@flemo/core 1.10.1 → 1.12.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.
@@ -13,6 +13,9 @@ export interface FlemoStores {
13
13
  driver: HistoryDriver;
14
14
  markSelfInduced: () => void;
15
15
  consume: () => boolean;
16
+ life: {
17
+ alive: boolean;
18
+ };
16
19
  }
17
20
  export interface CreateRouterScopeInput {
18
21
  routePaths: Path[];
@@ -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,9 @@ 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;
22
+ truncationEpoch: number;
23
+ bumpTruncationEpoch: () => void;
20
24
  setTransitionName: (index: number, transitionName: TransitionName) => void;
21
25
  }
22
26
  export type HistoryStoreApi = StoreApi<HistoryStore>;
package/dist/index.mjs CHANGED
@@ -207,6 +207,13 @@ 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
+ })),
215
+ truncationEpoch: 0,
216
+ bumpTruncationEpoch: () => e((e) => ({ truncationEpoch: e.truncationEpoch + 1 })),
210
217
  setTransitionName: (t, n) => e((e) => {
211
218
  let r = e.histories[t];
212
219
  if (!r || r.transitionName === n) return {};
@@ -333,40 +340,50 @@ function _() {
333
340
  function v(e) {
334
341
  let { stores: t, driver: n = p(), consume: r = _ } = e, i = !1, o = n.subscribe(async (e) => {
335
342
  if (i || r()) return;
336
- let n = e.state, o = a.generateTaskId();
343
+ let o = e.state, s = t.history.getState().truncationEpoch, c = a.generateTaskId();
337
344
  (await a.addTask(async (r) => {
338
345
  if (i) {
339
346
  r.abort();
340
347
  return;
341
348
  }
342
- let { setStatus: a, setTransitionTaskId: s } = t.navigate.getState(), { index: c, addHistory: l, popHistory: u, setPendingIndex: d } = t.history.getState(), f = n?.index, p = f !== void 0 && f < c, m = n?.status === "PUSHING" && f !== void 0 && f > c, h = n?.status === "REPLACING" && f !== void 0 && f > c;
343
- if (!p && !m && !h) {
344
- let i = t.history.getState().histories[c];
345
- n?.id && i && n.id !== i.id && t.history.getState().adoptHistory({
346
- id: n.id,
347
- pathname: e.pathname,
348
- params: n.params,
349
- transitionName: n.transitionName,
350
- layoutId: n.layoutId
351
- }), r.abort();
349
+ let { setStatus: a, setTransitionTaskId: l } = t.navigate.getState(), { index: u, histories: d, addHistory: f, popHistory: p, popHistories: m, setPendingIndex: h } = t.history.getState();
350
+ if (s !== t.history.getState().truncationEpoch && n.readState()?.id !== e.state?.id) {
351
+ r.abort();
352
+ return;
353
+ }
354
+ if (!o?.id) {
355
+ r.abort();
352
356
  return;
353
357
  }
354
- if (s(o), p) d(f), a("POPPING");
355
- else {
356
- let t = n;
357
- a(m ? "PUSHING" : "REPLACING"), l({
358
- id: t.id,
359
- pathname: e.pathname,
360
- params: t.params,
361
- transitionName: t.transitionName,
362
- layoutId: t.layoutId
363
- });
358
+ let g = d.findIndex((e) => e.id === o.id);
359
+ if (g === u) {
360
+ r.abort();
361
+ return;
364
362
  }
365
- return async () => {
366
- p && f !== void 0 && u(f + 1), a("COMPLETED");
363
+ let _ = {
364
+ id: o.id,
365
+ pathname: e.pathname,
366
+ params: o.params,
367
+ transitionName: o.transitionName,
368
+ layoutId: o.layoutId,
369
+ frameIndex: o.index
370
+ };
371
+ if (g === -1) {
372
+ let e = d[u]?.frameIndex ?? u;
373
+ if (!(o.index > e && (o.status === "PUSHING" || o.status === "REPLACING"))) {
374
+ t.history.getState().adoptHistory(_), r.abort();
375
+ return;
376
+ }
377
+ return l(c), a(o.status === "REPLACING" ? "REPLACING" : "PUSHING"), f(_), async () => {
378
+ a("COMPLETED");
379
+ };
380
+ }
381
+ let v = u - g - 1;
382
+ return l(c), v > 0 && m(v), h(g), a("POPPING"), async () => {
383
+ p(g + 1), a("COMPLETED");
367
384
  };
368
385
  }, {
369
- id: o,
386
+ id: c,
370
387
  control: { manual: !0 }
371
388
  })).result?.();
372
389
  });
@@ -441,127 +458,170 @@ var x = (e, t, n) => {
441
458
  i(), s && r();
442
459
  };
443
460
  function w(e) {
444
- let { stores: t, buildPathname: n, driver: r = p(), markSelfInduced: i = g } = e, o = async (e, o, s) => {
445
- let { status: c } = t.navigate.getState();
446
- if (c !== "COMPLETED" && c !== "IDLE") return;
447
- let l = t.transition.getState().defaultTransitionName, { transitionName: u = l, layoutId: d = null } = s ?? {}, f = a.generateTaskId();
448
- (await a.addTask(async () => {
449
- let { index: a, histories: c, addHistory: l, popHistories: p } = t.history.getState(), m = (() => {
450
- if (s?.until != null) {
451
- let e = x(s.until, a, c);
461
+ let { stores: t, buildPathname: n, driver: r = p(), markSelfInduced: i = g } = e, o = () => t.history.getState().bumpTruncationEpoch(), s = () => {
462
+ let e = r.readState();
463
+ if (!e?.id) return null;
464
+ let { index: n, histories: i, adoptHistory: a, truncateHistory: o } = t.history.getState();
465
+ if (i[n]?.id === e.id) return e;
466
+ let s = i.findIndex((t) => t.id === e.id);
467
+ return s >= 0 ? o(s) : a({
468
+ id: e.id,
469
+ pathname: r.readPathname(),
470
+ params: e.params ?? {},
471
+ transitionName: e.transitionName ?? "none",
472
+ layoutId: e.layoutId ?? null,
473
+ frameIndex: e.index
474
+ }), e;
475
+ }, c = async (e, c, l) => {
476
+ let { status: u } = t.navigate.getState();
477
+ if (u !== "COMPLETED" && u !== "IDLE") return;
478
+ let d = t.transition.getState().defaultTransitionName, { transitionName: f = d, layoutId: p = null } = l ?? {}, m = a.generateTaskId();
479
+ (await a.addTask(async (a) => {
480
+ if (t.life && !t.life.alive) {
481
+ a.abort();
482
+ return;
483
+ }
484
+ let u = s(), { index: d, histories: h, addHistory: g, popHistories: _ } = t.history.getState(), v = (() => {
485
+ if (l?.until != null) {
486
+ let e = x(l.until, d, h);
452
487
  return e < 0 ? 0 : e;
453
488
  }
454
- return Math.min(S(s?.skip, 0), Math.max(0, a));
455
- })(), { setStatus: h, setTransitionTaskId: g } = t.navigate.getState();
456
- h("PUSHING"), g(f);
457
- let { pathname: _, toPathname: v } = n(e, o ?? {}), y = {
458
- id: f,
459
- pathname: v,
460
- params: o ?? {},
461
- transitionName: u,
462
- layoutId: d
463
- };
464
- return m === 0 ? (r.pushState({
465
- id: f,
466
- index: a + 1,
489
+ return Math.min(S(l?.skip, 0), Math.max(0, d));
490
+ })(), { setStatus: y, setTransitionTaskId: b } = t.navigate.getState();
491
+ y("PUSHING"), b(m);
492
+ let { pathname: w, toPathname: T } = n(e, c ?? {}), E = {
493
+ id: m,
494
+ pathname: T,
495
+ params: c ?? {},
496
+ transitionName: f,
497
+ layoutId: p
498
+ }, D = u?.index ?? h[d]?.frameIndex ?? d;
499
+ if (v === 0) return o(), r.pushState({
500
+ id: m,
501
+ index: D + 1,
467
502
  status: "PUSHING",
468
- params: o,
469
- transitionName: u,
470
- layoutId: d
471
- }, _), l(y), () => {
472
- h("COMPLETED");
473
- }) : (l(y), await C(r, i, m, () => {
474
- r.pushState({
475
- id: f,
476
- index: t.history.getState().index - m,
503
+ params: c,
504
+ transitionName: f,
505
+ layoutId: p
506
+ }, w), g({
507
+ ...E,
508
+ frameIndex: D + 1
509
+ }), () => {
510
+ y("COMPLETED");
511
+ };
512
+ let O = h[d - v]?.frameIndex ?? d - v;
513
+ return g({
514
+ ...E,
515
+ frameIndex: O + 1
516
+ }), await C(r, i, v, () => {
517
+ o(), r.pushState({
518
+ id: m,
519
+ index: O + 1,
477
520
  status: "PUSHING",
478
- params: o,
479
- transitionName: u,
480
- layoutId: d
481
- }, _);
521
+ params: c,
522
+ transitionName: f,
523
+ layoutId: p
524
+ }, w);
482
525
  }), async () => {
483
- p(m), h("COMPLETED");
484
- });
526
+ _(v), y("COMPLETED");
527
+ };
485
528
  }, {
486
- id: f,
529
+ id: m,
487
530
  control: { manual: !0 }
488
531
  })).result?.();
489
- }, s = async (e, o, s) => {
490
- let { status: c } = t.navigate.getState();
491
- if (c !== "COMPLETED" && c !== "IDLE") return;
492
- let l = t.transition.getState().defaultTransitionName, { transitionName: u = l, layoutId: d = null } = s ?? {}, f = a.generateTaskId();
532
+ }, l = async (e, c, l) => {
533
+ let { status: u } = t.navigate.getState();
534
+ if (u !== "COMPLETED" && u !== "IDLE") return;
535
+ let d = t.transition.getState().defaultTransitionName, { transitionName: f = d, layoutId: p = null } = l ?? {}, m = a.generateTaskId();
493
536
  (await a.addTask(async (a) => {
494
- let { index: c, histories: l, addHistory: p, replaceHistory: m, popHistories: h } = t.history.getState(), g = (() => {
495
- if (s?.until != null) {
496
- let e = x(s.until, c, l);
537
+ if (t.life && !t.life.alive) {
538
+ a.abort();
539
+ return;
540
+ }
541
+ let u = s(), { index: d, histories: h, addHistory: g, replaceHistory: _, popHistories: v } = t.history.getState(), y = (() => {
542
+ if (l?.until != null) {
543
+ let e = x(l.until, d, h);
497
544
  return e < 0 ? 0 : e + 1;
498
545
  }
499
- return Math.min(S(s?.skip, 0) + 1, c + 1);
546
+ return Math.min(S(l?.skip, 0) + 1, d + 1);
500
547
  })();
501
- if (g <= 0) {
548
+ if (y <= 0) {
502
549
  a.abort();
503
550
  return;
504
551
  }
505
- let { setStatus: _, setTransitionTaskId: v } = t.navigate.getState();
506
- _("REPLACING"), v(f);
507
- let { pathname: y, toPathname: b } = n(e, o ?? {}), w = {
508
- id: f,
509
- pathname: b,
510
- params: o ?? {},
511
- transitionName: u,
512
- layoutId: d
513
- };
514
- return g === 1 ? (r.replaceState({
515
- id: f,
516
- index: c,
552
+ let { setStatus: b, setTransitionTaskId: w } = t.navigate.getState();
553
+ b("REPLACING"), w(m);
554
+ let { pathname: T, toPathname: E } = n(e, c ?? {}), D = {
555
+ id: m,
556
+ pathname: E,
557
+ params: c ?? {},
558
+ transitionName: f,
559
+ layoutId: p
560
+ }, O = u?.index ?? h[d]?.frameIndex ?? d;
561
+ if (y === 1) return o(), r.replaceState({
562
+ id: m,
563
+ index: O,
517
564
  status: "REPLACING",
518
- params: o,
519
- transitionName: u,
520
- layoutId: d
521
- }, y), p(w), async () => {
522
- m(c), _("COMPLETED");
523
- }) : (h(g - 1), p(w), g <= c ? await C(r, i, g, () => {
524
- r.pushState({
525
- id: f,
526
- index: t.history.getState().index - 1,
565
+ params: c,
566
+ transitionName: f,
567
+ layoutId: p
568
+ }, T), g({
569
+ ...D,
570
+ frameIndex: O
571
+ }), async () => {
572
+ _(d), b("COMPLETED");
573
+ };
574
+ let k = y <= d ? (h[d - y]?.frameIndex ?? d - y) + 1 : h[0]?.frameIndex ?? 0;
575
+ return v(y - 1), g({
576
+ ...D,
577
+ frameIndex: k
578
+ }), y <= d ? await C(r, i, y, () => {
579
+ o(), r.pushState({
580
+ id: m,
581
+ index: k,
527
582
  status: "REPLACING",
528
- params: o,
529
- transitionName: u,
530
- layoutId: d
531
- }, y);
532
- }) : await C(r, i, c, () => {
533
- r.replaceState({
534
- id: f,
535
- index: 0,
583
+ params: c,
584
+ transitionName: f,
585
+ layoutId: p
586
+ }, T);
587
+ }) : await C(r, i, d, () => {
588
+ o(), r.replaceState({
589
+ id: m,
590
+ index: k,
536
591
  status: "REPLACING",
537
- params: o,
538
- transitionName: u,
539
- layoutId: d
540
- }, y);
592
+ params: c,
593
+ transitionName: f,
594
+ layoutId: p
595
+ }, T);
541
596
  }), async () => {
542
- m(t.history.getState().index - 1), _("COMPLETED");
543
- });
597
+ _(t.history.getState().index - 1), b("COMPLETED");
598
+ };
544
599
  }, {
545
- id: f,
600
+ id: m,
546
601
  control: { manual: !0 }
547
602
  })).result?.();
548
- }, c = async (e, n) => {
603
+ }, u = async (e, n) => {
549
604
  let o = a.generateTaskId();
550
605
  (await a.addTask(async (a) => {
551
- let { index: s, histories: c, popHistory: l, popHistories: u, setPendingIndex: d, setTransitionName: f } = t.history.getState();
552
- if (s <= 0) {
606
+ if (t.life && !t.life.alive) {
553
607
  a.abort();
554
608
  return;
555
609
  }
556
- let p = Math.min(e(s, c), s);
557
- if (p <= 0) {
610
+ s();
611
+ let { index: c, histories: l, popHistory: u, popHistories: d, setPendingIndex: f, setTransitionName: p } = t.history.getState();
612
+ if (c <= 0) {
558
613
  a.abort();
559
614
  return;
560
615
  }
561
- d(s - p);
562
- let { setStatus: m, setTransitionTaskId: h } = t.navigate.getState();
563
- return n && f(s, n), m("POPPING"), h(o), u(p - 1), i(), p === 1 ? r.back() : r.go(-p), async () => {
564
- l(t.history.getState().index), m("COMPLETED");
616
+ let m = Math.min(e(c, l), c);
617
+ if (m <= 0) {
618
+ a.abort();
619
+ return;
620
+ }
621
+ f(c - m);
622
+ let { setStatus: h, setTransitionTaskId: g } = t.navigate.getState();
623
+ return n && p(c, n), h("POPPING"), g(o), d(m - 1), i(), m === 1 ? r.back() : r.go(-m), async () => {
624
+ u(t.history.getState().index), h("COMPLETED");
565
625
  };
566
626
  }, {
567
627
  id: o,
@@ -569,10 +629,10 @@ function w(e) {
569
629
  })).result?.();
570
630
  };
571
631
  return {
572
- push: o,
573
- replace: s,
632
+ push: c,
633
+ replace: l,
574
634
  pop: async (e) => {
575
- await c((t, n) => {
635
+ await u((t, n) => {
576
636
  if (e?.until != null) {
577
637
  let r = x(e.until, t, n);
578
638
  return r < 0 ? 0 : r;
@@ -585,14 +645,14 @@ function w(e) {
585
645
  }
586
646
  //#endregion
587
647
  //#region src/navigate/createStepController.ts
588
- var ee = (e) => {
648
+ var T = (e) => {
589
649
  let t = e;
590
650
  return t?.step ? t.params ?? {} : null;
591
- }, te = (e, t) => {
651
+ }, E = (e, t) => {
592
652
  let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
593
653
  return n ? `${e}?${n}` : e;
594
654
  };
595
- function ne(e) {
655
+ function D(e) {
596
656
  let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
597
657
  return {
598
658
  pushStep: async (e) => {
@@ -647,7 +707,7 @@ function ne(e) {
647
707
  }
648
708
  };
649
709
  }
650
- function re(e, t) {
710
+ function O(e, t) {
651
711
  return e.subscribe((e) => {
652
712
  let n = e.state;
653
713
  n?.step && a.addTask(async () => {
@@ -657,7 +717,7 @@ function re(e, t) {
657
717
  }
658
718
  //#endregion
659
719
  //#region src/transition/store.ts
660
- function T(t = "cupertino") {
720
+ function k(t = "cupertino") {
661
721
  return e((e) => ({
662
722
  defaultTransitionName: t,
663
723
  setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
@@ -665,7 +725,7 @@ function T(t = "cupertino") {
665
725
  }
666
726
  //#endregion
667
727
  //#region src/screen/store.ts
668
- function E() {
728
+ function A() {
669
729
  return e((e) => ({
670
730
  dragStatus: "IDLE",
671
731
  replaceTransitionStatus: "IDLE",
@@ -696,40 +756,49 @@ function E() {
696
756
  }
697
757
  //#endregion
698
758
  //#region src/core/createRouterScope.ts
699
- var ie = {
759
+ var ee = {
700
760
  mark: () => {},
701
761
  consume: () => !1
702
762
  };
703
- function ae(e) {
704
- let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: s } = e, c = l(t, n, r, i);
705
- if (e.hostedScope) return e.hostedScope.history.getState().index === -1 && e.hostedScope.history.setState({
763
+ function te(e) {
764
+ 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() : null, f = d?.id ? {
765
+ ...c,
766
+ id: d.id,
767
+ params: d.params ?? c.params,
768
+ frameIndex: d.index ?? 0
769
+ } : {
770
+ ...c,
771
+ frameIndex: 0
772
+ };
773
+ if (e.hostedScope) return e.hostedScope.life.alive = !0, e.hostedScope.history.getState().index === -1 && e.hostedScope.history.setState({
706
774
  index: 0,
707
- histories: [c]
775
+ histories: [f]
708
776
  }), e.hostedScope;
709
- let u = a ? y({
777
+ let p = a ? y({
710
778
  state: {
711
- id: c.id,
779
+ id: f.id,
712
780
  index: 0,
713
781
  status: "IDLE",
714
- params: c.params,
715
- transitionName: c.transitionName,
716
- layoutId: c.layoutId
782
+ params: f.params,
783
+ transitionName: f.transitionName,
784
+ layoutId: f.layoutId
717
785
  },
718
- url: c.pathname
719
- }) : s, d = a ? ie : m();
786
+ url: f.pathname
787
+ }) : s, h = a ? ee : m();
720
788
  return {
721
- history: o([c], 0),
789
+ history: o([f], 0),
722
790
  navigate: b(),
723
- transition: T(i),
724
- screen: E(),
725
- driver: u,
726
- markSelfInduced: d.mark,
727
- consume: d.consume
791
+ transition: k(i),
792
+ screen: A(),
793
+ driver: p,
794
+ markSelfInduced: h.mark,
795
+ consume: h.consume,
796
+ life: { alive: !0 }
728
797
  };
729
798
  }
730
799
  //#endregion
731
800
  //#region src/screen/createScreenSelector.ts
732
- function oe(e, t) {
801
+ function ne(e, t) {
733
802
  return e.map((n, r) => ({
734
803
  ...n,
735
804
  isActive: r === t,
@@ -742,13 +811,13 @@ function oe(e, t) {
742
811
  }
743
812
  //#endregion
744
813
  //#region src/screen/computeScreenFreeze.ts
745
- function se(e) {
814
+ function re(e) {
746
815
  let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
747
816
  return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
748
817
  }
749
818
  //#endregion
750
819
  //#region src/transition/createTransition.ts
751
- function D({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
820
+ function j({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
752
821
  return {
753
822
  name: e,
754
823
  initial: t,
@@ -769,7 +838,7 @@ function D({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
769
838
  }
770
839
  //#endregion
771
840
  //#region src/transition/createRawTransition.ts
772
- function ce({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
841
+ function ie({ 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
842
  return {
774
843
  name: e,
775
844
  initial: t,
@@ -790,10 +859,10 @@ function ce({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
790
859
  }
791
860
  //#endregion
792
861
  //#region src/transition/cupertino.ts
793
- var le = (e, t, n) => {
862
+ var ae = (e, t, n) => {
794
863
  let [r, i] = t, [a, o] = n;
795
864
  return i === r ? a : a + (e - r) / (i - r) * (o - a);
796
- }, ue = D({
865
+ }, oe = j({
797
866
  name: "cupertino",
798
867
  initial: { x: "100%" },
799
868
  idle: {
@@ -853,7 +922,7 @@ var le = (e, t, n) => {
853
922
  swipeDirection: "x",
854
923
  onSwipeStart: async () => !0,
855
924
  onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
856
- let { offset: o } = t, s = o.x, c = le(s, [0, window.innerWidth], [0, 100]);
925
+ let { offset: o } = t, s = o.x, c = ae(s, [0, window.innerWidth], [0, 100]);
857
926
  return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + c * .3}%` }, { duration: 0 }), c;
858
927
  },
859
928
  onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
@@ -877,10 +946,10 @@ var le = (e, t, n) => {
877
946
  })]), c;
878
947
  }
879
948
  }
880
- }), de = (e, t, n) => {
949
+ }), se = (e, t, n) => {
881
950
  let [r, i] = t, [a, o] = n;
882
951
  return i === r ? a : a + (e - r) / (i - r) * (o - a);
883
- }, fe = D({
952
+ }, M = j({
884
953
  name: "layout",
885
954
  initial: { opacity: .97 },
886
955
  idle: {
@@ -908,7 +977,7 @@ var le = (e, t, n) => {
908
977
  swipeDirection: "y",
909
978
  onSwipeStart: async () => !0,
910
979
  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 = de(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);
980
+ let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = se(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
981
  return i?.(!0, 100), n(r, {
913
982
  y: f,
914
983
  opacity: c
@@ -925,7 +994,7 @@ var le = (e, t, n) => {
925
994
  }, { duration: .3 })]), c;
926
995
  }
927
996
  }
928
- }), O = D({
997
+ }), ce = j({
929
998
  name: "material",
930
999
  initial: { y: "100%" },
931
1000
  idle: {
@@ -1033,7 +1102,7 @@ var le = (e, t, n) => {
1033
1102
  })]), c;
1034
1103
  }
1035
1104
  }
1036
- }), pe = D({
1105
+ }), le = j({
1037
1106
  name: "none",
1038
1107
  initial: {},
1039
1108
  idle: {
@@ -1056,20 +1125,20 @@ var le = (e, t, n) => {
1056
1125
  value: {},
1057
1126
  options: { duration: 0 }
1058
1127
  }
1059
- }), k = new Map([
1060
- ["none", pe],
1061
- ["cupertino", ue],
1062
- ["material", O],
1063
- ["layout", fe]
1128
+ }), N = new Map([
1129
+ ["none", le],
1130
+ ["cupertino", oe],
1131
+ ["material", ce],
1132
+ ["layout", M]
1064
1133
  ]);
1065
1134
  //#endregion
1066
1135
  //#region src/transition/resolveTransition.ts
1067
- function A(e) {
1068
- return k.get(e) ?? k.get("none");
1136
+ function ue(e) {
1137
+ return N.get(e) ?? N.get("none");
1069
1138
  }
1070
1139
  //#endregion
1071
1140
  //#region src/transition/decorator/createDecorator.ts
1072
- function me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
1141
+ function de({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
1073
1142
  return {
1074
1143
  name: e,
1075
1144
  initial: t,
@@ -1090,7 +1159,7 @@ function me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
1090
1159
  }
1091
1160
  //#endregion
1092
1161
  //#region src/transition/decorator/createRawDecorator.ts
1093
- 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 }) {
1162
+ 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
1163
  return {
1095
1164
  name: e,
1096
1165
  initial: t,
@@ -1111,30 +1180,30 @@ function he({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
1111
1180
  }
1112
1181
  //#endregion
1113
1182
  //#region src/transition/decorator/overlay.ts
1114
- var j = "rgba(0, 0, 0, 0.3)", M = me({
1183
+ var P = "rgba(0, 0, 0, 0.3)", pe = de({
1115
1184
  name: "overlay",
1116
1185
  initial: {
1117
1186
  opacity: 0,
1118
- backgroundColor: j
1187
+ backgroundColor: P
1119
1188
  },
1120
1189
  idle: {
1121
1190
  value: {
1122
1191
  opacity: 0,
1123
- backgroundColor: j
1192
+ backgroundColor: P
1124
1193
  },
1125
1194
  options: { duration: 0 }
1126
1195
  },
1127
1196
  enter: {
1128
1197
  value: {
1129
1198
  opacity: 1,
1130
- backgroundColor: j
1199
+ backgroundColor: P
1131
1200
  },
1132
1201
  options: { duration: .7 }
1133
1202
  },
1134
1203
  exit: {
1135
1204
  value: {
1136
1205
  opacity: 0,
1137
- backgroundColor: j
1206
+ backgroundColor: P
1138
1207
  },
1139
1208
  options: { duration: .6 }
1140
1209
  },
@@ -1143,10 +1212,10 @@ var j = "rgba(0, 0, 0, 0.3)", M = me({
1143
1212
  onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
1144
1213
  onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
1145
1214
  }
1146
- }), N = new Map([["overlay", M]]);
1215
+ }), F = new Map([["overlay", pe]]);
1147
1216
  //#endregion
1148
1217
  //#region src/transition/partTransition/createPartTransition.ts
1149
- function ge({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
1218
+ function me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
1150
1219
  return {
1151
1220
  name: e,
1152
1221
  initial: t,
@@ -1167,7 +1236,7 @@ function ge({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
1167
1236
  }
1168
1237
  //#endregion
1169
1238
  //#region src/transition/partTransition/createRawPartTransition.ts
1170
- function _e({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
1239
+ 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
1240
  return {
1172
1241
  name: e,
1173
1242
  initial: t,
@@ -1188,7 +1257,7 @@ function _e({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
1188
1257
  }
1189
1258
  //#endregion
1190
1259
  //#region src/transition/partTransition/partTransition.ts
1191
- var P = /* @__PURE__ */ new Map(), F = {
1260
+ var I = /* @__PURE__ */ new Map(), L = {
1192
1261
  "IDLE-true": "self",
1193
1262
  "IDLE-false": "self",
1194
1263
  "PUSHING-true": "initial",
@@ -1199,7 +1268,7 @@ var P = /* @__PURE__ */ new Map(), F = {
1199
1268
  "POPPING-false": "PUSHING-false",
1200
1269
  "COMPLETED-true": "self",
1201
1270
  "COMPLETED-false": "self"
1202
- }, ve = Object.keys(F), ye = ve, be = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), xe = (e) => typeof e == "object" && !!e && !Array.isArray(e), Se = 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(".")), Ce = (e, t) => t.startsWith("--") || Se.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, we = (e, t) => typeof t == "number" ? Ce(t, e) : typeof t == "string" ? t : "", Te = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Ee = new Set([
1271
+ }, 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
1272
  "x",
1204
1273
  "y",
1205
1274
  "z",
@@ -1210,7 +1279,7 @@ var P = /* @__PURE__ */ new Map(), F = {
1210
1279
  "rotateX",
1211
1280
  "rotateY",
1212
1281
  "rotateZ"
1213
- ]), De = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, Oe = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, ke = /^1(\.0+)?$/, Ae = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? ke.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? Oe.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? De.test(t.trim()) : !1, je = (e, t) => {
1282
+ ]), 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
1283
  switch (e) {
1215
1284
  case "x": return `translateX(${t})`;
1216
1285
  case "y": return `translateY(${t})`;
@@ -1224,23 +1293,23 @@ var P = /* @__PURE__ */ new Map(), F = {
1224
1293
  case "rotateY": return `rotateY(${t})`;
1225
1294
  default: return "";
1226
1295
  }
1227
- }, Me = (e) => {
1296
+ }, Ae = (e) => {
1228
1297
  let t = /* @__PURE__ */ new Set(), n = !1, r = (e) => {
1229
- if (xe(e)) for (let r of Object.keys(e)) {
1298
+ if (ye(e)) for (let r of Object.keys(e)) {
1230
1299
  let i = e[r];
1231
- we(r, i) !== "" && (Ee.has(r) ? n = !0 : t.add(Te(r)));
1300
+ Se(r, i) !== "" && (we.has(r) ? n = !0 : t.add(Ce(r)));
1232
1301
  }
1233
1302
  };
1234
1303
  r(e.initial);
1235
1304
  for (let t of Object.values(e.variants)) r(t.value);
1236
1305
  return n && t.add("transform"), Array.from(t);
1237
- }, I = (e) => {
1238
- if (!xe(e)) return [];
1306
+ }, R = (e) => {
1307
+ if (!ye(e)) return [];
1239
1308
  let t = [], n = !0, r = [];
1240
1309
  for (let i of Object.keys(e)) {
1241
- let a = e[i], o = we(i, a);
1242
- o !== "" && (Ee.has(i) ? (t.push(je(i, o)), Ae(i, a) || (n = !1)) : r.push({
1243
- property: Te(i),
1310
+ let a = e[i], o = Se(i, a);
1311
+ o !== "" && (we.has(i) ? (t.push(ke(i, o)), Oe(i, a) || (n = !1)) : r.push({
1312
+ property: Ce(i),
1244
1313
  value: o
1245
1314
  }));
1246
1315
  }
@@ -1248,7 +1317,7 @@ var P = /* @__PURE__ */ new Map(), F = {
1248
1317
  property: "transform",
1249
1318
  value: n ? "none" : t.join(" ")
1250
1319
  }), r;
1251
- }, L = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), R = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
1320
+ }, 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
1321
  linear: "linear",
1253
1322
  easeIn: "ease-in",
1254
1323
  easeOut: "ease-out",
@@ -1258,11 +1327,11 @@ var P = /* @__PURE__ */ new Map(), F = {
1258
1327
  backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
1259
1328
  backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
1260
1329
  anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
1261
- }[e] ?? "ease" : "ease", z = (e) => {
1330
+ }[e] ?? "ease" : "ease", V = (e) => {
1262
1331
  if (!e) return 0;
1263
1332
  let t = e.duration;
1264
1333
  return typeof t == "number" && t >= 0 ? t : 0;
1265
- }, B = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, V = (e, t) => {
1334
+ }, je = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Me = (e, t) => {
1266
1335
  let [n, r] = t.split("-");
1267
1336
  return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
1268
1337
  }, Ne = (e, t) => {
@@ -1274,17 +1343,17 @@ var P = /* @__PURE__ */ new Map(), F = {
1274
1343
  }, Fe = (e, t) => {
1275
1344
  let [n, r] = t.split("-");
1276
1345
  return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
1277
- }, H = (e, t, n) => `flemo-${e}-${be(t)}-${n}`, U = (e, t, n, r, i, a) => {
1278
- let o = I(r), s = I(i.value), c = z(i.options), l = B(i.options), u = R(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Pe(t, n)}` : d;
1346
+ }, H = (e, t, n) => `flemo-${e}-${ve(t)}-${n}`, U = (e, t, n, r, i, a) => {
1347
+ 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
1348
  if (s.length === 0 && o.length === 0) return "";
1280
- if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${L(s)}\n animation: none;\n}`;
1349
+ if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${z(s)}\n animation: none;\n}`;
1281
1350
  let p = H(e, t, n), m = [
1282
1351
  `@keyframes ${p} {`,
1283
1352
  " from {",
1284
- L(o).replace(/^/gm, " "),
1353
+ z(o).replace(/^/gm, " "),
1285
1354
  " }",
1286
1355
  " to {",
1287
- L(s).replace(/^/gm, " "),
1356
+ z(s).replace(/^/gm, " "),
1288
1357
  " }",
1289
1358
  "}"
1290
1359
  ].join("\n"), h = [
@@ -1294,33 +1363,33 @@ var P = /* @__PURE__ */ new Map(), F = {
1294
1363
  l > 0 ? `${l}s` : null,
1295
1364
  "both"
1296
1365
  ].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${L(s)}\n}` : ""}`;
1366
+ 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
1367
  }, Ie = (e) => {
1299
1368
  if (!e) return !1;
1300
1369
  if (e.opacity === 0) return !0;
1301
1370
  let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
1302
1371
  return t(e.x) || t(e.y);
1303
1372
  }, W = (e, t, n, r) => {
1304
- let i = I(r.value);
1305
- return i.length === 0 ? "" : `${e(t, n)} {\n${L(i)}\n}`;
1373
+ let i = R(r.value);
1374
+ return i.length === 0 ? "" : `${e(t, n)} {\n${z(i)}\n}`;
1306
1375
  }, Le = (e, t, n = []) => {
1307
1376
  let r = [];
1308
1377
  for (let t of e) {
1309
1378
  let e = t.name;
1310
- for (let n of ve) {
1311
- let i = t.variants[n], a = F[n];
1379
+ for (let n of ge) {
1380
+ let i = t.variants[n], a = L[n];
1312
1381
  if (a === "self") {
1313
- r.push(W(V, e, n, i));
1382
+ r.push(W(Me, e, n, i));
1314
1383
  continue;
1315
1384
  }
1316
1385
  let o = a === "initial" ? t.initial : t.variants[a].value;
1317
- r.push(U("screen", e, n, o, i, V));
1386
+ r.push(U("screen", e, n, o, i, Me));
1318
1387
  }
1319
1388
  }
1320
1389
  for (let e of t) {
1321
1390
  let t = e.name;
1322
- for (let n of ye) {
1323
- let i = e.variants[n], a = F[n];
1391
+ for (let n of _e) {
1392
+ let i = e.variants[n], a = L[n];
1324
1393
  if (a === "self") {
1325
1394
  r.push(W(Ne, t, n, i));
1326
1395
  continue;
@@ -1331,8 +1400,8 @@ var P = /* @__PURE__ */ new Map(), F = {
1331
1400
  }
1332
1401
  for (let e of n) {
1333
1402
  let t = e.name;
1334
- for (let n of ye) {
1335
- let i = e.variants[n], a = F[n];
1403
+ for (let n of _e) {
1404
+ let i = e.variants[n], a = L[n];
1336
1405
  if (a === "self") {
1337
1406
  r.push(W(Fe, t, n, i));
1338
1407
  continue;
@@ -1350,28 +1419,28 @@ var P = /* @__PURE__ */ new Map(), F = {
1350
1419
  " animation-play-state: paused !important;",
1351
1420
  "}"
1352
1421
  ].join("\n"), ze = (e, t) => {
1353
- let n = F[t];
1422
+ let n = L[t];
1354
1423
  if (n === "self") return !1;
1355
- let r = e.variants[t], i = z(r.options), a = B(r.options);
1424
+ let r = e.variants[t], i = V(r.options), a = je(r.options);
1356
1425
  if (i <= 0 && a <= 0) return !1;
1357
- let o = I(n === "initial" ? e.initial : e.variants[n].value), s = I(r.value);
1426
+ let o = R(n === "initial" ? e.initial : e.variants[n].value), s = R(r.value);
1358
1427
  return o.length > 0 || s.length > 0;
1359
1428
  }, Be = "data-flemo";
1360
1429
  function G() {
1361
1430
  if (u()) return;
1362
- let e = Le(k.values(), N.values(), P.values()), t = document.head.querySelector(`style[${Be}]`);
1431
+ let e = Le(N.values(), F.values(), I.values()), t = document.head.querySelector(`style[${Be}]`);
1363
1432
  t || (t = document.createElement("style"), t.setAttribute(Be, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
1364
1433
  }
1365
1434
  //#endregion
1366
1435
  //#region src/transition/registerTransitionDefinitions.ts
1367
1436
  function Ve(e, t, n = []) {
1368
- for (let t of e) k.set(t.name, t);
1369
- for (let e of t) N.set(e.name, e);
1370
- for (let e of n) P.set(e.name, e);
1437
+ for (let t of e) N.set(t.name, t);
1438
+ for (let e of t) F.set(e.name, e);
1439
+ for (let e of n) I.set(e.name, e);
1371
1440
  return G(), () => {
1372
- for (let t of e) k.delete(t.name);
1373
- for (let e of t) N.delete(e.name);
1374
- for (let e of n) P.delete(e.name);
1441
+ for (let t of e) N.delete(t.name);
1442
+ for (let e of t) F.delete(e.name);
1443
+ for (let e of n) I.delete(e.name);
1375
1444
  G();
1376
1445
  };
1377
1446
  }
@@ -1403,9 +1472,9 @@ var Ue = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, K = /* @__
1403
1472
  e.style.removeProperty("transform"), e.style.removeProperty("opacity");
1404
1473
  }, J = (e, t, n = {}) => {
1405
1474
  if (!Ue(e)) return Promise.resolve();
1406
- let r = e, i = I(t);
1475
+ let r = e, i = R(t);
1407
1476
  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 = R(n.ease);
1477
+ 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
1478
  if (a <= 0 && o <= 0) {
1410
1479
  r.style.transition = "none";
1411
1480
  for (let e of i) r.style.setProperty(e.property, e.value), We(r, e.property);
@@ -1440,7 +1509,7 @@ function Ge(e) {
1440
1509
  let l = () => {
1441
1510
  let t = e.getTransitionTaskId();
1442
1511
  t && a.resolveTask(t);
1443
- }, u = A(r), d = `${o}-true`;
1512
+ }, u = ue(r), d = `${o}-true`;
1444
1513
  if (!(c.getAttribute("data-flemo-skip-animation") !== "true" && ze(u, d))) return queueMicrotask(l), X;
1445
1514
  let f = H("screen", r, d), p = (e) => {
1446
1515
  e.target === c && e.animationName === f && (c.removeEventListener("animationend", p), l());
@@ -1557,7 +1626,7 @@ function Je(e) {
1557
1626
  current: i,
1558
1627
  prev: s
1559
1628
  };
1560
- let c = Me(e.getTransition()).join(", ");
1629
+ let c = Ae(e.getTransition()).join(", ");
1561
1630
  for (let e of i) e.style.willChange = c;
1562
1631
  for (let e of s) e.style.willChange = c;
1563
1632
  }, b = () => {
@@ -1575,7 +1644,7 @@ function Je(e) {
1575
1644
  };
1576
1645
  }, S = (e, t, n) => {
1577
1646
  let r = (r, i) => {
1578
- let a = P.get(r.getAttribute("data-flemo-part-name"));
1647
+ let a = I.get(r.getAttribute("data-flemo-part-name"));
1579
1648
  if (!a) return;
1580
1649
  let o = {
1581
1650
  animate: J,
@@ -1622,7 +1691,7 @@ function Je(e) {
1622
1691
  }), S("start", e, 0);
1623
1692
  }
1624
1693
  }) ? e.setDragStatus("PENDING") : (e.setDragStatus("IDLE"), s = !1, b());
1625
- }, ee = (r) => {
1694
+ }, T = (r) => {
1626
1695
  let i = e.getTransition();
1627
1696
  if (!i.swipeDirection || !s || e.getViewportScrollHeight() > 10) return;
1628
1697
  _(r);
@@ -1639,7 +1708,7 @@ function Je(e) {
1639
1708
  }), S("swipe", e, t);
1640
1709
  }
1641
1710
  });
1642
- }, te = async (a) => {
1711
+ }, E = async (a) => {
1643
1712
  let o = e.getTransition();
1644
1713
  if (!o.swipeDirection || !s) return;
1645
1714
  s = !1;
@@ -1685,7 +1754,7 @@ function Je(e) {
1685
1754
  pointerMove: (t) => {
1686
1755
  if (e.getViewportScrollHeight() > 10) return;
1687
1756
  if (s) {
1688
- ee(t);
1757
+ T(t);
1689
1758
  return;
1690
1759
  }
1691
1760
  let n = e.getTransition().swipeDirection, r = !f.element && !p.element;
@@ -1699,7 +1768,7 @@ function Je(e) {
1699
1768
  }
1700
1769
  },
1701
1770
  pointerUp: (e) => {
1702
- a = !1, o = !1, s && te(e);
1771
+ a = !1, o = !1, s && E(e);
1703
1772
  },
1704
1773
  shouldPreventTouch: () => o
1705
1774
  };
@@ -1805,4 +1874,4 @@ function st(e, n) {
1805
1874
  };
1806
1875
  }
1807
1876
  //#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, te as appendParamsQuery, G as applyTransitionStyles, st as buildRoutePath, $ as canProgrammaticallyScroll, q as clearInlineAnimation, Me as collectAnimatedProperties, Le as compileTransitionStyles, Ye as computeBarRiding, se as computeScreenFreeze, _ as consumeSelfInducedPop, p as createBrowserHistoryDriver, me as createDecorator, o as createHistoryStore, v as createHistorySync, y as createMemoryHistoryDriver, b as createNavigateStore, w as createNavigationController, ge as createPartTransition, he as createRawDecorator, _e as createRawPartTransition, ce as createRawTransition, ae as createRouterScope, oe as createScreenSelector, E as createScreenStore, m as createSelfPopGuard, ne as createStepController, Je as createSwipeController, D as createTransition, Ge as createTransitionEngine, T as createTransitionStore, ue as cupertino, N as decoratorMap, et as eagerlyDecodeImages, R as easingToCss, d as ensureWindowHistoryState, He as enteringInitialStyle, Z as findScrollable, s as getMatchedPathPattern, c as getParams, ot as isOpaqueColor, u as isServer, fe as layout, g as markSelfInducedPop, at as matchesPathname, O as material, pe as none, nt as observeBarHeight, it as observeViewportScrollHeight, Q as overflowsAxis, M as overlay, P as partTransitionMap, ee as readStepParams, Ve as registerTransitionDefinitions, A as resolveTransition, tt as scheduleAnimHoldRelease, l as seedInitialHistory, re as subscribeStepParamsRestore, I as targetToDecls, k as transitionMap, ze as variantHasAnimation };
1877
+ 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, re as computeScreenFreeze, _ as consumeSelfInducedPop, p as createBrowserHistoryDriver, de 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, ie as createRawTransition, te as createRouterScope, ne as createScreenSelector, A as createScreenStore, m as createSelfPopGuard, D as createStepController, Je as createSwipeController, j as createTransition, Ge as createTransitionEngine, k as createTransitionStore, oe 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, M as layout, g as markSelfInducedPop, at as matchesPathname, ce as material, le as none, nt as observeBarHeight, it as observeViewportScrollHeight, Q as overflowsAxis, pe as overlay, I as partTransitionMap, T as readStepParams, Ve as registerTransitionDefinitions, ue as resolveTransition, tt as scheduleAnimHoldRelease, l as seedInitialHistory, O as subscribeStepParamsRestore, R as targetToDecls, N as transitionMap, ze as variantHasAnimation };
@@ -19,6 +19,9 @@ export interface NavigationControllerDeps {
19
19
  history: HistoryStoreApi;
20
20
  navigate: NavigateStoreApi;
21
21
  transition: TransitionStoreApi;
22
+ life?: {
23
+ alive: boolean;
24
+ };
22
25
  };
23
26
  buildPathname: (path: string, params: object) => {
24
27
  pathname: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flemo/core",
3
- "version": "1.10.1",
3
+ "version": "1.12.0",
4
4
  "description": "Framework-agnostic primitives for flemo: history, navigation, transitions, task manager.",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",