aptechka 0.4.27 → 0.4.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.4.27",
3
+ "version": "0.4.29",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -1 +0,0 @@
1
- "use strict";var P=(r,n,e)=>{if(!n.has(r))throw TypeError("Cannot "+e)};var t=(r,n,e)=>(P(r,n,"read from private field"),e?e.call(r):n.get(r)),h=(r,n,e)=>{if(n.has(r))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(r):n.set(r,e)},i=(r,n,e,a)=>(P(r,n,"write to private field"),a?a.call(r,e):n.set(r,e),e);const u=require("./browser-CpzFX2xg.cjs"),A=require("./dom-JBOkFLTh.cjs");require("./path-data-polyfill-CXsOR7Oc.cjs");const T=require("./gestures-DHLrn6Q8.cjs"),W=require("./number-yVpzMdbQ.cjs"),X=require("./notifier/index.cjs"),B=require("./ticker/index.cjs"),Y=require("./order/index.cjs");var q;class v{constructor(){h(this,q,new X.Notifier)}get changeEvent(){return t(this,q)}}q=new WeakMap;var f,l,c,L;class K extends v{constructor(e){super();h(this,f,null);h(this,l,null);h(this,c,"offsetHeight");h(this,L,e=>{const a=e.shiftKey?-1:1;let s;e.code==="Space"?s=a*t(this,l)[t(this,c)]*.4:e.code==="ArrowLeft"?s=-1*t(this,l)[t(this,c)]*.2:e.code==="ArrowRight"?s=1*t(this,l)[t(this,c)]*.2:e.code==="ArrowUp"?s=-1*t(this,l)[t(this,c)]*.2:e.code==="ArrowDown"?s=1*t(this,l)[t(this,c)]*.2:e.code==="PageUp"?s=-1*t(this,l)[t(this,c)]:e.code==="PageDown"?s=1*t(this,l)[t(this,c)]:e.code==="Home"?s=0:e.code==="End"&&(s=t(this,c)==="offsetWidth"?t(this,l).scrollWidth:t(this,l).scrollHeight),s&&(e.stopPropagation(),this.changeEvent.notify("keyboard",s))});u.isBrowser&&(i(this,f,e!=null&&e.element&&A.getElement(e.element)||window),i(this,l,t(this,f)instanceof HTMLElement?t(this,f):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,c,e==="width"?"offsetWidth":"offsetHeight")}connect(){u.isBrowser&&t(this,f).addEventListener("keydown",t(this,L))}disconnect(){u.isBrowser&&t(this,f).removeEventListener("keydown",t(this,L))}}f=new WeakMap,l=new WeakMap,c=new WeakMap,L=new WeakMap;var x,o,E,M;class R extends v{constructor(e){super();h(this,x,null);h(this,o,void 0);h(this,E,void 0);h(this,M,e=>{let a=0;if(e.preventDefault(),!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*.5||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*.5))if(a=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const s=Date.now();if(s-t(this,E)>40&&(a=100*Math.sign(a)),i(this,E,s),Math.abs(a)<100||t(this,o))return;this.changeEvent.notify("wheel",a),i(this,o,setTimeout(()=>{i(this,o,void 0)},80))}else this.changeEvent.notify("wheel",a)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,E,Date.now()),u.isBrowser&&i(this,x,e!=null&&e.element&&A.getElement(e.element)||window)}connect(){u.isBrowser&&t(this,x).addEventListener("wheel",t(this,M),{passive:!1})}disconnect(){u.isBrowser&&(t(this,x).removeEventListener("wheel",t(this,M)),clearTimeout(t(this,o)))}}x=new WeakMap,o=new WeakMap,E=new WeakMap,M=new WeakMap;var b,m,y,d,k,g;const w=class w extends v{constructor(e){super();h(this,m,null);h(this,y,!1);h(this,d,0);h(this,k,e=>{if(e.composedPath().find(s=>s instanceof HTMLElement&&s.hasAttribute("drag-dead-zone")))return;this.swipe||B.ticker.unsubscribe(t(this,g));let a=e;i(this,d,0),document.documentElement.classList.add("grabbing"),T.setupDrag(s=>{if(t(this,y)||t(w,b)&&t(w,b)!==t(this,m))return;this.swipe&&i(this,y,!0);const C=a.x-s.x,D=a.y-s.y;this.axis==="x"?i(this,d,C):i(this,d,D),a=s,(this.axis==="x"&&Math.abs(C)>Math.abs(D)||this.axis==="y"&&Math.abs(D)>Math.abs(C))&&(i(w,b,t(this,m)),this.changeEvent.notify("drag",t(this,d)))},()=>{i(w,b,null),this.swipe||(i(this,d,t(this,d)*3),B.ticker.subscribe(t(this,g),{order:Y.TICK_ORDER.SCROLL-1})),document.documentElement.classList.remove("grabbing"),i(this,y,!1)})});h(this,g,()=>{t(this,d)||B.ticker.unsubscribe(t(this,g)),i(this,d,t(this,d)*.95),i(this,d,W.preciseNumber(t(this,d),3)),this.changeEvent.notify("drag",t(this,d))});this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,u.isBrowser&&i(this,m,e!=null&&e.element&&A.getElement(e.element)||document.documentElement)}connect(){u.isBrowser&&t(this,m).addEventListener("pointerdown",t(this,k))}disconnect(){u.isBrowser&&(t(this,m).removeEventListener("pointerdown",t(this,k)),B.ticker.unsubscribe(t(this,g)))}};b=new WeakMap,m=new WeakMap,y=new WeakMap,d=new WeakMap,k=new WeakMap,g=new WeakMap,h(w,b,null);let H=w;exports.Controls=v;exports.DragControls=H;exports.KeyboardControls=K;exports.WheelControls=R;
@@ -1,147 +0,0 @@
1
- var W = (h, r, e) => {
2
- if (!r.has(h))
3
- throw TypeError("Cannot " + e);
4
- };
5
- var t = (h, r, e) => (W(h, r, "read from private field"), e ? e.call(h) : r.get(h)), a = (h, r, e) => {
6
- if (r.has(h))
7
- throw TypeError("Cannot add the same private member more than once");
8
- r instanceof WeakSet ? r.add(h) : r.set(h, e);
9
- }, i = (h, r, e, n) => (W(h, r, "write to private field"), n ? n.call(h, e) : r.set(h, e), e);
10
- import { i as f } from "./browser-0zX67oeU.js";
11
- import { g as P } from "./dom-0S_WDL4g.js";
12
- import "./path-data-polyfill-DgeDWYeI.js";
13
- import { s as Y } from "./gestures-D2Fdra_G.js";
14
- import { p as C } from "./number-Bo5RdrA1.js";
15
- import { Notifier as K } from "./notifier/index.js";
16
- import { ticker as D } from "./ticker/index.js";
17
- import { TICK_ORDER as R } from "./order/index.js";
18
- var k;
19
- class T {
20
- constructor() {
21
- a(this, k, new K());
22
- }
23
- get changeEvent() {
24
- return t(this, k);
25
- }
26
- }
27
- k = new WeakMap();
28
- var m, l, c, L;
29
- class F extends T {
30
- constructor(e) {
31
- super();
32
- a(this, m, null);
33
- a(this, l, null);
34
- a(this, c, "offsetHeight");
35
- a(this, L, (e) => {
36
- const n = e.shiftKey ? -1 : 1;
37
- let s;
38
- e.code === "Space" ? s = n * t(this, l)[t(this, c)] * 0.4 : e.code === "ArrowLeft" ? s = -1 * t(this, l)[t(this, c)] * 0.2 : e.code === "ArrowRight" ? s = 1 * t(this, l)[t(this, c)] * 0.2 : e.code === "ArrowUp" ? s = -1 * t(this, l)[t(this, c)] * 0.2 : e.code === "ArrowDown" ? s = 1 * t(this, l)[t(this, c)] * 0.2 : e.code === "PageUp" ? s = -1 * t(this, l)[t(this, c)] : e.code === "PageDown" ? s = 1 * t(this, l)[t(this, c)] : e.code === "Home" ? s = 0 : e.code === "End" && (s = t(this, c) === "offsetWidth" ? t(this, l).scrollWidth : t(this, l).scrollHeight), s && (e.stopPropagation(), this.changeEvent.notify("keyboard", s));
39
- });
40
- f && (i(this, m, e != null && e.element && P(e.element) || window), i(this, l, t(this, m) instanceof HTMLElement ? t(this, m) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
41
- }
42
- set dimension(e) {
43
- i(this, c, e === "width" ? "offsetWidth" : "offsetHeight");
44
- }
45
- connect() {
46
- f && t(this, m).addEventListener(
47
- "keydown",
48
- t(this, L)
49
- );
50
- }
51
- disconnect() {
52
- f && t(this, m).removeEventListener(
53
- "keydown",
54
- t(this, L)
55
- );
56
- }
57
- }
58
- m = new WeakMap(), l = new WeakMap(), c = new WeakMap(), L = new WeakMap();
59
- var x, b, E, M;
60
- class G extends T {
61
- constructor(e) {
62
- super();
63
- a(this, x, null);
64
- a(this, b, void 0);
65
- a(this, E, void 0);
66
- a(this, M, (e) => {
67
- let n = 0;
68
- if (e.preventDefault(), !(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) * 0.5 || this.axis === "y" && Math.abs(e.deltaX) > Math.abs(e.deltaY) * 0.5))
69
- if (n = (this.axis === "max" ? Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
70
- const s = Date.now();
71
- if (s - t(this, E) > 40 && (n = 100 * Math.sign(n)), i(this, E, s), Math.abs(n) < 100 || t(this, b))
72
- return;
73
- this.changeEvent.notify("wheel", n), i(this, b, setTimeout(() => {
74
- i(this, b, void 0);
75
- }, 80));
76
- } else
77
- this.changeEvent.notify("wheel", n);
78
- });
79
- this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, E, Date.now()), f && i(this, x, e != null && e.element && P(e.element) || window);
80
- }
81
- connect() {
82
- f && t(this, x).addEventListener(
83
- "wheel",
84
- t(this, M),
85
- {
86
- passive: !1
87
- }
88
- );
89
- }
90
- disconnect() {
91
- f && (t(this, x).removeEventListener(
92
- "wheel",
93
- t(this, M)
94
- ), clearTimeout(t(this, b)));
95
- }
96
- }
97
- x = new WeakMap(), b = new WeakMap(), E = new WeakMap(), M = new WeakMap();
98
- var o, u, y, d, v, g;
99
- const w = class w extends T {
100
- constructor(e) {
101
- super();
102
- a(this, u, null);
103
- a(this, y, !1);
104
- a(this, d, 0);
105
- a(this, v, (e) => {
106
- if (e.composedPath().find(
107
- (s) => s instanceof HTMLElement && s.hasAttribute("drag-dead-zone")
108
- ))
109
- return;
110
- this.swipe || D.unsubscribe(t(this, g));
111
- let n = e;
112
- i(this, d, 0), document.documentElement.classList.add("grabbing"), Y(
113
- (s) => {
114
- if (t(this, y) || t(w, o) && t(w, o) !== t(this, u))
115
- return;
116
- this.swipe && i(this, y, !0);
117
- const H = n.x - s.x, A = n.y - s.y;
118
- this.axis === "x" ? i(this, d, H) : i(this, d, A), n = s, (this.axis === "x" && Math.abs(H) > Math.abs(A) || this.axis === "y" && Math.abs(A) > Math.abs(H)) && (i(w, o, t(this, u)), this.changeEvent.notify("drag", t(this, d)));
119
- },
120
- () => {
121
- i(w, o, null), this.swipe || (i(this, d, t(this, d) * 3), D.subscribe(t(this, g), { order: R.SCROLL - 1 })), document.documentElement.classList.remove("grabbing"), i(this, y, !1);
122
- }
123
- );
124
- });
125
- a(this, g, () => {
126
- t(this, d) || D.unsubscribe(t(this, g)), i(this, d, t(this, d) * 0.95), i(this, d, C(t(this, d), 3)), this.changeEvent.notify("drag", t(this, d));
127
- });
128
- this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, f && i(this, u, e != null && e.element && P(e.element) || document.documentElement);
129
- }
130
- connect() {
131
- f && t(this, u).addEventListener("pointerdown", t(this, v));
132
- }
133
- disconnect() {
134
- f && (t(this, u).removeEventListener(
135
- "pointerdown",
136
- t(this, v)
137
- ), D.unsubscribe(t(this, g)));
138
- }
139
- };
140
- o = new WeakMap(), u = new WeakMap(), y = new WeakMap(), d = new WeakMap(), v = new WeakMap(), g = new WeakMap(), a(w, o, null);
141
- let X = w;
142
- export {
143
- T as C,
144
- X as D,
145
- F as K,
146
- G as W
147
- };
@@ -1,12 +0,0 @@
1
- import { Controls } from './Controls';
2
-
3
- export interface LinearControlsOptions {
4
- speed?: number;
5
- }
6
- export declare class LinearControls extends Controls {
7
- #private;
8
- speed: number;
9
- constructor(options?: LinearControlsOptions);
10
- connect(): void;
11
- disconnect(): void;
12
- }