aptechka 0.50.8 → 0.50.11
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/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +49 -46
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.d.ts +5 -1
- package/lib/loading/index.js +44 -31
- package/lib/morph/Morph.d.ts +5 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +187 -174
- package/lib/popover/PopoverButtonElement.d.ts +1 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +156 -148
- package/lib/utils/events.d.ts +1 -1
- package/package.json +1 -1
package/lib/morph/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
1
|
+
var pt = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), Et = (r) => {
|
|
2
2
|
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var e = (r, t, s) => (
|
|
6
|
-
var
|
|
7
|
-
var f = (
|
|
4
|
+
var $ = (r, t, s) => t.has(r) || Et("Cannot " + s);
|
|
5
|
+
var e = (r, t, s) => ($(r, t, "read from private field"), s ? s.call(r) : t.get(r)), o = (r, t, s) => t.has(r) ? Et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), a = (r, t, s, i) => ($(r, t, "write to private field"), i ? i.call(r, s) : t.set(r, s), s), d = (r, t, s) => ($(r, t, "access private method"), s);
|
|
6
|
+
var M = (r, t, s) => new Promise((i, u) => {
|
|
7
|
+
var f = (h) => {
|
|
8
8
|
try {
|
|
9
|
-
|
|
9
|
+
T(s.next(h));
|
|
10
10
|
} catch (g) {
|
|
11
11
|
u(g);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, O = (h) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
15
|
+
T(s.throw(h));
|
|
16
16
|
} catch (g) {
|
|
17
17
|
u(g);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, T = (h) => h.done ? i(h.value) : Promise.resolve(h.value).then(f, O);
|
|
20
|
+
T((s = s.apply(r, t)).next());
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
import { i as
|
|
24
|
-
import { d as
|
|
25
|
-
import { r as
|
|
26
|
-
import { s as
|
|
27
|
-
import { n as
|
|
28
|
-
import { cssValueParser as
|
|
29
|
-
class
|
|
22
|
+
var gt = (r, t, s) => (t = r[pt("asyncIterator")]) ? t.call(r) : (r = r[pt("iterator")](), t = {}, s = (i, u) => (u = r[i]) && (t[i] = (f) => new Promise((O, T, h) => (f = u.call(r, f), h = f.done, Promise.resolve(f.value).then((g) => O({ value: g, done: h }), T)))), s("next"), s("return"), t);
|
|
23
|
+
import { i as yt } from "../index-euf5anj6.js";
|
|
24
|
+
import { d as U } from "../events-CsVF98U6.js";
|
|
25
|
+
import { r as Mt } from "../polyfills-DJrTJQky.js";
|
|
26
|
+
import { s as Ht } from "../scroll-myLAt-Tq.js";
|
|
27
|
+
import { n as xt, c as vt, s as Nt } from "../url-CfcHdBT6.js";
|
|
28
|
+
import { cssValueParser as Dt } from "../css-value-parser/index.js";
|
|
29
|
+
class wt extends HTMLElement {
|
|
30
30
|
connectedCallback() {
|
|
31
31
|
const t = {
|
|
32
32
|
"aria-live": "assertive",
|
|
@@ -37,72 +37,72 @@ class yt extends HTMLElement {
|
|
|
37
37
|
this.setAttribute(s, i);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
class
|
|
40
|
+
yt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", wt);
|
|
41
|
+
var b, c, H, j, F;
|
|
42
|
+
class Lt {
|
|
43
43
|
constructor(t, s) {
|
|
44
|
-
o(this,
|
|
44
|
+
o(this, b);
|
|
45
45
|
o(this, c);
|
|
46
|
-
o(this,
|
|
47
|
-
o(this,
|
|
46
|
+
o(this, H);
|
|
47
|
+
o(this, j, (t) => {
|
|
48
48
|
t.preventDefault();
|
|
49
49
|
const s = e(this, c).getAttribute(
|
|
50
50
|
"data-history-action"
|
|
51
|
-
) || "push", i = e(this, c).hasAttribute("data-center-scroll"), u = getComputedStyle(e(this, c)).getPropertyValue("--offset-scroll").trim(), f = u ?
|
|
52
|
-
e(this,
|
|
51
|
+
) || "push", i = e(this, c).hasAttribute("data-center-scroll"), u = getComputedStyle(e(this, c)).getPropertyValue("--offset-scroll").trim(), f = u ? Dt.parse(u) : void 0, O = e(this, c).hasAttribute("data-revalidate");
|
|
52
|
+
e(this, b).navigate(e(this, H), {
|
|
53
53
|
historyAction: s,
|
|
54
54
|
centerScroll: i,
|
|
55
55
|
offsetScroll: f,
|
|
56
|
-
revalidate:
|
|
56
|
+
revalidate: O
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
|
-
o(this,
|
|
60
|
-
e(this,
|
|
59
|
+
o(this, F, () => {
|
|
60
|
+
e(this, b).prefetch(e(this, H)), e(this, c).removeEventListener("pointerenter", e(this, F));
|
|
61
61
|
});
|
|
62
|
-
a(this,
|
|
62
|
+
a(this, b, s), a(this, c, t), a(this, H, e(this, c).getAttribute("href") || "/"), e(this, c).addEventListener("click", e(this, j)), this.checkCurrent(location.pathname), e(this, c).hasAttribute("data-prefetch") && e(this, c).addEventListener("pointerenter", e(this, F));
|
|
63
63
|
}
|
|
64
64
|
get element() {
|
|
65
65
|
return e(this, c);
|
|
66
66
|
}
|
|
67
67
|
checkCurrent(t) {
|
|
68
|
-
const s = e(this,
|
|
68
|
+
const s = e(this, b).normalizePath(t), i = e(this, b).normalizePath(e(this, H));
|
|
69
69
|
e(this, c).hasAttribute("data-include") && s.pathname.includes(i.pathname) ? e(this, c).classList.add("current") : i.pathname === s.pathname ? e(this, c).classList.add("current") : e(this, c).classList.remove("current");
|
|
70
70
|
}
|
|
71
71
|
destroy() {
|
|
72
|
-
e(this, c).removeEventListener("click", e(this,
|
|
72
|
+
e(this, c).removeEventListener("click", e(this, j)), e(this, c).removeEventListener("pointerenter", e(this, F)), e(this, c).classList.remove("current");
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
var
|
|
75
|
+
b = new WeakMap(), c = new WeakMap(), H = new WeakMap(), j = new WeakMap(), F = new WeakMap();
|
|
76
|
+
var x, I, p, N, D, P;
|
|
77
77
|
class St {
|
|
78
78
|
constructor(t, s, i) {
|
|
79
|
-
o(this, H);
|
|
80
|
-
o(this, F);
|
|
81
|
-
o(this, p, { x: 0, y: 0 });
|
|
82
79
|
o(this, x);
|
|
83
|
-
o(this,
|
|
84
|
-
o(this,
|
|
85
|
-
|
|
80
|
+
o(this, I);
|
|
81
|
+
o(this, p, { x: 0, y: 0 });
|
|
82
|
+
o(this, N);
|
|
83
|
+
o(this, D, null);
|
|
84
|
+
o(this, P, null);
|
|
85
|
+
a(this, x, t), a(this, I, s), a(this, N, i.cloneNode(!0));
|
|
86
86
|
}
|
|
87
87
|
get pathname() {
|
|
88
|
-
return e(this,
|
|
88
|
+
return e(this, I);
|
|
89
89
|
}
|
|
90
90
|
get scrollState() {
|
|
91
91
|
return e(this, p);
|
|
92
92
|
}
|
|
93
93
|
get document() {
|
|
94
|
-
return e(this,
|
|
94
|
+
return e(this, P);
|
|
95
95
|
}
|
|
96
96
|
cloneDocument() {
|
|
97
|
-
a(this,
|
|
97
|
+
a(this, P, (e(this, D) || e(this, N)).cloneNode(!0));
|
|
98
98
|
}
|
|
99
99
|
get title() {
|
|
100
100
|
let t = "";
|
|
101
|
-
if (e(this,
|
|
102
|
-
t = e(this,
|
|
101
|
+
if (e(this, P).title)
|
|
102
|
+
t = e(this, P).title;
|
|
103
103
|
else {
|
|
104
|
-
const s = e(this,
|
|
105
|
-
t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this,
|
|
104
|
+
const s = e(this, P).querySelector("h1");
|
|
105
|
+
t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, I);
|
|
106
106
|
}
|
|
107
107
|
return t;
|
|
108
108
|
}
|
|
@@ -110,54 +110,63 @@ class St {
|
|
|
110
110
|
e(this, p).x = 0, e(this, p).y = 0;
|
|
111
111
|
}
|
|
112
112
|
clearDocumentState() {
|
|
113
|
-
a(this,
|
|
113
|
+
a(this, D, null);
|
|
114
114
|
}
|
|
115
115
|
saveScrollState() {
|
|
116
|
-
e(this,
|
|
116
|
+
e(this, N).documentElement.hasAttribute(
|
|
117
117
|
"data-no-scroll-restoration"
|
|
118
|
-
) ? (e(this, p).x = 0, e(this, p).y = 0) : (e(this, p).x = e(this,
|
|
118
|
+
) ? (e(this, p).x = 0, e(this, p).y = 0) : (e(this, p).x = e(this, x).scrollElement.scrollLeft, e(this, p).y = e(this, x).scrollElement.scrollTop);
|
|
119
119
|
}
|
|
120
120
|
saveDocumentState() {
|
|
121
|
-
e(this,
|
|
121
|
+
e(this, N).documentElement.hasAttribute(
|
|
122
122
|
"data-no-page-restoration"
|
|
123
|
-
) ? a(this,
|
|
123
|
+
) ? a(this, D, null) : a(this, D, document.cloneNode(!0));
|
|
124
124
|
}
|
|
125
125
|
restoreScrollPosition() {
|
|
126
|
-
e(this,
|
|
126
|
+
e(this, x).scrollElement.scroll({
|
|
127
127
|
top: e(this, p).y,
|
|
128
128
|
left: e(this, p).x
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
class
|
|
132
|
+
x = new WeakMap(), I = new WeakMap(), p = new WeakMap(), N = new WeakMap(), D = new WeakMap(), P = new WeakMap();
|
|
133
|
+
var A, K, E, X, C, m, Y, R, k, L, V, z, l, tt, et, st, bt, it, rt, nt, ot, Z, B;
|
|
134
|
+
class Ot {
|
|
135
135
|
constructor(t) {
|
|
136
|
-
o(this,
|
|
137
|
-
o(this,
|
|
138
|
-
o(this,
|
|
136
|
+
o(this, l);
|
|
137
|
+
o(this, A, null);
|
|
138
|
+
o(this, K, null);
|
|
139
139
|
o(this, E, []);
|
|
140
|
-
o(this,
|
|
141
|
-
o(this,
|
|
140
|
+
o(this, X, new DOMParser());
|
|
141
|
+
o(this, C);
|
|
142
142
|
o(this, m, null);
|
|
143
|
-
o(this,
|
|
144
|
-
o(this,
|
|
145
|
-
o(this,
|
|
146
|
-
o(this,
|
|
143
|
+
o(this, Y);
|
|
144
|
+
o(this, R, []);
|
|
145
|
+
o(this, k, !1);
|
|
146
|
+
o(this, L, null);
|
|
147
147
|
o(this, V, /* @__PURE__ */ new Map());
|
|
148
|
-
o(this,
|
|
149
|
-
o(this,
|
|
148
|
+
o(this, z, null);
|
|
149
|
+
o(this, Z, (t) => M(this, null, function* () {
|
|
150
150
|
var s;
|
|
151
|
-
(s = t.state) != null && s.path && (a(this,
|
|
151
|
+
(s = t.state) != null && s.path && (t.preventDefault(), a(this, k, !0), yield this.navigate(t.state.path, { historyAction: "none" }), a(this, k, !1));
|
|
152
152
|
}));
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
o(this, B, () => {
|
|
154
|
+
const t = e(this, L).scrollTop, s = e(this, L).scrollLeft;
|
|
155
|
+
document.documentElement.classList.toggle("top-scrolled", t > 0), document.documentElement.classList.toggle("left-scrolled", s > 0), U(document, "morphScroll", {
|
|
156
|
+
detail: {
|
|
157
|
+
left: s,
|
|
158
|
+
top: t
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
if (yt) {
|
|
163
|
+
a(this, A, {
|
|
164
|
+
base: xt(t == null ? void 0 : t.base),
|
|
156
165
|
waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
|
|
157
166
|
cachePages: (t == null ? void 0 : t.cachePages) !== !1,
|
|
158
167
|
trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
|
|
159
168
|
scrollSelector: (t == null ? void 0 : t.scrollSelector) || "body"
|
|
160
|
-
}), a(this,
|
|
169
|
+
}), a(this, K, d(this, l, st).call(this, document.body));
|
|
161
170
|
const s = this.normalizePath(
|
|
162
171
|
location.pathname + location.hash
|
|
163
172
|
);
|
|
@@ -170,183 +179,183 @@ class Bt {
|
|
|
170
179
|
), document.documentElement.setAttribute(
|
|
171
180
|
"data-current-leaf",
|
|
172
181
|
s.leaf
|
|
173
|
-
), this.findLinks(), addEventListener("popstate", e(this,
|
|
182
|
+
), this.findLinks(), addEventListener("popstate", e(this, Z)), vt({
|
|
174
183
|
action: "replace",
|
|
175
184
|
pathname: e(this, m),
|
|
176
185
|
searchParameters: s.parameters,
|
|
177
186
|
hash: s.hash
|
|
178
|
-
}), a(this,
|
|
187
|
+
}), a(this, z, new wt()), d(this, l, nt).call(this, document);
|
|
179
188
|
}
|
|
180
189
|
}
|
|
181
190
|
get currentPathname() {
|
|
182
191
|
return e(this, m);
|
|
183
192
|
}
|
|
184
193
|
get previousPathname() {
|
|
185
|
-
return e(this,
|
|
194
|
+
return e(this, Y);
|
|
186
195
|
}
|
|
187
196
|
get links() {
|
|
188
197
|
return e(this, E);
|
|
189
198
|
}
|
|
190
199
|
get scrollElement() {
|
|
191
|
-
return e(this,
|
|
200
|
+
return e(this, L);
|
|
192
201
|
}
|
|
193
202
|
normalizePath(t) {
|
|
194
|
-
return
|
|
195
|
-
base: e(this,
|
|
196
|
-
trailingSlash: e(this,
|
|
203
|
+
return Nt(t, {
|
|
204
|
+
base: e(this, A).base,
|
|
205
|
+
trailingSlash: e(this, A).trailingSlash
|
|
197
206
|
});
|
|
198
207
|
}
|
|
199
208
|
prefetch(t) {
|
|
200
|
-
return
|
|
209
|
+
return M(this, null, function* () {
|
|
201
210
|
const s = this.normalizePath(t);
|
|
202
|
-
d(this,
|
|
211
|
+
d(this, l, et).call(this, s.pathname);
|
|
203
212
|
});
|
|
204
213
|
}
|
|
205
|
-
navigate(
|
|
206
|
-
return
|
|
214
|
+
navigate(O) {
|
|
215
|
+
return M(this, arguments, function* (t, {
|
|
207
216
|
historyAction: s = "push",
|
|
208
217
|
centerScroll: i,
|
|
209
218
|
offsetScroll: u,
|
|
210
219
|
revalidate: f
|
|
211
220
|
} = {}) {
|
|
212
|
-
if (e(this,
|
|
221
|
+
if (e(this, R).length)
|
|
213
222
|
return;
|
|
214
|
-
const
|
|
215
|
-
let { pathname:
|
|
216
|
-
if (e(this,
|
|
217
|
-
e(this,
|
|
223
|
+
const T = this.normalizePath(t);
|
|
224
|
+
let { pathname: h, hash: g, parameters: Pt, leaf: At } = T;
|
|
225
|
+
if (e(this, C) === h || e(this, m) === h) {
|
|
226
|
+
e(this, k) || d(this, l, ot).call(this, g || 0, {
|
|
218
227
|
centerScroll: i,
|
|
219
228
|
offsetScroll: u,
|
|
220
229
|
behavior: "smooth"
|
|
221
230
|
});
|
|
222
231
|
return;
|
|
223
232
|
}
|
|
224
|
-
a(this,
|
|
225
|
-
|
|
233
|
+
a(this, C, h), e(this, E).forEach((q) => {
|
|
234
|
+
q.checkCurrent(h);
|
|
226
235
|
});
|
|
227
236
|
try {
|
|
228
|
-
let
|
|
237
|
+
let q = !0;
|
|
229
238
|
if (this.preprocessor)
|
|
230
239
|
try {
|
|
231
|
-
yield new Promise((n,
|
|
232
|
-
var
|
|
233
|
-
(
|
|
234
|
-
pathname:
|
|
240
|
+
yield new Promise((n, y) => {
|
|
241
|
+
var w;
|
|
242
|
+
(w = this.preprocessor) == null || w.call(this, {
|
|
243
|
+
pathname: h,
|
|
235
244
|
resolve: n,
|
|
236
|
-
reject:
|
|
245
|
+
reject: y
|
|
237
246
|
});
|
|
238
247
|
});
|
|
239
248
|
} catch (n) {
|
|
240
|
-
n ? console.error(n) : console.log("Route change canceled"),
|
|
249
|
+
n ? console.error(n) : console.log("Route change canceled"), q = !1;
|
|
241
250
|
}
|
|
242
|
-
if (!
|
|
251
|
+
if (!q || e(this, C) !== h) {
|
|
243
252
|
e(this, E).forEach((n) => {
|
|
244
253
|
n.checkCurrent(e(this, m));
|
|
245
254
|
});
|
|
246
255
|
return;
|
|
247
256
|
}
|
|
248
|
-
const
|
|
249
|
-
if (e(this,
|
|
257
|
+
const at = yield d(this, l, tt).call(this, e(this, m)), S = yield d(this, l, tt).call(this, h, f);
|
|
258
|
+
if (e(this, C) !== h) {
|
|
250
259
|
e(this, E).forEach((n) => {
|
|
251
260
|
n.checkCurrent(e(this, m));
|
|
252
261
|
});
|
|
253
262
|
return;
|
|
254
263
|
}
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
pathname:
|
|
264
|
+
at.saveScrollState(), at.saveDocumentState(), e(this, k) || (S.clearScrollState(), S.clearDocumentState()), S.cloneDocument(), e(this, z).textContent = S.title, document.body.appendChild(e(this, z));
|
|
265
|
+
const lt = {
|
|
266
|
+
pathname: h
|
|
258
267
|
};
|
|
259
|
-
|
|
260
|
-
detail:
|
|
268
|
+
U(document, "morphStart", {
|
|
269
|
+
detail: lt
|
|
261
270
|
});
|
|
262
|
-
const ht = Array.from(document.head.children),
|
|
263
|
-
|
|
271
|
+
const ht = Array.from(document.head.children), ct = Array.from(S.document.head.children), ut = d(this, l, bt).call(this, ht, ct), Ct = d(this, l, it).call(this, ht, ut), G = d(this, l, it).call(this, ct, ut);
|
|
272
|
+
G.forEach((n, y) => {
|
|
264
273
|
if (n.tagName === "SCRIPT" && n.getAttribute("src")) {
|
|
265
|
-
const
|
|
266
|
-
|
|
274
|
+
const w = document.createElement("script");
|
|
275
|
+
w.type = "module", w.src = n.getAttribute("src"), G[y] = w;
|
|
267
276
|
}
|
|
268
|
-
}),
|
|
277
|
+
}), G.forEach((n) => {
|
|
269
278
|
document.head.appendChild(n);
|
|
270
279
|
});
|
|
271
|
-
const
|
|
280
|
+
const _ = G.filter((n) => {
|
|
272
281
|
if (n.hasAttribute("data-no-waiting"))
|
|
273
282
|
return !1;
|
|
274
|
-
if (d(this,
|
|
283
|
+
if (d(this, l, rt).call(this, n))
|
|
275
284
|
return !0;
|
|
276
285
|
});
|
|
277
|
-
e(this,
|
|
278
|
-
let
|
|
286
|
+
e(this, A).waitForHeadToLoad && _.length && (yield new Promise((n) => M(this, null, function* () {
|
|
287
|
+
let y = 0;
|
|
279
288
|
try {
|
|
280
|
-
for (var
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
289
|
+
for (var w = gt(_), mt, W, ft; mt = !(W = yield w.next()).done; mt = !1) {
|
|
290
|
+
const J = W.value;
|
|
291
|
+
J.onload = () => {
|
|
292
|
+
y++, y === _.length && n();
|
|
284
293
|
};
|
|
285
294
|
}
|
|
286
|
-
} catch (
|
|
287
|
-
|
|
295
|
+
} catch (W) {
|
|
296
|
+
ft = [W];
|
|
288
297
|
} finally {
|
|
289
298
|
try {
|
|
290
|
-
|
|
299
|
+
mt && (W = w.return) && (yield W.call(w));
|
|
291
300
|
} finally {
|
|
292
|
-
if (
|
|
293
|
-
throw
|
|
301
|
+
if (ft)
|
|
302
|
+
throw ft[0];
|
|
294
303
|
}
|
|
295
304
|
}
|
|
296
305
|
})));
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
n.hasAttribute("data-permanent") || (d(this,
|
|
306
|
+
const dt = [];
|
|
307
|
+
Ct.forEach((n) => {
|
|
308
|
+
n.hasAttribute("data-permanent") || (d(this, l, rt).call(this, n) ? dt.push(n) : n.remove());
|
|
300
309
|
});
|
|
301
|
-
const
|
|
302
|
-
d(this,
|
|
310
|
+
const kt = d(this, l, st).call(this, S.document.body);
|
|
311
|
+
d(this, l, nt).call(this, S.document), document.documentElement.setAttribute("data-current-pathname", h), document.documentElement.setAttribute("data-current-leaf", At), vt({
|
|
303
312
|
action: s,
|
|
304
|
-
pathname:
|
|
305
|
-
searchParameters:
|
|
313
|
+
pathname: h,
|
|
314
|
+
searchParameters: Pt,
|
|
306
315
|
hash: g
|
|
307
|
-
}), e(this,
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
311
|
-
|
|
316
|
+
}), e(this, z).remove(), a(this, Y, e(this, m)), a(this, m, h), e(this, K).forEach((n, y) => {
|
|
317
|
+
const w = kt[y], mt = getComputedStyle(n).getPropertyValue("--morph-duration"), W = [...w.childNodes];
|
|
318
|
+
if (mt) {
|
|
319
|
+
const ft = [...n.childNodes];
|
|
320
|
+
ft.forEach((v) => {
|
|
312
321
|
v instanceof HTMLElement && v.classList.add("old");
|
|
313
|
-
}),
|
|
322
|
+
}), W.forEach((v) => {
|
|
314
323
|
v instanceof HTMLElement && v.classList.add("new");
|
|
315
|
-
}), n.prepend(...
|
|
316
|
-
|
|
324
|
+
}), n.prepend(...W), Mt(() => {
|
|
325
|
+
W.forEach((v) => {
|
|
317
326
|
v instanceof HTMLElement && v.classList.add("in");
|
|
318
327
|
});
|
|
319
328
|
});
|
|
320
|
-
const
|
|
329
|
+
const J = {
|
|
321
330
|
morphElement: n,
|
|
322
|
-
pathname:
|
|
331
|
+
pathname: h
|
|
323
332
|
};
|
|
324
|
-
|
|
325
|
-
detail:
|
|
333
|
+
U(document, "morphNewChildrenAdded", {
|
|
334
|
+
detail: J
|
|
326
335
|
});
|
|
327
|
-
const
|
|
336
|
+
const Tt = new Promise((v) => {
|
|
328
337
|
setTimeout(() => {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}),
|
|
332
|
-
detail:
|
|
338
|
+
ft.forEach((Q) => Q.remove()), W.forEach((Q) => {
|
|
339
|
+
Q instanceof HTMLElement && Q.classList.remove("in", "new");
|
|
340
|
+
}), U(document, "morphOldChildrenRemoved", {
|
|
341
|
+
detail: J
|
|
333
342
|
}), v();
|
|
334
|
-
}, (parseFloat(
|
|
343
|
+
}, (parseFloat(mt) || 0) * 1e3 + 10);
|
|
335
344
|
});
|
|
336
|
-
e(this,
|
|
345
|
+
e(this, R).push(Tt);
|
|
337
346
|
} else
|
|
338
|
-
n.innerHTML = "", n.append(...
|
|
339
|
-
}), g ? (S.clearScrollState(), d(this,
|
|
340
|
-
detail:
|
|
347
|
+
n.innerHTML = "", n.append(...W);
|
|
348
|
+
}), g ? (S.clearScrollState(), d(this, l, ot).call(this, g, { centerScroll: i, offsetScroll: u })) : e(this, k) && S.restoreScrollPosition(), yield Promise.all(e(this, R)), dt.forEach((n) => n.remove()), a(this, R, []), this.findLinks(), U(document, "morphComplete", {
|
|
349
|
+
detail: lt
|
|
341
350
|
}), window.dispatchEvent(new Event("resize"));
|
|
342
|
-
} catch (
|
|
343
|
-
console.error(
|
|
351
|
+
} catch (q) {
|
|
352
|
+
console.error(q);
|
|
344
353
|
}
|
|
345
|
-
a(this,
|
|
354
|
+
a(this, C, void 0);
|
|
346
355
|
});
|
|
347
356
|
}
|
|
348
357
|
addLink(t) {
|
|
349
|
-
e(this, E).push(new
|
|
358
|
+
e(this, E).push(new Lt(t, this));
|
|
350
359
|
}
|
|
351
360
|
addLinks(t) {
|
|
352
361
|
t.forEach((s) => {
|
|
@@ -365,47 +374,51 @@ class Bt {
|
|
|
365
374
|
return ((i = s.getAttribute("href")) == null ? void 0 : i.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]");
|
|
366
375
|
}
|
|
367
376
|
);
|
|
368
|
-
e(this, E).forEach((s) => s.destroy()), a(this, E, t.map((s) => new
|
|
377
|
+
e(this, E).forEach((s) => s.destroy()), a(this, E, t.map((s) => new Lt(s, this)));
|
|
369
378
|
}
|
|
370
379
|
}
|
|
371
|
-
|
|
372
|
-
return
|
|
380
|
+
A = new WeakMap(), K = new WeakMap(), E = new WeakMap(), X = new WeakMap(), C = new WeakMap(), m = new WeakMap(), Y = new WeakMap(), R = new WeakMap(), k = new WeakMap(), L = new WeakMap(), V = new WeakMap(), z = new WeakMap(), l = new WeakSet(), tt = function(t, s = !1) {
|
|
381
|
+
return M(this, null, function* () {
|
|
373
382
|
let i = e(this, V).get(t);
|
|
374
|
-
return (!i || s) && (i = yield d(this,
|
|
383
|
+
return (!i || s) && (i = yield d(this, l, et).call(this, t)), i;
|
|
375
384
|
});
|
|
376
|
-
},
|
|
377
|
-
return
|
|
378
|
-
const i = yield (yield fetch(t)).text(), u = e(this,
|
|
385
|
+
}, et = function(t) {
|
|
386
|
+
return M(this, null, function* () {
|
|
387
|
+
const i = yield (yield fetch(t)).text(), u = e(this, X).parseFromString(i, "text/html"), f = new St(this, t, u);
|
|
379
388
|
return e(this, V).set(t, f), f;
|
|
380
389
|
});
|
|
381
|
-
},
|
|
390
|
+
}, st = function(t) {
|
|
382
391
|
const s = [...t.querySelectorAll("[data-morph]")];
|
|
383
392
|
return s.length ? s : [t];
|
|
384
|
-
},
|
|
393
|
+
}, bt = function(t, s) {
|
|
385
394
|
return t.filter(
|
|
386
395
|
(i) => s.find(
|
|
387
396
|
(u) => u.outerHTML === i.outerHTML
|
|
388
397
|
)
|
|
389
398
|
);
|
|
390
|
-
},
|
|
399
|
+
}, it = function(t, s) {
|
|
391
400
|
return t.filter(
|
|
392
401
|
(i) => !s.find(
|
|
393
402
|
(u) => u.outerHTML === i.outerHTML
|
|
394
403
|
)
|
|
395
404
|
);
|
|
396
|
-
}, it = function(t) {
|
|
397
|
-
return t.tagName === "SCRIPT" || t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
|
|
398
405
|
}, rt = function(t) {
|
|
399
|
-
|
|
400
|
-
}, nt = function(t
|
|
406
|
+
return t.tagName === "SCRIPT" || t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
|
|
407
|
+
}, nt = function(t) {
|
|
408
|
+
var s, i;
|
|
409
|
+
(s = e(this, L)) == null || s.removeEventListener(
|
|
410
|
+
"scroll",
|
|
411
|
+
e(this, B)
|
|
412
|
+
), a(this, L, t.querySelector(e(this, A).scrollSelector) || t.documentElement), (i = e(this, L)) == null || i.addEventListener("scroll", e(this, B)), e(this, B).call(this);
|
|
413
|
+
}, ot = function(t, s) {
|
|
401
414
|
const i = typeof t == "string" ? document.getElementById(t) : t;
|
|
402
|
-
(typeof i == "number" || i) &&
|
|
403
|
-
scrollElement: e(this,
|
|
415
|
+
(typeof i == "number" || i) && Ht(i, {
|
|
416
|
+
scrollElement: e(this, L),
|
|
404
417
|
behavior: (s == null ? void 0 : s.behavior) || "instant",
|
|
405
418
|
center: s == null ? void 0 : s.centerScroll,
|
|
406
419
|
offset: s == null ? void 0 : s.offsetScroll
|
|
407
420
|
});
|
|
408
|
-
},
|
|
421
|
+
}, Z = new WeakMap(), B = new WeakMap();
|
|
409
422
|
export {
|
|
410
|
-
|
|
423
|
+
Ot as Morph
|
|
411
424
|
};
|
|
@@ -6,6 +6,7 @@ export declare class PopoverButtonElement extends HTMLElement {
|
|
|
6
6
|
constructor();
|
|
7
7
|
get type(): CSSProperty<PopoverButtonType>;
|
|
8
8
|
get popoverElement(): PopoverElement | undefined;
|
|
9
|
+
changePopover(targetId: string): void;
|
|
9
10
|
protected connectedCallback(): void;
|
|
10
11
|
protected disconnectedCallback(): void;
|
|
11
12
|
}
|