aptechka 0.2.0 → 0.2.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 (103) hide show
  1. package/lib/ComponentElement-BUesLP4b.cjs +1 -0
  2. package/lib/ComponentElement-NMlh1Ptn.js +92 -0
  3. package/lib/Composed-ClTo1f0b.js +79 -0
  4. package/lib/Composed-Mdr4ZFbI.cjs +1 -0
  5. package/lib/ElementConstructor-B61ZFTEB.cjs +1 -0
  6. package/lib/{ElementConstructor-1bvPqYNa.js → ElementConstructor-CvNdPKJy.js} +6 -5
  7. package/lib/abstract-elements/index.cjs +1 -1
  8. package/lib/abstract-elements/index.js +1 -1
  9. package/lib/animation/hooks/index.cjs +1 -0
  10. package/lib/animation/hooks/index.d.ts +8 -0
  11. package/lib/animation/hooks/index.js +38 -0
  12. package/lib/attribute/hooks/index.d.ts +2 -0
  13. package/lib/attribute/index.cjs +1 -1
  14. package/lib/attribute/index.d.ts +0 -2
  15. package/lib/attribute/index.js +35 -50
  16. package/lib/canvas/index.cjs +1 -1
  17. package/lib/canvas/index.js +2 -2
  18. package/lib/controls/hooks/index.d.ts +1 -0
  19. package/lib/{createStylesheet-B5Nhxdpo.cjs → createStylesheet-C0OnN0Br.cjs} +1 -1
  20. package/lib/{createStylesheet-DpGvTRP3.js → createStylesheet-CD11E4C8.js} +1 -1
  21. package/lib/{createTheme-CLqJF9Pw.cjs → createTheme-B_W5dUY9.cjs} +1 -1
  22. package/lib/{createTheme-WJyOPh-q.js → createTheme-D0IoYkYN.js} +1 -1
  23. package/lib/element-constructor/index.cjs +1 -1
  24. package/lib/element-constructor/index.js +4 -4
  25. package/lib/element-resizer/hooks/index.cjs +1 -0
  26. package/lib/element-resizer/hooks/index.d.ts +4 -0
  27. package/lib/element-resizer/hooks/index.js +12 -0
  28. package/lib/en3/index.cjs +7 -7
  29. package/lib/en3/index.d.ts +1 -0
  30. package/lib/en3/index.js +639 -620
  31. package/lib/en3/utils/getCurrentViewport.d.ts +7 -0
  32. package/lib/{index-BNZNGmrW.cjs → index--wI4MTuv.cjs} +1 -1
  33. package/lib/{index-DMIfOO2r.js → index-Dq6GRJ9W.js} +2 -2
  34. package/lib/instantiate-BAz2WZtO.cjs +1 -0
  35. package/lib/instantiate-BDteLwW6.js +55 -0
  36. package/lib/intersector/hooks/index.cjs +1 -0
  37. package/lib/intersector/hooks/index.d.ts +4 -0
  38. package/lib/intersector/hooks/index.js +12 -0
  39. package/lib/jsx/hooks/index.cjs +1 -0
  40. package/lib/jsx/hooks/index.d.ts +7 -0
  41. package/lib/jsx/hooks/index.js +76 -0
  42. package/lib/jsx/hooks/useContext.d.ts +2 -2
  43. package/lib/jsx/index.cjs +1 -1
  44. package/lib/jsx/index.d.ts +2 -9
  45. package/lib/jsx/index.js +11 -95
  46. package/lib/jsx/instantiate.d.ts +1 -0
  47. package/lib/jsx/register.d.ts +1 -0
  48. package/lib/layout-box/index.cjs +1 -1
  49. package/lib/layout-box/index.js +82 -81
  50. package/lib/modal/index.cjs +1 -1
  51. package/lib/modal/index.js +2 -2
  52. package/lib/object-BZELAoVj.cjs +1 -0
  53. package/lib/object-R34VLqhp.js +85 -0
  54. package/lib/router/index.cjs +1 -1
  55. package/lib/router/index.js +21 -21
  56. package/lib/scroll/index.cjs +1 -1
  57. package/lib/scroll/index.js +2 -2
  58. package/lib/select/index.cjs +1 -1
  59. package/lib/select/index.js +1 -1
  60. package/lib/slicer/DecoderElement.d.ts +10 -0
  61. package/lib/slicer/Letter.d.ts +11 -0
  62. package/lib/slicer/SlicerElement.d.ts +21 -0
  63. package/lib/slicer/Word.d.ts +16 -0
  64. package/lib/slicer/index.cjs +11 -0
  65. package/lib/slicer/index.d.ts +4 -0
  66. package/lib/slicer/index.js +165 -0
  67. package/lib/store/hooks/index.cjs +1 -0
  68. package/lib/{jsx/hooks/useStore.d.ts → store/hooks/index.d.ts} +1 -1
  69. package/lib/store/hooks/index.js +31 -0
  70. package/lib/store/index.cjs +1 -1
  71. package/lib/store/index.js +48 -111
  72. package/lib/string-3lAkpJJP.js +51 -0
  73. package/lib/string-vBu90jhV.cjs +1 -0
  74. package/lib/studio/index.cjs +1 -1
  75. package/lib/studio/index.js +6 -5
  76. package/lib/{tags-D0k7-iVY.js → tags-C2jg1zYB.js} +1 -1
  77. package/lib/{tags-DGIuh1Hi.cjs → tags-DX-eNxbA.cjs} +1 -1
  78. package/lib/theme/index.cjs +1 -1
  79. package/lib/theme/index.d.ts +1 -1
  80. package/lib/theme/index.js +3 -3
  81. package/lib/ticker/hooks/index.cjs +1 -0
  82. package/lib/ticker/hooks/index.d.ts +5 -0
  83. package/lib/ticker/hooks/index.js +23 -0
  84. package/lib/ticker/index.d.ts +1 -1
  85. package/lib/useConnect-CXdqKdRX.js +9 -0
  86. package/lib/useConnect-DcfeqwzW.cjs +1 -0
  87. package/lib/useCreate-ClGKVMeG.cjs +1 -0
  88. package/lib/useCreate-DQSfJu7r.js +7 -0
  89. package/lib/useDisconnect-D5cBD1bq.js +9 -0
  90. package/lib/useDisconnect-sA74z4IZ.cjs +1 -0
  91. package/lib/utils/index.cjs +1 -1
  92. package/lib/utils/index.js +28 -27
  93. package/lib/utils/ts-utility.d.ts +5 -0
  94. package/lib/window-resizer/hooks/index.cjs +1 -0
  95. package/lib/window-resizer/hooks/index.d.ts +2 -0
  96. package/lib/window-resizer/hooks/index.js +9 -0
  97. package/package.json +67 -2
  98. package/lib/ElementConstructor-CdUaQS-S.cjs +0 -1
  99. package/lib/getComponentElement-B0Qb2RbZ.js +0 -145
  100. package/lib/getComponentElement-BcreYwFe.cjs +0 -1
  101. package/lib/jsx/getComponentElement.d.ts +0 -2
  102. package/lib/string-Cgp_uJvP.cjs +0 -1
  103. package/lib/string-DCGBU6em.js +0 -134
@@ -0,0 +1 @@
1
+ "use strict";var k=Object.defineProperty,g=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var b=(e,n,t)=>n in e?k(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,C=(e,n)=>{for(var t in n||(n={}))v.call(n,t)&&b(e,t,n[t]);if(p)for(var t of p(n))S.call(n,t)&&b(e,t,n[t]);return e},m=(e,n)=>g(e,w(n));var x=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var c=(e,n,t)=>(x(e,n,"read from private field"),t?t.call(e):n.get(e)),r=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)};var h=(e,n,t)=>(x(e,n,"access private method"),t);const A=require("./ElementConstructor-B61ZFTEB.cjs");exports.currentComponentElement=null;const f={value:null};var i,l,a,u,E;class M extends HTMLElement{constructor(t){super();r(this,u);r(this,i,new Set);r(this,l,new Set);r(this,a,new Map);exports.currentComponentElement=this;const o=t.tag(m(C({},t.attributes),{children:t.children}));new A.ElementConstructor(this,C({children:o},f.value)),exports.currentComponentElement=null,f.value=null}addConnectCallback(t){c(this,i).add(t)}addDisconnectCallback(t){c(this,l).add(t)}createContext(t,o){c(this,a).set(t,o)}getContext(t){return c(this,a).get(t)}findContext(t){return h(this,u,E).call(this,t)}connectedCallback(){c(this,i).forEach(t=>{const o=t(this);o&&c(this,l).add(o)})}disconnectedCallback(){c(this,l).forEach(t=>{t(this)})}}i=new WeakMap,l=new WeakMap,a=new WeakMap,u=new WeakSet,E=function(t,o=this){if(!o)return null;if(o&&"findContext"in o){const s=o.getContext(t);if(s)return s}let d=null;if(o.parentElement)d=o.parentElement;else{const s=o.getRootNode();s instanceof ShadowRoot&&(d=s.host)}return d?h(this,u,E).call(this,t,d):null};exports.ComponentElement=M;exports.nextComponentAttributes=f;
@@ -0,0 +1,92 @@
1
+ var w = Object.defineProperty, m = Object.defineProperties;
2
+ var v = Object.getOwnPropertyDescriptors;
3
+ var x = Object.getOwnPropertySymbols;
4
+ var S = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
5
+ var E = (e, n, t) => n in e ? w(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, h = (e, n) => {
6
+ for (var t in n || (n = {}))
7
+ S.call(n, t) && E(e, t, n[t]);
8
+ if (x)
9
+ for (var t of x(n))
10
+ M.call(n, t) && E(e, t, n[t]);
11
+ return e;
12
+ }, b = (e, n) => m(e, v(n));
13
+ var p = (e, n, t) => {
14
+ if (!n.has(e))
15
+ throw TypeError("Cannot " + t);
16
+ };
17
+ var s = (e, n, t) => (p(e, n, "read from private field"), t ? t.call(e) : n.get(e)), i = (e, n, t) => {
18
+ if (n.has(e))
19
+ throw TypeError("Cannot add the same private member more than once");
20
+ n instanceof WeakSet ? n.add(e) : n.set(e, t);
21
+ };
22
+ var C = (e, n, t) => (p(e, n, "access private method"), t);
23
+ import { E as R } from "./ElementConstructor-CvNdPKJy.js";
24
+ let k = null;
25
+ const g = {
26
+ value: null
27
+ };
28
+ var a, c, r, d, f;
29
+ class H extends HTMLElement {
30
+ constructor(t) {
31
+ super();
32
+ i(this, d);
33
+ i(this, a, /* @__PURE__ */ new Set());
34
+ i(this, c, /* @__PURE__ */ new Set());
35
+ i(this, r, /* @__PURE__ */ new Map());
36
+ k = this;
37
+ const o = t.tag(b(h({}, t.attributes), {
38
+ children: t.children
39
+ }));
40
+ new R(this, h({
41
+ children: o
42
+ }, g.value)), k = null, g.value = null;
43
+ }
44
+ addConnectCallback(t) {
45
+ s(this, a).add(t);
46
+ }
47
+ addDisconnectCallback(t) {
48
+ s(this, c).add(t);
49
+ }
50
+ createContext(t, o) {
51
+ s(this, r).set(t, o);
52
+ }
53
+ getContext(t) {
54
+ return s(this, r).get(t);
55
+ }
56
+ findContext(t) {
57
+ return C(this, d, f).call(this, t);
58
+ }
59
+ connectedCallback() {
60
+ s(this, a).forEach((t) => {
61
+ const o = t(this);
62
+ o && s(this, c).add(o);
63
+ });
64
+ }
65
+ disconnectedCallback() {
66
+ s(this, c).forEach((t) => {
67
+ t(this);
68
+ });
69
+ }
70
+ }
71
+ a = new WeakMap(), c = new WeakMap(), r = new WeakMap(), d = new WeakSet(), f = function(t, o = this) {
72
+ if (!o)
73
+ return null;
74
+ if (o && "findContext" in o) {
75
+ const l = o.getContext(t);
76
+ if (l)
77
+ return l;
78
+ }
79
+ let u = null;
80
+ if (o.parentElement)
81
+ u = o.parentElement;
82
+ else {
83
+ const l = o.getRootNode();
84
+ l instanceof ShadowRoot && (u = l.host);
85
+ }
86
+ return u ? C(this, d, f).call(this, t, u) : null;
87
+ };
88
+ export {
89
+ H as C,
90
+ k as c,
91
+ g as n
92
+ };
@@ -0,0 +1,79 @@
1
+ var g = (e, r, s) => {
2
+ if (!r.has(e))
3
+ throw TypeError("Cannot " + s);
4
+ };
5
+ var t = (e, r, s) => (g(e, r, "read from private field"), s ? s.call(e) : r.get(e)), n = (e, r, s) => {
6
+ if (r.has(e))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ r instanceof WeakSet ? r.add(e) : r.set(e, s);
9
+ }, f = (e, r, s, c) => (g(e, r, "write to private field"), c ? c.call(e, s) : r.set(e, s), s);
10
+ import { S as m } from "./Store-JOKrNVEr.js";
11
+ import { d as E } from "./function-C10DGppn.js";
12
+ var d;
13
+ class P extends m {
14
+ constructor(s, c, u) {
15
+ super(null, u);
16
+ n(this, d, void 0);
17
+ f(this, d, s.subscribe((o) => {
18
+ const a = [];
19
+ o.current.forEach((C, l) => {
20
+ var x;
21
+ o.current[l] === ((x = o.previous) == null ? void 0 : x[l]) && this.current[l] ? a.push(this.current[l]) : a.push(c(C, l));
22
+ }), this.current = a;
23
+ }));
24
+ }
25
+ close() {
26
+ super.close(), t(this, d).call(this);
27
+ }
28
+ }
29
+ d = new WeakMap();
30
+ var b, h, i;
31
+ class R extends m {
32
+ constructor(s, c, u) {
33
+ super(s, u);
34
+ n(this, b, void 0);
35
+ n(this, h, void 0);
36
+ n(this, i, 0);
37
+ f(this, h, new m(!1)), f(this, b, c), u != null && u.manualControl || this.refetch();
38
+ }
39
+ get isPending() {
40
+ return t(this, h);
41
+ }
42
+ /**
43
+ * Calls fetcher again and sets isPending to true.
44
+ */
45
+ refetch() {
46
+ t(this, h).current = !0, f(this, i, t(this, i) + 1);
47
+ const s = t(this, i);
48
+ t(this, b).call(this).then((c) => {
49
+ s === t(this, i) && (t(this, h).current = !1, this.current = c);
50
+ });
51
+ }
52
+ }
53
+ b = new WeakMap(), h = new WeakMap(), i = new WeakMap();
54
+ var p;
55
+ class S extends m {
56
+ constructor(s, c, u) {
57
+ super(null, u);
58
+ n(this, p, []);
59
+ const o = E(() => {
60
+ this.current = c();
61
+ }, 0);
62
+ s.forEach((a) => {
63
+ t(this, p).push(
64
+ a.subscribe(() => {
65
+ o();
66
+ })
67
+ );
68
+ });
69
+ }
70
+ close() {
71
+ super.close(), t(this, p).forEach((s) => s());
72
+ }
73
+ }
74
+ p = new WeakMap();
75
+ export {
76
+ S as C,
77
+ P as D,
78
+ R
79
+ };
@@ -0,0 +1 @@
1
+ "use strict";var g=(r,s,e)=>{if(!s.has(r))throw TypeError("Cannot "+e)};var t=(r,s,e)=>(g(r,s,"read from private field"),e?e.call(r):s.get(r)),h=(r,s,e)=>{if(s.has(r))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(r):s.set(r,e)},a=(r,s,e,c)=>(g(r,s,"write to private field"),c?c.call(r,e):s.set(r,e),e);const x=require("./Store-D0_rDIsE.cjs"),v=require("./function-MthRj-GJ.cjs");var d;class C extends x.Store{constructor(e,c,u){super(null,u);h(this,d,void 0);a(this,d,e.subscribe(o=>{const l=[];o.current.forEach((m,f)=>{var S;o.current[f]===((S=o.previous)==null?void 0:S[f])&&this.current[f]?l.push(this.current[f]):l.push(c(m,f))}),this.current=l}))}close(){super.close(),t(this,d).call(this)}}d=new WeakMap;var b,n,i;class E extends x.Store{constructor(e,c,u){super(e,u);h(this,b,void 0);h(this,n,void 0);h(this,i,0);a(this,n,new x.Store(!1)),a(this,b,c),u!=null&&u.manualControl||this.refetch()}get isPending(){return t(this,n)}refetch(){t(this,n).current=!0,a(this,i,t(this,i)+1);const e=t(this,i);t(this,b).call(this).then(c=>{e===t(this,i)&&(t(this,n).current=!1,this.current=c)})}}b=new WeakMap,n=new WeakMap,i=new WeakMap;var p;class q extends x.Store{constructor(e,c,u){super(null,u);h(this,p,[]);const o=v.debounce(()=>{this.current=c()},0);e.forEach(l=>{t(this,p).push(l.subscribe(()=>{o()}))})}close(){super.close(),t(this,p).forEach(e=>e())}}p=new WeakMap;exports.Composed=q;exports.DerivedArray=C;exports.Resource=E;
@@ -0,0 +1 @@
1
+ "use strict";var $=(l,e,s)=>{if(!e.has(l))throw TypeError("Cannot "+s)};var n=(l,e,s)=>($(l,e,"read from private field"),s?s.call(l):e.get(l)),f=(l,e,s)=>{if(e.has(l))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(l):e.set(l,s)},Q=(l,e,s,t)=>($(l,e,"write to private field"),t?t.call(l,s):e.set(l,s),s);var a=(l,e,s)=>($(l,e,"access private method"),s);const m=require("./Store-D0_rDIsE.cjs"),fe=require("./browser-CpzFX2xg.cjs"),X=require("./object-BZELAoVj.cjs"),R=require("./string-vBu90jhV.cjs"),re=require("./connector/index.cjs"),ce=new Set(["animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","listener","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","text","textPath","title","tspan","view"]);var r,h,d,N,Z,w,_,A,O,S,z,M,j,x,ee,v,te,D,se,y,J,E,V,k,ie,q,ne,b,K,g,T,p,Y,H,oe,F,ae,C,I,L,U,P,B;const G=class G{constructor(...e){f(this,N);f(this,w);f(this,A);f(this,S);f(this,M);f(this,x);f(this,v);f(this,D);f(this,y);f(this,E);f(this,k);f(this,q);f(this,b);f(this,g);f(this,p);f(this,H);f(this,F);f(this,C);f(this,L);f(this,r,void 0);f(this,h,new Set);f(this,d,new Set);f(this,P,()=>{n(this,h).forEach(e=>{e()}),n(this,h).clear()});f(this,B,e=>{n(this,d).forEach(s=>{s(e)}),n(this,d).clear()});const s=e[0],t=e[1];Q(this,r,a(this,N,Z).call(this,s,t==null?void 0:t.forceSvg)),a(this,A,O).call(this,t)}get node(){return n(this,r)}};r=new WeakMap,h=new WeakMap,d=new WeakMap,N=new WeakSet,Z=function(e,s){let t=null;if(e instanceof Node)t=e;else if(typeof e=="string")if(!e.includes("<")&&e.includes("-"))t=new(customElements.get(e));else if(e.includes("<")){const i=document.createElement("div");i.innerHTML=e,t=i.firstElementChild}else ce.has(e)||s?t=document.createElementNS("http://www.w3.org/2000/svg",e):t=document.createElement(e);else t=document.createElement("div");return t},w=new WeakSet,_=function(e){return e instanceof HTMLElement||e instanceof SVGElement},A=new WeakSet,O=function(e){if(!e)return;const s=a(this,w,_).call(this,n(this,r)),t=e.ref;delete e.ref,e!=null&&e.onConnect&&(n(this,h).add(e.onConnect),delete e.onConnect),e!=null&&e.onDisconnect&&(n(this,d).add(e.onDisconnect),delete e.onDisconnect);let i,o;for(const c in e){const u=e[c];c==="class"&&s?a(this,S,z).call(this,u):c==="style"&&s?a(this,v,te).call(this,u):c==="lightChildren"?a(this,g,T).call(this,n(this,r),u):c==="children"?a(this,g,T).call(this,n(this,r)instanceof Element?n(this,r).shadowRoot||n(this,r):n(this,r),u):c.startsWith("on")?(o||(o={}),o[c]=u):(i||(i={}),i[c]=u)}if(a(this,q,ne).call(this,i),a(this,k,ie).call(this,o),t&&(typeof t=="function"?t(n(this,r)):t.current=n(this,r)),fe.isBrowser&&(n(this,d).size||n(this,h).size)){const c=n(this,r)instanceof DocumentFragment?n(this,r).firstChild:n(this,r);re.connector.subscribe(c,{connectCallback:n(this,P),disconnectCallback:n(this,B),unsubscribeAfterDisconnect:!0,maxWaitSec:20})}},S=new WeakSet,z=function(e){const s=n(this,r);if(e){if(typeof e=="string")s.classList.add(e);else if(Array.isArray(e))e.forEach(t=>{a(this,S,z).call(this,t)});else if(typeof e=="object")if(e instanceof m.Store)a(this,M,j).call(this,e);else for(const t in e){const i=e[t];i instanceof m.Store?a(this,x,ee).call(this,t,i):i?s.classList.add(t):s.classList.remove(t)}}else return},M=new WeakSet,j=function(e){const s=n(this,r);n(this,d).add(e.subscribe(({current:t,previous:i})=>{i&&[i].flat().forEach(o=>{o&&s.classList.remove(o)}),t&&[t].flat().forEach(o=>{o&&s.classList.add(o)})}))},x=new WeakSet,ee=function(e,s){const t=n(this,r);n(this,d).add(s.subscribe(({current:i})=>{i?t.classList.add(e):t.classList.remove(e)}))},v=new WeakSet,te=function(e){if(!e)return;const s=n(this,r);s.tagName==="style"||s.tagName==="STYLE"?a(this,y,J).call(this,e):a(this,D,se).call(this,e)},D=new WeakSet,se=function(e){for(const s in e){const t=s,i=e[t];i instanceof m.Store?n(this,d).add(i.subscribe(({current:o})=>{a(this,E,V).call(this,t,o)})):a(this,E,V).call(this,t,i)}},y=new WeakSet,J=function(e){const s=n(this,r);for(const t in e){const i=e[t];if(typeof i=="object"&&!(i instanceof m.Store))s.appendChild(new Text(`${t} {`)),a(this,y,J).call(this,i),s.appendChild(new Text("}"));else if(i instanceof m.Store){const o=new Text;n(this,d).add(i.subscribe(c=>{c.current?o.nodeValue=`${R.camelToKebab(t)}: ${c.current};`:o.nodeValue=""})),s.appendChild(o)}else s.appendChild(new Text(`${R.camelToKebab(t)}: ${i};`))}},E=new WeakSet,V=function(e,s){const t=n(this,r);e.includes("--")?s?t.style.setProperty(e,s):t.style.removeProperty(e):s?t.style[e]=s:t.style[e]=""},k=new WeakSet,ie=function(e){if(!e)return;const s=n(this,r);for(const t in e){const i=t,o=R.uncapitalize(i.split("on").slice(1).join("on")),c=e[i];typeof c=="object"?s.addEventListener(o,c.callback,c.options):typeof c=="function"&&s.addEventListener(o,c)}},q=new WeakSet,ne=function(e){for(const s in e){const t=e[s];t instanceof m.Store?n(this,d).add(t.subscribe(({current:i})=>{a(this,b,K).call(this,s,i)})):a(this,b,K).call(this,s,t)}},b=new WeakSet,K=function(e,s){var i,o;const t=n(this,r);e in t&&!((o=(i=t.constructor)==null?void 0:i.observedAttributes)!=null&&o.includes(e))?s!=null&&(t[e]=s.toString()):s!=null&&t.setAttribute(e,s.toString())},g=new WeakSet,T=function(e,s){s&&(s=[s].flat(),s.forEach(t=>{if(t instanceof m.Store){const i=document.createElement("div");i.style.display="contents",e.appendChild(i),n(this,d).add(t.subscribe(({current:o})=>{a(this,F,ae).call(this,i,a(this,H,oe).call(this,o),Array.from(i.childNodes))}))}else if(t instanceof G)a(this,p,Y).call(this,e,t.node);else if(t instanceof Function)a(this,g,T).call(this,e,X.isESClass(t)?new t:t());else{const i=a(this,L,U).call(this,t);i instanceof Node&&a(this,p,Y).call(this,e,i)}}))},p=new WeakSet,Y=function(e,s){!(e instanceof ShadowRoot)&&s instanceof HTMLElement&&s.tagName==="STYLE"?(n(this,h).add(()=>{[...document.head.querySelectorAll("style")].find(i=>i.outerHTML===s.outerHTML)||document.head.appendChild(s)}),n(this,d).add(()=>{s.remove()})):e.appendChild(s)},H=new WeakSet,oe=function(e){return[e].flat().map(t=>t instanceof G?t.node:typeof t=="function"?X.isESClass(t)?new t:t():a(this,L,U).call(this,t)).flat().filter(Boolean)},F=new WeakSet,ae=function(e,s,t){t.length>s.length&&t.forEach(i=>{s.find(o=>a(this,C,I).call(this,i,o))||(e.removeChild(i),t=t.filter(o=>o!==i))}),t.forEach((i,o)=>{if(o<s.length){const c=s[o];a(this,C,I).call(this,i,c)||e.replaceChild(c,i)}else e.removeChild(i)});for(let i=t.length;i<s.length;i++)e.appendChild(s[i])},C=new WeakSet,I=function(e,s){return s?s instanceof Node?e.isEqualNode(s):e.textContent===s.toString():!1},L=new WeakSet,U=function(e){if(e instanceof Node)return e;if(e!=null){const s=String(e);if(s.trim().startsWith("<")&&s.trim().endsWith(">")){const t=document.createElement("div");return t.innerHTML=s,t.firstElementChild}else return new Text(s)}else return},P=new WeakMap,B=new WeakMap;let W=G;exports.ElementConstructor=W;
@@ -10,7 +10,8 @@ var n = (c, e, s) => (R(c, e, "read from private field"), s ? s.call(c) : e.get(
10
10
  var a = (c, e, s) => (R(c, e, "access private method"), s);
11
11
  import { S as m } from "./Store-JOKrNVEr.js";
12
12
  import { i as fe } from "./browser-0zX67oeU.js";
13
- import { c as U, u as le, i as Q } from "./string-DCGBU6em.js";
13
+ import { i as U } from "./object-R34VLqhp.js";
14
+ import { c as Q, u as le } from "./string-3lAkpJJP.js";
14
15
  import { connector as re } from "./connector/index.js";
15
16
  const ce = /* @__PURE__ */ new Set([
16
17
  // 'a', 'style', 'title', 'script',
@@ -218,11 +219,11 @@ l = new WeakMap(), d = new WeakMap(), h = new WeakMap(), N = new WeakSet(), Z =
218
219
  const o = new Text();
219
220
  n(this, h).add(
220
221
  i.subscribe((r) => {
221
- r.current ? o.nodeValue = `${U(t)}: ${r.current};` : o.nodeValue = "";
222
+ r.current ? o.nodeValue = `${Q(t)}: ${r.current};` : o.nodeValue = "";
222
223
  })
223
224
  ), s.appendChild(o);
224
225
  } else
225
- s.appendChild(new Text(`${U(t)}: ${i};`));
226
+ s.appendChild(new Text(`${Q(t)}: ${i};`));
226
227
  }
227
228
  }, p = new WeakSet(), z = function(e, s) {
228
229
  const t = n(this, l);
@@ -266,7 +267,7 @@ l = new WeakMap(), d = new WeakMap(), h = new WeakMap(), N = new WeakSet(), Z =
266
267
  } else if (t instanceof $)
267
268
  a(this, b, V).call(this, e, t.node);
268
269
  else if (t instanceof Function)
269
- a(this, g, T).call(this, e, Q(t) ? new t() : t());
270
+ a(this, g, T).call(this, e, U(t) ? new t() : t());
270
271
  else {
271
272
  const i = a(this, C, I).call(this, t);
272
273
  i instanceof Node && a(this, b, V).call(this, e, i);
@@ -279,7 +280,7 @@ l = new WeakMap(), d = new WeakMap(), h = new WeakMap(), N = new WeakSet(), Z =
279
280
  s.remove();
280
281
  })) : e.appendChild(s);
281
282
  }, F = new WeakSet(), oe = function(e) {
282
- return [e].flat().map((t) => t instanceof $ ? t.node : typeof t == "function" ? Q(t) ? new t() : t() : a(this, C, I).call(this, t)).flat().filter(Boolean);
283
+ return [e].flat().map((t) => t instanceof $ ? t.node : typeof t == "function" ? U(t) ? new t() : t() : a(this, C, I).call(this, t)).flat().filter(Boolean);
283
284
  }, P = new WeakSet(), ae = function(e, s, t) {
284
285
  t.length > s.length && t.forEach((i) => {
285
286
  s.find((o) => a(this, L, Y).call(this, i, o)) || (e.removeChild(i), t = t.filter((o) => o !== i));
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const r=require("../browser-CpzFX2xg.cjs"),s=require("../tags-DGIuh1Hi.cjs");class o extends t.CustomElement{constructor(){super(),r.isBrowser&&s.element(this,{style:{cursor:"default"},tabIndex:this.getAttribute("tabindex")||"0",role:"button",onKeydown:e=>{e.code==="Space"&&this.click()},onClick:()=>{this.click()}})}}exports.AbstractButtonElement=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const r=require("../browser-CpzFX2xg.cjs"),s=require("../tags-DX-eNxbA.cjs");class o extends t.CustomElement{constructor(){super(),r.isBrowser&&s.element(this,{style:{cursor:"default"},tabIndex:this.getAttribute("tabindex")||"0",role:"button",onKeydown:e=>{e.code==="Space"&&this.click()},onClick:()=>{this.click()}})}}exports.AbstractButtonElement=o;
@@ -1,7 +1,7 @@
1
1
  import { CustomElement as e } from "../custom-element/index.js";
2
2
  import "../Store-JOKrNVEr.js";
3
3
  import { i as o } from "../browser-0zX67oeU.js";
4
- import { e as r } from "../tags-D0k7-iVY.js";
4
+ import { e as r } from "../tags-C2jg1zYB.js";
5
5
  class l extends e {
6
6
  constructor() {
7
7
  super(), o && r(this, {
@@ -0,0 +1 @@
1
+ "use strict";var g=Object.defineProperty,D=Object.defineProperties;var m=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;var a=(e,u,r)=>u in e?g(e,u,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[u]=r,c=(e,u)=>{for(var r in u||(u={}))q.call(u,r)&&a(e,r,u[r]);if(l)for(var r of l(u))i.call(u,r)&&a(e,r,u[r]);return e},n=(e,u)=>D(e,m(u));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../useCreate-ClGKVMeG.cjs"),t=require("../../useDisconnect-sA74z4IZ.cjs");require("../../Store-D0_rDIsE.cjs");require("../../ticker/index.cjs");const s=require("../index.cjs"),w=require("../../Damped-mdFs8WSd.cjs");function T(e){const u=d.useCreate(r=>new s.Tweened(n(c({},e),{culling:(e==null?void 0:e.culling)===!0?r:e==null?void 0:e.culling})));return t.useDisconnect(()=>{u.close()}),u}function f(e){const u=d.useCreate(r=>new w.Damped(n(c({},e),{culling:(e==null?void 0:e.culling)===!0?r:e==null?void 0:e.culling})));return t.useDisconnect(()=>{u.close()}),u}exports.useDamped=f;exports.useTweened=T;
@@ -0,0 +1,8 @@
1
+ import { ElementOrSelector } from '../../utils';
2
+ import { Damped, DampedOptions, Tweened, TweenedOptions } from '..';
3
+ export declare function useTweened(options?: Omit<TweenedOptions, ''> & {
4
+ culling?: ElementOrSelector | boolean;
5
+ }): Tweened;
6
+ export declare function useDamped(options?: Omit<DampedOptions, ''> & {
7
+ culling?: ElementOrSelector | boolean;
8
+ }): Damped;
@@ -0,0 +1,38 @@
1
+ var n = Object.defineProperty, d = Object.defineProperties;
2
+ var w = Object.getOwnPropertyDescriptors;
3
+ var m = Object.getOwnPropertySymbols;
4
+ var D = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
5
+ var a = (e, r, u) => r in e ? n(e, r, { enumerable: !0, configurable: !0, writable: !0, value: u }) : e[r] = u, c = (e, r) => {
6
+ for (var u in r || (r = {}))
7
+ D.call(r, u) && a(e, u, r[u]);
8
+ if (m)
9
+ for (var u of m(r))
10
+ T.call(r, u) && a(e, u, r[u]);
11
+ return e;
12
+ }, l = (e, r) => d(e, w(r));
13
+ import { u as f } from "../../useCreate-DQSfJu7r.js";
14
+ import { u as g } from "../../useDisconnect-D5cBD1bq.js";
15
+ import "../../Store-JOKrNVEr.js";
16
+ import "../../ticker/index.js";
17
+ import { Tweened as t } from "../index.js";
18
+ import { D as x } from "../../Damped-Fy7tHx4d.js";
19
+ function y(e) {
20
+ const r = f((u) => new t(l(c({}, e), {
21
+ culling: (e == null ? void 0 : e.culling) === !0 ? u : e == null ? void 0 : e.culling
22
+ })));
23
+ return g(() => {
24
+ r.close();
25
+ }), r;
26
+ }
27
+ function z(e) {
28
+ const r = f((u) => new x(l(c({}, e), {
29
+ culling: (e == null ? void 0 : e.culling) === !0 ? u : e == null ? void 0 : e.culling
30
+ })));
31
+ return g(() => {
32
+ r.close();
33
+ }), r;
34
+ }
35
+ export {
36
+ z as useDamped,
37
+ y as useTweened
38
+ };
@@ -0,0 +1,2 @@
1
+ import { Attribute, AttributeOptions } from '..';
2
+ export declare function useAttribute<T extends number | string | boolean>(name: string, defaultValue: T, options?: AttributeOptions<T>): Attribute<T>;
@@ -1 +1 @@
1
- "use strict";var w=(s,r,e)=>{if(!r.has(s))throw TypeError("Cannot "+e)};var t=(s,r,e)=>(w(s,r,"read from private field"),e?e.call(s):r.get(s)),u=(s,r,e)=>{if(r.has(s))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(s):r.set(s,e)},b=(s,r,e,v)=>(w(s,r,"write to private field"),v?v.call(s,e):r.set(s,e),e);var n=(s,r,e)=>(w(s,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../Store-D0_rDIsE.cjs"),C=require("../attributes-Bf2svn4j.cjs"),z=require("../browser-CpzFX2xg.cjs"),E=require("../dom-qY2LdCVL.cjs");var i,h,o,l,c,d,y,f,A,a,m;class M extends q.Store{constructor(e,v,S,g){super(S,g);u(this,d);u(this,f);u(this,a);u(this,i,null);u(this,h,void 0);u(this,o,null);u(this,l,null);u(this,c,!1);b(this,h,v),z.isBrowser&&(b(this,i,E.getElement(e)),g!=null&&g.sync&&this.subscribe(p=>{t(this,i).setAttribute(t(this,h),p.current.toString())}),b(this,o,new MutationObserver(p=>{p.forEach(O=>{O.type==="attributes"&&O.attributeName===t(this,h)&&n(this,d,y).call(this)})})),b(this,l,new ResizeObserver(()=>{t(this,i).isConnected&&!t(this,c)?t(this,o).observe(t(this,i),{attributes:!0}):!t(this,i).isConnected&&t(this,c)&&n(this,a,m).call(this),b(this,c,t(this,i).isConnected)})))}get current(){return n(this,f,A).call(this),super.current}set current(e){super.current=e}subscribe(e){return n(this,f,A).call(this),super.subscribe(e)}unsubscribe(e){super.unsubscribe(e),this.subscribers.size||n(this,a,m).call(this)}close(){super.close(),n(this,a,m).call(this)}}i=new WeakMap,h=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakSet,y=function(){const e=t(this,i).getAttribute(t(this,h));e!=null&&(this.current=C.parseAttributeValue(e))},f=new WeakSet,A=function(){t(this,c)||(n(this,d,y).call(this),t(this,l).observe(t(this,i)))},a=new WeakSet,m=function(){t(this,c)&&(t(this,o).disconnect(),t(this,l).disconnect())};exports.Attribute=M;
1
+ "use strict";var f=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var r=(e,s,t)=>(f(e,s,"read from private field"),t?t.call(e):s.get(e)),n=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},a=(e,s,t,c)=>(f(e,s,"write to private field"),c?c.call(e,t):s.set(e,t),t);var v=(e,s,t)=>(f(e,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../Store-D0_rDIsE.cjs"),A=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),q=require("../dom-qY2LdCVL.cjs");var i,u,b,h,m;class p extends y.Store{constructor(t,c,l,o){super(l,o);n(this,h);n(this,i,null);n(this,u,void 0);n(this,b,null);a(this,u,c),S.isBrowser&&(a(this,i,q.getElement(t)),a(this,b,new MutationObserver(d=>{d.forEach(g=>{g.type==="attributes"&&g.attributeName===r(this,u)&&v(this,h,m).call(this)})})),o!=null&&o.sync&&this.subscribe(d=>{r(this,i).setAttribute(r(this,u),d.current.toString())}))}subscribe(t){const c=!this.subscribers.size,l=super.subscribe(t);return c&&(r(this,b).observe(r(this,i),{attributes:!0}),v(this,h,m).call(this)),l}unsubscribe(t){super.unsubscribe(t),this.subscribers.size||r(this,b).disconnect()}close(){super.close(),r(this,b).disconnect()}}i=new WeakMap,u=new WeakMap,b=new WeakMap,h=new WeakSet,m=function(){const t=r(this,i).getAttribute(r(this,u));t!=null&&(this.current=A.parseAttributeValue(t))};exports.Attribute=p;
@@ -6,8 +6,6 @@ export interface AttributeOptions<T> extends StoreOptions<T> {
6
6
  export declare class Attribute<T extends string | number | boolean> extends Store<T> {
7
7
  #private;
8
8
  constructor(elementOrSelector: ElementOrSelector, name: string, defaultValue: T, options?: AttributeOptions<T>);
9
- get current(): T;
10
- set current(value: T);
11
9
  subscribe(callback: StoreCallback<StoreEntry<T>>): () => void;
12
10
  unsubscribe(callback: StoreCallback<StoreEntry<T>>): void;
13
11
  close(): void;
@@ -1,65 +1,50 @@
1
- var w = (s, i, t) => {
2
- if (!i.has(s))
1
+ var l = (s, e, t) => {
2
+ if (!e.has(s))
3
3
  throw TypeError("Cannot " + t);
4
4
  };
5
- var e = (s, i, t) => (w(s, i, "read from private field"), t ? t.call(s) : i.get(s)), u = (s, i, t) => {
6
- if (i.has(s))
5
+ var r = (s, e, t) => (l(s, e, "read from private field"), t ? t.call(s) : e.get(s)), h = (s, e, t) => {
6
+ if (e.has(s))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- i instanceof WeakSet ? i.add(s) : i.set(s, t);
9
- }, b = (s, i, t, p) => (w(s, i, "write to private field"), p ? p.call(s, t) : i.set(s, t), t);
10
- var h = (s, i, t) => (w(s, i, "access private method"), t);
11
- import { S as z } from "../Store-JOKrNVEr.js";
12
- import { p as S } from "../attributes-69we3byR.js";
13
- import { i as x } from "../browser-0zX67oeU.js";
14
- import { g as E } from "../dom-BY7JhTx5.js";
15
- var r, c, a, o, n, f, A, m, C, l, v;
16
- class U extends z {
17
- constructor(t, p, y, d) {
18
- super(y, d);
19
- u(this, f);
20
- u(this, m);
21
- u(this, l);
22
- u(this, r, null);
23
- u(this, c, void 0);
24
- u(this, a, null);
25
- u(this, o, null);
26
- u(this, n, !1);
27
- b(this, c, p), x && (b(this, r, E(t)), d != null && d.sync && this.subscribe((g) => {
28
- e(this, r).setAttribute(e(this, c), g.current.toString());
29
- }), b(this, a, new MutationObserver((g) => {
30
- g.forEach((O) => {
31
- O.type === "attributes" && O.attributeName === e(this, c) && h(this, f, A).call(this);
8
+ e instanceof WeakSet ? e.add(s) : e.set(s, t);
9
+ }, o = (s, e, t, c) => (l(s, e, "write to private field"), c ? c.call(s, t) : e.set(s, t), t);
10
+ var p = (s, e, t) => (l(s, e, "access private method"), t);
11
+ import { S as g } from "../Store-JOKrNVEr.js";
12
+ import { p as A } from "../attributes-69we3byR.js";
13
+ import { i as y } from "../browser-0zX67oeU.js";
14
+ import { g as S } from "../dom-BY7JhTx5.js";
15
+ var i, u, b, n, v;
16
+ class B extends g {
17
+ constructor(t, c, m, a) {
18
+ super(m, a);
19
+ h(this, n);
20
+ h(this, i, null);
21
+ h(this, u, void 0);
22
+ h(this, b, null);
23
+ o(this, u, c), y && (o(this, i, S(t)), o(this, b, new MutationObserver((f) => {
24
+ f.forEach((d) => {
25
+ d.type === "attributes" && d.attributeName === r(this, u) && p(this, n, v).call(this);
32
26
  });
33
- })), b(this, o, new ResizeObserver(() => {
34
- e(this, r).isConnected && !e(this, n) ? e(this, a).observe(e(this, r), {
35
- attributes: !0
36
- }) : !e(this, r).isConnected && e(this, n) && h(this, l, v).call(this), b(this, n, e(this, r).isConnected);
37
- })));
38
- }
39
- get current() {
40
- return h(this, m, C).call(this), super.current;
41
- }
42
- set current(t) {
43
- super.current = t;
27
+ })), a != null && a.sync && this.subscribe((f) => {
28
+ r(this, i).setAttribute(r(this, u), f.current.toString());
29
+ }));
44
30
  }
45
31
  subscribe(t) {
46
- return h(this, m, C).call(this), super.subscribe(t);
32
+ const c = !this.subscribers.size, m = super.subscribe(t);
33
+ return c && (r(this, b).observe(r(this, i), {
34
+ attributes: !0
35
+ }), p(this, n, v).call(this)), m;
47
36
  }
48
37
  unsubscribe(t) {
49
- super.unsubscribe(t), this.subscribers.size || h(this, l, v).call(this);
38
+ super.unsubscribe(t), this.subscribers.size || r(this, b).disconnect();
50
39
  }
51
40
  close() {
52
- super.close(), h(this, l, v).call(this);
41
+ super.close(), r(this, b).disconnect();
53
42
  }
54
43
  }
55
- r = new WeakMap(), c = new WeakMap(), a = new WeakMap(), o = new WeakMap(), n = new WeakMap(), f = new WeakSet(), A = function() {
56
- const t = e(this, r).getAttribute(e(this, c));
57
- t != null && (this.current = S(t));
58
- }, m = new WeakSet(), C = function() {
59
- e(this, n) || (h(this, f, A).call(this), e(this, o).observe(e(this, r)));
60
- }, l = new WeakSet(), v = function() {
61
- e(this, n) && (e(this, a).disconnect(), e(this, o).disconnect());
44
+ i = new WeakMap(), u = new WeakMap(), b = new WeakMap(), n = new WeakSet(), v = function() {
45
+ const t = r(this, i).getAttribute(r(this, u));
46
+ t != null && (this.current = A(t));
62
47
  };
63
48
  export {
64
- U as Attribute
49
+ B as Attribute
65
50
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const S=require("../math-GDWEqu7y.cjs"),E=require("../tags-DGIuh1Hi.cjs"),b=require("../createStylesheet-B5Nhxdpo.cjs"),k=require("../element-resizer/index.cjs"),C=require("../ticker/index.cjs");var y=Object.defineProperty,q=Object.getOwnPropertyDescriptor,P=(i,e,s,h)=>{for(var r=h>1?void 0:h?q(e,s):e,f=i.length-1,g;f>=0;f--)(g=i[f])&&(r=(h?g(e,s,r):g(r))||r);return h&&r&&y(e,s,r),r},R=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(R(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},c=(i,e,s,h)=>(R(i,e,"write to private field"),h?h.call(i,s):e.set(i,s),s),M=(i,e,s)=>(R(i,e,"access private method"),s),n,p,l,o,d,u,v,_,m,w,x;const O=b.createStylesheet({":host, canvas":{display:"block",width:"100%",height:"100%"}});exports.CanvasElement=class extends W.CustomElement{constructor(){super(),a(this,w),a(this,n,null),a(this,p,null),a(this,l,0),a(this,o,0),a(this,d,1),a(this,u,0),a(this,v,1),a(this,_,e=>{c(this,d,S.clamp(devicePixelRatio,1,2)),c(this,l,e.contentRect.width),c(this,o,e.contentRect.height),t(this,n).width=t(this,l)*this.pixelRatio,t(this,n).height=t(this,o)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),M(this,w,x).call(this)}),a(this,m,e=>{c(this,u,e.timestamp),c(this,v,e.elapsed),M(this,w,x).call(this)}),this.openShadow(O),E.element(this,{children:E.canvas({ref:e=>{c(this,n,e),c(this,p,e.getContext("2d"))}})})}get canvasElement(){return t(this,n)}get context(){return t(this,p)}get pixelRatio(){return t(this,d)}get width(){return t(this,l)}get height(){return t(this,o)}get detail(){return{width:t(this,l),height:t(this,o),element:this,canvasElement:t(this,n),pixelRatio:t(this,d),context:t(this,p),timestamp:t(this,u),elapsed:t(this,v)}}connectedCallback(){k.elementResizer.subscribe(this,t(this,_)),this.hasAttribute("static")||C.ticker.subscribe(t(this,m),{culling:this,maxFPS:this.hasAttribute("fps")?parseInt(this.getAttribute("fps")):void 0})}disconnectedCallback(){k.elementResizer.unsubscribe(t(this,_)),C.ticker.unsubscribe(t(this,m)),t(this,n).remove()}};n=new WeakMap;p=new WeakMap;l=new WeakMap;o=new WeakMap;d=new WeakMap;u=new WeakMap;v=new WeakMap;_=new WeakMap;m=new WeakMap;w=new WeakSet;x=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))};exports.CanvasElement=P([W.define("e-canvas")],exports.CanvasElement);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const S=require("../math-GDWEqu7y.cjs"),E=require("../tags-DX-eNxbA.cjs"),b=require("../createStylesheet-C0OnN0Br.cjs"),k=require("../element-resizer/index.cjs"),C=require("../ticker/index.cjs");var y=Object.defineProperty,q=Object.getOwnPropertyDescriptor,P=(i,e,s,h)=>{for(var r=h>1?void 0:h?q(e,s):e,f=i.length-1,g;f>=0;f--)(g=i[f])&&(r=(h?g(e,s,r):g(r))||r);return h&&r&&y(e,s,r),r},R=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(R(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},c=(i,e,s,h)=>(R(i,e,"write to private field"),h?h.call(i,s):e.set(i,s),s),M=(i,e,s)=>(R(i,e,"access private method"),s),n,p,l,o,d,u,v,_,m,w,x;const O=b.createStylesheet({":host, canvas":{display:"block",width:"100%",height:"100%"}});exports.CanvasElement=class extends W.CustomElement{constructor(){super(),a(this,w),a(this,n,null),a(this,p,null),a(this,l,0),a(this,o,0),a(this,d,1),a(this,u,0),a(this,v,1),a(this,_,e=>{c(this,d,S.clamp(devicePixelRatio,1,2)),c(this,l,e.contentRect.width),c(this,o,e.contentRect.height),t(this,n).width=t(this,l)*this.pixelRatio,t(this,n).height=t(this,o)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),M(this,w,x).call(this)}),a(this,m,e=>{c(this,u,e.timestamp),c(this,v,e.elapsed),M(this,w,x).call(this)}),this.openShadow(O),E.element(this,{children:E.canvas({ref:e=>{c(this,n,e),c(this,p,e.getContext("2d"))}})})}get canvasElement(){return t(this,n)}get context(){return t(this,p)}get pixelRatio(){return t(this,d)}get width(){return t(this,l)}get height(){return t(this,o)}get detail(){return{width:t(this,l),height:t(this,o),element:this,canvasElement:t(this,n),pixelRatio:t(this,d),context:t(this,p),timestamp:t(this,u),elapsed:t(this,v)}}connectedCallback(){k.elementResizer.subscribe(this,t(this,_)),this.hasAttribute("static")||C.ticker.subscribe(t(this,m),{culling:this,maxFPS:this.hasAttribute("fps")?parseInt(this.getAttribute("fps")):void 0})}disconnectedCallback(){k.elementResizer.unsubscribe(t(this,_)),C.ticker.unsubscribe(t(this,m)),t(this,n).remove()}};n=new WeakMap;p=new WeakMap;l=new WeakMap;o=new WeakMap;d=new WeakMap;u=new WeakMap;v=new WeakMap;_=new WeakMap;m=new WeakMap;w=new WeakSet;x=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))};exports.CanvasElement=P([W.define("e-canvas")],exports.CanvasElement);
@@ -1,8 +1,8 @@
1
1
  import { CustomElement as M, define as b } from "../custom-element/index.js";
2
2
  import "../Store-JOKrNVEr.js";
3
3
  import { c as P } from "../math-BOBiC4TN.js";
4
- import { e as S, q as y } from "../tags-D0k7-iVY.js";
5
- import { c as A } from "../createStylesheet-DpGvTRP3.js";
4
+ import { e as S, q as y } from "../tags-C2jg1zYB.js";
5
+ import { c as A } from "../createStylesheet-CD11E4C8.js";
6
6
  import { elementResizer as k } from "../element-resizer/index.js";
7
7
  import { ticker as E } from "../ticker/index.js";
8
8
  var O = Object.defineProperty, z = Object.getOwnPropertyDescriptor, D = (t, i, s, r) => {
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- "use strict";const n=require("./tags-DGIuh1Hi.cjs");function r(t){const e=new CSSStyleSheet;return e.replaceSync(n.style(t).node.innerHTML),e}exports.createStylesheet=r;
1
+ "use strict";const n=require("./tags-DX-eNxbA.cjs");function r(t){const e=new CSSStyleSheet;return e.replaceSync(n.style(t).node.innerHTML),e}exports.createStylesheet=r;
@@ -1,4 +1,4 @@
1
- import { aC as n } from "./tags-D0k7-iVY.js";
1
+ import { aC as n } from "./tags-C2jg1zYB.js";
2
2
  function c(t) {
3
3
  const e = new CSSStyleSheet();
4
4
  return e.replaceSync(n(t).node.innerHTML), e;
@@ -1 +1 @@
1
- "use strict";const l=require("./string-Cgp_uJvP.cjs");function s(r,a){const t=(a==null?void 0:a.prefix)||"",c={style:{}};for(const e in r)c[e]={var:`var(--${t}${l.camelToKebab(e)})`,value:r[e]},c.style[`--${t}${l.camelToKebab(e)}`]=r[e];return c}exports.createTheme=s;
1
+ "use strict";const l=require("./string-vBu90jhV.cjs");function s(r,a){const t=(a==null?void 0:a.prefix)||"",c={style:{}};for(const e in r)c[e]={var:`var(--${t}${l.camelToKebab(e)})`,value:r[e]},c.style[`--${t}${l.camelToKebab(e)}`]=r[e];return c}exports.createTheme=s;
@@ -1,4 +1,4 @@
1
- import { c as l } from "./string-DCGBU6em.js";
1
+ import { c as l } from "./string-3lAkpJJP.js";
2
2
  function m(r, a) {
3
3
  const f = (a == null ? void 0 : a.prefix) || "", c = {
4
4
  style: {}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../ElementConstructor-CdUaQS-S.cjs"),e=require("../tags-DGIuh1Hi.cjs"),r=require("../createStylesheet-B5Nhxdpo.cjs"),a=require("../createTheme-CLqJF9Pw.cjs");exports.ElementConstructor=t.ElementConstructor;exports.a=e.a;exports.abbr=e.abbr;exports.address=e.address;exports.area=e.area;exports.article=e.article;exports.aside=e.aside;exports.audio=e.audio;exports.b=e.b;exports.base=e.base;exports.bdi=e.bdi;exports.bdo=e.bdo;exports.blockquote=e.blockquote;exports.body=e.body;exports.br=e.br;exports.button=e.button;exports.canvas=e.canvas;exports.caption=e.caption;exports.cite=e.cite;exports.code=e.code;exports.col=e.col;exports.colgroup=e.colgroup;exports.contents=e.contents;exports.data=e.data;exports.datalist=e.datalist;exports.dd=e.dd;exports.del=e.del;exports.details=e.details;exports.dfn=e.dfn;exports.dialog=e.dialog;exports.div=e.div;exports.dl=e.dl;exports.dt=e.dt;exports.element=e.element;exports.em=e.em;exports.embed=e.embed;exports.empty=e.empty;exports.fieldset=e.fieldset;exports.figcaption=e.figcaption;exports.figure=e.figure;exports.footer=e.footer;exports.form=e.form;exports.fragment=e.fragment;exports.h1=e.h1;exports.h2=e.h2;exports.h3=e.h3;exports.h4=e.h4;exports.h5=e.h5;exports.h6=e.h6;exports.head=e.head;exports.header=e.header;exports.hgroup=e.hgroup;exports.hr=e.hr;exports.html=e.html;exports.htmlVar=e.htmlVar;exports.i=e.i;exports.iframe=e.iframe;exports.img=e.img;exports.input=e.input;exports.ins=e.ins;exports.kbd=e.kbd;exports.label=e.label;exports.legend=e.legend;exports.li=e.li;exports.link=e.link;exports.main=e.main;exports.map=e.map;exports.mark=e.mark;exports.menu=e.menu;exports.meta=e.meta;exports.meter=e.meter;exports.nav=e.nav;exports.noscript=e.noscript;exports.object=e.object;exports.ol=e.ol;exports.optgroup=e.optgroup;exports.option=e.option;exports.output=e.output;exports.p=e.p;exports.picture=e.picture;exports.pre=e.pre;exports.progress=e.progress;exports.q=e.q;exports.rp=e.rp;exports.rt=e.rt;exports.ruby=e.ruby;exports.s=e.s;exports.samp=e.samp;exports.script=e.script;exports.search=e.search;exports.section=e.section;exports.select=e.select;exports.slot=e.slot;exports.small=e.small;exports.source=e.source;exports.span=e.span;exports.strong=e.strong;exports.style=e.style;exports.sub=e.sub;exports.summary=e.summary;exports.sup=e.sup;exports.table=e.table;exports.tbody=e.tbody;exports.td=e.td;exports.template=e.template;exports.textarea=e.textarea;exports.tfoot=e.tfoot;exports.th=e.th;exports.thead=e.thead;exports.time=e.time;exports.title=e.title;exports.tr=e.tr;exports.track=e.track;exports.u=e.u;exports.ul=e.ul;exports.video=e.video;exports.wbr=e.wbr;exports.createStylesheet=r.createStylesheet;exports.createTheme=a.createTheme;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../ElementConstructor-B61ZFTEB.cjs"),e=require("../tags-DX-eNxbA.cjs"),r=require("../createStylesheet-C0OnN0Br.cjs"),a=require("../createTheme-B_W5dUY9.cjs");exports.ElementConstructor=t.ElementConstructor;exports.a=e.a;exports.abbr=e.abbr;exports.address=e.address;exports.area=e.area;exports.article=e.article;exports.aside=e.aside;exports.audio=e.audio;exports.b=e.b;exports.base=e.base;exports.bdi=e.bdi;exports.bdo=e.bdo;exports.blockquote=e.blockquote;exports.body=e.body;exports.br=e.br;exports.button=e.button;exports.canvas=e.canvas;exports.caption=e.caption;exports.cite=e.cite;exports.code=e.code;exports.col=e.col;exports.colgroup=e.colgroup;exports.contents=e.contents;exports.data=e.data;exports.datalist=e.datalist;exports.dd=e.dd;exports.del=e.del;exports.details=e.details;exports.dfn=e.dfn;exports.dialog=e.dialog;exports.div=e.div;exports.dl=e.dl;exports.dt=e.dt;exports.element=e.element;exports.em=e.em;exports.embed=e.embed;exports.empty=e.empty;exports.fieldset=e.fieldset;exports.figcaption=e.figcaption;exports.figure=e.figure;exports.footer=e.footer;exports.form=e.form;exports.fragment=e.fragment;exports.h1=e.h1;exports.h2=e.h2;exports.h3=e.h3;exports.h4=e.h4;exports.h5=e.h5;exports.h6=e.h6;exports.head=e.head;exports.header=e.header;exports.hgroup=e.hgroup;exports.hr=e.hr;exports.html=e.html;exports.htmlVar=e.htmlVar;exports.i=e.i;exports.iframe=e.iframe;exports.img=e.img;exports.input=e.input;exports.ins=e.ins;exports.kbd=e.kbd;exports.label=e.label;exports.legend=e.legend;exports.li=e.li;exports.link=e.link;exports.main=e.main;exports.map=e.map;exports.mark=e.mark;exports.menu=e.menu;exports.meta=e.meta;exports.meter=e.meter;exports.nav=e.nav;exports.noscript=e.noscript;exports.object=e.object;exports.ol=e.ol;exports.optgroup=e.optgroup;exports.option=e.option;exports.output=e.output;exports.p=e.p;exports.picture=e.picture;exports.pre=e.pre;exports.progress=e.progress;exports.q=e.q;exports.rp=e.rp;exports.rt=e.rt;exports.ruby=e.ruby;exports.s=e.s;exports.samp=e.samp;exports.script=e.script;exports.search=e.search;exports.section=e.section;exports.select=e.select;exports.slot=e.slot;exports.small=e.small;exports.source=e.source;exports.span=e.span;exports.strong=e.strong;exports.style=e.style;exports.sub=e.sub;exports.summary=e.summary;exports.sup=e.sup;exports.table=e.table;exports.tbody=e.tbody;exports.td=e.td;exports.template=e.template;exports.textarea=e.textarea;exports.tfoot=e.tfoot;exports.th=e.th;exports.thead=e.thead;exports.time=e.time;exports.title=e.title;exports.tr=e.tr;exports.track=e.track;exports.u=e.u;exports.ul=e.ul;exports.video=e.video;exports.wbr=e.wbr;exports.createStylesheet=r.createStylesheet;exports.createTheme=a.createTheme;
@@ -1,7 +1,7 @@
1
- import { E as e } from "../ElementConstructor-1bvPqYNa.js";
2
- import { a as r, b as o, c as i, d as l, f as d, g as m, h as p, i as c, j as n, k as u, l as b, m as h, n as f, o as g, p as y, q as k, r as x, s as v, t as q, u as E, v as j, aZ as w, w as C, x as S, y as T, z as V, A as z, B as A, C as B, D, E as F, F as G, e as H, G as I, H as J, aY as K, I as L, J as M, K as N, L as O, M as P, aX as Q, N as R, O as U, P as W, Q as X, R as Y, S as Z, T as _, U as $, V as aa, W as sa, X as ea, aU as ta, Y as ra, Z as oa, _ as ia, $ as la, a0 as da, a1 as ma, a2 as pa, a3 as ca, a4 as na, a5 as ua, a6 as ba, a7 as ha, a8 as fa, a9 as ga, aa as ya, ab as ka, ac as xa, ad as va, ae as qa, af as Ea, ag as ja, ah as wa, ai as Ca, aj as Sa, ak as Ta, al as Va, am as za, an as Aa, ao as Ba, ap as Da, aq as Fa, ar as Ga, as as Ha, at as Ia, au as Ja, av as Ka, aw as La, ax as Ma, ay as Na, az as Oa, aA as Pa, aB as Qa, aC as Ra, aD as Ua, aE as Wa, aF as Xa, aG as Ya, aH as Za, aI as _a, aJ as $a, aK as as, aL as ss, aM as es, aN as ts, aO as rs, aP as os, aQ as is, aR as ls, aS as ds, aT as ms, aV as ps, aW as cs } from "../tags-D0k7-iVY.js";
3
- import { c as us } from "../createStylesheet-DpGvTRP3.js";
4
- import { c as hs } from "../createTheme-WJyOPh-q.js";
1
+ import { E as e } from "../ElementConstructor-CvNdPKJy.js";
2
+ import { a as r, b as o, c as i, d as l, f as d, g as m, h as p, i as c, j as n, k as u, l as b, m as h, n as f, o as g, p as y, q as k, r as x, s as v, t as q, u as E, v as j, aZ as w, w as C, x as S, y as T, z as V, A as z, B as A, C as B, D, E as F, F as G, e as H, G as I, H as J, aY as K, I as L, J as M, K as N, L as O, M as P, aX as Q, N as R, O as U, P as W, Q as X, R as Y, S as Z, T as _, U as $, V as aa, W as sa, X as ea, aU as ta, Y as ra, Z as oa, _ as ia, $ as la, a0 as da, a1 as ma, a2 as pa, a3 as ca, a4 as na, a5 as ua, a6 as ba, a7 as ha, a8 as fa, a9 as ga, aa as ya, ab as ka, ac as xa, ad as va, ae as qa, af as Ea, ag as ja, ah as wa, ai as Ca, aj as Sa, ak as Ta, al as Va, am as za, an as Aa, ao as Ba, ap as Da, aq as Fa, ar as Ga, as as Ha, at as Ia, au as Ja, av as Ka, aw as La, ax as Ma, ay as Na, az as Oa, aA as Pa, aB as Qa, aC as Ra, aD as Ua, aE as Wa, aF as Xa, aG as Ya, aH as Za, aI as _a, aJ as $a, aK as as, aL as ss, aM as es, aN as ts, aO as rs, aP as os, aQ as is, aR as ls, aS as ds, aT as ms, aV as ps, aW as cs } from "../tags-C2jg1zYB.js";
3
+ import { c as us } from "../createStylesheet-CD11E4C8.js";
4
+ import { c as hs } from "../createTheme-D0IoYkYN.js";
5
5
  export {
6
6
  e as ElementConstructor,
7
7
  r as a,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../useConnect-DcfeqwzW.cjs");require("../../Store-D0_rDIsE.cjs");const c=require("../index.cjs");function l(...e){u.useConnect(n=>{const t=e.length>1?e[0]:n,i=e.length>1?e[1]:e[0];return c.elementResizer.subscribe(t,i)})}exports.useElementResize=l;
@@ -0,0 +1,4 @@
1
+ import { ElementResizerCallback } from '..';
2
+ import { ElementOrSelector } from '../../utils';
3
+ export declare function useElementResize(elementOrSelector: ElementOrSelector, callback: ElementResizerCallback): void;
4
+ export declare function useElementResize(elementOrSelector: ElementOrSelector, callback: ElementResizerCallback): void;
@@ -0,0 +1,12 @@
1
+ import { u as m } from "../../useConnect-CXdqKdRX.js";
2
+ import "../../Store-JOKrNVEr.js";
3
+ import { elementResizer as c } from "../index.js";
4
+ function u(...e) {
5
+ m((t) => {
6
+ const n = e.length > 1 ? e[0] : t, o = e.length > 1 ? e[1] : e[0];
7
+ return c.subscribe(n, o);
8
+ });
9
+ }
10
+ export {
11
+ u as useElementResize
12
+ };