@vizejs/fresco 0.0.1-alpha.31

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":"index-DKRZxCzP.d.ts","names":[],"sources":["../src/components/Box.ts","../src/components/Divider.ts","../src/components/Stack.ts","../src/components/Grid.ts","../src/components/Card.ts","../src/components/Text.ts","../src/components/Code.ts","../src/components/Link.ts","../src/components/TextInput.ts","../src/components/TextArea.ts","../src/components/Select.ts","../src/components/Checkbox.ts","../src/components/RadioGroup.ts","../src/components/Confirm.ts","../src/components/Form.ts","../src/components/Spinner.ts","../src/components/ProgressBar.ts","../src/components/Alert.ts","../src/components/Badge.ts","../src/components/Timer.ts","../src/components/Tooltip.ts","../src/components/List.ts","../src/components/Table.ts","../src/components/Tree.ts","../src/components/Menu.ts","../src/components/Tabs.ts","../src/components/Breadcrumb.ts","../src/components/Stepper.ts","../src/components/Modal.ts","../src/components/StatusBar.ts","../src/components/Header.ts","../src/components/KeyHint.ts","../src/components/Avatar.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAMiB,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuEJ,wBAAG,+BAAA,kBAAA,CAAA,MAoGd,kBAAA,CApGc,YAAA,EAAA,kBAAA,CAAA,eAAA;;gBAAA,kBAAA,CAAA,qBAAA;;;;;;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MA0JlB,oBAAA,CA1JkB,YAAA,EAAA,oBAAA,CAAA,eAAA;;gBAAA,oBAAA,CAAA,qBAAA;;;;;;;;;;;;;;;UC/BH,UAAA;;;;;;;;;;;;;;;;;;cAmBJ,4BAAK,+BAAA,MA0GhB,oBAAA,CA1GgB,YAAA,EAAA,oBAAA,CAAA,eAAA;;uBAAA,oBAAA,CAAA,qBAAA;;;;;;;;;;;;;UCnBD,aAAA;;;;;;;;UASA,cAAA;;SAER;;;;;;;;cASI,gCAAS,+BAAA,MAwEpB,oBAAA,CAxEoB,YAAA,EAAA,oBAAA,CAAA,eAAA;;gBAAA,oBAAA,CAAA,qBAAA;;;;;;;;;UCpBL,WAAA;;;;;;;;;;;;;;;;;;cAmBJ,6BAAM,+BAAA,MAkFjB,oBAAA,CAlFiB,YAAA,EAAA,oBAAA,CAAA,eAAA;;gBAAA,oBAAA,CAAA,qBAAA;;;;;;;;;;;;UCnBF,UAAA;;;;UAKA,YAAA;;YAEL;;;;;;;;;;;;cAaC,8BAAO,+BAAA,oBAAA,CAAA,MA6ElB,oBAAA,CA7EkB,YAAA,EAAA,oBAAA,CAAA,eAAA;;gBAAA,oBAAA,CAAA,qBAAA;;;;;;;;;;;;;;UCpBH,WAAA;;;;;;;;;;;;;;;;cA+BJ,6BAAM,+BAAA,oBAAA,CAAA,MAiGjB,oBAAA,CAjGiB,YAAA,EAAA,oBAAA,CAAA,eAAA;;gBAAA,oBAAA,CAAA,qBAAA"}
@@ -0,0 +1,161 @@
1
+ import { Ref } from "@vue/runtime-core";
2
+
3
+ //#region src/composables/useInput.d.ts
4
+
5
+ interface KeyHandler {
6
+ (key: string, modifiers: {
7
+ ctrl: boolean;
8
+ alt: boolean;
9
+ shift: boolean;
10
+ }): void;
11
+ }
12
+ interface UseInputOptions {
13
+ /** Whether to capture input (boolean or Ref<boolean>) */
14
+ active?: boolean | Ref<boolean>;
15
+ /** Whether to capture input (alias for active, boolean or Ref<boolean>) */
16
+ isActive?: boolean | Ref<boolean>;
17
+ /** Called on key press */
18
+ onKey?: KeyHandler;
19
+ /** Called on character input */
20
+ onChar?: (char: string) => void;
21
+ /** Called on Enter */
22
+ onSubmit?: () => void;
23
+ /** Called on Escape */
24
+ onEscape?: () => void;
25
+ /** Called on arrow keys */
26
+ onArrow?: (direction: "up" | "down" | "left" | "right") => void;
27
+ }
28
+ declare function useInput(options?: UseInputOptions): {
29
+ isActive: any;
30
+ lastKey: any;
31
+ enable: () => void;
32
+ disable: () => void;
33
+ }; //#endregion
34
+ //#region src/composables/useFocus.d.ts
35
+
36
+ /**
37
+ * Shorthand for handling specific key combinations
38
+ */
39
+ interface UseFocusOptions {
40
+ /** Whether this element starts focused */
41
+ autoFocus?: boolean;
42
+ /** Focus ID for this element */
43
+ id?: string;
44
+ }
45
+ interface FocusManager {
46
+ /** Currently focused element ID */
47
+ focusedId: Ref<string | null>;
48
+ /** All focusable element IDs */
49
+ focusableIds: Ref<string[]>;
50
+ /** Focus a specific element */
51
+ focus: (id: string) => void;
52
+ /** Focus next element */
53
+ focusNext: () => void;
54
+ /** Focus previous element */
55
+ focusPrevious: () => void;
56
+ /** Register a focusable element */
57
+ register: (id: string) => void;
58
+ /** Unregister a focusable element */
59
+ unregister: (id: string) => void;
60
+ }
61
+ /**
62
+ * Create a focus manager (use at app root)
63
+ */
64
+
65
+ /**
66
+ * Use focus management
67
+ */
68
+ declare function useFocus(options?: UseFocusOptions): {
69
+ id: string;
70
+ isFocused: any;
71
+ focus: () => void;
72
+ blur: () => void;
73
+ }; //#endregion
74
+ //#region src/composables/useApp.d.ts
75
+
76
+ //# sourceMappingURL=useFocus.d.ts.map
77
+ interface UseAppReturn {
78
+ /** Terminal width */
79
+ width: Ref<number>;
80
+ /** Terminal height */
81
+ height: Ref<number>;
82
+ /** Whether app is running */
83
+ isRunning: Ref<boolean>;
84
+ /** Exit the app */
85
+ exit: (code?: number) => void;
86
+ /** Force re-render */
87
+ render: () => void;
88
+ /** Clear the screen */
89
+ clear: () => void;
90
+ }
91
+ /**
92
+ * Create app context (use at app root)
93
+ */
94
+
95
+ /**
96
+ * Use app context
97
+ */
98
+ declare function useApp(): UseAppReturn;
99
+
100
+ //#endregion
101
+ //#region src/composables/useIme.d.ts
102
+ /**
103
+ * Use terminal dimensions
104
+ */
105
+ interface UseImeOptions {
106
+ /** Initial IME mode */
107
+ mode?: ImeMode;
108
+ /** Called when IME mode changes */
109
+ onModeChange?: (mode: ImeMode) => void;
110
+ /** Called when composition updates */
111
+ onCompositionUpdate?: (text: string, cursor: number) => void;
112
+ /** Called when text is committed */
113
+ onCommit?: (text: string) => void;
114
+ }
115
+ type ImeMode = "direct" | "hiragana" | "katakana" | "half-katakana" | "full-alpha" | "pinyin" | "hangul";
116
+ interface ImeManager {
117
+ /** Whether IME is active */
118
+ isActive: Ref<boolean>;
119
+ /** Current input mode */
120
+ mode: Ref<ImeMode>;
121
+ /** Whether currently composing */
122
+ isComposing: Ref<boolean>;
123
+ /** Preedit text */
124
+ preedit: Ref<string>;
125
+ /** Cursor position in preedit */
126
+ preeditCursor: Ref<number>;
127
+ /** Candidate list */
128
+ candidates: Ref<string[]>;
129
+ /** Selected candidate index */
130
+ selectedCandidate: Ref<number>;
131
+ /** Mode display name */
132
+ modeDisplay: Ref<string>;
133
+ /** Enable IME */
134
+ enable: () => void;
135
+ /** Disable IME */
136
+ disable: () => void;
137
+ /** Set input mode */
138
+ setMode: (mode: ImeMode) => void;
139
+ /** Handle key event for IME */
140
+ handleKey: (key: string, modifiers: {
141
+ ctrl: boolean;
142
+ alt: boolean;
143
+ }) => boolean;
144
+ /** Commit current composition */
145
+ commit: () => void;
146
+ /** Cancel current composition */
147
+ cancel: () => void;
148
+ /** Select next candidate */
149
+ nextCandidate: () => void;
150
+ /** Select previous candidate */
151
+ prevCandidate: () => void;
152
+ /** Select candidate by number (1-9) */
153
+ selectCandidate: (num: number) => void;
154
+ }
155
+ declare function useIme(options?: UseImeOptions): ImeManager;
156
+
157
+ //#endregion
158
+ //# sourceMappingURL=useIme.d.ts.map
159
+
160
+ export { FocusManager, ImeManager, KeyHandler, UseAppReturn, UseFocusOptions, UseImeOptions, UseInputOptions, useApp as useApp$1, useFocus as useFocus$1, useIme as useIme$1, useInput };
161
+ //# sourceMappingURL=index-z9cQDuri.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-z9cQDuri.d.ts","names":[],"sources":["../src/composables/useInput.ts","../src/composables/useFocus.ts","../src/composables/useApp.ts","../src/composables/useIme.ts"],"sourcesContent":null,"mappings":";;;;AAWiB,UAJA,UAAA,CAIe;EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,SAAA,EAAA;IAEX,IAAA,EAAA,OAAA;IAEE,GAAA,EAAA,OAAA;IAEb,KAAA,EAAA,OAAA;EAAU,CAAA,CAAA,EAAA,IAAA;AAWpB;UAjBiB,eAAA;;qBAEI;ECLJ;EAOA,QAAA,CAAA,EAAA,OAAY,GDAN,GCAM,CAAA,OAAA,CAAA;EAAA;EAAA,KAEhB,CAAA,EDAH,UCAG;EAAG;EAEG,MAAA,CAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA,IAAA;;;;EAiFH,QAAA,CAAA,EAAQ,GAAA,GAAA,IAAA;;;;AC5FP,iBFoBD,QAAA,CEpBa,OAAA,CAAA,EFoBK,eEpBL,CAAA,EAAA;EAAA,QAAA,EAAA,GAAA;EAAA,OAEpB,EAAA,GAAA;EAAG,MAEF,EAAA,GAAA,GAAA,IAAA;EAAG,OAEA,EAAA,GAAA,GAAA,IAAA;AAAG,CAAA,CAAA;;;;;;AFHC,UCHA,eAAA,CDGe;EAAA;EAAA,SAEX,CAAA,EAAA,OAAA;EAAG;EAEE,EAAA,CAEhB,EAAA,MAAA;AAAU;AAWJ,UCbC,YAAA,CDaiB;;aCXrB;;EATI,YAAA,EAWD,GAXC,CAAe,MAAA,EAAA,CAAA;EAOf;EAAY,KAAA,EAAA,CAAA,EAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EAAA;EA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C5BE;;;IA1CD,IAAA,EAAA,OAAa;IAAA,GAAA,EAAA,OAAA;EAAA,CAAA,EAErB,GAAA,OAAA;EAAO;EAEe,MAAA,EAAA,GAAA,GAAA,IAAA;EAOnB;EASK,MAAA,EAAA,GAAA,GAAU,IAAA;EAAA;EAAA,aAEf,EAAA,GAAA,GAAA,IAAA;EAAG;EAEI,aAAX,EAAA,GAAA,GAAA,IAAA;EAAG;EAEO,eAEP,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,IAAA;;AAIG,iBAmCE,MAAA,CAnCF,OAAA,CAAA,EAmCkB,aAnClB,CAAA,EAmCuC,UAnCvC"}
@@ -0,0 +1,81 @@
1
+ import { Alert$1 as Alert, AlertProps, AlertType, Avatar$1 as Avatar, AvatarProps, Badge$1 as Badge, BadgeProps, BadgeVariant, Box$1 as Box, BoxProps, Breadcrumb$1 as Breadcrumb, BreadcrumbItem, BreadcrumbProps, Card$1 as Card, CardProps, Checkbox$1 as Checkbox, CheckboxProps, Code$1 as Code, CodeProps, Confirm$1 as Confirm, ConfirmProps, Divider$1 as Divider, DividerProps, Form$1 as Form, FormField, FormProps, Grid$1 as Grid, GridProps, HStack$1 as HStack, Header$1 as Header, HeaderProps, KeyBinding, KeyHint$1 as KeyHint, KeyHintProps, Link$1 as Link, LinkProps, List$1 as List, ListItem, ListProps, Menu$1 as Menu, MenuItem, MenuProps, Modal$1 as Modal, ModalProps, ProgressBar$1 as ProgressBar, ProgressBarProps, RadioGroup$1 as RadioGroup, RadioGroupProps, RadioOption, Select$1 as Select, SelectOption, SelectProps, Spinner$1 as Spinner, SpinnerProps, Stack$1 as Stack, StackProps, StatusBar$1 as StatusBar, StatusBarItem, StatusBarProps, Step, StepStatus, Stepper$1 as Stepper, StepperProps, Tab, Table$1 as Table, TableColumn, TableProps, Tabs$1 as Tabs, TabsProps, Text$1 as Text, TextArea$1 as TextArea, TextAreaProps, TextInput$1 as TextInput, TextInputProps, TextProps, Timer$1 as Timer, TimerMode, TimerProps, Tooltip$1 as Tooltip, TooltipPosition, TooltipProps, Tree$1 as Tree, TreeNode, TreeProps, VStack$1 as VStack } from "./index-DKRZxCzP.js";
2
+ import { FocusManager, ImeManager, KeyHandler, UseAppReturn, UseFocusOptions, UseImeOptions, UseInputOptions, useApp$1 as useApp, useFocus$1 as useFocus, useIme$1 as useIme, useInput } from "./index-z9cQDuri.js";
3
+ import * as _vue_runtime_core317 from "@vue/runtime-core";
4
+ import { Component, Ref, RendererElement, RendererNode } from "@vue/runtime-core";
5
+ import { FlexStyleNapi, ImeStateNapi, InputEventNapi, RenderNodeNapi, StyleNapi, TerminalInfoNapi } from "@vizejs/fresco-native";
6
+
7
+ //#region src/app.d.ts
8
+ interface KeyEvent {
9
+ type: "key";
10
+ key?: string;
11
+ char?: string;
12
+ ctrl: boolean;
13
+ alt: boolean;
14
+ shift: boolean;
15
+ }
16
+ declare const lastKeyEvent: Ref<KeyEvent | null>;
17
+ /**
18
+ * App options
19
+ */
20
+ interface AppOptions {
21
+ /** Enable mouse support */
22
+ mouse?: boolean;
23
+ /** Exit on Ctrl+C */
24
+ exitOnCtrlC?: boolean;
25
+ /** Custom error handler */
26
+ onError?: (error: Error) => void;
27
+ /** Debug mode - logs render tree */
28
+ debug?: boolean;
29
+ }
30
+ /**
31
+ * Fresco App instance
32
+ */
33
+ interface App {
34
+ /** Mount the app */
35
+ mount(): Promise<void>;
36
+ /** Unmount the app */
37
+ unmount(): Promise<void>;
38
+ /** Wait for exit */
39
+ waitUntilExit(): Promise<void>;
40
+ /** Render the app */
41
+ render(): void;
42
+ /** Get terminal info */
43
+ getTerminalInfo(): Promise<{
44
+ width: number;
45
+ height: number;
46
+ }>;
47
+ }
48
+ /**
49
+ * Create a Fresco TUI app
50
+ */
51
+ declare function createApp(rootComponent: Component, options?: AppOptions): App; //#endregion
52
+ //#region src/renderer.d.ts
53
+
54
+ //# sourceMappingURL=app.d.ts.map
55
+ /**
56
+ * Fresco node types
57
+ */
58
+ interface FrescoNode extends RendererNode {
59
+ id: number;
60
+ type: "box" | "text" | "input" | "root";
61
+ props: Record<string, unknown>;
62
+ children: FrescoNode[];
63
+ parent: FrescoNode | null;
64
+ text?: string;
65
+ }
66
+ /**
67
+ * Fresco element (extends node)
68
+ */
69
+ interface FrescoElement extends FrescoNode, RendererElement {}
70
+ /**
71
+ * Create the Fresco renderer
72
+ */
73
+ declare function createRenderer(): _vue_runtime_core317.Renderer<FrescoElement>;
74
+
75
+ //#endregion
76
+ /**
77
+ * Convert Fresco tree to render nodes for native
78
+ */
79
+
80
+ export { Alert, AlertProps, AlertType, App, AppOptions, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Box, BoxProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Card, CardProps, Checkbox, CheckboxProps, Code, CodeProps, Confirm, ConfirmProps, Divider, DividerProps, FlexStyleNapi, FocusManager, Form, FormField, FormProps, Grid, GridProps, HStack, Header, HeaderProps, ImeManager, ImeStateNapi, InputEventNapi, KeyBinding, KeyEvent, KeyHandler, KeyHint, KeyHintProps, Link, LinkProps, List, ListItem, ListProps, Menu, MenuItem, MenuProps, Modal, ModalProps, ProgressBar, ProgressBarProps, RadioGroup, RadioGroupProps, RadioOption, RenderNodeNapi, Select, SelectOption, SelectProps, Spinner, SpinnerProps, Stack, StackProps, StatusBar, StatusBarItem, StatusBarProps, Step, StepStatus, Stepper, StepperProps, StyleNapi, Tab, Table, TableColumn, TableProps, Tabs, TabsProps, TerminalInfoNapi, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Timer, TimerMode, TimerProps, Tooltip, TooltipPosition, TooltipProps, Tree, TreeNode, TreeProps, UseAppReturn, UseFocusOptions, UseImeOptions, UseInputOptions, VStack, createApp, createRenderer, lastKeyEvent, useApp, useFocus, useIme, useInput };
81
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/app.ts","../src/renderer.ts"],"sourcesContent":null,"mappings":";;;;;;;UAQiB,QAAA;;;EAAA,IAAA,CAAA,EAAA,MAAQ;EAkBZ,IAAA,EAAA,OAAA;EAA8C,GAAA,EAAA,OAAA;EAAA,KAA5B,EAAA,OAAA;;cAAlB,cAAc,IAAI;;AA6B/B;;AAEW,UAhBM,UAAA,CAgBN;EAAO;EAEE,KAED,CAAA,EAAA,OAAA;EAAO;EAIE,WAAA,CAAA,EAAA,OAAA;;oBAlBR;;EAwBJ,KAAA,CAAA,EAAA,OAAS;;;;;AAAyD,UAhBjE,GAAA,CAgBiE;;WAdvE;;aAEE;;mBAEM;EC/CF;EAAW,MAAA,EAAA,EAAA,IAAA;EAAA;EAGb,eACH,EAAA,ED+CS,OC/CT,CAAA;IACF,KAAA,EAAA,MAAA;IAL0B,MAAA,EAAA,MAAA;EAAY,CAAA,CAAA;;;;AAYhD;AAA+B,iBD6Cf,SAAA,CC7Ce,aAAA,ED6CU,SC7CV,EAAA,OAAA,CAAA,ED6C8B,UC7C9B,CAAA,ED6CgD,GC7ChD,CAAA;;;;;;;ADlBd,UCMA,UAAA,SAAmB,YDNX,CAAA;EAkBZ,EAAA,EAAA,MAAA;EAA8C,IAAA,EAAA,KAAA,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA;EAAA,KAA5B,ECTtB,MDSsB,CAAA,MAAA,EAAA,OAAA,CAAA;EAAQ,QAAZ,ECRf,UDQe,EAAA;EAAG,MAAA,ECPpB,UDOoB,GAAA,IAAA;;;;AAe9B;;UCfiB,aAAA,SAAsB,YAAY;AD6BnD;;;AAIa,iBCsEG,cAAA,CAAA,CDtEH,ECsEiB,oBAAA,CAAA,QDtEjB,CCsEiB,aDtEjB,CAAA;;;;;AAMe"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { createApp, createRenderer, lastKeyEvent, useInput$1 as useInput } from "./useInput-CvEslk0z.js";
2
+ import { Alert, Avatar, Badge, Box, Breadcrumb, Card, Checkbox, Code, Confirm, Divider, Form, Grid, HStack, Header, KeyHint, Link, List, Menu, Modal, ProgressBar, RadioGroup, Select, Spinner, Stack, StatusBar, Stepper, Table, Tabs, Text, TextArea, TextInput, Timer, Tooltip, Tree, VStack } from "./components-DtI-O8Cr.js";
3
+ import { useApp, useFocus, useIme } from "./composables-CLuPs-N5.js";
4
+
5
+ export { Alert, Avatar, Badge, Box, Breadcrumb, Card, Checkbox, Code, Confirm, Divider, Form, Grid, HStack, Header, KeyHint, Link, List, Menu, Modal, ProgressBar, RadioGroup, Select, Spinner, Stack, StatusBar, Stepper, Table, Tabs, Text, TextArea, TextInput, Timer, Tooltip, Tree, VStack, createApp, createRenderer, lastKeyEvent, useApp, useFocus, useIme, useInput };
@@ -0,0 +1,348 @@
1
+ import { createRenderer, isRef, ref, watch } from "@vue/runtime-core";
2
+
3
+ //#region src/renderer.ts
4
+ let nextId = 0;
5
+ function createNode(type) {
6
+ return {
7
+ id: nextId++,
8
+ type,
9
+ props: {},
10
+ children: [],
11
+ parent: null
12
+ };
13
+ }
14
+ /**
15
+ * Renderer options for Fresco
16
+ */
17
+ const rendererOptions = {
18
+ patchProp(el, key, prevValue, nextValue) {
19
+ el.props[key] = nextValue;
20
+ },
21
+ insert(child, parent, anchor) {
22
+ child.parent = parent;
23
+ if (anchor) {
24
+ const index = parent.children.indexOf(anchor);
25
+ if (index !== -1) {
26
+ parent.children.splice(index, 0, child);
27
+ return;
28
+ }
29
+ }
30
+ parent.children.push(child);
31
+ },
32
+ remove(child) {
33
+ if (child.parent) {
34
+ const index = child.parent.children.indexOf(child);
35
+ if (index !== -1) child.parent.children.splice(index, 1);
36
+ child.parent = null;
37
+ }
38
+ },
39
+ createElement(type) {
40
+ const nodeType = mapElementType(type);
41
+ return createNode(nodeType);
42
+ },
43
+ createText(text) {
44
+ const node = createNode("text");
45
+ node.text = text;
46
+ return node;
47
+ },
48
+ createComment() {
49
+ return createNode("text");
50
+ },
51
+ setText(node, text) {
52
+ node.text = text;
53
+ },
54
+ setElementText(el, text) {
55
+ el.text = text;
56
+ el.children = [];
57
+ },
58
+ parentNode(node) {
59
+ return node.parent;
60
+ },
61
+ nextSibling(node) {
62
+ if (!node.parent) return null;
63
+ const index = node.parent.children.indexOf(node);
64
+ return node.parent.children[index + 1] || null;
65
+ }
66
+ };
67
+ /**
68
+ * Map Vue element types to Fresco node types
69
+ */
70
+ function mapElementType(type) {
71
+ switch (type.toLowerCase()) {
72
+ case "box":
73
+ case "div":
74
+ case "view": return "box";
75
+ case "text":
76
+ case "span": return "text";
77
+ case "input":
78
+ case "textinput": return "input";
79
+ default: return "box";
80
+ }
81
+ }
82
+ /**
83
+ * Create the Fresco renderer
84
+ */
85
+ function createRenderer$1() {
86
+ return createRenderer(rendererOptions);
87
+ }
88
+ /**
89
+ * Convert Fresco tree to render nodes for native
90
+ */
91
+ function treeToRenderNodes(root) {
92
+ const nodes = [];
93
+ function visit(node) {
94
+ const renderNode = {
95
+ id: node.id,
96
+ nodeType: node.type
97
+ };
98
+ if (node.text) renderNode.text = node.text;
99
+ if (node.props.wrap !== void 0) renderNode.wrap = Boolean(node.props.wrap);
100
+ if (node.props.value !== void 0) {
101
+ const v = node.props.value;
102
+ renderNode.value = typeof v === "string" || typeof v === "number" ? String(v) : "";
103
+ }
104
+ if (node.props.placeholder !== void 0) {
105
+ const p = node.props.placeholder;
106
+ renderNode.placeholder = typeof p === "string" || typeof p === "number" ? String(p) : "";
107
+ }
108
+ if (node.props.focused !== void 0) renderNode.focused = Boolean(node.props.focused);
109
+ if (node.props.cursor !== void 0) renderNode.cursor = Number(node.props.cursor);
110
+ if (node.props.mask !== void 0) renderNode.mask = Boolean(node.props.mask);
111
+ if (node.props.border !== void 0) {
112
+ const b = node.props.border;
113
+ renderNode.border = typeof b === "string" ? b : "";
114
+ }
115
+ if (node.props.style) {
116
+ const s = node.props.style;
117
+ const style = {};
118
+ if (s.display !== void 0) style.display = s.display;
119
+ if (s.flexDirection !== void 0) style.flexDirection = s.flexDirection;
120
+ if (s.flexWrap !== void 0) style.flexWrap = s.flexWrap;
121
+ if (s.justifyContent !== void 0) style.justifyContent = s.justifyContent;
122
+ if (s.alignItems !== void 0) style.alignItems = s.alignItems;
123
+ if (s.alignSelf !== void 0) style.alignSelf = s.alignSelf;
124
+ if (s.alignContent !== void 0) style.alignContent = s.alignContent;
125
+ if (s.flexGrow !== void 0) style.flexGrow = s.flexGrow;
126
+ if (s.flexShrink !== void 0) style.flexShrink = s.flexShrink;
127
+ if (s.width !== void 0 && (typeof s.width === "string" || typeof s.width === "number")) style.width = String(s.width);
128
+ if (s.height !== void 0 && (typeof s.height === "string" || typeof s.height === "number")) style.height = String(s.height);
129
+ if (s.minWidth !== void 0 && (typeof s.minWidth === "string" || typeof s.minWidth === "number")) style.minWidth = String(s.minWidth);
130
+ if (s.minHeight !== void 0 && (typeof s.minHeight === "string" || typeof s.minHeight === "number")) style.minHeight = String(s.minHeight);
131
+ if (s.maxWidth !== void 0 && (typeof s.maxWidth === "string" || typeof s.maxWidth === "number")) style.maxWidth = String(s.maxWidth);
132
+ if (s.maxHeight !== void 0 && (typeof s.maxHeight === "string" || typeof s.maxHeight === "number")) style.maxHeight = String(s.maxHeight);
133
+ if (s.padding !== void 0) style.padding = s.padding;
134
+ if (s.paddingTop !== void 0) style.paddingTop = s.paddingTop;
135
+ if (s.paddingRight !== void 0) style.paddingRight = s.paddingRight;
136
+ if (s.paddingBottom !== void 0) style.paddingBottom = s.paddingBottom;
137
+ if (s.paddingLeft !== void 0) style.paddingLeft = s.paddingLeft;
138
+ if (s.margin !== void 0) style.margin = s.margin;
139
+ if (s.marginTop !== void 0) style.marginTop = s.marginTop;
140
+ if (s.marginRight !== void 0) style.marginRight = s.marginRight;
141
+ if (s.marginBottom !== void 0) style.marginBottom = s.marginBottom;
142
+ if (s.marginLeft !== void 0) style.marginLeft = s.marginLeft;
143
+ if (s.gap !== void 0) style.gap = s.gap;
144
+ renderNode.style = style;
145
+ }
146
+ const appearance = {};
147
+ if (node.props.fg) appearance.fg = node.props.fg;
148
+ if (node.props.bg) appearance.bg = node.props.bg;
149
+ if (node.props.bold) appearance.bold = node.props.bold;
150
+ if (node.props.dim) appearance.dim = node.props.dim;
151
+ if (node.props.italic) appearance.italic = node.props.italic;
152
+ if (node.props.underline) appearance.underline = node.props.underline;
153
+ if (Object.keys(appearance).length > 0) renderNode.appearance = appearance;
154
+ if (node.children.length > 0) renderNode.children = node.children.map((c) => c.id);
155
+ nodes.push(renderNode);
156
+ for (const child of node.children) visit(child);
157
+ }
158
+ visit(root);
159
+ return nodes;
160
+ }
161
+
162
+ //#endregion
163
+ //#region src/app.ts
164
+ const lastKeyEvent = ref(null);
165
+ let native = null;
166
+ async function loadNative() {
167
+ if (!native) native = await import("@vizejs/fresco-native");
168
+ return native;
169
+ }
170
+ /**
171
+ * Create a Fresco TUI app
172
+ */
173
+ function createApp(rootComponent, options = {}) {
174
+ const { mouse = false, exitOnCtrlC = true, onError } = options;
175
+ let vueApp = null;
176
+ let rootElement = null;
177
+ let mounted = false;
178
+ let running = false;
179
+ let exitResolve = null;
180
+ let needsRender = true;
181
+ const { createApp: createVueApp } = createRenderer$1();
182
+ async function mount() {
183
+ if (mounted) return;
184
+ const n = await loadNative();
185
+ if (mouse) n.initTerminalWithMouse();
186
+ else n.initTerminal();
187
+ n.initLayout();
188
+ const app = createVueApp(rootComponent);
189
+ rootElement = {
190
+ id: -1,
191
+ type: "root",
192
+ props: { style: {
193
+ width: "100%",
194
+ height: "100%",
195
+ flexDirection: "column",
196
+ justifyContent: "flex-start",
197
+ alignItems: "flex-start",
198
+ alignContent: "flex-start"
199
+ } },
200
+ children: [],
201
+ parent: null
202
+ };
203
+ app.mount(rootElement);
204
+ vueApp = app;
205
+ mounted = true;
206
+ running = true;
207
+ needsRender = true;
208
+ eventLoop();
209
+ }
210
+ async function unmount() {
211
+ if (!mounted) return;
212
+ running = false;
213
+ const n = await loadNative();
214
+ n.restoreTerminal();
215
+ if (vueApp) {
216
+ vueApp.unmount();
217
+ vueApp = null;
218
+ }
219
+ rootElement = null;
220
+ mounted = false;
221
+ if (exitResolve) exitResolve();
222
+ }
223
+ async function waitUntilExit() {
224
+ return new Promise((resolve) => {
225
+ exitResolve = resolve;
226
+ });
227
+ }
228
+ function render() {
229
+ if (!native || !mounted || !rootElement) return;
230
+ try {
231
+ const renderNodes = treeToRenderNodes(rootElement);
232
+ if (renderNodes.length > 0) {
233
+ native.renderTree(renderNodes);
234
+ native.flushTerminal();
235
+ }
236
+ } catch (error) {
237
+ if (onError) onError(error);
238
+ else console.error("Render error:", error);
239
+ }
240
+ }
241
+ async function getTerminalInfo() {
242
+ const n = await loadNative();
243
+ const info = n.getTerminalInfo();
244
+ return {
245
+ width: info.width,
246
+ height: info.height
247
+ };
248
+ }
249
+ async function eventLoop() {
250
+ const n = await loadNative();
251
+ while (running) {
252
+ try {
253
+ const event = n.pollEvent(16);
254
+ if (event) {
255
+ if (event.eventType === "resize") {
256
+ n.syncTerminalSize();
257
+ n.clearScreen();
258
+ needsRender = true;
259
+ }
260
+ if (exitOnCtrlC && event.eventType === "key" && event.char === "c" && event.modifiers?.ctrl) {
261
+ await unmount();
262
+ break;
263
+ }
264
+ if (event.eventType === "key") lastKeyEvent.value = {
265
+ type: "key",
266
+ key: event.key ?? void 0,
267
+ char: event.char ?? void 0,
268
+ ctrl: event.modifiers?.ctrl ?? false,
269
+ alt: event.modifiers?.alt ?? false,
270
+ shift: event.modifiers?.shift ?? false
271
+ };
272
+ }
273
+ if (needsRender) {
274
+ render();
275
+ needsRender = false;
276
+ }
277
+ needsRender = true;
278
+ } catch (error) {
279
+ if (onError) onError(error);
280
+ }
281
+ await new Promise((resolve) => setTimeout(resolve, 16));
282
+ }
283
+ }
284
+ return {
285
+ mount,
286
+ unmount,
287
+ waitUntilExit,
288
+ render,
289
+ getTerminalInfo
290
+ };
291
+ }
292
+
293
+ //#endregion
294
+ //#region src/composables/useInput.ts
295
+ function useInput(options = {}) {
296
+ const { active = true, isActive: isActiveOption, onKey, onChar, onSubmit, onEscape, onArrow } = options;
297
+ const activeSource = isActiveOption ?? active;
298
+ const isActive = isRef(activeSource) ? activeSource : ref(activeSource);
299
+ const lastKey = ref(null);
300
+ watch(lastKeyEvent, (event) => {
301
+ if (!event || !isActive.value) return;
302
+ const modifiers = {
303
+ ctrl: event.ctrl,
304
+ alt: event.alt,
305
+ shift: event.shift
306
+ };
307
+ if (event.char) {
308
+ lastKey.value = event.char;
309
+ onChar?.(event.char);
310
+ onKey?.(event.char, modifiers);
311
+ return;
312
+ }
313
+ if (event.key) {
314
+ lastKey.value = event.key;
315
+ onKey?.(event.key, modifiers);
316
+ switch (event.key) {
317
+ case "enter":
318
+ onSubmit?.();
319
+ break;
320
+ case "escape":
321
+ onEscape?.();
322
+ break;
323
+ case "up":
324
+ case "down":
325
+ case "left":
326
+ case "right":
327
+ onArrow?.(event.key);
328
+ break;
329
+ }
330
+ }
331
+ });
332
+ const enable = () => {
333
+ isActive.value = true;
334
+ };
335
+ const disable = () => {
336
+ isActive.value = false;
337
+ };
338
+ return {
339
+ isActive,
340
+ lastKey,
341
+ enable,
342
+ disable
343
+ };
344
+ }
345
+
346
+ //#endregion
347
+ export { createApp, createRenderer$1 as createRenderer, lastKeyEvent, useInput as useInput$1 };
348
+ //# sourceMappingURL=useInput-CvEslk0z.js.map