aptechka 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Tweened-CDYmG9hk.js +138 -0
- package/lib/Tweened-DlyMbHu_.cjs +1 -0
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +53 -6
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +29 -27
- package/lib/need_redo_tweaker/index.cjs +3 -3
- package/lib/need_redo_tweaker/index.js +1 -2
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +14 -18
- package/lib/order/index.js +1 -1
- package/lib/polyfills-AItxku8u.js +76 -0
- package/lib/polyfills-Caa6z-Ay.cjs +1 -0
- package/lib/source/index.cjs +1 -5
- package/lib/source/index.d.ts +0 -1
- package/lib/source/index.js +67 -152
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +213 -154
- package/package.json +1 -41
- package/lib/Animation-DI864E0i.cjs +0 -1
- package/lib/Animation-w6BLTCum.js +0 -105
- package/lib/Damped-DEHDEq-b.js +0 -53
- package/lib/Damped-ipnDc0iX.cjs +0 -1
- package/lib/Tweened-B1TfANfR.cjs +0 -1
- package/lib/Tweened-C52xXDLY.js +0 -44
- package/lib/canvas/index.cjs +0 -1
- package/lib/canvas/index.d.ts +0 -34
- package/lib/canvas/index.js +0 -108
- package/lib/canvas-CU5Xjahf.cjs +0 -1
- package/lib/canvas-DeZ0SLUJ.js +0 -34
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/image/index.cjs +0 -1
- package/lib/image/index.d.ts +0 -10
- package/lib/image/index.js +0 -15
- package/lib/jss-CjccJC-K.js +0 -21
- package/lib/jss-GJLvaNfT.cjs +0 -1
- package/lib/math-BOBiC4TN.js +0 -45
- package/lib/math-GDWEqu7y.cjs +0 -1
- package/lib/pointer/Pointer.d.ts +0 -22
- package/lib/pointer/PointerElement.d.ts +0 -13
- package/lib/pointer/index.cjs +0 -1
- package/lib/pointer/index.d.ts +0 -2
- package/lib/pointer/index.js +0 -151
- package/lib/polyfills-CM4SCDTt.cjs +0 -1
- package/lib/polyfills-X6KXuHg-.js +0 -33
- package/lib/sequence/index.cjs +0 -1
- package/lib/sequence/index.d.ts +0 -20
- package/lib/sequence/index.js +0 -158
- package/lib/source/SourceElement.d.ts +0 -24
- package/lib/test/starting-style/index.d.ts +0 -1
- package/lib/video/index.cjs +0 -1
- package/lib/video/index.d.ts +0 -21
- package/lib/video/index.js +0 -55
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const i = [
|
|
2
|
-
1,
|
|
3
|
-
10,
|
|
4
|
-
100,
|
|
5
|
-
1e3,
|
|
6
|
-
1e4,
|
|
7
|
-
1e5,
|
|
8
|
-
1e6,
|
|
9
|
-
1e7,
|
|
10
|
-
1e8,
|
|
11
|
-
1e9,
|
|
12
|
-
1e10
|
|
13
|
-
];
|
|
14
|
-
function o(e, n = 5) {
|
|
15
|
-
return Math.round(e * i[n]) / i[n];
|
|
16
|
-
}
|
|
17
|
-
function u(e, n) {
|
|
18
|
-
return Math.round(e / n) * n;
|
|
19
|
-
}
|
|
20
|
-
function s(e, n) {
|
|
21
|
-
var r;
|
|
22
|
-
const t = ((r = n.toString().split(".")[1]) == null ? void 0 : r.length) || 0;
|
|
23
|
-
return t ? +e.toFixed(t) : Math.ceil(e);
|
|
24
|
-
}
|
|
25
|
-
function c(e, n) {
|
|
26
|
-
return typeof e == "undefined" ? n : e;
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
c as n,
|
|
30
|
-
o as p,
|
|
31
|
-
u as r,
|
|
32
|
-
s as t
|
|
33
|
-
};
|
package/lib/sequence/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var x=s=>{throw TypeError(s)};var I=(s,n,e)=>n.has(s)||x("Cannot "+e);var t=(s,n,e)=>(I(s,n,"read from private field"),e?e.call(s):n.get(s)),c=(s,n,e)=>n.has(s)?x("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,e),l=(s,n,e,i)=>(I(s,n,"write to private field"),i?i.call(s,e):n.set(s,e),e);var L=(s,n,e)=>new Promise((i,f)=>{var w=o=>{try{u(e.next(o))}catch(r){f(r)}},y=o=>{try{u(e.throw(o))}catch(r){f(r)}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(w,y);u((e=e.apply(s,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("../canvas/index.cjs"),P=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs");require("../window-resizer/index.cjs");require("../Store-CDb6RMce.cjs");const H=require("../browser-CpzFX2xg.cjs"),z=require("../canvas-CU5Xjahf.cjs"),M=require("../source/index.cjs");function W(s){const n=s.match(/\{([\d-]+)\}/);if(n){const e=n[1].split("-");if(e.length===2){const i=parseInt(e[0],10),f=parseInt(e[1],10);return{start:i,end:f}}}return null}var h,b,S,m,d,g,E,p,a,v;class k extends M.SourceElement{constructor(e){super();c(this,h,[]);c(this,b,new P.CSSProperty(this,"--fit","contain"));c(this,S,new P.CSSProperty(this,"--autoplay",!1));c(this,m,new P.CSSProperty(this,"--offset-x",.5));c(this,d,new P.CSSProperty(this,"--offset-y",.5));c(this,g,null);c(this,E,0);c(this,p,1);c(this,a,()=>{if(t(this,h).length){const e=t(this,h)[0];t(this,b).current==="cover"?l(this,g,z.cover(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current)):l(this,g,z.contain(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current))}});c(this,v,e=>{if(this.status.isFalse("loaded")||!t(this,g))return;e.detail.context.clearRect(0,0,e.detail.width,e.detail.height);const i=t(this,h)[t(this,E)];i&&e.detail.context.drawImage(i,...t(this,g)),t(this,S).current&&l(this,E,(t(this,E)+1)%t(this,h).length)});H.isBrowser&&(l(this,p,parseInt(((e==null?void 0:e.pad)||this.getAttribute("pad")||"1").toString())),t(this,b).subscribe(t(this,a)),t(this,m).subscribe(t(this,a)),t(this,d).subscribe(t(this,a)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",t(this,v))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",t(this,v))}))}setProgress(e){t(this,h).length&&l(this,E,Math.floor((t(this,h).length-1)*e))}connectedCallback(){super.connectedCallback(),t(this,S).observe(),t(this,b).observe(),t(this,m).observe(),t(this,d).observe(),R.elementResizer.subscribe(this,t(this,a))}disconnectedCallback(){super.disconnectedCallback(),t(this,S).unobserve(),t(this,b).unobserve(),t(this,m).unobserve(),t(this,d).unobserve(),l(this,h,[]),R.elementResizer.unsubscribe(t(this,a)),this.consumerElement.removeEventListener("canvasRender",t(this,v))}createConsumer(){return new B.CanvasElement}consumeSource(e){return L(this,null,function*(){var i,f,w,y;if(e){this.consumerElement.removeEventListener("canvasRender",t(this,v));const u=[],o=W(e);if(o)for(let r=o.start;r<=o.end;r++){const q=e.replace(/\{([^}]+)\}/,r.toString().padStart(t(this,p),"0")),C=new Image;C.src=q,u.push(C)}else{const r=new Image;r.src=e,u.push(r)}try{yield Promise.all(u.map((r,q)=>new Promise((C,_)=>{r.onload=()=>{C()},r.onerror=j=>{_(`${r.src} Image not found`)}}))),l(this,h,u),t(this,a).call(this),(f=(i=this.consumerElement).onload)==null||f.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",t(this,v))}catch(r){console.error(r),(y=(w=this.consumerElement).onerror)==null||y.call(w,new Event("error"))}}})}}h=new WeakMap,b=new WeakMap,S=new WeakMap,m=new WeakMap,d=new WeakMap,g=new WeakMap,E=new WeakMap,p=new WeakMap,a=new WeakMap,v=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",k);exports.SequenceElement=k;
|
package/lib/sequence/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CanvasElement } from '../canvas';
|
|
2
|
-
import { SourceElement, SourceManagerSourceSet } from '../source';
|
|
3
|
-
export interface SequenceElementParameters {
|
|
4
|
-
srcset: SourceManagerSourceSet;
|
|
5
|
-
pad?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class SequenceElement extends SourceElement<CanvasElement> {
|
|
8
|
-
#private;
|
|
9
|
-
constructor(parameters?: SequenceElementParameters);
|
|
10
|
-
setProgress(value: number): void;
|
|
11
|
-
protected connectedCallback(): void;
|
|
12
|
-
protected disconnectedCallback(): void;
|
|
13
|
-
protected createConsumer(): CanvasElement;
|
|
14
|
-
protected consumeSource(url: string | null): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
declare global {
|
|
17
|
-
interface HTMLElementTagNameMap {
|
|
18
|
-
'e-sequence': SequenceElement;
|
|
19
|
-
}
|
|
20
|
-
}
|
package/lib/sequence/index.js
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
var x = (s) => {
|
|
2
|
-
throw TypeError(s);
|
|
3
|
-
};
|
|
4
|
-
var P = (s, n, e) => n.has(s) || x("Cannot " + e);
|
|
5
|
-
var t = (s, n, e) => (P(s, n, "read from private field"), e ? e.call(s) : n.get(s)), h = (s, n, e) => n.has(s) ? x("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(s) : n.set(s, e), u = (s, n, e, i) => (P(s, n, "write to private field"), i ? i.call(s, e) : n.set(s, e), e);
|
|
6
|
-
var R = (s, n, e) => new Promise((i, p) => {
|
|
7
|
-
var S = (o) => {
|
|
8
|
-
try {
|
|
9
|
-
m(e.next(o));
|
|
10
|
-
} catch (r) {
|
|
11
|
-
p(r);
|
|
12
|
-
}
|
|
13
|
-
}, C = (o) => {
|
|
14
|
-
try {
|
|
15
|
-
m(e.throw(o));
|
|
16
|
-
} catch (r) {
|
|
17
|
-
p(r);
|
|
18
|
-
}
|
|
19
|
-
}, m = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(S, C);
|
|
20
|
-
m((e = e.apply(s, n)).next());
|
|
21
|
-
});
|
|
22
|
-
import { CanvasElement as z } from "../canvas/index.js";
|
|
23
|
-
import { CSSProperty as I } from "../css-property/index.js";
|
|
24
|
-
import { elementResizer as k } from "../element-resizer/index.js";
|
|
25
|
-
import "../window-resizer/index.js";
|
|
26
|
-
import "../Store-OTdcl6SX.js";
|
|
27
|
-
import { i as B } from "../browser-0zX67oeU.js";
|
|
28
|
-
import { c as H, a as W } from "../canvas-DeZ0SLUJ.js";
|
|
29
|
-
import { SourceElement as A } from "../source/index.js";
|
|
30
|
-
function D(s) {
|
|
31
|
-
const n = s.match(/\{([\d-]+)\}/);
|
|
32
|
-
if (n) {
|
|
33
|
-
const e = n[1].split("-");
|
|
34
|
-
if (e.length === 2) {
|
|
35
|
-
const i = parseInt(e[0], 10), p = parseInt(e[1], 10);
|
|
36
|
-
return { start: i, end: p };
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
var c, v, g, l, d, E, b, w, a, f;
|
|
42
|
-
class F extends A {
|
|
43
|
-
constructor(e) {
|
|
44
|
-
super();
|
|
45
|
-
h(this, c, []);
|
|
46
|
-
h(this, v, new I(
|
|
47
|
-
this,
|
|
48
|
-
"--fit",
|
|
49
|
-
"contain"
|
|
50
|
-
));
|
|
51
|
-
h(this, g, new I(this, "--autoplay", !1));
|
|
52
|
-
h(this, l, new I(this, "--offset-x", 0.5));
|
|
53
|
-
h(this, d, new I(this, "--offset-y", 0.5));
|
|
54
|
-
h(this, E, null);
|
|
55
|
-
h(this, b, 0);
|
|
56
|
-
h(this, w, 1);
|
|
57
|
-
h(this, a, () => {
|
|
58
|
-
if (t(this, c).length) {
|
|
59
|
-
const e = t(this, c)[0];
|
|
60
|
-
t(this, v).current === "cover" ? u(this, E, H(
|
|
61
|
-
e.naturalWidth,
|
|
62
|
-
e.naturalHeight,
|
|
63
|
-
this.consumerElement.width,
|
|
64
|
-
this.consumerElement.height,
|
|
65
|
-
t(this, l).current,
|
|
66
|
-
t(this, d).current
|
|
67
|
-
)) : u(this, E, W(
|
|
68
|
-
e.naturalWidth,
|
|
69
|
-
e.naturalHeight,
|
|
70
|
-
this.consumerElement.width,
|
|
71
|
-
this.consumerElement.height,
|
|
72
|
-
t(this, l).current,
|
|
73
|
-
t(this, d).current
|
|
74
|
-
));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
h(this, f, (e) => {
|
|
78
|
-
if (this.status.isFalse("loaded") || !t(this, E))
|
|
79
|
-
return;
|
|
80
|
-
e.detail.context.clearRect(0, 0, e.detail.width, e.detail.height);
|
|
81
|
-
const i = t(this, c)[t(this, b)];
|
|
82
|
-
i && e.detail.context.drawImage(i, ...t(this, E)), t(this, g).current && u(this, b, (t(this, b) + 1) % t(this, c).length);
|
|
83
|
-
});
|
|
84
|
-
B && (u(this, w, parseInt(
|
|
85
|
-
((e == null ? void 0 : e.pad) || this.getAttribute("pad") || "1").toString()
|
|
86
|
-
)), t(this, v).subscribe(t(this, a)), t(this, l).subscribe(t(this, a)), t(this, d).subscribe(t(this, a)), this.addEventListener("sourceCapture", (i) => {
|
|
87
|
-
this.consumerElement.addEventListener(
|
|
88
|
-
"canvasRender",
|
|
89
|
-
t(this, f)
|
|
90
|
-
);
|
|
91
|
-
}), this.addEventListener("sourceRelease", (i) => {
|
|
92
|
-
this.consumerElement.removeEventListener(
|
|
93
|
-
"canvasRender",
|
|
94
|
-
t(this, f)
|
|
95
|
-
);
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
setProgress(e) {
|
|
99
|
-
t(this, c).length && u(this, b, Math.floor((t(this, c).length - 1) * e));
|
|
100
|
-
}
|
|
101
|
-
connectedCallback() {
|
|
102
|
-
super.connectedCallback(), t(this, g).observe(), t(this, v).observe(), t(this, l).observe(), t(this, d).observe(), k.subscribe(this, t(this, a));
|
|
103
|
-
}
|
|
104
|
-
disconnectedCallback() {
|
|
105
|
-
super.disconnectedCallback(), t(this, g).unobserve(), t(this, v).unobserve(), t(this, l).unobserve(), t(this, d).unobserve(), u(this, c, []), k.unsubscribe(t(this, a)), this.consumerElement.removeEventListener(
|
|
106
|
-
"canvasRender",
|
|
107
|
-
t(this, f)
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
createConsumer() {
|
|
111
|
-
return new z();
|
|
112
|
-
}
|
|
113
|
-
consumeSource(e) {
|
|
114
|
-
return R(this, null, function* () {
|
|
115
|
-
var i, p, S, C;
|
|
116
|
-
if (e) {
|
|
117
|
-
this.consumerElement.removeEventListener(
|
|
118
|
-
"canvasRender",
|
|
119
|
-
t(this, f)
|
|
120
|
-
);
|
|
121
|
-
const m = [], o = D(e);
|
|
122
|
-
if (o)
|
|
123
|
-
for (let r = o.start; r <= o.end; r++) {
|
|
124
|
-
const L = e.replace(
|
|
125
|
-
/\{([^}]+)\}/,
|
|
126
|
-
r.toString().padStart(t(this, w), "0")
|
|
127
|
-
), y = new Image();
|
|
128
|
-
y.src = L, m.push(y);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
const r = new Image();
|
|
132
|
-
r.src = e, m.push(r);
|
|
133
|
-
}
|
|
134
|
-
try {
|
|
135
|
-
yield Promise.all(
|
|
136
|
-
m.map((r, L) => new Promise((y, q) => {
|
|
137
|
-
r.onload = () => {
|
|
138
|
-
y();
|
|
139
|
-
}, r.onerror = (M) => {
|
|
140
|
-
q(`${r.src} Image not found`);
|
|
141
|
-
};
|
|
142
|
-
}))
|
|
143
|
-
), u(this, c, m), t(this, a).call(this), (p = (i = this.consumerElement).onload) == null || p.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
|
|
144
|
-
"canvasRender",
|
|
145
|
-
t(this, f)
|
|
146
|
-
);
|
|
147
|
-
} catch (r) {
|
|
148
|
-
console.error(r), (C = (S = this.consumerElement).onerror) == null || C.call(S, new Event("error"));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
c = new WeakMap(), v = new WeakMap(), g = new WeakMap(), l = new WeakMap(), d = new WeakMap(), E = new WeakMap(), b = new WeakMap(), w = new WeakMap(), a = new WeakMap(), f = new WeakMap();
|
|
155
|
-
customElements.get("e-sequence") || customElements.define("e-sequence", F);
|
|
156
|
-
export {
|
|
157
|
-
F as SequenceElement
|
|
158
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SourceManager } from './SourceManager';
|
|
2
|
-
import { ClassLinkedStatus } from '../class-linked-status';
|
|
3
|
-
export declare abstract class SourceElement<T extends HTMLElement> extends HTMLElement {
|
|
4
|
-
#private;
|
|
5
|
-
constructor();
|
|
6
|
-
get consumerElement(): T;
|
|
7
|
-
get sourceManager(): SourceManager;
|
|
8
|
-
get status(): ClassLinkedStatus<{
|
|
9
|
-
loading: false;
|
|
10
|
-
loaded: false;
|
|
11
|
-
error: false;
|
|
12
|
-
}>;
|
|
13
|
-
get isLazy(): boolean;
|
|
14
|
-
protected abstract createConsumer(): T;
|
|
15
|
-
protected abstract consumeSource(url: string | null): void;
|
|
16
|
-
protected connectedCallback(): void;
|
|
17
|
-
protected disconnectedCallback(): void;
|
|
18
|
-
}
|
|
19
|
-
declare global {
|
|
20
|
-
interface HTMLElementEventMap {
|
|
21
|
-
sourceCapture: CustomEvent;
|
|
22
|
-
sourceRelase: CustomEvent;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/video/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var l=e=>{throw TypeError(e)};var d=(e,s,t)=>s.has(e)||l("Cannot "+t);var i=(e,s,t)=>(d(e,s,"read from private field"),t?t.call(e):s.get(e)),n=(e,s,t)=>s.has(e)?l("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,o)=>(d(e,s,"write to private field"),o?o.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-CDb6RMce.cjs");const m=require("../source/index.cjs"),u=require("../ticker/index.cjs");var r,a;class h extends m.SourceElement{constructor(){super(...arguments);n(this,r,0);n(this,a,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>i(this,r)&&c(this,r,t),this.dispatchEvent(new CustomEvent("readyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}})),this.consumerElement.readyState===4&&u.ticker.unsubscribe(i(this,a))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{u.ticker.subscribe(i(this,a)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),u.ticker.unsubscribe(i(this,a)),c(this,r,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||""}}r=new WeakMap,a=new WeakMap;customElements.get("e-video")||customElements.define("e-video",h);exports.VideoElement=h;
|
package/lib/video/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SourceElement } from '../source';
|
|
2
|
-
export interface ReadyStateChangeEventDetail {
|
|
3
|
-
readyState: number;
|
|
4
|
-
progress: number;
|
|
5
|
-
}
|
|
6
|
-
export type ReadyStateChangeEvent = CustomEvent<ReadyStateChangeEventDetail>;
|
|
7
|
-
export declare class VideoElement extends SourceElement<HTMLVideoElement> {
|
|
8
|
-
#private;
|
|
9
|
-
protected connectedCallback(): void;
|
|
10
|
-
protected disconnectedCallback(): void;
|
|
11
|
-
protected createConsumer(): HTMLVideoElement;
|
|
12
|
-
protected consumeSource(url: string | null): void;
|
|
13
|
-
}
|
|
14
|
-
declare global {
|
|
15
|
-
interface HTMLElementTagNameMap {
|
|
16
|
-
'e-video': VideoElement;
|
|
17
|
-
}
|
|
18
|
-
interface HTMLElementEventMap {
|
|
19
|
-
readyStateChange: ReadyStateChangeEvent;
|
|
20
|
-
}
|
|
21
|
-
}
|
package/lib/video/index.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var m = (e) => {
|
|
2
|
-
throw TypeError(e);
|
|
3
|
-
};
|
|
4
|
-
var h = (e, s, t) => s.has(e) || m("Cannot " + t);
|
|
5
|
-
var i = (e, s, t) => (h(e, s, "read from private field"), t ? t.call(e) : s.get(e)), n = (e, s, t) => s.has(e) ? m("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), c = (e, s, t, u) => (h(e, s, "write to private field"), u ? u.call(e, t) : s.set(e, t), t);
|
|
6
|
-
import "../window-resizer/index.js";
|
|
7
|
-
import "../Store-OTdcl6SX.js";
|
|
8
|
-
import { SourceElement as l } from "../source/index.js";
|
|
9
|
-
import { ticker as o } from "../ticker/index.js";
|
|
10
|
-
var r, a;
|
|
11
|
-
class d extends l {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
n(this, r, 0);
|
|
15
|
-
n(this, a, () => {
|
|
16
|
-
this.classList.add(`state-${this.consumerElement.readyState}`);
|
|
17
|
-
const t = this.consumerElement.readyState / 4;
|
|
18
|
-
t > i(this, r) && c(this, r, t), this.dispatchEvent(
|
|
19
|
-
new CustomEvent("readyStateChange", {
|
|
20
|
-
detail: {
|
|
21
|
-
readyState: this.consumerElement.readyState,
|
|
22
|
-
progress: i(this, r)
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
), this.consumerElement.readyState === 4 && o.unsubscribe(i(this, a));
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
connectedCallback() {
|
|
29
|
-
super.connectedCallback(), this.addEventListener("sourceCapture", () => {
|
|
30
|
-
o.subscribe(i(this, a)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
|
|
31
|
-
}), this.addEventListener("sourceRelease", () => {
|
|
32
|
-
this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
|
|
33
|
-
"state-0",
|
|
34
|
-
"state-1",
|
|
35
|
-
"state-2",
|
|
36
|
-
"state-3",
|
|
37
|
-
"state-4"
|
|
38
|
-
);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
disconnectedCallback() {
|
|
42
|
-
super.disconnectedCallback(), o.unsubscribe(i(this, a)), c(this, r, 0);
|
|
43
|
-
}
|
|
44
|
-
createConsumer() {
|
|
45
|
-
return document.createElement("video");
|
|
46
|
-
}
|
|
47
|
-
consumeSource(t) {
|
|
48
|
-
this.consumerElement.src = t || "";
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
r = new WeakMap(), a = new WeakMap();
|
|
52
|
-
customElements.get("e-video") || customElements.define("e-video", d);
|
|
53
|
-
export {
|
|
54
|
-
d as VideoElement
|
|
55
|
-
};
|