aptechka 0.63.1 → 0.63.2
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/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +51 -49
- package/package.json +1 -1
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var J=Object.defineProperty;var B=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=i=>{throw TypeError(i)};var H=(i,s,t)=>s in i?J(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,O=(i,s)=>{for(var t in s||(s={}))K.call(s,t)&&H(i,t,s[t]);if(B)for(var t of B(s))N.call(s,t)&&H(i,t,s[t]);return i};var
|
|
1
|
+
"use strict";var J=Object.defineProperty;var B=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=i=>{throw TypeError(i)};var H=(i,s,t)=>s in i?J(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,O=(i,s)=>{for(var t in s||(s={}))K.call(s,t)&&H(i,t,s[t]);if(B)for(var t of B(s))N.call(s,t)&&H(i,t,s[t]);return i};var D=(i,s,t)=>s.has(i)||j("Cannot "+t);var e=(i,s,t)=>(D(i,s,"read from private field"),t?t.call(i):s.get(i)),r=(i,s,t)=>s.has(i)?j("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),o=(i,s,t,u)=>(D(i,s,"write to private field"),u?u.call(i,t):s.set(i,t),t),_=(i,s,t)=>(D(i,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-GokLe_g-.cjs");const M=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),W=require("../math-GDWEqu7y.cjs"),U=require("../index-Cqw2NKev.cjs");require("../ticker/index.cjs");const T=require("../Damped-B8bmTxAr.cjs"),A=require("../element-resizer/index.cjs"),F=require("../window-resizer/index.cjs"),w=require("../css-property/index.cjs");var c,a,l,y,m,d,b,x,g,z,C,E,p,q,k;class G{constructor(s){r(this,q);r(this,c);r(this,a);r(this,l);r(this,y);r(this,m);r(this,d);r(this,b,0);r(this,x,0);r(this,g,!1);r(this,z,s=>{o(this,g,!0);const t=_(this,q,k).call(this,s);e(this,a).set(t.x,{equalize:!0}),e(this,l).set(t.y,{equalize:!0}),e(this,y).set(1)});r(this,C,s=>{o(this,g,!1),e(this,y).set(0)});r(this,E,s=>{e(this,g)||e(this,z).call(this,s);const t=_(this,q,k).call(this,s);e(this,a).set(t.x),e(this,l).set(t.y)});r(this,p,()=>{o(this,b,this.element.clientWidth),o(this,x,this.element.clientHeight);let s=0,t=0,u=0,h=0;e(this,m)?e(this,d)?(s=-1,t=1,u=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,u=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,d)?(s=0,t=1,u=0,h=1):(s=0,t=e(this,b),u=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,l).min=u,e(this,l).max=h});o(this,c,Q.getElement(s.element)),o(this,a,new T.Damped(0,s.damped)),o(this,l,new T.Damped(0,s.damped)),o(this,y,new T.Damped(0,O({min:0,max:1},s.damped))),o(this,m,s.cartesian||!1),o(this,d,s.normalize||!1)}get element(){return e(this,c)}get x(){return e(this,a)}get y(){return e(this,l)}get z(){return e(this,y)}get cartesian(){return e(this,m)}set cartesian(s){o(this,m,s),e(this,p).call(this)}get normalize(){return e(this,d)}set normalize(s){o(this,d,s),e(this,p).call(this)}connect(){e(this,c).addEventListener("pointerenter",e(this,z)),e(this,c).addEventListener("pointerleave",e(this,C)),e(this,c).addEventListener("pointermove",e(this,E)),A.elementResizer.subscribe(e(this,c),e(this,p)),F.windowResizer.subscribe(e(this,p))}disconnect(){e(this,c).removeEventListener("pointerenter",e(this,z)),e(this,c).removeEventListener("pointerleave",e(this,C)),e(this,c).removeEventListener("pointermove",e(this,E)),A.elementResizer.unsubscribe(e(this,p)),F.windowResizer.unsubscribe(e(this,p)),e(this,a).reset(),e(this,l).reset(),e(this,y).reset()}}c=new WeakMap,a=new WeakMap,l=new WeakMap,y=new WeakMap,m=new WeakMap,d=new WeakMap,b=new WeakMap,x=new WeakMap,g=new WeakMap,z=new WeakMap,C=new WeakMap,E=new WeakMap,p=new WeakMap,q=new WeakSet,k=function(s){const t=M.getPointerPosition(s,e(this,c).getBoundingClientRect()),u={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,m)){const f=M.screenToCartesian(h,u);h.x=f.x,h.y=f.y}if(e(this,d)){const f=M.normalize(h,u);e(this,m)?(h.x=W.clamp(f.x*2,-1,1),h.y=W.clamp(f.y*2,-1,1)):(h.x=f.x,h.y=f.y)}return h};var n,v,P,S,L,R;class I extends HTMLElement{constructor(){super();r(this,n);r(this,v,new w.CSSProperty(this,"--damping",20));r(this,P,new w.CSSProperty(this,"--mass",0));r(this,S,new w.CSSProperty(this,"--stiffness",0));r(this,L,new w.CSSProperty(this,"--cartesian",!1));r(this,R,new w.CSSProperty(this,"--normalize",!1));o(this,n,new G({element:this})),e(this,v).subscribe(t=>{e(this,n).x.damping=t.current,e(this,n).y.damping=t.current,e(this,n).z.damping=t.current}),e(this,L).subscribe(t=>{e(this,n).cartesian=t.current}),e(this,R).subscribe(t=>{e(this,n).normalize=t.current}),e(this,P).subscribe(t=>{e(this,n).x.mass=t.current,e(this,n).y.mass=t.current,e(this,n).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,n).x.stiffness=t.current,e(this,n).y.stiffness=t.current,e(this,n).z.stiffness=t.current}),e(this,n).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,n).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,n).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,n)}connectedCallback(){e(this,n).connect(),e(this,v).observe(),e(this,P).observe(),e(this,S).observe()}disconnectedCallback(){e(this,n).disconnect(),e(this,v).unobserve(),e(this,P).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}n=new WeakMap,v=new WeakMap,P=new WeakMap,S=new WeakMap,L=new WeakMap,R=new WeakMap;U.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",I);exports.Pointer=G;exports.PointerElement=I;
|
package/lib/pointer/index.js
CHANGED
|
@@ -12,51 +12,53 @@ var T = (i, s, e) => s in i ? I(i, s, { enumerable: !0, configurable: !0, writab
|
|
|
12
12
|
K.call(s, e) && T(i, e, s[e]);
|
|
13
13
|
return i;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (i, s, e) => (
|
|
15
|
+
var q = (i, s, e) => s.has(i) || W("Cannot " + e);
|
|
16
|
+
var t = (i, s, e) => (q(i, s, "read from private field"), e ? e.call(i) : s.get(i)), r = (i, s, e) => s.has(i) ? W("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), o = (i, s, e, m) => (q(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e), B = (i, s, e) => (q(i, s, "access private method"), e);
|
|
17
17
|
import "../Store-swP_0ymB.js";
|
|
18
18
|
import { g as N, s as O, n as Q } from "../coordinates-CgdGoSYs.js";
|
|
19
19
|
import { g as U } from "../dom-CVWzyXPH.js";
|
|
20
20
|
import { c as A } from "../math-BOBiC4TN.js";
|
|
21
21
|
import { i as V } from "../index-euf5anj6.js";
|
|
22
22
|
import "../ticker/index.js";
|
|
23
|
-
import { D
|
|
23
|
+
import { D } from "../Damped-ByZFbNSt.js";
|
|
24
24
|
import { elementResizer as F } from "../element-resizer/index.js";
|
|
25
25
|
import { windowResizer as G } from "../window-resizer/index.js";
|
|
26
|
-
import { CSSProperty as
|
|
27
|
-
var
|
|
26
|
+
import { CSSProperty as w } from "../css-property/index.js";
|
|
27
|
+
var c, a, l, f, u, p, b, d, g, v, E, L, y, C, H;
|
|
28
28
|
class X {
|
|
29
29
|
constructor(s) {
|
|
30
|
-
r(this,
|
|
31
|
-
r(this,
|
|
30
|
+
r(this, C);
|
|
31
|
+
r(this, c);
|
|
32
32
|
r(this, a);
|
|
33
33
|
r(this, l);
|
|
34
|
-
r(this,
|
|
34
|
+
r(this, f);
|
|
35
35
|
r(this, u);
|
|
36
36
|
r(this, p);
|
|
37
|
+
r(this, b, 0);
|
|
37
38
|
r(this, d, 0);
|
|
38
|
-
r(this,
|
|
39
|
-
r(this,
|
|
40
|
-
|
|
41
|
-
const e =
|
|
42
|
-
t(this, a).set(e.x, { equalize: !0 }), t(this, l).set(e.y, { equalize: !0 }), t(this,
|
|
43
|
-
});
|
|
44
|
-
r(this, w, (s) => {
|
|
45
|
-
t(this, b).set(0);
|
|
39
|
+
r(this, g, !1);
|
|
40
|
+
r(this, v, (s) => {
|
|
41
|
+
o(this, g, !0);
|
|
42
|
+
const e = B(this, C, H).call(this, s);
|
|
43
|
+
t(this, a).set(e.x, { equalize: !0 }), t(this, l).set(e.y, { equalize: !0 }), t(this, f).set(1);
|
|
46
44
|
});
|
|
47
45
|
r(this, E, (s) => {
|
|
48
|
-
|
|
46
|
+
o(this, g, !1), t(this, f).set(0);
|
|
47
|
+
});
|
|
48
|
+
r(this, L, (s) => {
|
|
49
|
+
t(this, g) || t(this, v).call(this, s);
|
|
50
|
+
const e = B(this, C, H).call(this, s);
|
|
49
51
|
t(this, a).set(e.x), t(this, l).set(e.y);
|
|
50
52
|
});
|
|
51
53
|
r(this, y, () => {
|
|
52
|
-
|
|
54
|
+
o(this, b, this.element.clientWidth), o(this, d, this.element.clientHeight);
|
|
53
55
|
let s = 0, e = 0, m = 0, h = 0;
|
|
54
|
-
t(this, u) ? t(this, p) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this,
|
|
56
|
+
t(this, u) ? t(this, p) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, b) / 2 * -1, e = t(this, b) / 2 * 1, m = t(this, d) / 2 * -1, h = t(this, d) / 2 * 1) : t(this, p) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, b), m = 0, h = t(this, d)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
|
|
55
57
|
});
|
|
56
|
-
|
|
58
|
+
o(this, c, U(s.element)), o(this, a, new D(0, s.damped)), o(this, l, new D(0, s.damped)), o(this, f, new D(0, j({ min: 0, max: 1 }, s.damped))), o(this, u, s.cartesian || !1), o(this, p, s.normalize || !1);
|
|
57
59
|
}
|
|
58
60
|
get element() {
|
|
59
|
-
return t(this,
|
|
61
|
+
return t(this, c);
|
|
60
62
|
}
|
|
61
63
|
get x() {
|
|
62
64
|
return t(this, a);
|
|
@@ -65,37 +67,37 @@ class X {
|
|
|
65
67
|
return t(this, l);
|
|
66
68
|
}
|
|
67
69
|
get z() {
|
|
68
|
-
return t(this,
|
|
70
|
+
return t(this, f);
|
|
69
71
|
}
|
|
70
72
|
get cartesian() {
|
|
71
73
|
return t(this, u);
|
|
72
74
|
}
|
|
73
75
|
set cartesian(s) {
|
|
74
|
-
|
|
76
|
+
o(this, u, s), t(this, y).call(this);
|
|
75
77
|
}
|
|
76
78
|
get normalize() {
|
|
77
79
|
return t(this, p);
|
|
78
80
|
}
|
|
79
81
|
set normalize(s) {
|
|
80
|
-
|
|
82
|
+
o(this, p, s), t(this, y).call(this);
|
|
81
83
|
}
|
|
82
84
|
connect() {
|
|
83
|
-
t(this,
|
|
85
|
+
t(this, c).addEventListener("pointerenter", t(this, v)), t(this, c).addEventListener("pointerleave", t(this, E)), t(this, c).addEventListener("pointermove", t(this, L)), F.subscribe(t(this, c), t(this, y)), G.subscribe(t(this, y));
|
|
84
86
|
}
|
|
85
87
|
disconnect() {
|
|
86
|
-
t(this,
|
|
88
|
+
t(this, c).removeEventListener(
|
|
87
89
|
"pointerenter",
|
|
88
|
-
t(this,
|
|
89
|
-
), t(this,
|
|
90
|
+
t(this, v)
|
|
91
|
+
), t(this, c).removeEventListener(
|
|
90
92
|
"pointerleave",
|
|
91
|
-
t(this,
|
|
92
|
-
), t(this,
|
|
93
|
+
t(this, E)
|
|
94
|
+
), t(this, c).removeEventListener("pointermove", t(this, L)), F.unsubscribe(t(this, y)), G.unsubscribe(t(this, y)), t(this, a).reset(), t(this, l).reset(), t(this, f).reset();
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
|
-
|
|
96
|
-
const e = N(s, t(this,
|
|
97
|
-
width: t(this,
|
|
98
|
-
height: t(this,
|
|
97
|
+
c = new WeakMap(), a = new WeakMap(), l = new WeakMap(), f = new WeakMap(), u = new WeakMap(), p = new WeakMap(), b = new WeakMap(), d = new WeakMap(), g = new WeakMap(), v = new WeakMap(), E = new WeakMap(), L = new WeakMap(), y = new WeakMap(), C = new WeakSet(), H = function(s) {
|
|
98
|
+
const e = N(s, t(this, c).getBoundingClientRect()), m = {
|
|
99
|
+
width: t(this, b),
|
|
100
|
+
height: t(this, d)
|
|
99
101
|
}, h = {
|
|
100
102
|
x: e.x,
|
|
101
103
|
y: e.y
|
|
@@ -110,27 +112,27 @@ o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), b = new WeakMap(), u =
|
|
|
110
112
|
}
|
|
111
113
|
return h;
|
|
112
114
|
};
|
|
113
|
-
var n,
|
|
115
|
+
var n, z, P, S, R, k;
|
|
114
116
|
class Y extends HTMLElement {
|
|
115
117
|
constructor() {
|
|
116
118
|
super();
|
|
117
119
|
r(this, n);
|
|
118
|
-
r(this,
|
|
119
|
-
r(this,
|
|
120
|
-
r(this,
|
|
121
|
-
r(this,
|
|
122
|
-
r(this,
|
|
123
|
-
|
|
120
|
+
r(this, z, new w(this, "--damping", 20));
|
|
121
|
+
r(this, P, new w(this, "--mass", 0));
|
|
122
|
+
r(this, S, new w(this, "--stiffness", 0));
|
|
123
|
+
r(this, R, new w(this, "--cartesian", !1));
|
|
124
|
+
r(this, k, new w(this, "--normalize", !1));
|
|
125
|
+
o(this, n, new X({
|
|
124
126
|
element: this
|
|
125
|
-
})), t(this,
|
|
127
|
+
})), t(this, z).subscribe((e) => {
|
|
126
128
|
t(this, n).x.damping = e.current, t(this, n).y.damping = e.current, t(this, n).z.damping = e.current;
|
|
127
|
-
}), t(this,
|
|
129
|
+
}), t(this, R).subscribe((e) => {
|
|
128
130
|
t(this, n).cartesian = e.current;
|
|
129
|
-
}), t(this,
|
|
131
|
+
}), t(this, k).subscribe((e) => {
|
|
130
132
|
t(this, n).normalize = e.current;
|
|
131
|
-
}), t(this,
|
|
133
|
+
}), t(this, P).subscribe((e) => {
|
|
132
134
|
t(this, n).x.mass = e.current, t(this, n).y.mass = e.current, t(this, n).z.mass = e.current;
|
|
133
|
-
}), t(this,
|
|
135
|
+
}), t(this, S).subscribe((e) => {
|
|
134
136
|
t(this, n).x.stiffness = e.current, t(this, n).y.stiffness = e.current, t(this, n).z.stiffness = e.current;
|
|
135
137
|
}), t(this, n).x.subscribe((e) => {
|
|
136
138
|
this.style.setProperty("--x", e.current.toString());
|
|
@@ -144,13 +146,13 @@ class Y extends HTMLElement {
|
|
|
144
146
|
return t(this, n);
|
|
145
147
|
}
|
|
146
148
|
connectedCallback() {
|
|
147
|
-
t(this, n).connect(), t(this,
|
|
149
|
+
t(this, n).connect(), t(this, z).observe(), t(this, P).observe(), t(this, S).observe();
|
|
148
150
|
}
|
|
149
151
|
disconnectedCallback() {
|
|
150
|
-
t(this, n).disconnect(), t(this,
|
|
152
|
+
t(this, n).disconnect(), t(this, z).unobserve(), t(this, P).unobserve(), t(this, S).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
|
-
n = new WeakMap(),
|
|
155
|
+
n = new WeakMap(), z = new WeakMap(), P = new WeakMap(), S = new WeakMap(), R = new WeakMap(), k = new WeakMap();
|
|
154
156
|
V && !customElements.get("e-pointer") && customElements.define("e-pointer", Y);
|
|
155
157
|
export {
|
|
156
158
|
X as Pointer,
|