@ssgoi/core 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -43
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +366 -321
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/observe-ssgoi-transitions.d.ts +3 -0
- package/dist/ssgoi-transition/observe-ssgoi-transitions.d.ts.map +1 -0
- package/dist/transitions/axis/index.d.ts +3 -3
- package/dist/transitions/axis/index.d.ts.map +1 -1
- package/dist/transitions/drill/index.d.ts +3 -3
- package/dist/transitions/drill/index.d.ts.map +1 -1
- package/dist/transitions/sheet/index.d.ts +3 -3
- package/dist/transitions/sheet/index.d.ts.map +1 -1
- package/dist/transitions/utils.d.ts +1 -1
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/internal.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { A as
|
|
5
|
-
import { M as
|
|
6
|
-
class
|
|
1
|
+
var ft = Object.defineProperty;
|
|
2
|
+
var dt = (t, n, e) => n in t ? ft(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var F = (t, n, e) => dt(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { A as ht } from "./multi-animation-CnxqLEka.js";
|
|
5
|
+
import { M as $t, W as qt } from "./multi-animation-CnxqLEka.js";
|
|
6
|
+
class mt extends ht {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
F(this, "child", null);
|
|
10
|
+
F(this, "_state", "idle");
|
|
11
|
+
F(this, "_settled", !1);
|
|
12
|
+
F(this, "listeners", /* @__PURE__ */ new Set());
|
|
13
13
|
}
|
|
14
|
-
attach(
|
|
14
|
+
attach(e) {
|
|
15
15
|
const o = this.child;
|
|
16
|
-
if (this.child =
|
|
17
|
-
const
|
|
18
|
-
o.complete(),
|
|
16
|
+
if (this.child = e, this._settled = !1, o) {
|
|
17
|
+
const l = o.getPose();
|
|
18
|
+
o.complete(), e.matchInto(l);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
e.playbackRate = this.playbackRate;
|
|
21
|
+
const i = e.onComplete;
|
|
22
|
+
e.onComplete = () => {
|
|
23
|
+
i == null || i(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
|
|
24
24
|
};
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
}, this._state === "paused" ?
|
|
25
|
+
const f = e.onUpdate;
|
|
26
|
+
e.onUpdate = (l) => {
|
|
27
|
+
var d;
|
|
28
|
+
f == null || f(l), (d = this.onUpdate) == null || d.call(this, l), this.notify();
|
|
29
|
+
}, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
|
|
30
30
|
}
|
|
31
31
|
play() {
|
|
32
|
-
var
|
|
33
|
-
this._state = "playing", this._settled = !1, (
|
|
32
|
+
var e;
|
|
33
|
+
this._state = "playing", this._settled = !1, (e = this.child) == null || e.play(), this.notify();
|
|
34
34
|
}
|
|
35
35
|
reverse() {
|
|
36
|
-
var
|
|
37
|
-
this._state = "reversing", this._settled = !1, (
|
|
36
|
+
var e;
|
|
37
|
+
this._state = "reversing", this._settled = !1, (e = this.child) == null || e.reverse(), this.notify();
|
|
38
38
|
}
|
|
39
39
|
pause() {
|
|
40
|
-
var
|
|
41
|
-
this._state = "paused", (
|
|
40
|
+
var e;
|
|
41
|
+
this._state = "paused", (e = this.child) == null || e.pause(), this.notify();
|
|
42
42
|
}
|
|
43
43
|
complete() {
|
|
44
|
-
var
|
|
45
|
-
(
|
|
44
|
+
var e;
|
|
45
|
+
(e = this.child) == null || e.complete(), this.notify();
|
|
46
46
|
}
|
|
47
47
|
get isAnimating() {
|
|
48
|
-
var
|
|
49
|
-
return ((
|
|
48
|
+
var e;
|
|
49
|
+
return ((e = this.child) == null ? void 0 : e.isAnimating) ?? !1;
|
|
50
50
|
}
|
|
51
51
|
get isPaused() {
|
|
52
52
|
return this._state === "paused";
|
|
@@ -55,459 +55,504 @@ class fe extends ue {
|
|
|
55
55
|
return this._settled && !this.child;
|
|
56
56
|
}
|
|
57
57
|
get isReversing() {
|
|
58
|
-
var
|
|
59
|
-
return ((
|
|
58
|
+
var e;
|
|
59
|
+
return ((e = this.child) == null ? void 0 : e.isReversing) ?? this._state === "reversing";
|
|
60
60
|
}
|
|
61
61
|
get progress() {
|
|
62
|
-
var
|
|
63
|
-
return ((
|
|
62
|
+
var e;
|
|
63
|
+
return ((e = this.child) == null ? void 0 : e.progress) ?? 0;
|
|
64
64
|
}
|
|
65
|
-
findTimeForProgress(
|
|
65
|
+
findTimeForProgress(e) {
|
|
66
66
|
var o;
|
|
67
|
-
return ((o = this.child) == null ? void 0 : o.findTimeForProgress(
|
|
67
|
+
return ((o = this.child) == null ? void 0 : o.findTimeForProgress(e)) ?? null;
|
|
68
68
|
}
|
|
69
69
|
get playbackRate() {
|
|
70
70
|
return super.playbackRate;
|
|
71
71
|
}
|
|
72
|
-
set playbackRate(
|
|
73
|
-
super.playbackRate =
|
|
72
|
+
set playbackRate(e) {
|
|
73
|
+
super.playbackRate = e, this.child && (this.child.playbackRate = e), this.notify();
|
|
74
74
|
}
|
|
75
75
|
getPose() {
|
|
76
|
-
var
|
|
77
|
-
return ((
|
|
76
|
+
var e;
|
|
77
|
+
return ((e = this.child) == null ? void 0 : e.getPose()) ?? [];
|
|
78
78
|
}
|
|
79
79
|
getTimeline() {
|
|
80
|
-
var
|
|
81
|
-
return ((
|
|
80
|
+
var e;
|
|
81
|
+
return ((e = this.child) == null ? void 0 : e.getTimeline()) ?? [];
|
|
82
82
|
}
|
|
83
|
-
matchInto(
|
|
83
|
+
matchInto(e) {
|
|
84
84
|
var o;
|
|
85
|
-
(o = this.child) == null || o.matchInto(
|
|
85
|
+
(o = this.child) == null || o.matchInto(e);
|
|
86
86
|
}
|
|
87
87
|
/** Currently attached child, or null when nothing is playing. */
|
|
88
88
|
get activeChild() {
|
|
89
89
|
return this.child;
|
|
90
90
|
}
|
|
91
91
|
/** Subscribe to host state changes. Returns an unsubscribe fn. */
|
|
92
|
-
subscribe(
|
|
93
|
-
return this.listeners.add(
|
|
94
|
-
this.listeners.delete(
|
|
92
|
+
subscribe(e) {
|
|
93
|
+
return this.listeners.add(e), () => {
|
|
94
|
+
this.listeners.delete(e);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
notify() {
|
|
98
|
-
for (const
|
|
98
|
+
for (const e of this.listeners) e();
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
let n =
|
|
101
|
+
const gt = (t, n) => {
|
|
102
|
+
var e;
|
|
103
|
+
t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((e = n == null ? void 0 : n.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, t.style.left = "0";
|
|
104
|
+
}, Q = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), yt = (t) => {
|
|
105
|
+
let n = t.parentElement;
|
|
106
106
|
for (; n && n !== document.body; ) {
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
107
|
+
const e = window.getComputedStyle(n);
|
|
108
|
+
if (Q.has(e.overflowY) || Q.has(e.overflowX))
|
|
109
109
|
return n;
|
|
110
110
|
n = n.parentElement;
|
|
111
111
|
}
|
|
112
112
|
return document.documentElement;
|
|
113
|
-
},
|
|
114
|
-
let n =
|
|
113
|
+
}, pt = (t) => {
|
|
114
|
+
let n = t.parentElement;
|
|
115
115
|
for (; n && n !== document.body; ) {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
116
|
+
const e = window.getComputedStyle(n).position;
|
|
117
|
+
if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
|
|
118
118
|
return n;
|
|
119
119
|
n = n.parentElement;
|
|
120
120
|
}
|
|
121
121
|
return document.body;
|
|
122
122
|
};
|
|
123
|
-
function
|
|
124
|
-
const n = Object.keys(
|
|
125
|
-
return Promise.all(n.map((
|
|
123
|
+
function Et(t) {
|
|
124
|
+
const n = Object.keys(t);
|
|
125
|
+
return Promise.all(n.map((e) => t[e])).then((e) => {
|
|
126
126
|
const o = {};
|
|
127
|
-
return n.forEach((
|
|
128
|
-
o[
|
|
127
|
+
return n.forEach((i, f) => {
|
|
128
|
+
o[i] = e[f];
|
|
129
129
|
}), o;
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
const n =
|
|
134
|
-
from:
|
|
135
|
-
to:
|
|
136
|
-
transition:
|
|
132
|
+
function vt(t) {
|
|
133
|
+
const n = t.filter((e) => e.symmetric).map((e) => ({
|
|
134
|
+
from: e.to,
|
|
135
|
+
to: e.from,
|
|
136
|
+
transition: e.transition
|
|
137
137
|
}));
|
|
138
|
-
return [...
|
|
138
|
+
return [...t, ...n];
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function W(t, n) {
|
|
141
141
|
if (n === "*")
|
|
142
142
|
return !0;
|
|
143
143
|
if (n.endsWith("/*")) {
|
|
144
|
-
const
|
|
145
|
-
return
|
|
144
|
+
const e = n.slice(0, -1);
|
|
145
|
+
return t.startsWith(e) && t.length > e.length;
|
|
146
146
|
}
|
|
147
|
-
return
|
|
147
|
+
return t === n;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
for (const o of
|
|
151
|
-
if (
|
|
149
|
+
function Tt(t, n, e) {
|
|
150
|
+
for (const o of e)
|
|
151
|
+
if (W(t, o.from) && W(n, o.to))
|
|
152
152
|
return o.transition;
|
|
153
|
-
for (const o of
|
|
154
|
-
if ((o.from === "*" ||
|
|
153
|
+
for (const o of e)
|
|
154
|
+
if ((o.from === "*" || W(t, o.from)) && (o.to === "*" || W(n, o.to)))
|
|
155
155
|
return o.transition;
|
|
156
156
|
return null;
|
|
157
157
|
}
|
|
158
|
-
const
|
|
159
|
-
function
|
|
160
|
-
const { preserveScroll: n = (
|
|
161
|
-
let o = null,
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
},
|
|
158
|
+
const bt = 768, wt = 10, St = 10;
|
|
159
|
+
function Rt(t = {}) {
|
|
160
|
+
const { preserveScroll: n = (c) => c } = t, e = typeof n == "function" ? n : () => n;
|
|
161
|
+
let o = null, i = !1, f = !1;
|
|
162
|
+
const l = () => {
|
|
163
|
+
const c = (o == null ? void 0 : o.clientWidth) ?? 0, a = c > 0 ? c : typeof window < "u" ? window.innerWidth : 0;
|
|
164
|
+
return a > 0 && a < bt;
|
|
165
|
+
}, d = () => (f || (i = l(), f = !0), i), g = (c) => {
|
|
166
166
|
var v;
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
return { preserves: !1, shared: !1, storageKey: `path:${
|
|
170
|
-
if (
|
|
171
|
-
return { preserves: !0, shared: !1, storageKey: `path:${
|
|
172
|
-
const
|
|
167
|
+
const a = e(d());
|
|
168
|
+
if (a === !1)
|
|
169
|
+
return { preserves: !1, shared: !1, storageKey: `path:${c}` };
|
|
170
|
+
if (a === !0)
|
|
171
|
+
return { preserves: !0, shared: !1, storageKey: `path:${c}` };
|
|
172
|
+
const p = ((v = a.exclude) == null ? void 0 : v.some((r) => W(c, r))) ?? !1, E = !p && !!a.key;
|
|
173
173
|
return {
|
|
174
|
-
preserves: !
|
|
175
|
-
shared:
|
|
176
|
-
storageKey:
|
|
174
|
+
preserves: !p,
|
|
175
|
+
shared: E,
|
|
176
|
+
storageKey: E ? `shared:${a.key}` : `path:${c}`
|
|
177
177
|
};
|
|
178
|
-
},
|
|
179
|
-
let
|
|
180
|
-
const
|
|
181
|
-
let
|
|
178
|
+
}, L = (c) => g(c).preserves;
|
|
179
|
+
let A = null;
|
|
180
|
+
const y = /* @__PURE__ */ new Map();
|
|
181
|
+
let S = null, O = !1, k = 0;
|
|
182
182
|
const I = () => {
|
|
183
|
-
o &&
|
|
183
|
+
o && S && !O && y.set(g(S).storageKey, {
|
|
184
184
|
x: o.scrollLeft,
|
|
185
185
|
y: o.scrollTop
|
|
186
186
|
});
|
|
187
|
-
},
|
|
187
|
+
}, _ = (c) => {
|
|
188
188
|
if (!o) return;
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
189
|
+
const a = g(c);
|
|
190
|
+
if (a.preserves && a.shared && !y.has(a.storageKey))
|
|
191
191
|
return;
|
|
192
|
-
const
|
|
193
|
-
let
|
|
192
|
+
const p = a.preserves && y.has(a.storageKey) ? y.get(a.storageKey) : { x: 0, y: 0 };
|
|
193
|
+
let E = 0;
|
|
194
194
|
const v = () => {
|
|
195
195
|
if (!o) return;
|
|
196
196
|
o.scrollTo({
|
|
197
|
-
top:
|
|
198
|
-
left:
|
|
199
|
-
}), !(Math.abs(o.scrollTop -
|
|
197
|
+
top: p.y,
|
|
198
|
+
left: p.x
|
|
199
|
+
}), !(Math.abs(o.scrollTop - p.y) < 1 && Math.abs(o.scrollLeft - p.x) < 1) && E < wt && (E++, requestAnimationFrame(v));
|
|
200
200
|
};
|
|
201
201
|
requestAnimationFrame(v);
|
|
202
202
|
};
|
|
203
203
|
return {
|
|
204
|
-
initializeContext: (
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
initializeContext: (c, a) => {
|
|
205
|
+
O = !0;
|
|
206
|
+
const p = ++k;
|
|
207
|
+
A = c, o || (o = yt(c), i = l(), f = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
|
|
208
|
+
i = l();
|
|
209
209
|
}).observe(o), (o === document.documentElement ? window : o).addEventListener("scroll", I, {
|
|
210
210
|
passive: !0
|
|
211
|
-
})),
|
|
212
|
-
let
|
|
211
|
+
})), S = a, _(a);
|
|
212
|
+
let E = 0;
|
|
213
213
|
const v = () => {
|
|
214
|
-
|
|
214
|
+
p === k && (E++, E >= St ? O = !1 : requestAnimationFrame(v));
|
|
215
215
|
};
|
|
216
216
|
requestAnimationFrame(v);
|
|
217
217
|
},
|
|
218
|
-
calculateScrollOffset: (
|
|
219
|
-
const
|
|
218
|
+
calculateScrollOffset: (c, a) => {
|
|
219
|
+
const p = c ? g(c).storageKey : null, E = p && y.has(p) ? y.get(p) : { x: 0, y: 0 }, v = a ? g(a) : null, r = v != null && v.preserves ? v.storageKey : null, s = r && y.has(r) ? y.get(r) : { x: 0, y: 0 };
|
|
220
220
|
return {
|
|
221
|
-
x: -s.x +
|
|
222
|
-
y: -s.y +
|
|
221
|
+
x: -s.x + E.x,
|
|
222
|
+
y: -s.y + E.y
|
|
223
223
|
};
|
|
224
224
|
},
|
|
225
|
-
evictScrollPosition: (
|
|
226
|
-
|
|
225
|
+
evictScrollPosition: (c) => {
|
|
226
|
+
y.delete(g(c).storageKey);
|
|
227
227
|
},
|
|
228
|
-
shouldPreserve:
|
|
228
|
+
shouldPreserve: L,
|
|
229
229
|
getScrollContainer: () => o,
|
|
230
|
-
getPositionedParentElement: () =>
|
|
231
|
-
getScrollPosition: (
|
|
232
|
-
const
|
|
233
|
-
return
|
|
230
|
+
getPositionedParentElement: () => A ? pt(A) : document.body,
|
|
231
|
+
getScrollPosition: (c) => {
|
|
232
|
+
const a = c ? g(c).storageKey : null;
|
|
233
|
+
return a && y.has(a) ? y.get(a) : { x: 0, y: 0 };
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
function
|
|
239
|
-
let
|
|
240
|
-
const
|
|
241
|
-
for (let
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
237
|
+
const tt = 30, et = 8, nt = 1.2, ot = 30, At = 600;
|
|
238
|
+
function Ot() {
|
|
239
|
+
let t = null, n = !1, e = !1, o = null, i = null, f = !1;
|
|
240
|
+
const l = (u, h) => {
|
|
241
|
+
for (let m = 0; m < u.length; m++) {
|
|
242
|
+
const T = u.item(m);
|
|
243
|
+
if (T && T.identifier === h) return T;
|
|
244
244
|
}
|
|
245
245
|
return null;
|
|
246
|
-
},
|
|
246
|
+
}, d = () => {
|
|
247
247
|
o !== null && (clearTimeout(o), o = null);
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
},
|
|
251
|
-
n = !0,
|
|
252
|
-
n = !1,
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
if (
|
|
256
|
-
|
|
248
|
+
}, g = () => {
|
|
249
|
+
i !== null && (clearTimeout(i), i = null);
|
|
250
|
+
}, L = () => {
|
|
251
|
+
n = !0, e = !0, d(), g(), o = setTimeout(() => {
|
|
252
|
+
n = !1, e = !1, o = null;
|
|
253
|
+
}, At);
|
|
254
|
+
}, A = (u) => {
|
|
255
|
+
if (u.touches.length !== 1) {
|
|
256
|
+
t = null;
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
if (!
|
|
261
|
-
|
|
259
|
+
const h = u.touches.item(0);
|
|
260
|
+
if (!h) {
|
|
261
|
+
t = null;
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
|
-
const
|
|
265
|
-
if (!
|
|
266
|
-
|
|
264
|
+
const m = window.innerWidth, T = h.clientX <= tt, R = h.clientX >= m - tt;
|
|
265
|
+
if (!T && !R) {
|
|
266
|
+
t = null;
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
|
|
270
|
-
identifier:
|
|
271
|
-
startX:
|
|
272
|
-
startY:
|
|
273
|
-
fromLeftEdge:
|
|
269
|
+
t = {
|
|
270
|
+
identifier: h.identifier,
|
|
271
|
+
startX: h.clientX,
|
|
272
|
+
startY: h.clientY,
|
|
273
|
+
fromLeftEdge: T,
|
|
274
274
|
moved: !1
|
|
275
275
|
};
|
|
276
|
-
},
|
|
277
|
-
if (!
|
|
278
|
-
if (
|
|
279
|
-
|
|
276
|
+
}, y = (u) => {
|
|
277
|
+
if (!t) return;
|
|
278
|
+
if (u.touches.length !== 1) {
|
|
279
|
+
t = null;
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
if (!
|
|
284
|
-
|
|
282
|
+
const h = l(u.touches, t.identifier);
|
|
283
|
+
if (!h) {
|
|
284
|
+
t = null;
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
|
|
287
|
+
const m = h.clientX - t.startX, T = h.clientY - t.startY, R = Math.abs(m), c = Math.abs(T);
|
|
288
|
+
if (c > et && c > R * nt) {
|
|
289
|
+
t = null;
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
if (!
|
|
296
|
-
const
|
|
297
|
-
if (!
|
|
298
|
-
|
|
292
|
+
const a = t.fromLeftEdge ? m > 0 : m < 0;
|
|
293
|
+
R > et && R > c * nt && a && (t.moved = !0);
|
|
294
|
+
}, S = (u) => {
|
|
295
|
+
if (!t) return;
|
|
296
|
+
const h = l(u.changedTouches, t.identifier);
|
|
297
|
+
if (!h) {
|
|
298
|
+
t = null;
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
|
|
301
|
+
const m = h.clientX - t.startX, T = t.fromLeftEdge ? m > 0 : m < 0;
|
|
302
|
+
if (t.moved && T && Math.abs(m) >= ot) {
|
|
303
|
+
L(), t = null;
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
|
|
307
|
-
},
|
|
308
|
-
|
|
306
|
+
t.moved && Math.abs(m) >= ot && L(), t = null;
|
|
307
|
+
}, O = () => {
|
|
308
|
+
t && (t.moved && L(), t = null);
|
|
309
309
|
};
|
|
310
310
|
return { initialize: () => {
|
|
311
|
-
if (typeof window > "u" ||
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
window.addEventListener("touchstart",
|
|
311
|
+
if (typeof window > "u" || f) return;
|
|
312
|
+
f = !0;
|
|
313
|
+
const u = { passive: !0, capture: !0 };
|
|
314
|
+
window.addEventListener("touchstart", A, u), window.addEventListener("touchmove", y, u), window.addEventListener("touchend", S, u), window.addEventListener("touchcancel", O, u);
|
|
315
315
|
}, destroy: () => {
|
|
316
|
-
if (typeof window > "u" || !
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
window.removeEventListener("touchstart",
|
|
316
|
+
if (typeof window > "u" || !f) return;
|
|
317
|
+
f = !1;
|
|
318
|
+
const u = { capture: !0 };
|
|
319
|
+
window.removeEventListener("touchstart", A, u), window.removeEventListener("touchmove", y, u), window.removeEventListener("touchend", S, u), window.removeEventListener("touchcancel", O, u), d(), g(), t = null, n = !1, e = !1;
|
|
320
320
|
}, isSwipeBack: () => {
|
|
321
|
-
const
|
|
322
|
-
return
|
|
321
|
+
const u = n || e;
|
|
322
|
+
return u && d(), u;
|
|
323
323
|
}, onPageEnter: () => {
|
|
324
|
-
n = !1,
|
|
325
|
-
|
|
324
|
+
n = !1, d(), g(), i = setTimeout(() => {
|
|
325
|
+
e = !1, i = null;
|
|
326
326
|
}, 0);
|
|
327
327
|
} };
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
let
|
|
329
|
+
function Pt() {
|
|
330
|
+
let t = null;
|
|
331
331
|
function n() {
|
|
332
|
-
var o,
|
|
333
|
-
|
|
332
|
+
var o, i;
|
|
333
|
+
t && ((o = t.outResolve) == null || o.call(t, null), (i = t.inResolve) == null || i.call(t, null), t = null);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
if (
|
|
337
|
-
if (
|
|
335
|
+
function e() {
|
|
336
|
+
if (t != null && t.from && (t != null && t.to) && (t != null && t.outResolve) && (t != null && t.inResolve)) {
|
|
337
|
+
if (t.from === t.to) {
|
|
338
338
|
n();
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
const o = { from:
|
|
342
|
-
|
|
341
|
+
const o = { from: t.from, to: t.to };
|
|
342
|
+
t.outResolve(o), t.inResolve(o), t = null;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
return {
|
|
346
|
-
trigger(o,
|
|
347
|
-
var
|
|
348
|
-
|
|
346
|
+
trigger(o, i) {
|
|
347
|
+
var l;
|
|
348
|
+
i === "out" && (t == null ? void 0 : t.to) === o && !t.from && ((l = t.inResolve) == null || l.call(t, null), t = {}), t && (i === "out" && t.from && t.from !== o || i === "in" && t.to && t.to !== o) && n(), t || (t = {}), i === "out" ? t.from = o : t.to = o;
|
|
349
349
|
},
|
|
350
350
|
get(o) {
|
|
351
|
-
return new Promise((
|
|
352
|
-
|
|
351
|
+
return new Promise((i) => {
|
|
352
|
+
t || (t = {}), o === "out" ? t.outResolve = i : t.inResolve = i, e();
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
const
|
|
358
|
-
let
|
|
359
|
-
function
|
|
360
|
-
if (
|
|
361
|
-
const n =
|
|
362
|
-
|
|
357
|
+
const B = /* @__PURE__ */ new Map();
|
|
358
|
+
let H = null, rt = !1;
|
|
359
|
+
function it(t) {
|
|
360
|
+
if (t instanceof HTMLElement && B.has(t)) {
|
|
361
|
+
const n = B.get(t);
|
|
362
|
+
B.delete(t), queueMicrotask(n);
|
|
363
363
|
}
|
|
364
|
-
for (const n of Array.from(
|
|
365
|
-
|
|
364
|
+
for (const n of Array.from(t.childNodes))
|
|
365
|
+
it(n);
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
if (
|
|
369
|
-
|
|
370
|
-
for (const
|
|
371
|
-
for (const o of Array.from(
|
|
372
|
-
|
|
367
|
+
function Lt() {
|
|
368
|
+
if (rt || typeof document > "u") return;
|
|
369
|
+
rt = !0, H = new MutationObserver((n) => {
|
|
370
|
+
for (const e of n)
|
|
371
|
+
for (const o of Array.from(e.removedNodes))
|
|
372
|
+
it(o);
|
|
373
373
|
});
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const t = () => {
|
|
375
|
+
H == null || H.observe(document.body, { childList: !0, subtree: !0 });
|
|
376
376
|
};
|
|
377
|
-
document.body ?
|
|
377
|
+
document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
return
|
|
381
|
-
|
|
379
|
+
function _t(t, n) {
|
|
380
|
+
return Lt(), B.set(t, n), () => {
|
|
381
|
+
B.delete(t);
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
return Array.isArray(
|
|
384
|
+
function Mt(t) {
|
|
385
|
+
return Array.isArray(t);
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function lt(t) {
|
|
388
388
|
const n = [];
|
|
389
|
-
for (const
|
|
390
|
-
|
|
389
|
+
for (const e of t)
|
|
390
|
+
Mt(e) ? n.push(...lt(e)) : n.push(e);
|
|
391
391
|
return n;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function Dt(t, n = {}) {
|
|
394
394
|
const {
|
|
395
|
-
transitions:
|
|
395
|
+
transitions: e = [],
|
|
396
396
|
middleware: o = (r, s) => ({ from: r, to: s }),
|
|
397
|
-
preserveScroll:
|
|
398
|
-
} =
|
|
399
|
-
|
|
400
|
-
),
|
|
401
|
-
|
|
397
|
+
preserveScroll: i = (r) => r
|
|
398
|
+
} = t, f = n.host ?? new mt(), l = Pt(), d = vt(
|
|
399
|
+
lt(e)
|
|
400
|
+
), g = Ot();
|
|
401
|
+
g.initialize();
|
|
402
402
|
const {
|
|
403
|
-
initializeContext:
|
|
404
|
-
calculateScrollOffset:
|
|
405
|
-
evictScrollPosition:
|
|
406
|
-
shouldPreserve:
|
|
407
|
-
getScrollContainer:
|
|
408
|
-
getPositionedParentElement:
|
|
403
|
+
initializeContext: L,
|
|
404
|
+
calculateScrollOffset: A,
|
|
405
|
+
evictScrollPosition: y,
|
|
406
|
+
shouldPreserve: S,
|
|
407
|
+
getScrollContainer: O,
|
|
408
|
+
getPositionedParentElement: k,
|
|
409
409
|
getScrollPosition: I
|
|
410
|
-
} =
|
|
411
|
-
let
|
|
412
|
-
const
|
|
413
|
-
|
|
410
|
+
} = Rt({ preserveScroll: i });
|
|
411
|
+
let _ = null, x = null;
|
|
412
|
+
const u = /* @__PURE__ */ new WeakMap(), h = (r) => {
|
|
413
|
+
u.set(r, {
|
|
414
414
|
parent: r.parentElement,
|
|
415
415
|
nextSibling: r.nextElementSibling
|
|
416
416
|
});
|
|
417
|
-
},
|
|
418
|
-
const s =
|
|
417
|
+
}, m = (r) => {
|
|
418
|
+
const s = u.get(r);
|
|
419
419
|
return s || {
|
|
420
420
|
parent: r.parentElement,
|
|
421
421
|
nextSibling: r.nextElementSibling
|
|
422
422
|
};
|
|
423
|
-
},
|
|
424
|
-
const
|
|
425
|
-
|
|
423
|
+
}, T = (r, s, w, b, D) => {
|
|
424
|
+
const N = b.element, X = D.element, { parent: M, nextSibling: C } = b.parent ? { parent: b.parent, nextSibling: b.nextSibling } : m(N), P = N.cloneNode(!0);
|
|
425
|
+
P.setAttribute("data-ssgoi-clone", "");
|
|
426
|
+
const z = {
|
|
427
|
+
scrollOffset: A(s, w),
|
|
426
428
|
from: { scroll: I(s) },
|
|
427
|
-
to: { scroll: I(
|
|
429
|
+
to: { scroll: I(w) },
|
|
428
430
|
get scrollingElement() {
|
|
429
|
-
return
|
|
431
|
+
return O() || document.documentElement;
|
|
430
432
|
},
|
|
431
433
|
get positionedParent() {
|
|
432
|
-
return
|
|
434
|
+
return k();
|
|
433
435
|
}
|
|
434
436
|
};
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
from:
|
|
438
|
-
to:
|
|
439
|
-
context:
|
|
440
|
-
createElement: ((q
|
|
441
|
-
const
|
|
442
|
-
return
|
|
437
|
+
gt(P, z), S(s) || y(s);
|
|
438
|
+
const Z = Promise.resolve(P), j = Promise.resolve(X), J = [], at = {
|
|
439
|
+
from: Z,
|
|
440
|
+
to: j,
|
|
441
|
+
context: z,
|
|
442
|
+
createElement: (($, q = "div") => {
|
|
443
|
+
const K = document.createElement(q);
|
|
444
|
+
return K.setAttribute("data-ssgoi-id", $), J.push(K), K;
|
|
443
445
|
})
|
|
444
|
-
},
|
|
445
|
-
r.prepare ? r.prepare(
|
|
446
|
+
}, ut = Promise.resolve(
|
|
447
|
+
r.prepare ? r.prepare(at) : {}
|
|
446
448
|
);
|
|
447
|
-
|
|
448
|
-
from:
|
|
449
|
-
to:
|
|
450
|
-
extras:
|
|
451
|
-
}).then(({ from:
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
from:
|
|
455
|
-
to:
|
|
456
|
-
context:
|
|
457
|
-
...
|
|
458
|
-
}),
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
for (const
|
|
462
|
-
|
|
463
|
-
},
|
|
449
|
+
Et({
|
|
450
|
+
from: Z,
|
|
451
|
+
to: j,
|
|
452
|
+
extras: ut
|
|
453
|
+
}).then(({ from: $, to: q, extras: K }) => {
|
|
454
|
+
M && (C && M.contains(C) ? M.insertBefore(P, C) : M.appendChild(P));
|
|
455
|
+
const U = r.animation({
|
|
456
|
+
from: $,
|
|
457
|
+
to: q,
|
|
458
|
+
context: z,
|
|
459
|
+
...K
|
|
460
|
+
}), Y = U.onComplete;
|
|
461
|
+
U.onComplete = () => {
|
|
462
|
+
Y == null || Y(), P.parentElement && P.parentElement.removeChild(P);
|
|
463
|
+
for (const G of J)
|
|
464
|
+
G.parentElement && G.parentElement.removeChild(G);
|
|
465
|
+
}, f.attach(U);
|
|
464
466
|
});
|
|
465
|
-
},
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
if (s === "in" &&
|
|
469
|
-
if (
|
|
470
|
-
s === "out" &&
|
|
467
|
+
}, R = (r, s) => {
|
|
468
|
+
const w = g.isSwipeBack();
|
|
469
|
+
l.trigger(r, s), l.get(s).then((b) => {
|
|
470
|
+
if (s === "in" && g.onPageEnter(), !b) return;
|
|
471
|
+
if (w) {
|
|
472
|
+
s === "out" && b.from && !S(b.from) && y(b.from), _ = null, x = null;
|
|
471
473
|
return;
|
|
472
474
|
}
|
|
473
475
|
if (s !== "in") return;
|
|
474
|
-
const { from:
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
),
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
),
|
|
482
|
-
|
|
476
|
+
const { from: D, to: N } = o(
|
|
477
|
+
b.from,
|
|
478
|
+
b.to
|
|
479
|
+
), X = Tt(
|
|
480
|
+
D,
|
|
481
|
+
N,
|
|
482
|
+
d
|
|
483
|
+
), M = _, C = x;
|
|
484
|
+
_ = null, x = null, !(!X || !M || !C) && T(X, D, N, M, C);
|
|
483
485
|
});
|
|
484
|
-
},
|
|
485
|
-
const
|
|
486
|
-
|
|
486
|
+
}, c = (r, s) => {
|
|
487
|
+
const w = m(r);
|
|
488
|
+
_ = {
|
|
487
489
|
element: r,
|
|
488
|
-
parent:
|
|
489
|
-
nextSibling:
|
|
490
|
+
parent: w.parent,
|
|
491
|
+
nextSibling: w.nextSibling
|
|
490
492
|
};
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
},
|
|
494
|
-
|
|
493
|
+
const b = r.getAttribute("data-ssgoi-transition") ?? s;
|
|
494
|
+
R(b, "out");
|
|
495
|
+
}, a = /* @__PURE__ */ new WeakSet(), p = (r, s) => {
|
|
496
|
+
a.has(s) || (a.add(s), h(s), L(s, r), x = {
|
|
495
497
|
element: s,
|
|
496
498
|
parent: s.parentElement,
|
|
497
499
|
nextSibling: s.nextElementSibling
|
|
498
|
-
},
|
|
499
|
-
},
|
|
500
|
-
return { register:
|
|
501
|
-
let s =
|
|
502
|
-
return s || (s = (
|
|
503
|
-
|
|
504
|
-
},
|
|
500
|
+
}, R(r, "in"), _t(s, () => c(s, r)));
|
|
501
|
+
}, E = /* @__PURE__ */ new Map();
|
|
502
|
+
return { register: p, refFor: (r) => {
|
|
503
|
+
let s = E.get(r);
|
|
504
|
+
return s || (s = (w) => {
|
|
505
|
+
w && p(r, w);
|
|
506
|
+
}, E.set(r, s)), s;
|
|
505
507
|
} };
|
|
506
508
|
}
|
|
509
|
+
const ct = "data-ssgoi-root", xt = `[${ct}]`, V = "data-ssgoi-transition", st = `[${V}]`, Ct = "[data-ssgoi-clone]";
|
|
510
|
+
function kt() {
|
|
511
|
+
return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
|
|
512
|
+
}
|
|
513
|
+
function It(t) {
|
|
514
|
+
return t.nodeType === Node.ELEMENT_NODE;
|
|
515
|
+
}
|
|
516
|
+
function Nt(t) {
|
|
517
|
+
return t instanceof HTMLElement;
|
|
518
|
+
}
|
|
519
|
+
function Xt(t, n) {
|
|
520
|
+
if (!kt()) return () => {
|
|
521
|
+
};
|
|
522
|
+
t.setAttribute(ct, "");
|
|
523
|
+
const e = (l) => l.closest(xt) === t, o = (l) => {
|
|
524
|
+
if (!Nt(l) || !e(l) || l.closest(Ct))
|
|
525
|
+
return;
|
|
526
|
+
const d = l.getAttribute(V);
|
|
527
|
+
d !== null && n.register(d, l);
|
|
528
|
+
}, i = (l) => {
|
|
529
|
+
if (It(l)) {
|
|
530
|
+
l.matches(st) && o(l);
|
|
531
|
+
for (const d of l.querySelectorAll(st))
|
|
532
|
+
o(d);
|
|
533
|
+
}
|
|
534
|
+
}, f = new MutationObserver((l) => {
|
|
535
|
+
for (const d of l) {
|
|
536
|
+
if (d.type === "attributes") {
|
|
537
|
+
o(d.target);
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
for (const g of d.addedNodes)
|
|
541
|
+
i(g);
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
return f.observe(t, {
|
|
545
|
+
childList: !0,
|
|
546
|
+
subtree: !0,
|
|
547
|
+
attributes: !0,
|
|
548
|
+
attributeFilter: [V]
|
|
549
|
+
}), i(t), () => f.disconnect();
|
|
550
|
+
}
|
|
507
551
|
export {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
552
|
+
ht as Animation,
|
|
553
|
+
mt as HostAnimation,
|
|
554
|
+
$t as MultiAnimation,
|
|
555
|
+
qt as WebAnimation,
|
|
556
|
+
Dt as createSggoiTransitionContext,
|
|
557
|
+
Xt as observeSsgoiTransitions
|
|
513
558
|
};
|