@vizejs/fresco 0.719.0 → 0.721.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/dist/{accessibility-DwzT925M.d.mts → accessibility-D7iuITvU.d.mts} +4 -3
- package/dist/{accessibility-DwzT925M.d.mts.map → accessibility-D7iuITvU.d.mts.map} +1 -1
- package/dist/{app-_QmZ-PoH.d.mts → app-CJh9qfJI.d.mts} +3 -3
- package/dist/{app-_QmZ-PoH.d.mts.map → app-CJh9qfJI.d.mts.map} +1 -1
- package/dist/{app-C_wFlWSV.mjs → app-CjfLCWic.mjs} +110 -16
- package/dist/app-CjfLCWic.mjs.map +1 -0
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/{components-DzkL-yHj.mjs → components-B-HgL5id.mjs} +1032 -139
- package/dist/components-B-HgL5id.mjs.map +1 -0
- package/dist/composables/index.d.mts +1 -1
- package/dist/composables/index.mjs +3 -3
- package/dist/{composables-BJeirPSH.mjs → composables-BxxLIBdJ.mjs} +3 -3
- package/dist/{composables-BJeirPSH.mjs.map → composables-BxxLIBdJ.mjs.map} +1 -1
- package/dist/{index-Ddp2Txtm.d.mts → index-BOV-0YqV.d.mts} +2 -2
- package/dist/{index-Ddp2Txtm.d.mts.map → index-BOV-0YqV.d.mts.map} +1 -1
- package/dist/{index-BCxB_ZLV.d.mts → index-C0U_GDW-.d.mts} +324 -498
- package/dist/index-C0U_GDW-.d.mts.map +1 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +5 -5
- package/dist/{protocol-DavoeNLn.d.mts → protocol-C1DHP36Z.d.mts} +5 -2
- package/dist/protocol-C1DHP36Z.d.mts.map +1 -0
- package/dist/testing/index.d.mts +4 -2
- package/dist/testing/index.d.mts.map +1 -1
- package/dist/testing/index.mjs +2 -1
- package/dist/testing/index.mjs.map +1 -1
- package/dist/{useBoxMetrics-lF5Myjc7.mjs → useBoxMetrics-BMD1acRU.mjs} +2 -2
- package/dist/{useBoxMetrics-lF5Myjc7.mjs.map → useBoxMetrics-BMD1acRU.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/app-C_wFlWSV.mjs.map +0 -1
- package/dist/components-DzkL-yHj.mjs.map +0 -1
- package/dist/index-BCxB_ZLV.d.mts.map +0 -1
- package/dist/protocol-DavoeNLn.d.mts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-CjfLCWic.mjs","names":["stringValue","nodeText","loadNative","createRenderer","createVueRenderer","hitTestHostTree","createRenderer"],"sources":["../src/renderPayload.ts","../src/accessibility.ts","../src/composables/useApp.ts","../src/composables/useFocus.ts","../src/composables/useStreams.ts","../src/composables/useCursor.ts","../src/focusRouting.ts","../src/layoutMetrics.ts","../src/mouseRouting.ts","../src/nativeInput.ts","../src/hitTesting.ts","../src/renderer.ts","../src/renderToStringStreams.ts","../src/staticNodes.ts","../src/terminalLifecycle.ts","../src/app.ts"],"sourcesContent":["import type {\n FrescoAlignContent,\n FrescoAlignItems,\n FrescoAlignSelf,\n FrescoAppearance,\n FrescoBorderStyle,\n FrescoDisplay,\n FrescoFlexDirection,\n FrescoFlexWrap,\n FrescoInputRenderNode,\n FrescoJustifyContent,\n FrescoOverflow,\n FrescoPosition,\n FrescoRawRenderNode,\n FrescoRenderNode,\n FrescoRenderStyle,\n FrescoRootRenderNode,\n FrescoTextRenderNode,\n FrescoTextWrapMode,\n} from \"./protocol.js\";\nimport type { FrescoNode } from \"./renderer.js\";\n\nconst displays = [\"flex\", \"none\"] as const satisfies readonly FrescoDisplay[];\nconst positions = [\"absolute\", \"relative\", \"static\"] as const satisfies readonly FrescoPosition[];\nconst overflows = [\"visible\", \"hidden\", \"scroll\"] as const satisfies readonly FrescoOverflow[];\nconst flexDirections = [\n \"row\",\n \"column\",\n \"row-reverse\",\n \"column-reverse\",\n] as const satisfies readonly FrescoFlexDirection[];\nconst flexWraps = [\"nowrap\", \"wrap\", \"wrap-reverse\"] as const satisfies readonly FrescoFlexWrap[];\nconst justifyContents = [\n \"flex-start\",\n \"flex-end\",\n \"start\",\n \"end\",\n \"center\",\n \"space-between\",\n \"space-around\",\n \"space-evenly\",\n] as const satisfies readonly FrescoJustifyContent[];\nconst alignItems = [\n \"flex-start\",\n \"flex-end\",\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n \"baseline\",\n] as const satisfies readonly FrescoAlignItems[];\nconst alignSelf = [\"auto\", ...alignItems] as const satisfies readonly FrescoAlignSelf[];\nconst alignContent = [\n \"flex-start\",\n \"flex-end\",\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n \"space-between\",\n \"space-around\",\n \"space-evenly\",\n] as const satisfies readonly FrescoAlignContent[];\nconst borderStyles = [\n \"none\",\n \"single\",\n \"double\",\n \"rounded\",\n \"heavy\",\n \"dashed\",\n] as const satisfies readonly FrescoBorderStyle[];\nconst wrapModes = [\n \"none\",\n \"wrap\",\n \"hard\",\n \"truncate\",\n \"truncate-start\",\n \"truncate-middle\",\n \"truncate-end\",\n] as const satisfies readonly FrescoTextWrapMode[];\n\nfunction recordValue(value: unknown): Record<string, unknown> {\n return typeof value === \"object\" && value !== null ? (value as Record<string, unknown>) : {};\n}\n\nfunction firstValue(record: Record<string, unknown>, ...keys: string[]): unknown {\n for (const key of keys) {\n if (record[key] !== undefined) return record[key];\n }\n return undefined;\n}\n\nfunction enumValue<Value extends string>(\n value: unknown,\n values: readonly Value[],\n): Value | undefined {\n return typeof value === \"string\" && values.includes(value as Value)\n ? (value as Value)\n : undefined;\n}\n\nfunction stringValue(value: unknown): string | undefined {\n return typeof value === \"string\" || typeof value === \"number\" ? String(value) : undefined;\n}\n\nfunction numberValue(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value) ? value : undefined;\n}\n\nfunction integerValue(value: unknown): number | undefined {\n return typeof value === \"number\" &&\n Number.isInteger(value) &&\n value >= -2_147_483_648 &&\n value <= 2_147_483_647\n ? value\n : undefined;\n}\n\nfunction booleanValue(value: unknown): boolean | undefined {\n return typeof value === \"boolean\" ? value : undefined;\n}\n\nfunction stringLines(value: unknown): string[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const lines = value.filter((line): line is string => typeof line === \"string\");\n return lines.length > 0 ? lines : undefined;\n}\n\nfunction enabledValue(value: unknown): true | undefined {\n return value === true ? true : undefined;\n}\n\nfunction nonEmptyStringValue(value: unknown): string | undefined {\n const string = stringValue(value);\n return string ? string : undefined;\n}\n\n/** Normalize component style input into the canonical native render style. */\nexport function normalizeFrescoStyle(value: unknown): FrescoRenderStyle | undefined {\n const source = recordValue(value);\n const style: FrescoRenderStyle = {};\n\n style.display = enumValue(source.display, displays);\n style.position = enumValue(source.position, positions);\n style.zIndex = integerValue(firstValue(source, \"zIndex\", \"z_index\"));\n style.top = stringValue(source.top);\n style.right = stringValue(source.right);\n style.bottom = stringValue(source.bottom);\n style.left = stringValue(source.left);\n style.overflow = enumValue(source.overflow, overflows);\n style.overflowX = enumValue(firstValue(source, \"overflowX\", \"overflow_x\"), overflows);\n style.overflowY = enumValue(firstValue(source, \"overflowY\", \"overflow_y\"), overflows);\n style.flexDirection = enumValue(\n firstValue(source, \"flexDirection\", \"flex_direction\"),\n flexDirections,\n );\n style.flexWrap = enumValue(firstValue(source, \"flexWrap\", \"flex_wrap\"), flexWraps);\n style.justifyContent = enumValue(\n firstValue(source, \"justifyContent\", \"justify_content\"),\n justifyContents,\n );\n style.alignItems = enumValue(firstValue(source, \"alignItems\", \"align_items\"), alignItems);\n style.alignSelf = enumValue(firstValue(source, \"alignSelf\", \"align_self\"), alignSelf);\n style.alignContent = enumValue(firstValue(source, \"alignContent\", \"align_content\"), alignContent);\n style.flexGrow = numberValue(firstValue(source, \"flexGrow\", \"flex_grow\"));\n style.flexShrink = numberValue(firstValue(source, \"flexShrink\", \"flex_shrink\"));\n style.flexBasis = stringValue(firstValue(source, \"flexBasis\", \"flex_basis\"));\n style.width = stringValue(source.width);\n style.height = stringValue(source.height);\n style.minWidth = stringValue(firstValue(source, \"minWidth\", \"min_width\"));\n style.minHeight = stringValue(firstValue(source, \"minHeight\", \"min_height\"));\n style.maxWidth = stringValue(firstValue(source, \"maxWidth\", \"max_width\"));\n style.maxHeight = stringValue(firstValue(source, \"maxHeight\", \"max_height\"));\n style.aspectRatio = numberValue(firstValue(source, \"aspectRatio\", \"aspect_ratio\"));\n style.padding = numberValue(source.padding);\n style.paddingTop = numberValue(firstValue(source, \"paddingTop\", \"padding_top\"));\n style.paddingRight = numberValue(firstValue(source, \"paddingRight\", \"padding_right\"));\n style.paddingBottom = numberValue(firstValue(source, \"paddingBottom\", \"padding_bottom\"));\n style.paddingLeft = numberValue(firstValue(source, \"paddingLeft\", \"padding_left\"));\n style.margin = numberValue(source.margin);\n style.marginTop = numberValue(firstValue(source, \"marginTop\", \"margin_top\"));\n style.marginRight = numberValue(firstValue(source, \"marginRight\", \"margin_right\"));\n style.marginBottom = numberValue(firstValue(source, \"marginBottom\", \"margin_bottom\"));\n style.marginLeft = numberValue(firstValue(source, \"marginLeft\", \"margin_left\"));\n style.gap = numberValue(source.gap);\n style.columnGap = numberValue(firstValue(source, \"columnGap\", \"column_gap\"));\n style.rowGap = numberValue(firstValue(source, \"rowGap\", \"row_gap\"));\n\n for (const key of Object.keys(style) as (keyof FrescoRenderStyle)[]) {\n if (style[key] === undefined) delete style[key];\n }\n return Object.keys(style).length > 0 ? style : undefined;\n}\n\nfunction normalizeAppearance(props: Record<string, unknown>): FrescoAppearance | undefined {\n const appearance: FrescoAppearance = {};\n appearance.fg = nonEmptyStringValue(firstValue(props, \"fg\", \"color\"));\n appearance.bg = nonEmptyStringValue(\n firstValue(props, \"bg\", \"backgroundColor\", \"background_color\"),\n );\n appearance.bold = enabledValue(props.bold);\n appearance.dim = enabledValue(firstValue(props, \"dim\", \"dimColor\", \"dim_color\"));\n appearance.italic = enabledValue(props.italic);\n appearance.underline = enabledValue(props.underline);\n appearance.inverse = enabledValue(props.inverse);\n appearance.blink = enabledValue(props.blink);\n appearance.hidden = enabledValue(props.hidden);\n appearance.strikethrough = enabledValue(props.strikethrough);\n\n for (const key of Object.keys(appearance) as (keyof FrescoAppearance)[]) {\n if (appearance[key] === undefined) delete appearance[key];\n }\n return Object.keys(appearance).length > 0 ? appearance : undefined;\n}\n\nfunction commonFields(node: FrescoNode): Omit<FrescoRootRenderNode, \"nodeType\"> {\n const common: Omit<FrescoRootRenderNode, \"nodeType\"> = { id: node.id };\n const style = normalizeFrescoStyle(node.props.style);\n const appearance = normalizeAppearance(node.props);\n const border = enumValue(node.props.border, borderStyles);\n if (style) common.style = style;\n if (appearance) common.appearance = appearance;\n if (border) common.border = border;\n if (node.children.length > 0) common.children = node.children.map((child) => child.id);\n return common;\n}\n\nfunction wrapMode(value: unknown): FrescoTextWrapMode | undefined {\n if (value === false) return \"none\";\n if (value === true) return \"wrap\";\n if (value === \"end\") return \"truncate-end\";\n if (value === \"middle\") return \"truncate-middle\";\n return enumValue(value, wrapModes);\n}\n\nfunction wrappingEnabled(value: unknown, mode: FrescoTextWrapMode | undefined): boolean {\n if (value === undefined || value === false) return false;\n return !(mode?.startsWith(\"truncate\") ?? false);\n}\n\n/** Convert one internal Fresco node into its strict public render protocol node. */\nexport function frescoNodeToRenderNode(node: FrescoNode): FrescoRenderNode {\n const common = commonFields(node);\n\n if (node.type === \"root\" || node.type === \"box\") {\n return { ...common, nodeType: node.type };\n }\n\n if (node.type === \"text\") {\n const renderNode: FrescoTextRenderNode = { ...common, nodeType: \"text\" };\n const text = node.text ?? stringValue(firstValue(node.props, \"text\", \"content\"));\n const mode = wrapMode(node.props.wrap);\n if (text !== undefined) renderNode.text = text;\n if (node.props.wrap !== undefined) {\n renderNode.wrap = wrappingEnabled(node.props.wrap, mode);\n if (mode) renderNode.wrapMode = mode;\n }\n return renderNode;\n }\n\n if (node.type === \"raw\") {\n const renderNode: FrescoRawRenderNode = { ...common, nodeType: \"raw\" };\n const lines = stringLines(node.props.lines);\n if (lines) renderNode.lines = lines;\n return renderNode;\n }\n\n const renderNode: FrescoInputRenderNode = { ...common, nodeType: \"input\" };\n const value = stringValue(node.props.value);\n const placeholder = stringValue(node.props.placeholder);\n const focused = booleanValue(firstValue(node.props, \"focused\", \"focus\"));\n const cursor = numberValue(node.props.cursor);\n const selectionStart = numberValue(firstValue(node.props, \"selectionStart\", \"selection_start\"));\n const selectionEnd = numberValue(firstValue(node.props, \"selectionEnd\", \"selection_end\"));\n const mask = booleanValue(node.props.mask);\n const maskChar = stringValue(firstValue(node.props, \"maskChar\", \"mask_char\", \"mask-char\"));\n if (value !== undefined) renderNode.value = value;\n if (placeholder !== undefined) renderNode.placeholder = placeholder;\n if (focused !== undefined) renderNode.focused = focused;\n if (cursor !== undefined) renderNode.cursor = cursor;\n if (selectionStart !== undefined) renderNode.selectionStart = selectionStart;\n if (selectionEnd !== undefined) renderNode.selectionEnd = selectionEnd;\n if (mask !== undefined) renderNode.mask = mask;\n if (maskChar !== undefined) renderNode.maskChar = maskChar;\n return renderNode;\n}\n","/**\n * Ink-compatible screen reader helpers.\n */\n\nimport type { InjectionKey, Ref } from \"vue\";\nimport type { FrescoNode, NativeRenderNode } from \"./renderer.js\";\nimport { normalizeFrescoStyle } from \"./renderPayload.js\";\n\n/** Injection key exposing whether screen-reader output is active. */\nexport const SCREEN_READER_KEY: InjectionKey<Readonly<Ref<boolean>>> =\n Symbol(\"fresco-screen-reader\");\n\n/** Semantic roles supported by Fresco screen-reader serialization. */\nexport type AriaRole =\n | \"button\"\n | \"checkbox\"\n | \"combobox\"\n | \"dialog\"\n | \"list\"\n | \"listbox\"\n | \"listitem\"\n | \"menu\"\n | \"menuitem\"\n | \"option\"\n | \"progressbar\"\n | \"radio\"\n | \"radiogroup\"\n | \"scrollbar\"\n | \"slider\"\n | \"tab\"\n | \"tablist\"\n | \"table\"\n | \"textbox\"\n | \"timer\"\n | \"toolbar\";\n\n/** Accessible state rendered alongside the semantic node description. */\nexport interface AriaState {\n busy?: boolean;\n checked?: boolean;\n disabled?: boolean;\n expanded?: boolean;\n multiline?: boolean;\n multiselectable?: boolean;\n readonly?: boolean;\n required?: boolean;\n selected?: boolean;\n orientation?: \"horizontal\" | \"vertical\";\n valueMin?: number;\n valueMax?: number;\n valueNow?: number;\n}\n\n/** Read the Ink- and Fresco-compatible screen-reader environment flags. */\nexport function isScreenReaderEnabledByDefault(): boolean {\n return process.env.INK_SCREEN_READER === \"true\" || process.env.FRESCO_SCREEN_READER === \"true\";\n}\n\nfunction stringValue(value: unknown): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") return String(value);\n return undefined;\n}\n\nfunction nodeText(node: FrescoNode): string {\n const ariaLabel = stringValue(node.props[\"aria-label\"]);\n if (ariaLabel !== undefined) return ariaLabel;\n if (node.text !== undefined) return node.text;\n\n const propText = node.props.text ?? node.props.content;\n if (typeof propText === \"string\" || typeof propText === \"number\") return String(propText);\n\n if (node.type === \"input\") {\n const value = node.props.value;\n const placeholder = node.props.placeholder;\n if (typeof value === \"string\" || typeof value === \"number\") return String(value);\n if (typeof placeholder === \"string\" || typeof placeholder === \"number\")\n return String(placeholder);\n }\n\n return \"\";\n}\n\nfunction flexDirection(node: FrescoNode): string {\n const style = (node.props.style ?? {}) as Record<string, unknown>;\n return stringValue(style.flexDirection ?? style.flex_direction) ?? \"column\";\n}\n\nfunction ariaRole(node: FrescoNode): AriaRole | undefined {\n return stringValue(node.props[\"aria-role\"]) as AriaRole | undefined;\n}\n\nfunction ariaState(node: FrescoNode): AriaState | undefined {\n const state = node.props[\"aria-state\"];\n if (!state || typeof state !== \"object\") return undefined;\n return state as AriaState;\n}\n\nfunction isAriaHidden(node: FrescoNode): boolean {\n return node.props[\"aria-hidden\"] === true;\n}\n\n/** Serialize a Fresco tree into deterministic semantic screen-reader text. */\nexport function treeToScreenReaderString(\n node: FrescoNode,\n options: { parentRole?: AriaRole } = {},\n): string {\n if (isAriaHidden(node)) return \"\";\n\n let output = \"\";\n const text = nodeText(node);\n\n if (node.type === \"text\" || node.type === \"input\") {\n output = `${text}${node.children.map((child) => treeToScreenReaderString(child, options)).join(\"\")}`;\n } else if (text) {\n output = text;\n } else {\n const direction = flexDirection(node);\n const separator = direction === \"row\" || direction === \"row-reverse\" ? \" \" : \"\\n\";\n const children =\n direction === \"row-reverse\" || direction === \"column-reverse\"\n ? [...node.children].reverse()\n : node.children;\n\n const role = ariaRole(node);\n output = children\n .map((child) => treeToScreenReaderString(child, { parentRole: role }))\n .filter(Boolean)\n .join(separator);\n }\n\n const state = ariaState(node);\n if (state) {\n const stateDescription = Object.entries(state)\n .filter(([, value]) => value !== false && value !== undefined && value !== null)\n .map(([key, value]) => (value === true ? key : `${key}: ${String(value)}`))\n .join(\", \");\n\n if (stateDescription) {\n output = `(${stateDescription}) ${output}`;\n }\n }\n\n const role = ariaRole(node);\n if (role && role !== options.parentRole) {\n output = `${role}: ${output}`;\n }\n\n return output;\n}\n\n/** Convert a Fresco tree into the minimal native nodes used for screen-reader output. */\nexport function treeToScreenReaderRenderNodes(root: FrescoNode): NativeRenderNode[] {\n const output = treeToScreenReaderString(root);\n const rootStyle = normalizeFrescoStyle(root.props.style) ?? {};\n const nodes: NativeRenderNode[] = [\n {\n id: root.id,\n nodeType: \"root\",\n style: {\n ...rootStyle,\n flexDirection: \"column\",\n },\n },\n ];\n\n if (!output) return nodes;\n\n const textId = root.id - 1;\n nodes[0].children = [textId];\n nodes.push({\n id: textId,\n nodeType: \"text\",\n text: output,\n wrap: true,\n wrapMode: \"wrap\",\n });\n\n return nodes;\n}\n","/**\n * useApp - App context composable\n */\n\nimport { ref, provide, inject, type InjectionKey, type Ref } from \"vue\";\n\nexport const APP_KEY: InjectionKey<UseAppReturn> = Symbol(\"fresco-app\");\n\nexport interface UseAppReturn {\n /** Terminal width */\n width: Ref<number>;\n /** Terminal height */\n height: Ref<number>;\n /** Whether app is running */\n isRunning: Ref<boolean>;\n /** Exit the app */\n exit: (errorOrResult?: unknown) => void;\n /** Force re-render */\n render: () => void;\n /** Clear the screen */\n clear: () => void;\n /** Wait until pending render output has flushed */\n waitUntilRenderFlush: () => Promise<void>;\n}\n\nexport interface AppContextControls {\n exit?: (errorOrResult?: unknown) => void;\n render?: () => void;\n clear?: () => void;\n waitUntilRenderFlush?: () => Promise<void>;\n stdout?: NodeJS.WriteStream;\n width?: number;\n height?: number;\n}\n\n/**\n * Create app context (use at app root)\n */\nexport function createAppContext(controls: AppContextControls = {}): UseAppReturn {\n const width = ref(controls.width ?? 80);\n const height = ref(controls.height ?? 24);\n const isRunning = ref(true);\n\n const exit = (errorOrResult?: unknown) => {\n isRunning.value = false;\n controls.exit?.(errorOrResult);\n };\n\n const render = () => {\n controls.render?.();\n };\n\n const clear = () => {\n controls.clear?.();\n };\n\n const waitUntilRenderFlush = () => {\n return controls.waitUntilRenderFlush?.() ?? Promise.resolve();\n };\n\n const stdout = controls.stdout ?? (typeof process !== \"undefined\" ? process.stdout : undefined);\n\n // Try to get terminal size\n if (stdout) {\n width.value = controls.width ?? stdout.columns ?? 80;\n height.value = controls.height ?? stdout.rows ?? 24;\n\n stdout.on?.(\"resize\", () => {\n width.value = stdout.columns ?? 80;\n height.value = stdout.rows ?? 24;\n });\n }\n\n return {\n width,\n height,\n isRunning,\n exit,\n render,\n clear,\n waitUntilRenderFlush,\n };\n}\n\n/**\n * Provide app context to descendants\n */\nexport function provideApp(context: UseAppReturn) {\n provide(APP_KEY, context);\n}\n\n/**\n * Use app context\n */\nexport function useApp(): UseAppReturn {\n const context = inject(APP_KEY);\n\n if (!context) {\n // Return defaults if not in app context\n return {\n width: ref(80),\n height: ref(24),\n isRunning: ref(false),\n exit: () => {},\n render: () => {},\n clear: () => {},\n waitUntilRenderFlush: () => Promise.resolve(),\n };\n }\n\n return context;\n}\n\n/**\n * Use terminal dimensions\n */\nexport function useTerminalSize() {\n const { width, height } = useApp();\n return { width, height };\n}\n\n/**\n * Exit handler\n */\nexport function useExit() {\n const { exit } = useApp();\n return exit;\n}\n","/**\n * useFocus - Focus management composable\n */\n\nimport {\n computed,\n inject,\n isRef,\n onUnmounted,\n provide,\n ref,\n watch,\n type InjectionKey,\n type Ref,\n} from \"vue\";\n\nexport const FOCUS_KEY: InjectionKey<FocusManager> = Symbol(\"fresco-focus\");\nconst FOCUS_PARENT_KEY: InjectionKey<string | null | Ref<string | null | undefined>> =\n Symbol(\"fresco-focus-parent\");\n\nexport interface UseFocusOptions {\n /** Enable or disable this focus target while keeping its logical identity */\n isActive?: boolean | Ref<boolean>;\n /** Auto-focus this component when nothing else is focused */\n autoFocus?: boolean;\n /** Focus ID for this element */\n id?: string;\n /** Parent focus ID used to derive descendant-focus state */\n parentId?: string | null | Ref<string | null | undefined>;\n /** Descendant that receives focus when this target is focused */\n delegateFocusTo?: string | null | Ref<string | null | undefined>;\n /** Keep programmatic and sequential focus inside this target subtree */\n trapFocus?: boolean | Ref<boolean>;\n}\n\n/** Registration state retained for one focusable target. */\nexport interface FocusRegistrationOptions {\n /** Whether the target participates in focus traversal. @default true */\n isActive?: boolean;\n /** Focus the target when no target currently owns focus. @default false */\n autoFocus?: boolean;\n /** Registered parent used for descendant and trap boundaries. @default null */\n parentId?: string | null | undefined;\n /** Registered descendant that receives delegated focus. @default null */\n delegateFocusTo?: string | null | undefined;\n}\n\nexport interface FocusManager {\n /** Currently focused element ID */\n focusedId: Ref<string | null>;\n /** Ink-compatible currently focused ID alias */\n activeId: Readonly<Ref<string | undefined>>;\n /** All active focusable element IDs */\n focusableIds: Readonly<Ref<string[]>>;\n /** Innermost active focus-trap root, when present */\n activeTrapId: Readonly<Ref<string | undefined>>;\n /** Whether focus management is enabled */\n isEnabled: Ref<boolean>;\n /** Enable focus management */\n enableFocus: () => void;\n /** Disable focus management */\n disableFocus: () => void;\n /** Focus a specific element */\n focus: (id: string) => void;\n /** Focus next element */\n focusNext: () => void;\n /** Focus previous element */\n focusPrevious: () => void;\n /** Register a focusable element */\n register: (id: string, options?: FocusRegistrationOptions) => void;\n /** Unregister a focusable element */\n unregister: (id: string) => void;\n /** Activate or deactivate a focusable element while keeping its order */\n setActive: (id: string, isActive: boolean) => void;\n /** Reparent a focusable element while keeping its registration order */\n setParent: (id: string, parentId: string | null | undefined) => void;\n /** Change the descendant that receives delegated focus */\n setDelegate: (id: string, delegateFocusTo: string | null | undefined) => void;\n /** Activate a nested focus boundary rooted at a registered target */\n trapFocus: (id: string) => void;\n /** Release a focus boundary and every nested boundary that depends on it */\n releaseFocusTrap: (id: string) => void;\n /** Whether a registered descendant of the target currently owns focus */\n hasFocusedDescendant: (id: string) => boolean;\n}\n\ninterface Focusable {\n id: string;\n isActive: boolean;\n parentId: string | null;\n delegateFocusTo: string | null;\n}\n\nfunction activeFocusables(focusables: Focusable[]): Focusable[] {\n return focusables.filter((focusable) => focusable.isActive);\n}\n\n/**\n * Create a focus manager (use at app root)\n */\nexport function createFocusManager(): FocusManager {\n const focusedId = ref<string | null>(null);\n const activeId = computed(() => focusedId.value ?? undefined);\n const focusables = ref<Focusable[]>([]);\n const focusableIds = computed(() => activeFocusables(focusables.value).map(({ id }) => id));\n const trapStack = ref<string[]>([]);\n const activeTrapId = computed(() => trapStack.value.at(-1));\n const isEnabled = ref(true);\n\n const findFocusable = (id: string) => focusables.value.find((focusable) => focusable.id === id);\n\n const isWithin = (id: string, rootId: string) => {\n let currentId: string | null = id;\n const visited = new Set<string>();\n while (currentId !== null) {\n if (currentId === rootId) return true;\n if (visited.has(currentId)) return false;\n visited.add(currentId);\n currentId = findFocusable(currentId)?.parentId ?? null;\n }\n return false;\n };\n\n const allowedByActiveTrap = (id: string) => {\n const trapId = activeTrapId.value;\n return trapId === undefined || isWithin(id, trapId);\n };\n\n const scopedFocusables = () =>\n activeFocusables(focusables.value).filter(({ id }) => allowedByActiveTrap(id));\n\n const delegatedTarget = (target: Focusable) => {\n let current = target;\n const visited = new Set<string>();\n while (current.delegateFocusTo !== null && !visited.has(current.id)) {\n visited.add(current.id);\n const delegated = findFocusable(current.delegateFocusTo);\n if (\n !delegated?.isActive ||\n !isWithin(delegated.id, current.id) ||\n !allowedByActiveTrap(delegated.id)\n ) {\n break;\n }\n current = delegated;\n }\n return current;\n };\n\n const focus = (id: string) => {\n const target = findFocusable(id);\n if (isEnabled.value && target?.isActive && allowedByActiveTrap(id)) {\n focusedId.value = delegatedTarget(target).id;\n }\n };\n\n const moveFocus = (offset: -1 | 1) => {\n const active = scopedFocusables();\n if (!isEnabled.value || active.length === 0) return;\n\n const currentIndex = active.findIndex((focusable) => focusable.id === focusedId.value);\n for (let distance = 1; distance <= active.length; distance += 1) {\n const index =\n currentIndex === -1\n ? offset === 1\n ? distance - 1\n : active.length - distance\n : (currentIndex + offset * distance + active.length * 2) % active.length;\n const candidate = active[index];\n if (!candidate) continue;\n const resolved = delegatedTarget(candidate);\n if (resolved.id !== focusedId.value || active.length === 1) {\n focusedId.value = resolved.id;\n return;\n }\n }\n };\n\n const focusNext = () => moveFocus(1);\n\n const focusPrevious = () => moveFocus(-1);\n\n const register: FocusManager[\"register\"] = (id, options = {}) => {\n const existing = focusables.value.find((focusable) => focusable.id === id);\n if (existing) {\n existing.isActive = options.isActive ?? existing.isActive;\n if (\"parentId\" in options) {\n existing.parentId = options.parentId ?? null;\n }\n if (\"delegateFocusTo\" in options) {\n existing.delegateFocusTo = options.delegateFocusTo ?? null;\n }\n } else {\n focusables.value.push({\n id,\n isActive: options.isActive ?? true,\n parentId: options.parentId ?? null,\n delegateFocusTo: options.delegateFocusTo ?? null,\n });\n }\n\n if (options.autoFocus && focusedId.value === null && options.isActive !== false) {\n focus(id);\n }\n };\n\n const unregister = (id: string) => {\n const index = focusables.value.findIndex((focusable) => focusable.id === id);\n if (index !== -1) {\n const trapIndex = trapStack.value.indexOf(id);\n if (trapIndex !== -1) trapStack.value.splice(trapIndex);\n focusables.value.splice(index, 1);\n if (focusedId.value === id) {\n focusedId.value = null;\n }\n }\n };\n\n const setActive = (id: string, isActive: boolean) => {\n const focusable = focusables.value.find((item) => item.id === id);\n if (!focusable) return;\n\n focusable.isActive = isActive;\n if (!isActive) {\n const trapIndex = trapStack.value.indexOf(id);\n if (trapIndex !== -1) trapStack.value.splice(trapIndex);\n }\n if (!isActive && focusedId.value === id) {\n focusedId.value = null;\n }\n };\n\n const setParent: FocusManager[\"setParent\"] = (id, parentId) => {\n const focusable = findFocusable(id);\n if (!focusable) return;\n\n focusable.parentId = parentId ?? null;\n if (focusedId.value !== null && !allowedByActiveTrap(focusedId.value)) {\n focusedId.value = null;\n }\n };\n\n const setDelegate: FocusManager[\"setDelegate\"] = (id, delegateFocusTo) => {\n const focusable = findFocusable(id);\n if (focusable) focusable.delegateFocusTo = delegateFocusTo ?? null;\n };\n\n const trapFocus: FocusManager[\"trapFocus\"] = (id) => {\n const target = findFocusable(id);\n if (!target?.isActive || !allowedByActiveTrap(id)) return;\n if (activeTrapId.value !== id) trapStack.value.push(id);\n if (focusedId.value === null || !isWithin(focusedId.value, id)) focus(id);\n };\n\n const releaseFocusTrap: FocusManager[\"releaseFocusTrap\"] = (id) => {\n const index = trapStack.value.indexOf(id);\n if (index === -1) return;\n trapStack.value.splice(index);\n const remaining = activeTrapId.value;\n if (\n remaining !== undefined &&\n focusedId.value !== null &&\n !isWithin(focusedId.value, remaining)\n ) {\n focus(remaining);\n }\n };\n\n const hasFocusedDescendant: FocusManager[\"hasFocusedDescendant\"] = (id) => {\n let currentId = focusedId.value;\n if (currentId === null || currentId === id) return false;\n\n const visited = new Set<string>();\n\n while (true) {\n if (visited.has(currentId)) return false;\n visited.add(currentId);\n const current = findFocusable(currentId);\n const parentId = current?.parentId ?? null;\n if (parentId === null) return false;\n if (parentId === id) return true;\n currentId = parentId;\n }\n };\n\n const enableFocus = () => {\n isEnabled.value = true;\n };\n\n const disableFocus = () => {\n isEnabled.value = false;\n focusedId.value = null;\n };\n\n return {\n focusedId,\n activeId,\n focusableIds,\n activeTrapId,\n isEnabled,\n enableFocus,\n disableFocus,\n focus,\n focusNext,\n focusPrevious,\n register,\n unregister,\n setActive,\n setParent,\n setDelegate,\n trapFocus,\n releaseFocusTrap,\n hasFocusedDescendant,\n };\n}\n\n/**\n * Provide focus manager to descendants\n */\nexport function provideFocusManager(manager: FocusManager) {\n provide(FOCUS_KEY, manager);\n}\n\n/** Make an owning focus target the default parent for nested useFocus calls. */\nexport function provideFocusScope(parentId: string | null | Ref<string | null | undefined>) {\n provide(FOCUS_PARENT_KEY, parentId);\n}\n\n/**\n * Use focus management\n */\nexport function useFocus(options: UseFocusOptions = {}) {\n const inheritedParentId = inject(FOCUS_PARENT_KEY, null);\n const {\n autoFocus = false,\n id = `focus-${Math.random().toString(36).slice(2)}`,\n isActive: isActiveOption = true,\n delegateFocusTo: delegateFocusToOption = null,\n trapFocus: trapFocusOption = false,\n } = options;\n const parentIdOption = \"parentId\" in options ? (options.parentId ?? null) : inheritedParentId;\n\n const manager = inject(FOCUS_KEY, null);\n const localFocused = ref(autoFocus);\n const active = isRef(isActiveOption) ? isActiveOption : ref(isActiveOption);\n const parentId = isRef(parentIdOption) ? parentIdOption : ref(parentIdOption);\n const delegateFocusTo = isRef(delegateFocusToOption)\n ? delegateFocusToOption\n : ref(delegateFocusToOption);\n const trapsFocus = isRef(trapFocusOption) ? trapFocusOption : ref(trapFocusOption);\n\n const isFocused = computed(() => {\n if (manager) {\n return manager.isEnabled.value && manager.focusedId.value === id;\n }\n return active.value && localFocused.value;\n });\n const hasFocusedDescendant = computed(() => (manager ? manager.hasFocusedDescendant(id) : false));\n const isFocusTrapActive = computed(() => manager?.activeTrapId.value === id);\n\n const focus = (targetId = id) => {\n if (manager) {\n manager.focus(targetId);\n } else if (targetId === id) {\n localFocused.value = true;\n }\n };\n\n const blur = () => {\n if (manager) {\n if (manager.focusedId.value === id) {\n manager.focusedId.value = null;\n }\n } else {\n localFocused.value = false;\n }\n };\n\n if (manager) {\n manager.register(id, {\n isActive: active.value,\n autoFocus,\n parentId: parentId.value,\n delegateFocusTo: delegateFocusTo.value,\n });\n if (trapsFocus.value) manager.trapFocus(id);\n\n watch(\n active,\n (enabled) => {\n manager.setActive(id, enabled);\n if (enabled && trapsFocus.value) manager.trapFocus(id);\n if (enabled && autoFocus && !manager.focusedId.value) manager.focus(id);\n },\n { immediate: false },\n );\n watch(\n parentId,\n (nextParentId) => {\n manager.setParent(id, nextParentId);\n },\n { immediate: false },\n );\n watch(\n delegateFocusTo,\n (nextDelegate) => {\n manager.setDelegate(id, nextDelegate);\n },\n { immediate: false },\n );\n watch(\n trapsFocus,\n (trapped) => {\n if (trapped) manager.trapFocus(id);\n else manager.releaseFocusTrap(id);\n },\n { immediate: false },\n );\n\n onUnmounted(() => {\n manager.releaseFocusTrap(id);\n manager.unregister(id);\n });\n }\n\n return {\n id,\n isFocused,\n hasFocusedDescendant,\n isFocusTrapActive,\n focus,\n blur,\n };\n}\n\n/**\n * Use global focus manager controls.\n */\nexport function useFocusManager() {\n const manager = inject(FOCUS_KEY, null);\n\n if (!manager) {\n const empty = ref<string[]>([]);\n const activeId = ref<string | undefined>(undefined);\n return {\n enableFocus: () => {},\n disableFocus: () => {},\n focusNext: () => {},\n focusPrevious: () => {},\n focus: (_id: string) => {},\n hasFocusedDescendant: (_id: string) => false,\n trapFocus: (_id: string) => {},\n releaseFocusTrap: (_id: string) => {},\n setDelegate: (_id: string, _delegateFocusTo: string | null | undefined) => {},\n activeId,\n focusableIds: empty,\n activeTrapId: activeId,\n };\n }\n\n return {\n enableFocus: manager.enableFocus,\n disableFocus: manager.disableFocus,\n focusNext: manager.focusNext,\n focusPrevious: manager.focusPrevious,\n focus: manager.focus,\n hasFocusedDescendant: manager.hasFocusedDescendant,\n trapFocus: manager.trapFocus,\n releaseFocusTrap: manager.releaseFocusTrap,\n setDelegate: manager.setDelegate,\n activeId: manager.activeId,\n focusableIds: manager.focusableIds,\n activeTrapId: manager.activeTrapId,\n };\n}\n","/**\n * Stream composables matching Ink's stdin/stdout/stderr helpers.\n */\n\nimport { inject, type InjectionKey } from \"vue\";\n\nconst BRACKETED_PASTE_ENABLE = \"\\x1B[?2004h\";\nconst BRACKETED_PASTE_DISABLE = \"\\x1B[?2004l\";\n\nexport const STREAMS_KEY: InjectionKey<StreamsContext> = Symbol(\"fresco-streams\");\n\nexport interface StreamsContextOptions {\n stdin?: NodeJS.ReadStream;\n stdout?: NodeJS.WriteStream;\n stderr?: NodeJS.WriteStream;\n exitOnCtrlC?: boolean;\n interactive?: boolean;\n writeToStdout?: (data: string) => void;\n writeToStderr?: (data: string) => void;\n}\n\nexport interface StreamsContext {\n stdin: NodeJS.ReadStream;\n stdout: NodeJS.WriteStream;\n stderr: NodeJS.WriteStream;\n setRawMode: (isRawMode: boolean) => void;\n isRawModeSupported: boolean;\n setBracketedPasteMode: (isEnabled: boolean) => void;\n writeToStdout: (data: string) => void;\n writeToStderr: (data: string) => void;\n internal_exitOnCtrlC: boolean;\n}\n\nexport interface UseStdinReturn {\n stdin: NodeJS.ReadStream;\n setRawMode: (isRawMode: boolean) => void;\n isRawModeSupported: boolean;\n internal_exitOnCtrlC: boolean;\n}\n\nexport interface UseStdoutReturn {\n stdout: NodeJS.WriteStream;\n write: (data: string) => void;\n}\n\nexport interface UseStderrReturn {\n stderr: NodeJS.WriteStream;\n write: (data: string) => void;\n}\n\nexport function createStreamsContext(options: StreamsContextOptions = {}): StreamsContext {\n const stdin = options.stdin ?? process.stdin;\n const stdout = options.stdout ?? process.stdout;\n const stderr = options.stderr ?? process.stderr;\n const isInteractive = options.interactive ?? true;\n const writeToStdout = options.writeToStdout ?? ((data: string) => stdout.write(data));\n const writeToStderr = options.writeToStderr ?? ((data: string) => stderr.write(data));\n let rawModeDepth = 0;\n let pendingRawModeDisable = false;\n let bracketedPasteDepth = 0;\n\n return {\n stdin,\n stdout,\n stderr,\n setRawMode: (isRawMode: boolean) => {\n if (!isInteractive || typeof stdin.setRawMode !== \"function\") return;\n\n stdin.setEncoding?.(\"utf8\");\n\n if (isRawMode) {\n pendingRawModeDisable = false;\n if (rawModeDepth === 0) {\n stdin.ref?.();\n stdin.setRawMode(true);\n }\n rawModeDepth += 1;\n return;\n }\n\n if (rawModeDepth === 0) return;\n rawModeDepth -= 1;\n if (rawModeDepth > 0) return;\n\n pendingRawModeDisable = true;\n queueMicrotask(() => {\n if (!pendingRawModeDisable || rawModeDepth > 0) return;\n pendingRawModeDisable = false;\n stdin.setRawMode?.(false);\n stdin.unref?.();\n });\n },\n isRawModeSupported: isInteractive && typeof stdin.setRawMode === \"function\",\n setBracketedPasteMode: (isEnabled: boolean) => {\n if (!isInteractive) return;\n\n if (isEnabled) {\n bracketedPasteDepth += 1;\n if (bracketedPasteDepth === 1) stdout.write(BRACKETED_PASTE_ENABLE);\n return;\n }\n\n if (bracketedPasteDepth === 0) return;\n bracketedPasteDepth -= 1;\n if (bracketedPasteDepth === 0) stdout.write(BRACKETED_PASTE_DISABLE);\n },\n writeToStdout,\n writeToStderr,\n internal_exitOnCtrlC: options.exitOnCtrlC ?? true,\n };\n}\n\nexport function useStreamsContext(): StreamsContext {\n return inject(STREAMS_KEY) ?? createStreamsContext();\n}\n\nexport function useStdin(): UseStdinReturn {\n const streams = useStreamsContext();\n\n return {\n stdin: streams.stdin,\n setRawMode: streams.setRawMode,\n isRawModeSupported: streams.isRawModeSupported,\n internal_exitOnCtrlC: streams.internal_exitOnCtrlC,\n };\n}\n\nexport function useStdout(): UseStdoutReturn {\n const { stdout, writeToStdout } = useStreamsContext();\n\n return {\n stdout,\n write: writeToStdout,\n };\n}\n\nexport function useStderr(): UseStderrReturn {\n const { stderr, writeToStderr } = useStreamsContext();\n\n return {\n stderr,\n write: writeToStderr,\n };\n}\n","/**\n * useCursor - terminal cursor positioning.\n */\n\nimport { inject, onUnmounted, type InjectionKey } from \"vue\";\n\nexport interface CursorPosition {\n x: number;\n y: number;\n}\n\nexport interface CursorContext {\n setCursorPosition: (position: CursorPosition | undefined) => void;\n}\n\nexport const CURSOR_KEY: InjectionKey<CursorContext> = Symbol(\"fresco-cursor\");\n\nasync function loadNative() {\n return import(\"@vizejs/fresco-native\");\n}\n\nexport function createCursorContext(\n setCursorPosition: (position: CursorPosition | undefined) => void,\n): CursorContext {\n return {\n setCursorPosition,\n };\n}\n\nfunction setNativeCursorPosition(position: CursorPosition | undefined) {\n void loadNative()\n .then((native) => {\n if (position) {\n native.setCursor(position.x, position.y);\n native.showCursor();\n } else {\n native.hideCursor();\n }\n })\n .catch(() => {\n // Cursor control is best-effort outside a mounted Fresco app.\n });\n}\n\nexport function useCursor() {\n const context = inject(CURSOR_KEY, null);\n let didSetCursor = false;\n\n const setCursorPosition = (position: CursorPosition | undefined) => {\n didSetCursor = true;\n\n if (context) {\n context.setCursorPosition(position);\n return;\n }\n\n setNativeCursorPosition(position);\n };\n\n onUnmounted(() => {\n if (didSetCursor) {\n context?.setCursorPosition(undefined);\n }\n });\n\n return {\n setCursorPosition,\n };\n}\n","import type { FrescoInputEvent } from \"./protocol.js\";\nimport type { FrescoHostNode, FrescoInputDispatchResult, createRenderer } from \"./renderer.js\";\n\n/** Renderer surface needed to route terminal input to the active focus target. */\nexport type FocusRoutingRenderer = Pick<\n ReturnType<typeof createRenderer>,\n \"dispatchInput\" | \"findNodeByFocusId\"\n>;\n\nexport type DefaultInputAction = \"focus-next\" | \"focus-previous\" | \"exit\" | undefined;\n\ninterface DefaultInputPacket {\n eventType: string;\n key?: string;\n char?: string;\n modifiers?: { ctrl?: boolean };\n}\n\n/** Find the live host node registered for one logical focus target. */\nexport function findHostNodeByFocusId(\n root: FrescoHostNode,\n focusId: string,\n): FrescoHostNode | undefined {\n if (root.props.focusId === focusId) return root;\n for (const child of root.children) {\n const match = findHostNodeByFocusId(child, focusId);\n if (match) return match;\n }\n return undefined;\n}\n\n/** Derive the application fallback after focused handlers have had first refusal. */\nexport function defaultInputAction(\n input: DefaultInputPacket,\n result: Pick<FrescoInputDispatchResult, \"defaultPrevented\"> | undefined,\n exitOnCtrlC: boolean,\n): DefaultInputAction {\n if (result?.defaultPrevented || input.eventType !== \"key\") return undefined;\n if (input.key === \"tab\") return \"focus-next\";\n if (input.key === \"backtab\") return \"focus-previous\";\n if (exitOnCtrlC && input.char === \"c\" && input.modifiers?.ctrl) return \"exit\";\n return undefined;\n}\n\n/**\n * Route one normalized terminal packet to the live host node associated with\n * the active logical focus ID.\n */\nexport function routeFocusedInput(\n renderer: FocusRoutingRenderer,\n root: FrescoHostNode | null,\n focusId: string | undefined,\n input: FrescoInputEvent,\n): FrescoInputDispatchResult | undefined {\n if (!root || focusId === undefined) return undefined;\n const target = renderer.findNodeByFocusId(root, focusId);\n return target ? renderer.dispatchInput(target.id, input) : undefined;\n}\n","/**\n * Shared post-render layout metrics.\n */\n\nimport type { LayoutResultNapi } from \"@vizejs/fresco-native\";\n\n/** Renderer element or component public instance accepted by layout helpers. */\nexport interface DOMElement {\n id?: number;\n $el?: {\n id?: number;\n };\n}\n\nlet lastRenderLayouts: LayoutResultNapi[] = [];\n\n/** Replace the layout snapshot exposed by the most recent native render. */\nexport function updateLastRenderLayouts(layouts: LayoutResultNapi[]) {\n lastRenderLayouts = layouts;\n}\n\n/** Read the complete layout snapshot produced by the latest native frame. */\nexport function getLastRenderLayouts(): readonly LayoutResultNapi[] {\n return lastRenderLayouts;\n}\n\n/** Look up the latest native layout for an element or component public instance. */\nexport function getLastRenderLayout(node: DOMElement | null | undefined): LayoutResultNapi | null {\n const id = node?.id ?? node?.$el?.id;\n if (id === undefined) return null;\n return lastRenderLayouts.find((layout) => layout.id === id) ?? null;\n}\n\n/** Return the latest element dimensions, falling back to zero before layout. */\nexport function measureElement(node: DOMElement): { width: number; height: number } {\n const layout = getLastRenderLayout(node);\n return {\n width: layout?.width ?? 0,\n height: layout?.height ?? 0,\n };\n}\n","import type { LayoutResultNapi } from \"@vizejs/fresco-native\";\n\nimport type { MouseEvent } from \"./protocol.js\";\nimport type { FrescoHostNode } from \"./renderer.js\";\n\ninterface MouseInputRenderer {\n hitTest(\n root: FrescoHostNode,\n x: number,\n y: number,\n layouts: readonly LayoutResultNapi[],\n ): FrescoHostNode | undefined;\n dispatchInput(targetId: number, event: MouseEvent): unknown;\n}\n\ninterface MouseEventSink {\n value: MouseEvent | null;\n}\n\n/** Per-application pointer target retained between normalized mouse packets. */\nexport interface MouseRoutingState {\n hoveredTargetId: number | undefined;\n}\n\n/** Create isolated pointer-routing state for one mounted Fresco application. */\nexport function createMouseRoutingState(): MouseRoutingState {\n return { hoveredTargetId: undefined };\n}\n\nconst mountedRootStates = new WeakMap<FrescoHostNode, MouseRoutingState>();\n\nfunction stateForMountedRoot(root: FrescoHostNode): MouseRoutingState {\n const existing = mountedRootStates.get(root);\n if (existing) return existing;\n\n const state = createMouseRoutingState();\n mountedRootStates.set(root, state);\n return state;\n}\n\nfunction pointerTransition(event: MouseEvent, kind: \"enter\" | \"leave\"): MouseEvent {\n return { ...event, kind };\n}\n\nfunction routePointerTransitions(\n renderer: MouseInputRenderer,\n target: FrescoHostNode | undefined,\n event: MouseEvent,\n state: MouseRoutingState,\n publish?: (event: MouseEvent) => void,\n): void {\n if (event.kind !== \"moved\" && event.kind !== \"drag\") return;\n const nextTargetId = target?.id;\n if (state.hoveredTargetId === nextTargetId) return;\n\n const previousTargetId = state.hoveredTargetId;\n state.hoveredTargetId = nextTargetId;\n if (previousTargetId !== undefined) {\n const leave = pointerTransition(event, \"leave\");\n try {\n renderer.dispatchInput(previousTargetId, leave);\n } finally {\n publish?.(leave);\n }\n }\n if (nextTargetId !== undefined) {\n const enter = pointerTransition(event, \"enter\");\n try {\n renderer.dispatchInput(nextTargetId, enter);\n } finally {\n publish?.(enter);\n }\n }\n}\n\n/** Hit-test one normalized mouse packet and route it through the host tree. */\nexport function routeMouseInput(\n renderer: MouseInputRenderer,\n root: FrescoHostNode,\n event: MouseEvent,\n layouts: readonly LayoutResultNapi[],\n state?: MouseRoutingState,\n publishTransition?: (event: MouseEvent) => void,\n): void {\n const target = renderer.hitTest(root, event.x, event.y, layouts);\n if (state) routePointerTransitions(renderer, target, event, state, publishTransition);\n if (target) renderer.dispatchInput(target.id, event);\n}\n\n/** Route transitions and the native packet, publishing each even when a handler throws. */\nexport function routeAndPublishMouseInput(\n renderer: MouseInputRenderer,\n root: FrescoHostNode | null,\n event: MouseEvent,\n layouts: readonly LayoutResultNapi[],\n sink: MouseEventSink,\n state?: MouseRoutingState,\n): void {\n try {\n if (root) {\n routeMouseInput(\n renderer,\n root,\n event,\n layouts,\n state ?? stateForMountedRoot(root),\n (transition) => {\n sink.value = transition;\n },\n );\n }\n } finally {\n sink.value = event;\n }\n}\n","import type { InputEventNapi, ModifiersNapi } from \"@vizejs/fresco-native\";\nimport type { CompositionEvent, FrescoInputEvent, KeyEventType, MouseEvent } from \"./protocol.js\";\n\n/** Accept only key event phases supported by the public Fresco protocol. */\nexport function normalizeKeyEventType(value: string | undefined): KeyEventType | undefined {\n switch (value) {\n case \"press\":\n case \"repeat\":\n case \"release\":\n return value;\n default:\n return undefined;\n }\n}\n\n/** Preserve the generated native mouse contract at the public protocol boundary. */\nexport function normalizeMouseEvent(event: InputEventNapi): MouseEvent {\n return {\n type: \"mouse\",\n kind: event.mouseKind ?? undefined,\n button: event.button ?? undefined,\n x: event.x ?? 0,\n y: event.y ?? 0,\n modifiers: event.modifiers\n ? {\n ctrl: event.modifiers.ctrl,\n alt: event.modifiers.alt,\n shift: event.modifiers.shift,\n meta: event.modifiers.meta,\n super: event.modifiers.super,\n hyper: event.modifiers.hyper,\n capsLock: event.modifiers.capsLock,\n numLock: event.modifiers.numLock,\n }\n : undefined,\n };\n}\n\n/** Normalize one native input packet into the public Fresco event protocol. */\nexport function normalizeInputEvent(event: InputEventNapi): FrescoInputEvent | undefined {\n switch (event.eventType) {\n case \"resize\":\n return { type: \"resize\", width: event.width ?? 0, height: event.height ?? 0 };\n case \"paste\":\n return { type: \"paste\", text: event.text ?? \"\" };\n case \"mouse\":\n return normalizeMouseEvent(event);\n case \"focus\":\n return { type: \"focus\", focused: event.key === \"gained\" };\n case \"compositionstart\":\n case \"compositionupdate\":\n case \"compositionend\":\n return {\n type: event.eventType as CompositionEvent[\"type\"],\n text: event.text ?? \"\",\n cursor: event.cursor ?? 0,\n };\n case \"key\": {\n const modifiers: Partial<ModifiersNapi> = event.modifiers ?? {};\n return {\n type: \"key\",\n key: event.key ?? undefined,\n char: event.char ?? undefined,\n ctrl: modifiers.ctrl ?? false,\n alt: modifiers.alt ?? false,\n shift: modifiers.shift ?? false,\n meta: modifiers.meta ?? false,\n super: modifiers.super ?? false,\n hyper: modifiers.hyper ?? false,\n capsLock: modifiers.capsLock ?? false,\n numLock: modifiers.numLock ?? false,\n eventType: normalizeKeyEventType(event.keyEventType),\n };\n }\n default:\n return undefined;\n }\n}\n","import type { LayoutResultNapi } from \"@vizejs/fresco-native\";\n\nimport { normalizeFrescoStyle } from \"./renderPayload.js\";\nimport type { FrescoHostNode } from \"./renderer.js\";\n\ninterface HitRegion {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\nfunction clipsOverflow(value: unknown): boolean {\n return value === \"hidden\" || value === \"scroll\";\n}\n\nfunction clipsDescendants(node: FrescoHostNode): boolean {\n const style = normalizeFrescoStyle(node.props.style);\n return clipsOverflow(style?.overflow ?? style?.overflowX ?? style?.overflowY);\n}\n\nfunction zIndex(node: FrescoHostNode): number {\n const style = node.props.style;\n if (typeof style !== \"object\" || style === null) return 0;\n const record = style as Record<string, unknown>;\n const value = record.zIndex !== undefined ? record.zIndex : record.z_index;\n return typeof value === \"number\" &&\n Number.isInteger(value) &&\n value >= -2_147_483_648 &&\n value <= 2_147_483_647\n ? value\n : 0;\n}\n\nfunction containsPoint(layout: LayoutResultNapi, clip: HitRegion, x: number, y: number): boolean {\n return (\n x >= layout.x &&\n x < layout.x + layout.width &&\n y >= layout.y &&\n y < layout.y + layout.height &&\n x >= clip.left &&\n x < clip.right &&\n y >= clip.top &&\n y < clip.bottom\n );\n}\n\n/** Return the deepest topmost live host node under one native-layout coordinate. */\nexport function hitTest(\n nodes: ReadonlyMap<number, FrescoHostNode>,\n root: FrescoHostNode,\n x: number,\n y: number,\n layouts: readonly LayoutResultNapi[],\n): FrescoHostNode | undefined {\n if (!Number.isFinite(x) || !Number.isFinite(y)) return undefined;\n const byId = new Map(layouts.map((layout) => [layout.id, layout]));\n const unbounded: HitRegion = {\n left: Number.NEGATIVE_INFINITY,\n top: Number.NEGATIVE_INFINITY,\n right: Number.POSITIVE_INFINITY,\n bottom: Number.POSITIVE_INFINITY,\n };\n\n const visit = (node: FrescoHostNode, ancestorClip: HitRegion): FrescoHostNode | undefined => {\n const layout = byId.get(node.id);\n const clips = clipsDescendants(node);\n const childClip = layout\n ? {\n left: clips ? Math.max(ancestorClip.left, layout.x) : ancestorClip.left,\n top: clips ? Math.max(ancestorClip.top, layout.y) : ancestorClip.top,\n right: clips ? Math.min(ancestorClip.right, layout.x + layout.width) : ancestorClip.right,\n bottom: clips\n ? Math.min(ancestorClip.bottom, layout.y + layout.height)\n : ancestorClip.bottom,\n }\n : ancestorClip;\n\n if (node.children.some((child) => zIndex(child) !== 0)) {\n const children = node.children\n .map((child, index) => ({ child, index, zIndex: zIndex(child) }))\n .sort((left, right) => right.zIndex - left.zIndex || right.index - left.index);\n for (const { child } of children) {\n const target = visit(child, childClip);\n if (target) return target;\n }\n } else {\n for (let index = node.children.length - 1; index >= 0; index--) {\n const child = node.children[index];\n if (!child) continue;\n const target = visit(child, childClip);\n if (target) return target;\n }\n }\n if (!layout || !nodes.has(node.id)) return undefined;\n return containsPoint(layout, ancestorClip, x, y) ? node : undefined;\n };\n\n return visit(root, unbounded);\n}\n","/**\n * Fresco Vue Custom Renderer\n */\n\nimport {\n createRenderer as createVueRenderer,\n type RendererOptions,\n type RendererNode,\n type RendererElement,\n} from \"vue\";\nimport type { LayoutResultNapi } from \"@vizejs/fresco-native\";\nimport { findHostNodeByFocusId } from \"./focusRouting.js\";\nimport { hitTest as hitTestHostTree } from \"./hitTesting.js\";\nimport type { FrescoInputEvent, FrescoRenderNode, FrescoRenderNodeKind } from \"./protocol.js\";\nimport { frescoNodeToRenderNode } from \"./renderPayload.js\";\n\nexport type { FrescoRenderNodeKind } from \"./protocol.js\";\n\n/** Read-only view of a node owned by one Fresco renderer instance. */\nexport interface FrescoHostNode {\n /** Stable, process-unique identifier retained across keyed moves and updates. */\n readonly id: number;\n /** Native render-node kind represented by this host node. */\n readonly type: FrescoRenderNodeKind;\n /** Current Vue host properties. */\n readonly props: Readonly<Record<string, unknown>>;\n /** Ordered child host nodes. */\n readonly children: readonly FrescoHostNode[];\n /** Parent host node, or null while detached. */\n readonly parent: FrescoHostNode | null;\n /** Current text-node content when present. */\n readonly text?: string;\n}\n\n/** Declared host dimensions observed before native layout. */\nexport interface FrescoDeclaredSize {\n /** Declared width, when the host props provide one. */\n readonly width?: string | number;\n /** Declared height, when the host props provide one. */\n readonly height?: string | number;\n}\n\n/** Host-tree update category passed to lifecycle observers. */\nexport type FrescoNodeUpdateKind = \"children\" | \"props\" | \"text\";\n\n/** Position of a routed input event within its stable host-node path. */\nexport type FrescoInputEventPhase = \"capture\" | \"target\" | \"bubble\";\n\n/** Input event plus the stable host-node routing context. */\nexport interface FrescoRoutedInputEvent<Event extends FrescoInputEvent = FrescoInputEvent> {\n /** Normalized terminal input supplied by the caller. */\n readonly input: Event;\n /** Original live host node selected for this dispatch. */\n readonly target: FrescoHostNode;\n /** Node whose handlers are currently running. */\n readonly currentTarget: FrescoHostNode;\n /** Capture, target, or bubble portion of the route. */\n readonly phase: FrescoInputEventPhase;\n /** Whether a handler has prevented the associated default action. */\n readonly defaultPrevented: boolean;\n /** Whether traversal beyond the current node has been stopped. */\n readonly propagationStopped: boolean;\n /** Prevent the caller from performing the input event default action. */\n preventDefault(): void;\n /** Stop traversal after every handler on the current node has run. */\n stopPropagation(): void;\n}\n\n/** Public host prop callback accepted by routed input dispatch. */\nexport type FrescoInputEventHandler<Event extends FrescoInputEvent = FrescoInputEvent> = (\n event: FrescoRoutedInputEvent<Event>,\n) => void;\n\n/** Immutable receipt returned after one routed input dispatch. */\nexport interface FrescoInputDispatchResult {\n /** Stable target that owned the dispatch route. */\n readonly target: FrescoHostNode;\n /** Number of generic and event-specific callbacks invoked. */\n readonly handled: number;\n /** Whether any callback prevented the default action. */\n readonly defaultPrevented: boolean;\n /** Whether any callback stopped route traversal. */\n readonly propagationStopped: boolean;\n}\n/** Optional lifecycle observers for nodes owned by a Fresco renderer. */\nexport interface FrescoNodeLifecycleHooks {\n /** Observe allocation of a stable host node. @default No-op. */\n onCreate?(node: FrescoHostNode): void;\n /** Observe a committed host-tree update. @default No-op. */\n onUpdate?(node: FrescoHostNode, kind: FrescoNodeUpdateKind): void;\n /** Observe a change to declared width or height. @default No-op. */\n onResize?(node: FrescoHostNode, previous: FrescoDeclaredSize, current: FrescoDeclaredSize): void;\n /** Observe recursive disposal after descendants have been removed. @default No-op. */\n onRemove?(node: FrescoHostNode): void;\n}\n\n/** Configuration for {@link createRenderer}. */\nexport interface FrescoRendererOptions {\n /** Observe a host-tree mutation that requires native frame work. @default No-op. */\n onMutation?: () => void;\n /** Observe stable-node lifecycle transitions. @default No lifecycle observers. */\n lifecycle?: FrescoNodeLifecycleHooks;\n}\n\n/** @internal Mutable Vue host node; not part of the public render protocol. */\nexport interface FrescoNode extends RendererNode, FrescoHostNode {\n id: number;\n type: FrescoRenderNodeKind;\n props: Record<string, unknown>;\n children: FrescoNode[];\n parent: FrescoNode | null;\n text?: string;\n}\n\n/** @internal Mutable Vue host element; not part of the public render protocol. */\nexport interface FrescoElement extends FrescoNode, RendererElement {}\n\nlet nextId = 0;\n\n/** Keep only dimension values accepted by the public style contract. */\nfunction dimension(value: unknown): string | number | undefined {\n return typeof value === \"string\" || typeof value === \"number\" ? value : undefined;\n}\n\n/** Read the dimensions declared directly by a host node before native layout. */\nfunction declaredSize(node: FrescoNode): FrescoDeclaredSize {\n const style =\n typeof node.props.style === \"object\" && node.props.style !== null\n ? (node.props.style as Record<string, unknown>)\n : {};\n return {\n width: dimension(style.width ?? node.props.width),\n height: dimension(style.height ?? node.props.height),\n };\n}\n\n/** Compare declared dimensions without coercing numeric and string values. */\nfunction sameSize(left: FrescoDeclaredSize, right: FrescoDeclaredSize): boolean {\n return Object.is(left.width, right.width) && Object.is(left.height, right.height);\n}\n\ninterface HostTree {\n readonly nodes: Map<number, FrescoNode>;\n readonly lifecycle: FrescoNodeLifecycleHooks;\n readonly onMutation: () => void;\n}\n\n/** Allocate and register one stable host node before exposing it to Vue. */\nfunction createNode(tree: HostTree, type: FrescoRenderNodeKind, text?: string): FrescoNode {\n const node: FrescoNode = {\n id: nextId++,\n type,\n props: {},\n children: [],\n parent: null,\n ...(text === undefined ? {} : { text }),\n };\n tree.nodes.set(node.id, node);\n tree.lifecycle.onCreate?.(node);\n return node;\n}\n\n/** Publish a committed host-tree update to the optional lifecycle observer. */\nfunction notifyUpdate(tree: HostTree, node: FrescoNode, kind: FrescoNodeUpdateKind): void {\n tree.lifecycle.onUpdate?.(node, kind);\n}\n\n/** Dispose a registered subtree depth-first, reporting each node once. */\nfunction disposeNode(tree: HostTree, node: FrescoNode): boolean {\n if (!tree.nodes.has(node.id)) return false;\n for (const child of node.children) disposeNode(tree, child);\n node.children = [];\n node.parent = null;\n tree.nodes.delete(node.id);\n tree.lifecycle.onRemove?.(node);\n return true;\n}\n\n/** Detach a node only after its parent collection reflects the removal. */\nfunction detachNode(tree: HostTree, node: FrescoNode): boolean {\n const parent = node.parent;\n if (!parent) return false;\n const index = parent.children.indexOf(node);\n node.parent = null;\n if (index === -1) return false;\n parent.children.splice(index, 1);\n notifyUpdate(tree, parent, \"children\");\n return true;\n}\n\ninterface MutableRoutedInputEvent<\n Event extends FrescoInputEvent,\n> extends FrescoRoutedInputEvent<Event> {\n currentTarget: FrescoHostNode;\n phase: FrescoInputEventPhase;\n defaultPrevented: boolean;\n propagationStopped: boolean;\n}\n\nfunction routedInputEventName(event: FrescoInputEvent): string {\n switch (event.type) {\n case \"compositionstart\":\n return \"CompositionStart\";\n case \"compositionupdate\":\n return \"CompositionUpdate\";\n case \"compositionend\":\n return \"CompositionEnd\";\n default:\n return `${event.type[0]?.toUpperCase() ?? \"\"}${event.type.slice(1)}`;\n }\n}\n\nfunction callInputHandlers(value: unknown, event: FrescoRoutedInputEvent): number {\n if (typeof value === \"function\") {\n (value as FrescoInputEventHandler)(event);\n return 1;\n }\n if (!Array.isArray(value)) return 0;\n let handled = 0;\n for (const handler of value) handled += callInputHandlers(handler, event);\n return handled;\n}\n\nfunction dispatchAtNode(\n node: FrescoNode,\n event: MutableRoutedInputEvent<FrescoInputEvent>,\n capture: boolean,\n eventName: string,\n): number {\n const suffix = capture ? \"Capture\" : \"\";\n let handled = callInputHandlers(node.props[`onFrescoInput${suffix}`], event);\n handled += callInputHandlers(node.props[`on${eventName}${suffix}`], event);\n return handled;\n}\n\n/**\n * Renderer options for Fresco\n */\nfunction rendererOptions(tree: HostTree): RendererOptions<FrescoNode, FrescoElement> {\n return {\n patchProp(el, key, _prevValue, nextValue) {\n const previousSize = declaredSize(el);\n if (nextValue == null) {\n if (!(key in el.props)) return;\n delete el.props[key];\n } else {\n if (Object.is(el.props[key], nextValue)) return;\n el.props[key] = nextValue;\n }\n notifyUpdate(tree, el, \"props\");\n const currentSize = declaredSize(el);\n if (!sameSize(previousSize, currentSize)) {\n tree.lifecycle.onResize?.(el, previousSize, currentSize);\n }\n tree.onMutation();\n },\n\n insert(child, parent, anchor) {\n // Vue reuses host nodes for keyed moves and re-inserts them without a\n // preceding remove, relying on DOM insertBefore move semantics. Detach the\n // child from its current position first so a reorder repositions the\n // existing node instead of duplicating it.\n const previousParent = child.parent;\n if (previousParent) {\n const existing = previousParent.children.indexOf(child);\n if (existing !== -1) previousParent.children.splice(existing, 1);\n child.parent = null;\n }\n child.parent = parent;\n const index = anchor ? parent.children.indexOf(anchor) : -1;\n if (index === -1) parent.children.push(child);\n else parent.children.splice(index, 0, child);\n try {\n if (previousParent && previousParent !== parent) {\n notifyUpdate(tree, previousParent, \"children\");\n }\n notifyUpdate(tree, parent, \"children\");\n } finally {\n tree.onMutation();\n }\n },\n\n remove(child) {\n const detached = detachNode(tree, child);\n const disposed = disposeNode(tree, child);\n if (detached || disposed) tree.onMutation();\n },\n\n createElement(type) {\n const nodeType = mapElementType(type);\n return createNode(tree, nodeType) as FrescoElement;\n },\n\n createText(text) {\n return createNode(tree, \"text\", text);\n },\n\n createComment() {\n // Comments are ignored in TUI\n return createNode(tree, \"text\");\n },\n\n setText(node, text) {\n if (node.text === text) return;\n node.text = text;\n notifyUpdate(tree, node, \"text\");\n tree.onMutation();\n },\n\n setElementText(el, text) {\n if (el.text === text && el.children.length === 0) return;\n for (const child of el.children) disposeNode(tree, child);\n el.text = text;\n el.children = [];\n notifyUpdate(tree, el, \"text\");\n tree.onMutation();\n },\n\n parentNode(node) {\n return node.parent;\n },\n\n nextSibling(node) {\n if (!node.parent) return null;\n const index = node.parent.children.indexOf(node);\n return node.parent.children[index + 1] || null;\n },\n };\n}\n\n/**\n * Map Vue element types to Fresco node types\n */\nfunction mapElementType(type: string): FrescoRenderNodeKind {\n switch (type.toLowerCase()) {\n case \"box\":\n case \"div\":\n case \"view\":\n return \"box\";\n case \"text\":\n case \"span\":\n return \"text\";\n case \"input\":\n case \"textinput\":\n return \"input\";\n case \"raw\":\n case \"framebuffer\":\n case \"frame-buffer\":\n return \"raw\";\n default:\n return \"box\";\n }\n}\n\n/**\n * Create a Fresco renderer with stable host-node lookup and lifecycle control.\n */\nexport function createRenderer(options: FrescoRendererOptions | (() => void) = {}) {\n const normalized = typeof options === \"function\" ? { onMutation: options } : options;\n const tree: HostTree = {\n nodes: new Map(),\n lifecycle: normalized.lifecycle ?? {},\n onMutation: normalized.onMutation ?? (() => {}),\n };\n const renderer = createVueRenderer(rendererOptions(tree));\n\n return Object.assign(renderer, {\n /** Return one live host node by its stable identifier. */\n getNode(id: number): FrescoHostNode | undefined {\n return tree.nodes.get(id);\n },\n /** Find one node under the supplied subtree without crossing its boundary. */\n findDescendantById(root: FrescoHostNode, id: number): FrescoHostNode | undefined {\n if (root.id === id) return root;\n const registered = tree.nodes.get(id);\n if (!registered) return undefined;\n for (let parent = registered.parent; parent; parent = parent.parent) {\n if (parent === root) return registered;\n }\n return undefined;\n },\n /** Find the live host node registered for one logical focus target. */\n findNodeByFocusId(root: FrescoHostNode, focusId: string): FrescoHostNode | undefined {\n return findHostNodeByFocusId(root, focusId);\n },\n /** Detach and dispose a registered node and every descendant exactly once. */\n destroyRecursively(id: number): boolean {\n const node = tree.nodes.get(id);\n if (!node) return false;\n detachNode(tree, node);\n disposeNode(tree, node);\n tree.onMutation();\n return true;\n },\n /**\n * Return the deepest topmost node under one native-layout coordinate.\n * Hidden and scroll overflow constrain descendant targeting on each axis.\n */\n hitTest(\n root: FrescoHostNode,\n x: number,\n y: number,\n layouts: readonly LayoutResultNapi[],\n ): FrescoHostNode | undefined {\n return hitTestHostTree(tree.nodes, root, x, y, layouts);\n },\n /** Route normalized input through capture, target, and bubble handlers. */\n dispatchInput<Event extends FrescoInputEvent>(\n targetId: number,\n input: Event,\n ): FrescoInputDispatchResult | undefined {\n const target = tree.nodes.get(targetId);\n if (!target) return undefined;\n\n const path: FrescoNode[] = [];\n for (let node: FrescoNode | null = target; node; node = node.parent) path.push(node);\n const routed: MutableRoutedInputEvent<Event> = {\n input,\n target,\n currentTarget: target,\n phase: \"target\",\n defaultPrevented: false,\n propagationStopped: false,\n preventDefault() {\n this.defaultPrevented = true;\n },\n stopPropagation() {\n this.propagationStopped = true;\n },\n };\n const eventName = routedInputEventName(input);\n let handled = 0;\n\n for (let index = path.length - 1; index > 0; index -= 1) {\n const node = path[index];\n if (!node) continue;\n routed.currentTarget = node;\n routed.phase = \"capture\";\n handled += dispatchAtNode(node, routed, true, eventName);\n if (routed.propagationStopped) break;\n }\n\n if (!routed.propagationStopped) {\n routed.currentTarget = target;\n routed.phase = \"target\";\n handled += dispatchAtNode(target, routed, true, eventName);\n handled += dispatchAtNode(target, routed, false, eventName);\n }\n\n if (!routed.propagationStopped) {\n for (let index = 1; index < path.length; index += 1) {\n const node = path[index];\n if (!node) continue;\n routed.currentTarget = node;\n routed.phase = \"bubble\";\n handled += dispatchAtNode(node, routed, false, eventName);\n if (routed.propagationStopped) break;\n }\n }\n\n return {\n target,\n handled,\n defaultPrevented: routed.defaultPrevented,\n propagationStopped: routed.propagationStopped,\n };\n },\n });\n}\n\n/** Compatibility name for the render payload produced by this package. */\nexport type NativeRenderNode = FrescoRenderNode;\n\n/**\n * Convert Fresco tree to render nodes for native\n */\nexport function treeToRenderNodes(root: FrescoNode): NativeRenderNode[] {\n const nodes: NativeRenderNode[] = [];\n\n function visit(node: FrescoNode) {\n const renderNode = frescoNodeToRenderNode(node);\n\n nodes.push(renderNode);\n\n // Visit children\n for (const child of node.children) {\n visit(child);\n }\n }\n\n visit(root);\n return nodes;\n}\n","type Listener = (...args: unknown[]) => void;\n\n/** Create a detached writable stream for non-interactive Fresco rendering. */\nexport function createNoopWriteStream(columns: number, rows: number): NodeJS.WriteStream {\n const stream = {\n isTTY: false,\n columns,\n rows,\n write: () => true,\n on: (_event: string, _listener: Listener) => stream,\n off: (_event: string, _listener: Listener) => stream,\n once: (_event: string, _listener: Listener) => stream,\n removeListener: (_event: string, _listener: Listener) => stream,\n };\n\n return stream as unknown as NodeJS.WriteStream;\n}\n\n/** Create a detached readable stream for non-interactive Fresco rendering. */\nexport function createNoopReadStream(): NodeJS.ReadStream {\n const stream = {\n isTTY: false,\n isPaused: () => true,\n pause: () => stream,\n resume: () => stream,\n ref: () => stream,\n unref: () => stream,\n setEncoding: () => stream,\n setRawMode: () => stream,\n on: (_event: string, _listener: Listener) => stream,\n off: (_event: string, _listener: Listener) => stream,\n once: (_event: string, _listener: Listener) => stream,\n removeListener: (_event: string, _listener: Listener) => stream,\n };\n\n return stream as unknown as NodeJS.ReadStream;\n}\n","import type { FrescoNode } from \"./renderer.js\";\n\n/** Whether a renderer node owns append-only static output. */\nexport function isStaticNode(node: FrescoNode): boolean {\n return node.props.internal_static === true || node.props.internalStatic === true;\n}\n\n/** Whether a renderer node is one append-only item inside a static owner. */\nexport function isStaticItemNode(node: FrescoNode): boolean {\n return node.props.internal_static_item === true || node.props.internalStaticItem === true;\n}\n","type FrescoNative = typeof import(\"@vizejs/fresco-native\");\n\nconst CI_ENVIRONMENT_KEYS = [\"CI\", \"CONTINUOUS_INTEGRATION\", \"BUILD_NUMBER\", \"RUN_ID\"] as const;\n\nfunction isTruthyEnvironmentValue(value: string | undefined): boolean {\n if (!value) return false;\n return ![\"0\", \"false\", \"no\"].includes(value.toLowerCase());\n}\n\nfunction isCiEnvironment(env: NodeJS.ProcessEnv = process.env): boolean {\n return CI_ENVIRONMENT_KEYS.some((key) => isTruthyEnvironmentValue(env[key]));\n}\n\n/** Resolve whether an application can own the interactive terminal lifecycle. */\nexport function detectInteractiveMode(\n interactive: boolean | undefined,\n stdout: NodeJS.WriteStream,\n): boolean {\n return interactive ?? (stdout.isTTY === true && !isCiEnvironment());\n}\n\n/** Initialize the native terminal modes required by an interactive application. */\nexport function initializeTerminal(\n native: FrescoNative,\n options: { alternateScreen: boolean; mouse: boolean },\n): void {\n if (typeof native.initTerminalWithOptions === \"function\") {\n native.initTerminalWithOptions({\n alternateScreen: options.alternateScreen,\n bracketedPaste: true,\n hideCursor: true,\n mouse: options.mouse,\n rawMode: true,\n });\n } else if (options.mouse) {\n native.initTerminalWithMouse();\n } else {\n native.initTerminal();\n }\n\n native.enableIme?.();\n native.initLayout();\n}\n","/* eslint-disable script/one-component-per-file -- this module defines more than one component */\n/**\n * Fresco App - Application instance management\n */\n\nimport { format } from \"node:util\";\nimport {\n defineComponent,\n h,\n nextTick,\n ref,\n shallowRef,\n type App as VueApp,\n type Component,\n type Plugin,\n type Ref,\n type VNode,\n} from \"vue\";\nimport type { InputEventNapi, LayoutResultNapi, TerminalInfoNapi } from \"@vizejs/fresco-native\";\nimport {\n SCREEN_READER_KEY,\n isScreenReaderEnabledByDefault,\n treeToScreenReaderRenderNodes,\n} from \"./accessibility.js\";\nimport { APP_KEY, createAppContext, type UseAppReturn } from \"./composables/useApp.js\";\nimport { createFocusManager, FOCUS_KEY, type FocusManager } from \"./composables/useFocus.js\";\nimport {\n createStreamsContext,\n STREAMS_KEY,\n type StreamsContext,\n} from \"./composables/useStreams.js\";\nimport { createCursorContext, CURSOR_KEY, type CursorPosition } from \"./composables/useCursor.js\";\nimport type { FrescoDevtools } from \"./devtools.js\";\nimport { defaultInputAction, routeFocusedInput } from \"./focusRouting.js\";\nimport { getLastRenderLayouts, updateLastRenderLayouts } from \"./layoutMetrics.js\";\nimport type { KittyKeyboardOptions } from \"./kittyKeyboard.js\";\nimport { routeAndPublishMouseInput as routeMouseEvent } from \"./mouseRouting.js\";\nimport { normalizeInputEvent } from \"./nativeInput.js\";\nimport type {\n CompositionEvent,\n FocusEvent,\n KeyEvent,\n MouseEvent,\n PasteEvent,\n ResizeEvent,\n} from \"./protocol.js\";\nimport {\n createRenderer,\n treeToRenderNodes,\n type FrescoElement,\n type FrescoNode,\n} from \"./renderer.js\";\nimport { createNoopReadStream, createNoopWriteStream } from \"./renderToStringStreams.js\";\nimport { isStaticItemNode, isStaticNode } from \"./staticNodes.js\";\nimport { detectInteractiveMode, initializeTerminal } from \"./terminalLifecycle.js\";\n\nexport type {\n CompositionEvent,\n FocusEvent,\n FrescoInputEvent,\n InputEvent,\n KeyEvent,\n KeyEventType,\n MouseEvent,\n PasteEvent,\n ResizeEvent,\n} from \"./protocol.js\";\n\n/** Latest normalized key event received by the active Fresco application. */\nexport const lastKeyEvent: Ref<KeyEvent | null> = ref(null);\n/** Latest bracketed-paste event received by the active Fresco application. */\nexport const lastPasteEvent: Ref<PasteEvent | null> = ref(null);\n/** Latest terminal resize event received by the active Fresco application. */\nexport const lastResizeEvent: Ref<ResizeEvent | null> = ref(null);\n/** Latest normalized mouse event received by the active Fresco application. */\nexport const lastMouseEvent: Ref<MouseEvent | null> = ref(null);\n/** Latest terminal focus event received by the active Fresco application. */\nexport const lastFocusEvent: Ref<FocusEvent | null> = ref(null);\n/** Latest IME composition event received by the active Fresco application. */\nexport const lastCompositionEvent: Ref<CompositionEvent | null> = ref(null);\n\n// Import native bindings\n// eslint-disable-next-line typescript-eslint/no-redundant-type-constituents -- index.d.ts is generated by napi\nlet native: typeof import(\"@vizejs/fresco-native\") | null = null;\n\ntype ConsoleMethod = \"debug\" | \"error\" | \"info\" | \"log\" | \"warn\";\nconst consoleMethods: ConsoleMethod[] = [\"debug\", \"error\", \"info\", \"log\", \"warn\"];\n\nasync function loadNative() {\n if (!native) {\n native = await import(\"@vizejs/fresco-native\");\n }\n return native;\n}\n\n/**\n * App options\n */\nexport interface AppOptions {\n /** Enable mouse support. @default false */\n mouse?: boolean;\n /** Exit on Ctrl+C. @default true */\n exitOnCtrlC?: boolean;\n /** Custom render error handler. @default undefined */\n onError?: (error: Error) => void;\n /** Log every native render tree to stderr. @default false */\n debug?: boolean;\n /** Output stream used for frames and external output. @default process.stdout */\n stdout?: NodeJS.WriteStream;\n /** Input stream used for terminal events. @default process.stdin */\n stdin?: NodeJS.ReadStream;\n /** Error stream used for warnings and errors. @default process.stderr */\n stderr?: NodeJS.WriteStream;\n /** Route console methods through terminal-safe output. @default true */\n patchConsole?: boolean;\n /** Callback invoked after a frame is rendered. @default undefined */\n onRender?: (metrics: RenderMetrics) => void;\n /** Opt-in tree inspector, render metrics, and bounded event trace. @default undefined */\n devtools?: FrescoDevtools;\n /** Enable semantic screen-reader rendering. @default environment detection */\n isScreenReaderEnabled?: boolean;\n /** Maximum render frames per second. @default 30 */\n maxFps?: number;\n /** Use the alternate terminal screen buffer. @default false */\n alternateScreen?: boolean;\n /** Ink-compatible no-op retained for source compatibility. @default false */\n incrementalRendering?: boolean;\n /** Ink-compatible no-op retained for source compatibility. @default false */\n concurrent?: boolean;\n /** Override TTY and CI interactive-mode detection. @default automatic detection */\n interactive?: boolean;\n /** Configure Kitty keyboard protocol support. @default undefined */\n kittyKeyboard?: KittyKeyboardOptions;\n}\n\n/** Rendering options accepted by createApp and render. */\nexport type RenderOptions = AppOptions;\n\n/** Vue component or already-created VNode accepted as the application root. */\nexport type AppRoot = Component | VNode;\n\n/**\n * Performance metrics for a render operation.\n */\nexport interface RenderMetrics {\n /** Time spent rendering in milliseconds */\n renderTime: number;\n /** Number of live host nodes inspected for this frame. */\n nodeCount: number;\n /** Number of layout rectangles returned by the native renderer. */\n layoutCount: number;\n}\n\n/**\n * Fresco App instance\n */\nexport interface App {\n /** Install a Vue plugin before the first successful mount. */\n use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): App;\n /** Mount the app */\n mount(): Promise<void>;\n /** Unmount the app */\n unmount(errorOrResult?: unknown): Promise<void>;\n /** Wait for exit */\n waitUntilExit(): Promise<unknown>;\n /** Wait for pending render output */\n waitUntilRenderFlush(): Promise<void>;\n /** Render the app */\n render(): void;\n /** Clear the screen */\n clear(): void;\n /** Get terminal info */\n getTerminalInfo(): Promise<TerminalInfoNapi>;\n}\n\n/** Ink-compatible handle returned by render. */\nexport interface RenderInstance {\n rerender(root: AppRoot): void;\n unmount(errorOrResult?: unknown): Promise<void>;\n waitUntilExit(): Promise<unknown>;\n waitUntilRenderFlush(): Promise<void>;\n cleanup(): Promise<void>;\n clear(): void;\n}\n\n/** Compatibility alias for the render handle. */\nexport type Instance = RenderInstance;\n\n/** Options for deterministic, non-interactive string rendering. */\nexport interface RenderToStringOptions {\n /** Width of the virtual terminal in columns. @default 80 */\n columns?: number;\n}\n\n/** Minimal writable stream contract accepted by the render compatibility overload. */\nexport interface WritableStreamLike {\n write(...args: unknown[]): unknown;\n}\n\nfunction isWritableStream(value: unknown): value is WritableStreamLike {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"write\" in value &&\n typeof (value as { write?: unknown }).write === \"function\"\n );\n}\n\nfunction normalizeRenderOptions(options: AppOptions | WritableStreamLike): AppOptions {\n return isWritableStream(options) ? { stdout: options as NodeJS.WriteStream } : options;\n}\n\nfunction isVNodeRoot(root: AppRoot): root is VNode {\n return typeof root === \"object\" && root !== null && \"__v_isVNode\" in root;\n}\n\nfunction componentFromRoot(root: AppRoot): Component {\n if (!isVNodeRoot(root)) return root;\n\n return defineComponent({\n name: \"FrescoVNodeRoot\",\n setup() {\n return () => root;\n },\n });\n}\n\nfunction createRootElement(width = \"100%\", height = \"100%\"): FrescoElement {\n return {\n id: -1,\n type: \"root\",\n props: {\n style: {\n width,\n height,\n flexDirection: \"column\",\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n alignContent: \"flex-start\",\n },\n },\n children: [],\n parent: null,\n };\n}\n\nfunction nodeText(node: FrescoNode): string {\n if (node.text !== undefined) return node.text;\n const propText = node.props.text ?? node.props.content;\n if (typeof propText === \"string\" || typeof propText === \"number\") return String(propText);\n if (node.type === \"input\") {\n const value = node.props.value;\n const placeholder = node.props.placeholder;\n if (typeof value === \"string\" || typeof value === \"number\") return String(value);\n if (typeof placeholder === \"string\" || typeof placeholder === \"number\")\n return String(placeholder);\n }\n return \"\";\n}\n\nfunction joinOutput(parts: string[], separator = \"\\n\"): string {\n return parts.filter(Boolean).join(separator);\n}\n\nfunction treeToString(node: FrescoNode, options: { skipStatic?: boolean } = {}): string {\n if (options.skipStatic && isStaticNode(node)) return \"\";\n\n const ownText = nodeText(node);\n const childOutput = node.children.map((child) => treeToString(child, options));\n\n if (node.type === \"text\" || node.type === \"input\") {\n return `${ownText}${childOutput.join(\"\")}`;\n }\n\n const style = (node.props.style ?? {}) as Record<string, unknown>;\n const flexDirection = style.flexDirection ?? style.flex_direction;\n const separator = flexDirection === \"column\" ? \"\\n\" : \"\";\n return joinOutput(childOutput, separator);\n}\n\nfunction normalizeOutput(output: string): string {\n return output.endsWith(\"\\n\") ? output.slice(0, -1) : output;\n}\n\nfunction appendOutput(previous: string, next: string): string {\n const normalized = normalizeOutput(next);\n if (!normalized) return previous;\n return previous ? `${previous}\\n${normalized}` : normalized;\n}\n\nfunction captureStaticOutput(node: FrescoNode, renderedStaticItems: Map<number, number>): string {\n const output: string[] = [];\n\n function visit(current: FrescoNode) {\n if (isStaticNode(current)) {\n const renderedItems = renderedStaticItems.get(current.id) ?? 0;\n const staticItems = current.children.filter(isStaticItemNode);\n const nextItems = staticItems.slice(renderedItems);\n const nextOutput = joinOutput(\n nextItems.map((child) => treeToString(child)),\n \"\\n\",\n );\n if (nextOutput) output.push(nextOutput);\n renderedStaticItems.set(current.id, staticItems.length);\n return;\n }\n\n for (const child of current.children) {\n visit(child);\n }\n }\n\n visit(node);\n return joinOutput(output, \"\\n\");\n}\n\nfunction createStaticOutputNode(output: string): FrescoElement | null {\n const normalized = normalizeOutput(output);\n if (!normalized) return null;\n\n const staticRoot: FrescoElement = {\n id: -1,\n type: \"box\",\n props: {\n style: {\n flexDirection: \"column\",\n },\n },\n children: [],\n parent: null,\n };\n\n staticRoot.children = normalized.split(\"\\n\").map((line, index) => ({\n id: -2 - index,\n type: \"text\",\n props: {\n text: line,\n },\n children: [],\n parent: staticRoot,\n }));\n\n return staticRoot;\n}\n\nfunction cloneDynamicTree(node: FrescoNode): FrescoElement | null {\n if (isStaticNode(node)) return null;\n\n const clone: FrescoElement = {\n id: node.id,\n type: node.type,\n props: node.props,\n children: [],\n parent: null,\n text: node.text,\n };\n\n clone.children = node.children\n .map((child) => cloneDynamicTree(child))\n .filter((child): child is FrescoElement => child !== null);\n for (const child of clone.children) {\n child.parent = clone;\n }\n\n return clone;\n}\n\nfunction createRenderTree(root: FrescoElement, staticOutput: string): FrescoElement {\n const dynamicRoot = cloneDynamicTree(root) ?? createRootElement();\n const staticOutputNode = createStaticOutputNode(staticOutput);\n\n if (staticOutputNode) {\n staticOutputNode.parent = dynamicRoot;\n dynamicRoot.children = [staticOutputNode, ...dynamicRoot.children];\n }\n\n return dynamicRoot;\n}\n\nfunction renderPlainOutput(root: FrescoNode, staticOutput: string): string {\n return joinOutput([staticOutput, treeToString(root, { skipStatic: true })], \"\\n\");\n}\n\nfunction updateAppSize(context: UseAppReturn | null, width: number, height: number) {\n if (!context) return;\n context.width.value = width;\n context.height.value = height;\n}\n\n/**\n * Create a Fresco TUI app\n */\nexport function createApp(rootComponent: AppRoot, options: AppOptions = {}): App {\n const { mouse = false, exitOnCtrlC = true, onError } = options;\n const interactive = detectInteractiveMode(options.interactive, options.stdout ?? process.stdout);\n const screenReaderEnabled = ref(\n options.isScreenReaderEnabled ?? isScreenReaderEnabledByDefault(),\n );\n const frameDelay = Math.max(1, Math.floor(1000 / Math.max(1, options.maxFps ?? 30)));\n let streamsContext: StreamsContext;\n const writeToStdout = (data: string) => {\n writeExternalOutput(streamsContext.stdout, data);\n };\n const writeToStderr = (data: string) => {\n writeExternalOutput(streamsContext.stderr, data);\n };\n streamsContext = createStreamsContext({\n stdin: options.stdin,\n stdout: options.stdout,\n stderr: options.stderr,\n exitOnCtrlC,\n interactive,\n writeToStdout,\n writeToStderr,\n });\n let vueApp: VueApp | null = null;\n let rootElement: FrescoElement | null = null;\n let mounted = false;\n let pendingMount: Promise<void> | null = null;\n let hasMountedSuccessfully = false;\n let running = false;\n let needsRender = true;\n let appContext: UseAppReturn | null = null;\n let focusManager: FocusManager | null = null;\n let consoleRestore: (() => void) | null = null;\n let isWritingExternalOutput = false;\n let nonInteractiveOutput = \"\";\n let staticOutput = \"\";\n const renderedStaticItems = new Map<number, number>();\n let cursorPosition: CursorPosition | undefined;\n let hasCursorOverride = false;\n let instance: App;\n const pluginInstallers: Array<(app: VueApp) => void> = [];\n let exitSettled = false;\n let resolveExit: ((value?: unknown) => void) | null = null;\n let rejectExit: ((reason?: unknown) => void) | null = null;\n const exitPromise = new Promise<unknown>((resolve, reject) => {\n resolveExit = resolve;\n rejectExit = reject;\n });\n const renderer = createRenderer({\n lifecycle: options.devtools?.lifecycle,\n onMutation() {\n needsRender = true;\n },\n });\n function publishRenderMetrics(\n root: FrescoElement,\n layouts: readonly LayoutResultNapi[],\n start: number,\n ) {\n if (!options.devtools && !options.onRender) return;\n const metrics: RenderMetrics = {\n renderTime: performance.now() - start,\n nodeCount: treeToRenderNodes(root).length,\n layoutCount: layouts.length,\n };\n options.devtools?.recordRender(root, layouts, metrics);\n options.onRender?.(metrics);\n }\n\n function mount(): Promise<void> {\n if (mounted) return Promise.resolve();\n if (pendingMount) return pendingMount;\n pendingMount = Promise.resolve()\n .then(performMount)\n .finally(() => {\n pendingMount = null;\n });\n return pendingMount;\n }\n\n async function performMount(): Promise<void> {\n // Plugins run before terminal initialization so installation failures\n // cannot leave raw mode, IME, or cursor state enabled.\n const app = renderer.createApp(componentFromRoot(rootComponent));\n for (const install of pluginInstallers) install(app);\n\n const n = interactive ? await loadNative() : null;\n\n if (n) initializeTerminal(n, { alternateScreen: options.alternateScreen === true, mouse });\n\n const info = n?.getTerminalInfo() ?? {\n width: streamsContext.stdout.columns ?? 80,\n height: streamsContext.stdout.rows ?? 24,\n };\n appContext = createAppContext({\n width: info.width,\n height: info.height,\n exit: (value) => void unmount(value),\n render,\n clear,\n waitUntilRenderFlush,\n stdout: streamsContext.stdout,\n });\n focusManager = createFocusManager();\n app.provide(APP_KEY, appContext);\n app.provide(FOCUS_KEY, focusManager);\n app.provide(SCREEN_READER_KEY, screenReaderEnabled);\n app.provide(STREAMS_KEY, streamsContext);\n app.provide(\n CURSOR_KEY,\n createCursorContext((position) => {\n hasCursorOverride = true;\n cursorPosition = position;\n needsRender = true;\n }),\n );\n\n rootElement = createRootElement();\n patchConsoleMethods();\n try {\n app.mount(rootElement);\n } catch (error) {\n restoreConsoleMethods();\n throw error;\n }\n vueApp = app;\n\n mounted = true;\n hasMountedSuccessfully = true;\n running = true;\n needsRender = true;\n\n void eventLoop();\n }\n\n function use<Options extends unknown[]>(plugin: Plugin<Options>, ...pluginOptions: Options): App {\n if (pendingMount || hasMountedSuccessfully) {\n throw new Error(\"Fresco plugins must be installed before the first successful mount\");\n }\n pluginInstallers.push((app) => {\n app.use(plugin, ...pluginOptions);\n });\n return instance;\n }\n\n async function unmount(errorOrResult?: unknown) {\n if (!mounted) return;\n\n running = false;\n\n if (!interactive && rootElement) {\n staticOutput = appendOutput(\n staticOutput,\n captureStaticOutput(rootElement, renderedStaticItems),\n );\n nonInteractiveOutput = renderPlainOutput(rootElement, staticOutput);\n }\n\n if (native && interactive) {\n native.disableIme?.();\n native.restoreTerminal();\n }\n\n restoreConsoleMethods();\n\n if (vueApp) {\n vueApp.unmount();\n vueApp = null;\n }\n\n if (!interactive && nonInteractiveOutput) {\n streamsContext.stdout.write(\n nonInteractiveOutput.endsWith(\"\\n\") ? nonInteractiveOutput : `${nonInteractiveOutput}\\n`,\n );\n nonInteractiveOutput = \"\";\n }\n\n rootElement = null;\n mounted = false;\n appContext = null;\n focusManager = null;\n cursorPosition = undefined;\n hasCursorOverride = false;\n\n if (!exitSettled) {\n exitSettled = true;\n if (errorOrResult instanceof Error) {\n rejectExit?.(errorOrResult);\n } else {\n resolveExit?.(errorOrResult);\n }\n }\n }\n\n async function waitUntilExit(): Promise<unknown> {\n return exitPromise;\n }\n\n async function waitUntilRenderFlush(): Promise<void> {\n if (pendingMount) await pendingMount;\n await nextTick();\n if (!needsRender) return;\n needsRender = false;\n render();\n }\n\n function clear() {\n if (!mounted) return;\n staticOutput = \"\";\n if (!interactive) {\n nonInteractiveOutput = \"\";\n return;\n }\n if (!native) return;\n native.clearScreen();\n native.flushTerminal();\n }\n\n function writeExternalOutput(stream: NodeJS.WriteStream, data: string) {\n if (!mounted || !interactive || !native || isWritingExternalOutput) {\n stream.write(data);\n return;\n }\n\n try {\n isWritingExternalOutput = true;\n native.clearScreen();\n native.flushTerminal();\n stream.write(data);\n needsRender = true;\n render();\n } finally {\n isWritingExternalOutput = false;\n }\n }\n\n function patchConsoleMethods() {\n if (options.patchConsole === false || consoleRestore) return;\n\n const target = console as unknown as Record<ConsoleMethod, (...data: unknown[]) => void>;\n const original: Partial<Record<ConsoleMethod, (...data: unknown[]) => void>> = {};\n const patch = (method: ConsoleMethod, writer: (data: string) => void) => {\n original[method] = target[method];\n target[method] = (...args: unknown[]) => {\n writer(`${format(...args)}\\n`);\n };\n };\n\n patch(\"debug\", writeToStdout);\n patch(\"info\", writeToStdout);\n patch(\"log\", writeToStdout);\n patch(\"warn\", writeToStderr);\n patch(\"error\", writeToStderr);\n\n consoleRestore = () => {\n for (const method of consoleMethods) {\n const originalMethod = original[method];\n if (originalMethod) target[method] = originalMethod;\n }\n consoleRestore = null;\n };\n }\n\n function restoreConsoleMethods() {\n consoleRestore?.();\n }\n\n function applyCursorOverride() {\n if (!hasCursorOverride || !native) return;\n\n if (cursorPosition) {\n native.setCursor(cursorPosition.x, cursorPosition.y);\n native.showCursor();\n } else {\n native.hideCursor();\n }\n }\n\n function render() {\n if (!mounted || !rootElement) {\n return;\n }\n\n const start = performance.now();\n\n try {\n if (!interactive) {\n staticOutput = appendOutput(\n staticOutput,\n captureStaticOutput(rootElement, renderedStaticItems),\n );\n nonInteractiveOutput = renderPlainOutput(rootElement, staticOutput);\n publishRenderMetrics(rootElement, [], start);\n return;\n }\n\n if (!native) {\n return;\n }\n\n staticOutput = appendOutput(\n staticOutput,\n captureStaticOutput(rootElement, renderedStaticItems),\n );\n const renderRoot = createRenderTree(rootElement, staticOutput);\n const renderNodes = screenReaderEnabled.value\n ? treeToScreenReaderRenderNodes(renderRoot)\n : treeToRenderNodes(renderRoot);\n\n // Send to native for rendering\n if (renderNodes.length > 0) {\n if (options.debug) {\n streamsContext.stderr.write(`${JSON.stringify(renderNodes, null, 2)}\\n`);\n }\n\n // Use renderTree which handles layout and painting\n native.renderTree(renderNodes);\n const layouts: LayoutResultNapi[] =\n \"getLastRenderLayouts\" in native ? native.getLastRenderLayouts() : [];\n updateLastRenderLayouts(layouts);\n\n applyCursorOverride();\n\n // Flush to display\n native.flushTerminal();\n publishRenderMetrics(rootElement, layouts, start);\n }\n } catch (error) {\n if (onError) {\n onError(error as Error);\n } else {\n console.error(\"Render error:\", error);\n }\n }\n }\n\n async function getTerminalInfo() {\n const n = await loadNative();\n return n.getTerminalInfo();\n }\n\n function dispatchEvent(event: InputEventNapi) {\n const normalized = normalizeInputEvent(event);\n if (!normalized) return;\n options.devtools?.recordInput(normalized);\n switch (normalized.type) {\n case \"resize\":\n lastResizeEvent.value = normalized;\n updateAppSize(appContext, normalized.width, normalized.height);\n break;\n case \"paste\":\n lastPasteEvent.value = normalized;\n return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);\n case \"mouse\":\n routeMouseEvent(renderer, rootElement, normalized, getLastRenderLayouts(), lastMouseEvent);\n break;\n case \"focus\":\n lastFocusEvent.value = normalized;\n return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);\n case \"compositionstart\":\n case \"compositionupdate\":\n case \"compositionend\":\n lastCompositionEvent.value = normalized;\n return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);\n case \"key\":\n lastKeyEvent.value = normalized;\n return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);\n }\n }\n\n async function eventLoop() {\n const n = interactive ? await loadNative() : null;\n\n while (running) {\n try {\n const event = n?.pollEvent(16); // ~60fps\n\n if (event) {\n // Handle resize\n if (event.eventType === \"resize\") {\n n?.syncTerminalSize();\n n?.clearScreen();\n needsRender = true;\n }\n\n const dispatchResult = dispatchEvent(event);\n\n const defaultAction = defaultInputAction(event, dispatchResult, exitOnCtrlC);\n if (defaultAction === \"focus-next\") {\n focusManager?.focusNext();\n needsRender = true;\n } else if (defaultAction === \"focus-previous\") {\n focusManager?.focusPrevious();\n needsRender = true;\n } else if (defaultAction === \"exit\") {\n await unmount();\n break;\n }\n }\n\n // Render frame if needed\n if (needsRender) {\n render();\n needsRender = false;\n }\n } catch (error) {\n if (onError) {\n onError(error as Error);\n }\n }\n\n // Small delay to prevent busy loop\n await new Promise((resolve) => setTimeout(resolve, frameDelay));\n }\n }\n\n instance = {\n use,\n mount,\n unmount,\n waitUntilExit,\n waitUntilRenderFlush,\n render,\n clear,\n getTerminalInfo,\n };\n return instance;\n}\n\n/**\n * Ink-compatible helper that mounts immediately.\n */\nexport function render(\n root: AppRoot,\n options: AppOptions | WritableStreamLike = {},\n): RenderInstance {\n const renderOptions = normalizeRenderOptions(options);\n const rootRef = shallowRef(root);\n const Root = defineComponent({\n name: \"FrescoRenderRoot\",\n setup() {\n return () => {\n const current = rootRef.value;\n return isVNodeRoot(current) ? current : h(current);\n };\n },\n });\n\n const app = createApp(Root, renderOptions);\n void app.mount();\n\n return {\n rerender(nextRoot: AppRoot) {\n rootRef.value = nextRoot;\n app.render();\n },\n unmount: (value?: unknown) => app.unmount(value),\n waitUntilExit: () => app.waitUntilExit(),\n waitUntilRenderFlush: () => app.waitUntilRenderFlush(),\n cleanup: () => app.unmount(),\n clear: () => app.clear(),\n };\n}\n\n/**\n * Render a Fresco component to a plain string without starting a terminal app.\n */\nexport function renderToString(root: AppRoot, options: RenderToStringOptions = {}): string {\n const { createApp: createVueApp } = createRenderer();\n const app = createVueApp(componentFromRoot(root));\n const columns = options.columns ?? 80;\n const stdout = createNoopWriteStream(columns, 24);\n const stderr = createNoopWriteStream(columns, 24);\n const stdin = createNoopReadStream();\n const rootElement = createRootElement(String(columns), \"auto\");\n\n app.provide(\n APP_KEY,\n createAppContext({\n width: columns,\n height: 24,\n stdout,\n }),\n );\n app.provide(FOCUS_KEY, createFocusManager());\n app.provide(SCREEN_READER_KEY, ref(false));\n app.provide(\n CURSOR_KEY,\n createCursorContext(() => {}),\n );\n app.provide(\n STREAMS_KEY,\n createStreamsContext({\n stdin,\n stdout,\n stderr,\n interactive: false,\n writeToStdout: () => {},\n writeToStderr: () => {},\n }),\n );\n app.mount(rootElement);\n\n const renderedStaticItems = new Map<number, number>();\n const staticOutput = captureStaticOutput(rootElement, renderedStaticItems);\n const output = renderPlainOutput(rootElement, staticOutput);\n app.unmount();\n return output;\n}\n"],"mappings":";;;AAsBA,MAAM,WAAW,CAAC,QAAQ,MAAM;AAChC,MAAM,YAAY;CAAC;CAAY;CAAY;AAAQ;AACnD,MAAM,YAAY;CAAC;CAAW;CAAU;AAAQ;AAChD,MAAM,iBAAiB;CACrB;CACA;CACA;CACA;AACF;AACA,MAAM,YAAY;CAAC;CAAU;CAAQ;AAAc;AACn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C,CACH;CACA,IAAI,MAAM,WAAW;CAIrB,MAAM,SAAS,kBAAkB,aADZ,oBAAoB,6BAAa,IADtB,IACwC,CACf,CAAC;CAC1D,IAAI,QAAQ;CACZ,OAAO;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { _default as Alert, type AlertProps, type AlertType, _default$1 as Avatar, type AvatarProps, _default$2 as Badge, type BadgeProps, type BadgeVariant, Box, type BoxProps, _default$3 as Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, _default$4 as Card, type CardProps, Checkbox, type CheckboxProps, Code, type CodeBuffer, type CodeDiagnostic, type CodeDiagnosticSeverity, type CodePosition, type CodeProps, type CodeSelection, type CodeSyntaxContext, type CodeSyntaxProvider, type CodeSyntaxToken, Confirm, type ConfirmProps, Diff, type DiffProps, type DiffView, _default$5 as Divider, type DividerProps, Form, type FormErrors, type FormField, type FormProps, type FormSlotProps, type FormValues, _default$6 as FrameBuffer, type FrameBufferProps, Grid, type GridProps, _default$7 as HStack, _default$8 as Header, type HeaderProps, type KeyBinding, KeyHint, type KeyHintProps, LineNumber, type LineNumberProps, _default$9 as Link, type LinkProps, List, type ListItem, type ListProps, _default$
|
|
1
|
+
import { $ as _default$21, $t as createCodeBuffer, A as TreeProps, An as AlertType, At as DiffProps, B as _default$10, Bn as _default$28, Bt as MarkdownCodeBlock, C as TabsValueKey, Cn as ScrollBarOrientation, Ct as TextAreaProps, D as _default$27, Dn as ScrollBoxProps, Dt as LineNumber, E as MenuProps, En as ScrollBoxItemSlot, Et as _default$9, F as TableColumn, Fn as HeaderProps, Ft as parseMarkdown, G as _default$25, Gn as StackProps, Gt as MarkdownProps, H as ListItem, Hn as _default$22, Ht as MarkdownListBlock, I as TableProps, In as TooltipPosition, It as renderMarkdown, J as TimerProps, Jn as BoxProps, Jt as MarkdownRenderOptions, K as Timer, Kn as _default$20, Kt as MarkdownQuoteBlock, L as TableRow, Ln as TooltipProps, Lt as _default$11, M as Table, Mn as BreadcrumbItem, Mt as _default$6, N as TableAlignment, Nn as BreadcrumbProps, Nt as FrameBufferProps, O as TreeBy, On as _default$4, Ot as LineNumberProps, P as TableCellSlotProps, Pn as CardProps, Pt as defaultMarkdownRenderer, Q as ProgressBarProps, Qt as Code, R as TableSortDirection, Rn as Grid, Rt as MarkdownBlock, S as TabsProps, Sn as _default$17, St as TextArea, T as MenuItem, Tn as ScrollBoxExposed, Tt as TextInputProps, U as ListProps, Un as _default$5, Ut as MarkdownListItem, V as ListBy, Vn as _default$7, Vt as MarkdownHeadingBlock, W as ListValueKey, Wn as DividerProps, Wt as MarkdownParagraphBlock, X as _default, Xt as MarkdownSpan, Y as _default$2, Yt as MarkdownRenderer, Z as ProgressBar, Zt as MarkdownThematicBreakBlock, _ as StepperProps, _n as NewlineProps, _t as _default$18, a as _default$8, an as CodeSelection, at as FormValues, b as Tab, bn as TextProps, bt as SelectProps, c as StatusBarProps, cn as CodeSyntaxToken, ct as SliderProps, d as PopoverProps, dn as BadgeVariant, dt as ConfirmProps, en as CodeBuffer, et as Form, f as _default$13, fn as LinkProps, ft as RadioGroup, g as Stepper, gn as _default$14, gt as CheckboxProps, h as StepStatus, hn as _default$23, ht as Checkbox, i as KeyHintProps, in as CodeProps, it as FormSlotProps, j as TreeValueKey, jn as AvatarProps, jt as DiffView, k as TreeNode, kn as AlertProps, kt as Diff, l as _default$15, ln as _default$26, lt as SliderRange, m as Step, mn as StaticProps, mt as RadioOption, n as KeyBinding, nn as CodeDiagnosticSeverity, nt as FormField, o as StatusBar, on as CodeSyntaxContext, ot as _default$19, p as ModalProps, pn as SpinnerProps, pt as RadioGroupProps, q as TimerMode, qn as Box, qt as MarkdownRenderLine, r as KeyHint, rn as CodePosition, rt as FormProps, s as StatusBarItem, sn as CodeSyntaxProvider, st as SliderOrientation, t as _default$1, tn as CodeDiagnostic, tt as FormErrors, u as PopoverPlacement, un as BadgeProps, ut as Confirm, v as _default$3, vn as TransformProps, vt as SelectBy, w as _default$12, wn as ScrollBarProps, wt as TextInput, x as TabsBy, xn as _default$16, xt as SelectValueKey, y as _default$24, yn as Text, yt as SelectOption, z as TableViewportRange, zn as GridProps, zt as MarkdownBlockProvider } from "../index-C0U_GDW-.mjs";
|
|
2
|
+
export { _default as Alert, type AlertProps, type AlertType, _default$1 as Avatar, type AvatarProps, _default$2 as Badge, type BadgeProps, type BadgeVariant, Box, type BoxProps, _default$3 as Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, _default$4 as Card, type CardProps, Checkbox, type CheckboxProps, Code, type CodeBuffer, type CodeDiagnostic, type CodeDiagnosticSeverity, type CodePosition, type CodeProps, type CodeSelection, type CodeSyntaxContext, type CodeSyntaxProvider, type CodeSyntaxToken, Confirm, type ConfirmProps, Diff, type DiffProps, type DiffView, _default$5 as Divider, type DividerProps, Form, type FormErrors, type FormField, type FormProps, type FormSlotProps, type FormValues, _default$6 as FrameBuffer, type FrameBufferProps, Grid, type GridProps, _default$7 as HStack, _default$8 as Header, type HeaderProps, type KeyBinding, KeyHint, type KeyHintProps, LineNumber, type LineNumberProps, _default$9 as Link, type LinkProps, _default$10 as List, type ListBy, type ListItem, type ListProps, type ListValueKey, _default$11 as Markdown, type MarkdownBlock, type MarkdownBlockProvider, type MarkdownCodeBlock, type MarkdownHeadingBlock, type MarkdownListBlock, type MarkdownListItem, type MarkdownParagraphBlock, type MarkdownProps, type MarkdownQuoteBlock, type MarkdownRenderLine, type MarkdownRenderOptions, type MarkdownRenderer, type MarkdownSpan, type MarkdownThematicBreakBlock, _default$12 as Menu, type MenuItem, type MenuProps, _default$13 as Modal, type ModalProps, _default$14 as Newline, type NewlineProps, _default$15 as Popover, type PopoverPlacement, type PopoverProps, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, type RadioOption, _default$16 as ScrollBar, type ScrollBarOrientation, type ScrollBarProps, _default$17 as ScrollBox, type ScrollBoxExposed, type ScrollBoxItemSlot, type ScrollBoxProps, _default$18 as Select, type SelectBy, type SelectOption, type SelectProps, type SelectValueKey, _default$19 as Slider, type SliderOrientation, type SliderProps, type SliderRange, _default$20 as Spacer, _default$21 as Spinner, type SpinnerProps, _default$22 as Stack, type StackProps, _default$23 as Static, type StaticProps, StatusBar, type StatusBarItem, type StatusBarProps, type Step, type StepStatus, Stepper, type StepperProps, type Tab, Table, type TableAlignment, type TableCellSlotProps, type TableColumn, type TableProps, type TableRow, type TableSortDirection, type TableViewportRange, _default$24 as Tabs, type TabsBy, type TabsProps, type TabsValueKey, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, Timer, type TimerMode, type TimerProps, _default$25 as Tooltip, type TooltipPosition, type TooltipProps, _default$26 as Transform, type TransformProps, _default$27 as Tree, type TreeBy, type TreeNode, type TreeProps, type TreeValueKey, _default$28 as VStack, createCodeBuffer, defaultMarkdownRenderer, parseMarkdown, renderMarkdown };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { FrescoAlert_default as Alert, FrescoAvatar_default as Avatar, FrescoBadge_default as Badge, Box, FrescoBreadcrumb_default as Breadcrumb, FrescoCard_default as Card, Checkbox, Code, Confirm, Diff, FrescoDivider_default as Divider, Form, FrescoFrameBuffer_default as FrameBuffer, Grid, FrescoHStack_default as HStack, FrescoHeader_default as Header, KeyHint, LineNumber, FrescoLink_default as Link, List, FrescoMarkdown_default as Markdown, Menu, FrescoModal_default as Modal, FrescoNewline_default as Newline, ProgressBar, RadioGroup, ScrollBar_default as ScrollBar, ScrollBox_default as ScrollBox, Select, FrescoSlider_default as Slider, FrescoSpacer_default as Spacer, FrescoSpinner_default as Spinner, FrescoStack_default as Stack, FrescoStatic_default as Static, StatusBar, Stepper, Table, Tabs, Text, TextArea, TextInput, Timer, FrescoTooltip_default as Tooltip, FrescoTransform_default as Transform, Tree, FrescoVStack_default as VStack, createCodeBuffer, defaultMarkdownRenderer, parseMarkdown, renderMarkdown };
|
|
1
|
+
import { A as FrescoFrameBuffer_default, B as FrescoNewline_default, C as RadioGroup, D as TextInput, E as TextArea, F as Code, G as Grid, H as ScrollBar_default, I as createCodeBuffer, J as FrescoStack_default, K as FrescoVStack_default, L as LineNumber, M as defaultMarkdownRenderer, N as parseMarkdown, O as FrescoLink_default, P as renderMarkdown, R as FrescoTransform_default, S as Confirm, T as FrescoSelect_default, U as Text, V as ScrollBox_default, W as FrescoCard_default, X as FrescoSpacer_default, Y as FrescoDivider_default, Z as Box, _ as FrescoAlert_default, a as FrescoPopover_default, b as Form, c as FrescoBreadcrumb_default, d as FrescoTree_default, f as Table, g as FrescoBadge_default, h as Timer, i as StatusBar, j as FrescoMarkdown_default, k as Diff, l as FrescoTabs_default, m as FrescoTooltip_default, n as KeyHint, o as FrescoModal_default, p as FrescoList_default, q as FrescoHStack_default, r as FrescoHeader_default, s as Stepper, t as FrescoAvatar_default, u as FrescoMenu_default, v as ProgressBar, w as Checkbox, x as FrescoSlider_default, y as FrescoSpinner_default, z as FrescoStatic_default } from "../components-B-HgL5id.mjs";
|
|
2
|
+
export { FrescoAlert_default as Alert, FrescoAvatar_default as Avatar, FrescoBadge_default as Badge, Box, FrescoBreadcrumb_default as Breadcrumb, FrescoCard_default as Card, Checkbox, Code, Confirm, Diff, FrescoDivider_default as Divider, Form, FrescoFrameBuffer_default as FrameBuffer, Grid, FrescoHStack_default as HStack, FrescoHeader_default as Header, KeyHint, LineNumber, FrescoLink_default as Link, FrescoList_default as List, FrescoMarkdown_default as Markdown, FrescoMenu_default as Menu, FrescoModal_default as Modal, FrescoNewline_default as Newline, FrescoPopover_default as Popover, ProgressBar, RadioGroup, ScrollBar_default as ScrollBar, ScrollBox_default as ScrollBox, FrescoSelect_default as Select, FrescoSlider_default as Slider, FrescoSpacer_default as Spacer, FrescoSpinner_default as Spinner, FrescoStack_default as Stack, FrescoStatic_default as Static, StatusBar, Stepper, Table, FrescoTabs_default as Tabs, Text, TextArea, TextInput, Timer, FrescoTooltip_default as Tooltip, FrescoTransform_default as Transform, FrescoTree_default as Tree, FrescoVStack_default as VStack, createCodeBuffer, defaultMarkdownRenderer, parseMarkdown, renderMarkdown };
|