@flemo/react 1.11.0 → 1.11.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,25 +1,25 @@
|
|
|
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 } from "react";
|
|
2
|
-
import { animHoldKey as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { flushSync as
|
|
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 h, computeScreenFreezeMode as g, consumeSelfInducedPop as ae, createAnimHoldCoordinator as _, createBrowserHistoryDriver as v, createBrowserHistoryDriver as y, createDecorator as b, createHistoryStore as x, createNavigateStore as oe, createNavigationController as S, createPartTransition as C, createRawDecorator as se, createRawPartTransition as w, createRawTransition as T, createRouterScope as E, createScreenSelector as D, createScreenStore as O, createStepController as k, createSwipeController as ce, createTransition as A, createTransitionEngine as le, createTransitionStore as j, decoratorMap as ue, detectBlinkEngine as de, eagerlyDecodeImages as fe, ensureGpuPipelinePrewarm as pe, ensureImageDecodeOffloader as me, ensureScopeHistorySync as he, enteringInitialStyle as ge, getMatchedPathPattern as _e, governedCompiledActive as ve, holdCompositorWarm as M, isLegacyAndroidBlink as ye, isOpaqueColor as be, isServer as N, markSelfInducedPop as xe, matchesPathname as Se, observeBarHeight as Ce, observeViewportScrollHeight as we, partTransitionMap as Te, readImageOffloadOverride as Ee, readLayerPromotionFlag as De, readPrerasterFlag as Oe, readSettleGateFlag as ke, readStepParams as Ae, registerTransitionDefinitions as je, releaseScopeHistorySync as Me, resolveTransition as Ne, seedRouterEntry as Pe, sharedBarsMatch as Fe, steadySixtyPlayerEligible as Ie, subscribeStepParamsRestore as Le } from "@flemo/core";
|
|
3
|
+
import { jsx as P, jsxs as Re } from "react/jsx-runtime";
|
|
4
|
+
import { flushSync as ze } from "react-dom";
|
|
5
5
|
//#region src/stores/StoreContext.ts
|
|
6
|
-
var
|
|
6
|
+
var F = r(null);
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/stores/useStores.ts
|
|
9
|
-
function
|
|
10
|
-
let e = o(
|
|
9
|
+
function I() {
|
|
10
|
+
let e = o(F);
|
|
11
11
|
if (!e) throw Error("flemo stores are missing. Render inside a <Router>.");
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/history/HistoryListener.tsx
|
|
16
|
-
function
|
|
17
|
-
let e =
|
|
18
|
-
return s(() => (
|
|
16
|
+
function L() {
|
|
17
|
+
let e = I();
|
|
18
|
+
return s(() => (he(e), () => Me(e)), [e]), null;
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/screen/ScreenContext.ts
|
|
22
|
-
var
|
|
22
|
+
var R = r({
|
|
23
23
|
id: "",
|
|
24
24
|
isActive: !1,
|
|
25
25
|
isRoot: !0,
|
|
@@ -34,15 +34,15 @@ var I = r({
|
|
|
34
34
|
});
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/screen/useScreen.ts
|
|
37
|
-
function
|
|
38
|
-
return o(
|
|
37
|
+
function z() {
|
|
38
|
+
return o(R);
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/screen/ParamsProvider/ParamsContext.ts
|
|
42
|
-
var
|
|
42
|
+
var B = r({}), V = r(() => {});
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/screen/ParamsProvider/ParamsReducer.ts
|
|
45
|
-
function
|
|
45
|
+
function Be(e, t) {
|
|
46
46
|
switch (t.type) {
|
|
47
47
|
case "SET": return t.params;
|
|
48
48
|
default: return e;
|
|
@@ -50,10 +50,10 @@ function B(e, t) {
|
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/screen/ParamsProvider/ParamsProvider.tsx
|
|
53
|
-
function
|
|
54
|
-
let { isActive: t, params: n } =
|
|
53
|
+
function Ve({ children: e }) {
|
|
54
|
+
let { isActive: t, params: n } = z(), { driver: r } = I(), [i, a] = f(Be, n);
|
|
55
55
|
return s(() => {
|
|
56
|
-
if (t) return
|
|
56
|
+
if (t) return Le(r, (e) => a({
|
|
57
57
|
type: "SET",
|
|
58
58
|
params: e
|
|
59
59
|
}));
|
|
@@ -61,9 +61,9 @@ function Be({ children: e }) {
|
|
|
61
61
|
t,
|
|
62
62
|
a,
|
|
63
63
|
r
|
|
64
|
-
]), /* @__PURE__ */
|
|
64
|
+
]), /* @__PURE__ */ P(V.Provider, {
|
|
65
65
|
value: a,
|
|
66
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ P(B.Provider, {
|
|
67
67
|
value: i,
|
|
68
68
|
children: e
|
|
69
69
|
})
|
|
@@ -71,47 +71,47 @@ function Be({ 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
|
|
74
|
+
var He = (e) => e;
|
|
75
|
+
function H(t, n = He) {
|
|
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
|
}
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/stores/useHistoryStore.ts
|
|
81
|
-
function
|
|
82
|
-
return
|
|
81
|
+
function U(e) {
|
|
82
|
+
return H(I().history, e);
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/RouterIdContext.ts
|
|
86
|
-
var
|
|
86
|
+
var Ue = r(null);
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/renderer/Renderer.tsx
|
|
89
|
-
function
|
|
90
|
-
let t =
|
|
91
|
-
return
|
|
92
|
-
let [r] = n.toArray(e).filter((e) =>
|
|
93
|
-
return r ? /* @__PURE__ */
|
|
89
|
+
function We({ children: e }) {
|
|
90
|
+
let t = U((e) => e.index), r = U((e) => e.histories), i = I(), a = o(R), s = o(Ue);
|
|
91
|
+
return D(r, t).map((t) => {
|
|
92
|
+
let [r] = n.toArray(e).filter((e) => Se(e.props.path, t.pathname));
|
|
93
|
+
return r ? /* @__PURE__ */ P(R.Provider, {
|
|
94
94
|
value: {
|
|
95
95
|
...t,
|
|
96
96
|
isPrev: t.isPrev || a.isPrev,
|
|
97
97
|
navigateStore: i.navigate,
|
|
98
98
|
routerId: s ?? void 0,
|
|
99
|
-
routePath:
|
|
99
|
+
routePath: _e(r.props.path, t.pathname)
|
|
100
100
|
},
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ P(Ve, { 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 Ge = r({ contained: !1 });
|
|
108
|
+
function Ke() {
|
|
109
|
+
return o(Ge);
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/transition/styles.ts
|
|
113
|
-
function
|
|
114
|
-
u(() =>
|
|
113
|
+
function qe(e, t, n = []) {
|
|
114
|
+
u(() => je(e, t, n), [
|
|
115
115
|
e,
|
|
116
116
|
t,
|
|
117
117
|
n
|
|
@@ -119,72 +119,72 @@ function Ge(e, t, n = []) {
|
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/RouterDepthContext.ts
|
|
122
|
-
var
|
|
123
|
-
function
|
|
124
|
-
return /* @__PURE__ */
|
|
122
|
+
var Je = r(0), Ye = { contained: !0 };
|
|
123
|
+
function Xe({ children: e, className: t, style: n }) {
|
|
124
|
+
return /* @__PURE__ */ P("div", {
|
|
125
125
|
className: t,
|
|
126
126
|
style: {
|
|
127
127
|
position: "relative",
|
|
128
128
|
overflow: "hidden",
|
|
129
129
|
...n
|
|
130
130
|
},
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
-
value:
|
|
133
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ P(Ge.Provider, {
|
|
132
|
+
value: Ye,
|
|
133
|
+
children: /* @__PURE__ */ P(We, { children: e })
|
|
134
134
|
})
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region src/Router.tsx
|
|
139
|
-
function
|
|
139
|
+
function Ze(e) {
|
|
140
140
|
let t = null;
|
|
141
141
|
return n.forEach(e, (e) => {
|
|
142
142
|
if (t || !i(e)) return;
|
|
143
|
-
if (e.type ===
|
|
143
|
+
if (e.type === Xe) {
|
|
144
144
|
t = n.toArray(e.props.children).filter(i);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
let r = e.props.children;
|
|
148
148
|
if (r) {
|
|
149
|
-
let e =
|
|
149
|
+
let e = Ze(r);
|
|
150
150
|
e && (t = e);
|
|
151
151
|
}
|
|
152
152
|
}), t;
|
|
153
153
|
}
|
|
154
|
-
var
|
|
155
|
-
function
|
|
156
|
-
let ee = o(
|
|
154
|
+
var Qe = typeof window > "u" ? s : d, W = [], $e = [], et = [], tt = { contained: !0 }, G = 500, K = 3e3;
|
|
155
|
+
function nt({ children: e, initPath: t = "/", defaultTransitionName: r = "cupertino", transitions: i = W, decorators: a = $e, partTransitions: l = et, history: u = "browser", createDriver: d, className: f, style: p }) {
|
|
156
|
+
let ee = o(Je), te = c(), [ne, re] = m(!1);
|
|
157
157
|
s(() => re(!0), []);
|
|
158
|
-
let ie = ne ? te : null, h = ee > 0, g = u === "memory", ae = c(), _ = o(
|
|
159
|
-
let t = (
|
|
160
|
-
return
|
|
158
|
+
let ie = ne ? te : null, h = ee > 0, g = u === "memory", ae = c(), _ = o(R), v = o(F), b = h && _.id ? `_F_${v?.routerKey ?? ""}${_.id}_` : ae, x = Ze(e), oe = x !== null, S = h ? null : v, C = S !== null, se = d ?? y, [w] = m(() => g ? null : se(C ? void 0 : b)), T = !h && !g && !N(), D = T && w ? w.readPathname() : t || "/", O = D.indexOf("?"), k = (O >= 0 ? D.slice(0, O) : D) || "/", ce = T ? window.location.search : O >= 0 ? D.slice(O) : "", [A] = m(() => {
|
|
159
|
+
let t = (x ?? n.toArray(e)).map((e) => e.props.path).flat();
|
|
160
|
+
return E({
|
|
161
161
|
routePaths: t,
|
|
162
|
-
pathname:
|
|
163
|
-
search:
|
|
162
|
+
pathname: k,
|
|
163
|
+
search: ce,
|
|
164
164
|
defaultTransitionName: r,
|
|
165
165
|
memory: g,
|
|
166
|
-
browserDriver:
|
|
167
|
-
hostedScope:
|
|
168
|
-
routerKey:
|
|
169
|
-
zoneEntryId: h && !
|
|
170
|
-
persistKey: h && !g && !
|
|
166
|
+
browserDriver: w,
|
|
167
|
+
hostedScope: S,
|
|
168
|
+
routerKey: C ? void 0 : b,
|
|
169
|
+
zoneEntryId: h && !C && _.id || void 0,
|
|
170
|
+
persistKey: h && !g && !C ? b : void 0
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}), [
|
|
176
|
-
let e =
|
|
177
|
-
if (e !== "off") return e === "on" ||
|
|
178
|
-
}, []), s(() =>
|
|
173
|
+
A.transition.setState({ defaultTransitionName: r }), Qe(() => (A.life.alive = !0, () => {
|
|
174
|
+
A.life.alive = !1;
|
|
175
|
+
}), [A]), qe(i, a, l), s(() => {
|
|
176
|
+
let e = Ee();
|
|
177
|
+
if (e !== "off") return e === "on" || ye() ? me() : void 0;
|
|
178
|
+
}, []), s(() => pe(), []), s(() => {
|
|
179
179
|
if (typeof document > "u") return;
|
|
180
180
|
let e = null, t = null, n = 0, r = () => {
|
|
181
181
|
let r = Date.now();
|
|
182
|
-
if (r - n <
|
|
182
|
+
if (r - n < G) return;
|
|
183
183
|
n = r, t && clearTimeout(t);
|
|
184
184
|
let i = e;
|
|
185
|
-
e =
|
|
185
|
+
e = M(), i?.(), t = setTimeout(() => {
|
|
186
186
|
t = null, e?.(), e = null;
|
|
187
|
-
},
|
|
187
|
+
}, K);
|
|
188
188
|
}, i = [
|
|
189
189
|
"pointerdown",
|
|
190
190
|
"pointermove",
|
|
@@ -198,63 +198,63 @@ function G({ children: e, initPath: t = "/", defaultTransitionName: r = "cuperti
|
|
|
198
198
|
t && clearTimeout(t), e?.();
|
|
199
199
|
};
|
|
200
200
|
}, []), s(() => {
|
|
201
|
-
g || !
|
|
202
|
-
driver:
|
|
203
|
-
routerKey:
|
|
204
|
-
nested: h && !
|
|
205
|
-
seedPathname:
|
|
201
|
+
g || !w || Pe({
|
|
202
|
+
driver: w,
|
|
203
|
+
routerKey: C ? null : b,
|
|
204
|
+
nested: h && !C,
|
|
205
|
+
seedPathname: k,
|
|
206
206
|
defaultTransitionName: r,
|
|
207
|
-
rootParams:
|
|
207
|
+
rootParams: A.history.getState().histories[0]?.params ?? {}
|
|
208
208
|
});
|
|
209
209
|
}, [
|
|
210
210
|
g,
|
|
211
|
-
|
|
211
|
+
C,
|
|
212
212
|
h,
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
b,
|
|
214
|
+
k,
|
|
215
215
|
r,
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
A.history,
|
|
217
|
+
w
|
|
218
218
|
]);
|
|
219
|
-
let
|
|
219
|
+
let le = oe ? e : /* @__PURE__ */ P(We, { children: e }), j = /* @__PURE__ */ P(Ue.Provider, {
|
|
220
220
|
value: ie,
|
|
221
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ P(Je.Provider, {
|
|
222
222
|
value: ee + 1,
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
value:
|
|
225
|
-
children: [!g && /* @__PURE__ */
|
|
226
|
-
value:
|
|
227
|
-
children:
|
|
228
|
-
}) :
|
|
223
|
+
children: /* @__PURE__ */ Re(F.Provider, {
|
|
224
|
+
value: A,
|
|
225
|
+
children: [!g && /* @__PURE__ */ P(L, {}), h ? /* @__PURE__ */ P(Ge.Provider, {
|
|
226
|
+
value: tt,
|
|
227
|
+
children: le
|
|
228
|
+
}) : le]
|
|
229
229
|
})
|
|
230
230
|
})
|
|
231
231
|
});
|
|
232
|
-
return h ? /* @__PURE__ */
|
|
232
|
+
return h ? /* @__PURE__ */ P("div", {
|
|
233
233
|
className: f,
|
|
234
234
|
style: {
|
|
235
235
|
position: "relative",
|
|
236
236
|
overflow: "hidden",
|
|
237
237
|
...p
|
|
238
238
|
},
|
|
239
|
-
children:
|
|
240
|
-
}) :
|
|
239
|
+
children: j
|
|
240
|
+
}) : j;
|
|
241
241
|
}
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region src/Route.tsx
|
|
244
|
-
function
|
|
244
|
+
function q({ element: e }) {
|
|
245
245
|
return e;
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
248
248
|
//#region src/utils/buildRoutePath.ts
|
|
249
|
-
function
|
|
250
|
-
return
|
|
249
|
+
function rt(e, t) {
|
|
250
|
+
return re(e, t);
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/navigate/useNavigate.ts
|
|
254
|
-
function
|
|
255
|
-
let e =
|
|
254
|
+
function it() {
|
|
255
|
+
let e = I(), t = S({
|
|
256
256
|
stores: e,
|
|
257
|
-
buildPathname: (e, t) =>
|
|
257
|
+
buildPathname: (e, t) => rt(e, t),
|
|
258
258
|
driver: e.driver,
|
|
259
259
|
markSelfInduced: e.markSelfInduced
|
|
260
260
|
});
|
|
@@ -266,21 +266,21 @@ function nt() {
|
|
|
266
266
|
}
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/navigate/usePathname.ts
|
|
269
|
-
function
|
|
270
|
-
return
|
|
269
|
+
function J() {
|
|
270
|
+
return U((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
|
|
271
271
|
}
|
|
272
272
|
//#endregion
|
|
273
273
|
//#region src/navigate/useStep.ts
|
|
274
|
-
function
|
|
275
|
-
let { routePath: e } =
|
|
274
|
+
function at() {
|
|
275
|
+
let { routePath: e } = z(), t = I(), n = o(V), { driver: r, markSelfInduced: i } = t, [a, c] = m(null);
|
|
276
276
|
s(() => {
|
|
277
|
-
if (!e) return c(
|
|
277
|
+
if (!e) return c(Ae(r.readState())), r.subscribe((e) => c(Ae(e.state)));
|
|
278
278
|
}, [e, r]);
|
|
279
|
-
let l =
|
|
279
|
+
let l = k({
|
|
280
280
|
stores: t,
|
|
281
281
|
driver: r,
|
|
282
282
|
markSelfInduced: i,
|
|
283
|
-
buildStepPathname: (t) => e ?
|
|
283
|
+
buildStepPathname: (t) => e ? rt(e, t).pathname : ne(r.readPathname(), t),
|
|
284
284
|
applyParams: (t) => {
|
|
285
285
|
n({
|
|
286
286
|
type: "SET",
|
|
@@ -297,50 +297,50 @@ function it() {
|
|
|
297
297
|
}
|
|
298
298
|
//#endregion
|
|
299
299
|
//#region src/screen/ParamsProvider/useParams.ts
|
|
300
|
-
function
|
|
301
|
-
return o(
|
|
300
|
+
function Y() {
|
|
301
|
+
return o(B);
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/screen/ScreenFreeze.tsx
|
|
305
|
-
var
|
|
306
|
-
function
|
|
305
|
+
var ot = 3e3;
|
|
306
|
+
function st({ freeze: e, children: n }) {
|
|
307
307
|
let [r, i] = m(e), a = p(null);
|
|
308
308
|
return !e && r && i(!1), s(() => {
|
|
309
309
|
if (!(!e || r)) {
|
|
310
|
-
if (!
|
|
310
|
+
if (!Ie()) {
|
|
311
311
|
i(!0);
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
314
|
return a.current = setTimeout(() => {
|
|
315
315
|
a.current = null, i(!0);
|
|
316
|
-
},
|
|
316
|
+
}, ot), () => {
|
|
317
317
|
a.current !== null && (clearTimeout(a.current), a.current = null);
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
}, [e, r]), /* @__PURE__ */
|
|
320
|
+
}, [e, r]), /* @__PURE__ */ P(t, {
|
|
321
321
|
mode: e && r ? "hidden" : "visible",
|
|
322
322
|
children: n
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
//#endregion
|
|
326
326
|
//#region src/screen/scopeAnimHoldCoordinator.ts
|
|
327
|
-
var
|
|
328
|
-
function
|
|
329
|
-
let t =
|
|
330
|
-
return t || (t =
|
|
327
|
+
var ct = /* @__PURE__ */ new WeakMap();
|
|
328
|
+
function lt(e) {
|
|
329
|
+
let t = ct.get(e);
|
|
330
|
+
return t || (t = _(), ct.set(e, t)), t;
|
|
331
331
|
}
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region src/stores/useNavigateStore.ts
|
|
334
|
-
function
|
|
335
|
-
return
|
|
334
|
+
function ut(e) {
|
|
335
|
+
return H(I().navigate, e);
|
|
336
336
|
}
|
|
337
337
|
//#endregion
|
|
338
338
|
//#region src/screen/ScreenDecorator.tsx
|
|
339
|
-
function
|
|
340
|
-
let { isActive: r, isPrev: i, transitionName: a } =
|
|
339
|
+
function dt({ ref: e, style: t, ...n }) {
|
|
340
|
+
let { isActive: r, isPrev: i, transitionName: a } = z(), o = p(null);
|
|
341
341
|
l(e, () => o.current);
|
|
342
|
-
let s =
|
|
343
|
-
return u ? /* @__PURE__ */
|
|
342
|
+
let s = ut((e) => i ? "COMPLETED" : e.status), { decoratorName: c } = Ne(a), u = ue.get(c);
|
|
343
|
+
return u ? /* @__PURE__ */ P("div", {
|
|
344
344
|
ref: o,
|
|
345
345
|
"data-flemo-decorator": !0,
|
|
346
346
|
"data-flemo-decorator-name": u.name,
|
|
@@ -361,9 +361,9 @@ function lt({ ref: e, style: t, ...n }) {
|
|
|
361
361
|
}
|
|
362
362
|
//#endregion
|
|
363
363
|
//#region src/screen/useViewportScrollHeight.ts
|
|
364
|
-
function
|
|
364
|
+
function ft() {
|
|
365
365
|
let [e, t] = m(0), [n, r] = m(0);
|
|
366
|
-
return s(() =>
|
|
366
|
+
return s(() => we((e, n) => {
|
|
367
367
|
r(n), t(e);
|
|
368
368
|
}), []), {
|
|
369
369
|
viewportScrollHeight: e,
|
|
@@ -371,85 +371,91 @@ function ut() {
|
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
373
|
//#endregion
|
|
374
|
+
//#region src/utils/useHydrationSafeFlag.ts
|
|
375
|
+
var pt = () => () => {}, mt = () => !1;
|
|
376
|
+
function ht(e) {
|
|
377
|
+
return ee(pt, e, mt);
|
|
378
|
+
}
|
|
379
|
+
//#endregion
|
|
374
380
|
//#region src/stores/useScreenStore.ts
|
|
375
381
|
function X(e) {
|
|
376
|
-
return
|
|
382
|
+
return H(I().screen, e);
|
|
377
383
|
}
|
|
378
384
|
//#endregion
|
|
379
385
|
//#region src/screen/ScreenMotion.tsx
|
|
380
|
-
function
|
|
381
|
-
let { id:
|
|
382
|
-
|
|
383
|
-
getTransitionTaskId: () =>
|
|
384
|
-
setDragStatus:
|
|
385
|
-
setReplaceTransitionStatus:
|
|
386
|
+
function gt({ 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: g, backgroundColor: ae = "white", contentScrollable: _ = !0, ...v }) {
|
|
387
|
+
let { id: y, isActive: b, isRoot: x, isPrev: oe, zIndex: S, transitionName: C, prevTransitionName: se } = z(), { contained: w } = Ke(), T = w ? "absolute" : "fixed", E = I(), D = o(Ue), O = U((e) => e.index), k = U((e) => e.histories), A = b || S === O - 1, j = ut((e) => A ? e.status : "COMPLETED"), pe = X((e) => e.dragStatus), me = X((e) => e.replaceTransitionStatus), he = E.screen.getState().setDragStatus, _e = E.screen.getState().setReplaceTransitionStatus, M = b ? k[O - 1]?.id : k[O]?.id, ye = X((e) => M ? e.sharedBars[M] : void 0), N = X((e) => M ? e.sharedBarMetadata[M] : void 0), xe = X((e) => M ? e.screenSurfaces[M] : void 0), Se = p(null);
|
|
388
|
+
Se.current ||= le({
|
|
389
|
+
getTransitionTaskId: () => E.navigate.getState().transitionTaskId,
|
|
390
|
+
setDragStatus: he,
|
|
391
|
+
setReplaceTransitionStatus: _e
|
|
386
392
|
});
|
|
387
|
-
let
|
|
388
|
-
|
|
389
|
-
let
|
|
390
|
-
key:
|
|
393
|
+
let we = Se.current, Te = p(null);
|
|
394
|
+
Te.current ||= lt(E.navigate);
|
|
395
|
+
let Ee = Ne(C), { initial: Ae, swipeDirection: je, decoratorName: Me } = Ee, Pe = ue.get(Me), { viewportScrollHeight: Ie } = ft(), Le = Ie > 0, F = !!c, L = !!u, R = F ? `${typeof l}:${String(l)}` : null, B = L ? `${typeof f}:${String(f)}` : null, [V, Be] = m({
|
|
396
|
+
key: R,
|
|
391
397
|
height: 0
|
|
392
|
-
}), [
|
|
398
|
+
}), [Ve, He] = m({
|
|
393
399
|
key: B,
|
|
394
400
|
height: 0
|
|
395
|
-
}),
|
|
396
|
-
e <= 0 ||
|
|
397
|
-
key:
|
|
401
|
+
}), H = p(V), We = p(Ve), Ge = V.key === R ? V.height : 0, qe = Ve.key === B ? Ve.height : 0, Je = Fe(F ? { id: l } : void 0, N?.topBar) ? N?.topBar?.height ?? 0 : 0, Ye = Fe(L ? { id: f } : void 0, N?.bottomBar) ? N?.bottomBar?.height ?? 0 : 0, Xe = Ge || Je, Ze = qe || Ye, Qe = p(null), W = p(null), $e = p(null), et = p(null), tt = p(null), G = p(null), K = p(null), nt = a((e) => {
|
|
402
|
+
e <= 0 || R === null || (et.current && (et.current.style.minHeight = `${e}px`), H.current = {
|
|
403
|
+
key: R,
|
|
398
404
|
height: e
|
|
399
|
-
},
|
|
400
|
-
key:
|
|
405
|
+
}, Be((t) => t.key === R && t.height === e ? t : {
|
|
406
|
+
key: R,
|
|
401
407
|
height: e
|
|
402
|
-
}),
|
|
408
|
+
}), E.screen.getState().updateSharedBarHeight(y, "topBar", e));
|
|
403
409
|
}, [
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
]),
|
|
408
|
-
e <= 0 || B === null || (tt.current && (tt.current.style.minHeight = `${e}px`),
|
|
410
|
+
y,
|
|
411
|
+
E.screen,
|
|
412
|
+
R
|
|
413
|
+
]), q = a((e) => {
|
|
414
|
+
e <= 0 || B === null || (tt.current && (tt.current.style.minHeight = `${e}px`), We.current = {
|
|
409
415
|
key: B,
|
|
410
416
|
height: e
|
|
411
|
-
},
|
|
417
|
+
}, He((t) => t.key === B && t.height === e ? t : {
|
|
412
418
|
key: B,
|
|
413
419
|
height: e
|
|
414
|
-
}),
|
|
420
|
+
}), E.screen.getState().updateSharedBarHeight(y, "bottomBar", e));
|
|
415
421
|
}, [
|
|
416
422
|
B,
|
|
417
|
-
|
|
418
|
-
|
|
423
|
+
y,
|
|
424
|
+
E.screen
|
|
419
425
|
]), rt = a((e) => {
|
|
420
|
-
G.current = e, e?.offsetHeight &&
|
|
421
|
-
}, [
|
|
422
|
-
K.current = e, e?.offsetHeight &&
|
|
423
|
-
}, [
|
|
424
|
-
transition:
|
|
425
|
-
decorator:
|
|
426
|
+
G.current = e, e?.offsetHeight && nt(e.offsetHeight);
|
|
427
|
+
}, [nt]), it = a((e) => {
|
|
428
|
+
K.current = e, e?.offsetHeight && q(e.offsetHeight);
|
|
429
|
+
}, [q]), J = p({
|
|
430
|
+
transition: Ee,
|
|
431
|
+
decorator: Pe,
|
|
426
432
|
hasSharedTopBar: !!c,
|
|
427
433
|
hasSharedBottomBar: !!u,
|
|
428
434
|
sharedTopBarId: l,
|
|
429
435
|
sharedBottomBarId: f,
|
|
430
|
-
viewportScrollHeight:
|
|
431
|
-
isRoot:
|
|
432
|
-
isActive:
|
|
433
|
-
status:
|
|
434
|
-
dragStatus:
|
|
435
|
-
index:
|
|
436
|
+
viewportScrollHeight: Ie,
|
|
437
|
+
isRoot: x,
|
|
438
|
+
isActive: b,
|
|
439
|
+
status: j,
|
|
440
|
+
dragStatus: pe,
|
|
441
|
+
index: O
|
|
436
442
|
});
|
|
437
443
|
J.current = {
|
|
438
|
-
transition:
|
|
439
|
-
decorator:
|
|
444
|
+
transition: Ee,
|
|
445
|
+
decorator: Pe,
|
|
440
446
|
hasSharedTopBar: !!c,
|
|
441
447
|
hasSharedBottomBar: !!u,
|
|
442
448
|
sharedTopBarId: l,
|
|
443
449
|
sharedBottomBarId: f,
|
|
444
|
-
viewportScrollHeight:
|
|
445
|
-
isRoot:
|
|
446
|
-
isActive:
|
|
447
|
-
status:
|
|
448
|
-
dragStatus:
|
|
449
|
-
index:
|
|
450
|
+
viewportScrollHeight: Ie,
|
|
451
|
+
isRoot: x,
|
|
452
|
+
isActive: b,
|
|
453
|
+
status: j,
|
|
454
|
+
dragStatus: pe,
|
|
455
|
+
index: O
|
|
450
456
|
};
|
|
451
457
|
let at = p(null);
|
|
452
|
-
at.current ||=
|
|
458
|
+
at.current ||= ce({
|
|
453
459
|
getTransition: () => J.current.transition,
|
|
454
460
|
getDecorator: () => J.current.decorator,
|
|
455
461
|
getElements: () => ({
|
|
@@ -469,21 +475,21 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
469
475
|
return !e.isRoot && e.isActive && e.status === "COMPLETED" && e.dragStatus === "IDLE" && !!e.transition.swipeDirection && e.viewportScrollHeight < 10;
|
|
470
476
|
},
|
|
471
477
|
getPartnerBars: () => {
|
|
472
|
-
let e = J.current, t =
|
|
473
|
-
return n ?
|
|
478
|
+
let e = J.current, t = E.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
|
|
479
|
+
return n ? E.screen.getState().sharedBars[n] : void 0;
|
|
474
480
|
},
|
|
475
481
|
getPartnerBarMetadata: () => {
|
|
476
|
-
let e = J.current, t =
|
|
477
|
-
return n ?
|
|
482
|
+
let e = J.current, t = E.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
|
|
483
|
+
return n ? E.screen.getState().sharedBarMetadata[n] : void 0;
|
|
478
484
|
},
|
|
479
|
-
setDragStatus:
|
|
485
|
+
setDragStatus: he,
|
|
480
486
|
back: () => window.history.back()
|
|
481
487
|
});
|
|
482
|
-
let Y = at.current, ot = (e) => Y.pointerDown(e.nativeEvent),
|
|
483
|
-
(
|
|
488
|
+
let Y = at.current, ot = (e) => Y.pointerDown(e.nativeEvent), st = (e) => Y.pointerMove(e.nativeEvent), ct = (e) => Y.pointerUp(e.nativeEvent), pt = (e) => Y.pointerCancel(e.nativeEvent), mt = (e) => {
|
|
489
|
+
(j === "PUSHING" || j === "REPLACING") && (e.preventDefault(), e.stopPropagation());
|
|
484
490
|
};
|
|
485
491
|
s(() => {
|
|
486
|
-
|
|
492
|
+
fe(W.current);
|
|
487
493
|
}, []), s(() => {
|
|
488
494
|
let e = W.current;
|
|
489
495
|
if (!e) return;
|
|
@@ -494,99 +500,99 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
494
500
|
e.removeEventListener("touchmove", t);
|
|
495
501
|
};
|
|
496
502
|
}, [Y]), d(() => {
|
|
497
|
-
let { registerSharedBars: e, unregisterSharedBars: t } =
|
|
498
|
-
return e(
|
|
499
|
-
topBar:
|
|
500
|
-
bottomBar:
|
|
503
|
+
let { registerSharedBars: e, unregisterSharedBars: t } = E.screen.getState(), n = H.current, r = We.current;
|
|
504
|
+
return e(y, {
|
|
505
|
+
topBar: F,
|
|
506
|
+
bottomBar: L
|
|
501
507
|
}, {
|
|
502
|
-
topBar:
|
|
508
|
+
topBar: F ? {
|
|
503
509
|
id: l,
|
|
504
|
-
height: n.key ===
|
|
510
|
+
height: n.key === R ? n.height : void 0
|
|
505
511
|
} : void 0,
|
|
506
|
-
bottomBar:
|
|
512
|
+
bottomBar: L ? {
|
|
507
513
|
id: f,
|
|
508
514
|
height: r.key === B ? r.height : void 0
|
|
509
515
|
} : void 0
|
|
510
|
-
}), () => t(
|
|
516
|
+
}), () => t(y);
|
|
511
517
|
}, [
|
|
512
518
|
B,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
519
|
+
L,
|
|
520
|
+
F,
|
|
521
|
+
y,
|
|
516
522
|
f,
|
|
517
523
|
l,
|
|
518
|
-
|
|
519
|
-
|
|
524
|
+
E.screen,
|
|
525
|
+
R
|
|
520
526
|
]), d(() => {
|
|
521
527
|
let e = G.current;
|
|
522
|
-
if (e) return
|
|
523
|
-
}, [
|
|
528
|
+
if (e) return Ce(e, nt);
|
|
529
|
+
}, [nt, c]), d(() => {
|
|
524
530
|
let e = K.current;
|
|
525
|
-
if (e) return
|
|
526
|
-
}, [
|
|
531
|
+
if (e) return Ce(e, q);
|
|
532
|
+
}, [q, u]), d(() => {
|
|
527
533
|
let e = W.current;
|
|
528
534
|
if (!e) return;
|
|
529
|
-
let { registerScreenSurface: t, unregisterScreenSurface: n } =
|
|
530
|
-
return t(
|
|
535
|
+
let { registerScreenSurface: t, unregisterScreenSurface: n } = E.screen.getState();
|
|
536
|
+
return t(y, { opaqueBackground: be(getComputedStyle(e).backgroundColor) }), () => n(y);
|
|
531
537
|
}, [
|
|
532
|
-
|
|
538
|
+
y,
|
|
533
539
|
ae,
|
|
534
|
-
|
|
535
|
-
|
|
540
|
+
j,
|
|
541
|
+
E.screen
|
|
536
542
|
]);
|
|
537
|
-
let
|
|
538
|
-
status:
|
|
539
|
-
isTopOrTopPrev:
|
|
540
|
-
hasTopBar:
|
|
541
|
-
hasNavBar:
|
|
543
|
+
let gt = A, { app: _t, nav: vt } = ie({
|
|
544
|
+
status: j,
|
|
545
|
+
isTopOrTopPrev: gt,
|
|
546
|
+
hasTopBar: F,
|
|
547
|
+
hasNavBar: L,
|
|
542
548
|
topBarId: l,
|
|
543
549
|
bottomBarId: f,
|
|
544
|
-
partnerBars:
|
|
545
|
-
partnerMetadata:
|
|
546
|
-
}), Z =
|
|
547
|
-
status:
|
|
548
|
-
isTopOrTopPrev:
|
|
549
|
-
transitionName:
|
|
550
|
-
}),
|
|
551
|
-
isActive:
|
|
552
|
-
isPrev:
|
|
553
|
-
zIndex:
|
|
554
|
-
index:
|
|
555
|
-
status:
|
|
556
|
-
dragStatus:
|
|
557
|
-
replaceTransitionStatus:
|
|
558
|
-
}),
|
|
550
|
+
partnerBars: ye,
|
|
551
|
+
partnerMetadata: N
|
|
552
|
+
}), Z = te({
|
|
553
|
+
status: j,
|
|
554
|
+
isTopOrTopPrev: gt,
|
|
555
|
+
transitionName: C
|
|
556
|
+
}), yt = h({
|
|
557
|
+
isActive: b,
|
|
558
|
+
isPrev: oe,
|
|
559
|
+
zIndex: S,
|
|
560
|
+
index: O,
|
|
561
|
+
status: j,
|
|
562
|
+
dragStatus: pe,
|
|
563
|
+
replaceTransitionStatus: me
|
|
564
|
+
}), bt = p(yt), xt = p(Z !== null && yt), [St, Ct] = m({
|
|
559
565
|
key: Z,
|
|
560
566
|
released: Z === null
|
|
561
567
|
});
|
|
562
|
-
|
|
568
|
+
St.key !== Z && (Ct({
|
|
563
569
|
key: Z,
|
|
564
570
|
released: Z === null
|
|
565
|
-
}),
|
|
566
|
-
let Q = Z !== null &&
|
|
567
|
-
d(() =>
|
|
571
|
+
}), xt.current = Z !== null && bt.current), bt.current = yt;
|
|
572
|
+
let Q = Z !== null && St.key === Z && !St.released, $ = Q ? !b && xe?.opaqueBackground ? "park" : b && (j === "PUSHING" || j === "REPLACING") && xe?.opaqueBackground ? Oe() ? "park-over" : "park-under" : "true" : "false", wt = ht(De);
|
|
573
|
+
d(() => we.driveScreenLifecycle({
|
|
568
574
|
getElements: () => ({
|
|
569
575
|
scope: W.current,
|
|
570
576
|
decorator: $e.current,
|
|
571
577
|
bars: [G.current, K.current]
|
|
572
578
|
}),
|
|
573
|
-
transitionName:
|
|
574
|
-
prevTransitionName:
|
|
575
|
-
status:
|
|
576
|
-
isActive:
|
|
579
|
+
transitionName: C,
|
|
580
|
+
prevTransitionName: se,
|
|
581
|
+
status: j,
|
|
582
|
+
isActive: b,
|
|
577
583
|
animHoldReleased: !Q
|
|
578
584
|
}), [
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
585
|
+
we,
|
|
586
|
+
j,
|
|
587
|
+
b,
|
|
588
|
+
se,
|
|
589
|
+
C,
|
|
584
590
|
Q
|
|
585
591
|
]), s(() => {
|
|
586
592
|
if (!Q || Z === null) return;
|
|
587
|
-
let e = Z, t =
|
|
588
|
-
return
|
|
589
|
-
if ((J.current.transition.driver === "native" ||
|
|
593
|
+
let e = Z, t = E.navigate.getState().transitionTaskId, n = t === null ? e : `${e}#${t}`;
|
|
594
|
+
return Te.current.join(n, () => {
|
|
595
|
+
if ((J.current.transition.driver === "native" || ve()) && !de()) {
|
|
590
596
|
for (let e of [
|
|
591
597
|
W.current,
|
|
592
598
|
G.current,
|
|
@@ -595,18 +601,18 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
595
601
|
]) e?.isConnected && e.getAttribute("data-flemo-anim-hold") !== null && e.setAttribute("data-flemo-anim-hold", "false");
|
|
596
602
|
Qe.current && (Qe.current.style.zIndex = "");
|
|
597
603
|
}
|
|
598
|
-
|
|
604
|
+
ze(() => Ct((t) => t.key === e && !t.released ? {
|
|
599
605
|
key: e,
|
|
600
606
|
released: !0
|
|
601
607
|
} : t));
|
|
602
608
|
}, {
|
|
603
609
|
scope: W.current,
|
|
604
|
-
decodeWait:
|
|
605
|
-
contentSettle: ke() && (
|
|
610
|
+
decodeWait: xt.current,
|
|
611
|
+
contentSettle: ke() && (b && j === "PUSHING" || j === "POPPING") ? {
|
|
606
612
|
firstWaitMs: 120,
|
|
607
613
|
capMs: 700,
|
|
608
614
|
graceMs: 60,
|
|
609
|
-
minNodes:
|
|
615
|
+
minNodes: b ? 30 : 1,
|
|
610
616
|
renderSettleOnly: !0
|
|
611
617
|
} : void 0
|
|
612
618
|
});
|
|
@@ -614,20 +620,20 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
614
620
|
Q,
|
|
615
621
|
Z,
|
|
616
622
|
$,
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
623
|
+
b,
|
|
624
|
+
j,
|
|
625
|
+
E.navigate
|
|
620
626
|
]);
|
|
621
|
-
let
|
|
627
|
+
let Tt = $ === "park-under" || $ === "park-over" ? {} : ge({
|
|
622
628
|
initial: Ae,
|
|
623
|
-
isActive:
|
|
624
|
-
status:
|
|
629
|
+
isActive: b,
|
|
630
|
+
status: j
|
|
625
631
|
});
|
|
626
|
-
return /* @__PURE__ */
|
|
632
|
+
return /* @__PURE__ */ Re("div", {
|
|
627
633
|
ref: Qe,
|
|
628
634
|
onClickCapture: mt,
|
|
629
635
|
style: {
|
|
630
|
-
position:
|
|
636
|
+
position: T,
|
|
631
637
|
top: 0,
|
|
632
638
|
left: 0,
|
|
633
639
|
width: "100%",
|
|
@@ -640,18 +646,18 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
640
646
|
overscrollBehavior: "contain"
|
|
641
647
|
},
|
|
642
648
|
children: [
|
|
643
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ Re("div", {
|
|
644
650
|
ref: W,
|
|
645
|
-
...
|
|
651
|
+
...v,
|
|
646
652
|
onPointerDown: ot,
|
|
647
|
-
onPointerMove:
|
|
648
|
-
onPointerUp:
|
|
653
|
+
onPointerMove: st,
|
|
654
|
+
onPointerUp: ct,
|
|
649
655
|
onPointerCancel: pt,
|
|
650
656
|
"data-flemo-screen": !0,
|
|
651
|
-
"data-flemo-router":
|
|
652
|
-
"data-flemo-transition":
|
|
653
|
-
"data-flemo-status":
|
|
654
|
-
"data-flemo-active":
|
|
657
|
+
"data-flemo-router": D ?? void 0,
|
|
658
|
+
"data-flemo-transition": C,
|
|
659
|
+
"data-flemo-status": j,
|
|
660
|
+
"data-flemo-active": b ? "true" : "false",
|
|
655
661
|
"data-flemo-anim-hold": $,
|
|
656
662
|
style: {
|
|
657
663
|
display: "flex",
|
|
@@ -660,22 +666,22 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
660
666
|
backgroundColor: ae,
|
|
661
667
|
overflowY: _ ? void 0 : "auto",
|
|
662
668
|
touchAction: je === "x" ? "pan-y" : je === "y" ? "pan-x" : "auto",
|
|
663
|
-
...
|
|
664
|
-
...
|
|
665
|
-
...
|
|
669
|
+
...wt && ($ !== "false" || S === O && !w) ? { willChange: "transform" } : {},
|
|
670
|
+
...Tt,
|
|
671
|
+
...v.style
|
|
666
672
|
},
|
|
667
673
|
children: [
|
|
668
|
-
!
|
|
674
|
+
!re && t && /* @__PURE__ */ P("div", {
|
|
669
675
|
style: { minHeight: t },
|
|
670
|
-
children: /* @__PURE__ */
|
|
671
|
-
position:
|
|
676
|
+
children: /* @__PURE__ */ P("div", { style: {
|
|
677
|
+
position: T,
|
|
672
678
|
top: 0,
|
|
673
679
|
width: "100%",
|
|
674
680
|
minHeight: t,
|
|
675
681
|
backgroundColor: n
|
|
676
682
|
} })
|
|
677
683
|
}),
|
|
678
|
-
c && /* @__PURE__ */
|
|
684
|
+
c && /* @__PURE__ */ P("div", {
|
|
679
685
|
ref: et,
|
|
680
686
|
"data-flemo-bar-spacer": "app",
|
|
681
687
|
style: {
|
|
@@ -683,8 +689,8 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
683
689
|
minHeight: Xe
|
|
684
690
|
}
|
|
685
691
|
}),
|
|
686
|
-
|
|
687
|
-
/* @__PURE__ */
|
|
692
|
+
ee,
|
|
693
|
+
/* @__PURE__ */ P("div", {
|
|
688
694
|
style: {
|
|
689
695
|
display: "flex",
|
|
690
696
|
flexDirection: "column",
|
|
@@ -694,22 +700,22 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
694
700
|
children: e
|
|
695
701
|
}),
|
|
696
702
|
ne,
|
|
697
|
-
u && /* @__PURE__ */
|
|
703
|
+
u && /* @__PURE__ */ P("div", {
|
|
698
704
|
ref: tt,
|
|
699
705
|
"data-flemo-bar-spacer": "nav",
|
|
700
706
|
style: {
|
|
701
|
-
display:
|
|
707
|
+
display: Le ? "none" : void 0,
|
|
702
708
|
width: "100%",
|
|
703
709
|
minHeight: Ze
|
|
704
710
|
}
|
|
705
711
|
}),
|
|
706
|
-
!g && r && /* @__PURE__ */
|
|
712
|
+
!g && r && /* @__PURE__ */ P("div", {
|
|
707
713
|
style: {
|
|
708
|
-
display:
|
|
714
|
+
display: Le ? "none" : void 0,
|
|
709
715
|
minHeight: r
|
|
710
716
|
},
|
|
711
|
-
children: /* @__PURE__ */
|
|
712
|
-
position:
|
|
717
|
+
children: /* @__PURE__ */ P("div", { style: {
|
|
718
|
+
position: T,
|
|
713
719
|
bottom: 0,
|
|
714
720
|
width: "100%",
|
|
715
721
|
minHeight: r,
|
|
@@ -718,40 +724,40 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
718
724
|
})
|
|
719
725
|
]
|
|
720
726
|
}),
|
|
721
|
-
c && /* @__PURE__ */
|
|
727
|
+
c && /* @__PURE__ */ P("div", {
|
|
722
728
|
ref: rt,
|
|
723
729
|
"data-flemo-bar": "app",
|
|
724
730
|
"data-flemo-bar-id": l,
|
|
725
731
|
"data-flemo-bar-id-type": l === void 0 ? void 0 : typeof l,
|
|
726
|
-
"data-flemo-router":
|
|
727
|
-
"data-flemo-bar-transition":
|
|
728
|
-
"data-flemo-bar-status":
|
|
729
|
-
"data-flemo-bar-active":
|
|
730
|
-
"data-flemo-bar-riding":
|
|
732
|
+
"data-flemo-router": D ?? void 0,
|
|
733
|
+
"data-flemo-bar-transition": C,
|
|
734
|
+
"data-flemo-bar-status": j,
|
|
735
|
+
"data-flemo-bar-active": b ? "true" : "false",
|
|
736
|
+
"data-flemo-bar-riding": _t ? "true" : "false",
|
|
731
737
|
"data-flemo-anim-hold": $,
|
|
732
738
|
style: {
|
|
733
|
-
position:
|
|
734
|
-
top:
|
|
739
|
+
position: T,
|
|
740
|
+
top: re ? 0 : t,
|
|
735
741
|
left: 0,
|
|
736
742
|
width: "100%",
|
|
737
743
|
zIndex: 1
|
|
738
744
|
},
|
|
739
745
|
children: c
|
|
740
746
|
}),
|
|
741
|
-
u && /* @__PURE__ */
|
|
747
|
+
u && /* @__PURE__ */ P("div", {
|
|
742
748
|
ref: it,
|
|
743
749
|
"data-flemo-bar": "nav",
|
|
744
750
|
"data-flemo-bar-id": f,
|
|
745
751
|
"data-flemo-bar-id-type": f === void 0 ? void 0 : typeof f,
|
|
746
|
-
"data-flemo-router":
|
|
747
|
-
"data-flemo-bar-transition":
|
|
748
|
-
"data-flemo-bar-status":
|
|
749
|
-
"data-flemo-bar-active":
|
|
750
|
-
"data-flemo-bar-riding":
|
|
752
|
+
"data-flemo-router": D ?? void 0,
|
|
753
|
+
"data-flemo-bar-transition": C,
|
|
754
|
+
"data-flemo-bar-status": j,
|
|
755
|
+
"data-flemo-bar-active": b ? "true" : "false",
|
|
756
|
+
"data-flemo-bar-riding": vt ? "true" : "false",
|
|
751
757
|
"data-flemo-anim-hold": $,
|
|
752
758
|
style: {
|
|
753
|
-
display:
|
|
754
|
-
position:
|
|
759
|
+
display: Le ? "none" : void 0,
|
|
760
|
+
position: T,
|
|
755
761
|
bottom: g ? 0 : r,
|
|
756
762
|
left: 0,
|
|
757
763
|
width: "100%",
|
|
@@ -759,7 +765,7 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
759
765
|
},
|
|
760
766
|
children: u
|
|
761
767
|
}),
|
|
762
|
-
|
|
768
|
+
Pe && /* @__PURE__ */ P(dt, {
|
|
763
769
|
ref: $e,
|
|
764
770
|
"data-flemo-anim-hold": $
|
|
765
771
|
})
|
|
@@ -768,8 +774,8 @@ function dt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
|
|
|
768
774
|
}
|
|
769
775
|
//#endregion
|
|
770
776
|
//#region src/screen/Screen.tsx
|
|
771
|
-
function
|
|
772
|
-
let { isActive: n, isPrev: r, zIndex: i } =
|
|
777
|
+
function _t({ children: e, ...t }) {
|
|
778
|
+
let { isActive: n, isPrev: r, zIndex: i } = z(), a = U((e) => e.index), o = ut((e) => e.status), c = X((e) => e.dragStatus), l = X((e) => e.replaceTransitionStatus), u = g({
|
|
773
779
|
isActive: n,
|
|
774
780
|
isPrev: r,
|
|
775
781
|
zIndex: i,
|
|
@@ -780,22 +786,22 @@ function ft({ children: e, ...t }) {
|
|
|
780
786
|
}), [d, f] = m(u !== "live");
|
|
781
787
|
return u === "live" && d && f(!1), u === "immediate" && !d && f(!0), s(() => {
|
|
782
788
|
if (u !== "deferred" || d) return;
|
|
783
|
-
let e = setTimeout(() => f(!0),
|
|
789
|
+
let e = setTimeout(() => f(!0), vt);
|
|
784
790
|
return () => clearTimeout(e);
|
|
785
|
-
}, [u, d]), /* @__PURE__ */
|
|
791
|
+
}, [u, d]), /* @__PURE__ */ P(st, {
|
|
786
792
|
freeze: d,
|
|
787
|
-
children: /* @__PURE__ */
|
|
793
|
+
children: /* @__PURE__ */ P(gt, {
|
|
788
794
|
...t,
|
|
789
795
|
children: e
|
|
790
796
|
})
|
|
791
797
|
});
|
|
792
798
|
}
|
|
793
|
-
var
|
|
799
|
+
var vt = 600;
|
|
794
800
|
//#endregion
|
|
795
801
|
//#region src/screen/Part.tsx
|
|
796
|
-
function
|
|
797
|
-
let { isActive: a, isPrev: s, navigateStore: c, routerId: l } =
|
|
798
|
-
return /* @__PURE__ */
|
|
802
|
+
function Z({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
803
|
+
let { isActive: a, isPrev: s, navigateStore: c, routerId: l } = z(), u = o(Ue), d = l ?? u ?? void 0, f = I(), p = H(c ?? f.navigate, (e) => s ? "COMPLETED" : e.status);
|
|
804
|
+
return /* @__PURE__ */ P("div", {
|
|
799
805
|
ref: e,
|
|
800
806
|
"data-flemo-part-name": t,
|
|
801
807
|
"data-flemo-router": d,
|
|
@@ -808,21 +814,21 @@ function mt({ ref: e, name: t, style: n, children: r, ...i }) {
|
|
|
808
814
|
}
|
|
809
815
|
//#endregion
|
|
810
816
|
//#region src/stores/RouterScopeProvider.tsx
|
|
811
|
-
function
|
|
817
|
+
function yt({ children: e }) {
|
|
812
818
|
let [t] = m(() => ({
|
|
813
|
-
history:
|
|
814
|
-
navigate:
|
|
815
|
-
transition:
|
|
816
|
-
screen:
|
|
817
|
-
driver:
|
|
818
|
-
markSelfInduced:
|
|
819
|
-
consume:
|
|
819
|
+
history: x(),
|
|
820
|
+
navigate: oe(),
|
|
821
|
+
transition: j(),
|
|
822
|
+
screen: O(),
|
|
823
|
+
driver: y(),
|
|
824
|
+
markSelfInduced: xe,
|
|
825
|
+
consume: ae,
|
|
820
826
|
life: { alive: !0 }
|
|
821
827
|
}));
|
|
822
|
-
return /* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ P(F.Provider, {
|
|
823
829
|
value: t,
|
|
824
830
|
children: e
|
|
825
831
|
});
|
|
826
832
|
}
|
|
827
833
|
//#endregion
|
|
828
|
-
export {
|
|
834
|
+
export { Z as Part, q as Route, nt as Router, yt as RouterScopeProvider, _t as Screen, R as ScreenContext, dt as ScreenDecorator, st as ScreenFreeze, gt as ScreenMotion, Xe as Slot, v as createBrowserHistoryDriver, b as createDecorator, C as createPartTransition, se as createRawDecorator, w as createRawPartTransition, T as createRawTransition, A as createTransition, Te as partTransitionMap, U as useHistoryStore, it as useNavigate, ut as useNavigateStore, Y as useParams, J as usePathname, z as useScreen, X as useScreenStore, at as useStep, I as useStores, ft as useViewportScrollHeight };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useHydrationSafeFlag(read: () => boolean): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flemo/react",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.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.
|
|
39
|
+
"@flemo/core": "1.25.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@testing-library/jest-dom": "^6.9.1",
|