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