@flemo/core 1.10.1 → 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;
|
|
@@ -17,6 +18,7 @@ export interface HistoryStore {
|
|
|
17
18
|
popHistories: (count: number) => void;
|
|
18
19
|
setPendingIndex: (index: number) => void;
|
|
19
20
|
adoptHistory: (history: History) => void;
|
|
21
|
+
truncateHistory: (position: number) => void;
|
|
20
22
|
setTransitionName: (index: number, transitionName: TransitionName) => void;
|
|
21
23
|
}
|
|
22
24
|
export type HistoryStoreApi = StoreApi<HistoryStore>;
|
package/dist/index.mjs
CHANGED
|
@@ -207,6 +207,11 @@ function o(t = [], n = -1) {
|
|
|
207
207
|
},
|
|
208
208
|
setPendingIndex: (t) => e({ pendingIndex: t }),
|
|
209
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
|
+
})),
|
|
210
215
|
setTransitionName: (t, n) => e((e) => {
|
|
211
216
|
let r = e.histories[t];
|
|
212
217
|
if (!r || r.transitionName === n) return {};
|
|
@@ -333,40 +338,50 @@ function _() {
|
|
|
333
338
|
function v(e) {
|
|
334
339
|
let { stores: t, driver: n = p(), consume: r = _ } = e, i = !1, o = n.subscribe(async (e) => {
|
|
335
340
|
if (i || r()) return;
|
|
336
|
-
let
|
|
341
|
+
let o = e.state, s = a.generateTaskId();
|
|
337
342
|
(await a.addTask(async (r) => {
|
|
338
343
|
if (i) {
|
|
339
344
|
r.abort();
|
|
340
345
|
return;
|
|
341
346
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
347
|
+
if (n.readState()?.id !== e.state?.id) {
|
|
348
|
+
r.abort();
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
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();
|
|
352
359
|
return;
|
|
353
360
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
+
};
|
|
364
378
|
}
|
|
365
|
-
|
|
366
|
-
|
|
379
|
+
let _ = l - h - 1;
|
|
380
|
+
return c(s), _ > 0 && p(_), m(h), a("POPPING"), async () => {
|
|
381
|
+
f(h + 1), a("COMPLETED");
|
|
367
382
|
};
|
|
368
383
|
}, {
|
|
369
|
-
id:
|
|
384
|
+
id: s,
|
|
370
385
|
control: { manual: !0 }
|
|
371
386
|
})).result?.();
|
|
372
387
|
});
|
|
@@ -441,138 +456,181 @@ var x = (e, t, n) => {
|
|
|
441
456
|
i(), s && r();
|
|
442
457
|
};
|
|
443
458
|
function w(e) {
|
|
444
|
-
let { stores: t, buildPathname: n, driver: r = p(), markSelfInduced: i = g } = e, o =
|
|
445
|
-
let
|
|
446
|
-
if (
|
|
447
|
-
let
|
|
448
|
-
(
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
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);
|
|
452
485
|
return e < 0 ? 0 : e;
|
|
453
486
|
}
|
|
454
|
-
return Math.min(S(
|
|
455
|
-
})(), { setStatus:
|
|
456
|
-
|
|
457
|
-
let { pathname:
|
|
458
|
-
id:
|
|
459
|
-
pathname:
|
|
460
|
-
params:
|
|
461
|
-
transitionName:
|
|
462
|
-
layoutId:
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
id:
|
|
466
|
-
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,
|
|
467
500
|
status: "PUSHING",
|
|
468
|
-
params:
|
|
469
|
-
transitionName:
|
|
470
|
-
layoutId:
|
|
471
|
-
},
|
|
472
|
-
|
|
473
|
-
|
|
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, _, () => {
|
|
474
515
|
r.pushState({
|
|
475
|
-
id:
|
|
476
|
-
index:
|
|
516
|
+
id: p,
|
|
517
|
+
index: D + 1,
|
|
477
518
|
status: "PUSHING",
|
|
478
|
-
params:
|
|
479
|
-
transitionName:
|
|
480
|
-
layoutId:
|
|
481
|
-
},
|
|
519
|
+
params: s,
|
|
520
|
+
transitionName: d,
|
|
521
|
+
layoutId: f
|
|
522
|
+
}, b);
|
|
482
523
|
}), async () => {
|
|
483
|
-
|
|
484
|
-
}
|
|
524
|
+
g(_), v("COMPLETED");
|
|
525
|
+
};
|
|
485
526
|
}, {
|
|
486
|
-
id:
|
|
527
|
+
id: p,
|
|
487
528
|
control: { manual: !0 }
|
|
488
529
|
})).result?.();
|
|
489
|
-
},
|
|
490
|
-
let { status:
|
|
491
|
-
if (
|
|
492
|
-
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();
|
|
493
534
|
(await a.addTask(async (a) => {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
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);
|
|
497
542
|
return e < 0 ? 0 : e + 1;
|
|
498
543
|
}
|
|
499
|
-
return Math.min(S(
|
|
544
|
+
return Math.min(S(c?.skip, 0) + 1, u + 1);
|
|
500
545
|
})();
|
|
501
|
-
if (
|
|
546
|
+
if (v <= 0) {
|
|
502
547
|
a.abort();
|
|
503
548
|
return;
|
|
504
549
|
}
|
|
505
|
-
let { setStatus:
|
|
506
|
-
|
|
507
|
-
let { pathname:
|
|
508
|
-
id:
|
|
509
|
-
pathname:
|
|
510
|
-
params:
|
|
511
|
-
transitionName:
|
|
512
|
-
layoutId:
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
id:
|
|
516
|
-
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,
|
|
517
562
|
status: "REPLACING",
|
|
518
|
-
params:
|
|
519
|
-
transitionName:
|
|
520
|
-
layoutId:
|
|
521
|
-
},
|
|
522
|
-
|
|
523
|
-
|
|
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, () => {
|
|
524
577
|
r.pushState({
|
|
525
|
-
id:
|
|
526
|
-
index:
|
|
578
|
+
id: p,
|
|
579
|
+
index: O,
|
|
527
580
|
status: "REPLACING",
|
|
528
|
-
params:
|
|
529
|
-
transitionName:
|
|
530
|
-
layoutId:
|
|
531
|
-
},
|
|
532
|
-
}) : await C(r, i,
|
|
581
|
+
params: s,
|
|
582
|
+
transitionName: d,
|
|
583
|
+
layoutId: f
|
|
584
|
+
}, w);
|
|
585
|
+
}) : await C(r, i, u, () => {
|
|
533
586
|
r.replaceState({
|
|
534
|
-
id:
|
|
535
|
-
index:
|
|
587
|
+
id: p,
|
|
588
|
+
index: O,
|
|
536
589
|
status: "REPLACING",
|
|
537
|
-
params:
|
|
538
|
-
transitionName:
|
|
539
|
-
layoutId:
|
|
540
|
-
},
|
|
590
|
+
params: s,
|
|
591
|
+
transitionName: d,
|
|
592
|
+
layoutId: f
|
|
593
|
+
}, w);
|
|
541
594
|
}), async () => {
|
|
542
|
-
|
|
543
|
-
}
|
|
595
|
+
g(t.history.getState().index - 1), y("COMPLETED");
|
|
596
|
+
};
|
|
544
597
|
}, {
|
|
545
|
-
id:
|
|
598
|
+
id: p,
|
|
546
599
|
control: { manual: !0 }
|
|
547
600
|
})).result?.();
|
|
548
|
-
},
|
|
549
|
-
let
|
|
601
|
+
}, l = async (e, n) => {
|
|
602
|
+
let s = a.generateTaskId();
|
|
550
603
|
(await a.addTask(async (a) => {
|
|
551
|
-
|
|
552
|
-
|
|
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) {
|
|
553
611
|
a.abort();
|
|
554
612
|
return;
|
|
555
613
|
}
|
|
556
|
-
let
|
|
557
|
-
if (
|
|
614
|
+
let m = Math.min(e(c, l), c);
|
|
615
|
+
if (m <= 0) {
|
|
558
616
|
a.abort();
|
|
559
617
|
return;
|
|
560
618
|
}
|
|
561
|
-
|
|
562
|
-
let { setStatus:
|
|
563
|
-
return n &&
|
|
564
|
-
|
|
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");
|
|
565
623
|
};
|
|
566
624
|
}, {
|
|
567
|
-
id:
|
|
625
|
+
id: s,
|
|
568
626
|
control: { manual: !0 }
|
|
569
627
|
})).result?.();
|
|
570
628
|
};
|
|
571
629
|
return {
|
|
572
|
-
push:
|
|
573
|
-
replace:
|
|
630
|
+
push: s,
|
|
631
|
+
replace: c,
|
|
574
632
|
pop: async (e) => {
|
|
575
|
-
await
|
|
633
|
+
await l((t, n) => {
|
|
576
634
|
if (e?.until != null) {
|
|
577
635
|
let r = x(e.until, t, n);
|
|
578
636
|
return r < 0 ? 0 : r;
|
|
@@ -585,14 +643,14 @@ function w(e) {
|
|
|
585
643
|
}
|
|
586
644
|
//#endregion
|
|
587
645
|
//#region src/navigate/createStepController.ts
|
|
588
|
-
var
|
|
646
|
+
var T = (e) => {
|
|
589
647
|
let t = e;
|
|
590
648
|
return t?.step ? t.params ?? {} : null;
|
|
591
|
-
},
|
|
649
|
+
}, E = (e, t) => {
|
|
592
650
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
593
651
|
return n ? `${e}?${n}` : e;
|
|
594
652
|
};
|
|
595
|
-
function
|
|
653
|
+
function D(e) {
|
|
596
654
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
597
655
|
return {
|
|
598
656
|
pushStep: async (e) => {
|
|
@@ -647,7 +705,7 @@ function ne(e) {
|
|
|
647
705
|
}
|
|
648
706
|
};
|
|
649
707
|
}
|
|
650
|
-
function
|
|
708
|
+
function O(e, t) {
|
|
651
709
|
return e.subscribe((e) => {
|
|
652
710
|
let n = e.state;
|
|
653
711
|
n?.step && a.addTask(async () => {
|
|
@@ -657,7 +715,7 @@ function re(e, t) {
|
|
|
657
715
|
}
|
|
658
716
|
//#endregion
|
|
659
717
|
//#region src/transition/store.ts
|
|
660
|
-
function
|
|
718
|
+
function ee(t = "cupertino") {
|
|
661
719
|
return e((e) => ({
|
|
662
720
|
defaultTransitionName: t,
|
|
663
721
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -665,7 +723,7 @@ function T(t = "cupertino") {
|
|
|
665
723
|
}
|
|
666
724
|
//#endregion
|
|
667
725
|
//#region src/screen/store.ts
|
|
668
|
-
function
|
|
726
|
+
function k() {
|
|
669
727
|
return e((e) => ({
|
|
670
728
|
dragStatus: "IDLE",
|
|
671
729
|
replaceTransitionStatus: "IDLE",
|
|
@@ -696,40 +754,44 @@ function E() {
|
|
|
696
754
|
}
|
|
697
755
|
//#endregion
|
|
698
756
|
//#region src/core/createRouterScope.ts
|
|
699
|
-
var
|
|
757
|
+
var te = {
|
|
700
758
|
mark: () => {},
|
|
701
759
|
consume: () => !1
|
|
702
760
|
};
|
|
703
|
-
function
|
|
704
|
-
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: s } = e, c = l(t, n, r, i)
|
|
705
|
-
|
|
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({
|
|
706
767
|
index: 0,
|
|
707
|
-
histories: [
|
|
768
|
+
histories: [f]
|
|
708
769
|
}), e.hostedScope;
|
|
709
|
-
let
|
|
770
|
+
let p = a ? y({
|
|
710
771
|
state: {
|
|
711
|
-
id:
|
|
772
|
+
id: f.id,
|
|
712
773
|
index: 0,
|
|
713
774
|
status: "IDLE",
|
|
714
|
-
params:
|
|
715
|
-
transitionName:
|
|
716
|
-
layoutId:
|
|
775
|
+
params: f.params,
|
|
776
|
+
transitionName: f.transitionName,
|
|
777
|
+
layoutId: f.layoutId
|
|
717
778
|
},
|
|
718
|
-
url:
|
|
719
|
-
}) : s,
|
|
779
|
+
url: f.pathname
|
|
780
|
+
}) : s, h = a ? te : m();
|
|
720
781
|
return {
|
|
721
|
-
history: o([
|
|
782
|
+
history: o([f], 0),
|
|
722
783
|
navigate: b(),
|
|
723
|
-
transition:
|
|
724
|
-
screen:
|
|
725
|
-
driver:
|
|
726
|
-
markSelfInduced:
|
|
727
|
-
consume:
|
|
784
|
+
transition: ee(i),
|
|
785
|
+
screen: k(),
|
|
786
|
+
driver: p,
|
|
787
|
+
markSelfInduced: h.mark,
|
|
788
|
+
consume: h.consume,
|
|
789
|
+
life: { alive: !0 }
|
|
728
790
|
};
|
|
729
791
|
}
|
|
730
792
|
//#endregion
|
|
731
793
|
//#region src/screen/createScreenSelector.ts
|
|
732
|
-
function
|
|
794
|
+
function re(e, t) {
|
|
733
795
|
return e.map((n, r) => ({
|
|
734
796
|
...n,
|
|
735
797
|
isActive: r === t,
|
|
@@ -742,13 +804,13 @@ function oe(e, t) {
|
|
|
742
804
|
}
|
|
743
805
|
//#endregion
|
|
744
806
|
//#region src/screen/computeScreenFreeze.ts
|
|
745
|
-
function
|
|
807
|
+
function ie(e) {
|
|
746
808
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
747
809
|
return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
|
|
748
810
|
}
|
|
749
811
|
//#endregion
|
|
750
812
|
//#region src/transition/createTransition.ts
|
|
751
|
-
function
|
|
813
|
+
function A({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
752
814
|
return {
|
|
753
815
|
name: e,
|
|
754
816
|
initial: t,
|
|
@@ -769,7 +831,7 @@ function D({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
769
831
|
}
|
|
770
832
|
//#endregion
|
|
771
833
|
//#region src/transition/createRawTransition.ts
|
|
772
|
-
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 }) {
|
|
773
835
|
return {
|
|
774
836
|
name: e,
|
|
775
837
|
initial: t,
|
|
@@ -790,10 +852,10 @@ function ce({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
790
852
|
}
|
|
791
853
|
//#endregion
|
|
792
854
|
//#region src/transition/cupertino.ts
|
|
793
|
-
var
|
|
855
|
+
var oe = (e, t, n) => {
|
|
794
856
|
let [r, i] = t, [a, o] = n;
|
|
795
857
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
796
|
-
},
|
|
858
|
+
}, se = A({
|
|
797
859
|
name: "cupertino",
|
|
798
860
|
initial: { x: "100%" },
|
|
799
861
|
idle: {
|
|
@@ -853,7 +915,7 @@ var le = (e, t, n) => {
|
|
|
853
915
|
swipeDirection: "x",
|
|
854
916
|
onSwipeStart: async () => !0,
|
|
855
917
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
856
|
-
let { offset: o } = t, s = o.x, c =
|
|
918
|
+
let { offset: o } = t, s = o.x, c = oe(s, [0, window.innerWidth], [0, 100]);
|
|
857
919
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + c * .3}%` }, { duration: 0 }), c;
|
|
858
920
|
},
|
|
859
921
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -877,10 +939,10 @@ var le = (e, t, n) => {
|
|
|
877
939
|
})]), c;
|
|
878
940
|
}
|
|
879
941
|
}
|
|
880
|
-
}),
|
|
942
|
+
}), ce = (e, t, n) => {
|
|
881
943
|
let [r, i] = t, [a, o] = n;
|
|
882
944
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
883
|
-
},
|
|
945
|
+
}, j = A({
|
|
884
946
|
name: "layout",
|
|
885
947
|
initial: { opacity: .97 },
|
|
886
948
|
idle: {
|
|
@@ -908,7 +970,7 @@ var le = (e, t, n) => {
|
|
|
908
970
|
swipeDirection: "y",
|
|
909
971
|
onSwipeStart: async () => !0,
|
|
910
972
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
911
|
-
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);
|
|
912
974
|
return i?.(!0, 100), n(r, {
|
|
913
975
|
y: f,
|
|
914
976
|
opacity: c
|
|
@@ -925,7 +987,7 @@ var le = (e, t, n) => {
|
|
|
925
987
|
}, { duration: .3 })]), c;
|
|
926
988
|
}
|
|
927
989
|
}
|
|
928
|
-
}),
|
|
990
|
+
}), le = A({
|
|
929
991
|
name: "material",
|
|
930
992
|
initial: { y: "100%" },
|
|
931
993
|
idle: {
|
|
@@ -1033,7 +1095,7 @@ var le = (e, t, n) => {
|
|
|
1033
1095
|
})]), c;
|
|
1034
1096
|
}
|
|
1035
1097
|
}
|
|
1036
|
-
}),
|
|
1098
|
+
}), ue = A({
|
|
1037
1099
|
name: "none",
|
|
1038
1100
|
initial: {},
|
|
1039
1101
|
idle: {
|
|
@@ -1056,20 +1118,20 @@ var le = (e, t, n) => {
|
|
|
1056
1118
|
value: {},
|
|
1057
1119
|
options: { duration: 0 }
|
|
1058
1120
|
}
|
|
1059
|
-
}),
|
|
1060
|
-
["none",
|
|
1061
|
-
["cupertino",
|
|
1062
|
-
["material",
|
|
1063
|
-
["layout",
|
|
1121
|
+
}), M = new Map([
|
|
1122
|
+
["none", ue],
|
|
1123
|
+
["cupertino", se],
|
|
1124
|
+
["material", le],
|
|
1125
|
+
["layout", j]
|
|
1064
1126
|
]);
|
|
1065
1127
|
//#endregion
|
|
1066
1128
|
//#region src/transition/resolveTransition.ts
|
|
1067
|
-
function
|
|
1068
|
-
return
|
|
1129
|
+
function de(e) {
|
|
1130
|
+
return M.get(e) ?? M.get("none");
|
|
1069
1131
|
}
|
|
1070
1132
|
//#endregion
|
|
1071
1133
|
//#region src/transition/decorator/createDecorator.ts
|
|
1072
|
-
function
|
|
1134
|
+
function N({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1073
1135
|
return {
|
|
1074
1136
|
name: e,
|
|
1075
1137
|
initial: t,
|
|
@@ -1090,7 +1152,7 @@ function me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1090
1152
|
}
|
|
1091
1153
|
//#endregion
|
|
1092
1154
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
1093
|
-
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 }) {
|
|
1094
1156
|
return {
|
|
1095
1157
|
name: e,
|
|
1096
1158
|
initial: t,
|
|
@@ -1111,30 +1173,30 @@ function he({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1111
1173
|
}
|
|
1112
1174
|
//#endregion
|
|
1113
1175
|
//#region src/transition/decorator/overlay.ts
|
|
1114
|
-
var
|
|
1176
|
+
var P = "rgba(0, 0, 0, 0.3)", pe = N({
|
|
1115
1177
|
name: "overlay",
|
|
1116
1178
|
initial: {
|
|
1117
1179
|
opacity: 0,
|
|
1118
|
-
backgroundColor:
|
|
1180
|
+
backgroundColor: P
|
|
1119
1181
|
},
|
|
1120
1182
|
idle: {
|
|
1121
1183
|
value: {
|
|
1122
1184
|
opacity: 0,
|
|
1123
|
-
backgroundColor:
|
|
1185
|
+
backgroundColor: P
|
|
1124
1186
|
},
|
|
1125
1187
|
options: { duration: 0 }
|
|
1126
1188
|
},
|
|
1127
1189
|
enter: {
|
|
1128
1190
|
value: {
|
|
1129
1191
|
opacity: 1,
|
|
1130
|
-
backgroundColor:
|
|
1192
|
+
backgroundColor: P
|
|
1131
1193
|
},
|
|
1132
1194
|
options: { duration: .7 }
|
|
1133
1195
|
},
|
|
1134
1196
|
exit: {
|
|
1135
1197
|
value: {
|
|
1136
1198
|
opacity: 0,
|
|
1137
|
-
backgroundColor:
|
|
1199
|
+
backgroundColor: P
|
|
1138
1200
|
},
|
|
1139
1201
|
options: { duration: .6 }
|
|
1140
1202
|
},
|
|
@@ -1143,10 +1205,10 @@ var j = "rgba(0, 0, 0, 0.3)", M = me({
|
|
|
1143
1205
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1144
1206
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1145
1207
|
}
|
|
1146
|
-
}),
|
|
1208
|
+
}), F = new Map([["overlay", pe]]);
|
|
1147
1209
|
//#endregion
|
|
1148
1210
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1149
|
-
function
|
|
1211
|
+
function me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1150
1212
|
return {
|
|
1151
1213
|
name: e,
|
|
1152
1214
|
initial: t,
|
|
@@ -1167,7 +1229,7 @@ function ge({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1167
1229
|
}
|
|
1168
1230
|
//#endregion
|
|
1169
1231
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1170
|
-
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 }) {
|
|
1171
1233
|
return {
|
|
1172
1234
|
name: e,
|
|
1173
1235
|
initial: t,
|
|
@@ -1188,7 +1250,7 @@ function _e({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1188
1250
|
}
|
|
1189
1251
|
//#endregion
|
|
1190
1252
|
//#region src/transition/partTransition/partTransition.ts
|
|
1191
|
-
var
|
|
1253
|
+
var I = /* @__PURE__ */ new Map(), L = {
|
|
1192
1254
|
"IDLE-true": "self",
|
|
1193
1255
|
"IDLE-false": "self",
|
|
1194
1256
|
"PUSHING-true": "initial",
|
|
@@ -1199,7 +1261,7 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1199
1261
|
"POPPING-false": "PUSHING-false",
|
|
1200
1262
|
"COMPLETED-true": "self",
|
|
1201
1263
|
"COMPLETED-false": "self"
|
|
1202
|
-
},
|
|
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([
|
|
1203
1265
|
"x",
|
|
1204
1266
|
"y",
|
|
1205
1267
|
"z",
|
|
@@ -1210,7 +1272,7 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1210
1272
|
"rotateX",
|
|
1211
1273
|
"rotateY",
|
|
1212
1274
|
"rotateZ"
|
|
1213
|
-
]),
|
|
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) => {
|
|
1214
1276
|
switch (e) {
|
|
1215
1277
|
case "x": return `translateX(${t})`;
|
|
1216
1278
|
case "y": return `translateY(${t})`;
|
|
@@ -1224,23 +1286,23 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1224
1286
|
case "rotateY": return `rotateY(${t})`;
|
|
1225
1287
|
default: return "";
|
|
1226
1288
|
}
|
|
1227
|
-
},
|
|
1289
|
+
}, Ae = (e) => {
|
|
1228
1290
|
let t = /* @__PURE__ */ new Set(), n = !1, r = (e) => {
|
|
1229
|
-
if (
|
|
1291
|
+
if (ye(e)) for (let r of Object.keys(e)) {
|
|
1230
1292
|
let i = e[r];
|
|
1231
|
-
|
|
1293
|
+
Se(r, i) !== "" && (we.has(r) ? n = !0 : t.add(Ce(r)));
|
|
1232
1294
|
}
|
|
1233
1295
|
};
|
|
1234
1296
|
r(e.initial);
|
|
1235
1297
|
for (let t of Object.values(e.variants)) r(t.value);
|
|
1236
1298
|
return n && t.add("transform"), Array.from(t);
|
|
1237
|
-
},
|
|
1238
|
-
if (!
|
|
1299
|
+
}, R = (e) => {
|
|
1300
|
+
if (!ye(e)) return [];
|
|
1239
1301
|
let t = [], n = !0, r = [];
|
|
1240
1302
|
for (let i of Object.keys(e)) {
|
|
1241
|
-
let a = e[i], o =
|
|
1242
|
-
o !== "" && (
|
|
1243
|
-
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),
|
|
1244
1306
|
value: o
|
|
1245
1307
|
}));
|
|
1246
1308
|
}
|
|
@@ -1248,7 +1310,7 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1248
1310
|
property: "transform",
|
|
1249
1311
|
value: n ? "none" : t.join(" ")
|
|
1250
1312
|
}), r;
|
|
1251
|
-
},
|
|
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" ? {
|
|
1252
1314
|
linear: "linear",
|
|
1253
1315
|
easeIn: "ease-in",
|
|
1254
1316
|
easeOut: "ease-out",
|
|
@@ -1258,11 +1320,11 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1258
1320
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1259
1321
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1260
1322
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1261
|
-
}[e] ?? "ease" : "ease",
|
|
1323
|
+
}[e] ?? "ease" : "ease", V = (e) => {
|
|
1262
1324
|
if (!e) return 0;
|
|
1263
1325
|
let t = e.duration;
|
|
1264
1326
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1265
|
-
},
|
|
1327
|
+
}, je = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Me = (e, t) => {
|
|
1266
1328
|
let [n, r] = t.split("-");
|
|
1267
1329
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1268
1330
|
}, Ne = (e, t) => {
|
|
@@ -1274,17 +1336,17 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1274
1336
|
}, Fe = (e, t) => {
|
|
1275
1337
|
let [n, r] = t.split("-");
|
|
1276
1338
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1277
|
-
}, H = (e, t, n) => `flemo-${e}-${
|
|
1278
|
-
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;
|
|
1279
1341
|
if (s.length === 0 && o.length === 0) return "";
|
|
1280
|
-
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}`;
|
|
1281
1343
|
let p = H(e, t, n), m = [
|
|
1282
1344
|
`@keyframes ${p} {`,
|
|
1283
1345
|
" from {",
|
|
1284
|
-
|
|
1346
|
+
z(o).replace(/^/gm, " "),
|
|
1285
1347
|
" }",
|
|
1286
1348
|
" to {",
|
|
1287
|
-
|
|
1349
|
+
z(s).replace(/^/gm, " "),
|
|
1288
1350
|
" }",
|
|
1289
1351
|
"}"
|
|
1290
1352
|
].join("\n"), h = [
|
|
@@ -1294,33 +1356,33 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1294
1356
|
l > 0 ? `${l}s` : null,
|
|
1295
1357
|
"both"
|
|
1296
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];
|
|
1297
|
-
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}` : ""}`;
|
|
1298
1360
|
}, Ie = (e) => {
|
|
1299
1361
|
if (!e) return !1;
|
|
1300
1362
|
if (e.opacity === 0) return !0;
|
|
1301
1363
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1302
1364
|
return t(e.x) || t(e.y);
|
|
1303
1365
|
}, W = (e, t, n, r) => {
|
|
1304
|
-
let i =
|
|
1305
|
-
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}`;
|
|
1306
1368
|
}, Le = (e, t, n = []) => {
|
|
1307
1369
|
let r = [];
|
|
1308
1370
|
for (let t of e) {
|
|
1309
1371
|
let e = t.name;
|
|
1310
|
-
for (let n of
|
|
1311
|
-
let i = t.variants[n], a =
|
|
1372
|
+
for (let n of ge) {
|
|
1373
|
+
let i = t.variants[n], a = L[n];
|
|
1312
1374
|
if (a === "self") {
|
|
1313
|
-
r.push(W(
|
|
1375
|
+
r.push(W(Me, e, n, i));
|
|
1314
1376
|
continue;
|
|
1315
1377
|
}
|
|
1316
1378
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1317
|
-
r.push(U("screen", e, n, o, i,
|
|
1379
|
+
r.push(U("screen", e, n, o, i, Me));
|
|
1318
1380
|
}
|
|
1319
1381
|
}
|
|
1320
1382
|
for (let e of t) {
|
|
1321
1383
|
let t = e.name;
|
|
1322
|
-
for (let n of
|
|
1323
|
-
let i = e.variants[n], a =
|
|
1384
|
+
for (let n of _e) {
|
|
1385
|
+
let i = e.variants[n], a = L[n];
|
|
1324
1386
|
if (a === "self") {
|
|
1325
1387
|
r.push(W(Ne, t, n, i));
|
|
1326
1388
|
continue;
|
|
@@ -1331,8 +1393,8 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1331
1393
|
}
|
|
1332
1394
|
for (let e of n) {
|
|
1333
1395
|
let t = e.name;
|
|
1334
|
-
for (let n of
|
|
1335
|
-
let i = e.variants[n], a =
|
|
1396
|
+
for (let n of _e) {
|
|
1397
|
+
let i = e.variants[n], a = L[n];
|
|
1336
1398
|
if (a === "self") {
|
|
1337
1399
|
r.push(W(Fe, t, n, i));
|
|
1338
1400
|
continue;
|
|
@@ -1350,28 +1412,28 @@ var P = /* @__PURE__ */ new Map(), F = {
|
|
|
1350
1412
|
" animation-play-state: paused !important;",
|
|
1351
1413
|
"}"
|
|
1352
1414
|
].join("\n"), ze = (e, t) => {
|
|
1353
|
-
let n =
|
|
1415
|
+
let n = L[t];
|
|
1354
1416
|
if (n === "self") return !1;
|
|
1355
|
-
let r = e.variants[t], i =
|
|
1417
|
+
let r = e.variants[t], i = V(r.options), a = je(r.options);
|
|
1356
1418
|
if (i <= 0 && a <= 0) return !1;
|
|
1357
|
-
let o =
|
|
1419
|
+
let o = R(n === "initial" ? e.initial : e.variants[n].value), s = R(r.value);
|
|
1358
1420
|
return o.length > 0 || s.length > 0;
|
|
1359
1421
|
}, Be = "data-flemo";
|
|
1360
1422
|
function G() {
|
|
1361
1423
|
if (u()) return;
|
|
1362
|
-
let e = Le(
|
|
1424
|
+
let e = Le(M.values(), F.values(), I.values()), t = document.head.querySelector(`style[${Be}]`);
|
|
1363
1425
|
t || (t = document.createElement("style"), t.setAttribute(Be, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1364
1426
|
}
|
|
1365
1427
|
//#endregion
|
|
1366
1428
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1367
1429
|
function Ve(e, t, n = []) {
|
|
1368
|
-
for (let t of e)
|
|
1369
|
-
for (let e of t)
|
|
1370
|
-
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);
|
|
1371
1433
|
return G(), () => {
|
|
1372
|
-
for (let t of e)
|
|
1373
|
-
for (let e of t)
|
|
1374
|
-
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);
|
|
1375
1437
|
G();
|
|
1376
1438
|
};
|
|
1377
1439
|
}
|
|
@@ -1403,9 +1465,9 @@ var Ue = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, K = /* @__
|
|
|
1403
1465
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1404
1466
|
}, J = (e, t, n = {}) => {
|
|
1405
1467
|
if (!Ue(e)) return Promise.resolve();
|
|
1406
|
-
let r = e, i =
|
|
1468
|
+
let r = e, i = R(t);
|
|
1407
1469
|
if (i.length === 0) return Promise.resolve();
|
|
1408
|
-
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);
|
|
1409
1471
|
if (a <= 0 && o <= 0) {
|
|
1410
1472
|
r.style.transition = "none";
|
|
1411
1473
|
for (let e of i) r.style.setProperty(e.property, e.value), We(r, e.property);
|
|
@@ -1440,7 +1502,7 @@ function Ge(e) {
|
|
|
1440
1502
|
let l = () => {
|
|
1441
1503
|
let t = e.getTransitionTaskId();
|
|
1442
1504
|
t && a.resolveTask(t);
|
|
1443
|
-
}, u =
|
|
1505
|
+
}, u = de(r), d = `${o}-true`;
|
|
1444
1506
|
if (!(c.getAttribute("data-flemo-skip-animation") !== "true" && ze(u, d))) return queueMicrotask(l), X;
|
|
1445
1507
|
let f = H("screen", r, d), p = (e) => {
|
|
1446
1508
|
e.target === c && e.animationName === f && (c.removeEventListener("animationend", p), l());
|
|
@@ -1557,7 +1619,7 @@ function Je(e) {
|
|
|
1557
1619
|
current: i,
|
|
1558
1620
|
prev: s
|
|
1559
1621
|
};
|
|
1560
|
-
let c =
|
|
1622
|
+
let c = Ae(e.getTransition()).join(", ");
|
|
1561
1623
|
for (let e of i) e.style.willChange = c;
|
|
1562
1624
|
for (let e of s) e.style.willChange = c;
|
|
1563
1625
|
}, b = () => {
|
|
@@ -1575,7 +1637,7 @@ function Je(e) {
|
|
|
1575
1637
|
};
|
|
1576
1638
|
}, S = (e, t, n) => {
|
|
1577
1639
|
let r = (r, i) => {
|
|
1578
|
-
let a =
|
|
1640
|
+
let a = I.get(r.getAttribute("data-flemo-part-name"));
|
|
1579
1641
|
if (!a) return;
|
|
1580
1642
|
let o = {
|
|
1581
1643
|
animate: J,
|
|
@@ -1622,7 +1684,7 @@ function Je(e) {
|
|
|
1622
1684
|
}), S("start", e, 0);
|
|
1623
1685
|
}
|
|
1624
1686
|
}) ? e.setDragStatus("PENDING") : (e.setDragStatus("IDLE"), s = !1, b());
|
|
1625
|
-
},
|
|
1687
|
+
}, T = (r) => {
|
|
1626
1688
|
let i = e.getTransition();
|
|
1627
1689
|
if (!i.swipeDirection || !s || e.getViewportScrollHeight() > 10) return;
|
|
1628
1690
|
_(r);
|
|
@@ -1639,7 +1701,7 @@ function Je(e) {
|
|
|
1639
1701
|
}), S("swipe", e, t);
|
|
1640
1702
|
}
|
|
1641
1703
|
});
|
|
1642
|
-
},
|
|
1704
|
+
}, E = async (a) => {
|
|
1643
1705
|
let o = e.getTransition();
|
|
1644
1706
|
if (!o.swipeDirection || !s) return;
|
|
1645
1707
|
s = !1;
|
|
@@ -1685,7 +1747,7 @@ function Je(e) {
|
|
|
1685
1747
|
pointerMove: (t) => {
|
|
1686
1748
|
if (e.getViewportScrollHeight() > 10) return;
|
|
1687
1749
|
if (s) {
|
|
1688
|
-
|
|
1750
|
+
T(t);
|
|
1689
1751
|
return;
|
|
1690
1752
|
}
|
|
1691
1753
|
let n = e.getTransition().swipeDirection, r = !f.element && !p.element;
|
|
@@ -1699,7 +1761,7 @@ function Je(e) {
|
|
|
1699
1761
|
}
|
|
1700
1762
|
},
|
|
1701
1763
|
pointerUp: (e) => {
|
|
1702
|
-
a = !1, o = !1, s &&
|
|
1764
|
+
a = !1, o = !1, s && E(e);
|
|
1703
1765
|
},
|
|
1704
1766
|
shouldPreventTouch: () => o
|
|
1705
1767
|
};
|
|
@@ -1805,4 +1867,4 @@ function st(e, n) {
|
|
|
1805
1867
|
};
|
|
1806
1868
|
}
|
|
1807
1869
|
//#endregion
|
|
1808
|
-
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