aptechka 0.83.1 → 0.84.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.
- package/lib/Animation-BAiM6_n1.js +111 -0
- package/lib/Animation-DMWabSR0.cjs +1 -0
- package/lib/Composed-B0fvCtZz.cjs +1 -0
- package/lib/Composed-CgA9lLWA.js +75 -0
- package/lib/Damped-BLo-OAVb.cjs +1 -0
- package/lib/Damped-Dcz5UdMH.js +57 -0
- package/lib/DerivedArray-DFhxap_z.js +63 -0
- package/lib/DerivedArray-DYtWMW0n.cjs +1 -0
- package/lib/DragControls-BPHsDeH6.cjs +1 -0
- package/lib/DragControls-D2a1Cifp.js +234 -0
- package/lib/LocalLinks-BWFJYhGX.cjs +1 -0
- package/lib/LocalLinks-Dwgf3No6.js +65 -0
- package/lib/PageAnnouncerElement-DPMlVJZG.cjs +1 -0
- package/lib/PageAnnouncerElement-DV9pm_od.js +28 -0
- package/lib/PageScroll-BAatKJx6.cjs +1 -0
- package/lib/PageScroll-m3TsHnzR.js +65 -0
- package/lib/SourceElement-941MrYpq.js +265 -0
- package/lib/SourceElement-DBLZ7b5k.cjs +5 -0
- package/lib/Store-BCW70G3Z.cjs +1 -0
- package/lib/Store-uLDYY9ed.js +158 -0
- package/lib/Tweened-BvtjLCa3.js +48 -0
- package/lib/Tweened-DdXm1dbF.cjs +1 -0
- package/lib/Viewport-BiDoiU8M.js +113 -0
- package/lib/Viewport-CXGKUyDy.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +97 -93
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +6 -6
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.js +67 -66
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +37 -34
- package/lib/attributes-BADnRZpK.cjs +1 -0
- package/lib/attributes-FObgMNCf.js +36 -0
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +240 -232
- package/lib/cache/index.cjs +1 -1
- package/lib/cache/index.js +26 -23
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +62 -59
- package/lib/canvas-BP1ceie3.cjs +1 -0
- package/lib/canvas-DsglKco1.js +40 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +44 -41
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +6 -6
- package/lib/coordinates--JG1U6kQ.js +29 -0
- package/lib/coordinates-DQ9XV9M1.cjs +1 -0
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +40 -37
- package/lib/css-unit-parser/index.cjs +2 -2
- package/lib/css-unit-parser/index.js +22 -19
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +13 -11
- package/lib/custom-elements-BfZCJde6.cjs +1 -0
- package/lib/custom-elements-HEMuF7yH.js +27 -0
- package/lib/dev/index.cjs +2 -1
- package/lib/dev/index.d.ts +1 -0
- package/lib/dev/index.js +25 -10
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -5
- package/lib/dom-B40i6NXw.cjs +1 -0
- package/lib/dom-D8D-_9ty.js +108 -0
- package/lib/easings-BSGJFMAo.js +40 -0
- package/lib/easings-BWq0pPLq.cjs +1 -0
- package/lib/element-CqD0jqBJ.cjs +1 -0
- package/lib/element-DKw5H-Tu.js +10 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +53 -52
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +47 -44
- package/lib/en3/index.cjs +4 -4
- package/lib/en3/index.js +192 -185
- package/lib/events-Ds-TuvYW.js +9 -0
- package/lib/events-UlGk63iC.cjs +1 -0
- package/lib/file-DwQs6bB6.js +28 -0
- package/lib/file-RHfA3OS-.cjs +1 -0
- package/lib/function-H4b_gTg6.cjs +1 -0
- package/lib/function-UmbPrOHm.js +19 -0
- package/lib/gestures-DmKKNnh4.js +14 -0
- package/lib/gestures-DtYbQr49.cjs +1 -0
- package/lib/history/index.cjs +1 -1
- package/lib/history/index.js +24 -21
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +27 -24
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +17 -13
- package/lib/index-BpO2RJ__.cjs +1 -0
- package/lib/index-DpKsHe97.js +68 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +3 -3
- package/lib/jsx/ComponentElement.d.ts +4 -0
- package/lib/jsx/h.d.ts +7 -16
- package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
- package/lib/jsx/hooks/cssProperty.d.ts +6 -0
- package/lib/jsx/hooks/resize.d.ts +4 -0
- package/lib/jsx/hooks/store.d.ts +1 -2
- package/lib/jsx/hooks/ticker.d.ts +5 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +4 -4
- package/lib/jsx/index.js +171 -349
- package/lib/jsx/plugins/vite/index.cjs +49 -0
- package/lib/jsx/plugins/vite/index.d.ts +38 -0
- package/lib/jsx/plugins/vite/index.js +104 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +228 -190
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +86 -84
- package/lib/layout-C26zkY7D.js +35 -0
- package/lib/layout-CnGLl7oe.cjs +1 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +221 -217
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +48 -45
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +2 -2
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +48 -45
- package/lib/math-C-knY2TL.cjs +1 -0
- package/lib/math-r8V23YFe.js +57 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +28 -25
- package/lib/metadata-BNdkmeeD.js +15 -0
- package/lib/metadata-BrHUfpV9.cjs +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +561 -556
- package/lib/morph-BtgB1YQP.js +256 -0
- package/lib/morph-Buhxq-X0.cjs +1 -0
- package/lib/need_redo_tweaker/index.cjs +4 -4
- package/lib/need_redo_tweaker/index.js +862 -834
- package/lib/notifier/index.cjs +1 -1
- package/lib/notifier/index.js +29 -26
- package/lib/number-Bu4sGvW7.cjs +1 -0
- package/lib/number-DiVt2xnh.js +47 -0
- package/lib/object-CiIdEmJx.js +98 -0
- package/lib/object-DTY_W6xG.cjs +1 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.js +3 -3
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +2 -2
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +2 -2
- package/lib/pixel-perfect/index.cjs +4 -4
- package/lib/pixel-perfect/index.js +43 -40
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +125 -122
- package/lib/polyfills-CG1XJNia.js +28 -0
- package/lib/polyfills-DZCuDBkA.cjs +1 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +249 -245
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +58 -55
- package/lib/render-DLcWVnuH.js +355 -0
- package/lib/render-DdomypCo.cjs +1 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +196 -194
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +890 -877
- package/lib/scroll-BvIWh1xB.js +41 -0
- package/lib/scroll-CT0lpyRZ.cjs +1 -0
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +37 -34
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +214 -209
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +102 -98
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +29 -26
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +118 -113
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +5 -5
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +94 -94
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +10 -8
- package/lib/string-B3lm2b7v.js +84 -0
- package/lib/string-CbRNzmd9.cjs +1 -0
- package/lib/style-DBoQWK0d.js +14 -0
- package/lib/style-IDJ6db6n.cjs +1 -0
- package/lib/stylesheet-CHvuef16.js +28 -0
- package/lib/stylesheet-CQdBaIAA.cjs +1 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +96 -92
- package/lib/url-CPCO10Sy.cjs +1 -0
- package/lib/url-CWCY_qe_.js +124 -0
- package/lib/utils/attributes.d.ts +2 -0
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +245 -226
- package/lib/utils/polyfills.d.ts +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +36 -33
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +27 -24
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +56 -54
- package/package.json +11 -24
- package/lib/Animation-BzTjZIE-.js +0 -108
- package/lib/Animation-C39Ah-LM.cjs +0 -1
- package/lib/Composed-C-TV9te3.cjs +0 -1
- package/lib/Composed-DyAWjEXE.js +0 -121
- package/lib/Damped-CRusiRIV.js +0 -56
- package/lib/Damped-Prr0iKu1.cjs +0 -1
- package/lib/DragControls-8rNZwQrs.cjs +0 -1
- package/lib/DragControls-DBNdMBA4.js +0 -228
- package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
- package/lib/LocalLinks-DFZFpbjs.js +0 -62
- package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
- package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
- package/lib/PageScroll-0LxFblry.js +0 -62
- package/lib/PageScroll-BXJUQwG7.cjs +0 -1
- package/lib/SourceElement-BHqPFbna.cjs +0 -5
- package/lib/SourceElement-DjbHjynf.js +0 -260
- package/lib/Store-Blf4msDz.cjs +0 -1
- package/lib/Store-ZThXYBQd.js +0 -152
- package/lib/Tweened-Bw1Cn1PJ.js +0 -47
- package/lib/Tweened-DWtk9E-O.cjs +0 -1
- package/lib/Viewport-BxCr0GlB.cjs +0 -1
- package/lib/Viewport-Dt-d9DPi.js +0 -109
- package/lib/attributes-69we3byR.js +0 -10
- package/lib/attributes-Bf2svn4j.cjs +0 -1
- package/lib/canvas-CU5Xjahf.cjs +0 -1
- package/lib/canvas-DeZ0SLUJ.js +0 -34
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/custom-elements-DBnCK7Zx.js +0 -24
- package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
- package/lib/dom-BETkVSSZ.js +0 -82
- package/lib/dom-CBLlqORw.cjs +0 -1
- package/lib/easings-BEmRlrDd.js +0 -38
- package/lib/easings-GegIwET5.cjs +0 -1
- package/lib/element-CGVl1jA-.js +0 -7
- package/lib/element-yhcBhsho.cjs +0 -1
- package/lib/events-CsVF98U6.js +0 -6
- package/lib/events-KVanG9sR.cjs +0 -1
- package/lib/file-DSpfWdd9.cjs +0 -1
- package/lib/file-GHShUlue.js +0 -24
- package/lib/function-C10DGppn.js +0 -17
- package/lib/function-MthRj-GJ.cjs +0 -1
- package/lib/gestures-C7gbKx11.cjs +0 -1
- package/lib/gestures-CcXV6fCp.js +0 -11
- package/lib/index-OE2INULi.cjs +0 -1
- package/lib/index-e9eDuagL.js +0 -65
- package/lib/jsx/hydrate.d.ts +0 -1
- package/lib/jsx/integrations/astro/client.cjs +0 -1
- package/lib/jsx/integrations/astro/client.d.ts +0 -2
- package/lib/jsx/integrations/astro/client.js +0 -50
- package/lib/jsx/integrations/astro/index.cjs +0 -1
- package/lib/jsx/integrations/astro/index.d.ts +0 -2
- package/lib/jsx/integrations/astro/index.js +0 -54
- package/lib/jsx/integrations/astro/server.cjs +0 -1
- package/lib/jsx/integrations/astro/server.d.ts +0 -3
- package/lib/jsx/integrations/astro/server.js +0 -35
- package/lib/jsx/plugins/vite.d.ts +0 -21
- package/lib/layout-BSMtwCga.js +0 -29
- package/lib/layout-Ctc2p3uz.cjs +0 -1
- package/lib/math-BOBiC4TN.js +0 -45
- package/lib/math-GDWEqu7y.cjs +0 -1
- package/lib/metadata-BcYZ5w3T.cjs +0 -1
- package/lib/metadata-jfowcCyz.js +0 -12
- package/lib/morph-B6sGhLCi.cjs +0 -1
- package/lib/morph-BQErz7qP.js +0 -242
- package/lib/number-ChAm68cm.cjs +0 -1
- package/lib/number-CumqY64S.js +0 -40
- package/lib/object-CcMK4y_r.js +0 -87
- package/lib/object-baN9pgbU.cjs +0 -1
- package/lib/polyfills-DJrTJQky.js +0 -24
- package/lib/polyfills-Df4r-ETT.cjs +0 -1
- package/lib/render-DQs7rIoN.cjs +0 -1
- package/lib/render-D_0FCWEu.js +0 -18
- package/lib/scroll-BA2WnUrb.cjs +0 -1
- package/lib/scroll-DY5senkF.js +0 -37
- package/lib/string-BlMQbe8b.js +0 -70
- package/lib/string-DUXXtU8v.cjs +0 -1
- package/lib/style-At6aDoqG.cjs +0 -1
- package/lib/style-j2TwriJ_.js +0 -10
- package/lib/stylesheet-5_o7PFzM.cjs +0 -1
- package/lib/stylesheet-DdBzowZY.js +0 -24
- package/lib/url-CHgcNwJ1.cjs +0 -1
- package/lib/url-CYgo5vrG.js +0 -113
- package/lib/vite-C-i3hVDL.js +0 -75
- package/lib/vite-DzanPumM.cjs +0 -44
package/lib/store/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { S
|
|
2
|
-
import { C
|
|
1
|
+
import { S, a, s } from "../Store-uLDYY9ed.js";
|
|
2
|
+
import { C, D, R } from "../Composed-CgA9lLWA.js";
|
|
3
|
+
import { D as D2, a as a2 } from "../DerivedArray-DFhxap_z.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
C as Composed,
|
|
6
|
+
D as Derived,
|
|
7
|
+
D2 as DerivedArray,
|
|
8
|
+
a2 as DerivedKeyedArray,
|
|
9
|
+
R as Resource,
|
|
10
|
+
S as Store,
|
|
9
11
|
a as activeStores,
|
|
10
|
-
|
|
12
|
+
s as storeRegistry
|
|
11
13
|
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
3
|
+
function kebabToCamel(kebab, capitalize2 = !1) {
|
|
4
|
+
let camel = "";
|
|
5
|
+
return kebab.split("-").forEach((part, i) => {
|
|
6
|
+
if (i === 0 && !capitalize2)
|
|
7
|
+
camel += part;
|
|
8
|
+
else {
|
|
9
|
+
const firstLetter = part[0], restLetters = part.slice(1), capitalized = firstLetter.toUpperCase() + restLetters;
|
|
10
|
+
camel += capitalized;
|
|
11
|
+
}
|
|
12
|
+
}), camel;
|
|
13
|
+
}
|
|
14
|
+
__name(kebabToCamel, "kebabToCamel");
|
|
15
|
+
function camelToKebab(camelCaseString) {
|
|
16
|
+
return camelCaseString.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
17
|
+
}
|
|
18
|
+
__name(camelToKebab, "camelToKebab");
|
|
19
|
+
function snakeToDotted(snake) {
|
|
20
|
+
return snake.split("_").join(".");
|
|
21
|
+
}
|
|
22
|
+
__name(snakeToDotted, "snakeToDotted");
|
|
23
|
+
function toPascalCase(str) {
|
|
24
|
+
return /^[a-z\d]+$/i.test(str) ? str.charAt(0).toUpperCase() + str.slice(1) : str.replace(
|
|
25
|
+
/([a-z\d])([a-z\d]*)/gi,
|
|
26
|
+
(_, g1, g2) => g1.toUpperCase() + g2.toLowerCase()
|
|
27
|
+
).replace(/[^a-z\d]/gi, "");
|
|
28
|
+
}
|
|
29
|
+
__name(toPascalCase, "toPascalCase");
|
|
30
|
+
function sliceAndModifyFirst(string, method) {
|
|
31
|
+
return string.slice(0, 1)[method]() + string.slice(1);
|
|
32
|
+
}
|
|
33
|
+
__name(sliceAndModifyFirst, "sliceAndModifyFirst");
|
|
34
|
+
function sliceAndModify(string, everyWord = !1, method) {
|
|
35
|
+
return everyWord ? string.split(" ").map((v) => sliceAndModifyFirst(v, method)).join(" ") : sliceAndModifyFirst(string, method);
|
|
36
|
+
}
|
|
37
|
+
__name(sliceAndModify, "sliceAndModify");
|
|
38
|
+
function capitalize(string, everyWord = !1) {
|
|
39
|
+
return sliceAndModify(string, everyWord, "toUpperCase");
|
|
40
|
+
}
|
|
41
|
+
__name(capitalize, "capitalize");
|
|
42
|
+
function uncapitalize(string, everyWord = !1) {
|
|
43
|
+
return sliceAndModify(string, everyWord, "toLowerCase");
|
|
44
|
+
}
|
|
45
|
+
__name(uncapitalize, "uncapitalize");
|
|
46
|
+
function generateId(length, characters = "abcdefghijklmnopqrstuvwxyz0123456789") {
|
|
47
|
+
const charactersLength = characters.length, key = crypto.getRandomValues(new Uint8Array(length));
|
|
48
|
+
let generatedKey = "";
|
|
49
|
+
for (let i = 0; i < length; i++)
|
|
50
|
+
generatedKey += characters.charAt(key[i] % charactersLength);
|
|
51
|
+
return generatedKey;
|
|
52
|
+
}
|
|
53
|
+
__name(generateId, "generateId");
|
|
54
|
+
function isUppercase(string) {
|
|
55
|
+
return new RegExp("^\\p{Lu}", "u").test(string);
|
|
56
|
+
}
|
|
57
|
+
__name(isUppercase, "isUppercase");
|
|
58
|
+
let textarea;
|
|
59
|
+
function decodeHtmlEntities(html) {
|
|
60
|
+
return textarea || (textarea = document.createElement("textarea")), textarea.innerHTML = html, textarea.value;
|
|
61
|
+
}
|
|
62
|
+
__name(decodeHtmlEntities, "decodeHtmlEntities");
|
|
63
|
+
function declension(number, one, few, many) {
|
|
64
|
+
const n = typeof number == "string" ? parseInt(number) : number;
|
|
65
|
+
if (n === 1)
|
|
66
|
+
return one;
|
|
67
|
+
if (n % 100 >= 11 && n % 100 <= 14)
|
|
68
|
+
return many;
|
|
69
|
+
const remainder = n % 10;
|
|
70
|
+
return remainder === 1 ? one : remainder >= 2 && remainder <= 4 ? few : many;
|
|
71
|
+
}
|
|
72
|
+
__name(declension, "declension");
|
|
73
|
+
export {
|
|
74
|
+
capitalize as a,
|
|
75
|
+
declension as b,
|
|
76
|
+
camelToKebab as c,
|
|
77
|
+
decodeHtmlEntities as d,
|
|
78
|
+
generateId as g,
|
|
79
|
+
isUppercase as i,
|
|
80
|
+
kebabToCamel as k,
|
|
81
|
+
snakeToDotted as s,
|
|
82
|
+
toPascalCase as t,
|
|
83
|
+
uncapitalize as u
|
|
84
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function kebabToCamel(kebab,capitalize2=!1){let camel="";return kebab.split("-").forEach((part,i)=>{if(i===0&&!capitalize2)camel+=part;else{const firstLetter=part[0],restLetters=part.slice(1),capitalized=firstLetter.toUpperCase()+restLetters;camel+=capitalized}}),camel}__name(kebabToCamel,"kebabToCamel");function camelToKebab(camelCaseString){return camelCaseString.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}__name(camelToKebab,"camelToKebab");function snakeToDotted(snake){return snake.split("_").join(".")}__name(snakeToDotted,"snakeToDotted");function toPascalCase(str){return/^[a-z\d]+$/i.test(str)?str.charAt(0).toUpperCase()+str.slice(1):str.replace(/([a-z\d])([a-z\d]*)/gi,(_,g1,g2)=>g1.toUpperCase()+g2.toLowerCase()).replace(/[^a-z\d]/gi,"")}__name(toPascalCase,"toPascalCase");function sliceAndModifyFirst(string,method){return string.slice(0,1)[method]()+string.slice(1)}__name(sliceAndModifyFirst,"sliceAndModifyFirst");function sliceAndModify(string,everyWord=!1,method){return everyWord?string.split(" ").map(v=>sliceAndModifyFirst(v,method)).join(" "):sliceAndModifyFirst(string,method)}__name(sliceAndModify,"sliceAndModify");function capitalize(string,everyWord=!1){return sliceAndModify(string,everyWord,"toUpperCase")}__name(capitalize,"capitalize");function uncapitalize(string,everyWord=!1){return sliceAndModify(string,everyWord,"toLowerCase")}__name(uncapitalize,"uncapitalize");function generateId(length,characters="abcdefghijklmnopqrstuvwxyz0123456789"){const charactersLength=characters.length,key=crypto.getRandomValues(new Uint8Array(length));let generatedKey="";for(let i=0;i<length;i++)generatedKey+=characters.charAt(key[i]%charactersLength);return generatedKey}__name(generateId,"generateId");function isUppercase(string){return new RegExp("^\\p{Lu}","u").test(string)}__name(isUppercase,"isUppercase");let textarea;function decodeHtmlEntities(html){return textarea||(textarea=document.createElement("textarea")),textarea.innerHTML=html,textarea.value}__name(decodeHtmlEntities,"decodeHtmlEntities");function declension(number,one,few,many){const n=typeof number=="string"?parseInt(number):number;if(n===1)return one;if(n%100>=11&&n%100<=14)return many;const remainder=n%10;return remainder===1?one:remainder>=2&&remainder<=4?few:many}__name(declension,"declension");exports.camelToKebab=camelToKebab;exports.capitalize=capitalize;exports.declension=declension;exports.decodeHtmlEntities=decodeHtmlEntities;exports.generateId=generateId;exports.isUppercase=isUppercase;exports.kebabToCamel=kebabToCamel;exports.snakeToDotted=snakeToDotted;exports.toPascalCase=toPascalCase;exports.uncapitalize=uncapitalize;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
3
|
+
function getElementTransitionDurationS(element) {
|
|
4
|
+
return parseFloat(getComputedStyle(element).transitionDuration || "");
|
|
5
|
+
}
|
|
6
|
+
__name(getElementTransitionDurationS, "getElementTransitionDurationS");
|
|
7
|
+
function getElementTransitionDurationMS(element) {
|
|
8
|
+
return getElementTransitionDurationS(element) * 1e3;
|
|
9
|
+
}
|
|
10
|
+
__name(getElementTransitionDurationMS, "getElementTransitionDurationMS");
|
|
11
|
+
export {
|
|
12
|
+
getElementTransitionDurationS as a,
|
|
13
|
+
getElementTransitionDurationMS as g
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function getElementTransitionDurationS(element){return parseFloat(getComputedStyle(element).transitionDuration||"")}__name(getElementTransitionDurationS,"getElementTransitionDurationS");function getElementTransitionDurationMS(element){return getElementTransitionDurationS(element)*1e3}__name(getElementTransitionDurationMS,"getElementTransitionDurationMS");exports.getElementTransitionDurationMS=getElementTransitionDurationMS;exports.getElementTransitionDurationS=getElementTransitionDurationS;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
3
|
+
import "construct-style-sheets-polyfill";
|
|
4
|
+
import { i as isBrowser } from "./index-DpKsHe97.js";
|
|
5
|
+
import { c as camelToKebab } from "./string-B3lm2b7v.js";
|
|
6
|
+
function styleToString(object) {
|
|
7
|
+
let text = "";
|
|
8
|
+
for (const key in object) {
|
|
9
|
+
const value = object[key];
|
|
10
|
+
typeof value == "object" ? (text += `${key} {`, text += styleToString(value), text += "}") : text += `${camelToKebab(key)}: ${value};`;
|
|
11
|
+
}
|
|
12
|
+
return text;
|
|
13
|
+
}
|
|
14
|
+
__name(styleToString, "styleToString");
|
|
15
|
+
function createStylesheet(value) {
|
|
16
|
+
if (isBrowser) {
|
|
17
|
+
const styleSheet = new CSSStyleSheet();
|
|
18
|
+
return styleSheet.replaceSync(
|
|
19
|
+
typeof value == "string" ? value : styleToString(value)
|
|
20
|
+
), styleSheet;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
__name(createStylesheet, "createStylesheet");
|
|
25
|
+
export {
|
|
26
|
+
createStylesheet as c,
|
|
27
|
+
styleToString as s
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});require("construct-style-sheets-polyfill");const intersector_index=require("./index-BpO2RJ__.cjs"),string=require("./string-CbRNzmd9.cjs");function styleToString(object){let text="";for(const key in object){const value=object[key];typeof value=="object"?(text+=`${key} {`,text+=styleToString(value),text+="}"):text+=`${string.camelToKebab(key)}: ${value};`}return text}__name(styleToString,"styleToString");function createStylesheet(value){if(intersector_index.isBrowser){const styleSheet=new CSSStyleSheet;return styleSheet.replaceSync(typeof value=="string"?value:styleToString(value)),styleSheet}return null}__name(createStylesheet,"createStylesheet");exports.createStylesheet=createStylesheet;exports.styleToString=styleToString;
|
package/lib/ticker/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const intersector_index=require("../index-BpO2RJ__.cjs"),dom=require("../dom-B40i6NXw.cjs");require("construct-style-sheets-polyfill");var _callback,_maxFPS,_order,_timestamp,_lastTimestamp,_subscribeTimestamp,_intersectionTimestamp,_timeBetweenFrames,_isVisible,_intersectionObserver,_intersectionListener;const _TickerSubscriber=class _TickerSubscriber{constructor(callback,options){__privateAdd(this,_callback);__privateAdd(this,_maxFPS);__privateAdd(this,_order);__privateAdd(this,_timestamp,0);__privateAdd(this,_lastTimestamp,0);__privateAdd(this,_subscribeTimestamp,0);__privateAdd(this,_intersectionTimestamp,0);__privateAdd(this,_timeBetweenFrames,0);__privateAdd(this,_isVisible,!1);__privateAdd(this,_intersectionObserver,null);__privateAdd(this,_intersectionListener,__name(entries=>{const entry=entries[0];__privateSet(this,_isVisible,entry.isIntersecting),__privateGet(this,_isVisible)&&__privateSet(this,_intersectionTimestamp,__privateGet(this,_timestamp))},"#intersectionListener"));if(__privateSet(this,_callback,callback),__privateSet(this,_maxFPS,options==null?void 0:options.maxFPS),__privateSet(this,_order,(options==null?void 0:options.order)||0),options!=null&&options.culling&&intersector_index.isBrowser){const element=dom.getElement(options.culling);element&&(__privateSet(this,_intersectionObserver,new IntersectionObserver(__privateGet(this,_intersectionListener))),__privateGet(this,_intersectionObserver).observe(element))}else __privateSet(this,_isVisible,!0)}get callback(){return __privateGet(this,_callback)}get order(){return __privateGet(this,_order)}sync(timestamp){__privateSet(this,_lastTimestamp,timestamp-__privateGet(this,_timeBetweenFrames))}tick(timestamp){if(__privateSet(this,_timestamp,timestamp),__privateSet(this,_timeBetweenFrames,Math.max(0,timestamp-__privateGet(this,_lastTimestamp))),__privateGet(this,_subscribeTimestamp)||__privateSet(this,_subscribeTimestamp,timestamp),__privateGet(this,_maxFPS))if(__privateGet(this,_timeBetweenFrames)>=1e3/__privateGet(this,_maxFPS))__privateSet(this,_lastTimestamp,timestamp-__privateGet(this,_timeBetweenFrames)%__privateGet(this,_maxFPS));else return;else __privateSet(this,_lastTimestamp,timestamp);__privateGet(this,_isVisible)&&__privateGet(this,_callback).call(this,{timeBetweenFrames:__privateGet(this,_timeBetweenFrames),timestamp,subscribeTimestamp:__privateGet(this,_subscribeTimestamp),timeElapsedSinceSubscription:timestamp-__privateGet(this,_subscribeTimestamp),timeElapsedSinceIntersection:timestamp-__privateGet(this,_intersectionTimestamp)})}destroy(){var _a;(_a=__privateGet(this,_intersectionObserver))==null||_a.disconnect()}};_callback=new WeakMap,_maxFPS=new WeakMap,_order=new WeakMap,_timestamp=new WeakMap,_lastTimestamp=new WeakMap,_subscribeTimestamp=new WeakMap,_intersectionTimestamp=new WeakMap,_timeBetweenFrames=new WeakMap,_isVisible=new WeakMap,_intersectionObserver=new WeakMap,_intersectionListener=new WeakMap,__name(_TickerSubscriber,"TickerSubscriber");let TickerSubscriber=_TickerSubscriber;var _idleTime,_timestamp2,_lastFrameId,_isDocumentHidden,_subscribers,_Ticker_instances,requestAnimationFrame_fn,cancelAnimationFrame_fn,_animationFrameListener,_documentVisibilityChangeListener;const _Ticker=class _Ticker{constructor(){__privateAdd(this,_Ticker_instances);__privateAdd(this,_idleTime,0);__privateAdd(this,_timestamp2,0);__privateAdd(this,_lastFrameId);__privateAdd(this,_isDocumentHidden,!1);__privateAdd(this,_subscribers,[]);__privateAdd(this,_animationFrameListener,__name(timestamp=>{if(__privateGet(this,_isDocumentHidden)){__privateSet(this,_isDocumentHidden,!1),__privateSet(this,_idleTime,timestamp-__privateGet(this,_timestamp2));for(const subscriber of __privateGet(this,_subscribers))subscriber.sync(__privateGet(this,_timestamp2))}__privateSet(this,_lastFrameId,requestAnimationFrame(__privateGet(this,_animationFrameListener))),__privateSet(this,_timestamp2,timestamp-__privateGet(this,_idleTime));for(const subscriber of __privateGet(this,_subscribers))subscriber.tick(__privateGet(this,_timestamp2))},"#animationFrameListener"));__privateAdd(this,_documentVisibilityChangeListener,__name(()=>{document.hidden&&__privateSet(this,_isDocumentHidden,!0)},"#documentVisibilityChangeListener"));intersector_index.isBrowser&&document.addEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))}subscribe(callback,options){if(!__privateGet(this,_subscribers).find(s=>s.callback===callback)){const subscriber=new TickerSubscriber(callback,options);subscriber.sync(performance.now()),__privateGet(this,_subscribers).push(subscriber),__privateSet(this,_subscribers,__privateGet(this,_subscribers).sort((a,b)=>a.order-b.order))}return __privateMethod(this,_Ticker_instances,requestAnimationFrame_fn).call(this),()=>this.unsubscribe(callback)}unsubscribe(callback){const matches=__privateGet(this,_subscribers).filter(subscriber=>subscriber.callback===callback);matches.length&&(matches.forEach(m=>m.destroy()),__privateSet(this,_subscribers,__privateGet(this,_subscribers).filter(subscriber=>subscriber.callback!==callback)),__privateGet(this,_subscribers).length||__privateMethod(this,_Ticker_instances,cancelAnimationFrame_fn).call(this))}destroy(){intersector_index.isBrowser&&(__privateMethod(this,_Ticker_instances,cancelAnimationFrame_fn).call(this),document.removeEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener)))}};_idleTime=new WeakMap,_timestamp2=new WeakMap,_lastFrameId=new WeakMap,_isDocumentHidden=new WeakMap,_subscribers=new WeakMap,_Ticker_instances=new WeakSet,requestAnimationFrame_fn=__name(function(){__privateGet(this,_subscribers).length&&!__privateGet(this,_lastFrameId)&&__privateSet(this,_lastFrameId,requestAnimationFrame(__privateGet(this,_animationFrameListener)))},"#requestAnimationFrame"),cancelAnimationFrame_fn=__name(function(){__privateGet(this,_lastFrameId)&&(cancelAnimationFrame(__privateGet(this,_lastFrameId)),__privateSet(this,_lastFrameId,void 0))},"#cancelAnimationFrame"),_animationFrameListener=new WeakMap,_documentVisibilityChangeListener=new WeakMap,__name(_Ticker,"Ticker");let Ticker=_Ticker;const ticker=new Ticker;exports.Ticker=Ticker;exports.ticker=ticker;
|
package/lib/ticker/index.js
CHANGED
|
@@ -1,123 +1,127 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
3
4
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
import {
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
6
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
8
|
+
import { i as isBrowser } from "../index-DpKsHe97.js";
|
|
9
|
+
import { g as getElement } from "../dom-D8D-_9ty.js";
|
|
8
10
|
import "construct-style-sheets-polyfill";
|
|
9
|
-
var
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)),
|
|
11
|
+
var _callback, _maxFPS, _order, _timestamp, _lastTimestamp, _subscribeTimestamp, _intersectionTimestamp, _timeBetweenFrames, _isVisible, _intersectionObserver, _intersectionListener;
|
|
12
|
+
const _TickerSubscriber = class _TickerSubscriber {
|
|
13
|
+
constructor(callback, options) {
|
|
14
|
+
__privateAdd(this, _callback);
|
|
15
|
+
__privateAdd(this, _maxFPS);
|
|
16
|
+
__privateAdd(this, _order);
|
|
17
|
+
__privateAdd(this, _timestamp, 0);
|
|
18
|
+
__privateAdd(this, _lastTimestamp, 0);
|
|
19
|
+
__privateAdd(this, _subscribeTimestamp, 0);
|
|
20
|
+
__privateAdd(this, _intersectionTimestamp, 0);
|
|
21
|
+
__privateAdd(this, _timeBetweenFrames, 0);
|
|
22
|
+
__privateAdd(this, _isVisible, !1);
|
|
23
|
+
__privateAdd(this, _intersectionObserver, null);
|
|
24
|
+
__privateAdd(this, _intersectionListener, /* @__PURE__ */ __name((entries) => {
|
|
25
|
+
const entry = entries[0];
|
|
26
|
+
__privateSet(this, _isVisible, entry.isIntersecting), __privateGet(this, _isVisible) && __privateSet(this, _intersectionTimestamp, __privateGet(this, _timestamp));
|
|
27
|
+
}, "#intersectionListener"));
|
|
28
|
+
if (__privateSet(this, _callback, callback), __privateSet(this, _maxFPS, options == null ? void 0 : options.maxFPS), __privateSet(this, _order, (options == null ? void 0 : options.order) || 0), options != null && options.culling && isBrowser) {
|
|
29
|
+
const element = getElement(options.culling);
|
|
30
|
+
element && (__privateSet(this, _intersectionObserver, new IntersectionObserver(
|
|
31
|
+
__privateGet(this, _intersectionListener)
|
|
32
|
+
)), __privateGet(this, _intersectionObserver).observe(element));
|
|
31
33
|
} else
|
|
32
|
-
|
|
34
|
+
__privateSet(this, _isVisible, !0);
|
|
33
35
|
}
|
|
34
36
|
get callback() {
|
|
35
|
-
return
|
|
37
|
+
return __privateGet(this, _callback);
|
|
36
38
|
}
|
|
37
39
|
get order() {
|
|
38
|
-
return
|
|
40
|
+
return __privateGet(this, _order);
|
|
39
41
|
}
|
|
40
|
-
sync(
|
|
41
|
-
|
|
42
|
+
sync(timestamp) {
|
|
43
|
+
__privateSet(this, _lastTimestamp, timestamp - __privateGet(this, _timeBetweenFrames));
|
|
42
44
|
}
|
|
43
|
-
tick(
|
|
44
|
-
if (
|
|
45
|
-
if (
|
|
46
|
-
|
|
45
|
+
tick(timestamp) {
|
|
46
|
+
if (__privateSet(this, _timestamp, timestamp), __privateSet(this, _timeBetweenFrames, Math.max(0, timestamp - __privateGet(this, _lastTimestamp))), __privateGet(this, _subscribeTimestamp) || __privateSet(this, _subscribeTimestamp, timestamp), __privateGet(this, _maxFPS))
|
|
47
|
+
if (__privateGet(this, _timeBetweenFrames) >= 1e3 / __privateGet(this, _maxFPS))
|
|
48
|
+
__privateSet(this, _lastTimestamp, timestamp - __privateGet(this, _timeBetweenFrames) % __privateGet(this, _maxFPS));
|
|
47
49
|
else
|
|
48
50
|
return;
|
|
49
51
|
else
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
timeBetweenFrames:
|
|
53
|
-
timestamp
|
|
54
|
-
subscribeTimestamp:
|
|
55
|
-
timeElapsedSinceSubscription:
|
|
56
|
-
timeElapsedSinceIntersection:
|
|
52
|
+
__privateSet(this, _lastTimestamp, timestamp);
|
|
53
|
+
__privateGet(this, _isVisible) && __privateGet(this, _callback).call(this, {
|
|
54
|
+
timeBetweenFrames: __privateGet(this, _timeBetweenFrames),
|
|
55
|
+
timestamp,
|
|
56
|
+
subscribeTimestamp: __privateGet(this, _subscribeTimestamp),
|
|
57
|
+
timeElapsedSinceSubscription: timestamp - __privateGet(this, _subscribeTimestamp),
|
|
58
|
+
timeElapsedSinceIntersection: timestamp - __privateGet(this, _intersectionTimestamp)
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
destroy() {
|
|
60
|
-
var
|
|
61
|
-
(
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = __privateGet(this, _intersectionObserver)) == null || _a.disconnect();
|
|
62
64
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
};
|
|
66
|
+
_callback = new WeakMap(), _maxFPS = new WeakMap(), _order = new WeakMap(), _timestamp = new WeakMap(), _lastTimestamp = new WeakMap(), _subscribeTimestamp = new WeakMap(), _intersectionTimestamp = new WeakMap(), _timeBetweenFrames = new WeakMap(), _isVisible = new WeakMap(), _intersectionObserver = new WeakMap(), _intersectionListener = new WeakMap(), __name(_TickerSubscriber, "TickerSubscriber");
|
|
67
|
+
let TickerSubscriber = _TickerSubscriber;
|
|
68
|
+
var _idleTime, _timestamp2, _lastFrameId, _isDocumentHidden, _subscribers, _Ticker_instances, requestAnimationFrame_fn, cancelAnimationFrame_fn, _animationFrameListener, _documentVisibilityChangeListener;
|
|
69
|
+
const _Ticker = class _Ticker {
|
|
67
70
|
constructor() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
for (const
|
|
78
|
-
|
|
71
|
+
__privateAdd(this, _Ticker_instances);
|
|
72
|
+
__privateAdd(this, _idleTime, 0);
|
|
73
|
+
__privateAdd(this, _timestamp2, 0);
|
|
74
|
+
__privateAdd(this, _lastFrameId);
|
|
75
|
+
__privateAdd(this, _isDocumentHidden, !1);
|
|
76
|
+
__privateAdd(this, _subscribers, []);
|
|
77
|
+
__privateAdd(this, _animationFrameListener, /* @__PURE__ */ __name((timestamp) => {
|
|
78
|
+
if (__privateGet(this, _isDocumentHidden)) {
|
|
79
|
+
__privateSet(this, _isDocumentHidden, !1), __privateSet(this, _idleTime, timestamp - __privateGet(this, _timestamp2));
|
|
80
|
+
for (const subscriber of __privateGet(this, _subscribers))
|
|
81
|
+
subscriber.sync(__privateGet(this, _timestamp2));
|
|
79
82
|
}
|
|
80
|
-
|
|
81
|
-
for (const
|
|
82
|
-
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
document.hidden &&
|
|
86
|
-
});
|
|
87
|
-
|
|
83
|
+
__privateSet(this, _lastFrameId, requestAnimationFrame(__privateGet(this, _animationFrameListener))), __privateSet(this, _timestamp2, timestamp - __privateGet(this, _idleTime));
|
|
84
|
+
for (const subscriber of __privateGet(this, _subscribers))
|
|
85
|
+
subscriber.tick(__privateGet(this, _timestamp2));
|
|
86
|
+
}, "#animationFrameListener"));
|
|
87
|
+
__privateAdd(this, _documentVisibilityChangeListener, /* @__PURE__ */ __name(() => {
|
|
88
|
+
document.hidden && __privateSet(this, _isDocumentHidden, !0);
|
|
89
|
+
}, "#documentVisibilityChangeListener"));
|
|
90
|
+
isBrowser && document.addEventListener(
|
|
88
91
|
"visibilitychange",
|
|
89
|
-
|
|
92
|
+
__privateGet(this, _documentVisibilityChangeListener)
|
|
90
93
|
);
|
|
91
94
|
}
|
|
92
|
-
subscribe(
|
|
93
|
-
if (!
|
|
94
|
-
const
|
|
95
|
-
|
|
95
|
+
subscribe(callback, options) {
|
|
96
|
+
if (!__privateGet(this, _subscribers).find((s) => s.callback === callback)) {
|
|
97
|
+
const subscriber = new TickerSubscriber(callback, options);
|
|
98
|
+
subscriber.sync(performance.now()), __privateGet(this, _subscribers).push(subscriber), __privateSet(this, _subscribers, __privateGet(this, _subscribers).sort((a, b) => a.order - b.order));
|
|
96
99
|
}
|
|
97
|
-
return
|
|
100
|
+
return __privateMethod(this, _Ticker_instances, requestAnimationFrame_fn).call(this), () => this.unsubscribe(callback);
|
|
98
101
|
}
|
|
99
|
-
unsubscribe(
|
|
100
|
-
const
|
|
101
|
-
(
|
|
102
|
+
unsubscribe(callback) {
|
|
103
|
+
const matches = __privateGet(this, _subscribers).filter(
|
|
104
|
+
(subscriber) => subscriber.callback === callback
|
|
102
105
|
);
|
|
103
|
-
|
|
104
|
-
(
|
|
105
|
-
)),
|
|
106
|
+
matches.length && (matches.forEach((m) => m.destroy()), __privateSet(this, _subscribers, __privateGet(this, _subscribers).filter(
|
|
107
|
+
(subscriber) => subscriber.callback !== callback
|
|
108
|
+
)), __privateGet(this, _subscribers).length || __privateMethod(this, _Ticker_instances, cancelAnimationFrame_fn).call(this));
|
|
106
109
|
}
|
|
107
110
|
destroy() {
|
|
108
|
-
|
|
111
|
+
isBrowser && (__privateMethod(this, _Ticker_instances, cancelAnimationFrame_fn).call(this), document.removeEventListener(
|
|
109
112
|
"visibilitychange",
|
|
110
|
-
|
|
113
|
+
__privateGet(this, _documentVisibilityChangeListener)
|
|
111
114
|
));
|
|
112
115
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
116
|
+
};
|
|
117
|
+
_idleTime = new WeakMap(), _timestamp2 = new WeakMap(), _lastFrameId = new WeakMap(), _isDocumentHidden = new WeakMap(), _subscribers = new WeakMap(), _Ticker_instances = new WeakSet(), requestAnimationFrame_fn = /* @__PURE__ */ __name(function() {
|
|
118
|
+
__privateGet(this, _subscribers).length && !__privateGet(this, _lastFrameId) && __privateSet(this, _lastFrameId, requestAnimationFrame(__privateGet(this, _animationFrameListener)));
|
|
119
|
+
}, "#requestAnimationFrame"), cancelAnimationFrame_fn = /* @__PURE__ */ __name(function() {
|
|
120
|
+
__privateGet(this, _lastFrameId) && (cancelAnimationFrame(__privateGet(this, _lastFrameId)), __privateSet(this, _lastFrameId, void 0));
|
|
121
|
+
}, "#cancelAnimationFrame"), _animationFrameListener = new WeakMap(), _documentVisibilityChangeListener = new WeakMap(), __name(_Ticker, "Ticker");
|
|
122
|
+
let Ticker = _Ticker;
|
|
123
|
+
const ticker = new Ticker();
|
|
120
124
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
Ticker,
|
|
126
|
+
ticker
|
|
123
127
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function splitPath(value,{base="",trailingSlash=!1,mergeParams,removeParams}={}){base=base.endsWith("/")?base.slice(0,-1):base,value=value.replace(base,""),value.startsWith("/")&&(value=value.slice(1));const split1=value.split("#"),split2=split1[0].split("?");let leaf=split2[0].startsWith("/")?split2[0]:"/"+split2[0];trailingSlash?leaf=!leaf.endsWith("/")&&leaf!=="/"?leaf+"/":leaf:leaf=leaf.endsWith("/")&&leaf!=="/"?leaf.slice(0,-1):leaf;let parameters=split2[1]||"";if(mergeParams){const existingParams=new URLSearchParams(parameters),mergeParamsObj=new URLSearchParams(mergeParams);for(const[key,value2]of mergeParamsObj)existingParams.has(key)||existingParams.set(key,value2);removeParams==null||removeParams.split(",").forEach(param=>{existingParams.has(param)&&existingParams.delete(param)}),parameters=existingParams.toString()}const pathname=base+leaf,hash=split1[1],path=`${pathname}${parameters?"?"+parameters:""}${hash?"#"+hash:""}`;return{leaf,pathname,parameters,hash,path}}__name(splitPath,"splitPath");function normalizeBase(base="/"){return base.endsWith("/")||(base+="/"),base.startsWith("/")||(base+="/"),base}__name(normalizeBase,"normalizeBase");function changeHistory(p){if(p.action==="none")return;const por=p==null?void 0:p.searchParameters,hash=p.hash?p.hash.startsWith("#")?p.hash:"#"+p.hash:"",searhParameters=por?por.startsWith("?")?por:"?"+por:"",pathPlus=`${p.pathname}${searhParameters}${hash}`,hstate=__spreadProps(__spreadValues({},p.state),{path:pathPlus});p.action==="push"?history.pushState(hstate,"",pathPlus):p.action==="replace"&&history.replaceState(hstate,"",pathPlus)}__name(changeHistory,"changeHistory");function parseSearchParameters(search){const params=new URLSearchParams(search),values={};for(const[key,value]of params)values[key]=value;return values}__name(parseSearchParameters,"parseSearchParameters");function updateSearchParameter(parameterName,value){const url=new URL(location.href),v=(value==null?void 0:value.toString())||"";url.searchParams.set(parameterName,v),history.replaceState(history.state,"",url.href)}__name(updateSearchParameter,"updateSearchParameter");function updateURLAttr(el,attr,base){el.setAttribute(attr,new URL(el.getAttribute(attr),base).pathname)}__name(updateURLAttr,"updateURLAttr");function normalizeRelativeURLs(el,base){el.querySelectorAll('[href^="./"], [href^="../"]').forEach(item=>updateURLAttr(item,"href",base)),el.querySelectorAll('[src^="./"], [src^="../"]').forEach(item=>updateURLAttr(item,"src",base))}__name(normalizeRelativeURLs,"normalizeRelativeURLs");function normalizeURL(url,{base="",trailingSlash=!1}={}){base=base.replace(/^\/|\/$/g,"");const path=typeof url=="string"?url.replace(/^\/|\/$/g,""):url.pathname.replace(/^\/|\/$/g,"");let urlString="";return path.includes(base)?urlString=`/${path}`:urlString=`${base}/${path}`,trailingSlash&&!urlString.endsWith("/")&&(urlString+="/"),new URL(urlString,location.origin)}__name(normalizeURL,"normalizeURL");function isLocalUrl(href){try{const url=new URL(href);if(window.location.origin===url.origin)return url.pathname===window.location.pathname?!url.hash:!0}catch(e){}return!1}__name(isLocalUrl,"isLocalUrl");function searchParamsObjectToString(parameters){if(!parameters)return"";const params=new URLSearchParams;for(const[key,value]of Object.entries(parameters))value!=null&&value!==!1&&value!==""&¶ms.append(key,String(value));return params.toString()}__name(searchParamsObjectToString,"searchParamsObjectToString");function searchParamsToObject(params){const object={};for(const[key,value]of params.entries())value!=null&&(object[key]=value);return object}__name(searchParamsToObject,"searchParamsToObject");exports.changeHistory=changeHistory;exports.isLocalUrl=isLocalUrl;exports.normalizeBase=normalizeBase;exports.normalizeRelativeURLs=normalizeRelativeURLs;exports.normalizeURL=normalizeURL;exports.parseSearchParameters=parseSearchParameters;exports.searchParamsObjectToString=searchParamsObjectToString;exports.searchParamsToObject=searchParamsToObject;exports.splitPath=splitPath;exports.updateSearchParameter=updateSearchParameter;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
|
|
2
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
|
|
6
|
+
for (var prop in b || (b = {}))
|
|
7
|
+
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
8
|
+
if (__getOwnPropSymbols)
|
|
9
|
+
for (var prop of __getOwnPropSymbols(b))
|
|
10
|
+
__propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
11
|
+
return a;
|
|
12
|
+
}, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
13
|
+
function splitPath(value, {
|
|
14
|
+
base = "",
|
|
15
|
+
trailingSlash = !1,
|
|
16
|
+
mergeParams,
|
|
17
|
+
removeParams
|
|
18
|
+
} = {}) {
|
|
19
|
+
base = base.endsWith("/") ? base.slice(0, -1) : base, value = value.replace(base, ""), value.startsWith("/") && (value = value.slice(1));
|
|
20
|
+
const split1 = value.split("#"), split2 = split1[0].split("?");
|
|
21
|
+
let leaf = split2[0].startsWith("/") ? split2[0] : "/" + split2[0];
|
|
22
|
+
trailingSlash ? leaf = !leaf.endsWith("/") && leaf !== "/" ? leaf + "/" : leaf : leaf = leaf.endsWith("/") && leaf !== "/" ? leaf.slice(0, -1) : leaf;
|
|
23
|
+
let parameters = split2[1] || "";
|
|
24
|
+
if (mergeParams) {
|
|
25
|
+
const existingParams = new URLSearchParams(parameters), mergeParamsObj = new URLSearchParams(mergeParams);
|
|
26
|
+
for (const [key, value2] of mergeParamsObj)
|
|
27
|
+
existingParams.has(key) || existingParams.set(key, value2);
|
|
28
|
+
removeParams == null || removeParams.split(",").forEach((param) => {
|
|
29
|
+
existingParams.has(param) && existingParams.delete(param);
|
|
30
|
+
}), parameters = existingParams.toString();
|
|
31
|
+
}
|
|
32
|
+
const pathname = base + leaf, hash = split1[1], path = `${pathname}${parameters ? "?" + parameters : ""}${hash ? "#" + hash : ""}`;
|
|
33
|
+
return {
|
|
34
|
+
leaf,
|
|
35
|
+
pathname,
|
|
36
|
+
parameters,
|
|
37
|
+
hash,
|
|
38
|
+
path
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
__name(splitPath, "splitPath");
|
|
42
|
+
function normalizeBase(base = "/") {
|
|
43
|
+
return base.endsWith("/") || (base += "/"), base.startsWith("/") || (base += "/"), base;
|
|
44
|
+
}
|
|
45
|
+
__name(normalizeBase, "normalizeBase");
|
|
46
|
+
function changeHistory(p) {
|
|
47
|
+
if (p.action === "none")
|
|
48
|
+
return;
|
|
49
|
+
const por = p == null ? void 0 : p.searchParameters, hash = p.hash ? p.hash.startsWith("#") ? p.hash : "#" + p.hash : "", searhParameters = por ? por.startsWith("?") ? por : "?" + por : "", pathPlus = `${p.pathname}${searhParameters}${hash}`, hstate = __spreadProps(__spreadValues({}, p.state), { path: pathPlus });
|
|
50
|
+
p.action === "push" ? history.pushState(hstate, "", pathPlus) : p.action === "replace" && history.replaceState(hstate, "", pathPlus);
|
|
51
|
+
}
|
|
52
|
+
__name(changeHistory, "changeHistory");
|
|
53
|
+
function parseSearchParameters(search) {
|
|
54
|
+
const params = new URLSearchParams(search), values = {};
|
|
55
|
+
for (const [key, value] of params)
|
|
56
|
+
values[key] = value;
|
|
57
|
+
return values;
|
|
58
|
+
}
|
|
59
|
+
__name(parseSearchParameters, "parseSearchParameters");
|
|
60
|
+
function updateSearchParameter(parameterName, value) {
|
|
61
|
+
const url = new URL(location.href), v = (value == null ? void 0 : value.toString()) || "";
|
|
62
|
+
url.searchParams.set(parameterName, v), history.replaceState(history.state, "", url.href);
|
|
63
|
+
}
|
|
64
|
+
__name(updateSearchParameter, "updateSearchParameter");
|
|
65
|
+
function updateURLAttr(el, attr, base) {
|
|
66
|
+
el.setAttribute(attr, new URL(el.getAttribute(attr), base).pathname);
|
|
67
|
+
}
|
|
68
|
+
__name(updateURLAttr, "updateURLAttr");
|
|
69
|
+
function normalizeRelativeURLs(el, base) {
|
|
70
|
+
el.querySelectorAll('[href^="./"], [href^="../"]').forEach(
|
|
71
|
+
(item) => updateURLAttr(item, "href", base)
|
|
72
|
+
), el.querySelectorAll('[src^="./"], [src^="../"]').forEach(
|
|
73
|
+
(item) => updateURLAttr(item, "src", base)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
__name(normalizeRelativeURLs, "normalizeRelativeURLs");
|
|
77
|
+
function normalizeURL(url, {
|
|
78
|
+
base = "",
|
|
79
|
+
trailingSlash = !1
|
|
80
|
+
} = {}) {
|
|
81
|
+
base = base.replace(/^\/|\/$/g, "");
|
|
82
|
+
const path = typeof url == "string" ? url.replace(/^\/|\/$/g, "") : url.pathname.replace(/^\/|\/$/g, "");
|
|
83
|
+
let urlString = "";
|
|
84
|
+
return path.includes(base) ? urlString = `/${path}` : urlString = `${base}/${path}`, trailingSlash && !urlString.endsWith("/") && (urlString += "/"), new URL(urlString, location.origin);
|
|
85
|
+
}
|
|
86
|
+
__name(normalizeURL, "normalizeURL");
|
|
87
|
+
function isLocalUrl(href) {
|
|
88
|
+
try {
|
|
89
|
+
const url = new URL(href);
|
|
90
|
+
if (window.location.origin === url.origin)
|
|
91
|
+
return url.pathname === window.location.pathname ? !url.hash : !0;
|
|
92
|
+
} catch (e) {
|
|
93
|
+
}
|
|
94
|
+
return !1;
|
|
95
|
+
}
|
|
96
|
+
__name(isLocalUrl, "isLocalUrl");
|
|
97
|
+
function searchParamsObjectToString(parameters) {
|
|
98
|
+
if (!parameters)
|
|
99
|
+
return "";
|
|
100
|
+
const params = new URLSearchParams();
|
|
101
|
+
for (const [key, value] of Object.entries(parameters))
|
|
102
|
+
value != null && value !== !1 && value !== "" && params.append(key, String(value));
|
|
103
|
+
return params.toString();
|
|
104
|
+
}
|
|
105
|
+
__name(searchParamsObjectToString, "searchParamsObjectToString");
|
|
106
|
+
function searchParamsToObject(params) {
|
|
107
|
+
const object = {};
|
|
108
|
+
for (const [key, value] of params.entries())
|
|
109
|
+
value != null && (object[key] = value);
|
|
110
|
+
return object;
|
|
111
|
+
}
|
|
112
|
+
__name(searchParamsToObject, "searchParamsToObject");
|
|
113
|
+
export {
|
|
114
|
+
normalizeBase as a,
|
|
115
|
+
normalizeRelativeURLs as b,
|
|
116
|
+
changeHistory as c,
|
|
117
|
+
splitPath as d,
|
|
118
|
+
searchParamsToObject as e,
|
|
119
|
+
isLocalUrl as i,
|
|
120
|
+
normalizeURL as n,
|
|
121
|
+
parseSearchParameters as p,
|
|
122
|
+
searchParamsObjectToString as s,
|
|
123
|
+
updateSearchParameter as u
|
|
124
|
+
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare function parseAttribute(element: HTMLElement, attributeName: string): string | number | boolean | null;
|
|
2
2
|
export declare function parseAttributeValue(value: string | null | undefined): string | number | boolean | null;
|
|
3
|
+
export declare function parseAttributeValueAdvanced(value: string): any;
|
|
4
|
+
export declare function getElementAttributesAdvanced(element: HTMLElement): Record<string, any>;
|
package/lib/utils/dom.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export declare function traverseShadowRoots(root: Element, callback: (element: E
|
|
|
8
8
|
export declare function intersectElements(elements: Array<Element>, elementsToIntersect: Array<Element>): Element[];
|
|
9
9
|
export declare function excludeElements(elements: Array<Element>, elementsToExclude: Array<Element>): Element[];
|
|
10
10
|
export declare function createScriptElement(element: HTMLScriptElement): HTMLScriptElement;
|
|
11
|
+
export declare function deepQuerySelectorAll(selector: string, root?: Document): Element[];
|