flemo 1.0.0 → 1.1.1
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 +1 -1
- package/dist/index.mjs +526 -388
- package/dist/screen/Screen.d.ts +3 -2
- package/dist/screen/ScreenMotion.d.ts +3 -2
- package/dist/transition/decorator/typing.d.ts +9 -1
- package/dist/transition/typing.d.ts +4 -1
- package/dist/utils/findScrollable.d.ts +13 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as P, jsxs as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { d as
|
|
4
|
-
import { animate as
|
|
5
|
-
import { animate as
|
|
6
|
-
function
|
|
7
|
-
const a = Array.isArray(
|
|
8
|
-
return
|
|
1
|
+
import { jsx as P, jsxs as tt } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as R, createContext as X, useReducer as gt, Children as et, useContext as q, Suspense as Pt, useImperativeHandle as yt, useRef as L } from "react";
|
|
3
|
+
import { d as I, c as U } from "./vendor-C8cPYUOQ.js";
|
|
4
|
+
import { animate as F } from "motion";
|
|
5
|
+
import { animate as M, transform as nt, useAnimate as rt, motion as at, useDragControls as wt } from "motion/react";
|
|
6
|
+
function St(n, e, t) {
|
|
7
|
+
const a = Array.isArray(n) ? n.find((i) => I.pathToRegexp(i).regexp.test(e)) || "" : I.pathToRegexp(n).regexp.test(e) ? n : "", r = I.match(a)(e), s = new URLSearchParams(t), o = Object.fromEntries(s.entries());
|
|
8
|
+
return r ? { ...r.params, ...o } : {};
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function J() {
|
|
11
11
|
return typeof document > "u";
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class Et {
|
|
14
14
|
tasks = /* @__PURE__ */ new Map();
|
|
15
15
|
instanceId = Date.now().toString();
|
|
16
16
|
isLocked = !1;
|
|
@@ -19,7 +19,7 @@ class ot {
|
|
|
19
19
|
signalListeners = /* @__PURE__ */ new Map();
|
|
20
20
|
// 신호 리스너
|
|
21
21
|
async acquireLock(e) {
|
|
22
|
-
for (let
|
|
22
|
+
for (let r = 0; r < 10; r++) {
|
|
23
23
|
if (!this.isLocked)
|
|
24
24
|
return this.isLocked = !0, this.currentTaskId = e, !0;
|
|
25
25
|
await new Promise((s) => setTimeout(s, 100));
|
|
@@ -40,72 +40,72 @@ class ot {
|
|
|
40
40
|
}
|
|
41
41
|
async addTask(e, t = {}) {
|
|
42
42
|
const a = t.id || this.generateTaskId();
|
|
43
|
-
return new Promise((
|
|
43
|
+
return new Promise((r, s) => {
|
|
44
44
|
this.taskQueue = this.taskQueue.then(async () => {
|
|
45
45
|
try {
|
|
46
|
-
const { control:
|
|
46
|
+
const { control: o, validate: i, rollback: c, dependencies: p = [] } = t, u = {
|
|
47
47
|
id: a,
|
|
48
48
|
execute: e,
|
|
49
49
|
timestamp: Date.now(),
|
|
50
50
|
retryCount: 0,
|
|
51
51
|
status: "PENDING",
|
|
52
|
-
dependencies:
|
|
52
|
+
dependencies: p,
|
|
53
53
|
instanceId: this.instanceId,
|
|
54
54
|
validate: i,
|
|
55
|
-
rollback:
|
|
56
|
-
control:
|
|
55
|
+
rollback: c,
|
|
56
|
+
control: o
|
|
57
57
|
};
|
|
58
|
-
this.tasks.set(
|
|
58
|
+
this.tasks.set(u.id, u);
|
|
59
59
|
try {
|
|
60
|
-
if (!await this.acquireLock(
|
|
61
|
-
throw
|
|
60
|
+
if (!await this.acquireLock(u.id))
|
|
61
|
+
throw u.status = "FAILED", new Error("FAILED");
|
|
62
62
|
try {
|
|
63
|
-
|
|
64
|
-
for (const l of
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
67
|
-
throw
|
|
63
|
+
u.status = "PROCESSING";
|
|
64
|
+
for (const l of u.dependencies) {
|
|
65
|
+
const w = this.tasks.get(l);
|
|
66
|
+
if (!w || w.status !== "COMPLETED")
|
|
67
|
+
throw u.status = "FAILED", new Error("FAILED");
|
|
68
68
|
}
|
|
69
|
-
if (
|
|
70
|
-
throw
|
|
71
|
-
const
|
|
69
|
+
if (u.validate && !await u.validate())
|
|
70
|
+
throw u.status = "FAILED", new Error("FAILED");
|
|
71
|
+
const d = await u.execute();
|
|
72
72
|
if (t.control) {
|
|
73
73
|
const l = t.control;
|
|
74
|
-
if (l.delay && l.delay > 0 && await new Promise((
|
|
75
|
-
|
|
74
|
+
if (l.delay && l.delay > 0 && await new Promise((w) => setTimeout(w, l.delay)), l.manual) {
|
|
75
|
+
u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: s, result: d };
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
if (l.signal) {
|
|
79
|
-
|
|
79
|
+
u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: s, result: d }, this.signalListeners.has(l.signal) || this.signalListeners.set(l.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(l.signal).add(u.id);
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
if (l.condition && !await l.condition()) {
|
|
83
|
-
|
|
83
|
+
u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: s, result: d };
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
u.status = "COMPLETED", r({
|
|
88
88
|
success: !0,
|
|
89
|
-
result:
|
|
90
|
-
taskId:
|
|
89
|
+
result: d,
|
|
90
|
+
taskId: u.id,
|
|
91
91
|
timestamp: Date.now(),
|
|
92
92
|
instanceId: this.instanceId
|
|
93
93
|
});
|
|
94
|
-
} catch (
|
|
95
|
-
if (
|
|
94
|
+
} catch (d) {
|
|
95
|
+
if (u.status = "FAILED", u.rollback)
|
|
96
96
|
try {
|
|
97
|
-
await
|
|
97
|
+
await u.rollback(), u.status = "ROLLEDBACK";
|
|
98
98
|
} catch {
|
|
99
99
|
}
|
|
100
|
-
throw
|
|
100
|
+
throw d;
|
|
101
101
|
} finally {
|
|
102
|
-
this.releaseLock(
|
|
102
|
+
this.releaseLock(u.id);
|
|
103
103
|
}
|
|
104
|
-
} catch (
|
|
105
|
-
s(
|
|
104
|
+
} catch (h) {
|
|
105
|
+
s(h);
|
|
106
106
|
}
|
|
107
|
-
} catch (
|
|
108
|
-
s(
|
|
107
|
+
} catch (o) {
|
|
108
|
+
s(o);
|
|
109
109
|
}
|
|
110
110
|
}).catch(s);
|
|
111
111
|
});
|
|
@@ -139,103 +139,103 @@ class ot {
|
|
|
139
139
|
return Array.from(this.tasks.values()).filter((e) => e.status === "MANUAL_PENDING");
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const m = new Et(), x = U((n) => ({
|
|
143
143
|
index: -1,
|
|
144
144
|
histories: [],
|
|
145
|
-
addHistory: (e) =>
|
|
145
|
+
addHistory: (e) => n((t) => ({
|
|
146
146
|
index: t.index + 1,
|
|
147
147
|
histories: t.histories.concat(e)
|
|
148
148
|
})),
|
|
149
|
-
replaceHistory: (e) =>
|
|
149
|
+
replaceHistory: (e) => n((t) => (t.histories.splice(e, 1), {
|
|
150
150
|
index: t.index - 1,
|
|
151
151
|
histories: t.histories
|
|
152
152
|
})),
|
|
153
|
-
popHistory: (e) =>
|
|
153
|
+
popHistory: (e) => n((t) => ({
|
|
154
154
|
index: t.index - 1,
|
|
155
|
-
histories: t.histories.filter((a,
|
|
155
|
+
histories: t.histories.filter((a, r) => r !== e)
|
|
156
156
|
}))
|
|
157
|
-
})),
|
|
157
|
+
})), C = U((n) => ({
|
|
158
158
|
status: "IDLE",
|
|
159
|
-
setStatus: (e) =>
|
|
159
|
+
setStatus: (e) => n({ status: e })
|
|
160
160
|
}));
|
|
161
|
-
function
|
|
162
|
-
return
|
|
163
|
-
const
|
|
164
|
-
await
|
|
165
|
-
const { index: t, addHistory: a, popHistory:
|
|
166
|
-
|
|
161
|
+
function vt() {
|
|
162
|
+
return R(() => {
|
|
163
|
+
const n = async (e) => {
|
|
164
|
+
await m.resolveAllPending();
|
|
165
|
+
const { index: t, addHistory: a, popHistory: r } = x.getState(), s = C.getState().setStatus, o = e.state?.id, i = e.state?.index, c = e.state?.status, p = e.state?.params, u = e.state?.transitionName, h = i < t, d = c === "PUSHING" && i > t, l = c === "REPLACING" && i > t;
|
|
166
|
+
h ? (await m.addTask(
|
|
167
167
|
async () => (s("POPPING"), async () => {
|
|
168
|
-
|
|
168
|
+
r(i + 1), m.getManualPendingTasks().length || s("COMPLETED");
|
|
169
169
|
}),
|
|
170
170
|
{
|
|
171
|
-
id:
|
|
171
|
+
id: o,
|
|
172
172
|
control: {
|
|
173
173
|
manual: !0
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
))?.result?.() :
|
|
176
|
+
))?.result?.() : d ? (await m.addTask(
|
|
177
177
|
async () => (s("PUSHING"), a({
|
|
178
|
-
id:
|
|
178
|
+
id: o,
|
|
179
179
|
pathname: window.location.pathname,
|
|
180
|
-
params:
|
|
181
|
-
transitionName:
|
|
180
|
+
params: p,
|
|
181
|
+
transitionName: u
|
|
182
182
|
}), async () => {
|
|
183
|
-
|
|
183
|
+
m.getManualPendingTasks().length || s("COMPLETED");
|
|
184
184
|
}),
|
|
185
185
|
{
|
|
186
|
-
id:
|
|
186
|
+
id: o,
|
|
187
187
|
control: {
|
|
188
188
|
manual: !0
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
))?.result?.() : l && (await
|
|
191
|
+
))?.result?.() : l && (await m.addTask(
|
|
192
192
|
async () => (s("REPLACING"), a({
|
|
193
|
-
id:
|
|
193
|
+
id: o,
|
|
194
194
|
pathname: window.location.pathname,
|
|
195
|
-
params:
|
|
196
|
-
transitionName:
|
|
195
|
+
params: p,
|
|
196
|
+
transitionName: u
|
|
197
197
|
}), async () => {
|
|
198
|
-
|
|
198
|
+
m.getManualPendingTasks().length || s("COMPLETED");
|
|
199
199
|
}),
|
|
200
200
|
{
|
|
201
|
-
id:
|
|
201
|
+
id: o,
|
|
202
202
|
control: {
|
|
203
203
|
manual: !0
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
))?.result?.();
|
|
207
207
|
};
|
|
208
|
-
return window.addEventListener("popstate",
|
|
209
|
-
window.removeEventListener("popstate",
|
|
208
|
+
return window.addEventListener("popstate", n), () => {
|
|
209
|
+
window.removeEventListener("popstate", n);
|
|
210
210
|
};
|
|
211
211
|
}, []), null;
|
|
212
212
|
}
|
|
213
|
-
const
|
|
213
|
+
const st = X({}), ot = X(() => {
|
|
214
214
|
});
|
|
215
|
-
function
|
|
215
|
+
function Lt(n, e) {
|
|
216
216
|
switch (e.type) {
|
|
217
217
|
case "SET":
|
|
218
218
|
return e.params;
|
|
219
219
|
default:
|
|
220
|
-
return
|
|
220
|
+
return n;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
children:
|
|
223
|
+
function Tt({
|
|
224
|
+
children: n,
|
|
225
225
|
active: e,
|
|
226
226
|
params: t
|
|
227
227
|
}) {
|
|
228
|
-
const [a,
|
|
229
|
-
return
|
|
230
|
-
const s = (
|
|
231
|
-
|
|
228
|
+
const [a, r] = gt(Lt, t);
|
|
229
|
+
return R(() => {
|
|
230
|
+
const s = (o) => {
|
|
231
|
+
o.state?.step && r({ type: "SET", params: o.state?.params || {} });
|
|
232
232
|
};
|
|
233
233
|
return e && window.addEventListener("popstate", s), () => {
|
|
234
234
|
window.removeEventListener("popstate", s);
|
|
235
235
|
};
|
|
236
|
-
}, [e,
|
|
236
|
+
}, [e, r]), /* @__PURE__ */ P(ot.Provider, { value: r, children: /* @__PURE__ */ P(st.Provider, { value: a, children: n }) });
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const it = X({
|
|
239
239
|
id: "",
|
|
240
240
|
isActive: !1,
|
|
241
241
|
isRoot: !0,
|
|
@@ -246,42 +246,42 @@ const W = O({
|
|
|
246
246
|
transitionName: "none",
|
|
247
247
|
prevTransitionName: "none"
|
|
248
248
|
});
|
|
249
|
-
function
|
|
250
|
-
const e =
|
|
249
|
+
function Dt({ children: n }) {
|
|
250
|
+
const e = x((a) => a.index), t = x((a) => a.histories);
|
|
251
251
|
return t.map(
|
|
252
|
-
(a) =>
|
|
253
|
-
(
|
|
252
|
+
(a) => et.toArray(n).filter(
|
|
253
|
+
(r) => I.pathToRegexp(r.props.path).regexp.test(
|
|
254
254
|
a.pathname
|
|
255
255
|
)
|
|
256
256
|
)
|
|
257
|
-
).map(([a],
|
|
258
|
-
|
|
257
|
+
).map(([a], r) => /* @__PURE__ */ P(
|
|
258
|
+
it.Provider,
|
|
259
259
|
{
|
|
260
260
|
value: {
|
|
261
|
-
id: t[
|
|
262
|
-
isActive:
|
|
263
|
-
isRoot:
|
|
264
|
-
isPrev:
|
|
265
|
-
zIndex:
|
|
266
|
-
pathname: t[
|
|
267
|
-
params: t[
|
|
261
|
+
id: t[r].id,
|
|
262
|
+
isActive: r === e,
|
|
263
|
+
isRoot: r === 0,
|
|
264
|
+
isPrev: r < e - 1,
|
|
265
|
+
zIndex: r,
|
|
266
|
+
pathname: t[r].pathname,
|
|
267
|
+
params: t[r].params,
|
|
268
268
|
transitionName: t[e].transitionName,
|
|
269
269
|
prevTransitionName: t[e - 1]?.transitionName
|
|
270
270
|
},
|
|
271
|
-
children: /* @__PURE__ */ P(
|
|
271
|
+
children: /* @__PURE__ */ P(Tt, { active: r === e, params: t[r].params, children: a })
|
|
272
272
|
},
|
|
273
|
-
t[
|
|
273
|
+
t[r].id
|
|
274
274
|
));
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
name:
|
|
276
|
+
function Nt({
|
|
277
|
+
name: n,
|
|
278
278
|
initial: e,
|
|
279
279
|
enter: t,
|
|
280
280
|
exit: a,
|
|
281
|
-
options:
|
|
281
|
+
options: r
|
|
282
282
|
}) {
|
|
283
283
|
return {
|
|
284
|
-
name:
|
|
284
|
+
name: n,
|
|
285
285
|
initial: e,
|
|
286
286
|
variants: {
|
|
287
287
|
"IDLE-true": t,
|
|
@@ -295,10 +295,10 @@ function pt({
|
|
|
295
295
|
"COMPLETED-false": a,
|
|
296
296
|
"COMPLETED-true": t
|
|
297
297
|
},
|
|
298
|
-
...
|
|
298
|
+
...r
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
const
|
|
301
|
+
const kt = Nt({
|
|
302
302
|
name: "overlay",
|
|
303
303
|
initial: {
|
|
304
304
|
opacity: 0,
|
|
@@ -326,32 +326,50 @@ const ft = pt({
|
|
|
326
326
|
}
|
|
327
327
|
},
|
|
328
328
|
options: {
|
|
329
|
-
|
|
329
|
+
onSwipeStart: (n, { prevDecorator: e }) => F(
|
|
330
330
|
e,
|
|
331
331
|
{
|
|
332
|
-
opacity:
|
|
332
|
+
opacity: n ? 1 : 0
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
duration: 0.3
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
onSwipe: (n, e, { prevDecorator: t }) => F(
|
|
339
|
+
t,
|
|
340
|
+
{
|
|
341
|
+
opacity: Math.max(0, 1 - e / 100)
|
|
333
342
|
},
|
|
334
343
|
{
|
|
335
344
|
duration: 0
|
|
336
345
|
}
|
|
346
|
+
),
|
|
347
|
+
onSwipeEnd: (n, { prevDecorator: e }) => F(
|
|
348
|
+
e,
|
|
349
|
+
{
|
|
350
|
+
opacity: n ? 0 : 1
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
duration: 0.3
|
|
354
|
+
}
|
|
337
355
|
)
|
|
338
356
|
}
|
|
339
|
-
}),
|
|
357
|
+
}), j = /* @__PURE__ */ new Map([["overlay", kt]]), _ = U((n) => ({
|
|
340
358
|
defaultTransitionName: "cupertino",
|
|
341
|
-
setDefaultTransitionName: (e) =>
|
|
359
|
+
setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
|
|
342
360
|
}));
|
|
343
|
-
function
|
|
344
|
-
name:
|
|
361
|
+
function K({
|
|
362
|
+
name: n,
|
|
345
363
|
initial: e,
|
|
346
364
|
idle: t,
|
|
347
365
|
enter: a,
|
|
348
|
-
enterBack:
|
|
366
|
+
enterBack: r,
|
|
349
367
|
exit: s,
|
|
350
|
-
exitBack:
|
|
368
|
+
exitBack: o,
|
|
351
369
|
options: i
|
|
352
370
|
}) {
|
|
353
371
|
return {
|
|
354
|
-
name:
|
|
372
|
+
name: n,
|
|
355
373
|
initial: e,
|
|
356
374
|
variants: {
|
|
357
375
|
"IDLE-true": t,
|
|
@@ -360,15 +378,15 @@ function U({
|
|
|
360
378
|
"PUSHING-true": a,
|
|
361
379
|
"REPLACING-false": s,
|
|
362
380
|
"REPLACING-true": a,
|
|
363
|
-
"POPPING-false":
|
|
364
|
-
"POPPING-true":
|
|
381
|
+
"POPPING-false": o,
|
|
382
|
+
"POPPING-true": r,
|
|
365
383
|
"COMPLETED-false": s,
|
|
366
384
|
"COMPLETED-true": a
|
|
367
385
|
},
|
|
368
386
|
...i
|
|
369
387
|
};
|
|
370
388
|
}
|
|
371
|
-
const
|
|
389
|
+
const It = K({
|
|
372
390
|
name: "cupertino",
|
|
373
391
|
initial: {
|
|
374
392
|
x: "100%",
|
|
@@ -423,62 +441,54 @@ const ht = U({
|
|
|
423
441
|
options: {
|
|
424
442
|
decoratorName: "overlay",
|
|
425
443
|
swipeDirection: "x",
|
|
426
|
-
onSwipeStart: async (
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
{
|
|
431
|
-
x: 0
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
duration: 0.3
|
|
435
|
-
}
|
|
436
|
-
));
|
|
437
|
-
},
|
|
438
|
-
onSwipe: (r, e, { currentScreen: t, prevScreen: a }) => {
|
|
439
|
-
const { offset: n } = e, s = n.x, c = X(s, [0, window.innerWidth], [0, 100]);
|
|
440
|
-
return w(
|
|
444
|
+
onSwipeStart: async () => !0,
|
|
445
|
+
onSwipe: (n, e, { currentScreen: t, prevScreen: a, onProgress: r }) => {
|
|
446
|
+
const { offset: s } = e, o = s.x, i = nt(o, [0, window.innerWidth], [0, 100]);
|
|
447
|
+
return r?.(!0, i), M(
|
|
441
448
|
t,
|
|
442
449
|
{
|
|
443
|
-
x: Math.max(0,
|
|
450
|
+
x: Math.max(0, o)
|
|
444
451
|
},
|
|
445
452
|
{
|
|
446
453
|
duration: 0
|
|
447
454
|
}
|
|
448
|
-
),
|
|
455
|
+
), M(
|
|
449
456
|
a,
|
|
450
457
|
{
|
|
451
|
-
x: -100 +
|
|
458
|
+
x: -100 + i
|
|
452
459
|
},
|
|
453
460
|
{
|
|
454
461
|
duration: 0
|
|
455
462
|
}
|
|
456
|
-
), c;
|
|
457
|
-
},
|
|
458
|
-
onSwipeEnd: async (r, e, { currentScreen: t, prevScreen: a }) => {
|
|
459
|
-
const { offset: n, velocity: s } = e, i = n.x > 50 || s.x > 20;
|
|
460
|
-
return w(
|
|
461
|
-
t,
|
|
462
|
-
{
|
|
463
|
-
x: i ? "100%" : 0
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
duration: 0.3,
|
|
467
|
-
ease: [0.32, 0.72, 0, 1]
|
|
468
|
-
}
|
|
469
|
-
), w(
|
|
470
|
-
a,
|
|
471
|
-
{
|
|
472
|
-
x: i ? 0 : -100
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
duration: 0.3,
|
|
476
|
-
ease: [0.32, 0.72, 0, 1]
|
|
477
|
-
}
|
|
478
463
|
), i;
|
|
464
|
+
},
|
|
465
|
+
onSwipeEnd: async (n, e, { currentScreen: t, prevScreen: a, onStart: r }) => {
|
|
466
|
+
const { offset: s, velocity: o } = e, c = s.x > 50 || o.x > 20;
|
|
467
|
+
return r?.(c), await Promise.all([
|
|
468
|
+
M(
|
|
469
|
+
t,
|
|
470
|
+
{
|
|
471
|
+
x: c ? "100%" : 0
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
duration: 0.3,
|
|
475
|
+
ease: [0.32, 0.72, 0, 1]
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
M(
|
|
479
|
+
a,
|
|
480
|
+
{
|
|
481
|
+
x: c ? 0 : -100
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
duration: 0.3,
|
|
485
|
+
ease: [0.32, 0.72, 0, 1]
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
]), c;
|
|
479
489
|
}
|
|
480
490
|
}
|
|
481
|
-
}),
|
|
491
|
+
}), Mt = K({
|
|
482
492
|
name: "material",
|
|
483
493
|
initial: {
|
|
484
494
|
y: "100%",
|
|
@@ -538,68 +548,56 @@ const ht = U({
|
|
|
538
548
|
},
|
|
539
549
|
options: {
|
|
540
550
|
swipeDirection: "y",
|
|
541
|
-
onSwipeStart: async (
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
{
|
|
546
|
-
y: 0,
|
|
547
|
-
opacity: 1
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
duration: 0.24
|
|
551
|
-
}
|
|
552
|
-
));
|
|
553
|
-
},
|
|
554
|
-
onSwipe: (r, e, { currentScreen: t, prevScreen: a }) => {
|
|
555
|
-
const { offset: n } = e, s = n.y, c = Math.max(0, Math.min(56, s)), i = X(c, [0, 56], [1, 0.96]), p = Math.max(0, s - 56), h = Math.min(1, p / 160), o = Math.sqrt(h) * 12, d = Math.max(0, c + o), u = Math.min(56, d);
|
|
556
|
-
return w(
|
|
551
|
+
onSwipeStart: async () => !0,
|
|
552
|
+
onSwipe: (n, e, { currentScreen: t, prevScreen: a, onProgress: r }) => {
|
|
553
|
+
const { offset: s } = e, o = s.y, i = Math.max(0, Math.min(56, o)), c = nt(i, [0, 56], [1, 0.96]), p = Math.max(0, o - 56), u = Math.min(1, p / 160), h = Math.sqrt(u) * 12, d = Math.max(0, i + h), l = Math.min(56, d);
|
|
554
|
+
return r?.(!0, l), M(
|
|
557
555
|
t,
|
|
558
556
|
{
|
|
559
557
|
y: d,
|
|
560
|
-
opacity:
|
|
558
|
+
opacity: c
|
|
561
559
|
},
|
|
562
560
|
{
|
|
563
561
|
duration: 0
|
|
564
562
|
}
|
|
565
|
-
),
|
|
563
|
+
), M(
|
|
566
564
|
a,
|
|
567
565
|
{
|
|
568
|
-
y: -56 +
|
|
569
|
-
opacity:
|
|
566
|
+
y: -56 + l,
|
|
567
|
+
opacity: l / 56
|
|
570
568
|
},
|
|
571
569
|
{ duration: 0 }
|
|
572
|
-
),
|
|
570
|
+
), l;
|
|
573
571
|
},
|
|
574
|
-
onSwipeEnd: async (
|
|
575
|
-
const { offset:
|
|
576
|
-
return await Promise.all([
|
|
577
|
-
|
|
572
|
+
onSwipeEnd: async (n, e, { currentScreen: t, prevScreen: a, onStart: r }) => {
|
|
573
|
+
const { offset: s, velocity: o } = e, c = s.y > 56 || o.y > 20;
|
|
574
|
+
return r?.(c), await Promise.all([
|
|
575
|
+
M(
|
|
578
576
|
t,
|
|
579
577
|
{
|
|
580
|
-
y:
|
|
581
|
-
opacity:
|
|
578
|
+
y: c ? "100%" : 0,
|
|
579
|
+
opacity: c ? 0.96 : 1
|
|
582
580
|
},
|
|
583
581
|
{
|
|
584
|
-
duration:
|
|
585
|
-
ease:
|
|
582
|
+
duration: c ? 0.22 : 0.24,
|
|
583
|
+
ease: c ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
|
|
586
584
|
}
|
|
587
585
|
),
|
|
588
|
-
|
|
586
|
+
M(
|
|
589
587
|
a,
|
|
590
588
|
{
|
|
591
|
-
y:
|
|
592
|
-
opacity:
|
|
589
|
+
y: c ? 0 : -56,
|
|
590
|
+
opacity: c ? 1 : 0.96
|
|
593
591
|
},
|
|
594
592
|
{
|
|
595
|
-
duration:
|
|
596
|
-
ease:
|
|
593
|
+
duration: c ? 0.22 : 0.24,
|
|
594
|
+
ease: c ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
|
|
597
595
|
}
|
|
598
596
|
)
|
|
599
|
-
]),
|
|
597
|
+
]), c;
|
|
600
598
|
}
|
|
601
599
|
}
|
|
602
|
-
}),
|
|
600
|
+
}), xt = K({
|
|
603
601
|
name: "none",
|
|
604
602
|
initial: {
|
|
605
603
|
transition: {
|
|
@@ -636,135 +634,147 @@ const ht = U({
|
|
|
636
634
|
duration: 0
|
|
637
635
|
}
|
|
638
636
|
}
|
|
639
|
-
}),
|
|
640
|
-
["none",
|
|
641
|
-
["cupertino",
|
|
642
|
-
["material",
|
|
643
|
-
]),
|
|
644
|
-
const
|
|
645
|
-
for (const t of
|
|
637
|
+
}), $ = /* @__PURE__ */ new Map([
|
|
638
|
+
["none", xt],
|
|
639
|
+
["cupertino", It],
|
|
640
|
+
["material", Mt]
|
|
641
|
+
]), Rt = (() => {
|
|
642
|
+
const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
|
|
643
|
+
for (const t of $.values()) {
|
|
646
644
|
const a = t.variants["IDLE-true"].value;
|
|
647
|
-
for (const
|
|
648
|
-
e.call(a,
|
|
645
|
+
for (const r in a)
|
|
646
|
+
e.call(a, r) && (n[r] = a[r]);
|
|
649
647
|
}
|
|
650
|
-
return
|
|
648
|
+
return n;
|
|
651
649
|
})();
|
|
652
|
-
function
|
|
653
|
-
children:
|
|
650
|
+
function Yt({
|
|
651
|
+
children: n,
|
|
654
652
|
initPath: e = "/",
|
|
655
653
|
defaultTransitionName: t = "cupertino",
|
|
656
654
|
transitions: a = [],
|
|
657
|
-
decorators:
|
|
655
|
+
decorators: r = []
|
|
658
656
|
}) {
|
|
659
|
-
const s =
|
|
660
|
-
return
|
|
657
|
+
const s = J() ? e || "/" : window.location.pathname, o = J() ? s.split("?")[1] || "" : window.location.search;
|
|
658
|
+
return _.setState({
|
|
661
659
|
defaultTransitionName: t
|
|
662
|
-
}),
|
|
660
|
+
}), x.setState({
|
|
663
661
|
index: 0,
|
|
664
662
|
histories: [
|
|
665
663
|
{
|
|
666
664
|
id: "root",
|
|
667
665
|
pathname: s,
|
|
668
|
-
params:
|
|
669
|
-
|
|
666
|
+
params: St(
|
|
667
|
+
et.toArray(n).map((i) => i.props.path).flat(),
|
|
670
668
|
s,
|
|
671
|
-
|
|
669
|
+
o
|
|
672
670
|
),
|
|
673
671
|
transitionName: t
|
|
674
672
|
}
|
|
675
673
|
]
|
|
676
|
-
}),
|
|
677
|
-
a.forEach((i) =>
|
|
678
|
-
}, [a]),
|
|
679
|
-
|
|
680
|
-
}, [
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
674
|
+
}), R(() => {
|
|
675
|
+
a.forEach((i) => $.set(i.name, i));
|
|
676
|
+
}, [a]), R(() => {
|
|
677
|
+
r.forEach((i) => j.set(i.name, i));
|
|
678
|
+
}, [r]), /* @__PURE__ */ tt(
|
|
679
|
+
"div",
|
|
680
|
+
{
|
|
681
|
+
style: {
|
|
682
|
+
position: "fixed",
|
|
683
|
+
top: 0,
|
|
684
|
+
left: 0,
|
|
685
|
+
width: "100%",
|
|
686
|
+
height: "100%"
|
|
687
|
+
},
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ P(vt, {}),
|
|
690
|
+
/* @__PURE__ */ P(Dt, { children: n })
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
);
|
|
684
694
|
}
|
|
685
|
-
function
|
|
686
|
-
return
|
|
695
|
+
function Xt({ element: n }) {
|
|
696
|
+
return n;
|
|
687
697
|
}
|
|
688
|
-
function
|
|
698
|
+
function qt() {
|
|
689
699
|
return {
|
|
690
|
-
push: async (a,
|
|
691
|
-
if (
|
|
700
|
+
push: async (a, r, s = {}) => {
|
|
701
|
+
if (m.getManualPendingTasks().length)
|
|
692
702
|
return;
|
|
693
|
-
const { index:
|
|
694
|
-
(await
|
|
703
|
+
const { index: o, addHistory: i } = x.getState(), c = C.getState().setStatus, p = _.getState().defaultTransitionName, { transitionName: u = p } = s, h = m.generateTaskId();
|
|
704
|
+
(await m.addTask(
|
|
695
705
|
async () => {
|
|
696
|
-
|
|
697
|
-
const
|
|
698
|
-
Object.entries(
|
|
699
|
-
),
|
|
706
|
+
c("PUSHING");
|
|
707
|
+
const d = I.compile(a)(r), l = I.parse(a).tokens.filter((v) => v.type === "param").map((v) => v.name), w = Object.fromEntries(
|
|
708
|
+
Object.entries(r).filter(([v]) => !l.includes(v))
|
|
709
|
+
), A = new URLSearchParams(w).toString(), S = `${d}${A ? `?${A}` : ""}`;
|
|
700
710
|
return window.history.state?.id || window.history.replaceState(
|
|
701
711
|
{
|
|
702
712
|
id: "root",
|
|
703
713
|
index: 0,
|
|
704
714
|
status: "IDLE",
|
|
705
715
|
params: {},
|
|
706
|
-
transitionName:
|
|
716
|
+
transitionName: u
|
|
707
717
|
},
|
|
708
718
|
"",
|
|
709
719
|
window.location.pathname
|
|
710
720
|
), window.history.pushState(
|
|
711
721
|
{
|
|
712
|
-
id:
|
|
713
|
-
index:
|
|
722
|
+
id: h,
|
|
723
|
+
index: o + 1,
|
|
714
724
|
status: "PUSHING",
|
|
715
|
-
params:
|
|
716
|
-
transitionName:
|
|
725
|
+
params: r,
|
|
726
|
+
transitionName: u
|
|
717
727
|
},
|
|
718
728
|
"",
|
|
719
729
|
S
|
|
720
730
|
), i({
|
|
721
|
-
id:
|
|
722
|
-
pathname:
|
|
723
|
-
params:
|
|
724
|
-
transitionName:
|
|
731
|
+
id: h,
|
|
732
|
+
pathname: d,
|
|
733
|
+
params: r,
|
|
734
|
+
transitionName: u
|
|
725
735
|
}), () => {
|
|
726
|
-
|
|
736
|
+
m.getManualPendingTasks().length || c("COMPLETED");
|
|
727
737
|
};
|
|
728
738
|
},
|
|
729
739
|
{
|
|
730
|
-
id:
|
|
740
|
+
id: h,
|
|
731
741
|
control: {
|
|
732
742
|
manual: !0
|
|
733
743
|
}
|
|
734
744
|
}
|
|
735
745
|
)).result?.();
|
|
736
746
|
},
|
|
737
|
-
replace: async (a,
|
|
738
|
-
if (
|
|
747
|
+
replace: async (a, r, s = {}) => {
|
|
748
|
+
if (m.getManualPendingTasks().length)
|
|
739
749
|
return;
|
|
740
|
-
const { index:
|
|
741
|
-
(await
|
|
750
|
+
const { index: o, addHistory: i } = x.getState(), c = x.getState().replaceHistory, p = C.getState().setStatus, u = _.getState().defaultTransitionName, { transitionName: h = u } = s, d = m.generateTaskId();
|
|
751
|
+
(await m.addTask(
|
|
742
752
|
async () => {
|
|
743
|
-
|
|
744
|
-
const l =
|
|
745
|
-
Object.entries(
|
|
746
|
-
), S = new URLSearchParams(
|
|
753
|
+
p("REPLACING");
|
|
754
|
+
const l = I.compile(a)(r), w = I.parse(a).tokens.filter((E) => E.type === "param").map((E) => E.name), A = Object.fromEntries(
|
|
755
|
+
Object.entries(r).filter(([E]) => !w.includes(E))
|
|
756
|
+
), S = new URLSearchParams(A).toString(), v = `${l}${S ? `?${S}` : ""}`;
|
|
747
757
|
return window.history.replaceState(
|
|
748
758
|
{
|
|
749
|
-
id:
|
|
750
|
-
index:
|
|
759
|
+
id: d,
|
|
760
|
+
index: o,
|
|
751
761
|
status: "REPLACING",
|
|
752
|
-
params:
|
|
753
|
-
transitionName:
|
|
762
|
+
params: r,
|
|
763
|
+
transitionName: h
|
|
754
764
|
},
|
|
755
765
|
"",
|
|
756
|
-
|
|
766
|
+
v
|
|
757
767
|
), i({
|
|
758
|
-
id:
|
|
768
|
+
id: d,
|
|
759
769
|
pathname: l,
|
|
760
|
-
params:
|
|
761
|
-
transitionName:
|
|
770
|
+
params: r,
|
|
771
|
+
transitionName: h
|
|
762
772
|
}), async () => {
|
|
763
|
-
await
|
|
773
|
+
await m.addTask(async () => c(o)), m.getManualPendingTasks().length || p("COMPLETED");
|
|
764
774
|
};
|
|
765
775
|
},
|
|
766
776
|
{
|
|
767
|
-
id:
|
|
777
|
+
id: d,
|
|
768
778
|
control: {
|
|
769
779
|
manual: !0
|
|
770
780
|
}
|
|
@@ -772,16 +782,16 @@ function Mt() {
|
|
|
772
782
|
)).result?.();
|
|
773
783
|
},
|
|
774
784
|
pop: () => {
|
|
775
|
-
|
|
785
|
+
m.getManualPendingTasks().length || window.history.back();
|
|
776
786
|
}
|
|
777
787
|
};
|
|
778
788
|
}
|
|
779
|
-
function
|
|
780
|
-
const
|
|
789
|
+
function jt() {
|
|
790
|
+
const n = q(ot);
|
|
781
791
|
return {
|
|
782
|
-
pushStep: async (
|
|
783
|
-
|
|
784
|
-
const s = new URLSearchParams(
|
|
792
|
+
pushStep: async (r) => {
|
|
793
|
+
m.getManualPendingTasks().length || (await m.addTask(async () => {
|
|
794
|
+
const s = new URLSearchParams(r).toString(), o = `${window.location.pathname}${s ? `?${s}` : ""}`;
|
|
785
795
|
return window.history.state?.step || window.history.replaceState(
|
|
786
796
|
{
|
|
787
797
|
...window.history.state,
|
|
@@ -793,128 +803,177 @@ function At() {
|
|
|
793
803
|
{
|
|
794
804
|
...window.history.state,
|
|
795
805
|
step: !0,
|
|
796
|
-
params:
|
|
806
|
+
params: r
|
|
797
807
|
},
|
|
798
808
|
"",
|
|
799
|
-
|
|
800
|
-
), async () =>
|
|
809
|
+
o
|
|
810
|
+
), async () => n({ type: "SET", params: r });
|
|
801
811
|
})).result?.();
|
|
802
812
|
},
|
|
803
|
-
replaceStep: async (
|
|
804
|
-
|
|
805
|
-
const s = new URLSearchParams(
|
|
813
|
+
replaceStep: async (r) => {
|
|
814
|
+
m.getManualPendingTasks().length || (await m.addTask(async () => {
|
|
815
|
+
const s = new URLSearchParams(r).toString(), o = `${window.location.pathname}${s ? `?${s}` : ""}`;
|
|
806
816
|
return window.history.replaceState(
|
|
807
817
|
{
|
|
808
818
|
...window.history.state,
|
|
809
819
|
step: !0,
|
|
810
|
-
params:
|
|
820
|
+
params: r
|
|
811
821
|
},
|
|
812
822
|
"",
|
|
813
|
-
|
|
814
|
-
), async () =>
|
|
823
|
+
o
|
|
824
|
+
), async () => n({ type: "SET", params: r });
|
|
815
825
|
})).result?.();
|
|
816
826
|
},
|
|
817
827
|
popStep: () => {
|
|
818
|
-
|
|
828
|
+
m.getManualPendingTasks().length || window.history.back();
|
|
819
829
|
}
|
|
820
830
|
};
|
|
821
831
|
}
|
|
822
|
-
function
|
|
823
|
-
return
|
|
832
|
+
function Q() {
|
|
833
|
+
return q(it);
|
|
824
834
|
}
|
|
825
|
-
function
|
|
826
|
-
return
|
|
835
|
+
function Kt() {
|
|
836
|
+
return q(st);
|
|
827
837
|
}
|
|
828
|
-
function
|
|
829
|
-
name:
|
|
838
|
+
function Qt({
|
|
839
|
+
name: n,
|
|
830
840
|
initial: e,
|
|
831
841
|
idle: t,
|
|
832
842
|
pushOnEnter: a,
|
|
833
|
-
pushOnExit:
|
|
843
|
+
pushOnExit: r,
|
|
834
844
|
replaceOnEnter: s,
|
|
835
|
-
replaceOnExit:
|
|
845
|
+
replaceOnExit: o,
|
|
836
846
|
popOnEnter: i,
|
|
837
|
-
popOnExit:
|
|
838
|
-
completedOnExit:
|
|
839
|
-
completedOnEnter:
|
|
840
|
-
options:
|
|
847
|
+
popOnExit: c,
|
|
848
|
+
completedOnExit: p,
|
|
849
|
+
completedOnEnter: u,
|
|
850
|
+
options: h
|
|
841
851
|
}) {
|
|
842
852
|
return {
|
|
843
|
-
name:
|
|
853
|
+
name: n,
|
|
844
854
|
initial: e,
|
|
845
855
|
variants: {
|
|
846
856
|
"IDLE-true": t,
|
|
847
857
|
"IDLE-false": t,
|
|
848
|
-
"PUSHING-false":
|
|
858
|
+
"PUSHING-false": r,
|
|
849
859
|
"PUSHING-true": a,
|
|
850
|
-
"REPLACING-false":
|
|
860
|
+
"REPLACING-false": o,
|
|
851
861
|
"REPLACING-true": s,
|
|
852
|
-
"POPPING-false":
|
|
862
|
+
"POPPING-false": c,
|
|
853
863
|
"POPPING-true": i,
|
|
854
|
-
"COMPLETED-false":
|
|
855
|
-
"COMPLETED-true":
|
|
864
|
+
"COMPLETED-false": p,
|
|
865
|
+
"COMPLETED-true": u
|
|
856
866
|
},
|
|
857
|
-
...
|
|
867
|
+
...h
|
|
858
868
|
};
|
|
859
869
|
}
|
|
860
|
-
function
|
|
861
|
-
name:
|
|
870
|
+
function Vt({
|
|
871
|
+
name: n,
|
|
862
872
|
initial: e,
|
|
863
873
|
idle: t,
|
|
864
874
|
pushOnEnter: a,
|
|
865
|
-
pushOnExit:
|
|
875
|
+
pushOnExit: r,
|
|
866
876
|
replaceOnEnter: s,
|
|
867
|
-
replaceOnExit:
|
|
877
|
+
replaceOnExit: o,
|
|
868
878
|
popOnEnter: i,
|
|
869
|
-
popOnExit:
|
|
870
|
-
completedOnEnter:
|
|
871
|
-
completedOnExit:
|
|
872
|
-
options:
|
|
879
|
+
popOnExit: c,
|
|
880
|
+
completedOnEnter: p,
|
|
881
|
+
completedOnExit: u,
|
|
882
|
+
options: h
|
|
873
883
|
}) {
|
|
874
884
|
return {
|
|
875
|
-
name:
|
|
885
|
+
name: n,
|
|
876
886
|
initial: e,
|
|
877
887
|
variants: {
|
|
878
888
|
"IDLE-true": t,
|
|
879
889
|
"IDLE-false": t,
|
|
880
|
-
"PUSHING-false":
|
|
890
|
+
"PUSHING-false": r,
|
|
881
891
|
"PUSHING-true": a,
|
|
882
|
-
"REPLACING-false":
|
|
892
|
+
"REPLACING-false": o,
|
|
883
893
|
"REPLACING-true": s,
|
|
884
|
-
"POPPING-false":
|
|
894
|
+
"POPPING-false": c,
|
|
885
895
|
"POPPING-true": i,
|
|
886
|
-
"COMPLETED-false":
|
|
887
|
-
"COMPLETED-true":
|
|
896
|
+
"COMPLETED-false": u,
|
|
897
|
+
"COMPLETED-true": p
|
|
888
898
|
},
|
|
889
|
-
...
|
|
899
|
+
...h
|
|
890
900
|
};
|
|
891
901
|
}
|
|
892
|
-
const
|
|
902
|
+
const At = { then() {
|
|
893
903
|
} };
|
|
894
|
-
function
|
|
895
|
-
freeze:
|
|
904
|
+
function Ct({
|
|
905
|
+
freeze: n,
|
|
896
906
|
children: e
|
|
897
907
|
}) {
|
|
898
|
-
if (
|
|
899
|
-
throw
|
|
908
|
+
if (n)
|
|
909
|
+
throw At;
|
|
900
910
|
return e;
|
|
901
911
|
}
|
|
902
|
-
function
|
|
903
|
-
return /* @__PURE__ */ P(
|
|
912
|
+
function Gt({ freeze: n, children: e, placeholder: t }) {
|
|
913
|
+
return /* @__PURE__ */ P(Pt, { fallback: t, children: /* @__PURE__ */ P(Ct, { freeze: n, children: e }) });
|
|
914
|
+
}
|
|
915
|
+
function Z(n, e) {
|
|
916
|
+
const {
|
|
917
|
+
direction: t = "x",
|
|
918
|
+
markerSelector: a = "[data-swipe-at-edge]",
|
|
919
|
+
depthLimit: r = 24,
|
|
920
|
+
verifyByScroll: s = !1
|
|
921
|
+
} = e ?? {}, o = bt(n);
|
|
922
|
+
if (!o) return { element: null, hasMarker: !1 };
|
|
923
|
+
const i = o.closest?.(a);
|
|
924
|
+
if (i instanceof HTMLElement && B(i, t) && (!s || z(i, t)))
|
|
925
|
+
return { element: i, hasMarker: !0 };
|
|
926
|
+
let c = o, p = 0;
|
|
927
|
+
for (; c && c !== document.body && p < r; ) {
|
|
928
|
+
if (B(c, t) && (!s || z(c, t)))
|
|
929
|
+
return { element: c, hasMarker: !1 };
|
|
930
|
+
c = c.parentElement, p++;
|
|
931
|
+
}
|
|
932
|
+
return { element: null, hasMarker: !1 };
|
|
933
|
+
}
|
|
934
|
+
function bt(n) {
|
|
935
|
+
if (!n) return null;
|
|
936
|
+
const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
|
|
937
|
+
if (t && t.length) {
|
|
938
|
+
for (const a of t)
|
|
939
|
+
if (a instanceof HTMLElement) return a;
|
|
940
|
+
}
|
|
941
|
+
return n;
|
|
942
|
+
}
|
|
943
|
+
function B(n, e) {
|
|
944
|
+
return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
|
|
945
|
+
}
|
|
946
|
+
function z(n, e) {
|
|
947
|
+
if (!B(n, e)) return !1;
|
|
948
|
+
if (e === "y") {
|
|
949
|
+
const t = n.scrollTop;
|
|
950
|
+
if (n.scrollTop = t + 1, n.scrollTop !== t)
|
|
951
|
+
return n.scrollTop = t, !0;
|
|
952
|
+
n.scrollTop = t - 1;
|
|
953
|
+
const r = n.scrollTop !== t;
|
|
954
|
+
return n.scrollTop = t, r;
|
|
955
|
+
} else {
|
|
956
|
+
const t = n.scrollLeft;
|
|
957
|
+
if (n.scrollLeft = t + 1, n.scrollLeft !== t)
|
|
958
|
+
return n.scrollLeft = t, !0;
|
|
959
|
+
n.scrollLeft = t - 1;
|
|
960
|
+
const r = n.scrollLeft !== t;
|
|
961
|
+
return n.scrollLeft = t, r;
|
|
962
|
+
}
|
|
904
963
|
}
|
|
905
|
-
function
|
|
906
|
-
const { isActive: a, transitionName:
|
|
907
|
-
|
|
908
|
-
const i =
|
|
909
|
-
return
|
|
964
|
+
function Ot({ children: n, ref: e, ...t }) {
|
|
965
|
+
const { isActive: a, transitionName: r } = Q(), [s, o] = rt();
|
|
966
|
+
yt(e, () => s.current);
|
|
967
|
+
const i = C((d) => d.status), c = $.get(r), { decoratorName: p } = c, { initial: u, variants: h } = j.get(p);
|
|
968
|
+
return R(() => {
|
|
910
969
|
if (!s.current) return;
|
|
911
|
-
const { value:
|
|
912
|
-
|
|
913
|
-
}, [i, a,
|
|
914
|
-
|
|
970
|
+
const { value: d, options: l } = h[`${i}-${a}`];
|
|
971
|
+
o(s.current, d, l);
|
|
972
|
+
}, [i, a, o, h, s]), /* @__PURE__ */ P(
|
|
973
|
+
at.div,
|
|
915
974
|
{
|
|
916
975
|
ref: s,
|
|
917
|
-
initial:
|
|
976
|
+
initial: u,
|
|
918
977
|
style: {
|
|
919
978
|
position: "absolute",
|
|
920
979
|
top: 0,
|
|
@@ -928,82 +987,144 @@ function Et({ children: r, ref: e, ...t }) {
|
|
|
928
987
|
}
|
|
929
988
|
);
|
|
930
989
|
}
|
|
931
|
-
const
|
|
990
|
+
const Y = U((n) => ({
|
|
932
991
|
transitionStatus: "IDLE",
|
|
933
|
-
setTransitionStatus: (e) =>
|
|
992
|
+
setTransitionStatus: (e) => n({ transitionStatus: e })
|
|
934
993
|
}));
|
|
935
|
-
function
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
},
|
|
943
|
-
if (!S
|
|
994
|
+
function Ht({
|
|
995
|
+
children: n,
|
|
996
|
+
...e
|
|
997
|
+
}) {
|
|
998
|
+
const [t, a] = rt(), { id: r, isActive: s, isRoot: o, transitionName: i, prevTransitionName: c } = Q(), p = wt(), u = C((f) => f.status), h = Y((f) => f.transitionStatus), d = Y.getState().setTransitionStatus, l = $.get(i), { variants: w, initial: A, swipeDirection: S, decoratorName: v } = l, E = j.get(v), b = L(null), O = L(null), H = L(null), T = L(!1), G = L(!1), D = L({
|
|
999
|
+
element: null,
|
|
1000
|
+
hasMarker: !1
|
|
1001
|
+
}), N = L({ element: null, hasMarker: !1 }), V = L(0), W = L(0), ct = async (f, y) => {
|
|
1002
|
+
if (!S)
|
|
944
1003
|
return;
|
|
945
|
-
|
|
1004
|
+
b.current = t.current?.previousSibling, H.current = t.current?.previousSibling?.querySelector("[data-decorator]");
|
|
1005
|
+
const g = await l?.onSwipeStart(f, y, {
|
|
946
1006
|
currentScreen: t.current,
|
|
947
|
-
prevScreen:
|
|
948
|
-
dragControls:
|
|
1007
|
+
prevScreen: b.current,
|
|
1008
|
+
dragControls: p,
|
|
1009
|
+
onStart: (k) => E?.onSwipeStart?.(k, {
|
|
1010
|
+
currentDecorator: O.current,
|
|
1011
|
+
prevDecorator: H.current
|
|
1012
|
+
})
|
|
949
1013
|
});
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1014
|
+
d(g ? "PENDING" : "IDLE");
|
|
1015
|
+
}, ut = (f, y) => {
|
|
1016
|
+
!S || h !== "PENDING" || l?.onSwipe(f, y, {
|
|
1017
|
+
currentScreen: t.current,
|
|
1018
|
+
prevScreen: b.current,
|
|
1019
|
+
dragControls: p,
|
|
1020
|
+
onProgress: (g, k) => E?.onSwipe?.(g, k, {
|
|
1021
|
+
currentDecorator: O.current,
|
|
1022
|
+
prevDecorator: H.current
|
|
1023
|
+
})
|
|
953
1024
|
});
|
|
954
|
-
},
|
|
955
|
-
if (!S ||
|
|
1025
|
+
}, lt = async (f, y) => {
|
|
1026
|
+
if (!S || h !== "PENDING")
|
|
956
1027
|
return;
|
|
957
|
-
await l?.onSwipeEnd(
|
|
1028
|
+
await l?.onSwipeEnd(f, y, {
|
|
958
1029
|
currentScreen: t.current,
|
|
959
|
-
prevScreen:
|
|
960
|
-
|
|
1030
|
+
prevScreen: b.current,
|
|
1031
|
+
onStart: (k) => E?.onSwipeEnd?.(k, {
|
|
1032
|
+
currentDecorator: O.current,
|
|
1033
|
+
prevDecorator: H.current
|
|
1034
|
+
})
|
|
1035
|
+
}) ? window.history.back() : d("IDLE");
|
|
1036
|
+
}, dt = (f) => {
|
|
1037
|
+
if (!(!o && s && u === "COMPLETED" && h === "IDLE" && !!S))
|
|
1038
|
+
return;
|
|
1039
|
+
D.current = Z(f.target, {
|
|
1040
|
+
direction: "x"
|
|
1041
|
+
}), N.current = Z(f.target, {
|
|
1042
|
+
direction: "y"
|
|
1043
|
+
}), V.current = f.clientX, W.current = f.clientY, (!D.current.element && !N.current.element || D.current.element || N.current.element) && (T.current = !0);
|
|
1044
|
+
}, pt = (f) => {
|
|
1045
|
+
const y = !D.current.element && !N.current.element;
|
|
1046
|
+
if (T.current && y)
|
|
1047
|
+
T.current = !1, G.current = !0, p.start(f);
|
|
1048
|
+
else if (T.current && !y) {
|
|
1049
|
+
const g = f.clientX - V.current, k = f.clientY - W.current, ht = N.current.element && N.current.element.scrollTop <= 0 && N.current.hasMarker, mt = D.current.element && D.current.element.scrollLeft <= 0 && D.current.hasMarker;
|
|
1050
|
+
(S === "y" && (ht || D.current.element) && k > 0 && g < 2 || S === "x" && (mt || N.current.element) && g > 0 && k < 2) && (T.current = !1, G.current = !0, p.start(f));
|
|
1051
|
+
}
|
|
1052
|
+
}, ft = () => {
|
|
1053
|
+
T.current = !1, G.current = !1;
|
|
961
1054
|
};
|
|
962
|
-
return
|
|
963
|
-
const
|
|
964
|
-
if (!
|
|
965
|
-
const y = (
|
|
966
|
-
|
|
967
|
-
m.removeEventListener("touchmove", y);
|
|
1055
|
+
return R(() => {
|
|
1056
|
+
const f = t.current;
|
|
1057
|
+
if (!f) return;
|
|
1058
|
+
const y = (g) => {
|
|
1059
|
+
G.current && g.preventDefault(), g.target?.dataset.swipeAtEdgeBar === "true" && g.preventDefault();
|
|
968
1060
|
};
|
|
969
|
-
|
|
1061
|
+
return f.addEventListener("touchmove", y, {
|
|
1062
|
+
passive: !1
|
|
1063
|
+
}), () => {
|
|
1064
|
+
f.removeEventListener("touchmove", y);
|
|
1065
|
+
};
|
|
1066
|
+
}, [t]), R(() => {
|
|
970
1067
|
t.current && (async () => {
|
|
971
|
-
const { value:
|
|
972
|
-
!s &&
|
|
1068
|
+
const { value: f, options: y } = w[`${u}-${s}`], g = u === "REPLACING" && c !== i;
|
|
1069
|
+
!s && g && (d("PENDING"), await a(t.current, Rt, {
|
|
973
1070
|
duration: 0.01
|
|
974
|
-
})), await a(t.current,
|
|
1071
|
+
})), await a(t.current, f, y), await m.resolveTask(r), !s && !g && d("IDLE");
|
|
975
1072
|
})();
|
|
976
1073
|
}, [
|
|
977
|
-
|
|
1074
|
+
u,
|
|
978
1075
|
s,
|
|
979
|
-
|
|
980
|
-
|
|
1076
|
+
r,
|
|
1077
|
+
c,
|
|
981
1078
|
i,
|
|
982
1079
|
a,
|
|
983
1080
|
t,
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
]), /* @__PURE__ */
|
|
987
|
-
|
|
1081
|
+
d,
|
|
1082
|
+
w
|
|
1083
|
+
]), /* @__PURE__ */ tt(
|
|
1084
|
+
at.div,
|
|
988
1085
|
{
|
|
989
1086
|
ref: t,
|
|
990
|
-
|
|
1087
|
+
...e,
|
|
1088
|
+
initial: A,
|
|
991
1089
|
drag: S,
|
|
992
|
-
dragListener: !
|
|
993
|
-
dragControls:
|
|
994
|
-
onDragStart:
|
|
995
|
-
onDrag:
|
|
996
|
-
onDragEnd:
|
|
1090
|
+
dragListener: !1,
|
|
1091
|
+
dragControls: p,
|
|
1092
|
+
onDragStart: ct,
|
|
1093
|
+
onDrag: ut,
|
|
1094
|
+
onDragEnd: lt,
|
|
1095
|
+
onPointerDown: dt,
|
|
1096
|
+
onPointerMove: pt,
|
|
1097
|
+
onPointerUp: ft,
|
|
997
1098
|
style: {
|
|
998
1099
|
position: "absolute",
|
|
999
1100
|
top: 0,
|
|
1000
1101
|
left: 0,
|
|
1001
1102
|
width: "100%",
|
|
1002
1103
|
height: "100%",
|
|
1104
|
+
display: "flex",
|
|
1105
|
+
flexDirection: "column",
|
|
1003
1106
|
backgroundColor: "white",
|
|
1107
|
+
boxSizing: "border-box",
|
|
1108
|
+
touchAction: "none",
|
|
1109
|
+
isolation: "isolate",
|
|
1110
|
+
contain: "strict",
|
|
1004
1111
|
...e.style
|
|
1005
1112
|
},
|
|
1006
1113
|
children: [
|
|
1114
|
+
/* @__PURE__ */ P(
|
|
1115
|
+
"div",
|
|
1116
|
+
{
|
|
1117
|
+
"data-swipe-at-edge-bar": !0,
|
|
1118
|
+
style: {
|
|
1119
|
+
position: "absolute",
|
|
1120
|
+
top: 0,
|
|
1121
|
+
left: 0,
|
|
1122
|
+
width: 8,
|
|
1123
|
+
height: "100%",
|
|
1124
|
+
zIndex: 1
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
),
|
|
1007
1128
|
/* @__PURE__ */ P(
|
|
1008
1129
|
"div",
|
|
1009
1130
|
{
|
|
@@ -1014,28 +1135,45 @@ function vt({ children: r, ...e }) {
|
|
|
1014
1135
|
width: "100%",
|
|
1015
1136
|
height: "100%"
|
|
1016
1137
|
},
|
|
1017
|
-
children:
|
|
1138
|
+
children: n
|
|
1018
1139
|
}
|
|
1019
1140
|
),
|
|
1020
|
-
|
|
1141
|
+
E && /* @__PURE__ */ P(Ot, { ref: O }),
|
|
1142
|
+
/* @__PURE__ */ P(
|
|
1143
|
+
"div",
|
|
1144
|
+
{
|
|
1145
|
+
"data-swipe-at-edge-bar": !0,
|
|
1146
|
+
style: {
|
|
1147
|
+
position: "absolute",
|
|
1148
|
+
top: 0,
|
|
1149
|
+
right: 0,
|
|
1150
|
+
width: 8,
|
|
1151
|
+
height: "100%",
|
|
1152
|
+
zIndex: 1
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
)
|
|
1021
1156
|
]
|
|
1022
1157
|
}
|
|
1023
1158
|
);
|
|
1024
1159
|
}
|
|
1025
|
-
function
|
|
1026
|
-
|
|
1027
|
-
|
|
1160
|
+
function Wt({
|
|
1161
|
+
children: n,
|
|
1162
|
+
...e
|
|
1163
|
+
}) {
|
|
1164
|
+
const { isActive: t, isPrev: a } = Q(), r = C((c) => c.status), s = Y((c) => c.transitionStatus);
|
|
1165
|
+
return /* @__PURE__ */ P(Gt, { freeze: !t && (r === "COMPLETED" && s === "IDLE" || a), children: /* @__PURE__ */ P(Ht, { ...e, children: n }) });
|
|
1028
1166
|
}
|
|
1029
1167
|
export {
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1168
|
+
Xt as Route,
|
|
1169
|
+
Yt as Router,
|
|
1170
|
+
Wt as Screen,
|
|
1171
|
+
Nt as createDecorator,
|
|
1172
|
+
Vt as createRawDecorator,
|
|
1173
|
+
Qt as createRawTransition,
|
|
1174
|
+
K as createTransition,
|
|
1175
|
+
qt as useNavigate,
|
|
1176
|
+
Kt as useParams,
|
|
1177
|
+
Q as useScreen,
|
|
1178
|
+
jt as useStep
|
|
1041
1179
|
};
|