@flemo/core 1.7.0 → 1.9.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/__tests__/createRouterScope.test.d.ts +1 -0
- package/dist/core/__tests__/taskManagerBranches.test.d.ts +1 -0
- package/dist/core/createRouterScope.d.ts +26 -0
- package/dist/core/engine/__tests__/createSwipeController.gestures.test.d.ts +1 -0
- package/dist/core/engine/__tests__/createTransitionEngine.branches.test.d.ts +1 -0
- package/dist/history/__tests__/historyDriverBranches.test.d.ts +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.mjs +389 -217
- package/dist/navigate/__tests__/createStepController.test.d.ts +1 -0
- package/dist/navigate/createStepController.d.ts +21 -0
- package/dist/screen/__tests__/observeBarHeight.test.d.ts +1 -0
- package/dist/screen/__tests__/observeViewportScrollHeight.test.d.ts +1 -0
- package/dist/screen/observeBarHeight.d.ts +1 -0
- package/dist/screen/observeViewportScrollHeight.d.ts +1 -0
- package/dist/transition/__tests__/coverageBranches.test.d.ts +6 -0
- package/dist/transition/__tests__/enteringInitialStyle.test.d.ts +1 -0
- package/dist/transition/__tests__/presetSwipeCallbacks.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/transition/resolveTransition.d.ts +2 -0
- package/dist/utils/__tests__/buildRoutePath.test.d.ts +1 -0
- package/dist/utils/__tests__/findScrollableEvent.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/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,98 @@ 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
|
+
function re(e, t) {
|
|
637
|
+
return e.subscribe((e) => {
|
|
638
|
+
let n = e.state;
|
|
639
|
+
n?.step && a.addTask(async () => {
|
|
640
|
+
t(n.params ?? {});
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region src/transition/store.ts
|
|
646
|
+
function ie(t = "cupertino") {
|
|
647
|
+
return e((e) => ({
|
|
648
|
+
defaultTransitionName: t,
|
|
649
|
+
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
650
|
+
}));
|
|
651
|
+
}
|
|
652
|
+
//#endregion
|
|
573
653
|
//#region src/screen/store.ts
|
|
574
|
-
function
|
|
654
|
+
function ae() {
|
|
575
655
|
return e((e) => ({
|
|
576
656
|
dragStatus: "IDLE",
|
|
577
657
|
replaceTransitionStatus: "IDLE",
|
|
@@ -589,8 +669,41 @@ function C() {
|
|
|
589
669
|
}));
|
|
590
670
|
}
|
|
591
671
|
//#endregion
|
|
672
|
+
//#region src/core/createRouterScope.ts
|
|
673
|
+
var oe = {
|
|
674
|
+
mark: () => {},
|
|
675
|
+
consume: () => !1
|
|
676
|
+
};
|
|
677
|
+
function se(e) {
|
|
678
|
+
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: s } = e, c = l(t, n, r, i);
|
|
679
|
+
if (e.hostedScope) return e.hostedScope.history.getState().index === -1 && e.hostedScope.history.setState({
|
|
680
|
+
index: 0,
|
|
681
|
+
histories: [c]
|
|
682
|
+
}), e.hostedScope;
|
|
683
|
+
let u = a ? y({
|
|
684
|
+
state: {
|
|
685
|
+
id: c.id,
|
|
686
|
+
index: 0,
|
|
687
|
+
status: "IDLE",
|
|
688
|
+
params: c.params,
|
|
689
|
+
transitionName: c.transitionName,
|
|
690
|
+
layoutId: c.layoutId
|
|
691
|
+
},
|
|
692
|
+
url: c.pathname
|
|
693
|
+
}) : s, d = a ? oe : m();
|
|
694
|
+
return {
|
|
695
|
+
history: o([c], 0),
|
|
696
|
+
navigate: b(),
|
|
697
|
+
transition: ie(i),
|
|
698
|
+
screen: ae(),
|
|
699
|
+
driver: u,
|
|
700
|
+
markSelfInduced: d.mark,
|
|
701
|
+
consume: d.consume
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
//#endregion
|
|
592
705
|
//#region src/screen/createScreenSelector.ts
|
|
593
|
-
function
|
|
706
|
+
function ce(e, t) {
|
|
594
707
|
return e.map((n, r) => ({
|
|
595
708
|
...n,
|
|
596
709
|
isActive: r === t,
|
|
@@ -603,7 +716,7 @@ function w(e, t) {
|
|
|
603
716
|
}
|
|
604
717
|
//#endregion
|
|
605
718
|
//#region src/screen/computeScreenFreeze.ts
|
|
606
|
-
function
|
|
719
|
+
function le(e) {
|
|
607
720
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
608
721
|
return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
|
|
609
722
|
}
|
|
@@ -630,7 +743,7 @@ function T({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
630
743
|
}
|
|
631
744
|
//#endregion
|
|
632
745
|
//#region src/transition/createRawTransition.ts
|
|
633
|
-
function
|
|
746
|
+
function ue({ 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
747
|
return {
|
|
635
748
|
name: e,
|
|
636
749
|
initial: t,
|
|
@@ -651,10 +764,10 @@ function te({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
651
764
|
}
|
|
652
765
|
//#endregion
|
|
653
766
|
//#region src/transition/cupertino.ts
|
|
654
|
-
var
|
|
767
|
+
var de = (e, t, n) => {
|
|
655
768
|
let [r, i] = t, [a, o] = n;
|
|
656
769
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
657
|
-
},
|
|
770
|
+
}, fe = T({
|
|
658
771
|
name: "cupertino",
|
|
659
772
|
initial: { x: "100%" },
|
|
660
773
|
idle: {
|
|
@@ -714,7 +827,7 @@ var ne = (e, t, n) => {
|
|
|
714
827
|
swipeDirection: "x",
|
|
715
828
|
onSwipeStart: async () => !0,
|
|
716
829
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
717
|
-
let { offset: o } = t, s = o.x, c =
|
|
830
|
+
let { offset: o } = t, s = o.x, c = de(s, [0, window.innerWidth], [0, 100]);
|
|
718
831
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + c * .3}%` }, { duration: 0 }), c;
|
|
719
832
|
},
|
|
720
833
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -738,10 +851,10 @@ var ne = (e, t, n) => {
|
|
|
738
851
|
})]), c;
|
|
739
852
|
}
|
|
740
853
|
}
|
|
741
|
-
}),
|
|
854
|
+
}), pe = (e, t, n) => {
|
|
742
855
|
let [r, i] = t, [a, o] = n;
|
|
743
856
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
744
|
-
},
|
|
857
|
+
}, me = T({
|
|
745
858
|
name: "layout",
|
|
746
859
|
initial: { opacity: .97 },
|
|
747
860
|
idle: {
|
|
@@ -769,7 +882,7 @@ var ne = (e, t, n) => {
|
|
|
769
882
|
swipeDirection: "y",
|
|
770
883
|
onSwipeStart: async () => !0,
|
|
771
884
|
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 =
|
|
885
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = pe(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
886
|
return i?.(!0, 100), n(r, {
|
|
774
887
|
y: f,
|
|
775
888
|
opacity: c
|
|
@@ -786,7 +899,7 @@ var ne = (e, t, n) => {
|
|
|
786
899
|
}, { duration: .3 })]), c;
|
|
787
900
|
}
|
|
788
901
|
}
|
|
789
|
-
}),
|
|
902
|
+
}), he = T({
|
|
790
903
|
name: "material",
|
|
791
904
|
initial: { y: "100%" },
|
|
792
905
|
idle: {
|
|
@@ -894,7 +1007,7 @@ var ne = (e, t, n) => {
|
|
|
894
1007
|
})]), c;
|
|
895
1008
|
}
|
|
896
1009
|
}
|
|
897
|
-
}),
|
|
1010
|
+
}), E = T({
|
|
898
1011
|
name: "none",
|
|
899
1012
|
initial: {},
|
|
900
1013
|
idle: {
|
|
@@ -917,23 +1030,20 @@ var ne = (e, t, n) => {
|
|
|
917
1030
|
value: {},
|
|
918
1031
|
options: { duration: 0 }
|
|
919
1032
|
}
|
|
920
|
-
}),
|
|
921
|
-
["none",
|
|
922
|
-
["cupertino",
|
|
923
|
-
["material",
|
|
924
|
-
["layout",
|
|
1033
|
+
}), D = new Map([
|
|
1034
|
+
["none", E],
|
|
1035
|
+
["cupertino", fe],
|
|
1036
|
+
["material", he],
|
|
1037
|
+
["layout", me]
|
|
925
1038
|
]);
|
|
926
1039
|
//#endregion
|
|
927
|
-
//#region src/transition/
|
|
928
|
-
function
|
|
929
|
-
return
|
|
930
|
-
defaultTransitionName: t,
|
|
931
|
-
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
932
|
-
}));
|
|
1040
|
+
//#region src/transition/resolveTransition.ts
|
|
1041
|
+
function ge(e) {
|
|
1042
|
+
return D.get(e) ?? D.get("none");
|
|
933
1043
|
}
|
|
934
1044
|
//#endregion
|
|
935
1045
|
//#region src/transition/decorator/createDecorator.ts
|
|
936
|
-
function
|
|
1046
|
+
function _e({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
937
1047
|
return {
|
|
938
1048
|
name: e,
|
|
939
1049
|
initial: t,
|
|
@@ -954,7 +1064,7 @@ function oe({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
954
1064
|
}
|
|
955
1065
|
//#endregion
|
|
956
1066
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
957
|
-
function
|
|
1067
|
+
function ve({ 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
1068
|
return {
|
|
959
1069
|
name: e,
|
|
960
1070
|
initial: t,
|
|
@@ -975,30 +1085,30 @@ function se({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
975
1085
|
}
|
|
976
1086
|
//#endregion
|
|
977
1087
|
//#region src/transition/decorator/overlay.ts
|
|
978
|
-
var
|
|
1088
|
+
var O = "rgba(0, 0, 0, 0.3)", ye = _e({
|
|
979
1089
|
name: "overlay",
|
|
980
1090
|
initial: {
|
|
981
1091
|
opacity: 0,
|
|
982
|
-
backgroundColor:
|
|
1092
|
+
backgroundColor: O
|
|
983
1093
|
},
|
|
984
1094
|
idle: {
|
|
985
1095
|
value: {
|
|
986
1096
|
opacity: 0,
|
|
987
|
-
backgroundColor:
|
|
1097
|
+
backgroundColor: O
|
|
988
1098
|
},
|
|
989
1099
|
options: { duration: 0 }
|
|
990
1100
|
},
|
|
991
1101
|
enter: {
|
|
992
1102
|
value: {
|
|
993
1103
|
opacity: 1,
|
|
994
|
-
backgroundColor:
|
|
1104
|
+
backgroundColor: O
|
|
995
1105
|
},
|
|
996
1106
|
options: { duration: .7 }
|
|
997
1107
|
},
|
|
998
1108
|
exit: {
|
|
999
1109
|
value: {
|
|
1000
1110
|
opacity: 0,
|
|
1001
|
-
backgroundColor:
|
|
1111
|
+
backgroundColor: O
|
|
1002
1112
|
},
|
|
1003
1113
|
options: { duration: .6 }
|
|
1004
1114
|
},
|
|
@@ -1007,10 +1117,10 @@ var A = "rgba(0, 0, 0, 0.3)", ce = oe({
|
|
|
1007
1117
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1008
1118
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1009
1119
|
}
|
|
1010
|
-
}),
|
|
1120
|
+
}), k = new Map([["overlay", ye]]);
|
|
1011
1121
|
//#endregion
|
|
1012
1122
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1013
|
-
function
|
|
1123
|
+
function be({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1014
1124
|
return {
|
|
1015
1125
|
name: e,
|
|
1016
1126
|
initial: t,
|
|
@@ -1031,7 +1141,7 @@ function ue({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1031
1141
|
}
|
|
1032
1142
|
//#endregion
|
|
1033
1143
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1034
|
-
function
|
|
1144
|
+
function xe({ 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
1145
|
return {
|
|
1036
1146
|
name: e,
|
|
1037
1147
|
initial: t,
|
|
@@ -1052,7 +1162,7 @@ function de({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1052
1162
|
}
|
|
1053
1163
|
//#endregion
|
|
1054
1164
|
//#region src/transition/partTransition/partTransition.ts
|
|
1055
|
-
var
|
|
1165
|
+
var A = /* @__PURE__ */ new Map(), j = {
|
|
1056
1166
|
"IDLE-true": "self",
|
|
1057
1167
|
"IDLE-false": "self",
|
|
1058
1168
|
"PUSHING-true": "initial",
|
|
@@ -1063,7 +1173,7 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1063
1173
|
"POPPING-false": "PUSHING-false",
|
|
1064
1174
|
"COMPLETED-true": "self",
|
|
1065
1175
|
"COMPLETED-false": "self"
|
|
1066
|
-
},
|
|
1176
|
+
}, Se = Object.keys(j), M = Se, Ce = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), N = (e) => typeof e == "object" && !!e && !Array.isArray(e), we = 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(".")), Te = (e, t) => t.startsWith("--") || we.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, P = (e, t) => typeof t == "number" ? Te(t, e) : typeof t == "string" ? t : "", F = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), I = new Set([
|
|
1067
1177
|
"x",
|
|
1068
1178
|
"y",
|
|
1069
1179
|
"z",
|
|
@@ -1074,7 +1184,7 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1074
1184
|
"rotateX",
|
|
1075
1185
|
"rotateY",
|
|
1076
1186
|
"rotateZ"
|
|
1077
|
-
]),
|
|
1187
|
+
]), Ee = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, De = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Oe = /^1(\.0+)?$/, ke = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? Oe.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? De.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? Ee.test(t.trim()) : !1, Ae = (e, t) => {
|
|
1078
1188
|
switch (e) {
|
|
1079
1189
|
case "x": return `translateX(${t})`;
|
|
1080
1190
|
case "y": return `translateY(${t})`;
|
|
@@ -1088,23 +1198,23 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1088
1198
|
case "rotateY": return `rotateY(${t})`;
|
|
1089
1199
|
default: return "";
|
|
1090
1200
|
}
|
|
1091
|
-
},
|
|
1201
|
+
}, L = (e) => {
|
|
1092
1202
|
let t = /* @__PURE__ */ new Set(), n = !1, r = (e) => {
|
|
1093
|
-
if (
|
|
1203
|
+
if (N(e)) for (let r of Object.keys(e)) {
|
|
1094
1204
|
let i = e[r];
|
|
1095
|
-
|
|
1205
|
+
P(r, i) !== "" && (I.has(r) ? n = !0 : t.add(F(r)));
|
|
1096
1206
|
}
|
|
1097
1207
|
};
|
|
1098
1208
|
r(e.initial);
|
|
1099
1209
|
for (let t of Object.values(e.variants)) r(t.value);
|
|
1100
1210
|
return n && t.add("transform"), Array.from(t);
|
|
1101
|
-
},
|
|
1102
|
-
if (!
|
|
1211
|
+
}, R = (e) => {
|
|
1212
|
+
if (!N(e)) return [];
|
|
1103
1213
|
let t = [], n = !0, r = [];
|
|
1104
1214
|
for (let i of Object.keys(e)) {
|
|
1105
|
-
let a = e[i], o =
|
|
1106
|
-
o !== "" && (
|
|
1107
|
-
property:
|
|
1215
|
+
let a = e[i], o = P(i, a);
|
|
1216
|
+
o !== "" && (I.has(i) ? (t.push(Ae(i, o)), ke(i, a) || (n = !1)) : r.push({
|
|
1217
|
+
property: F(i),
|
|
1108
1218
|
value: o
|
|
1109
1219
|
}));
|
|
1110
1220
|
}
|
|
@@ -1112,7 +1222,7 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1112
1222
|
property: "transform",
|
|
1113
1223
|
value: n ? "none" : t.join(" ")
|
|
1114
1224
|
}), r;
|
|
1115
|
-
},
|
|
1225
|
+
}, z = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), B = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1116
1226
|
linear: "linear",
|
|
1117
1227
|
easeIn: "ease-in",
|
|
1118
1228
|
easeOut: "ease-out",
|
|
@@ -1122,33 +1232,33 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1122
1232
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1123
1233
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1124
1234
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1125
|
-
}[e] ?? "ease" : "ease",
|
|
1235
|
+
}[e] ?? "ease" : "ease", je = (e) => {
|
|
1126
1236
|
if (!e) return 0;
|
|
1127
1237
|
let t = e.duration;
|
|
1128
1238
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1129
|
-
},
|
|
1239
|
+
}, Me = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Ne = (e, t) => {
|
|
1130
1240
|
let [n, r] = t.split("-");
|
|
1131
1241
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1132
|
-
},
|
|
1242
|
+
}, Pe = (e, t) => {
|
|
1133
1243
|
let [n, r] = t.split("-");
|
|
1134
1244
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1135
|
-
},
|
|
1245
|
+
}, Fe = (e, t) => {
|
|
1136
1246
|
let [n, r] = t.split("-");
|
|
1137
1247
|
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
|
-
},
|
|
1248
|
+
}, Ie = (e, t) => {
|
|
1139
1249
|
let [n, r] = t.split("-");
|
|
1140
1250
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1141
|
-
},
|
|
1142
|
-
let o =
|
|
1251
|
+
}, V = (e, t, n) => `flemo-${e}-${Ce(t)}-${n}`, H = (e, t, n, r, i, a) => {
|
|
1252
|
+
let o = R(r), s = R(i.value), c = je(i.options), l = Me(i.options), u = B(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Fe(t, n)}` : d;
|
|
1143
1253
|
if (s.length === 0 && o.length === 0) return "";
|
|
1144
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1145
|
-
let p =
|
|
1254
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${z(s)}\n animation: none;\n}`;
|
|
1255
|
+
let p = V(e, t, n), m = [
|
|
1146
1256
|
`@keyframes ${p} {`,
|
|
1147
1257
|
" from {",
|
|
1148
|
-
|
|
1258
|
+
z(o).replace(/^/gm, " "),
|
|
1149
1259
|
" }",
|
|
1150
1260
|
" to {",
|
|
1151
|
-
|
|
1261
|
+
z(s).replace(/^/gm, " "),
|
|
1152
1262
|
" }",
|
|
1153
1263
|
"}"
|
|
1154
1264
|
].join("\n"), h = [
|
|
@@ -1159,97 +1269,118 @@ var j = /* @__PURE__ */ new Map(), M = {
|
|
|
1159
1269
|
"both"
|
|
1160
1270
|
].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
1271
|
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
|
-
},
|
|
1272
|
+
}, U = (e, t, n, r) => {
|
|
1273
|
+
let i = R(r.value);
|
|
1274
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${z(i)}\n}`;
|
|
1275
|
+
}, Le = (e, t, n = []) => {
|
|
1166
1276
|
let r = [];
|
|
1167
1277
|
for (let t of e) {
|
|
1168
1278
|
let e = t.name;
|
|
1169
|
-
for (let n of
|
|
1170
|
-
let i = t.variants[n], a =
|
|
1279
|
+
for (let n of Se) {
|
|
1280
|
+
let i = t.variants[n], a = j[n];
|
|
1171
1281
|
if (a === "self") {
|
|
1172
|
-
r.push(
|
|
1282
|
+
r.push(U(Ne, e, n, i));
|
|
1173
1283
|
continue;
|
|
1174
1284
|
}
|
|
1175
1285
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1176
|
-
r.push(
|
|
1286
|
+
r.push(H("screen", e, n, o, i, Ne));
|
|
1177
1287
|
}
|
|
1178
1288
|
}
|
|
1179
1289
|
for (let e of t) {
|
|
1180
1290
|
let t = e.name;
|
|
1181
|
-
for (let n of
|
|
1182
|
-
let i = e.variants[n], a =
|
|
1291
|
+
for (let n of M) {
|
|
1292
|
+
let i = e.variants[n], a = j[n];
|
|
1183
1293
|
if (a === "self") {
|
|
1184
|
-
r.push(
|
|
1294
|
+
r.push(U(Pe, t, n, i));
|
|
1185
1295
|
continue;
|
|
1186
1296
|
}
|
|
1187
1297
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1188
|
-
r.push(
|
|
1298
|
+
r.push(H("decorator", t, n, o, i, Pe));
|
|
1189
1299
|
}
|
|
1190
1300
|
}
|
|
1191
1301
|
for (let e of n) {
|
|
1192
1302
|
let t = e.name;
|
|
1193
|
-
for (let n of
|
|
1194
|
-
let i = e.variants[n], a =
|
|
1303
|
+
for (let n of M) {
|
|
1304
|
+
let i = e.variants[n], a = j[n];
|
|
1195
1305
|
if (a === "self") {
|
|
1196
|
-
r.push(
|
|
1306
|
+
r.push(U(Ie, t, n, i));
|
|
1197
1307
|
continue;
|
|
1198
1308
|
}
|
|
1199
1309
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1200
|
-
r.push(
|
|
1310
|
+
r.push(H("part", t, n, o, i, Ie));
|
|
1201
1311
|
}
|
|
1202
1312
|
}
|
|
1203
|
-
return [...r.filter((e) => e.length > 0),
|
|
1204
|
-
},
|
|
1313
|
+
return [...r.filter((e) => e.length > 0), Re].join("\n\n");
|
|
1314
|
+
}, Re = [
|
|
1205
1315
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1206
1316
|
"[data-flemo-anim-hold=\"true\"] [data-flemo-part-name] {",
|
|
1207
1317
|
" animation-play-state: paused !important;",
|
|
1208
1318
|
"}"
|
|
1209
|
-
].join("\n"),
|
|
1210
|
-
let n =
|
|
1319
|
+
].join("\n"), ze = (e, t) => {
|
|
1320
|
+
let n = j[t];
|
|
1211
1321
|
if (n === "self") return !1;
|
|
1212
|
-
let r = e.variants[t], i =
|
|
1322
|
+
let r = e.variants[t], i = je(r.options), a = Me(r.options);
|
|
1213
1323
|
if (i <= 0 && a <= 0) return !1;
|
|
1214
|
-
let o =
|
|
1324
|
+
let o = R(n === "initial" ? e.initial : e.variants[n].value), s = R(r.value);
|
|
1215
1325
|
return o.length > 0 || s.length > 0;
|
|
1216
|
-
},
|
|
1217
|
-
function
|
|
1218
|
-
if (
|
|
1219
|
-
let e =
|
|
1220
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1326
|
+
}, Be = "data-flemo";
|
|
1327
|
+
function W() {
|
|
1328
|
+
if (u()) return;
|
|
1329
|
+
let e = Le(D.values(), k.values(), A.values()), t = document.head.querySelector(`style[${Be}]`);
|
|
1330
|
+
t || (t = document.createElement("style"), t.setAttribute(Be, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1331
|
+
}
|
|
1332
|
+
//#endregion
|
|
1333
|
+
//#region src/transition/registerTransitionDefinitions.ts
|
|
1334
|
+
function Ve(e, t, n = []) {
|
|
1335
|
+
for (let t of e) D.set(t.name, t);
|
|
1336
|
+
for (let e of t) k.set(e.name, e);
|
|
1337
|
+
for (let e of n) A.set(e.name, e);
|
|
1338
|
+
return W(), () => {
|
|
1339
|
+
for (let t of e) D.delete(t.name);
|
|
1340
|
+
for (let e of t) k.delete(e.name);
|
|
1341
|
+
for (let e of n) A.delete(e.name);
|
|
1342
|
+
W();
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
//#endregion
|
|
1346
|
+
//#region src/transition/enteringInitialStyle.ts
|
|
1347
|
+
function He(e) {
|
|
1348
|
+
let { initial: t, isActive: n, status: r } = e;
|
|
1349
|
+
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1350
|
+
let i = {};
|
|
1351
|
+
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;
|
|
1221
1352
|
}
|
|
1222
1353
|
//#endregion
|
|
1223
1354
|
//#region src/transition/animateInline.ts
|
|
1224
|
-
var
|
|
1225
|
-
let n =
|
|
1226
|
-
n || (n = /* @__PURE__ */ new Set(),
|
|
1227
|
-
},
|
|
1355
|
+
var Ue = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, G = /* @__PURE__ */ new WeakMap(), We = (e, t) => {
|
|
1356
|
+
let n = G.get(e);
|
|
1357
|
+
n || (n = /* @__PURE__ */ new Set(), G.set(e, n)), n.add(t);
|
|
1358
|
+
}, K = (e, t) => {
|
|
1228
1359
|
if (e.style.transition = "", t) {
|
|
1229
|
-
let n =
|
|
1360
|
+
let n = G.get(e);
|
|
1230
1361
|
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1231
1362
|
return;
|
|
1232
1363
|
}
|
|
1233
|
-
let n =
|
|
1364
|
+
let n = G.get(e);
|
|
1234
1365
|
if (n && n.size > 0) {
|
|
1235
1366
|
for (let t of n) e.style.removeProperty(t);
|
|
1236
1367
|
n.clear();
|
|
1237
1368
|
return;
|
|
1238
1369
|
}
|
|
1239
1370
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1240
|
-
},
|
|
1241
|
-
if (!
|
|
1242
|
-
let r = e, i =
|
|
1371
|
+
}, q = (e, t, n = {}) => {
|
|
1372
|
+
if (!Ue(e)) return Promise.resolve();
|
|
1373
|
+
let r = e, i = R(t);
|
|
1243
1374
|
if (i.length === 0) return Promise.resolve();
|
|
1244
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1375
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = B(n.ease);
|
|
1245
1376
|
if (a <= 0 && o <= 0) {
|
|
1246
1377
|
r.style.transition = "none";
|
|
1247
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1378
|
+
for (let e of i) r.style.setProperty(e.property, e.value), We(r, e.property);
|
|
1248
1379
|
return Promise.resolve();
|
|
1249
1380
|
}
|
|
1250
1381
|
let c = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1251
1382
|
r.style.transition = c, r.offsetWidth;
|
|
1252
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1383
|
+
for (let e of i) r.style.setProperty(e.property, e.value), We(r, e.property);
|
|
1253
1384
|
return new Promise((e) => {
|
|
1254
1385
|
let t = !1, n = () => {
|
|
1255
1386
|
t || (t = !0, r.removeEventListener("transitionend", i), e());
|
|
@@ -1258,27 +1389,27 @@ var je = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, K = /* @__
|
|
|
1258
1389
|
};
|
|
1259
1390
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1260
1391
|
});
|
|
1261
|
-
},
|
|
1262
|
-
function
|
|
1392
|
+
}, J = "data-flemo-skip-animation", Y = () => {};
|
|
1393
|
+
function Ge(e) {
|
|
1263
1394
|
return { driveScreenLifecycle: (t) => {
|
|
1264
|
-
let { getElements: n, transitionName:
|
|
1265
|
-
if (!s) return o === "REPLACING" &&
|
|
1395
|
+
let { getElements: n, transitionName: r, prevTransitionName: i, status: o, isActive: s } = t;
|
|
1396
|
+
if (!s) return o === "REPLACING" && i !== r && e.setReplaceTransitionStatus("PENDING"), Y;
|
|
1266
1397
|
if (o === "COMPLETED") {
|
|
1267
1398
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
1268
1399
|
let { scope: t, decorator: r, bars: i } = n();
|
|
1269
|
-
t && (
|
|
1270
|
-
for (let e of i ?? []) e && (
|
|
1271
|
-
return
|
|
1400
|
+
t && (K(t), t.removeAttribute(J)), r && (K(r), r.removeAttribute(J));
|
|
1401
|
+
for (let e of i ?? []) e && (K(e), e.style.removeProperty("will-change"));
|
|
1402
|
+
return Y;
|
|
1272
1403
|
}
|
|
1273
|
-
if (o === "IDLE") return
|
|
1404
|
+
if (o === "IDLE") return Y;
|
|
1274
1405
|
let { scope: c } = n();
|
|
1275
|
-
if (!c) return
|
|
1406
|
+
if (!c) return Y;
|
|
1276
1407
|
let l = () => {
|
|
1277
1408
|
let t = e.getTransitionTaskId();
|
|
1278
|
-
t &&
|
|
1279
|
-
}, u =
|
|
1280
|
-
if (!(c.getAttribute("data-flemo-skip-animation") !== "true" &&
|
|
1281
|
-
let f =
|
|
1409
|
+
t && a.resolveTask(t);
|
|
1410
|
+
}, u = ge(r), d = `${o}-true`;
|
|
1411
|
+
if (!(c.getAttribute("data-flemo-skip-animation") !== "true" && ze(u, d))) return queueMicrotask(l), Y;
|
|
1412
|
+
let f = V("screen", r, d), p = (e) => {
|
|
1282
1413
|
e.target === c && e.animationName === f && (c.removeEventListener("animationend", p), l());
|
|
1283
1414
|
};
|
|
1284
1415
|
return c.addEventListener("animationend", p), () => {
|
|
@@ -1288,20 +1419,20 @@ function Ne(e) {
|
|
|
1288
1419
|
}
|
|
1289
1420
|
//#endregion
|
|
1290
1421
|
//#region src/utils/findScrollable.ts
|
|
1291
|
-
function
|
|
1292
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
1422
|
+
function X(e, t) {
|
|
1423
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Ke(e);
|
|
1293
1424
|
if (!o) return {
|
|
1294
1425
|
element: null,
|
|
1295
1426
|
hasMarker: !1
|
|
1296
1427
|
};
|
|
1297
1428
|
let s = o.closest?.(r);
|
|
1298
|
-
if (s instanceof HTMLElement &&
|
|
1429
|
+
if (s instanceof HTMLElement && Z(s, n) && (!a || Q(s, n))) return {
|
|
1299
1430
|
element: s,
|
|
1300
1431
|
hasMarker: !0
|
|
1301
1432
|
};
|
|
1302
1433
|
let c = o, l = 0;
|
|
1303
1434
|
for (; c && l < i;) {
|
|
1304
|
-
if (
|
|
1435
|
+
if (Z(c, n) && (!a || Q(c, n))) return {
|
|
1305
1436
|
element: c,
|
|
1306
1437
|
hasMarker: !1
|
|
1307
1438
|
};
|
|
@@ -1312,7 +1443,7 @@ function Z(e, t) {
|
|
|
1312
1443
|
hasMarker: !1
|
|
1313
1444
|
};
|
|
1314
1445
|
}
|
|
1315
|
-
function
|
|
1446
|
+
function Ke(e) {
|
|
1316
1447
|
if (!e) return null;
|
|
1317
1448
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
1318
1449
|
if (n && n.length) {
|
|
@@ -1320,18 +1451,18 @@ function Pe(e) {
|
|
|
1320
1451
|
}
|
|
1321
1452
|
return e instanceof HTMLElement ? e : null;
|
|
1322
1453
|
}
|
|
1323
|
-
function
|
|
1454
|
+
function Z(e, t) {
|
|
1324
1455
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
1325
1456
|
}
|
|
1326
|
-
function
|
|
1327
|
-
if (!
|
|
1457
|
+
function Q(e, t) {
|
|
1458
|
+
if (!Z(e, t) || typeof window > "u") return !1;
|
|
1328
1459
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
1329
1460
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
1330
1461
|
}
|
|
1331
1462
|
//#endregion
|
|
1332
1463
|
//#region src/core/engine/createSwipeController.ts
|
|
1333
|
-
var
|
|
1334
|
-
function
|
|
1464
|
+
var qe = "data-flemo-skip-animation";
|
|
1465
|
+
function Je(e) {
|
|
1335
1466
|
let t = null, n = null, r = {
|
|
1336
1467
|
current: [],
|
|
1337
1468
|
prev: []
|
|
@@ -1377,9 +1508,9 @@ function Ie(e) {
|
|
|
1377
1508
|
y: e.clientY
|
|
1378
1509
|
}, u = t;
|
|
1379
1510
|
}, v = (n, i, a) => {
|
|
1380
|
-
let o =
|
|
1381
|
-
if (n === e.getElements().scope) for (let e of r.current)
|
|
1382
|
-
else if (n === t) for (let e of r.prev)
|
|
1511
|
+
let o = q(n, i, a);
|
|
1512
|
+
if (n === e.getElements().scope) for (let e of r.current) q(e, i, a);
|
|
1513
|
+
else if (n === t) for (let e of r.prev) q(e, i, a);
|
|
1383
1514
|
return o;
|
|
1384
1515
|
}, y = (t) => {
|
|
1385
1516
|
let n = e.getPartnerBars(), i = [], { sharedTopBar: a, sharedBottomBar: o } = e.getElements();
|
|
@@ -1393,12 +1524,12 @@ function Ie(e) {
|
|
|
1393
1524
|
current: i,
|
|
1394
1525
|
prev: s
|
|
1395
1526
|
};
|
|
1396
|
-
let c =
|
|
1527
|
+
let c = L(e.getTransition()).join(", ");
|
|
1397
1528
|
for (let e of i) e.style.willChange = c;
|
|
1398
1529
|
for (let e of s) e.style.willChange = c;
|
|
1399
1530
|
}, b = () => {
|
|
1400
|
-
for (let e of r.current)
|
|
1401
|
-
for (let e of r.prev)
|
|
1531
|
+
for (let e of r.current) K(e), e.style.removeProperty("will-change");
|
|
1532
|
+
for (let e of r.prev) K(e), e.style.removeProperty("will-change");
|
|
1402
1533
|
r = {
|
|
1403
1534
|
current: [],
|
|
1404
1535
|
prev: []
|
|
@@ -1411,10 +1542,10 @@ function Ie(e) {
|
|
|
1411
1542
|
};
|
|
1412
1543
|
}, S = (e, t, n) => {
|
|
1413
1544
|
let r = (r, i) => {
|
|
1414
|
-
let a =
|
|
1545
|
+
let a = A.get(r.getAttribute("data-flemo-part-name"));
|
|
1415
1546
|
if (!a) return;
|
|
1416
1547
|
let o = {
|
|
1417
|
-
animate:
|
|
1548
|
+
animate: q,
|
|
1418
1549
|
element: r,
|
|
1419
1550
|
active: i
|
|
1420
1551
|
};
|
|
@@ -1423,7 +1554,7 @@ function Ie(e) {
|
|
|
1423
1554
|
for (let e of i.current) r(e, !0);
|
|
1424
1555
|
for (let e of i.prev) r(e, !1);
|
|
1425
1556
|
}, C = () => {
|
|
1426
|
-
for (let e of [...i.current, ...i.prev])
|
|
1557
|
+
for (let e of [...i.current, ...i.prev]) K(e);
|
|
1427
1558
|
i = {
|
|
1428
1559
|
current: [],
|
|
1429
1560
|
prev: []
|
|
@@ -1452,7 +1583,7 @@ function Ie(e) {
|
|
|
1452
1583
|
prevScreen: t,
|
|
1453
1584
|
onStart: (e) => {
|
|
1454
1585
|
m?.onSwipeStart?.(e, {
|
|
1455
|
-
animate:
|
|
1586
|
+
animate: q,
|
|
1456
1587
|
currentDecorator: f,
|
|
1457
1588
|
prevDecorator: n
|
|
1458
1589
|
}), S("start", e, 0);
|
|
@@ -1469,13 +1600,13 @@ function Ie(e) {
|
|
|
1469
1600
|
prevScreen: t,
|
|
1470
1601
|
onProgress: (e, t) => {
|
|
1471
1602
|
c?.onSwipe?.(e, t, {
|
|
1472
|
-
animate:
|
|
1603
|
+
animate: q,
|
|
1473
1604
|
currentDecorator: o,
|
|
1474
1605
|
prevDecorator: n
|
|
1475
1606
|
}), S("swipe", e, t);
|
|
1476
1607
|
}
|
|
1477
1608
|
});
|
|
1478
|
-
},
|
|
1609
|
+
}, te = async (a) => {
|
|
1479
1610
|
let o = e.getTransition();
|
|
1480
1611
|
if (!o.swipeDirection || !s) return;
|
|
1481
1612
|
s = !1;
|
|
@@ -1488,32 +1619,32 @@ function Ie(e) {
|
|
|
1488
1619
|
prevScreen: t,
|
|
1489
1620
|
onStart: (e) => {
|
|
1490
1621
|
u?.onSwipeEnd?.(e, {
|
|
1491
|
-
animate:
|
|
1622
|
+
animate: q,
|
|
1492
1623
|
currentDecorator: l,
|
|
1493
1624
|
prevDecorator: n
|
|
1494
1625
|
}), S("end", e, 0);
|
|
1495
1626
|
}
|
|
1496
1627
|
})) {
|
|
1497
|
-
c?.setAttribute(
|
|
1628
|
+
c?.setAttribute(qe, "true"), l?.setAttribute(qe, "true");
|
|
1498
1629
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
1499
|
-
for (let e of r.prev)
|
|
1630
|
+
for (let e of r.prev) K(e), e.style.removeProperty("will-change");
|
|
1500
1631
|
r = {
|
|
1501
1632
|
current: [],
|
|
1502
1633
|
prev: []
|
|
1503
1634
|
};
|
|
1504
|
-
for (let e of i.prev)
|
|
1635
|
+
for (let e of i.prev) K(e);
|
|
1505
1636
|
i = {
|
|
1506
1637
|
current: [],
|
|
1507
1638
|
prev: []
|
|
1508
1639
|
}, e.back();
|
|
1509
|
-
} else c &&
|
|
1640
|
+
} else c && K(c), t && K(t), l && K(l), n && K(n), b(), C(), e.setDragStatus("IDLE");
|
|
1510
1641
|
};
|
|
1511
1642
|
return {
|
|
1512
1643
|
pointerDown: (t) => {
|
|
1513
|
-
e.isReadyForDrag() && (f =
|
|
1644
|
+
e.isReadyForDrag() && (f = X(t.target, {
|
|
1514
1645
|
direction: "x",
|
|
1515
1646
|
verifyByScroll: !0
|
|
1516
|
-
}), p =
|
|
1647
|
+
}), p = X(t.target, {
|
|
1517
1648
|
direction: "y",
|
|
1518
1649
|
verifyByScroll: !0
|
|
1519
1650
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -1535,14 +1666,14 @@ function Ie(e) {
|
|
|
1535
1666
|
}
|
|
1536
1667
|
},
|
|
1537
1668
|
pointerUp: (e) => {
|
|
1538
|
-
a = !1, o = !1, s &&
|
|
1669
|
+
a = !1, o = !1, s && te(e);
|
|
1539
1670
|
},
|
|
1540
1671
|
shouldPreventTouch: () => o
|
|
1541
1672
|
};
|
|
1542
1673
|
}
|
|
1543
1674
|
//#endregion
|
|
1544
1675
|
//#region src/screen/computeBarRiding.ts
|
|
1545
|
-
function
|
|
1676
|
+
function Ye(e) {
|
|
1546
1677
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
1547
1678
|
app: !1,
|
|
1548
1679
|
nav: !1
|
|
@@ -1553,11 +1684,11 @@ function Le(e) {
|
|
|
1553
1684
|
}
|
|
1554
1685
|
//#endregion
|
|
1555
1686
|
//#region src/screen/animStartAnchor.ts
|
|
1556
|
-
function
|
|
1687
|
+
function Xe(e) {
|
|
1557
1688
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
1558
1689
|
}
|
|
1559
|
-
var
|
|
1560
|
-
function
|
|
1690
|
+
var Ze = 300;
|
|
1691
|
+
function Qe(e) {
|
|
1561
1692
|
let t = 0, n = requestAnimationFrame(() => {
|
|
1562
1693
|
t = requestAnimationFrame(e);
|
|
1563
1694
|
}), r = setTimeout(e, 300);
|
|
@@ -1566,4 +1697,45 @@ function Be(e) {
|
|
|
1566
1697
|
};
|
|
1567
1698
|
}
|
|
1568
1699
|
//#endregion
|
|
1569
|
-
|
|
1700
|
+
//#region src/screen/observeBarHeight.ts
|
|
1701
|
+
function $e(e, t) {
|
|
1702
|
+
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
1703
|
+
let n = new ResizeObserver(([e]) => {
|
|
1704
|
+
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
1705
|
+
});
|
|
1706
|
+
return n.observe(e), () => {
|
|
1707
|
+
n.disconnect();
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1710
|
+
//#endregion
|
|
1711
|
+
//#region src/screen/observeViewportScrollHeight.ts
|
|
1712
|
+
var $ = 0;
|
|
1713
|
+
function et(e) {
|
|
1714
|
+
let t = 0, n = () => {
|
|
1715
|
+
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
1716
|
+
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
1717
|
+
t = t < 0 ? 0 : t;
|
|
1718
|
+
let n = t - $;
|
|
1719
|
+
n = n < 0 ? 0 : n, $ ||= t, e(t, n);
|
|
1720
|
+
});
|
|
1721
|
+
};
|
|
1722
|
+
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
1723
|
+
cancelAnimationFrame(t), window.visualViewport?.removeEventListener("resize", n), window.visualViewport?.removeEventListener("scroll", n);
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
//#endregion
|
|
1727
|
+
//#region src/utils/matchesPathname.ts
|
|
1728
|
+
function tt(e, t) {
|
|
1729
|
+
return i(e).regexp.test(t);
|
|
1730
|
+
}
|
|
1731
|
+
//#endregion
|
|
1732
|
+
//#region src/utils/buildRoutePath.ts
|
|
1733
|
+
function nt(e, n) {
|
|
1734
|
+
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();
|
|
1735
|
+
return {
|
|
1736
|
+
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
1737
|
+
toPathname: a
|
|
1738
|
+
};
|
|
1739
|
+
}
|
|
1740
|
+
//#endregion
|
|
1741
|
+
export { Ze as ANIM_HOLD_RELEASE_BACKSTOP_MS, J as SKIP_ANIMATION_ATTR, a as TaskManger, Xe as animHoldKey, q as animateInline, V as animationName, te as appendParamsQuery, W as applyTransitionStyles, nt as buildRoutePath, Q as canProgrammaticallyScroll, K as clearInlineAnimation, L as collectAnimatedProperties, Le as compileTransitionStyles, Ye as computeBarRiding, le as computeScreenFreeze, _ as consumeSelfInducedPop, p as createBrowserHistoryDriver, _e as createDecorator, o as createHistoryStore, v as createHistorySync, y as createMemoryHistoryDriver, b as createNavigateStore, w as createNavigationController, be as createPartTransition, ve as createRawDecorator, xe as createRawPartTransition, ue as createRawTransition, se as createRouterScope, ce as createScreenSelector, ae as createScreenStore, m as createSelfPopGuard, ne as createStepController, Je as createSwipeController, T as createTransition, Ge as createTransitionEngine, ie as createTransitionStore, fe as cupertino, k as decoratorMap, B as easingToCss, d as ensureWindowHistoryState, He as enteringInitialStyle, X as findScrollable, s as getMatchedPathPattern, c as getParams, u as isServer, me as layout, g as markSelfInducedPop, tt as matchesPathname, he as material, E as none, $e as observeBarHeight, et as observeViewportScrollHeight, Z as overflowsAxis, ye as overlay, A as partTransitionMap, ee as readStepParams, Ve as registerTransitionDefinitions, ge as resolveTransition, Qe as scheduleAnimHoldRelease, l as seedInitialHistory, re as subscribeStepParamsRestore, R as targetToDecls, D as transitionMap, ze as variantHasAnimation };
|