@flemo/react 1.12.1 → 1.12.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e, { Activity as t, Children as n, createContext as r, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useId as c, useImperativeHandle as l, useInsertionEffect as u, useLayoutEffect as d, useReducer as f, useRef as p, useState as m, useSyncExternalStore as ee } from "react";
|
|
2
|
-
import { animHoldKey as te, appendParamsQuery as ne, buildRoutePath as re, computeBarRiding as ie, computeScreenFreeze as ae, computeScreenFreezeMode as oe, consumeSelfInducedPop as se, createAnimHoldCoordinator as h, createBrowserHistoryDriver as g, createBrowserHistoryDriver as _, createDecorator as v, createHistoryStore as y, createNavigateStore as ce, createNavigationController as b, createPartTransition as x, createRawDecorator as le, createRawPartTransition as S, createRawTransition as C, createRouterScope as w, createScreenSelector as T, createScreenStore as E, createStepController as D, createSwipeController as ue, createTransition as O, createTransitionEngine as de, createTransitionStore as k, decoratorMap as fe, detectBlinkEngine as A, eagerlyDecodeImages as pe, ensureGpuPipelinePrewarm as me, ensureImageDecodeOffloader as he, ensureScopeHistorySync as j, enteringInitialStyle as ge, getMatchedPathPattern as _e, governedCompiledActive as ve, holdCompositorWarm as M,
|
|
3
|
-
import { jsx as P, jsxs as
|
|
4
|
-
import { flushSync as
|
|
2
|
+
import { animHoldKey as te, appendParamsQuery as ne, buildRoutePath as re, computeBarRiding as ie, computeScreenFreeze as ae, computeScreenFreezeMode as oe, consumeSelfInducedPop as se, createAnimHoldCoordinator as h, createBrowserHistoryDriver as g, createBrowserHistoryDriver as _, createDecorator as v, createHistoryStore as y, createNavigateStore as ce, createNavigationController as b, createPartTransition as x, createRawDecorator as le, createRawPartTransition as S, createRawTransition as C, createRouterScope as w, createScreenSelector as T, createScreenStore as E, createStepController as D, createSwipeController as ue, createTransition as O, createTransitionEngine as de, createTransitionStore as k, decoratorMap as fe, detectBlinkEngine as A, eagerlyDecodeImages as pe, ensureGpuPipelinePrewarm as me, ensureImageDecodeOffloader as he, ensureScopeHistorySync as j, enteringInitialStyle as ge, getMatchedPathPattern as _e, governedCompiledActive as ve, holdCompositorWarm as M, isDesktopBlink as ye, isLegacyAndroidBlink as N, isOpaqueColor as be, isServer as xe, markSelfInducedPop as Se, matchesPathname as Ce, observeBarHeight as we, observeViewportScrollHeight as Te, partTransitionMap as Ee, readDeferReleaseCommitFlag as De, readDesktopReleaseFlipFlag as Oe, readImageOffloadOverride as ke, readLayerPromotionFlag as Ae, readPrerasterFlag as je, readSettleGateFlag as Me, readStepParams as Ne, registerTransitionDefinitions as Pe, releaseScopeHistorySync as Fe, resolveTransition as Ie, seedRouterEntry as Le, sharedBarsMatch as Re, subscribeStepParamsRestore as ze } from "@flemo/core";
|
|
3
|
+
import { jsx as P, jsxs as Be } from "react/jsx-runtime";
|
|
4
|
+
import { flushSync as Ve } from "react-dom";
|
|
5
5
|
//#region src/stores/StoreContext.ts
|
|
6
6
|
var F = r(null);
|
|
7
7
|
//#endregion
|
|
@@ -15,7 +15,7 @@ function I() {
|
|
|
15
15
|
//#region src/history/HistoryListener.tsx
|
|
16
16
|
function L() {
|
|
17
17
|
let e = I();
|
|
18
|
-
return s(() => (j(e), () =>
|
|
18
|
+
return s(() => (j(e), () => Fe(e)), [e]), null;
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/screen/ScreenContext.ts
|
|
@@ -39,10 +39,10 @@ function z() {
|
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/screen/ParamsProvider/ParamsContext.ts
|
|
42
|
-
var B = r({}),
|
|
42
|
+
var B = r({}), He = r(() => {});
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/screen/ParamsProvider/ParamsReducer.ts
|
|
45
|
-
function
|
|
45
|
+
function Ue(e, t) {
|
|
46
46
|
switch (t.type) {
|
|
47
47
|
case "SET": return t.params;
|
|
48
48
|
default: return e;
|
|
@@ -50,10 +50,10 @@ function Ve(e, t) {
|
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/screen/ParamsProvider/ParamsProvider.tsx
|
|
53
|
-
function
|
|
54
|
-
let { isActive: t, params: n } = z(), { driver: r } = I(), [i, a] = f(
|
|
53
|
+
function We({ children: e }) {
|
|
54
|
+
let { isActive: t, params: n } = z(), { driver: r } = I(), [i, a] = f(Ue, n);
|
|
55
55
|
return s(() => {
|
|
56
|
-
if (t) return
|
|
56
|
+
if (t) return ze(r, (e) => a({
|
|
57
57
|
type: "SET",
|
|
58
58
|
params: e
|
|
59
59
|
}));
|
|
@@ -61,7 +61,7 @@ function He({ children: e }) {
|
|
|
61
61
|
t,
|
|
62
62
|
a,
|
|
63
63
|
r
|
|
64
|
-
]), /* @__PURE__ */ P(
|
|
64
|
+
]), /* @__PURE__ */ P(He.Provider, {
|
|
65
65
|
value: a,
|
|
66
66
|
children: /* @__PURE__ */ P(B.Provider, {
|
|
67
67
|
value: i,
|
|
@@ -71,8 +71,8 @@ function He({ children: e }) {
|
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../../node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.18_react@19.2.8/node_modules/zustand/esm/react.mjs
|
|
74
|
-
var
|
|
75
|
-
function V(t, n =
|
|
74
|
+
var Ge = (e) => e;
|
|
75
|
+
function V(t, n = Ge) {
|
|
76
76
|
let r = e.useSyncExternalStore(t.subscribe, e.useCallback(() => n(t.getState()), [t, n]), e.useCallback(() => n(t.getInitialState()), [t, n]));
|
|
77
77
|
return e.useDebugValue(r), r;
|
|
78
78
|
}
|
|
@@ -83,13 +83,13 @@ function H(e) {
|
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/RouterIdContext.ts
|
|
86
|
-
var
|
|
86
|
+
var Ke = r(null);
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/renderer/Renderer.tsx
|
|
89
|
-
function
|
|
90
|
-
let t = H((e) => e.index), r = H((e) => e.histories), i = I(), a = o(R), s = o(
|
|
89
|
+
function qe({ children: e }) {
|
|
90
|
+
let t = H((e) => e.index), r = H((e) => e.histories), i = I(), a = o(R), s = o(Ke);
|
|
91
91
|
return T(r, t).map((t) => {
|
|
92
|
-
let [r] = n.toArray(e).filter((e) =>
|
|
92
|
+
let [r] = n.toArray(e).filter((e) => Ce(e.props.path, t.pathname));
|
|
93
93
|
return r ? /* @__PURE__ */ P(R.Provider, {
|
|
94
94
|
value: {
|
|
95
95
|
...t,
|
|
@@ -98,20 +98,20 @@ function Ge({ children: e }) {
|
|
|
98
98
|
routerId: s ?? void 0,
|
|
99
99
|
routePath: _e(r.props.path, t.pathname)
|
|
100
100
|
},
|
|
101
|
-
children: /* @__PURE__ */ P(
|
|
101
|
+
children: /* @__PURE__ */ P(We, { children: r })
|
|
102
102
|
}, t.id) : null;
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/screen/ScreenViewportContext.ts
|
|
107
|
-
var
|
|
108
|
-
function
|
|
109
|
-
return o(
|
|
107
|
+
var Je = r({ contained: !1 });
|
|
108
|
+
function Ye() {
|
|
109
|
+
return o(Je);
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/transition/styles.ts
|
|
113
|
-
function
|
|
114
|
-
u(() =>
|
|
113
|
+
function Xe(e, t, n = []) {
|
|
114
|
+
u(() => Pe(e, t, n), [
|
|
115
115
|
e,
|
|
116
116
|
t,
|
|
117
117
|
n
|
|
@@ -119,29 +119,29 @@ function Je(e, t, n = []) {
|
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/utils/devDiagnostics.ts
|
|
122
|
-
function
|
|
122
|
+
function Ze() {
|
|
123
123
|
return typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
!
|
|
125
|
+
function Qe(e) {
|
|
126
|
+
!Ze() || typeof console > "u" || console.error(`[flemo] ${e}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
128
|
+
function $e(e) {
|
|
129
|
+
if (Ze()) throw Error(`[flemo] ${e}`);
|
|
130
130
|
}
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/RouterDepthContext.ts
|
|
133
|
-
var
|
|
133
|
+
var et = r(0), U = r(null), W = [
|
|
134
134
|
"current",
|
|
135
135
|
"parent",
|
|
136
136
|
"root",
|
|
137
137
|
"nearest-owner"
|
|
138
|
-
],
|
|
138
|
+
], tt = (e) => W.includes(e), G = (e) => {
|
|
139
139
|
let t = [];
|
|
140
140
|
for (let n = e; n; n = n.parent) t.push(n);
|
|
141
141
|
return t;
|
|
142
142
|
};
|
|
143
|
-
function
|
|
144
|
-
return e.routePaths.length === 0 || e.routePaths.some((e) => e === t) ? !0 : n ?
|
|
143
|
+
function nt(e, t, n) {
|
|
144
|
+
return e.routePaths.length === 0 || e.routePaths.some((e) => e === t) ? !0 : n ? Ce(e.routePaths, n) : !1;
|
|
145
145
|
}
|
|
146
146
|
function K(e) {
|
|
147
147
|
return G(e).map((e, t) => {
|
|
@@ -155,7 +155,7 @@ function q({ from: e, target: t, path: n, pathname: r }) {
|
|
|
155
155
|
message: null
|
|
156
156
|
};
|
|
157
157
|
let i = null, a = null;
|
|
158
|
-
if (typeof t == "string" ?
|
|
158
|
+
if (typeof t == "string" ? tt(t) ? i = t : a = t : "scope" in t ? i = t.scope : a = t.name, a !== null) {
|
|
159
159
|
let t = G(e).find((e) => e.name === a);
|
|
160
160
|
return t ? {
|
|
161
161
|
node: t,
|
|
@@ -185,7 +185,7 @@ function q({ from: e, target: t, path: n, pathname: r }) {
|
|
|
185
185
|
node: e,
|
|
186
186
|
message: "router: \"nearest-owner\" needs a route to search for, and pop() carries none. Falling back to \"current\" — name the Router explicitly for a cross-Router pop."
|
|
187
187
|
};
|
|
188
|
-
let t = G(e).find((e) =>
|
|
188
|
+
let t = G(e).find((e) => nt(e, n, r));
|
|
189
189
|
return t ? {
|
|
190
190
|
node: t,
|
|
191
191
|
message: null
|
|
@@ -200,15 +200,15 @@ function q({ from: e, target: t, path: n, pathname: r }) {
|
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function rt(e) {
|
|
204
204
|
if (!e.name) return null;
|
|
205
205
|
for (let t = e.parent; t; t = t.parent) if (t.name === e.name) return t;
|
|
206
206
|
return null;
|
|
207
207
|
}
|
|
208
208
|
//#endregion
|
|
209
209
|
//#region src/Slot.tsx
|
|
210
|
-
var
|
|
211
|
-
function
|
|
210
|
+
var it = { contained: !0 };
|
|
211
|
+
function at({ children: e, className: t, style: n }) {
|
|
212
212
|
return /* @__PURE__ */ P("div", {
|
|
213
213
|
className: t,
|
|
214
214
|
style: {
|
|
@@ -216,34 +216,34 @@ function rt({ children: e, className: t, style: n }) {
|
|
|
216
216
|
overflow: "hidden",
|
|
217
217
|
...n
|
|
218
218
|
},
|
|
219
|
-
children: /* @__PURE__ */ P(
|
|
220
|
-
value:
|
|
221
|
-
children: /* @__PURE__ */ P(
|
|
219
|
+
children: /* @__PURE__ */ P(Je.Provider, {
|
|
220
|
+
value: it,
|
|
221
|
+
children: /* @__PURE__ */ P(qe, { children: e })
|
|
222
222
|
})
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
//#endregion
|
|
226
226
|
//#region src/Router.tsx
|
|
227
|
-
function
|
|
227
|
+
function ot(e) {
|
|
228
228
|
let t = null;
|
|
229
229
|
return n.forEach(e, (e) => {
|
|
230
230
|
if (t || !i(e)) return;
|
|
231
|
-
if (e.type ===
|
|
231
|
+
if (e.type === at) {
|
|
232
232
|
t = n.toArray(e.props.children).filter(i);
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
235
235
|
let r = e.props.children;
|
|
236
236
|
if (r) {
|
|
237
|
-
let e =
|
|
237
|
+
let e = ot(r);
|
|
238
238
|
e && (t = e);
|
|
239
239
|
}
|
|
240
240
|
}), t;
|
|
241
241
|
}
|
|
242
|
-
var J = typeof window > "u" ? s : d,
|
|
243
|
-
function
|
|
244
|
-
let re = o(
|
|
242
|
+
var J = typeof window > "u" ? s : d, st = typeof window > "u" ? s : u, Y = [], ct = [], lt = [], ut = { contained: !0 }, dt = 500, ft = 3e3;
|
|
243
|
+
function pt({ children: e, name: t, strictRoutes: r = !1, initPath: a = "/", defaultTransitionName: l = "cupertino", transitions: u = Y, decorators: d = ct, partTransitions: f = lt, history: p = "browser", createDriver: ee, className: te, style: ne }) {
|
|
244
|
+
let re = o(et), ie = c(), [ae, oe] = m(!1);
|
|
245
245
|
s(() => oe(!0), []);
|
|
246
|
-
let se = ae ? ie : null, h = re > 0, g = p === "memory", v = c(), y = o(R), ce = o(F), b = h && y.id ? `_F_${ce?.routerKey ?? ""}${y.id}_` : v, x =
|
|
246
|
+
let se = ae ? ie : null, h = re > 0, g = p === "memory", v = c(), y = o(R), ce = o(F), b = h && y.id ? `_F_${ce?.routerKey ?? ""}${y.id}_` : v, x = ot(e), le = x !== null, S = (x ?? n.toArray(e).filter(i)).flatMap((e) => e.props?.path ? [e.props.path].flat() : []), C = h ? null : ce, T = C !== null, E = ee ?? _, [D] = m(() => g ? null : E(T ? void 0 : b)), ue = !h && !g && !xe(), O = ue && D ? D.readPathname() : a || "/", de = O.indexOf("?"), k = (de >= 0 ? O.slice(0, de) : O) || "/", fe = ue ? window.location.search : de >= 0 ? O.slice(de) : "", [A] = m(() => w({
|
|
247
247
|
routePaths: S,
|
|
248
248
|
pathname: k,
|
|
249
249
|
search: fe,
|
|
@@ -266,25 +266,25 @@ function dt({ children: e, name: t, strictRoutes: r = !1, initPath: a = "/", def
|
|
|
266
266
|
parent: pe,
|
|
267
267
|
depth: re
|
|
268
268
|
}));
|
|
269
|
-
|
|
269
|
+
st(() => {
|
|
270
270
|
j.name = t, j.stores = A, j.routePaths = S, j.strictRoutes = r, j.parent = pe;
|
|
271
271
|
}), s(() => {
|
|
272
|
-
|
|
272
|
+
rt(j) && Qe(`duplicate <Router name="${j.name}">: an enclosing <Router> already uses that name, so \`router\` targets resolve to the nearer one. Give each nested Router a unique name.`);
|
|
273
273
|
}, [j, t]), J(() => (A.life.alive = !0, () => {
|
|
274
274
|
A.life.alive = !1;
|
|
275
|
-
}), [A]),
|
|
276
|
-
let e =
|
|
277
|
-
if (e !== "off") return e === "on" ||
|
|
275
|
+
}), [A]), Xe(u, d, f), s(() => {
|
|
276
|
+
let e = ke();
|
|
277
|
+
if (e !== "off") return e === "on" || N() ? he() : void 0;
|
|
278
278
|
}, []), s(() => me(), []), s(() => {
|
|
279
279
|
if (typeof document > "u") return;
|
|
280
280
|
let e = null, t = null, n = 0, r = () => {
|
|
281
281
|
let r = Date.now();
|
|
282
|
-
if (r - n <
|
|
282
|
+
if (r - n < dt) return;
|
|
283
283
|
n = r, t && clearTimeout(t);
|
|
284
284
|
let i = e;
|
|
285
285
|
e = M(), i?.(), t = setTimeout(() => {
|
|
286
286
|
t = null, e?.(), e = null;
|
|
287
|
-
},
|
|
287
|
+
}, ft);
|
|
288
288
|
}, i = [
|
|
289
289
|
"pointerdown",
|
|
290
290
|
"pointermove",
|
|
@@ -298,7 +298,7 @@ function dt({ children: e, name: t, strictRoutes: r = !1, initPath: a = "/", def
|
|
|
298
298
|
t && clearTimeout(t), e?.();
|
|
299
299
|
};
|
|
300
300
|
}, []), s(() => {
|
|
301
|
-
g || !D ||
|
|
301
|
+
g || !D || Le({
|
|
302
302
|
driver: D,
|
|
303
303
|
routerKey: T ? null : b,
|
|
304
304
|
nested: h && !T,
|
|
@@ -316,16 +316,16 @@ function dt({ children: e, name: t, strictRoutes: r = !1, initPath: a = "/", def
|
|
|
316
316
|
A.history,
|
|
317
317
|
D
|
|
318
318
|
]);
|
|
319
|
-
let ge = le ? e : /* @__PURE__ */ P(
|
|
319
|
+
let ge = le ? e : /* @__PURE__ */ P(qe, { children: e }), _e = /* @__PURE__ */ P(Ke.Provider, {
|
|
320
320
|
value: se,
|
|
321
|
-
children: /* @__PURE__ */ P(
|
|
321
|
+
children: /* @__PURE__ */ P(et.Provider, {
|
|
322
322
|
value: re + 1,
|
|
323
323
|
children: /* @__PURE__ */ P(U.Provider, {
|
|
324
324
|
value: j,
|
|
325
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ Be(F.Provider, {
|
|
326
326
|
value: A,
|
|
327
|
-
children: [!g && /* @__PURE__ */ P(L, {}), h ? /* @__PURE__ */ P(
|
|
328
|
-
value:
|
|
327
|
+
children: [!g && /* @__PURE__ */ P(L, {}), h ? /* @__PURE__ */ P(Je.Provider, {
|
|
328
|
+
value: ut,
|
|
329
329
|
children: ge
|
|
330
330
|
}) : ge]
|
|
331
331
|
})
|
|
@@ -344,12 +344,12 @@ function dt({ children: e, name: t, strictRoutes: r = !1, initPath: a = "/", def
|
|
|
344
344
|
}
|
|
345
345
|
//#endregion
|
|
346
346
|
//#region src/Route.tsx
|
|
347
|
-
function
|
|
347
|
+
function mt({ element: e }) {
|
|
348
348
|
return e;
|
|
349
349
|
}
|
|
350
350
|
//#endregion
|
|
351
351
|
//#region src/utils/buildRoutePath.ts
|
|
352
|
-
function
|
|
352
|
+
function ht(e, t) {
|
|
353
353
|
return re(e, t);
|
|
354
354
|
}
|
|
355
355
|
//#endregion
|
|
@@ -364,7 +364,7 @@ function X(e) {
|
|
|
364
364
|
}, r = (t, r, i) => {
|
|
365
365
|
let a = t ?? e?.router, o;
|
|
366
366
|
if (r) try {
|
|
367
|
-
o =
|
|
367
|
+
o = ht(r, i).toPathname;
|
|
368
368
|
} catch {
|
|
369
369
|
o = void 0;
|
|
370
370
|
}
|
|
@@ -374,14 +374,14 @@ function X(e) {
|
|
|
374
374
|
path: r,
|
|
375
375
|
pathname: o
|
|
376
376
|
});
|
|
377
|
-
if (!s) return
|
|
378
|
-
if (c &&
|
|
377
|
+
if (!s) return $e(c ?? "the requested Router could not be resolved."), null;
|
|
378
|
+
if (c && Qe(c), r && !nt(s, r, o)) {
|
|
379
379
|
let e = `"${r}" is not declared by ${s.name ? `<Router name="${s.name}">` : "the target <Router>"}, so the navigation cannot mount a screen there. Declare a matching <Route>, target the Router that owns it, or use \`router: "nearest-owner"\`.`;
|
|
380
|
-
a !== void 0 || s.strictRoutes ?
|
|
380
|
+
a !== void 0 || s.strictRoutes ? $e(e) : Qe(e);
|
|
381
381
|
}
|
|
382
382
|
return b({
|
|
383
383
|
stores: s.stores,
|
|
384
|
-
buildPathname: (e, t) =>
|
|
384
|
+
buildPathname: (e, t) => ht(e, t),
|
|
385
385
|
driver: s.stores.driver,
|
|
386
386
|
markSelfInduced: s.stores.markSelfInduced
|
|
387
387
|
});
|
|
@@ -403,21 +403,21 @@ function X(e) {
|
|
|
403
403
|
}
|
|
404
404
|
//#endregion
|
|
405
405
|
//#region src/navigate/usePathname.ts
|
|
406
|
-
function
|
|
406
|
+
function gt() {
|
|
407
407
|
return H((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
|
|
408
408
|
}
|
|
409
409
|
//#endregion
|
|
410
410
|
//#region src/navigate/useStep.ts
|
|
411
|
-
function
|
|
412
|
-
let { routePath: e } = z(), t = I(), n = o(
|
|
411
|
+
function _t() {
|
|
412
|
+
let { routePath: e } = z(), t = I(), n = o(He), { driver: r, markSelfInduced: i } = t, [a, c] = m(null);
|
|
413
413
|
s(() => {
|
|
414
|
-
if (!e) return c(
|
|
414
|
+
if (!e) return c(Ne(r.readState())), r.subscribe((e) => c(Ne(e.state)));
|
|
415
415
|
}, [e, r]);
|
|
416
416
|
let l = D({
|
|
417
417
|
stores: t,
|
|
418
418
|
driver: r,
|
|
419
419
|
markSelfInduced: i,
|
|
420
|
-
buildStepPathname: (t) => e ?
|
|
420
|
+
buildStepPathname: (t) => e ? ht(e, t).pathname : ne(r.readPathname(), t),
|
|
421
421
|
applyParams: (t) => {
|
|
422
422
|
n({
|
|
423
423
|
type: "SET",
|
|
@@ -434,23 +434,23 @@ function ht() {
|
|
|
434
434
|
}
|
|
435
435
|
//#endregion
|
|
436
436
|
//#region src/screen/ParamsProvider/useParams.ts
|
|
437
|
-
function
|
|
437
|
+
function vt() {
|
|
438
438
|
return o(B);
|
|
439
439
|
}
|
|
440
440
|
//#endregion
|
|
441
441
|
//#region src/screen/ScreenFreeze.tsx
|
|
442
|
-
var
|
|
443
|
-
function
|
|
442
|
+
var yt = 3e3;
|
|
443
|
+
function bt({ freeze: e, children: n }) {
|
|
444
444
|
let [r, i] = m(e), a = p(null);
|
|
445
445
|
return !e && r && i(!1), s(() => {
|
|
446
446
|
if (!(!e || r)) {
|
|
447
|
-
if (!
|
|
447
|
+
if (!ye()) {
|
|
448
448
|
i(!0);
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
451
|
return a.current = setTimeout(() => {
|
|
452
452
|
a.current = null, i(!0);
|
|
453
|
-
},
|
|
453
|
+
}, yt), () => {
|
|
454
454
|
a.current !== null && (clearTimeout(a.current), a.current = null);
|
|
455
455
|
};
|
|
456
456
|
}
|
|
@@ -461,22 +461,22 @@ function vt({ freeze: e, children: n }) {
|
|
|
461
461
|
}
|
|
462
462
|
//#endregion
|
|
463
463
|
//#region src/screen/scopeAnimHoldCoordinator.ts
|
|
464
|
-
var
|
|
465
|
-
function
|
|
466
|
-
let t =
|
|
467
|
-
return t || (t = h(),
|
|
464
|
+
var xt = /* @__PURE__ */ new WeakMap();
|
|
465
|
+
function St(e) {
|
|
466
|
+
let t = xt.get(e);
|
|
467
|
+
return t || (t = h(), xt.set(e, t)), t;
|
|
468
468
|
}
|
|
469
469
|
//#endregion
|
|
470
470
|
//#region src/stores/useNavigateStore.ts
|
|
471
|
-
function
|
|
471
|
+
function Ct(e) {
|
|
472
472
|
return V(I().navigate, e);
|
|
473
473
|
}
|
|
474
474
|
//#endregion
|
|
475
475
|
//#region src/screen/ScreenDecorator.tsx
|
|
476
|
-
function
|
|
476
|
+
function wt({ ref: e, style: t, ...n }) {
|
|
477
477
|
let { isActive: r, isPrev: i, transitionName: a } = z(), o = p(null);
|
|
478
478
|
l(e, () => o.current);
|
|
479
|
-
let s =
|
|
479
|
+
let s = Ct((e) => i ? "COMPLETED" : e.status), { decoratorName: c } = Ie(a), u = fe.get(c);
|
|
480
480
|
return u ? /* @__PURE__ */ P("div", {
|
|
481
481
|
ref: o,
|
|
482
482
|
"data-flemo-decorator": !0,
|
|
@@ -498,9 +498,9 @@ function xt({ ref: e, style: t, ...n }) {
|
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region src/screen/useViewportScrollHeight.ts
|
|
501
|
-
function
|
|
501
|
+
function Tt() {
|
|
502
502
|
let [e, t] = m(0), [n, r] = m(0);
|
|
503
|
-
return s(() =>
|
|
503
|
+
return s(() => Te((e, n) => {
|
|
504
504
|
r(n), t(e);
|
|
505
505
|
}), []), {
|
|
506
506
|
viewportScrollHeight: e,
|
|
@@ -509,9 +509,9 @@ function St() {
|
|
|
509
509
|
}
|
|
510
510
|
//#endregion
|
|
511
511
|
//#region src/utils/useHydrationSafeFlag.ts
|
|
512
|
-
var
|
|
513
|
-
function
|
|
514
|
-
return ee(
|
|
512
|
+
var Z = () => () => {}, Q = () => !1;
|
|
513
|
+
function Et(e) {
|
|
514
|
+
return ee(Z, e, Q);
|
|
515
515
|
}
|
|
516
516
|
//#endregion
|
|
517
517
|
//#region src/stores/useScreenStore.ts
|
|
@@ -520,26 +520,26 @@ function $(e) {
|
|
|
520
520
|
}
|
|
521
521
|
//#endregion
|
|
522
522
|
//#region src/screen/ScreenMotion.tsx
|
|
523
|
-
function
|
|
524
|
-
let { id: _, isActive: v, isRoot: y, isPrev: ce, zIndex: b, transitionName: x, prevTransitionName: le } = z(), { contained: S } =
|
|
523
|
+
function Dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: c, sharedTopBarId: l, sharedBottomBar: u, sharedBottomBarId: f, topBar: ee, bottomBar: ne, hideStatusBar: re, hideSystemNavigationBar: oe, backgroundColor: se = "white", contentScrollable: h = !0, ...g }) {
|
|
524
|
+
let { id: _, isActive: v, isRoot: y, isPrev: ce, zIndex: b, transitionName: x, prevTransitionName: le } = z(), { contained: S } = Ye(), C = S ? "absolute" : "fixed", w = I(), T = o(Ke), E = H((e) => e.index), D = H((e) => e.histories), O = v || b === E - 1, k = Ct((e) => O ? e.status : "COMPLETED"), me = $((e) => e.dragStatus), he = $((e) => e.replaceTransitionStatus), j = w.screen.getState().setDragStatus, _e = w.screen.getState().setReplaceTransitionStatus, M = v ? D[E - 1]?.id : D[E]?.id, ye = $((e) => M ? e.sharedBars[M] : void 0), N = $((e) => M ? e.sharedBarMetadata[M] : void 0), xe = $((e) => M ? e.screenSurfaces[M] : void 0), Se = p(null);
|
|
525
525
|
Se.current ||= de({
|
|
526
526
|
getTransitionTaskId: () => w.navigate.getState().transitionTaskId,
|
|
527
527
|
setDragStatus: j,
|
|
528
528
|
setReplaceTransitionStatus: _e
|
|
529
529
|
});
|
|
530
|
-
let
|
|
531
|
-
Te.current ||=
|
|
532
|
-
let Ee =
|
|
530
|
+
let Ce = Se.current, Te = p(null);
|
|
531
|
+
Te.current ||= St(w.navigate);
|
|
532
|
+
let Ee = Ie(x), { initial: ke, swipeDirection: Ne, decoratorName: Pe } = Ee, Fe = fe.get(Pe), { viewportScrollHeight: Le } = Tt(), ze = Le > 0, F = !!c, L = !!u, R = F ? `${typeof l}:${String(l)}` : null, B = L ? `${typeof f}:${String(f)}` : null, [He, Ue] = m({
|
|
533
533
|
key: R,
|
|
534
534
|
height: 0
|
|
535
|
-
}), [
|
|
535
|
+
}), [We, Ge] = m({
|
|
536
536
|
key: B,
|
|
537
537
|
height: 0
|
|
538
|
-
}), V = p(
|
|
538
|
+
}), V = p(He), qe = p(We), Je = He.key === R ? He.height : 0, Xe = We.key === B ? We.height : 0, Ze = Re(F ? { id: l } : void 0, N?.topBar) ? N?.topBar?.height ?? 0 : 0, Qe = Re(L ? { id: f } : void 0, N?.bottomBar) ? N?.bottomBar?.height ?? 0 : 0, $e = Je || Ze, et = Xe || Qe, U = p(null), W = p(null), tt = p(null), G = p(null), nt = p(null), K = p(null), q = p(null), rt = a((e) => {
|
|
539
539
|
e <= 0 || R === null || (G.current && (G.current.style.minHeight = `${e}px`), V.current = {
|
|
540
540
|
key: R,
|
|
541
541
|
height: e
|
|
542
|
-
},
|
|
542
|
+
}, Ue((t) => t.key === R && t.height === e ? t : {
|
|
543
543
|
key: R,
|
|
544
544
|
height: e
|
|
545
545
|
}), w.screen.getState().updateSharedBarHeight(_, "topBar", e));
|
|
@@ -547,11 +547,11 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
547
547
|
_,
|
|
548
548
|
w.screen,
|
|
549
549
|
R
|
|
550
|
-
]),
|
|
551
|
-
e <= 0 || B === null || (
|
|
550
|
+
]), it = a((e) => {
|
|
551
|
+
e <= 0 || B === null || (nt.current && (nt.current.style.minHeight = `${e}px`), qe.current = {
|
|
552
552
|
key: B,
|
|
553
553
|
height: e
|
|
554
|
-
},
|
|
554
|
+
}, Ge((t) => t.key === B && t.height === e ? t : {
|
|
555
555
|
key: B,
|
|
556
556
|
height: e
|
|
557
557
|
}), w.screen.getState().updateSharedBarHeight(_, "bottomBar", e));
|
|
@@ -559,18 +559,18 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
559
559
|
B,
|
|
560
560
|
_,
|
|
561
561
|
w.screen
|
|
562
|
-
]),
|
|
563
|
-
K.current = e, e?.offsetHeight &&
|
|
564
|
-
}, [
|
|
565
|
-
q.current = e, e?.offsetHeight &&
|
|
566
|
-
}, [
|
|
562
|
+
]), at = a((e) => {
|
|
563
|
+
K.current = e, e?.offsetHeight && rt(e.offsetHeight);
|
|
564
|
+
}, [rt]), ot = a((e) => {
|
|
565
|
+
q.current = e, e?.offsetHeight && it(e.offsetHeight);
|
|
566
|
+
}, [it]), J = p({
|
|
567
567
|
transition: Ee,
|
|
568
|
-
decorator:
|
|
568
|
+
decorator: Fe,
|
|
569
569
|
hasSharedTopBar: !!c,
|
|
570
570
|
hasSharedBottomBar: !!u,
|
|
571
571
|
sharedTopBarId: l,
|
|
572
572
|
sharedBottomBarId: f,
|
|
573
|
-
viewportScrollHeight:
|
|
573
|
+
viewportScrollHeight: Le,
|
|
574
574
|
isRoot: y,
|
|
575
575
|
isActive: v,
|
|
576
576
|
status: k,
|
|
@@ -579,26 +579,26 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
579
579
|
});
|
|
580
580
|
J.current = {
|
|
581
581
|
transition: Ee,
|
|
582
|
-
decorator:
|
|
582
|
+
decorator: Fe,
|
|
583
583
|
hasSharedTopBar: !!c,
|
|
584
584
|
hasSharedBottomBar: !!u,
|
|
585
585
|
sharedTopBarId: l,
|
|
586
586
|
sharedBottomBarId: f,
|
|
587
|
-
viewportScrollHeight:
|
|
587
|
+
viewportScrollHeight: Le,
|
|
588
588
|
isRoot: y,
|
|
589
589
|
isActive: v,
|
|
590
590
|
status: k,
|
|
591
591
|
dragStatus: me,
|
|
592
592
|
index: E
|
|
593
593
|
};
|
|
594
|
-
let
|
|
595
|
-
|
|
594
|
+
let st = p(null);
|
|
595
|
+
st.current ||= ue({
|
|
596
596
|
getTransition: () => J.current.transition,
|
|
597
597
|
getDecorator: () => J.current.decorator,
|
|
598
598
|
getElements: () => ({
|
|
599
599
|
scope: W.current,
|
|
600
600
|
screenContainer: U.current,
|
|
601
|
-
decorator:
|
|
601
|
+
decorator: tt.current,
|
|
602
602
|
sharedTopBar: K.current,
|
|
603
603
|
sharedBottomBar: q.current
|
|
604
604
|
}),
|
|
@@ -622,7 +622,7 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
622
622
|
setDragStatus: j,
|
|
623
623
|
back: () => window.history.back()
|
|
624
624
|
});
|
|
625
|
-
let Y =
|
|
625
|
+
let Y = st.current, ct = (e) => Y.pointerDown(e.nativeEvent), lt = (e) => Y.pointerMove(e.nativeEvent), ut = (e) => Y.pointerUp(e.nativeEvent), dt = (e) => Y.pointerCancel(e.nativeEvent), ft = (e) => {
|
|
626
626
|
(k === "PUSHING" || k === "REPLACING") && (e.preventDefault(), e.stopPropagation());
|
|
627
627
|
};
|
|
628
628
|
s(() => {
|
|
@@ -637,7 +637,7 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
637
637
|
e.removeEventListener("touchmove", t);
|
|
638
638
|
};
|
|
639
639
|
}, [Y]), d(() => {
|
|
640
|
-
let { registerSharedBars: e, unregisterSharedBars: t } = w.screen.getState(), n = V.current, r =
|
|
640
|
+
let { registerSharedBars: e, unregisterSharedBars: t } = w.screen.getState(), n = V.current, r = qe.current;
|
|
641
641
|
return e(_, {
|
|
642
642
|
topBar: F,
|
|
643
643
|
bottomBar: L
|
|
@@ -662,11 +662,11 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
662
662
|
R
|
|
663
663
|
]), d(() => {
|
|
664
664
|
let e = K.current;
|
|
665
|
-
if (e) return
|
|
666
|
-
}, [
|
|
665
|
+
if (e) return we(e, rt);
|
|
666
|
+
}, [rt, c]), d(() => {
|
|
667
667
|
let e = q.current;
|
|
668
|
-
if (e) return
|
|
669
|
-
}, [
|
|
668
|
+
if (e) return we(e, it);
|
|
669
|
+
}, [it, u]), d(() => {
|
|
670
670
|
let e = W.current;
|
|
671
671
|
if (!e) return;
|
|
672
672
|
let { registerScreenSurface: t, unregisterScreenSurface: n } = w.screen.getState();
|
|
@@ -677,9 +677,9 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
677
677
|
k,
|
|
678
678
|
w.screen
|
|
679
679
|
]);
|
|
680
|
-
let
|
|
680
|
+
let pt = O, { app: mt, nav: ht } = ie({
|
|
681
681
|
status: k,
|
|
682
|
-
isTopOrTopPrev:
|
|
682
|
+
isTopOrTopPrev: pt,
|
|
683
683
|
hasTopBar: F,
|
|
684
684
|
hasNavBar: L,
|
|
685
685
|
topBarId: l,
|
|
@@ -688,9 +688,9 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
688
688
|
partnerMetadata: N
|
|
689
689
|
}), X = te({
|
|
690
690
|
status: k,
|
|
691
|
-
isTopOrTopPrev:
|
|
691
|
+
isTopOrTopPrev: pt,
|
|
692
692
|
transitionName: x
|
|
693
|
-
}),
|
|
693
|
+
}), gt = ae({
|
|
694
694
|
isActive: v,
|
|
695
695
|
isPrev: ce,
|
|
696
696
|
zIndex: b,
|
|
@@ -698,19 +698,19 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
698
698
|
status: k,
|
|
699
699
|
dragStatus: me,
|
|
700
700
|
replaceTransitionStatus: he
|
|
701
|
-
}),
|
|
701
|
+
}), _t = p(gt), vt = p(X !== null && gt), yt = p(null), [bt, xt] = m({
|
|
702
702
|
key: X,
|
|
703
703
|
released: X === null
|
|
704
704
|
});
|
|
705
|
-
|
|
705
|
+
bt.key !== X && (xt({
|
|
706
706
|
key: X,
|
|
707
707
|
released: X === null
|
|
708
|
-
}),
|
|
709
|
-
let Z = X !== null &&
|
|
710
|
-
d(() =>
|
|
708
|
+
}), yt.current = null, vt.current = X !== null && _t.current), _t.current = gt;
|
|
709
|
+
let Z = X !== null && bt.key === X && !bt.released && yt.current !== X, Q = Z ? !v && xe?.opaqueBackground ? "park" : v && (k === "PUSHING" || k === "REPLACING") && xe?.opaqueBackground ? je() || ve() ? "park-over" : "park-under" : "true" : "false", Dt = Et(Ae);
|
|
710
|
+
d(() => Ce.driveScreenLifecycle({
|
|
711
711
|
getElements: () => ({
|
|
712
712
|
scope: W.current,
|
|
713
|
-
decorator:
|
|
713
|
+
decorator: tt.current,
|
|
714
714
|
bars: [K.current, q.current]
|
|
715
715
|
}),
|
|
716
716
|
transitionName: x,
|
|
@@ -719,7 +719,7 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
719
719
|
isActive: v,
|
|
720
720
|
animHoldReleased: !Z
|
|
721
721
|
}), [
|
|
722
|
-
|
|
722
|
+
Ce,
|
|
723
723
|
k,
|
|
724
724
|
v,
|
|
725
725
|
le,
|
|
@@ -729,23 +729,27 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
729
729
|
if (!Z || X === null) return;
|
|
730
730
|
let e = X, t = w.navigate.getState().transitionTaskId, n = t === null ? e : `${e}#${t}`;
|
|
731
731
|
return Te.current.join(n, () => {
|
|
732
|
-
|
|
732
|
+
let t = (J.current.transition.driver === "native" || ve() || Oe()) && !A();
|
|
733
|
+
if (t) {
|
|
733
734
|
for (let e of [
|
|
734
735
|
W.current,
|
|
735
736
|
K.current,
|
|
736
737
|
q.current,
|
|
737
|
-
|
|
738
|
+
tt.current
|
|
738
739
|
]) e?.isConnected && e.getAttribute("data-flemo-anim-hold") !== null && e.setAttribute("data-flemo-anim-hold", "false");
|
|
739
|
-
U.current && (U.current.style.zIndex = "");
|
|
740
|
+
U.current && (U.current.style.zIndex = ""), yt.current = e;
|
|
741
|
+
}
|
|
742
|
+
{
|
|
743
|
+
let n = () => xt((t) => t.key === e && !t.released ? {
|
|
744
|
+
key: e,
|
|
745
|
+
released: !0
|
|
746
|
+
} : t);
|
|
747
|
+
t && De() && typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => n()) : Ve(n);
|
|
740
748
|
}
|
|
741
|
-
ze(() => vt((t) => t.key === e && !t.released ? {
|
|
742
|
-
key: e,
|
|
743
|
-
released: !0
|
|
744
|
-
} : t));
|
|
745
749
|
}, {
|
|
746
750
|
scope: W.current,
|
|
747
|
-
decodeWait:
|
|
748
|
-
contentSettle:
|
|
751
|
+
decodeWait: vt.current,
|
|
752
|
+
contentSettle: Me() && (v && k === "PUSHING" || k === "POPPING") ? {
|
|
749
753
|
firstWaitMs: 120,
|
|
750
754
|
capMs: 700,
|
|
751
755
|
graceMs: 60,
|
|
@@ -761,14 +765,14 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
761
765
|
k,
|
|
762
766
|
w.navigate
|
|
763
767
|
]);
|
|
764
|
-
let
|
|
765
|
-
initial:
|
|
768
|
+
let Ot = Q === "park-under" || Q === "park-over" ? {} : ge({
|
|
769
|
+
initial: ke,
|
|
766
770
|
isActive: v,
|
|
767
771
|
status: k
|
|
768
772
|
});
|
|
769
|
-
return /* @__PURE__ */
|
|
773
|
+
return /* @__PURE__ */ Be("div", {
|
|
770
774
|
ref: U,
|
|
771
|
-
onClickCapture:
|
|
775
|
+
onClickCapture: ft,
|
|
772
776
|
style: {
|
|
773
777
|
position: C,
|
|
774
778
|
top: 0,
|
|
@@ -783,13 +787,13 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
783
787
|
overscrollBehavior: "contain"
|
|
784
788
|
},
|
|
785
789
|
children: [
|
|
786
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ Be("div", {
|
|
787
791
|
ref: W,
|
|
788
792
|
...g,
|
|
789
|
-
onPointerDown:
|
|
790
|
-
onPointerMove:
|
|
791
|
-
onPointerUp:
|
|
792
|
-
onPointerCancel:
|
|
793
|
+
onPointerDown: ct,
|
|
794
|
+
onPointerMove: lt,
|
|
795
|
+
onPointerUp: ut,
|
|
796
|
+
onPointerCancel: dt,
|
|
793
797
|
"data-flemo-screen": !0,
|
|
794
798
|
"data-flemo-router": T ?? void 0,
|
|
795
799
|
"data-flemo-transition": x,
|
|
@@ -802,9 +806,9 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
802
806
|
height: "100%",
|
|
803
807
|
backgroundColor: se,
|
|
804
808
|
overflowY: h ? void 0 : "auto",
|
|
805
|
-
touchAction:
|
|
806
|
-
...
|
|
807
|
-
...
|
|
809
|
+
touchAction: Ne === "x" ? "pan-y" : Ne === "y" ? "pan-x" : "auto",
|
|
810
|
+
...Dt && (Q !== "false" || b === E && !S) ? { willChange: "transform" } : {},
|
|
811
|
+
...Ot,
|
|
808
812
|
...g.style
|
|
809
813
|
},
|
|
810
814
|
children: [
|
|
@@ -823,7 +827,7 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
823
827
|
"data-flemo-bar-spacer": "app",
|
|
824
828
|
style: {
|
|
825
829
|
width: "100%",
|
|
826
|
-
minHeight:
|
|
830
|
+
minHeight: $e
|
|
827
831
|
}
|
|
828
832
|
}),
|
|
829
833
|
ee,
|
|
@@ -838,17 +842,17 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
838
842
|
}),
|
|
839
843
|
ne,
|
|
840
844
|
u && /* @__PURE__ */ P("div", {
|
|
841
|
-
ref:
|
|
845
|
+
ref: nt,
|
|
842
846
|
"data-flemo-bar-spacer": "nav",
|
|
843
847
|
style: {
|
|
844
|
-
display:
|
|
848
|
+
display: ze ? "none" : void 0,
|
|
845
849
|
width: "100%",
|
|
846
|
-
minHeight:
|
|
850
|
+
minHeight: et
|
|
847
851
|
}
|
|
848
852
|
}),
|
|
849
853
|
!oe && r && /* @__PURE__ */ P("div", {
|
|
850
854
|
style: {
|
|
851
|
-
display:
|
|
855
|
+
display: ze ? "none" : void 0,
|
|
852
856
|
minHeight: r
|
|
853
857
|
},
|
|
854
858
|
children: /* @__PURE__ */ P("div", { style: {
|
|
@@ -862,7 +866,7 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
862
866
|
]
|
|
863
867
|
}),
|
|
864
868
|
c && /* @__PURE__ */ P("div", {
|
|
865
|
-
ref:
|
|
869
|
+
ref: at,
|
|
866
870
|
"data-flemo-bar": "app",
|
|
867
871
|
"data-flemo-bar-id": l,
|
|
868
872
|
"data-flemo-bar-id-type": l === void 0 ? void 0 : typeof l,
|
|
@@ -870,7 +874,7 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
870
874
|
"data-flemo-bar-transition": x,
|
|
871
875
|
"data-flemo-bar-status": k,
|
|
872
876
|
"data-flemo-bar-active": v ? "true" : "false",
|
|
873
|
-
"data-flemo-bar-riding":
|
|
877
|
+
"data-flemo-bar-riding": mt ? "true" : "false",
|
|
874
878
|
"data-flemo-anim-hold": Q,
|
|
875
879
|
style: {
|
|
876
880
|
position: C,
|
|
@@ -882,7 +886,7 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
882
886
|
children: c
|
|
883
887
|
}),
|
|
884
888
|
u && /* @__PURE__ */ P("div", {
|
|
885
|
-
ref:
|
|
889
|
+
ref: ot,
|
|
886
890
|
"data-flemo-bar": "nav",
|
|
887
891
|
"data-flemo-bar-id": f,
|
|
888
892
|
"data-flemo-bar-id-type": f === void 0 ? void 0 : typeof f,
|
|
@@ -890,10 +894,10 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
890
894
|
"data-flemo-bar-transition": x,
|
|
891
895
|
"data-flemo-bar-status": k,
|
|
892
896
|
"data-flemo-bar-active": v ? "true" : "false",
|
|
893
|
-
"data-flemo-bar-riding":
|
|
897
|
+
"data-flemo-bar-riding": ht ? "true" : "false",
|
|
894
898
|
"data-flemo-anim-hold": Q,
|
|
895
899
|
style: {
|
|
896
|
-
display:
|
|
900
|
+
display: ze ? "none" : void 0,
|
|
897
901
|
position: C,
|
|
898
902
|
bottom: oe ? 0 : r,
|
|
899
903
|
left: 0,
|
|
@@ -902,8 +906,8 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
902
906
|
},
|
|
903
907
|
children: u
|
|
904
908
|
}),
|
|
905
|
-
|
|
906
|
-
ref:
|
|
909
|
+
Fe && /* @__PURE__ */ P(wt, {
|
|
910
|
+
ref: tt,
|
|
907
911
|
"data-flemo-anim-hold": Q
|
|
908
912
|
})
|
|
909
913
|
]
|
|
@@ -911,8 +915,8 @@ function Tt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
911
915
|
}
|
|
912
916
|
//#endregion
|
|
913
917
|
//#region src/screen/Screen.tsx
|
|
914
|
-
function
|
|
915
|
-
let { isActive: n, isPrev: r, zIndex: i } = z(), a = H((e) => e.index), o =
|
|
918
|
+
function Ot({ children: e, ...t }) {
|
|
919
|
+
let { isActive: n, isPrev: r, zIndex: i } = z(), a = H((e) => e.index), o = Ct((e) => e.status), c = $((e) => e.dragStatus), l = $((e) => e.replaceTransitionStatus), u = oe({
|
|
916
920
|
isActive: n,
|
|
917
921
|
isPrev: r,
|
|
918
922
|
zIndex: i,
|
|
@@ -923,21 +927,21 @@ function Et({ children: e, ...t }) {
|
|
|
923
927
|
}), [d, f] = m(u !== "live");
|
|
924
928
|
return u === "live" && d && f(!1), u === "immediate" && !d && f(!0), s(() => {
|
|
925
929
|
if (u !== "deferred" || d) return;
|
|
926
|
-
let e = setTimeout(() => f(!0),
|
|
930
|
+
let e = setTimeout(() => f(!0), kt);
|
|
927
931
|
return () => clearTimeout(e);
|
|
928
|
-
}, [u, d]), /* @__PURE__ */ P(
|
|
932
|
+
}, [u, d]), /* @__PURE__ */ P(bt, {
|
|
929
933
|
freeze: d,
|
|
930
|
-
children: /* @__PURE__ */ P(
|
|
934
|
+
children: /* @__PURE__ */ P(Dt, {
|
|
931
935
|
...t,
|
|
932
936
|
children: e
|
|
933
937
|
})
|
|
934
938
|
});
|
|
935
939
|
}
|
|
936
|
-
var
|
|
940
|
+
var kt = 600;
|
|
937
941
|
//#endregion
|
|
938
942
|
//#region src/screen/Part.tsx
|
|
939
|
-
function
|
|
940
|
-
let { isActive: a, isPrev: s, navigateStore: c, routerId: l } = z(), u = o(
|
|
943
|
+
function At({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
944
|
+
let { isActive: a, isPrev: s, navigateStore: c, routerId: l } = z(), u = o(Ke), d = l ?? u ?? void 0, f = I(), p = V(c ?? f.navigate, (e) => s ? "COMPLETED" : e.status);
|
|
941
945
|
return /* @__PURE__ */ P("div", {
|
|
942
946
|
ref: e,
|
|
943
947
|
"data-flemo-part-name": t,
|
|
@@ -951,14 +955,14 @@ function Ot({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
|
951
955
|
}
|
|
952
956
|
//#endregion
|
|
953
957
|
//#region src/stores/RouterScopeProvider.tsx
|
|
954
|
-
function
|
|
958
|
+
function jt({ children: e }) {
|
|
955
959
|
let [t] = m(() => ({
|
|
956
960
|
history: y(),
|
|
957
961
|
navigate: ce(),
|
|
958
962
|
transition: k(),
|
|
959
963
|
screen: E(),
|
|
960
964
|
driver: _(),
|
|
961
|
-
markSelfInduced:
|
|
965
|
+
markSelfInduced: Se,
|
|
962
966
|
consume: se,
|
|
963
967
|
life: { alive: !0 }
|
|
964
968
|
}));
|
|
@@ -968,4 +972,4 @@ function kt({ children: e }) {
|
|
|
968
972
|
});
|
|
969
973
|
}
|
|
970
974
|
//#endregion
|
|
971
|
-
export {
|
|
975
|
+
export { At as Part, mt as Route, pt as Router, jt as RouterScopeProvider, Ot as Screen, R as ScreenContext, wt as ScreenDecorator, bt as ScreenFreeze, Dt as ScreenMotion, at as Slot, g as createBrowserHistoryDriver, v as createDecorator, x as createPartTransition, le as createRawDecorator, S as createRawPartTransition, C as createRawTransition, O as createTransition, Ee as partTransitionMap, H as useHistoryStore, X as useNavigate, Ct as useNavigateStore, vt as useParams, gt as usePathname, z as useScreen, $ as useScreenStore, _t as useStep, I as useStores, Tt as useViewportScrollHeight };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flemo/react",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.3",
|
|
4
4
|
"description": "React bindings for flemo: Router, Route, Screen, and the screen-transition runtime.",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"path-to-regexp": "^8.4.2",
|
|
38
38
|
"zustand": "^5.0.14",
|
|
39
|
-
"@flemo/core": "1.
|
|
39
|
+
"@flemo/core": "1.27.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@testing-library/jest-dom": "^6.9.1",
|