@vizejs/fresco 0.58.0 → 0.59.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/components/index.d.mts +2 -0
- package/dist/components/index.mjs +2 -0
- package/dist/components-B5VXjX9s.mjs +2562 -0
- package/dist/components-B5VXjX9s.mjs.map +1 -0
- package/dist/composables/index.d.mts +2 -0
- package/dist/composables/index.mjs +3 -0
- package/dist/composables-ThPaZc16.mjs +194 -0
- package/dist/composables-ThPaZc16.mjs.map +1 -0
- package/dist/index-BeImxraZ.d.mts +142 -0
- package/dist/index-BeImxraZ.d.mts.map +1 -0
- package/dist/index-Cnc7zMgh.d.mts +2774 -0
- package/dist/index-Cnc7zMgh.d.mts.map +1 -0
- package/dist/index.d.mts +75 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +4 -0
- package/dist/useInput-CbggNZUF.mjs +351 -0
- package/dist/useInput-CbggNZUF.mjs.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Cnc7zMgh.d.mts","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"],"mappings":";;;;UAMiB,QAAA;EAAQ;EAEvB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A;E8BZA,UAAA;E9BgBA;E8BdA,YAAA;AAAA;AAAA,cAGW,MAAA,uBAAM,eAAA,sBAAA,gBAAA;;;;;;;;;;;;;;;;;;;;;gBAAA,oBAAA,CAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCnBF,UAAA;EACf,IAAA;EACA,WAAA;AAAA;AAAA,UAGe,YAAA;E/BDf;E+BGA,QAAA,EAAU,UAAA;E/BOV;E+BLA,SAAA;E/BSA;E+BPA,KAAA;E/BWA;E+BTA,KAAA;E/BaA;E+BXA,MAAA;E/BeA;E+BbA,SAAA;AAAA;AAAA,cAGW,OAAA,uBAAO,eAAA,sBAAA,gBAAA;;UAIC,QAAA,CAAS,UAAA;;;;UAIR,QAAA;;;;;;;;;;;;;;;;;;;qCARF,oBAAA,CAAA,YAAA;;;;UAIC,QAAA,CAAS,UAAA;;;;UAIR,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC5BL,WAAA;EhCAQ;EgCEvB,IAAA;EhCFuB;EgCIvB,QAAA;EhCAA;EgCEA,IAAA;EhCQA;EgCNA,EAAA;EhCUA;EgCRA,EAAA;EhCYA;EgCVA,MAAA;EhCcA;EgCZA,MAAA;AAAA;AAAA,cAiBW,MAAA,uBAAM,eAAA,CAsBW,oBAAA,CAtBX,gBAAA;;;;UAMG,QAAA;;;;;;;;;;;;;;;;UAgBA,QAAA,CAAS,WAAA;EAAA;AAAA,qCAtBZ,oBAAA,CAAA,YAAA;;+JAsBW,oBAAA,CAAA,gBAAA;;;;UAhBR,QAAA;;;;;;;;;;;;;;;;UAgBA,QAAA,CAAS,WAAA;EAAA;AAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { $ as FormProps, A as TableColumn, At as Box, B as TimerProps, C as Menu, Ct as GridProps, D as TreeNode, Dt as VStack, E as Tree, Et as StackProps, F as Tooltip, G as AlertProps, H as BadgeProps, I as TooltipPosition, J as ProgressBarProps, K as AlertType, L as TooltipProps, M as List, N as ListItem, O as TreeProps, Ot as Divider, P as ListProps, Q as FormField, R as Timer, S as TabsProps, St as Grid, T as MenuProps, Tt as Stack, U as BadgeVariant, V as Badge, W as Alert, X as SpinnerProps, Y as Spinner, Z as Form, _ as Breadcrumb, _t as CodeProps, a as KeyHintProps, at as Checkbox, b as Tab, bt as Card, c as StatusBar, ct as SelectOption, d as Modal, dt as TextAreaProps, et as Confirm, f as ModalProps, ft as TextInput, g as StepperProps, gt as Code, h as Stepper, ht as LinkProps, i as KeyHint, it as RadioOption, j as TableProps, jt as BoxProps, k as Table, kt as DividerProps, l as StatusBarItem, lt as SelectProps, m as StepStatus, mt as Link, n as AvatarProps, nt as RadioGroup, o as Header, ot as CheckboxProps, p as Step, pt as TextInputProps, q as ProgressBar, r as KeyBinding, rt as RadioGroupProps, s as HeaderProps, st as Select, t as Avatar, tt as ConfirmProps, u as StatusBarProps, ut as TextArea, v as BreadcrumbItem, vt as Text, w as MenuItem, wt as HStack, x as Tabs, xt as CardProps, y as BreadcrumbProps, yt as TextProps, z as TimerMode } from "./index-Cnc7zMgh.mjs";
|
|
2
|
+
import { a as useApp, c as useFocus, d as useInput, i as UseAppReturn, l as KeyHandler, n as UseImeOptions, o as FocusManager, r as useIme, s as UseFocusOptions, t as ImeManager, u as UseInputOptions } from "./index-BeImxraZ.mjs";
|
|
3
|
+
import * as _$_vue_runtime_core0 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;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/renderer.d.ts
|
|
54
|
+
/**
|
|
55
|
+
* Fresco node types
|
|
56
|
+
*/
|
|
57
|
+
interface FrescoNode extends RendererNode {
|
|
58
|
+
id: number;
|
|
59
|
+
type: "box" | "text" | "input" | "root";
|
|
60
|
+
props: Record<string, unknown>;
|
|
61
|
+
children: FrescoNode[];
|
|
62
|
+
parent: FrescoNode | null;
|
|
63
|
+
text?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Fresco element (extends node)
|
|
67
|
+
*/
|
|
68
|
+
interface FrescoElement extends FrescoNode, RendererElement {}
|
|
69
|
+
/**
|
|
70
|
+
* Create the Fresco renderer
|
|
71
|
+
*/
|
|
72
|
+
declare function createRenderer(): _$_vue_runtime_core0.Renderer<FrescoElement>;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { Alert, AlertProps, AlertType, type App, type AppOptions, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Box, BoxProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Card, CardProps, Checkbox, CheckboxProps, Code, CodeProps, Confirm, ConfirmProps, Divider, DividerProps, type FlexStyleNapi, FocusManager, Form, FormField, FormProps, Grid, GridProps, HStack, Header, HeaderProps, ImeManager, type ImeStateNapi, type InputEventNapi, KeyBinding, type KeyEvent, KeyHandler, KeyHint, KeyHintProps, Link, LinkProps, List, ListItem, ListProps, Menu, MenuItem, MenuProps, Modal, ModalProps, ProgressBar, ProgressBarProps, RadioGroup, RadioGroupProps, RadioOption, type RenderNodeNapi, Select, SelectOption, SelectProps, Spinner, SpinnerProps, Stack, StackProps, StatusBar, StatusBarItem, StatusBarProps, Step, StepStatus, Stepper, StepperProps, type StyleNapi, Tab, Table, TableColumn, TableProps, Tabs, TabsProps, type 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 };
|
|
75
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/app.ts","../src/renderer.ts"],"mappings":";;;;;;;UAQiB,QAAA;EACf,IAAA;EACA,GAAA;EACA,IAAA;EACA,IAAA;EACA,GAAA;EACA,KAAA;AAAA;AAAA,cAYW,YAAA,EAAc,GAAA,CAAI,QAAA;AAA/B;;;AAAA,UAgBiB,UAAA;EAhBsB;EAkBrC,KAAA;EAFyB;EAIzB,WAAA;EAEuB;EAAvB,OAAA,IAAW,KAAA,EAAO,KAAA;EAFlB;EAIA,KAAA;AAAA;;;;UAMe,GAAA;EAAA;EAEf,KAAA,IAAS,OAAA;;EAET,OAAA,IAAW,OAAA;EAAA;EAEX,aAAA,IAAiB,OAAA;EAIE;EAFnB,MAAA;EAE0B;EAA1B,eAAA,IAAmB,OAAA;IAAU,KAAA;IAAe,MAAA;EAAA;AAAA;;;;iBAM9B,SAAA,CAAU,aAAA,EAAe,SAAA,EAAW,OAAA,GAAS,UAAA,GAAkB,GAAA;;;;;;UC1D9D,UAAA,SAAmB,YAAA;EAClC,EAAA;EACA,IAAA;EACA,KAAA,EAAO,MAAA;EACP,QAAA,EAAU,UAAA;EACV,MAAA,EAAQ,UAAA;EACR,IAAA;AAAA;;;;UAMe,aAAA,SAAsB,UAAA,EAAY,eAAA;;;;iBAuGnC,cAAA,CAAA,GAAc,oBAAA,CAAA,QAAA,CAAA,aAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { i as createRenderer, n as createApp, r as lastKeyEvent, t as useInput } from "./useInput-CbggNZUF.mjs";
|
|
2
|
+
import { A as Grid, C as Select, D as Code, E as Link, F as Box, M as Stack, N as VStack, O as Text, P as Divider, S as Checkbox, T as TextInput, _ as ProgressBar, a as Modal, b as Confirm, c as Tabs, d as Table, f as List, g as Alert, h as Badge, i as StatusBar, j as HStack, k as Card, l as Menu, m as Timer, n as KeyHint, o as Stepper, p as Tooltip, r as Header, s as Breadcrumb, t as Avatar, u as Tree, v as Spinner, w as TextArea, x as RadioGroup, y as Form } from "./components-B5VXjX9s.mjs";
|
|
3
|
+
import { n as useApp, r as useFocus, t as useIme } from "./composables-ThPaZc16.mjs";
|
|
4
|
+
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,351 @@
|
|
|
1
|
+
import { createRenderer, isRef, ref, watch } from "@vue/runtime-core";
|
|
2
|
+
//#region src/renderer.ts
|
|
3
|
+
/**
|
|
4
|
+
* Fresco Vue Custom Renderer
|
|
5
|
+
*/
|
|
6
|
+
let nextId = 0;
|
|
7
|
+
function createNode(type) {
|
|
8
|
+
return {
|
|
9
|
+
id: nextId++,
|
|
10
|
+
type,
|
|
11
|
+
props: {},
|
|
12
|
+
children: [],
|
|
13
|
+
parent: null
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renderer options for Fresco
|
|
18
|
+
*/
|
|
19
|
+
const rendererOptions = {
|
|
20
|
+
patchProp(el, key, prevValue, nextValue) {
|
|
21
|
+
el.props[key] = nextValue;
|
|
22
|
+
},
|
|
23
|
+
insert(child, parent, anchor) {
|
|
24
|
+
child.parent = parent;
|
|
25
|
+
if (anchor) {
|
|
26
|
+
const index = parent.children.indexOf(anchor);
|
|
27
|
+
if (index !== -1) {
|
|
28
|
+
parent.children.splice(index, 0, child);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
parent.children.push(child);
|
|
33
|
+
},
|
|
34
|
+
remove(child) {
|
|
35
|
+
if (child.parent) {
|
|
36
|
+
const index = child.parent.children.indexOf(child);
|
|
37
|
+
if (index !== -1) child.parent.children.splice(index, 1);
|
|
38
|
+
child.parent = null;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
createElement(type) {
|
|
42
|
+
return createNode(mapElementType(type));
|
|
43
|
+
},
|
|
44
|
+
createText(text) {
|
|
45
|
+
const node = createNode("text");
|
|
46
|
+
node.text = text;
|
|
47
|
+
return node;
|
|
48
|
+
},
|
|
49
|
+
createComment() {
|
|
50
|
+
return createNode("text");
|
|
51
|
+
},
|
|
52
|
+
setText(node, text) {
|
|
53
|
+
node.text = text;
|
|
54
|
+
},
|
|
55
|
+
setElementText(el, text) {
|
|
56
|
+
el.text = text;
|
|
57
|
+
el.children = [];
|
|
58
|
+
},
|
|
59
|
+
parentNode(node) {
|
|
60
|
+
return node.parent;
|
|
61
|
+
},
|
|
62
|
+
nextSibling(node) {
|
|
63
|
+
if (!node.parent) return null;
|
|
64
|
+
const index = node.parent.children.indexOf(node);
|
|
65
|
+
return node.parent.children[index + 1] || null;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Map Vue element types to Fresco node types
|
|
70
|
+
*/
|
|
71
|
+
function mapElementType(type) {
|
|
72
|
+
switch (type.toLowerCase()) {
|
|
73
|
+
case "box":
|
|
74
|
+
case "div":
|
|
75
|
+
case "view": return "box";
|
|
76
|
+
case "text":
|
|
77
|
+
case "span": return "text";
|
|
78
|
+
case "input":
|
|
79
|
+
case "textinput": return "input";
|
|
80
|
+
default: return "box";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Create the Fresco renderer
|
|
85
|
+
*/
|
|
86
|
+
function createRenderer$1() {
|
|
87
|
+
return createRenderer(rendererOptions);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Convert Fresco tree to render nodes for native
|
|
91
|
+
*/
|
|
92
|
+
function treeToRenderNodes(root) {
|
|
93
|
+
const nodes = [];
|
|
94
|
+
function visit(node) {
|
|
95
|
+
const renderNode = {
|
|
96
|
+
id: node.id,
|
|
97
|
+
nodeType: node.type
|
|
98
|
+
};
|
|
99
|
+
if (node.text) renderNode.text = node.text;
|
|
100
|
+
if (node.props.wrap !== void 0) renderNode.wrap = Boolean(node.props.wrap);
|
|
101
|
+
if (node.props.value !== void 0) {
|
|
102
|
+
const v = node.props.value;
|
|
103
|
+
renderNode.value = typeof v === "string" || typeof v === "number" ? String(v) : "";
|
|
104
|
+
}
|
|
105
|
+
if (node.props.placeholder !== void 0) {
|
|
106
|
+
const p = node.props.placeholder;
|
|
107
|
+
renderNode.placeholder = typeof p === "string" || typeof p === "number" ? String(p) : "";
|
|
108
|
+
}
|
|
109
|
+
if (node.props.focused !== void 0) renderNode.focused = Boolean(node.props.focused);
|
|
110
|
+
if (node.props.cursor !== void 0) renderNode.cursor = Number(node.props.cursor);
|
|
111
|
+
if (node.props.mask !== void 0) renderNode.mask = Boolean(node.props.mask);
|
|
112
|
+
if (node.props.border !== void 0) {
|
|
113
|
+
const b = node.props.border;
|
|
114
|
+
renderNode.border = typeof b === "string" ? b : "";
|
|
115
|
+
}
|
|
116
|
+
if (node.props.style) {
|
|
117
|
+
const s = node.props.style;
|
|
118
|
+
const style = {};
|
|
119
|
+
if (s.display !== void 0) style.display = s.display;
|
|
120
|
+
if (s.flexDirection !== void 0) style.flexDirection = s.flexDirection;
|
|
121
|
+
if (s.flexWrap !== void 0) style.flexWrap = s.flexWrap;
|
|
122
|
+
if (s.justifyContent !== void 0) style.justifyContent = s.justifyContent;
|
|
123
|
+
if (s.alignItems !== void 0) style.alignItems = s.alignItems;
|
|
124
|
+
if (s.alignSelf !== void 0) style.alignSelf = s.alignSelf;
|
|
125
|
+
if (s.alignContent !== void 0) style.alignContent = s.alignContent;
|
|
126
|
+
if (s.flexGrow !== void 0) style.flexGrow = s.flexGrow;
|
|
127
|
+
if (s.flexShrink !== void 0) style.flexShrink = s.flexShrink;
|
|
128
|
+
if (s.width !== void 0 && (typeof s.width === "string" || typeof s.width === "number")) style.width = String(s.width);
|
|
129
|
+
if (s.height !== void 0 && (typeof s.height === "string" || typeof s.height === "number")) style.height = String(s.height);
|
|
130
|
+
if (s.minWidth !== void 0 && (typeof s.minWidth === "string" || typeof s.minWidth === "number")) style.minWidth = String(s.minWidth);
|
|
131
|
+
if (s.minHeight !== void 0 && (typeof s.minHeight === "string" || typeof s.minHeight === "number")) style.minHeight = String(s.minHeight);
|
|
132
|
+
if (s.maxWidth !== void 0 && (typeof s.maxWidth === "string" || typeof s.maxWidth === "number")) style.maxWidth = String(s.maxWidth);
|
|
133
|
+
if (s.maxHeight !== void 0 && (typeof s.maxHeight === "string" || typeof s.maxHeight === "number")) style.maxHeight = String(s.maxHeight);
|
|
134
|
+
if (s.padding !== void 0) style.padding = s.padding;
|
|
135
|
+
if (s.paddingTop !== void 0) style.paddingTop = s.paddingTop;
|
|
136
|
+
if (s.paddingRight !== void 0) style.paddingRight = s.paddingRight;
|
|
137
|
+
if (s.paddingBottom !== void 0) style.paddingBottom = s.paddingBottom;
|
|
138
|
+
if (s.paddingLeft !== void 0) style.paddingLeft = s.paddingLeft;
|
|
139
|
+
if (s.margin !== void 0) style.margin = s.margin;
|
|
140
|
+
if (s.marginTop !== void 0) style.marginTop = s.marginTop;
|
|
141
|
+
if (s.marginRight !== void 0) style.marginRight = s.marginRight;
|
|
142
|
+
if (s.marginBottom !== void 0) style.marginBottom = s.marginBottom;
|
|
143
|
+
if (s.marginLeft !== void 0) style.marginLeft = s.marginLeft;
|
|
144
|
+
if (s.gap !== void 0) style.gap = s.gap;
|
|
145
|
+
renderNode.style = style;
|
|
146
|
+
}
|
|
147
|
+
const appearance = {};
|
|
148
|
+
if (node.props.fg) appearance.fg = node.props.fg;
|
|
149
|
+
if (node.props.bg) appearance.bg = node.props.bg;
|
|
150
|
+
if (node.props.bold) appearance.bold = node.props.bold;
|
|
151
|
+
if (node.props.dim) appearance.dim = node.props.dim;
|
|
152
|
+
if (node.props.italic) appearance.italic = node.props.italic;
|
|
153
|
+
if (node.props.underline) appearance.underline = node.props.underline;
|
|
154
|
+
if (Object.keys(appearance).length > 0) renderNode.appearance = appearance;
|
|
155
|
+
if (node.children.length > 0) renderNode.children = node.children.map((c) => c.id);
|
|
156
|
+
nodes.push(renderNode);
|
|
157
|
+
for (const child of node.children) visit(child);
|
|
158
|
+
}
|
|
159
|
+
visit(root);
|
|
160
|
+
return nodes;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/app.ts
|
|
164
|
+
/**
|
|
165
|
+
* Fresco App - Application instance management
|
|
166
|
+
*/
|
|
167
|
+
const lastKeyEvent = ref(null);
|
|
168
|
+
let native = null;
|
|
169
|
+
async function loadNative() {
|
|
170
|
+
if (!native) native = await import("@vizejs/fresco-native");
|
|
171
|
+
return native;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Create a Fresco TUI app
|
|
175
|
+
*/
|
|
176
|
+
function createApp(rootComponent, options = {}) {
|
|
177
|
+
const { mouse = false, exitOnCtrlC = true, onError } = options;
|
|
178
|
+
let vueApp = null;
|
|
179
|
+
let rootElement = null;
|
|
180
|
+
let mounted = false;
|
|
181
|
+
let running = false;
|
|
182
|
+
let exitResolve = null;
|
|
183
|
+
let needsRender = true;
|
|
184
|
+
const { createApp: createVueApp } = createRenderer$1();
|
|
185
|
+
async function mount() {
|
|
186
|
+
if (mounted) return;
|
|
187
|
+
const n = await loadNative();
|
|
188
|
+
if (mouse) n.initTerminalWithMouse();
|
|
189
|
+
else n.initTerminal();
|
|
190
|
+
n.initLayout();
|
|
191
|
+
const app = createVueApp(rootComponent);
|
|
192
|
+
rootElement = {
|
|
193
|
+
id: -1,
|
|
194
|
+
type: "root",
|
|
195
|
+
props: { style: {
|
|
196
|
+
width: "100%",
|
|
197
|
+
height: "100%",
|
|
198
|
+
flexDirection: "column",
|
|
199
|
+
justifyContent: "flex-start",
|
|
200
|
+
alignItems: "flex-start",
|
|
201
|
+
alignContent: "flex-start"
|
|
202
|
+
} },
|
|
203
|
+
children: [],
|
|
204
|
+
parent: null
|
|
205
|
+
};
|
|
206
|
+
app.mount(rootElement);
|
|
207
|
+
vueApp = app;
|
|
208
|
+
mounted = true;
|
|
209
|
+
running = true;
|
|
210
|
+
needsRender = true;
|
|
211
|
+
eventLoop();
|
|
212
|
+
}
|
|
213
|
+
async function unmount() {
|
|
214
|
+
if (!mounted) return;
|
|
215
|
+
running = false;
|
|
216
|
+
(await loadNative()).restoreTerminal();
|
|
217
|
+
if (vueApp) {
|
|
218
|
+
vueApp.unmount();
|
|
219
|
+
vueApp = null;
|
|
220
|
+
}
|
|
221
|
+
rootElement = null;
|
|
222
|
+
mounted = false;
|
|
223
|
+
if (exitResolve) exitResolve();
|
|
224
|
+
}
|
|
225
|
+
async function waitUntilExit() {
|
|
226
|
+
return new Promise((resolve) => {
|
|
227
|
+
exitResolve = resolve;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function render() {
|
|
231
|
+
if (!native || !mounted || !rootElement) return;
|
|
232
|
+
try {
|
|
233
|
+
const renderNodes = treeToRenderNodes(rootElement);
|
|
234
|
+
if (renderNodes.length > 0) {
|
|
235
|
+
native.renderTree(renderNodes);
|
|
236
|
+
native.flushTerminal();
|
|
237
|
+
}
|
|
238
|
+
} catch (error) {
|
|
239
|
+
if (onError) onError(error);
|
|
240
|
+
else console.error("Render error:", error);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
async function getTerminalInfo() {
|
|
244
|
+
const info = (await loadNative()).getTerminalInfo();
|
|
245
|
+
return {
|
|
246
|
+
width: info.width,
|
|
247
|
+
height: info.height
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
async function eventLoop() {
|
|
251
|
+
const n = await loadNative();
|
|
252
|
+
while (running) {
|
|
253
|
+
try {
|
|
254
|
+
const event = n.pollEvent(16);
|
|
255
|
+
if (event) {
|
|
256
|
+
if (event.eventType === "resize") {
|
|
257
|
+
n.syncTerminalSize();
|
|
258
|
+
n.clearScreen();
|
|
259
|
+
needsRender = true;
|
|
260
|
+
}
|
|
261
|
+
if (exitOnCtrlC && event.eventType === "key" && event.char === "c" && event.modifiers?.ctrl) {
|
|
262
|
+
await unmount();
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
if (event.eventType === "key") lastKeyEvent.value = {
|
|
266
|
+
type: "key",
|
|
267
|
+
key: event.key ?? void 0,
|
|
268
|
+
char: event.char ?? void 0,
|
|
269
|
+
ctrl: event.modifiers?.ctrl ?? false,
|
|
270
|
+
alt: event.modifiers?.alt ?? false,
|
|
271
|
+
shift: event.modifiers?.shift ?? false
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
if (needsRender) {
|
|
275
|
+
render();
|
|
276
|
+
needsRender = false;
|
|
277
|
+
}
|
|
278
|
+
needsRender = true;
|
|
279
|
+
} catch (error) {
|
|
280
|
+
if (onError) onError(error);
|
|
281
|
+
}
|
|
282
|
+
await new Promise((resolve) => setTimeout(resolve, 16));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
mount,
|
|
287
|
+
unmount,
|
|
288
|
+
waitUntilExit,
|
|
289
|
+
render,
|
|
290
|
+
getTerminalInfo
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/composables/useInput.ts
|
|
295
|
+
/**
|
|
296
|
+
* useInput - Input handling composable
|
|
297
|
+
*/
|
|
298
|
+
function useInput(options = {}) {
|
|
299
|
+
const { active = true, isActive: isActiveOption, onKey, onChar, onSubmit, onEscape, onArrow } = options;
|
|
300
|
+
const activeSource = isActiveOption ?? active;
|
|
301
|
+
const isActive = isRef(activeSource) ? activeSource : ref(activeSource);
|
|
302
|
+
const lastKey = ref(null);
|
|
303
|
+
watch(lastKeyEvent, (event) => {
|
|
304
|
+
if (!event || !isActive.value) return;
|
|
305
|
+
const modifiers = {
|
|
306
|
+
ctrl: event.ctrl,
|
|
307
|
+
alt: event.alt,
|
|
308
|
+
shift: event.shift
|
|
309
|
+
};
|
|
310
|
+
if (event.char) {
|
|
311
|
+
lastKey.value = event.char;
|
|
312
|
+
onChar?.(event.char);
|
|
313
|
+
onKey?.(event.char, modifiers);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if (event.key) {
|
|
317
|
+
lastKey.value = event.key;
|
|
318
|
+
onKey?.(event.key, modifiers);
|
|
319
|
+
switch (event.key) {
|
|
320
|
+
case "enter":
|
|
321
|
+
onSubmit?.();
|
|
322
|
+
break;
|
|
323
|
+
case "escape":
|
|
324
|
+
onEscape?.();
|
|
325
|
+
break;
|
|
326
|
+
case "up":
|
|
327
|
+
case "down":
|
|
328
|
+
case "left":
|
|
329
|
+
case "right":
|
|
330
|
+
onArrow?.(event.key);
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
const enable = () => {
|
|
336
|
+
isActive.value = true;
|
|
337
|
+
};
|
|
338
|
+
const disable = () => {
|
|
339
|
+
isActive.value = false;
|
|
340
|
+
};
|
|
341
|
+
return {
|
|
342
|
+
isActive,
|
|
343
|
+
lastKey,
|
|
344
|
+
enable,
|
|
345
|
+
disable
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
export { createRenderer$1 as i, createApp as n, lastKeyEvent as r, useInput as t };
|
|
350
|
+
|
|
351
|
+
//# sourceMappingURL=useInput-CbggNZUF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInput-CbggNZUF.mjs","names":["createRenderer","createVueRenderer","createRenderer"],"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,WAAW,MAAsC;AACxD,QAAO;EACL,IAAI;EACJ;EACA,OAAO,EAAE;EACT,UAAU,EAAE;EACZ,QAAQ;EACT;;;;;AAMH,MAAM,kBAA8D;CAClE,UAAU,IAAI,KAAK,WAAW,WAAW;AACvC,KAAG,MAAM,OAAO;;CAGlB,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;;;AAGJ,SAAO,SAAS,KAAK,MAAM;;CAG7B,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;;;CAInB,cAAc,MAAM;AAElB,SAAO,WADU,eA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mBAAc;;AAIhB,kBAAc;YACP,OAAO;AACd,QAAI,QACF,SAAQ,MAAe;;AAK3B,SAAM,IAAI,SAAS,YAAY,WAAW,SAAS,GAAG,CAAC;;;AAI3D,QAAO;EACL;EACA;EACA;EACA;EACA;EACD;;;;;;;AClOH,SAAgB,SAAS,UAA2B,EAAE,EAAE;CACtD,MAAM,EACJ,SAAS,MACT,UAAU,gBACV,OACA,QACA,UACA,UACA,YACE;CAGJ,MAAM,eAAe,kBAAkB;CACvC,MAAM,WAAW,MAAM,aAAa,GAAG,eAAe,IAAI,aAAa;CACvE,MAAM,UAAU,IAAmB,KAAK;AAGxC,OAAM,eAAe,UAAU;AAC7B,MAAI,CAAC,SAAS,CAAC,SAAS,MAAO;EAE/B,MAAM,YAAY;GAChB,MAAM,MAAM;GACZ,KAAK,MAAM;GACX,OAAO,MAAM;GACd;AAGD,MAAI,MAAM,MAAM;AACd,WAAQ,QAAQ,MAAM;AACtB,YAAS,MAAM,KAAK;AACpB,WAAQ,MAAM,MAAM,UAAU;AAC9B;;AAIF,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;;;GAGN;CAEF,MAAM,eAAe;AACnB,WAAS,QAAQ;;CAGnB,MAAM,gBAAgB;AACpB,WAAS,QAAQ;;AAGnB,QAAO;EACL;EACA;EACA;EACA;EACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/fresco",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"description": "Vue TUI framework - Build terminal UIs with Vue.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@vizejs/fresco-native": "0.
|
|
44
|
+
"@vizejs/fresco-native": "0.59.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "25.6.0",
|