@flemo/core 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,6 +13,7 @@ export interface DriverPolicy {
|
|
|
13
13
|
demoted: boolean;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const detectBlinkEngine: () => boolean;
|
|
17
|
+
export declare const createDriverPolicy: (storage?: DriverPolicyStorage, playerByDefault?: boolean) => DriverPolicy;
|
|
17
18
|
declare const driverPolicy: DriverPolicy;
|
|
18
19
|
export default driverPolicy;
|
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,16 +1258,16 @@ var ye = (e, t, n) => {
|
|
|
1258
1258
|
value: {},
|
|
1259
1259
|
options: { duration: 0 }
|
|
1260
1260
|
}
|
|
1261
|
-
}),
|
|
1262
|
-
["none",
|
|
1263
|
-
["cupertino",
|
|
1264
|
-
["material",
|
|
1265
|
-
["layout",
|
|
1261
|
+
}), M = new Map([
|
|
1262
|
+
["none", Ce],
|
|
1263
|
+
["cupertino", ye],
|
|
1264
|
+
["material", Se],
|
|
1265
|
+
["layout", xe]
|
|
1266
1266
|
]);
|
|
1267
1267
|
//#endregion
|
|
1268
1268
|
//#region src/transition/resolveTransition.ts
|
|
1269
|
-
function
|
|
1270
|
-
return
|
|
1269
|
+
function we(e) {
|
|
1270
|
+
return M.get(e) ?? M.get("none");
|
|
1271
1271
|
}
|
|
1272
1272
|
//#endregion
|
|
1273
1273
|
//#region src/transition/decorator/createDecorator.ts
|
|
@@ -1408,7 +1408,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1408
1408
|
}, R = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, je = (e, t) => {
|
|
1409
1409
|
let n = I[t];
|
|
1410
1410
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1411
|
-
},
|
|
1411
|
+
}, z = (e, t) => {
|
|
1412
1412
|
let n = je(e, t);
|
|
1413
1413
|
if (n === null) return null;
|
|
1414
1414
|
let r = e.variants[t], i = L(r.options), a = R(r.options);
|
|
@@ -1419,7 +1419,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1419
1419
|
delay: a,
|
|
1420
1420
|
ease: r.options?.ease
|
|
1421
1421
|
};
|
|
1422
|
-
},
|
|
1422
|
+
}, Me = Ae, Ne = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Pe = (e) => typeof e == "object" && !!e && !Array.isArray(e), Fe = new Set(/* @__PURE__ */ "opacity.scale.scaleX.scaleY.scaleZ.aspectRatio.columnCount.columns.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineHeight.lineClamp.order.orphans.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeWidth".split(".")), Ie = (e, t) => t.startsWith("--") || Fe.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Le = (e, t) => typeof t == "number" ? Ie(t, e) : typeof t == "string" ? t : "", Re = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), ze = new Set([
|
|
1423
1423
|
"x",
|
|
1424
1424
|
"y",
|
|
1425
1425
|
"z",
|
|
@@ -1430,7 +1430,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1430
1430
|
"rotateX",
|
|
1431
1431
|
"rotateY",
|
|
1432
1432
|
"rotateZ"
|
|
1433
|
-
]),
|
|
1433
|
+
]), Be = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, Ve = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, He = /^1(\.0+)?$/, Ue = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? He.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? Ve.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? Be.test(t.trim()) : !1, We = (e, t) => {
|
|
1434
1434
|
switch (e) {
|
|
1435
1435
|
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1436
1436
|
case "y": return `translate3d(0, ${t}, 0)`;
|
|
@@ -1444,16 +1444,16 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1444
1444
|
case "rotateY": return `rotateY(${t})`;
|
|
1445
1445
|
default: return "";
|
|
1446
1446
|
}
|
|
1447
|
-
},
|
|
1447
|
+
}, Ge = (e) => {
|
|
1448
1448
|
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1449
|
-
if (!
|
|
1449
|
+
if (!Pe(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 = Le(r, i);
|
|
1453
|
+
if (a !== "") if (ze.has(r)) n.push(`${r}:${a}`);
|
|
1454
1454
|
else {
|
|
1455
|
-
let e = t.get(
|
|
1456
|
-
e.add(a), t.set(
|
|
1455
|
+
let e = t.get(Re(r)) ?? /* @__PURE__ */ new Set();
|
|
1456
|
+
e.add(a), t.set(Re(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
|
+
}, B = (e) => {
|
|
1467
|
+
if (!Pe(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 = Le(i, a);
|
|
1471
|
+
o !== "" && (ze.has(i) ? (t.push(We(i, o)), Ue(i, a) || (n = !1)) : r.push({
|
|
1472
|
+
property: Re(i),
|
|
1473
1473
|
value: o
|
|
1474
1474
|
}));
|
|
1475
1475
|
}
|
|
@@ -1477,7 +1477,7 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1477
1477
|
property: "transform",
|
|
1478
1478
|
value: n ? "none" : t.join(" ")
|
|
1479
1479
|
}), r;
|
|
1480
|
-
},
|
|
1480
|
+
}, V = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), H = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1481
1481
|
linear: "linear",
|
|
1482
1482
|
easeIn: "ease-in",
|
|
1483
1483
|
easeOut: "ease-out",
|
|
@@ -1487,29 +1487,29 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1487
1487
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1488
1488
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1489
1489
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1490
|
-
}[e] ?? "ease" : "ease",
|
|
1490
|
+
}[e] ?? "ease" : "ease", Ke = (e, t) => {
|
|
1491
1491
|
let [n, r] = t.split("-");
|
|
1492
1492
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1493
|
-
},
|
|
1493
|
+
}, qe = (e, t) => {
|
|
1494
1494
|
let [n, r] = t.split("-");
|
|
1495
1495
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1496
|
-
},
|
|
1496
|
+
}, Je = (e, t) => {
|
|
1497
1497
|
let [n, r] = t.split("-");
|
|
1498
1498
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1499
|
-
},
|
|
1499
|
+
}, Ye = (e, t) => {
|
|
1500
1500
|
let [n, r] = t.split("-");
|
|
1501
1501
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1502
|
-
},
|
|
1503
|
-
let o =
|
|
1502
|
+
}, Xe = (e, t, n) => `flemo-${e}-${Ne(t)}-${n}`, Ze = (e, t, n, r, i, a) => {
|
|
1503
|
+
let o = B(r), s = B(i.value), c = L(i.options), l = R(i.options), u = H(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Je(t, n)}` : d;
|
|
1504
1504
|
if (s.length === 0 && o.length === 0) return "";
|
|
1505
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1506
|
-
let p =
|
|
1505
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${V(s)}\n animation: none;\n}`;
|
|
1506
|
+
let p = Xe(e, t, n), m = [
|
|
1507
1507
|
`@keyframes ${p} {`,
|
|
1508
1508
|
" from {",
|
|
1509
|
-
|
|
1509
|
+
V(o).replace(/^/gm, " "),
|
|
1510
1510
|
" }",
|
|
1511
1511
|
" to {",
|
|
1512
|
-
|
|
1512
|
+
V(s).replace(/^/gm, " "),
|
|
1513
1513
|
" }",
|
|
1514
1514
|
"}"
|
|
1515
1515
|
].join("\n"), h = [
|
|
@@ -1519,15 +1519,15 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1519
1519
|
l > 0 ? `${l}s` : null,
|
|
1520
1520
|
"both"
|
|
1521
1521
|
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1522
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Qe(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${
|
|
1522
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Qe(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${V(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && Qe(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${V(s)}\n}` : ""}`;
|
|
1523
1523
|
}, Qe = (e) => {
|
|
1524
1524
|
if (!e) return !1;
|
|
1525
1525
|
if (e.opacity === 0) return !0;
|
|
1526
1526
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1527
1527
|
return t(e.x) || t(e.y);
|
|
1528
1528
|
}, $e = (e, t, n, r) => {
|
|
1529
|
-
let i =
|
|
1530
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1529
|
+
let i = B(r.value);
|
|
1530
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${V(i)}\n}`;
|
|
1531
1531
|
}, et = (e, t, n = []) => {
|
|
1532
1532
|
let r = [];
|
|
1533
1533
|
for (let t of e) {
|
|
@@ -1535,35 +1535,35 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1535
1535
|
for (let n of Ae) {
|
|
1536
1536
|
let i = t.variants[n], a = I[n];
|
|
1537
1537
|
if (a === "self") {
|
|
1538
|
-
r.push($e(
|
|
1538
|
+
r.push($e(Ke, e, n, i));
|
|
1539
1539
|
continue;
|
|
1540
1540
|
}
|
|
1541
1541
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1542
|
-
r.push(
|
|
1542
|
+
r.push(Ze("screen", e, n, o, i, Ke));
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
1545
|
for (let e of t) {
|
|
1546
1546
|
let t = e.name;
|
|
1547
|
-
for (let n of
|
|
1547
|
+
for (let n of Me) {
|
|
1548
1548
|
let i = e.variants[n], a = I[n];
|
|
1549
1549
|
if (a === "self") {
|
|
1550
|
-
r.push($e(
|
|
1550
|
+
r.push($e(qe, t, n, i));
|
|
1551
1551
|
continue;
|
|
1552
1552
|
}
|
|
1553
1553
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1554
|
-
r.push(
|
|
1554
|
+
r.push(Ze("decorator", t, n, o, i, qe));
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
1557
|
for (let e of n) {
|
|
1558
1558
|
let t = e.name;
|
|
1559
|
-
for (let n of
|
|
1559
|
+
for (let n of Me) {
|
|
1560
1560
|
let i = e.variants[n], a = I[n];
|
|
1561
1561
|
if (a === "self") {
|
|
1562
|
-
r.push($e(
|
|
1562
|
+
r.push($e(Ye, t, n, i));
|
|
1563
1563
|
continue;
|
|
1564
1564
|
}
|
|
1565
1565
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1566
|
-
r.push(
|
|
1566
|
+
r.push(Ze("part", t, n, o, i, Ye));
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
1569
1569
|
return [...r.filter((e) => e.length > 0), tt].join("\n\n");
|
|
@@ -1581,12 +1581,12 @@ var F = /* @__PURE__ */ new Map(), I = {
|
|
|
1581
1581
|
if (n === "self") return !1;
|
|
1582
1582
|
let r = e.variants[t], i = L(r.options), a = R(r.options);
|
|
1583
1583
|
if (i <= 0 && a <= 0) return !1;
|
|
1584
|
-
let o =
|
|
1584
|
+
let o = B(n === "initial" ? e.initial : e.variants[n].value), s = B(r.value);
|
|
1585
1585
|
return o.length > 0 || s.length > 0;
|
|
1586
1586
|
}, rt = "data-flemo";
|
|
1587
1587
|
function it() {
|
|
1588
1588
|
if (d()) return;
|
|
1589
|
-
let e = et(
|
|
1589
|
+
let e = et(M.values(), P.values(), F.values()), t = document.head.querySelector(`style[${rt}]`);
|
|
1590
1590
|
t || (t = document.createElement("style"), t.setAttribute(rt, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1591
1591
|
}
|
|
1592
1592
|
//#endregion
|
|
@@ -1598,11 +1598,11 @@ var at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), st = /* @__P
|
|
|
1598
1598
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1599
1599
|
};
|
|
1600
1600
|
function ut(e, t, n = []) {
|
|
1601
|
-
for (let t of e)
|
|
1601
|
+
for (let t of e) M.set(t.name, t), ct(at, t.name);
|
|
1602
1602
|
for (let e of t) P.set(e.name, e), ct(ot, e.name);
|
|
1603
1603
|
for (let e of n) F.set(e.name, e), ct(st, e.name);
|
|
1604
1604
|
return it(), () => {
|
|
1605
|
-
for (let t of e) lt(at, t.name) &&
|
|
1605
|
+
for (let t of e) lt(at, t.name) && M.delete(t.name);
|
|
1606
1606
|
for (let e of t) lt(ot, e.name) && P.delete(e.name);
|
|
1607
1607
|
for (let e of n) lt(st, e.name) && F.delete(e.name);
|
|
1608
1608
|
it();
|
|
@@ -1617,95 +1617,168 @@ function dt(e) {
|
|
|
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 ft = (
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
},
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1620
|
+
//#region src/transition/settleScrub.ts
|
|
1621
|
+
var ft = () => ({
|
|
1622
|
+
request: (e) => requestAnimationFrame(e),
|
|
1623
|
+
cancel: (e) => cancelAnimationFrame(e)
|
|
1624
|
+
}), pt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), mt = ((e = ft()) => {
|
|
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[pt(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
|
+
})(), ht = "flemo:motion-driver", gt = "flemo:motion-driver-force", _t = !1, vt = () => {
|
|
1659
1687
|
try {
|
|
1660
1688
|
if (typeof localStorage > "u") return null;
|
|
1661
|
-
let e = localStorage.getItem(
|
|
1662
|
-
return e !== "css" && e !== "raf" ? null : (!
|
|
1689
|
+
let e = localStorage.getItem(gt);
|
|
1690
|
+
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
1691
|
} catch {
|
|
1664
1692
|
return null;
|
|
1665
1693
|
}
|
|
1666
|
-
},
|
|
1694
|
+
}, yt = () => ({
|
|
1667
1695
|
read: () => {
|
|
1668
1696
|
try {
|
|
1669
|
-
return typeof localStorage < "u" ? localStorage.getItem(
|
|
1697
|
+
return typeof localStorage < "u" ? localStorage.getItem(ht) : null;
|
|
1670
1698
|
} catch {
|
|
1671
1699
|
return null;
|
|
1672
1700
|
}
|
|
1673
1701
|
},
|
|
1674
1702
|
write: (e) => {
|
|
1675
1703
|
try {
|
|
1676
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
1704
|
+
typeof localStorage < "u" && localStorage.setItem(ht, e);
|
|
1677
1705
|
} catch {}
|
|
1678
1706
|
}
|
|
1679
|
-
}),
|
|
1680
|
-
let
|
|
1681
|
-
|
|
1682
|
-
let
|
|
1707
|
+
}), bt = 30, xt = 2, St = 2, Ct = () => typeof navigator < "u" && !!navigator.userAgentData, U = ((e = yt(), t = Ct()) => {
|
|
1708
|
+
let n = e.read() === "css", r = n;
|
|
1709
|
+
n &&= !1;
|
|
1710
|
+
let i = 0, a = 0, o = [];
|
|
1683
1711
|
return {
|
|
1684
1712
|
playerAllowed: () => {
|
|
1685
|
-
let e =
|
|
1686
|
-
return e ? e === "raf" : !
|
|
1713
|
+
let e = vt();
|
|
1714
|
+
return e ? e === "raf" : t && !n;
|
|
1687
1715
|
},
|
|
1688
1716
|
beginRun: () => {
|
|
1689
|
-
|
|
1717
|
+
a = 0, o = [];
|
|
1690
1718
|
},
|
|
1691
1719
|
reportGap: (e) => {
|
|
1692
|
-
|
|
1720
|
+
o.push(e), e >= bt && (a += 1);
|
|
1693
1721
|
},
|
|
1694
1722
|
endRun: () => {
|
|
1695
|
-
let
|
|
1696
|
-
if (
|
|
1697
|
-
|
|
1723
|
+
let t = a >= xt;
|
|
1724
|
+
if (r) {
|
|
1725
|
+
r = !1, t ? n = !0 : e.write("raf");
|
|
1698
1726
|
return;
|
|
1699
1727
|
}
|
|
1700
|
-
|
|
1728
|
+
t && (i += 1, i >= St && !n && (n = !0, e.write("css")));
|
|
1701
1729
|
},
|
|
1702
1730
|
stats: () => ({
|
|
1703
|
-
runGaps: [...
|
|
1704
|
-
strikes:
|
|
1705
|
-
demoted:
|
|
1731
|
+
runGaps: [...o],
|
|
1732
|
+
strikes: i,
|
|
1733
|
+
demoted: n
|
|
1706
1734
|
})
|
|
1707
1735
|
};
|
|
1708
|
-
})(),
|
|
1736
|
+
})(), wt = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, W = /* @__PURE__ */ new WeakMap(), G = (e, t) => {
|
|
1737
|
+
let n = W.get(e);
|
|
1738
|
+
n || (n = /* @__PURE__ */ new Set(), W.set(e, n)), n.add(t);
|
|
1739
|
+
}, K = (e, t) => {
|
|
1740
|
+
if (e.style.transition = "", t) {
|
|
1741
|
+
let n = W.get(e);
|
|
1742
|
+
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1745
|
+
let n = W.get(e);
|
|
1746
|
+
if (n && n.size > 0) {
|
|
1747
|
+
for (let t of n) e.style.removeProperty(t);
|
|
1748
|
+
n.clear();
|
|
1749
|
+
return;
|
|
1750
|
+
}
|
|
1751
|
+
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1752
|
+
}, q = (e, t, n = {}) => {
|
|
1753
|
+
if (!wt(e)) return Promise.resolve();
|
|
1754
|
+
let r = e, i = B(t);
|
|
1755
|
+
if (i.length === 0) return Promise.resolve();
|
|
1756
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = H(n.ease);
|
|
1757
|
+
if (a <= 0 && o <= 0) {
|
|
1758
|
+
mt.takeover(r), r.style.transition = "none";
|
|
1759
|
+
for (let e of i) r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1760
|
+
return Promise.resolve();
|
|
1761
|
+
}
|
|
1762
|
+
let c = U.playerAllowed() ? mt.settle(r, i, {
|
|
1763
|
+
durationMs: a * 1e3,
|
|
1764
|
+
delayMs: o * 1e3,
|
|
1765
|
+
easing: s
|
|
1766
|
+
}, (e) => {
|
|
1767
|
+
r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1768
|
+
}) : null;
|
|
1769
|
+
if (c) return c;
|
|
1770
|
+
let l = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1771
|
+
r.style.transition = l, r.offsetWidth;
|
|
1772
|
+
for (let e of i) r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1773
|
+
return new Promise((e) => {
|
|
1774
|
+
let t = !1, n = () => {
|
|
1775
|
+
t || (t = !0, r.removeEventListener("transitionend", i), e());
|
|
1776
|
+
}, i = (e) => {
|
|
1777
|
+
e.target === r && n();
|
|
1778
|
+
};
|
|
1779
|
+
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1780
|
+
});
|
|
1781
|
+
}, Tt = (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
|
+
}, Et = (e) => e, Dt = {
|
|
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
|
+
}, Ot = (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 Tt(t, n, r, i);
|
|
1780
1853
|
}
|
|
1781
|
-
return
|
|
1854
|
+
return Et;
|
|
1782
1855
|
}
|
|
1783
|
-
return typeof e == "string" ? e === "linear" ?
|
|
1784
|
-
},
|
|
1856
|
+
return typeof e == "string" ? e === "linear" ? Et : Tt(...Dt[e] ?? Dt.ease) : Tt(...Dt.ease);
|
|
1857
|
+
}, kt = [
|
|
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
|
+
], At = new Set(kt), jt = {
|
|
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
|
+
}, Mt = (e, t) => {
|
|
1807
1880
|
if (typeof t == "number") return {
|
|
1808
1881
|
value: t,
|
|
1809
1882
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -1822,7 +1895,7 @@ 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
|
-
}, J = /-?\d*\.?\d+/g,
|
|
1898
|
+
}, J = /-?\d*\.?\d+/g, Nt = (e, t) => {
|
|
1826
1899
|
let n = e.match(J) ?? [], r = t.match(J) ?? [];
|
|
1827
1900
|
if (n.length !== r.length || e.replace(J, " ") !== t.replace(J, " ")) return null;
|
|
1828
1901
|
let i = n.map(Number), a = r.map(Number);
|
|
@@ -1833,15 +1906,15 @@ var ft = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, U = /* @__
|
|
|
1833
1906
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
1834
1907
|
});
|
|
1835
1908
|
};
|
|
1836
|
-
},
|
|
1837
|
-
let n = new Set([...
|
|
1909
|
+
}, Pt = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Ft = (e) => typeof e == "object" && !!e && !Array.isArray(e), It = (e) => Ft(e) ? Object.keys(e) : [], Lt = (e, t) => Ft(e) ? e[t] : void 0, Rt = (e, t) => {
|
|
1910
|
+
let n = new Set([...It(e.from), ...It(e.to)]), r = [], i = null, a = [], o = [];
|
|
1838
1911
|
for (let s of n) {
|
|
1839
|
-
let n =
|
|
1840
|
-
if (
|
|
1912
|
+
let n = Lt(e.from, s), c = Lt(e.to, s);
|
|
1913
|
+
if (At.has(s)) {
|
|
1841
1914
|
let e = s, i = {
|
|
1842
|
-
value:
|
|
1915
|
+
value: jt[e],
|
|
1843
1916
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
1844
|
-
}, a = n === void 0 ? i :
|
|
1917
|
+
}, a = n === void 0 ? i : Mt(e, n), o = c === void 0 ? i : Mt(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: Pt(s),
|
|
1876
1949
|
value: l
|
|
1877
1950
|
});
|
|
1878
1951
|
continue;
|
|
1879
1952
|
}
|
|
1880
|
-
let d =
|
|
1953
|
+
let d = Nt(l, u);
|
|
1881
1954
|
if (!d) return null;
|
|
1882
1955
|
a.push({
|
|
1883
|
-
property:
|
|
1956
|
+
property: Pt(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
|
+
}, zt = 1, Bt = (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 kt) {
|
|
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 >= zt) && 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 = jt[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
|
+
}, Vt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), Ht = (e) => {
|
|
1909
1982
|
let t = {};
|
|
1910
|
-
for (let n of
|
|
1983
|
+
for (let n of B(e)) t[Vt(n.property)] = n.value;
|
|
1911
1984
|
return t;
|
|
1912
|
-
},
|
|
1985
|
+
}, Ut = (e, t) => {
|
|
1913
1986
|
if (typeof e.animate != "function") return null;
|
|
1914
1987
|
try {
|
|
1915
|
-
let n = e.animate([
|
|
1988
|
+
let n = e.animate([Ht(t.from), Ht(t.to)], {
|
|
1916
1989
|
duration: Math.max(0, t.duration * 1e3),
|
|
1917
1990
|
delay: Math.max(0, t.delay * 1e3),
|
|
1918
|
-
easing:
|
|
1991
|
+
easing: H(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
|
+
}, Wt = () => ({
|
|
1926
1999
|
request: (e) => requestAnimationFrame(e),
|
|
1927
2000
|
cancel: (e) => cancelAnimationFrame(e),
|
|
1928
2001
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
1929
|
-
}), Y = ((e =
|
|
2002
|
+
}), Y = ((e = Wt()) => {
|
|
1930
2003
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
1931
2004
|
join: (n, r) => {
|
|
1932
|
-
let i =
|
|
2005
|
+
let i = Rt(r.motion, r.element), s = i ? null : Ut(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, U.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 = Ot(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 = Bt(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 && (U.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,7 +2082,7 @@ 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
|
+
U.endRun(), t.delete(e);
|
|
2013
2086
|
return;
|
|
2014
2087
|
}
|
|
2015
2088
|
o(e, r);
|
|
@@ -2024,15 +2097,24 @@ Y.onFrameGap = (e) => {
|
|
|
2024
2097
|
};
|
|
2025
2098
|
//#endregion
|
|
2026
2099
|
//#region src/core/engine/types.ts
|
|
2027
|
-
var X = "data-flemo-skip-animation", Z = () => {}
|
|
2028
|
-
|
|
2100
|
+
var X = "data-flemo-skip-animation", Z = () => {}, Gt = "data-flemo-part-name", Kt = (e) => {
|
|
2101
|
+
let t = e.parentElement ?? e;
|
|
2102
|
+
return Array.from(t.querySelectorAll(`[${Gt}]`)).filter((n) => {
|
|
2103
|
+
let r = n.closest("[data-flemo-screen]");
|
|
2104
|
+
return !r || r === e || !t.contains(r);
|
|
2105
|
+
});
|
|
2106
|
+
}, qt = (e, t) => {
|
|
2107
|
+
let [n, r] = t.split("-");
|
|
2108
|
+
return Kt(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2109
|
+
};
|
|
2110
|
+
function Jt(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) || !U.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 = we(r), f = z(d, t);
|
|
2036
2118
|
if (!f) return null;
|
|
2037
2119
|
let p = [], m = Y.join(s, {
|
|
2038
2120
|
element: c,
|
|
@@ -2052,7 +2134,7 @@ function Vt(e) {
|
|
|
2052
2134
|
t && p.push(t);
|
|
2053
2135
|
}
|
|
2054
2136
|
if (l && d.decoratorName) {
|
|
2055
|
-
let e = P.get(d.decoratorName), n = e ?
|
|
2137
|
+
let e = P.get(d.decoratorName), n = e ? z(e, t) : null;
|
|
2056
2138
|
if (n) {
|
|
2057
2139
|
let e = Y.join(s, {
|
|
2058
2140
|
element: l,
|
|
@@ -2062,13 +2144,27 @@ function Vt(e) {
|
|
|
2062
2144
|
e && p.push(e);
|
|
2063
2145
|
}
|
|
2064
2146
|
}
|
|
2147
|
+
for (let e of qt(c, t)) {
|
|
2148
|
+
let n = F.get(e.getAttribute(Gt)), r = n ? z(n, t) : null;
|
|
2149
|
+
if (!r) continue;
|
|
2150
|
+
let i = Y.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
|
-
|
|
2162
|
+
if (e) {
|
|
2163
|
+
K(e);
|
|
2164
|
+
for (let t of Kt(e)) K(t);
|
|
2165
|
+
}
|
|
2166
|
+
t && K(t);
|
|
2167
|
+
for (let e of r ?? []) e && K(e);
|
|
2072
2168
|
return Z;
|
|
2073
2169
|
}
|
|
2074
2170
|
if (a === "REPLACING" && i !== r && e.setReplaceTransitionStatus("PENDING"), l && c) {
|
|
@@ -2080,8 +2176,12 @@ function Vt(e) {
|
|
|
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
|
-
|
|
2179
|
+
if (t) {
|
|
2180
|
+
K(t), t.removeAttribute(X);
|
|
2181
|
+
for (let e of Kt(t)) K(e);
|
|
2182
|
+
}
|
|
2183
|
+
r && (K(r), r.removeAttribute(X));
|
|
2184
|
+
for (let e of i ?? []) e && (K(e), e.style.removeProperty("will-change"));
|
|
2085
2185
|
return Z;
|
|
2086
2186
|
}
|
|
2087
2187
|
if (a === "IDLE") return Z;
|
|
@@ -2090,9 +2190,9 @@ function Vt(e) {
|
|
|
2090
2190
|
let f = () => {
|
|
2091
2191
|
let t = e.getTransitionTaskId();
|
|
2092
2192
|
t && o.resolveTask(t);
|
|
2093
|
-
}, p =
|
|
2193
|
+
}, p = we(r), m = `${a}-true`, h = d.getAttribute(X) === "true";
|
|
2094
2194
|
if (!(!h && nt(p, m))) return queueMicrotask(f), Z;
|
|
2095
|
-
let g =
|
|
2195
|
+
let g = z(p, m), _ = !h && !!g, v = Xe("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,8 +2204,8 @@ 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 Yt(e, t) {
|
|
2208
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Xt(e);
|
|
2109
2209
|
if (!o) return {
|
|
2110
2210
|
element: null,
|
|
2111
2211
|
hasMarker: !1
|
|
@@ -2128,7 +2228,7 @@ function Ht(e, t) {
|
|
|
2128
2228
|
hasMarker: !1
|
|
2129
2229
|
};
|
|
2130
2230
|
}
|
|
2131
|
-
function
|
|
2231
|
+
function Xt(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) {
|
|
@@ -2146,8 +2246,8 @@ function $(e, t) {
|
|
|
2146
2246
|
}
|
|
2147
2247
|
//#endregion
|
|
2148
2248
|
//#region src/core/engine/createSwipeController.ts
|
|
2149
|
-
var
|
|
2150
|
-
function
|
|
2249
|
+
var Zt = "data-flemo-skip-animation";
|
|
2250
|
+
function Qt(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 = Ge(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: []
|
|
@@ -2230,7 +2330,7 @@ function Gt(e) {
|
|
|
2230
2330
|
let a = F.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(Zt, "true"), l?.setAttribute(Zt, "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 = Yt(t.target, {
|
|
2330
2430
|
direction: "x",
|
|
2331
2431
|
verifyByScroll: !0
|
|
2332
|
-
}), p =
|
|
2432
|
+
}), p = Yt(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 $t(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 en(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 tn = 300, nn = 20;
|
|
2476
|
+
function rn(e) {
|
|
2477
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, nn);
|
|
2378
2478
|
}
|
|
2379
|
-
function
|
|
2380
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
2479
|
+
function an(e) {
|
|
2480
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of rn(e)) t.decode().catch(() => {});
|
|
2381
2481
|
}
|
|
2382
|
-
function
|
|
2482
|
+
function on(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 = rn(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 sn(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 cn = 0;
|
|
2527
|
+
function ln(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 - cn;
|
|
2533
|
+
n = n < 0 ? 0 : n, cn ||= 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 un(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 dn(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 { tn as ANIM_HOLD_RELEASE_BACKSTOP_MS, X as SKIP_ANIMATION_ATTR, o as TaskManger, en as animHoldKey, q as animateInline, Xe as animationName, oe as appendParamsQuery, it as applyTransitionStyles, dn as buildRoutePath, $ as canProgrammaticallyScroll, K as clearInlineAnimation, Ge as collectAnimatedProperties, et as compileTransitionStyles, $t as computeBarRiding, ge as computeScreenFreeze, y as consumeSelfInducedPop, h as createBrowserHistoryDriver, Te as createDecorator, s as createHistoryStore, b as createHistorySync, ne as createMemoryHistoryDriver, re as createNavigateStore, ie as createNavigationController, Oe as createPartTransition, Ee as createRawDecorator, ke as createRawPartTransition, _e as createRawTransition, me as createRouterScope, he as createScreenSelector, de as createScreenStore, g as createSelfPopGuard, se as createStepController, Qt as createSwipeController, j as createTransition, Jt as createTransitionEngine, le as createTransitionStore, ye as cupertino, P as decoratorMap, an as eagerlyDecodeImages, H as easingToCss, ee as ensureScopeHistorySync, f as ensureWindowHistoryState, dt as enteringInitialStyle, Yt as findScrollable, c as getMatchedPathPattern, l as getParams, un as isOpaqueColor, d as isServer, xe as layout, v as markSelfInducedPop, ue as matchesPathname, Se as material, Ce as none, sn as observeBarHeight, ln as observeViewportScrollHeight, Q as overflowsAxis, De as overlay, F as partTransitionMap, ae as readStepParams, ut as registerTransitionDefinitions, te as releaseScopeHistorySync, we as resolveTransition, on as scheduleAnimHoldRelease, u as seedInitialHistory, p as seedRouterEntry, ce as subscribeStepParamsRestore, B as targetToDecls, M as transitionMap, nt as variantHasAnimation };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CssDecl } from './compileTransitionStyles';
|
|
2
|
+
export interface SettleScheduler {
|
|
3
|
+
request: (callback: (time: number) => void) => number;
|
|
4
|
+
cancel: (handle: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface SettleTiming {
|
|
7
|
+
durationMs: number;
|
|
8
|
+
delayMs: number;
|
|
9
|
+
easing: string;
|
|
10
|
+
}
|
|
11
|
+
export type SettleWrite = (decl: CssDecl) => void;
|
|
12
|
+
export interface SettleScrubber {
|
|
13
|
+
settle: (element: HTMLElement, decls: CssDecl[], timing: SettleTiming, writeFinal: SettleWrite) => Promise<void> | null;
|
|
14
|
+
takeover: (element: HTMLElement) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const createSettleScrubber: (scheduler?: SettleScheduler) => SettleScrubber;
|
|
17
|
+
declare const settleScrubber: SettleScrubber;
|
|
18
|
+
export default settleScrubber;
|
package/package.json
CHANGED