@ssgoi/core 0.0.3 → 2.1.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 +252 -23
- package/dist/animator.d.ts +28 -17
- package/dist/animator.d.ts.map +1 -1
- package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/create-transition-callback.d.ts +3 -32
- package/dist/create-transition-callback.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +374 -213
- package/dist/presets/index.cjs +1 -0
- package/dist/presets/index.d.ts +16 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +35 -0
- package/dist/transition-strategy.d.ts +60 -0
- package/dist/transition-strategy.d.ts.map +1 -0
- package/dist/transition.d.ts +55 -11
- package/dist/transition.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts +5 -1
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +5 -0
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +3 -0
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +30 -0
- package/dist/transitions/fly.d.ts.map +1 -0
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.d.ts +1 -0
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/index.js +200 -120
- package/dist/transitions/none.d.ts +3 -0
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +6 -0
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +6 -3
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +6 -1
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/types.d.ts +19 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/utils-8Eptbv7c.cjs +2 -0
- package/dist/utils-DTRMUQW4.js +31 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/view-transitions/drill.d.ts +9 -0
- package/dist/view-transitions/drill.d.ts.map +1 -0
- package/dist/view-transitions/fade.d.ts +3 -1
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +1 -1
- package/dist/view-transitions/index.d.ts +2 -1
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +233 -177
- package/dist/view-transitions/scroll.d.ts +8 -0
- package/dist/view-transitions/scroll.d.ts.map +1 -0
- package/package.json +28 -10
- package/dist/utils-BSgyev81.cjs +0 -1
- package/dist/utils-DR41YsAh.js +0 -16
package/dist/index.js
CHANGED
|
@@ -1,41 +1,110 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { animate as
|
|
5
|
-
import { g as
|
|
6
|
-
class
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var x = (i, t, o) => t in i ? M(i, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[t] = o;
|
|
3
|
+
var g = (i, t, o) => x(i, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { animate as E } from "popmotion";
|
|
5
|
+
import { p as U, g as _ } from "./utils-DTRMUQW4.js";
|
|
6
|
+
class V {
|
|
7
7
|
constructor(t) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
g(this, "options");
|
|
9
|
+
g(this, "currentValue");
|
|
10
|
+
g(this, "velocity");
|
|
11
|
+
g(this, "isAnimating", !1);
|
|
12
|
+
g(this, "controls", null);
|
|
13
|
+
// For object animations
|
|
14
|
+
g(this, "animationMap", null);
|
|
15
|
+
g(this, "activeAnimations", /* @__PURE__ */ new Set());
|
|
16
|
+
g(this, "completedAnimations", /* @__PURE__ */ new Set());
|
|
17
|
+
g(this, "updatedProperties", /* @__PURE__ */ new Set());
|
|
18
|
+
g(this, "animate", (t = !1) => {
|
|
14
19
|
!this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
const o = t ? this.options.from : this.options.to;
|
|
21
|
+
if (typeof this.currentValue == "object" && this.currentValue !== null) {
|
|
22
|
+
this.animateObject(o, t);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
let n = this.currentValue, e = performance.now();
|
|
26
|
+
const m = {
|
|
18
27
|
from: this.currentValue,
|
|
19
|
-
to:
|
|
20
|
-
velocity: this.velocity * 1e3,
|
|
21
|
-
// Convert to px/s
|
|
28
|
+
to: o,
|
|
22
29
|
stiffness: this.options.spring.stiffness,
|
|
23
30
|
damping: this.options.spring.damping,
|
|
24
|
-
mass: 1
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
mass: 1
|
|
32
|
+
};
|
|
33
|
+
typeof this.velocity == "number" && (m.velocity = this.velocity * 1e3), this.controls = E({
|
|
34
|
+
...m,
|
|
35
|
+
onUpdate: (a) => {
|
|
36
|
+
const f = performance.now(), h = (f - e) / 1e3;
|
|
37
|
+
if (h > 0) {
|
|
38
|
+
if (typeof a == "number" && typeof n == "number") {
|
|
39
|
+
const c = (a - n) / h;
|
|
40
|
+
this.velocity = c / 1e3;
|
|
41
|
+
} else if (typeof a == "object" && a !== null) {
|
|
42
|
+
const c = {};
|
|
43
|
+
Object.keys(a).forEach((u) => {
|
|
44
|
+
const r = a[u], s = n[u];
|
|
45
|
+
if (typeof r == "number" && typeof s == "number") {
|
|
46
|
+
const p = (r - s) / h;
|
|
47
|
+
c[u] = p / 1e3;
|
|
48
|
+
}
|
|
49
|
+
}), this.velocity = c;
|
|
50
|
+
}
|
|
51
|
+
n = a, e = f;
|
|
30
52
|
}
|
|
31
|
-
this.currentValue =
|
|
53
|
+
this.currentValue = a, this.options.onUpdate(a);
|
|
32
54
|
},
|
|
33
55
|
onComplete: () => {
|
|
34
|
-
this.currentValue =
|
|
56
|
+
this.currentValue = o, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((a) => {
|
|
57
|
+
this.velocity[a] = 0;
|
|
58
|
+
}) : this.velocity = 0, this.options.onComplete();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
g(this, "animateObject", (t, o) => {
|
|
63
|
+
const n = this.currentValue, e = Object.keys(n);
|
|
64
|
+
this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
|
|
65
|
+
const m = { ...n }, a = {};
|
|
66
|
+
let f = !1;
|
|
67
|
+
const h = () => {
|
|
68
|
+
const c = e.filter((r) => !this.completedAnimations.has(r));
|
|
69
|
+
if (c.every((r) => this.updatedProperties.has(r)) && c.length > 0) {
|
|
70
|
+
if (typeof this.velocity == "object" && this.velocity) {
|
|
71
|
+
const r = performance.now();
|
|
72
|
+
Object.keys(m).forEach((s) => {
|
|
73
|
+
if (a[s]) {
|
|
74
|
+
const p = (r - a[s]) / 1e3, l = this.currentValue[s], d = m[s];
|
|
75
|
+
typeof l == "number" && typeof d == "number" && p > 0 && (this.velocity[s] = (d - l) / p / 1e3);
|
|
76
|
+
}
|
|
77
|
+
a[s] = r;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
this.currentValue = { ...m }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !f && this.options.onStart && (f = !0, this.options.onStart());
|
|
35
81
|
}
|
|
82
|
+
};
|
|
83
|
+
e.forEach((c) => {
|
|
84
|
+
this.activeAnimations.add(c);
|
|
85
|
+
const u = {
|
|
86
|
+
from: n[c],
|
|
87
|
+
to: t[c],
|
|
88
|
+
stiffness: this.options.spring.stiffness,
|
|
89
|
+
damping: this.options.spring.damping,
|
|
90
|
+
mass: 1
|
|
91
|
+
};
|
|
92
|
+
typeof this.velocity == "object" && this.velocity && c in this.velocity && (u.velocity = this.velocity[c] * 1e3);
|
|
93
|
+
const r = E({
|
|
94
|
+
...u,
|
|
95
|
+
onUpdate: (s) => {
|
|
96
|
+
m[c] = s, this.updatedProperties.add(c), h();
|
|
97
|
+
},
|
|
98
|
+
onComplete: () => {
|
|
99
|
+
this.completedAnimations.add(c), this.updatedProperties.delete(c), this.completedAnimations.size === e.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((s) => {
|
|
100
|
+
this.velocity[s] = 0;
|
|
101
|
+
}), this.options.onComplete());
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
this.animationMap.set(c, r);
|
|
36
105
|
});
|
|
37
106
|
});
|
|
38
|
-
this.options = {
|
|
107
|
+
if (this.options = {
|
|
39
108
|
from: t.from ?? 0,
|
|
40
109
|
to: t.to ?? 1,
|
|
41
110
|
spring: t.spring ?? { stiffness: 100, damping: 10 },
|
|
@@ -44,7 +113,13 @@ class v {
|
|
|
44
113
|
onComplete: t.onComplete ?? (() => {
|
|
45
114
|
}),
|
|
46
115
|
onStart: t.onStart
|
|
47
|
-
}, this.currentValue = this.options.from
|
|
116
|
+
}, this.currentValue = this.options.from, typeof this.options.from == "object" && this.options.from !== null) {
|
|
117
|
+
const o = {};
|
|
118
|
+
Object.keys(this.options.from).forEach((n) => {
|
|
119
|
+
o[n] = 0;
|
|
120
|
+
}), this.velocity = o;
|
|
121
|
+
} else
|
|
122
|
+
this.velocity = 0;
|
|
48
123
|
}
|
|
49
124
|
// Animation control methods
|
|
50
125
|
forward() {
|
|
@@ -56,12 +131,17 @@ class v {
|
|
|
56
131
|
reverse() {
|
|
57
132
|
const t = this.options.from;
|
|
58
133
|
if (this.options.from = this.options.to, this.options.to = t, this.isAnimating) {
|
|
59
|
-
const
|
|
60
|
-
this.stop(), this.animate(!
|
|
134
|
+
const o = this.shouldReverse();
|
|
135
|
+
this.stop(), this.animate(!o);
|
|
61
136
|
}
|
|
62
137
|
}
|
|
138
|
+
shouldReverse() {
|
|
139
|
+
return typeof this.currentValue == "number" && typeof this.options.from == "number" && typeof this.options.to == "number" ? this.currentValue > (this.options.from + this.options.to) / 2 : !1;
|
|
140
|
+
}
|
|
63
141
|
stop() {
|
|
64
|
-
this.isAnimating = !1, this.controls && (this.controls.stop(), this.controls = null)
|
|
142
|
+
this.isAnimating = !1, this.controls && (this.controls.stop(), this.controls = null), this.animationMap && (this.animationMap.forEach((t) => {
|
|
143
|
+
t.stop();
|
|
144
|
+
}), this.animationMap.clear(), this.animationMap = null), this.updatedProperties.clear();
|
|
65
145
|
}
|
|
66
146
|
// State getters
|
|
67
147
|
getVelocity() {
|
|
@@ -76,7 +156,9 @@ class v {
|
|
|
76
156
|
getCurrentState() {
|
|
77
157
|
return {
|
|
78
158
|
position: this.currentValue,
|
|
79
|
-
velocity: this.velocity
|
|
159
|
+
velocity: this.velocity,
|
|
160
|
+
from: this.options.from,
|
|
161
|
+
to: this.options.to
|
|
80
162
|
};
|
|
81
163
|
}
|
|
82
164
|
// State setters
|
|
@@ -89,223 +171,302 @@ class v {
|
|
|
89
171
|
// Configuration
|
|
90
172
|
updateOptions(t) {
|
|
91
173
|
if (this.options = { ...this.options, ...t }, this.isAnimating && this.controls) {
|
|
92
|
-
const
|
|
93
|
-
this.stop(), this.animate(!
|
|
174
|
+
const o = this.shouldReverse();
|
|
175
|
+
this.stop(), this.animate(!o);
|
|
94
176
|
}
|
|
95
177
|
}
|
|
96
178
|
// Static factory method
|
|
97
|
-
static fromState(t,
|
|
98
|
-
const
|
|
99
|
-
return
|
|
179
|
+
static fromState(t, o) {
|
|
180
|
+
const n = new V(o);
|
|
181
|
+
return n.setValue(t.position), n.setVelocity(t.velocity), n;
|
|
100
182
|
}
|
|
101
183
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
onComplete: () => {
|
|
122
|
-
var i;
|
|
123
|
-
n = null, l = !1, (i = r.onEnd) == null || i.call(r);
|
|
124
|
-
}
|
|
125
|
-
}), n.backward();
|
|
126
|
-
return;
|
|
184
|
+
const k = Symbol.for("TRANSITION_STRATEGY"), I = (i) => ({
|
|
185
|
+
runIn: async (t) => {
|
|
186
|
+
const { currentAnimation: o } = i;
|
|
187
|
+
if (o && o.direction === "out") {
|
|
188
|
+
const a = o.animator.getCurrentState();
|
|
189
|
+
if (o.animator.stop(), t.out) {
|
|
190
|
+
const f = await t.out, { from: h = 1, to: c = 0 } = f;
|
|
191
|
+
return {
|
|
192
|
+
config: f,
|
|
193
|
+
state: a,
|
|
194
|
+
from: h,
|
|
195
|
+
// OUT animation's from
|
|
196
|
+
to: c,
|
|
197
|
+
// OUT animation's to
|
|
198
|
+
direction: "backward"
|
|
199
|
+
// Will actually go 0→1
|
|
200
|
+
};
|
|
201
|
+
}
|
|
127
202
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
203
|
+
const n = await t.in;
|
|
204
|
+
if (!n)
|
|
205
|
+
return {
|
|
206
|
+
state: {
|
|
207
|
+
position: 0,
|
|
208
|
+
velocity: 0
|
|
209
|
+
},
|
|
134
210
|
from: 0,
|
|
135
211
|
to: 1,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
212
|
+
direction: "forward"
|
|
213
|
+
};
|
|
214
|
+
const { from: e = 0, to: m = 1 } = n;
|
|
215
|
+
return {
|
|
216
|
+
config: n,
|
|
217
|
+
state: {
|
|
218
|
+
position: e,
|
|
219
|
+
velocity: 0
|
|
220
|
+
},
|
|
221
|
+
from: e,
|
|
222
|
+
to: m,
|
|
223
|
+
direction: "forward"
|
|
224
|
+
};
|
|
225
|
+
},
|
|
226
|
+
runOut: async (t) => {
|
|
227
|
+
const { currentAnimation: o } = i;
|
|
228
|
+
if (o && o.direction === "in") {
|
|
229
|
+
const a = o.animator.getCurrentState();
|
|
230
|
+
if (o.animator.stop(), t.in) {
|
|
231
|
+
const f = await t.in, { from: h = 0, to: c = 1 } = f;
|
|
232
|
+
return {
|
|
233
|
+
config: f,
|
|
234
|
+
state: {
|
|
235
|
+
position: a.position,
|
|
236
|
+
velocity: a.velocity
|
|
237
|
+
},
|
|
238
|
+
from: h,
|
|
239
|
+
// IN animation's from
|
|
240
|
+
to: c,
|
|
241
|
+
// IN animation's to
|
|
242
|
+
direction: "backward"
|
|
243
|
+
// Will actually go 1→0
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const n = await t.out;
|
|
248
|
+
if (!n)
|
|
249
|
+
return {
|
|
250
|
+
state: {
|
|
251
|
+
position: 1,
|
|
252
|
+
velocity: 0
|
|
141
253
|
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
254
|
+
from: 1,
|
|
255
|
+
to: 0,
|
|
256
|
+
direction: "forward"
|
|
257
|
+
};
|
|
258
|
+
const { from: e = 1, to: m = 0 } = n;
|
|
259
|
+
return {
|
|
260
|
+
config: n,
|
|
261
|
+
state: {
|
|
262
|
+
position: e,
|
|
263
|
+
velocity: 0
|
|
264
|
+
},
|
|
265
|
+
from: e,
|
|
266
|
+
to: m,
|
|
267
|
+
direction: "forward"
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
function D(i, t) {
|
|
272
|
+
var u;
|
|
273
|
+
let o = null, n = null, e = null, m = null;
|
|
274
|
+
const a = {
|
|
275
|
+
get currentAnimation() {
|
|
276
|
+
return o;
|
|
147
277
|
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
278
|
+
}, f = ((u = t == null ? void 0 : t.strategy) == null ? void 0 : u.call(t, a)) || I(a), h = async (r) => {
|
|
279
|
+
var y, S;
|
|
280
|
+
n && (n.remove(), n = null);
|
|
281
|
+
const s = i(), p = {
|
|
282
|
+
in: s.in && Promise.resolve(s.in(r)),
|
|
283
|
+
out: s.out && Promise.resolve(s.out(r))
|
|
284
|
+
}, l = await f.runIn(p);
|
|
285
|
+
if (!l.config)
|
|
286
|
+
return;
|
|
287
|
+
(S = (y = l.config).prepare) == null || S.call(y, r), l.config.wait && await l.config.wait();
|
|
288
|
+
const d = V.fromState(l.state, {
|
|
289
|
+
from: l.from,
|
|
290
|
+
to: l.to,
|
|
291
|
+
spring: l.config.spring,
|
|
292
|
+
onStart: l.config.onStart,
|
|
293
|
+
onUpdate: l.config.tick,
|
|
294
|
+
onComplete: () => {
|
|
295
|
+
var v, w;
|
|
296
|
+
o = null, (w = (v = l.config) == null ? void 0 : v.onEnd) == null || w.call(v);
|
|
161
297
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
(A = i.tick) == null || A.call(i, y);
|
|
173
|
-
},
|
|
174
|
-
onComplete: () => {
|
|
175
|
-
var y;
|
|
176
|
-
(y = i.onEnd) == null || y.call(i), m();
|
|
177
|
-
}
|
|
178
|
-
}), n.backward();
|
|
179
|
-
});
|
|
298
|
+
});
|
|
299
|
+
o = { animator: d, direction: "in" }, l.direction === "forward" ? d.forward() : d.backward();
|
|
300
|
+
}, c = async (r) => {
|
|
301
|
+
var S, v;
|
|
302
|
+
n = r;
|
|
303
|
+
const s = i(), p = {
|
|
304
|
+
in: s.in && Promise.resolve(s.in(r)),
|
|
305
|
+
out: s.out && Promise.resolve(s.out(r))
|
|
306
|
+
}, l = await f.runOut(p);
|
|
307
|
+
if (!l.config)
|
|
180
308
|
return;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
309
|
+
(v = (S = l.config).prepare) == null || v.call(S, r), y(), l.config.wait && await l.config.wait();
|
|
310
|
+
const d = V.fromState(l.state, {
|
|
311
|
+
from: l.from,
|
|
312
|
+
to: l.to,
|
|
313
|
+
spring: l.config.spring,
|
|
314
|
+
onStart: l.config.onStart,
|
|
315
|
+
onUpdate: l.config.tick,
|
|
316
|
+
onComplete: () => {
|
|
317
|
+
var w, T, O;
|
|
318
|
+
(T = (w = l.config) == null ? void 0 : w.onEnd) == null || T.call(w), n && (n.remove(), n = null), o = null, (O = t == null ? void 0 : t.onCleanupEnd) == null || O.call(t);
|
|
186
319
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
to: 0,
|
|
192
|
-
spring: r.spring,
|
|
193
|
-
onStart: r.onStart,
|
|
194
|
-
onUpdate: (a) => {
|
|
195
|
-
var p;
|
|
196
|
-
(p = r.tick) == null || p.call(r, a);
|
|
197
|
-
},
|
|
198
|
-
onComplete: () => {
|
|
199
|
-
var a;
|
|
200
|
-
(a = r.onEnd) == null || a.call(r), m();
|
|
201
|
-
}
|
|
202
|
-
}), n.forward();
|
|
203
|
-
});
|
|
320
|
+
});
|
|
321
|
+
o = { animator: d, direction: "out" }, l.direction === "forward" ? d.forward() : d.backward();
|
|
322
|
+
function y() {
|
|
323
|
+
!e || !n || (m && e.contains(m) ? e.insertBefore(n, m) : e.appendChild(n));
|
|
204
324
|
}
|
|
205
|
-
}
|
|
206
|
-
return (
|
|
207
|
-
|
|
208
|
-
|
|
325
|
+
};
|
|
326
|
+
return (r) => {
|
|
327
|
+
if (r)
|
|
328
|
+
return e = r.parentElement, m = r.nextElementSibling, h(r), () => {
|
|
329
|
+
const s = r.cloneNode(!0);
|
|
330
|
+
c(s);
|
|
331
|
+
};
|
|
332
|
+
};
|
|
209
333
|
}
|
|
210
|
-
const
|
|
211
|
-
function
|
|
212
|
-
|
|
213
|
-
let n =
|
|
214
|
-
return n || (n =
|
|
334
|
+
const A = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
335
|
+
function N(i, t, o) {
|
|
336
|
+
A.set(i, t);
|
|
337
|
+
let n = C.get(i);
|
|
338
|
+
return n || (n = D(
|
|
215
339
|
() => {
|
|
216
|
-
const
|
|
217
|
-
return
|
|
340
|
+
const e = A.get(i);
|
|
341
|
+
return e || (console.warn(`Transition "${String(i)}" not found`), {});
|
|
218
342
|
},
|
|
219
343
|
{
|
|
220
|
-
|
|
344
|
+
strategy: o,
|
|
345
|
+
onCleanupEnd: () => P(i)
|
|
221
346
|
}
|
|
222
|
-
),
|
|
347
|
+
), C.set(i, n), n);
|
|
223
348
|
}
|
|
224
|
-
function
|
|
225
|
-
|
|
349
|
+
function P(i) {
|
|
350
|
+
A.delete(i), C.delete(i);
|
|
226
351
|
}
|
|
227
|
-
function
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
352
|
+
function $() {
|
|
353
|
+
const i = U(new Error().stack);
|
|
354
|
+
return i ? `auto_${i.file}_${i.line}_${i.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
|
|
355
|
+
}
|
|
356
|
+
const R = globalThis.FinalizationRegistry, j = R ? new R((i) => {
|
|
357
|
+
try {
|
|
358
|
+
P(i);
|
|
359
|
+
} catch {
|
|
360
|
+
}
|
|
361
|
+
}) : void 0;
|
|
362
|
+
function Y(i) {
|
|
363
|
+
const t = i.key ?? $();
|
|
364
|
+
if (i.ref && j)
|
|
365
|
+
try {
|
|
366
|
+
j.register(i.ref, t);
|
|
367
|
+
} catch {
|
|
368
|
+
}
|
|
369
|
+
return N(
|
|
370
|
+
t,
|
|
371
|
+
{
|
|
372
|
+
in: i.in,
|
|
373
|
+
out: i.out
|
|
374
|
+
},
|
|
375
|
+
i[k]
|
|
376
|
+
);
|
|
232
377
|
}
|
|
233
|
-
function
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
n
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const S = () => {
|
|
250
|
-
c && l && u.set(l, {
|
|
251
|
-
x: c.scrollLeft,
|
|
252
|
-
y: c.scrollTop
|
|
378
|
+
function F(i) {
|
|
379
|
+
const t = i.filter((o) => o.symmetric).map((o) => ({
|
|
380
|
+
from: o.to,
|
|
381
|
+
to: o.from,
|
|
382
|
+
transition: o.transition
|
|
383
|
+
}));
|
|
384
|
+
return [...i, ...t];
|
|
385
|
+
}
|
|
386
|
+
function L() {
|
|
387
|
+
let i = null;
|
|
388
|
+
const t = /* @__PURE__ */ new Map();
|
|
389
|
+
let o = null;
|
|
390
|
+
const n = () => {
|
|
391
|
+
i && o && t.set(o, {
|
|
392
|
+
x: i.scrollLeft,
|
|
393
|
+
y: i.scrollTop
|
|
253
394
|
});
|
|
254
|
-
}, w = (e, r) => {
|
|
255
|
-
c || (c = b(e), c.addEventListener("scroll", S, {
|
|
256
|
-
passive: !0
|
|
257
|
-
})), l = r;
|
|
258
|
-
}, f = () => {
|
|
259
|
-
const e = t == null ? void 0 : t.from, r = t == null ? void 0 : t.to, i = e && u.has(e) ? u.get(e) : { x: 0, y: 0 }, a = r && u.has(r) ? u.get(r) : { x: 0, y: 0 };
|
|
260
|
-
return {
|
|
261
|
-
x: -a.x + i.x,
|
|
262
|
-
y: -a.y + i.y
|
|
263
|
-
};
|
|
264
395
|
};
|
|
396
|
+
return {
|
|
397
|
+
startScrollTracking: (a, f) => {
|
|
398
|
+
i || (i = _(a), (i === document.documentElement ? window : i).addEventListener("scroll", n, {
|
|
399
|
+
passive: !0
|
|
400
|
+
})), o = f;
|
|
401
|
+
},
|
|
402
|
+
calculateScrollOffset: (a, f) => {
|
|
403
|
+
const h = a && t.has(a) ? t.get(a) : { x: 0, y: 0 }, c = f && t.has(f) ? t.get(f) : { x: 0, y: 0 };
|
|
404
|
+
return {
|
|
405
|
+
x: -c.x + h.x,
|
|
406
|
+
y: -c.y + h.y
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
function B(i) {
|
|
412
|
+
const {
|
|
413
|
+
transitions: t = [],
|
|
414
|
+
defaultTransition: o,
|
|
415
|
+
middleware: n = (u, r) => ({ from: u, to: r })
|
|
416
|
+
// Identity function as default
|
|
417
|
+
} = i;
|
|
418
|
+
let e = null;
|
|
419
|
+
const m = F(t), { startScrollTracking: a, calculateScrollOffset: f } = L();
|
|
265
420
|
function h() {
|
|
266
|
-
if (
|
|
267
|
-
const r =
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
),
|
|
275
|
-
|
|
276
|
-
|
|
421
|
+
if (e != null && e.from && (e != null && e.to)) {
|
|
422
|
+
const { from: u, to: r } = n(
|
|
423
|
+
e.from,
|
|
424
|
+
e.to
|
|
425
|
+
), p = z(
|
|
426
|
+
u,
|
|
427
|
+
r,
|
|
428
|
+
m
|
|
429
|
+
) || o, d = { scrollOffset: f(e.from, e.to) };
|
|
430
|
+
p && (p.out && e.outResolve && e.outResolve(
|
|
431
|
+
(y) => p.out(y, d)
|
|
432
|
+
), p.in && e.inResolve && e.inResolve(
|
|
433
|
+
(y) => p.in(y, d)
|
|
434
|
+
)), e = null;
|
|
277
435
|
}
|
|
278
436
|
}
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
})) : (
|
|
282
|
-
|
|
437
|
+
const c = async (u, r) => r === "in" && (!e || !e.from) ? () => ({}) : (e || (e = {}), r === "out" ? (e.from = u, new Promise((s) => {
|
|
438
|
+
e.outResolve = s, h();
|
|
439
|
+
})) : (e.to = u, new Promise((s) => {
|
|
440
|
+
e.inResolve = s, h();
|
|
283
441
|
})));
|
|
284
|
-
return (
|
|
285
|
-
key:
|
|
286
|
-
in: async (r) => (
|
|
287
|
-
out: async (r) => (await
|
|
442
|
+
return (u) => ({
|
|
443
|
+
key: u,
|
|
444
|
+
in: async (r) => (a(r, u), (await c(u, "in"))(r)),
|
|
445
|
+
out: async (r) => (await c(u, "out"))(r)
|
|
288
446
|
});
|
|
289
447
|
}
|
|
290
|
-
function
|
|
291
|
-
for (const
|
|
292
|
-
if (
|
|
293
|
-
return
|
|
294
|
-
for (const
|
|
295
|
-
if ((
|
|
296
|
-
return
|
|
448
|
+
function z(i, t, o) {
|
|
449
|
+
for (const n of o)
|
|
450
|
+
if (b(i, n.from) && b(t, n.to))
|
|
451
|
+
return n.transition;
|
|
452
|
+
for (const n of o)
|
|
453
|
+
if ((n.from === "*" || b(i, n.from)) && (n.to === "*" || b(t, n.to)))
|
|
454
|
+
return n.transition;
|
|
297
455
|
return null;
|
|
298
456
|
}
|
|
299
|
-
function
|
|
457
|
+
function b(i, t) {
|
|
300
458
|
if (t === "*")
|
|
301
459
|
return !0;
|
|
302
460
|
if (t.endsWith("/*")) {
|
|
303
|
-
const
|
|
304
|
-
return
|
|
461
|
+
const o = t.slice(0, -2);
|
|
462
|
+
return i === o || i.startsWith(o + "/");
|
|
305
463
|
}
|
|
306
|
-
return
|
|
464
|
+
return i === t;
|
|
307
465
|
}
|
|
308
466
|
export {
|
|
309
|
-
|
|
310
|
-
|
|
467
|
+
k as TRANSITION_STRATEGY,
|
|
468
|
+
I as createDefaultStrategy,
|
|
469
|
+
B as createSggoiTransitionContext,
|
|
470
|
+
$ as generateAutoKey,
|
|
471
|
+
Y as transition
|
|
311
472
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={stiffness:170,damping:26},n={stiffness:120,damping:14},t={stiffness:180,damping:12},e={stiffness:210,damping:20},f={stiffness:280,damping:60},i={stiffness:280,damping:120},o={default:s,gentle:n,wobbly:t,stiff:e,slow:f,molasses:i};exports.config=o;exports.defaultSpring=s;exports.gentle=n;exports.molasses=i;exports.slow=f;exports.stiff=e;exports.wobbly=t;
|