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.
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.d.ts +2 -0
- package/lib/attribute/index.js +43 -34
- package/lib/component/Component.d.ts +1 -5
- package/lib/component/hooks/attributes.d.ts +2 -0
- package/lib/component/index.cjs +1 -1
- package/lib/component/index.d.ts +1 -1
- package/lib/component/index.js +135 -132
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +1 -1
- package/package.json +1 -1
- package/lib/component/hooks/context.d.ts +0 -2
package/lib/attribute/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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;
|
package/lib/attribute/index.d.ts
CHANGED
|
@@ -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
|
}
|
package/lib/attribute/index.js
CHANGED
|
@@ -1,56 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (!
|
|
1
|
+
var w = (s, i, t) => {
|
|
2
|
+
if (!i.has(s))
|
|
3
3
|
throw TypeError("Cannot " + t);
|
|
4
4
|
};
|
|
5
|
-
var e = (s,
|
|
6
|
-
if (
|
|
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
|
-
|
|
9
|
-
},
|
|
10
|
-
var
|
|
11
|
-
import { S as
|
|
12
|
-
import { p as
|
|
13
|
-
import { i as
|
|
14
|
-
import { g as
|
|
15
|
-
var
|
|
16
|
-
class
|
|
17
|
-
constructor(t,
|
|
18
|
-
super(
|
|
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,
|
|
22
|
-
u(this,
|
|
22
|
+
u(this, r, null);
|
|
23
|
+
u(this, c, void 0);
|
|
23
24
|
u(this, a, null);
|
|
24
|
-
u(this,
|
|
25
|
+
u(this, o, null);
|
|
25
26
|
u(this, n, !1);
|
|
26
|
-
|
|
27
|
-
e(this,
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
})),
|
|
33
|
-
e(this,
|
|
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,
|
|
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
|
|
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
|
|
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
|
-
|
|
49
|
-
const t = e(this,
|
|
50
|
-
t != null && (this.current =
|
|
51
|
-
},
|
|
52
|
-
e(this, n) || (
|
|
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
|
-
|
|
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>;
|
package/lib/component/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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;
|
package/lib/component/index.d.ts
CHANGED
|
@@ -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 {
|
|
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';
|
package/lib/component/index.js
CHANGED
|
@@ -1,216 +1,219 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var F = Object.defineProperty, H = Object.defineProperties;
|
|
2
|
+
var I = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var D = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var k = (t, e, n) => e in t ?
|
|
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
|
-
|
|
7
|
+
L.call(e, n) && k(t, n, e[n]);
|
|
8
8
|
if (D)
|
|
9
9
|
for (var n of D(e))
|
|
10
|
-
|
|
10
|
+
M.call(e, n) && k(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
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) => (
|
|
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
|
|
23
|
-
import { e as
|
|
24
|
-
import { D as
|
|
25
|
-
import { D as
|
|
26
|
-
import { ticker as
|
|
27
|
-
import { Tweened as
|
|
28
|
-
import { D as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
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
|
|
33
|
-
let
|
|
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
|
-
|
|
36
|
+
R.addConnectCallback(t);
|
|
37
37
|
}
|
|
38
38
|
function u(t) {
|
|
39
|
-
|
|
39
|
+
R.addDisconnectCallback(t);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return t(
|
|
41
|
+
function S(t) {
|
|
42
|
+
return t(R);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
var
|
|
46
|
-
const e = typeof t[0] == "string" ? HTMLElement : t[0], n = typeof t[0] == "string" ? t[0] : t[1],
|
|
47
|
-
let
|
|
48
|
-
|
|
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
|
-
|
|
51
|
-
constructor(
|
|
50
|
+
i || (t[0].componentConstructor ? i = class extends e {
|
|
51
|
+
constructor(p) {
|
|
52
52
|
super();
|
|
53
|
-
|
|
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
|
-
},
|
|
60
|
-
|
|
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
|
-
|
|
67
|
-
|
|
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
|
-
|
|
70
|
-
s(this, a).add(
|
|
72
|
+
addConnectCallback(r) {
|
|
73
|
+
s(this, a).add(r);
|
|
71
74
|
}
|
|
72
|
-
|
|
73
|
-
s(this,
|
|
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
|
|
77
|
-
(
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
}), s(this,
|
|
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
|
|
84
|
-
(
|
|
85
|
-
|
|
86
|
-
}), s(this,
|
|
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
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return
|
|
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
|
|
101
|
+
const e = new P(...t);
|
|
96
102
|
return u(e.close), e;
|
|
97
103
|
}
|
|
98
104
|
function ae(...t) {
|
|
99
|
-
const e = new
|
|
105
|
+
const e = new j(...t);
|
|
100
106
|
return u(e.close), e;
|
|
101
107
|
}
|
|
102
|
-
function
|
|
103
|
-
const e = new
|
|
108
|
+
function ue(...t) {
|
|
109
|
+
const e = new q(...t);
|
|
104
110
|
return u(e.close), e;
|
|
105
111
|
}
|
|
106
|
-
function
|
|
107
|
-
const e = new
|
|
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
|
|
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
|
|
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
|
|
121
|
-
const
|
|
122
|
-
return
|
|
123
|
-
culling:
|
|
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
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
|
145
|
+
function pe(t, e) {
|
|
142
146
|
C((n) => {
|
|
143
|
-
const
|
|
144
|
-
if (typeof
|
|
145
|
-
return
|
|
146
|
-
if (
|
|
147
|
-
return
|
|
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
|
|
154
|
+
function we(t, e) {
|
|
151
155
|
C((n) => {
|
|
152
|
-
const
|
|
153
|
-
if (typeof
|
|
154
|
-
return
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
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
|
|
163
|
+
function be(t, e) {
|
|
160
164
|
C((n) => O.subscribe(t, e));
|
|
161
165
|
}
|
|
162
166
|
function ye(t) {
|
|
163
|
-
|
|
164
|
-
e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(
|
|
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
|
|
171
|
-
if (![...document.head.querySelectorAll("style")].find((l) => l.outerHTML ===
|
|
172
|
-
return document.head.appendChild(
|
|
173
|
-
|
|
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
|
|
177
|
-
n.adoptedStyleSheets.filter((
|
|
178
|
-
const l = Array.from(
|
|
179
|
-
Array.from(
|
|
180
|
-
(
|
|
181
|
-
(a) => a.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((
|
|
184
|
-
|
|
187
|
+
).forEach((d) => {
|
|
188
|
+
c.insertRule(d.cssText);
|
|
185
189
|
});
|
|
186
190
|
});
|
|
187
191
|
}
|
|
188
192
|
});
|
|
189
193
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
194
|
+
function Re(t) {
|
|
195
|
+
return S((e) => e.attachShadow(A(b({}, t), { mode: "open" })));
|
|
192
196
|
}
|
|
193
|
-
function
|
|
194
|
-
return
|
|
197
|
+
function Se() {
|
|
198
|
+
return S((t) => t.attachInternals());
|
|
195
199
|
}
|
|
196
200
|
export {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
201
|
+
se as Component,
|
|
202
|
+
Se as attachInternals,
|
|
203
|
+
Re as attachShadow,
|
|
200
204
|
ye as attachStyle,
|
|
201
205
|
le as createComposed,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
215
|
+
we as onElementResize,
|
|
216
|
+
pe as onIntersection,
|
|
217
|
+
be as onWindowResize,
|
|
218
|
+
Ce as watchAttribute
|
|
216
219
|
};
|
package/lib/layout-box/index.cjs
CHANGED
|
@@ -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;
|
package/lib/layout-box/index.js
CHANGED
|
@@ -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