@vizejs/fresco 0.0.1-alpha.100

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInput-CvEslk0z.js","names":["type: FrescoNode[\"type\"]","rendererOptions: RendererOptions<FrescoNode, FrescoElement>","type: string","createRenderer","root: FrescoNode","nodes: Array<{\n id: number;\n nodeType: string;\n text?: string;\n wrap?: boolean;\n value?: string;\n placeholder?: string;\n focused?: boolean;\n mask?: boolean;\n style?: Record<string, unknown>;\n appearance?: Record<string, unknown>;\n border?: string;\n children?: number[];\n }>","node: FrescoNode","renderNode: (typeof nodes)[0]","style: Record<string, unknown>","appearance: Record<string, unknown>","lastKeyEvent: Ref<KeyEvent | null>","native: typeof import(\"@vizejs/fresco-native\") | null","rootComponent: Component","options: AppOptions","vueApp: VueApp | null","rootElement: FrescoElement | null","exitResolve: (() => void) | null","options: UseInputOptions"],"sources":["../src/renderer.ts","../src/app.ts","../src/composables/useInput.ts"],"sourcesContent":["/**\n * Fresco Vue Custom Renderer\n */\n\nimport {\n createRenderer as createVueRenderer,\n type RendererOptions,\n type RendererNode,\n type RendererElement,\n} from \"@vue/runtime-core\";\n\n/**\n * Fresco node types\n */\nexport interface FrescoNode extends RendererNode {\n id: number;\n type: \"box\" | \"text\" | \"input\" | \"root\";\n props: Record<string, unknown>;\n children: FrescoNode[];\n parent: FrescoNode | null;\n text?: string;\n}\n\n/**\n * Fresco element (extends node)\n */\nexport interface FrescoElement extends FrescoNode, RendererElement {}\n\nlet nextId = 0;\n\nfunction createNode(type: FrescoNode[\"type\"]): FrescoNode {\n return {\n id: nextId++,\n type,\n props: {},\n children: [],\n parent: null,\n };\n}\n\n/**\n * Renderer options for Fresco\n */\nconst rendererOptions: RendererOptions<FrescoNode, FrescoElement> = {\n patchProp(el, key, prevValue, nextValue) {\n el.props[key] = nextValue;\n },\n\n insert(child, parent, anchor) {\n child.parent = parent;\n if (anchor) {\n const index = parent.children.indexOf(anchor);\n if (index !== -1) {\n parent.children.splice(index, 0, child);\n return;\n }\n }\n parent.children.push(child);\n },\n\n remove(child) {\n if (child.parent) {\n const index = child.parent.children.indexOf(child);\n if (index !== -1) {\n child.parent.children.splice(index, 1);\n }\n child.parent = null;\n }\n },\n\n createElement(type) {\n const nodeType = mapElementType(type);\n return createNode(nodeType) as FrescoElement;\n },\n\n createText(text) {\n const node = createNode(\"text\");\n node.text = text;\n return node;\n },\n\n createComment() {\n // Comments are ignored in TUI\n return createNode(\"text\");\n },\n\n setText(node, text) {\n node.text = text;\n },\n\n setElementText(el, text) {\n el.text = text;\n el.children = [];\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 * Map Vue element types to Fresco node types\n */\nfunction mapElementType(type: string): FrescoNode[\"type\"] {\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 default:\n return \"box\";\n }\n}\n\n/**\n * Create the Fresco renderer\n */\nexport function createRenderer() {\n return createVueRenderer(rendererOptions);\n}\n\n/**\n * Convert Fresco tree to render nodes for native\n */\nexport function treeToRenderNodes(root: FrescoNode): Array<{\n id: number;\n nodeType: string;\n text?: string;\n wrap?: boolean;\n value?: string;\n placeholder?: string;\n focused?: boolean;\n mask?: boolean;\n style?: Record<string, unknown>;\n appearance?: Record<string, unknown>;\n border?: string;\n children?: number[];\n}> {\n const nodes: Array<{\n id: number;\n nodeType: string;\n text?: string;\n wrap?: boolean;\n value?: string;\n placeholder?: string;\n focused?: boolean;\n mask?: boolean;\n style?: Record<string, unknown>;\n appearance?: Record<string, unknown>;\n border?: string;\n children?: number[];\n }> = [];\n\n function visit(node: FrescoNode) {\n const renderNode: (typeof nodes)[0] = {\n id: node.id,\n nodeType: node.type,\n };\n\n // Extract props\n if (node.text) {\n renderNode.text = node.text;\n }\n if (node.props.wrap !== undefined) {\n renderNode.wrap = Boolean(node.props.wrap);\n }\n if (node.props.value !== undefined) {\n const v = node.props.value;\n renderNode.value = typeof v === \"string\" || typeof v === \"number\" ? String(v) : \"\";\n }\n if (node.props.placeholder !== undefined) {\n const p = node.props.placeholder;\n renderNode.placeholder = typeof p === \"string\" || typeof p === \"number\" ? String(p) : \"\";\n }\n if (node.props.focused !== undefined) {\n renderNode.focused = Boolean(node.props.focused);\n }\n if (node.props.cursor !== undefined) {\n (renderNode as any).cursor = Number(node.props.cursor);\n }\n if (node.props.mask !== undefined) {\n renderNode.mask = Boolean(node.props.mask);\n }\n if (node.props.border !== undefined) {\n const b = node.props.border;\n renderNode.border = typeof b === \"string\" ? b : \"\";\n }\n\n // Extract style - only include defined values\n if (node.props.style) {\n const s = node.props.style as Record<string, unknown>;\n const style: Record<string, unknown> = {};\n\n if (s.display !== undefined) style.display = s.display;\n if (s.flexDirection !== undefined) style.flexDirection = s.flexDirection;\n if (s.flexWrap !== undefined) style.flexWrap = s.flexWrap;\n if (s.justifyContent !== undefined) style.justifyContent = s.justifyContent;\n if (s.alignItems !== undefined) style.alignItems = s.alignItems;\n if (s.alignSelf !== undefined) style.alignSelf = s.alignSelf;\n if (s.alignContent !== undefined) style.alignContent = s.alignContent;\n if (s.flexGrow !== undefined) style.flexGrow = s.flexGrow;\n if (s.flexShrink !== undefined) style.flexShrink = s.flexShrink;\n if (s.width !== undefined && (typeof s.width === \"string\" || typeof s.width === \"number\"))\n style.width = String(s.width);\n if (s.height !== undefined && (typeof s.height === \"string\" || typeof s.height === \"number\"))\n style.height = String(s.height);\n if (\n s.minWidth !== undefined &&\n (typeof s.minWidth === \"string\" || typeof s.minWidth === \"number\")\n )\n style.minWidth = String(s.minWidth);\n if (\n s.minHeight !== undefined &&\n (typeof s.minHeight === \"string\" || typeof s.minHeight === \"number\")\n )\n style.minHeight = String(s.minHeight);\n if (\n s.maxWidth !== undefined &&\n (typeof s.maxWidth === \"string\" || typeof s.maxWidth === \"number\")\n )\n style.maxWidth = String(s.maxWidth);\n if (\n s.maxHeight !== undefined &&\n (typeof s.maxHeight === \"string\" || typeof s.maxHeight === \"number\")\n )\n style.maxHeight = String(s.maxHeight);\n if (s.padding !== undefined) style.padding = s.padding;\n if (s.paddingTop !== undefined) style.paddingTop = s.paddingTop;\n if (s.paddingRight !== undefined) style.paddingRight = s.paddingRight;\n if (s.paddingBottom !== undefined) style.paddingBottom = s.paddingBottom;\n if (s.paddingLeft !== undefined) style.paddingLeft = s.paddingLeft;\n if (s.margin !== undefined) style.margin = s.margin;\n if (s.marginTop !== undefined) style.marginTop = s.marginTop;\n if (s.marginRight !== undefined) style.marginRight = s.marginRight;\n if (s.marginBottom !== undefined) style.marginBottom = s.marginBottom;\n if (s.marginLeft !== undefined) style.marginLeft = s.marginLeft;\n if (s.gap !== undefined) style.gap = s.gap;\n\n renderNode.style = style as any;\n }\n\n // Extract appearance (fg, bg, bold, etc.)\n const appearance: Record<string, unknown> = {};\n if (node.props.fg) appearance.fg = node.props.fg;\n if (node.props.bg) appearance.bg = node.props.bg;\n if (node.props.bold) appearance.bold = node.props.bold;\n if (node.props.dim) appearance.dim = node.props.dim;\n if (node.props.italic) appearance.italic = node.props.italic;\n if (node.props.underline) appearance.underline = node.props.underline;\n if (Object.keys(appearance).length > 0) {\n renderNode.appearance = appearance;\n }\n\n // Children\n if (node.children.length > 0) {\n renderNode.children = node.children.map((c) => c.id);\n }\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","/**\n * Fresco App - Application instance management\n */\n\nimport { type Component, type App as VueApp, ref, type Ref } from \"@vue/runtime-core\";\nimport { createRenderer, treeToRenderNodes, type FrescoElement } from \"./renderer.js\";\n\n// Event types\nexport interface KeyEvent {\n type: \"key\";\n key?: string;\n char?: string;\n ctrl: boolean;\n alt: boolean;\n shift: boolean;\n}\n\nexport interface ResizeEvent {\n type: \"resize\";\n width: number;\n height: number;\n}\n\nexport type InputEvent = KeyEvent | ResizeEvent;\n\n// Global event state\nexport const lastKeyEvent: Ref<KeyEvent | null> = ref(null);\n\n// Import native bindings\n// eslint-disable-next-line typescript-eslint/no-redundant-type-constituents -- index.d.ts is not yet generated\nlet native: typeof import(\"@vizejs/fresco-native\") | null = null;\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 */\n mouse?: boolean;\n /** Exit on Ctrl+C */\n exitOnCtrlC?: boolean;\n /** Custom error handler */\n onError?: (error: Error) => void;\n /** Debug mode - logs render tree */\n debug?: boolean;\n}\n\n/**\n * Fresco App instance\n */\nexport interface App {\n /** Mount the app */\n mount(): Promise<void>;\n /** Unmount the app */\n unmount(): Promise<void>;\n /** Wait for exit */\n waitUntilExit(): Promise<void>;\n /** Render the app */\n render(): void;\n /** Get terminal info */\n getTerminalInfo(): Promise<{ width: number; height: number }>;\n}\n\n/**\n * Create a Fresco TUI app\n */\nexport function createApp(rootComponent: Component, options: AppOptions = {}): App {\n const { mouse = false, exitOnCtrlC = true, onError } = options;\n\n let vueApp: VueApp | null = null;\n let rootElement: FrescoElement | null = null;\n let mounted = false;\n let running = false;\n let exitResolve: (() => void) | null = null;\n let needsRender = true;\n\n const { createApp: createVueApp } = createRenderer();\n\n async function mount() {\n if (mounted) return;\n\n const n = await loadNative();\n\n // Initialize terminal\n if (mouse) {\n n.initTerminalWithMouse();\n } else {\n n.initTerminal();\n }\n\n // Initialize layout engine\n n.initLayout();\n\n // Create Vue app with custom renderer\n const app = createVueApp(rootComponent);\n\n // Create a root element for mounting\n rootElement = {\n id: -1,\n type: \"root\",\n props: {\n style: {\n width: \"100%\",\n height: \"100%\",\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 app.mount(rootElement);\n vueApp = app;\n\n mounted = true;\n running = true;\n needsRender = true;\n\n // Start event loop\n void eventLoop();\n }\n\n async function unmount() {\n if (!mounted) return;\n\n running = false;\n\n const n = await loadNative();\n n.restoreTerminal();\n\n if (vueApp) {\n vueApp.unmount();\n vueApp = null;\n }\n\n rootElement = null;\n mounted = false;\n\n if (exitResolve) {\n exitResolve();\n }\n }\n\n async function waitUntilExit(): Promise<void> {\n return new Promise((resolve) => {\n exitResolve = resolve;\n });\n }\n\n function render() {\n if (!native || !mounted || !rootElement) {\n return;\n }\n\n try {\n // Convert Vue tree to render nodes\n const renderNodes = treeToRenderNodes(rootElement);\n\n // Send to native for rendering\n if (renderNodes.length > 0) {\n // Use renderTree which handles layout and painting\n native.renderTree(renderNodes as any);\n\n // Flush to display\n native.flushTerminal();\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 const info = n.getTerminalInfo();\n return { width: info.width, height: info.height };\n }\n\n async function eventLoop() {\n const n = await loadNative();\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 // Handle Ctrl+C\n if (\n exitOnCtrlC &&\n event.eventType === \"key\" &&\n event.char === \"c\" &&\n event.modifiers?.ctrl\n ) {\n await unmount();\n break;\n }\n\n // Dispatch key events\n if (event.eventType === \"key\") {\n lastKeyEvent.value = {\n type: \"key\",\n key: event.key ?? undefined,\n char: event.char ?? undefined,\n ctrl: event.modifiers?.ctrl ?? false,\n alt: event.modifiers?.alt ?? false,\n shift: event.modifiers?.shift ?? false,\n };\n }\n }\n\n // Render frame if needed\n if (needsRender) {\n render();\n needsRender = false;\n }\n\n // Schedule re-render (Vue reactivity will trigger updates)\n needsRender = true;\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, 16));\n }\n }\n\n return {\n mount,\n unmount,\n waitUntilExit,\n render,\n getTerminalInfo,\n };\n}\n","/**\n * useInput - Input handling composable\n */\n\nimport { ref, watch, isRef, type Ref } from \"@vue/runtime-core\";\nimport { lastKeyEvent } from \"../app.js\";\n\nexport interface KeyHandler {\n (key: string, modifiers: { ctrl: boolean; alt: boolean; shift: boolean }): void;\n}\n\nexport interface UseInputOptions {\n /** Whether to capture input (boolean or Ref<boolean>) */\n active?: boolean | Ref<boolean>;\n /** Whether to capture input (alias for active, boolean or Ref<boolean>) */\n isActive?: boolean | Ref<boolean>;\n /** Called on key press */\n onKey?: KeyHandler;\n /** Called on character input */\n onChar?: (char: string) => void;\n /** Called on Enter */\n onSubmit?: () => void;\n /** Called on Escape */\n onEscape?: () => void;\n /** Called on arrow keys */\n onArrow?: (direction: \"up\" | \"down\" | \"left\" | \"right\") => void;\n}\n\nexport function useInput(options: UseInputOptions = {}) {\n const {\n active = true,\n isActive: isActiveOption,\n onKey,\n onChar,\n onSubmit,\n onEscape,\n onArrow,\n } = options;\n\n // Support both active and isActive, prefer isActive if both provided\n const activeSource = isActiveOption ?? active;\n const isActive = isRef(activeSource) ? activeSource : ref(activeSource);\n const lastKey = ref<string | null>(null);\n\n // Watch for key events from the app\n watch(lastKeyEvent, (event) => {\n if (!event || !isActive.value) return;\n\n const modifiers = {\n ctrl: event.ctrl,\n alt: event.alt,\n shift: event.shift,\n };\n\n // Character input\n if (event.char) {\n lastKey.value = event.char;\n onChar?.(event.char);\n onKey?.(event.char, modifiers);\n return;\n }\n\n // Special keys\n if (event.key) {\n lastKey.value = event.key;\n onKey?.(event.key, modifiers);\n\n switch (event.key) {\n case \"enter\":\n onSubmit?.();\n break;\n case \"escape\":\n onEscape?.();\n break;\n case \"up\":\n case \"down\":\n case \"left\":\n case \"right\":\n onArrow?.(event.key as \"up\" | \"down\" | \"left\" | \"right\");\n break;\n }\n }\n });\n\n const enable = () => {\n isActive.value = true;\n };\n\n const disable = () => {\n isActive.value = false;\n };\n\n return {\n isActive,\n lastKey,\n enable,\n disable,\n };\n}\n\n/**\n * Shorthand for handling specific key combinations\n */\nexport function useKeyPress(\n key: string,\n handler: () => void,\n options: { ctrl?: boolean; alt?: boolean; shift?: boolean } = {},\n) {\n const { ctrl = false, alt = false, shift = false } = options;\n\n useInput({\n onKey: (pressedKey, modifiers) => {\n const matches =\n pressedKey.toLowerCase() === key.toLowerCase() &&\n modifiers.ctrl === ctrl &&\n modifiers.alt === alt &&\n modifiers.shift === shift;\n\n if (matches) {\n handler();\n }\n },\n });\n}\n"],"mappings":";;;AA4BA,IAAI,SAAS;AAEb,SAAS,WAAWA,MAAsC;AACxD,QAAO;EACL,IAAI;EACJ;EACA,OAAO,CAAE;EACT,UAAU,CAAE;EACZ,QAAQ;CACT;AACF;;;;AAKD,MAAMC,kBAA8D;CAClE,UAAU,IAAI,KAAK,WAAW,WAAW;AACvC,KAAG,MAAM,OAAO;CACjB;CAED,OAAO,OAAO,QAAQ,QAAQ;AAC5B,QAAM,SAAS;AACf,MAAI,QAAQ;GACV,MAAM,QAAQ,OAAO,SAAS,QAAQ,OAAO;AAC7C,OAAI,UAAU,IAAI;AAChB,WAAO,SAAS,OAAO,OAAO,GAAG,MAAM;AACvC;GACD;EACF;AACD,SAAO,SAAS,KAAK,MAAM;CAC5B;CAED,OAAO,OAAO;AACZ,MAAI,MAAM,QAAQ;GAChB,MAAM,QAAQ,MAAM,OAAO,SAAS,QAAQ,MAAM;AAClD,OAAI,UAAU,GACZ,OAAM,OAAO,SAAS,OAAO,OAAO,EAAE;AAExC,SAAM,SAAS;EAChB;CACF;CAED,cAAc,MAAM;EAClB,MAAM,WAAW,eAAe,KAAK;AACrC,SAAO,WAAW,SAAS;CAC5B;CAED,WAAW,MAAM;EACf,MAAM,OAAO,WAAW,OAAO;AAC/B,OAAK,OAAO;AACZ,SAAO;CACR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C,OAAM,cAAc,CAAC,UAAU;AAC7B,OAAK,UAAU,SAAS,MAAO;EAE/B,MAAM,YAAY;GAChB,MAAM,MAAM;GACZ,KAAK,MAAM;GACX,OAAO,MAAM;EACd;AAGD,MAAI,MAAM,MAAM;AACd,WAAQ,QAAQ,MAAM;AACtB,YAAS,MAAM,KAAK;AACpB,WAAQ,MAAM,MAAM,UAAU;AAC9B;EACD;AAGD,MAAI,MAAM,KAAK;AACb,WAAQ,QAAQ,MAAM;AACtB,WAAQ,MAAM,KAAK,UAAU;AAE7B,WAAQ,MAAM,KAAd;IACE,KAAK;AACH,iBAAY;AACZ;IACF,KAAK;AACH,iBAAY;AACZ;IACF,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;AACH,eAAU,MAAM,IAAwC;AACxD;GACH;EACF;CACF,EAAC;CAEF,MAAM,SAAS,MAAM;AACnB,WAAS,QAAQ;CAClB;CAED,MAAM,UAAU,MAAM;AACpB,WAAS,QAAQ;CAClB;AAED,QAAO;EACL;EACA;EACA;EACA;CACD;AACF"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@vizejs/fresco",
3
+ "version": "0.0.1-alpha.100",
4
+ "description": "Vue TUI framework - Build terminal UIs with Vue.js",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "type": "module",
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ },
16
+ "./components": {
17
+ "import": "./dist/components/index.js",
18
+ "types": "./dist/components/index.d.ts"
19
+ },
20
+ "./composables": {
21
+ "import": "./dist/composables/index.js",
22
+ "types": "./dist/composables/index.d.ts"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "keywords": [
29
+ "vue",
30
+ "tui",
31
+ "terminal",
32
+ "cli",
33
+ "ink",
34
+ "fresco",
35
+ "vize"
36
+ ],
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/ubugeeei/vize",
41
+ "directory": "npm/fresco"
42
+ },
43
+ "dependencies": {
44
+ "@vizejs/fresco-native": "0.0.1-alpha.100"
45
+ },
46
+ "peerDependencies": {
47
+ "@vue/runtime-core": "^3.4.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^22.0.0",
51
+ "@vue/runtime-core": "^3.5.0",
52
+ "tsdown": "^0.9.0",
53
+ "typescript": "~5.6.0"
54
+ },
55
+ "scripts": {
56
+ "build": "tsdown",
57
+ "dev": "tsdown --watch",
58
+ "lint": "oxlint --deny-warnings --type-aware --tsconfig tsconfig.json",
59
+ "lint:fix": "oxlint --type-aware --tsconfig tsconfig.json --fix",
60
+ "fmt": "oxfmt --write src",
61
+ "fmt:check": "oxfmt src"
62
+ }
63
+ }