flemo 1.1.3 → 1.1.4
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/dist/core/TaskManger.d.ts +20 -1
- package/dist/index.mjs +256 -238
- package/package.json +1 -1
|
@@ -6,12 +6,31 @@ interface TaskResult<T> {
|
|
|
6
6
|
timestamp?: number;
|
|
7
7
|
instanceId?: string;
|
|
8
8
|
}
|
|
9
|
+
type TaskStatus = "PENDING" | "MANUAL_PENDING" | "SIGNAL_PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "ROLLEDBACK";
|
|
9
10
|
interface Control {
|
|
10
11
|
manual?: boolean;
|
|
11
12
|
delay?: number;
|
|
12
13
|
condition?: () => Promise<boolean>;
|
|
13
14
|
signal?: string;
|
|
14
15
|
}
|
|
16
|
+
interface Task<T> {
|
|
17
|
+
id: string;
|
|
18
|
+
execute: (abortController: AbortController) => Promise<T>;
|
|
19
|
+
validate?: () => Promise<boolean>;
|
|
20
|
+
rollback?: () => Promise<void>;
|
|
21
|
+
control?: Control;
|
|
22
|
+
timestamp: number;
|
|
23
|
+
retryCount: number;
|
|
24
|
+
status: TaskStatus;
|
|
25
|
+
dependencies: string[];
|
|
26
|
+
instanceId: string;
|
|
27
|
+
abortController?: AbortController;
|
|
28
|
+
manualResolver?: {
|
|
29
|
+
resolve: (value: TaskResult<T>) => void;
|
|
30
|
+
reject: (error: Error) => void;
|
|
31
|
+
result: T;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
15
34
|
declare class TaskManager {
|
|
16
35
|
private tasks;
|
|
17
36
|
private readonly instanceId;
|
|
@@ -28,7 +47,7 @@ declare class TaskManager {
|
|
|
28
47
|
private processPendingTasks;
|
|
29
48
|
private waitForPendingTasks;
|
|
30
49
|
private onTaskStatusChange;
|
|
31
|
-
addTask<T>(execute:
|
|
50
|
+
addTask<T>(execute: Task<T>["execute"], options?: {
|
|
32
51
|
id?: string;
|
|
33
52
|
delay?: number;
|
|
34
53
|
validate?: () => Promise<boolean>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as G, createContext as X, useReducer as Pt, Children as nt, useContext as q, Suspense as Et, useImperativeHandle as St, useRef as
|
|
3
|
-
import { d as
|
|
1
|
+
import { jsx as w, jsxs as et } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as G, createContext as X, useReducer as Pt, Children as nt, useContext as q, Suspense as Et, useImperativeHandle as St, useRef as I } from "react";
|
|
3
|
+
import { d as x, c as _ } from "./vendor-C8cPYUOQ.js";
|
|
4
4
|
import { animate as F } from "motion";
|
|
5
|
-
import { animate as
|
|
5
|
+
import { animate as A, transform as st, useAnimate as at, motion as rt, useDragControls as wt } from "motion/react";
|
|
6
6
|
function yt(s, e, t) {
|
|
7
|
-
const a = Array.isArray(s) ? s.find((
|
|
8
|
-
return n ? { ...n.params, ...
|
|
7
|
+
const a = Array.isArray(s) ? s.find((c) => x.pathToRegexp(c).regexp.test(e)) || "" : x.pathToRegexp(s).regexp.test(e) ? s : "", n = x.match(a)(e), i = new URLSearchParams(t), o = Object.fromEntries(i.entries());
|
|
8
|
+
return n ? { ...n.params, ...o } : {};
|
|
9
9
|
}
|
|
10
10
|
function Z() {
|
|
11
11
|
return typeof document > "u";
|
|
@@ -23,7 +23,7 @@ class Lt {
|
|
|
23
23
|
for (let n = 0; n < 10; n++) {
|
|
24
24
|
if (!this.isLocked)
|
|
25
25
|
return this.isLocked = !0, this.currentTaskId = e, !0;
|
|
26
|
-
await new Promise((
|
|
26
|
+
await new Promise((i) => setTimeout(i, 100));
|
|
27
27
|
}
|
|
28
28
|
return !1;
|
|
29
29
|
}
|
|
@@ -75,10 +75,10 @@ class Lt {
|
|
|
75
75
|
}
|
|
76
76
|
async addTask(e, t = {}) {
|
|
77
77
|
const a = t.id || this.generateTaskId();
|
|
78
|
-
return new Promise((n,
|
|
78
|
+
return new Promise((n, i) => {
|
|
79
79
|
this.taskQueue = this.taskQueue.then(async () => {
|
|
80
80
|
try {
|
|
81
|
-
const { control:
|
|
81
|
+
const { control: o, validate: c, rollback: u, dependencies: l = [], delay: p } = t, f = new AbortController(), r = {
|
|
82
82
|
id: a,
|
|
83
83
|
execute: e,
|
|
84
84
|
timestamp: Date.now(),
|
|
@@ -86,64 +86,75 @@ class Lt {
|
|
|
86
86
|
status: "PENDING",
|
|
87
87
|
dependencies: l,
|
|
88
88
|
instanceId: this.instanceId,
|
|
89
|
-
validate:
|
|
89
|
+
validate: c,
|
|
90
90
|
rollback: u,
|
|
91
|
-
control:
|
|
91
|
+
control: o,
|
|
92
|
+
abortController: f
|
|
92
93
|
};
|
|
93
|
-
this.tasks.set(
|
|
94
|
+
this.tasks.set(r.id, r), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(r), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((P) => P.id !== r.id));
|
|
94
95
|
try {
|
|
95
|
-
if (!await this.acquireLock(
|
|
96
|
-
throw
|
|
96
|
+
if (!await this.acquireLock(r.id))
|
|
97
|
+
throw r.status = "FAILED", new Error("FAILED");
|
|
97
98
|
try {
|
|
98
|
-
|
|
99
|
-
for (const
|
|
100
|
-
const
|
|
101
|
-
if (!
|
|
102
|
-
throw
|
|
99
|
+
r.status = "PROCESSING";
|
|
100
|
+
for (const h of r.dependencies) {
|
|
101
|
+
const m = this.tasks.get(h);
|
|
102
|
+
if (!m || m.status !== "COMPLETED")
|
|
103
|
+
throw r.status = "FAILED", new Error("FAILED");
|
|
104
|
+
}
|
|
105
|
+
if (r.validate && !await r.validate())
|
|
106
|
+
throw r.status = "FAILED", new Error("FAILED");
|
|
107
|
+
p && p > 0 && await new Promise((h) => setTimeout(h, p));
|
|
108
|
+
const E = await r.execute(r.abortController);
|
|
109
|
+
if (r.abortController.signal.aborted) {
|
|
110
|
+
r.status = "COMPLETED", await this.onTaskStatusChange(r.id, "COMPLETED"), n({
|
|
111
|
+
success: !0,
|
|
112
|
+
result: void 0,
|
|
113
|
+
taskId: r.id,
|
|
114
|
+
timestamp: Date.now(),
|
|
115
|
+
instanceId: this.instanceId
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
103
118
|
}
|
|
104
|
-
if (i.validate && !await i.validate())
|
|
105
|
-
throw i.status = "FAILED", new Error("FAILED");
|
|
106
|
-
f && f > 0 && await new Promise((m) => setTimeout(m, f));
|
|
107
|
-
const g = await i.execute();
|
|
108
119
|
if (t.control) {
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
|
|
120
|
+
const h = t.control;
|
|
121
|
+
if (h.delay && h.delay > 0 && await new Promise((m) => setTimeout(m, h.delay)), h.manual) {
|
|
122
|
+
r.status = "MANUAL_PENDING", r.manualResolver = { resolve: n, reject: i, result: E }, this.pendingTaskQueue.push(r), await this.onTaskStatusChange(r.id, "MANUAL_PENDING");
|
|
112
123
|
return;
|
|
113
124
|
}
|
|
114
|
-
if (
|
|
115
|
-
|
|
125
|
+
if (h.signal) {
|
|
126
|
+
r.status = "SIGNAL_PENDING", r.manualResolver = { resolve: n, reject: i, result: E }, this.signalListeners.has(h.signal) || this.signalListeners.set(h.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(h.signal).add(r.id), this.pendingTaskQueue.push(r), await this.onTaskStatusChange(r.id, "SIGNAL_PENDING");
|
|
116
127
|
return;
|
|
117
128
|
}
|
|
118
|
-
if (
|
|
119
|
-
|
|
129
|
+
if (h.condition && !await h.condition()) {
|
|
130
|
+
r.status = "MANUAL_PENDING", r.manualResolver = { resolve: n, reject: i, result: E }, this.pendingTaskQueue.push(r), await this.onTaskStatusChange(r.id, "MANUAL_PENDING");
|
|
120
131
|
return;
|
|
121
132
|
}
|
|
122
133
|
}
|
|
123
|
-
|
|
134
|
+
r.status = "COMPLETED", await this.onTaskStatusChange(r.id, "COMPLETED"), n({
|
|
124
135
|
success: !0,
|
|
125
|
-
result:
|
|
126
|
-
taskId:
|
|
136
|
+
result: E,
|
|
137
|
+
taskId: r.id,
|
|
127
138
|
timestamp: Date.now(),
|
|
128
139
|
instanceId: this.instanceId
|
|
129
140
|
});
|
|
130
|
-
} catch (
|
|
131
|
-
if (
|
|
141
|
+
} catch (E) {
|
|
142
|
+
if (r.status = "FAILED", r.rollback)
|
|
132
143
|
try {
|
|
133
|
-
await
|
|
144
|
+
await r.rollback(), r.status = "ROLLEDBACK";
|
|
134
145
|
} catch {
|
|
135
146
|
}
|
|
136
|
-
throw await this.onTaskStatusChange(
|
|
147
|
+
throw await this.onTaskStatusChange(r.id, r.status), E;
|
|
137
148
|
} finally {
|
|
138
|
-
this.releaseLock(
|
|
149
|
+
this.releaseLock(r.id);
|
|
139
150
|
}
|
|
140
|
-
} catch (
|
|
141
|
-
|
|
151
|
+
} catch (P) {
|
|
152
|
+
i(P);
|
|
142
153
|
}
|
|
143
|
-
} catch (
|
|
144
|
-
|
|
154
|
+
} catch (o) {
|
|
155
|
+
i(o);
|
|
145
156
|
}
|
|
146
|
-
}).catch(
|
|
157
|
+
}).catch(i);
|
|
147
158
|
});
|
|
148
159
|
}
|
|
149
160
|
async resolveTask(e) {
|
|
@@ -161,7 +172,7 @@ class Lt {
|
|
|
161
172
|
taskId: t.id,
|
|
162
173
|
timestamp: Date.now(),
|
|
163
174
|
instanceId: this.instanceId
|
|
164
|
-
}), delete t.manualResolver, !0;
|
|
175
|
+
}), delete t.manualResolver, await this.onTaskStatusChange(e, "COMPLETED"), !0;
|
|
165
176
|
}
|
|
166
177
|
return !1;
|
|
167
178
|
}
|
|
@@ -172,7 +183,7 @@ class Lt {
|
|
|
172
183
|
await Promise.all(e.map((t) => this.resolveTask(t.id)));
|
|
173
184
|
}
|
|
174
185
|
}
|
|
175
|
-
const
|
|
186
|
+
const N = new Lt(), R = _((s) => ({
|
|
176
187
|
index: -1,
|
|
177
188
|
histories: [],
|
|
178
189
|
addHistory: (e) => s((t) => ({
|
|
@@ -194,21 +205,28 @@ const I = new Lt(), R = _((s) => ({
|
|
|
194
205
|
function Tt() {
|
|
195
206
|
return G(() => {
|
|
196
207
|
const s = async (e) => {
|
|
197
|
-
const t = e.state?.id
|
|
198
|
-
|
|
199
|
-
async () =>
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
const t = e.state?.id;
|
|
209
|
+
(await N.addTask(
|
|
210
|
+
async (a) => {
|
|
211
|
+
const n = e.state?.index, i = e.state?.status, o = e.state?.params, c = e.state?.transitionName, u = T.getState().setStatus, { index: l, addHistory: p, popHistory: f } = R.getState(), r = n < l, g = i === "PUSHING" && n > l, P = i === "REPLACING" && n > l, E = window.location.pathname;
|
|
212
|
+
if (!r && !g && !P) {
|
|
213
|
+
a.abort();
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
return r ? u("POPPING") : g ? (u("PUSHING"), p({
|
|
217
|
+
id: t,
|
|
218
|
+
pathname: E,
|
|
219
|
+
params: o,
|
|
220
|
+
transitionName: c
|
|
221
|
+
})) : P && (u("REPLACING"), p({
|
|
222
|
+
id: t,
|
|
223
|
+
pathname: E,
|
|
224
|
+
params: o,
|
|
225
|
+
transitionName: c
|
|
226
|
+
})), async () => {
|
|
227
|
+
r && f(n + 1), u("COMPLETED");
|
|
228
|
+
};
|
|
229
|
+
},
|
|
212
230
|
{
|
|
213
231
|
id: t,
|
|
214
232
|
control: {
|
|
@@ -232,22 +250,22 @@ function Dt(s, e) {
|
|
|
232
250
|
return s;
|
|
233
251
|
}
|
|
234
252
|
}
|
|
235
|
-
function
|
|
253
|
+
function It({
|
|
236
254
|
children: s,
|
|
237
255
|
active: e,
|
|
238
256
|
params: t
|
|
239
257
|
}) {
|
|
240
258
|
const [a, n] = Pt(Dt, t);
|
|
241
259
|
return G(() => {
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
n({ type: "SET", params:
|
|
260
|
+
const i = async (o) => {
|
|
261
|
+
o.state?.step && await N.addTask(async () => {
|
|
262
|
+
n({ type: "SET", params: o.state?.params || {} });
|
|
245
263
|
});
|
|
246
264
|
};
|
|
247
|
-
return e && window.addEventListener("popstate",
|
|
248
|
-
window.removeEventListener("popstate",
|
|
265
|
+
return e && window.addEventListener("popstate", i), () => {
|
|
266
|
+
window.removeEventListener("popstate", i);
|
|
249
267
|
};
|
|
250
|
-
}, [e, n]), /* @__PURE__ */
|
|
268
|
+
}, [e, n]), /* @__PURE__ */ w(ot.Provider, { value: n, children: /* @__PURE__ */ w(it.Provider, { value: a, children: s }) });
|
|
251
269
|
}
|
|
252
270
|
const ct = X({
|
|
253
271
|
id: "",
|
|
@@ -260,15 +278,15 @@ const ct = X({
|
|
|
260
278
|
transitionName: "none",
|
|
261
279
|
prevTransitionName: "none"
|
|
262
280
|
});
|
|
263
|
-
function
|
|
281
|
+
function Nt({ children: s }) {
|
|
264
282
|
const e = R((a) => a.index), t = R((a) => a.histories);
|
|
265
283
|
return t.map(
|
|
266
284
|
(a) => nt.toArray(s).filter(
|
|
267
|
-
(n) =>
|
|
285
|
+
(n) => x.pathToRegexp(n.props.path).regexp.test(
|
|
268
286
|
a.pathname
|
|
269
287
|
)
|
|
270
288
|
)
|
|
271
|
-
).map(([a], n) => /* @__PURE__ */
|
|
289
|
+
).map(([a], n) => /* @__PURE__ */ w(
|
|
272
290
|
ct.Provider,
|
|
273
291
|
{
|
|
274
292
|
value: {
|
|
@@ -282,7 +300,7 @@ function It({ children: s }) {
|
|
|
282
300
|
transitionName: t[e].transitionName,
|
|
283
301
|
prevTransitionName: t[e - 1]?.transitionName
|
|
284
302
|
},
|
|
285
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ w(It, { active: n === e, params: t[n].params, children: a })
|
|
286
304
|
},
|
|
287
305
|
t[n].id
|
|
288
306
|
));
|
|
@@ -378,9 +396,9 @@ function j({
|
|
|
378
396
|
idle: t,
|
|
379
397
|
enter: a,
|
|
380
398
|
enterBack: n,
|
|
381
|
-
exit:
|
|
382
|
-
exitBack:
|
|
383
|
-
options:
|
|
399
|
+
exit: i,
|
|
400
|
+
exitBack: o,
|
|
401
|
+
options: c
|
|
384
402
|
}) {
|
|
385
403
|
return {
|
|
386
404
|
name: s,
|
|
@@ -388,16 +406,16 @@ function j({
|
|
|
388
406
|
variants: {
|
|
389
407
|
"IDLE-true": t,
|
|
390
408
|
"IDLE-false": t,
|
|
391
|
-
"PUSHING-false":
|
|
409
|
+
"PUSHING-false": i,
|
|
392
410
|
"PUSHING-true": a,
|
|
393
|
-
"REPLACING-false":
|
|
411
|
+
"REPLACING-false": i,
|
|
394
412
|
"REPLACING-true": a,
|
|
395
|
-
"POPPING-false":
|
|
413
|
+
"POPPING-false": o,
|
|
396
414
|
"POPPING-true": n,
|
|
397
|
-
"COMPLETED-false":
|
|
415
|
+
"COMPLETED-false": i,
|
|
398
416
|
"COMPLETED-true": a
|
|
399
417
|
},
|
|
400
|
-
...
|
|
418
|
+
...c
|
|
401
419
|
};
|
|
402
420
|
}
|
|
403
421
|
const Mt = j({
|
|
@@ -457,29 +475,29 @@ const Mt = j({
|
|
|
457
475
|
swipeDirection: "x",
|
|
458
476
|
onSwipeStart: async () => !0,
|
|
459
477
|
onSwipe: (s, e, { currentScreen: t, prevScreen: a, onProgress: n }) => {
|
|
460
|
-
const { offset:
|
|
461
|
-
return n?.(!0,
|
|
478
|
+
const { offset: i } = e, o = i.x, c = st(o, [0, window.innerWidth], [0, 100]);
|
|
479
|
+
return n?.(!0, c), A(
|
|
462
480
|
t,
|
|
463
481
|
{
|
|
464
|
-
x: Math.max(0,
|
|
482
|
+
x: Math.max(0, o)
|
|
465
483
|
},
|
|
466
484
|
{
|
|
467
485
|
duration: 0
|
|
468
486
|
}
|
|
469
|
-
),
|
|
487
|
+
), A(
|
|
470
488
|
a,
|
|
471
489
|
{
|
|
472
|
-
x: -100 +
|
|
490
|
+
x: -100 + c
|
|
473
491
|
},
|
|
474
492
|
{
|
|
475
493
|
duration: 0
|
|
476
494
|
}
|
|
477
|
-
),
|
|
495
|
+
), c;
|
|
478
496
|
},
|
|
479
497
|
onSwipeEnd: async (s, e, { currentScreen: t, prevScreen: a, onStart: n }) => {
|
|
480
|
-
const { offset:
|
|
498
|
+
const { offset: i, velocity: o } = e, u = i.x > 50 || o.x > 20;
|
|
481
499
|
return n?.(u), await Promise.all([
|
|
482
|
-
|
|
500
|
+
A(
|
|
483
501
|
t,
|
|
484
502
|
{
|
|
485
503
|
x: u ? "100%" : 0
|
|
@@ -489,7 +507,7 @@ const Mt = j({
|
|
|
489
507
|
ease: [0.32, 0.72, 0, 1]
|
|
490
508
|
}
|
|
491
509
|
),
|
|
492
|
-
|
|
510
|
+
A(
|
|
493
511
|
a,
|
|
494
512
|
{
|
|
495
513
|
x: u ? 0 : -100
|
|
@@ -502,7 +520,7 @@ const Mt = j({
|
|
|
502
520
|
]), u;
|
|
503
521
|
}
|
|
504
522
|
}
|
|
505
|
-
}),
|
|
523
|
+
}), Ct = j({
|
|
506
524
|
name: "material",
|
|
507
525
|
initial: {
|
|
508
526
|
y: "100%",
|
|
@@ -564,29 +582,29 @@ const Mt = j({
|
|
|
564
582
|
swipeDirection: "y",
|
|
565
583
|
onSwipeStart: async () => !0,
|
|
566
584
|
onSwipe: (s, e, { currentScreen: t, prevScreen: a, onProgress: n }) => {
|
|
567
|
-
const { offset:
|
|
568
|
-
return n?.(!0,
|
|
585
|
+
const { offset: i } = e, o = i.y, c = Math.max(0, Math.min(56, o)), u = st(c, [0, 56], [1, 0.96]), l = Math.max(0, o - 56), p = Math.min(1, l / 160), f = Math.sqrt(p) * 12, r = Math.max(0, c + f), g = Math.min(56, r);
|
|
586
|
+
return n?.(!0, g), A(
|
|
569
587
|
t,
|
|
570
588
|
{
|
|
571
|
-
y:
|
|
589
|
+
y: r,
|
|
572
590
|
opacity: u
|
|
573
591
|
},
|
|
574
592
|
{
|
|
575
593
|
duration: 0
|
|
576
594
|
}
|
|
577
|
-
),
|
|
595
|
+
), A(
|
|
578
596
|
a,
|
|
579
597
|
{
|
|
580
|
-
y: -56 +
|
|
581
|
-
opacity:
|
|
598
|
+
y: -56 + g,
|
|
599
|
+
opacity: g / 56
|
|
582
600
|
},
|
|
583
601
|
{ duration: 0 }
|
|
584
|
-
),
|
|
602
|
+
), g;
|
|
585
603
|
},
|
|
586
604
|
onSwipeEnd: async (s, e, { currentScreen: t, prevScreen: a, onStart: n }) => {
|
|
587
|
-
const { offset:
|
|
605
|
+
const { offset: i, velocity: o } = e, u = i.y > 56 || o.y > 20;
|
|
588
606
|
return n?.(u), await Promise.all([
|
|
589
|
-
|
|
607
|
+
A(
|
|
590
608
|
t,
|
|
591
609
|
{
|
|
592
610
|
y: u ? "100%" : 0,
|
|
@@ -597,7 +615,7 @@ const Mt = j({
|
|
|
597
615
|
ease: u ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
|
|
598
616
|
}
|
|
599
617
|
),
|
|
600
|
-
|
|
618
|
+
A(
|
|
601
619
|
a,
|
|
602
620
|
{
|
|
603
621
|
y: u ? 0 : -56,
|
|
@@ -611,7 +629,7 @@ const Mt = j({
|
|
|
611
629
|
]), u;
|
|
612
630
|
}
|
|
613
631
|
}
|
|
614
|
-
}),
|
|
632
|
+
}), xt = j({
|
|
615
633
|
name: "none",
|
|
616
634
|
initial: {
|
|
617
635
|
transition: {
|
|
@@ -649,10 +667,10 @@ const Mt = j({
|
|
|
649
667
|
}
|
|
650
668
|
}
|
|
651
669
|
}), Q = /* @__PURE__ */ new Map([
|
|
652
|
-
["none",
|
|
670
|
+
["none", xt],
|
|
653
671
|
["cupertino", Mt],
|
|
654
|
-
["material",
|
|
655
|
-
]),
|
|
672
|
+
["material", Ct]
|
|
673
|
+
]), At = (() => {
|
|
656
674
|
const s = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
|
|
657
675
|
for (const t of Q.values()) {
|
|
658
676
|
const a = t.variants["IDLE-true"].value;
|
|
@@ -668,7 +686,7 @@ function Yt({
|
|
|
668
686
|
transitions: a = [],
|
|
669
687
|
decorators: n = []
|
|
670
688
|
}) {
|
|
671
|
-
const
|
|
689
|
+
const i = Z() ? e || "/" : window.location.pathname, o = Z() ? i.split("?")[1] || "" : window.location.search;
|
|
672
690
|
return B.setState({
|
|
673
691
|
defaultTransitionName: t
|
|
674
692
|
}), R.setState({
|
|
@@ -676,19 +694,19 @@ function Yt({
|
|
|
676
694
|
histories: [
|
|
677
695
|
{
|
|
678
696
|
id: "root",
|
|
679
|
-
pathname:
|
|
697
|
+
pathname: i,
|
|
680
698
|
params: yt(
|
|
681
|
-
nt.toArray(s).map((
|
|
682
|
-
|
|
683
|
-
|
|
699
|
+
nt.toArray(s).map((c) => c.props.path).flat(),
|
|
700
|
+
i,
|
|
701
|
+
o
|
|
684
702
|
),
|
|
685
703
|
transitionName: t
|
|
686
704
|
}
|
|
687
705
|
]
|
|
688
706
|
}), G(() => {
|
|
689
|
-
a.forEach((
|
|
707
|
+
a.forEach((c) => Q.set(c.name, c));
|
|
690
708
|
}, [a]), G(() => {
|
|
691
|
-
n.forEach((
|
|
709
|
+
n.forEach((c) => K.set(c.name, c));
|
|
692
710
|
}, [n]), /* @__PURE__ */ et(
|
|
693
711
|
"div",
|
|
694
712
|
{
|
|
@@ -700,8 +718,8 @@ function Yt({
|
|
|
700
718
|
height: "100%"
|
|
701
719
|
},
|
|
702
720
|
children: [
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ w(Tt, {}),
|
|
722
|
+
/* @__PURE__ */ w(Nt, { children: s })
|
|
705
723
|
]
|
|
706
724
|
}
|
|
707
725
|
);
|
|
@@ -711,86 +729,86 @@ function Xt({ element: s }) {
|
|
|
711
729
|
}
|
|
712
730
|
function qt() {
|
|
713
731
|
return {
|
|
714
|
-
push: async (a, n,
|
|
715
|
-
const { status:
|
|
716
|
-
if (
|
|
732
|
+
push: async (a, n, i = {}) => {
|
|
733
|
+
const { status: o, setStatus: c } = T.getState();
|
|
734
|
+
if (o !== "COMPLETED" && o !== "IDLE")
|
|
717
735
|
return;
|
|
718
|
-
const { index: u, addHistory: l } = R.getState(),
|
|
719
|
-
(await
|
|
736
|
+
const { index: u, addHistory: l } = R.getState(), p = B.getState().defaultTransitionName, { transitionName: f = p } = i, r = N.generateTaskId();
|
|
737
|
+
(await N.addTask(
|
|
720
738
|
async () => {
|
|
721
|
-
|
|
722
|
-
const
|
|
723
|
-
Object.entries(n).filter(([D]) => !
|
|
724
|
-
),
|
|
739
|
+
c("PUSHING");
|
|
740
|
+
const g = x.compile(a)(n), P = x.parse(a).tokens.filter((D) => D.type === "param").map((D) => D.name), E = Object.fromEntries(
|
|
741
|
+
Object.entries(n).filter(([D]) => !P.includes(D))
|
|
742
|
+
), h = new URLSearchParams(E).toString(), m = `${g}${h ? `?${h}` : ""}`;
|
|
725
743
|
return window.history.state?.id || window.history.replaceState(
|
|
726
744
|
{
|
|
727
745
|
id: "root",
|
|
728
746
|
index: 0,
|
|
729
747
|
status: "IDLE",
|
|
730
748
|
params: {},
|
|
731
|
-
transitionName:
|
|
749
|
+
transitionName: f
|
|
732
750
|
},
|
|
733
751
|
"",
|
|
734
752
|
window.location.pathname
|
|
735
753
|
), window.history.pushState(
|
|
736
754
|
{
|
|
737
|
-
id:
|
|
755
|
+
id: r,
|
|
738
756
|
index: u + 1,
|
|
739
757
|
status: "PUSHING",
|
|
740
758
|
params: n,
|
|
741
|
-
transitionName:
|
|
759
|
+
transitionName: f
|
|
742
760
|
},
|
|
743
761
|
"",
|
|
744
|
-
|
|
762
|
+
m
|
|
745
763
|
), l({
|
|
746
|
-
id:
|
|
747
|
-
pathname:
|
|
764
|
+
id: r,
|
|
765
|
+
pathname: g,
|
|
748
766
|
params: n,
|
|
749
|
-
transitionName:
|
|
767
|
+
transitionName: f
|
|
750
768
|
}), () => {
|
|
751
|
-
|
|
769
|
+
c("COMPLETED");
|
|
752
770
|
};
|
|
753
771
|
},
|
|
754
772
|
{
|
|
755
|
-
id:
|
|
773
|
+
id: r,
|
|
756
774
|
control: {
|
|
757
775
|
manual: !0
|
|
758
776
|
}
|
|
759
777
|
}
|
|
760
778
|
)).result?.();
|
|
761
779
|
},
|
|
762
|
-
replace: async (a, n,
|
|
763
|
-
const { status:
|
|
764
|
-
if (
|
|
780
|
+
replace: async (a, n, i = {}) => {
|
|
781
|
+
const { status: o, setStatus: c } = T.getState();
|
|
782
|
+
if (o !== "COMPLETED" && o !== "IDLE")
|
|
765
783
|
return;
|
|
766
|
-
const { index: u, addHistory: l } = R.getState(),
|
|
767
|
-
(await
|
|
784
|
+
const { index: u, addHistory: l } = R.getState(), p = R.getState().replaceHistory, f = B.getState().defaultTransitionName, { transitionName: r = f } = i, g = N.generateTaskId();
|
|
785
|
+
(await N.addTask(
|
|
768
786
|
async () => {
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
Object.entries(n).filter(([L]) => !
|
|
772
|
-
),
|
|
787
|
+
c("REPLACING");
|
|
788
|
+
const P = x.compile(a)(n), E = x.parse(a).tokens.filter((L) => L.type === "param").map((L) => L.name), h = Object.fromEntries(
|
|
789
|
+
Object.entries(n).filter(([L]) => !E.includes(L))
|
|
790
|
+
), m = new URLSearchParams(h).toString(), D = `${P}${m ? `?${m}` : ""}`;
|
|
773
791
|
return window.history.replaceState(
|
|
774
792
|
{
|
|
775
|
-
id:
|
|
793
|
+
id: g,
|
|
776
794
|
index: u,
|
|
777
795
|
status: "REPLACING",
|
|
778
796
|
params: n,
|
|
779
|
-
transitionName:
|
|
797
|
+
transitionName: r
|
|
780
798
|
},
|
|
781
799
|
"",
|
|
782
800
|
D
|
|
783
801
|
), l({
|
|
784
|
-
id:
|
|
785
|
-
pathname:
|
|
802
|
+
id: g,
|
|
803
|
+
pathname: P,
|
|
786
804
|
params: n,
|
|
787
|
-
transitionName:
|
|
805
|
+
transitionName: r
|
|
788
806
|
}), async () => {
|
|
789
|
-
|
|
807
|
+
p(u), c("COMPLETED");
|
|
790
808
|
};
|
|
791
809
|
},
|
|
792
810
|
{
|
|
793
|
-
id:
|
|
811
|
+
id: g,
|
|
794
812
|
control: {
|
|
795
813
|
manual: !0
|
|
796
814
|
}
|
|
@@ -807,9 +825,9 @@ function Kt() {
|
|
|
807
825
|
const s = q(ot);
|
|
808
826
|
return {
|
|
809
827
|
pushStep: async (n) => {
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
const
|
|
828
|
+
const i = T.getState().status;
|
|
829
|
+
i !== "COMPLETED" && i !== "IDLE" || (await N.addTask(async () => {
|
|
830
|
+
const o = new URLSearchParams(n).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
|
|
813
831
|
return window.history.state?.step || window.history.replaceState(
|
|
814
832
|
{
|
|
815
833
|
...window.history.state,
|
|
@@ -824,14 +842,14 @@ function Kt() {
|
|
|
824
842
|
params: n
|
|
825
843
|
},
|
|
826
844
|
"",
|
|
827
|
-
|
|
845
|
+
c
|
|
828
846
|
), async () => s({ type: "SET", params: n });
|
|
829
847
|
})).result?.();
|
|
830
848
|
},
|
|
831
849
|
replaceStep: async (n) => {
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
const
|
|
850
|
+
const i = T.getState().status;
|
|
851
|
+
i !== "COMPLETED" && i !== "IDLE" || (await N.addTask(async () => {
|
|
852
|
+
const o = new URLSearchParams(n).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
|
|
835
853
|
return window.history.replaceState(
|
|
836
854
|
{
|
|
837
855
|
...window.history.state,
|
|
@@ -839,7 +857,7 @@ function Kt() {
|
|
|
839
857
|
params: n
|
|
840
858
|
},
|
|
841
859
|
"",
|
|
842
|
-
|
|
860
|
+
c
|
|
843
861
|
), async () => s({ type: "SET", params: n });
|
|
844
862
|
})).result?.();
|
|
845
863
|
},
|
|
@@ -861,13 +879,13 @@ function Vt({
|
|
|
861
879
|
idle: t,
|
|
862
880
|
pushOnEnter: a,
|
|
863
881
|
pushOnExit: n,
|
|
864
|
-
replaceOnEnter:
|
|
865
|
-
replaceOnExit:
|
|
866
|
-
popOnEnter:
|
|
882
|
+
replaceOnEnter: i,
|
|
883
|
+
replaceOnExit: o,
|
|
884
|
+
popOnEnter: c,
|
|
867
885
|
popOnExit: u,
|
|
868
886
|
completedOnExit: l,
|
|
869
|
-
completedOnEnter:
|
|
870
|
-
options:
|
|
887
|
+
completedOnEnter: p,
|
|
888
|
+
options: f
|
|
871
889
|
}) {
|
|
872
890
|
return {
|
|
873
891
|
name: s,
|
|
@@ -877,14 +895,14 @@ function Vt({
|
|
|
877
895
|
"IDLE-false": t,
|
|
878
896
|
"PUSHING-false": n,
|
|
879
897
|
"PUSHING-true": a,
|
|
880
|
-
"REPLACING-false":
|
|
881
|
-
"REPLACING-true":
|
|
898
|
+
"REPLACING-false": o,
|
|
899
|
+
"REPLACING-true": i,
|
|
882
900
|
"POPPING-false": u,
|
|
883
|
-
"POPPING-true":
|
|
901
|
+
"POPPING-true": c,
|
|
884
902
|
"COMPLETED-false": l,
|
|
885
|
-
"COMPLETED-true":
|
|
903
|
+
"COMPLETED-true": p
|
|
886
904
|
},
|
|
887
|
-
...
|
|
905
|
+
...f
|
|
888
906
|
};
|
|
889
907
|
}
|
|
890
908
|
function Wt({
|
|
@@ -893,13 +911,13 @@ function Wt({
|
|
|
893
911
|
idle: t,
|
|
894
912
|
pushOnEnter: a,
|
|
895
913
|
pushOnExit: n,
|
|
896
|
-
replaceOnEnter:
|
|
897
|
-
replaceOnExit:
|
|
898
|
-
popOnEnter:
|
|
914
|
+
replaceOnEnter: i,
|
|
915
|
+
replaceOnExit: o,
|
|
916
|
+
popOnEnter: c,
|
|
899
917
|
popOnExit: u,
|
|
900
918
|
completedOnEnter: l,
|
|
901
|
-
completedOnExit:
|
|
902
|
-
options:
|
|
919
|
+
completedOnExit: p,
|
|
920
|
+
options: f
|
|
903
921
|
}) {
|
|
904
922
|
return {
|
|
905
923
|
name: s,
|
|
@@ -909,14 +927,14 @@ function Wt({
|
|
|
909
927
|
"IDLE-false": t,
|
|
910
928
|
"PUSHING-false": n,
|
|
911
929
|
"PUSHING-true": a,
|
|
912
|
-
"REPLACING-false":
|
|
913
|
-
"REPLACING-true":
|
|
930
|
+
"REPLACING-false": o,
|
|
931
|
+
"REPLACING-true": i,
|
|
914
932
|
"POPPING-false": u,
|
|
915
|
-
"POPPING-true":
|
|
916
|
-
"COMPLETED-false":
|
|
933
|
+
"POPPING-true": c,
|
|
934
|
+
"COMPLETED-false": p,
|
|
917
935
|
"COMPLETED-true": l
|
|
918
936
|
},
|
|
919
|
-
...
|
|
937
|
+
...f
|
|
920
938
|
};
|
|
921
939
|
}
|
|
922
940
|
const Rt = { then() {
|
|
@@ -929,29 +947,29 @@ function Gt({
|
|
|
929
947
|
throw Rt;
|
|
930
948
|
return e;
|
|
931
949
|
}
|
|
932
|
-
function
|
|
933
|
-
return /* @__PURE__ */
|
|
950
|
+
function bt({ freeze: s, children: e, placeholder: t }) {
|
|
951
|
+
return /* @__PURE__ */ w(Et, { fallback: t, children: /* @__PURE__ */ w(Gt, { freeze: s, children: e }) });
|
|
934
952
|
}
|
|
935
953
|
function z(s, e) {
|
|
936
954
|
const {
|
|
937
955
|
direction: t = "x",
|
|
938
956
|
markerSelector: a = "[data-swipe-at-edge]",
|
|
939
957
|
depthLimit: n = 24,
|
|
940
|
-
verifyByScroll:
|
|
941
|
-
} = e ?? {},
|
|
942
|
-
if (!
|
|
943
|
-
const
|
|
944
|
-
if (
|
|
945
|
-
return { element:
|
|
946
|
-
let u =
|
|
958
|
+
verifyByScroll: i = !1
|
|
959
|
+
} = e ?? {}, o = Ot(s);
|
|
960
|
+
if (!o) return { element: null, hasMarker: !1 };
|
|
961
|
+
const c = o.closest?.(a);
|
|
962
|
+
if (c instanceof HTMLElement && Y(c, t) && (!i || tt(c, t)))
|
|
963
|
+
return { element: c, hasMarker: !0 };
|
|
964
|
+
let u = o, l = 0;
|
|
947
965
|
for (; u && u !== document.body && l < n; ) {
|
|
948
|
-
if (Y(u, t) && (!
|
|
966
|
+
if (Y(u, t) && (!i || tt(u, t)))
|
|
949
967
|
return { element: u, hasMarker: !1 };
|
|
950
968
|
u = u.parentElement, l++;
|
|
951
969
|
}
|
|
952
970
|
return { element: null, hasMarker: !1 };
|
|
953
971
|
}
|
|
954
|
-
function
|
|
972
|
+
function Ot(s) {
|
|
955
973
|
if (!s) return null;
|
|
956
974
|
const e = s, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
|
|
957
975
|
if (t && t.length) {
|
|
@@ -982,18 +1000,18 @@ function tt(s, e) {
|
|
|
982
1000
|
}
|
|
983
1001
|
}
|
|
984
1002
|
function Ht({ children: s, ref: e, ...t }) {
|
|
985
|
-
const { isActive: a, transitionName: n } = V(), [
|
|
986
|
-
St(e, () =>
|
|
987
|
-
const
|
|
1003
|
+
const { isActive: a, transitionName: n } = V(), [i, o] = at();
|
|
1004
|
+
St(e, () => i.current);
|
|
1005
|
+
const c = T((r) => r.status), u = Q.get(n), { decoratorName: l } = u, { initial: p, variants: f } = K.get(l);
|
|
988
1006
|
return G(() => {
|
|
989
|
-
if (!
|
|
990
|
-
const { value:
|
|
991
|
-
|
|
992
|
-
}, [
|
|
1007
|
+
if (!i.current) return;
|
|
1008
|
+
const { value: r, options: g } = f[`${c}-${a}`];
|
|
1009
|
+
o(i.current, r, g);
|
|
1010
|
+
}, [c, a, o, f, i]), /* @__PURE__ */ w(
|
|
993
1011
|
rt.div,
|
|
994
1012
|
{
|
|
995
|
-
ref:
|
|
996
|
-
initial:
|
|
1013
|
+
ref: i,
|
|
1014
|
+
initial: p,
|
|
997
1015
|
style: {
|
|
998
1016
|
position: "absolute",
|
|
999
1017
|
top: 0,
|
|
@@ -1007,7 +1025,7 @@ function Ht({ children: s, ref: e, ...t }) {
|
|
|
1007
1025
|
}
|
|
1008
1026
|
);
|
|
1009
1027
|
}
|
|
1010
|
-
const
|
|
1028
|
+
const O = _((s) => ({
|
|
1011
1029
|
dragStatus: "IDLE",
|
|
1012
1030
|
replaceTransitionStatus: "IDLE",
|
|
1013
1031
|
setDragStatus: (e) => s({ dragStatus: e }),
|
|
@@ -1017,46 +1035,46 @@ function Ut({
|
|
|
1017
1035
|
children: s,
|
|
1018
1036
|
...e
|
|
1019
1037
|
}) {
|
|
1020
|
-
const [t, a] = at(), { id: n, isActive:
|
|
1038
|
+
const [t, a] = at(), { id: n, isActive: i, isRoot: o, transitionName: c, prevTransitionName: u } = V(), l = wt(), p = T((d) => d.status), f = O((d) => d.dragStatus), r = O.getState().setDragStatus, g = O.getState().setReplaceTransitionStatus, P = Q.get(c), { variants: E, initial: h, swipeDirection: m, decoratorName: D } = P, L = K.get(D), H = I(null), U = I(null), $ = I(null), k = I(!1), b = I(!1), v = I({
|
|
1021
1039
|
element: null,
|
|
1022
1040
|
hasMarker: !1
|
|
1023
|
-
}), M =
|
|
1024
|
-
if (!
|
|
1041
|
+
}), M = I({ element: null, hasMarker: !1 }), W = I(0), J = I(0), ut = async (d, y) => {
|
|
1042
|
+
if (!m)
|
|
1025
1043
|
return;
|
|
1026
1044
|
H.current = t.current?.previousSibling, $.current = t.current?.previousSibling?.querySelector("[data-decorator]");
|
|
1027
|
-
const
|
|
1045
|
+
const S = await P?.onSwipeStart(d, y, {
|
|
1028
1046
|
currentScreen: t.current,
|
|
1029
1047
|
prevScreen: H.current,
|
|
1030
1048
|
dragControls: l,
|
|
1031
|
-
onStart: (
|
|
1049
|
+
onStart: (C) => L?.onSwipeStart?.(C, {
|
|
1032
1050
|
currentDecorator: U.current,
|
|
1033
1051
|
prevDecorator: $.current
|
|
1034
1052
|
})
|
|
1035
1053
|
});
|
|
1036
|
-
|
|
1037
|
-
}, lt = (d,
|
|
1038
|
-
!
|
|
1054
|
+
r(S ? "PENDING" : "IDLE");
|
|
1055
|
+
}, lt = (d, y) => {
|
|
1056
|
+
!m || f !== "PENDING" || P?.onSwipe(d, y, {
|
|
1039
1057
|
currentScreen: t.current,
|
|
1040
1058
|
prevScreen: H.current,
|
|
1041
1059
|
dragControls: l,
|
|
1042
|
-
onProgress: (
|
|
1060
|
+
onProgress: (S, C) => L?.onSwipe?.(S, C, {
|
|
1043
1061
|
currentDecorator: U.current,
|
|
1044
1062
|
prevDecorator: $.current
|
|
1045
1063
|
})
|
|
1046
1064
|
});
|
|
1047
|
-
}, dt = async (d,
|
|
1048
|
-
if (!
|
|
1065
|
+
}, dt = async (d, y) => {
|
|
1066
|
+
if (!m || f !== "PENDING")
|
|
1049
1067
|
return;
|
|
1050
|
-
await
|
|
1068
|
+
await P?.onSwipeEnd(d, y, {
|
|
1051
1069
|
currentScreen: t.current,
|
|
1052
1070
|
prevScreen: H.current,
|
|
1053
|
-
onStart: (
|
|
1071
|
+
onStart: (C) => L?.onSwipeEnd?.(C, {
|
|
1054
1072
|
currentDecorator: U.current,
|
|
1055
1073
|
prevDecorator: $.current
|
|
1056
1074
|
})
|
|
1057
|
-
}) ? window.history.back() :
|
|
1075
|
+
}) ? window.history.back() : r("IDLE");
|
|
1058
1076
|
}, pt = (d) => {
|
|
1059
|
-
if (!(!
|
|
1077
|
+
if (!(!o && i && p === "COMPLETED" && f === "IDLE" && !!m))
|
|
1060
1078
|
return;
|
|
1061
1079
|
v.current = z(d.target, {
|
|
1062
1080
|
direction: "x"
|
|
@@ -1064,52 +1082,52 @@ function Ut({
|
|
|
1064
1082
|
direction: "y"
|
|
1065
1083
|
}), W.current = d.clientX, J.current = d.clientY, (!v.current.element && !M.current.element || v.current.element || M.current.element) && (k.current = !0);
|
|
1066
1084
|
}, ft = (d) => {
|
|
1067
|
-
const
|
|
1068
|
-
if (k.current &&
|
|
1069
|
-
k.current = !1,
|
|
1070
|
-
else if (k.current && !
|
|
1071
|
-
const
|
|
1072
|
-
(
|
|
1085
|
+
const y = !v.current.element && !M.current.element;
|
|
1086
|
+
if (k.current && y)
|
|
1087
|
+
k.current = !1, b.current = !0, l.start(d);
|
|
1088
|
+
else if (k.current && !y) {
|
|
1089
|
+
const S = d.clientX - W.current, C = d.clientY - J.current, gt = M.current.element && M.current.element.scrollTop <= 0 && M.current.hasMarker, mt = v.current.element && v.current.element.scrollLeft <= 0 && v.current.hasMarker;
|
|
1090
|
+
(m === "y" && (gt || v.current.element) && C > 0 && Math.abs(S) < 4 || m === "x" && (mt || M.current.element) && S > 0 && Math.abs(C) < 4) && (k.current = !1, b.current = !0, l.start(d));
|
|
1073
1091
|
}
|
|
1074
1092
|
}, ht = () => {
|
|
1075
|
-
k.current = !1,
|
|
1093
|
+
k.current = !1, b.current = !1;
|
|
1076
1094
|
};
|
|
1077
1095
|
return G(() => {
|
|
1078
1096
|
const d = t.current;
|
|
1079
1097
|
if (!d) return;
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1098
|
+
const y = (S) => {
|
|
1099
|
+
b.current && S.preventDefault(), S.target?.dataset.swipeAtEdgeBar === "true" && S.preventDefault();
|
|
1082
1100
|
};
|
|
1083
|
-
return d.addEventListener("touchmove",
|
|
1101
|
+
return d.addEventListener("touchmove", y, {
|
|
1084
1102
|
passive: !1
|
|
1085
1103
|
}), () => {
|
|
1086
|
-
d.removeEventListener("touchmove",
|
|
1104
|
+
d.removeEventListener("touchmove", y);
|
|
1087
1105
|
};
|
|
1088
1106
|
}, [t]), G(() => {
|
|
1089
1107
|
t.current && (async () => {
|
|
1090
|
-
const { value: d, options:
|
|
1091
|
-
!
|
|
1108
|
+
const { value: d, options: y } = E[`${p}-${i}`], S = u !== c;
|
|
1109
|
+
!i && p === "REPLACING" && S && (g("PENDING"), await a(t.current, At, {
|
|
1092
1110
|
duration: 0.1
|
|
1093
|
-
})), await a(t.current, d,
|
|
1111
|
+
})), await a(t.current, d, y), await N.resolveTask(n), !i && S && g("IDLE"), i && p === "COMPLETED" && r("IDLE");
|
|
1094
1112
|
})();
|
|
1095
1113
|
}, [
|
|
1096
|
-
|
|
1097
|
-
|
|
1114
|
+
p,
|
|
1115
|
+
i,
|
|
1098
1116
|
n,
|
|
1099
1117
|
u,
|
|
1100
|
-
|
|
1118
|
+
c,
|
|
1101
1119
|
a,
|
|
1102
1120
|
t,
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1121
|
+
E,
|
|
1122
|
+
r,
|
|
1123
|
+
g
|
|
1106
1124
|
]), /* @__PURE__ */ et(
|
|
1107
1125
|
rt.div,
|
|
1108
1126
|
{
|
|
1109
1127
|
ref: t,
|
|
1110
1128
|
...e,
|
|
1111
|
-
initial:
|
|
1112
|
-
drag:
|
|
1129
|
+
initial: h,
|
|
1130
|
+
drag: m,
|
|
1113
1131
|
dragListener: !1,
|
|
1114
1132
|
dragControls: l,
|
|
1115
1133
|
onDragStart: ut,
|
|
@@ -1135,7 +1153,7 @@ function Ut({
|
|
|
1135
1153
|
...e.style
|
|
1136
1154
|
},
|
|
1137
1155
|
children: [
|
|
1138
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ w(
|
|
1139
1157
|
"div",
|
|
1140
1158
|
{
|
|
1141
1159
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1149,7 +1167,7 @@ function Ut({
|
|
|
1149
1167
|
}
|
|
1150
1168
|
}
|
|
1151
1169
|
),
|
|
1152
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ w(
|
|
1153
1171
|
"div",
|
|
1154
1172
|
{
|
|
1155
1173
|
style: {
|
|
@@ -1162,8 +1180,8 @@ function Ut({
|
|
|
1162
1180
|
children: s
|
|
1163
1181
|
}
|
|
1164
1182
|
),
|
|
1165
|
-
L && /* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1183
|
+
L && /* @__PURE__ */ w(Ht, { ref: U }),
|
|
1184
|
+
/* @__PURE__ */ w(
|
|
1167
1185
|
"div",
|
|
1168
1186
|
{
|
|
1169
1187
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1185,8 +1203,8 @@ function Jt({
|
|
|
1185
1203
|
children: s,
|
|
1186
1204
|
...e
|
|
1187
1205
|
}) {
|
|
1188
|
-
const { isActive: t, isPrev: a } = V(), n = T((l) => l.status),
|
|
1189
|
-
return /* @__PURE__ */
|
|
1206
|
+
const { isActive: t, isPrev: a } = V(), n = T((l) => l.status), i = O((l) => l.dragStatus), o = O((l) => l.replaceTransitionStatus);
|
|
1207
|
+
return /* @__PURE__ */ w(bt, { freeze: !t && (n === "COMPLETED" && i === "IDLE" && o === "IDLE" || a && o === "IDLE"), children: /* @__PURE__ */ w(Ut, { ...e, children: s }) });
|
|
1190
1208
|
}
|
|
1191
1209
|
export {
|
|
1192
1210
|
Xt as Route,
|