@cloudlet/toast 1.4.0 → 1.5.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +165 -0
  2. package/README.md +3 -0
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +19 -15
  5. package/dist/agent.js.map +1 -1
  6. package/dist/center-react.d.ts +286 -0
  7. package/dist/center-react.d.ts.map +1 -0
  8. package/dist/center-react.js +2 -0
  9. package/dist/center.d.ts +3 -0
  10. package/dist/center.d.ts.map +1 -0
  11. package/dist/center.js +1 -0
  12. package/dist/core/agent-port.d.ts +2 -0
  13. package/dist/core/agent-port.d.ts.map +1 -1
  14. package/dist/core/agent-port.js +3 -0
  15. package/dist/core/agent-port.js.map +1 -1
  16. package/dist/react/card.d.ts +4 -0
  17. package/dist/react/card.d.ts.map +1 -1
  18. package/dist/react/card.js +3 -8
  19. package/dist/react/card.js.map +1 -1
  20. package/dist/react/center-backdrop.d.ts +69 -0
  21. package/dist/react/center-backdrop.d.ts.map +1 -0
  22. package/dist/react/center-backdrop.js +81 -0
  23. package/dist/react/center-backdrop.js.map +1 -0
  24. package/dist/react/center-clear.d.ts +16 -0
  25. package/dist/react/center-clear.d.ts.map +1 -0
  26. package/dist/react/center-clear.js +24 -0
  27. package/dist/react/center-clear.js.map +1 -0
  28. package/dist/react/center-gestures.d.ts +47 -0
  29. package/dist/react/center-gestures.d.ts.map +1 -0
  30. package/dist/react/center-gestures.js +74 -0
  31. package/dist/react/center-gestures.js.map +1 -0
  32. package/dist/react/center-motion.d.ts +174 -0
  33. package/dist/react/center-motion.d.ts.map +1 -0
  34. package/dist/react/center-motion.js +344 -0
  35. package/dist/react/center-motion.js.map +1 -0
  36. package/dist/react/center.d.ts +15 -0
  37. package/dist/react/center.d.ts.map +1 -0
  38. package/dist/react/center.js +1287 -0
  39. package/dist/react/center.js.map +1 -0
  40. package/dist/react/focus.d.ts +7 -0
  41. package/dist/react/focus.d.ts.map +1 -0
  42. package/dist/react/focus.js +14 -0
  43. package/dist/react/focus.js.map +1 -0
  44. package/dist/react/gestures.d.ts +33 -2
  45. package/dist/react/gestures.d.ts.map +1 -1
  46. package/dist/react/gestures.js +181 -149
  47. package/dist/react/gestures.js.map +1 -1
  48. package/dist/react/host.d.ts.map +1 -1
  49. package/dist/react/host.js +287 -283
  50. package/dist/react/host.js.map +1 -1
  51. package/dist/react/motion.d.ts +18 -11
  52. package/dist/react/motion.d.ts.map +1 -1
  53. package/dist/react/motion.js +6 -3
  54. package/dist/react/motion.js.map +1 -1
  55. package/dist/react/reduced.d.ts +24 -0
  56. package/dist/react/reduced.d.ts.map +1 -0
  57. package/dist/react/reduced.js +35 -0
  58. package/dist/react/reduced.js.map +1 -0
  59. package/dist/react/zoom.d.ts +12 -0
  60. package/dist/react/zoom.d.ts.map +1 -0
  61. package/dist/react/zoom.js +21 -0
  62. package/dist/react/zoom.js.map +1 -0
  63. package/dist/react.d.ts +4 -0
  64. package/dist/react.d.ts.map +1 -1
  65. package/dist/styles.css +1 -1
  66. package/package.json +2 -1
  67. package/src/agent.ts +11 -6
  68. package/src/center-react.ts +300 -0
  69. package/src/center.ts +27 -0
  70. package/src/core/agent-port.ts +3 -0
  71. package/src/react/card.tsx +5 -6
  72. package/src/react/center-backdrop.tsx +151 -0
  73. package/src/react/center-clear.ts +56 -0
  74. package/src/react/center-gestures.ts +143 -0
  75. package/src/react/center-motion.ts +504 -0
  76. package/src/react/center.tsx +1557 -0
  77. package/src/react/focus.ts +18 -0
  78. package/src/react/gestures.ts +127 -37
  79. package/src/react/host.tsx +17 -5
  80. package/src/react/motion.ts +16 -9
  81. package/src/react/reduced.ts +52 -0
  82. package/src/react/zoom.ts +26 -0
  83. package/src/react.ts +4 -0
@@ -1,252 +1,284 @@
1
1
  import { MOTION as e } from "./motion.js";
2
+ import { cssZoom as t } from "./zoom.js";
2
3
  //#region src/react/gestures.ts
3
- var { swipe: t } = e;
4
- function n(e, n, r = t.rubberBand) {
5
- return !Number.isFinite(e) || !(n > 0) ? 0 : Math.sign(e) * (1 - 1 / (Math.abs(e) * r / n + 1)) * n;
4
+ var { swipe: n } = e;
5
+ function r(e, t, r = n.rubberBand) {
6
+ return !Number.isFinite(e) || !(t > 0) ? 0 : Math.sign(e) * (1 - 1 / (Math.abs(e) * r / t + 1)) * t;
6
7
  }
7
- function r(e, n, r, i) {
8
+ function i(e, t, r, i) {
8
9
  let a = e > 0 ? 1 : e < 0 ? -1 : 0;
9
10
  if (!a || !(a > 0 ? i.positive : i.negative)) return 0;
10
- let o = Number.isFinite(n) ? n * a : 0;
11
- if (o < -t.velocity) return 0;
11
+ let o = Number.isFinite(t) ? t * a : 0;
12
+ if (o <= -n.velocity) return 0;
12
13
  let s = Math.abs(e);
13
- return r > 0 && s > r * t.distance || s >= t.minDistance && o > t.velocity ? a : 0;
14
+ return r > 0 && s > r * n.distance || s >= n.flick && o >= n.velocity ? a : 0;
14
15
  }
15
- var i = "button,a,input,select,textarea,summary,label,[role=\"button\"],[role=\"link\"],[contenteditable]:not([contenteditable=\"false\"])";
16
- function a(e, n) {
17
- let a = e.ownerDocument.defaultView, o = null, s = null, c = 0, l = !1;
18
- if (!a) return {
16
+ function a(e = "wheel") {
17
+ let t = [];
18
+ return {
19
+ reset(e, n) {
20
+ t.length = 0, t.push({
21
+ time: e,
22
+ position: n
23
+ });
24
+ },
25
+ add(e, r) {
26
+ for (t.push({
27
+ time: e,
28
+ position: r
29
+ }); t.length > 2 && t[1].time <= e - n.window;) t.shift();
30
+ },
31
+ get() {
32
+ let r = t[t.length - 1], i = t[0];
33
+ if (!r || !i || r === i) return 0;
34
+ let a = e === "pointer" ? Math.max(i.time, Math.min(t[1].time - 16, r.time - n.window)) : i.time, o = Math.max(r.time - a, 16), s = (r.position - i.position) / o;
35
+ return Number.isFinite(s) ? Math.max(-n.maxVelocity, Math.min(n.maxVelocity, s)) : 0;
36
+ }
37
+ };
38
+ }
39
+ var o = "button,a,input,select,textarea,summary,label,[role=\"button\"],[role=\"link\"],[contenteditable]:not([contenteditable=\"false\"])";
40
+ function s(e, r) {
41
+ let s = e.ownerDocument.defaultView, c = null, l = null, u = 0, d = !1;
42
+ if (!s) return {
19
43
  cancel() {},
20
44
  dispose() {},
21
45
  get active() {
22
46
  return !1;
23
47
  }
24
48
  };
25
- function u() {
26
- let t = o;
27
- return t ? (o = null, delete e.dataset.dragging, t.captured && e.hasPointerCapture?.(t.pointer) && e.releasePointerCapture(t.pointer), t.candidate.release(), t) : null;
49
+ function f() {
50
+ let t = c;
51
+ return t ? (c = null, delete e.dataset.dragging, t.captured && e.hasPointerCapture?.(t.pointer) && e.releasePointerCapture(t.pointer), t.candidate.release(), t) : null;
28
52
  }
29
- function d(t) {
30
- let n = s;
31
- n && (s = null, a.clearTimeout(n.timer), n.session && delete e.dataset.dragging, n.candidate?.release(), t ? n.session?.end(n.offset, n.velocity) : n.session?.cancel());
53
+ function p(t) {
54
+ let n = l;
55
+ n && (l = null, r.holdsStream && s.removeEventListener("wheel", D, !1), s.clearTimeout(n.timer), n.session && delete e.dataset.dragging, n.candidate?.release(), t ? n.session?.end(n.offset, n.velocity.get()) : n.session?.cancel());
32
56
  }
33
- let f = () => {
34
- u()?.session?.cancel(), d(!1);
35
- }, p = (e) => {
36
- o && e.pointerId !== o.pointer && f();
37
- }, m = (t) => {
38
- if (l || o || !t.isPrimary || t.button !== 0) return;
39
- c = 0;
40
- let r = t.target;
41
- if (!(r instanceof a.Element)) return;
42
- let s = r.closest(i);
43
- if (s && e.contains(s) && !s.matches("[data-cloudlet-pill]")) return;
44
- d(!1);
45
- let u = n.begin(r, "pointer");
46
- u && (o = {
47
- pointer: t.pointerId,
48
- candidate: u,
49
- startX: t.clientX,
50
- startY: t.clientY,
57
+ let m = () => {
58
+ f()?.session?.cancel(), p(!1);
59
+ }, h = (e) => {
60
+ c && e.pointerId !== c.pointer && m();
61
+ }, g = (n) => {
62
+ if (d || c || !n.isPrimary || n.button !== 0) return;
63
+ u = 0;
64
+ let i = n.target;
65
+ if (!(i instanceof s.Element)) return;
66
+ let l = i.closest(o);
67
+ if (l && e.contains(l) && !l.matches("[data-cloudlet-pill]")) return;
68
+ p(!1);
69
+ let f = r.begin(i, "pointer");
70
+ if (!f) return;
71
+ let m = a("pointer"), h = a("pointer");
72
+ m.reset(n.timeStamp, 0), h.reset(n.timeStamp, 0), c = {
73
+ pointer: n.pointerId,
74
+ candidate: f,
75
+ zoom: t(e),
76
+ startX: n.clientX,
77
+ startY: n.clientY,
51
78
  session: null,
52
79
  axis: null,
53
80
  captured: !1,
54
81
  x: 0,
55
82
  y: 0,
56
- lastX: t.clientX,
57
- lastY: t.clientY,
58
- time: t.timeStamp,
59
- velocityX: 0,
60
- velocityY: 0
61
- });
83
+ velocityX: m,
84
+ velocityY: h,
85
+ sampled: n.timeStamp
86
+ };
62
87
  };
63
- function h(e, t, n = !1) {
64
- let r = t.timeStamp - e.time;
65
- for (let i of ["X", "Y"]) {
66
- let a = i === "X" ? t.clientX : t.clientY, o = e[`last${i}`];
67
- r > 0 && a !== o ? e[`velocity${i}`] = (a - o) / r : r > 0 && (!n || r > 80) && (e[`velocity${i}`] = 0), e[`last${i}`] = a;
88
+ function _(e, t) {
89
+ for (let n of t.getCoalescedEvents?.() ?? []) {
90
+ let r = n.timeStamp;
91
+ !Number.isFinite(r) || r <= e.sampled || r >= t.timeStamp || (e.sampled = r, e.velocityX.add(r, (n.clientX - e.startX) / e.zoom), e.velocityY.add(r, (n.clientY - e.startY) / e.zoom));
68
92
  }
69
- e.x = t.clientX - e.startX, e.y = t.clientY - e.startY, e.time = t.timeStamp;
93
+ e.x = (t.clientX - e.startX) / e.zoom, e.y = (t.clientY - e.startY) / e.zoom, e.velocityX.add(t.timeStamp, e.x), e.velocityY.add(t.timeStamp, e.y), e.sampled = Math.max(e.sampled, t.timeStamp);
70
94
  }
71
- let g = (r) => {
72
- let i = o;
73
- if (i && r.pointerId === i.pointer) {
74
- if (h(i, r), !i.session) {
75
- let n = Math.abs(i.x), r = Math.abs(i.y);
76
- if (Math.max(n, r) < t.intent) return;
77
- let s = n > r ? "x" : "y", c = i.candidate[s] ? i.candidate.start(s) : null;
78
- if (!c || o !== i) {
79
- f();
95
+ let v = (t) => {
96
+ let i = c;
97
+ if (i && t.pointerId === i.pointer) {
98
+ if (_(i, t), !i.session) {
99
+ let t = Math.abs(i.x), r = Math.abs(i.y);
100
+ if (Math.max(t, r) < n.intent) return;
101
+ let a = t > r ? "x" : "y", o = a === "x" ? i.x : i.y, l = i.candidate[a] ? i.candidate.start(a, o < 0 ? -1 : 1) : null;
102
+ if (!l || c !== i) {
103
+ m();
80
104
  return;
81
105
  }
82
- i.session = c, i.axis = s;
106
+ i.session = l, i.axis = a;
83
107
  try {
84
108
  e.setPointerCapture(i.pointer), i.captured = !0;
85
109
  } catch {
86
- f();
110
+ m();
87
111
  return;
88
112
  }
89
- e.dataset.dragging = s;
90
- let l = a.getSelection();
91
- l?.anchorNode && e.contains(l.anchorNode) && l.removeAllRanges();
113
+ e.dataset.dragging = a;
114
+ let u = s.getSelection();
115
+ u?.anchorNode && e.contains(u.anchorNode) && u.removeAllRanges();
92
116
  }
93
- c = n.now() + t.suppressClick, r.cancelable && r.preventDefault(), i.session.move(i.axis === "x" ? i.x : i.y);
117
+ u = r.now() + n.suppressClick, t.cancelable && t.preventDefault(), i.session.move(i.axis === "x" ? i.x : i.y);
94
118
  }
95
- }, _ = (e) => {
96
- let t = o;
119
+ }, y = (e) => {
120
+ let t = c;
97
121
  if (!t || e.pointerId !== t.pointer) return;
98
- h(t, e, !0), u();
122
+ _(t, e), f();
99
123
  let n = t.axis === "x";
100
- t.session?.end(n ? t.x : t.y, n ? t.velocityX : t.velocityY);
101
- }, v = (e) => {
102
- o?.pointer === e.pointerId && f();
103
- }, y = (t) => {
104
- t.target === e && o?.captured && o.pointer === t.pointerId && f();
124
+ t.session?.end(n ? t.x : t.y, n ? t.velocityX.get() : t.velocityY.get());
105
125
  }, b = (e) => {
106
- o && (e.type === "dragstart" || o.session) && e.preventDefault();
107
- }, x = [
126
+ c?.pointer === e.pointerId && m();
127
+ }, x = (t) => {
128
+ t.target === e && c?.captured && c.pointer === t.pointerId && m();
129
+ }, S = (e) => {
130
+ c && (e.type === "dragstart" || c.session) && e.preventDefault();
131
+ }, C = (e) => {
132
+ e.detail === 0 || u === 0 || r.now() > u || (u = 0, e.preventDefault(), e.stopImmediatePropagation());
133
+ }, w = (o) => {
134
+ if (d || c || o.ctrlKey || r.holdsStream && !l && !(o.target instanceof s.Node && e.contains(o.target))) return;
135
+ let u = l?.zoom ?? t(e), f = o.deltaMode === 1 ? 16 : o.deltaMode === 2 ? e.clientWidth || 1 : 1 / u, m = o.deltaX * f, h = o.deltaY * f, g = o.timeStamp;
136
+ if (l?.spent) {
137
+ let e = l.lastDx;
138
+ if (g - l.spentAt > n.wheelLock && (Math.abs(m) > Math.abs(e) * 1.5 + 2 || m !== 0 && e !== 0 && Math.sign(m) !== Math.sign(e))) p(!1);
139
+ else {
140
+ s.clearTimeout(l.timer), l.timer = s.setTimeout(() => p(!0), n.wheelIdle), l.lastDx = m, Math.abs(m) >= Math.abs(h) && o.preventDefault();
141
+ return;
142
+ }
143
+ }
144
+ l || (l = {
145
+ claimed: o.target instanceof s.Element && (r.claimsWheel?.(o.target) ?? !1),
146
+ zoom: u,
147
+ axis: null,
148
+ travelX: 0,
149
+ travelY: 0,
150
+ candidate: null,
151
+ session: null,
152
+ spent: !1,
153
+ spentAt: 0,
154
+ lastDx: m,
155
+ offset: 0,
156
+ velocity: a(),
157
+ time: g,
158
+ timer: 0
159
+ }, r.holdsStream && s.addEventListener("wheel", D, {
160
+ capture: !1,
161
+ passive: !1
162
+ }));
163
+ let _ = l;
164
+ if (s.clearTimeout(_.timer), _.timer = s.setTimeout(() => p(!0), n.wheelIdle), _.lastDx = m, !_.axis) {
165
+ _.travelX += m, _.travelY += h;
166
+ let e = Math.abs(_.travelX), t = Math.abs(_.travelY);
167
+ if (Math.max(e, t) >= n.intent) {
168
+ _.axis = e > t ? "x" : "y";
169
+ let n = o.target, i = _.axis === "x" && n instanceof s.Element ? r.begin(n, "wheel") : null, a = i?.x ? i.start("x", _.travelX > 0 ? -1 : 1) : null;
170
+ i && !a && i.release(), a && (_.candidate = i, _.session = a, _.offset = m - _.travelX, _.velocity.reset(_.time, _.offset));
171
+ }
172
+ }
173
+ if (!_.session) {
174
+ _.claimed && (!_.axis || Math.abs(m) > Math.abs(h)) && o.preventDefault(), _.time = g;
175
+ return;
176
+ }
177
+ o.preventDefault(), _.offset -= m, _.time = g, _.velocity.add(g, _.offset), e.dataset.dragging = "x", _.session.move(_.offset);
178
+ let v = _.velocity.get();
179
+ if (_.session.decide ? _.session.decide(_.offset, v) : i(_.offset, v, e.clientWidth || 0, {
180
+ negative: !0,
181
+ positive: !0
182
+ }) !== 0) {
183
+ let t = _.session;
184
+ _.session = null, _.spent = !0, _.spentAt = g, delete e.dataset.dragging, _.candidate?.release(), t.end(_.offset, v);
185
+ }
186
+ }, T = null, E = (e) => {
187
+ T = e, w(e);
188
+ }, D = (e) => {
189
+ e !== T && w(e);
190
+ }, O = [
108
191
  [
109
- a,
192
+ s,
110
193
  "pointerdown",
111
- p,
194
+ h,
112
195
  !0
113
196
  ],
114
197
  [
115
198
  e,
116
199
  "pointerdown",
117
- m,
200
+ g,
118
201
  !1
119
202
  ],
120
203
  [
121
- a,
204
+ s,
122
205
  "pointermove",
123
- g,
206
+ v,
124
207
  !0
125
208
  ],
126
209
  [
127
- a,
210
+ s,
128
211
  "pointerup",
129
- _,
212
+ y,
130
213
  !0
131
214
  ],
132
215
  [
133
- a,
216
+ s,
134
217
  "pointercancel",
135
- v,
218
+ b,
136
219
  !0
137
220
  ],
138
221
  [
139
222
  e,
140
223
  "lostpointercapture",
141
- y,
224
+ x,
142
225
  !1
143
226
  ],
144
227
  [
145
228
  e,
146
229
  "click",
147
- (e) => {
148
- e.detail === 0 || c === 0 || n.now() > c || (c = 0, e.preventDefault(), e.stopImmediatePropagation());
149
- },
230
+ C,
150
231
  !0
151
232
  ],
152
233
  [
153
234
  e,
154
235
  "dragstart",
155
- b,
236
+ S,
156
237
  !1
157
238
  ],
158
239
  [
159
240
  e,
160
241
  "selectstart",
161
- b,
242
+ S,
162
243
  !1
163
244
  ],
164
245
  [
165
246
  e,
166
247
  "wheel",
167
- (i) => {
168
- if (l || o || i.ctrlKey) return;
169
- let c = i.deltaMode === 1 ? 16 : i.deltaMode === 2 && e.clientWidth || 1, u = i.deltaX * c, f = i.deltaY * c, p = i.timeStamp;
170
- if (s?.spent) {
171
- let e = s.lastDx;
172
- if (p - s.spentAt > t.wheelLock && (Math.abs(u) > Math.abs(e) * 1.5 + 2 || u !== 0 && e !== 0 && Math.sign(u) !== Math.sign(e))) d(!1);
173
- else {
174
- a.clearTimeout(s.timer), s.timer = a.setTimeout(() => d(!0), t.wheelIdle), s.lastDx = u, Math.abs(u) >= Math.abs(f) && i.preventDefault();
175
- return;
176
- }
177
- }
178
- s ||= {
179
- claimed: i.target instanceof a.Element && (n.claimsWheel?.(i.target) ?? !1),
180
- axis: null,
181
- travelX: 0,
182
- travelY: 0,
183
- candidate: null,
184
- session: null,
185
- spent: !1,
186
- spentAt: 0,
187
- lastDx: u,
188
- offset: 0,
189
- velocity: 0,
190
- time: p,
191
- timer: 0
192
- };
193
- let m = s;
194
- if (a.clearTimeout(m.timer), m.timer = a.setTimeout(() => d(!0), t.wheelIdle), m.lastDx = u, !m.axis) {
195
- m.travelX += u, m.travelY += f;
196
- let e = Math.abs(m.travelX), r = Math.abs(m.travelY);
197
- if (Math.max(e, r) >= t.intent) {
198
- m.axis = e > r ? "x" : "y";
199
- let t = i.target, o = m.axis === "x" && t instanceof a.Element ? n.begin(t, "wheel") : null, s = o?.x ? o.start("x") : null;
200
- o && !s && o.release(), s && (m.candidate = o, m.session = s, m.offset = u - m.travelX);
201
- }
202
- }
203
- if (!m.session) {
204
- m.claimed && (!m.axis || Math.abs(u) > Math.abs(f)) && i.preventDefault(), m.time = p;
205
- return;
206
- }
207
- i.preventDefault();
208
- let h = p - m.time;
209
- if (h > 0 && (m.velocity = -u / h), m.offset -= u, m.time = p, e.dataset.dragging = "x", m.session.move(m.offset), r(m.offset, m.velocity, e.clientWidth || 0, {
210
- negative: !0,
211
- positive: !0
212
- })) {
213
- let t = m.session;
214
- m.session = null, m.spent = !0, m.spentAt = p, delete e.dataset.dragging, m.candidate?.release(), t.end(m.offset, m.velocity);
215
- }
216
- },
248
+ E,
217
249
  !1
218
250
  ],
219
251
  [
220
- a,
252
+ s,
221
253
  "orientationchange",
222
- f,
254
+ m,
223
255
  !1
224
256
  ]
225
257
  ];
226
- a.screen?.orientation && x.push([
227
- a.screen.orientation,
258
+ s.screen?.orientation && O.push([
259
+ s.screen.orientation,
228
260
  "change",
229
- f,
261
+ m,
230
262
  !1
231
263
  ]);
232
- for (let [e, t, n, r] of x) e.addEventListener(t, n, {
264
+ for (let [e, t, n, r] of O) e.addEventListener(t, n, {
233
265
  capture: r,
234
266
  passive: !1
235
267
  });
236
268
  return {
237
- cancel: f,
269
+ cancel: m,
238
270
  get active() {
239
- return o !== null || s?.session != null;
271
+ return c !== null || l?.session != null;
240
272
  },
241
273
  dispose() {
242
- if (!l) {
243
- l = !0, f();
244
- for (let [e, t, n, r] of x) e.removeEventListener(t, n, r);
274
+ if (!d) {
275
+ d = !0, m();
276
+ for (let [e, t, n, r] of O) e.removeEventListener(t, n, r);
245
277
  }
246
278
  }
247
279
  };
248
280
  }
249
281
  //#endregion
250
- export { a as createSwipe, r as decideRelease, n as rubberBand };
282
+ export { s as createSwipe, a as createVelocity, i as decideRelease, r as rubberBand };
251
283
 
252
284
  //# sourceMappingURL=gestures.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gestures.js","names":["MOTION","rubberBand","swipe","offset","dimension","coefficient","decideRelease","sign","allowed","toward","velocity","distance","interactive","createSwipe","view","root","current","wheel","suppressUntil","disposed","finish","gesture","endWheel","stream","commit","cancel","secondPointer","event","down","target","control","candidate","options","sample","elapsed","axis","position","last","release","move","horizontal","vertical","session","selection","up","x","cancelled","lost","native","listeners","unit","dx","dy","time","previous","type","listener","capture"],"sources":["../../src/react/gestures.ts"],"sourcesContent":["import { MOTION } from './motion.js';\n\nconst { swipe } = MOTION;\n\n/**\n * Edge resistance (iOS-style rubber band): the result approaches `dimension`\n * asymptotically and keeps the sign of the raw finger travel.\n */\nexport function rubberBand(offset: number, dimension: number, coefficient: number = swipe.rubberBand): number {\n if (!Number.isFinite(offset) || !(dimension > 0)) return 0;\n const travel = Math.abs(offset);\n return Math.sign(offset) * (1 - 1 / (travel * coefficient / dimension + 1)) * dimension;\n}\n\n/**\n * Release decision along one axis. Returns the sign of the travel when the swipe\n * commits that way (distance past `MOTION.swipe.distance` of `dimension`, or a flick of\n * at least `minDistance` px faster than `velocity` px/ms), 0 when it springs back.\n * A direction without a destination never commits; a flick back always cancels.\n */\nexport function decideRelease(offset: number, velocity: number, dimension: number,\n allowed: { readonly negative: boolean; readonly positive: boolean }): -1 | 0 | 1 {\n const sign = offset > 0 ? 1 : offset < 0 ? -1 : 0;\n if (!sign || !(sign > 0 ? allowed.positive : allowed.negative)) return 0;\n const toward = Number.isFinite(velocity) ? velocity * sign : 0;\n if (toward < -swipe.velocity) return 0;\n const distance = Math.abs(offset);\n if (dimension > 0 && distance > dimension * swipe.distance) return sign;\n return distance >= swipe.minDistance && toward > swipe.velocity ? sign : 0;\n}\n\nexport type SwipeAxis = 'x' | 'y';\n\n/** A started swipe along one axis. Offsets are raw finger travel in CSS px. */\nexport interface SwipeSession {\n readonly move: (offset: number) => void;\n /** Velocity is CSS px/ms along the axis, positive in the direction of positive offsets. */\n readonly end: (offset: number, velocity: number) => void;\n /** Lost capture, a second pointer, orientation change or an external cancel. */\n readonly cancel: () => void;\n}\n\n/** What may start from one pointerdown or wheel stream; `release` ends the intent window. */\nexport interface SwipeCandidate {\n readonly x: boolean;\n readonly y: boolean;\n readonly start: (axis: SwipeAxis) => SwipeSession | null;\n readonly release: () => void;\n}\n\ninterface SwipeOptions {\n /** Null ignores the input; the candidate is released exactly once. */\n readonly begin: (target: Element, input: 'pointer' | 'wheel') => SwipeCandidate | null;\n /**\n * The open Island under a wheel stream: until the stream's axis is decided, and for every\n * mostly horizontal event after that, the browser gets no wheel event from it (no history swipe),\n * even where no swipe can start (an end of the slider, reduced motion, outside the slides).\n */\n readonly claimsWheel?: (target: Element) => boolean;\n readonly now: () => number;\n}\n\ninterface PointerSwipe {\n readonly pointer: number;\n readonly candidate: SwipeCandidate;\n readonly startX: number;\n readonly startY: number;\n session: SwipeSession | null;\n axis: SwipeAxis | null;\n captured: boolean;\n x: number;\n y: number;\n lastX: number;\n lastY: number;\n time: number;\n velocityX: number;\n velocityY: number;\n}\n\ninterface WheelSwipe {\n /** Started over the open Island (`claimsWheel`). */\n readonly claimed: boolean;\n /** Decided after `MOTION.swipe.intent` px of summed travel, like a pointer. */\n axis: SwipeAxis | null;\n travelX: number;\n travelY: number;\n candidate: SwipeCandidate | null;\n session: SwipeSession | null;\n /** Committed early: the rest of the stream (macOS momentum) is swallowed until it goes idle. */\n spent: boolean;\n spentAt: number;\n lastDx: number;\n offset: number;\n velocity: number;\n time: number;\n timer: number;\n}\n\nconst interactive = 'button,a,input,select,textarea,summary,label,[role=\"button\"],[role=\"link\"],[contenteditable]:not([contenteditable=\"false\"])';\n\n/**\n * Pointer and trackpad ownership for one host. The axis is decided by the first\n * `MOTION.swipe.intent` px; an axis the target does not own is given back to the\n * browser (native scroll) for the rest of the gesture. Buttons and links never start\n * a swipe, except the collapsed pill, which is itself the swipe surface. Layout,\n * physics and store commands stay with the caller.\n */\nexport function createSwipe(root: HTMLElement, options: SwipeOptions) {\n const view = root.ownerDocument.defaultView;\n let current: PointerSwipe | null = null;\n let wheel: WheelSwipe | null = null;\n let suppressUntil = 0;\n let disposed = false;\n if (!view) return { cancel() {}, dispose() {}, get active() { return false; } };\n\n function finish(): PointerSwipe | null {\n const gesture = current;\n if (!gesture) return null;\n // Lost capture, store updates and callbacks can be synchronous/reentrant:\n // clear ownership before releasing anything.\n current = null;\n delete root.dataset.dragging;\n if (gesture.captured && root.hasPointerCapture?.(gesture.pointer)) root.releasePointerCapture(gesture.pointer);\n gesture.candidate.release();\n return gesture;\n }\n function endWheel(commit: boolean) {\n const stream = wheel;\n if (!stream) return;\n wheel = null;\n view!.clearTimeout(stream.timer);\n if (stream.session) delete root.dataset.dragging;\n stream.candidate?.release();\n if (commit) stream.session?.end(stream.offset, stream.velocity);\n else stream.session?.cancel();\n }\n const cancel = () => {\n finish()?.session?.cancel();\n endWheel(false);\n };\n const secondPointer = (event: PointerEvent) => {\n if (current && event.pointerId !== current.pointer) cancel();\n };\n const down = (event: PointerEvent) => {\n // A new deliberate activation must work even if a previous browser did not\n // generate the compatibility click suppressed after an accepted drag.\n if (disposed || current || !event.isPrimary || event.button !== 0) return;\n suppressUntil = 0;\n const target = event.target;\n if (!(target instanceof view.Element)) return;\n const control = target.closest(interactive);\n if (control && root.contains(control) && !control.matches('[data-cloudlet-pill]')) return;\n endWheel(false);\n const candidate = options.begin(target, 'pointer');\n if (!candidate) return;\n current = {\n pointer: event.pointerId, candidate, startX: event.clientX, startY: event.clientY, session: null, axis: null,\n captured: false, x: 0, y: 0, lastX: event.clientX, lastY: event.clientY, time: event.timeStamp, velocityX: 0, velocityY: 0,\n };\n };\n function sample(gesture: PointerSwipe, event: PointerEvent, release = false) {\n const elapsed = event.timeStamp - gesture.time;\n for (const axis of ['X', 'Y'] as const) {\n const position = axis === 'X' ? event.clientX : event.clientY;\n const last = gesture[`last${axis}`];\n // A pause before lifting the finger is not a flick.\n if (elapsed > 0 && position !== last) gesture[`velocity${axis}`] = (position - last) / elapsed;\n else if (elapsed > 0 && (!release || elapsed > 80)) gesture[`velocity${axis}`] = 0;\n gesture[`last${axis}`] = position;\n }\n gesture.x = event.clientX - gesture.startX;\n gesture.y = event.clientY - gesture.startY;\n gesture.time = event.timeStamp;\n }\n const move = (event: PointerEvent) => {\n const gesture = current;\n if (!gesture || event.pointerId !== gesture.pointer) return;\n sample(gesture, event);\n if (!gesture.session) {\n const horizontal = Math.abs(gesture.x);\n const vertical = Math.abs(gesture.y);\n if (Math.max(horizontal, vertical) < swipe.intent) return;\n // The first directional intent wins; an axis the target does not own stays native.\n const axis: SwipeAxis = horizontal > vertical ? 'x' : 'y';\n const session = gesture.candidate[axis] ? gesture.candidate.start(axis) : null;\n if (!session || current !== gesture) { cancel(); return; }\n gesture.session = session;\n gesture.axis = axis;\n try {\n root.setPointerCapture(gesture.pointer);\n gesture.captured = true;\n } catch { cancel(); return; }\n root.dataset.dragging = axis;\n // A text selection left in the host would turn the next press into native drag and drop.\n const selection = view.getSelection();\n if (selection?.anchorNode && root.contains(selection.anchorNode)) selection.removeAllRanges();\n }\n suppressUntil = options.now() + swipe.suppressClick;\n if (event.cancelable) event.preventDefault();\n gesture.session.move(gesture.axis === 'x' ? gesture.x : gesture.y);\n };\n const up = (event: PointerEvent) => {\n const gesture = current;\n if (!gesture || event.pointerId !== gesture.pointer) return;\n sample(gesture, event, true);\n finish();\n const x = gesture.axis === 'x';\n gesture.session?.end(x ? gesture.x : gesture.y, x ? gesture.velocityX : gesture.velocityY);\n };\n const cancelled = (event: PointerEvent) => {\n if (current?.pointer === event.pointerId) cancel();\n };\n // Touch input is implicitly captured by the pressed element; moving the capture to\n // the host fires a bubbling lostpointercapture there. Only the host's own loss counts.\n const lost = (event: PointerEvent) => {\n if (event.target === root && current?.captured && current.pointer === event.pointerId) cancel();\n };\n // While the host owns a press, the browser must not start selecting or dragging content.\n const native = (event: Event) => { if (current && (event.type === 'dragstart' || current.session)) event.preventDefault(); };\n const click = (event: MouseEvent) => {\n // Keyboard/AT clicks have detail=0 and remain available during any return.\n if (event.detail === 0 || suppressUntil === 0 || options.now() > suppressUntil) return;\n suppressUntil = 0;\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n const scroll = (event: WheelEvent) => {\n // Pinch zoom (ctrl+wheel) and a running pointer swipe stay untouched.\n if (disposed || current || event.ctrlKey) return;\n const unit = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? root.clientWidth || 1 : 1;\n const dx = event.deltaX * unit;\n const dy = event.deltaY * unit;\n const time = event.timeStamp;\n if (wheel?.spent) {\n // Momentum only decays. A new swipe accelerates or reverses and starts a fresh stream;\n // vertical scrolling stays native.\n const previous = wheel.lastDx;\n const renewed = time - wheel.spentAt > swipe.wheelLock\n && (Math.abs(dx) > Math.abs(previous) * 1.5 + 2 || (dx !== 0 && previous !== 0 && Math.sign(dx) !== Math.sign(previous)));\n if (renewed) endWheel(false);\n else {\n view.clearTimeout(wheel.timer);\n wheel.timer = view.setTimeout(() => endWheel(true), swipe.wheelIdle);\n wheel.lastDx = dx;\n if (Math.abs(dx) >= Math.abs(dy)) event.preventDefault();\n return;\n }\n }\n if (!wheel) {\n const claimed = event.target instanceof view.Element && (options.claimsWheel?.(event.target) ?? false);\n wheel = {\n claimed, axis: null, travelX: 0, travelY: 0, candidate: null, session: null,\n spent: false, spentAt: 0, lastDx: dx, offset: 0, velocity: 0, time, timer: 0,\n };\n }\n const stream = wheel;\n view.clearTimeout(stream.timer);\n stream.timer = view.setTimeout(() => endWheel(true), swipe.wheelIdle);\n stream.lastDx = dx;\n if (!stream.axis) {\n // The first event alone does not decide: a trackpad swipe often lands diagonally (1, 2 px).\n stream.travelX += dx;\n stream.travelY += dy;\n const horizontal = Math.abs(stream.travelX);\n const vertical = Math.abs(stream.travelY);\n if (Math.max(horizontal, vertical) >= swipe.intent) {\n stream.axis = horizontal > vertical ? 'x' : 'y';\n const target = event.target;\n const candidate = stream.axis === 'x' && target instanceof view.Element ? options.begin(target, 'wheel') : null;\n const session = candidate?.x ? candidate.start('x') : null;\n if (candidate && !session) candidate.release();\n if (session) {\n stream.candidate = candidate;\n stream.session = session;\n // The travel of the intent window counts, as a pointer's does.\n stream.offset = dx - stream.travelX;\n }\n }\n }\n if (!stream.session) {\n // A stream that started vertical stays native until it goes idle; over the Island its\n // sideways events are still held back from the browser's back/forward swipe.\n if (stream.claimed && (!stream.axis || Math.abs(dx) > Math.abs(dy))) event.preventDefault();\n stream.time = time;\n return;\n }\n event.preventDefault();\n // Fingers moving left scroll right (positive deltaX): the content follows the fingers.\n const elapsed = time - stream.time;\n if (elapsed > 0) stream.velocity = -dx / elapsed;\n stream.offset -= dx;\n stream.time = time;\n root.dataset.dragging = 'x';\n stream.session.move(stream.offset);\n // A trackpad swipe commits as soon as its release would: macOS momentum keeps\n // sending wheel events for a second or more, which otherwise holds the preview in place.\n if (decideRelease(stream.offset, stream.velocity, root.clientWidth || 0, { negative: true, positive: true })) {\n const session = stream.session;\n stream.session = null;\n stream.spent = true;\n stream.spentAt = time;\n delete root.dataset.dragging;\n stream.candidate?.release();\n session.end(stream.offset, stream.velocity);\n }\n };\n const listeners: [EventTarget, string, EventListener, boolean][] = [\n [view, 'pointerdown', secondPointer as EventListener, true],\n [root, 'pointerdown', down as EventListener, false],\n [view, 'pointermove', move as EventListener, true],\n [view, 'pointerup', up as EventListener, true],\n [view, 'pointercancel', cancelled as EventListener, true],\n [root, 'lostpointercapture', lost as EventListener, false],\n [root, 'click', click as EventListener, true],\n [root, 'dragstart', native, false],\n [root, 'selectstart', native, false],\n [root, 'wheel', scroll as EventListener, false],\n [view, 'orientationchange', cancel, false],\n ];\n if (view.screen?.orientation) listeners.push([view.screen.orientation, 'change', cancel, false]);\n for (const [target, type, listener, capture] of listeners) target.addEventListener(type, listener, { capture, passive: false });\n return {\n cancel,\n /** True while a pointer or trackpad swipe (or its intent window) owns the input. */\n get active() { return current !== null || wheel?.session != null; },\n dispose() {\n if (disposed) return;\n disposed = true;\n cancel();\n for (const [target, type, listener, capture] of listeners) target.removeEventListener(type, listener, capture);\n },\n };\n}\n"],"mappings":";;AAEA,IAAM,EAAE,aAAUA;AAMlB,SAAgBC,EAAW,GAAgB,GAAmB,IAAsBC,EAAM,YAAoB;CAG5G,OAFI,CAAC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ClE,UAAU;GACR,IAAI,IACJ;IACA,AADA,IAAW,IACXQ,EAAO;IACP,KAAK,IAAM,CAACI,GAAQ0B,GAAMC,GAAUC,MAAYR,GAAW,EAAO,oBAAoBM,GAAMC,GAAUC,CAAO;GAFlG;EAGb;CACF;AACF"}
1
+ {"version":3,"file":"gestures.js","names":["MOTION","rubberBand","swipe","offset","dimension","coefficient","decideRelease","sign","allowed","toward","velocity","distance","createVelocity","samples","time","last","anchor","from","input","span","interactive","createSwipe","view","root","current","wheel","suppressUntil","disposed","finish","gesture","endWheel","stream","options","held","commit","cancel","secondPointer","event","down","target","control","candidate","velocityX","velocityY","cssZoom","sample","moved","move","horizontal","vertical","axis","travel","session","selection","up","x","cancelled","lost","native","click","scroll","zoom","unit","dx","dy","previous","heard","own","listeners","type","listener","capture"],"sources":["../../src/react/gestures.ts"],"sourcesContent":["import { MOTION } from './motion.js';\nimport { cssZoom } from './zoom.js';\n\nconst { swipe } = MOTION;\n\n/**\n * Edge resistance (iOS-style rubber band): the result approaches `dimension`\n * asymptotically and keeps the sign of the raw finger travel.\n */\nexport function rubberBand(offset: number, dimension: number, coefficient: number = swipe.rubberBand): number {\n if (!Number.isFinite(offset) || !(dimension > 0)) return 0;\n const travel = Math.abs(offset);\n return Math.sign(offset) * (1 - 1 / (travel * coefficient / dimension + 1)) * dimension;\n}\n\n/**\n * Release decision along one axis. Returns the sign of the travel when the swipe\n * commits that way (distance past `MOTION.swipe.distance` of `dimension`, or a flick of\n * at least `flick` px released at `velocity` px/ms or faster), 0 when it springs back.\n * A direction without a destination never commits; a flick back always cancels.\n */\nexport function decideRelease(offset: number, velocity: number, dimension: number,\n allowed: { readonly negative: boolean; readonly positive: boolean }): -1 | 0 | 1 {\n const sign = offset > 0 ? 1 : offset < 0 ? -1 : 0;\n if (!sign || !(sign > 0 ? allowed.positive : allowed.negative)) return 0;\n const toward = Number.isFinite(velocity) ? velocity * sign : 0;\n if (toward <= -swipe.velocity) return 0;\n const distance = Math.abs(offset);\n if (dimension > 0 && distance > dimension * swipe.distance) return sign;\n return distance >= swipe.flick && toward >= swipe.velocity ? sign : 0;\n}\n\n/**\n * The release speed of one axis: the travel over the last `MOTION.swipe.window` ms of samples, in\n * px/ms, at most `maxVelocity` either way; a span shorter than one frame counts as one frame. The\n * sample just before the window anchors it. Of a wheel stream (`'wheel'`), a quiet time before a\n * burst counts too: batched deltas after a pause are no flick. A pointer (`'pointer'`) sends a move\n * whenever it moves, so a quiet time is stillness: the anchor stands until a frame before the next\n * sample, at most back to the window's start, and a finger that rests and then flicks is measured\n * over the flick.\n */\nexport function createVelocity(input: 'pointer' | 'wheel' = 'wheel') {\n const samples: { time: number; position: number }[] = [];\n return {\n reset(time: number, position: number) {\n samples.length = 0;\n samples.push({ time, position });\n },\n add(time: number, position: number) {\n samples.push({ time, position });\n // Keep the window and the one sample before it.\n while (samples.length > 2 && samples[1]!.time <= time - swipe.window) samples.shift();\n },\n get(): number {\n const last = samples[samples.length - 1];\n const anchor = samples[0];\n if (!last || !anchor || last === anchor) return 0;\n // A pointer rested at the anchor until a frame before its next move: within the window, that\n // rest is no travel time.\n const from = input === 'pointer'\n ? Math.max(anchor.time, Math.min(samples[1]!.time - 16, last.time - swipe.window)) : anchor.time;\n const span = Math.max(last.time - from, 16);\n const velocity = (last.position - anchor.position) / span;\n return Number.isFinite(velocity) ? Math.max(-swipe.maxVelocity, Math.min(swipe.maxVelocity, velocity)) : 0;\n },\n };\n}\ntype Velocity = ReturnType<typeof createVelocity>;\n\nexport type SwipeAxis = 'x' | 'y';\n\n/** A started swipe along one axis. Offsets are raw finger travel in CSS px. */\nexport interface SwipeSession {\n readonly move: (offset: number) => void;\n /** Velocity is CSS px/ms along the axis, positive in the direction of positive offsets. */\n readonly end: (offset: number, velocity: number) => void;\n /** Lost capture, a second pointer, orientation change or an external cancel. */\n readonly cancel: () => void;\n /**\n * Whether a release now would commit; a trackpad stream ends as soon as it does. Without it the\n * stream commits past `MOTION.swipe` of the root's width in either direction.\n */\n readonly decide?: (offset: number, velocity: number) => boolean;\n}\n\n/** What may start from one pointerdown or wheel stream; `release` ends the intent window. */\nexport interface SwipeCandidate {\n readonly x: boolean;\n readonly y: boolean;\n /** `direction` is the sign of the travel that decided the axis (+1 right or down). */\n readonly start: (axis: SwipeAxis, direction: 1 | -1) => SwipeSession | null;\n readonly release: () => void;\n}\n\ninterface SwipeOptions {\n /** Null ignores the input; the candidate is released exactly once. */\n readonly begin: (target: Element, input: 'pointer' | 'wheel') => SwipeCandidate | null;\n /**\n * The open Island under a wheel stream: until the stream's axis is decided, and for every\n * mostly horizontal event after that, the browser gets no wheel event from it (no history swipe),\n * even where no swipe can start (an end of the slider, reduced motion, outside the slides).\n */\n readonly claimsWheel?: (target: Element) => boolean;\n /**\n * A wheel stream that started over the root stays the root's until it goes idle, wherever the\n * pointer is now: the rest of a committed swipe is swallowed even when the root has left the hit\n * test (the notification center's panel turns inert as a swipe closes it). Streams still start\n * only over the root, and the window has a wheel listener only while such a stream lasts.\n */\n readonly holdsStream?: boolean;\n readonly now: () => number;\n}\n\ninterface PointerSwipe {\n readonly pointer: number;\n readonly candidate: SwipeCandidate;\n /** Viewport px per CSS px of the host (`cssZoom`): pointer travel is divided by it. */\n readonly zoom: number;\n readonly startX: number;\n readonly startY: number;\n session: SwipeSession | null;\n axis: SwipeAxis | null;\n captured: boolean;\n x: number;\n y: number;\n /** Release speeds over the last samples (CSS px/ms). */\n readonly velocityX: Velocity;\n readonly velocityY: Velocity;\n /** The time of the last sample. */\n sampled: number;\n}\n\ninterface WheelSwipe {\n /** Started over the open Island (`claimsWheel`). */\n readonly claimed: boolean;\n /** Viewport px per CSS px of the host (`cssZoom`): wheel deltas are divided by it. */\n readonly zoom: number;\n /** Decided after `MOTION.swipe.intent` px of summed travel, like a pointer. */\n axis: SwipeAxis | null;\n travelX: number;\n travelY: number;\n candidate: SwipeCandidate | null;\n session: SwipeSession | null;\n /** Committed early: the rest of the stream (macOS momentum) is swallowed until it goes idle. */\n spent: boolean;\n spentAt: number;\n lastDx: number;\n offset: number;\n /** Release speed over the last deltas (CSS px/ms), of `offset`. */\n readonly velocity: Velocity;\n time: number;\n timer: number;\n}\n\nconst interactive = 'button,a,input,select,textarea,summary,label,[role=\"button\"],[role=\"link\"],[contenteditable]:not([contenteditable=\"false\"])';\n\n/**\n * Pointer and trackpad ownership for one host. The axis is decided by the first\n * `MOTION.swipe.intent` px; an axis the target does not own is given back to the\n * browser (native scroll) for the rest of the gesture. Buttons and links never start\n * a swipe, except the collapsed pill, which is itself the swipe surface. Layout,\n * physics and store commands stay with the caller.\n *\n * Travel, velocity and thresholds are CSS px of the host: under a CSS `zoom` on an\n * ancestor, pointer and wheel input (viewport px) is divided by it, so content follows\n * the finger and every distance scales with the zoomed interface.\n */\nexport function createSwipe(root: HTMLElement, options: SwipeOptions) {\n const view = root.ownerDocument.defaultView;\n let current: PointerSwipe | null = null;\n let wheel: WheelSwipe | null = null;\n let suppressUntil = 0;\n let disposed = false;\n if (!view) return { cancel() {}, dispose() {}, get active() { return false; } };\n\n function finish(): PointerSwipe | null {\n const gesture = current;\n if (!gesture) return null;\n // Lost capture, store updates and callbacks can be synchronous/reentrant:\n // clear ownership before releasing anything.\n current = null;\n delete root.dataset.dragging;\n if (gesture.captured && root.hasPointerCapture?.(gesture.pointer)) root.releasePointerCapture(gesture.pointer);\n gesture.candidate.release();\n return gesture;\n }\n function endWheel(commit: boolean) {\n const stream = wheel;\n if (!stream) return;\n wheel = null;\n if (options.holdsStream) view!.removeEventListener('wheel', held as EventListener, false);\n view!.clearTimeout(stream.timer);\n if (stream.session) delete root.dataset.dragging;\n stream.candidate?.release();\n if (commit) stream.session?.end(stream.offset, stream.velocity.get());\n else stream.session?.cancel();\n }\n const cancel = () => {\n finish()?.session?.cancel();\n endWheel(false);\n };\n const secondPointer = (event: PointerEvent) => {\n if (current && event.pointerId !== current.pointer) cancel();\n };\n const down = (event: PointerEvent) => {\n // A new deliberate activation must work even if a previous browser did not\n // generate the compatibility click suppressed after an accepted drag.\n if (disposed || current || !event.isPrimary || event.button !== 0) return;\n suppressUntil = 0;\n const target = event.target;\n if (!(target instanceof view.Element)) return;\n const control = target.closest(interactive);\n if (control && root.contains(control) && !control.matches('[data-cloudlet-pill]')) return;\n endWheel(false);\n const candidate = options.begin(target, 'pointer');\n if (!candidate) return;\n const velocityX = createVelocity('pointer');\n const velocityY = createVelocity('pointer');\n velocityX.reset(event.timeStamp, 0);\n velocityY.reset(event.timeStamp, 0);\n current = {\n pointer: event.pointerId, candidate, zoom: cssZoom(root), startX: event.clientX, startY: event.clientY, session: null, axis: null,\n captured: false, x: 0, y: 0, velocityX, velocityY, sampled: event.timeStamp,\n };\n };\n function sample(gesture: PointerSwipe, event: PointerEvent) {\n // A busy main thread hands over the moves of several frames at once: their own times keep a\n // steady drag from reading as a flick. Out-of-order times are left to the event's own.\n for (const moved of event.getCoalescedEvents?.() ?? []) {\n const time = moved.timeStamp;\n if (!Number.isFinite(time) || time <= gesture.sampled || time >= event.timeStamp) continue;\n gesture.sampled = time;\n gesture.velocityX.add(time, (moved.clientX - gesture.startX) / gesture.zoom);\n gesture.velocityY.add(time, (moved.clientY - gesture.startY) / gesture.zoom);\n }\n gesture.x = (event.clientX - gesture.startX) / gesture.zoom;\n gesture.y = (event.clientY - gesture.startY) / gesture.zoom;\n // A pause before lifting the finger is in the window too: it is no flick.\n gesture.velocityX.add(event.timeStamp, gesture.x);\n gesture.velocityY.add(event.timeStamp, gesture.y);\n gesture.sampled = Math.max(gesture.sampled, event.timeStamp);\n }\n const move = (event: PointerEvent) => {\n const gesture = current;\n if (!gesture || event.pointerId !== gesture.pointer) return;\n sample(gesture, event);\n if (!gesture.session) {\n const horizontal = Math.abs(gesture.x);\n const vertical = Math.abs(gesture.y);\n if (Math.max(horizontal, vertical) < swipe.intent) return;\n // The first directional intent wins; an axis the target does not own stays native.\n const axis: SwipeAxis = horizontal > vertical ? 'x' : 'y';\n const travel = axis === 'x' ? gesture.x : gesture.y;\n const session = gesture.candidate[axis] ? gesture.candidate.start(axis, travel < 0 ? -1 : 1) : null;\n if (!session || current !== gesture) { cancel(); return; }\n gesture.session = session;\n gesture.axis = axis;\n try {\n root.setPointerCapture(gesture.pointer);\n gesture.captured = true;\n } catch { cancel(); return; }\n root.dataset.dragging = axis;\n // A text selection left in the host would turn the next press into native drag and drop.\n const selection = view.getSelection();\n if (selection?.anchorNode && root.contains(selection.anchorNode)) selection.removeAllRanges();\n }\n suppressUntil = options.now() + swipe.suppressClick;\n if (event.cancelable) event.preventDefault();\n gesture.session.move(gesture.axis === 'x' ? gesture.x : gesture.y);\n };\n const up = (event: PointerEvent) => {\n const gesture = current;\n if (!gesture || event.pointerId !== gesture.pointer) return;\n sample(gesture, event);\n finish();\n const x = gesture.axis === 'x';\n gesture.session?.end(x ? gesture.x : gesture.y, x ? gesture.velocityX.get() : gesture.velocityY.get());\n };\n const cancelled = (event: PointerEvent) => {\n if (current?.pointer === event.pointerId) cancel();\n };\n // Touch input is implicitly captured by the pressed element; moving the capture to\n // the host fires a bubbling lostpointercapture there. Only the host's own loss counts.\n const lost = (event: PointerEvent) => {\n if (event.target === root && current?.captured && current.pointer === event.pointerId) cancel();\n };\n // While the host owns a press, the browser must not start selecting or dragging content.\n const native = (event: Event) => { if (current && (event.type === 'dragstart' || current.session)) event.preventDefault(); };\n const click = (event: MouseEvent) => {\n // Keyboard/AT clicks have detail=0 and remain available during any return.\n if (event.detail === 0 || suppressUntil === 0 || options.now() > suppressUntil) return;\n suppressUntil = 0;\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n const scroll = (event: WheelEvent) => {\n // Pinch zoom (ctrl+wheel) and a running pointer swipe stay untouched.\n if (disposed || current || event.ctrlKey) return;\n if (options.holdsStream && !wheel && !(event.target instanceof view.Node && root.contains(event.target))) return;\n // Pixel deltas are viewport px; lines and pages are counted in the host's own CSS px.\n const zoom = wheel?.zoom ?? cssZoom(root);\n const unit = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? root.clientWidth || 1 : 1 / zoom;\n const dx = event.deltaX * unit;\n const dy = event.deltaY * unit;\n const time = event.timeStamp;\n if (wheel?.spent) {\n // Momentum only decays. A new swipe accelerates or reverses and starts a fresh stream;\n // vertical scrolling stays native.\n const previous = wheel.lastDx;\n const renewed = time - wheel.spentAt > swipe.wheelLock\n && (Math.abs(dx) > Math.abs(previous) * 1.5 + 2 || (dx !== 0 && previous !== 0 && Math.sign(dx) !== Math.sign(previous)));\n if (renewed) endWheel(false);\n else {\n view.clearTimeout(wheel.timer);\n wheel.timer = view.setTimeout(() => endWheel(true), swipe.wheelIdle);\n wheel.lastDx = dx;\n if (Math.abs(dx) >= Math.abs(dy)) event.preventDefault();\n return;\n }\n }\n if (!wheel) {\n const claimed = event.target instanceof view.Element && (options.claimsWheel?.(event.target) ?? false);\n wheel = {\n claimed, zoom, axis: null, travelX: 0, travelY: 0, candidate: null, session: null,\n spent: false, spentAt: 0, lastDx: dx, offset: 0, velocity: createVelocity(), time, timer: 0,\n };\n // The stream's events outside the root reach the window only while the stream lasts: the\n // page's own wheel scrolling never waits on a listener that can cancel it.\n if (options.holdsStream) view.addEventListener('wheel', held as EventListener, { capture: false, passive: false });\n }\n const stream = wheel;\n view.clearTimeout(stream.timer);\n stream.timer = view.setTimeout(() => endWheel(true), swipe.wheelIdle);\n stream.lastDx = dx;\n if (!stream.axis) {\n // The first event alone does not decide: a trackpad swipe often lands diagonally (1, 2 px).\n stream.travelX += dx;\n stream.travelY += dy;\n const horizontal = Math.abs(stream.travelX);\n const vertical = Math.abs(stream.travelY);\n if (Math.max(horizontal, vertical) >= swipe.intent) {\n stream.axis = horizontal > vertical ? 'x' : 'y';\n const target = event.target;\n const candidate = stream.axis === 'x' && target instanceof view.Element ? options.begin(target, 'wheel') : null;\n // Fingers moving left scroll right (positive deltaX): the travel is the opposite of the deltas.\n const session = candidate?.x ? candidate.start('x', stream.travelX > 0 ? -1 : 1) : null;\n if (candidate && !session) candidate.release();\n if (session) {\n stream.candidate = candidate;\n stream.session = session;\n // The travel of the intent window counts, as a pointer's does.\n stream.offset = dx - stream.travelX;\n stream.velocity.reset(stream.time, stream.offset);\n }\n }\n }\n if (!stream.session) {\n // A stream that started vertical stays native until it goes idle; over the Island its\n // sideways events are still held back from the browser's back/forward swipe.\n if (stream.claimed && (!stream.axis || Math.abs(dx) > Math.abs(dy))) event.preventDefault();\n stream.time = time;\n return;\n }\n event.preventDefault();\n // Fingers moving left scroll right (positive deltaX): the content follows the fingers.\n stream.offset -= dx;\n stream.time = time;\n stream.velocity.add(time, stream.offset);\n root.dataset.dragging = 'x';\n stream.session.move(stream.offset);\n // A trackpad swipe commits as soon as its release would: macOS momentum keeps\n // sending wheel events for a second or more, which otherwise holds the preview in place.\n const velocity = stream.velocity.get();\n const commits = stream.session.decide\n ? stream.session.decide(stream.offset, velocity)\n : decideRelease(stream.offset, velocity, root.clientWidth || 0, { negative: true, positive: true }) !== 0;\n if (commits) {\n const session = stream.session;\n stream.session = null;\n stream.spent = true;\n stream.spentAt = time;\n delete root.dataset.dragging;\n stream.candidate?.release();\n session.end(stream.offset, velocity);\n }\n };\n /** The last wheel event the root heard: it reaches the window's listener too, and counts once. */\n let heard: Event | null = null;\n const own = (event: WheelEvent) => {\n heard = event;\n scroll(event);\n };\n const held = (event: WheelEvent) => {\n if (event === heard) return;\n scroll(event);\n };\n const listeners: [EventTarget, string, EventListener, boolean][] = [\n [view, 'pointerdown', secondPointer as EventListener, true],\n [root, 'pointerdown', down as EventListener, false],\n [view, 'pointermove', move as EventListener, true],\n [view, 'pointerup', up as EventListener, true],\n [view, 'pointercancel', cancelled as EventListener, true],\n [root, 'lostpointercapture', lost as EventListener, false],\n [root, 'click', click as EventListener, true],\n [root, 'dragstart', native, false],\n [root, 'selectstart', native, false],\n [root, 'wheel', own as EventListener, false],\n [view, 'orientationchange', cancel, false],\n ];\n if (view.screen?.orientation) listeners.push([view.screen.orientation, 'change', cancel, false]);\n for (const [target, type, listener, capture] of listeners) target.addEventListener(type, listener, { capture, passive: false });\n return {\n cancel,\n /** True while a pointer or trackpad swipe (or its intent window) owns the input. */\n get active() { return current !== null || wheel?.session != null; },\n dispose() {\n if (disposed) return;\n disposed = true;\n cancel();\n for (const [target, type, listener, capture] of listeners) target.removeEventListener(type, listener, capture);\n },\n };\n}\n"],"mappings":";;;AAGA,IAAM,EAAE,aAAUA;AAMlB,SAAgBC,EAAW,GAAgB,GAAmB,IAAsBC,EAAM,YAAoB;CAG5G,OAFI,CAAC,OAAO,SAASC,CAAM,KAAK,EAAEC,IAAY,KAAW,IAElD,KAAK,KAAKD,CAAM,KAAK,IAAI,KADjB,KAAK,IAAIA,CACa,IAASE,IAAcD,IAAY,MAAMA;AAChF;AAQA,SAAgBE,EAAc,GAAgB,GAAkB,GAC9D,GAAiF;CACjF,IAAMC,IAAOJ,IAAS,IAAI,IAAIA,IAAS,IAAI,KAAK;CAChD,IAAI,CAACI,KAAQ,EAAEA,IAAO,IAAIC,EAAQ,WAAWA,EAAQ,WAAW,OAAO;CACvE,IAAMC,IAAS,OAAO,SAASC,CAAQ,IAAIA,IAAWH,IAAO;CAC7D,IAAIE,KAAU,CAACP,EAAM,UAAU,OAAO;CACtC,IAAMS,IAAW,KAAK,IAAIR,CAAM;CAEhC,OADIC,IAAY,KAAKO,IAAWP,IAAYF,EAAM,YAC3CS,KAAYT,EAAM,SAASO,KAAUP,EAAM,WADiBK,IACC;AACtE;AAWA,SAAgBK,EAAe,IAA6B,SAAS;CACnE,IAAMC,IAAgD,CAAC;CACvD,OAAO;EACL,MAAM,GAAc,GAAkB;GAEpC,AADA,EAAQ,SAAS,GACjBA,EAAQ,KAAK;IAAE;IAAM;GAAS,CAAC;EACjC;EACA,IAAI,GAAc,GAAkB;GAGlC,KAFAA,EAAQ,KAAK;IAAE;IAAM;GAAS,CAAC,GAExBA,EAAQ,SAAS,KAAKA,EAAQ,EAAE,CAAE,QAAQC,IAAOZ,EAAM,SAAQ,EAAQ,MAAM;EACtF;EACA,MAAc;GACZ,I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