foldkit-primitives 0.11.0 → 0.12.1
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/dist/dom/index.d.mts +31 -2
- package/dist/dom/index.d.mts.map +1 -1
- package/dist/dom/index.mjs +43 -2
- package/dist/dom/index.mjs.map +1 -1
- package/dist/{editable-text-Dvm-Fuqs.d.mts → editable-text-1D31qthY.d.mts} +12 -4
- package/dist/{editable-text-Dvm-Fuqs.d.mts.map → editable-text-1D31qthY.d.mts.map} +1 -1
- package/dist/{follow-tab-stop-Ci1tqAIW.mjs → follow-tab-stop-Caog2qg1.mjs} +53 -12
- package/dist/follow-tab-stop-Caog2qg1.mjs.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/interaction/index.d.mts +1 -1
- package/dist/interaction/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/follow-tab-stop-Ci1tqAIW.mjs.map +0 -1
package/dist/dom/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["failMessage","failMessage","urlToString"],"sources":["../../src/dom/autofocus.ts","../../src/dom/clipboard.ts","../../src/dom/input-mask.ts","../../src/dom/keep-in-view.ts","../../src/dom/script-loader.ts","../../src/dom/share.ts","../../src/dom/measure.ts","../../src/dom/scroll.ts","../../src/dom/pointed-links.ts","../../src/dom/fluid-hover.ts","../../src/dom/scroll-bars.ts","../../src/dom/swipe.ts","../../src/dom/scroll-settle.ts","../../src/dom/pointer-position.ts","../../src/dom/track-box.ts"],"sourcesContent":["import { Effect, Schema } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\nexport const Focused = Schema.TaggedStruct('Focused', {})\nexport type Focused = typeof Focused.Type\n\n/**\n * Autofocus as a Mount: focuses the element on insert, then emits `Focused`.\n * The message means focus was requested — a non-focusable element or a\n * hidden tab may decline, and the browser does not report that. Plain\n * `focus()`, no scroll options: scroll behavior stays the application's\n * choice.\n */\nexport const Autofocus = Mount.define('Autofocus', {\n messages: [Focused],\n execute: ({ element }) =>\n Effect.sync(() => {\n const focusable = element as unknown as { readonly focus?: unknown }\n if (typeof focusable.focus === 'function') {\n ;(focusable.focus as () => void).call(element)\n }\n return Focused.make({})\n }),\n})\n","/**\n * The clipboard as Commands: run in `update` beside any bundle. A copy yields\n * `Copied` or `CopyFailed`, a read `Read` or `ReadFailed`. No Model involved:\n * the clipboard is not application state.\n */\nimport { Effect, Schema } from 'effect'\nimport type { Command } from 'foldkit/command'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ClipboardMessage = defineMessageUnion({\n Copied: {},\n CopyFailed: { message: Schema.String },\n})\nexport type ClipboardMessage = typeof ClipboardMessage.Type\n\nexport const ClipboardReadMessage = defineMessageUnion({\n Read: { text: Schema.String },\n ReadFailed: { message: Schema.String },\n})\nexport type ClipboardReadMessage = typeof ClipboardReadMessage.Type\n\nconst failMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error)\n\n/**\n * Copies text to the clipboard. Without a clipboard API (SSR, insecure\n * context, denied permission) the command yields `CopyFailed` instead of\n * throwing, so `update` handles both outcomes as Messages.\n */\nexport const copyText = (text: string): Command<ClipboardMessage, never, never> => ({\n name: 'Clipboard.copy',\n args: { text },\n effect:\n typeof navigator !== 'undefined' && typeof navigator.clipboard?.writeText === 'function'\n ? Effect.matchEffect(\n Effect.tryPromise({\n try: () => navigator.clipboard.writeText(text),\n catch: failMessage,\n }),\n {\n onFailure: message => Effect.succeed(ClipboardMessage.CopyFailed({ message })),\n onSuccess: () => Effect.succeed(ClipboardMessage.Copied()),\n },\n )\n : Effect.succeed(ClipboardMessage.CopyFailed({ message: 'clipboard is unavailable' })),\n})\n\n/**\n * Reads the clipboard's text. The browser may ask the user first; a refusal,\n * an insecure context or no clipboard API yields `ReadFailed`.\n */\nexport const readText = (): Command<ClipboardReadMessage, never, never> => ({\n name: 'Clipboard.read',\n effect:\n typeof navigator !== 'undefined' && typeof navigator.clipboard?.readText === 'function'\n ? Effect.matchEffect(\n Effect.tryPromise({ try: () => navigator.clipboard.readText(), catch: failMessage }),\n {\n onFailure: message => Effect.succeed(ClipboardReadMessage.ReadFailed({ message })),\n onSuccess: text => Effect.succeed(ClipboardReadMessage.Read({ text })),\n },\n )\n : Effect.succeed(ClipboardReadMessage.ReadFailed({ message: 'clipboard is unavailable' })),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** What `InputMask` reports after each edit: the masked text shown, and the characters typed. */\nexport const Input = Schema.TaggedStruct('Input', {\n value: Schema.String,\n raw: Schema.String,\n})\nexport type Input = typeof Input.Type\n\nconst isDigit = (char: string): boolean => char >= '0' && char <= '9'\nconst isLetter = (char: string): boolean =>\n (char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z')\n\nconst matches = (placeholder: string, char: string): boolean =>\n placeholder === '#'\n ? isDigit(char)\n : placeholder === 'A'\n ? isLetter(char)\n : isDigit(char) || isLetter(char)\n\nconst isPlaceholder = (char: string): boolean => char === '#' || char === 'A' || char === '*'\n\n/** Whether any placeholder at or after `from` consumes any input at or after `at`. */\nconst fillable = (pattern: string, from: number, value: string, at: number): boolean => {\n for (let i = from; i < pattern.length; i++) {\n const placeholder = pattern[i]!\n if (!isPlaceholder(placeholder)) continue\n for (let j = at; j < value.length; j++) {\n if (matches(placeholder, value[j]!)) return true\n }\n }\n return false\n}\n\n/**\n * The mask as a pure function: `#` takes a digit, `A` a letter, `*` either, and\n * any other character of the pattern is written in once input reaches past it.\n * Input that fits no placeholder is skipped. `masked` is what the field shows;\n * `raw` is only the characters typed.\n */\nexport const applyMask = (\n value: string,\n pattern: string,\n): { readonly masked: string; readonly raw: string } => {\n let masked = ''\n let raw = ''\n let at = 0\n for (let i = 0; i < pattern.length; i++) {\n const slot = pattern[i]!\n if (isPlaceholder(slot)) {\n while (at < value.length && !matches(slot, value[at]!)) at++\n if (at >= value.length) break\n masked += value[at]!\n raw += value[at]!\n at++\n } else if (fillable(pattern, i + 1, value, at)) {\n masked += slot\n } else {\n break\n }\n }\n return { masked, raw }\n}\n\ninterface MaskableField {\n value: string\n selectionStart: number | null\n addEventListener(type: string, listener: () => void): void\n removeEventListener(type: string, listener: () => void): void\n setSelectionRange?(start: number, end: number): void\n}\n\nconst asField = (element: Element): MaskableField | null => {\n const field = element as unknown as Partial<MaskableField>\n return typeof field.value === 'string' && typeof field.addEventListener === 'function'\n ? (field as MaskableField)\n : null\n}\n\n/**\n * An input mask as a Mount plus a pure mask function. The pattern language\n * is three placeholders — `#` digit, `A` letter, `*` either, all ASCII —\n * with every other character literal. Literals appear only once a later placeholder\n * consumes input, so partial values never dangle a separator. The Mount\n * rewrites the field, restores the caret approximately, and emits `Input`\n * with both the masked and raw values; the parent owns the state, like any\n * controlled input.\n */\nexport const InputMask = Mount.defineStream('InputMask', {\n messages: [Input],\n args: { pattern: Schema.String },\n execute: ({ element, pattern }) =>\n Stream.callback<typeof Input.Type>(queue =>\n Effect.gen(function* () {\n const field = asField(element)\n if (field === null) return\n const onInput = () => {\n const { masked, raw } = applyMask(field.value, pattern)\n if (masked !== field.value) {\n const caret = field.selectionStart ?? masked.length\n field.value = masked\n const at = Math.min(caret, masked.length)\n try {\n field.setSelectionRange?.(at, at)\n } catch {\n // Select-all style inputs reject ranges; the value still stands.\n }\n }\n Queue.offerUnsafe(queue, Input.make({ value: masked, raw }))\n }\n yield* Effect.acquireRelease(\n Effect.sync(() => {\n field.addEventListener('input', onInput)\n return field\n }),\n current => Effect.sync(() => current.removeEventListener('input', onInput)),\n )\n }),\n ),\n})\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/**\n * Keeps what is marked in view as a Mount: whenever an element in the mounted\n * one's subtree newly matches `selector`, such as the row just selected in a\n * list, it is scrolled into view the least amount that shows it (`nearest`).\n * The element keeps its identity and its focus: nothing is redrawn to move it.\n *\n * It watches with a `MutationObserver` for as long as it is mounted, which is as\n * long as the list or canvas that can change what is marked.\n */\nexport const KeepInView = Mount.defineStream('KeepInView', {\n messages: [Schema.Never],\n args: {\n /** What is marked, as a selector within the element: `[aria-selected=\"true\"]`. */\n selector: Schema.String,\n },\n execute: ({ element, selector }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n let marked = element.querySelector(selector)\n const observer = new MutationObserver(() => {\n const now = element.querySelector(selector)\n // Only a change of what is marked scrolls: the author's own scrolling stays.\n // A DOM with no layout (jsdom, in a test) has no scrollIntoView and nothing to scroll.\n if (now !== null && now !== marked && typeof now.scrollIntoView === 'function')\n now.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n marked = now\n })\n observer.observe(element, { subtree: true, childList: true, attributes: true })\n return observer\n }),\n observer => Effect.sync(() => observer.disconnect()),\n ),\n ),\n})\n","/**\n * Script loading as a Command: appends a `src` script to the head unless one\n * is already there. Idempotent by URL — concurrent placements collapse onto\n * the first tag instead of fetching twice. Yields `Loaded` on success and\n * `LoadFailed` otherwise (network error, no document), so `update` handles\n * both outcomes as Messages.\n */\nimport { Effect, Schema } from 'effect'\nimport type { Command } from 'foldkit/command'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ScriptMessage = defineMessageUnion({\n Loaded: {},\n LoadFailed: { message: Schema.String },\n})\nexport type ScriptMessage = typeof ScriptMessage.Type\n\nconst failMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error)\n\n// Tags still fetching, by URL: concurrent loads share one tag and its fate.\nconst inflight = new Map<string, Promise<void>>()\n\n/** Loads a script by URL, once per URL. */\nexport const loadScript = (src: string): Command<ScriptMessage, never, never> => ({\n name: 'Script.load',\n args: { src },\n effect: Effect.matchEffect(\n Effect.tryPromise({\n try: () => {\n if (typeof document === 'undefined') {\n return Promise.reject(new Error('script loading is unavailable'))\n }\n // Concurrent loads share one tag and its fate, instead of racing\n // past the presence check and fetching twice: the in-flight entry\n // is checked before presence, in the same synchronous block that\n // appends, so a second load cannot slip between them.\n const running = inflight.get(src)\n if (running !== undefined) return running\n // getAttribute, not .src: the property resolves to an absolute URL\n // and would never equal the given string.\n const present = Array.from(document.getElementsByTagName('script')).some(\n element => element.getAttribute('src') === src,\n )\n if (present) return Promise.resolve()\n const completion = new Promise<void>((resolve, reject) => {\n const element = document.createElement('script')\n element.src = src\n element.async = true\n element.onload = () => resolve()\n element.onerror = () => {\n // A dead tag must not satisfy later presence checks.\n element.remove()\n reject(new Error(`failed to load script: ${src}`))\n }\n document.head.appendChild(element)\n })\n const tracked = completion.then(\n () => {\n inflight.delete(src)\n },\n (error: unknown) => {\n inflight.delete(src)\n throw error\n },\n )\n inflight.set(src, tracked)\n return tracked\n },\n catch: (error: unknown) => error,\n }),\n {\n onFailure: error => Effect.succeed(ScriptMessage.LoadFailed({ message: failMessage(error) })),\n onSuccess: () => Effect.succeed(ScriptMessage.Loaded()),\n },\n ),\n})\n","/**\n * Web Share as a Command: runs in `update` beside any bundle, yields\n * `Shared` on success. Dismissal is its own outcome, not a failure — the\n * application tells a cancelled sheet apart from a broken one. Without a\n * share API (desktop, insecure context) it yields `ShareFailed` instead of\n * throwing, so `update` handles every outcome as a Message.\n */\nimport { Effect, Schema } from 'effect'\nimport type { Command } from 'foldkit/command'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ShareData = Schema.Struct({\n title: Schema.optional(Schema.String),\n text: Schema.optional(Schema.String),\n url: Schema.optional(Schema.String),\n})\nexport type ShareData = typeof ShareData.Type\n\nexport const ShareMessage = defineMessageUnion({\n Shared: {},\n Dismissed: {},\n ShareFailed: { message: Schema.String },\n})\nexport type ShareMessage = typeof ShareMessage.Type\n\nconst failMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error)\n\nconst isDismissal = (error: unknown): boolean =>\n typeof (error as { readonly name?: unknown } | null)?.name === 'string' &&\n (error as { readonly name: string }).name === 'AbortError'\n\n/** Shares data through the platform sheet. */\nexport const share = (data: ShareData): Command<ShareMessage, never, never> => ({\n name: 'Share.share',\n args: { data },\n effect:\n typeof navigator !== 'undefined' && typeof navigator.share === 'function'\n ? Effect.matchEffect(\n Effect.tryPromise({\n // Omit absent fields: the platform type rejects explicit\n // undefined under exactOptionalPropertyTypes.\n try: () =>\n navigator.share({\n ...(data.title !== undefined ? { title: data.title } : {}),\n ...(data.text !== undefined ? { text: data.text } : {}),\n ...(data.url !== undefined ? { url: data.url } : {}),\n }),\n catch: (error: unknown) => error,\n }),\n {\n onFailure: error =>\n Effect.succeed(\n isDismissal(error)\n ? ShareMessage.Dismissed()\n : ShareMessage.ShareFailed({ message: failMessage(error) }),\n ),\n onSuccess: () => Effect.succeed(ShareMessage.Shared()),\n },\n )\n : Effect.succeed(ShareMessage.ShareFailed({ message: 'share is unavailable' })),\n})\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** The custom properties `Measure` writes for a target named `name`. */\nexport const measured = (name: string) =>\n ({\n x: `--fk-${name}-x`,\n y: `--fk-${name}-y`,\n w: `--fk-${name}-w`,\n h: `--fk-${name}-h`,\n display: `--fk-${name}-display`,\n }) as const\n\n/**\n * Measures marked elements as a Mount, for a view to draw something over them,\n * such as an editor's selection outline, with no Message and no Model: where\n * an element is, is presentation, known to the DOM and to no transition.\n *\n * For each named target, the first element in the mounted one's subtree that\n * matches its selector is measured relative to the mounted element's scroll\n * box, which is what an absolutely placed child of it is laid out in. The\n * mounted element gets `--fk-<name>-x`, `-y`, `-w` and `-h` in pixels, and\n * `--fk-<name>-display`: `block` while a target is found, `none` while none is.\n *\n * It measures again when the subtree changes (a selection moves), in the\n * frame the change is drawn in; and, at most once a frame, when the mounted\n * element scrolls, the window resizes, the mounted element or a measured one\n * changes size, an image or a font inside loads, and on every frame of a\n * transition or an animation inside. What moves a target by any other way,\n * such as a stylesheet added that shifts it without resizing it, is seen at\n * the next of these.\n */\nexport const Measure = Mount.defineStream('Measure', {\n messages: [Schema.Never],\n args: {\n /** Each target by name, as a selector within the element: `{ selected: '[aria-selected=\"true\"]' }`. */\n targets: Schema.Record(Schema.String, Schema.String),\n },\n execute: ({ element, targets }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const container = element as HTMLElement\n const names = Object.keys(targets)\n let watched: ReadonlyArray<Element> = []\n let frame: number | undefined\n // Whether a transition or an animation may be moving something, until one frame finds none.\n let animating = false\n\n const measure = () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = undefined\n const box = container.getBoundingClientRect()\n const found: Array<Element> = []\n for (const name of names) {\n const property = measured(name)\n const target = container.querySelector(targets[name]!)\n if (target === null) {\n container.style.setProperty(property.display, 'none')\n continue\n }\n found.push(target)\n const rect = target.getBoundingClientRect()\n // Relative to the scroll box: where the content is, not where the viewport shows it.\n const x = rect.left - box.left - container.clientLeft + container.scrollLeft\n const y = rect.top - box.top - container.clientTop + container.scrollTop\n container.style.setProperty(property.x, `${x}px`)\n container.style.setProperty(property.y, `${y}px`)\n container.style.setProperty(property.w, `${rect.width}px`)\n container.style.setProperty(property.h, `${rect.height}px`)\n container.style.setProperty(property.display, 'block')\n }\n // A measured element that changes size, as an image loading does, is measured again.\n if (found.length !== watched.length || found.some((each, at) => each !== watched[at])) {\n for (const each of watched) sizes.unobserve(each)\n for (const each of found) sizes.observe(each)\n watched = found\n }\n if (animating) {\n // Asked each frame rather than counted: an element removed mid-transition ends none.\n animating = container\n .getAnimations({ subtree: true })\n .some(animation => animation.playState === 'running')\n if (animating) soon()\n }\n }\n const soon = () => {\n if (frame === undefined) frame = requestAnimationFrame(measure)\n }\n const moving = () => {\n animating = true\n soon()\n }\n\n // A change is measured as its records arrive, before the frame it is drawn in is\n // painted, so a box never shows one frame on the element it has left.\n const changes = new MutationObserver(measure)\n // Made, and the fonts listened to, before anything observes: where one is\n // missing (jsdom has neither a ResizeObserver nor `document.fonts`), the Mount\n // fails with nothing attached to call `measure`.\n const sizes = new ResizeObserver(soon)\n document.fonts.addEventListener('loadingdone', soon)\n // Its own properties change the container's style too, but writing the same\n // values again records nothing, so a measure that changed nothing rests.\n changes.observe(container, { subtree: true, childList: true, attributes: true })\n sizes.observe(container)\n container.addEventListener('scroll', soon, { passive: true })\n window.addEventListener('resize', soon)\n // `load` does not bubble, so it is caught on the way down.\n container.addEventListener('load', soon, { capture: true })\n container.addEventListener('transitionrun', moving)\n container.addEventListener('animationstart', moving)\n measure()\n return () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n changes.disconnect()\n sizes.disconnect()\n container.removeEventListener('scroll', soon)\n window.removeEventListener('resize', soon)\n container.removeEventListener('load', soon, { capture: true })\n document.fonts.removeEventListener('loadingdone', soon)\n container.removeEventListener('transitionrun', moving)\n container.removeEventListener('animationstart', moving)\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","/**\n * Where the window is scrolled, across an application's own navigations, as\n * a stream. Left to itself, a browser keeps the scroll of the entry it\n * leaves when a link pushes a new one, and on Back restores the old offset\n * before the application has drawn the entry it returns to, so the offset is\n * clamped to a page still loading. Here a pushed entry starts at the top,\n * and Back, Forward or a reload return where that entry was, once the page\n * is tall enough to hold it.\n *\n * Three rules, each found the slow way:\n *\n * 1. The offset is taken when the reader acts. The next screen is drawn\n * before a Navigate Command pushes the address, so by the time the URL\n * changes the window is already clamped to the new, shorter page. The\n * scroll is recorded at the reader's click or key (capture phase), and at\n * the start of Back and Forward, which begin in the browser before\n * anything is drawn.\n * 2. A restore holds its place while the next screen settles. A restore made\n * when the entry changes is undone by the loading state drawn right after\n * it, so the target is held on each frame for a moment, until the reader\n * scrolls, touches or types, or another navigation starts.\n * 3. Entries are keyed by the Navigation API's entry key, which a reload and\n * a full navigation keep; offsets rest in `sessionStorage`, so Back into\n * another document restores too. Where the browser has no Navigation API\n * the stream attaches nothing and leaves the browser's own behaviour\n * alone.\n *\n * Lift with `Subscription.persistentEntry`; the stream sends no Messages. Only\n * the window scrolls: a nested container is the route graph's to know, when\n * `Site.transition` arrives.\n */\nimport { Effect, Option, Stream } from 'effect'\n\n/** How `keepScroll` remembers and restores each history entry's offset. */\nexport interface KeepScrollOptions {\n /** The `sessionStorage` key holding entry offsets. Default `'foldkit:scroll'`. */\n readonly storageKey?: string | undefined\n /** Entries remembered at most: the oldest are forgotten first. Default 50. */\n readonly kept?: number | undefined\n /**\n * How long a restore holds its place while the next screen settles, in\n * milliseconds. Default 2000.\n */\n readonly patience?: number | undefined\n}\n\nconst navigationTypeOf = (event: Event): Option.Option<unknown> =>\n 'navigationType' in event ? Option.some(event.navigationType) : Option.none()\n\nconst readSaved = (storageKey: string): Map<string, number> => {\n try {\n const stored: unknown = JSON.parse(sessionStorage.getItem(storageKey) ?? '[]')\n return new Map(\n Array.isArray(stored)\n ? stored.filter(\n (pair): pair is [string, number] =>\n Array.isArray(pair) && typeof pair[0] === 'string' && typeof pair[1] === 'number',\n )\n : [],\n )\n } catch {\n // Storage blocked, or something else wrote the key: nothing is remembered.\n return new Map()\n }\n}\n\n/** Starts keeping the scroll; the release undoes everything it installed. */\nconst attach = (storageKey: string, kept: number, patience: number): (() => void) => {\n // TypeScript's DOM library declares it on every window; a browser without\n // the Navigation API has none.\n const navigation: Navigation | undefined = window.navigation\n if (navigation === undefined) return () => {}\n const restoration = window.history.scrollRestoration\n window.history.scrollRestoration = 'manual'\n const saved = readSaved(storageKey)\n const detaches: Array<() => void> = []\n const on = (target: EventTarget, type: string, listener: EventListener, capture?: boolean) => {\n target.addEventListener(type, listener, capture)\n detaches.push(() => target.removeEventListener(type, listener, capture))\n }\n const keyOf = () =>\n Option.fromNullOr(navigation.currentEntry).pipe(Option.map(entry => entry.key))\n /** Where the current entry was left, if it has been. */\n const savedHere = () => Option.flatMap(keyOf(), key => Option.fromUndefinedOr(saved.get(key)))\n const remember = () => {\n const key = keyOf()\n if (Option.isNone(key)) return\n // Moved to the end, so it is the last to be forgotten.\n saved.delete(key.value)\n saved.set(key.value, window.scrollY)\n for (const old of saved.keys()) {\n if (saved.size <= kept) break\n saved.delete(old)\n }\n }\n\n let settling = new AbortController()\n /**\n * Holds the window at `top` while the next screen settles, whenever the page\n * can hold it, until the reader scrolls, touches or types, or another\n * navigation starts.\n */\n const settle = (top: number) => {\n settling.abort()\n settling = new AbortController()\n const { signal } = settling\n for (const input of ['wheel', 'touchstart', 'keydown', 'pointerdown'])\n window.addEventListener(input, () => settling.abort(), { passive: true, signal })\n const until = performance.now() + patience\n const step = () => {\n if (signal.aborted) return\n const room = document.documentElement.scrollHeight - window.innerHeight\n if (room >= top && Math.round(window.scrollY) !== top)\n window.scrollTo({ top, behavior: 'instant' })\n if (performance.now() < until) requestAnimationFrame(step)\n else settling.abort()\n }\n step()\n }\n\n // Remembered where the reader acts, before the application does: by the time\n // it pushes an address it has drawn the next screen, and the window is\n // already clamped to it. Back and Forward start in the browser, before\n // anything is drawn, so they are remembered as they begin.\n const acted = () => remember()\n for (const input of ['click', 'keydown']) on(window, input, acted, true)\n const traversing = (event: Event) => {\n if (Option.contains(navigationTypeOf(event), 'traverse')) remember()\n }\n on(navigation, 'navigate', traversing)\n const changed = (event: Event) => {\n const type = navigationTypeOf(event)\n if (Option.contains(type, 'push')) settle(0)\n else if (Option.contains(type, 'traverse')) settle(Option.getOrElse(savedHere(), () => 0))\n // A replace is the same entry, narrowed or selected in place: it stays where it is.\n }\n on(navigation, 'currententrychange', changed)\n const hidden = () => {\n remember()\n try {\n sessionStorage.setItem(storageKey, JSON.stringify([...saved]))\n } catch {\n // Storage blocked: the next document starts at the top.\n }\n }\n on(window, 'pagehide', hidden)\n // A reload, or Back into this document from another: where this entry was.\n const here = savedHere()\n if (Option.isSome(here)) settle(here.value)\n return () => {\n settling.abort()\n for (const detach of detaches) detach()\n window.history.scrollRestoration = restoration\n }\n}\n\n/**\n * Keeps the window's scroll across same-document navigations: a pushed entry\n * starts at the top, and Back, Forward or a reload return where that entry\n * was. Without a window the stream is empty instead of throwing. Lift with\n * `Subscription.persistentEntry`; the stream sends no Messages.\n */\nexport const keepScroll = (options: KeepScrollOptions = {}): Stream.Stream<never> => {\n if (typeof window === 'undefined') return Stream.empty\n const storageKey = options.storageKey ?? 'foldkit:scroll'\n const kept = options.kept ?? 50\n const patience = options.patience ?? 2000\n return Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => attach(storageKey, kept, patience)),\n detach => Effect.sync(detach),\n ),\n )\n}\n","import { Option, Stream } from 'effect'\nimport * as Dom from 'foldkit/dom'\nimport { fromString, toString as urlToString, type Url } from 'foldkit/url'\n\n/**\n * The address of the link a reader points at or tabs to, on the page's own\n * origin: where they may go next, for a `Data.preload` before they go. Each\n * link once while they stay on it, since crossing its text sends one event\n * per element inside it. Without a document the stream is empty. Lift with\n * `Subscription.persistentEntry`, mapping each address to a Message.\n */\nexport const pointedLinks = (): Stream.Stream<Url> => {\n if (typeof document === 'undefined') return Stream.empty\n const linkOf = (event: Event): Option.Option<Url> => {\n const link = event.target instanceof Element ? event.target.closest('a[href]') : null\n return link instanceof HTMLAnchorElement && link.origin === window.location.origin\n ? fromString(link.href)\n : Option.none()\n }\n return Stream.merge(\n Dom.streamFromEventFilterMap({\n target: document,\n type: 'pointerover',\n filterMapEvent: linkOf,\n }),\n Dom.streamFromEventFilterMap({ target: document, type: 'focusin', filterMapEvent: linkOf }),\n ).pipe(Stream.changesWith((a, b) => urlToString(a) === urlToString(b)))\n}\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** The custom properties `FluidHover` writes on its container for a highlight named `name`. */\nexport const fluidHovered = (name: string) =>\n ({\n x: `--fk-${name}-x`,\n y: `--fk-${name}-y`,\n w: `--fk-${name}-w`,\n h: `--fk-${name}-h`,\n /** `1` while an item is highlighted, `0` once the pointer and focus have left. */\n shown: `--fk-${name}-shown`,\n /**\n * `0` for the frame the highlight appears in, then `1`: a highlight's\n * movement scales its duration by it, so it appears on its item rather\n * than sliding in from where it last was.\n */\n moving: `--fk-${name}-moving`,\n }) as const\n\n/**\n * The attribute `FluidHover` sets on its container, to the highlight's name,\n * while it runs: a stylist draws the highlight, and drops each item's own\n * hover, only under it.\n */\nexport const FLUID_HOVER_ATTRIBUTE = 'data-fluid-hover'\n\n/** The attribute that names, inside an item, the control a press in a gap reaches. */\nexport const FLUID_PRESS_ATTRIBUTE = 'data-fluid-press'\n\n/** The attribute on the item the highlight is shown on, for what CSS draws beside it. */\nexport const FLUID_LIT_ATTRIBUTE = 'data-fluid-lit'\n\nconst Axis = Schema.Literals(['x', 'y', 'xy'])\nexport type FluidAxis = typeof Axis.Type\n\n/** How far a point is from a rectangle along each axis: zero inside it. */\nconst gap = (low: number, high: number, at: number) => Math.max(low - at, 0, at - high)\n\n// On one axis the other only breaks ties, so a list's highlight never leaves\n// the row level with the pointer for a nearer edge of the next column.\nconst away: Record<FluidAxis, (dx: number, dy: number) => number> = {\n x: (dx, dy) => dx * 1e6 + dy,\n y: (dx, dy) => dy * 1e6 + dx,\n xy: Math.hypot,\n}\n\nconst distance = (rect: DOMRect, x: number, y: number, axis: FluidAxis) =>\n away[axis](gap(rect.left, rect.right, x), gap(rect.top, rect.bottom, y))\n\nconst isDisabled = (item: Element) =>\n item.matches('[aria-disabled=\"true\"], [data-disabled]:not([data-disabled=\"false\"]), :disabled')\n\n/**\n * One highlight that follows the pointer across a container's items, as a\n * Mount, with no Message and no Model: which item the pointer is nearest is\n * presentation, known to the DOM and to no transition.\n *\n * The item nearest the pointer is the one highlighted, so the pointer in a gap\n * between two items still points at one, and the highlight moves from item to\n * item instead of blinking off between them. On the `y` axis nearness is read\n * vertically (a list), on `x` horizontally (a strip), on `xy` both (a grid). A\n * disabled item (`aria-disabled=\"true\"`, `data-disabled`, `:disabled`) is never\n * highlighted. An item reached by the keyboard (`:focus-visible`) is\n * highlighted too; a touch highlights nothing, since there is no pointer to\n * follow before the press.\n *\n * The container gets `--fk-<name>-x`, `-y`, `-w` and `-h` in pixels, relative\n * to its scroll box like `Measure`'s, and `-shown` and `-moving` (see\n * `fluidHovered`); a view draws the highlight as an absolutely placed child\n * that reads them. With `gapClick`, a click in a gap presses the highlighted\n * item: its descendant marked `data-fluid-press`, or the item itself; with\n * `gapReach` too, only a click within that many pixels of it, as a grid of\n * cards with wide gutters wants (Fluid Functionalism's uses 16). A popup\n * measured before it has a layout box keeps its last complete place, and\n * tries again for three frames, rather than drawing the highlight at zero.\n * The item the highlight is shown on carries `data-fluid-lit`, so a style\n * can change what sits beside it (a table hides the lines around the lit\n * row).\n *\n * `follows` names the item the highlight sits on while the pointer is not\n * moving it: a menu marks the row its keys reach (`[data-active]`), and the\n * highlight goes there whenever that mark moves, so the keys and the pointer\n * light the same one. `from` names the item a fresh highlight grows out of,\n * as a tab's hover leaves the chosen tab. A highlight always fades where it\n * is: once the pointer leaves, nothing should move. It stays only for an item\n * the keyboard reached (`:focus-visible`), not one a click focused.\n */\nexport const FluidHover = Mount.defineStream('FluidHover', {\n messages: [Schema.Never],\n args: {\n /** The highlight's name, which names the custom properties. */\n name: Schema.String,\n /** The selector of an item within the container. */\n item: Schema.String,\n axis: Axis,\n gapClick: Schema.Boolean,\n /** How far from the highlighted item, in pixels, a click in a gap still presses it. */\n gapReach: Schema.optional(Schema.Number),\n /** The selector of the item the highlight sits on while the pointer is not moving it. */\n follows: Schema.optional(Schema.String),\n /** The selector of the item a fresh highlight grows out of. */\n from: Schema.optional(Schema.String),\n },\n execute: ({ element, name, item: selector, axis, gapClick, gapReach, follows, from }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const container = element as HTMLElement\n const property = fluidHovered(name)\n let active: Element | null = null\n let followed: Element | null = null\n let pointer: { readonly x: number; readonly y: number } | null = null\n let frame: number | undefined\n\n const origin = () => (from === undefined ? null : container.querySelector(from))\n let retries = 0\n const place = (at: Element | null = active) => {\n if (at === null) return\n const box = container.getBoundingClientRect()\n const rect = at.getBoundingClientRect()\n // No layout box yet (a popup still opening): keep the last place and look again.\n if (rect.width === 0 && rect.height === 0) {\n if (retries < 3) {\n retries += 1\n requestAnimationFrame(() => place(at))\n }\n return\n }\n retries = 0\n const x = rect.left - box.left - container.clientLeft + container.scrollLeft\n const y = rect.top - box.top - container.clientTop + container.scrollTop\n container.style.setProperty(property.x, `${x}px`)\n container.style.setProperty(property.y, `${y}px`)\n container.style.setProperty(property.w, `${rect.width}px`)\n container.style.setProperty(property.h, `${rect.height}px`)\n }\n /** Marks `item` as the lit one, and nothing else. */\n const light = (item: Element | null) => {\n container\n .querySelectorAll(`[${FLUID_LIT_ATTRIBUTE}]`)\n .forEach(each => each !== item && each.removeAttribute(FLUID_LIT_ATTRIBUTE))\n item?.setAttribute(FLUID_LIT_ATTRIBUTE, '')\n }\n const show = (next: Element) => {\n const appearing = container.style.getPropertyValue(property.shown) !== '1'\n active = next\n light(next)\n const grows = appearing ? origin() : null\n if (appearing) container.style.setProperty(property.moving, '0')\n if (grows === null) {\n place()\n container.style.setProperty(property.shown, '1')\n } else {\n // Drawn first where it grows from, then moved: it travels out of that item.\n place(grows)\n requestAnimationFrame(() => {\n if (active !== next) return\n place()\n container.style.setProperty(property.shown, '1')\n })\n }\n if (appearing) {\n // The frame after: by then the jump to the item has been drawn without moving.\n requestAnimationFrame(() => container.style.setProperty(property.moving, '1'))\n }\n }\n const hide = () => {\n container.style.setProperty(property.shown, '0')\n light(null)\n }\n /** Whether the keyboard has an item focused, which the highlight then stays on. */\n const keyed = () => {\n const focused = document.activeElement\n return (\n focused !== null && container.contains(focused) && focused.matches(':focus-visible')\n )\n }\n const nearest = (x: number, y: number) => {\n let best: Element | null = null\n let bestDistance = Infinity\n for (const each of Array.from(container.querySelectorAll(selector))) {\n if (isDisabled(each)) continue\n const far = distance(each.getBoundingClientRect(), x, y, axis)\n if (far < bestDistance) {\n best = each\n bestDistance = far\n }\n }\n return best\n }\n const follow = () => {\n frame = undefined\n if (pointer === null) return\n const next = nearest(pointer.x, pointer.y)\n if (next === null) hide()\n else if (next !== active || container.style.getPropertyValue(property.shown) !== '1')\n show(next)\n }\n\n const move = (event: PointerEvent) => {\n if (event.pointerType === 'touch') return\n pointer = { x: event.clientX, y: event.clientY }\n if (frame === undefined) frame = requestAnimationFrame(follow)\n }\n const leave = () => {\n pointer = null\n if (!keyed()) hide()\n }\n const focus = (event: FocusEvent) => {\n if (!(event.target instanceof Element) || !event.target.matches(':focus-visible')) {\n return\n }\n const owner = event.target.closest(selector)\n if (owner !== null && container.contains(owner) && !isDisabled(owner)) show(owner)\n }\n const blur = (event: FocusEvent) => {\n const to = event.relatedTarget\n if (pointer === null && !(to instanceof Node && container.contains(to))) hide()\n }\n const click = (event: MouseEvent) => {\n if (!gapClick || active === null) return\n if (container.style.getPropertyValue(property.shown) !== '1') return\n const target = event.target\n if (!(target instanceof Element) || target.closest(selector) !== null) return\n const reach = distance(\n active.getBoundingClientRect(),\n event.clientX,\n event.clientY,\n 'xy',\n )\n if (gapReach !== undefined && reach > gapReach) return\n const press = active.querySelector(`[${FLUID_PRESS_ATTRIBUTE}]`) ?? active\n if (press instanceof HTMLElement) press.click()\n }\n const soon = () => {\n if (active !== null) requestAnimationFrame(() => place())\n }\n /** The marked item moved: the highlight goes with it, or fades if it is gone. */\n const marked = () => {\n if (follows === undefined) return\n const next = container.querySelector(follows)\n if (next === followed) return\n followed = next\n if (next !== null && !isDisabled(next)) show(next)\n else if (pointer === null && !keyed()) hide()\n }\n\n // Where there is no layout (jsdom has no ResizeObserver) nothing moves to\n // follow, and a view drawn there is no worse for the highlight's absence.\n const sizes = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(soon)\n const marks = follows === undefined ? undefined : new MutationObserver(marked)\n sizes?.observe(container)\n marks?.observe(container, { subtree: true, childList: true, attributes: true })\n container.addEventListener('pointermove', move, { passive: true })\n container.addEventListener('pointerleave', leave)\n container.addEventListener('focusin', focus)\n container.addEventListener('focusout', blur)\n container.addEventListener('click', click)\n container.addEventListener('scroll', soon, { passive: true })\n window.addEventListener('resize', soon)\n container.style.setProperty(property.shown, '0')\n container.setAttribute(FLUID_HOVER_ATTRIBUTE, name)\n marked()\n return () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n sizes?.disconnect()\n marks?.disconnect()\n container.removeAttribute(FLUID_HOVER_ATTRIBUTE)\n light(null)\n container.removeEventListener('pointermove', move)\n container.removeEventListener('pointerleave', leave)\n container.removeEventListener('focusin', focus)\n container.removeEventListener('focusout', blur)\n container.removeEventListener('click', click)\n container.removeEventListener('scroll', soon)\n window.removeEventListener('resize', soon)\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/**\n * The attribute that marks a bar beside a scroller `ScrollBars` runs on, set\n * to the axis it shows: `block` (the up-and-down bar) or `inline`.\n */\nexport const SCROLL_BAR_ATTRIBUTE = 'data-scroll-bar'\n\n/**\n * The attribute `ScrollBars` sets on its scroller while it draws the bars, so a\n * style hides the native bar only then: with no Mount running (a coarse\n * pointer, a page not yet hydrated) the browser's bar stays.\n */\nexport const SCROLL_OVERLAID_ATTRIBUTE = 'data-scroll-overlaid'\n\n/**\n * The custom properties `ScrollBars` writes on each bar, in pixels, for its\n * thumb to read: how far along the bar the thumb starts, and how long it is.\n * Physical: an inline bar's offset is from its left edge in either direction.\n */\nexport const scrollThumb = {\n offset: '--fk-scroll-thumb-offset',\n size: '--fk-scroll-thumb-size',\n} as const\n\n/** The shortest a thumb is drawn, however long the content, so it stays a target. */\nconst SHORTEST = 20\n\nconst FINE_POINTER = '(hover: hover) and (pointer: fine)'\n\ntype Axis = 'block' | 'inline'\n\n/**\n * An overlay scrollbar as a Mount, with no Message and no Model: where a\n * scroller is scrolled is the browser's, and the bar only shows it.\n *\n * It runs on the scroller (or on an element holding it, named by `scroller`,\n * when the scroller carries another Mount) and drives the bars drawn beside\n * it: the scroller's parent's children marked `data-scroll-bar` (`block` or\n * `inline`), which a style lays over the scroller's edge. Each bar gets `data-scrollable` while its axis has\n * more to scroll, `data-shown` while the scroller scrolls or the pointer moves\n * over it, until `idle` milliseconds pass with neither (or longer, while the\n * pointer rests on a bar), and `data-dragging` while its thumb is dragged; and\n * `--fk-scroll-thumb-offset` and `-size` (see `scrollThumb`). Pressing a bar\n * off its thumb moves the thumb there, then drags it.\n *\n * It does nothing where the primary pointer is coarse or cannot hover, decided\n * when it mounts: touch keeps the browser's bar and its physics. Otherwise the\n * scroller gets `data-scroll-overlaid`, for a style to hide the native bar.\n * How the bar looks, rests, widens and fades is the style's.\n */\nexport const ScrollBars = Mount.defineStream('ScrollBars', {\n messages: [Schema.Never],\n args: {\n /** How long, in milliseconds, the bars stay after the last scroll or move. Default 600. */\n idle: Schema.optional(Schema.Number),\n /**\n * The scroller, as a selector within the element, when it cannot hold this\n * Mount itself (another component's, with a Mount of its own); looked for\n * once, when it mounts. Default: the element is the scroller.\n */\n scroller: Schema.optional(Schema.String),\n },\n execute: ({ element, idle = 600, scroller: within }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n if (typeof matchMedia !== 'function' || !matchMedia(FINE_POINTER).matches) {\n return () => {}\n }\n const found = within === undefined ? element : element.querySelector(within)\n if (!(found instanceof HTMLElement)) return () => {}\n const scroller = found\n const area = scroller.parentElement\n if (area === null) return () => {}\n\n const isBar = (child: Element): child is HTMLElement =>\n child instanceof HTMLElement && child.hasAttribute(SCROLL_BAR_ATTRIBUTE)\n /** Looked for at each use, so a redraw that replaced a bar is followed. */\n const bars = () => Array.from(area.children).filter(isBar)\n const axisOf = (bar: HTMLElement): Axis =>\n bar.getAttribute(SCROLL_BAR_ATTRIBUTE) === 'inline' ? 'inline' : 'block'\n\n /** The scroller along one axis, with the start measured from the top or the left. */\n const extent = (axis: Axis) => {\n if (axis === 'block') {\n return {\n view: scroller.clientHeight,\n content: scroller.scrollHeight,\n start: scroller.scrollTop,\n }\n }\n const room = scroller.scrollWidth - scroller.clientWidth\n // A right-to-left scroller counts from 0 at the right down to minus its room.\n const rtl = getComputedStyle(scroller).direction === 'rtl'\n return {\n view: scroller.clientWidth,\n content: scroller.scrollWidth,\n start: rtl ? room + scroller.scrollLeft : scroller.scrollLeft,\n }\n }\n const scrollTo = (axis: Axis, start: number) => {\n if (axis === 'block') {\n scroller.scrollTop = start\n return\n }\n const room = scroller.scrollWidth - scroller.clientWidth\n const rtl = getComputedStyle(scroller).direction === 'rtl'\n scroller.scrollLeft = rtl ? start - room : start\n }\n const trackOf = (bar: HTMLElement, axis: Axis) =>\n axis === 'block' ? bar.clientHeight : bar.clientWidth\n /** Where the thumb is along its bar, or nothing while the axis has nothing to scroll. */\n const thumbOf = (bar: HTMLElement, axis: Axis) => {\n const { view, content, start } = extent(axis)\n const track = trackOf(bar, axis)\n if (content - view < 1 || track <= 0) return null\n const size = Math.min(track, Math.max(SHORTEST, (track * view) / content))\n const offset = ((track - size) * start) / (content - view)\n return { track, size, offset, room: content - view }\n }\n const set = (bar: HTMLElement, name: string, value: string) => {\n if (bar.style.getPropertyValue(name) !== value) bar.style.setProperty(name, value)\n }\n const mark = (bar: HTMLElement, name: string, on: boolean) => {\n if (bar.hasAttribute(name) !== on) bar.toggleAttribute(name, on)\n }\n\n let frame: number | undefined\n const update = () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = undefined\n for (const bar of bars()) {\n const axis = axisOf(bar)\n const { view, content } = extent(axis)\n // Marked first: a style draws no bar until it is, so it has no length before.\n mark(bar, 'data-scrollable', content - view >= 1)\n const thumb = thumbOf(bar, axis)\n if (thumb === null) continue\n set(bar, scrollThumb.offset, `${thumb.offset}px`)\n set(bar, scrollThumb.size, `${thumb.size}px`)\n }\n }\n const soon = () => {\n if (frame === undefined) frame = requestAnimationFrame(update)\n }\n\n let hiding: ReturnType<typeof setTimeout> | undefined\n let resting: HTMLElement | null = null\n /** Ends the drag under way, if one is. */\n let dragging: (() => void) | null = null\n const hide = () => {\n hiding = undefined\n // A bar the pointer rests on, or one being dragged, stays until it is left.\n if (resting !== null || dragging !== null) return\n for (const bar of bars()) mark(bar, 'data-shown', false)\n }\n const show = () => {\n for (const bar of bars()) mark(bar, 'data-shown', true)\n if (hiding !== undefined) clearTimeout(hiding)\n hiding = setTimeout(hide, idle)\n }\n\n const scrolled = () => {\n update()\n show()\n }\n // Listened to only while the pointer is over the area.\n const moved = (event: PointerEvent) => {\n if (event.pointerType !== 'touch') show()\n }\n const entered = (event: PointerEvent) => {\n if (event.pointerType === 'touch') return\n area.addEventListener('pointermove', moved, { passive: true })\n show()\n }\n const left = () => {\n area.removeEventListener('pointermove', moved)\n resting = null\n // A hide that came while the pointer rested on a bar waited for this.\n if (hiding === undefined) hiding = setTimeout(hide, idle)\n }\n const over = (event: PointerEvent) => {\n const target = event.target\n resting =\n target instanceof Element ? (bars().find(bar => bar.contains(target)) ?? null) : null\n }\n\n const pressed = (event: PointerEvent) => {\n if (event.button !== 0 || event.pointerType === 'touch' || dragging !== null) return\n const target = event.target\n if (!(target instanceof Element)) return\n const bar = bars().find(each => each.contains(target))\n if (bar === undefined) return\n const axis = axisOf(bar)\n const thumb = thumbOf(bar, axis)\n if (thumb === null) return\n // The bar takes the press: no text selected, no focus moved off the scroller.\n event.preventDefault()\n const along = (at: PointerEvent) => {\n const box = bar.getBoundingClientRect()\n return axis === 'block'\n ? at.clientY - box.top - bar.clientTop\n : at.clientX - box.left - bar.clientLeft\n }\n const at = along(event)\n const onThumb = at >= thumb.offset && at <= thumb.offset + thumb.size\n // Held where it was taken, or by its middle when the press jumped it there.\n const grab = onThumb ? at - thumb.offset : thumb.size / 2\n const follow = (to: PointerEvent) => {\n const current = thumbOf(bar, axis)\n if (current === null) return\n const offset = Math.min(Math.max(along(to) - grab, 0), current.track - current.size)\n scrollTo(axis, (offset / (current.track - current.size)) * current.room)\n }\n const id = event.pointerId\n const move = (to: PointerEvent) => {\n if (to.pointerId === id) follow(to)\n }\n const end = (to: PointerEvent) => {\n if (to.pointerId === id) stop()\n }\n // On the document, for the drag alone: the pointer leaves the bar as it drags.\n const owner = bar.ownerDocument\n const stop = () => {\n owner.removeEventListener('pointermove', move)\n owner.removeEventListener('pointerup', end)\n owner.removeEventListener('pointercancel', end)\n mark(bar, 'data-dragging', false)\n dragging = null\n show()\n }\n owner.addEventListener('pointermove', move)\n owner.addEventListener('pointerup', end)\n owner.addEventListener('pointercancel', end)\n mark(bar, 'data-dragging', true)\n dragging = stop\n show()\n if (!onThumb) follow(event)\n }\n\n // Both made before anything observes: where one is missing, the Mount\n // fails with nothing attached.\n const sizes = new ResizeObserver(soon)\n // The content's size moves the thumb as much as the scroller's, so each\n // child of the scroller is watched, and each bar for its track. Only what\n // a change added or removed is watched or let go: a virtual list swaps\n // a row or two each frame it scrolls, out of many.\n const changes = new MutationObserver(records => {\n for (const record of records) {\n for (const node of Array.from(record.removedNodes)) {\n if (node instanceof Element) sizes.unobserve(node)\n }\n for (const node of Array.from(record.addedNodes)) {\n if (node instanceof Element && (record.target === scroller || isBar(node))) {\n sizes.observe(node)\n }\n }\n }\n soon()\n })\n sizes.observe(scroller)\n for (const child of Array.from(scroller.children)) sizes.observe(child)\n for (const bar of bars()) sizes.observe(bar)\n changes.observe(scroller, { childList: true })\n changes.observe(area, { childList: true })\n scroller.addEventListener('scroll', scrolled, { passive: true })\n area.addEventListener('pointerenter', entered)\n area.addEventListener('pointerleave', left)\n area.addEventListener('pointerover', over)\n area.addEventListener('pointerdown', pressed)\n scroller.setAttribute(SCROLL_OVERLAID_ATTRIBUTE, '')\n update()\n return () => {\n // Ended first: ending a drag shows the bars, which sets a hide to clear.\n dragging?.()\n if (frame !== undefined) cancelAnimationFrame(frame)\n if (hiding !== undefined) clearTimeout(hiding)\n sizes.disconnect()\n changes.disconnect()\n scroller.removeEventListener('scroll', scrolled)\n area.removeEventListener('pointerenter', entered)\n area.removeEventListener('pointerleave', left)\n area.removeEventListener('pointerover', over)\n area.removeEventListener('pointerdown', pressed)\n area.removeEventListener('pointermove', moved)\n scroller.removeAttribute(SCROLL_OVERLAID_ATTRIBUTE)\n for (const bar of bars()) {\n for (const name of ['data-scrollable', 'data-shown', 'data-dragging'])\n bar.removeAttribute(name)\n bar.style.removeProperty(scrollThumb.offset)\n bar.style.removeProperty(scrollThumb.size)\n }\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\nexport const SwipeStarted = Schema.TaggedStruct('SwipeStarted', {\n pointerId: Schema.Number,\n pointerType: Schema.String,\n /** The border box of what `measure` names (the element itself by default), as the swipe starts. */\n width: Schema.Number,\n height: Schema.Number,\n})\nexport type SwipeStarted = typeof SwipeStarted.Type\n\nexport const Swiped = Schema.TaggedStruct('Swiped', {\n pointerId: Schema.Number,\n /** From where the pointer went down, in CSS pixels. */\n deltaX: Schema.Number,\n deltaY: Schema.Number,\n})\nexport type Swiped = typeof Swiped.Type\n\nexport const SwipeEnded = Schema.TaggedStruct('SwipeEnded', {\n pointerId: Schema.Number,\n /** From where the pointer went down to where it came up, in CSS pixels. */\n deltaX: Schema.Number,\n deltaY: Schema.Number,\n /**\n * How fast the pointer was moving as it came up, in pixels a millisecond,\n * over the last `SWIPE_WINDOW` milliseconds: 0 when it rested there first.\n */\n velocityX: Schema.Number,\n velocityY: Schema.Number,\n /** `false` when the pointer was cancelled or capture was lost. */\n completed: Schema.Boolean,\n})\nexport type SwipeEnded = typeof SwipeEnded.Type\n\nexport type SwipeFact = SwipeStarted | Swiped | SwipeEnded\n\n/** How far back, in milliseconds, the release velocity looks. */\nexport const SWIPE_WINDOW = 100\n\ntype PointerLike = Event & {\n readonly pointerId?: number\n readonly button?: number\n readonly pointerType?: string\n readonly clientX?: number\n readonly clientY?: number\n}\n\ntype Capturing = Element & {\n setPointerCapture?: (pointerId: number) => void\n releasePointerCapture?: (pointerId: number) => void\n}\n\ninterface Sample {\n readonly at: number\n readonly x: number\n readonly y: number\n}\n\n/**\n * The velocity of the samples within `SWIPE_WINDOW` of the last: the way\n * from the oldest of them to the last over the time between. A pointer that\n * came to rest before the last sample has no recent way to measure, so 0.\n */\nexport const velocityOf = (samples: ReadonlyArray<Sample>): { x: number; y: number } => {\n const last = samples.at(-1)\n if (last === undefined) return { x: 0, y: 0 }\n const first = samples.find(sample => last.at - sample.at <= SWIPE_WINDOW) ?? last\n const elapsed = last.at - first.at\n return elapsed <= 0\n ? { x: 0, y: 0 }\n : { x: (last.x - first.x) / elapsed, y: (last.y - first.y) / elapsed }\n}\n\n/**\n * `Move` with the speed of its release, for a gesture that a flick ends\n * (a sheet dragged to dismiss, a card swiped away): a primary-button pointer\n * down captures the pointer, each move reports the delta from where it\n * started, and up reports the last delta with the velocity over the last\n * `SWIPE_WINDOW` milliseconds, by the events' own time stamps. Cancel or\n * lost capture ends it incomplete. The start reports the size of what is\n * moved, so a distance can be read as a share of it. What a delta or a speed\n * means is the parent's `update`. Capture is released with the Mount.\n */\nexport const Swipe = Mount.defineStream('Swipe', {\n messages: [SwipeStarted, Swiped, SwipeEnded],\n args: {\n /**\n * The nearest ancestor matching this selector is measured as the swipe\n * starts, for what the swipe moves (a sheet's panel, dragged by its\n * handle). Default: the element itself.\n */\n measure: Schema.optional(Schema.String),\n },\n execute: ({ element, measure }) =>\n Stream.callback<SwipeFact>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const target = element as Capturing\n let active: { readonly pointerId: number; samples: Array<Sample> } | null = null\n const offer = (fact: SwipeFact) => Queue.offerUnsafe(queue, fact)\n const sampleOf = (event: PointerLike): Sample => ({\n at: event.timeStamp,\n x: event.clientX ?? 0,\n y: event.clientY ?? 0,\n })\n const end = (event: PointerLike, completed: boolean) => {\n const pointerId = event.pointerId ?? 0\n if (active === null || active.pointerId !== pointerId) return\n const { samples } = active\n active = null\n try {\n target.releasePointerCapture?.(pointerId)\n } catch {\n // Capture may already be gone; the end is still reported.\n }\n // A lost capture or a cancel carries no place: the last move's stands.\n const last = completed ? sampleOf(event) : (samples.at(-1) ?? sampleOf(event))\n const all = completed ? [...samples, last] : samples\n const start = all[0] ?? last\n const velocity = completed ? velocityOf(all) : { x: 0, y: 0 }\n offer(\n SwipeEnded.make({\n pointerId,\n deltaX: last.x - start.x,\n deltaY: last.y - start.y,\n velocityX: velocity.x,\n velocityY: velocity.y,\n completed,\n }),\n )\n }\n const listeners: ReadonlyArray<readonly [string, (event: Event) => void]> = [\n [\n 'pointerdown',\n event => {\n const pointer = event as PointerLike\n if ((pointer.button ?? 0) !== 0 || active !== null) return\n const pointerId = pointer.pointerId ?? 0\n active = { pointerId, samples: [sampleOf(pointer)] }\n try {\n target.setPointerCapture?.(pointerId)\n } catch {\n // Without capture the move still reports while over the element.\n }\n const moved =\n measure === undefined ? element : (element.closest(measure) ?? element)\n const box = moved.getBoundingClientRect()\n offer(\n SwipeStarted.make({\n pointerId,\n pointerType: pointer.pointerType ?? 'mouse',\n width: box.width,\n height: box.height,\n }),\n )\n },\n ],\n [\n 'pointermove',\n event => {\n const pointer = event as PointerLike\n const pointerId = pointer.pointerId ?? 0\n if (active === null || active.pointerId !== pointerId) return\n const sample = sampleOf(pointer)\n const start = active.samples[0] ?? sample\n // Only what the velocity can still read, and where it began.\n active.samples = [\n start,\n ...active.samples.slice(1).filter(each => sample.at - each.at <= SWIPE_WINDOW),\n sample,\n ]\n offer(\n Swiped.make({\n pointerId,\n deltaX: sample.x - start.x,\n deltaY: sample.y - start.y,\n }),\n )\n },\n ],\n ['pointerup', event => end(event as PointerLike, true)],\n ['pointercancel', event => end(event as PointerLike, false)],\n ['lostpointercapture', event => end(event as PointerLike, false)],\n ]\n for (const [type, listener] of listeners) element.addEventListener(type, listener)\n return { listeners, current: () => active }\n }),\n ({ listeners, current }) =>\n Effect.sync(() => {\n for (const [type, listener] of listeners) element.removeEventListener(type, listener)\n const pointer = current()\n if (pointer !== null) {\n try {\n ;(element as Capturing).releasePointerCapture?.(pointer.pointerId)\n } catch {\n // Already released.\n }\n }\n }),\n ),\n ),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\nexport const ScrollSettled = Schema.TaggedStruct('ScrollSettled', {\n /** The item whose start lies nearest the scroller's start, from 0. */\n index: Schema.Number,\n})\nexport type ScrollSettled = typeof ScrollSettled.Type\n\n/** How long a scroll must be still to count as settled, where `scrollend` is missing. */\nexport const SETTLE_QUIET = 120\n\n/**\n * Hears a scroller come to rest, as a Mount: after a swipe, a fling, a\n * trackpad or a scroll a Command made, it reports which of its items starts\n * nearest its own start (inside its `scroll-padding`), the start being the\n * right edge right to left. A snapping carousel reads it as the slide shown.\n *\n * At insert it first scrolls, at once, to item `start` (the Mount's args are\n * read only then, so this is where a redrawn or restored scroller begins),\n * and reports where it lies, since a scroller drawn already at rest sends no\n * `scrollend`. It listens for `scrollend` where the browser has it, and\n * otherwise for a scroll that is quiet for `SETTLE_QUIET` milliseconds.\n */\nexport const ScrollSettle = Mount.defineStream('ScrollSettle', {\n messages: [ScrollSettled],\n args: {\n /** Which children are the items; default every child. */\n item: Schema.optional(Schema.String),\n /** Default `inline`, the row a carousel scrolls along. */\n axis: Schema.optional(Schema.Literals(['inline', 'block'])),\n /** The item to scroll to at insert; default the first, which needs no scroll. */\n start: Schema.optional(Schema.Number),\n },\n execute: ({ element, item, axis = 'inline', start = 0 }) =>\n Stream.callback<ScrollSettled>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const items = () =>\n Array.from(\n item === undefined ? element.children : element.querySelectorAll(`:scope > ${item}`),\n )\n /** How far `child`'s start lies past the scroller's start, along the axis. */\n const offsetOf = (child: Element): number => {\n const style = getComputedStyle(element)\n const box = element.getBoundingClientRect()\n const own = child.getBoundingClientRect()\n if (axis === 'block') {\n return own.top - box.top - (parseFloat(style.scrollPaddingBlockStart) || 0)\n }\n const padding = parseFloat(style.scrollPaddingInlineStart) || 0\n return style.direction === 'rtl'\n ? box.right - padding - own.right\n : own.left - box.left - padding\n }\n const report = () => {\n let nearest = -1\n let distance = Infinity\n items().forEach((child, index) => {\n const away = Math.abs(offsetOf(child))\n if (away < distance) {\n nearest = index\n distance = away\n }\n })\n if (nearest >= 0) Queue.offerUnsafe(queue, ScrollSettled.make({ index: nearest }))\n }\n const first = items()[start]\n const before = element.scrollLeft + element.scrollTop\n if (start > 0 && first !== undefined) {\n const by = offsetOf(first)\n const rtl = axis === 'inline' && getComputedStyle(element).direction === 'rtl'\n // A larger `scrollLeft` moves the content toward the start either way, so right to\n // left the way to an item's start is the other sign. To a position, not by a\n // distance: a relative scroll stops at every `scroll-snap-stop: always` on the way.\n element.scrollTo(\n axis === 'block'\n ? { top: element.scrollTop + by, behavior: 'instant' }\n : { left: element.scrollLeft + (rtl ? -by : by), behavior: 'instant' },\n )\n }\n // A scroll just made reports itself when it ends; one that moved nothing never ends.\n if (element.scrollLeft + element.scrollTop === before) report()\n let quiet: ReturnType<typeof setTimeout> | undefined\n const hasEnd = 'onscrollend' in element\n const listener = hasEnd\n ? report\n : () => {\n clearTimeout(quiet)\n quiet = setTimeout(report, SETTLE_QUIET)\n }\n const type = hasEnd ? 'scrollend' : 'scroll'\n element.addEventListener(type, listener)\n return () => {\n clearTimeout(quiet)\n element.removeEventListener(type, listener)\n }\n }),\n detach => Effect.sync(detach),\n ),\n ),\n})\n","import { Effect, Option, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/**\n * A place in an element's padding box, in CSS pixels from its top left\n * corner, and the pointer's pressure there (0 to 1; a mouse reads 0.5 while\n * a button is down). A captured pointer can be outside the box, so `x` and\n * `y` can be negative or past its size.\n */\nexport const PointerPoint = Schema.Struct({\n x: Schema.Number,\n y: Schema.Number,\n pressure: Schema.Number,\n})\nexport type PointerPoint = typeof PointerPoint.Type\n\n/** The padding box's size at the event, in CSS pixels. */\nconst Size = { width: Schema.Number, height: Schema.Number }\n\nexport const PointerPressed = Schema.TaggedStruct('PointerPressed', {\n ...Size,\n point: PointerPoint,\n /** `mouse`, `pen` or `touch`, as the browser names it. */\n pointerType: Schema.String,\n})\nexport type PointerPressed = typeof PointerPressed.Type\n\nexport const PointerMoved = Schema.TaggedStruct('PointerMoved', {\n ...Size,\n /** Where the pointer is now. */\n point: PointerPoint,\n /**\n * Every place it passed since the last move, ending with `point`: the\n * browser's coalesced events, so a fast stroke keeps its curve. Just\n * `point` where the browser coalesces none.\n */\n points: Schema.Array(PointerPoint),\n})\nexport type PointerMoved = typeof PointerMoved.Type\n\nexport const PointerReleased = Schema.TaggedStruct('PointerReleased', {\n /** `false` when the pointer was cancelled, lost its capture, or pressed again unreleased. */\n completed: Schema.Boolean,\n})\nexport type PointerReleased = typeof PointerReleased.Type\n\nexport type PointerFact = PointerPressed | PointerMoved | PointerReleased\n\ninterface Sides {\n readonly top: number\n readonly right: number\n readonly bottom: number\n readonly left: number\n}\n\nexport interface Rect {\n readonly left: number\n readonly top: number\n readonly width: number\n readonly height: number\n}\n\n/**\n * The padding box of an element whose border box is `rect`: inside its\n * border, padding included. An absolutely positioned child (a thumb, a\n * stroke) is laid out against it, so a place read here is where that child\n * sits, whatever padding a stylist adds.\n */\nexport const paddingBoxOf = (layout: { readonly rect: Rect; readonly border: Sides }): Rect => {\n const { rect, border } = layout\n return {\n left: rect.left + border.left,\n top: rect.top + border.top,\n width: Math.max(0, rect.width - border.left - border.right),\n height: Math.max(0, rect.height - border.top - border.bottom),\n }\n}\n\nconst borderOf = (style: CSSStyleDeclaration): Sides => ({\n top: parseFloat(style.borderTopWidth),\n right: parseFloat(style.borderRightWidth),\n bottom: parseFloat(style.borderBottomWidth),\n left: parseFloat(style.borderLeftWidth),\n})\n\n/**\n * An element's padding box now, in the viewport, as `PointerPosition`\n * measures it: for a size kept beside its places, which a `ResizeObserver`'s\n * content box does not match once the element has padding. Read from the\n * bounding rectangle and the computed border, since `clientWidth` and\n * `clientLeft` round to whole pixels.\n */\nexport const measurePaddingBox = (element: Element): Rect =>\n paddingBoxOf({\n rect: element.getBoundingClientRect(),\n border: borderOf(getComputedStyle(element)),\n })\n\nconst pointIn = (box: Rect, event: PointerEvent): PointerPoint => ({\n x: event.clientX - box.left,\n y: event.clientY - box.top,\n pressure: event.pressure,\n})\n\n/**\n * Where one pointer is inside an element, as a Mount, for a surface the\n * pointer draws on or points into (a color area, a dial, a signature pad): a\n * primary press, each move until the release, and the release, each with\n * the place in the element's padding box and the box's size. The box is\n * measured at each event, so an element that moved or resized is followed.\n * Coordinates are raw, left to right and top down whatever the direction:\n * what a place means (a share, an angle, a reading direction) is the parent's.\n *\n * The pointer is captured from press to release, so a drag that leaves the\n * element is still heard, and the moves and the release are listened to only\n * meanwhile. A press keeps the browser's own focus and text selection away,\n * and a second pointer while one is down is ignored.\n */\nexport const PointerPosition = Mount.defineStream('PointerPosition', {\n messages: [PointerPressed, PointerMoved, PointerReleased],\n args: {\n /**\n * A descendant to focus on a press, found by this selector (a thumb), so\n * the keys go on from where the pointer left it.\n */\n focus: Schema.optionalKey(Schema.String),\n },\n execute: ({ element, focus }) =>\n Stream.callback<PointerFact>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const offer = (fact: PointerFact) => Queue.offerUnsafe(queue, fact)\n let held: Option.Option<number> = Option.none()\n const ours = (event: Event): event is PointerEvent =>\n event instanceof PointerEvent && Option.contains(held, event.pointerId)\n\n const release = () => {\n if (Option.isNone(held)) return\n const pointerId = held.value\n held = Option.none()\n for (const [type, listener] of during) element.removeEventListener(type, listener)\n try {\n element.releasePointerCapture(pointerId)\n } catch {\n // Capture may already be gone with the pointer.\n }\n }\n const end = (completed: boolean) => (event: Event) => {\n if (!ours(event)) return\n release()\n offer(PointerReleased.make({ completed }))\n }\n const move = (event: Event) => {\n if (!ours(event)) return\n const box = measurePaddingBox(element)\n const point = pointIn(box, event)\n // Safari coalesces none and has no method for it.\n const coalesced = event.getCoalescedEvents?.() ?? []\n offer(\n PointerMoved.make({\n width: box.width,\n height: box.height,\n point,\n points: coalesced.length > 0 ? coalesced.map(one => pointIn(box, one)) : [point],\n }),\n )\n }\n const during: ReadonlyArray<readonly [string, (event: Event) => void]> = [\n ['pointermove', move],\n ['pointerup', end(true)],\n ['pointercancel', end(false)],\n ['lostpointercapture', end(false)],\n ]\n\n const down = (event: Event) => {\n if (!(event instanceof PointerEvent) || event.button !== 0) return\n if (Option.isSome(held)) {\n if (!ours(event)) return\n // The same pointer down again: its release went where nothing heard it.\n release()\n offer(PointerReleased.make({ completed: false }))\n }\n held = Option.some(event.pointerId)\n for (const [type, listener] of during) element.addEventListener(type, listener)\n try {\n element.setPointerCapture(event.pointerId)\n } catch {\n // A pointer the browser no longer tracks cannot be captured; its moves over the element still come.\n }\n // Kept from the browser's own focus and text selection, and from the mouse events a touch also sends.\n event.preventDefault()\n if (focus !== undefined) {\n const into = element.querySelector(focus)\n if (into instanceof HTMLElement) into.focus()\n }\n const box = measurePaddingBox(element)\n offer(\n PointerPressed.make({\n width: box.width,\n height: box.height,\n point: pointIn(box, event),\n pointerType: event.pointerType,\n }),\n )\n }\n element.addEventListener('pointerdown', down)\n return () => {\n element.removeEventListener('pointerdown', down)\n release()\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** The attribute on the mounted element naming the element `TrackBox` follows, by id. */\nexport const TRACK_TARGET_ATTRIBUTE = 'data-target'\n\n/** The custom properties `TrackBox` writes for `name`, as `measured` names `Measure`'s. */\nexport const trackedBox = (name: string) =>\n ({\n x: `--fk-${name}-x`,\n y: `--fk-${name}-y`,\n w: `--fk-${name}-w`,\n h: `--fk-${name}-h`,\n radius: `--fk-${name}-radius`,\n }) as const\n\n/** Sent as the followed element changes: its id, and whether it is on the page. */\nexport const TrackedTarget = Schema.TaggedStruct('TrackedTarget', {\n target: Schema.String,\n found: Schema.Boolean,\n})\nexport type TrackedTarget = typeof TrackedTarget.Type\n\n/**\n * The radius a box of `width` by `height` draws for a computed\n * `border-top-left-radius` of `value` (`8px`, `50%`, `8px 4px`): its\n * horizontal length in pixels, a share of the width for a percentage, and\n * never more than half the shorter side, where the browser stops it.\n */\nexport const cornerRadius = (value: string, width: number, height: number): number => {\n const first = value.trim().split(/\\s+/)[0] ?? ''\n const length = parseFloat(first)\n if (!Number.isFinite(length)) return 0\n const pixels = first.endsWith('%') ? (length * width) / 100 : length\n return Math.max(0, Math.min(pixels, width / 2, height / 2))\n}\n\n/**\n * Follows another element's box, as a Mount: the element whose id is the\n * mounted element's `data-target` (`TRACK_TARGET_ATTRIBUTE`). Its box in\n * viewport pixels is written on the mounted element as `--fk-<name>-x`,\n * `-y`, `-w` and `-h`, and with `radius`, its top left corner's radius as\n * `--fk-<name>-radius` (`cornerRadius`), so a fixed overlay drawn from them\n * (a tour's cutout, a coach mark's ring) sits over it. While nothing is\n * followed they are removed, so a stylist's fallbacks apply.\n *\n * The box is read again on a scroll anywhere (heard on the way down, since\n * `scroll` does not bubble), a window resize, the followed element's own\n * resize, and any change to the document's elements, which is also how a\n * target drawn anew under the same id is found. `data-target` is read again\n * whenever it changes, so one element can glide from target to target\n * without being drawn again, which a Mount's args, read once, could not do.\n * What moves the target by any other way (a stylesheet added) is seen at the\n * next of these.\n *\n * Whether a target is on the page is the parent's to act on (a tour shows\n * the step in the middle instead), so each change of the target or of\n * whether it is found sends `TrackedTarget`, starting with the first one.\n * Since it sends a Message, a component may draw it by default: a Scene test\n * resolves it with what the parent maps it to. An empty `data-target` follows\n * nothing and sends nothing.\n */\nexport const TrackBox = Mount.defineStream('TrackBox', {\n messages: [TrackedTarget],\n args: {\n /** The custom properties' prefix: `tour` writes `--fk-tour-x`. */\n name: Schema.String,\n /** Whether to write the target's corner radius too; it reads the target's computed style. */\n radius: Schema.optional(Schema.Boolean),\n },\n execute: ({ element, name, radius = false }) =>\n Stream.callback<TrackedTarget>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const document = element.ownerDocument\n const view = document.defaultView\n const properties = trackedBox(name)\n const style = element instanceof HTMLElement ? element.style : undefined\n let target: Element | null = null\n let told: TrackedTarget | undefined\n\n const place = () => {\n if (style === undefined) return\n if (target === null) {\n for (const property of Object.values(properties)) style.removeProperty(property)\n return\n }\n const box = target.getBoundingClientRect()\n style.setProperty(properties.x, `${box.left}px`)\n style.setProperty(properties.y, `${box.top}px`)\n style.setProperty(properties.w, `${box.width}px`)\n style.setProperty(properties.h, `${box.height}px`)\n if (radius) {\n const corner = getComputedStyle(target).borderTopLeftRadius\n style.setProperty(\n properties.radius,\n `${cornerRadius(corner, box.width, box.height)}px`,\n )\n }\n }\n // Looks the target up again, telling the parent when what it follows, or whether\n // that is found, changed.\n const follow = () => {\n const id = element.getAttribute(TRACK_TARGET_ATTRIBUTE) ?? ''\n const found = id === '' ? null : document.getElementById(id)\n if (found !== target) {\n if (target !== null) resized.unobserve(target)\n if (found !== null) resized.observe(found)\n target = found\n }\n place()\n if (id !== '' && (told?.target !== id || told.found !== (found !== null))) {\n told = TrackedTarget.make({ target: id, found: found !== null })\n Queue.offerUnsafe(queue, told)\n }\n }\n\n // Every observer is made before any observes, so one that throws (jsdom has no\n // ResizeObserver) leaves nothing attached.\n const resized = new ResizeObserver(place)\n const changed = new MutationObserver(follow)\n changed.observe(element, {\n attributes: true,\n attributeFilter: [TRACK_TARGET_ATTRIBUTE],\n })\n changed.observe(document, { childList: true, subtree: true })\n view?.addEventListener('scroll', place, { capture: true, passive: true })\n view?.addEventListener('resize', place)\n follow()\n return () => {\n changed.disconnect()\n resized.disconnect()\n view?.removeEventListener('scroll', place, { capture: true })\n view?.removeEventListener('resize', place)\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n"],"mappings":";;;;;;;AAGA,MAAa,UAAU,OAAO,aAAa,WAAW,CAAC,CAAC;;;;;;;;AAUxD,MAAa,YAAY,MAAM,OAAO,aAAa;CACjD,UAAU,CAAC,OAAO;CAClB,UAAU,EAAE,cACV,OAAO,WAAW;EAChB,MAAM,YAAY;EAClB,IAAI,OAAO,UAAU,UAAU,YAC5B,UAAW,MAAqB,KAAK,OAAO;EAE/C,OAAO,QAAQ,KAAK,CAAC,CAAC;CACxB,CAAC;AACL,CAAC;;;;;;;;ACdD,MAAa,mBAAmB,mBAAmB;CACjD,QAA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AAO,OAAO,MAAM,WAAW,MAAM,KAAK,WAAW,UAAU,QAAQ;IACzE,OAAO,cAAc,KAAK;KAAE,QAAQ;KAAI,OAAO,UAAU;IAAK,CAAC;IAC/D,MAAM,YAAY,OAAO,IAAI;GAC/B;EACF;EAIA,MAAM,UAAU,IAAI,eAAe,KAAK;EACxC,MAAM,UAAU,IAAI,iBAAiB,MAAM;EAC3C,QAAQ,QAAQ,SAAS;GACvB,YAAY;GACZ,iBAAiB,CAAC,sBAAsB;EAC1C,CAAC;EACD,QAAQ,QAAQ,UAAU;GAAE,WAAW;GAAM,SAAS;EAAK,CAAC;EAC5D,MAAM,iBAAiB,UAAU,OAAO;GAAE,SAAS;GAAM,SAAS;EAAK,CAAC;EACxE,MAAM,iBAAiB,UAAU,KAAK;EACtC,OAAO;EACP,aAAa;GACX,QAAQ,WAAW;GACnB,QAAQ,WAAW;GACnB,MAAM,oBAAoB,UAAU,OAAO,EAAE,SAAS,KAAK,CAAC;GAC5D,MAAM,oBAAoB,UAAU,KAAK;EAC3C;CACF,CAAC,IACD,SAAQ,OAAO,KAAK,IAAI,CAC1B,CACF;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["failMessage","failMessage","urlToString"],"sources":["../../src/dom/autofocus.ts","../../src/dom/clipboard.ts","../../src/dom/input-mask.ts","../../src/dom/keep-in-view.ts","../../src/dom/script-loader.ts","../../src/dom/share.ts","../../src/dom/measure.ts","../../src/dom/scroll.ts","../../src/dom/pointed-links.ts","../../src/dom/fluid-hover.ts","../../src/dom/keyboard-inset.ts","../../src/dom/scroll-bars.ts","../../src/dom/swipe.ts","../../src/dom/scroll-settle.ts","../../src/dom/pointer-position.ts","../../src/dom/track-box.ts"],"sourcesContent":["import { Effect, Schema } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\nexport const Focused = Schema.TaggedStruct('Focused', {})\nexport type Focused = typeof Focused.Type\n\n/**\n * Autofocus as a Mount: focuses the element on insert, then emits `Focused`.\n * The message means focus was requested — a non-focusable element or a\n * hidden tab may decline, and the browser does not report that. Plain\n * `focus()`, no scroll options: scroll behavior stays the application's\n * choice.\n */\nexport const Autofocus = Mount.define('Autofocus', {\n messages: [Focused],\n execute: ({ element }) =>\n Effect.sync(() => {\n const focusable = element as unknown as { readonly focus?: unknown }\n if (typeof focusable.focus === 'function') {\n ;(focusable.focus as () => void).call(element)\n }\n return Focused.make({})\n }),\n})\n","/**\n * The clipboard as Commands: run in `update` beside any bundle. A copy yields\n * `Copied` or `CopyFailed`, a read `Read` or `ReadFailed`. No Model involved:\n * the clipboard is not application state.\n */\nimport { Effect, Schema } from 'effect'\nimport type { Command } from 'foldkit/command'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ClipboardMessage = defineMessageUnion({\n Copied: {},\n CopyFailed: { message: Schema.String },\n})\nexport type ClipboardMessage = typeof ClipboardMessage.Type\n\nexport const ClipboardReadMessage = defineMessageUnion({\n Read: { text: Schema.String },\n ReadFailed: { message: Schema.String },\n})\nexport type ClipboardReadMessage = typeof ClipboardReadMessage.Type\n\nconst failMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error)\n\n/**\n * Copies text to the clipboard. Without a clipboard API (SSR, insecure\n * context, denied permission) the command yields `CopyFailed` instead of\n * throwing, so `update` handles both outcomes as Messages.\n */\nexport const copyText = (text: string): Command<ClipboardMessage, never, never> => ({\n name: 'Clipboard.copy',\n args: { text },\n effect:\n typeof navigator !== 'undefined' && typeof navigator.clipboard?.writeText === 'function'\n ? Effect.matchEffect(\n Effect.tryPromise({\n try: () => navigator.clipboard.writeText(text),\n catch: failMessage,\n }),\n {\n onFailure: message => Effect.succeed(ClipboardMessage.CopyFailed({ message })),\n onSuccess: () => Effect.succeed(ClipboardMessage.Copied()),\n },\n )\n : Effect.succeed(ClipboardMessage.CopyFailed({ message: 'clipboard is unavailable' })),\n})\n\n/**\n * Reads the clipboard's text. The browser may ask the user first; a refusal,\n * an insecure context or no clipboard API yields `ReadFailed`.\n */\nexport const readText = (): Command<ClipboardReadMessage, never, never> => ({\n name: 'Clipboard.read',\n effect:\n typeof navigator !== 'undefined' && typeof navigator.clipboard?.readText === 'function'\n ? Effect.matchEffect(\n Effect.tryPromise({ try: () => navigator.clipboard.readText(), catch: failMessage }),\n {\n onFailure: message => Effect.succeed(ClipboardReadMessage.ReadFailed({ message })),\n onSuccess: text => Effect.succeed(ClipboardReadMessage.Read({ text })),\n },\n )\n : Effect.succeed(ClipboardReadMessage.ReadFailed({ message: 'clipboard is unavailable' })),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** What `InputMask` reports after each edit: the masked text shown, and the characters typed. */\nexport const Input = Schema.TaggedStruct('Input', {\n value: Schema.String,\n raw: Schema.String,\n})\nexport type Input = typeof Input.Type\n\nconst isDigit = (char: string): boolean => char >= '0' && char <= '9'\nconst isLetter = (char: string): boolean =>\n (char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z')\n\nconst matches = (placeholder: string, char: string): boolean =>\n placeholder === '#'\n ? isDigit(char)\n : placeholder === 'A'\n ? isLetter(char)\n : isDigit(char) || isLetter(char)\n\nconst isPlaceholder = (char: string): boolean => char === '#' || char === 'A' || char === '*'\n\n/** Whether any placeholder at or after `from` consumes any input at or after `at`. */\nconst fillable = (pattern: string, from: number, value: string, at: number): boolean => {\n for (let i = from; i < pattern.length; i++) {\n const placeholder = pattern[i]!\n if (!isPlaceholder(placeholder)) continue\n for (let j = at; j < value.length; j++) {\n if (matches(placeholder, value[j]!)) return true\n }\n }\n return false\n}\n\n/**\n * The mask as a pure function: `#` takes a digit, `A` a letter, `*` either, and\n * any other character of the pattern is written in once input reaches past it.\n * Input that fits no placeholder is skipped. `masked` is what the field shows;\n * `raw` is only the characters typed.\n */\nexport const applyMask = (\n value: string,\n pattern: string,\n): { readonly masked: string; readonly raw: string } => {\n let masked = ''\n let raw = ''\n let at = 0\n for (let i = 0; i < pattern.length; i++) {\n const slot = pattern[i]!\n if (isPlaceholder(slot)) {\n while (at < value.length && !matches(slot, value[at]!)) at++\n if (at >= value.length) break\n masked += value[at]!\n raw += value[at]!\n at++\n } else if (fillable(pattern, i + 1, value, at)) {\n masked += slot\n } else {\n break\n }\n }\n return { masked, raw }\n}\n\ninterface MaskableField {\n value: string\n selectionStart: number | null\n addEventListener(type: string, listener: () => void): void\n removeEventListener(type: string, listener: () => void): void\n setSelectionRange?(start: number, end: number): void\n}\n\nconst asField = (element: Element): MaskableField | null => {\n const field = element as unknown as Partial<MaskableField>\n return typeof field.value === 'string' && typeof field.addEventListener === 'function'\n ? (field as MaskableField)\n : null\n}\n\n/**\n * An input mask as a Mount plus a pure mask function. The pattern language\n * is three placeholders — `#` digit, `A` letter, `*` either, all ASCII —\n * with every other character literal. Literals appear only once a later placeholder\n * consumes input, so partial values never dangle a separator. The Mount\n * rewrites the field, restores the caret approximately, and emits `Input`\n * with both the masked and raw values; the parent owns the state, like any\n * controlled input.\n */\nexport const InputMask = Mount.defineStream('InputMask', {\n messages: [Input],\n args: { pattern: Schema.String },\n execute: ({ element, pattern }) =>\n Stream.callback<typeof Input.Type>(queue =>\n Effect.gen(function* () {\n const field = asField(element)\n if (field === null) return\n const onInput = () => {\n const { masked, raw } = applyMask(field.value, pattern)\n if (masked !== field.value) {\n const caret = field.selectionStart ?? masked.length\n field.value = masked\n const at = Math.min(caret, masked.length)\n try {\n field.setSelectionRange?.(at, at)\n } catch {\n // Select-all style inputs reject ranges; the value still stands.\n }\n }\n Queue.offerUnsafe(queue, Input.make({ value: masked, raw }))\n }\n yield* Effect.acquireRelease(\n Effect.sync(() => {\n field.addEventListener('input', onInput)\n return field\n }),\n current => Effect.sync(() => current.removeEventListener('input', onInput)),\n )\n }),\n ),\n})\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/**\n * Keeps what is marked in view as a Mount: whenever an element in the mounted\n * one's subtree newly matches `selector`, such as the row just selected in a\n * list, it is scrolled into view the least amount that shows it (`nearest`).\n * The element keeps its identity and its focus: nothing is redrawn to move it.\n *\n * It watches with a `MutationObserver` for as long as it is mounted, which is as\n * long as the list or canvas that can change what is marked.\n */\nexport const KeepInView = Mount.defineStream('KeepInView', {\n messages: [Schema.Never],\n args: {\n /** What is marked, as a selector within the element: `[aria-selected=\"true\"]`. */\n selector: Schema.String,\n },\n execute: ({ element, selector }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n let marked = element.querySelector(selector)\n const observer = new MutationObserver(() => {\n const now = element.querySelector(selector)\n // Only a change of what is marked scrolls: the author's own scrolling stays.\n // A DOM with no layout (jsdom, in a test) has no scrollIntoView and nothing to scroll.\n if (now !== null && now !== marked && typeof now.scrollIntoView === 'function')\n now.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n marked = now\n })\n observer.observe(element, { subtree: true, childList: true, attributes: true })\n return observer\n }),\n observer => Effect.sync(() => observer.disconnect()),\n ),\n ),\n})\n","/**\n * Script loading as a Command: appends a `src` script to the head unless one\n * is already there. Idempotent by URL — concurrent placements collapse onto\n * the first tag instead of fetching twice. Yields `Loaded` on success and\n * `LoadFailed` otherwise (network error, no document), so `update` handles\n * both outcomes as Messages.\n */\nimport { Effect, Schema } from 'effect'\nimport type { Command } from 'foldkit/command'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ScriptMessage = defineMessageUnion({\n Loaded: {},\n LoadFailed: { message: Schema.String },\n})\nexport type ScriptMessage = typeof ScriptMessage.Type\n\nconst failMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error)\n\n// Tags still fetching, by URL: concurrent loads share one tag and its fate.\nconst inflight = new Map<string, Promise<void>>()\n\n/** Loads a script by URL, once per URL. */\nexport const loadScript = (src: string): Command<ScriptMessage, never, never> => ({\n name: 'Script.load',\n args: { src },\n effect: Effect.matchEffect(\n Effect.tryPromise({\n try: () => {\n if (typeof document === 'undefined') {\n return Promise.reject(new Error('script loading is unavailable'))\n }\n // Concurrent loads share one tag and its fate, instead of racing\n // past the presence check and fetching twice: the in-flight entry\n // is checked before presence, in the same synchronous block that\n // appends, so a second load cannot slip between them.\n const running = inflight.get(src)\n if (running !== undefined) return running\n // getAttribute, not .src: the property resolves to an absolute URL\n // and would never equal the given string.\n const present = Array.from(document.getElementsByTagName('script')).some(\n element => element.getAttribute('src') === src,\n )\n if (present) return Promise.resolve()\n const completion = new Promise<void>((resolve, reject) => {\n const element = document.createElement('script')\n element.src = src\n element.async = true\n element.onload = () => resolve()\n element.onerror = () => {\n // A dead tag must not satisfy later presence checks.\n element.remove()\n reject(new Error(`failed to load script: ${src}`))\n }\n document.head.appendChild(element)\n })\n const tracked = completion.then(\n () => {\n inflight.delete(src)\n },\n (error: unknown) => {\n inflight.delete(src)\n throw error\n },\n )\n inflight.set(src, tracked)\n return tracked\n },\n catch: (error: unknown) => error,\n }),\n {\n onFailure: error => Effect.succeed(ScriptMessage.LoadFailed({ message: failMessage(error) })),\n onSuccess: () => Effect.succeed(ScriptMessage.Loaded()),\n },\n ),\n})\n","/**\n * Web Share as a Command: runs in `update` beside any bundle, yields\n * `Shared` on success. Dismissal is its own outcome, not a failure — the\n * application tells a cancelled sheet apart from a broken one. Without a\n * share API (desktop, insecure context) it yields `ShareFailed` instead of\n * throwing, so `update` handles every outcome as a Message.\n */\nimport { Effect, Schema } from 'effect'\nimport type { Command } from 'foldkit/command'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ShareData = Schema.Struct({\n title: Schema.optional(Schema.String),\n text: Schema.optional(Schema.String),\n url: Schema.optional(Schema.String),\n})\nexport type ShareData = typeof ShareData.Type\n\nexport const ShareMessage = defineMessageUnion({\n Shared: {},\n Dismissed: {},\n ShareFailed: { message: Schema.String },\n})\nexport type ShareMessage = typeof ShareMessage.Type\n\nconst failMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error)\n\nconst isDismissal = (error: unknown): boolean =>\n typeof (error as { readonly name?: unknown } | null)?.name === 'string' &&\n (error as { readonly name: string }).name === 'AbortError'\n\n/** Shares data through the platform sheet. */\nexport const share = (data: ShareData): Command<ShareMessage, never, never> => ({\n name: 'Share.share',\n args: { data },\n effect:\n typeof navigator !== 'undefined' && typeof navigator.share === 'function'\n ? Effect.matchEffect(\n Effect.tryPromise({\n // Omit absent fields: the platform type rejects explicit\n // undefined under exactOptionalPropertyTypes.\n try: () =>\n navigator.share({\n ...(data.title !== undefined ? { title: data.title } : {}),\n ...(data.text !== undefined ? { text: data.text } : {}),\n ...(data.url !== undefined ? { url: data.url } : {}),\n }),\n catch: (error: unknown) => error,\n }),\n {\n onFailure: error =>\n Effect.succeed(\n isDismissal(error)\n ? ShareMessage.Dismissed()\n : ShareMessage.ShareFailed({ message: failMessage(error) }),\n ),\n onSuccess: () => Effect.succeed(ShareMessage.Shared()),\n },\n )\n : Effect.succeed(ShareMessage.ShareFailed({ message: 'share is unavailable' })),\n})\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** The custom properties `Measure` writes for a target named `name`. */\nexport const measured = (name: string) =>\n ({\n x: `--fk-${name}-x`,\n y: `--fk-${name}-y`,\n w: `--fk-${name}-w`,\n h: `--fk-${name}-h`,\n display: `--fk-${name}-display`,\n }) as const\n\n/**\n * Measures marked elements as a Mount, for a view to draw something over them,\n * such as an editor's selection outline, with no Message and no Model: where\n * an element is, is presentation, known to the DOM and to no transition.\n *\n * For each named target, the first element in the mounted one's subtree that\n * matches its selector is measured relative to the mounted element's scroll\n * box, which is what an absolutely placed child of it is laid out in. The\n * mounted element gets `--fk-<name>-x`, `-y`, `-w` and `-h` in pixels, and\n * `--fk-<name>-display`: `block` while a target is found, `none` while none is.\n *\n * It measures again when the subtree changes (a selection moves), in the\n * frame the change is drawn in; and, at most once a frame, when the mounted\n * element scrolls, the window resizes, the mounted element or a measured one\n * changes size, an image or a font inside loads, and on every frame of a\n * transition or an animation inside. What moves a target by any other way,\n * such as a stylesheet added that shifts it without resizing it, is seen at\n * the next of these.\n */\nexport const Measure = Mount.defineStream('Measure', {\n messages: [Schema.Never],\n args: {\n /** Each target by name, as a selector within the element: `{ selected: '[aria-selected=\"true\"]' }`. */\n targets: Schema.Record(Schema.String, Schema.String),\n },\n execute: ({ element, targets }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const container = element as HTMLElement\n const names = Object.keys(targets)\n let watched: ReadonlyArray<Element> = []\n let frame: number | undefined\n // Whether a transition or an animation may be moving something, until one frame finds none.\n let animating = false\n\n const measure = () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = undefined\n const box = container.getBoundingClientRect()\n const found: Array<Element> = []\n for (const name of names) {\n const property = measured(name)\n const target = container.querySelector(targets[name]!)\n if (target === null) {\n container.style.setProperty(property.display, 'none')\n continue\n }\n found.push(target)\n const rect = target.getBoundingClientRect()\n // Relative to the scroll box: where the content is, not where the viewport shows it.\n const x = rect.left - box.left - container.clientLeft + container.scrollLeft\n const y = rect.top - box.top - container.clientTop + container.scrollTop\n container.style.setProperty(property.x, `${x}px`)\n container.style.setProperty(property.y, `${y}px`)\n container.style.setProperty(property.w, `${rect.width}px`)\n container.style.setProperty(property.h, `${rect.height}px`)\n container.style.setProperty(property.display, 'block')\n }\n // A measured element that changes size, as an image loading does, is measured again.\n if (found.length !== watched.length || found.some((each, at) => each !== watched[at])) {\n for (const each of watched) sizes.unobserve(each)\n for (const each of found) sizes.observe(each)\n watched = found\n }\n if (animating) {\n // Asked each frame rather than counted: an element removed mid-transition ends none.\n animating = container\n .getAnimations({ subtree: true })\n .some(animation => animation.playState === 'running')\n if (animating) soon()\n }\n }\n const soon = () => {\n if (frame === undefined) frame = requestAnimationFrame(measure)\n }\n const moving = () => {\n animating = true\n soon()\n }\n\n // A change is measured as its records arrive, before the frame it is drawn in is\n // painted, so a box never shows one frame on the element it has left.\n const changes = new MutationObserver(measure)\n // Made, and the fonts listened to, before anything observes: where one is\n // missing (jsdom has neither a ResizeObserver nor `document.fonts`), the Mount\n // fails with nothing attached to call `measure`.\n const sizes = new ResizeObserver(soon)\n document.fonts.addEventListener('loadingdone', soon)\n // Its own properties change the container's style too, but writing the same\n // values again records nothing, so a measure that changed nothing rests.\n changes.observe(container, { subtree: true, childList: true, attributes: true })\n sizes.observe(container)\n container.addEventListener('scroll', soon, { passive: true })\n window.addEventListener('resize', soon)\n // `load` does not bubble, so it is caught on the way down.\n container.addEventListener('load', soon, { capture: true })\n container.addEventListener('transitionrun', moving)\n container.addEventListener('animationstart', moving)\n measure()\n return () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n changes.disconnect()\n sizes.disconnect()\n container.removeEventListener('scroll', soon)\n window.removeEventListener('resize', soon)\n container.removeEventListener('load', soon, { capture: true })\n document.fonts.removeEventListener('loadingdone', soon)\n container.removeEventListener('transitionrun', moving)\n container.removeEventListener('animationstart', moving)\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","/**\n * Where the window is scrolled, across an application's own navigations, as\n * a stream. Left to itself, a browser keeps the scroll of the entry it\n * leaves when a link pushes a new one, and on Back restores the old offset\n * before the application has drawn the entry it returns to, so the offset is\n * clamped to a page still loading. Here a pushed entry starts at the top,\n * and Back, Forward or a reload return where that entry was, once the page\n * is tall enough to hold it.\n *\n * Three rules, each found the slow way:\n *\n * 1. The offset is taken when the reader acts. The next screen is drawn\n * before a Navigate Command pushes the address, so by the time the URL\n * changes the window is already clamped to the new, shorter page. The\n * scroll is recorded at the reader's click or key (capture phase), and at\n * the start of Back and Forward, which begin in the browser before\n * anything is drawn.\n * 2. A restore holds its place while the next screen settles. A restore made\n * when the entry changes is undone by the loading state drawn right after\n * it, so the target is held on each frame for a moment, until the reader\n * scrolls, touches or types, or another navigation starts.\n * 3. Entries are keyed by the Navigation API's entry key, which a reload and\n * a full navigation keep; offsets rest in `sessionStorage`, so Back into\n * another document restores too. Where the browser has no Navigation API\n * the stream attaches nothing and leaves the browser's own behaviour\n * alone.\n *\n * Lift with `Subscription.persistentEntry`; the stream sends no Messages. Only\n * the window scrolls: a nested container is the route graph's to know, when\n * `Site.transition` arrives.\n */\nimport { Effect, Option, Stream } from 'effect'\n\n/** How `keepScroll` remembers and restores each history entry's offset. */\nexport interface KeepScrollOptions {\n /** The `sessionStorage` key holding entry offsets. Default `'foldkit:scroll'`. */\n readonly storageKey?: string | undefined\n /** Entries remembered at most: the oldest are forgotten first. Default 50. */\n readonly kept?: number | undefined\n /**\n * How long a restore holds its place while the next screen settles, in\n * milliseconds. Default 2000.\n */\n readonly patience?: number | undefined\n}\n\nconst navigationTypeOf = (event: Event): Option.Option<unknown> =>\n 'navigationType' in event ? Option.some(event.navigationType) : Option.none()\n\nconst readSaved = (storageKey: string): Map<string, number> => {\n try {\n const stored: unknown = JSON.parse(sessionStorage.getItem(storageKey) ?? '[]')\n return new Map(\n Array.isArray(stored)\n ? stored.filter(\n (pair): pair is [string, number] =>\n Array.isArray(pair) && typeof pair[0] === 'string' && typeof pair[1] === 'number',\n )\n : [],\n )\n } catch {\n // Storage blocked, or something else wrote the key: nothing is remembered.\n return new Map()\n }\n}\n\n/** Starts keeping the scroll; the release undoes everything it installed. */\nconst attach = (storageKey: string, kept: number, patience: number): (() => void) => {\n // TypeScript's DOM library declares it on every window; a browser without\n // the Navigation API has none.\n const navigation: Navigation | undefined = window.navigation\n if (navigation === undefined) return () => {}\n const restoration = window.history.scrollRestoration\n window.history.scrollRestoration = 'manual'\n const saved = readSaved(storageKey)\n const detaches: Array<() => void> = []\n const on = (target: EventTarget, type: string, listener: EventListener, capture?: boolean) => {\n target.addEventListener(type, listener, capture)\n detaches.push(() => target.removeEventListener(type, listener, capture))\n }\n const keyOf = () =>\n Option.fromNullOr(navigation.currentEntry).pipe(Option.map(entry => entry.key))\n /** Where the current entry was left, if it has been. */\n const savedHere = () => Option.flatMap(keyOf(), key => Option.fromUndefinedOr(saved.get(key)))\n const remember = () => {\n const key = keyOf()\n if (Option.isNone(key)) return\n // Moved to the end, so it is the last to be forgotten.\n saved.delete(key.value)\n saved.set(key.value, window.scrollY)\n for (const old of saved.keys()) {\n if (saved.size <= kept) break\n saved.delete(old)\n }\n }\n\n let settling = new AbortController()\n /**\n * Holds the window at `top` while the next screen settles, whenever the page\n * can hold it, until the reader scrolls, touches or types, or another\n * navigation starts.\n */\n const settle = (top: number) => {\n settling.abort()\n settling = new AbortController()\n const { signal } = settling\n for (const input of ['wheel', 'touchstart', 'keydown', 'pointerdown'])\n window.addEventListener(input, () => settling.abort(), { passive: true, signal })\n const until = performance.now() + patience\n const step = () => {\n if (signal.aborted) return\n const room = document.documentElement.scrollHeight - window.innerHeight\n if (room >= top && Math.round(window.scrollY) !== top)\n window.scrollTo({ top, behavior: 'instant' })\n if (performance.now() < until) requestAnimationFrame(step)\n else settling.abort()\n }\n step()\n }\n\n // Remembered where the reader acts, before the application does: by the time\n // it pushes an address it has drawn the next screen, and the window is\n // already clamped to it. Back and Forward start in the browser, before\n // anything is drawn, so they are remembered as they begin.\n const acted = () => remember()\n for (const input of ['click', 'keydown']) on(window, input, acted, true)\n const traversing = (event: Event) => {\n if (Option.contains(navigationTypeOf(event), 'traverse')) remember()\n }\n on(navigation, 'navigate', traversing)\n const changed = (event: Event) => {\n const type = navigationTypeOf(event)\n if (Option.contains(type, 'push')) settle(0)\n else if (Option.contains(type, 'traverse')) settle(Option.getOrElse(savedHere(), () => 0))\n // A replace is the same entry, narrowed or selected in place: it stays where it is.\n }\n on(navigation, 'currententrychange', changed)\n const hidden = () => {\n remember()\n try {\n sessionStorage.setItem(storageKey, JSON.stringify([...saved]))\n } catch {\n // Storage blocked: the next document starts at the top.\n }\n }\n on(window, 'pagehide', hidden)\n // A reload, or Back into this document from another: where this entry was.\n const here = savedHere()\n if (Option.isSome(here)) settle(here.value)\n return () => {\n settling.abort()\n for (const detach of detaches) detach()\n window.history.scrollRestoration = restoration\n }\n}\n\n/**\n * Keeps the window's scroll across same-document navigations: a pushed entry\n * starts at the top, and Back, Forward or a reload return where that entry\n * was. Without a window the stream is empty instead of throwing. Lift with\n * `Subscription.persistentEntry`; the stream sends no Messages.\n */\nexport const keepScroll = (options: KeepScrollOptions = {}): Stream.Stream<never> => {\n if (typeof window === 'undefined') return Stream.empty\n const storageKey = options.storageKey ?? 'foldkit:scroll'\n const kept = options.kept ?? 50\n const patience = options.patience ?? 2000\n return Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => attach(storageKey, kept, patience)),\n detach => Effect.sync(detach),\n ),\n )\n}\n","import { Option, Stream } from 'effect'\nimport * as Dom from 'foldkit/dom'\nimport { fromString, toString as urlToString, type Url } from 'foldkit/url'\n\n/**\n * The address of the link a reader points at or tabs to, on the page's own\n * origin: where they may go next, for a `Data.preload` before they go. Each\n * link once while they stay on it, since crossing its text sends one event\n * per element inside it. Without a document the stream is empty. Lift with\n * `Subscription.persistentEntry`, mapping each address to a Message.\n */\nexport const pointedLinks = (): Stream.Stream<Url> => {\n if (typeof document === 'undefined') return Stream.empty\n const linkOf = (event: Event): Option.Option<Url> => {\n const link = event.target instanceof Element ? event.target.closest('a[href]') : null\n return link instanceof HTMLAnchorElement && link.origin === window.location.origin\n ? fromString(link.href)\n : Option.none()\n }\n return Stream.merge(\n Dom.streamFromEventFilterMap({\n target: document,\n type: 'pointerover',\n filterMapEvent: linkOf,\n }),\n Dom.streamFromEventFilterMap({ target: document, type: 'focusin', filterMapEvent: linkOf }),\n ).pipe(Stream.changesWith((a, b) => urlToString(a) === urlToString(b)))\n}\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** The custom properties `FluidHover` writes on its container for a highlight named `name`. */\nexport const fluidHovered = (name: string) =>\n ({\n x: `--fk-${name}-x`,\n y: `--fk-${name}-y`,\n w: `--fk-${name}-w`,\n h: `--fk-${name}-h`,\n /** `1` while an item is highlighted, `0` once the pointer and focus have left. */\n shown: `--fk-${name}-shown`,\n /**\n * `0` for the frame the highlight appears in, then `1`: a highlight's\n * movement scales its duration by it, so it appears on its item rather\n * than sliding in from where it last was.\n */\n moving: `--fk-${name}-moving`,\n }) as const\n\n/**\n * The attribute `FluidHover` sets on its container, to the highlight's name,\n * while it runs: a stylist draws the highlight, and drops each item's own\n * hover, only under it.\n */\nexport const FLUID_HOVER_ATTRIBUTE = 'data-fluid-hover'\n\n/** The attribute that names, inside an item, the control a press in a gap reaches. */\nexport const FLUID_PRESS_ATTRIBUTE = 'data-fluid-press'\n\n/** The attribute on the item the highlight is shown on, for what CSS draws beside it. */\nexport const FLUID_LIT_ATTRIBUTE = 'data-fluid-lit'\n\nconst Axis = Schema.Literals(['x', 'y', 'xy'])\nexport type FluidAxis = typeof Axis.Type\n\n/** How far a point is from a rectangle along each axis: zero inside it. */\nconst gap = (low: number, high: number, at: number) => Math.max(low - at, 0, at - high)\n\n// On one axis the other only breaks ties, so a list's highlight never leaves\n// the row level with the pointer for a nearer edge of the next column.\nconst away: Record<FluidAxis, (dx: number, dy: number) => number> = {\n x: (dx, dy) => dx * 1e6 + dy,\n y: (dx, dy) => dy * 1e6 + dx,\n xy: Math.hypot,\n}\n\nconst distance = (rect: DOMRect, x: number, y: number, axis: FluidAxis) =>\n away[axis](gap(rect.left, rect.right, x), gap(rect.top, rect.bottom, y))\n\nconst isDisabled = (item: Element) =>\n item.matches('[aria-disabled=\"true\"], [data-disabled]:not([data-disabled=\"false\"]), :disabled')\n\n/**\n * One highlight that follows the pointer across a container's items, as a\n * Mount, with no Message and no Model: which item the pointer is nearest is\n * presentation, known to the DOM and to no transition.\n *\n * The item nearest the pointer is the one highlighted, so the pointer in a gap\n * between two items still points at one, and the highlight moves from item to\n * item instead of blinking off between them. On the `y` axis nearness is read\n * vertically (a list), on `x` horizontally (a strip), on `xy` both (a grid). A\n * disabled item (`aria-disabled=\"true\"`, `data-disabled`, `:disabled`) is never\n * highlighted. An item reached by the keyboard (`:focus-visible`) is\n * highlighted too; a touch highlights nothing, since there is no pointer to\n * follow before the press.\n *\n * The container gets `--fk-<name>-x`, `-y`, `-w` and `-h` in pixels, relative\n * to its scroll box like `Measure`'s, and `-shown` and `-moving` (see\n * `fluidHovered`); a view draws the highlight as an absolutely placed child\n * that reads them. With `gapClick`, a click in a gap presses the highlighted\n * item: its descendant marked `data-fluid-press`, or the item itself; with\n * `gapReach` too, only a click within that many pixels of it, as a grid of\n * cards with wide gutters wants (Fluid Functionalism's uses 16). A popup\n * measured before it has a layout box keeps its last complete place, and\n * tries again for three frames, rather than drawing the highlight at zero.\n * The item the highlight is shown on carries `data-fluid-lit`, so a style\n * can change what sits beside it (a table hides the lines around the lit\n * row).\n *\n * `follows` names the item the highlight sits on while the pointer is not\n * moving it: a menu marks the row its keys reach (`[data-active]`), and the\n * highlight goes there whenever that mark moves, so the keys and the pointer\n * light the same one. `from` names the item a fresh highlight grows out of,\n * as a tab's hover leaves the chosen tab. A highlight always fades where it\n * is: once the pointer leaves, nothing should move. It stays only for an item\n * the keyboard reached (`:focus-visible`), not one a click focused.\n */\nexport const FluidHover = Mount.defineStream('FluidHover', {\n messages: [Schema.Never],\n args: {\n /** The highlight's name, which names the custom properties. */\n name: Schema.String,\n /** The selector of an item within the container. */\n item: Schema.String,\n axis: Axis,\n gapClick: Schema.Boolean,\n /** How far from the highlighted item, in pixels, a click in a gap still presses it. */\n gapReach: Schema.optional(Schema.Number),\n /** The selector of the item the highlight sits on while the pointer is not moving it. */\n follows: Schema.optional(Schema.String),\n /** The selector of the item a fresh highlight grows out of. */\n from: Schema.optional(Schema.String),\n },\n execute: ({ element, name, item: selector, axis, gapClick, gapReach, follows, from }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const container = element as HTMLElement\n const property = fluidHovered(name)\n let active: Element | null = null\n let followed: Element | null = null\n let pointer: { readonly x: number; readonly y: number } | null = null\n let frame: number | undefined\n\n const origin = () => (from === undefined ? null : container.querySelector(from))\n let retries = 0\n const place = (at: Element | null = active) => {\n if (at === null) return\n const box = container.getBoundingClientRect()\n const rect = at.getBoundingClientRect()\n // No layout box yet (a popup still opening): keep the last place and look again.\n if (rect.width === 0 && rect.height === 0) {\n if (retries < 3) {\n retries += 1\n requestAnimationFrame(() => place(at))\n }\n return\n }\n retries = 0\n const x = rect.left - box.left - container.clientLeft + container.scrollLeft\n const y = rect.top - box.top - container.clientTop + container.scrollTop\n container.style.setProperty(property.x, `${x}px`)\n container.style.setProperty(property.y, `${y}px`)\n container.style.setProperty(property.w, `${rect.width}px`)\n container.style.setProperty(property.h, `${rect.height}px`)\n }\n /** Marks `item` as the lit one, and nothing else. */\n const light = (item: Element | null) => {\n container\n .querySelectorAll(`[${FLUID_LIT_ATTRIBUTE}]`)\n .forEach(each => each !== item && each.removeAttribute(FLUID_LIT_ATTRIBUTE))\n item?.setAttribute(FLUID_LIT_ATTRIBUTE, '')\n }\n const show = (next: Element) => {\n const appearing = container.style.getPropertyValue(property.shown) !== '1'\n active = next\n light(next)\n const grows = appearing ? origin() : null\n if (appearing) container.style.setProperty(property.moving, '0')\n if (grows === null) {\n place()\n container.style.setProperty(property.shown, '1')\n } else {\n // Drawn first where it grows from, then moved: it travels out of that item.\n place(grows)\n requestAnimationFrame(() => {\n if (active !== next) return\n place()\n container.style.setProperty(property.shown, '1')\n })\n }\n if (appearing) {\n // The frame after: by then the jump to the item has been drawn without moving.\n requestAnimationFrame(() => container.style.setProperty(property.moving, '1'))\n }\n }\n const hide = () => {\n container.style.setProperty(property.shown, '0')\n light(null)\n }\n /** Whether the keyboard has an item focused, which the highlight then stays on. */\n const keyed = () => {\n const focused = document.activeElement\n return (\n focused !== null && container.contains(focused) && focused.matches(':focus-visible')\n )\n }\n const nearest = (x: number, y: number) => {\n let best: Element | null = null\n let bestDistance = Infinity\n for (const each of Array.from(container.querySelectorAll(selector))) {\n if (isDisabled(each)) continue\n const far = distance(each.getBoundingClientRect(), x, y, axis)\n if (far < bestDistance) {\n best = each\n bestDistance = far\n }\n }\n return best\n }\n const follow = () => {\n frame = undefined\n if (pointer === null) return\n const next = nearest(pointer.x, pointer.y)\n if (next === null) hide()\n else if (next !== active || container.style.getPropertyValue(property.shown) !== '1')\n show(next)\n }\n\n const move = (event: PointerEvent) => {\n if (event.pointerType === 'touch') return\n pointer = { x: event.clientX, y: event.clientY }\n if (frame === undefined) frame = requestAnimationFrame(follow)\n }\n const leave = () => {\n pointer = null\n if (!keyed()) hide()\n }\n const focus = (event: FocusEvent) => {\n if (!(event.target instanceof Element) || !event.target.matches(':focus-visible')) {\n return\n }\n const owner = event.target.closest(selector)\n if (owner !== null && container.contains(owner) && !isDisabled(owner)) show(owner)\n }\n const blur = (event: FocusEvent) => {\n const to = event.relatedTarget\n if (pointer === null && !(to instanceof Node && container.contains(to))) hide()\n }\n const click = (event: MouseEvent) => {\n if (!gapClick || active === null) return\n if (container.style.getPropertyValue(property.shown) !== '1') return\n const target = event.target\n if (!(target instanceof Element) || target.closest(selector) !== null) return\n const reach = distance(\n active.getBoundingClientRect(),\n event.clientX,\n event.clientY,\n 'xy',\n )\n if (gapReach !== undefined && reach > gapReach) return\n const press = active.querySelector(`[${FLUID_PRESS_ATTRIBUTE}]`) ?? active\n if (press instanceof HTMLElement) press.click()\n }\n const soon = () => {\n if (active !== null) requestAnimationFrame(() => place())\n }\n /** The marked item moved: the highlight goes with it, or fades if it is gone. */\n const marked = () => {\n if (follows === undefined) return\n const next = container.querySelector(follows)\n if (next === followed) return\n followed = next\n if (next !== null && !isDisabled(next)) show(next)\n else if (pointer === null && !keyed()) hide()\n }\n\n // Where there is no layout (jsdom has no ResizeObserver) nothing moves to\n // follow, and a view drawn there is no worse for the highlight's absence.\n const sizes = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(soon)\n const marks = follows === undefined ? undefined : new MutationObserver(marked)\n sizes?.observe(container)\n marks?.observe(container, { subtree: true, childList: true, attributes: true })\n container.addEventListener('pointermove', move, { passive: true })\n container.addEventListener('pointerleave', leave)\n container.addEventListener('focusin', focus)\n container.addEventListener('focusout', blur)\n container.addEventListener('click', click)\n container.addEventListener('scroll', soon, { passive: true })\n window.addEventListener('resize', soon)\n container.style.setProperty(property.shown, '0')\n container.setAttribute(FLUID_HOVER_ATTRIBUTE, name)\n marked()\n return () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n sizes?.disconnect()\n marks?.disconnect()\n container.removeAttribute(FLUID_HOVER_ATTRIBUTE)\n light(null)\n container.removeEventListener('pointermove', move)\n container.removeEventListener('pointerleave', leave)\n container.removeEventListener('focusin', focus)\n container.removeEventListener('focusout', blur)\n container.removeEventListener('click', click)\n container.removeEventListener('scroll', soon)\n window.removeEventListener('resize', soon)\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/**\n * The custom property `KeyboardInset` writes on its element: how much of the layout\n * viewport's bottom the on-screen keyboard (or anything else the visual viewport leaves\n * out) covers, in pixels.\n */\nexport const KEYBOARD_INSET = '--fk-keyboard-inset'\n\n/**\n * The part of the layout viewport's height below the visual viewport: what the on-screen\n * keyboard covers. Rounded down, since a fraction of a pixel of zoom is no keyboard.\n */\nexport const keyboardInset = (view: {\n readonly innerHeight: number\n readonly visualViewport: { readonly height: number; readonly offsetTop: number } | null\n}): number =>\n view.visualViewport === null\n ? 0\n : Math.max(\n 0,\n Math.floor(view.innerHeight - view.visualViewport.height - view.visualViewport.offsetTop),\n )\n\n/**\n * The on-screen keyboard's height as a Mount, with no Message and no Model: where it is\n * is the browser's. iOS Safari, and Chrome on Android unless the page asks otherwise,\n * leave the layout viewport as it is when the keyboard opens, so a panel fixed to the\n * screen keeps its height and its bottom under the keys. This writes `KEYBOARD_INSET` on\n * the element, from the visual viewport's size and scroll, for a style to pad or shrink by\n * (`var(--fk-keyboard-inset, 0px)`), and removes it when the element goes. Where there is\n * no visual viewport it writes nothing.\n */\nexport const KeyboardInset = Mount.defineStream('KeyboardInset', {\n messages: [Schema.Never],\n args: {},\n execute: ({ element }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const view = element.ownerDocument.defaultView\n const viewport = view?.visualViewport\n if (\n !(element instanceof HTMLElement) ||\n view === null ||\n view === undefined ||\n viewport === null ||\n viewport === undefined\n ) {\n return () => {}\n }\n const target = element\n const measure = () => target.style.setProperty(KEYBOARD_INSET, `${keyboardInset(view)}px`)\n measure()\n viewport.addEventListener('resize', measure)\n viewport.addEventListener('scroll', measure)\n return () => {\n viewport.removeEventListener('resize', measure)\n viewport.removeEventListener('scroll', measure)\n target.style.removeProperty(KEYBOARD_INSET)\n }\n }),\n release => Effect.sync(release),\n ),\n ),\n})\n","import { Effect, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/**\n * The attribute that marks a bar beside a scroller `ScrollBars` runs on, set\n * to the axis it shows: `block` (the up-and-down bar) or `inline`.\n */\nexport const SCROLL_BAR_ATTRIBUTE = 'data-scroll-bar'\n\n/**\n * The attribute `ScrollBars` sets on its scroller while it draws the bars, so a\n * style hides the native bar only then: with no Mount running (a coarse\n * pointer, a page not yet hydrated) the browser's bar stays.\n */\nexport const SCROLL_OVERLAID_ATTRIBUTE = 'data-scroll-overlaid'\n\n/**\n * The custom properties `ScrollBars` writes on each bar, in pixels, for its\n * thumb to read: how far along the bar the thumb starts, and how long it is.\n * Physical: an inline bar's offset is from its left edge in either direction.\n */\nexport const scrollThumb = {\n offset: '--fk-scroll-thumb-offset',\n size: '--fk-scroll-thumb-size',\n} as const\n\n/** The shortest a thumb is drawn, however long the content, so it stays a target. */\nconst SHORTEST = 20\n\nconst FINE_POINTER = '(hover: hover) and (pointer: fine)'\n\ntype Axis = 'block' | 'inline'\n\n/**\n * An overlay scrollbar as a Mount, with no Message and no Model: where a\n * scroller is scrolled is the browser's, and the bar only shows it.\n *\n * It runs on the scroller (or on an element holding it, named by `scroller`,\n * when the scroller carries another Mount) and drives the bars drawn beside\n * it: the scroller's parent's children marked `data-scroll-bar` (`block` or\n * `inline`), which a style lays over the scroller's edge. Each bar gets `data-scrollable` while its axis has\n * more to scroll, `data-shown` while the scroller scrolls or the pointer moves\n * over it, until `idle` milliseconds pass with neither (or longer, while the\n * pointer rests on a bar), and `data-dragging` while its thumb is dragged; and\n * `--fk-scroll-thumb-offset` and `-size` (see `scrollThumb`). Pressing a bar\n * off its thumb moves the thumb there, then drags it.\n *\n * It does nothing where the primary pointer is coarse or cannot hover, decided\n * when it mounts: touch keeps the browser's bar and its physics. Otherwise the\n * scroller gets `data-scroll-overlaid`, for a style to hide the native bar.\n * How the bar looks, rests, widens and fades is the style's.\n */\nexport const ScrollBars = Mount.defineStream('ScrollBars', {\n messages: [Schema.Never],\n args: {\n /** How long, in milliseconds, the bars stay after the last scroll or move. Default 600. */\n idle: Schema.optional(Schema.Number),\n /**\n * The scroller, as a selector within the element, when it cannot hold this\n * Mount itself (another component's, with a Mount of its own); looked for\n * once, when it mounts. Default: the element is the scroller.\n */\n scroller: Schema.optional(Schema.String),\n },\n execute: ({ element, idle = 600, scroller: within }) =>\n Stream.callback<never>(() =>\n Effect.acquireRelease(\n Effect.sync(() => {\n if (typeof matchMedia !== 'function' || !matchMedia(FINE_POINTER).matches) {\n return () => {}\n }\n const found = within === undefined ? element : element.querySelector(within)\n if (!(found instanceof HTMLElement)) return () => {}\n const scroller = found\n const area = scroller.parentElement\n if (area === null) return () => {}\n\n const isBar = (child: Element): child is HTMLElement =>\n child instanceof HTMLElement && child.hasAttribute(SCROLL_BAR_ATTRIBUTE)\n /** Looked for at each use, so a redraw that replaced a bar is followed. */\n const bars = () => Array.from(area.children).filter(isBar)\n const axisOf = (bar: HTMLElement): Axis =>\n bar.getAttribute(SCROLL_BAR_ATTRIBUTE) === 'inline' ? 'inline' : 'block'\n\n /** The scroller along one axis, with the start measured from the top or the left. */\n const extent = (axis: Axis) => {\n if (axis === 'block') {\n return {\n view: scroller.clientHeight,\n content: scroller.scrollHeight,\n start: scroller.scrollTop,\n }\n }\n const room = scroller.scrollWidth - scroller.clientWidth\n // A right-to-left scroller counts from 0 at the right down to minus its room.\n const rtl = getComputedStyle(scroller).direction === 'rtl'\n return {\n view: scroller.clientWidth,\n content: scroller.scrollWidth,\n start: rtl ? room + scroller.scrollLeft : scroller.scrollLeft,\n }\n }\n const scrollTo = (axis: Axis, start: number) => {\n if (axis === 'block') {\n scroller.scrollTop = start\n return\n }\n const room = scroller.scrollWidth - scroller.clientWidth\n const rtl = getComputedStyle(scroller).direction === 'rtl'\n scroller.scrollLeft = rtl ? start - room : start\n }\n const trackOf = (bar: HTMLElement, axis: Axis) =>\n axis === 'block' ? bar.clientHeight : bar.clientWidth\n /** Where the thumb is along its bar, or nothing while the axis has nothing to scroll. */\n const thumbOf = (bar: HTMLElement, axis: Axis) => {\n const { view, content, start } = extent(axis)\n const track = trackOf(bar, axis)\n if (content - view < 1 || track <= 0) return null\n const size = Math.min(track, Math.max(SHORTEST, (track * view) / content))\n const offset = ((track - size) * start) / (content - view)\n return { track, size, offset, room: content - view }\n }\n const set = (bar: HTMLElement, name: string, value: string) => {\n if (bar.style.getPropertyValue(name) !== value) bar.style.setProperty(name, value)\n }\n const mark = (bar: HTMLElement, name: string, on: boolean) => {\n if (bar.hasAttribute(name) !== on) bar.toggleAttribute(name, on)\n }\n\n let frame: number | undefined\n const update = () => {\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = undefined\n for (const bar of bars()) {\n const axis = axisOf(bar)\n const { view, content } = extent(axis)\n // Marked first: a style draws no bar until it is, so it has no length before.\n mark(bar, 'data-scrollable', content - view >= 1)\n const thumb = thumbOf(bar, axis)\n if (thumb === null) continue\n set(bar, scrollThumb.offset, `${thumb.offset}px`)\n set(bar, scrollThumb.size, `${thumb.size}px`)\n }\n }\n const soon = () => {\n if (frame === undefined) frame = requestAnimationFrame(update)\n }\n\n let hiding: ReturnType<typeof setTimeout> | undefined\n let resting: HTMLElement | null = null\n /** Ends the drag under way, if one is. */\n let dragging: (() => void) | null = null\n const hide = () => {\n hiding = undefined\n // A bar the pointer rests on, or one being dragged, stays until it is left.\n if (resting !== null || dragging !== null) return\n for (const bar of bars()) mark(bar, 'data-shown', false)\n }\n const show = () => {\n for (const bar of bars()) mark(bar, 'data-shown', true)\n if (hiding !== undefined) clearTimeout(hiding)\n hiding = setTimeout(hide, idle)\n }\n\n const scrolled = () => {\n update()\n show()\n }\n // Listened to only while the pointer is over the area.\n const moved = (event: PointerEvent) => {\n if (event.pointerType !== 'touch') show()\n }\n const entered = (event: PointerEvent) => {\n if (event.pointerType === 'touch') return\n area.addEventListener('pointermove', moved, { passive: true })\n show()\n }\n const left = () => {\n area.removeEventListener('pointermove', moved)\n resting = null\n // A hide that came while the pointer rested on a bar waited for this.\n if (hiding === undefined) hiding = setTimeout(hide, idle)\n }\n const over = (event: PointerEvent) => {\n const target = event.target\n resting =\n target instanceof Element ? (bars().find(bar => bar.contains(target)) ?? null) : null\n }\n\n const pressed = (event: PointerEvent) => {\n if (event.button !== 0 || event.pointerType === 'touch' || dragging !== null) return\n const target = event.target\n if (!(target instanceof Element)) return\n const bar = bars().find(each => each.contains(target))\n if (bar === undefined) return\n const axis = axisOf(bar)\n const thumb = thumbOf(bar, axis)\n if (thumb === null) return\n // The bar takes the press: no text selected, no focus moved off the scroller.\n event.preventDefault()\n const along = (at: PointerEvent) => {\n const box = bar.getBoundingClientRect()\n return axis === 'block'\n ? at.clientY - box.top - bar.clientTop\n : at.clientX - box.left - bar.clientLeft\n }\n const at = along(event)\n const onThumb = at >= thumb.offset && at <= thumb.offset + thumb.size\n // Held where it was taken, or by its middle when the press jumped it there.\n const grab = onThumb ? at - thumb.offset : thumb.size / 2\n const follow = (to: PointerEvent) => {\n const current = thumbOf(bar, axis)\n if (current === null) return\n const offset = Math.min(Math.max(along(to) - grab, 0), current.track - current.size)\n scrollTo(axis, (offset / (current.track - current.size)) * current.room)\n }\n const id = event.pointerId\n const move = (to: PointerEvent) => {\n if (to.pointerId === id) follow(to)\n }\n const end = (to: PointerEvent) => {\n if (to.pointerId === id) stop()\n }\n // On the document, for the drag alone: the pointer leaves the bar as it drags.\n const owner = bar.ownerDocument\n const stop = () => {\n owner.removeEventListener('pointermove', move)\n owner.removeEventListener('pointerup', end)\n owner.removeEventListener('pointercancel', end)\n mark(bar, 'data-dragging', false)\n dragging = null\n show()\n }\n owner.addEventListener('pointermove', move)\n owner.addEventListener('pointerup', end)\n owner.addEventListener('pointercancel', end)\n mark(bar, 'data-dragging', true)\n dragging = stop\n show()\n if (!onThumb) follow(event)\n }\n\n // Both made before anything observes: where one is missing, the Mount\n // fails with nothing attached.\n const sizes = new ResizeObserver(soon)\n // The content's size moves the thumb as much as the scroller's, so each\n // child of the scroller is watched, and each bar for its track. Only what\n // a change added or removed is watched or let go: a virtual list swaps\n // a row or two each frame it scrolls, out of many.\n const changes = new MutationObserver(records => {\n for (const record of records) {\n for (const node of Array.from(record.removedNodes)) {\n if (node instanceof Element) sizes.unobserve(node)\n }\n for (const node of Array.from(record.addedNodes)) {\n if (node instanceof Element && (record.target === scroller || isBar(node))) {\n sizes.observe(node)\n }\n }\n }\n soon()\n })\n sizes.observe(scroller)\n for (const child of Array.from(scroller.children)) sizes.observe(child)\n for (const bar of bars()) sizes.observe(bar)\n changes.observe(scroller, { childList: true })\n changes.observe(area, { childList: true })\n scroller.addEventListener('scroll', scrolled, { passive: true })\n area.addEventListener('pointerenter', entered)\n area.addEventListener('pointerleave', left)\n area.addEventListener('pointerover', over)\n area.addEventListener('pointerdown', pressed)\n scroller.setAttribute(SCROLL_OVERLAID_ATTRIBUTE, '')\n update()\n return () => {\n // Ended first: ending a drag shows the bars, which sets a hide to clear.\n dragging?.()\n if (frame !== undefined) cancelAnimationFrame(frame)\n if (hiding !== undefined) clearTimeout(hiding)\n sizes.disconnect()\n changes.disconnect()\n scroller.removeEventListener('scroll', scrolled)\n area.removeEventListener('pointerenter', entered)\n area.removeEventListener('pointerleave', left)\n area.removeEventListener('pointerover', over)\n area.removeEventListener('pointerdown', pressed)\n area.removeEventListener('pointermove', moved)\n scroller.removeAttribute(SCROLL_OVERLAID_ATTRIBUTE)\n for (const bar of bars()) {\n for (const name of ['data-scrollable', 'data-shown', 'data-dragging'])\n bar.removeAttribute(name)\n bar.style.removeProperty(scrollThumb.offset)\n bar.style.removeProperty(scrollThumb.size)\n }\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\nexport const SwipeStarted = Schema.TaggedStruct('SwipeStarted', {\n pointerId: Schema.Number,\n pointerType: Schema.String,\n /** The border box of what `measure` names (the element itself by default), as the swipe starts. */\n width: Schema.Number,\n height: Schema.Number,\n})\nexport type SwipeStarted = typeof SwipeStarted.Type\n\nexport const Swiped = Schema.TaggedStruct('Swiped', {\n pointerId: Schema.Number,\n /** From where the pointer went down, in CSS pixels. */\n deltaX: Schema.Number,\n deltaY: Schema.Number,\n})\nexport type Swiped = typeof Swiped.Type\n\nexport const SwipeEnded = Schema.TaggedStruct('SwipeEnded', {\n pointerId: Schema.Number,\n /** From where the pointer went down to where it came up, in CSS pixels. */\n deltaX: Schema.Number,\n deltaY: Schema.Number,\n /**\n * How fast the pointer was moving as it came up, in pixels a millisecond,\n * over the last `SWIPE_WINDOW` milliseconds: 0 when it rested there first.\n */\n velocityX: Schema.Number,\n velocityY: Schema.Number,\n /** `false` when the pointer was cancelled or capture was lost. */\n completed: Schema.Boolean,\n})\nexport type SwipeEnded = typeof SwipeEnded.Type\n\nexport type SwipeFact = SwipeStarted | Swiped | SwipeEnded\n\n/** How far back, in milliseconds, the release velocity looks. */\nexport const SWIPE_WINDOW = 100\n\ntype PointerLike = Event & {\n readonly pointerId?: number\n readonly button?: number\n readonly pointerType?: string\n readonly clientX?: number\n readonly clientY?: number\n}\n\ntype Capturing = Element & {\n setPointerCapture?: (pointerId: number) => void\n releasePointerCapture?: (pointerId: number) => void\n}\n\ninterface Sample {\n readonly at: number\n readonly x: number\n readonly y: number\n}\n\n/**\n * The velocity of the samples within `SWIPE_WINDOW` of the last: the way\n * from the oldest of them to the last over the time between. A pointer that\n * came to rest before the last sample has no recent way to measure, so 0.\n */\nexport const velocityOf = (samples: ReadonlyArray<Sample>): { x: number; y: number } => {\n const last = samples.at(-1)\n if (last === undefined) return { x: 0, y: 0 }\n const first = samples.find(sample => last.at - sample.at <= SWIPE_WINDOW) ?? last\n const elapsed = last.at - first.at\n return elapsed <= 0\n ? { x: 0, y: 0 }\n : { x: (last.x - first.x) / elapsed, y: (last.y - first.y) / elapsed }\n}\n\n/**\n * `Move` with the speed of its release, for a gesture that a flick ends\n * (a sheet dragged to dismiss, a card swiped away): a primary-button pointer\n * down captures the pointer, each move reports the delta from where it\n * started, and up reports the last delta with the velocity over the last\n * `SWIPE_WINDOW` milliseconds, by the events' own time stamps. Cancel or\n * lost capture ends it incomplete. The start reports the size of what is\n * moved, so a distance can be read as a share of it. What a delta or a speed\n * means is the parent's `update`. Capture is released with the Mount.\n */\nexport const Swipe = Mount.defineStream('Swipe', {\n messages: [SwipeStarted, Swiped, SwipeEnded],\n args: {\n /**\n * The nearest ancestor matching this selector is measured as the swipe\n * starts, for what the swipe moves (a sheet's panel, dragged by its\n * handle). Default: the element itself.\n */\n measure: Schema.optional(Schema.String),\n },\n execute: ({ element, measure }) =>\n Stream.callback<SwipeFact>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const target = element as Capturing\n let active: { readonly pointerId: number; samples: Array<Sample> } | null = null\n const offer = (fact: SwipeFact) => Queue.offerUnsafe(queue, fact)\n const sampleOf = (event: PointerLike): Sample => ({\n at: event.timeStamp,\n x: event.clientX ?? 0,\n y: event.clientY ?? 0,\n })\n const end = (event: PointerLike, completed: boolean) => {\n const pointerId = event.pointerId ?? 0\n if (active === null || active.pointerId !== pointerId) return\n const { samples } = active\n active = null\n try {\n target.releasePointerCapture?.(pointerId)\n } catch {\n // Capture may already be gone; the end is still reported.\n }\n // A lost capture or a cancel carries no place: the last move's stands.\n const last = completed ? sampleOf(event) : (samples.at(-1) ?? sampleOf(event))\n const all = completed ? [...samples, last] : samples\n const start = all[0] ?? last\n const velocity = completed ? velocityOf(all) : { x: 0, y: 0 }\n offer(\n SwipeEnded.make({\n pointerId,\n deltaX: last.x - start.x,\n deltaY: last.y - start.y,\n velocityX: velocity.x,\n velocityY: velocity.y,\n completed,\n }),\n )\n }\n const listeners: ReadonlyArray<readonly [string, (event: Event) => void]> = [\n [\n 'pointerdown',\n event => {\n const pointer = event as PointerLike\n if ((pointer.button ?? 0) !== 0 || active !== null) return\n const pointerId = pointer.pointerId ?? 0\n active = { pointerId, samples: [sampleOf(pointer)] }\n try {\n target.setPointerCapture?.(pointerId)\n } catch {\n // Without capture the move still reports while over the element.\n }\n const moved =\n measure === undefined ? element : (element.closest(measure) ?? element)\n const box = moved.getBoundingClientRect()\n offer(\n SwipeStarted.make({\n pointerId,\n pointerType: pointer.pointerType ?? 'mouse',\n width: box.width,\n height: box.height,\n }),\n )\n },\n ],\n [\n 'pointermove',\n event => {\n const pointer = event as PointerLike\n const pointerId = pointer.pointerId ?? 0\n if (active === null || active.pointerId !== pointerId) return\n const sample = sampleOf(pointer)\n const start = active.samples[0] ?? sample\n // Only what the velocity can still read, and where it began.\n active.samples = [\n start,\n ...active.samples.slice(1).filter(each => sample.at - each.at <= SWIPE_WINDOW),\n sample,\n ]\n offer(\n Swiped.make({\n pointerId,\n deltaX: sample.x - start.x,\n deltaY: sample.y - start.y,\n }),\n )\n },\n ],\n ['pointerup', event => end(event as PointerLike, true)],\n ['pointercancel', event => end(event as PointerLike, false)],\n ['lostpointercapture', event => end(event as PointerLike, false)],\n ]\n for (const [type, listener] of listeners) element.addEventListener(type, listener)\n return { listeners, current: () => active }\n }),\n ({ listeners, current }) =>\n Effect.sync(() => {\n for (const [type, listener] of listeners) element.removeEventListener(type, listener)\n const pointer = current()\n if (pointer !== null) {\n try {\n ;(element as Capturing).releasePointerCapture?.(pointer.pointerId)\n } catch {\n // Already released.\n }\n }\n }),\n ),\n ),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\nexport const ScrollSettled = Schema.TaggedStruct('ScrollSettled', {\n /** The item whose start lies nearest the scroller's start, from 0. */\n index: Schema.Number,\n})\nexport type ScrollSettled = typeof ScrollSettled.Type\n\n/** How long a scroll must be still to count as settled, where `scrollend` is missing. */\nexport const SETTLE_QUIET = 120\n\n/**\n * Hears a scroller come to rest, as a Mount: after a swipe, a fling, a\n * trackpad or a scroll a Command made, it reports which of its items starts\n * nearest its own start (inside its `scroll-padding`), the start being the\n * right edge right to left. A snapping carousel reads it as the slide shown.\n *\n * At insert it first scrolls, at once, to item `start` (the Mount's args are\n * read only then, so this is where a redrawn or restored scroller begins),\n * and reports where it lies, since a scroller drawn already at rest sends no\n * `scrollend`. It listens for `scrollend` where the browser has it, and\n * otherwise for a scroll that is quiet for `SETTLE_QUIET` milliseconds.\n */\nexport const ScrollSettle = Mount.defineStream('ScrollSettle', {\n messages: [ScrollSettled],\n args: {\n /** Which children are the items; default every child. */\n item: Schema.optional(Schema.String),\n /** Default `inline`, the row a carousel scrolls along. */\n axis: Schema.optional(Schema.Literals(['inline', 'block'])),\n /** The item to scroll to at insert; default the first, which needs no scroll. */\n start: Schema.optional(Schema.Number),\n },\n execute: ({ element, item, axis = 'inline', start = 0 }) =>\n Stream.callback<ScrollSettled>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const items = () =>\n Array.from(\n item === undefined ? element.children : element.querySelectorAll(`:scope > ${item}`),\n )\n /** How far `child`'s start lies past the scroller's start, along the axis. */\n const offsetOf = (child: Element): number => {\n const style = getComputedStyle(element)\n const box = element.getBoundingClientRect()\n const own = child.getBoundingClientRect()\n if (axis === 'block') {\n return own.top - box.top - (parseFloat(style.scrollPaddingBlockStart) || 0)\n }\n const padding = parseFloat(style.scrollPaddingInlineStart) || 0\n return style.direction === 'rtl'\n ? box.right - padding - own.right\n : own.left - box.left - padding\n }\n const report = () => {\n let nearest = -1\n let distance = Infinity\n items().forEach((child, index) => {\n const away = Math.abs(offsetOf(child))\n if (away < distance) {\n nearest = index\n distance = away\n }\n })\n if (nearest >= 0) Queue.offerUnsafe(queue, ScrollSettled.make({ index: nearest }))\n }\n const first = items()[start]\n const before = element.scrollLeft + element.scrollTop\n if (start > 0 && first !== undefined) {\n const by = offsetOf(first)\n const rtl = axis === 'inline' && getComputedStyle(element).direction === 'rtl'\n // A larger `scrollLeft` moves the content toward the start either way, so right to\n // left the way to an item's start is the other sign. To a position, not by a\n // distance: a relative scroll stops at every `scroll-snap-stop: always` on the way.\n element.scrollTo(\n axis === 'block'\n ? { top: element.scrollTop + by, behavior: 'instant' }\n : { left: element.scrollLeft + (rtl ? -by : by), behavior: 'instant' },\n )\n }\n // A scroll just made reports itself when it ends; one that moved nothing never ends.\n if (element.scrollLeft + element.scrollTop === before) report()\n let quiet: ReturnType<typeof setTimeout> | undefined\n const hasEnd = 'onscrollend' in element\n const listener = hasEnd\n ? report\n : () => {\n clearTimeout(quiet)\n quiet = setTimeout(report, SETTLE_QUIET)\n }\n const type = hasEnd ? 'scrollend' : 'scroll'\n element.addEventListener(type, listener)\n return () => {\n clearTimeout(quiet)\n element.removeEventListener(type, listener)\n }\n }),\n detach => Effect.sync(detach),\n ),\n ),\n})\n","import { Effect, Option, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/**\n * A place in an element's padding box, in CSS pixels from its top left\n * corner, and the pointer's pressure there (0 to 1; a mouse reads 0.5 while\n * a button is down). A captured pointer can be outside the box, so `x` and\n * `y` can be negative or past its size.\n */\nexport const PointerPoint = Schema.Struct({\n x: Schema.Number,\n y: Schema.Number,\n pressure: Schema.Number,\n})\nexport type PointerPoint = typeof PointerPoint.Type\n\n/** The padding box's size at the event, in CSS pixels. */\nconst Size = { width: Schema.Number, height: Schema.Number }\n\nexport const PointerPressed = Schema.TaggedStruct('PointerPressed', {\n ...Size,\n point: PointerPoint,\n /** `mouse`, `pen` or `touch`, as the browser names it. */\n pointerType: Schema.String,\n})\nexport type PointerPressed = typeof PointerPressed.Type\n\nexport const PointerMoved = Schema.TaggedStruct('PointerMoved', {\n ...Size,\n /** Where the pointer is now. */\n point: PointerPoint,\n /**\n * Every place it passed since the last move, ending with `point`: the\n * browser's coalesced events, so a fast stroke keeps its curve. Just\n * `point` where the browser coalesces none.\n */\n points: Schema.Array(PointerPoint),\n})\nexport type PointerMoved = typeof PointerMoved.Type\n\nexport const PointerReleased = Schema.TaggedStruct('PointerReleased', {\n /** `false` when the pointer was cancelled, lost its capture, or pressed again unreleased. */\n completed: Schema.Boolean,\n})\nexport type PointerReleased = typeof PointerReleased.Type\n\nexport type PointerFact = PointerPressed | PointerMoved | PointerReleased\n\ninterface Sides {\n readonly top: number\n readonly right: number\n readonly bottom: number\n readonly left: number\n}\n\nexport interface Rect {\n readonly left: number\n readonly top: number\n readonly width: number\n readonly height: number\n}\n\n/**\n * The padding box of an element whose border box is `rect`: inside its\n * border, padding included. An absolutely positioned child (a thumb, a\n * stroke) is laid out against it, so a place read here is where that child\n * sits, whatever padding a stylist adds.\n */\nexport const paddingBoxOf = (layout: { readonly rect: Rect; readonly border: Sides }): Rect => {\n const { rect, border } = layout\n return {\n left: rect.left + border.left,\n top: rect.top + border.top,\n width: Math.max(0, rect.width - border.left - border.right),\n height: Math.max(0, rect.height - border.top - border.bottom),\n }\n}\n\nconst borderOf = (style: CSSStyleDeclaration): Sides => ({\n top: parseFloat(style.borderTopWidth),\n right: parseFloat(style.borderRightWidth),\n bottom: parseFloat(style.borderBottomWidth),\n left: parseFloat(style.borderLeftWidth),\n})\n\n/**\n * An element's padding box now, in the viewport, as `PointerPosition`\n * measures it: for a size kept beside its places, which a `ResizeObserver`'s\n * content box does not match once the element has padding. Read from the\n * bounding rectangle and the computed border, since `clientWidth` and\n * `clientLeft` round to whole pixels.\n */\nexport const measurePaddingBox = (element: Element): Rect =>\n paddingBoxOf({\n rect: element.getBoundingClientRect(),\n border: borderOf(getComputedStyle(element)),\n })\n\nconst pointIn = (box: Rect, event: PointerEvent): PointerPoint => ({\n x: event.clientX - box.left,\n y: event.clientY - box.top,\n pressure: event.pressure,\n})\n\n/**\n * Where one pointer is inside an element, as a Mount, for a surface the\n * pointer draws on or points into (a color area, a dial, a signature pad): a\n * primary press, each move until the release, and the release, each with\n * the place in the element's padding box and the box's size. The box is\n * measured at each event, so an element that moved or resized is followed.\n * Coordinates are raw, left to right and top down whatever the direction:\n * what a place means (a share, an angle, a reading direction) is the parent's.\n *\n * The pointer is captured from press to release, so a drag that leaves the\n * element is still heard, and the moves and the release are listened to only\n * meanwhile. A press keeps the browser's own focus and text selection away,\n * and a second pointer while one is down is ignored.\n */\nexport const PointerPosition = Mount.defineStream('PointerPosition', {\n messages: [PointerPressed, PointerMoved, PointerReleased],\n args: {\n /**\n * A descendant to focus on a press, found by this selector (a thumb), so\n * the keys go on from where the pointer left it.\n */\n focus: Schema.optionalKey(Schema.String),\n },\n execute: ({ element, focus }) =>\n Stream.callback<PointerFact>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const offer = (fact: PointerFact) => Queue.offerUnsafe(queue, fact)\n let held: Option.Option<number> = Option.none()\n const ours = (event: Event): event is PointerEvent =>\n event instanceof PointerEvent && Option.contains(held, event.pointerId)\n\n const release = () => {\n if (Option.isNone(held)) return\n const pointerId = held.value\n held = Option.none()\n for (const [type, listener] of during) element.removeEventListener(type, listener)\n try {\n element.releasePointerCapture(pointerId)\n } catch {\n // Capture may already be gone with the pointer.\n }\n }\n const end = (completed: boolean) => (event: Event) => {\n if (!ours(event)) return\n release()\n offer(PointerReleased.make({ completed }))\n }\n const move = (event: Event) => {\n if (!ours(event)) return\n const box = measurePaddingBox(element)\n const point = pointIn(box, event)\n // Safari coalesces none and has no method for it.\n const coalesced = event.getCoalescedEvents?.() ?? []\n offer(\n PointerMoved.make({\n width: box.width,\n height: box.height,\n point,\n points: coalesced.length > 0 ? coalesced.map(one => pointIn(box, one)) : [point],\n }),\n )\n }\n const during: ReadonlyArray<readonly [string, (event: Event) => void]> = [\n ['pointermove', move],\n ['pointerup', end(true)],\n ['pointercancel', end(false)],\n ['lostpointercapture', end(false)],\n ]\n\n const down = (event: Event) => {\n if (!(event instanceof PointerEvent) || event.button !== 0) return\n if (Option.isSome(held)) {\n if (!ours(event)) return\n // The same pointer down again: its release went where nothing heard it.\n release()\n offer(PointerReleased.make({ completed: false }))\n }\n held = Option.some(event.pointerId)\n for (const [type, listener] of during) element.addEventListener(type, listener)\n try {\n element.setPointerCapture(event.pointerId)\n } catch {\n // A pointer the browser no longer tracks cannot be captured; its moves over the element still come.\n }\n // Kept from the browser's own focus and text selection, and from the mouse events a touch also sends.\n event.preventDefault()\n if (focus !== undefined) {\n const into = element.querySelector(focus)\n if (into instanceof HTMLElement) into.focus()\n }\n const box = measurePaddingBox(element)\n offer(\n PointerPressed.make({\n width: box.width,\n height: box.height,\n point: pointIn(box, event),\n pointerType: event.pointerType,\n }),\n )\n }\n element.addEventListener('pointerdown', down)\n return () => {\n element.removeEventListener('pointerdown', down)\n release()\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n","import { Effect, Queue, Schema, Stream } from 'effect'\nimport * as Mount from 'foldkit/mount'\n\n/** The attribute on the mounted element naming the element `TrackBox` follows, by id. */\nexport const TRACK_TARGET_ATTRIBUTE = 'data-target'\n\n/** The custom properties `TrackBox` writes for `name`, as `measured` names `Measure`'s. */\nexport const trackedBox = (name: string) =>\n ({\n x: `--fk-${name}-x`,\n y: `--fk-${name}-y`,\n w: `--fk-${name}-w`,\n h: `--fk-${name}-h`,\n radius: `--fk-${name}-radius`,\n }) as const\n\n/** Sent as the followed element changes: its id, and whether it is on the page. */\nexport const TrackedTarget = Schema.TaggedStruct('TrackedTarget', {\n target: Schema.String,\n found: Schema.Boolean,\n})\nexport type TrackedTarget = typeof TrackedTarget.Type\n\n/**\n * The radius a box of `width` by `height` draws for a computed\n * `border-top-left-radius` of `value` (`8px`, `50%`, `8px 4px`): its\n * horizontal length in pixels, a share of the width for a percentage, and\n * never more than half the shorter side, where the browser stops it.\n */\nexport const cornerRadius = (value: string, width: number, height: number): number => {\n const first = value.trim().split(/\\s+/)[0] ?? ''\n const length = parseFloat(first)\n if (!Number.isFinite(length)) return 0\n const pixels = first.endsWith('%') ? (length * width) / 100 : length\n return Math.max(0, Math.min(pixels, width / 2, height / 2))\n}\n\n/**\n * Follows another element's box, as a Mount: the element whose id is the\n * mounted element's `data-target` (`TRACK_TARGET_ATTRIBUTE`). Its box in\n * viewport pixels is written on the mounted element as `--fk-<name>-x`,\n * `-y`, `-w` and `-h`, and with `radius`, its top left corner's radius as\n * `--fk-<name>-radius` (`cornerRadius`), so a fixed overlay drawn from them\n * (a tour's cutout, a coach mark's ring) sits over it. While nothing is\n * followed they are removed, so a stylist's fallbacks apply.\n *\n * The box is read again on a scroll anywhere (heard on the way down, since\n * `scroll` does not bubble), a window resize, the followed element's own\n * resize, and any change to the document's elements, which is also how a\n * target drawn anew under the same id is found. `data-target` is read again\n * whenever it changes, so one element can glide from target to target\n * without being drawn again, which a Mount's args, read once, could not do.\n * What moves the target by any other way (a stylesheet added) is seen at the\n * next of these.\n *\n * Whether a target is on the page is the parent's to act on (a tour shows\n * the step in the middle instead), so each change of the target or of\n * whether it is found sends `TrackedTarget`, starting with the first one.\n * Since it sends a Message, a component may draw it by default: a Scene test\n * resolves it with what the parent maps it to. An empty `data-target` follows\n * nothing and sends nothing.\n */\nexport const TrackBox = Mount.defineStream('TrackBox', {\n messages: [TrackedTarget],\n args: {\n /** The custom properties' prefix: `tour` writes `--fk-tour-x`. */\n name: Schema.String,\n /** Whether to write the target's corner radius too; it reads the target's computed style. */\n radius: Schema.optional(Schema.Boolean),\n },\n execute: ({ element, name, radius = false }) =>\n Stream.callback<TrackedTarget>(queue =>\n Effect.acquireRelease(\n Effect.sync(() => {\n const document = element.ownerDocument\n const view = document.defaultView\n const properties = trackedBox(name)\n const style = element instanceof HTMLElement ? element.style : undefined\n let target: Element | null = null\n let told: TrackedTarget | undefined\n\n const place = () => {\n if (style === undefined) return\n if (target === null) {\n for (const property of Object.values(properties)) style.removeProperty(property)\n return\n }\n const box = target.getBoundingClientRect()\n style.setProperty(properties.x, `${box.left}px`)\n style.setProperty(properties.y, `${box.top}px`)\n style.setProperty(properties.w, `${box.width}px`)\n style.setProperty(properties.h, `${box.height}px`)\n if (radius) {\n const corner = getComputedStyle(target).borderTopLeftRadius\n style.setProperty(\n properties.radius,\n `${cornerRadius(corner, box.width, box.height)}px`,\n )\n }\n }\n // Looks the target up again, telling the parent when what it follows, or whether\n // that is found, changed.\n const follow = () => {\n const id = element.getAttribute(TRACK_TARGET_ATTRIBUTE) ?? ''\n const found = id === '' ? null : document.getElementById(id)\n if (found !== target) {\n if (target !== null) resized.unobserve(target)\n if (found !== null) resized.observe(found)\n target = found\n }\n place()\n if (id !== '' && (told?.target !== id || told.found !== (found !== null))) {\n told = TrackedTarget.make({ target: id, found: found !== null })\n Queue.offerUnsafe(queue, told)\n }\n }\n\n // Every observer is made before any observes, so one that throws (jsdom has no\n // ResizeObserver) leaves nothing attached.\n const resized = new ResizeObserver(place)\n const changed = new MutationObserver(follow)\n changed.observe(element, {\n attributes: true,\n attributeFilter: [TRACK_TARGET_ATTRIBUTE],\n })\n changed.observe(document, { childList: true, subtree: true })\n view?.addEventListener('scroll', place, { capture: true, passive: true })\n view?.addEventListener('resize', place)\n follow()\n return () => {\n changed.disconnect()\n resized.disconnect()\n view?.removeEventListener('scroll', place, { capture: true })\n view?.removeEventListener('resize', place)\n }\n }),\n stop => Effect.sync(stop),\n ),\n ),\n})\n"],"mappings":";;;;;;;AAGA,MAAa,UAAU,OAAO,aAAa,WAAW,CAAC,CAAC;;;;;;;;AAUxD,MAAa,YAAY,MAAM,OAAO,aAAa;CACjD,UAAU,CAAC,OAAO;CAClB,UAAU,EAAE,cACV,OAAO,WAAW;EAChB,MAAM,YAAY;EAClB,IAAI,OAAO,UAAU,UAAU,YAC5B,UAAW,MAAqB,KAAK,OAAO;EAE/C,OAAO,QAAQ,KAAK,CAAC,CAAC;CACxB,CAAC;AACL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