aptechka 0.1.15 → 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,E=(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)),y=(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"),p=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 S=null;const b=new Map;function C(t){S.addConnectCallback(t)}function l(t){S.addDisconnectCallback(t)}function R(t){return t(S)}function $(...t){return e=>{var a,u,f,x;const n=typeof t[0]=="string"?HTMLElement:t[0],r=typeof t[0]=="string"?t[0]:t[1],o=typeof t[0]=="string"?t[1]:t[2],d=`e-${r}`,w=typeof t[0]=="string"?t[2]:t[3];let i=customElements.get(d);return i||(i=(x=class extends n{constructor(c){super();y(this,a,new Set);y(this,u,new Set);y(this,f,new Set);S=this;const m=o(E({element:this},c));m&&g.element(this,m),s(this,f).forEach(h=>{h(this)}),s(this,f).clear(),b.forEach((h,z)=>{h.element===this&&b.delete(z)})}addConnectCallback(c){s(this,a).add(c)}addDisconnectCallback(c){s(this,u).add(c)}addAfterCreateCallback(c){s(this,f).add(c)}connectedCallback(){var c;(c=super.connectedCallback)==null||c.call(this),s(this,a).forEach(m=>{const h=m(this);h&&s(this,u).add(h)}),s(this,a).clear()}disconnectedCallback(){var c;(c=super.disconnectedCallback)==null||c.call(this),s(this,u).forEach(m=>{m(this)}),s(this,u).clear()}},a=new WeakMap,u=new WeakMap,f=new WeakMap,x),w!=null&&w.formAssociated&&(i.formAssociated=!0),customElements.define(d,i)),new i(e||{})}}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 p.DerivedArray(...t);return l(e.close),e}function Q(...t){const e=new p.Composed(...t);return l(e.close),e}function U(...t){const e=new p.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 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),W.ticker.subscribe(t,{culling:r,maxFPS:e==null?void 0:e.maxFPS,order:e==null?void 0:e.order})})}function Z(t,e){R(n=>{b.set(t,{element:n,value:e})})}function ee(t){var e;return(e=b.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){R(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(d=>d.outerHTML===r.outerHTML))return document.head.appendChild(r),()=>{r.remove()}}else if(n instanceof ShadowRoot){const r=A.createStylesheet(t);n.adoptedStyleSheets.filter(o=>{const d=Array.from(o.cssRules);Array.from(r.cssRules).filter(i=>!d.find(a=>a.cssText===i.cssText)).forEach(i=>{o.insertRule(i.cssText)})})}})}function oe(t){return R(e=>e.attachShadow(q(E({},t),{mode:"open"})))}function se(){return R(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,218 +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, R = (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)), b = (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 y = null;
34
- const p = /* @__PURE__ */ new Map();
33
+ import { c as z } from "../createStylesheet-Zqf3lXhM.js";
34
+ let R = null;
35
35
  function C(t) {
36
- y.addConnectCallback(t);
36
+ R.addConnectCallback(t);
37
37
  }
38
38
  function u(t) {
39
- y.addDisconnectCallback(t);
39
+ R.addDisconnectCallback(t);
40
40
  }
41
- function E(t) {
42
- return t(y);
41
+ function S(t) {
42
+ return t(R);
43
43
  }
44
44
  function se(...t) {
45
- return (e) => {
46
- var a, l, d, S;
47
- const n = typeof t[0] == "string" ? HTMLElement : t[0], r = typeof t[0] == "string" ? t[0] : t[1], c = typeof t[0] == "string" ? t[1] : t[2], f = `e-${r}`, w = typeof t[0] == "string" ? t[2] : t[3];
48
- let i = customElements.get(
49
- f
50
- );
51
- return i || (i = (S = class extends n {
52
- constructor(o) {
53
- super();
54
- b(this, a, /* @__PURE__ */ new Set());
55
- b(this, l, /* @__PURE__ */ new Set());
56
- b(this, d, /* @__PURE__ */ new Set());
57
- y = this;
58
- const m = c(R({
59
- element: this
60
- }, o));
61
- m && P(this, m), s(this, d).forEach((h) => {
62
- h(this);
63
- }), s(this, d).clear(), p.forEach((h, g) => {
64
- h.element === this && p.delete(g);
65
- });
66
- }
67
- addConnectCallback(o) {
68
- s(this, a).add(o);
69
- }
70
- addDisconnectCallback(o) {
71
- s(this, l).add(o);
72
- }
73
- addAfterCreateCallback(o) {
74
- s(this, d).add(o);
75
- }
76
- connectedCallback() {
77
- var o;
78
- (o = super.connectedCallback) == null || o.call(this), s(this, a).forEach((m) => {
79
- const h = m(this);
80
- h && s(this, l).add(h);
81
- }), s(this, a).clear();
82
- }
83
- disconnectedCallback() {
84
- var o;
85
- (o = super.disconnectedCallback) == null || o.call(this), s(this, l).forEach((m) => {
86
- m(this);
87
- }), s(this, l).clear();
88
- }
89
- }, a = new WeakMap(), l = new WeakMap(), d = new WeakMap(), S), w != null && w.formAssociated && (i.formAssociated = !0), customElements.define(f, i)), new i(e || {});
90
- };
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
+ );
50
+ i || (t[0].componentConstructor ? i = class extends e {
51
+ constructor(p) {
52
+ super();
53
+ const r = o(b({
54
+ element: this
55
+ }, p));
56
+ r && T(this, r);
57
+ }
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();
71
+ }
72
+ addConnectCallback(r) {
73
+ s(this, a).add(r);
74
+ }
75
+ addDisconnectCallback(r) {
76
+ s(this, f).add(r);
77
+ }
78
+ addAfterCreateCallback(r) {
79
+ s(this, m).add(r);
80
+ }
81
+ connectedCallback() {
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();
87
+ }
88
+ disconnectedCallback() {
89
+ var r;
90
+ (r = super.disconnectedCallback) == null || r.call(this), s(this, f).forEach((h) => {
91
+ h(this);
92
+ }), s(this, f).clear();
93
+ }
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;
91
99
  }
92
100
  function ie(...t) {
93
- const e = new N(...t);
101
+ const e = new P(...t);
94
102
  return u(e.close), e;
95
103
  }
96
104
  function ae(...t) {
97
- const e = new B(...t);
105
+ const e = new j(...t);
98
106
  return u(e.close), e;
99
107
  }
100
- function le(...t) {
101
- const e = new W(...t);
108
+ function ue(...t) {
109
+ const e = new q(...t);
102
110
  return u(e.close), e;
103
111
  }
104
- function ue(...t) {
105
- const e = new $(...t);
112
+ function le(...t) {
113
+ const e = new B(...t);
106
114
  return u(e.close), e;
107
115
  }
108
116
  function fe(...t) {
109
- const e = new j(...t);
117
+ const e = new W(...t);
110
118
  return u(e.close), e;
111
119
  }
112
120
  function de(...t) {
113
- const e = new K(...t);
121
+ const e = new J(...t);
114
122
  return u(e.close), e;
115
123
  }
116
124
  function me(...t) {
117
- const e = new J(...t);
125
+ const e = new G(...t);
118
126
  return u(e.close), e;
119
127
  }
120
128
  function he(t, e) {
121
129
  C((n) => {
122
- let r;
130
+ let o;
123
131
  const c = e == null ? void 0 : e.culling;
124
- return c === !0 ? r = n : typeof c == "string" || c instanceof Element ? r = c : typeof c == "object" && (r = c.current), G.subscribe(t, {
125
- culling: r,
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,
126
134
  maxFPS: e == null ? void 0 : e.maxFPS,
127
135
  order: e == null ? void 0 : e.order
128
136
  });
129
137
  });
130
138
  }
131
139
  function Ce(t, e) {
132
- E((n) => {
133
- p.set(t, {
134
- element: n,
135
- value: e
136
- });
137
- });
138
- }
139
- function we(t) {
140
- var e;
141
- return (e = p.get(t)) == null ? void 0 : e.value;
140
+ const n = S((o) => new K(o, t, e));
141
+ return u(() => {
142
+ n.close();
143
+ }), n;
142
144
  }
143
- function be(t, e) {
145
+ function pe(t, e) {
144
146
  C((n) => {
145
- const r = e || (n instanceof Element ? n : void 0);
146
- if (typeof r == "string" || r instanceof Element)
147
- return T.subscribe(r, t);
148
- if (r != null && r.current)
149
- 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);
150
152
  });
151
153
  }
152
- function pe(t, e) {
154
+ function we(t, e) {
153
155
  C((n) => {
154
- const r = e || (n instanceof Element ? n : void 0);
155
- if (typeof r == "string" || r instanceof Element)
156
- return A.subscribe(r, t);
157
- if (r != null && r.current)
158
- 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);
159
161
  });
160
162
  }
161
- function ye(t, e) {
163
+ function be(t, e) {
162
164
  C((n) => O.subscribe(t, e));
163
165
  }
164
- function Ee(t) {
165
- E((e) => {
166
- e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(v(t));
166
+ function ye(t) {
167
+ S((e) => {
168
+ e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(z(t));
167
169
  }), C((e) => {
168
170
  if (e.shadowRoot)
169
171
  return;
170
172
  const n = e.getRootNode();
171
173
  if (n === document) {
172
- const r = q(t).node;
173
- if (![...document.head.querySelectorAll("style")].find((f) => f.outerHTML === r.outerHTML))
174
- return document.head.appendChild(r), () => {
175
- 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();
176
178
  };
177
179
  } else if (n instanceof ShadowRoot) {
178
- const r = v(t);
180
+ const o = z(t);
179
181
  n.adoptedStyleSheets.filter((c) => {
180
- const f = Array.from(c.cssRules);
181
- Array.from(r.cssRules).filter(
182
- (i) => !f.find(
183
- (a) => a.cssText === i.cssText
182
+ const l = Array.from(c.cssRules);
183
+ Array.from(o.cssRules).filter(
184
+ (d) => !l.find(
185
+ (a) => a.cssText === d.cssText
184
186
  )
185
- ).forEach((i) => {
186
- c.insertRule(i.cssText);
187
+ ).forEach((d) => {
188
+ c.insertRule(d.cssText);
187
189
  });
188
190
  });
189
191
  }
190
192
  });
191
193
  }
192
194
  function Re(t) {
193
- return E((e) => e.attachShadow(x(R({}, t), { mode: "open" })));
195
+ return S((e) => e.attachShadow(A(b({}, t), { mode: "open" })));
194
196
  }
195
197
  function Se() {
196
- return E((t) => t.attachInternals());
198
+ return S((t) => t.attachInternals());
197
199
  }
198
200
  export {
199
201
  se as Component,
200
202
  Se as attachInternals,
201
203
  Re as attachShadow,
202
- Ee as attachStyle,
203
- ue as createComposed,
204
- Ce as createContext,
204
+ ye as attachStyle,
205
+ le as createComposed,
205
206
  de as createDamped,
206
207
  ae as createDerived,
207
- le as createDerivedArray,
208
+ ue as createDerivedArray,
208
209
  fe as createResource,
209
210
  ie as createStore,
210
211
  me as createTweened,
211
- we as getContext,
212
212
  he as onAnimationFrame,
213
213
  C as onConnect,
214
214
  u as onDisconnect,
215
- pe as onElementResize,
216
- be as onIntersection,
217
- ye as onWindowResize
215
+ we as onElementResize,
216
+ pe as onIntersection,
217
+ be as onWindowResize,
218
+ Ce as watchAttribute
218
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,
@@ -0,0 +1 @@
1
+ "use strict";var l=(e,s,r)=>{if(!s.has(e))throw TypeError("Cannot "+r)};var c=(e,s,r)=>(l(e,s,"read from private field"),r?r.call(e):s.get(e)),n=(e,s,r)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,r)},d=(e,s,r,i)=>(l(e,s,"write to private field"),i?i.call(e,r):s.set(e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../element-resizer/index.cjs"),z=require("../Store-D0_rDIsE.cjs"),h=require("../window-resizer/index.cjs");var t,u;class a extends z.Store{constructor(r,i){super(r(),i);n(this,t,void 0);n(this,u,()=>{this.current=c(this,t).call(this)});d(this,t,r),(i==null?void 0:i.dispatcher)instanceof Element?b.elementResizer.subscribe(i.dispatcher,c(this,u)):h.windowResizer.subscribe(c(this,u))}close(){super.close(),h.windowResizer.unsubscribe(c(this,t)),b.elementResizer.unsubscribe(c(this,t))}}t=new WeakMap,u=new WeakMap;exports.Resized=a;
@@ -0,0 +1,30 @@
1
+ var h = (e, s, r) => {
2
+ if (!s.has(e))
3
+ throw TypeError("Cannot " + r);
4
+ };
5
+ var c = (e, s, r) => (h(e, s, "read from private field"), r ? r.call(e) : s.get(e)), b = (e, s, r) => {
6
+ if (s.has(e))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ s instanceof WeakSet ? s.add(e) : s.set(e, r);
9
+ }, l = (e, s, r, i) => (h(e, s, "write to private field"), i ? i.call(e, r) : s.set(e, r), r);
10
+ import { elementResizer as m } from "../element-resizer/index.js";
11
+ import { S as d } from "../Store-JOKrNVEr.js";
12
+ import { windowResizer as a } from "../window-resizer/index.js";
13
+ var t, u;
14
+ class o extends d {
15
+ constructor(r, i) {
16
+ super(r(), i);
17
+ b(this, t, void 0);
18
+ b(this, u, () => {
19
+ this.current = c(this, t).call(this);
20
+ });
21
+ l(this, t, r), (i == null ? void 0 : i.dispatcher) instanceof Element ? m.subscribe(i.dispatcher, c(this, u)) : a.subscribe(c(this, u));
22
+ }
23
+ close() {
24
+ super.close(), a.unsubscribe(c(this, t)), m.unsubscribe(c(this, t));
25
+ }
26
+ }
27
+ t = new WeakMap(), u = new WeakMap();
28
+ export {
29
+ o as Resized
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -143,6 +143,11 @@
143
143
  "default": "./lib/popover/index.js",
144
144
  "types": "./lib/popover/index.d.ts"
145
145
  },
146
+ "./resized": {
147
+ "require": "./lib/resized/index.cjs",
148
+ "default": "./lib/resized/index.js",
149
+ "types": "./lib/resized/index.d.ts"
150
+ },
146
151
  "./router": {
147
152
  "require": "./lib/router/index.cjs",
148
153
  "default": "./lib/router/index.js",
@@ -275,6 +280,9 @@
275
280
  "popover": [
276
281
  "lib/popover/index.d.ts"
277
282
  ],
283
+ "resized": [
284
+ "lib/resized/index.d.ts"
285
+ ],
278
286
  "router": [
279
287
  "lib/router/index.d.ts"
280
288
  ],
@@ -1,2 +0,0 @@
1
- export declare function createContext<Context>(name: string, value: Context): void;
2
- export declare function getContext<Context>(name: string): Context;