@flemo/core 1.12.1 → 1.14.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 +637 -187
- 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
|
+
}, Me = (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
|
+
}, 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 : "", ze = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Be = 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
|
+
]), Ve = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, He = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Ue = /^1(\.0+)?$/, We = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? Ue.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? He.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? Ve.test(t.trim()) : !1, Ge = (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
|
+
}, Ke = (e) => {
|
|
1448
|
+
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1449
|
+
if (!Fe(e)) return;
|
|
1450
|
+
let n = [];
|
|
1451
|
+
for (let r of Object.keys(e)) {
|
|
1452
|
+
let i = e[r], a = Re(r, i);
|
|
1453
|
+
if (a !== "") if (Be.has(r)) n.push(`${r}:${a}`);
|
|
1454
|
+
else {
|
|
1455
|
+
let e = t.get(ze(r)) ?? /* @__PURE__ */ new Set();
|
|
1456
|
+
e.add(a), t.set(ze(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
|
+
}, z = (e) => {
|
|
1467
|
+
if (!Fe(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 = Re(i, a);
|
|
1471
|
+
o !== "" && (Be.has(i) ? (t.push(Ge(i, o)), We(i, a) || (n = !1)) : r.push({
|
|
1472
|
+
property: ze(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
|
+
}, B = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), V = (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,11 +1487,7 @@ 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", qe = (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
|
}, Je = (e, t) => {
|
|
@@ -1476,17 +1499,17 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1476
1499
|
}, Xe = (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
|
+
}, Ze = (e, t, n) => `flemo-${e}-${Pe(t)}-${n}`, H = (e, t, n, r, i, a) => {
|
|
1503
|
+
let o = z(r), s = z(i.value), c = L(i.options), l = R(i.options), u = V(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Ye(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${B(s)}\n animation: none;\n}`;
|
|
1506
|
+
let p = Ze(e, t, n), m = [
|
|
1484
1507
|
`@keyframes ${p} {`,
|
|
1485
1508
|
" from {",
|
|
1486
|
-
|
|
1509
|
+
B(o).replace(/^/gm, " "),
|
|
1487
1510
|
" }",
|
|
1488
1511
|
" to {",
|
|
1489
|
-
|
|
1512
|
+
B(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${B(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${B(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 = z(r.value);
|
|
1530
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${B(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(qe, 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(H("screen", e, n, o, i, qe));
|
|
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 Ne) {
|
|
1525
1548
|
let i = e.variants[n], a = I[n];
|
|
1526
1549
|
if (a === "self") {
|
|
1527
|
-
r.push(
|
|
1550
|
+
r.push($e(Je, 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(H("decorator", t, n, o, i, Je));
|
|
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 Ne) {
|
|
1537
1560
|
let i = e.variants[n], a = I[n];
|
|
1538
1561
|
if (a === "self") {
|
|
1539
|
-
r.push(
|
|
1562
|
+
r.push($e(Xe, 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(H("part", t, n, o, i, Xe));
|
|
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 = z(n === "initial" ? e.initial : e.variants[n].value), s = z(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 = z(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 = V(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,457 @@ 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, " ") !== t.replace(J, " ")) 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, 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
|
+
}, Ft = 1, It = (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 >= Ft) && 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
|
+
}, Lt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), Rt = (e) => {
|
|
1909
|
+
let t = {};
|
|
1910
|
+
for (let n of z(e)) t[Lt(n.property)] = n.value;
|
|
1911
|
+
return t;
|
|
1912
|
+
}, zt = (e, t) => {
|
|
1913
|
+
if (typeof e.animate != "function") return null;
|
|
1914
|
+
try {
|
|
1915
|
+
let n = e.animate([Rt(t.from), Rt(t.to)], {
|
|
1916
|
+
duration: Math.max(0, t.duration * 1e3),
|
|
1917
|
+
delay: Math.max(0, t.delay * 1e3),
|
|
1918
|
+
easing: V(t.ease),
|
|
1919
|
+
fill: "both"
|
|
1920
|
+
});
|
|
1921
|
+
return n.pause(), n.currentTime = 0, n;
|
|
1922
|
+
} catch {
|
|
1923
|
+
return null;
|
|
1924
|
+
}
|
|
1925
|
+
}, Bt = () => ({
|
|
1926
|
+
request: (e) => requestAnimationFrame(e),
|
|
1927
|
+
cancel: (e) => cancelAnimationFrame(e),
|
|
1928
|
+
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
1929
|
+
}), Y = ((e = Bt()) => {
|
|
1930
|
+
let t = /* @__PURE__ */ new Map(), n = {
|
|
1931
|
+
join: (n, r) => {
|
|
1932
|
+
let i = Pt(r.motion, r.element), s = i ? null : zt(r.element, r.motion);
|
|
1933
|
+
if (!i && !s) return null;
|
|
1934
|
+
let c = t.get(n);
|
|
1935
|
+
c || (c = {
|
|
1936
|
+
tracks: [],
|
|
1937
|
+
started: !1,
|
|
1938
|
+
startTime: null,
|
|
1939
|
+
lastTime: null,
|
|
1940
|
+
frameHandle: null
|
|
1941
|
+
}, t.set(n, c));
|
|
1942
|
+
let l = {
|
|
1943
|
+
...r,
|
|
1944
|
+
parsed: i,
|
|
1945
|
+
scrub: s,
|
|
1946
|
+
completed: !1,
|
|
1947
|
+
detached: !1,
|
|
1948
|
+
snapMemory: {
|
|
1949
|
+
x: null,
|
|
1950
|
+
y: null
|
|
1951
|
+
}
|
|
1952
|
+
};
|
|
1953
|
+
if (c.tracks.push(l), l.element.style.animation = "none", W(l.element, "animation"), i) {
|
|
1954
|
+
i.transforms.length > 0 && W(l.element, "transform"), i.opacity && W(l.element, "opacity");
|
|
1955
|
+
for (let e of i.strings) W(l.element, e.property);
|
|
1956
|
+
for (let e of i.constants) W(l.element, e.property);
|
|
1957
|
+
a(l, 0);
|
|
1958
|
+
}
|
|
1959
|
+
return r.role === "active" && !c.started && (c.started = !0, q.beginRun(), o(n, c)), () => {
|
|
1960
|
+
l.detached = !0, l.scrub?.cancel(), G(l.element);
|
|
1961
|
+
let r = t.get(n);
|
|
1962
|
+
r && (r.tracks = r.tracks.filter((e) => e !== l), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
1963
|
+
};
|
|
1964
|
+
},
|
|
1965
|
+
dispose: (n) => {
|
|
1966
|
+
let r = t.get(n);
|
|
1967
|
+
if (r) {
|
|
1968
|
+
r.frameHandle !== null && e.cancel(r.frameHandle);
|
|
1969
|
+
for (let e of r.tracks) e.scrub?.cancel();
|
|
1970
|
+
t.delete(n);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
1974
|
+
let t = r.get(e);
|
|
1975
|
+
return t || (t = wt(e.motion.ease), r.set(e, t)), t;
|
|
1976
|
+
};
|
|
1977
|
+
function a(t, n) {
|
|
1978
|
+
let { element: r, parsed: i } = t;
|
|
1979
|
+
if (!(!i || !r.isConnected)) {
|
|
1980
|
+
if (i.transforms.length > 0) {
|
|
1981
|
+
let a = It(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
1982
|
+
a !== "" && (r.style.transform = a);
|
|
1983
|
+
}
|
|
1984
|
+
if (i.opacity) {
|
|
1985
|
+
let { from: e, to: t } = i.opacity;
|
|
1986
|
+
r.style.opacity = `${e + (t - e) * n}`;
|
|
1987
|
+
}
|
|
1988
|
+
for (let e of i.strings) r.style.setProperty(e.property, e.mix(n));
|
|
1989
|
+
if (n === 0) for (let e of i.constants) r.style.setProperty(e.property, e.value);
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
function o(t, n) {
|
|
1993
|
+
n.frameHandle = e.request((e) => {
|
|
1994
|
+
n.frameHandle = null, s(t, n, e);
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
function s(e, r, s) {
|
|
1998
|
+
r.startTime === null && (r.startTime = s), r.lastTime !== null && (q.reportGap(s - r.lastTime), n.onFrameGap?.(s - r.lastTime)), r.lastTime = s;
|
|
1999
|
+
let c = !0;
|
|
2000
|
+
for (let e of r.tracks) {
|
|
2001
|
+
if (e.completed || e.detached) continue;
|
|
2002
|
+
let t = e.motion.duration * 1e3, n = e.motion.delay * 1e3, o = s - r.startTime;
|
|
2003
|
+
if (e.scrub) {
|
|
2004
|
+
let r = n + t;
|
|
2005
|
+
e.scrub.currentTime = Math.min(Math.max(0, o), r), o >= r ? (e.completed = !0, e.onComplete?.()) : c = !1;
|
|
2006
|
+
continue;
|
|
2007
|
+
}
|
|
2008
|
+
let l = t <= 0 ? 1 : Math.min(1, Math.max(0, (o - n) / t));
|
|
2009
|
+
a(e, i(e)(l)), l >= 1 ? (e.completed = !0, e.onComplete?.()) : c = !1;
|
|
2010
|
+
}
|
|
2011
|
+
if (c) {
|
|
2012
|
+
q.endRun(), t.delete(e);
|
|
2013
|
+
return;
|
|
2014
|
+
}
|
|
2015
|
+
o(e, r);
|
|
2016
|
+
}
|
|
2017
|
+
return n;
|
|
2018
|
+
})();
|
|
2019
|
+
Y.onFrameGap = (e) => {
|
|
2020
|
+
if (typeof window < "u") {
|
|
2021
|
+
let t = window.__flemoPlayerGaps ??= [];
|
|
2022
|
+
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
2023
|
+
}
|
|
2024
|
+
};
|
|
2025
|
+
//#endregion
|
|
2026
|
+
//#region src/core/engine/types.ts
|
|
2027
|
+
var X = "data-flemo-skip-animation", Z = () => {};
|
|
2028
|
+
function Vt(e) {
|
|
1635
2029
|
return { driveScreenLifecycle: (t) => {
|
|
1636
|
-
let { getElements: n, transitionName: r, prevTransitionName: i, status: a, isActive: s } = t
|
|
1637
|
-
|
|
2030
|
+
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) => {
|
|
2031
|
+
let s = e.getTransitionTaskId();
|
|
2032
|
+
if (!s || o.pendingTaskIds.some((e) => e !== s) || !q.playerAllowed()) return null;
|
|
2033
|
+
let { scope: c, decorator: l, bars: u } = n();
|
|
2034
|
+
if (!c) return null;
|
|
2035
|
+
let d = M(r), f = Me(d, t);
|
|
2036
|
+
if (!f) return null;
|
|
2037
|
+
let p = [], m = Y.join(s, {
|
|
2038
|
+
element: c,
|
|
2039
|
+
motion: f,
|
|
2040
|
+
role: i,
|
|
2041
|
+
onComplete: a
|
|
2042
|
+
});
|
|
2043
|
+
if (!m) return null;
|
|
2044
|
+
p.push(m);
|
|
2045
|
+
for (let e of u ?? []) {
|
|
2046
|
+
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2047
|
+
let t = Y.join(s, {
|
|
2048
|
+
element: e,
|
|
2049
|
+
motion: f,
|
|
2050
|
+
role: "passive"
|
|
2051
|
+
});
|
|
2052
|
+
t && p.push(t);
|
|
2053
|
+
}
|
|
2054
|
+
if (l && d.decoratorName) {
|
|
2055
|
+
let e = P.get(d.decoratorName), n = e ? Me(e, t) : null;
|
|
2056
|
+
if (n) {
|
|
2057
|
+
let e = Y.join(s, {
|
|
2058
|
+
element: l,
|
|
2059
|
+
motion: n,
|
|
2060
|
+
role: "passive"
|
|
2061
|
+
});
|
|
2062
|
+
e && p.push(e);
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
return () => p.forEach((e) => e());
|
|
2066
|
+
};
|
|
2067
|
+
if (!s) {
|
|
2068
|
+
if (a === "COMPLETED") {
|
|
2069
|
+
let { scope: e, decorator: t, bars: r } = n();
|
|
2070
|
+
e && G(e), t && G(t);
|
|
2071
|
+
for (let e of r ?? []) e && G(e);
|
|
2072
|
+
return Z;
|
|
2073
|
+
}
|
|
2074
|
+
if (a === "REPLACING" && i !== r && e.setReplaceTransitionStatus("PENDING"), l && c) {
|
|
2075
|
+
let e = u(`${a}-false`, "passive");
|
|
2076
|
+
if (e) return e;
|
|
2077
|
+
}
|
|
2078
|
+
return Z;
|
|
2079
|
+
}
|
|
1638
2080
|
if (a === "COMPLETED") {
|
|
1639
2081
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
1640
2082
|
let { scope: t, decorator: r, bars: i } = n();
|
|
1641
|
-
t && (
|
|
1642
|
-
for (let e of i ?? []) e && (
|
|
1643
|
-
return
|
|
2083
|
+
t && (G(t), t.removeAttribute(X)), r && (G(r), r.removeAttribute(X));
|
|
2084
|
+
for (let e of i ?? []) e && (G(e), e.style.removeProperty("will-change"));
|
|
2085
|
+
return Z;
|
|
1644
2086
|
}
|
|
1645
|
-
if (a === "IDLE") return
|
|
1646
|
-
let { scope:
|
|
1647
|
-
if (!
|
|
1648
|
-
let
|
|
2087
|
+
if (a === "IDLE") return Z;
|
|
2088
|
+
let { scope: d } = n();
|
|
2089
|
+
if (!d) return Z;
|
|
2090
|
+
let f = () => {
|
|
1649
2091
|
let t = e.getTransitionTaskId();
|
|
1650
2092
|
t && o.resolveTask(t);
|
|
1651
|
-
},
|
|
1652
|
-
if (!(
|
|
1653
|
-
let
|
|
1654
|
-
e.target ===
|
|
2093
|
+
}, p = M(r), m = `${a}-true`, h = d.getAttribute(X) === "true";
|
|
2094
|
+
if (!(!h && nt(p, m))) return queueMicrotask(f), Z;
|
|
2095
|
+
let g = Me(p, m), _ = !h && !!g, v = Ze("screen", r, m), y = (e) => {
|
|
2096
|
+
e.target === d && e.animationName === v && (d.removeEventListener("animationend", y), f());
|
|
1655
2097
|
};
|
|
1656
|
-
|
|
1657
|
-
|
|
2098
|
+
d.addEventListener("animationend", y);
|
|
2099
|
+
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;
|
|
2100
|
+
return () => {
|
|
2101
|
+
C !== void 0 && clearTimeout(C), d.removeEventListener("animationend", y), b?.();
|
|
1658
2102
|
};
|
|
1659
2103
|
} };
|
|
1660
2104
|
}
|
|
1661
2105
|
//#endregion
|
|
1662
2106
|
//#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 =
|
|
2107
|
+
function Ht(e, t) {
|
|
2108
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Ut(e);
|
|
1665
2109
|
if (!o) return {
|
|
1666
2110
|
element: null,
|
|
1667
2111
|
hasMarker: !1
|
|
@@ -1684,7 +2128,7 @@ function Z(e, t) {
|
|
|
1684
2128
|
hasMarker: !1
|
|
1685
2129
|
};
|
|
1686
2130
|
}
|
|
1687
|
-
function
|
|
2131
|
+
function Ut(e) {
|
|
1688
2132
|
if (!e) return null;
|
|
1689
2133
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
1690
2134
|
if (n && n.length) {
|
|
@@ -1702,8 +2146,8 @@ function $(e, t) {
|
|
|
1702
2146
|
}
|
|
1703
2147
|
//#endregion
|
|
1704
2148
|
//#region src/core/engine/createSwipeController.ts
|
|
1705
|
-
var
|
|
1706
|
-
function
|
|
2149
|
+
var Wt = "data-flemo-skip-animation";
|
|
2150
|
+
function Gt(e) {
|
|
1707
2151
|
let t = null, n = null, r = {
|
|
1708
2152
|
current: [],
|
|
1709
2153
|
prev: []
|
|
@@ -1749,9 +2193,9 @@ function ft(e) {
|
|
|
1749
2193
|
y: e.clientY
|
|
1750
2194
|
}, u = t;
|
|
1751
2195
|
}, 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)
|
|
2196
|
+
let o = K(n, i, a);
|
|
2197
|
+
if (n === e.getElements().scope) for (let e of r.current) K(e, i, a);
|
|
2198
|
+
else if (n === t) for (let e of r.prev) K(e, i, a);
|
|
1755
2199
|
return o;
|
|
1756
2200
|
}, y = (t) => {
|
|
1757
2201
|
let n = e.getPartnerBars(), i = [], { sharedTopBar: a, sharedBottomBar: o } = e.getElements();
|
|
@@ -1765,12 +2209,12 @@ function ft(e) {
|
|
|
1765
2209
|
current: i,
|
|
1766
2210
|
prev: s
|
|
1767
2211
|
};
|
|
1768
|
-
let c =
|
|
2212
|
+
let c = Ke(e.getTransition()).join(", ");
|
|
1769
2213
|
for (let e of i) e.style.willChange = c;
|
|
1770
2214
|
for (let e of s) e.style.willChange = c;
|
|
1771
2215
|
}, b = () => {
|
|
1772
|
-
for (let e of r.current)
|
|
1773
|
-
for (let e of r.prev)
|
|
2216
|
+
for (let e of r.current) G(e), e.style.removeProperty("will-change");
|
|
2217
|
+
for (let e of r.prev) G(e), e.style.removeProperty("will-change");
|
|
1774
2218
|
r = {
|
|
1775
2219
|
current: [],
|
|
1776
2220
|
prev: []
|
|
@@ -1786,7 +2230,7 @@ function ft(e) {
|
|
|
1786
2230
|
let a = F.get(r.getAttribute("data-flemo-part-name"));
|
|
1787
2231
|
if (!a) return;
|
|
1788
2232
|
let o = {
|
|
1789
|
-
animate:
|
|
2233
|
+
animate: K,
|
|
1790
2234
|
element: r,
|
|
1791
2235
|
active: i
|
|
1792
2236
|
};
|
|
@@ -1795,7 +2239,7 @@ function ft(e) {
|
|
|
1795
2239
|
for (let e of i.current) r(e, !0);
|
|
1796
2240
|
for (let e of i.prev) r(e, !1);
|
|
1797
2241
|
}, C = () => {
|
|
1798
|
-
for (let e of [...i.current, ...i.prev])
|
|
2242
|
+
for (let e of [...i.current, ...i.prev]) G(e);
|
|
1799
2243
|
i = {
|
|
1800
2244
|
current: [],
|
|
1801
2245
|
prev: []
|
|
@@ -1824,7 +2268,7 @@ function ft(e) {
|
|
|
1824
2268
|
prevScreen: t,
|
|
1825
2269
|
onStart: (e) => {
|
|
1826
2270
|
m?.onSwipeStart?.(e, {
|
|
1827
|
-
animate:
|
|
2271
|
+
animate: K,
|
|
1828
2272
|
currentDecorator: f,
|
|
1829
2273
|
prevDecorator: n
|
|
1830
2274
|
}), S("start", e, 0);
|
|
@@ -1841,7 +2285,7 @@ function ft(e) {
|
|
|
1841
2285
|
prevScreen: t,
|
|
1842
2286
|
onProgress: (e, t) => {
|
|
1843
2287
|
c?.onSwipe?.(e, t, {
|
|
1844
|
-
animate:
|
|
2288
|
+
animate: K,
|
|
1845
2289
|
currentDecorator: o,
|
|
1846
2290
|
prevDecorator: n
|
|
1847
2291
|
}), S("swipe", e, t);
|
|
@@ -1860,32 +2304,32 @@ function ft(e) {
|
|
|
1860
2304
|
prevScreen: t,
|
|
1861
2305
|
onStart: (e) => {
|
|
1862
2306
|
u?.onSwipeEnd?.(e, {
|
|
1863
|
-
animate:
|
|
2307
|
+
animate: K,
|
|
1864
2308
|
currentDecorator: l,
|
|
1865
2309
|
prevDecorator: n
|
|
1866
2310
|
}), S("end", e, 0);
|
|
1867
2311
|
}
|
|
1868
2312
|
})) {
|
|
1869
|
-
c?.setAttribute(
|
|
2313
|
+
c?.setAttribute(Wt, "true"), l?.setAttribute(Wt, "true");
|
|
1870
2314
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
1871
|
-
for (let e of r.prev)
|
|
2315
|
+
for (let e of r.prev) G(e), e.style.removeProperty("will-change");
|
|
1872
2316
|
r = {
|
|
1873
2317
|
current: [],
|
|
1874
2318
|
prev: []
|
|
1875
2319
|
};
|
|
1876
|
-
for (let e of i.prev)
|
|
2320
|
+
for (let e of i.prev) G(e);
|
|
1877
2321
|
i = {
|
|
1878
2322
|
current: [],
|
|
1879
2323
|
prev: []
|
|
1880
2324
|
}, e.back();
|
|
1881
|
-
} else c &&
|
|
2325
|
+
} else c && G(c), t && G(t), l && G(l), n && G(n), b(), C(), e.setDragStatus("IDLE");
|
|
1882
2326
|
};
|
|
1883
2327
|
return {
|
|
1884
2328
|
pointerDown: (t) => {
|
|
1885
|
-
e.isReadyForDrag() && (f =
|
|
2329
|
+
e.isReadyForDrag() && (f = Ht(t.target, {
|
|
1886
2330
|
direction: "x",
|
|
1887
2331
|
verifyByScroll: !0
|
|
1888
|
-
}), p =
|
|
2332
|
+
}), p = Ht(t.target, {
|
|
1889
2333
|
direction: "y",
|
|
1890
2334
|
verifyByScroll: !0
|
|
1891
2335
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -1914,7 +2358,7 @@ function ft(e) {
|
|
|
1914
2358
|
}
|
|
1915
2359
|
//#endregion
|
|
1916
2360
|
//#region src/screen/computeBarRiding.ts
|
|
1917
|
-
function
|
|
2361
|
+
function Kt(e) {
|
|
1918
2362
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
1919
2363
|
app: !1,
|
|
1920
2364
|
nav: !1
|
|
@@ -1925,24 +2369,24 @@ function pt(e) {
|
|
|
1925
2369
|
}
|
|
1926
2370
|
//#endregion
|
|
1927
2371
|
//#region src/screen/animStartAnchor.ts
|
|
1928
|
-
function
|
|
2372
|
+
function qt(e) {
|
|
1929
2373
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
1930
2374
|
}
|
|
1931
|
-
var
|
|
1932
|
-
function
|
|
1933
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0,
|
|
2375
|
+
var Jt = 300, Yt = 20;
|
|
2376
|
+
function Xt(e) {
|
|
2377
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, Yt);
|
|
1934
2378
|
}
|
|
1935
|
-
function
|
|
1936
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
2379
|
+
function Zt(e) {
|
|
2380
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of Xt(e)) t.decode().catch(() => {});
|
|
1937
2381
|
}
|
|
1938
|
-
function
|
|
1939
|
-
let n = !1, r = 0, i = () => {
|
|
2382
|
+
function Qt(e, t = {}) {
|
|
2383
|
+
let n = !1, r = 0, i = [], a = () => {
|
|
1940
2384
|
let r = t.scope;
|
|
1941
2385
|
if (!r || typeof r.querySelectorAll != "function") {
|
|
1942
2386
|
e();
|
|
1943
2387
|
return;
|
|
1944
2388
|
}
|
|
1945
|
-
let i =
|
|
2389
|
+
let i = Xt(r);
|
|
1946
2390
|
if (i.length === 0) {
|
|
1947
2391
|
e();
|
|
1948
2392
|
return;
|
|
@@ -1953,16 +2397,22 @@ function yt(e, t = {}) {
|
|
|
1953
2397
|
Promise.race([a, o]).then(() => {
|
|
1954
2398
|
n || e();
|
|
1955
2399
|
});
|
|
1956
|
-
},
|
|
1957
|
-
|
|
1958
|
-
|
|
2400
|
+
}, o = (e) => {
|
|
2401
|
+
if (e <= 0) {
|
|
2402
|
+
a();
|
|
2403
|
+
return;
|
|
2404
|
+
}
|
|
2405
|
+
i.push(requestAnimationFrame(() => o(e - 1)));
|
|
2406
|
+
}, s = requestAnimationFrame(() => {
|
|
2407
|
+
r = requestAnimationFrame(() => o(t.extraFrames ?? 0));
|
|
2408
|
+
}), c = setTimeout(e, 300);
|
|
1959
2409
|
return () => {
|
|
1960
|
-
n = !0, cancelAnimationFrame(
|
|
2410
|
+
n = !0, cancelAnimationFrame(s), r && cancelAnimationFrame(r), i.forEach((e) => cancelAnimationFrame(e)), clearTimeout(c);
|
|
1961
2411
|
};
|
|
1962
2412
|
}
|
|
1963
2413
|
//#endregion
|
|
1964
2414
|
//#region src/screen/observeBarHeight.ts
|
|
1965
|
-
function
|
|
2415
|
+
function $t(e, t) {
|
|
1966
2416
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
1967
2417
|
let n = new ResizeObserver(([e]) => {
|
|
1968
2418
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -1973,14 +2423,14 @@ function bt(e, t) {
|
|
|
1973
2423
|
}
|
|
1974
2424
|
//#endregion
|
|
1975
2425
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
1976
|
-
var
|
|
1977
|
-
function
|
|
2426
|
+
var en = 0;
|
|
2427
|
+
function tn(e) {
|
|
1978
2428
|
let t = 0, n = () => {
|
|
1979
2429
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
1980
2430
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
1981
2431
|
t = t < 0 ? 0 : t;
|
|
1982
|
-
let n = t -
|
|
1983
|
-
n = n < 0 ? 0 : n,
|
|
2432
|
+
let n = t - en;
|
|
2433
|
+
n = n < 0 ? 0 : n, en ||= t, e(t, n);
|
|
1984
2434
|
});
|
|
1985
2435
|
};
|
|
1986
2436
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -1989,7 +2439,7 @@ function St(e) {
|
|
|
1989
2439
|
}
|
|
1990
2440
|
//#endregion
|
|
1991
2441
|
//#region src/utils/isOpaqueColor.ts
|
|
1992
|
-
function
|
|
2442
|
+
function nn(e) {
|
|
1993
2443
|
let t = e.trim().toLowerCase();
|
|
1994
2444
|
if (t === "transparent" || t === "") return !1;
|
|
1995
2445
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -2000,7 +2450,7 @@ function Ct(e) {
|
|
|
2000
2450
|
}
|
|
2001
2451
|
//#endregion
|
|
2002
2452
|
//#region src/utils/buildRoutePath.ts
|
|
2003
|
-
function
|
|
2453
|
+
function rn(e, n) {
|
|
2004
2454
|
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
2455
|
return {
|
|
2006
2456
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -2008,4 +2458,4 @@ function wt(e, n) {
|
|
|
2008
2458
|
};
|
|
2009
2459
|
}
|
|
2010
2460
|
//#endregion
|
|
2011
|
-
export {
|
|
2461
|
+
export { Jt as ANIM_HOLD_RELEASE_BACKSTOP_MS, X as SKIP_ANIMATION_ATTR, o as TaskManger, qt as animHoldKey, K as animateInline, Ze as animationName, se as appendParamsQuery, it as applyTransitionStyles, rn as buildRoutePath, $ as canProgrammaticallyScroll, G as clearInlineAnimation, Ke as collectAnimatedProperties, et as compileTransitionStyles, Kt 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, Gt as createSwipeController, A as createTransition, Vt as createTransitionEngine, ue as createTransitionStore, be as cupertino, P as decoratorMap, Zt as eagerlyDecodeImages, V as easingToCss, ee as ensureScopeHistorySync, f as ensureWindowHistoryState, dt as enteringInitialStyle, Ht as findScrollable, c as getMatchedPathPattern, l as getParams, nn as isOpaqueColor, d as isServer, Se as layout, v as markSelfInducedPop, de as matchesPathname, Ce as material, we as none, $t as observeBarHeight, tn as observeViewportScrollHeight, Q as overflowsAxis, De as overlay, F as partTransitionMap, oe as readStepParams, ut as registerTransitionDefinitions, te as releaseScopeHistorySync, M as resolveTransition, Qt as scheduleAnimHoldRelease, u as seedInitialHistory, p as seedRouterEntry, le as subscribeStepParamsRestore, z as targetToDecls, j as transitionMap, nt as variantHasAnimation };
|