@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.
@@ -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,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 n = e.state, o = a.generateTaskId();
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
- 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();
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
- 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
- });
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
- return async () => {
366
- p && f !== void 0 && u(f + 1), a("COMPLETED");
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: o,
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 = 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);
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(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,
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: o,
469
- transitionName: u,
470
- layoutId: d
471
- }, _), l(y), () => {
472
- h("COMPLETED");
473
- }) : (l(y), await C(r, i, m, () => {
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: f,
476
- index: t.history.getState().index - m,
516
+ id: p,
517
+ index: D + 1,
477
518
  status: "PUSHING",
478
- params: o,
479
- transitionName: u,
480
- layoutId: d
481
- }, _);
519
+ params: s,
520
+ transitionName: d,
521
+ layoutId: f
522
+ }, b);
482
523
  }), async () => {
483
- p(m), h("COMPLETED");
484
- });
524
+ g(_), v("COMPLETED");
525
+ };
485
526
  }, {
486
- id: f,
527
+ id: p,
487
528
  control: { manual: !0 }
488
529
  })).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();
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
- 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);
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(s?.skip, 0) + 1, c + 1);
544
+ return Math.min(S(c?.skip, 0) + 1, u + 1);
500
545
  })();
501
- if (g <= 0) {
546
+ if (v <= 0) {
502
547
  a.abort();
503
548
  return;
504
549
  }
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,
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: 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, () => {
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: f,
526
- index: t.history.getState().index - 1,
578
+ id: p,
579
+ index: O,
527
580
  status: "REPLACING",
528
- params: o,
529
- transitionName: u,
530
- layoutId: d
531
- }, y);
532
- }) : await C(r, i, c, () => {
581
+ params: s,
582
+ transitionName: d,
583
+ layoutId: f
584
+ }, w);
585
+ }) : await C(r, i, u, () => {
533
586
  r.replaceState({
534
- id: f,
535
- index: 0,
587
+ id: p,
588
+ index: O,
536
589
  status: "REPLACING",
537
- params: o,
538
- transitionName: u,
539
- layoutId: d
540
- }, y);
590
+ params: s,
591
+ transitionName: d,
592
+ layoutId: f
593
+ }, w);
541
594
  }), async () => {
542
- m(t.history.getState().index - 1), _("COMPLETED");
543
- });
595
+ g(t.history.getState().index - 1), y("COMPLETED");
596
+ };
544
597
  }, {
545
- id: f,
598
+ id: p,
546
599
  control: { manual: !0 }
547
600
  })).result?.();
548
- }, c = async (e, n) => {
549
- let o = a.generateTaskId();
601
+ }, l = async (e, n) => {
602
+ let s = a.generateTaskId();
550
603
  (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) {
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 p = Math.min(e(s, c), s);
557
- if (p <= 0) {
614
+ let m = Math.min(e(c, l), c);
615
+ if (m <= 0) {
558
616
  a.abort();
559
617
  return;
560
618
  }
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");
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: o,
625
+ id: s,
568
626
  control: { manual: !0 }
569
627
  })).result?.();
570
628
  };
571
629
  return {
572
- push: o,
573
- replace: s,
630
+ push: s,
631
+ replace: c,
574
632
  pop: async (e) => {
575
- await c((t, n) => {
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 ee = (e) => {
646
+ var T = (e) => {
589
647
  let t = e;
590
648
  return t?.step ? t.params ?? {} : null;
591
- }, te = (e, t) => {
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 ne(e) {
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 re(e, t) {
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 T(t = "cupertino") {
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 E() {
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 ie = {
757
+ var te = {
700
758
  mark: () => {},
701
759
  consume: () => !1
702
760
  };
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({
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: [c]
768
+ histories: [f]
708
769
  }), e.hostedScope;
709
- let u = a ? y({
770
+ let p = a ? y({
710
771
  state: {
711
- id: c.id,
772
+ id: f.id,
712
773
  index: 0,
713
774
  status: "IDLE",
714
- params: c.params,
715
- transitionName: c.transitionName,
716
- layoutId: c.layoutId
775
+ params: f.params,
776
+ transitionName: f.transitionName,
777
+ layoutId: f.layoutId
717
778
  },
718
- url: c.pathname
719
- }) : s, d = a ? ie : m();
779
+ url: f.pathname
780
+ }) : s, h = a ? te : m();
720
781
  return {
721
- history: o([c], 0),
782
+ history: o([f], 0),
722
783
  navigate: b(),
723
- transition: T(i),
724
- screen: E(),
725
- driver: u,
726
- markSelfInduced: d.mark,
727
- consume: d.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 oe(e, t) {
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 se(e) {
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 D({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
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 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 }) {
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 le = (e, t, n) => {
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
- }, ue = D({
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 = le(s, [0, window.innerWidth], [0, 100]);
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
- }), de = (e, t, n) => {
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
- }, fe = D({
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 = 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);
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
- }), O = D({
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
- }), pe = D({
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
- }), k = new Map([
1060
- ["none", pe],
1061
- ["cupertino", ue],
1062
- ["material", O],
1063
- ["layout", fe]
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 A(e) {
1068
- return k.get(e) ?? k.get("none");
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 me({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
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 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 }) {
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 j = "rgba(0, 0, 0, 0.3)", M = me({
1176
+ var P = "rgba(0, 0, 0, 0.3)", pe = N({
1115
1177
  name: "overlay",
1116
1178
  initial: {
1117
1179
  opacity: 0,
1118
- backgroundColor: j
1180
+ backgroundColor: P
1119
1181
  },
1120
1182
  idle: {
1121
1183
  value: {
1122
1184
  opacity: 0,
1123
- backgroundColor: j
1185
+ backgroundColor: P
1124
1186
  },
1125
1187
  options: { duration: 0 }
1126
1188
  },
1127
1189
  enter: {
1128
1190
  value: {
1129
1191
  opacity: 1,
1130
- backgroundColor: j
1192
+ backgroundColor: P
1131
1193
  },
1132
1194
  options: { duration: .7 }
1133
1195
  },
1134
1196
  exit: {
1135
1197
  value: {
1136
1198
  opacity: 0,
1137
- backgroundColor: j
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
- }), N = new Map([["overlay", M]]);
1208
+ }), F = new Map([["overlay", pe]]);
1147
1209
  //#endregion
1148
1210
  //#region src/transition/partTransition/createPartTransition.ts
1149
- function ge({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
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 _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 }) {
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 P = /* @__PURE__ */ new Map(), F = {
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
- }, 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([
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
- ]), 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) => {
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
- }, Me = (e) => {
1289
+ }, Ae = (e) => {
1228
1290
  let t = /* @__PURE__ */ new Set(), n = !1, r = (e) => {
1229
- if (xe(e)) for (let r of Object.keys(e)) {
1291
+ if (ye(e)) for (let r of Object.keys(e)) {
1230
1292
  let i = e[r];
1231
- we(r, i) !== "" && (Ee.has(r) ? n = !0 : t.add(Te(r)));
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
- }, I = (e) => {
1238
- if (!xe(e)) return [];
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 = we(i, a);
1242
- o !== "" && (Ee.has(i) ? (t.push(je(i, o)), Ae(i, a) || (n = !1)) : r.push({
1243
- property: Te(i),
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
- }, 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" ? {
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", z = (e) => {
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
- }, B = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, V = (e, t) => {
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}-${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;
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${L(s)}\n animation: none;\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
- L(o).replace(/^/gm, " "),
1346
+ z(o).replace(/^/gm, " "),
1285
1347
  " }",
1286
1348
  " to {",
1287
- L(s).replace(/^/gm, " "),
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${L(s)}\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 = I(r.value);
1305
- return i.length === 0 ? "" : `${e(t, n)} {\n${L(i)}\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 ve) {
1311
- let i = t.variants[n], a = F[n];
1372
+ for (let n of ge) {
1373
+ let i = t.variants[n], a = L[n];
1312
1374
  if (a === "self") {
1313
- r.push(W(V, e, n, i));
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, V));
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 ye) {
1323
- let i = e.variants[n], a = F[n];
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 ye) {
1335
- let i = e.variants[n], a = F[n];
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 = F[t];
1415
+ let n = L[t];
1354
1416
  if (n === "self") return !1;
1355
- let r = e.variants[t], i = z(r.options), a = B(r.options);
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 = I(n === "initial" ? e.initial : e.variants[n].value), s = I(r.value);
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(k.values(), N.values(), P.values()), t = document.head.querySelector(`style[${Be}]`);
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) 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);
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) k.delete(t.name);
1373
- for (let e of t) N.delete(e.name);
1374
- for (let e of n) P.delete(e.name);
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 = I(t);
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 = R(n.ease);
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 = A(r), d = `${o}-true`;
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 = Me(e.getTransition()).join(", ");
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 = P.get(r.getAttribute("data-flemo-part-name"));
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
- }, ee = (r) => {
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
- }, te = async (a) => {
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
- ee(t);
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 && te(e);
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, 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 };
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 };
@@ -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.11.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",