@flemo/core 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/history/store.d.ts +4 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +822 -1046
- package/dist/navigate/store.d.ts +4 -3
- package/dist/transition/store.d.ts +4 -3
- package/dist/utils/findScrollable.d.ts +1 -1
- package/package.json +11 -11
package/dist/index.mjs
CHANGED
|
@@ -1,1061 +1,837 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
class
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
1
|
+
import { createStore as e } from "zustand/vanilla";
|
|
2
|
+
import { match as t, pathToRegexp as n } from "path-to-regexp";
|
|
3
|
+
var r = new class {
|
|
4
|
+
tasks = /* @__PURE__ */ new Map();
|
|
5
|
+
instanceId = Date.now().toString();
|
|
6
|
+
isLocked = !1;
|
|
7
|
+
currentTaskId = null;
|
|
8
|
+
taskQueue = Promise.resolve();
|
|
9
|
+
signalListeners = /* @__PURE__ */ new Map();
|
|
10
|
+
pendingTaskQueue = [];
|
|
11
|
+
isProcessingPending = !1;
|
|
12
|
+
async acquireLock(e) {
|
|
13
|
+
for (let t = 0; t < 10; t++) {
|
|
14
|
+
if (!this.isLocked) return this.isLocked = !0, this.currentTaskId = e, !0;
|
|
15
|
+
await new Promise((e) => setTimeout(e, 100));
|
|
16
|
+
}
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
releaseLock(e) {
|
|
20
|
+
this.currentTaskId === e && (this.isLocked = !1, this.currentTaskId = null);
|
|
21
|
+
}
|
|
22
|
+
generateTaskId() {
|
|
23
|
+
return `${this.instanceId}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
24
|
+
}
|
|
25
|
+
emitSignal(e) {
|
|
26
|
+
let t = this.signalListeners.get(e);
|
|
27
|
+
t && (t.forEach((e) => {
|
|
28
|
+
this.resolveTask(e);
|
|
29
|
+
}), this.signalListeners.delete(e));
|
|
30
|
+
}
|
|
31
|
+
async processPendingTasks() {
|
|
32
|
+
if (!(this.isProcessingPending || this.pendingTaskQueue.length === 0)) {
|
|
33
|
+
this.isProcessingPending = !0;
|
|
34
|
+
try {
|
|
35
|
+
for (; this.pendingTaskQueue.length > 0;) {
|
|
36
|
+
let e = this.pendingTaskQueue[0];
|
|
37
|
+
if (e.status === "COMPLETED" || e.status === "FAILED" || e.status === "ROLLEDBACK") {
|
|
38
|
+
this.pendingTaskQueue.shift();
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (e.status === "MANUAL_PENDING" || e.status === "SIGNAL_PENDING" || e.status === "PROCESSING" || e.status === "PENDING") break;
|
|
42
|
+
}
|
|
43
|
+
} finally {
|
|
44
|
+
this.isProcessingPending = !1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async waitForPendingTasks() {
|
|
49
|
+
return new Promise((e) => {
|
|
50
|
+
let t = () => {
|
|
51
|
+
this.pendingTaskQueue.filter((e) => e.status === "MANUAL_PENDING" || e.status === "SIGNAL_PENDING").length === 0 ? e() : setTimeout(t, 100);
|
|
52
|
+
};
|
|
53
|
+
t();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async onTaskStatusChange(e, t) {
|
|
57
|
+
(t === "COMPLETED" || t === "FAILED" || t === "ROLLEDBACK") && (this.pendingTaskQueue = this.pendingTaskQueue.filter((t) => t.id !== e), await this.processPendingTasks());
|
|
58
|
+
}
|
|
59
|
+
async addTask(e, t = {}) {
|
|
60
|
+
let n = t.id || this.generateTaskId();
|
|
61
|
+
return new Promise((r, i) => {
|
|
62
|
+
this.taskQueue = this.taskQueue.then(async () => {
|
|
63
|
+
try {
|
|
64
|
+
let { control: a, validate: o, rollback: s, dependencies: c = [], delay: l } = t, u = new AbortController(), d = {
|
|
65
|
+
id: n,
|
|
66
|
+
execute: e,
|
|
67
|
+
timestamp: Date.now(),
|
|
68
|
+
retryCount: 0,
|
|
69
|
+
status: "PENDING",
|
|
70
|
+
dependencies: c,
|
|
71
|
+
instanceId: this.instanceId,
|
|
72
|
+
validate: o,
|
|
73
|
+
rollback: s,
|
|
74
|
+
control: a,
|
|
75
|
+
abortController: u
|
|
76
|
+
};
|
|
77
|
+
this.tasks.set(d.id, d), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(d), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((e) => e.id !== d.id));
|
|
78
|
+
try {
|
|
79
|
+
if (!await this.acquireLock(d.id)) throw d.status = "FAILED", Error("FAILED");
|
|
80
|
+
try {
|
|
81
|
+
d.status = "PROCESSING";
|
|
82
|
+
for (let e of d.dependencies) {
|
|
83
|
+
let t = this.tasks.get(e);
|
|
84
|
+
if (!t || t.status !== "COMPLETED") throw d.status = "FAILED", Error("FAILED");
|
|
85
|
+
}
|
|
86
|
+
if (d.validate && !await d.validate()) throw d.status = "FAILED", Error("FAILED");
|
|
87
|
+
l && l > 0 && await new Promise((e) => setTimeout(e, l));
|
|
88
|
+
let e = await d.execute(d.abortController);
|
|
89
|
+
if (d.abortController.signal.aborted) {
|
|
90
|
+
d.status = "COMPLETED", await this.onTaskStatusChange(d.id, "COMPLETED"), r({
|
|
91
|
+
success: !0,
|
|
92
|
+
result: void 0,
|
|
93
|
+
taskId: d.id,
|
|
94
|
+
timestamp: Date.now(),
|
|
95
|
+
instanceId: this.instanceId
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (t.control) {
|
|
100
|
+
let n = t.control;
|
|
101
|
+
if (n.delay && n.delay > 0 && await new Promise((e) => setTimeout(e, n.delay)), n.manual) {
|
|
102
|
+
d.status = "MANUAL_PENDING", d.manualResolver = {
|
|
103
|
+
resolve: r,
|
|
104
|
+
reject: i,
|
|
105
|
+
result: e
|
|
106
|
+
}, this.pendingTaskQueue.push(d), await this.onTaskStatusChange(d.id, "MANUAL_PENDING");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (n.signal) {
|
|
110
|
+
d.status = "SIGNAL_PENDING", d.manualResolver = {
|
|
111
|
+
resolve: r,
|
|
112
|
+
reject: i,
|
|
113
|
+
result: e
|
|
114
|
+
}, this.signalListeners.has(n.signal) || this.signalListeners.set(n.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(n.signal).add(d.id), this.pendingTaskQueue.push(d), await this.onTaskStatusChange(d.id, "SIGNAL_PENDING");
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (n.condition && !await n.condition()) {
|
|
118
|
+
d.status = "MANUAL_PENDING", d.manualResolver = {
|
|
119
|
+
resolve: r,
|
|
120
|
+
reject: i,
|
|
121
|
+
result: e
|
|
122
|
+
}, this.pendingTaskQueue.push(d), await this.onTaskStatusChange(d.id, "MANUAL_PENDING");
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
d.status = "COMPLETED", await this.onTaskStatusChange(d.id, "COMPLETED"), r({
|
|
127
|
+
success: !0,
|
|
128
|
+
result: e,
|
|
129
|
+
taskId: d.id,
|
|
130
|
+
timestamp: Date.now(),
|
|
131
|
+
instanceId: this.instanceId
|
|
132
|
+
});
|
|
133
|
+
} catch (e) {
|
|
134
|
+
if (d.status = "FAILED", d.rollback) try {
|
|
135
|
+
await d.rollback(), d.status = "ROLLEDBACK";
|
|
136
|
+
} catch {}
|
|
137
|
+
throw await this.onTaskStatusChange(d.id, d.status), e;
|
|
138
|
+
} finally {
|
|
139
|
+
this.releaseLock(d.id);
|
|
140
|
+
}
|
|
141
|
+
} catch (e) {
|
|
142
|
+
i(e);
|
|
143
|
+
}
|
|
144
|
+
} catch (e) {
|
|
145
|
+
i(e);
|
|
146
|
+
}
|
|
147
|
+
}).catch(i);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async resolveTask(e) {
|
|
151
|
+
let t = this.tasks.get(e);
|
|
152
|
+
if (!t || t.status !== "MANUAL_PENDING" && t.status !== "SIGNAL_PENDING") return !1;
|
|
153
|
+
if (t.manualResolver) {
|
|
154
|
+
if (t.control?.condition && !await t.control.condition()) return !1;
|
|
155
|
+
t.status = "COMPLETED";
|
|
156
|
+
let n = t.manualResolver;
|
|
157
|
+
return n.resolve({
|
|
158
|
+
success: !0,
|
|
159
|
+
result: n.result,
|
|
160
|
+
taskId: t.id,
|
|
161
|
+
timestamp: Date.now(),
|
|
162
|
+
instanceId: this.instanceId
|
|
163
|
+
}), delete t.manualResolver, await this.onTaskStatusChange(e, "COMPLETED"), !0;
|
|
164
|
+
}
|
|
165
|
+
return !1;
|
|
166
|
+
}
|
|
167
|
+
async resolveAllPending() {
|
|
168
|
+
let e = Array.from(this.tasks.values()).filter((e) => [
|
|
169
|
+
"PENDING",
|
|
170
|
+
"MANUAL_PENDING",
|
|
171
|
+
"SIGNAL_PENDING"
|
|
172
|
+
].includes(e.status));
|
|
173
|
+
await Promise.all(e.map((e) => this.resolveTask(e.id)));
|
|
174
|
+
}
|
|
175
|
+
}();
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/history/store.ts
|
|
178
|
+
function i(t = [], n = -1) {
|
|
179
|
+
return e((e) => ({
|
|
180
|
+
index: n,
|
|
181
|
+
histories: t,
|
|
182
|
+
addHistory: (t) => e((e) => ({
|
|
183
|
+
index: e.index + 1,
|
|
184
|
+
histories: e.histories.concat(t)
|
|
185
|
+
})),
|
|
186
|
+
replaceHistory: (t) => e((e) => (e.histories.splice(t, 1), {
|
|
187
|
+
index: e.index - 1,
|
|
188
|
+
histories: e.histories
|
|
189
|
+
})),
|
|
190
|
+
popHistory: (t) => e((e) => ({
|
|
191
|
+
index: e.index - 1,
|
|
192
|
+
histories: e.histories.filter((e, n) => n !== t)
|
|
193
|
+
})),
|
|
194
|
+
popHistories: (t) => {
|
|
195
|
+
t <= 0 || e((e) => {
|
|
196
|
+
let n = e.index;
|
|
197
|
+
return {
|
|
198
|
+
index: e.index - t,
|
|
199
|
+
histories: e.histories.filter((e, r) => r < n - t || r >= n)
|
|
200
|
+
};
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
setTransitionName: (t, n) => e((e) => {
|
|
204
|
+
let r = e.histories[t];
|
|
205
|
+
if (!r || r.transitionName === n) return {};
|
|
206
|
+
let i = e.histories.slice();
|
|
207
|
+
return i[t] = {
|
|
208
|
+
...r,
|
|
209
|
+
transitionName: n
|
|
210
|
+
}, { histories: i };
|
|
211
|
+
})
|
|
212
|
+
}));
|
|
175
213
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
histories: e.histories
|
|
186
|
-
})),
|
|
187
|
-
popHistory: (t) => n((e) => ({
|
|
188
|
-
index: e.index - 1,
|
|
189
|
-
histories: e.histories.filter((s, a) => a !== t)
|
|
190
|
-
})),
|
|
191
|
-
// Drop `count` entries sitting directly below the current top, keeping the
|
|
192
|
-
// top itself. Used by pop(n) to remove the screens it skips over in the same
|
|
193
|
-
// synchronous block that starts the transition — so they never paint — while
|
|
194
|
-
// the leaving top stays mounted to drive and resolve the animation.
|
|
195
|
-
popHistories: (t) => {
|
|
196
|
-
t <= 0 || n((e) => {
|
|
197
|
-
const s = e.index;
|
|
198
|
-
return {
|
|
199
|
-
index: e.index - t,
|
|
200
|
-
histories: e.histories.filter((a, r) => r < s - t || r >= s)
|
|
201
|
-
};
|
|
202
|
-
});
|
|
203
|
-
},
|
|
204
|
-
// Override one entry's transition. Used by pop() to relabel the leaving top
|
|
205
|
-
// before the POPPING flip so the back animation uses the caller's
|
|
206
|
-
// `transitionName` from the first frame — its original transition never
|
|
207
|
-
// paints. Returns a fresh array so the renderer re-reads it.
|
|
208
|
-
setTransitionName: (t, e) => n((s) => {
|
|
209
|
-
const a = s.histories[t];
|
|
210
|
-
if (!a || a.transitionName === e) return {};
|
|
211
|
-
const r = s.histories.slice();
|
|
212
|
-
return r[t] = { ...a, transitionName: e }, { histories: r };
|
|
213
|
-
})
|
|
214
|
-
})), gt = w((n) => ({
|
|
215
|
-
status: "IDLE",
|
|
216
|
-
transitionTaskId: null,
|
|
217
|
-
setStatus: (t) => n({ status: t }),
|
|
218
|
-
setTransitionTaskId: (t) => n({ transitionTaskId: t })
|
|
219
|
-
}));
|
|
220
|
-
let L = 0;
|
|
221
|
-
function It() {
|
|
222
|
-
L += 1;
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/navigate/store.ts
|
|
216
|
+
function a() {
|
|
217
|
+
return e((e) => ({
|
|
218
|
+
status: "IDLE",
|
|
219
|
+
transitionTaskId: null,
|
|
220
|
+
setStatus: (t) => e({ status: t }),
|
|
221
|
+
setTransitionTaskId: (t) => e({ transitionTaskId: t })
|
|
222
|
+
}));
|
|
223
223
|
}
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/navigate/selfPopGuard.ts
|
|
226
|
+
var o = 0;
|
|
227
|
+
function s() {
|
|
228
|
+
o += 1;
|
|
226
229
|
}
|
|
227
|
-
function
|
|
228
|
-
|
|
229
|
-
initial: t,
|
|
230
|
-
idle: e,
|
|
231
|
-
enter: s,
|
|
232
|
-
enterBack: a,
|
|
233
|
-
exit: r,
|
|
234
|
-
exitBack: o,
|
|
235
|
-
options: c
|
|
236
|
-
}) {
|
|
237
|
-
return {
|
|
238
|
-
name: n,
|
|
239
|
-
initial: t,
|
|
240
|
-
variants: {
|
|
241
|
-
"IDLE-true": e,
|
|
242
|
-
"IDLE-false": e,
|
|
243
|
-
"PUSHING-false": r,
|
|
244
|
-
"PUSHING-true": s,
|
|
245
|
-
"REPLACING-false": r,
|
|
246
|
-
"REPLACING-true": s,
|
|
247
|
-
"POPPING-false": o,
|
|
248
|
-
"POPPING-true": a,
|
|
249
|
-
"COMPLETED-false": r,
|
|
250
|
-
"COMPLETED-true": s
|
|
251
|
-
},
|
|
252
|
-
...c
|
|
253
|
-
};
|
|
230
|
+
function c() {
|
|
231
|
+
return o > 0 ? (--o, !0) : !1;
|
|
254
232
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
"PUSHING-false": a,
|
|
276
|
-
"PUSHING-true": s,
|
|
277
|
-
"REPLACING-false": o,
|
|
278
|
-
"REPLACING-true": r,
|
|
279
|
-
"POPPING-false": l,
|
|
280
|
-
"POPPING-true": c,
|
|
281
|
-
"COMPLETED-false": u,
|
|
282
|
-
"COMPLETED-true": d
|
|
283
|
-
},
|
|
284
|
-
...m
|
|
285
|
-
};
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/transition/createTransition.ts
|
|
235
|
+
function l({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
236
|
+
return {
|
|
237
|
+
name: e,
|
|
238
|
+
initial: t,
|
|
239
|
+
variants: {
|
|
240
|
+
"IDLE-true": n,
|
|
241
|
+
"IDLE-false": n,
|
|
242
|
+
"PUSHING-false": a,
|
|
243
|
+
"PUSHING-true": r,
|
|
244
|
+
"REPLACING-false": a,
|
|
245
|
+
"REPLACING-true": r,
|
|
246
|
+
"POPPING-false": o,
|
|
247
|
+
"POPPING-true": i,
|
|
248
|
+
"COMPLETED-false": a,
|
|
249
|
+
"COMPLETED-true": r
|
|
250
|
+
},
|
|
251
|
+
...s
|
|
252
|
+
};
|
|
286
253
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
x: 0
|
|
308
|
-
},
|
|
309
|
-
options: {
|
|
310
|
-
duration: 0.7,
|
|
311
|
-
ease: [0.32, 0.72, 0, 1]
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
enterBack: {
|
|
315
|
-
value: {
|
|
316
|
-
x: "100%"
|
|
317
|
-
},
|
|
318
|
-
options: {
|
|
319
|
-
duration: 0.6,
|
|
320
|
-
ease: [0.32, 0.72, 0, 1]
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
exit: {
|
|
324
|
-
value: {
|
|
325
|
-
x: "-30%"
|
|
326
|
-
},
|
|
327
|
-
options: {
|
|
328
|
-
duration: 0.7,
|
|
329
|
-
ease: [0.32, 0.72, 0, 1]
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
exitBack: {
|
|
333
|
-
value: {
|
|
334
|
-
x: 0
|
|
335
|
-
},
|
|
336
|
-
options: {
|
|
337
|
-
duration: 0.6,
|
|
338
|
-
ease: [0.32, 0.72, 0, 1]
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
options: {
|
|
342
|
-
decoratorName: "overlay",
|
|
343
|
-
swipeDirection: "x",
|
|
344
|
-
onSwipeStart: async () => !0,
|
|
345
|
-
onSwipe: (n, t, { animate: e, currentScreen: s, prevScreen: a, onProgress: r }) => {
|
|
346
|
-
const { offset: o } = t, c = o.x, l = X(c, [0, window.innerWidth], [0, 100]);
|
|
347
|
-
return r?.(!0, l), e(
|
|
348
|
-
s,
|
|
349
|
-
{
|
|
350
|
-
x: Math.max(0, c)
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
duration: 0
|
|
354
|
-
}
|
|
355
|
-
), e(
|
|
356
|
-
a,
|
|
357
|
-
{
|
|
358
|
-
x: `${-30 + l * 0.3}%`
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
duration: 0
|
|
362
|
-
}
|
|
363
|
-
), l;
|
|
364
|
-
},
|
|
365
|
-
onSwipeEnd: async (n, t, { animate: e, currentScreen: s, prevScreen: a, onStart: r }) => {
|
|
366
|
-
const { offset: o, velocity: c } = t, u = o.x > 50 || c.x > 20;
|
|
367
|
-
return r?.(u), await Promise.all([
|
|
368
|
-
e(
|
|
369
|
-
s,
|
|
370
|
-
{
|
|
371
|
-
x: u ? "100%" : 0
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
duration: 0.3,
|
|
375
|
-
ease: [0.32, 0.72, 0, 1]
|
|
376
|
-
}
|
|
377
|
-
),
|
|
378
|
-
e(
|
|
379
|
-
a,
|
|
380
|
-
{
|
|
381
|
-
x: u ? 0 : "-30%"
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
duration: 0.3,
|
|
385
|
-
ease: [0.32, 0.72, 0, 1]
|
|
386
|
-
}
|
|
387
|
-
)
|
|
388
|
-
]), u;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}), z = (n, t, e) => {
|
|
392
|
-
const [s, a] = t, [r, o] = e;
|
|
393
|
-
if (a === s) return r;
|
|
394
|
-
const c = (n - s) / (a - s);
|
|
395
|
-
return r + c * (o - r);
|
|
396
|
-
}, V = T({
|
|
397
|
-
name: "layout",
|
|
398
|
-
initial: {
|
|
399
|
-
opacity: 0.97
|
|
400
|
-
},
|
|
401
|
-
idle: {
|
|
402
|
-
value: {
|
|
403
|
-
opacity: 1
|
|
404
|
-
},
|
|
405
|
-
options: {
|
|
406
|
-
duration: 0.3
|
|
407
|
-
}
|
|
408
|
-
},
|
|
409
|
-
enter: {
|
|
410
|
-
value: {
|
|
411
|
-
opacity: 1
|
|
412
|
-
},
|
|
413
|
-
options: {
|
|
414
|
-
duration: 0.3
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
enterBack: {
|
|
418
|
-
value: {
|
|
419
|
-
opacity: 0.97
|
|
420
|
-
},
|
|
421
|
-
options: {
|
|
422
|
-
duration: 0.3
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
exit: {
|
|
426
|
-
value: {
|
|
427
|
-
opacity: 0.97
|
|
428
|
-
},
|
|
429
|
-
options: {
|
|
430
|
-
duration: 0.3
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
exitBack: {
|
|
434
|
-
value: {
|
|
435
|
-
opacity: 1
|
|
436
|
-
},
|
|
437
|
-
options: {
|
|
438
|
-
duration: 0.3
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
options: {
|
|
442
|
-
decoratorName: "overlay",
|
|
443
|
-
swipeDirection: "y",
|
|
444
|
-
onSwipeStart: async () => !0,
|
|
445
|
-
onSwipe: (n, t, { animate: e, currentScreen: s, onProgress: a }) => {
|
|
446
|
-
const { offset: r } = t, o = r.y, c = Math.max(0, Math.min(56, o)), l = z(c, [0, 56], [1, 0.96]), u = Math.max(0, o - 56), d = Math.min(1, u / 160), m = Math.sqrt(d) * 12, i = Math.max(0, c + m), p = Math.min(56, i);
|
|
447
|
-
return a?.(!0, 100), e(
|
|
448
|
-
s,
|
|
449
|
-
{
|
|
450
|
-
y: i,
|
|
451
|
-
opacity: l
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
duration: 0
|
|
455
|
-
}
|
|
456
|
-
), p;
|
|
457
|
-
},
|
|
458
|
-
onSwipeEnd: async (n, t, { animate: e, currentScreen: s, prevScreen: a, onStart: r }) => {
|
|
459
|
-
const { offset: o, velocity: c } = t, u = o.y > 56 || c.y > 20;
|
|
460
|
-
return r?.(u), await Promise.all([
|
|
461
|
-
e(
|
|
462
|
-
s,
|
|
463
|
-
{
|
|
464
|
-
y: u ? "100%" : 0,
|
|
465
|
-
opacity: u ? 0.96 : 1
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
duration: 0.3
|
|
469
|
-
}
|
|
470
|
-
),
|
|
471
|
-
e(
|
|
472
|
-
a,
|
|
473
|
-
{
|
|
474
|
-
y: 0,
|
|
475
|
-
opacity: u ? 1 : 0.97
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
duration: 0.3
|
|
479
|
-
}
|
|
480
|
-
)
|
|
481
|
-
]), u;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}), Z = T({
|
|
485
|
-
name: "material",
|
|
486
|
-
initial: {
|
|
487
|
-
y: "100%"
|
|
488
|
-
},
|
|
489
|
-
idle: {
|
|
490
|
-
value: {
|
|
491
|
-
y: 0,
|
|
492
|
-
opacity: 1
|
|
493
|
-
},
|
|
494
|
-
options: {
|
|
495
|
-
duration: 0
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
enter: {
|
|
499
|
-
value: {
|
|
500
|
-
y: 0
|
|
501
|
-
},
|
|
502
|
-
options: {
|
|
503
|
-
duration: 0.35,
|
|
504
|
-
ease: [0, 0, 0.2, 1]
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
enterBack: {
|
|
508
|
-
value: {
|
|
509
|
-
y: "100%"
|
|
510
|
-
},
|
|
511
|
-
options: {
|
|
512
|
-
duration: 0.25,
|
|
513
|
-
ease: [0.4, 0, 1, 1]
|
|
514
|
-
}
|
|
515
|
-
},
|
|
516
|
-
exit: {
|
|
517
|
-
value: {
|
|
518
|
-
y: -56,
|
|
519
|
-
opacity: 0
|
|
520
|
-
},
|
|
521
|
-
options: {
|
|
522
|
-
duration: 0.35,
|
|
523
|
-
ease: [0.4, 0, 1, 1]
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
exitBack: {
|
|
527
|
-
value: {
|
|
528
|
-
y: 0,
|
|
529
|
-
opacity: 1
|
|
530
|
-
},
|
|
531
|
-
options: {
|
|
532
|
-
duration: 0.25,
|
|
533
|
-
ease: [0, 0, 0.2, 1]
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
options: {
|
|
537
|
-
swipeDirection: "y",
|
|
538
|
-
onSwipeStart: async () => !0,
|
|
539
|
-
onSwipe: (n, t, { animate: e, currentScreen: s, prevScreen: a, onProgress: r }) => {
|
|
540
|
-
const { offset: o } = t, c = o.y, l = Math.max(0, Math.min(56, c)), u = Math.max(0, c - 56), d = Math.min(1, u / 160), m = Math.sqrt(d) * 12, i = Math.max(0, l + m), p = Math.min(56, i);
|
|
541
|
-
return r?.(!0, p), e(
|
|
542
|
-
s,
|
|
543
|
-
{
|
|
544
|
-
y: i
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
duration: 0
|
|
548
|
-
}
|
|
549
|
-
), e(
|
|
550
|
-
a,
|
|
551
|
-
{
|
|
552
|
-
y: -56 + p,
|
|
553
|
-
opacity: p / 56
|
|
554
|
-
},
|
|
555
|
-
{ duration: 0 }
|
|
556
|
-
), p;
|
|
557
|
-
},
|
|
558
|
-
onSwipeEnd: async (n, t, { animate: e, currentScreen: s, prevScreen: a, onStart: r }) => {
|
|
559
|
-
const { offset: o, velocity: c } = t, u = o.y > 56 || c.y > 20;
|
|
560
|
-
return r?.(u), await Promise.all([
|
|
561
|
-
e(
|
|
562
|
-
s,
|
|
563
|
-
{
|
|
564
|
-
y: u ? "100%" : 0
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
duration: u ? 0.22 : 0.24,
|
|
568
|
-
ease: u ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
|
|
569
|
-
}
|
|
570
|
-
),
|
|
571
|
-
e(
|
|
572
|
-
a,
|
|
573
|
-
{
|
|
574
|
-
y: u ? 0 : -56,
|
|
575
|
-
opacity: u ? 1 : 0
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
duration: u ? 0.22 : 0.24,
|
|
579
|
-
ease: u ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
|
|
580
|
-
}
|
|
581
|
-
)
|
|
582
|
-
]), u;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}), j = T({
|
|
586
|
-
name: "none",
|
|
587
|
-
initial: {},
|
|
588
|
-
idle: {
|
|
589
|
-
value: {},
|
|
590
|
-
options: {
|
|
591
|
-
duration: 0
|
|
592
|
-
}
|
|
593
|
-
},
|
|
594
|
-
enter: {
|
|
595
|
-
value: {},
|
|
596
|
-
options: {
|
|
597
|
-
duration: 0
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
|
-
enterBack: {
|
|
601
|
-
value: {},
|
|
602
|
-
options: {
|
|
603
|
-
duration: 0
|
|
604
|
-
}
|
|
605
|
-
},
|
|
606
|
-
exit: {
|
|
607
|
-
value: {},
|
|
608
|
-
options: {
|
|
609
|
-
duration: 0
|
|
610
|
-
}
|
|
611
|
-
},
|
|
612
|
-
exitBack: {
|
|
613
|
-
value: {},
|
|
614
|
-
options: {
|
|
615
|
-
duration: 0
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
}), Tt = /* @__PURE__ */ new Map([
|
|
619
|
-
["none", j],
|
|
620
|
-
["cupertino", F],
|
|
621
|
-
["material", Z],
|
|
622
|
-
["layout", V]
|
|
623
|
-
]), Nt = w((n) => ({
|
|
624
|
-
defaultTransitionName: "cupertino",
|
|
625
|
-
setDefaultTransitionName: (t) => n({ defaultTransitionName: t })
|
|
626
|
-
}));
|
|
627
|
-
function K({
|
|
628
|
-
name: n,
|
|
629
|
-
initial: t,
|
|
630
|
-
idle: e,
|
|
631
|
-
enter: s,
|
|
632
|
-
exit: a,
|
|
633
|
-
options: r
|
|
634
|
-
}) {
|
|
635
|
-
return {
|
|
636
|
-
name: n,
|
|
637
|
-
initial: t,
|
|
638
|
-
variants: {
|
|
639
|
-
"IDLE-true": e,
|
|
640
|
-
"IDLE-false": e,
|
|
641
|
-
"PUSHING-true": e,
|
|
642
|
-
"PUSHING-false": s,
|
|
643
|
-
"REPLACING-true": e,
|
|
644
|
-
"REPLACING-false": s,
|
|
645
|
-
"POPPING-true": e,
|
|
646
|
-
"POPPING-false": a,
|
|
647
|
-
"COMPLETED-true": e,
|
|
648
|
-
"COMPLETED-false": s
|
|
649
|
-
},
|
|
650
|
-
...r
|
|
651
|
-
};
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/transition/createRawTransition.ts
|
|
256
|
+
function u({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
257
|
+
return {
|
|
258
|
+
name: e,
|
|
259
|
+
initial: t,
|
|
260
|
+
variants: {
|
|
261
|
+
"IDLE-true": n,
|
|
262
|
+
"IDLE-false": n,
|
|
263
|
+
"PUSHING-false": i,
|
|
264
|
+
"PUSHING-true": r,
|
|
265
|
+
"REPLACING-false": o,
|
|
266
|
+
"REPLACING-true": a,
|
|
267
|
+
"POPPING-false": c,
|
|
268
|
+
"POPPING-true": s,
|
|
269
|
+
"COMPLETED-false": l,
|
|
270
|
+
"COMPLETED-true": u
|
|
271
|
+
},
|
|
272
|
+
...d
|
|
273
|
+
};
|
|
652
274
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/transition/cupertino.ts
|
|
277
|
+
var d = (e, t, n) => {
|
|
278
|
+
let [r, i] = t, [a, o] = n;
|
|
279
|
+
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
280
|
+
}, f = l({
|
|
281
|
+
name: "cupertino",
|
|
282
|
+
initial: { x: "100%" },
|
|
283
|
+
idle: {
|
|
284
|
+
value: { x: 0 },
|
|
285
|
+
options: { duration: 0 }
|
|
286
|
+
},
|
|
287
|
+
enter: {
|
|
288
|
+
value: { x: 0 },
|
|
289
|
+
options: {
|
|
290
|
+
duration: .7,
|
|
291
|
+
ease: [
|
|
292
|
+
.32,
|
|
293
|
+
.72,
|
|
294
|
+
0,
|
|
295
|
+
1
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
enterBack: {
|
|
300
|
+
value: { x: "100%" },
|
|
301
|
+
options: {
|
|
302
|
+
duration: .6,
|
|
303
|
+
ease: [
|
|
304
|
+
.32,
|
|
305
|
+
.72,
|
|
306
|
+
0,
|
|
307
|
+
1
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
exit: {
|
|
312
|
+
value: { x: "-30%" },
|
|
313
|
+
options: {
|
|
314
|
+
duration: .7,
|
|
315
|
+
ease: [
|
|
316
|
+
.32,
|
|
317
|
+
.72,
|
|
318
|
+
0,
|
|
319
|
+
1
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
exitBack: {
|
|
324
|
+
value: { x: 0 },
|
|
325
|
+
options: {
|
|
326
|
+
duration: .6,
|
|
327
|
+
ease: [
|
|
328
|
+
.32,
|
|
329
|
+
.72,
|
|
330
|
+
0,
|
|
331
|
+
1
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
options: {
|
|
336
|
+
decoratorName: "overlay",
|
|
337
|
+
swipeDirection: "x",
|
|
338
|
+
onSwipeStart: async () => !0,
|
|
339
|
+
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
340
|
+
let { offset: o } = t, s = o.x, c = d(s, [0, window.innerWidth], [0, 100]);
|
|
341
|
+
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + c * .3}%` }, { duration: 0 }), c;
|
|
342
|
+
},
|
|
343
|
+
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
344
|
+
let { offset: o, velocity: s } = t, c = o.x > 50 || s.x > 20;
|
|
345
|
+
return a?.(c), await Promise.all([n(r, { x: c ? "100%" : 0 }, {
|
|
346
|
+
duration: .3,
|
|
347
|
+
ease: [
|
|
348
|
+
.32,
|
|
349
|
+
.72,
|
|
350
|
+
0,
|
|
351
|
+
1
|
|
352
|
+
]
|
|
353
|
+
}), n(i, { x: c ? 0 : "-30%" }, {
|
|
354
|
+
duration: .3,
|
|
355
|
+
ease: [
|
|
356
|
+
.32,
|
|
357
|
+
.72,
|
|
358
|
+
0,
|
|
359
|
+
1
|
|
360
|
+
]
|
|
361
|
+
})]), c;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}), p = (e, t, n) => {
|
|
365
|
+
let [r, i] = t, [a, o] = n;
|
|
366
|
+
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
367
|
+
}, m = l({
|
|
368
|
+
name: "layout",
|
|
369
|
+
initial: { opacity: .97 },
|
|
370
|
+
idle: {
|
|
371
|
+
value: { opacity: 1 },
|
|
372
|
+
options: { duration: .3 }
|
|
373
|
+
},
|
|
374
|
+
enter: {
|
|
375
|
+
value: { opacity: 1 },
|
|
376
|
+
options: { duration: .3 }
|
|
377
|
+
},
|
|
378
|
+
enterBack: {
|
|
379
|
+
value: { opacity: .97 },
|
|
380
|
+
options: { duration: .3 }
|
|
381
|
+
},
|
|
382
|
+
exit: {
|
|
383
|
+
value: { opacity: .97 },
|
|
384
|
+
options: { duration: .3 }
|
|
385
|
+
},
|
|
386
|
+
exitBack: {
|
|
387
|
+
value: { opacity: 1 },
|
|
388
|
+
options: { duration: .3 }
|
|
389
|
+
},
|
|
390
|
+
options: {
|
|
391
|
+
decoratorName: "overlay",
|
|
392
|
+
swipeDirection: "y",
|
|
393
|
+
onSwipeStart: async () => !0,
|
|
394
|
+
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
395
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = p(s, [0, 56], [1, .96]), l = Math.max(0, o - 56), u = Math.min(1, l / 160), d = Math.sqrt(u) * 12, f = Math.max(0, s + d), m = Math.min(56, f);
|
|
396
|
+
return i?.(!0, 100), n(r, {
|
|
397
|
+
y: f,
|
|
398
|
+
opacity: c
|
|
399
|
+
}, { duration: 0 }), m;
|
|
400
|
+
},
|
|
401
|
+
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
402
|
+
let { offset: o, velocity: s } = t, c = o.y > 56 || s.y > 20;
|
|
403
|
+
return a?.(c), await Promise.all([n(r, {
|
|
404
|
+
y: c ? "100%" : 0,
|
|
405
|
+
opacity: c ? .96 : 1
|
|
406
|
+
}, { duration: .3 }), n(i, {
|
|
407
|
+
y: 0,
|
|
408
|
+
opacity: c ? 1 : .97
|
|
409
|
+
}, { duration: .3 })]), c;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}), h = l({
|
|
413
|
+
name: "material",
|
|
414
|
+
initial: { y: "100%" },
|
|
415
|
+
idle: {
|
|
416
|
+
value: {
|
|
417
|
+
y: 0,
|
|
418
|
+
opacity: 1
|
|
419
|
+
},
|
|
420
|
+
options: { duration: 0 }
|
|
421
|
+
},
|
|
422
|
+
enter: {
|
|
423
|
+
value: { y: 0 },
|
|
424
|
+
options: {
|
|
425
|
+
duration: .35,
|
|
426
|
+
ease: [
|
|
427
|
+
0,
|
|
428
|
+
0,
|
|
429
|
+
.2,
|
|
430
|
+
1
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
enterBack: {
|
|
435
|
+
value: { y: "100%" },
|
|
436
|
+
options: {
|
|
437
|
+
duration: .25,
|
|
438
|
+
ease: [
|
|
439
|
+
.4,
|
|
440
|
+
0,
|
|
441
|
+
1,
|
|
442
|
+
1
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
exit: {
|
|
447
|
+
value: {
|
|
448
|
+
y: -56,
|
|
449
|
+
opacity: 0
|
|
450
|
+
},
|
|
451
|
+
options: {
|
|
452
|
+
duration: .35,
|
|
453
|
+
ease: [
|
|
454
|
+
.4,
|
|
455
|
+
0,
|
|
456
|
+
1,
|
|
457
|
+
1
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
exitBack: {
|
|
462
|
+
value: {
|
|
463
|
+
y: 0,
|
|
464
|
+
opacity: 1
|
|
465
|
+
},
|
|
466
|
+
options: {
|
|
467
|
+
duration: .25,
|
|
468
|
+
ease: [
|
|
469
|
+
0,
|
|
470
|
+
0,
|
|
471
|
+
.2,
|
|
472
|
+
1
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
options: {
|
|
477
|
+
swipeDirection: "y",
|
|
478
|
+
onSwipeStart: async () => !0,
|
|
479
|
+
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
480
|
+
let { offset: o } = t, s = o.y, c = Math.max(0, Math.min(56, s)), l = Math.max(0, s - 56), u = Math.min(1, l / 160), d = Math.sqrt(u) * 12, f = Math.max(0, c + d), p = Math.min(56, f);
|
|
481
|
+
return a?.(!0, p), n(r, { y: f }, { duration: 0 }), n(i, {
|
|
482
|
+
y: -56 + p,
|
|
483
|
+
opacity: p / 56
|
|
484
|
+
}, { duration: 0 }), p;
|
|
485
|
+
},
|
|
486
|
+
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
487
|
+
let { offset: o, velocity: s } = t, c = o.y > 56 || s.y > 20;
|
|
488
|
+
return a?.(c), await Promise.all([n(r, { y: c ? "100%" : 0 }, {
|
|
489
|
+
duration: c ? .22 : .24,
|
|
490
|
+
ease: c ? [
|
|
491
|
+
.4,
|
|
492
|
+
0,
|
|
493
|
+
1,
|
|
494
|
+
1
|
|
495
|
+
] : [
|
|
496
|
+
0,
|
|
497
|
+
0,
|
|
498
|
+
.2,
|
|
499
|
+
1
|
|
500
|
+
]
|
|
501
|
+
}), n(i, {
|
|
502
|
+
y: c ? 0 : -56,
|
|
503
|
+
opacity: +!!c
|
|
504
|
+
}, {
|
|
505
|
+
duration: c ? .22 : .24,
|
|
506
|
+
ease: c ? [
|
|
507
|
+
0,
|
|
508
|
+
0,
|
|
509
|
+
.2,
|
|
510
|
+
1
|
|
511
|
+
] : [
|
|
512
|
+
.4,
|
|
513
|
+
0,
|
|
514
|
+
1,
|
|
515
|
+
1
|
|
516
|
+
]
|
|
517
|
+
})]), c;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}), g = l({
|
|
521
|
+
name: "none",
|
|
522
|
+
initial: {},
|
|
523
|
+
idle: {
|
|
524
|
+
value: {},
|
|
525
|
+
options: { duration: 0 }
|
|
526
|
+
},
|
|
527
|
+
enter: {
|
|
528
|
+
value: {},
|
|
529
|
+
options: { duration: 0 }
|
|
530
|
+
},
|
|
531
|
+
enterBack: {
|
|
532
|
+
value: {},
|
|
533
|
+
options: { duration: 0 }
|
|
534
|
+
},
|
|
535
|
+
exit: {
|
|
536
|
+
value: {},
|
|
537
|
+
options: { duration: 0 }
|
|
538
|
+
},
|
|
539
|
+
exitBack: {
|
|
540
|
+
value: {},
|
|
541
|
+
options: { duration: 0 }
|
|
542
|
+
}
|
|
543
|
+
}), _ = new Map([
|
|
544
|
+
["none", g],
|
|
545
|
+
["cupertino", f],
|
|
546
|
+
["material", h],
|
|
547
|
+
["layout", m]
|
|
548
|
+
]);
|
|
549
|
+
//#endregion
|
|
550
|
+
//#region src/transition/store.ts
|
|
551
|
+
function v(t = "cupertino") {
|
|
552
|
+
return e((e) => ({
|
|
553
|
+
defaultTransitionName: t,
|
|
554
|
+
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
555
|
+
}));
|
|
684
556
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
return c.length === 0 ? "" : `${i} {
|
|
903
|
-
${E(c)}
|
|
904
|
-
animation: none;
|
|
905
|
-
}`;
|
|
906
|
-
const p = ut(n, t, e), P = [
|
|
907
|
-
`@keyframes ${p} {`,
|
|
908
|
-
" from {",
|
|
909
|
-
E(o).replace(/^/gm, " "),
|
|
910
|
-
" }",
|
|
911
|
-
" to {",
|
|
912
|
-
E(c).replace(/^/gm, " "),
|
|
913
|
-
" }",
|
|
914
|
-
"}"
|
|
915
|
-
].join(`
|
|
916
|
-
`), h = [
|
|
917
|
-
`${p}`,
|
|
918
|
-
`${l}s`,
|
|
919
|
-
d,
|
|
920
|
-
u > 0 ? `${u}s` : null,
|
|
921
|
-
"both"
|
|
922
|
-
].filter(Boolean).join(" "), f = Array.from(
|
|
923
|
-
/* @__PURE__ */ new Set([...o.map((N) => N.property), ...c.map((N) => N.property)])
|
|
924
|
-
), y = f.length > 0 ? ` will-change: ${f.join(", ")};
|
|
925
|
-
` : "", S = e.split("-")[0], Y = `${i} {
|
|
926
|
-
animation: ${h};
|
|
927
|
-
${y}${S === "PUSHING" || S === "REPLACING" ? ` contain: layout;
|
|
928
|
-
pointer-events: none;
|
|
929
|
-
` : ""}}`;
|
|
930
|
-
return `${P}
|
|
931
|
-
${Y}`;
|
|
932
|
-
}, C = (n, t, e, s) => {
|
|
933
|
-
const a = g(s.value);
|
|
934
|
-
return a.length === 0 ? "" : `${n(t, e)} {
|
|
935
|
-
${E(a)}
|
|
936
|
-
}`;
|
|
937
|
-
}, St = (n, t) => {
|
|
938
|
-
const e = [];
|
|
939
|
-
for (const s of n) {
|
|
940
|
-
const a = s.name;
|
|
941
|
-
for (const r of O) {
|
|
942
|
-
const o = s.variants[r], c = k[r];
|
|
943
|
-
if (c === "self") {
|
|
944
|
-
e.push(C(A, a, r, o));
|
|
945
|
-
continue;
|
|
946
|
-
}
|
|
947
|
-
const l = c === "initial" ? s.initial : s.variants[c].value;
|
|
948
|
-
e.push(
|
|
949
|
-
x("screen", a, r, l, o, A)
|
|
950
|
-
);
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
for (const s of t) {
|
|
954
|
-
const a = s.name;
|
|
955
|
-
for (const r of W) {
|
|
956
|
-
const o = s.variants[r], c = k[r];
|
|
957
|
-
if (c === "self") {
|
|
958
|
-
e.push(C(M, a, r, o));
|
|
959
|
-
continue;
|
|
960
|
-
}
|
|
961
|
-
const l = c === "initial" ? s.initial : s.variants[c].value;
|
|
962
|
-
e.push(
|
|
963
|
-
x(
|
|
964
|
-
"decorator",
|
|
965
|
-
a,
|
|
966
|
-
r,
|
|
967
|
-
l,
|
|
968
|
-
o,
|
|
969
|
-
M
|
|
970
|
-
)
|
|
971
|
-
);
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
return e.filter((s) => s.length > 0).join(`
|
|
975
|
-
|
|
976
|
-
`);
|
|
977
|
-
}, vt = (n, t) => {
|
|
978
|
-
const e = k[t];
|
|
979
|
-
if (e === "self") return !1;
|
|
980
|
-
const s = n.variants[t], a = H(s.options), r = U(s.options);
|
|
981
|
-
if (a <= 0 && r <= 0) return !1;
|
|
982
|
-
const o = e === "initial" ? n.initial : n.variants[e].value, c = g(o), l = g(s.value);
|
|
983
|
-
return c.length > 0 || l.length > 0;
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region src/transition/decorator/createDecorator.ts
|
|
559
|
+
function y({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
560
|
+
return {
|
|
561
|
+
name: e,
|
|
562
|
+
initial: t,
|
|
563
|
+
variants: {
|
|
564
|
+
"IDLE-true": n,
|
|
565
|
+
"IDLE-false": n,
|
|
566
|
+
"PUSHING-true": n,
|
|
567
|
+
"PUSHING-false": r,
|
|
568
|
+
"REPLACING-true": n,
|
|
569
|
+
"REPLACING-false": r,
|
|
570
|
+
"POPPING-true": n,
|
|
571
|
+
"POPPING-false": i,
|
|
572
|
+
"COMPLETED-true": n,
|
|
573
|
+
"COMPLETED-false": r
|
|
574
|
+
},
|
|
575
|
+
...a
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/transition/decorator/createRawDecorator.ts
|
|
580
|
+
function ee({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
581
|
+
return {
|
|
582
|
+
name: e,
|
|
583
|
+
initial: t,
|
|
584
|
+
variants: {
|
|
585
|
+
"IDLE-true": n,
|
|
586
|
+
"IDLE-false": n,
|
|
587
|
+
"PUSHING-false": i,
|
|
588
|
+
"PUSHING-true": r,
|
|
589
|
+
"REPLACING-false": o,
|
|
590
|
+
"REPLACING-true": a,
|
|
591
|
+
"POPPING-false": c,
|
|
592
|
+
"POPPING-true": s,
|
|
593
|
+
"COMPLETED-false": u,
|
|
594
|
+
"COMPLETED-true": l
|
|
595
|
+
},
|
|
596
|
+
...d
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
//#endregion
|
|
600
|
+
//#region src/transition/decorator/overlay.ts
|
|
601
|
+
var b = "rgba(0, 0, 0, 0.3)", x = y({
|
|
602
|
+
name: "overlay",
|
|
603
|
+
initial: {
|
|
604
|
+
opacity: 0,
|
|
605
|
+
backgroundColor: b
|
|
606
|
+
},
|
|
607
|
+
idle: {
|
|
608
|
+
value: {
|
|
609
|
+
opacity: 0,
|
|
610
|
+
backgroundColor: b
|
|
611
|
+
},
|
|
612
|
+
options: { duration: 0 }
|
|
613
|
+
},
|
|
614
|
+
enter: {
|
|
615
|
+
value: {
|
|
616
|
+
opacity: 1,
|
|
617
|
+
backgroundColor: b
|
|
618
|
+
},
|
|
619
|
+
options: { duration: .7 }
|
|
620
|
+
},
|
|
621
|
+
exit: {
|
|
622
|
+
value: {
|
|
623
|
+
opacity: 0,
|
|
624
|
+
backgroundColor: b
|
|
625
|
+
},
|
|
626
|
+
options: { duration: .6 }
|
|
627
|
+
},
|
|
628
|
+
options: {
|
|
629
|
+
onSwipeStart: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!!e }, { duration: .3 }),
|
|
630
|
+
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
631
|
+
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
632
|
+
}
|
|
633
|
+
}), te = new Map([["overlay", x]]), S = {
|
|
634
|
+
"IDLE-true": "self",
|
|
635
|
+
"IDLE-false": "self",
|
|
636
|
+
"PUSHING-true": "initial",
|
|
637
|
+
"PUSHING-false": "IDLE-true",
|
|
638
|
+
"REPLACING-true": "initial",
|
|
639
|
+
"REPLACING-false": "IDLE-true",
|
|
640
|
+
"POPPING-true": "IDLE-true",
|
|
641
|
+
"POPPING-false": "PUSHING-false",
|
|
642
|
+
"COMPLETED-true": "self",
|
|
643
|
+
"COMPLETED-false": "self"
|
|
644
|
+
}, C = Object.keys(S), w = C, ne = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), T = (e) => typeof e == "object" && !!e && !Array.isArray(e), E = new Set(/* @__PURE__ */ "opacity.scale.scaleX.scaleY.scaleZ.aspectRatio.columnCount.columns.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineHeight.lineClamp.order.orphans.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeWidth".split(".")), D = (e, t) => t.startsWith("--") || E.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, O = (e, t) => typeof t == "number" ? D(t, e) : typeof t == "string" ? t : "", k = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), A = new Set([
|
|
645
|
+
"x",
|
|
646
|
+
"y",
|
|
647
|
+
"z",
|
|
648
|
+
"scale",
|
|
649
|
+
"scaleX",
|
|
650
|
+
"scaleY",
|
|
651
|
+
"rotate",
|
|
652
|
+
"rotateX",
|
|
653
|
+
"rotateY",
|
|
654
|
+
"rotateZ"
|
|
655
|
+
]), j = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, M = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, N = /^1(\.0+)?$/, P = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 ? !0 : typeof t == "string" ? N.test(t.trim()) : !1 : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 ? !0 : typeof t == "string" ? M.test(t.trim()) : !1 : t === 0 ? !0 : typeof t == "string" ? j.test(t.trim()) : !1, F = (e, t) => {
|
|
656
|
+
switch (e) {
|
|
657
|
+
case "x": return `translateX(${t})`;
|
|
658
|
+
case "y": return `translateY(${t})`;
|
|
659
|
+
case "z": return `translateZ(${t})`;
|
|
660
|
+
case "scale": return `scale(${t})`;
|
|
661
|
+
case "scaleX": return `scaleX(${t})`;
|
|
662
|
+
case "scaleY": return `scaleY(${t})`;
|
|
663
|
+
case "rotate":
|
|
664
|
+
case "rotateZ": return `rotate(${t})`;
|
|
665
|
+
case "rotateX": return `rotateX(${t})`;
|
|
666
|
+
case "rotateY": return `rotateY(${t})`;
|
|
667
|
+
default: return "";
|
|
668
|
+
}
|
|
669
|
+
}, I = (e) => {
|
|
670
|
+
let t = /* @__PURE__ */ new Set(), n = !1, r = (e) => {
|
|
671
|
+
if (T(e)) for (let r of Object.keys(e)) {
|
|
672
|
+
let i = e[r];
|
|
673
|
+
O(r, i) !== "" && (A.has(r) ? n = !0 : t.add(k(r)));
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
r(e.initial);
|
|
677
|
+
for (let t of Object.values(e.variants)) r(t.value);
|
|
678
|
+
return n && t.add("transform"), Array.from(t);
|
|
679
|
+
}, L = (e) => {
|
|
680
|
+
if (!T(e)) return [];
|
|
681
|
+
let t = [], n = !0, r = [];
|
|
682
|
+
for (let i of Object.keys(e)) {
|
|
683
|
+
let a = e[i], o = O(i, a);
|
|
684
|
+
o !== "" && (A.has(i) ? (t.push(F(i, o)), P(i, a) || (n = !1)) : r.push({
|
|
685
|
+
property: k(i),
|
|
686
|
+
value: o
|
|
687
|
+
}));
|
|
688
|
+
}
|
|
689
|
+
return t.length > 0 && r.push({
|
|
690
|
+
property: "transform",
|
|
691
|
+
value: n ? "none" : t.join(" ")
|
|
692
|
+
}), r;
|
|
693
|
+
}, R = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), z = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
694
|
+
linear: "linear",
|
|
695
|
+
easeIn: "ease-in",
|
|
696
|
+
easeOut: "ease-out",
|
|
697
|
+
easeInOut: "ease-in-out",
|
|
698
|
+
circIn: "cubic-bezier(0, 0.55, 0.45, 1)",
|
|
699
|
+
circOut: "cubic-bezier(0.55, 0, 1, 0.45)",
|
|
700
|
+
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
701
|
+
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
702
|
+
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
703
|
+
}[e] ?? "ease" : "ease", B = (e) => {
|
|
704
|
+
if (!e) return 0;
|
|
705
|
+
let t = e.duration;
|
|
706
|
+
return typeof t == "number" && t >= 0 ? t : 0;
|
|
707
|
+
}, V = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, H = (e, t) => {
|
|
708
|
+
let [n, r] = t.split("-");
|
|
709
|
+
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
710
|
+
}, U = (e, t) => {
|
|
711
|
+
let [n, r] = t.split("-");
|
|
712
|
+
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
713
|
+
}, W = (e, t) => {
|
|
714
|
+
let [n, r] = t.split("-");
|
|
715
|
+
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
716
|
+
}, G = (e, t, n) => `flemo-${e}-${ne(t)}-${n}`, K = (e, t, n, r, i, a) => {
|
|
717
|
+
let o = L(r), s = L(i.value), c = B(i.options), l = V(i.options), u = z(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${W(t, n)}` : d;
|
|
718
|
+
if (s.length === 0 && o.length === 0) return "";
|
|
719
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${R(s)}\n animation: none;\n}`;
|
|
720
|
+
let p = G(e, t, n), m = [
|
|
721
|
+
`@keyframes ${p} {`,
|
|
722
|
+
" from {",
|
|
723
|
+
R(o).replace(/^/gm, " "),
|
|
724
|
+
" }",
|
|
725
|
+
" to {",
|
|
726
|
+
R(s).replace(/^/gm, " "),
|
|
727
|
+
" }",
|
|
728
|
+
"}"
|
|
729
|
+
].join("\n"), h = [
|
|
730
|
+
`${p}`,
|
|
731
|
+
`${c}s`,
|
|
732
|
+
u,
|
|
733
|
+
l > 0 ? `${l}s` : null,
|
|
734
|
+
"both"
|
|
735
|
+
].filter(Boolean).join(" "), g = Array.from(new Set([...o.map((e) => e.property), ...s.map((e) => e.property)])), _ = g.length > 0 ? ` will-change: ${g.join(", ")};\n` : "", v = n.split("-")[0];
|
|
736
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${_}${v === "PUSHING" || v === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}`;
|
|
737
|
+
}, q = (e, t, n, r) => {
|
|
738
|
+
let i = L(r.value);
|
|
739
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${R(i)}\n}`;
|
|
740
|
+
}, J = (e, t) => {
|
|
741
|
+
let n = [];
|
|
742
|
+
for (let t of e) {
|
|
743
|
+
let e = t.name;
|
|
744
|
+
for (let r of C) {
|
|
745
|
+
let i = t.variants[r], a = S[r];
|
|
746
|
+
if (a === "self") {
|
|
747
|
+
n.push(q(H, e, r, i));
|
|
748
|
+
continue;
|
|
749
|
+
}
|
|
750
|
+
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
751
|
+
n.push(K("screen", e, r, o, i, H));
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
for (let e of t) {
|
|
755
|
+
let t = e.name;
|
|
756
|
+
for (let r of w) {
|
|
757
|
+
let i = e.variants[r], a = S[r];
|
|
758
|
+
if (a === "self") {
|
|
759
|
+
n.push(q(U, t, r, i));
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
763
|
+
n.push(K("decorator", t, r, o, i, U));
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return n.filter((e) => e.length > 0).join("\n\n");
|
|
767
|
+
}, Y = (e, t) => {
|
|
768
|
+
let n = S[t];
|
|
769
|
+
if (n === "self") return !1;
|
|
770
|
+
let r = e.variants[t], i = B(r.options), a = V(r.options);
|
|
771
|
+
if (i <= 0 && a <= 0) return !1;
|
|
772
|
+
let o = L(n === "initial" ? e.initial : e.variants[n].value), s = L(r.value);
|
|
773
|
+
return o.length > 0 || s.length > 0;
|
|
984
774
|
};
|
|
985
|
-
|
|
986
|
-
|
|
775
|
+
//#endregion
|
|
776
|
+
//#region src/utils/isServer.ts
|
|
777
|
+
function X() {
|
|
778
|
+
return typeof document > "u";
|
|
987
779
|
}
|
|
988
|
-
|
|
989
|
-
|
|
780
|
+
//#endregion
|
|
781
|
+
//#region src/utils/getMatchedPathPattern.ts
|
|
782
|
+
function Z(e, t) {
|
|
783
|
+
return Array.isArray(e) ? e.find((e) => n(e).regexp.test(t)) ?? "" : n(e).regexp.test(t) ? e : "";
|
|
990
784
|
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
785
|
+
//#endregion
|
|
786
|
+
//#region src/utils/getParams.ts
|
|
787
|
+
function re(e, n, r) {
|
|
788
|
+
let i = t(Z(e, n))(n), a = new URLSearchParams(r), o = Object.fromEntries(a.entries());
|
|
789
|
+
return i ? {
|
|
790
|
+
...i.params,
|
|
791
|
+
...o
|
|
792
|
+
} : {};
|
|
994
793
|
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
794
|
+
//#endregion
|
|
795
|
+
//#region src/utils/findScrollable.ts
|
|
796
|
+
function ie(e, t) {
|
|
797
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = ae(e);
|
|
798
|
+
if (!o) return {
|
|
799
|
+
element: null,
|
|
800
|
+
hasMarker: !1
|
|
801
|
+
};
|
|
802
|
+
let s = o.closest?.(r);
|
|
803
|
+
if (s instanceof HTMLElement && Q(s, n) && (!a || $(s, n))) return {
|
|
804
|
+
element: s,
|
|
805
|
+
hasMarker: !0
|
|
806
|
+
};
|
|
807
|
+
let c = o, l = 0;
|
|
808
|
+
for (; c && l < i;) {
|
|
809
|
+
if (Q(c, n) && (!a || $(c, n))) return {
|
|
810
|
+
element: c,
|
|
811
|
+
hasMarker: !1
|
|
812
|
+
};
|
|
813
|
+
c = c.parentElement, l++;
|
|
814
|
+
}
|
|
815
|
+
return {
|
|
816
|
+
element: null,
|
|
817
|
+
hasMarker: !1
|
|
818
|
+
};
|
|
1013
819
|
}
|
|
1014
|
-
function
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
return n instanceof HTMLElement ? n : null;
|
|
820
|
+
function ae(e) {
|
|
821
|
+
if (!e) return null;
|
|
822
|
+
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
823
|
+
if (n && n.length) {
|
|
824
|
+
for (let e of n) if (e instanceof HTMLElement) return e;
|
|
825
|
+
}
|
|
826
|
+
return e instanceof HTMLElement ? e : null;
|
|
1022
827
|
}
|
|
1023
|
-
function
|
|
1024
|
-
|
|
828
|
+
function Q(e, t) {
|
|
829
|
+
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
1025
830
|
}
|
|
1026
|
-
function
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
831
|
+
function $(e, t) {
|
|
832
|
+
if (!Q(e, t) || typeof window > "u") return !1;
|
|
833
|
+
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
834
|
+
return r === "auto" || r === "scroll" || r === "overlay";
|
|
1030
835
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
ut as animationName,
|
|
1034
|
-
G as canProgrammaticallyScroll,
|
|
1035
|
-
wt as collectAnimatedProperties,
|
|
1036
|
-
St as compileTransitionStyles,
|
|
1037
|
-
Et as consumeSelfInducedPop,
|
|
1038
|
-
K as createDecorator,
|
|
1039
|
-
Lt as createRawDecorator,
|
|
1040
|
-
kt as createRawTransition,
|
|
1041
|
-
T as createTransition,
|
|
1042
|
-
F as cupertino,
|
|
1043
|
-
Dt as decoratorMap,
|
|
1044
|
-
it as easingToCss,
|
|
1045
|
-
xt as findScrollable,
|
|
1046
|
-
lt as getMatchedPathPattern,
|
|
1047
|
-
Mt as getParams,
|
|
1048
|
-
At as isServer,
|
|
1049
|
-
V as layout,
|
|
1050
|
-
It as markSelfInducedPop,
|
|
1051
|
-
Z as material,
|
|
1052
|
-
j as none,
|
|
1053
|
-
D as overflowsAxis,
|
|
1054
|
-
q as overlay,
|
|
1055
|
-
g as targetToDecls,
|
|
1056
|
-
Tt as transitionMap,
|
|
1057
|
-
Pt as useHistoryStore,
|
|
1058
|
-
gt as useNavigateStore,
|
|
1059
|
-
Nt as useTransitionStore,
|
|
1060
|
-
vt as variantHasAnimation
|
|
1061
|
-
};
|
|
836
|
+
//#endregion
|
|
837
|
+
export { r as TaskManger, G as animationName, $ as canProgrammaticallyScroll, I as collectAnimatedProperties, J as compileTransitionStyles, c as consumeSelfInducedPop, y as createDecorator, i as createHistoryStore, a as createNavigateStore, ee as createRawDecorator, u as createRawTransition, l as createTransition, v as createTransitionStore, f as cupertino, te as decoratorMap, z as easingToCss, ie as findScrollable, Z as getMatchedPathPattern, re as getParams, X as isServer, m as layout, s as markSelfInducedPop, h as material, g as none, Q as overflowsAxis, x as overlay, L as targetToDecls, _ as transitionMap, Y as variantHasAnimation };
|