@flemo/react 1.11.0 → 1.12.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/Router.d.ts +3 -1
- package/dist/RouterScopeContext.d.ts +12 -0
- package/dist/RouterTarget.d.ts +24 -0
- package/dist/__tests__/RouterTarget.test.d.ts +9 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +478 -335
- package/dist/navigate/__tests__/useNavigate.routerTarget.test.d.ts +22 -0
- package/dist/navigate/useNavigate.d.ts +10 -5
- package/dist/screen/__tests__/ScreenMotion.hydration.test.d.ts +1 -0
- package/dist/utils/devDiagnostics.d.ts +3 -0
- package/dist/utils/useHydrationSafeFlag.d.ts +1 -0
- 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, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useId as c, useImperativeHandle as l, useInsertionEffect as u, useLayoutEffect as d, useReducer as f, useRef as p, useState as m } from "react";
|
|
2
|
-
import { animHoldKey as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { flushSync as
|
|
1
|
+
import e, { Activity as t, Children as n, createContext as r, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useId as c, useImperativeHandle as l, useInsertionEffect as u, useLayoutEffect as d, useReducer as f, useRef as p, useState as m, useSyncExternalStore as ee } from "react";
|
|
2
|
+
import { animHoldKey as te, appendParamsQuery as ne, buildRoutePath as re, computeBarRiding as ie, computeScreenFreeze as ae, computeScreenFreezeMode as oe, consumeSelfInducedPop as se, createAnimHoldCoordinator as h, createBrowserHistoryDriver as g, createBrowserHistoryDriver as _, createDecorator as v, createHistoryStore as y, createNavigateStore as ce, createNavigationController as b, createPartTransition as x, createRawDecorator as le, createRawPartTransition as S, createRawTransition as C, createRouterScope as w, createScreenSelector as T, createScreenStore as E, createStepController as D, createSwipeController as ue, createTransition as O, createTransitionEngine as de, createTransitionStore as k, decoratorMap as fe, detectBlinkEngine as A, eagerlyDecodeImages as pe, ensureGpuPipelinePrewarm as me, ensureImageDecodeOffloader as he, ensureScopeHistorySync as j, enteringInitialStyle as ge, getMatchedPathPattern as _e, governedCompiledActive as ve, holdCompositorWarm as M, isLegacyAndroidBlink as ye, isOpaqueColor as be, isServer as N, markSelfInducedPop as xe, matchesPathname as Se, observeBarHeight as Ce, observeViewportScrollHeight as we, partTransitionMap as Te, readImageOffloadOverride as Ee, readLayerPromotionFlag as De, readPrerasterFlag as Oe, readSettleGateFlag as ke, readStepParams as Ae, registerTransitionDefinitions as je, releaseScopeHistorySync as Me, resolveTransition as Ne, seedRouterEntry as Pe, sharedBarsMatch as Fe, steadySixtyPlayerEligible as Ie, subscribeStepParamsRestore as Le } from "@flemo/core";
|
|
3
|
+
import { jsx as P, jsxs as Re } from "react/jsx-runtime";
|
|
4
|
+
import { flushSync as ze } from "react-dom";
|
|
5
5
|
//#region src/stores/StoreContext.ts
|
|
6
|
-
var
|
|
6
|
+
var F = r(null);
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/stores/useStores.ts
|
|
9
|
-
function
|
|
10
|
-
let e = o(
|
|
9
|
+
function I() {
|
|
10
|
+
let e = o(F);
|
|
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 s(() => (
|
|
16
|
+
function L() {
|
|
17
|
+
let e = I();
|
|
18
|
+
return s(() => (j(e), () => Me(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,15 +34,15 @@ var I = r({
|
|
|
34
34
|
});
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/screen/useScreen.ts
|
|
37
|
-
function
|
|
38
|
-
return o(
|
|
37
|
+
function z() {
|
|
38
|
+
return o(R);
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/screen/ParamsProvider/ParamsContext.ts
|
|
42
|
-
var
|
|
42
|
+
var B = r({}), Be = r(() => {});
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/screen/ParamsProvider/ParamsReducer.ts
|
|
45
|
-
function
|
|
45
|
+
function Ve(e, t) {
|
|
46
46
|
switch (t.type) {
|
|
47
47
|
case "SET": return t.params;
|
|
48
48
|
default: return e;
|
|
@@ -50,10 +50,10 @@ function B(e, t) {
|
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/screen/ParamsProvider/ParamsProvider.tsx
|
|
53
|
-
function
|
|
54
|
-
let { isActive: t, params: n } =
|
|
53
|
+
function He({ children: e }) {
|
|
54
|
+
let { isActive: t, params: n } = z(), { driver: r } = I(), [i, a] = f(Ve, n);
|
|
55
55
|
return s(() => {
|
|
56
|
-
if (t) return
|
|
56
|
+
if (t) return Le(r, (e) => a({
|
|
57
57
|
type: "SET",
|
|
58
58
|
params: e
|
|
59
59
|
}));
|
|
@@ -61,9 +61,9 @@ function Be({ children: e }) {
|
|
|
61
61
|
t,
|
|
62
62
|
a,
|
|
63
63
|
r
|
|
64
|
-
]), /* @__PURE__ */
|
|
64
|
+
]), /* @__PURE__ */ P(Be.Provider, {
|
|
65
65
|
value: a,
|
|
66
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ P(B.Provider, {
|
|
67
67
|
value: i,
|
|
68
68
|
children: e
|
|
69
69
|
})
|
|
@@ -71,120 +71,220 @@ function Be({ children: e }) {
|
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../../node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.18_react@19.2.8/node_modules/zustand/esm/react.mjs
|
|
74
|
-
var
|
|
75
|
-
function V(t, n =
|
|
74
|
+
var Ue = (e) => e;
|
|
75
|
+
function V(t, n = Ue) {
|
|
76
76
|
let r = e.useSyncExternalStore(t.subscribe, e.useCallback(() => n(t.getState()), [t, n]), e.useCallback(() => n(t.getInitialState()), [t, n]));
|
|
77
77
|
return e.useDebugValue(r), r;
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/stores/useHistoryStore.ts
|
|
81
81
|
function H(e) {
|
|
82
|
-
return V(
|
|
82
|
+
return V(I().history, e);
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/RouterIdContext.ts
|
|
86
|
-
var
|
|
86
|
+
var We = r(null);
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/renderer/Renderer.tsx
|
|
89
|
-
function
|
|
90
|
-
let t = H((e) => e.index), r = H((e) => e.histories), i =
|
|
89
|
+
function Ge({ children: e }) {
|
|
90
|
+
let t = H((e) => e.index), r = H((e) => e.histories), i = I(), a = o(R), s = o(We);
|
|
91
91
|
return T(r, t).map((t) => {
|
|
92
|
-
let [r] = n.toArray(e).filter((e) =>
|
|
93
|
-
return r ? /* @__PURE__ */
|
|
92
|
+
let [r] = n.toArray(e).filter((e) => Se(e.props.path, t.pathname));
|
|
93
|
+
return r ? /* @__PURE__ */ P(R.Provider, {
|
|
94
94
|
value: {
|
|
95
95
|
...t,
|
|
96
96
|
isPrev: t.isPrev || a.isPrev,
|
|
97
97
|
navigateStore: i.navigate,
|
|
98
98
|
routerId: s ?? void 0,
|
|
99
|
-
routePath:
|
|
99
|
+
routePath: _e(r.props.path, t.pathname)
|
|
100
100
|
},
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ P(He, { children: r })
|
|
102
102
|
}, t.id) : null;
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/screen/ScreenViewportContext.ts
|
|
107
|
-
var
|
|
108
|
-
function
|
|
109
|
-
return o(
|
|
107
|
+
var Ke = r({ contained: !1 });
|
|
108
|
+
function qe() {
|
|
109
|
+
return o(Ke);
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/transition/styles.ts
|
|
113
|
-
function
|
|
114
|
-
u(() =>
|
|
113
|
+
function Je(e, t, n = []) {
|
|
114
|
+
u(() => je(e, t, n), [
|
|
115
115
|
e,
|
|
116
116
|
t,
|
|
117
117
|
n
|
|
118
118
|
]);
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
|
+
//#region src/utils/devDiagnostics.ts
|
|
122
|
+
function Ye() {
|
|
123
|
+
return typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
124
|
+
}
|
|
125
|
+
function Xe(e) {
|
|
126
|
+
!Ye() || typeof console > "u" || console.error(`[flemo] ${e}`);
|
|
127
|
+
}
|
|
128
|
+
function Ze(e) {
|
|
129
|
+
if (Ye()) throw Error(`[flemo] ${e}`);
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
121
132
|
//#region src/RouterDepthContext.ts
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
133
|
+
var Qe = r(0), U = r(null), W = [
|
|
134
|
+
"current",
|
|
135
|
+
"parent",
|
|
136
|
+
"root",
|
|
137
|
+
"nearest-owner"
|
|
138
|
+
], $e = (e) => W.includes(e), G = (e) => {
|
|
139
|
+
let t = [];
|
|
140
|
+
for (let n = e; n; n = n.parent) t.push(n);
|
|
141
|
+
return t;
|
|
142
|
+
};
|
|
143
|
+
function et(e, t, n) {
|
|
144
|
+
return e.routePaths.length === 0 || e.routePaths.some((e) => e === t) ? !0 : n ? Se(e.routePaths, n) : !1;
|
|
145
|
+
}
|
|
146
|
+
function K(e) {
|
|
147
|
+
return G(e).map((e, t) => {
|
|
148
|
+
let n = t === 0 ? "current" : `${t} level(s) up`;
|
|
149
|
+
return e.name ? `"${e.name}" (${n})` : `<unnamed> (${n})`;
|
|
150
|
+
}).join(", ");
|
|
151
|
+
}
|
|
152
|
+
function q({ from: e, target: t, path: n, pathname: r }) {
|
|
153
|
+
if (t === void 0) return {
|
|
154
|
+
node: e,
|
|
155
|
+
message: null
|
|
156
|
+
};
|
|
157
|
+
let i = null, a = null;
|
|
158
|
+
if (typeof t == "string" ? $e(t) ? i = t : a = t : "scope" in t ? i = t.scope : a = t.name, a !== null) {
|
|
159
|
+
let t = G(e).find((e) => e.name === a);
|
|
160
|
+
return t ? {
|
|
161
|
+
node: t,
|
|
162
|
+
message: null
|
|
163
|
+
} : {
|
|
164
|
+
node: null,
|
|
165
|
+
message: `no <Router name="${a}"> encloses this call. Routers in scope: ${K(e)}.`
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
switch (i) {
|
|
169
|
+
case "parent": return e.parent ? {
|
|
170
|
+
node: e.parent,
|
|
171
|
+
message: null
|
|
172
|
+
} : {
|
|
173
|
+
node: null,
|
|
174
|
+
message: "router: \"parent\" was requested, but the enclosing <Router> is the outermost one (it has no parent Router)."
|
|
175
|
+
};
|
|
176
|
+
case "root": {
|
|
177
|
+
let t = G(e);
|
|
178
|
+
return {
|
|
179
|
+
node: t[t.length - 1],
|
|
180
|
+
message: null
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
case "nearest-owner": {
|
|
184
|
+
if (!n) return {
|
|
185
|
+
node: e,
|
|
186
|
+
message: "router: \"nearest-owner\" needs a route to search for, and pop() carries none. Falling back to \"current\" — name the Router explicitly for a cross-Router pop."
|
|
187
|
+
};
|
|
188
|
+
let t = G(e).find((e) => et(e, n, r));
|
|
189
|
+
return t ? {
|
|
190
|
+
node: t,
|
|
191
|
+
message: null
|
|
192
|
+
} : {
|
|
193
|
+
node: null,
|
|
194
|
+
message: `no <Router> in scope declares a <Route path="${n}">. Routers in scope: ${K(e)}.`
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
default: return {
|
|
198
|
+
node: e,
|
|
199
|
+
message: null
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function tt(e) {
|
|
204
|
+
if (!e.name) return null;
|
|
205
|
+
for (let t = e.parent; t; t = t.parent) if (t.name === e.name) return t;
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/Slot.tsx
|
|
210
|
+
var nt = { contained: !0 };
|
|
211
|
+
function rt({ children: e, className: t, style: n }) {
|
|
212
|
+
return /* @__PURE__ */ P("div", {
|
|
125
213
|
className: t,
|
|
126
214
|
style: {
|
|
127
215
|
position: "relative",
|
|
128
216
|
overflow: "hidden",
|
|
129
217
|
...n
|
|
130
218
|
},
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
-
value:
|
|
133
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ P(Ke.Provider, {
|
|
220
|
+
value: nt,
|
|
221
|
+
children: /* @__PURE__ */ P(Ge, { children: e })
|
|
134
222
|
})
|
|
135
223
|
});
|
|
136
224
|
}
|
|
137
225
|
//#endregion
|
|
138
226
|
//#region src/Router.tsx
|
|
139
|
-
function
|
|
227
|
+
function it(e) {
|
|
140
228
|
let t = null;
|
|
141
229
|
return n.forEach(e, (e) => {
|
|
142
230
|
if (t || !i(e)) return;
|
|
143
|
-
if (e.type ===
|
|
231
|
+
if (e.type === rt) {
|
|
144
232
|
t = n.toArray(e.props.children).filter(i);
|
|
145
233
|
return;
|
|
146
234
|
}
|
|
147
235
|
let r = e.props.children;
|
|
148
236
|
if (r) {
|
|
149
|
-
let e =
|
|
237
|
+
let e = it(r);
|
|
150
238
|
e && (t = e);
|
|
151
239
|
}
|
|
152
240
|
}), t;
|
|
153
241
|
}
|
|
154
|
-
var
|
|
155
|
-
function
|
|
156
|
-
let
|
|
157
|
-
s(() =>
|
|
158
|
-
let
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
});
|
|
242
|
+
var J = typeof window > "u" ? s : d, at = typeof window > "u" ? s : u, Y = [], ot = [], st = [], ct = { contained: !0 }, lt = 500, ut = 3e3;
|
|
243
|
+
function dt({ children: e, name: t, strictRoutes: r = !1, initPath: a = "/", defaultTransitionName: l = "cupertino", transitions: u = Y, decorators: d = ot, partTransitions: f = st, history: p = "browser", createDriver: ee, className: te, style: ne }) {
|
|
244
|
+
let re = o(Qe), ie = c(), [ae, oe] = m(!1);
|
|
245
|
+
s(() => oe(!0), []);
|
|
246
|
+
let se = ae ? ie : null, h = re > 0, g = p === "memory", v = c(), y = o(R), ce = o(F), b = h && y.id ? `_F_${ce?.routerKey ?? ""}${y.id}_` : v, x = it(e), le = x !== null, S = (x ?? n.toArray(e).filter(i)).flatMap((e) => e.props?.path ? [e.props.path].flat() : []), C = h ? null : ce, T = C !== null, E = ee ?? _, [D] = m(() => g ? null : E(T ? void 0 : b)), ue = !h && !g && !N(), O = ue && D ? D.readPathname() : a || "/", de = O.indexOf("?"), k = (de >= 0 ? O.slice(0, de) : O) || "/", fe = ue ? window.location.search : de >= 0 ? O.slice(de) : "", [A] = m(() => w({
|
|
247
|
+
routePaths: S,
|
|
248
|
+
pathname: k,
|
|
249
|
+
search: fe,
|
|
250
|
+
defaultTransitionName: l,
|
|
251
|
+
memory: g,
|
|
252
|
+
browserDriver: D,
|
|
253
|
+
hostedScope: C,
|
|
254
|
+
routerKey: T ? void 0 : b,
|
|
255
|
+
zoneEntryId: h && !T && y.id || void 0,
|
|
256
|
+
persistKey: h && !g && !T ? b : void 0
|
|
257
|
+
}));
|
|
258
|
+
J(() => {
|
|
259
|
+
A.transition.getState().defaultTransitionName !== l && A.transition.setState({ defaultTransitionName: l });
|
|
172
260
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
261
|
+
let pe = o(U), [j] = m(() => ({
|
|
262
|
+
name: t,
|
|
263
|
+
stores: A,
|
|
264
|
+
routePaths: S,
|
|
265
|
+
strictRoutes: r,
|
|
266
|
+
parent: pe,
|
|
267
|
+
depth: re
|
|
268
|
+
}));
|
|
269
|
+
at(() => {
|
|
270
|
+
j.name = t, j.stores = A, j.routePaths = S, j.strictRoutes = r, j.parent = pe;
|
|
271
|
+
}), s(() => {
|
|
272
|
+
tt(j) && Xe(`duplicate <Router name="${j.name}">: an enclosing <Router> already uses that name, so \`router\` targets resolve to the nearer one. Give each nested Router a unique name.`);
|
|
273
|
+
}, [j, t]), J(() => (A.life.alive = !0, () => {
|
|
274
|
+
A.life.alive = !1;
|
|
275
|
+
}), [A]), Je(u, d, f), s(() => {
|
|
276
|
+
let e = Ee();
|
|
277
|
+
if (e !== "off") return e === "on" || ye() ? he() : void 0;
|
|
278
|
+
}, []), s(() => me(), []), s(() => {
|
|
179
279
|
if (typeof document > "u") return;
|
|
180
280
|
let e = null, t = null, n = 0, r = () => {
|
|
181
281
|
let r = Date.now();
|
|
182
|
-
if (r - n <
|
|
282
|
+
if (r - n < lt) return;
|
|
183
283
|
n = r, t && clearTimeout(t);
|
|
184
284
|
let i = e;
|
|
185
|
-
e =
|
|
285
|
+
e = M(), i?.(), t = setTimeout(() => {
|
|
186
286
|
t = null, e?.(), e = null;
|
|
187
|
-
},
|
|
287
|
+
}, ut);
|
|
188
288
|
}, i = [
|
|
189
289
|
"pointerdown",
|
|
190
290
|
"pointermove",
|
|
@@ -198,89 +298,126 @@ function G({ children: e, initPath: t = "/", defaultTransitionName: r = "cuperti
|
|
|
198
298
|
t && clearTimeout(t), e?.();
|
|
199
299
|
};
|
|
200
300
|
}, []), s(() => {
|
|
201
|
-
g || !
|
|
202
|
-
driver:
|
|
203
|
-
routerKey:
|
|
204
|
-
nested: h && !
|
|
205
|
-
seedPathname:
|
|
206
|
-
defaultTransitionName:
|
|
207
|
-
rootParams:
|
|
301
|
+
g || !D || Pe({
|
|
302
|
+
driver: D,
|
|
303
|
+
routerKey: T ? null : b,
|
|
304
|
+
nested: h && !T,
|
|
305
|
+
seedPathname: k,
|
|
306
|
+
defaultTransitionName: l,
|
|
307
|
+
rootParams: A.history.getState().histories[0]?.params ?? {}
|
|
208
308
|
});
|
|
209
309
|
}, [
|
|
210
310
|
g,
|
|
211
|
-
|
|
311
|
+
T,
|
|
212
312
|
h,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
313
|
+
b,
|
|
314
|
+
k,
|
|
315
|
+
l,
|
|
316
|
+
A.history,
|
|
317
|
+
D
|
|
218
318
|
]);
|
|
219
|
-
let
|
|
220
|
-
value:
|
|
221
|
-
children: /* @__PURE__ */
|
|
222
|
-
value:
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
value:
|
|
225
|
-
children:
|
|
226
|
-
value:
|
|
227
|
-
children:
|
|
228
|
-
|
|
319
|
+
let ge = le ? e : /* @__PURE__ */ P(Ge, { children: e }), _e = /* @__PURE__ */ P(We.Provider, {
|
|
320
|
+
value: se,
|
|
321
|
+
children: /* @__PURE__ */ P(Qe.Provider, {
|
|
322
|
+
value: re + 1,
|
|
323
|
+
children: /* @__PURE__ */ P(U.Provider, {
|
|
324
|
+
value: j,
|
|
325
|
+
children: /* @__PURE__ */ Re(F.Provider, {
|
|
326
|
+
value: A,
|
|
327
|
+
children: [!g && /* @__PURE__ */ P(L, {}), h ? /* @__PURE__ */ P(Ke.Provider, {
|
|
328
|
+
value: ct,
|
|
329
|
+
children: ge
|
|
330
|
+
}) : ge]
|
|
331
|
+
})
|
|
229
332
|
})
|
|
230
333
|
})
|
|
231
334
|
});
|
|
232
|
-
return h ? /* @__PURE__ */
|
|
233
|
-
className:
|
|
335
|
+
return h ? /* @__PURE__ */ P("div", {
|
|
336
|
+
className: te,
|
|
234
337
|
style: {
|
|
235
338
|
position: "relative",
|
|
236
339
|
overflow: "hidden",
|
|
237
|
-
...
|
|
340
|
+
...ne
|
|
238
341
|
},
|
|
239
|
-
children:
|
|
240
|
-
}) :
|
|
342
|
+
children: _e
|
|
343
|
+
}) : _e;
|
|
241
344
|
}
|
|
242
345
|
//#endregion
|
|
243
346
|
//#region src/Route.tsx
|
|
244
|
-
function
|
|
347
|
+
function ft({ element: e }) {
|
|
245
348
|
return e;
|
|
246
349
|
}
|
|
247
350
|
//#endregion
|
|
248
351
|
//#region src/utils/buildRoutePath.ts
|
|
249
|
-
function
|
|
250
|
-
return
|
|
352
|
+
function pt(e, t) {
|
|
353
|
+
return re(e, t);
|
|
251
354
|
}
|
|
252
355
|
//#endregion
|
|
253
356
|
//#region src/navigate/useNavigate.ts
|
|
254
|
-
function
|
|
255
|
-
let
|
|
256
|
-
stores:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
357
|
+
function X(e) {
|
|
358
|
+
let t = I(), n = o(U) ?? {
|
|
359
|
+
stores: t,
|
|
360
|
+
routePaths: [],
|
|
361
|
+
strictRoutes: !1,
|
|
362
|
+
parent: null,
|
|
363
|
+
depth: 0
|
|
364
|
+
}, r = (t, r, i) => {
|
|
365
|
+
let a = t ?? e?.router, o;
|
|
366
|
+
if (r) try {
|
|
367
|
+
o = pt(r, i).toPathname;
|
|
368
|
+
} catch {
|
|
369
|
+
o = void 0;
|
|
370
|
+
}
|
|
371
|
+
let { node: s, message: c } = q({
|
|
372
|
+
from: n,
|
|
373
|
+
target: a,
|
|
374
|
+
path: r,
|
|
375
|
+
pathname: o
|
|
376
|
+
});
|
|
377
|
+
if (!s) return Ze(c ?? "the requested Router could not be resolved."), null;
|
|
378
|
+
if (c && Xe(c), r && !et(s, r, o)) {
|
|
379
|
+
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"\`.`;
|
|
380
|
+
a !== void 0 || s.strictRoutes ? Ze(e) : Xe(e);
|
|
381
|
+
}
|
|
382
|
+
return b({
|
|
383
|
+
stores: s.stores,
|
|
384
|
+
buildPathname: (e, t) => pt(e, t),
|
|
385
|
+
driver: s.stores.driver,
|
|
386
|
+
markSelfInduced: s.stores.markSelfInduced
|
|
387
|
+
});
|
|
388
|
+
};
|
|
261
389
|
return {
|
|
262
|
-
push: (e,
|
|
263
|
-
|
|
264
|
-
|
|
390
|
+
push: (e, t, n) => {
|
|
391
|
+
let i = r(n?.router, e, t ?? {});
|
|
392
|
+
return i ? i.push(e, t ?? {}, n) : Promise.resolve();
|
|
393
|
+
},
|
|
394
|
+
replace: (e, t, n) => {
|
|
395
|
+
let i = r(n?.router, e, t ?? {});
|
|
396
|
+
return i ? i.replace(e, t ?? {}, n) : Promise.resolve();
|
|
397
|
+
},
|
|
398
|
+
pop: (e) => {
|
|
399
|
+
let t = r(e?.router);
|
|
400
|
+
return t ? t.pop(e) : Promise.resolve();
|
|
401
|
+
}
|
|
265
402
|
};
|
|
266
403
|
}
|
|
267
404
|
//#endregion
|
|
268
405
|
//#region src/navigate/usePathname.ts
|
|
269
|
-
function
|
|
406
|
+
function mt() {
|
|
270
407
|
return H((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
|
|
271
408
|
}
|
|
272
409
|
//#endregion
|
|
273
410
|
//#region src/navigate/useStep.ts
|
|
274
|
-
function
|
|
275
|
-
let { routePath: e } =
|
|
411
|
+
function ht() {
|
|
412
|
+
let { routePath: e } = z(), t = I(), n = o(Be), { driver: r, markSelfInduced: i } = t, [a, c] = m(null);
|
|
276
413
|
s(() => {
|
|
277
|
-
if (!e) return c(
|
|
414
|
+
if (!e) return c(Ae(r.readState())), r.subscribe((e) => c(Ae(e.state)));
|
|
278
415
|
}, [e, r]);
|
|
279
416
|
let l = D({
|
|
280
417
|
stores: t,
|
|
281
418
|
driver: r,
|
|
282
419
|
markSelfInduced: i,
|
|
283
|
-
buildStepPathname: (t) => e ?
|
|
420
|
+
buildStepPathname: (t) => e ? pt(e, t).pathname : ne(r.readPathname(), t),
|
|
284
421
|
applyParams: (t) => {
|
|
285
422
|
n({
|
|
286
423
|
type: "SET",
|
|
@@ -297,50 +434,50 @@ function it() {
|
|
|
297
434
|
}
|
|
298
435
|
//#endregion
|
|
299
436
|
//#region src/screen/ParamsProvider/useParams.ts
|
|
300
|
-
function
|
|
301
|
-
return o(
|
|
437
|
+
function gt() {
|
|
438
|
+
return o(B);
|
|
302
439
|
}
|
|
303
440
|
//#endregion
|
|
304
441
|
//#region src/screen/ScreenFreeze.tsx
|
|
305
|
-
var
|
|
306
|
-
function
|
|
442
|
+
var _t = 3e3;
|
|
443
|
+
function vt({ freeze: e, children: n }) {
|
|
307
444
|
let [r, i] = m(e), a = p(null);
|
|
308
445
|
return !e && r && i(!1), s(() => {
|
|
309
446
|
if (!(!e || r)) {
|
|
310
|
-
if (!
|
|
447
|
+
if (!Ie()) {
|
|
311
448
|
i(!0);
|
|
312
449
|
return;
|
|
313
450
|
}
|
|
314
451
|
return a.current = setTimeout(() => {
|
|
315
452
|
a.current = null, i(!0);
|
|
316
|
-
},
|
|
453
|
+
}, _t), () => {
|
|
317
454
|
a.current !== null && (clearTimeout(a.current), a.current = null);
|
|
318
455
|
};
|
|
319
456
|
}
|
|
320
|
-
}, [e, r]), /* @__PURE__ */
|
|
457
|
+
}, [e, r]), /* @__PURE__ */ P(t, {
|
|
321
458
|
mode: e && r ? "hidden" : "visible",
|
|
322
459
|
children: n
|
|
323
460
|
});
|
|
324
461
|
}
|
|
325
462
|
//#endregion
|
|
326
463
|
//#region src/screen/scopeAnimHoldCoordinator.ts
|
|
327
|
-
var
|
|
328
|
-
function
|
|
329
|
-
let t =
|
|
330
|
-
return t || (t =
|
|
464
|
+
var Z = /* @__PURE__ */ new WeakMap();
|
|
465
|
+
function yt(e) {
|
|
466
|
+
let t = Z.get(e);
|
|
467
|
+
return t || (t = h(), Z.set(e, t)), t;
|
|
331
468
|
}
|
|
332
469
|
//#endregion
|
|
333
470
|
//#region src/stores/useNavigateStore.ts
|
|
334
|
-
function
|
|
335
|
-
return V(
|
|
471
|
+
function bt(e) {
|
|
472
|
+
return V(I().navigate, e);
|
|
336
473
|
}
|
|
337
474
|
//#endregion
|
|
338
475
|
//#region src/screen/ScreenDecorator.tsx
|
|
339
|
-
function
|
|
340
|
-
let { isActive: r, isPrev: i, transitionName: a } =
|
|
476
|
+
function xt({ ref: e, style: t, ...n }) {
|
|
477
|
+
let { isActive: r, isPrev: i, transitionName: a } = z(), o = p(null);
|
|
341
478
|
l(e, () => o.current);
|
|
342
|
-
let s =
|
|
343
|
-
return u ? /* @__PURE__ */
|
|
479
|
+
let s = bt((e) => i ? "COMPLETED" : e.status), { decoratorName: c } = Ne(a), u = fe.get(c);
|
|
480
|
+
return u ? /* @__PURE__ */ P("div", {
|
|
344
481
|
ref: o,
|
|
345
482
|
"data-flemo-decorator": !0,
|
|
346
483
|
"data-flemo-decorator-name": u.name,
|
|
@@ -361,9 +498,9 @@ function lt({ ref: e, style: t, ...n }) {
|
|
|
361
498
|
}
|
|
362
499
|
//#endregion
|
|
363
500
|
//#region src/screen/useViewportScrollHeight.ts
|
|
364
|
-
function
|
|
501
|
+
function St() {
|
|
365
502
|
let [e, t] = m(0), [n, r] = m(0);
|
|
366
|
-
return s(() =>
|
|
503
|
+
return s(() => we((e, n) => {
|
|
367
504
|
r(n), t(e);
|
|
368
505
|
}), []), {
|
|
369
506
|
viewportScrollHeight: e,
|
|
@@ -371,93 +508,99 @@ function ut() {
|
|
|
371
508
|
};
|
|
372
509
|
}
|
|
373
510
|
//#endregion
|
|
511
|
+
//#region src/utils/useHydrationSafeFlag.ts
|
|
512
|
+
var Q = () => () => {}, Ct = () => !1;
|
|
513
|
+
function wt(e) {
|
|
514
|
+
return ee(Q, e, Ct);
|
|
515
|
+
}
|
|
516
|
+
//#endregion
|
|
374
517
|
//#region src/stores/useScreenStore.ts
|
|
375
|
-
function
|
|
376
|
-
return V(
|
|
518
|
+
function $(e) {
|
|
519
|
+
return V(I().screen, e);
|
|
377
520
|
}
|
|
378
521
|
//#endregion
|
|
379
522
|
//#region src/screen/ScreenMotion.tsx
|
|
380
|
-
function
|
|
381
|
-
let { id:
|
|
382
|
-
|
|
383
|
-
getTransitionTaskId: () =>
|
|
384
|
-
setDragStatus:
|
|
385
|
-
setReplaceTransitionStatus:
|
|
523
|
+
function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: c, sharedTopBarId: l, sharedBottomBar: u, sharedBottomBarId: f, topBar: ee, bottomBar: ne, hideStatusBar: re, hideSystemNavigationBar: oe, backgroundColor: se = "white", contentScrollable: h = !0, ...g }) {
|
|
524
|
+
let { id: _, isActive: v, isRoot: y, isPrev: ce, zIndex: b, transitionName: x, prevTransitionName: le } = z(), { contained: S } = qe(), C = S ? "absolute" : "fixed", w = I(), T = o(We), E = H((e) => e.index), D = H((e) => e.histories), O = v || b === E - 1, k = bt((e) => O ? e.status : "COMPLETED"), me = $((e) => e.dragStatus), he = $((e) => e.replaceTransitionStatus), j = w.screen.getState().setDragStatus, _e = w.screen.getState().setReplaceTransitionStatus, M = v ? D[E - 1]?.id : D[E]?.id, ye = $((e) => M ? e.sharedBars[M] : void 0), N = $((e) => M ? e.sharedBarMetadata[M] : void 0), xe = $((e) => M ? e.screenSurfaces[M] : void 0), Se = p(null);
|
|
525
|
+
Se.current ||= de({
|
|
526
|
+
getTransitionTaskId: () => w.navigate.getState().transitionTaskId,
|
|
527
|
+
setDragStatus: j,
|
|
528
|
+
setReplaceTransitionStatus: _e
|
|
386
529
|
});
|
|
387
|
-
let
|
|
388
|
-
|
|
389
|
-
let
|
|
390
|
-
key:
|
|
530
|
+
let we = Se.current, Te = p(null);
|
|
531
|
+
Te.current ||= yt(w.navigate);
|
|
532
|
+
let Ee = Ne(x), { initial: Ae, swipeDirection: je, decoratorName: Me } = Ee, Pe = fe.get(Me), { viewportScrollHeight: Ie } = St(), Le = Ie > 0, F = !!c, L = !!u, R = F ? `${typeof l}:${String(l)}` : null, B = L ? `${typeof f}:${String(f)}` : null, [Be, Ve] = m({
|
|
533
|
+
key: R,
|
|
391
534
|
height: 0
|
|
392
|
-
}), [
|
|
535
|
+
}), [He, Ue] = m({
|
|
393
536
|
key: B,
|
|
394
537
|
height: 0
|
|
395
|
-
}),
|
|
396
|
-
e <= 0 ||
|
|
397
|
-
key:
|
|
538
|
+
}), V = p(Be), Ge = p(He), Ke = Be.key === R ? Be.height : 0, Je = He.key === B ? He.height : 0, Ye = Fe(F ? { id: l } : void 0, N?.topBar) ? N?.topBar?.height ?? 0 : 0, Xe = Fe(L ? { id: f } : void 0, N?.bottomBar) ? N?.bottomBar?.height ?? 0 : 0, Ze = Ke || Ye, Qe = Je || Xe, U = p(null), W = p(null), $e = p(null), G = p(null), et = p(null), K = p(null), q = p(null), tt = a((e) => {
|
|
539
|
+
e <= 0 || R === null || (G.current && (G.current.style.minHeight = `${e}px`), V.current = {
|
|
540
|
+
key: R,
|
|
398
541
|
height: e
|
|
399
|
-
}, Ve((t) => t.key ===
|
|
400
|
-
key:
|
|
542
|
+
}, Ve((t) => t.key === R && t.height === e ? t : {
|
|
543
|
+
key: R,
|
|
401
544
|
height: e
|
|
402
|
-
}),
|
|
545
|
+
}), w.screen.getState().updateSharedBarHeight(_, "topBar", e));
|
|
403
546
|
}, [
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
547
|
+
_,
|
|
548
|
+
w.screen,
|
|
549
|
+
R
|
|
407
550
|
]), nt = a((e) => {
|
|
408
|
-
e <= 0 || B === null || (
|
|
551
|
+
e <= 0 || B === null || (et.current && (et.current.style.minHeight = `${e}px`), Ge.current = {
|
|
409
552
|
key: B,
|
|
410
553
|
height: e
|
|
411
554
|
}, Ue((t) => t.key === B && t.height === e ? t : {
|
|
412
555
|
key: B,
|
|
413
556
|
height: e
|
|
414
|
-
}),
|
|
557
|
+
}), w.screen.getState().updateSharedBarHeight(_, "bottomBar", e));
|
|
415
558
|
}, [
|
|
416
559
|
B,
|
|
417
|
-
|
|
418
|
-
|
|
560
|
+
_,
|
|
561
|
+
w.screen
|
|
419
562
|
]), rt = a((e) => {
|
|
420
|
-
|
|
421
|
-
}, [
|
|
422
|
-
|
|
563
|
+
K.current = e, e?.offsetHeight && tt(e.offsetHeight);
|
|
564
|
+
}, [tt]), it = a((e) => {
|
|
565
|
+
q.current = e, e?.offsetHeight && nt(e.offsetHeight);
|
|
423
566
|
}, [nt]), J = p({
|
|
424
|
-
transition:
|
|
425
|
-
decorator:
|
|
567
|
+
transition: Ee,
|
|
568
|
+
decorator: Pe,
|
|
426
569
|
hasSharedTopBar: !!c,
|
|
427
570
|
hasSharedBottomBar: !!u,
|
|
428
571
|
sharedTopBarId: l,
|
|
429
572
|
sharedBottomBarId: f,
|
|
430
|
-
viewportScrollHeight:
|
|
431
|
-
isRoot:
|
|
432
|
-
isActive:
|
|
573
|
+
viewportScrollHeight: Ie,
|
|
574
|
+
isRoot: y,
|
|
575
|
+
isActive: v,
|
|
433
576
|
status: k,
|
|
434
|
-
dragStatus:
|
|
435
|
-
index:
|
|
577
|
+
dragStatus: me,
|
|
578
|
+
index: E
|
|
436
579
|
});
|
|
437
580
|
J.current = {
|
|
438
|
-
transition:
|
|
439
|
-
decorator:
|
|
581
|
+
transition: Ee,
|
|
582
|
+
decorator: Pe,
|
|
440
583
|
hasSharedTopBar: !!c,
|
|
441
584
|
hasSharedBottomBar: !!u,
|
|
442
585
|
sharedTopBarId: l,
|
|
443
586
|
sharedBottomBarId: f,
|
|
444
|
-
viewportScrollHeight:
|
|
445
|
-
isRoot:
|
|
446
|
-
isActive:
|
|
587
|
+
viewportScrollHeight: Ie,
|
|
588
|
+
isRoot: y,
|
|
589
|
+
isActive: v,
|
|
447
590
|
status: k,
|
|
448
|
-
dragStatus:
|
|
449
|
-
index:
|
|
591
|
+
dragStatus: me,
|
|
592
|
+
index: E
|
|
450
593
|
};
|
|
451
594
|
let at = p(null);
|
|
452
|
-
at.current ||=
|
|
595
|
+
at.current ||= ue({
|
|
453
596
|
getTransition: () => J.current.transition,
|
|
454
597
|
getDecorator: () => J.current.decorator,
|
|
455
598
|
getElements: () => ({
|
|
456
599
|
scope: W.current,
|
|
457
|
-
screenContainer:
|
|
600
|
+
screenContainer: U.current,
|
|
458
601
|
decorator: $e.current,
|
|
459
|
-
sharedTopBar:
|
|
460
|
-
sharedBottomBar:
|
|
602
|
+
sharedTopBar: K.current,
|
|
603
|
+
sharedBottomBar: q.current
|
|
461
604
|
}),
|
|
462
605
|
hasSharedTopBar: () => J.current.hasSharedTopBar,
|
|
463
606
|
hasSharedBottomBar: () => J.current.hasSharedBottomBar,
|
|
@@ -469,21 +612,21 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
469
612
|
return !e.isRoot && e.isActive && e.status === "COMPLETED" && e.dragStatus === "IDLE" && !!e.transition.swipeDirection && e.viewportScrollHeight < 10;
|
|
470
613
|
},
|
|
471
614
|
getPartnerBars: () => {
|
|
472
|
-
let e = J.current, t =
|
|
473
|
-
return n ?
|
|
615
|
+
let e = J.current, t = w.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
|
|
616
|
+
return n ? w.screen.getState().sharedBars[n] : void 0;
|
|
474
617
|
},
|
|
475
618
|
getPartnerBarMetadata: () => {
|
|
476
|
-
let e = J.current, t =
|
|
477
|
-
return n ?
|
|
619
|
+
let e = J.current, t = w.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
|
|
620
|
+
return n ? w.screen.getState().sharedBarMetadata[n] : void 0;
|
|
478
621
|
},
|
|
479
|
-
setDragStatus:
|
|
622
|
+
setDragStatus: j,
|
|
480
623
|
back: () => window.history.back()
|
|
481
624
|
});
|
|
482
|
-
let Y = at.current, ot = (e) => Y.pointerDown(e.nativeEvent),
|
|
625
|
+
let Y = at.current, ot = (e) => Y.pointerDown(e.nativeEvent), st = (e) => Y.pointerMove(e.nativeEvent), ct = (e) => Y.pointerUp(e.nativeEvent), lt = (e) => Y.pointerCancel(e.nativeEvent), ut = (e) => {
|
|
483
626
|
(k === "PUSHING" || k === "REPLACING") && (e.preventDefault(), e.stopPropagation());
|
|
484
627
|
};
|
|
485
628
|
s(() => {
|
|
486
|
-
|
|
629
|
+
pe(W.current);
|
|
487
630
|
}, []), s(() => {
|
|
488
631
|
let e = W.current;
|
|
489
632
|
if (!e) return;
|
|
@@ -494,222 +637,222 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
494
637
|
e.removeEventListener("touchmove", t);
|
|
495
638
|
};
|
|
496
639
|
}, [Y]), d(() => {
|
|
497
|
-
let { registerSharedBars: e, unregisterSharedBars: t } =
|
|
498
|
-
return e(
|
|
499
|
-
topBar:
|
|
500
|
-
bottomBar:
|
|
640
|
+
let { registerSharedBars: e, unregisterSharedBars: t } = w.screen.getState(), n = V.current, r = Ge.current;
|
|
641
|
+
return e(_, {
|
|
642
|
+
topBar: F,
|
|
643
|
+
bottomBar: L
|
|
501
644
|
}, {
|
|
502
|
-
topBar:
|
|
645
|
+
topBar: F ? {
|
|
503
646
|
id: l,
|
|
504
|
-
height: n.key ===
|
|
647
|
+
height: n.key === R ? n.height : void 0
|
|
505
648
|
} : void 0,
|
|
506
|
-
bottomBar:
|
|
649
|
+
bottomBar: L ? {
|
|
507
650
|
id: f,
|
|
508
651
|
height: r.key === B ? r.height : void 0
|
|
509
652
|
} : void 0
|
|
510
|
-
}), () => t(
|
|
653
|
+
}), () => t(_);
|
|
511
654
|
}, [
|
|
512
655
|
B,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
656
|
+
L,
|
|
657
|
+
F,
|
|
658
|
+
_,
|
|
516
659
|
f,
|
|
517
660
|
l,
|
|
518
|
-
|
|
519
|
-
|
|
661
|
+
w.screen,
|
|
662
|
+
R
|
|
520
663
|
]), d(() => {
|
|
521
|
-
let e = G.current;
|
|
522
|
-
if (e) return we(e, q);
|
|
523
|
-
}, [q, c]), d(() => {
|
|
524
664
|
let e = K.current;
|
|
525
|
-
if (e) return
|
|
665
|
+
if (e) return Ce(e, tt);
|
|
666
|
+
}, [tt, c]), d(() => {
|
|
667
|
+
let e = q.current;
|
|
668
|
+
if (e) return Ce(e, nt);
|
|
526
669
|
}, [nt, u]), d(() => {
|
|
527
670
|
let e = W.current;
|
|
528
671
|
if (!e) return;
|
|
529
|
-
let { registerScreenSurface: t, unregisterScreenSurface: n } =
|
|
530
|
-
return t(
|
|
672
|
+
let { registerScreenSurface: t, unregisterScreenSurface: n } = w.screen.getState();
|
|
673
|
+
return t(_, { opaqueBackground: be(getComputedStyle(e).backgroundColor) }), () => n(_);
|
|
531
674
|
}, [
|
|
532
|
-
|
|
533
|
-
|
|
675
|
+
_,
|
|
676
|
+
se,
|
|
534
677
|
k,
|
|
535
|
-
|
|
678
|
+
w.screen
|
|
536
679
|
]);
|
|
537
|
-
let
|
|
680
|
+
let dt = O, { app: ft, nav: pt } = ie({
|
|
538
681
|
status: k,
|
|
539
|
-
isTopOrTopPrev:
|
|
540
|
-
hasTopBar:
|
|
541
|
-
hasNavBar:
|
|
682
|
+
isTopOrTopPrev: dt,
|
|
683
|
+
hasTopBar: F,
|
|
684
|
+
hasNavBar: L,
|
|
542
685
|
topBarId: l,
|
|
543
686
|
bottomBarId: f,
|
|
544
|
-
partnerBars:
|
|
545
|
-
partnerMetadata:
|
|
546
|
-
}),
|
|
687
|
+
partnerBars: ye,
|
|
688
|
+
partnerMetadata: N
|
|
689
|
+
}), X = te({
|
|
547
690
|
status: k,
|
|
548
|
-
isTopOrTopPrev:
|
|
549
|
-
transitionName:
|
|
550
|
-
}),
|
|
551
|
-
isActive:
|
|
552
|
-
isPrev:
|
|
553
|
-
zIndex:
|
|
554
|
-
index:
|
|
691
|
+
isTopOrTopPrev: dt,
|
|
692
|
+
transitionName: x
|
|
693
|
+
}), mt = ae({
|
|
694
|
+
isActive: v,
|
|
695
|
+
isPrev: ce,
|
|
696
|
+
zIndex: b,
|
|
697
|
+
index: E,
|
|
555
698
|
status: k,
|
|
556
|
-
dragStatus:
|
|
557
|
-
replaceTransitionStatus:
|
|
558
|
-
}),
|
|
559
|
-
key:
|
|
560
|
-
released:
|
|
699
|
+
dragStatus: me,
|
|
700
|
+
replaceTransitionStatus: he
|
|
701
|
+
}), ht = p(mt), gt = p(X !== null && mt), [_t, vt] = m({
|
|
702
|
+
key: X,
|
|
703
|
+
released: X === null
|
|
561
704
|
});
|
|
562
|
-
|
|
563
|
-
key:
|
|
564
|
-
released:
|
|
565
|
-
}),
|
|
566
|
-
let
|
|
567
|
-
d(() =>
|
|
705
|
+
_t.key !== X && (vt({
|
|
706
|
+
key: X,
|
|
707
|
+
released: X === null
|
|
708
|
+
}), gt.current = X !== null && ht.current), ht.current = mt;
|
|
709
|
+
let Z = X !== null && _t.key === X && !_t.released, Q = Z ? !v && xe?.opaqueBackground ? "park" : v && (k === "PUSHING" || k === "REPLACING") && xe?.opaqueBackground ? Oe() ? "park-over" : "park-under" : "true" : "false", Ct = wt(De);
|
|
710
|
+
d(() => we.driveScreenLifecycle({
|
|
568
711
|
getElements: () => ({
|
|
569
712
|
scope: W.current,
|
|
570
713
|
decorator: $e.current,
|
|
571
|
-
bars: [
|
|
714
|
+
bars: [K.current, q.current]
|
|
572
715
|
}),
|
|
573
|
-
transitionName:
|
|
574
|
-
prevTransitionName:
|
|
716
|
+
transitionName: x,
|
|
717
|
+
prevTransitionName: le,
|
|
575
718
|
status: k,
|
|
576
|
-
isActive:
|
|
577
|
-
animHoldReleased: !
|
|
719
|
+
isActive: v,
|
|
720
|
+
animHoldReleased: !Z
|
|
578
721
|
}), [
|
|
579
|
-
|
|
722
|
+
we,
|
|
580
723
|
k,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
724
|
+
v,
|
|
725
|
+
le,
|
|
726
|
+
x,
|
|
727
|
+
Z
|
|
585
728
|
]), s(() => {
|
|
586
|
-
if (!
|
|
587
|
-
let e =
|
|
588
|
-
return
|
|
589
|
-
if ((J.current.transition.driver === "native" ||
|
|
729
|
+
if (!Z || X === null) return;
|
|
730
|
+
let e = X, t = w.navigate.getState().transitionTaskId, n = t === null ? e : `${e}#${t}`;
|
|
731
|
+
return Te.current.join(n, () => {
|
|
732
|
+
if ((J.current.transition.driver === "native" || ve()) && !A()) {
|
|
590
733
|
for (let e of [
|
|
591
734
|
W.current,
|
|
592
|
-
G.current,
|
|
593
735
|
K.current,
|
|
736
|
+
q.current,
|
|
594
737
|
$e.current
|
|
595
738
|
]) e?.isConnected && e.getAttribute("data-flemo-anim-hold") !== null && e.setAttribute("data-flemo-anim-hold", "false");
|
|
596
|
-
|
|
739
|
+
U.current && (U.current.style.zIndex = "");
|
|
597
740
|
}
|
|
598
|
-
|
|
741
|
+
ze(() => vt((t) => t.key === e && !t.released ? {
|
|
599
742
|
key: e,
|
|
600
743
|
released: !0
|
|
601
744
|
} : t));
|
|
602
745
|
}, {
|
|
603
746
|
scope: W.current,
|
|
604
|
-
decodeWait:
|
|
605
|
-
contentSettle: ke() && (
|
|
747
|
+
decodeWait: gt.current,
|
|
748
|
+
contentSettle: ke() && (v && k === "PUSHING" || k === "POPPING") ? {
|
|
606
749
|
firstWaitMs: 120,
|
|
607
750
|
capMs: 700,
|
|
608
751
|
graceMs: 60,
|
|
609
|
-
minNodes:
|
|
752
|
+
minNodes: v ? 30 : 1,
|
|
610
753
|
renderSettleOnly: !0
|
|
611
754
|
} : void 0
|
|
612
755
|
});
|
|
613
756
|
}, [
|
|
614
|
-
Q,
|
|
615
757
|
Z,
|
|
616
|
-
|
|
617
|
-
|
|
758
|
+
X,
|
|
759
|
+
Q,
|
|
760
|
+
v,
|
|
618
761
|
k,
|
|
619
|
-
|
|
762
|
+
w.navigate
|
|
620
763
|
]);
|
|
621
|
-
let
|
|
764
|
+
let Tt = Q === "park-under" || Q === "park-over" ? {} : ge({
|
|
622
765
|
initial: Ae,
|
|
623
|
-
isActive:
|
|
766
|
+
isActive: v,
|
|
624
767
|
status: k
|
|
625
768
|
});
|
|
626
|
-
return /* @__PURE__ */
|
|
627
|
-
ref:
|
|
628
|
-
onClickCapture:
|
|
769
|
+
return /* @__PURE__ */ Re("div", {
|
|
770
|
+
ref: U,
|
|
771
|
+
onClickCapture: ut,
|
|
629
772
|
style: {
|
|
630
|
-
position:
|
|
773
|
+
position: C,
|
|
631
774
|
top: 0,
|
|
632
775
|
left: 0,
|
|
633
776
|
width: "100%",
|
|
634
777
|
height: "100%",
|
|
635
778
|
display: "flex",
|
|
636
|
-
zIndex:
|
|
779
|
+
zIndex: Q === "park-under" ? -1 : void 0,
|
|
637
780
|
contain: "layout style",
|
|
638
781
|
flexDirection: "column",
|
|
639
782
|
boxSizing: "border-box",
|
|
640
783
|
overscrollBehavior: "contain"
|
|
641
784
|
},
|
|
642
785
|
children: [
|
|
643
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ Re("div", {
|
|
644
787
|
ref: W,
|
|
645
|
-
...
|
|
788
|
+
...g,
|
|
646
789
|
onPointerDown: ot,
|
|
647
|
-
onPointerMove:
|
|
648
|
-
onPointerUp:
|
|
649
|
-
onPointerCancel:
|
|
790
|
+
onPointerMove: st,
|
|
791
|
+
onPointerUp: ct,
|
|
792
|
+
onPointerCancel: lt,
|
|
650
793
|
"data-flemo-screen": !0,
|
|
651
|
-
"data-flemo-router":
|
|
652
|
-
"data-flemo-transition":
|
|
794
|
+
"data-flemo-router": T ?? void 0,
|
|
795
|
+
"data-flemo-transition": x,
|
|
653
796
|
"data-flemo-status": k,
|
|
654
|
-
"data-flemo-active":
|
|
655
|
-
"data-flemo-anim-hold":
|
|
797
|
+
"data-flemo-active": v ? "true" : "false",
|
|
798
|
+
"data-flemo-anim-hold": Q,
|
|
656
799
|
style: {
|
|
657
800
|
display: "flex",
|
|
658
801
|
flexDirection: "column",
|
|
659
802
|
height: "100%",
|
|
660
|
-
backgroundColor:
|
|
661
|
-
overflowY:
|
|
803
|
+
backgroundColor: se,
|
|
804
|
+
overflowY: h ? void 0 : "auto",
|
|
662
805
|
touchAction: je === "x" ? "pan-y" : je === "y" ? "pan-x" : "auto",
|
|
663
|
-
...
|
|
664
|
-
...
|
|
665
|
-
...
|
|
806
|
+
...Ct && (Q !== "false" || b === E && !S) ? { willChange: "transform" } : {},
|
|
807
|
+
...Tt,
|
|
808
|
+
...g.style
|
|
666
809
|
},
|
|
667
810
|
children: [
|
|
668
|
-
!
|
|
811
|
+
!re && t && /* @__PURE__ */ P("div", {
|
|
669
812
|
style: { minHeight: t },
|
|
670
|
-
children: /* @__PURE__ */
|
|
671
|
-
position:
|
|
813
|
+
children: /* @__PURE__ */ P("div", { style: {
|
|
814
|
+
position: C,
|
|
672
815
|
top: 0,
|
|
673
816
|
width: "100%",
|
|
674
817
|
minHeight: t,
|
|
675
818
|
backgroundColor: n
|
|
676
819
|
} })
|
|
677
820
|
}),
|
|
678
|
-
c && /* @__PURE__ */
|
|
679
|
-
ref:
|
|
821
|
+
c && /* @__PURE__ */ P("div", {
|
|
822
|
+
ref: G,
|
|
680
823
|
"data-flemo-bar-spacer": "app",
|
|
681
824
|
style: {
|
|
682
825
|
width: "100%",
|
|
683
|
-
minHeight:
|
|
826
|
+
minHeight: Ze
|
|
684
827
|
}
|
|
685
828
|
}),
|
|
686
|
-
|
|
687
|
-
/* @__PURE__ */
|
|
829
|
+
ee,
|
|
830
|
+
/* @__PURE__ */ P("div", {
|
|
688
831
|
style: {
|
|
689
832
|
display: "flex",
|
|
690
833
|
flexDirection: "column",
|
|
691
834
|
flexGrow: 1,
|
|
692
|
-
overflowY:
|
|
835
|
+
overflowY: h ? "auto" : void 0
|
|
693
836
|
},
|
|
694
837
|
children: e
|
|
695
838
|
}),
|
|
696
839
|
ne,
|
|
697
|
-
u && /* @__PURE__ */
|
|
698
|
-
ref:
|
|
840
|
+
u && /* @__PURE__ */ P("div", {
|
|
841
|
+
ref: et,
|
|
699
842
|
"data-flemo-bar-spacer": "nav",
|
|
700
843
|
style: {
|
|
701
|
-
display:
|
|
844
|
+
display: Le ? "none" : void 0,
|
|
702
845
|
width: "100%",
|
|
703
|
-
minHeight:
|
|
846
|
+
minHeight: Qe
|
|
704
847
|
}
|
|
705
848
|
}),
|
|
706
|
-
!
|
|
849
|
+
!oe && r && /* @__PURE__ */ P("div", {
|
|
707
850
|
style: {
|
|
708
|
-
display:
|
|
851
|
+
display: Le ? "none" : void 0,
|
|
709
852
|
minHeight: r
|
|
710
853
|
},
|
|
711
|
-
children: /* @__PURE__ */
|
|
712
|
-
position:
|
|
854
|
+
children: /* @__PURE__ */ P("div", { style: {
|
|
855
|
+
position: C,
|
|
713
856
|
bottom: 0,
|
|
714
857
|
width: "100%",
|
|
715
858
|
minHeight: r,
|
|
@@ -718,58 +861,58 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
718
861
|
})
|
|
719
862
|
]
|
|
720
863
|
}),
|
|
721
|
-
c && /* @__PURE__ */
|
|
864
|
+
c && /* @__PURE__ */ P("div", {
|
|
722
865
|
ref: rt,
|
|
723
866
|
"data-flemo-bar": "app",
|
|
724
867
|
"data-flemo-bar-id": l,
|
|
725
868
|
"data-flemo-bar-id-type": l === void 0 ? void 0 : typeof l,
|
|
726
|
-
"data-flemo-router":
|
|
727
|
-
"data-flemo-bar-transition":
|
|
869
|
+
"data-flemo-router": T ?? void 0,
|
|
870
|
+
"data-flemo-bar-transition": x,
|
|
728
871
|
"data-flemo-bar-status": k,
|
|
729
|
-
"data-flemo-bar-active":
|
|
730
|
-
"data-flemo-bar-riding":
|
|
731
|
-
"data-flemo-anim-hold":
|
|
872
|
+
"data-flemo-bar-active": v ? "true" : "false",
|
|
873
|
+
"data-flemo-bar-riding": ft ? "true" : "false",
|
|
874
|
+
"data-flemo-anim-hold": Q,
|
|
732
875
|
style: {
|
|
733
|
-
position:
|
|
734
|
-
top:
|
|
876
|
+
position: C,
|
|
877
|
+
top: re ? 0 : t,
|
|
735
878
|
left: 0,
|
|
736
879
|
width: "100%",
|
|
737
880
|
zIndex: 1
|
|
738
881
|
},
|
|
739
882
|
children: c
|
|
740
883
|
}),
|
|
741
|
-
u && /* @__PURE__ */
|
|
884
|
+
u && /* @__PURE__ */ P("div", {
|
|
742
885
|
ref: it,
|
|
743
886
|
"data-flemo-bar": "nav",
|
|
744
887
|
"data-flemo-bar-id": f,
|
|
745
888
|
"data-flemo-bar-id-type": f === void 0 ? void 0 : typeof f,
|
|
746
|
-
"data-flemo-router":
|
|
747
|
-
"data-flemo-bar-transition":
|
|
889
|
+
"data-flemo-router": T ?? void 0,
|
|
890
|
+
"data-flemo-bar-transition": x,
|
|
748
891
|
"data-flemo-bar-status": k,
|
|
749
|
-
"data-flemo-bar-active":
|
|
750
|
-
"data-flemo-bar-riding":
|
|
751
|
-
"data-flemo-anim-hold":
|
|
892
|
+
"data-flemo-bar-active": v ? "true" : "false",
|
|
893
|
+
"data-flemo-bar-riding": pt ? "true" : "false",
|
|
894
|
+
"data-flemo-anim-hold": Q,
|
|
752
895
|
style: {
|
|
753
|
-
display:
|
|
754
|
-
position:
|
|
755
|
-
bottom:
|
|
896
|
+
display: Le ? "none" : void 0,
|
|
897
|
+
position: C,
|
|
898
|
+
bottom: oe ? 0 : r,
|
|
756
899
|
left: 0,
|
|
757
900
|
width: "100%",
|
|
758
901
|
zIndex: 1
|
|
759
902
|
},
|
|
760
903
|
children: u
|
|
761
904
|
}),
|
|
762
|
-
|
|
905
|
+
Pe && /* @__PURE__ */ P(xt, {
|
|
763
906
|
ref: $e,
|
|
764
|
-
"data-flemo-anim-hold":
|
|
907
|
+
"data-flemo-anim-hold": Q
|
|
765
908
|
})
|
|
766
909
|
]
|
|
767
910
|
});
|
|
768
911
|
}
|
|
769
912
|
//#endregion
|
|
770
913
|
//#region src/screen/Screen.tsx
|
|
771
|
-
function
|
|
772
|
-
let { isActive: n, isPrev: r, zIndex: i } =
|
|
914
|
+
function Et({ children: e, ...t }) {
|
|
915
|
+
let { isActive: n, isPrev: r, zIndex: i } = z(), a = H((e) => e.index), o = bt((e) => e.status), c = $((e) => e.dragStatus), l = $((e) => e.replaceTransitionStatus), u = oe({
|
|
773
916
|
isActive: n,
|
|
774
917
|
isPrev: r,
|
|
775
918
|
zIndex: i,
|
|
@@ -780,22 +923,22 @@ function ft({ children: e, ...t }) {
|
|
|
780
923
|
}), [d, f] = m(u !== "live");
|
|
781
924
|
return u === "live" && d && f(!1), u === "immediate" && !d && f(!0), s(() => {
|
|
782
925
|
if (u !== "deferred" || d) return;
|
|
783
|
-
let e = setTimeout(() => f(!0),
|
|
926
|
+
let e = setTimeout(() => f(!0), Dt);
|
|
784
927
|
return () => clearTimeout(e);
|
|
785
|
-
}, [u, d]), /* @__PURE__ */
|
|
928
|
+
}, [u, d]), /* @__PURE__ */ P(vt, {
|
|
786
929
|
freeze: d,
|
|
787
|
-
children: /* @__PURE__ */
|
|
930
|
+
children: /* @__PURE__ */ P(Tt, {
|
|
788
931
|
...t,
|
|
789
932
|
children: e
|
|
790
933
|
})
|
|
791
934
|
});
|
|
792
935
|
}
|
|
793
|
-
var
|
|
936
|
+
var Dt = 600;
|
|
794
937
|
//#endregion
|
|
795
938
|
//#region src/screen/Part.tsx
|
|
796
|
-
function
|
|
797
|
-
let { isActive: a, isPrev: s, navigateStore: c, routerId: l } =
|
|
798
|
-
return /* @__PURE__ */
|
|
939
|
+
function Ot({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
940
|
+
let { isActive: a, isPrev: s, navigateStore: c, routerId: l } = z(), u = o(We), d = l ?? u ?? void 0, f = I(), p = V(c ?? f.navigate, (e) => s ? "COMPLETED" : e.status);
|
|
941
|
+
return /* @__PURE__ */ P("div", {
|
|
799
942
|
ref: e,
|
|
800
943
|
"data-flemo-part-name": t,
|
|
801
944
|
"data-flemo-router": d,
|
|
@@ -808,21 +951,21 @@ function mt({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
|
808
951
|
}
|
|
809
952
|
//#endregion
|
|
810
953
|
//#region src/stores/RouterScopeProvider.tsx
|
|
811
|
-
function
|
|
954
|
+
function kt({ children: e }) {
|
|
812
955
|
let [t] = m(() => ({
|
|
813
956
|
history: y(),
|
|
814
|
-
navigate:
|
|
815
|
-
transition:
|
|
957
|
+
navigate: ce(),
|
|
958
|
+
transition: k(),
|
|
816
959
|
screen: E(),
|
|
817
|
-
driver:
|
|
818
|
-
markSelfInduced:
|
|
819
|
-
consume:
|
|
960
|
+
driver: _(),
|
|
961
|
+
markSelfInduced: xe,
|
|
962
|
+
consume: se,
|
|
820
963
|
life: { alive: !0 }
|
|
821
964
|
}));
|
|
822
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ P(F.Provider, {
|
|
823
966
|
value: t,
|
|
824
967
|
children: e
|
|
825
968
|
});
|
|
826
969
|
}
|
|
827
970
|
//#endregion
|
|
828
|
-
export {
|
|
971
|
+
export { Ot as Part, ft as Route, dt as Router, kt as RouterScopeProvider, Et as Screen, R as ScreenContext, xt as ScreenDecorator, vt as ScreenFreeze, Tt as ScreenMotion, rt as Slot, g as createBrowserHistoryDriver, v as createDecorator, x as createPartTransition, le as createRawDecorator, S as createRawPartTransition, C as createRawTransition, O as createTransition, Te as partTransitionMap, H as useHistoryStore, X as useNavigate, bt as useNavigateStore, gt as useParams, mt as usePathname, z as useScreen, $ as useScreenStore, ht as useStep, I as useStores, St as useViewportScrollHeight };
|