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