@flemo/react 1.0.0 → 1.0.2
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 +1 -6
- package/dist/history/__tests__/HistoryListener.test.d.ts +1 -0
- package/dist/index.mjs +611 -585
- package/dist/navigate/__tests__/useStep.test.d.ts +8 -0
- package/dist/renderer/__tests__/Renderer.test.d.ts +1 -0
- package/dist/screen/__tests__/ParamsReducer.test.d.ts +1 -0
- package/dist/screen/__tests__/useParams.test.d.ts +8 -0
- package/dist/screen/__tests__/useScreen.test.d.ts +1 -0
- package/dist/transition/__tests__/animateInline.test.d.ts +1 -0
- package/dist/transition/__tests__/useTransitionStyles.test.d.ts +7 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { consumeSelfInducedPop as ge, TaskManger as G, useNavigateStore as
|
|
1
|
+
import { jsx as N, jsxs as Ht, Fragment as fe } from "react/jsx-runtime";
|
|
2
|
+
import Pt, { useEffect as lt, createContext as Gt, useContext as Yt, useReducer as me, Children as te, useInsertionEffect as he, useRef as L, useImperativeHandle as ye, useState as bt, useLayoutEffect as xt } from "react";
|
|
3
|
+
import { consumeSelfInducedPop as ge, TaskManger as G, useNavigateStore as K, useHistoryStore as O, getMatchedPathPattern as we, transitionMap as it, decoratorMap as ft, isServer as Mt, compileTransitionStyles as Se, useTransitionStore as Ot, getParams as ve, markSelfInducedPop as ee, targetToDecls as Te, easingToCss as Ee, variantHasAnimation as Pe, animationName as xe, findScrollable as qt, collectAnimatedProperties as be } from "@flemo/core";
|
|
4
4
|
import { createDecorator as tn, createRawDecorator as en, createRawTransition as nn, createTransition as rn } from "@flemo/core";
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function Ie() {
|
|
6
|
+
return lt(() => {
|
|
7
7
|
const n = async (e) => {
|
|
8
8
|
if (ge())
|
|
9
9
|
return;
|
|
10
|
-
const
|
|
10
|
+
const r = e.state?.id, a = G.generateTaskId();
|
|
11
11
|
(await G.addTask(
|
|
12
12
|
async (u) => {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
13
|
+
const i = e.state?.index, s = e.state?.status, T = e.state?.params, E = e.state?.transitionName, m = e.state?.layoutId, { setStatus: x, setTransitionTaskId: y } = K.getState(), { index: R, addHistory: $, popHistory: C } = O.getState(), D = i < R, F = s === "PUSHING" && i > R, M = s === "REPLACING" && i > R, Y = window.location.pathname;
|
|
14
|
+
if (!D && !F && !M) {
|
|
15
15
|
u.abort();
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
return
|
|
19
|
-
id:
|
|
20
|
-
pathname:
|
|
21
|
-
params:
|
|
18
|
+
return y(a), D ? x("POPPING") : F ? (x("PUSHING"), $({
|
|
19
|
+
id: r,
|
|
20
|
+
pathname: Y,
|
|
21
|
+
params: T,
|
|
22
22
|
transitionName: E,
|
|
23
|
-
layoutId:
|
|
24
|
-
})) :
|
|
25
|
-
id:
|
|
26
|
-
pathname:
|
|
27
|
-
params:
|
|
23
|
+
layoutId: m
|
|
24
|
+
})) : M && (x("REPLACING"), $({
|
|
25
|
+
id: r,
|
|
26
|
+
pathname: Y,
|
|
27
|
+
params: T,
|
|
28
28
|
transitionName: E,
|
|
29
|
-
layoutId:
|
|
29
|
+
layoutId: m
|
|
30
30
|
})), async () => {
|
|
31
|
-
|
|
31
|
+
D && C(i + 1), x("COMPLETED");
|
|
32
32
|
};
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
id:
|
|
35
|
+
id: a,
|
|
36
36
|
control: {
|
|
37
37
|
manual: !0
|
|
38
38
|
}
|
|
@@ -44,267 +44,267 @@ function De() {
|
|
|
44
44
|
};
|
|
45
45
|
}, []), null;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
47
|
+
var j = {}, zt;
|
|
48
48
|
function Re() {
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
const n = "/", e = (
|
|
52
|
-
function
|
|
53
|
-
return
|
|
49
|
+
if (zt) return j;
|
|
50
|
+
zt = 1, Object.defineProperty(j, "__esModule", { value: !0 }), j.PathError = j.TokenData = void 0, j.parse = m, j.compile = x, j.match = $, j.pathToRegexp = C, j.stringify = ht;
|
|
51
|
+
const n = "/", e = (o) => o, r = /^[$_\p{ID_Start}]$/u, a = /^[$\u200c\u200d\p{ID_Continue}]$/u, u = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
|
|
52
|
+
function i(o) {
|
|
53
|
+
return o.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
55
|
+
function s(o) {
|
|
56
|
+
return o.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
57
57
|
}
|
|
58
|
-
class
|
|
59
|
-
constructor(c,
|
|
60
|
-
this.tokens = c, this.originalPath =
|
|
58
|
+
class T {
|
|
59
|
+
constructor(c, h) {
|
|
60
|
+
this.tokens = c, this.originalPath = h;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
j.TokenData = T;
|
|
64
64
|
class E extends TypeError {
|
|
65
|
-
constructor(c,
|
|
66
|
-
let
|
|
67
|
-
|
|
65
|
+
constructor(c, h) {
|
|
66
|
+
let d = c;
|
|
67
|
+
h && (d += `: ${h}`), d += "; visit https://git.new/pathToRegexpError for info", super(d), this.originalPath = h;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
function
|
|
72
|
-
const { encodePath:
|
|
70
|
+
j.PathError = E;
|
|
71
|
+
function m(o, c = {}) {
|
|
72
|
+
const { encodePath: h = e } = c, d = [...o];
|
|
73
73
|
let l = 0;
|
|
74
|
-
function g(
|
|
74
|
+
function g(p) {
|
|
75
75
|
const P = [];
|
|
76
76
|
let w = "";
|
|
77
|
-
function
|
|
77
|
+
function I() {
|
|
78
78
|
w && (P.push({
|
|
79
79
|
type: "text",
|
|
80
|
-
value:
|
|
80
|
+
value: h(w)
|
|
81
81
|
}), w = "");
|
|
82
82
|
}
|
|
83
|
-
for (; l <
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
return
|
|
87
|
-
if (
|
|
88
|
-
if (l ===
|
|
89
|
-
throw new E(`Unexpected end after \\ at index ${l}`,
|
|
90
|
-
w +=
|
|
83
|
+
for (; l < d.length; ) {
|
|
84
|
+
const b = d[l++];
|
|
85
|
+
if (b === p)
|
|
86
|
+
return I(), P;
|
|
87
|
+
if (b === "\\") {
|
|
88
|
+
if (l === d.length)
|
|
89
|
+
throw new E(`Unexpected end after \\ at index ${l}`, o);
|
|
90
|
+
w += d[l++];
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
93
|
+
if (b === ":" || b === "*") {
|
|
94
|
+
const U = b === ":" ? "param" : "wildcard";
|
|
95
95
|
let S = "";
|
|
96
|
-
if (
|
|
96
|
+
if (r.test(d[l]))
|
|
97
97
|
do
|
|
98
|
-
S +=
|
|
99
|
-
while (
|
|
100
|
-
else if (
|
|
101
|
-
let
|
|
102
|
-
for (; l <
|
|
103
|
-
if (
|
|
104
|
-
l++,
|
|
98
|
+
S += d[l++];
|
|
99
|
+
while (a.test(d[l]));
|
|
100
|
+
else if (d[l] === '"') {
|
|
101
|
+
let H = l;
|
|
102
|
+
for (; l < d.length; ) {
|
|
103
|
+
if (d[++l] === '"') {
|
|
104
|
+
l++, H = 0;
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
d[l] === "\\" && l++, S += d[l];
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
throw new E(`Unterminated quote at index ${
|
|
109
|
+
if (H)
|
|
110
|
+
throw new E(`Unterminated quote at index ${H}`, o);
|
|
111
111
|
}
|
|
112
112
|
if (!S)
|
|
113
|
-
throw new E(`Missing parameter name at index ${l}`,
|
|
114
|
-
|
|
113
|
+
throw new E(`Missing parameter name at index ${l}`, o);
|
|
114
|
+
I(), P.push({ type: U, name: S });
|
|
115
115
|
continue;
|
|
116
116
|
}
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (b === "{") {
|
|
118
|
+
I(), P.push({
|
|
119
119
|
type: "group",
|
|
120
120
|
tokens: g("}")
|
|
121
121
|
});
|
|
122
122
|
continue;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
throw new E(`Unexpected ${
|
|
126
|
-
w +=
|
|
124
|
+
if (b === "}" || b === "(" || b === ")" || b === "[" || b === "]" || b === "+" || b === "?" || b === "!")
|
|
125
|
+
throw new E(`Unexpected ${b} at index ${l - 1}`, o);
|
|
126
|
+
w += b;
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
129
|
-
throw new E(`Unexpected end at index ${l}, expected ${
|
|
130
|
-
return
|
|
128
|
+
if (p)
|
|
129
|
+
throw new E(`Unexpected end at index ${l}, expected ${p}`, o);
|
|
130
|
+
return I(), P;
|
|
131
131
|
}
|
|
132
|
-
return new
|
|
132
|
+
return new T(g(""), o);
|
|
133
133
|
}
|
|
134
|
-
function x(
|
|
135
|
-
const { encode:
|
|
134
|
+
function x(o, c = {}) {
|
|
135
|
+
const { encode: h = encodeURIComponent, delimiter: d = n } = c, l = typeof o == "object" ? o : m(o, c), g = y(l.tokens, d, h);
|
|
136
136
|
return function(P = {}) {
|
|
137
|
-
const w = [],
|
|
137
|
+
const w = [], I = g(P, w);
|
|
138
138
|
if (w.length)
|
|
139
139
|
throw new TypeError(`Missing parameters: ${w.join(", ")}`);
|
|
140
|
-
return
|
|
140
|
+
return I;
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
const
|
|
143
|
+
function y(o, c, h) {
|
|
144
|
+
const d = o.map((l) => R(l, c, h));
|
|
145
145
|
return (l, g) => {
|
|
146
|
-
let
|
|
147
|
-
for (const P of
|
|
148
|
-
|
|
149
|
-
return
|
|
146
|
+
let p = "";
|
|
147
|
+
for (const P of d)
|
|
148
|
+
p += P(l, g);
|
|
149
|
+
return p;
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function R(
|
|
153
|
-
if (
|
|
154
|
-
return () =>
|
|
155
|
-
if (
|
|
156
|
-
const l =
|
|
157
|
-
return (g,
|
|
158
|
-
const P =
|
|
159
|
-
return
|
|
152
|
+
function R(o, c, h) {
|
|
153
|
+
if (o.type === "text")
|
|
154
|
+
return () => o.value;
|
|
155
|
+
if (o.type === "group") {
|
|
156
|
+
const l = y(o.tokens, c, h);
|
|
157
|
+
return (g, p) => {
|
|
158
|
+
const P = p.length, w = l(g, p);
|
|
159
|
+
return p.length === P ? w : (p.length = P, "");
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
const
|
|
163
|
-
return
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
return g.push(
|
|
167
|
-
if (!Array.isArray(
|
|
168
|
-
throw new TypeError(`Expected "${
|
|
162
|
+
const d = h || e;
|
|
163
|
+
return o.type === "wildcard" && h !== !1 ? (l, g) => {
|
|
164
|
+
const p = l[o.name];
|
|
165
|
+
if (p == null)
|
|
166
|
+
return g.push(o.name), "";
|
|
167
|
+
if (!Array.isArray(p) || p.length === 0)
|
|
168
|
+
throw new TypeError(`Expected "${o.name}" to be a non-empty array`);
|
|
169
169
|
let P = "";
|
|
170
|
-
for (let w = 0; w <
|
|
171
|
-
if (typeof
|
|
172
|
-
throw new TypeError(`Expected "${
|
|
173
|
-
w > 0 && (P += c), P += p
|
|
170
|
+
for (let w = 0; w < p.length; w++) {
|
|
171
|
+
if (typeof p[w] != "string")
|
|
172
|
+
throw new TypeError(`Expected "${o.name}/${w}" to be a string`);
|
|
173
|
+
w > 0 && (P += c), P += d(p[w]);
|
|
174
174
|
}
|
|
175
175
|
return P;
|
|
176
176
|
} : (l, g) => {
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
return g.push(
|
|
180
|
-
if (typeof
|
|
181
|
-
throw new TypeError(`Expected "${
|
|
182
|
-
return p
|
|
177
|
+
const p = l[o.name];
|
|
178
|
+
if (p == null)
|
|
179
|
+
return g.push(o.name), "";
|
|
180
|
+
if (typeof p != "string")
|
|
181
|
+
throw new TypeError(`Expected "${o.name}" to be a string`);
|
|
182
|
+
return d(p);
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function $(
|
|
186
|
-
const { decode:
|
|
185
|
+
function $(o, c = {}) {
|
|
186
|
+
const { decode: h = decodeURIComponent, delimiter: d = n } = c, { regexp: l, keys: g } = C(o, c), p = g.map((P) => h === !1 ? e : P.type === "param" ? h : (w) => w.split(d).map(h));
|
|
187
187
|
return function(w) {
|
|
188
|
-
const
|
|
189
|
-
if (!
|
|
188
|
+
const I = l.exec(w);
|
|
189
|
+
if (!I)
|
|
190
190
|
return !1;
|
|
191
|
-
const
|
|
192
|
-
for (let S = 1; S <
|
|
193
|
-
if (
|
|
191
|
+
const b = I[0], U = /* @__PURE__ */ Object.create(null);
|
|
192
|
+
for (let S = 1; S < I.length; S++) {
|
|
193
|
+
if (I[S] === void 0)
|
|
194
194
|
continue;
|
|
195
|
-
const
|
|
196
|
-
|
|
195
|
+
const H = g[S - 1], _ = p[S - 1];
|
|
196
|
+
U[H.name] = _(I[S]);
|
|
197
197
|
}
|
|
198
|
-
return { path:
|
|
198
|
+
return { path: b, params: U };
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
|
-
function C(
|
|
202
|
-
const { delimiter:
|
|
201
|
+
function C(o, c = {}) {
|
|
202
|
+
const { delimiter: h = n, end: d = !0, sensitive: l = !1, trailing: g = !0 } = c, p = [];
|
|
203
203
|
let P = "", w = 0;
|
|
204
|
-
function
|
|
205
|
-
if (Array.isArray(
|
|
206
|
-
for (const
|
|
207
|
-
|
|
204
|
+
function I(U) {
|
|
205
|
+
if (Array.isArray(U)) {
|
|
206
|
+
for (const H of U)
|
|
207
|
+
I(H);
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
|
-
const S = typeof
|
|
211
|
-
|
|
210
|
+
const S = typeof U == "object" ? U : m(U, c);
|
|
211
|
+
D(S.tokens, 0, [], (H) => {
|
|
212
212
|
if (w >= 256)
|
|
213
213
|
throw new E("Too many path combinations", S.originalPath);
|
|
214
|
-
w > 0 && (P += "|"), P +=
|
|
214
|
+
w > 0 && (P += "|"), P += F(H, h, p, S.originalPath), w++;
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
let
|
|
219
|
-
return g && (
|
|
217
|
+
I(o);
|
|
218
|
+
let b = `^(?:${P})`;
|
|
219
|
+
return g && (b += "(?:" + s(h) + "$)?"), b += d ? "$" : "(?=" + s(h) + "|$)", { regexp: new RegExp(b, l ? "" : "i"), keys: p };
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
for (; c <
|
|
223
|
-
const l =
|
|
221
|
+
function D(o, c, h, d) {
|
|
222
|
+
for (; c < o.length; ) {
|
|
223
|
+
const l = o[c++];
|
|
224
224
|
if (l.type === "group") {
|
|
225
|
-
const g =
|
|
226
|
-
|
|
225
|
+
const g = h.length;
|
|
226
|
+
D(l.tokens, 0, h, (p) => D(o, c, p, d)), h.length = g;
|
|
227
227
|
continue;
|
|
228
228
|
}
|
|
229
|
-
|
|
229
|
+
h.push(l);
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
d(h);
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
let l = "", g = "",
|
|
235
|
-
function
|
|
236
|
-
for (; S <
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
233
|
+
function F(o, c, h, d) {
|
|
234
|
+
let l = "", g = "", p = "", P = 0, w = 0, I = 0;
|
|
235
|
+
function b(S, H) {
|
|
236
|
+
for (; S < o.length; ) {
|
|
237
|
+
const _ = o[S++];
|
|
238
|
+
if (_.type === H)
|
|
239
239
|
return !0;
|
|
240
|
-
if (
|
|
240
|
+
if (_.type === "text" && _.value.includes(c))
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
243
|
return !1;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
let
|
|
247
|
-
for (; S <
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
245
|
+
function U(S) {
|
|
246
|
+
let H = "";
|
|
247
|
+
for (; S < o.length; ) {
|
|
248
|
+
const _ = o[S++];
|
|
249
|
+
if (_.type !== "text")
|
|
250
250
|
break;
|
|
251
|
-
|
|
251
|
+
H += _.value;
|
|
252
252
|
}
|
|
253
|
-
return
|
|
253
|
+
return H;
|
|
254
254
|
}
|
|
255
|
-
for (;
|
|
256
|
-
const S =
|
|
255
|
+
for (; I < o.length; ) {
|
|
256
|
+
const S = o[I++];
|
|
257
257
|
if (S.type === "text") {
|
|
258
|
-
l +=
|
|
258
|
+
l += s(S.value), g += S.value, P === 2 && (p += S.value), S.value.includes(c) && (w = 0);
|
|
259
259
|
continue;
|
|
260
260
|
}
|
|
261
261
|
if (S.type === "param" || S.type === "wildcard") {
|
|
262
262
|
if (P && !g)
|
|
263
|
-
throw new E(`Missing text before "${S.name}" ${S.type}`,
|
|
264
|
-
S.type === "param" ? (l += w & 2 ? `(${
|
|
263
|
+
throw new E(`Missing text before "${S.name}" ${S.type}`, d);
|
|
264
|
+
S.type === "param" ? (l += w & 2 ? `(${M(c, g)}+)` : b(I, "wildcard") ? `(${M(c, U(I))}+)` : w & 1 ? `(${M(c, g)}+|${s(g)})` : `(${M(c, "")}+)`, w |= P = 1) : (l += w & 2 ? `(${M(g, "")}+)` : p ? `(${M(p, "")}+|${M(c, "")}+)` : "([^]+)", p = "", w |= P = 2), h.push(S), g = "";
|
|
265
265
|
continue;
|
|
266
266
|
}
|
|
267
267
|
throw new TypeError(`Unknown token type: ${S.type}`);
|
|
268
268
|
}
|
|
269
269
|
return l;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
return c.length >
|
|
271
|
+
function M(o, c) {
|
|
272
|
+
return c.length > o.length ? M(c, o) : (o === c && (c = ""), c.length > 1 ? `(?:(?!${s(o)}|${s(c)})[^])` : o.length > 1 ? `(?:(?!${s(o)})[^${s(c)}])` : `[^${s(o + c)}]`);
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
let
|
|
276
|
-
for (; c <
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
279
|
-
|
|
274
|
+
function Y(o, c) {
|
|
275
|
+
let h = "";
|
|
276
|
+
for (; c < o.length; ) {
|
|
277
|
+
const d = o[c++];
|
|
278
|
+
if (d.type === "text") {
|
|
279
|
+
h += i(d.value);
|
|
280
280
|
continue;
|
|
281
281
|
}
|
|
282
|
-
if (
|
|
283
|
-
|
|
282
|
+
if (d.type === "group") {
|
|
283
|
+
h += "{" + Y(d.tokens, 0) + "}";
|
|
284
284
|
continue;
|
|
285
285
|
}
|
|
286
|
-
if (
|
|
287
|
-
|
|
286
|
+
if (d.type === "param") {
|
|
287
|
+
h += ":" + B(d.name, o[c]);
|
|
288
288
|
continue;
|
|
289
289
|
}
|
|
290
|
-
if (
|
|
291
|
-
|
|
290
|
+
if (d.type === "wildcard") {
|
|
291
|
+
h += "*" + B(d.name, o[c]);
|
|
292
292
|
continue;
|
|
293
293
|
}
|
|
294
|
-
throw new TypeError(`Unknown token type: ${
|
|
294
|
+
throw new TypeError(`Unknown token type: ${d.type}`);
|
|
295
295
|
}
|
|
296
|
-
return
|
|
296
|
+
return h;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
return
|
|
298
|
+
function ht(o) {
|
|
299
|
+
return Y(o.tokens, 0);
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
return !u.test(
|
|
301
|
+
function B(o, c) {
|
|
302
|
+
return !u.test(o) || c?.type === "text" && a.test(c.value[0]) ? JSON.stringify(o) : o;
|
|
303
303
|
}
|
|
304
|
-
return
|
|
304
|
+
return j;
|
|
305
305
|
}
|
|
306
|
-
var
|
|
307
|
-
const
|
|
306
|
+
var Bt = Re();
|
|
307
|
+
const ne = Gt({
|
|
308
308
|
id: "",
|
|
309
309
|
isActive: !1,
|
|
310
310
|
isRoot: !0,
|
|
@@ -317,160 +317,160 @@ const re = Gt({
|
|
|
317
317
|
layoutId: null,
|
|
318
318
|
routePath: ""
|
|
319
319
|
});
|
|
320
|
-
function
|
|
321
|
-
return
|
|
320
|
+
function mt() {
|
|
321
|
+
return Yt(ne);
|
|
322
322
|
}
|
|
323
|
-
const
|
|
323
|
+
const re = Gt({}), oe = Gt(() => {
|
|
324
324
|
});
|
|
325
|
-
function
|
|
325
|
+
function De(n, e) {
|
|
326
326
|
return e.type === "SET" ? e.params : n;
|
|
327
327
|
}
|
|
328
328
|
function Le({ children: n }) {
|
|
329
|
-
const { isActive: e, params:
|
|
330
|
-
return
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
u({ type: "SET", params:
|
|
329
|
+
const { isActive: e, params: r } = mt(), [a, u] = me(De, r);
|
|
330
|
+
return lt(() => {
|
|
331
|
+
const i = async (s) => {
|
|
332
|
+
s.state?.step && await G.addTask(async () => {
|
|
333
|
+
u({ type: "SET", params: s.state?.params || {} });
|
|
334
334
|
});
|
|
335
335
|
};
|
|
336
|
-
return e && window.addEventListener("popstate",
|
|
337
|
-
window.removeEventListener("popstate",
|
|
336
|
+
return e && window.addEventListener("popstate", i), () => {
|
|
337
|
+
window.removeEventListener("popstate", i);
|
|
338
338
|
};
|
|
339
|
-
}, [e, u]), /* @__PURE__ */
|
|
339
|
+
}, [e, u]), /* @__PURE__ */ N(oe.Provider, { value: u, children: /* @__PURE__ */ N(re.Provider, { value: a, children: n }) });
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const e =
|
|
343
|
-
return
|
|
344
|
-
(
|
|
345
|
-
(u) =>
|
|
346
|
-
|
|
341
|
+
function Ne({ children: n }) {
|
|
342
|
+
const e = O((a) => a.index), r = O((a) => a.histories);
|
|
343
|
+
return r.map(
|
|
344
|
+
(a) => te.toArray(n).filter(
|
|
345
|
+
(u) => Bt.pathToRegexp(u.props.path).regexp.test(
|
|
346
|
+
a.pathname
|
|
347
347
|
)
|
|
348
348
|
)
|
|
349
|
-
).map(([
|
|
350
|
-
|
|
349
|
+
).map(([a], u) => /* @__PURE__ */ N(
|
|
350
|
+
ne.Provider,
|
|
351
351
|
{
|
|
352
352
|
value: {
|
|
353
|
-
id:
|
|
353
|
+
id: r[u].id,
|
|
354
354
|
isActive: u === e,
|
|
355
355
|
isRoot: u === 0,
|
|
356
356
|
isPrev: u < e - 1,
|
|
357
357
|
zIndex: u,
|
|
358
|
-
pathname:
|
|
359
|
-
params:
|
|
360
|
-
transitionName:
|
|
361
|
-
prevTransitionName:
|
|
362
|
-
layoutId:
|
|
358
|
+
pathname: r[u].pathname,
|
|
359
|
+
params: r[u].params,
|
|
360
|
+
transitionName: r[e].transitionName,
|
|
361
|
+
prevTransitionName: r[e - 1]?.transitionName,
|
|
362
|
+
layoutId: r[u].layoutId,
|
|
363
363
|
routePath: we(
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
a.props.path,
|
|
365
|
+
r[u].pathname
|
|
366
366
|
)
|
|
367
367
|
},
|
|
368
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ N(Le, { children: a })
|
|
369
369
|
},
|
|
370
|
-
|
|
370
|
+
r[u].id
|
|
371
371
|
));
|
|
372
372
|
}
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
375
|
-
const n = Se(
|
|
376
|
-
let e = document.head.querySelector(`style[${
|
|
377
|
-
e || (e = document.createElement("style"), e.setAttribute(
|
|
373
|
+
const Kt = "data-flemo", Wt = () => {
|
|
374
|
+
if (Mt()) return;
|
|
375
|
+
const n = Se(it.values(), ft.values());
|
|
376
|
+
let e = document.head.querySelector(`style[${Kt}]`);
|
|
377
|
+
e || (e = document.createElement("style"), e.setAttribute(Kt, ""), document.head.appendChild(e)), e.textContent !== n && (e.textContent = n);
|
|
378
378
|
};
|
|
379
|
-
function
|
|
380
|
-
|
|
381
|
-
for (const
|
|
382
|
-
for (const
|
|
383
|
-
return
|
|
384
|
-
for (const
|
|
385
|
-
for (const
|
|
386
|
-
|
|
379
|
+
function $e(n, e) {
|
|
380
|
+
he(() => {
|
|
381
|
+
for (const r of n) it.set(r.name, r);
|
|
382
|
+
for (const r of e) ft.set(r.name, r);
|
|
383
|
+
return Wt(), () => {
|
|
384
|
+
for (const r of n) it.delete(r.name);
|
|
385
|
+
for (const r of e) ft.delete(r.name);
|
|
386
|
+
Wt();
|
|
387
387
|
};
|
|
388
388
|
}, [n, e]);
|
|
389
389
|
}
|
|
390
|
-
const
|
|
391
|
-
function
|
|
390
|
+
const Ae = [], ke = [];
|
|
391
|
+
function Fe({
|
|
392
392
|
children: n,
|
|
393
393
|
initPath: e = "/",
|
|
394
|
-
defaultTransitionName:
|
|
395
|
-
transitions:
|
|
394
|
+
defaultTransitionName: r = "cupertino",
|
|
395
|
+
transitions: a = Ae,
|
|
396
396
|
decorators: u = ke
|
|
397
397
|
}) {
|
|
398
|
-
const
|
|
398
|
+
const i = Mt() ? e || "/" : window.location.pathname, s = Mt() ? i.split("?")[1] || "" : window.location.search;
|
|
399
399
|
return Ot.setState({
|
|
400
|
-
defaultTransitionName:
|
|
401
|
-
}),
|
|
400
|
+
defaultTransitionName: r
|
|
401
|
+
}), O.setState({
|
|
402
402
|
index: 0,
|
|
403
403
|
histories: [
|
|
404
404
|
{
|
|
405
405
|
id: "root",
|
|
406
|
-
pathname:
|
|
406
|
+
pathname: i,
|
|
407
407
|
params: ve(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
te.toArray(n).map((T) => T.props.path).flat(),
|
|
409
|
+
i,
|
|
410
|
+
s
|
|
411
411
|
),
|
|
412
|
-
transitionName:
|
|
412
|
+
transitionName: r,
|
|
413
413
|
layoutId: null
|
|
414
414
|
}
|
|
415
415
|
]
|
|
416
|
-
}),
|
|
416
|
+
}), $e(a, u), lt(() => {
|
|
417
417
|
window.history.state?.index || window.history.replaceState(
|
|
418
418
|
{
|
|
419
419
|
id: "root",
|
|
420
420
|
index: 0,
|
|
421
421
|
status: "IDLE",
|
|
422
422
|
params: {},
|
|
423
|
-
transitionName:
|
|
423
|
+
transitionName: r,
|
|
424
424
|
layoutId: null
|
|
425
425
|
},
|
|
426
426
|
"",
|
|
427
427
|
window.location.href
|
|
428
428
|
);
|
|
429
|
-
}, [
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
429
|
+
}, [r]), /* @__PURE__ */ Ht(fe, { children: [
|
|
430
|
+
/* @__PURE__ */ N(Ie, {}),
|
|
431
|
+
/* @__PURE__ */ N(Ne, { children: n })
|
|
432
432
|
] });
|
|
433
433
|
}
|
|
434
434
|
function qe({ element: n }) {
|
|
435
435
|
return n;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
const
|
|
439
|
-
Object.entries(
|
|
440
|
-
),
|
|
441
|
-
Object.entries(
|
|
442
|
-
),
|
|
443
|
-
return { pathname: `${
|
|
437
|
+
function It(n, e) {
|
|
438
|
+
const r = e ?? {}, a = Bt.compile(n), u = Object.fromEntries(
|
|
439
|
+
Object.entries(r).map(([y, R]) => [y, String(R)])
|
|
440
|
+
), i = a(u), T = (typeof n == "string" ? Bt.parse(n) : n).tokens.filter((y) => y.type === "param").map((y) => y.name), E = Object.fromEntries(
|
|
441
|
+
Object.entries(r).filter(([y]) => !T.includes(y))
|
|
442
|
+
), m = new URLSearchParams(E).toString();
|
|
443
|
+
return { pathname: `${i}${m ? `?${m}` : ""}`, toPathname: i };
|
|
444
444
|
}
|
|
445
445
|
function ze() {
|
|
446
446
|
return {
|
|
447
|
-
push: async (
|
|
448
|
-
const { status:
|
|
449
|
-
if (
|
|
447
|
+
push: async (a, u, i) => {
|
|
448
|
+
const { status: s } = K.getState();
|
|
449
|
+
if (s !== "COMPLETED" && s !== "IDLE")
|
|
450
450
|
return;
|
|
451
|
-
const { index:
|
|
451
|
+
const { index: T, addHistory: E } = O.getState(), m = Ot.getState().defaultTransitionName, { transitionName: x = m, layoutId: y = null } = i ?? {}, R = G.generateTaskId();
|
|
452
452
|
(await G.addTask(
|
|
453
453
|
async () => {
|
|
454
|
-
const { setStatus: $, setTransitionTaskId: C } =
|
|
454
|
+
const { setStatus: $, setTransitionTaskId: C } = K.getState();
|
|
455
455
|
$("PUSHING"), C(R);
|
|
456
|
-
const { pathname:
|
|
456
|
+
const { pathname: D, toPathname: F } = It(a, u ?? {});
|
|
457
457
|
return window.history.pushState(
|
|
458
458
|
{
|
|
459
459
|
id: R,
|
|
460
|
-
index:
|
|
460
|
+
index: T + 1,
|
|
461
461
|
status: "PUSHING",
|
|
462
462
|
params: u,
|
|
463
463
|
transitionName: x,
|
|
464
|
-
layoutId:
|
|
464
|
+
layoutId: y
|
|
465
465
|
},
|
|
466
466
|
"",
|
|
467
|
-
|
|
467
|
+
D
|
|
468
468
|
), E({
|
|
469
469
|
id: R,
|
|
470
|
-
pathname:
|
|
470
|
+
pathname: F,
|
|
471
471
|
params: u ?? {},
|
|
472
472
|
transitionName: x,
|
|
473
|
-
layoutId:
|
|
473
|
+
layoutId: y
|
|
474
474
|
}), () => {
|
|
475
475
|
$("COMPLETED");
|
|
476
476
|
};
|
|
@@ -483,35 +483,35 @@ function ze() {
|
|
|
483
483
|
}
|
|
484
484
|
)).result?.();
|
|
485
485
|
},
|
|
486
|
-
replace: async (
|
|
487
|
-
const { status:
|
|
488
|
-
if (
|
|
486
|
+
replace: async (a, u, i) => {
|
|
487
|
+
const { status: s } = K.getState();
|
|
488
|
+
if (s !== "COMPLETED" && s !== "IDLE")
|
|
489
489
|
return;
|
|
490
|
-
const { index:
|
|
490
|
+
const { index: T, addHistory: E } = O.getState(), m = O.getState().replaceHistory, x = Ot.getState().defaultTransitionName, { transitionName: y = x, layoutId: R = null } = i ?? {}, $ = G.generateTaskId();
|
|
491
491
|
(await G.addTask(
|
|
492
492
|
async () => {
|
|
493
|
-
const { setStatus: C, setTransitionTaskId:
|
|
494
|
-
C("REPLACING"),
|
|
495
|
-
const { pathname:
|
|
493
|
+
const { setStatus: C, setTransitionTaskId: D } = K.getState();
|
|
494
|
+
C("REPLACING"), D($);
|
|
495
|
+
const { pathname: F, toPathname: M } = It(a, u ?? {});
|
|
496
496
|
return window.history.replaceState(
|
|
497
497
|
{
|
|
498
498
|
id: $,
|
|
499
|
-
index:
|
|
499
|
+
index: T,
|
|
500
500
|
status: "REPLACING",
|
|
501
501
|
params: u,
|
|
502
|
-
transitionName:
|
|
502
|
+
transitionName: y,
|
|
503
503
|
layoutId: R
|
|
504
504
|
},
|
|
505
505
|
"",
|
|
506
|
-
|
|
506
|
+
F
|
|
507
507
|
), E({
|
|
508
508
|
id: $,
|
|
509
|
-
pathname:
|
|
509
|
+
pathname: M,
|
|
510
510
|
params: u ?? {},
|
|
511
|
-
transitionName:
|
|
511
|
+
transitionName: y,
|
|
512
512
|
layoutId: R
|
|
513
513
|
}), async () => {
|
|
514
|
-
|
|
514
|
+
m(T), C("COMPLETED");
|
|
515
515
|
};
|
|
516
516
|
},
|
|
517
517
|
{
|
|
@@ -523,21 +523,21 @@ function ze() {
|
|
|
523
523
|
)).result?.();
|
|
524
524
|
},
|
|
525
525
|
pop: async () => {
|
|
526
|
-
const
|
|
526
|
+
const a = G.generateTaskId();
|
|
527
527
|
(await G.addTask(
|
|
528
528
|
async (u) => {
|
|
529
|
-
const { index:
|
|
530
|
-
if (
|
|
529
|
+
const { index: i, popHistory: s } = O.getState();
|
|
530
|
+
if (i <= 0) {
|
|
531
531
|
u.abort();
|
|
532
532
|
return;
|
|
533
533
|
}
|
|
534
|
-
const { setStatus:
|
|
535
|
-
return
|
|
536
|
-
|
|
534
|
+
const { setStatus: T, setTransitionTaskId: E } = K.getState();
|
|
535
|
+
return T("POPPING"), E(a), ee(), window.history.back(), async () => {
|
|
536
|
+
s(i), T("COMPLETED");
|
|
537
537
|
};
|
|
538
538
|
},
|
|
539
539
|
{
|
|
540
|
-
id:
|
|
540
|
+
id: a,
|
|
541
541
|
control: {
|
|
542
542
|
manual: !0
|
|
543
543
|
}
|
|
@@ -547,11 +547,11 @@ function ze() {
|
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
549
|
function Ke() {
|
|
550
|
-
const { routePath: n } =
|
|
550
|
+
const { routePath: n } = mt(), e = Yt(oe);
|
|
551
551
|
return {
|
|
552
|
-
pushStep: async (
|
|
552
|
+
pushStep: async (i) => {
|
|
553
553
|
(await G.addTask(async () => {
|
|
554
|
-
const { pathname:
|
|
554
|
+
const { pathname: s } = It(n, i);
|
|
555
555
|
return window.history.state?.step || window.history.replaceState(
|
|
556
556
|
{
|
|
557
557
|
...window.history.state,
|
|
@@ -563,60 +563,60 @@ function Ke() {
|
|
|
563
563
|
{
|
|
564
564
|
...window.history.state,
|
|
565
565
|
step: !0,
|
|
566
|
-
params:
|
|
566
|
+
params: i
|
|
567
567
|
},
|
|
568
568
|
"",
|
|
569
|
-
|
|
570
|
-
), async () => e({ type: "SET", params:
|
|
569
|
+
s
|
|
570
|
+
), async () => e({ type: "SET", params: i });
|
|
571
571
|
})).result?.();
|
|
572
572
|
},
|
|
573
|
-
replaceStep: async (
|
|
573
|
+
replaceStep: async (i) => {
|
|
574
574
|
(await G.addTask(async () => {
|
|
575
|
-
const { pathname:
|
|
575
|
+
const { pathname: s } = It(n, i);
|
|
576
576
|
return window.history.replaceState(
|
|
577
577
|
{
|
|
578
578
|
...window.history.state,
|
|
579
579
|
step: !0,
|
|
580
|
-
params:
|
|
580
|
+
params: i
|
|
581
581
|
},
|
|
582
582
|
"",
|
|
583
|
-
|
|
584
|
-
), async () => e({ type: "SET", params:
|
|
583
|
+
s
|
|
584
|
+
), async () => e({ type: "SET", params: i });
|
|
585
585
|
})).result?.();
|
|
586
586
|
},
|
|
587
587
|
popStep: async () => {
|
|
588
|
-
const
|
|
588
|
+
const i = G.generateTaskId();
|
|
589
589
|
(await G.addTask(
|
|
590
|
-
async (
|
|
591
|
-
const
|
|
590
|
+
async (s) => {
|
|
591
|
+
const T = new Promise((C) => {
|
|
592
592
|
window.addEventListener(
|
|
593
593
|
"popstate",
|
|
594
|
-
(
|
|
594
|
+
(D) => C(D.state),
|
|
595
595
|
{ once: !0 }
|
|
596
596
|
);
|
|
597
597
|
}), E = new Promise(
|
|
598
598
|
(C) => setTimeout(() => C(void 0), 200)
|
|
599
599
|
);
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
|
|
600
|
+
ee(), window.history.back();
|
|
601
|
+
const m = await Promise.race([
|
|
602
|
+
T,
|
|
603
603
|
E
|
|
604
604
|
]);
|
|
605
|
-
if (!
|
|
606
|
-
|
|
605
|
+
if (!m) {
|
|
606
|
+
s.abort();
|
|
607
607
|
return;
|
|
608
608
|
}
|
|
609
|
-
if (
|
|
610
|
-
e({ type: "SET", params:
|
|
609
|
+
if (m.step) {
|
|
610
|
+
e({ type: "SET", params: m.params ?? {} }), s.abort();
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
|
-
const { setStatus: x, setTransitionTaskId:
|
|
614
|
-
return x("POPPING"),
|
|
613
|
+
const { setStatus: x, setTransitionTaskId: y } = K.getState(), { index: R, popHistory: $ } = O.getState();
|
|
614
|
+
return x("POPPING"), y(i), async () => {
|
|
615
615
|
$(R), x("COMPLETED");
|
|
616
616
|
};
|
|
617
617
|
},
|
|
618
618
|
{
|
|
619
|
-
id:
|
|
619
|
+
id: i,
|
|
620
620
|
control: {
|
|
621
621
|
manual: !0
|
|
622
622
|
}
|
|
@@ -626,32 +626,32 @@ function Ke() {
|
|
|
626
626
|
};
|
|
627
627
|
}
|
|
628
628
|
function We() {
|
|
629
|
-
return
|
|
629
|
+
return Yt(re);
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
const
|
|
633
|
-
return n || (
|
|
631
|
+
function Ce({ freeze: n, children: e }) {
|
|
632
|
+
const r = L(e);
|
|
633
|
+
return n || (r.current = e), /* @__PURE__ */ N(
|
|
634
634
|
"div",
|
|
635
635
|
{
|
|
636
636
|
style: {
|
|
637
637
|
display: n ? "none" : void 0
|
|
638
638
|
},
|
|
639
|
-
children:
|
|
639
|
+
children: r.current
|
|
640
640
|
}
|
|
641
641
|
);
|
|
642
642
|
}
|
|
643
|
-
function He({ ref: n, style: e, ...
|
|
644
|
-
const { isActive:
|
|
645
|
-
|
|
646
|
-
const
|
|
647
|
-
return
|
|
643
|
+
function He({ ref: n, style: e, ...r }) {
|
|
644
|
+
const { isActive: a, transitionName: u } = mt(), i = L(null);
|
|
645
|
+
ye(n, () => i.current);
|
|
646
|
+
const s = K((x) => x.status), T = it.get(u) ?? it.get("none"), { decoratorName: E } = T, m = ft.get(E);
|
|
647
|
+
return m ? /* @__PURE__ */ N(
|
|
648
648
|
"div",
|
|
649
649
|
{
|
|
650
|
-
ref:
|
|
650
|
+
ref: i,
|
|
651
651
|
"data-flemo-decorator": !0,
|
|
652
|
-
"data-flemo-decorator-name":
|
|
653
|
-
"data-flemo-status":
|
|
654
|
-
"data-flemo-active":
|
|
652
|
+
"data-flemo-decorator-name": m.name,
|
|
653
|
+
"data-flemo-status": s,
|
|
654
|
+
"data-flemo-active": a ? "true" : "false",
|
|
655
655
|
style: {
|
|
656
656
|
position: "absolute",
|
|
657
657
|
top: 0,
|
|
@@ -662,332 +662,350 @@ function He({ ref: n, style: e, ...o }) {
|
|
|
662
662
|
zIndex: 1,
|
|
663
663
|
...e
|
|
664
664
|
},
|
|
665
|
-
...
|
|
665
|
+
...r
|
|
666
666
|
}
|
|
667
667
|
) : null;
|
|
668
668
|
}
|
|
669
|
-
const
|
|
669
|
+
const Jt = (n) => {
|
|
670
670
|
let e;
|
|
671
|
-
const
|
|
672
|
-
const
|
|
673
|
-
if (!Object.is(
|
|
671
|
+
const r = /* @__PURE__ */ new Set(), a = (m, x) => {
|
|
672
|
+
const y = typeof m == "function" ? m(e) : m;
|
|
673
|
+
if (!Object.is(y, e)) {
|
|
674
674
|
const R = e;
|
|
675
|
-
e = x ?? (typeof
|
|
675
|
+
e = x ?? (typeof y != "object" || y === null) ? y : Object.assign({}, e, y), r.forEach(($) => $(e, R));
|
|
676
676
|
}
|
|
677
|
-
}, u = () => e,
|
|
678
|
-
return
|
|
679
|
-
},
|
|
680
|
-
function
|
|
681
|
-
const
|
|
677
|
+
}, u = () => e, T = { setState: a, getState: u, getInitialState: () => E, subscribe: (m) => (r.add(m), () => r.delete(m)) }, E = e = n(a, u, T);
|
|
678
|
+
return T;
|
|
679
|
+
}, Me = ((n) => n ? Jt(n) : Jt), Oe = (n) => n;
|
|
680
|
+
function Be(n, e = Oe) {
|
|
681
|
+
const r = Pt.useSyncExternalStore(
|
|
682
682
|
n.subscribe,
|
|
683
|
-
|
|
684
|
-
|
|
683
|
+
Pt.useCallback(() => e(n.getState()), [n, e]),
|
|
684
|
+
Pt.useCallback(() => e(n.getInitialState()), [n, e])
|
|
685
685
|
);
|
|
686
|
-
return
|
|
686
|
+
return Pt.useDebugValue(r), r;
|
|
687
687
|
}
|
|
688
|
-
const
|
|
689
|
-
const e =
|
|
690
|
-
return Object.assign(
|
|
691
|
-
}, Ue = ((n) => n ?
|
|
688
|
+
const Qt = (n) => {
|
|
689
|
+
const e = Me(n), r = (a) => Be(e, a);
|
|
690
|
+
return Object.assign(r, e), r;
|
|
691
|
+
}, Ue = ((n) => n ? Qt(n) : Qt), Q = Ue((n) => ({
|
|
692
692
|
dragStatus: "IDLE",
|
|
693
693
|
replaceTransitionStatus: "IDLE",
|
|
694
694
|
sharedBars: {},
|
|
695
695
|
setDragStatus: (e) => n({ dragStatus: e }),
|
|
696
696
|
setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e }),
|
|
697
|
-
registerSharedBars: (e,
|
|
698
|
-
unregisterSharedBars: (e) => n((
|
|
699
|
-
const
|
|
700
|
-
return delete
|
|
697
|
+
registerSharedBars: (e, r) => n((a) => ({ sharedBars: { ...a.sharedBars, [e]: r } })),
|
|
698
|
+
unregisterSharedBars: (e) => n((r) => {
|
|
699
|
+
const a = { ...r.sharedBars };
|
|
700
|
+
return delete a[e], { sharedBars: a };
|
|
701
701
|
})
|
|
702
702
|
}));
|
|
703
703
|
let Ct = 0;
|
|
704
|
-
function
|
|
705
|
-
const [n, e] =
|
|
706
|
-
return
|
|
704
|
+
function Ge() {
|
|
705
|
+
const [n, e] = bt(0), [r, a] = bt(0);
|
|
706
|
+
return lt(() => {
|
|
707
707
|
let u = 0;
|
|
708
|
-
const
|
|
708
|
+
const i = () => {
|
|
709
709
|
cancelAnimationFrame(u), u = requestAnimationFrame(() => {
|
|
710
|
-
let
|
|
711
|
-
|
|
712
|
-
let
|
|
713
|
-
|
|
710
|
+
let s = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
711
|
+
s = s < 0 ? 0 : s;
|
|
712
|
+
let T = s - Ct;
|
|
713
|
+
T = T < 0 ? 0 : T, Ct || (Ct = s), a(T), e(s);
|
|
714
714
|
});
|
|
715
715
|
};
|
|
716
|
-
return window.visualViewport?.addEventListener("resize",
|
|
717
|
-
cancelAnimationFrame(u), window.visualViewport?.removeEventListener("resize",
|
|
716
|
+
return window.visualViewport?.addEventListener("resize", i), window.visualViewport?.addEventListener("scroll", i), () => {
|
|
717
|
+
cancelAnimationFrame(u), window.visualViewport?.removeEventListener("resize", i), window.visualViewport?.removeEventListener("scroll", i);
|
|
718
718
|
};
|
|
719
|
-
}, []), { viewportScrollHeight: n, changedViewportScrollHeight:
|
|
719
|
+
}, []), { viewportScrollHeight: n, changedViewportScrollHeight: r };
|
|
720
720
|
}
|
|
721
|
-
const Ye = (n) => typeof HTMLElement < "u" && n instanceof HTMLElement,
|
|
721
|
+
const Ye = (n) => typeof HTMLElement < "u" && n instanceof HTMLElement, Ut = /* @__PURE__ */ new WeakMap(), Zt = (n, e) => {
|
|
722
|
+
let r = Ut.get(n);
|
|
723
|
+
r || (r = /* @__PURE__ */ new Set(), Ut.set(n, r)), r.add(e);
|
|
724
|
+
}, J = (n, e) => {
|
|
722
725
|
n.style.transition = "";
|
|
723
|
-
|
|
724
|
-
|
|
726
|
+
const r = Ut.get(n);
|
|
727
|
+
if (r && r.size > 0) {
|
|
728
|
+
for (const a of r)
|
|
729
|
+
n.style.removeProperty(a);
|
|
730
|
+
r.clear();
|
|
725
731
|
return;
|
|
726
732
|
}
|
|
727
|
-
|
|
733
|
+
n.style.removeProperty("transform"), n.style.removeProperty("opacity");
|
|
734
|
+
}, ct = (n, e, r = {}) => {
|
|
728
735
|
if (!Ye(n)) return Promise.resolve();
|
|
729
|
-
const
|
|
736
|
+
const a = n, u = Te(e);
|
|
730
737
|
if (u.length === 0) return Promise.resolve();
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
733
|
-
|
|
734
|
-
for (const
|
|
738
|
+
const i = typeof r.duration == "number" ? r.duration : 0, s = typeof r.delay == "number" && r.delay > 0 ? r.delay : 0, T = Ee(r.ease);
|
|
739
|
+
if (i <= 0 && s <= 0) {
|
|
740
|
+
a.style.transition = "none";
|
|
741
|
+
for (const m of u)
|
|
742
|
+
a.style.setProperty(m.property, m.value), Zt(a, m.property);
|
|
735
743
|
return Promise.resolve();
|
|
736
744
|
}
|
|
737
|
-
const E = u.map((
|
|
738
|
-
|
|
739
|
-
for (const
|
|
740
|
-
|
|
745
|
+
const E = u.map((m) => `${m.property} ${i}s ${T} ${s}s`).join(", ");
|
|
746
|
+
a.style.transition = E, a.offsetWidth;
|
|
747
|
+
for (const m of u)
|
|
748
|
+
a.style.setProperty(m.property, m.value), Zt(a, m.property);
|
|
749
|
+
return new Promise((m) => {
|
|
741
750
|
let x = !1;
|
|
742
|
-
const
|
|
743
|
-
x || (x = !0,
|
|
751
|
+
const y = () => {
|
|
752
|
+
x || (x = !0, a.removeEventListener("transitionend", R), m());
|
|
744
753
|
}, R = ($) => {
|
|
745
|
-
$.target ===
|
|
754
|
+
$.target === a && y();
|
|
746
755
|
};
|
|
747
|
-
|
|
756
|
+
a.addEventListener("transitionend", R), setTimeout(y, (i + s) * 1e3 + 60);
|
|
748
757
|
});
|
|
749
|
-
},
|
|
750
|
-
function
|
|
758
|
+
}, ut = K, pt = "data-flemo-skip-animation";
|
|
759
|
+
function Ve({
|
|
751
760
|
children: n,
|
|
752
761
|
statusBarHeight: e,
|
|
753
|
-
statusBarColor:
|
|
754
|
-
systemNavigationBarHeight:
|
|
762
|
+
statusBarColor: r,
|
|
763
|
+
systemNavigationBarHeight: a,
|
|
755
764
|
systemNavigationBarColor: u,
|
|
756
|
-
sharedAppBar:
|
|
757
|
-
sharedNavigationBar:
|
|
758
|
-
appBar:
|
|
765
|
+
sharedAppBar: i,
|
|
766
|
+
sharedNavigationBar: s,
|
|
767
|
+
appBar: T,
|
|
759
768
|
navigationBar: E,
|
|
760
|
-
hideStatusBar:
|
|
769
|
+
hideStatusBar: m,
|
|
761
770
|
hideSystemNavigationBar: x,
|
|
762
|
-
backgroundColor:
|
|
771
|
+
backgroundColor: y = "white",
|
|
763
772
|
contentScrollable: R = !0,
|
|
764
773
|
...$
|
|
765
774
|
}) {
|
|
766
|
-
const { id: C, isActive:
|
|
775
|
+
const { id: C, isActive: D, isRoot: F, zIndex: M, transitionName: Y, prevTransitionName: ht } = mt(), B = ut((t) => t.status), o = Q((t) => t.dragStatus), c = Q.getState().setDragStatus, h = Q.getState().setReplaceTransitionStatus, d = O((t) => t.index), l = it.get(Y) ?? it.get("none"), { initial: g, swipeDirection: p, decoratorName: P } = l, w = ft.get(P), { viewportScrollHeight: I } = Ge(), b = I > 0, [U, S] = bt(0), [H, _] = bt(0), Vt = L(null), V = L(null), Z = L(null), q = L(null), st = L(null), W = L({
|
|
776
|
+
current: [],
|
|
777
|
+
prev: []
|
|
778
|
+
}), tt = L(!1), dt = L(!1), rt = L(!1), ae = L(0), Rt = L({ x: 0, y: 0 }), yt = L({ x: 0, y: 0 }), Dt = L(0), Lt = L({ x: 0, y: 0 }), et = L({
|
|
767
779
|
element: null,
|
|
768
780
|
hasMarker: !1
|
|
769
|
-
}),
|
|
770
|
-
const
|
|
781
|
+
}), ot = L({ element: null, hasMarker: !1 }), Nt = L(0), $t = L(0), gt = L(null), wt = L(null), At = (t) => {
|
|
782
|
+
const f = yt.current;
|
|
771
783
|
return {
|
|
772
784
|
point: { x: t.clientX, y: t.clientY },
|
|
773
785
|
offset: {
|
|
774
|
-
x: t.clientX -
|
|
775
|
-
y: t.clientY -
|
|
786
|
+
x: t.clientX - Rt.current.x,
|
|
787
|
+
y: t.clientY - Rt.current.y
|
|
776
788
|
},
|
|
777
|
-
delta: { x: t.clientX -
|
|
778
|
-
velocity:
|
|
789
|
+
delta: { x: t.clientX - f.x, y: t.clientY - f.y },
|
|
790
|
+
velocity: Lt.current
|
|
779
791
|
};
|
|
780
|
-
},
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
x: (t.clientX -
|
|
784
|
-
y: (t.clientY -
|
|
785
|
-
},
|
|
786
|
-
},
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
if (
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
792
|
+
}, ie = (t) => {
|
|
793
|
+
const f = t.timeStamp, v = Math.max(1, f - Dt.current), k = yt.current;
|
|
794
|
+
Lt.current = {
|
|
795
|
+
x: (t.clientX - k.x) / v * 1e3,
|
|
796
|
+
y: (t.clientY - k.y) / v * 1e3
|
|
797
|
+
}, yt.current = { x: t.clientX, y: t.clientY }, Dt.current = f;
|
|
798
|
+
}, kt = (t, f, v) => {
|
|
799
|
+
const k = ct(t, f, v);
|
|
800
|
+
if (t === V.current)
|
|
801
|
+
for (const A of W.current.current)
|
|
802
|
+
ct(A, f, v);
|
|
803
|
+
else if (t === Z.current)
|
|
804
|
+
for (const A of W.current.prev)
|
|
805
|
+
ct(A, f, v);
|
|
806
|
+
return k;
|
|
807
|
+
}, se = (t) => {
|
|
808
|
+
const f = D ? O.getState().histories[d - 1]?.id : O.getState().histories[d]?.id, v = f ? Q.getState().sharedBars[f] : void 0, k = [], A = gt.current, at = wt.current;
|
|
809
|
+
A && vt && !v?.appBar && k.push(A), at && Tt && !v?.navigationBar && k.push(at);
|
|
810
|
+
const X = [];
|
|
811
|
+
if (t) {
|
|
812
|
+
const nt = t.querySelector('[data-flemo-bar="app"]'), Ft = t.querySelector('[data-flemo-bar="nav"]');
|
|
813
|
+
nt && !vt && X.push(nt), Ft && !Tt && X.push(Ft);
|
|
814
|
+
}
|
|
815
|
+
W.current = { current: k, prev: X };
|
|
816
|
+
const Et = be(l).join(", ");
|
|
817
|
+
for (const nt of k) nt.style.willChange = Et;
|
|
818
|
+
for (const nt of X) nt.style.willChange = Et;
|
|
819
|
+
}, _t = () => {
|
|
820
|
+
for (const t of W.current.current)
|
|
821
|
+
J(t), t.style.removeProperty("will-change");
|
|
822
|
+
for (const t of W.current.prev)
|
|
823
|
+
J(t), t.style.removeProperty("will-change");
|
|
824
|
+
W.current = { current: [], prev: [] };
|
|
825
|
+
}, St = async (t) => {
|
|
826
|
+
if (!p || I > 10) return;
|
|
827
|
+
const f = V.current;
|
|
828
|
+
if (!f) return;
|
|
829
|
+
const v = Vt.current?.parentElement?.previousElementSibling;
|
|
830
|
+
if (Z.current = v?.querySelector("[data-flemo-screen]") ?? null, st.current = v?.querySelector("[data-flemo-decorator]") ?? null, !Z.current) return;
|
|
831
|
+
rt.current = !0, ae.current = t.timeStamp, Rt.current = { x: t.clientX, y: t.clientY }, yt.current = { x: t.clientX, y: t.clientY }, Dt.current = t.timeStamp, Lt.current = { x: 0, y: 0 }, f.setPointerCapture(t.pointerId), se(v), await l?.onSwipeStart(t, At(t), {
|
|
832
|
+
animate: kt,
|
|
833
|
+
currentScreen: f,
|
|
834
|
+
prevScreen: Z.current,
|
|
835
|
+
onStart: (A) => w?.onSwipeStart?.(A, {
|
|
836
|
+
animate: ct,
|
|
837
|
+
currentDecorator: q.current,
|
|
838
|
+
prevDecorator: st.current
|
|
800
839
|
})
|
|
801
|
-
}) ? c("PENDING") : (c("IDLE"),
|
|
840
|
+
}) ? c("PENDING") : (c("IDLE"), rt.current = !1, _t());
|
|
802
841
|
}, ce = (t) => {
|
|
803
|
-
!
|
|
804
|
-
animate:
|
|
805
|
-
currentScreen:
|
|
806
|
-
prevScreen:
|
|
807
|
-
onProgress: (
|
|
808
|
-
animate:
|
|
809
|
-
currentDecorator:
|
|
810
|
-
prevDecorator:
|
|
842
|
+
!p || !rt.current || I > 10 || (ie(t), l.onSwipe(t, At(t), {
|
|
843
|
+
animate: kt,
|
|
844
|
+
currentScreen: V.current,
|
|
845
|
+
prevScreen: Z.current,
|
|
846
|
+
onProgress: (f, v) => w?.onSwipe?.(f, v, {
|
|
847
|
+
animate: ct,
|
|
848
|
+
currentDecorator: q.current,
|
|
849
|
+
prevDecorator: st.current
|
|
811
850
|
})
|
|
812
851
|
}));
|
|
813
852
|
}, ue = async (t) => {
|
|
814
|
-
if (!
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
await l?.onSwipeEnd(t,
|
|
820
|
-
animate:
|
|
821
|
-
currentScreen:
|
|
822
|
-
prevScreen:
|
|
823
|
-
onStart: (
|
|
824
|
-
animate:
|
|
825
|
-
currentDecorator:
|
|
826
|
-
prevDecorator:
|
|
853
|
+
if (!p || !rt.current) return;
|
|
854
|
+
rt.current = !1;
|
|
855
|
+
const f = V.current;
|
|
856
|
+
f && f.hasPointerCapture(t.pointerId) && f.releasePointerCapture(t.pointerId);
|
|
857
|
+
const v = At(t);
|
|
858
|
+
if (await l?.onSwipeEnd(t, v, {
|
|
859
|
+
animate: kt,
|
|
860
|
+
currentScreen: V.current,
|
|
861
|
+
prevScreen: Z.current,
|
|
862
|
+
onStart: (A) => w?.onSwipeEnd?.(A, {
|
|
863
|
+
animate: ct,
|
|
864
|
+
currentDecorator: q.current,
|
|
865
|
+
prevDecorator: st.current
|
|
827
866
|
})
|
|
828
|
-
})
|
|
867
|
+
})) {
|
|
868
|
+
V.current?.setAttribute(pt, "true"), q.current?.setAttribute(pt, "true");
|
|
869
|
+
for (const A of W.current.current)
|
|
870
|
+
A.style.removeProperty("will-change");
|
|
871
|
+
for (const A of W.current.prev)
|
|
872
|
+
J(A), A.style.removeProperty("will-change");
|
|
873
|
+
W.current = { current: [], prev: [] }, window.history.back();
|
|
874
|
+
} else
|
|
875
|
+
J(V.current), Z.current && J(Z.current), q.current && J(q.current), st.current && J(st.current), _t(), c("IDLE");
|
|
829
876
|
}, le = (t) => {
|
|
830
|
-
if (!(!
|
|
877
|
+
if (!(!F && D && B === "COMPLETED" && o === "IDLE" && !!p && I < 10))
|
|
831
878
|
return;
|
|
832
|
-
|
|
879
|
+
et.current = qt(t.target, {
|
|
833
880
|
direction: "x",
|
|
834
881
|
verifyByScroll: !0
|
|
835
|
-
}),
|
|
882
|
+
}), ot.current = qt(t.target, {
|
|
836
883
|
direction: "y",
|
|
837
884
|
verifyByScroll: !0
|
|
838
|
-
}),
|
|
839
|
-
},
|
|
840
|
-
if (
|
|
885
|
+
}), Nt.current = t.clientX, $t.current = t.clientY, (!et.current.element && !ot.current.element || et.current.element || ot.current.element) && (tt.current = !0);
|
|
886
|
+
}, de = (t) => {
|
|
887
|
+
if (I > 10)
|
|
841
888
|
return;
|
|
842
|
-
if (
|
|
889
|
+
if (rt.current) {
|
|
843
890
|
ce(t.nativeEvent);
|
|
844
891
|
return;
|
|
845
892
|
}
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
(
|
|
851
|
-
} else if (
|
|
852
|
-
const
|
|
853
|
-
(
|
|
893
|
+
const f = !et.current.element && !ot.current.element;
|
|
894
|
+
if (tt.current && f) {
|
|
895
|
+
tt.current = !1, dt.current = !0;
|
|
896
|
+
const v = t.clientY - $t.current, k = t.clientX - Nt.current;
|
|
897
|
+
(p === "y" && v > 0 || p === "x" && k > 0) && St(t.nativeEvent);
|
|
898
|
+
} else if (tt.current && !f) {
|
|
899
|
+
const v = t.clientX - Nt.current, k = t.clientY - $t.current, A = ot.current.element && ot.current.element.scrollTop <= 0, at = et.current.element && et.current.element.scrollLeft <= 0 && et.current.hasMarker;
|
|
900
|
+
(p === "y" && (A || et.current.element) && k > 0 && Math.abs(v) < 2 || p === "x" && (at || ot.current.element) && v > 0 && Math.abs(k) < 2) && (tt.current = !1, dt.current = !0, St(t.nativeEvent));
|
|
854
901
|
}
|
|
855
|
-
},
|
|
856
|
-
|
|
902
|
+
}, jt = (t) => {
|
|
903
|
+
tt.current = !1, dt.current = !1, rt.current && ue(t.nativeEvent);
|
|
857
904
|
};
|
|
858
|
-
|
|
859
|
-
const t =
|
|
905
|
+
lt(() => {
|
|
906
|
+
const t = V.current;
|
|
860
907
|
if (!t) return;
|
|
861
|
-
const
|
|
862
|
-
|
|
908
|
+
const f = (v) => {
|
|
909
|
+
dt.current && v.preventDefault(), v.target?.dataset.swipeAtEdgeBar === "true" && v.preventDefault();
|
|
863
910
|
};
|
|
864
|
-
return t.addEventListener("touchmove",
|
|
911
|
+
return t.addEventListener("touchmove", f, {
|
|
865
912
|
passive: !1
|
|
866
913
|
}), () => {
|
|
867
|
-
t.removeEventListener("touchmove",
|
|
914
|
+
t.removeEventListener("touchmove", f);
|
|
868
915
|
};
|
|
869
|
-
}, []),
|
|
870
|
-
if (!
|
|
871
|
-
|
|
916
|
+
}, []), lt(() => {
|
|
917
|
+
if (!D) {
|
|
918
|
+
B === "REPLACING" && ht !== Y && h("PENDING");
|
|
872
919
|
return;
|
|
873
920
|
}
|
|
874
|
-
if (
|
|
875
|
-
c("IDLE"),
|
|
921
|
+
if (B === "COMPLETED") {
|
|
922
|
+
c("IDLE"), h("IDLE"), V.current && (J(V.current), V.current.removeAttribute(pt)), q.current && (J(q.current), q.current.removeAttribute(pt));
|
|
876
923
|
return;
|
|
877
924
|
}
|
|
878
|
-
if (
|
|
879
|
-
const t =
|
|
925
|
+
if (B === "IDLE") return;
|
|
926
|
+
const t = V.current;
|
|
880
927
|
if (!t) return;
|
|
881
|
-
const
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
},
|
|
885
|
-
if (!(!(t.getAttribute(
|
|
886
|
-
queueMicrotask(
|
|
928
|
+
const f = () => {
|
|
929
|
+
const z = ut.getState().transitionTaskId;
|
|
930
|
+
z && G.resolveTask(z);
|
|
931
|
+
}, v = `${B}-true`;
|
|
932
|
+
if (!(!(t.getAttribute(pt) === "true") && Pe(l, v))) {
|
|
933
|
+
queueMicrotask(f);
|
|
887
934
|
return;
|
|
888
935
|
}
|
|
889
|
-
const
|
|
890
|
-
|
|
936
|
+
const at = xe("screen", Y, v), X = (z) => {
|
|
937
|
+
z.target === t && z.animationName === at && (t.removeEventListener("animationend", X), f());
|
|
891
938
|
};
|
|
892
|
-
return t.addEventListener("animationend",
|
|
893
|
-
t.removeEventListener("animationend",
|
|
939
|
+
return t.addEventListener("animationend", X), () => {
|
|
940
|
+
t.removeEventListener("animationend", X);
|
|
894
941
|
};
|
|
895
942
|
}, [
|
|
896
|
-
|
|
897
|
-
|
|
943
|
+
B,
|
|
944
|
+
D,
|
|
898
945
|
C,
|
|
899
|
-
|
|
900
|
-
|
|
946
|
+
ht,
|
|
947
|
+
Y,
|
|
901
948
|
l,
|
|
902
949
|
c,
|
|
903
|
-
|
|
904
|
-
]),
|
|
905
|
-
const t =
|
|
950
|
+
h
|
|
951
|
+
]), xt(() => {
|
|
952
|
+
const t = gt.current;
|
|
906
953
|
if (!t) {
|
|
907
954
|
S(0);
|
|
908
955
|
return;
|
|
909
956
|
}
|
|
910
957
|
S(t.offsetHeight);
|
|
911
|
-
const
|
|
912
|
-
S(
|
|
958
|
+
const f = new ResizeObserver(([v]) => {
|
|
959
|
+
S(v.contentRect.height);
|
|
913
960
|
});
|
|
914
|
-
return
|
|
915
|
-
|
|
961
|
+
return f.observe(t), () => {
|
|
962
|
+
f.disconnect();
|
|
916
963
|
};
|
|
917
|
-
}, [
|
|
918
|
-
const t =
|
|
964
|
+
}, [i]), xt(() => {
|
|
965
|
+
const t = wt.current;
|
|
919
966
|
if (!t) {
|
|
920
|
-
|
|
967
|
+
_(0);
|
|
921
968
|
return;
|
|
922
969
|
}
|
|
923
|
-
|
|
924
|
-
const
|
|
925
|
-
|
|
970
|
+
_(t.offsetHeight);
|
|
971
|
+
const f = new ResizeObserver(([v]) => {
|
|
972
|
+
_(v.contentRect.height);
|
|
926
973
|
});
|
|
927
|
-
return
|
|
928
|
-
|
|
974
|
+
return f.observe(t), () => {
|
|
975
|
+
f.disconnect();
|
|
929
976
|
};
|
|
930
|
-
}, [
|
|
931
|
-
const { registerSharedBars: t, unregisterSharedBars:
|
|
977
|
+
}, [s]), xt(() => {
|
|
978
|
+
const { registerSharedBars: t, unregisterSharedBars: f } = Q.getState();
|
|
932
979
|
return t(C, {
|
|
933
|
-
appBar: !!
|
|
934
|
-
navigationBar: !!
|
|
935
|
-
}), () =>
|
|
936
|
-
}, [C,
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
};
|
|
949
|
-
ot(y), ot(T);
|
|
950
|
-
const j = (F) => {
|
|
951
|
-
if (F)
|
|
952
|
-
for (const yt of A)
|
|
953
|
-
F.style.removeProperty(yt);
|
|
954
|
-
};
|
|
955
|
-
let Ft = 0;
|
|
956
|
-
const Xt = () => {
|
|
957
|
-
const F = b ? U.getState().histories[p - 1]?.id : U.getState().histories[p]?.id, yt = F ? et.getState().sharedBars[F] : void 0, Bt = $t && !yt?.appBar, qt = Nt && !yt?.navigationBar, ht = Bt || qt ? getComputedStyle(t) : null;
|
|
958
|
-
if (y)
|
|
959
|
-
if (Bt && ht)
|
|
960
|
-
for (const ut of A)
|
|
961
|
-
y.style.setProperty(ut, ht.getPropertyValue(ut));
|
|
962
|
-
else
|
|
963
|
-
j(y);
|
|
964
|
-
if (T)
|
|
965
|
-
if (qt && ht)
|
|
966
|
-
for (const ut of A)
|
|
967
|
-
T.style.setProperty(ut, ht.getPropertyValue(ut));
|
|
968
|
-
else
|
|
969
|
-
j(T);
|
|
970
|
-
Ft = requestAnimationFrame(Xt);
|
|
980
|
+
appBar: !!i,
|
|
981
|
+
navigationBar: !!s
|
|
982
|
+
}), () => f(C);
|
|
983
|
+
}, [C, i, s]);
|
|
984
|
+
const Xt = D || M === d - 1, vt = !!i, Tt = !!s;
|
|
985
|
+
xt(() => {
|
|
986
|
+
const t = gt.current, f = wt.current;
|
|
987
|
+
if (!t && !f) return;
|
|
988
|
+
const v = () => {
|
|
989
|
+
if (!(ut.getState().status === "PUSHING" || ut.getState().status === "POPPING" || ut.getState().status === "REPLACING") || !Xt) {
|
|
990
|
+
t?.removeAttribute("data-flemo-bar-riding"), f?.removeAttribute("data-flemo-bar-riding");
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
const X = D ? O.getState().histories[d - 1]?.id : O.getState().histories[d]?.id, z = X ? Q.getState().sharedBars[X] : void 0, Et = vt && !z?.appBar, nt = Tt && !z?.navigationBar;
|
|
994
|
+
t && t.setAttribute("data-flemo-bar-riding", Et ? "true" : "false"), f && f.setAttribute("data-flemo-bar-riding", nt ? "true" : "false");
|
|
971
995
|
};
|
|
972
|
-
|
|
973
|
-
|
|
996
|
+
v();
|
|
997
|
+
const k = Q.subscribe(v), A = ut.subscribe(v);
|
|
998
|
+
return () => {
|
|
999
|
+
k(), A(), t?.removeAttribute("data-flemo-bar-riding"), f?.removeAttribute("data-flemo-bar-riding");
|
|
974
1000
|
};
|
|
975
|
-
}, [
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
Nt,
|
|
980
|
-
b,
|
|
981
|
-
p,
|
|
982
|
-
l
|
|
983
|
-
]);
|
|
984
|
-
const de = (() => {
|
|
985
|
-
if (!b) return {};
|
|
986
|
-
if (O !== "PUSHING" && O !== "REPLACING") return {};
|
|
1001
|
+
}, [Xt, D, d, vt, Tt]);
|
|
1002
|
+
const pe = (() => {
|
|
1003
|
+
if (!D) return {};
|
|
1004
|
+
if (B !== "PUSHING" && B !== "REPLACING") return {};
|
|
987
1005
|
const t = {};
|
|
988
1006
|
return typeof g.x == "number" && (t.transform = `translateX(${g.x}px)`), typeof g.x == "string" && (t.transform = `translateX(${g.x})`), typeof g.y == "number" && (t.transform = `translateY(${g.y}px)`), typeof g.y == "string" && (t.transform = `translateY(${g.y})`), typeof g.opacity == "number" && (t.opacity = `${g.opacity}`), t;
|
|
989
1007
|
})();
|
|
990
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ Ht(
|
|
991
1009
|
"div",
|
|
992
1010
|
{
|
|
993
1011
|
ref: Vt,
|
|
@@ -1008,7 +1026,7 @@ function _e({
|
|
|
1008
1026
|
overscrollBehavior: "contain"
|
|
1009
1027
|
},
|
|
1010
1028
|
children: [
|
|
1011
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ N(
|
|
1012
1030
|
"div",
|
|
1013
1031
|
{
|
|
1014
1032
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1022,31 +1040,31 @@ function _e({
|
|
|
1022
1040
|
}
|
|
1023
1041
|
}
|
|
1024
1042
|
),
|
|
1025
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ Ht(
|
|
1026
1044
|
"div",
|
|
1027
1045
|
{
|
|
1028
|
-
ref:
|
|
1046
|
+
ref: V,
|
|
1029
1047
|
...$,
|
|
1030
1048
|
onPointerDown: le,
|
|
1031
|
-
onPointerMove:
|
|
1032
|
-
onPointerUp:
|
|
1033
|
-
onPointerCancel:
|
|
1049
|
+
onPointerMove: de,
|
|
1050
|
+
onPointerUp: jt,
|
|
1051
|
+
onPointerCancel: jt,
|
|
1034
1052
|
"data-flemo-screen": !0,
|
|
1035
|
-
"data-flemo-transition":
|
|
1036
|
-
"data-flemo-status":
|
|
1037
|
-
"data-flemo-active":
|
|
1053
|
+
"data-flemo-transition": Y,
|
|
1054
|
+
"data-flemo-status": B,
|
|
1055
|
+
"data-flemo-active": D ? "true" : "false",
|
|
1038
1056
|
style: {
|
|
1039
1057
|
display: "flex",
|
|
1040
1058
|
flexDirection: "column",
|
|
1041
1059
|
height: "100%",
|
|
1042
|
-
backgroundColor:
|
|
1060
|
+
backgroundColor: y,
|
|
1043
1061
|
overflowY: R ? void 0 : "auto",
|
|
1044
|
-
touchAction:
|
|
1045
|
-
...
|
|
1062
|
+
touchAction: p === "x" ? "pan-y" : p === "y" ? "pan-x" : "auto",
|
|
1063
|
+
...pe,
|
|
1046
1064
|
...$.style
|
|
1047
1065
|
},
|
|
1048
1066
|
children: [
|
|
1049
|
-
!
|
|
1067
|
+
!m && e && /* @__PURE__ */ N("div", { style: { minHeight: e }, children: /* @__PURE__ */ N(
|
|
1050
1068
|
"div",
|
|
1051
1069
|
{
|
|
1052
1070
|
style: {
|
|
@@ -1054,21 +1072,21 @@ function _e({
|
|
|
1054
1072
|
top: 0,
|
|
1055
1073
|
width: "100%",
|
|
1056
1074
|
minHeight: e,
|
|
1057
|
-
backgroundColor:
|
|
1075
|
+
backgroundColor: r
|
|
1058
1076
|
}
|
|
1059
1077
|
}
|
|
1060
1078
|
) }),
|
|
1061
|
-
|
|
1079
|
+
i && /* @__PURE__ */ N(
|
|
1062
1080
|
"div",
|
|
1063
1081
|
{
|
|
1064
1082
|
style: {
|
|
1065
1083
|
width: "100%",
|
|
1066
|
-
minHeight:
|
|
1084
|
+
minHeight: U
|
|
1067
1085
|
}
|
|
1068
1086
|
}
|
|
1069
1087
|
),
|
|
1070
|
-
|
|
1071
|
-
/* @__PURE__ */
|
|
1088
|
+
T,
|
|
1089
|
+
/* @__PURE__ */ N(
|
|
1072
1090
|
"div",
|
|
1073
1091
|
{
|
|
1074
1092
|
style: {
|
|
@@ -1081,31 +1099,31 @@ function _e({
|
|
|
1081
1099
|
}
|
|
1082
1100
|
),
|
|
1083
1101
|
E,
|
|
1084
|
-
|
|
1102
|
+
s && /* @__PURE__ */ N(
|
|
1085
1103
|
"div",
|
|
1086
1104
|
{
|
|
1087
1105
|
style: {
|
|
1088
|
-
display:
|
|
1106
|
+
display: b ? "none" : void 0,
|
|
1089
1107
|
width: "100%",
|
|
1090
|
-
minHeight:
|
|
1108
|
+
minHeight: H
|
|
1091
1109
|
}
|
|
1092
1110
|
}
|
|
1093
1111
|
),
|
|
1094
|
-
!x &&
|
|
1112
|
+
!x && a && /* @__PURE__ */ N(
|
|
1095
1113
|
"div",
|
|
1096
1114
|
{
|
|
1097
1115
|
style: {
|
|
1098
|
-
display:
|
|
1099
|
-
minHeight:
|
|
1116
|
+
display: b ? "none" : void 0,
|
|
1117
|
+
minHeight: a
|
|
1100
1118
|
},
|
|
1101
|
-
children: /* @__PURE__ */
|
|
1119
|
+
children: /* @__PURE__ */ N(
|
|
1102
1120
|
"div",
|
|
1103
1121
|
{
|
|
1104
1122
|
style: {
|
|
1105
1123
|
position: "fixed",
|
|
1106
1124
|
bottom: 0,
|
|
1107
1125
|
width: "100%",
|
|
1108
|
-
minHeight:
|
|
1126
|
+
minHeight: a,
|
|
1109
1127
|
backgroundColor: u
|
|
1110
1128
|
}
|
|
1111
1129
|
}
|
|
@@ -1115,37 +1133,45 @@ function _e({
|
|
|
1115
1133
|
]
|
|
1116
1134
|
}
|
|
1117
1135
|
),
|
|
1118
|
-
|
|
1136
|
+
i && /* @__PURE__ */ N(
|
|
1119
1137
|
"div",
|
|
1120
1138
|
{
|
|
1121
|
-
ref:
|
|
1139
|
+
ref: gt,
|
|
1140
|
+
"data-flemo-bar": "app",
|
|
1141
|
+
"data-flemo-bar-transition": Y,
|
|
1142
|
+
"data-flemo-bar-status": B,
|
|
1143
|
+
"data-flemo-bar-active": D ? "true" : "false",
|
|
1122
1144
|
style: {
|
|
1123
1145
|
position: "fixed",
|
|
1124
|
-
top:
|
|
1146
|
+
top: m ? 0 : e,
|
|
1125
1147
|
left: 0,
|
|
1126
1148
|
width: "100%",
|
|
1127
1149
|
zIndex: 1
|
|
1128
1150
|
},
|
|
1129
|
-
children:
|
|
1151
|
+
children: i
|
|
1130
1152
|
}
|
|
1131
1153
|
),
|
|
1132
|
-
|
|
1154
|
+
s && /* @__PURE__ */ N(
|
|
1133
1155
|
"div",
|
|
1134
1156
|
{
|
|
1135
|
-
ref:
|
|
1157
|
+
ref: wt,
|
|
1158
|
+
"data-flemo-bar": "nav",
|
|
1159
|
+
"data-flemo-bar-transition": Y,
|
|
1160
|
+
"data-flemo-bar-status": B,
|
|
1161
|
+
"data-flemo-bar-active": D ? "true" : "false",
|
|
1136
1162
|
style: {
|
|
1137
|
-
display:
|
|
1163
|
+
display: b ? "none" : void 0,
|
|
1138
1164
|
position: "fixed",
|
|
1139
|
-
bottom: x ? 0 :
|
|
1165
|
+
bottom: x ? 0 : a,
|
|
1140
1166
|
left: 0,
|
|
1141
1167
|
width: "100%",
|
|
1142
1168
|
zIndex: 1
|
|
1143
1169
|
},
|
|
1144
|
-
children:
|
|
1170
|
+
children: s
|
|
1145
1171
|
}
|
|
1146
1172
|
),
|
|
1147
|
-
w && /* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1173
|
+
w && /* @__PURE__ */ N(He, { ref: q }),
|
|
1174
|
+
/* @__PURE__ */ N(
|
|
1149
1175
|
"div",
|
|
1150
1176
|
{
|
|
1151
1177
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1164,25 +1190,25 @@ function _e({
|
|
|
1164
1190
|
);
|
|
1165
1191
|
}
|
|
1166
1192
|
function Je({ children: n, ...e }) {
|
|
1167
|
-
const { isActive:
|
|
1168
|
-
return /* @__PURE__ */
|
|
1193
|
+
const { isActive: r, isPrev: a, zIndex: u } = mt(), i = O((y) => y.index), s = K((y) => y.status), T = Q((y) => y.dragStatus), E = Q((y) => y.replaceTransitionStatus), x = !r && (s === "COMPLETED" && T === "IDLE") || a && i - 2 <= u && E === "IDLE" || a && i - 2 > u;
|
|
1194
|
+
return /* @__PURE__ */ N(Ce, { freeze: x, children: /* @__PURE__ */ N(Ve, { ...e, children: n }) });
|
|
1169
1195
|
}
|
|
1170
1196
|
export {
|
|
1171
1197
|
qe as Route,
|
|
1172
|
-
|
|
1198
|
+
Fe as Router,
|
|
1173
1199
|
Je as Screen,
|
|
1174
|
-
|
|
1200
|
+
ne as ScreenContext,
|
|
1175
1201
|
He as ScreenDecorator,
|
|
1176
|
-
|
|
1177
|
-
|
|
1202
|
+
Ce as ScreenFreeze,
|
|
1203
|
+
Ve as ScreenMotion,
|
|
1178
1204
|
tn as createDecorator,
|
|
1179
1205
|
en as createRawDecorator,
|
|
1180
1206
|
nn as createRawTransition,
|
|
1181
1207
|
rn as createTransition,
|
|
1182
1208
|
ze as useNavigate,
|
|
1183
1209
|
We as useParams,
|
|
1184
|
-
|
|
1185
|
-
|
|
1210
|
+
mt as useScreen,
|
|
1211
|
+
Q as useScreenStore,
|
|
1186
1212
|
Ke as useStep,
|
|
1187
|
-
|
|
1213
|
+
Ge as useViewportScrollHeight
|
|
1188
1214
|
};
|