@cloudlet/toast 1.2.0 → 1.3.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 +27 -0
- package/README.md +2 -2
- package/dist/react/gestures.d.ts +6 -0
- package/dist/react/gestures.d.ts.map +1 -1
- package/dist/react/gestures.js +28 -15
- package/dist/react/gestures.js.map +1 -1
- package/dist/react/host.d.ts.map +1 -1
- package/dist/react/host.js +217 -208
- package/dist/react/host.js.map +1 -1
- package/dist/react.d.ts +2 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/react/gestures.ts +45 -8
- package/src/react/host.tsx +22 -9
- package/src/react.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.0 — 2026-11-24
|
|
4
|
+
|
|
5
|
+
The stack can sit in a corner. Nothing is removed or changed in behaviour; the new positions are
|
|
6
|
+
additive (see API).
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- `<Toaster position>` takes `top-left`, `top-right`, `bottom-left` and `bottom-right` besides the
|
|
11
|
+
centre. The pill, its tails and the badge keep to that side, and the Island grows away from it: the
|
|
12
|
+
morph, the enter and the exit stay against the edge. The side is physical, so `dir="rtl"` keeps it.
|
|
13
|
+
|
|
14
|
+
### API
|
|
15
|
+
|
|
16
|
+
- `ToasterProps['position']` widens to `'auto' | 'top-left' | 'top-center' | 'top-right' |
|
|
17
|
+
'bottom-left' | 'bottom-center' | 'bottom-right'`. Code that narrows it with a `switch` now needs the
|
|
18
|
+
four new values; TypeScript points them out.
|
|
19
|
+
- The host carries `data-align="left|center|right"` beside `data-edge`.
|
|
20
|
+
|
|
21
|
+
### Fixes
|
|
22
|
+
|
|
23
|
+
- A trackpad swipe over the open Island goes to the next or previous slide even when its first delta
|
|
24
|
+
leans vertical (a finger landing diagonally). The axis is now decided by the first 8 px of travel, as
|
|
25
|
+
for a finger, instead of by the first wheel event, which used to hand the whole swipe to the browser
|
|
26
|
+
and start its back/forward gesture. Over the open Island no sideways wheel event reaches the browser,
|
|
27
|
+
also at either end of the slider and under reduced motion; vertical scrolling and the page outside
|
|
28
|
+
stay native.
|
|
29
|
+
|
|
3
30
|
## 1.2.0 — 2026-11-01
|
|
4
31
|
|
|
5
32
|
Clear all in the Island. Nothing is removed or changed in behaviour; the new texts, prop and close
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ can carry a command, a link, or a short form of up to three text fields that is
|
|
|
23
23
|
**Status.** Stable since `1.0.0`; the API follows semantic versioning.
|
|
24
24
|
Screen readers, physical phones and the minimum browser versions are checked by hand on top of the
|
|
25
25
|
automated suite; see
|
|
26
|
-
[What is tested](https://cloudlet.dev/toaster/
|
|
26
|
+
[What is tested](https://cloudlet.dev/docs/components/toaster/accessibility#what-is-tested).
|
|
27
27
|
|
|
28
28
|
## Installation
|
|
29
29
|
|
|
@@ -65,7 +65,7 @@ is permanently finished: in a React effect, clean up exactly the instance that e
|
|
|
65
65
|
|
|
66
66
|
## Documentation
|
|
67
67
|
|
|
68
|
-
Full documentation: **https://cloudlet.dev/toaster
|
|
68
|
+
Full documentation: **https://cloudlet.dev/docs/components/toaster**
|
|
69
69
|
|
|
70
70
|
- Getting started: Introduction, Installation (npm and the shadcn registry item), Quick start.
|
|
71
71
|
- Guides: Notifications & time, Operations & cancellation, Forms, Positioning & offsets, Styling,
|
package/dist/react/gestures.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export interface SwipeCandidate {
|
|
|
32
32
|
interface SwipeOptions {
|
|
33
33
|
/** Null ignores the input; the candidate is released exactly once. */
|
|
34
34
|
readonly begin: (target: Element, input: 'pointer' | 'wheel') => SwipeCandidate | null;
|
|
35
|
+
/**
|
|
36
|
+
* The open Island under a wheel stream: until the stream's axis is decided, and for every
|
|
37
|
+
* mostly horizontal event after that, the browser gets no wheel event from it (no history swipe),
|
|
38
|
+
* even where no swipe can start (an end of the slider, reduced motion, outside the slides).
|
|
39
|
+
*/
|
|
40
|
+
readonly claimsWheel?: (target: Element) => boolean;
|
|
35
41
|
readonly now: () => number;
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gestures.d.ts","sourceRoot":"","sources":["../../src/react/gestures.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,GAAE,MAAyB,GAAG,MAAM,CAI5G;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAC/E,OAAO,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAQjF;AAED,MAAM,MAAM,SAAS,GAAG,GAAG,GAAG,GAAG,CAAC;AAElC,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,2FAA2F;IAC3F,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,6FAA6F;AAC7F,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,YAAY,GAAG,IAAI,CAA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,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,YAAY,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,UAAU,YAAY;IACpB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,KAAK,cAAc,GAAG,IAAI,CAAC;IACvF;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IACpD,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;CAC5B;AAwCD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY;;;;EAiOnE"}
|
package/dist/react/gestures.js
CHANGED
|
@@ -175,22 +175,35 @@ function a(e, n) {
|
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
+
};
|
|
192
193
|
let m = s;
|
|
193
|
-
if (a.clearTimeout(m.timer), m.timer = a.setTimeout(() => d(!0), t.wheelIdle), m.lastDx = u, !m.
|
|
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
|
+
}
|
|
194
207
|
i.preventDefault();
|
|
195
208
|
let h = p - m.time;
|
|
196
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, {
|
|
@@ -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 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 readonly 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 target = event.target;\n const candidate = Math.abs(dx) > Math.abs(dy) && 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 // A stream that started vertical stays native until it goes idle.\n wheel = { candidate: session ? candidate : null, session, spent: false, spentAt: 0, lastDx: dx, offset: 0, velocity: 0, time, timer: 0 };\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.session) return;\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]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O;IAQ9B,IAPIW,IAAU,MAAG,EAAO,WAAW,CAACiB,IAAKjB,IACzC,EAAO,UAAUiB,GACjB,EAAO,OAAOE,GACd,EAAK,QAAQ,WAAW,KACxB9B,EAAO,QAAQ,KAAKA,EAAO,MAAM,GAG7BjB,EAAciB,EAAO,QAAQA,EAAO,UAAUR,EAAK,eAAe,GAAG;KAAE,UAAU;KAAM,UAAU;IAAK,CAAC,GAAG;KAC5G,IAAM2B,IAAUnB,EAAO;KAMvB,AALA,EAAO,UAAU,MACjB,EAAO,QAAQ,IACf,EAAO,UAAU8B,GACjB,OAAOtC,EAAK,QAAQ,UACpBQ,EAAO,WAAW,QAAQ,GAC1BmB,EAAQ,IAAInB,EAAO,QAAQA,EAAO,QAAQ;IAC5C;GACF;GAW2C;EAAK;EAC9C;GAACT;GAAM;GAAqBW;GAAQ;EAAK;CAC3C;CACA,AAAIX,EAAK,QAAQ,eAAamC,EAAU,KAAK;EAACnC,EAAK,OAAO;EAAa;EAAUW;EAAQ;CAAK,CAAC;CAC/F,KAAK,IAAM,CAACI,GAAQ0B,GAAMC,GAAUC,MAAYR,GAAW,EAAO,iBAAiBM,GAAMC,GAAU;EAAE;EAAS,SAAS;CAAM,CAAC;CAC9H,OAAO;EACL;EAEA,IAAI,SAAS;GAAE,OAAOxC,MAAY,QAAQC,GAAO,WAAW;EAAM;EAClE,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","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,OAAO,SAASC,CAAM,KAAK,EAAEC,IAAY,KAAW,IAElD,KAAK,KAAKD,C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