aptechka 0.4.21 → 0.4.22

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.
@@ -1 +1 @@
1
- "use strict";var L=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var i=(t,e,s)=>(L(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)},v=(t,e,s,h)=>(L(t,e,"write to private field"),h?h.call(t,s):e.set(t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../Damped-B0G_t-pw.cjs"),C=require("../coordinates-D8Np3cPD.cjs"),D=require("../dom-JBOkFLTh.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");require("../Store-BQGNOHlY.cjs");require("../ticker/index.cjs");const q=require("../custom-element/index.cjs"),m=require("../css-property/index.cjs");var a,u,d,l,_,w,b;class M{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,b,e=>{const s=C.getPointerPosition(e),h={width:this.element.offsetWidth,height:this.element.offsetHeight},o={x:s.x,y:s.y};if(this.cartesian){const c=C.screenToCartesian(o,h);o.x=c.x,o.y=c.y}if(this.normalize){const c=C.normalize(o,h);o.x=c.x*2,o.y=c.y*2}i(this,u).set(o.x),i(this,d).set(o.y)});v(this,a,D.getElement(e.element)),v(this,u,new x.Damped(0,e.damped)),v(this,d,new x.Damped(0,e.damped)),v(this,l,new x.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,b))}disconnect(){i(this,a).removeEventListener("pointerenter",i(this,_)),i(this,a).removeEventListener("pointerleave",i(this,w)),i(this,a).removeEventListener("pointermove",i(this,b)),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,b=new WeakMap;var k=Object.defineProperty,O=Object.getOwnPropertyDescriptor,T=(t,e,s,h)=>{for(var o=h>1?void 0:h?O(e,s):e,c=t.length-1,g;c>=0;c--)(g=t[c])&&(o=(h?g(e,s,o):g(o))||o);return h&&o&&k(e,s,o),o},W=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(W(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)},A=(t,e,s,h)=>(W(t,e,"write to private field"),h?h.call(t,s):e.set(t,s),s),n,f,P,S,z,E;exports.PointerElement=class extends q.CustomElement{constructor(){super(),y(this,n,void 0),y(this,f,new m.CSSProperty(this,"--damping",20)),y(this,P,new m.CSSProperty(this,"--mass",0)),y(this,S,new m.CSSProperty(this,"--stiffness",0)),y(this,z,new m.CSSProperty(this,"--cartesian",!1)),y(this,E,new m.CSSProperty(this,"--normalize",!1)),A(this,n,new M({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,z).subscribe(e=>{r(this,n).cartesian=e.current}),r(this,E).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;z=new WeakMap;E=new WeakMap;exports.PointerElement=T([q.define("e-pointer")],exports.PointerElement);exports.Pointer=M;
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"});const C=require("../Damped-B0G_t-pw.cjs"),L=require("../coordinates-D8Np3cPD.cjs"),k=require("../dom-JBOkFLTh.cjs"),q=require("../math-GDWEqu7y.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");require("../Store-BQGNOHlY.cjs");require("../ticker/index.cjs");const 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.offsetX,y:e.offsetY},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;
@@ -6,30 +6,34 @@ var r = (e, t, s) => (E(e, t, "read from private field"), s ? s.call(e) : t.get(
6
6
  if (t.has(e))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
9
- }, d = (e, t, s, h) => (E(e, t, "write to private field"), h ? h.call(e, s) : t.set(e, s), s);
10
- import { D as b } from "../Damped-DpaKIZqv.js";
11
- import { g as M, s as k, n as D } from "../coordinates-CgdGoSYs.js";
9
+ }, y = (e, t, s, h) => (E(e, t, "write to private field"), h ? h.call(e, s) : t.set(e, s), s);
10
+ import { D as g } from "../Damped-DpaKIZqv.js";
11
+ import { s as k, n as D } from "../coordinates-CgdGoSYs.js";
12
12
  import { g as O } from "../dom-0S_WDL4g.js";
13
+ import { c as L } from "../math-BOBiC4TN.js";
13
14
  import "../path-data-polyfill-DgeDWYeI.js";
14
15
  import "../Store-Cd-E5W1z.js";
15
16
  import "../ticker/index.js";
16
17
  import { CustomElement as T, define as A } from "../custom-element/index.js";
17
- import { CSSProperty as u } from "../css-property/index.js";
18
- var a, m, v, l, _, g, x;
18
+ import { CSSProperty as d } from "../css-property/index.js";
19
+ var a, l, f, m, x, P, S;
19
20
  class G {
20
21
  constructor(t) {
21
22
  p(this, a, void 0);
22
- p(this, m, void 0);
23
- p(this, v, void 0);
24
23
  p(this, l, void 0);
25
- p(this, _, (t) => {
26
- r(this, l).set(1);
24
+ p(this, f, void 0);
25
+ p(this, m, void 0);
26
+ p(this, x, (t) => {
27
+ r(this, m).set(1);
27
28
  });
28
- p(this, g, (t) => {
29
- r(this, l).set(0);
29
+ p(this, P, (t) => {
30
+ r(this, m).set(0);
30
31
  });
31
- p(this, x, (t) => {
32
- const s = M(t), h = {
32
+ p(this, S, (t) => {
33
+ const s = {
34
+ x: t.offsetX,
35
+ y: t.offsetY
36
+ }, h = {
33
37
  width: this.element.offsetWidth,
34
38
  height: this.element.offsetHeight
35
39
  }, o = {
@@ -42,55 +46,55 @@ class G {
42
46
  }
43
47
  if (this.normalize) {
44
48
  const c = D(o, h);
45
- o.x = c.x * 2, o.y = c.y * 2;
49
+ o.x = L(c.x * 2, -1, 1), o.y = L(c.y * 2, -1, 1);
46
50
  }
47
- r(this, m).set(o.x), r(this, v).set(o.y);
51
+ r(this, l).set(o.x), r(this, f).set(o.y);
48
52
  });
49
- d(this, a, O(t.element)), d(this, m, new b(0, t.damped)), d(this, v, new b(0, t.damped)), d(this, l, new b(0, t.damped)), this.cartesian = t.cartesian || !1, this.normalize = t.normalize || !1;
53
+ y(this, a, O(t.element)), y(this, l, new g(0, t.damped)), y(this, f, new g(0, t.damped)), y(this, m, new g(0, t.damped)), this.cartesian = t.cartesian || !1, this.normalize = t.normalize || !1;
50
54
  }
51
55
  get element() {
52
56
  return r(this, a);
53
57
  }
54
58
  get x() {
55
- return r(this, m);
59
+ return r(this, l);
56
60
  }
57
61
  get y() {
58
- return r(this, v);
62
+ return r(this, f);
59
63
  }
60
64
  get z() {
61
- return r(this, l);
65
+ return r(this, m);
62
66
  }
63
67
  connect() {
64
- r(this, a).addEventListener("pointerenter", r(this, _)), r(this, a).addEventListener("pointerleave", r(this, g)), r(this, a).addEventListener("pointermove", r(this, x));
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));
65
69
  }
66
70
  disconnect() {
67
71
  r(this, a).removeEventListener(
68
72
  "pointerenter",
69
- r(this, _)
73
+ r(this, x)
70
74
  ), r(this, a).removeEventListener(
71
75
  "pointerleave",
72
- r(this, g)
73
- ), r(this, a).removeEventListener("pointermove", r(this, x)), r(this, m).reset(), r(this, v).reset(), r(this, l).reset();
76
+ r(this, P)
77
+ ), r(this, a).removeEventListener("pointermove", r(this, S)), r(this, l).reset(), r(this, f).reset(), r(this, m).reset();
74
78
  }
75
79
  }
76
- a = new WeakMap(), m = new WeakMap(), v = new WeakMap(), l = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), x = new WeakMap();
77
- var H = Object.defineProperty, q = Object.getOwnPropertyDescriptor, B = (e, t, s, h) => {
78
- for (var o = h > 1 ? void 0 : h ? q(t, s) : t, c = e.length - 1, S; c >= 0; c--)
79
- (S = e[c]) && (o = (h ? S(t, s, o) : S(o)) || o);
80
+ a = new WeakMap(), l = new WeakMap(), f = new WeakMap(), m = new WeakMap(), x = new WeakMap(), P = new WeakMap(), S = new WeakMap();
81
+ var H = Object.defineProperty, X = Object.getOwnPropertyDescriptor, Y = (e, t, s, h) => {
82
+ for (var o = h > 1 ? void 0 : h ? X(t, s) : t, c = e.length - 1, b; c >= 0; c--)
83
+ (b = e[c]) && (o = (h ? b(t, s, o) : b(o)) || o);
80
84
  return h && o && H(t, s, o), o;
81
- }, W = (e, t, s) => {
85
+ }, M = (e, t, s) => {
82
86
  if (!t.has(e))
83
87
  throw TypeError("Cannot " + s);
84
- }, i = (e, t, s) => (W(e, t, "read from private field"), s ? s.call(e) : t.get(e)), f = (e, t, s) => {
88
+ }, i = (e, t, s) => (M(e, t, "read from private field"), s ? s.call(e) : t.get(e)), v = (e, t, s) => {
85
89
  if (t.has(e))
86
90
  throw TypeError("Cannot add the same private member more than once");
87
91
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
88
- }, F = (e, t, s, h) => (W(e, t, "write to private field"), h ? h.call(e, s) : t.set(e, s), s), n, y, w, P, z, C;
89
- let L = class extends T {
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
+ let W = class extends T {
90
94
  constructor() {
91
- super(), f(this, n, void 0), f(this, y, new u(this, "--damping", 20)), f(this, w, new u(this, "--mass", 0)), f(this, P, new u(this, "--stiffness", 0)), f(this, z, new u(this, "--cartesian", !1)), f(this, C, new u(this, "--normalize", !1)), F(this, n, new G({
95
+ super(), v(this, n, void 0), v(this, u, new d(this, "--damping", 20)), v(this, w, new d(this, "--mass", 0)), v(this, _, new d(this, "--stiffness", 0)), v(this, z, new d(this, "--cartesian", !1)), v(this, C, new d(this, "--normalize", !1)), q(this, n, new G({
92
96
  element: this
93
- })), i(this, y).subscribe((e) => {
97
+ })), i(this, u).subscribe((e) => {
94
98
  i(this, n).x.damping = e.current, i(this, n).y.damping = e.current, i(this, n).z.damping = e.current;
95
99
  }), i(this, z).subscribe((e) => {
96
100
  i(this, n).cartesian = e.current;
@@ -98,7 +102,7 @@ let L = class extends T {
98
102
  i(this, n).normalize = e.current;
99
103
  }), i(this, w).subscribe((e) => {
100
104
  i(this, n).x.mass = e.current, i(this, n).y.mass = e.current, i(this, n).z.mass = e.current;
101
- }), i(this, P).subscribe((e) => {
105
+ }), i(this, _).subscribe((e) => {
102
106
  i(this, n).x.stiffness = e.current, i(this, n).y.stiffness = e.current, i(this, n).z.stiffness = e.current;
103
107
  }), i(this, n).x.subscribe((e) => {
104
108
  this.style.setProperty("--x", e.current.toString());
@@ -109,22 +113,22 @@ let L = class extends T {
109
113
  });
110
114
  }
111
115
  connectedCallback() {
112
- i(this, n).connect(), i(this, y).observe(), i(this, w).observe(), i(this, P).observe();
116
+ i(this, n).connect(), i(this, u).observe(), i(this, w).observe(), i(this, _).observe();
113
117
  }
114
118
  disconnectedCallback() {
115
- i(this, n).disconnect(), i(this, y).unobserve(), i(this, w).unobserve(), i(this, P).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
119
+ i(this, n).disconnect(), i(this, u).unobserve(), i(this, w).unobserve(), i(this, _).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
116
120
  }
117
121
  };
118
122
  n = /* @__PURE__ */ new WeakMap();
119
- y = /* @__PURE__ */ new WeakMap();
123
+ u = /* @__PURE__ */ new WeakMap();
120
124
  w = /* @__PURE__ */ new WeakMap();
121
- P = /* @__PURE__ */ new WeakMap();
125
+ _ = /* @__PURE__ */ new WeakMap();
122
126
  z = /* @__PURE__ */ new WeakMap();
123
127
  C = /* @__PURE__ */ new WeakMap();
124
- L = B([
128
+ W = Y([
125
129
  A("e-pointer")
126
- ], L);
130
+ ], W);
127
131
  export {
128
132
  G as Pointer,
129
- L as PointerElement
133
+ W as PointerElement
130
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.4.21",
3
+ "version": "0.4.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"