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.
- package/lib/Composed-C2Vv1xxR.cjs +1 -0
- package/lib/Composed-DhtYBEmo.js +79 -0
- package/lib/component/Component.d.ts +29 -0
- package/lib/component/hooks/animation.d.ts +9 -0
- package/lib/component/hooks/context.d.ts +2 -0
- package/lib/component/hooks/intersection.d.ts +4 -0
- package/lib/component/hooks/resize.d.ts +6 -0
- package/lib/component/hooks/shadow.d.ts +1 -0
- package/lib/component/hooks/stores.d.ts +6 -0
- package/lib/component/hooks/style.d.ts +2 -0
- package/lib/component/index.cjs +1 -0
- package/lib/component/index.d.ts +7 -0
- package/lib/component/index.js +187 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +1 -1
- package/lib/element-constructor/ElementConstructor.d.ts +1 -1
- package/lib/element-constructor/tags.d.ts +2 -3
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.d.ts +1 -1
- package/lib/element-resizer/index.js +2 -1
- package/lib/en3/core/en3.d.ts +2 -2
- package/lib/en3/objects/En3Clip.d.ts +1 -1
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.d.ts +1 -1
- package/lib/intersector/index.js +2 -1
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +2 -2
- package/lib/layout-box/index.js +70 -72
- package/lib/object-C1ph624j.cjs +1 -0
- package/lib/object-DIPjdukP.js +73 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +79 -71
- package/lib/router/Route.d.ts +8 -2
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.d.ts +1 -2
- package/lib/router/index.js +139 -140
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +48 -111
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.d.ts +1 -1
- package/lib/ticker/index.js +33 -37
- package/lib/utils/dom.d.ts +2 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +113 -168
- package/lib/utils/object.d.ts +1 -0
- package/package.json +10 -2
- package/lib/router/RouteElement.d.ts +0 -14
package/lib/utils/index.js
CHANGED
|
@@ -1,193 +1,138 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { i as
|
|
3
|
-
import { f as
|
|
4
|
-
import { c as
|
|
5
|
-
import { d as
|
|
6
|
-
import { c as
|
|
7
|
-
import { d as
|
|
8
|
-
import { g as
|
|
9
|
-
import { e as
|
|
10
|
-
import { p as
|
|
11
|
-
import { c as
|
|
12
|
-
import { g as ve,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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:
|
|
21
|
+
width: n
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return Math.floor(
|
|
24
|
+
function c(a) {
|
|
25
|
+
return Math.floor(a) + 0.5;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
let
|
|
28
|
-
return
|
|
29
|
-
(
|
|
30
|
-
(s - i) *
|
|
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
|
|
36
|
-
return
|
|
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
|
|
39
|
-
return Math.sqrt((
|
|
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
|
|
42
|
-
let s =
|
|
43
|
-
return
|
|
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
|
|
46
|
-
const
|
|
47
|
-
return { x:
|
|
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
|
|
50
|
-
return
|
|
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: (
|
|
57
|
-
y: (
|
|
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
|
|
61
|
-
const
|
|
62
|
-
return decodeURIComponent(window.escape(
|
|
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
|
|
120
|
-
const
|
|
121
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
E as
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
};
|
package/lib/utils/object.d.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
-
}
|