aptechka 0.4.9 → 0.4.11
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/Damped-BdnkNOcb.cjs +1 -0
- package/lib/Damped-Ceg1a3X8.js +150 -0
- package/lib/DragControls-C7P6P5HO.cjs +1 -0
- package/lib/DragControls-CZhJHO0_.js +146 -0
- package/lib/animation/Animation.d.ts +23 -0
- package/lib/animation/Damped.d.ts +15 -12
- package/lib/animation/Tweened.d.ts +9 -11
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.d.ts +1 -1
- package/lib/animation/index.js +49 -75
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +2 -2
- package/lib/checkbox/index.cjs +1 -1
- package/lib/checkbox/index.js +2 -2
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +2 -2
- package/lib/{createStylesheet-W0b965g0.cjs → createStylesheet-CqHU9_qv.cjs} +1 -1
- package/lib/{createStylesheet-D6C3BPkl.js → createStylesheet-DBCEbDjI.js} +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +2 -2
- package/lib/{index-ilQWX_BM.js → index-BUOBDenR.js} +2 -2
- package/lib/{index-C_qv6rk4.cjs → index-Bv5vIuF-.cjs} +1 -1
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +2 -2
- package/lib/{object-BZELAoVj.cjs → object-CCiXnER2.cjs} +1 -1
- package/lib/{object-R34VLqhp.js → object-D6MVWB4l.js} +8 -8
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +2 -2
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +1 -1
- package/lib/scroll/ScrollElement.d.ts +2 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +424 -411
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/{tags-D0zt3vue.js → tags-CMPg9ETZ.js} +1 -1
- package/lib/{tags-CK7mk_EP.cjs → tags-Djb6mb1o.cjs} +1 -1
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +1 -1
- package/lib/tweaker/index.cjs +1 -1
- package/lib/tweaker/index.js +3 -3
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
- package/lib/Damped-9h4qaGcS.cjs +0 -1
- package/lib/Damped-HhitpTP_.js +0 -132
- package/lib/DragControls-CuGSxr1d.js +0 -137
- package/lib/DragControls-Dfbbq8Wb.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty,L=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var k=(e,s,t)=>s in e?w(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,N=(e,s)=>{for(var t in s||(s={}))j.call(s,t)&&k(e,t,s[t]);if(O)for(var t of O(s))z.call(s,t)&&k(e,t,s[t]);return e},P=(e,s)=>L(e,_(s));var v=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var i=(e,s,t)=>(v(e,s,"read from private field"),t?t.call(e):s.get(e)),a=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},r=(e,s,t,h)=>(v(e,s,"write to private field"),h?h.call(e,t):s.set(e,t),t);const D=require("./math-GDWEqu7y.cjs"),q=require("./number-yVpzMdbQ.cjs"),c=require("./polyfills-CrcS4RcO.cjs"),I=require("./Store-C-1ruEIm.cjs"),M=require("./ticker/index.cjs");var d,f,F,m,C;class R extends I.Store{constructor(t,h){super(t||0);a(this,d,void 0);a(this,f,void 0);a(this,F,void 0);a(this,m,new I.Store(!1));a(this,C,t=>{this.handleAnimationFrame(t)});this.updateOptions(h)}get isRunning(){return i(this,m)}reset(){this.unlistenAnimationFrame(),super.reset()}close(){super.close(),this.unlistenAnimationFrame()}updateOptions(t){r(this,d,c.nullishCoalescing(t==null?void 0:t.maxFPS,i(this,d))),r(this,f,c.nullishCoalescing(t==null?void 0:t.order,i(this,f))),r(this,F,c.nullishCoalescing(t==null?void 0:t.culling,i(this,F)))}listenAnimationFrame(){i(this,m).current||(i(this,m).current=!0,M.ticker.subscribe(i(this,C),{maxFPS:i(this,d),order:i(this,f),culling:i(this,F)}))}unlistenAnimationFrame(){i(this,m).current&&(i(this,m).current=!1,M.ticker.unsubscribe(i(this,C)))}}d=new WeakMap,f=new WeakMap,F=new WeakMap,m=new WeakMap,C=new WeakMap;var n,A,u,l,g,x,b;class B extends R{constructor(t,h){super(t||0,h);a(this,n,void 0);a(this,A,void 0);a(this,u,void 0);a(this,l,void 0);a(this,g,void 0);a(this,x,void 0);a(this,b,void 0);this.damping=.01,this.stiffness=0,this.mass=0,r(this,n,0),r(this,A,0),r(this,u,0),r(this,l,0),r(this,g,0),r(this,x,0),r(this,b,()=>{this.set(i(this,n),!0)}),r(this,u,c.nullishCoalescing(h==null?void 0:h.min,-1/0)),r(this,l,c.nullishCoalescing(h==null?void 0:h.max,1/0)),r(this,n,this.current)}get target(){return i(this,n)}get direction(){return i(this,A)}get min(){return i(this,u)}set min(t){r(this,u,t),i(this,b).call(this)}get max(){return i(this,l)}set max(t){r(this,l,t),i(this,b).call(this)}get velocity(){return i(this,g)}get speed(){return i(this,x)}get length(){return i(this,l)-i(this,u)}get progress(){return this.length?q.preciseNumber((this.current-i(this,u))/this.length,6):0}get entry(){return P(N({},super.entry),{min:i(this,u),max:i(this,l),length:this.length,direction:this.direction,progress:this.progress})}set(t,h=!1){const y=i(this,n);r(this,n,D.clamp(t,i(this,u),i(this,l))),h&&(this.current=i(this,n)),i(this,n)!==y&&(r(this,A,Math.sign(t-i(this,n))||1),this.listenAnimationFrame())}shift(t,h=!1){this.set(i(this,n)+t,h)}reset(){this.set(this.initial,!0),super.reset()}listenAnimationFrame(){this.current!==this.target&&super.listenAnimationFrame()}updateOptions(t){super.updateOptions(t),this.damping=c.nullishCoalescing(t==null?void 0:t.damping,this.damping),this.mass=c.nullishCoalescing(t==null?void 0:t.damping,this.mass),this.stiffness=c.nullishCoalescing(t==null?void 0:t.damping,this.stiffness)}handleAnimationFrame(t){q.preciseNumber(this.current,4)===q.preciseNumber(this.target,4)&&(this.unlistenAnimationFrame(),this.current=this.target);const h=this.current,y=Math.abs(h-this.target);r(this,x,y/t.elapsed);const S=t.elapsed/1e3;if(this.mass||this.stiffness){const p=(i(this,n)-this.current)*this.stiffness-i(this,g)*this.damping;r(this,g,i(this,g)+p/this.mass*S),this.current+=i(this,g)*S}else this.current=D.damp(this.current,this.target,this.damping,S)}}n=new WeakMap,A=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap;exports.Animation=R;exports.Damped=B;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var w = Object.defineProperty, L = Object.defineProperties;
|
|
2
|
+
var N = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var P = Object.getOwnPropertySymbols;
|
|
4
|
+
var j = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var v = (e, i, t) => i in e ? w(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, C = (e, i) => {
|
|
6
|
+
for (var t in i || (i = {}))
|
|
7
|
+
j.call(i, t) && v(e, t, i[t]);
|
|
8
|
+
if (P)
|
|
9
|
+
for (var t of P(i))
|
|
10
|
+
q.call(i, t) && v(e, t, i[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, D = (e, i) => L(e, N(i));
|
|
13
|
+
var I = (e, i, t) => {
|
|
14
|
+
if (!i.has(e))
|
|
15
|
+
throw TypeError("Cannot " + t);
|
|
16
|
+
};
|
|
17
|
+
var s = (e, i, t) => (I(e, i, "read from private field"), t ? t.call(e) : i.get(e)), a = (e, i, t) => {
|
|
18
|
+
if (i.has(e))
|
|
19
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
20
|
+
i instanceof WeakSet ? i.add(e) : i.set(e, t);
|
|
21
|
+
}, r = (e, i, t, h) => (I(e, i, "write to private field"), h ? h.call(e, t) : i.set(e, t), t);
|
|
22
|
+
import { c as z, d as B } from "./math-BOBiC4TN.js";
|
|
23
|
+
import { p as O } from "./number-Bo5RdrA1.js";
|
|
24
|
+
import { n as c } from "./polyfills-DJUYczFm.js";
|
|
25
|
+
import { S as M } from "./Store-BQXXikps.js";
|
|
26
|
+
import { ticker as R } from "./ticker/index.js";
|
|
27
|
+
var d, f, F, g, y;
|
|
28
|
+
class E extends M {
|
|
29
|
+
constructor(t, h) {
|
|
30
|
+
super(t || 0);
|
|
31
|
+
a(this, d, void 0);
|
|
32
|
+
a(this, f, void 0);
|
|
33
|
+
a(this, F, void 0);
|
|
34
|
+
a(this, g, new M(!1));
|
|
35
|
+
a(this, y, (t) => {
|
|
36
|
+
this.handleAnimationFrame(t);
|
|
37
|
+
});
|
|
38
|
+
this.updateOptions(h);
|
|
39
|
+
}
|
|
40
|
+
get isRunning() {
|
|
41
|
+
return s(this, g);
|
|
42
|
+
}
|
|
43
|
+
reset() {
|
|
44
|
+
this.unlistenAnimationFrame(), super.reset();
|
|
45
|
+
}
|
|
46
|
+
close() {
|
|
47
|
+
super.close(), this.unlistenAnimationFrame();
|
|
48
|
+
}
|
|
49
|
+
updateOptions(t) {
|
|
50
|
+
r(this, d, c(t == null ? void 0 : t.maxFPS, s(this, d))), r(this, f, c(t == null ? void 0 : t.order, s(this, f))), r(this, F, c(t == null ? void 0 : t.culling, s(this, F)));
|
|
51
|
+
}
|
|
52
|
+
listenAnimationFrame() {
|
|
53
|
+
s(this, g).current || (s(this, g).current = !0, R.subscribe(s(this, y), {
|
|
54
|
+
maxFPS: s(this, d),
|
|
55
|
+
order: s(this, f),
|
|
56
|
+
culling: s(this, F)
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
unlistenAnimationFrame() {
|
|
60
|
+
s(this, g).current && (s(this, g).current = !1, R.unsubscribe(s(this, y)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
d = new WeakMap(), f = new WeakMap(), F = new WeakMap(), g = new WeakMap(), y = new WeakMap();
|
|
64
|
+
var n, A, m, u, l, x, b;
|
|
65
|
+
class U extends E {
|
|
66
|
+
constructor(t, h) {
|
|
67
|
+
super(t || 0, h);
|
|
68
|
+
a(this, n, void 0);
|
|
69
|
+
a(this, A, void 0);
|
|
70
|
+
a(this, m, void 0);
|
|
71
|
+
a(this, u, void 0);
|
|
72
|
+
a(this, l, void 0);
|
|
73
|
+
a(this, x, void 0);
|
|
74
|
+
a(this, b, void 0);
|
|
75
|
+
this.damping = 0.01, this.stiffness = 0, this.mass = 0, r(this, n, 0), r(this, A, 0), r(this, m, 0), r(this, u, 0), r(this, l, 0), r(this, x, 0), r(this, b, () => {
|
|
76
|
+
this.set(s(this, n), !0);
|
|
77
|
+
}), r(this, m, c(h == null ? void 0 : h.min, -1 / 0)), r(this, u, c(h == null ? void 0 : h.max, 1 / 0)), r(this, n, this.current);
|
|
78
|
+
}
|
|
79
|
+
get target() {
|
|
80
|
+
return s(this, n);
|
|
81
|
+
}
|
|
82
|
+
get direction() {
|
|
83
|
+
return s(this, A);
|
|
84
|
+
}
|
|
85
|
+
get min() {
|
|
86
|
+
return s(this, m);
|
|
87
|
+
}
|
|
88
|
+
set min(t) {
|
|
89
|
+
r(this, m, t), s(this, b).call(this);
|
|
90
|
+
}
|
|
91
|
+
get max() {
|
|
92
|
+
return s(this, u);
|
|
93
|
+
}
|
|
94
|
+
set max(t) {
|
|
95
|
+
r(this, u, t), s(this, b).call(this);
|
|
96
|
+
}
|
|
97
|
+
get velocity() {
|
|
98
|
+
return s(this, l);
|
|
99
|
+
}
|
|
100
|
+
get speed() {
|
|
101
|
+
return s(this, x);
|
|
102
|
+
}
|
|
103
|
+
get length() {
|
|
104
|
+
return s(this, u) - s(this, m);
|
|
105
|
+
}
|
|
106
|
+
get progress() {
|
|
107
|
+
return this.length ? O((this.current - s(this, m)) / this.length, 6) : 0;
|
|
108
|
+
}
|
|
109
|
+
get entry() {
|
|
110
|
+
return D(C({}, super.entry), {
|
|
111
|
+
min: s(this, m),
|
|
112
|
+
max: s(this, u),
|
|
113
|
+
length: this.length,
|
|
114
|
+
direction: this.direction,
|
|
115
|
+
progress: this.progress
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
set(t, h = !1) {
|
|
119
|
+
const S = s(this, n);
|
|
120
|
+
r(this, n, z(t, s(this, m), s(this, u))), h && (this.current = s(this, n)), s(this, n) !== S && (r(this, A, Math.sign(t - s(this, n)) || 1), this.listenAnimationFrame());
|
|
121
|
+
}
|
|
122
|
+
shift(t, h = !1) {
|
|
123
|
+
this.set(s(this, n) + t, h);
|
|
124
|
+
}
|
|
125
|
+
reset() {
|
|
126
|
+
this.set(this.initial, !0), super.reset();
|
|
127
|
+
}
|
|
128
|
+
listenAnimationFrame() {
|
|
129
|
+
this.current !== this.target && super.listenAnimationFrame();
|
|
130
|
+
}
|
|
131
|
+
updateOptions(t) {
|
|
132
|
+
super.updateOptions(t), this.damping = c(t == null ? void 0 : t.damping, this.damping), this.mass = c(t == null ? void 0 : t.damping, this.mass), this.stiffness = c(t == null ? void 0 : t.damping, this.stiffness);
|
|
133
|
+
}
|
|
134
|
+
handleAnimationFrame(t) {
|
|
135
|
+
O(this.current, 4) === O(this.target, 4) && (this.unlistenAnimationFrame(), this.current = this.target);
|
|
136
|
+
const h = this.current, S = Math.abs(h - this.target);
|
|
137
|
+
r(this, x, S / t.elapsed);
|
|
138
|
+
const p = t.elapsed / 1e3;
|
|
139
|
+
if (this.mass || this.stiffness) {
|
|
140
|
+
const k = (s(this, n) - this.current) * this.stiffness - s(this, l) * this.damping;
|
|
141
|
+
r(this, l, s(this, l) + k / this.mass * p), this.current += s(this, l) * p;
|
|
142
|
+
} else
|
|
143
|
+
this.current = B(this.current, this.target, this.damping, p);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
n = new WeakMap(), A = new WeakMap(), m = new WeakMap(), u = new WeakMap(), l = new WeakMap(), x = new WeakMap(), b = new WeakMap();
|
|
147
|
+
export {
|
|
148
|
+
E as A,
|
|
149
|
+
U as D
|
|
150
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var P=(h,n,e)=>{if(!n.has(h))throw TypeError("Cannot "+e)};var t=(h,n,e)=>(P(h,n,"read from private field"),e?e.call(h):n.get(h)),r=(h,n,e)=>{if(n.has(h))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(h):n.set(h,e)},i=(h,n,e,a)=>(P(h,n,"write to private field"),a?a.call(h,e):n.set(h,e),e);const f=require("./browser-CpzFX2xg.cjs"),A=require("./dom-JBOkFLTh.cjs"),T=require("./gestures-DHLrn6Q8.cjs"),W=require("./number-yVpzMdbQ.cjs"),X=require("./notifier/index.cjs"),B=require("./ticker/index.cjs"),Y=require("./order/index.cjs");var q;class v{constructor(){r(this,q,new X.Notifier)}get changeEvent(){return t(this,q)}}q=new WeakMap;var u,l,c,L;class K extends v{constructor(e){super();r(this,u,null);r(this,l,null);r(this,c,"offsetHeight");r(this,L,e=>{const a=e.shiftKey?-1:1;let s;e.code==="Space"?s=a*t(this,l)[t(this,c)]*.4:e.code==="ArrowLeft"?s=-1*t(this,l)[t(this,c)]*.2:e.code==="ArrowRight"?s=1*t(this,l)[t(this,c)]*.2:e.code==="ArrowUp"?s=-1*t(this,l)[t(this,c)]*.2:e.code==="ArrowDown"?s=1*t(this,l)[t(this,c)]*.2:e.code==="PageUp"?s=-1*t(this,l)[t(this,c)]:e.code==="PageDown"?s=1*t(this,l)[t(this,c)]:e.code==="Home"?s=0:e.code==="End"&&(s=t(this,c)==="offsetWidth"?t(this,l).scrollWidth:t(this,l).scrollHeight),s&&(e.stopPropagation(),this.changeEvent.notify("keyboard",s))});f.isBrowser&&(i(this,u,e!=null&&e.element&&A.getElement(e.element)||window),i(this,l,t(this,u)instanceof HTMLElement?t(this,u):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,c,e==="width"?"offsetWidth":"offsetHeight")}connect(){f.isBrowser&&t(this,u).addEventListener("keydown",t(this,L))}disconnect(){f.isBrowser&&t(this,u).removeEventListener("keydown",t(this,L))}}u=new WeakMap,l=new WeakMap,c=new WeakMap,L=new WeakMap;var g,o,E,M;class R extends v{constructor(e){super();r(this,g,null);r(this,o,void 0);r(this,E,void 0);r(this,M,e=>{let a=0;if(!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)))if(a=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),e.preventDefault(),this.debounce){const s=Date.now();if(s-t(this,E)>40&&(a=100*Math.sign(a)),i(this,E,s),Math.abs(a)<100||t(this,o))return;this.changeEvent.notify("wheel",a),i(this,o,setTimeout(()=>{i(this,o,void 0)},80))}else this.changeEvent.notify("wheel",a)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,E,Date.now()),f.isBrowser&&i(this,g,e!=null&&e.element&&A.getElement(e.element)||window)}connect(){f.isBrowser&&t(this,g).addEventListener("wheel",t(this,M),{passive:!1})}disconnect(){f.isBrowser&&(t(this,g).removeEventListener("wheel",t(this,M)),clearTimeout(t(this,o)))}}g=new WeakMap,o=new WeakMap,E=new WeakMap,M=new WeakMap;var b,w,y,d,k,x;const m=class m extends v{constructor(e){super();r(this,w,null);r(this,y,!1);r(this,d,0);r(this,k,e=>{if(e.composedPath().find(s=>s instanceof HTMLElement&&s.hasAttribute("drag-dead-zone")))return;this.swipe||B.ticker.unsubscribe(t(this,x));let a=e;i(this,d,0),T.setupDrag(s=>{if(t(this,y)||t(m,b)&&t(m,b)!==t(this,w))return;this.swipe&&i(this,y,!0);const C=a.x-s.x,D=a.y-s.y;this.axis==="x"?i(this,d,C):i(this,d,D),a=s,this.changeEvent.notify("drag",t(this,d)),(this.axis==="x"&&Math.abs(C)>Math.abs(D)||this.axis==="y"&&Math.abs(C)<Math.abs(D))&&i(m,b,t(this,w))},()=>{i(m,b,null),this.swipe||(i(this,d,t(this,d)*3),B.ticker.subscribe(t(this,x),{order:Y.TICK_ORDER.SCROLL-1})),i(this,y,!1)})});r(this,x,()=>{t(this,d)||B.ticker.unsubscribe(t(this,x)),i(this,d,t(this,d)*.95),i(this,d,W.preciseNumber(t(this,d),3)),this.changeEvent.notify("drag",t(this,d))});this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,f.isBrowser&&i(this,w,e!=null&&e.element&&A.getElement(e.element)||document.documentElement)}connect(){f.isBrowser&&t(this,w).addEventListener("pointerdown",t(this,k))}disconnect(){f.isBrowser&&(t(this,w).removeEventListener("pointerdown",t(this,k)),B.ticker.unsubscribe(t(this,x)))}};b=new WeakMap,w=new WeakMap,y=new WeakMap,d=new WeakMap,k=new WeakMap,x=new WeakMap,r(m,b,null);let H=m;exports.Controls=v;exports.DragControls=H;exports.KeyboardControls=K;exports.WheelControls=R;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
var W = (h, r, e) => {
|
|
2
|
+
if (!r.has(h))
|
|
3
|
+
throw TypeError("Cannot " + e);
|
|
4
|
+
};
|
|
5
|
+
var t = (h, r, e) => (W(h, r, "read from private field"), e ? e.call(h) : r.get(h)), a = (h, r, e) => {
|
|
6
|
+
if (r.has(h))
|
|
7
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
+
r instanceof WeakSet ? r.add(h) : r.set(h, e);
|
|
9
|
+
}, i = (h, r, e, n) => (W(h, r, "write to private field"), n ? n.call(h, e) : r.set(h, e), e);
|
|
10
|
+
import { i as f } from "./browser-0zX67oeU.js";
|
|
11
|
+
import { g as P } from "./dom-0S_WDL4g.js";
|
|
12
|
+
import { s as Y } from "./gestures-D2Fdra_G.js";
|
|
13
|
+
import { p as C } from "./number-Bo5RdrA1.js";
|
|
14
|
+
import { Notifier as K } from "./notifier/index.js";
|
|
15
|
+
import { ticker as D } from "./ticker/index.js";
|
|
16
|
+
import { TICK_ORDER as R } from "./order/index.js";
|
|
17
|
+
var k;
|
|
18
|
+
class T {
|
|
19
|
+
constructor() {
|
|
20
|
+
a(this, k, new K());
|
|
21
|
+
}
|
|
22
|
+
get changeEvent() {
|
|
23
|
+
return t(this, k);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
k = new WeakMap();
|
|
27
|
+
var m, l, c, L;
|
|
28
|
+
class q extends T {
|
|
29
|
+
constructor(e) {
|
|
30
|
+
super();
|
|
31
|
+
a(this, m, null);
|
|
32
|
+
a(this, l, null);
|
|
33
|
+
a(this, c, "offsetHeight");
|
|
34
|
+
a(this, L, (e) => {
|
|
35
|
+
const n = e.shiftKey ? -1 : 1;
|
|
36
|
+
let s;
|
|
37
|
+
e.code === "Space" ? s = n * t(this, l)[t(this, c)] * 0.4 : e.code === "ArrowLeft" ? s = -1 * t(this, l)[t(this, c)] * 0.2 : e.code === "ArrowRight" ? s = 1 * t(this, l)[t(this, c)] * 0.2 : e.code === "ArrowUp" ? s = -1 * t(this, l)[t(this, c)] * 0.2 : e.code === "ArrowDown" ? s = 1 * t(this, l)[t(this, c)] * 0.2 : e.code === "PageUp" ? s = -1 * t(this, l)[t(this, c)] : e.code === "PageDown" ? s = 1 * t(this, l)[t(this, c)] : e.code === "Home" ? s = 0 : e.code === "End" && (s = t(this, c) === "offsetWidth" ? t(this, l).scrollWidth : t(this, l).scrollHeight), s && (e.stopPropagation(), this.changeEvent.notify("keyboard", s));
|
|
38
|
+
});
|
|
39
|
+
f && (i(this, m, e != null && e.element && P(e.element) || window), i(this, l, t(this, m) instanceof HTMLElement ? t(this, m) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
|
|
40
|
+
}
|
|
41
|
+
set dimension(e) {
|
|
42
|
+
i(this, c, e === "width" ? "offsetWidth" : "offsetHeight");
|
|
43
|
+
}
|
|
44
|
+
connect() {
|
|
45
|
+
f && t(this, m).addEventListener(
|
|
46
|
+
"keydown",
|
|
47
|
+
t(this, L)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
disconnect() {
|
|
51
|
+
f && t(this, m).removeEventListener(
|
|
52
|
+
"keydown",
|
|
53
|
+
t(this, L)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
m = new WeakMap(), l = new WeakMap(), c = new WeakMap(), L = new WeakMap();
|
|
58
|
+
var E, b, g, M;
|
|
59
|
+
class F extends T {
|
|
60
|
+
constructor(e) {
|
|
61
|
+
super();
|
|
62
|
+
a(this, E, null);
|
|
63
|
+
a(this, b, void 0);
|
|
64
|
+
a(this, g, void 0);
|
|
65
|
+
a(this, M, (e) => {
|
|
66
|
+
let n = 0;
|
|
67
|
+
if (!(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) || this.axis === "y" && Math.abs(e.deltaX) > Math.abs(e.deltaY)))
|
|
68
|
+
if (n = (this.axis === "max" ? Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), e.preventDefault(), this.debounce) {
|
|
69
|
+
const s = Date.now();
|
|
70
|
+
if (s - t(this, g) > 40 && (n = 100 * Math.sign(n)), i(this, g, s), Math.abs(n) < 100 || t(this, b))
|
|
71
|
+
return;
|
|
72
|
+
this.changeEvent.notify("wheel", n), i(this, b, setTimeout(() => {
|
|
73
|
+
i(this, b, void 0);
|
|
74
|
+
}, 80));
|
|
75
|
+
} else
|
|
76
|
+
this.changeEvent.notify("wheel", n);
|
|
77
|
+
});
|
|
78
|
+
this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, g, Date.now()), f && i(this, E, e != null && e.element && P(e.element) || window);
|
|
79
|
+
}
|
|
80
|
+
connect() {
|
|
81
|
+
f && t(this, E).addEventListener(
|
|
82
|
+
"wheel",
|
|
83
|
+
t(this, M),
|
|
84
|
+
{
|
|
85
|
+
passive: !1
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
disconnect() {
|
|
90
|
+
f && (t(this, E).removeEventListener(
|
|
91
|
+
"wheel",
|
|
92
|
+
t(this, M)
|
|
93
|
+
), clearTimeout(t(this, b)));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), M = new WeakMap();
|
|
97
|
+
var x, u, y, d, v, o;
|
|
98
|
+
const w = class w extends T {
|
|
99
|
+
constructor(e) {
|
|
100
|
+
super();
|
|
101
|
+
a(this, u, null);
|
|
102
|
+
a(this, y, !1);
|
|
103
|
+
a(this, d, 0);
|
|
104
|
+
a(this, v, (e) => {
|
|
105
|
+
if (e.composedPath().find(
|
|
106
|
+
(s) => s instanceof HTMLElement && s.hasAttribute("drag-dead-zone")
|
|
107
|
+
))
|
|
108
|
+
return;
|
|
109
|
+
this.swipe || D.unsubscribe(t(this, o));
|
|
110
|
+
let n = e;
|
|
111
|
+
i(this, d, 0), Y(
|
|
112
|
+
(s) => {
|
|
113
|
+
if (t(this, y) || t(w, x) && t(w, x) !== t(this, u))
|
|
114
|
+
return;
|
|
115
|
+
this.swipe && i(this, y, !0);
|
|
116
|
+
const H = n.x - s.x, A = n.y - s.y;
|
|
117
|
+
this.axis === "x" ? i(this, d, H) : i(this, d, A), n = s, this.changeEvent.notify("drag", t(this, d)), (this.axis === "x" && Math.abs(H) > Math.abs(A) || this.axis === "y" && Math.abs(H) < Math.abs(A)) && i(w, x, t(this, u));
|
|
118
|
+
},
|
|
119
|
+
() => {
|
|
120
|
+
i(w, x, null), this.swipe || (i(this, d, t(this, d) * 3), D.subscribe(t(this, o), { order: R.SCROLL - 1 })), i(this, y, !1);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
a(this, o, () => {
|
|
125
|
+
t(this, d) || D.unsubscribe(t(this, o)), i(this, d, t(this, d) * 0.95), i(this, d, C(t(this, d), 3)), this.changeEvent.notify("drag", t(this, d));
|
|
126
|
+
});
|
|
127
|
+
this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, f && i(this, u, e != null && e.element && P(e.element) || document.documentElement);
|
|
128
|
+
}
|
|
129
|
+
connect() {
|
|
130
|
+
f && t(this, u).addEventListener("pointerdown", t(this, v));
|
|
131
|
+
}
|
|
132
|
+
disconnect() {
|
|
133
|
+
f && (t(this, u).removeEventListener(
|
|
134
|
+
"pointerdown",
|
|
135
|
+
t(this, v)
|
|
136
|
+
), D.unsubscribe(t(this, o)));
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
x = new WeakMap(), u = new WeakMap(), y = new WeakMap(), d = new WeakMap(), v = new WeakMap(), o = new WeakMap(), a(w, x, null);
|
|
140
|
+
let X = w;
|
|
141
|
+
export {
|
|
142
|
+
T as C,
|
|
143
|
+
X as D,
|
|
144
|
+
q as K,
|
|
145
|
+
F as W
|
|
146
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TickerAddOptions, TickerCallbackEntry } from '../ticker';
|
|
2
|
+
import { Store, StoreEntry, StoreOptions } from '../store';
|
|
3
|
+
|
|
4
|
+
export interface AnimationEntry extends StoreEntry<number> {
|
|
5
|
+
length: number;
|
|
6
|
+
progress: number;
|
|
7
|
+
direction: number;
|
|
8
|
+
}
|
|
9
|
+
export interface AnimationOptions extends TickerAddOptions, StoreOptions<number> {
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class Animation<Options extends AnimationOptions, Entry extends StoreEntry<number> = StoreEntry<number>> extends Store<number, 'number', Entry> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(initial?: number, options?: Options);
|
|
14
|
+
get isRunning(): Store<boolean, keyof import('../store').StoreManagers, StoreEntry<boolean>>;
|
|
15
|
+
abstract set(value: number): void;
|
|
16
|
+
abstract shift(value: number): void;
|
|
17
|
+
reset(): void;
|
|
18
|
+
close(): void;
|
|
19
|
+
updateOptions(options?: Omit<Options, keyof StoreOptions<number>>): void;
|
|
20
|
+
listenAnimationFrame(): void;
|
|
21
|
+
unlistenAnimationFrame(): void;
|
|
22
|
+
protected abstract handleAnimationFrame(e: TickerCallbackEntry): void;
|
|
23
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Animation } from './Animation';
|
|
2
|
+
import { TickerAddOptions, TickerCallbackEntry } from '../ticker';
|
|
3
|
+
import { StoreEntry, StoreManagers, StoreOptions } from '../store';
|
|
3
4
|
|
|
4
5
|
export interface DampedOptions extends TickerAddOptions, StoreOptions<number> {
|
|
5
|
-
damping?: number;
|
|
6
6
|
min?: number;
|
|
7
7
|
max?: number;
|
|
8
|
+
stiffness?: number;
|
|
9
|
+
damping?: number;
|
|
10
|
+
mass?: number;
|
|
8
11
|
}
|
|
9
12
|
export interface DampedEntry extends StoreEntry<number> {
|
|
10
13
|
min: number;
|
|
@@ -12,28 +15,28 @@ export interface DampedEntry extends StoreEntry<number> {
|
|
|
12
15
|
length: number;
|
|
13
16
|
progress: number;
|
|
14
17
|
direction: number;
|
|
15
|
-
speed: number;
|
|
16
18
|
}
|
|
17
|
-
export declare class Damped extends
|
|
19
|
+
export declare class Damped extends Animation<DampedOptions, DampedEntry> {
|
|
18
20
|
#private;
|
|
21
|
+
damping: number;
|
|
22
|
+
stiffness: number;
|
|
23
|
+
mass: number;
|
|
19
24
|
constructor(initial?: number, options?: DampedOptions);
|
|
20
25
|
get target(): number;
|
|
21
|
-
get isRunning(): Store<boolean, keyof import('../store').StoreManagers, StoreEntry<boolean>>;
|
|
22
26
|
get direction(): number;
|
|
23
|
-
get maxFPS(): number | undefined;
|
|
24
|
-
get speed(): number;
|
|
25
27
|
get min(): number;
|
|
26
28
|
set min(value: number);
|
|
27
29
|
get max(): number;
|
|
28
30
|
set max(value: number);
|
|
31
|
+
get velocity(): number;
|
|
32
|
+
get speed(): number;
|
|
29
33
|
get length(): number;
|
|
30
34
|
get progress(): number;
|
|
31
|
-
get damping(): number;
|
|
32
|
-
set damping(value: number);
|
|
33
35
|
get entry(): DampedEntry;
|
|
34
36
|
set(value: number, equalize?: boolean): void;
|
|
35
37
|
shift(value: number, equalize?: boolean): void;
|
|
36
|
-
close(): void;
|
|
37
38
|
reset(): void;
|
|
38
|
-
|
|
39
|
+
listenAnimationFrame(): void;
|
|
40
|
+
updateOptions(options?: Omit<DampedOptions, keyof StoreOptions<number, keyof StoreManagers>> | undefined): void;
|
|
41
|
+
protected handleAnimationFrame(e: TickerCallbackEntry): void;
|
|
39
42
|
}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
+
import { Animation, AnimationOptions } from './Animation';
|
|
1
2
|
import { EasingFunction } from '../utils';
|
|
2
|
-
import { TickerAddOptions } from '../ticker';
|
|
3
|
-
import {
|
|
3
|
+
import { TickerAddOptions, TickerCallbackEntry } from '../ticker';
|
|
4
|
+
import { StoreEntry, StoreManagers, StoreOptions } from '../store';
|
|
4
5
|
|
|
5
|
-
export interface
|
|
6
|
+
export interface TweenedOptions extends AnimationOptions {
|
|
6
7
|
easing?: EasingFunction;
|
|
7
8
|
duration?: number;
|
|
8
9
|
}
|
|
9
|
-
export interface TweenedSetOptions extends
|
|
10
|
+
export interface TweenedSetOptions extends Omit<TweenedOptions, keyof StoreOptions<number>> {
|
|
10
11
|
restart?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export interface TweenedOptions extends TweenedAnimationOptions, StoreOptions<number> {
|
|
13
|
-
}
|
|
14
13
|
export interface TweenedEntry extends StoreEntry<number> {
|
|
15
14
|
length: number;
|
|
16
15
|
progress: number;
|
|
17
16
|
direction: number;
|
|
18
17
|
}
|
|
19
|
-
export declare class Tweened extends
|
|
18
|
+
export declare class Tweened extends Animation<TweenedOptions, TweenedEntry> {
|
|
20
19
|
#private;
|
|
21
|
-
constructor(initial?: number, options?: TweenedOptions);
|
|
22
|
-
get isRunning(): Store<boolean, keyof import('../store').StoreManagers, StoreEntry<boolean>>;
|
|
20
|
+
constructor(initial?: number, options?: TweenedOptions & TickerAddOptions & StoreOptions<number>);
|
|
23
21
|
get direction(): number;
|
|
24
22
|
get length(): number;
|
|
25
23
|
get progress(): number;
|
|
26
24
|
get entry(): TweenedEntry;
|
|
27
25
|
set(value: number, options?: TweenedSetOptions): void;
|
|
28
26
|
shift(value: number, options?: TweenedSetOptions): void;
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
updateOptions(options?: Omit<TweenedOptions, keyof StoreOptions<number, keyof StoreManagers>> | undefined): void;
|
|
28
|
+
protected handleAnimationFrame(e: TickerCallbackEntry): void;
|
|
31
29
|
}
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var F=Object.defineProperty,O=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=(i,e,t)=>e in i?F(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,f=(i,e)=>{for(var t in e||(e={}))D.call(e,t)&&d(i,t,e[t]);if(g)for(var t of g(e))w.call(e,t)&&d(i,t,e[t]);return i},p=(i,e)=>O(i,T(e));var o=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var r=(i,e,t)=>(o(i,e,"read from private field"),t?t.call(i):e.get(i)),u=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},l=(i,e,t,s)=>(o(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../Damped-BdnkNOcb.cjs"),C=require("../easings-DsS5-Kqc.cjs"),M=require("../math-GDWEqu7y.cjs"),A=require("../number-yVpzMdbQ.cjs"),b=require("../polyfills-CrcS4RcO.cjs");var c,h,n,a,m;class N extends q.Animation{constructor(t,s){super(t||0,s);u(this,c,C.linear);u(this,h,1e3);u(this,n,0);u(this,a,0);u(this,m,0)}get direction(){return r(this,m)}get length(){return r(this,a)-r(this,n)}get progress(){return this.length?A.preciseNumber((this.current-r(this,n))/this.length,6):0}get entry(){return p(f({},super.entry),{length:this.length,direction:this.direction,progress:this.progress})}set(t,s){s!=null&&s.restart&&(this.current=this.initial),l(this,n,this.current),l(this,a,t),l(this,m,Math.sign(this.length)),this.updateOptions(s),r(this,h)?(this.unlistenAnimationFrame(),this.listenAnimationFrame()):(this.current=r(this,a),this.unlistenAnimationFrame())}shift(t,s){this.set(this.current+t,s)}updateOptions(t){super.updateOptions(t),l(this,c,b.nullishCoalescing(t==null?void 0:t.easing,r(this,c))),l(this,h,b.nullishCoalescing(t==null?void 0:t.duration,r(this,h)))}handleAnimationFrame(t){const s=(t.timestamp-t.startTimestamp)/1e3/(r(this,h)/1e3),y=r(this,c).call(this,M.clamp(s,0,1));this.current=A.preciseNumber(r(this,n)+(r(this,a)-r(this,n))*y,6),s>1&&this.unlistenAnimationFrame()}}c=new WeakMap,h=new WeakMap,n=new WeakMap,a=new WeakMap,m=new WeakMap;exports.Damped=q.Damped;exports.Tweened=N;
|
package/lib/animation/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Damped, type DampedOptions, type DampedEntry } from './Damped';
|
|
2
|
-
export { Tweened, type
|
|
2
|
+
export { Tweened, type TweenedOptions, type TweenedSetOptions, type TweenedEntry, } from './Tweened';
|
package/lib/animation/index.js
CHANGED
|
@@ -1,98 +1,72 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var t in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
if (!
|
|
1
|
+
var O = Object.defineProperty, y = Object.defineProperties;
|
|
2
|
+
var D = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var g = Object.getOwnPropertySymbols;
|
|
4
|
+
var T = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var d = (e, i, t) => i in e ? O(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, f = (e, i) => {
|
|
6
|
+
for (var t in i || (i = {}))
|
|
7
|
+
T.call(i, t) && d(e, t, i[t]);
|
|
8
|
+
if (g)
|
|
9
|
+
for (var t of g(i))
|
|
10
|
+
b.call(i, t) && d(e, t, i[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, p = (e, i) => y(e, D(i));
|
|
13
|
+
var o = (e, i, t) => {
|
|
14
|
+
if (!i.has(e))
|
|
15
15
|
throw TypeError("Cannot " + t);
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
if (
|
|
17
|
+
var s = (e, i, t) => (o(e, i, "read from private field"), t ? t.call(e) : i.get(e)), m = (e, i, t) => {
|
|
18
|
+
if (i.has(e))
|
|
19
19
|
throw TypeError("Cannot add the same private member more than once");
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
import { D as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
h(this, d, void 0);
|
|
38
|
-
h(this, x, void 0);
|
|
39
|
-
h(this, F, void 0);
|
|
40
|
-
h(this, b, H);
|
|
41
|
-
h(this, l, 1e3);
|
|
42
|
-
h(this, a, new M(!1));
|
|
43
|
-
h(this, c, 0);
|
|
44
|
-
h(this, g, 0);
|
|
45
|
-
h(this, P, 0);
|
|
46
|
-
h(this, y, (t) => {
|
|
47
|
-
const s = (t.timestamp - t.startTimestamp) / 1e3 / (r(this, l) / 1e3), q = r(this, b).call(this, I(s, 0, 1));
|
|
48
|
-
this.current = N(r(this, c) + (r(this, g) - r(this, c)) * q, 6), s > 1 && u(this, m, f).call(this);
|
|
49
|
-
});
|
|
50
|
-
u(this, w, R).call(this, s);
|
|
51
|
-
}
|
|
52
|
-
get isRunning() {
|
|
53
|
-
return r(this, a);
|
|
20
|
+
i instanceof WeakSet ? i.add(e) : i.set(e, t);
|
|
21
|
+
}, u = (e, i, t, r) => (o(e, i, "write to private field"), r ? r.call(e, t) : i.set(e, t), t);
|
|
22
|
+
import { A as w } from "../Damped-Ceg1a3X8.js";
|
|
23
|
+
import { D as H } from "../Damped-Ceg1a3X8.js";
|
|
24
|
+
import { l as C } from "../easings-BKi40vHz.js";
|
|
25
|
+
import { c as M } from "../math-BOBiC4TN.js";
|
|
26
|
+
import { p as A } from "../number-Bo5RdrA1.js";
|
|
27
|
+
import { n as F } from "../polyfills-DJUYczFm.js";
|
|
28
|
+
var l, n, h, a, c;
|
|
29
|
+
class B extends w {
|
|
30
|
+
constructor(t, r) {
|
|
31
|
+
super(t || 0, r);
|
|
32
|
+
m(this, l, C);
|
|
33
|
+
m(this, n, 1e3);
|
|
34
|
+
m(this, h, 0);
|
|
35
|
+
m(this, a, 0);
|
|
36
|
+
m(this, c, 0);
|
|
54
37
|
}
|
|
55
38
|
get direction() {
|
|
56
|
-
return
|
|
39
|
+
return s(this, c);
|
|
57
40
|
}
|
|
58
41
|
get length() {
|
|
59
|
-
return
|
|
42
|
+
return s(this, a) - s(this, h);
|
|
60
43
|
}
|
|
61
44
|
get progress() {
|
|
62
|
-
return this.length ?
|
|
45
|
+
return this.length ? A((this.current - s(this, h)) / this.length, 6) : 0;
|
|
63
46
|
}
|
|
64
47
|
get entry() {
|
|
65
|
-
return
|
|
48
|
+
return p(f({}, super.entry), {
|
|
66
49
|
length: this.length,
|
|
67
50
|
direction: this.direction,
|
|
68
51
|
progress: this.progress
|
|
69
52
|
});
|
|
70
53
|
}
|
|
71
|
-
set(t,
|
|
72
|
-
|
|
54
|
+
set(t, r) {
|
|
55
|
+
r != null && r.restart && (this.current = this.initial), u(this, h, this.current), u(this, a, t), u(this, c, Math.sign(this.length)), this.updateOptions(r), s(this, n) ? (this.unlistenAnimationFrame(), this.listenAnimationFrame()) : (this.current = s(this, a), this.unlistenAnimationFrame());
|
|
73
56
|
}
|
|
74
|
-
shift(t,
|
|
75
|
-
this.set(this.current + t,
|
|
57
|
+
shift(t, r) {
|
|
58
|
+
this.set(this.current + t, r);
|
|
76
59
|
}
|
|
77
|
-
|
|
78
|
-
u(this,
|
|
60
|
+
updateOptions(t) {
|
|
61
|
+
super.updateOptions(t), u(this, l, F(t == null ? void 0 : t.easing, s(this, l))), u(this, n, F(t == null ? void 0 : t.duration, s(this, n)));
|
|
79
62
|
}
|
|
80
|
-
|
|
81
|
-
|
|
63
|
+
handleAnimationFrame(t) {
|
|
64
|
+
const r = (t.timestamp - t.startTimestamp) / 1e3 / (s(this, n) / 1e3), x = s(this, l).call(this, M(r, 0, 1));
|
|
65
|
+
this.current = A(s(this, h) + (s(this, a) - s(this, h)) * x, 6), r > 1 && this.unlistenAnimationFrame();
|
|
82
66
|
}
|
|
83
67
|
}
|
|
84
|
-
|
|
85
|
-
n(this, b, S(t == null ? void 0 : t.easing, r(this, b))), n(this, l, S(t == null ? void 0 : t.duration, r(this, l))), n(this, d, S(t == null ? void 0 : t.maxFPS, r(this, d))), n(this, x, S(t == null ? void 0 : t.order, r(this, x))), n(this, F, S(t == null ? void 0 : t.culling, r(this, F)));
|
|
86
|
-
}, A = new WeakSet(), j = function() {
|
|
87
|
-
r(this, a).current || (r(this, a).current = !0, O.subscribe(r(this, y), {
|
|
88
|
-
maxFPS: r(this, d),
|
|
89
|
-
order: r(this, x),
|
|
90
|
-
culling: r(this, F)
|
|
91
|
-
}));
|
|
92
|
-
}, m = new WeakSet(), f = function() {
|
|
93
|
-
r(this, a).current && (r(this, a).current = !1, O.unsubscribe(r(this, y)));
|
|
94
|
-
}, y = new WeakMap();
|
|
68
|
+
l = new WeakMap(), n = new WeakMap(), h = new WeakMap(), a = new WeakMap(), c = new WeakMap();
|
|
95
69
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
70
|
+
H as Damped,
|
|
71
|
+
B as Tweened
|
|
98
72
|
};
|
package/lib/canvas/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../custom-element/index.cjs");require("../Store-C-1ruEIm.cjs");const S=require("../math-GDWEqu7y.cjs"),E=require("../tags-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../custom-element/index.cjs");require("../Store-C-1ruEIm.cjs");const S=require("../math-GDWEqu7y.cjs"),E=require("../tags-Djb6mb1o.cjs"),b=require("../createStylesheet-CqHU9_qv.cjs"),k=require("../element-resizer/index.cjs"),C=require("../ticker/index.cjs");var y=Object.defineProperty,q=Object.getOwnPropertyDescriptor,P=(i,e,s,h)=>{for(var r=h>1?void 0:h?q(e,s):e,f=i.length-1,g;f>=0;f--)(g=i[f])&&(r=(h?g(e,s,r):g(r))||r);return h&&r&&y(e,s,r),r},R=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(R(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},c=(i,e,s,h)=>(R(i,e,"write to private field"),h?h.call(i,s):e.set(i,s),s),M=(i,e,s)=>(R(i,e,"access private method"),s),n,p,l,o,d,u,v,_,m,w,x;const O=b.createStylesheet({":host, canvas":{display:"block",width:"100%",height:"100%"}});exports.CanvasElement=class extends W.CustomElement{constructor(){super(),a(this,w),a(this,n,null),a(this,p,null),a(this,l,0),a(this,o,0),a(this,d,1),a(this,u,0),a(this,v,1),a(this,_,e=>{c(this,d,S.clamp(devicePixelRatio,1,2)),c(this,l,e.contentRect.width),c(this,o,e.contentRect.height),t(this,n).width=t(this,l)*this.pixelRatio,t(this,n).height=t(this,o)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),M(this,w,x).call(this)}),a(this,m,e=>{c(this,u,e.timestamp),c(this,v,e.elapsed),M(this,w,x).call(this)}),this.openShadow(O),E.element(this,{children:E.canvas({ref:e=>{c(this,n,e),c(this,p,e.getContext("2d"))}})})}get canvasElement(){return t(this,n)}get context(){return t(this,p)}get pixelRatio(){return t(this,d)}get width(){return t(this,l)}get height(){return t(this,o)}get detail(){return{width:t(this,l),height:t(this,o),element:this,canvasElement:t(this,n),pixelRatio:t(this,d),context:t(this,p),timestamp:t(this,u),elapsed:t(this,v)}}connectedCallback(){k.elementResizer.subscribe(this,t(this,_)),this.hasAttribute("static")||C.ticker.subscribe(t(this,m),{culling:this,maxFPS:this.hasAttribute("fps")?parseInt(this.getAttribute("fps")):void 0})}disconnectedCallback(){k.elementResizer.unsubscribe(t(this,_)),C.ticker.unsubscribe(t(this,m)),t(this,n).remove()}};n=new WeakMap;p=new WeakMap;l=new WeakMap;o=new WeakMap;d=new WeakMap;u=new WeakMap;v=new WeakMap;_=new WeakMap;m=new WeakMap;w=new WeakSet;x=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))};exports.CanvasElement=P([W.define("e-canvas")],exports.CanvasElement);
|
package/lib/canvas/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CustomElement as M, define as b } from "../custom-element/index.js";
|
|
2
2
|
import "../Store-BQXXikps.js";
|
|
3
3
|
import { c as P } from "../math-BOBiC4TN.js";
|
|
4
|
-
import { e as S, q as y } from "../tags-
|
|
5
|
-
import { c as A } from "../createStylesheet-
|
|
4
|
+
import { e as S, q as y } from "../tags-CMPg9ETZ.js";
|
|
5
|
+
import { c as A } from "../createStylesheet-DBCEbDjI.js";
|
|
6
6
|
import { elementResizer as k } from "../element-resizer/index.js";
|
|
7
7
|
import { ticker as E } from "../ticker/index.js";
|
|
8
8
|
var O = Object.defineProperty, z = Object.getOwnPropertyDescriptor, D = (t, i, s, r) => {
|