@flemo/core 1.10.0 → 1.11.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/history/store.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface History {
|
|
|
6
6
|
params: object;
|
|
7
7
|
transitionName: TransitionName;
|
|
8
8
|
layoutId: string | number | null;
|
|
9
|
+
frameIndex?: number;
|
|
9
10
|
}
|
|
10
11
|
export interface HistoryStore {
|
|
11
12
|
index: number;
|
|
@@ -16,6 +17,8 @@ export interface HistoryStore {
|
|
|
16
17
|
popHistory: (index: number) => void;
|
|
17
18
|
popHistories: (count: number) => void;
|
|
18
19
|
setPendingIndex: (index: number) => void;
|
|
20
|
+
adoptHistory: (history: History) => void;
|
|
21
|
+
truncateHistory: (position: number) => void;
|
|
19
22
|
setTransitionName: (index: number, transitionName: TransitionName) => void;
|
|
20
23
|
}
|
|
21
24
|
export type HistoryStoreApi = StoreApi<HistoryStore>;
|
package/dist/index.mjs
CHANGED
|
@@ -206,6 +206,12 @@ function o(t = [], n = -1) {
|
|
|
206
206
|
});
|
|
207
207
|
},
|
|
208
208
|
setPendingIndex: (t) => e({ pendingIndex: t }),
|
|
209
|
+
adoptHistory: (t) => e((e) => ({ histories: e.histories.slice(0, e.index).concat(t) })),
|
|
210
|
+
truncateHistory: (t) => e((e) => ({
|
|
211
|
+
index: t,
|
|
212
|
+
pendingIndex: t,
|
|
213
|
+
histories: e.histories.slice(0, t + 1)
|
|
214
|
+
})),
|
|
209
215
|
setTransitionName: (t, n) => e((e) => {
|
|
210
216
|
let r = e.histories[t];
|
|
211
217
|
if (!r || r.transitionName === n) return {};
|
|
@@ -330,35 +336,58 @@ function _() {
|
|
|
330
336
|
//#endregion
|
|
331
337
|
//#region src/history/createHistorySync.ts
|
|
332
338
|
function v(e) {
|
|
333
|
-
let { stores: t, driver: n = p(), consume: r = _ } = e
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
let n = e.state, i = a.generateTaskId();
|
|
339
|
+
let { stores: t, driver: n = p(), consume: r = _ } = e, i = !1, o = n.subscribe(async (e) => {
|
|
340
|
+
if (i || r()) return;
|
|
341
|
+
let o = e.state, s = a.generateTaskId();
|
|
337
342
|
(await a.addTask(async (r) => {
|
|
338
|
-
|
|
339
|
-
|
|
343
|
+
if (i) {
|
|
344
|
+
r.abort();
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
if (n.readState()?.id !== e.state?.id) {
|
|
340
348
|
r.abort();
|
|
341
349
|
return;
|
|
342
350
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
let { setStatus: a, setTransitionTaskId: c } = t.navigate.getState(), { index: l, histories: u, addHistory: d, popHistory: f, popHistories: p, setPendingIndex: m } = t.history.getState();
|
|
352
|
+
if (!o?.id) {
|
|
353
|
+
r.abort();
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
let h = u.findIndex((e) => e.id === o.id);
|
|
357
|
+
if (h === l) {
|
|
358
|
+
r.abort();
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
let g = {
|
|
362
|
+
id: o.id,
|
|
363
|
+
pathname: e.pathname,
|
|
364
|
+
params: o.params,
|
|
365
|
+
transitionName: o.transitionName,
|
|
366
|
+
layoutId: o.layoutId,
|
|
367
|
+
frameIndex: o.index
|
|
368
|
+
};
|
|
369
|
+
if (h === -1) {
|
|
370
|
+
let e = u[l]?.frameIndex ?? l;
|
|
371
|
+
if (!(o.index > e && (o.status === "PUSHING" || o.status === "REPLACING"))) {
|
|
372
|
+
t.history.getState().adoptHistory(g), r.abort();
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
return c(s), a(o.status === "REPLACING" ? "REPLACING" : "PUSHING"), d(g), async () => {
|
|
376
|
+
a("COMPLETED");
|
|
377
|
+
};
|
|
353
378
|
}
|
|
354
|
-
|
|
355
|
-
|
|
379
|
+
let _ = l - h - 1;
|
|
380
|
+
return c(s), _ > 0 && p(_), m(h), a("POPPING"), async () => {
|
|
381
|
+
f(h + 1), a("COMPLETED");
|
|
356
382
|
};
|
|
357
383
|
}, {
|
|
358
|
-
id:
|
|
384
|
+
id: s,
|
|
359
385
|
control: { manual: !0 }
|
|
360
386
|
})).result?.();
|
|
361
387
|
});
|
|
388
|
+
return () => {
|
|
389
|
+
i = !0, o();
|
|
390
|
+
};
|
|
362
391
|
}
|
|
363
392
|
//#endregion
|
|
364
393
|
//#region src/history/memoryHistoryDriver.ts
|
|
@@ -427,138 +456,181 @@ var x = (e, t, n) => {
|
|
|
427
456
|
i(), s && r();
|
|
428
457
|
};
|
|
429
458
|
function w(e) {
|
|
430
|
-
let { stores: t, buildPathname: n, driver: r = p(), markSelfInduced: i = g } = e, o =
|
|
431
|
-
let
|
|
432
|
-
if (
|
|
433
|
-
let
|
|
434
|
-
(
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
459
|
+
let { stores: t, buildPathname: n, driver: r = p(), markSelfInduced: i = g } = e, o = () => {
|
|
460
|
+
let e = r.readState();
|
|
461
|
+
if (!e?.id) return null;
|
|
462
|
+
let { index: n, histories: i, adoptHistory: a, truncateHistory: o } = t.history.getState();
|
|
463
|
+
if (i[n]?.id === e.id) return e;
|
|
464
|
+
let s = i.findIndex((t) => t.id === e.id);
|
|
465
|
+
return s >= 0 ? o(s) : a({
|
|
466
|
+
id: e.id,
|
|
467
|
+
pathname: r.readPathname(),
|
|
468
|
+
params: e.params ?? {},
|
|
469
|
+
transitionName: e.transitionName ?? "none",
|
|
470
|
+
layoutId: e.layoutId ?? null,
|
|
471
|
+
frameIndex: e.index
|
|
472
|
+
}), e;
|
|
473
|
+
}, s = async (e, s, c) => {
|
|
474
|
+
let { status: l } = t.navigate.getState();
|
|
475
|
+
if (l !== "COMPLETED" && l !== "IDLE") return;
|
|
476
|
+
let u = t.transition.getState().defaultTransitionName, { transitionName: d = u, layoutId: f = null } = c ?? {}, p = a.generateTaskId();
|
|
477
|
+
(await a.addTask(async (a) => {
|
|
478
|
+
if (t.life && !t.life.alive) {
|
|
479
|
+
a.abort();
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
let l = o(), { index: u, histories: m, addHistory: h, popHistories: g } = t.history.getState(), _ = (() => {
|
|
483
|
+
if (c?.until != null) {
|
|
484
|
+
let e = x(c.until, u, m);
|
|
438
485
|
return e < 0 ? 0 : e;
|
|
439
486
|
}
|
|
440
|
-
return Math.min(S(
|
|
441
|
-
})(), { setStatus:
|
|
442
|
-
|
|
443
|
-
let { pathname:
|
|
444
|
-
id:
|
|
445
|
-
pathname:
|
|
446
|
-
params:
|
|
447
|
-
transitionName:
|
|
448
|
-
layoutId:
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
id:
|
|
452
|
-
index:
|
|
487
|
+
return Math.min(S(c?.skip, 0), Math.max(0, u));
|
|
488
|
+
})(), { setStatus: v, setTransitionTaskId: y } = t.navigate.getState();
|
|
489
|
+
v("PUSHING"), y(p);
|
|
490
|
+
let { pathname: b, toPathname: w } = n(e, s ?? {}), T = {
|
|
491
|
+
id: p,
|
|
492
|
+
pathname: w,
|
|
493
|
+
params: s ?? {},
|
|
494
|
+
transitionName: d,
|
|
495
|
+
layoutId: f
|
|
496
|
+
}, E = l?.index ?? m[u]?.frameIndex ?? u;
|
|
497
|
+
if (_ === 0) return r.pushState({
|
|
498
|
+
id: p,
|
|
499
|
+
index: E + 1,
|
|
453
500
|
status: "PUSHING",
|
|
454
|
-
params:
|
|
455
|
-
transitionName:
|
|
456
|
-
layoutId:
|
|
457
|
-
},
|
|
458
|
-
|
|
459
|
-
|
|
501
|
+
params: s,
|
|
502
|
+
transitionName: d,
|
|
503
|
+
layoutId: f
|
|
504
|
+
}, b), h({
|
|
505
|
+
...T,
|
|
506
|
+
frameIndex: E + 1
|
|
507
|
+
}), () => {
|
|
508
|
+
v("COMPLETED");
|
|
509
|
+
};
|
|
510
|
+
let D = m[u - _]?.frameIndex ?? u - _;
|
|
511
|
+
return h({
|
|
512
|
+
...T,
|
|
513
|
+
frameIndex: D + 1
|
|
514
|
+
}), await C(r, i, _, () => {
|
|
460
515
|
r.pushState({
|
|
461
|
-
id:
|
|
462
|
-
index:
|
|
516
|
+
id: p,
|
|
517
|
+
index: D + 1,
|
|
463
518
|
status: "PUSHING",
|
|
464
|
-
params:
|
|
465
|
-
transitionName:
|
|
466
|
-
layoutId:
|
|
467
|
-
},
|
|
519
|
+
params: s,
|
|
520
|
+
transitionName: d,
|
|
521
|
+
layoutId: f
|
|
522
|
+
}, b);
|
|
468
523
|
}), async () => {
|
|
469
|
-
|
|
470
|
-
}
|
|
524
|
+
g(_), v("COMPLETED");
|
|
525
|
+
};
|
|
471
526
|
}, {
|
|
472
|
-
id:
|
|
527
|
+
id: p,
|
|
473
528
|
control: { manual: !0 }
|
|
474
529
|
})).result?.();
|
|
475
|
-
},
|
|
476
|
-
let { status:
|
|
477
|
-
if (
|
|
478
|
-
let
|
|
530
|
+
}, c = async (e, s, c) => {
|
|
531
|
+
let { status: l } = t.navigate.getState();
|
|
532
|
+
if (l !== "COMPLETED" && l !== "IDLE") return;
|
|
533
|
+
let u = t.transition.getState().defaultTransitionName, { transitionName: d = u, layoutId: f = null } = c ?? {}, p = a.generateTaskId();
|
|
479
534
|
(await a.addTask(async (a) => {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
535
|
+
if (t.life && !t.life.alive) {
|
|
536
|
+
a.abort();
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
let l = o(), { index: u, histories: m, addHistory: h, replaceHistory: g, popHistories: _ } = t.history.getState(), v = (() => {
|
|
540
|
+
if (c?.until != null) {
|
|
541
|
+
let e = x(c.until, u, m);
|
|
483
542
|
return e < 0 ? 0 : e + 1;
|
|
484
543
|
}
|
|
485
|
-
return Math.min(S(
|
|
544
|
+
return Math.min(S(c?.skip, 0) + 1, u + 1);
|
|
486
545
|
})();
|
|
487
|
-
if (
|
|
546
|
+
if (v <= 0) {
|
|
488
547
|
a.abort();
|
|
489
548
|
return;
|
|
490
549
|
}
|
|
491
|
-
let { setStatus:
|
|
492
|
-
|
|
493
|
-
let { pathname:
|
|
494
|
-
id:
|
|
495
|
-
pathname:
|
|
496
|
-
params:
|
|
497
|
-
transitionName:
|
|
498
|
-
layoutId:
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
id:
|
|
502
|
-
index:
|
|
550
|
+
let { setStatus: y, setTransitionTaskId: b } = t.navigate.getState();
|
|
551
|
+
y("REPLACING"), b(p);
|
|
552
|
+
let { pathname: w, toPathname: T } = n(e, s ?? {}), E = {
|
|
553
|
+
id: p,
|
|
554
|
+
pathname: T,
|
|
555
|
+
params: s ?? {},
|
|
556
|
+
transitionName: d,
|
|
557
|
+
layoutId: f
|
|
558
|
+
}, D = l?.index ?? m[u]?.frameIndex ?? u;
|
|
559
|
+
if (v === 1) return r.replaceState({
|
|
560
|
+
id: p,
|
|
561
|
+
index: D,
|
|
503
562
|
status: "REPLACING",
|
|
504
|
-
params:
|
|
505
|
-
transitionName:
|
|
506
|
-
layoutId:
|
|
507
|
-
},
|
|
508
|
-
|
|
509
|
-
|
|
563
|
+
params: s,
|
|
564
|
+
transitionName: d,
|
|
565
|
+
layoutId: f
|
|
566
|
+
}, w), h({
|
|
567
|
+
...E,
|
|
568
|
+
frameIndex: D
|
|
569
|
+
}), async () => {
|
|
570
|
+
g(u), y("COMPLETED");
|
|
571
|
+
};
|
|
572
|
+
let O = v <= u ? (m[u - v]?.frameIndex ?? u - v) + 1 : m[0]?.frameIndex ?? 0;
|
|
573
|
+
return _(v - 1), h({
|
|
574
|
+
...E,
|
|
575
|
+
frameIndex: O
|
|
576
|
+
}), v <= u ? await C(r, i, v, () => {
|
|
510
577
|
r.pushState({
|
|
511
|
-
id:
|
|
512
|
-
index:
|
|
578
|
+
id: p,
|
|
579
|
+
index: O,
|
|
513
580
|
status: "REPLACING",
|
|
514
|
-
params:
|
|
515
|
-
transitionName:
|
|
516
|
-
layoutId:
|
|
517
|
-
},
|
|
518
|
-
}) : await C(r, i,
|
|
581
|
+
params: s,
|
|
582
|
+
transitionName: d,
|
|
583
|
+
layoutId: f
|
|
584
|
+
}, w);
|
|
585
|
+
}) : await C(r, i, u, () => {
|
|
519
586
|
r.replaceState({
|
|
520
|
-
id:
|
|
521
|
-
index:
|
|
587
|
+
id: p,
|
|
588
|
+
index: O,
|
|
522
589
|
status: "REPLACING",
|
|
523
|
-
params:
|
|
524
|
-
transitionName:
|
|
525
|
-
layoutId:
|
|
526
|
-
},
|
|
590
|
+
params: s,
|
|
591
|
+
transitionName: d,
|
|
592
|
+
layoutId: f
|
|
593
|
+
}, w);
|
|
527
594
|
}), async () => {
|
|
528
|
-
|
|
529
|
-
}
|
|
595
|
+
g(t.history.getState().index - 1), y("COMPLETED");
|
|
596
|
+
};
|
|
530
597
|
}, {
|
|
531
|
-
id:
|
|
598
|
+
id: p,
|
|
532
599
|
control: { manual: !0 }
|
|
533
600
|
})).result?.();
|
|
534
|
-
},
|
|
535
|
-
let
|
|
601
|
+
}, l = async (e, n) => {
|
|
602
|
+
let s = a.generateTaskId();
|
|
536
603
|
(await a.addTask(async (a) => {
|
|
537
|
-
|
|
538
|
-
|
|
604
|
+
if (t.life && !t.life.alive) {
|
|
605
|
+
a.abort();
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
o();
|
|
609
|
+
let { index: c, histories: l, popHistory: u, popHistories: d, setPendingIndex: f, setTransitionName: p } = t.history.getState();
|
|
610
|
+
if (c <= 0) {
|
|
539
611
|
a.abort();
|
|
540
612
|
return;
|
|
541
613
|
}
|
|
542
|
-
let
|
|
543
|
-
if (
|
|
614
|
+
let m = Math.min(e(c, l), c);
|
|
615
|
+
if (m <= 0) {
|
|
544
616
|
a.abort();
|
|
545
617
|
return;
|
|
546
618
|
}
|
|
547
|
-
|
|
548
|
-
let { setStatus:
|
|
549
|
-
return n &&
|
|
550
|
-
|
|
619
|
+
f(c - m);
|
|
620
|
+
let { setStatus: h, setTransitionTaskId: g } = t.navigate.getState();
|
|
621
|
+
return n && p(c, n), h("POPPING"), g(s), d(m - 1), i(), m === 1 ? r.back() : r.go(-m), async () => {
|
|
622
|
+
u(t.history.getState().index), h("COMPLETED");
|
|
551
623
|
};
|
|
552
624
|
}, {
|
|
553
|
-
id:
|
|
625
|
+
id: s,
|
|
554
626
|
control: { manual: !0 }
|
|
555
627
|
})).result?.();
|
|
556
628
|
};
|
|
557
629
|
return {
|
|
558
|
-
push:
|
|
559
|
-
replace:
|
|
630
|
+
push: s,
|
|
631
|
+
replace: c,
|
|
560
632
|
pop: async (e) => {
|
|
561
|
-
await
|
|
633
|
+
await l((t, n) => {
|
|
562
634
|
if (e?.until != null) {
|
|
563
635
|
let r = x(e.until, t, n);
|
|
564
636
|
return r < 0 ? 0 : r;
|
|
@@ -571,14 +643,14 @@ function w(e) {
|
|
|
571
643
|
}
|
|
572
644
|
//#endregion
|
|
573
645
|
//#region src/navigate/createStepController.ts
|
|
574
|
-
var
|
|
646
|
+
var T = (e) => {
|
|
575
647
|
let t = e;
|
|
576
648
|
return t?.step ? t.params ?? {} : null;
|
|
577
|
-
},
|
|
649
|
+
}, E = (e, t) => {
|
|
578
650
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
579
651
|
return n ? `${e}?${n}` : e;
|
|
580
652
|
};
|
|
581
|
-
function
|
|
653
|
+
function D(e) {
|
|
582
654
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
583
655
|
return {
|
|
584
656
|
pushStep: async (e) => {
|
|
@@ -633,7 +705,7 @@ function ne(e) {
|
|
|
633
705
|
}
|
|
634
706
|
};
|
|
635
707
|
}
|
|
636
|
-
function
|
|
708
|
+
function O(e, t) {
|
|
637
709
|
return e.subscribe((e) => {
|
|
638
710
|
let n = e.state;
|
|
639
711
|
n?.step && a.addTask(async () => {
|
|
@@ -643,7 +715,7 @@ function re(e, t) {
|
|
|
643
715
|
}
|
|
644
716
|
//#endregion
|
|
645
717
|
//#region src/transition/store.ts
|
|
646
|
-
function
|
|
718
|
+
function ee(t = "cupertino") {
|
|
647
719
|
return e((e) => ({
|
|
648
720
|
defaultTransitionName: t,
|
|
649
721
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -651,7 +723,7 @@ function T(t = "cupertino") {
|
|
|
651
723
|
}
|
|
652
724
|
//#endregion
|
|
653
725
|
//#region src/screen/store.ts
|
|
654
|
-
function
|
|
726
|
+
function k() {
|
|
655
727
|
return e((e) => ({
|
|
656
728
|
dragStatus: "IDLE",
|
|
657
729
|
replaceTransitionStatus: "IDLE",
|
|
@@ -682,40 +754,44 @@ function E() {
|
|
|
682
754
|
}
|
|
683
755
|
//#endregion
|
|
684
756
|
//#region src/core/createRouterScope.ts
|
|
685
|
-
var
|
|
757
|
+
var te = {
|
|
686
758
|
mark: () => {},
|
|
687
759
|
consume: () => !1
|
|
688
760
|
};
|
|
689
|
-
function
|
|
690
|
-
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: s } = e, c = l(t, n, r, i)
|
|
691
|
-
|
|
761
|
+
function ne(e) {
|
|
762
|
+
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: s } = e, c = l(t, n, r, i), d = s && !u() ? s.readState()?.index ?? 0 : 0, f = {
|
|
763
|
+
...c,
|
|
764
|
+
frameIndex: d
|
|
765
|
+
};
|
|
766
|
+
if (e.hostedScope) return e.hostedScope.life.alive = !0, e.hostedScope.history.getState().index === -1 && e.hostedScope.history.setState({
|
|
692
767
|
index: 0,
|
|
693
|
-
histories: [
|
|
768
|
+
histories: [f]
|
|
694
769
|
}), e.hostedScope;
|
|
695
|
-
let
|
|
770
|
+
let p = a ? y({
|
|
696
771
|
state: {
|
|
697
|
-
id:
|
|
772
|
+
id: f.id,
|
|
698
773
|
index: 0,
|
|
699
774
|
status: "IDLE",
|
|
700
|
-
params:
|
|
701
|
-
transitionName:
|
|
702
|
-
layoutId:
|
|
775
|
+
params: f.params,
|
|
776
|
+
transitionName: f.transitionName,
|
|
777
|
+
layoutId: f.layoutId
|
|
703
778
|
},
|
|
704
|
-
url:
|
|
705
|
-
}) : s,
|
|
779
|
+
url: f.pathname
|
|
780
|
+
}) : s, h = a ? te : m();
|
|
706
781
|
return {
|
|
707
|
-
history: o([
|
|
782
|
+
history: o([f], 0),
|
|
708
783
|
navigate: b(),
|
|
709
|
-
transition:
|
|
710
|
-
screen:
|
|
711
|
-
driver:
|
|
712
|
-
markSelfInduced:
|
|
713
|
-
consume:
|
|
784
|
+
transition: ee(i),
|
|
785
|
+
screen: k(),
|
|
786
|
+
driver: p,
|
|
787
|
+
markSelfInduced: h.mark,
|
|
788
|
+
consume: h.consume,
|
|
789
|
+
life: { alive: !0 }
|
|
714
790
|
};
|
|
715
791
|
}
|
|
716
792
|
//#endregion
|
|
717
793
|
//#region src/screen/createScreenSelector.ts
|
|
718
|
-
function
|
|
794
|
+
function re(e, t) {
|
|
719
795
|
return e.map((n, r) => ({
|
|
720
796
|
...n,
|
|
721
797
|
isActive: r === t,
|
|
@@ -728,13 +804,13 @@ function oe(e, t) {
|
|
|
728
804
|
}
|
|
729
805
|
//#endregion
|
|
730
806
|
//#region src/screen/computeScreenFreeze.ts
|
|
731
|
-
function
|
|
807
|
+
function ie(e) {
|
|
732
808
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
733
809
|
return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
|
|
734
810
|
}
|
|
735
811
|
//#endregion
|
|
736
812
|
//#region src/transition/createTransition.ts
|
|
737
|
-
function
|
|
813
|
+
function A({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
738
814
|
return {
|
|
739
815
|
name: e,
|
|
740
816
|
initial: t,
|
|
@@ -755,7 +831,7 @@ function D({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
755
831
|
}
|
|
756
832
|
//#endregion
|
|
757
833
|
//#region src/transition/createRawTransition.ts
|
|
758
|
-
function
|
|
834
|
+
function ae({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
759
835
|
return {
|
|
760
836
|
name: e,
|
|
761
837
|
initial: t,
|
|
@@ -776,10 +852,10 @@ function ce({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
776
852
|
}
|
|
777
853
|
//#endregion
|
|
778
854
|
//#region src/transition/cupertino.ts
|
|
779
|
-
var
|
|
855
|
+
var oe = (e, t, n) => {
|
|
780
856
|
let [r, i] = t, [a, o] = n;
|
|
781
857
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
782
|
-
},
|
|
858
|
+
}, se = A({
|
|
783
859
|
name: "cupertino",
|
|
784
860
|
initial: { x: "100%" },
|
|
785
861
|
idle: {
|
|
@@ -839,7 +915,7 @@ var le = (e, t, n) => {
|
|
|
839
915
|
swipeDirection: "x",
|
|
840
916
|
onSwipeStart: async () => !0,
|
|
841
917
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
842
|
-
let { offset: o } = t, s = o.x, c =
|
|
918
|
+
let { offset: o } = t, s = o.x, c = oe(s, [0, window.innerWidth], [0, 100]);
|
|
843
919
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + c * .3}%` }, { duration: 0 }), c;
|
|
844
920
|
},
|
|
845
921
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -863,10 +939,10 @@ var le = (e, t, n) => {
|
|
|
863
939
|
})]), c;
|
|
864
940
|
}
|
|
865
941
|
}
|
|
866
|
-
}),
|
|
942
|
+
}), ce = (e, t, n) => {
|
|
867
943
|
let [r, i] = t, [a, o] = n;
|
|
868
944
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
869
|
-
},
|
|
945
|
+
}, j = A({
|
|
870
946
|
name: "layout",
|
|
871
947
|
initial: { opacity: .97 },
|
|
872
948
|
idle: {
|
|
@@ -894,7 +970,7 @@ var le = (e, t, n) => {
|
|
|
894
970
|
swipeDirection: "y",
|
|
895
971
|
onSwipeStart: async () => !0,
|
|
896
972
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
897
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
973
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = ce(s, [0, 56], [1, .96]), l = Math.max(0, o - 56), u = Math.min(1, l / 160), d = Math.sqrt(u) * 12, f = Math.max(0, s + d), p = Math.min(56, f);
|
|
898
974
|
return i?.(!0, 100), n(r, {
|
|
899
975
|
y: f,
|
|
900
976
|
opacity: c
|
|
@@ -911,7 +987,7 @@ var le = (e, t, n) => {
|
|
|
911
987
|
}, { duration: .3 })]), c;
|
|
912
988
|
}
|
|
913
989
|
}
|
|
914
|
-
}),
|
|
990
|
+
}), le = A({
|
|
915
991
|
name: "material",
|
|
916
992
|
initial: { y: "100%" },
|
|
917
993
|
idle: {
|
|
@@ -1019,7 +1095,7 @@ var le = (e, t, n) => {
|
|
|
1019
1095
|
})]), c;
|
|
1020
1096
|
}
|
|
1021
1097
|
}
|
|
1022
|
-
}),
|
|
1098
|
+
}), ue = A({
|
|
1023
1099
|
name: "none",
|
|
1024
1100
|
initial: {},
|
|
1025
1101
|
idle: {
|
|
@@ -1042,20 +1118,20 @@ var le = (e, t, n) => {
|
|
|
1042
1118
|
value: {},
|
|
1043
1119
|
options: { duration: 0 }
|
|
1044
1120
|
}
|
|
1045
|
-
}),
|
|
1046
|
-
["none",
|
|
1047
|
-
["cupertino",
|
|
1048
|
-
["material",
|
|
1049
|
-
["layout",
|
|
1121
|
+
}), M = new Map([
|
|
1122
|
+
["none", ue],
|
|
1123
|
+
["cupertino", se],
|
|
1124
|
+
["material", le],
|
|
1125
|
+
["layout", j]
|
|
1050
1126
|
]);
|
|
1051
1127
|
//#endregion
|
|
1052
1128
|
//#region src/transition/resolveTransition.ts
|
|
1053
|
-
function
|
|
1054
|
-
return
|
|
1129
|
+
function de(e) {
|
|
1130
|
+
return M.get(e) ?? M.get("none");
|
|
1055
1131
|
}
|
|
1056
1132
|
//#endregion
|
|
1057
1133
|
//#region src/transition/decorator/createDecorator.ts
|
|
1058
|
-
function
|
|
1134
|
+
function N({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1059
1135
|
return {
|
|
1060
1136
|
name: e,
|
|
1061
1137
|
initial: t,
|
|
@@ -1076,7 +1152,7 @@ function me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1076
1152
|
}
|
|
1077
1153
|
//#endregion
|
|
1078
1154
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
1079
|
-
function
|
|
1155
|
+
function fe({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1080
1156
|
return {
|
|
1081
1157
|
name: e,
|
|
1082
1158
|
initial: t,
|
|
@@ -1097,30 +1173,30 @@ function he({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1097
1173
|
}
|
|
1098
1174
|
//#endregion
|
|
1099
1175
|
//#region src/transition/decorator/overlay.ts
|
|
1100
|
-
var
|
|
1176
|
+
var P = "rgba(0, 0, 0, 0.3)", pe = N({
|
|
1101
1177
|
name: "overlay",
|
|
1102
1178
|
initial: {
|
|
1103
1179
|
opacity: 0,
|
|
1104
|
-
backgroundColor:
|
|
1180
|
+
backgroundColor: P
|
|
1105
1181
|
},
|
|
1106
1182
|
idle: {
|
|
1107
1183
|
value: {
|
|
1108
1184
|
opacity: 0,
|
|
1109
|
-
backgroundColor:
|
|
1185
|
+
backgroundColor: P
|
|
1110
1186
|
},
|
|
1111
1187
|
options: { duration: 0 }
|
|
1112
1188
|
},
|
|
1113
1189
|
enter: {
|
|
1114
1190
|
value: {
|
|
1115
1191
|
opacity: 1,
|
|
1116
|
-
backgroundColor:
|
|
1192
|
+
backgroundColor: P
|
|
1117
1193
|
},
|
|
1118
1194
|
options: { duration: .7 }
|
|
1119
1195
|
},
|
|
1120
1196
|
exit: {
|
|
1121
1197
|
value: {
|
|
1122
1198
|
opacity: 0,
|
|
1123
|
-
backgroundColor:
|
|
1199
|
+
backgroundColor: P
|
|
1124
1200
|
},
|
|
1125
1201
|
options: { duration: .6 }
|
|
1126
1202
|
},
|
|
@@ -1129,10 +1205,10 @@ var j = "rgba(0, 0, 0, 0.3)", M = me({
|
|
|
1129
1205
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1130
1206
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1131
1207
|
}
|
|
1132
|
-
}),
|
|
1208
|
+
}), F = new Map([["overlay", pe]]);
|
|
1133
1209
|
//#endregion
|
|
1134
1210
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1135
|
-
function
|
|
1211
|
+
function me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1136
1212
|
return {
|
|
1137
1213
|
name: e,
|
|
1138
1214
|
initial: t,
|
|
@@ -1153,7 +1229,7 @@ function ge({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1153
1229
|
}
|
|
1154
1230
|
//#endregion
|
|
1155
1231
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1156
|
-
function
|
|
1232
|
+
function he({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1157
1233
|
return {
|
|
1158
1234
|
name: e,
|
|
1159
1235
|
initial: t,
|
|
@@ -1174,7 +1250,7 @@ function _e({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1174
1250
|
}
|
|
1175
1251
|
//#endregion
|
|
1176
1252
|
//#region src/transition/partTransition/partTransition.ts
|
|
1177
|
-
var
|
|
1253
|
+
var I = /* @__PURE__ */ new Map(), L = {
|
|
1178
1254
|
"IDLE-true": "self",
|
|
1179
1255
|
"IDLE-false": "self",
|
|
1180
1256
|
"PUSHING-true": "initial",
|
|
@@ -1185,7 +1261,7 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1185
1261
|
"POPPING-false": "PUSHING-false",
|
|
1186
1262
|
"COMPLETED-true": "self",
|
|
1187
1263
|
"COMPLETED-false": "self"
|
|
1188
|
-
},
|
|
1264
|
+
}, ge = Object.keys(L), _e = ge, ve = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), ye = (e) => typeof e == "object" && !!e && !Array.isArray(e), be = new Set(/* @__PURE__ */ "opacity.scale.scaleX.scaleY.scaleZ.aspectRatio.columnCount.columns.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineHeight.lineClamp.order.orphans.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeWidth".split(".")), xe = (e, t) => t.startsWith("--") || be.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Se = (e, t) => typeof t == "number" ? xe(t, e) : typeof t == "string" ? t : "", Ce = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), we = new Set([
|
|
1189
1265
|
"x",
|
|
1190
1266
|
"y",
|
|
1191
1267
|
"z",
|
|
@@ -1196,7 +1272,7 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1196
1272
|
"rotateX",
|
|
1197
1273
|
"rotateY",
|
|
1198
1274
|
"rotateZ"
|
|
1199
|
-
]),
|
|
1275
|
+
]), Te = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, Ee = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, De = /^1(\.0+)?$/, Oe = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? De.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? Ee.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? Te.test(t.trim()) : !1, ke = (e, t) => {
|
|
1200
1276
|
switch (e) {
|
|
1201
1277
|
case "x": return `translateX(${t})`;
|
|
1202
1278
|
case "y": return `translateY(${t})`;
|
|
@@ -1210,23 +1286,23 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1210
1286
|
case "rotateY": return `rotateY(${t})`;
|
|
1211
1287
|
default: return "";
|
|
1212
1288
|
}
|
|
1213
|
-
},
|
|
1289
|
+
}, Ae = (e) => {
|
|
1214
1290
|
let t = /* @__PURE__ */ new Set(), n = !1, r = (e) => {
|
|
1215
|
-
if (
|
|
1291
|
+
if (ye(e)) for (let r of Object.keys(e)) {
|
|
1216
1292
|
let i = e[r];
|
|
1217
|
-
|
|
1293
|
+
Se(r, i) !== "" && (we.has(r) ? n = !0 : t.add(Ce(r)));
|
|
1218
1294
|
}
|
|
1219
1295
|
};
|
|
1220
1296
|
r(e.initial);
|
|
1221
1297
|
for (let t of Object.values(e.variants)) r(t.value);
|
|
1222
1298
|
return n && t.add("transform"), Array.from(t);
|
|
1223
|
-
},
|
|
1224
|
-
if (!
|
|
1299
|
+
}, R = (e) => {
|
|
1300
|
+
if (!ye(e)) return [];
|
|
1225
1301
|
let t = [], n = !0, r = [];
|
|
1226
1302
|
for (let i of Object.keys(e)) {
|
|
1227
|
-
let a = e[i], o =
|
|
1228
|
-
o !== "" && (
|
|
1229
|
-
property:
|
|
1303
|
+
let a = e[i], o = Se(i, a);
|
|
1304
|
+
o !== "" && (we.has(i) ? (t.push(ke(i, o)), Oe(i, a) || (n = !1)) : r.push({
|
|
1305
|
+
property: Ce(i),
|
|
1230
1306
|
value: o
|
|
1231
1307
|
}));
|
|
1232
1308
|
}
|
|
@@ -1234,7 +1310,7 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1234
1310
|
property: "transform",
|
|
1235
1311
|
value: n ? "none" : t.join(" ")
|
|
1236
1312
|
}), r;
|
|
1237
|
-
},
|
|
1313
|
+
}, z = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), B = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1238
1314
|
linear: "linear",
|
|
1239
1315
|
easeIn: "ease-in",
|
|
1240
1316
|
easeOut: "ease-out",
|
|
@@ -1244,11 +1320,11 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1244
1320
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1245
1321
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1246
1322
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1247
|
-
}[e] ?? "ease" : "ease",
|
|
1323
|
+
}[e] ?? "ease" : "ease", V = (e) => {
|
|
1248
1324
|
if (!e) return 0;
|
|
1249
1325
|
let t = e.duration;
|
|
1250
1326
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1251
|
-
},
|
|
1327
|
+
}, je = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Me = (e, t) => {
|
|
1252
1328
|
let [n, r] = t.split("-");
|
|
1253
1329
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1254
1330
|
}, Ne = (e, t) => {
|
|
@@ -1260,17 +1336,17 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1260
1336
|
}, Fe = (e, t) => {
|
|
1261
1337
|
let [n, r] = t.split("-");
|
|
1262
1338
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1263
|
-
}, H = (e, t, n) => `flemo-${e}-${
|
|
1264
|
-
let o =
|
|
1339
|
+
}, H = (e, t, n) => `flemo-${e}-${ve(t)}-${n}`, U = (e, t, n, r, i, a) => {
|
|
1340
|
+
let o = R(r), s = R(i.value), c = V(i.options), l = je(i.options), u = B(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Pe(t, n)}` : d;
|
|
1265
1341
|
if (s.length === 0 && o.length === 0) return "";
|
|
1266
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1342
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${z(s)}\n animation: none;\n}`;
|
|
1267
1343
|
let p = H(e, t, n), m = [
|
|
1268
1344
|
`@keyframes ${p} {`,
|
|
1269
1345
|
" from {",
|
|
1270
|
-
|
|
1346
|
+
z(o).replace(/^/gm, " "),
|
|
1271
1347
|
" }",
|
|
1272
1348
|
" to {",
|
|
1273
|
-
|
|
1349
|
+
z(s).replace(/^/gm, " "),
|
|
1274
1350
|
" }",
|
|
1275
1351
|
"}"
|
|
1276
1352
|
].join("\n"), h = [
|
|
@@ -1280,33 +1356,33 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1280
1356
|
l > 0 ? `${l}s` : null,
|
|
1281
1357
|
"both"
|
|
1282
1358
|
].filter(Boolean).join(" "), g = Array.from(new Set([...o.map((e) => e.property), ...s.map((e) => e.property)])), _ = g.length > 0 ? ` will-change: ${g.join(", ")};\n` : "", v = n.split("-")[0];
|
|
1283
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${_}${v === "PUSHING" || v === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Ie(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${
|
|
1359
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${_}${v === "PUSHING" || v === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Ie(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${z(s)}\n}` : ""}`;
|
|
1284
1360
|
}, Ie = (e) => {
|
|
1285
1361
|
if (!e) return !1;
|
|
1286
1362
|
if (e.opacity === 0) return !0;
|
|
1287
1363
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1288
1364
|
return t(e.x) || t(e.y);
|
|
1289
1365
|
}, W = (e, t, n, r) => {
|
|
1290
|
-
let i =
|
|
1291
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1366
|
+
let i = R(r.value);
|
|
1367
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${z(i)}\n}`;
|
|
1292
1368
|
}, Le = (e, t, n = []) => {
|
|
1293
1369
|
let r = [];
|
|
1294
1370
|
for (let t of e) {
|
|
1295
1371
|
let e = t.name;
|
|
1296
|
-
for (let n of
|
|
1297
|
-
let i = t.variants[n], a =
|
|
1372
|
+
for (let n of ge) {
|
|
1373
|
+
let i = t.variants[n], a = L[n];
|
|
1298
1374
|
if (a === "self") {
|
|
1299
|
-
r.push(W(
|
|
1375
|
+
r.push(W(Me, e, n, i));
|
|
1300
1376
|
continue;
|
|
1301
1377
|
}
|
|
1302
1378
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1303
|
-
r.push(U("screen", e, n, o, i,
|
|
1379
|
+
r.push(U("screen", e, n, o, i, Me));
|
|
1304
1380
|
}
|
|
1305
1381
|
}
|
|
1306
1382
|
for (let e of t) {
|
|
1307
1383
|
let t = e.name;
|
|
1308
|
-
for (let n of
|
|
1309
|
-
let i = e.variants[n], a =
|
|
1384
|
+
for (let n of _e) {
|
|
1385
|
+
let i = e.variants[n], a = L[n];
|
|
1310
1386
|
if (a === "self") {
|
|
1311
1387
|
r.push(W(Ne, t, n, i));
|
|
1312
1388
|
continue;
|
|
@@ -1317,8 +1393,8 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1317
1393
|
}
|
|
1318
1394
|
for (let e of n) {
|
|
1319
1395
|
let t = e.name;
|
|
1320
|
-
for (let n of
|
|
1321
|
-
let i = e.variants[n], a =
|
|
1396
|
+
for (let n of _e) {
|
|
1397
|
+
let i = e.variants[n], a = L[n];
|
|
1322
1398
|
if (a === "self") {
|
|
1323
1399
|
r.push(W(Fe, t, n, i));
|
|
1324
1400
|
continue;
|
|
@@ -1336,28 +1412,28 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1336
1412
|
" animation-play-state: paused !important;",
|
|
1337
1413
|
"}"
|
|
1338
1414
|
].join("\n"), ze = (e, t) => {
|
|
1339
|
-
let n =
|
|
1415
|
+
let n = L[t];
|
|
1340
1416
|
if (n === "self") return !1;
|
|
1341
|
-
let r = e.variants[t], i =
|
|
1417
|
+
let r = e.variants[t], i = V(r.options), a = je(r.options);
|
|
1342
1418
|
if (i <= 0 && a <= 0) return !1;
|
|
1343
|
-
let o =
|
|
1419
|
+
let o = R(n === "initial" ? e.initial : e.variants[n].value), s = R(r.value);
|
|
1344
1420
|
return o.length > 0 || s.length > 0;
|
|
1345
1421
|
}, Be = "data-flemo";
|
|
1346
1422
|
function G() {
|
|
1347
1423
|
if (u()) return;
|
|
1348
|
-
let e = Le(
|
|
1424
|
+
let e = Le(M.values(), F.values(), I.values()), t = document.head.querySelector(`style[${Be}]`);
|
|
1349
1425
|
t || (t = document.createElement("style"), t.setAttribute(Be, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1350
1426
|
}
|
|
1351
1427
|
//#endregion
|
|
1352
1428
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1353
1429
|
function Ve(e, t, n = []) {
|
|
1354
|
-
for (let t of e)
|
|
1355
|
-
for (let e of t)
|
|
1356
|
-
for (let e of n)
|
|
1430
|
+
for (let t of e) M.set(t.name, t);
|
|
1431
|
+
for (let e of t) F.set(e.name, e);
|
|
1432
|
+
for (let e of n) I.set(e.name, e);
|
|
1357
1433
|
return G(), () => {
|
|
1358
|
-
for (let t of e)
|
|
1359
|
-
for (let e of t)
|
|
1360
|
-
for (let e of n)
|
|
1434
|
+
for (let t of e) M.delete(t.name);
|
|
1435
|
+
for (let e of t) F.delete(e.name);
|
|
1436
|
+
for (let e of n) I.delete(e.name);
|
|
1361
1437
|
G();
|
|
1362
1438
|
};
|
|
1363
1439
|
}
|
|
@@ -1389,9 +1465,9 @@ var Ue = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, K = /* @__
|
|
|
1389
1465
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1390
1466
|
}, J = (e, t, n = {}) => {
|
|
1391
1467
|
if (!Ue(e)) return Promise.resolve();
|
|
1392
|
-
let r = e, i =
|
|
1468
|
+
let r = e, i = R(t);
|
|
1393
1469
|
if (i.length === 0) return Promise.resolve();
|
|
1394
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1470
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = B(n.ease);
|
|
1395
1471
|
if (a <= 0 && o <= 0) {
|
|
1396
1472
|
r.style.transition = "none";
|
|
1397
1473
|
for (let e of i) r.style.setProperty(e.property, e.value), We(r, e.property);
|
|
@@ -1426,7 +1502,7 @@ function Ge(e) {
|
|
|
1426
1502
|
let l = () => {
|
|
1427
1503
|
let t = e.getTransitionTaskId();
|
|
1428
1504
|
t && a.resolveTask(t);
|
|
1429
|
-
}, u =
|
|
1505
|
+
}, u = de(r), d = `${o}-true`;
|
|
1430
1506
|
if (!(c.getAttribute("data-flemo-skip-animation") !== "true" && ze(u, d))) return queueMicrotask(l), X;
|
|
1431
1507
|
let f = H("screen", r, d), p = (e) => {
|
|
1432
1508
|
e.target === c && e.animationName === f && (c.removeEventListener("animationend", p), l());
|
|
@@ -1543,7 +1619,7 @@ function Je(e) {
|
|
|
1543
1619
|
current: i,
|
|
1544
1620
|
prev: s
|
|
1545
1621
|
};
|
|
1546
|
-
let c =
|
|
1622
|
+
let c = Ae(e.getTransition()).join(", ");
|
|
1547
1623
|
for (let e of i) e.style.willChange = c;
|
|
1548
1624
|
for (let e of s) e.style.willChange = c;
|
|
1549
1625
|
}, b = () => {
|
|
@@ -1561,7 +1637,7 @@ function Je(e) {
|
|
|
1561
1637
|
};
|
|
1562
1638
|
}, S = (e, t, n) => {
|
|
1563
1639
|
let r = (r, i) => {
|
|
1564
|
-
let a =
|
|
1640
|
+
let a = I.get(r.getAttribute("data-flemo-part-name"));
|
|
1565
1641
|
if (!a) return;
|
|
1566
1642
|
let o = {
|
|
1567
1643
|
animate: J,
|
|
@@ -1608,7 +1684,7 @@ function Je(e) {
|
|
|
1608
1684
|
}), S("start", e, 0);
|
|
1609
1685
|
}
|
|
1610
1686
|
}) ? e.setDragStatus("PENDING") : (e.setDragStatus("IDLE"), s = !1, b());
|
|
1611
|
-
},
|
|
1687
|
+
}, T = (r) => {
|
|
1612
1688
|
let i = e.getTransition();
|
|
1613
1689
|
if (!i.swipeDirection || !s || e.getViewportScrollHeight() > 10) return;
|
|
1614
1690
|
_(r);
|
|
@@ -1625,7 +1701,7 @@ function Je(e) {
|
|
|
1625
1701
|
}), S("swipe", e, t);
|
|
1626
1702
|
}
|
|
1627
1703
|
});
|
|
1628
|
-
},
|
|
1704
|
+
}, E = async (a) => {
|
|
1629
1705
|
let o = e.getTransition();
|
|
1630
1706
|
if (!o.swipeDirection || !s) return;
|
|
1631
1707
|
s = !1;
|
|
@@ -1671,7 +1747,7 @@ function Je(e) {
|
|
|
1671
1747
|
pointerMove: (t) => {
|
|
1672
1748
|
if (e.getViewportScrollHeight() > 10) return;
|
|
1673
1749
|
if (s) {
|
|
1674
|
-
|
|
1750
|
+
T(t);
|
|
1675
1751
|
return;
|
|
1676
1752
|
}
|
|
1677
1753
|
let n = e.getTransition().swipeDirection, r = !f.element && !p.element;
|
|
@@ -1685,7 +1761,7 @@ function Je(e) {
|
|
|
1685
1761
|
}
|
|
1686
1762
|
},
|
|
1687
1763
|
pointerUp: (e) => {
|
|
1688
|
-
a = !1, o = !1, s &&
|
|
1764
|
+
a = !1, o = !1, s && E(e);
|
|
1689
1765
|
},
|
|
1690
1766
|
shouldPreventTouch: () => o
|
|
1691
1767
|
};
|
|
@@ -1791,4 +1867,4 @@ function st(e, n) {
|
|
|
1791
1867
|
};
|
|
1792
1868
|
}
|
|
1793
1869
|
//#endregion
|
|
1794
|
-
export { Ze as ANIM_HOLD_RELEASE_BACKSTOP_MS, Y as SKIP_ANIMATION_ATTR, a as TaskManger, Xe as animHoldKey, J as animateInline, H as animationName,
|
|
1870
|
+
export { Ze as ANIM_HOLD_RELEASE_BACKSTOP_MS, Y as SKIP_ANIMATION_ATTR, a as TaskManger, Xe as animHoldKey, J as animateInline, H as animationName, E as appendParamsQuery, G as applyTransitionStyles, st as buildRoutePath, $ as canProgrammaticallyScroll, q as clearInlineAnimation, Ae as collectAnimatedProperties, Le as compileTransitionStyles, Ye as computeBarRiding, ie as computeScreenFreeze, _ as consumeSelfInducedPop, p as createBrowserHistoryDriver, N as createDecorator, o as createHistoryStore, v as createHistorySync, y as createMemoryHistoryDriver, b as createNavigateStore, w as createNavigationController, me as createPartTransition, fe as createRawDecorator, he as createRawPartTransition, ae as createRawTransition, ne as createRouterScope, re as createScreenSelector, k as createScreenStore, m as createSelfPopGuard, D as createStepController, Je as createSwipeController, A as createTransition, Ge as createTransitionEngine, ee as createTransitionStore, se as cupertino, F as decoratorMap, et as eagerlyDecodeImages, B as easingToCss, d as ensureWindowHistoryState, He as enteringInitialStyle, Z as findScrollable, s as getMatchedPathPattern, c as getParams, ot as isOpaqueColor, u as isServer, j as layout, g as markSelfInducedPop, at as matchesPathname, le as material, ue as none, nt as observeBarHeight, it as observeViewportScrollHeight, Q as overflowsAxis, pe as overlay, I as partTransitionMap, T as readStepParams, Ve as registerTransitionDefinitions, de as resolveTransition, tt as scheduleAnimHoldRelease, l as seedInitialHistory, O as subscribeStepParamsRestore, R as targetToDecls, M as transitionMap, ze as variantHasAnimation };
|
package/package.json
CHANGED