aptechka 0.1.1 → 0.1.3
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/Damped-DdPj4Sho.cjs +1 -0
- package/lib/Damped-H3PuZwKV.js +152 -0
- package/lib/SourceManager-tmQlXkSD.cjs +1 -0
- package/lib/SourceManager-vXInLlh_.js +108 -0
- package/lib/Store-qq7IjRLE.js +136 -0
- package/lib/Store-txkR3wXU.cjs +1 -0
- package/lib/WheelControls-9ZQKSYYq.js +83 -0
- package/lib/WheelControls-TYhGU6oA.cjs +1 -0
- package/lib/accordion/AccordionElement.d.ts +7 -0
- package/lib/accordion/index.d.ts +1 -0
- package/lib/animation/Animated.d.ts +41 -0
- package/lib/animation/Damped.d.ts +11 -0
- package/lib/animation/Tweened.d.ts +16 -0
- package/lib/animation/index.cjs +1 -0
- package/lib/animation/index.d.ts +3 -0
- package/lib/animation/index.js +56 -0
- package/lib/attribute/index.cjs +1 -0
- package/lib/attribute/index.d.ts +8 -0
- package/lib/attribute/index.js +47 -0
- package/lib/attributes-_2U65GDl.cjs +1 -0
- package/lib/attributes-w0u-KiIb.js +10 -0
- package/lib/browser-QbF6EW-w.cjs +1 -0
- package/lib/browser-S4eq8AeN.js +4 -0
- package/lib/canvas-2d/index.cjs +5 -0
- package/lib/canvas-2d/index.d.ts +30 -0
- package/lib/canvas-2d/index.js +90 -0
- package/lib/controls/Controls.d.ts +9 -0
- package/lib/controls/KeyboardControls.d.ts +10 -0
- package/lib/controls/LinearControls.d.ts +11 -0
- package/lib/controls/WheelControls.d.ts +17 -0
- package/lib/controls/index.cjs +1 -0
- package/lib/controls/index.d.ts +4 -0
- package/lib/controls/index.js +42 -0
- package/lib/css-unit-parser/index.cjs +8 -0
- package/lib/css-unit-parser/index.d.ts +6 -0
- package/lib/css-unit-parser/index.js +36 -0
- package/lib/custom-element/index.cjs +1 -0
- package/lib/custom-element/index.d.ts +8 -0
- package/lib/custom-element/index.js +16 -0
- package/lib/device/Device.d.ts +17 -0
- package/lib/device/Viewport.d.ts +27 -0
- package/lib/device/index.cjs +1 -0
- package/lib/device/index.d.ts +2 -0
- package/lib/device/index.js +123 -0
- package/lib/dom-QhWsdQS2.cjs +1 -0
- package/lib/dom-bHEwc_xV.js +24 -0
- package/lib/easings-_wFs9ZWc.cjs +1 -0
- package/lib/easings-uF-tgahf.js +19 -0
- package/lib/element-constructor/ElementConstructor.d.ts +76 -0
- package/lib/element-constructor/htmlTags.d.ts +113 -0
- package/lib/element-constructor/index.cjs +1 -0
- package/lib/element-constructor/index.d.ts +4 -0
- package/lib/element-constructor/index.js +1390 -0
- package/lib/element-constructor/specialObjects.d.ts +2 -0
- package/lib/element-constructor/svgTags.d.ts +64 -0
- package/lib/en3/attachments/En3SourceManager.d.ts +30 -0
- package/lib/en3/core/en3.d.ts +55 -0
- package/lib/en3/index.cjs +28 -0
- package/lib/en3/index.d.ts +18 -0
- package/lib/en3/index.js +3249 -0
- package/lib/en3/instances/en3LazyLoader.d.ts +7 -0
- package/lib/en3/libs/MeshoptDecoder.d.ts +1 -0
- package/lib/en3/loaders/en3GLTFLoader.d.ts +16 -0
- package/lib/en3/loaders/en3TextureLoader.d.ts +2 -0
- package/lib/en3/objects/En3Clip.d.ts +10 -0
- package/lib/en3/objects/En3ClipHelpers.d.ts +5 -0
- package/lib/en3/objects/En3GLTF.d.ts +9 -0
- package/lib/en3/objects/En3Image.d.ts +7 -0
- package/lib/en3/objects/En3ImageLike.d.ts +22 -0
- package/{src/packages/en3/objects/En3SourceConsumer.ts → lib/en3/objects/En3SourceConsumer.d.ts} +2 -3
- package/lib/en3/objects/En3Video.d.ts +12 -0
- package/lib/en3/test/En3HTML.d.ts +9 -0
- package/lib/en3/test/En3ModifiedMaterial.d.ts +32 -0
- package/lib/en3/test/En3Raycaster.d.ts +19 -0
- package/lib/en3/utils/coverTexture.d.ts +6 -0
- package/lib/en3/utils/dispose.d.ts +2 -0
- package/lib/en3/utils/traverseMaterials.d.ts +2 -0
- package/lib/en3/utils/traverseMeshes.d.ts +2 -0
- package/lib/function-QP7IreXR.cjs +1 -0
- package/lib/function-zwSFehNd.js +17 -0
- package/lib/image/index.cjs +1 -0
- package/lib/image/index.d.ts +10 -0
- package/lib/image/index.js +30 -0
- package/lib/intersector/index.cjs +1 -0
- package/lib/intersector/index.d.ts +8 -0
- package/lib/intersector/index.js +55 -0
- package/lib/ladder/index.cjs +1 -0
- package/lib/ladder/index.d.ts +21 -0
- package/lib/ladder/index.js +97 -0
- package/lib/layout-5SJlcXTY.js +12 -0
- package/lib/layout-box/index.cjs +1 -0
- package/lib/layout-box/index.d.ts +78 -0
- package/lib/layout-box/index.js +235 -0
- package/lib/layout-rZzbsLPd.cjs +1 -0
- package/lib/loading/index.cjs +1 -0
- package/lib/loading/index.d.ts +38 -0
- package/lib/loading/index.js +99 -0
- package/lib/math-FNUBmQPK.cjs +1 -0
- package/lib/math-_a3IpKOc.js +45 -0
- package/lib/measurer/CumulativeOffsetLeft.d.ts +4 -0
- package/lib/measurer/CumulativeOffsetTop.d.ts +4 -0
- package/lib/measurer/Meaurer.d.ts +8 -0
- package/lib/measurer/index.cjs +1 -0
- package/lib/measurer/index.d.ts +3 -0
- package/lib/measurer/index.js +48 -0
- package/lib/media/index.cjs +1 -0
- package/lib/media/index.d.ts +11 -0
- package/lib/media/index.js +33 -0
- package/lib/morph/Link.d.ts +6 -0
- package/lib/morph/Morph.d.ts +26 -0
- package/lib/morph/index.cjs +1 -0
- package/lib/morph/index.d.ts +1 -0
- package/lib/morph/index.js +182 -0
- package/lib/notifier/index.cjs +1 -0
- package/lib/notifier/index.d.ts +8 -0
- package/lib/notifier/index.js +38 -0
- package/lib/number-2bR0KBcX.cjs +1 -0
- package/lib/number-bCHB2GAD.js +31 -0
- package/lib/order/index.cjs +1 -0
- package/lib/order/index.d.ts +13 -0
- package/lib/order/index.js +5 -0
- package/lib/resizer/index.cjs +1 -0
- package/lib/resizer/index.d.ts +10 -0
- package/lib/resizer/index.js +45 -0
- package/lib/router/Link.d.ts +6 -0
- package/lib/router/Route.d.ts +15 -0
- package/lib/router/RouteElement.d.ts +14 -0
- package/lib/router/Router.d.ts +33 -0
- package/lib/router/index.cjs +1 -0
- package/lib/router/index.d.ts +3 -0
- package/lib/router/index.js +266 -0
- package/lib/scroll/ScrollElement.d.ts +40 -0
- package/lib/scroll/ScrollUserElement.d.ts +7 -0
- package/lib/scroll/ScrollbarElement.d.ts +13 -0
- package/lib/scroll/index.cjs +71 -0
- package/lib/scroll/index.d.ts +2 -0
- package/lib/scroll/index.js +444 -0
- package/lib/scroll-entries/index.cjs +1 -0
- package/lib/scroll-entries/index.d.ts +17 -0
- package/lib/scroll-entries/index.js +56 -0
- package/lib/source/SourceClass.d.ts +11 -0
- package/lib/source/SourceElement.d.ts +16 -0
- package/lib/source/SourceManager.d.ts +13 -0
- package/lib/source/SourceSet.d.ts +8 -0
- package/lib/source/index.cjs +5 -0
- package/lib/source/index.d.ts +4 -0
- package/lib/source/index.js +95 -0
- package/lib/store/Composed.d.ts +7 -0
- package/lib/store/CumulativeResource.d.ts +12 -0
- package/lib/store/Derived.d.ts +7 -0
- package/lib/store/DerivedArray.d.ts +7 -0
- package/lib/store/Resource.d.ts +14 -0
- package/lib/store/Store.d.ts +33 -0
- package/lib/store/StoreRegistry.d.ts +22 -0
- package/lib/store/index.cjs +1 -0
- package/lib/store/index.d.ts +6 -0
- package/lib/store/index.js +99 -0
- package/lib/string-GmxZA5Nq.js +31 -0
- package/lib/string-WmNOGq16.cjs +1 -0
- package/lib/studio/StudioElement.d.ts +9 -0
- package/lib/studio/index.d.ts +1 -0
- package/lib/ticker/index.cjs +1 -0
- package/lib/ticker/index.d.ts +19 -0
- package/lib/ticker/index.js +107 -0
- package/lib/utils/array.d.ts +1 -0
- package/lib/utils/attributes.d.ts +2 -0
- package/lib/utils/browser.d.ts +1 -0
- package/lib/utils/canvas.d.ts +6 -0
- package/lib/utils/collisions.d.ts +3 -0
- package/lib/utils/coordinates.d.ts +13 -0
- package/lib/utils/decoding.d.ts +2 -0
- package/lib/utils/dev.d.ts +3 -0
- package/lib/utils/dom.d.ts +4 -0
- package/lib/utils/easings.d.ts +17 -0
- package/lib/utils/file.d.ts +1 -0
- package/lib/utils/function.d.ts +2 -0
- package/lib/utils/index.cjs +1 -0
- package/lib/utils/index.d.ts +19 -0
- package/lib/utils/index.js +203 -0
- package/lib/utils/layout.d.ts +3 -0
- package/lib/utils/math.d.ts +11 -0
- package/lib/utils/number.d.ts +3 -0
- package/lib/utils/object.d.ts +7 -0
- package/lib/utils/string.d.ts +5 -0
- package/lib/utils/ts-shape.d.ts +19 -0
- package/lib/utils/ts-utility.d.ts +19 -0
- package/lib/video/index.cjs +1 -0
- package/lib/video/index.d.ts +11 -0
- package/lib/video/index.js +37 -0
- package/package.json +7 -7
- package/.github/workflows/publish.yml +0 -20
- package/.prettierignore +0 -16
- package/.prettierrc +0 -9
- package/index.html +0 -32
- package/public/vite.svg +0 -1
- package/src/packages/animation/Animated.ts +0 -189
- package/src/packages/animation/Damped.ts +0 -39
- package/src/packages/animation/Tweened.ts +0 -51
- package/src/packages/animation/index.ts +0 -10
- package/src/packages/attribute/index.ts +0 -59
- package/src/packages/canvas-2d/index.ts +0 -137
- package/src/packages/controls/Controls.ts +0 -15
- package/src/packages/controls/KeyboardControls.ts +0 -63
- package/src/packages/controls/LinearControls.ts +0 -27
- package/src/packages/controls/User.ts +0 -20
- package/src/packages/controls/WheelControls.ts +0 -92
- package/src/packages/controls/index.ts +0 -5
- package/src/packages/css-unit-parser/index.ts +0 -32
- package/src/packages/custom-element/index.ts +0 -19
- package/src/packages/device/Device.ts +0 -113
- package/src/packages/device/Viewport.ts +0 -67
- package/src/packages/device/index.ts +0 -2
- package/src/packages/element-constructor/ElementConstructor.ts +0 -577
- package/src/packages/element-constructor/htmlTags.ts +0 -679
- package/src/packages/element-constructor/index.ts +0 -4
- package/src/packages/element-constructor/specialObjects.ts +0 -8
- package/src/packages/element-constructor/svgTags.ts +0 -588
- package/src/packages/en3/attachments/En3SourceManager.ts +0 -116
- package/src/packages/en3/core/en3.ts +0 -306
- package/src/packages/en3/index.ts +0 -52
- package/src/packages/en3/instances/en3LazyLoader.ts +0 -22
- package/src/packages/en3/libs/MeshoptDecoder.js +0 -138
- package/src/packages/en3/loaders/en3GLTFLoader.ts +0 -54
- package/src/packages/en3/loaders/en3TextureLoader.ts +0 -3
- package/src/packages/en3/objects/En3Clip.ts +0 -53
- package/src/packages/en3/objects/En3ClipHelpers.ts +0 -12
- package/src/packages/en3/objects/En3GLTF.ts +0 -35
- package/src/packages/en3/objects/En3Image.ts +0 -18
- package/src/packages/en3/objects/En3ImageLike.ts +0 -101
- package/src/packages/en3/objects/En3Video.ts +0 -88
- package/src/packages/en3/test/En3HTML.ts +0 -55
- package/src/packages/en3/test/En3ModifiedMaterial.ts +0 -221
- package/src/packages/en3/test/En3Raycaster.ts +0 -187
- package/src/packages/en3/utils/coverTexture.ts +0 -29
- package/src/packages/en3/utils/dispose.ts +0 -27
- package/src/packages/en3/utils/traverseMaterials.ts +0 -10
- package/src/packages/en3/utils/traverseMeshes.ts +0 -9
- package/src/packages/image/index.ts +0 -19
- package/src/packages/intersector/index.ts +0 -83
- package/src/packages/ladder/index.ts +0 -112
- package/src/packages/layout-box/index.ts +0 -417
- package/src/packages/loading/index.ts +0 -131
- package/src/packages/measurer/CumulativeOffsetLeft.ts +0 -8
- package/src/packages/measurer/CumulativeOffsetTop.ts +0 -8
- package/src/packages/measurer/Meaurer.ts +0 -38
- package/src/packages/measurer/index.ts +0 -3
- package/src/packages/media/index.ts +0 -38
- package/src/packages/morph/Link.ts +0 -32
- package/src/packages/morph/Morph.ts +0 -246
- package/src/packages/morph/index.ts +0 -10
- package/src/packages/notifier/index.ts +0 -41
- package/src/packages/order/index.ts +0 -14
- package/src/packages/resizer/index.ts +0 -55
- package/src/packages/router/Link.ts +0 -33
- package/src/packages/router/Route.ts +0 -152
- package/src/packages/router/RouteElement.ts +0 -34
- package/src/packages/router/Router.ts +0 -190
- package/src/packages/router/index.ts +0 -13
- package/src/packages/scroll/ScrollElement.ts +0 -618
- package/src/packages/scroll/ScrollUserElement.ts +0 -21
- package/src/packages/scroll/ScrollbarElement.ts +0 -170
- package/src/packages/scroll/index.ts +0 -2
- package/src/packages/scroll-entries/index.ts +0 -74
- package/src/packages/source/SourceClass.ts +0 -77
- package/src/packages/source/SourceElement.ts +0 -177
- package/src/packages/source/SourceManager.ts +0 -61
- package/src/packages/source/SourceSet.ts +0 -52
- package/src/packages/source/index.ts +0 -8
- package/src/packages/store/Composed.ts +0 -33
- package/src/packages/store/Derived.ts +0 -24
- package/src/packages/store/DerivedArray.ts +0 -36
- package/src/packages/store/Resource.ts +0 -38
- package/src/packages/store/Store.ts +0 -144
- package/src/packages/store/StoreRegistry.ts +0 -105
- package/src/packages/store/index.ts +0 -23
- package/src/packages/ticker/index.ts +0 -173
- package/src/packages/utils/array.ts +0 -3
- package/src/packages/utils/attributes.ts +0 -19
- package/src/packages/utils/browser.ts +0 -2
- package/src/packages/utils/canvas.ts +0 -46
- package/src/packages/utils/collisions.ts +0 -12
- package/src/packages/utils/coordinates.ts +0 -40
- package/src/packages/utils/decoding.ts +0 -11
- package/src/packages/utils/dev.ts +0 -5
- package/src/packages/utils/dom.ts +0 -48
- package/src/packages/utils/easings.ts +0 -69
- package/src/packages/utils/file.ts +0 -17
- package/src/packages/utils/function.ts +0 -29
- package/src/packages/utils/index.ts +0 -61
- package/src/packages/utils/layout.ts +0 -22
- package/src/packages/utils/math.ts +0 -74
- package/src/packages/utils/number.ts +0 -26
- package/src/packages/utils/object.ts +0 -108
- package/src/packages/utils/string.ts +0 -49
- package/src/packages/utils/ts-shape.ts +0 -25
- package/src/packages/utils/ts-utility.ts +0 -47
- package/src/packages/video/index.ts +0 -39
- package/src/playground/index.ts +0 -0
- package/tsconfig.json +0 -31
- package/vite.config.ts +0 -78
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
var it = Object.defineProperty;
|
|
2
|
+
var Z = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i);
|
|
3
|
+
var rt = (i, t, s) => t in i ? it(i, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[t] = s;
|
|
4
|
+
var K = (i, t, s) => (rt(i, typeof t != "symbol" ? t + "" : t, s), s), G = (i, t, s) => {
|
|
5
|
+
if (!t.has(i))
|
|
6
|
+
throw TypeError("Cannot " + s);
|
|
7
|
+
};
|
|
8
|
+
var e = (i, t, s) => (G(i, t, "read from private field"), s ? s.call(i) : t.get(i)), o = (i, t, s) => {
|
|
9
|
+
if (t.has(i))
|
|
10
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
11
|
+
t instanceof WeakSet ? t.add(i) : t.set(i, s);
|
|
12
|
+
}, n = (i, t, s, r) => (G(i, t, "write to private field"), r ? r.call(i, s) : t.set(i, s), s);
|
|
13
|
+
var J = (i, t, s) => (G(i, t, "access private method"), s);
|
|
14
|
+
var W = (i, t, s) => new Promise((r, l) => {
|
|
15
|
+
var a = (f) => {
|
|
16
|
+
try {
|
|
17
|
+
d(s.next(f));
|
|
18
|
+
} catch (T) {
|
|
19
|
+
l(T);
|
|
20
|
+
}
|
|
21
|
+
}, u = (f) => {
|
|
22
|
+
try {
|
|
23
|
+
d(s.throw(f));
|
|
24
|
+
} catch (T) {
|
|
25
|
+
l(T);
|
|
26
|
+
}
|
|
27
|
+
}, d = (f) => f.done ? r(f.value) : Promise.resolve(f.value).then(a, u);
|
|
28
|
+
d((s = s.apply(i, t)).next());
|
|
29
|
+
});
|
|
30
|
+
var Q = (i, t, s) => (t = i[Z("asyncIterator")]) ? t.call(i) : (i = i[Z("iterator")](), t = {}, s = (r, l) => (l = i[r]) && (t[r] = (a) => new Promise((u, d, f) => (a = l.call(i, a), f = a.done, Promise.resolve(a.value).then((T) => u({ value: T, done: f }), d)))), s("next"), s("return"), t);
|
|
31
|
+
import { URLPattern as ot } from "urlpattern-polyfill";
|
|
32
|
+
import { Notifier as nt } from "../notifier/index.js";
|
|
33
|
+
import { i as tt } from "../browser-S4eq8AeN.js";
|
|
34
|
+
import { d as at } from "../function-zwSFehNd.js";
|
|
35
|
+
import { CustomElement as ht } from "../custom-element/index.js";
|
|
36
|
+
var R, H, b, m, c, P, A, v, w, E, Y, et;
|
|
37
|
+
class ct {
|
|
38
|
+
constructor(t, s) {
|
|
39
|
+
o(this, Y);
|
|
40
|
+
o(this, R, void 0);
|
|
41
|
+
o(this, H, void 0);
|
|
42
|
+
o(this, b, void 0);
|
|
43
|
+
o(this, m, void 0);
|
|
44
|
+
o(this, c, void 0);
|
|
45
|
+
o(this, P, void 0);
|
|
46
|
+
o(this, A, void 0);
|
|
47
|
+
o(this, v, null);
|
|
48
|
+
o(this, w, []);
|
|
49
|
+
o(this, E, []);
|
|
50
|
+
n(this, R, t), n(this, H, s), n(this, b, new URLPattern({ pathname: e(this, R) })), n(this, m, null), n(this, c, null), n(this, P, !1), n(this, A, null), tt && n(this, v, new MutationObserver((r) => {
|
|
51
|
+
r[0].addedNodes.forEach((a) => {
|
|
52
|
+
e(this, m) ? e(this, E).push(a) : e(this, w).push(a);
|
|
53
|
+
});
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
get pattern() {
|
|
57
|
+
return e(this, R);
|
|
58
|
+
}
|
|
59
|
+
get urlPattern() {
|
|
60
|
+
return e(this, b);
|
|
61
|
+
}
|
|
62
|
+
get isActive() {
|
|
63
|
+
return e(this, P);
|
|
64
|
+
}
|
|
65
|
+
get element() {
|
|
66
|
+
return e(this, c);
|
|
67
|
+
}
|
|
68
|
+
get outlet() {
|
|
69
|
+
return e(this, A);
|
|
70
|
+
}
|
|
71
|
+
testPathname(t) {
|
|
72
|
+
return this.urlPattern.test({ pathname: t });
|
|
73
|
+
}
|
|
74
|
+
render(t, s) {
|
|
75
|
+
return W(this, null, function* () {
|
|
76
|
+
var r, l;
|
|
77
|
+
if (e(this, v).observe(document.head, { childList: !0, subtree: !0 }), e(this, m))
|
|
78
|
+
e(this, w).forEach((a) => {
|
|
79
|
+
document.head.appendChild(a);
|
|
80
|
+
});
|
|
81
|
+
else {
|
|
82
|
+
const a = yield e(this, H).call(this);
|
|
83
|
+
n(this, E, [...e(this, w)]), typeof a.default == "function" && (n(this, m, a.default), customElements.define("e-" + ((r = e(this, m)) == null ? void 0 : r.name.toLowerCase()), a.default));
|
|
84
|
+
}
|
|
85
|
+
if (yield J(this, Y, et).call(this), e(this, m)) {
|
|
86
|
+
const a = e(this, b).exec({ pathname: s }), u = (a == null ? void 0 : a.pathname.groups) || {}, d = Object.fromEntries(new URLSearchParams(location.search)), f = {
|
|
87
|
+
pathnameParams: u,
|
|
88
|
+
searchParams: d
|
|
89
|
+
};
|
|
90
|
+
n(this, c, new (e(this, m))(f)), t.appendChild(e(this, c)), n(this, A, e(this, c).querySelector("[data-outlet]") || ((l = e(this, c).shadowRoot) == null ? void 0 : l.querySelector("[data-outlet]")) || e(this, c).shadowRoot || e(this, c)), n(this, P, !0);
|
|
91
|
+
}
|
|
92
|
+
e(this, v).disconnect();
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
close() {
|
|
96
|
+
var t;
|
|
97
|
+
e(this, v).disconnect(), (t = e(this, c)) == null || t.remove(), n(this, P, !1), e(this, E).forEach((s) => document.head.removeChild(s)), n(this, E, []);
|
|
98
|
+
}
|
|
99
|
+
getAnchorElements() {
|
|
100
|
+
var s;
|
|
101
|
+
let t = [];
|
|
102
|
+
return e(this, c) && (t = [...e(this, c).querySelectorAll("a")]), (s = e(this, c)) != null && s.shadowRoot && (t = [...t, ...e(this, c).shadowRoot.querySelectorAll("a")]), t;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), c = new WeakMap(), P = new WeakMap(), A = new WeakMap(), v = new WeakMap(), w = new WeakMap(), E = new WeakMap(), Y = new WeakSet(), et = function() {
|
|
106
|
+
return W(this, null, function* () {
|
|
107
|
+
const t = e(this, w).filter((u) => u instanceof HTMLElement ? u.tagName === "STYLE" || u.tagName === "SCRIPT" || u.tagName === "LINK" : !1);
|
|
108
|
+
try {
|
|
109
|
+
for (var s = Q(t), r, l, a; r = !(l = yield s.next()).done; r = !1) {
|
|
110
|
+
const u = l.value;
|
|
111
|
+
yield new Promise((d) => {
|
|
112
|
+
u.onload = () => {
|
|
113
|
+
d();
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
} catch (l) {
|
|
118
|
+
a = [l];
|
|
119
|
+
} finally {
|
|
120
|
+
try {
|
|
121
|
+
r && (l = s.return) && (yield l.call(s));
|
|
122
|
+
} finally {
|
|
123
|
+
if (a)
|
|
124
|
+
throw a[0];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
var O, p, S, x, I;
|
|
130
|
+
class lt {
|
|
131
|
+
constructor(t, s) {
|
|
132
|
+
o(this, O, void 0);
|
|
133
|
+
o(this, p, void 0);
|
|
134
|
+
o(this, S, void 0);
|
|
135
|
+
o(this, x, void 0);
|
|
136
|
+
o(this, I, (t) => {
|
|
137
|
+
t.preventDefault(), e(this, O).navigate(e(this, S), e(this, x));
|
|
138
|
+
});
|
|
139
|
+
n(this, O, t), n(this, p, s), n(this, S, e(this, p).getAttribute("href") || "/"), n(this, x, e(this, p).getAttribute("data-history-action") || "push"), e(this, p).addEventListener("click", e(this, I)), location.pathname === e(this, S) && e(this, p).classList.add("current");
|
|
140
|
+
}
|
|
141
|
+
destroy() {
|
|
142
|
+
e(this, p).removeEventListener("click", e(this, I)), e(this, p).classList.remove("current");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
O = new WeakMap(), p = new WeakMap(), S = new WeakMap(), x = new WeakMap(), I = new WeakMap();
|
|
146
|
+
globalThis.URLPattern = ot;
|
|
147
|
+
var k, N, g, C, M, L, q, j, $, z, st, F;
|
|
148
|
+
const U = class U {
|
|
149
|
+
constructor(t) {
|
|
150
|
+
o(this, z);
|
|
151
|
+
o(this, k, null);
|
|
152
|
+
o(this, N, void 0);
|
|
153
|
+
o(this, g, []);
|
|
154
|
+
o(this, C, null);
|
|
155
|
+
o(this, M, []);
|
|
156
|
+
o(this, L, void 0);
|
|
157
|
+
o(this, q, null);
|
|
158
|
+
o(this, j, new nt());
|
|
159
|
+
K(this, "preprocessor");
|
|
160
|
+
K(this, "postprocessor");
|
|
161
|
+
o(this, $, at(() => {
|
|
162
|
+
const t = (s) => s.split("/").length;
|
|
163
|
+
n(this, g, e(this, g).sort((s, r) => t(s.pattern) - t(r.pattern))), this.navigate(location.pathname.replace(e(this, N), ""));
|
|
164
|
+
}, 0));
|
|
165
|
+
o(this, F, (t) => {
|
|
166
|
+
t.state && this.navigate(t.state, "none");
|
|
167
|
+
});
|
|
168
|
+
n(this, N, (t == null ? void 0 : t.base) || ""), U.active = this, tt && (n(this, k, (t == null ? void 0 : t.rootElement) || document.body), addEventListener("popstate", e(this, F)));
|
|
169
|
+
}
|
|
170
|
+
get currentPathname() {
|
|
171
|
+
return e(this, q);
|
|
172
|
+
}
|
|
173
|
+
get candidatePathname() {
|
|
174
|
+
return e(this, L);
|
|
175
|
+
}
|
|
176
|
+
get routes() {
|
|
177
|
+
return e(this, g);
|
|
178
|
+
}
|
|
179
|
+
navigationEvent(t) {
|
|
180
|
+
return e(this, j).subscribe(t);
|
|
181
|
+
}
|
|
182
|
+
defineRoute(t, s) {
|
|
183
|
+
const r = new ct(t, s);
|
|
184
|
+
e(this, g).push(r), e(this, $).call(this);
|
|
185
|
+
}
|
|
186
|
+
navigate(t, s = "push") {
|
|
187
|
+
return W(this, null, function* () {
|
|
188
|
+
var f, V;
|
|
189
|
+
if (e(this, L) === t || e(this, q) === t)
|
|
190
|
+
return;
|
|
191
|
+
U.active = this, n(this, L, t);
|
|
192
|
+
const r = e(this, g).filter((h) => h.isActive), l = e(this, g).filter(
|
|
193
|
+
(h) => !r.includes(h) && h.testPathname(t)
|
|
194
|
+
), a = r.filter((h) => !h.testPathname(t)), u = r.filter((h) => h.testPathname(t));
|
|
195
|
+
let d = !0;
|
|
196
|
+
if (this.preprocessor)
|
|
197
|
+
try {
|
|
198
|
+
yield new Promise((h, y) => {
|
|
199
|
+
var X;
|
|
200
|
+
(X = this.preprocessor) == null || X.call(this, { pathname: t, resolve: h, reject: y });
|
|
201
|
+
});
|
|
202
|
+
} catch (h) {
|
|
203
|
+
h ? console.error(h) : console.log("Route change canceled"), d = !1;
|
|
204
|
+
}
|
|
205
|
+
if (d && e(this, L) === t) {
|
|
206
|
+
n(this, C, u[u.length - 1]), a.forEach((y) => {
|
|
207
|
+
y.close();
|
|
208
|
+
}), n(this, q, t);
|
|
209
|
+
try {
|
|
210
|
+
for (var T = Q(l), Et, Lt, yt; Et = !(Lt = yield T.next()).done; Et = !1) {
|
|
211
|
+
const y = Lt.value;
|
|
212
|
+
yield y.render(((f = e(this, C)) == null ? void 0 : f.outlet) || e(this, k), t), n(this, C, y);
|
|
213
|
+
}
|
|
214
|
+
} catch (Lt) {
|
|
215
|
+
yt = [Lt];
|
|
216
|
+
} finally {
|
|
217
|
+
try {
|
|
218
|
+
Et && (Lt = T.return) && (yield Lt.call(T));
|
|
219
|
+
} finally {
|
|
220
|
+
if (yt)
|
|
221
|
+
throw yt[0];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const h = e(this, N) + t + location.search;
|
|
225
|
+
s === "push" ? history.pushState(h, "", h) : s === "replace" && history.replaceState(h, "", h), J(this, z, st).call(this), (V = this.postprocessor) == null || V.call(this, { pathname: t }), e(this, j).notify({ pathname: t });
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
k = new WeakMap(), N = new WeakMap(), g = new WeakMap(), C = new WeakMap(), M = new WeakMap(), L = new WeakMap(), q = new WeakMap(), j = new WeakMap(), $ = new WeakMap(), z = new WeakSet(), st = function() {
|
|
231
|
+
const t = e(this, g).filter((r) => r.isActive), s = Array.from(
|
|
232
|
+
new Set(
|
|
233
|
+
[
|
|
234
|
+
...e(this, k).querySelectorAll("a"),
|
|
235
|
+
...t.map((r) => r.getAnchorElements()).flat()
|
|
236
|
+
].filter((r) => {
|
|
237
|
+
var l;
|
|
238
|
+
return (l = r.getAttribute("href")) == null ? void 0 : l.startsWith("/");
|
|
239
|
+
})
|
|
240
|
+
)
|
|
241
|
+
);
|
|
242
|
+
e(this, M).forEach((r) => {
|
|
243
|
+
r.destroy();
|
|
244
|
+
}), n(this, M, s.map((r) => new lt(this, r)));
|
|
245
|
+
}, F = new WeakMap(), K(U, "active");
|
|
246
|
+
let _ = U;
|
|
247
|
+
var B, D;
|
|
248
|
+
class Pt extends ht {
|
|
249
|
+
constructor(s) {
|
|
250
|
+
super();
|
|
251
|
+
o(this, B, void 0);
|
|
252
|
+
o(this, D, void 0);
|
|
253
|
+
n(this, B, s.pathnameParams), n(this, D, s.searchParams);
|
|
254
|
+
}
|
|
255
|
+
get pathnameParams() {
|
|
256
|
+
return e(this, B);
|
|
257
|
+
}
|
|
258
|
+
get searchParams() {
|
|
259
|
+
return e(this, D);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
B = new WeakMap(), D = new WeakMap();
|
|
263
|
+
export {
|
|
264
|
+
Pt as RouteElement,
|
|
265
|
+
_ as Router
|
|
266
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Damped } from '../animation';
|
|
2
|
+
import { Attribute } from '../attribute';
|
|
3
|
+
import { CustomElement } from '../custom-element';
|
|
4
|
+
import { Store } from '../store';
|
|
5
|
+
import { Axes2D } from '../utils';
|
|
6
|
+
export type ScrollBehaviour = 'smooth' | 'instant';
|
|
7
|
+
export declare class ScrollElement extends CustomElement {
|
|
8
|
+
#private;
|
|
9
|
+
constructor();
|
|
10
|
+
get currentScrollValue(): number;
|
|
11
|
+
get targetScrollValue(): number;
|
|
12
|
+
get damped(): Damped;
|
|
13
|
+
get dampedAttibute(): Damped;
|
|
14
|
+
get axisAttibute(): Attribute<Axes2D>;
|
|
15
|
+
get pagesAttibute(): Attribute<number>;
|
|
16
|
+
get sectionalAttibute(): Attribute<boolean>;
|
|
17
|
+
get infiniteAttribute(): Attribute<boolean>;
|
|
18
|
+
get splitAttibute(): Attribute<boolean>;
|
|
19
|
+
get dampingAttibute(): Attribute<number>;
|
|
20
|
+
get disabledAttibute(): Attribute<boolean>;
|
|
21
|
+
get hibernatedAttibute(): Attribute<boolean>;
|
|
22
|
+
get position(): number;
|
|
23
|
+
get viewportSize(): number;
|
|
24
|
+
get scrollSize(): number;
|
|
25
|
+
get counter(): Store<number, import('../store').StoreEntry<number>>;
|
|
26
|
+
get distance(): number;
|
|
27
|
+
get overscroll(): number;
|
|
28
|
+
get vertical(): boolean;
|
|
29
|
+
get currentProgress(): number;
|
|
30
|
+
get targetProgress(): number;
|
|
31
|
+
scrollToSection(sectionIndex: number, behaviour?: ScrollBehaviour): void;
|
|
32
|
+
shiftSections(direction: number, behaviour?: ScrollBehaviour): void;
|
|
33
|
+
protected connectedCallback(): void;
|
|
34
|
+
protected disconnectedCallback(): void;
|
|
35
|
+
}
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
'e-scroll': ScrollElement;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScrollUserElement } from './ScrollUserElement';
|
|
2
|
+
export declare class ScrollbarElement extends ScrollUserElement {
|
|
3
|
+
#private;
|
|
4
|
+
constructor();
|
|
5
|
+
get thumbElement(): HTMLElement;
|
|
6
|
+
protected connectedCallback(): void;
|
|
7
|
+
protected disconnectedCallback(): void;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
'e-scrollbar': ScrollbarElement;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";var xt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var l=(i,e,s)=>(xt(i,e,"read from private field"),s?s.call(i):e.get(i)),T=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},V=(i,e,s,n)=>(xt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zt=require("../Store-txkR3wXU.cjs"),Ct=require("../browser-QbF6EW-w.cjs"),ot=require("../layout-rZzbsLPd.cjs"),Wt=require("../math-FNUBmQPK.cjs");require("../ticker/index.cjs");const qt=require("../Damped-DdPj4Sho.cjs"),W=require("../attribute/index.cjs"),yt=require("../WheelControls-TYhGU6oA.cjs"),pt=require("../custom-element/index.cjs"),wt=require("../order/index.cjs"),at=require("../resizer/index.cjs"),B=require("../scroll-entries/index.cjs"),Ot=require("../dom-QhWsdQS2.cjs");require("../intersector/index.cjs");require("../number-2bR0KBcX.cjs");require("../attributes-_2U65GDl.cjs");require("../notifier/index.cjs");require("../function-QP7IreXR.cjs");var Vt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,Pt=(i,e,s,n)=>{for(var c=n>1?void 0:n?$t(e,s):e,b=i.length-1,r;b>=0;b--)(r=i[b])&&(c=(n?r(e,s,c):r(c))||c);return n&&c&&Vt(e,s,c),c},_t=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(_t(i,e,"read from private field"),s?s.call(i):e.get(i)),o=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},w=(i,e,s,n)=>(_t(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),f=(i,e,s)=>(_t(i,e,"access private method"),s),a,M,A,L,x,y,D,H,I,d,u,j,_,p,O,G,m,J,$,N,ct,K,Q,ut,Et,dt,St,tt,mt,et,bt,R,ft,vt,kt,st,it,gt,E,g,P,C;class Rt{constructor(e,s){T(this,E,void 0);T(this,g,void 0);T(this,P,0);T(this,C,0);V(this,E,e),V(this,g,s),B.scrollEnties.register(l(this,E))}get size(){return l(this,P)}get position(){return l(this,C)}destroy(){B.scrollEnties.unregister(l(this,E)),l(this,E).style.transform=""}resize(){V(this,P,l(this,g).vertical?l(this,E).offsetHeight:l(this,E).offsetWidth),V(this,C,l(this,g).vertical?ot.getCumulativeOffsetTop(l(this,E)):ot.getCumulativeOffsetLeft(l(this,E))),V(this,C,l(this,C)-l(this,g).position)}transform(){let e=0;l(this,g).infiniteAttribute.current&&l(this,g).overscroll&&l(this,C)+l(this,P)<l(this,g).currentScrollValue&&(e=l(this,g).distance*-1),B.scrollEnties.update(l(this,E),l(this,g).axisAttibute.current,e);const s=Wt.clamp(l(this,g).currentScrollValue+e,l(this,C)-l(this,g).viewportSize,l(this,C)+l(this,P));l(this,g).vertical?l(this,E).style.transform=`translate3d(0px, ${s*-1}px, 0px)`:l(this,E).style.transform=`translate3d(${s*-1}px, 0px, 0px)`}}E=new WeakMap,g=new WeakMap,P=new WeakMap,C=new WeakMap;exports.ScrollElement=class extends pt.CustomElement{constructor(){if(super(),o(this,N),o(this,K),o(this,ut),o(this,dt),o(this,tt),o(this,et),o(this,vt),o(this,it),o(this,a,null),o(this,M,new W.Attribute(this,"axis","y")),o(this,A,new W.Attribute(this,"pages",0,{validate:e=>Math.max(0,e-1)})),o(this,L,new W.Attribute(this,"sectional",!1)),o(this,x,new W.Attribute(this,"infinite",!1)),o(this,y,new W.Attribute(this,"split",!1)),o(this,D,new W.Attribute(this,"damping",.03)),o(this,H,new W.Attribute(this,"disabled",!1)),o(this,I,new W.Attribute(this,"hibernated",!1)),o(this,d,null),o(this,u,[]),o(this,j,0),o(this,_,0),o(this,p,0),o(this,O,null),o(this,G,null),o(this,m,new zt.Store(0)),o(this,J,0),o(this,$,0),o(this,R,()=>{const e=this.currentScrollValue/t(this,p);if(w(this,j,this.vertical?ot.getCumulativeOffsetTop(this):ot.getCumulativeOffsetLeft(this)),w(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,A).current){w(this,p,t(this,_)*t(this,A).current);const s=t(this,p)+t(this,_);this.vertical?(t(this,d).style.width=s+"px",t(this,d).style.height="100%"):(t(this,d).style.height=s+"px",t(this,d).style.width="100%")}else this.vertical?(t(this,d).style.width="100%",t(this,d).style.height="max-content",w(this,p,t(this,d).offsetHeight-t(this,_))):(t(this,d).style.width="max-content",t(this,d).style.height="100%",w(this,p,t(this,d).offsetWidth-t(this,_)));if(t(this,x)||(t(this,a).max=t(this,p)),t(this,u).forEach(s=>{s.resize(),s.transform()}),t(this,x).current&&t(this,u).length){const s=t(this,u)[t(this,u).length-1],n=s.position+s.size-t(this,_),c=t(this,p)-n;w(this,$,s.position+s.size+c)}else w(this,$,t(this,p));if(t(this,L).current&&t(this,u).length){const s=t(this,u)[t(this,m).current];t(this,a).set(s.position,!0)}else t(this,a).set(e*t(this,p),!0)}),o(this,ft,()=>{if(t(this,u).length){let e=0;for(let s=0;s<t(this,u).length;s++){const n=t(this,u)[s];n.transform(),this.targetScrollValue>=n.position&&(e=s)}t(this,m).current=e}else this.vertical?t(this,d).style.transform=`translate3d(0px, ${this.currentScrollValue*-1}px, 0px)`:t(this,d).style.transform=`translate3d(${this.currentScrollValue*-1}px, 0px, 0px)`;B.scrollEnties.update(this,t(this,M).current,this.currentScrollValue)}),o(this,st,e=>{if(typeof e=="number")if(t(this,L).current){const s=Math.sign(e);t(this,u).length?this.shiftSections(s):t(this,a).shift(s*t(this,_))}else t(this,a).shift(e);else e==="min"?t(this,a).set(t(this,a).min):e==="max"&&t(this,a).set(t(this,a).delta)}),Ct.isBrowser){w(this,a,new qt.Damped({damping:.01,min:0,order:wt.TICK_ORDER.SCROLL}));const e=this.attachShadow({mode:"open"}),s=document.createElement("style");s.textContent=`
|
|
2
|
+
:host {
|
|
3
|
+
position: relative;
|
|
4
|
+
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
|
|
8
|
+
display: block;
|
|
9
|
+
outline: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:host([hibernated="true"]) {
|
|
13
|
+
display: contents;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.static {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
|
|
21
|
+
z-index: 1;
|
|
22
|
+
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.content {
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([hibernated="true"]) .content {
|
|
33
|
+
display: contents;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
::slotted(*) {
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
}
|
|
39
|
+
`,e.appendChild(s),this.tabIndex=0;const n=document.createElement("div");n.classList.add("static"),e.appendChild(n);const c=document.createElement("slot");c.setAttribute("name","static"),n.appendChild(c),w(this,d,document.createElement("div")),t(this,d).classList.add("content"),e.appendChild(t(this,d));const b=document.createElement("slot");t(this,d).appendChild(b),w(this,O,new yt.WheelControls({element:this})),t(this,O).changeEvent.subscribe(t(this,st)),w(this,G,new yt.KeyboardControls({element:this})),t(this,G).changeEvent.subscribe(t(this,st)),t(this,M).subscribe(({current:r})=>{t(this,d).style.flexDirection=r==="x"?"row":"column",t(this,O).axis=r,this.isConnected&&t(this,R).call(this)}),t(this,A).subscribe(()=>{this.isConnected&&t(this,R).call(this)}),t(this,L).subscribe(r=>{t(this,m).current=0,t(this,O).debounce=r.current,t(this,a).reset(),this.isConnected&&(r.current&&!r.previous?f(this,N,ct).call(this):!r.current&&r.previous&&f(this,K,Q).call(this))}),t(this,x).subscribe(r=>{r.current?(this.isConnected&&(t(this,u).length||(t(this,y).current=!0)),t(this,u).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(w(this,J,0),t(this,a).max=t(this,p),t(this,a).min=0)}),t(this,y).subscribe(({current:r})=>{this.isConnected&&(r?f(this,N,ct).call(this):f(this,K,Q).call(this))}),t(this,D).subscribe(r=>{t(this,a).damping=r.current}),t(this,H).subscribe(r=>{r.current&&!r.previous?f(this,ut,Et).call(this):!r.current&&r.previous&&f(this,dt,St).call(this)}),t(this,I).subscribe(r=>{r.current&&!r.previous?f(this,tt,mt).call(this):!r.current&&r.previous&&f(this,et,bt).call(this)})}}get currentScrollValue(){return f(this,it,gt).call(this,"current")}get targetScrollValue(){return f(this,it,gt).call(this,"target")}get damped(){return t(this,a)}get dampedAttibute(){return t(this,a)}get axisAttibute(){return t(this,M)}get pagesAttibute(){return t(this,A)}get sectionalAttibute(){return t(this,L)}get infiniteAttribute(){return t(this,x)}get splitAttibute(){return t(this,y)}get dampingAttibute(){return t(this,D)}get disabledAttibute(){return t(this,H)}get hibernatedAttibute(){return t(this,I)}get position(){return t(this,j)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,p)}get counter(){return t(this,m)}get distance(){return t(this,$)}get overscroll(){return t(this,J)}get vertical(){return t(this,M).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,$)}get targetProgress(){return this.targetScrollValue/t(this,$)}scrollToSection(e,s="smooth"){if(!t(this,u).length)return;const n=t(this,m).current;f(this,vt,kt).call(this,e);const c=t(this,u)[n],b=t(this,u)[t(this,m).current];if(c&&b){let r=0;const Y=t(this,u).length-1;t(this,m).current===0&&n===Y?r=t(this,p)+t(this,_)-c.position:t(this,m).current===Y&&n===0?r=b.position-(t(this,p)+t(this,_)):r=b.position-c.position,t(this,a).shift(r,s==="instant")}}shiftSections(e,s="smooth"){t(this,u).length&&this.scrollToSection(t(this,m).current+e,s)}connectedCallback(){f(this,et,bt).call(this),t(this,M).observe(),t(this,A).observe(),t(this,L).observe(),t(this,x).observe(),t(this,y).observe(),t(this,D).observe(),t(this,H).observe(),t(this,I).observe()}disconnectedCallback(){f(this,tt,mt).call(this),t(this,M).unobserve(),t(this,A).unobserve(),t(this,L).unobserve(),t(this,x).unobserve(),t(this,y).unobserve(),t(this,D).unobserve(),t(this,H).unobserve(),t(this,I).unobserve()}};a=new WeakMap;M=new WeakMap;A=new WeakMap;L=new WeakMap;x=new WeakMap;y=new WeakMap;D=new WeakMap;H=new WeakMap;I=new WeakMap;d=new WeakMap;u=new WeakMap;j=new WeakMap;_=new WeakMap;p=new WeakMap;O=new WeakMap;G=new WeakMap;m=new WeakMap;J=new WeakMap;$=new WeakMap;N=new WeakSet;ct=function(){f(this,K,Q).call(this),t(this,d).querySelector("slot").assignedElements().forEach(e=>{e instanceof HTMLElement&&t(this,u).push(new Rt(e,this))}),t(this,d).style.transform="",t(this,R).call(this)};K=new WeakSet;Q=function(){t(this,u).forEach(i=>{i.destroy()}),w(this,u,[])};ut=new WeakSet;Et=function(){t(this,a).unsubscribe(t(this,ft)),t(this,a).unlistenAnimationFrame(),t(this,O).disconnect(),t(this,G).disconnect()};dt=new WeakSet;St=function(){t(this,a).subscribe(t(this,ft)),t(this,O).connect(),t(this,G).connect()};tt=new WeakSet;mt=function(){at.resizer.unsubscribe(t(this,R)),t(this,a).reset(),f(this,ut,Et).call(this),t(this,d).style.transform="",t(this,y).current&&f(this,K,Q).call(this),B.scrollEnties.unregister(this)};et=new WeakSet;bt=function(){t(this,y).current&&f(this,N,ct).call(this),B.scrollEnties.register(this),at.resizer.subscribe(t(this,R),wt.RESIZE_ORDER.SCROLL),f(this,dt,St).call(this)};R=new WeakMap;ft=new WeakMap;vt=new WeakSet;kt=function(i){t(this,x).current?(t(this,m).current=i%t(this,u).length,t(this,m).current=t(this,m).current<0?t(this,u).length+t(this,m).current:t(this,m).current):t(this,m).current=Wt.clamp(i,0,t(this,u).length-1)};st=new WeakMap;it=new WeakSet;gt=function(i="current"){if(t(this,x).current&&t(this,u).length){const e=t(this,a)[i]%(t(this,p)+t(this,_)),s=e<0?t(this,p)+e+t(this,_):e;return w(this,J,Math.max(0,s-t(this,p))),s}else return t(this,a)[i]};exports.ScrollElement=Pt([pt.define("e-scroll")],exports.ScrollElement);var X;class Tt extends pt.CustomElement{constructor(){super(...arguments);T(this,X,null)}get scrollElement(){return l(this,X)}connectedCallback(){const s=Ot.findParentElement(this,exports.ScrollElement);s instanceof exports.ScrollElement?V(this,X,s):console.error(this,"e-scroll not found")}}X=new WeakMap;var Dt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,It=(i,e,s,n)=>{for(var c=n>1?void 0:n?Ht(e,s):e,b=i.length-1,r;b>=0;b--)(r=i[b])&&(c=(n?r(e,s,c):r(c))||c);return n&&c&&Dt(e,s,c),c},Mt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},h=(i,e,s)=>(Mt(i,e,"read from private field"),s?s.call(i):e.get(i)),S=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},k=(i,e,s,n)=>(Mt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),Z,v,z,q,F,U,rt,nt,ht,lt;exports.ScrollbarElement=class extends Tt{constructor(){if(super(),S(this,Z,null),S(this,v,null),S(this,z,!1),S(this,q,0),S(this,F,0),S(this,U,0),S(this,rt,()=>{k(this,z,this.offsetWidth>this.offsetHeight);const e=h(this,z)?this.offsetWidth:this.offsetHeight;k(this,q,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),k(this,q,Math.max(h(this,q),30)),h(this,z)?(h(this,v).style.width=h(this,q)+"px",h(this,v).style.height="100%"):(h(this,v).style.width="100%",h(this,v).style.height=h(this,q)+"px"),k(this,F,e-h(this,q)),this.scrollElement.scrollSize||(this.style.display="none")}),S(this,nt,()=>{k(this,U,this.scrollElement.currentProgress*h(this,F)),h(this,z)?h(this,v).style.transform=`translate3d(${h(this,U)}px, 0px, 0px)`:h(this,v).style.transform=`translate3d(0px, ${h(this,U)}px, 0px)`}),S(this,ht,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),S(this,lt,e=>{const s=r=>{const Y=h(this,z)?r.x:r.y,At=this.scrollElement.distance/h(this,F),Lt=(Y-b)*At;this.scrollElement.damped.set(c+Lt)},n=()=>{removeEventListener("pointermove",s),removeEventListener("pointerup",n),removeEventListener("touchend",n)};addEventListener("pointermove",s),addEventListener("pointerup",n),addEventListener("touchend",n);const c=this.scrollElement.damped.target,b=h(this,z)?e.x:e.y}),Ct.isBrowser){const e=this.attachShadow({mode:"open"}),s=document.createElement("style");s.textContent=`
|
|
40
|
+
:host {
|
|
41
|
+
display: inline-block;
|
|
42
|
+
z-index: 1;
|
|
43
|
+
background-color: #efefef;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([axis="y"]) {
|
|
47
|
+
position: absolute;
|
|
48
|
+
right: 0;
|
|
49
|
+
top: 0;
|
|
50
|
+
width: 1vmin;
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([axis="x"]) {
|
|
55
|
+
position: absolute;
|
|
56
|
+
left: 0;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 1vmin;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.default-thumb {
|
|
63
|
+
background-color: #181818;
|
|
64
|
+
border-radius: 1vmin;
|
|
65
|
+
touch-action: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
::slotted(*) {
|
|
69
|
+
touch-action: none;
|
|
70
|
+
}
|
|
71
|
+
`,e.appendChild(s),k(this,Z,document.createElement("slot")),e.appendChild(h(this,Z))}}get thumbElement(){return h(this,v)}connectedCallback(){super.connectedCallback();const e=h(this,Z).assignedElements()[0];e instanceof HTMLElement?k(this,v,e):(k(this,v,document.createElement("div")),h(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(h(this,v))),h(this,v).addEventListener("pointerdown",h(this,lt)),at.resizer.subscribe(h(this,rt),wt.RESIZE_ORDER.SCROLL+1),this.scrollElement.damped.subscribe(h(this,nt)),this.scrollElement.axisAttibute.subscribe(h(this,ht))}disconnectedCallback(){h(this,v).removeEventListener("pointerdown",h(this,lt)),at.resizer.unsubscribe(h(this,rt)),this.scrollElement.damped.unsubscribe(h(this,nt)),this.scrollElement.axisAttibute.unsubscribe(h(this,ht))}};Z=new WeakMap;v=new WeakMap;z=new WeakMap;q=new WeakMap;F=new WeakMap;U=new WeakMap;rt=new WeakMap;nt=new WeakMap;ht=new WeakMap;lt=new WeakMap;exports.ScrollbarElement=It([pt.define("e-scrollbar")],exports.ScrollbarElement);
|