@flemo/react 2.2.3 → 2.3.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/__tests__/Router.hydration.test.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +467 -464
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import e, { Activity as t, Children as n, createContext as r, createElement as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useInsertionEffect as d, useLayoutEffect as f, useReducer as p, useRef as m, useState as h } from "react";
|
|
2
|
-
import { ACTIVE_ATTR as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { createPortal as
|
|
1
|
+
import e, { Activity as t, Children as n, createContext as r, createElement as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useInsertionEffect as d, useLayoutEffect as f, useReducer as p, useRef as m, useState as h, useSyncExternalStore as ee } from "react";
|
|
2
|
+
import { ACTIVE_ATTR as te, ANIM_HOLD as g, ANIM_HOLD_ATTR as _, DEFAULT_COMMIT_FRACTION as v, DEFAULT_COMMIT_VELOCITY as y, LAYER_HOST_ATTR as ne, LAYER_OWNER_ATTR as b, LAYER_SLOT_ATTR as re, OVERLAY_LEVEL as x, STATUS_ATTR as S, TRANSITION_ATTR as ie, adoptEntryIdentity as ae, animHoldKey as oe, appendParamsQuery as se, attachMorph as C, beginMorphSwipe as ce, buildRoutePath as w, computeBarRiding as le, computeScreenFreeze as ue, computeScreenFreezeMode as T, consumeSelfInducedPop as de, createAnimHoldCoordinator as E, createBrowserHistoryDriver as D, createBrowserHistoryDriver as fe, createDecorator as pe, createHistoryStore as O, createMorphTransition as k, createNavigateStore as me, createNavigationController as A, createPartTransition as he, createRawDecorator as j, createRawMorphTransition as M, createRawPartTransition as N, createRawTransition as ge, createRouterScope as _e, createScreenSelector as ve, createScreenStore as P, createStepController as ye, createSwipeController as be, createTransition as xe, createTransitionEngine as Se, createTransitionStore as Ce, decoratorMap as we, eagerlyDecodeImages as Te, ensureScopeHistorySync as Ee, enteringInitialStyle as De, getMatchedPathPattern as Oe, isDesktopBlink as ke, isOpaqueColor as Ae, isServer as je, markSelfInducedPop as Me, matchesPathname as Ne, morphTransitionMap as Pe, observeBarHeight as Fe, observeViewportScrollHeight as Ie, partTransitionMap as Le, publishRideBox as Re, readStepParams as ze, registerMorphLayer as Be, registerPartLayer as Ve, registerTransitionDefinitions as He, releaseScopeHistorySync as Ue, resolvePartLayer as We, resolvePlatformProfile as Ge, resolveSwipeOptions as Ke, resolveTransition as qe, seedRouterEntry as Je, sharedBarsMatch as Ye, startFlemoRuntime as Xe, subscribeStepParamsRestore as Ze } from "@flemo/core";
|
|
3
|
+
import { Fragment as Qe, jsx as F, jsxs as $e } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as et, flushSync as tt } from "react-dom";
|
|
5
5
|
//#region src/stores/StoreContext.ts
|
|
6
|
-
var
|
|
6
|
+
var nt = r(null);
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/stores/useStores.ts
|
|
9
|
-
function
|
|
10
|
-
let e = s(
|
|
9
|
+
function I() {
|
|
10
|
+
let e = s(nt);
|
|
11
11
|
if (!e) throw Error("flemo stores are missing. Render inside a <Router>.");
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/history/HistoryListener.tsx
|
|
16
|
-
function
|
|
17
|
-
let e =
|
|
18
|
-
return c(() => (
|
|
16
|
+
function L() {
|
|
17
|
+
let e = I();
|
|
18
|
+
return c(() => (Ee(e), () => Ue(e)), [e]), null;
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/screen/ScreenContext.ts
|
|
22
|
-
var
|
|
22
|
+
var R = r({
|
|
23
23
|
id: "",
|
|
24
24
|
isActive: !1,
|
|
25
25
|
isRoot: !0,
|
|
@@ -34,14 +34,14 @@ var Ze = r({
|
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/screen/useScreen.ts
|
|
36
36
|
function z() {
|
|
37
|
-
return s(
|
|
37
|
+
return s(R);
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/screen/ParamsProvider/ParamsContext.ts
|
|
41
|
-
var
|
|
41
|
+
var B = r({}), V = r(() => {});
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/screen/ParamsProvider/ParamsReducer.ts
|
|
44
|
-
function
|
|
44
|
+
function rt(e, t) {
|
|
45
45
|
switch (t.type) {
|
|
46
46
|
case "SET": return t.params;
|
|
47
47
|
default: return e;
|
|
@@ -49,10 +49,10 @@ function B(e, t) {
|
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/screen/ParamsProvider/ParamsProvider.tsx
|
|
52
|
-
function
|
|
53
|
-
let { isActive: t, params: n } = z(), { driver: r } =
|
|
52
|
+
function it({ children: e }) {
|
|
53
|
+
let { isActive: t, params: n } = z(), { driver: r } = I(), [i, a] = p(rt, n);
|
|
54
54
|
return c(() => {
|
|
55
|
-
if (t) return
|
|
55
|
+
if (t) return Ze(r, (e) => a({
|
|
56
56
|
type: "SET",
|
|
57
57
|
params: e
|
|
58
58
|
}));
|
|
@@ -60,9 +60,9 @@ function V({ children: e }) {
|
|
|
60
60
|
t,
|
|
61
61
|
a,
|
|
62
62
|
r
|
|
63
|
-
]), /* @__PURE__ */
|
|
63
|
+
]), /* @__PURE__ */ F(V.Provider, {
|
|
64
64
|
value: a,
|
|
65
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ F(B.Provider, {
|
|
66
66
|
value: i,
|
|
67
67
|
children: e
|
|
68
68
|
})
|
|
@@ -70,42 +70,42 @@ function V({ children: e }) {
|
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region ../../node_modules/.pnpm/zustand@5.0.15_@types+react@19.2.18_react@19.2.8/node_modules/zustand/esm/react.mjs
|
|
73
|
-
var
|
|
74
|
-
function
|
|
73
|
+
var at = (e) => e;
|
|
74
|
+
function ot(t, n = at) {
|
|
75
75
|
let r = e.useSyncExternalStore(t.subscribe, e.useCallback(() => n(t.getState()), [t, n]), e.useCallback(() => n(t.getInitialState()), [t, n]));
|
|
76
76
|
return e.useDebugValue(r), r;
|
|
77
77
|
}
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/stores/useHistoryStore.ts
|
|
80
|
-
function
|
|
81
|
-
return
|
|
80
|
+
function H(e) {
|
|
81
|
+
return ot(I().history, e);
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/RouterIdContext.ts
|
|
85
|
-
var
|
|
85
|
+
var st = r(null);
|
|
86
86
|
//#endregion
|
|
87
87
|
//#region src/renderer/Renderer.tsx
|
|
88
|
-
function
|
|
89
|
-
let t =
|
|
90
|
-
return
|
|
91
|
-
let [r] = n.toArray(e).filter((e) =>
|
|
92
|
-
return r ? /* @__PURE__ */
|
|
88
|
+
function ct({ children: e }) {
|
|
89
|
+
let t = H((e) => e.index), r = H((e) => e.histories), i = I(), a = s(R), o = s(st);
|
|
90
|
+
return ve(r, t).map((t) => {
|
|
91
|
+
let [r] = n.toArray(e).filter((e) => Ne(e.props.path, t.pathname));
|
|
92
|
+
return r ? /* @__PURE__ */ F(R.Provider, {
|
|
93
93
|
value: {
|
|
94
94
|
...t,
|
|
95
95
|
isPrev: t.isPrev || a.isPrev,
|
|
96
96
|
navigateStore: i.navigate,
|
|
97
97
|
routerId: o ?? void 0,
|
|
98
|
-
routePath:
|
|
98
|
+
routePath: Oe(r.props.path, t.pathname)
|
|
99
99
|
},
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ F(it, { children: r })
|
|
101
101
|
}, t.id) : null;
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/screen/MorphLayer/MorphLayer.tsx
|
|
106
|
-
function
|
|
106
|
+
function lt({ stores: e }) {
|
|
107
107
|
let t = m(null);
|
|
108
|
-
return f(() => (
|
|
108
|
+
return f(() => (Be(e.navigate, t.current), () => Be(e.navigate, null)), [e.navigate]), /* @__PURE__ */ F("div", {
|
|
109
109
|
ref: t,
|
|
110
110
|
"data-flemo-morph-layer": "",
|
|
111
111
|
"aria-hidden": "true",
|
|
@@ -118,9 +118,9 @@ function nt({ stores: e }) {
|
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/screen/PartLayer/PartLayer.tsx
|
|
121
|
-
function
|
|
121
|
+
function ut({ stores: e }) {
|
|
122
122
|
let t = m(null);
|
|
123
|
-
return f(() => (
|
|
123
|
+
return f(() => (Ve(e.navigate, t.current), () => Ve(e.navigate, null)), [e.navigate]), /* @__PURE__ */ F("div", {
|
|
124
124
|
ref: t,
|
|
125
125
|
"data-flemo-part-layer": "",
|
|
126
126
|
"aria-hidden": "true",
|
|
@@ -133,14 +133,14 @@ function rt({ stores: e }) {
|
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
135
|
//#region src/screen/ScreenViewportContext.ts
|
|
136
|
-
var
|
|
137
|
-
function
|
|
138
|
-
return s(
|
|
136
|
+
var dt = r({ contained: !1 });
|
|
137
|
+
function ft() {
|
|
138
|
+
return s(dt);
|
|
139
139
|
}
|
|
140
140
|
//#endregion
|
|
141
141
|
//#region src/transition/styles.ts
|
|
142
|
-
function
|
|
143
|
-
d(() =>
|
|
142
|
+
function pt(e, t, n = [], r = []) {
|
|
143
|
+
d(() => He(e, t, n, r), [
|
|
144
144
|
e,
|
|
145
145
|
t,
|
|
146
146
|
n,
|
|
@@ -149,29 +149,29 @@ function ot(e, t, n = [], r = []) {
|
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region src/utils/devDiagnostics.ts
|
|
152
|
-
function
|
|
152
|
+
function mt() {
|
|
153
153
|
return typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
!
|
|
155
|
+
function ht(e) {
|
|
156
|
+
!mt() || typeof console > "u" || console.error(`[flemo] ${e}`);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
if (
|
|
158
|
+
function gt(e) {
|
|
159
|
+
if (mt()) throw Error(`[flemo] ${e}`);
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
162
|
//#region src/RouterDepthContext.ts
|
|
163
|
-
var
|
|
163
|
+
var U = r(0), W = r(null), _t = [
|
|
164
164
|
"current",
|
|
165
165
|
"parent",
|
|
166
166
|
"root",
|
|
167
167
|
"nearest-owner"
|
|
168
|
-
],
|
|
168
|
+
], vt = (e) => _t.includes(e), G = (e) => {
|
|
169
169
|
let t = [];
|
|
170
170
|
for (let n = e; n; n = n.parent) t.push(n);
|
|
171
171
|
return t;
|
|
172
172
|
};
|
|
173
173
|
function K(e, t, n) {
|
|
174
|
-
return e.routePaths.length === 0 || e.routePaths.some((e) => e === t) ? !0 : n ?
|
|
174
|
+
return e.routePaths.length === 0 || e.routePaths.some((e) => e === t) ? !0 : n ? Ne(e.routePaths, n) : !1;
|
|
175
175
|
}
|
|
176
176
|
function q(e) {
|
|
177
177
|
return G(e).map((e, t) => {
|
|
@@ -179,13 +179,13 @@ function q(e) {
|
|
|
179
179
|
return e.name ? `"${e.name}" (${n})` : `<unnamed> (${n})`;
|
|
180
180
|
}).join(", ");
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function yt({ from: e, target: t, path: n, pathname: r }) {
|
|
183
183
|
if (t === void 0) return {
|
|
184
184
|
node: e,
|
|
185
185
|
message: null
|
|
186
186
|
};
|
|
187
187
|
let i = null, a = null;
|
|
188
|
-
if (typeof t == "string" ?
|
|
188
|
+
if (typeof t == "string" ? vt(t) ? i = t : a = t : "scope" in t ? i = t.scope : a = t.name, a !== null) {
|
|
189
189
|
let t = G(e).find((e) => e.name === a);
|
|
190
190
|
return t ? {
|
|
191
191
|
node: t,
|
|
@@ -230,114 +230,117 @@ function mt({ from: e, target: t, path: n, pathname: r }) {
|
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function bt(e) {
|
|
234
234
|
if (!e.name) return null;
|
|
235
235
|
for (let t = e.parent; t; t = t.parent) if (t.name === e.name) return t;
|
|
236
236
|
return null;
|
|
237
237
|
}
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region src/Slot.tsx
|
|
240
|
-
var
|
|
241
|
-
function
|
|
242
|
-
return /* @__PURE__ */
|
|
240
|
+
var xt = { contained: !0 };
|
|
241
|
+
function St({ children: e, className: t, style: n }) {
|
|
242
|
+
return /* @__PURE__ */ F("div", {
|
|
243
243
|
className: t,
|
|
244
244
|
style: {
|
|
245
245
|
position: "relative",
|
|
246
246
|
overflow: "hidden",
|
|
247
247
|
...n
|
|
248
248
|
},
|
|
249
|
-
children: /* @__PURE__ */
|
|
250
|
-
value:
|
|
251
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ F(dt.Provider, {
|
|
250
|
+
value: xt,
|
|
251
|
+
children: /* @__PURE__ */ F(ct, { children: e })
|
|
252
252
|
})
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
//#endregion
|
|
256
256
|
//#region src/Router.tsx
|
|
257
|
-
function
|
|
257
|
+
function J(e) {
|
|
258
258
|
let t = null;
|
|
259
259
|
return n.forEach(e, (e) => {
|
|
260
260
|
if (t || !a(e)) return;
|
|
261
|
-
if (e.type ===
|
|
261
|
+
if (e.type === St) {
|
|
262
262
|
t = n.toArray(e.props.children).filter(a);
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
let r = e.props.children;
|
|
266
266
|
if (r) {
|
|
267
|
-
let e =
|
|
267
|
+
let e = J(r);
|
|
268
268
|
e && (t = e);
|
|
269
269
|
}
|
|
270
270
|
}), t;
|
|
271
271
|
}
|
|
272
|
-
var
|
|
273
|
-
function
|
|
274
|
-
let v = s(
|
|
275
|
-
c(() =>
|
|
276
|
-
let
|
|
277
|
-
routePaths:
|
|
278
|
-
pathname:
|
|
279
|
-
search:
|
|
272
|
+
var Ct = typeof window > "u" ? c : f, wt = () => () => {}, Y = () => !1, Tt = () => !0, Et = typeof window > "u" ? c : d, Dt = [], Ot = [], kt = [], At = [], jt = { contained: !0 };
|
|
273
|
+
function Mt({ children: e, name: t, strictRoutes: r = !1, initPath: i = "/", defaultTransitionName: o = "cupertino", transitions: u = Dt, decorators: d = Ot, partTransitions: f = kt, morphTransitions: p = At, history: m = "browser", createDriver: te, className: g, style: _ }) {
|
|
274
|
+
let v = s(U), y = l(), [ne, b] = h(!1);
|
|
275
|
+
c(() => b(!0), []);
|
|
276
|
+
let re = ne ? y : null, x = v > 0, S = m === "memory", ie = l(), oe = s(R), se = s(nt), C = x && oe.id ? `_F_${se?.routerKey ?? ""}${oe.id}_` : ie, ce = J(e), w = ce !== null, le = (ce ?? n.toArray(e).filter(a)).flatMap((e) => e.props?.path ? [e.props.path].flat() : []), ue = x ? null : se, T = ue !== null, de = te ?? fe, [E] = h(() => S ? null : de(T ? void 0 : C)), D = !x && !S && !je(), pe = D && E ? E.readPathname() : i || "/", O = pe.indexOf("?"), k = (O >= 0 ? pe.slice(0, O) : pe) || "/", me = D ? window.location.search : O >= 0 ? pe.slice(O) : "", A = ee(wt, Y, Tt), [he] = h(A), [j] = h(() => _e({
|
|
277
|
+
routePaths: le,
|
|
278
|
+
pathname: k,
|
|
279
|
+
search: me,
|
|
280
280
|
defaultTransitionName: o,
|
|
281
281
|
memory: S,
|
|
282
|
-
browserDriver:
|
|
283
|
-
hostedScope:
|
|
282
|
+
browserDriver: E,
|
|
283
|
+
hostedScope: ue,
|
|
284
|
+
deferEntryAdoption: A,
|
|
284
285
|
routerKey: T ? void 0 : C,
|
|
285
|
-
zoneEntryId: x && !T &&
|
|
286
|
+
zoneEntryId: x && !T && oe.id || void 0,
|
|
286
287
|
persistKey: x && !S && !T ? C : void 0
|
|
287
288
|
}));
|
|
288
|
-
|
|
289
|
-
|
|
289
|
+
Ct(() => {
|
|
290
|
+
j.transition.getState().defaultTransitionName !== o && j.transition.setState({ defaultTransitionName: o });
|
|
290
291
|
});
|
|
291
|
-
let
|
|
292
|
+
let M = s(W), [N] = h(() => ({
|
|
292
293
|
name: t,
|
|
293
|
-
stores:
|
|
294
|
-
routePaths:
|
|
294
|
+
stores: j,
|
|
295
|
+
routePaths: le,
|
|
295
296
|
strictRoutes: r,
|
|
296
|
-
parent:
|
|
297
|
+
parent: M,
|
|
297
298
|
depth: v
|
|
298
299
|
}));
|
|
299
|
-
|
|
300
|
-
|
|
300
|
+
Et(() => {
|
|
301
|
+
N.name = t, N.stores = j, N.routePaths = le, N.strictRoutes = r, N.parent = M;
|
|
301
302
|
}), c(() => {
|
|
302
|
-
|
|
303
|
-
}, [
|
|
304
|
-
|
|
305
|
-
}), [
|
|
306
|
-
|
|
307
|
-
|
|
303
|
+
bt(N) && ht(`duplicate <Router name="${N.name}">: an enclosing <Router> already uses that name, so \`router\` targets resolve to the nearer one. Give each nested Router a unique name.`);
|
|
304
|
+
}, [N, t]), Ct(() => (j.life.alive = !0, () => {
|
|
305
|
+
j.life.alive = !1;
|
|
306
|
+
}), [j]), pt(u, d, f, p), c(() => Xe(), []), Ct(() => {
|
|
307
|
+
he && ae(j);
|
|
308
|
+
}, [he, j]), c(() => {
|
|
309
|
+
S || !E || Je({
|
|
310
|
+
driver: E,
|
|
308
311
|
routerKey: T ? null : C,
|
|
309
312
|
nested: x && !T,
|
|
310
|
-
seedPathname:
|
|
313
|
+
seedPathname: k,
|
|
311
314
|
defaultTransitionName: o,
|
|
312
|
-
rootParams:
|
|
315
|
+
rootParams: j.history.getState().histories[0]?.params ?? {}
|
|
313
316
|
});
|
|
314
317
|
}, [
|
|
315
318
|
S,
|
|
316
319
|
T,
|
|
317
320
|
x,
|
|
318
321
|
C,
|
|
319
|
-
|
|
322
|
+
k,
|
|
320
323
|
o,
|
|
321
|
-
|
|
322
|
-
|
|
324
|
+
j.history,
|
|
325
|
+
E
|
|
323
326
|
]);
|
|
324
|
-
let
|
|
325
|
-
value:
|
|
326
|
-
children: /* @__PURE__ */
|
|
327
|
+
let ge = w ? e : /* @__PURE__ */ F(ct, { children: e }), ve = /* @__PURE__ */ F(st.Provider, {
|
|
328
|
+
value: re,
|
|
329
|
+
children: /* @__PURE__ */ F(U.Provider, {
|
|
327
330
|
value: v + 1,
|
|
328
|
-
children: /* @__PURE__ */
|
|
329
|
-
value:
|
|
330
|
-
children: /* @__PURE__ */
|
|
331
|
-
value:
|
|
332
|
-
children: [/* @__PURE__ */ L
|
|
333
|
-
value:
|
|
334
|
-
children:
|
|
335
|
-
}) :
|
|
331
|
+
children: /* @__PURE__ */ F(W.Provider, {
|
|
332
|
+
value: N,
|
|
333
|
+
children: /* @__PURE__ */ $e(nt.Provider, {
|
|
334
|
+
value: j,
|
|
335
|
+
children: [/* @__PURE__ */ F(L, {}), x ? /* @__PURE__ */ F(dt.Provider, {
|
|
336
|
+
value: jt,
|
|
337
|
+
children: ge
|
|
338
|
+
}) : ge]
|
|
336
339
|
})
|
|
337
340
|
})
|
|
338
341
|
})
|
|
339
342
|
});
|
|
340
|
-
return x ? /* @__PURE__ */
|
|
343
|
+
return x ? /* @__PURE__ */ $e("div", {
|
|
341
344
|
className: g,
|
|
342
345
|
style: {
|
|
343
346
|
position: "relative",
|
|
@@ -345,30 +348,30 @@ function Ct({ children: e, name: t, strictRoutes: r = !1, initPath: i = "/", def
|
|
|
345
348
|
..._
|
|
346
349
|
},
|
|
347
350
|
children: [
|
|
348
|
-
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
+
ve,
|
|
352
|
+
/* @__PURE__ */ F(lt, { stores: j }),
|
|
353
|
+
/* @__PURE__ */ F(ut, { stores: j })
|
|
351
354
|
]
|
|
352
|
-
}) : /* @__PURE__ */
|
|
353
|
-
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
355
|
+
}) : /* @__PURE__ */ $e(Qe, { children: [
|
|
356
|
+
ve,
|
|
357
|
+
/* @__PURE__ */ F(lt, { stores: j }),
|
|
358
|
+
/* @__PURE__ */ F(ut, { stores: j })
|
|
356
359
|
] });
|
|
357
360
|
}
|
|
358
361
|
//#endregion
|
|
359
362
|
//#region src/Route.tsx
|
|
360
|
-
function
|
|
363
|
+
function Nt({ element: e }) {
|
|
361
364
|
return e;
|
|
362
365
|
}
|
|
363
366
|
//#endregion
|
|
364
367
|
//#region src/utils/buildRoutePath.ts
|
|
365
|
-
function
|
|
366
|
-
return
|
|
368
|
+
function X(e, t) {
|
|
369
|
+
return w(e, t);
|
|
367
370
|
}
|
|
368
371
|
//#endregion
|
|
369
372
|
//#region src/navigate/useNavigate.ts
|
|
370
|
-
function
|
|
371
|
-
let t =
|
|
373
|
+
function Pt(e) {
|
|
374
|
+
let t = I(), n = s(W) ?? {
|
|
372
375
|
stores: t,
|
|
373
376
|
routePaths: [],
|
|
374
377
|
strictRoutes: !1,
|
|
@@ -377,24 +380,24 @@ function Et(e) {
|
|
|
377
380
|
}, r = (t, r, i) => {
|
|
378
381
|
let a = t ?? e?.router, o;
|
|
379
382
|
if (r) try {
|
|
380
|
-
o =
|
|
383
|
+
o = X(r, i).toPathname;
|
|
381
384
|
} catch {
|
|
382
385
|
o = void 0;
|
|
383
386
|
}
|
|
384
|
-
let { node: s, message: c } =
|
|
387
|
+
let { node: s, message: c } = yt({
|
|
385
388
|
from: n,
|
|
386
389
|
target: a,
|
|
387
390
|
path: r,
|
|
388
391
|
pathname: o
|
|
389
392
|
});
|
|
390
|
-
if (!s) return
|
|
391
|
-
if (c &&
|
|
393
|
+
if (!s) return gt(c ?? "the requested Router could not be resolved."), null;
|
|
394
|
+
if (c && ht(c), r && !K(s, r, o)) {
|
|
392
395
|
let e = `"${r}" is not declared by ${s.name ? `<Router name="${s.name}">` : "the target <Router>"}, so the navigation cannot mount a screen there. Declare a matching <Route>, target the Router that owns it, or use \`router: "nearest-owner"\`.`;
|
|
393
|
-
a !== void 0 || s.strictRoutes ?
|
|
396
|
+
a !== void 0 || s.strictRoutes ? gt(e) : ht(e);
|
|
394
397
|
}
|
|
395
|
-
return
|
|
398
|
+
return A({
|
|
396
399
|
stores: s.stores,
|
|
397
|
-
buildPathname: (e, t) =>
|
|
400
|
+
buildPathname: (e, t) => X(e, t),
|
|
398
401
|
driver: s.stores.driver,
|
|
399
402
|
markSelfInduced: s.stores.markSelfInduced
|
|
400
403
|
});
|
|
@@ -416,21 +419,21 @@ function Et(e) {
|
|
|
416
419
|
}
|
|
417
420
|
//#endregion
|
|
418
421
|
//#region src/navigate/usePathname.ts
|
|
419
|
-
function
|
|
420
|
-
return
|
|
422
|
+
function Ft() {
|
|
423
|
+
return H((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
|
|
421
424
|
}
|
|
422
425
|
//#endregion
|
|
423
426
|
//#region src/navigate/useStep.ts
|
|
424
|
-
function
|
|
425
|
-
let { routePath: e } = z(), t =
|
|
427
|
+
function It() {
|
|
428
|
+
let { routePath: e } = z(), t = I(), n = s(V), { driver: r, markSelfInduced: i } = t, [a, o] = h(null);
|
|
426
429
|
c(() => {
|
|
427
|
-
if (!e) return o(
|
|
430
|
+
if (!e) return o(ze(r.readState())), r.subscribe((e) => o(ze(e.state)));
|
|
428
431
|
}, [e, r]);
|
|
429
|
-
let l =
|
|
432
|
+
let l = ye({
|
|
430
433
|
stores: t,
|
|
431
434
|
driver: r,
|
|
432
435
|
markSelfInduced: i,
|
|
433
|
-
buildStepPathname: (t) => e ?
|
|
436
|
+
buildStepPathname: (t) => e ? X(e, t).pathname : se(r.readPathname(), t),
|
|
434
437
|
applyParams: (t) => {
|
|
435
438
|
n({
|
|
436
439
|
type: "SET",
|
|
@@ -447,23 +450,23 @@ function Ot() {
|
|
|
447
450
|
}
|
|
448
451
|
//#endregion
|
|
449
452
|
//#region src/screen/ParamsProvider/useParams.ts
|
|
450
|
-
function
|
|
451
|
-
return s(
|
|
453
|
+
function Lt() {
|
|
454
|
+
return s(B);
|
|
452
455
|
}
|
|
453
456
|
//#endregion
|
|
454
457
|
//#region src/screen/ScreenFreeze.tsx
|
|
455
|
-
var
|
|
456
|
-
function
|
|
458
|
+
var Rt = 3e3;
|
|
459
|
+
function zt({ freeze: e, mode: n = "deferred", children: r }) {
|
|
457
460
|
let [i, a] = h(e), o = m(null);
|
|
458
461
|
return !e && i && a(!1), c(() => {
|
|
459
462
|
if (!(!e || i)) {
|
|
460
|
-
if (n === "immediate" || !
|
|
463
|
+
if (n === "immediate" || !ke()) {
|
|
461
464
|
a(!0);
|
|
462
465
|
return;
|
|
463
466
|
}
|
|
464
467
|
return o.current = setTimeout(() => {
|
|
465
468
|
o.current = null, a(!0);
|
|
466
|
-
},
|
|
469
|
+
}, Rt), () => {
|
|
467
470
|
o.current !== null && (clearTimeout(o.current), o.current = null);
|
|
468
471
|
};
|
|
469
472
|
}
|
|
@@ -471,40 +474,40 @@ function jt({ freeze: e, mode: n = "deferred", children: r }) {
|
|
|
471
474
|
e,
|
|
472
475
|
i,
|
|
473
476
|
n
|
|
474
|
-
]), /* @__PURE__ */
|
|
477
|
+
]), /* @__PURE__ */ F(t, {
|
|
475
478
|
mode: e && i ? "hidden" : "visible",
|
|
476
479
|
children: r
|
|
477
480
|
});
|
|
478
481
|
}
|
|
479
482
|
//#endregion
|
|
480
483
|
//#region src/screen/LayerContext.ts
|
|
481
|
-
var
|
|
482
|
-
function
|
|
483
|
-
return s(
|
|
484
|
+
var Bt = r(null);
|
|
485
|
+
function Vt() {
|
|
486
|
+
return s(Bt);
|
|
484
487
|
}
|
|
485
|
-
var
|
|
486
|
-
function
|
|
487
|
-
return s(
|
|
488
|
+
var Ht = r(null);
|
|
489
|
+
function Ut() {
|
|
490
|
+
return s(Ht);
|
|
488
491
|
}
|
|
489
492
|
//#endregion
|
|
490
493
|
//#region src/screen/scopeAnimHoldCoordinator.ts
|
|
491
|
-
var
|
|
492
|
-
function
|
|
493
|
-
let t =
|
|
494
|
-
return t || (t =
|
|
494
|
+
var Wt = /* @__PURE__ */ new WeakMap();
|
|
495
|
+
function Gt(e) {
|
|
496
|
+
let t = Wt.get(e);
|
|
497
|
+
return t || (t = E(), Wt.set(e, t)), t;
|
|
495
498
|
}
|
|
496
499
|
//#endregion
|
|
497
500
|
//#region src/stores/useNavigateStore.ts
|
|
498
|
-
function
|
|
499
|
-
return
|
|
501
|
+
function Kt(e) {
|
|
502
|
+
return ot(I().navigate, e);
|
|
500
503
|
}
|
|
501
504
|
//#endregion
|
|
502
505
|
//#region src/screen/ScreenDecorator.tsx
|
|
503
|
-
function
|
|
506
|
+
function qt({ ref: e, style: t, ...n }) {
|
|
504
507
|
let { id: r, isActive: i, isPrev: a, transitionName: o } = z(), s = m(null);
|
|
505
508
|
u(e, () => s.current);
|
|
506
|
-
let c =
|
|
507
|
-
return f ? /* @__PURE__ */
|
|
509
|
+
let c = Kt((e) => a ? "COMPLETED" : e.status), l = qe(o), { decoratorName: d } = l, f = we.get(d);
|
|
510
|
+
return f ? /* @__PURE__ */ F("div", {
|
|
508
511
|
ref: s,
|
|
509
512
|
"data-flemo-decorator": !0,
|
|
510
513
|
"data-flemo-decorator-name": f.name,
|
|
@@ -526,9 +529,9 @@ function Rt({ ref: e, style: t, ...n }) {
|
|
|
526
529
|
}
|
|
527
530
|
//#endregion
|
|
528
531
|
//#region src/screen/useViewportScrollHeight.ts
|
|
529
|
-
function
|
|
532
|
+
function Jt() {
|
|
530
533
|
let [e, t] = h(0), [n, r] = h(0);
|
|
531
|
-
return c(() =>
|
|
534
|
+
return c(() => Ie((e, n) => {
|
|
532
535
|
r(n), t(e);
|
|
533
536
|
}), []), {
|
|
534
537
|
viewportScrollHeight: e,
|
|
@@ -537,308 +540,308 @@ function zt() {
|
|
|
537
540
|
}
|
|
538
541
|
//#endregion
|
|
539
542
|
//#region src/stores/useScreenStore.ts
|
|
540
|
-
function
|
|
541
|
-
return
|
|
543
|
+
function Z(e) {
|
|
544
|
+
return ot(I().screen, e);
|
|
542
545
|
}
|
|
543
546
|
//#endregion
|
|
544
547
|
//#region src/screen/ScreenMotion.tsx
|
|
545
|
-
function
|
|
546
|
-
let { id:
|
|
547
|
-
Ee.current ||=
|
|
548
|
-
getTransitionTaskId: () =>
|
|
549
|
-
setDragStatus:
|
|
548
|
+
function Yt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: a, sharedTopBarId: l, sharedBottomBar: u, sharedBottomBarId: d, topBar: p, bottomBar: ee, hideStatusBar: v, hideSystemNavigationBar: y, backgroundColor: b = "white", contentScrollable: re = !0, paintHidden: ae = !1, ...se }) {
|
|
549
|
+
let { id: C, isActive: w, isRoot: T, isPrev: de, zIndex: E, transitionName: D, prevTransitionName: fe } = z(), { contained: pe } = ft(), O = pe ? "absolute" : "fixed", k = I(), me = s(st), A = H((e) => e.index), he = H((e) => e.histories), j = w || E === A - 1, M = Kt((e) => j ? e.status : "COMPLETED"), N = Z((e) => e.dragStatus), ge = Z((e) => e.replaceTransitionStatus), _e = k.screen.getState().setDragStatus, ve = k.screen.getState().setReplaceTransitionStatus, P = w ? he[A - 1]?.id : he[A]?.id, ye = Z((e) => P ? e.sharedBars[P] : void 0), xe = Z((e) => P ? e.sharedBarMetadata[P] : void 0), Ce = Z((e) => P ? e.screenSurfaces[P] : void 0), Ee = m(null);
|
|
550
|
+
Ee.current ||= Se({
|
|
551
|
+
getTransitionTaskId: () => k.navigate.getState().transitionTaskId,
|
|
552
|
+
setDragStatus: _e,
|
|
550
553
|
setReplaceTransitionStatus: ve
|
|
551
554
|
});
|
|
552
|
-
let
|
|
553
|
-
|
|
554
|
-
let
|
|
555
|
-
let t =
|
|
555
|
+
let Oe = Ee.current, ke = m(null);
|
|
556
|
+
ke.current ||= Gt(k.navigate);
|
|
557
|
+
let je = qe(D), { initial: Me, decoratorName: Ne } = je, Pe = Ke(je)?.direction, Ie = we.get(Ne), { viewportScrollHeight: Le } = Jt(), ze = Le > 0, [Be, Ve] = h(null), He = Vt(), Ue = He ?? Be, Je = m(/* @__PURE__ */ new Set()), [Xe, Ze] = h(!1), Qe = Xe, nt = o((e) => {
|
|
558
|
+
let t = Je.current;
|
|
556
559
|
e ? t.add(e) : t.clear(), Ze(t.size > 0);
|
|
557
|
-
}, []),
|
|
558
|
-
key:
|
|
560
|
+
}, []), L = !!a, R = !!u, B = L ? `${typeof l}:${String(l)}` : null, V = R ? `${typeof d}:${String(d)}` : null, [rt, it] = h({
|
|
561
|
+
key: B,
|
|
559
562
|
height: 0
|
|
560
|
-
}), [
|
|
561
|
-
key:
|
|
563
|
+
}), [at, ot] = h({
|
|
564
|
+
key: V,
|
|
562
565
|
height: 0
|
|
563
|
-
}),
|
|
564
|
-
e <= 0 ||
|
|
565
|
-
key:
|
|
566
|
+
}), ct = m(rt), lt = m(at), ut = rt.key === B ? rt.height : 0, dt = at.key === V ? at.height : 0, pt = Ye(L ? { id: l } : void 0, xe?.topBar) ? xe?.topBar?.height ?? 0 : 0, mt = Ye(R ? { id: d } : void 0, xe?.bottomBar) ? xe?.bottomBar?.height ?? 0 : 0, ht = ut || pt, gt = dt || mt, U = m(null), W = m(null), _t = m(null), vt = m(null), G = m(null), K = m(null), q = m(null), yt = o((e) => {
|
|
567
|
+
e <= 0 || B === null || (vt.current && (vt.current.style.minHeight = `${e}px`), ct.current = {
|
|
568
|
+
key: B,
|
|
566
569
|
height: e
|
|
567
|
-
},
|
|
568
|
-
key:
|
|
570
|
+
}, it((t) => t.key === B && t.height === e ? t : {
|
|
571
|
+
key: B,
|
|
569
572
|
height: e
|
|
570
|
-
}),
|
|
573
|
+
}), k.screen.getState().updateSharedBarHeight(C, "topBar", e));
|
|
571
574
|
}, [
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
]),
|
|
576
|
-
e <= 0 ||
|
|
577
|
-
key:
|
|
575
|
+
C,
|
|
576
|
+
k.screen,
|
|
577
|
+
B
|
|
578
|
+
]), bt = o((e) => {
|
|
579
|
+
e <= 0 || V === null || (G.current && (G.current.style.minHeight = `${e}px`), lt.current = {
|
|
580
|
+
key: V,
|
|
578
581
|
height: e
|
|
579
|
-
},
|
|
580
|
-
key:
|
|
582
|
+
}, ot((t) => t.key === V && t.height === e ? t : {
|
|
583
|
+
key: V,
|
|
581
584
|
height: e
|
|
582
|
-
}),
|
|
585
|
+
}), k.screen.getState().updateSharedBarHeight(C, "bottomBar", e));
|
|
583
586
|
}, [
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
]),
|
|
588
|
-
|
|
589
|
-
}, [
|
|
590
|
-
|
|
591
|
-
}, [
|
|
592
|
-
transition:
|
|
593
|
-
decorator:
|
|
587
|
+
V,
|
|
588
|
+
C,
|
|
589
|
+
k.screen
|
|
590
|
+
]), xt = o((e) => {
|
|
591
|
+
K.current = e, e?.offsetHeight && yt(e.offsetHeight);
|
|
592
|
+
}, [yt]), St = o((e) => {
|
|
593
|
+
q.current = e, e?.offsetHeight && bt(e.offsetHeight);
|
|
594
|
+
}, [bt]), J = m({
|
|
595
|
+
transition: je,
|
|
596
|
+
decorator: Ie,
|
|
594
597
|
hasSharedTopBar: !!a,
|
|
595
598
|
hasSharedBottomBar: !!u,
|
|
596
599
|
sharedTopBarId: l,
|
|
597
600
|
sharedBottomBarId: d,
|
|
598
|
-
viewportScrollHeight:
|
|
599
|
-
isRoot:
|
|
600
|
-
isActive:
|
|
601
|
-
status:
|
|
602
|
-
dragStatus:
|
|
603
|
-
index:
|
|
601
|
+
viewportScrollHeight: Le,
|
|
602
|
+
isRoot: T,
|
|
603
|
+
isActive: w,
|
|
604
|
+
status: M,
|
|
605
|
+
dragStatus: N,
|
|
606
|
+
index: A
|
|
604
607
|
});
|
|
605
|
-
|
|
606
|
-
transition:
|
|
607
|
-
decorator:
|
|
608
|
+
J.current = {
|
|
609
|
+
transition: je,
|
|
610
|
+
decorator: Ie,
|
|
608
611
|
hasSharedTopBar: !!a,
|
|
609
612
|
hasSharedBottomBar: !!u,
|
|
610
613
|
sharedTopBarId: l,
|
|
611
614
|
sharedBottomBarId: d,
|
|
612
|
-
viewportScrollHeight:
|
|
613
|
-
isRoot:
|
|
614
|
-
isActive:
|
|
615
|
-
status:
|
|
616
|
-
dragStatus:
|
|
617
|
-
index:
|
|
615
|
+
viewportScrollHeight: Le,
|
|
616
|
+
isRoot: T,
|
|
617
|
+
isActive: w,
|
|
618
|
+
status: M,
|
|
619
|
+
dragStatus: N,
|
|
620
|
+
index: A
|
|
618
621
|
};
|
|
619
|
-
let
|
|
620
|
-
|
|
621
|
-
getTransition: () =>
|
|
622
|
-
getDecorator: () =>
|
|
622
|
+
let Ct = m(null), wt = m(null);
|
|
623
|
+
Ct.current ||= be({
|
|
624
|
+
getTransition: () => J.current.transition,
|
|
625
|
+
getDecorator: () => J.current.decorator,
|
|
623
626
|
getElements: () => ({
|
|
624
|
-
scope:
|
|
625
|
-
screenContainer:
|
|
626
|
-
decorator:
|
|
627
|
-
sharedTopBar:
|
|
628
|
-
sharedBottomBar:
|
|
627
|
+
scope: W.current,
|
|
628
|
+
screenContainer: U.current,
|
|
629
|
+
decorator: _t.current,
|
|
630
|
+
sharedTopBar: K.current,
|
|
631
|
+
sharedBottomBar: q.current
|
|
629
632
|
}),
|
|
630
|
-
hasSharedTopBar: () =>
|
|
631
|
-
hasSharedBottomBar: () =>
|
|
632
|
-
getPartLayer: () =>
|
|
633
|
-
getSharedTopBarId: () =>
|
|
634
|
-
getSharedBottomBarId: () =>
|
|
635
|
-
getViewportScrollHeight: () =>
|
|
633
|
+
hasSharedTopBar: () => J.current.hasSharedTopBar,
|
|
634
|
+
hasSharedBottomBar: () => J.current.hasSharedBottomBar,
|
|
635
|
+
getPartLayer: () => We(k.navigate),
|
|
636
|
+
getSharedTopBarId: () => J.current.sharedTopBarId,
|
|
637
|
+
getSharedBottomBarId: () => J.current.sharedBottomBarId,
|
|
638
|
+
getViewportScrollHeight: () => J.current.viewportScrollHeight,
|
|
636
639
|
isReadyForDrag: () => {
|
|
637
|
-
let e =
|
|
638
|
-
return !e.isRoot && e.isActive && e.status === "COMPLETED" && e.dragStatus === "IDLE" && !!e.transition
|
|
640
|
+
let e = J.current;
|
|
641
|
+
return !e.isRoot && e.isActive && e.status === "COMPLETED" && e.dragStatus === "IDLE" && !!Ke(e.transition) && e.viewportScrollHeight < 10;
|
|
639
642
|
},
|
|
640
643
|
getPartnerBars: () => {
|
|
641
|
-
let e =
|
|
642
|
-
return n ?
|
|
644
|
+
let e = J.current, t = k.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
|
|
645
|
+
return n ? k.screen.getState().sharedBars[n] : void 0;
|
|
643
646
|
},
|
|
644
647
|
getPartnerBarMetadata: () => {
|
|
645
|
-
let e =
|
|
646
|
-
return n ?
|
|
648
|
+
let e = J.current, t = k.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
|
|
649
|
+
return n ? k.screen.getState().sharedBarMetadata[n] : void 0;
|
|
647
650
|
},
|
|
648
|
-
setDragStatus:
|
|
649
|
-
back: () =>
|
|
651
|
+
setDragStatus: _e,
|
|
652
|
+
back: () => k.driver.back(),
|
|
650
653
|
onDragStart: () => {
|
|
651
|
-
|
|
654
|
+
wt.current?.settle(!1, 0), wt.current = ce(k.navigate, "POPPING");
|
|
652
655
|
},
|
|
653
656
|
onDragProgress: (e) => {
|
|
654
|
-
|
|
657
|
+
wt.current?.scrub(e);
|
|
655
658
|
},
|
|
656
659
|
onDragSettle: (e, t) => {
|
|
657
|
-
|
|
660
|
+
wt.current?.settle(e, t), wt.current = null;
|
|
658
661
|
}
|
|
659
662
|
});
|
|
660
|
-
let
|
|
661
|
-
(
|
|
663
|
+
let Y = Ct.current, Tt = (e) => Y.pointerDown(e.nativeEvent), Et = (e) => Y.pointerMove(e.nativeEvent), Dt = (e) => Y.pointerUp(e.nativeEvent), Ot = (e) => Y.pointerCancel(e.nativeEvent), kt = (e) => Y.lostPointerCapture(e.nativeEvent), At = (e) => {
|
|
664
|
+
(M === "PUSHING" || M === "REPLACING") && (e.preventDefault(), e.stopPropagation());
|
|
662
665
|
};
|
|
663
666
|
c(() => {
|
|
664
|
-
|
|
667
|
+
Te(W.current);
|
|
665
668
|
}, []), c(() => {
|
|
666
|
-
let e =
|
|
669
|
+
let e = W.current;
|
|
667
670
|
if (!e) return;
|
|
668
671
|
let t = (e) => {
|
|
669
|
-
|
|
672
|
+
Y.shouldPreventTouch() && e.preventDefault();
|
|
670
673
|
};
|
|
671
674
|
return e.addEventListener("touchmove", t, { passive: !1 }), () => {
|
|
672
|
-
e.removeEventListener("touchmove", t),
|
|
675
|
+
e.removeEventListener("touchmove", t), Y.abandon();
|
|
673
676
|
};
|
|
674
|
-
}, [
|
|
675
|
-
let { registerSharedBars: e, unregisterSharedBars: t } =
|
|
676
|
-
return e(
|
|
677
|
-
topBar:
|
|
678
|
-
bottomBar:
|
|
677
|
+
}, [Y]), f(() => {
|
|
678
|
+
let { registerSharedBars: e, unregisterSharedBars: t } = k.screen.getState(), n = ct.current, r = lt.current;
|
|
679
|
+
return e(C, {
|
|
680
|
+
topBar: L,
|
|
681
|
+
bottomBar: R
|
|
679
682
|
}, {
|
|
680
|
-
topBar:
|
|
683
|
+
topBar: L ? {
|
|
681
684
|
id: l,
|
|
682
|
-
height: n.key ===
|
|
685
|
+
height: n.key === B ? n.height : void 0
|
|
683
686
|
} : void 0,
|
|
684
|
-
bottomBar:
|
|
687
|
+
bottomBar: R ? {
|
|
685
688
|
id: d,
|
|
686
|
-
height: r.key ===
|
|
689
|
+
height: r.key === V ? r.height : void 0
|
|
687
690
|
} : void 0
|
|
688
|
-
}), () => t(
|
|
691
|
+
}), () => t(C);
|
|
689
692
|
}, [
|
|
690
|
-
U,
|
|
691
693
|
V,
|
|
692
|
-
|
|
693
|
-
|
|
694
|
+
R,
|
|
695
|
+
L,
|
|
696
|
+
C,
|
|
694
697
|
d,
|
|
695
698
|
l,
|
|
696
|
-
|
|
697
|
-
|
|
699
|
+
k.screen,
|
|
700
|
+
B
|
|
698
701
|
]), f(() => {
|
|
699
|
-
let e = gt.current;
|
|
700
|
-
if (e) return ke(e, _t);
|
|
701
|
-
}, [_t, B]), f(() => {
|
|
702
|
-
let e = J.current;
|
|
703
|
-
if (e) return ke(e, vt);
|
|
704
|
-
}, [vt, V]), f(() => {
|
|
705
|
-
let e = G.current;
|
|
706
|
-
if (e && !(!B && !V)) return Me(e);
|
|
707
|
-
}, [V, B]), f(() => {
|
|
708
702
|
let e = K.current;
|
|
703
|
+
if (e) return Fe(e, yt);
|
|
704
|
+
}, [yt, L]), f(() => {
|
|
705
|
+
let e = q.current;
|
|
706
|
+
if (e) return Fe(e, bt);
|
|
707
|
+
}, [bt, R]), f(() => {
|
|
708
|
+
let e = U.current;
|
|
709
|
+
if (e && !(!L && !R)) return Re(e);
|
|
710
|
+
}, [R, L]), f(() => {
|
|
711
|
+
let e = W.current;
|
|
709
712
|
if (!e) return;
|
|
710
|
-
let { registerScreenSurface: t, unregisterScreenSurface: n } =
|
|
711
|
-
return t(
|
|
713
|
+
let { registerScreenSurface: t, unregisterScreenSurface: n } = k.screen.getState();
|
|
714
|
+
return t(C, { opaqueBackground: Ae(getComputedStyle(e).backgroundColor) }), () => n(C);
|
|
712
715
|
}, [
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
716
|
+
C,
|
|
717
|
+
b,
|
|
718
|
+
M,
|
|
719
|
+
k.screen
|
|
717
720
|
]);
|
|
718
|
-
let
|
|
719
|
-
status:
|
|
720
|
-
isTopOrTopPrev:
|
|
721
|
-
hasTopBar:
|
|
722
|
-
hasNavBar:
|
|
721
|
+
let jt = j, { app: Mt, nav: Nt } = le({
|
|
722
|
+
status: M,
|
|
723
|
+
isTopOrTopPrev: jt,
|
|
724
|
+
hasTopBar: L,
|
|
725
|
+
hasNavBar: R,
|
|
723
726
|
topBarId: l,
|
|
724
727
|
bottomBarId: d,
|
|
725
|
-
partnerBars:
|
|
726
|
-
partnerMetadata:
|
|
727
|
-
}),
|
|
728
|
-
status:
|
|
729
|
-
isTopOrTopPrev:
|
|
730
|
-
transitionName:
|
|
731
|
-
}),
|
|
732
|
-
isActive:
|
|
733
|
-
isPrev:
|
|
734
|
-
zIndex:
|
|
735
|
-
index:
|
|
736
|
-
status:
|
|
737
|
-
dragStatus:
|
|
738
|
-
replaceTransitionStatus:
|
|
739
|
-
}),
|
|
740
|
-
|
|
741
|
-
let
|
|
742
|
-
key:
|
|
743
|
-
released:
|
|
728
|
+
partnerBars: ye,
|
|
729
|
+
partnerMetadata: xe
|
|
730
|
+
}), X = oe({
|
|
731
|
+
status: M,
|
|
732
|
+
isTopOrTopPrev: jt,
|
|
733
|
+
transitionName: D
|
|
734
|
+
}), Pt = ue({
|
|
735
|
+
isActive: w,
|
|
736
|
+
isPrev: de,
|
|
737
|
+
zIndex: E,
|
|
738
|
+
index: A,
|
|
739
|
+
status: M,
|
|
740
|
+
dragStatus: N,
|
|
741
|
+
replaceTransitionStatus: ge
|
|
742
|
+
}), Ft = m(Pt), It = m(X !== null && Pt), Lt = m(null), Rt = m(null), zt = m(!1);
|
|
743
|
+
X === null && (zt.current = !0);
|
|
744
|
+
let Ut = !zt.current, [Wt, Yt] = h({
|
|
745
|
+
key: X,
|
|
746
|
+
released: X === null
|
|
744
747
|
});
|
|
745
|
-
|
|
746
|
-
key:
|
|
747
|
-
released:
|
|
748
|
-
}),
|
|
749
|
-
let
|
|
750
|
-
|
|
751
|
-
let
|
|
752
|
-
zIndex:
|
|
753
|
-
paintHidden:
|
|
754
|
-
transitionName:
|
|
755
|
-
status:
|
|
756
|
-
isActive:
|
|
748
|
+
Wt.key !== X && (Yt({
|
|
749
|
+
key: X,
|
|
750
|
+
released: X === null
|
|
751
|
+
}), Lt.current = null, Rt.current = null, It.current = X !== null && Ft.current), Ft.current = Pt;
|
|
752
|
+
let Q = X !== null && Wt.key === X && !Wt.released && Lt.current !== X, $ = Q ? !w && Ce?.opaqueBackground ? g.PARK : w && (M === "PUSHING" || M === "REPLACING") && Ce?.opaqueBackground ? Ge().parkOver ? g.PARK_OVER : g.PARK_UNDER : g.HELD : g.RELEASED;
|
|
753
|
+
Rt.current !== X && ($ === g.PARK_OVER || $ === g.PARK) && (Rt.current = X);
|
|
754
|
+
let Xt = X !== null && Rt.current === X, Zt = {
|
|
755
|
+
zIndex: E,
|
|
756
|
+
paintHidden: ae,
|
|
757
|
+
transitionName: D,
|
|
758
|
+
status: M,
|
|
759
|
+
isActive: w,
|
|
757
760
|
animHold: $,
|
|
758
|
-
rendersHost: !
|
|
759
|
-
screenId:
|
|
760
|
-
registerSlot:
|
|
761
|
+
rendersHost: !He,
|
|
762
|
+
screenId: C,
|
|
763
|
+
registerSlot: nt
|
|
761
764
|
};
|
|
762
|
-
f(() =>
|
|
765
|
+
f(() => Oe.driveScreenLifecycle({
|
|
763
766
|
getElements: () => ({
|
|
764
|
-
scope:
|
|
765
|
-
decorator:
|
|
766
|
-
bars: [
|
|
767
|
-
screenContainer:
|
|
768
|
-
partLayer:
|
|
767
|
+
scope: W.current,
|
|
768
|
+
decorator: _t.current,
|
|
769
|
+
bars: [K.current, q.current],
|
|
770
|
+
screenContainer: U.current,
|
|
771
|
+
partLayer: We(k.navigate)
|
|
769
772
|
}),
|
|
770
|
-
transitionName:
|
|
771
|
-
prevTransitionName:
|
|
772
|
-
status:
|
|
773
|
-
isActive:
|
|
774
|
-
animHoldReleased: !
|
|
773
|
+
transitionName: D,
|
|
774
|
+
prevTransitionName: fe,
|
|
775
|
+
status: M,
|
|
776
|
+
isActive: w,
|
|
777
|
+
animHoldReleased: !Q
|
|
775
778
|
}), [
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
779
|
+
Oe,
|
|
780
|
+
M,
|
|
781
|
+
w,
|
|
782
|
+
fe,
|
|
783
|
+
D,
|
|
784
|
+
Q,
|
|
785
|
+
k.navigate
|
|
783
786
|
]), c(() => {
|
|
784
|
-
if (!
|
|
785
|
-
let e =
|
|
786
|
-
return
|
|
787
|
-
let t =
|
|
787
|
+
if (!Q || X === null) return;
|
|
788
|
+
let e = X, t = k.navigate.getState().transitionTaskId, n = t === null ? e : `${e}#${t}`;
|
|
789
|
+
return ke.current.join(n, () => {
|
|
790
|
+
let t = J.current.transition.driver === "native", n = Ge({ authoredNativeDriver: t }).atomicReleaseFlip;
|
|
788
791
|
if (n) {
|
|
789
792
|
for (let e of [
|
|
793
|
+
W.current,
|
|
790
794
|
K.current,
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
q.current
|
|
795
|
+
q.current,
|
|
796
|
+
_t.current
|
|
794
797
|
]) e?.isConnected && e.getAttribute(_) !== null && e.setAttribute(_, g.RELEASED);
|
|
795
|
-
|
|
798
|
+
U.current && (U.current.style.zIndex = String(E + 1)), Lt.current = e;
|
|
796
799
|
}
|
|
797
800
|
{
|
|
798
|
-
let t = () =>
|
|
801
|
+
let t = () => Yt((t) => t.key === e && !t.released ? {
|
|
799
802
|
key: e,
|
|
800
803
|
released: !0
|
|
801
804
|
} : t);
|
|
802
|
-
n &&
|
|
805
|
+
n && Ge().deferReleaseCommit && typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => t()) : tt(t);
|
|
803
806
|
}
|
|
804
807
|
}, {
|
|
805
|
-
scope:
|
|
806
|
-
decodeWait:
|
|
807
|
-
contentSettle:
|
|
808
|
+
scope: W.current,
|
|
809
|
+
decodeWait: It.current,
|
|
810
|
+
contentSettle: Ge().renderSettleGate && (w && M === "PUSHING" || M === "POPPING") ? {
|
|
808
811
|
firstWaitMs: 120,
|
|
809
812
|
capMs: 700,
|
|
810
|
-
graceMs:
|
|
811
|
-
minNodes:
|
|
813
|
+
graceMs: Ut ? 60 : 0,
|
|
814
|
+
minNodes: w ? 30 : 1,
|
|
812
815
|
renderSettleOnly: !0
|
|
813
816
|
} : void 0
|
|
814
817
|
});
|
|
815
818
|
}, [
|
|
816
|
-
|
|
817
|
-
|
|
819
|
+
Q,
|
|
820
|
+
X,
|
|
818
821
|
$,
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
822
|
+
w,
|
|
823
|
+
Ut,
|
|
824
|
+
M,
|
|
825
|
+
k.navigate,
|
|
826
|
+
E
|
|
824
827
|
]);
|
|
825
|
-
let
|
|
826
|
-
initial:
|
|
827
|
-
isActive:
|
|
828
|
-
status:
|
|
828
|
+
let Qt = $ === g.PARK_UNDER || $ === g.PARK_OVER ? {} : De({
|
|
829
|
+
initial: Me,
|
|
830
|
+
isActive: w,
|
|
831
|
+
status: M
|
|
829
832
|
});
|
|
830
|
-
return /* @__PURE__ */
|
|
831
|
-
ref:
|
|
832
|
-
onClickCapture:
|
|
833
|
+
return /* @__PURE__ */ $e("div", {
|
|
834
|
+
ref: U,
|
|
835
|
+
onClickCapture: At,
|
|
833
836
|
style: {
|
|
834
|
-
position:
|
|
837
|
+
position: O,
|
|
835
838
|
top: 0,
|
|
836
839
|
left: 0,
|
|
837
840
|
width: "100%",
|
|
838
841
|
height: "100%",
|
|
839
842
|
display: "flex",
|
|
840
|
-
visibility:
|
|
841
|
-
zIndex: $ === g.PARK_UNDER ?
|
|
843
|
+
visibility: ae ? "hidden" : void 0,
|
|
844
|
+
zIndex: $ === g.PARK_UNDER ? E - 1 : E + 1,
|
|
842
845
|
isolation: "isolate",
|
|
843
846
|
contain: "style",
|
|
844
847
|
flexDirection: "column",
|
|
@@ -846,83 +849,83 @@ function Bt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
846
849
|
overscrollBehavior: "contain"
|
|
847
850
|
},
|
|
848
851
|
children: [
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
ref:
|
|
851
|
-
...
|
|
852
|
-
onPointerDown:
|
|
853
|
-
onPointerMove:
|
|
854
|
-
onPointerUp:
|
|
855
|
-
onPointerCancel:
|
|
856
|
-
onLostPointerCapture:
|
|
857
|
-
"data-flemo-screen":
|
|
858
|
-
"data-flemo-router":
|
|
859
|
-
"data-flemo-transition":
|
|
860
|
-
"data-flemo-status":
|
|
861
|
-
"data-flemo-active":
|
|
852
|
+
/* @__PURE__ */ $e("div", {
|
|
853
|
+
ref: W,
|
|
854
|
+
...se,
|
|
855
|
+
onPointerDown: Tt,
|
|
856
|
+
onPointerMove: Et,
|
|
857
|
+
onPointerUp: Dt,
|
|
858
|
+
onPointerCancel: Ot,
|
|
859
|
+
onLostPointerCapture: kt,
|
|
860
|
+
"data-flemo-screen": C,
|
|
861
|
+
"data-flemo-router": me ?? void 0,
|
|
862
|
+
"data-flemo-transition": D,
|
|
863
|
+
"data-flemo-status": M,
|
|
864
|
+
"data-flemo-active": w ? "true" : "false",
|
|
862
865
|
"data-flemo-anim-hold": $,
|
|
863
|
-
"data-flemo-park-head":
|
|
866
|
+
"data-flemo-park-head": Xt ? "true" : void 0,
|
|
864
867
|
style: {
|
|
865
868
|
display: "flex",
|
|
866
869
|
flexDirection: "column",
|
|
867
870
|
height: "100%",
|
|
868
|
-
backgroundColor:
|
|
869
|
-
overflowY:
|
|
870
|
-
touchAction:
|
|
871
|
-
...
|
|
872
|
-
...
|
|
871
|
+
backgroundColor: b,
|
|
872
|
+
overflowY: re ? void 0 : "auto",
|
|
873
|
+
touchAction: Pe === "x" ? "pan-y" : Pe === "y" ? "pan-x" : "auto",
|
|
874
|
+
...Qt,
|
|
875
|
+
...se.style
|
|
873
876
|
},
|
|
874
877
|
children: [
|
|
875
|
-
!
|
|
878
|
+
!v && t && /* @__PURE__ */ F("div", {
|
|
876
879
|
style: { minHeight: t },
|
|
877
|
-
children: /* @__PURE__ */
|
|
878
|
-
position:
|
|
880
|
+
children: /* @__PURE__ */ F("div", { style: {
|
|
881
|
+
position: O,
|
|
879
882
|
top: 0,
|
|
880
883
|
width: "100%",
|
|
881
884
|
minHeight: t,
|
|
882
885
|
backgroundColor: n
|
|
883
886
|
} })
|
|
884
887
|
}),
|
|
885
|
-
a && /* @__PURE__ */
|
|
886
|
-
ref:
|
|
888
|
+
a && /* @__PURE__ */ F("div", {
|
|
889
|
+
ref: vt,
|
|
887
890
|
"data-flemo-bar-spacer": "app",
|
|
888
891
|
style: {
|
|
889
892
|
width: "100%",
|
|
890
|
-
minHeight:
|
|
893
|
+
minHeight: ht
|
|
891
894
|
}
|
|
892
895
|
}),
|
|
893
896
|
p,
|
|
894
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ F("div", {
|
|
895
898
|
style: {
|
|
896
899
|
display: "flex",
|
|
897
900
|
flexDirection: "column",
|
|
898
901
|
flexGrow: 1,
|
|
899
|
-
overflowY:
|
|
902
|
+
overflowY: re ? "auto" : void 0
|
|
900
903
|
},
|
|
901
|
-
children: /* @__PURE__ */
|
|
902
|
-
value:
|
|
903
|
-
children: /* @__PURE__ */
|
|
904
|
-
value:
|
|
904
|
+
children: /* @__PURE__ */ F(Bt.Provider, {
|
|
905
|
+
value: Ue,
|
|
906
|
+
children: /* @__PURE__ */ F(Ht.Provider, {
|
|
907
|
+
value: Zt,
|
|
905
908
|
children: e
|
|
906
909
|
})
|
|
907
910
|
})
|
|
908
911
|
}),
|
|
909
|
-
|
|
910
|
-
u && /* @__PURE__ */
|
|
911
|
-
ref:
|
|
912
|
+
ee,
|
|
913
|
+
u && /* @__PURE__ */ F("div", {
|
|
914
|
+
ref: G,
|
|
912
915
|
"data-flemo-bar-spacer": "nav",
|
|
913
916
|
style: {
|
|
914
|
-
display:
|
|
917
|
+
display: ze ? "none" : void 0,
|
|
915
918
|
width: "100%",
|
|
916
|
-
minHeight:
|
|
919
|
+
minHeight: gt
|
|
917
920
|
}
|
|
918
921
|
}),
|
|
919
|
-
!
|
|
922
|
+
!y && r && /* @__PURE__ */ F("div", {
|
|
920
923
|
style: {
|
|
921
|
-
display:
|
|
924
|
+
display: ze ? "none" : void 0,
|
|
922
925
|
minHeight: r
|
|
923
926
|
},
|
|
924
|
-
children: /* @__PURE__ */
|
|
925
|
-
position:
|
|
927
|
+
children: /* @__PURE__ */ F("div", { style: {
|
|
928
|
+
position: O,
|
|
926
929
|
bottom: 0,
|
|
927
930
|
width: "100%",
|
|
928
931
|
minHeight: r,
|
|
@@ -931,66 +934,66 @@ function Bt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
931
934
|
})
|
|
932
935
|
]
|
|
933
936
|
}),
|
|
934
|
-
a && /* @__PURE__ */
|
|
935
|
-
ref:
|
|
937
|
+
a && /* @__PURE__ */ F("div", {
|
|
938
|
+
ref: xt,
|
|
936
939
|
"data-flemo-bar": "app",
|
|
937
940
|
"data-flemo-bar-id": l,
|
|
938
941
|
"data-flemo-bar-id-type": l === void 0 ? void 0 : typeof l,
|
|
939
|
-
"data-flemo-router":
|
|
940
|
-
"data-flemo-bar-transition":
|
|
941
|
-
"data-flemo-bar-status":
|
|
942
|
-
"data-flemo-bar-active":
|
|
943
|
-
"data-flemo-bar-riding":
|
|
942
|
+
"data-flemo-router": me ?? void 0,
|
|
943
|
+
"data-flemo-bar-transition": D,
|
|
944
|
+
"data-flemo-bar-status": M,
|
|
945
|
+
"data-flemo-bar-active": w ? "true" : "false",
|
|
946
|
+
"data-flemo-bar-riding": Mt ? "true" : "false",
|
|
944
947
|
"data-flemo-anim-hold": $,
|
|
945
948
|
style: {
|
|
946
|
-
position:
|
|
947
|
-
top:
|
|
949
|
+
position: O,
|
|
950
|
+
top: v ? 0 : t,
|
|
948
951
|
left: 0,
|
|
949
952
|
width: "100%"
|
|
950
953
|
},
|
|
951
954
|
children: a
|
|
952
955
|
}),
|
|
953
|
-
u && /* @__PURE__ */
|
|
954
|
-
ref:
|
|
956
|
+
u && /* @__PURE__ */ F("div", {
|
|
957
|
+
ref: St,
|
|
955
958
|
"data-flemo-bar": "nav",
|
|
956
959
|
"data-flemo-bar-id": d,
|
|
957
960
|
"data-flemo-bar-id-type": d === void 0 ? void 0 : typeof d,
|
|
958
|
-
"data-flemo-router":
|
|
959
|
-
"data-flemo-bar-transition":
|
|
960
|
-
"data-flemo-bar-status":
|
|
961
|
-
"data-flemo-bar-active":
|
|
962
|
-
"data-flemo-bar-riding":
|
|
961
|
+
"data-flemo-router": me ?? void 0,
|
|
962
|
+
"data-flemo-bar-transition": D,
|
|
963
|
+
"data-flemo-bar-status": M,
|
|
964
|
+
"data-flemo-bar-active": w ? "true" : "false",
|
|
965
|
+
"data-flemo-bar-riding": Nt ? "true" : "false",
|
|
963
966
|
"data-flemo-anim-hold": $,
|
|
964
967
|
style: {
|
|
965
|
-
display:
|
|
966
|
-
position:
|
|
967
|
-
bottom:
|
|
968
|
+
display: ze ? "none" : void 0,
|
|
969
|
+
position: O,
|
|
970
|
+
bottom: y ? 0 : r,
|
|
968
971
|
left: 0,
|
|
969
972
|
width: "100%"
|
|
970
973
|
},
|
|
971
974
|
children: u
|
|
972
975
|
}),
|
|
973
|
-
|
|
974
|
-
ref:
|
|
976
|
+
Ie && !Qe && /* @__PURE__ */ F(qt, {
|
|
977
|
+
ref: _t,
|
|
975
978
|
"data-flemo-anim-hold": $
|
|
976
979
|
}),
|
|
977
|
-
|
|
978
|
-
ref:
|
|
980
|
+
Ie && Qe && Ue ? et(/* @__PURE__ */ F(qt, {
|
|
981
|
+
ref: _t,
|
|
979
982
|
"data-flemo-anim-hold": $,
|
|
980
|
-
style: { zIndex:
|
|
981
|
-
}),
|
|
982
|
-
!
|
|
983
|
-
ref:
|
|
984
|
-
[
|
|
985
|
-
[
|
|
986
|
-
[
|
|
987
|
-
[
|
|
983
|
+
style: { zIndex: E * 2 + 1 }
|
|
984
|
+
}), Ue) : null,
|
|
985
|
+
!He && /* @__PURE__ */ F("div", {
|
|
986
|
+
ref: Ve,
|
|
987
|
+
[ne]: "",
|
|
988
|
+
[ie]: D,
|
|
989
|
+
[S]: M,
|
|
990
|
+
[te]: w ? "true" : "false",
|
|
988
991
|
[_]: $,
|
|
989
992
|
style: {
|
|
990
993
|
position: "absolute",
|
|
991
994
|
inset: 0,
|
|
992
995
|
pointerEvents: "none",
|
|
993
|
-
zIndex:
|
|
996
|
+
zIndex: x
|
|
994
997
|
}
|
|
995
998
|
})
|
|
996
999
|
]
|
|
@@ -998,8 +1001,8 @@ function Bt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
998
1001
|
}
|
|
999
1002
|
//#endregion
|
|
1000
1003
|
//#region src/screen/Screen.tsx
|
|
1001
|
-
function
|
|
1002
|
-
let { isActive: n, isPrev: r, zIndex: i } = z(), a =
|
|
1004
|
+
function Q({ children: e, ...t }) {
|
|
1005
|
+
let { isActive: n, isPrev: r, zIndex: i } = z(), a = H((e) => e.index), o = Kt((e) => e.status), s = Z((e) => e.dragStatus), l = Z((e) => e.replaceTransitionStatus), u = T({
|
|
1003
1006
|
isActive: n,
|
|
1004
1007
|
isPrev: r,
|
|
1005
1008
|
zIndex: i,
|
|
@@ -1010,24 +1013,24 @@ function Vt({ children: e, ...t }) {
|
|
|
1010
1013
|
}), [d, f] = h(u !== "live");
|
|
1011
1014
|
return u === "live" && d && f(!1), u === "immediate" && !d && f(!0), c(() => {
|
|
1012
1015
|
if (u !== "deferred" || d) return;
|
|
1013
|
-
let e = setTimeout(() => f(!0),
|
|
1016
|
+
let e = setTimeout(() => f(!0), $);
|
|
1014
1017
|
return () => clearTimeout(e);
|
|
1015
|
-
}, [u, d]), /* @__PURE__ */
|
|
1018
|
+
}, [u, d]), /* @__PURE__ */ F(zt, {
|
|
1016
1019
|
freeze: d,
|
|
1017
1020
|
mode: u,
|
|
1018
|
-
children: /* @__PURE__ */
|
|
1021
|
+
children: /* @__PURE__ */ F(Yt, {
|
|
1019
1022
|
paintHidden: d,
|
|
1020
1023
|
...t,
|
|
1021
1024
|
children: e
|
|
1022
1025
|
})
|
|
1023
1026
|
});
|
|
1024
1027
|
}
|
|
1025
|
-
var
|
|
1028
|
+
var $ = 600;
|
|
1026
1029
|
//#endregion
|
|
1027
1030
|
//#region src/screen/Part.tsx
|
|
1028
|
-
function
|
|
1029
|
-
let { isActive: a, isPrev: o, navigateStore: c, routerId: l, transitionName: u } = z(), d = s(
|
|
1030
|
-
return /* @__PURE__ */
|
|
1031
|
+
function Xt({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
1032
|
+
let { isActive: a, isPrev: o, navigateStore: c, routerId: l, transitionName: u } = z(), d = s(st), f = l ?? d ?? void 0, p = I(), m = ot(c ?? p.navigate, (e) => o ? "COMPLETED" : e.status);
|
|
1033
|
+
return /* @__PURE__ */ F("div", {
|
|
1031
1034
|
ref: e,
|
|
1032
1035
|
"data-flemo-part-name": t,
|
|
1033
1036
|
"data-flemo-transition": u,
|
|
@@ -1041,16 +1044,16 @@ function Ut({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
|
1041
1044
|
}
|
|
1042
1045
|
//#endregion
|
|
1043
1046
|
//#region src/screen/Layer.tsx
|
|
1044
|
-
function
|
|
1045
|
-
let t =
|
|
1046
|
-
return !t || !n ? null :
|
|
1047
|
+
function Zt({ children: e }) {
|
|
1048
|
+
let t = Vt(), n = Ut();
|
|
1049
|
+
return !t || !n ? null : et(/* @__PURE__ */ F("div", {
|
|
1047
1050
|
ref: n.registerSlot,
|
|
1048
|
-
[
|
|
1049
|
-
[
|
|
1051
|
+
[re]: "",
|
|
1052
|
+
[b]: n.screenId,
|
|
1050
1053
|
...n.rendersHost ? {} : {
|
|
1051
|
-
[
|
|
1052
|
-
[
|
|
1053
|
-
[
|
|
1054
|
+
[ie]: n.transitionName,
|
|
1055
|
+
[S]: n.status,
|
|
1056
|
+
[te]: n.isActive ? "true" : "false",
|
|
1054
1057
|
[_]: n.animHold
|
|
1055
1058
|
},
|
|
1056
1059
|
style: {
|
|
@@ -1060,7 +1063,7 @@ function Wt({ children: e }) {
|
|
|
1060
1063
|
zIndex: n.zIndex * 2,
|
|
1061
1064
|
visibility: n.paintHidden ? "hidden" : void 0
|
|
1062
1065
|
},
|
|
1063
|
-
children: /* @__PURE__ */
|
|
1066
|
+
children: /* @__PURE__ */ F("div", {
|
|
1064
1067
|
style: {
|
|
1065
1068
|
display: "contents",
|
|
1066
1069
|
pointerEvents: "auto"
|
|
@@ -1071,18 +1074,18 @@ function Wt({ children: e }) {
|
|
|
1071
1074
|
}
|
|
1072
1075
|
//#endregion
|
|
1073
1076
|
//#region src/screen/Morph.tsx
|
|
1074
|
-
function
|
|
1075
|
-
let { isActive: u, isPrev: d, navigateStore: p, routerId: h, transitionName: ee } = z(),
|
|
1077
|
+
function Qt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: c, ...l }) {
|
|
1078
|
+
let { isActive: u, isPrev: d, navigateStore: p, routerId: h, transitionName: ee } = z(), te = s(st), g = I(), _ = p ?? g.navigate, v = ot(_, (e) => d ? "COMPLETED" : e.status), y = m(null), ne = o((t) => {
|
|
1076
1079
|
y.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
|
|
1077
1080
|
}, [e]), b = !!p;
|
|
1078
1081
|
return f(() => {
|
|
1079
1082
|
let e = y.current;
|
|
1080
|
-
if (e) return
|
|
1083
|
+
if (e) return C(e, {
|
|
1081
1084
|
layoutId: t,
|
|
1082
1085
|
name: n,
|
|
1083
|
-
navigateStore:
|
|
1086
|
+
navigateStore: _,
|
|
1084
1087
|
ownership: b ? {
|
|
1085
|
-
status:
|
|
1088
|
+
status: v,
|
|
1086
1089
|
active: u
|
|
1087
1090
|
} : null
|
|
1088
1091
|
});
|
|
@@ -1090,8 +1093,8 @@ function Gt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: c
|
|
|
1090
1093
|
t,
|
|
1091
1094
|
n,
|
|
1092
1095
|
b,
|
|
1096
|
+
_,
|
|
1093
1097
|
v,
|
|
1094
|
-
te,
|
|
1095
1098
|
u
|
|
1096
1099
|
]), i(r, {
|
|
1097
1100
|
"data-flemo-morph-slot": "",
|
|
@@ -1102,7 +1105,7 @@ function Gt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: c
|
|
|
1102
1105
|
"data-flemo-morph-name": n,
|
|
1103
1106
|
...b ? {
|
|
1104
1107
|
"data-flemo-transition": ee,
|
|
1105
|
-
"data-flemo-router": h ??
|
|
1108
|
+
"data-flemo-router": h ?? te ?? void 0
|
|
1106
1109
|
} : null,
|
|
1107
1110
|
style: a,
|
|
1108
1111
|
...l
|
|
@@ -1110,22 +1113,22 @@ function Gt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: c
|
|
|
1110
1113
|
}
|
|
1111
1114
|
//#endregion
|
|
1112
1115
|
//#region src/stores/RouterScopeProvider.tsx
|
|
1113
|
-
function
|
|
1116
|
+
function $t({ children: e }) {
|
|
1114
1117
|
let [t] = h(() => ({
|
|
1115
1118
|
history: O(),
|
|
1116
|
-
navigate:
|
|
1117
|
-
transition:
|
|
1118
|
-
screen:
|
|
1119
|
-
driver:
|
|
1119
|
+
navigate: me(),
|
|
1120
|
+
transition: Ce(),
|
|
1121
|
+
screen: P(),
|
|
1122
|
+
driver: fe(),
|
|
1120
1123
|
memory: !1,
|
|
1121
|
-
markSelfInduced:
|
|
1122
|
-
consume:
|
|
1124
|
+
markSelfInduced: Me,
|
|
1125
|
+
consume: de,
|
|
1123
1126
|
life: { alive: !0 }
|
|
1124
1127
|
}));
|
|
1125
|
-
return /* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ F(nt.Provider, {
|
|
1126
1129
|
value: t,
|
|
1127
1130
|
children: e
|
|
1128
1131
|
});
|
|
1129
1132
|
}
|
|
1130
1133
|
//#endregion
|
|
1131
|
-
export {
|
|
1134
|
+
export { v as DEFAULT_COMMIT_FRACTION, y as DEFAULT_COMMIT_VELOCITY, Zt as Layer, Qt as Morph, Xt as Part, Nt as Route, Mt as Router, $t as RouterScopeProvider, Q as Screen, R as ScreenContext, qt as ScreenDecorator, zt as ScreenFreeze, Yt as ScreenMotion, St as Slot, D as createBrowserHistoryDriver, pe as createDecorator, k as createMorphTransition, he as createPartTransition, j as createRawDecorator, M as createRawMorphTransition, N as createRawPartTransition, ge as createRawTransition, xe as createTransition, Pe as morphTransitionMap, Le as partTransitionMap, H as useHistoryStore, Pt as useNavigate, Kt as useNavigateStore, Lt as useParams, Ft as usePathname, z as useScreen, Z as useScreenStore, It as useStep, I as useStores, Jt as useViewportScrollHeight };
|