@vielzeug/codex 26.10.11 → 26.10.13

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/data/search.json CHANGED
@@ -575,8 +575,8 @@
575
575
  "description": "framework neutral two dimensional pointer drag and one axis pan recognition with lifecycle owned handles.",
576
576
  "docs": {
577
577
  "index": " \ntitle: 'gesture: pointer movement primitives'\ndescription: framework neutral two dimensional pointer drag and one axis pan recognition with lifecycle owned handles.\npackage: gesture\ncategory: input\nkeywords: [pointer, pan, swipe, gesture, touch, drag, long press]\nexports: [createdraggesture, createpangesture, createlongpress, gestureconfigerror]\nrelated: [refine, dnd, keymap]\nenvironments: [browser]\n \n\n<! markdownlint disable md025 md033 md060 >\n\n<packagehero package=\"gesture\" />\n\n## why gesture?\n\npointer driven interfaces need reliable one pointer movement tracking without coupling recognition to rendering, drag and drop semantics, or product specific completion policy.\n\n```ts\n// before\nelement.addeventlistener('pointermove', (event) => {\n // coordinate tracking, pointer identity, direction locking, and cleanup\n});\n\n// after\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst pan = createpangesture(element, {\n axis: 'x',\n onmove: ({ distance }) => console.log('distance', distance),\n onend: ({ reason }) => console.log('ended', reason),\n});\n```\n\n| feature | gesture | ad hoc pointer handling |\n| | | |\n| bundle size | <packageinfo package=\"gesture\" type=\"size\" /> | n/a |\n| zero dependencies | <ore icon name=\"check\" size=\"16\"></ore icon> | n/a |\n| two dimensional drag tracking | built in | manual |\n| axis intent recognition | built in | manual |\n| pointer ownership | tracked across the document | manual |\n| lifecycle cleanup | `dispose()` + `disposalsignal` | manual |\n\n<div class=\"decision callout\">\n\n**use gesture when** ui surfaces need consistent free drag or axis locked pan tracking while retaining their own rendering and completion rules.\n\n**consider direct pointer handling when** the interaction is isolated and does not need reusable lifecycle or direction lock behavior.\n\n</div>\n\n## installation\n\n::: code group\n\n```sh [pnpm]\npnpm add @vielzeug/gesture\n```\n\n```sh [npm]\nnpm install @vielzeug/gesture\n```\n\n```sh [yarn]\nyarn add @vielzeug/gesture\n```\n\n:::\n\n## quick start\n\n```ts\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst element = document.queryselector<htmlelement>('[data swipe]');\nif (!element) throw new error('missing [data swipe] element');\n\nconst pan = createpangesture(element, {\n axis: 'x',\n onmove: ({ distance }) => {\n element.style.transform = `translatex(${distance}px)`;\n },\n onend: ({ distance, reason }) => {\n element.style.transform = '';\n if (reason === 'release' && math.abs(distance) >= 48) {\n pan.dispose();\n element.remove();\n }\n },\n});\n\nwindow.addeventlistener('pagehide', () => pan.dispose(), { once: true });\n```\n\n## features\n\n<div class=\"features grid\">\n\n `createdraggesture()`: unrestricted two dimensional pointer movement tracking\n `createpangesture()`: one axis pointer movement with direction intent recognition\n `createlongpress()`: hold recognition with slop cancellation and click swallowing\n direction locking: activates only when movement favors the configured axis\n configurable pointer capture: own the pointer by default or preserve native targeting\n configurable `activationdistance`: tune slop for touch density and component needs\n consumer owned policy: completion thresholds, snapping, and outcomes stay in application code\n stable completion: one `onend` callback for release and cancellation\n lifecycle ownership: `dispose()`, `disposed`, `disposalsignal`, optional owner `signal`, and `[symbol.dispose]()`\n\n</div>\n\n## documentation\n\n<div class=\"doc links\">\n\n [usage guide](./usage.md)\n [api reference](./api.md)\n [examples](./examples.md)\n [migration guide](./migration.md)\n\n</div>\n\n## see also\n\n<div class=\"see also\">\n\n [refine](/refine/): components that use pan recognition for carousel, drawer, toast, and list interactions.\n [dnd](/dnd/): builds touch sorting on `createdraggesture()` and adds files, previews, drop targets, keyboard reordering, and connected list transactions.\n [keymap](/keymap/): keyboard interaction primitives for complementary input paths.\n\n</div>\n\n<! markdownlint enable md025 md033 md060 >\n",
578
- "api": " \ntitle: 'gesture: api reference'\ndescription: api reference for two dimensional drag and one axis pan recognition.\n \n\n[[toc]]\n\n## api overview\n\n| symbol | purpose | execution mode | common gotcha |\n| | | | |\n| `createdraggesture()` | track unrestricted two dimensional pointer movement | sync | does not provide dom movement or drop semantics |\n| `createpangesture()` | track pointer movement projected onto one axis | sync | cross axis intent ends a pending interaction |\n| `createlongpress()` | recognize a primary pointer held in place | sync | the click that follows a fired hold is swallowed |\n| `draggesture` / `pangesture` / `longpress` | control recognition lifecycle | sync | `dispose()` does not invoke `onend` |\n| `draggestureoptions` | configure free drag recognition | sync | `activationdistance` uses euclidean distance |\n| `pangestureoptions` | configure axis locked recognition | sync | completion thresholds belong in `onend` |\n| `longpressoptions` | configure hold recognition | sync | `durationms` and `sloppx` are validated at construction |\n\n## package entry point\n\n| import | purpose |\n| | |\n| `@vielzeug/gesture` | drag and pan factories, handles, callback details, options, axes, points, and end reasons |\n\n## core functions\n\n### `createdraggesture()`\n\n```ts\nfunction createdraggesture(target: element, options?: draggestureoptions): draggesture;\n```\n\ntracks one primary pointer without restricting movement to an axis.\n\n| parameter | type | description |\n| | | |\n| `target` | `element` | element that owns pointer admission and optional capture |\n| `options` | `draggestureoptions` | activation, admission, capture, callback, and lifecycle configuration |\n\n**returns:** a lifecycle owned `draggesture` handle.\n\n**example**\n\n```ts\nimport { createdraggesture } from '@vielzeug/gesture';\n\nconst drag = createdraggesture(element, {\n onmove: ({ delta }) => {\n element.style.translate = `${delta.x}px ${delta.y}px`;\n },\n onend: () => {\n element.style.translate = '';\n },\n});\n```\n\n \n\n### `createpangesture()`\n\n```ts\nfunction createpangesture(target: element, options?: pangestureoptions): pangesture;\n```\n\ntracks one primary pointer after movement establishes intent on the configured axis.\n\n| parameter | type | description |\n| | | |\n| `target` | `element` | element that owns pointer admission and optional capture |\n| `options` | `pangestureoptions` | axis, activation, admission, capture, callback, and lifecycle configuration |\n\n**returns:** a lifecycle owned `pangesture` handle.\n\n**example**\n\n```ts\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst pan = createpangesture(element, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && math.abs(distance) >= 48) dismiss();\n },\n});\n```\n\nboth handles expose the same members:\n\n| member | type | contract |\n| | | |\n| `active` | `boolean` | `true` after activation and before release or cancellation |\n| `cancel()` | `() => boolean` | clears pending recognition or ends active recognition with `reason: 'cancel'`; returns whether a session existed |\n| `disposalsignal` | `abortsignal` | aborts when the handle is disposed |\n| `dispose()` | `() => void` | aborts `disposalsignal`, clears recognition, releases capture, and detaches listeners; idempotent |\n| `disposed` | `boolean` | `true` after disposal |\n| `[symbol.dispose]()` | `() => void` | calls `dispose()` |\n\n \n\n### `createlongpress()`\n\n```ts\nfunction createlongpress(target: element, options?: longpressoptions): longpress;\n```\n\nrecognizes a primary pointer held in place: `onlongpress` fires with the originating pointerdown once the hold outlasts `durationms`.\n\n| parameter | type | description |\n| | | |\n| `target` | `element` | element that owns pointer admission, document tracking, and click swallowing |\n| `options` | `longpressoptions` | hold time, slop distance, admission, callback, and lifecycle configuration |\n\n**returns:** a lifecycle owned `longpress` handle with the same members as the other gestures; `active` is `true` while a hold is pending.\n\n**example**\n\n```ts\nimport { createlongpress } from '@vielzeug/gesture';\n\nconst hold = createlongpress(list, {\n shouldstart: (event) => event.pointertype !== 'mouse',\n onlongpress: (detail) => {\n const tile = (detail.event.target as htmlelement).closest('.tile');\n opendetail(tile?.dataset.id);\n },\n});\n```\n\nmovement beyond `sloppx` cancels back to a normal press, and window blur or a hidden document cancels a pending hold. the click that follows a fired hold is swallowed through a capture phase listener on `target`, so releasing never commits what the hold opened; bind `target` to a stable ancestor of the pressed controls so the swallow precedes their click handlers.\n\n## types\n\n### drag types\n\n```ts\ntype dragendreason = 'cancel' | 'release';\n\ntype dragpoint = readonly<{\n x: number;\n y: number;\n}>;\n\ntype draggesturedetail = readonly<{\n current: dragpoint;\n delta: dragpoint;\n event: pointerevent;\n pointerid: number;\n pointertype: string;\n start: dragpoint;\n target: element;\n}>;\n\ntype draggestureenddetail = draggesturedetail &\n readonly<{\n reason: dragendreason;\n }>;\n\ntype draggestureoptions = readonly<{\n activationdistance?: number;\n disabled?: boolean | (() => boolean | undefined);\n onend?: (detail: draggestureenddetail) => void;\n onmove?: (detail: draggesturedetail) => void;\n onstart?: (detail: draggesturedetail) => void;\n pointercapture?: boolean;\n shouldstart?: (event: pointerevent) => boolean;\n signal?: abortsignal;\n}>;\n```\n\n`start`, `current`, and `delta` use viewport `clientx` and `clienty` coordinates. activation uses `math.hypot(delta.x, delta.y)`.\n\n### pan types\n\n```ts\ntype panaxis = 'x' | 'y';\ntype panendreason = 'cancel' | 'release';\n\ntype pangesturedetail = readonly<{\n axis: panaxis;\n current: number;\n distance: number;\n event: pointerevent;\n pointerid: number;\n pointertype: string;\n start: number;\n target: element;\n}>;\n\ntype pangestureenddetail = pangesturedetail &\n readonly<{\n reason: panendreason;\n }>;\n\ntype pangestureoptions = readonly<{\n activationdistance?: number;\n axis?: panaxis | (() => panaxis);\n disabled?: boolean | (() => boolean | undefined);\n onend?: (detail: pangestureenddetail) => void;\n onmove?: (detail: pangesturedetail) => void;\n onstart?: (detail: pangesturedetail) => void;\n pointercapture?: boolean;\n shouldstart?: (event: pointerevent) => boolean;\n signal?: abortsignal;\n}>;\n```\n\npan details project `start`, `current`, and `distance` onto `axis`. the default axis is `'x'`.\n\n### long press types\n\n```ts\ntype longpressdetail = readonly<{\n event: pointerevent;\n pointerid: number;\n pointertype: string;\n target: element;\n}>;\n\ntype longpressoptions = readonly<{\n durationms?: number;\n disabled?: boolean | (() => boolean | undefined);\n onlongpress?: (detail: longpressdetail) => void;\n shouldstart?: (event: pointerevent) => boolean;\n sloppx?: number;\n signal?: abortsignal;\n}>;\n```\n\n`durationms` defaults to `500` and `sloppx` to `8`. `event` is the pointerdown that started the hold, so `event.target` is the pressed element.\n\n### handle types\n\n```ts\ntype draggesture = {\n readonly active: boolean;\n [symbol.dispose](): void;\n cancel(): boolean;\n readonly disposalsignal: abortsignal;\n dispose(): void;\n readonly disposed: boolean;\n};\n\ntype pangesture = draggesture;\n```\n\n### shared option behavior\n\n| option | default | contract |\n| | | |\n| `activationdistance` | `6` | non negative finite css pixels; drag uses euclidean distance, pan waits for dominant axis intent |\n| `axis` | `'x'` | pan only; fixed value or getter sampled when each interaction starts |\n| `disabled` | `false` | fixed value or getter; blocks starts and cancels active recognition on the next matching pointer event |\n| `pointercapture` | `true` | best effort capture after activation; document tracking continues when capture is disabled or fails |\n| `shouldstart` | n/a | admission predicate evaluated for the primary pointer before tracking starts |\n| `signal` | n/a | disposes the handle when the external owner aborts |\n| `onstart` | n/a | runs once on the activating movement |\n| `onmove` | n/a | runs on the activating movement and each later matching movement |\n| `onend` | n/a | runs once for active release or cancellation; pending interactions end without callbacks |\n\noptions and callback details are readonly. fixed callbacks and capture policy are snapshotted at construction. function valued `axis` and `disabled` options remain dynamic.\n\ngesture tracks accepted movement with capture phase listeners on the target's current owner document. window blur, hidden document transition, `pointercancel`, and `lostpointercapture` cancel active recognition.\n\n## errors\n\n| error | trigger | notable properties |\n| | | |\n| `gestureerror` | base class for every gesture originated error | `instanceof gestureerror` catches any gesture error |\n| `gestureconfigerror` | invalid option value | extends `gestureerror` |\n\n invalid `activationdistance` values throw `gestureconfigerror` during construction.\n invalid fixed `axis` values throw `gestureconfigerror` during construction.\n invalid values returned by a dynamic `axis` getter throw `gestureconfigerror` when a pointer interaction starts.\n",
579
- "usage": " \ntitle: 'gesture: usage guide'\ndescription: track unrestricted pointer dragging and axis locked pans with application owned rendering and completion.\n \n\n[[toc]]\n\n## basic usage\n\ncreate one handle for the element that owns the interaction. this example creates its surface, applies the required touch policy, and disposes the handle when the page unloads.\n\n```ts\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst row = document.body.appendchild(document.createelement('div'));\nrow.textcontent = 'swipe to archive';\nrow.style.touchaction = 'pan y';\n\nconst pan = createpangesture(row, {\n axis: 'x',\n onmove: ({ distance }) => {\n row.style.transform = `translatex(${distance}px)`;\n },\n onend: ({ distance, reason }) => {\n row.style.transform = '';\n if (reason === 'release' && math.abs(distance) >= 64) {\n pan.dispose();\n row.remove();\n }\n },\n});\n\nwindow.addeventlistener('pagehide', () => pan.dispose(), { once: true });\n```\n\n## track two dimensional dragging\n\nuse `createdraggesture()` when movement must remain unrestricted in both dimensions:\n\n```ts\nimport { createdraggesture } from '@vielzeug/gesture';\n\nconst card = document.queryselector<htmlelement>('[data draggable]');\nif (!card) throw new error('missing [data draggable] element');\n\nconst drag = createdraggesture(card, {\n activationdistance: 6,\n onmove: ({ delta }) => {\n card.style.translate = `${delta.x}px ${delta.y}px`;\n },\n onend: () => {\n card.style.translate = '';\n },\n});\n\nwindow.addeventlistener('pagehide', () => drag.dispose(), { once: true });\n```\n\n`start`, `current`, and `delta` are readonly `{ x, y }` points. set `touch action: none` when the surface owns movement in both dimensions. drag recognition does not provide previews, drop targets, dom movement, or `datatransfer`; use dnd for those semantics.\n\n## recognize long presses\n\nuse `createlongpress()` for hold interactions: the touch counterpart of a keyboard preview key. `onlongpress` receives the originating pointerdown once the hold outlasts `durationms`:\n\n```ts\nimport { createlongpress } from '@vielzeug/gesture';\n\nconst hold = createlongpress(grid, {\n durationms: 500,\n shouldstart: (event) =>\n event.pointertype !== 'mouse' &&\n (event.target as htmlelement).closest('.tile') !== null,\n onlongpress: (detail) => {\n const tile = (detail.event.target as htmlelement).closest<htmlelement>('.tile');\n openpreview(tile?.dataset.id);\n },\n});\n```\n\nmovement beyond `sloppx` cancels back to a normal press, so scrolling never triggers the hold. the click that follows a fired hold is swallowed through a capture phase listener on `target`: bind `target` to a stable ancestor of the pressed controls so the swallow precedes their click handlers, and gate `shouldstart` to the elements the hold belongs to.\n\n## completion rules\n\ngesture reports movement and terminal state but does not decide what constitutes a swipe. apply thresholds and allowed directions in `onend`.\n\n```ts\nconst pan = createpangesture(panel, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && distance <= 80) {\n opennext();\n } else {\n resetpanel();\n }\n },\n});\n```\n\n## direction recognition\n\nthe gesture remains pending during small movement. it activates only after movement favors the configured axis. cross axis movement ends the pending interaction without invoking callbacks.\n\nthe default `activationdistance` is 6 pixels. tune direction recognition slop for touch density or component specific needs:\n\n```ts\nconst pan = createpangesture(row, {\n axis: 'x',\n activationdistance: 12,\n onmove,\n onend,\n});\n```\n\nset `activationdistance: 0` when the first pointer move with non zero displacement should activate immediately. zero motion events remain pending.\n\nuse the corresponding `touch action` value so the browser retains native scrolling on the other axis.\n\n```css\n.swipe row {\n touch action: pan y;\n}\n```\n\n```ts\nconst pan = createpangesture(row, { axis: 'x', onmove });\n```\n\n## pointer capture\n\npointer capture is enabled by default. after axis intent is accepted, gesture attempts to capture the pointer while continuing to track movement through document level listeners. capture failure (for example after target detachment or pointer termination) falls back to document tracking without stranding the session.\n\ndisable capture when nested or newly revealed controls must retain native pointer up and click targeting:\n\n```ts\nconst pan = createpangesture(row, {\n axis: 'x',\n pointercapture: false,\n onmove: renderreveal,\n onend: settlereveal,\n});\n```\n\ndocument level tracking still keeps the pan active outside the target. disabling capture changes event targeting, not gesture tracking.\n\n## interactive descendants\n\nuse `shouldstart` when buttons, links, or form controls inside the surface must not start a pan.\n\n```ts\nconst pan = createpangesture(notification, {\n axis: 'x',\n pointercapture: false,\n shouldstart: (event) =>\n !event\n .composedpath()\n .some((node) => node instanceof element && node.matches('button, a, input, select, textarea')),\n onmove,\n onend,\n});\n```\n\n`shouldstart` protects controls under the initial pointer. `pointercapture: false` additionally protects controls that appear beneath the pointer during a reveal interaction.\n\n## disabled state\n\na boolean disables the recognizer permanently. a getter supports state that changes while the handle is alive.\n\n```ts\nconst pan = createpangesture(row, {\n disabled: () => islocked,\n onend: ({ reason }) => {\n if (reason === 'cancel') resetrow();\n },\n});\n```\n\nwhen the getter becomes `true`, the next pointer event cancels an active pan. window blur or a hidden owner document also cancels active tracking so a lost release cannot block later gestures.\n\ngesture snapshots fixed callbacks and capture policy at construction. use the `axis` and `disabled` functions for behavior that must remain dynamic instead of mutating the options object.\n\n## lifecycle\n\ndispose the target bound handle when its owning ui scope unmounts.\n\n```ts\nconst element = document.queryselector<htmlelement>('[data pan]');\nif (!element) throw new error('missing [data pan] element');\n\nconst owner = new abortcontroller();\nconst request = new abortcontroller();\nconst pan = createpangesture(element, {\n axis: 'x',\n signal: owner.signal,\n});\n\nconst childsignal = abortsignal.any([pan.disposalsignal, request.signal]);\nwindow.addeventlistener('pagehide', () => owner.abort(), { once: true });\n```\n\npass `{ signal }` to dispose with an existing owner signal. `disposalsignal` always aborts when gesture finishes teardown, so child work can compose with the handle regardless of how disposal starts.\n\nuse `cancel()` to stop a pending or active interaction without disposing the handle. an active interaction emits `onend` with `reason: 'cancel'`. call `cancel()` before `dispose()` when a connected surface needs its `onend` reset path; disposal itself does not invoke callbacks.\n\n## framework integration\n\ncreate the handle after the target element exists and dispose it on unmount.\n\n::: code group\n\n```tsx [react]\nimport { useeffect, useref } from 'react';\nimport { createpangesture } from '@vielzeug/gesture';\n\nfunction swiperow({ ondismiss }: { ondismiss: () => void }) {\n const rowref = useref<htmldivelement>(null);\n\n useeffect(() => {\n const row = rowref.current;\n if (!row) return;\n\n const pan = createpangesture(row, {\n axis: 'x',\n onmove: ({ distance }) => {\n row.style.transform = `translatex(${distance}px)`;\n },\n onend: ({ distance, reason }) => {\n row.style.transform = '';\n if (reason === 'release' && math.abs(distance) >= 64) ondismiss();\n },\n });\n\n return () => pan.dispose();\n }, [ondismiss]);\n\n return <div ref={rowref}>swipe me</div>;\n}\n```\n\n```vue [vue 3]\n<script setup lang=\"ts\">\nimport { onmounted, onunmounted, ref } from 'vue';\nimport { createpangesture, type pangesture } from '@vielzeug/gesture';\n\nconst emit = defineemits<{ dismiss: [] }>();\nconst rowel = ref<htmldivelement | null>(null);\nlet pan: pangesture | undefined;\n\nonmounted(() => {\n const row = rowel.value;\n if (!row) return;\n\n pan = createpangesture(row, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && math.abs(distance) >= 64) emit('dismiss');\n },\n });\n});\n\nonunmounted(() => pan?.dispose());\n</script>\n\n<template>\n <div ref=\"rowel\">swipe me</div>\n</template>\n```\n\n```svelte [svelte]\n<script lang=\"ts\">\n import { onmount } from 'svelte';\n import { createpangesture } from '@vielzeug/gesture';\n\n let { ondismiss = () => {} }: { ondismiss: () => void } = $props();\n let rowel: htmldivelement;\n\n onmount(() => {\n const pan = createpangesture(rowel, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && math.abs(distance) >= 64) ondismiss();\n },\n });\n\n return () => pan.dispose();\n });\n</script>\n\n<div bind:this={rowel}>swipe me</div>\n```\n\n:::\n\n## working with other vielzeug libraries\n\n### gesture + refine\n\nrefine uses gesture internally for carousel, drawer, toast, and list item pointer interactions. custom surfaces can use the same pan lifecycle while keeping visual state local.\n\n```ts\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst pan = createpangesture(panel, {\n axis: 'x',\n onmove: ({ distance }) => {\n panel.style.transform = `translatex(${distance}px)`;\n },\n onend: ({ distance, reason }) => {\n panel.style.transform = '';\n if (reason === 'release' && math.abs(distance) >= 80) revealactions();\n },\n});\n```\n\n### gesture + dnd\n\ngesture owns pointer recognition: unrestricted two dimensional drag and one axis pan. dnd builds touch sorting on `createdraggesture()`, then owns `datatransfer`, previews, hit testing, file drop zones, keyboard sorting, dom reordering, and connected list transactions. use dnd when an item is picked up and dropped; use gesture directly when application code owns rendering and completion.\n\n## best practices\n\n **set** `touch action` for the axis the browser should continue scrolling.\n **use** `shouldstart` to exclude nested interactive controls.\n **disable** pointer capture when nested or newly revealed controls must keep native release targeting.\n **apply** completion thresholds and direction rules in `onend`; use `activationdistance` only for recognition slop.\n **treat** `reason: 'cancel'` as a reset path, never a commit path.\n **keep** `onmove` rendering lightweight.\n **dispose** the handle when its target leaves the ui.\n",
578
+ "api": " \ntitle: 'gesture: api reference'\ndescription: api reference for two dimensional drag and one axis pan recognition.\n \n\n[[toc]]\n\n## api overview\n\n| symbol | purpose | execution mode | common gotcha |\n| | | | |\n| `createdraggesture()` | track unrestricted two dimensional pointer movement | sync | does not provide dom movement or drop semantics |\n| `createpangesture()` | track pointer movement projected onto one axis | sync | cross axis intent ends a pending interaction |\n| `createlongpress()` | recognize a primary pointer held in place | sync | the click that follows a fired hold is swallowed |\n| `draggesture` / `pangesture` / `longpress` | control recognition lifecycle | sync | `dispose()` does not invoke `onend` |\n| `draggestureoptions` | configure free drag recognition | sync | `activationdistance` uses euclidean distance |\n| `pangestureoptions` | configure axis locked recognition | sync | completion thresholds belong in `onend` |\n| `longpressoptions` | configure hold recognition | sync | `durationms` and `sloppx` are validated at construction |\n\n## package entry point\n\n| import | purpose |\n| | |\n| `@vielzeug/gesture` | drag and pan factories, handles, callback details, options, axes, points, and end reasons |\n\n## core functions\n\n### `createdraggesture()`\n\n```ts\nfunction createdraggesture(target: element, options?: draggestureoptions): draggesture;\n```\n\ntracks one primary pointer without restricting movement to an axis.\n\n| parameter | type | description |\n| | | |\n| `target` | `element` | element that owns pointer admission and optional capture |\n| `options` | `draggestureoptions` | activation, admission, capture, callback, and lifecycle configuration |\n\n**returns:** a lifecycle owned `draggesture` handle.\n\n**example**\n\n```ts\nimport { createdraggesture } from '@vielzeug/gesture';\n\nconst drag = createdraggesture(element, {\n onmove: ({ delta }) => {\n element.style.translate = `${delta.x}px ${delta.y}px`;\n },\n onend: () => {\n element.style.translate = '';\n },\n});\n```\n\n \n\n### `createpangesture()`\n\n```ts\nfunction createpangesture(target: element, options?: pangestureoptions): pangesture;\n```\n\ntracks one primary pointer after movement establishes intent on the configured axis.\n\n| parameter | type | description |\n| | | |\n| `target` | `element` | element that owns pointer admission and optional capture |\n| `options` | `pangestureoptions` | axis, activation, admission, capture, callback, and lifecycle configuration |\n\n**returns:** a lifecycle owned `pangesture` handle.\n\n**example**\n\n```ts\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst pan = createpangesture(element, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && math.abs(distance) >= 48) dismiss();\n },\n});\n```\n\nboth handles expose the same members:\n\n| member | type | contract |\n| | | |\n| `active` | `boolean` | `true` after activation and before release or cancellation |\n| `cancel()` | `() => boolean` | clears pending recognition or ends active recognition with `reason: 'cancel'`; returns whether a session existed |\n| `disposalsignal` | `abortsignal` | aborts when the handle is disposed |\n| `dispose()` | `() => void` | aborts `disposalsignal`, clears recognition, releases capture, and detaches listeners; idempotent |\n| `disposed` | `boolean` | `true` after disposal |\n| `[symbol.dispose]()` | `() => void` | calls `dispose()` |\n\n \n\n### `createlongpress()`\n\n```ts\nfunction createlongpress(target: element, options?: longpressoptions): longpress;\n```\n\nrecognizes a primary pointer held in place: `onlongpress` fires with the originating pointerdown once the hold outlasts `durationms`.\n\n| parameter | type | description |\n| | | |\n| `target` | `element` | element that owns pointer admission, document tracking, and click swallowing |\n| `options` | `longpressoptions` | hold time, slop distance, admission, callback, and lifecycle configuration |\n\n**returns:** a lifecycle owned `longpress` handle with the same members as the other gestures; `active` is `true` while a hold is pending.\n\n**example**\n\n```ts\nimport { createlongpress } from '@vielzeug/gesture';\n\nconst hold = createlongpress(list, {\n shouldstart: (event) => event.pointertype !== 'mouse',\n onlongpress: (detail) => {\n const tile = (detail.event.target as htmlelement).closest('.tile');\n opendetail(tile?.dataset.id);\n },\n});\n```\n\nmovement beyond `sloppx` cancels back to a normal press, and window blur or a hidden document cancels a pending hold. the click that follows a fired hold is swallowed through a capture phase listener on `target`, so releasing never commits what the hold opened; bind `target` to a stable ancestor of the pressed controls so the swallow precedes their click handlers.\n\n## types\n\n### drag types\n\n```ts\ntype dragendreason = 'cancel' | 'release';\n\ntype dragpoint = readonly<{\n x: number;\n y: number;\n}>;\n\ntype draggesturedetail = readonly<{\n current: dragpoint;\n delta: dragpoint;\n event: pointerevent;\n pointerid: number;\n pointertype: string;\n start: dragpoint;\n target: element;\n}>;\n\ntype draggestureenddetail = draggesturedetail &\n readonly<{\n reason: dragendreason;\n }>;\n\ntype draggestureoptions = readonly<{\n activationdistance?: number;\n disabled?: boolean | (() => boolean | undefined);\n onend?: (detail: draggestureenddetail) => void;\n onmove?: (detail: draggesturedetail) => void;\n onstart?: (detail: draggesturedetail) => void;\n pointercapture?: boolean;\n shouldstart?: (event: pointerevent) => boolean;\n signal?: abortsignal;\n}>;\n```\n\n`start`, `current`, and `delta` use viewport `clientx` and `clienty` coordinates. activation uses `math.hypot(delta.x, delta.y)`.\n\n### pan types\n\n```ts\ntype panaxis = 'x' | 'y';\ntype panendreason = 'cancel' | 'release';\n\ntype pangesturedetail = readonly<{\n axis: panaxis;\n current: number;\n distance: number;\n event: pointerevent;\n pointerid: number;\n pointertype: string;\n start: number;\n target: element;\n}>;\n\ntype pangestureenddetail = pangesturedetail &\n readonly<{\n reason: panendreason;\n }>;\n\ntype pangestureoptions = readonly<{\n activationdistance?: number;\n axis?: panaxis | (() => panaxis);\n disabled?: boolean | (() => boolean | undefined);\n onend?: (detail: pangestureenddetail) => void;\n onmove?: (detail: pangesturedetail) => void;\n onstart?: (detail: pangesturedetail) => void;\n pointercapture?: boolean;\n shouldstart?: (event: pointerevent) => boolean;\n signal?: abortsignal;\n}>;\n```\n\npan details project `start`, `current`, and `distance` onto `axis`. the default axis is `'x'`.\n\n### long press types\n\n```ts\ntype longpressdetail = readonly<{\n event: pointerevent;\n pointerid: number;\n pointertype: string;\n target: element;\n}>;\n\ntype longpressoptions = readonly<{\n durationms?: number;\n disabled?: boolean | (() => boolean | undefined);\n onlongpress?: (detail: longpressdetail) => void;\n shouldstart?: (event: pointerevent) => boolean;\n sloppx?: number;\n signal?: abortsignal;\n}>;\n```\n\n`durationms` defaults to `500` and `sloppx` to `8`. `event` is the pointerdown that started the hold, so `event.target` is the pressed element.\n\n### handle types\n\n```ts\ntype draggesture = {\n readonly active: boolean;\n [symbol.dispose](): void;\n cancel(): boolean;\n readonly disposalsignal: abortsignal;\n dispose(): void;\n readonly disposed: boolean;\n};\n\ntype pangesture = draggesture;\n```\n\n### shared option behavior\n\n| option | default | contract |\n| | | |\n| `activationdistance` | `6` | non negative finite css pixels; drag uses euclidean distance, pan waits for dominant axis intent |\n| `axis` | `'x'` | pan only; fixed value or getter sampled when each interaction starts |\n| `disabled` | `false` | fixed value or getter; blocks starts and cancels active recognition on the next matching pointer event |\n| `pointercapture` | `true` | best effort capture after activation; document tracking continues when capture is disabled or fails |\n| `shouldstart` | n/a | admission predicate evaluated for the primary pointer before tracking starts |\n| `signal` | n/a | disposes the handle when the external owner aborts |\n| `onstart` | n/a | runs once on the activating movement |\n| `onmove` | n/a | runs on the activating movement and each later matching movement |\n| `onend` | n/a | runs once for active release or cancellation; pending interactions end without callbacks |\n\noptions and callback details are readonly. fixed callbacks and capture policy are snapshotted at construction. function valued `axis` and `disabled` options remain dynamic.\n\ngesture tracks accepted movement with capture phase listeners on the target's current owner document. window blur, hidden document transition, `pointercancel`, and pointer capture loss on the gesture target cancel active recognition. a `lostpointercapture` event bubbling from a descendant does not cancel the target's gesture.\n\n## errors\n\n| error | trigger | notable properties |\n| | | |\n| `gestureerror` | base class for every gesture originated error | `instanceof gestureerror` catches any gesture error |\n| `gestureconfigerror` | invalid option value | extends `gestureerror` |\n\n invalid `activationdistance` values throw `gestureconfigerror` during construction.\n invalid fixed `axis` values throw `gestureconfigerror` during construction.\n invalid values returned by a dynamic `axis` getter throw `gestureconfigerror` when a pointer interaction starts.\n",
579
+ "usage": " \ntitle: 'gesture: usage guide'\ndescription: track unrestricted pointer dragging and axis locked pans with application owned rendering and completion.\n \n\n[[toc]]\n\n## basic usage\n\ncreate one handle for the element that owns the interaction. this example creates its surface, applies the required touch policy, and disposes the handle when the page unloads.\n\n```ts\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst row = document.body.appendchild(document.createelement('div'));\nrow.textcontent = 'swipe to archive';\nrow.style.touchaction = 'pan y';\n\nconst pan = createpangesture(row, {\n axis: 'x',\n onmove: ({ distance }) => {\n row.style.transform = `translatex(${distance}px)`;\n },\n onend: ({ distance, reason }) => {\n row.style.transform = '';\n if (reason === 'release' && math.abs(distance) >= 64) {\n pan.dispose();\n row.remove();\n }\n },\n});\n\nwindow.addeventlistener('pagehide', () => pan.dispose(), { once: true });\n```\n\n## track two dimensional dragging\n\nuse `createdraggesture()` when movement must remain unrestricted in both dimensions:\n\n```ts\nimport { createdraggesture } from '@vielzeug/gesture';\n\nconst card = document.queryselector<htmlelement>('[data draggable]');\nif (!card) throw new error('missing [data draggable] element');\n\nconst drag = createdraggesture(card, {\n activationdistance: 6,\n onmove: ({ delta }) => {\n card.style.translate = `${delta.x}px ${delta.y}px`;\n },\n onend: () => {\n card.style.translate = '';\n },\n});\n\nwindow.addeventlistener('pagehide', () => drag.dispose(), { once: true });\n```\n\n`start`, `current`, and `delta` are readonly `{ x, y }` points. set `touch action: none` when the surface owns movement in both dimensions. drag recognition does not provide previews, drop targets, dom movement, or `datatransfer`; use dnd for those semantics.\n\n## recognize long presses\n\nuse `createlongpress()` for hold interactions: the touch counterpart of a keyboard preview key. `onlongpress` receives the originating pointerdown once the hold outlasts `durationms`:\n\n```ts\nimport { createlongpress } from '@vielzeug/gesture';\n\nconst hold = createlongpress(grid, {\n durationms: 500,\n shouldstart: (event) =>\n event.pointertype !== 'mouse' &&\n (event.target as htmlelement).closest('.tile') !== null,\n onlongpress: (detail) => {\n const tile = (detail.event.target as htmlelement).closest<htmlelement>('.tile');\n openpreview(tile?.dataset.id);\n },\n});\n```\n\nmovement beyond `sloppx` cancels back to a normal press, so scrolling never triggers the hold. the click that follows a fired hold is swallowed through a capture phase listener on `target`: bind `target` to a stable ancestor of the pressed controls so the swallow precedes their click handlers, and gate `shouldstart` to the elements the hold belongs to.\n\n## completion rules\n\ngesture reports movement and terminal state but does not decide what constitutes a swipe. apply thresholds and allowed directions in `onend`.\n\n```ts\nconst pan = createpangesture(panel, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && distance <= 80) {\n opennext();\n } else {\n resetpanel();\n }\n },\n});\n```\n\n## direction recognition\n\nthe gesture remains pending during small movement. it activates only after movement favors the configured axis. cross axis movement ends the pending interaction without invoking callbacks.\n\nthe default `activationdistance` is 6 pixels. tune direction recognition slop for touch density or component specific needs:\n\n```ts\nconst pan = createpangesture(row, {\n axis: 'x',\n activationdistance: 12,\n onmove,\n onend,\n});\n```\n\nset `activationdistance: 0` when the first pointer move with non zero displacement should activate immediately. zero motion events remain pending.\n\nuse the corresponding `touch action` value so the browser retains native scrolling on the other axis.\n\n```css\n.swipe row {\n touch action: pan y;\n}\n```\n\n```ts\nconst pan = createpangesture(row, { axis: 'x', onmove });\n```\n\n## pointer capture\n\npointer capture is enabled by default. after axis intent is accepted, gesture attempts to capture the pointer while continuing to track movement through document level listeners. capture failure (for example after target detachment or pointer termination) falls back to document tracking without stranding the session.\n\ndisable capture when nested or newly revealed controls must retain native pointer up and click targeting:\n\n```ts\nconst pan = createpangesture(row, {\n axis: 'x',\n pointercapture: false,\n onmove: renderreveal,\n onend: settlereveal,\n});\n```\n\ndocument level tracking still keeps the pan active outside the target. disabling capture changes event targeting, not gesture tracking.\n\n## interactive descendants\n\nuse `shouldstart` when buttons, links, or form controls inside the surface must not start a pan.\n\n```ts\nconst pan = createpangesture(notification, {\n axis: 'x',\n pointercapture: false,\n shouldstart: (event) =>\n !event\n .composedpath()\n .some((node) => node instanceof element && node.matches('button, a, input, select, textarea')),\n onmove,\n onend,\n});\n```\n\n`shouldstart` protects controls under the initial pointer. `pointercapture: false` additionally protects controls that appear beneath the pointer during a reveal interaction.\n\n## disabled state\n\na boolean disables the recognizer permanently. a getter supports state that changes while the handle is alive.\n\n```ts\nconst pan = createpangesture(row, {\n disabled: () => islocked,\n onend: ({ reason }) => {\n if (reason === 'cancel') resetrow();\n },\n});\n```\n\nwhen the getter becomes `true`, the next pointer event cancels an active pan. window blur or a hidden owner document also cancels active tracking so a lost release cannot block later gestures.\n\ngesture snapshots fixed callbacks and capture policy at construction. use the `axis` and `disabled` functions for behavior that must remain dynamic instead of mutating the options object.\n\n## lifecycle\n\ndispose the target bound handle when its owning ui scope unmounts.\n\n```ts\nconst element = document.queryselector<htmlelement>('[data pan]');\nif (!element) throw new error('missing [data pan] element');\n\nconst owner = new abortcontroller();\nconst request = new abortcontroller();\nconst pan = createpangesture(element, {\n axis: 'x',\n signal: owner.signal,\n});\n\nconst childsignal = abortsignal.any([pan.disposalsignal, request.signal]);\nwindow.addeventlistener('pagehide', () => owner.abort(), { once: true });\n```\n\npass `{ signal }` to dispose with an existing owner signal. `disposalsignal` always aborts when gesture finishes teardown, so child work can compose with the handle regardless of how disposal starts.\n\nuse `cancel()` to stop a pending or active interaction without disposing the handle. an active interaction emits `onend` with `reason: 'cancel'`. call `cancel()` before `dispose()` when a connected surface needs its `onend` reset path; disposal itself does not invoke callbacks.\n\n## framework integration\n\ncreate the handle after the target element exists and dispose it on unmount.\n\n::: code group\n\n```tsx [react]\nimport { useeffect, useref } from 'react';\nimport { createpangesture } from '@vielzeug/gesture';\n\nfunction swiperow({ ondismiss }: { ondismiss: () => void }) {\n const rowref = useref<htmldivelement>(null);\n\n useeffect(() => {\n const row = rowref.current;\n if (!row) return;\n\n const pan = createpangesture(row, {\n axis: 'x',\n onmove: ({ distance }) => {\n row.style.transform = `translatex(${distance}px)`;\n },\n onend: ({ distance, reason }) => {\n row.style.transform = '';\n if (reason === 'release' && math.abs(distance) >= 64) ondismiss();\n },\n });\n\n return () => pan.dispose();\n }, [ondismiss]);\n\n return <div ref={rowref}>swipe me</div>;\n}\n```\n\n```vue [vue 3]\n<script setup lang=\"ts\">\nimport { onmounted, onunmounted, ref } from 'vue';\nimport { createpangesture, type pangesture } from '@vielzeug/gesture';\n\nconst emit = defineemits<{ dismiss: [] }>();\nconst rowel = ref<htmldivelement | null>(null);\nlet pan: pangesture | undefined;\n\nonmounted(() => {\n const row = rowel.value;\n if (!row) return;\n\n pan = createpangesture(row, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && math.abs(distance) >= 64) emit('dismiss');\n },\n });\n});\n\nonunmounted(() => pan?.dispose());\n</script>\n\n<template>\n <div ref=\"rowel\">swipe me</div>\n</template>\n```\n\n```svelte [svelte]\n<script lang=\"ts\">\n import { onmount } from 'svelte';\n import { createpangesture } from '@vielzeug/gesture';\n\n let { ondismiss = () => {} }: { ondismiss: () => void } = $props();\n let rowel: htmldivelement;\n\n onmount(() => {\n const pan = createpangesture(rowel, {\n axis: 'x',\n onend: ({ distance, reason }) => {\n if (reason === 'release' && math.abs(distance) >= 64) ondismiss();\n },\n });\n\n return () => pan.dispose();\n });\n</script>\n\n<div bind:this={rowel}>swipe me</div>\n```\n\n:::\n\n## working with other vielzeug libraries\n\n### gesture + refine\n\nrefine uses gesture internally for carousel, drawer, toast, and list item pointer interactions. custom surfaces can use the same pan lifecycle while keeping visual state local.\n\n```ts\nimport { createpangesture } from '@vielzeug/gesture';\n\nconst pan = createpangesture(panel, {\n axis: 'x',\n onmove: ({ distance }) => {\n panel.style.transform = `translatex(${distance}px)`;\n },\n onend: ({ distance, reason }) => {\n panel.style.transform = '';\n if (reason === 'release' && math.abs(distance) >= 80) revealactions();\n },\n});\n```\n\n### gesture + dnd\n\ngesture owns pointer recognition: unrestricted two dimensional drag and one axis pan. dnd builds touch sorting on `createdraggesture()`, then owns `datatransfer`, previews, hit testing, file drop zones, keyboard sorting, dom reordering, and connected list transactions. use dnd when an item is picked up and dropped; use gesture directly when application code owns rendering and completion.\n\n## best practices\n\n **set** `touch action` for the axis the browser should continue scrolling.\n **use** `shouldstart` to exclude nested interactive controls.\n **disable** pointer capture when nested or newly revealed controls must keep native release targeting.\n **apply** completion thresholds and direction rules in `onend`; use `activationdistance` only for recognition slop.\n **treat** `reason: 'cancel'` as a reset path, never a commit path. pointer capture loss on the gesture target cancels; capture loss bubbling from a descendant does not.\n **keep** `onmove` rendering lightweight.\n **dispose** the handle when its target leaves the ui.\n",
580
580
  "examples": " \ntitle: 'gesture: examples'\ndescription: worked examples for @vielzeug/gesture.\n \n\n## examples\n\n [carousel pan navigation](./examples/carousel swipe navigation.md)\n [swipe to dismiss notifications](./examples/swipe dismiss notifications.md)\n"
581
581
  },
582
582
  "examples": [
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from 'node:fs';
2
+ import { readFileSync, realpathSync } from 'node:fs';
3
3
  import { dirname, resolve } from 'node:path';
4
4
  import { fileURLToPath, pathToFileURL } from 'node:url';
5
5
  import { parseArgs } from 'node:util';
@@ -107,7 +107,7 @@ export async function main(argv = process.argv.slice(2)) {
107
107
  return 1;
108
108
  }
109
109
  }
110
- if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
110
+ if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
111
111
  process.exitCode = await main();
112
112
  }
113
113
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,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C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACvG,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACvB,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAElC,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAExE,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7F,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC;AAClC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vielzeug/codex",
3
- "version": "26.10.11",
3
+ "version": "26.10.13",
4
4
  "description": "MCP server exposing all Vielzeug docs to AI clients",
5
5
  "repository": {
6
6
  "type": "git",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/node": "^26.6.2",
65
- "@vielzeug/refine": "26.10.11",
65
+ "@vielzeug/refine": "26.10.13",
66
66
  "typescript": "^6.0.3",
67
67
  "vitest": "^5.0.1"
68
68
  }