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)

NameFormReports or yieldsArgs
copyText(text)CommandCopied, CopyFailed
readText()CommandRead { text }, ReadFailed
share(data)CommandShared, Dismissed, ShareFailed{ title?, text?, url? }
loadScript(src)CommandLoaded, LoadFailed
Autofocus()MountFocused
InputMask({ pattern })MountInput { value, raw }#, A, * placeholders
KeepInView({ selector })Mountnothing
Measure({ targets })Mountnothing; writes custom properties
FluidHover({ name, item, axis, gapClick, gapReach?, follows?, from? })Mountnothing; writes custom propertiesaxis: x, y, xy
FocusScope(options)Mountnothing{ contain?, restore?, initialFocus? }
FollowTabStopMountnothing
ScrollLock, HideOutsideMountsnothing
keepScroll(options?)entrynothing
pointedLinks()streamUrl
applyMask(value, pattern)function{ value, raw }