aptechka 0.4.36 → 0.4.37
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 +16 -16
- package/package.json +1 -1
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var E=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var i=(t,e,s)=>(E(t,e,"read from private field"),s?s.call(t):e.get(t)),p=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},m=(t,e,s,h)=>(E(t,e,"write to private field"),h?h.call(t,s):e.set(t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-BQGNOHlY.cjs");const L=require("../coordinates-D8Np3cPD.cjs"),k=require("../dom-JBOkFLTh.cjs"),q=require("../math-GDWEqu7y.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");require("../ticker/index.cjs");const C=require("../Damped-CbWlWAbx.cjs"),M=require("../custom-element/index.cjs"),v=require("../css-property/index.cjs");var a,u,d,l,_,w,x;class W{constructor(e){p(this,a,void 0);p(this,u,void 0);p(this,d,void 0);p(this,l,void 0);p(this,_,e=>{i(this,l).set(1)});p(this,w,e=>{i(this,l).set(0)});p(this,x,e=>{const s={x:e.
|
|
1
|
+
"use strict";var E=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var i=(t,e,s)=>(E(t,e,"read from private field"),s?s.call(t):e.get(t)),p=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},m=(t,e,s,h)=>(E(t,e,"write to private field"),h?h.call(t,s):e.set(t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-BQGNOHlY.cjs");const L=require("../coordinates-D8Np3cPD.cjs"),k=require("../dom-JBOkFLTh.cjs"),q=require("../math-GDWEqu7y.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");require("../ticker/index.cjs");const C=require("../Damped-CbWlWAbx.cjs"),M=require("../custom-element/index.cjs"),v=require("../css-property/index.cjs");var a,u,d,l,_,w,x;class W{constructor(e){p(this,a,void 0);p(this,u,void 0);p(this,d,void 0);p(this,l,void 0);p(this,_,e=>{i(this,l).set(1)});p(this,w,e=>{i(this,l).set(0)});p(this,x,e=>{const s={x:e.clientX,y:e.clientY},h={width:this.element.offsetWidth,height:this.element.offsetHeight},o={x:s.x,y:s.y};if(this.cartesian){const c=L.screenToCartesian(o,h);o.x=c.x,o.y=c.y}if(this.normalize){const c=L.normalize(o,h);o.x=q.clamp(c.x*2,-1,1),o.y=q.clamp(c.y*2,-1,1)}i(this,u).set(o.x),i(this,d).set(o.y)});m(this,a,k.getElement(e.element)),m(this,u,new C.Damped(0,e.damped)),m(this,d,new C.Damped(0,e.damped)),m(this,l,new C.Damped(0,e.damped)),this.cartesian=e.cartesian||!1,this.normalize=e.normalize||!1}get element(){return i(this,a)}get x(){return i(this,u)}get y(){return i(this,d)}get z(){return i(this,l)}connect(){i(this,a).addEventListener("pointerenter",i(this,_)),i(this,a).addEventListener("pointerleave",i(this,w)),i(this,a).addEventListener("pointermove",i(this,x))}disconnect(){i(this,a).removeEventListener("pointerenter",i(this,_)),i(this,a).removeEventListener("pointerleave",i(this,w)),i(this,a).removeEventListener("pointermove",i(this,x)),i(this,u).reset(),i(this,d).reset(),i(this,l).reset()}}a=new WeakMap,u=new WeakMap,d=new WeakMap,l=new WeakMap,_=new WeakMap,w=new WeakMap,x=new WeakMap;var O=Object.defineProperty,T=Object.getOwnPropertyDescriptor,A=(t,e,s,h)=>{for(var o=h>1?void 0:h?T(e,s):e,c=t.length-1,b;c>=0;c--)(b=t[c])&&(o=(h?b(e,s,o):b(o))||o);return h&&o&&O(e,s,o),o},D=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(D(t,e,"read from private field"),s?s.call(t):e.get(t)),y=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},G=(t,e,s,h)=>(D(t,e,"write to private field"),h?h.call(t,s):e.set(t,s),s),n,f,P,S,g,z;exports.PointerElement=class extends M.CustomElement{constructor(){super(),y(this,n,void 0),y(this,f,new v.CSSProperty(this,"--damping",20)),y(this,P,new v.CSSProperty(this,"--mass",0)),y(this,S,new v.CSSProperty(this,"--stiffness",0)),y(this,g,new v.CSSProperty(this,"--cartesian",!1)),y(this,z,new v.CSSProperty(this,"--normalize",!1)),G(this,n,new W({element:this})),r(this,f).subscribe(e=>{r(this,n).x.damping=e.current,r(this,n).y.damping=e.current,r(this,n).z.damping=e.current}),r(this,g).subscribe(e=>{r(this,n).cartesian=e.current}),r(this,z).subscribe(e=>{r(this,n).normalize=e.current}),r(this,P).subscribe(e=>{r(this,n).x.mass=e.current,r(this,n).y.mass=e.current,r(this,n).z.mass=e.current}),r(this,S).subscribe(e=>{r(this,n).x.stiffness=e.current,r(this,n).y.stiffness=e.current,r(this,n).z.stiffness=e.current}),r(this,n).x.subscribe(e=>{this.style.setProperty("--x",e.current.toString())}),r(this,n).y.subscribe(e=>{this.style.setProperty("--y",e.current.toString())}),r(this,n).z.subscribe(e=>{this.style.setProperty("--z",e.current.toString())})}connectedCallback(){r(this,n).connect(),r(this,f).observe(),r(this,P).observe(),r(this,S).observe()}disconnectedCallback(){r(this,n).disconnect(),r(this,f).unobserve(),r(this,P).unobserve(),r(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}};n=new WeakMap;f=new WeakMap;P=new WeakMap;S=new WeakMap;g=new WeakMap;z=new WeakMap;exports.PointerElement=A([M.define("e-pointer")],exports.PointerElement);exports.Pointer=W;
|
package/lib/pointer/index.js
CHANGED
|
@@ -16,23 +16,23 @@ import "../ticker/index.js";
|
|
|
16
16
|
import { D as g } from "../Damped-BJgyFENo.js";
|
|
17
17
|
import { CustomElement as T, define as A } from "../custom-element/index.js";
|
|
18
18
|
import { CSSProperty as d } from "../css-property/index.js";
|
|
19
|
-
var a,
|
|
19
|
+
var a, m, v, l, x, P, S;
|
|
20
20
|
class G {
|
|
21
21
|
constructor(t) {
|
|
22
22
|
p(this, a, void 0);
|
|
23
|
-
p(this, l, void 0);
|
|
24
|
-
p(this, f, void 0);
|
|
25
23
|
p(this, m, void 0);
|
|
24
|
+
p(this, v, void 0);
|
|
25
|
+
p(this, l, void 0);
|
|
26
26
|
p(this, x, (t) => {
|
|
27
|
-
r(this,
|
|
27
|
+
r(this, l).set(1);
|
|
28
28
|
});
|
|
29
29
|
p(this, P, (t) => {
|
|
30
|
-
r(this,
|
|
30
|
+
r(this, l).set(0);
|
|
31
31
|
});
|
|
32
32
|
p(this, S, (t) => {
|
|
33
33
|
const s = {
|
|
34
|
-
x: t.
|
|
35
|
-
y: t.
|
|
34
|
+
x: t.clientX,
|
|
35
|
+
y: t.clientY
|
|
36
36
|
}, h = {
|
|
37
37
|
width: this.element.offsetWidth,
|
|
38
38
|
height: this.element.offsetHeight
|
|
@@ -48,21 +48,21 @@ class G {
|
|
|
48
48
|
const c = D(o, h);
|
|
49
49
|
o.x = L(c.x * 2, -1, 1), o.y = L(c.y * 2, -1, 1);
|
|
50
50
|
}
|
|
51
|
-
r(this,
|
|
51
|
+
r(this, m).set(o.x), r(this, v).set(o.y);
|
|
52
52
|
});
|
|
53
|
-
y(this, a, O(t.element)), y(this,
|
|
53
|
+
y(this, a, O(t.element)), y(this, m, new g(0, t.damped)), y(this, v, new g(0, t.damped)), y(this, l, new g(0, t.damped)), this.cartesian = t.cartesian || !1, this.normalize = t.normalize || !1;
|
|
54
54
|
}
|
|
55
55
|
get element() {
|
|
56
56
|
return r(this, a);
|
|
57
57
|
}
|
|
58
58
|
get x() {
|
|
59
|
-
return r(this,
|
|
59
|
+
return r(this, m);
|
|
60
60
|
}
|
|
61
61
|
get y() {
|
|
62
|
-
return r(this,
|
|
62
|
+
return r(this, v);
|
|
63
63
|
}
|
|
64
64
|
get z() {
|
|
65
|
-
return r(this,
|
|
65
|
+
return r(this, l);
|
|
66
66
|
}
|
|
67
67
|
connect() {
|
|
68
68
|
r(this, a).addEventListener("pointerenter", r(this, x)), r(this, a).addEventListener("pointerleave", r(this, P)), r(this, a).addEventListener("pointermove", r(this, S));
|
|
@@ -74,10 +74,10 @@ class G {
|
|
|
74
74
|
), r(this, a).removeEventListener(
|
|
75
75
|
"pointerleave",
|
|
76
76
|
r(this, P)
|
|
77
|
-
), r(this, a).removeEventListener("pointermove", r(this, S)), r(this,
|
|
77
|
+
), r(this, a).removeEventListener("pointermove", r(this, S)), r(this, m).reset(), r(this, v).reset(), r(this, l).reset();
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
a = new WeakMap(),
|
|
80
|
+
a = new WeakMap(), m = new WeakMap(), v = new WeakMap(), l = new WeakMap(), x = new WeakMap(), P = new WeakMap(), S = new WeakMap();
|
|
81
81
|
var H = Object.defineProperty, X = Object.getOwnPropertyDescriptor, Y = (e, t, s, h) => {
|
|
82
82
|
for (var o = h > 1 ? void 0 : h ? X(t, s) : t, c = e.length - 1, b; c >= 0; c--)
|
|
83
83
|
(b = e[c]) && (o = (h ? b(t, s, o) : b(o)) || o);
|
|
@@ -85,14 +85,14 @@ var H = Object.defineProperty, X = Object.getOwnPropertyDescriptor, Y = (e, t, s
|
|
|
85
85
|
}, M = (e, t, s) => {
|
|
86
86
|
if (!t.has(e))
|
|
87
87
|
throw TypeError("Cannot " + s);
|
|
88
|
-
}, i = (e, t, s) => (M(e, t, "read from private field"), s ? s.call(e) : t.get(e)),
|
|
88
|
+
}, i = (e, t, s) => (M(e, t, "read from private field"), s ? s.call(e) : t.get(e)), f = (e, t, s) => {
|
|
89
89
|
if (t.has(e))
|
|
90
90
|
throw TypeError("Cannot add the same private member more than once");
|
|
91
91
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
92
92
|
}, q = (e, t, s, h) => (M(e, t, "write to private field"), h ? h.call(e, s) : t.set(e, s), s), n, u, w, _, z, C;
|
|
93
93
|
let W = class extends T {
|
|
94
94
|
constructor() {
|
|
95
|
-
super(),
|
|
95
|
+
super(), f(this, n, void 0), f(this, u, new d(this, "--damping", 20)), f(this, w, new d(this, "--mass", 0)), f(this, _, new d(this, "--stiffness", 0)), f(this, z, new d(this, "--cartesian", !1)), f(this, C, new d(this, "--normalize", !1)), q(this, n, new G({
|
|
96
96
|
element: this
|
|
97
97
|
})), i(this, u).subscribe((e) => {
|
|
98
98
|
i(this, n).x.damping = e.current, i(this, n).y.damping = e.current, i(this, n).z.damping = e.current;
|