aptechka 0.1.9 → 0.1.10

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 (48) hide show
  1. package/lib/Composed-C2Vv1xxR.cjs +1 -0
  2. package/lib/Composed-DhtYBEmo.js +79 -0
  3. package/lib/component/Component.d.ts +29 -0
  4. package/lib/component/hooks/animation.d.ts +9 -0
  5. package/lib/component/hooks/context.d.ts +2 -0
  6. package/lib/component/hooks/intersection.d.ts +4 -0
  7. package/lib/component/hooks/resize.d.ts +6 -0
  8. package/lib/component/hooks/shadow.d.ts +1 -0
  9. package/lib/component/hooks/stores.d.ts +6 -0
  10. package/lib/component/hooks/style.d.ts +2 -0
  11. package/lib/component/index.cjs +1 -0
  12. package/lib/component/index.d.ts +7 -0
  13. package/lib/component/index.js +187 -0
  14. package/lib/connector/index.cjs +1 -1
  15. package/lib/connector/index.js +1 -1
  16. package/lib/element-constructor/ElementConstructor.d.ts +1 -1
  17. package/lib/element-constructor/tags.d.ts +2 -3
  18. package/lib/element-resizer/index.cjs +1 -1
  19. package/lib/element-resizer/index.d.ts +1 -1
  20. package/lib/element-resizer/index.js +2 -1
  21. package/lib/en3/core/en3.d.ts +2 -2
  22. package/lib/en3/objects/En3Clip.d.ts +1 -1
  23. package/lib/intersector/index.cjs +1 -1
  24. package/lib/intersector/index.d.ts +1 -1
  25. package/lib/intersector/index.js +2 -1
  26. package/lib/layout-box/index.cjs +1 -1
  27. package/lib/layout-box/index.d.ts +2 -2
  28. package/lib/layout-box/index.js +70 -72
  29. package/lib/object-C1ph624j.cjs +1 -0
  30. package/lib/object-DIPjdukP.js +73 -0
  31. package/lib/popover/index.cjs +1 -1
  32. package/lib/popover/index.js +79 -71
  33. package/lib/router/Route.d.ts +8 -2
  34. package/lib/router/index.cjs +1 -1
  35. package/lib/router/index.d.ts +1 -2
  36. package/lib/router/index.js +139 -140
  37. package/lib/store/index.cjs +1 -1
  38. package/lib/store/index.js +48 -111
  39. package/lib/ticker/index.cjs +1 -1
  40. package/lib/ticker/index.d.ts +1 -1
  41. package/lib/ticker/index.js +33 -37
  42. package/lib/utils/dom.d.ts +2 -2
  43. package/lib/utils/index.cjs +1 -1
  44. package/lib/utils/index.d.ts +1 -1
  45. package/lib/utils/index.js +113 -168
  46. package/lib/utils/object.d.ts +1 -0
  47. package/package.json +10 -2
  48. package/lib/router/RouteElement.d.ts +0 -14
@@ -1,193 +1,138 @@
1
- import { a as T, p as R } from "../attributes-69we3byR.js";
2
- import { i as B } from "../browser-0zX67oeU.js";
3
- import { f as M, a as z, g as U } from "../dom-BY7JhTx5.js";
4
- import { c as J, n as K, f as V, p as W, b as G, i as X, m as Y, e as Z, g as _, j as $, d as F, o as H, a as L, h as b, k as j, l as ee } from "../easings-BKi40vHz.js";
5
- import { d as ne } from "../events-_C2CztxR.js";
6
- import { c as ae } from "../file-lxi_oXJf.js";
7
- import { d as ie, t as ue } from "../function-C10DGppn.js";
8
- import { g as fe, a as ce, b as le } from "../layout-HoBT_Da2.js";
9
- import { e as pe, f as me, c as ye, d as he, l as xe, m as ge, r as we, b as Oe, a as Ce, s as Ie } from "../math-BOBiC4TN.js";
10
- import { p as ke, r as De } from "../number-Bo5RdrA1.js";
11
- import { c as Pe, a as Qe, g as Se, k as Te, s as Re, t as Ne } from "../string-BrDhnNUL.js";
12
- import { g as ve, a as Me } from "../style-j2TwriJ_.js";
13
- function y(e, t, ...n) {
14
- return [...e.slice(0, t), ...n, ...e.slice(t)];
15
- }
16
- function h(e, t) {
17
- const n = e.measureText(t), s = n.actualBoundingBoxAscent + n.actualBoundingBoxDescent, a = n.width;
1
+ import { a as I, p as E } from "../attributes-69we3byR.js";
2
+ import { i as S } from "../browser-0zX67oeU.js";
3
+ import { f as P, a as R, g as T } from "../dom-BY7JhTx5.js";
4
+ import { c as v, n as B, f as A, p as N, b as j, i as M, m as z, e as U, g as q, j as J, d as K, o as V, a as F, h as G, k as W, l as X } from "../easings-BKi40vHz.js";
5
+ import { d as Z } from "../events-_C2CztxR.js";
6
+ import { c as $ } from "../file-lxi_oXJf.js";
7
+ import { d as L, t as ee } from "../function-C10DGppn.js";
8
+ import { g as te, a as se, b as ne } from "../layout-HoBT_Da2.js";
9
+ import { e as ie, f as ue, c as re, d as le, l as de, m as me, r as ce, b as pe, a as xe, s as fe } from "../math-BOBiC4TN.js";
10
+ import { p as ge, r as be } from "../number-Bo5RdrA1.js";
11
+ import { c as ye, d as Ce, i as Oe, b as Ie, a as Ee, m as Qe, o as Se, p as De } from "../object-DIPjdukP.js";
12
+ import { c as Re, a as Te, g as ke, k as ve, s as Be, t as Ae } from "../string-BrDhnNUL.js";
13
+ import { g as je, a as Me } from "../style-j2TwriJ_.js";
14
+ function d(a, e, ...t) {
15
+ return [...a.slice(0, e), ...t, ...a.slice(e)];
16
+ }
17
+ function m(a, e) {
18
+ const t = a.measureText(e), s = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent, n = t.width;
18
19
  return {
19
20
  height: s,
20
- width: a
21
+ width: n
21
22
  };
22
23
  }
23
- function x(e) {
24
- return Math.floor(e) + 0.5;
24
+ function c(a) {
25
+ return Math.floor(a) + 0.5;
25
26
  }
26
- function g(e, t, n, s, a, r) {
27
- let o = e / t, c = n / s, i = 0, u = 0;
28
- return a = typeof a == "undefined" ? 0.5 : a, r = typeof r == "undefined" ? 0.5 : r, o > c ? (i = s, u = s * o) : (u = n, i = n / o), [
29
- (n - u) * a,
30
- (s - i) * r,
27
+ function p(a, e, t, s, n, o) {
28
+ let r = a / e, l = t / s, i = 0, u = 0;
29
+ return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, r > l ? (i = s, u = s * r) : (u = t, i = t / r), [
30
+ (t - u) * n,
31
+ (s - i) * o,
31
32
  u,
32
33
  i
33
34
  ];
34
35
  }
35
- function w(e, t) {
36
- return e.x < t.x + t.width && e.x > t.x && e.y < t.y + t.height && e.y > t.y;
36
+ function x(a, e) {
37
+ return a.x < e.x + e.width && a.x > e.x && a.y < e.y + e.height && a.y > e.y;
37
38
  }
38
- function O(e, t) {
39
- return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2) < t.radius;
39
+ function f(a, e) {
40
+ return Math.sqrt((a.x - e.x) ** 2 + (a.y - e.y) ** 2) < e.radius;
40
41
  }
41
- function C(e, t, n = !1) {
42
- let s = e.x - t.width / 2, a = t.height / 2 - e.y;
43
- return n && (s = s / (t.width / 2), a = a / (t.height / 2)), { x: s, y: a };
42
+ function h(a, e, t = !1) {
43
+ let s = a.x - e.width / 2, n = e.height / 2 - a.y;
44
+ return t && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
44
45
  }
45
- function I(e, t) {
46
- const n = e.x / t.x, s = e.y / t.y;
47
- return { x: n, y: s };
46
+ function g(a, e) {
47
+ const t = a.x / e.x, s = a.y / e.y;
48
+ return { x: t, y: s };
48
49
  }
49
- function A(e, t) {
50
- return t = t || {
50
+ function b(a, e) {
51
+ return e = e || {
51
52
  x: 0,
52
53
  y: 0,
53
54
  width: document.documentElement.offsetWidth,
54
55
  height: innerHeight
55
56
  }, {
56
- x: (e.x - t.x) / t.width * t.width,
57
- y: (e.y - t.y) / t.height * t.height
57
+ x: (a.x - e.x) / e.width * e.width,
58
+ y: (a.y - e.y) / e.height * e.height
58
59
  };
59
60
  }
60
- function k(e) {
61
- const t = window.atob(e);
62
- return decodeURIComponent(window.escape(t));
63
- }
64
- function D(e) {
65
- const t = window.unescape(encodeURIComponent(e));
66
- return window.btoa(t);
67
- }
68
- function l(e) {
69
- return typeof e == "object" && e !== null && !Array.isArray(e);
70
- }
71
- function d(e) {
72
- if (e === null || typeof e != "object")
73
- return e;
74
- if (e instanceof Date)
75
- return new Date(e.getTime());
76
- if (e instanceof Node)
77
- return e;
78
- const t = Array.isArray(e) ? [] : {};
79
- for (const n in e)
80
- e.hasOwnProperty(n) && (t[n] = d(e[n]));
81
- return t;
82
- }
83
- function p(e, t, n = l) {
84
- for (const s in t)
85
- n(t[s]) ? (e[s] || Object.assign(e, { [s]: {} }), p(e[s], t[s], n)) : Object.assign(e, { [s]: t[s] });
86
- return e;
87
- }
88
- function m(e) {
89
- return e === null || typeof e == "undefined";
90
- }
91
- function f(e, t) {
92
- if (typeof e != typeof t)
93
- return !1;
94
- if ([e, t].some((n) => m(n)))
95
- return e === t;
96
- if (Array.isArray(e)) {
97
- const n = e.length > t.length ? e : t, s = e.length > t.length ? t : e;
98
- return n.every((a, r) => f(a, s[r]));
99
- }
100
- if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
101
- return e === t;
102
- for (const n in e) {
103
- if (!t.hasOwnProperty(n))
104
- return !1;
105
- if (typeof e[n] == "object" && typeof t[n] == "object") {
106
- if (!f(e[n], t[n]))
107
- return !1;
108
- } else if (e[n] !== t[n])
109
- return !1;
110
- }
111
- return !0;
112
- }
113
- function E(e, t) {
114
- const n = {};
115
- for (const s in e)
116
- t.includes(s) && (n[s] = e[s]);
117
- return n;
61
+ function w(a) {
62
+ const e = window.atob(a);
63
+ return decodeURIComponent(window.escape(e));
118
64
  }
119
- function P(e, t) {
120
- const n = {};
121
- for (const s in e)
122
- t.includes(s) || (n[s] = e[s]);
123
- return n;
65
+ function y(a) {
66
+ const e = window.unescape(encodeURIComponent(a));
67
+ return window.btoa(e);
124
68
  }
125
69
  export {
126
- pe as calculateDistance,
127
- me as calculateDistanceWithRadius,
128
- Pe as camelToKebab,
129
- Qe as capitalize,
130
- ye as clamp,
131
- d as cloneDeep,
132
- f as compareObjects,
133
- g as cover,
134
- ae as createJSONAndSave,
135
- he as damp,
136
- ie as debounce,
137
- D as decode,
138
- ne as dispatchSizeChangeEvent,
139
- O as dotCircleCollision,
140
- w as dotRectCollision,
141
- J as easeInCubic,
142
- K as easeInExpo,
143
- V as easeInOutCubic,
144
- W as easeInOutExpo,
145
- G as easeInOutQuad,
146
- X as easeInOutQuart,
147
- Y as easeInOutQuint,
148
- Z as easeInQuad,
149
- _ as easeInQuart,
150
- $ as easeInQuint,
151
- F as easeOutCubic,
152
- H as easeOutExpo,
153
- L as easeOutQuad,
154
- b as easeOutQuart,
155
- j as easeOutQuint,
156
- k as encode,
157
- M as findParentElement,
158
- z as findScrollParentElement,
159
- x as fixPosition,
160
- Se as generateId,
161
- fe as getCumulativeOffsetLeft,
162
- ce as getCumulativeOffsetTop,
163
- le as getCumulativePosition,
164
- U as getElement,
165
- ve as getElementTransitionDurationMS,
70
+ ie as calculateDistance,
71
+ ue as calculateDistanceWithRadius,
72
+ Re as camelToKebab,
73
+ Te as capitalize,
74
+ re as clamp,
75
+ ye as cloneDeep,
76
+ Ce as compareObjects,
77
+ p as cover,
78
+ $ as createJSONAndSave,
79
+ le as damp,
80
+ L as debounce,
81
+ y as decode,
82
+ Z as dispatchSizeChangeEvent,
83
+ f as dotCircleCollision,
84
+ x as dotRectCollision,
85
+ v as easeInCubic,
86
+ B as easeInExpo,
87
+ A as easeInOutCubic,
88
+ N as easeInOutExpo,
89
+ j as easeInOutQuad,
90
+ M as easeInOutQuart,
91
+ z as easeInOutQuint,
92
+ U as easeInQuad,
93
+ q as easeInQuart,
94
+ J as easeInQuint,
95
+ K as easeOutCubic,
96
+ V as easeOutExpo,
97
+ F as easeOutQuad,
98
+ G as easeOutQuart,
99
+ W as easeOutQuint,
100
+ w as encode,
101
+ P as findParentElement,
102
+ R as findScrollParentElement,
103
+ c as fixPosition,
104
+ ke as generateId,
105
+ te as getCumulativeOffsetLeft,
106
+ se as getCumulativeOffsetTop,
107
+ ne as getCumulativePosition,
108
+ T as getElement,
109
+ je as getElementTransitionDurationMS,
166
110
  Me as getElementTransitionDurationS,
167
- A as getPointerPosition,
168
- y as insert,
169
- B as isBrowser,
170
- m as isNullish,
171
- l as isObject,
172
- Te as kebabToCamel,
173
- xe as lerp,
174
- ee as linear,
175
- ge as mapRange,
176
- h as measureText,
177
- p as mergeDeep,
178
- I as normalize,
179
- P as omit,
180
- T as parseAttribute,
181
- R as parseAttributeValue,
182
- E as pick,
183
- ke as preciseNumber,
184
- we as round,
185
- De as roundNumberTo,
186
- C as screenToCartesian,
187
- Oe as smootherstep,
188
- Ce as smoothstep,
189
- Re as snakeToDotted,
190
- Ie as step,
191
- ue as throttle,
192
- Ne as toPascalCase
111
+ b as getPointerPosition,
112
+ d as insert,
113
+ S as isBrowser,
114
+ Oe as isESClass,
115
+ Ie as isNullish,
116
+ Ee as isObject,
117
+ ve as kebabToCamel,
118
+ de as lerp,
119
+ X as linear,
120
+ me as mapRange,
121
+ m as measureText,
122
+ Qe as mergeDeep,
123
+ g as normalize,
124
+ Se as omit,
125
+ I as parseAttribute,
126
+ E as parseAttributeValue,
127
+ De as pick,
128
+ ge as preciseNumber,
129
+ ce as round,
130
+ be as roundNumberTo,
131
+ h as screenToCartesian,
132
+ pe as smootherstep,
133
+ xe as smoothstep,
134
+ Be as snakeToDotted,
135
+ fe as step,
136
+ ee as throttle,
137
+ Ae as toPascalCase
193
138
  };
@@ -5,3 +5,4 @@ export declare function isNullish(value: any): boolean;
5
5
  export declare function compareObjects(obj1: any, obj2: any): boolean;
6
6
  export declare function pick<T extends object, R extends keyof T>(object: T, keys: Array<R>): Pick<T, R>;
7
7
  export declare function omit<T extends object, R extends keyof T>(object: T, keys: Array<R>): Omit<T, R>;
8
+ export declare function isESClass(fn: Function): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -43,6 +43,11 @@
43
43
  "default": "./lib/canvas/index.js",
44
44
  "types": "./lib/canvas/index.d.ts"
45
45
  },
46
+ "./component": {
47
+ "require": "./lib/component/index.cjs",
48
+ "default": "./lib/component/index.js",
49
+ "types": "./lib/component/index.d.ts"
50
+ },
46
51
  "./connector": {
47
52
  "require": "./lib/connector/index.cjs",
48
53
  "default": "./lib/connector/index.js",
@@ -213,6 +218,9 @@
213
218
  "canvas": [
214
219
  "lib/canvas/index.d.ts"
215
220
  ],
221
+ "component": [
222
+ "lib/component/index.d.ts"
223
+ ],
216
224
  "connector": [
217
225
  "lib/connector/index.d.ts"
218
226
  ],
@@ -313,7 +321,7 @@
313
321
  "@types/three": "^0.161.2",
314
322
  "vite": "5.1.1",
315
323
  "vite-plugin-dts": "^3.7.2",
316
- "vite-plugin-htmc": "^0.1.1"
324
+ "vite-plugin-htmc": "^0.1.5"
317
325
  },
318
326
  "dependencies": {
319
327
  "detect-gpu": "^5.0.38",
@@ -1,14 +0,0 @@
1
- import { CustomElement } from '../custom-element';
2
- export type RouteURLParams<T extends string = string> = Partial<{
3
- [key in T]: string;
4
- }>;
5
- export type RouteParameters<PathnameParams extends string = string, SearchParams extends string = string> = {
6
- pathnameParams: RouteURLParams<PathnameParams>;
7
- searchParams: RouteURLParams<SearchParams>;
8
- };
9
- export declare class RouteElement<PathnameParams extends string = string, SearchParams extends string = string> extends CustomElement {
10
- #private;
11
- constructor(parameters: RouteParameters<PathnameParams, SearchParams>);
12
- get pathnameParams(): Partial<{ [key in PathnameParams]: string; }>;
13
- get searchParams(): Partial<{ [key in SearchParams]: string; }>;
14
- }