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