use-scroll-animate 3.3.0 → 3.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.
- package/CHANGELOG.md +24 -0
- package/README.md +2 -0
- package/README_ja.md +2 -0
- package/README_zh.md +2 -0
- package/dist/chunks/{base-Cu-86Z31.js → base-BpROOcey.js} +2 -2
- package/dist/chunks/{base-Cu-86Z31.js.map → base-BpROOcey.js.map} +1 -1
- package/dist/chunks/core-IaorbTdu.cjs +185 -0
- package/dist/chunks/core-IaorbTdu.cjs.map +1 -0
- package/dist/chunks/core-uxs3ETou.js +181 -0
- package/dist/chunks/core-uxs3ETou.js.map +1 -0
- package/dist/chunks/{index-tags-Cz4iTBEK.cjs → index-tags-CLFrjVR7.cjs} +3 -1
- package/dist/chunks/{index-tags-Cz4iTBEK.cjs.map → index-tags-CLFrjVR7.cjs.map} +1 -1
- package/dist/chunks/{index-tags-Dc_Z4yAY.js → index-tags-uw1Fospg.js} +3 -1
- package/dist/chunks/{index-tags-Dc_Z4yAY.js.map → index-tags-uw1Fospg.js.map} +1 -1
- package/dist/chunks/{spring-BV-cpTHC.js → spring-C-fw7_9f.js} +2 -2
- package/dist/chunks/{spring-BV-cpTHC.js.map → spring-C-fw7_9f.js.map} +1 -1
- package/dist/chunks/{variants-BQ3gCb5L.js → variants-CHe1VbSn.js} +2 -2
- package/dist/chunks/{variants-BQ3gCb5L.js.map → variants-CHe1VbSn.js.map} +1 -1
- package/dist/components/background.js +3 -3
- package/dist/components/cards.js +3 -3
- package/dist/components/click.js +3 -3
- package/dist/components/depth.cjs +252 -0
- package/dist/components/depth.cjs.map +1 -0
- package/dist/components/depth.css +3 -0
- package/dist/components/depth.d.cts +121 -0
- package/dist/components/depth.d.ts +121 -0
- package/dist/components/depth.js +243 -0
- package/dist/components/depth.js.map +1 -0
- package/dist/components/feedback.js +2 -2
- package/dist/components/gesture.cjs +6 -182
- package/dist/components/gesture.cjs.map +1 -1
- package/dist/components/gesture.js +6 -181
- package/dist/components/gesture.js.map +1 -1
- package/dist/components/interaction.js +2 -2
- package/dist/components/jsx.d.cts +2 -0
- package/dist/components/jsx.d.ts +2 -0
- package/dist/components/lazy.cjs +3 -1
- package/dist/components/lazy.cjs.map +1 -1
- package/dist/components/lazy.d.cts +2 -0
- package/dist/components/lazy.d.ts +2 -0
- package/dist/components/lazy.js +3 -1
- package/dist/components/lazy.js.map +1 -1
- package/dist/components/page.js +3 -3
- package/dist/components/physics.js +4 -4
- package/dist/components/react.cjs +1 -1
- package/dist/components/react.js +1 -1
- package/dist/components/reveal.js +2 -2
- package/dist/components/svg.js +2 -2
- package/dist/components/text.js +2 -2
- package/dist/components/timeline.js +2 -2
- package/dist/components/transitions.js +2 -2
- package/dist/components/ui.js +5 -5
- package/dist/components/vue.cjs +4 -1
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +74 -0
- package/dist/components/vue.d.ts +74 -0
- package/dist/components/vue.js +7 -4
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.cjs +277 -0
- package/dist/components/webgl.cjs.map +1 -0
- package/dist/components/webgl.css +3 -0
- package/dist/components/webgl.d.cts +114 -0
- package/dist/components/webgl.d.ts +114 -0
- package/dist/components/webgl.js +267 -0
- package/dist/components/webgl.js.map +1 -0
- package/dist/components.cjs +24 -4
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +2 -0
- package/dist/components.d.cts +145 -2
- package/dist/components.d.ts +145 -2
- package/dist/components.js +15 -8
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/docs/components.md +21 -0
- package/package.json +24 -2
|
@@ -2,183 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var base = require('../chunks/base-CXx7jZ-o.cjs');
|
|
4
4
|
var spring = require('../chunks/spring-2OTnYCzm.cjs');
|
|
5
|
-
|
|
6
|
-
/** The swipe a pointer release represents, or `null` (pure). */
|
|
7
|
-
function swipeDirection(dx, dy, vx, vy, o = {}) {
|
|
8
|
-
const dist = o.distance ?? 40;
|
|
9
|
-
const vel = o.velocity ?? 300;
|
|
10
|
-
const horiz = o.axis === 'x' || (o.axis !== 'y' && Math.abs(dx) >= Math.abs(dy));
|
|
11
|
-
const d = horiz ? dx : dy;
|
|
12
|
-
const v = horiz ? vx : vy;
|
|
13
|
-
if (Math.abs(d) < dist && Math.abs(v) < vel * 2)
|
|
14
|
-
return null;
|
|
15
|
-
if (Math.abs(v) < vel && Math.abs(d) < dist * 3)
|
|
16
|
-
return null;
|
|
17
|
-
const direction = horiz ? (d > 0 ? 'right' : 'left') : d > 0 ? 'down' : 'up';
|
|
18
|
-
return { direction, velocity: Math.abs(v), dx, dy };
|
|
19
|
-
}
|
|
20
|
-
/** Scale between two pointer distances, clamped to [min, max] (pure). */
|
|
21
|
-
function pinchScale(startDistance, distance, base$1 = 1, min = 0.5, max = 4) {
|
|
22
|
-
if (!startDistance)
|
|
23
|
-
return base$1;
|
|
24
|
-
return base.clamp(base$1 * (distance / startDistance), min, max);
|
|
25
|
-
}
|
|
26
|
-
const pid = (e) => (typeof e.pointerId === 'number' ? e.pointerId : 1);
|
|
27
|
-
/**
|
|
28
|
-
* One recognizer for pan, swipe, pinch (two pointers or Ctrl + wheel),
|
|
29
|
-
* long-press, tap and double-tap, with velocities ready to hand to a spring
|
|
30
|
-
* (`createSpring().set(target, velocity)`). Works with mouse, touch and pen
|
|
31
|
-
* through Pointer Events. Returns a cleanup function.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* const x = createSpring({ onUpdate: (v) => (card.style.translate = `${v}px`) });
|
|
35
|
-
* gesture(card, {
|
|
36
|
-
* onPan: ({ dx, last, vx }) => (last ? x.set(0, vx) : x.jump(dx)),
|
|
37
|
-
* onSwipe: ({ direction }) => dismiss(direction),
|
|
38
|
-
* }, { axis: 'x' });
|
|
39
|
-
*/
|
|
40
|
-
function gesture(el, h, o = {}) {
|
|
41
|
-
const pts = new Map();
|
|
42
|
-
let start = { x: 0, y: 0 };
|
|
43
|
-
let last = { x: 0, y: 0, t: 0 };
|
|
44
|
-
let vx = 0;
|
|
45
|
-
let vy = 0;
|
|
46
|
-
let panning = false;
|
|
47
|
-
let pinch = null;
|
|
48
|
-
let pinchScaleNow = 1;
|
|
49
|
-
let press;
|
|
50
|
-
let pressed = false;
|
|
51
|
-
let lastTap = -1e9;
|
|
52
|
-
const th = o.threshold ?? 4;
|
|
53
|
-
const dist = () => {
|
|
54
|
-
const [a, b] = [...pts.values()];
|
|
55
|
-
return Math.hypot(a.x - b.x, a.y - b.y);
|
|
56
|
-
};
|
|
57
|
-
const mid = () => {
|
|
58
|
-
const [a, b] = [...pts.values()];
|
|
59
|
-
return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
|
60
|
-
};
|
|
61
|
-
const t = (e) => (e.timeStamp || Date.now());
|
|
62
|
-
const down = (e) => {
|
|
63
|
-
pts.set(pid(e), { x: e.clientX, y: e.clientY });
|
|
64
|
-
try {
|
|
65
|
-
el.setPointerCapture?.(pid(e));
|
|
66
|
-
}
|
|
67
|
-
catch { /* jsdom / synthetic */ }
|
|
68
|
-
if (pts.size === 2 && h.onPinch) {
|
|
69
|
-
clearTimeout(press);
|
|
70
|
-
if (panning)
|
|
71
|
-
h.onPan?.({ dx: last.x - start.x, dy: last.y - start.y, vx: 0, vy: 0, first: false, last: true, event: e });
|
|
72
|
-
panning = false;
|
|
73
|
-
pinch = { d0: dist(), first: true };
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (pts.size > 1)
|
|
77
|
-
return;
|
|
78
|
-
start = { x: e.clientX, y: e.clientY };
|
|
79
|
-
last = { ...start, t: t(e) };
|
|
80
|
-
vx = vy = 0;
|
|
81
|
-
pressed = false;
|
|
82
|
-
if (h.onLongPress)
|
|
83
|
-
press = setTimeout(() => { pressed = true; h.onLongPress?.({ x: start.x, y: start.y }); }, o.longPress ?? 500);
|
|
84
|
-
};
|
|
85
|
-
const move = (e) => {
|
|
86
|
-
if (!pts.has(pid(e)))
|
|
87
|
-
return;
|
|
88
|
-
pts.set(pid(e), { x: e.clientX, y: e.clientY });
|
|
89
|
-
if (pinch && pts.size >= 2) {
|
|
90
|
-
const m = mid();
|
|
91
|
-
pinchScaleNow = pinchScale(pinch.d0, dist(), 1, 0.05, 20);
|
|
92
|
-
h.onPinch?.({ scale: pinchScaleNow, x: m.x, y: m.y, first: pinch.first, last: false });
|
|
93
|
-
pinch.first = false;
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const dx = e.clientX - start.x;
|
|
97
|
-
const dy = e.clientY - start.y;
|
|
98
|
-
const dt = Math.max(1, t(e) - last.t) / 1000;
|
|
99
|
-
vx = (e.clientX - last.x) / dt;
|
|
100
|
-
vy = (e.clientY - last.y) / dt;
|
|
101
|
-
last = { x: e.clientX, y: e.clientY, t: t(e) };
|
|
102
|
-
if (!panning) {
|
|
103
|
-
const off = o.axis === 'x' ? Math.abs(dx) : o.axis === 'y' ? Math.abs(dy) : Math.hypot(dx, dy);
|
|
104
|
-
if (off < th)
|
|
105
|
-
return;
|
|
106
|
-
clearTimeout(press);
|
|
107
|
-
if (o.axis && Math.abs(o.axis === 'x' ? dy : dx) > off) {
|
|
108
|
-
pts.delete(pid(e));
|
|
109
|
-
return;
|
|
110
|
-
} // wrong axis: let the page scroll
|
|
111
|
-
panning = true;
|
|
112
|
-
h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: true, last: false, event: e });
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (e.cancelable)
|
|
116
|
-
e.preventDefault();
|
|
117
|
-
h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: false, last: false, event: e });
|
|
118
|
-
};
|
|
119
|
-
const up = (e) => {
|
|
120
|
-
if (!pts.has(pid(e)))
|
|
121
|
-
return;
|
|
122
|
-
pts.delete(pid(e));
|
|
123
|
-
clearTimeout(press);
|
|
124
|
-
if (pinch) {
|
|
125
|
-
if (pts.size < 2) {
|
|
126
|
-
h.onPinch?.({ scale: pinchScaleNow, ...start, first: false, last: true });
|
|
127
|
-
pinch = null;
|
|
128
|
-
pts.clear();
|
|
129
|
-
}
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const dx = e.clientX - start.x;
|
|
133
|
-
const dy = e.clientY - start.y;
|
|
134
|
-
if (panning) {
|
|
135
|
-
panning = false;
|
|
136
|
-
if (t(e) - last.t > 80)
|
|
137
|
-
vx = vy = 0; // paused before release
|
|
138
|
-
h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: false, last: true, event: e });
|
|
139
|
-
const s = swipeDirection(dx, dy, vx, vy, { distance: o.swipeDistance, velocity: o.swipeVelocity, axis: o.axis });
|
|
140
|
-
if (s)
|
|
141
|
-
h.onSwipe?.(s);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (pressed || e.type === 'pointercancel')
|
|
145
|
-
return;
|
|
146
|
-
const p = { x: e.clientX, y: e.clientY };
|
|
147
|
-
const n = t(e);
|
|
148
|
-
if (h.onDoubleTap && n - lastTap < 300) {
|
|
149
|
-
lastTap = -1e9;
|
|
150
|
-
h.onDoubleTap(p);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
lastTap = n;
|
|
154
|
-
h.onTap?.(p);
|
|
155
|
-
};
|
|
156
|
-
const wheel = (e) => {
|
|
157
|
-
if (!h.onPinch || o.wheelPinch === false || !e.ctrlKey)
|
|
158
|
-
return;
|
|
159
|
-
e.preventDefault();
|
|
160
|
-
const s = Math.exp(-e.deltaY / 100);
|
|
161
|
-
h.onPinch({ scale: s, x: e.clientX, y: e.clientY, first: true, last: true });
|
|
162
|
-
};
|
|
163
|
-
const opts = { passive: false };
|
|
164
|
-
el.addEventListener('pointerdown', down);
|
|
165
|
-
el.addEventListener('pointermove', move, opts);
|
|
166
|
-
el.addEventListener('pointerup', up);
|
|
167
|
-
el.addEventListener('pointercancel', up);
|
|
168
|
-
el.addEventListener('wheel', wheel, opts);
|
|
169
|
-
if (o.axis && !el.style.touchAction)
|
|
170
|
-
el.style.touchAction = o.axis === 'x' ? 'pan-y' : 'pan-x';
|
|
171
|
-
else if (!o.axis && !el.style.touchAction && (h.onPan || h.onPinch))
|
|
172
|
-
el.style.touchAction = 'none';
|
|
173
|
-
return () => {
|
|
174
|
-
clearTimeout(press);
|
|
175
|
-
el.removeEventListener('pointerdown', down);
|
|
176
|
-
el.removeEventListener('pointermove', move, opts);
|
|
177
|
-
el.removeEventListener('pointerup', up);
|
|
178
|
-
el.removeEventListener('pointercancel', up);
|
|
179
|
-
el.removeEventListener('wheel', wheel, opts);
|
|
180
|
-
};
|
|
181
|
-
}
|
|
5
|
+
var core = require('../chunks/core-IaorbTdu.cjs');
|
|
182
6
|
|
|
183
7
|
var css = "usa-swipeable{display:block;touch-action:pan-y;user-select:none;-webkit-user-select:none}usa-swipeable[axis=\"y\"]{touch-action:pan-x}usa-swipeable>*{transform:translate3d(var(--usa-swipe,0px),0,0);opacity:calc(1 - var(--usa-swipe-p,0) * 0.5)}usa-swipeable[axis=\"y\"]>*{transform:translate3d(0,var(--usa-swipe,0px),0)}usa-swipeable:focus-visible{outline:2px solid currentColor;outline-offset:2px}usa-pinch-zoom{display:block;overflow:hidden;touch-action:none;position:relative}usa-pinch-zoom>*{transform:translate3d(var(--usa-zoom-x,0px),var(--usa-zoom-y,0px),0) scale(var(--usa-zoom,1));transform-origin:50% 50%}usa-pinch-zoom[data-zoomed]{cursor:grab}usa-pinch-zoom:focus-visible{outline:2px solid currentColor;outline-offset:2px}";
|
|
184
8
|
|
|
@@ -229,7 +53,7 @@ function defineSwipeable(tag = 'usa-swipeable') {
|
|
|
229
53
|
this.tabIndex = 0;
|
|
230
54
|
const y = this.str('axis', 'x') === 'y';
|
|
231
55
|
const max = () => this.num('distance', 120);
|
|
232
|
-
this.onCleanup(gesture(this, {
|
|
56
|
+
this.onCleanup(core.gesture(this, {
|
|
233
57
|
onPan: ({ dx, dy, vx, vy, last }) => {
|
|
234
58
|
if (this.flag('disabled'))
|
|
235
59
|
return;
|
|
@@ -320,7 +144,7 @@ function definePinchZoom(tag = 'usa-pinch-zoom') {
|
|
|
320
144
|
let base$1 = 1;
|
|
321
145
|
let ox = 0;
|
|
322
146
|
let oy = 0;
|
|
323
|
-
this.onCleanup(gesture(this, {
|
|
147
|
+
this.onCleanup(core.gesture(this, {
|
|
324
148
|
onPinch: ({ scale, first, last }) => {
|
|
325
149
|
if (first)
|
|
326
150
|
base$1 = this._v.k;
|
|
@@ -378,10 +202,10 @@ function defineGestureComponents() {
|
|
|
378
202
|
|
|
379
203
|
exports.configureComponents = base.configureComponents;
|
|
380
204
|
exports.prefersReducedMotion = base.prefersReducedMotion;
|
|
205
|
+
exports.gesture = core.gesture;
|
|
206
|
+
exports.pinchScale = core.pinchScale;
|
|
207
|
+
exports.swipeDirection = core.swipeDirection;
|
|
381
208
|
exports.defineGestureComponents = defineGestureComponents;
|
|
382
209
|
exports.definePinchZoom = definePinchZoom;
|
|
383
210
|
exports.defineSwipeable = defineSwipeable;
|
|
384
|
-
exports.gesture = gesture;
|
|
385
|
-
exports.pinchScale = pinchScale;
|
|
386
|
-
exports.swipeDirection = swipeDirection;
|
|
387
211
|
//# sourceMappingURL=gesture.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesture.cjs","sources":["../../src/components/gesture/core.ts","../../src/components/gesture/swipeable.ts","../../src/components/gesture/pinch-zoom.ts","../../src/components/gesture/index.ts"],"sourcesContent":["import { clamp } from '../base';\n\nexport interface PanState {\n /** Offset from the gesture start (px). */\n dx: number;\n dy: number;\n /** Velocity (px/s). */\n vx: number;\n vy: number;\n first: boolean;\n last: boolean;\n event: Event;\n}\nexport type SwipeDirection = 'left' | 'right' | 'up' | 'down';\nexport interface SwipeState { direction: SwipeDirection; velocity: number; dx: number; dy: number }\nexport interface PinchState { scale: number; /** Midpoint of the two pointers (client px). */ x: number; y: number; first: boolean; last: boolean }\nexport interface PressState { x: number; y: number }\n\nexport interface GestureHandlers {\n onPan?: (s: PanState) => void;\n onSwipe?: (s: SwipeState) => void;\n onPinch?: (s: PinchState) => void;\n onLongPress?: (s: PressState) => void;\n onTap?: (s: PressState) => void;\n onDoubleTap?: (s: PressState) => void;\n}\n\nexport interface GestureOptions {\n /** Restrict panning to an axis. */\n axis?: 'x' | 'y';\n /** Movement (px) before a pan starts (default 4). */\n threshold?: number;\n /** Minimum distance (px, default 40) and speed (px/s, default 300) for a swipe. */\n swipeDistance?: number;\n swipeVelocity?: number;\n /** Long-press delay (ms, default 500). */\n longPress?: number;\n /** Ctrl/⌘ + wheel (trackpad pinch) counts as pinch (default true). */\n wheelPinch?: boolean;\n}\n\n/** The swipe a pointer release represents, or `null` (pure). */\nexport function swipeDirection(dx: number, dy: number, vx: number, vy: number, o: { distance?: number; velocity?: number; axis?: 'x' | 'y' } = {}): SwipeState | null {\n const dist = o.distance ?? 40;\n const vel = o.velocity ?? 300;\n const horiz = o.axis === 'x' || (o.axis !== 'y' && Math.abs(dx) >= Math.abs(dy));\n const d = horiz ? dx : dy;\n const v = horiz ? vx : vy;\n if (Math.abs(d) < dist && Math.abs(v) < vel * 2) return null;\n if (Math.abs(v) < vel && Math.abs(d) < dist * 3) return null;\n const direction: SwipeDirection = horiz ? (d > 0 ? 'right' : 'left') : d > 0 ? 'down' : 'up';\n return { direction, velocity: Math.abs(v), dx, dy };\n}\n\n/** Scale between two pointer distances, clamped to [min, max] (pure). */\nexport function pinchScale(startDistance: number, distance: number, base = 1, min = 0.5, max = 4): number {\n if (!startDistance) return base;\n return clamp(base * (distance / startDistance), min, max);\n}\n\ntype P = { x: number; y: number };\nconst pid = (e: any): number => (typeof e.pointerId === 'number' ? e.pointerId : 1);\n\n/**\n * One recognizer for pan, swipe, pinch (two pointers or Ctrl + wheel),\n * long-press, tap and double-tap, with velocities ready to hand to a spring\n * (`createSpring().set(target, velocity)`). Works with mouse, touch and pen\n * through Pointer Events. Returns a cleanup function.\n *\n * @example\n * const x = createSpring({ onUpdate: (v) => (card.style.translate = `${v}px`) });\n * gesture(card, {\n * onPan: ({ dx, last, vx }) => (last ? x.set(0, vx) : x.jump(dx)),\n * onSwipe: ({ direction }) => dismiss(direction),\n * }, { axis: 'x' });\n */\nexport function gesture(el: HTMLElement, h: GestureHandlers, o: GestureOptions = {}): () => void {\n const pts = new Map<number, P>();\n let start: P = { x: 0, y: 0 };\n let last: P & { t: number } = { x: 0, y: 0, t: 0 };\n let vx = 0;\n let vy = 0;\n let panning = false;\n let pinch: { d0: number; first: boolean } | null = null;\n let pinchScaleNow = 1;\n let press: ReturnType<typeof setTimeout> | undefined;\n let pressed = false;\n let lastTap = -1e9;\n const th = o.threshold ?? 4;\n const dist = () => {\n const [a, b] = [...pts.values()];\n return Math.hypot(a.x - b.x, a.y - b.y);\n };\n const mid = () => {\n const [a, b] = [...pts.values()];\n return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };\n };\n const t = (e: Event) => (e.timeStamp || Date.now());\n\n const down = (e: PointerEvent) => {\n pts.set(pid(e), { x: e.clientX, y: e.clientY });\n try { el.setPointerCapture?.(pid(e)); } catch { /* jsdom / synthetic */ }\n if (pts.size === 2 && h.onPinch) {\n clearTimeout(press);\n if (panning) h.onPan?.({ dx: last.x - start.x, dy: last.y - start.y, vx: 0, vy: 0, first: false, last: true, event: e });\n panning = false;\n pinch = { d0: dist(), first: true };\n return;\n }\n if (pts.size > 1) return;\n start = { x: e.clientX, y: e.clientY };\n last = { ...start, t: t(e) };\n vx = vy = 0;\n pressed = false;\n if (h.onLongPress) press = setTimeout(() => { pressed = true; h.onLongPress?.({ x: start.x, y: start.y }); }, o.longPress ?? 500);\n };\n const move = (e: PointerEvent) => {\n if (!pts.has(pid(e))) return;\n pts.set(pid(e), { x: e.clientX, y: e.clientY });\n if (pinch && pts.size >= 2) {\n const m = mid();\n pinchScaleNow = pinchScale(pinch.d0, dist(), 1, 0.05, 20);\n h.onPinch?.({ scale: pinchScaleNow, x: m.x, y: m.y, first: pinch.first, last: false });\n pinch.first = false;\n return;\n }\n const dx = e.clientX - start.x;\n const dy = e.clientY - start.y;\n const dt = Math.max(1, t(e) - last.t) / 1000;\n vx = (e.clientX - last.x) / dt;\n vy = (e.clientY - last.y) / dt;\n last = { x: e.clientX, y: e.clientY, t: t(e) };\n if (!panning) {\n const off = o.axis === 'x' ? Math.abs(dx) : o.axis === 'y' ? Math.abs(dy) : Math.hypot(dx, dy);\n if (off < th) return;\n clearTimeout(press);\n if (o.axis && Math.abs(o.axis === 'x' ? dy : dx) > off) { pts.delete(pid(e)); return; } // wrong axis: let the page scroll\n panning = true;\n h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: true, last: false, event: e });\n return;\n }\n if (e.cancelable) e.preventDefault();\n h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: false, last: false, event: e });\n };\n const up = (e: PointerEvent) => {\n if (!pts.has(pid(e))) return;\n pts.delete(pid(e));\n clearTimeout(press);\n if (pinch) {\n if (pts.size < 2) {\n h.onPinch?.({ scale: pinchScaleNow, ...start, first: false, last: true });\n pinch = null;\n pts.clear();\n }\n return;\n }\n const dx = e.clientX - start.x;\n const dy = e.clientY - start.y;\n if (panning) {\n panning = false;\n if (t(e) - last.t > 80) vx = vy = 0; // paused before release\n h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: false, last: true, event: e });\n const s = swipeDirection(dx, dy, vx, vy, { distance: o.swipeDistance, velocity: o.swipeVelocity, axis: o.axis });\n if (s) h.onSwipe?.(s);\n return;\n }\n if (pressed || e.type === 'pointercancel') return;\n const p = { x: e.clientX, y: e.clientY };\n const n = t(e);\n if (h.onDoubleTap && n - lastTap < 300) { lastTap = -1e9; h.onDoubleTap(p); return; }\n lastTap = n;\n h.onTap?.(p);\n };\n const wheel = (e: WheelEvent) => {\n if (!h.onPinch || o.wheelPinch === false || !e.ctrlKey) return;\n e.preventDefault();\n const s = Math.exp(-e.deltaY / 100);\n h.onPinch({ scale: s, x: e.clientX, y: e.clientY, first: true, last: true });\n };\n const opts: AddEventListenerOptions = { passive: false };\n el.addEventListener('pointerdown', down as EventListener);\n el.addEventListener('pointermove', move as EventListener, opts);\n el.addEventListener('pointerup', up as EventListener);\n el.addEventListener('pointercancel', up as EventListener);\n el.addEventListener('wheel', wheel as EventListener, opts);\n if (o.axis && !el.style.touchAction) el.style.touchAction = o.axis === 'x' ? 'pan-y' : 'pan-x';\n else if (!o.axis && !el.style.touchAction && (h.onPan || h.onPinch)) el.style.touchAction = 'none';\n return () => {\n clearTimeout(press);\n el.removeEventListener('pointerdown', down as EventListener);\n el.removeEventListener('pointermove', move as EventListener, opts);\n el.removeEventListener('pointerup', up as EventListener);\n el.removeEventListener('pointercancel', up as EventListener);\n el.removeEventListener('wheel', wheel as EventListener, opts);\n };\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture, type SwipeDirection } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-swipeable>` — swipe-to-dismiss / swipe actions. The content follows\n * the finger (rubber-banded past `distance`), flies out on a swipe or a drag\n * past `distance`, otherwise springs home with the release velocity.\n *\n * Attributes: `axis` (`x` default · `y`), `distance` (px, 120), `preset`\n * (spring), `dismiss` (remove the element after flying out), `disabled`.\n * Keyboard: Delete/Backspace dismisses, ←/→ swipe. Events `usa:swipe`\n * (`{ direction }`, cancelable), `usa:dismiss`. Methods `swipe(dir)`, `reset()`.\n * Reduced motion: no follow / fly-out animation, events still fire.\n */\nexport interface UsaSwipeableElement extends UsaElement {\n swipe(direction: SwipeDirection): void;\n reset(): void;\n readonly offset: number;\n}\n\nexport function defineSwipeable(tag = 'usa-swipeable'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSwipeable extends Base {\n static get observedAttributes(): string[] {\n return ['axis', 'disabled'];\n }\n private _s!: SpringValue;\n private _off = 0;\n\n get offset(): number {\n return this._off;\n }\n\n private put(v: number): void {\n this._off = v;\n this.style.setProperty('--usa-swipe', `${v}px`);\n this.style.setProperty('--usa-swipe-p', String(Math.min(1, Math.abs(v) / this.num('distance', 120))));\n }\n\n swipe(direction: SwipeDirection): void {\n if (!this.emit('swipe', { direction })) return this.reset();\n const sign = direction === 'left' || direction === 'up' ? -1 : 1;\n const far = sign * ((this.str('axis', 'x') === 'y' ? this.offsetHeight : this.offsetWidth) + 80 || 600);\n const done = () => {\n this.emit('dismiss', { direction });\n if (this.flag('dismiss')) this.remove();\n };\n if (this.reduced) {\n this.put(0);\n return done();\n }\n this.setAttribute('data-gone', '');\n this._s = createSpring({ spring: 'stiff', value: this._off, onUpdate: (v) => this.put(v), onRest: done });\n this._s.set(far, sign * 1500);\n }\n\n reset(): void {\n this.removeAttribute('data-gone');\n if (this.reduced) return this.put(0);\n this._s.set(0);\n }\n\n mount(): void {\n this._s = createSpring({ spring: this.str('preset', 'default'), onUpdate: (v) => this.put(v) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n const y = this.str('axis', 'x') === 'y';\n const max = () => this.num('distance', 120);\n this.onCleanup(\n gesture(this, {\n onPan: ({ dx, dy, vx, vy, last }) => {\n if (this.flag('disabled')) return;\n const d = y ? dy : dx;\n if (!last) {\n this._s.stop();\n if (!this.reduced) this.put(Math.abs(d) > max() ? Math.sign(d) * (max() + (Math.abs(d) - max()) * 0.35) : d);\n return;\n }\n if (Math.abs(d) > max()) this.swipe(y ? (d > 0 ? 'down' : 'up') : d > 0 ? 'right' : 'left');\n else if (!this.hasAttribute('data-gone')) {\n if (this.reduced) this.put(0);\n else this._s.set(0, y ? vy : vx);\n }\n },\n onSwipe: ({ direction }) => {\n if (this.flag('disabled') || this.hasAttribute('data-gone')) return;\n if (y === (direction === 'up' || direction === 'down')) this.swipe(direction);\n },\n }, { axis: y ? 'y' : 'x' })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (this.flag('disabled')) return;\n const map: Record<string, SwipeDirection> = y ? { ArrowUp: 'up', ArrowDown: 'down' } : { ArrowLeft: 'left', ArrowRight: 'right' };\n if (e.key === 'Delete' || e.key === 'Backspace') this.swipe(y ? 'up' : 'left');\n else if (map[e.key]) this.swipe(map[e.key]);\n else return;\n e.preventDefault();\n });\n }\n\n unmount(): void {\n this._s?.stop();\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","import { defineElement, clamp, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-pinch-zoom>` — pinch (two fingers or Ctrl/⌘ + wheel / trackpad\n * pinch) to zoom its content, pan while zoomed, double-tap to toggle zoom;\n * scale and position spring back inside the bounds on release.\n *\n * Attributes: `min` (1), `max` (4), `double-tap` (zoom level, 2), `preset`.\n * Keyboard: `+` / `-` / `0`. Property `scale`, method `zoomTo(scale)`.\n * Event `usa:zoom` (`{ scale }`). Reduced motion: zoom changes instantly.\n */\nexport interface UsaPinchZoomElement extends UsaElement {\n readonly scale: number;\n zoomTo(scale: number): void;\n}\n\nexport function definePinchZoom(tag = 'usa-pinch-zoom'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPinchZoom extends Base {\n private _k!: SpringValue;\n private _x!: SpringValue;\n private _y!: SpringValue;\n private _v = { k: 1, x: 0, y: 0 };\n\n get scale(): number {\n return this._v.k;\n }\n\n private paint(): void {\n const { k, x, y } = this._v;\n this.style.setProperty('--usa-zoom', String(k));\n this.style.setProperty('--usa-zoom-x', `${x}px`);\n this.style.setProperty('--usa-zoom-y', `${y}px`);\n this.toggleAttribute('data-zoomed', k > 1.01);\n }\n\n private bound(k: number, x: number, y: number) {\n const w = (this.clientWidth * (k - 1)) / 2;\n const h = (this.clientHeight * (k - 1)) / 2;\n return { x: clamp(x, -w, w), y: clamp(y, -h, h) };\n }\n\n zoomTo(scale: number): void {\n const k = clamp(scale, this.num('min', 1), this.num('max', 4));\n const b = this.bound(k, this._v.x, this._v.y);\n if (this.reduced) {\n this._v = { k, ...b };\n this.paint();\n } else {\n this._k.set(k);\n this._x.set(b.x);\n this._y.set(b.y);\n }\n this.emit('zoom', { scale: k });\n }\n\n mount(): void {\n const preset = this.str('preset', 'gentle');\n this._k = createSpring({ spring: preset, value: this._v.k, onUpdate: (v) => ((this._v.k = v), this.paint()) });\n this._x = createSpring({ spring: preset, value: this._v.x, onUpdate: (v) => ((this._v.x = v), this.paint()) });\n this._y = createSpring({ spring: preset, value: this._v.y, onUpdate: (v) => ((this._v.y = v), this.paint()) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n let base = 1;\n let ox = 0;\n let oy = 0;\n this.onCleanup(\n gesture(this, {\n onPinch: ({ scale, first, last }) => {\n if (first) base = this._v.k;\n const k = clamp(base * scale, this.num('min', 1) * 0.7, this.num('max', 4) * 1.3);\n if (last) return this.zoomTo(k);\n this._k.jump(k);\n },\n onPan: ({ dx, dy, vx, vy, first, last }) => {\n if (this._v.k <= 1.01) return;\n if (first) ((ox = this._v.x), (oy = this._v.y));\n if (!last) {\n this._x.jump(ox + dx);\n this._y.jump(oy + dy);\n return;\n }\n const b = this.bound(this._v.k, ox + dx + vx * 0.15, oy + dy + vy * 0.15);\n this._x.set(b.x, vx);\n this._y.set(b.y, vy);\n },\n onDoubleTap: () => this.zoomTo(this._v.k > 1.01 ? 1 : this.num('double-tap', 2)),\n })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === '+' || e.key === '=') this.zoomTo(this._v.k * 1.25);\n else if (e.key === '-') this.zoomTo(this._v.k / 1.25);\n else if (e.key === '0') this.zoomTo(1);\n else return;\n e.preventDefault();\n });\n this.paint();\n }\n\n unmount(): void {\n [this._k, this._x, this._y].forEach((s) => s?.stop());\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/gesture — unified gestures (v3.2).\n * `gesture()` recognises pan, swipe, pinch, long-press, tap and double-tap\n * with release velocities for springs; `<usa-swipeable>` (swipe-to-dismiss)\n * and `<usa-pinch-zoom>` are built on it.\n */\nimport { defineSwipeable, type UsaSwipeableElement } from './swipeable';\nimport { definePinchZoom, type UsaPinchZoomElement } from './pinch-zoom';\n\nexport { defineSwipeable, definePinchZoom };\nexport { gesture, swipeDirection, pinchScale } from './core';\nexport type { GestureHandlers, GestureOptions, PanState, SwipeState, SwipeDirection, PinchState, PressState } from './core';\nexport type { UsaSwipeableElement, UsaPinchZoomElement };\nexport { configureComponents, prefersReducedMotion } from '../base';\nexport type { ComponentsConfig, UsaElement } from '../base';\n\n/** Register every component of this category under its default tag. */\nexport function defineGestureComponents(): void {\n defineSwipeable();\n definePinchZoom();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-swipeable': UsaSwipeableElement;\n 'usa-pinch-zoom': UsaPinchZoomElement;\n }\n}\n"],"names":["base","clamp","defineElement","createSpring"],"mappings":";;;;;AAyCA;AACM,SAAU,cAAc,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,CAAA,GAAgE,EAAE,EAAA;AAC/I,IAAA,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,IAAI,EAAE;AAC7B,IAAA,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,IAAI,GAAG;AAC7B,IAAA,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChF,MAAM,CAAC,GAAG,KAAK,GAAG,EAAE,GAAG,EAAE;IACzB,MA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IAAI,CAAC;AAC5D,qBAAA,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG;oBAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AAChD,qBAAA,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG;AAAE,oBAAA,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;;oBACjC;gBACL,CAAC,CAAC,cAAc,EAAE;AACpB,YAAA,CAAC,CAAC;YACF,IAAI,CAAC,KAAK,EAAE;QACd;QAEA,OAAO,GAAA;YACL,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;QACvD;KACD,EACH,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAC7B;AACH;;AC7GA;;;;;AAKG;AAWH;SACgB,uBAAuB,GAAA;AACrC,IAAA,eAAe,EAAE;AACjB,IAAA,eAAe,EAAE;AACnB;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"gesture.cjs","sources":["../../src/components/gesture/swipeable.ts","../../src/components/gesture/pinch-zoom.ts","../../src/components/gesture/index.ts"],"sourcesContent":["import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture, type SwipeDirection } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-swipeable>` — swipe-to-dismiss / swipe actions. The content follows\n * the finger (rubber-banded past `distance`), flies out on a swipe or a drag\n * past `distance`, otherwise springs home with the release velocity.\n *\n * Attributes: `axis` (`x` default · `y`), `distance` (px, 120), `preset`\n * (spring), `dismiss` (remove the element after flying out), `disabled`.\n * Keyboard: Delete/Backspace dismisses, ←/→ swipe. Events `usa:swipe`\n * (`{ direction }`, cancelable), `usa:dismiss`. Methods `swipe(dir)`, `reset()`.\n * Reduced motion: no follow / fly-out animation, events still fire.\n */\nexport interface UsaSwipeableElement extends UsaElement {\n swipe(direction: SwipeDirection): void;\n reset(): void;\n readonly offset: number;\n}\n\nexport function defineSwipeable(tag = 'usa-swipeable'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSwipeable extends Base {\n static get observedAttributes(): string[] {\n return ['axis', 'disabled'];\n }\n private _s!: SpringValue;\n private _off = 0;\n\n get offset(): number {\n return this._off;\n }\n\n private put(v: number): void {\n this._off = v;\n this.style.setProperty('--usa-swipe', `${v}px`);\n this.style.setProperty('--usa-swipe-p', String(Math.min(1, Math.abs(v) / this.num('distance', 120))));\n }\n\n swipe(direction: SwipeDirection): void {\n if (!this.emit('swipe', { direction })) return this.reset();\n const sign = direction === 'left' || direction === 'up' ? -1 : 1;\n const far = sign * ((this.str('axis', 'x') === 'y' ? this.offsetHeight : this.offsetWidth) + 80 || 600);\n const done = () => {\n this.emit('dismiss', { direction });\n if (this.flag('dismiss')) this.remove();\n };\n if (this.reduced) {\n this.put(0);\n return done();\n }\n this.setAttribute('data-gone', '');\n this._s = createSpring({ spring: 'stiff', value: this._off, onUpdate: (v) => this.put(v), onRest: done });\n this._s.set(far, sign * 1500);\n }\n\n reset(): void {\n this.removeAttribute('data-gone');\n if (this.reduced) return this.put(0);\n this._s.set(0);\n }\n\n mount(): void {\n this._s = createSpring({ spring: this.str('preset', 'default'), onUpdate: (v) => this.put(v) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n const y = this.str('axis', 'x') === 'y';\n const max = () => this.num('distance', 120);\n this.onCleanup(\n gesture(this, {\n onPan: ({ dx, dy, vx, vy, last }) => {\n if (this.flag('disabled')) return;\n const d = y ? dy : dx;\n if (!last) {\n this._s.stop();\n if (!this.reduced) this.put(Math.abs(d) > max() ? Math.sign(d) * (max() + (Math.abs(d) - max()) * 0.35) : d);\n return;\n }\n if (Math.abs(d) > max()) this.swipe(y ? (d > 0 ? 'down' : 'up') : d > 0 ? 'right' : 'left');\n else if (!this.hasAttribute('data-gone')) {\n if (this.reduced) this.put(0);\n else this._s.set(0, y ? vy : vx);\n }\n },\n onSwipe: ({ direction }) => {\n if (this.flag('disabled') || this.hasAttribute('data-gone')) return;\n if (y === (direction === 'up' || direction === 'down')) this.swipe(direction);\n },\n }, { axis: y ? 'y' : 'x' })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (this.flag('disabled')) return;\n const map: Record<string, SwipeDirection> = y ? { ArrowUp: 'up', ArrowDown: 'down' } : { ArrowLeft: 'left', ArrowRight: 'right' };\n if (e.key === 'Delete' || e.key === 'Backspace') this.swipe(y ? 'up' : 'left');\n else if (map[e.key]) this.swipe(map[e.key]);\n else return;\n e.preventDefault();\n });\n }\n\n unmount(): void {\n this._s?.stop();\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","import { defineElement, clamp, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-pinch-zoom>` — pinch (two fingers or Ctrl/⌘ + wheel / trackpad\n * pinch) to zoom its content, pan while zoomed, double-tap to toggle zoom;\n * scale and position spring back inside the bounds on release.\n *\n * Attributes: `min` (1), `max` (4), `double-tap` (zoom level, 2), `preset`.\n * Keyboard: `+` / `-` / `0`. Property `scale`, method `zoomTo(scale)`.\n * Event `usa:zoom` (`{ scale }`). Reduced motion: zoom changes instantly.\n */\nexport interface UsaPinchZoomElement extends UsaElement {\n readonly scale: number;\n zoomTo(scale: number): void;\n}\n\nexport function definePinchZoom(tag = 'usa-pinch-zoom'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPinchZoom extends Base {\n private _k!: SpringValue;\n private _x!: SpringValue;\n private _y!: SpringValue;\n private _v = { k: 1, x: 0, y: 0 };\n\n get scale(): number {\n return this._v.k;\n }\n\n private paint(): void {\n const { k, x, y } = this._v;\n this.style.setProperty('--usa-zoom', String(k));\n this.style.setProperty('--usa-zoom-x', `${x}px`);\n this.style.setProperty('--usa-zoom-y', `${y}px`);\n this.toggleAttribute('data-zoomed', k > 1.01);\n }\n\n private bound(k: number, x: number, y: number) {\n const w = (this.clientWidth * (k - 1)) / 2;\n const h = (this.clientHeight * (k - 1)) / 2;\n return { x: clamp(x, -w, w), y: clamp(y, -h, h) };\n }\n\n zoomTo(scale: number): void {\n const k = clamp(scale, this.num('min', 1), this.num('max', 4));\n const b = this.bound(k, this._v.x, this._v.y);\n if (this.reduced) {\n this._v = { k, ...b };\n this.paint();\n } else {\n this._k.set(k);\n this._x.set(b.x);\n this._y.set(b.y);\n }\n this.emit('zoom', { scale: k });\n }\n\n mount(): void {\n const preset = this.str('preset', 'gentle');\n this._k = createSpring({ spring: preset, value: this._v.k, onUpdate: (v) => ((this._v.k = v), this.paint()) });\n this._x = createSpring({ spring: preset, value: this._v.x, onUpdate: (v) => ((this._v.x = v), this.paint()) });\n this._y = createSpring({ spring: preset, value: this._v.y, onUpdate: (v) => ((this._v.y = v), this.paint()) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n let base = 1;\n let ox = 0;\n let oy = 0;\n this.onCleanup(\n gesture(this, {\n onPinch: ({ scale, first, last }) => {\n if (first) base = this._v.k;\n const k = clamp(base * scale, this.num('min', 1) * 0.7, this.num('max', 4) * 1.3);\n if (last) return this.zoomTo(k);\n this._k.jump(k);\n },\n onPan: ({ dx, dy, vx, vy, first, last }) => {\n if (this._v.k <= 1.01) return;\n if (first) ((ox = this._v.x), (oy = this._v.y));\n if (!last) {\n this._x.jump(ox + dx);\n this._y.jump(oy + dy);\n return;\n }\n const b = this.bound(this._v.k, ox + dx + vx * 0.15, oy + dy + vy * 0.15);\n this._x.set(b.x, vx);\n this._y.set(b.y, vy);\n },\n onDoubleTap: () => this.zoomTo(this._v.k > 1.01 ? 1 : this.num('double-tap', 2)),\n })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === '+' || e.key === '=') this.zoomTo(this._v.k * 1.25);\n else if (e.key === '-') this.zoomTo(this._v.k / 1.25);\n else if (e.key === '0') this.zoomTo(1);\n else return;\n e.preventDefault();\n });\n this.paint();\n }\n\n unmount(): void {\n [this._k, this._x, this._y].forEach((s) => s?.stop());\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/gesture — unified gestures (v3.2).\n * `gesture()` recognises pan, swipe, pinch, long-press, tap and double-tap\n * with release velocities for springs; `<usa-swipeable>` (swipe-to-dismiss)\n * and `<usa-pinch-zoom>` are built on it.\n */\nimport { defineSwipeable, type UsaSwipeableElement } from './swipeable';\nimport { definePinchZoom, type UsaPinchZoomElement } from './pinch-zoom';\n\nexport { defineSwipeable, definePinchZoom };\nexport { gesture, swipeDirection, pinchScale } from './core';\nexport type { GestureHandlers, GestureOptions, PanState, SwipeState, SwipeDirection, PinchState, PressState } from './core';\nexport type { UsaSwipeableElement, UsaPinchZoomElement };\nexport { configureComponents, prefersReducedMotion } from '../base';\nexport type { ComponentsConfig, UsaElement } from '../base';\n\n/** Register every component of this category under its default tag. */\nexport function defineGestureComponents(): void {\n defineSwipeable();\n definePinchZoom();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-swipeable': UsaSwipeableElement;\n 'usa-pinch-zoom': UsaPinchZoomElement;\n }\n}\n"],"names":["defineElement","createSpring","gesture","clamp","base"],"mappings":";;;;;;;;AAsBM,SAAU,eAAe,CAAC,GAAG,GAAG,eAAe,EAAA;AACnD,IAAA,OAAOA,kBAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,YAAa,SAAQ,IAAI,CAAA;AAA/B,QAAA,WAAA,GAAA;;YAKU,IAAA,CAAA,IAAI,GAAG,CAAC;QA2ElB;AA/EE,QAAA,WAAW,kBAAkB,GAAA;AAC3B,YAAA,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;QAC7B;AAIA,QAAA,IAAI,MAAM,GAAA;YACR,OAAO,IAAI,CAAC,IAAI;QACl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EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;QACvD;KACD,EACH,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAC7B;AACH;;AC7GA;;;;;AAKG;AAWH;SACgB,uBAAuB,GAAA;AACrC,IAAA,eAAe,EAAE;AACjB,IAAA,eAAe,EAAE;AACnB;;;;;;;;;;;"}
|
|
@@ -1,183 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-
|
|
3
|
-
import { c as createSpring } from '../chunks/spring-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function swipeDirection(dx, dy, vx, vy, o = {}) {
|
|
7
|
-
const dist = o.distance ?? 40;
|
|
8
|
-
const vel = o.velocity ?? 300;
|
|
9
|
-
const horiz = o.axis === 'x' || (o.axis !== 'y' && Math.abs(dx) >= Math.abs(dy));
|
|
10
|
-
const d = horiz ? dx : dy;
|
|
11
|
-
const v = horiz ? vx : vy;
|
|
12
|
-
if (Math.abs(d) < dist && Math.abs(v) < vel * 2)
|
|
13
|
-
return null;
|
|
14
|
-
if (Math.abs(v) < vel && Math.abs(d) < dist * 3)
|
|
15
|
-
return null;
|
|
16
|
-
const direction = horiz ? (d > 0 ? 'right' : 'left') : d > 0 ? 'down' : 'up';
|
|
17
|
-
return { direction, velocity: Math.abs(v), dx, dy };
|
|
18
|
-
}
|
|
19
|
-
/** Scale between two pointer distances, clamped to [min, max] (pure). */
|
|
20
|
-
function pinchScale(startDistance, distance, base = 1, min = 0.5, max = 4) {
|
|
21
|
-
if (!startDistance)
|
|
22
|
-
return base;
|
|
23
|
-
return clamp(base * (distance / startDistance), min, max);
|
|
24
|
-
}
|
|
25
|
-
const pid = (e) => (typeof e.pointerId === 'number' ? e.pointerId : 1);
|
|
26
|
-
/**
|
|
27
|
-
* One recognizer for pan, swipe, pinch (two pointers or Ctrl + wheel),
|
|
28
|
-
* long-press, tap and double-tap, with velocities ready to hand to a spring
|
|
29
|
-
* (`createSpring().set(target, velocity)`). Works with mouse, touch and pen
|
|
30
|
-
* through Pointer Events. Returns a cleanup function.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* const x = createSpring({ onUpdate: (v) => (card.style.translate = `${v}px`) });
|
|
34
|
-
* gesture(card, {
|
|
35
|
-
* onPan: ({ dx, last, vx }) => (last ? x.set(0, vx) : x.jump(dx)),
|
|
36
|
-
* onSwipe: ({ direction }) => dismiss(direction),
|
|
37
|
-
* }, { axis: 'x' });
|
|
38
|
-
*/
|
|
39
|
-
function gesture(el, h, o = {}) {
|
|
40
|
-
const pts = new Map();
|
|
41
|
-
let start = { x: 0, y: 0 };
|
|
42
|
-
let last = { x: 0, y: 0, t: 0 };
|
|
43
|
-
let vx = 0;
|
|
44
|
-
let vy = 0;
|
|
45
|
-
let panning = false;
|
|
46
|
-
let pinch = null;
|
|
47
|
-
let pinchScaleNow = 1;
|
|
48
|
-
let press;
|
|
49
|
-
let pressed = false;
|
|
50
|
-
let lastTap = -1e9;
|
|
51
|
-
const th = o.threshold ?? 4;
|
|
52
|
-
const dist = () => {
|
|
53
|
-
const [a, b] = [...pts.values()];
|
|
54
|
-
return Math.hypot(a.x - b.x, a.y - b.y);
|
|
55
|
-
};
|
|
56
|
-
const mid = () => {
|
|
57
|
-
const [a, b] = [...pts.values()];
|
|
58
|
-
return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
|
59
|
-
};
|
|
60
|
-
const t = (e) => (e.timeStamp || Date.now());
|
|
61
|
-
const down = (e) => {
|
|
62
|
-
pts.set(pid(e), { x: e.clientX, y: e.clientY });
|
|
63
|
-
try {
|
|
64
|
-
el.setPointerCapture?.(pid(e));
|
|
65
|
-
}
|
|
66
|
-
catch { /* jsdom / synthetic */ }
|
|
67
|
-
if (pts.size === 2 && h.onPinch) {
|
|
68
|
-
clearTimeout(press);
|
|
69
|
-
if (panning)
|
|
70
|
-
h.onPan?.({ dx: last.x - start.x, dy: last.y - start.y, vx: 0, vy: 0, first: false, last: true, event: e });
|
|
71
|
-
panning = false;
|
|
72
|
-
pinch = { d0: dist(), first: true };
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (pts.size > 1)
|
|
76
|
-
return;
|
|
77
|
-
start = { x: e.clientX, y: e.clientY };
|
|
78
|
-
last = { ...start, t: t(e) };
|
|
79
|
-
vx = vy = 0;
|
|
80
|
-
pressed = false;
|
|
81
|
-
if (h.onLongPress)
|
|
82
|
-
press = setTimeout(() => { pressed = true; h.onLongPress?.({ x: start.x, y: start.y }); }, o.longPress ?? 500);
|
|
83
|
-
};
|
|
84
|
-
const move = (e) => {
|
|
85
|
-
if (!pts.has(pid(e)))
|
|
86
|
-
return;
|
|
87
|
-
pts.set(pid(e), { x: e.clientX, y: e.clientY });
|
|
88
|
-
if (pinch && pts.size >= 2) {
|
|
89
|
-
const m = mid();
|
|
90
|
-
pinchScaleNow = pinchScale(pinch.d0, dist(), 1, 0.05, 20);
|
|
91
|
-
h.onPinch?.({ scale: pinchScaleNow, x: m.x, y: m.y, first: pinch.first, last: false });
|
|
92
|
-
pinch.first = false;
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const dx = e.clientX - start.x;
|
|
96
|
-
const dy = e.clientY - start.y;
|
|
97
|
-
const dt = Math.max(1, t(e) - last.t) / 1000;
|
|
98
|
-
vx = (e.clientX - last.x) / dt;
|
|
99
|
-
vy = (e.clientY - last.y) / dt;
|
|
100
|
-
last = { x: e.clientX, y: e.clientY, t: t(e) };
|
|
101
|
-
if (!panning) {
|
|
102
|
-
const off = o.axis === 'x' ? Math.abs(dx) : o.axis === 'y' ? Math.abs(dy) : Math.hypot(dx, dy);
|
|
103
|
-
if (off < th)
|
|
104
|
-
return;
|
|
105
|
-
clearTimeout(press);
|
|
106
|
-
if (o.axis && Math.abs(o.axis === 'x' ? dy : dx) > off) {
|
|
107
|
-
pts.delete(pid(e));
|
|
108
|
-
return;
|
|
109
|
-
} // wrong axis: let the page scroll
|
|
110
|
-
panning = true;
|
|
111
|
-
h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: true, last: false, event: e });
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (e.cancelable)
|
|
115
|
-
e.preventDefault();
|
|
116
|
-
h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: false, last: false, event: e });
|
|
117
|
-
};
|
|
118
|
-
const up = (e) => {
|
|
119
|
-
if (!pts.has(pid(e)))
|
|
120
|
-
return;
|
|
121
|
-
pts.delete(pid(e));
|
|
122
|
-
clearTimeout(press);
|
|
123
|
-
if (pinch) {
|
|
124
|
-
if (pts.size < 2) {
|
|
125
|
-
h.onPinch?.({ scale: pinchScaleNow, ...start, first: false, last: true });
|
|
126
|
-
pinch = null;
|
|
127
|
-
pts.clear();
|
|
128
|
-
}
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const dx = e.clientX - start.x;
|
|
132
|
-
const dy = e.clientY - start.y;
|
|
133
|
-
if (panning) {
|
|
134
|
-
panning = false;
|
|
135
|
-
if (t(e) - last.t > 80)
|
|
136
|
-
vx = vy = 0; // paused before release
|
|
137
|
-
h.onPan?.({ dx: o.axis === 'y' ? 0 : dx, dy: o.axis === 'x' ? 0 : dy, vx, vy, first: false, last: true, event: e });
|
|
138
|
-
const s = swipeDirection(dx, dy, vx, vy, { distance: o.swipeDistance, velocity: o.swipeVelocity, axis: o.axis });
|
|
139
|
-
if (s)
|
|
140
|
-
h.onSwipe?.(s);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if (pressed || e.type === 'pointercancel')
|
|
144
|
-
return;
|
|
145
|
-
const p = { x: e.clientX, y: e.clientY };
|
|
146
|
-
const n = t(e);
|
|
147
|
-
if (h.onDoubleTap && n - lastTap < 300) {
|
|
148
|
-
lastTap = -1e9;
|
|
149
|
-
h.onDoubleTap(p);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
lastTap = n;
|
|
153
|
-
h.onTap?.(p);
|
|
154
|
-
};
|
|
155
|
-
const wheel = (e) => {
|
|
156
|
-
if (!h.onPinch || o.wheelPinch === false || !e.ctrlKey)
|
|
157
|
-
return;
|
|
158
|
-
e.preventDefault();
|
|
159
|
-
const s = Math.exp(-e.deltaY / 100);
|
|
160
|
-
h.onPinch({ scale: s, x: e.clientX, y: e.clientY, first: true, last: true });
|
|
161
|
-
};
|
|
162
|
-
const opts = { passive: false };
|
|
163
|
-
el.addEventListener('pointerdown', down);
|
|
164
|
-
el.addEventListener('pointermove', move, opts);
|
|
165
|
-
el.addEventListener('pointerup', up);
|
|
166
|
-
el.addEventListener('pointercancel', up);
|
|
167
|
-
el.addEventListener('wheel', wheel, opts);
|
|
168
|
-
if (o.axis && !el.style.touchAction)
|
|
169
|
-
el.style.touchAction = o.axis === 'x' ? 'pan-y' : 'pan-x';
|
|
170
|
-
else if (!o.axis && !el.style.touchAction && (h.onPan || h.onPinch))
|
|
171
|
-
el.style.touchAction = 'none';
|
|
172
|
-
return () => {
|
|
173
|
-
clearTimeout(press);
|
|
174
|
-
el.removeEventListener('pointerdown', down);
|
|
175
|
-
el.removeEventListener('pointermove', move, opts);
|
|
176
|
-
el.removeEventListener('pointerup', up);
|
|
177
|
-
el.removeEventListener('pointercancel', up);
|
|
178
|
-
el.removeEventListener('wheel', wheel, opts);
|
|
179
|
-
};
|
|
180
|
-
}
|
|
1
|
+
import { h as defineElement, b as clamp } from '../chunks/base-BpROOcey.js';
|
|
2
|
+
export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BpROOcey.js';
|
|
3
|
+
import { c as createSpring } from '../chunks/spring-C-fw7_9f.js';
|
|
4
|
+
import { g as gesture } from '../chunks/core-uxs3ETou.js';
|
|
5
|
+
export { p as pinchScale, s as swipeDirection } from '../chunks/core-uxs3ETou.js';
|
|
181
6
|
|
|
182
7
|
var css = "usa-swipeable{display:block;touch-action:pan-y;user-select:none;-webkit-user-select:none}usa-swipeable[axis=\"y\"]{touch-action:pan-x}usa-swipeable>*{transform:translate3d(var(--usa-swipe,0px),0,0);opacity:calc(1 - var(--usa-swipe-p,0) * 0.5)}usa-swipeable[axis=\"y\"]>*{transform:translate3d(0,var(--usa-swipe,0px),0)}usa-swipeable:focus-visible{outline:2px solid currentColor;outline-offset:2px}usa-pinch-zoom{display:block;overflow:hidden;touch-action:none;position:relative}usa-pinch-zoom>*{transform:translate3d(var(--usa-zoom-x,0px),var(--usa-zoom-y,0px),0) scale(var(--usa-zoom,1));transform-origin:50% 50%}usa-pinch-zoom[data-zoomed]{cursor:grab}usa-pinch-zoom:focus-visible{outline:2px solid currentColor;outline-offset:2px}";
|
|
183
8
|
|
|
@@ -375,5 +200,5 @@ function defineGestureComponents() {
|
|
|
375
200
|
definePinchZoom();
|
|
376
201
|
}
|
|
377
202
|
|
|
378
|
-
export { defineGestureComponents, definePinchZoom, defineSwipeable, gesture
|
|
203
|
+
export { defineGestureComponents, definePinchZoom, defineSwipeable, gesture };
|
|
379
204
|
//# sourceMappingURL=gesture.js.map
|