@flemo/core 1.15.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.
- package/dist/core/engine/driverPolicy.d.ts +2 -1
- package/dist/index.mjs +240 -240
- package/package.json +1 -1
|
@@ -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
|
@@ -1266,12 +1266,12 @@ var ve = (e, t, n) => {
|
|
|
1266
1266
|
]);
|
|
1267
1267
|
//#endregion
|
|
1268
1268
|
//#region src/transition/resolveTransition.ts
|
|
1269
|
-
function
|
|
1269
|
+
function we(e) {
|
|
1270
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 Te({ 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 we({ 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 Ee({ 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 Te({ 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 N = "rgba(0, 0, 0, 0.2)", De = Te({
|
|
1317
1317
|
name: "overlay",
|
|
1318
1318
|
initial: {
|
|
1319
1319
|
opacity: 0,
|
|
1320
|
-
backgroundColor:
|
|
1320
|
+
backgroundColor: N
|
|
1321
1321
|
},
|
|
1322
1322
|
idle: {
|
|
1323
1323
|
value: {
|
|
1324
1324
|
opacity: 0,
|
|
1325
|
-
backgroundColor:
|
|
1325
|
+
backgroundColor: N
|
|
1326
1326
|
},
|
|
1327
1327
|
options: { duration: 0 }
|
|
1328
1328
|
},
|
|
1329
1329
|
enter: {
|
|
1330
1330
|
value: {
|
|
1331
1331
|
opacity: 1,
|
|
1332
|
-
backgroundColor:
|
|
1332
|
+
backgroundColor: N
|
|
1333
1333
|
},
|
|
1334
1334
|
options: { duration: .6 }
|
|
1335
1335
|
},
|
|
1336
1336
|
exit: {
|
|
1337
1337
|
value: {
|
|
1338
1338
|
opacity: 0,
|
|
1339
|
-
backgroundColor:
|
|
1339
|
+
backgroundColor: N
|
|
1340
1340
|
},
|
|
1341
1341
|
options: { duration: .6 }
|
|
1342
1342
|
},
|
|
@@ -1345,10 +1345,10 @@ var P = "rgba(0, 0, 0, 0.2)", Ee = we({
|
|
|
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
|
+
}), P = new Map([["overlay", De]]);
|
|
1349
1349
|
//#endregion
|
|
1350
1350
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1351
|
-
function
|
|
1351
|
+
function Oe({ 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 De({ 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 ke({ 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 Oe({ 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 F = /* @__PURE__ */ new Map(), I = {
|
|
1394
1394
|
"IDLE-true": "self",
|
|
1395
1395
|
"IDLE-false": "self",
|
|
1396
1396
|
"PUSHING-true": "initial",
|
|
@@ -1401,17 +1401,17 @@ var I = /* @__PURE__ */ new Map(), L = {
|
|
|
1401
1401
|
"POPPING-false": "PUSHING-false",
|
|
1402
1402
|
"COMPLETED-true": "self",
|
|
1403
1403
|
"COMPLETED-false": "self"
|
|
1404
|
-
},
|
|
1404
|
+
}, Ae = Object.keys(I), L = (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
|
+
}, R = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, je = (e, t) => {
|
|
1409
|
+
let n = I[t];
|
|
1410
1410
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1411
|
-
},
|
|
1412
|
-
let n =
|
|
1411
|
+
}, z = (e, t) => {
|
|
1412
|
+
let n = je(e, t);
|
|
1413
1413
|
if (n === null) return null;
|
|
1414
|
-
let r = e.variants[t], i =
|
|
1414
|
+
let r = e.variants[t], i = L(r.options), a = R(r.options);
|
|
1415
1415
|
return i <= 0 && a <= 0 ? null : {
|
|
1416
1416
|
from: n,
|
|
1417
1417
|
to: r.value,
|
|
@@ -1419,7 +1419,7 @@ var I = /* @__PURE__ */ new Map(), L = {
|
|
|
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 I = /* @__PURE__ */ new Map(), L = {
|
|
|
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 I = /* @__PURE__ */ new Map(), L = {
|
|
|
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 I = /* @__PURE__ */ new Map(), L = {
|
|
|
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 I = /* @__PURE__ */ new Map(), L = {
|
|
|
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 I = /* @__PURE__ */ new Map(), L = {
|
|
|
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,55 +1519,55 @@ var I = /* @__PURE__ */ new Map(), L = {
|
|
|
1519
1519
|
l > 0 ? `${l}s` : null,
|
|
1520
1520
|
"both"
|
|
1521
1521
|
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1522
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") &&
|
|
1523
|
-
},
|
|
1522
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Qe(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${V(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && Qe(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${V(s)}\n}` : ""}`;
|
|
1523
|
+
}, Qe = (e) => {
|
|
1524
1524
|
if (!e) return !1;
|
|
1525
1525
|
if (e.opacity === 0) return !0;
|
|
1526
1526
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1527
1527
|
return t(e.x) || t(e.y);
|
|
1528
|
-
},
|
|
1529
|
-
let i =
|
|
1530
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1531
|
-
},
|
|
1528
|
+
}, $e = (e, t, n, r) => {
|
|
1529
|
+
let i = B(r.value);
|
|
1530
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${V(i)}\n}`;
|
|
1531
|
+
}, et = (e, t, n = []) => {
|
|
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 Ae) {
|
|
1536
|
+
let i = t.variants[n], a = I[n];
|
|
1537
1537
|
if (a === "self") {
|
|
1538
|
-
r.push(
|
|
1538
|
+
r.push($e(Ke, e, n, i));
|
|
1539
1539
|
continue;
|
|
1540
1540
|
}
|
|
1541
1541
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1542
|
-
r.push(
|
|
1542
|
+
r.push(Ze("screen", e, n, o, i, Ke));
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
1545
|
for (let e of t) {
|
|
1546
1546
|
let t = e.name;
|
|
1547
|
-
for (let n of
|
|
1548
|
-
let i = e.variants[n], a =
|
|
1547
|
+
for (let n of Me) {
|
|
1548
|
+
let i = e.variants[n], a = I[n];
|
|
1549
1549
|
if (a === "self") {
|
|
1550
|
-
r.push(
|
|
1550
|
+
r.push($e(qe, t, n, i));
|
|
1551
1551
|
continue;
|
|
1552
1552
|
}
|
|
1553
1553
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1554
|
-
r.push(
|
|
1554
|
+
r.push(Ze("decorator", t, n, o, i, qe));
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
1557
|
for (let e of n) {
|
|
1558
1558
|
let t = e.name;
|
|
1559
|
-
for (let n of
|
|
1560
|
-
let i = e.variants[n], a =
|
|
1559
|
+
for (let n of Me) {
|
|
1560
|
+
let i = e.variants[n], a = I[n];
|
|
1561
1561
|
if (a === "self") {
|
|
1562
|
-
r.push(
|
|
1562
|
+
r.push($e(Ye, t, n, i));
|
|
1563
1563
|
continue;
|
|
1564
1564
|
}
|
|
1565
1565
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1566
|
-
r.push(
|
|
1566
|
+
r.push(Ze("part", t, n, o, i, Ye));
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
1569
|
-
return [...r.filter((e) => e.length > 0),
|
|
1570
|
-
},
|
|
1569
|
+
return [...r.filter((e) => e.length > 0), tt].join("\n\n");
|
|
1570
|
+
}, tt = [
|
|
1571
1571
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1572
1572
|
"[data-flemo-anim-hold=\"park\"],",
|
|
1573
1573
|
"[data-flemo-anim-hold=\"park-under\"],",
|
|
@@ -1576,41 +1576,41 @@ var I = /* @__PURE__ */ new Map(), L = {
|
|
|
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"), nt = (e, t) => {
|
|
1580
|
+
let n = I[t];
|
|
1581
1581
|
if (n === "self") return !1;
|
|
1582
|
-
let r = e.variants[t], i =
|
|
1582
|
+
let r = e.variants[t], i = 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
|
-
},
|
|
1587
|
-
function
|
|
1586
|
+
}, rt = "data-flemo";
|
|
1587
|
+
function it() {
|
|
1588
1588
|
if (d()) return;
|
|
1589
|
-
let e =
|
|
1590
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1589
|
+
let e = et(M.values(), P.values(), F.values()), t = document.head.querySelector(`style[${rt}]`);
|
|
1590
|
+
t || (t = document.createElement("style"), t.setAttribute(rt, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1591
1591
|
}
|
|
1592
1592
|
//#endregion
|
|
1593
1593
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1594
|
-
var
|
|
1594
|
+
var at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), st = /* @__PURE__ */ new Map(), ct = (e, t) => {
|
|
1595
1595
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1596
|
-
},
|
|
1596
|
+
}, lt = (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) M.set(t.name, t),
|
|
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 ut(e, t, n = []) {
|
|
1601
|
+
for (let t of e) M.set(t.name, t), ct(at, t.name);
|
|
1602
|
+
for (let e of t) P.set(e.name, e), ct(ot, e.name);
|
|
1603
|
+
for (let e of n) F.set(e.name, e), ct(st, e.name);
|
|
1604
|
+
return it(), () => {
|
|
1605
|
+
for (let t of e) lt(at, t.name) && M.delete(t.name);
|
|
1606
|
+
for (let e of t) lt(ot, e.name) && P.delete(e.name);
|
|
1607
|
+
for (let e of n) lt(st, e.name) && F.delete(e.name);
|
|
1608
|
+
it();
|
|
1609
1609
|
};
|
|
1610
1610
|
}
|
|
1611
1611
|
//#endregion
|
|
1612
1612
|
//#region src/transition/enteringInitialStyle.ts
|
|
1613
|
-
function
|
|
1613
|
+
function dt(e) {
|
|
1614
1614
|
let { initial: t, isActive: n, status: r } = e;
|
|
1615
1615
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1616
1616
|
let i = {};
|
|
@@ -1618,10 +1618,10 @@ function ut(e) {
|
|
|
1618
1618
|
}
|
|
1619
1619
|
//#endregion
|
|
1620
1620
|
//#region src/transition/settleScrub.ts
|
|
1621
|
-
var
|
|
1621
|
+
var ft = () => ({
|
|
1622
1622
|
request: (e) => requestAnimationFrame(e),
|
|
1623
1623
|
cancel: (e) => cancelAnimationFrame(e)
|
|
1624
|
-
}),
|
|
1624
|
+
}), pt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), mt = ((e = ft()) => {
|
|
1625
1625
|
let t = /* @__PURE__ */ new Map(), n = null, r = () => {
|
|
1626
1626
|
t.size === 0 && n !== null && (e.cancel(n), n = null);
|
|
1627
1627
|
}, i = (e, n) => {
|
|
@@ -1654,7 +1654,7 @@ var dt = () => ({
|
|
|
1654
1654
|
if (typeof r.animate != "function") return null;
|
|
1655
1655
|
i(r, "current");
|
|
1656
1656
|
let l = {};
|
|
1657
|
-
for (let e of o) l[
|
|
1657
|
+
for (let e of o) l[pt(e.property)] = e.value;
|
|
1658
1658
|
let u;
|
|
1659
1659
|
try {
|
|
1660
1660
|
u = r.animate([l], {
|
|
@@ -1683,7 +1683,57 @@ var dt = () => ({
|
|
|
1683
1683
|
},
|
|
1684
1684
|
takeover: (e) => i(e, "current")
|
|
1685
1685
|
};
|
|
1686
|
-
})(),
|
|
1686
|
+
})(), ht = "flemo:motion-driver", gt = "flemo:motion-driver-force", _t = !1, vt = () => {
|
|
1687
|
+
try {
|
|
1688
|
+
if (typeof localStorage > "u") return 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);
|
|
1691
|
+
} catch {
|
|
1692
|
+
return null;
|
|
1693
|
+
}
|
|
1694
|
+
}, yt = () => ({
|
|
1695
|
+
read: () => {
|
|
1696
|
+
try {
|
|
1697
|
+
return typeof localStorage < "u" ? localStorage.getItem(ht) : null;
|
|
1698
|
+
} catch {
|
|
1699
|
+
return null;
|
|
1700
|
+
}
|
|
1701
|
+
},
|
|
1702
|
+
write: (e) => {
|
|
1703
|
+
try {
|
|
1704
|
+
typeof localStorage < "u" && localStorage.setItem(ht, e);
|
|
1705
|
+
} catch {}
|
|
1706
|
+
}
|
|
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 = [];
|
|
1711
|
+
return {
|
|
1712
|
+
playerAllowed: () => {
|
|
1713
|
+
let e = vt();
|
|
1714
|
+
return e ? e === "raf" : t && !n;
|
|
1715
|
+
},
|
|
1716
|
+
beginRun: () => {
|
|
1717
|
+
a = 0, o = [];
|
|
1718
|
+
},
|
|
1719
|
+
reportGap: (e) => {
|
|
1720
|
+
o.push(e), e >= bt && (a += 1);
|
|
1721
|
+
},
|
|
1722
|
+
endRun: () => {
|
|
1723
|
+
let t = a >= xt;
|
|
1724
|
+
if (r) {
|
|
1725
|
+
r = !1, t ? n = !0 : e.write("raf");
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
t && (i += 1, i >= St && !n && (n = !0, e.write("css")));
|
|
1729
|
+
},
|
|
1730
|
+
stats: () => ({
|
|
1731
|
+
runGaps: [...o],
|
|
1732
|
+
strikes: i,
|
|
1733
|
+
demoted: n
|
|
1734
|
+
})
|
|
1735
|
+
};
|
|
1736
|
+
})(), wt = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, W = /* @__PURE__ */ new WeakMap(), G = (e, t) => {
|
|
1687
1737
|
let n = W.get(e);
|
|
1688
1738
|
n || (n = /* @__PURE__ */ new Set(), W.set(e, n)), n.add(t);
|
|
1689
1739
|
}, K = (e, t) => {
|
|
@@ -1700,22 +1750,22 @@ var dt = () => ({
|
|
|
1700
1750
|
}
|
|
1701
1751
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1702
1752
|
}, q = (e, t, n = {}) => {
|
|
1703
|
-
if (!
|
|
1704
|
-
let r = e, i =
|
|
1753
|
+
if (!wt(e)) return Promise.resolve();
|
|
1754
|
+
let r = e, i = B(t);
|
|
1705
1755
|
if (i.length === 0) return Promise.resolve();
|
|
1706
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
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);
|
|
1707
1757
|
if (a <= 0 && o <= 0) {
|
|
1708
|
-
|
|
1758
|
+
mt.takeover(r), r.style.transition = "none";
|
|
1709
1759
|
for (let e of i) r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1710
1760
|
return Promise.resolve();
|
|
1711
1761
|
}
|
|
1712
|
-
let c =
|
|
1762
|
+
let c = U.playerAllowed() ? mt.settle(r, i, {
|
|
1713
1763
|
durationMs: a * 1e3,
|
|
1714
1764
|
delayMs: o * 1e3,
|
|
1715
1765
|
easing: s
|
|
1716
1766
|
}, (e) => {
|
|
1717
1767
|
r.style.setProperty(e.property, e.value), G(r, e.property);
|
|
1718
|
-
});
|
|
1768
|
+
}) : null;
|
|
1719
1769
|
if (c) return c;
|
|
1720
1770
|
let l = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1721
1771
|
r.style.transition = l, r.offsetWidth;
|
|
@@ -1728,57 +1778,7 @@ var dt = () => ({
|
|
|
1728
1778
|
};
|
|
1729
1779
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1730
1780
|
});
|
|
1731
|
-
},
|
|
1732
|
-
try {
|
|
1733
|
-
if (typeof localStorage > "u") return 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);
|
|
1736
|
-
} catch {
|
|
1737
|
-
return null;
|
|
1738
|
-
}
|
|
1739
|
-
}, yt = () => ({
|
|
1740
|
-
read: () => {
|
|
1741
|
-
try {
|
|
1742
|
-
return typeof localStorage < "u" ? localStorage.getItem(ht) : null;
|
|
1743
|
-
} catch {
|
|
1744
|
-
return null;
|
|
1745
|
-
}
|
|
1746
|
-
},
|
|
1747
|
-
write: (e) => {
|
|
1748
|
-
try {
|
|
1749
|
-
typeof localStorage < "u" && localStorage.setItem(ht, e);
|
|
1750
|
-
} catch {}
|
|
1751
|
-
}
|
|
1752
|
-
}), bt = 30, xt = 2, St = 2, J = ((e = yt()) => {
|
|
1753
|
-
let t = e.read() === "css", n = t;
|
|
1754
|
-
t &&= !1;
|
|
1755
|
-
let r = 0, i = 0, a = [];
|
|
1756
|
-
return {
|
|
1757
|
-
playerAllowed: () => {
|
|
1758
|
-
let e = vt();
|
|
1759
|
-
return e ? e === "raf" : !t;
|
|
1760
|
-
},
|
|
1761
|
-
beginRun: () => {
|
|
1762
|
-
i = 0, a = [];
|
|
1763
|
-
},
|
|
1764
|
-
reportGap: (e) => {
|
|
1765
|
-
a.push(e), e >= bt && (i += 1);
|
|
1766
|
-
},
|
|
1767
|
-
endRun: () => {
|
|
1768
|
-
let a = i >= xt;
|
|
1769
|
-
if (n) {
|
|
1770
|
-
n = !1, a ? t = !0 : e.write("raf");
|
|
1771
|
-
return;
|
|
1772
|
-
}
|
|
1773
|
-
a && (r += 1, r >= St && !t && (t = !0, e.write("css")));
|
|
1774
|
-
},
|
|
1775
|
-
stats: () => ({
|
|
1776
|
-
runGaps: [...a],
|
|
1777
|
-
strikes: r,
|
|
1778
|
-
demoted: t
|
|
1779
|
-
})
|
|
1780
|
-
};
|
|
1781
|
-
})(), Ct = (e, t, n, r) => {
|
|
1781
|
+
}, Tt = (e, t, n, r) => {
|
|
1782
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;
|
|
1783
1783
|
return (e) => {
|
|
1784
1784
|
if (e <= 0) return 0;
|
|
@@ -1790,7 +1790,7 @@ var dt = () => ({
|
|
|
1790
1790
|
}
|
|
1791
1791
|
return a((t + n) / 2);
|
|
1792
1792
|
};
|
|
1793
|
-
},
|
|
1793
|
+
}, Et = (e) => e, Dt = {
|
|
1794
1794
|
ease: [
|
|
1795
1795
|
.25,
|
|
1796
1796
|
.1,
|
|
@@ -1845,16 +1845,16 @@ var dt = () => ({
|
|
|
1845
1845
|
.66,
|
|
1846
1846
|
-.56
|
|
1847
1847
|
]
|
|
1848
|
-
},
|
|
1848
|
+
}, Ot = (e) => {
|
|
1849
1849
|
if (Array.isArray(e)) {
|
|
1850
1850
|
if (e.length === 4 && e.every((e) => typeof e == "number")) {
|
|
1851
1851
|
let [t, n, r, i] = e;
|
|
1852
|
-
return
|
|
1852
|
+
return Tt(t, n, r, i);
|
|
1853
1853
|
}
|
|
1854
|
-
return
|
|
1854
|
+
return Et;
|
|
1855
1855
|
}
|
|
1856
|
-
return typeof e == "string" ? e === "linear" ?
|
|
1857
|
-
},
|
|
1856
|
+
return typeof e == "string" ? e === "linear" ? Et : Tt(...Dt[e] ?? Dt.ease) : Tt(...Dt.ease);
|
|
1857
|
+
}, kt = [
|
|
1858
1858
|
"x",
|
|
1859
1859
|
"y",
|
|
1860
1860
|
"z",
|
|
@@ -1865,7 +1865,7 @@ var dt = () => ({
|
|
|
1865
1865
|
"rotateX",
|
|
1866
1866
|
"rotateY",
|
|
1867
1867
|
"rotateZ"
|
|
1868
|
-
],
|
|
1868
|
+
], At = new Set(kt), jt = {
|
|
1869
1869
|
x: 0,
|
|
1870
1870
|
y: 0,
|
|
1871
1871
|
z: 0,
|
|
@@ -1876,7 +1876,7 @@ var dt = () => ({
|
|
|
1876
1876
|
rotateX: 0,
|
|
1877
1877
|
rotateY: 0,
|
|
1878
1878
|
rotateZ: 0
|
|
1879
|
-
},
|
|
1879
|
+
}, Mt = (e, t) => {
|
|
1880
1880
|
if (typeof t == "number") return {
|
|
1881
1881
|
value: t,
|
|
1882
1882
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -1895,26 +1895,26 @@ var dt = () => ({
|
|
|
1895
1895
|
value: i,
|
|
1896
1896
|
unit: a === "" && i === 0 ? "px" : a
|
|
1897
1897
|
};
|
|
1898
|
-
},
|
|
1899
|
-
let n = e.match(
|
|
1900
|
-
if (n.length !== r.length || e.replace(
|
|
1898
|
+
}, J = /-?\d*\.?\d+/g, Nt = (e, t) => {
|
|
1899
|
+
let n = e.match(J) ?? [], r = t.match(J) ?? [];
|
|
1900
|
+
if (n.length !== r.length || e.replace(J, " ") !== t.replace(J, " ")) return null;
|
|
1901
1901
|
let i = n.map(Number), a = r.map(Number);
|
|
1902
1902
|
return (t) => {
|
|
1903
1903
|
let n = 0;
|
|
1904
|
-
return e.replace(
|
|
1904
|
+
return e.replace(J, () => {
|
|
1905
1905
|
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
1906
1906
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
1907
1907
|
});
|
|
1908
1908
|
};
|
|
1909
|
-
},
|
|
1910
|
-
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 = [];
|
|
1911
1911
|
for (let s of n) {
|
|
1912
|
-
let n =
|
|
1913
|
-
if (
|
|
1912
|
+
let n = Lt(e.from, s), c = Lt(e.to, s);
|
|
1913
|
+
if (At.has(s)) {
|
|
1914
1914
|
let e = s, i = {
|
|
1915
|
-
value:
|
|
1915
|
+
value: jt[e],
|
|
1916
1916
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
1917
|
-
}, a = n === void 0 ? i :
|
|
1917
|
+
}, a = n === void 0 ? i : Mt(e, n), o = c === void 0 ? i : Mt(e, c);
|
|
1918
1918
|
if (!a || !o || a.unit !== o.unit && a.value !== 0 && o.value !== 0) return null;
|
|
1919
1919
|
let l = a.value === 0 && a.unit !== o.unit ? o.unit : a.unit, u = l === "%", d = 0;
|
|
1920
1920
|
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), r.push({
|
|
@@ -1945,15 +1945,15 @@ var dt = () => ({
|
|
|
1945
1945
|
if (typeof l != "string" || typeof u != "string") return null;
|
|
1946
1946
|
if (l === u) {
|
|
1947
1947
|
o.push({
|
|
1948
|
-
property:
|
|
1948
|
+
property: Pt(s),
|
|
1949
1949
|
value: l
|
|
1950
1950
|
});
|
|
1951
1951
|
continue;
|
|
1952
1952
|
}
|
|
1953
|
-
let d =
|
|
1953
|
+
let d = Nt(l, u);
|
|
1954
1954
|
if (!d) return null;
|
|
1955
1955
|
a.push({
|
|
1956
|
-
property:
|
|
1956
|
+
property: Pt(s),
|
|
1957
1957
|
mix: d
|
|
1958
1958
|
});
|
|
1959
1959
|
}
|
|
@@ -1963,46 +1963,46 @@ var dt = () => ({
|
|
|
1963
1963
|
strings: a,
|
|
1964
1964
|
constants: o
|
|
1965
1965
|
};
|
|
1966
|
-
},
|
|
1966
|
+
}, zt = 1, Bt = (e, t, n, r) => {
|
|
1967
1967
|
let i = 0, a = 0, o = !1, s = [], c = !0;
|
|
1968
|
-
for (let l of
|
|
1968
|
+
for (let l of kt) {
|
|
1969
1969
|
let u = e.find((e) => e.prop === l);
|
|
1970
1970
|
if (!u) continue;
|
|
1971
1971
|
let d = u.from.value + (u.to.value - u.from.value) * t;
|
|
1972
1972
|
if (u.from.unit === "%" && (d *= u.percentBase), l === "x" || l === "y") {
|
|
1973
|
-
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;
|
|
1974
1974
|
l === "x" ? (r.x = d, i = t) : (r.y = d, a = t), o = !0, t !== 0 && (c = !1);
|
|
1975
1975
|
continue;
|
|
1976
1976
|
}
|
|
1977
|
-
let f =
|
|
1977
|
+
let f = jt[l];
|
|
1978
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)`);
|
|
1979
1979
|
}
|
|
1980
1980
|
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
1981
|
-
},
|
|
1981
|
+
}, Vt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), Ht = (e) => {
|
|
1982
1982
|
let t = {};
|
|
1983
|
-
for (let n of
|
|
1983
|
+
for (let n of B(e)) t[Vt(n.property)] = n.value;
|
|
1984
1984
|
return t;
|
|
1985
|
-
},
|
|
1985
|
+
}, Ut = (e, t) => {
|
|
1986
1986
|
if (typeof e.animate != "function") return null;
|
|
1987
1987
|
try {
|
|
1988
|
-
let n = e.animate([
|
|
1988
|
+
let n = e.animate([Ht(t.from), Ht(t.to)], {
|
|
1989
1989
|
duration: Math.max(0, t.duration * 1e3),
|
|
1990
1990
|
delay: Math.max(0, t.delay * 1e3),
|
|
1991
|
-
easing:
|
|
1991
|
+
easing: H(t.ease),
|
|
1992
1992
|
fill: "both"
|
|
1993
1993
|
});
|
|
1994
1994
|
return n.pause(), n.currentTime = 0, n;
|
|
1995
1995
|
} catch {
|
|
1996
1996
|
return null;
|
|
1997
1997
|
}
|
|
1998
|
-
},
|
|
1998
|
+
}, Wt = () => ({
|
|
1999
1999
|
request: (e) => requestAnimationFrame(e),
|
|
2000
2000
|
cancel: (e) => cancelAnimationFrame(e),
|
|
2001
2001
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
2002
|
-
}),
|
|
2002
|
+
}), Y = ((e = Wt()) => {
|
|
2003
2003
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
2004
2004
|
join: (n, r) => {
|
|
2005
|
-
let i =
|
|
2005
|
+
let i = Rt(r.motion, r.element), s = i ? null : Ut(r.element, r.motion);
|
|
2006
2006
|
if (!i && !s) return null;
|
|
2007
2007
|
let c = t.get(n);
|
|
2008
2008
|
c || (c = {
|
|
@@ -2029,7 +2029,7 @@ var dt = () => ({
|
|
|
2029
2029
|
for (let e of i.constants) G(l.element, e.property);
|
|
2030
2030
|
a(l, 0);
|
|
2031
2031
|
}
|
|
2032
|
-
return r.role === "active" && !c.started && (c.started = !0,
|
|
2032
|
+
return r.role === "active" && !c.started && (c.started = !0, U.beginRun(), o(n, c)), () => {
|
|
2033
2033
|
l.detached = !0, l.scrub?.cancel(), K(l.element);
|
|
2034
2034
|
let r = t.get(n);
|
|
2035
2035
|
r && (r.tracks = r.tracks.filter((e) => e !== l), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
@@ -2045,13 +2045,13 @@ var dt = () => ({
|
|
|
2045
2045
|
}
|
|
2046
2046
|
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
2047
2047
|
let t = r.get(e);
|
|
2048
|
-
return t || (t =
|
|
2048
|
+
return t || (t = Ot(e.motion.ease), r.set(e, t)), t;
|
|
2049
2049
|
};
|
|
2050
2050
|
function a(t, n) {
|
|
2051
2051
|
let { element: r, parsed: i } = t;
|
|
2052
2052
|
if (!(!i || !r.isConnected)) {
|
|
2053
2053
|
if (i.transforms.length > 0) {
|
|
2054
|
-
let a =
|
|
2054
|
+
let a = Bt(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
2055
2055
|
a !== "" && (r.style.transform = a);
|
|
2056
2056
|
}
|
|
2057
2057
|
if (i.opacity) {
|
|
@@ -2068,7 +2068,7 @@ var dt = () => ({
|
|
|
2068
2068
|
});
|
|
2069
2069
|
}
|
|
2070
2070
|
function s(e, r, s) {
|
|
2071
|
-
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;
|
|
2072
2072
|
let c = !0;
|
|
2073
2073
|
for (let e of r.tracks) {
|
|
2074
2074
|
if (e.completed || e.detached) continue;
|
|
@@ -2082,14 +2082,14 @@ var dt = () => ({
|
|
|
2082
2082
|
a(e, i(e)(l)), l >= 1 ? (e.completed = !0, e.onComplete?.()) : c = !1;
|
|
2083
2083
|
}
|
|
2084
2084
|
if (c) {
|
|
2085
|
-
|
|
2085
|
+
U.endRun(), t.delete(e);
|
|
2086
2086
|
return;
|
|
2087
2087
|
}
|
|
2088
2088
|
o(e, r);
|
|
2089
2089
|
}
|
|
2090
2090
|
return n;
|
|
2091
2091
|
})();
|
|
2092
|
-
|
|
2092
|
+
Y.onFrameGap = (e) => {
|
|
2093
2093
|
if (typeof window < "u") {
|
|
2094
2094
|
let t = window.__flemoPlayerGaps ??= [];
|
|
2095
2095
|
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
@@ -2097,26 +2097,26 @@ X.onFrameGap = (e) => {
|
|
|
2097
2097
|
};
|
|
2098
2098
|
//#endregion
|
|
2099
2099
|
//#region src/core/engine/types.ts
|
|
2100
|
-
var
|
|
2100
|
+
var X = "data-flemo-skip-animation", Z = () => {}, Gt = "data-flemo-part-name", Kt = (e) => {
|
|
2101
2101
|
let t = e.parentElement ?? e;
|
|
2102
|
-
return Array.from(t.querySelectorAll(`[${
|
|
2102
|
+
return Array.from(t.querySelectorAll(`[${Gt}]`)).filter((n) => {
|
|
2103
2103
|
let r = n.closest("[data-flemo-screen]");
|
|
2104
2104
|
return !r || r === e || !t.contains(r);
|
|
2105
2105
|
});
|
|
2106
|
-
},
|
|
2106
|
+
}, qt = (e, t) => {
|
|
2107
2107
|
let [n, r] = t.split("-");
|
|
2108
|
-
return
|
|
2108
|
+
return Kt(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2109
2109
|
};
|
|
2110
|
-
function
|
|
2110
|
+
function Jt(e) {
|
|
2111
2111
|
return { driveScreenLifecycle: (t) => {
|
|
2112
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) => {
|
|
2113
2113
|
let s = e.getTransitionTaskId();
|
|
2114
|
-
if (!s || o.pendingTaskIds.some((e) => e !== s) || !
|
|
2114
|
+
if (!s || o.pendingTaskIds.some((e) => e !== s) || !U.playerAllowed()) return null;
|
|
2115
2115
|
let { scope: c, decorator: l, bars: u } = n();
|
|
2116
2116
|
if (!c) return null;
|
|
2117
|
-
let d =
|
|
2117
|
+
let d = we(r), f = z(d, t);
|
|
2118
2118
|
if (!f) return null;
|
|
2119
|
-
let p = [], m =
|
|
2119
|
+
let p = [], m = Y.join(s, {
|
|
2120
2120
|
element: c,
|
|
2121
2121
|
motion: f,
|
|
2122
2122
|
role: i,
|
|
@@ -2126,7 +2126,7 @@ function Kt(e) {
|
|
|
2126
2126
|
p.push(m);
|
|
2127
2127
|
for (let e of u ?? []) {
|
|
2128
2128
|
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2129
|
-
let t =
|
|
2129
|
+
let t = Y.join(s, {
|
|
2130
2130
|
element: e,
|
|
2131
2131
|
motion: f,
|
|
2132
2132
|
role: "passive"
|
|
@@ -2134,9 +2134,9 @@ function Kt(e) {
|
|
|
2134
2134
|
t && p.push(t);
|
|
2135
2135
|
}
|
|
2136
2136
|
if (l && d.decoratorName) {
|
|
2137
|
-
let e =
|
|
2137
|
+
let e = P.get(d.decoratorName), n = e ? z(e, t) : null;
|
|
2138
2138
|
if (n) {
|
|
2139
|
-
let e =
|
|
2139
|
+
let e = Y.join(s, {
|
|
2140
2140
|
element: l,
|
|
2141
2141
|
motion: n,
|
|
2142
2142
|
role: "passive"
|
|
@@ -2144,10 +2144,10 @@ function Kt(e) {
|
|
|
2144
2144
|
e && p.push(e);
|
|
2145
2145
|
}
|
|
2146
2146
|
}
|
|
2147
|
-
for (let e of
|
|
2148
|
-
let n =
|
|
2147
|
+
for (let e of qt(c, t)) {
|
|
2148
|
+
let n = F.get(e.getAttribute(Gt)), r = n ? z(n, t) : null;
|
|
2149
2149
|
if (!r) continue;
|
|
2150
|
-
let i =
|
|
2150
|
+
let i = Y.join(s, {
|
|
2151
2151
|
element: e,
|
|
2152
2152
|
motion: r,
|
|
2153
2153
|
role: "passive"
|
|
@@ -2161,38 +2161,38 @@ function Kt(e) {
|
|
|
2161
2161
|
let { scope: e, decorator: t, bars: r } = n();
|
|
2162
2162
|
if (e) {
|
|
2163
2163
|
K(e);
|
|
2164
|
-
for (let t of
|
|
2164
|
+
for (let t of Kt(e)) K(t);
|
|
2165
2165
|
}
|
|
2166
2166
|
t && K(t);
|
|
2167
2167
|
for (let e of r ?? []) e && K(e);
|
|
2168
|
-
return
|
|
2168
|
+
return Z;
|
|
2169
2169
|
}
|
|
2170
2170
|
if (a === "REPLACING" && i !== r && e.setReplaceTransitionStatus("PENDING"), l && c) {
|
|
2171
2171
|
let e = u(`${a}-false`, "passive");
|
|
2172
2172
|
if (e) return e;
|
|
2173
2173
|
}
|
|
2174
|
-
return
|
|
2174
|
+
return Z;
|
|
2175
2175
|
}
|
|
2176
2176
|
if (a === "COMPLETED") {
|
|
2177
2177
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
2178
2178
|
let { scope: t, decorator: r, bars: i } = n();
|
|
2179
2179
|
if (t) {
|
|
2180
|
-
K(t), t.removeAttribute(
|
|
2181
|
-
for (let e of
|
|
2180
|
+
K(t), t.removeAttribute(X);
|
|
2181
|
+
for (let e of Kt(t)) K(e);
|
|
2182
2182
|
}
|
|
2183
|
-
r && (K(r), r.removeAttribute(
|
|
2183
|
+
r && (K(r), r.removeAttribute(X));
|
|
2184
2184
|
for (let e of i ?? []) e && (K(e), e.style.removeProperty("will-change"));
|
|
2185
|
-
return
|
|
2185
|
+
return Z;
|
|
2186
2186
|
}
|
|
2187
|
-
if (a === "IDLE") return
|
|
2187
|
+
if (a === "IDLE") return Z;
|
|
2188
2188
|
let { scope: d } = n();
|
|
2189
|
-
if (!d) return
|
|
2189
|
+
if (!d) return Z;
|
|
2190
2190
|
let f = () => {
|
|
2191
2191
|
let t = e.getTransitionTaskId();
|
|
2192
2192
|
t && o.resolveTask(t);
|
|
2193
|
-
}, p =
|
|
2194
|
-
if (!(!h &&
|
|
2195
|
-
let g =
|
|
2193
|
+
}, p = we(r), m = `${a}-true`, h = d.getAttribute(X) === "true";
|
|
2194
|
+
if (!(!h && nt(p, m))) return queueMicrotask(f), Z;
|
|
2195
|
+
let g = z(p, m), _ = !h && !!g, v = Xe("screen", r, m), y = (e) => {
|
|
2196
2196
|
e.target === d && e.animationName === v && (d.removeEventListener("animationend", y), f());
|
|
2197
2197
|
};
|
|
2198
2198
|
d.addEventListener("animationend", y);
|
|
@@ -2204,20 +2204,20 @@ function Kt(e) {
|
|
|
2204
2204
|
}
|
|
2205
2205
|
//#endregion
|
|
2206
2206
|
//#region src/utils/findScrollable.ts
|
|
2207
|
-
function
|
|
2208
|
-
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);
|
|
2209
2209
|
if (!o) return {
|
|
2210
2210
|
element: null,
|
|
2211
2211
|
hasMarker: !1
|
|
2212
2212
|
};
|
|
2213
2213
|
let s = o.closest?.(r);
|
|
2214
|
-
if (s instanceof HTMLElement &&
|
|
2214
|
+
if (s instanceof HTMLElement && Q(s, n) && (!a || $(s, n))) return {
|
|
2215
2215
|
element: s,
|
|
2216
2216
|
hasMarker: !0
|
|
2217
2217
|
};
|
|
2218
2218
|
let c = o, l = 0;
|
|
2219
2219
|
for (; c && l < i;) {
|
|
2220
|
-
if (
|
|
2220
|
+
if (Q(c, n) && (!a || $(c, n))) return {
|
|
2221
2221
|
element: c,
|
|
2222
2222
|
hasMarker: !1
|
|
2223
2223
|
};
|
|
@@ -2228,7 +2228,7 @@ function qt(e, t) {
|
|
|
2228
2228
|
hasMarker: !1
|
|
2229
2229
|
};
|
|
2230
2230
|
}
|
|
2231
|
-
function
|
|
2231
|
+
function Xt(e) {
|
|
2232
2232
|
if (!e) return null;
|
|
2233
2233
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2234
2234
|
if (n && n.length) {
|
|
@@ -2236,18 +2236,18 @@ function Jt(e) {
|
|
|
2236
2236
|
}
|
|
2237
2237
|
return e instanceof HTMLElement ? e : null;
|
|
2238
2238
|
}
|
|
2239
|
-
function
|
|
2239
|
+
function Q(e, t) {
|
|
2240
2240
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2241
2241
|
}
|
|
2242
|
-
function
|
|
2243
|
-
if (
|
|
2242
|
+
function $(e, t) {
|
|
2243
|
+
if (!Q(e, t) || typeof window > "u") return !1;
|
|
2244
2244
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2245
2245
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2246
2246
|
}
|
|
2247
2247
|
//#endregion
|
|
2248
2248
|
//#region src/core/engine/createSwipeController.ts
|
|
2249
|
-
var
|
|
2250
|
-
function
|
|
2249
|
+
var Zt = "data-flemo-skip-animation";
|
|
2250
|
+
function Qt(e) {
|
|
2251
2251
|
let t = null, n = null, r = {
|
|
2252
2252
|
current: [],
|
|
2253
2253
|
prev: []
|
|
@@ -2309,7 +2309,7 @@ function Zt(e) {
|
|
|
2309
2309
|
current: i,
|
|
2310
2310
|
prev: s
|
|
2311
2311
|
};
|
|
2312
|
-
let c =
|
|
2312
|
+
let c = Ge(e.getTransition()).join(", ");
|
|
2313
2313
|
for (let e of i) e.style.willChange = c;
|
|
2314
2314
|
for (let e of s) e.style.willChange = c;
|
|
2315
2315
|
}, b = () => {
|
|
@@ -2327,7 +2327,7 @@ function Zt(e) {
|
|
|
2327
2327
|
};
|
|
2328
2328
|
}, S = (e, t, n) => {
|
|
2329
2329
|
let r = (r, i) => {
|
|
2330
|
-
let a =
|
|
2330
|
+
let a = F.get(r.getAttribute("data-flemo-part-name"));
|
|
2331
2331
|
if (!a) return;
|
|
2332
2332
|
let o = {
|
|
2333
2333
|
animate: q,
|
|
@@ -2410,7 +2410,7 @@ function Zt(e) {
|
|
|
2410
2410
|
}), S("end", e, 0);
|
|
2411
2411
|
}
|
|
2412
2412
|
})) {
|
|
2413
|
-
c?.setAttribute(
|
|
2413
|
+
c?.setAttribute(Zt, "true"), l?.setAttribute(Zt, "true");
|
|
2414
2414
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
2415
2415
|
for (let e of r.prev) K(e), e.style.removeProperty("will-change");
|
|
2416
2416
|
r = {
|
|
@@ -2426,10 +2426,10 @@ function Zt(e) {
|
|
|
2426
2426
|
};
|
|
2427
2427
|
return {
|
|
2428
2428
|
pointerDown: (t) => {
|
|
2429
|
-
e.isReadyForDrag() && (f =
|
|
2429
|
+
e.isReadyForDrag() && (f = Yt(t.target, {
|
|
2430
2430
|
direction: "x",
|
|
2431
2431
|
verifyByScroll: !0
|
|
2432
|
-
}), p =
|
|
2432
|
+
}), p = Yt(t.target, {
|
|
2433
2433
|
direction: "y",
|
|
2434
2434
|
verifyByScroll: !0
|
|
2435
2435
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -2458,7 +2458,7 @@ function Zt(e) {
|
|
|
2458
2458
|
}
|
|
2459
2459
|
//#endregion
|
|
2460
2460
|
//#region src/screen/computeBarRiding.ts
|
|
2461
|
-
function
|
|
2461
|
+
function $t(e) {
|
|
2462
2462
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
2463
2463
|
app: !1,
|
|
2464
2464
|
nav: !1
|
|
@@ -2469,24 +2469,24 @@ function Qt(e) {
|
|
|
2469
2469
|
}
|
|
2470
2470
|
//#endregion
|
|
2471
2471
|
//#region src/screen/animStartAnchor.ts
|
|
2472
|
-
function
|
|
2472
|
+
function en(e) {
|
|
2473
2473
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
2474
2474
|
}
|
|
2475
|
-
var
|
|
2476
|
-
function nn(e) {
|
|
2477
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, tn);
|
|
2478
|
-
}
|
|
2475
|
+
var tn = 300, nn = 20;
|
|
2479
2476
|
function rn(e) {
|
|
2480
|
-
|
|
2477
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, nn);
|
|
2478
|
+
}
|
|
2479
|
+
function an(e) {
|
|
2480
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of rn(e)) t.decode().catch(() => {});
|
|
2481
2481
|
}
|
|
2482
|
-
function
|
|
2482
|
+
function on(e, t = {}) {
|
|
2483
2483
|
let n = !1, r = 0, i = [], a = () => {
|
|
2484
2484
|
let r = t.scope;
|
|
2485
2485
|
if (!r || typeof r.querySelectorAll != "function") {
|
|
2486
2486
|
e();
|
|
2487
2487
|
return;
|
|
2488
2488
|
}
|
|
2489
|
-
let i =
|
|
2489
|
+
let i = rn(r);
|
|
2490
2490
|
if (i.length === 0) {
|
|
2491
2491
|
e();
|
|
2492
2492
|
return;
|
|
@@ -2512,7 +2512,7 @@ function an(e, t = {}) {
|
|
|
2512
2512
|
}
|
|
2513
2513
|
//#endregion
|
|
2514
2514
|
//#region src/screen/observeBarHeight.ts
|
|
2515
|
-
function
|
|
2515
|
+
function sn(e, t) {
|
|
2516
2516
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
2517
2517
|
let n = new ResizeObserver(([e]) => {
|
|
2518
2518
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -2523,14 +2523,14 @@ function on(e, t) {
|
|
|
2523
2523
|
}
|
|
2524
2524
|
//#endregion
|
|
2525
2525
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
2526
|
-
var
|
|
2527
|
-
function
|
|
2526
|
+
var cn = 0;
|
|
2527
|
+
function ln(e) {
|
|
2528
2528
|
let t = 0, n = () => {
|
|
2529
2529
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
2530
2530
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
2531
2531
|
t = t < 0 ? 0 : t;
|
|
2532
|
-
let n = t -
|
|
2533
|
-
n = n < 0 ? 0 : n,
|
|
2532
|
+
let n = t - cn;
|
|
2533
|
+
n = n < 0 ? 0 : n, cn ||= t, e(t, n);
|
|
2534
2534
|
});
|
|
2535
2535
|
};
|
|
2536
2536
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -2539,7 +2539,7 @@ function cn(e) {
|
|
|
2539
2539
|
}
|
|
2540
2540
|
//#endregion
|
|
2541
2541
|
//#region src/utils/isOpaqueColor.ts
|
|
2542
|
-
function
|
|
2542
|
+
function un(e) {
|
|
2543
2543
|
let t = e.trim().toLowerCase();
|
|
2544
2544
|
if (t === "transparent" || t === "") return !1;
|
|
2545
2545
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -2550,7 +2550,7 @@ function ln(e) {
|
|
|
2550
2550
|
}
|
|
2551
2551
|
//#endregion
|
|
2552
2552
|
//#region src/utils/buildRoutePath.ts
|
|
2553
|
-
function
|
|
2553
|
+
function dn(e, n) {
|
|
2554
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();
|
|
2555
2555
|
return {
|
|
2556
2556
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -2558,4 +2558,4 @@ function un(e, n) {
|
|
|
2558
2558
|
};
|
|
2559
2559
|
}
|
|
2560
2560
|
//#endregion
|
|
2561
|
-
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 };
|
package/package.json
CHANGED