aptechka 0.1.16 → 0.1.17

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.
@@ -1 +1 @@
1
- "use strict";var m=(s,r,e)=>{if(!r.has(s))throw TypeError("Cannot "+e)};var t=(s,r,e)=>(m(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)},h=(s,r,e,f)=>(m(s,r,"write to private field"),f?f.call(s,e):r.set(s,e),e);var o=(s,r,e)=>(m(s,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../Store-D0_rDIsE.cjs"),q=require("../attributes-Bf2svn4j.cjs"),C=require("../browser-CpzFX2xg.cjs"),p=require("../dom-qY2LdCVL.cjs");var i,n,b,a,c,l,w,d,y;class z extends S.Store{constructor(e,f,O,v){super(O,v);u(this,l);u(this,d);u(this,i,null);u(this,n,void 0);u(this,b,null);u(this,a,null);u(this,c,!1);h(this,n,f),C.isBrowser&&(h(this,i,p.getElement(e)),v!=null&&v.sync&&this.subscribe(g=>{t(this,i).setAttribute(t(this,n),g.current.toString())}),h(this,b,new MutationObserver(g=>{g.forEach(A=>{A.type==="attributes"&&A.attributeName===t(this,n)&&o(this,l,w).call(this)})})),h(this,a,new ResizeObserver(()=>{t(this,i).isConnected&&!t(this,c)?t(this,b).observe(t(this,i),{attributes:!0}):!t(this,i).isConnected&&t(this,c)&&(t(this,b).disconnect(),t(this,a).disconnect()),h(this,c,t(this,i).isConnected)})))}get current(){return o(this,d,y).call(this),super.current}set current(e){super.current=e}subscribe(e){return o(this,d,y).call(this),super.subscribe(e)}}i=new WeakMap,n=new WeakMap,b=new WeakMap,a=new WeakMap,c=new WeakMap,l=new WeakSet,w=function(){const e=t(this,i).getAttribute(t(this,n));e!=null&&(this.current=q.parseAttributeValue(e))},d=new WeakSet,y=function(){t(this,c)||(o(this,l,w).call(this),t(this,a).observe(t(this,i)))};exports.Attribute=z;
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;
@@ -9,4 +9,6 @@ export declare class Attribute<T extends string | number | boolean> extends Stor
9
9
  get current(): T;
10
10
  set current(value: T);
11
11
  subscribe(callback: StoreCallback<StoreEntry<T>>): () => void;
12
+ unsubscribe(callback: StoreCallback<StoreEntry<T>>): void;
13
+ close(): void;
12
14
  }
@@ -1,56 +1,65 @@
1
- var v = (s, r, t) => {
2
- if (!r.has(s))
1
+ var w = (s, i, t) => {
2
+ if (!i.has(s))
3
3
  throw TypeError("Cannot " + t);
4
4
  };
5
- var e = (s, r, t) => (v(s, r, "read from private field"), t ? t.call(s) : r.get(s)), u = (s, r, t) => {
6
- if (r.has(s))
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))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- r instanceof WeakSet ? r.add(s) : r.set(s, t);
9
- }, c = (s, r, t, m) => (v(s, r, "write to private field"), m ? m.call(s, t) : r.set(s, t), t);
10
- var o = (s, r, t) => (v(s, r, "access private method"), t);
11
- import { S as O } from "../Store-JOKrNVEr.js";
12
- import { p as y } from "../attributes-69we3byR.js";
13
- import { i as S } from "../browser-0zX67oeU.js";
14
- import { g as x } from "../dom-BY7JhTx5.js";
15
- var i, h, a, b, n, f, g, l, w;
16
- class N extends O {
17
- constructor(t, m, C, d) {
18
- super(C, d);
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
19
  u(this, f);
20
+ u(this, m);
20
21
  u(this, l);
21
- u(this, i, null);
22
- u(this, h, void 0);
22
+ u(this, r, null);
23
+ u(this, c, void 0);
23
24
  u(this, a, null);
24
- u(this, b, null);
25
+ u(this, o, null);
25
26
  u(this, n, !1);
26
- c(this, h, m), S && (c(this, i, x(t)), d != null && d.sync && this.subscribe((p) => {
27
- e(this, i).setAttribute(e(this, h), p.current.toString());
28
- }), c(this, a, new MutationObserver((p) => {
29
- p.forEach((A) => {
30
- A.type === "attributes" && A.attributeName === e(this, h) && o(this, f, g).call(this);
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);
31
32
  });
32
- })), c(this, b, new ResizeObserver(() => {
33
- e(this, i).isConnected && !e(this, n) ? e(this, a).observe(e(this, i), {
33
+ })), b(this, o, new ResizeObserver(() => {
34
+ e(this, r).isConnected && !e(this, n) ? e(this, a).observe(e(this, r), {
34
35
  attributes: !0
35
- }) : !e(this, i).isConnected && e(this, n) && (e(this, a).disconnect(), e(this, b).disconnect()), c(this, n, e(this, i).isConnected);
36
+ }) : !e(this, r).isConnected && e(this, n) && h(this, l, v).call(this), b(this, n, e(this, r).isConnected);
36
37
  })));
37
38
  }
38
39
  get current() {
39
- return o(this, l, w).call(this), super.current;
40
+ return h(this, m, C).call(this), super.current;
40
41
  }
41
42
  set current(t) {
42
43
  super.current = t;
43
44
  }
44
45
  subscribe(t) {
45
- return o(this, l, w).call(this), super.subscribe(t);
46
+ return h(this, m, C).call(this), super.subscribe(t);
47
+ }
48
+ unsubscribe(t) {
49
+ super.unsubscribe(t), this.subscribers.size || h(this, l, v).call(this);
50
+ }
51
+ close() {
52
+ super.close(), h(this, l, v).call(this);
46
53
  }
47
54
  }
48
- i = new WeakMap(), h = new WeakMap(), a = new WeakMap(), b = new WeakMap(), n = new WeakMap(), f = new WeakSet(), g = function() {
49
- const t = e(this, i).getAttribute(e(this, h));
50
- t != null && (this.current = y(t));
51
- }, l = new WeakSet(), w = function() {
52
- e(this, n) || (o(this, f, g).call(this), e(this, b).observe(e(this, i)));
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());
53
62
  };
54
63
  export {
55
- N as Attribute
64
+ U as Attribute
56
65
  };
@@ -18,13 +18,9 @@ export interface ComponentElement extends HTMLElement {
18
18
  export interface ComponentOptions {
19
19
  formAssociated?: boolean;
20
20
  }
21
- export declare const contexts: Map<string, {
22
- element: HTMLElement;
23
- value: any;
24
- }>;
25
21
  export declare function onConnect(callback: ComponentConnectCallback): void;
26
22
  export declare function onDisconnect(callback: ComponentElementCallback): void;
27
23
  export declare function onBeforeCreate<R>(callback: ComponentBeforeCreateCallback<R>): R;
28
24
  export declare function onAfterCreate(callback: ComponentElementCallback): void;
29
25
  export declare function Component<Props extends object = {}>(name: string, callback: ComponentConstructorCallback<Props>, options?: ComponentOptions): ComponentReturn<Props>;
30
- export declare function Component<Props extends object = {}, BaseElementConstructor extends typeof HTMLElement = typeof HTMLElement>(Constructor: BaseElementConstructor, name: string, callback: ComponentConstructorCallback<Props, InstanceType<BaseElementConstructor>>, options?: ComponentOptions): ComponentReturn<Props>;
26
+ export declare function Component<Props extends object = {}, BaseElementConstructor extends typeof HTMLElement = typeof HTMLElement>(Constructor: BaseElementConstructor | Function, name: string, callback: ComponentConstructorCallback<Props, InstanceType<BaseElementConstructor>>, options?: ComponentOptions): ComponentReturn<Props>;
@@ -0,0 +1,2 @@
1
+ import { Attribute } from '../../attribute';
2
+ export declare function watchAttribute(name: string, defaultValue: any): Attribute<any>;
@@ -1 +1 @@
1
- "use strict";var I=Object.defineProperty,M=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var k=(t,e,n)=>e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,R=(t,e)=>{for(var n in e||(e={}))F.call(e,n)&&k(t,n,e[n]);if(D)for(var n of D(e))H.call(e,n)&&k(t,n,e[n]);return t},q=(t,e)=>M(t,_(e));var L=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var s=(t,e,n)=>(L(t,e,"read from private field"),n?n.call(t):e.get(t)),w=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../Store-D0_rDIsE.cjs"),g=require("../tags-75InVOh4.cjs"),P=require("../Derived-SjPdLJiZ.cjs"),E=require("../Composed-C2Vv1xxR.cjs"),W=require("../ticker/index.cjs"),j=require("../animation/index.cjs"),B=require("../Damped-mdFs8WSd.cjs"),v=require("../intersector/index.cjs"),T=require("../element-resizer/index.cjs"),O=require("../window-resizer/index.cjs"),A=require("../createStylesheet-DTOK6fTn.cjs");let b=null;const y=new Map;function C(t){b.addConnectCallback(t)}function l(t){b.addDisconnectCallback(t)}function S(t){return t(b)}function $(...t){var i,a,f,p;const e=typeof t[0]=="string"?HTMLElement:t[0],n=typeof t[0]=="string"?t[0]:t[1],r=typeof t[0]=="string"?t[1]:t[2],c=`e-${n}`,u=typeof t[0]=="string"?t[2]:t[3];let d=customElements.get(c);return d||(d=(p=class extends e{constructor(o){super();w(this,i,new Set);w(this,a,new Set);w(this,f,new Set);b=this;const m=r(R({element:this},o));m&&g.element(this,m),s(this,f).forEach(h=>{h(this)}),s(this,f).clear(),y.forEach((h,z)=>{h.element===this&&y.delete(z)})}addConnectCallback(o){s(this,i).add(o)}addDisconnectCallback(o){s(this,a).add(o)}addAfterCreateCallback(o){s(this,f).add(o)}connectedCallback(){var o;(o=super.connectedCallback)==null||o.call(this),s(this,i).forEach(m=>{const h=m(this);h&&s(this,a).add(h)}),s(this,i).clear()}disconnectedCallback(){var o;(o=super.disconnectedCallback)==null||o.call(this),s(this,a).forEach(m=>{m(this)}),s(this,a).clear()}},i=new WeakMap,a=new WeakMap,f=new WeakMap,p),u!=null&&u.formAssociated&&(d.formAssociated=!0),customElements.define(c,d)),x=>new d(x||{})}function G(...t){const e=new N.Store(...t);return l(e.close),e}function J(...t){const e=new P.Derived(...t);return l(e.close),e}function K(...t){const e=new E.DerivedArray(...t);return l(e.close),e}function Q(...t){const e=new E.Composed(...t);return l(e.close),e}function U(...t){const e=new E.Resource(...t);return l(e.close),e}function V(...t){const e=new B.Damped(...t);return l(e.close),e}function X(...t){const e=new j.Tweened(...t);return l(e.close),e}function Y(t,e){C(n=>{let r;const c=e==null?void 0:e.culling;return c===!0?r=n:typeof c=="string"||c instanceof Element?r=c:typeof c=="object"&&(r=c.current),W.ticker.subscribe(t,{culling:r,maxFPS:e==null?void 0:e.maxFPS,order:e==null?void 0:e.order})})}function Z(t,e){S(n=>{y.set(t,{element:n,value:e})})}function ee(t){var e;return(e=y.get(t))==null?void 0:e.value}function te(t,e){C(n=>{const r=e||(n instanceof Element?n:void 0);if(typeof r=="string"||r instanceof Element)return v.intersector.subscribe(r,t);if(r!=null&&r.current)return v.intersector.subscribe(r.current,t)})}function ne(t,e){C(n=>{const r=e||(n instanceof Element?n:void 0);if(typeof r=="string"||r instanceof Element)return T.elementResizer.subscribe(r,t);if(r!=null&&r.current)return T.elementResizer.subscribe(r.current,t)})}function re(t,e){C(n=>O.windowResizer.subscribe(t,e))}function ce(t){S(e=>{e.shadowRoot&&e.shadowRoot.adoptedStyleSheets.push(A.createStylesheet(t))}),C(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const r=g.style(t).node;if(![...document.head.querySelectorAll("style")].find(u=>u.outerHTML===r.outerHTML))return document.head.appendChild(r),()=>{r.remove()}}else if(n instanceof ShadowRoot){const r=A.createStylesheet(t);n.adoptedStyleSheets.filter(c=>{const u=Array.from(c.cssRules);Array.from(r.cssRules).filter(i=>!u.find(a=>a.cssText===i.cssText)).forEach(i=>{c.insertRule(i.cssText)})})}})}function oe(t){return S(e=>e.attachShadow(q(R({},t),{mode:"open"})))}function se(){return S(t=>t.attachInternals())}exports.Component=$;exports.attachInternals=se;exports.attachShadow=oe;exports.attachStyle=ce;exports.createComposed=Q;exports.createContext=Z;exports.createDamped=V;exports.createDerived=J;exports.createDerivedArray=K;exports.createResource=U;exports.createStore=G;exports.createTweened=X;exports.getContext=ee;exports.onAnimationFrame=Y;exports.onConnect=C;exports.onDisconnect=l;exports.onElementResize=ne;exports.onIntersection=te;exports.onWindowResize=re;
1
+ "use strict";var _=Object.defineProperty,I=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var q=(t,e,n)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,y=(t,e)=>{for(var n in e||(e={}))F.call(e,n)&&q(t,n,e[n]);if(k)for(var n of k(e))M.call(e,n)&&q(t,n,e[n]);return t},x=(t,e)=>I(t,g(e));var H=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var s=(t,e,n)=>(H(t,e,"read from private field"),n?n.call(t):e.get(t)),S=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../Store-D0_rDIsE.cjs"),E=require("../tags-75InVOh4.cjs"),N=require("../Derived-SjPdLJiZ.cjs"),D=require("../Composed-C2Vv1xxR.cjs"),P=require("../ticker/index.cjs"),j=require("../animation/index.cjs"),W=require("../Damped-mdFs8WSd.cjs"),B=require("../attribute/index.cjs"),T=require("../intersector/index.cjs"),v=require("../element-resizer/index.cjs"),O=require("../window-resizer/index.cjs"),z=require("../createStylesheet-DTOK6fTn.cjs");let R=null;function C(t){R.addConnectCallback(t)}function i(t){R.addDisconnectCallback(t)}function p(t){return t(R)}function $(...t){var u,d,m,A;const e=typeof t[0]=="string"?HTMLElement:t[0].componentConstructor||t[0],n=typeof t[0]=="string"?t[0]:t[1],r=typeof t[0]=="string"?t[1]:t[2],o=`e-${n}`,l=typeof t[0]=="string"?t[2]:t[3];let a=customElements.get(o);a||(t[0].componentConstructor?a=class extends e{constructor(w){super();const c=r(y({element:this},w));c&&E.element(this,c)}}:a=(A=class extends e{constructor(c){super();S(this,u,new Set);S(this,d,new Set);S(this,m,new Set);R=this;const h=r(y({element:this},c));h&&E.element(this,h),s(this,m).forEach(b=>{b(this)}),s(this,m).clear()}addConnectCallback(c){s(this,u).add(c)}addDisconnectCallback(c){s(this,d).add(c)}addAfterCreateCallback(c){s(this,m).add(c)}connectedCallback(){var c;(c=super.connectedCallback)==null||c.call(this),s(this,u).forEach(h=>{const b=h(this);b&&s(this,d).add(b)}),s(this,u).clear()}disconnectedCallback(){var c;(c=super.disconnectedCallback)==null||c.call(this),s(this,d).forEach(h=>{h(this)}),s(this,d).clear()}},u=new WeakMap,d=new WeakMap,m=new WeakMap,A),l!=null&&l.formAssociated&&(a.formAssociated=!0),customElements.define(o,a));function f(w){return new a(w||{})}return f.componentConstructor=a,f}function G(...t){const e=new L.Store(...t);return i(e.close),e}function J(...t){const e=new N.Derived(...t);return i(e.close),e}function K(...t){const e=new D.DerivedArray(...t);return i(e.close),e}function Q(...t){const e=new D.Composed(...t);return i(e.close),e}function U(...t){const e=new D.Resource(...t);return i(e.close),e}function V(...t){const e=new W.Damped(...t);return i(e.close),e}function X(...t){const e=new j.Tweened(...t);return i(e.close),e}function Y(t,e){C(n=>{let r;const o=e==null?void 0:e.culling;return o===!0?r=n:typeof o=="string"||o instanceof Element?r=o:typeof o=="object"&&(r=o.current),P.ticker.subscribe(t,{culling:r,maxFPS:e==null?void 0:e.maxFPS,order:e==null?void 0:e.order})})}function Z(t,e){const n=p(r=>new B.Attribute(r,t,e));return i(()=>{n.close()}),n}function ee(t,e){C(n=>{const r=e||(n instanceof Element?n:void 0);if(typeof r=="string"||r instanceof Element)return T.intersector.subscribe(r,t);if(r!=null&&r.current)return T.intersector.subscribe(r.current,t)})}function te(t,e){C(n=>{const r=e||(n instanceof Element?n:void 0);if(typeof r=="string"||r instanceof Element)return v.elementResizer.subscribe(r,t);if(r!=null&&r.current)return v.elementResizer.subscribe(r.current,t)})}function ne(t,e){C(n=>O.windowResizer.subscribe(t,e))}function re(t){p(e=>{e.shadowRoot&&e.shadowRoot.adoptedStyleSheets.push(z.createStylesheet(t))}),C(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const r=E.style(t).node;if(![...document.head.querySelectorAll("style")].find(l=>l.outerHTML===r.outerHTML))return document.head.appendChild(r),()=>{r.remove()}}else if(n instanceof ShadowRoot){const r=z.createStylesheet(t);n.adoptedStyleSheets.filter(o=>{const l=Array.from(o.cssRules);Array.from(r.cssRules).filter(f=>!l.find(u=>u.cssText===f.cssText)).forEach(f=>{o.insertRule(f.cssText)})})}})}function ce(t){return p(e=>e.attachShadow(x(y({},t),{mode:"open"})))}function oe(){return p(t=>t.attachInternals())}exports.Component=$;exports.attachInternals=oe;exports.attachShadow=ce;exports.attachStyle=re;exports.createComposed=Q;exports.createDamped=V;exports.createDerived=J;exports.createDerivedArray=K;exports.createResource=U;exports.createStore=G;exports.createTweened=X;exports.onAnimationFrame=Y;exports.onConnect=C;exports.onDisconnect=i;exports.onElementResize=te;exports.onIntersection=ee;exports.onWindowResize=ne;exports.watchAttribute=Z;
@@ -1,7 +1,7 @@
1
1
  export { Component, onConnect, onDisconnect, type ComponentConstructorCallback, type ComponentConnectCallback, type ComponentElementCallback, } from './Component';
2
2
  export { createStore, createComposed, createDerived, createDerivedArray, createResource, } from './hooks/stores';
3
3
  export { createDamped, createTweened, onAnimationFrame, } from './hooks/animation';
4
- export { getContext, createContext } from './hooks/context';
4
+ export { watchAttribute } from './hooks/attributes';
5
5
  export { onIntersection } from './hooks/intersection';
6
6
  export { onElementResize, onWindowResize } from './hooks/resize';
7
7
  export { attachStyle } from './hooks/style';
@@ -1,216 +1,219 @@
1
- var z = Object.defineProperty, M = Object.defineProperties;
2
- var F = Object.getOwnPropertyDescriptors;
1
+ var F = Object.defineProperty, H = Object.defineProperties;
2
+ var I = Object.getOwnPropertyDescriptors;
3
3
  var D = Object.getOwnPropertySymbols;
4
- var H = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
5
- var k = (t, e, n) => e in t ? z(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, E = (t, e) => {
4
+ var L = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
5
+ var k = (t, e, n) => e in t ? F(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, b = (t, e) => {
6
6
  for (var n in e || (e = {}))
7
- H.call(e, n) && k(t, n, e[n]);
7
+ L.call(e, n) && k(t, n, e[n]);
8
8
  if (D)
9
9
  for (var n of D(e))
10
- I.call(e, n) && k(t, n, e[n]);
10
+ M.call(e, n) && k(t, n, e[n]);
11
11
  return t;
12
- }, x = (t, e) => M(t, F(e));
13
- var L = (t, e, n) => {
12
+ }, A = (t, e) => H(t, I(e));
13
+ var N = (t, e, n) => {
14
14
  if (!e.has(t))
15
15
  throw TypeError("Cannot " + n);
16
16
  };
17
- var s = (t, e, n) => (L(t, e, "read from private field"), n ? n.call(t) : e.get(t)), w = (t, e, n) => {
17
+ var s = (t, e, n) => (N(t, e, "read from private field"), n ? n.call(t) : e.get(t)), y = (t, e, n) => {
18
18
  if (e.has(t))
19
19
  throw TypeError("Cannot add the same private member more than once");
20
20
  e instanceof WeakSet ? e.add(t) : e.set(t, n);
21
21
  };
22
- import { S as N } from "../Store-JOKrNVEr.js";
23
- import { e as P, aD as q } from "../tags-DgRVzazL.js";
24
- import { D as B } from "../Derived-Bc88XJ8J.js";
25
- import { D as W, C as $, R as j } from "../Composed-DhtYBEmo.js";
26
- import { ticker as G } from "../ticker/index.js";
27
- import { Tweened as J } from "../animation/index.js";
28
- import { D as K } from "../Damped-Fy7tHx4d.js";
29
- import { intersector as T } from "../intersector/index.js";
30
- import { elementResizer as A } from "../element-resizer/index.js";
22
+ import { S as P } from "../Store-JOKrNVEr.js";
23
+ import { e as T, aD as g } from "../tags-DgRVzazL.js";
24
+ import { D as j } from "../Derived-Bc88XJ8J.js";
25
+ import { D as q, C as B, R as W } from "../Composed-DhtYBEmo.js";
26
+ import { ticker as $ } from "../ticker/index.js";
27
+ import { Tweened as G } from "../animation/index.js";
28
+ import { D as J } from "../Damped-Fy7tHx4d.js";
29
+ import { Attribute as K } from "../attribute/index.js";
30
+ import { intersector as x } from "../intersector/index.js";
31
+ import { elementResizer as v } from "../element-resizer/index.js";
31
32
  import { windowResizer as O } from "../window-resizer/index.js";
32
- import { c as v } from "../createStylesheet-Zqf3lXhM.js";
33
- let p = null;
34
- const b = /* @__PURE__ */ new Map();
33
+ import { c as z } from "../createStylesheet-Zqf3lXhM.js";
34
+ let R = null;
35
35
  function C(t) {
36
- p.addConnectCallback(t);
36
+ R.addConnectCallback(t);
37
37
  }
38
38
  function u(t) {
39
- p.addDisconnectCallback(t);
39
+ R.addDisconnectCallback(t);
40
40
  }
41
- function y(t) {
42
- return t(p);
41
+ function S(t) {
42
+ return t(R);
43
43
  }
44
- function ce(...t) {
45
- var i, a, d, R;
46
- const e = typeof t[0] == "string" ? HTMLElement : t[0], n = typeof t[0] == "string" ? t[0] : t[1], r = typeof t[0] == "string" ? t[1] : t[2], o = `e-${n}`, l = typeof t[0] == "string" ? t[2] : t[3];
47
- let f = customElements.get(
48
- o
44
+ function se(...t) {
45
+ var a, f, m, E;
46
+ const e = typeof t[0] == "string" ? HTMLElement : t[0].componentConstructor || t[0], n = typeof t[0] == "string" ? t[0] : t[1], o = typeof t[0] == "string" ? t[1] : t[2], c = `e-${n}`, l = typeof t[0] == "string" ? t[2] : t[3];
47
+ let i = customElements.get(
48
+ c
49
49
  );
50
- return f || (f = (R = class extends e {
51
- constructor(c) {
50
+ i || (t[0].componentConstructor ? i = class extends e {
51
+ constructor(p) {
52
52
  super();
53
- w(this, i, /* @__PURE__ */ new Set());
54
- w(this, a, /* @__PURE__ */ new Set());
55
- w(this, d, /* @__PURE__ */ new Set());
56
- p = this;
57
- const m = r(E({
53
+ const r = o(b({
58
54
  element: this
59
- }, c));
60
- m && P(this, m), s(this, d).forEach((h) => {
61
- h(this);
62
- }), s(this, d).clear(), b.forEach((h, g) => {
63
- h.element === this && b.delete(g);
64
- });
55
+ }, p));
56
+ r && T(this, r);
65
57
  }
66
- addConnectCallback(c) {
67
- s(this, i).add(c);
58
+ } : i = (E = class extends e {
59
+ constructor(r) {
60
+ super();
61
+ y(this, a, /* @__PURE__ */ new Set());
62
+ y(this, f, /* @__PURE__ */ new Set());
63
+ y(this, m, /* @__PURE__ */ new Set());
64
+ R = this;
65
+ const h = o(b({
66
+ element: this
67
+ }, r));
68
+ h && T(this, h), s(this, m).forEach((w) => {
69
+ w(this);
70
+ }), s(this, m).clear();
68
71
  }
69
- addDisconnectCallback(c) {
70
- s(this, a).add(c);
72
+ addConnectCallback(r) {
73
+ s(this, a).add(r);
71
74
  }
72
- addAfterCreateCallback(c) {
73
- s(this, d).add(c);
75
+ addDisconnectCallback(r) {
76
+ s(this, f).add(r);
77
+ }
78
+ addAfterCreateCallback(r) {
79
+ s(this, m).add(r);
74
80
  }
75
81
  connectedCallback() {
76
- var c;
77
- (c = super.connectedCallback) == null || c.call(this), s(this, i).forEach((m) => {
78
- const h = m(this);
79
- h && s(this, a).add(h);
80
- }), s(this, i).clear();
82
+ var r;
83
+ (r = super.connectedCallback) == null || r.call(this), s(this, a).forEach((h) => {
84
+ const w = h(this);
85
+ w && s(this, f).add(w);
86
+ }), s(this, a).clear();
81
87
  }
82
88
  disconnectedCallback() {
83
- var c;
84
- (c = super.disconnectedCallback) == null || c.call(this), s(this, a).forEach((m) => {
85
- m(this);
86
- }), s(this, a).clear();
89
+ var r;
90
+ (r = super.disconnectedCallback) == null || r.call(this), s(this, f).forEach((h) => {
91
+ h(this);
92
+ }), s(this, f).clear();
87
93
  }
88
- }, i = new WeakMap(), a = new WeakMap(), d = new WeakMap(), R), l != null && l.formAssociated && (f.formAssociated = !0), customElements.define(o, f)), (S) => new f(S || {});
89
- }
90
- function se(...t) {
91
- const e = new N(...t);
92
- return u(e.close), e;
94
+ }, a = new WeakMap(), f = new WeakMap(), m = new WeakMap(), E), l != null && l.formAssociated && (i.formAssociated = !0), customElements.define(c, i));
95
+ function d(p) {
96
+ return new i(p || {});
97
+ }
98
+ return d.componentConstructor = i, d;
93
99
  }
94
100
  function ie(...t) {
95
- const e = new B(...t);
101
+ const e = new P(...t);
96
102
  return u(e.close), e;
97
103
  }
98
104
  function ae(...t) {
99
- const e = new W(...t);
105
+ const e = new j(...t);
100
106
  return u(e.close), e;
101
107
  }
102
- function le(...t) {
103
- const e = new $(...t);
108
+ function ue(...t) {
109
+ const e = new q(...t);
104
110
  return u(e.close), e;
105
111
  }
106
- function ue(...t) {
107
- const e = new j(...t);
112
+ function le(...t) {
113
+ const e = new B(...t);
108
114
  return u(e.close), e;
109
115
  }
110
116
  function fe(...t) {
111
- const e = new K(...t);
117
+ const e = new W(...t);
112
118
  return u(e.close), e;
113
119
  }
114
120
  function de(...t) {
115
121
  const e = new J(...t);
116
122
  return u(e.close), e;
117
123
  }
118
- function me(t, e) {
124
+ function me(...t) {
125
+ const e = new G(...t);
126
+ return u(e.close), e;
127
+ }
128
+ function he(t, e) {
119
129
  C((n) => {
120
- let r;
121
- const o = e == null ? void 0 : e.culling;
122
- return o === !0 ? r = n : typeof o == "string" || o instanceof Element ? r = o : typeof o == "object" && (r = o.current), G.subscribe(t, {
123
- culling: r,
130
+ let o;
131
+ const c = e == null ? void 0 : e.culling;
132
+ return c === !0 ? o = n : typeof c == "string" || c instanceof Element ? o = c : typeof c == "object" && (o = c.current), $.subscribe(t, {
133
+ culling: o,
124
134
  maxFPS: e == null ? void 0 : e.maxFPS,
125
135
  order: e == null ? void 0 : e.order
126
136
  });
127
137
  });
128
138
  }
129
- function he(t, e) {
130
- y((n) => {
131
- b.set(t, {
132
- element: n,
133
- value: e
134
- });
135
- });
136
- }
137
- function Ce(t) {
138
- var e;
139
- return (e = b.get(t)) == null ? void 0 : e.value;
139
+ function Ce(t, e) {
140
+ const n = S((o) => new K(o, t, e));
141
+ return u(() => {
142
+ n.close();
143
+ }), n;
140
144
  }
141
- function we(t, e) {
145
+ function pe(t, e) {
142
146
  C((n) => {
143
- const r = e || (n instanceof Element ? n : void 0);
144
- if (typeof r == "string" || r instanceof Element)
145
- return T.subscribe(r, t);
146
- if (r != null && r.current)
147
- return T.subscribe(r.current, t);
147
+ const o = e || (n instanceof Element ? n : void 0);
148
+ if (typeof o == "string" || o instanceof Element)
149
+ return x.subscribe(o, t);
150
+ if (o != null && o.current)
151
+ return x.subscribe(o.current, t);
148
152
  });
149
153
  }
150
- function be(t, e) {
154
+ function we(t, e) {
151
155
  C((n) => {
152
- const r = e || (n instanceof Element ? n : void 0);
153
- if (typeof r == "string" || r instanceof Element)
154
- return A.subscribe(r, t);
155
- if (r != null && r.current)
156
- return A.subscribe(r.current, t);
156
+ const o = e || (n instanceof Element ? n : void 0);
157
+ if (typeof o == "string" || o instanceof Element)
158
+ return v.subscribe(o, t);
159
+ if (o != null && o.current)
160
+ return v.subscribe(o.current, t);
157
161
  });
158
162
  }
159
- function pe(t, e) {
163
+ function be(t, e) {
160
164
  C((n) => O.subscribe(t, e));
161
165
  }
162
166
  function ye(t) {
163
- y((e) => {
164
- e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(v(t));
167
+ S((e) => {
168
+ e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(z(t));
165
169
  }), C((e) => {
166
170
  if (e.shadowRoot)
167
171
  return;
168
172
  const n = e.getRootNode();
169
173
  if (n === document) {
170
- const r = q(t).node;
171
- if (![...document.head.querySelectorAll("style")].find((l) => l.outerHTML === r.outerHTML))
172
- return document.head.appendChild(r), () => {
173
- r.remove();
174
+ const o = g(t).node;
175
+ if (![...document.head.querySelectorAll("style")].find((l) => l.outerHTML === o.outerHTML))
176
+ return document.head.appendChild(o), () => {
177
+ o.remove();
174
178
  };
175
179
  } else if (n instanceof ShadowRoot) {
176
- const r = v(t);
177
- n.adoptedStyleSheets.filter((o) => {
178
- const l = Array.from(o.cssRules);
179
- Array.from(r.cssRules).filter(
180
- (i) => !l.find(
181
- (a) => a.cssText === i.cssText
180
+ const o = z(t);
181
+ n.adoptedStyleSheets.filter((c) => {
182
+ const l = Array.from(c.cssRules);
183
+ Array.from(o.cssRules).filter(
184
+ (d) => !l.find(
185
+ (a) => a.cssText === d.cssText
182
186
  )
183
- ).forEach((i) => {
184
- o.insertRule(i.cssText);
187
+ ).forEach((d) => {
188
+ c.insertRule(d.cssText);
185
189
  });
186
190
  });
187
191
  }
188
192
  });
189
193
  }
190
- function Ee(t) {
191
- return y((e) => e.attachShadow(x(E({}, t), { mode: "open" })));
194
+ function Re(t) {
195
+ return S((e) => e.attachShadow(A(b({}, t), { mode: "open" })));
192
196
  }
193
- function Re() {
194
- return y((t) => t.attachInternals());
197
+ function Se() {
198
+ return S((t) => t.attachInternals());
195
199
  }
196
200
  export {
197
- ce as Component,
198
- Re as attachInternals,
199
- Ee as attachShadow,
201
+ se as Component,
202
+ Se as attachInternals,
203
+ Re as attachShadow,
200
204
  ye as attachStyle,
201
205
  le as createComposed,
202
- he as createContext,
203
- fe as createDamped,
204
- ie as createDerived,
205
- ae as createDerivedArray,
206
- ue as createResource,
207
- se as createStore,
208
- de as createTweened,
209
- Ce as getContext,
210
- me as onAnimationFrame,
206
+ de as createDamped,
207
+ ae as createDerived,
208
+ ue as createDerivedArray,
209
+ fe as createResource,
210
+ ie as createStore,
211
+ me as createTweened,
212
+ he as onAnimationFrame,
211
213
  C as onConnect,
212
214
  u as onDisconnect,
213
- be as onElementResize,
214
- we as onIntersection,
215
- pe as onWindowResize
215
+ we as onElementResize,
216
+ pe as onIntersection,
217
+ be as onWindowResize,
218
+ Ce as watchAttribute
216
219
  };
@@ -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,o)=>(K(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);var L=(i,e,s)=>(K(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const lt=require("../css-unit-parser/index.cjs"),I=require("../ladder/index.cjs"),F=require("../order/index.cjs"),G=require("../window-resizer/index.cjs"),ot=require("../scroll-entries/index.cjs"),J=require("../ticker/index.cjs"),N=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-qY2LdCVL.cjs"),b=require("../layout-8ryRAMGJ.cjs");function j(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),T=Math.atan2(i.m32,i.m33),X=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,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:o,rotationX:T,rotationY:X,rotationZ:V,translationX:u,translationY:C,translationZ:O}}var a,f,p,M,Y,q,x,v,H,m,_,P,d,S,w,R,E,B,g,y,z,c,r,l,Z,$,k,tt,D,et,U,st,A,W;class at{constructor(e,s){h(this,Z);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,Y,"top");h(this,q,!1);h(this,x,!0);h(this,v,!0);h(this,H,!0);h(this,m,0);h(this,_,0);h(this,P,0);h(this,d,0);h(this,S,0);h(this,w,0);h(this,R,0);h(this,E,0);h(this,B,0);h(this,g,{x:0,y:0,z:0});h(this,y,{x:0,y:0,z:0});h(this,z,{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,A,()=>{N.isBrowser&&L(this,D,et).call(this)});h(this,W,()=>{L(this,U,st).call(this),L(this,Z,$).call(this)});N.isBrowser&&(n(this,a,Q.getElement(e)||document.body),n(this,f,Q.getElement(s==null?void 0:s.containerElement)||document.body),n(this,M,(s==null?void 0:s.scrollAxis)||"auto"),n(this,Y,(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,H,(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",()=>{ot.scrollEntries.getAll(this.element).forEach(o=>{this.setScrollStep(()=>o)})}),J.ticker.subscribe(t(this,W),{order:F.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}),G.windowResizer.subscribe(t(this,A),F.TICK_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,w)}get width(){return t(this,m)}get height(){return t(this,_)}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(){J.ticker.unsubscribe(t(this,W)),G.windowResizer.unsubscribe(t(this,A)),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,Y=new WeakMap,q=new WeakMap,x=new WeakMap,v=new WeakMap,H=new WeakMap,m=new WeakMap,_=new WeakMap,P=new WeakMap,d=new WeakMap,S=new WeakMap,w=new WeakMap,R=new WeakMap,E=new WeakMap,B=new WeakMap,g=new WeakMap,y=new WeakMap,z=new WeakMap,c=new WeakMap,r=new WeakMap,l=new WeakMap,Z=new WeakSet,$=function(){t(this,l).calculate(),t(this,r).calculate(),t(this,c).calculate()},k=new WeakSet,tt=function(){t(this,l).setStep("_size","+",{x:t(this,x)?t(this,m):1,y:t(this,x)?t(this,_):1,z:t(this,x)?t(this,P):1});const e=t(this,v)?t(this,R):0,s=t(this,v)?t(this,E):0,o=t(this,v)?t(this,B):0;t(this,r).setStep("_position","+",{x:e,y:s,z:o}),t(this,H)?(t(this,l).setStep("_scale","*",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).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,y).x,y:t(this,y).y,z:t(this,y).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,et=function(){const e=getComputedStyle(t(this,a));n(this,m,Math.max(t(this,a).clientWidth,1)),n(this,_,Math.max(t(this,a).clientHeight,1)),n(this,P,Math.max(lt.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=b.getCumulativeOffsetLeft(t(this,f)),o=b.getCumulativeOffsetTop(t(this,f)),T=t(this,f).clientWidth,X=t(this,f).clientHeight;if(n(this,S,b.getCumulativeOffsetLeft(t(this,a))-s),n(this,d,b.getCumulativeOffsetTop(t(this,a))-o),t(this,M)==="z"){const C=t(this,S)/T,O=t(this,d)/X;n(this,S,(C-Math.floor(C))*T),n(this,d,(O-Math.floor(O))*X),t(this,Y)==="left"?n(this,w,b.getCumulativeOffsetLeft(t(this,a))-s-t(this,S)):n(this,w,b.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(T/2),O=Math.round(X/2),it=t(this,m)?Math.round(t(this,m)/2):0,ht=t(this,_)?Math.round(t(this,_)/2):0,nt=t(this,S)-C+it,rt=(t(this,d)-O+ht)*-1;n(this,R,nt),n(this,E,rt)}else n(this,R,t(this,S)),n(this,E,t(this,d));n(this,B,t(this,w)*-1);const V=new WebKitCSSMatrix(e.transform),u=j(V);t(this,g).x=u.translationX,t(this,g).y=u.translationY,t(this,g).z=u.translationZ,t(this,z).x=u.scaleX,t(this,z).y=u.scaleY,t(this,z).z=u.scaleZ,t(this,y).x=u.rotationX,t(this,y).y=u.rotationY,t(this,y).z=u.rotationZ,L(this,k,tt).call(this),L(this,Z,$).call(this)},U=new WeakSet,st=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)})}},A=new WeakMap,W=new WeakMap;exports.LayoutBox=at;exports.decomposeCSSMatrix=j;
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,o)=>(K(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);var L=(i,e,s)=>(K(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const lt=require("../css-unit-parser/index.cjs"),I=require("../ladder/index.cjs"),F=require("../order/index.cjs"),G=require("../window-resizer/index.cjs"),ot=require("../scroll-entries/index.cjs"),J=require("../ticker/index.cjs"),N=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-qY2LdCVL.cjs"),b=require("../layout-8ryRAMGJ.cjs");function j(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),T=Math.atan2(i.m32,i.m33),X=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:T,rotationY:X,rotationZ:V,translationX:u,translationY:C,translationZ:O}}var a,f,p,M,Y,q,x,v,H,m,_,P,d,S,w,R,E,B,g,y,z,c,r,l,Z,$,k,tt,D,et,U,st,A,W;class at{constructor(e,s){h(this,Z);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,Y,"top");h(this,q,!1);h(this,x,!0);h(this,v,!0);h(this,H,!0);h(this,m,0);h(this,_,0);h(this,P,0);h(this,d,0);h(this,S,0);h(this,w,0);h(this,R,0);h(this,E,0);h(this,B,0);h(this,g,{x:0,y:0,z:0});h(this,y,{x:0,y:0,z:0});h(this,z,{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,A,()=>{N.isBrowser&&L(this,D,et).call(this)});h(this,W,()=>{L(this,U,st).call(this),L(this,Z,$).call(this)});N.isBrowser&&(n(this,a,Q.getElement(e)||document.body),n(this,f,Q.getElement(s==null?void 0:s.containerElement)||document.body),n(this,M,(s==null?void 0:s.scrollAxis)||"auto"),n(this,Y,(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,H,(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",()=>{ot.scrollEntries.getAll(this.element).forEach(o=>{this.setScrollStep(()=>o)})}),J.ticker.subscribe(t(this,W),{order:F.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}),G.windowResizer.subscribe(t(this,A),F.TICK_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,w)}get width(){return t(this,m)}get height(){return t(this,_)}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(){J.ticker.unsubscribe(t(this,W)),G.windowResizer.unsubscribe(t(this,A)),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,Y=new WeakMap,q=new WeakMap,x=new WeakMap,v=new WeakMap,H=new WeakMap,m=new WeakMap,_=new WeakMap,P=new WeakMap,d=new WeakMap,S=new WeakMap,w=new WeakMap,R=new WeakMap,E=new WeakMap,B=new WeakMap,g=new WeakMap,y=new WeakMap,z=new WeakMap,c=new WeakMap,r=new WeakMap,l=new WeakMap,Z=new WeakSet,$=function(){t(this,l).calculate(),t(this,r).calculate(),t(this,c).calculate()},k=new WeakSet,tt=function(){t(this,l).setStep("_size","+",{x:t(this,x)?t(this,m):1,y:t(this,x)?t(this,_):1,z:t(this,x)?t(this,P):1});const e=t(this,v)?t(this,R):0,s=t(this,v)?t(this,E):0,o=t(this,v)?t(this,B):0;t(this,r).setStep("_position","+",{x:e,y:s,z:o}),t(this,H)?(t(this,l).setStep("_scale","*",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).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,y).x,y:t(this,y).y,z:t(this,y).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,et=function(){const e=getComputedStyle(t(this,a));n(this,m,Math.max(t(this,a).clientWidth,1)),n(this,_,Math.max(t(this,a).clientHeight,1)),n(this,P,Math.max(lt.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=b.getCumulativeOffsetLeft(t(this,f)),o=b.getCumulativeOffsetTop(t(this,f)),T=t(this,f).clientWidth,X=t(this,f).clientHeight;if(n(this,S,b.getCumulativeOffsetLeft(t(this,a))-s),n(this,d,b.getCumulativeOffsetTop(t(this,a))-o),t(this,M)==="z"){const C=t(this,S)/T,O=t(this,d)/X;n(this,S,(C-Math.floor(C))*T),n(this,d,(O-Math.floor(O))*X),t(this,Y)==="left"?n(this,w,b.getCumulativeOffsetLeft(t(this,a))-s-t(this,S)):n(this,w,b.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(T/2),O=Math.round(X/2),it=t(this,m)?Math.round(t(this,m)/2):0,ht=t(this,_)?Math.round(t(this,_)/2):0,nt=t(this,S)-C+it,rt=(t(this,d)-O+ht)*-1;n(this,R,nt),n(this,E,rt)}else n(this,R,t(this,S)),n(this,E,t(this,d));n(this,B,t(this,w)*-1);const V=new WebKitCSSMatrix(e.transform),u=j(V);t(this,g).x=u.translationX,t(this,g).y=u.translationY,t(this,g).z=u.translationZ,t(this,z).x=u.scaleX,t(this,z).y=u.scaleY,t(this,z).z=u.scaleZ,t(this,y).x=u.rotationX,t(this,y).y=u.rotationY,t(this,y).z=u.rotationZ,L(this,k,tt).call(this),L(this,Z,$).call(this)},U=new WeakSet,st=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)})}},A=new WeakMap,W=new WeakMap;exports.LayoutBox=at;exports.decomposeCSSMatrix=j;
@@ -27,7 +27,7 @@ function at(i) {
27
27
  ), E = Math.atan2(i.m32, i.m33), H = Math.atan2(
28
28
  -i.m31,
29
29
  Math.sqrt(i.m32 * i.m32 + i.m33 * i.m33)
30
- ), U = Math.atan2(i.m21, i.m11), u = i.m41, C = i.m42, b = i.m43;
30
+ ), U = Math.atan2(i.m21, i.m11), u = i.m41, C = i.m42 * -1, b = i.m43;
31
31
  return {
32
32
  scaleX: e,
33
33
  scaleY: s,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -1,2 +0,0 @@
1
- export declare function createContext<Context>(name: string, value: Context): void;
2
- export declare function getContext<Context>(name: string): Context;