@flemo/react 1.8.2 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RouterIdContext.d.ts +2 -0
- package/dist/index.mjs +329 -310
- package/dist/screen/ScreenContext.d.ts +1 -0
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e, { Activity as t, Children as n, createContext as r, isValidElement as i, useContext as a, useEffect as o, useId as s, useImperativeHandle as c, useInsertionEffect as l, useLayoutEffect as u, useReducer as d, useRef as f, useState as p } from "react";
|
|
2
|
-
import { animHoldKey as ee, appendParamsQuery as m, buildRoutePath as
|
|
3
|
-
import { jsx as L, jsxs as
|
|
2
|
+
import { animHoldKey as ee, appendParamsQuery as m, buildRoutePath as te, computeBarRiding as h, computeScreenFreeze as g, computeScreenFreezeMode as _, consumeSelfInducedPop as v, createAnimHoldCoordinator as y, createBrowserHistoryDriver as b, createBrowserHistoryDriver as x, createDecorator as S, createHistoryStore as ne, createNavigateStore as C, createNavigationController as w, createPartTransition as re, createRawDecorator as T, createRawPartTransition as E, createRawTransition as D, createRouterScope as ie, createScreenSelector as O, createScreenStore as k, createStepController as ae, createSwipeController as A, createTransition as j, createTransitionEngine as oe, createTransitionStore as M, decoratorMap as se, detectBlinkEngine as ce, eagerlyDecodeImages as le, ensureGpuPipelinePrewarm as ue, ensureImageDecodeOffloader as de, ensureScopeHistorySync as fe, enteringInitialStyle as pe, getMatchedPathPattern as N, holdCompositorWarm as me, isOpaqueColor as he, isServer as ge, markSelfInducedPop as _e, matchesPathname as ve, observeBarHeight as ye, observeViewportScrollHeight as be, partTransitionMap as P, readStepParams as xe, registerTransitionDefinitions as Se, releaseScopeHistorySync as Ce, resolveTransition as we, seedRouterEntry as F, subscribeStepParamsRestore as I } from "@flemo/core";
|
|
3
|
+
import { jsx as L, jsxs as Te } from "react/jsx-runtime";
|
|
4
4
|
//#region src/stores/StoreContext.ts
|
|
5
5
|
var R = r(null);
|
|
6
6
|
//#endregion
|
|
@@ -12,9 +12,9 @@ function z() {
|
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/history/HistoryListener.tsx
|
|
15
|
-
function
|
|
15
|
+
function Ee() {
|
|
16
16
|
let e = z();
|
|
17
|
-
return o(() => (
|
|
17
|
+
return o(() => (fe(e), () => Ce(e)), [e]), null;
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/screen/ScreenContext.ts
|
|
@@ -38,7 +38,7 @@ function V() {
|
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/screen/ParamsProvider/ParamsContext.ts
|
|
41
|
-
var
|
|
41
|
+
var De = r({}), Oe = r(() => {});
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/screen/ParamsProvider/ParamsReducer.ts
|
|
44
44
|
function H(e, t) {
|
|
@@ -49,7 +49,7 @@ function H(e, t) {
|
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/screen/ParamsProvider/ParamsProvider.tsx
|
|
52
|
-
function
|
|
52
|
+
function U({ children: e }) {
|
|
53
53
|
let { isActive: t, params: n } = V(), { driver: r } = z(), [i, a] = d(H, n);
|
|
54
54
|
return o(() => {
|
|
55
55
|
if (t) return I(r, (e) => a({
|
|
@@ -60,30 +60,33 @@ function De({ children: e }) {
|
|
|
60
60
|
t,
|
|
61
61
|
a,
|
|
62
62
|
r
|
|
63
|
-
]), /* @__PURE__ */ L(
|
|
63
|
+
]), /* @__PURE__ */ L(Oe.Provider, {
|
|
64
64
|
value: a,
|
|
65
|
-
children: /* @__PURE__ */ L(
|
|
65
|
+
children: /* @__PURE__ */ L(De.Provider, {
|
|
66
66
|
value: i,
|
|
67
67
|
children: e
|
|
68
68
|
})
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
|
-
//#region ../../node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.
|
|
73
|
-
var
|
|
74
|
-
function
|
|
72
|
+
//#region ../../node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.18_react@19.2.8/node_modules/zustand/esm/react.mjs
|
|
73
|
+
var W = (e) => e;
|
|
74
|
+
function G(t, n = W) {
|
|
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 K(e) {
|
|
81
|
+
return G(z().history, e);
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
|
+
//#region src/RouterIdContext.ts
|
|
85
|
+
var ke = r(null);
|
|
86
|
+
//#endregion
|
|
84
87
|
//#region src/renderer/Renderer.tsx
|
|
85
|
-
function
|
|
86
|
-
let t =
|
|
88
|
+
function q({ children: e }) {
|
|
89
|
+
let t = K((e) => e.index), r = K((e) => e.histories), i = z(), o = a(B), s = a(ke);
|
|
87
90
|
return O(r, t).map((t) => {
|
|
88
91
|
let [r] = n.toArray(e).filter((e) => ve(e.props.path, t.pathname));
|
|
89
92
|
return r ? /* @__PURE__ */ L(B.Provider, {
|
|
@@ -91,22 +94,23 @@ function K({ children: e }) {
|
|
|
91
94
|
...t,
|
|
92
95
|
isPrev: t.isPrev || o.isPrev,
|
|
93
96
|
navigateStore: i.navigate,
|
|
94
|
-
|
|
97
|
+
routerId: s ?? void 0,
|
|
98
|
+
routePath: N(r.props.path, t.pathname)
|
|
95
99
|
},
|
|
96
|
-
children: /* @__PURE__ */ L(
|
|
100
|
+
children: /* @__PURE__ */ L(U, { children: r })
|
|
97
101
|
}, t.id) : null;
|
|
98
102
|
});
|
|
99
103
|
}
|
|
100
104
|
//#endregion
|
|
101
105
|
//#region src/screen/ScreenViewportContext.ts
|
|
102
|
-
var
|
|
103
|
-
function
|
|
104
|
-
return a(
|
|
106
|
+
var J = r({ contained: !1 });
|
|
107
|
+
function Ae() {
|
|
108
|
+
return a(J);
|
|
105
109
|
}
|
|
106
110
|
//#endregion
|
|
107
111
|
//#region src/transition/styles.ts
|
|
108
|
-
function
|
|
109
|
-
l(() =>
|
|
112
|
+
function je(e, t, n = []) {
|
|
113
|
+
l(() => Se(e, t, n), [
|
|
110
114
|
e,
|
|
111
115
|
t,
|
|
112
116
|
n
|
|
@@ -114,8 +118,8 @@ function J(e, t, n = []) {
|
|
|
114
118
|
}
|
|
115
119
|
//#endregion
|
|
116
120
|
//#region src/RouterDepthContext.ts
|
|
117
|
-
var
|
|
118
|
-
function
|
|
121
|
+
var Y = r(0), Me = { contained: !0 };
|
|
122
|
+
function Ne({ children: e, className: t, style: n }) {
|
|
119
123
|
return /* @__PURE__ */ L("div", {
|
|
120
124
|
className: t,
|
|
121
125
|
style: {
|
|
@@ -123,55 +127,58 @@ function je({ children: e, className: t, style: n }) {
|
|
|
123
127
|
overflow: "hidden",
|
|
124
128
|
...n
|
|
125
129
|
},
|
|
126
|
-
children: /* @__PURE__ */ L(
|
|
127
|
-
value:
|
|
128
|
-
children: /* @__PURE__ */ L(
|
|
130
|
+
children: /* @__PURE__ */ L(J.Provider, {
|
|
131
|
+
value: Me,
|
|
132
|
+
children: /* @__PURE__ */ L(q, { children: e })
|
|
129
133
|
})
|
|
130
134
|
});
|
|
131
135
|
}
|
|
132
136
|
//#endregion
|
|
133
137
|
//#region src/Router.tsx
|
|
134
|
-
function
|
|
138
|
+
function Pe(e) {
|
|
135
139
|
let t = null;
|
|
136
140
|
return n.forEach(e, (e) => {
|
|
137
141
|
if (t || !i(e)) return;
|
|
138
|
-
if (e.type ===
|
|
142
|
+
if (e.type === Ne) {
|
|
139
143
|
t = n.toArray(e.props.children).filter(i);
|
|
140
144
|
return;
|
|
141
145
|
}
|
|
142
146
|
let r = e.props.children;
|
|
143
147
|
if (r) {
|
|
144
|
-
let e =
|
|
148
|
+
let e = Pe(r);
|
|
145
149
|
e && (t = e);
|
|
146
150
|
}
|
|
147
151
|
}), t;
|
|
148
152
|
}
|
|
149
|
-
var
|
|
150
|
-
function
|
|
151
|
-
let m = a(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
var Fe = typeof window > "u" ? o : u, Ie = [], Le = [], X = [], Re = { contained: !0 }, ze = 500, Be = 3e3;
|
|
154
|
+
function Ve({ children: e, initPath: t = "/", defaultTransitionName: r = "cupertino", transitions: i = Ie, decorators: c = Le, partTransitions: l = X, history: u = "browser", createDriver: d, className: f, style: ee }) {
|
|
155
|
+
let m = a(Y), te = s(), h = m > 0, g = u === "memory", _ = s(), v = a(B), y = a(R), b = h && v.id ? `_F_${y?.routerKey ?? ""}${v.id}_` : _, S = Pe(e), ne = S !== null, C = h ? null : y, w = C !== null, re = d ?? x, [T] = p(() => g ? null : re(w ? void 0 : b)), E = !h && !g && !ge(), D = E && T ? T.readPathname() : t || "/", O = D.indexOf("?"), k = (O >= 0 ? D.slice(0, O) : D) || "/", ae = E ? window.location.search : O >= 0 ? D.slice(O) : "", [A] = p(() => {
|
|
156
|
+
let t = (S ?? n.toArray(e)).map((e) => e.props.path).flat();
|
|
157
|
+
return ie({
|
|
158
|
+
routePaths: t,
|
|
159
|
+
pathname: k,
|
|
160
|
+
search: ae,
|
|
161
|
+
defaultTransitionName: r,
|
|
162
|
+
memory: g,
|
|
163
|
+
browserDriver: T,
|
|
164
|
+
hostedScope: C,
|
|
165
|
+
routerKey: w ? void 0 : b,
|
|
166
|
+
zoneEntryId: h && !w && v.id || void 0,
|
|
167
|
+
persistKey: h && !g && !w ? b : void 0
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
A.transition.setState({ defaultTransitionName: r }), Fe(() => (A.life.alive = !0, () => {
|
|
164
171
|
A.life.alive = !1;
|
|
165
|
-
}), [A]),
|
|
172
|
+
}), [A]), je(i, c, l), o(() => de(), []), o(() => ue(), []), o(() => {
|
|
166
173
|
if (typeof document > "u") return;
|
|
167
174
|
let e = null, t = null, n = 0, r = () => {
|
|
168
175
|
let r = Date.now();
|
|
169
|
-
if (r - n <
|
|
176
|
+
if (r - n < ze) return;
|
|
170
177
|
n = r, t && clearTimeout(t);
|
|
171
178
|
let i = e;
|
|
172
179
|
e = me(), i?.(), t = setTimeout(() => {
|
|
173
180
|
t = null, e?.(), e = null;
|
|
174
|
-
},
|
|
181
|
+
}, Be);
|
|
175
182
|
}, i = [
|
|
176
183
|
"pointerdown",
|
|
177
184
|
"pointermove",
|
|
@@ -185,32 +192,35 @@ function ze({ children: e, initPath: t = "/", defaultTransitionName: r = "cupert
|
|
|
185
192
|
t && clearTimeout(t), e?.();
|
|
186
193
|
};
|
|
187
194
|
}, []), o(() => {
|
|
188
|
-
g || !
|
|
189
|
-
driver:
|
|
190
|
-
routerKey:
|
|
191
|
-
nested: h && !
|
|
192
|
-
seedPathname:
|
|
195
|
+
g || !T || F({
|
|
196
|
+
driver: T,
|
|
197
|
+
routerKey: w ? null : b,
|
|
198
|
+
nested: h && !w,
|
|
199
|
+
seedPathname: k,
|
|
193
200
|
defaultTransitionName: r,
|
|
194
201
|
rootParams: A.history.getState().histories[0]?.params ?? {}
|
|
195
202
|
});
|
|
196
203
|
}, [
|
|
197
204
|
g,
|
|
198
|
-
|
|
205
|
+
w,
|
|
199
206
|
h,
|
|
200
|
-
|
|
201
|
-
|
|
207
|
+
b,
|
|
208
|
+
k,
|
|
202
209
|
r,
|
|
203
210
|
A.history,
|
|
204
|
-
|
|
211
|
+
T
|
|
205
212
|
]);
|
|
206
|
-
let
|
|
207
|
-
value:
|
|
208
|
-
children: /* @__PURE__ */
|
|
209
|
-
value:
|
|
210
|
-
children:
|
|
211
|
-
value:
|
|
212
|
-
children:
|
|
213
|
-
|
|
213
|
+
let j = ne ? e : /* @__PURE__ */ L(q, { children: e }), oe = /* @__PURE__ */ L(ke.Provider, {
|
|
214
|
+
value: te,
|
|
215
|
+
children: /* @__PURE__ */ L(Y.Provider, {
|
|
216
|
+
value: m + 1,
|
|
217
|
+
children: /* @__PURE__ */ Te(R.Provider, {
|
|
218
|
+
value: A,
|
|
219
|
+
children: [!g && /* @__PURE__ */ L(Ee, {}), h ? /* @__PURE__ */ L(J.Provider, {
|
|
220
|
+
value: Re,
|
|
221
|
+
children: j
|
|
222
|
+
}) : j]
|
|
223
|
+
})
|
|
214
224
|
})
|
|
215
225
|
});
|
|
216
226
|
return h ? /* @__PURE__ */ L("div", {
|
|
@@ -225,18 +235,18 @@ function ze({ children: e, initPath: t = "/", defaultTransitionName: r = "cupert
|
|
|
225
235
|
}
|
|
226
236
|
//#endregion
|
|
227
237
|
//#region src/Route.tsx
|
|
228
|
-
function
|
|
238
|
+
function He({ element: e }) {
|
|
229
239
|
return e;
|
|
230
240
|
}
|
|
231
241
|
//#endregion
|
|
232
242
|
//#region src/utils/buildRoutePath.ts
|
|
233
243
|
function Z(e, t) {
|
|
234
|
-
return
|
|
244
|
+
return te(e, t);
|
|
235
245
|
}
|
|
236
246
|
//#endregion
|
|
237
247
|
//#region src/navigate/useNavigate.ts
|
|
238
|
-
function
|
|
239
|
-
let e = z(), t =
|
|
248
|
+
function Q() {
|
|
249
|
+
let e = z(), t = w({
|
|
240
250
|
stores: e,
|
|
241
251
|
buildPathname: (e, t) => Z(e, t),
|
|
242
252
|
driver: e.driver,
|
|
@@ -250,17 +260,17 @@ function Be() {
|
|
|
250
260
|
}
|
|
251
261
|
//#endregion
|
|
252
262
|
//#region src/navigate/usePathname.ts
|
|
253
|
-
function
|
|
254
|
-
return
|
|
263
|
+
function Ue() {
|
|
264
|
+
return K((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
|
|
255
265
|
}
|
|
256
266
|
//#endregion
|
|
257
267
|
//#region src/navigate/useStep.ts
|
|
258
|
-
function
|
|
259
|
-
let { routePath: e } = V(), t = z(), n = a(
|
|
268
|
+
function We() {
|
|
269
|
+
let { routePath: e } = V(), t = z(), n = a(Oe), { driver: r, markSelfInduced: i } = t, [s, c] = p(null);
|
|
260
270
|
o(() => {
|
|
261
|
-
if (!e) return c(
|
|
271
|
+
if (!e) return c(xe(r.readState())), r.subscribe((e) => c(xe(e.state)));
|
|
262
272
|
}, [e, r]);
|
|
263
|
-
let l =
|
|
273
|
+
let l = ae({
|
|
264
274
|
stores: t,
|
|
265
275
|
driver: r,
|
|
266
276
|
markSelfInduced: i,
|
|
@@ -281,12 +291,12 @@ function He() {
|
|
|
281
291
|
}
|
|
282
292
|
//#endregion
|
|
283
293
|
//#region src/screen/ParamsProvider/useParams.ts
|
|
284
|
-
function
|
|
285
|
-
return a(
|
|
294
|
+
function Ge() {
|
|
295
|
+
return a(De);
|
|
286
296
|
}
|
|
287
297
|
//#endregion
|
|
288
298
|
//#region src/screen/ScreenFreeze.tsx
|
|
289
|
-
function
|
|
299
|
+
function Ke({ freeze: e, children: n }) {
|
|
290
300
|
return /* @__PURE__ */ L(t, {
|
|
291
301
|
mode: e ? "hidden" : "visible",
|
|
292
302
|
children: n
|
|
@@ -294,22 +304,22 @@ function We({ freeze: e, children: n }) {
|
|
|
294
304
|
}
|
|
295
305
|
//#endregion
|
|
296
306
|
//#region src/screen/scopeAnimHoldCoordinator.ts
|
|
297
|
-
var
|
|
298
|
-
function
|
|
299
|
-
let t =
|
|
300
|
-
return t || (t = y(),
|
|
307
|
+
var qe = /* @__PURE__ */ new WeakMap();
|
|
308
|
+
function Je(e) {
|
|
309
|
+
let t = qe.get(e);
|
|
310
|
+
return t || (t = y(), qe.set(e, t)), t;
|
|
301
311
|
}
|
|
302
312
|
//#endregion
|
|
303
313
|
//#region src/stores/useNavigateStore.ts
|
|
304
|
-
function
|
|
305
|
-
return
|
|
314
|
+
function Ye(e) {
|
|
315
|
+
return G(z().navigate, e);
|
|
306
316
|
}
|
|
307
317
|
//#endregion
|
|
308
318
|
//#region src/screen/ScreenDecorator.tsx
|
|
309
|
-
function
|
|
319
|
+
function Xe({ ref: e, style: t, ...n }) {
|
|
310
320
|
let { isActive: r, isPrev: i, transitionName: a } = V(), o = f(null);
|
|
311
321
|
c(e, () => o.current);
|
|
312
|
-
let s =
|
|
322
|
+
let s = Ye((e) => i ? "COMPLETED" : e.status), { decoratorName: l } = we(a), u = se.get(l);
|
|
313
323
|
return u ? /* @__PURE__ */ L("div", {
|
|
314
324
|
ref: o,
|
|
315
325
|
"data-flemo-decorator": !0,
|
|
@@ -331,9 +341,9 @@ function qe({ ref: e, style: t, ...n }) {
|
|
|
331
341
|
}
|
|
332
342
|
//#endregion
|
|
333
343
|
//#region src/screen/useViewportScrollHeight.ts
|
|
334
|
-
function
|
|
344
|
+
function Ze() {
|
|
335
345
|
let [e, t] = p(0), [n, r] = p(0);
|
|
336
|
-
return o(() =>
|
|
346
|
+
return o(() => be((e, n) => {
|
|
337
347
|
r(n), t(e);
|
|
338
348
|
}), []), {
|
|
339
349
|
viewportScrollHeight: e,
|
|
@@ -343,200 +353,205 @@ function Je() {
|
|
|
343
353
|
//#endregion
|
|
344
354
|
//#region src/stores/useScreenStore.ts
|
|
345
355
|
function $(e) {
|
|
346
|
-
return
|
|
356
|
+
return G(z().screen, e);
|
|
347
357
|
}
|
|
348
358
|
//#endregion
|
|
349
359
|
//#region src/screen/ScreenMotion.tsx
|
|
350
|
-
function
|
|
351
|
-
let { id:
|
|
352
|
-
|
|
353
|
-
getTransitionTaskId: () =>
|
|
354
|
-
setDragStatus:
|
|
355
|
-
setReplaceTransitionStatus:
|
|
360
|
+
function Qe({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: s, sharedBottomBar: c, topBar: l, bottomBar: d, hideStatusBar: m, hideSystemNavigationBar: te, backgroundColor: _ = "white", contentScrollable: v = !0, ...y }) {
|
|
361
|
+
let { id: b, isActive: x, isRoot: S, isPrev: ne, zIndex: C, transitionName: w, prevTransitionName: re } = V(), { contained: T } = Ae(), E = T ? "absolute" : "fixed", D = z(), ie = a(ke), O = K((e) => e.index), k = K((e) => e.histories), ae = x || C === O - 1, j = Ye((e) => ae ? e.status : "COMPLETED"), M = $((e) => e.dragStatus), ue = $((e) => e.replaceTransitionStatus), de = D.screen.getState().setDragStatus, fe = D.screen.getState().setReplaceTransitionStatus, N = x ? k[O - 1]?.id : k[O]?.id, me = $((e) => N ? e.sharedBars[N] : void 0), ge = $((e) => N ? e.screenSurfaces[N] : void 0), _e = f(null);
|
|
362
|
+
_e.current ||= oe({
|
|
363
|
+
getTransitionTaskId: () => D.navigate.getState().transitionTaskId,
|
|
364
|
+
setDragStatus: de,
|
|
365
|
+
setReplaceTransitionStatus: fe
|
|
356
366
|
});
|
|
357
|
-
let
|
|
358
|
-
|
|
359
|
-
let
|
|
360
|
-
transition:
|
|
361
|
-
decorator:
|
|
362
|
-
hasSharedTopBar: !!
|
|
363
|
-
hasSharedBottomBar: !!
|
|
364
|
-
viewportScrollHeight:
|
|
365
|
-
isRoot:
|
|
366
|
-
isActive:
|
|
367
|
-
status:
|
|
368
|
-
dragStatus:
|
|
369
|
-
index:
|
|
367
|
+
let ve = _e.current, be = f(null);
|
|
368
|
+
be.current ||= Je(D.navigate);
|
|
369
|
+
let P = we(w), { initial: xe, swipeDirection: Se, decoratorName: Ce } = P, F = se.get(Ce), { viewportScrollHeight: I } = Ze(), R = I > 0, [Ee, B] = p(0), [De, Oe] = p(0), H = f(null), U = f(null), W = f(null), G = f(null), q = f(null), J = f({
|
|
370
|
+
transition: P,
|
|
371
|
+
decorator: F,
|
|
372
|
+
hasSharedTopBar: !!s,
|
|
373
|
+
hasSharedBottomBar: !!c,
|
|
374
|
+
viewportScrollHeight: I,
|
|
375
|
+
isRoot: S,
|
|
376
|
+
isActive: x,
|
|
377
|
+
status: j,
|
|
378
|
+
dragStatus: M,
|
|
379
|
+
index: O
|
|
370
380
|
});
|
|
371
|
-
|
|
372
|
-
transition:
|
|
373
|
-
decorator:
|
|
374
|
-
hasSharedTopBar: !!
|
|
375
|
-
hasSharedBottomBar: !!
|
|
376
|
-
viewportScrollHeight:
|
|
377
|
-
isRoot:
|
|
378
|
-
isActive:
|
|
379
|
-
status:
|
|
380
|
-
dragStatus:
|
|
381
|
-
index:
|
|
381
|
+
J.current = {
|
|
382
|
+
transition: P,
|
|
383
|
+
decorator: F,
|
|
384
|
+
hasSharedTopBar: !!s,
|
|
385
|
+
hasSharedBottomBar: !!c,
|
|
386
|
+
viewportScrollHeight: I,
|
|
387
|
+
isRoot: S,
|
|
388
|
+
isActive: x,
|
|
389
|
+
status: j,
|
|
390
|
+
dragStatus: M,
|
|
391
|
+
index: O
|
|
382
392
|
};
|
|
383
|
-
let
|
|
384
|
-
|
|
385
|
-
getTransition: () =>
|
|
386
|
-
getDecorator: () =>
|
|
393
|
+
let je = f(null);
|
|
394
|
+
je.current ||= A({
|
|
395
|
+
getTransition: () => J.current.transition,
|
|
396
|
+
getDecorator: () => J.current.decorator,
|
|
387
397
|
getElements: () => ({
|
|
388
|
-
scope:
|
|
389
|
-
screenContainer:
|
|
390
|
-
decorator:
|
|
391
|
-
sharedTopBar:
|
|
392
|
-
sharedBottomBar:
|
|
398
|
+
scope: U.current,
|
|
399
|
+
screenContainer: H.current,
|
|
400
|
+
decorator: W.current,
|
|
401
|
+
sharedTopBar: G.current,
|
|
402
|
+
sharedBottomBar: q.current
|
|
393
403
|
}),
|
|
394
|
-
hasSharedTopBar: () =>
|
|
395
|
-
hasSharedBottomBar: () =>
|
|
396
|
-
getViewportScrollHeight: () =>
|
|
404
|
+
hasSharedTopBar: () => J.current.hasSharedTopBar,
|
|
405
|
+
hasSharedBottomBar: () => J.current.hasSharedBottomBar,
|
|
406
|
+
getViewportScrollHeight: () => J.current.viewportScrollHeight,
|
|
397
407
|
isReadyForDrag: () => {
|
|
398
|
-
let e =
|
|
408
|
+
let e = J.current;
|
|
399
409
|
return !e.isRoot && e.isActive && e.status === "COMPLETED" && e.dragStatus === "IDLE" && !!e.transition.swipeDirection && e.viewportScrollHeight < 10;
|
|
400
410
|
},
|
|
401
411
|
getPartnerBars: () => {
|
|
402
|
-
let e =
|
|
403
|
-
return n ?
|
|
412
|
+
let e = J.current, t = D.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
|
|
413
|
+
return n ? D.screen.getState().sharedBars[n] : void 0;
|
|
404
414
|
},
|
|
405
|
-
setDragStatus:
|
|
415
|
+
setDragStatus: de,
|
|
406
416
|
back: () => window.history.back()
|
|
407
417
|
});
|
|
408
|
-
let
|
|
418
|
+
let Y = je.current, Me = (e) => Y.pointerDown(e.nativeEvent), Ne = (e) => Y.pointerMove(e.nativeEvent), Pe = (e) => Y.pointerUp(e.nativeEvent);
|
|
409
419
|
o(() => {
|
|
410
|
-
|
|
420
|
+
le(U.current);
|
|
411
421
|
}, []), o(() => {
|
|
412
|
-
let e =
|
|
422
|
+
let e = U.current;
|
|
413
423
|
if (!e) return;
|
|
414
424
|
let t = (e) => {
|
|
415
|
-
|
|
425
|
+
Y.shouldPreventTouch() && e.preventDefault(), e.target?.dataset.swipeAtEdgeBar === "true" && e.preventDefault();
|
|
416
426
|
};
|
|
417
427
|
return e.addEventListener("touchmove", t, { passive: !1 }), () => {
|
|
418
428
|
e.removeEventListener("touchmove", t);
|
|
419
429
|
};
|
|
420
|
-
}, [
|
|
421
|
-
let e =
|
|
430
|
+
}, [Y]), u(() => {
|
|
431
|
+
let e = G.current;
|
|
422
432
|
if (!e) {
|
|
423
|
-
|
|
433
|
+
B(0);
|
|
424
434
|
return;
|
|
425
435
|
}
|
|
426
|
-
return ye(e,
|
|
427
|
-
}, [
|
|
428
|
-
let e =
|
|
436
|
+
return ye(e, B);
|
|
437
|
+
}, [s]), u(() => {
|
|
438
|
+
let e = q.current;
|
|
429
439
|
if (!e) {
|
|
430
|
-
|
|
440
|
+
Oe(0);
|
|
431
441
|
return;
|
|
432
442
|
}
|
|
433
|
-
return ye(e,
|
|
434
|
-
}, [
|
|
435
|
-
let { registerSharedBars: e, unregisterSharedBars: t } =
|
|
436
|
-
return e(
|
|
437
|
-
topBar: !!
|
|
438
|
-
bottomBar: !!
|
|
439
|
-
}), () => t(
|
|
443
|
+
return ye(e, Oe);
|
|
444
|
+
}, [c]), u(() => {
|
|
445
|
+
let { registerSharedBars: e, unregisterSharedBars: t } = D.screen.getState();
|
|
446
|
+
return e(b, {
|
|
447
|
+
topBar: !!s,
|
|
448
|
+
bottomBar: !!c
|
|
449
|
+
}), () => t(b);
|
|
440
450
|
}, [
|
|
441
|
-
|
|
442
|
-
a,
|
|
451
|
+
b,
|
|
443
452
|
s,
|
|
444
|
-
|
|
453
|
+
c,
|
|
454
|
+
D.screen
|
|
445
455
|
]), u(() => {
|
|
446
|
-
let e =
|
|
456
|
+
let e = U.current;
|
|
447
457
|
if (!e) return;
|
|
448
|
-
let { registerScreenSurface: t, unregisterScreenSurface: n } =
|
|
449
|
-
return t(
|
|
458
|
+
let { registerScreenSurface: t, unregisterScreenSurface: n } = D.screen.getState();
|
|
459
|
+
return t(b, { opaqueBackground: he(getComputedStyle(e).backgroundColor) }), () => n(b);
|
|
450
460
|
}, [
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
461
|
+
b,
|
|
462
|
+
_,
|
|
463
|
+
j,
|
|
464
|
+
D.screen
|
|
455
465
|
]);
|
|
456
|
-
let
|
|
457
|
-
status:
|
|
458
|
-
isTopOrTopPrev:
|
|
459
|
-
hasTopBar: !!
|
|
460
|
-
hasNavBar: !!
|
|
461
|
-
partnerBars:
|
|
462
|
-
}),
|
|
463
|
-
status:
|
|
464
|
-
isTopOrTopPrev:
|
|
465
|
-
transitionName:
|
|
466
|
-
}),
|
|
467
|
-
isActive:
|
|
468
|
-
isPrev:
|
|
469
|
-
zIndex:
|
|
470
|
-
index:
|
|
471
|
-
status:
|
|
472
|
-
dragStatus:
|
|
473
|
-
replaceTransitionStatus:
|
|
474
|
-
}),
|
|
475
|
-
key:
|
|
476
|
-
released:
|
|
466
|
+
let Fe = ae, { app: Ie, nav: Le } = h({
|
|
467
|
+
status: j,
|
|
468
|
+
isTopOrTopPrev: Fe,
|
|
469
|
+
hasTopBar: !!s,
|
|
470
|
+
hasNavBar: !!c,
|
|
471
|
+
partnerBars: me
|
|
472
|
+
}), X = ee({
|
|
473
|
+
status: j,
|
|
474
|
+
isTopOrTopPrev: Fe,
|
|
475
|
+
transitionName: w
|
|
476
|
+
}), Re = g({
|
|
477
|
+
isActive: x,
|
|
478
|
+
isPrev: ne,
|
|
479
|
+
zIndex: C,
|
|
480
|
+
index: O,
|
|
481
|
+
status: j,
|
|
482
|
+
dragStatus: M,
|
|
483
|
+
replaceTransitionStatus: ue
|
|
484
|
+
}), ze = f(Re), Be = f(X !== null && Re), [Ve, He] = p({
|
|
485
|
+
key: X,
|
|
486
|
+
released: X === null
|
|
477
487
|
});
|
|
478
|
-
|
|
479
|
-
key:
|
|
480
|
-
released:
|
|
481
|
-
}),
|
|
482
|
-
let
|
|
483
|
-
u(() =>
|
|
488
|
+
Ve.key !== X && (He({
|
|
489
|
+
key: X,
|
|
490
|
+
released: X === null
|
|
491
|
+
}), Be.current = X !== null && ze.current), ze.current = Re;
|
|
492
|
+
let Z = X !== null && Ve.key === X && !Ve.released, Q = Z ? !x && ge?.opaqueBackground ? "park" : x && (j === "PUSHING" || j === "REPLACING") && ge?.opaqueBackground ? "park-under" : "true" : "false";
|
|
493
|
+
u(() => ve.driveScreenLifecycle({
|
|
484
494
|
getElements: () => ({
|
|
485
|
-
scope:
|
|
486
|
-
decorator:
|
|
487
|
-
bars: [
|
|
495
|
+
scope: U.current,
|
|
496
|
+
decorator: W.current,
|
|
497
|
+
bars: [G.current, q.current]
|
|
488
498
|
}),
|
|
489
|
-
transitionName:
|
|
490
|
-
prevTransitionName:
|
|
491
|
-
status:
|
|
492
|
-
isActive:
|
|
493
|
-
animHoldReleased: !
|
|
499
|
+
transitionName: w,
|
|
500
|
+
prevTransitionName: re,
|
|
501
|
+
status: j,
|
|
502
|
+
isActive: x,
|
|
503
|
+
animHoldReleased: !Z
|
|
494
504
|
}), [
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
505
|
+
ve,
|
|
506
|
+
j,
|
|
507
|
+
x,
|
|
508
|
+
re,
|
|
509
|
+
w,
|
|
510
|
+
Z
|
|
501
511
|
]), o(() => {
|
|
502
|
-
if (!
|
|
503
|
-
let e =
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
512
|
+
if (!Z || X === null) return;
|
|
513
|
+
let e = X, t = D.navigate.getState().transitionTaskId, n = t === null ? e : `${e}#${t}`;
|
|
514
|
+
return be.current.join(n, () => {
|
|
515
|
+
if (J.current.transition.driver === "native" && !ce()) {
|
|
516
|
+
for (let e of [
|
|
517
|
+
U.current,
|
|
518
|
+
G.current,
|
|
519
|
+
q.current,
|
|
520
|
+
W.current
|
|
521
|
+
]) e?.isConnected && e.getAttribute("data-flemo-anim-hold") !== null && e.setAttribute("data-flemo-anim-hold", "false");
|
|
522
|
+
H.current && (H.current.style.zIndex = "");
|
|
523
|
+
}
|
|
524
|
+
He((t) => t.key === e && !t.released ? {
|
|
525
|
+
key: e,
|
|
526
|
+
released: !0
|
|
527
|
+
} : t);
|
|
528
|
+
}, {
|
|
529
|
+
scope: U.current,
|
|
530
|
+
decodeWait: Be.current
|
|
516
531
|
});
|
|
517
532
|
}, [
|
|
518
|
-
X,
|
|
519
|
-
Y,
|
|
520
533
|
Z,
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
534
|
+
X,
|
|
535
|
+
Q,
|
|
536
|
+
x,
|
|
537
|
+
j,
|
|
538
|
+
D.navigate
|
|
524
539
|
]);
|
|
525
|
-
let
|
|
526
|
-
initial:
|
|
527
|
-
isActive:
|
|
528
|
-
status:
|
|
540
|
+
let Ue = Q === "park-under" ? {} : pe({
|
|
541
|
+
initial: xe,
|
|
542
|
+
isActive: x,
|
|
543
|
+
status: j
|
|
529
544
|
});
|
|
530
|
-
return /* @__PURE__ */
|
|
531
|
-
ref:
|
|
545
|
+
return /* @__PURE__ */ Te("div", {
|
|
546
|
+
ref: H,
|
|
532
547
|
style: {
|
|
533
|
-
position:
|
|
548
|
+
position: E,
|
|
534
549
|
top: 0,
|
|
535
550
|
left: 0,
|
|
536
551
|
width: "100%",
|
|
537
552
|
height: "100%",
|
|
538
553
|
display: "flex",
|
|
539
|
-
zIndex:
|
|
554
|
+
zIndex: Q === "park-under" ? -1 : void 0,
|
|
540
555
|
contain: "layout style",
|
|
541
556
|
flexDirection: "column",
|
|
542
557
|
boxSizing: "border-box",
|
|
@@ -546,7 +561,7 @@ function Ye({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
546
561
|
/* @__PURE__ */ L("div", {
|
|
547
562
|
"data-swipe-at-edge-bar": !0,
|
|
548
563
|
style: {
|
|
549
|
-
position:
|
|
564
|
+
position: E,
|
|
550
565
|
top: 0,
|
|
551
566
|
left: 0,
|
|
552
567
|
width: 8,
|
|
@@ -554,66 +569,67 @@ function Ye({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
554
569
|
zIndex: 1
|
|
555
570
|
}
|
|
556
571
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
ref:
|
|
559
|
-
...
|
|
560
|
-
onPointerDown:
|
|
561
|
-
onPointerMove:
|
|
562
|
-
onPointerUp:
|
|
563
|
-
onPointerCancel:
|
|
572
|
+
/* @__PURE__ */ Te("div", {
|
|
573
|
+
ref: U,
|
|
574
|
+
...y,
|
|
575
|
+
onPointerDown: Me,
|
|
576
|
+
onPointerMove: Ne,
|
|
577
|
+
onPointerUp: Pe,
|
|
578
|
+
onPointerCancel: Pe,
|
|
564
579
|
"data-flemo-screen": !0,
|
|
565
|
-
"data-flemo-
|
|
566
|
-
"data-flemo-
|
|
567
|
-
"data-flemo-
|
|
568
|
-
"data-flemo-
|
|
580
|
+
"data-flemo-router": ie ?? void 0,
|
|
581
|
+
"data-flemo-transition": w,
|
|
582
|
+
"data-flemo-status": j,
|
|
583
|
+
"data-flemo-active": x ? "true" : "false",
|
|
584
|
+
"data-flemo-anim-hold": Q,
|
|
569
585
|
style: {
|
|
570
586
|
display: "flex",
|
|
571
587
|
flexDirection: "column",
|
|
572
588
|
height: "100%",
|
|
573
|
-
backgroundColor:
|
|
574
|
-
overflowY:
|
|
575
|
-
touchAction:
|
|
576
|
-
...
|
|
577
|
-
...
|
|
589
|
+
backgroundColor: _,
|
|
590
|
+
overflowY: v ? void 0 : "auto",
|
|
591
|
+
touchAction: Se === "x" ? "pan-y" : Se === "y" ? "pan-x" : "auto",
|
|
592
|
+
...Ue,
|
|
593
|
+
...y.style
|
|
578
594
|
},
|
|
579
595
|
children: [
|
|
580
|
-
!
|
|
596
|
+
!m && t && /* @__PURE__ */ L("div", {
|
|
581
597
|
style: { minHeight: t },
|
|
582
598
|
children: /* @__PURE__ */ L("div", { style: {
|
|
583
|
-
position:
|
|
599
|
+
position: E,
|
|
584
600
|
top: 0,
|
|
585
601
|
width: "100%",
|
|
586
602
|
minHeight: t,
|
|
587
603
|
backgroundColor: n
|
|
588
604
|
} })
|
|
589
605
|
}),
|
|
590
|
-
|
|
606
|
+
s && /* @__PURE__ */ L("div", { style: {
|
|
591
607
|
width: "100%",
|
|
592
|
-
minHeight:
|
|
608
|
+
minHeight: Ee
|
|
593
609
|
} }),
|
|
594
|
-
|
|
610
|
+
l,
|
|
595
611
|
/* @__PURE__ */ L("div", {
|
|
596
612
|
style: {
|
|
597
613
|
display: "flex",
|
|
598
614
|
flexDirection: "column",
|
|
599
615
|
flexGrow: 1,
|
|
600
|
-
overflowY:
|
|
616
|
+
overflowY: v ? "auto" : void 0
|
|
601
617
|
},
|
|
602
618
|
children: e
|
|
603
619
|
}),
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
display:
|
|
620
|
+
d,
|
|
621
|
+
c && /* @__PURE__ */ L("div", { style: {
|
|
622
|
+
display: R ? "none" : void 0,
|
|
607
623
|
width: "100%",
|
|
608
|
-
minHeight:
|
|
624
|
+
minHeight: De
|
|
609
625
|
} }),
|
|
610
|
-
!
|
|
626
|
+
!te && r && /* @__PURE__ */ L("div", {
|
|
611
627
|
style: {
|
|
612
|
-
display:
|
|
628
|
+
display: R ? "none" : void 0,
|
|
613
629
|
minHeight: r
|
|
614
630
|
},
|
|
615
631
|
children: /* @__PURE__ */ L("div", { style: {
|
|
616
|
-
position:
|
|
632
|
+
position: E,
|
|
617
633
|
bottom: 0,
|
|
618
634
|
width: "100%",
|
|
619
635
|
minHeight: r,
|
|
@@ -622,49 +638,51 @@ function Ye({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
622
638
|
})
|
|
623
639
|
]
|
|
624
640
|
}),
|
|
625
|
-
|
|
626
|
-
ref:
|
|
641
|
+
s && /* @__PURE__ */ L("div", {
|
|
642
|
+
ref: G,
|
|
627
643
|
"data-flemo-bar": "app",
|
|
628
|
-
"data-flemo-
|
|
629
|
-
"data-flemo-bar-
|
|
630
|
-
"data-flemo-bar-
|
|
631
|
-
"data-flemo-bar-
|
|
632
|
-
"data-flemo-
|
|
644
|
+
"data-flemo-router": ie ?? void 0,
|
|
645
|
+
"data-flemo-bar-transition": w,
|
|
646
|
+
"data-flemo-bar-status": j,
|
|
647
|
+
"data-flemo-bar-active": x ? "true" : "false",
|
|
648
|
+
"data-flemo-bar-riding": Ie ? "true" : "false",
|
|
649
|
+
"data-flemo-anim-hold": Q,
|
|
633
650
|
style: {
|
|
634
|
-
position:
|
|
635
|
-
top:
|
|
651
|
+
position: E,
|
|
652
|
+
top: m ? 0 : t,
|
|
636
653
|
left: 0,
|
|
637
654
|
width: "100%",
|
|
638
655
|
zIndex: 1
|
|
639
656
|
},
|
|
640
|
-
children:
|
|
657
|
+
children: s
|
|
641
658
|
}),
|
|
642
|
-
|
|
643
|
-
ref:
|
|
659
|
+
c && /* @__PURE__ */ L("div", {
|
|
660
|
+
ref: q,
|
|
644
661
|
"data-flemo-bar": "nav",
|
|
645
|
-
"data-flemo-
|
|
646
|
-
"data-flemo-bar-
|
|
647
|
-
"data-flemo-bar-
|
|
648
|
-
"data-flemo-bar-
|
|
649
|
-
"data-flemo-
|
|
662
|
+
"data-flemo-router": ie ?? void 0,
|
|
663
|
+
"data-flemo-bar-transition": w,
|
|
664
|
+
"data-flemo-bar-status": j,
|
|
665
|
+
"data-flemo-bar-active": x ? "true" : "false",
|
|
666
|
+
"data-flemo-bar-riding": Le ? "true" : "false",
|
|
667
|
+
"data-flemo-anim-hold": Q,
|
|
650
668
|
style: {
|
|
651
|
-
display:
|
|
652
|
-
position:
|
|
653
|
-
bottom:
|
|
669
|
+
display: R ? "none" : void 0,
|
|
670
|
+
position: E,
|
|
671
|
+
bottom: te ? 0 : r,
|
|
654
672
|
left: 0,
|
|
655
673
|
width: "100%",
|
|
656
674
|
zIndex: 1
|
|
657
675
|
},
|
|
658
|
-
children:
|
|
676
|
+
children: c
|
|
659
677
|
}),
|
|
660
|
-
|
|
661
|
-
ref:
|
|
662
|
-
"data-flemo-anim-hold":
|
|
678
|
+
F && /* @__PURE__ */ L(Xe, {
|
|
679
|
+
ref: W,
|
|
680
|
+
"data-flemo-anim-hold": Q
|
|
663
681
|
}),
|
|
664
682
|
/* @__PURE__ */ L("div", {
|
|
665
683
|
"data-swipe-at-edge-bar": !0,
|
|
666
684
|
style: {
|
|
667
|
-
position:
|
|
685
|
+
position: E,
|
|
668
686
|
top: 0,
|
|
669
687
|
right: 0,
|
|
670
688
|
width: 8,
|
|
@@ -677,38 +695,39 @@ function Ye({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
677
695
|
}
|
|
678
696
|
//#endregion
|
|
679
697
|
//#region src/screen/Screen.tsx
|
|
680
|
-
function
|
|
681
|
-
let { isActive: n, isPrev: r, zIndex: i } = V(), a = _({
|
|
698
|
+
function $e({ children: e, ...t }) {
|
|
699
|
+
let { isActive: n, isPrev: r, zIndex: i } = V(), a = K((e) => e.index), s = Ye((e) => e.status), c = $((e) => e.dragStatus), l = $((e) => e.replaceTransitionStatus), u = _({
|
|
682
700
|
isActive: n,
|
|
683
701
|
isPrev: r,
|
|
684
702
|
zIndex: i,
|
|
685
|
-
index:
|
|
686
|
-
status:
|
|
687
|
-
dragStatus:
|
|
688
|
-
replaceTransitionStatus:
|
|
689
|
-
}), [
|
|
690
|
-
return
|
|
691
|
-
if (
|
|
692
|
-
let e = setTimeout(() =>
|
|
703
|
+
index: a,
|
|
704
|
+
status: s,
|
|
705
|
+
dragStatus: c,
|
|
706
|
+
replaceTransitionStatus: l
|
|
707
|
+
}), [d, f] = p(u !== "live");
|
|
708
|
+
return u === "live" && d && f(!1), u === "immediate" && !d && f(!0), o(() => {
|
|
709
|
+
if (u !== "deferred" || d) return;
|
|
710
|
+
let e = setTimeout(() => f(!0), et);
|
|
693
711
|
return () => clearTimeout(e);
|
|
694
|
-
}, [
|
|
695
|
-
freeze:
|
|
696
|
-
children: /* @__PURE__ */ L(
|
|
712
|
+
}, [u, d]), /* @__PURE__ */ L(Ke, {
|
|
713
|
+
freeze: d,
|
|
714
|
+
children: /* @__PURE__ */ L(Qe, {
|
|
697
715
|
...t,
|
|
698
716
|
children: e
|
|
699
717
|
})
|
|
700
718
|
});
|
|
701
719
|
}
|
|
702
|
-
var
|
|
720
|
+
var et = 600;
|
|
703
721
|
//#endregion
|
|
704
722
|
//#region src/screen/Part.tsx
|
|
705
|
-
function
|
|
706
|
-
let { isActive:
|
|
723
|
+
function tt({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
724
|
+
let { isActive: o, isPrev: s, navigateStore: c, routerId: l } = V(), u = a(ke), d = l ?? u ?? void 0, f = z(), p = G(c ?? f.navigate, (e) => s ? "COMPLETED" : e.status);
|
|
707
725
|
return /* @__PURE__ */ L("div", {
|
|
708
726
|
ref: e,
|
|
709
727
|
"data-flemo-part-name": t,
|
|
710
|
-
"data-flemo-
|
|
711
|
-
"data-flemo-
|
|
728
|
+
"data-flemo-router": d,
|
|
729
|
+
"data-flemo-status": p,
|
|
730
|
+
"data-flemo-active": o ? "true" : "false",
|
|
712
731
|
style: n,
|
|
713
732
|
...i,
|
|
714
733
|
children: r
|
|
@@ -716,13 +735,13 @@ function Qe({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
|
716
735
|
}
|
|
717
736
|
//#endregion
|
|
718
737
|
//#region src/stores/RouterScopeProvider.tsx
|
|
719
|
-
function
|
|
738
|
+
function nt({ children: e }) {
|
|
720
739
|
let [t] = p(() => ({
|
|
721
|
-
history:
|
|
722
|
-
navigate:
|
|
723
|
-
transition:
|
|
740
|
+
history: ne(),
|
|
741
|
+
navigate: C(),
|
|
742
|
+
transition: M(),
|
|
724
743
|
screen: k(),
|
|
725
|
-
driver:
|
|
744
|
+
driver: x(),
|
|
726
745
|
markSelfInduced: _e,
|
|
727
746
|
consume: v,
|
|
728
747
|
life: { alive: !0 }
|
|
@@ -733,4 +752,4 @@ function $e({ children: e }) {
|
|
|
733
752
|
});
|
|
734
753
|
}
|
|
735
754
|
//#endregion
|
|
736
|
-
export {
|
|
755
|
+
export { tt as Part, He as Route, Ve as Router, nt as RouterScopeProvider, $e as Screen, B as ScreenContext, Xe as ScreenDecorator, Ke as ScreenFreeze, Qe as ScreenMotion, Ne as Slot, b as createBrowserHistoryDriver, S as createDecorator, re as createPartTransition, T as createRawDecorator, E as createRawPartTransition, D as createRawTransition, j as createTransition, P as partTransitionMap, K as useHistoryStore, Q as useNavigate, Ye as useNavigateStore, Ge as useParams, Ue as usePathname, V as useScreen, $ as useScreenStore, We as useStep, z as useStores, Ze as useViewportScrollHeight };
|
|
@@ -9,6 +9,7 @@ export interface ScreenContextProps extends History {
|
|
|
9
9
|
prevTransitionName: TransitionName;
|
|
10
10
|
routePath: Path;
|
|
11
11
|
navigateStore?: FlemoStores["navigate"];
|
|
12
|
+
routerId?: string;
|
|
12
13
|
}
|
|
13
14
|
declare const ScreenContext: import('react').Context<ScreenContextProps>;
|
|
14
15
|
export default ScreenContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flemo/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
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,30 +36,30 @@
|
|
|
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.23.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@testing-library/jest-dom": "^6.9.1",
|
|
43
43
|
"@testing-library/react": "^16.3.2",
|
|
44
44
|
"@types/node": "^24.13.1",
|
|
45
|
-
"@types/react": "^19.2.
|
|
46
|
-
"@types/react-dom": "^19.2.
|
|
47
|
-
"@vitejs/plugin-react-swc": "^4.3.
|
|
45
|
+
"@types/react": "^19.2.18",
|
|
46
|
+
"@types/react-dom": "^19.2.4",
|
|
47
|
+
"@vitejs/plugin-react-swc": "^4.3.3",
|
|
48
48
|
"@vitest/coverage-v8": "^4.1.10",
|
|
49
49
|
"eslint": "^9.39.4",
|
|
50
50
|
"jsdom": "^29.1.1",
|
|
51
|
-
"react": "^19.2.
|
|
52
|
-
"react-dom": "^19.2.
|
|
51
|
+
"react": "^19.2.8",
|
|
52
|
+
"react-dom": "^19.2.8",
|
|
53
53
|
"typescript": "^6.0.3",
|
|
54
|
-
"vite": "^8.
|
|
54
|
+
"vite": "^8.2.0",
|
|
55
55
|
"vite-plugin-dts": "^5.0.3",
|
|
56
56
|
"vitest": "^4.1.10",
|
|
57
57
|
"@flemo/eslint-config": "0.0.0",
|
|
58
58
|
"@flemo/tsconfig": "0.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"react": "^19.2.
|
|
62
|
-
"react-dom": "^19.2.
|
|
61
|
+
"react": "^19.2.8",
|
|
62
|
+
"react-dom": "^19.2.8"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|