@flemo/core 1.12.1 → 1.13.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/core/engine/__tests__/driverPolicy.test.d.ts +1 -0
- package/dist/core/engine/__tests__/transitionPlayer.test.d.ts +1 -0
- package/dist/core/engine/driverPolicy.d.ts +18 -0
- package/dist/core/engine/transitionPlayer.d.ts +30 -0
- package/dist/core/engine/types.d.ts +1 -0
- package/dist/index.mjs +609 -190
- package/dist/screen/animStartAnchor.d.ts +1 -0
- package/dist/transition/__tests__/cubicBezier.test.d.ts +1 -0
- package/dist/transition/__tests__/variantMotion.test.d.ts +1 -0
- package/dist/transition/animateInline.d.ts +1 -0
- package/dist/transition/cubicBezier.d.ts +4 -0
- package/dist/transition/variantMotion.d.ts +16 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -552,7 +552,7 @@ var O = (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
|
-
}, k = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t,
|
|
555
|
+
}, k = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, ie = 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 ae(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;
|
|
@@ -616,7 +616,7 @@ function ie(e) {
|
|
|
616
616
|
return g({
|
|
617
617
|
...C,
|
|
618
618
|
frameIndex: T + 1
|
|
619
|
-
}), await
|
|
619
|
+
}), await ie(r, i, v, () => {
|
|
620
620
|
s(), r.pushState({
|
|
621
621
|
id: h,
|
|
622
622
|
index: T + 1,
|
|
@@ -681,7 +681,7 @@ function ie(e) {
|
|
|
681
681
|
return v(y - 1), g({
|
|
682
682
|
...w,
|
|
683
683
|
frameIndex: E
|
|
684
|
-
}), y <= d ? await
|
|
684
|
+
}), y <= d ? await ie(r, i, y, () => {
|
|
685
685
|
s(), r.pushState({
|
|
686
686
|
id: h,
|
|
687
687
|
index: E,
|
|
@@ -690,7 +690,7 @@ function ie(e) {
|
|
|
690
690
|
transitionName: p,
|
|
691
691
|
layoutId: m
|
|
692
692
|
}, S);
|
|
693
|
-
}) : await
|
|
693
|
+
}) : await ie(r, i, d, () => {
|
|
694
694
|
s(), r.replaceState({
|
|
695
695
|
id: h,
|
|
696
696
|
index: E,
|
|
@@ -757,14 +757,14 @@ function ie(e) {
|
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
759
759
|
//#region src/navigate/createStepController.ts
|
|
760
|
-
var
|
|
760
|
+
var oe = (e) => {
|
|
761
761
|
let t = e;
|
|
762
762
|
return t?.step ? t.params ?? {} : null;
|
|
763
|
-
},
|
|
763
|
+
}, se = (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 ce(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 se(e) {
|
|
|
822
822
|
}
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function le(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 ce(e, t) {
|
|
|
832
832
|
}
|
|
833
833
|
//#endregion
|
|
834
834
|
//#region src/transition/store.ts
|
|
835
|
-
function
|
|
835
|
+
function ue(t = "cupertino") {
|
|
836
836
|
return e((e) => ({
|
|
837
837
|
defaultTransitionName: t,
|
|
838
838
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -840,12 +840,12 @@ function le(t = "cupertino") {
|
|
|
840
840
|
}
|
|
841
841
|
//#endregion
|
|
842
842
|
//#region src/utils/matchesPathname.ts
|
|
843
|
-
function
|
|
843
|
+
function de(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 fe() {
|
|
849
849
|
return e((e) => ({
|
|
850
850
|
dragStatus: "IDLE",
|
|
851
851
|
replaceTransitionStatus: "IDLE",
|
|
@@ -876,14 +876,14 @@ function de() {
|
|
|
876
876
|
}
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region src/core/createRouterScope.ts
|
|
879
|
-
var
|
|
879
|
+
var pe = {
|
|
880
880
|
mark: () => {},
|
|
881
881
|
consume: () => !1
|
|
882
|
-
},
|
|
883
|
-
function
|
|
882
|
+
}, me = /* @__PURE__ */ new Map();
|
|
883
|
+
function he(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 = me.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();
|
|
@@ -913,25 +913,25 @@ function me(e) {
|
|
|
913
913
|
layoutId: p.layoutId
|
|
914
914
|
},
|
|
915
915
|
url: p.pathname
|
|
916
|
-
}) : o, h = a ?
|
|
916
|
+
}) : o, h = a ? pe : g(), _ = {
|
|
917
917
|
history: s([p], 0),
|
|
918
918
|
navigate: re(),
|
|
919
|
-
transition:
|
|
920
|
-
screen:
|
|
919
|
+
transition: ue(i),
|
|
920
|
+
screen: fe(),
|
|
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) => de(t, e),
|
|
927
927
|
persistent: !!c,
|
|
928
928
|
life: { alive: !0 }
|
|
929
929
|
};
|
|
930
|
-
return c &&
|
|
930
|
+
return c && me.set(c, _), _;
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region src/screen/createScreenSelector.ts
|
|
934
|
-
function
|
|
934
|
+
function ge(e, t) {
|
|
935
935
|
return e.map((n, r) => ({
|
|
936
936
|
...n,
|
|
937
937
|
isActive: r === t,
|
|
@@ -944,13 +944,13 @@ function he(e, t) {
|
|
|
944
944
|
}
|
|
945
945
|
//#endregion
|
|
946
946
|
//#region src/screen/computeScreenFreeze.ts
|
|
947
|
-
function
|
|
947
|
+
function _e(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 A({ 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 j({ 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 ve({ 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 _e({ 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 ye = (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
|
+
}, be = A({
|
|
999
999
|
name: "cupertino",
|
|
1000
1000
|
initial: { x: "100%" },
|
|
1001
1001
|
idle: {
|
|
@@ -1005,7 +1005,7 @@ var ve = (e, t, n) => {
|
|
|
1005
1005
|
enter: {
|
|
1006
1006
|
value: { x: 0 },
|
|
1007
1007
|
options: {
|
|
1008
|
-
duration: .
|
|
1008
|
+
duration: .6,
|
|
1009
1009
|
ease: [
|
|
1010
1010
|
.32,
|
|
1011
1011
|
.72,
|
|
@@ -1027,9 +1027,9 @@ var ve = (e, t, n) => {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
},
|
|
1029
1029
|
exit: {
|
|
1030
|
-
value: { x: "-
|
|
1030
|
+
value: { x: "-35%" },
|
|
1031
1031
|
options: {
|
|
1032
|
-
duration: .
|
|
1032
|
+
duration: .6,
|
|
1033
1033
|
ease: [
|
|
1034
1034
|
.32,
|
|
1035
1035
|
.72,
|
|
@@ -1055,8 +1055,8 @@ var ve = (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 =
|
|
1059
|
-
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-
|
|
1058
|
+
let { offset: o } = t, s = o.x, c = ye(s, [0, window.innerWidth], [0, 100]);
|
|
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 }) => {
|
|
1062
1062
|
let { offset: o, velocity: s } = t, c = o.x > 50 || s.x > 20;
|
|
@@ -1068,7 +1068,7 @@ var ve = (e, t, n) => {
|
|
|
1068
1068
|
0,
|
|
1069
1069
|
1
|
|
1070
1070
|
]
|
|
1071
|
-
}), n(i, { x: c ? 0 : "-
|
|
1071
|
+
}), n(i, { x: c ? 0 : "-35%" }, {
|
|
1072
1072
|
duration: .3,
|
|
1073
1073
|
ease: [
|
|
1074
1074
|
.32,
|
|
@@ -1079,10 +1079,10 @@ var ve = (e, t, n) => {
|
|
|
1079
1079
|
})]), c;
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
}),
|
|
1082
|
+
}), xe = (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
|
+
}, Se = A({
|
|
1086
1086
|
name: "layout",
|
|
1087
1087
|
initial: { opacity: .97 },
|
|
1088
1088
|
idle: {
|
|
@@ -1110,7 +1110,7 @@ var ve = (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 = xe(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 ve = (e, t, n) => {
|
|
|
1127
1127
|
}, { duration: .3 })]), c;
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
}),
|
|
1130
|
+
}), Ce = A({
|
|
1131
1131
|
name: "material",
|
|
1132
1132
|
initial: { y: "100%" },
|
|
1133
1133
|
idle: {
|
|
@@ -1235,7 +1235,7 @@ var ve = (e, t, n) => {
|
|
|
1235
1235
|
})]), c;
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
|
-
}),
|
|
1238
|
+
}), we = A({
|
|
1239
1239
|
name: "none",
|
|
1240
1240
|
initial: {},
|
|
1241
1241
|
idle: {
|
|
@@ -1258,16 +1258,16 @@ var ve = (e, t, n) => {
|
|
|
1258
1258
|
value: {},
|
|
1259
1259
|
options: { duration: 0 }
|
|
1260
1260
|
}
|
|
1261
|
-
}),
|
|
1262
|
-
["none",
|
|
1263
|
-
["cupertino",
|
|
1264
|
-
["material",
|
|
1265
|
-
["layout",
|
|
1261
|
+
}), j = new Map([
|
|
1262
|
+
["none", we],
|
|
1263
|
+
["cupertino", be],
|
|
1264
|
+
["material", Ce],
|
|
1265
|
+
["layout", Se]
|
|
1266
1266
|
]);
|
|
1267
1267
|
//#endregion
|
|
1268
1268
|
//#region src/transition/resolveTransition.ts
|
|
1269
|
-
function
|
|
1270
|
-
return
|
|
1269
|
+
function M(e) {
|
|
1270
|
+
return j.get(e) ?? j.get("none");
|
|
1271
1271
|
}
|
|
1272
1272
|
//#endregion
|
|
1273
1273
|
//#region src/transition/decorator/createDecorator.ts
|
|
@@ -1313,7 +1313,7 @@ function Ee({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1313
1313
|
}
|
|
1314
1314
|
//#endregion
|
|
1315
1315
|
//#region src/transition/decorator/overlay.ts
|
|
1316
|
-
var N = "rgba(0, 0, 0, 0.
|
|
1316
|
+
var N = "rgba(0, 0, 0, 0.2)", De = Te({
|
|
1317
1317
|
name: "overlay",
|
|
1318
1318
|
initial: {
|
|
1319
1319
|
opacity: 0,
|
|
@@ -1331,7 +1331,7 @@ var N = "rgba(0, 0, 0, 0.3)", De = Te({
|
|
|
1331
1331
|
opacity: 1,
|
|
1332
1332
|
backgroundColor: N
|
|
1333
1333
|
},
|
|
1334
|
-
options: { duration: .
|
|
1334
|
+
options: { duration: .6 }
|
|
1335
1335
|
},
|
|
1336
1336
|
exit: {
|
|
1337
1337
|
value: {
|
|
@@ -1401,7 +1401,25 @@ 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), L = (e) => {
|
|
1405
|
+
if (!e) return 0;
|
|
1406
|
+
let t = e.duration;
|
|
1407
|
+
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1408
|
+
}, R = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, je = (e, t) => {
|
|
1409
|
+
let n = I[t];
|
|
1410
|
+
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1411
|
+
}, z = (e, t) => {
|
|
1412
|
+
let n = je(e, t);
|
|
1413
|
+
if (n === null) return null;
|
|
1414
|
+
let r = e.variants[t], i = L(r.options), a = R(r.options);
|
|
1415
|
+
return i <= 0 && a <= 0 ? null : {
|
|
1416
|
+
from: n,
|
|
1417
|
+
to: r.value,
|
|
1418
|
+
duration: i,
|
|
1419
|
+
delay: a,
|
|
1420
|
+
ease: r.options?.ease
|
|
1421
|
+
};
|
|
1422
|
+
}, Me = Ae, Ne = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Pe = (e) => typeof e == "object" && !!e && !Array.isArray(e), Fe = 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(".")), Ie = (e, t) => t.startsWith("--") || Fe.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Le = (e, t) => typeof t == "number" ? Ie(t, e) : typeof t == "string" ? t : "", Re = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), ze = new Set([
|
|
1405
1423
|
"x",
|
|
1406
1424
|
"y",
|
|
1407
1425
|
"z",
|
|
@@ -1412,10 +1430,10 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1412
1430
|
"rotateX",
|
|
1413
1431
|
"rotateY",
|
|
1414
1432
|
"rotateZ"
|
|
1415
|
-
]),
|
|
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) => {
|
|
1416
1434
|
switch (e) {
|
|
1417
|
-
case "x": return `
|
|
1418
|
-
case "y": return `
|
|
1435
|
+
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1436
|
+
case "y": return `translate3d(0, ${t}, 0)`;
|
|
1419
1437
|
case "z": return `translateZ(${t})`;
|
|
1420
1438
|
case "scale": return `scale(${t})`;
|
|
1421
1439
|
case "scaleX": return `scaleX(${t})`;
|
|
@@ -1426,23 +1444,32 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1426
1444
|
case "rotateY": return `rotateY(${t})`;
|
|
1427
1445
|
default: return "";
|
|
1428
1446
|
}
|
|
1429
|
-
},
|
|
1430
|
-
let t = /* @__PURE__ */ new
|
|
1431
|
-
if (
|
|
1432
|
-
|
|
1433
|
-
|
|
1447
|
+
}, Ge = (e) => {
|
|
1448
|
+
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1449
|
+
if (!Pe(e)) return;
|
|
1450
|
+
let n = [];
|
|
1451
|
+
for (let r of Object.keys(e)) {
|
|
1452
|
+
let i = e[r], a = Le(r, i);
|
|
1453
|
+
if (a !== "") if (ze.has(r)) n.push(`${r}:${a}`);
|
|
1454
|
+
else {
|
|
1455
|
+
let e = t.get(Re(r)) ?? /* @__PURE__ */ new Set();
|
|
1456
|
+
e.add(a), t.set(Re(r), e);
|
|
1457
|
+
}
|
|
1434
1458
|
}
|
|
1459
|
+
r.add(n.sort().join("|"));
|
|
1435
1460
|
};
|
|
1436
|
-
|
|
1437
|
-
for (let t of Object.values(e.variants))
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1461
|
+
i(e.initial);
|
|
1462
|
+
for (let t of Object.values(e.variants)) i(t.value);
|
|
1463
|
+
n = r.size > 1;
|
|
1464
|
+
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1465
|
+
return n && a.push("transform"), a;
|
|
1466
|
+
}, B = (e) => {
|
|
1467
|
+
if (!Pe(e)) return [];
|
|
1441
1468
|
let t = [], n = !0, r = [];
|
|
1442
1469
|
for (let i of Object.keys(e)) {
|
|
1443
|
-
let a = e[i], o =
|
|
1444
|
-
o !== "" && (
|
|
1445
|
-
property:
|
|
1470
|
+
let a = e[i], o = Le(i, a);
|
|
1471
|
+
o !== "" && (ze.has(i) ? (t.push(We(i, o)), Ue(i, a) || (n = !1)) : r.push({
|
|
1472
|
+
property: Re(i),
|
|
1446
1473
|
value: o
|
|
1447
1474
|
}));
|
|
1448
1475
|
}
|
|
@@ -1450,7 +1477,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1450
1477
|
property: "transform",
|
|
1451
1478
|
value: n ? "none" : t.join(" ")
|
|
1452
1479
|
}), r;
|
|
1453
|
-
},
|
|
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" ? {
|
|
1454
1481
|
linear: "linear",
|
|
1455
1482
|
easeIn: "ease-in",
|
|
1456
1483
|
easeOut: "ease-out",
|
|
@@ -1460,33 +1487,29 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1460
1487
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1461
1488
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1462
1489
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1463
|
-
}[e] ?? "ease" : "ease",
|
|
1464
|
-
if (!e) return 0;
|
|
1465
|
-
let t = e.duration;
|
|
1466
|
-
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1467
|
-
}, Ke = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, qe = (e, t) => {
|
|
1490
|
+
}[e] ?? "ease" : "ease", Ke = (e, t) => {
|
|
1468
1491
|
let [n, r] = t.split("-");
|
|
1469
1492
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1470
|
-
},
|
|
1493
|
+
}, qe = (e, t) => {
|
|
1471
1494
|
let [n, r] = t.split("-");
|
|
1472
1495
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1473
|
-
},
|
|
1496
|
+
}, Je = (e, t) => {
|
|
1474
1497
|
let [n, r] = t.split("-");
|
|
1475
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"]`;
|
|
1476
|
-
},
|
|
1499
|
+
}, Ye = (e, t) => {
|
|
1477
1500
|
let [n, r] = t.split("-");
|
|
1478
1501
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1479
|
-
},
|
|
1480
|
-
let o =
|
|
1502
|
+
}, Xe = (e, t, n) => `flemo-${e}-${Ne(t)}-${n}`, Ze = (e, t, n, r, i, a) => {
|
|
1503
|
+
let o = B(r), s = B(i.value), c = L(i.options), l = R(i.options), u = H(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Je(t, n)}` : d;
|
|
1481
1504
|
if (s.length === 0 && o.length === 0) return "";
|
|
1482
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1483
|
-
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 = [
|
|
1484
1507
|
`@keyframes ${p} {`,
|
|
1485
1508
|
" from {",
|
|
1486
|
-
|
|
1509
|
+
V(o).replace(/^/gm, " "),
|
|
1487
1510
|
" }",
|
|
1488
1511
|
" to {",
|
|
1489
|
-
|
|
1512
|
+
V(s).replace(/^/gm, " "),
|
|
1490
1513
|
" }",
|
|
1491
1514
|
"}"
|
|
1492
1515
|
].join("\n"), h = [
|
|
@@ -1495,133 +1518,135 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1495
1518
|
u,
|
|
1496
1519
|
l > 0 ? `${l}s` : null,
|
|
1497
1520
|
"both"
|
|
1498
|
-
].filter(Boolean).join(" "), g =
|
|
1499
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${
|
|
1500
|
-
},
|
|
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") && 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) => {
|
|
1501
1524
|
if (!e) return !1;
|
|
1502
1525
|
if (e.opacity === 0) return !0;
|
|
1503
1526
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1504
1527
|
return t(e.x) || t(e.y);
|
|
1505
|
-
},
|
|
1506
|
-
let i =
|
|
1507
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1508
|
-
},
|
|
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
|
+
}, et = (e, t, n = []) => {
|
|
1509
1532
|
let r = [];
|
|
1510
1533
|
for (let t of e) {
|
|
1511
1534
|
let e = t.name;
|
|
1512
1535
|
for (let n of Ae) {
|
|
1513
1536
|
let i = t.variants[n], a = I[n];
|
|
1514
1537
|
if (a === "self") {
|
|
1515
|
-
r.push(
|
|
1538
|
+
r.push($e(Ke, e, n, i));
|
|
1516
1539
|
continue;
|
|
1517
1540
|
}
|
|
1518
1541
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1519
|
-
r.push(
|
|
1542
|
+
r.push(Ze("screen", e, n, o, i, Ke));
|
|
1520
1543
|
}
|
|
1521
1544
|
}
|
|
1522
1545
|
for (let e of t) {
|
|
1523
1546
|
let t = e.name;
|
|
1524
|
-
for (let n of
|
|
1547
|
+
for (let n of Me) {
|
|
1525
1548
|
let i = e.variants[n], a = I[n];
|
|
1526
1549
|
if (a === "self") {
|
|
1527
|
-
r.push(
|
|
1550
|
+
r.push($e(qe, t, n, i));
|
|
1528
1551
|
continue;
|
|
1529
1552
|
}
|
|
1530
1553
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1531
|
-
r.push(
|
|
1554
|
+
r.push(Ze("decorator", t, n, o, i, qe));
|
|
1532
1555
|
}
|
|
1533
1556
|
}
|
|
1534
1557
|
for (let e of n) {
|
|
1535
1558
|
let t = e.name;
|
|
1536
|
-
for (let n of
|
|
1559
|
+
for (let n of Me) {
|
|
1537
1560
|
let i = e.variants[n], a = I[n];
|
|
1538
1561
|
if (a === "self") {
|
|
1539
|
-
r.push(
|
|
1562
|
+
r.push($e(Ye, t, n, i));
|
|
1540
1563
|
continue;
|
|
1541
1564
|
}
|
|
1542
1565
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1543
|
-
r.push(
|
|
1566
|
+
r.push(Ze("part", t, n, o, i, Ye));
|
|
1544
1567
|
}
|
|
1545
1568
|
}
|
|
1546
|
-
return [...r.filter((e) => e.length > 0),
|
|
1547
|
-
},
|
|
1569
|
+
return [...r.filter((e) => e.length > 0), tt].join("\n\n");
|
|
1570
|
+
}, tt = [
|
|
1548
1571
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1549
1572
|
"[data-flemo-anim-hold=\"park\"],",
|
|
1573
|
+
"[data-flemo-anim-hold=\"park-under\"],",
|
|
1550
1574
|
"[data-flemo-anim-hold=\"true\"] [data-flemo-part-name],",
|
|
1551
|
-
"[data-flemo-anim-hold=\"park\"] [data-flemo-part-name]
|
|
1575
|
+
"[data-flemo-anim-hold=\"park\"] [data-flemo-part-name],",
|
|
1576
|
+
"[data-flemo-anim-hold=\"park-under\"] [data-flemo-part-name] {",
|
|
1552
1577
|
" animation-play-state: paused !important;",
|
|
1553
1578
|
"}"
|
|
1554
|
-
].join("\n"),
|
|
1579
|
+
].join("\n"), nt = (e, t) => {
|
|
1555
1580
|
let n = I[t];
|
|
1556
1581
|
if (n === "self") return !1;
|
|
1557
|
-
let r = e.variants[t], i =
|
|
1582
|
+
let r = e.variants[t], i = L(r.options), a = R(r.options);
|
|
1558
1583
|
if (i <= 0 && a <= 0) return !1;
|
|
1559
|
-
let o =
|
|
1584
|
+
let o = B(n === "initial" ? e.initial : e.variants[n].value), s = B(r.value);
|
|
1560
1585
|
return o.length > 0 || s.length > 0;
|
|
1561
|
-
},
|
|
1562
|
-
function
|
|
1586
|
+
}, rt = "data-flemo";
|
|
1587
|
+
function it() {
|
|
1563
1588
|
if (d()) return;
|
|
1564
|
-
let e =
|
|
1565
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1589
|
+
let e = et(j.values(), P.values(), F.values()), t = document.head.querySelector(`style[${rt}]`);
|
|
1590
|
+
t || (t = document.createElement("style"), t.setAttribute(rt, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1566
1591
|
}
|
|
1567
1592
|
//#endregion
|
|
1568
1593
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1569
|
-
var
|
|
1594
|
+
var at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), st = /* @__PURE__ */ new Map(), ct = (e, t) => {
|
|
1570
1595
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1571
|
-
},
|
|
1596
|
+
}, lt = (e, t) => {
|
|
1572
1597
|
let n = (e.get(t) ?? 1) - 1;
|
|
1573
1598
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1574
1599
|
};
|
|
1575
|
-
function
|
|
1576
|
-
for (let t of e)
|
|
1577
|
-
for (let e of t) P.set(e.name, e),
|
|
1578
|
-
for (let e of n) F.set(e.name, e),
|
|
1579
|
-
return
|
|
1580
|
-
for (let t of e)
|
|
1581
|
-
for (let e of t)
|
|
1582
|
-
for (let e of n)
|
|
1583
|
-
|
|
1600
|
+
function ut(e, t, n = []) {
|
|
1601
|
+
for (let t of e) j.set(t.name, t), ct(at, t.name);
|
|
1602
|
+
for (let e of t) P.set(e.name, e), ct(ot, e.name);
|
|
1603
|
+
for (let e of n) F.set(e.name, e), ct(st, e.name);
|
|
1604
|
+
return it(), () => {
|
|
1605
|
+
for (let t of e) lt(at, t.name) && j.delete(t.name);
|
|
1606
|
+
for (let e of t) lt(ot, e.name) && P.delete(e.name);
|
|
1607
|
+
for (let e of n) lt(st, e.name) && F.delete(e.name);
|
|
1608
|
+
it();
|
|
1584
1609
|
};
|
|
1585
1610
|
}
|
|
1586
1611
|
//#endregion
|
|
1587
1612
|
//#region src/transition/enteringInitialStyle.ts
|
|
1588
|
-
function
|
|
1613
|
+
function dt(e) {
|
|
1589
1614
|
let { initial: t, isActive: n, status: r } = e;
|
|
1590
1615
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1591
1616
|
let i = {};
|
|
1592
|
-
return typeof t.x == "number" && (i.transform = `
|
|
1617
|
+
return typeof t.x == "number" && (i.transform = `translate3d(${t.x}px, 0, 0)`), typeof t.x == "string" && (i.transform = `translate3d(${t.x}, 0, 0)`), typeof t.y == "number" && (i.transform = `translate3d(0, ${t.y}px, 0)`), typeof t.y == "string" && (i.transform = `translate3d(0, ${t.y}, 0)`), typeof t.opacity == "number" && (i.opacity = `${t.opacity}`), i;
|
|
1593
1618
|
}
|
|
1594
1619
|
//#endregion
|
|
1595
1620
|
//#region src/transition/animateInline.ts
|
|
1596
|
-
var
|
|
1597
|
-
let n =
|
|
1598
|
-
n || (n = /* @__PURE__ */ new Set(),
|
|
1599
|
-
},
|
|
1621
|
+
var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__PURE__ */ new WeakMap(), W = (e, t) => {
|
|
1622
|
+
let n = U.get(e);
|
|
1623
|
+
n || (n = /* @__PURE__ */ new Set(), U.set(e, n)), n.add(t);
|
|
1624
|
+
}, G = (e, t) => {
|
|
1600
1625
|
if (e.style.transition = "", t) {
|
|
1601
|
-
let n =
|
|
1626
|
+
let n = U.get(e);
|
|
1602
1627
|
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1603
1628
|
return;
|
|
1604
1629
|
}
|
|
1605
|
-
let n =
|
|
1630
|
+
let n = U.get(e);
|
|
1606
1631
|
if (n && n.size > 0) {
|
|
1607
1632
|
for (let t of n) e.style.removeProperty(t);
|
|
1608
1633
|
n.clear();
|
|
1609
1634
|
return;
|
|
1610
1635
|
}
|
|
1611
1636
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1612
|
-
},
|
|
1613
|
-
if (!
|
|
1614
|
-
let r = e, i =
|
|
1637
|
+
}, K = (e, t, n = {}) => {
|
|
1638
|
+
if (!ft(e)) return Promise.resolve();
|
|
1639
|
+
let r = e, i = B(t);
|
|
1615
1640
|
if (i.length === 0) return Promise.resolve();
|
|
1616
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1641
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = H(n.ease);
|
|
1617
1642
|
if (a <= 0 && o <= 0) {
|
|
1618
1643
|
r.style.transition = "none";
|
|
1619
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1644
|
+
for (let e of i) r.style.setProperty(e.property, e.value), W(r, e.property);
|
|
1620
1645
|
return Promise.resolve();
|
|
1621
1646
|
}
|
|
1622
1647
|
let c = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1623
1648
|
r.style.transition = c, r.offsetWidth;
|
|
1624
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1649
|
+
for (let e of i) r.style.setProperty(e.property, e.value), W(r, e.property);
|
|
1625
1650
|
return new Promise((e) => {
|
|
1626
1651
|
let t = !1, n = () => {
|
|
1627
1652
|
t || (t = !0, r.removeEventListener("transitionend", i), e());
|
|
@@ -1630,38 +1655,426 @@ var st = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, K = /* @__
|
|
|
1630
1655
|
};
|
|
1631
1656
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1632
1657
|
});
|
|
1633
|
-
},
|
|
1634
|
-
|
|
1658
|
+
}, pt = "flemo:motion-driver", mt = "flemo:motion-driver-force", ht = !1, gt = () => {
|
|
1659
|
+
try {
|
|
1660
|
+
if (typeof localStorage > "u") return null;
|
|
1661
|
+
let e = localStorage.getItem(mt);
|
|
1662
|
+
return e !== "css" && e !== "raf" ? null : (!ht && typeof console < "u" && (ht = !0, console.warn(`[flemo] motion driver pinned to "${e}" via localStorage ${mt}; remove the key to restore automatic selection.`)), e);
|
|
1663
|
+
} catch {
|
|
1664
|
+
return null;
|
|
1665
|
+
}
|
|
1666
|
+
}, _t = () => ({
|
|
1667
|
+
read: () => {
|
|
1668
|
+
try {
|
|
1669
|
+
return typeof localStorage < "u" ? localStorage.getItem(pt) : null;
|
|
1670
|
+
} catch {
|
|
1671
|
+
return null;
|
|
1672
|
+
}
|
|
1673
|
+
},
|
|
1674
|
+
write: (e) => {
|
|
1675
|
+
try {
|
|
1676
|
+
typeof localStorage < "u" && localStorage.setItem(pt, e);
|
|
1677
|
+
} catch {}
|
|
1678
|
+
}
|
|
1679
|
+
}), vt = 30, yt = 2, bt = 2, q = ((e = _t()) => {
|
|
1680
|
+
let t = e.read() === "css", n = t;
|
|
1681
|
+
t &&= !1;
|
|
1682
|
+
let r = 0, i = 0, a = [];
|
|
1683
|
+
return {
|
|
1684
|
+
playerAllowed: () => {
|
|
1685
|
+
let e = gt();
|
|
1686
|
+
return e ? e === "raf" : !t;
|
|
1687
|
+
},
|
|
1688
|
+
beginRun: () => {
|
|
1689
|
+
i = 0, a = [];
|
|
1690
|
+
},
|
|
1691
|
+
reportGap: (e) => {
|
|
1692
|
+
a.push(e), e >= vt && (i += 1);
|
|
1693
|
+
},
|
|
1694
|
+
endRun: () => {
|
|
1695
|
+
let a = i >= yt;
|
|
1696
|
+
if (n) {
|
|
1697
|
+
n = !1, a ? t = !0 : e.write("raf");
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
a && (r += 1, r >= bt && !t && (t = !0, e.write("css")));
|
|
1701
|
+
},
|
|
1702
|
+
stats: () => ({
|
|
1703
|
+
runGaps: [...a],
|
|
1704
|
+
strikes: r,
|
|
1705
|
+
demoted: t
|
|
1706
|
+
})
|
|
1707
|
+
};
|
|
1708
|
+
})(), xt = (e, t, n, r) => {
|
|
1709
|
+
let i = (t) => 3 * (1 - t) * (1 - t) * t * e + 3 * (1 - t) * t * t * n + t ** 3, a = (e) => 3 * (1 - e) * (1 - e) * e * t + 3 * (1 - e) * e * e * r + e ** 3;
|
|
1710
|
+
return (e) => {
|
|
1711
|
+
if (e <= 0) return 0;
|
|
1712
|
+
if (e >= 1) return 1;
|
|
1713
|
+
let t = 0, n = 1;
|
|
1714
|
+
for (let r = 0; r < 40; r++) {
|
|
1715
|
+
let r = (t + n) / 2;
|
|
1716
|
+
i(r) < e ? t = r : n = r;
|
|
1717
|
+
}
|
|
1718
|
+
return a((t + n) / 2);
|
|
1719
|
+
};
|
|
1720
|
+
}, St = (e) => e, Ct = {
|
|
1721
|
+
ease: [
|
|
1722
|
+
.25,
|
|
1723
|
+
.1,
|
|
1724
|
+
.25,
|
|
1725
|
+
1
|
|
1726
|
+
],
|
|
1727
|
+
easeIn: [
|
|
1728
|
+
.42,
|
|
1729
|
+
0,
|
|
1730
|
+
1,
|
|
1731
|
+
1
|
|
1732
|
+
],
|
|
1733
|
+
easeOut: [
|
|
1734
|
+
0,
|
|
1735
|
+
0,
|
|
1736
|
+
.58,
|
|
1737
|
+
1
|
|
1738
|
+
],
|
|
1739
|
+
easeInOut: [
|
|
1740
|
+
.42,
|
|
1741
|
+
0,
|
|
1742
|
+
.58,
|
|
1743
|
+
1
|
|
1744
|
+
],
|
|
1745
|
+
circIn: [
|
|
1746
|
+
0,
|
|
1747
|
+
.55,
|
|
1748
|
+
.45,
|
|
1749
|
+
1
|
|
1750
|
+
],
|
|
1751
|
+
circOut: [
|
|
1752
|
+
.55,
|
|
1753
|
+
0,
|
|
1754
|
+
1,
|
|
1755
|
+
.45
|
|
1756
|
+
],
|
|
1757
|
+
backIn: [
|
|
1758
|
+
.31,
|
|
1759
|
+
.01,
|
|
1760
|
+
.66,
|
|
1761
|
+
-.59
|
|
1762
|
+
],
|
|
1763
|
+
backOut: [
|
|
1764
|
+
.33,
|
|
1765
|
+
1.53,
|
|
1766
|
+
.69,
|
|
1767
|
+
.99
|
|
1768
|
+
],
|
|
1769
|
+
anticipate: [
|
|
1770
|
+
.36,
|
|
1771
|
+
0,
|
|
1772
|
+
.66,
|
|
1773
|
+
-.56
|
|
1774
|
+
]
|
|
1775
|
+
}, wt = (e) => {
|
|
1776
|
+
if (Array.isArray(e)) {
|
|
1777
|
+
if (e.length === 4 && e.every((e) => typeof e == "number")) {
|
|
1778
|
+
let [t, n, r, i] = e;
|
|
1779
|
+
return xt(t, n, r, i);
|
|
1780
|
+
}
|
|
1781
|
+
return St;
|
|
1782
|
+
}
|
|
1783
|
+
return typeof e == "string" ? e === "linear" ? St : xt(...Ct[e] ?? Ct.ease) : xt(...Ct.ease);
|
|
1784
|
+
}, Tt = [
|
|
1785
|
+
"x",
|
|
1786
|
+
"y",
|
|
1787
|
+
"z",
|
|
1788
|
+
"scale",
|
|
1789
|
+
"scaleX",
|
|
1790
|
+
"scaleY",
|
|
1791
|
+
"rotate",
|
|
1792
|
+
"rotateX",
|
|
1793
|
+
"rotateY",
|
|
1794
|
+
"rotateZ"
|
|
1795
|
+
], Et = new Set(Tt), Dt = {
|
|
1796
|
+
x: 0,
|
|
1797
|
+
y: 0,
|
|
1798
|
+
z: 0,
|
|
1799
|
+
scale: 1,
|
|
1800
|
+
scaleX: 1,
|
|
1801
|
+
scaleY: 1,
|
|
1802
|
+
rotate: 0,
|
|
1803
|
+
rotateX: 0,
|
|
1804
|
+
rotateY: 0,
|
|
1805
|
+
rotateZ: 0
|
|
1806
|
+
}, Ot = (e, t) => {
|
|
1807
|
+
if (typeof t == "number") return {
|
|
1808
|
+
value: t,
|
|
1809
|
+
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
1810
|
+
};
|
|
1811
|
+
if (typeof t != "string") return null;
|
|
1812
|
+
let n = t.trim(), r = /^(-?\d*\.?\d+)(px|%|deg)?$/.exec(n);
|
|
1813
|
+
if (!r) return null;
|
|
1814
|
+
let i = parseFloat(r[1]), a = r[2] ?? "";
|
|
1815
|
+
return e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? a !== "deg" && !(a === "" && i === 0) ? null : {
|
|
1816
|
+
value: i,
|
|
1817
|
+
unit: ""
|
|
1818
|
+
} : e === "scale" || e === "scaleX" || e === "scaleY" ? a === "" ? {
|
|
1819
|
+
value: i,
|
|
1820
|
+
unit: ""
|
|
1821
|
+
} : null : a === "deg" ? null : {
|
|
1822
|
+
value: i,
|
|
1823
|
+
unit: a === "" && i === 0 ? "px" : a
|
|
1824
|
+
};
|
|
1825
|
+
}, J = /-?\d*\.?\d+/g, kt = (e, t) => {
|
|
1826
|
+
let n = e.match(J) ?? [], r = t.match(J) ?? [];
|
|
1827
|
+
if (n.length !== r.length || e.replace(J, "\0") !== t.replace(J, "\0")) return null;
|
|
1828
|
+
let i = n.map(Number), a = r.map(Number);
|
|
1829
|
+
return (t) => {
|
|
1830
|
+
let n = 0;
|
|
1831
|
+
return e.replace(J, () => {
|
|
1832
|
+
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
1833
|
+
return `${Math.round(r * 1e3) / 1e3}`;
|
|
1834
|
+
});
|
|
1835
|
+
};
|
|
1836
|
+
}, At = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), jt = (e) => typeof e == "object" && !!e && !Array.isArray(e), Mt = (e) => jt(e) ? Object.keys(e) : [], Nt = (e, t) => jt(e) ? e[t] : void 0, Pt = (e) => Ft(e, null) !== null, Ft = (e, t) => {
|
|
1837
|
+
let n = new Set([...Mt(e.from), ...Mt(e.to)]), r = [], i = null, a = [], o = [];
|
|
1838
|
+
for (let s of n) {
|
|
1839
|
+
let n = Nt(e.from, s), c = Nt(e.to, s);
|
|
1840
|
+
if (Et.has(s)) {
|
|
1841
|
+
let e = s, i = {
|
|
1842
|
+
value: Dt[e],
|
|
1843
|
+
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
1844
|
+
}, a = n === void 0 ? i : Ot(e, n), o = c === void 0 ? i : Ot(e, c);
|
|
1845
|
+
if (!a || !o || a.unit !== o.unit && a.value !== 0 && o.value !== 0) return null;
|
|
1846
|
+
let l = a.value === 0 && a.unit !== o.unit ? o.unit : a.unit, u = l === "%", d = 0;
|
|
1847
|
+
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), r.push({
|
|
1848
|
+
prop: e,
|
|
1849
|
+
from: {
|
|
1850
|
+
value: a.value,
|
|
1851
|
+
unit: l
|
|
1852
|
+
},
|
|
1853
|
+
to: {
|
|
1854
|
+
value: o.value,
|
|
1855
|
+
unit: l
|
|
1856
|
+
},
|
|
1857
|
+
percentBase: d
|
|
1858
|
+
});
|
|
1859
|
+
continue;
|
|
1860
|
+
}
|
|
1861
|
+
if (s === "opacity") {
|
|
1862
|
+
let e = n === void 0 ? 1 : n, t = c === void 0 ? 1 : c;
|
|
1863
|
+
if (typeof e != "number" || typeof t != "number") return null;
|
|
1864
|
+
i = {
|
|
1865
|
+
from: e,
|
|
1866
|
+
to: t
|
|
1867
|
+
};
|
|
1868
|
+
continue;
|
|
1869
|
+
}
|
|
1870
|
+
if (n === void 0 || c === void 0) return null;
|
|
1871
|
+
let l = typeof n == "number" ? `${n}` : n, u = typeof c == "number" ? `${c}` : c;
|
|
1872
|
+
if (typeof l != "string" || typeof u != "string") return null;
|
|
1873
|
+
if (l === u) {
|
|
1874
|
+
o.push({
|
|
1875
|
+
property: At(s),
|
|
1876
|
+
value: l
|
|
1877
|
+
});
|
|
1878
|
+
continue;
|
|
1879
|
+
}
|
|
1880
|
+
let d = kt(l, u);
|
|
1881
|
+
if (!d) return null;
|
|
1882
|
+
a.push({
|
|
1883
|
+
property: At(s),
|
|
1884
|
+
mix: d
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
return {
|
|
1888
|
+
transforms: r,
|
|
1889
|
+
opacity: i,
|
|
1890
|
+
strings: a,
|
|
1891
|
+
constants: o
|
|
1892
|
+
};
|
|
1893
|
+
}, It = 1, Lt = (e, t, n, r) => {
|
|
1894
|
+
let i = 0, a = 0, o = !1, s = [], c = !0;
|
|
1895
|
+
for (let l of Tt) {
|
|
1896
|
+
let u = e.find((e) => e.prop === l);
|
|
1897
|
+
if (!u) continue;
|
|
1898
|
+
let d = u.from.value + (u.to.value - u.from.value) * t;
|
|
1899
|
+
if (u.from.unit === "%" && (d *= u.percentBase), l === "x" || l === "y") {
|
|
1900
|
+
let e = l === "x" ? r.x : r.y, t = (e === null || Math.abs(d - e) * n >= It) && n > 0 ? Math.round(d * n) / n : Math.round(d * 1e3) / 1e3;
|
|
1901
|
+
l === "x" ? (r.x = d, i = t) : (r.y = d, a = t), o = !0, t !== 0 && (c = !1);
|
|
1902
|
+
continue;
|
|
1903
|
+
}
|
|
1904
|
+
let f = Dt[l];
|
|
1905
|
+
d !== f && (c = !1), l === "z" ? s.push(`translateZ(${d}px)`) : l === "scale" ? s.push(`scale(${d})`) : l === "scaleX" ? s.push(`scaleX(${d})`) : l === "scaleY" ? s.push(`scaleY(${d})`) : l === "rotate" || l === "rotateZ" ? s.push(`rotate(${d}deg)`) : l === "rotateX" ? s.push(`rotateX(${d}deg)`) : l === "rotateY" && s.push(`rotateY(${d}deg)`);
|
|
1906
|
+
}
|
|
1907
|
+
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
1908
|
+
}, Rt = () => ({
|
|
1909
|
+
request: (e) => requestAnimationFrame(e),
|
|
1910
|
+
cancel: (e) => cancelAnimationFrame(e),
|
|
1911
|
+
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
1912
|
+
}), Y = ((e = Rt()) => {
|
|
1913
|
+
let t = /* @__PURE__ */ new Map(), n = {
|
|
1914
|
+
join: (n, r) => {
|
|
1915
|
+
let i = Ft(r.motion, r.element);
|
|
1916
|
+
if (!i) return null;
|
|
1917
|
+
let s = t.get(n);
|
|
1918
|
+
s || (s = {
|
|
1919
|
+
tracks: [],
|
|
1920
|
+
started: !1,
|
|
1921
|
+
startTime: null,
|
|
1922
|
+
lastTime: null,
|
|
1923
|
+
frameHandle: null
|
|
1924
|
+
}, t.set(n, s));
|
|
1925
|
+
let c = {
|
|
1926
|
+
...r,
|
|
1927
|
+
parsed: i,
|
|
1928
|
+
completed: !1,
|
|
1929
|
+
detached: !1,
|
|
1930
|
+
snapMemory: {
|
|
1931
|
+
x: null,
|
|
1932
|
+
y: null
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1935
|
+
s.tracks.push(c), c.element.style.animation = "none", W(c.element, "animation"), i.transforms.length > 0 && W(c.element, "transform"), i.opacity && W(c.element, "opacity");
|
|
1936
|
+
for (let e of i.strings) W(c.element, e.property);
|
|
1937
|
+
for (let e of i.constants) W(c.element, e.property);
|
|
1938
|
+
return a(c, 0), r.role === "active" && !s.started && (s.started = !0, q.beginRun(), o(n, s)), () => {
|
|
1939
|
+
c.detached = !0, G(c.element);
|
|
1940
|
+
let r = t.get(n);
|
|
1941
|
+
r && (r.tracks = r.tracks.filter((e) => e !== c), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
1942
|
+
};
|
|
1943
|
+
},
|
|
1944
|
+
dispose: (n) => {
|
|
1945
|
+
let r = t.get(n);
|
|
1946
|
+
r && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n));
|
|
1947
|
+
}
|
|
1948
|
+
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
1949
|
+
let t = r.get(e);
|
|
1950
|
+
return t || (t = wt(e.motion.ease), r.set(e, t)), t;
|
|
1951
|
+
};
|
|
1952
|
+
function a(t, n) {
|
|
1953
|
+
let { element: r, parsed: i } = t;
|
|
1954
|
+
if (r.isConnected) {
|
|
1955
|
+
if (i.transforms.length > 0) {
|
|
1956
|
+
let a = Lt(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
1957
|
+
a !== "" && (r.style.transform = a);
|
|
1958
|
+
}
|
|
1959
|
+
if (i.opacity) {
|
|
1960
|
+
let { from: e, to: t } = i.opacity;
|
|
1961
|
+
r.style.opacity = `${e + (t - e) * n}`;
|
|
1962
|
+
}
|
|
1963
|
+
for (let e of i.strings) r.style.setProperty(e.property, e.mix(n));
|
|
1964
|
+
if (n === 0) for (let e of i.constants) r.style.setProperty(e.property, e.value);
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
function o(t, n) {
|
|
1968
|
+
n.frameHandle = e.request((e) => {
|
|
1969
|
+
n.frameHandle = null, s(t, n, e);
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
function s(e, r, s) {
|
|
1973
|
+
r.startTime === null && (r.startTime = s), r.lastTime !== null && (q.reportGap(s - r.lastTime), n.onFrameGap?.(s - r.lastTime)), r.lastTime = s;
|
|
1974
|
+
let c = !0;
|
|
1975
|
+
for (let e of r.tracks) {
|
|
1976
|
+
if (e.completed || e.detached) continue;
|
|
1977
|
+
let t = e.motion.duration * 1e3, n = e.motion.delay * 1e3, o = t <= 0 ? 1 : Math.min(1, Math.max(0, (s - r.startTime - n) / t));
|
|
1978
|
+
a(e, i(e)(o)), o >= 1 ? (e.completed = !0, e.onComplete?.()) : c = !1;
|
|
1979
|
+
}
|
|
1980
|
+
if (c) {
|
|
1981
|
+
q.endRun(), t.delete(e);
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1984
|
+
o(e, r);
|
|
1985
|
+
}
|
|
1986
|
+
return n;
|
|
1987
|
+
})();
|
|
1988
|
+
Y.onFrameGap = (e) => {
|
|
1989
|
+
if (typeof window < "u") {
|
|
1990
|
+
let t = window.__flemoPlayerGaps ??= [];
|
|
1991
|
+
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
1992
|
+
}
|
|
1993
|
+
};
|
|
1994
|
+
//#endregion
|
|
1995
|
+
//#region src/core/engine/types.ts
|
|
1996
|
+
var X = "data-flemo-skip-animation", Z = () => {};
|
|
1997
|
+
function zt(e) {
|
|
1635
1998
|
return { driveScreenLifecycle: (t) => {
|
|
1636
|
-
let { getElements: n, transitionName: r, prevTransitionName: i, status: a, isActive: s } = t
|
|
1637
|
-
|
|
1999
|
+
let { getElements: n, transitionName: r, prevTransitionName: i, status: a, isActive: s, animHoldReleased: c } = t, l = a === "PUSHING" || a === "POPPING" || a === "REPLACING", u = (t, i, a) => {
|
|
2000
|
+
let s = e.getTransitionTaskId();
|
|
2001
|
+
if (!s || o.pendingTaskIds.some((e) => e !== s) || !q.playerAllowed()) return null;
|
|
2002
|
+
let { scope: c, decorator: l, bars: u } = n();
|
|
2003
|
+
if (!c) return null;
|
|
2004
|
+
let d = M(r), f = z(d, t);
|
|
2005
|
+
if (!f || !Pt(f)) return null;
|
|
2006
|
+
let p = [], m = Y.join(s, {
|
|
2007
|
+
element: c,
|
|
2008
|
+
motion: f,
|
|
2009
|
+
role: i,
|
|
2010
|
+
onComplete: a
|
|
2011
|
+
});
|
|
2012
|
+
if (!m) return null;
|
|
2013
|
+
p.push(m);
|
|
2014
|
+
for (let e of u ?? []) {
|
|
2015
|
+
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2016
|
+
let t = Y.join(s, {
|
|
2017
|
+
element: e,
|
|
2018
|
+
motion: f,
|
|
2019
|
+
role: "passive"
|
|
2020
|
+
});
|
|
2021
|
+
t && p.push(t);
|
|
2022
|
+
}
|
|
2023
|
+
if (l && d.decoratorName) {
|
|
2024
|
+
let e = P.get(d.decoratorName), n = e ? z(e, t) : null;
|
|
2025
|
+
if (n && Pt(n)) {
|
|
2026
|
+
let e = Y.join(s, {
|
|
2027
|
+
element: l,
|
|
2028
|
+
motion: n,
|
|
2029
|
+
role: "passive"
|
|
2030
|
+
});
|
|
2031
|
+
e && p.push(e);
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
return () => p.forEach((e) => e());
|
|
2035
|
+
};
|
|
2036
|
+
if (!s) {
|
|
2037
|
+
if (a === "COMPLETED") {
|
|
2038
|
+
let { scope: e, decorator: t, bars: r } = n();
|
|
2039
|
+
e && G(e), t && G(t);
|
|
2040
|
+
for (let e of r ?? []) e && G(e);
|
|
2041
|
+
return Z;
|
|
2042
|
+
}
|
|
2043
|
+
if (a === "REPLACING" && i !== r && e.setReplaceTransitionStatus("PENDING"), l && c) {
|
|
2044
|
+
let e = u(`${a}-false`, "passive");
|
|
2045
|
+
if (e) return e;
|
|
2046
|
+
}
|
|
2047
|
+
return Z;
|
|
2048
|
+
}
|
|
1638
2049
|
if (a === "COMPLETED") {
|
|
1639
2050
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
1640
2051
|
let { scope: t, decorator: r, bars: i } = n();
|
|
1641
|
-
t && (
|
|
1642
|
-
for (let e of i ?? []) e && (
|
|
1643
|
-
return
|
|
2052
|
+
t && (G(t), t.removeAttribute(X)), r && (G(r), r.removeAttribute(X));
|
|
2053
|
+
for (let e of i ?? []) e && (G(e), e.style.removeProperty("will-change"));
|
|
2054
|
+
return Z;
|
|
1644
2055
|
}
|
|
1645
|
-
if (a === "IDLE") return
|
|
1646
|
-
let { scope:
|
|
1647
|
-
if (!
|
|
1648
|
-
let
|
|
2056
|
+
if (a === "IDLE") return Z;
|
|
2057
|
+
let { scope: d } = n();
|
|
2058
|
+
if (!d) return Z;
|
|
2059
|
+
let f = () => {
|
|
1649
2060
|
let t = e.getTransitionTaskId();
|
|
1650
2061
|
t && o.resolveTask(t);
|
|
1651
|
-
},
|
|
1652
|
-
if (!(
|
|
1653
|
-
let
|
|
1654
|
-
e.target ===
|
|
2062
|
+
}, p = M(r), m = `${a}-true`, h = d.getAttribute(X) === "true";
|
|
2063
|
+
if (!(!h && nt(p, m))) return queueMicrotask(f), Z;
|
|
2064
|
+
let g = z(p, m), _ = !h && !!g && Pt(g), v = Xe("screen", r, m), y = (e) => {
|
|
2065
|
+
e.target === d && e.animationName === v && (d.removeEventListener("animationend", y), f());
|
|
1655
2066
|
};
|
|
1656
|
-
|
|
1657
|
-
|
|
2067
|
+
d.addEventListener("animationend", y);
|
|
2068
|
+
let b = _ && c ? u(m, "active", f) : null, x = e.getTransitionTaskId(), S = ((g?.delay ?? 0) + (g?.duration ?? .6)) * 1e3 + 1500, C = x ? setTimeout(() => void o.resolveTask(x), S) : void 0;
|
|
2069
|
+
return () => {
|
|
2070
|
+
C !== void 0 && clearTimeout(C), d.removeEventListener("animationend", y), b?.();
|
|
1658
2071
|
};
|
|
1659
2072
|
} };
|
|
1660
2073
|
}
|
|
1661
2074
|
//#endregion
|
|
1662
2075
|
//#region src/utils/findScrollable.ts
|
|
1663
|
-
function
|
|
1664
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
2076
|
+
function Bt(e, t) {
|
|
2077
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Vt(e);
|
|
1665
2078
|
if (!o) return {
|
|
1666
2079
|
element: null,
|
|
1667
2080
|
hasMarker: !1
|
|
@@ -1684,7 +2097,7 @@ function Z(e, t) {
|
|
|
1684
2097
|
hasMarker: !1
|
|
1685
2098
|
};
|
|
1686
2099
|
}
|
|
1687
|
-
function
|
|
2100
|
+
function Vt(e) {
|
|
1688
2101
|
if (!e) return null;
|
|
1689
2102
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
1690
2103
|
if (n && n.length) {
|
|
@@ -1702,8 +2115,8 @@ function $(e, t) {
|
|
|
1702
2115
|
}
|
|
1703
2116
|
//#endregion
|
|
1704
2117
|
//#region src/core/engine/createSwipeController.ts
|
|
1705
|
-
var
|
|
1706
|
-
function
|
|
2118
|
+
var Ht = "data-flemo-skip-animation";
|
|
2119
|
+
function Ut(e) {
|
|
1707
2120
|
let t = null, n = null, r = {
|
|
1708
2121
|
current: [],
|
|
1709
2122
|
prev: []
|
|
@@ -1749,9 +2162,9 @@ function ft(e) {
|
|
|
1749
2162
|
y: e.clientY
|
|
1750
2163
|
}, u = t;
|
|
1751
2164
|
}, v = (n, i, a) => {
|
|
1752
|
-
let o =
|
|
1753
|
-
if (n === e.getElements().scope) for (let e of r.current)
|
|
1754
|
-
else if (n === t) for (let e of r.prev)
|
|
2165
|
+
let o = K(n, i, a);
|
|
2166
|
+
if (n === e.getElements().scope) for (let e of r.current) K(e, i, a);
|
|
2167
|
+
else if (n === t) for (let e of r.prev) K(e, i, a);
|
|
1755
2168
|
return o;
|
|
1756
2169
|
}, y = (t) => {
|
|
1757
2170
|
let n = e.getPartnerBars(), i = [], { sharedTopBar: a, sharedBottomBar: o } = e.getElements();
|
|
@@ -1765,12 +2178,12 @@ function ft(e) {
|
|
|
1765
2178
|
current: i,
|
|
1766
2179
|
prev: s
|
|
1767
2180
|
};
|
|
1768
|
-
let c =
|
|
2181
|
+
let c = Ge(e.getTransition()).join(", ");
|
|
1769
2182
|
for (let e of i) e.style.willChange = c;
|
|
1770
2183
|
for (let e of s) e.style.willChange = c;
|
|
1771
2184
|
}, b = () => {
|
|
1772
|
-
for (let e of r.current)
|
|
1773
|
-
for (let e of r.prev)
|
|
2185
|
+
for (let e of r.current) G(e), e.style.removeProperty("will-change");
|
|
2186
|
+
for (let e of r.prev) G(e), e.style.removeProperty("will-change");
|
|
1774
2187
|
r = {
|
|
1775
2188
|
current: [],
|
|
1776
2189
|
prev: []
|
|
@@ -1786,7 +2199,7 @@ function ft(e) {
|
|
|
1786
2199
|
let a = F.get(r.getAttribute("data-flemo-part-name"));
|
|
1787
2200
|
if (!a) return;
|
|
1788
2201
|
let o = {
|
|
1789
|
-
animate:
|
|
2202
|
+
animate: K,
|
|
1790
2203
|
element: r,
|
|
1791
2204
|
active: i
|
|
1792
2205
|
};
|
|
@@ -1795,7 +2208,7 @@ function ft(e) {
|
|
|
1795
2208
|
for (let e of i.current) r(e, !0);
|
|
1796
2209
|
for (let e of i.prev) r(e, !1);
|
|
1797
2210
|
}, C = () => {
|
|
1798
|
-
for (let e of [...i.current, ...i.prev])
|
|
2211
|
+
for (let e of [...i.current, ...i.prev]) G(e);
|
|
1799
2212
|
i = {
|
|
1800
2213
|
current: [],
|
|
1801
2214
|
prev: []
|
|
@@ -1824,7 +2237,7 @@ function ft(e) {
|
|
|
1824
2237
|
prevScreen: t,
|
|
1825
2238
|
onStart: (e) => {
|
|
1826
2239
|
m?.onSwipeStart?.(e, {
|
|
1827
|
-
animate:
|
|
2240
|
+
animate: K,
|
|
1828
2241
|
currentDecorator: f,
|
|
1829
2242
|
prevDecorator: n
|
|
1830
2243
|
}), S("start", e, 0);
|
|
@@ -1841,7 +2254,7 @@ function ft(e) {
|
|
|
1841
2254
|
prevScreen: t,
|
|
1842
2255
|
onProgress: (e, t) => {
|
|
1843
2256
|
c?.onSwipe?.(e, t, {
|
|
1844
|
-
animate:
|
|
2257
|
+
animate: K,
|
|
1845
2258
|
currentDecorator: o,
|
|
1846
2259
|
prevDecorator: n
|
|
1847
2260
|
}), S("swipe", e, t);
|
|
@@ -1860,32 +2273,32 @@ function ft(e) {
|
|
|
1860
2273
|
prevScreen: t,
|
|
1861
2274
|
onStart: (e) => {
|
|
1862
2275
|
u?.onSwipeEnd?.(e, {
|
|
1863
|
-
animate:
|
|
2276
|
+
animate: K,
|
|
1864
2277
|
currentDecorator: l,
|
|
1865
2278
|
prevDecorator: n
|
|
1866
2279
|
}), S("end", e, 0);
|
|
1867
2280
|
}
|
|
1868
2281
|
})) {
|
|
1869
|
-
c?.setAttribute(
|
|
2282
|
+
c?.setAttribute(Ht, "true"), l?.setAttribute(Ht, "true");
|
|
1870
2283
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
1871
|
-
for (let e of r.prev)
|
|
2284
|
+
for (let e of r.prev) G(e), e.style.removeProperty("will-change");
|
|
1872
2285
|
r = {
|
|
1873
2286
|
current: [],
|
|
1874
2287
|
prev: []
|
|
1875
2288
|
};
|
|
1876
|
-
for (let e of i.prev)
|
|
2289
|
+
for (let e of i.prev) G(e);
|
|
1877
2290
|
i = {
|
|
1878
2291
|
current: [],
|
|
1879
2292
|
prev: []
|
|
1880
2293
|
}, e.back();
|
|
1881
|
-
} else c &&
|
|
2294
|
+
} else c && G(c), t && G(t), l && G(l), n && G(n), b(), C(), e.setDragStatus("IDLE");
|
|
1882
2295
|
};
|
|
1883
2296
|
return {
|
|
1884
2297
|
pointerDown: (t) => {
|
|
1885
|
-
e.isReadyForDrag() && (f =
|
|
2298
|
+
e.isReadyForDrag() && (f = Bt(t.target, {
|
|
1886
2299
|
direction: "x",
|
|
1887
2300
|
verifyByScroll: !0
|
|
1888
|
-
}), p =
|
|
2301
|
+
}), p = Bt(t.target, {
|
|
1889
2302
|
direction: "y",
|
|
1890
2303
|
verifyByScroll: !0
|
|
1891
2304
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -1914,7 +2327,7 @@ function ft(e) {
|
|
|
1914
2327
|
}
|
|
1915
2328
|
//#endregion
|
|
1916
2329
|
//#region src/screen/computeBarRiding.ts
|
|
1917
|
-
function
|
|
2330
|
+
function Wt(e) {
|
|
1918
2331
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
1919
2332
|
app: !1,
|
|
1920
2333
|
nav: !1
|
|
@@ -1925,24 +2338,24 @@ function pt(e) {
|
|
|
1925
2338
|
}
|
|
1926
2339
|
//#endregion
|
|
1927
2340
|
//#region src/screen/animStartAnchor.ts
|
|
1928
|
-
function
|
|
2341
|
+
function Gt(e) {
|
|
1929
2342
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
1930
2343
|
}
|
|
1931
|
-
var
|
|
1932
|
-
function
|
|
1933
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0,
|
|
2344
|
+
var Kt = 300, qt = 20;
|
|
2345
|
+
function Jt(e) {
|
|
2346
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, qt);
|
|
1934
2347
|
}
|
|
1935
|
-
function
|
|
1936
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
2348
|
+
function Yt(e) {
|
|
2349
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of Jt(e)) t.decode().catch(() => {});
|
|
1937
2350
|
}
|
|
1938
|
-
function
|
|
1939
|
-
let n = !1, r = 0, i = () => {
|
|
2351
|
+
function Xt(e, t = {}) {
|
|
2352
|
+
let n = !1, r = 0, i = [], a = () => {
|
|
1940
2353
|
let r = t.scope;
|
|
1941
2354
|
if (!r || typeof r.querySelectorAll != "function") {
|
|
1942
2355
|
e();
|
|
1943
2356
|
return;
|
|
1944
2357
|
}
|
|
1945
|
-
let i =
|
|
2358
|
+
let i = Jt(r);
|
|
1946
2359
|
if (i.length === 0) {
|
|
1947
2360
|
e();
|
|
1948
2361
|
return;
|
|
@@ -1953,16 +2366,22 @@ function yt(e, t = {}) {
|
|
|
1953
2366
|
Promise.race([a, o]).then(() => {
|
|
1954
2367
|
n || e();
|
|
1955
2368
|
});
|
|
1956
|
-
},
|
|
1957
|
-
|
|
1958
|
-
|
|
2369
|
+
}, o = (e) => {
|
|
2370
|
+
if (e <= 0) {
|
|
2371
|
+
a();
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
i.push(requestAnimationFrame(() => o(e - 1)));
|
|
2375
|
+
}, s = requestAnimationFrame(() => {
|
|
2376
|
+
r = requestAnimationFrame(() => o(t.extraFrames ?? 0));
|
|
2377
|
+
}), c = setTimeout(e, 300);
|
|
1959
2378
|
return () => {
|
|
1960
|
-
n = !0, cancelAnimationFrame(
|
|
2379
|
+
n = !0, cancelAnimationFrame(s), r && cancelAnimationFrame(r), i.forEach((e) => cancelAnimationFrame(e)), clearTimeout(c);
|
|
1961
2380
|
};
|
|
1962
2381
|
}
|
|
1963
2382
|
//#endregion
|
|
1964
2383
|
//#region src/screen/observeBarHeight.ts
|
|
1965
|
-
function
|
|
2384
|
+
function Zt(e, t) {
|
|
1966
2385
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
1967
2386
|
let n = new ResizeObserver(([e]) => {
|
|
1968
2387
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -1973,14 +2392,14 @@ function bt(e, t) {
|
|
|
1973
2392
|
}
|
|
1974
2393
|
//#endregion
|
|
1975
2394
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
1976
|
-
var
|
|
1977
|
-
function
|
|
2395
|
+
var Qt = 0;
|
|
2396
|
+
function $t(e) {
|
|
1978
2397
|
let t = 0, n = () => {
|
|
1979
2398
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
1980
2399
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
1981
2400
|
t = t < 0 ? 0 : t;
|
|
1982
|
-
let n = t -
|
|
1983
|
-
n = n < 0 ? 0 : n,
|
|
2401
|
+
let n = t - Qt;
|
|
2402
|
+
n = n < 0 ? 0 : n, Qt ||= t, e(t, n);
|
|
1984
2403
|
});
|
|
1985
2404
|
};
|
|
1986
2405
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -1989,7 +2408,7 @@ function St(e) {
|
|
|
1989
2408
|
}
|
|
1990
2409
|
//#endregion
|
|
1991
2410
|
//#region src/utils/isOpaqueColor.ts
|
|
1992
|
-
function
|
|
2411
|
+
function en(e) {
|
|
1993
2412
|
let t = e.trim().toLowerCase();
|
|
1994
2413
|
if (t === "transparent" || t === "") return !1;
|
|
1995
2414
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -2000,7 +2419,7 @@ function Ct(e) {
|
|
|
2000
2419
|
}
|
|
2001
2420
|
//#endregion
|
|
2002
2421
|
//#region src/utils/buildRoutePath.ts
|
|
2003
|
-
function
|
|
2422
|
+
function tn(e, n) {
|
|
2004
2423
|
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();
|
|
2005
2424
|
return {
|
|
2006
2425
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -2008,4 +2427,4 @@ function wt(e, n) {
|
|
|
2008
2427
|
};
|
|
2009
2428
|
}
|
|
2010
2429
|
//#endregion
|
|
2011
|
-
export {
|
|
2430
|
+
export { Kt as ANIM_HOLD_RELEASE_BACKSTOP_MS, X as SKIP_ANIMATION_ATTR, o as TaskManger, Gt as animHoldKey, K as animateInline, Xe as animationName, se as appendParamsQuery, it as applyTransitionStyles, tn as buildRoutePath, $ as canProgrammaticallyScroll, G as clearInlineAnimation, Ge as collectAnimatedProperties, et as compileTransitionStyles, Wt as computeBarRiding, _e as computeScreenFreeze, y as consumeSelfInducedPop, h as createBrowserHistoryDriver, Te as createDecorator, s as createHistoryStore, b as createHistorySync, ne as createMemoryHistoryDriver, re as createNavigateStore, ae as createNavigationController, Oe as createPartTransition, Ee as createRawDecorator, ke as createRawPartTransition, ve as createRawTransition, he as createRouterScope, ge as createScreenSelector, fe as createScreenStore, g as createSelfPopGuard, ce as createStepController, Ut as createSwipeController, A as createTransition, zt as createTransitionEngine, ue as createTransitionStore, be as cupertino, P as decoratorMap, Yt as eagerlyDecodeImages, H as easingToCss, ee as ensureScopeHistorySync, f as ensureWindowHistoryState, dt as enteringInitialStyle, Bt as findScrollable, c as getMatchedPathPattern, l as getParams, en as isOpaqueColor, d as isServer, Se as layout, v as markSelfInducedPop, de as matchesPathname, Ce as material, we as none, Zt as observeBarHeight, $t as observeViewportScrollHeight, Q as overflowsAxis, De as overlay, F as partTransitionMap, oe as readStepParams, ut as registerTransitionDefinitions, te as releaseScopeHistorySync, M as resolveTransition, Xt as scheduleAnimHoldRelease, u as seedInitialHistory, p as seedRouterEntry, le as subscribeStepParamsRestore, B as targetToDecls, j as transitionMap, nt as variantHasAnimation };
|