@lingshugroup/web-plus 0.0.7-beta → 0.0.9-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.cjs +1 -1
  2. package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.js +4 -4
  3. package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.js.br +0 -0
  4. package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.js.gz +0 -0
  5. package/package.json +116 -2
  6. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/__commonjsHelpers__-f3sTPFkQ/index.cjs +0 -1
  7. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/__commonjsHelpers__-f3sTPFkQ/index.js +0 -11
  8. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/full-width-button-handler-wnoSIg42/index.cjs +0 -1
  9. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/full-width-button-handler-wnoSIg42/index.js +0 -7
  10. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.cjs +0 -15
  11. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.js +0 -598
  12. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.js.br +0 -0
  13. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.js.gz +0 -0
  14. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.cjs +0 -117
  15. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.js +0 -121
  16. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.js.br +0 -0
  17. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.js.gz +0 -0
  18. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/styles-handler-G8NSk43t/index.cjs +0 -1
  19. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/styles-handler-G8NSk43t/index.js +0 -18
  20. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.cjs +0 -167
  21. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.js +0 -47804
  22. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.js.br +0 -0
  23. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.js.gz +0 -0
  24. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.cjs +0 -8
  25. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.js +0 -551
  26. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.js.br +0 -0
  27. package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.js.gz +0 -0
@@ -1,8 +0,0 @@
1
- "use strict";var z=Object.defineProperty;var a=(s,t)=>z(s,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});/*!
2
- * vanilla-picker v2.12.2
3
- * https://vanilla-picker.js.org
4
- *
5
- * Copyright 2017-2023 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
6
- * Released under the ISC license.
7
- */var O=a(function(s,t){if(!(s instanceof t))throw new TypeError("Cannot call a class as a function")},"O"),R=function(){function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return a(s,"l"),function(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),t}}(),y=function(){function s(t,e){var r=[],n=!0,o=!1,u=void 0;try{for(var c=t[Symbol.iterator](),i;!(n=(i=c.next()).done)&&(r.push(i.value),!(e&&r.length===e));n=!0);}catch(p){o=!0,u=p}finally{try{!n&&c.return&&c.return()}finally{if(o)throw u}}return r}return a(s,"l"),function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return s(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();String.prototype.startsWith=String.prototype.startsWith||function(s){return this.indexOf(s)===0};String.prototype.padStart=String.prototype.padStart||function(s,t){for(var e=this;e.length<s;)e=t+e;return e};var I={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function $(s){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,e=t>0?s.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):s.toString();return e||"0"}a($,"A");var q=function(){function s(t,e,r,n){O(this,s);var o=this;function u(i){if(i.startsWith("hsl")){var p=i.match(/([\-\d\.e]+)/g).map(Number),l=y(p,4),d=l[0],f=l[1],b=l[2],g=l[3];g===void 0&&(g=1),d/=360,f/=100,b/=100,o.hsla=[d,f,b,g]}else if(i.startsWith("rgb")){var _=i.match(/([\-\d\.e]+)/g).map(Number),h=y(_,4),k=h[0],S=h[1],w=h[2],v=h[3];v===void 0&&(v=1),o.rgba=[k,S,w,v]}else i.startsWith("#")?o.rgba=s.hexToRgb(i):o.rgba=s.nameToRgb(i)||s.hexToRgb(i)}if(a(u,"o"),t!==void 0)if(Array.isArray(t))this.rgba=t;else if(r===void 0){var c=t&&""+t;c&&u(c.toLowerCase())}else this.rgba=[t,e,r,n===void 0?1:n]}return a(s,"l"),R(s,[{key:"printRGB",value:a(function(t){var e=t?this.rgba:this.rgba.slice(0,3),r=e.map(function(n,o){return $(n,o===3?3:0)});return t?"rgba("+r+")":"rgb("+r+")"},"value")},{key:"printHSL",value:a(function(t){var e=[360,100,100,1],r=["","%","%",""],n=t?this.hsla:this.hsla.slice(0,3),o=n.map(function(u,c){return $(u*e[c],c===3?3:1)+r[c]});return t?"hsla("+o+")":"hsl("+o+")"},"value")},{key:"printHex",value:a(function(t){var e=this.hex;return t?e:e.substring(0,7)},"value")},{key:"rgba",get:a(function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=s.hslToRgb(this._hsla)},"get"),set:a(function(t){t.length===3&&(t[3]=1),this._rgba=t,this._hsla=null},"set")},{key:"rgbString",get:a(function(){return this.printRGB()},"get")},{key:"rgbaString",get:a(function(){return this.printRGB(!0)},"get")},{key:"hsla",get:a(function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=s.rgbToHsl(this._rgba)},"get"),set:a(function(t){t.length===3&&(t[3]=1),this._hsla=t,this._rgba=null},"set")},{key:"hslString",get:a(function(){return this.printHSL()},"get")},{key:"hslaString",get:a(function(){return this.printHSL(!0)},"get")},{key:"hex",get:a(function(){var t=this.rgba,e=t.map(function(r,n){return n<3?r.toString(16):Math.round(r*255).toString(16)});return"#"+e.map(function(r){return r.padStart(2,"0")}).join("")},"get"),set:a(function(t){this.rgba=s.hexToRgb(t)},"set")}],[{key:"hexToRgb",value:a(function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var r=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(n){return parseInt(n,16)});return r[3]=r[3]/255,r},"value")},{key:"nameToRgb",value:a(function(t){var e=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=I[e];return r===void 0?r:s.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))},"value")},{key:"rgbToHsl",value:a(function(t){var e=y(t,4),r=e[0],n=e[1],o=e[2],u=e[3];r/=255,n/=255,o/=255;var c=Math.max(r,n,o),i=Math.min(r,n,o),p=void 0,l=void 0,d=(c+i)/2;if(c===i)p=l=0;else{var f=c-i;switch(l=d>.5?f/(2-c-i):f/(c+i),c){case r:p=(n-o)/f+(n<o?6:0);break;case n:p=(o-r)/f+2;break;case o:p=(r-n)/f+4;break}p/=6}return[p,l,d,u]},"value")},{key:"hslToRgb",value:a(function(t){var e=y(t,4),r=e[0],n=e[1],o=e[2],u=e[3],c=void 0,i=void 0,p=void 0;if(n===0)c=i=p=o;else{var l=a(function(g,_,h){return h<0&&(h+=1),h>1&&(h-=1),h<.16666666666666666?g+(_-g)*6*h:h<.5?_:h<.6666666666666666?g+(_-g)*(.6666666666666666-h)*6:g},"u"),d=o<.5?o*(1+n):o+n-o*n,f=2*o-d;c=l(f,d,r+1/3),i=l(f,d,r),p=l(f,d,r-1/3)}var b=[c*255,i*255,p*255].map(Math.round);return b[3]=u,b},"value")}]),s}(),B=function(){function s(){O(this,s),this._events=[]}return a(s,"l"),R(s,[{key:"add",value:a(function(t,e,r){t.addEventListener(e,r,!1),this._events.push({target:t,type:e,handler:r})},"value")},{key:"remove",value:a(function(t,e,r){this._events=this._events.filter(function(n){var o=!0;return t&&t!==n.target&&(o=!1),e&&e!==n.type&&(o=!1),r&&r!==n.handler&&(o=!1),o&&s._doRemove(n.target,n.type,n.handler),!o})},"value")},{key:"destroy",value:a(function(){this._events.forEach(function(t){return s._doRemove(t.target,t.type,t.handler)}),this._events=[]},"value")}],[{key:"_doRemove",value:a(function(t,e,r){t.removeEventListener(e,r,!1)},"value")}]),s}();function F(s){var t=document.createElement("div");return t.innerHTML=s,t.firstElementChild}a(F,"U");function C(s,t,e){var r=!1;function n(i,p,l){return Math.max(p,Math.min(i,l))}a(n,"r");function o(i,p,l){if(l&&(r=!0),!!r){i.preventDefault();var d=t.getBoundingClientRect(),f=d.width,b=d.height,g=p.clientX,_=p.clientY,h=n(g-d.left,0,f),k=n(_-d.top,0,b);e(h/f,k/b)}}a(o,"n");function u(i,p){var l=i.buttons===void 0?i.which:i.buttons;l===1?o(i,i,p):r=!1}a(u,"o");function c(i,p){i.touches.length===1?o(i,i.touches[0],p):r=!1}a(c,"c"),s.add(t,"mousedown",function(i){u(i,!0)}),s.add(t,"touchstart",function(i){c(i,!0)}),s.add(window,"mousemove",u),s.add(t,"touchmove",c),s.add(window,"mouseup",function(i){r=!1}),s.add(t,"touchend",function(i){r=!1}),s.add(t,"touchcancel",function(i){r=!1})}a(C,"L");var W=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
8
- linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,j=360,A="keydown",x="mousedown",D="focusin";function m(s,t){return(t||document).querySelector(s)}a(m,"_");function N(s){s.preventDefault(),s.stopPropagation()}a(N,"M");function T(s,t,e,r,n){s.add(t,A,function(o){e.indexOf(o.key)>=0&&r(o)})}a(T,"H");var M=function(){function s(t){O(this,s),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new B,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return a(s,"l"),R(s,[{key:"setOptions",value:a(function(t){var e=this;if(!t)return;var r=this.settings;function n(i,p,l){for(var d in i)p[d]=i[d]}if(a(n,"n"),t instanceof HTMLElement)r.parent=t;else{r.parent&&t.parent&&r.parent!==t.parent&&(this._events.remove(r.parent),this._popupInited=!1),n(t,r),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var o=t.color||t.colour;o&&this._setColor(o)}var u=r.parent;if(u&&r.popup&&!this._popupInited){var c=a(function(i){return e.openHandler(i)},"a");this._events.add(u,"click",c),T(this._events,u,[" ","Spacebar","Enter"],c),this._popupInited=!0}else t.parent&&!r.popup&&this.show()},"value")},{key:"openHandler",value:a(function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===A?this._domEdit:this.domElement;setTimeout(function(){return e.focus()},100),this.onOpen&&this.onOpen(this.colour)}},"value")},{key:"closeHandler",value:a(function(t){var e=t&&t.type,r=!1;if(!t)r=!0;else if(e===x||e===D){var n=(this.__containedEvent||0)+100;t.timeStamp>n&&(r=!0)}else N(t),r=!0;r&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==x&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))},"value")},{key:"movePopup",value:a(function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()},"value")},{key:"setColor",value:a(function(t,e){this._setColor(t,{silent:e})},"value")},{key:"_setColor",value:a(function(t,e){if(typeof t=="string"&&(t=t.trim()),!!t){e=e||{};var r=void 0;try{r=new q(t)}catch(o){if(e.failSilently)return;throw o}if(!this.settings.alpha){var n=r.hsla;n[3]=1,r.hsla=n}this.colour=this.color=r,this._setHSLA(null,null,null,null,e)}},"value")},{key:"setColour",value:a(function(t,e){this.setColor(t,e)},"value")},{key:"show",value:a(function(){var t=this.settings.parent;if(!t)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',n=F(r);return this.domElement=n,this._domH=m(".picker_hue",n),this._domSL=m(".picker_sl",n),this._domA=m(".picker_alpha",n),this._domEdit=m(".picker_editor input",n),this._domSample=m(".picker_sample",n),this._domOkay=m(".picker_done button",n),this._domCancel=m(".picker_cancel button",n),n.classList.add("layout_"+this.settings.layout),this.settings.alpha||n.classList.add("no_alpha"),this.settings.editor||n.classList.add("no_editor"),this.settings.cancelButton||n.classList.add("no_cancel"),this._ifPopup(function(){return n.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0},"value")},{key:"hide",value:a(function(){return this._toggleDOM(!1)},"value")},{key:"destroy",value:a(function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)},"value")},{key:"_bindEvents",value:a(function(){var t=this,e=this,r=this.domElement,n=this._events;function o(i,p,l){n.add(i,p,l)}a(o,"o"),o(r,"click",function(i){return i.preventDefault()}),C(n,this._domH,function(i,p){return e._setHSLA(i)}),C(n,this._domSL,function(i,p){return e._setHSLA(null,i,1-p)}),this.settings.alpha&&C(n,this._domA,function(i,p){return e._setHSLA(null,null,null,1-p)});var u=this._domEdit;o(u,"input",function(i){e._setColor(this.value,{fromEditor:!0,failSilently:!0})}),o(u,"focus",function(i){var p=this;p.selectionStart===p.selectionEnd&&p.select()}),this._ifPopup(function(){var i=a(function(l){return t.closeHandler(l)},"s");o(window,x,i),o(window,D,i),T(n,r,["Esc","Escape"],i);var p=a(function(l){t.__containedEvent=l.timeStamp},"p");o(r,x,p),o(r,D,p),o(t._domCancel,"click",i)});var c=a(function(i){t._ifPopup(function(){return t.closeHandler(i)}),t.onDone&&t.onDone(t.colour)},"a");o(this._domOkay,"click",c),T(n,r,["Enter"],c)},"value")},{key:"_setPosition",value:a(function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup(function(r){getComputedStyle(t).position==="static"&&(t.style.position="relative");var n=r===!0?"popup_right":"popup_"+r;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(o){o===n?e.classList.add(o):e.classList.remove(o)}),e.classList.add(n)})},"value")},{key:"_setHSLA",value:a(function(t,e,r,n,o){o=o||{};var u=this.colour,c=u.hsla;[t,e,r,n].forEach(function(i,p){(i||i===0)&&(c[p]=i)}),u.hsla=c,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(u)},"value")},{key:"_updateUI",value:a(function(t){if(!this.domElement)return;t=t||{};var e=this.colour,r=e.hsla,n="hsl("+r[0]*j+", 100%, 50%)",o=e.hslString,u=e.hslaString,c=this._domH,i=this._domSL,p=this._domA,l=m(".picker_selector",c),d=m(".picker_selector",i),f=m(".picker_selector",p);function b(P,E,L){E.style.left=L*100+"%"}a(b,"b");function g(P,E,L){E.style.top=L*100+"%"}a(g,"m"),b(c,l,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,b(i,d,r[1]),g(i,d,1-r[2]),i.style.color=o,g(p,f,1-r[3]);var _=o,h=_.replace("hsl","hsla").replace(")",", 0)"),k="linear-gradient("+[_,h]+")";if(this._domA.style.background=k+", "+W,!t.fromEditor){var S=this.settings.editorFormat,w=this.settings.alpha,v=void 0;switch(S){case"rgb":v=e.printRGB(w);break;case"hsl":v=e.printHSL(w);break;default:v=e.printHex(w)}this._domEdit.value=v}this._domSample.style.color=u},"value")},{key:"_ifPopup",value:a(function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()},"value")},{key:"_toggleDOM",value:a(function(t){var e=this.domElement;if(!e)return!1;var r=t?"":"none",n=e.style.display!==r;return n&&(e.style.display=r),n},"value")}]),s}();{var H=document.createElement("style");H.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(H),M.StyleElement=H}exports.default=M;
@@ -1,551 +0,0 @@
1
- var P = Object.defineProperty;
2
- var a = (s, t) => P(s, "name", { value: t, configurable: !0 });
3
- /*!
4
- * vanilla-picker v2.12.2
5
- * https://vanilla-picker.js.org
6
- *
7
- * Copyright 2017-2023 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
8
- * Released under the ISC license.
9
- */
10
- var O = /* @__PURE__ */ a(function(s, t) {
11
- if (!(s instanceof t))
12
- throw new TypeError("Cannot call a class as a function");
13
- }, "O"), R = /* @__PURE__ */ function() {
14
- function s(t, e) {
15
- for (var r = 0; r < e.length; r++) {
16
- var n = e[r];
17
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
18
- }
19
- }
20
- return a(s, "l"), function(t, e, r) {
21
- return e && s(t.prototype, e), r && s(t, r), t;
22
- };
23
- }(), y = /* @__PURE__ */ function() {
24
- function s(t, e) {
25
- var r = [], n = !0, o = !1, u = void 0;
26
- try {
27
- for (var c = t[Symbol.iterator](), i; !(n = (i = c.next()).done) && (r.push(i.value), !(e && r.length === e)); n = !0)
28
- ;
29
- } catch (p) {
30
- o = !0, u = p;
31
- } finally {
32
- try {
33
- !n && c.return && c.return();
34
- } finally {
35
- if (o)
36
- throw u;
37
- }
38
- }
39
- return r;
40
- }
41
- return a(s, "l"), function(t, e) {
42
- if (Array.isArray(t))
43
- return t;
44
- if (Symbol.iterator in Object(t))
45
- return s(t, e);
46
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
47
- };
48
- }();
49
- String.prototype.startsWith = String.prototype.startsWith || function(s) {
50
- return this.indexOf(s) === 0;
51
- };
52
- String.prototype.padStart = String.prototype.padStart || function(s, t) {
53
- for (var e = this; e.length < s; )
54
- e = t + e;
55
- return e;
56
- };
57
- var z = { cb: "0f8ff", tqw: "aebd7", q: "-ffff", qmrn: "7fffd4", zr: "0ffff", bg: "5f5dc", bsq: "e4c4", bck: "---", nch: "ebcd", b: "--ff", bvt: "8a2be2", brwn: "a52a2a", brw: "deb887", ctb: "5f9ea0", hrt: "7fff-", chcT: "d2691e", cr: "7f50", rnw: "6495ed", crns: "8dc", crms: "dc143c", cn: "-ffff", Db: "--8b", Dcn: "-8b8b", Dgnr: "b8860b", Dgr: "a9a9a9", Dgrn: "-64-", Dkhk: "bdb76b", Dmgn: "8b-8b", Dvgr: "556b2f", Drng: "8c-", Drch: "9932cc", Dr: "8b--", Dsmn: "e9967a", Dsgr: "8fbc8f", DsTb: "483d8b", DsTg: "2f4f4f", Dtrq: "-ced1", Dvt: "94-d3", ppnk: "1493", pskb: "-bfff", mgr: "696969", grb: "1e90ff", rbrc: "b22222", rwht: "af0", stg: "228b22", chs: "-ff", gnsb: "dcdcdc", st: "8f8ff", g: "d7-", gnr: "daa520", gr: "808080", grn: "-8-0", grnw: "adff2f", hnw: "0fff0", htpn: "69b4", nnr: "cd5c5c", ng: "4b-82", vr: "0", khk: "0e68c", vnr: "e6e6fa", nrb: "0f5", wngr: "7cfc-", mnch: "acd", Lb: "add8e6", Lcr: "08080", Lcn: "e0ffff", Lgnr: "afad2", Lgr: "d3d3d3", Lgrn: "90ee90", Lpnk: "b6c1", Lsmn: "a07a", Lsgr: "20b2aa", Lskb: "87cefa", LsTg: "778899", Lstb: "b0c4de", Lw: "e0", m: "-ff-", mgrn: "32cd32", nn: "af0e6", mgnt: "-ff", mrn: "8--0", mqm: "66cdaa", mmb: "--cd", mmrc: "ba55d3", mmpr: "9370db", msg: "3cb371", mmsT: "7b68ee", "": "-fa9a", mtr: "48d1cc", mmvt: "c71585", mnLb: "191970", ntc: "5fffa", mstr: "e4e1", mccs: "e4b5", vjw: "dead", nv: "--80", c: "df5e6", v: "808-0", vrb: "6b8e23", rng: "a5-", rngr: "45-", rch: "da70d6", pgnr: "eee8aa", pgrn: "98fb98", ptrq: "afeeee", pvtr: "db7093", ppwh: "efd5", pchp: "dab9", pr: "cd853f", pnk: "c0cb", pm: "dda0dd", pwrb: "b0e0e6", prp: "8-080", cc: "663399", r: "--", sbr: "bc8f8f", rb: "4169e1", sbrw: "8b4513", smn: "a8072", nbr: "4a460", sgrn: "2e8b57", ssh: "5ee", snn: "a0522d", svr: "c0c0c0", skb: "87ceeb", sTb: "6a5acd", sTgr: "708090", snw: "afa", n: "-ff7f", stb: "4682b4", tn: "d2b48c", t: "-8080", thst: "d8bfd8", tmT: "6347", trqs: "40e0d0", vt: "ee82ee", whT: "5deb3", wht: "", hts: "5f5f5", w: "-", wgrn: "9acd32" };
58
- function $(s) {
59
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, e = t > 0 ? s.toFixed(t).replace(/0+$/, "").replace(/\.$/, "") : s.toString();
60
- return e || "0";
61
- }
62
- a($, "A");
63
- var I = function() {
64
- function s(t, e, r, n) {
65
- O(this, s);
66
- var o = this;
67
- function u(i) {
68
- if (i.startsWith("hsl")) {
69
- var p = i.match(/([\-\d\.e]+)/g).map(Number), l = y(p, 4), d = l[0], f = l[1], b = l[2], g = l[3];
70
- g === void 0 && (g = 1), d /= 360, f /= 100, b /= 100, o.hsla = [d, f, b, g];
71
- } else if (i.startsWith("rgb")) {
72
- var _ = i.match(/([\-\d\.e]+)/g).map(Number), h = y(_, 4), k = h[0], E = h[1], w = h[2], v = h[3];
73
- v === void 0 && (v = 1), o.rgba = [k, E, w, v];
74
- } else
75
- i.startsWith("#") ? o.rgba = s.hexToRgb(i) : o.rgba = s.nameToRgb(i) || s.hexToRgb(i);
76
- }
77
- if (a(u, "o"), t !== void 0)
78
- if (Array.isArray(t))
79
- this.rgba = t;
80
- else if (r === void 0) {
81
- var c = t && "" + t;
82
- c && u(c.toLowerCase());
83
- } else
84
- this.rgba = [t, e, r, n === void 0 ? 1 : n];
85
- }
86
- return a(s, "l"), R(s, [{
87
- key: "printRGB",
88
- value: /* @__PURE__ */ a(function(t) {
89
- var e = t ? this.rgba : this.rgba.slice(0, 3), r = e.map(function(n, o) {
90
- return $(n, o === 3 ? 3 : 0);
91
- });
92
- return t ? "rgba(" + r + ")" : "rgb(" + r + ")";
93
- }, "value")
94
- }, {
95
- key: "printHSL",
96
- value: /* @__PURE__ */ a(function(t) {
97
- var e = [360, 100, 100, 1], r = ["", "%", "%", ""], n = t ? this.hsla : this.hsla.slice(0, 3), o = n.map(function(u, c) {
98
- return $(u * e[c], c === 3 ? 3 : 1) + r[c];
99
- });
100
- return t ? "hsla(" + o + ")" : "hsl(" + o + ")";
101
- }, "value")
102
- }, {
103
- key: "printHex",
104
- value: /* @__PURE__ */ a(function(t) {
105
- var e = this.hex;
106
- return t ? e : e.substring(0, 7);
107
- }, "value")
108
- }, {
109
- key: "rgba",
110
- get: /* @__PURE__ */ a(function() {
111
- if (this._rgba)
112
- return this._rgba;
113
- if (!this._hsla)
114
- throw new Error("No color is set");
115
- return this._rgba = s.hslToRgb(this._hsla);
116
- }, "get"),
117
- set: /* @__PURE__ */ a(function(t) {
118
- t.length === 3 && (t[3] = 1), this._rgba = t, this._hsla = null;
119
- }, "set")
120
- }, {
121
- key: "rgbString",
122
- get: /* @__PURE__ */ a(function() {
123
- return this.printRGB();
124
- }, "get")
125
- }, {
126
- key: "rgbaString",
127
- get: /* @__PURE__ */ a(function() {
128
- return this.printRGB(!0);
129
- }, "get")
130
- }, {
131
- key: "hsla",
132
- get: /* @__PURE__ */ a(function() {
133
- if (this._hsla)
134
- return this._hsla;
135
- if (!this._rgba)
136
- throw new Error("No color is set");
137
- return this._hsla = s.rgbToHsl(this._rgba);
138
- }, "get"),
139
- set: /* @__PURE__ */ a(function(t) {
140
- t.length === 3 && (t[3] = 1), this._hsla = t, this._rgba = null;
141
- }, "set")
142
- }, {
143
- key: "hslString",
144
- get: /* @__PURE__ */ a(function() {
145
- return this.printHSL();
146
- }, "get")
147
- }, {
148
- key: "hslaString",
149
- get: /* @__PURE__ */ a(function() {
150
- return this.printHSL(!0);
151
- }, "get")
152
- }, {
153
- key: "hex",
154
- get: /* @__PURE__ */ a(function() {
155
- var t = this.rgba, e = t.map(function(r, n) {
156
- return n < 3 ? r.toString(16) : Math.round(r * 255).toString(16);
157
- });
158
- return "#" + e.map(function(r) {
159
- return r.padStart(2, "0");
160
- }).join("");
161
- }, "get"),
162
- set: /* @__PURE__ */ a(function(t) {
163
- this.rgba = s.hexToRgb(t);
164
- }, "set")
165
- }], [{
166
- key: "hexToRgb",
167
- value: /* @__PURE__ */ a(function(t) {
168
- var e = (t.startsWith("#") ? t.slice(1) : t).replace(/^(\w{3})$/, "$1F").replace(/^(\w)(\w)(\w)(\w)$/, "$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/, "$1FF");
169
- if (!e.match(/^([0-9a-fA-F]{8})$/))
170
- throw new Error("Unknown hex color; " + t);
171
- var r = e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(n) {
172
- return parseInt(n, 16);
173
- });
174
- return r[3] = r[3] / 255, r;
175
- }, "value")
176
- }, {
177
- key: "nameToRgb",
178
- value: /* @__PURE__ */ a(function(t) {
179
- var e = t.toLowerCase().replace("at", "T").replace(/[aeiouyldf]/g, "").replace("ght", "L").replace("rk", "D").slice(-5, 4), r = z[e];
180
- return r === void 0 ? r : s.hexToRgb(r.replace(/\-/g, "00").padStart(6, "f"));
181
- }, "value")
182
- }, {
183
- key: "rgbToHsl",
184
- value: /* @__PURE__ */ a(function(t) {
185
- var e = y(t, 4), r = e[0], n = e[1], o = e[2], u = e[3];
186
- r /= 255, n /= 255, o /= 255;
187
- var c = Math.max(r, n, o), i = Math.min(r, n, o), p = void 0, l = void 0, d = (c + i) / 2;
188
- if (c === i)
189
- p = l = 0;
190
- else {
191
- var f = c - i;
192
- switch (l = d > 0.5 ? f / (2 - c - i) : f / (c + i), c) {
193
- case r:
194
- p = (n - o) / f + (n < o ? 6 : 0);
195
- break;
196
- case n:
197
- p = (o - r) / f + 2;
198
- break;
199
- case o:
200
- p = (r - n) / f + 4;
201
- break;
202
- }
203
- p /= 6;
204
- }
205
- return [p, l, d, u];
206
- }, "value")
207
- }, {
208
- key: "hslToRgb",
209
- value: /* @__PURE__ */ a(function(t) {
210
- var e = y(t, 4), r = e[0], n = e[1], o = e[2], u = e[3], c = void 0, i = void 0, p = void 0;
211
- if (n === 0)
212
- c = i = p = o;
213
- else {
214
- var l = /* @__PURE__ */ a(function(g, _, h) {
215
- return h < 0 && (h += 1), h > 1 && (h -= 1), h < 0.16666666666666666 ? g + (_ - g) * 6 * h : h < 0.5 ? _ : h < 0.6666666666666666 ? g + (_ - g) * (0.6666666666666666 - h) * 6 : g;
216
- }, "u"), d = o < 0.5 ? o * (1 + n) : o + n - o * n, f = 2 * o - d;
217
- c = l(f, d, r + 1 / 3), i = l(f, d, r), p = l(f, d, r - 1 / 3);
218
- }
219
- var b = [c * 255, i * 255, p * 255].map(Math.round);
220
- return b[3] = u, b;
221
- }, "value")
222
- }]), s;
223
- }(), q = function() {
224
- function s() {
225
- O(this, s), this._events = [];
226
- }
227
- return a(s, "l"), R(s, [{
228
- key: "add",
229
- value: /* @__PURE__ */ a(function(t, e, r) {
230
- t.addEventListener(e, r, !1), this._events.push({
231
- target: t,
232
- type: e,
233
- handler: r
234
- });
235
- }, "value")
236
- }, {
237
- key: "remove",
238
- value: /* @__PURE__ */ a(function(t, e, r) {
239
- this._events = this._events.filter(function(n) {
240
- var o = !0;
241
- return t && t !== n.target && (o = !1), e && e !== n.type && (o = !1), r && r !== n.handler && (o = !1), o && s._doRemove(n.target, n.type, n.handler), !o;
242
- });
243
- }, "value")
244
- }, {
245
- key: "destroy",
246
- value: /* @__PURE__ */ a(function() {
247
- this._events.forEach(function(t) {
248
- return s._doRemove(t.target, t.type, t.handler);
249
- }), this._events = [];
250
- }, "value")
251
- }], [{
252
- key: "_doRemove",
253
- value: /* @__PURE__ */ a(function(t, e, r) {
254
- t.removeEventListener(e, r, !1);
255
- }, "value")
256
- }]), s;
257
- }();
258
- function B(s) {
259
- var t = document.createElement("div");
260
- return t.innerHTML = s, t.firstElementChild;
261
- }
262
- a(B, "U");
263
- function C(s, t, e) {
264
- var r = !1;
265
- function n(i, p, l) {
266
- return Math.max(p, Math.min(i, l));
267
- }
268
- a(n, "r");
269
- function o(i, p, l) {
270
- if (l && (r = !0), !!r) {
271
- i.preventDefault();
272
- var d = t.getBoundingClientRect(), f = d.width, b = d.height, g = p.clientX, _ = p.clientY, h = n(g - d.left, 0, f), k = n(_ - d.top, 0, b);
273
- e(h / f, k / b);
274
- }
275
- }
276
- a(o, "n");
277
- function u(i, p) {
278
- var l = i.buttons === void 0 ? i.which : i.buttons;
279
- l === 1 ? o(i, i, p) : r = !1;
280
- }
281
- a(u, "o");
282
- function c(i, p) {
283
- i.touches.length === 1 ? o(i, i.touches[0], p) : r = !1;
284
- }
285
- a(c, "c"), s.add(t, "mousedown", function(i) {
286
- u(i, !0);
287
- }), s.add(t, "touchstart", function(i) {
288
- c(i, !0);
289
- }), s.add(window, "mousemove", u), s.add(t, "touchmove", c), s.add(window, "mouseup", function(i) {
290
- r = !1;
291
- }), s.add(t, "touchend", function(i) {
292
- r = !1;
293
- }), s.add(t, "touchcancel", function(i) {
294
- r = !1;
295
- });
296
- }
297
- a(C, "L");
298
- var F = `linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
299
- linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`, W = 360, A = "keydown", x = "mousedown", D = "focusin";
300
- function m(s, t) {
301
- return (t || document).querySelector(s);
302
- }
303
- a(m, "_");
304
- function N(s) {
305
- s.preventDefault(), s.stopPropagation();
306
- }
307
- a(N, "M");
308
- function T(s, t, e, r, n) {
309
- s.add(t, A, function(o) {
310
- e.indexOf(o.key) >= 0 && r(o);
311
- });
312
- }
313
- a(T, "H");
314
- var j = function() {
315
- function s(t) {
316
- O(this, s), this.settings = {
317
- popup: "right",
318
- layout: "default",
319
- alpha: !0,
320
- editor: !0,
321
- editorFormat: "hex",
322
- cancelButton: !1,
323
- defaultColor: "#0cf"
324
- }, this._events = new q(), this.onChange = null, this.onDone = null, this.onOpen = null, this.onClose = null, this.setOptions(t);
325
- }
326
- return a(s, "l"), R(s, [{
327
- key: "setOptions",
328
- value: /* @__PURE__ */ a(function(t) {
329
- var e = this;
330
- if (!t)
331
- return;
332
- var r = this.settings;
333
- function n(i, p, l) {
334
- for (var d in i)
335
- p[d] = i[d];
336
- }
337
- if (a(n, "n"), t instanceof HTMLElement)
338
- r.parent = t;
339
- else {
340
- r.parent && t.parent && r.parent !== t.parent && (this._events.remove(r.parent), this._popupInited = !1), n(t, r), t.onChange && (this.onChange = t.onChange), t.onDone && (this.onDone = t.onDone), t.onOpen && (this.onOpen = t.onOpen), t.onClose && (this.onClose = t.onClose);
341
- var o = t.color || t.colour;
342
- o && this._setColor(o);
343
- }
344
- var u = r.parent;
345
- if (u && r.popup && !this._popupInited) {
346
- var c = /* @__PURE__ */ a(function(i) {
347
- return e.openHandler(i);
348
- }, "a");
349
- this._events.add(u, "click", c), T(this._events, u, [" ", "Spacebar", "Enter"], c), this._popupInited = !0;
350
- } else
351
- t.parent && !r.popup && this.show();
352
- }, "value")
353
- }, {
354
- key: "openHandler",
355
- value: /* @__PURE__ */ a(function(t) {
356
- if (this.show()) {
357
- t && t.preventDefault(), this.settings.parent.style.pointerEvents = "none";
358
- var e = t && t.type === A ? this._domEdit : this.domElement;
359
- setTimeout(function() {
360
- return e.focus();
361
- }, 100), this.onOpen && this.onOpen(this.colour);
362
- }
363
- }, "value")
364
- }, {
365
- key: "closeHandler",
366
- value: /* @__PURE__ */ a(function(t) {
367
- var e = t && t.type, r = !1;
368
- if (!t)
369
- r = !0;
370
- else if (e === x || e === D) {
371
- var n = (this.__containedEvent || 0) + 100;
372
- t.timeStamp > n && (r = !0);
373
- } else
374
- N(t), r = !0;
375
- r && this.hide() && (this.settings.parent.style.pointerEvents = "", e !== x && this.settings.parent.focus(), this.onClose && this.onClose(this.colour));
376
- }, "value")
377
- }, {
378
- key: "movePopup",
379
- value: /* @__PURE__ */ a(function(t, e) {
380
- this.closeHandler(), this.setOptions(t), e && this.openHandler();
381
- }, "value")
382
- }, {
383
- key: "setColor",
384
- value: /* @__PURE__ */ a(function(t, e) {
385
- this._setColor(t, { silent: e });
386
- }, "value")
387
- }, {
388
- key: "_setColor",
389
- value: /* @__PURE__ */ a(function(t, e) {
390
- if (typeof t == "string" && (t = t.trim()), !!t) {
391
- e = e || {};
392
- var r = void 0;
393
- try {
394
- r = new I(t);
395
- } catch (o) {
396
- if (e.failSilently)
397
- return;
398
- throw o;
399
- }
400
- if (!this.settings.alpha) {
401
- var n = r.hsla;
402
- n[3] = 1, r.hsla = n;
403
- }
404
- this.colour = this.color = r, this._setHSLA(null, null, null, null, e);
405
- }
406
- }, "value")
407
- }, {
408
- key: "setColour",
409
- value: /* @__PURE__ */ a(function(t, e) {
410
- this.setColor(t, e);
411
- }, "value")
412
- }, {
413
- key: "show",
414
- value: /* @__PURE__ */ a(function() {
415
- var t = this.settings.parent;
416
- if (!t)
417
- return !1;
418
- if (this.domElement) {
419
- var e = this._toggleDOM(!0);
420
- return this._setPosition(), e;
421
- }
422
- var r = this.settings.template || '<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>', n = B(r);
423
- return this.domElement = n, this._domH = m(".picker_hue", n), this._domSL = m(".picker_sl", n), this._domA = m(".picker_alpha", n), this._domEdit = m(".picker_editor input", n), this._domSample = m(".picker_sample", n), this._domOkay = m(".picker_done button", n), this._domCancel = m(".picker_cancel button", n), n.classList.add("layout_" + this.settings.layout), this.settings.alpha || n.classList.add("no_alpha"), this.settings.editor || n.classList.add("no_editor"), this.settings.cancelButton || n.classList.add("no_cancel"), this._ifPopup(function() {
424
- return n.classList.add("popup");
425
- }), this._setPosition(), this.colour ? this._updateUI() : this._setColor(this.settings.defaultColor), this._bindEvents(), !0;
426
- }, "value")
427
- }, {
428
- key: "hide",
429
- value: /* @__PURE__ */ a(function() {
430
- return this._toggleDOM(!1);
431
- }, "value")
432
- }, {
433
- key: "destroy",
434
- value: /* @__PURE__ */ a(function() {
435
- this._events.destroy(), this.domElement && this.settings.parent.removeChild(this.domElement);
436
- }, "value")
437
- }, {
438
- key: "_bindEvents",
439
- value: /* @__PURE__ */ a(function() {
440
- var t = this, e = this, r = this.domElement, n = this._events;
441
- function o(i, p, l) {
442
- n.add(i, p, l);
443
- }
444
- a(o, "o"), o(r, "click", function(i) {
445
- return i.preventDefault();
446
- }), C(n, this._domH, function(i, p) {
447
- return e._setHSLA(i);
448
- }), C(n, this._domSL, function(i, p) {
449
- return e._setHSLA(null, i, 1 - p);
450
- }), this.settings.alpha && C(n, this._domA, function(i, p) {
451
- return e._setHSLA(null, null, null, 1 - p);
452
- });
453
- var u = this._domEdit;
454
- o(u, "input", function(i) {
455
- e._setColor(this.value, { fromEditor: !0, failSilently: !0 });
456
- }), o(u, "focus", function(i) {
457
- var p = this;
458
- p.selectionStart === p.selectionEnd && p.select();
459
- }), this._ifPopup(function() {
460
- var i = /* @__PURE__ */ a(function(l) {
461
- return t.closeHandler(l);
462
- }, "s");
463
- o(window, x, i), o(window, D, i), T(n, r, ["Esc", "Escape"], i);
464
- var p = /* @__PURE__ */ a(function(l) {
465
- t.__containedEvent = l.timeStamp;
466
- }, "p");
467
- o(r, x, p), o(r, D, p), o(t._domCancel, "click", i);
468
- });
469
- var c = /* @__PURE__ */ a(function(i) {
470
- t._ifPopup(function() {
471
- return t.closeHandler(i);
472
- }), t.onDone && t.onDone(t.colour);
473
- }, "a");
474
- o(this._domOkay, "click", c), T(n, r, ["Enter"], c);
475
- }, "value")
476
- }, {
477
- key: "_setPosition",
478
- value: /* @__PURE__ */ a(function() {
479
- var t = this.settings.parent, e = this.domElement;
480
- t !== e.parentNode && t.appendChild(e), this._ifPopup(function(r) {
481
- getComputedStyle(t).position === "static" && (t.style.position = "relative");
482
- var n = r === !0 ? "popup_right" : "popup_" + r;
483
- ["popup_top", "popup_bottom", "popup_left", "popup_right"].forEach(function(o) {
484
- o === n ? e.classList.add(o) : e.classList.remove(o);
485
- }), e.classList.add(n);
486
- });
487
- }, "value")
488
- }, {
489
- key: "_setHSLA",
490
- value: /* @__PURE__ */ a(function(t, e, r, n, o) {
491
- o = o || {};
492
- var u = this.colour, c = u.hsla;
493
- [t, e, r, n].forEach(function(i, p) {
494
- (i || i === 0) && (c[p] = i);
495
- }), u.hsla = c, this._updateUI(o), this.onChange && !o.silent && this.onChange(u);
496
- }, "value")
497
- }, {
498
- key: "_updateUI",
499
- value: /* @__PURE__ */ a(function(t) {
500
- if (!this.domElement)
501
- return;
502
- t = t || {};
503
- var e = this.colour, r = e.hsla, n = "hsl(" + r[0] * W + ", 100%, 50%)", o = e.hslString, u = e.hslaString, c = this._domH, i = this._domSL, p = this._domA, l = m(".picker_selector", c), d = m(".picker_selector", i), f = m(".picker_selector", p);
504
- function b(M, L, S) {
505
- L.style.left = S * 100 + "%";
506
- }
507
- a(b, "b");
508
- function g(M, L, S) {
509
- L.style.top = S * 100 + "%";
510
- }
511
- a(g, "m"), b(c, l, r[0]), this._domSL.style.backgroundColor = this._domH.style.color = n, b(i, d, r[1]), g(i, d, 1 - r[2]), i.style.color = o, g(p, f, 1 - r[3]);
512
- var _ = o, h = _.replace("hsl", "hsla").replace(")", ", 0)"), k = "linear-gradient(" + [_, h] + ")";
513
- if (this._domA.style.background = k + ", " + F, !t.fromEditor) {
514
- var E = this.settings.editorFormat, w = this.settings.alpha, v = void 0;
515
- switch (E) {
516
- case "rgb":
517
- v = e.printRGB(w);
518
- break;
519
- case "hsl":
520
- v = e.printHSL(w);
521
- break;
522
- default:
523
- v = e.printHex(w);
524
- }
525
- this._domEdit.value = v;
526
- }
527
- this._domSample.style.color = u;
528
- }, "value")
529
- }, {
530
- key: "_ifPopup",
531
- value: /* @__PURE__ */ a(function(t, e) {
532
- this.settings.parent && this.settings.popup ? t && t(this.settings.popup) : e && e();
533
- }, "value")
534
- }, {
535
- key: "_toggleDOM",
536
- value: /* @__PURE__ */ a(function(t) {
537
- var e = this.domElement;
538
- if (!e)
539
- return !1;
540
- var r = t ? "" : "none", n = e.style.display !== r;
541
- return n && (e.style.display = r), n;
542
- }, "value")
543
- }]), s;
544
- }();
545
- {
546
- var H = document.createElement("style");
547
- H.textContent = '.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}', document.documentElement.firstElementChild.appendChild(H), j.StyleElement = H;
548
- }
549
- export {
550
- j as default
551
- };