@lingshugroup/web-plus 1.7.1 → 1.7.2

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 (60) hide show
  1. package/lib/hooks/index.cjs +1 -1
  2. package/lib/hooks/index.js +6 -8
  3. package/lib/index.css +1 -1
  4. package/lib/index.css.br +0 -0
  5. package/lib/index.css.gz +0 -0
  6. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.cjs +1 -1
  7. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js +37 -32
  8. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js.br +0 -0
  9. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js.gz +0 -0
  10. package/lib/packages/ls-components/components/button/Button.vue/index.cjs +1 -1
  11. package/lib/packages/ls-components/components/button/Button.vue/index.js +2 -2
  12. package/lib/packages/ls-components/components/button/Button.vue/index2.cjs +1 -1
  13. package/lib/packages/ls-components/components/button/Button.vue/index2.js +14 -14
  14. package/lib/packages/ls-components/components/button/Button.vue/index2.js.br +0 -0
  15. package/lib/packages/ls-components/components/button/Button.vue/index2.js.gz +0 -0
  16. package/lib/packages/ls-components/components/button/ButtonGroup.vue/index.cjs +1 -1
  17. package/lib/packages/ls-components/components/button/ButtonGroup.vue/index.js +2 -2
  18. package/lib/packages/ls-components/components/editor/Index.vue/index.cjs +1 -1
  19. package/lib/packages/ls-components/components/editor/Index.vue/index.js +2 -2
  20. package/lib/packages/ls-components/components/editor/Index.vue/index2.cjs +1 -1
  21. package/lib/packages/ls-components/components/editor/Index.vue/index2.js +75 -58
  22. package/lib/packages/ls-components/components/editor/Index.vue/index2.js.br +0 -0
  23. package/lib/packages/ls-components/components/editor/Index.vue/index2.js.gz +0 -0
  24. package/lib/packages/ls-components/components/editor/types/index.cjs +1 -1
  25. package/lib/packages/ls-components/components/editor/types/index.js +19 -4
  26. package/lib/packages/ls-components/components/editor/types/index.js.br +0 -0
  27. package/lib/packages/ls-components/components/editor/types/index.js.gz +0 -0
  28. package/lib/packages/ls-components/components/menu/Index.vue/index.cjs +1 -1
  29. package/lib/packages/ls-components/components/menu/Index.vue/index.js +2 -2
  30. package/lib/packages/ls-components/components/menu/Index.vue/index2.cjs +1 -1
  31. package/lib/packages/ls-components/components/menu/Index.vue/index2.js +37 -35
  32. package/lib/packages/ls-components/components/menu/Index.vue/index2.js.br +0 -0
  33. package/lib/packages/ls-components/components/menu/Index.vue/index2.js.gz +0 -0
  34. package/lib/packages/ls-components/components/menu/MenuItem.vue/index.cjs +1 -1
  35. package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js +10 -10
  36. package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.br +0 -0
  37. package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.gz +0 -0
  38. package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
  39. package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
  40. package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
  41. package/lib/packages/ls-components/components/upload/Index.vue/index2.js +52 -52
  42. package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
  43. package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
  44. package/lib/types/components/_hooks/index.d.ts +1 -2
  45. package/lib/types/components/_hooks/useOptionHook.d.ts +3 -3
  46. package/lib/types/components/dialog/Index.vue.d.ts +1 -1
  47. package/lib/types/components/editor/Index.vue.d.ts +9 -0
  48. package/lib/types/components/editor/index.d.ts +18 -0
  49. package/lib/types/components/editor/types.d.ts +3 -0
  50. package/lib/types/components/form/FormItem.vue.d.ts +23 -23
  51. package/lib/types/components/form/index.d.ts +23 -23
  52. package/lib/types/components/form/types.d.ts +1 -1
  53. package/lib/types/components/menu/types.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.cjs +0 -1
  56. package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.js +0 -222
  57. package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.js.br +0 -0
  58. package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.js.gz +0 -0
  59. package/lib/packages/ls-components/components/_hooks/useColorthiefHook/index.cjs +0 -1
  60. package/lib/packages/ls-components/components/_hooks/useColorthiefHook/index.js +0 -23
@@ -3,7 +3,7 @@ import { LocationQueryRaw } from 'vue-router';
3
3
  import { EpPropFinalized } from '../_utils/types';
4
4
  export type MenuBaseType = {
5
5
  title: string;
6
- name: string;
6
+ name?: string;
7
7
  path?: string;
8
8
  key?: string;
9
9
  cpoPath?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingshugroup/web-plus",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",
@@ -1 +0,0 @@
1
- "use strict";var T=Object.defineProperty;var l=(f,u)=>T(f,"name",{value:u,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});if(!q)var q={map:l(function(f,u){var d={};return u?f.map(function(g,b){return d.index=b,u.call(d,g)}):f.slice()},"map"),naturalOrder:l(function(f,u){return f<u?-1:f>u?1:0},"naturalOrder"),sum:l(function(f,u){var d={};return f.reduce(u?function(g,b,m){return d.index=m,g+u.call(d,b)}:function(g,b){return g+b},0)},"sum"),max:l(function(f,u){return Math.max.apply(null,u?q.map(f,u):f)},"max")};var L=function(){var f=5,u=8-f,d=1e3;function g(r,t,n){return(r<<2*f)+(t<<f)+n}l(g,"e");function b(r){var t=[],n=!1;function s(){t.sort(r),n=!0}return l(s,"o"),{push:l(function(e){t.push(e),n=!1},"push"),peek:l(function(e){return n||s(),e===void 0&&(e=t.length-1),t[e]},"peek"),pop:l(function(){return n||s(),t.pop()},"pop"),size:l(function(){return t.length},"size"),map:l(function(e){return t.map(e)},"map"),debug:l(function(){return n||s(),t},"debug")}}l(b,"u");function m(r,t,n,s,e,o,h){var a=this;a.r1=r,a.r2=t,a.g1=n,a.g2=s,a.b1=e,a.b2=o,a.histo=h}l(m,"a");function M(){this.vboxes=new b(function(r,t){return q.naturalOrder(r.vbox.count()*r.vbox.volume(),t.vbox.count()*t.vbox.volume())})}l(M,"i");function I(r,t){if(t.count()){var n=t.r2-t.r1+1,s=t.g2-t.g1+1,e=q.max([n,s,t.b2-t.b1+1]);if(t.count()==1)return[t.copy()];var o,h,a,c,v=0,p=[],w=[];if(e==n)for(o=t.r1;o<=t.r2;o++){for(c=0,h=t.g1;h<=t.g2;h++)for(a=t.b1;a<=t.b2;a++)c+=r[g(o,h,a)]||0;p[o]=v+=c}else if(e==s)for(o=t.g1;o<=t.g2;o++){for(c=0,h=t.r1;h<=t.r2;h++)for(a=t.b1;a<=t.b2;a++)c+=r[g(h,o,a)]||0;p[o]=v+=c}else for(o=t.b1;o<=t.b2;o++){for(c=0,h=t.r1;h<=t.r2;h++)for(a=t.g1;a<=t.g2;a++)c+=r[g(h,a,o)]||0;p[o]=v+=c}return p.forEach(function(x,y){w[y]=v-x}),function(x){var y,E,_,O,C,k=x+"1",z=x+"2",D=0;for(o=t[k];o<=t[z];o++)if(p[o]>v/2){for(_=t.copy(),O=t.copy(),C=(y=o-t[k])<=(E=t[z]-o)?Math.min(t[z]-1,~~(o+E/2)):Math.max(t[k],~~(o-1-y/2));!p[C];)C++;for(D=w[C];!D&&p[C-1];)D=w[--C];return _[z]=C,O[k]=_[z]+1,[_,O]}}(e==n?"r":e==s?"g":"b")}}return l(I,"c"),m.prototype={volume:l(function(r){var t=this;return t._volume&&!r||(t._volume=(t.r2-t.r1+1)*(t.g2-t.g1+1)*(t.b2-t.b1+1)),t._volume},"volume"),count:l(function(r){var t=this,n=t.histo;if(!t._count_set||r){var s,e,o,h=0;for(s=t.r1;s<=t.r2;s++)for(e=t.g1;e<=t.g2;e++)for(o=t.b1;o<=t.b2;o++)h+=n[g(s,e,o)]||0;t._count=h,t._count_set=!0}return t._count},"count"),copy:l(function(){var r=this;return new m(r.r1,r.r2,r.g1,r.g2,r.b1,r.b2,r.histo)},"copy"),avg:l(function(r){var t=this,n=t.histo;if(!t._avg||r){var s,e,o,h,a=0,c=1<<8-f,v=0,p=0,w=0;for(e=t.r1;e<=t.r2;e++)for(o=t.g1;o<=t.g2;o++)for(h=t.b1;h<=t.b2;h++)a+=s=n[g(e,o,h)]||0,v+=s*(e+.5)*c,p+=s*(o+.5)*c,w+=s*(h+.5)*c;t._avg=a?[~~(v/a),~~(p/a),~~(w/a)]:[~~(c*(t.r1+t.r2+1)/2),~~(c*(t.g1+t.g2+1)/2),~~(c*(t.b1+t.b2+1)/2)]}return t._avg},"avg"),contains:l(function(r){var t=this,n=r[0]>>u;return gval=r[1]>>u,bval=r[2]>>u,n>=t.r1&&n<=t.r2&&gval>=t.g1&&gval<=t.g2&&bval>=t.b1&&bval<=t.b2},"contains")},M.prototype={push:l(function(r){this.vboxes.push({vbox:r,color:r.avg()})},"push"),palette:l(function(){return this.vboxes.map(function(r){return r.color})},"palette"),size:l(function(){return this.vboxes.size()},"size"),map:l(function(r){for(var t=this.vboxes,n=0;n<t.size();n++)if(t.peek(n).vbox.contains(r))return t.peek(n).color;return this.nearest(r)},"map"),nearest:l(function(r){for(var t,n,s,e=this.vboxes,o=0;o<e.size();o++)((n=Math.sqrt(Math.pow(r[0]-e.peek(o).color[0],2)+Math.pow(r[1]-e.peek(o).color[1],2)+Math.pow(r[2]-e.peek(o).color[2],2)))<t||t===void 0)&&(t=n,s=e.peek(o).color);return s},"nearest"),forcebw:l(function(){var r=this.vboxes;r.sort(function(e,o){return q.naturalOrder(q.sum(e.color),q.sum(o.color))});var t=r[0].color;t[0]<5&&t[1]<5&&t[2]<5&&(r[0].color=[0,0,0]);var n=r.length-1,s=r[n].color;s[0]>251&&s[1]>251&&s[2]>251&&(r[n].color=[255,255,255])},"forcebw")},{quantize:l(function(r,t){if(!r.length||t<2||t>256)return!1;var n=function(c){var v,p=new Array(1<<3*f);return c.forEach(function(w){v=g(w[0]>>u,w[1]>>u,w[2]>>u),p[v]=(p[v]||0)+1}),p}(r);n.forEach(function(){});var s=function(c,v){var p,w,x,y=1e6,E=0,_=1e6,O=0,C=1e6,k=0;return c.forEach(function(z){(p=z[0]>>u)<y?y=p:p>E&&(E=p),(w=z[1]>>u)<_?_=w:w>O&&(O=w),(x=z[2]>>u)<C?C=x:x>k&&(k=x)}),new m(y,E,_,O,C,k,v)}(r,n),e=new b(function(c,v){return q.naturalOrder(c.count(),v.count())});function o(c,v){for(var p,w=c.size(),x=0;x<d;){if(w>=v||x++>d)return;if((p=c.pop()).count()){var y=I(n,p),E=y[0],_=y[1];if(!E)return;c.push(E),_&&(c.push(_),w++)}else c.push(p),x++}}l(o,"g"),e.push(s),o(e,.75*t);for(var h=new b(function(c,v){return q.naturalOrder(c.count()*c.volume(),v.count()*v.volume())});e.size();)h.push(e.pop());o(h,t);for(var a=new M;h.size();)a.push(h.pop());return a},"quantize")}}().quantize,A=l(function(f){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.width=this.canvas.width=f.naturalWidth,this.height=this.canvas.height=f.naturalHeight,this.context.drawImage(f,0,0,this.width,this.height)},"n");A.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)};var P=l(function(){},"o");P.prototype.getColor=function(f,u){return u===void 0&&(u=10),this.getPalette(f,5,u)[0]},P.prototype.getPalette=function(f,u,d){var g=function(I){var r=I.colorCount,t=I.quality;if(r!==void 0&&Number.isInteger(r)){if(r===1)throw new Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()");r=Math.max(r,2),r=Math.min(r,20)}else r=10;return(t===void 0||!Number.isInteger(t)||t<1)&&(t=10),{colorCount:r,quality:t}}({colorCount:u,quality:d}),b=new A(f),m=function(I,r,t){for(var n,s,e,o,h,a=I,c=[],v=0;v<r;v+=t)s=a[0+(n=4*v)],e=a[n+1],o=a[n+2],((h=a[n+3])===void 0||h>=125)&&(s>250&&e>250&&o>250||c.push([s,e,o]));return c}(b.getImageData().data,b.width*b.height,g.quality),M=L(m,g.colorCount);return M?M.palette():null},P.prototype.getColorFromUrl=function(f,u,d){var g=this,b=document.createElement("img");b.addEventListener("load",function(){var m=g.getPalette(b,5,d);u(m[0],f)}),b.src=f},P.prototype.getImageData=function(f,u){var d=new XMLHttpRequest;d.open("GET",f,!0),d.responseType="arraybuffer",d.onload=function(){if(this.status==200){var g=new Uint8Array(this.response);i=g.length;for(var b=new Array(i),m=0;m<g.length;m++)b[m]=String.fromCharCode(g[m]);var M=b.join(""),I=window.btoa(M);u("data:image/png;base64,"+I)}},d.send()},P.prototype.getColorAsync=function(f,u,d){var g=this;this.getImageData(f,function(b){var m=document.createElement("img");m.addEventListener("load",function(){var M=g.getPalette(m,5,d);u(M[0],this)}),m.src=b})};exports.default=P;
@@ -1,222 +0,0 @@
1
- var L = Object.defineProperty;
2
- var h = (f, u) => L(f, "name", { value: u, configurable: !0 });
3
- if (!q) var q = { map: /* @__PURE__ */ h(function(f, u) {
4
- var m = {};
5
- return u ? f.map(function(g, b) {
6
- return m.index = b, u.call(m, g);
7
- }) : f.slice();
8
- }, "map"), naturalOrder: /* @__PURE__ */ h(function(f, u) {
9
- return f < u ? -1 : f > u ? 1 : 0;
10
- }, "naturalOrder"), sum: /* @__PURE__ */ h(function(f, u) {
11
- var m = {};
12
- return f.reduce(u ? function(g, b, d) {
13
- return m.index = d, g + u.call(m, b);
14
- } : function(g, b) {
15
- return g + b;
16
- }, 0);
17
- }, "sum"), max: /* @__PURE__ */ h(function(f, u) {
18
- return Math.max.apply(null, u ? q.map(f, u) : f);
19
- }, "max") };
20
- var T = function() {
21
- var f = 5, u = 8 - f, m = 1e3;
22
- function g(r, t, n) {
23
- return (r << 2 * f) + (t << f) + n;
24
- }
25
- h(g, "e");
26
- function b(r) {
27
- var t = [], n = !1;
28
- function s() {
29
- t.sort(r), n = !0;
30
- }
31
- return h(s, "o"), { push: /* @__PURE__ */ h(function(e) {
32
- t.push(e), n = !1;
33
- }, "push"), peek: /* @__PURE__ */ h(function(e) {
34
- return n || s(), e === void 0 && (e = t.length - 1), t[e];
35
- }, "peek"), pop: /* @__PURE__ */ h(function() {
36
- return n || s(), t.pop();
37
- }, "pop"), size: /* @__PURE__ */ h(function() {
38
- return t.length;
39
- }, "size"), map: /* @__PURE__ */ h(function(e) {
40
- return t.map(e);
41
- }, "map"), debug: /* @__PURE__ */ h(function() {
42
- return n || s(), t;
43
- }, "debug") };
44
- }
45
- h(b, "u");
46
- function d(r, t, n, s, e, o, l) {
47
- var a = this;
48
- a.r1 = r, a.r2 = t, a.g1 = n, a.g2 = s, a.b1 = e, a.b2 = o, a.histo = l;
49
- }
50
- h(d, "a");
51
- function E() {
52
- this.vboxes = new b(function(r, t) {
53
- return q.naturalOrder(r.vbox.count() * r.vbox.volume(), t.vbox.count() * t.vbox.volume());
54
- });
55
- }
56
- h(E, "i");
57
- function I(r, t) {
58
- if (t.count()) {
59
- var n = t.r2 - t.r1 + 1, s = t.g2 - t.g1 + 1, e = q.max([n, s, t.b2 - t.b1 + 1]);
60
- if (t.count() == 1) return [t.copy()];
61
- var o, l, a, c, v = 0, p = [], w = [];
62
- if (e == n) for (o = t.r1; o <= t.r2; o++) {
63
- for (c = 0, l = t.g1; l <= t.g2; l++) for (a = t.b1; a <= t.b2; a++) c += r[g(o, l, a)] || 0;
64
- p[o] = v += c;
65
- }
66
- else if (e == s) for (o = t.g1; o <= t.g2; o++) {
67
- for (c = 0, l = t.r1; l <= t.r2; l++) for (a = t.b1; a <= t.b2; a++) c += r[g(l, o, a)] || 0;
68
- p[o] = v += c;
69
- }
70
- else for (o = t.b1; o <= t.b2; o++) {
71
- for (c = 0, l = t.r1; l <= t.r2; l++) for (a = t.g1; a <= t.g2; a++) c += r[g(l, a, o)] || 0;
72
- p[o] = v += c;
73
- }
74
- return p.forEach(function(x, y) {
75
- w[y] = v - x;
76
- }), function(x) {
77
- var y, z, C, D, _, k = x + "1", M = x + "2", P = 0;
78
- for (o = t[k]; o <= t[M]; o++) if (p[o] > v / 2) {
79
- for (C = t.copy(), D = t.copy(), _ = (y = o - t[k]) <= (z = t[M] - o) ? Math.min(t[M] - 1, ~~(o + z / 2)) : Math.max(t[k], ~~(o - 1 - y / 2)); !p[_]; ) _++;
80
- for (P = w[_]; !P && p[_ - 1]; ) P = w[--_];
81
- return C[M] = _, D[k] = C[M] + 1, [C, D];
82
- }
83
- }(e == n ? "r" : e == s ? "g" : "b");
84
- }
85
- }
86
- return h(I, "c"), d.prototype = { volume: /* @__PURE__ */ h(function(r) {
87
- var t = this;
88
- return t._volume && !r || (t._volume = (t.r2 - t.r1 + 1) * (t.g2 - t.g1 + 1) * (t.b2 - t.b1 + 1)), t._volume;
89
- }, "volume"), count: /* @__PURE__ */ h(function(r) {
90
- var t = this, n = t.histo;
91
- if (!t._count_set || r) {
92
- var s, e, o, l = 0;
93
- for (s = t.r1; s <= t.r2; s++) for (e = t.g1; e <= t.g2; e++) for (o = t.b1; o <= t.b2; o++) l += n[g(s, e, o)] || 0;
94
- t._count = l, t._count_set = !0;
95
- }
96
- return t._count;
97
- }, "count"), copy: /* @__PURE__ */ h(function() {
98
- var r = this;
99
- return new d(r.r1, r.r2, r.g1, r.g2, r.b1, r.b2, r.histo);
100
- }, "copy"), avg: /* @__PURE__ */ h(function(r) {
101
- var t = this, n = t.histo;
102
- if (!t._avg || r) {
103
- var s, e, o, l, a = 0, c = 1 << 8 - f, v = 0, p = 0, w = 0;
104
- for (e = t.r1; e <= t.r2; e++) for (o = t.g1; o <= t.g2; o++) for (l = t.b1; l <= t.b2; l++) a += s = n[g(e, o, l)] || 0, v += s * (e + 0.5) * c, p += s * (o + 0.5) * c, w += s * (l + 0.5) * c;
105
- t._avg = a ? [~~(v / a), ~~(p / a), ~~(w / a)] : [~~(c * (t.r1 + t.r2 + 1) / 2), ~~(c * (t.g1 + t.g2 + 1) / 2), ~~(c * (t.b1 + t.b2 + 1) / 2)];
106
- }
107
- return t._avg;
108
- }, "avg"), contains: /* @__PURE__ */ h(function(r) {
109
- var t = this, n = r[0] >> u;
110
- return gval = r[1] >> u, bval = r[2] >> u, n >= t.r1 && n <= t.r2 && gval >= t.g1 && gval <= t.g2 && bval >= t.b1 && bval <= t.b2;
111
- }, "contains") }, E.prototype = { push: /* @__PURE__ */ h(function(r) {
112
- this.vboxes.push({ vbox: r, color: r.avg() });
113
- }, "push"), palette: /* @__PURE__ */ h(function() {
114
- return this.vboxes.map(function(r) {
115
- return r.color;
116
- });
117
- }, "palette"), size: /* @__PURE__ */ h(function() {
118
- return this.vboxes.size();
119
- }, "size"), map: /* @__PURE__ */ h(function(r) {
120
- for (var t = this.vboxes, n = 0; n < t.size(); n++) if (t.peek(n).vbox.contains(r)) return t.peek(n).color;
121
- return this.nearest(r);
122
- }, "map"), nearest: /* @__PURE__ */ h(function(r) {
123
- for (var t, n, s, e = this.vboxes, o = 0; o < e.size(); o++) ((n = Math.sqrt(Math.pow(r[0] - e.peek(o).color[0], 2) + Math.pow(r[1] - e.peek(o).color[1], 2) + Math.pow(r[2] - e.peek(o).color[2], 2))) < t || t === void 0) && (t = n, s = e.peek(o).color);
124
- return s;
125
- }, "nearest"), forcebw: /* @__PURE__ */ h(function() {
126
- var r = this.vboxes;
127
- r.sort(function(e, o) {
128
- return q.naturalOrder(q.sum(e.color), q.sum(o.color));
129
- });
130
- var t = r[0].color;
131
- t[0] < 5 && t[1] < 5 && t[2] < 5 && (r[0].color = [0, 0, 0]);
132
- var n = r.length - 1, s = r[n].color;
133
- s[0] > 251 && s[1] > 251 && s[2] > 251 && (r[n].color = [255, 255, 255]);
134
- }, "forcebw") }, { quantize: /* @__PURE__ */ h(function(r, t) {
135
- if (!r.length || t < 2 || t > 256) return !1;
136
- var n = function(c) {
137
- var v, p = new Array(1 << 3 * f);
138
- return c.forEach(function(w) {
139
- v = g(w[0] >> u, w[1] >> u, w[2] >> u), p[v] = (p[v] || 0) + 1;
140
- }), p;
141
- }(r);
142
- n.forEach(function() {
143
- });
144
- var s = function(c, v) {
145
- var p, w, x, y = 1e6, z = 0, C = 1e6, D = 0, _ = 1e6, k = 0;
146
- return c.forEach(function(M) {
147
- (p = M[0] >> u) < y ? y = p : p > z && (z = p), (w = M[1] >> u) < C ? C = w : w > D && (D = w), (x = M[2] >> u) < _ ? _ = x : x > k && (k = x);
148
- }), new d(y, z, C, D, _, k, v);
149
- }(r, n), e = new b(function(c, v) {
150
- return q.naturalOrder(c.count(), v.count());
151
- });
152
- function o(c, v) {
153
- for (var p, w = c.size(), x = 0; x < m; ) {
154
- if (w >= v || x++ > m) return;
155
- if ((p = c.pop()).count()) {
156
- var y = I(n, p), z = y[0], C = y[1];
157
- if (!z) return;
158
- c.push(z), C && (c.push(C), w++);
159
- } else c.push(p), x++;
160
- }
161
- }
162
- h(o, "g"), e.push(s), o(e, 0.75 * t);
163
- for (var l = new b(function(c, v) {
164
- return q.naturalOrder(c.count() * c.volume(), v.count() * v.volume());
165
- }); e.size(); ) l.push(e.pop());
166
- o(l, t);
167
- for (var a = new E(); l.size(); ) a.push(l.pop());
168
- return a;
169
- }, "quantize") };
170
- }().quantize, A = /* @__PURE__ */ h(function(f) {
171
- this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), this.width = this.canvas.width = f.naturalWidth, this.height = this.canvas.height = f.naturalHeight, this.context.drawImage(f, 0, 0, this.width, this.height);
172
- }, "n");
173
- A.prototype.getImageData = function() {
174
- return this.context.getImageData(0, 0, this.width, this.height);
175
- };
176
- var O = /* @__PURE__ */ h(function() {
177
- }, "o");
178
- O.prototype.getColor = function(f, u) {
179
- return u === void 0 && (u = 10), this.getPalette(f, 5, u)[0];
180
- }, O.prototype.getPalette = function(f, u, m) {
181
- var g = function(I) {
182
- var r = I.colorCount, t = I.quality;
183
- if (r !== void 0 && Number.isInteger(r)) {
184
- if (r === 1) throw new Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()");
185
- r = Math.max(r, 2), r = Math.min(r, 20);
186
- } else r = 10;
187
- return (t === void 0 || !Number.isInteger(t) || t < 1) && (t = 10), { colorCount: r, quality: t };
188
- }({ colorCount: u, quality: m }), b = new A(f), d = function(I, r, t) {
189
- for (var n, s, e, o, l, a = I, c = [], v = 0; v < r; v += t) s = a[0 + (n = 4 * v)], e = a[n + 1], o = a[n + 2], ((l = a[n + 3]) === void 0 || l >= 125) && (s > 250 && e > 250 && o > 250 || c.push([s, e, o]));
190
- return c;
191
- }(b.getImageData().data, b.width * b.height, g.quality), E = T(d, g.colorCount);
192
- return E ? E.palette() : null;
193
- }, O.prototype.getColorFromUrl = function(f, u, m) {
194
- var g = this, b = document.createElement("img");
195
- b.addEventListener("load", function() {
196
- var d = g.getPalette(b, 5, m);
197
- u(d[0], f);
198
- }), b.src = f;
199
- }, O.prototype.getImageData = function(f, u) {
200
- var m = new XMLHttpRequest();
201
- m.open("GET", f, !0), m.responseType = "arraybuffer", m.onload = function() {
202
- if (this.status == 200) {
203
- var g = new Uint8Array(this.response);
204
- i = g.length;
205
- for (var b = new Array(i), d = 0; d < g.length; d++) b[d] = String.fromCharCode(g[d]);
206
- var E = b.join(""), I = window.btoa(E);
207
- u("data:image/png;base64," + I);
208
- }
209
- }, m.send();
210
- }, O.prototype.getColorAsync = function(f, u, m) {
211
- var g = this;
212
- this.getImageData(f, function(b) {
213
- var d = document.createElement("img");
214
- d.addEventListener("load", function() {
215
- var E = g.getPalette(d, 5, m);
216
- u(E[0], this);
217
- }), d.src = b;
218
- });
219
- };
220
- export {
221
- O as default
222
- };
@@ -1 +0,0 @@
1
- "use strict";var c=Object.defineProperty;var r=(o,n)=>c(o,"name",{value:n,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../../../../node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.cjs");function u(){const o=new l.default;return{getColorthief:r(async i=>{const e=new Image;return e.src=i,e.crossOrigin="Anonymous",new Promise(s=>{e.addEventListener("load",async function(){const t=await o.getColor(e,90);s({bgColor:`rgb(${t[0]}, ${t[1]}, ${t[2]})`})})})},"getColorthief")}}r(u,"useColorthiefHook");exports.default=u;
@@ -1,23 +0,0 @@
1
- var a = Object.defineProperty;
2
- var n = (t, r) => a(t, "name", { value: r, configurable: !0 });
3
- import c from "../../../../../node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.js";
4
- function l() {
5
- const t = new c();
6
- return {
7
- getColorthief: /* @__PURE__ */ n(async (s) => {
8
- const o = new Image();
9
- return o.src = s, o.crossOrigin = "Anonymous", new Promise((i) => {
10
- o.addEventListener("load", async function() {
11
- const e = await t.getColor(o, 90);
12
- i({
13
- bgColor: `rgb(${e[0]}, ${e[1]}, ${e[2]})`
14
- });
15
- });
16
- });
17
- }, "getColorthief")
18
- };
19
- }
20
- n(l, "useColorthiefHook");
21
- export {
22
- l as default
23
- };