Primitives / DOM
foldkit-primitives/dom
Element Mounts that act while attached, and one-shot Commands that run once and report back. Nothing here owns lasting state: a Mount reads and writes the DOM for its element, a Command's result comes back as a Message your union wraps. (source)
| Name | Form | Reports or yields | Args |
|---|---|---|---|
copyText(text) | Command | Copied, CopyFailed | |
readText() | Command | Read { text }, ReadFailed | |
share(data) | Command | Shared, Dismissed, ShareFailed | { title?, text?, url? } |
loadScript(src) | Command | Loaded, LoadFailed | |
Autofocus() | Mount | Focused | |
InputMask({ pattern }) | Mount | Input { value, raw } | #, A, * placeholders |
KeepInView({ selector }) | Mount | nothing | |
Measure({ targets }) | Mount | nothing; writes custom properties | |
FluidHover({ name, item, axis, gapClick, gapReach?, follows?, from? }) | Mount | nothing; writes custom properties | axis: x, y, xy |
FocusScope(options) | Mount | nothing | { contain?, restore?, initialFocus? } |
FollowTabStop | Mount | nothing | |
ScrollLock, HideOutside | Mounts | nothing | |
keepScroll(options?) | entry | nothing | |
pointedLinks() | stream | Url | |
applyMask(value, pattern) | function | { value, raw } |