aptechka 0.66.1 → 0.66.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/pointer/Pointer.d.ts +1 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +83 -80
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +12 -12
- package/package.json +1 -1
package/lib/pointer/Pointer.d.ts
CHANGED
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var I=Object.defineProperty;var B=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var j=i=>{throw TypeError(i)};var W=(i,s,t)=>s in i?I(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,O=(i,s)=>{for(var t in s||(s={}))J.call(s,t)&&W(i,t,s[t]);if(B)for(var t of B(s))K.call(s,t)&&W(i,t,s[t]);return i};var _=(i,s,t)=>s.has(i)||j("Cannot "+t);var e=(i,s,t)=>(_(i,s,"read from private field"),t?t.call(i):s.get(i)),r=(i,s,t)=>s.has(i)?j("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),h=(i,s,t,l)=>(_(i,s,"write to private field"),l?l.call(i,t):s.set(i,t),t),H=(i,s,t)=>(_(i,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-Cd1GlEmZ.cjs");const M=require("../coordinates-D8Np3cPD.cjs"),N=require("../dom-JBOkFLTh.cjs"),X=require("../math-GDWEqu7y.cjs");require("construct-style-sheets-polyfill");const Q=require("../index-DekP7OZe.cjs");require("../ticker/index.cjs");const T=require("../Damped-z9Uaw2MJ.cjs"),Y=require("../element-resizer/index.cjs"),A=require("../window-resizer/index.cjs"),C=require("../css-property/index.cjs");var c,u,a,f,m,d,g,y,p,S,z,E,q,b,L,k;class F{constructor(s){r(this,L);r(this,c);r(this,u);r(this,a);r(this,f);r(this,m);r(this,d);r(this,g,!1);r(this,y,0);r(this,p,0);r(this,S,!1);r(this,z,s=>{h(this,S,!0);const t=H(this,L,k).call(this,s);e(this,u).set(t.x,{equalize:!0}),e(this,a).set(t.y,{equalize:!0}),e(this,f).set(1)});r(this,E,s=>{h(this,S,!1),e(this,f).set(0)});r(this,q,s=>{e(this,S)||e(this,z).call(this,s);const t=H(this,L,k).call(this,s);e(this,u).set(t.x),e(this,a).set(t.y)});r(this,b,()=>{e(this,g)?(h(this,y,document.documentElement.clientWidth),h(this,p,innerHeight)):(h(this,y,this.element.clientWidth),h(this,p,this.element.clientHeight));let s=0,t=0,l=0,o=0;e(this,m)?e(this,d)?(s=-1,t=1,l=-1,o=1):(s=e(this,y)/2*-1,t=e(this,y)/2*1,l=e(this,p)/2*-1,o=e(this,p)/2*1):e(this,d)?(s=0,t=1,l=0,o=1):(s=0,t=e(this,y),l=0,o=e(this,p)),e(this,u).min=s,e(this,u).max=t,e(this,a).min=l,e(this,a).max=o});h(this,c,N.getElement(s.element)),h(this,u,new T.Damped(0,s.damped)),h(this,a,new T.Damped(0,s.damped)),h(this,f,new T.Damped(0,O({min:0,max:1},s.damped))),h(this,m,s.cartesian||!1),h(this,d,s.normalize||!1),h(this,g,s.fullScreen||!1)}get element(){return e(this,c)}get x(){return e(this,u)}get y(){return e(this,a)}get z(){return e(this,f)}get cartesian(){return e(this,m)}set cartesian(s){h(this,m,s),e(this,b).call(this)}get normalize(){return e(this,d)}set normalize(s){h(this,d,s),e(this,b).call(this)}connect(){e(this,c).addEventListener("pointerenter",e(this,z)),e(this,c).addEventListener("pointerleave",e(this,E)),e(this,c).addEventListener("pointermove",e(this,q)),Y.elementResizer.subscribe(e(this,c),e(this,b)),A.windowResizer.subscribe(e(this,b))}disconnect(){e(this,c).removeEventListener("pointerenter",e(this,z)),e(this,c).removeEventListener("pointerleave",e(this,E)),e(this,c).removeEventListener("pointermove",e(this,q)),Y.elementResizer.unsubscribe(e(this,b)),A.windowResizer.unsubscribe(e(this,b)),e(this,u).reset(),e(this,a).reset(),e(this,f).reset()}}c=new WeakMap,u=new WeakMap,a=new WeakMap,f=new WeakMap,m=new WeakMap,d=new WeakMap,g=new WeakMap,y=new WeakMap,p=new WeakMap,S=new WeakMap,z=new WeakMap,E=new WeakMap,q=new WeakMap,b=new WeakMap,L=new WeakSet,k=function(s){let t=null;e(this,g)?t={x:s.clientX,y:s.clientY}:t=M.getPointerPosition(s,e(this,c).getBoundingClientRect());const l={width:e(this,y),height:e(this,p)},o={x:t.x,y:t.y};if(e(this,m)){const x=M.screenToCartesian(o,l);o.x=x.x,o.y=x.y}if(e(this,d)){const x=M.normalize(o,l);e(this,m)?(o.x=X.clamp(x.x*2,-1,1),o.y=X.clamp(x.y*2,-1,1)):(o.x=x.x,o.y=x.y)}return o};var n,P,v,w,R,D;class G extends HTMLElement{constructor(){super();r(this,n);r(this,P,new C.CSSProperty(this,"--damping",20));r(this,v,new C.CSSProperty(this,"--mass",0));r(this,w,new C.CSSProperty(this,"--stiffness",0));r(this,R,new C.CSSProperty(this,"--cartesian",!1));r(this,D,new C.CSSProperty(this,"--normalize",!1));h(this,n,new F({element:this})),e(this,P).subscribe(t=>{e(this,n).x.damping=t.current,e(this,n).y.damping=t.current,e(this,n).z.damping=t.current}),e(this,R).subscribe(t=>{e(this,n).cartesian=t.current}),e(this,D).subscribe(t=>{e(this,n).normalize=t.current}),e(this,v).subscribe(t=>{e(this,n).x.mass=t.current,e(this,n).y.mass=t.current,e(this,n).z.mass=t.current}),e(this,w).subscribe(t=>{e(this,n).x.stiffness=t.current,e(this,n).y.stiffness=t.current,e(this,n).z.stiffness=t.current}),e(this,n).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,n).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,n).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,n)}connectedCallback(){e(this,n).connect(),e(this,P).observe(),e(this,v).observe(),e(this,w).observe()}disconnectedCallback(){e(this,n).disconnect(),e(this,P).unobserve(),e(this,v).unobserve(),e(this,w).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}n=new WeakMap,P=new WeakMap,v=new WeakMap,w=new WeakMap,R=new WeakMap,D=new WeakMap;Q.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",G);exports.Pointer=F;exports.PointerElement=G;
|
package/lib/pointer/index.js
CHANGED
|
@@ -1,139 +1,142 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var G = Object.defineProperty;
|
|
2
|
+
var T = Object.getOwnPropertySymbols;
|
|
3
|
+
var I = Object.prototype.hasOwnProperty, J = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var X = (i) => {
|
|
5
5
|
throw TypeError(i);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var W = (i, s, e) => s in i ? G(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, Y = (i, s) => {
|
|
8
8
|
for (var e in s || (s = {}))
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var e of
|
|
12
|
-
|
|
9
|
+
I.call(s, e) && W(i, e, s[e]);
|
|
10
|
+
if (T)
|
|
11
|
+
for (var e of T(s))
|
|
12
|
+
J.call(s, e) && W(i, e, s[e]);
|
|
13
13
|
return i;
|
|
14
14
|
};
|
|
15
|
-
var q = (i, s, e) => s.has(i) ||
|
|
16
|
-
var t = (i, s, e) => (q(i, s, "read from private field"), e ? e.call(i) : s.get(i)), r = (i, s, e) => s.has(i) ?
|
|
15
|
+
var q = (i, s, e) => s.has(i) || X("Cannot " + e);
|
|
16
|
+
var t = (i, s, e) => (q(i, s, "read from private field"), e ? e.call(i) : s.get(i)), r = (i, s, e) => s.has(i) ? X("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), h = (i, s, e, m) => (q(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e), B = (i, s, e) => (q(i, s, "access private method"), e);
|
|
17
17
|
import "../Store-0BVty6AZ.js";
|
|
18
|
-
import { g as
|
|
19
|
-
import { g as
|
|
20
|
-
import { c as
|
|
18
|
+
import { g as K, s as N, n as O } from "../coordinates-CgdGoSYs.js";
|
|
19
|
+
import { g as Q } from "../dom-CVWzyXPH.js";
|
|
20
|
+
import { c as j } from "../math-BOBiC4TN.js";
|
|
21
21
|
import "construct-style-sheets-polyfill";
|
|
22
|
-
import { i as
|
|
22
|
+
import { i as U } from "../index-Bv9zgfdb.js";
|
|
23
23
|
import "../ticker/index.js";
|
|
24
24
|
import { D } from "../Damped-CtQmJ52v.js";
|
|
25
|
-
import { elementResizer as
|
|
26
|
-
import { windowResizer as
|
|
27
|
-
import { CSSProperty as
|
|
28
|
-
var
|
|
29
|
-
class
|
|
25
|
+
import { elementResizer as A } from "../element-resizer/index.js";
|
|
26
|
+
import { windowResizer as F } from "../window-resizer/index.js";
|
|
27
|
+
import { CSSProperty as E } from "../css-property/index.js";
|
|
28
|
+
var c, l, a, b, u, p, g, f, y, v, z, L, C, d, H, M;
|
|
29
|
+
class V {
|
|
30
30
|
constructor(s) {
|
|
31
|
-
r(this,
|
|
32
|
-
r(this,
|
|
33
|
-
r(this, a);
|
|
31
|
+
r(this, H);
|
|
32
|
+
r(this, c);
|
|
34
33
|
r(this, l);
|
|
35
|
-
r(this,
|
|
34
|
+
r(this, a);
|
|
35
|
+
r(this, b);
|
|
36
36
|
r(this, u);
|
|
37
37
|
r(this, p);
|
|
38
|
-
r(this, b, 0);
|
|
39
|
-
r(this, d, 0);
|
|
40
38
|
r(this, g, !1);
|
|
41
|
-
r(this,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
r(this, f, 0);
|
|
40
|
+
r(this, y, 0);
|
|
41
|
+
r(this, v, !1);
|
|
42
|
+
r(this, z, (s) => {
|
|
43
|
+
h(this, v, !0);
|
|
44
|
+
const e = B(this, H, M).call(this, s);
|
|
45
|
+
t(this, l).set(e.x, { equalize: !0 }), t(this, a).set(e.y, { equalize: !0 }), t(this, b).set(1);
|
|
48
46
|
});
|
|
49
47
|
r(this, L, (s) => {
|
|
50
|
-
|
|
51
|
-
const e = B(this, C, H).call(this, s);
|
|
52
|
-
t(this, a).set(e.x), t(this, l).set(e.y);
|
|
48
|
+
h(this, v, !1), t(this, b).set(0);
|
|
53
49
|
});
|
|
54
|
-
r(this,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
t(this,
|
|
50
|
+
r(this, C, (s) => {
|
|
51
|
+
t(this, v) || t(this, z).call(this, s);
|
|
52
|
+
const e = B(this, H, M).call(this, s);
|
|
53
|
+
t(this, l).set(e.x), t(this, a).set(e.y);
|
|
58
54
|
});
|
|
59
|
-
|
|
55
|
+
r(this, d, () => {
|
|
56
|
+
t(this, g) ? (h(this, f, document.documentElement.clientWidth), h(this, y, innerHeight)) : (h(this, f, this.element.clientWidth), h(this, y, this.element.clientHeight));
|
|
57
|
+
let s = 0, e = 0, m = 0, o = 0;
|
|
58
|
+
t(this, u) ? t(this, p) ? (s = -1, e = 1, m = -1, o = 1) : (s = t(this, f) / 2 * -1, e = t(this, f) / 2 * 1, m = t(this, y) / 2 * -1, o = t(this, y) / 2 * 1) : t(this, p) ? (s = 0, e = 1, m = 0, o = 1) : (s = 0, e = t(this, f), m = 0, o = t(this, y)), t(this, l).min = s, t(this, l).max = e, t(this, a).min = m, t(this, a).max = o;
|
|
59
|
+
});
|
|
60
|
+
h(this, c, Q(s.element)), h(this, l, new D(0, s.damped)), h(this, a, new D(0, s.damped)), h(this, b, new D(0, Y({ min: 0, max: 1 }, s.damped))), h(this, u, s.cartesian || !1), h(this, p, s.normalize || !1), h(this, g, s.fullScreen || !1);
|
|
60
61
|
}
|
|
61
62
|
get element() {
|
|
62
|
-
return t(this,
|
|
63
|
+
return t(this, c);
|
|
63
64
|
}
|
|
64
65
|
get x() {
|
|
65
|
-
return t(this,
|
|
66
|
+
return t(this, l);
|
|
66
67
|
}
|
|
67
68
|
get y() {
|
|
68
|
-
return t(this,
|
|
69
|
+
return t(this, a);
|
|
69
70
|
}
|
|
70
71
|
get z() {
|
|
71
|
-
return t(this,
|
|
72
|
+
return t(this, b);
|
|
72
73
|
}
|
|
73
74
|
get cartesian() {
|
|
74
75
|
return t(this, u);
|
|
75
76
|
}
|
|
76
77
|
set cartesian(s) {
|
|
77
|
-
|
|
78
|
+
h(this, u, s), t(this, d).call(this);
|
|
78
79
|
}
|
|
79
80
|
get normalize() {
|
|
80
81
|
return t(this, p);
|
|
81
82
|
}
|
|
82
83
|
set normalize(s) {
|
|
83
|
-
|
|
84
|
+
h(this, p, s), t(this, d).call(this);
|
|
84
85
|
}
|
|
85
86
|
connect() {
|
|
86
|
-
t(this,
|
|
87
|
+
t(this, c).addEventListener("pointerenter", t(this, z)), t(this, c).addEventListener("pointerleave", t(this, L)), t(this, c).addEventListener("pointermove", t(this, C)), A.subscribe(t(this, c), t(this, d)), F.subscribe(t(this, d));
|
|
87
88
|
}
|
|
88
89
|
disconnect() {
|
|
89
|
-
t(this,
|
|
90
|
+
t(this, c).removeEventListener(
|
|
90
91
|
"pointerenter",
|
|
91
|
-
t(this,
|
|
92
|
-
), t(this,
|
|
92
|
+
t(this, z)
|
|
93
|
+
), t(this, c).removeEventListener(
|
|
93
94
|
"pointerleave",
|
|
94
|
-
t(this,
|
|
95
|
-
), t(this,
|
|
95
|
+
t(this, L)
|
|
96
|
+
), t(this, c).removeEventListener("pointermove", t(this, C)), A.unsubscribe(t(this, d)), F.unsubscribe(t(this, d)), t(this, l).reset(), t(this, a).reset(), t(this, b).reset();
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
c = new WeakMap(), l = new WeakMap(), a = new WeakMap(), b = new WeakMap(), u = new WeakMap(), p = new WeakMap(), g = new WeakMap(), f = new WeakMap(), y = new WeakMap(), v = new WeakMap(), z = new WeakMap(), L = new WeakMap(), C = new WeakMap(), d = new WeakMap(), H = new WeakSet(), M = function(s) {
|
|
100
|
+
let e = null;
|
|
101
|
+
t(this, g) ? e = { x: s.clientX, y: s.clientY } : e = K(s, t(this, c).getBoundingClientRect());
|
|
102
|
+
const m = {
|
|
103
|
+
width: t(this, f),
|
|
104
|
+
height: t(this, y)
|
|
105
|
+
}, o = {
|
|
103
106
|
x: e.x,
|
|
104
107
|
y: e.y
|
|
105
108
|
};
|
|
106
109
|
if (t(this, u)) {
|
|
107
|
-
const x =
|
|
108
|
-
|
|
110
|
+
const x = N(o, m);
|
|
111
|
+
o.x = x.x, o.y = x.y;
|
|
109
112
|
}
|
|
110
113
|
if (t(this, p)) {
|
|
111
|
-
const x =
|
|
112
|
-
t(this, u) ? (
|
|
114
|
+
const x = O(o, m);
|
|
115
|
+
t(this, u) ? (o.x = j(x.x * 2, -1, 1), o.y = j(x.y * 2, -1, 1)) : (o.x = x.x, o.y = x.y);
|
|
113
116
|
}
|
|
114
|
-
return
|
|
117
|
+
return o;
|
|
115
118
|
};
|
|
116
|
-
var n,
|
|
117
|
-
class
|
|
119
|
+
var n, P, S, w, R, k;
|
|
120
|
+
class Z extends HTMLElement {
|
|
118
121
|
constructor() {
|
|
119
122
|
super();
|
|
120
123
|
r(this, n);
|
|
121
|
-
r(this,
|
|
122
|
-
r(this,
|
|
123
|
-
r(this,
|
|
124
|
-
r(this, R, new
|
|
125
|
-
r(this, k, new
|
|
126
|
-
|
|
124
|
+
r(this, P, new E(this, "--damping", 20));
|
|
125
|
+
r(this, S, new E(this, "--mass", 0));
|
|
126
|
+
r(this, w, new E(this, "--stiffness", 0));
|
|
127
|
+
r(this, R, new E(this, "--cartesian", !1));
|
|
128
|
+
r(this, k, new E(this, "--normalize", !1));
|
|
129
|
+
h(this, n, new V({
|
|
127
130
|
element: this
|
|
128
|
-
})), t(this,
|
|
131
|
+
})), t(this, P).subscribe((e) => {
|
|
129
132
|
t(this, n).x.damping = e.current, t(this, n).y.damping = e.current, t(this, n).z.damping = e.current;
|
|
130
133
|
}), t(this, R).subscribe((e) => {
|
|
131
134
|
t(this, n).cartesian = e.current;
|
|
132
135
|
}), t(this, k).subscribe((e) => {
|
|
133
136
|
t(this, n).normalize = e.current;
|
|
134
|
-
}), t(this, P).subscribe((e) => {
|
|
135
|
-
t(this, n).x.mass = e.current, t(this, n).y.mass = e.current, t(this, n).z.mass = e.current;
|
|
136
137
|
}), t(this, S).subscribe((e) => {
|
|
138
|
+
t(this, n).x.mass = e.current, t(this, n).y.mass = e.current, t(this, n).z.mass = e.current;
|
|
139
|
+
}), t(this, w).subscribe((e) => {
|
|
137
140
|
t(this, n).x.stiffness = e.current, t(this, n).y.stiffness = e.current, t(this, n).z.stiffness = e.current;
|
|
138
141
|
}), t(this, n).x.subscribe((e) => {
|
|
139
142
|
this.style.setProperty("--x", e.current.toString());
|
|
@@ -147,15 +150,15 @@ class Y extends HTMLElement {
|
|
|
147
150
|
return t(this, n);
|
|
148
151
|
}
|
|
149
152
|
connectedCallback() {
|
|
150
|
-
t(this, n).connect(), t(this,
|
|
153
|
+
t(this, n).connect(), t(this, P).observe(), t(this, S).observe(), t(this, w).observe();
|
|
151
154
|
}
|
|
152
155
|
disconnectedCallback() {
|
|
153
|
-
t(this, n).disconnect(), t(this,
|
|
156
|
+
t(this, n).disconnect(), t(this, P).unobserve(), t(this, S).unobserve(), t(this, w).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
|
-
n = new WeakMap(),
|
|
157
|
-
|
|
159
|
+
n = new WeakMap(), P = new WeakMap(), S = new WeakMap(), w = new WeakMap(), R = new WeakMap(), k = new WeakMap();
|
|
160
|
+
U && !customElements.get("e-pointer") && customElements.define("e-pointer", Z);
|
|
158
161
|
export {
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
V as Pointer,
|
|
163
|
+
Z as PointerElement
|
|
161
164
|
};
|
package/lib/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=e=>{throw TypeError(e)};var m=(e,s,t)=>s.has(e)||h("Cannot "+t);var r=(e,s,t)=>(m(e,s,"read from private field"),t?t.call(e):s.get(e)),u=(e,s,t)=>s.has(e)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,l)=>(m(e,s,"write to private field"),l?l.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-D_YeNqsI.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const b=require("../index-DekP7OZe.cjs"),p=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");const o=require("../ticker/index.cjs");var i,a,n;class d extends E.SourceElement{constructor(){super(...arguments);u(this,i,0);u(this,a,!1);u(this,n,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>r(this,i)&&c(this,i,t),p.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:r(this,i)}}),this.consumerElement.readyState===4&&(o.ticker.unsubscribe(r(this,n)),r(this,a)&&this.sourceManager.current&&this.consumerElement.play())})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{c(this,a,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():c(this,a,!0)),o.ticker.subscribe(r(this,n))}),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(),o.ticker.unsubscribe(r(this,n)),c(this,i,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.hasAttribute("volume")&&(this.consumerElement.volume=parseFloat(this.getAttribute("volume")||"1"))}}i=new WeakMap,a=new WeakMap,n=new WeakMap;b.isBrowser&&!customElements.get("e-video")&&customElements.define("e-video",d);exports.VideoElement=d;
|
|
1
|
+
"use strict";var h=e=>{throw TypeError(e)};var m=(e,s,t)=>s.has(e)||h("Cannot "+t);var r=(e,s,t)=>(m(e,s,"read from private field"),t?t.call(e):s.get(e)),u=(e,s,t)=>s.has(e)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,l)=>(m(e,s,"write to private field"),l?l.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-D_YeNqsI.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const b=require("../index-DekP7OZe.cjs"),p=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");const o=require("../ticker/index.cjs");var i,a,n;class d extends E.SourceElement{constructor(){super(...arguments);u(this,i,0);u(this,a,!1);u(this,n,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>r(this,i)&&c(this,i,t),p.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:r(this,i)}}),this.consumerElement.readyState===4&&(o.ticker.unsubscribe(r(this,n)),r(this,a)&&this.sourceManager.current&&this.consumerElement.play())})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{c(this,a,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():c(this,a,!0)),o.ticker.subscribe(r(this,n))}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("release-pause")&&this.consumerElement.pause(),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),o.ticker.unsubscribe(r(this,n)),c(this,i,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.hasAttribute("volume")&&(this.consumerElement.volume=parseFloat(this.getAttribute("volume")||"1"))}}i=new WeakMap,a=new WeakMap,n=new WeakMap;b.isBrowser&&!customElements.get("e-video")&&customElements.define("e-video",d);exports.VideoElement=d;
|
package/lib/video/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var l = (e, s, t) => s.has(e) || h("Cannot " + t);
|
|
5
|
+
var i = (e, s, t) => (l(e, s, "read from private field"), t ? t.call(e) : s.get(e)), c = (e, s, t) => s.has(e) ? h("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), n = (e, s, t, m) => (l(e, s, "write to private field"), m ? m.call(e, t) : s.set(e, t), t);
|
|
6
6
|
import { a as d } from "../SourceElement-jbviggZp.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
@@ -10,28 +10,28 @@ import { i as p } from "../index-Bv9zgfdb.js";
|
|
|
10
10
|
import { d as E } from "../events-CsVF98U6.js";
|
|
11
11
|
import "construct-style-sheets-polyfill";
|
|
12
12
|
import { ticker as u } from "../ticker/index.js";
|
|
13
|
-
var
|
|
13
|
+
var r, a, o;
|
|
14
14
|
class f extends d {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
-
c(this,
|
|
17
|
+
c(this, r, 0);
|
|
18
18
|
c(this, a, !1);
|
|
19
19
|
c(this, o, () => {
|
|
20
20
|
this.classList.add(`state-${this.consumerElement.readyState}`);
|
|
21
21
|
const t = this.consumerElement.readyState / 4;
|
|
22
|
-
t >
|
|
22
|
+
t > i(this, r) && n(this, r, t), E(this, "videoReadyStateChange", {
|
|
23
23
|
detail: {
|
|
24
24
|
readyState: this.consumerElement.readyState,
|
|
25
|
-
progress:
|
|
25
|
+
progress: i(this, r)
|
|
26
26
|
}
|
|
27
|
-
}), this.consumerElement.readyState === 4 && (u.unsubscribe(
|
|
27
|
+
}), this.consumerElement.readyState === 4 && (u.unsubscribe(i(this, o)), i(this, a) && this.sourceManager.current && this.consumerElement.play());
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
connectedCallback() {
|
|
31
31
|
super.connectedCallback(), this.addEventListener("sourceCapture", () => {
|
|
32
|
-
n(this, a, !1), this.hasAttribute("capture-autoplay") && (this.sourceManager.current ? this.consumerElement.play() : n(this, a, !0)), u.subscribe(
|
|
32
|
+
n(this, a, !1), this.hasAttribute("capture-autoplay") && (this.sourceManager.current ? this.consumerElement.play() : n(this, a, !0)), u.subscribe(i(this, o));
|
|
33
33
|
}), this.addEventListener("sourceRelease", () => {
|
|
34
|
-
this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
|
|
34
|
+
this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("release-pause") && this.consumerElement.pause(), this.hasAttribute("reload-source") && this.classList.remove(
|
|
35
35
|
"state-0",
|
|
36
36
|
"state-1",
|
|
37
37
|
"state-2",
|
|
@@ -41,7 +41,7 @@ class f extends d {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
disconnectedCallback() {
|
|
44
|
-
super.disconnectedCallback(), u.unsubscribe(
|
|
44
|
+
super.disconnectedCallback(), u.unsubscribe(i(this, o)), n(this, r, 0);
|
|
45
45
|
}
|
|
46
46
|
createConsumer() {
|
|
47
47
|
return document.createElement("video");
|
|
@@ -52,7 +52,7 @@ class f extends d {
|
|
|
52
52
|
));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
r = new WeakMap(), a = new WeakMap(), o = new WeakMap();
|
|
56
56
|
p && !customElements.get("e-video") && customElements.define("e-video", f);
|
|
57
57
|
export {
|
|
58
58
|
f as VideoElement
|