aptechka 0.4.30 → 0.4.32
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-BJgyFENo.js +258 -0
- package/lib/Damped-CbWlWAbx.cjs +1 -0
- package/lib/animation/Animation.d.ts +42 -7
- package/lib/animation/AnimationLink.d.ts +13 -0
- package/lib/animation/Damped.d.ts +23 -28
- package/lib/animation/Tweened.d.ts +7 -19
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.d.ts +2 -1
- package/lib/animation/index.js +43 -61
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +35 -35
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.d.ts +3 -1
- package/lib/class-linked-status/index.js +36 -37
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +64 -64
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +5 -1
- package/lib/css-property/index.js +35 -31
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.d.ts +1 -1
- package/lib/en3/index.js +264 -277
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +8 -8
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.d.ts +12 -6
- package/lib/ladder/index.js +119 -114
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +4 -3
- package/lib/order/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +2 -2
- package/lib/scroll/ScrollElement.d.ts +1 -3
- package/lib/scroll/ScrollSegmentElement.d.ts +6 -11
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.d.ts +1 -1
- package/lib/scroll/index.js +497 -500
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.d.ts +4 -2
- package/lib/sequence/index.js +129 -114
- package/lib/source/SourceElement.d.ts +14 -7
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.d.ts +2 -2
- package/lib/source/index.js +66 -56
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.d.ts +15 -0
- package/lib/theme/index.js +9 -6
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.d.ts +3 -2
- package/lib/ticker/index.js +81 -71
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +10 -10
- package/package.json +5 -5
- package/lib/Damped-B0G_t-pw.cjs +0 -1
- package/lib/Damped-DpaKIZqv.js +0 -150
- package/lib/en3/instances/en3LazyLoader.d.ts +0 -8
package/lib/canvas/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CSSProperty as
|
|
2
|
-
import { CustomElement as
|
|
1
|
+
import { CSSProperty as F } from "../css-property/index.js";
|
|
2
|
+
import { CustomElement as O, define as B } from "../custom-element/index.js";
|
|
3
3
|
import "../Store-Cd-E5W1z.js";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as z } from "../math-BOBiC4TN.js";
|
|
5
5
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
6
|
-
import { e as
|
|
7
|
-
import { c as
|
|
6
|
+
import { e as A, q as D } from "../tags-BoPv9fDr.js";
|
|
7
|
+
import { c as L } from "../createStylesheet-KMRQhSa-.js";
|
|
8
8
|
import { elementResizer as b } from "../element-resizer/index.js";
|
|
9
9
|
import { ticker as S } from "../ticker/index.js";
|
|
10
|
-
var
|
|
11
|
-
for (var r = h > 1 ? void 0 : h ?
|
|
10
|
+
var T = Object.defineProperty, q = Object.getOwnPropertyDescriptor, G = (t, i, s, h) => {
|
|
11
|
+
for (var r = h > 1 ? void 0 : h ? q(i, s) : i, k = t.length - 1, R; k >= 0; k--)
|
|
12
12
|
(R = t[k]) && (r = (h ? R(i, s, r) : R(r)) || r);
|
|
13
|
-
return h && r &&
|
|
13
|
+
return h && r && T(i, s, r), r;
|
|
14
14
|
}, M = (t, i, s) => {
|
|
15
15
|
if (!i.has(t))
|
|
16
16
|
throw TypeError("Cannot " + s);
|
|
@@ -18,28 +18,28 @@ var F = Object.defineProperty, G = Object.getOwnPropertyDescriptor, B = (t, i, s
|
|
|
18
18
|
if (i.has(t))
|
|
19
19
|
throw TypeError("Cannot add the same private member more than once");
|
|
20
20
|
i instanceof WeakSet ? i.add(t) : i.set(t, s);
|
|
21
|
-
}, n = (t, i, s, h) => (M(t, i, "write to private field"), h ? h.call(t, s) : i.set(t, s), s),
|
|
22
|
-
const H =
|
|
21
|
+
}, n = (t, i, s, h) => (M(t, i, "write to private field"), h ? h.call(t, s) : i.set(t, s), s), u = (t, i, s) => (M(t, i, "access private method"), s), o, c, d, p, l, m, f, _, w, W, C, P, x, v, g, E;
|
|
22
|
+
const H = L({
|
|
23
23
|
":host, canvas": {
|
|
24
24
|
display: "block",
|
|
25
25
|
width: "100%",
|
|
26
26
|
height: "100%"
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
let y = class extends
|
|
29
|
+
let y = class extends O {
|
|
30
30
|
constructor() {
|
|
31
|
-
super(), a(this, w), a(this, C), a(this, g), a(this, o, new
|
|
32
|
-
n(this,
|
|
33
|
-
}), a(this,
|
|
34
|
-
n(this,
|
|
35
|
-
}), this.openShadow(H),
|
|
36
|
-
children:
|
|
31
|
+
super(), a(this, w), a(this, C), a(this, g), a(this, o, new F(this, "--fps", 0)), a(this, c, null), a(this, d, null), a(this, p, 0), a(this, l, 0), a(this, m, 1), a(this, f, 0), a(this, _, 1), a(this, x, (t) => {
|
|
32
|
+
n(this, m, z(devicePixelRatio, 1, 2)), n(this, p, t.contentRect.width), n(this, l, t.contentRect.height), e(this, c).width = e(this, p) * this.pixelRatio, e(this, c).height = e(this, l) * this.pixelRatio, this.context.scale(this.pixelRatio, this.pixelRatio), u(this, g, E).call(this);
|
|
33
|
+
}), a(this, v, (t) => {
|
|
34
|
+
n(this, f, t.timestamp), n(this, _, t.timeBetweenFrames), u(this, g, E).call(this);
|
|
35
|
+
}), this.openShadow(H), A(this, {
|
|
36
|
+
children: D({
|
|
37
37
|
ref: (t) => {
|
|
38
|
-
n(this, c, t), n(this,
|
|
38
|
+
n(this, c, t), n(this, d, t.getContext("2d"));
|
|
39
39
|
}
|
|
40
40
|
})
|
|
41
41
|
}), e(this, o).subscribe((t) => {
|
|
42
|
-
typeof t.previous != "undefined" && t.current !== t.previous &&
|
|
42
|
+
typeof t.previous != "undefined" && t.current !== t.previous && u(this, w, W).call(this);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
get fpsCSSProperty() {
|
|
@@ -49,10 +49,10 @@ let y = class extends z {
|
|
|
49
49
|
return e(this, c);
|
|
50
50
|
}
|
|
51
51
|
get context() {
|
|
52
|
-
return e(this,
|
|
52
|
+
return e(this, d);
|
|
53
53
|
}
|
|
54
54
|
get pixelRatio() {
|
|
55
|
-
return e(this,
|
|
55
|
+
return e(this, m);
|
|
56
56
|
}
|
|
57
57
|
get width() {
|
|
58
58
|
return e(this, p);
|
|
@@ -66,40 +66,40 @@ let y = class extends z {
|
|
|
66
66
|
height: e(this, l),
|
|
67
67
|
element: this,
|
|
68
68
|
canvasElement: e(this, c),
|
|
69
|
-
pixelRatio: e(this,
|
|
70
|
-
context: e(this,
|
|
71
|
-
timestamp: e(this,
|
|
72
|
-
|
|
69
|
+
pixelRatio: e(this, m),
|
|
70
|
+
context: e(this, d),
|
|
71
|
+
timestamp: e(this, f),
|
|
72
|
+
timeBetweenFrames: e(this, _)
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
connectedCallback() {
|
|
76
|
-
e(this, o).observe(), b.subscribe(this, e(this, x)),
|
|
76
|
+
e(this, o).observe(), b.subscribe(this, e(this, x)), u(this, w, W).call(this);
|
|
77
77
|
}
|
|
78
78
|
disconnectedCallback() {
|
|
79
|
-
e(this, o).unobserve(), b.unsubscribe(e(this, x)),
|
|
79
|
+
e(this, o).unobserve(), b.unsubscribe(e(this, x)), u(this, C, P).call(this);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
o = /* @__PURE__ */ new WeakMap();
|
|
83
83
|
c = /* @__PURE__ */ new WeakMap();
|
|
84
|
-
|
|
84
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
85
85
|
p = /* @__PURE__ */ new WeakMap();
|
|
86
86
|
l = /* @__PURE__ */ new WeakMap();
|
|
87
|
-
v = /* @__PURE__ */ new WeakMap();
|
|
88
|
-
_ = /* @__PURE__ */ new WeakMap();
|
|
89
87
|
m = /* @__PURE__ */ new WeakMap();
|
|
88
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
89
|
+
_ = /* @__PURE__ */ new WeakMap();
|
|
90
90
|
w = /* @__PURE__ */ new WeakSet();
|
|
91
91
|
W = function() {
|
|
92
|
-
S.unsubscribe(e(this,
|
|
92
|
+
S.unsubscribe(e(this, v)), this.hasAttribute("static") || S.subscribe(e(this, v), {
|
|
93
93
|
culling: this,
|
|
94
94
|
maxFPS: e(this, o).current
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
C = /* @__PURE__ */ new WeakSet();
|
|
98
98
|
P = function() {
|
|
99
|
-
S.unsubscribe(e(this,
|
|
99
|
+
S.unsubscribe(e(this, v));
|
|
100
100
|
};
|
|
101
101
|
x = /* @__PURE__ */ new WeakMap();
|
|
102
|
-
|
|
102
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
103
103
|
g = /* @__PURE__ */ new WeakSet();
|
|
104
104
|
E = function() {
|
|
105
105
|
this.dispatchEvent(
|
|
@@ -109,8 +109,8 @@ E = function() {
|
|
|
109
109
|
})
|
|
110
110
|
);
|
|
111
111
|
};
|
|
112
|
-
y =
|
|
113
|
-
|
|
112
|
+
y = G([
|
|
113
|
+
B("e-canvas")
|
|
114
114
|
], y);
|
|
115
115
|
export {
|
|
116
116
|
y as CanvasElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var S=Object.defineProperty,m=Object.defineProperties;var f=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var a=(s,t,e)=>t in s?S(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,c=(s,t)=>{for(var e in t||(t={}))L.call(t,e)&&a(s,e,t[e]);if(u)for(var e of u(t))T.call(t,e)&&a(s,e,t[e]);return s},l=(s,t)=>m(s,f(t));var o=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var n=(s,t,e)=>(o(s,t,"read from private field"),e?e.call(s):t.get(s)),h=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},d=(s,t,e,r)=>(o(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../Store-BQGNOHlY.cjs"),b=require("../string-DhgS_iFl.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var i;class p extends g.Store{constructor(e,r){super(r);h(this,i,void 0);d(this,i,e)}isTrue(e){return this.current[e]===!0}isFalse(e){return this.current[e]===!1}reset(){super.reset();for(const e in this.initial)this.set(e,this.initial[e])}set(e,r=!0){this.current=l(c({},this.current),{[e]:r}),r?n(this,i).classList.add(b.camelToKebab(e)):n(this,i).classList.remove(b.camelToKebab(e))}}i=new WeakMap;exports.ClassLinkedStatus=p;
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var f = Object.defineProperty, d = Object.defineProperties;
|
|
2
|
+
var L = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var a = Object.getOwnPropertySymbols;
|
|
4
|
+
var S = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var o = (e, s, t) => s in e ? f(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t, c = (e, s) => {
|
|
5
6
|
for (var t in s || (s = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var t of
|
|
9
|
-
b.call(s, t) &&
|
|
10
|
-
return
|
|
11
|
-
};
|
|
12
|
-
var
|
|
13
|
-
if (!s.has(
|
|
7
|
+
S.call(s, t) && o(e, t, s[t]);
|
|
8
|
+
if (a)
|
|
9
|
+
for (var t of a(s))
|
|
10
|
+
b.call(s, t) && o(e, t, s[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, u = (e, s) => d(e, L(s));
|
|
13
|
+
var h = (e, s, t) => {
|
|
14
|
+
if (!s.has(e))
|
|
14
15
|
throw TypeError("Cannot " + t);
|
|
15
16
|
};
|
|
16
|
-
var
|
|
17
|
-
if (s.has(
|
|
17
|
+
var n = (e, s, t) => (h(e, s, "read from private field"), t ? t.call(e) : s.get(e)), l = (e, s, t) => {
|
|
18
|
+
if (s.has(e))
|
|
18
19
|
throw TypeError("Cannot add the same private member more than once");
|
|
19
|
-
s instanceof WeakSet ? s.add(
|
|
20
|
-
},
|
|
21
|
-
import {
|
|
20
|
+
s instanceof WeakSet ? s.add(e) : s.set(e, t);
|
|
21
|
+
}, m = (e, s, t, r) => (h(e, s, "write to private field"), r ? r.call(e, t) : s.set(e, t), t);
|
|
22
|
+
import { S as x } from "../Store-Cd-E5W1z.js";
|
|
23
|
+
import { c as p } from "../string-f0Dnk0L1.js";
|
|
22
24
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
23
|
-
var
|
|
24
|
-
class
|
|
25
|
-
constructor(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
l(this, a, s), l(this, r, t), l(this, h, u({}, t));
|
|
25
|
+
var i;
|
|
26
|
+
class g extends x {
|
|
27
|
+
constructor(t, r) {
|
|
28
|
+
super(r);
|
|
29
|
+
l(this, i, void 0);
|
|
30
|
+
m(this, i, t);
|
|
30
31
|
}
|
|
31
|
-
isTrue(
|
|
32
|
-
return
|
|
32
|
+
isTrue(t) {
|
|
33
|
+
return this.current[t] === !0;
|
|
33
34
|
}
|
|
34
|
-
isFalse(
|
|
35
|
-
return
|
|
35
|
+
isFalse(t) {
|
|
36
|
+
return this.current[t] === !1;
|
|
36
37
|
}
|
|
37
38
|
reset() {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
e(this, h)[s]
|
|
42
|
-
);
|
|
39
|
+
super.reset();
|
|
40
|
+
for (const t in this.initial)
|
|
41
|
+
this.set(t, this.initial[t]);
|
|
43
42
|
}
|
|
44
|
-
set(
|
|
45
|
-
|
|
43
|
+
set(t, r = !0) {
|
|
44
|
+
this.current = u(c({}, this.current), { [t]: r }), r ? n(this, i).classList.add(p(t)) : n(this, i).classList.remove(p(t));
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
|
|
47
|
+
i = new WeakMap();
|
|
49
48
|
export {
|
|
50
|
-
|
|
49
|
+
g as ClassLinkedStatus
|
|
51
50
|
};
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var S=(r,a,e)=>{if(!a.has(r))throw TypeError("Cannot "+e)};var t=(r,a,e)=>(S(r,a,"read from private field"),e?e.call(r):a.get(r)),i=(r,a,e)=>{if(a.has(r))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(r):a.set(r,e)},s=(r,a,e,n)=>(S(r,a,"write to private field"),n?n.call(r,e):a.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../notifier/index.cjs"),f=require("../browser-CpzFX2xg.cjs"),R=require("../dom-JBOkFLTh.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const x=require("../ticker/index.cjs"),
|
|
1
|
+
"use strict";var S=(r,a,e)=>{if(!a.has(r))throw TypeError("Cannot "+e)};var t=(r,a,e)=>(S(r,a,"read from private field"),e?e.call(r):a.get(r)),i=(r,a,e)=>{if(a.has(r))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(r):a.set(r,e)},s=(r,a,e,n)=>(S(r,a,"write to private field"),n?n.call(r,e):a.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../notifier/index.cjs"),f=require("../browser-CpzFX2xg.cjs"),R=require("../dom-JBOkFLTh.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const x=require("../ticker/index.cjs"),F=require("../gestures-DHLrn6Q8.cjs"),N=require("../number-yVpzMdbQ.cjs"),U=require("../order/index.cjs");var W;class P{constructor(){i(this,W,new O.Notifier)}get changeEvent(){return t(this,W)}}W=new WeakMap;var m,c,d,q;class j extends P{constructor(e){super();i(this,m,null);i(this,c,null);i(this,d,"offsetHeight");i(this,q,e=>{const n=e.shiftKey?-1:1;let h;e.code==="Space"?h=n*t(this,c)[t(this,d)]*.4:e.code==="ArrowLeft"?h=-1*t(this,c)[t(this,d)]*.2:e.code==="ArrowRight"?h=1*t(this,c)[t(this,d)]*.2:e.code==="ArrowUp"?h=-1*t(this,c)[t(this,d)]*.2:e.code==="ArrowDown"?h=1*t(this,c)[t(this,d)]*.2:e.code==="PageUp"?h=-1*t(this,c)[t(this,d)]:e.code==="PageDown"?h=1*t(this,c)[t(this,d)]:e.code==="Home"?h=0:e.code==="End"&&(h=t(this,d)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),h&&(e.stopPropagation(),this.changeEvent.notify("keyboard",h))});f.isBrowser&&(s(this,m,e!=null&&e.element&&R.getElement(e.element)||window),s(this,c,t(this,m)instanceof HTMLElement?t(this,m):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){s(this,d,e==="width"?"offsetWidth":"offsetHeight")}connect(){f.isBrowser&&t(this,m).addEventListener("keydown",t(this,q))}disconnect(){f.isBrowser&&t(this,m).removeEventListener("keydown",t(this,q))}}m=new WeakMap,c=new WeakMap,d=new WeakMap,q=new WeakMap;var o,v,A,I,u,M,L,T;class z extends P{constructor(e){super();i(this,o,void 0);i(this,v,void 0);i(this,A,void 0);i(this,I,void 0);i(this,u,void 0);i(this,M,void 0);i(this,L,void 0);i(this,T,void 0);this.direction=1,s(this,u,!1),s(this,L,n=>{t(this,u)||this.changeEvent.notify("autoplay",n.timeBetweenFrames*t(this,o)*this.direction)}),s(this,T,()=>{t(this,u)||this.changeEvent.notify("autoplay",Math.sign(t(this,o))*this.direction)}),s(this,o,(e==null?void 0:e.speed)||1),s(this,v,(e==null?void 0:e.interval)||!1),s(this,A,e)}set interval(e){s(this,v,e),this.connect()}set speed(e){s(this,o,e),this.connect()}connect(){this.disconnect(),t(this,v)?s(this,I,setInterval(t(this,T),Math.abs(t(this,o)))):x.ticker.subscribe(t(this,L),t(this,A))}disconnect(){clearInterval(t(this,I)),x.ticker.unsubscribe(t(this,L)),clearInterval(t(this,M)),s(this,u,!1)}pauseAndContinue(e){e&&!t(this,u)&&(clearInterval(t(this,M)),s(this,u,!0),s(this,M,setTimeout(()=>{s(this,u,!1)},3e3)))}}o=new WeakMap,v=new WeakMap,A=new WeakMap,I=new WeakMap,u=new WeakMap,M=new WeakMap,L=new WeakMap,T=new WeakMap;var k,g,C,D;class G extends P{constructor(e){super();i(this,k,null);i(this,g,void 0);i(this,C,void 0);i(this,D,e=>{let n=0;if(e.preventDefault(),!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*.5||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*.5))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(),this.debounce){const h=Date.now();if(h-t(this,C)>40&&(n=100*Math.sign(n)),s(this,C,h),Math.abs(n)<100||t(this,g))return;this.changeEvent.notify("wheel",n),s(this,g,setTimeout(()=>{s(this,g,void 0)},80))}else this.changeEvent.notify("wheel",n)});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,s(this,C,Date.now()),f.isBrowser&&s(this,k,e!=null&&e.element&&R.getElement(e.element)||window)}connect(){f.isBrowser&&t(this,k).addEventListener("wheel",t(this,D),{passive:!1})}disconnect(){f.isBrowser&&(t(this,k).removeEventListener("wheel",t(this,D)),clearTimeout(t(this,g)))}}k=new WeakMap,g=new WeakMap,C=new WeakMap,D=new WeakMap;var y,w,B,l,H,E;const b=class b extends P{constructor(e){super();i(this,w,null);i(this,B,!1);i(this,l,0);i(this,H,e=>{if(e.composedPath().find(h=>h instanceof HTMLElement&&h.hasAttribute("drag-dead-zone")))return;this.swipe||x.ticker.unsubscribe(t(this,E));let n=e;s(this,l,0),document.documentElement.classList.add("grabbing"),F.setupDrag(h=>{if(t(this,B)||t(b,y)&&t(b,y)!==t(this,w))return;this.swipe&&s(this,B,!0);const X=n.x-h.x,Y=n.y-h.y;this.axis==="x"?s(this,l,X):s(this,l,Y),n=h,(this.axis==="x"&&Math.abs(X)>Math.abs(Y)||this.axis==="y"&&Math.abs(Y)>Math.abs(X))&&(s(b,y,t(this,w)),this.changeEvent.notify("drag",t(this,l)))},()=>{s(b,y,null),this.swipe||(s(this,l,t(this,l)*3),x.ticker.subscribe(t(this,E),{order:U.TICK_ORDER.SCROLL-1})),document.documentElement.classList.remove("grabbing"),s(this,B,!1)})});i(this,E,()=>{Math.floor(t(this,l))||x.ticker.unsubscribe(t(this,E)),s(this,l,t(this,l)*.95),s(this,l,N.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l))});this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,f.isBrowser&&s(this,w,e!=null&&e.element&&R.getElement(e.element)||document.documentElement)}connect(){f.isBrowser&&t(this,w).addEventListener("pointerdown",t(this,H))}disconnect(){f.isBrowser&&(t(this,w).removeEventListener("pointerdown",t(this,H)),x.ticker.unsubscribe(t(this,E)))}};y=new WeakMap,w=new WeakMap,B=new WeakMap,l=new WeakMap,H=new WeakMap,E=new WeakMap,i(b,y,null);let K=b;exports.AutoplayControls=z;exports.Controls=P;exports.DragControls=K;exports.KeyboardControls=j;exports.WheelControls=G;
|
package/lib/controls/index.js
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
var
|
|
1
|
+
var F = (a, r, e) => {
|
|
2
2
|
if (!r.has(a))
|
|
3
3
|
throw TypeError("Cannot " + e);
|
|
4
4
|
};
|
|
5
|
-
var t = (a, r, e) => (
|
|
5
|
+
var t = (a, r, e) => (F(a, r, "read from private field"), e ? e.call(a) : r.get(a)), s = (a, r, e) => {
|
|
6
6
|
if (r.has(a))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
r instanceof WeakSet ? r.add(a) : r.set(a, e);
|
|
9
|
-
},
|
|
10
|
-
import { Notifier as
|
|
11
|
-
import { i as
|
|
12
|
-
import { g as
|
|
9
|
+
}, i = (a, r, e, n) => (F(a, r, "write to private field"), n ? n.call(a, e) : r.set(a, e), e);
|
|
10
|
+
import { Notifier as O } from "../notifier/index.js";
|
|
11
|
+
import { i as m } from "../browser-0zX67oeU.js";
|
|
12
|
+
import { g as B } from "../dom-0S_WDL4g.js";
|
|
13
13
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
14
14
|
import { ticker as y } from "../ticker/index.js";
|
|
15
|
-
import { s as
|
|
16
|
-
import { p as
|
|
17
|
-
import { TICK_ORDER as
|
|
15
|
+
import { s as S } from "../gestures-D2Fdra_G.js";
|
|
16
|
+
import { p as U } from "../number-Bo5RdrA1.js";
|
|
17
|
+
import { TICK_ORDER as z } from "../order/index.js";
|
|
18
18
|
var Y;
|
|
19
19
|
class R {
|
|
20
20
|
constructor() {
|
|
21
|
-
|
|
21
|
+
s(this, Y, new O());
|
|
22
22
|
}
|
|
23
23
|
get changeEvent() {
|
|
24
24
|
return t(this, Y);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
Y = new WeakMap();
|
|
28
|
-
var
|
|
28
|
+
var u, d, c, C;
|
|
29
29
|
class p extends R {
|
|
30
30
|
constructor(e) {
|
|
31
31
|
super();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
s(this, u, null);
|
|
33
|
+
s(this, d, null);
|
|
34
|
+
s(this, c, "offsetHeight");
|
|
35
|
+
s(this, C, (e) => {
|
|
36
36
|
const n = e.shiftKey ? -1 : 1;
|
|
37
37
|
let h;
|
|
38
38
|
e.code === "Space" ? h = n * t(this, d)[t(this, c)] * 0.4 : e.code === "ArrowLeft" ? h = -1 * t(this, d)[t(this, c)] * 0.2 : e.code === "ArrowRight" ? h = 1 * t(this, d)[t(this, c)] * 0.2 : e.code === "ArrowUp" ? h = -1 * t(this, d)[t(this, c)] * 0.2 : e.code === "ArrowDown" ? h = 1 * t(this, d)[t(this, c)] * 0.2 : e.code === "PageUp" ? h = -1 * t(this, d)[t(this, c)] : e.code === "PageDown" ? h = 1 * t(this, d)[t(this, c)] : e.code === "Home" ? h = 0 : e.code === "End" && (h = t(this, c) === "offsetWidth" ? t(this, d).scrollWidth : t(this, d).scrollHeight), h && (e.stopPropagation(), this.changeEvent.notify("keyboard", h));
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
m && (i(this, u, e != null && e.element && B(e.element) || window), i(this, d, t(this, u) instanceof HTMLElement ? t(this, u) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
|
|
41
41
|
}
|
|
42
42
|
set dimension(e) {
|
|
43
|
-
|
|
43
|
+
i(this, c, e === "width" ? "offsetWidth" : "offsetHeight");
|
|
44
44
|
}
|
|
45
45
|
connect() {
|
|
46
|
-
|
|
46
|
+
m && t(this, u).addEventListener(
|
|
47
47
|
"keydown",
|
|
48
48
|
t(this, C)
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
disconnect() {
|
|
52
|
-
|
|
52
|
+
m && t(this, u).removeEventListener(
|
|
53
53
|
"keydown",
|
|
54
54
|
t(this, C)
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
u = new WeakMap(), d = new WeakMap(), c = new WeakMap(), C = new WeakMap();
|
|
59
59
|
var w, v, T, D, f, L, M, H;
|
|
60
60
|
class ee extends R {
|
|
61
61
|
constructor(e) {
|
|
62
62
|
super();
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.direction = 1,
|
|
63
|
+
s(this, w, void 0);
|
|
64
|
+
s(this, v, void 0);
|
|
65
|
+
s(this, T, void 0);
|
|
66
|
+
s(this, D, void 0);
|
|
67
|
+
s(this, f, void 0);
|
|
68
|
+
s(this, L, void 0);
|
|
69
|
+
s(this, M, void 0);
|
|
70
|
+
s(this, H, void 0);
|
|
71
|
+
this.direction = 1, i(this, f, !1), i(this, M, (n) => {
|
|
72
72
|
t(this, f) || this.changeEvent.notify(
|
|
73
73
|
"autoplay",
|
|
74
|
-
n.
|
|
74
|
+
n.timeBetweenFrames * t(this, w) * this.direction
|
|
75
75
|
);
|
|
76
|
-
}),
|
|
76
|
+
}), i(this, H, () => {
|
|
77
77
|
t(this, f) || this.changeEvent.notify(
|
|
78
78
|
"autoplay",
|
|
79
79
|
Math.sign(t(this, w)) * this.direction
|
|
80
80
|
);
|
|
81
|
-
}),
|
|
81
|
+
}), i(this, w, (e == null ? void 0 : e.speed) || 1), i(this, v, (e == null ? void 0 : e.interval) || !1), i(this, T, e);
|
|
82
82
|
}
|
|
83
83
|
set interval(e) {
|
|
84
|
-
|
|
84
|
+
i(this, v, e), this.connect();
|
|
85
85
|
}
|
|
86
86
|
set speed(e) {
|
|
87
|
-
|
|
87
|
+
i(this, w, e), this.connect();
|
|
88
88
|
}
|
|
89
89
|
connect() {
|
|
90
|
-
this.disconnect(), t(this, v) ?
|
|
90
|
+
this.disconnect(), t(this, v) ? i(this, D, setInterval(
|
|
91
91
|
t(this, H),
|
|
92
92
|
Math.abs(t(this, w))
|
|
93
93
|
)) : y.subscribe(t(this, M), t(this, T));
|
|
94
94
|
}
|
|
95
95
|
disconnect() {
|
|
96
|
-
clearInterval(t(this, D)), y.unsubscribe(t(this, M)), clearInterval(t(this, L)),
|
|
96
|
+
clearInterval(t(this, D)), y.unsubscribe(t(this, M)), clearInterval(t(this, L)), i(this, f, !1);
|
|
97
97
|
}
|
|
98
98
|
pauseAndContinue(e) {
|
|
99
|
-
e && !t(this, f) && (clearInterval(t(this, L)),
|
|
100
|
-
|
|
99
|
+
e && !t(this, f) && (clearInterval(t(this, L)), i(this, f, !0), i(this, L, setTimeout(() => {
|
|
100
|
+
i(this, f, !1);
|
|
101
101
|
}, 3e3)));
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -106,26 +106,26 @@ var k, g, I, P;
|
|
|
106
106
|
class te extends R {
|
|
107
107
|
constructor(e) {
|
|
108
108
|
super();
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
s(this, k, null);
|
|
110
|
+
s(this, g, void 0);
|
|
111
|
+
s(this, I, void 0);
|
|
112
|
+
s(this, P, (e) => {
|
|
113
113
|
let n = 0;
|
|
114
114
|
if (e.preventDefault(), !(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) * 0.5 || this.axis === "y" && Math.abs(e.deltaX) > Math.abs(e.deltaY) * 0.5))
|
|
115
115
|
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(), this.debounce) {
|
|
116
116
|
const h = Date.now();
|
|
117
|
-
if (h - t(this, I) > 40 && (n = 100 * Math.sign(n)),
|
|
117
|
+
if (h - t(this, I) > 40 && (n = 100 * Math.sign(n)), i(this, I, h), Math.abs(n) < 100 || t(this, g))
|
|
118
118
|
return;
|
|
119
|
-
this.changeEvent.notify("wheel", n),
|
|
120
|
-
|
|
119
|
+
this.changeEvent.notify("wheel", n), i(this, g, setTimeout(() => {
|
|
120
|
+
i(this, g, void 0);
|
|
121
121
|
}, 80));
|
|
122
122
|
} else
|
|
123
123
|
this.changeEvent.notify("wheel", n);
|
|
124
124
|
});
|
|
125
|
-
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,
|
|
125
|
+
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, I, Date.now()), m && i(this, k, e != null && e.element && B(e.element) || window);
|
|
126
126
|
}
|
|
127
127
|
connect() {
|
|
128
|
-
|
|
128
|
+
m && t(this, k).addEventListener(
|
|
129
129
|
"wheel",
|
|
130
130
|
t(this, P),
|
|
131
131
|
{
|
|
@@ -134,7 +134,7 @@ class te extends R {
|
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
136
|
disconnect() {
|
|
137
|
-
|
|
137
|
+
m && (t(this, k).removeEventListener(
|
|
138
138
|
"wheel",
|
|
139
139
|
t(this, P)
|
|
140
140
|
), clearTimeout(t(this, g)));
|
|
@@ -145,50 +145,50 @@ var E, b, A, l, X, x;
|
|
|
145
145
|
const o = class o extends R {
|
|
146
146
|
constructor(e) {
|
|
147
147
|
super();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
s(this, b, null);
|
|
149
|
+
s(this, A, !1);
|
|
150
|
+
s(this, l, 0);
|
|
151
|
+
s(this, X, (e) => {
|
|
152
152
|
if (e.composedPath().find(
|
|
153
153
|
(h) => h instanceof HTMLElement && h.hasAttribute("drag-dead-zone")
|
|
154
154
|
))
|
|
155
155
|
return;
|
|
156
156
|
this.swipe || y.unsubscribe(t(this, x));
|
|
157
157
|
let n = e;
|
|
158
|
-
|
|
158
|
+
i(this, l, 0), document.documentElement.classList.add("grabbing"), S(
|
|
159
159
|
(h) => {
|
|
160
160
|
if (t(this, A) || t(o, E) && t(o, E) !== t(this, b))
|
|
161
161
|
return;
|
|
162
|
-
this.swipe &&
|
|
162
|
+
this.swipe && i(this, A, !0);
|
|
163
163
|
const W = n.x - h.x, K = n.y - h.y;
|
|
164
|
-
this.axis === "x" ?
|
|
164
|
+
this.axis === "x" ? i(this, l, W) : i(this, l, K), n = h, (this.axis === "x" && Math.abs(W) > Math.abs(K) || this.axis === "y" && Math.abs(K) > Math.abs(W)) && (i(o, E, t(this, b)), this.changeEvent.notify("drag", t(this, l)));
|
|
165
165
|
},
|
|
166
166
|
() => {
|
|
167
|
-
|
|
167
|
+
i(o, E, null), this.swipe || (i(this, l, t(this, l) * 3), y.subscribe(t(this, x), { order: z.SCROLL - 1 })), document.documentElement.classList.remove("grabbing"), i(this, A, !1);
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
170
|
});
|
|
171
|
-
|
|
172
|
-
Math.floor(t(this, l)) || y.unsubscribe(t(this, x)),
|
|
171
|
+
s(this, x, () => {
|
|
172
|
+
Math.floor(t(this, l)) || y.unsubscribe(t(this, x)), i(this, l, t(this, l) * 0.95), i(this, l, U(t(this, l), 3)), this.changeEvent.notify("drag", t(this, l));
|
|
173
173
|
});
|
|
174
|
-
this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1,
|
|
174
|
+
this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, m && i(this, b, e != null && e.element && B(e.element) || document.documentElement);
|
|
175
175
|
}
|
|
176
176
|
connect() {
|
|
177
|
-
|
|
177
|
+
m && t(this, b).addEventListener("pointerdown", t(this, X));
|
|
178
178
|
}
|
|
179
179
|
disconnect() {
|
|
180
|
-
|
|
180
|
+
m && (t(this, b).removeEventListener(
|
|
181
181
|
"pointerdown",
|
|
182
182
|
t(this, X)
|
|
183
183
|
), y.unsubscribe(t(this, x)));
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
|
-
E = new WeakMap(), b = new WeakMap(), A = new WeakMap(), l = new WeakMap(), X = new WeakMap(), x = new WeakMap(),
|
|
187
|
-
let
|
|
186
|
+
E = new WeakMap(), b = new WeakMap(), A = new WeakMap(), l = new WeakMap(), X = new WeakMap(), x = new WeakMap(), s(o, E, null);
|
|
187
|
+
let N = o;
|
|
188
188
|
export {
|
|
189
189
|
ee as AutoplayControls,
|
|
190
190
|
R as Controls,
|
|
191
|
-
|
|
191
|
+
N as DragControls,
|
|
192
192
|
p as KeyboardControls,
|
|
193
193
|
te as WheelControls
|
|
194
194
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=(r,s,e)=>{if(!s.has(r))throw TypeError("Cannot "+e)};var t=(r,s,e)=>(d(r,s,"read from private field"),e?e.call(r):s.get(r)),c=(r,s,e)=>{if(s.has(r))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(r):s.set(r,e)},n=(r,s,e,u)=>(d(r,s,"write to private field"),u?u.call(r,e):s.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../css-value-parser/index.cjs"),V=require("../order/index.cjs"),g=require("../Store-BQGNOHlY.cjs"),y=require("../dom-JBOkFLTh.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const w=require("../window-resizer/index.cjs");var h,b,i,a,o;class f extends g.Store{constructor(e,u,S,l){super(S,l);c(this,h,void 0);c(this,b,void 0);c(this,i,void 0);c(this,a,void 0);c(this,o,()=>{this.check()});n(this,h,y.getElement(e)),n(this,b,u),n(this,i,S.toString()),n(this,a,(l==null?void 0:l.rawValueCheck)!==!1)}get currentRawValue(){return t(this,i)}observe(){this.subscribers.size||w.windowResizer.subscribe(t(this,o),V.RESIZE_ORDER.CSS_VARIABLE)}unobserve(){this.subscribers.size||w.windowResizer.unsubscribe(t(this,o))}subscribe(e){return this.observe(),super.subscribe(e)}unsubscribe(e){super.unsubscribe(e),this.unobserve()}check(){const e=getComputedStyle(t(this,h)).getPropertyValue(t(this,b));if(!(t(this,a)&&t(this,i)===e))if(n(this,i,e),e){const u=R.cssValueParser.parse(t(this,i));this.current=u}else this.current=this.initial}}h=new WeakMap,b=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap;exports.CSSProperty=f;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ElementOrSelector } from '../utils';
|
|
2
2
|
import { Store, StoreCallback, StoreEntry, StoreManagerType, StoreOptions } from '../store';
|
|
3
3
|
|
|
4
|
+
export interface CSSPropertyOptions<StoreType extends number | boolean | string, StoreManager extends StoreManagerType = StoreManagerType> extends StoreOptions<StoreType, StoreManager> {
|
|
5
|
+
rawValueCheck?: boolean;
|
|
6
|
+
}
|
|
4
7
|
export declare class CSSProperty<StoreType extends number | boolean | string, StoreManager extends StoreManagerType = StoreManagerType> extends Store<StoreType, StoreManager> {
|
|
5
8
|
#private;
|
|
6
|
-
constructor(elementOrSelector: ElementOrSelector<HTMLElement>, property: string, defaultValue: StoreType, options?:
|
|
9
|
+
constructor(elementOrSelector: ElementOrSelector<HTMLElement>, property: string, defaultValue: StoreType, options?: CSSPropertyOptions<StoreType, StoreManager>);
|
|
10
|
+
get currentRawValue(): string;
|
|
7
11
|
observe(): void;
|
|
8
12
|
unobserve(): void;
|
|
9
13
|
subscribe(callback: StoreCallback<StoreEntry<StoreType>>): () => void;
|