(axis-velocity {:keys [pos lo hi max-speed]})Auto-scroll speed in pixels per second along one axis.
pos is the pointer coordinate and lo/hi the container's edges on that
axis. Negative scrolls toward lo, positive toward hi, zero between the two
bands. Called once per axis because the vertical and horizontal scrollers are
resolved independently — a board scrolls sideways while its columns scroll
down, and a drag into a corner needs both.
Auto-scroll speed in pixels per second along one axis. `pos` is the pointer coordinate and `lo`/`hi` the container's edges on that axis. Negative scrolls toward `lo`, positive toward `hi`, zero between the two bands. Called once per axis because the vertical and horizontal scrollers are resolved independently — a board scrolls sideways while its columns scroll down, and a drag into a corner needs both.
(drag-cancel-detail kind value reason)Build the x-drag-panel-drag-cancel CustomEvent detail.
Build the x-drag-panel-drag-cancel CustomEvent detail.
(drag-delta {:keys [start-x start-y] :as drag})Translation to apply to the lifted surface, relative to where it started.
Translation to apply to the lifted surface, relative to where it started.
(drag-position {:keys [pointer-x pointer-y offset-x offset-y]})Panel top-left for a pointer at {:pointer-x :pointer-y}, given the grab
offset captured at pointerdown. Returns {:x :y} in viewport coordinates.
The lifted position is never stored — it is derived from the drag value, so there is exactly one answer to "where is the panel" at any moment.
Panel top-left for a pointer at `{:pointer-x :pointer-y}`, given the grab
offset captured at pointerdown. Returns `{:x :y}` in viewport coordinates.
The lifted position is never stored — it is derived from the drag value, so
there is exactly one answer to "where is the panel" at any moment.(drag-start-detail kind value)Build the x-drag-panel-drag-start CustomEvent detail.
Build the x-drag-panel-drag-start CustomEvent detail.
(edge-band dimension)Width of the auto-scroll trigger band for a container dimension.
Width of the auto-scroll trigger band for a container dimension.
(long-press-required? {:keys [pointer-type grab]})True when a press must be held before it arms a drag.
Only touch pointers in surface grab mode: the grab area is the whole panel, so
arming immediately would need touch-action: none across it and the user could
no longer scroll the board by swiping over a card. Mouse and pen have no such
conflict, and handle mode targets a small deliberate strip.
True when a press must be held before it arms a drag. Only touch pointers in surface grab mode: the grab area is the whole panel, so arming immediately would need `touch-action: none` across it and the user could no longer scroll the board by swiping over a card. Mouse and pen have no such conflict, and handle mode targets a small deliberate strip.
(normalize {:keys [kind-raw value-raw label-raw grab-raw auto-scroll-raw
disabled-present? pending-present?]})Normalise raw attribute inputs into a stable view-model map.
Input keys: :kind-raw string | nil :value-raw string | nil :label-raw string | nil :grab-raw string | nil :auto-scroll-raw string | nil :disabled-present? boolean :pending-present? boolean
Output keys: :kind string :value string :label string :grab string (grab-handle | grab-surface) :auto-scroll string (auto-scroll-auto | auto-scroll-none) :disabled? boolean :pending? boolean :draggable? boolean
Normalise raw attribute inputs into a stable view-model map. Input keys: :kind-raw string | nil :value-raw string | nil :label-raw string | nil :grab-raw string | nil :auto-scroll-raw string | nil :disabled-present? boolean :pending-present? boolean Output keys: :kind string :value string :label string :grab string (grab-handle | grab-surface) :auto-scroll string (auto-scroll-auto | auto-scroll-none) :disabled? boolean :pending? boolean :draggable? boolean
(normalize-auto-scroll raw)Normalize the raw auto-scroll attribute to auto-scroll-none or
auto-scroll-auto. Unrecognised values fall back to auto-scroll-auto,
because a board deeper than the viewport is close to unusable without it.
Normalize the raw auto-scroll attribute to `auto-scroll-none` or `auto-scroll-auto`. Unrecognised values fall back to `auto-scroll-auto`, because a board deeper than the viewport is close to unusable without it.
(normalize-grab raw)Normalize the raw grab attribute to grab-surface or grab-handle.
Anything unrecognised falls back to grab-handle deliberately: handle mode is
the conservative choice, since surface mode swallows presses on interactive
content inside the panel body.
Normalize the raw grab attribute to `grab-surface` or `grab-handle`. Anything unrecognised falls back to `grab-handle` deliberately: handle mode is the conservative choice, since surface mode swallows presses on interactive content inside the panel body.
(normalize-label raw)Normalize the raw label attribute. Falls back to default-label.
Normalize the raw label attribute. Falls back to default-label.
(normalize-text raw)Normalize a raw free-text attribute (kind, value) to a string.
Absent and blank collapse to the empty string so downstream comparisons never
have to distinguish nil from "".
Normalize a raw free-text attribute (`kind`, `value`) to a string. Absent and blank collapse to the empty string so downstream comparisons never have to distinguish nil from "".
(scroll-delta velocity dt-ms)Pixels to scroll this frame for velocity px/sec over dt-ms milliseconds.
Frame-delta driven rather than per-frame constant, so the result does not double on a 120Hz display.
Pixels to scroll this frame for `velocity` px/sec over `dt-ms` milliseconds. Frame-delta driven rather than per-frame constant, so the result does not double on a 120Hz display.
(travelled? {:keys [start-x start-y pointer-x pointer-y slop]})True when a pointer has moved beyond slop pixels from its press origin.
Used to cancel a pending long-press: travel before the timer fires is a scroll gesture, not a drag.
True when a pointer has moved beyond `slop` pixels from its press origin. Used to cancel a pending long-press: travel before the timer fires is a scroll gesture, not a drag.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |