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,444 @@
|
|
|
1
|
+
var _t = (s, e, i) => {
|
|
2
|
+
if (!e.has(s))
|
|
3
|
+
throw TypeError("Cannot " + i);
|
|
4
|
+
};
|
|
5
|
+
var h = (s, e, i) => (_t(s, e, "read from private field"), i ? i.call(s) : e.get(s)), D = (s, e, i) => {
|
|
6
|
+
if (e.has(s))
|
|
7
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
+
e instanceof WeakSet ? e.add(s) : e.set(s, i);
|
|
9
|
+
}, $ = (s, e, i, o) => (_t(s, e, "write to private field"), o ? o.call(s, i) : e.set(s, i), i);
|
|
10
|
+
import { S as Vt } from "../Store-qq7IjRLE.js";
|
|
11
|
+
import { i as St } from "../browser-S4eq8AeN.js";
|
|
12
|
+
import { a as xt, g as yt } from "../layout-5SJlcXTY.js";
|
|
13
|
+
import { c as Wt } from "../math-_a3IpKOc.js";
|
|
14
|
+
import "../ticker/index.js";
|
|
15
|
+
import { D as $t } from "../Damped-H3PuZwKV.js";
|
|
16
|
+
import { Attribute as k } from "../attribute/index.js";
|
|
17
|
+
import { W as Pt, K as Tt } from "../WheelControls-9ZQKSYYq.js";
|
|
18
|
+
import { CustomElement as kt, define as Ct } from "../custom-element/index.js";
|
|
19
|
+
import { TICK_ORDER as Rt, RESIZE_ORDER as Mt } from "../order/index.js";
|
|
20
|
+
import { resizer as lt } from "../resizer/index.js";
|
|
21
|
+
import { scrollEnties as G } from "../scroll-entries/index.js";
|
|
22
|
+
import { f as Dt } from "../dom-bHEwc_xV.js";
|
|
23
|
+
import "../intersector/index.js";
|
|
24
|
+
import "../number-bCHB2GAD.js";
|
|
25
|
+
import "../attributes-w0u-KiIb.js";
|
|
26
|
+
import "../notifier/index.js";
|
|
27
|
+
import "../function-zwSFehNd.js";
|
|
28
|
+
var Ht = Object.defineProperty, It = Object.getOwnPropertyDescriptor, Kt = (s, e, i, o) => {
|
|
29
|
+
for (var u = o > 1 ? void 0 : o ? It(e, i) : e, n = s.length - 1, E; n >= 0; n--)
|
|
30
|
+
(E = s[n]) && (u = (o ? E(e, i, u) : E(u)) || u);
|
|
31
|
+
return o && u && Ht(e, i, u), u;
|
|
32
|
+
}, vt = (s, e, i) => {
|
|
33
|
+
if (!e.has(s))
|
|
34
|
+
throw TypeError("Cannot " + i);
|
|
35
|
+
}, t = (s, e, i) => (vt(s, e, "read from private field"), i ? i.call(s) : e.get(s)), l = (s, e, i) => {
|
|
36
|
+
if (e.has(s))
|
|
37
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
38
|
+
e instanceof WeakSet ? e.add(s) : e.set(s, i);
|
|
39
|
+
}, g = (s, e, i, o) => (vt(s, e, "write to private field"), o ? o.call(s, i) : e.set(s, i), i), f = (s, e, i) => (vt(s, e, "access private method"), i), a, M, A, L, x, y, H, I, K, p, c, Y, w, d, V, q, m, J, P, N, ot, B, Q, at, gt, ct, wt, j, dt, tt, ft, R, pt, mt, At, et, st, bt, _, v, T, W;
|
|
40
|
+
class Gt {
|
|
41
|
+
constructor(e, i) {
|
|
42
|
+
D(this, _, void 0);
|
|
43
|
+
D(this, v, void 0);
|
|
44
|
+
D(this, T, 0);
|
|
45
|
+
D(this, W, 0);
|
|
46
|
+
$(this, _, e), $(this, v, i), G.register(h(this, _));
|
|
47
|
+
}
|
|
48
|
+
get size() {
|
|
49
|
+
return h(this, T);
|
|
50
|
+
}
|
|
51
|
+
get position() {
|
|
52
|
+
return h(this, W);
|
|
53
|
+
}
|
|
54
|
+
destroy() {
|
|
55
|
+
G.unregister(h(this, _)), h(this, _).style.transform = "";
|
|
56
|
+
}
|
|
57
|
+
resize() {
|
|
58
|
+
$(this, T, h(this, v).vertical ? h(this, _).offsetHeight : h(this, _).offsetWidth), $(this, W, h(this, v).vertical ? xt(h(this, _)) : yt(h(this, _))), $(this, W, h(this, W) - h(this, v).position);
|
|
59
|
+
}
|
|
60
|
+
transform() {
|
|
61
|
+
let e = 0;
|
|
62
|
+
h(this, v).infiniteAttribute.current && h(this, v).overscroll && h(this, W) + h(this, T) < h(this, v).currentScrollValue && (e = h(this, v).distance * -1), G.update(h(this, _), h(this, v).axisAttibute.current, e);
|
|
63
|
+
const i = Wt(
|
|
64
|
+
h(this, v).currentScrollValue + e,
|
|
65
|
+
h(this, W) - h(this, v).viewportSize,
|
|
66
|
+
h(this, W) + h(this, T)
|
|
67
|
+
);
|
|
68
|
+
h(this, v).vertical ? h(this, _).style.transform = `translate3d(0px, ${i * -1}px, 0px)` : h(this, _).style.transform = `translate3d(${i * -1}px, 0px, 0px)`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
_ = new WeakMap(), v = new WeakMap(), T = new WeakMap(), W = new WeakMap();
|
|
72
|
+
let ut = class extends kt {
|
|
73
|
+
constructor() {
|
|
74
|
+
if (super(), l(this, N), l(this, B), l(this, at), l(this, ct), l(this, j), l(this, tt), l(this, mt), l(this, st), l(this, a, null), l(this, M, new k(this, "axis", "y")), l(this, A, new k(this, "pages", 0, {
|
|
75
|
+
validate: (s) => Math.max(0, s - 1)
|
|
76
|
+
})), l(this, L, new k(this, "sectional", !1)), l(this, x, new k(this, "infinite", !1)), l(this, y, new k(this, "split", !1)), l(this, H, new k(this, "damping", 0.03)), l(this, I, new k(this, "disabled", !1)), l(this, K, new k(this, "hibernated", !1)), l(this, p, null), l(this, c, []), l(this, Y, 0), l(this, w, 0), l(this, d, 0), l(this, V, null), l(this, q, null), l(this, m, new Vt(0)), l(this, J, 0), l(this, P, 0), l(this, R, () => {
|
|
77
|
+
const s = this.currentScrollValue / t(this, d);
|
|
78
|
+
if (g(this, Y, this.vertical ? xt(this) : yt(this)), g(this, w, this.vertical ? this.offsetHeight : this.offsetWidth), t(this, A).current) {
|
|
79
|
+
g(this, d, t(this, w) * t(this, A).current);
|
|
80
|
+
const e = t(this, d) + t(this, w);
|
|
81
|
+
this.vertical ? (t(this, p).style.width = e + "px", t(this, p).style.height = "100%") : (t(this, p).style.height = e + "px", t(this, p).style.width = "100%");
|
|
82
|
+
} else
|
|
83
|
+
this.vertical ? (t(this, p).style.width = "100%", t(this, p).style.height = "max-content", g(this, d, t(this, p).offsetHeight - t(this, w))) : (t(this, p).style.width = "max-content", t(this, p).style.height = "100%", g(this, d, t(this, p).offsetWidth - t(this, w)));
|
|
84
|
+
if (t(this, x) || (t(this, a).max = t(this, d)), t(this, c).forEach((e) => {
|
|
85
|
+
e.resize(), e.transform();
|
|
86
|
+
}), t(this, x).current && t(this, c).length) {
|
|
87
|
+
const e = t(this, c)[t(this, c).length - 1], i = e.position + e.size - t(this, w), o = t(this, d) - i;
|
|
88
|
+
g(this, P, e.position + e.size + o);
|
|
89
|
+
} else
|
|
90
|
+
g(this, P, t(this, d));
|
|
91
|
+
if (t(this, L).current && t(this, c).length) {
|
|
92
|
+
const e = t(this, c)[t(this, m).current];
|
|
93
|
+
t(this, a).set(e.position, !0);
|
|
94
|
+
} else
|
|
95
|
+
t(this, a).set(s * t(this, d), !0);
|
|
96
|
+
}), l(this, pt, () => {
|
|
97
|
+
if (t(this, c).length) {
|
|
98
|
+
let s = 0;
|
|
99
|
+
for (let e = 0; e < t(this, c).length; e++) {
|
|
100
|
+
const i = t(this, c)[e];
|
|
101
|
+
i.transform(), this.targetScrollValue >= i.position && (s = e);
|
|
102
|
+
}
|
|
103
|
+
t(this, m).current = s;
|
|
104
|
+
} else
|
|
105
|
+
this.vertical ? t(this, p).style.transform = `translate3d(0px, ${this.currentScrollValue * -1}px, 0px)` : t(this, p).style.transform = `translate3d(${this.currentScrollValue * -1}px, 0px, 0px)`;
|
|
106
|
+
G.update(this, t(this, M).current, this.currentScrollValue);
|
|
107
|
+
}), l(this, et, (s) => {
|
|
108
|
+
if (typeof s == "number")
|
|
109
|
+
if (t(this, L).current) {
|
|
110
|
+
const e = Math.sign(s);
|
|
111
|
+
t(this, c).length ? this.shiftSections(e) : t(this, a).shift(e * t(this, w));
|
|
112
|
+
} else
|
|
113
|
+
t(this, a).shift(s);
|
|
114
|
+
else
|
|
115
|
+
s === "min" ? t(this, a).set(t(this, a).min) : s === "max" && t(this, a).set(t(this, a).delta);
|
|
116
|
+
}), St) {
|
|
117
|
+
g(this, a, new $t({ damping: 0.01, min: 0, order: Rt.SCROLL }));
|
|
118
|
+
const s = this.attachShadow({ mode: "open" }), e = document.createElement("style");
|
|
119
|
+
e.textContent = `
|
|
120
|
+
:host {
|
|
121
|
+
position: relative;
|
|
122
|
+
|
|
123
|
+
width: 100%;
|
|
124
|
+
height: 100%;
|
|
125
|
+
|
|
126
|
+
display: block;
|
|
127
|
+
outline: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host([hibernated="true"]) {
|
|
131
|
+
display: contents;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.static {
|
|
135
|
+
position: absolute;
|
|
136
|
+
top: 0;
|
|
137
|
+
left: 0;
|
|
138
|
+
|
|
139
|
+
z-index: 1;
|
|
140
|
+
|
|
141
|
+
width: 100%;
|
|
142
|
+
height: 100%;
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.content {
|
|
147
|
+
display: flex;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:host([hibernated="true"]) .content {
|
|
151
|
+
display: contents;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
::slotted(*) {
|
|
155
|
+
flex-shrink: 0;
|
|
156
|
+
}
|
|
157
|
+
`, s.appendChild(e), this.tabIndex = 0;
|
|
158
|
+
const i = document.createElement("div");
|
|
159
|
+
i.classList.add("static"), s.appendChild(i);
|
|
160
|
+
const o = document.createElement("slot");
|
|
161
|
+
o.setAttribute("name", "static"), i.appendChild(o), g(this, p, document.createElement("div")), t(this, p).classList.add("content"), s.appendChild(t(this, p));
|
|
162
|
+
const u = document.createElement("slot");
|
|
163
|
+
t(this, p).appendChild(u), g(this, V, new Pt({ element: this })), t(this, V).changeEvent.subscribe(t(this, et)), g(this, q, new Tt({ element: this })), t(this, q).changeEvent.subscribe(t(this, et)), t(this, M).subscribe(({ current: n }) => {
|
|
164
|
+
t(this, p).style.flexDirection = n === "x" ? "row" : "column", t(this, V).axis = n, this.isConnected && t(this, R).call(this);
|
|
165
|
+
}), t(this, A).subscribe(() => {
|
|
166
|
+
this.isConnected && t(this, R).call(this);
|
|
167
|
+
}), t(this, L).subscribe((n) => {
|
|
168
|
+
t(this, m).current = 0, t(this, V).debounce = n.current, t(this, a).reset(), this.isConnected && (n.current && !n.previous ? f(this, N, ot).call(this) : !n.current && n.previous && f(this, B, Q).call(this));
|
|
169
|
+
}), t(this, x).subscribe((n) => {
|
|
170
|
+
n.current ? (this.isConnected && (t(this, c).length || (t(this, y).current = !0)), t(this, c).length && (t(this, a).max = 1 / 0, t(this, a).min = -1 / 0)) : (g(this, J, 0), t(this, a).max = t(this, d), t(this, a).min = 0);
|
|
171
|
+
}), t(this, y).subscribe(({ current: n }) => {
|
|
172
|
+
this.isConnected && (n ? f(this, N, ot).call(this) : f(this, B, Q).call(this));
|
|
173
|
+
}), t(this, H).subscribe((n) => {
|
|
174
|
+
t(this, a).damping = n.current;
|
|
175
|
+
}), t(this, I).subscribe((n) => {
|
|
176
|
+
n.current && !n.previous ? f(this, at, gt).call(this) : !n.current && n.previous && f(this, ct, wt).call(this);
|
|
177
|
+
}), t(this, K).subscribe((n) => {
|
|
178
|
+
n.current && !n.previous ? f(this, j, dt).call(this) : !n.current && n.previous && f(this, tt, ft).call(this);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
get currentScrollValue() {
|
|
183
|
+
return f(this, st, bt).call(this, "current");
|
|
184
|
+
}
|
|
185
|
+
get targetScrollValue() {
|
|
186
|
+
return f(this, st, bt).call(this, "target");
|
|
187
|
+
}
|
|
188
|
+
get damped() {
|
|
189
|
+
return t(this, a);
|
|
190
|
+
}
|
|
191
|
+
get dampedAttibute() {
|
|
192
|
+
return t(this, a);
|
|
193
|
+
}
|
|
194
|
+
get axisAttibute() {
|
|
195
|
+
return t(this, M);
|
|
196
|
+
}
|
|
197
|
+
get pagesAttibute() {
|
|
198
|
+
return t(this, A);
|
|
199
|
+
}
|
|
200
|
+
get sectionalAttibute() {
|
|
201
|
+
return t(this, L);
|
|
202
|
+
}
|
|
203
|
+
get infiniteAttribute() {
|
|
204
|
+
return t(this, x);
|
|
205
|
+
}
|
|
206
|
+
get splitAttibute() {
|
|
207
|
+
return t(this, y);
|
|
208
|
+
}
|
|
209
|
+
get dampingAttibute() {
|
|
210
|
+
return t(this, H);
|
|
211
|
+
}
|
|
212
|
+
get disabledAttibute() {
|
|
213
|
+
return t(this, I);
|
|
214
|
+
}
|
|
215
|
+
get hibernatedAttibute() {
|
|
216
|
+
return t(this, K);
|
|
217
|
+
}
|
|
218
|
+
get position() {
|
|
219
|
+
return t(this, Y);
|
|
220
|
+
}
|
|
221
|
+
get viewportSize() {
|
|
222
|
+
return t(this, w);
|
|
223
|
+
}
|
|
224
|
+
get scrollSize() {
|
|
225
|
+
return t(this, d);
|
|
226
|
+
}
|
|
227
|
+
get counter() {
|
|
228
|
+
return t(this, m);
|
|
229
|
+
}
|
|
230
|
+
get distance() {
|
|
231
|
+
return t(this, P);
|
|
232
|
+
}
|
|
233
|
+
get overscroll() {
|
|
234
|
+
return t(this, J);
|
|
235
|
+
}
|
|
236
|
+
get vertical() {
|
|
237
|
+
return t(this, M).current === "y";
|
|
238
|
+
}
|
|
239
|
+
get currentProgress() {
|
|
240
|
+
return this.currentScrollValue / t(this, P);
|
|
241
|
+
}
|
|
242
|
+
get targetProgress() {
|
|
243
|
+
return this.targetScrollValue / t(this, P);
|
|
244
|
+
}
|
|
245
|
+
// TODO: Поправить значение когда скролл не секционный ??
|
|
246
|
+
scrollToSection(s, e = "smooth") {
|
|
247
|
+
if (!t(this, c).length)
|
|
248
|
+
return;
|
|
249
|
+
const i = t(this, m).current;
|
|
250
|
+
f(this, mt, At).call(this, s);
|
|
251
|
+
const o = t(this, c)[i], u = t(this, c)[t(this, m).current];
|
|
252
|
+
if (o && u) {
|
|
253
|
+
let n = 0;
|
|
254
|
+
const E = t(this, c).length - 1;
|
|
255
|
+
t(this, m).current === 0 && i === E ? n = t(this, d) + t(this, w) - o.position : t(this, m).current === E && i === 0 ? n = u.position - (t(this, d) + t(this, w)) : n = u.position - o.position, t(this, a).shift(n, e === "instant");
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
shiftSections(s, e = "smooth") {
|
|
259
|
+
t(this, c).length && this.scrollToSection(t(this, m).current + s, e);
|
|
260
|
+
}
|
|
261
|
+
connectedCallback() {
|
|
262
|
+
f(this, tt, ft).call(this), t(this, M).observe(), t(this, A).observe(), t(this, L).observe(), t(this, x).observe(), t(this, y).observe(), t(this, H).observe(), t(this, I).observe(), t(this, K).observe();
|
|
263
|
+
}
|
|
264
|
+
disconnectedCallback() {
|
|
265
|
+
f(this, j, dt).call(this), t(this, M).unobserve(), t(this, A).unobserve(), t(this, L).unobserve(), t(this, x).unobserve(), t(this, y).unobserve(), t(this, H).unobserve(), t(this, I).unobserve(), t(this, K).unobserve();
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
a = /* @__PURE__ */ new WeakMap();
|
|
269
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
270
|
+
A = /* @__PURE__ */ new WeakMap();
|
|
271
|
+
L = /* @__PURE__ */ new WeakMap();
|
|
272
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
273
|
+
y = /* @__PURE__ */ new WeakMap();
|
|
274
|
+
H = /* @__PURE__ */ new WeakMap();
|
|
275
|
+
I = /* @__PURE__ */ new WeakMap();
|
|
276
|
+
K = /* @__PURE__ */ new WeakMap();
|
|
277
|
+
p = /* @__PURE__ */ new WeakMap();
|
|
278
|
+
c = /* @__PURE__ */ new WeakMap();
|
|
279
|
+
Y = /* @__PURE__ */ new WeakMap();
|
|
280
|
+
w = /* @__PURE__ */ new WeakMap();
|
|
281
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
282
|
+
V = /* @__PURE__ */ new WeakMap();
|
|
283
|
+
q = /* @__PURE__ */ new WeakMap();
|
|
284
|
+
m = /* @__PURE__ */ new WeakMap();
|
|
285
|
+
J = /* @__PURE__ */ new WeakMap();
|
|
286
|
+
P = /* @__PURE__ */ new WeakMap();
|
|
287
|
+
N = /* @__PURE__ */ new WeakSet();
|
|
288
|
+
ot = function() {
|
|
289
|
+
f(this, B, Q).call(this), t(this, p).querySelector("slot").assignedElements().forEach((e) => {
|
|
290
|
+
e instanceof HTMLElement && t(this, c).push(new Gt(e, this));
|
|
291
|
+
}), t(this, p).style.transform = "", t(this, R).call(this);
|
|
292
|
+
};
|
|
293
|
+
B = /* @__PURE__ */ new WeakSet();
|
|
294
|
+
Q = function() {
|
|
295
|
+
t(this, c).forEach((s) => {
|
|
296
|
+
s.destroy();
|
|
297
|
+
}), g(this, c, []);
|
|
298
|
+
};
|
|
299
|
+
at = /* @__PURE__ */ new WeakSet();
|
|
300
|
+
gt = function() {
|
|
301
|
+
t(this, a).unsubscribe(t(this, pt)), t(this, a).unlistenAnimationFrame(), t(this, V).disconnect(), t(this, q).disconnect();
|
|
302
|
+
};
|
|
303
|
+
ct = /* @__PURE__ */ new WeakSet();
|
|
304
|
+
wt = function() {
|
|
305
|
+
t(this, a).subscribe(t(this, pt)), t(this, V).connect(), t(this, q).connect();
|
|
306
|
+
};
|
|
307
|
+
j = /* @__PURE__ */ new WeakSet();
|
|
308
|
+
dt = function() {
|
|
309
|
+
lt.unsubscribe(t(this, R)), t(this, a).reset(), f(this, at, gt).call(this), t(this, p).style.transform = "", t(this, y).current && f(this, B, Q).call(this), G.unregister(this);
|
|
310
|
+
};
|
|
311
|
+
tt = /* @__PURE__ */ new WeakSet();
|
|
312
|
+
ft = function() {
|
|
313
|
+
t(this, y).current && f(this, N, ot).call(this), G.register(this), lt.subscribe(t(this, R), Mt.SCROLL), f(this, ct, wt).call(this);
|
|
314
|
+
};
|
|
315
|
+
R = /* @__PURE__ */ new WeakMap();
|
|
316
|
+
pt = /* @__PURE__ */ new WeakMap();
|
|
317
|
+
mt = /* @__PURE__ */ new WeakSet();
|
|
318
|
+
At = function(s) {
|
|
319
|
+
t(this, x).current ? (t(this, m).current = s % t(this, c).length, t(this, m).current = t(this, m).current < 0 ? t(this, c).length + t(this, m).current : t(this, m).current) : t(this, m).current = Wt(s, 0, t(this, c).length - 1);
|
|
320
|
+
};
|
|
321
|
+
et = /* @__PURE__ */ new WeakMap();
|
|
322
|
+
st = /* @__PURE__ */ new WeakSet();
|
|
323
|
+
bt = function(s = "current") {
|
|
324
|
+
if (t(this, x).current && t(this, c).length) {
|
|
325
|
+
const e = t(this, a)[s] % (t(this, d) + t(this, w)), i = e < 0 ? t(this, d) + e + t(this, w) : e;
|
|
326
|
+
return g(this, J, Math.max(0, i - t(this, d))), i;
|
|
327
|
+
} else
|
|
328
|
+
return t(this, a)[s];
|
|
329
|
+
};
|
|
330
|
+
ut = Kt([
|
|
331
|
+
Ct("e-scroll")
|
|
332
|
+
], ut);
|
|
333
|
+
var X;
|
|
334
|
+
class qt extends kt {
|
|
335
|
+
constructor() {
|
|
336
|
+
super(...arguments);
|
|
337
|
+
D(this, X, null);
|
|
338
|
+
}
|
|
339
|
+
get scrollElement() {
|
|
340
|
+
return h(this, X);
|
|
341
|
+
}
|
|
342
|
+
connectedCallback() {
|
|
343
|
+
const i = Dt(this, ut);
|
|
344
|
+
i instanceof ut ? $(this, X, i) : console.error(this, "e-scroll not found");
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
X = new WeakMap();
|
|
348
|
+
var Bt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, Ut = (s, e, i, o) => {
|
|
349
|
+
for (var u = o > 1 ? void 0 : o ? Ft(e, i) : e, n = s.length - 1, E; n >= 0; n--)
|
|
350
|
+
(E = s[n]) && (u = (o ? E(e, i, u) : E(u)) || u);
|
|
351
|
+
return o && u && Bt(e, i, u), u;
|
|
352
|
+
}, Lt = (s, e, i) => {
|
|
353
|
+
if (!e.has(s))
|
|
354
|
+
throw TypeError("Cannot " + i);
|
|
355
|
+
}, r = (s, e, i) => (Lt(s, e, "read from private field"), i ? i.call(s) : e.get(s)), S = (s, e, i) => {
|
|
356
|
+
if (e.has(s))
|
|
357
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
358
|
+
e instanceof WeakSet ? e.add(s) : e.set(s, i);
|
|
359
|
+
}, C = (s, e, i, o) => (Lt(s, e, "write to private field"), o ? o.call(s, i) : e.set(s, i), i), F, b, z, O, U, Z, it, nt, rt, ht;
|
|
360
|
+
let Et = class extends qt {
|
|
361
|
+
constructor() {
|
|
362
|
+
if (super(), S(this, F, null), S(this, b, null), S(this, z, !1), S(this, O, 0), S(this, U, 0), S(this, Z, 0), S(this, it, () => {
|
|
363
|
+
C(this, z, this.offsetWidth > this.offsetHeight);
|
|
364
|
+
const s = r(this, z) ? this.offsetWidth : this.offsetHeight;
|
|
365
|
+
C(this, O, s / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / s)), C(this, O, Math.max(r(this, O), 30)), r(this, z) ? (r(this, b).style.width = r(this, O) + "px", r(this, b).style.height = "100%") : (r(this, b).style.width = "100%", r(this, b).style.height = r(this, O) + "px"), C(this, U, s - r(this, O)), this.scrollElement.scrollSize || (this.style.display = "none");
|
|
366
|
+
}), S(this, nt, () => {
|
|
367
|
+
C(this, Z, this.scrollElement.currentProgress * r(this, U)), r(this, z) ? r(this, b).style.transform = `translate3d(${r(this, Z)}px, 0px, 0px)` : r(this, b).style.transform = `translate3d(0px, ${r(this, Z)}px, 0px)`;
|
|
368
|
+
}), S(this, rt, () => {
|
|
369
|
+
this.setAttribute("axis", this.scrollElement.axisAttibute.current);
|
|
370
|
+
}), S(this, ht, (s) => {
|
|
371
|
+
const e = (n) => {
|
|
372
|
+
const E = r(this, z) ? n.x : n.y, zt = this.scrollElement.distance / r(this, U), Ot = (E - u) * zt;
|
|
373
|
+
this.scrollElement.damped.set(o + Ot);
|
|
374
|
+
}, i = () => {
|
|
375
|
+
removeEventListener("pointermove", e), removeEventListener("pointerup", i), removeEventListener("touchend", i);
|
|
376
|
+
};
|
|
377
|
+
addEventListener("pointermove", e), addEventListener("pointerup", i), addEventListener("touchend", i);
|
|
378
|
+
const o = this.scrollElement.damped.target, u = r(this, z) ? s.x : s.y;
|
|
379
|
+
}), St) {
|
|
380
|
+
const s = this.attachShadow({ mode: "open" }), e = document.createElement("style");
|
|
381
|
+
e.textContent = `
|
|
382
|
+
:host {
|
|
383
|
+
display: inline-block;
|
|
384
|
+
z-index: 1;
|
|
385
|
+
background-color: #efefef;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
:host([axis="y"]) {
|
|
389
|
+
position: absolute;
|
|
390
|
+
right: 0;
|
|
391
|
+
top: 0;
|
|
392
|
+
width: 1vmin;
|
|
393
|
+
height: 100%;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
:host([axis="x"]) {
|
|
397
|
+
position: absolute;
|
|
398
|
+
left: 0;
|
|
399
|
+
bottom: 0;
|
|
400
|
+
width: 100%;
|
|
401
|
+
height: 1vmin;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.default-thumb {
|
|
405
|
+
background-color: #181818;
|
|
406
|
+
border-radius: 1vmin;
|
|
407
|
+
touch-action: none;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
::slotted(*) {
|
|
411
|
+
touch-action: none;
|
|
412
|
+
}
|
|
413
|
+
`, s.appendChild(e), C(this, F, document.createElement("slot")), s.appendChild(r(this, F));
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
get thumbElement() {
|
|
417
|
+
return r(this, b);
|
|
418
|
+
}
|
|
419
|
+
connectedCallback() {
|
|
420
|
+
super.connectedCallback();
|
|
421
|
+
const s = r(this, F).assignedElements()[0];
|
|
422
|
+
s instanceof HTMLElement ? C(this, b, s) : (C(this, b, document.createElement("div")), r(this, b).classList.add("default-thumb"), this.shadowRoot.appendChild(r(this, b))), r(this, b).addEventListener("pointerdown", r(this, ht)), lt.subscribe(r(this, it), Mt.SCROLL + 1), this.scrollElement.damped.subscribe(r(this, nt)), this.scrollElement.axisAttibute.subscribe(r(this, rt));
|
|
423
|
+
}
|
|
424
|
+
disconnectedCallback() {
|
|
425
|
+
r(this, b).removeEventListener("pointerdown", r(this, ht)), lt.unsubscribe(r(this, it)), this.scrollElement.damped.unsubscribe(r(this, nt)), this.scrollElement.axisAttibute.unsubscribe(r(this, rt));
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
F = /* @__PURE__ */ new WeakMap();
|
|
429
|
+
b = /* @__PURE__ */ new WeakMap();
|
|
430
|
+
z = /* @__PURE__ */ new WeakMap();
|
|
431
|
+
O = /* @__PURE__ */ new WeakMap();
|
|
432
|
+
U = /* @__PURE__ */ new WeakMap();
|
|
433
|
+
Z = /* @__PURE__ */ new WeakMap();
|
|
434
|
+
it = /* @__PURE__ */ new WeakMap();
|
|
435
|
+
nt = /* @__PURE__ */ new WeakMap();
|
|
436
|
+
rt = /* @__PURE__ */ new WeakMap();
|
|
437
|
+
ht = /* @__PURE__ */ new WeakMap();
|
|
438
|
+
Et = Ut([
|
|
439
|
+
Ct("e-scrollbar")
|
|
440
|
+
], Et);
|
|
441
|
+
export {
|
|
442
|
+
ut as ScrollElement,
|
|
443
|
+
Et as ScrollbarElement
|
|
444
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)};var s=(r,t,e)=>(o(r,t,"read from private field"),e?e.call(r):t.get(r)),h=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var a,n;class u{constructor(){h(this,a,new Set);h(this,n,new WeakMap)}register(t){s(this,n).set(t,{axis:"y",value:0}),s(this,a).add(t)}unregister(t){s(this,n).delete(t),s(this,a).delete(t)}update(t,e,l){const i=s(this,n).get(t);i.axis=e,i.value=l}hasEntry(t){return s(this,n).has(t)}getEntry(t){return s(this,n).get(t)}getClosest(t){let e=t.parentElement;for(;e&&!this.hasEntry(e);)e=e.parentElement;if(e&&e!==t){const l=this.getEntry(e);return l||this.getClosest(e)}return null}getAll(t){const e=Array.from(s(this,a)).filter(i=>i!==t&&i.contains(t)),l=[];return e.forEach(i=>{s(this,n).has(i)&&l.push(s(this,n).get(i))}),l}}a=new WeakMap,n=new WeakMap;const c=new u;exports.scrollEnties=c;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Axes2D } from '../utils';
|
|
2
|
+
interface ScrollEntry {
|
|
3
|
+
axis: Axes2D;
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
declare class ScrollEntries {
|
|
7
|
+
#private;
|
|
8
|
+
register(element: HTMLElement): void;
|
|
9
|
+
unregister(element: HTMLElement): void;
|
|
10
|
+
update(element: HTMLElement, axis: Axes2D, value: number): void;
|
|
11
|
+
hasEntry(element: HTMLElement): boolean;
|
|
12
|
+
getEntry(element: HTMLElement): ScrollEntry;
|
|
13
|
+
getClosest(element: HTMLElement): ScrollEntry | null;
|
|
14
|
+
getAll(element: HTMLElement): ScrollEntry[];
|
|
15
|
+
}
|
|
16
|
+
export declare const scrollEnties: ScrollEntries;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var o = (r, t, e) => {
|
|
2
|
+
if (!t.has(r))
|
|
3
|
+
throw TypeError("Cannot " + e);
|
|
4
|
+
};
|
|
5
|
+
var s = (r, t, e) => (o(r, t, "read from private field"), e ? e.call(r) : t.get(r)), l = (r, t, e) => {
|
|
6
|
+
if (t.has(r))
|
|
7
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
+
t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
|
9
|
+
};
|
|
10
|
+
var a, n;
|
|
11
|
+
class u {
|
|
12
|
+
constructor() {
|
|
13
|
+
l(this, a, /* @__PURE__ */ new Set());
|
|
14
|
+
l(this, n, /* @__PURE__ */ new WeakMap());
|
|
15
|
+
}
|
|
16
|
+
register(t) {
|
|
17
|
+
s(this, n).set(t, {
|
|
18
|
+
axis: "y",
|
|
19
|
+
value: 0
|
|
20
|
+
}), s(this, a).add(t);
|
|
21
|
+
}
|
|
22
|
+
unregister(t) {
|
|
23
|
+
s(this, n).delete(t), s(this, a).delete(t);
|
|
24
|
+
}
|
|
25
|
+
update(t, e, h) {
|
|
26
|
+
const i = s(this, n).get(t);
|
|
27
|
+
i.axis = e, i.value = h;
|
|
28
|
+
}
|
|
29
|
+
hasEntry(t) {
|
|
30
|
+
return s(this, n).has(t);
|
|
31
|
+
}
|
|
32
|
+
getEntry(t) {
|
|
33
|
+
return s(this, n).get(t);
|
|
34
|
+
}
|
|
35
|
+
getClosest(t) {
|
|
36
|
+
let e = t.parentElement;
|
|
37
|
+
for (; e && !this.hasEntry(e); )
|
|
38
|
+
e = e.parentElement;
|
|
39
|
+
if (e && e !== t) {
|
|
40
|
+
const h = this.getEntry(e);
|
|
41
|
+
return h || this.getClosest(e);
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
getAll(t) {
|
|
46
|
+
const e = Array.from(s(this, a)).filter((i) => i !== t && i.contains(t)), h = [];
|
|
47
|
+
return e.forEach((i) => {
|
|
48
|
+
s(this, n).has(i) && h.push(s(this, n).get(i));
|
|
49
|
+
}), h;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
a = new WeakMap(), n = new WeakMap();
|
|
53
|
+
const g = new u();
|
|
54
|
+
export {
|
|
55
|
+
g as scrollEnties
|
|
56
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CustomElement } from '../custom-element';
|
|
2
|
+
import { Notifier } from '../notifier';
|
|
3
|
+
export interface SourceConsumer extends HTMLElement {
|
|
4
|
+
src: string | null;
|
|
5
|
+
}
|
|
6
|
+
export declare abstract class SourceElement<T extends SourceConsumer> extends CustomElement {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
get consumerElement(): T;
|
|
10
|
+
get captureEvent(): Notifier<import('../notifier').ProviderCallback>;
|
|
11
|
+
get releaseEvent(): Notifier<import('../notifier').ProviderCallback>;
|
|
12
|
+
protected abstract createConsumer(): T;
|
|
13
|
+
protected abstract consumeSource(url: string | null): void;
|
|
14
|
+
protected connectedCallback(): void;
|
|
15
|
+
protected disconnectedCallback(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Store } from '../store';
|
|
2
|
+
import type { Source } from './SourceClass';
|
|
3
|
+
export type SourceManagerSourceSet = string | Array<string>;
|
|
4
|
+
export interface SourceManagerParameters {
|
|
5
|
+
srcset: SourceManagerSourceSet;
|
|
6
|
+
}
|
|
7
|
+
export declare class SourceManager extends Store<Source | undefined> {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(parameters: SourceManagerParameters);
|
|
10
|
+
close(): void;
|
|
11
|
+
connect(): void;
|
|
12
|
+
disconnect(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Source } from './SourceClass';
|
|
2
|
+
export type SourceSetMediaSources = Array<Source>;
|
|
3
|
+
export type SourceSetMediaBucket = Map<string, SourceSetMediaSources>;
|
|
4
|
+
export declare class SourceSet {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(sourceSet: string | Array<string>);
|
|
7
|
+
get mediaBuckets(): SourceSetMediaBucket;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var v=(i,r,t)=>{if(!r.has(i))throw TypeError("Cannot "+t)};var e=(i,r,t)=>(v(i,r,"read from private field"),t?t.call(i):r.get(i)),n=(i,r,t)=>{if(r.has(i))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(i):r.set(i,t)},l=(i,r,t,a)=>(v(i,r,"write to private field"),a?a.call(i,t):r.set(i,t),t);var E=(i,r,t)=>(v(i,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../SourceManager-tmQlXkSD.cjs"),C=require("../custom-element/index.cjs"),x=require("../intersector/index.cjs"),q=require("../loading/index.cjs"),A=require("../notifier/index.cjs");require("../order/index.cjs");require("../resizer/index.cjs");require("../browser-QbF6EW-w.cjs");require("../function-QP7IreXR.cjs");require("../Store-txkR3wXU.cjs");let N=0;var o,s,h,m,c,u,f,g,b,y,p;class k extends C.CustomElement{constructor(){super();n(this,b);n(this,o,null);n(this,s,null);n(this,h,!1);n(this,m,!1);n(this,c,!1);n(this,u,void 0);n(this,f,new A.Notifier);n(this,g,new A.Notifier);n(this,p,t=>{e(this,c)&&!e(this,m)&&t.isIntersecting&&(e(this,o).current&&e(this,o).current!==e(this,o).previous&&E(this,b,y).call(this,e(this,o).current),l(this,m,!0)),t.isIntersecting?e(this,f).notify():e(this,g).notify()});l(this,u,`source-consumer-${++N}`)}get consumerElement(){return e(this,s)}get captureEvent(){return e(this,f)}get releaseEvent(){return e(this,g)}connectedCallback(){const t=this.getAttribute("srcset");t&&(l(this,s,this.createConsumer()),e(this,s).style.cssText=`
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
`,e(this,s).classList.add("source-consumer"),Array.from(this.attributes).forEach(a=>{if(a.nodeName.startsWith("e-")){const S=a.nodeName.slice(2),d=a.nodeValue||"";e(this,s).setAttribute(S,d),e(this,s)[S]=d||!0}}),this.appendChild(e(this,s)),l(this,o,new L.SourceManager({srcset:t})),l(this,c,this.hasAttribute("lazy")),e(this,o).subscribe(a=>{(!e(this,c)||e(this,c)&&e(this,m))&&E(this,b,y).call(this,a.current)}),x.intersector.subscribe(this,e(this,p)),e(this,o).connect())}disconnectedCallback(){x.intersector.unsubscribe(e(this,p)),e(this,f).close(),e(this,g).close(),e(this,o).close(),e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,e(this,s).remove()}}o=new WeakMap,s=new WeakMap,h=new WeakMap,m=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap,g=new WeakMap,b=new WeakSet,y=function(t){if(e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,t){const a=this.hasAttribute("keep-source-parameters");this.classList.remove("loaded"),this.classList.add("loading");const S=a?t.url:t.name+t.extension;this.consumeSource(S);const d=()=>{this.classList.remove("error"),this.classList.remove("loading"),this.classList.add("loaded"),!e(this,c)&&!e(this,h)&&q.loading.setLoaded(e(this,u),1),l(this,h,!0)},M=()=>{this.classList.remove("loading"),this.classList.add("error"),!e(this,c)&&!e(this,h)&&q.loading.setError(e(this,u),S),l(this,h,!0)};!e(this,c)&&!e(this,h)&&q.loading.setTotal(e(this,u),1),e(this,s).onloadeddata=()=>{d()},e(this,s).onload=()=>{d()},e(this,s).onerror=M}else this.consumeSource(null)},p=new WeakMap;exports.Source=L.Source;exports.SourceManager=L.SourceManager;exports.SourceSet=L.SourceSet;exports.SourceElement=k;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Source } from './SourceClass';
|
|
2
|
+
export { SourceSet, type SourceSetMediaSources, type SourceSetMediaBucket } from './SourceSet';
|
|
3
|
+
export { SourceManager, type SourceManagerSourceSet, type SourceManagerParameters, } from './SourceManager';
|
|
4
|
+
export { SourceElement, type SourceConsumer } from './SourceElement';
|