aptechka 0.70.0 → 0.70.2
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/{SourceElement-DCZneQrE.cjs → SourceElement-Bc5Rwf81.cjs} +1 -1
- package/lib/{SourceElement-CpB95xQn.js → SourceElement-hkzZTDa7.js} +14 -14
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +1 -1
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +28 -28
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +5 -5
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,_)),t(this,r).addEventListener("pause",t(this,P)),Array.from(this.attributes).forEach(l=>{if(l.name!=="srcset"){const x=l.nodeValue||"",v=it.kebabToCamel(l.name);v in t(this,r)&&(t(this,r)[v]=x||!0)}}),this.appendChild(t(this,r)),s(this,d,new tt({srcset:e,sourceSetOptions:t(this,V)})),s(this,p,this.hasAttribute("lazy")),t(this,d).subscribe(l=>{(!t(this,p)||t(this,p)&&t(this,b))&&D(this,T,H).call(this,l.current)}),t(this,d).connect(),t(this,I).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,$)),t(this,I).disconnect(),(e=t(this,d))==null||e.close(),t(this,r)&&(t(this,r).removeEventListener("play",t(this,_)),t(this,r).removeEventListener("pause",t(this,P)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).remove()),s(this,y,!1),s(this,b,!1),t(this,a).reset()}}d=new WeakMap,r=new WeakMap,y=new WeakMap,b=new WeakMap,p=new WeakMap,C=new WeakMap,M=new WeakMap,a=new WeakMap,I=new WeakMap,$=new WeakMap,w=new WeakMap,V=new WeakMap,T=new WeakSet,H=function(e){if(clearTimeout(t(this,$)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,a).set("loaded",!1),t(this,a).set("error",!1),t(this,a).set("loading",!1),t(this,a).set("clear",!1),t(this,a).set("playing",!1),e){s(this,M,`${t(this,C)}-${e.url}`);const c=this.hasAttribute("keep-source-parameters");t(this,a).set("loading",!0),s(this,w,c?e.url:e.name+e.extension),this.consumeSource(t(this,w)),!t(this,p)&&!t(this,y)&&W.loading.add(t(this,M)),t(this,r).onloadeddata=()=>{t(this,B).call(this)},t(this,r).onload=()=>{t(this,B).call(this)},t(this,r).onerror=()=>{t(this,G).call(this,t(this,w))}}else s(this,w,null),this.consumeSource(null)},j=new WeakMap,B=new WeakMap,G=new WeakMap,_=new WeakMap,P=new WeakMap;exports.Source=Y;exports.SourceElement=at;exports.SourceManager=tt;exports.SourceSet=Z;
|
|
5
|
+
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,_)),t(this,r).addEventListener("pause",t(this,P)),Array.from(this.attributes).forEach(l=>{if(l.name!=="srcset"){const x=l.nodeValue||"",v=it.kebabToCamel(l.name);v in t(this,r)&&(t(this,r)[v]=x||!0)}}),this.appendChild(t(this,r)),s(this,d,new tt({srcset:e,sourceSetOptions:t(this,V)})),s(this,p,this.hasAttribute("lazy")),t(this,d).subscribe(l=>{(!t(this,p)||t(this,p)&&t(this,b))&&D(this,T,H).call(this,l.current)}),t(this,d).connect(),t(this,I).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,$)),t(this,I).disconnect(),(e=t(this,d))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,_)),t(this,r).removeEventListener("pause",t(this,P)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,y,!1),s(this,b,!1),t(this,a).reset()}}d=new WeakMap,r=new WeakMap,y=new WeakMap,b=new WeakMap,p=new WeakMap,C=new WeakMap,M=new WeakMap,a=new WeakMap,I=new WeakMap,$=new WeakMap,w=new WeakMap,V=new WeakMap,T=new WeakSet,H=function(e){if(clearTimeout(t(this,$)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,a).set("loaded",!1),t(this,a).set("error",!1),t(this,a).set("loading",!1),t(this,a).set("clear",!1),t(this,a).set("playing",!1),e){s(this,M,`${t(this,C)}-${e.url}`);const c=this.hasAttribute("keep-source-parameters");t(this,a).set("loading",!0),s(this,w,c?e.url:e.name+e.extension),this.consumeSource(t(this,w)),!t(this,p)&&!t(this,y)&&W.loading.add(t(this,M)),t(this,r).onloadeddata=()=>{t(this,B).call(this)},t(this,r).onload=()=>{t(this,B).call(this)},t(this,r).onerror=()=>{t(this,G).call(this,t(this,w))}}else s(this,w,null),this.consumeSource(null)},j=new WeakMap,B=new WeakMap,G=new WeakMap,_=new WeakMap,P=new WeakMap;exports.Source=Y;exports.SourceElement=at;exports.SourceManager=tt;exports.SourceSet=Z;
|
|
@@ -12,11 +12,11 @@ import { loading as W } from "./loading/index.js";
|
|
|
12
12
|
import { RESIZE_ORDER as st } from "./order/index.js";
|
|
13
13
|
import { windowResizer as Q } from "./window-resizer/index.js";
|
|
14
14
|
import { S as it } from "./Store-0BVty6AZ.js";
|
|
15
|
-
var O,
|
|
15
|
+
var O, S, C, L, u, f, k;
|
|
16
16
|
class rt {
|
|
17
17
|
constructor(n) {
|
|
18
18
|
i(this, O);
|
|
19
|
-
i(this,
|
|
19
|
+
i(this, S);
|
|
20
20
|
i(this, C);
|
|
21
21
|
i(this, L);
|
|
22
22
|
i(this, u);
|
|
@@ -25,12 +25,12 @@ class rt {
|
|
|
25
25
|
s(this, O, n);
|
|
26
26
|
let e = n.split(".");
|
|
27
27
|
const l = /\b\d{1,2}x\b/g, m = e.find((g) => g.match(l) && parseInt(g));
|
|
28
|
-
s(this, C, m ? parseInt(m) : 1), m && (e = e.slice(0, -1)), s(this,
|
|
28
|
+
s(this, C, m ? parseInt(m) : 1), m && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
29
|
const c = /\d+max/g, x = /\d+min/g, v = /\d+mar/g, D = /\d+mir/g, K = e.find((g) => g.match(c)), h = e.find((g) => g.match(x)), b = e.find((g) => g.match(v)), Z = e.find((g) => g.match(D));
|
|
30
|
-
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : Z ? (s(this, u, parseInt(Z)), s(this, f, "max"), s(this, L, `(min-aspect-ratio: ${t(this, u)})`)) : K ? (s(this, u, parseInt(K)), s(this, f, "max"), s(this, L, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this,
|
|
30
|
+
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : Z ? (s(this, u, parseInt(Z)), s(this, f, "max"), s(this, L, `(min-aspect-ratio: ${t(this, u)})`)) : K ? (s(this, u, parseInt(K)), s(this, f, "max"), s(this, L, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this, S, t(this, S).replace(
|
|
31
31
|
`.${t(this, u)}${t(this, f)}`,
|
|
32
32
|
""
|
|
33
|
-
)), s(this, k, e[e.length - 1] === t(this,
|
|
33
|
+
)), s(this, k, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, k, t(this, k).replace(
|
|
34
34
|
`.${t(this, u)}${t(this, f)}`,
|
|
35
35
|
""
|
|
36
36
|
));
|
|
@@ -39,7 +39,7 @@ class rt {
|
|
|
39
39
|
return t(this, O);
|
|
40
40
|
}
|
|
41
41
|
get name() {
|
|
42
|
-
return t(this,
|
|
42
|
+
return t(this, S);
|
|
43
43
|
}
|
|
44
44
|
get density() {
|
|
45
45
|
return t(this, C);
|
|
@@ -57,12 +57,12 @@ class rt {
|
|
|
57
57
|
return t(this, u);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
O = new WeakMap(),
|
|
61
|
-
var
|
|
60
|
+
O = new WeakMap(), S = new WeakMap(), C = new WeakMap(), L = new WeakMap(), u = new WeakMap(), f = new WeakMap(), k = new WeakMap();
|
|
61
|
+
var w;
|
|
62
62
|
class X {
|
|
63
63
|
constructor(n, e) {
|
|
64
|
-
i(this,
|
|
65
|
-
s(this,
|
|
64
|
+
i(this, w);
|
|
65
|
+
s(this, w, /* @__PURE__ */ new Map());
|
|
66
66
|
const l = (e == null ? void 0 : e.mediaBuckets) !== !1, m = typeof n == "string" ? l ? n.trim().split(",").map((h) => h.trim()).filter((h) => !!h) : [n] : n, c = [];
|
|
67
67
|
m.forEach((h) => {
|
|
68
68
|
const b = new rt(h);
|
|
@@ -70,14 +70,14 @@ class X {
|
|
|
70
70
|
});
|
|
71
71
|
const x = c.filter((h) => h[1].queryType.includes("max")).sort((h, b) => b[1].queryValue - h[1].queryValue), v = c.filter((h) => h[1].queryType.includes("min") && h[1].queryValue !== 0).sort((h, b) => h[1].queryValue - b[1].queryValue), D = c.filter((h) => h[0] === "(min-width: 0px)");
|
|
72
72
|
(D ? [...D, ...x, ...v] : [...x, ...v]).forEach((h) => {
|
|
73
|
-
t(this,
|
|
73
|
+
t(this, w).has(h[0]) || t(this, w).set(h[0], []), t(this, w).get(h[0]).push(h[1]);
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
get mediaBuckets() {
|
|
77
|
-
return t(this,
|
|
77
|
+
return t(this, w);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
w = new WeakMap();
|
|
81
81
|
var M, A;
|
|
82
82
|
class nt extends it {
|
|
83
83
|
constructor(e) {
|
|
@@ -200,7 +200,7 @@ class yt extends HTMLElement {
|
|
|
200
200
|
}
|
|
201
201
|
disconnectedCallback() {
|
|
202
202
|
var e;
|
|
203
|
-
clearTimeout(t(this, $)), t(this, R).disconnect(), (e = t(this, d)) == null || e.close(), t(this, r) && (t(this, r).removeEventListener("play", t(this, P)), t(this, r).removeEventListener("pause", t(this, U)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).remove()), s(this, y, !1), s(this, E, !1), t(this, a).reset();
|
|
203
|
+
clearTimeout(t(this, $)), t(this, R).disconnect(), (e = t(this, d)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, P)), t(this, r).removeEventListener("pause", t(this, U)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, y, !1), s(this, E, !1), t(this, a).reset();
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
d = new WeakMap(), r = new WeakMap(), y = new WeakMap(), E = new WeakMap(), p = new WeakMap(), V = new WeakMap(), I = new WeakMap(), a = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), q = new WeakMap(), z = new WeakMap(), T = new WeakSet(), j = function(e) {
|
package/lib/iframe/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-
|
|
1
|
+
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-Bc5Rwf81.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
|
package/lib/iframe/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var a = (r) => {
|
|
|
3
3
|
};
|
|
4
4
|
var u = (r, t, e) => t.has(r) || a("Cannot " + e);
|
|
5
5
|
var s = (r, t, e) => (u(r, t, "read from private field"), e ? e.call(r) : t.get(r)), i = (r, t, e) => t.has(r) ? a("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), c = (r, t, e, o) => (u(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
|
|
6
|
-
import { a as E } from "../SourceElement-
|
|
6
|
+
import { a as E } from "../SourceElement-hkzZTDa7.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as f } from "../index-Bv9zgfdb.js";
|
package/lib/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-Bc5Rwf81.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
|
package/lib/image/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as m } from "../Viewport-DA10iWAO.js";
|
|
2
|
-
import { a as s } from "../SourceElement-
|
|
2
|
+
import { a as s } from "../SourceElement-hkzZTDa7.js";
|
|
3
3
|
import "../window-resizer/index.js";
|
|
4
4
|
import "../Store-0BVty6AZ.js";
|
|
5
5
|
import { i } from "../index-Bv9zgfdb.js";
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=c=>{throw TypeError(c)};var ee=(c,n,t)=>n.has(c)||oe("Cannot "+t);var e=(c,n,t)=>(ee(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(ee(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),f=(c,n,t)=>(ee(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("../element-linked-store/index.cjs"),y=require("../css-property/index.cjs"),ie=require("../index-DekP7OZe.cjs"),K=require("../events-KVanG9sR.cjs"),pe=require("../function-MthRj-GJ.cjs"),ne=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const he=require("../url-BT4fssbO.cjs"),ce=require("../window-resizer/index.cjs"),Q=require("../Viewport-DB0qAZPJ.cjs");var u,E,_,N;class de{constructor(){r(this,u,new Map);r(this,E,[]);r(this,_,n=>{var s;const t=[...e(this,E)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(re=>re instanceof HTMLElement&&re.hasAttribute("data-popover-content")))return;const l=i[0],d=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),D=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!d||D)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,E)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,_)),addEventListener("keydown",e(this,N))}get groups(){return e(this,u)}get stack(){return e(this,E)}add(n,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(n);s!=null&&s.length||(s=[],e(this,u).set(n,s)),e(this,E).push(t),s.push(t)}remove(n,t){if(o(this,E,e(this,E).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(n);e(this,u).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(n);s&&(s=s.filter(i=>i!==t),e(this,u).set(n,s))}}}u=new WeakMap,E=new WeakMap,_=new WeakMap,N=new WeakMap;var v,B,H,k,z,m,L,A,x,b,R,q,S,T,$,a,O,G,p,le,M,Z,V,P,j,X,W;const w=class w extends HTMLElement{constructor(){super();r(this,p);r(this,v);r(this,B);r(this,H);r(this,k);r(this,z);r(this,m);r(this,L);r(this,A);r(this,x);r(this,b);r(this,R);r(this,q);r(this,S);r(this,T);r(this,$);r(this,a);r(this,O);r(this,G);r(this,V);r(this,P);r(this,j);r(this,X);r(this,W);this.urlValue="",o(this,v,!1),o(this,m,new y.CSSProperty(this,"--history",!1)),o(this,L,new y.CSSProperty(this,"--restore",!1)),o(this,A,new y.CSSProperty(this,"--close-rest",!1)),o(this,x,new y.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new y.CSSProperty(this,"--group","")),o(this,R,new y.CSSProperty(this,"--click-outside",!1)),o(this,q,new y.CSSProperty(this,"--escape",!1)),o(this,S,new y.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,T,!1),o(this,a,new ue.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),o(this,O,[]),o(this,G,[]),o(this,V,()=>{o(this,T,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,T,!0)}),o(this,P,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,j).call(this)}),o(this,j,pe.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,S).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Q.viewport.width?s=Q.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Q.viewport.height?i=Q.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,W,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(w.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=w.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,L)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,b)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,v)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&he.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,B)),clearTimeout(e(this,H)),f(this,p,M).call(this,!0,this.openClass),f(this,p,M).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),K.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,m).current&&e(this,T)&&history.pushState(history.state,"",e(this,p,le)),o(this,v,!0);const s=()=>{w.stack.add(e(this,b).current,this),e(this,G).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),e(this,P).call(this),e(this,a).set("opened",!0),K.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,k,void 0),o(this,z,setTimeout(()=>{e(this,a).set("transitionend",!0)},ne.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,k,setTimeout(s,10))}close(){e(this,v)&&(o(this,v,!1),clearTimeout(e(this,k)),clearTimeout(e(this,z)),w.stack.remove(e(this,b).current,this),f(this,p,Z).call(this),f(this,p,M).call(this,!1,this.openClass),e(this,a).set("transitionend",!1),o(this,B,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),f(this,p,M).call(this,!0,this.closingClass),K.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,H,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),f(this,p,M).call(this,!1,this.closingClass),K.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},ne.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,O,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,O).forEach(t=>{t.addEventListener("click",e(this,W))}),o(this,G,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,L).observe(),e(this,A).observe(),e(this,x).observe(),e(this,b).observe(),e(this,R).observe(),e(this,q).observe(),e(this,S).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,L).current?(this.urlValue=he.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(f(this,p,Z).call(this),o(this,T,!0))},0),e(this,S).subscribe(()=>{e(this,P).call(this)}),ce.windowResizer.subscribe(e(this,P))}disconnectedCallback(){e(this,O).forEach(t=>{t.removeEventListener("click",e(this,W))}),w.stack.remove(e(this,b).current,this),ce.windowResizer.unsubscribe(e(this,P)),e(this,a).close(),e(this,m).close(),e(this,L).close(),e(this,A).close(),e(this,x).close(),e(this,b).close(),e(this,R).close(),e(this,q).close(),e(this,S).close(),this.removeAttribute("role"),clearTimeout(e(this,B)),clearTimeout(e(this,H)),clearTimeout(e(this,k)),clearTimeout(e(this,z)),removeEventListener("popstate",e(this,V)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),f(this,p,Z).call(this)}};v=new WeakMap,B=new WeakMap,H=new WeakMap,k=new WeakMap,z=new WeakMap,m=new WeakMap,L=new WeakMap,A=new WeakMap,x=new WeakMap,b=new WeakMap,R=new WeakMap,q=new WeakMap,S=new WeakMap,T=new WeakMap,$=new WeakMap,a=new WeakMap,O=new WeakMap,G=new WeakMap,p=new WeakSet,le=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},M=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},Z=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,P=new WeakMap,j=new WeakMap,X=new WeakMap,W=new WeakMap,w.stack=new de;let U=w;ie.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",U);var h,g,C,te,Y,F,I,J,se;class ae extends HTMLElement{constructor(){super();r(this,C);r(this,h);r(this,g,new y.CSSProperty(this,"--type","open"));r(this,Y,()=>{e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,F,()=>{e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,I,()=>{e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,J,()=>{e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});ie.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(f(this,C,te).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const d=this.getRootNode();d instanceof ShadowRoot?i=d.host.closest("[data-popover]"):d instanceof HTMLElement&&(i=d.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=d=>{if(!d)return null;let D=d.querySelector("[data-popover]");return!D&&(d!=null&&d.parentElement)&&(D=l(d.parentElement)),D};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,F)),e(this,h).addEventListener("popoverClosing",e(this,I)),e(this,h).addEventListener("popoverClosed",e(this,J))):console.warn(this,`target ${t} not found`)}f(this,C,se).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{f(this,C,se).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),f(this,C,te).call(this)}}h=new WeakMap,g=new WeakMap,C=new WeakSet,te=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,F)),e(this,h).removeEventListener("popoverClosing",e(this,I)),e(this,h).removeEventListener("popoverClosed",e(this,J)))},Y=new WeakMap,F=new WeakMap,I=new WeakMap,J=new WeakMap,se=function(t){e(this,h)instanceof U&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};ie.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ae);exports.PopoverButtonElement=ae;exports.PopoverElement=U;
|
|
1
|
+
"use strict";var oe=c=>{throw TypeError(c)};var ee=(c,n,t)=>n.has(c)||oe("Cannot "+t);var e=(c,n,t)=>(ee(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(ee(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),f=(c,n,t)=>(ee(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("../element-linked-store/index.cjs"),y=require("../css-property/index.cjs"),ie=require("../index-DekP7OZe.cjs"),K=require("../events-KVanG9sR.cjs"),pe=require("../function-MthRj-GJ.cjs"),ne=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const he=require("../url-BT4fssbO.cjs"),ce=require("../window-resizer/index.cjs"),Q=require("../Viewport-DB0qAZPJ.cjs");var u,E,_,N;class de{constructor(){r(this,u,new Map);r(this,E,[]);r(this,_,n=>{var s;const t=[...e(this,E)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(re=>re instanceof HTMLElement&&re.hasAttribute("data-popover-content")))return;const l=i[0],d=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),D=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!d||D)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,E)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,_)),addEventListener("keydown",e(this,N))}get groups(){return e(this,u)}get stack(){return e(this,E)}add(n,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(n);s!=null&&s.length||(s=[],e(this,u).set(n,s)),e(this,E).push(t),s.push(t)}remove(n,t){if(o(this,E,e(this,E).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(n);e(this,u).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(n);s&&(s=s.filter(i=>i!==t),e(this,u).set(n,s))}}}u=new WeakMap,E=new WeakMap,_=new WeakMap,N=new WeakMap;var v,M,B,k,H,m,L,A,x,b,R,q,S,T,$,a,V,W,p,le,O,Z,z,P,j,X,G;const w=class w extends HTMLElement{constructor(){super();r(this,p);r(this,v);r(this,M);r(this,B);r(this,k);r(this,H);r(this,m);r(this,L);r(this,A);r(this,x);r(this,b);r(this,R);r(this,q);r(this,S);r(this,T);r(this,$);r(this,a);r(this,V);r(this,W);r(this,z);r(this,P);r(this,j);r(this,X);r(this,G);this.urlValue="",o(this,v,!1),o(this,m,new y.CSSProperty(this,"--history",!1)),o(this,L,new y.CSSProperty(this,"--restore",!1)),o(this,A,new y.CSSProperty(this,"--close-rest",!1)),o(this,x,new y.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new y.CSSProperty(this,"--group","")),o(this,R,new y.CSSProperty(this,"--click-outside",!1)),o(this,q,new y.CSSProperty(this,"--escape",!1)),o(this,S,new y.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,T,!1),o(this,a,new ue.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),o(this,V,[]),o(this,W,[]),o(this,z,()=>{o(this,T,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,T,!0)}),o(this,P,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,j).call(this)}),o(this,j,pe.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,S).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Q.viewport.width?s=Q.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Q.viewport.height?i=Q.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,G,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(w.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=w.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,L)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,b)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,v)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&he.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,M)),clearTimeout(e(this,B)),f(this,p,O).call(this,!0,this.openClass),f(this,p,O).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),K.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,m).current&&e(this,T)&&history.pushState(history.state,"",e(this,p,le)),o(this,v,!0);const s=()=>{w.stack.add(e(this,b).current,this),e(this,W).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),e(this,P).call(this),e(this,a).set("opened",!0),K.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,k,void 0),o(this,H,setTimeout(()=>{e(this,a).set("transitionend",!0)},ne.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,k,setTimeout(s,10))}close(){e(this,v)&&(o(this,v,!1),clearTimeout(e(this,k)),clearTimeout(e(this,H)),w.stack.remove(e(this,b).current,this),f(this,p,Z).call(this),f(this,p,O).call(this,!1,this.openClass),e(this,a).set("transitionend",!1),o(this,M,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),f(this,p,O).call(this,!0,this.closingClass),K.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,B,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),f(this,p,O).call(this,!1,this.closingClass),K.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},ne.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,V,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,V).forEach(t=>{t.addEventListener("click",e(this,G))}),o(this,W,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,L).observe(),e(this,A).observe(),e(this,x).observe(),e(this,b).observe(),e(this,R).observe(),e(this,q).observe(),e(this,S).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,z)),setTimeout(()=>{e(this,L).current?(this.urlValue=he.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue})):(f(this,p,Z).call(this),o(this,T,!0))},0),e(this,S).subscribe(()=>{e(this,P).call(this)}),ce.windowResizer.subscribe(e(this,P))}disconnectedCallback(){e(this,V).forEach(t=>{t.removeEventListener("click",e(this,G))}),w.stack.remove(e(this,b).current,this),ce.windowResizer.unsubscribe(e(this,P)),e(this,a).close(),e(this,m).close(),e(this,L).close(),e(this,A).close(),e(this,x).close(),e(this,b).close(),e(this,R).close(),e(this,q).close(),e(this,S).close(),this.removeAttribute("role"),clearTimeout(e(this,M)),clearTimeout(e(this,B)),clearTimeout(e(this,k)),clearTimeout(e(this,H)),removeEventListener("popstate",e(this,z)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),f(this,p,Z).call(this)}};v=new WeakMap,M=new WeakMap,B=new WeakMap,k=new WeakMap,H=new WeakMap,m=new WeakMap,L=new WeakMap,A=new WeakMap,x=new WeakMap,b=new WeakMap,R=new WeakMap,q=new WeakMap,S=new WeakMap,T=new WeakMap,$=new WeakMap,a=new WeakMap,V=new WeakMap,W=new WeakMap,p=new WeakSet,le=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},O=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},Z=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},z=new WeakMap,P=new WeakMap,j=new WeakMap,X=new WeakMap,G=new WeakMap,w.stack=new de;let U=w;ie.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",U);var h,g,C,te,Y,F,I,J,se;class ae extends HTMLElement{constructor(){super();r(this,C);r(this,h);r(this,g,new y.CSSProperty(this,"--type","open"));r(this,Y,()=>{e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,F,()=>{e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,I,()=>{e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,J,()=>{e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});ie.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(f(this,C,te).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const d=this.getRootNode();d instanceof ShadowRoot?i=d.host.closest("[data-popover]"):d instanceof HTMLElement&&(i=d.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=d=>{if(!d)return null;let D=d.querySelector("[data-popover]");return!D&&(d!=null&&d.parentElement)&&(D=l(d.parentElement)),D};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,F)),e(this,h).addEventListener("popoverClosing",e(this,I)),e(this,h).addEventListener("popoverClosed",e(this,J))):console.warn(this,`target ${t} not found`)}f(this,C,se).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{f(this,C,se).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),f(this,C,te).call(this)}}h=new WeakMap,g=new WeakMap,C=new WeakSet,te=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,F)),e(this,h).removeEventListener("popoverClosing",e(this,I)),e(this,h).removeEventListener("popoverClosed",e(this,J)))},Y=new WeakMap,F=new WeakMap,I=new WeakMap,J=new WeakMap,se=function(t){e(this,h)instanceof U&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};ie.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ae);exports.PopoverButtonElement=ae;exports.PopoverElement=U;
|
package/lib/popover/index.js
CHANGED
|
@@ -82,16 +82,16 @@ class dt {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
u = new WeakMap(), y = new WeakMap(), N = new WeakMap(), _ = new WeakMap();
|
|
85
|
-
var m,
|
|
85
|
+
var m, H, W, P, q, v, w, x, S, b, R, $, T, k, V, a, O, G, p, lt, M, Q, z, A, U, X, B;
|
|
86
86
|
const L = class L extends HTMLElement {
|
|
87
87
|
constructor() {
|
|
88
88
|
super();
|
|
89
89
|
r(this, p);
|
|
90
90
|
r(this, m);
|
|
91
|
-
r(this,
|
|
92
|
-
r(this, G);
|
|
93
|
-
r(this, P);
|
|
91
|
+
r(this, H);
|
|
94
92
|
r(this, W);
|
|
93
|
+
r(this, P);
|
|
94
|
+
r(this, q);
|
|
95
95
|
r(this, v);
|
|
96
96
|
r(this, w);
|
|
97
97
|
r(this, x);
|
|
@@ -101,11 +101,11 @@ const L = class L extends HTMLElement {
|
|
|
101
101
|
r(this, $);
|
|
102
102
|
r(this, T);
|
|
103
103
|
r(this, k);
|
|
104
|
-
r(this, O);
|
|
105
|
-
r(this, a);
|
|
106
104
|
r(this, V);
|
|
105
|
+
r(this, a);
|
|
106
|
+
r(this, O);
|
|
107
|
+
r(this, G);
|
|
107
108
|
r(this, z);
|
|
108
|
-
r(this, M);
|
|
109
109
|
r(this, A);
|
|
110
110
|
r(this, U);
|
|
111
111
|
r(this, X);
|
|
@@ -119,7 +119,7 @@ const L = class L extends HTMLElement {
|
|
|
119
119
|
closing: !1,
|
|
120
120
|
triggered: !1,
|
|
121
121
|
transitionend: !1
|
|
122
|
-
})), o(this,
|
|
122
|
+
})), o(this, O, []), o(this, G, []), o(this, z, () => {
|
|
123
123
|
o(this, k, !1), t(this, m) && t(this, v).current && !location.search.includes(this.id) ? this.close() : !t(this, m) && t(this, v).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, k, !0);
|
|
124
124
|
}), o(this, A, () => {
|
|
125
125
|
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), this.style.setProperty("--viewport-offset-x", "0px"), this.style.setProperty("--viewport-offset-y", "0px"), t(this, U).call(this);
|
|
@@ -184,7 +184,7 @@ const L = class L extends HTMLElement {
|
|
|
184
184
|
return t(this, m);
|
|
185
185
|
}
|
|
186
186
|
get lastTrigger() {
|
|
187
|
-
return t(this,
|
|
187
|
+
return t(this, V);
|
|
188
188
|
}
|
|
189
189
|
get idWithValue() {
|
|
190
190
|
return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
|
|
@@ -195,14 +195,14 @@ const L = class L extends HTMLElement {
|
|
|
195
195
|
open(e) {
|
|
196
196
|
if (t(this, m))
|
|
197
197
|
return;
|
|
198
|
-
o(this,
|
|
198
|
+
o(this, V, e == null ? void 0 : e.trigger), clearTimeout(t(this, H)), clearTimeout(t(this, W)), f(this, p, M).call(this, !0, this.openClass), f(this, p, M).call(this, !1, this.closingClass), t(this, a).set("closing", !1), t(this, a).set("triggered", !0), J(this, "popoverTriggered", {
|
|
199
199
|
custom: !0,
|
|
200
200
|
detail: {
|
|
201
|
-
trigger: t(this,
|
|
201
|
+
trigger: t(this, V)
|
|
202
202
|
}
|
|
203
203
|
}), t(this, v).current && t(this, k) && history.pushState(history.state, "", t(this, p, lt)), o(this, m, !0);
|
|
204
204
|
const s = () => {
|
|
205
|
-
L.stack.add(t(this, b).current, this), t(this,
|
|
205
|
+
L.stack.add(t(this, b).current, this), t(this, G).forEach((i) => {
|
|
206
206
|
i.scroll({
|
|
207
207
|
top: 0,
|
|
208
208
|
left: 0,
|
|
@@ -211,22 +211,22 @@ const L = class L extends HTMLElement {
|
|
|
211
211
|
}), t(this, A).call(this), t(this, a).set("opened", !0), J(this, "popoverOpened", {
|
|
212
212
|
custom: !0,
|
|
213
213
|
detail: {
|
|
214
|
-
trigger: t(this,
|
|
214
|
+
trigger: t(this, V)
|
|
215
215
|
},
|
|
216
216
|
bubbles: !0
|
|
217
|
-
}), o(this, P, void 0), o(this,
|
|
217
|
+
}), o(this, P, void 0), o(this, q, setTimeout(() => {
|
|
218
218
|
t(this, a).set("transitionend", !0);
|
|
219
219
|
}, ht(this) + 10));
|
|
220
220
|
};
|
|
221
221
|
e != null && e.skipTransition ? s() : o(this, P, setTimeout(s, 10));
|
|
222
222
|
}
|
|
223
223
|
close() {
|
|
224
|
-
t(this, m) && (o(this, m, !1), clearTimeout(t(this, P)), clearTimeout(t(this,
|
|
225
|
-
t(this, a).set("opened", !1), t(this, a).set("closing", !0), f(this, p,
|
|
224
|
+
t(this, m) && (o(this, m, !1), clearTimeout(t(this, P)), clearTimeout(t(this, q)), L.stack.remove(t(this, b).current, this), f(this, p, Q).call(this), f(this, p, M).call(this, !1, this.openClass), t(this, a).set("transitionend", !1), o(this, H, setTimeout(() => {
|
|
225
|
+
t(this, a).set("opened", !1), t(this, a).set("closing", !0), f(this, p, M).call(this, !0, this.closingClass), J(this, "popoverClosing", {
|
|
226
226
|
custom: !0,
|
|
227
227
|
bubbles: !0
|
|
228
|
-
}), o(this,
|
|
229
|
-
t(this, a).set("triggered", !1), t(this, a).set("closing", !1), f(this, p,
|
|
228
|
+
}), o(this, W, setTimeout(() => {
|
|
229
|
+
t(this, a).set("triggered", !1), t(this, a).set("closing", !1), f(this, p, M).call(this, !1, this.closingClass), J(this, "popoverClosed", {
|
|
230
230
|
custom: !0,
|
|
231
231
|
bubbles: !0
|
|
232
232
|
});
|
|
@@ -234,31 +234,31 @@ const L = class L extends HTMLElement {
|
|
|
234
234
|
}, 10)));
|
|
235
235
|
}
|
|
236
236
|
connectedCallback() {
|
|
237
|
-
o(this,
|
|
237
|
+
o(this, O, [
|
|
238
238
|
...this.querySelectorAll(
|
|
239
239
|
`[data-popover-close${this.id ? `="${this.id}"` : ""}]`
|
|
240
240
|
)
|
|
241
|
-
]), t(this,
|
|
241
|
+
]), t(this, O).forEach((e) => {
|
|
242
242
|
e.addEventListener("click", t(this, B));
|
|
243
|
-
}), o(this,
|
|
243
|
+
}), o(this, G, [
|
|
244
244
|
...this.querySelectorAll(
|
|
245
245
|
`[data-popover-reset-scroll${this.id ? `="${this.id}"` : ""}]`
|
|
246
246
|
)
|
|
247
|
-
]), t(this, v).observe(), t(this, w).observe(), t(this, x).observe(), t(this, S).observe(), t(this, b).observe(), t(this, R).observe(), t(this, $).observe(), t(this, T).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this,
|
|
248
|
-
t(this, w).current ? (this.urlValue = pt(location.search)[this.id],
|
|
247
|
+
]), t(this, v).observe(), t(this, w).observe(), t(this, x).observe(), t(this, S).observe(), t(this, b).observe(), t(this, R).observe(), t(this, $).observe(), t(this, T).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, z)), setTimeout(() => {
|
|
248
|
+
t(this, w).current ? (this.urlValue = pt(location.search)[this.id], location.search.includes(this.id) && this.open({ trigger: this.idWithValue })) : (f(this, p, Q).call(this), o(this, k, !0));
|
|
249
249
|
}, 0), t(this, T).subscribe(() => {
|
|
250
250
|
t(this, A).call(this);
|
|
251
251
|
}), nt.subscribe(t(this, A));
|
|
252
252
|
}
|
|
253
253
|
disconnectedCallback() {
|
|
254
|
-
t(this,
|
|
254
|
+
t(this, O).forEach((e) => {
|
|
255
255
|
e.removeEventListener("click", t(this, B));
|
|
256
|
-
}), L.stack.remove(t(this, b).current, this), nt.unsubscribe(t(this, A)), t(this, a).close(), t(this, v).close(), t(this, w).close(), t(this, x).close(), t(this, S).close(), t(this, b).close(), t(this, R).close(), t(this, $).close(), t(this, T).close(), this.removeAttribute("role"), clearTimeout(t(this,
|
|
256
|
+
}), L.stack.remove(t(this, b).current, this), nt.unsubscribe(t(this, A)), t(this, a).close(), t(this, v).close(), t(this, w).close(), t(this, x).close(), t(this, S).close(), t(this, b).close(), t(this, R).close(), t(this, $).close(), t(this, T).close(), this.removeAttribute("role"), clearTimeout(t(this, H)), clearTimeout(t(this, W)), clearTimeout(t(this, P)), clearTimeout(t(this, q)), removeEventListener("popstate", t(this, z)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), f(this, p, Q).call(this);
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
m = new WeakMap(),
|
|
259
|
+
m = new WeakMap(), H = new WeakMap(), W = new WeakMap(), P = new WeakMap(), q = new WeakMap(), v = new WeakMap(), w = new WeakMap(), x = new WeakMap(), S = new WeakMap(), b = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), T = new WeakMap(), k = new WeakMap(), V = new WeakMap(), a = new WeakMap(), O = new WeakMap(), G = new WeakMap(), p = new WeakSet(), lt = function() {
|
|
260
260
|
return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
|
|
261
|
-
},
|
|
261
|
+
}, M = function(e, s) {
|
|
262
262
|
s && s.split(" ").map((i) => {
|
|
263
263
|
document.documentElement.classList.toggle(i.trim(), e);
|
|
264
264
|
});
|
|
@@ -267,7 +267,7 @@ m = new WeakMap(), q = new WeakMap(), G = new WeakMap(), P = new WeakMap(), W =
|
|
|
267
267
|
const e = new URL(location.href);
|
|
268
268
|
e.searchParams.delete(this.id), history.replaceState(history.state, "", e.href);
|
|
269
269
|
}
|
|
270
|
-
},
|
|
270
|
+
}, z = new WeakMap(), A = new WeakMap(), U = new WeakMap(), X = new WeakMap(), B = new WeakMap(), L.stack = new dt();
|
|
271
271
|
let Z = L;
|
|
272
272
|
it && !customElements.get("e-popover") && customElements.define("e-popover", Z);
|
|
273
273
|
var n, g, C, et, Y, j, F, I, st;
|
package/lib/sequence/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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 q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-
|
|
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 q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-Bc5Rwf81.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const M=require("../canvas/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,E,S,m,d,b,g,p,a,v;class B extends H.SourceElement{constructor(e){super();c(this,h,[]);c(this,E,new q.CSSProperty(this,"--fit","contain"));c(this,S,new q.CSSProperty(this,"--autoplay",!1));c(this,m,new q.CSSProperty(this,"--offset-x",.5));c(this,d,new q.CSSProperty(this,"--offset-y",.5));c(this,b,null);c(this,g,0);c(this,p,1);c(this,a,()=>{if(t(this,h).length){const e=t(this,h)[0];t(this,E).current==="cover"?l(this,b,z.cover(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current)):l(this,b,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,b))return;e.detail.context.clearRect(0,0,e.detail.width,e.detail.height);const i=t(this,h)[t(this,g)];i&&e.detail.context.drawImage(i,...t(this,b)),t(this,S).current&&l(this,g,(t(this,g)+1)%t(this,h).length)});k.isBrowser&&(l(this,p,parseInt(((e==null?void 0:e.pad)||this.getAttribute("pad")||"1").toString())),t(this,E).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,g,Math.floor((t(this,h).length-1)*e))}connectedCallback(){super.connectedCallback(),t(this,S).observe(),t(this,E).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,E).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 M.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 P=e.replace(/\{([^}]+)\}/,r.toString().padStart(t(this,p),"0")),C=new Image;C.src=P,u.push(C)}else{const r=new Image;r.src=e,u.push(r)}try{yield Promise.all(u.map((r,P)=>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,E=new WeakMap,S=new WeakMap,m=new WeakMap,d=new WeakMap,b=new WeakMap,g=new WeakMap,p=new WeakMap,a=new WeakMap,v=new WeakMap;k.isBrowser&&!customElements.get("e-sequence")&&customElements.define("e-sequence",B);exports.SequenceElement=B;
|
package/lib/sequence/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { elementResizer as k } from "../element-resizer/index.js";
|
|
|
24
24
|
import { i as q } from "../index-Bv9zgfdb.js";
|
|
25
25
|
import { c as B, a as H } from "../canvas-DeZ0SLUJ.js";
|
|
26
26
|
import "construct-style-sheets-polyfill";
|
|
27
|
-
import { a as W } from "../SourceElement-
|
|
27
|
+
import { a as W } from "../SourceElement-hkzZTDa7.js";
|
|
28
28
|
import "../window-resizer/index.js";
|
|
29
29
|
import "../Store-0BVty6AZ.js";
|
|
30
30
|
import { CanvasElement as A } from "../canvas/index.js";
|
package/lib/source/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-Bc5Rwf81.cjs");exports.Source=e.Source;exports.SourceElement=e.SourceElement;exports.SourceManager=e.SourceManager;exports.SourceSet=e.SourceSet;
|
package/lib/source/index.js
CHANGED
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 i=(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-
|
|
1
|
+
"use strict";var h=e=>{throw TypeError(e)};var m=(e,s,t)=>s.has(e)||h("Cannot "+t);var i=(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-Bc5Rwf81.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const p=require("../index-DekP7OZe.cjs"),b=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");const o=require("../ticker/index.cjs");var r,n,a;class d extends E.SourceElement{constructor(){super(...arguments);u(this,r,0);u(this,n,!1);u(this,a,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>i(this,r)&&c(this,r,t),b.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}}),this.consumerElement.readyState===4&&(o.ticker.unsubscribe(i(this,a)),i(this,n)&&this.sourceManager.current&&this.consumerElement.play())})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{c(this,n,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():c(this,n,!0)),o.ticker.subscribe(i(this,a))}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&this.consumerElement.pause(),this.hasAttribute("release-pause")&&this.consumerElement.pause(),this.hasAttribute("release-stop")&&(this.consumerElement.pause(),this.consumerElement.currentTime=0),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")}),this.addEventListener("click",()=>{this.hasAttribute("click-controls")&&(this.consumerElement.paused?this.consumerElement.play():this.consumerElement.pause())})}disconnectedCallback(){super.disconnectedCallback(),o.ticker.unsubscribe(i(this,a)),c(this,r,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",t&&this.hasAttribute("volume")&&(this.consumerElement.volume=parseFloat(this.getAttribute("volume")||"1"))}}r=new WeakMap,n=new WeakMap,a=new WeakMap;p.isBrowser&&!customElements.get("e-video")&&customElements.define("e-video",d);exports.VideoElement=d;
|
package/lib/video/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var i = (e, s, t) => (
|
|
6
|
-
import { a as d } from "../SourceElement-
|
|
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), o = (e, s, t, m) => (l(e, s, "write to private field"), m ? m.call(e, t) : s.set(e, t), t);
|
|
6
|
+
import { a as d } from "../SourceElement-hkzZTDa7.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as p } from "../index-Bv9zgfdb.js";
|
|
@@ -49,7 +49,7 @@ class f extends d {
|
|
|
49
49
|
return document.createElement("video");
|
|
50
50
|
}
|
|
51
51
|
consumeSource(t) {
|
|
52
|
-
this.consumerElement.src = t || "", this.hasAttribute("volume") && (this.consumerElement.volume = parseFloat(
|
|
52
|
+
this.consumerElement.src = t || "", t && this.hasAttribute("volume") && (this.consumerElement.volume = parseFloat(
|
|
53
53
|
this.getAttribute("volume") || "1"
|
|
54
54
|
));
|
|
55
55
|
}
|
package/lib/youtube/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-
|
|
1
|
+
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-Bc5Rwf81.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const L=require("../index-DekP7OZe.cjs"),T=require("../events-KVanG9sR.cjs"),_=require("../string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");var i,c,n,y,l,f,b,R,p,I;const d=class d extends A.SourceElement{constructor(){super();o(this,p);o(this,i);o(this,c);o(this,n,!1);o(this,y,!1);o(this,l,()=>{u(this,n,e(this,n)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),u(this,i,new window.YT.Player(e(this,c),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,f),onError:e(this,b),onStateChange:e(this,R)}}))});o(this,f,()=>{u(this,y,!0),w(this,p,I).call(this)});o(this,b,t=>{var a,h;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(h=(a=this.consumerElement).onerror)==null||h.call(a,new Event("error"))});o(this,R,()=>{});u(this,c,"yt-"+_.generateId(10)),d.__apiReady||(window.onYouTubeIframeAPIReady=()=>{d.__apiReady=!0,T.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,y)?e(this,i).playVideo():u(this,n,!0))}),this.addEventListener("sourceRelease",()=>{e(this,i)&&this.hasAttribute("capture-autoplay")&&(e(this,i).pauseVideo(),this.hasAttribute("replay")&&e(this,i).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,c),t}consumeSource(t){var a;if(t){if(!document.getElementById("youtube-script")){const h=document.createElement("script");h.id,h.src="https://www.youtube.com/iframe_api";const g=document.getElementsByTagName("script")[0];(a=g.parentNode)==null||a.insertBefore(h,g)}e(this,i)?w(this,p,I).call(this):d.__apiReady?e(this,l).call(this):addEventListener("youTubeIframeAPIReady",e(this,l))}else e(this,i)&&e(this,i).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,i)&&e(this,i).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,l))}};i=new WeakMap,c=new WeakMap,n=new WeakMap,y=new WeakMap,l=new WeakMap,f=new WeakMap,b=new WeakMap,R=new WeakMap,p=new WeakSet,I=function(){var t,a;this.currentURL&&(this.currentURL.startsWith("http")?e(this,i).loadVideoByUrl(this.currentURL):e(this,i).loadVideoById(this.currentURL)),e(this,n)?e(this,i).playVideo():e(this,i).stopVideo(),u(this,n,!1),(a=(t=this.consumerElement).onload)==null||a.call(t,new Event("load"))},d.__apiReady=!1;let m=d;L.isBrowser&&!customElements.get("e-youtube")&&customElements.define("e-youtube",m);exports.YouTubeElement=m;
|
package/lib/youtube/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var L = (s) => {
|
|
|
3
3
|
};
|
|
4
4
|
var b = (s, r, t) => r.has(s) || L("Cannot " + t);
|
|
5
5
|
var e = (s, r, t) => (b(s, r, "read from private field"), t ? t.call(s) : r.get(s)), o = (s, r, t) => r.has(s) ? L("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), u = (s, r, t, a) => (b(s, r, "write to private field"), a ? a.call(s, t) : r.set(s, t), t), E = (s, r, t) => (b(s, r, "access private method"), t);
|
|
6
|
-
import { a as g } from "../SourceElement-
|
|
6
|
+
import { a as g } from "../SourceElement-hkzZTDa7.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as v } from "../index-Bv9zgfdb.js";
|