From 688a8743b1c78c05d4cc710e64e714fad83da1a4 Mon Sep 17 00:00:00 2001 From: kaalibro Date: Tue, 16 Jan 2024 02:20:34 +0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20Add=20svg=20icon=20for?= =?UTF-8?q?=20"Create=20an=20upscaled=20version=20of=20the=20current=20ima?= =?UTF-8?q?ge"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- javascript/main.js | 2 +- src/scripts/replaceIcon.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript/main.js b/javascript/main.js index 1b93755..4f39f35 100644 --- a/javascript/main.js +++ b/javascript/main.js @@ -2551,7 +2551,7 @@ const le={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},se=(e=le } `,sidebar:t` height: calc(100vh - ${i}px); - `}))),Yue=64,Que=W.memo((()=>{const e=hne(dne,m5),{cx:t,styles:n}=Kue({headerHeight:Yue,isPrimaryColor:Boolean(e.primaryColor)});return W.useEffect((()=>{e.enableHighlight&&(()=>{try{dre("#txt2img_prompt","#lobe_txt2img_prompt"),dre("#img2img_prompt","#lobe_img2img_prompt"),window.ignore_ids_for_localization.lobe_highlighter="SPAN",fe.success("๐Ÿคฏ [module] inject - PromptHighlight")}catch(e){fe.error("๐Ÿคฏ [module] inject - PromptHighlight",e)}})(),e.enableImageInfo&&(()=>{try{sre("#html_info_txt2img","#lobe_html_info_txt2img"),sre("#html_info_img2img","#lobe_html_info_img2img"),fe.success("๐Ÿคฏ [module] inject - ImageInfo")}catch(e){fe.error("๐Ÿคฏ [module] inject - ImageInfo",e)}})(),e.svgIcon&&(()=>{for(const e of document.querySelectorAll("button"))pre(e,["๐Ÿ–Œ๏ธ"],'\n\n \n \n\n',16),pre(e,["๐Ÿ—ƒ๏ธ"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["๐Ÿ–ผ๏ธ"],'\n\n \n \n \n\n',16),pre(e,["๐ŸŽจ๏ธ"],'\n\n \n \n\n',16),pre(e,["๐Ÿ“‚"],'\n\n \n \n\n',16),pre(e,["๐Ÿ”„","๐Ÿ”","โ™ป๏ธ"],'\n\n \n \n \n \n\n',16),pre(e,["โ†™๏ธ"],'\n\n \n \n\n',16),pre(e,["โคด"],'\n\n \n \n\n',16),pre(e,["โ†•๏ธ"],'\n\n \n \n \n \n \n\n',16),pre(e,["๐Ÿ—‘๏ธ"],'\n\n \n \n \n\n',16),pre(e,["๐Ÿ“‹"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["๐Ÿ’พ"],'\n\n \n \n \n\n',16),pre(e,["๐ŸŽฒ๏ธ"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["๐Ÿช„"],'\n\n \n \n \n \n \n \n \n \n\n',16),pre(e,["โš™๏ธ"],'\n\n \n \n\n',16),pre(e,["โžก๏ธ"],fre,16),pre(e,["โ‡…"],'\n\n \n \n \n \n\n',16),pre(e,["โ‡„"],'\n\n \n \n \n \n\n',16),pre(e,["๐ŸŽด"],'\n\n \n \n\n',16),pre(e,["๐ŸŒ€"],'\n\n \n \n \n \n \n\n',16),pre(e,["๐Ÿ’ฅ"],'\n\n \n\n',16),pre(e,["๐Ÿ“ท"],'\n\n \n \n \n \n\n',16),pre(e,["๐Ÿ“"],'\n\n \n \n\n',16),pre(e,["๐Ÿ“"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["โฌ‡๏ธ"],'\n\n \n \n\n',16),pre(e,["โ†ฉ"],'\n\n \n \n\n',16),pre(e,["๐Ÿ“’"],'\n\n \n\n',16),pre(e,["๐Ÿ“Ž"],'\n\n \n\n',16),pre(e,["๐Ÿ“ฆ"],'\n\n \n \n \n\n',16),pre(e,["๐Ÿ’ž"],'\n\n \n \n \n \n \n\n',16);for(const e of document.querySelectorAll("span"))pre(e,["โคก"],'\n\n \n \n \n \n\n',36),pre(e,["โŠž"],'\n\n \n \n \n\n',36),pre(e,["๐Ÿ–ซ"],'\n\n \n \n \n\n',36),pre(e,["ร—"],'\n\n \n \n\n',36);for(const e of document.querySelectorAll("a"))pre(e,["โฎ"],'\n\n \n \n\n',36),pre(e,["โฏ"],fre,36);fe.success("๐Ÿคฏ [svgIcon] replace")})()}),[]),Z.jsxs(Z.Fragment,{children:[Z.jsx(jre,{}),Z.jsx(w3,{headerHeight:Yue,children:Z.jsx(Lse,{})}),Z.jsxs(x3,{children:[Z.jsx("div",{className:e.liteAnimation?n.backgroundLite:n.background}),e.enableSidebar&&Z.jsx(S3,{className:n.sidebar,headerHeight:Yue,style:{flex:0,zIndex:50},children:Z.jsx(Hse,{headerHeight:Yue})}),Z.jsx(Nre,{className:t(!e.enableSidebar&&n.quicksettings)}),Z.jsx(c8,{}),Z.jsx(Xue,{}),(null==e?void 0:e.enableExtraNetworkSidebar)&&Z.jsx(S3,{className:n.sidebar,headerHeight:Yue,style:{flex:0,zIndex:50},children:Z.jsx(qre,{headerHeight:Yue})})]}),Z.jsx(Qre,{})]})})),Jue=Que;var Zue,ede=W,tde=(Zue=ede)&&"object"==typeof Zue&&"default"in Zue?Zue.default:Zue;function nde(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rde=!("undefined"==typeof window||!window.document||!window.document.createElement);const ode=o((function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var o,i=[];function a(){o=e(i.map((function(e){return e.props}))),l.canUseDOM?t(o):n&&(o=n(o))}var l=function(e){var t,n;function l(){return e.apply(this,arguments)||this}n=e,(t=l).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,l.peek=function(){return o},l.rewind=function(){if(l.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=o;return o=void 0,i=[],e};var s=l.prototype;return s.UNSAFE_componentWillMount=function(){i.push(this),a()},s.componentDidUpdate=function(){a()},s.componentWillUnmount=function(){var e=i.indexOf(this);i.splice(e,1),a()},s.render=function(){return tde.createElement(r,this.props)},l}(ede.PureComponent);return nde(l,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),nde(l,"canUseDOM",rde),l}}));var ide="undefined"!=typeof Element,ade="function"==typeof Map,lde="function"==typeof Set,sde="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function cde(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!cde(e[r],t[r]))return!1;return!0}if(ade&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!cde(r.value[1],t.get(r.value[0])))return!1;return!0}if(lde&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(sde&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(ide&&e instanceof Element)return!1;for(r=n;0!=r--;)if(("_owner"!==o[r]&&"__v"!==o[r]&&"__o"!==o[r]||!e.$$typeof)&&!cde(e[o[r]],t[o[r]]))return!1;return!0}return e!=e&&t!=t}var ude=function(e,t){try{return cde(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const dde=o(ude); + `}))),Yue=64,Que=W.memo((()=>{const e=hne(dne,m5),{cx:t,styles:n}=Kue({headerHeight:Yue,isPrimaryColor:Boolean(e.primaryColor)});return W.useEffect((()=>{e.enableHighlight&&(()=>{try{dre("#txt2img_prompt","#lobe_txt2img_prompt"),dre("#img2img_prompt","#lobe_img2img_prompt"),window.ignore_ids_for_localization.lobe_highlighter="SPAN",fe.success("๐Ÿคฏ [module] inject - PromptHighlight")}catch(e){fe.error("๐Ÿคฏ [module] inject - PromptHighlight",e)}})(),e.enableImageInfo&&(()=>{try{sre("#html_info_txt2img","#lobe_html_info_txt2img"),sre("#html_info_img2img","#lobe_html_info_img2img"),fe.success("๐Ÿคฏ [module] inject - ImageInfo")}catch(e){fe.error("๐Ÿคฏ [module] inject - ImageInfo",e)}})(),e.svgIcon&&(()=>{for(const e of document.querySelectorAll("button"))pre(e,["๐Ÿ–Œ๏ธ"],'\n\n \n \n\n',16),pre(e,["๐Ÿ—ƒ๏ธ"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["๐Ÿ–ผ๏ธ"],'\n\n \n \n \n\n',16),pre(e,["๐ŸŽจ๏ธ"],'\n\n \n \n\n',16),pre(e,["๐Ÿ“‚"],'\n\n \n \n\n',16),pre(e,["๐Ÿ”„","๐Ÿ”","โ™ป๏ธ"],'\n\n \n \n \n \n\n',16),pre(e,["โ†™๏ธ"],'\n\n \n \n\n',16),pre(e,["โคด"],'\n\n \n \n\n',16),pre(e,["โ†•๏ธ"],'\n\n \n \n \n \n \n\n',16),pre(e,["๐Ÿ—‘๏ธ"],'\n\n \n \n \n\n',16),pre(e,["๐Ÿ“‹"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["๐Ÿ’พ"],'\n\n \n \n \n\n',16),pre(e,["๐ŸŽฒ๏ธ"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["๐Ÿช„"],'\n\n \n \n \n \n \n \n \n \n\n',16),pre(e,["โš™๏ธ"],'\n\n \n \n\n',16),pre(e,["โžก๏ธ"],fre,16),pre(e,["โ‡…"],'\n\n \n \n \n \n\n',16),pre(e,["โ‡„"],'\n\n \n \n \n \n\n',16),pre(e,["๐ŸŽด"],'\n\n \n \n\n',16),pre(e,["๐ŸŒ€"],'\n\n \n \n \n \n \n\n',16),pre(e,["๐Ÿ’ฅ"],'\n\n \n\n',16),pre(e,["๐Ÿ“ท"],'\n\n \n \n \n \n\n',16),pre(e,["๐Ÿ“"],'\n\n \n \n\n',16),pre(e,["๐Ÿ“"],'\n\n \n \n \n \n \n \n\n',16),pre(e,["โฌ‡๏ธ"],'\n\n \n \n\n',16),pre(e,["โ†ฉ"],'\n\n \n \n\n',16),pre(e,["๐Ÿ“’"],'\n\n \n\n',16),pre(e,["๐Ÿ“Ž"],'\n\n \n\n',16),pre(e,["๐Ÿ“ฆ"],'\n\n \n \n \n\n',16),pre(e,["๐Ÿ’ž"],'\n\n \n \n \n \n \n\n',16),pre(e,["โœจ"],'\n\n \n \n \n \n\n',16);for(const e of document.querySelectorAll("span"))pre(e,["โคก"],'\n\n \n \n \n \n\n',36),pre(e,["โŠž"],'\n\n \n \n \n\n',36),pre(e,["๐Ÿ–ซ"],'\n\n \n \n \n\n',36),pre(e,["ร—"],'\n\n \n \n\n',36);for(const e of document.querySelectorAll("a"))pre(e,["โฎ"],'\n\n \n \n\n',36),pre(e,["โฏ"],fre,36);fe.success("๐Ÿคฏ [svgIcon] replace")})()}),[]),Z.jsxs(Z.Fragment,{children:[Z.jsx(jre,{}),Z.jsx(w3,{headerHeight:Yue,children:Z.jsx(Lse,{})}),Z.jsxs(x3,{children:[Z.jsx("div",{className:e.liteAnimation?n.backgroundLite:n.background}),e.enableSidebar&&Z.jsx(S3,{className:n.sidebar,headerHeight:Yue,style:{flex:0,zIndex:50},children:Z.jsx(Hse,{headerHeight:Yue})}),Z.jsx(Nre,{className:t(!e.enableSidebar&&n.quicksettings)}),Z.jsx(c8,{}),Z.jsx(Xue,{}),(null==e?void 0:e.enableExtraNetworkSidebar)&&Z.jsx(S3,{className:n.sidebar,headerHeight:Yue,style:{flex:0,zIndex:50},children:Z.jsx(qre,{headerHeight:Yue})})]}),Z.jsx(Qre,{})]})})),Jue=Que;var Zue,ede=W,tde=(Zue=ede)&&"object"==typeof Zue&&"default"in Zue?Zue.default:Zue;function nde(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rde=!("undefined"==typeof window||!window.document||!window.document.createElement);const ode=o((function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var o,i=[];function a(){o=e(i.map((function(e){return e.props}))),l.canUseDOM?t(o):n&&(o=n(o))}var l=function(e){var t,n;function l(){return e.apply(this,arguments)||this}n=e,(t=l).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,l.peek=function(){return o},l.rewind=function(){if(l.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=o;return o=void 0,i=[],e};var s=l.prototype;return s.UNSAFE_componentWillMount=function(){i.push(this),a()},s.componentDidUpdate=function(){a()},s.componentWillUnmount=function(){var e=i.indexOf(this);i.splice(e,1),a()},s.render=function(){return tde.createElement(r,this.props)},l}(ede.PureComponent);return nde(l,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),nde(l,"canUseDOM",rde),l}}));var ide="undefined"!=typeof Element,ade="function"==typeof Map,lde="function"==typeof Set,sde="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function cde(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!cde(e[r],t[r]))return!1;return!0}if(ade&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!cde(r.value[1],t.get(r.value[0])))return!1;return!0}if(lde&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(sde&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(ide&&e instanceof Element)return!1;for(r=n;0!=r--;)if(("_owner"!==o[r]&&"__v"!==o[r]&&"__o"!==o[r]||!e.$$typeof)&&!cde(e[o[r]],t[o[r]]))return!1;return!0}return e!=e&&t!=t}var ude=function(e,t){try{return cde(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const dde=o(ude); /* object-assign (c) Sindre Sorhus diff --git a/src/scripts/replaceIcon.ts b/src/scripts/replaceIcon.ts index 8381fc5..ad94a4d 100644 --- a/src/scripts/replaceIcon.ts +++ b/src/scripts/replaceIcon.ts @@ -27,6 +27,7 @@ import { Play, RefreshCcw, Save, + Scaling, Settings, Share2, SquarePen, @@ -80,6 +81,7 @@ export default () => { replaceIcon(button, ['๐Ÿ“Ž'], Paperclip, 16); replaceIcon(button, ['๐Ÿ“ฆ'], Box, 16); replaceIcon(button, ['๐Ÿ’ž'], Share2, 16); + replaceIcon(button, ['โœจ'], Scaling, 16); } for (const span of document.querySelectorAll('span')) {