aptechka 0.4.37 → 0.4.38

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,8 +1,10 @@
1
+ import { Pointer } from './Pointer';
1
2
  import { CustomElement } from '../custom-element';
2
3
 
3
4
  export declare class PointerElement extends CustomElement {
4
5
  #private;
5
6
  constructor();
7
+ get pointer(): Pointer;
6
8
  protected connectedCallback(): void;
7
9
  protected disconnectedCallback(): void;
8
10
  }
@@ -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.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;
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 g=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 g.Damped(0,e.damped)),m(this,d,new g.Damped(0,e.damped)),m(this,l,new g.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,C,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,C,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,C).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())})}get pointer(){return r(this,n)}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;C=new WeakMap;z=new WeakMap;exports.PointerElement=A([M.define("e-pointer")],exports.PointerElement);exports.Pointer=W;
@@ -6,17 +6,17 @@ 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
- }, y = (e, t, s, h) => (E(e, t, "write to private field"), h ? h.call(e, s) : t.set(e, s), s);
9
+ }, u = (e, t, s, h) => (E(e, t, "write to private field"), h ? h.call(e, s) : t.set(e, s), s);
10
10
  import "../Store-Cd-E5W1z.js";
11
11
  import { s as k, n as D } from "../coordinates-CgdGoSYs.js";
12
12
  import { g as O } from "../dom-0S_WDL4g.js";
13
13
  import { c as L } from "../math-BOBiC4TN.js";
14
14
  import "../path-data-polyfill-DgeDWYeI.js";
15
15
  import "../ticker/index.js";
16
- import { D as g } from "../Damped-BJgyFENo.js";
16
+ import { D as b } from "../Damped-BJgyFENo.js";
17
17
  import { CustomElement as T, define as A } from "../custom-element/index.js";
18
- import { CSSProperty as d } from "../css-property/index.js";
19
- var a, m, v, l, x, P, S;
18
+ import { CSSProperty as y } from "../css-property/index.js";
19
+ var a, m, v, l, x, P, g;
20
20
  class G {
21
21
  constructor(t) {
22
22
  p(this, a, void 0);
@@ -29,7 +29,7 @@ class G {
29
29
  p(this, P, (t) => {
30
30
  r(this, l).set(0);
31
31
  });
32
- p(this, S, (t) => {
32
+ p(this, g, (t) => {
33
33
  const s = {
34
34
  x: t.clientX,
35
35
  y: t.clientY
@@ -50,7 +50,7 @@ class G {
50
50
  }
51
51
  r(this, m).set(o.x), r(this, v).set(o.y);
52
52
  });
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;
53
+ u(this, a, O(t.element)), u(this, m, new b(0, t.damped)), u(this, v, new b(0, t.damped)), u(this, l, new b(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);
@@ -65,7 +65,7 @@ class G {
65
65
  return r(this, l);
66
66
  }
67
67
  connect() {
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));
68
+ r(this, a).addEventListener("pointerenter", r(this, x)), r(this, a).addEventListener("pointerleave", r(this, P)), r(this, a).addEventListener("pointermove", r(this, g));
69
69
  }
70
70
  disconnect() {
71
71
  r(this, a).removeEventListener(
@@ -74,13 +74,13 @@ 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, m).reset(), r(this, v).reset(), r(this, l).reset();
77
+ ), r(this, a).removeEventListener("pointermove", r(this, g)), r(this, m).reset(), r(this, v).reset(), r(this, l).reset();
78
78
  }
79
79
  }
80
- a = new WeakMap(), m = new WeakMap(), v = new WeakMap(), l = new WeakMap(), x = new WeakMap(), P = new WeakMap(), S = new WeakMap();
80
+ a = new WeakMap(), m = new WeakMap(), v = new WeakMap(), l = new WeakMap(), x = new WeakMap(), P = new WeakMap(), g = new WeakMap();
81
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);
82
+ for (var o = h > 1 ? void 0 : h ? X(t, s) : t, c = e.length - 1, S; c >= 0; c--)
83
+ (S = e[c]) && (o = (h ? S(t, s, o) : S(o)) || o);
84
84
  return h && o && H(t, s, o), o;
85
85
  }, M = (e, t, s) => {
86
86
  if (!t.has(e))
@@ -89,12 +89,12 @@ var H = Object.defineProperty, X = Object.getOwnPropertyDescriptor, Y = (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
- }, 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;
92
+ }, q = (e, t, s, h) => (M(e, t, "write to private field"), h ? h.call(e, s) : t.set(e, s), s), n, d, w, _, z, C;
93
93
  let W = class extends T {
94
94
  constructor() {
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({
95
+ super(), f(this, n, void 0), f(this, d, new y(this, "--damping", 20)), f(this, w, new y(this, "--mass", 0)), f(this, _, new y(this, "--stiffness", 0)), f(this, z, new y(this, "--cartesian", !1)), f(this, C, new y(this, "--normalize", !1)), q(this, n, new G({
96
96
  element: this
97
- })), i(this, u).subscribe((e) => {
97
+ })), i(this, d).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;
99
99
  }), i(this, z).subscribe((e) => {
100
100
  i(this, n).cartesian = e.current;
@@ -112,15 +112,18 @@ let W = class extends T {
112
112
  this.style.setProperty("--z", e.current.toString());
113
113
  });
114
114
  }
115
+ get pointer() {
116
+ return i(this, n);
117
+ }
115
118
  connectedCallback() {
116
- i(this, n).connect(), i(this, u).observe(), i(this, w).observe(), i(this, _).observe();
119
+ i(this, n).connect(), i(this, d).observe(), i(this, w).observe(), i(this, _).observe();
117
120
  }
118
121
  disconnectedCallback() {
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");
122
+ i(this, n).disconnect(), i(this, d).unobserve(), i(this, w).unobserve(), i(this, _).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
120
123
  }
121
124
  };
122
125
  n = /* @__PURE__ */ new WeakMap();
123
- u = /* @__PURE__ */ new WeakMap();
126
+ d = /* @__PURE__ */ new WeakMap();
124
127
  w = /* @__PURE__ */ new WeakMap();
125
128
  _ = /* @__PURE__ */ new WeakMap();
126
129
  z = /* @__PURE__ */ new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.4.37",
3
+ "version": "0.4.38",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"