@flemo/core 1.17.0 → 1.18.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.
- package/dist/index.mjs +163 -150
- package/dist/screen/animStartAnchor.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -496,7 +496,7 @@ function te(e) {
|
|
|
496
496
|
}
|
|
497
497
|
//#endregion
|
|
498
498
|
//#region src/history/memoryHistoryDriver.ts
|
|
499
|
-
function
|
|
499
|
+
function O(e) {
|
|
500
500
|
let t = [{
|
|
501
501
|
state: e?.state ?? null,
|
|
502
502
|
url: e?.url ?? "/"
|
|
@@ -538,7 +538,7 @@ function ne(e) {
|
|
|
538
538
|
}
|
|
539
539
|
//#endregion
|
|
540
540
|
//#region src/navigate/store.ts
|
|
541
|
-
function
|
|
541
|
+
function k() {
|
|
542
542
|
return e((e) => ({
|
|
543
543
|
status: "IDLE",
|
|
544
544
|
transitionTaskId: null,
|
|
@@ -548,11 +548,11 @@ function re() {
|
|
|
548
548
|
}
|
|
549
549
|
//#endregion
|
|
550
550
|
//#region src/navigate/createNavigationController.ts
|
|
551
|
-
var
|
|
551
|
+
var A = (e, t, n) => {
|
|
552
552
|
let { regexp: r } = i(e);
|
|
553
553
|
for (let e = t - 1; e >= 0; e--) if (r.test(n[e].pathname)) return t - e;
|
|
554
554
|
return -1;
|
|
555
|
-
},
|
|
555
|
+
}, ne = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, re = async (e, t, n, r) => {
|
|
556
556
|
let i, a = new Promise((t) => {
|
|
557
557
|
i = e.subscribe(() => t(!0));
|
|
558
558
|
}), o = new Promise((e) => setTimeout(() => e(!1), 200));
|
|
@@ -560,7 +560,7 @@ var O = (e, t, n) => {
|
|
|
560
560
|
let s = await Promise.race([a, o]);
|
|
561
561
|
i(), s && r();
|
|
562
562
|
};
|
|
563
|
-
function
|
|
563
|
+
function ie(e) {
|
|
564
564
|
let { stores: t, buildPathname: n, driver: r = h(), markSelfInduced: i = v } = e, s = () => t.history.getState().bumpTruncationEpoch(), c = () => {
|
|
565
565
|
let e = r.readState();
|
|
566
566
|
if (!e?.id) return null;
|
|
@@ -586,10 +586,10 @@ function ae(e) {
|
|
|
586
586
|
}
|
|
587
587
|
let o = c(), { index: d, histories: f, addHistory: g, popHistories: _ } = t.history.getState(), v = (() => {
|
|
588
588
|
if (u?.until != null) {
|
|
589
|
-
let e =
|
|
589
|
+
let e = A(u.until, d, f);
|
|
590
590
|
return e < 0 ? 0 : e;
|
|
591
591
|
}
|
|
592
|
-
return Math.min(
|
|
592
|
+
return Math.min(ne(u?.skip, 0), Math.max(0, d));
|
|
593
593
|
})(), { setStatus: y, setTransitionTaskId: b } = t.navigate.getState();
|
|
594
594
|
y("PUSHING"), b(h);
|
|
595
595
|
let { pathname: x, toPathname: S } = n(e, l ?? {}), C = {
|
|
@@ -616,7 +616,7 @@ function ae(e) {
|
|
|
616
616
|
return g({
|
|
617
617
|
...C,
|
|
618
618
|
frameIndex: T + 1
|
|
619
|
-
}), await
|
|
619
|
+
}), await re(r, i, v, () => {
|
|
620
620
|
s(), r.pushState({
|
|
621
621
|
id: h,
|
|
622
622
|
index: T + 1,
|
|
@@ -646,10 +646,10 @@ function ae(e) {
|
|
|
646
646
|
}
|
|
647
647
|
let o = c(), { index: d, histories: f, addHistory: g, replaceHistory: _, popHistories: v } = t.history.getState(), y = (() => {
|
|
648
648
|
if (u?.until != null) {
|
|
649
|
-
let e =
|
|
649
|
+
let e = A(u.until, d, f);
|
|
650
650
|
return e < 0 ? 0 : e + 1;
|
|
651
651
|
}
|
|
652
|
-
return Math.min(
|
|
652
|
+
return Math.min(ne(u?.skip, 0) + 1, d + 1);
|
|
653
653
|
})();
|
|
654
654
|
if (y <= 0) {
|
|
655
655
|
a.abort();
|
|
@@ -681,7 +681,7 @@ function ae(e) {
|
|
|
681
681
|
return v(y - 1), g({
|
|
682
682
|
...w,
|
|
683
683
|
frameIndex: E
|
|
684
|
-
}), y <= d ? await
|
|
684
|
+
}), y <= d ? await re(r, i, y, () => {
|
|
685
685
|
s(), r.pushState({
|
|
686
686
|
id: h,
|
|
687
687
|
index: E,
|
|
@@ -690,7 +690,7 @@ function ae(e) {
|
|
|
690
690
|
transitionName: p,
|
|
691
691
|
layoutId: m
|
|
692
692
|
}, S);
|
|
693
|
-
}) : await
|
|
693
|
+
}) : await re(r, i, d, () => {
|
|
694
694
|
s(), r.replaceState({
|
|
695
695
|
id: h,
|
|
696
696
|
index: E,
|
|
@@ -746,10 +746,10 @@ function ae(e) {
|
|
|
746
746
|
pop: async (e) => {
|
|
747
747
|
await d((t, n) => {
|
|
748
748
|
if (e?.until != null) {
|
|
749
|
-
let r =
|
|
749
|
+
let r = A(e.until, t, n);
|
|
750
750
|
return r < 0 ? 0 : r;
|
|
751
751
|
}
|
|
752
|
-
let r =
|
|
752
|
+
let r = ne(e?.skip, 1);
|
|
753
753
|
return r <= 0 ? 0 : Math.min(r, t);
|
|
754
754
|
}, e?.transitionName);
|
|
755
755
|
}
|
|
@@ -757,14 +757,14 @@ function ae(e) {
|
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
759
759
|
//#region src/navigate/createStepController.ts
|
|
760
|
-
var
|
|
760
|
+
var ae = (e) => {
|
|
761
761
|
let t = e;
|
|
762
762
|
return t?.step ? t.params ?? {} : null;
|
|
763
|
-
},
|
|
763
|
+
}, oe = (e, t) => {
|
|
764
764
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
765
765
|
return n ? `${e}?${n}` : e;
|
|
766
766
|
};
|
|
767
|
-
function
|
|
767
|
+
function se(e) {
|
|
768
768
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: s } = e;
|
|
769
769
|
return {
|
|
770
770
|
pushStep: async (e) => {
|
|
@@ -822,7 +822,7 @@ function ce(e) {
|
|
|
822
822
|
}
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function ce(e, t) {
|
|
826
826
|
return e.subscribe((e) => {
|
|
827
827
|
let n = e.state;
|
|
828
828
|
n?.step && o.addTask(async () => {
|
|
@@ -832,7 +832,7 @@ function le(e, t) {
|
|
|
832
832
|
}
|
|
833
833
|
//#endregion
|
|
834
834
|
//#region src/transition/store.ts
|
|
835
|
-
function
|
|
835
|
+
function le(t = "cupertino") {
|
|
836
836
|
return e((e) => ({
|
|
837
837
|
defaultTransitionName: t,
|
|
838
838
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -840,12 +840,12 @@ function ue(t = "cupertino") {
|
|
|
840
840
|
}
|
|
841
841
|
//#endregion
|
|
842
842
|
//#region src/utils/matchesPathname.ts
|
|
843
|
-
function
|
|
843
|
+
function ue(e, t) {
|
|
844
844
|
return i(e).regexp.test(t);
|
|
845
845
|
}
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/screen/store.ts
|
|
848
|
-
function
|
|
848
|
+
function de() {
|
|
849
849
|
return e((e) => ({
|
|
850
850
|
dragStatus: "IDLE",
|
|
851
851
|
replaceTransitionStatus: "IDLE",
|
|
@@ -876,14 +876,14 @@ function fe() {
|
|
|
876
876
|
}
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region src/core/createRouterScope.ts
|
|
879
|
-
var
|
|
879
|
+
var fe = {
|
|
880
880
|
mark: () => {},
|
|
881
881
|
consume: () => !1
|
|
882
|
-
},
|
|
883
|
-
function
|
|
882
|
+
}, pe = /* @__PURE__ */ new Map();
|
|
883
|
+
function me(e) {
|
|
884
884
|
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: o } = e, c = d() ? void 0 : e.persistKey;
|
|
885
885
|
if (c) {
|
|
886
|
-
let e =
|
|
886
|
+
let e = pe.get(c);
|
|
887
887
|
if (e) {
|
|
888
888
|
e.life.alive = !0, e.navigate.getState().setStatus("IDLE"), e.navigate.getState().setTransitionTaskId(null);
|
|
889
889
|
let t = e.history.getState();
|
|
@@ -903,7 +903,7 @@ function he(e) {
|
|
|
903
903
|
index: 0,
|
|
904
904
|
histories: [p]
|
|
905
905
|
}), e.hostedScope;
|
|
906
|
-
let m = a ?
|
|
906
|
+
let m = a ? O({
|
|
907
907
|
state: {
|
|
908
908
|
id: p.id,
|
|
909
909
|
index: 0,
|
|
@@ -913,25 +913,25 @@ function he(e) {
|
|
|
913
913
|
layoutId: p.layoutId
|
|
914
914
|
},
|
|
915
915
|
url: p.pathname
|
|
916
|
-
}) : o, h = a ?
|
|
916
|
+
}) : o, h = a ? fe : g(), _ = {
|
|
917
917
|
history: s([p], 0),
|
|
918
|
-
navigate:
|
|
919
|
-
transition:
|
|
920
|
-
screen:
|
|
918
|
+
navigate: k(),
|
|
919
|
+
transition: le(i),
|
|
920
|
+
screen: de(),
|
|
921
921
|
driver: m,
|
|
922
922
|
markSelfInduced: h.mark,
|
|
923
923
|
consume: h.consume,
|
|
924
924
|
routerKey: e.routerKey,
|
|
925
925
|
zoneEntryId: e.zoneEntryId,
|
|
926
|
-
ownsPathname: (e) =>
|
|
926
|
+
ownsPathname: (e) => ue(t, e),
|
|
927
927
|
persistent: !!c,
|
|
928
928
|
life: { alive: !0 }
|
|
929
929
|
};
|
|
930
|
-
return c &&
|
|
930
|
+
return c && pe.set(c, _), _;
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region src/screen/createScreenSelector.ts
|
|
934
|
-
function
|
|
934
|
+
function he(e, t) {
|
|
935
935
|
return e.map((n, r) => ({
|
|
936
936
|
...n,
|
|
937
937
|
isActive: r === t,
|
|
@@ -944,13 +944,13 @@ function ge(e, t) {
|
|
|
944
944
|
}
|
|
945
945
|
//#endregion
|
|
946
946
|
//#region src/screen/computeScreenFreeze.ts
|
|
947
|
-
function
|
|
947
|
+
function ge(e) {
|
|
948
948
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
949
949
|
return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
|
|
950
950
|
}
|
|
951
951
|
//#endregion
|
|
952
952
|
//#region src/transition/createTransition.ts
|
|
953
|
-
function
|
|
953
|
+
function j({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
954
954
|
return {
|
|
955
955
|
name: e,
|
|
956
956
|
initial: t,
|
|
@@ -971,7 +971,7 @@ function A({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
971
971
|
}
|
|
972
972
|
//#endregion
|
|
973
973
|
//#region src/transition/createRawTransition.ts
|
|
974
|
-
function
|
|
974
|
+
function _e({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
975
975
|
return {
|
|
976
976
|
name: e,
|
|
977
977
|
initial: t,
|
|
@@ -992,10 +992,10 @@ function ve({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
992
992
|
}
|
|
993
993
|
//#endregion
|
|
994
994
|
//#region src/transition/cupertino.ts
|
|
995
|
-
var
|
|
995
|
+
var ve = (e, t, n) => {
|
|
996
996
|
let [r, i] = t, [a, o] = n;
|
|
997
997
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
998
|
-
},
|
|
998
|
+
}, ye = j({
|
|
999
999
|
name: "cupertino",
|
|
1000
1000
|
initial: { x: "100%" },
|
|
1001
1001
|
idle: {
|
|
@@ -1055,7 +1055,7 @@ var ye = (e, t, n) => {
|
|
|
1055
1055
|
swipeDirection: "x",
|
|
1056
1056
|
onSwipeStart: async () => !0,
|
|
1057
1057
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1058
|
-
let { offset: o } = t, s = o.x, c =
|
|
1058
|
+
let { offset: o } = t, s = o.x, c = ve(s, [0, window.innerWidth], [0, 100]);
|
|
1059
1059
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-35 + c * .35}%` }, { duration: 0 }), c;
|
|
1060
1060
|
},
|
|
1061
1061
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -1079,10 +1079,10 @@ var ye = (e, t, n) => {
|
|
|
1079
1079
|
})]), c;
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
}),
|
|
1082
|
+
}), be = (e, t, n) => {
|
|
1083
1083
|
let [r, i] = t, [a, o] = n;
|
|
1084
1084
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1085
|
-
},
|
|
1085
|
+
}, xe = j({
|
|
1086
1086
|
name: "layout",
|
|
1087
1087
|
initial: { opacity: .97 },
|
|
1088
1088
|
idle: {
|
|
@@ -1110,7 +1110,7 @@ var ye = (e, t, n) => {
|
|
|
1110
1110
|
swipeDirection: "y",
|
|
1111
1111
|
onSwipeStart: async () => !0,
|
|
1112
1112
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
1113
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
1113
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = be(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);
|
|
1114
1114
|
return i?.(!0, 100), n(r, {
|
|
1115
1115
|
y: f,
|
|
1116
1116
|
opacity: c
|
|
@@ -1127,7 +1127,7 @@ var ye = (e, t, n) => {
|
|
|
1127
1127
|
}, { duration: .3 })]), c;
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
}),
|
|
1130
|
+
}), Se = j({
|
|
1131
1131
|
name: "material",
|
|
1132
1132
|
initial: { y: "100%" },
|
|
1133
1133
|
idle: {
|
|
@@ -1235,7 +1235,7 @@ var ye = (e, t, n) => {
|
|
|
1235
1235
|
})]), c;
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
|
-
}),
|
|
1238
|
+
}), Ce = j({
|
|
1239
1239
|
name: "none",
|
|
1240
1240
|
initial: {},
|
|
1241
1241
|
idle: {
|
|
@@ -1258,16 +1258,16 @@ var ye = (e, t, n) => {
|
|
|
1258
1258
|
value: {},
|
|
1259
1259
|
options: { duration: 0 }
|
|
1260
1260
|
}
|
|
1261
|
-
}),
|
|
1262
|
-
["none",
|
|
1263
|
-
["cupertino",
|
|
1264
|
-
["material",
|
|
1265
|
-
["layout",
|
|
1261
|
+
}), M = new Map([
|
|
1262
|
+
["none", Ce],
|
|
1263
|
+
["cupertino", ye],
|
|
1264
|
+
["material", Se],
|
|
1265
|
+
["layout", xe]
|
|
1266
1266
|
]);
|
|
1267
1267
|
//#endregion
|
|
1268
1268
|
//#region src/transition/resolveTransition.ts
|
|
1269
|
-
function
|
|
1270
|
-
return
|
|
1269
|
+
function we(e) {
|
|
1270
|
+
return M.get(e) ?? M.get("none");
|
|
1271
1271
|
}
|
|
1272
1272
|
//#endregion
|
|
1273
1273
|
//#region src/transition/decorator/createDecorator.ts
|
|
@@ -1401,17 +1401,17 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1401
1401
|
"POPPING-false": "PUSHING-false",
|
|
1402
1402
|
"COMPLETED-true": "self",
|
|
1403
1403
|
"COMPLETED-false": "self"
|
|
1404
|
-
}, Ae = Object.keys(I),
|
|
1404
|
+
}, Ae = Object.keys(I), je = (e) => {
|
|
1405
1405
|
if (!e) return 0;
|
|
1406
1406
|
let t = e.duration;
|
|
1407
1407
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1408
|
-
},
|
|
1408
|
+
}, L = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Me = (e, t) => {
|
|
1409
1409
|
let n = I[t];
|
|
1410
1410
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1411
1411
|
}, R = (e, t) => {
|
|
1412
1412
|
let n = Me(e, t);
|
|
1413
1413
|
if (n === null) return null;
|
|
1414
|
-
let r = e.variants[t], i =
|
|
1414
|
+
let r = e.variants[t], i = je(r.options), a = L(r.options);
|
|
1415
1415
|
return i <= 0 && a <= 0 ? null : {
|
|
1416
1416
|
from: n,
|
|
1417
1417
|
to: r.value,
|
|
@@ -1419,7 +1419,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1419
1419
|
delay: a,
|
|
1420
1420
|
ease: r.options?.ease
|
|
1421
1421
|
};
|
|
1422
|
-
}, Ne = Ae, Pe = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Fe = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ie = 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(".")), Le = (e, t) => t.startsWith("--") || Ie.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Re = (e, t) => typeof t == "number" ? Le(t, e) : typeof t == "string" ? t : "",
|
|
1422
|
+
}, Ne = Ae, Pe = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Fe = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ie = 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(".")), Le = (e, t) => t.startsWith("--") || Ie.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Re = (e, t) => typeof t == "number" ? Le(t, e) : typeof t == "string" ? t : "", z = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), ze = new Set([
|
|
1423
1423
|
"x",
|
|
1424
1424
|
"y",
|
|
1425
1425
|
"z",
|
|
@@ -1430,7 +1430,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1430
1430
|
"rotateX",
|
|
1431
1431
|
"rotateY",
|
|
1432
1432
|
"rotateZ"
|
|
1433
|
-
]),
|
|
1433
|
+
]), Be = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, Ve = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, He = /^1(\.0+)?$/, Ue = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? He.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? Ve.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? Be.test(t.trim()) : !1, We = (e, t) => {
|
|
1434
1434
|
switch (e) {
|
|
1435
1435
|
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1436
1436
|
case "y": return `translate3d(0, ${t}, 0)`;
|
|
@@ -1444,16 +1444,16 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1444
1444
|
case "rotateY": return `rotateY(${t})`;
|
|
1445
1445
|
default: return "";
|
|
1446
1446
|
}
|
|
1447
|
-
},
|
|
1447
|
+
}, Ge = (e) => {
|
|
1448
1448
|
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1449
1449
|
if (!Fe(e)) return;
|
|
1450
1450
|
let n = [];
|
|
1451
1451
|
for (let r of Object.keys(e)) {
|
|
1452
1452
|
let i = e[r], a = Re(r, i);
|
|
1453
|
-
if (a !== "") if (
|
|
1453
|
+
if (a !== "") if (ze.has(r)) n.push(`${r}:${a}`);
|
|
1454
1454
|
else {
|
|
1455
|
-
let e = t.get(
|
|
1456
|
-
e.add(a), t.set(
|
|
1455
|
+
let e = t.get(z(r)) ?? /* @__PURE__ */ new Set();
|
|
1456
|
+
e.add(a), t.set(z(r), e);
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
1459
|
r.add(n.sort().join("|"));
|
|
@@ -1463,13 +1463,13 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1463
1463
|
n = r.size > 1;
|
|
1464
1464
|
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1465
1465
|
return n && a.push("transform"), a;
|
|
1466
|
-
},
|
|
1466
|
+
}, B = (e) => {
|
|
1467
1467
|
if (!Fe(e)) return [];
|
|
1468
1468
|
let t = [], n = !0, r = [];
|
|
1469
1469
|
for (let i of Object.keys(e)) {
|
|
1470
1470
|
let a = e[i], o = Re(i, a);
|
|
1471
|
-
o !== "" && (
|
|
1472
|
-
property:
|
|
1471
|
+
o !== "" && (ze.has(i) ? (t.push(We(i, o)), Ue(i, a) || (n = !1)) : r.push({
|
|
1472
|
+
property: z(i),
|
|
1473
1473
|
value: o
|
|
1474
1474
|
}));
|
|
1475
1475
|
}
|
|
@@ -1477,7 +1477,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1477
1477
|
property: "transform",
|
|
1478
1478
|
value: n ? "none" : t.join(" ")
|
|
1479
1479
|
}), r;
|
|
1480
|
-
},
|
|
1480
|
+
}, V = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), H = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1481
1481
|
linear: "linear",
|
|
1482
1482
|
easeIn: "ease-in",
|
|
1483
1483
|
easeOut: "ease-out",
|
|
@@ -1487,29 +1487,29 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1487
1487
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1488
1488
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1489
1489
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1490
|
-
}[e] ?? "ease" : "ease",
|
|
1490
|
+
}[e] ?? "ease" : "ease", Ke = (e, t) => {
|
|
1491
1491
|
let [n, r] = t.split("-");
|
|
1492
1492
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1493
|
-
},
|
|
1493
|
+
}, qe = (e, t) => {
|
|
1494
1494
|
let [n, r] = t.split("-");
|
|
1495
1495
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1496
|
-
},
|
|
1496
|
+
}, Je = (e, t) => {
|
|
1497
1497
|
let [n, r] = t.split("-");
|
|
1498
1498
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1499
|
-
},
|
|
1499
|
+
}, Ye = (e, t) => {
|
|
1500
1500
|
let [n, r] = t.split("-");
|
|
1501
1501
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1502
|
-
},
|
|
1503
|
-
let o =
|
|
1502
|
+
}, Xe = (e, t, n) => `flemo-${e}-${Pe(t)}-${n}`, Ze = (e, t, n, r, i, a) => {
|
|
1503
|
+
let o = B(r), s = B(i.value), c = je(i.options), l = L(i.options), u = H(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Je(t, n)}` : d;
|
|
1504
1504
|
if (s.length === 0 && o.length === 0) return "";
|
|
1505
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1506
|
-
let p =
|
|
1505
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${V(s)}\n animation: none;\n}`;
|
|
1506
|
+
let p = Xe(e, t, n), m = [
|
|
1507
1507
|
`@keyframes ${p} {`,
|
|
1508
1508
|
" from {",
|
|
1509
|
-
|
|
1509
|
+
V(o).replace(/^/gm, " "),
|
|
1510
1510
|
" }",
|
|
1511
1511
|
" to {",
|
|
1512
|
-
|
|
1512
|
+
V(s).replace(/^/gm, " "),
|
|
1513
1513
|
" }",
|
|
1514
1514
|
"}"
|
|
1515
1515
|
].join("\n"), h = [
|
|
@@ -1519,15 +1519,15 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1519
1519
|
l > 0 ? `${l}s` : null,
|
|
1520
1520
|
"both"
|
|
1521
1521
|
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1522
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") &&
|
|
1523
|
-
},
|
|
1522
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Qe(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${V(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && Qe(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${V(s)}\n}` : ""}`;
|
|
1523
|
+
}, Qe = (e) => {
|
|
1524
1524
|
if (!e) return !1;
|
|
1525
1525
|
if (e.opacity === 0) return !0;
|
|
1526
1526
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1527
1527
|
return t(e.x) || t(e.y);
|
|
1528
|
-
},
|
|
1529
|
-
let i =
|
|
1530
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1528
|
+
}, $e = (e, t, n, r) => {
|
|
1529
|
+
let i = B(r.value);
|
|
1530
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${V(i)}\n}`;
|
|
1531
1531
|
}, et = (e, t, n = []) => {
|
|
1532
1532
|
let r = [];
|
|
1533
1533
|
for (let t of e) {
|
|
@@ -1535,11 +1535,11 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1535
1535
|
for (let n of Ae) {
|
|
1536
1536
|
let i = t.variants[n], a = I[n];
|
|
1537
1537
|
if (a === "self") {
|
|
1538
|
-
r.push(
|
|
1538
|
+
r.push($e(Ke, e, n, i));
|
|
1539
1539
|
continue;
|
|
1540
1540
|
}
|
|
1541
1541
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1542
|
-
r.push(
|
|
1542
|
+
r.push(Ze("screen", e, n, o, i, Ke));
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
1545
|
for (let e of t) {
|
|
@@ -1547,11 +1547,11 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1547
1547
|
for (let n of Ne) {
|
|
1548
1548
|
let i = e.variants[n], a = I[n];
|
|
1549
1549
|
if (a === "self") {
|
|
1550
|
-
r.push(
|
|
1550
|
+
r.push($e(qe, t, n, i));
|
|
1551
1551
|
continue;
|
|
1552
1552
|
}
|
|
1553
1553
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1554
|
-
r.push(
|
|
1554
|
+
r.push(Ze("decorator", t, n, o, i, qe));
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
1557
|
for (let e of n) {
|
|
@@ -1559,11 +1559,11 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1559
1559
|
for (let n of Ne) {
|
|
1560
1560
|
let i = e.variants[n], a = I[n];
|
|
1561
1561
|
if (a === "self") {
|
|
1562
|
-
r.push(
|
|
1562
|
+
r.push($e(Ye, t, n, i));
|
|
1563
1563
|
continue;
|
|
1564
1564
|
}
|
|
1565
1565
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1566
|
-
r.push(
|
|
1566
|
+
r.push(Ze("part", t, n, o, i, Ye));
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
1569
1569
|
return [...r.filter((e) => e.length > 0), tt].join("\n\n");
|
|
@@ -1579,14 +1579,14 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1579
1579
|
].join("\n"), nt = (e, t) => {
|
|
1580
1580
|
let n = I[t];
|
|
1581
1581
|
if (n === "self") return !1;
|
|
1582
|
-
let r = e.variants[t], i =
|
|
1582
|
+
let r = e.variants[t], i = je(r.options), a = L(r.options);
|
|
1583
1583
|
if (i <= 0 && a <= 0) return !1;
|
|
1584
|
-
let o =
|
|
1584
|
+
let o = B(n === "initial" ? e.initial : e.variants[n].value), s = B(r.value);
|
|
1585
1585
|
return o.length > 0 || s.length > 0;
|
|
1586
1586
|
}, rt = "data-flemo";
|
|
1587
1587
|
function it() {
|
|
1588
1588
|
if (d()) return;
|
|
1589
|
-
let e = et(
|
|
1589
|
+
let e = et(M.values(), P.values(), F.values()), t = document.head.querySelector(`style[${rt}]`);
|
|
1590
1590
|
t || (t = document.createElement("style"), t.setAttribute(rt, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1591
1591
|
}
|
|
1592
1592
|
//#endregion
|
|
@@ -1598,11 +1598,11 @@ var at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), st = /* @__P
|
|
|
1598
1598
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1599
1599
|
};
|
|
1600
1600
|
function ut(e, t, n = []) {
|
|
1601
|
-
for (let t of e)
|
|
1601
|
+
for (let t of e) M.set(t.name, t), ct(at, t.name);
|
|
1602
1602
|
for (let e of t) P.set(e.name, e), ct(ot, e.name);
|
|
1603
1603
|
for (let e of n) F.set(e.name, e), ct(st, e.name);
|
|
1604
1604
|
return it(), () => {
|
|
1605
|
-
for (let t of e) lt(at, t.name) &&
|
|
1605
|
+
for (let t of e) lt(at, t.name) && M.delete(t.name);
|
|
1606
1606
|
for (let e of t) lt(ot, e.name) && P.delete(e.name);
|
|
1607
1607
|
for (let e of n) lt(st, e.name) && F.delete(e.name);
|
|
1608
1608
|
it();
|
|
@@ -1752,9 +1752,9 @@ var ft = () => ({
|
|
|
1752
1752
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1753
1753
|
}, q = (e, t, n = {}) => {
|
|
1754
1754
|
if (!wt(e)) return Promise.resolve();
|
|
1755
|
-
let r = e, i =
|
|
1755
|
+
let r = e, i = B(t);
|
|
1756
1756
|
if (i.length === 0) return Promise.resolve();
|
|
1757
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1757
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = H(n.ease);
|
|
1758
1758
|
if (a <= 0 && o <= 0) {
|
|
1759
1759
|
mt.takeover(r), r.style.transition = "none";
|
|
1760
1760
|
for (let e of i) r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
@@ -1981,7 +1981,7 @@ var ft = () => ({
|
|
|
1981
1981
|
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
1982
1982
|
}, Vt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), Ht = (e) => {
|
|
1983
1983
|
let t = {};
|
|
1984
|
-
for (let n of
|
|
1984
|
+
for (let n of B(e)) t[Vt(n.property)] = n.value;
|
|
1985
1985
|
return t;
|
|
1986
1986
|
}, Ut = (e, t) => {
|
|
1987
1987
|
if (typeof e.animate != "function") return null;
|
|
@@ -1989,7 +1989,7 @@ var ft = () => ({
|
|
|
1989
1989
|
let n = e.animate([Ht(t.from), Ht(t.to)], {
|
|
1990
1990
|
duration: Math.max(0, t.duration * 1e3),
|
|
1991
1991
|
delay: Math.max(0, t.delay * 1e3),
|
|
1992
|
-
easing:
|
|
1992
|
+
easing: H(t.ease),
|
|
1993
1993
|
fill: "both"
|
|
1994
1994
|
});
|
|
1995
1995
|
return n.pause(), n.currentTime = 0, n;
|
|
@@ -2098,29 +2098,30 @@ Y.onFrameGap = (e) => {
|
|
|
2098
2098
|
};
|
|
2099
2099
|
//#endregion
|
|
2100
2100
|
//#region src/core/engine/types.ts
|
|
2101
|
-
var X = "data-flemo-skip-animation", Z = () => {}, Gt = "data-flemo-part-name",
|
|
2101
|
+
var X = "data-flemo-skip-animation", Z = () => {}, Gt = "data-flemo-part-name", Q = (e) => {
|
|
2102
2102
|
let t = e.parentElement ?? e;
|
|
2103
2103
|
return Array.from(t.querySelectorAll(`[${Gt}]`)).filter((n) => {
|
|
2104
2104
|
let r = n.closest("[data-flemo-screen]");
|
|
2105
2105
|
return !r || r === e || !t.contains(r);
|
|
2106
2106
|
});
|
|
2107
|
-
},
|
|
2107
|
+
}, Kt = (e, t) => {
|
|
2108
2108
|
let [n, r] = t.split("-");
|
|
2109
|
-
return
|
|
2109
|
+
return Q(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2110
2110
|
};
|
|
2111
|
-
function
|
|
2112
|
-
|
|
2113
|
-
|
|
2111
|
+
function qt(e) {
|
|
2112
|
+
let t = /* @__PURE__ */ new Set();
|
|
2113
|
+
return { driveScreenLifecycle: (n) => {
|
|
2114
|
+
let { getElements: r, transitionName: i, prevTransitionName: a, status: s, isActive: c, animHoldReleased: l } = n, u = s === "PUSHING" || s === "POPPING" || s === "REPLACING", d = (t, n, a) => {
|
|
2114
2115
|
let s = e.getTransitionTaskId();
|
|
2115
2116
|
if (!s || o.pendingTaskIds.some((e) => e !== s) || !U.playerAllowed()) return null;
|
|
2116
|
-
let { scope: c, decorator: l, bars: u } =
|
|
2117
|
+
let { scope: c, decorator: l, bars: u } = r();
|
|
2117
2118
|
if (!c) return null;
|
|
2118
|
-
let d =
|
|
2119
|
+
let d = we(i), f = R(d, t);
|
|
2119
2120
|
if (!f) return null;
|
|
2120
2121
|
let p = [], m = Y.join(s, {
|
|
2121
2122
|
element: c,
|
|
2122
2123
|
motion: f,
|
|
2123
|
-
role:
|
|
2124
|
+
role: n,
|
|
2124
2125
|
onComplete: a
|
|
2125
2126
|
});
|
|
2126
2127
|
if (!m) return null;
|
|
@@ -2145,7 +2146,7 @@ function Jt(e) {
|
|
|
2145
2146
|
e && p.push(e);
|
|
2146
2147
|
}
|
|
2147
2148
|
}
|
|
2148
|
-
for (let e of
|
|
2149
|
+
for (let e of Kt(c, t)) {
|
|
2149
2150
|
let n = F.get(e.getAttribute(Gt)), r = n ? R(n, t) : null;
|
|
2150
2151
|
if (!r) continue;
|
|
2151
2152
|
let i = Y.join(s, {
|
|
@@ -2157,68 +2158,82 @@ function Jt(e) {
|
|
|
2157
2158
|
}
|
|
2158
2159
|
return () => p.forEach((e) => e());
|
|
2159
2160
|
};
|
|
2160
|
-
if (!
|
|
2161
|
-
if (
|
|
2162
|
-
let { scope: e, decorator: t, bars:
|
|
2161
|
+
if (!c) {
|
|
2162
|
+
if (s === "COMPLETED") {
|
|
2163
|
+
let { scope: e, decorator: t, bars: n } = r();
|
|
2163
2164
|
if (e) {
|
|
2164
2165
|
K(e);
|
|
2165
|
-
for (let t of
|
|
2166
|
+
for (let t of Q(e)) K(t);
|
|
2166
2167
|
}
|
|
2167
2168
|
t && K(t);
|
|
2168
|
-
for (let e of
|
|
2169
|
+
for (let e of n ?? []) e && K(e);
|
|
2169
2170
|
return Z;
|
|
2170
2171
|
}
|
|
2171
|
-
if (
|
|
2172
|
-
let e =
|
|
2172
|
+
if (s === "REPLACING" && a !== i && e.setReplaceTransitionStatus("PENDING"), u && l) {
|
|
2173
|
+
let e = d(`${s}-false`, "passive");
|
|
2173
2174
|
if (e) return e;
|
|
2174
2175
|
}
|
|
2175
2176
|
return Z;
|
|
2176
2177
|
}
|
|
2177
|
-
if (
|
|
2178
|
+
if (s === "COMPLETED") {
|
|
2178
2179
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
2179
|
-
let { scope: t, decorator:
|
|
2180
|
+
let { scope: t, decorator: n, bars: i } = r();
|
|
2180
2181
|
if (t) {
|
|
2181
2182
|
K(t), t.removeAttribute(X);
|
|
2182
|
-
for (let e of
|
|
2183
|
+
for (let e of Q(t)) K(e);
|
|
2183
2184
|
}
|
|
2184
|
-
|
|
2185
|
+
n && (K(n), n.removeAttribute(X));
|
|
2185
2186
|
for (let e of i ?? []) e && (K(e), e.style.removeProperty("will-change"));
|
|
2186
2187
|
return Z;
|
|
2187
2188
|
}
|
|
2188
|
-
if (
|
|
2189
|
-
let { scope:
|
|
2190
|
-
if (!
|
|
2191
|
-
let
|
|
2189
|
+
if (s === "IDLE") return Z;
|
|
2190
|
+
let { scope: f } = r();
|
|
2191
|
+
if (!f) return Z;
|
|
2192
|
+
let p = () => {
|
|
2192
2193
|
let t = e.getTransitionTaskId();
|
|
2193
2194
|
t && o.resolveTask(t);
|
|
2194
|
-
},
|
|
2195
|
-
if (!(!
|
|
2196
|
-
let
|
|
2197
|
-
|
|
2195
|
+
}, m = we(i), h = `${s}-true`, g = f.getAttribute(X) === "true";
|
|
2196
|
+
if (!(!g && nt(m, h))) return queueMicrotask(p), Z;
|
|
2197
|
+
let _ = R(m, h), v = !g && !!_, y = Xe("screen", i, h), b, x = () => {
|
|
2198
|
+
b !== void 0 && (clearTimeout(b), b = void 0);
|
|
2199
|
+
}, S = (e) => {
|
|
2200
|
+
e.target === f && e.animationName === y && (f.removeEventListener("animationend", S), x(), p());
|
|
2198
2201
|
};
|
|
2199
|
-
|
|
2200
|
-
let
|
|
2201
|
-
|
|
2202
|
-
|
|
2202
|
+
f.addEventListener("animationend", S);
|
|
2203
|
+
let C = v && l ? d(h, "active", p) : null, w = e.getTransitionTaskId(), T = (_.delay + _.duration) * 1e3, E = T + 1500, D = w ? setTimeout(() => void o.resolveTask(w), E) : void 0, ee = T + 250, te = () => {
|
|
2204
|
+
x(), b = setTimeout(O, ee);
|
|
2205
|
+
}, O = () => {
|
|
2206
|
+
if (x(), w) {
|
|
2207
|
+
if (e.getTransitionTaskId() === w && f.isConnected && f.getAttribute("data-flemo-skip-animation") !== "true" && nt(m, h) && !t.has(w)) {
|
|
2208
|
+
t.add(w), f.style.animation = "none", f.offsetWidth, f.style.removeProperty("animation"), te();
|
|
2209
|
+
return;
|
|
2210
|
+
}
|
|
2211
|
+
p();
|
|
2212
|
+
}
|
|
2213
|
+
}, k = (e) => {
|
|
2214
|
+
e.target === f && e.animationName === y && O();
|
|
2215
|
+
}, A = !C && l;
|
|
2216
|
+
return A && (f.addEventListener("animationcancel", k), te()), () => {
|
|
2217
|
+
D !== void 0 && clearTimeout(D), f.removeEventListener("animationend", S), A && f.removeEventListener("animationcancel", k), x(), C?.();
|
|
2203
2218
|
};
|
|
2204
2219
|
} };
|
|
2205
2220
|
}
|
|
2206
2221
|
//#endregion
|
|
2207
2222
|
//#region src/utils/findScrollable.ts
|
|
2208
|
-
function
|
|
2209
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
2223
|
+
function Jt(e, t) {
|
|
2224
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Yt(e);
|
|
2210
2225
|
if (!o) return {
|
|
2211
2226
|
element: null,
|
|
2212
2227
|
hasMarker: !1
|
|
2213
2228
|
};
|
|
2214
2229
|
let s = o.closest?.(r);
|
|
2215
|
-
if (s instanceof HTMLElement &&
|
|
2230
|
+
if (s instanceof HTMLElement && $(s, n) && (!a || Xt(s, n))) return {
|
|
2216
2231
|
element: s,
|
|
2217
2232
|
hasMarker: !0
|
|
2218
2233
|
};
|
|
2219
2234
|
let c = o, l = 0;
|
|
2220
2235
|
for (; c && l < i;) {
|
|
2221
|
-
if (
|
|
2236
|
+
if ($(c, n) && (!a || Xt(c, n))) return {
|
|
2222
2237
|
element: c,
|
|
2223
2238
|
hasMarker: !1
|
|
2224
2239
|
};
|
|
@@ -2229,7 +2244,7 @@ function Yt(e, t) {
|
|
|
2229
2244
|
hasMarker: !1
|
|
2230
2245
|
};
|
|
2231
2246
|
}
|
|
2232
|
-
function
|
|
2247
|
+
function Yt(e) {
|
|
2233
2248
|
if (!e) return null;
|
|
2234
2249
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2235
2250
|
if (n && n.length) {
|
|
@@ -2237,11 +2252,11 @@ function Xt(e) {
|
|
|
2237
2252
|
}
|
|
2238
2253
|
return e instanceof HTMLElement ? e : null;
|
|
2239
2254
|
}
|
|
2240
|
-
function
|
|
2255
|
+
function $(e, t) {
|
|
2241
2256
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2242
2257
|
}
|
|
2243
|
-
function
|
|
2244
|
-
if (
|
|
2258
|
+
function Xt(e, t) {
|
|
2259
|
+
if (!$(e, t) || typeof window > "u") return !1;
|
|
2245
2260
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2246
2261
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2247
2262
|
}
|
|
@@ -2310,7 +2325,7 @@ function Qt(e) {
|
|
|
2310
2325
|
current: i,
|
|
2311
2326
|
prev: s
|
|
2312
2327
|
};
|
|
2313
|
-
let c =
|
|
2328
|
+
let c = Ge(e.getTransition()).join(", ");
|
|
2314
2329
|
for (let e of i) e.style.willChange = c;
|
|
2315
2330
|
for (let e of s) e.style.willChange = c;
|
|
2316
2331
|
}, b = () => {
|
|
@@ -2425,10 +2440,10 @@ function Qt(e) {
|
|
|
2425
2440
|
};
|
|
2426
2441
|
return {
|
|
2427
2442
|
pointerDown: (t) => {
|
|
2428
|
-
e.isReadyForDrag() && (f =
|
|
2443
|
+
e.isReadyForDrag() && (f = Jt(t.target, {
|
|
2429
2444
|
direction: "x",
|
|
2430
2445
|
verifyByScroll: !0
|
|
2431
|
-
}), p =
|
|
2446
|
+
}), p = Jt(t.target, {
|
|
2432
2447
|
direction: "y",
|
|
2433
2448
|
verifyByScroll: !0
|
|
2434
2449
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -2481,7 +2496,7 @@ function an(e) {
|
|
|
2481
2496
|
function on(e, t = {}) {
|
|
2482
2497
|
let n = !1, r = 0, i = [], a = () => {
|
|
2483
2498
|
let r = t.scope;
|
|
2484
|
-
if (!r || typeof r.querySelectorAll != "function") {
|
|
2499
|
+
if (t.decodeWait === !1 || !r || typeof r.querySelectorAll != "function") {
|
|
2485
2500
|
e();
|
|
2486
2501
|
return;
|
|
2487
2502
|
}
|
|
@@ -2515,8 +2530,7 @@ function sn(e, t = {}) {
|
|
|
2515
2530
|
n(), clearTimeout(r);
|
|
2516
2531
|
};
|
|
2517
2532
|
}
|
|
2518
|
-
|
|
2519
|
-
function ln() {
|
|
2533
|
+
function cn() {
|
|
2520
2534
|
let e = /* @__PURE__ */ new Map(), t = (t, n) => {
|
|
2521
2535
|
clearTimeout(n.backstop), e.delete(t);
|
|
2522
2536
|
let r = [...n.members];
|
|
@@ -2524,7 +2538,6 @@ function ln() {
|
|
|
2524
2538
|
for (let e of r) e.cancelReadiness(), e.release();
|
|
2525
2539
|
}, n = (e) => [...e.members].every((e) => e.ready);
|
|
2526
2540
|
return { join: (r, i, a) => {
|
|
2527
|
-
if (!r.startsWith(cn)) return sn(i, a);
|
|
2528
2541
|
let o = e.get(r);
|
|
2529
2542
|
if (!o) {
|
|
2530
2543
|
let n = {
|
|
@@ -2553,7 +2566,7 @@ function ln() {
|
|
|
2553
2566
|
}
|
|
2554
2567
|
//#endregion
|
|
2555
2568
|
//#region src/screen/observeBarHeight.ts
|
|
2556
|
-
function
|
|
2569
|
+
function ln(e, t) {
|
|
2557
2570
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
2558
2571
|
let n = new ResizeObserver(([e]) => {
|
|
2559
2572
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -2564,14 +2577,14 @@ function un(e, t) {
|
|
|
2564
2577
|
}
|
|
2565
2578
|
//#endregion
|
|
2566
2579
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
2567
|
-
var
|
|
2568
|
-
function
|
|
2580
|
+
var un = 0;
|
|
2581
|
+
function dn(e) {
|
|
2569
2582
|
let t = 0, n = () => {
|
|
2570
2583
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
2571
2584
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
2572
2585
|
t = t < 0 ? 0 : t;
|
|
2573
|
-
let n = t -
|
|
2574
|
-
n = n < 0 ? 0 : n,
|
|
2586
|
+
let n = t - un;
|
|
2587
|
+
n = n < 0 ? 0 : n, un ||= t, e(t, n);
|
|
2575
2588
|
});
|
|
2576
2589
|
};
|
|
2577
2590
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -2580,7 +2593,7 @@ function fn(e) {
|
|
|
2580
2593
|
}
|
|
2581
2594
|
//#endregion
|
|
2582
2595
|
//#region src/utils/isOpaqueColor.ts
|
|
2583
|
-
function
|
|
2596
|
+
function fn(e) {
|
|
2584
2597
|
let t = e.trim().toLowerCase();
|
|
2585
2598
|
if (t === "transparent" || t === "") return !1;
|
|
2586
2599
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -2591,7 +2604,7 @@ function pn(e) {
|
|
|
2591
2604
|
}
|
|
2592
2605
|
//#endregion
|
|
2593
2606
|
//#region src/utils/buildRoutePath.ts
|
|
2594
|
-
function
|
|
2607
|
+
function pn(e, n) {
|
|
2595
2608
|
let i = n ?? {}, a = t(e)(Object.fromEntries(Object.entries(i).map(([e, t]) => [e, String(t)]))), o = (typeof e == "string" ? r(e) : e).tokens.filter((e) => e.type === "param").map((e) => e.name), s = Object.fromEntries(Object.entries(i).filter(([e]) => !o.includes(e))), c = new URLSearchParams(s).toString();
|
|
2596
2609
|
return {
|
|
2597
2610
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -2599,4 +2612,4 @@ function mn(e, n) {
|
|
|
2599
2612
|
};
|
|
2600
2613
|
}
|
|
2601
2614
|
//#endregion
|
|
2602
|
-
export { tn as ANIM_HOLD_RELEASE_BACKSTOP_MS, X as SKIP_ANIMATION_ATTR, o as TaskManger, en as animHoldKey, q as animateInline,
|
|
2615
|
+
export { tn as ANIM_HOLD_RELEASE_BACKSTOP_MS, X as SKIP_ANIMATION_ATTR, o as TaskManger, en as animHoldKey, q as animateInline, Xe as animationName, oe as appendParamsQuery, it as applyTransitionStyles, pn as buildRoutePath, Xt as canProgrammaticallyScroll, K as clearInlineAnimation, Ge as collectAnimatedProperties, et as compileTransitionStyles, $t as computeBarRiding, ge as computeScreenFreeze, y as consumeSelfInducedPop, cn as createAnimHoldCoordinator, h as createBrowserHistoryDriver, Te as createDecorator, s as createHistoryStore, b as createHistorySync, O as createMemoryHistoryDriver, k as createNavigateStore, ie as createNavigationController, Oe as createPartTransition, Ee as createRawDecorator, ke as createRawPartTransition, _e as createRawTransition, me as createRouterScope, he as createScreenSelector, de as createScreenStore, g as createSelfPopGuard, se as createStepController, Qt as createSwipeController, j as createTransition, qt as createTransitionEngine, le as createTransitionStore, ye as cupertino, P as decoratorMap, an as eagerlyDecodeImages, H as easingToCss, ee as ensureScopeHistorySync, f as ensureWindowHistoryState, dt as enteringInitialStyle, Jt as findScrollable, c as getMatchedPathPattern, l as getParams, fn as isOpaqueColor, d as isServer, xe as layout, v as markSelfInducedPop, ue as matchesPathname, Se as material, Ce as none, ln as observeBarHeight, dn as observeViewportScrollHeight, $ as overflowsAxis, De as overlay, F as partTransitionMap, ae as readStepParams, ut as registerTransitionDefinitions, te as releaseScopeHistorySync, we as resolveTransition, sn as scheduleAnimHoldRelease, u as seedInitialHistory, p as seedRouterEntry, ce as subscribeStepParamsRestore, B as targetToDecls, M as transitionMap, nt as variantHasAnimation };
|
|
@@ -12,6 +12,7 @@ export declare function eagerlyDecodeImages(scope: HTMLElement | null): void;
|
|
|
12
12
|
export interface AnimHoldReleaseOptions {
|
|
13
13
|
extraFrames?: number;
|
|
14
14
|
scope?: HTMLElement | null;
|
|
15
|
+
decodeWait?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare function scheduleAnimHoldReadiness(onReady: () => void, options?: AnimHoldReleaseOptions): () => void;
|
|
17
18
|
export declare function scheduleAnimHoldRelease(release: () => void, options?: AnimHoldReleaseOptions): () => void;
|
package/package.json
CHANGED