aptechka 0.5.39 → 0.5.40
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/source/index.cjs +2 -2
- package/lib/source/index.js +44 -43
- package/package.json +1 -1
package/lib/source/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var y=(i,r,t)=>{if(!r.has(i))throw TypeError("Cannot "+t)};var e=(i,r,t)=>(y(i,r,"read from private field"),t?t.call(i):r.get(i)),a=(i,r,t)=>{if(r.has(i))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(i):r.set(i,t)},u=(i,r,t,o)=>(y(i,r,"write to private field"),o?o.call(i,t):r.set(i,t),t);var p=(i,r,t)=>(y(i,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../SourceManager-vSlsMKUE.cjs"),M=require("../custom-element/index.cjs"),w=require("../loading/index.cjs"),q=require("../class-linked-status/index.cjs"),x=require("../browser-CpzFX2xg.cjs"),A=require("../string-DhgS_iFl.cjs");let T=0;var h,s,c,f,l,d,n,m,g,v,E,b,C;class z extends M.CustomElement{constructor(){super();a(this,g);a(this,h,null);a(this,s,null);a(this,c,!1);a(this,f,!1);a(this,l,!1);a(this,d,"");a(this,n,new q.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1}));a(this,m,null);a(this,E,t=>{const o=t[0];e(this,l)&&(!e(this,f)||this.hasAttribute("reload-source"))&&o.isIntersecting&&(e(this,h).current&&e(this,h).current!==e(this,h).previous&&p(this,g,v).call(this,e(this,h).current),u(this,f,!0)),o.isIntersecting?this.dispatchEvent(new CustomEvent("sourceCapture")):(this.hasAttribute("reload-source")&&p(this,g,v).call(this,void 0),this.dispatchEvent(new CustomEvent("sourceRelease")))});a(this,b,()=>{e(this,n).set("loaded",!0),e(this,n).set("error",!1),e(this,n).set("loading",!1),!e(this,l)&&!e(this,c)&&w.loading.setLoaded(e(this,d),1),u(this,c,!0)});a(this,C,t=>{e(this,n).set("loaded",!1),e(this,n).set("error",!0),e(this,n).set("loading",!1),!e(this,l)&&!e(this,c)&&w.loading.setError(e(this,d),t),u(this,c,!0)});x.isBrowser&&(u(this,d,`source-consumer-${++T}`),u(this,m,new IntersectionObserver(e(this,E))))}get consumerElement(){return e(this,s)}get sourceManager(){return e(this,h)}get status(){return e(this,n)}get isLazy(){return e(this,l)}connectedCallback(){const t=this.getAttribute("srcset");t&&(u(this,s,this.createConsumer()),e(this,s).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,e(this,s).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const S=o.nodeValue||""
|
|
5
|
+
`,e(this,s).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const S=o.nodeValue||"",k=A.kebabToCamel(o.name);k in e(this,s)&&(e(this,s)[k]=S||!0)}}),this.appendChild(e(this,s)),u(this,h,new L.SourceManager({srcset:t})),u(this,l,this.hasAttribute("lazy")),e(this,h).subscribe(o=>{(!e(this,l)||e(this,l)&&e(this,f))&&p(this,g,v).call(this,o.current)}),e(this,m).observe(this),e(this,h).connect())}disconnectedCallback(){e(this,m).disconnect(),e(this,h).close(),e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,e(this,s).remove(),e(this,n).reset()}}h=new WeakMap,s=new WeakMap,c=new WeakMap,f=new WeakMap,l=new WeakMap,d=new WeakMap,n=new WeakMap,m=new WeakMap,g=new WeakSet,v=function(t){if(e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,e(this,n).set("loaded",!1),e(this,n).set("error",!1),e(this,n).set("loading",!1),t){const o=this.hasAttribute("keep-source-parameters");e(this,n).set("loading",!0);const S=o?t.url:t.name+t.extension;this.consumeSource(S),!e(this,l)&&!e(this,c)&&w.loading.setTotal(e(this,d),1),e(this,s).onloadeddata=()=>{e(this,b).call(this)},e(this,s).onload=()=>{e(this,b).call(this)},e(this,s).onerror=()=>{e(this,C).call(this,S)}}else this.consumeSource(null)},E=new WeakMap,b=new WeakMap,C=new WeakMap;exports.Source=L.Source;exports.SourceManager=L.SourceManager;exports.SourceSet=L.SourceSet;exports.SourceElement=z;
|
package/lib/source/index.js
CHANGED
|
@@ -2,55 +2,56 @@ var L = (i, r, s) => {
|
|
|
2
2
|
if (!r.has(i))
|
|
3
3
|
throw TypeError("Cannot " + s);
|
|
4
4
|
};
|
|
5
|
-
var t = (i, r, s) => (L(i, r, "read from private field"), s ? s.call(i) : r.get(i)),
|
|
5
|
+
var t = (i, r, s) => (L(i, r, "read from private field"), s ? s.call(i) : r.get(i)), a = (i, r, s) => {
|
|
6
6
|
if (r.has(i))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
r instanceof WeakSet ? r.add(i) : r.set(i, s);
|
|
9
9
|
}, u = (i, r, s, n) => (L(i, r, "write to private field"), n ? n.call(i, s) : r.set(i, s), s);
|
|
10
10
|
var v = (i, r, s) => (L(i, r, "access private method"), s);
|
|
11
11
|
import { S as y } from "../SourceManager-Q-PB-Rkh.js";
|
|
12
|
-
import { a as
|
|
12
|
+
import { a as j, b as q } from "../SourceManager-Q-PB-Rkh.js";
|
|
13
13
|
import { CustomElement as A } from "../custom-element/index.js";
|
|
14
|
-
import { loading as
|
|
15
|
-
import { ClassLinkedStatus as
|
|
16
|
-
import { i as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
import { loading as k } from "../loading/index.js";
|
|
15
|
+
import { ClassLinkedStatus as x } from "../class-linked-status/index.js";
|
|
16
|
+
import { i as z } from "../browser-0zX67oeU.js";
|
|
17
|
+
import { k as I } from "../string-f0Dnk0L1.js";
|
|
18
|
+
let M = 0;
|
|
19
|
+
var h, e, c, f, l, d, o, m, p, C, S, g, E;
|
|
20
|
+
class R extends A {
|
|
20
21
|
constructor() {
|
|
21
22
|
super();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
a(this, p);
|
|
24
|
+
a(this, h, null);
|
|
25
|
+
a(this, e, null);
|
|
26
|
+
a(this, c, !1);
|
|
27
|
+
a(this, f, !1);
|
|
28
|
+
a(this, l, !1);
|
|
29
|
+
a(this, d, "");
|
|
30
|
+
a(this, o, new x(this, {
|
|
30
31
|
loading: !1,
|
|
31
32
|
loaded: !1,
|
|
32
33
|
error: !1
|
|
33
34
|
}));
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
a(this, m, null);
|
|
36
|
+
a(this, S, (s) => {
|
|
36
37
|
const n = s[0];
|
|
37
|
-
t(this, l) && (!t(this, f) || this.hasAttribute("reload-source")) && n.isIntersecting && (t(this,
|
|
38
|
+
t(this, l) && (!t(this, f) || this.hasAttribute("reload-source")) && n.isIntersecting && (t(this, h).current && t(this, h).current !== t(this, h).previous && v(this, p, C).call(this, t(this, h).current), u(this, f, !0)), n.isIntersecting ? this.dispatchEvent(new CustomEvent("sourceCapture")) : (this.hasAttribute("reload-source") && v(this, p, C).call(this, void 0), this.dispatchEvent(new CustomEvent("sourceRelease")));
|
|
38
39
|
});
|
|
39
|
-
|
|
40
|
-
t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) &&
|
|
40
|
+
a(this, g, () => {
|
|
41
|
+
t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) && k.setLoaded(t(this, d), 1), u(this, c, !0);
|
|
41
42
|
});
|
|
42
|
-
|
|
43
|
-
t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) &&
|
|
43
|
+
a(this, E, (s) => {
|
|
44
|
+
t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) && k.setError(t(this, d), s), u(this, c, !0);
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
-
t(this,
|
|
46
|
+
z && (u(this, d, `source-consumer-${++M}`), u(this, m, new IntersectionObserver(
|
|
47
|
+
t(this, S)
|
|
47
48
|
)));
|
|
48
49
|
}
|
|
49
50
|
get consumerElement() {
|
|
50
51
|
return t(this, e);
|
|
51
52
|
}
|
|
52
53
|
get sourceManager() {
|
|
53
|
-
return t(this,
|
|
54
|
+
return t(this, h);
|
|
54
55
|
}
|
|
55
56
|
get status() {
|
|
56
57
|
return t(this, o);
|
|
@@ -66,37 +67,37 @@ class F extends A {
|
|
|
66
67
|
height: 100%;
|
|
67
68
|
`, t(this, e).classList.add("source-consumer"), Array.from(this.attributes).forEach((n) => {
|
|
68
69
|
if (n.name !== "srcset") {
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
const b = n.nodeValue || "", w = I(n.name);
|
|
71
|
+
w in t(this, e) && (t(this, e)[w] = b || !0);
|
|
71
72
|
}
|
|
72
|
-
}), this.appendChild(t(this, e)), u(this,
|
|
73
|
+
}), this.appendChild(t(this, e)), u(this, h, new y({
|
|
73
74
|
srcset: s
|
|
74
|
-
})), u(this, l, this.hasAttribute("lazy")), t(this,
|
|
75
|
-
(!t(this, l) || t(this, l) && t(this, f)) && v(this, p,
|
|
76
|
-
}), t(this, m).observe(this), t(this,
|
|
75
|
+
})), u(this, l, this.hasAttribute("lazy")), t(this, h).subscribe((n) => {
|
|
76
|
+
(!t(this, l) || t(this, l) && t(this, f)) && v(this, p, C).call(this, n.current);
|
|
77
|
+
}), t(this, m).observe(this), t(this, h).connect());
|
|
77
78
|
}
|
|
78
79
|
disconnectedCallback() {
|
|
79
|
-
t(this, m).disconnect(), t(this,
|
|
80
|
+
t(this, m).disconnect(), t(this, h).close(), t(this, e).onloadeddata = null, t(this, e).onload = null, t(this, e).onerror = null, t(this, e).remove(), t(this, o).reset();
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
h = new WeakMap(), e = new WeakMap(), c = new WeakMap(), f = new WeakMap(), l = new WeakMap(), d = new WeakMap(), o = new WeakMap(), m = new WeakMap(), p = new WeakSet(), C = function(s) {
|
|
83
84
|
if (t(this, e).onloadeddata = null, t(this, e).onload = null, t(this, e).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), s) {
|
|
84
85
|
const n = this.hasAttribute("keep-source-parameters");
|
|
85
86
|
t(this, o).set("loading", !0);
|
|
86
|
-
const
|
|
87
|
-
this.consumeSource(
|
|
88
|
-
t(this,
|
|
87
|
+
const b = n ? s.url : s.name + s.extension;
|
|
88
|
+
this.consumeSource(b), !t(this, l) && !t(this, c) && k.setTotal(t(this, d), 1), t(this, e).onloadeddata = () => {
|
|
89
|
+
t(this, g).call(this);
|
|
89
90
|
}, t(this, e).onload = () => {
|
|
90
|
-
t(this,
|
|
91
|
+
t(this, g).call(this);
|
|
91
92
|
}, t(this, e).onerror = () => {
|
|
92
|
-
t(this,
|
|
93
|
+
t(this, E).call(this, b);
|
|
93
94
|
};
|
|
94
95
|
} else
|
|
95
96
|
this.consumeSource(null);
|
|
96
|
-
},
|
|
97
|
+
}, S = new WeakMap(), g = new WeakMap(), E = new WeakMap();
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
j as Source,
|
|
100
|
+
R as SourceElement,
|
|
100
101
|
y as SourceManager,
|
|
101
|
-
|
|
102
|
+
q as SourceSet
|
|
102
103
|
};
|