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,7 @@
1
+ export declare function getCurrentViewport(target: THREE.Vector3 | [number, number, number]): {
2
+ width: number;
3
+ height: number;
4
+ factor: number;
5
+ distance: number;
6
+ aspect: number;
7
+ };
@@ -1,4 +1,4 @@
1
- "use strict";var I=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var z=(t,e,s)=>(I(t,e,"read from private field"),s?s.call(t):e.get(t)),A=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},H=(t,e,s,i)=>(I(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s);const E=require("./custom-element/index.cjs");require("./Store-D0_rDIsE.cjs");const M=require("./browser-CpzFX2xg.cjs"),N=require("./events-Crwi8fz6.cjs"),Y=require("./style-At6aDoqG.cjs"),a=require("./tags-DGIuh1Hi.cjs"),P=require("./createStylesheet-B5Nhxdpo.cjs"),w=require("./theme/index.cjs");var Z=Object.defineProperty,J=Object.getOwnPropertyDescriptor,Q=(t,e,s,i)=>{for(var n=i>1?void 0:i?J(e,s):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(n=(i?h(e,s,n):h(n))||n);return i&&n&&Z(e,s,n),n},q=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},d=(t,e,s,i)=>(q(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),B=(t,e,s)=>(q(t,e,"access private method"),s),y,S,o,v,u,f,L,C,W;const V=P.createStylesheet({":host":{position:"relative"},".head":{width:"100%",cursor:"default",background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start",padding:"0",margin:"0"},".body":{boxSizing:"border-box",position:"var(--position, unset)",top:"100%",left:"0",width:"100%",overflow:"hidden",transitionDuration:`var(--duration, ${w.aptechkaTheme.durationShort.var})`,transitionProperty:"height",cursor:"default"},".body-inner":{display:"grid",gap:"var(--gap, 0px)",width:"100%",paddingTop:"var(--gap, 0px)"}});exports.SelectElement=class extends E.CustomElement{constructor(){super(),c(this,C),c(this,y,null),c(this,S,""),c(this,o,null),c(this,v,!1),c(this,u,void 0),c(this,f,null),c(this,L,()=>{N.dispatchSizeChangeEvent(this)}),M.isBrowser&&(this.openShadow(V),d(this,y,this.attachInternals()),d(this,f,new ResizeObserver(r(this,L))),a.element(this,{children:[a.button({class:"head",children:a.slot({name:"head"}),onClick:()=>{this.opened?this.close():this.open()}}),a.div({class:"body",style:{height:"0px"},children:a.div({class:"body-inner",children:a.slot()}),ref:e=>{d(this,o,e)}})]}))}get value(){return r(this,S)}set value(e){d(this,S,e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}get internals(){return r(this,y)}get opened(){return r(this,v)}open(){clearTimeout(r(this,u)),d(this,v,!0),r(this,o).style.display="grid",this.classList.add("triggered"),setTimeout(()=>{this.classList.add("opened"),r(this,o).style.height=r(this,o).scrollHeight+"px",B(this,C,W).call(this)},0)}close(){d(this,v,!1),r(this,o).style.height="0px",this.classList.remove("opened"),B(this,C,W).call(this),d(this,u,setTimeout(()=>{this.classList.remove("triggered"),r(this,o).style.display="none"},Y.getElementTransitionDurationMS(r(this,o))))}connectedCallback(){r(this,f).observe(r(this,o))}disconnectedCallback(){clearTimeout(r(this,u)),r(this,f).disconnect()}};y=new WeakMap;S=new WeakMap;o=new WeakMap;v=new WeakMap;u=new WeakMap;f=new WeakMap;L=new WeakMap;C=new WeakSet;W=function(){this.dispatchEvent(new CustomEvent("selectToggle",{bubbles:!0,composed:!0,detail:{opened:r(this,v)}}))};exports.SelectElement.formAssociated=!0;exports.SelectElement=Q([E.define("e-select")],exports.SelectElement);var _;class D extends E.CustomElement{constructor(){super(...arguments);A(this,_,null)}get selectElement(){return z(this,_)}connectedCallback(){var i,n;const s=(n=(i=this.assignedSlot)==null?void 0:i.getRootNode())==null?void 0:n.host;s?H(this,_,s):console.log(this,"e-select not found")}}_=new WeakMap;var X=Object.defineProperty,j=Object.getOwnPropertyDescriptor,ee=(t,e,s,i)=>{for(var n=i>1?void 0:i?j(e,s):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(n=(i?h(e,s,n):h(n))||n);return i&&n&&X(e,s,n),n},U=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},O=(t,e,s)=>(U(t,e,"read from private field"),s?s.call(t):e.get(t)),G=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},R=(t,e,s)=>(U(t,e,"access private method"),s),m,T,b;const te=P.createStylesheet({":host":{width:"100%",height:w.aptechkaTheme.heightInput.var,display:"inline-flex",alignItems:"center"}});exports.SelectOptionElement=class extends D{constructor(){super(),G(this,T),G(this,m,()=>{this.selectElement.value===this.value?this.style.display="none":this.style.display=""}),M.isBrowser&&(this.openShadow(te),a.element(this,{tabIndex:"0",onClick:()=>{R(this,T,b).call(this)},onKeydown:e=>{e.code==="Space"&&R(this,T,b).call(this)},children:[a.slot()]}))}get value(){return(this.hasAttribute("value")?this.getAttribute("value"):this.innerText)||""}connectedCallback(){super.connectedCallback(),this.hasAttribute("default")&&(this.selectElement.value||(this.selectElement.value=this.value)),this.selectElement.addEventListener("change",O(this,m)),setTimeout(()=>{O(this,m).call(this)})}disconnectedCallback(){this.selectElement.removeEventListener("change",O(this,m))}};m=new WeakMap;T=new WeakSet;b=function(){this.selectElement.value=this.value,this.selectElement.close()};exports.SelectOptionElement=ee([E.define("e-select-option")],exports.SelectOptionElement);const F=`<svg
1
+ "use strict";var I=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var z=(t,e,s)=>(I(t,e,"read from private field"),s?s.call(t):e.get(t)),A=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},H=(t,e,s,i)=>(I(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s);const E=require("./custom-element/index.cjs");require("./Store-D0_rDIsE.cjs");const M=require("./browser-CpzFX2xg.cjs"),N=require("./events-Crwi8fz6.cjs"),Y=require("./style-At6aDoqG.cjs"),a=require("./tags-DX-eNxbA.cjs"),P=require("./createStylesheet-C0OnN0Br.cjs"),w=require("./theme/index.cjs");var Z=Object.defineProperty,J=Object.getOwnPropertyDescriptor,Q=(t,e,s,i)=>{for(var n=i>1?void 0:i?J(e,s):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(n=(i?h(e,s,n):h(n))||n);return i&&n&&Z(e,s,n),n},q=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},d=(t,e,s,i)=>(q(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),B=(t,e,s)=>(q(t,e,"access private method"),s),y,S,o,v,u,f,L,C,W;const V=P.createStylesheet({":host":{position:"relative"},".head":{width:"100%",cursor:"default",background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start",padding:"0",margin:"0"},".body":{boxSizing:"border-box",position:"var(--position, unset)",top:"100%",left:"0",width:"100%",overflow:"hidden",transitionDuration:`var(--duration, ${w.aptechkaTheme.durationShort.var})`,transitionProperty:"height",cursor:"default"},".body-inner":{display:"grid",gap:"var(--gap, 0px)",width:"100%",paddingTop:"var(--gap, 0px)"}});exports.SelectElement=class extends E.CustomElement{constructor(){super(),c(this,C),c(this,y,null),c(this,S,""),c(this,o,null),c(this,v,!1),c(this,u,void 0),c(this,f,null),c(this,L,()=>{N.dispatchSizeChangeEvent(this)}),M.isBrowser&&(this.openShadow(V),d(this,y,this.attachInternals()),d(this,f,new ResizeObserver(r(this,L))),a.element(this,{children:[a.button({class:"head",children:a.slot({name:"head"}),onClick:()=>{this.opened?this.close():this.open()}}),a.div({class:"body",style:{height:"0px"},children:a.div({class:"body-inner",children:a.slot()}),ref:e=>{d(this,o,e)}})]}))}get value(){return r(this,S)}set value(e){d(this,S,e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}get internals(){return r(this,y)}get opened(){return r(this,v)}open(){clearTimeout(r(this,u)),d(this,v,!0),r(this,o).style.display="grid",this.classList.add("triggered"),setTimeout(()=>{this.classList.add("opened"),r(this,o).style.height=r(this,o).scrollHeight+"px",B(this,C,W).call(this)},0)}close(){d(this,v,!1),r(this,o).style.height="0px",this.classList.remove("opened"),B(this,C,W).call(this),d(this,u,setTimeout(()=>{this.classList.remove("triggered"),r(this,o).style.display="none"},Y.getElementTransitionDurationMS(r(this,o))))}connectedCallback(){r(this,f).observe(r(this,o))}disconnectedCallback(){clearTimeout(r(this,u)),r(this,f).disconnect()}};y=new WeakMap;S=new WeakMap;o=new WeakMap;v=new WeakMap;u=new WeakMap;f=new WeakMap;L=new WeakMap;C=new WeakSet;W=function(){this.dispatchEvent(new CustomEvent("selectToggle",{bubbles:!0,composed:!0,detail:{opened:r(this,v)}}))};exports.SelectElement.formAssociated=!0;exports.SelectElement=Q([E.define("e-select")],exports.SelectElement);var _;class D extends E.CustomElement{constructor(){super(...arguments);A(this,_,null)}get selectElement(){return z(this,_)}connectedCallback(){var i,n;const s=(n=(i=this.assignedSlot)==null?void 0:i.getRootNode())==null?void 0:n.host;s?H(this,_,s):console.log(this,"e-select not found")}}_=new WeakMap;var X=Object.defineProperty,j=Object.getOwnPropertyDescriptor,ee=(t,e,s,i)=>{for(var n=i>1?void 0:i?j(e,s):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(n=(i?h(e,s,n):h(n))||n);return i&&n&&X(e,s,n),n},U=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},O=(t,e,s)=>(U(t,e,"read from private field"),s?s.call(t):e.get(t)),G=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},R=(t,e,s)=>(U(t,e,"access private method"),s),m,T,b;const te=P.createStylesheet({":host":{width:"100%",height:w.aptechkaTheme.heightInput.var,display:"inline-flex",alignItems:"center"}});exports.SelectOptionElement=class extends D{constructor(){super(),G(this,T),G(this,m,()=>{this.selectElement.value===this.value?this.style.display="none":this.style.display=""}),M.isBrowser&&(this.openShadow(te),a.element(this,{tabIndex:"0",onClick:()=>{R(this,T,b).call(this)},onKeydown:e=>{e.code==="Space"&&R(this,T,b).call(this)},children:[a.slot()]}))}get value(){return(this.hasAttribute("value")?this.getAttribute("value"):this.innerText)||""}connectedCallback(){super.connectedCallback(),this.hasAttribute("default")&&(this.selectElement.value||(this.selectElement.value=this.value)),this.selectElement.addEventListener("change",O(this,m)),setTimeout(()=>{O(this,m).call(this)})}disconnectedCallback(){this.selectElement.removeEventListener("change",O(this,m))}};m=new WeakMap;T=new WeakSet;b=function(){this.selectElement.value=this.value,this.selectElement.close()};exports.SelectOptionElement=ee([E.define("e-select-option")],exports.SelectOptionElement);const F=`<svg
2
2
  xmlns="http://www.w3.org/2000/svg"
3
3
  width="32"
4
4
  height="32"
@@ -12,8 +12,8 @@ import "./Store-JOKrNVEr.js";
12
12
  import { i as D } from "./browser-0zX67oeU.js";
13
13
  import { d as V } from "./events-_C2CztxR.js";
14
14
  import { g as X } from "./style-j2TwriJ_.js";
15
- import { e as x, p as j, ax as _, D as q } from "./tags-D0k7-iVY.js";
16
- import { c as z } from "./createStylesheet-DpGvTRP3.js";
15
+ import { e as x, p as j, ax as _, D as q } from "./tags-C2jg1zYB.js";
16
+ import { c as z } from "./createStylesheet-CD11E4C8.js";
17
17
  import { aptechkaTheme as m } from "./theme/index.js";
18
18
  var ee = Object.defineProperty, te = Object.getOwnPropertyDescriptor, se = (e, t, s, i) => {
19
19
  for (var a = i > 1 ? void 0 : i ? te(t, s) : t, r = e.length - 1, l; r >= 0; r--)
@@ -0,0 +1 @@
1
+ "use strict";var y=Object.defineProperty,A=Object.defineProperties;var h=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var l=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))q.call(t,n)&&l(e,n,t[n]);if(i)for(var n of i(t))w.call(t,n)&&l(e,n,t[n]);return e},a=(e,t)=>A(e,h(t));const C=require("./ElementConstructor-B61ZFTEB.cjs"),F=require("./string-vBu90jhV.cjs"),p=require("./ComponentElement-BUesLP4b.cjs");function E(e){const t=Array.isArray(e)?e:[e];let n=[];return t.forEach(r=>{if(typeof r=="function"){const o=r();n=[...n,...E(o)]}else n.push(r)}),n}function d(e,t,...n){var s;if(typeof e=="function"){if(e===m)return m(n);const u=`e-${F.camelToKebab(e.name)}`;let c=customElements.get(u);return c||(c=(s=class extends p.ComponentElement{},s.formAssociated=e.formAssociated,s),customElements.define(u,c)),()=>new c({tag:e,attributes:t,children:n})}const r=n.map(u=>E(u)).flat();let o=null;return e==="component"?(o=m(r),p.nextComponentAttributes.value=t):o=new C.ElementConstructor(e,a(f({},t),{children:r})),o.node}function m(e){return new C.ElementConstructor(document.createDocumentFragment(),{children:e})}function x(e,t=null,...n){return d(e,t,...n)()}exports.Fragment=m;exports.h=d;exports.instantiate=x;
@@ -0,0 +1,55 @@
1
+ var C = Object.defineProperty, E = Object.defineProperties;
2
+ var y = Object.getOwnPropertyDescriptors;
3
+ var f = Object.getOwnPropertySymbols;
4
+ var A = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable;
5
+ var i = (e, t, n) => t in e ? C(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ A.call(t, n) && i(e, n, t[n]);
8
+ if (f)
9
+ for (var n of f(t))
10
+ h.call(t, n) && i(e, n, t[n]);
11
+ return e;
12
+ }, l = (e, t) => E(e, y(t));
13
+ import { E as p } from "./ElementConstructor-CvNdPKJy.js";
14
+ import { c as w } from "./string-3lAkpJJP.js";
15
+ import { C as x, n as F } from "./ComponentElement-NMlh1Ptn.js";
16
+ function d(e) {
17
+ const t = Array.isArray(e) ? e : [e];
18
+ let n = [];
19
+ return t.forEach((r) => {
20
+ if (typeof r == "function") {
21
+ const o = r();
22
+ n = [...n, ...d(o)];
23
+ } else
24
+ n.push(r);
25
+ }), n;
26
+ }
27
+ function b(e, t, ...n) {
28
+ var s;
29
+ if (typeof e == "function") {
30
+ if (e === c)
31
+ return c(n);
32
+ const m = `e-${w(e.name)}`;
33
+ let u = customElements.get(m);
34
+ return u || (u = (s = class extends x {
35
+ }, s.formAssociated = e.formAssociated, s), customElements.define(m, u)), () => new u({ tag: e, attributes: t, children: n });
36
+ }
37
+ const r = n.map((m) => d(m)).flat();
38
+ let o = null;
39
+ return e === "component" ? (o = c(r), F.value = t) : o = new p(e, l(a({}, t), {
40
+ children: r
41
+ })), o.node;
42
+ }
43
+ function c(e) {
44
+ return new p(document.createDocumentFragment(), {
45
+ children: e
46
+ });
47
+ }
48
+ function $(e, t = null, ...n) {
49
+ return b(e, t, ...n)();
50
+ }
51
+ export {
52
+ c as F,
53
+ b as h,
54
+ $ as i
55
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../useConnect-DcfeqwzW.cjs");require("../../Store-D0_rDIsE.cjs");const o=require("../index.cjs");function u(...e){c.useConnect(t=>{const n=e.length>1?e[0]:t,r=e.length>1?e[1]:e[0];return o.intersector.subscribe(n,r)})}exports.useIntersector=u;
@@ -0,0 +1,4 @@
1
+ import { ElementOrSelector } from '../../utils';
2
+ import { IntersectorCallback } from '..';
3
+ export declare function useIntersector(elementOrSelector: ElementOrSelector, callback: IntersectorCallback): void;
4
+ export declare function useIntersector(elementOrSelector: ElementOrSelector, callback: IntersectorCallback): void;
@@ -0,0 +1,12 @@
1
+ import { u as c } from "../../useConnect-CXdqKdRX.js";
2
+ import "../../Store-JOKrNVEr.js";
3
+ import { intersector as r } from "../index.js";
4
+ function l(...t) {
5
+ c((e) => {
6
+ const n = t.length > 1 ? t[0] : e, o = t.length > 1 ? t[1] : t[0];
7
+ return r.subscribe(n, o);
8
+ });
9
+ }
10
+ export {
11
+ l as useIntersector
12
+ };
@@ -0,0 +1 @@
1
+ "use strict";var C=Object.defineProperty;var l=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var i=(t,e,n)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,d=(t,e)=>{for(var n in e||(e={}))y.call(e,n)&&i(t,n,e[n]);if(l)for(var n of l(e))S.call(e,n)&&i(t,n,e[n]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../useConnect-DcfeqwzW.cjs"),o=require("../../useCreate-ClGKVMeG.cjs"),w=require("../../useDisconnect-sA74z4IZ.cjs");require("../../Store-D0_rDIsE.cjs");const x=require("../../tags-DX-eNxbA.cjs"),f=require("../../createStylesheet-C0OnN0Br.cjs");function R(t,e){a.useConnect(n=>{const s=n.findContext(t);if(!s){console.warn(n,`Context "${t}" not found`);return}return e(s)})}function m(t,e){o.useCreate(n=>{n.createContext(t,e)})}function T(){return o.useCreate(t=>t.attachInternals())}function p(t){return o.useCreate(e=>e.attachShadow(d({mode:"open"},t)))}function q(t){o.useCreate(e=>{e.shadowRoot&&e.shadowRoot.adoptedStyleSheets.push(f.createStylesheet(t))}),a.useConnect(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const s=x.style(t).node;if(![...document.head.querySelectorAll("style")].find(u=>u.outerHTML===s.outerHTML))return document.head.appendChild(s),()=>{s.remove()}}else if(n instanceof ShadowRoot){const s=f.createStylesheet(t);n.adoptedStyleSheets.filter(r=>{const u=Array.from(r.cssRules);Array.from(s.cssRules).filter(c=>!u.find(h=>h.cssText===c.cssText)).forEach(c=>{r.insertRule(c.cssText)})})}})}exports.useConnect=a.useConnect;exports.useCreate=o.useCreate;exports.useDisconnect=w.useDisconnect;exports.createContext=m;exports.useContext=R;exports.useInternals=T;exports.useShadow=p;exports.useStylesheet=q;
@@ -0,0 +1,7 @@
1
+ export { useConnect } from './useConnect';
2
+ export { useContext, createContext, type ContextCallback } from './useContext';
3
+ export { useCreate } from './useCreate';
4
+ export { useDisconnect } from './useDisconnect';
5
+ export { useInternals } from './useInternals';
6
+ export { useShadow } from './useShadow';
7
+ export { useStylesheet } from './useStylesheet';
@@ -0,0 +1,76 @@
1
+ var m = Object.defineProperty;
2
+ var c = Object.getOwnPropertySymbols;
3
+ var p = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
4
+ var f = (t, e, o) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, l = (t, e) => {
5
+ for (var o in e || (e = {}))
6
+ p.call(e, o) && f(t, o, e[o]);
7
+ if (c)
8
+ for (var o of c(e))
9
+ y.call(e, o) && f(t, o, e[o]);
10
+ return t;
11
+ };
12
+ import { u as i } from "../../useConnect-CXdqKdRX.js";
13
+ import { u as s } from "../../useCreate-DQSfJu7r.js";
14
+ import { u as v } from "../../useDisconnect-D5cBD1bq.js";
15
+ import "../../Store-JOKrNVEr.js";
16
+ import { aC as x } from "../../tags-C2jg1zYB.js";
17
+ import { c as d } from "../../createStylesheet-CD11E4C8.js";
18
+ function E(t, e) {
19
+ i((o) => {
20
+ const n = o.findContext(t);
21
+ if (!n) {
22
+ console.warn(o, `Context "${t}" not found`);
23
+ return;
24
+ }
25
+ return e(n);
26
+ });
27
+ }
28
+ function H(t, e) {
29
+ s((o) => {
30
+ o.createContext(t, e);
31
+ });
32
+ }
33
+ function I() {
34
+ return s((t) => t.attachInternals());
35
+ }
36
+ function L(t) {
37
+ return s((e) => e.attachShadow(l({ mode: "open" }, t)));
38
+ }
39
+ function M(t) {
40
+ s((e) => {
41
+ e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(d(t));
42
+ }), i((e) => {
43
+ if (e.shadowRoot)
44
+ return;
45
+ const o = e.getRootNode();
46
+ if (o === document) {
47
+ const n = x(t).node;
48
+ if (![...document.head.querySelectorAll("style")].find((u) => u.outerHTML === n.outerHTML))
49
+ return document.head.appendChild(n), () => {
50
+ n.remove();
51
+ };
52
+ } else if (o instanceof ShadowRoot) {
53
+ const n = d(t);
54
+ o.adoptedStyleSheets.filter((r) => {
55
+ const u = Array.from(r.cssRules);
56
+ Array.from(n.cssRules).filter(
57
+ (a) => !u.find(
58
+ (h) => h.cssText === a.cssText
59
+ )
60
+ ).forEach((a) => {
61
+ r.insertRule(a.cssText);
62
+ });
63
+ });
64
+ }
65
+ });
66
+ }
67
+ export {
68
+ H as createContext,
69
+ i as useConnect,
70
+ E as useContext,
71
+ s as useCreate,
72
+ v as useDisconnect,
73
+ I as useInternals,
74
+ L as useShadow,
75
+ M as useStylesheet
76
+ };
@@ -1,3 +1,3 @@
1
- import { Store } from '../../store';
2
- export declare function useContext<T>(name: string): Store<T, keyof import('../../store').StoreManagers, import('../../store').StoreEntry<T>>;
1
+ export type ContextCallback<T> = (context: T) => void | (() => void);
2
+ export declare function useContext<T>(name: string, callback: ContextCallback<T>): void;
3
3
  export declare function createContext(name: string, value: any): void;
package/lib/jsx/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var d=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var i=(t,e,n)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,f=(t,e)=>{for(var n in e||(e={}))p.call(e,n)&&i(t,n,e[n]);if(d)for(var n of d(e))w.call(e,n)&&i(t,n,e[n]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../getComponentElement-BcreYwFe.cjs"),m=require("../Store-D0_rDIsE.cjs"),g=require("../tags-DGIuh1Hi.cjs"),h=require("../createStylesheet-B5Nhxdpo.cjs");function x(t,e=document.body){e.appendChild(r.getComponentElement(t))}function s(t){return t(r.currentComponentElement)}function a(t){s(e=>{e.addConnectCallback(t)})}function R(t){const e=new m.Store(null);return a(n=>{const o=n.findContext(t);return o?e.current=o:console.warn(n,`Context "${t}" not found`),()=>{e.close()}}),e}function T(t,e){s(n=>{n.createContext(t,e)})}function C(t){s(e=>{e.addDisconnectCallback(t)})}function E(){return s(t=>t.attachInternals())}function q(t){return s(e=>e.attachShadow(f({mode:"open"},t)))}function b(...t){const e=new m.Store(...t);return C(e.close),e}function A(t){s(e=>{e.shadowRoot&&e.shadowRoot.adoptedStyleSheets.push(h.createStylesheet(t))}),a(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const o=g.style(t).node;if(![...document.head.querySelectorAll("style")].find(c=>c.outerHTML===o.outerHTML))return document.head.appendChild(o),()=>{o.remove()}}else if(n instanceof ShadowRoot){const o=h.createStylesheet(t);n.adoptedStyleSheets.filter(u=>{const c=Array.from(u.cssRules);Array.from(o.cssRules).filter(l=>!c.find(S=>S.cssText===l.cssText)).forEach(l=>{u.insertRule(l.cssText)})})}})}exports.Fragment=r.Fragment;exports.getComponentElement=r.getComponentElement;exports.h=r.h;exports.createContext=T;exports.render=x;exports.useConnect=a;exports.useContext=R;exports.useCreate=s;exports.useDisconnect=C;exports.useInternals=E;exports.useShadow=q;exports.useStore=b;exports.useStylesheet=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../instantiate-BAz2WZtO.cjs");function i(e,n=null,...r){return t.h(e,n,...r)}function a(e,n=document.body){n.appendChild(t.instantiate(e))}exports.Fragment=t.Fragment;exports.h=t.h;exports.instantiate=t.instantiate;exports.register=i;exports.render=a;
@@ -1,12 +1,5 @@
1
1
  export * from './type';
2
2
  export { h, Fragment } from './h';
3
+ export { register } from './register';
3
4
  export { render } from './render';
4
- export { getComponentElement } from './getComponentElement';
5
- export { useConnect } from './hooks/useConnect';
6
- export { useContext, createContext } from './hooks/useContext';
7
- export { useCreate } from './hooks/useCreate';
8
- export { useDisconnect } from './hooks/useDisconnect';
9
- export { useInternals } from './hooks/useInternals';
10
- export { useShadow } from './hooks/useShadow';
11
- export { useStore } from './hooks/useStore';
12
- export { useStylesheet } from './hooks/useStylesheet';
5
+ export { instantiate } from './instantiate';
package/lib/jsx/index.js CHANGED
@@ -1,99 +1,15 @@
1
- var p = Object.defineProperty;
2
- var a = Object.getOwnPropertySymbols;
3
- var C = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
4
- var l = (t, e, n) => e in t ? p(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
5
- for (var n in e || (e = {}))
6
- C.call(e, n) && l(t, n, e[n]);
7
- if (a)
8
- for (var n of a(e))
9
- y.call(e, n) && l(t, n, e[n]);
10
- return t;
11
- };
12
- import { g as S, c as w } from "../getComponentElement-B0Qb2RbZ.js";
13
- import { F as $, h as z } from "../getComponentElement-B0Qb2RbZ.js";
14
- import { S as i } from "../Store-JOKrNVEr.js";
15
- import { aC as x } from "../tags-D0k7-iVY.js";
16
- import { c as f } from "../createStylesheet-DpGvTRP3.js";
17
- function F(t, e = document.body) {
18
- e.appendChild(S(t));
19
- }
20
- function r(t) {
21
- return t(w);
22
- }
23
- function m(t) {
24
- r((e) => {
25
- e.addConnectCallback(t);
26
- });
27
- }
28
- function H(t) {
29
- const e = new i(null);
30
- return m((n) => {
31
- const o = n.findContext(t);
32
- return o ? e.current = o : console.warn(n, `Context "${t}" not found`), () => {
33
- e.close();
34
- };
35
- }), e;
36
- }
37
- function I(t, e) {
38
- r((n) => {
39
- n.createContext(t, e);
40
- });
41
- }
42
- function R(t) {
43
- r((e) => {
44
- e.addDisconnectCallback(t);
45
- });
46
- }
47
- function L() {
48
- return r((t) => t.attachInternals());
49
- }
50
- function M(t) {
51
- return r((e) => e.attachShadow(d({ mode: "open" }, t)));
52
- }
53
- function N(...t) {
54
- const e = new i(...t);
55
- return R(e.close), e;
1
+ import { h as e, i as o } from "../instantiate-BDteLwW6.js";
2
+ import { F as u } from "../instantiate-BDteLwW6.js";
3
+ function a(n, r = null, ...t) {
4
+ return e(n, r, ...t);
56
5
  }
57
- function b(t) {
58
- r((e) => {
59
- e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(f(t));
60
- }), m((e) => {
61
- if (e.shadowRoot)
62
- return;
63
- const n = e.getRootNode();
64
- if (n === document) {
65
- const o = x(t).node;
66
- if (![...document.head.querySelectorAll("style")].find((c) => c.outerHTML === o.outerHTML))
67
- return document.head.appendChild(o), () => {
68
- o.remove();
69
- };
70
- } else if (n instanceof ShadowRoot) {
71
- const o = f(t);
72
- n.adoptedStyleSheets.filter((s) => {
73
- const c = Array.from(s.cssRules);
74
- Array.from(o.cssRules).filter(
75
- (u) => !c.find(
76
- (h) => h.cssText === u.cssText
77
- )
78
- ).forEach((u) => {
79
- s.insertRule(u.cssText);
80
- });
81
- });
82
- }
83
- });
6
+ function d(n, r = document.body) {
7
+ r.appendChild(o(n));
84
8
  }
85
9
  export {
86
- $ as Fragment,
87
- I as createContext,
88
- S as getComponentElement,
89
- z as h,
90
- F as render,
91
- m as useConnect,
92
- H as useContext,
93
- r as useCreate,
94
- R as useDisconnect,
95
- L as useInternals,
96
- M as useShadow,
97
- N as useStore,
98
- b as useStylesheet
10
+ u as Fragment,
11
+ e as h,
12
+ o as instantiate,
13
+ a as register,
14
+ d as render
99
15
  };
@@ -0,0 +1 @@
1
+ export declare function instantiate(Component: any, attributes?: JSX.AllAttributes | null, ...children: JSX.ComponentChildren): any;
@@ -0,0 +1 @@
1
+ export declare function register(Component: any, attributes?: JSX.AllAttributes | null, ...children: JSX.ComponentChildren): any;
@@ -1 +1 @@
1
- "use strict";var K=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(K(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(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)},n=(i,e,s,a)=>(K(i,e,"write to private field"),a?a.call(i,s):e.set(i,s),s);var q=(i,e,s)=>(K(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("../css-unit-parser/index.cjs"),I=require("../ladder/index.cjs"),lt=require("../order/index.cjs"),at=require("../scroll-entries/index.cjs"),F=require("../ticker/index.cjs"),G=require("../browser-CpzFX2xg.cjs"),J=require("../dom-qY2LdCVL.cjs"),O=require("../layout-8ryRAMGJ.cjs"),N=require("../element-resizer/index.cjs");function Q(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),a=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),T=Math.atan2(i.m32,i.m33),H=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),U=Math.atan2(i.m21,i.m11),u=i.m41,b=i.m42*-1,L=i.m43;return{scaleX:e,scaleY:s,scaleZ:a,rotationX:T,rotationY:H,rotationZ:U,translationX:u,translationY:b,translationZ:L}}var o,f,p,_,X,w,x,v,Y,z,M,P,S,d,C,E,R,Z,g,m,y,c,r,l,B,$,A,j,V,tt,D,et,W,k;class ot{constructor(e,s){h(this,B);h(this,A);h(this,V);h(this,D);h(this,o,null);h(this,f,null);h(this,p,[]);h(this,_,"auto");h(this,X,"top");h(this,w,!1);h(this,x,!0);h(this,v,!0);h(this,Y,!0);h(this,z,0);h(this,M,0);h(this,P,0);h(this,S,0);h(this,d,0);h(this,C,0);h(this,E,0);h(this,R,0);h(this,Z,0);h(this,g,{x:0,y:0,z:0});h(this,m,{x:0,y:0,z:0});h(this,y,{x:1,y:1,z:1});h(this,c,new I.Ladder({x:0,y:0,z:0}));h(this,r,new I.Ladder({x:0,y:0,z:0}));h(this,l,new I.Ladder({x:0,y:0,z:0}));h(this,W,()=>{G.isBrowser&&q(this,V,tt).call(this)});h(this,k,()=>{q(this,D,et).call(this),q(this,B,$).call(this)});G.isBrowser&&(n(this,o,J.getElement(e)||document.body),n(this,f,J.getElement(s==null?void 0:s.containerElement)||document.body),n(this,_,(s==null?void 0:s.scrollAxis)||"auto"),n(this,X,(s==null?void 0:s.frontSide)||"top"),n(this,w,(s==null?void 0:s.cartesian)||!1),n(this,x,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),n(this,v,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),n(this,Y,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),t(this,l).setStep("_size","+",{x:1,y:1,z:1}),t(this,r).setStep("_position","+",{x:0,y:0,z:0}),t(this,l).setStep("_scale","*",{x:1,y:1,z:1}),t(this,r).setStep("_translation","+",{x:0,y:0,z:0}),t(this,c).setStep("_rotation","+",{x:0,y:0,z:0}),addEventListener("DOMContentLoaded",()=>{at.scrollEntries.getAll(this.element).forEach(a=>{this.setScrollStep(()=>a)})}),F.ticker.subscribe(t(this,k),{order:lt.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}),N.elementResizer.subscribe(this.element,t(this,W)))}get element(){return t(this,o)}get containerElement(){return t(this,f)}get position(){return t(this,r).current}get rotation(){return t(this,c).current}get scale(){return t(this,l).current}get left(){return t(this,d)}get top(){return t(this,S)}get front(){return t(this,C)}get width(){return t(this,z)}get height(){return t(this,M)}get depth(){return t(this,P)}bindObject(e){e.position&&t(this,r).bind(e.position),e.rotation&&t(this,c).bind(e.rotation),e.scale&&t(this,l).bind(e.scale)}unbindObject(e){e.position&&t(this,r).unbind(e.position),e.rotation&&t(this,c).unbind(e.rotation),e.scale&&t(this,l).unbind(e.scale)}setScrollStep(e){return t(this,p).includes(e)||t(this,p).push(e),()=>this.deleteScrollStep(e)}deleteScrollStep(e){n(this,p,t(this,p).filter(s=>s!==e))}destroy(){F.ticker.unsubscribe(t(this,k)),N.elementResizer.unsubscribe(t(this,W)),t(this,r).close(),t(this,c).close(),t(this,l).close()}setPositionStep(...e){t(this,r).setStep(...e)}getPositionStep(...e){return t(this,r).getStepValue(...e)}setRotationStep(...e){t(this,c).setStep(...e)}getRotationStep(...e){return t(this,c).getStepValue(...e)}setScaleStep(...e){t(this,l).setStep(...e)}getScaleStep(...e){return t(this,l).getStepValue(...e)}deletePositionStep(...e){t(this,r).deleteStep(...e)}deleteRotationStep(...e){t(this,c).deleteStep(...e)}deleteScaleStep(...e){t(this,l).deleteStep(...e)}}o=new WeakMap,f=new WeakMap,p=new WeakMap,_=new WeakMap,X=new WeakMap,w=new WeakMap,x=new WeakMap,v=new WeakMap,Y=new WeakMap,z=new WeakMap,M=new WeakMap,P=new WeakMap,S=new WeakMap,d=new WeakMap,C=new WeakMap,E=new WeakMap,R=new WeakMap,Z=new WeakMap,g=new WeakMap,m=new WeakMap,y=new WeakMap,c=new WeakMap,r=new WeakMap,l=new WeakMap,B=new WeakSet,$=function(){t(this,l).calculate(),t(this,r).calculate(),t(this,c).calculate()},A=new WeakSet,j=function(){t(this,l).setStep("_size","+",{x:t(this,x)?t(this,z):1,y:t(this,x)?t(this,M):1,z:t(this,x)?t(this,P):1});const e=t(this,v)?t(this,E):0,s=t(this,v)?t(this,R):0,a=t(this,v)?t(this,Z):0;t(this,r).setStep("_position","+",{x:e,y:s,z:a}),t(this,Y)?(t(this,l).setStep("_scale","*",{x:t(this,y).x,y:t(this,y).y,z:t(this,y).z}),t(this,r).setStep("_translation","+",{x:t(this,g).x,y:t(this,g).y,z:t(this,g).z}),t(this,c).setStep("_rotation","+",{x:t(this,m).x,y:t(this,m).y,z:t(this,m).z})):(t(this,l).setStep("_scale","*",{x:1,y:1,z:1}),t(this,r).setStep("_translation","+",{x:0,y:0,z:0}),t(this,c).setStep("_rotation","+",{x:0,y:0,z:0}))},V=new WeakSet,tt=function(){const e=getComputedStyle(t(this,o));n(this,z,Math.max(t(this,o).clientWidth,1)),n(this,M,Math.max(t(this,o).clientHeight,1)),n(this,P,Math.max(rt.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=O.getCumulativeOffsetLeft(t(this,f)),a=O.getCumulativeOffsetTop(t(this,f)),T=t(this,f).clientWidth,H=t(this,f).clientHeight;if(n(this,d,O.getCumulativeOffsetLeft(t(this,o))-s),n(this,S,O.getCumulativeOffsetTop(t(this,o))-a),t(this,_)==="z"){const b=t(this,d)/T,L=t(this,S)/H;n(this,d,(b-Math.floor(b))*T),n(this,S,(L-Math.floor(L))*H),t(this,X)==="left"?n(this,C,O.getCumulativeOffsetLeft(t(this,o))-s-t(this,d)):n(this,C,O.getCumulativeOffsetTop(t(this,o))-a-t(this,S))}if(n(this,d,t(this,d)+t(this,o).clientLeft),n(this,S,t(this,S)+t(this,o).clientTop),t(this,w)){const b=Math.round(T/2),L=Math.round(H/2),st=t(this,z)?Math.round(t(this,z)/2):0,it=t(this,M)?Math.round(t(this,M)/2):0,ht=t(this,d)-b+st,nt=(t(this,S)-L+it)*-1;n(this,E,ht),n(this,R,nt)}else n(this,E,t(this,d)),n(this,R,t(this,S));n(this,Z,t(this,C)*-1);const U=new WebKitCSSMatrix(e.transform),u=Q(U);t(this,g).x=u.translationX,t(this,g).y=u.translationY,t(this,g).z=u.translationZ,t(this,y).x=u.scaleX,t(this,y).y=u.scaleY,t(this,y).z=u.scaleZ,t(this,m).x=u.rotationX,t(this,m).y=u.rotationY,t(this,m).z=u.rotationZ,q(this,A,j).call(this),q(this,B,$).call(this)},D=new WeakSet,et=function(){for(let e=0;e<t(this,p).length;e++){const s=t(this,p)[e]();let a=s.axis;t(this,_)!=="auto"&&(a=t(this,_)),t(this,r).setStep(`_scroll_${e}`,"+",{[a]:s.value*(a==="x"?-1:t(this,w)?1:-1)})}},W=new WeakMap,k=new WeakMap;exports.LayoutBox=ot;exports.decomposeCSSMatrix=Q;
1
+ "use strict";var I=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(I(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(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)},n=(i,e,s,o)=>(I(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);var R=(i,e,s)=>(I(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ot=require("../css-unit-parser/index.cjs"),K=require("../ladder/index.cjs"),F=require("../order/index.cjs"),at=require("../scroll-entries/index.cjs"),G=require("../ticker/index.cjs"),J=require("../browser-CpzFX2xg.cjs"),N=require("../dom-qY2LdCVL.cjs"),L=require("../layout-8ryRAMGJ.cjs"),Q=require("../element-resizer/index.cjs"),j=require("../window-resizer/index.cjs");function tt(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),o=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),X=Math.atan2(i.m32,i.m33),Y=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),V=Math.atan2(i.m21,i.m11),u=i.m41,C=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:o,rotationX:X,rotationY:Y,rotationZ:V,translationX:u,translationY:C,translationZ:O}}var a,f,p,M,H,q,x,v,Z,y,_,E,d,S,b,P,T,B,z,g,m,c,r,l,A,$,k,et,D,st,U,it,w,W;class ct{constructor(e,s){h(this,A);h(this,k);h(this,D);h(this,U);h(this,a,null);h(this,f,null);h(this,p,[]);h(this,M,"auto");h(this,H,"top");h(this,q,!1);h(this,x,!0);h(this,v,!0);h(this,Z,!0);h(this,y,0);h(this,_,0);h(this,E,0);h(this,d,0);h(this,S,0);h(this,b,0);h(this,P,0);h(this,T,0);h(this,B,0);h(this,z,{x:0,y:0,z:0});h(this,g,{x:0,y:0,z:0});h(this,m,{x:1,y:1,z:1});h(this,c,new K.Ladder({x:0,y:0,z:0}));h(this,r,new K.Ladder({x:0,y:0,z:0}));h(this,l,new K.Ladder({x:0,y:0,z:0}));h(this,w,()=>{J.isBrowser&&R(this,D,st).call(this)});h(this,W,()=>{R(this,U,it).call(this),R(this,A,$).call(this)});J.isBrowser&&(n(this,a,N.getElement(e)||document.body),n(this,f,N.getElement(s==null?void 0:s.containerElement)||document.body),n(this,M,(s==null?void 0:s.scrollAxis)||"auto"),n(this,H,(s==null?void 0:s.frontSide)||"top"),n(this,q,(s==null?void 0:s.cartesian)||!1),n(this,x,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),n(this,v,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),n(this,Z,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),t(this,l).setStep("_size","+",{x:1,y:1,z:1}),t(this,r).setStep("_position","+",{x:0,y:0,z:0}),t(this,l).setStep("_scale","*",{x:1,y:1,z:1}),t(this,r).setStep("_translation","+",{x:0,y:0,z:0}),t(this,c).setStep("_rotation","+",{x:0,y:0,z:0}),addEventListener("DOMContentLoaded",()=>{at.scrollEntries.getAll(this.element).forEach(o=>{this.setScrollStep(()=>o)})}),G.ticker.subscribe(t(this,W),{order:F.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}),Q.elementResizer.subscribe(this.element,t(this,w)),j.windowResizer.subscribe(t(this,w),F.RESIZE_ORDER.LAYOUT_BOX))}get element(){return t(this,a)}get containerElement(){return t(this,f)}get position(){return t(this,r).current}get rotation(){return t(this,c).current}get scale(){return t(this,l).current}get left(){return t(this,S)}get top(){return t(this,d)}get front(){return t(this,b)}get width(){return t(this,y)}get height(){return t(this,_)}get depth(){return t(this,E)}bindObject(e){e.position&&t(this,r).bind(e.position),e.rotation&&t(this,c).bind(e.rotation),e.scale&&t(this,l).bind(e.scale)}unbindObject(e){e.position&&t(this,r).unbind(e.position),e.rotation&&t(this,c).unbind(e.rotation),e.scale&&t(this,l).unbind(e.scale)}setScrollStep(e){return t(this,p).includes(e)||t(this,p).push(e),()=>this.deleteScrollStep(e)}deleteScrollStep(e){n(this,p,t(this,p).filter(s=>s!==e))}destroy(){G.ticker.unsubscribe(t(this,W)),Q.elementResizer.unsubscribe(t(this,w)),j.windowResizer.unsubscribe(t(this,w)),t(this,r).close(),t(this,c).close(),t(this,l).close()}setPositionStep(...e){t(this,r).setStep(...e)}getPositionStep(...e){return t(this,r).getStepValue(...e)}setRotationStep(...e){t(this,c).setStep(...e)}getRotationStep(...e){return t(this,c).getStepValue(...e)}setScaleStep(...e){t(this,l).setStep(...e)}getScaleStep(...e){return t(this,l).getStepValue(...e)}deletePositionStep(...e){t(this,r).deleteStep(...e)}deleteRotationStep(...e){t(this,c).deleteStep(...e)}deleteScaleStep(...e){t(this,l).deleteStep(...e)}}a=new WeakMap,f=new WeakMap,p=new WeakMap,M=new WeakMap,H=new WeakMap,q=new WeakMap,x=new WeakMap,v=new WeakMap,Z=new WeakMap,y=new WeakMap,_=new WeakMap,E=new WeakMap,d=new WeakMap,S=new WeakMap,b=new WeakMap,P=new WeakMap,T=new WeakMap,B=new WeakMap,z=new WeakMap,g=new WeakMap,m=new WeakMap,c=new WeakMap,r=new WeakMap,l=new WeakMap,A=new WeakSet,$=function(){t(this,l).calculate(),t(this,r).calculate(),t(this,c).calculate()},k=new WeakSet,et=function(){t(this,l).setStep("_size","+",{x:t(this,x)?t(this,y):1,y:t(this,x)?t(this,_):1,z:t(this,x)?t(this,E):1});const e=t(this,v)?t(this,P):0,s=t(this,v)?t(this,T):0,o=t(this,v)?t(this,B):0;t(this,r).setStep("_position","+",{x:e,y:s,z:o}),t(this,Z)?(t(this,l).setStep("_scale","*",{x:t(this,m).x,y:t(this,m).y,z:t(this,m).z}),t(this,r).setStep("_translation","+",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).z}),t(this,c).setStep("_rotation","+",{x:t(this,g).x,y:t(this,g).y,z:t(this,g).z})):(t(this,l).setStep("_scale","*",{x:1,y:1,z:1}),t(this,r).setStep("_translation","+",{x:0,y:0,z:0}),t(this,c).setStep("_rotation","+",{x:0,y:0,z:0}))},D=new WeakSet,st=function(){const e=getComputedStyle(t(this,a));n(this,y,Math.max(t(this,a).clientWidth,1)),n(this,_,Math.max(t(this,a).clientHeight,1)),n(this,E,Math.max(ot.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=L.getCumulativeOffsetLeft(t(this,f)),o=L.getCumulativeOffsetTop(t(this,f)),X=t(this,f).clientWidth,Y=t(this,f).clientHeight;if(n(this,S,L.getCumulativeOffsetLeft(t(this,a))-s),n(this,d,L.getCumulativeOffsetTop(t(this,a))-o),t(this,M)==="z"){const C=t(this,S)/X,O=t(this,d)/Y;n(this,S,(C-Math.floor(C))*X),n(this,d,(O-Math.floor(O))*Y),t(this,H)==="left"?n(this,b,L.getCumulativeOffsetLeft(t(this,a))-s-t(this,S)):n(this,b,L.getCumulativeOffsetTop(t(this,a))-o-t(this,d))}if(n(this,S,t(this,S)+t(this,a).clientLeft),n(this,d,t(this,d)+t(this,a).clientTop),t(this,q)){const C=Math.round(X/2),O=Math.round(Y/2),ht=t(this,y)?Math.round(t(this,y)/2):0,nt=t(this,_)?Math.round(t(this,_)/2):0,rt=t(this,S)-C+ht,lt=(t(this,d)-O+nt)*-1;n(this,P,rt),n(this,T,lt)}else n(this,P,t(this,S)),n(this,T,t(this,d));n(this,B,t(this,b)*-1);const V=new WebKitCSSMatrix(e.transform),u=tt(V);t(this,z).x=u.translationX,t(this,z).y=u.translationY,t(this,z).z=u.translationZ,t(this,m).x=u.scaleX,t(this,m).y=u.scaleY,t(this,m).z=u.scaleZ,t(this,g).x=u.rotationX,t(this,g).y=u.rotationY,t(this,g).z=u.rotationZ,R(this,k,et).call(this),R(this,A,$).call(this)},U=new WeakSet,it=function(){for(let e=0;e<t(this,p).length;e++){const s=t(this,p)[e]();let o=s.axis;t(this,M)!=="auto"&&(o=t(this,M)),t(this,r).setStep(`_scroll_${e}`,"+",{[o]:s.value*(o==="x"?-1:t(this,q)?1:-1)})}},w=new WeakMap,W=new WeakMap;exports.LayoutBox=ct;exports.decomposeCSSMatrix=tt;