@flemo/react 1.6.0 → 1.6.1

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,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 h, computeBarRiding as g, computeScreenFreeze as _, consumeSelfInducedPop as v, createBrowserHistoryDriver as y, createBrowserHistoryDriver as b, createDecorator as x, createHistoryStore as te, createHistorySync as S, createNavigateStore as C, createNavigationController as w, createPartTransition as T, createRawDecorator as E, createRawPartTransition as D, createRawTransition as O, createRouterScope as ne, createScreenSelector as k, createScreenStore as A, createStepController as j, createSwipeController as M, createTransition as N, createTransitionEngine as re, createTransitionStore as ie, decoratorMap as ae, eagerlyDecodeImages as oe, ensureWindowHistoryState as se, enteringInitialStyle as ce, getMatchedPathPattern as le, isOpaqueColor as ue, isServer as de, markSelfInducedPop as fe, matchesPathname as pe, observeBarHeight as me, observeViewportScrollHeight as he, partTransitionMap as ge, readStepParams as P, registerTransitionDefinitions as F, resolveTransition as _e, scheduleAnimHoldRelease as ve, subscribeStepParamsRestore as I } from "@flemo/core";
3
- import { jsx as L, jsxs as ye } from "react/jsx-runtime";
2
+ import { animHoldKey as ee, appendParamsQuery as m, buildRoutePath as h, computeBarRiding as g, computeScreenFreeze as _, consumeSelfInducedPop as v, createBrowserHistoryDriver as y, createBrowserHistoryDriver as b, createDecorator as x, createHistoryStore as te, createNavigateStore as S, createNavigationController as C, createPartTransition as w, createRawDecorator as T, createRawPartTransition as E, createRawTransition as D, createRouterScope as ne, createScreenSelector as O, createScreenStore as k, createStepController as A, createSwipeController as re, createTransition as j, createTransitionEngine as ie, createTransitionStore as M, decoratorMap as ae, eagerlyDecodeImages as oe, ensureScopeHistorySync as se, enteringInitialStyle as ce, getMatchedPathPattern as le, isOpaqueColor as ue, isServer as de, markSelfInducedPop as fe, matchesPathname as N, observeBarHeight as pe, observeViewportScrollHeight as me, partTransitionMap as he, readStepParams as ge, registerTransitionDefinitions as P, releaseScopeHistorySync as F, resolveTransition as _e, scheduleAnimHoldRelease as ve, seedRouterEntry as I, subscribeStepParamsRestore as ye } from "@flemo/core";
3
+ import { jsx as L, jsxs as be } from "react/jsx-runtime";
4
4
  //#region src/stores/StoreContext.ts
5
5
  var R = r(null);
6
6
  //#endregion
@@ -12,13 +12,9 @@ function z() {
12
12
  }
13
13
  //#endregion
14
14
  //#region src/history/HistoryListener.tsx
15
- function be() {
15
+ function xe() {
16
16
  let e = z();
17
- return o(() => S({
18
- stores: e,
19
- driver: e.driver,
20
- consume: e.consume
21
- }), [e]), null;
17
+ return o(() => (se(e), () => F(e)), [e]), null;
22
18
  }
23
19
  //#endregion
24
20
  //#region src/screen/ScreenContext.ts
@@ -42,10 +38,10 @@ function V() {
42
38
  }
43
39
  //#endregion
44
40
  //#region src/screen/ParamsProvider/ParamsContext.ts
45
- var H = r({}), xe = r(() => {});
41
+ var H = r({}), U = r(() => {});
46
42
  //#endregion
47
43
  //#region src/screen/ParamsProvider/ParamsReducer.ts
48
- function U(e, t) {
44
+ function W(e, t) {
49
45
  switch (t.type) {
50
46
  case "SET": return t.params;
51
47
  default: return e;
@@ -53,10 +49,10 @@ function U(e, t) {
53
49
  }
54
50
  //#endregion
55
51
  //#region src/screen/ParamsProvider/ParamsProvider.tsx
56
- function Se({ children: e }) {
57
- let { isActive: t, params: n } = V(), { driver: r } = z(), [i, a] = d(U, n);
52
+ function G({ children: e }) {
53
+ let { isActive: t, params: n } = V(), { driver: r } = z(), [i, a] = d(W, n);
58
54
  return o(() => {
59
- if (t) return I(r, (e) => a({
55
+ if (t) return ye(r, (e) => a({
60
56
  type: "SET",
61
57
  params: e
62
58
  }));
@@ -64,7 +60,7 @@ function Se({ children: e }) {
64
60
  t,
65
61
  a,
66
62
  r
67
- ]), /* @__PURE__ */ L(xe.Provider, {
63
+ ]), /* @__PURE__ */ L(U.Provider, {
68
64
  value: a,
69
65
  children: /* @__PURE__ */ L(H.Provider, {
70
66
  value: i,
@@ -74,41 +70,41 @@ function Se({ children: e }) {
74
70
  }
75
71
  //#endregion
76
72
  //#region ../../node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.17_react@19.2.7/node_modules/zustand/esm/react.mjs
77
- var W = (e) => e;
78
- function G(t, n = W) {
73
+ var K = (e) => e;
74
+ function q(t, n = K) {
79
75
  let r = e.useSyncExternalStore(t.subscribe, e.useCallback(() => n(t.getState()), [t, n]), e.useCallback(() => n(t.getInitialState()), [t, n]));
80
76
  return e.useDebugValue(r), r;
81
77
  }
82
78
  //#endregion
83
79
  //#region src/stores/useHistoryStore.ts
84
- function K(e) {
85
- return G(z().history, e);
80
+ function J(e) {
81
+ return q(z().history, e);
86
82
  }
87
83
  //#endregion
88
84
  //#region src/renderer/Renderer.tsx
89
- function q({ children: e }) {
90
- let t = K((e) => e.index);
91
- return k(K((e) => e.histories), t).map((t) => {
92
- let [r] = n.toArray(e).filter((e) => pe(e.props.path, t.pathname));
93
- return /* @__PURE__ */ L(B.Provider, {
85
+ function Se({ children: e }) {
86
+ let t = J((e) => e.index);
87
+ return O(J((e) => e.histories), t).map((t) => {
88
+ let [r] = n.toArray(e).filter((e) => N(e.props.path, t.pathname));
89
+ return r ? /* @__PURE__ */ L(B.Provider, {
94
90
  value: {
95
91
  ...t,
96
92
  routePath: le(r.props.path, t.pathname)
97
93
  },
98
- children: /* @__PURE__ */ L(Se, { children: r })
99
- }, t.id);
94
+ children: /* @__PURE__ */ L(G, { children: r })
95
+ }, t.id) : null;
100
96
  });
101
97
  }
102
98
  //#endregion
103
99
  //#region src/screen/ScreenViewportContext.ts
104
- var J = r({ contained: !1 });
100
+ var Y = r({ contained: !1 });
105
101
  function Ce() {
106
- return a(J);
102
+ return a(Y);
107
103
  }
108
104
  //#endregion
109
105
  //#region src/transition/styles.ts
110
- function Y(e, t, n = []) {
111
- l(() => F(e, t, n), [
106
+ function we(e, t, n = []) {
107
+ l(() => P(e, t, n), [
112
108
  e,
113
109
  t,
114
110
  n
@@ -116,8 +112,8 @@ function Y(e, t, n = []) {
116
112
  }
117
113
  //#endregion
118
114
  //#region src/RouterDepthContext.ts
119
- var we = r(0), Te = { contained: !0 };
120
- function Ee({ children: e, className: t, style: n }) {
115
+ var Te = r(0), Ee = { contained: !0 };
116
+ function De({ children: e, className: t, style: n }) {
121
117
  return /* @__PURE__ */ L("div", {
122
118
  className: t,
123
119
  style: {
@@ -125,46 +121,54 @@ function Ee({ children: e, className: t, style: n }) {
125
121
  overflow: "hidden",
126
122
  ...n
127
123
  },
128
- children: /* @__PURE__ */ L(J.Provider, {
129
- value: Te,
130
- children: /* @__PURE__ */ L(q, { children: e })
124
+ children: /* @__PURE__ */ L(Y.Provider, {
125
+ value: Ee,
126
+ children: /* @__PURE__ */ L(Se, { children: e })
131
127
  })
132
128
  });
133
129
  }
134
130
  //#endregion
135
131
  //#region src/Router.tsx
136
- function De(e) {
132
+ function Oe(e) {
137
133
  let t = null;
138
134
  return n.forEach(e, (e) => {
139
135
  if (t || !i(e)) return;
140
- if (e.type === Ee) {
136
+ if (e.type === De) {
141
137
  t = n.toArray(e.props.children).filter(i);
142
138
  return;
143
139
  }
144
140
  let r = e.props.children;
145
141
  if (r) {
146
- let e = De(r);
142
+ let e = Oe(r);
147
143
  e && (t = e);
148
144
  }
149
145
  }), t;
150
146
  }
151
- var Oe = [], ke = [], X = [], Ae = { contained: !0 };
152
- function je({ children: e, initPath: t = "/", defaultTransitionName: r = "cupertino", transitions: i = Oe, decorators: c = ke, partTransitions: l = X, history: u = "browser", createDriver: d, className: f, style: ee }) {
153
- let m = a(we), h = m > 0, g = u === "memory", _ = s(), v = a(B), y = h && v.id ? `_F_${v.id}_` : _, x = De(e), te = x !== null, S = a(R), C = h ? null : S, w = C !== null, T = d ?? b, [E] = p(() => g ? null : T(w ? void 0 : y)), D = !h && !g && !de(), O = D && E ? E.readPathname() : t || "/", k = O.indexOf("?"), A = (k >= 0 ? O.slice(0, k) : O) || "/", j = D ? window.location.search : k >= 0 ? O.slice(k) : "", [M] = p(() => ne({
147
+ var ke = typeof window > "u" ? o : u, X = [], Ae = [], je = [], Me = { contained: !0 };
148
+ function Z({ children: e, initPath: t = "/", defaultTransitionName: r = "cupertino", transitions: i = X, decorators: c = Ae, partTransitions: l = je, history: u = "browser", createDriver: d, className: f, style: ee }) {
149
+ let m = a(Te), h = m > 0, g = u === "memory", _ = s(), v = a(B), y = h && v.id ? `_F_${v.id}_` : _, x = Oe(e), te = x !== null, S = a(R), C = h ? null : S, w = C !== null, T = d ?? b, [E] = p(() => g ? null : T(w ? void 0 : y)), D = !h && !g && !de(), O = D && E ? E.readPathname() : t || "/", k = O.indexOf("?"), A = (k >= 0 ? O.slice(0, k) : O) || "/", re = D ? window.location.search : k >= 0 ? O.slice(k) : "", [j] = p(() => ne({
154
150
  routePaths: (x ?? n.toArray(e)).map((e) => e.props.path).flat(),
155
151
  pathname: A,
156
- search: j,
152
+ search: re,
157
153
  defaultTransitionName: r,
158
154
  memory: g,
159
155
  browserDriver: E,
160
- hostedScope: C
156
+ hostedScope: C,
157
+ routerKey: w ? void 0 : y,
158
+ zoneEntryId: h && !w && v.id || void 0,
159
+ persistKey: h && !g && !w ? y : void 0
161
160
  }));
162
- M.transition.setState({ defaultTransitionName: r }), o(() => (M.life.alive = !0, () => {
163
- M.life.alive = !1;
164
- }), [M]), Y(i, c, l), o(() => {
165
- if (g || de()) return;
166
- let e = h && !w && E ? E.readState() == null : !1;
167
- se(w ? null : y, r, M.history.getState().histories[0]?.params ?? {}), h && !w && E && e && E.readPathname() !== A && E.replaceState(E.readState(), A);
161
+ j.transition.setState({ defaultTransitionName: r }), ke(() => (j.life.alive = !0, () => {
162
+ j.life.alive = !1;
163
+ }), [j]), we(i, c, l), o(() => {
164
+ g || !E || I({
165
+ driver: E,
166
+ routerKey: w ? null : y,
167
+ nested: h && !w,
168
+ seedPathname: A,
169
+ defaultTransitionName: r,
170
+ rootParams: j.history.getState().histories[0]?.params ?? {}
171
+ });
168
172
  }, [
169
173
  g,
170
174
  w,
@@ -172,17 +176,17 @@ function je({ children: e, initPath: t = "/", defaultTransitionName: r = "cupert
172
176
  y,
173
177
  A,
174
178
  r,
175
- M.history,
179
+ j.history,
176
180
  E
177
181
  ]);
178
- let N = te ? e : /* @__PURE__ */ L(q, { children: e }), re = /* @__PURE__ */ L(we.Provider, {
182
+ let ie = te ? e : /* @__PURE__ */ L(Se, { children: e }), M = /* @__PURE__ */ L(Te.Provider, {
179
183
  value: m + 1,
180
- children: /* @__PURE__ */ ye(R.Provider, {
181
- value: M,
182
- children: [!g && /* @__PURE__ */ L(be, {}), h ? /* @__PURE__ */ L(J.Provider, {
183
- value: Ae,
184
- children: N
185
- }) : N]
184
+ children: /* @__PURE__ */ be(R.Provider, {
185
+ value: j,
186
+ children: [!g && /* @__PURE__ */ L(xe, {}), h ? /* @__PURE__ */ L(Y.Provider, {
187
+ value: Me,
188
+ children: ie
189
+ }) : ie]
186
190
  })
187
191
  });
188
192
  return h ? /* @__PURE__ */ L("div", {
@@ -192,25 +196,25 @@ function je({ children: e, initPath: t = "/", defaultTransitionName: r = "cupert
192
196
  overflow: "hidden",
193
197
  ...ee
194
198
  },
195
- children: re
196
- }) : re;
199
+ children: M
200
+ }) : M;
197
201
  }
198
202
  //#endregion
199
203
  //#region src/Route.tsx
200
- function Me({ element: e }) {
204
+ function Ne({ element: e }) {
201
205
  return e;
202
206
  }
203
207
  //#endregion
204
208
  //#region src/utils/buildRoutePath.ts
205
- function Z(e, t) {
209
+ function Pe(e, t) {
206
210
  return h(e, t);
207
211
  }
208
212
  //#endregion
209
213
  //#region src/navigate/useNavigate.ts
210
- function Ne() {
211
- let e = z(), t = w({
214
+ function Fe() {
215
+ let e = z(), t = C({
212
216
  stores: e,
213
- buildPathname: (e, t) => Z(e, t),
217
+ buildPathname: (e, t) => Pe(e, t),
214
218
  driver: e.driver,
215
219
  markSelfInduced: e.markSelfInduced
216
220
  });
@@ -222,21 +226,21 @@ function Ne() {
222
226
  }
223
227
  //#endregion
224
228
  //#region src/navigate/usePathname.ts
225
- function Pe() {
226
- return K((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
229
+ function Ie() {
230
+ return J((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
227
231
  }
228
232
  //#endregion
229
233
  //#region src/navigate/useStep.ts
230
- function Fe() {
231
- let { routePath: e } = V(), t = z(), n = a(xe), { driver: r, markSelfInduced: i } = t, [s, c] = p(null);
234
+ function Le() {
235
+ let { routePath: e } = V(), t = z(), n = a(U), { driver: r, markSelfInduced: i } = t, [s, c] = p(null);
232
236
  o(() => {
233
- if (!e) return c(P(r.readState())), r.subscribe((e) => c(P(e.state)));
237
+ if (!e) return c(ge(r.readState())), r.subscribe((e) => c(ge(e.state)));
234
238
  }, [e, r]);
235
- let l = j({
239
+ let l = A({
236
240
  stores: t,
237
241
  driver: r,
238
242
  markSelfInduced: i,
239
- buildStepPathname: (t) => e ? Z(e, t).pathname : m(r.readPathname(), t),
243
+ buildStepPathname: (t) => e ? Pe(e, t).pathname : m(r.readPathname(), t),
240
244
  applyParams: (t) => {
241
245
  n({
242
246
  type: "SET",
@@ -253,12 +257,12 @@ function Fe() {
253
257
  }
254
258
  //#endregion
255
259
  //#region src/screen/ParamsProvider/useParams.ts
256
- function Ie() {
260
+ function Re() {
257
261
  return a(H);
258
262
  }
259
263
  //#endregion
260
264
  //#region src/screen/ScreenFreeze.tsx
261
- function Le({ freeze: e, children: n }) {
265
+ function ze({ freeze: e, children: n }) {
262
266
  return /* @__PURE__ */ L(t, {
263
267
  mode: e ? "hidden" : "visible",
264
268
  children: n
@@ -267,11 +271,11 @@ function Le({ freeze: e, children: n }) {
267
271
  //#endregion
268
272
  //#region src/stores/useNavigateStore.ts
269
273
  function Q(e) {
270
- return G(z().navigate, e);
274
+ return q(z().navigate, e);
271
275
  }
272
276
  //#endregion
273
277
  //#region src/screen/ScreenDecorator.tsx
274
- function Re({ ref: e, style: t, ...n }) {
278
+ function Be({ ref: e, style: t, ...n }) {
275
279
  let { isActive: r, transitionName: i } = V(), a = f(null);
276
280
  c(e, () => a.current);
277
281
  let o = Q((e) => e.status), { decoratorName: s } = _e(i), l = ae.get(s);
@@ -296,9 +300,9 @@ function Re({ ref: e, style: t, ...n }) {
296
300
  }
297
301
  //#endregion
298
302
  //#region src/screen/useViewportScrollHeight.ts
299
- function ze() {
303
+ function Ve() {
300
304
  let [e, t] = p(0), [n, r] = p(0);
301
- return o(() => he((e, n) => {
305
+ return o(() => me((e, n) => {
302
306
  r(n), t(e);
303
307
  }), []), {
304
308
  viewportScrollHeight: e,
@@ -308,19 +312,19 @@ function ze() {
308
312
  //#endregion
309
313
  //#region src/stores/useScreenStore.ts
310
314
  function $(e) {
311
- return G(z().screen, e);
315
+ return q(z().screen, e);
312
316
  }
313
317
  //#endregion
314
318
  //#region src/screen/ScreenMotion.tsx
315
- function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: a, sharedBottomBar: s, topBar: c, bottomBar: l, hideStatusBar: d, hideSystemNavigationBar: m, backgroundColor: h = "white", contentScrollable: _ = !0, ...v }) {
316
- let { id: y, isActive: b, isRoot: x, zIndex: te, transitionName: S, prevTransitionName: C } = V(), { contained: w } = Ce(), T = w ? "absolute" : "fixed", E = z(), D = Q((e) => e.status), O = $((e) => e.dragStatus), ne = E.screen.getState().setDragStatus, k = E.screen.getState().setReplaceTransitionStatus, A = K((e) => e.index), j = K((e) => e.histories), N = b ? j[A - 1]?.id : j[A]?.id, ie = $((e) => N ? e.sharedBars[N] : void 0), se = $((e) => N ? e.screenSurfaces[N] : void 0), le = f(null);
317
- le.current ||= re({
319
+ function He({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: a, sharedBottomBar: s, topBar: c, bottomBar: l, hideStatusBar: d, hideSystemNavigationBar: m, backgroundColor: h = "white", contentScrollable: _ = !0, ...v }) {
320
+ let { id: y, isActive: b, isRoot: x, zIndex: te, transitionName: S, prevTransitionName: C } = V(), { contained: w } = Ce(), T = w ? "absolute" : "fixed", E = z(), D = Q((e) => e.status), ne = $((e) => e.dragStatus), O = E.screen.getState().setDragStatus, k = E.screen.getState().setReplaceTransitionStatus, A = J((e) => e.index), j = J((e) => e.histories), M = b ? j[A - 1]?.id : j[A]?.id, se = $((e) => M ? e.sharedBars[M] : void 0), le = $((e) => M ? e.screenSurfaces[M] : void 0), de = f(null);
321
+ de.current ||= ie({
318
322
  getTransitionTaskId: () => E.navigate.getState().transitionTaskId,
319
- setDragStatus: ne,
323
+ setDragStatus: O,
320
324
  setReplaceTransitionStatus: k
321
325
  });
322
- let de = le.current, fe = _e(S), { initial: pe, swipeDirection: he, decoratorName: ge } = fe, P = ae.get(ge), { viewportScrollHeight: F } = ze(), I = F > 0, [R, be] = p(0), [B, H] = p(0), xe = f(null), U = f(null), Se = f(null), W = f(null), G = f(null), q = f({
323
- transition: fe,
326
+ let fe = de.current, N = _e(S), { initial: me, swipeDirection: he, decoratorName: ge } = N, P = ae.get(ge), { viewportScrollHeight: F } = Ve(), I = F > 0, [ye, R] = p(0), [xe, B] = p(0), H = f(null), U = f(null), W = f(null), G = f(null), K = f(null), q = f({
327
+ transition: N,
324
328
  decorator: P,
325
329
  hasSharedTopBar: !!a,
326
330
  hasSharedBottomBar: !!s,
@@ -328,11 +332,11 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
328
332
  isRoot: x,
329
333
  isActive: b,
330
334
  status: D,
331
- dragStatus: O,
335
+ dragStatus: ne,
332
336
  index: A
333
337
  });
334
338
  q.current = {
335
- transition: fe,
339
+ transition: N,
336
340
  decorator: P,
337
341
  hasSharedTopBar: !!a,
338
342
  hasSharedBottomBar: !!s,
@@ -340,19 +344,19 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
340
344
  isRoot: x,
341
345
  isActive: b,
342
346
  status: D,
343
- dragStatus: O,
347
+ dragStatus: ne,
344
348
  index: A
345
349
  };
346
- let J = f(null);
347
- J.current ||= M({
350
+ let Se = f(null);
351
+ Se.current ||= re({
348
352
  getTransition: () => q.current.transition,
349
353
  getDecorator: () => q.current.decorator,
350
354
  getElements: () => ({
351
355
  scope: U.current,
352
- screenContainer: xe.current,
353
- decorator: Se.current,
354
- sharedTopBar: W.current,
355
- sharedBottomBar: G.current
356
+ screenContainer: H.current,
357
+ decorator: W.current,
358
+ sharedTopBar: G.current,
359
+ sharedBottomBar: K.current
356
360
  }),
357
361
  hasSharedTopBar: () => q.current.hasSharedTopBar,
358
362
  hasSharedBottomBar: () => q.current.hasSharedBottomBar,
@@ -365,10 +369,10 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
365
369
  let e = q.current, t = E.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
366
370
  return n ? E.screen.getState().sharedBars[n] : void 0;
367
371
  },
368
- setDragStatus: ne,
372
+ setDragStatus: O,
369
373
  back: () => window.history.back()
370
374
  });
371
- let Y = J.current, we = (e) => Y.pointerDown(e.nativeEvent), Te = (e) => Y.pointerMove(e.nativeEvent), Ee = (e) => Y.pointerUp(e.nativeEvent);
375
+ let Y = Se.current, we = (e) => Y.pointerDown(e.nativeEvent), Te = (e) => Y.pointerMove(e.nativeEvent), Ee = (e) => Y.pointerUp(e.nativeEvent);
372
376
  o(() => {
373
377
  oe(U.current);
374
378
  }, []), o(() => {
@@ -380,36 +384,36 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
380
384
  return e.addEventListener("touchmove", t, { passive: !1 }), () => {
381
385
  e.removeEventListener("touchmove", t);
382
386
  };
383
- }, [Y]), u(() => de.driveScreenLifecycle({
387
+ }, [Y]), u(() => fe.driveScreenLifecycle({
384
388
  getElements: () => ({
385
389
  scope: U.current,
386
- decorator: Se.current,
387
- bars: [W.current, G.current]
390
+ decorator: W.current,
391
+ bars: [G.current, K.current]
388
392
  }),
389
393
  transitionName: S,
390
394
  prevTransitionName: C,
391
395
  status: D,
392
396
  isActive: b
393
397
  }), [
394
- de,
398
+ fe,
395
399
  D,
396
400
  b,
397
401
  C,
398
402
  S
399
403
  ]), u(() => {
400
- let e = W.current;
404
+ let e = G.current;
401
405
  if (!e) {
402
- be(0);
406
+ R(0);
403
407
  return;
404
408
  }
405
- return me(e, be);
409
+ return pe(e, R);
406
410
  }, [a]), u(() => {
407
- let e = G.current;
411
+ let e = K.current;
408
412
  if (!e) {
409
- H(0);
413
+ B(0);
410
414
  return;
411
415
  }
412
- return me(e, H);
416
+ return pe(e, B);
413
417
  }, [s]), u(() => {
414
418
  let { registerSharedBars: e, unregisterSharedBars: t } = E.screen.getState();
415
419
  return e(y, {
@@ -437,7 +441,7 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
437
441
  isTopOrTopPrev: De,
438
442
  hasTopBar: !!a,
439
443
  hasNavBar: !!s,
440
- partnerBars: ie
444
+ partnerBars: se
441
445
  }), X = ee({
442
446
  status: D,
443
447
  isTopOrTopPrev: De,
@@ -450,7 +454,7 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
450
454
  key: X,
451
455
  released: X === null
452
456
  });
453
- let Me = X !== null && Ae.key === X && !Ae.released, Z = Me ? !b && se?.opaqueBackground ? "park" : "true" : "false";
457
+ let Me = X !== null && Ae.key === X && !Ae.released, Z = Me ? !b && le?.opaqueBackground ? "park" : "true" : "false";
454
458
  o(() => {
455
459
  if (Me) return ve(() => je((e) => e.key === X && !e.released ? {
456
460
  key: X,
@@ -458,12 +462,12 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
458
462
  } : e));
459
463
  }, [Me, X]);
460
464
  let Ne = ce({
461
- initial: pe,
465
+ initial: me,
462
466
  isActive: b,
463
467
  status: D
464
468
  });
465
- return /* @__PURE__ */ ye("div", {
466
- ref: xe,
469
+ return /* @__PURE__ */ be("div", {
470
+ ref: H,
467
471
  style: {
468
472
  position: T,
469
473
  top: 0,
@@ -488,7 +492,7 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
488
492
  zIndex: 1
489
493
  }
490
494
  }),
491
- /* @__PURE__ */ ye("div", {
495
+ /* @__PURE__ */ be("div", {
492
496
  ref: U,
493
497
  ...v,
494
498
  onPointerDown: we,
@@ -523,7 +527,7 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
523
527
  }),
524
528
  a && /* @__PURE__ */ L("div", { style: {
525
529
  width: "100%",
526
- minHeight: R
530
+ minHeight: ye
527
531
  } }),
528
532
  c,
529
533
  /* @__PURE__ */ L("div", {
@@ -539,7 +543,7 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
539
543
  s && /* @__PURE__ */ L("div", { style: {
540
544
  display: I ? "none" : void 0,
541
545
  width: "100%",
542
- minHeight: B
546
+ minHeight: xe
543
547
  } }),
544
548
  !m && r && /* @__PURE__ */ L("div", {
545
549
  style: {
@@ -557,7 +561,7 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
557
561
  ]
558
562
  }),
559
563
  a && /* @__PURE__ */ L("div", {
560
- ref: W,
564
+ ref: G,
561
565
  "data-flemo-bar": "app",
562
566
  "data-flemo-bar-transition": S,
563
567
  "data-flemo-bar-status": D,
@@ -574,7 +578,7 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
574
578
  children: a
575
579
  }),
576
580
  s && /* @__PURE__ */ L("div", {
577
- ref: G,
581
+ ref: K,
578
582
  "data-flemo-bar": "nav",
579
583
  "data-flemo-bar-transition": S,
580
584
  "data-flemo-bar-status": D,
@@ -591,8 +595,8 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
591
595
  },
592
596
  children: s
593
597
  }),
594
- P && /* @__PURE__ */ L(Re, {
595
- ref: Se,
598
+ P && /* @__PURE__ */ L(Be, {
599
+ ref: W,
596
600
  "data-flemo-anim-hold": Z
597
601
  }),
598
602
  /* @__PURE__ */ L("div", {
@@ -611,19 +615,19 @@ function Be({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
611
615
  }
612
616
  //#endregion
613
617
  //#region src/screen/Screen.tsx
614
- function Ve({ children: e, ...t }) {
618
+ function Ue({ children: e, ...t }) {
615
619
  let { isActive: n, isPrev: r, zIndex: i } = V();
616
- return /* @__PURE__ */ L(Le, {
620
+ return /* @__PURE__ */ L(ze, {
617
621
  freeze: _({
618
622
  isActive: n,
619
623
  isPrev: r,
620
624
  zIndex: i,
621
- index: K((e) => e.index),
625
+ index: J((e) => e.index),
622
626
  status: Q((e) => e.status),
623
627
  dragStatus: $((e) => e.dragStatus),
624
628
  replaceTransitionStatus: $((e) => e.replaceTransitionStatus)
625
629
  }),
626
- children: /* @__PURE__ */ L(Be, {
630
+ children: /* @__PURE__ */ L(He, {
627
631
  ...t,
628
632
  children: e
629
633
  })
@@ -631,7 +635,7 @@ function Ve({ children: e, ...t }) {
631
635
  }
632
636
  //#endregion
633
637
  //#region src/screen/Part.tsx
634
- function He({ ref: e, name: t, style: n, children: r, ...i }) {
638
+ function We({ ref: e, name: t, style: n, children: r, ...i }) {
635
639
  let { isActive: a } = V();
636
640
  return /* @__PURE__ */ L("div", {
637
641
  ref: e,
@@ -645,12 +649,12 @@ function He({ ref: e, name: t, style: n, children: r, ...i }) {
645
649
  }
646
650
  //#endregion
647
651
  //#region src/stores/RouterScopeProvider.tsx
648
- function Ue({ children: e }) {
652
+ function Ge({ children: e }) {
649
653
  let [t] = p(() => ({
650
654
  history: te(),
651
- navigate: C(),
652
- transition: ie(),
653
- screen: A(),
655
+ navigate: S(),
656
+ transition: M(),
657
+ screen: k(),
654
658
  driver: b(),
655
659
  markSelfInduced: fe,
656
660
  consume: v,
@@ -662,4 +666,4 @@ function Ue({ children: e }) {
662
666
  });
663
667
  }
664
668
  //#endregion
665
- export { He as Part, Me as Route, je as Router, Ue as RouterScopeProvider, Ve as Screen, B as ScreenContext, Re as ScreenDecorator, Le as ScreenFreeze, Be as ScreenMotion, Ee as Slot, y as createBrowserHistoryDriver, x as createDecorator, T as createPartTransition, E as createRawDecorator, D as createRawPartTransition, O as createRawTransition, N as createTransition, ge as partTransitionMap, K as useHistoryStore, Ne as useNavigate, Q as useNavigateStore, Ie as useParams, Pe as usePathname, V as useScreen, $ as useScreenStore, Fe as useStep, z as useStores, ze as useViewportScrollHeight };
669
+ export { We as Part, Ne as Route, Z as Router, Ge as RouterScopeProvider, Ue as Screen, B as ScreenContext, Be as ScreenDecorator, ze as ScreenFreeze, He as ScreenMotion, De as Slot, y as createBrowserHistoryDriver, x as createDecorator, w as createPartTransition, T as createRawDecorator, E as createRawPartTransition, D as createRawTransition, j as createTransition, he as partTransitionMap, J as useHistoryStore, Fe as useNavigate, Q as useNavigateStore, Re as useParams, Ie as usePathname, V as useScreen, $ as useScreenStore, Le as useStep, z as useStores, Ve as useViewportScrollHeight };
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
- declare function Renderer({ children }: PropsWithChildren): import("react").JSX.Element[];
2
+ declare function Renderer({ children }: PropsWithChildren): (import("react").JSX.Element | null)[];
3
3
  export default Renderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flemo/react",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
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.12.0"
39
+ "@flemo/core": "1.12.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@testing-library/jest-dom": "^6.9.1",
@@ -54,8 +54,8 @@
54
54
  "vite": "^8.0.16",
55
55
  "vite-plugin-dts": "^5.0.2",
56
56
  "vitest": "^4.1.9",
57
- "@flemo/eslint-config": "0.0.0",
58
- "@flemo/tsconfig": "0.0.0"
57
+ "@flemo/tsconfig": "0.0.0",
58
+ "@flemo/eslint-config": "0.0.0"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "react": "^19.2.7",