@flemo/react 1.0.1 → 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/dist/index.mjs +596 -589
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { consumeSelfInducedPop as
|
|
4
|
-
import { createDecorator as
|
|
5
|
-
function
|
|
6
|
-
return
|
|
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
|
+
import { createDecorator as tn, createRawDecorator as en, createRawTransition as nn, createTransition as rn } from "@flemo/core";
|
|
5
|
+
function Ie() {
|
|
6
|
+
return lt(() => {
|
|
7
7
|
const n = async (e) => {
|
|
8
|
-
if (
|
|
8
|
+
if (ge())
|
|
9
9
|
return;
|
|
10
|
-
const
|
|
11
|
-
(await
|
|
10
|
+
const r = e.state?.id, a = G.generateTaskId();
|
|
11
|
+
(await G.addTask(
|
|
12
12
|
async (u) => {
|
|
13
|
-
const i = e.state?.index, s = e.state?.status,
|
|
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:
|
|
22
|
-
transitionName:
|
|
18
|
+
return y(a), D ? x("POPPING") : F ? (x("PUSHING"), $({
|
|
19
|
+
id: r,
|
|
20
|
+
pathname: Y,
|
|
21
|
+
params: T,
|
|
22
|
+
transitionName: E,
|
|
23
23
|
layoutId: m
|
|
24
|
-
})) :
|
|
25
|
-
id:
|
|
26
|
-
pathname:
|
|
27
|
-
params:
|
|
28
|
-
transitionName:
|
|
24
|
+
})) : M && (x("REPLACING"), $({
|
|
25
|
+
id: r,
|
|
26
|
+
pathname: Y,
|
|
27
|
+
params: T,
|
|
28
|
+
transitionName: E,
|
|
29
29
|
layoutId: m
|
|
30
30
|
})), async () => {
|
|
31
|
-
|
|
31
|
+
D && C(i + 1), x("COMPLETED");
|
|
32
32
|
};
|
|
33
33
|
},
|
|
34
34
|
{
|
|
@@ -44,267 +44,267 @@ function xe() {
|
|
|
44
44
|
};
|
|
45
45
|
}, []), null;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
if (zt) return
|
|
50
|
-
zt = 1, Object.defineProperty(
|
|
51
|
-
const n = "/", e = (
|
|
52
|
-
function i(
|
|
53
|
-
return
|
|
47
|
+
var j = {}, zt;
|
|
48
|
+
function Re() {
|
|
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 s(
|
|
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
|
-
|
|
64
|
-
class
|
|
65
|
-
constructor(c,
|
|
63
|
+
j.TokenData = T;
|
|
64
|
+
class E extends TypeError {
|
|
65
|
+
constructor(c, h) {
|
|
66
66
|
let d = c;
|
|
67
|
-
|
|
67
|
+
h && (d += `: ${h}`), d += "; visit https://git.new/pathToRegexpError for info", super(d), this.originalPath = h;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
function m(
|
|
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
|
|
74
|
+
function g(p) {
|
|
75
75
|
const P = [];
|
|
76
|
-
let
|
|
77
|
-
function
|
|
78
|
-
|
|
76
|
+
let w = "";
|
|
77
|
+
function I() {
|
|
78
|
+
w && (P.push({
|
|
79
79
|
type: "text",
|
|
80
|
-
value:
|
|
81
|
-
}),
|
|
80
|
+
value: h(w)
|
|
81
|
+
}), w = "");
|
|
82
82
|
}
|
|
83
83
|
for (; l < d.length; ) {
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
return
|
|
87
|
-
if (
|
|
84
|
+
const b = d[l++];
|
|
85
|
+
if (b === p)
|
|
86
|
+
return I(), P;
|
|
87
|
+
if (b === "\\") {
|
|
88
88
|
if (l === d.length)
|
|
89
|
-
throw new
|
|
90
|
-
|
|
89
|
+
throw new E(`Unexpected end after \\ at index ${l}`, o);
|
|
90
|
+
w += d[l++];
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
let
|
|
96
|
-
if (
|
|
93
|
+
if (b === ":" || b === "*") {
|
|
94
|
+
const U = b === ":" ? "param" : "wildcard";
|
|
95
|
+
let S = "";
|
|
96
|
+
if (r.test(d[l]))
|
|
97
97
|
do
|
|
98
|
-
|
|
98
|
+
S += d[l++];
|
|
99
99
|
while (a.test(d[l]));
|
|
100
100
|
else if (d[l] === '"') {
|
|
101
|
-
let
|
|
101
|
+
let H = l;
|
|
102
102
|
for (; l < d.length; ) {
|
|
103
103
|
if (d[++l] === '"') {
|
|
104
|
-
l++,
|
|
104
|
+
l++, H = 0;
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
|
-
d[l] === "\\" && l++,
|
|
107
|
+
d[l] === "\\" && l++, S += d[l];
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
throw new
|
|
109
|
+
if (H)
|
|
110
|
+
throw new E(`Unterminated quote at index ${H}`, o);
|
|
111
111
|
}
|
|
112
|
-
if (!
|
|
113
|
-
throw new
|
|
114
|
-
|
|
112
|
+
if (!S)
|
|
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
|
-
tokens:
|
|
120
|
+
tokens: g("}")
|
|
121
121
|
});
|
|
122
122
|
continue;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
throw new
|
|
126
|
-
|
|
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
|
|
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
|
|
138
|
-
if (
|
|
139
|
-
throw new TypeError(`Missing parameters: ${
|
|
140
|
-
return
|
|
137
|
+
const w = [], I = g(P, w);
|
|
138
|
+
if (w.length)
|
|
139
|
+
throw new TypeError(`Missing parameters: ${w.join(", ")}`);
|
|
140
|
+
return I;
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
const d =
|
|
145
|
-
return (l,
|
|
146
|
-
let
|
|
143
|
+
function y(o, c, h) {
|
|
144
|
+
const d = o.map((l) => R(l, c, h));
|
|
145
|
+
return (l, g) => {
|
|
146
|
+
let p = "";
|
|
147
147
|
for (const P of d)
|
|
148
|
-
|
|
149
|
-
return
|
|
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 (
|
|
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 d =
|
|
163
|
-
return
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
return
|
|
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
|
|
171
|
-
if (typeof
|
|
172
|
-
throw new TypeError(`Expected "${
|
|
173
|
-
|
|
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
|
-
} : (l,
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
return
|
|
180
|
-
if (typeof
|
|
181
|
-
throw new TypeError(`Expected "${
|
|
182
|
-
return d(
|
|
176
|
+
} : (l, g) => {
|
|
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:
|
|
187
|
-
return function(
|
|
188
|
-
const
|
|
189
|
-
if (!
|
|
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
|
+
return function(w) {
|
|
188
|
+
const I = l.exec(w);
|
|
189
|
+
if (!I)
|
|
190
190
|
return !1;
|
|
191
|
-
const
|
|
192
|
-
for (let
|
|
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
|
|
202
|
-
const { delimiter:
|
|
203
|
-
let P = "",
|
|
204
|
-
function
|
|
205
|
-
if (Array.isArray(
|
|
206
|
-
for (const
|
|
207
|
-
|
|
201
|
+
function C(o, c = {}) {
|
|
202
|
+
const { delimiter: h = n, end: d = !0, sensitive: l = !1, trailing: g = !0 } = c, p = [];
|
|
203
|
+
let P = "", w = 0;
|
|
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
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
throw new
|
|
214
|
-
|
|
210
|
+
const S = typeof U == "object" ? U : m(U, c);
|
|
211
|
+
D(S.tokens, 0, [], (H) => {
|
|
212
|
+
if (w >= 256)
|
|
213
|
+
throw new E("Too many path combinations", S.originalPath);
|
|
214
|
+
w > 0 && (P += "|"), P += F(H, h, p, S.originalPath), w++;
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
let
|
|
219
|
-
return
|
|
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
|
|
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
|
-
d(
|
|
231
|
+
d(h);
|
|
232
232
|
}
|
|
233
|
-
function F(
|
|
234
|
-
let l = "",
|
|
235
|
-
function
|
|
236
|
-
for (;
|
|
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 (;
|
|
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
|
|
257
|
-
if (
|
|
258
|
-
l += s(
|
|
255
|
+
for (; I < o.length; ) {
|
|
256
|
+
const S = o[I++];
|
|
257
|
+
if (S.type === "text") {
|
|
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
|
-
if (
|
|
262
|
-
if (P && !
|
|
263
|
-
throw new
|
|
264
|
-
|
|
261
|
+
if (S.type === "param" || S.type === "wildcard") {
|
|
262
|
+
if (P && !g)
|
|
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
|
-
throw new TypeError(`Unknown token type: ${
|
|
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 d =
|
|
274
|
+
function Y(o, c) {
|
|
275
|
+
let h = "";
|
|
276
|
+
for (; c < o.length; ) {
|
|
277
|
+
const d = o[c++];
|
|
278
278
|
if (d.type === "text") {
|
|
279
|
-
|
|
279
|
+
h += i(d.value);
|
|
280
280
|
continue;
|
|
281
281
|
}
|
|
282
282
|
if (d.type === "group") {
|
|
283
|
-
|
|
283
|
+
h += "{" + Y(d.tokens, 0) + "}";
|
|
284
284
|
continue;
|
|
285
285
|
}
|
|
286
286
|
if (d.type === "param") {
|
|
287
|
-
|
|
287
|
+
h += ":" + B(d.name, o[c]);
|
|
288
288
|
continue;
|
|
289
289
|
}
|
|
290
290
|
if (d.type === "wildcard") {
|
|
291
|
-
|
|
291
|
+
h += "*" + B(d.name, o[c]);
|
|
292
292
|
continue;
|
|
293
293
|
}
|
|
294
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,162 +317,162 @@ const ee = Vt({
|
|
|
317
317
|
layoutId: null,
|
|
318
318
|
routePath: ""
|
|
319
319
|
});
|
|
320
|
-
function
|
|
321
|
-
return Yt(
|
|
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
|
-
function
|
|
329
|
-
const { isActive: e, params:
|
|
330
|
-
return
|
|
328
|
+
function Le({ children: n }) {
|
|
329
|
+
const { isActive: e, params: r } = mt(), [a, u] = me(De, r);
|
|
330
|
+
return lt(() => {
|
|
331
331
|
const i = async (s) => {
|
|
332
|
-
s.state?.step && await
|
|
332
|
+
s.state?.step && await G.addTask(async () => {
|
|
333
333
|
u({ type: "SET", params: s.state?.params || {} });
|
|
334
334
|
});
|
|
335
335
|
};
|
|
336
336
|
return e && window.addEventListener("popstate", i), () => {
|
|
337
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 = O((a) => a.index),
|
|
343
|
-
return
|
|
344
|
-
(a) =>
|
|
345
|
-
(u) =>
|
|
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
346
|
a.pathname
|
|
347
347
|
)
|
|
348
348
|
)
|
|
349
|
-
).map(([a], u) => /* @__PURE__ */
|
|
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:
|
|
363
|
-
routePath:
|
|
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
|
+
routePath: we(
|
|
364
364
|
a.props.path,
|
|
365
|
-
|
|
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 Kt = "data-flemo",
|
|
373
|
+
const Kt = "data-flemo", Wt = () => {
|
|
374
374
|
if (Mt()) return;
|
|
375
|
-
const n =
|
|
375
|
+
const n = Se(it.values(), ft.values());
|
|
376
376
|
let e = document.head.querySelector(`style[${Kt}]`);
|
|
377
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: a =
|
|
396
|
-
decorators: u =
|
|
394
|
+
defaultTransitionName: r = "cupertino",
|
|
395
|
+
transitions: a = Ae,
|
|
396
|
+
decorators: u = ke
|
|
397
397
|
}) {
|
|
398
398
|
const i = Mt() ? e || "/" : window.location.pathname, s = Mt() ? i.split("?")[1] || "" : window.location.search;
|
|
399
|
-
return
|
|
400
|
-
defaultTransitionName:
|
|
399
|
+
return Ot.setState({
|
|
400
|
+
defaultTransitionName: r
|
|
401
401
|
}), O.setState({
|
|
402
402
|
index: 0,
|
|
403
403
|
histories: [
|
|
404
404
|
{
|
|
405
405
|
id: "root",
|
|
406
406
|
pathname: i,
|
|
407
|
-
params:
|
|
408
|
-
|
|
407
|
+
params: ve(
|
|
408
|
+
te.toArray(n).map((T) => T.props.path).flat(),
|
|
409
409
|
i,
|
|
410
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
|
-
function
|
|
434
|
+
function qe({ element: n }) {
|
|
435
435
|
return n;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
const
|
|
439
|
-
Object.entries(
|
|
440
|
-
), i = a(u),
|
|
441
|
-
Object.entries(
|
|
442
|
-
), m = new URLSearchParams(
|
|
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
443
|
return { pathname: `${i}${m ? `?${m}` : ""}`, toPathname: i };
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function ze() {
|
|
446
446
|
return {
|
|
447
447
|
push: async (a, u, i) => {
|
|
448
|
-
const { status: s } =
|
|
448
|
+
const { status: s } = K.getState();
|
|
449
449
|
if (s !== "COMPLETED" && s !== "IDLE")
|
|
450
450
|
return;
|
|
451
|
-
const { index:
|
|
452
|
-
(await
|
|
451
|
+
const { index: T, addHistory: E } = O.getState(), m = Ot.getState().defaultTransitionName, { transitionName: x = m, layoutId: y = null } = i ?? {}, R = G.generateTaskId();
|
|
452
|
+
(await G.addTask(
|
|
453
453
|
async () => {
|
|
454
|
-
const { setStatus:
|
|
455
|
-
|
|
456
|
-
const { pathname:
|
|
454
|
+
const { setStatus: $, setTransitionTaskId: C } = K.getState();
|
|
455
|
+
$("PUSHING"), C(R);
|
|
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
|
-
|
|
468
|
-
),
|
|
467
|
+
D
|
|
468
|
+
), E({
|
|
469
469
|
id: R,
|
|
470
470
|
pathname: F,
|
|
471
471
|
params: u ?? {},
|
|
472
472
|
transitionName: x,
|
|
473
|
-
layoutId:
|
|
473
|
+
layoutId: y
|
|
474
474
|
}), () => {
|
|
475
|
-
|
|
475
|
+
$("COMPLETED");
|
|
476
476
|
};
|
|
477
477
|
},
|
|
478
478
|
{
|
|
@@ -484,38 +484,38 @@ function Xe() {
|
|
|
484
484
|
)).result?.();
|
|
485
485
|
},
|
|
486
486
|
replace: async (a, u, i) => {
|
|
487
|
-
const { status: s } =
|
|
487
|
+
const { status: s } = K.getState();
|
|
488
488
|
if (s !== "COMPLETED" && s !== "IDLE")
|
|
489
489
|
return;
|
|
490
|
-
const { index:
|
|
491
|
-
(await
|
|
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
|
+
(await G.addTask(
|
|
492
492
|
async () => {
|
|
493
|
-
const { setStatus:
|
|
494
|
-
|
|
495
|
-
const { pathname: F, toPathname:
|
|
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
|
-
id:
|
|
499
|
-
index:
|
|
498
|
+
id: $,
|
|
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
|
-
),
|
|
508
|
-
id:
|
|
509
|
-
pathname:
|
|
507
|
+
), E({
|
|
508
|
+
id: $,
|
|
509
|
+
pathname: M,
|
|
510
510
|
params: u ?? {},
|
|
511
|
-
transitionName:
|
|
511
|
+
transitionName: y,
|
|
512
512
|
layoutId: R
|
|
513
513
|
}), async () => {
|
|
514
|
-
m(
|
|
514
|
+
m(T), C("COMPLETED");
|
|
515
515
|
};
|
|
516
516
|
},
|
|
517
517
|
{
|
|
518
|
-
id:
|
|
518
|
+
id: $,
|
|
519
519
|
control: {
|
|
520
520
|
manual: !0
|
|
521
521
|
}
|
|
@@ -523,17 +523,17 @@ function Xe() {
|
|
|
523
523
|
)).result?.();
|
|
524
524
|
},
|
|
525
525
|
pop: async () => {
|
|
526
|
-
const a =
|
|
527
|
-
(await
|
|
526
|
+
const a = G.generateTaskId();
|
|
527
|
+
(await G.addTask(
|
|
528
528
|
async (u) => {
|
|
529
529
|
const { index: i, popHistory: s } = O.getState();
|
|
530
530
|
if (i <= 0) {
|
|
531
531
|
u.abort();
|
|
532
532
|
return;
|
|
533
533
|
}
|
|
534
|
-
const { setStatus:
|
|
535
|
-
return
|
|
536
|
-
s(i),
|
|
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
|
{
|
|
@@ -546,12 +546,12 @@ function Xe() {
|
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
const { routePath: n } =
|
|
549
|
+
function Ke() {
|
|
550
|
+
const { routePath: n } = mt(), e = Yt(oe);
|
|
551
551
|
return {
|
|
552
552
|
pushStep: async (i) => {
|
|
553
|
-
(await
|
|
554
|
-
const { pathname: s } =
|
|
553
|
+
(await G.addTask(async () => {
|
|
554
|
+
const { pathname: s } = It(n, i);
|
|
555
555
|
return window.history.state?.step || window.history.replaceState(
|
|
556
556
|
{
|
|
557
557
|
...window.history.state,
|
|
@@ -571,8 +571,8 @@ function qe() {
|
|
|
571
571
|
})).result?.();
|
|
572
572
|
},
|
|
573
573
|
replaceStep: async (i) => {
|
|
574
|
-
(await
|
|
575
|
-
const { pathname: s } =
|
|
574
|
+
(await G.addTask(async () => {
|
|
575
|
+
const { pathname: s } = It(n, i);
|
|
576
576
|
return window.history.replaceState(
|
|
577
577
|
{
|
|
578
578
|
...window.history.state,
|
|
@@ -585,22 +585,22 @@ function qe() {
|
|
|
585
585
|
})).result?.();
|
|
586
586
|
},
|
|
587
587
|
popStep: async () => {
|
|
588
|
-
const i =
|
|
589
|
-
(await
|
|
588
|
+
const i = G.generateTaskId();
|
|
589
|
+
(await G.addTask(
|
|
590
590
|
async (s) => {
|
|
591
|
-
const
|
|
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
|
-
}),
|
|
598
|
-
(
|
|
597
|
+
}), E = new Promise(
|
|
598
|
+
(C) => setTimeout(() => C(void 0), 200)
|
|
599
599
|
);
|
|
600
|
-
|
|
600
|
+
ee(), window.history.back();
|
|
601
601
|
const m = await Promise.race([
|
|
602
|
-
|
|
603
|
-
|
|
602
|
+
T,
|
|
603
|
+
E
|
|
604
604
|
]);
|
|
605
605
|
if (!m) {
|
|
606
606
|
s.abort();
|
|
@@ -610,9 +610,9 @@ function qe() {
|
|
|
610
610
|
e({ type: "SET", params: m.params ?? {} }), s.abort();
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
|
-
const { setStatus: x, setTransitionTaskId:
|
|
614
|
-
return x("POPPING"),
|
|
615
|
-
|
|
613
|
+
const { setStatus: x, setTransitionTaskId: y } = K.getState(), { index: R, popHistory: $ } = O.getState();
|
|
614
|
+
return x("POPPING"), y(i), async () => {
|
|
615
|
+
$(R), x("COMPLETED");
|
|
616
616
|
};
|
|
617
617
|
},
|
|
618
618
|
{
|
|
@@ -625,26 +625,26 @@ function qe() {
|
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
return Yt(
|
|
628
|
+
function We() {
|
|
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
|
|
644
|
-
const { isActive: a, transitionName: u } =
|
|
645
|
-
|
|
646
|
-
const s =
|
|
647
|
-
return m ? /* @__PURE__ */
|
|
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
650
|
ref: i,
|
|
@@ -662,346 +662,353 @@ function Ce({ 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
688
|
const Qt = (n) => {
|
|
689
|
-
const e =
|
|
690
|
-
return Object.assign(
|
|
691
|
-
},
|
|
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 a = { ...
|
|
697
|
+
registerSharedBars: (e, r) => n((a) => ({ sharedBars: { ...a.sharedBars, [e]: r } })),
|
|
698
|
+
unregisterSharedBars: (e) => n((r) => {
|
|
699
|
+
const a = { ...r.sharedBars };
|
|
700
700
|
return delete a[e], { sharedBars: a };
|
|
701
701
|
})
|
|
702
702
|
}));
|
|
703
|
-
let
|
|
703
|
+
let Ct = 0;
|
|
704
704
|
function Ge() {
|
|
705
|
-
const [n, e] = bt(0), [
|
|
706
|
-
return
|
|
705
|
+
const [n, e] = bt(0), [r, a] = bt(0);
|
|
706
|
+
return lt(() => {
|
|
707
707
|
let u = 0;
|
|
708
708
|
const i = () => {
|
|
709
709
|
cancelAnimationFrame(u), u = requestAnimationFrame(() => {
|
|
710
710
|
let s = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
711
711
|
s = s < 0 ? 0 : s;
|
|
712
|
-
let
|
|
713
|
-
|
|
712
|
+
let T = s - Ct;
|
|
713
|
+
T = T < 0 ? 0 : T, Ct || (Ct = s), a(T), e(s);
|
|
714
714
|
});
|
|
715
715
|
};
|
|
716
716
|
return window.visualViewport?.addEventListener("resize", i), window.visualViewport?.addEventListener("scroll", i), () => {
|
|
717
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
|
|
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
|
-
|
|
728
|
-
|
|
729
|
-
|
|
733
|
+
n.style.removeProperty("transform"), n.style.removeProperty("opacity");
|
|
734
|
+
}, ct = (n, e, r = {}) => {
|
|
735
|
+
if (!Ye(n)) return Promise.resolve();
|
|
736
|
+
const a = n, u = Te(e);
|
|
730
737
|
if (u.length === 0) return Promise.resolve();
|
|
731
|
-
const i = typeof
|
|
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);
|
|
732
739
|
if (i <= 0 && s <= 0) {
|
|
733
740
|
a.style.transition = "none";
|
|
734
|
-
for (const m of u)
|
|
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
|
|
738
|
-
a.style.transition =
|
|
739
|
-
for (const m of u)
|
|
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);
|
|
740
749
|
return new Promise((m) => {
|
|
741
750
|
let x = !1;
|
|
742
|
-
const
|
|
751
|
+
const y = () => {
|
|
743
752
|
x || (x = !0, a.removeEventListener("transitionend", R), m());
|
|
744
|
-
}, R = (
|
|
745
|
-
|
|
753
|
+
}, R = ($) => {
|
|
754
|
+
$.target === a && y();
|
|
746
755
|
};
|
|
747
|
-
a.addEventListener("transitionend", R), setTimeout(
|
|
756
|
+
a.addEventListener("transitionend", R), setTimeout(y, (i + s) * 1e3 + 60);
|
|
748
757
|
});
|
|
749
|
-
},
|
|
758
|
+
}, ut = K, pt = "data-flemo-skip-animation";
|
|
750
759
|
function Ve({
|
|
751
760
|
children: n,
|
|
752
761
|
statusBarHeight: e,
|
|
753
|
-
statusBarColor:
|
|
762
|
+
statusBarColor: r,
|
|
754
763
|
systemNavigationBarHeight: a,
|
|
755
764
|
systemNavigationBarColor: u,
|
|
756
765
|
sharedAppBar: i,
|
|
757
766
|
sharedNavigationBar: s,
|
|
758
|
-
appBar:
|
|
759
|
-
navigationBar:
|
|
767
|
+
appBar: T,
|
|
768
|
+
navigationBar: E,
|
|
760
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:
|
|
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
786
|
x: t.clientX - Rt.current.x,
|
|
775
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
|
-
|
|
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,
|
|
795
834
|
prevScreen: Z.current,
|
|
796
|
-
onStart: (
|
|
797
|
-
animate:
|
|
798
|
-
currentDecorator:
|
|
799
|
-
prevDecorator:
|
|
835
|
+
onStart: (A) => w?.onSwipeStart?.(A, {
|
|
836
|
+
animate: ct,
|
|
837
|
+
currentDecorator: q.current,
|
|
838
|
+
prevDecorator: st.current
|
|
800
839
|
})
|
|
801
|
-
}) ? c("PENDING") : (c("IDLE"),
|
|
802
|
-
},
|
|
803
|
-
!
|
|
804
|
-
animate:
|
|
805
|
-
currentScreen:
|
|
840
|
+
}) ? c("PENDING") : (c("IDLE"), rt.current = !1, _t());
|
|
841
|
+
}, ce = (t) => {
|
|
842
|
+
!p || !rt.current || I > 10 || (ie(t), l.onSwipe(t, At(t), {
|
|
843
|
+
animate: kt,
|
|
844
|
+
currentScreen: V.current,
|
|
806
845
|
prevScreen: Z.current,
|
|
807
|
-
onProgress: (
|
|
808
|
-
animate:
|
|
809
|
-
currentDecorator:
|
|
810
|
-
prevDecorator:
|
|
846
|
+
onProgress: (f, v) => w?.onSwipe?.(f, v, {
|
|
847
|
+
animate: ct,
|
|
848
|
+
currentDecorator: q.current,
|
|
849
|
+
prevDecorator: st.current
|
|
811
850
|
})
|
|
812
851
|
}));
|
|
813
|
-
},
|
|
814
|
-
if (!
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
await l?.onSwipeEnd(t,
|
|
820
|
-
animate:
|
|
821
|
-
currentScreen:
|
|
852
|
+
}, ue = async (t) => {
|
|
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,
|
|
822
861
|
prevScreen: Z.current,
|
|
823
|
-
onStart: (
|
|
824
|
-
animate:
|
|
825
|
-
currentDecorator:
|
|
826
|
-
prevDecorator:
|
|
862
|
+
onStart: (A) => w?.onSwipeEnd?.(A, {
|
|
863
|
+
animate: ct,
|
|
864
|
+
currentDecorator: q.current,
|
|
865
|
+
prevDecorator: st.current
|
|
827
866
|
})
|
|
828
|
-
})
|
|
829
|
-
|
|
830
|
-
|
|
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");
|
|
876
|
+
}, le = (t) => {
|
|
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 (
|
|
843
|
-
|
|
889
|
+
if (rt.current) {
|
|
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
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
943
|
+
B,
|
|
944
|
+
D,
|
|
945
|
+
C,
|
|
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
|
-
|
|
911
|
-
const
|
|
912
|
-
v
|
|
957
|
+
S(t.offsetHeight);
|
|
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
|
-
}, [i]),
|
|
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
|
-
}, [s]),
|
|
931
|
-
const { registerSharedBars: t, unregisterSharedBars:
|
|
932
|
-
return t(
|
|
977
|
+
}, [s]), xt(() => {
|
|
978
|
+
const { registerSharedBars: t, unregisterSharedBars: f } = Q.getState();
|
|
979
|
+
return t(C, {
|
|
933
980
|
appBar: !!i,
|
|
934
981
|
navigationBar: !!s
|
|
935
|
-
}), () =>
|
|
936
|
-
}, [
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
const t =
|
|
940
|
-
if (!t && !
|
|
941
|
-
const
|
|
942
|
-
if (!(
|
|
943
|
-
t?.removeAttribute("data-flemo-bar-riding"),
|
|
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");
|
|
944
991
|
return;
|
|
945
992
|
}
|
|
946
|
-
const
|
|
947
|
-
t && t.setAttribute("data-flemo-bar-riding",
|
|
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");
|
|
948
995
|
};
|
|
949
|
-
|
|
950
|
-
const
|
|
996
|
+
v();
|
|
997
|
+
const k = Q.subscribe(v), A = ut.subscribe(v);
|
|
951
998
|
return () => {
|
|
952
|
-
|
|
953
|
-
};
|
|
954
|
-
}, [Tt, b, d, dt, pt]), mt(() => {
|
|
955
|
-
if (!jt || !Tt || !dt && !pt) return;
|
|
956
|
-
const t = X.current;
|
|
957
|
-
if (!t) return;
|
|
958
|
-
const p = St.current, g = vt.current, C = Pe(l);
|
|
959
|
-
if (C.length === 0) return;
|
|
960
|
-
const j = C.join(", ");
|
|
961
|
-
p && (p.style.willChange = j), g && (g.style.willChange = j);
|
|
962
|
-
const z = (rt) => {
|
|
963
|
-
if (rt)
|
|
964
|
-
for (const it of C) rt.style.removeProperty(it);
|
|
965
|
-
};
|
|
966
|
-
let K = 0;
|
|
967
|
-
const B = () => {
|
|
968
|
-
const rt = b ? O.getState().histories[d - 1]?.id : O.getState().histories[d]?.id, it = rt ? J.getState().sharedBars[rt] : void 0, Ft = dt && !it?.appBar, Xt = pt && !it?.navigationBar, Pt = Ft || Xt ? getComputedStyle(t) : null;
|
|
969
|
-
if (p)
|
|
970
|
-
if (Ft && Pt)
|
|
971
|
-
for (const ft of C)
|
|
972
|
-
p.style.setProperty(ft, Pt.getPropertyValue(ft));
|
|
973
|
-
else
|
|
974
|
-
z(p);
|
|
975
|
-
if (g)
|
|
976
|
-
if (Xt && Pt)
|
|
977
|
-
for (const ft of C)
|
|
978
|
-
g.style.setProperty(ft, Pt.getPropertyValue(ft));
|
|
979
|
-
else
|
|
980
|
-
z(g);
|
|
981
|
-
K = requestAnimationFrame(B);
|
|
982
|
-
};
|
|
983
|
-
return B(), () => {
|
|
984
|
-
cancelAnimationFrame(K), z(p), z(g), p && p.style.removeProperty("will-change"), g && g.style.removeProperty("will-change");
|
|
999
|
+
k(), A(), t?.removeAttribute("data-flemo-bar-riding"), f?.removeAttribute("data-flemo-bar-riding");
|
|
985
1000
|
};
|
|
986
|
-
}, [
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
pt,
|
|
991
|
-
b,
|
|
992
|
-
d,
|
|
993
|
-
l
|
|
994
|
-
]);
|
|
995
|
-
const le = (() => {
|
|
996
|
-
if (!b) return {};
|
|
997
|
-
if (M !== "PUSHING" && M !== "REPLACING") return {};
|
|
1001
|
+
}, [Xt, D, d, vt, Tt]);
|
|
1002
|
+
const pe = (() => {
|
|
1003
|
+
if (!D) return {};
|
|
1004
|
+
if (B !== "PUSHING" && B !== "REPLACING") return {};
|
|
998
1005
|
const t = {};
|
|
999
|
-
return typeof
|
|
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;
|
|
1000
1007
|
})();
|
|
1001
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ Ht(
|
|
1002
1009
|
"div",
|
|
1003
1010
|
{
|
|
1004
|
-
ref:
|
|
1011
|
+
ref: Vt,
|
|
1005
1012
|
style: {
|
|
1006
1013
|
position: "fixed",
|
|
1007
1014
|
top: 0,
|
|
@@ -1019,7 +1026,7 @@ function Ve({
|
|
|
1019
1026
|
overscrollBehavior: "contain"
|
|
1020
1027
|
},
|
|
1021
1028
|
children: [
|
|
1022
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ N(
|
|
1023
1030
|
"div",
|
|
1024
1031
|
{
|
|
1025
1032
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1033,31 +1040,31 @@ function Ve({
|
|
|
1033
1040
|
}
|
|
1034
1041
|
}
|
|
1035
1042
|
),
|
|
1036
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ Ht(
|
|
1037
1044
|
"div",
|
|
1038
1045
|
{
|
|
1039
|
-
ref:
|
|
1040
|
-
|
|
1041
|
-
onPointerDown:
|
|
1042
|
-
onPointerMove:
|
|
1043
|
-
onPointerUp:
|
|
1044
|
-
onPointerCancel:
|
|
1046
|
+
ref: V,
|
|
1047
|
+
...$,
|
|
1048
|
+
onPointerDown: le,
|
|
1049
|
+
onPointerMove: de,
|
|
1050
|
+
onPointerUp: jt,
|
|
1051
|
+
onPointerCancel: jt,
|
|
1045
1052
|
"data-flemo-screen": !0,
|
|
1046
|
-
"data-flemo-transition":
|
|
1047
|
-
"data-flemo-status":
|
|
1048
|
-
"data-flemo-active":
|
|
1053
|
+
"data-flemo-transition": Y,
|
|
1054
|
+
"data-flemo-status": B,
|
|
1055
|
+
"data-flemo-active": D ? "true" : "false",
|
|
1049
1056
|
style: {
|
|
1050
1057
|
display: "flex",
|
|
1051
1058
|
flexDirection: "column",
|
|
1052
1059
|
height: "100%",
|
|
1053
|
-
backgroundColor:
|
|
1060
|
+
backgroundColor: y,
|
|
1054
1061
|
overflowY: R ? void 0 : "auto",
|
|
1055
|
-
touchAction:
|
|
1056
|
-
...
|
|
1057
|
-
|
|
1062
|
+
touchAction: p === "x" ? "pan-y" : p === "y" ? "pan-x" : "auto",
|
|
1063
|
+
...pe,
|
|
1064
|
+
...$.style
|
|
1058
1065
|
},
|
|
1059
1066
|
children: [
|
|
1060
|
-
!m && e && /* @__PURE__ */
|
|
1067
|
+
!m && e && /* @__PURE__ */ N("div", { style: { minHeight: e }, children: /* @__PURE__ */ N(
|
|
1061
1068
|
"div",
|
|
1062
1069
|
{
|
|
1063
1070
|
style: {
|
|
@@ -1065,21 +1072,21 @@ function Ve({
|
|
|
1065
1072
|
top: 0,
|
|
1066
1073
|
width: "100%",
|
|
1067
1074
|
minHeight: e,
|
|
1068
|
-
backgroundColor:
|
|
1075
|
+
backgroundColor: r
|
|
1069
1076
|
}
|
|
1070
1077
|
}
|
|
1071
1078
|
) }),
|
|
1072
|
-
i && /* @__PURE__ */
|
|
1079
|
+
i && /* @__PURE__ */ N(
|
|
1073
1080
|
"div",
|
|
1074
1081
|
{
|
|
1075
1082
|
style: {
|
|
1076
1083
|
width: "100%",
|
|
1077
|
-
minHeight:
|
|
1084
|
+
minHeight: U
|
|
1078
1085
|
}
|
|
1079
1086
|
}
|
|
1080
1087
|
),
|
|
1081
|
-
|
|
1082
|
-
/* @__PURE__ */
|
|
1088
|
+
T,
|
|
1089
|
+
/* @__PURE__ */ N(
|
|
1083
1090
|
"div",
|
|
1084
1091
|
{
|
|
1085
1092
|
style: {
|
|
@@ -1091,25 +1098,25 @@ function Ve({
|
|
|
1091
1098
|
children: n
|
|
1092
1099
|
}
|
|
1093
1100
|
),
|
|
1094
|
-
|
|
1095
|
-
s && /* @__PURE__ */
|
|
1101
|
+
E,
|
|
1102
|
+
s && /* @__PURE__ */ N(
|
|
1096
1103
|
"div",
|
|
1097
1104
|
{
|
|
1098
1105
|
style: {
|
|
1099
|
-
display:
|
|
1106
|
+
display: b ? "none" : void 0,
|
|
1100
1107
|
width: "100%",
|
|
1101
|
-
minHeight:
|
|
1108
|
+
minHeight: H
|
|
1102
1109
|
}
|
|
1103
1110
|
}
|
|
1104
1111
|
),
|
|
1105
|
-
!x && a && /* @__PURE__ */
|
|
1112
|
+
!x && a && /* @__PURE__ */ N(
|
|
1106
1113
|
"div",
|
|
1107
1114
|
{
|
|
1108
1115
|
style: {
|
|
1109
|
-
display:
|
|
1116
|
+
display: b ? "none" : void 0,
|
|
1110
1117
|
minHeight: a
|
|
1111
1118
|
},
|
|
1112
|
-
children: /* @__PURE__ */
|
|
1119
|
+
children: /* @__PURE__ */ N(
|
|
1113
1120
|
"div",
|
|
1114
1121
|
{
|
|
1115
1122
|
style: {
|
|
@@ -1126,14 +1133,14 @@ function Ve({
|
|
|
1126
1133
|
]
|
|
1127
1134
|
}
|
|
1128
1135
|
),
|
|
1129
|
-
i && /* @__PURE__ */
|
|
1136
|
+
i && /* @__PURE__ */ N(
|
|
1130
1137
|
"div",
|
|
1131
1138
|
{
|
|
1132
|
-
ref:
|
|
1139
|
+
ref: gt,
|
|
1133
1140
|
"data-flemo-bar": "app",
|
|
1134
|
-
"data-flemo-bar-transition":
|
|
1135
|
-
"data-flemo-bar-status":
|
|
1136
|
-
"data-flemo-bar-active":
|
|
1141
|
+
"data-flemo-bar-transition": Y,
|
|
1142
|
+
"data-flemo-bar-status": B,
|
|
1143
|
+
"data-flemo-bar-active": D ? "true" : "false",
|
|
1137
1144
|
style: {
|
|
1138
1145
|
position: "fixed",
|
|
1139
1146
|
top: m ? 0 : e,
|
|
@@ -1144,16 +1151,16 @@ function Ve({
|
|
|
1144
1151
|
children: i
|
|
1145
1152
|
}
|
|
1146
1153
|
),
|
|
1147
|
-
s && /* @__PURE__ */
|
|
1154
|
+
s && /* @__PURE__ */ N(
|
|
1148
1155
|
"div",
|
|
1149
1156
|
{
|
|
1150
|
-
ref:
|
|
1157
|
+
ref: wt,
|
|
1151
1158
|
"data-flemo-bar": "nav",
|
|
1152
|
-
"data-flemo-bar-transition":
|
|
1153
|
-
"data-flemo-bar-status":
|
|
1154
|
-
"data-flemo-bar-active":
|
|
1159
|
+
"data-flemo-bar-transition": Y,
|
|
1160
|
+
"data-flemo-bar-status": B,
|
|
1161
|
+
"data-flemo-bar-active": D ? "true" : "false",
|
|
1155
1162
|
style: {
|
|
1156
|
-
display:
|
|
1163
|
+
display: b ? "none" : void 0,
|
|
1157
1164
|
position: "fixed",
|
|
1158
1165
|
bottom: x ? 0 : a,
|
|
1159
1166
|
left: 0,
|
|
@@ -1163,8 +1170,8 @@ function Ve({
|
|
|
1163
1170
|
children: s
|
|
1164
1171
|
}
|
|
1165
1172
|
),
|
|
1166
|
-
|
|
1167
|
-
/* @__PURE__ */
|
|
1173
|
+
w && /* @__PURE__ */ N(He, { ref: q }),
|
|
1174
|
+
/* @__PURE__ */ N(
|
|
1168
1175
|
"div",
|
|
1169
1176
|
{
|
|
1170
1177
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1182,26 +1189,26 @@ function Ve({
|
|
|
1182
1189
|
}
|
|
1183
1190
|
);
|
|
1184
1191
|
}
|
|
1185
|
-
function
|
|
1186
|
-
const { isActive:
|
|
1187
|
-
return /* @__PURE__ */
|
|
1192
|
+
function Je({ children: n, ...e }) {
|
|
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 }) });
|
|
1188
1195
|
}
|
|
1189
1196
|
export {
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1197
|
+
qe as Route,
|
|
1198
|
+
Fe as Router,
|
|
1199
|
+
Je as Screen,
|
|
1200
|
+
ne as ScreenContext,
|
|
1201
|
+
He as ScreenDecorator,
|
|
1202
|
+
Ce as ScreenFreeze,
|
|
1196
1203
|
Ve as ScreenMotion,
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1204
|
+
tn as createDecorator,
|
|
1205
|
+
en as createRawDecorator,
|
|
1206
|
+
nn as createRawTransition,
|
|
1207
|
+
rn as createTransition,
|
|
1208
|
+
ze as useNavigate,
|
|
1209
|
+
We as useParams,
|
|
1210
|
+
mt as useScreen,
|
|
1211
|
+
Q as useScreenStore,
|
|
1212
|
+
Ke as useStep,
|
|
1206
1213
|
Ge as useViewportScrollHeight
|
|
1207
1214
|
};
|