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