@jsenv/navi 0.29.31 → 0.29.32

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.
@@ -63,6 +63,7 @@ condition: `{ swipe_right: canArchive && archive }`.
63
63
  | `swipe_left` `swipe_right` `swipe_up` `swipe_down` | a press that travels |
64
64
  | `longpress` | a press held still |
65
65
  | `move` `reorder` `toss` | the element carried, and what letting go means |
66
+ | `grab` | the instant a drag takes hold of it |
66
67
  | `"keyboard:<shortcut>"` | keys, e.g. `"keyboard:ctrl+backspace"` |
67
68
 
68
69
  A name nothing knows how to detect produces a dev warning naming the detectors
@@ -228,6 +229,39 @@ name what moves.
228
229
  | `data-drag-delay` `data-drag-slop` `data-drag-threshold` | when the press becomes a grab |
229
230
  | `data-toss-distance` `data-toss-speed` | how far and how fast counts as a throw |
230
231
 
232
+ ### Saying the grab is acquired: `grab`
233
+
234
+ The three above answer the **release**. Between the press and the release there is
235
+ one instant that counts for the hand: the one where the object stops being pressed
236
+ and starts being held. `grab` is that instant — the same one whichever way the drag
237
+ was entered, a finger held still or a mouse travelled a few pixels.
238
+
239
+ ```jsx
240
+ <Box
241
+ interactions={{
242
+ toss: (event) => remove(event.detail.id),
243
+ grab: () => navigator.vibrate?.(10),
244
+ }}
245
+ />
246
+ ```
247
+
248
+ It matters most where it is least visible. On a screen the held object is under the
249
+ thumb that hides it, so the only feedback available is the one that is felt; without
250
+ it the hand waits, doubts the press was heard, and lets go too early — the whole
251
+ gesture fails, not its decoration. With a mouse the grab is acquired after a few
252
+ pixels and the object has visibly moved, so the answer is already there.
253
+
254
+ Nothing here is about vibration: a sound, a class, a measure are the same moment.
255
+
256
+ `grab` **reports, it does not ask**: what it returns is not waited on, and
257
+ preventing its event does not call the gesture off. And it is not an interaction on
258
+ its own — declared without `move`, `reorder` or `toss` there is no gesture for it to
259
+ be the beginning of, and a dev warning says so. Its detail carries `pointerType` and
260
+ the `gestureInfo`.
261
+
262
+ A `longpress` needs none of this: it already happens at the moment the hold is
263
+ acquired, not at the release.
264
+
231
265
  ### Dressing the clone
232
266
 
233
267
  What the pointer carries is a copy, and a copy of a transparent element is
@@ -400,6 +434,8 @@ container above it does not take the gesture:
400
434
  the registry.
401
435
  - `src/control/interaction/interaction_press.js` — swipes and holds, and what a
402
436
  swipe writes on the element.
437
+ - `src/control/interaction/interaction_drag.js` — `move`, `reorder`, `toss` and
438
+ the `grab` moment.
403
439
  - `src/control/interaction/interaction_keyboard.js`,
404
440
  `interaction_native.js` — the other two detectors.
405
441
  - `src/control/demos/38_interactions_demo.html` — every case above, plus a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.31",
3
+ "version": "0.29.32",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {