aptechka 0.18.0 → 0.20.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.
Files changed (60) hide show
  1. package/lib/{Animation-w6BLTCum.js → Animation-CuR3fbKl.js} +3 -4
  2. package/lib/Animation-Dt4Kc5VA.cjs +1 -0
  3. package/lib/Damped-C236fv4v.cjs +1 -0
  4. package/lib/{Damped-DEHDEq-b.js → Damped-OSAezqOR.js} +16 -17
  5. package/lib/Tweened-B7zGiekd.cjs +1 -0
  6. package/lib/Tweened-DfDr-AYv.js +43 -0
  7. package/lib/animation/index.cjs +1 -1
  8. package/lib/animation/index.js +3 -3
  9. package/lib/controls/index.cjs +1 -1
  10. package/lib/controls/index.js +2 -2
  11. package/lib/need_redo_tweaker/index.cjs +3 -3
  12. package/lib/need_redo_tweaker/index.js +1 -2
  13. package/lib/pointer/index.cjs +1 -1
  14. package/lib/pointer/index.js +2 -2
  15. package/lib/polyfills-AItxku8u.js +76 -0
  16. package/lib/polyfills-Caa6z-Ay.cjs +1 -0
  17. package/lib/source/index.cjs +1 -5
  18. package/lib/source/index.d.ts +0 -1
  19. package/lib/source/index.js +67 -152
  20. package/lib/utils/index.cjs +1 -1
  21. package/lib/utils/index.js +168 -127
  22. package/package.json +1 -41
  23. package/lib/Animation-DI864E0i.cjs +0 -1
  24. package/lib/Damped-ipnDc0iX.cjs +0 -1
  25. package/lib/Tweened-B1TfANfR.cjs +0 -1
  26. package/lib/Tweened-C52xXDLY.js +0 -44
  27. package/lib/canvas/index.cjs +0 -1
  28. package/lib/canvas/index.d.ts +0 -34
  29. package/lib/canvas/index.js +0 -108
  30. package/lib/canvas-CU5Xjahf.cjs +0 -1
  31. package/lib/canvas-DeZ0SLUJ.js +0 -34
  32. package/lib/image/index.cjs +0 -1
  33. package/lib/image/index.d.ts +0 -10
  34. package/lib/image/index.js +0 -15
  35. package/lib/jss-CjccJC-K.js +0 -21
  36. package/lib/jss-GJLvaNfT.cjs +0 -1
  37. package/lib/math-BOBiC4TN.js +0 -45
  38. package/lib/math-GDWEqu7y.cjs +0 -1
  39. package/lib/polyfills-CM4SCDTt.cjs +0 -1
  40. package/lib/polyfills-X6KXuHg-.js +0 -33
  41. package/lib/scroll/ScrollBulletButtonsElement.d.ts +0 -11
  42. package/lib/scroll/ScrollButtonElement.d.ts +0 -5
  43. package/lib/scroll/ScrollElement.d.ts +0 -81
  44. package/lib/scroll/ScrollSection.d.ts +0 -22
  45. package/lib/scroll/ScrollSegmentElement.d.ts +0 -62
  46. package/lib/scroll/ScrollSetButtonElement.d.ts +0 -9
  47. package/lib/scroll/ScrollStepButtonElement.d.ts +0 -9
  48. package/lib/scroll/ScrollUserElement.d.ts +0 -6
  49. package/lib/scroll/ScrollbarElement.d.ts +0 -13
  50. package/lib/scroll/index.cjs +0 -1
  51. package/lib/scroll/index.d.ts +0 -6
  52. package/lib/scroll/index.js +0 -1098
  53. package/lib/sequence/index.cjs +0 -1
  54. package/lib/sequence/index.d.ts +0 -20
  55. package/lib/sequence/index.js +0 -158
  56. package/lib/source/SourceElement.d.ts +0 -24
  57. package/lib/test/starting-style/index.d.ts +0 -1
  58. package/lib/video/index.cjs +0 -1
  59. package/lib/video/index.d.ts +0 -21
  60. package/lib/video/index.js +0 -55
@@ -1,34 +1,32 @@
1
- import { a as O, p as b } from "../attributes-69we3byR.js";
2
- import { i as I } from "../browser-0zX67oeU.js";
3
- import { a as T, c as A, f as Q, m as W } from "../canvas-DeZ0SLUJ.js";
4
- import { g as M, n as R, s as z } from "../coordinates-CgdGoSYs.js";
5
- import { f as v, b as $, a as j, g as N } from "../dom-0S_WDL4g.js";
6
- import { c as U, n as F, f as K, p as q, b as G, i as H, m as J, e as L, g as Y, j as Z, d as X, o as _, a as tt, h as et, k as st, l as at } from "../easings-BKi40vHz.js";
7
- import { b as nt, f as rt, c as it, a as ct, d as ut, g as lt, e as ft, i as pt, m as mt, h as ht, o as dt, p as gt } from "../object-DOa0yKM9.js";
8
- import { d as St, t as yt } from "../function-C10DGppn.js";
9
- import { s as Et } from "../gestures-D2Fdra_G.js";
10
- import { c as Ot, s as bt } from "../jss-CjccJC-K.js";
11
- import { g as It, a as Pt, b as Tt } from "../layout-HoBT_Da2.js";
12
- import { e as Qt, f as Wt, c as Dt, d as Mt, l as Rt, m as zt, r as kt, b as vt, a as $t, s as jt } from "../math-BOBiC4TN.js";
13
- import { n as Vt, p as Ut, r as Ft, t as Kt } from "../polyfills-X6KXuHg-.js";
14
- import { c as Gt, a as Ht, g as Jt, i as Lt, k as Yt, s as Zt, t as Xt, u as _t } from "../string-f0Dnk0L1.js";
1
+ import { a as k, p as v } from "../attributes-69we3byR.js";
2
+ import { i as f } from "../browser-0zX67oeU.js";
3
+ import { g as W, n as j, s as N } from "../coordinates-CgdGoSYs.js";
4
+ import { f as U, b as F, a as K, g as q } from "../dom-0S_WDL4g.js";
5
+ import { c as J, n as Y, f as Z, p as X, b as _, i as H, m as L, e as tt, g as et, j as st, d as at, o as nt, a as ot, h as rt, k as it, l as ut } from "../easings-BKi40vHz.js";
6
+ import { b as lt, f as pt, c as ft, a as mt, d as dt, g as ht, e as gt, i as xt, m as yt, h as St, o as Ct, p as wt } from "../object-DOa0yKM9.js";
7
+ import { d as Et, t as Ot } from "../function-C10DGppn.js";
8
+ import { s as It } from "../gestures-D2Fdra_G.js";
9
+ import { c as m } from "../string-f0Dnk0L1.js";
10
+ import { a as Rt, g as At, i as Dt, k as Mt, s as Qt, t as $t, u as Tt } from "../string-f0Dnk0L1.js";
11
+ import { g as vt, a as zt, b as Wt } from "../layout-HoBT_Da2.js";
12
+ import { e as Nt, f as Vt, c as Ut, d as Ft, l as Kt, m as qt, n as Gt, p as Jt, r as Yt, g as Zt, b as Xt, a as _t, s as Ht, t as Lt } from "../polyfills-AItxku8u.js";
15
13
  import { g as ee, a as se } from "../style-j2TwriJ_.js";
16
- function u(t, e, ...s) {
14
+ function g(t, e, ...s) {
17
15
  return [...t.slice(0, e), ...s, ...t.slice(e)];
18
16
  }
19
- function l(t, e) {
17
+ function x(t, e) {
20
18
  const s = t.length;
21
19
  e = e % s;
22
20
  const a = new Array(s);
23
- for (let o = 0; o < s; o++) {
24
- const n = (o + e) % s;
25
- a[n] = t[o];
21
+ for (let n = 0; n < s; n++) {
22
+ const o = (n + e) % s;
23
+ a[o] = t[n];
26
24
  }
27
25
  return a;
28
26
  }
29
- function f(t, e = 2) {
27
+ function y(t, e = 2) {
30
28
  if (!+t) return "0 Bytes";
31
- const s = 1024, a = e < 0 ? 0 : e, o = [
29
+ const s = 1024, a = e < 0 ? 0 : e, n = [
32
30
  "Bytes",
33
31
  "KiB",
34
32
  "MiB",
@@ -38,152 +36,195 @@ function f(t, e = 2) {
38
36
  "EiB",
39
37
  "ZiB",
40
38
  "YiB"
41
- ], n = Math.floor(Math.log(t) / Math.log(s));
42
- return `${parseFloat((t / Math.pow(s, n)).toFixed(a))} ${o[n]}`;
39
+ ], o = Math.floor(Math.log(t) / Math.log(s));
40
+ return `${parseFloat((t / Math.pow(s, o)).toFixed(a))} ${n[o]}`;
41
+ }
42
+ function S(t, e) {
43
+ const s = t.measureText(e), a = s.actualBoundingBoxAscent + s.actualBoundingBoxDescent, n = s.width;
44
+ return {
45
+ height: a,
46
+ width: n
47
+ };
48
+ }
49
+ function C(t) {
50
+ return Math.floor(t) + 0.5;
51
+ }
52
+ function w(t, e, s, a, n, o) {
53
+ let r = t / e, c = s / a, i = 0, u = 0;
54
+ return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, r > c ? (i = a, u = a * r) : (u = s, i = s / r), [
55
+ (s - u) * n,
56
+ (a - i) * o,
57
+ u,
58
+ i
59
+ ];
43
60
  }
44
- function p(t, e) {
61
+ function B(t, e, s, a, n, o) {
62
+ let r = t / e, c = s / a, i = 0, u = 0;
63
+ return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, r > c ? (u = s, i = s / r) : (i = a, u = a * r), [
64
+ (s - u) * n,
65
+ (a - i) * o,
66
+ u,
67
+ i
68
+ ];
69
+ }
70
+ function E(t, e) {
45
71
  return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
46
72
  }
47
- function m(t, e) {
73
+ function O(t, e) {
48
74
  return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
49
75
  }
50
- function c(t, e) {
76
+ function l(t, e) {
51
77
  const s = t.styleMap.get(e);
52
78
  if (s) {
53
79
  const a = s.toString();
54
- return a.startsWith("var") ? c(t, a.slice(4, -1)) : a;
80
+ return a.startsWith("var") ? l(t, a.slice(4, -1)) : a;
55
81
  }
56
82
  }
57
- function h(...t) {
83
+ function b(...t) {
58
84
  const e = {};
59
85
  return Array.from(document.styleSheets).forEach((s) => {
60
86
  Array.from(s.cssRules).forEach((a) => {
61
- a instanceof CSSStyleRule && a.selectorText === ":root" && t.forEach((o) => {
62
- const n = c(a, o);
63
- n && (e[o] = n);
87
+ a instanceof CSSStyleRule && a.selectorText === ":root" && t.forEach((n) => {
88
+ const o = l(a, n);
89
+ o && (e[n] = o);
64
90
  });
65
91
  });
66
92
  }), t.forEach((s) => {
67
93
  e[s] || console.warn(`variable named ${s} not found`);
68
94
  }), e;
69
95
  }
70
- function d(t) {
96
+ function I(t) {
71
97
  const e = window.atob(t);
72
98
  return decodeURIComponent(window.escape(e));
73
99
  }
74
- function g(t) {
100
+ function P(t) {
75
101
  const e = window.unescape(encodeURIComponent(t));
76
102
  return window.btoa(e);
77
103
  }
78
- function x(t) {
104
+ function p(t) {
105
+ let e = "";
106
+ for (const s in t) {
107
+ const a = t[s];
108
+ typeof a == "object" ? (e += `${s} {`, e += p(a), e += "}") : e += `${m(s)}: ${a};`;
109
+ }
110
+ return e;
111
+ }
112
+ function R(t) {
113
+ if (f) {
114
+ const e = new CSSStyleSheet();
115
+ return e.replaceSync(p(t)), e;
116
+ }
117
+ return null;
118
+ }
119
+ function A(t) {
79
120
  return new Promise((e) => {
80
121
  setTimeout(() => {
81
122
  e();
82
123
  }, t);
83
124
  });
84
125
  }
85
- function S(t, e = "") {
126
+ function D(t, e = "") {
86
127
  e = e.endsWith("/") ? e.slice(0, -1) : e, t = t.replace(e, ""), t.startsWith("/") && (t = t.slice(1));
87
- const s = t.split("#"), a = s[0].split("?"), o = a[0].startsWith("/") ? a[0] : "/" + a[0], n = e + o, i = a == null ? void 0 : a[1], r = s == null ? void 0 : s[1];
128
+ const s = t.split("#"), a = s[0].split("?"), n = a[0].startsWith("/") ? a[0] : "/" + a[0], o = e + n, r = a == null ? void 0 : a[1], c = s == null ? void 0 : s[1];
88
129
  return {
89
- leaf: o,
90
- pathname: n,
91
- parameters: i,
92
- hash: r
130
+ leaf: n,
131
+ pathname: o,
132
+ parameters: r,
133
+ hash: c
93
134
  };
94
135
  }
95
- function y(t = "/") {
136
+ function M(t = "/") {
96
137
  return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
97
138
  }
98
- function C(t, e, s, a) {
99
- const o = s || location.search, n = a ? a.startsWith("#") ? a : "#" + a : "", i = o ? o.startsWith("?") ? o : "?" + o : "", r = `${e}${n}${i}`;
100
- t === "push" ? history.pushState(null, "", r) : t === "replace" && history.replaceState(null, "", r);
139
+ function Q(t, e, s, a) {
140
+ const n = s || location.search, o = a ? a.startsWith("#") ? a : "#" + a : "", r = n ? n.startsWith("?") ? n : "?" + n : "", c = `${e}${o}${r}`;
141
+ t === "push" ? history.pushState(null, "", c) : t === "replace" && history.replaceState(null, "", c);
101
142
  }
102
143
  export {
103
- Qt as calculateDistance,
104
- Wt as calculateDistanceWithRadius,
105
- Gt as camelToKebab,
106
- Ht as capitalize,
107
- C as changeHistory,
108
- Dt as clamp,
109
- nt as cloneDeep,
110
- rt as compareObjects,
111
- T as contain,
112
- A as cover,
113
- it as createJSONAndSave,
114
- Ot as createStylesheet,
115
- Mt as damp,
116
- St as debounce,
117
- g as decode,
118
- ct as dispatchBeforeSizeChangeEvent,
119
- ut as dispatchSizeChangeEvent,
120
- m as dotCircleCollision,
121
- p as dotRectCollision,
122
- U as easeInCubic,
123
- F as easeInExpo,
124
- K as easeInOutCubic,
125
- q as easeInOutExpo,
126
- G as easeInOutQuad,
144
+ Nt as calculateDistance,
145
+ Vt as calculateDistanceWithRadius,
146
+ m as camelToKebab,
147
+ Rt as capitalize,
148
+ Q as changeHistory,
149
+ Ut as clamp,
150
+ lt as cloneDeep,
151
+ pt as compareObjects,
152
+ B as contain,
153
+ w as cover,
154
+ ft as createJSONAndSave,
155
+ R as createStylesheet,
156
+ Ft as damp,
157
+ Et as debounce,
158
+ P as decode,
159
+ mt as dispatchBeforeSizeChangeEvent,
160
+ dt as dispatchSizeChangeEvent,
161
+ O as dotCircleCollision,
162
+ E as dotRectCollision,
163
+ J as easeInCubic,
164
+ Y as easeInExpo,
165
+ Z as easeInOutCubic,
166
+ X as easeInOutExpo,
167
+ _ as easeInOutQuad,
127
168
  H as easeInOutQuart,
128
- J as easeInOutQuint,
129
- L as easeInQuad,
130
- Y as easeInQuart,
131
- Z as easeInQuint,
132
- X as easeOutCubic,
133
- _ as easeOutExpo,
134
- tt as easeOutQuad,
135
- et as easeOutQuart,
136
- st as easeOutQuint,
137
- d as encode,
138
- v as findParentElement,
139
- $ as findScrollParentElement,
140
- Q as fixPosition,
141
- f as formatBytes,
142
- Jt as generateId,
143
- j as getAllParentElements,
144
- It as getCumulativeOffsetLeft,
145
- Pt as getCumulativeOffsetTop,
146
- Tt as getCumulativePosition,
147
- N as getElement,
169
+ L as easeInOutQuint,
170
+ tt as easeInQuad,
171
+ et as easeInQuart,
172
+ st as easeInQuint,
173
+ at as easeOutCubic,
174
+ nt as easeOutExpo,
175
+ ot as easeOutQuad,
176
+ rt as easeOutQuart,
177
+ it as easeOutQuint,
178
+ I as encode,
179
+ U as findParentElement,
180
+ F as findScrollParentElement,
181
+ C as fixPosition,
182
+ y as formatBytes,
183
+ At as generateId,
184
+ K as getAllParentElements,
185
+ vt as getCumulativeOffsetLeft,
186
+ zt as getCumulativeOffsetTop,
187
+ Wt as getCumulativePosition,
188
+ q as getElement,
148
189
  ee as getElementTransitionDurationMS,
149
190
  se as getElementTransitionDurationS,
150
- M as getPointerPosition,
151
- h as getRootVariables,
152
- u as insert,
153
- I as isBrowser,
154
- lt as isESClass,
155
- ft as isNullish,
156
- pt as isObject,
157
- Lt as isUppercase,
158
- Yt as kebabToCamel,
159
- Rt as lerp,
160
- at as linear,
161
- zt as mapRange,
162
- W as measureText,
163
- mt as mergeDeep,
164
- ht as mixin,
165
- R as normalize,
166
- y as normalizeBase,
167
- Vt as nullishCoalescing,
168
- dt as omit,
169
- O as parseAttribute,
170
- b as parseAttributeValue,
171
- gt as pick,
172
- Ut as preciseNumber,
173
- kt as round,
174
- Ft as roundNumberTo,
175
- z as screenToCartesian,
176
- Et as setupDrag,
177
- l as shiftArray,
178
- vt as smootherstep,
179
- $t as smoothstep,
180
- Zt as snakeToDotted,
181
- S as splitPath,
182
- jt as step,
183
- bt as styleToString,
184
- yt as throttle,
185
- Xt as toPascalCase,
186
- Kt as toStep,
187
- _t as uncapitalize,
188
- x as wait
191
+ W as getPointerPosition,
192
+ b as getRootVariables,
193
+ g as insert,
194
+ f as isBrowser,
195
+ ht as isESClass,
196
+ gt as isNullish,
197
+ xt as isObject,
198
+ Dt as isUppercase,
199
+ Mt as kebabToCamel,
200
+ Kt as lerp,
201
+ ut as linear,
202
+ qt as mapRange,
203
+ S as measureText,
204
+ yt as mergeDeep,
205
+ St as mixin,
206
+ j as normalize,
207
+ M as normalizeBase,
208
+ Gt as nullishCoalescing,
209
+ Ct as omit,
210
+ k as parseAttribute,
211
+ v as parseAttributeValue,
212
+ wt as pick,
213
+ Jt as preciseNumber,
214
+ Yt as round,
215
+ Zt as roundNumberTo,
216
+ N as screenToCartesian,
217
+ It as setupDrag,
218
+ x as shiftArray,
219
+ Xt as smootherstep,
220
+ _t as smoothstep,
221
+ Qt as snakeToDotted,
222
+ D as splitPath,
223
+ Ht as step,
224
+ p as styleToString,
225
+ Ot as throttle,
226
+ $t as toPascalCase,
227
+ Lt as toStep,
228
+ Tt as uncapitalize,
229
+ A as wait
189
230
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -28,11 +28,6 @@
28
28
  "default": "./lib/attribute/index.js",
29
29
  "types": "./lib/attribute/index.d.ts"
30
30
  },
31
- "./canvas": {
32
- "require": "./lib/canvas/index.cjs",
33
- "default": "./lib/canvas/index.js",
34
- "types": "./lib/canvas/index.d.ts"
35
- },
36
31
  "./class-linked-status": {
37
32
  "require": "./lib/class-linked-status/index.cjs",
38
33
  "default": "./lib/class-linked-status/index.js",
@@ -78,11 +73,6 @@
78
73
  "default": "./lib/element-resizer/index.js",
79
74
  "types": "./lib/element-resizer/index.d.ts"
80
75
  },
81
- "./image": {
82
- "require": "./lib/image/index.cjs",
83
- "default": "./lib/image/index.js",
84
- "types": "./lib/image/index.d.ts"
85
- },
86
76
  "./intersector": {
87
77
  "require": "./lib/intersector/index.cjs",
88
78
  "default": "./lib/intersector/index.js",
@@ -128,21 +118,11 @@
128
118
  "default": "./lib/popover/index.js",
129
119
  "types": "./lib/popover/index.d.ts"
130
120
  },
131
- "./scroll": {
132
- "require": "./lib/scroll/index.cjs",
133
- "default": "./lib/scroll/index.js",
134
- "types": "./lib/scroll/index.d.ts"
135
- },
136
121
  "./scroll-entries": {
137
122
  "require": "./lib/scroll-entries/index.cjs",
138
123
  "default": "./lib/scroll-entries/index.js",
139
124
  "types": "./lib/scroll-entries/index.d.ts"
140
125
  },
141
- "./sequence": {
142
- "require": "./lib/sequence/index.cjs",
143
- "default": "./lib/sequence/index.js",
144
- "types": "./lib/sequence/index.d.ts"
145
- },
146
126
  "./slicer": {
147
127
  "require": "./lib/slicer/index.cjs",
148
128
  "default": "./lib/slicer/index.js",
@@ -173,11 +153,6 @@
173
153
  "default": "./lib/utils/index.js",
174
154
  "types": "./lib/utils/index.d.ts"
175
155
  },
176
- "./video": {
177
- "require": "./lib/video/index.cjs",
178
- "default": "./lib/video/index.js",
179
- "types": "./lib/video/index.d.ts"
180
- },
181
156
  "./window-resizer": {
182
157
  "require": "./lib/window-resizer/index.cjs",
183
158
  "default": "./lib/window-resizer/index.js",
@@ -192,9 +167,6 @@
192
167
  "attribute": [
193
168
  "lib/attribute/index.d.ts"
194
169
  ],
195
- "canvas": [
196
- "lib/canvas/index.d.ts"
197
- ],
198
170
  "class-linked-status": [
199
171
  "lib/class-linked-status/index.d.ts"
200
172
  ],
@@ -225,9 +197,6 @@
225
197
  "element-resizer": [
226
198
  "lib/element-resizer/index.d.ts"
227
199
  ],
228
- "image": [
229
- "lib/image/index.d.ts"
230
- ],
231
200
  "intersector": [
232
201
  "lib/intersector/index.d.ts"
233
202
  ],
@@ -255,15 +224,9 @@
255
224
  "popover": [
256
225
  "lib/popover/index.d.ts"
257
226
  ],
258
- "scroll": [
259
- "lib/scroll/index.d.ts"
260
- ],
261
227
  "scroll-entries": [
262
228
  "lib/scroll-entries/index.d.ts"
263
229
  ],
264
- "sequence": [
265
- "lib/sequence/index.d.ts"
266
- ],
267
230
  "slicer": [
268
231
  "lib/slicer/index.d.ts"
269
232
  ],
@@ -282,9 +245,6 @@
282
245
  "utils": [
283
246
  "lib/utils/index.d.ts"
284
247
  ],
285
- "video": [
286
- "lib/video/index.d.ts"
287
- ],
288
248
  "window-resizer": [
289
249
  "lib/window-resizer/index.d.ts"
290
250
  ]
@@ -1 +0,0 @@
1
- "use strict";var C=i=>{throw TypeError(i)};var S=(i,s,t)=>s.has(i)||C("Cannot "+t);var e=(i,s,t)=>(S(i,s,"read from private field"),t?t.call(i):s.get(i)),a=(i,s,t)=>s.has(i)?C("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),h=(i,s,t,n)=>(S(i,s,"write to private field"),n?n.call(i,t):s.set(i,t),t),M=(i,s,t)=>(S(i,s,"access private method"),t);const I=require("./Store-CDb6RMce.cjs"),z=require("./math-GDWEqu7y.cjs"),m=require("./polyfills-CM4SCDTt.cjs"),P=require("./ticker/index.cjs"),N=require("./order/index.cjs");var f,b,A,c,F,r,u,l,g,d,q,y,x;class O extends I.Store{constructor(t,n){super(t||0,n);a(this,q);a(this,f);a(this,b,N.TICK_ORDER.ANIMATION);a(this,A);a(this,c,new I.Store(!1));a(this,F,0);a(this,r,0);a(this,u,-1/0);a(this,l,1/0);a(this,g,0);a(this,d,null);a(this,x,t=>{this.handleAnimationFrame(t)});h(this,r,this.current)}get direction(){return e(this,F)}get target(){return e(this,r)}get min(){return e(this,u)}set min(t){h(this,u,t),this.set(e(this,r),{equalize:!0})}get max(){return e(this,l)}set max(t){h(this,l,t),this.set(e(this,r),{equalize:!0})}get from(){return e(this,g)}get isRunning(){return e(this,c)}get delta(){return Math.abs(e(this,r)-e(this,g))}get deltaProgress(){return this.delta?m.preciseNumber(Math.abs(this.current-e(this,g))/this.delta,6):0}get distance(){return Math.abs(e(this,l)-e(this,u))}get distanceProgress(){return this.distance?m.preciseNumber(Math.abs(this.current-e(this,u))/this.distance,6):0}set(t,n){(e(this,r)!==t||n!=null&&n.restart)&&(h(this,d,t),this.updateOptions(n),h(this,d,null),e(this,r)!==this.current&&this.start())}shift(t,n){this.set(e(this,r)+t,n)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){e(this,c).current||(e(this,c).current=!0,P.ticker.subscribe(e(this,x),{maxFPS:e(this,f),order:e(this,b),culling:e(this,A)}))}unlistenAnimationFrame(){e(this,c).current&&(e(this,c).current=!1,P.ticker.unsubscribe(e(this,x)))}updateOptions(t){h(this,f,m.nullishCoalescing(t==null?void 0:t.maxFPS,e(this,f))),h(this,b,m.nullishCoalescing(t==null?void 0:t.order,e(this,b))),h(this,A,m.nullishCoalescing(t==null?void 0:t.culling,e(this,A))),h(this,u,m.nullishCoalescing(t==null?void 0:t.min,e(this,u))),h(this,l,m.nullishCoalescing(t==null?void 0:t.max,e(this,l))),M(this,q,y).call(this,typeof e(this,d)=="number"?e(this,d):e(this,r)),t!=null&&t.equalize&&(this.unlistenAnimationFrame(),this.current=e(this,r)),t!=null&&t.restart&&(this.unlistenAnimationFrame(),this.current=this.initial)}start(){this.listenAnimationFrame()}}f=new WeakMap,b=new WeakMap,A=new WeakMap,c=new WeakMap,F=new WeakMap,r=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakSet,y=function(t){h(this,F,Math.sign(t-e(this,r))),h(this,r,z.clamp(t,e(this,u),e(this,l))),h(this,g,this.current)},x=new WeakMap;exports.Animation=O;
@@ -1 +0,0 @@
1
- "use strict";var b=Object.defineProperty,y=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))O.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))v.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>y(t,C(e));var q=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),u=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),n=(t,e,s,r)=>(q(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const w=require("./math-GDWEqu7y.cjs"),c=require("./polyfills-CM4SCDTt.cjs"),B=require("./Animation-DI864E0i.cjs");var i,h;class D extends B.Animation{constructor(s,r){super(s,r);u(this,i);u(this,h);this.damping=20,this.stiffness=0,this.mass=0,n(this,i,0),n(this,h,0),this.updateOptions(p(f({},r),{equalize:!0}))}get velocity(){return a(this,i)}get speed(){return a(this,h)}updateOptions(s){this.damping=c.nullishCoalescing(s==null?void 0:s.damping,this.damping),this.mass=c.nullishCoalescing(s==null?void 0:s.mass,this.mass),this.stiffness=c.nullishCoalescing(s==null?void 0:s.stiffness,this.stiffness),super.updateOptions(s)}handleAnimationFrame(s){c.preciseNumber(this.current,6)===c.preciseNumber(this.target,6)&&(this.unlistenAnimationFrame(),this.current=this.target);const r=this.current,A=Math.abs(r-this.target);n(this,h,A/s.timeBetweenFrames);const m=s.timeBetweenFrames/1e3;if(this.mass||this.stiffness){const F=(this.target-this.current)*this.stiffness-a(this,i)*this.damping;n(this,i,a(this,i)+F/this.mass*m),this.current+=a(this,i)*m}else this.current=w.damp(this.current,this.target,this.damping,m)}}i=new WeakMap,h=new WeakMap;exports.Damped=D;
@@ -1 +0,0 @@
1
- "use strict";var F=Object.defineProperty,o=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,t,e)=>t in i?F(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,g=(i,t)=>{for(var e in t||(t={}))b.call(t,e)&&m(i,e,t[e]);if(c)for(var e of c(t))p.call(t,e)&&m(i,e,t[e]);return i},A=(i,t)=>o(i,O(t));var q=(i,t,e)=>t.has(i)||d("Cannot "+e);var a=(i,t,e)=>(q(i,t,"read from private field"),e?e.call(i):t.get(i)),u=(i,t,e)=>t.has(i)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),h=(i,t,e,s)=>(q(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);const w=require("./easings-DsS5-Kqc.cjs"),C=require("./math-GDWEqu7y.cjs"),l=require("./polyfills-CM4SCDTt.cjs"),S=require("./Animation-DI864E0i.cjs");var n,r;class T extends S.Animation{constructor(e,s){super(e||0,s);u(this,n,w.linear);u(this,r,1e3);this.updateOptions(A(g({},s),{equalize:!0}))}updateOptions(e){super.updateOptions(e),h(this,n,l.nullishCoalescing(e==null?void 0:e.easing,a(this,n))),h(this,r,l.nullishCoalescing(e==null?void 0:e.duration,a(this,r)))}handleAnimationFrame(e){const s=e.timeElapsedSinceSubscription/1e3/(a(this,r)/1e3),f=a(this,n).call(this,C.clamp(s,0,1));this.current=l.preciseNumber(this.from+(this.target-this.from)*f,6),s>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,r=new WeakMap;exports.Tweened=T;
@@ -1,44 +0,0 @@
1
- var g = Object.defineProperty, F = 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 = (e) => {
6
- throw TypeError(e);
7
- };
8
- var l = (e, i, t) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, d = (e, i) => {
9
- for (var t in i || (i = {}))
10
- b.call(i, t) && l(e, t, i[t]);
11
- if (u)
12
- for (var t of u(i))
13
- x.call(i, t) && l(e, t, i[t]);
14
- return e;
15
- }, f = (e, i) => F(e, O(i));
16
- var p = (e, i, t) => i.has(e) || c("Cannot " + t);
17
- var n = (e, i, t) => (p(e, i, "read from private field"), t ? t.call(e) : i.get(e)), m = (e, i, t) => i.has(e) ? c("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), h = (e, i, t, a) => (p(e, i, "write to private field"), a ? a.call(e, t) : i.set(e, t), t);
18
- import { l as S } from "./easings-BKi40vHz.js";
19
- import { c as T } from "./math-BOBiC4TN.js";
20
- import { n as A, p as q } from "./polyfills-X6KXuHg-.js";
21
- import { A as w } from "./Animation-w6BLTCum.js";
22
- var s, r;
23
- class k extends w {
24
- constructor(t, a) {
25
- super(t || 0, a);
26
- m(this, s, S);
27
- m(this, r, 1e3);
28
- this.updateOptions(f(d({}, a), { equalize: !0 }));
29
- }
30
- updateOptions(t) {
31
- super.updateOptions(t), h(this, s, A(t == null ? void 0 : t.easing, n(this, s))), h(this, r, A(t == null ? void 0 : t.duration, n(this, r)));
32
- }
33
- handleAnimationFrame(t) {
34
- const a = t.timeElapsedSinceSubscription / 1e3 / (n(this, r) / 1e3), o = n(this, s).call(this, T(a, 0, 1));
35
- this.current = q(this.from + (this.target - this.from) * o, 6), a > 1 && this.unlistenAnimationFrame();
36
- }
37
- start() {
38
- this.unlistenAnimationFrame(), this.listenAnimationFrame();
39
- }
40
- }
41
- s = new WeakMap(), r = new WeakMap();
42
- export {
43
- k as T
44
- };
@@ -1 +0,0 @@
1
- "use strict";var f=i=>{throw TypeError(i)};var R=(i,s,e)=>s.has(i)||f("Cannot "+e);var t=(i,s,e)=>(R(i,s,"read from private field"),e?e.call(i):s.get(i)),n=(i,s,e)=>s.has(i)?f("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,e),a=(i,s,e,d)=>(R(i,s,"write to private field"),d?d.call(i,e):s.set(i,e),e),o=(i,s,e)=>(R(i,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),C=require("../element-resizer/index.cjs"),w=require("../ticker/index.cjs"),z=require("../browser-CpzFX2xg.cjs"),B=require("../jss-GJLvaNfT.cjs"),F=require("../math-GDWEqu7y.cjs");var c,r,m,l,u,p,b,g,h,E,k,x,v,S,P;class y extends HTMLElement{constructor(){super();n(this,h);n(this,c,new q.CSSProperty(this,"--fps",0));n(this,r,null);n(this,m,null);n(this,l,0);n(this,u,0);n(this,p,1);n(this,b,0);n(this,g,1);n(this,x,e=>{a(this,p,F.clamp(devicePixelRatio,1,2)),a(this,l,e.contentRect.width),a(this,u,e.contentRect.height),t(this,r).width=t(this,l)*this.pixelRatio,t(this,r).height=t(this,u)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),o(this,h,P).call(this),o(this,h,S).call(this)});n(this,v,e=>{a(this,b,e.timestamp),a(this,g,e.timeBetweenFrames),o(this,h,S).call(this)});if(z.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(B.createStylesheet({" :host, canvas":{display:"block",width:"100%",height:"100%"}})),a(this,r,document.createElement("canvas")),a(this,m,t(this,r).getContext("2d")),e.appendChild(t(this,r)),t(this,c).subscribe(d=>{typeof d.previous!="undefined"&&d.current!==d.previous&&o(this,h,E).call(this)})}}get fpsCSSProperty(){return t(this,c)}get canvasElement(){return t(this,r)}get context(){return t(this,m)}get pixelRatio(){return t(this,p)}get width(){return t(this,l)}get height(){return t(this,u)}get detail(){return{width:t(this,l),height:t(this,u),element:this,canvasElement:t(this,r),pixelRatio:t(this,p),context:t(this,m),timestamp:t(this,b),timeBetweenFrames:t(this,g)}}connectedCallback(){t(this,c).observe(),C.elementResizer.subscribe(this,t(this,x)),o(this,h,E).call(this)}disconnectedCallback(){t(this,c).unobserve(),C.elementResizer.unsubscribe(t(this,x)),o(this,h,k).call(this)}}c=new WeakMap,r=new WeakMap,m=new WeakMap,l=new WeakMap,u=new WeakMap,p=new WeakMap,b=new WeakMap,g=new WeakMap,h=new WeakSet,E=function(){w.ticker.unsubscribe(t(this,v)),this.hasAttribute("static")||w.ticker.subscribe(t(this,v),{culling:this,maxFPS:t(this,c).current})},k=function(){w.ticker.unsubscribe(t(this,v))},x=new WeakMap,v=new WeakMap,S=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))},P=function(){this.dispatchEvent(new CustomEvent("canvasResize",{composed:!0,detail:this.detail}))};customElements.get("e-canvas")||customElements.define("e-canvas",y);exports.CanvasElement=y;
@@ -1,34 +0,0 @@
1
- import { CSSProperty } from '../css-property';
2
- export interface Canvas2DRenderDetail {
3
- pixelRatio: number;
4
- width: number;
5
- height: number;
6
- element: HTMLElement;
7
- canvasElement: HTMLCanvasElement;
8
- context: CanvasRenderingContext2D;
9
- timestamp: number;
10
- timeBetweenFrames: number;
11
- }
12
- export type CanvasRenderEvent = CustomEvent<Canvas2DRenderDetail>;
13
- export declare class CanvasElement extends HTMLElement {
14
- #private;
15
- constructor();
16
- get fpsCSSProperty(): CSSProperty<number>;
17
- get canvasElement(): HTMLCanvasElement;
18
- get context(): CanvasRenderingContext2D;
19
- get pixelRatio(): number;
20
- get width(): number;
21
- get height(): number;
22
- get detail(): Canvas2DRenderDetail;
23
- protected connectedCallback(): void;
24
- protected disconnectedCallback(): void;
25
- }
26
- declare global {
27
- interface HTMLElementTagNameMap {
28
- 'e-canvas': CanvasElement;
29
- }
30
- interface HTMLElementEventMap {
31
- canvasRender: CanvasRenderEvent;
32
- canvasResize: CanvasRenderEvent;
33
- }
34
- }