@flemo/core 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
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, A = async (e, t, n, r) => {
|
|
556
556
|
let i, a = new Promise((t) => {
|
|
557
557
|
i = e.subscribe(() => t(!0));
|
|
558
558
|
}), o = new Promise((e) => setTimeout(() => e(!1), 200));
|
|
@@ -560,7 +560,7 @@ var O = (e, t, n) => {
|
|
|
560
560
|
let s = await Promise.race([a, o]);
|
|
561
561
|
i(), s && r();
|
|
562
562
|
};
|
|
563
|
-
function
|
|
563
|
+
function ie(e) {
|
|
564
564
|
let { stores: t, buildPathname: n, driver: r = h(), markSelfInduced: i = v } = e, s = () => t.history.getState().bumpTruncationEpoch(), c = () => {
|
|
565
565
|
let e = r.readState();
|
|
566
566
|
if (!e?.id) return null;
|
|
@@ -616,7 +616,7 @@ function ae(e) {
|
|
|
616
616
|
return g({
|
|
617
617
|
...C,
|
|
618
618
|
frameIndex: T + 1
|
|
619
|
-
}), await
|
|
619
|
+
}), await A(r, i, v, () => {
|
|
620
620
|
s(), r.pushState({
|
|
621
621
|
id: h,
|
|
622
622
|
index: T + 1,
|
|
@@ -681,7 +681,7 @@ function ae(e) {
|
|
|
681
681
|
return v(y - 1), g({
|
|
682
682
|
...w,
|
|
683
683
|
frameIndex: E
|
|
684
|
-
}), y <= d ? await
|
|
684
|
+
}), y <= d ? await A(r, i, y, () => {
|
|
685
685
|
s(), r.pushState({
|
|
686
686
|
id: h,
|
|
687
687
|
index: E,
|
|
@@ -690,7 +690,7 @@ function ae(e) {
|
|
|
690
690
|
transitionName: p,
|
|
691
691
|
layoutId: m
|
|
692
692
|
}, S);
|
|
693
|
-
}) : await
|
|
693
|
+
}) : await A(r, i, d, () => {
|
|
694
694
|
s(), r.replaceState({
|
|
695
695
|
id: h,
|
|
696
696
|
index: E,
|
|
@@ -757,14 +757,14 @@ function ae(e) {
|
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
759
759
|
//#region src/navigate/createStepController.ts
|
|
760
|
-
var
|
|
760
|
+
var ae = (e) => {
|
|
761
761
|
let t = e;
|
|
762
762
|
return t?.step ? t.params ?? {} : null;
|
|
763
|
-
},
|
|
763
|
+
}, oe = (e, t) => {
|
|
764
764
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
765
765
|
return n ? `${e}?${n}` : e;
|
|
766
766
|
};
|
|
767
|
-
function
|
|
767
|
+
function se(e) {
|
|
768
768
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: s } = e;
|
|
769
769
|
return {
|
|
770
770
|
pushStep: async (e) => {
|
|
@@ -822,7 +822,7 @@ function ce(e) {
|
|
|
822
822
|
}
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function ce(e, t) {
|
|
826
826
|
return e.subscribe((e) => {
|
|
827
827
|
let n = e.state;
|
|
828
828
|
n?.step && o.addTask(async () => {
|
|
@@ -832,7 +832,7 @@ function le(e, t) {
|
|
|
832
832
|
}
|
|
833
833
|
//#endregion
|
|
834
834
|
//#region src/transition/store.ts
|
|
835
|
-
function
|
|
835
|
+
function le(t = "cupertino") {
|
|
836
836
|
return e((e) => ({
|
|
837
837
|
defaultTransitionName: t,
|
|
838
838
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -840,12 +840,12 @@ function ue(t = "cupertino") {
|
|
|
840
840
|
}
|
|
841
841
|
//#endregion
|
|
842
842
|
//#region src/utils/matchesPathname.ts
|
|
843
|
-
function
|
|
843
|
+
function ue(e, t) {
|
|
844
844
|
return i(e).regexp.test(t);
|
|
845
845
|
}
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/screen/store.ts
|
|
848
|
-
function
|
|
848
|
+
function de() {
|
|
849
849
|
return e((e) => ({
|
|
850
850
|
dragStatus: "IDLE",
|
|
851
851
|
replaceTransitionStatus: "IDLE",
|
|
@@ -876,14 +876,14 @@ function fe() {
|
|
|
876
876
|
}
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region src/core/createRouterScope.ts
|
|
879
|
-
var
|
|
879
|
+
var fe = {
|
|
880
880
|
mark: () => {},
|
|
881
881
|
consume: () => !1
|
|
882
|
-
},
|
|
883
|
-
function
|
|
882
|
+
}, pe = /* @__PURE__ */ new Map();
|
|
883
|
+
function me(e) {
|
|
884
884
|
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: o } = e, c = d() ? void 0 : e.persistKey;
|
|
885
885
|
if (c) {
|
|
886
|
-
let e =
|
|
886
|
+
let e = pe.get(c);
|
|
887
887
|
if (e) {
|
|
888
888
|
e.life.alive = !0, e.navigate.getState().setStatus("IDLE"), e.navigate.getState().setTransitionTaskId(null);
|
|
889
889
|
let t = e.history.getState();
|
|
@@ -913,25 +913,25 @@ function he(e) {
|
|
|
913
913
|
layoutId: p.layoutId
|
|
914
914
|
},
|
|
915
915
|
url: p.pathname
|
|
916
|
-
}) : o, h = a ?
|
|
916
|
+
}) : o, h = a ? fe : g(), _ = {
|
|
917
917
|
history: s([p], 0),
|
|
918
918
|
navigate: re(),
|
|
919
|
-
transition:
|
|
920
|
-
screen:
|
|
919
|
+
transition: le(i),
|
|
920
|
+
screen: de(),
|
|
921
921
|
driver: m,
|
|
922
922
|
markSelfInduced: h.mark,
|
|
923
923
|
consume: h.consume,
|
|
924
924
|
routerKey: e.routerKey,
|
|
925
925
|
zoneEntryId: e.zoneEntryId,
|
|
926
|
-
ownsPathname: (e) =>
|
|
926
|
+
ownsPathname: (e) => ue(t, e),
|
|
927
927
|
persistent: !!c,
|
|
928
928
|
life: { alive: !0 }
|
|
929
929
|
};
|
|
930
|
-
return c &&
|
|
930
|
+
return c && pe.set(c, _), _;
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region src/screen/createScreenSelector.ts
|
|
934
|
-
function
|
|
934
|
+
function he(e, t) {
|
|
935
935
|
return e.map((n, r) => ({
|
|
936
936
|
...n,
|
|
937
937
|
isActive: r === t,
|
|
@@ -944,13 +944,13 @@ function ge(e, t) {
|
|
|
944
944
|
}
|
|
945
945
|
//#endregion
|
|
946
946
|
//#region src/screen/computeScreenFreeze.ts
|
|
947
|
-
function
|
|
947
|
+
function ge(e) {
|
|
948
948
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
949
949
|
return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
|
|
950
950
|
}
|
|
951
951
|
//#endregion
|
|
952
952
|
//#region src/transition/createTransition.ts
|
|
953
|
-
function
|
|
953
|
+
function j({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
954
954
|
return {
|
|
955
955
|
name: e,
|
|
956
956
|
initial: t,
|
|
@@ -971,7 +971,7 @@ function A({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
971
971
|
}
|
|
972
972
|
//#endregion
|
|
973
973
|
//#region src/transition/createRawTransition.ts
|
|
974
|
-
function
|
|
974
|
+
function _e({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
975
975
|
return {
|
|
976
976
|
name: e,
|
|
977
977
|
initial: t,
|
|
@@ -992,10 +992,10 @@ function ve({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
992
992
|
}
|
|
993
993
|
//#endregion
|
|
994
994
|
//#region src/transition/cupertino.ts
|
|
995
|
-
var
|
|
995
|
+
var ve = (e, t, n) => {
|
|
996
996
|
let [r, i] = t, [a, o] = n;
|
|
997
997
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
998
|
-
},
|
|
998
|
+
}, ye = j({
|
|
999
999
|
name: "cupertino",
|
|
1000
1000
|
initial: { x: "100%" },
|
|
1001
1001
|
idle: {
|
|
@@ -1055,7 +1055,7 @@ var ye = (e, t, n) => {
|
|
|
1055
1055
|
swipeDirection: "x",
|
|
1056
1056
|
onSwipeStart: async () => !0,
|
|
1057
1057
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1058
|
-
let { offset: o } = t, s = o.x, c =
|
|
1058
|
+
let { offset: o } = t, s = o.x, c = ve(s, [0, window.innerWidth], [0, 100]);
|
|
1059
1059
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-35 + c * .35}%` }, { duration: 0 }), c;
|
|
1060
1060
|
},
|
|
1061
1061
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -1079,10 +1079,10 @@ var ye = (e, t, n) => {
|
|
|
1079
1079
|
})]), c;
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
}),
|
|
1082
|
+
}), be = (e, t, n) => {
|
|
1083
1083
|
let [r, i] = t, [a, o] = n;
|
|
1084
1084
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1085
|
-
},
|
|
1085
|
+
}, xe = j({
|
|
1086
1086
|
name: "layout",
|
|
1087
1087
|
initial: { opacity: .97 },
|
|
1088
1088
|
idle: {
|
|
@@ -1110,7 +1110,7 @@ var ye = (e, t, n) => {
|
|
|
1110
1110
|
swipeDirection: "y",
|
|
1111
1111
|
onSwipeStart: async () => !0,
|
|
1112
1112
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
1113
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
1113
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = be(s, [0, 56], [1, .96]), l = Math.max(0, o - 56), u = Math.min(1, l / 160), d = Math.sqrt(u) * 12, f = Math.max(0, s + d), p = Math.min(56, f);
|
|
1114
1114
|
return i?.(!0, 100), n(r, {
|
|
1115
1115
|
y: f,
|
|
1116
1116
|
opacity: c
|
|
@@ -1127,7 +1127,7 @@ var ye = (e, t, n) => {
|
|
|
1127
1127
|
}, { duration: .3 })]), c;
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
}),
|
|
1130
|
+
}), Se = j({
|
|
1131
1131
|
name: "material",
|
|
1132
1132
|
initial: { y: "100%" },
|
|
1133
1133
|
idle: {
|
|
@@ -1235,7 +1235,7 @@ var ye = (e, t, n) => {
|
|
|
1235
1235
|
})]), c;
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
|
-
}),
|
|
1238
|
+
}), Ce = j({
|
|
1239
1239
|
name: "none",
|
|
1240
1240
|
initial: {},
|
|
1241
1241
|
idle: {
|
|
@@ -1258,20 +1258,20 @@ var ye = (e, t, n) => {
|
|
|
1258
1258
|
value: {},
|
|
1259
1259
|
options: { duration: 0 }
|
|
1260
1260
|
}
|
|
1261
|
-
}),
|
|
1262
|
-
["none",
|
|
1263
|
-
["cupertino",
|
|
1264
|
-
["material",
|
|
1265
|
-
["layout",
|
|
1261
|
+
}), M = new Map([
|
|
1262
|
+
["none", Ce],
|
|
1263
|
+
["cupertino", ye],
|
|
1264
|
+
["material", Se],
|
|
1265
|
+
["layout", xe]
|
|
1266
1266
|
]);
|
|
1267
1267
|
//#endregion
|
|
1268
1268
|
//#region src/transition/resolveTransition.ts
|
|
1269
|
-
function
|
|
1270
|
-
return
|
|
1269
|
+
function N(e) {
|
|
1270
|
+
return M.get(e) ?? M.get("none");
|
|
1271
1271
|
}
|
|
1272
1272
|
//#endregion
|
|
1273
1273
|
//#region src/transition/decorator/createDecorator.ts
|
|
1274
|
-
function
|
|
1274
|
+
function we({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1275
1275
|
return {
|
|
1276
1276
|
name: e,
|
|
1277
1277
|
initial: t,
|
|
@@ -1292,7 +1292,7 @@ function Te({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
//#endregion
|
|
1294
1294
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
1295
|
-
function
|
|
1295
|
+
function Te({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1296
1296
|
return {
|
|
1297
1297
|
name: e,
|
|
1298
1298
|
initial: t,
|
|
@@ -1313,30 +1313,30 @@ 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
|
|
1316
|
+
var P = "rgba(0, 0, 0, 0.2)", Ee = we({
|
|
1317
1317
|
name: "overlay",
|
|
1318
1318
|
initial: {
|
|
1319
1319
|
opacity: 0,
|
|
1320
|
-
backgroundColor:
|
|
1320
|
+
backgroundColor: P
|
|
1321
1321
|
},
|
|
1322
1322
|
idle: {
|
|
1323
1323
|
value: {
|
|
1324
1324
|
opacity: 0,
|
|
1325
|
-
backgroundColor:
|
|
1325
|
+
backgroundColor: P
|
|
1326
1326
|
},
|
|
1327
1327
|
options: { duration: 0 }
|
|
1328
1328
|
},
|
|
1329
1329
|
enter: {
|
|
1330
1330
|
value: {
|
|
1331
1331
|
opacity: 1,
|
|
1332
|
-
backgroundColor:
|
|
1332
|
+
backgroundColor: P
|
|
1333
1333
|
},
|
|
1334
1334
|
options: { duration: .6 }
|
|
1335
1335
|
},
|
|
1336
1336
|
exit: {
|
|
1337
1337
|
value: {
|
|
1338
1338
|
opacity: 0,
|
|
1339
|
-
backgroundColor:
|
|
1339
|
+
backgroundColor: P
|
|
1340
1340
|
},
|
|
1341
1341
|
options: { duration: .6 }
|
|
1342
1342
|
},
|
|
@@ -1345,10 +1345,10 @@ var N = "rgba(0, 0, 0, 0.2)", De = Te({
|
|
|
1345
1345
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1346
1346
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1347
1347
|
}
|
|
1348
|
-
}),
|
|
1348
|
+
}), F = new Map([["overlay", Ee]]);
|
|
1349
1349
|
//#endregion
|
|
1350
1350
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1351
|
-
function
|
|
1351
|
+
function De({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1352
1352
|
return {
|
|
1353
1353
|
name: e,
|
|
1354
1354
|
initial: t,
|
|
@@ -1369,7 +1369,7 @@ function Oe({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
//#endregion
|
|
1371
1371
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1372
|
-
function
|
|
1372
|
+
function Oe({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1373
1373
|
return {
|
|
1374
1374
|
name: e,
|
|
1375
1375
|
initial: t,
|
|
@@ -1390,7 +1390,7 @@ function ke({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1390
1390
|
}
|
|
1391
1391
|
//#endregion
|
|
1392
1392
|
//#region src/transition/partTransition/partTransition.ts
|
|
1393
|
-
var
|
|
1393
|
+
var I = /* @__PURE__ */ new Map(), L = {
|
|
1394
1394
|
"IDLE-true": "self",
|
|
1395
1395
|
"IDLE-false": "self",
|
|
1396
1396
|
"PUSHING-true": "initial",
|
|
@@ -1401,17 +1401,17 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1401
1401
|
"POPPING-false": "PUSHING-false",
|
|
1402
1402
|
"COMPLETED-true": "self",
|
|
1403
1403
|
"COMPLETED-false": "self"
|
|
1404
|
-
},
|
|
1404
|
+
}, ke = Object.keys(L), R = (e) => {
|
|
1405
1405
|
if (!e) return 0;
|
|
1406
1406
|
let t = e.duration;
|
|
1407
1407
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1408
|
-
},
|
|
1409
|
-
let n =
|
|
1408
|
+
}, z = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Ae = (e, t) => {
|
|
1409
|
+
let n = L[t];
|
|
1410
1410
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1411
|
-
},
|
|
1412
|
-
let n =
|
|
1411
|
+
}, B = (e, t) => {
|
|
1412
|
+
let n = Ae(e, t);
|
|
1413
1413
|
if (n === null) return null;
|
|
1414
|
-
let r = e.variants[t], i =
|
|
1414
|
+
let r = e.variants[t], i = R(r.options), a = z(r.options);
|
|
1415
1415
|
return i <= 0 && a <= 0 ? null : {
|
|
1416
1416
|
from: n,
|
|
1417
1417
|
to: r.value,
|
|
@@ -1419,7 +1419,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1419
1419
|
delay: a,
|
|
1420
1420
|
ease: r.options?.ease
|
|
1421
1421
|
};
|
|
1422
|
-
},
|
|
1422
|
+
}, je = ke, Me = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Ne = (e) => typeof e == "object" && !!e && !Array.isArray(e), Pe = 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(".")), Fe = (e, t) => t.startsWith("--") || Pe.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Ie = (e, t) => typeof t == "number" ? Fe(t, e) : typeof t == "string" ? t : "", Le = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Re = new Set([
|
|
1423
1423
|
"x",
|
|
1424
1424
|
"y",
|
|
1425
1425
|
"z",
|
|
@@ -1430,7 +1430,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1430
1430
|
"rotateX",
|
|
1431
1431
|
"rotateY",
|
|
1432
1432
|
"rotateZ"
|
|
1433
|
-
]),
|
|
1433
|
+
]), ze = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, Be = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Ve = /^1(\.0+)?$/, He = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? Ve.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? Be.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? ze.test(t.trim()) : !1, Ue = (e, t) => {
|
|
1434
1434
|
switch (e) {
|
|
1435
1435
|
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1436
1436
|
case "y": return `translate3d(0, ${t}, 0)`;
|
|
@@ -1444,16 +1444,16 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1444
1444
|
case "rotateY": return `rotateY(${t})`;
|
|
1445
1445
|
default: return "";
|
|
1446
1446
|
}
|
|
1447
|
-
},
|
|
1447
|
+
}, We = (e) => {
|
|
1448
1448
|
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1449
|
-
if (!
|
|
1449
|
+
if (!Ne(e)) return;
|
|
1450
1450
|
let n = [];
|
|
1451
1451
|
for (let r of Object.keys(e)) {
|
|
1452
|
-
let i = e[r], a =
|
|
1453
|
-
if (a !== "") if (
|
|
1452
|
+
let i = e[r], a = Ie(r, i);
|
|
1453
|
+
if (a !== "") if (Re.has(r)) n.push(`${r}:${a}`);
|
|
1454
1454
|
else {
|
|
1455
|
-
let e = t.get(
|
|
1456
|
-
e.add(a), t.set(
|
|
1455
|
+
let e = t.get(Le(r)) ?? /* @__PURE__ */ new Set();
|
|
1456
|
+
e.add(a), t.set(Le(r), e);
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
1459
|
r.add(n.sort().join("|"));
|
|
@@ -1463,13 +1463,13 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1463
1463
|
n = r.size > 1;
|
|
1464
1464
|
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1465
1465
|
return n && a.push("transform"), a;
|
|
1466
|
-
},
|
|
1467
|
-
if (!
|
|
1466
|
+
}, V = (e) => {
|
|
1467
|
+
if (!Ne(e)) return [];
|
|
1468
1468
|
let t = [], n = !0, r = [];
|
|
1469
1469
|
for (let i of Object.keys(e)) {
|
|
1470
|
-
let a = e[i], o =
|
|
1471
|
-
o !== "" && (
|
|
1472
|
-
property:
|
|
1470
|
+
let a = e[i], o = Ie(i, a);
|
|
1471
|
+
o !== "" && (Re.has(i) ? (t.push(Ue(i, o)), He(i, a) || (n = !1)) : r.push({
|
|
1472
|
+
property: Le(i),
|
|
1473
1473
|
value: o
|
|
1474
1474
|
}));
|
|
1475
1475
|
}
|
|
@@ -1477,7 +1477,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1477
1477
|
property: "transform",
|
|
1478
1478
|
value: n ? "none" : t.join(" ")
|
|
1479
1479
|
}), r;
|
|
1480
|
-
},
|
|
1480
|
+
}, H = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), U = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1481
1481
|
linear: "linear",
|
|
1482
1482
|
easeIn: "ease-in",
|
|
1483
1483
|
easeOut: "ease-out",
|
|
@@ -1487,29 +1487,29 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1487
1487
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1488
1488
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1489
1489
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1490
|
-
}[e] ?? "ease" : "ease",
|
|
1490
|
+
}[e] ?? "ease" : "ease", Ge = (e, t) => {
|
|
1491
1491
|
let [n, r] = t.split("-");
|
|
1492
1492
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1493
|
-
},
|
|
1493
|
+
}, Ke = (e, t) => {
|
|
1494
1494
|
let [n, r] = t.split("-");
|
|
1495
1495
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1496
|
-
},
|
|
1496
|
+
}, qe = (e, t) => {
|
|
1497
1497
|
let [n, r] = t.split("-");
|
|
1498
1498
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1499
|
-
},
|
|
1499
|
+
}, Je = (e, t) => {
|
|
1500
1500
|
let [n, r] = t.split("-");
|
|
1501
1501
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1502
|
-
},
|
|
1503
|
-
let o =
|
|
1502
|
+
}, Ye = (e, t, n) => `flemo-${e}-${Me(t)}-${n}`, Xe = (e, t, n, r, i, a) => {
|
|
1503
|
+
let o = V(r), s = V(i.value), c = R(i.options), l = z(i.options), u = U(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${qe(t, n)}` : d;
|
|
1504
1504
|
if (s.length === 0 && o.length === 0) return "";
|
|
1505
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1506
|
-
let p =
|
|
1505
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${H(s)}\n animation: none;\n}`;
|
|
1506
|
+
let p = Ye(e, t, n), m = [
|
|
1507
1507
|
`@keyframes ${p} {`,
|
|
1508
1508
|
" from {",
|
|
1509
|
-
|
|
1509
|
+
H(o).replace(/^/gm, " "),
|
|
1510
1510
|
" }",
|
|
1511
1511
|
" to {",
|
|
1512
|
-
|
|
1512
|
+
H(s).replace(/^/gm, " "),
|
|
1513
1513
|
" }",
|
|
1514
1514
|
"}"
|
|
1515
1515
|
].join("\n"), h = [
|
|
@@ -1519,55 +1519,55 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1519
1519
|
l > 0 ? `${l}s` : null,
|
|
1520
1520
|
"both"
|
|
1521
1521
|
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1522
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") &&
|
|
1523
|
-
},
|
|
1522
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Ze(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${H(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && Ze(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${H(s)}\n}` : ""}`;
|
|
1523
|
+
}, Ze = (e) => {
|
|
1524
1524
|
if (!e) return !1;
|
|
1525
1525
|
if (e.opacity === 0) return !0;
|
|
1526
1526
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1527
1527
|
return t(e.x) || t(e.y);
|
|
1528
|
-
},
|
|
1529
|
-
let i =
|
|
1530
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1531
|
-
},
|
|
1528
|
+
}, Qe = (e, t, n, r) => {
|
|
1529
|
+
let i = V(r.value);
|
|
1530
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${H(i)}\n}`;
|
|
1531
|
+
}, $e = (e, t, n = []) => {
|
|
1532
1532
|
let r = [];
|
|
1533
1533
|
for (let t of e) {
|
|
1534
1534
|
let e = t.name;
|
|
1535
|
-
for (let n of
|
|
1536
|
-
let i = t.variants[n], a =
|
|
1535
|
+
for (let n of ke) {
|
|
1536
|
+
let i = t.variants[n], a = L[n];
|
|
1537
1537
|
if (a === "self") {
|
|
1538
|
-
r.push(
|
|
1538
|
+
r.push(Qe(Ge, e, n, i));
|
|
1539
1539
|
continue;
|
|
1540
1540
|
}
|
|
1541
1541
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1542
|
-
r.push(
|
|
1542
|
+
r.push(Xe("screen", e, n, o, i, Ge));
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
1545
|
for (let e of t) {
|
|
1546
1546
|
let t = e.name;
|
|
1547
|
-
for (let n of
|
|
1548
|
-
let i = e.variants[n], a =
|
|
1547
|
+
for (let n of je) {
|
|
1548
|
+
let i = e.variants[n], a = L[n];
|
|
1549
1549
|
if (a === "self") {
|
|
1550
|
-
r.push(
|
|
1550
|
+
r.push(Qe(Ke, t, n, i));
|
|
1551
1551
|
continue;
|
|
1552
1552
|
}
|
|
1553
1553
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1554
|
-
r.push(
|
|
1554
|
+
r.push(Xe("decorator", t, n, o, i, Ke));
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
1557
|
for (let e of n) {
|
|
1558
1558
|
let t = e.name;
|
|
1559
|
-
for (let n of
|
|
1560
|
-
let i = e.variants[n], a =
|
|
1559
|
+
for (let n of je) {
|
|
1560
|
+
let i = e.variants[n], a = L[n];
|
|
1561
1561
|
if (a === "self") {
|
|
1562
|
-
r.push(
|
|
1562
|
+
r.push(Qe(Je, t, n, i));
|
|
1563
1563
|
continue;
|
|
1564
1564
|
}
|
|
1565
1565
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1566
|
-
r.push(
|
|
1566
|
+
r.push(Xe("part", t, n, o, i, Je));
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
1569
|
-
return [...r.filter((e) => e.length > 0),
|
|
1570
|
-
},
|
|
1569
|
+
return [...r.filter((e) => e.length > 0), et].join("\n\n");
|
|
1570
|
+
}, et = [
|
|
1571
1571
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1572
1572
|
"[data-flemo-anim-hold=\"park\"],",
|
|
1573
1573
|
"[data-flemo-anim-hold=\"park-under\"],",
|
|
@@ -1576,77 +1576,150 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1576
1576
|
"[data-flemo-anim-hold=\"park-under\"] [data-flemo-part-name] {",
|
|
1577
1577
|
" animation-play-state: paused !important;",
|
|
1578
1578
|
"}"
|
|
1579
|
-
].join("\n"),
|
|
1580
|
-
let n =
|
|
1579
|
+
].join("\n"), tt = (e, t) => {
|
|
1580
|
+
let n = L[t];
|
|
1581
1581
|
if (n === "self") return !1;
|
|
1582
|
-
let r = e.variants[t], i =
|
|
1582
|
+
let r = e.variants[t], i = R(r.options), a = z(r.options);
|
|
1583
1583
|
if (i <= 0 && a <= 0) return !1;
|
|
1584
|
-
let o =
|
|
1584
|
+
let o = V(n === "initial" ? e.initial : e.variants[n].value), s = V(r.value);
|
|
1585
1585
|
return o.length > 0 || s.length > 0;
|
|
1586
|
-
},
|
|
1587
|
-
function
|
|
1586
|
+
}, nt = "data-flemo";
|
|
1587
|
+
function rt() {
|
|
1588
1588
|
if (d()) return;
|
|
1589
|
-
let e =
|
|
1590
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1589
|
+
let e = $e(M.values(), F.values(), I.values()), t = document.head.querySelector(`style[${nt}]`);
|
|
1590
|
+
t || (t = document.createElement("style"), t.setAttribute(nt, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1591
1591
|
}
|
|
1592
1592
|
//#endregion
|
|
1593
1593
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1594
|
-
var
|
|
1594
|
+
var it = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), st = (e, t) => {
|
|
1595
1595
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1596
|
-
},
|
|
1596
|
+
}, ct = (e, t) => {
|
|
1597
1597
|
let n = (e.get(t) ?? 1) - 1;
|
|
1598
1598
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1599
1599
|
};
|
|
1600
|
-
function
|
|
1601
|
-
for (let t of e)
|
|
1602
|
-
for (let e of t)
|
|
1603
|
-
for (let e of n)
|
|
1604
|
-
return
|
|
1605
|
-
for (let t of e)
|
|
1606
|
-
for (let e of t)
|
|
1607
|
-
for (let e of n)
|
|
1608
|
-
|
|
1600
|
+
function lt(e, t, n = []) {
|
|
1601
|
+
for (let t of e) M.set(t.name, t), st(it, t.name);
|
|
1602
|
+
for (let e of t) F.set(e.name, e), st(at, e.name);
|
|
1603
|
+
for (let e of n) I.set(e.name, e), st(ot, e.name);
|
|
1604
|
+
return rt(), () => {
|
|
1605
|
+
for (let t of e) ct(it, t.name) && M.delete(t.name);
|
|
1606
|
+
for (let e of t) ct(at, e.name) && F.delete(e.name);
|
|
1607
|
+
for (let e of n) ct(ot, e.name) && I.delete(e.name);
|
|
1608
|
+
rt();
|
|
1609
1609
|
};
|
|
1610
1610
|
}
|
|
1611
1611
|
//#endregion
|
|
1612
1612
|
//#region src/transition/enteringInitialStyle.ts
|
|
1613
|
-
function
|
|
1613
|
+
function ut(e) {
|
|
1614
1614
|
let { initial: t, isActive: n, status: r } = e;
|
|
1615
1615
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1616
1616
|
let i = {};
|
|
1617
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;
|
|
1618
1618
|
}
|
|
1619
1619
|
//#endregion
|
|
1620
|
-
//#region src/transition/
|
|
1621
|
-
var
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
},
|
|
1620
|
+
//#region src/transition/settleScrub.ts
|
|
1621
|
+
var dt = () => ({
|
|
1622
|
+
request: (e) => requestAnimationFrame(e),
|
|
1623
|
+
cancel: (e) => cancelAnimationFrame(e)
|
|
1624
|
+
}), ft = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), pt = ((e = dt()) => {
|
|
1625
|
+
let t = /* @__PURE__ */ new Map(), n = null, r = () => {
|
|
1626
|
+
t.size === 0 && n !== null && (e.cancel(n), n = null);
|
|
1627
|
+
}, i = (e, n) => {
|
|
1628
|
+
let i = t.get(e);
|
|
1629
|
+
if (i) {
|
|
1630
|
+
if (t.delete(e), clearTimeout(i.backstop), e.isConnected) if (n === "end") for (let e of i.decls) i.writeFinal(e);
|
|
1631
|
+
else {
|
|
1632
|
+
let t = getComputedStyle(e);
|
|
1633
|
+
for (let e of i.decls) {
|
|
1634
|
+
let n = t.getPropertyValue(e.property);
|
|
1635
|
+
n !== "" && i.writeFinal({
|
|
1636
|
+
property: e.property,
|
|
1637
|
+
value: n
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
i.animation.cancel(), i.resolve(), r();
|
|
1642
|
+
}
|
|
1643
|
+
}, a = (r) => {
|
|
1644
|
+
n = null;
|
|
1645
|
+
for (let e of [...t.values()]) {
|
|
1646
|
+
e.startTime === null && (e.startTime = r);
|
|
1647
|
+
let t = r - e.startTime;
|
|
1648
|
+
t >= e.totalMs ? i(e.element, "end") : e.animation.currentTime = Math.max(0, t);
|
|
1649
|
+
}
|
|
1650
|
+
t.size > 0 && (n = e.request(a));
|
|
1651
|
+
};
|
|
1652
|
+
return {
|
|
1653
|
+
settle: (r, o, s, c) => {
|
|
1654
|
+
if (typeof r.animate != "function") return null;
|
|
1655
|
+
i(r, "current");
|
|
1656
|
+
let l = {};
|
|
1657
|
+
for (let e of o) l[ft(e.property)] = e.value;
|
|
1658
|
+
let u;
|
|
1659
|
+
try {
|
|
1660
|
+
u = r.animate([l], {
|
|
1661
|
+
duration: Math.max(0, s.durationMs),
|
|
1662
|
+
delay: Math.max(0, s.delayMs),
|
|
1663
|
+
easing: s.easing,
|
|
1664
|
+
fill: "forwards"
|
|
1665
|
+
}), u.pause(), u.currentTime = 0;
|
|
1666
|
+
} catch {
|
|
1667
|
+
return null;
|
|
1668
|
+
}
|
|
1669
|
+
let d = Math.max(0, s.durationMs) + Math.max(0, s.delayMs);
|
|
1670
|
+
return new Promise((s) => {
|
|
1671
|
+
let l = {
|
|
1672
|
+
element: r,
|
|
1673
|
+
animation: u,
|
|
1674
|
+
decls: o,
|
|
1675
|
+
totalMs: d,
|
|
1676
|
+
startTime: null,
|
|
1677
|
+
writeFinal: c,
|
|
1678
|
+
resolve: s,
|
|
1679
|
+
backstop: setTimeout(() => i(r, "end"), d + 60)
|
|
1680
|
+
};
|
|
1681
|
+
t.set(r, l), n === null && (n = e.request(a));
|
|
1682
|
+
});
|
|
1683
|
+
},
|
|
1684
|
+
takeover: (e) => i(e, "current")
|
|
1685
|
+
};
|
|
1686
|
+
})(), mt = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, W = /* @__PURE__ */ new WeakMap(), G = (e, t) => {
|
|
1687
|
+
let n = W.get(e);
|
|
1688
|
+
n || (n = /* @__PURE__ */ new Set(), W.set(e, n)), n.add(t);
|
|
1689
|
+
}, K = (e, t) => {
|
|
1625
1690
|
if (e.style.transition = "", t) {
|
|
1626
|
-
let n =
|
|
1691
|
+
let n = W.get(e);
|
|
1627
1692
|
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1628
1693
|
return;
|
|
1629
1694
|
}
|
|
1630
|
-
let n =
|
|
1695
|
+
let n = W.get(e);
|
|
1631
1696
|
if (n && n.size > 0) {
|
|
1632
1697
|
for (let t of n) e.style.removeProperty(t);
|
|
1633
1698
|
n.clear();
|
|
1634
1699
|
return;
|
|
1635
1700
|
}
|
|
1636
1701
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1637
|
-
},
|
|
1638
|
-
if (!
|
|
1639
|
-
let r = e, i =
|
|
1702
|
+
}, q = (e, t, n = {}) => {
|
|
1703
|
+
if (!mt(e)) return Promise.resolve();
|
|
1704
|
+
let r = e, i = V(t);
|
|
1640
1705
|
if (i.length === 0) return Promise.resolve();
|
|
1641
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1706
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = U(n.ease);
|
|
1642
1707
|
if (a <= 0 && o <= 0) {
|
|
1643
|
-
r.style.transition = "none";
|
|
1644
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1708
|
+
pt.takeover(r), r.style.transition = "none";
|
|
1709
|
+
for (let e of i) r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1645
1710
|
return Promise.resolve();
|
|
1646
1711
|
}
|
|
1647
|
-
let c =
|
|
1648
|
-
|
|
1649
|
-
|
|
1712
|
+
let c = pt.settle(r, i, {
|
|
1713
|
+
durationMs: a * 1e3,
|
|
1714
|
+
delayMs: o * 1e3,
|
|
1715
|
+
easing: s
|
|
1716
|
+
}, (e) => {
|
|
1717
|
+
r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1718
|
+
});
|
|
1719
|
+
if (c) return c;
|
|
1720
|
+
let l = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1721
|
+
r.style.transition = l, r.offsetWidth;
|
|
1722
|
+
for (let e of i) r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1650
1723
|
return new Promise((e) => {
|
|
1651
1724
|
let t = !1, n = () => {
|
|
1652
1725
|
t || (t = !0, r.removeEventListener("transitionend", i), e());
|
|
@@ -1655,49 +1728,49 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1655
1728
|
};
|
|
1656
1729
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1657
1730
|
});
|
|
1658
|
-
},
|
|
1731
|
+
}, ht = "flemo:motion-driver", gt = "flemo:motion-driver-force", _t = !1, vt = () => {
|
|
1659
1732
|
try {
|
|
1660
1733
|
if (typeof localStorage > "u") return null;
|
|
1661
|
-
let e = localStorage.getItem(
|
|
1662
|
-
return e !== "css" && e !== "raf" ? null : (!
|
|
1734
|
+
let e = localStorage.getItem(gt);
|
|
1735
|
+
return e !== "css" && e !== "raf" ? null : (!_t && typeof console < "u" && (_t = !0, console.warn(`[flemo] motion driver pinned to "${e}" via localStorage ${gt}; remove the key to restore automatic selection.`)), e);
|
|
1663
1736
|
} catch {
|
|
1664
1737
|
return null;
|
|
1665
1738
|
}
|
|
1666
|
-
},
|
|
1739
|
+
}, yt = () => ({
|
|
1667
1740
|
read: () => {
|
|
1668
1741
|
try {
|
|
1669
|
-
return typeof localStorage < "u" ? localStorage.getItem(
|
|
1742
|
+
return typeof localStorage < "u" ? localStorage.getItem(ht) : null;
|
|
1670
1743
|
} catch {
|
|
1671
1744
|
return null;
|
|
1672
1745
|
}
|
|
1673
1746
|
},
|
|
1674
1747
|
write: (e) => {
|
|
1675
1748
|
try {
|
|
1676
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
1749
|
+
typeof localStorage < "u" && localStorage.setItem(ht, e);
|
|
1677
1750
|
} catch {}
|
|
1678
1751
|
}
|
|
1679
|
-
}),
|
|
1752
|
+
}), bt = 30, xt = 2, St = 2, J = ((e = yt()) => {
|
|
1680
1753
|
let t = e.read() === "css", n = t;
|
|
1681
1754
|
t &&= !1;
|
|
1682
1755
|
let r = 0, i = 0, a = [];
|
|
1683
1756
|
return {
|
|
1684
1757
|
playerAllowed: () => {
|
|
1685
|
-
let e =
|
|
1758
|
+
let e = vt();
|
|
1686
1759
|
return e ? e === "raf" : !t;
|
|
1687
1760
|
},
|
|
1688
1761
|
beginRun: () => {
|
|
1689
1762
|
i = 0, a = [];
|
|
1690
1763
|
},
|
|
1691
1764
|
reportGap: (e) => {
|
|
1692
|
-
a.push(e), e >=
|
|
1765
|
+
a.push(e), e >= bt && (i += 1);
|
|
1693
1766
|
},
|
|
1694
1767
|
endRun: () => {
|
|
1695
|
-
let a = i >=
|
|
1768
|
+
let a = i >= xt;
|
|
1696
1769
|
if (n) {
|
|
1697
1770
|
n = !1, a ? t = !0 : e.write("raf");
|
|
1698
1771
|
return;
|
|
1699
1772
|
}
|
|
1700
|
-
a && (r += 1, r >=
|
|
1773
|
+
a && (r += 1, r >= St && !t && (t = !0, e.write("css")));
|
|
1701
1774
|
},
|
|
1702
1775
|
stats: () => ({
|
|
1703
1776
|
runGaps: [...a],
|
|
@@ -1705,7 +1778,7 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1705
1778
|
demoted: t
|
|
1706
1779
|
})
|
|
1707
1780
|
};
|
|
1708
|
-
})(),
|
|
1781
|
+
})(), Ct = (e, t, n, r) => {
|
|
1709
1782
|
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
1783
|
return (e) => {
|
|
1711
1784
|
if (e <= 0) return 0;
|
|
@@ -1717,7 +1790,7 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1717
1790
|
}
|
|
1718
1791
|
return a((t + n) / 2);
|
|
1719
1792
|
};
|
|
1720
|
-
},
|
|
1793
|
+
}, wt = (e) => e, Tt = {
|
|
1721
1794
|
ease: [
|
|
1722
1795
|
.25,
|
|
1723
1796
|
.1,
|
|
@@ -1772,16 +1845,16 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1772
1845
|
.66,
|
|
1773
1846
|
-.56
|
|
1774
1847
|
]
|
|
1775
|
-
},
|
|
1848
|
+
}, Et = (e) => {
|
|
1776
1849
|
if (Array.isArray(e)) {
|
|
1777
1850
|
if (e.length === 4 && e.every((e) => typeof e == "number")) {
|
|
1778
1851
|
let [t, n, r, i] = e;
|
|
1779
|
-
return
|
|
1852
|
+
return Ct(t, n, r, i);
|
|
1780
1853
|
}
|
|
1781
|
-
return
|
|
1854
|
+
return wt;
|
|
1782
1855
|
}
|
|
1783
|
-
return typeof e == "string" ? e === "linear" ?
|
|
1784
|
-
},
|
|
1856
|
+
return typeof e == "string" ? e === "linear" ? wt : Ct(...Tt[e] ?? Tt.ease) : Ct(...Tt.ease);
|
|
1857
|
+
}, Dt = [
|
|
1785
1858
|
"x",
|
|
1786
1859
|
"y",
|
|
1787
1860
|
"z",
|
|
@@ -1792,7 +1865,7 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1792
1865
|
"rotateX",
|
|
1793
1866
|
"rotateY",
|
|
1794
1867
|
"rotateZ"
|
|
1795
|
-
],
|
|
1868
|
+
], Ot = new Set(Dt), kt = {
|
|
1796
1869
|
x: 0,
|
|
1797
1870
|
y: 0,
|
|
1798
1871
|
z: 0,
|
|
@@ -1803,7 +1876,7 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1803
1876
|
rotateX: 0,
|
|
1804
1877
|
rotateY: 0,
|
|
1805
1878
|
rotateZ: 0
|
|
1806
|
-
},
|
|
1879
|
+
}, At = (e, t) => {
|
|
1807
1880
|
if (typeof t == "number") return {
|
|
1808
1881
|
value: t,
|
|
1809
1882
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -1822,26 +1895,26 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1822
1895
|
value: i,
|
|
1823
1896
|
unit: a === "" && i === 0 ? "px" : a
|
|
1824
1897
|
};
|
|
1825
|
-
},
|
|
1826
|
-
let n = e.match(
|
|
1827
|
-
if (n.length !== r.length || e.replace(
|
|
1898
|
+
}, Y = /-?\d*\.?\d+/g, jt = (e, t) => {
|
|
1899
|
+
let n = e.match(Y) ?? [], r = t.match(Y) ?? [];
|
|
1900
|
+
if (n.length !== r.length || e.replace(Y, " ") !== t.replace(Y, " ")) return null;
|
|
1828
1901
|
let i = n.map(Number), a = r.map(Number);
|
|
1829
1902
|
return (t) => {
|
|
1830
1903
|
let n = 0;
|
|
1831
|
-
return e.replace(
|
|
1904
|
+
return e.replace(Y, () => {
|
|
1832
1905
|
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
1833
1906
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
1834
1907
|
});
|
|
1835
1908
|
};
|
|
1836
|
-
},
|
|
1837
|
-
let n = new Set([...
|
|
1909
|
+
}, Mt = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Nt = (e) => typeof e == "object" && !!e && !Array.isArray(e), Pt = (e) => Nt(e) ? Object.keys(e) : [], Ft = (e, t) => Nt(e) ? e[t] : void 0, It = (e, t) => {
|
|
1910
|
+
let n = new Set([...Pt(e.from), ...Pt(e.to)]), r = [], i = null, a = [], o = [];
|
|
1838
1911
|
for (let s of n) {
|
|
1839
|
-
let n =
|
|
1840
|
-
if (
|
|
1912
|
+
let n = Ft(e.from, s), c = Ft(e.to, s);
|
|
1913
|
+
if (Ot.has(s)) {
|
|
1841
1914
|
let e = s, i = {
|
|
1842
|
-
value:
|
|
1915
|
+
value: kt[e],
|
|
1843
1916
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
1844
|
-
}, a = n === void 0 ? i :
|
|
1917
|
+
}, a = n === void 0 ? i : At(e, n), o = c === void 0 ? i : At(e, c);
|
|
1845
1918
|
if (!a || !o || a.unit !== o.unit && a.value !== 0 && o.value !== 0) return null;
|
|
1846
1919
|
let l = a.value === 0 && a.unit !== o.unit ? o.unit : a.unit, u = l === "%", d = 0;
|
|
1847
1920
|
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), r.push({
|
|
@@ -1872,15 +1945,15 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1872
1945
|
if (typeof l != "string" || typeof u != "string") return null;
|
|
1873
1946
|
if (l === u) {
|
|
1874
1947
|
o.push({
|
|
1875
|
-
property:
|
|
1948
|
+
property: Mt(s),
|
|
1876
1949
|
value: l
|
|
1877
1950
|
});
|
|
1878
1951
|
continue;
|
|
1879
1952
|
}
|
|
1880
|
-
let d =
|
|
1953
|
+
let d = jt(l, u);
|
|
1881
1954
|
if (!d) return null;
|
|
1882
1955
|
a.push({
|
|
1883
|
-
property:
|
|
1956
|
+
property: Mt(s),
|
|
1884
1957
|
mix: d
|
|
1885
1958
|
});
|
|
1886
1959
|
}
|
|
@@ -1890,46 +1963,46 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1890
1963
|
strings: a,
|
|
1891
1964
|
constants: o
|
|
1892
1965
|
};
|
|
1893
|
-
},
|
|
1966
|
+
}, Lt = 1, Rt = (e, t, n, r) => {
|
|
1894
1967
|
let i = 0, a = 0, o = !1, s = [], c = !0;
|
|
1895
|
-
for (let l of
|
|
1968
|
+
for (let l of Dt) {
|
|
1896
1969
|
let u = e.find((e) => e.prop === l);
|
|
1897
1970
|
if (!u) continue;
|
|
1898
1971
|
let d = u.from.value + (u.to.value - u.from.value) * t;
|
|
1899
1972
|
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 >=
|
|
1973
|
+
let e = l === "x" ? r.x : r.y, t = (e === null || Math.abs(d - e) * n >= Lt) && n > 0 ? Math.round(d * n) / n : Math.round(d * 1e3) / 1e3;
|
|
1901
1974
|
l === "x" ? (r.x = d, i = t) : (r.y = d, a = t), o = !0, t !== 0 && (c = !1);
|
|
1902
1975
|
continue;
|
|
1903
1976
|
}
|
|
1904
|
-
let f =
|
|
1977
|
+
let f = kt[l];
|
|
1905
1978
|
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
1979
|
}
|
|
1907
1980
|
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
1908
|
-
},
|
|
1981
|
+
}, zt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), Bt = (e) => {
|
|
1909
1982
|
let t = {};
|
|
1910
|
-
for (let n of
|
|
1983
|
+
for (let n of V(e)) t[zt(n.property)] = n.value;
|
|
1911
1984
|
return t;
|
|
1912
|
-
},
|
|
1985
|
+
}, Vt = (e, t) => {
|
|
1913
1986
|
if (typeof e.animate != "function") return null;
|
|
1914
1987
|
try {
|
|
1915
|
-
let n = e.animate([
|
|
1988
|
+
let n = e.animate([Bt(t.from), Bt(t.to)], {
|
|
1916
1989
|
duration: Math.max(0, t.duration * 1e3),
|
|
1917
1990
|
delay: Math.max(0, t.delay * 1e3),
|
|
1918
|
-
easing:
|
|
1991
|
+
easing: U(t.ease),
|
|
1919
1992
|
fill: "both"
|
|
1920
1993
|
});
|
|
1921
1994
|
return n.pause(), n.currentTime = 0, n;
|
|
1922
1995
|
} catch {
|
|
1923
1996
|
return null;
|
|
1924
1997
|
}
|
|
1925
|
-
},
|
|
1998
|
+
}, Ht = () => ({
|
|
1926
1999
|
request: (e) => requestAnimationFrame(e),
|
|
1927
2000
|
cancel: (e) => cancelAnimationFrame(e),
|
|
1928
2001
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
1929
|
-
}),
|
|
2002
|
+
}), X = ((e = Ht()) => {
|
|
1930
2003
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
1931
2004
|
join: (n, r) => {
|
|
1932
|
-
let i =
|
|
2005
|
+
let i = It(r.motion, r.element), s = i ? null : Vt(r.element, r.motion);
|
|
1933
2006
|
if (!i && !s) return null;
|
|
1934
2007
|
let c = t.get(n);
|
|
1935
2008
|
c || (c = {
|
|
@@ -1950,14 +2023,14 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1950
2023
|
y: null
|
|
1951
2024
|
}
|
|
1952
2025
|
};
|
|
1953
|
-
if (c.tracks.push(l), l.element.style.animation = "none",
|
|
1954
|
-
i.transforms.length > 0 &&
|
|
1955
|
-
for (let e of i.strings)
|
|
1956
|
-
for (let e of i.constants)
|
|
2026
|
+
if (c.tracks.push(l), l.element.style.animation = "none", G(l.element, "animation"), i) {
|
|
2027
|
+
i.transforms.length > 0 && G(l.element, "transform"), i.opacity && G(l.element, "opacity");
|
|
2028
|
+
for (let e of i.strings) G(l.element, e.property);
|
|
2029
|
+
for (let e of i.constants) G(l.element, e.property);
|
|
1957
2030
|
a(l, 0);
|
|
1958
2031
|
}
|
|
1959
|
-
return r.role === "active" && !c.started && (c.started = !0,
|
|
1960
|
-
l.detached = !0, l.scrub?.cancel(),
|
|
2032
|
+
return r.role === "active" && !c.started && (c.started = !0, J.beginRun(), o(n, c)), () => {
|
|
2033
|
+
l.detached = !0, l.scrub?.cancel(), K(l.element);
|
|
1961
2034
|
let r = t.get(n);
|
|
1962
2035
|
r && (r.tracks = r.tracks.filter((e) => e !== l), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
1963
2036
|
};
|
|
@@ -1972,13 +2045,13 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1972
2045
|
}
|
|
1973
2046
|
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
1974
2047
|
let t = r.get(e);
|
|
1975
|
-
return t || (t =
|
|
2048
|
+
return t || (t = Et(e.motion.ease), r.set(e, t)), t;
|
|
1976
2049
|
};
|
|
1977
2050
|
function a(t, n) {
|
|
1978
2051
|
let { element: r, parsed: i } = t;
|
|
1979
2052
|
if (!(!i || !r.isConnected)) {
|
|
1980
2053
|
if (i.transforms.length > 0) {
|
|
1981
|
-
let a =
|
|
2054
|
+
let a = Rt(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
1982
2055
|
a !== "" && (r.style.transform = a);
|
|
1983
2056
|
}
|
|
1984
2057
|
if (i.opacity) {
|
|
@@ -1995,7 +2068,7 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1995
2068
|
});
|
|
1996
2069
|
}
|
|
1997
2070
|
function s(e, r, s) {
|
|
1998
|
-
r.startTime === null && (r.startTime = s), r.lastTime !== null && (
|
|
2071
|
+
r.startTime === null && (r.startTime = s), r.lastTime !== null && (J.reportGap(s - r.lastTime), n.onFrameGap?.(s - r.lastTime)), r.lastTime = s;
|
|
1999
2072
|
let c = !0;
|
|
2000
2073
|
for (let e of r.tracks) {
|
|
2001
2074
|
if (e.completed || e.detached) continue;
|
|
@@ -2009,14 +2082,14 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
2009
2082
|
a(e, i(e)(l)), l >= 1 ? (e.completed = !0, e.onComplete?.()) : c = !1;
|
|
2010
2083
|
}
|
|
2011
2084
|
if (c) {
|
|
2012
|
-
|
|
2085
|
+
J.endRun(), t.delete(e);
|
|
2013
2086
|
return;
|
|
2014
2087
|
}
|
|
2015
2088
|
o(e, r);
|
|
2016
2089
|
}
|
|
2017
2090
|
return n;
|
|
2018
2091
|
})();
|
|
2019
|
-
|
|
2092
|
+
X.onFrameGap = (e) => {
|
|
2020
2093
|
if (typeof window < "u") {
|
|
2021
2094
|
let t = window.__flemoPlayerGaps ??= [];
|
|
2022
2095
|
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
@@ -2024,17 +2097,26 @@ Y.onFrameGap = (e) => {
|
|
|
2024
2097
|
};
|
|
2025
2098
|
//#endregion
|
|
2026
2099
|
//#region src/core/engine/types.ts
|
|
2027
|
-
var
|
|
2028
|
-
|
|
2100
|
+
var Z = "data-flemo-skip-animation", Q = () => {}, Ut = "data-flemo-part-name", Wt = (e) => {
|
|
2101
|
+
let t = e.parentElement ?? e;
|
|
2102
|
+
return Array.from(t.querySelectorAll(`[${Ut}]`)).filter((n) => {
|
|
2103
|
+
let r = n.closest("[data-flemo-screen]");
|
|
2104
|
+
return !r || r === e || !t.contains(r);
|
|
2105
|
+
});
|
|
2106
|
+
}, Gt = (e, t) => {
|
|
2107
|
+
let [n, r] = t.split("-");
|
|
2108
|
+
return Wt(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2109
|
+
};
|
|
2110
|
+
function Kt(e) {
|
|
2029
2111
|
return { driveScreenLifecycle: (t) => {
|
|
2030
2112
|
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
2113
|
let s = e.getTransitionTaskId();
|
|
2032
|
-
if (!s || o.pendingTaskIds.some((e) => e !== s) || !
|
|
2114
|
+
if (!s || o.pendingTaskIds.some((e) => e !== s) || !J.playerAllowed()) return null;
|
|
2033
2115
|
let { scope: c, decorator: l, bars: u } = n();
|
|
2034
2116
|
if (!c) return null;
|
|
2035
|
-
let d =
|
|
2117
|
+
let d = N(r), f = B(d, t);
|
|
2036
2118
|
if (!f) return null;
|
|
2037
|
-
let p = [], m =
|
|
2119
|
+
let p = [], m = X.join(s, {
|
|
2038
2120
|
element: c,
|
|
2039
2121
|
motion: f,
|
|
2040
2122
|
role: i,
|
|
@@ -2044,7 +2126,7 @@ function Vt(e) {
|
|
|
2044
2126
|
p.push(m);
|
|
2045
2127
|
for (let e of u ?? []) {
|
|
2046
2128
|
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2047
|
-
let t =
|
|
2129
|
+
let t = X.join(s, {
|
|
2048
2130
|
element: e,
|
|
2049
2131
|
motion: f,
|
|
2050
2132
|
role: "passive"
|
|
@@ -2052,9 +2134,9 @@ function Vt(e) {
|
|
|
2052
2134
|
t && p.push(t);
|
|
2053
2135
|
}
|
|
2054
2136
|
if (l && d.decoratorName) {
|
|
2055
|
-
let e =
|
|
2137
|
+
let e = F.get(d.decoratorName), n = e ? B(e, t) : null;
|
|
2056
2138
|
if (n) {
|
|
2057
|
-
let e =
|
|
2139
|
+
let e = X.join(s, {
|
|
2058
2140
|
element: l,
|
|
2059
2141
|
motion: n,
|
|
2060
2142
|
role: "passive"
|
|
@@ -2062,37 +2144,55 @@ function Vt(e) {
|
|
|
2062
2144
|
e && p.push(e);
|
|
2063
2145
|
}
|
|
2064
2146
|
}
|
|
2147
|
+
for (let e of Gt(c, t)) {
|
|
2148
|
+
let n = I.get(e.getAttribute(Ut)), r = n ? B(n, t) : null;
|
|
2149
|
+
if (!r) continue;
|
|
2150
|
+
let i = X.join(s, {
|
|
2151
|
+
element: e,
|
|
2152
|
+
motion: r,
|
|
2153
|
+
role: "passive"
|
|
2154
|
+
});
|
|
2155
|
+
i && p.push(i);
|
|
2156
|
+
}
|
|
2065
2157
|
return () => p.forEach((e) => e());
|
|
2066
2158
|
};
|
|
2067
2159
|
if (!s) {
|
|
2068
2160
|
if (a === "COMPLETED") {
|
|
2069
2161
|
let { scope: e, decorator: t, bars: r } = n();
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2162
|
+
if (e) {
|
|
2163
|
+
K(e);
|
|
2164
|
+
for (let t of Wt(e)) K(t);
|
|
2165
|
+
}
|
|
2166
|
+
t && K(t);
|
|
2167
|
+
for (let e of r ?? []) e && K(e);
|
|
2168
|
+
return Q;
|
|
2073
2169
|
}
|
|
2074
2170
|
if (a === "REPLACING" && i !== r && e.setReplaceTransitionStatus("PENDING"), l && c) {
|
|
2075
2171
|
let e = u(`${a}-false`, "passive");
|
|
2076
2172
|
if (e) return e;
|
|
2077
2173
|
}
|
|
2078
|
-
return
|
|
2174
|
+
return Q;
|
|
2079
2175
|
}
|
|
2080
2176
|
if (a === "COMPLETED") {
|
|
2081
2177
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
2082
2178
|
let { scope: t, decorator: r, bars: i } = n();
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2179
|
+
if (t) {
|
|
2180
|
+
K(t), t.removeAttribute(Z);
|
|
2181
|
+
for (let e of Wt(t)) K(e);
|
|
2182
|
+
}
|
|
2183
|
+
r && (K(r), r.removeAttribute(Z));
|
|
2184
|
+
for (let e of i ?? []) e && (K(e), e.style.removeProperty("will-change"));
|
|
2185
|
+
return Q;
|
|
2086
2186
|
}
|
|
2087
|
-
if (a === "IDLE") return
|
|
2187
|
+
if (a === "IDLE") return Q;
|
|
2088
2188
|
let { scope: d } = n();
|
|
2089
|
-
if (!d) return
|
|
2189
|
+
if (!d) return Q;
|
|
2090
2190
|
let f = () => {
|
|
2091
2191
|
let t = e.getTransitionTaskId();
|
|
2092
2192
|
t && o.resolveTask(t);
|
|
2093
|
-
}, p =
|
|
2094
|
-
if (!(!h &&
|
|
2095
|
-
let g =
|
|
2193
|
+
}, p = N(r), m = `${a}-true`, h = d.getAttribute(Z) === "true";
|
|
2194
|
+
if (!(!h && tt(p, m))) return queueMicrotask(f), Q;
|
|
2195
|
+
let g = B(p, m), _ = !h && !!g, v = Ye("screen", r, m), y = (e) => {
|
|
2096
2196
|
e.target === d && e.animationName === v && (d.removeEventListener("animationend", y), f());
|
|
2097
2197
|
};
|
|
2098
2198
|
d.addEventListener("animationend", y);
|
|
@@ -2104,20 +2204,20 @@ function Vt(e) {
|
|
|
2104
2204
|
}
|
|
2105
2205
|
//#endregion
|
|
2106
2206
|
//#region src/utils/findScrollable.ts
|
|
2107
|
-
function
|
|
2108
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
2207
|
+
function qt(e, t) {
|
|
2208
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Jt(e);
|
|
2109
2209
|
if (!o) return {
|
|
2110
2210
|
element: null,
|
|
2111
2211
|
hasMarker: !1
|
|
2112
2212
|
};
|
|
2113
2213
|
let s = o.closest?.(r);
|
|
2114
|
-
if (s instanceof HTMLElement &&
|
|
2214
|
+
if (s instanceof HTMLElement && $(s, n) && (!a || Yt(s, n))) return {
|
|
2115
2215
|
element: s,
|
|
2116
2216
|
hasMarker: !0
|
|
2117
2217
|
};
|
|
2118
2218
|
let c = o, l = 0;
|
|
2119
2219
|
for (; c && l < i;) {
|
|
2120
|
-
if (
|
|
2220
|
+
if ($(c, n) && (!a || Yt(c, n))) return {
|
|
2121
2221
|
element: c,
|
|
2122
2222
|
hasMarker: !1
|
|
2123
2223
|
};
|
|
@@ -2128,7 +2228,7 @@ function Ht(e, t) {
|
|
|
2128
2228
|
hasMarker: !1
|
|
2129
2229
|
};
|
|
2130
2230
|
}
|
|
2131
|
-
function
|
|
2231
|
+
function Jt(e) {
|
|
2132
2232
|
if (!e) return null;
|
|
2133
2233
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2134
2234
|
if (n && n.length) {
|
|
@@ -2136,18 +2236,18 @@ function Ut(e) {
|
|
|
2136
2236
|
}
|
|
2137
2237
|
return e instanceof HTMLElement ? e : null;
|
|
2138
2238
|
}
|
|
2139
|
-
function
|
|
2239
|
+
function $(e, t) {
|
|
2140
2240
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2141
2241
|
}
|
|
2142
|
-
function
|
|
2143
|
-
if (
|
|
2242
|
+
function Yt(e, t) {
|
|
2243
|
+
if (!$(e, t) || typeof window > "u") return !1;
|
|
2144
2244
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2145
2245
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2146
2246
|
}
|
|
2147
2247
|
//#endregion
|
|
2148
2248
|
//#region src/core/engine/createSwipeController.ts
|
|
2149
|
-
var
|
|
2150
|
-
function
|
|
2249
|
+
var Xt = "data-flemo-skip-animation";
|
|
2250
|
+
function Zt(e) {
|
|
2151
2251
|
let t = null, n = null, r = {
|
|
2152
2252
|
current: [],
|
|
2153
2253
|
prev: []
|
|
@@ -2193,9 +2293,9 @@ function Gt(e) {
|
|
|
2193
2293
|
y: e.clientY
|
|
2194
2294
|
}, u = t;
|
|
2195
2295
|
}, v = (n, i, a) => {
|
|
2196
|
-
let o =
|
|
2197
|
-
if (n === e.getElements().scope) for (let e of r.current)
|
|
2198
|
-
else if (n === t) for (let e of r.prev)
|
|
2296
|
+
let o = q(n, i, a);
|
|
2297
|
+
if (n === e.getElements().scope) for (let e of r.current) q(e, i, a);
|
|
2298
|
+
else if (n === t) for (let e of r.prev) q(e, i, a);
|
|
2199
2299
|
return o;
|
|
2200
2300
|
}, y = (t) => {
|
|
2201
2301
|
let n = e.getPartnerBars(), i = [], { sharedTopBar: a, sharedBottomBar: o } = e.getElements();
|
|
@@ -2209,12 +2309,12 @@ function Gt(e) {
|
|
|
2209
2309
|
current: i,
|
|
2210
2310
|
prev: s
|
|
2211
2311
|
};
|
|
2212
|
-
let c =
|
|
2312
|
+
let c = We(e.getTransition()).join(", ");
|
|
2213
2313
|
for (let e of i) e.style.willChange = c;
|
|
2214
2314
|
for (let e of s) e.style.willChange = c;
|
|
2215
2315
|
}, b = () => {
|
|
2216
|
-
for (let e of r.current)
|
|
2217
|
-
for (let e of r.prev)
|
|
2316
|
+
for (let e of r.current) K(e), e.style.removeProperty("will-change");
|
|
2317
|
+
for (let e of r.prev) K(e), e.style.removeProperty("will-change");
|
|
2218
2318
|
r = {
|
|
2219
2319
|
current: [],
|
|
2220
2320
|
prev: []
|
|
@@ -2227,10 +2327,10 @@ function Gt(e) {
|
|
|
2227
2327
|
};
|
|
2228
2328
|
}, S = (e, t, n) => {
|
|
2229
2329
|
let r = (r, i) => {
|
|
2230
|
-
let a =
|
|
2330
|
+
let a = I.get(r.getAttribute("data-flemo-part-name"));
|
|
2231
2331
|
if (!a) return;
|
|
2232
2332
|
let o = {
|
|
2233
|
-
animate:
|
|
2333
|
+
animate: q,
|
|
2234
2334
|
element: r,
|
|
2235
2335
|
active: i
|
|
2236
2336
|
};
|
|
@@ -2239,7 +2339,7 @@ function Gt(e) {
|
|
|
2239
2339
|
for (let e of i.current) r(e, !0);
|
|
2240
2340
|
for (let e of i.prev) r(e, !1);
|
|
2241
2341
|
}, C = () => {
|
|
2242
|
-
for (let e of [...i.current, ...i.prev])
|
|
2342
|
+
for (let e of [...i.current, ...i.prev]) K(e);
|
|
2243
2343
|
i = {
|
|
2244
2344
|
current: [],
|
|
2245
2345
|
prev: []
|
|
@@ -2268,7 +2368,7 @@ function Gt(e) {
|
|
|
2268
2368
|
prevScreen: t,
|
|
2269
2369
|
onStart: (e) => {
|
|
2270
2370
|
m?.onSwipeStart?.(e, {
|
|
2271
|
-
animate:
|
|
2371
|
+
animate: q,
|
|
2272
2372
|
currentDecorator: f,
|
|
2273
2373
|
prevDecorator: n
|
|
2274
2374
|
}), S("start", e, 0);
|
|
@@ -2285,7 +2385,7 @@ function Gt(e) {
|
|
|
2285
2385
|
prevScreen: t,
|
|
2286
2386
|
onProgress: (e, t) => {
|
|
2287
2387
|
c?.onSwipe?.(e, t, {
|
|
2288
|
-
animate:
|
|
2388
|
+
animate: q,
|
|
2289
2389
|
currentDecorator: o,
|
|
2290
2390
|
prevDecorator: n
|
|
2291
2391
|
}), S("swipe", e, t);
|
|
@@ -2304,32 +2404,32 @@ function Gt(e) {
|
|
|
2304
2404
|
prevScreen: t,
|
|
2305
2405
|
onStart: (e) => {
|
|
2306
2406
|
u?.onSwipeEnd?.(e, {
|
|
2307
|
-
animate:
|
|
2407
|
+
animate: q,
|
|
2308
2408
|
currentDecorator: l,
|
|
2309
2409
|
prevDecorator: n
|
|
2310
2410
|
}), S("end", e, 0);
|
|
2311
2411
|
}
|
|
2312
2412
|
})) {
|
|
2313
|
-
c?.setAttribute(
|
|
2413
|
+
c?.setAttribute(Xt, "true"), l?.setAttribute(Xt, "true");
|
|
2314
2414
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
2315
|
-
for (let e of r.prev)
|
|
2415
|
+
for (let e of r.prev) K(e), e.style.removeProperty("will-change");
|
|
2316
2416
|
r = {
|
|
2317
2417
|
current: [],
|
|
2318
2418
|
prev: []
|
|
2319
2419
|
};
|
|
2320
|
-
for (let e of i.prev)
|
|
2420
|
+
for (let e of i.prev) K(e);
|
|
2321
2421
|
i = {
|
|
2322
2422
|
current: [],
|
|
2323
2423
|
prev: []
|
|
2324
2424
|
}, e.back();
|
|
2325
|
-
} else c &&
|
|
2425
|
+
} else c && K(c), t && K(t), l && K(l), n && K(n), b(), C(), e.setDragStatus("IDLE");
|
|
2326
2426
|
};
|
|
2327
2427
|
return {
|
|
2328
2428
|
pointerDown: (t) => {
|
|
2329
|
-
e.isReadyForDrag() && (f =
|
|
2429
|
+
e.isReadyForDrag() && (f = qt(t.target, {
|
|
2330
2430
|
direction: "x",
|
|
2331
2431
|
verifyByScroll: !0
|
|
2332
|
-
}), p =
|
|
2432
|
+
}), p = qt(t.target, {
|
|
2333
2433
|
direction: "y",
|
|
2334
2434
|
verifyByScroll: !0
|
|
2335
2435
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -2358,7 +2458,7 @@ function Gt(e) {
|
|
|
2358
2458
|
}
|
|
2359
2459
|
//#endregion
|
|
2360
2460
|
//#region src/screen/computeBarRiding.ts
|
|
2361
|
-
function
|
|
2461
|
+
function Qt(e) {
|
|
2362
2462
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
2363
2463
|
app: !1,
|
|
2364
2464
|
nav: !1
|
|
@@ -2369,24 +2469,24 @@ function Kt(e) {
|
|
|
2369
2469
|
}
|
|
2370
2470
|
//#endregion
|
|
2371
2471
|
//#region src/screen/animStartAnchor.ts
|
|
2372
|
-
function
|
|
2472
|
+
function $t(e) {
|
|
2373
2473
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
2374
2474
|
}
|
|
2375
|
-
var
|
|
2376
|
-
function
|
|
2377
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0,
|
|
2475
|
+
var en = 300, tn = 20;
|
|
2476
|
+
function nn(e) {
|
|
2477
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, tn);
|
|
2378
2478
|
}
|
|
2379
|
-
function
|
|
2380
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
2479
|
+
function rn(e) {
|
|
2480
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of nn(e)) t.decode().catch(() => {});
|
|
2381
2481
|
}
|
|
2382
|
-
function
|
|
2482
|
+
function an(e, t = {}) {
|
|
2383
2483
|
let n = !1, r = 0, i = [], a = () => {
|
|
2384
2484
|
let r = t.scope;
|
|
2385
2485
|
if (!r || typeof r.querySelectorAll != "function") {
|
|
2386
2486
|
e();
|
|
2387
2487
|
return;
|
|
2388
2488
|
}
|
|
2389
|
-
let i =
|
|
2489
|
+
let i = nn(r);
|
|
2390
2490
|
if (i.length === 0) {
|
|
2391
2491
|
e();
|
|
2392
2492
|
return;
|
|
@@ -2412,7 +2512,7 @@ function Qt(e, t = {}) {
|
|
|
2412
2512
|
}
|
|
2413
2513
|
//#endregion
|
|
2414
2514
|
//#region src/screen/observeBarHeight.ts
|
|
2415
|
-
function
|
|
2515
|
+
function on(e, t) {
|
|
2416
2516
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
2417
2517
|
let n = new ResizeObserver(([e]) => {
|
|
2418
2518
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -2423,14 +2523,14 @@ function $t(e, t) {
|
|
|
2423
2523
|
}
|
|
2424
2524
|
//#endregion
|
|
2425
2525
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
2426
|
-
var
|
|
2427
|
-
function
|
|
2526
|
+
var sn = 0;
|
|
2527
|
+
function cn(e) {
|
|
2428
2528
|
let t = 0, n = () => {
|
|
2429
2529
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
2430
2530
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
2431
2531
|
t = t < 0 ? 0 : t;
|
|
2432
|
-
let n = t -
|
|
2433
|
-
n = n < 0 ? 0 : n,
|
|
2532
|
+
let n = t - sn;
|
|
2533
|
+
n = n < 0 ? 0 : n, sn ||= t, e(t, n);
|
|
2434
2534
|
});
|
|
2435
2535
|
};
|
|
2436
2536
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -2439,7 +2539,7 @@ function tn(e) {
|
|
|
2439
2539
|
}
|
|
2440
2540
|
//#endregion
|
|
2441
2541
|
//#region src/utils/isOpaqueColor.ts
|
|
2442
|
-
function
|
|
2542
|
+
function ln(e) {
|
|
2443
2543
|
let t = e.trim().toLowerCase();
|
|
2444
2544
|
if (t === "transparent" || t === "") return !1;
|
|
2445
2545
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -2450,7 +2550,7 @@ function nn(e) {
|
|
|
2450
2550
|
}
|
|
2451
2551
|
//#endregion
|
|
2452
2552
|
//#region src/utils/buildRoutePath.ts
|
|
2453
|
-
function
|
|
2553
|
+
function un(e, n) {
|
|
2454
2554
|
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();
|
|
2455
2555
|
return {
|
|
2456
2556
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -2458,4 +2558,4 @@ function rn(e, n) {
|
|
|
2458
2558
|
};
|
|
2459
2559
|
}
|
|
2460
2560
|
//#endregion
|
|
2461
|
-
export {
|
|
2561
|
+
export { en as ANIM_HOLD_RELEASE_BACKSTOP_MS, Z as SKIP_ANIMATION_ATTR, o as TaskManger, $t as animHoldKey, q as animateInline, Ye as animationName, oe as appendParamsQuery, rt as applyTransitionStyles, un as buildRoutePath, Yt as canProgrammaticallyScroll, K as clearInlineAnimation, We as collectAnimatedProperties, $e as compileTransitionStyles, Qt as computeBarRiding, ge as computeScreenFreeze, y as consumeSelfInducedPop, h as createBrowserHistoryDriver, we as createDecorator, s as createHistoryStore, b as createHistorySync, ne as createMemoryHistoryDriver, re as createNavigateStore, ie as createNavigationController, De as createPartTransition, Te as createRawDecorator, Oe as createRawPartTransition, _e as createRawTransition, me as createRouterScope, he as createScreenSelector, de as createScreenStore, g as createSelfPopGuard, se as createStepController, Zt as createSwipeController, j as createTransition, Kt as createTransitionEngine, le as createTransitionStore, ye as cupertino, F as decoratorMap, rn as eagerlyDecodeImages, U as easingToCss, ee as ensureScopeHistorySync, f as ensureWindowHistoryState, ut as enteringInitialStyle, qt as findScrollable, c as getMatchedPathPattern, l as getParams, ln as isOpaqueColor, d as isServer, xe as layout, v as markSelfInducedPop, ue as matchesPathname, Se as material, Ce as none, on as observeBarHeight, cn as observeViewportScrollHeight, $ as overflowsAxis, Ee as overlay, I as partTransitionMap, ae as readStepParams, lt as registerTransitionDefinitions, te as releaseScopeHistorySync, N as resolveTransition, an as scheduleAnimHoldRelease, u as seedInitialHistory, p as seedRouterEntry, ce as subscribeStepParamsRestore, V as targetToDecls, M as transitionMap, tt as variantHasAnimation };
|