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