@flemo/core 1.6.1 → 1.8.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/createRouterScope.d.ts +26 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.mjs +398 -230
- package/dist/navigate/__tests__/createStepController.test.d.ts +1 -0
- package/dist/navigate/createStepController.d.ts +20 -0
- package/dist/screen/__tests__/animStartAnchor.test.d.ts +1 -0
- package/dist/screen/__tests__/computeBarRiding.test.d.ts +1 -0
- package/dist/screen/__tests__/observeBarHeight.test.d.ts +1 -0
- package/dist/screen/__tests__/observeViewportScrollHeight.test.d.ts +1 -0
- package/dist/screen/animStartAnchor.d.ts +9 -0
- package/dist/screen/computeBarRiding.d.ts +13 -0
- package/dist/screen/observeBarHeight.d.ts +1 -0
- package/dist/screen/observeViewportScrollHeight.d.ts +1 -0
- package/dist/transition/__tests__/enteringInitialStyle.test.d.ts +1 -0
- package/dist/transition/__tests__/registerTransitionDefinitions.test.d.ts +6 -0
- package/dist/transition/enteringInitialStyle.d.ts +11 -0
- package/dist/transition/registerTransitionDefinitions.d.ts +4 -0
- package/dist/utils/__tests__/buildRoutePath.test.d.ts +1 -0
- package/dist/utils/__tests__/matchesPathname.test.d.ts +1 -0
- package/dist/utils/buildRoutePath.d.ts +5 -0
- package/dist/utils/matchesPathname.d.ts +2 -0
- package/package.json +1 -1
- package/dist/core/engine/barRiding.d.ts +0 -18
- /package/dist/core/{engine/__tests__/barRiding.test.d.ts → __tests__/createRouterScope.test.d.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createStore as e } from "zustand/vanilla";
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
2
|
+
import { compile as t, match as n, parse as r, pathToRegexp as i } from "path-to-regexp";
|
|
3
|
+
var a = new class {
|
|
4
4
|
tasks = /* @__PURE__ */ new Map();
|
|
5
5
|
instanceId = Date.now().toString();
|
|
6
6
|
isLocked = !1;
|
|
@@ -175,7 +175,7 @@ var r = new class {
|
|
|
175
175
|
}();
|
|
176
176
|
//#endregion
|
|
177
177
|
//#region src/history/store.ts
|
|
178
|
-
function
|
|
178
|
+
function o(t = [], n = -1) {
|
|
179
179
|
return e((e) => ({
|
|
180
180
|
index: n,
|
|
181
181
|
pendingIndex: n,
|
|
@@ -219,38 +219,38 @@ function i(t = [], n = -1) {
|
|
|
219
219
|
}
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/utils/getMatchedPathPattern.ts
|
|
222
|
-
function
|
|
223
|
-
return Array.isArray(e) ? e.find((e) =>
|
|
222
|
+
function s(e, t) {
|
|
223
|
+
return Array.isArray(e) ? e.find((e) => i(e).regexp.test(t)) ?? "" : i(e).regexp.test(t) ? e : "";
|
|
224
224
|
}
|
|
225
225
|
//#endregion
|
|
226
226
|
//#region src/utils/getParams.ts
|
|
227
|
-
function
|
|
228
|
-
let i =
|
|
227
|
+
function c(e, t, r) {
|
|
228
|
+
let i = n(s(e, t))(t), a = new URLSearchParams(r), o = Object.fromEntries(a.entries());
|
|
229
229
|
return i ? {
|
|
230
230
|
...i.params,
|
|
231
|
-
...
|
|
231
|
+
...o
|
|
232
232
|
} : {};
|
|
233
233
|
}
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region src/history/seedInitialHistory.ts
|
|
236
|
-
function
|
|
236
|
+
function l(e, t, n, r) {
|
|
237
237
|
return {
|
|
238
238
|
id: "root",
|
|
239
239
|
pathname: t,
|
|
240
|
-
params:
|
|
240
|
+
params: c(e, t, n),
|
|
241
241
|
transitionName: r,
|
|
242
242
|
layoutId: null
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
245
|
//#endregion
|
|
246
246
|
//#region src/utils/isServer.ts
|
|
247
|
-
function
|
|
247
|
+
function u() {
|
|
248
248
|
return typeof document > "u";
|
|
249
249
|
}
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region src/history/ensureWindowHistoryState.ts
|
|
252
|
-
function
|
|
253
|
-
if (
|
|
252
|
+
function d(e, t, n = {}) {
|
|
253
|
+
if (u()) return;
|
|
254
254
|
let r = {
|
|
255
255
|
id: "root",
|
|
256
256
|
index: 0,
|
|
@@ -272,11 +272,11 @@ function l(e, t, n = {}) {
|
|
|
272
272
|
}
|
|
273
273
|
//#endregion
|
|
274
274
|
//#region src/history/historyDriver.ts
|
|
275
|
-
var
|
|
275
|
+
var f = (e, t) => ({
|
|
276
276
|
...window.history.state ?? {},
|
|
277
277
|
[e]: t
|
|
278
278
|
});
|
|
279
|
-
function
|
|
279
|
+
function p(e) {
|
|
280
280
|
return e === void 0 ? {
|
|
281
281
|
readState: () => window.history.state,
|
|
282
282
|
readPathname: () => window.location.pathname,
|
|
@@ -294,8 +294,8 @@ function d(e) {
|
|
|
294
294
|
} : {
|
|
295
295
|
readState: () => window.history.state?.[e] ?? null,
|
|
296
296
|
readPathname: () => window.location.pathname,
|
|
297
|
-
pushState: (t, n) => window.history.pushState(
|
|
298
|
-
replaceState: (t, n) => window.history.replaceState(
|
|
297
|
+
pushState: (t, n) => window.history.pushState(f(e, t), "", n),
|
|
298
|
+
replaceState: (t, n) => window.history.replaceState(f(e, t), "", n),
|
|
299
299
|
go: (e) => window.history.go(e),
|
|
300
300
|
back: () => window.history.back(),
|
|
301
301
|
subscribe: (t) => {
|
|
@@ -309,7 +309,7 @@ function d(e) {
|
|
|
309
309
|
}
|
|
310
310
|
//#endregion
|
|
311
311
|
//#region src/navigate/selfPopGuard.ts
|
|
312
|
-
function
|
|
312
|
+
function m() {
|
|
313
313
|
let e = 0;
|
|
314
314
|
return {
|
|
315
315
|
mark() {
|
|
@@ -320,30 +320,30 @@ function f() {
|
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
var
|
|
324
|
-
function
|
|
325
|
-
|
|
323
|
+
var h = m();
|
|
324
|
+
function g() {
|
|
325
|
+
h.mark();
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
return
|
|
327
|
+
function _() {
|
|
328
|
+
return h.consume();
|
|
329
329
|
}
|
|
330
330
|
//#endregion
|
|
331
331
|
//#region src/history/createHistorySync.ts
|
|
332
|
-
function
|
|
333
|
-
let { stores: t, driver: n =
|
|
332
|
+
function v(e) {
|
|
333
|
+
let { stores: t, driver: n = p(), consume: r = _ } = e;
|
|
334
334
|
return n.subscribe(async (e) => {
|
|
335
|
-
if (
|
|
336
|
-
let n = e.state,
|
|
337
|
-
(await
|
|
338
|
-
let { setStatus:
|
|
335
|
+
if (r()) return;
|
|
336
|
+
let n = e.state, i = a.generateTaskId();
|
|
337
|
+
(await a.addTask(async (r) => {
|
|
338
|
+
let { setStatus: a, setTransitionTaskId: o } = t.navigate.getState(), { index: s, addHistory: c, popHistory: l, setPendingIndex: u } = t.history.getState(), d = n?.index, f = d !== void 0 && d < s, p = n?.status === "PUSHING" && d !== void 0 && d > s, m = n?.status === "REPLACING" && d !== void 0 && d > s;
|
|
339
339
|
if (!f && !p && !m) {
|
|
340
340
|
r.abort();
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
if (o(
|
|
343
|
+
if (o(i), f) u(d), a("POPPING");
|
|
344
344
|
else {
|
|
345
345
|
let t = n;
|
|
346
|
-
|
|
346
|
+
a(p ? "PUSHING" : "REPLACING"), c({
|
|
347
347
|
id: t.id,
|
|
348
348
|
pathname: e.pathname,
|
|
349
349
|
params: t.params,
|
|
@@ -352,17 +352,17 @@ function g(e) {
|
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
return async () => {
|
|
355
|
-
f && d !== void 0 && l(d + 1),
|
|
355
|
+
f && d !== void 0 && l(d + 1), a("COMPLETED");
|
|
356
356
|
};
|
|
357
357
|
}, {
|
|
358
|
-
id:
|
|
358
|
+
id: i,
|
|
359
359
|
control: { manual: !0 }
|
|
360
360
|
})).result?.();
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/history/memoryHistoryDriver.ts
|
|
365
|
-
function
|
|
365
|
+
function y(e) {
|
|
366
366
|
let t = [{
|
|
367
367
|
state: e?.state ?? null,
|
|
368
368
|
url: e?.url ?? "/"
|
|
@@ -404,7 +404,7 @@ function _(e) {
|
|
|
404
404
|
}
|
|
405
405
|
//#endregion
|
|
406
406
|
//#region src/navigate/store.ts
|
|
407
|
-
function
|
|
407
|
+
function b() {
|
|
408
408
|
return e((e) => ({
|
|
409
409
|
status: "IDLE",
|
|
410
410
|
transitionTaskId: null,
|
|
@@ -414,11 +414,11 @@ function v() {
|
|
|
414
414
|
}
|
|
415
415
|
//#endregion
|
|
416
416
|
//#region src/navigate/createNavigationController.ts
|
|
417
|
-
var
|
|
418
|
-
let { regexp:
|
|
419
|
-
for (let e = t - 1; e >= 0; e--) if (
|
|
417
|
+
var x = (e, t, n) => {
|
|
418
|
+
let { regexp: r } = i(e);
|
|
419
|
+
for (let e = t - 1; e >= 0; e--) if (r.test(n[e].pathname)) return t - e;
|
|
420
420
|
return -1;
|
|
421
|
-
},
|
|
421
|
+
}, S = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, C = async (e, t, n, r) => {
|
|
422
422
|
let i, a = new Promise((t) => {
|
|
423
423
|
i = e.subscribe(() => t(!0));
|
|
424
424
|
}), o = new Promise((e) => setTimeout(() => e(!1), 200));
|
|
@@ -426,38 +426,38 @@ var y = (e, t, r) => {
|
|
|
426
426
|
let s = await Promise.race([a, o]);
|
|
427
427
|
i(), s && r();
|
|
428
428
|
};
|
|
429
|
-
function
|
|
430
|
-
let { stores: t, buildPathname: n, driver:
|
|
429
|
+
function w(e) {
|
|
430
|
+
let { stores: t, buildPathname: n, driver: r = p(), markSelfInduced: i = g } = e, o = async (e, o, s) => {
|
|
431
431
|
let { status: c } = t.navigate.getState();
|
|
432
432
|
if (c !== "COMPLETED" && c !== "IDLE") return;
|
|
433
|
-
let l = t.transition.getState().defaultTransitionName, { transitionName: u = l, layoutId: d = null } = s ?? {}, f =
|
|
434
|
-
(await
|
|
435
|
-
let { index:
|
|
433
|
+
let l = t.transition.getState().defaultTransitionName, { transitionName: u = l, layoutId: d = null } = s ?? {}, f = a.generateTaskId();
|
|
434
|
+
(await a.addTask(async () => {
|
|
435
|
+
let { index: a, histories: c, addHistory: l, popHistories: p } = t.history.getState(), m = (() => {
|
|
436
436
|
if (s?.until != null) {
|
|
437
|
-
let e =
|
|
437
|
+
let e = x(s.until, a, c);
|
|
438
438
|
return e < 0 ? 0 : e;
|
|
439
439
|
}
|
|
440
|
-
return Math.min(
|
|
440
|
+
return Math.min(S(s?.skip, 0), Math.max(0, a));
|
|
441
441
|
})(), { setStatus: h, setTransitionTaskId: g } = t.navigate.getState();
|
|
442
442
|
h("PUSHING"), g(f);
|
|
443
|
-
let { pathname: _, toPathname: v } = n(e, o ?? {}),
|
|
443
|
+
let { pathname: _, toPathname: v } = n(e, o ?? {}), y = {
|
|
444
444
|
id: f,
|
|
445
445
|
pathname: v,
|
|
446
446
|
params: o ?? {},
|
|
447
447
|
transitionName: u,
|
|
448
448
|
layoutId: d
|
|
449
449
|
};
|
|
450
|
-
return m === 0 ? (
|
|
450
|
+
return m === 0 ? (r.pushState({
|
|
451
451
|
id: f,
|
|
452
|
-
index:
|
|
452
|
+
index: a + 1,
|
|
453
453
|
status: "PUSHING",
|
|
454
454
|
params: o,
|
|
455
455
|
transitionName: u,
|
|
456
456
|
layoutId: d
|
|
457
|
-
}, _), l(
|
|
457
|
+
}, _), l(y), () => {
|
|
458
458
|
h("COMPLETED");
|
|
459
|
-
}) : (l(
|
|
460
|
-
|
|
459
|
+
}) : (l(y), await C(r, i, m, () => {
|
|
460
|
+
r.pushState({
|
|
461
461
|
id: f,
|
|
462
462
|
index: t.history.getState().index - m,
|
|
463
463
|
status: "PUSHING",
|
|
@@ -475,55 +475,55 @@ function S(e) {
|
|
|
475
475
|
}, s = async (e, o, s) => {
|
|
476
476
|
let { status: c } = t.navigate.getState();
|
|
477
477
|
if (c !== "COMPLETED" && c !== "IDLE") return;
|
|
478
|
-
let l = t.transition.getState().defaultTransitionName, { transitionName: u = l, layoutId: d = null } = s ?? {}, f =
|
|
479
|
-
(await
|
|
478
|
+
let l = t.transition.getState().defaultTransitionName, { transitionName: u = l, layoutId: d = null } = s ?? {}, f = a.generateTaskId();
|
|
479
|
+
(await a.addTask(async (a) => {
|
|
480
480
|
let { index: c, histories: l, addHistory: p, replaceHistory: m, popHistories: h } = t.history.getState(), g = (() => {
|
|
481
481
|
if (s?.until != null) {
|
|
482
|
-
let e =
|
|
482
|
+
let e = x(s.until, c, l);
|
|
483
483
|
return e < 0 ? 0 : e + 1;
|
|
484
484
|
}
|
|
485
|
-
return Math.min(
|
|
485
|
+
return Math.min(S(s?.skip, 0) + 1, c + 1);
|
|
486
486
|
})();
|
|
487
487
|
if (g <= 0) {
|
|
488
|
-
|
|
488
|
+
a.abort();
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
491
|
let { setStatus: _, setTransitionTaskId: v } = t.navigate.getState();
|
|
492
492
|
_("REPLACING"), v(f);
|
|
493
|
-
let { pathname:
|
|
493
|
+
let { pathname: y, toPathname: b } = n(e, o ?? {}), w = {
|
|
494
494
|
id: f,
|
|
495
|
-
pathname:
|
|
495
|
+
pathname: b,
|
|
496
496
|
params: o ?? {},
|
|
497
497
|
transitionName: u,
|
|
498
498
|
layoutId: d
|
|
499
499
|
};
|
|
500
|
-
return g === 1 ? (
|
|
500
|
+
return g === 1 ? (r.replaceState({
|
|
501
501
|
id: f,
|
|
502
502
|
index: c,
|
|
503
503
|
status: "REPLACING",
|
|
504
504
|
params: o,
|
|
505
505
|
transitionName: u,
|
|
506
506
|
layoutId: d
|
|
507
|
-
},
|
|
507
|
+
}, y), p(w), async () => {
|
|
508
508
|
m(c), _("COMPLETED");
|
|
509
|
-
}) : (h(g - 1), p(w), g <= c ? await
|
|
510
|
-
|
|
509
|
+
}) : (h(g - 1), p(w), g <= c ? await C(r, i, g, () => {
|
|
510
|
+
r.pushState({
|
|
511
511
|
id: f,
|
|
512
512
|
index: t.history.getState().index - 1,
|
|
513
513
|
status: "REPLACING",
|
|
514
514
|
params: o,
|
|
515
515
|
transitionName: u,
|
|
516
516
|
layoutId: d
|
|
517
|
-
},
|
|
518
|
-
}) : await
|
|
519
|
-
|
|
517
|
+
}, y);
|
|
518
|
+
}) : await C(r, i, c, () => {
|
|
519
|
+
r.replaceState({
|
|
520
520
|
id: f,
|
|
521
521
|
index: 0,
|
|
522
522
|
status: "REPLACING",
|
|
523
523
|
params: o,
|
|
524
524
|
transitionName: u,
|
|
525
525
|
layoutId: d
|
|
526
|
-
},
|
|
526
|
+
}, y);
|
|
527
527
|
}), async () => {
|
|
528
528
|
m(t.history.getState().index - 1), _("COMPLETED");
|
|
529
529
|
});
|
|
@@ -532,21 +532,21 @@ function S(e) {
|
|
|
532
532
|
control: { manual: !0 }
|
|
533
533
|
})).result?.();
|
|
534
534
|
}, c = async (e, n) => {
|
|
535
|
-
let o =
|
|
536
|
-
(await
|
|
535
|
+
let o = a.generateTaskId();
|
|
536
|
+
(await a.addTask(async (a) => {
|
|
537
537
|
let { index: s, histories: c, popHistory: l, popHistories: u, setPendingIndex: d, setTransitionName: f } = t.history.getState();
|
|
538
538
|
if (s <= 0) {
|
|
539
|
-
|
|
539
|
+
a.abort();
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
542
|
let p = Math.min(e(s, c), s);
|
|
543
543
|
if (p <= 0) {
|
|
544
|
-
|
|
544
|
+
a.abort();
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
547
|
d(s - p);
|
|
548
548
|
let { setStatus: m, setTransitionTaskId: h } = t.navigate.getState();
|
|
549
|
-
return n && f(s, n), m("POPPING"), h(o), u(p - 1),
|
|
549
|
+
return n && f(s, n), m("POPPING"), h(o), u(p - 1), i(), p === 1 ? r.back() : r.go(-p), async () => {
|
|
550
550
|
l(t.history.getState().index), m("COMPLETED");
|
|
551
551
|
};
|
|
552
552
|
}, {
|
|
@@ -560,18 +560,90 @@ function S(e) {
|
|
|
560
560
|
pop: async (e) => {
|
|
561
561
|
await c((t, n) => {
|
|
562
562
|
if (e?.until != null) {
|
|
563
|
-
let r =
|
|
563
|
+
let r = x(e.until, t, n);
|
|
564
564
|
return r < 0 ? 0 : r;
|
|
565
565
|
}
|
|
566
|
-
let r =
|
|
566
|
+
let r = S(e?.skip, 1);
|
|
567
567
|
return r <= 0 ? 0 : Math.min(r, t);
|
|
568
568
|
}, e?.transitionName);
|
|
569
569
|
}
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
572
|
//#endregion
|
|
573
|
+
//#region src/navigate/createStepController.ts
|
|
574
|
+
var ee = (e) => {
|
|
575
|
+
let t = e;
|
|
576
|
+
return t?.step ? t.params ?? {} : null;
|
|
577
|
+
}, te = (e, t) => {
|
|
578
|
+
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
579
|
+
return n ? `${e}?${n}` : e;
|
|
580
|
+
};
|
|
581
|
+
function ne(e) {
|
|
582
|
+
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
583
|
+
return {
|
|
584
|
+
pushStep: async (e) => {
|
|
585
|
+
(await a.addTask(async () => {
|
|
586
|
+
let t = i(e), r = n.readState();
|
|
587
|
+
return r?.step || n.replaceState({
|
|
588
|
+
...r,
|
|
589
|
+
step: !0
|
|
590
|
+
}, n.readPathname()), n.pushState({
|
|
591
|
+
...n.readState(),
|
|
592
|
+
step: !0,
|
|
593
|
+
params: e
|
|
594
|
+
}, t), async () => o(e);
|
|
595
|
+
})).result?.();
|
|
596
|
+
},
|
|
597
|
+
replaceStep: async (e) => {
|
|
598
|
+
(await a.addTask(async () => {
|
|
599
|
+
let t = i(e);
|
|
600
|
+
return n.replaceState({
|
|
601
|
+
...n.readState(),
|
|
602
|
+
step: !0,
|
|
603
|
+
params: e
|
|
604
|
+
}, t), async () => o(e);
|
|
605
|
+
})).result?.();
|
|
606
|
+
},
|
|
607
|
+
popStep: async () => {
|
|
608
|
+
let e = a.generateTaskId();
|
|
609
|
+
(await a.addTask(async (i) => {
|
|
610
|
+
let a = new Promise((e) => {
|
|
611
|
+
let t = n.subscribe((n) => {
|
|
612
|
+
t(), e(n.state);
|
|
613
|
+
});
|
|
614
|
+
}), s = new Promise((e) => setTimeout(() => e(void 0), 200));
|
|
615
|
+
r(), n.back();
|
|
616
|
+
let c = await Promise.race([a, s]);
|
|
617
|
+
if (!c) {
|
|
618
|
+
i.abort();
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
if (c.step) {
|
|
622
|
+
o(c.params ?? {}), i.abort();
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
let { setStatus: l, setTransitionTaskId: u } = t.navigate.getState(), { index: d, popHistory: f } = t.history.getState();
|
|
626
|
+
return l("POPPING"), u(e), async () => {
|
|
627
|
+
f(d), l("COMPLETED");
|
|
628
|
+
};
|
|
629
|
+
}, {
|
|
630
|
+
id: e,
|
|
631
|
+
control: { manual: !0 }
|
|
632
|
+
})).result?.();
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
//#endregion
|
|
637
|
+
//#region src/transition/store.ts
|
|
638
|
+
function re(t = "cupertino") {
|
|
639
|
+
return e((e) => ({
|
|
640
|
+
defaultTransitionName: t,
|
|
641
|
+
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
642
|
+
}));
|
|
643
|
+
}
|
|
644
|
+
//#endregion
|
|
573
645
|
//#region src/screen/store.ts
|
|
574
|
-
function
|
|
646
|
+
function T() {
|
|
575
647
|
return e((e) => ({
|
|
576
648
|
dragStatus: "IDLE",
|
|
577
649
|
replaceTransitionStatus: "IDLE",
|
|
@@ -589,8 +661,41 @@ function C() {
|
|
|
589
661
|
}));
|
|
590
662
|
}
|
|
591
663
|
//#endregion
|
|
664
|
+
//#region src/core/createRouterScope.ts
|
|
665
|
+
var ie = {
|
|
666
|
+
mark: () => {},
|
|
667
|
+
consume: () => !1
|
|
668
|
+
};
|
|
669
|
+
function ae(e) {
|
|
670
|
+
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: s } = e, c = l(t, n, r, i);
|
|
671
|
+
if (e.hostedScope) return e.hostedScope.history.getState().index === -1 && e.hostedScope.history.setState({
|
|
672
|
+
index: 0,
|
|
673
|
+
histories: [c]
|
|
674
|
+
}), e.hostedScope;
|
|
675
|
+
let u = a ? y({
|
|
676
|
+
state: {
|
|
677
|
+
id: c.id,
|
|
678
|
+
index: 0,
|
|
679
|
+
status: "IDLE",
|
|
680
|
+
params: c.params,
|
|
681
|
+
transitionName: c.transitionName,
|
|
682
|
+
layoutId: c.layoutId
|
|
683
|
+
},
|
|
684
|
+
url: c.pathname
|
|
685
|
+
}) : s, d = a ? ie : m();
|
|
686
|
+
return {
|
|
687
|
+
history: o([c], 0),
|
|
688
|
+
navigate: b(),
|
|
689
|
+
transition: re(i),
|
|
690
|
+
screen: T(),
|
|
691
|
+
driver: u,
|
|
692
|
+
markSelfInduced: d.mark,
|
|
693
|
+
consume: d.consume
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
//#endregion
|
|
592
697
|
//#region src/screen/createScreenSelector.ts
|
|
593
|
-
function
|
|
698
|
+
function oe(e, t) {
|
|
594
699
|
return e.map((n, r) => ({
|
|
595
700
|
...n,
|
|
596
701
|
isActive: r === t,
|
|
@@ -603,13 +708,13 @@ function w(e, t) {
|
|
|
603
708
|
}
|
|
604
709
|
//#endregion
|
|
605
710
|
//#region src/screen/computeScreenFreeze.ts
|
|
606
|
-
function
|
|
711
|
+
function se(e) {
|
|
607
712
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
608
713
|
return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
|
|
609
714
|
}
|
|
610
715
|
//#endregion
|
|
611
716
|
//#region src/transition/createTransition.ts
|
|
612
|
-
function
|
|
717
|
+
function E({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
613
718
|
return {
|
|
614
719
|
name: e,
|
|
615
720
|
initial: t,
|
|
@@ -630,7 +735,7 @@ function T({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
630
735
|
}
|
|
631
736
|
//#endregion
|
|
632
737
|
//#region src/transition/createRawTransition.ts
|
|
633
|
-
function
|
|
738
|
+
function ce({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
634
739
|
return {
|
|
635
740
|
name: e,
|
|
636
741
|
initial: t,
|
|
@@ -651,10 +756,10 @@ function te({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
651
756
|
}
|
|
652
757
|
//#endregion
|
|
653
758
|
//#region src/transition/cupertino.ts
|
|
654
|
-
var
|
|
759
|
+
var le = (e, t, n) => {
|
|
655
760
|
let [r, i] = t, [a, o] = n;
|
|
656
761
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
657
|
-
},
|
|
762
|
+
}, ue = E({
|
|
658
763
|
name: "cupertino",
|
|
659
764
|
initial: { x: "100%" },
|
|
660
765
|
idle: {
|
|
@@ -714,7 +819,7 @@ var ne = (e, t, n) => {
|
|
|
714
819
|
swipeDirection: "x",
|
|
715
820
|
onSwipeStart: async () => !0,
|
|
716
821
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
717
|
-
let { offset: o } = t, s = o.x, c =
|
|
822
|
+
let { offset: o } = t, s = o.x, c = le(s, [0, window.innerWidth], [0, 100]);
|
|
718
823
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + c * .3}%` }, { duration: 0 }), c;
|
|
719
824
|
},
|
|
720
825
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -738,10 +843,10 @@ var ne = (e, t, n) => {
|
|
|
738
843
|
})]), c;
|
|
739
844
|
}
|
|
740
845
|
}
|
|
741
|
-
}),
|
|
846
|
+
}), de = (e, t, n) => {
|
|
742
847
|
let [r, i] = t, [a, o] = n;
|
|
743
848
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
744
|
-
},
|
|
849
|
+
}, fe = E({
|
|
745
850
|
name: "layout",
|
|
746
851
|
initial: { opacity: .97 },
|
|
747
852
|
idle: {
|
|
@@ -769,7 +874,7 @@ var ne = (e, t, n) => {
|
|
|
769
874
|
swipeDirection: "y",
|
|
770
875
|
onSwipeStart: async () => !0,
|
|
771
876
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
772
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
877
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = de(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);
|
|
773
878
|
return i?.(!0, 100), n(r, {
|
|
774
879
|
y: f,
|
|
775
880
|
opacity: c
|
|
@@ -786,7 +891,7 @@ var ne = (e, t, n) => {
|
|
|
786
891
|
}, { duration: .3 })]), c;
|
|
787
892
|
}
|
|
788
893
|
}
|
|
789
|
-
}),
|
|
894
|
+
}), pe = E({
|
|
790
895
|
name: "material",
|
|
791
896
|
initial: { y: "100%" },
|
|
792
897
|
idle: {
|
|
@@ -894,7 +999,7 @@ var ne = (e, t, n) => {
|
|
|
894
999
|
})]), c;
|
|
895
1000
|
}
|
|
896
1001
|
}
|
|
897
|
-
}),
|
|
1002
|
+
}), me = E({
|
|
898
1003
|
name: "none",
|
|
899
1004
|
initial: {},
|
|
900
1005
|
idle: {
|
|
@@ -918,22 +1023,14 @@ var ne = (e, t, n) => {
|
|
|
918
1023
|
options: { duration: 0 }
|
|
919
1024
|
}
|
|
920
1025
|
}), D = new Map([
|
|
921
|
-
["none",
|
|
922
|
-
["cupertino",
|
|
923
|
-
["material",
|
|
924
|
-
["layout",
|
|
1026
|
+
["none", me],
|
|
1027
|
+
["cupertino", ue],
|
|
1028
|
+
["material", pe],
|
|
1029
|
+
["layout", fe]
|
|
925
1030
|
]);
|
|
926
1031
|
//#endregion
|
|
927
|
-
//#region src/transition/store.ts
|
|
928
|
-
function se(t = "cupertino") {
|
|
929
|
-
return e((e) => ({
|
|
930
|
-
defaultTransitionName: t,
|
|
931
|
-
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
932
|
-
}));
|
|
933
|
-
}
|
|
934
|
-
//#endregion
|
|
935
1032
|
//#region src/transition/decorator/createDecorator.ts
|
|
936
|
-
function
|
|
1033
|
+
function he({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
937
1034
|
return {
|
|
938
1035
|
name: e,
|
|
939
1036
|
initial: t,
|
|
@@ -954,7 +1051,7 @@ function O({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
954
1051
|
}
|
|
955
1052
|
//#endregion
|
|
956
1053
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
957
|
-
function
|
|
1054
|
+
function ge({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
958
1055
|
return {
|
|
959
1056
|
name: e,
|
|
960
1057
|
initial: t,
|
|
@@ -975,30 +1072,30 @@ function ce({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
975
1072
|
}
|
|
976
1073
|
//#endregion
|
|
977
1074
|
//#region src/transition/decorator/overlay.ts
|
|
978
|
-
var
|
|
1075
|
+
var O = "rgba(0, 0, 0, 0.3)", _e = he({
|
|
979
1076
|
name: "overlay",
|
|
980
1077
|
initial: {
|
|
981
1078
|
opacity: 0,
|
|
982
|
-
backgroundColor:
|
|
1079
|
+
backgroundColor: O
|
|
983
1080
|
},
|
|
984
1081
|
idle: {
|
|
985
1082
|
value: {
|
|
986
1083
|
opacity: 0,
|
|
987
|
-
backgroundColor:
|
|
1084
|
+
backgroundColor: O
|
|
988
1085
|
},
|
|
989
1086
|
options: { duration: 0 }
|
|
990
1087
|
},
|
|
991
1088
|
enter: {
|
|
992
1089
|
value: {
|
|
993
1090
|
opacity: 1,
|
|
994
|
-
backgroundColor:
|
|
1091
|
+
backgroundColor: O
|
|
995
1092
|
},
|
|
996
1093
|
options: { duration: .7 }
|
|
997
1094
|
},
|
|
998
1095
|
exit: {
|
|
999
1096
|
value: {
|
|
1000
1097
|
opacity: 0,
|
|
1001
|
-
backgroundColor:
|
|
1098
|
+
backgroundColor: O
|
|
1002
1099
|
},
|
|
1003
1100
|
options: { duration: .6 }
|
|
1004
1101
|
},
|
|
@@ -1007,10 +1104,10 @@ var k = "rgba(0, 0, 0, 0.3)", le = O({
|
|
|
1007
1104
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1008
1105
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1009
1106
|
}
|
|
1010
|
-
}),
|
|
1107
|
+
}), k = new Map([["overlay", _e]]);
|
|
1011
1108
|
//#endregion
|
|
1012
1109
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1013
|
-
function
|
|
1110
|
+
function ve({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1014
1111
|
return {
|
|
1015
1112
|
name: e,
|
|
1016
1113
|
initial: t,
|
|
@@ -1031,7 +1128,7 @@ function ue({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1031
1128
|
}
|
|
1032
1129
|
//#endregion
|
|
1033
1130
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1034
|
-
function
|
|
1131
|
+
function ye({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1035
1132
|
return {
|
|
1036
1133
|
name: e,
|
|
1037
1134
|
initial: t,
|
|
@@ -1052,7 +1149,7 @@ function de({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1052
1149
|
}
|
|
1053
1150
|
//#endregion
|
|
1054
1151
|
//#region src/transition/partTransition/partTransition.ts
|
|
1055
|
-
var
|
|
1152
|
+
var A = /* @__PURE__ */ new Map(), j = {
|
|
1056
1153
|
"IDLE-true": "self",
|
|
1057
1154
|
"IDLE-false": "self",
|
|
1058
1155
|
"PUSHING-true": "initial",
|
|
@@ -1063,7 +1160,7 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1063
1160
|
"POPPING-false": "PUSHING-false",
|
|
1064
1161
|
"COMPLETED-true": "self",
|
|
1065
1162
|
"COMPLETED-false": "self"
|
|
1066
|
-
},
|
|
1163
|
+
}, M = Object.keys(j), N = M, be = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), P = (e) => typeof e == "object" && !!e && !Array.isArray(e), xe = 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(".")), Se = (e, t) => t.startsWith("--") || xe.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, F = (e, t) => typeof t == "number" ? Se(t, e) : typeof t == "string" ? t : "", I = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Ce = new Set([
|
|
1067
1164
|
"x",
|
|
1068
1165
|
"y",
|
|
1069
1166
|
"z",
|
|
@@ -1074,7 +1171,7 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1074
1171
|
"rotateX",
|
|
1075
1172
|
"rotateY",
|
|
1076
1173
|
"rotateZ"
|
|
1077
|
-
]),
|
|
1174
|
+
]), we = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, Te = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Ee = /^1(\.0+)?$/, De = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? Ee.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? Te.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? we.test(t.trim()) : !1, Oe = (e, t) => {
|
|
1078
1175
|
switch (e) {
|
|
1079
1176
|
case "x": return `translateX(${t})`;
|
|
1080
1177
|
case "y": return `translateY(${t})`;
|
|
@@ -1088,23 +1185,23 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1088
1185
|
case "rotateY": return `rotateY(${t})`;
|
|
1089
1186
|
default: return "";
|
|
1090
1187
|
}
|
|
1091
|
-
},
|
|
1188
|
+
}, ke = (e) => {
|
|
1092
1189
|
let t = /* @__PURE__ */ new Set(), n = !1, r = (e) => {
|
|
1093
|
-
if (
|
|
1190
|
+
if (P(e)) for (let r of Object.keys(e)) {
|
|
1094
1191
|
let i = e[r];
|
|
1095
|
-
|
|
1192
|
+
F(r, i) !== "" && (Ce.has(r) ? n = !0 : t.add(I(r)));
|
|
1096
1193
|
}
|
|
1097
1194
|
};
|
|
1098
1195
|
r(e.initial);
|
|
1099
1196
|
for (let t of Object.values(e.variants)) r(t.value);
|
|
1100
1197
|
return n && t.add("transform"), Array.from(t);
|
|
1101
|
-
},
|
|
1102
|
-
if (!
|
|
1198
|
+
}, L = (e) => {
|
|
1199
|
+
if (!P(e)) return [];
|
|
1103
1200
|
let t = [], n = !0, r = [];
|
|
1104
1201
|
for (let i of Object.keys(e)) {
|
|
1105
|
-
let a = e[i], o =
|
|
1106
|
-
o !== "" && (
|
|
1107
|
-
property:
|
|
1202
|
+
let a = e[i], o = F(i, a);
|
|
1203
|
+
o !== "" && (Ce.has(i) ? (t.push(Oe(i, o)), De(i, a) || (n = !1)) : r.push({
|
|
1204
|
+
property: I(i),
|
|
1108
1205
|
value: o
|
|
1109
1206
|
}));
|
|
1110
1207
|
}
|
|
@@ -1112,7 +1209,7 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1112
1209
|
property: "transform",
|
|
1113
1210
|
value: n ? "none" : t.join(" ")
|
|
1114
1211
|
}), r;
|
|
1115
|
-
},
|
|
1212
|
+
}, R = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), z = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1116
1213
|
linear: "linear",
|
|
1117
1214
|
easeIn: "ease-in",
|
|
1118
1215
|
easeOut: "ease-out",
|
|
@@ -1122,33 +1219,33 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1122
1219
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1123
1220
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1124
1221
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1125
|
-
}[e] ?? "ease" : "ease",
|
|
1222
|
+
}[e] ?? "ease" : "ease", Ae = (e) => {
|
|
1126
1223
|
if (!e) return 0;
|
|
1127
1224
|
let t = e.duration;
|
|
1128
1225
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1129
|
-
},
|
|
1226
|
+
}, je = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Me = (e, t) => {
|
|
1130
1227
|
let [n, r] = t.split("-");
|
|
1131
1228
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1132
|
-
},
|
|
1229
|
+
}, Ne = (e, t) => {
|
|
1133
1230
|
let [n, r] = t.split("-");
|
|
1134
1231
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1135
|
-
},
|
|
1232
|
+
}, Pe = (e, t) => {
|
|
1136
1233
|
let [n, r] = t.split("-");
|
|
1137
1234
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1138
|
-
},
|
|
1235
|
+
}, Fe = (e, t) => {
|
|
1139
1236
|
let [n, r] = t.split("-");
|
|
1140
1237
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1141
|
-
},
|
|
1142
|
-
let o =
|
|
1238
|
+
}, B = (e, t, n) => `flemo-${e}-${be(t)}-${n}`, V = (e, t, n, r, i, a) => {
|
|
1239
|
+
let o = L(r), s = L(i.value), c = Ae(i.options), l = je(i.options), u = z(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Pe(t, n)}` : d;
|
|
1143
1240
|
if (s.length === 0 && o.length === 0) return "";
|
|
1144
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1145
|
-
let p =
|
|
1241
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${R(s)}\n animation: none;\n}`;
|
|
1242
|
+
let p = B(e, t, n), m = [
|
|
1146
1243
|
`@keyframes ${p} {`,
|
|
1147
1244
|
" from {",
|
|
1148
|
-
|
|
1245
|
+
R(o).replace(/^/gm, " "),
|
|
1149
1246
|
" }",
|
|
1150
1247
|
" to {",
|
|
1151
|
-
|
|
1248
|
+
R(s).replace(/^/gm, " "),
|
|
1152
1249
|
" }",
|
|
1153
1250
|
"}"
|
|
1154
1251
|
].join("\n"), h = [
|
|
@@ -1159,92 +1256,118 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1159
1256
|
"both"
|
|
1160
1257
|
].filter(Boolean).join(" "), g = Array.from(new Set([...o.map((e) => e.property), ...s.map((e) => e.property)])), _ = g.length > 0 ? ` will-change: ${g.join(", ")};\n` : "", v = n.split("-")[0];
|
|
1161
1258
|
return `${m}\n${`${f} {\n animation: ${h};\n${_}${v === "PUSHING" || v === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}`;
|
|
1162
|
-
},
|
|
1163
|
-
let i =
|
|
1164
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1165
|
-
},
|
|
1259
|
+
}, H = (e, t, n, r) => {
|
|
1260
|
+
let i = L(r.value);
|
|
1261
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${R(i)}\n}`;
|
|
1262
|
+
}, Ie = (e, t, n = []) => {
|
|
1166
1263
|
let r = [];
|
|
1167
1264
|
for (let t of e) {
|
|
1168
1265
|
let e = t.name;
|
|
1169
|
-
for (let n of
|
|
1170
|
-
let i = t.variants[n], a =
|
|
1266
|
+
for (let n of M) {
|
|
1267
|
+
let i = t.variants[n], a = j[n];
|
|
1171
1268
|
if (a === "self") {
|
|
1172
|
-
r.push(
|
|
1269
|
+
r.push(H(Me, e, n, i));
|
|
1173
1270
|
continue;
|
|
1174
1271
|
}
|
|
1175
1272
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1176
|
-
r.push(
|
|
1273
|
+
r.push(V("screen", e, n, o, i, Me));
|
|
1177
1274
|
}
|
|
1178
1275
|
}
|
|
1179
1276
|
for (let e of t) {
|
|
1180
1277
|
let t = e.name;
|
|
1181
|
-
for (let n of
|
|
1182
|
-
let i = e.variants[n], a =
|
|
1278
|
+
for (let n of N) {
|
|
1279
|
+
let i = e.variants[n], a = j[n];
|
|
1183
1280
|
if (a === "self") {
|
|
1184
|
-
r.push(
|
|
1281
|
+
r.push(H(Ne, t, n, i));
|
|
1185
1282
|
continue;
|
|
1186
1283
|
}
|
|
1187
1284
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1188
|
-
r.push(
|
|
1285
|
+
r.push(V("decorator", t, n, o, i, Ne));
|
|
1189
1286
|
}
|
|
1190
1287
|
}
|
|
1191
1288
|
for (let e of n) {
|
|
1192
1289
|
let t = e.name;
|
|
1193
|
-
for (let n of
|
|
1194
|
-
let i = e.variants[n], a =
|
|
1290
|
+
for (let n of N) {
|
|
1291
|
+
let i = e.variants[n], a = j[n];
|
|
1195
1292
|
if (a === "self") {
|
|
1196
|
-
r.push(
|
|
1293
|
+
r.push(H(Fe, t, n, i));
|
|
1197
1294
|
continue;
|
|
1198
1295
|
}
|
|
1199
1296
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1200
|
-
r.push(
|
|
1297
|
+
r.push(V("part", t, n, o, i, Fe));
|
|
1201
1298
|
}
|
|
1202
1299
|
}
|
|
1203
|
-
return r.filter((e) => e.length > 0).join("\n\n");
|
|
1204
|
-
},
|
|
1205
|
-
|
|
1300
|
+
return [...r.filter((e) => e.length > 0), Le].join("\n\n");
|
|
1301
|
+
}, Le = [
|
|
1302
|
+
"[data-flemo-anim-hold=\"true\"],",
|
|
1303
|
+
"[data-flemo-anim-hold=\"true\"] [data-flemo-part-name] {",
|
|
1304
|
+
" animation-play-state: paused !important;",
|
|
1305
|
+
"}"
|
|
1306
|
+
].join("\n"), Re = (e, t) => {
|
|
1307
|
+
let n = j[t];
|
|
1206
1308
|
if (n === "self") return !1;
|
|
1207
|
-
let r = e.variants[t], i =
|
|
1309
|
+
let r = e.variants[t], i = Ae(r.options), a = je(r.options);
|
|
1208
1310
|
if (i <= 0 && a <= 0) return !1;
|
|
1209
|
-
let o =
|
|
1311
|
+
let o = L(n === "initial" ? e.initial : e.variants[n].value), s = L(r.value);
|
|
1210
1312
|
return o.length > 0 || s.length > 0;
|
|
1211
|
-
},
|
|
1212
|
-
function
|
|
1213
|
-
if (
|
|
1214
|
-
let e =
|
|
1215
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1313
|
+
}, ze = "data-flemo";
|
|
1314
|
+
function U() {
|
|
1315
|
+
if (u()) return;
|
|
1316
|
+
let e = Ie(D.values(), k.values(), A.values()), t = document.head.querySelector(`style[${ze}]`);
|
|
1317
|
+
t || (t = document.createElement("style"), t.setAttribute(ze, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1318
|
+
}
|
|
1319
|
+
//#endregion
|
|
1320
|
+
//#region src/transition/registerTransitionDefinitions.ts
|
|
1321
|
+
function Be(e, t, n = []) {
|
|
1322
|
+
for (let t of e) D.set(t.name, t);
|
|
1323
|
+
for (let e of t) k.set(e.name, e);
|
|
1324
|
+
for (let e of n) A.set(e.name, e);
|
|
1325
|
+
return U(), () => {
|
|
1326
|
+
for (let t of e) D.delete(t.name);
|
|
1327
|
+
for (let e of t) k.delete(e.name);
|
|
1328
|
+
for (let e of n) A.delete(e.name);
|
|
1329
|
+
U();
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
//#endregion
|
|
1333
|
+
//#region src/transition/enteringInitialStyle.ts
|
|
1334
|
+
function Ve(e) {
|
|
1335
|
+
let { initial: t, isActive: n, status: r } = e;
|
|
1336
|
+
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1337
|
+
let i = {};
|
|
1338
|
+
return typeof t.x == "number" && (i.transform = `translateX(${t.x}px)`), typeof t.x == "string" && (i.transform = `translateX(${t.x})`), typeof t.y == "number" && (i.transform = `translateY(${t.y}px)`), typeof t.y == "string" && (i.transform = `translateY(${t.y})`), typeof t.opacity == "number" && (i.opacity = `${t.opacity}`), i;
|
|
1216
1339
|
}
|
|
1217
1340
|
//#endregion
|
|
1218
1341
|
//#region src/transition/animateInline.ts
|
|
1219
|
-
var
|
|
1220
|
-
let n =
|
|
1221
|
-
n || (n = /* @__PURE__ */ new Set(),
|
|
1222
|
-
},
|
|
1342
|
+
var He = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, W = /* @__PURE__ */ new WeakMap(), Ue = (e, t) => {
|
|
1343
|
+
let n = W.get(e);
|
|
1344
|
+
n || (n = /* @__PURE__ */ new Set(), W.set(e, n)), n.add(t);
|
|
1345
|
+
}, G = (e, t) => {
|
|
1223
1346
|
if (e.style.transition = "", t) {
|
|
1224
|
-
let n =
|
|
1347
|
+
let n = W.get(e);
|
|
1225
1348
|
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1226
1349
|
return;
|
|
1227
1350
|
}
|
|
1228
|
-
let n =
|
|
1351
|
+
let n = W.get(e);
|
|
1229
1352
|
if (n && n.size > 0) {
|
|
1230
1353
|
for (let t of n) e.style.removeProperty(t);
|
|
1231
1354
|
n.clear();
|
|
1232
1355
|
return;
|
|
1233
1356
|
}
|
|
1234
1357
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1235
|
-
},
|
|
1236
|
-
if (!
|
|
1237
|
-
let r = e, i =
|
|
1358
|
+
}, K = (e, t, n = {}) => {
|
|
1359
|
+
if (!He(e)) return Promise.resolve();
|
|
1360
|
+
let r = e, i = L(t);
|
|
1238
1361
|
if (i.length === 0) return Promise.resolve();
|
|
1239
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1362
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = z(n.ease);
|
|
1240
1363
|
if (a <= 0 && o <= 0) {
|
|
1241
1364
|
r.style.transition = "none";
|
|
1242
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1365
|
+
for (let e of i) r.style.setProperty(e.property, e.value), Ue(r, e.property);
|
|
1243
1366
|
return Promise.resolve();
|
|
1244
1367
|
}
|
|
1245
1368
|
let c = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1246
1369
|
r.style.transition = c, r.offsetWidth;
|
|
1247
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1370
|
+
for (let e of i) r.style.setProperty(e.property, e.value), Ue(r, e.property);
|
|
1248
1371
|
return new Promise((e) => {
|
|
1249
1372
|
let t = !1, n = () => {
|
|
1250
1373
|
t || (t = !0, r.removeEventListener("transitionend", i), e());
|
|
@@ -1253,27 +1376,27 @@ var je = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, G = /* @__
|
|
|
1253
1376
|
};
|
|
1254
1377
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1255
1378
|
});
|
|
1256
|
-
},
|
|
1257
|
-
function
|
|
1379
|
+
}, q = "data-flemo-skip-animation", J = () => {};
|
|
1380
|
+
function We(e) {
|
|
1258
1381
|
return { driveScreenLifecycle: (t) => {
|
|
1259
|
-
let { getElements: n, transitionName:
|
|
1260
|
-
if (!s) return o === "REPLACING" &&
|
|
1382
|
+
let { getElements: n, transitionName: r, prevTransitionName: i, status: o, isActive: s } = t;
|
|
1383
|
+
if (!s) return o === "REPLACING" && i !== r && e.setReplaceTransitionStatus("PENDING"), J;
|
|
1261
1384
|
if (o === "COMPLETED") {
|
|
1262
1385
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
1263
1386
|
let { scope: t, decorator: r, bars: i } = n();
|
|
1264
|
-
t && (
|
|
1265
|
-
for (let e of i ?? []) e && (
|
|
1266
|
-
return
|
|
1387
|
+
t && (G(t), t.removeAttribute(q)), r && (G(r), r.removeAttribute(q));
|
|
1388
|
+
for (let e of i ?? []) e && (G(e), e.style.removeProperty("will-change"));
|
|
1389
|
+
return J;
|
|
1267
1390
|
}
|
|
1268
|
-
if (o === "IDLE") return
|
|
1391
|
+
if (o === "IDLE") return J;
|
|
1269
1392
|
let { scope: c } = n();
|
|
1270
|
-
if (!c) return
|
|
1393
|
+
if (!c) return J;
|
|
1271
1394
|
let l = () => {
|
|
1272
1395
|
let t = e.getTransitionTaskId();
|
|
1273
|
-
t &&
|
|
1274
|
-
}, u = D.get(
|
|
1275
|
-
if (!(c.getAttribute("data-flemo-skip-animation") !== "true" &&
|
|
1276
|
-
let f =
|
|
1396
|
+
t && a.resolveTask(t);
|
|
1397
|
+
}, u = D.get(r) ?? D.get("none"), d = `${o}-true`;
|
|
1398
|
+
if (!(c.getAttribute("data-flemo-skip-animation") !== "true" && Re(u, d))) return queueMicrotask(l), J;
|
|
1399
|
+
let f = B("screen", r, d), p = (e) => {
|
|
1277
1400
|
e.target === c && e.animationName === f && (c.removeEventListener("animationend", p), l());
|
|
1278
1401
|
};
|
|
1279
1402
|
return c.addEventListener("animationend", p), () => {
|
|
@@ -1283,20 +1406,20 @@ function Ne(e) {
|
|
|
1283
1406
|
}
|
|
1284
1407
|
//#endregion
|
|
1285
1408
|
//#region src/utils/findScrollable.ts
|
|
1286
|
-
function
|
|
1287
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
1409
|
+
function Y(e, t) {
|
|
1410
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Ge(e);
|
|
1288
1411
|
if (!o) return {
|
|
1289
1412
|
element: null,
|
|
1290
1413
|
hasMarker: !1
|
|
1291
1414
|
};
|
|
1292
1415
|
let s = o.closest?.(r);
|
|
1293
|
-
if (s instanceof HTMLElement &&
|
|
1416
|
+
if (s instanceof HTMLElement && X(s, n) && (!a || Z(s, n))) return {
|
|
1294
1417
|
element: s,
|
|
1295
1418
|
hasMarker: !0
|
|
1296
1419
|
};
|
|
1297
1420
|
let c = o, l = 0;
|
|
1298
1421
|
for (; c && l < i;) {
|
|
1299
|
-
if (
|
|
1422
|
+
if (X(c, n) && (!a || Z(c, n))) return {
|
|
1300
1423
|
element: c,
|
|
1301
1424
|
hasMarker: !1
|
|
1302
1425
|
};
|
|
@@ -1307,7 +1430,7 @@ function X(e, t) {
|
|
|
1307
1430
|
hasMarker: !1
|
|
1308
1431
|
};
|
|
1309
1432
|
}
|
|
1310
|
-
function
|
|
1433
|
+
function Ge(e) {
|
|
1311
1434
|
if (!e) return null;
|
|
1312
1435
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
1313
1436
|
if (n && n.length) {
|
|
@@ -1315,18 +1438,18 @@ function Pe(e) {
|
|
|
1315
1438
|
}
|
|
1316
1439
|
return e instanceof HTMLElement ? e : null;
|
|
1317
1440
|
}
|
|
1318
|
-
function
|
|
1441
|
+
function X(e, t) {
|
|
1319
1442
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
1320
1443
|
}
|
|
1321
|
-
function
|
|
1322
|
-
if (!
|
|
1444
|
+
function Z(e, t) {
|
|
1445
|
+
if (!X(e, t) || typeof window > "u") return !1;
|
|
1323
1446
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
1324
1447
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
1325
1448
|
}
|
|
1326
1449
|
//#endregion
|
|
1327
1450
|
//#region src/core/engine/createSwipeController.ts
|
|
1328
|
-
var
|
|
1329
|
-
function
|
|
1451
|
+
var Q = "data-flemo-skip-animation";
|
|
1452
|
+
function Ke(e) {
|
|
1330
1453
|
let t = null, n = null, r = {
|
|
1331
1454
|
current: [],
|
|
1332
1455
|
prev: []
|
|
@@ -1372,9 +1495,9 @@ function Ie(e) {
|
|
|
1372
1495
|
y: e.clientY
|
|
1373
1496
|
}, u = t;
|
|
1374
1497
|
}, v = (n, i, a) => {
|
|
1375
|
-
let o =
|
|
1376
|
-
if (n === e.getElements().scope) for (let e of r.current)
|
|
1377
|
-
else if (n === t) for (let e of r.prev)
|
|
1498
|
+
let o = K(n, i, a);
|
|
1499
|
+
if (n === e.getElements().scope) for (let e of r.current) K(e, i, a);
|
|
1500
|
+
else if (n === t) for (let e of r.prev) K(e, i, a);
|
|
1378
1501
|
return o;
|
|
1379
1502
|
}, y = (t) => {
|
|
1380
1503
|
let n = e.getPartnerBars(), i = [], { sharedTopBar: a, sharedBottomBar: o } = e.getElements();
|
|
@@ -1388,12 +1511,12 @@ function Ie(e) {
|
|
|
1388
1511
|
current: i,
|
|
1389
1512
|
prev: s
|
|
1390
1513
|
};
|
|
1391
|
-
let c =
|
|
1514
|
+
let c = ke(e.getTransition()).join(", ");
|
|
1392
1515
|
for (let e of i) e.style.willChange = c;
|
|
1393
1516
|
for (let e of s) e.style.willChange = c;
|
|
1394
1517
|
}, b = () => {
|
|
1395
|
-
for (let e of r.current)
|
|
1396
|
-
for (let e of r.prev)
|
|
1518
|
+
for (let e of r.current) G(e), e.style.removeProperty("will-change");
|
|
1519
|
+
for (let e of r.prev) G(e), e.style.removeProperty("will-change");
|
|
1397
1520
|
r = {
|
|
1398
1521
|
current: [],
|
|
1399
1522
|
prev: []
|
|
@@ -1406,10 +1529,10 @@ function Ie(e) {
|
|
|
1406
1529
|
};
|
|
1407
1530
|
}, S = (e, t, n) => {
|
|
1408
1531
|
let r = (r, i) => {
|
|
1409
|
-
let a =
|
|
1532
|
+
let a = A.get(r.getAttribute("data-flemo-part-name"));
|
|
1410
1533
|
if (!a) return;
|
|
1411
1534
|
let o = {
|
|
1412
|
-
animate:
|
|
1535
|
+
animate: K,
|
|
1413
1536
|
element: r,
|
|
1414
1537
|
active: i
|
|
1415
1538
|
};
|
|
@@ -1418,7 +1541,7 @@ function Ie(e) {
|
|
|
1418
1541
|
for (let e of i.current) r(e, !0);
|
|
1419
1542
|
for (let e of i.prev) r(e, !1);
|
|
1420
1543
|
}, C = () => {
|
|
1421
|
-
for (let e of [...i.current, ...i.prev])
|
|
1544
|
+
for (let e of [...i.current, ...i.prev]) G(e);
|
|
1422
1545
|
i = {
|
|
1423
1546
|
current: [],
|
|
1424
1547
|
prev: []
|
|
@@ -1447,7 +1570,7 @@ function Ie(e) {
|
|
|
1447
1570
|
prevScreen: t,
|
|
1448
1571
|
onStart: (e) => {
|
|
1449
1572
|
m?.onSwipeStart?.(e, {
|
|
1450
|
-
animate:
|
|
1573
|
+
animate: K,
|
|
1451
1574
|
currentDecorator: f,
|
|
1452
1575
|
prevDecorator: n
|
|
1453
1576
|
}), S("start", e, 0);
|
|
@@ -1464,13 +1587,13 @@ function Ie(e) {
|
|
|
1464
1587
|
prevScreen: t,
|
|
1465
1588
|
onProgress: (e, t) => {
|
|
1466
1589
|
c?.onSwipe?.(e, t, {
|
|
1467
|
-
animate:
|
|
1590
|
+
animate: K,
|
|
1468
1591
|
currentDecorator: o,
|
|
1469
1592
|
prevDecorator: n
|
|
1470
1593
|
}), S("swipe", e, t);
|
|
1471
1594
|
}
|
|
1472
1595
|
});
|
|
1473
|
-
},
|
|
1596
|
+
}, te = async (a) => {
|
|
1474
1597
|
let o = e.getTransition();
|
|
1475
1598
|
if (!o.swipeDirection || !s) return;
|
|
1476
1599
|
s = !1;
|
|
@@ -1483,32 +1606,32 @@ function Ie(e) {
|
|
|
1483
1606
|
prevScreen: t,
|
|
1484
1607
|
onStart: (e) => {
|
|
1485
1608
|
u?.onSwipeEnd?.(e, {
|
|
1486
|
-
animate:
|
|
1609
|
+
animate: K,
|
|
1487
1610
|
currentDecorator: l,
|
|
1488
1611
|
prevDecorator: n
|
|
1489
1612
|
}), S("end", e, 0);
|
|
1490
1613
|
}
|
|
1491
1614
|
})) {
|
|
1492
|
-
c?.setAttribute(
|
|
1615
|
+
c?.setAttribute(Q, "true"), l?.setAttribute(Q, "true");
|
|
1493
1616
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
1494
|
-
for (let e of r.prev)
|
|
1617
|
+
for (let e of r.prev) G(e), e.style.removeProperty("will-change");
|
|
1495
1618
|
r = {
|
|
1496
1619
|
current: [],
|
|
1497
1620
|
prev: []
|
|
1498
1621
|
};
|
|
1499
|
-
for (let e of i.prev)
|
|
1622
|
+
for (let e of i.prev) G(e);
|
|
1500
1623
|
i = {
|
|
1501
1624
|
current: [],
|
|
1502
1625
|
prev: []
|
|
1503
1626
|
}, e.back();
|
|
1504
|
-
} else c &&
|
|
1627
|
+
} else c && G(c), t && G(t), l && G(l), n && G(n), b(), C(), e.setDragStatus("IDLE");
|
|
1505
1628
|
};
|
|
1506
1629
|
return {
|
|
1507
1630
|
pointerDown: (t) => {
|
|
1508
|
-
e.isReadyForDrag() && (f =
|
|
1631
|
+
e.isReadyForDrag() && (f = Y(t.target, {
|
|
1509
1632
|
direction: "x",
|
|
1510
1633
|
verifyByScroll: !0
|
|
1511
|
-
}), p =
|
|
1634
|
+
}), p = Y(t.target, {
|
|
1512
1635
|
direction: "y",
|
|
1513
1636
|
verifyByScroll: !0
|
|
1514
1637
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -1530,31 +1653,76 @@ function Ie(e) {
|
|
|
1530
1653
|
}
|
|
1531
1654
|
},
|
|
1532
1655
|
pointerUp: (e) => {
|
|
1533
|
-
a = !1, o = !1, s &&
|
|
1656
|
+
a = !1, o = !1, s && te(e);
|
|
1534
1657
|
},
|
|
1535
1658
|
shouldPreventTouch: () => o
|
|
1536
1659
|
};
|
|
1537
1660
|
}
|
|
1538
1661
|
//#endregion
|
|
1539
|
-
//#region src/
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
t?.removeAttribute($), n?.removeAttribute($);
|
|
1548
|
-
return;
|
|
1549
|
-
}
|
|
1550
|
-
let i = e.getHistories(), a = e.isActive ? i[e.index - 1]?.id : i[e.index]?.id, o = a ? e.getSharedBars()[a] : void 0, s = e.hasTopBar && !o?.topBar, c = e.hasNavBar && !o?.bottomBar;
|
|
1551
|
-
t && t.setAttribute($, s ? "true" : "false"), n && n.setAttribute($, c ? "true" : "false");
|
|
1662
|
+
//#region src/screen/computeBarRiding.ts
|
|
1663
|
+
function qe(e) {
|
|
1664
|
+
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
1665
|
+
app: !1,
|
|
1666
|
+
nav: !1
|
|
1667
|
+
} : {
|
|
1668
|
+
app: e.hasTopBar && !e.partnerBars?.topBar,
|
|
1669
|
+
nav: e.hasNavBar && !e.partnerBars?.bottomBar
|
|
1552
1670
|
};
|
|
1553
|
-
|
|
1554
|
-
|
|
1671
|
+
}
|
|
1672
|
+
//#endregion
|
|
1673
|
+
//#region src/screen/animStartAnchor.ts
|
|
1674
|
+
function Je(e) {
|
|
1675
|
+
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
1676
|
+
}
|
|
1677
|
+
var Ye = 300;
|
|
1678
|
+
function Xe(e) {
|
|
1679
|
+
let t = 0, n = requestAnimationFrame(() => {
|
|
1680
|
+
t = requestAnimationFrame(e);
|
|
1681
|
+
}), r = setTimeout(e, 300);
|
|
1555
1682
|
return () => {
|
|
1556
|
-
|
|
1683
|
+
cancelAnimationFrame(n), t && cancelAnimationFrame(t), clearTimeout(r);
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
//#endregion
|
|
1687
|
+
//#region src/screen/observeBarHeight.ts
|
|
1688
|
+
function Ze(e, t) {
|
|
1689
|
+
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
1690
|
+
let n = new ResizeObserver(([e]) => {
|
|
1691
|
+
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
1692
|
+
});
|
|
1693
|
+
return n.observe(e), () => {
|
|
1694
|
+
n.disconnect();
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
//#endregion
|
|
1698
|
+
//#region src/screen/observeViewportScrollHeight.ts
|
|
1699
|
+
var $ = 0;
|
|
1700
|
+
function Qe(e) {
|
|
1701
|
+
let t = 0, n = () => {
|
|
1702
|
+
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
1703
|
+
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
1704
|
+
t = t < 0 ? 0 : t;
|
|
1705
|
+
let n = t - $;
|
|
1706
|
+
n = n < 0 ? 0 : n, $ ||= t, e(t, n);
|
|
1707
|
+
});
|
|
1708
|
+
};
|
|
1709
|
+
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
1710
|
+
cancelAnimationFrame(t), window.visualViewport?.removeEventListener("resize", n), window.visualViewport?.removeEventListener("scroll", n);
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
//#endregion
|
|
1714
|
+
//#region src/utils/matchesPathname.ts
|
|
1715
|
+
function $e(e, t) {
|
|
1716
|
+
return i(e).regexp.test(t);
|
|
1717
|
+
}
|
|
1718
|
+
//#endregion
|
|
1719
|
+
//#region src/utils/buildRoutePath.ts
|
|
1720
|
+
function et(e, n) {
|
|
1721
|
+
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();
|
|
1722
|
+
return {
|
|
1723
|
+
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
1724
|
+
toPathname: a
|
|
1557
1725
|
};
|
|
1558
1726
|
}
|
|
1559
1727
|
//#endregion
|
|
1560
|
-
export {
|
|
1728
|
+
export { Ye as ANIM_HOLD_RELEASE_BACKSTOP_MS, q as SKIP_ANIMATION_ATTR, a as TaskManger, Je as animHoldKey, K as animateInline, B as animationName, te as appendParamsQuery, U as applyTransitionStyles, et as buildRoutePath, Z as canProgrammaticallyScroll, G as clearInlineAnimation, ke as collectAnimatedProperties, Ie as compileTransitionStyles, qe as computeBarRiding, se as computeScreenFreeze, _ as consumeSelfInducedPop, p as createBrowserHistoryDriver, he as createDecorator, o as createHistoryStore, v as createHistorySync, y as createMemoryHistoryDriver, b as createNavigateStore, w as createNavigationController, ve as createPartTransition, ge as createRawDecorator, ye as createRawPartTransition, ce as createRawTransition, ae as createRouterScope, oe as createScreenSelector, T as createScreenStore, m as createSelfPopGuard, ne as createStepController, Ke as createSwipeController, E as createTransition, We as createTransitionEngine, re as createTransitionStore, ue as cupertino, k as decoratorMap, z as easingToCss, d as ensureWindowHistoryState, Ve as enteringInitialStyle, Y as findScrollable, s as getMatchedPathPattern, c as getParams, u as isServer, fe as layout, g as markSelfInducedPop, $e as matchesPathname, pe as material, me as none, Ze as observeBarHeight, Qe as observeViewportScrollHeight, X as overflowsAxis, _e as overlay, A as partTransitionMap, ee as readStepParams, Be as registerTransitionDefinitions, Xe as scheduleAnimHoldRelease, l as seedInitialHistory, L as targetToDecls, D as transitionMap, Re as variantHasAnimation };
|