aptechka 0.4.31 → 0.4.32
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-BJgyFENo.js +258 -0
- package/lib/Damped-CbWlWAbx.cjs +1 -0
- package/lib/animation/Animation.d.ts +42 -7
- package/lib/animation/AnimationLink.d.ts +13 -0
- package/lib/animation/Damped.d.ts +23 -28
- package/lib/animation/Tweened.d.ts +7 -19
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.d.ts +2 -1
- package/lib/animation/index.js +43 -61
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +35 -35
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.d.ts +3 -1
- package/lib/class-linked-status/index.js +36 -37
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +64 -64
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +5 -1
- package/lib/css-property/index.js +35 -31
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.d.ts +0 -1
- package/lib/en3/index.js +268 -281
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +8 -8
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.d.ts +12 -6
- package/lib/ladder/index.js +119 -114
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +4 -3
- package/lib/order/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +2 -2
- package/lib/scroll/ScrollElement.d.ts +1 -3
- package/lib/scroll/ScrollSegmentElement.d.ts +6 -11
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.d.ts +1 -1
- package/lib/scroll/index.js +497 -500
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.d.ts +4 -2
- package/lib/sequence/index.js +129 -114
- package/lib/source/SourceElement.d.ts +14 -7
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.d.ts +2 -2
- package/lib/source/index.js +66 -56
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.d.ts +15 -0
- package/lib/theme/index.js +9 -6
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.d.ts +3 -2
- package/lib/ticker/index.js +81 -71
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +10 -10
- package/package.json +1 -1
- package/lib/Damped-B0G_t-pw.cjs +0 -1
- package/lib/Damped-DpaKIZqv.js +0 -150
- package/lib/en3/instances/en3LazyLoader.d.ts +0 -8
package/lib/sequence/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var P=(
|
|
1
|
+
"use strict";var P=(n,s,t)=>new Promise((i,a)=>{var u=r=>{try{d(t.next(r))}catch(w){a(w)}},o=r=>{try{d(t.throw(r))}catch(w){a(w)}},d=r=>r.done?i(r.value):Promise.resolve(r.value).then(u,o);d((t=t.apply(n,s)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../canvas/index.cjs"),C=require("../css-property/index.cjs"),I=require("../custom-element/index.cjs"),q=require("../element-resizer/index.cjs");require("../window-resizer/index.cjs");require("../Store-BQGNOHlY.cjs");const L=require("../browser-CpzFX2xg.cjs"),W=require("../canvas-CU5Xjahf.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const R=require("../source/index.cjs");var z=Object.defineProperty,O=Object.getOwnPropertyDescriptor,B=(n,s,t,i)=>{for(var a=i>1?void 0:i?O(s,t):s,u=n.length-1,o;u>=0;u--)(o=n[u])&&(a=(i?o(s,t,a):o(a))||a);return i&&a&&z(s,t,a),a},x=(n,s,t)=>{if(!s.has(n))throw TypeError("Cannot "+t)},e=(n,s,t)=>(x(n,s,"read from private field"),t?t.call(n):s.get(n)),c=(n,s,t)=>{if(s.has(n))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(n):s.set(n,t)},m=(n,s,t,i)=>(x(n,s,"write to private field"),i?i.call(n,t):s.set(n,t),t),h,E,g,p,v,S,_,b,l,f;function D(n){const s=n.match(/\{([\d-]+)\}/);if(s){const t=s[1].split("-");if(t.length===2){const i=parseInt(t[0],10),a=parseInt(t[1],10);return{start:i,end:a}}}return null}exports.SequenceElement=class extends R.SourceElement{constructor(s){super(),c(this,h,[]),c(this,E,new C.CSSProperty(this,"--fit","contain")),c(this,g,new C.CSSProperty(this,"--autoplay",!1)),c(this,p,new C.CSSProperty(this,"--offset-x",.5)),c(this,v,new C.CSSProperty(this,"--offset-y",.5)),c(this,S,null),c(this,_,0),c(this,b,1),c(this,l,()=>{if(e(this,h).length){const t=e(this,h)[0];e(this,E).current==="cover"?m(this,S,W.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,p).current,e(this,v).current)):m(this,S,W.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,p).current,e(this,v).current))}}),c(this,f,t=>{if(this.status.isFalse("loaded")||!e(this,S))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,h)[e(this,_)];i&&t.detail.context.drawImage(i,...e(this,S)),e(this,g).current&&m(this,_,(e(this,_)+1)%e(this,h).length)}),L.isBrowser&&(m(this,b,parseInt(((s==null?void 0:s.pad)||this.getAttribute("pad")||"1").toString())),e(this,E).subscribe(e(this,l)),e(this,p).subscribe(e(this,l)),e(this,v).subscribe(e(this,l)),this.addEventListener("sourceCapture",t=>{this.consumerElement.addEventListener("canvasRender",e(this,f))}),this.addEventListener("sourceRelease",t=>{this.consumerElement.removeEventListener("canvasRender",e(this,f))}))}setProgress(s){e(this,h).length&&m(this,_,Math.floor((e(this,h).length-1)*s))}connectedCallback(){super.connectedCallback(),e(this,g).observe(),e(this,E).observe(),e(this,p).observe(),e(this,v).observe(),q.elementResizer.subscribe(this,e(this,l))}disconnectedCallback(){super.disconnectedCallback(),e(this,g).unobserve(),e(this,E).unobserve(),e(this,p).unobserve(),e(this,v).unobserve(),m(this,h,[]),q.elementResizer.unsubscribe(e(this,l)),this.consumerElement.removeEventListener("canvasRender",e(this,f))}createConsumer(){return new k.CanvasElement}consumeSource(s){return P(this,null,function*(){var t,i,a,u;if(s){this.consumerElement.removeEventListener("canvasRender",e(this,f));const o=[],d=D(s);if(d)for(let r=d.start;r<=d.end;r++){const w=s.replace(/\{([^}]+)\}/,r.toString().padStart(e(this,b),"0")),y=new Image;y.src=w,o.push(y)}else{const r=new Image;r.src=s,o.push(r)}try{yield Promise.all(o.map((r,w)=>new Promise((y,M)=>{r.onload=()=>{y()},r.onerror=T=>{M(`${r.src} Image not found`)}}))),m(this,h,o),e(this,l).call(this),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,f))}catch(r){console.error(r),(u=(a=this.consumerElement).onerror)==null||u.call(a,new Event("error"))}}})}};h=new WeakMap;E=new WeakMap;g=new WeakMap;p=new WeakMap;v=new WeakMap;S=new WeakMap;_=new WeakMap;b=new WeakMap;l=new WeakMap;f=new WeakMap;exports.SequenceElement=B([I.define("e-sequence")],exports.SequenceElement);
|
package/lib/sequence/index.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { SourceManagerSourceSet } from '../source';
|
|
1
|
+
import { SourceElement, SourceManagerSourceSet } from '../source';
|
|
2
2
|
import { CanvasElement } from '../canvas';
|
|
3
3
|
|
|
4
4
|
export interface SequenceElementParameters {
|
|
5
5
|
srcset: SourceManagerSourceSet;
|
|
6
6
|
pad?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare class SequenceElement extends CanvasElement {
|
|
8
|
+
export declare class SequenceElement extends SourceElement<CanvasElement> {
|
|
9
9
|
#private;
|
|
10
10
|
constructor(parameters?: SequenceElementParameters);
|
|
11
11
|
setProgress(value: number): void;
|
|
12
12
|
protected connectedCallback(): void;
|
|
13
13
|
protected disconnectedCallback(): void;
|
|
14
|
+
protected createConsumer(): CanvasElement;
|
|
15
|
+
protected consumeSource(url: string | null): Promise<void>;
|
|
14
16
|
}
|
|
15
17
|
declare global {
|
|
16
18
|
interface HTMLElementTagNameMap {
|
package/lib/sequence/index.js
CHANGED
|
@@ -1,151 +1,166 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var y = (s, t, r) => new Promise((a, i) => {
|
|
2
|
+
var o = (h) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
n(r.next(h));
|
|
5
|
+
} catch (m) {
|
|
6
|
+
i(m);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, u = (h) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
n(r.throw(h));
|
|
11
|
+
} catch (m) {
|
|
12
|
+
i(m);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, n = (h) => h.done ? a(h.value) : Promise.resolve(h.value).then(o, u);
|
|
15
|
+
n((r = r.apply(s, t)).next());
|
|
16
16
|
});
|
|
17
|
-
import { CanvasElement as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import "../
|
|
24
|
-
import { c as
|
|
17
|
+
import { CanvasElement as I } from "../canvas/index.js";
|
|
18
|
+
import { CSSProperty as C } from "../css-property/index.js";
|
|
19
|
+
import { define as L } from "../custom-element/index.js";
|
|
20
|
+
import { elementResizer as W } from "../element-resizer/index.js";
|
|
21
|
+
import "../window-resizer/index.js";
|
|
22
|
+
import "../Store-Cd-E5W1z.js";
|
|
23
|
+
import { i as x } from "../browser-0zX67oeU.js";
|
|
24
|
+
import { c as R, a as O } from "../canvas-DeZ0SLUJ.js";
|
|
25
25
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
import { SourceElement as z } from "../source/index.js";
|
|
27
|
+
var B = Object.defineProperty, D = Object.getOwnPropertyDescriptor, q = (s, t, r, a) => {
|
|
28
|
+
for (var i = a > 1 ? void 0 : a ? D(t, r) : t, o = s.length - 1, u; o >= 0; o--)
|
|
29
|
+
(u = s[o]) && (i = (a ? u(t, r, i) : u(i)) || i);
|
|
30
|
+
return a && i && B(t, r, i), i;
|
|
31
|
+
}, k = (s, t, r) => {
|
|
32
|
+
if (!t.has(s))
|
|
33
|
+
throw TypeError("Cannot " + r);
|
|
34
|
+
}, e = (s, t, r) => (k(s, t, "read from private field"), r ? r.call(s) : t.get(s)), c = (s, t, r) => {
|
|
35
|
+
if (t.has(s))
|
|
35
36
|
throw TypeError("Cannot add the same private member more than once");
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
return { start:
|
|
37
|
+
t instanceof WeakSet ? t.add(s) : t.set(s, r);
|
|
38
|
+
}, p = (s, t, r, a) => (k(s, t, "write to private field"), a ? a.call(s, r) : t.set(s, r), r), l, E, S, f, v, _, g, b, d, w;
|
|
39
|
+
function A(s) {
|
|
40
|
+
const t = s.match(/\{([\d-]+)\}/);
|
|
41
|
+
if (t) {
|
|
42
|
+
const r = t[1].split("-");
|
|
43
|
+
if (r.length === 2) {
|
|
44
|
+
const a = parseInt(r[0], 10), i = parseInt(r[1], 10);
|
|
45
|
+
return { start: a, end: i };
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
return null;
|
|
48
49
|
}
|
|
49
|
-
let
|
|
50
|
-
constructor(
|
|
51
|
-
super(),
|
|
50
|
+
let P = class extends z {
|
|
51
|
+
constructor(s) {
|
|
52
|
+
super(), c(this, l, []), c(this, E, new C(
|
|
52
53
|
this,
|
|
53
54
|
"--fit",
|
|
54
55
|
"contain"
|
|
55
|
-
)),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
t
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.width,
|
|
73
|
-
this.height,
|
|
74
|
-
t(this, p).current,
|
|
75
|
-
t(this, w).current
|
|
56
|
+
)), c(this, S, new C(this, "--autoplay", !1)), c(this, f, new C(this, "--offset-x", 0.5)), c(this, v, new C(this, "--offset-y", 0.5)), c(this, _, null), c(this, g, 0), c(this, b, 1), c(this, d, () => {
|
|
57
|
+
if (e(this, l).length) {
|
|
58
|
+
const t = e(this, l)[0];
|
|
59
|
+
e(this, E).current === "cover" ? p(this, _, R(
|
|
60
|
+
t.naturalWidth,
|
|
61
|
+
t.naturalHeight,
|
|
62
|
+
this.consumerElement.width,
|
|
63
|
+
this.consumerElement.height,
|
|
64
|
+
e(this, f).current,
|
|
65
|
+
e(this, v).current
|
|
66
|
+
)) : p(this, _, O(
|
|
67
|
+
t.naturalWidth,
|
|
68
|
+
t.naturalHeight,
|
|
69
|
+
this.consumerElement.width,
|
|
70
|
+
this.consumerElement.height,
|
|
71
|
+
e(this, f).current,
|
|
72
|
+
e(this, v).current
|
|
76
73
|
));
|
|
77
74
|
}
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
}), c(this, w, (t) => {
|
|
76
|
+
if (this.status.isFalse("loaded") || !e(this, _))
|
|
77
|
+
return;
|
|
78
|
+
t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
|
|
79
|
+
const r = e(this, l)[e(this, g)];
|
|
80
|
+
r && t.detail.context.drawImage(r, ...e(this, _)), e(this, S).current && p(this, g, (e(this, g) + 1) % e(this, l).length);
|
|
81
|
+
}), x && (p(this, b, parseInt(
|
|
82
|
+
((s == null ? void 0 : s.pad) || this.getAttribute("pad") || "1").toString()
|
|
83
|
+
)), e(this, E).subscribe(e(this, d)), e(this, f).subscribe(e(this, d)), e(this, v).subscribe(e(this, d)), this.addEventListener("sourceCapture", (t) => {
|
|
84
|
+
this.consumerElement.addEventListener(
|
|
85
|
+
"canvasRender",
|
|
86
|
+
e(this, w)
|
|
87
|
+
);
|
|
88
|
+
}), this.addEventListener("sourceRelease", (t) => {
|
|
89
|
+
this.consumerElement.removeEventListener(
|
|
90
|
+
"canvasRender",
|
|
91
|
+
e(this, w)
|
|
92
|
+
);
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
setProgress(s) {
|
|
96
|
+
e(this, l).length && p(this, g, Math.floor((e(this, l).length - 1) * s));
|
|
97
|
+
}
|
|
98
|
+
connectedCallback() {
|
|
99
|
+
super.connectedCallback(), e(this, S).observe(), e(this, E).observe(), e(this, f).observe(), e(this, v).observe(), W.subscribe(this, e(this, d));
|
|
100
|
+
}
|
|
101
|
+
disconnectedCallback() {
|
|
102
|
+
super.disconnectedCallback(), e(this, S).unobserve(), e(this, E).unobserve(), e(this, f).unobserve(), e(this, v).unobserve(), p(this, l, []), W.unsubscribe(e(this, d)), this.consumerElement.removeEventListener(
|
|
103
|
+
"canvasRender",
|
|
104
|
+
e(this, w)
|
|
81
105
|
);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
106
|
+
}
|
|
107
|
+
createConsumer() {
|
|
108
|
+
return new I();
|
|
109
|
+
}
|
|
110
|
+
consumeSource(s) {
|
|
111
|
+
return y(this, null, function* () {
|
|
112
|
+
var t, r, a, i;
|
|
113
|
+
if (s) {
|
|
114
|
+
this.consumerElement.removeEventListener(
|
|
115
|
+
"canvasRender",
|
|
116
|
+
e(this, w)
|
|
117
|
+
);
|
|
118
|
+
const o = [], u = A(s);
|
|
89
119
|
if (u)
|
|
90
|
-
for (let
|
|
91
|
-
const
|
|
120
|
+
for (let n = u.start; n <= u.end; n++) {
|
|
121
|
+
const h = s.replace(
|
|
92
122
|
/\{([^}]+)\}/,
|
|
93
|
-
|
|
94
|
-
),
|
|
95
|
-
|
|
123
|
+
n.toString().padStart(e(this, b), "0")
|
|
124
|
+
), m = new Image();
|
|
125
|
+
m.src = h, o.push(m);
|
|
96
126
|
}
|
|
97
127
|
else {
|
|
98
|
-
const
|
|
99
|
-
|
|
128
|
+
const n = new Image();
|
|
129
|
+
n.src = s, o.push(n);
|
|
100
130
|
}
|
|
101
|
-
t(this, l).set("loading", !0), t(this, l).set("error", !1), t(this, l).set("loaded", !1);
|
|
102
131
|
try {
|
|
103
132
|
yield Promise.all(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
133
|
+
o.map((n, h) => new Promise((m, M) => {
|
|
134
|
+
n.onload = () => {
|
|
135
|
+
m();
|
|
136
|
+
}, n.onerror = (H) => {
|
|
137
|
+
M(`${n.src} Image not found`);
|
|
109
138
|
};
|
|
110
139
|
}))
|
|
111
|
-
),
|
|
112
|
-
|
|
113
|
-
|
|
140
|
+
), p(this, l, o), e(this, d).call(this), (r = (t = this.consumerElement).onload) == null || r.call(t, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
|
|
141
|
+
"canvasRender",
|
|
142
|
+
e(this, w)
|
|
143
|
+
);
|
|
144
|
+
} catch (n) {
|
|
145
|
+
console.error(n), (i = (a = this.consumerElement).onerror) == null || i.call(a, new Event("error"));
|
|
114
146
|
}
|
|
115
|
-
t(this, l).set("loading", !1);
|
|
116
147
|
}
|
|
117
|
-
})), this.addEventListener("canvasRender", (s) => {
|
|
118
|
-
if (t(this, l).isFalse("loaded") || !t(this, _))
|
|
119
|
-
return;
|
|
120
|
-
s.detail.context.clearRect(0, 0, s.detail.width, s.detail.height);
|
|
121
|
-
const n = t(this, c)[t(this, b)];
|
|
122
|
-
n && s.detail.context.drawImage(n, ...t(this, _)), t(this, C).current && f(this, b, (t(this, b) + 1) % t(this, c).length);
|
|
123
148
|
});
|
|
124
149
|
}
|
|
125
|
-
setProgress(e) {
|
|
126
|
-
t(this, c).length && f(this, b, Math.floor((t(this, c).length - 1) * e));
|
|
127
|
-
}
|
|
128
|
-
connectedCallback() {
|
|
129
|
-
super.connectedCallback(), t(this, C).observe(), t(this, m).observe(), t(this, p).observe(), t(this, w).observe(), t(this, v).connect(), k.subscribe(this, t(this, d));
|
|
130
|
-
}
|
|
131
|
-
disconnectedCallback() {
|
|
132
|
-
super.disconnectedCallback(), t(this, C).unobserve(), t(this, m).unobserve(), t(this, p).unobserve(), t(this, w).unobserve(), f(this, c, []), t(this, l).reset(), t(this, v).disconnect(), k.unsubscribe(t(this, d));
|
|
133
|
-
}
|
|
134
150
|
};
|
|
135
|
-
v = /* @__PURE__ */ new WeakMap();
|
|
136
|
-
c = /* @__PURE__ */ new WeakMap();
|
|
137
|
-
m = /* @__PURE__ */ new WeakMap();
|
|
138
|
-
C = /* @__PURE__ */ new WeakMap();
|
|
139
|
-
p = /* @__PURE__ */ new WeakMap();
|
|
140
|
-
w = /* @__PURE__ */ new WeakMap();
|
|
141
151
|
l = /* @__PURE__ */ new WeakMap();
|
|
152
|
+
E = /* @__PURE__ */ new WeakMap();
|
|
153
|
+
S = /* @__PURE__ */ new WeakMap();
|
|
154
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
155
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
142
156
|
_ = /* @__PURE__ */ new WeakMap();
|
|
157
|
+
g = /* @__PURE__ */ new WeakMap();
|
|
143
158
|
b = /* @__PURE__ */ new WeakMap();
|
|
144
|
-
I = /* @__PURE__ */ new WeakMap();
|
|
145
159
|
d = /* @__PURE__ */ new WeakMap();
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
w = /* @__PURE__ */ new WeakMap();
|
|
161
|
+
P = q([
|
|
162
|
+
L("e-sequence")
|
|
163
|
+
], P);
|
|
149
164
|
export {
|
|
150
|
-
|
|
165
|
+
P as SequenceElement
|
|
151
166
|
};
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClassLinkedStatus } from '../class-linked-status';
|
|
2
2
|
import { CustomElement } from '../custom-element';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
src: string | null;
|
|
6
|
-
}
|
|
7
|
-
export declare abstract class SourceElement<T extends SourceConsumer> extends CustomElement {
|
|
4
|
+
export declare abstract class SourceElement<T extends HTMLElement> extends CustomElement {
|
|
8
5
|
#private;
|
|
9
6
|
constructor();
|
|
10
7
|
get consumerElement(): T;
|
|
11
|
-
get
|
|
12
|
-
|
|
8
|
+
get status(): ClassLinkedStatus<{
|
|
9
|
+
loading: false;
|
|
10
|
+
loaded: false;
|
|
11
|
+
error: false;
|
|
12
|
+
}>;
|
|
13
|
+
get isLazy(): boolean;
|
|
13
14
|
protected abstract createConsumer(): T;
|
|
14
15
|
protected abstract consumeSource(url: string | null): void;
|
|
15
16
|
protected connectedCallback(): void;
|
|
16
17
|
protected disconnectedCallback(): void;
|
|
17
18
|
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementEventMap {
|
|
21
|
+
sourceCapture: CustomEvent;
|
|
22
|
+
sourceRelase: CustomEvent;
|
|
23
|
+
}
|
|
24
|
+
}
|
package/lib/source/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var L=(i,r,t)=>{if(!r.has(i))throw TypeError("Cannot "+t)};var e=(i,r,t)=>(L(i,r,"read from private field"),t?t.call(i):r.get(i)),a=(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)},u=(i,r,t,n)=>(L(i,r,"write to private field"),n?n.call(i,t):r.set(i,t),t);var y=(i,r,t)=>(L(i,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../SourceManager-Bl_uduSS.cjs"),k=require("../custom-element/index.cjs"),C=require("../loading/index.cjs"),q=require("../class-linked-status/index.cjs"),x=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");let M=0;var h,s,c,f,l,d,o,m,S,w,b,p,E;class A extends k.CustomElement{constructor(){super();a(this,S);a(this,h,null);a(this,s,null);a(this,c,!1);a(this,f,!1);a(this,l,!1);a(this,d,"");a(this,o,new q.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1}));a(this,m,null);a(this,b,t=>{const n=t[0];e(this,l)&&!e(this,f)&&n.isIntersecting&&(e(this,h).current&&e(this,h).current!==e(this,h).previous&&y(this,S,w).call(this,e(this,h).current),u(this,f,!0)),n.isIntersecting?this.dispatchEvent(new CustomEvent("sourceCapture")):this.dispatchEvent(new CustomEvent("sourceRelease"))});a(this,p,()=>{e(this,o).set("loaded",!0),e(this,o).set("error",!1),e(this,o).set("loading",!1),!e(this,l)&&!e(this,c)&&C.loading.setLoaded(e(this,d),1),u(this,c,!0)});a(this,E,t=>{e(this,o).set("loaded",!1),e(this,o).set("error",!0),e(this,o).set("loading",!1),!e(this,l)&&!e(this,c)&&C.loading.setError(e(this,d),t),u(this,c,!0)});x.isBrowser&&(u(this,d,`source-consumer-${++M}`),u(this,m,new IntersectionObserver(e(this,b))))}get consumerElement(){return e(this,s)}get status(){return e(this,o)}get isLazy(){return e(this,l)}connectedCallback(){const t=this.getAttribute("srcset");t&&(u(this,s,this.createConsumer()),e(this,s).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,e(this,s).classList.add("source-consumer"),Array.from(this.attributes).forEach(
|
|
5
|
+
`,e(this,s).classList.add("source-consumer"),Array.from(this.attributes).forEach(n=>{if(n.name!=="srcset"){const g=n.nodeValue||"";n.name in e(this,s)&&(e(this,s)[n.name]=g||!0)}}),this.appendChild(e(this,s)),u(this,h,new v.SourceManager({srcset:t})),u(this,l,this.hasAttribute("lazy")),e(this,h).subscribe(n=>{(!e(this,l)||e(this,l)&&e(this,f))&&y(this,S,w).call(this,n.current)}),e(this,m).observe(this),e(this,h).connect())}disconnectedCallback(){e(this,m).disconnect(),e(this,h).close(),e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,e(this,s).remove(),e(this,o).reset()}}h=new WeakMap,s=new WeakMap,c=new WeakMap,f=new WeakMap,l=new WeakMap,d=new WeakMap,o=new WeakMap,m=new WeakMap,S=new WeakSet,w=function(t){if(e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,t){const n=this.hasAttribute("keep-source-parameters");e(this,o).set("loaded",!1),e(this,o).set("error",!1),e(this,o).set("loading",!0);const g=n?t.url:t.name+t.extension;this.consumeSource(g),!e(this,l)&&!e(this,c)&&C.loading.setTotal(e(this,d),1),e(this,s).onloadeddata=()=>{e(this,p).call(this)},e(this,s).onload=()=>{e(this,p).call(this)},e(this,s).onerror=()=>{e(this,E).call(this,g)}}else this.consumeSource(null)},b=new WeakMap,p=new WeakMap,E=new WeakMap;exports.Source=v.Source;exports.SourceManager=v.SourceManager;exports.SourceSet=v.SourceSet;exports.SourceElement=A;
|
package/lib/source/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Source } from './SourceClass';
|
|
2
|
-
export { SourceSet, type SourceSetMediaSources, type SourceSetMediaBucket } from './SourceSet';
|
|
2
|
+
export { SourceSet, type SourceSetMediaSources, type SourceSetMediaBucket, } from './SourceSet';
|
|
3
3
|
export { SourceManager, type SourceManagerSourceSet, type SourceManagerParameters, } from './SourceManager';
|
|
4
|
-
export { SourceElement
|
|
4
|
+
export { SourceElement } from './SourceElement';
|
package/lib/source/index.js
CHANGED
|
@@ -1,90 +1,100 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E = (i, r, s) => {
|
|
2
2
|
if (!r.has(i))
|
|
3
3
|
throw TypeError("Cannot " + s);
|
|
4
4
|
};
|
|
5
|
-
var t = (i, r, s) => (
|
|
5
|
+
var t = (i, r, s) => (E(i, r, "read from private field"), s ? s.call(i) : r.get(i)), h = (i, r, s) => {
|
|
6
6
|
if (r.has(i))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
r instanceof WeakSet ? r.add(i) : r.set(i, s);
|
|
9
|
-
},
|
|
10
|
-
var
|
|
11
|
-
import { S as
|
|
12
|
-
import { a as
|
|
13
|
-
import { CustomElement as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
}, u = (i, r, s, o) => (E(i, r, "write to private field"), o ? o.call(i, s) : r.set(i, s), s);
|
|
10
|
+
var C = (i, r, s) => (E(i, r, "access private method"), s);
|
|
11
|
+
import { S as y } from "../SourceManager-D_8MZ3bR.js";
|
|
12
|
+
import { a as V, b as $ } from "../SourceManager-D_8MZ3bR.js";
|
|
13
|
+
import { CustomElement as k } from "../custom-element/index.js";
|
|
14
|
+
import { loading as L } from "../loading/index.js";
|
|
15
|
+
import { ClassLinkedStatus as x } from "../class-linked-status/index.js";
|
|
16
|
+
import { i as A } from "../browser-0zX67oeU.js";
|
|
17
|
+
import "../path-data-polyfill-DgeDWYeI.js";
|
|
18
|
+
let z = 0;
|
|
19
|
+
var a, e, c, m, l, d, n, f, g, w, S, b, v;
|
|
20
|
+
class K extends k {
|
|
20
21
|
constructor() {
|
|
21
22
|
super();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
h(this, g);
|
|
24
|
+
h(this, a, null);
|
|
25
|
+
h(this, e, null);
|
|
26
|
+
h(this, c, !1);
|
|
27
|
+
h(this, m, !1);
|
|
28
|
+
h(this, l, !1);
|
|
29
|
+
h(this, d, "");
|
|
30
|
+
h(this, n, new x(this, {
|
|
31
|
+
loading: !1,
|
|
32
|
+
loaded: !1,
|
|
33
|
+
error: !1
|
|
34
|
+
}));
|
|
35
|
+
h(this, f, null);
|
|
36
|
+
h(this, S, (s) => {
|
|
37
|
+
const o = s[0];
|
|
38
|
+
t(this, l) && !t(this, m) && o.isIntersecting && (t(this, a).current && t(this, a).current !== t(this, a).previous && C(this, g, w).call(this, t(this, a).current), u(this, m, !0)), o.isIntersecting ? this.dispatchEvent(new CustomEvent("sourceCapture")) : this.dispatchEvent(new CustomEvent("sourceRelease"));
|
|
33
39
|
});
|
|
34
|
-
|
|
40
|
+
h(this, b, () => {
|
|
41
|
+
t(this, n).set("loaded", !0), t(this, n).set("error", !1), t(this, n).set("loading", !1), !t(this, l) && !t(this, c) && L.setLoaded(t(this, d), 1), u(this, c, !0);
|
|
42
|
+
});
|
|
43
|
+
h(this, v, (s) => {
|
|
44
|
+
t(this, n).set("loaded", !1), t(this, n).set("error", !0), t(this, n).set("loading", !1), !t(this, l) && !t(this, c) && L.setError(t(this, d), s), u(this, c, !0);
|
|
45
|
+
});
|
|
46
|
+
A && (u(this, d, `source-consumer-${++z}`), u(this, f, new IntersectionObserver(
|
|
47
|
+
t(this, S)
|
|
48
|
+
)));
|
|
35
49
|
}
|
|
36
50
|
get consumerElement() {
|
|
37
51
|
return t(this, e);
|
|
38
52
|
}
|
|
39
|
-
get
|
|
40
|
-
return t(this,
|
|
53
|
+
get status() {
|
|
54
|
+
return t(this, n);
|
|
41
55
|
}
|
|
42
|
-
get
|
|
43
|
-
return t(this,
|
|
56
|
+
get isLazy() {
|
|
57
|
+
return t(this, l);
|
|
44
58
|
}
|
|
45
59
|
connectedCallback() {
|
|
46
60
|
const s = this.getAttribute("srcset");
|
|
47
|
-
s && (
|
|
61
|
+
s && (u(this, e, this.createConsumer()), t(this, e).style.cssText = `
|
|
48
62
|
display: block;
|
|
49
63
|
width: 100%;
|
|
50
64
|
height: 100%;
|
|
51
|
-
`, t(this, e).classList.add("source-consumer"), Array.from(this.attributes).forEach((
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
t(this, e)
|
|
65
|
+
`, t(this, e).classList.add("source-consumer"), Array.from(this.attributes).forEach((o) => {
|
|
66
|
+
if (o.name !== "srcset") {
|
|
67
|
+
const p = o.nodeValue || "";
|
|
68
|
+
o.name in t(this, e) && (t(this, e)[o.name] = p || !0);
|
|
55
69
|
}
|
|
56
|
-
}), this.appendChild(t(this, e)),
|
|
70
|
+
}), this.appendChild(t(this, e)), u(this, a, new y({
|
|
57
71
|
srcset: s
|
|
58
|
-
})),
|
|
59
|
-
(!t(this,
|
|
60
|
-
}),
|
|
72
|
+
})), u(this, l, this.hasAttribute("lazy")), t(this, a).subscribe((o) => {
|
|
73
|
+
(!t(this, l) || t(this, l) && t(this, m)) && C(this, g, w).call(this, o.current);
|
|
74
|
+
}), t(this, f).observe(this), t(this, a).connect());
|
|
61
75
|
}
|
|
62
76
|
disconnectedCallback() {
|
|
63
|
-
|
|
77
|
+
t(this, f).disconnect(), t(this, a).close(), t(this, e).onloadeddata = null, t(this, e).onload = null, t(this, e).onerror = null, t(this, e).remove(), t(this, n).reset();
|
|
64
78
|
}
|
|
65
79
|
}
|
|
66
|
-
|
|
80
|
+
a = new WeakMap(), e = new WeakMap(), c = new WeakMap(), m = new WeakMap(), l = new WeakMap(), d = new WeakMap(), n = new WeakMap(), f = new WeakMap(), g = new WeakSet(), w = function(s) {
|
|
67
81
|
if (t(this, e).onloadeddata = null, t(this, e).onload = null, t(this, e).onerror = null, s) {
|
|
68
|
-
const
|
|
69
|
-
this.
|
|
70
|
-
const
|
|
71
|
-
this.consumeSource(
|
|
72
|
-
|
|
73
|
-
this.classList.remove("error"), this.classList.remove("loading"), this.classList.add("loaded"), !t(this, a) && !t(this, c) && S.setLoaded(t(this, u), 1), l(this, c, !0);
|
|
74
|
-
}, C = () => {
|
|
75
|
-
this.classList.remove("loading"), this.classList.add("error"), !t(this, a) && !t(this, c) && S.setError(t(this, u), b), l(this, c, !0);
|
|
76
|
-
};
|
|
77
|
-
!t(this, a) && !t(this, c) && S.setTotal(t(this, u), 1), t(this, e).onloadeddata = () => {
|
|
78
|
-
d();
|
|
82
|
+
const o = this.hasAttribute("keep-source-parameters");
|
|
83
|
+
t(this, n).set("loaded", !1), t(this, n).set("error", !1), t(this, n).set("loading", !0);
|
|
84
|
+
const p = o ? s.url : s.name + s.extension;
|
|
85
|
+
this.consumeSource(p), !t(this, l) && !t(this, c) && L.setTotal(t(this, d), 1), t(this, e).onloadeddata = () => {
|
|
86
|
+
t(this, b).call(this);
|
|
79
87
|
}, t(this, e).onload = () => {
|
|
80
|
-
|
|
81
|
-
}, t(this, e).onerror =
|
|
88
|
+
t(this, b).call(this);
|
|
89
|
+
}, t(this, e).onerror = () => {
|
|
90
|
+
t(this, v).call(this, p);
|
|
91
|
+
};
|
|
82
92
|
} else
|
|
83
93
|
this.consumeSource(null);
|
|
84
|
-
},
|
|
94
|
+
}, S = new WeakMap(), b = new WeakMap(), v = new WeakMap();
|
|
85
95
|
export {
|
|
86
|
-
|
|
96
|
+
V as Source,
|
|
87
97
|
K as SourceElement,
|
|
88
|
-
|
|
98
|
+
y as SourceManager,
|
|
89
99
|
$ as SourceSet
|
|
90
100
|
};
|
package/lib/theme/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-BQGNOHlY.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-BQGNOHlY.cjs");const t=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const r=require("../tags-CueX-JLX.cjs"),i=require("../createTheme-BSreUYge.cjs"),e=i.createTheme({colorDark:"#1c1c1c",colorDarkAux:"#282828",colorLight:"#ffffff",colorActive:"#00E5B0",tweakerWidth:"500px",tweakerOffset:"20px",tweakerFolderHeight:"40px",timelineWidth:"50vw",timelineHeight:"30vh",timelineOffset:"20px",heightInput:"30px",borderRadius:"12px",borderRadiusSmall:"4px",gapLarge:"16px",gapMedium:"12px",gapSmall:"8px",gapExtraSmall:"4px",fontSizeLarge:"20px",fontSizeMedium:"16px",fontSizeSmall:"14px",durationShort:"0.2s"},{prefix:"aptechka-"});t.isBrowser&&document.head.appendChild(r.style({":root":e.style}).node);exports.aptechkaTheme=e;
|
package/lib/theme/index.d.ts
CHANGED
|
@@ -31,6 +31,18 @@ export declare const aptechkaTheme: {
|
|
|
31
31
|
var: "var(--aptechka-tweaker-folder-height)";
|
|
32
32
|
value: "40px";
|
|
33
33
|
};
|
|
34
|
+
timelineWidth: {
|
|
35
|
+
var: "var(--aptechka-timeline-width)";
|
|
36
|
+
value: "50vw";
|
|
37
|
+
};
|
|
38
|
+
timelineHeight: {
|
|
39
|
+
var: "var(--aptechka-timeline-height)";
|
|
40
|
+
value: "30vh";
|
|
41
|
+
};
|
|
42
|
+
timelineOffset: {
|
|
43
|
+
var: "var(--aptechka-timeline-offset)";
|
|
44
|
+
value: "20px";
|
|
45
|
+
};
|
|
34
46
|
heightInput: {
|
|
35
47
|
var: "var(--aptechka-height-input)";
|
|
36
48
|
value: "30px";
|
|
@@ -81,6 +93,9 @@ export declare const aptechkaTheme: {
|
|
|
81
93
|
"--aptechka-tweaker-width": string;
|
|
82
94
|
"--aptechka-tweaker-offset": string;
|
|
83
95
|
"--aptechka-tweaker-folder-height": string;
|
|
96
|
+
"--aptechka-timeline-width": string;
|
|
97
|
+
"--aptechka-timeline-height": string;
|
|
98
|
+
"--aptechka-timeline-offset": string;
|
|
84
99
|
"--aptechka-height-input": string;
|
|
85
100
|
"--aptechka-border-radius-small": string;
|
|
86
101
|
"--aptechka-gap-large": string;
|