aptechka 0.20.0 → 0.21.0

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,43 +0,0 @@
1
- var F = Object.defineProperty, o = Object.defineProperties;
2
- var O = Object.getOwnPropertyDescriptors;
3
- var u = Object.getOwnPropertySymbols;
4
- var b = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
5
- var c = (t) => {
6
- throw TypeError(t);
7
- };
8
- var l = (t, i, e) => i in t ? F(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e, d = (t, i) => {
9
- for (var e in i || (i = {}))
10
- b.call(i, e) && l(t, e, i[e]);
11
- if (u)
12
- for (var e of u(i))
13
- x.call(i, e) && l(t, e, i[e]);
14
- return t;
15
- }, f = (t, i) => o(t, O(i));
16
- var p = (t, i, e) => i.has(t) || c("Cannot " + e);
17
- var n = (t, i, e) => (p(t, i, "read from private field"), e ? e.call(t) : i.get(t)), m = (t, i, e) => i.has(t) ? c("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), h = (t, i, e, a) => (p(t, i, "write to private field"), a ? a.call(t, e) : i.set(t, e), e);
18
- import { l as S } from "./easings-BKi40vHz.js";
19
- import { n as A, c as T, p as q } from "./polyfills-AItxku8u.js";
20
- import { A as w } from "./Animation-CuR3fbKl.js";
21
- var s, r;
22
- class j extends w {
23
- constructor(e, a) {
24
- super(e || 0, a);
25
- m(this, s, S);
26
- m(this, r, 1e3);
27
- this.updateOptions(f(d({}, a), { equalize: !0 }));
28
- }
29
- updateOptions(e) {
30
- super.updateOptions(e), h(this, s, A(e == null ? void 0 : e.easing, n(this, s))), h(this, r, A(e == null ? void 0 : e.duration, n(this, r)));
31
- }
32
- handleAnimationFrame(e) {
33
- const a = e.timeElapsedSinceSubscription / 1e3 / (n(this, r) / 1e3), g = n(this, s).call(this, T(a, 0, 1));
34
- this.current = q(this.from + (this.target - this.from) * g, 6), a > 1 && this.unlistenAnimationFrame();
35
- }
36
- start() {
37
- this.unlistenAnimationFrame(), this.listenAnimationFrame();
38
- }
39
- }
40
- s = new WeakMap(), r = new WeakMap();
41
- export {
42
- j as T
43
- };
@@ -1,24 +0,0 @@
1
- function s(t, h, n = !1) {
2
- let i = t.x - h.width / 2, g = h.height / 2 - t.y;
3
- return n && (i = i / (h.width / 2), g = g / (h.height / 2)), { x: i, y: g };
4
- }
5
- function x(t, h) {
6
- const n = t.x / h.width, i = t.y / h.height;
7
- return { x: n, y: i };
8
- }
9
- function e(t, h) {
10
- return h = h || {
11
- x: 0,
12
- y: 0,
13
- width: document.documentElement.offsetWidth,
14
- height: innerHeight
15
- }, {
16
- x: (t.x - h.x) / h.width * h.width,
17
- y: (t.y - h.y) / h.height * h.height
18
- };
19
- }
20
- export {
21
- e as g,
22
- x as n,
23
- s
24
- };
@@ -1 +0,0 @@
1
- "use strict";function o(t,i,n=!1){let h=t.x-i.width/2,e=i.height/2-t.y;return n&&(h=h/(i.width/2),e=e/(i.height/2)),{x:h,y:e}}function s(t,i){const n=t.x/i.width,h=t.y/i.height;return{x:n,y:h}}function g(t,i){return i=i||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(t.x-i.x)/i.width*i.width,y:(t.y-i.y)/i.height*i.height}}exports.getPointerPosition=g;exports.normalize=s;exports.screenToCartesian=o;
@@ -1,22 +0,0 @@
1
- import { Damped, DampedOptions } from '../animation';
2
- import { ElementOrSelector } from '../utils';
3
- export interface PointerParameters {
4
- element: ElementOrSelector<HTMLElement>;
5
- damped?: DampedOptions;
6
- cartesian?: boolean;
7
- normalize?: boolean;
8
- }
9
- export declare class Pointer {
10
- #private;
11
- constructor(parameters: PointerParameters);
12
- get element(): HTMLElement;
13
- get x(): Damped;
14
- get y(): Damped;
15
- get z(): Damped;
16
- get cartesian(): boolean;
17
- set cartesian(value: boolean);
18
- get normalize(): boolean;
19
- set normalize(value: boolean);
20
- connect(): void;
21
- disconnect(): void;
22
- }
@@ -1,13 +0,0 @@
1
- import { Pointer } from './Pointer';
2
- export declare class PointerElement extends HTMLElement {
3
- #private;
4
- constructor();
5
- get pointer(): Pointer;
6
- protected connectedCallback(): void;
7
- protected disconnectedCallback(): void;
8
- }
9
- declare global {
10
- interface HTMLElementTagNameMap {
11
- 'e-pointer': PointerElement;
12
- }
13
- }
@@ -1 +0,0 @@
1
- "use strict";var A=Object.defineProperty;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var T=i=>{throw TypeError(i)};var M=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,_=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&M(i,t,s[t]);if(D)for(var t of D(s))G.call(s,t)&&M(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||T("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?T("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,l)=>(k(i,s,"write to private field"),l?l.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-CDb6RMce.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),H=require("../polyfills-Caa6z-Ay.cjs");require("../ticker/index.cjs");const R=require("../Damped-C236fv4v.cjs"),j=require("../element-resizer/index.cjs"),B=require("../window-resizer/index.cjs"),P=require("../css-property/index.cjs");var o,m,a,y,d,u,b,x,f,w,C,p;class O{constructor(s){n(this,o);n(this,m);n(this,a);n(this,y);n(this,d);n(this,u);n(this,b,0);n(this,x,0);n(this,f,s=>{e(this,y).set(1)});n(this,w,s=>{e(this,y).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),l={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,d)){const z=q.screenToCartesian(h,l);h.x=z.x,h.y=z.y}if(e(this,u)){const z=q.normalize(h,l);h.x=H.clamp(z.x*2,-1,1),h.y=H.clamp(z.y*2,-1,1)}e(this,m).set(h.x),e(this,a).set(h.y)});n(this,p,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,l=0,h=0;e(this,d)?e(this,u)?(s=-1,t=1,l=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,l=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,u)?(s=0,t=1,l=0,h=1):(s=0,t=e(this,b),l=0,h=e(this,x)),e(this,m).min=s,e(this,m).max=t,e(this,a).min=l,e(this,a).max=h});c(this,o,I.getElement(s.element)),c(this,m,new R.Damped(0,s.damped)),c(this,a,new R.Damped(0,s.damped)),c(this,y,new R.Damped(0,_({min:0,max:1},s.damped))),c(this,d,s.cartesian||!1),c(this,u,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,m)}get y(){return e(this,a)}get z(){return e(this,y)}get cartesian(){return e(this,d)}set cartesian(s){c(this,d,s),e(this,p).call(this)}get normalize(){return e(this,u)}set normalize(s){c(this,u,s),e(this,p).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),j.elementResizer.subscribe(e(this,o),e(this,p)),B.windowResizer.subscribe(e(this,p))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),j.elementResizer.unsubscribe(e(this,p)),B.windowResizer.unsubscribe(e(this,p)),e(this,m).reset(),e(this,a).reset(),e(this,y).reset()}}o=new WeakMap,m=new WeakMap,a=new WeakMap,y=new WeakMap,d=new WeakMap,u=new WeakMap,b=new WeakMap,x=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,p=new WeakMap;var r,g,v,S,E,L;class W extends HTMLElement{constructor(){super();n(this,r);n(this,g,new P.CSSProperty(this,"--damping",20));n(this,v,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new O({element:this})),e(this,g).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,v).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,g).observe(),e(this,v).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,g=new WeakMap,v=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;customElements.get("e-pointer")||customElements.define("e-pointer",W);exports.Pointer=O;exports.PointerElement=W;
@@ -1,2 +0,0 @@
1
- export { Pointer, type PointerParameters } from './Pointer';
2
- export { PointerElement } from './PointerElement';
@@ -1,151 +0,0 @@
1
- var q = Object.defineProperty;
2
- var k = Object.getOwnPropertySymbols;
3
- var A = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
4
- var H = (i) => {
5
- throw TypeError(i);
6
- };
7
- var D = (i, s, e) => s in i ? q(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, M = (i, s) => {
8
- for (var e in s || (s = {}))
9
- A.call(s, e) && D(i, e, s[e]);
10
- if (k)
11
- for (var e of k(s))
12
- F.call(s, e) && D(i, e, s[e]);
13
- return i;
14
- };
15
- var T = (i, s, e) => s.has(i) || H("Cannot " + e);
16
- var t = (i, s, e) => (T(i, s, "read from private field"), e ? e.call(i) : s.get(i)), n = (i, s, e) => s.has(i) ? H("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), c = (i, s, e, m) => (T(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e);
17
- import "../Store-OTdcl6SX.js";
18
- import { g as G, s as I, n as J } from "../coordinates-CgdGoSYs.js";
19
- import { g as K } from "../dom-0S_WDL4g.js";
20
- import { c as B } from "../polyfills-AItxku8u.js";
21
- import "../ticker/index.js";
22
- import { D as R } from "../Damped-OSAezqOR.js";
23
- import { elementResizer as W } from "../element-resizer/index.js";
24
- import { windowResizer as j } from "../window-resizer/index.js";
25
- import { CSSProperty as P } from "../css-property/index.js";
26
- var o, a, l, y, b, u, d, f, S, w, E, p;
27
- class N {
28
- constructor(s) {
29
- n(this, o);
30
- n(this, a);
31
- n(this, l);
32
- n(this, y);
33
- n(this, b);
34
- n(this, u);
35
- n(this, d, 0);
36
- n(this, f, 0);
37
- n(this, S, (s) => {
38
- t(this, y).set(1);
39
- });
40
- n(this, w, (s) => {
41
- t(this, y).set(0);
42
- });
43
- n(this, E, (s) => {
44
- const e = G(s, t(this, o).getBoundingClientRect()), m = {
45
- width: t(this, d),
46
- height: t(this, f)
47
- }, h = {
48
- x: e.x,
49
- y: e.y
50
- };
51
- if (t(this, b)) {
52
- const z = I(h, m);
53
- h.x = z.x, h.y = z.y;
54
- }
55
- if (t(this, u)) {
56
- const z = J(h, m);
57
- h.x = B(z.x * 2, -1, 1), h.y = B(z.y * 2, -1, 1);
58
- }
59
- t(this, a).set(h.x), t(this, l).set(h.y);
60
- });
61
- n(this, p, () => {
62
- c(this, d, this.element.clientWidth), c(this, f, this.element.clientHeight);
63
- let s = 0, e = 0, m = 0, h = 0;
64
- t(this, b) ? t(this, u) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, d) / 2 * -1, e = t(this, d) / 2 * 1, m = t(this, f) / 2 * -1, h = t(this, f) / 2 * 1) : t(this, u) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, d), m = 0, h = t(this, f)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
65
- });
66
- c(this, o, K(s.element)), c(this, a, new R(0, s.damped)), c(this, l, new R(0, s.damped)), c(this, y, new R(0, M({ min: 0, max: 1 }, s.damped))), c(this, b, s.cartesian || !1), c(this, u, s.normalize || !1);
67
- }
68
- get element() {
69
- return t(this, o);
70
- }
71
- get x() {
72
- return t(this, a);
73
- }
74
- get y() {
75
- return t(this, l);
76
- }
77
- get z() {
78
- return t(this, y);
79
- }
80
- get cartesian() {
81
- return t(this, b);
82
- }
83
- set cartesian(s) {
84
- c(this, b, s), t(this, p).call(this);
85
- }
86
- get normalize() {
87
- return t(this, u);
88
- }
89
- set normalize(s) {
90
- c(this, u, s), t(this, p).call(this);
91
- }
92
- connect() {
93
- t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), W.subscribe(t(this, o), t(this, p)), j.subscribe(t(this, p));
94
- }
95
- disconnect() {
96
- t(this, o).removeEventListener(
97
- "pointerenter",
98
- t(this, S)
99
- ), t(this, o).removeEventListener(
100
- "pointerleave",
101
- t(this, w)
102
- ), t(this, o).removeEventListener("pointermove", t(this, E)), W.unsubscribe(t(this, p)), j.unsubscribe(t(this, p)), t(this, a).reset(), t(this, l).reset(), t(this, y).reset();
103
- }
104
- }
105
- o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), y = new WeakMap(), b = new WeakMap(), u = new WeakMap(), d = new WeakMap(), f = new WeakMap(), S = new WeakMap(), w = new WeakMap(), E = new WeakMap(), p = new WeakMap();
106
- var r, g, v, x, L, C;
107
- class O extends HTMLElement {
108
- constructor() {
109
- super();
110
- n(this, r);
111
- n(this, g, new P(this, "--damping", 20));
112
- n(this, v, new P(this, "--mass", 0));
113
- n(this, x, new P(this, "--stiffness", 0));
114
- n(this, L, new P(this, "--cartesian", !1));
115
- n(this, C, new P(this, "--normalize", !1));
116
- c(this, r, new N({
117
- element: this
118
- })), t(this, g).subscribe((e) => {
119
- t(this, r).x.damping = e.current, t(this, r).y.damping = e.current, t(this, r).z.damping = e.current;
120
- }), t(this, L).subscribe((e) => {
121
- t(this, r).cartesian = e.current;
122
- }), t(this, C).subscribe((e) => {
123
- t(this, r).normalize = e.current;
124
- }), t(this, v).subscribe((e) => {
125
- t(this, r).x.mass = e.current, t(this, r).y.mass = e.current, t(this, r).z.mass = e.current;
126
- }), t(this, x).subscribe((e) => {
127
- t(this, r).x.stiffness = e.current, t(this, r).y.stiffness = e.current, t(this, r).z.stiffness = e.current;
128
- }), t(this, r).x.subscribe((e) => {
129
- this.style.setProperty("--x", e.current.toString());
130
- }), t(this, r).y.subscribe((e) => {
131
- this.style.setProperty("--y", e.current.toString());
132
- }), t(this, r).z.subscribe((e) => {
133
- this.style.setProperty("--z", e.current.toString());
134
- });
135
- }
136
- get pointer() {
137
- return t(this, r);
138
- }
139
- connectedCallback() {
140
- t(this, r).connect(), t(this, g).observe(), t(this, v).observe(), t(this, x).observe();
141
- }
142
- disconnectedCallback() {
143
- t(this, r).disconnect(), t(this, g).unobserve(), t(this, v).unobserve(), t(this, x).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
144
- }
145
- }
146
- r = new WeakMap(), g = new WeakMap(), v = new WeakMap(), x = new WeakMap(), L = new WeakMap(), C = new WeakMap();
147
- customElements.get("e-pointer") || customElements.define("e-pointer", O);
148
- export {
149
- N as Pointer,
150
- O as PointerElement
151
- };