@cloudlet/toast 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +271 -0
- package/LICENSE +21 -0
- package/README.md +65 -2
- package/THIRD_PARTY_NOTICES.md +149 -0
- package/dist/contracts/controller.d.ts +71 -0
- package/dist/contracts/controller.d.ts.map +1 -0
- package/dist/contracts/events.d.ts +72 -0
- package/dist/contracts/events.d.ts.map +1 -0
- package/dist/contracts/identity.d.ts +32 -0
- package/dist/contracts/identity.d.ts.map +1 -0
- package/dist/contracts/internal.d.ts +188 -0
- package/dist/contracts/internal.d.ts.map +1 -0
- package/dist/contracts/notifications.d.ts +101 -0
- package/dist/contracts/notifications.d.ts.map +1 -0
- package/dist/contracts/operations.d.ts +76 -0
- package/dist/contracts/operations.d.ts.map +1 -0
- package/dist/contracts/snapshots.d.ts +48 -0
- package/dist/contracts/snapshots.d.ts.map +1 -0
- package/dist/core/bridge.d.ts +5 -0
- package/dist/core/bridge.d.ts.map +1 -0
- package/dist/core/bridge.js +277 -0
- package/dist/core/bridge.js.map +1 -0
- package/dist/core/controller.d.ts +117 -0
- package/dist/core/controller.d.ts.map +1 -0
- package/dist/core/controller.js +787 -0
- package/dist/core/controller.js.map +1 -0
- package/dist/core/validation.d.ts +17 -0
- package/dist/core/validation.d.ts.map +1 -0
- package/dist/core/validation.js +298 -0
- package/dist/core/validation.js.map +1 -0
- package/dist/create-cloudlet.d.ts +5 -0
- package/dist/create-cloudlet.d.ts.map +1 -0
- package/dist/create-cloudlet.js +34 -0
- package/dist/create-cloudlet.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/react/announcer.d.ts +15 -0
- package/dist/react/announcer.d.ts.map +1 -0
- package/dist/react/announcer.js +140 -0
- package/dist/react/announcer.js.map +1 -0
- package/dist/react/bindings.d.ts +17 -0
- package/dist/react/bindings.d.ts.map +1 -0
- package/dist/react/bindings.js +47 -0
- package/dist/react/bindings.js.map +1 -0
- package/dist/react/card.d.ts +58 -0
- package/dist/react/card.d.ts.map +1 -0
- package/dist/react/card.js +300 -0
- package/dist/react/card.js.map +1 -0
- package/dist/react/generators.d.ts +46 -0
- package/dist/react/generators.d.ts.map +1 -0
- package/dist/react/generators.js +115 -0
- package/dist/react/generators.js.map +1 -0
- package/dist/react/gestures.d.ts +50 -0
- package/dist/react/gestures.d.ts.map +1 -0
- package/dist/react/gestures.js +239 -0
- package/dist/react/gestures.js.map +1 -0
- package/dist/react/host.d.ts +37 -0
- package/dist/react/host.d.ts.map +1 -0
- package/dist/react/host.js +816 -0
- package/dist/react/host.js.map +1 -0
- package/dist/react/motion.d.ts +206 -0
- package/dist/react/motion.d.ts.map +1 -0
- package/dist/react/motion.js +414 -0
- package/dist/react/motion.js.map +1 -0
- package/dist/react/plan.d.ts +45 -0
- package/dist/react/plan.d.ts.map +1 -0
- package/dist/react/plan.js +58 -0
- package/dist/react/plan.js.map +1 -0
- package/dist/react/renderer.d.ts +7 -0
- package/dist/react/renderer.d.ts.map +1 -0
- package/dist/react/renderer.js +62 -0
- package/dist/react/renderer.js.map +1 -0
- package/dist/react/shape.d.ts +7 -0
- package/dist/react/shape.d.ts.map +1 -0
- package/dist/react/shape.js +21 -0
- package/dist/react/shape.js.map +1 -0
- package/dist/react/viewport.d.ts +15 -0
- package/dist/react/viewport.d.ts.map +1 -0
- package/dist/react/viewport.js +16 -0
- package/dist/react/viewport.js.map +1 -0
- package/dist/react.d.ts +176 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +2 -0
- package/dist/styles.css +1 -0
- package/package.json +19 -4
- package/src/contracts/controller.ts +61 -0
- package/src/contracts/events.ts +48 -0
- package/src/contracts/identity.ts +27 -0
- package/src/contracts/internal.ts +150 -0
- package/src/contracts/notifications.ts +104 -0
- package/src/contracts/operations.ts +71 -0
- package/src/contracts/snapshots.ts +59 -0
- package/src/core/bridge.ts +280 -0
- package/src/core/controller.ts +853 -0
- package/src/core/validation.ts +290 -0
- package/src/create-cloudlet.ts +43 -0
- package/src/index.ts +34 -0
- package/src/react/announcer.ts +198 -0
- package/src/react/bindings.tsx +56 -0
- package/src/react/card.tsx +222 -0
- package/src/react/generators.ts +274 -0
- package/src/react/gestures.ts +296 -0
- package/src/react/host.tsx +953 -0
- package/src/react/motion.ts +484 -0
- package/src/react/plan.ts +101 -0
- package/src/react/renderer.tsx +77 -0
- package/src/react/shape.ts +33 -0
- package/src/react/viewport.ts +10 -0
- package/src/react.ts +190 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { spring as e, tween as t } from "./generators.js";
|
|
2
|
+
//#region src/react/motion.ts
|
|
3
|
+
var n = {
|
|
4
|
+
enter: {
|
|
5
|
+
duration: 200,
|
|
6
|
+
bounce: .25,
|
|
7
|
+
scale: .25,
|
|
8
|
+
offset: 1,
|
|
9
|
+
fade: 160
|
|
10
|
+
},
|
|
11
|
+
exit: {
|
|
12
|
+
duration: 300,
|
|
13
|
+
bounce: 0
|
|
14
|
+
},
|
|
15
|
+
shapeOpen: {
|
|
16
|
+
stiffness: 900,
|
|
17
|
+
damping: 60,
|
|
18
|
+
mass: 2
|
|
19
|
+
},
|
|
20
|
+
shapeClose: {
|
|
21
|
+
stiffness: 900,
|
|
22
|
+
damping: 45,
|
|
23
|
+
mass: 1
|
|
24
|
+
},
|
|
25
|
+
tails: 150,
|
|
26
|
+
chromeDelay: 100,
|
|
27
|
+
chromeIn: 200,
|
|
28
|
+
chromeOut: 70,
|
|
29
|
+
chromeOffset: 4,
|
|
30
|
+
headerOut: 200,
|
|
31
|
+
headerIn: 260,
|
|
32
|
+
blur: 6,
|
|
33
|
+
bodyOut: 120,
|
|
34
|
+
bodyIn: 200,
|
|
35
|
+
bodyOffset: 4,
|
|
36
|
+
bodyQuiet: 600,
|
|
37
|
+
slide: {
|
|
38
|
+
stiffness: 1200,
|
|
39
|
+
damping: 60,
|
|
40
|
+
mass: 1
|
|
41
|
+
},
|
|
42
|
+
badge: {
|
|
43
|
+
duration: 200,
|
|
44
|
+
bounce: 0,
|
|
45
|
+
scale: .6
|
|
46
|
+
},
|
|
47
|
+
countSwap: 160,
|
|
48
|
+
progress: 1e3,
|
|
49
|
+
hover: 200,
|
|
50
|
+
hoverLift: 2,
|
|
51
|
+
reduced: 80,
|
|
52
|
+
swipe: {
|
|
53
|
+
intent: 8,
|
|
54
|
+
distance: .3,
|
|
55
|
+
minDistance: 24,
|
|
56
|
+
velocity: .5,
|
|
57
|
+
edge: 32,
|
|
58
|
+
rubberBand: .55,
|
|
59
|
+
wheelIdle: 140,
|
|
60
|
+
wheelLock: 400,
|
|
61
|
+
suppressClick: 500
|
|
62
|
+
}
|
|
63
|
+
}, r = n, i = /* @__PURE__ */ new Set(["stiffness", "mass"]);
|
|
64
|
+
function a(e) {
|
|
65
|
+
if (!e || typeof e != "object") return r;
|
|
66
|
+
let t = (e, t) => typeof t == "number" && Number.isFinite(t) && (i.has(e) ? t > 0 : t >= 0), n = {};
|
|
67
|
+
for (let [i, a] of Object.entries(r)) {
|
|
68
|
+
if (i === "swipe") continue;
|
|
69
|
+
let r = e[i];
|
|
70
|
+
if (typeof a == "number") n[i] = t(i, r) ? r : a;
|
|
71
|
+
else {
|
|
72
|
+
let e = { ...a };
|
|
73
|
+
if (r && typeof r == "object") for (let n of Object.keys(e)) {
|
|
74
|
+
let i = r[n];
|
|
75
|
+
t(n, i) && (e[n] = i);
|
|
76
|
+
}
|
|
77
|
+
n[i] = e;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return n;
|
|
81
|
+
}
|
|
82
|
+
var o = /* @__PURE__ */ "opacity.scale.y.width.height.radius.tail1.tail1Opacity.tail2.tail2Opacity.lift.badge.chrome.chromeOut.headerIn.headerOut.bodyIn.bodyOut.slide.slideIn.slideOut.badgeIn.badgeOut.pageIn.pageOut.progress.exitOpacity.exitScale.exitY.exitX.headX.headY.dragX.dragY".split("."), s = /* @__PURE__ */ new Set([
|
|
83
|
+
"scale",
|
|
84
|
+
"y",
|
|
85
|
+
"width",
|
|
86
|
+
"height",
|
|
87
|
+
"radius",
|
|
88
|
+
"tail1",
|
|
89
|
+
"tail2",
|
|
90
|
+
"lift",
|
|
91
|
+
"slide",
|
|
92
|
+
"progress",
|
|
93
|
+
"exitScale",
|
|
94
|
+
"exitY",
|
|
95
|
+
"exitX",
|
|
96
|
+
"headX",
|
|
97
|
+
"headY",
|
|
98
|
+
"dragX",
|
|
99
|
+
"dragY"
|
|
100
|
+
]), c = {
|
|
101
|
+
scale: 1,
|
|
102
|
+
headerIn: 1,
|
|
103
|
+
bodyIn: 1,
|
|
104
|
+
slideIn: 1,
|
|
105
|
+
badgeIn: 1,
|
|
106
|
+
pageIn: 1,
|
|
107
|
+
exitScale: 1
|
|
108
|
+
}, l = (e) => ({
|
|
109
|
+
header: [
|
|
110
|
+
"headerIn",
|
|
111
|
+
"headerOut",
|
|
112
|
+
e.headerIn,
|
|
113
|
+
e.headerOut
|
|
114
|
+
],
|
|
115
|
+
body: [
|
|
116
|
+
"bodyIn",
|
|
117
|
+
"bodyOut",
|
|
118
|
+
e.bodyIn,
|
|
119
|
+
e.bodyOut
|
|
120
|
+
],
|
|
121
|
+
badge: [
|
|
122
|
+
"badgeIn",
|
|
123
|
+
"badgeOut",
|
|
124
|
+
e.countSwap,
|
|
125
|
+
e.countSwap
|
|
126
|
+
],
|
|
127
|
+
page: [
|
|
128
|
+
"pageIn",
|
|
129
|
+
"pageOut",
|
|
130
|
+
e.countSwap,
|
|
131
|
+
e.countSwap
|
|
132
|
+
],
|
|
133
|
+
chrome: [
|
|
134
|
+
"chrome",
|
|
135
|
+
"chromeOut",
|
|
136
|
+
e.chromeIn,
|
|
137
|
+
e.chromeOut
|
|
138
|
+
]
|
|
139
|
+
}), u = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : 1;
|
|
140
|
+
function d(n) {
|
|
141
|
+
let i = Object.fromEntries(o.map((e) => {
|
|
142
|
+
let t = c[e] ?? 0;
|
|
143
|
+
return [e, {
|
|
144
|
+
value: t,
|
|
145
|
+
target: t,
|
|
146
|
+
velocity: 0,
|
|
147
|
+
animation: null
|
|
148
|
+
}];
|
|
149
|
+
})), a = /* @__PURE__ */ new Map(), d = null, f = !1, p = !1, m = n.reducedMotion ?? !1, h = u(n.timeScale), g = n.constants ?? r, _ = 1, v = 0, y = (e) => e.some((e) => i[e].animation !== null), b = () => {
|
|
150
|
+
let e = {
|
|
151
|
+
reduced: m,
|
|
152
|
+
slideDirection: _,
|
|
153
|
+
slideWidth: v
|
|
154
|
+
};
|
|
155
|
+
for (let t of o) e[t] = i[t].value;
|
|
156
|
+
return e;
|
|
157
|
+
}, x = () => {
|
|
158
|
+
p && !f && n.write(b());
|
|
159
|
+
};
|
|
160
|
+
function S(e) {
|
|
161
|
+
for (let t of o) {
|
|
162
|
+
let n = i[t], r = n.animation;
|
|
163
|
+
if (!r) continue;
|
|
164
|
+
let a = Math.max(0, (e - r.start) * h - r.delay), o = r.generator.next(a);
|
|
165
|
+
n.value = o.value, n.velocity = o.done ? 0 : (r.generator.velocity?.(a) ?? 0) * h, o.done && (n.animation = null, n.value = n.target);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function C() {
|
|
169
|
+
!f && d === null && (d = n.requestFrame(T));
|
|
170
|
+
}
|
|
171
|
+
function w() {
|
|
172
|
+
for (let [e, t] of [...a]) {
|
|
173
|
+
if (f) return;
|
|
174
|
+
a.get(e) !== t || y(t.keys) || (a.delete(e), t.done());
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function T(e) {
|
|
178
|
+
d = null, !f && (S(e), x(), w(), y(o) && C());
|
|
179
|
+
}
|
|
180
|
+
function E(e, t) {
|
|
181
|
+
let n = i[e];
|
|
182
|
+
n.value = n.target = t, n.velocity = 0, n.animation = null;
|
|
183
|
+
}
|
|
184
|
+
function D(n, r, a, o, c = 0) {
|
|
185
|
+
let l = i[n];
|
|
186
|
+
if (m) {
|
|
187
|
+
if (s.has(n)) return E(n, r);
|
|
188
|
+
a = { tween: g.reduced }, c = 0;
|
|
189
|
+
}
|
|
190
|
+
l.target = r, (l.value !== r || l.animation) && (l.animation = {
|
|
191
|
+
generator: "tween" in a ? t(l.value, r, a.tween) : e({
|
|
192
|
+
from: l.value,
|
|
193
|
+
to: r,
|
|
194
|
+
velocity: l.velocity / h,
|
|
195
|
+
...a
|
|
196
|
+
}),
|
|
197
|
+
start: o,
|
|
198
|
+
delay: c
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function O(e, t, n) {
|
|
202
|
+
n ? a.set(e, {
|
|
203
|
+
keys: t,
|
|
204
|
+
done: n
|
|
205
|
+
}) : a.delete(e);
|
|
206
|
+
}
|
|
207
|
+
function k(e) {
|
|
208
|
+
if (f) return;
|
|
209
|
+
let t = n.now();
|
|
210
|
+
S(t), e(t), x(), (a.size || y(o)) && C();
|
|
211
|
+
}
|
|
212
|
+
let A = () => ({
|
|
213
|
+
duration: g.enter.duration,
|
|
214
|
+
bounce: g.enter.bounce
|
|
215
|
+
}), j = () => ({
|
|
216
|
+
duration: g.exit.duration,
|
|
217
|
+
bounce: g.exit.bounce
|
|
218
|
+
}), M = () => ({
|
|
219
|
+
duration: g.badge.duration,
|
|
220
|
+
bounce: g.badge.bounce
|
|
221
|
+
}), N = (e) => ({ tween: e });
|
|
222
|
+
function P(e, t) {
|
|
223
|
+
let n = i[e].animation;
|
|
224
|
+
if (!n) return 0;
|
|
225
|
+
let r = i[e].target, a = (t - n.start) * h - n.delay, o = Math.max(0, a);
|
|
226
|
+
for (let e = o + 2e3; o < e; o += 8) {
|
|
227
|
+
let e = n.generator.next(o);
|
|
228
|
+
if (e.done || Math.abs(e.value - r) < .5) break;
|
|
229
|
+
}
|
|
230
|
+
return n.generator.next(Math.max(0, a)), (o - a) / h;
|
|
231
|
+
}
|
|
232
|
+
function F(e, t, n, r = !1) {
|
|
233
|
+
let [a, o, s, c] = l(g)[e];
|
|
234
|
+
E(o, r ? 0 : i[a].value), E(a, 0), D(o, 0, N(c), t), D(a, 1, N(s), t, e === "chrome" ? g.chromeDelay : 0), O(e, [a, o], n);
|
|
235
|
+
}
|
|
236
|
+
function I(e, t, n, r, i) {
|
|
237
|
+
for (let a of [1, 2]) {
|
|
238
|
+
let o = `tail${a}`, s = `tail${a}Opacity`, c = i?.(a);
|
|
239
|
+
c?.slot !== void 0 && E(o, c.slot), c?.opacity !== void 0 && E(s, c.opacity), a <= e ? (D(o, a, n, t, r), D(s, 1, "tween" in n ? n : N(g.tails), t, r)) : D(s, 0, N(g.tails), t);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
let L = [
|
|
243
|
+
"tail1",
|
|
244
|
+
"tail1Opacity",
|
|
245
|
+
"tail2",
|
|
246
|
+
"tail2Opacity",
|
|
247
|
+
"badge"
|
|
248
|
+
];
|
|
249
|
+
return {
|
|
250
|
+
setShape(e, t) {
|
|
251
|
+
k((n) => {
|
|
252
|
+
let r = t === "open" ? g.shapeOpen : g.shapeClose;
|
|
253
|
+
for (let a of [
|
|
254
|
+
"width",
|
|
255
|
+
"height",
|
|
256
|
+
"radius"
|
|
257
|
+
]) !p || t === "instant" ? E(a, e[a]) : i[a].target !== e[a] && D(a, e[a], r, n);
|
|
258
|
+
p = !0;
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
shiftHeading(e, t, n) {
|
|
262
|
+
k((r) => {
|
|
263
|
+
let a = n === "open" ? g.shapeOpen : g.shapeClose;
|
|
264
|
+
for (let [n, o] of [["headX", e], ["headY", t]]) !Number.isFinite(o) || Math.abs(o) < .5 || (i[n].value += o, D(n, 0, a, r));
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
enter(e, t) {
|
|
268
|
+
k((n) => {
|
|
269
|
+
E("opacity", 0), E("scale", g.enter.scale), E("y", e * g.enter.offset), D("opacity", 1, N(g.enter.fade), n);
|
|
270
|
+
for (let e of ["scale", "y"]) D(e, e === "y" ? 0 : 1, A(), n);
|
|
271
|
+
O("presence", [
|
|
272
|
+
"opacity",
|
|
273
|
+
"scale",
|
|
274
|
+
"y"
|
|
275
|
+
], t);
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
rise(e, t, n) {
|
|
279
|
+
k((r) => {
|
|
280
|
+
E("y", e), E("scale", t), D("y", 0, A(), r), D("scale", 1, A(), r), D("opacity", 1, A(), r), O("presence", [
|
|
281
|
+
"opacity",
|
|
282
|
+
"scale",
|
|
283
|
+
"y"
|
|
284
|
+
], n);
|
|
285
|
+
});
|
|
286
|
+
},
|
|
287
|
+
exit(e, t, n) {
|
|
288
|
+
k((r) => {
|
|
289
|
+
E("exitOpacity", i.opacity.value), E("exitScale", i.scale.value), E("exitY", i.y.value + i.dragY.value), E("exitX", n ? i.dragX.value : 0), D("exitOpacity", 0, j(), r), n ? (i.exitX.velocity = n.velocity, D("exitX", n.direction * n.distance, g.slide, r)) : (D("exitScale", g.enter.scale, j(), r), D("exitY", e * g.enter.offset, j(), r)), E("dragX", 0), E("dragY", 0), O("exit", [
|
|
290
|
+
"exitOpacity",
|
|
291
|
+
"exitScale",
|
|
292
|
+
"exitY",
|
|
293
|
+
"exitX"
|
|
294
|
+
], t);
|
|
295
|
+
});
|
|
296
|
+
},
|
|
297
|
+
hide() {
|
|
298
|
+
k(() => E("opacity", 0));
|
|
299
|
+
},
|
|
300
|
+
setTails(e, t, n, r) {
|
|
301
|
+
k((i) => {
|
|
302
|
+
t === "settle" ? I(e, i, A(), 0) : I(e, i, A(), 0, (r) => r > e ? { opacity: 0 } : t === "arrival" ? {
|
|
303
|
+
slot: r - 1,
|
|
304
|
+
opacity: 1
|
|
305
|
+
} : {
|
|
306
|
+
slot: r + 1,
|
|
307
|
+
opacity: +(r + 1 <= n)
|
|
308
|
+
}), O("tails", L, r);
|
|
309
|
+
});
|
|
310
|
+
},
|
|
311
|
+
setBadge(e) {
|
|
312
|
+
k((t) => D("badge", +!!e, M(), t));
|
|
313
|
+
},
|
|
314
|
+
swapping(e) {
|
|
315
|
+
return !!i[l(g)[e][0]].animation;
|
|
316
|
+
},
|
|
317
|
+
now() {
|
|
318
|
+
return n.now();
|
|
319
|
+
},
|
|
320
|
+
open(e) {
|
|
321
|
+
k((t) => {
|
|
322
|
+
for (let e of [1, 2]) D(`tail${e}`, 0, N(g.tails), t), D(`tail${e}Opacity`, 0, N(g.tails), t);
|
|
323
|
+
D("badge", 0, N(g.tails), t), E("chromeOut", 0), E("chrome", 0), D("chrome", 1, N(g.chromeIn), t, g.chromeDelay), O("tails", L, e);
|
|
324
|
+
});
|
|
325
|
+
},
|
|
326
|
+
collapse(e, t, n) {
|
|
327
|
+
k((r) => {
|
|
328
|
+
E("chrome", 0), E("chromeOut", 1), D("chromeOut", 0, N(g.chromeOut), r), O("chrome", ["chromeOut"], n?.chrome);
|
|
329
|
+
let i = Math.max(0, Math.max(P("width", r), P("height", r)) - g.tails) * h;
|
|
330
|
+
I(e, r, N(g.tails), i, () => ({
|
|
331
|
+
slot: 0,
|
|
332
|
+
opacity: 0
|
|
333
|
+
})), D("badge", +!!t, N(g.tails), r, i), O("tails", L, n?.tails);
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
swap(e, t, n = !1) {
|
|
337
|
+
k((r) => F(e, r, t, n));
|
|
338
|
+
},
|
|
339
|
+
slide(e, t, n) {
|
|
340
|
+
k((r) => {
|
|
341
|
+
if (m) E("slide", 0), E("slideOut", 1), E("slideIn", 0), D("slideOut", 0, N(g.reduced), r), D("slideIn", 1, N(g.reduced), r);
|
|
342
|
+
else {
|
|
343
|
+
E("slideOut", 1), E("slideIn", 1);
|
|
344
|
+
let n = i.slide;
|
|
345
|
+
n.value += e * t, D("slide", 0, g.slide, r);
|
|
346
|
+
}
|
|
347
|
+
_ = e, v = t, O("slide", [
|
|
348
|
+
"slide",
|
|
349
|
+
"slideIn",
|
|
350
|
+
"slideOut"
|
|
351
|
+
], n);
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
drag(e, t) {
|
|
355
|
+
k(() => {
|
|
356
|
+
Number.isFinite(t) && E(e, t);
|
|
357
|
+
});
|
|
358
|
+
},
|
|
359
|
+
release(e, t, n) {
|
|
360
|
+
k((r) => {
|
|
361
|
+
i[e].velocity = Number.isFinite(t) ? t : 0, D(e, 0, g.slide, r), O(`release:${e}`, [e], n);
|
|
362
|
+
});
|
|
363
|
+
},
|
|
364
|
+
fling(e, t) {
|
|
365
|
+
!f && !i[e].animation && (i[e].velocity = Number.isFinite(t) ? t : 0);
|
|
366
|
+
},
|
|
367
|
+
setProgress(e, t) {
|
|
368
|
+
k((n) => {
|
|
369
|
+
e === null || t ? E("progress", e ?? 0) : D("progress", e, N(g.progress), n);
|
|
370
|
+
});
|
|
371
|
+
},
|
|
372
|
+
setHover(e) {
|
|
373
|
+
k((t) => D("lift", +!!e, N(g.hover), t));
|
|
374
|
+
},
|
|
375
|
+
setReducedMotion(e) {
|
|
376
|
+
f || m === e || k((t) => {
|
|
377
|
+
if (m = e, m) for (let e of o) {
|
|
378
|
+
let n = i[e];
|
|
379
|
+
n.animation && (s.has(e) ? E(e, n.target) : (n.animation = null, n.velocity = 0, D(e, n.target, N(g.reduced), t)));
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
},
|
|
383
|
+
setTimeScale(e) {
|
|
384
|
+
let t = u(e);
|
|
385
|
+
if (f || t === h) return;
|
|
386
|
+
let r = n.now();
|
|
387
|
+
S(r);
|
|
388
|
+
for (let e of o) {
|
|
389
|
+
let n = i[e].animation;
|
|
390
|
+
n && (n.start = r - (r - n.start) * h / t);
|
|
391
|
+
}
|
|
392
|
+
h = t;
|
|
393
|
+
},
|
|
394
|
+
setConstants(e) {
|
|
395
|
+
g = e;
|
|
396
|
+
},
|
|
397
|
+
get constants() {
|
|
398
|
+
return g;
|
|
399
|
+
},
|
|
400
|
+
get running() {
|
|
401
|
+
return d !== null;
|
|
402
|
+
},
|
|
403
|
+
dispose() {
|
|
404
|
+
if (!f) {
|
|
405
|
+
f = !0, d !== null && n.cancelFrame(d), d = null, a.clear();
|
|
406
|
+
for (let e of o) i[e].animation = null;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
//#endregion
|
|
412
|
+
export { n as MOTION, d as createShellMotion, a as resolveMotion };
|
|
413
|
+
|
|
414
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.js","names":["tweenGenerator","tween","MOTION","tunable","positive","resolveMotion","overrides","valid","value","key","result","base","override","fields","field","channelKeys","spatial","initial","swaps","m","validScale","createShellMotion","values","groups","frame","disposed","measured","reduced","options","timeScale","slideDirection","slideWidth","active","keys","output","write","sample","state","animation","elapsed","time","next","schedule","tick","complete","name","group","jump","to","target","spec","tween","spring","after","done","request","change","enterSpring","exitSpring","badgeSpring","tween$1","duration","remaining","t","end","swap","incoming","outgoing","inMs","outMs","layer","incomingOnly","tails","index","slot","opacity","start","from","depth","delay","tailKeys","mode","delta","dx","dy","edge","offset","scale","fling","previousDepth","direction","width","channel","velocity","immediate"],"sources":["../../src/react/motion.ts"],"sourcesContent":["import type { CloudletMotionConstants, CloudletMotionOverrides } from '../react.js';\nimport { spring, tween as tweenGenerator } from './generators.js';\nimport type { Generator } from './generators.js';\n\n/**\n * Values tuned on the laboratory, the one place\n * to tune them. Durations are milliseconds at `timeScale: 1`; offsets are CSS px.\n */\nexport const MOTION = {\n /** First pill of an empty stack: scale and translateY on the spring, opacity on a `fade` ms tween (it grows, not fades). */\n enter: { duration: 200, bounce: 0.25, scale: 0.25, offset: 1, fade: 160 },\n /** Exit of the last record or of the dismissed top pill: the reverse of entering (same scale and offset). */\n exit: { duration: 300, bounce: 0 },\n /** Shape springs: opening, and collapsing or adjusting to new content. */\n shapeOpen: { stiffness: 900, damping: 60, mass: 2 },\n shapeClose: { stiffness: 900, damping: 45, mass: 1 },\n /** Tails retract in the first 150 ms of opening and return in the last 150 ms of collapsing. */\n tails: 150,\n /** Close button, body and indicator: delayed fade + 4 px on open, 70 ms fade on collapse. */\n chromeDelay: 100, chromeIn: 200, chromeOut: 70, chromeOffset: 4,\n /** Title and icon blur swap: outgoing 0→6 px and 1→0, incoming 6→0 px and 0→1. */\n headerOut: 200, headerIn: 260, blur: 6,\n /** Body crossfade: outgoing opacity, incoming opacity + translateY 4→0; a stream of updates (progress) crossfades once, then changes in place. */\n bodyOut: 120, bodyIn: 200, bodyOffset: 4, bodyQuiet: 600,\n /** Horizontal slide of the body between notifications (the heading blur-swaps in place); swipes release with it. */\n slide: { stiffness: 1200, damping: 60, mass: 1 },\n /** Badge presence (scale .6↔1, opacity), badge number and indicator text blur swap. */\n badge: { duration: 200, bounce: 0, scale: 0.6 }, countSwap: 160,\n /** Numeric progress value tween. */\n progress: 1000,\n /** Hover spreads the tails by 2 px per step. */\n hover: 200, hoverLift: 2,\n /** Reduced motion: every transition becomes an opacity change of this length; swipes are off. */\n reduced: 80,\n /**\n * Swipes: the axis is decided after `intent` px; a release commits past\n * `distance` of the swiped dimension, or after `minDistance` px with `velocity` px/ms\n * towards the commit (a flick back cancels). Edges resist with the rubber-band\n * coefficient; a trackpad swipe ends after `wheelIdle` ms without wheel events and commits\n * as soon as its release would; for `wheelLock` ms after that the same stream cannot commit\n * again (one gesture keeps accelerating), later only a faster or reversed delta starts a new swipe.\n * Released offsets spring home with the `slide` spring and the release velocity.\n * Collapsing towards the screen edge has little room: it also commits after `edge` px.\n */\n swipe: { intent: 8, distance: 0.3, minDistance: 24, velocity: 0.5, edge: 32, rubberBand: 0.55, wheelIdle: 140, wheelLock: 400, suppressClick: 500 },\n} as const;\n\n/** The tunable part of MOTION: everything but the swipe thresholds. */\nconst tunable: CloudletMotionConstants = MOTION;\nconst positive = new Set(['stiffness', 'mass']);\n\n/**\n * Resolves `ToasterMotion.overrides` (a debugging channel) onto the starting\n * values. A field that is not a finite number in range (springs: stiffness and mass > 0,\n * everything else ≥ 0) keeps its default; unknown keys are ignored.\n */\nexport function resolveMotion(overrides: CloudletMotionOverrides | undefined): CloudletMotionConstants {\n if (!overrides || typeof overrides !== 'object') return tunable;\n const valid = (key: string, value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value) && (positive.has(key) ? value > 0 : value >= 0);\n const result: Record<string, unknown> = {};\n for (const [key, base] of Object.entries(tunable) as [string, unknown][]) {\n if (key === 'swipe') continue;\n const override = (overrides as Record<string, unknown>)[key];\n if (typeof base === 'number') result[key] = valid(key, override) ? override : base;\n else {\n const fields = { ...(base as Record<string, number>) };\n if (override && typeof override === 'object') {\n for (const field of Object.keys(fields)) {\n const value = (override as Record<string, unknown>)[field];\n if (valid(field, value)) fields[field] = value;\n }\n }\n result[key] = fields;\n }\n }\n return result as unknown as CloudletMotionConstants;\n}\n\nconst channelKeys = [\n 'opacity', 'scale', 'y', 'width', 'height', 'radius',\n 'tail1', 'tail1Opacity', 'tail2', 'tail2Opacity', 'lift', 'badge',\n 'chrome', 'chromeOut', 'headerIn', 'headerOut', 'bodyIn', 'bodyOut',\n 'slide', 'slideIn', 'slideOut', 'badgeIn', 'badgeOut', 'pageIn', 'pageOut',\n 'progress', 'exitOpacity', 'exitScale', 'exitY', 'exitX', 'headX', 'headY', 'dragX', 'dragY',\n] as const;\nexport type Channel = typeof channelKeys[number];\n/** Spatial channels jump under reduced motion; every other channel fades for MOTION.reduced. */\nconst spatial = new Set<Channel>(['scale', 'y', 'width', 'height', 'radius', 'tail1', 'tail2', 'lift', 'slide', 'progress',\n 'exitScale', 'exitY', 'exitX', 'headX', 'headY', 'dragX', 'dragY']);\nconst initial: Partial<Record<Channel, number>> = { scale: 1, headerIn: 1, bodyIn: 1, slideIn: 1, badgeIn: 1, pageIn: 1, exitScale: 1 };\n\nexport type ShellFrame = Readonly<Record<Channel, number>> & {\n readonly reduced: boolean;\n /** +1 when the incoming slide arrives from the inline end, −1 from the start. */\n readonly slideDirection: number;\n readonly slideWidth: number;\n};\nexport type SwapLayer = 'header' | 'body' | 'badge' | 'page';\nexport type ShapeMode = 'open' | 'close' | 'instant';\nexport interface ShellGeometry { readonly width: number; readonly height: number; readonly radius: number }\n/** Channels a finger moves directly: the pill or Island (`dragX`, `dragY`) and the Island content (`slide`). */\nexport type DragChannel = 'dragX' | 'dragY' | 'slide';\n/** A swipe-dismissed pill keeps flying sideways from where the finger released it. */\nexport interface Fling { readonly direction: 1 | -1; readonly distance: number; readonly velocity: number }\n\ninterface ShellMotionOptions {\n readonly now: () => number;\n readonly requestFrame: (callback: (time: number) => void) => number;\n readonly cancelFrame: (frame: number) => void;\n /** The sole DOM writer: scoped CSSOM rules and SVG attributes, never a style attribute. */\n readonly write: (frame: ShellFrame) => void;\n readonly reducedMotion?: boolean;\n readonly timeScale?: number | undefined;\n /** Resolved constants (`resolveMotion`); MOTION when omitted. */\n readonly constants?: CloudletMotionConstants | undefined;\n}\n\ntype Spec =\n | { readonly stiffness: number; readonly damping: number; readonly mass: number }\n | { readonly duration: number; readonly bounce: number }\n | { readonly tween: number };\ninterface ChannelState {\n value: number;\n target: number;\n /** Real-time units per second, independent of timeScale. */\n velocity: number;\n animation: { generator: Generator; start: number; delay: number } | null;\n}\n\nconst swaps = (m: CloudletMotionConstants): Record<SwapLayer | 'chrome', readonly [Channel, Channel, number, number]> => ({\n header: ['headerIn', 'headerOut', m.headerIn, m.headerOut],\n body: ['bodyIn', 'bodyOut', m.bodyIn, m.bodyOut],\n badge: ['badgeIn', 'badgeOut', m.countSwap, m.countSwap],\n page: ['pageIn', 'pageOut', m.countSwap, m.countSwap],\n chrome: ['chrome', 'chromeOut', m.chromeIn, m.chromeOut],\n});\nconst validScale = (value: number | undefined) => typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 1;\n\n/**\n * One RAF sampler per host over the generators of generators.ts (the numeric part of\n * Motion 14.3.0, frame-exact by the reference test): next() takes milliseconds,\n * velocity() returns the analytical units/s derivative accepted by the next\n * physical spring, so every retarget starts from the current value and speed.\n * Time-defined springs (duration/bounce) intentionally ignore velocity there.\n * `timeScale` stretches generator time for every channel at once. Nothing is\n * scheduled while idle; completion callbacks run only for the latest request\n * of their group and never synchronously.\n */\nexport function createShellMotion(options: ShellMotionOptions) {\n const values = Object.fromEntries(channelKeys.map(key => {\n const value = initial[key] ?? 0;\n return [key, { value, target: value, velocity: 0, animation: null } satisfies ChannelState];\n })) as Record<Channel, ChannelState>;\n const groups = new Map<string, { keys: readonly Channel[]; done: () => void }>();\n let frame: number | null = null;\n let disposed = false;\n let measured = false;\n let reduced = options.reducedMotion ?? false;\n let timeScale = validScale(options.timeScale);\n // Read at the start of every transition: new values apply live, running ones finish as started.\n let m = options.constants ?? tunable;\n let slideDirection = 1;\n let slideWidth = 0;\n\n const active = (keys: readonly Channel[]) => keys.some(key => values[key].animation !== null);\n const output = (): ShellFrame => {\n const result = { reduced, slideDirection, slideWidth } as Record<string, number | boolean>;\n for (const key of channelKeys) result[key] = values[key].value;\n return result as unknown as ShellFrame;\n };\n const write = () => { if (measured && !disposed) options.write(output()); };\n function sample(time: number) {\n for (const key of channelKeys) {\n const state = values[key];\n const animation = state.animation;\n if (!animation) continue;\n const elapsed = Math.max(0, (time - animation.start) * timeScale - animation.delay);\n const next = animation.generator.next(elapsed);\n state.value = next.value;\n state.velocity = next.done ? 0 : (animation.generator.velocity?.(elapsed) ?? 0) * timeScale;\n if (next.done) { state.animation = null; state.value = state.target; }\n }\n }\n function schedule() {\n if (!disposed && frame === null) frame = options.requestFrame(tick);\n }\n function complete() {\n for (const [name, group] of [...groups]) {\n if (disposed) return;\n if (groups.get(name) !== group || active(group.keys)) continue;\n // Clear before invoking: completion can synchronously retarget or dispose.\n groups.delete(name);\n group.done();\n }\n }\n function tick(time: number) {\n frame = null;\n if (disposed) return;\n sample(time);\n write();\n complete();\n if (active(channelKeys)) schedule();\n }\n function jump(key: Channel, value: number) {\n const state = values[key];\n state.value = state.target = value;\n state.velocity = 0;\n state.animation = null;\n }\n function to(key: Channel, target: number, spec: Spec, time: number, delay = 0) {\n const state = values[key];\n if (reduced) {\n if (spatial.has(key)) return jump(key, target);\n spec = { tween: m.reduced };\n delay = 0;\n }\n state.target = target;\n if (state.value === target && !state.animation) return;\n const generator = 'tween' in spec\n ? tweenGenerator(state.value, target, spec.tween)\n : spring({ from: state.value, to: target, velocity: state.velocity / timeScale, ...spec });\n state.animation = { generator, start: time, delay };\n }\n function after(name: string, keys: readonly Channel[], done?: () => void) {\n if (done) groups.set(name, { keys, done }); else groups.delete(name);\n }\n /** Shared entry for every public request: sample now, mutate, write the first frame, schedule. */\n function request(change: (time: number) => void) {\n if (disposed) return;\n const time = options.now();\n sample(time);\n change(time);\n write();\n // Completions are always delivered from a frame, never synchronously.\n if (groups.size || active(channelKeys)) schedule();\n }\n const enterSpring = () => ({ duration: m.enter.duration, bounce: m.enter.bounce });\n const exitSpring = () => ({ duration: m.exit.duration, bounce: m.exit.bounce });\n const badgeSpring = () => ({ duration: m.badge.duration, bounce: m.badge.bounce });\n const tween = (duration: number) => ({ tween: duration });\n\n /** Visual settle time of a running channel in real milliseconds (bounded, includes a pending delay). */\n function remaining(key: Channel, time: number): number {\n const animation = values[key].animation;\n if (!animation) return 0;\n const target = values[key].target;\n const elapsed = (time - animation.start) * timeScale - animation.delay;\n let t = Math.max(0, elapsed);\n for (const end = t + 2000; t < end; t += 8) {\n const next = animation.generator.next(t);\n if (next.done || Math.abs(next.value - target) < 0.5) break;\n }\n // Generators keep mutable iterator state: resample the current time.\n animation.generator.next(Math.max(0, elapsed));\n return (t - elapsed) / timeScale;\n }\n function swap(layer: SwapLayer | 'chrome', time: number, done?: () => void, incomingOnly = false) {\n const [incoming, outgoing, inMs, outMs] = swaps(m)[layer];\n // The live layer was just cloned: the snapshot continues from its current look.\n jump(outgoing, incomingOnly ? 0 : values[incoming].value);\n jump(incoming, 0);\n to(outgoing, 0, tween(outMs), time);\n to(incoming, 1, tween(inMs), time, layer === 'chrome' ? m.chromeDelay : 0);\n after(layer, [incoming, outgoing], done);\n }\n function tails(depth: number, time: number, spec: Spec, delay: number, from?: (index: number) => { slot?: number; opacity?: number }) {\n for (const index of [1, 2] as const) {\n const slot = `tail${index}` as const;\n const opacity = `tail${index}Opacity` as const;\n const start = from?.(index);\n if (start?.slot !== undefined) jump(slot, start.slot);\n if (start?.opacity !== undefined) jump(opacity, start.opacity);\n if (index <= depth) {\n to(slot, index, spec, time, delay);\n to(opacity, 1, 'tween' in spec ? spec : tween(m.tails), time, delay);\n } else to(opacity, 0, tween(m.tails), time);\n }\n }\n const tailKeys: readonly Channel[] = ['tail1', 'tail1Opacity', 'tail2', 'tail2Opacity', 'badge'];\n\n return {\n /** Target geometry measured from HTML; the first measurement and `instant` never animate. */\n setShape(target: ShellGeometry, mode: ShapeMode) {\n request(time => {\n const spec = mode === 'open' ? m.shapeOpen : m.shapeClose;\n for (const key of ['width', 'height', 'radius'] as const) {\n if (!measured || mode === 'instant') jump(key, target[key]);\n else if (values[key].target !== target[key]) to(key, target[key], spec, time);\n }\n measured = true;\n });\n },\n /**\n * The title and icon are the same nodes in both states, so a morph moves them\n * (FLIP): the layout jump is cancelled and springs back with the shape. Text never scales.\n */\n shiftHeading(dx: number, dy: number, mode: ShapeMode) {\n request(time => {\n const spec = mode === 'open' ? m.shapeOpen : m.shapeClose;\n for (const [key, delta] of [['headX', dx], ['headY', dy]] as const) {\n if (!Number.isFinite(delta) || Math.abs(delta) < 0.5) continue;\n values[key].value += delta;\n to(key, 0, spec, time);\n }\n });\n },\n /** The first pill: opacity 0→1 (tween), scale and translateY from the edge on the enter spring. */\n enter(edge: -1 | 1, done?: () => void) {\n request(time => {\n jump('opacity', 0); jump('scale', m.enter.scale); jump('y', edge * m.enter.offset);\n // The shell becomes opaque within `fade`; only scale and y follow the spring.\n to('opacity', 1, tween(m.enter.fade), time);\n for (const key of ['scale', 'y'] as const) to(key, key === 'y' ? 0 : 1, enterSpring(), time);\n after('presence', ['opacity', 'scale', 'y'], done);\n });\n },\n /** The first tail moves up into the pill's place after the top pill was dismissed. */\n rise(offset: number, scale: number, done?: () => void) {\n request(time => {\n jump('y', offset); jump('scale', scale);\n to('y', 0, enterSpring(), time); to('scale', 1, enterSpring(), time); to('opacity', 1, enterSpring(), time);\n after('presence', ['opacity', 'scale', 'y'], done);\n });\n },\n /**\n * The exit layer leaves from the shell's current presence; the shell itself is free again.\n * With a fling (swipe dismiss) the snapshot continues sideways with the release velocity\n * (px/s) instead of falling back to the edge, and the live shell returns to the centre.\n */\n exit(edge: -1 | 1, done?: () => void, fling?: Fling) {\n request(time => {\n jump('exitOpacity', values.opacity.value); jump('exitScale', values.scale.value);\n jump('exitY', values.y.value + values.dragY.value); jump('exitX', fling ? values.dragX.value : 0);\n to('exitOpacity', 0, exitSpring(), time);\n if (fling) {\n values.exitX.velocity = fling.velocity;\n to('exitX', fling.direction * fling.distance, m.slide, time);\n } else {\n to('exitScale', m.enter.scale, exitSpring(), time);\n to('exitY', edge * m.enter.offset, exitSpring(), time);\n }\n jump('dragX', 0); jump('dragY', 0);\n after('exit', ['exitOpacity', 'exitScale', 'exitY', 'exitX'], done);\n });\n },\n /** Hides the live shell at once (its look moved to the exit layer). */\n hide() { request(() => jump('opacity', 0)); },\n /**\n * Collapsed stack depth (0–2 tails). `arrival`: tails shift back from the pill;\n * `rise`: they move up one step; `settle`: spring to their slots in place.\n */\n setTails(depth: number, change: 'arrival' | 'rise' | 'settle', previousDepth: number, done?: () => void) {\n request(time => {\n if (change === 'settle') tails(depth, time, enterSpring(), 0);\n else tails(depth, time, enterSpring(), 0, index => {\n if (index > depth) return { opacity: 0 };\n if (change === 'arrival') return { slot: index - 1, opacity: 1 };\n return { slot: index + 1, opacity: index + 1 <= previousDepth ? 1 : 0 };\n });\n after('tails', tailKeys, done);\n });\n },\n setBadge(visible: boolean) { request(time => to('badge', visible ? 1 : 0, badgeSpring(), time)); },\n /** True while the layer's incoming side is still fading in: a further update joins it instead of restarting. */\n swapping(layer: SwapLayer): boolean { return !!values[swaps(m)[layer][0]].animation; },\n /** The sampler's clock (real ms), so the host's update timing follows the same source. */\n now(): number { return options.now(); },\n /** Opening: tails and badge leave in 150 ms; close, body and indicator appear after 100 ms. */\n open(done?: () => void) {\n request(time => {\n for (const index of [1, 2] as const) { to(`tail${index}`, 0, tween(m.tails), time); to(`tail${index}Opacity`, 0, tween(m.tails), time); }\n to('badge', 0, tween(m.tails), time);\n jump('chromeOut', 0);\n jump('chrome', 0);\n to('chrome', 1, tween(m.chromeIn), time, m.chromeDelay);\n after('tails', tailKeys, done);\n });\n },\n /**\n * Collapsing: the chrome snapshot fades in 70 ms while the shape springs back;\n * tails and badge return during the last 150 ms of the shape spring.\n */\n collapse(depth: number, badge: boolean, done?: { chrome?: () => void; tails?: () => void }) {\n request(time => {\n jump('chrome', 0);\n jump('chromeOut', 1);\n to('chromeOut', 0, tween(m.chromeOut), time);\n after('chrome', ['chromeOut'], done?.chrome);\n const delay = Math.max(0, Math.max(remaining('width', time), remaining('height', time)) - m.tails) * timeScale;\n tails(depth, time, tween(m.tails), delay, () => ({ slot: 0, opacity: 0 }));\n to('badge', badge ? 1 : 0, tween(m.tails), time, delay);\n after('tails', tailKeys, done?.tails);\n });\n },\n /** One outgoing snapshot per layer: a new swap restarts from the live layer's current look. */\n swap(layer: SwapLayer, done?: () => void, incomingOnly = false) {\n request(time => swap(layer, time, done, incomingOnly));\n },\n /** Slide inside a fixed shell. The outgoing snapshot follows the incoming layer one width behind. */\n slide(direction: 1 | -1, width: number, done?: () => void) {\n request(time => {\n if (reduced) {\n jump('slide', 0);\n jump('slideOut', 1); jump('slideIn', 0);\n to('slideOut', 0, tween(m.reduced), time); to('slideIn', 1, tween(m.reduced), time);\n } else {\n jump('slideOut', 1); jump('slideIn', 1);\n // Keep the strip continuous and its velocity when a slide interrupts a slide.\n const state = values.slide;\n state.value += direction * width;\n to('slide', 0, m.slide, time);\n }\n slideDirection = direction;\n slideWidth = width;\n after('slide', ['slide', 'slideIn', 'slideOut'], done);\n });\n },\n /** The finger owns the channel: no spring, no velocity until `release`. */\n drag(channel: DragChannel, value: number) {\n request(() => { if (Number.isFinite(value)) jump(channel, value); });\n },\n /**\n * The finger lets go: the channel springs home (0) with the release velocity in px/s.\n * A committed navigation instead keeps the offset and velocity and calls `slide`.\n */\n release(channel: DragChannel, velocity: number, done?: () => void) {\n request(time => {\n values[channel].velocity = Number.isFinite(velocity) ? velocity : 0;\n to(channel, 0, m.slide, time);\n after(`release:${channel}`, [channel], done);\n });\n },\n /** Sets the speed a following `slide` starts with (a swipe released towards a neighbour). */\n fling(channel: DragChannel, velocity: number) {\n if (!disposed && !values[channel].animation) values[channel].velocity = Number.isFinite(velocity) ? velocity : 0;\n },\n setProgress(value: number | null, immediate: boolean) {\n request(time => { if (value === null || immediate) jump('progress', value ?? 0); else to('progress', value, tween(m.progress), time); });\n },\n setHover(active: boolean) { request(time => to('lift', active ? 1 : 0, tween(m.hover), time)); },\n setReducedMotion(next: boolean) {\n if (disposed || reduced === next) return;\n request(time => {\n reduced = next;\n if (!reduced) return;\n for (const key of channelKeys) {\n const state = values[key];\n if (!state.animation) continue;\n if (spatial.has(key)) jump(key, state.target);\n else { state.animation = null; state.velocity = 0; to(key, state.target, tween(m.reduced), time); }\n }\n });\n },\n setTimeScale(next: number | undefined) {\n const scale = validScale(next);\n if (disposed || scale === timeScale) return;\n const time = options.now();\n sample(time);\n // Rebase running animations so their generator time stays continuous.\n for (const key of channelKeys) {\n const animation = values[key].animation;\n if (animation) animation.start = time - (time - animation.start) * timeScale / scale;\n }\n timeScale = scale;\n },\n /** New constants apply to transitions started from now on; running ones keep their curves. */\n setConstants(next: CloudletMotionConstants) { m = next; },\n /** The constants in effect (the renderer reads offsets and blur from them). */\n get constants() { return m; },\n /** True while a frame is scheduled; an idle host never keeps a RAF loop. */\n get running() { return frame !== null; },\n dispose() {\n if (disposed) return;\n disposed = true;\n if (frame !== null) options.cancelFrame(frame);\n frame = null;\n groups.clear();\n for (const key of channelKeys) values[key].animation = null;\n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IAAGsC,EAAKtC,GAAK4B,EAAM,MAAM,KACrC,EAAM,YAAY,MAAM,EAAM,WAAW,GAAGW,EAAGvC,GAAK4B,EAAM,QAAQpC,EAAMkB,EAAE,OAAO,GAAGqB,CAAI;IACjG;GACF,CAAC;EACH;EACA,aAAa,GAA0B;GACrC,IAAM+C,IAAQnE,EAAWqB,CAAI;GAC7B,IAAIhB,KAAY8D,MAAU1D,GAAW;GACrC,IAAMW,IAAOZ,EAAQ,IAAI;GACzB,EAAOY,CAAI;GAEX,KAAK,IAAM/B,KAAOM,GAAa;IAC7B,IAAMuB,IAAYhB,EAAOb,EAAI,CAAC;IAC9B,AAAI6B,MAAW,EAAU,QAAQE,KAAQA,IAAOF,EAAU,SAAST,IAAY0D;GACjF;GACA,IAAYA;EACd;EAEA,aAAa,GAA+B;GAAE,IAAI9C;EAAM;EAExD,IAAI,YAAY;GAAE,OAAOtB;EAAG;EAE5B,IAAI,UAAU;GAAE,OAAOK,MAAU;EAAM;EACvC,UAAU;GACR,IAAI,IACJ;IAGA,AAHA,IAAW,IACPA,MAAU,QAAMI,EAAQ,YAAYJ,CAAK,GAC7C,IAAQ,MACRD,EAAO,MAAM;IACb,KAAK,IAAMd,KAAOM,GAAa,EAAON,EAAI,CAAC,YAAY;GAJ5C;EAKb;CACF;AACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NotificationHandle } from '../contracts/identity.js';
|
|
3
|
+
import type { RendererSnapshot } from '../contracts/internal.js';
|
|
4
|
+
import type { NotificationSnapshot } from '../contracts/snapshots.js';
|
|
5
|
+
type Presented = NotificationSnapshot<ReactNode>;
|
|
6
|
+
/** What the shell shows for one renderer snapshot. */
|
|
7
|
+
export interface ShellView {
|
|
8
|
+
readonly presented: Presented | null;
|
|
9
|
+
readonly open: boolean;
|
|
10
|
+
readonly stack: readonly NotificationHandle[];
|
|
11
|
+
readonly index: number;
|
|
12
|
+
readonly total: number;
|
|
13
|
+
/** Tails behind the collapsed pill (0–2); none in the Island. */
|
|
14
|
+
readonly depth: number;
|
|
15
|
+
/** Missed notifications (overflow), part of the badge and the pill name. */
|
|
16
|
+
readonly missed: number;
|
|
17
|
+
/** Badge number: records in the stack plus missed ones; shown on the pill at ≥ 2 or with missed ones. */
|
|
18
|
+
readonly count: number;
|
|
19
|
+
readonly badge: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function shellView(snapshot: RendererSnapshot<ReactNode>): ShellView;
|
|
22
|
+
/** The collapsed view before the first commit. */
|
|
23
|
+
export declare const emptyView: ShellView;
|
|
24
|
+
/** Visual transition between two committed views; pure, so it is unit-tested without DOM. */
|
|
25
|
+
export interface ShellPlan {
|
|
26
|
+
/**
|
|
27
|
+
* enter: from the edge; exit: the shell leaves (last record); arrival: a new top
|
|
28
|
+
* pill enters while the old one becomes the first tail; rise: the top pill leaves
|
|
29
|
+
* and the first tail moves up; replace: the old pill leaves and a new one enters.
|
|
30
|
+
*/
|
|
31
|
+
readonly presence: 'none' | 'enter' | 'exit' | 'arrival' | 'rise' | 'replace';
|
|
32
|
+
readonly morph: 'none' | 'open' | 'close';
|
|
33
|
+
/** +1: the incoming slide comes from the inline end (towards older records). */
|
|
34
|
+
readonly slide: 0 | 1 | -1;
|
|
35
|
+
readonly header: boolean;
|
|
36
|
+
readonly body: boolean;
|
|
37
|
+
readonly badge: boolean;
|
|
38
|
+
readonly page: boolean;
|
|
39
|
+
/** Same record, new message: hide it from the scheduler until the swap is readable. */
|
|
40
|
+
readonly begin: boolean;
|
|
41
|
+
readonly tails: 'none' | 'arrival' | 'rise' | 'settle';
|
|
42
|
+
}
|
|
43
|
+
export declare function planShell(previous: ShellView, next: ShellView): ShellPlan;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/react/plan.ts"],"names":[],"mappings":"AAAA,O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AAC,CAAC,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;CACxD;AAWD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,CAmCzE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region src/react/plan.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = e.notifications.find((e) => e.location === "current") ?? null, n = e.island.open && t !== null, r = e.stack.length, i = e.overflow.pending ? e.overflow.count : 0;
|
|
4
|
+
return {
|
|
5
|
+
presented: t,
|
|
6
|
+
open: n,
|
|
7
|
+
stack: e.stack,
|
|
8
|
+
total: r,
|
|
9
|
+
index: t ? e.stack.indexOf(t.handle) : -1,
|
|
10
|
+
depth: n || !t ? 0 : Math.min(2, Math.max(0, r - 1)),
|
|
11
|
+
missed: i,
|
|
12
|
+
count: r + i,
|
|
13
|
+
badge: !n && !!t && (r > 1 || i > 0)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var t = {
|
|
17
|
+
presented: null,
|
|
18
|
+
open: !1,
|
|
19
|
+
stack: [],
|
|
20
|
+
index: -1,
|
|
21
|
+
total: 0,
|
|
22
|
+
depth: 0,
|
|
23
|
+
missed: 0,
|
|
24
|
+
count: 0,
|
|
25
|
+
badge: !1
|
|
26
|
+
}, n = (e) => `${e.kind}\u0000${e.content.title}`;
|
|
27
|
+
function r(e) {
|
|
28
|
+
let { content: t, operation: n, action: r } = e, i = t.description;
|
|
29
|
+
return [
|
|
30
|
+
i?.kind,
|
|
31
|
+
i?.kind === "text" ? i.text : "",
|
|
32
|
+
t.progress?.kind,
|
|
33
|
+
t.action?.kind,
|
|
34
|
+
t.action?.label,
|
|
35
|
+
r.status === "failed" ? r.message : "",
|
|
36
|
+
n?.status,
|
|
37
|
+
n?.canRetry,
|
|
38
|
+
n?.canCancel
|
|
39
|
+
].join("\0");
|
|
40
|
+
}
|
|
41
|
+
function i(e, t) {
|
|
42
|
+
let i = {
|
|
43
|
+
presence: "none",
|
|
44
|
+
morph: "none",
|
|
45
|
+
slide: 0,
|
|
46
|
+
header: !1,
|
|
47
|
+
body: !1,
|
|
48
|
+
badge: !1,
|
|
49
|
+
page: !1,
|
|
50
|
+
begin: !1,
|
|
51
|
+
tails: "none"
|
|
52
|
+
}, a = e.presented, o = t.presented;
|
|
53
|
+
return o ? a ? (e.open !== t.open && (i.morph = t.open ? "open" : "close"), a.handle === o.handle ? (i.header = n(a) !== n(o) || a.content.icon !== o.content.icon, i.body = e.open && t.open && (r(a) !== r(o) || a.content.description?.kind === "rich" && o.content.description?.kind === "rich" && a.content.description.content !== o.content.description.content), i.begin = a.kind !== o.kind || a.operation?.status !== o.operation?.status) : e.open && t.open ? (i.slide = t.index >= e.index ? 1 : -1, i.header = n(a) !== n(o) || a.content.icon !== o.content.icon) : i.morph === "none" ? t.stack.includes(a.handle) ? (i.presence = "arrival", i.tails = "arrival", i.header = !0) : e.stack.includes(o.handle) ? (i.presence = "rise", i.tails = "rise") : i.presence = "replace" : i.header = !0, i.tails === "none" && i.morph === "none" && !t.open && e.depth !== t.depth && (i.tails = "settle"), i.badge = e.badge && t.badge && e.count !== t.count, i.page = e.open && t.open && t.total > 5 && (e.index !== t.index || e.total !== t.total), i) : (i.presence = "enter", i) : (a && (i.presence = "exit"), i);
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { t as emptyView, i as planShell, e as shellView };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","names":["shellView","presented","snapshot","item","open","total","missed","emptyView","headerKey","bodyKey","description","content","action","operation","planShell","plan","before","previous","after","next"],"sources":["../../src/react/plan.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { NotificationHandle } from '../contracts/identity.js';\nimport type { RendererSnapshot } from '../contracts/internal.js';\nimport type { NotificationSnapshot } from '../contracts/snapshots.js';\n\ntype Presented = NotificationSnapshot<ReactNode>;\n\n/** What the shell shows for one renderer snapshot. */\nexport interface ShellView {\n readonly presented: Presented | null;\n readonly open: boolean;\n readonly stack: readonly NotificationHandle[];\n readonly index: number;\n readonly total: number;\n /** Tails behind the collapsed pill (0–2); none in the Island. */\n readonly depth: number;\n /** Missed notifications (overflow), part of the badge and the pill name. */\n readonly missed: number;\n /** Badge number: records in the stack plus missed ones; shown on the pill at ≥ 2 or with missed ones. */\n readonly count: number;\n readonly badge: boolean;\n}\n\nexport function shellView(snapshot: RendererSnapshot<ReactNode>): ShellView {\n const presented = snapshot.notifications.find(item => item.location === 'current') ?? null;\n const open = snapshot.island.open && presented !== null;\n const total = snapshot.stack.length;\n const missed = snapshot.overflow.pending ? snapshot.overflow.count : 0;\n return { presented, open, stack: snapshot.stack, total, index: presented ? snapshot.stack.indexOf(presented.handle) : -1,\n depth: open || !presented ? 0 : Math.min(2, Math.max(0, total - 1)),\n missed, count: total + missed, badge: !open && !!presented && (total > 1 || missed > 0) };\n}\n\n/** The collapsed view before the first commit. */\nexport const emptyView: ShellView = { presented: null, open: false, stack: [], index: -1, total: 0, depth: 0, missed: 0, count: 0, badge: false };\n\n/** Visual transition between two committed views; pure, so it is unit-tested without DOM. */\nexport interface ShellPlan {\n /**\n * enter: from the edge; exit: the shell leaves (last record); arrival: a new top\n * pill enters while the old one becomes the first tail; rise: the top pill leaves\n * and the first tail moves up; replace: the old pill leaves and a new one enters.\n */\n readonly presence: 'none' | 'enter' | 'exit' | 'arrival' | 'rise' | 'replace';\n readonly morph: 'none' | 'open' | 'close';\n /** +1: the incoming slide comes from the inline end (towards older records). */\n readonly slide: 0 | 1 | -1;\n readonly header: boolean;\n readonly body: boolean;\n readonly badge: boolean;\n readonly page: boolean;\n /** Same record, new message: hide it from the scheduler until the swap is readable. */\n readonly begin: boolean;\n readonly tails: 'none' | 'arrival' | 'rise' | 'settle';\n}\n\nconst headerKey = (item: Presented) => `${item.kind}\\u0000${item.content.title}`;\nfunction bodyKey(item: Presented) {\n const { content, operation, action } = item;\n const description = content.description;\n return [description?.kind, description?.kind === 'text' ? description.text : '', content.progress?.kind,\n content.action?.kind, content.action?.label, action.status === 'failed' ? action.message : '',\n operation?.status, operation?.canRetry, operation?.canCancel].join('\\u0000');\n}\n\nexport function planShell(previous: ShellView, next: ShellView): ShellPlan {\n const plan = { presence: 'none', morph: 'none', slide: 0, header: false, body: false, badge: false, page: false,\n begin: false, tails: 'none' } as { -readonly [Key in keyof ShellPlan]: ShellPlan[Key] };\n const before = previous.presented;\n const after = next.presented;\n if (!after) {\n if (before) plan.presence = 'exit';\n return plan;\n }\n if (!before) {\n plan.presence = 'enter';\n return plan;\n }\n if (previous.open !== next.open) plan.morph = next.open ? 'open' : 'close';\n if (before.handle !== after.handle) {\n if (previous.open && next.open) {\n // Only the body slides: the title and icon blur-swap in place.\n plan.slide = next.index >= previous.index ? 1 : -1;\n plan.header = headerKey(before) !== headerKey(after) || before.content.icon !== after.content.icon;\n }\n else if (plan.morph !== 'none') plan.header = true;\n else if (next.stack.includes(before.handle)) { plan.presence = 'arrival'; plan.tails = 'arrival'; plan.header = true; }\n else if (previous.stack.includes(after.handle)) { plan.presence = 'rise'; plan.tails = 'rise'; }\n else plan.presence = 'replace';\n } else {\n plan.header = headerKey(before) !== headerKey(after) || before.content.icon !== after.content.icon;\n plan.body = previous.open && next.open && (bodyKey(before) !== bodyKey(after)\n || (before.content.description?.kind === 'rich' && after.content.description?.kind === 'rich'\n && before.content.description.content !== after.content.description.content));\n plan.begin = before.kind !== after.kind || before.operation?.status !== after.operation?.status;\n }\n if (plan.tails === 'none' && plan.morph === 'none' && !next.open && previous.depth !== next.depth) plan.tails = 'settle';\n plan.badge = previous.badge && next.badge && previous.count !== next.count;\n plan.page = previous.open && next.open && next.total > 5 && (previous.index !== next.index || previous.total !== next.total);\n return plan;\n}\n"],"mappings":";AAuBA,SAAgBA,EAAU,GAAkD;CAC1E,IAAMC,IAAYC,EAAS,cAAc,MAAK,MAAQC,EAAK,aAAa,SAAS,KAAK,MAChFC,IAAOF,EAAS,OAAO,QAAQD,MAAc,MAC7CI,IAAQH,EAAS,MAAM,QACvBI,IAASJ,EAAS,SAAS,UAAUA,EAAS,SAAS,QAAQ;CACrE,OAAO;EAAE;EAAW;EAAM,OAAOA,EAAS;EAAO;EAAO,OAAOD,IAAYC,EAAS,MAAM,QAAQD,EAAU,MAAM,IAAI;EACpH,OAAOG,KAAQ,CAACH,IAAY,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGI,IAAQ,CAAC,CAAC;EAClE;EAAQ,OAAOA,IAAQC;EAAQ,OAAO,CAACF,KAAQ,CAAC,CAACH,MAAcI,IAAQ,KAAKC,IAAS;CAAG;AAC5F;AAGA,IAAaC,IAAuB;CAAE,WAAW;CAAM,MAAM;CAAO,OAAO,CAAC;CAAG,OAAO;CAAI,OAAO;CAAG,OAAO;CAAG,QAAQ;CAAG,OAAO;CAAG,OAAO;AAAM,GAsB1IC,KAAa,MAAoB,GAAGL,EAAK,KAAK,QAAQA,EAAK,QAAQ;AACzE,SAASM,EAAQ,GAAiB;CAChC,IAAM,EAAE,YAAS,cAAW,cAAWN,GACjCO,IAAcC,EAAQ;CAC5B,OAAO;EAACD,GAAa;EAAMA,GAAa,SAAS,SAASA,EAAY,OAAO;EAAIC,EAAQ,UAAU;EACjGA,EAAQ,QAAQ;EAAMA,EAAQ,QAAQ;EAAOC,EAAO,WAAW,WAAWA,EAAO,UAAU;EAC3FC,GAAW;EAAQA,GAAW;EAAUA,GAAW;CAA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EAAK,QAAQF,EAAS,SAASE,EAAK,SAASF,EAAS,UAAUE,EAAK,OACrE,EAAK,OAAOF,EAAS,QAAQE,EAAK,QAAQA,EAAK,QAAQ,MAAMF,EAAS,UAAUE,EAAK,SAASF,EAAS,UAAUE,EAAK,QAC/GJ,MAxBL,EAAK,WAAW,SACTA,MALHC,MAAQ,EAAK,WAAW,SACrBD;AA4BX"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ReactCloudletController, ToasterProps } from '../react.js';
|
|
3
|
+
export declare function AttachedToaster({ controller, options }: {
|
|
4
|
+
controller: ReactCloudletController;
|
|
5
|
+
options: ToasterProps;
|
|
6
|
+
}): ReactElement | null;
|
|
7
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/react/renderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAezE,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IAAE,UAAU,EAAE,uBAAuB,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GAAG,YAAY,GAAG,IAAI,CAwD5I"}
|