foldkit-primitives 0.2.1 → 0.3.0
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/README.md +314 -32
- package/dist/device/index.d.mts +11 -11
- package/dist/dom/index.d.mts +2 -0
- package/dist/dom/index.d.mts.map +1 -1
- package/dist/dom/index.mjs +2 -1
- package/dist/dom/index.mjs.map +1 -1
- package/dist/events/index.d.mts +2 -0
- package/dist/events/index.d.mts.map +1 -1
- package/dist/events/index.mjs +2 -1
- package/dist/events/index.mjs.map +1 -1
- package/dist/index-Cppf-lBx.d.mts +130 -0
- package/dist/index-Cppf-lBx.d.mts.map +1 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +4 -2
- package/dist/input-modality-DGOhAknO.d.mts +26 -0
- package/dist/input-modality-DGOhAknO.d.mts.map +1 -0
- package/dist/input-modality-m6v7__Xs.mjs +43 -0
- package/dist/input-modality-m6v7__Xs.mjs.map +1 -0
- package/dist/interaction/index.d.mts +862 -0
- package/dist/interaction/index.d.mts.map +1 -0
- package/dist/interaction/index.mjs +1364 -0
- package/dist/interaction/index.mjs.map +1 -0
- package/dist/motion/index.d.mts +2 -112
- package/dist/motion/index.mjs +2 -208
- package/dist/motion-LfJYAMnP.mjs +239 -0
- package/dist/motion-LfJYAMnP.mjs.map +1 -0
- package/dist/move-CZwHyTGk.mjs +215 -0
- package/dist/move-CZwHyTGk.mjs.map +1 -0
- package/dist/move-DNiMPcuf.d.mts +58 -0
- package/dist/move-DNiMPcuf.d.mts.map +1 -0
- package/dist/net/index.d.mts +5 -5
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +20 -8
- package/dist/motion/index.d.mts.map +0 -1
- package/dist/motion/index.mjs.map +0 -1
package/dist/events/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as modalityOfKey, i as Modality, n as InputModalityMessage, r as InputModalityModel, t as InputModality } from "../input-modality-DGOhAknO.mjs";
|
|
1
2
|
import { Schema, Stream } from "effect";
|
|
2
3
|
import { Bundle } from "foldkit-bundle";
|
|
3
4
|
//#region src/events/active-element.d.ts
|
|
@@ -151,4 +152,5 @@ export declare const WindowSize: Bundle.Bundle<"WindowSize", void, {
|
|
|
151
152
|
readonly height: number;
|
|
152
153
|
}, never, never, never, void, {}, {}>;
|
|
153
154
|
//#endregion
|
|
155
|
+
export { InputModality, InputModalityMessage, InputModalityModel, Modality, modalityOfKey };
|
|
154
156
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/events/active-element.ts","../../src/events/hotkeys.ts","../../src/events/idle.ts","../../src/events/keyboard.ts","../../src/events/pointer.ts","../../src/events/scroll.ts","../../src/events/visibility.ts","../../src/events/window-size.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/events/active-element.ts","../../src/events/hotkeys.ts","../../src/events/idle.ts","../../src/events/keyboard.ts","../../src/events/pointer.ts","../../src/events/scroll.ts","../../src/events/visibility.ts","../../src/events/window-size.ts"],"mappings":";;;;qBASa,gDAAoB;;;;;;YAGrB,8BAA8B,qBAAqB;;;;;;qBAOlD,2BAA0B,OAAO,OAAO;;;;;;;;;;;;;;;iBCNpC;WACN;WACA;WACA;WACA;WACA;WACA;;qBAkCE,cAAe,iBAAiB,OAAO;;;qBCvCvC,WAAS,OAAA;;;YACV,mBAAmB,UAAU;qBAE5B,uCAAW;;;;YACZ,qBAAqB,YAAY;qBAchC,MAAI,OAAA;;;;;;;;;;;qBCvBJ,2CAAe;;;;;;;;;;;;;YAWhB,yBAAyB,gBAAgB;;;;;;qBAOxC,sBAAqB,OAAO,OAAO;;;qBClBnC,0CAAc;;;;;;YAGf,wBAAwB,eAAe;;;;;;qBAOtC,qBAAoB,OAAO,OAAO;;;qBCVlC,yCAAa;;;;;;YAGd,uBAAuB,cAAc;;;;;;;qBAQpC,oBAAmB,OAAO,OAAO;;;qBCTjC,iBAAe,OAAA;;;YAChB,yBAAyB,gBAAgB;qBAExC,6CAAiB;;sBAAjB,OAAA;;;YACD,2BAA2B,kBAAkB;qBAiB5C,YAAU,OAAA;;;;;;;;qBCpBV,iBAAe,OAAA;;;;YAChB,yBAAyB,gBAAgB;qBAExC,6CAAiB;;;;;;YAGlB,2BAA2B,kBAAkB;qBAmC5C,YAAU,OAAA"}
|
package/dist/events/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as modalityOfKey, i as Modality, n as InputModalityMessage, r as InputModalityModel, t as InputModality } from "../input-modality-m6v7__Xs.mjs";
|
|
1
2
|
import { Effect, Queue, Schema, Stream } from "effect";
|
|
2
3
|
import { defineMessageUnion } from "foldkit/message";
|
|
3
4
|
import * as Subscription from "foldkit/subscription";
|
|
@@ -282,6 +283,6 @@ const WindowSize = Bundle.make("WindowSize", {
|
|
|
282
283
|
subscriptions: () => Subscription.make()(() => ({ changes: Subscription.persistent(sizeStream()) }))
|
|
283
284
|
});
|
|
284
285
|
//#endregion
|
|
285
|
-
export { ActiveElementMessage, Idle, IdleMessage, IdleModel, KeyboardMessage, PointerMessage, ScrollMessage, Visibility, VisibilityMessage, VisibilityModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, keyboardEvents, matchHotkey, pointerEvents, scrollEvents };
|
|
286
|
+
export { ActiveElementMessage, Idle, IdleMessage, IdleModel, InputModality, InputModalityMessage, InputModalityModel, KeyboardMessage, Modality, PointerMessage, ScrollMessage, Visibility, VisibilityMessage, VisibilityModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, keyboardEvents, matchHotkey, modalityOfKey, pointerEvents, scrollEvents };
|
|
286
287
|
|
|
287
288
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/events/active-element.ts","../../src/events/hotkeys.ts","../../src/events/idle.ts","../../src/events/keyboard.ts","../../src/events/pointer.ts","../../src/events/scroll.ts","../../src/events/visibility.ts","../../src/events/window-size.ts"],"sourcesContent":["/**\n * Focused element as an entry — not a bundle, because elements are not\n * Model facts: this reports the active element's tag and id (both\n * serializable), and the parent stores what matters. Starts with the\n * current answer, then follows `focusin`/`focusout`.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ActiveElementMessage = defineMessageUnion({\n Changed: { tag: Schema.String, id: Schema.NullOr(Schema.String) },\n})\nexport type ActiveElementMessage = typeof ActiveElementMessage.Type\n\n/**\n * Focus changes on the document. Without a document the stream is empty\n * instead of throwing. Lift with `Subscription.persistent`, mapping into\n * the parent's Message.\n */\nexport const activeElementEvents = (): Stream.Stream<ActiveElementMessage> => {\n if (typeof document === 'undefined') return Stream.empty\n const read = (): ActiveElementMessage => {\n const element = document.activeElement as Element | null | undefined\n return ActiveElementMessage.Changed({\n tag: element?.tagName ?? '',\n id: element?.id !== undefined && element.id !== '' ? element.id : null,\n })\n }\n const changes: Stream.Stream<ActiveElementMessage> = Stream.mergeAll(\n [\n Stream.fromEventListener(document, 'focusin').pipe(Stream.map(read)),\n Stream.fromEventListener(document, 'focusout').pipe(Stream.map(read)),\n ],\n { concurrency: 'unbounded' },\n )\n return Stream.concat(Stream.make(read()), changes)\n}\n","/**\n * Hotkey matching as a pure function over a `Pressed` payload: `matchHotkey`\n * answers whether a press is the shortcut, so `update` stays a table of\n * chords instead of a nest of modifier checks. Patterns read like\n * `\"ctrl+shift+k\"`: modifiers first (any order), the key last,\n * case-insensitive, with `cmd`/`command` and `option` as the Mac names for\n * meta and alt. Matching is exact — unlisted modifiers must be up — and\n * auto-repeat never matches, so holding a chord fires once. `space` (or a\n * bare space) means the space key; `esc` means escape. A pattern with\n * no key, or two keys, matches nothing: predicates return false, they do\n * not throw on the hot path.\n */\n\nexport interface KeyPress {\n readonly key: string\n readonly repeat: boolean\n readonly ctrl: boolean\n readonly shift: boolean\n readonly alt: boolean\n readonly meta: boolean\n}\n\nconst modifierOf = (part: string): 'ctrl' | 'shift' | 'alt' | 'meta' | null => {\n switch (part) {\n case 'ctrl':\n case 'control':\n return 'ctrl'\n case 'shift':\n return 'shift'\n case 'alt':\n case 'option':\n return 'alt'\n case 'meta':\n case 'cmd':\n case 'command':\n return 'meta'\n default:\n return null\n }\n}\n\nconst keyNameOf = (part: string): string => {\n switch (part) {\n case 'spacebar':\n case ' ':\n return 'space'\n case 'esc':\n return 'escape'\n default:\n return part\n }\n}\n\nexport const matchHotkey = (pattern: string, press: KeyPress): boolean => {\n if (press.repeat) return false\n const trimmed = pattern\n .split('+')\n .map(part => part.trim().toLowerCase())\n .filter(part => part !== '')\n // A bare whitespace pattern means the space key; an empty pattern is malformed.\n const parts = trimmed.length === 0 && pattern.length > 0 ? ['space'] : trimmed\n const keys = parts.filter(part => modifierOf(part) === null)\n if (keys.length !== 1) return false\n if (keyNameOf(keys[0]!) !== keyNameOf(press.key.toLowerCase())) return false\n const required: Record<'ctrl' | 'shift' | 'alt' | 'meta', boolean> = {\n ctrl: false,\n shift: false,\n alt: false,\n meta: false,\n }\n for (const part of parts) {\n const modifier = modifierOf(part)\n if (modifier !== null) required[modifier] = true\n }\n return (\n required.ctrl === press.ctrl &&\n required.shift === press.shift &&\n required.alt === press.alt &&\n required.meta === press.meta\n )\n}\n","/**\n * Idleness as a bundle: `idle` in the Model, flipped by activity and\n * silence. While active, activity debounced past `timeoutMs` settles to\n * `BecameIdle`; while idle, the first activity wakes to `BecameActive` and\n * the dependency flip restarts the watch. Starts active — a lurker idles\n * when the timeout elapses. The clock is Effect's, so tests drive it with\n * TestClock.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Subscription from 'foldkit/subscription'\nimport type * as Update from 'foldkit/update'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const IdleModel = Schema.Struct({ idle: Schema.Boolean })\nexport type IdleModel = typeof IdleModel.Type\n\nexport const IdleMessage = defineMessageUnion({ BecameIdle: {}, BecameActive: {} })\nexport type IdleMessage = typeof IdleMessage.Type\n\nconst activity = (): Stream.Stream<unknown> => {\n if (typeof window === 'undefined') return Stream.empty\n // One stream per sense; the merge fans into the debounce below.\n const senses: Array<Stream.Stream<unknown>> = [\n Stream.fromEventListener(window, 'mousemove'),\n Stream.fromEventListener(window, 'keydown'),\n Stream.fromEventListener(window, 'pointerdown'),\n Stream.fromEventListener(window, 'scroll'),\n ]\n return Stream.mergeAll(senses, { concurrency: 'unbounded' })\n}\n\nexport const Idle = Bundle.make('Idle', {\n Model: IdleModel,\n Message: IdleMessage,\n args: Schema.Struct({\n timeoutMs: Schema.Number.pipe(\n Schema.check(Schema.isGreaterThan(0)),\n Schema.check(Schema.isFinite()),\n ),\n }),\n init: () => ({ model: { idle: false } }),\n update: (model, message) =>\n IdleMessage.match<Update.ReturnWithOutMessage<IdleModel, IdleMessage, never>>(message, {\n BecameIdle: () => ({ model: { ...model, idle: true } }),\n BecameActive: () => ({ model: { ...model, idle: false } }),\n }),\n subscriptions: ({ timeoutMs }): Subscription.Subscriptions<IdleModel, IdleMessage> =>\n Subscription.make<IdleModel, IdleMessage>()(entry => ({\n watch: entry(\n { idle: Schema.Boolean },\n {\n modelToDependencies: model => ({ idle: model.idle }),\n dependenciesToStream: ({ idle }) =>\n idle\n ? activity().pipe(\n Stream.take(1),\n Stream.map(() => IdleMessage.BecameActive()),\n )\n : // Seeded with subscribe time as last-known-alive: silence from\n // here still settles, so a lurker idles without moving first.\n Stream.concat(Stream.make(null), activity()).pipe(\n Stream.debounce(timeoutMs),\n Stream.map(() => IdleMessage.BecameIdle()),\n ),\n },\n ),\n })),\n})\n","/**\n * Keyboard as an entry — not a bundle, because the parent owns whatever key\n * state it keeps (a held-keys set, a shortcut map, a focused field): this\n * reports presses and releases, including auto-repeat, and the parent\n * stores what matters. Hotkey matching stays application policy.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const KeyboardMessage = defineMessageUnion({\n Pressed: {\n key: Schema.String,\n repeat: Schema.Boolean,\n ctrl: Schema.Boolean,\n shift: Schema.Boolean,\n alt: Schema.Boolean,\n meta: Schema.Boolean,\n },\n Released: { key: Schema.String },\n})\nexport type KeyboardMessage = typeof KeyboardMessage.Type\n\n/**\n * Key presses and releases on the window. Without a window the stream is\n * empty instead of throwing. Lift with `Subscription.persistent`, mapping\n * into the parent's Message.\n */\nexport const keyboardEvents = (): Stream.Stream<KeyboardMessage> => {\n if (typeof window === 'undefined') return Stream.empty\n const downs: Stream.Stream<KeyboardMessage> = Stream.fromEventListener<KeyboardEvent>(\n window,\n 'keydown',\n ).pipe(\n Stream.map(event =>\n KeyboardMessage.Pressed({\n key: event.key,\n repeat: event.repeat,\n ctrl: event.ctrlKey,\n shift: event.shiftKey,\n alt: event.altKey,\n meta: event.metaKey,\n }),\n ),\n )\n const ups: Stream.Stream<KeyboardMessage> = Stream.fromEventListener<KeyboardEvent>(\n window,\n 'keyup',\n ).pipe(Stream.map(event => KeyboardMessage.Released({ key: event.key })))\n return Stream.mergeAll([downs, ups], { concurrency: 'unbounded' })\n}\n","/**\n * Pointer position as an entry — not a bundle, because the parent owns what\n * it keeps (a cursor, a drag anchor, hover state): this reports moves, and\n * the parent stores what matters. Element-scoped pointer needs are Mounts,\n * not this window-level entry.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const PointerMessage = defineMessageUnion({\n Moved: { x: Schema.Number, y: Schema.Number },\n})\nexport type PointerMessage = typeof PointerMessage.Type\n\n/**\n * Pointer moves on the window. Without a window the stream is empty instead\n * of throwing. Lift with `Subscription.persistent`, mapping into the\n * parent's Message.\n */\nexport const pointerEvents = (): Stream.Stream<PointerMessage> => {\n if (typeof window === 'undefined') return Stream.empty\n return Stream.fromEventListener<PointerEvent>(window, 'pointermove').pipe(\n Stream.map(event => PointerMessage.Moved({ x: event.clientX, y: event.clientY })),\n )\n}\n","/**\n * Window scroll position as an entry — not a bundle, because the parent\n * owns what it keeps (a stuck header, a back-to-top gate, restore-on-back):\n * this reports positions, and the parent stores what matters.\n * Element-scoped scrolling needs a Mount, not this window-level entry.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ScrollMessage = defineMessageUnion({\n Scrolled: { x: Schema.Number, y: Schema.Number },\n})\nexport type ScrollMessage = typeof ScrollMessage.Type\n\n/**\n * Scrolls on the window, in the capture phase so container scrolls (which\n * do not bubble) report too. Without a window the stream is empty instead\n * of throwing. Lift with `Subscription.persistent`, mapping into the\n * parent's Message.\n */\nexport const scrollEvents = (): Stream.Stream<ScrollMessage> => {\n if (typeof window === 'undefined') return Stream.empty\n return Stream.fromEventListener(window, 'scroll', { capture: true }).pipe(\n Stream.map(() => ScrollMessage.Scrolled({ x: window.scrollX, y: window.scrollY })),\n )\n}\n","/**\n * Page visibility as a bundle: `visible` in the Model, read from the\n * document at startup and kept current by `visibilitychange`. A hidden page\n * is the application's cue to pause polling, animations, and realtime\n * streams; the decision stays in application `update`, not here.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Subscription from 'foldkit/subscription'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const VisibilityModel = Schema.Struct({ visible: Schema.Boolean })\nexport type VisibilityModel = typeof VisibilityModel.Type\n\nexport const VisibilityMessage = defineMessageUnion({ Changed: { visible: Schema.Boolean } })\nexport type VisibilityMessage = typeof VisibilityMessage.Type\n\nconst isVisible = (): boolean =>\n typeof document === 'undefined' || document.visibilityState !== 'hidden'\n\nconst visibilityStream = (): Stream.Stream<VisibilityMessage> => {\n if (typeof document === 'undefined' || typeof document.addEventListener !== 'function') {\n return Stream.empty\n }\n return Stream.concat(\n Stream.make(VisibilityMessage.Changed({ visible: isVisible() })),\n Stream.fromEventListener(document, 'visibilitychange').pipe(\n Stream.map(() => VisibilityMessage.Changed({ visible: isVisible() })),\n ),\n )\n}\n\nexport const Visibility = Bundle.make('Visibility', {\n Model: VisibilityModel,\n Message: VisibilityMessage,\n // No document (SSR): assume visible; the stream corrects on subscribe.\n init: () => ({ model: { visible: isVisible() } }),\n update: (model, message) => ({ model: { visible: message.visible } }),\n subscriptions: (): Subscription.Subscriptions<VisibilityModel, VisibilityMessage> =>\n Subscription.make<VisibilityModel, VisibilityMessage>()(() => ({\n changes: Subscription.persistent(visibilityStream()),\n })),\n})\n","/**\n * Window size as a bundle: `{ width, height }` in the Model, read from the\n * window at startup and kept current by one `resize` listener. Breakpoints\n * owns its own listener and derives names; place this one when views need\n * the raw pixels. Placing both doubles resize listeners — pick the one the\n * view reads.\n */\nimport { Effect, Queue, Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Subscription from 'foldkit/subscription'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const WindowSizeModel = Schema.Struct({ width: Schema.Number, height: Schema.Number })\nexport type WindowSizeModel = typeof WindowSizeModel.Type\n\nexport const WindowSizeMessage = defineMessageUnion({\n Changed: { width: Schema.Number, height: Schema.Number },\n})\nexport type WindowSizeMessage = typeof WindowSizeMessage.Type\n\nconst readSize = (): { readonly width: number; readonly height: number } => ({\n width: window.innerWidth,\n height: window.innerHeight,\n})\n\nconst sizeStream = (): Stream.Stream<WindowSizeMessage> => {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return Stream.empty\n }\n return Stream.unwrap(\n Effect.gen(function* () {\n const queue = yield* Queue.unbounded<WindowSizeMessage>()\n const onResize = () => {\n const size = readSize()\n Effect.runFork(\n Queue.offer(queue, WindowSizeMessage.Changed({ width: size.width, height: size.height })),\n )\n }\n window.addEventListener('resize', onResize)\n yield* Effect.addFinalizer(() =>\n Effect.sync(() => {\n window.removeEventListener('resize', onResize)\n }),\n )\n const size = readSize()\n return Stream.concat(\n Stream.make(WindowSizeMessage.Changed({ width: size.width, height: size.height })),\n Stream.fromQueue(queue),\n )\n }),\n )\n}\n\nexport const WindowSize = Bundle.make('WindowSize', {\n Model: WindowSizeModel,\n Message: WindowSizeMessage,\n init: () => ({ model: { width: 0, height: 0 } }),\n update: (model, message) => ({ model: { width: message.width, height: message.height } }),\n subscriptions: (): Subscription.Subscriptions<WindowSizeModel, WindowSizeMessage> =>\n Subscription.make<WindowSizeModel, WindowSizeMessage>()(() => ({\n changes: Subscription.persistent(sizeStream()),\n })),\n})\n"],"mappings":";;;;;;;;;;;AASA,MAAa,uBAAuB,mBAAmB,EACrD,SAAS;CAAE,KAAK,OAAO;CAAQ,IAAI,OAAO,OAAO,OAAO,MAAM;AAAE,EAClE,CAAC;;;;;;AAQD,MAAa,4BAAiE;CAC5E,IAAI,OAAO,aAAa,aAAa,OAAO,OAAO;CACnD,MAAM,aAAmC;EACvC,MAAM,UAAU,SAAS;EACzB,OAAO,qBAAqB,QAAQ;GAClC,KAAK,SAAS,WAAW;GACzB,IAAI,SAAS,OAAO,KAAA,KAAa,QAAQ,OAAO,KAAK,QAAQ,KAAK;EACpE,CAAC;CACH;CACA,MAAM,UAA+C,OAAO,SAC1D,CACE,OAAO,kBAAkB,UAAU,SAAS,CAAC,CAAC,KAAK,OAAO,IAAI,IAAI,CAAC,GACnE,OAAO,kBAAkB,UAAU,UAAU,CAAC,CAAC,KAAK,OAAO,IAAI,IAAI,CAAC,CACtE,GACA,EAAE,aAAa,YAAY,CAC7B;CACA,OAAO,OAAO,OAAO,OAAO,KAAK,KAAK,CAAC,GAAG,OAAO;AACnD;;;ACdA,MAAM,cAAc,SAA2D;CAC7E,QAAQ,MAAR;EACE,KAAK;EACL,KAAK,WACH,OAAO;EACT,KAAK,SACH,OAAO;EACT,KAAK;EACL,KAAK,UACH,OAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK,WACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAEA,MAAM,aAAa,SAAyB;CAC1C,QAAQ,MAAR;EACE,KAAK;EACL,KAAK,KACH,OAAO;EACT,KAAK,OACH,OA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AAoB,UAAU,QAAQ;EAC/C,CAAC,CACH;EACA,MAAM,OAAO,SAAS;EACtB,OAAO,OAAO,OACZ,OAAO,KAAK,kBAAkB,QAAQ;GAAE,OAAO,KAAK;GAAO,QAAQ,KAAK;EAAO,CAAC,CAAC,GACjF,OAAO,UAAU,KAAK,CACxB;CACF,CAAC,CACH;AACF;AAEA,MAAa,aAAa,OAAO,KAAK,cAAc;CAClD,OAAO;CACP,SAAS;CACT,aAAa,EAAE,OAAO;EAAE,OAAO;EAAG,QAAQ;CAAE,EAAE;CAC9C,SAAS,OAAO,aAAa,EAAE,OAAO;EAAE,OAAO,QAAQ;EAAO,QAAQ,QAAQ;CAAO,EAAE;CACvF,qBACE,aAAa,KAAyC,CAAC,QAAQ,EAC7D,SAAS,aAAa,WAAW,WAAW,CAAC,EAC/C,EAAE;AACN,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/events/active-element.ts","../../src/events/hotkeys.ts","../../src/events/idle.ts","../../src/events/keyboard.ts","../../src/events/pointer.ts","../../src/events/scroll.ts","../../src/events/visibility.ts","../../src/events/window-size.ts"],"sourcesContent":["/**\n * Focused element as an entry — not a bundle, because elements are not\n * Model facts: this reports the active element's tag and id (both\n * serializable), and the parent stores what matters. Starts with the\n * current answer, then follows `focusin`/`focusout`.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ActiveElementMessage = defineMessageUnion({\n Changed: { tag: Schema.String, id: Schema.NullOr(Schema.String) },\n})\nexport type ActiveElementMessage = typeof ActiveElementMessage.Type\n\n/**\n * Focus changes on the document. Without a document the stream is empty\n * instead of throwing. Lift with `Subscription.persistent`, mapping into\n * the parent's Message.\n */\nexport const activeElementEvents = (): Stream.Stream<ActiveElementMessage> => {\n if (typeof document === 'undefined') return Stream.empty\n const read = (): ActiveElementMessage => {\n const element = document.activeElement as Element | null | undefined\n return ActiveElementMessage.Changed({\n tag: element?.tagName ?? '',\n id: element?.id !== undefined && element.id !== '' ? element.id : null,\n })\n }\n const changes: Stream.Stream<ActiveElementMessage> = Stream.mergeAll(\n [\n Stream.fromEventListener(document, 'focusin').pipe(Stream.map(read)),\n Stream.fromEventListener(document, 'focusout').pipe(Stream.map(read)),\n ],\n { concurrency: 'unbounded' },\n )\n return Stream.concat(Stream.make(read()), changes)\n}\n","/**\n * Hotkey matching as a pure function over a `Pressed` payload: `matchHotkey`\n * answers whether a press is the shortcut, so `update` stays a table of\n * chords instead of a nest of modifier checks. Patterns read like\n * `\"ctrl+shift+k\"`: modifiers first (any order), the key last,\n * case-insensitive, with `cmd`/`command` and `option` as the Mac names for\n * meta and alt. Matching is exact — unlisted modifiers must be up — and\n * auto-repeat never matches, so holding a chord fires once. `space` (or a\n * bare space) means the space key; `esc` means escape. A pattern with\n * no key, or two keys, matches nothing: predicates return false, they do\n * not throw on the hot path.\n */\n\nexport interface KeyPress {\n readonly key: string\n readonly repeat: boolean\n readonly ctrl: boolean\n readonly shift: boolean\n readonly alt: boolean\n readonly meta: boolean\n}\n\nconst modifierOf = (part: string): 'ctrl' | 'shift' | 'alt' | 'meta' | null => {\n switch (part) {\n case 'ctrl':\n case 'control':\n return 'ctrl'\n case 'shift':\n return 'shift'\n case 'alt':\n case 'option':\n return 'alt'\n case 'meta':\n case 'cmd':\n case 'command':\n return 'meta'\n default:\n return null\n }\n}\n\nconst keyNameOf = (part: string): string => {\n switch (part) {\n case 'spacebar':\n case ' ':\n return 'space'\n case 'esc':\n return 'escape'\n default:\n return part\n }\n}\n\nexport const matchHotkey = (pattern: string, press: KeyPress): boolean => {\n if (press.repeat) return false\n const trimmed = pattern\n .split('+')\n .map(part => part.trim().toLowerCase())\n .filter(part => part !== '')\n // A bare whitespace pattern means the space key; an empty pattern is malformed.\n const parts = trimmed.length === 0 && pattern.length > 0 ? ['space'] : trimmed\n const keys = parts.filter(part => modifierOf(part) === null)\n if (keys.length !== 1) return false\n if (keyNameOf(keys[0]!) !== keyNameOf(press.key.toLowerCase())) return false\n const required: Record<'ctrl' | 'shift' | 'alt' | 'meta', boolean> = {\n ctrl: false,\n shift: false,\n alt: false,\n meta: false,\n }\n for (const part of parts) {\n const modifier = modifierOf(part)\n if (modifier !== null) required[modifier] = true\n }\n return (\n required.ctrl === press.ctrl &&\n required.shift === press.shift &&\n required.alt === press.alt &&\n required.meta === press.meta\n )\n}\n","/**\n * Idleness as a bundle: `idle` in the Model, flipped by activity and\n * silence. While active, activity debounced past `timeoutMs` settles to\n * `BecameIdle`; while idle, the first activity wakes to `BecameActive` and\n * the dependency flip restarts the watch. Starts active — a lurker idles\n * when the timeout elapses. The clock is Effect's, so tests drive it with\n * TestClock.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Subscription from 'foldkit/subscription'\nimport type * as Update from 'foldkit/update'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const IdleModel = Schema.Struct({ idle: Schema.Boolean })\nexport type IdleModel = typeof IdleModel.Type\n\nexport const IdleMessage = defineMessageUnion({ BecameIdle: {}, BecameActive: {} })\nexport type IdleMessage = typeof IdleMessage.Type\n\nconst activity = (): Stream.Stream<unknown> => {\n if (typeof window === 'undefined') return Stream.empty\n // One stream per sense; the merge fans into the debounce below.\n const senses: Array<Stream.Stream<unknown>> = [\n Stream.fromEventListener(window, 'mousemove'),\n Stream.fromEventListener(window, 'keydown'),\n Stream.fromEventListener(window, 'pointerdown'),\n Stream.fromEventListener(window, 'scroll'),\n ]\n return Stream.mergeAll(senses, { concurrency: 'unbounded' })\n}\n\nexport const Idle = Bundle.make('Idle', {\n Model: IdleModel,\n Message: IdleMessage,\n args: Schema.Struct({\n timeoutMs: Schema.Number.pipe(\n Schema.check(Schema.isGreaterThan(0)),\n Schema.check(Schema.isFinite()),\n ),\n }),\n init: () => ({ model: { idle: false } }),\n update: (model, message) =>\n IdleMessage.match<Update.ReturnWithOutMessage<IdleModel, IdleMessage, never>>(message, {\n BecameIdle: () => ({ model: { ...model, idle: true } }),\n BecameActive: () => ({ model: { ...model, idle: false } }),\n }),\n subscriptions: ({ timeoutMs }): Subscription.Subscriptions<IdleModel, IdleMessage> =>\n Subscription.make<IdleModel, IdleMessage>()(entry => ({\n watch: entry(\n { idle: Schema.Boolean },\n {\n modelToDependencies: model => ({ idle: model.idle }),\n dependenciesToStream: ({ idle }) =>\n idle\n ? activity().pipe(\n Stream.take(1),\n Stream.map(() => IdleMessage.BecameActive()),\n )\n : // Seeded with subscribe time as last-known-alive: silence from\n // here still settles, so a lurker idles without moving first.\n Stream.concat(Stream.make(null), activity()).pipe(\n Stream.debounce(timeoutMs),\n Stream.map(() => IdleMessage.BecameIdle()),\n ),\n },\n ),\n })),\n})\n","/**\n * Keyboard as an entry — not a bundle, because the parent owns whatever key\n * state it keeps (a held-keys set, a shortcut map, a focused field): this\n * reports presses and releases, including auto-repeat, and the parent\n * stores what matters. Hotkey matching stays application policy.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const KeyboardMessage = defineMessageUnion({\n Pressed: {\n key: Schema.String,\n repeat: Schema.Boolean,\n ctrl: Schema.Boolean,\n shift: Schema.Boolean,\n alt: Schema.Boolean,\n meta: Schema.Boolean,\n },\n Released: { key: Schema.String },\n})\nexport type KeyboardMessage = typeof KeyboardMessage.Type\n\n/**\n * Key presses and releases on the window. Without a window the stream is\n * empty instead of throwing. Lift with `Subscription.persistent`, mapping\n * into the parent's Message.\n */\nexport const keyboardEvents = (): Stream.Stream<KeyboardMessage> => {\n if (typeof window === 'undefined') return Stream.empty\n const downs: Stream.Stream<KeyboardMessage> = Stream.fromEventListener<KeyboardEvent>(\n window,\n 'keydown',\n ).pipe(\n Stream.map(event =>\n KeyboardMessage.Pressed({\n key: event.key,\n repeat: event.repeat,\n ctrl: event.ctrlKey,\n shift: event.shiftKey,\n alt: event.altKey,\n meta: event.metaKey,\n }),\n ),\n )\n const ups: Stream.Stream<KeyboardMessage> = Stream.fromEventListener<KeyboardEvent>(\n window,\n 'keyup',\n ).pipe(Stream.map(event => KeyboardMessage.Released({ key: event.key })))\n return Stream.mergeAll([downs, ups], { concurrency: 'unbounded' })\n}\n","/**\n * Pointer position as an entry — not a bundle, because the parent owns what\n * it keeps (a cursor, a drag anchor, hover state): this reports moves, and\n * the parent stores what matters. Element-scoped pointer needs are Mounts,\n * not this window-level entry.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const PointerMessage = defineMessageUnion({\n Moved: { x: Schema.Number, y: Schema.Number },\n})\nexport type PointerMessage = typeof PointerMessage.Type\n\n/**\n * Pointer moves on the window. Without a window the stream is empty instead\n * of throwing. Lift with `Subscription.persistent`, mapping into the\n * parent's Message.\n */\nexport const pointerEvents = (): Stream.Stream<PointerMessage> => {\n if (typeof window === 'undefined') return Stream.empty\n return Stream.fromEventListener<PointerEvent>(window, 'pointermove').pipe(\n Stream.map(event => PointerMessage.Moved({ x: event.clientX, y: event.clientY })),\n )\n}\n","/**\n * Window scroll position as an entry — not a bundle, because the parent\n * owns what it keeps (a stuck header, a back-to-top gate, restore-on-back):\n * this reports positions, and the parent stores what matters.\n * Element-scoped scrolling needs a Mount, not this window-level entry.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\n\nexport const ScrollMessage = defineMessageUnion({\n Scrolled: { x: Schema.Number, y: Schema.Number },\n})\nexport type ScrollMessage = typeof ScrollMessage.Type\n\n/**\n * Scrolls on the window, in the capture phase so container scrolls (which\n * do not bubble) report too. Without a window the stream is empty instead\n * of throwing. Lift with `Subscription.persistent`, mapping into the\n * parent's Message.\n */\nexport const scrollEvents = (): Stream.Stream<ScrollMessage> => {\n if (typeof window === 'undefined') return Stream.empty\n return Stream.fromEventListener(window, 'scroll', { capture: true }).pipe(\n Stream.map(() => ScrollMessage.Scrolled({ x: window.scrollX, y: window.scrollY })),\n )\n}\n","/**\n * Page visibility as a bundle: `visible` in the Model, read from the\n * document at startup and kept current by `visibilitychange`. A hidden page\n * is the application's cue to pause polling, animations, and realtime\n * streams; the decision stays in application `update`, not here.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Subscription from 'foldkit/subscription'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const VisibilityModel = Schema.Struct({ visible: Schema.Boolean })\nexport type VisibilityModel = typeof VisibilityModel.Type\n\nexport const VisibilityMessage = defineMessageUnion({ Changed: { visible: Schema.Boolean } })\nexport type VisibilityMessage = typeof VisibilityMessage.Type\n\nconst isVisible = (): boolean =>\n typeof document === 'undefined' || document.visibilityState !== 'hidden'\n\nconst visibilityStream = (): Stream.Stream<VisibilityMessage> => {\n if (typeof document === 'undefined' || typeof document.addEventListener !== 'function') {\n return Stream.empty\n }\n return Stream.concat(\n Stream.make(VisibilityMessage.Changed({ visible: isVisible() })),\n Stream.fromEventListener(document, 'visibilitychange').pipe(\n Stream.map(() => VisibilityMessage.Changed({ visible: isVisible() })),\n ),\n )\n}\n\nexport const Visibility = Bundle.make('Visibility', {\n Model: VisibilityModel,\n Message: VisibilityMessage,\n // No document (SSR): assume visible; the stream corrects on subscribe.\n init: () => ({ model: { visible: isVisible() } }),\n update: (model, message) => ({ model: { visible: message.visible } }),\n subscriptions: (): Subscription.Subscriptions<VisibilityModel, VisibilityMessage> =>\n Subscription.make<VisibilityModel, VisibilityMessage>()(() => ({\n changes: Subscription.persistent(visibilityStream()),\n })),\n})\n","/**\n * Window size as a bundle: `{ width, height }` in the Model, read from the\n * window at startup and kept current by one `resize` listener. Breakpoints\n * owns its own listener and derives names; place this one when views need\n * the raw pixels. Placing both doubles resize listeners — pick the one the\n * view reads.\n */\nimport { Effect, Queue, Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Subscription from 'foldkit/subscription'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const WindowSizeModel = Schema.Struct({ width: Schema.Number, height: Schema.Number })\nexport type WindowSizeModel = typeof WindowSizeModel.Type\n\nexport const WindowSizeMessage = defineMessageUnion({\n Changed: { width: Schema.Number, height: Schema.Number },\n})\nexport type WindowSizeMessage = typeof WindowSizeMessage.Type\n\nconst readSize = (): { readonly width: number; readonly height: number } => ({\n width: window.innerWidth,\n height: window.innerHeight,\n})\n\nconst sizeStream = (): Stream.Stream<WindowSizeMessage> => {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return Stream.empty\n }\n return Stream.unwrap(\n Effect.gen(function* () {\n const queue = yield* Queue.unbounded<WindowSizeMessage>()\n const onResize = () => {\n const size = readSize()\n Effect.runFork(\n Queue.offer(queue, WindowSizeMessage.Changed({ width: size.width, height: size.height })),\n )\n }\n window.addEventListener('resize', onResize)\n yield* Effect.addFinalizer(() =>\n Effect.sync(() => {\n window.removeEventListener('resize', onResize)\n }),\n )\n const size = readSize()\n return Stream.concat(\n Stream.make(WindowSizeMessage.Changed({ width: size.width, height: size.height })),\n Stream.fromQueue(queue),\n )\n }),\n )\n}\n\nexport const WindowSize = Bundle.make('WindowSize', {\n Model: WindowSizeModel,\n Message: WindowSizeMessage,\n init: () => ({ model: { width: 0, height: 0 } }),\n update: (model, message) => ({ model: { width: message.width, height: message.height } }),\n subscriptions: (): Subscription.Subscriptions<WindowSizeModel, WindowSizeMessage> =>\n Subscription.make<WindowSizeModel, WindowSizeMessage>()(() => ({\n changes: Subscription.persistent(sizeStream()),\n })),\n})\n"],"mappings":";;;;;;;;;;;;AASA,MAAa,uBAAuB,mBAAmB,EACrD,SAAS;CAAE,KAAK,OAAO;CAAQ,IAAI,OAAO,OAAO,OAAO,MAAM;AAAE,EAClE,CAAC;;;;;;AAQD,MAAa,4BAAiE;CAC5E,IAAI,OAAO,aAAa,aAAa,OAAO,OAAO;CACnD,MAAM,aAAmC;EACvC,MAAM,UAAU,SAAS;EACzB,OAAO,qBAAqB,QAAQ;GAClC,KAAK,SAAS,WAAW;GACzB,IAAI,SAAS,OAAO,KAAA,KAAa,QAAQ,OA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le } from "foldkit-bundle";
|
|
3
|
+
declare namespace motion_d_exports {
|
|
4
|
+
export { Motion, MotionShape, full, layer, live, reduced, reducedMotion };
|
|
5
|
+
}
|
|
6
|
+
interface MotionShape {
|
|
7
|
+
readonly reduced: Effect.Effect<boolean>;
|
|
8
|
+
}
|
|
9
|
+
declare const Motion_base: Context.ServiceClass<Motion, "foldkit-primitives/Motion", MotionShape>;
|
|
10
|
+
declare class Motion extends Motion_base {}
|
|
11
|
+
/** Reduced or full motion, fixed: for a test or a setting the application owns. */
|
|
12
|
+
declare const layer: (reduced: boolean) => Layer.Layer<Motion>;
|
|
13
|
+
declare const reduced: Layer.Layer<Motion>;
|
|
14
|
+
declare const full: Layer.Layer<Motion>;
|
|
15
|
+
/** The user's `prefers-reduced-motion`, read each time a transition starts. */
|
|
16
|
+
declare const live: Layer.Layer<Motion>;
|
|
17
|
+
/** Whether to reduce motion now: the service's answer, or `false` without one. */
|
|
18
|
+
declare const reducedMotion: Effect.Effect<boolean>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/motion/presence.d.ts
|
|
21
|
+
declare const PresenceModel: Schema.Struct<{
|
|
22
|
+
readonly phase: Schema.Literals<readonly ["shown", "hiding", "hidden"]>;
|
|
23
|
+
readonly generation: Schema.Number;
|
|
24
|
+
}>;
|
|
25
|
+
type PresenceModel = typeof PresenceModel.Type;
|
|
26
|
+
declare const PresenceMessage: import("foldkit/message").MessageUnion<{
|
|
27
|
+
readonly Show: {};
|
|
28
|
+
readonly Hide: {};
|
|
29
|
+
readonly Hidden: {
|
|
30
|
+
readonly generation: Schema.Number;
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
type PresenceMessage = typeof PresenceMessage.Type;
|
|
34
|
+
/** Whether the content renders: shown or mid-exit. */
|
|
35
|
+
declare const isVisible: (model: PresenceModel) => boolean;
|
|
36
|
+
declare const Presence: Bundle.Bundle<"Presence", {
|
|
37
|
+
readonly durationMs: number;
|
|
38
|
+
}, {
|
|
39
|
+
readonly phase: "shown" | "hiding" | "hidden";
|
|
40
|
+
readonly generation: number;
|
|
41
|
+
}, {
|
|
42
|
+
readonly _tag: "Hidden";
|
|
43
|
+
readonly generation: number;
|
|
44
|
+
} | {
|
|
45
|
+
readonly _tag: "Show";
|
|
46
|
+
} | {
|
|
47
|
+
readonly _tag: "Hide";
|
|
48
|
+
}, never, never, never, void, {}, {}>;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/motion/spring.d.ts
|
|
51
|
+
declare const SpringModel: Schema.Struct<{
|
|
52
|
+
readonly value: Schema.Number;
|
|
53
|
+
readonly velocity: Schema.Number;
|
|
54
|
+
readonly running: Schema.Boolean;
|
|
55
|
+
}>;
|
|
56
|
+
type SpringModel = typeof SpringModel.Type;
|
|
57
|
+
declare const SpringMessage: import("foldkit/message").MessageUnion<{
|
|
58
|
+
readonly Started: {};
|
|
59
|
+
readonly Stopped: {};
|
|
60
|
+
readonly Ticked: {
|
|
61
|
+
readonly value: Schema.Number;
|
|
62
|
+
readonly velocity: Schema.Number;
|
|
63
|
+
};
|
|
64
|
+
/** Carries the exact end value: the integrator stops near it, not on it. */
|
|
65
|
+
readonly Finished: {
|
|
66
|
+
readonly value: Schema.Number;
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
type SpringMessage = typeof SpringMessage.Type;
|
|
70
|
+
declare const Spring: Bundle.Bundle<"Spring", {
|
|
71
|
+
readonly from: number;
|
|
72
|
+
readonly to: number;
|
|
73
|
+
readonly stiffness: number;
|
|
74
|
+
readonly damping: number;
|
|
75
|
+
}, {
|
|
76
|
+
readonly value: number;
|
|
77
|
+
readonly velocity: number;
|
|
78
|
+
readonly running: boolean;
|
|
79
|
+
}, {
|
|
80
|
+
readonly _tag: "Started";
|
|
81
|
+
} | {
|
|
82
|
+
readonly _tag: "Stopped";
|
|
83
|
+
} | {
|
|
84
|
+
readonly _tag: "Ticked";
|
|
85
|
+
readonly value: number;
|
|
86
|
+
readonly velocity: number;
|
|
87
|
+
} | {
|
|
88
|
+
readonly _tag: "Finished";
|
|
89
|
+
readonly value: number;
|
|
90
|
+
}, never, never, never, void, {}, {}>;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/motion/tween.d.ts
|
|
93
|
+
declare const TweenModel: Schema.Struct<{
|
|
94
|
+
readonly value: Schema.Number;
|
|
95
|
+
readonly running: Schema.Boolean;
|
|
96
|
+
}>;
|
|
97
|
+
type TweenModel = typeof TweenModel.Type;
|
|
98
|
+
declare const TweenMessage: import("foldkit/message").MessageUnion<{
|
|
99
|
+
readonly Started: {};
|
|
100
|
+
readonly Stopped: {};
|
|
101
|
+
readonly Ticked: {
|
|
102
|
+
readonly value: Schema.Number;
|
|
103
|
+
};
|
|
104
|
+
/** Carries the exact end value: the stream may stop on either side of it. */
|
|
105
|
+
readonly Finished: {
|
|
106
|
+
readonly value: Schema.Number;
|
|
107
|
+
};
|
|
108
|
+
}>;
|
|
109
|
+
type TweenMessage = typeof TweenMessage.Type;
|
|
110
|
+
declare const Tween: Bundle.Bundle<"Tween", {
|
|
111
|
+
readonly from: number;
|
|
112
|
+
readonly to: number;
|
|
113
|
+
readonly ms: number;
|
|
114
|
+
}, {
|
|
115
|
+
readonly value: number;
|
|
116
|
+
readonly running: boolean;
|
|
117
|
+
}, {
|
|
118
|
+
readonly _tag: "Started";
|
|
119
|
+
} | {
|
|
120
|
+
readonly _tag: "Stopped";
|
|
121
|
+
} | {
|
|
122
|
+
readonly _tag: "Ticked";
|
|
123
|
+
readonly value: number;
|
|
124
|
+
} | {
|
|
125
|
+
readonly _tag: "Finished";
|
|
126
|
+
readonly value: number;
|
|
127
|
+
}, never, never, never, void, {}, {}>;
|
|
128
|
+
//#endregion
|
|
129
|
+
export { SpringMessage as a, PresenceMessage as c, motion_d_exports as d, Spring as i, PresenceModel as l, TweenMessage as n, SpringModel as o, TweenModel as r, Presence as s, Tween as t, isVisible as u };
|
|
130
|
+
//# sourceMappingURL=index-Cppf-lBx.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Cppf-lBx.d.mts","names":[],"sources":["../src/motion/motion.ts","../src/motion/presence.ts","../src/motion/spring.ts","../src/motion/tween.ts"],"mappings":";;;;;UAUiB;WACN,SAAS,OAAO;;;cAGd,eAAe;;cAGf,QAAS,qBAAmB,MAAM,MAAM;cAGxC,SAAS,MAAM,MAAM;cACrB,MAAM,MAAM,MAAM;;cAGlB,MAAM,MAAM,MAAM;;cAUlB,eAAe,OAAO;;;cCtBtB,eAAa,OAAA;;;;KAId,uBAAuB,cAAc;cAEpC,2CAAe;;;;yBAAf,OAAA;;;KAKD,yBAAyB,gBAAgB;;cAGxC,YAAa,OAAO;cAEpB,UAAQ,OAAA;WAII;;;;;;;;;;;;;;cCnBZ,aAAW,OAAA;;;;;KAKZ,qBAAqB,YAAY;cAEhC,yCAAa;;;;;;;;;;;;KAOd,uBAAuB,cAAc;cAapC,QAAM,OAAA;;;;;;;;;;;;;;;;;;;;;;;cC5BN,YAAU,OAAA;;;;KACX,oBAAoB,WAAW;cAE9B,wCAAY;;;;;;;;;;;KAOb,sBAAsB,aAAa;cAElC,OAAK,OAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Coordinates, FullscreenMessage, Geolocation, GeolocationMessage, GeolocationModel, LiveStream, LiveStreamService, MediaDevice, MediaDevicesHandle, MediaDevicesMessage, MediaDevicesModel, MediaStreamConstraints, MediaStreamHandle, MediaStreamMessage, MediaStreamModel, MediaTrackHandle, PermissionState, PermissionStatusHandle, PermissionsHandle, PermissionsMessage, PermissionsModel, Watch, WatchService, enterFullscreen, exitFullscreen, fullscreenChanges, mediaDevices, mediaStream, permissions } from "./device/index.mjs";
|
|
2
|
+
import { a as Moved, c as FocusScope, i as MoveStarted, l as tabbableWithin, n as Move, o as HideOutside, r as MoveEnded, s as ScrollLock, t as Fact } from "./move-DNiMPcuf.mjs";
|
|
2
3
|
import { Autofocus, ClipboardMessage, Focused, Input, InputMask, ScriptMessage, ShareData, ShareMessage, applyMask, copyText, loadScript, share } from "./dom/index.mjs";
|
|
4
|
+
import { a as modalityOfKey, i as Modality, n as InputModalityMessage, r as InputModalityModel, t as InputModality } from "./input-modality-DGOhAknO.mjs";
|
|
3
5
|
import { ActiveElementMessage, Idle, IdleMessage, IdleModel, KeyPress, KeyboardMessage, PointerMessage, ScrollMessage, Visibility, VisibilityMessage, VisibilityModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, keyboardEvents, matchHotkey, pointerEvents, scrollEvents } from "./events/index.mjs";
|
|
4
6
|
import { Breakpoints, BreakpointsMessage, BreakpointsModel, MediaQuery, MediaQueryMessage, MediaQueryModel, Platform, PlatformHints, PrefersDark, PrefersReducedMotion, breakpointFor, isBrowser, isServer, platformFromUA } from "./media/index.mjs";
|
|
5
|
-
import {
|
|
7
|
+
import { a as SpringMessage, c as PresenceMessage, d as motion_d_exports, i as Spring, l as PresenceModel, n as TweenMessage, o as SpringModel, r as TweenModel, s as Presence, t as Tween, u as isVisible } from "./index-Cppf-lBx.mjs";
|
|
6
8
|
import { Acquired, AcquiredSource, BroadcastChannelHandle, BroadcastMessage, Online, OnlineMessage, OnlineModel, Socket, SocketHandle, SocketService, Source, SourceHandle, SourceService, SseMessage, SseModel, WebSocketMessage, WebSocketModel, broadcastMessages, postBroadcast, sse, websocket } from "./net/index.mjs";
|
|
7
9
|
import { Bounds, Intersection, IntersectionChanged, Measured, Mutated, Mutation, Resize, Resized } from "./observers/index.mjs";
|
|
8
10
|
import { HistoryModel, Locale, LocaleMessage, LocaleModel, MasonryPlacement, MeasureRow, Pagination, PaginationMessage, PaginationModel, RowMeasured, SelectionSet, SelectionSetMessage, SelectionSetModel, Viewport, ViewportScrolled, Virtual, VirtualLayout, VirtualMessage, VirtualModel, VirtualWindow, canRedo, canUndo, distanceToEnd, history, isAtEnd, isSelected, masonry, offset, offsetFor, pageCount, range, stickyHeader, totalHeight, visibleRange, windowFor } from "./state/index.mjs";
|
|
9
11
|
import { Interval, IntervalMessage, IntervalModel, Throttle, ThrottleMessage, ThrottleModel, Throttled, Timer, TimerMessage, TimerModel, debounce, formatRelativeTime } from "./time/index.mjs";
|
|
10
|
-
export { Acquired, AcquiredSource, ActiveElementMessage, Autofocus, Bounds, Breakpoints, BreakpointsMessage, BreakpointsModel, BroadcastChannelHandle, BroadcastMessage, ClipboardMessage, Coordinates, Focused, FullscreenMessage, Geolocation, GeolocationMessage, GeolocationModel, HistoryModel, Idle, IdleMessage, IdleModel, Input, InputMask, Intersection, IntersectionChanged, Interval, IntervalMessage, IntervalModel, KeyPress, KeyboardMessage, LiveStream, LiveStreamService, Locale, LocaleMessage, LocaleModel, MasonryPlacement, MeasureRow, Measured, MediaDevice, MediaDevicesHandle, MediaDevicesMessage, MediaDevicesModel, MediaQuery, MediaQueryMessage, MediaQueryModel, MediaStreamConstraints, MediaStreamHandle, MediaStreamMessage, MediaStreamModel, MediaTrackHandle, Mutated, Mutation, Online, OnlineMessage, OnlineModel, Pagination, PaginationMessage, PaginationModel, PermissionState, PermissionStatusHandle, PermissionsHandle, PermissionsMessage, PermissionsModel, Platform, PlatformHints, PointerMessage, PrefersDark, PrefersReducedMotion, Presence, PresenceMessage, PresenceModel, Resize, Resized, RowMeasured, ScriptMessage, ScrollMessage, SelectionSet, SelectionSetMessage, SelectionSetModel, ShareData, ShareMessage, Socket, SocketHandle, SocketService, Source, SourceHandle, SourceService, Spring, SpringMessage, SpringModel, SseMessage, SseModel, Throttle, ThrottleMessage, ThrottleModel, Throttled, Timer, TimerMessage, TimerModel, Tween, TweenMessage, TweenModel, Viewport, ViewportScrolled, Virtual, VirtualLayout, VirtualMessage, VirtualModel, VirtualWindow, Visibility, VisibilityMessage, VisibilityModel, Watch, WatchService, WebSocketMessage, WebSocketModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, applyMask, breakpointFor, broadcastMessages, canRedo, canUndo, copyText, debounce, distanceToEnd, enterFullscreen, exitFullscreen, formatRelativeTime, fullscreenChanges, history, isAtEnd, isBrowser, isSelected, isServer, isVisible, keyboardEvents, loadScript, masonry, matchHotkey, mediaDevices, mediaStream, offset, offsetFor, pageCount, permissions, platformFromUA, pointerEvents, postBroadcast, range, scrollEvents, share, sse, stickyHeader, totalHeight, visibleRange, websocket, windowFor };
|
|
12
|
+
export { Acquired, AcquiredSource, ActiveElementMessage, Autofocus, Bounds, Breakpoints, BreakpointsMessage, BreakpointsModel, BroadcastChannelHandle, BroadcastMessage, ClipboardMessage, Coordinates, Fact, FocusScope, Focused, FullscreenMessage, Geolocation, GeolocationMessage, GeolocationModel, HideOutside, HistoryModel, Idle, IdleMessage, IdleModel, Input, InputMask, InputModality, InputModalityMessage, InputModalityModel, Intersection, IntersectionChanged, Interval, IntervalMessage, IntervalModel, KeyPress, KeyboardMessage, LiveStream, LiveStreamService, Locale, LocaleMessage, LocaleModel, MasonryPlacement, MeasureRow, Measured, MediaDevice, MediaDevicesHandle, MediaDevicesMessage, MediaDevicesModel, MediaQuery, MediaQueryMessage, MediaQueryModel, MediaStreamConstraints, MediaStreamHandle, MediaStreamMessage, MediaStreamModel, MediaTrackHandle, Modality, motion_d_exports as Motion, Move, MoveEnded, MoveStarted, Moved, Mutated, Mutation, Online, OnlineMessage, OnlineModel, Pagination, PaginationMessage, PaginationModel, PermissionState, PermissionStatusHandle, PermissionsHandle, PermissionsMessage, PermissionsModel, Platform, PlatformHints, PointerMessage, PrefersDark, PrefersReducedMotion, Presence, PresenceMessage, PresenceModel, Resize, Resized, RowMeasured, ScriptMessage, ScrollLock, ScrollMessage, SelectionSet, SelectionSetMessage, SelectionSetModel, ShareData, ShareMessage, Socket, SocketHandle, SocketService, Source, SourceHandle, SourceService, Spring, SpringMessage, SpringModel, SseMessage, SseModel, Throttle, ThrottleMessage, ThrottleModel, Throttled, Timer, TimerMessage, TimerModel, Tween, TweenMessage, TweenModel, Viewport, ViewportScrolled, Virtual, VirtualLayout, VirtualMessage, VirtualModel, VirtualWindow, Visibility, VisibilityMessage, VisibilityModel, Watch, WatchService, WebSocketMessage, WebSocketModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, applyMask, breakpointFor, broadcastMessages, canRedo, canUndo, copyText, debounce, distanceToEnd, enterFullscreen, exitFullscreen, formatRelativeTime, fullscreenChanges, history, isAtEnd, isBrowser, isSelected, isServer, isVisible, keyboardEvents, loadScript, masonry, matchHotkey, mediaDevices, mediaStream, modalityOfKey, offset, offsetFor, pageCount, permissions, platformFromUA, pointerEvents, postBroadcast, range, scrollEvents, share, sse, stickyHeader, tabbableWithin, totalHeight, visibleRange, websocket, windowFor };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { a as HideOutside, c as tabbableWithin, i as Moved, n as MoveEnded, o as ScrollLock, r as MoveStarted, s as FocusScope, t as Move } from "./move-CZwHyTGk.mjs";
|
|
1
2
|
import { Autofocus, ClipboardMessage, Focused, Input, InputMask, ScriptMessage, ShareData, ShareMessage, applyMask, copyText, loadScript, share } from "./dom/index.mjs";
|
|
2
3
|
import { Coordinates, FullscreenMessage, Geolocation, GeolocationMessage, GeolocationModel, LiveStream, MediaDevice, MediaDevicesMessage, MediaDevicesModel, MediaStreamMessage, MediaStreamModel, PermissionState, PermissionsMessage, PermissionsModel, Watch, enterFullscreen, exitFullscreen, fullscreenChanges, mediaDevices, mediaStream, permissions } from "./device/index.mjs";
|
|
4
|
+
import { a as modalityOfKey, i as Modality, n as InputModalityMessage, r as InputModalityModel, t as InputModality } from "./input-modality-m6v7__Xs.mjs";
|
|
3
5
|
import { ActiveElementMessage, Idle, IdleMessage, IdleModel, KeyboardMessage, PointerMessage, ScrollMessage, Visibility, VisibilityMessage, VisibilityModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, keyboardEvents, matchHotkey, pointerEvents, scrollEvents } from "./events/index.mjs";
|
|
4
6
|
import { Breakpoints, BreakpointsMessage, BreakpointsModel, MediaQuery, MediaQueryMessage, MediaQueryModel, Platform, PrefersDark, PrefersReducedMotion, breakpointFor, isBrowser, isServer, platformFromUA } from "./media/index.mjs";
|
|
5
|
-
import {
|
|
7
|
+
import { a as SpringMessage, c as PresenceMessage, d as motion_exports, i as Spring, l as PresenceModel, n as TweenMessage, o as SpringModel, r as TweenModel, s as Presence, t as Tween, u as isVisible } from "./motion-LfJYAMnP.mjs";
|
|
6
8
|
import { BroadcastMessage, Online, OnlineMessage, OnlineModel, Socket, Source, SseMessage, SseModel, WebSocketMessage, WebSocketModel, broadcastMessages, postBroadcast, sse, websocket } from "./net/index.mjs";
|
|
7
9
|
import { Bounds, Intersection, IntersectionChanged, Measured, Mutated, Mutation, Resize, Resized } from "./observers/index.mjs";
|
|
8
10
|
import { HistoryModel, Locale, LocaleMessage, LocaleModel, MeasureRow, Pagination, PaginationMessage, PaginationModel, RowMeasured, SelectionSet, SelectionSetMessage, SelectionSetModel, Viewport, ViewportScrolled, Virtual, VirtualMessage, VirtualModel, canRedo, canUndo, distanceToEnd, history, isAtEnd, isSelected, masonry, offset, offsetFor, pageCount, range, stickyHeader, totalHeight, visibleRange, windowFor } from "./state/index.mjs";
|
|
9
11
|
import { Interval, IntervalMessage, IntervalModel, Throttle, ThrottleMessage, ThrottleModel, Throttled, Timer, TimerMessage, TimerModel, debounce, formatRelativeTime } from "./time/index.mjs";
|
|
10
|
-
export { ActiveElementMessage, Autofocus, Bounds, Breakpoints, BreakpointsMessage, BreakpointsModel, BroadcastMessage, ClipboardMessage, Coordinates, Focused, FullscreenMessage, Geolocation, GeolocationMessage, GeolocationModel, HistoryModel, Idle, IdleMessage, IdleModel, Input, InputMask, Intersection, IntersectionChanged, Interval, IntervalMessage, IntervalModel, KeyboardMessage, LiveStream, Locale, LocaleMessage, LocaleModel, MeasureRow, Measured, MediaDevice, MediaDevicesMessage, MediaDevicesModel, MediaQuery, MediaQueryMessage, MediaQueryModel, MediaStreamMessage, MediaStreamModel, Mutated, Mutation, Online, OnlineMessage, OnlineModel, Pagination, PaginationMessage, PaginationModel, PermissionState, PermissionsMessage, PermissionsModel, Platform, PointerMessage, PrefersDark, PrefersReducedMotion, Presence, PresenceMessage, PresenceModel, Resize, Resized, RowMeasured, ScriptMessage, ScrollMessage, SelectionSet, SelectionSetMessage, SelectionSetModel, ShareData, ShareMessage, Socket, Source, Spring, SpringMessage, SpringModel, SseMessage, SseModel, Throttle, ThrottleMessage, ThrottleModel, Throttled, Timer, TimerMessage, TimerModel, Tween, TweenMessage, TweenModel, Viewport, ViewportScrolled, Virtual, VirtualMessage, VirtualModel, Visibility, VisibilityMessage, VisibilityModel, Watch, WebSocketMessage, WebSocketModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, applyMask, breakpointFor, broadcastMessages, canRedo, canUndo, copyText, debounce, distanceToEnd, enterFullscreen, exitFullscreen, formatRelativeTime, fullscreenChanges, history, isAtEnd, isBrowser, isSelected, isServer, isVisible, keyboardEvents, loadScript, masonry, matchHotkey, mediaDevices, mediaStream, offset, offsetFor, pageCount, permissions, platformFromUA, pointerEvents, postBroadcast, range, scrollEvents, share, sse, stickyHeader, totalHeight, visibleRange, websocket, windowFor };
|
|
12
|
+
export { ActiveElementMessage, Autofocus, Bounds, Breakpoints, BreakpointsMessage, BreakpointsModel, BroadcastMessage, ClipboardMessage, Coordinates, FocusScope, Focused, FullscreenMessage, Geolocation, GeolocationMessage, GeolocationModel, HideOutside, HistoryModel, Idle, IdleMessage, IdleModel, Input, InputMask, InputModality, InputModalityMessage, InputModalityModel, Intersection, IntersectionChanged, Interval, IntervalMessage, IntervalModel, KeyboardMessage, LiveStream, Locale, LocaleMessage, LocaleModel, MeasureRow, Measured, MediaDevice, MediaDevicesMessage, MediaDevicesModel, MediaQuery, MediaQueryMessage, MediaQueryModel, MediaStreamMessage, MediaStreamModel, Modality, motion_exports as Motion, Move, MoveEnded, MoveStarted, Moved, Mutated, Mutation, Online, OnlineMessage, OnlineModel, Pagination, PaginationMessage, PaginationModel, PermissionState, PermissionsMessage, PermissionsModel, Platform, PointerMessage, PrefersDark, PrefersReducedMotion, Presence, PresenceMessage, PresenceModel, Resize, Resized, RowMeasured, ScriptMessage, ScrollLock, ScrollMessage, SelectionSet, SelectionSetMessage, SelectionSetModel, ShareData, ShareMessage, Socket, Source, Spring, SpringMessage, SpringModel, SseMessage, SseModel, Throttle, ThrottleMessage, ThrottleModel, Throttled, Timer, TimerMessage, TimerModel, Tween, TweenMessage, TweenModel, Viewport, ViewportScrolled, Virtual, VirtualMessage, VirtualModel, Visibility, VisibilityMessage, VisibilityModel, Watch, WebSocketMessage, WebSocketModel, WindowSize, WindowSizeMessage, WindowSizeModel, activeElementEvents, applyMask, breakpointFor, broadcastMessages, canRedo, canUndo, copyText, debounce, distanceToEnd, enterFullscreen, exitFullscreen, formatRelativeTime, fullscreenChanges, history, isAtEnd, isBrowser, isSelected, isServer, isVisible, keyboardEvents, loadScript, masonry, matchHotkey, mediaDevices, mediaStream, modalityOfKey, offset, offsetFor, pageCount, permissions, platformFromUA, pointerEvents, postBroadcast, range, scrollEvents, share, sse, stickyHeader, tabbableWithin, totalHeight, visibleRange, websocket, windowFor };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Bundle } from "foldkit-bundle";
|
|
3
|
+
//#region src/events/input-modality.d.ts
|
|
4
|
+
declare const Modality: Schema.Literals<readonly ["keyboard", "pointer", "unknown"]>;
|
|
5
|
+
type Modality = typeof Modality.Type;
|
|
6
|
+
declare const InputModalityModel: Schema.Struct<{
|
|
7
|
+
readonly modality: Schema.Literals<readonly ["keyboard", "pointer", "unknown"]>;
|
|
8
|
+
}>;
|
|
9
|
+
type InputModalityModel = typeof InputModalityModel.Type;
|
|
10
|
+
declare const InputModalityMessage: import("foldkit/message").MessageUnion<{
|
|
11
|
+
readonly Changed: {
|
|
12
|
+
readonly modality: Schema.Literals<readonly ["keyboard", "pointer", "unknown"]>;
|
|
13
|
+
};
|
|
14
|
+
}>;
|
|
15
|
+
type InputModalityMessage = typeof InputModalityMessage.Type;
|
|
16
|
+
/** A modifier alone says nothing about how the page is being driven. */
|
|
17
|
+
declare const modalityOfKey: (key: string) => Modality | null;
|
|
18
|
+
declare const InputModality: Bundle.Bundle<"InputModality", void, {
|
|
19
|
+
readonly modality: "keyboard" | "pointer" | "unknown";
|
|
20
|
+
}, {
|
|
21
|
+
readonly _tag: "Changed";
|
|
22
|
+
readonly modality: "keyboard" | "pointer" | "unknown";
|
|
23
|
+
}, never, never, never, void, {}, {}>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { modalityOfKey as a, Modality as i, InputModalityMessage as n, InputModalityModel as r, InputModality as t };
|
|
26
|
+
//# sourceMappingURL=input-modality-DGOhAknO.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-modality-DGOhAknO.d.mts","names":[],"sources":["../src/events/input-modality.ts"],"mappings":";;;cAYa,UAAQ,OAAA;KACT,kBAAkB,SAAS;cAE1B,oBAAkB,OAAA;;;KACnB,4BAA4B,mBAAmB;cAE9C,gDAAoB;;uBAApB,OAAA;;;KACD,8BAA8B,qBAAqB;;cAKlD,gBAAiB,gBAAc;cAmB/B,eAAa,OAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Schema, Stream } from "effect";
|
|
2
|
+
import { defineMessageUnion } from "foldkit/message";
|
|
3
|
+
import * as Subscription from "foldkit/subscription";
|
|
4
|
+
import { Bundle } from "foldkit-bundle";
|
|
5
|
+
//#region src/events/input-modality.ts
|
|
6
|
+
/**
|
|
7
|
+
* Input modality as a bundle: whether the user last drove the page by
|
|
8
|
+
* keyboard or by pointer. The browser reports the facts; the Model keeps the
|
|
9
|
+
* answer, so a view can show a focus ring only for keyboard users without
|
|
10
|
+
* reading the DOM, and a replay sees the same answer. CSS `:focus-visible`
|
|
11
|
+
* is the floor; this is for JavaScript that must know.
|
|
12
|
+
*/
|
|
13
|
+
const Modality = Schema.Literals([
|
|
14
|
+
"keyboard",
|
|
15
|
+
"pointer",
|
|
16
|
+
"unknown"
|
|
17
|
+
]);
|
|
18
|
+
const InputModalityModel = Schema.Struct({ modality: Modality });
|
|
19
|
+
const InputModalityMessage = defineMessageUnion({ Changed: { modality: Modality } });
|
|
20
|
+
const MODIFIERS = /* @__PURE__ */ new Set([
|
|
21
|
+
"Shift",
|
|
22
|
+
"Control",
|
|
23
|
+
"Alt",
|
|
24
|
+
"Meta",
|
|
25
|
+
"CapsLock"
|
|
26
|
+
]);
|
|
27
|
+
/** A modifier alone says nothing about how the page is being driven. */
|
|
28
|
+
const modalityOfKey = (key) => MODIFIERS.has(key) ? null : "keyboard";
|
|
29
|
+
const modalityStream = () => {
|
|
30
|
+
if (typeof window === "undefined") return Stream.empty;
|
|
31
|
+
return Stream.mergeAll([Stream.fromEventListener(window, "keydown", { capture: true }).pipe(Stream.filter((event) => modalityOfKey(event.key) !== null), Stream.map(() => InputModalityMessage.Changed({ modality: "keyboard" }))), Stream.fromEventListener(window, "pointerdown", { capture: true }).pipe(Stream.map(() => InputModalityMessage.Changed({ modality: "pointer" })))], { concurrency: "unbounded" });
|
|
32
|
+
};
|
|
33
|
+
const InputModality = Bundle.make("InputModality", {
|
|
34
|
+
Model: InputModalityModel,
|
|
35
|
+
Message: InputModalityMessage,
|
|
36
|
+
init: () => ({ model: { modality: "unknown" } }),
|
|
37
|
+
update: (model, message) => model.modality === message.modality ? { model } : { model: { modality: message.modality } },
|
|
38
|
+
subscriptions: () => Subscription.make()(() => ({ changes: Subscription.persistent(modalityStream()) }))
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
export { modalityOfKey as a, Modality as i, InputModalityMessage as n, InputModalityModel as r, InputModality as t };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=input-modality-m6v7__Xs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-modality-m6v7__Xs.mjs","names":[],"sources":["../src/events/input-modality.ts"],"sourcesContent":["/**\n * Input modality as a bundle: whether the user last drove the page by\n * keyboard or by pointer. The browser reports the facts; the Model keeps the\n * answer, so a view can show a focus ring only for keyboard users without\n * reading the DOM, and a replay sees the same answer. CSS `:focus-visible`\n * is the floor; this is for JavaScript that must know.\n */\nimport { Schema, Stream } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport * as Subscription from 'foldkit/subscription'\nimport { Bundle } from 'foldkit-bundle'\n\nexport const Modality = Schema.Literals(['keyboard', 'pointer', 'unknown'])\nexport type Modality = typeof Modality.Type\n\nexport const InputModalityModel = Schema.Struct({ modality: Modality })\nexport type InputModalityModel = typeof InputModalityModel.Type\n\nexport const InputModalityMessage = defineMessageUnion({ Changed: { modality: Modality } })\nexport type InputModalityMessage = typeof InputModalityMessage.Type\n\nconst MODIFIERS = new Set(['Shift', 'Control', 'Alt', 'Meta', 'CapsLock'])\n\n/** A modifier alone says nothing about how the page is being driven. */\nexport const modalityOfKey = (key: string): Modality | null =>\n MODIFIERS.has(key) ? null : 'keyboard'\n\nconst modalityStream = (): Stream.Stream<InputModalityMessage> => {\n if (typeof window === 'undefined') return Stream.empty\n return Stream.mergeAll(\n [\n Stream.fromEventListener<KeyboardEvent>(window, 'keydown', { capture: true }).pipe(\n Stream.filter(event => modalityOfKey(event.key) !== null),\n Stream.map(() => InputModalityMessage.Changed({ modality: 'keyboard' })),\n ),\n Stream.fromEventListener(window, 'pointerdown', { capture: true }).pipe(\n Stream.map(() => InputModalityMessage.Changed({ modality: 'pointer' })),\n ),\n ],\n { concurrency: 'unbounded' },\n )\n}\n\nexport const InputModality = Bundle.make('InputModality', {\n Model: InputModalityModel,\n Message: InputModalityMessage,\n init: () => ({ model: { modality: 'unknown' as const } }),\n update: (model, message) =>\n model.modality === message.modality ? { model } : { model: { modality: message.modality } },\n subscriptions: (): Subscription.Subscriptions<InputModalityModel, InputModalityMessage> =>\n Subscription.make<InputModalityModel, InputModalityMessage>()(() => ({\n changes: Subscription.persistent(modalityStream()),\n })),\n})\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,WAAW,OAAO,SAAS;CAAC;CAAY;CAAW;AAAS,CAAC;AAG1E,MAAa,qBAAqB,OAAO,OAAO,EAAE,UAAU,SAAS,CAAC;AAGtE,MAAa,uBAAuB,mBAAmB,EAAE,SAAS,EAAE,UAAU,SAAS,EAAE,CAAC;AAG1F,MAAM,4BAAY,IAAI,IAAI;CAAC;CAAS;CAAW;CAAO;CAAQ;AAAU,CAAC;;AAGzE,MAAa,iBAAiB,QAC5B,UAAU,IAAI,GAAG,IAAI,OAAO;AAE9B,MAAM,uBAA4D;CAChE,IAAI,OAAO,WAAW,aAAa,OAAO,OAAO;CACjD,OAAO,OAAO,SACZ,CACE,OAAO,kBAAiC,QAAQ,WAAW,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,KAC5E,OAAO,QAAO,UAAS,cAAc,MAAM,GAAG,MAAM,IAAI,GACxD,OAAO,UAAU,qBAAqB,QAAQ,EAAE,UAAU,WAAW,CAAC,CAAC,CACzE,GACA,OAAO,kBAAkB,QAAQ,eAAe,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,KACjE,OAAO,UAAU,qBAAqB,QAAQ,EAAE,UAAU,UAAU,CAAC,CAAC,CACxE,CACF,GACA,EAAE,aAAa,YAAY,CAC7B;AACF;AAEA,MAAa,gBAAgB,OAAO,KAAK,iBAAiB;CACxD,OAAO;CACP,SAAS;CACT,aAAa,EAAE,OAAO,EAAE,UAAU,UAAmB,EAAE;CACvD,SAAS,OAAO,YACd,MAAM,aAAa,QAAQ,WAAW,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,UAAU,QAAQ,SAAS,EAAE;CAC5F,qBACE,aAAa,KAA+C,CAAC,QAAQ,EACnE,SAAS,aAAa,WAAW,eAAe,CAAC,EACnD,EAAE;AACN,CAAC"}
|