@vizejs/fresco 0.322.0 → 0.323.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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as FormProps, A as TableColumn, At as HStack, B as TimerProps, C as Menu, Ct as NewlineProps, D as TreeNode, Dt as CardProps, E as Tree, Et as Card, F as Tooltip, Ft as DividerProps, G as AlertProps, H as BadgeProps, I as TooltipPosition, It as Spacer, J as ProgressBarProps, K as AlertType, L as TooltipProps, Lt as Box, M as List, Mt as StackProps, N as ListItem, Nt as VStack, O as TreeProps, Ot as Grid, P as ListProps, Pt as Divider, Q as FormField, R as Timer, Rt as BoxProps, S as TabsProps, St as Newline, T as MenuProps, Tt as TextProps, 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 Static, 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 Stack, k as Table, kt as GridProps, 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 Transform, w as MenuItem, wt as Text, x as Tabs, xt as StaticProps, y as BreadcrumbProps, yt as TransformProps, z as TimerMode, zt as createRenderer } from "./index-CnFCOPIv.mjs";
2
- import { A as usePaste, C as UseAppReturn, D as useFocus, E as UseFocusOptions, F as UseInputReturn, I as useInput, L as useKeyPress, M as Key, N as KeyHandler, O as useFocusManager, P as UseInputOptions, S as useIme, T as FocusManager, _ as useStderr, a as DOMElement, b as ImeManager, c as UseAnimationOptions, d as useCursor, f as WindowSize, g as UseStdoutReturn, h as UseStdinReturn, i as useBoxMetrics, j as InputHandler, k as UsePasteOptions, l as useAnimation, m as UseStderrReturn, n as BoxMetrics, o as measureElement, p as useWindowSize, r as UseBoxMetricsResult, s as AnimationResult, t as useIsScreenReaderEnabled, u as CursorPosition, v as useStdin, w as useApp, x as UseImeOptions, y as useStdout } from "./index-43FxHkwF.mjs";
1
+ import { $ as FormProps, $t as FrescoInputEvent, A as TableColumn, At as HStack, B as TimerProps, Bt as CompositionEvent, C as Menu, Ct as NewlineProps, D as TreeNode, Dt as CardProps, E as Tree, Et as Card, F as Tooltip, Ft as DividerProps, G as AlertProps, Gt as FrescoAppearance, H as BadgeProps, Ht as FrescoAlignContent, I as TooltipPosition, It as Spacer, J as ProgressBarProps, Jt as FrescoCanonicalStyle, K as AlertType, Kt as FrescoBorderStyle, L as TooltipProps, Lt as Box, M as List, Mt as StackProps, N as ListItem, Nt as VStack, O as TreeProps, Ot as Grid, P as ListProps, Pt as Divider, Q as FormField, Qt as FrescoFlexWrap, R as Timer, Rt as BoxProps, S as TabsProps, St as Newline, T as MenuProps, Tt as TextProps, U as BadgeVariant, Ut as FrescoAlignItems, V as Badge, Vt as FocusEvent, W as Alert, Wt as FrescoAlignSelf, X as SpinnerProps, Xt as FrescoDisplay, Y as Spinner, Yt as FrescoDimension, Z as Form, Zt as FrescoFlexDirection, _ as Breadcrumb, _n as PasteEvent, _t as CodeProps, a as KeyHintProps, an as FrescoRenderNode, at as Checkbox, b as Tab, bt as Static, c as StatusBar, cn as FrescoRootRenderNode, ct as SelectOption, d as Modal, dn as FrescoTextRenderNode, dt as TextAreaProps, en as FrescoInputRenderNode, et as Confirm, f as ModalProps, fn as FrescoTextWrapMode, ft as TextInput, g as StepperProps, gn as MouseEvent, gt as Code, h as Stepper, hn as KeyEventType, ht as LinkProps, i as KeyHint, in as FrescoPosition, it as RadioOption, j as TableProps, jt as Stack, k as Table, kt as GridProps, l as StatusBarItem, ln as FrescoSnakeStyleAliases, lt as SelectProps, m as StepStatus, mn as KeyEvent, mt as Link, n as AvatarProps, nn as FrescoModifiers, nt as RadioGroup, o as Header, on as FrescoRenderNodeKind, ot as CheckboxProps, p as Step, pn as InputEvent, pt as TextInputProps, q as ProgressBar, qt as FrescoBoxRenderNode, r as KeyBinding, rn as FrescoOverflow, rt as RadioGroupProps, s as HeaderProps, sn as FrescoRenderStyle, st as Select, t as Avatar, tn as FrescoJustifyContent, tt as ConfirmProps, u as StatusBarProps, un as FrescoStyle, ut as TextArea, v as BreadcrumbItem, vn as ResizeEvent, vt as Transform, w as MenuItem, wt as Text, x as Tabs, xt as StaticProps, y as BreadcrumbProps, yt as TransformProps, z as TimerMode, zt as createRenderer } from "./index-7Qk0ZhUI.mjs";
2
+ import { A as usePaste, C as UseAppReturn, D as useFocus, E as UseFocusOptions, F as UseInputReturn, I as useInput, L as useKeyPress, M as Key, N as KeyHandler, O as useFocusManager, P as UseInputOptions, S as useIme, T as FocusManager, _ as useStderr, a as DOMElement, b as ImeManager, c as UseAnimationOptions, d as useCursor, f as WindowSize, g as UseStdoutReturn, h as UseStdinReturn, i as useBoxMetrics, j as InputHandler, k as UsePasteOptions, l as useAnimation, m as UseStderrReturn, n as BoxMetrics, o as measureElement, p as useWindowSize, r as UseBoxMetricsResult, s as AnimationResult, t as useIsScreenReaderEnabled, u as CursorPosition, v as useStdin, w as useApp, x as UseImeOptions, y as useStdout } from "./index-Dwx6lKP0.mjs";
3
3
  import { Component, Ref, VNode } from "@vue/runtime-core";
4
4
  import { FlexStyleNapi, ImeStateNapi, InputEventNapi, LayoutResultNapi, ModifiersNapi, RenderNodeNapi, StyleNapi, TerminalInfoNapi, TerminalOptionsNapi } from "@vizejs/fresco-native";
5
5
 
@@ -32,45 +32,6 @@ declare const kittyModifiers: {
32
32
  };
33
33
  //#endregion
34
34
  //#region src/app.d.ts
35
- type KeyEventType = "press" | "repeat" | "release";
36
- interface KeyEvent {
37
- type: "key";
38
- key?: string;
39
- char?: string;
40
- ctrl: boolean;
41
- alt: boolean;
42
- shift: boolean;
43
- meta: boolean;
44
- super: boolean;
45
- hyper: boolean;
46
- capsLock: boolean;
47
- numLock: boolean;
48
- eventType?: KeyEventType;
49
- }
50
- interface PasteEvent {
51
- type: "paste";
52
- text: string;
53
- }
54
- interface ResizeEvent {
55
- type: "resize";
56
- width: number;
57
- height: number;
58
- }
59
- interface MouseEvent {
60
- type: "mouse";
61
- button?: string;
62
- x: number;
63
- y: number;
64
- }
65
- interface FocusEvent {
66
- type: "focus";
67
- focused: boolean;
68
- }
69
- interface CompositionEvent {
70
- type: "compositionstart" | "compositionupdate" | "compositionend";
71
- text: string;
72
- cursor: number;
73
- }
74
35
  declare const lastKeyEvent: Ref<KeyEvent | null>;
75
36
  declare const lastPasteEvent: Ref<PasteEvent | null>;
76
37
  declare const lastResizeEvent: Ref<ResizeEvent | null>;
@@ -174,5 +135,5 @@ declare function render(root: AppRoot, options?: AppOptions | WritableStreamLike
174
135
  */
175
136
  declare function renderToString(root: AppRoot, options?: RenderToStringOptions): string;
176
137
  //#endregion
177
- export { Alert, AlertProps, AlertType, AnimationResult, type App, type AppOptions, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Box, BoxMetrics, BoxProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Card, CardProps, Checkbox, CheckboxProps, Code, CodeProps, type CompositionEvent, Confirm, ConfirmProps, CursorPosition, type DOMElement, Divider, DividerProps, type FlexStyleNapi, type FocusEvent, FocusManager, Form, FormField, FormProps, Grid, GridProps, HStack, Header, HeaderProps, ImeManager, type ImeStateNapi, type InputEventNapi, InputHandler, type Instance, Key, KeyBinding, type KeyEvent, KeyHandler, KeyHint, KeyHintProps, type KittyFlagName, type KittyKeyboardOptions, type LayoutResultNapi, Link, LinkProps, List, ListItem, ListProps, Menu, MenuItem, MenuProps, Modal, ModalProps, type ModifiersNapi, type MouseEvent, Newline, NewlineProps, type PasteEvent, ProgressBar, ProgressBarProps, RadioGroup, RadioGroupProps, RadioOption, type RenderInstance, type RenderMetrics, type RenderNodeNapi, type RenderOptions, type RenderToStringOptions, type ResizeEvent, Select, SelectOption, SelectProps, Spacer, Spinner, SpinnerProps, Stack, StackProps, Static, StaticProps, StatusBar, StatusBarItem, StatusBarProps, Step, StepStatus, Stepper, StepperProps, type StyleNapi, Tab, Table, TableColumn, TableProps, Tabs, TabsProps, type TerminalInfoNapi, type TerminalOptionsNapi, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Timer, TimerMode, TimerProps, Tooltip, TooltipPosition, TooltipProps, Transform, TransformProps, Tree, TreeNode, TreeProps, UseAnimationOptions, UseAppReturn, UseBoxMetricsResult, UseFocusOptions, UseImeOptions, UseInputOptions, UseInputReturn, UsePasteOptions, UseStderrReturn, UseStdinReturn, UseStdoutReturn, VStack, WindowSize, createApp, createRenderer, kittyFlags, kittyModifiers, lastCompositionEvent, lastFocusEvent, lastKeyEvent, lastMouseEvent, lastPasteEvent, lastResizeEvent, measureElement, render, renderToString, resolveKittyFlags, useAnimation, useApp, useBoxMetrics, useCursor, useFocus, useFocusManager, useIme, useInput, useIsScreenReaderEnabled, useKeyPress, usePaste, useStderr, useStdin, useStdout, useWindowSize };
138
+ export { Alert, AlertProps, AlertType, AnimationResult, type App, type AppOptions, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Box, BoxMetrics, BoxProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Card, CardProps, Checkbox, CheckboxProps, Code, CodeProps, type CompositionEvent, Confirm, ConfirmProps, CursorPosition, type DOMElement, Divider, DividerProps, type FlexStyleNapi, type FocusEvent, FocusManager, Form, FormField, FormProps, type FrescoAlignContent, type FrescoAlignItems, type FrescoAlignSelf, type FrescoAppearance, type FrescoBorderStyle, type FrescoBoxRenderNode, type FrescoCanonicalStyle, type FrescoDimension, type FrescoDisplay, type FrescoFlexDirection, type FrescoFlexWrap, type FrescoInputEvent, type FrescoInputRenderNode, type FrescoJustifyContent, type FrescoModifiers, type FrescoOverflow, type FrescoPosition, type FrescoRenderNode, type FrescoRenderNodeKind, type FrescoRenderStyle, type FrescoRootRenderNode, type FrescoSnakeStyleAliases, type FrescoStyle, type FrescoTextRenderNode, type FrescoTextWrapMode, Grid, GridProps, HStack, Header, HeaderProps, ImeManager, type ImeStateNapi, type InputEvent, type InputEventNapi, InputHandler, type Instance, Key, KeyBinding, type KeyEvent, type KeyEventType, KeyHandler, KeyHint, KeyHintProps, type KittyFlagName, type KittyKeyboardOptions, type LayoutResultNapi, Link, LinkProps, List, ListItem, ListProps, Menu, MenuItem, MenuProps, Modal, ModalProps, type ModifiersNapi, type MouseEvent, Newline, NewlineProps, type PasteEvent, ProgressBar, ProgressBarProps, RadioGroup, RadioGroupProps, RadioOption, type RenderInstance, type RenderMetrics, type RenderNodeNapi, type RenderOptions, type RenderToStringOptions, type ResizeEvent, Select, SelectOption, SelectProps, Spacer, Spinner, SpinnerProps, Stack, StackProps, Static, StaticProps, StatusBar, StatusBarItem, StatusBarProps, Step, StepStatus, Stepper, StepperProps, type StyleNapi, Tab, Table, TableColumn, TableProps, Tabs, TabsProps, type TerminalInfoNapi, type TerminalOptionsNapi, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Timer, TimerMode, TimerProps, Tooltip, TooltipPosition, TooltipProps, Transform, TransformProps, Tree, TreeNode, TreeProps, UseAnimationOptions, UseAppReturn, UseBoxMetricsResult, UseFocusOptions, UseImeOptions, UseInputOptions, UseInputReturn, UsePasteOptions, UseStderrReturn, UseStdinReturn, UseStdoutReturn, VStack, WindowSize, createApp, createRenderer, kittyFlags, kittyModifiers, lastCompositionEvent, lastFocusEvent, lastKeyEvent, lastMouseEvent, lastPasteEvent, lastResizeEvent, measureElement, render, renderToString, resolveKittyFlags, useAnimation, useApp, useBoxMetrics, useCursor, useFocus, useFocusManager, useIme, useInput, useIsScreenReaderEnabled, useKeyPress, usePaste, useStderr, useStdin, useStdout, useWindowSize };
178
139
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/kittyKeyboard.ts","../src/app.ts"],"mappings":";;;;;;;;;cAIa,UAAA;EAAA;;;;;;KAQD,aAAA,gBAA6B,UAAA;AAAA,UAExB,oBAAA;EACf,IAAA;EACA,KAAA,GAAQ,aAAA;AAAA;AAAA,iBAGM,iBAAA,CAAkB,KAAA,EAAO,aAAA;AAAA,cAI5B,cAAA;EAAA;;;;;;;;;;;KCeD,YAAA;AAAA,UAGK,QAAA;EACf,IAAA;EACA,GAAA;EACA,IAAA;EACA,IAAA;EACA,GAAA;EACA,KAAA;EACA,IAAA;EACA,KAAA;EACA,KAAA;EACA,QAAA;EACA,OAAA;EACA,SAAA,GAAY,YAAA;AAAA;AAAA,UAGG,UAAA;EACf,IAAA;EACA,IAAA;AAAA;AAAA,UAGe,WAAA;EACf,IAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,UAGe,UAAA;EACf,IAAA;EACA,MAAA;EACA,CAAA;EACA,CAAA;AAAA;AAAA,UAGe,UAAA;EACf,IAAA;EACA,OAAA;AAAA;AAAA,UAGe,gBAAA;EACf,IAAA;EACA,IAAA;EACA,MAAA;AAAA;AAAA,cAYW,YAAA,EAAc,GAAA,CAAI,QAAA;AAAA,cAClB,cAAA,EAAgB,GAAA,CAAI,UAAA;AAAA,cACpB,eAAA,EAAiB,GAAA,CAAI,WAAA;AAAA,cACrB,cAAA,EAAgB,GAAA,CAAI,UAAA;AAAA,cACpB,cAAA,EAAgB,GAAA,CAAI,UAAA;AAAA,cACpB,oBAAA,EAAsB,GAAA,CAAI,gBAAA;;;AA7DvC;UAgFiB,UAAA;;EAEf,KAAA;EAlFsB;EAoFtB,WAAA;EAjFuB;EAmFvB,OAAA,IAAW,KAAA,EAAO,KAAA;EAvEM;EAyExB,KAAA;EAnFA;EAqFA,MAAA,GAAS,MAAA,CAAO,WAAA;EAnFhB;EAqFA,KAAA,GA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aAAA,aAA0B,OAAA;EA5ES;EA8E3C,aAAA,IAAiB,OAAA;EA7E4C;EA+E7D,oBAAA,IAAwB,OAAA;EA/EG;EAiF3B,MAAA;EAhFW;EAkFX,KAAA;;EAEA,eAAA,IAAmB,OAAA;IAAU,KAAA;IAAe,MAAA;EAAA;AAAA;AAAA,UAG7B,cAAA;EACf,QAAA,CAAS,IAAA,EAAM,OAAA;EACf,OAAA,CAAQ,aAAA,aAA0B,OAAA;EAClC,aAAA,IAAiB,OAAA;EACjB,oBAAA,IAAwB,OAAA;EACxB,OAAA,IAAW,OAAA;EACX,KAAA;AAAA;AAAA,KAGU,QAAA,GAAW,cAAA;AAAA,UAEN,qBAAA;EA9CC;EAgDhB,OAAA;AAAA;AAAA,UAGe,kBAAA;EACf,KAAA,IAAS,IAAA;AAAA;;;;iBA2PK,SAAA,CAAU,aAAA,EAAe,OAAA,EAAS,OAAA,GAAS,UAAA,GAAkB,GAAA;;;;iBA8c7D,MAAA,CACd,IAAA,EAAM,OAAA,EACN,OAAA,GAAS,UAAA,GAAa,kBAAA,GACrB,cAAA;;;;iBAgCa,cAAA,CAAe,IAAA,EAAM,OAAA,EAAS,OAAA,GAAS,qBAAA"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { C as useFocusManager, S as useFocus, a as createApp, b as useStdin, c as lastKeyEvent, d as lastResizeEvent, f as render, g as measureElement, i as useIsScreenReaderEnabled, l as lastMouseEvent, m as createRenderer, n as useKeyPress, o as lastCompositionEvent, p as renderToString, r as usePaste, s as lastFocusEvent, t as useInput, u as lastPasteEvent, v as useCursor, w as useApp, x as useStdout, y as useStderr } from "./useInput-BopE5ia7.mjs";
2
- import { A as Newline, C as Select, D as Code, E as Link, F as Stack, I as VStack, L as Divider, M as Card, N as Grid, O as Transform, P as HStack, R as Spacer, 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 Text, k as Static, 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, z as Box } from "./components-JxATjNGp.mjs";
3
- import { i as useIme, n as useAnimation, r as useWindowSize, t as useBoxMetrics } from "./composables-D9lN8Kdo.mjs";
1
+ import { C as useFocusManager, S as useFocus, a as createApp, b as useStdin, c as lastKeyEvent, d as lastResizeEvent, f as render, g as measureElement, i as useIsScreenReaderEnabled, l as lastMouseEvent, m as createRenderer, n as useKeyPress, o as lastCompositionEvent, p as renderToString, r as usePaste, s as lastFocusEvent, t as useInput, u as lastPasteEvent, v as useCursor, w as useApp, x as useStdout, y as useStderr } from "./useInput-5QozFZon.mjs";
2
+ import { A as Newline, C as Select, D as Code, E as Link, F as Stack, I as VStack, L as Divider, M as Card, N as Grid, O as Transform, P as HStack, R as Spacer, 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 Text, k as Static, 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, z as Box } from "./components-D-SpaK6k.mjs";
3
+ import { i as useIme, n as useAnimation, r as useWindowSize, t as useBoxMetrics } from "./composables-B_2fxufp.mjs";
4
4
  //#region src/kittyKeyboard.ts
5
5
  /**
6
6
  * Kitty keyboard protocol constants compatible with Ink.
@@ -1,15 +1,231 @@
1
1
  import { format } from "node:util";
2
2
  import { computed, createRenderer, defineComponent, h, inject, isRef, onUnmounted, ref, shallowRef, watch } from "@vue/runtime-core";
3
+ //#region src/renderPayload.ts
4
+ const displays = ["flex", "none"];
5
+ const positions = [
6
+ "absolute",
7
+ "relative",
8
+ "static"
9
+ ];
10
+ const overflows = [
11
+ "visible",
12
+ "hidden",
13
+ "scroll"
14
+ ];
15
+ const flexDirections = [
16
+ "row",
17
+ "column",
18
+ "row-reverse",
19
+ "column-reverse"
20
+ ];
21
+ const flexWraps = [
22
+ "nowrap",
23
+ "wrap",
24
+ "wrap-reverse"
25
+ ];
26
+ const justifyContents = [
27
+ "flex-start",
28
+ "flex-end",
29
+ "start",
30
+ "end",
31
+ "center",
32
+ "space-between",
33
+ "space-around",
34
+ "space-evenly"
35
+ ];
36
+ const alignItems = [
37
+ "flex-start",
38
+ "flex-end",
39
+ "start",
40
+ "end",
41
+ "center",
42
+ "stretch",
43
+ "baseline"
44
+ ];
45
+ const alignSelf = ["auto", ...alignItems];
46
+ const alignContent = [
47
+ "flex-start",
48
+ "flex-end",
49
+ "start",
50
+ "end",
51
+ "center",
52
+ "stretch",
53
+ "space-between",
54
+ "space-around",
55
+ "space-evenly"
56
+ ];
57
+ const borderStyles = [
58
+ "none",
59
+ "single",
60
+ "double",
61
+ "rounded",
62
+ "heavy",
63
+ "dashed"
64
+ ];
65
+ const wrapModes = [
66
+ "none",
67
+ "wrap",
68
+ "hard",
69
+ "truncate",
70
+ "truncate-start",
71
+ "truncate-middle",
72
+ "truncate-end"
73
+ ];
74
+ function recordValue(value) {
75
+ return typeof value === "object" && value !== null ? value : {};
76
+ }
77
+ function firstValue(record, ...keys) {
78
+ for (const key of keys) if (record[key] !== void 0) return record[key];
79
+ }
80
+ function enumValue(value, values) {
81
+ return typeof value === "string" && values.includes(value) ? value : void 0;
82
+ }
83
+ function stringValue$1(value) {
84
+ return typeof value === "string" || typeof value === "number" ? String(value) : void 0;
85
+ }
86
+ function numberValue(value) {
87
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
88
+ }
89
+ function booleanValue(value) {
90
+ return typeof value === "boolean" ? value : void 0;
91
+ }
92
+ function enabledValue(value) {
93
+ return value === true ? true : void 0;
94
+ }
95
+ function nonEmptyStringValue(value) {
96
+ const string = stringValue$1(value);
97
+ return string ? string : void 0;
98
+ }
99
+ function normalizeFrescoStyle(value) {
100
+ const source = recordValue(value);
101
+ const style = {};
102
+ style.display = enumValue(source.display, displays);
103
+ style.position = enumValue(source.position, positions);
104
+ style.top = stringValue$1(source.top);
105
+ style.right = stringValue$1(source.right);
106
+ style.bottom = stringValue$1(source.bottom);
107
+ style.left = stringValue$1(source.left);
108
+ style.overflow = enumValue(source.overflow, overflows);
109
+ style.overflowX = enumValue(firstValue(source, "overflowX", "overflow_x"), overflows);
110
+ style.overflowY = enumValue(firstValue(source, "overflowY", "overflow_y"), overflows);
111
+ style.flexDirection = enumValue(firstValue(source, "flexDirection", "flex_direction"), flexDirections);
112
+ style.flexWrap = enumValue(firstValue(source, "flexWrap", "flex_wrap"), flexWraps);
113
+ style.justifyContent = enumValue(firstValue(source, "justifyContent", "justify_content"), justifyContents);
114
+ style.alignItems = enumValue(firstValue(source, "alignItems", "align_items"), alignItems);
115
+ style.alignSelf = enumValue(firstValue(source, "alignSelf", "align_self"), alignSelf);
116
+ style.alignContent = enumValue(firstValue(source, "alignContent", "align_content"), alignContent);
117
+ style.flexGrow = numberValue(firstValue(source, "flexGrow", "flex_grow"));
118
+ style.flexShrink = numberValue(firstValue(source, "flexShrink", "flex_shrink"));
119
+ style.flexBasis = stringValue$1(firstValue(source, "flexBasis", "flex_basis"));
120
+ style.width = stringValue$1(source.width);
121
+ style.height = stringValue$1(source.height);
122
+ style.minWidth = stringValue$1(firstValue(source, "minWidth", "min_width"));
123
+ style.minHeight = stringValue$1(firstValue(source, "minHeight", "min_height"));
124
+ style.maxWidth = stringValue$1(firstValue(source, "maxWidth", "max_width"));
125
+ style.maxHeight = stringValue$1(firstValue(source, "maxHeight", "max_height"));
126
+ style.aspectRatio = numberValue(firstValue(source, "aspectRatio", "aspect_ratio"));
127
+ style.padding = numberValue(source.padding);
128
+ style.paddingTop = numberValue(firstValue(source, "paddingTop", "padding_top"));
129
+ style.paddingRight = numberValue(firstValue(source, "paddingRight", "padding_right"));
130
+ style.paddingBottom = numberValue(firstValue(source, "paddingBottom", "padding_bottom"));
131
+ style.paddingLeft = numberValue(firstValue(source, "paddingLeft", "padding_left"));
132
+ style.margin = numberValue(source.margin);
133
+ style.marginTop = numberValue(firstValue(source, "marginTop", "margin_top"));
134
+ style.marginRight = numberValue(firstValue(source, "marginRight", "margin_right"));
135
+ style.marginBottom = numberValue(firstValue(source, "marginBottom", "margin_bottom"));
136
+ style.marginLeft = numberValue(firstValue(source, "marginLeft", "margin_left"));
137
+ style.gap = numberValue(source.gap);
138
+ style.columnGap = numberValue(firstValue(source, "columnGap", "column_gap"));
139
+ style.rowGap = numberValue(firstValue(source, "rowGap", "row_gap"));
140
+ for (const key of Object.keys(style)) if (style[key] === void 0) delete style[key];
141
+ return Object.keys(style).length > 0 ? style : void 0;
142
+ }
143
+ function normalizeAppearance(props) {
144
+ const appearance = {};
145
+ appearance.fg = nonEmptyStringValue(firstValue(props, "fg", "color"));
146
+ appearance.bg = nonEmptyStringValue(firstValue(props, "bg", "backgroundColor", "background_color"));
147
+ appearance.bold = enabledValue(props.bold);
148
+ appearance.dim = enabledValue(firstValue(props, "dim", "dimColor", "dim_color"));
149
+ appearance.italic = enabledValue(props.italic);
150
+ appearance.underline = enabledValue(props.underline);
151
+ appearance.inverse = enabledValue(props.inverse);
152
+ appearance.blink = enabledValue(props.blink);
153
+ appearance.hidden = enabledValue(props.hidden);
154
+ appearance.strikethrough = enabledValue(props.strikethrough);
155
+ for (const key of Object.keys(appearance)) if (appearance[key] === void 0) delete appearance[key];
156
+ return Object.keys(appearance).length > 0 ? appearance : void 0;
157
+ }
158
+ function commonFields(node) {
159
+ const common = { id: node.id };
160
+ const style = normalizeFrescoStyle(node.props.style);
161
+ const appearance = normalizeAppearance(node.props);
162
+ const border = enumValue(node.props.border, borderStyles);
163
+ if (style) common.style = style;
164
+ if (appearance) common.appearance = appearance;
165
+ if (border) common.border = border;
166
+ if (node.children.length > 0) common.children = node.children.map((child) => child.id);
167
+ return common;
168
+ }
169
+ function wrapMode(value) {
170
+ if (value === false) return "none";
171
+ if (value === true) return "wrap";
172
+ if (value === "end") return "truncate-end";
173
+ if (value === "middle") return "truncate-middle";
174
+ return enumValue(value, wrapModes);
175
+ }
176
+ function wrappingEnabled(value, mode) {
177
+ if (value === void 0 || value === false) return false;
178
+ return !(mode?.startsWith("truncate") ?? false);
179
+ }
180
+ function frescoNodeToRenderNode(node) {
181
+ const common = commonFields(node);
182
+ if (node.type === "root" || node.type === "box") return {
183
+ ...common,
184
+ nodeType: node.type
185
+ };
186
+ if (node.type === "text") {
187
+ const renderNode = {
188
+ ...common,
189
+ nodeType: "text"
190
+ };
191
+ const text = node.text ?? stringValue$1(firstValue(node.props, "text", "content"));
192
+ const mode = wrapMode(node.props.wrap);
193
+ if (text !== void 0) renderNode.text = text;
194
+ if (node.props.wrap !== void 0) {
195
+ renderNode.wrap = wrappingEnabled(node.props.wrap, mode);
196
+ if (mode) renderNode.wrapMode = mode;
197
+ }
198
+ return renderNode;
199
+ }
200
+ const renderNode = {
201
+ ...common,
202
+ nodeType: "input"
203
+ };
204
+ const value = stringValue$1(node.props.value);
205
+ const placeholder = stringValue$1(node.props.placeholder);
206
+ const focused = booleanValue(firstValue(node.props, "focused", "focus"));
207
+ const cursor = numberValue(node.props.cursor);
208
+ const mask = booleanValue(node.props.mask);
209
+ const maskChar = stringValue$1(firstValue(node.props, "maskChar", "mask_char", "mask-char"));
210
+ if (value !== void 0) renderNode.value = value;
211
+ if (placeholder !== void 0) renderNode.placeholder = placeholder;
212
+ if (focused !== void 0) renderNode.focused = focused;
213
+ if (cursor !== void 0) renderNode.cursor = cursor;
214
+ if (mask !== void 0) renderNode.mask = mask;
215
+ if (maskChar !== void 0) renderNode.maskChar = maskChar;
216
+ return renderNode;
217
+ }
218
+ //#endregion
3
219
  //#region src/accessibility.ts
4
220
  const SCREEN_READER_KEY = Symbol("fresco-screen-reader");
5
221
  function isScreenReaderEnabledByDefault() {
6
222
  return process.env.INK_SCREEN_READER === "true" || process.env.FRESCO_SCREEN_READER === "true";
7
223
  }
8
- function stringValue$1(value) {
224
+ function stringValue(value) {
9
225
  if (typeof value === "string" || typeof value === "number") return String(value);
10
226
  }
11
227
  function nodeText$1(node) {
12
- const ariaLabel = stringValue$1(node.props["aria-label"]);
228
+ const ariaLabel = stringValue(node.props["aria-label"]);
13
229
  if (ariaLabel !== void 0) return ariaLabel;
14
230
  if (node.text !== void 0) return node.text;
15
231
  const propText = node.props.text ?? node.props.content;
@@ -24,10 +240,10 @@ function nodeText$1(node) {
24
240
  }
25
241
  function flexDirection(node) {
26
242
  const style = node.props.style ?? {};
27
- return stringValue$1(style.flexDirection ?? style.flex_direction) ?? "column";
243
+ return stringValue(style.flexDirection ?? style.flex_direction) ?? "column";
28
244
  }
29
245
  function ariaRole(node) {
30
- return stringValue$1(node.props["aria-role"]);
246
+ return stringValue(node.props["aria-role"]);
31
247
  }
32
248
  function ariaState(node) {
33
249
  const state = node.props["aria-state"];
@@ -61,7 +277,7 @@ function treeToScreenReaderString(node, options = {}) {
61
277
  }
62
278
  function treeToScreenReaderRenderNodes(root) {
63
279
  const output = treeToScreenReaderString(root);
64
- const rootStyle = root.props.style ?? {};
280
+ const rootStyle = normalizeFrescoStyle(root.props.style) ?? {};
65
281
  const nodes = [{
66
282
  id: root.id,
67
283
  nodeType: "root",
@@ -524,117 +740,13 @@ function mapElementType(type) {
524
740
  function createRenderer$1() {
525
741
  return createRenderer(rendererOptions);
526
742
  }
527
- function stringValue(value) {
528
- if (typeof value === "string" || typeof value === "number") return String(value);
529
- }
530
- function styleValue(style, ...keys) {
531
- for (const key of keys) if (style[key] !== void 0) return style[key];
532
- }
533
- function copyStringStyle(output, style, nativeKey, ...sourceKeys) {
534
- const normalized = stringValue(styleValue(style, ...sourceKeys));
535
- if (normalized !== void 0) output[nativeKey] = normalized;
536
- }
537
- function copyNumberStyle(output, style, nativeKey, ...sourceKeys) {
538
- const value = styleValue(style, ...sourceKeys);
539
- if (typeof value === "number") output[nativeKey] = value;
540
- }
541
- function copyRawStyle(output, style, nativeKey, ...sourceKeys) {
542
- const value = styleValue(style, ...sourceKeys);
543
- if (value !== void 0) output[nativeKey] = value;
544
- }
545
- function isWrappingEnabled(value) {
546
- if (value === void 0) return false;
547
- if (value === false) return false;
548
- if (typeof value === "string" && value.startsWith("truncate")) return false;
549
- return true;
550
- }
551
- function textWrapMode(value) {
552
- if (value === void 0) return void 0;
553
- if (value === false) return "none";
554
- if (value === true) return "wrap";
555
- if (value === "end") return "truncate-end";
556
- if (value === "middle") return "truncate-middle";
557
- if (typeof value === "string") return value;
558
- }
559
743
  /**
560
744
  * Convert Fresco tree to render nodes for native
561
745
  */
562
746
  function treeToRenderNodes(root) {
563
747
  const nodes = [];
564
748
  function visit(node) {
565
- const renderNode = {
566
- id: node.id,
567
- nodeType: node.type
568
- };
569
- const text = node.text ?? stringValue(node.props.text) ?? stringValue(node.props.content);
570
- if (text !== void 0) renderNode.text = text;
571
- if (node.props.wrap !== void 0) {
572
- renderNode.wrap = isWrappingEnabled(node.props.wrap);
573
- renderNode.wrapMode = textWrapMode(node.props.wrap);
574
- }
575
- if (node.props.value !== void 0) renderNode.value = stringValue(node.props.value) ?? "";
576
- if (node.props.placeholder !== void 0) renderNode.placeholder = stringValue(node.props.placeholder) ?? "";
577
- if (node.props.focused !== void 0 || node.props.focus !== void 0) renderNode.focused = Boolean(node.props.focused ?? node.props.focus);
578
- if (node.props.cursor !== void 0) renderNode.cursor = Number(node.props.cursor);
579
- if (node.props.mask !== void 0) renderNode.mask = Boolean(node.props.mask);
580
- if (node.props.maskChar !== void 0 || node.props["mask-char"] !== void 0) renderNode.maskChar = stringValue(node.props.maskChar ?? node.props["mask-char"]);
581
- if (node.props.border !== void 0) renderNode.border = stringValue(node.props.border) ?? "";
582
- if (node.props.style) {
583
- const s = node.props.style;
584
- const style = {};
585
- copyRawStyle(style, s, "display", "display");
586
- copyRawStyle(style, s, "position", "position");
587
- copyStringStyle(style, s, "top", "top");
588
- copyStringStyle(style, s, "right", "right");
589
- copyStringStyle(style, s, "bottom", "bottom");
590
- copyStringStyle(style, s, "left", "left");
591
- copyRawStyle(style, s, "flexDirection", "flexDirection", "flex_direction");
592
- copyRawStyle(style, s, "flexWrap", "flexWrap", "flex_wrap");
593
- copyRawStyle(style, s, "justifyContent", "justifyContent", "justify_content");
594
- copyRawStyle(style, s, "alignItems", "alignItems", "align_items");
595
- copyRawStyle(style, s, "alignSelf", "alignSelf", "align_self");
596
- copyRawStyle(style, s, "alignContent", "alignContent", "align_content");
597
- copyNumberStyle(style, s, "flexGrow", "flexGrow", "flex_grow");
598
- copyNumberStyle(style, s, "flexShrink", "flexShrink", "flex_shrink");
599
- copyStringStyle(style, s, "flexBasis", "flexBasis", "flex_basis");
600
- copyStringStyle(style, s, "width", "width");
601
- copyStringStyle(style, s, "height", "height");
602
- copyStringStyle(style, s, "minWidth", "minWidth", "min_width");
603
- copyStringStyle(style, s, "minHeight", "minHeight", "min_height");
604
- copyStringStyle(style, s, "maxWidth", "maxWidth", "max_width");
605
- copyStringStyle(style, s, "maxHeight", "maxHeight", "max_height");
606
- copyNumberStyle(style, s, "aspectRatio", "aspectRatio", "aspect_ratio");
607
- copyNumberStyle(style, s, "padding", "padding");
608
- copyNumberStyle(style, s, "paddingTop", "paddingTop", "padding_top");
609
- copyNumberStyle(style, s, "paddingRight", "paddingRight", "padding_right");
610
- copyNumberStyle(style, s, "paddingBottom", "paddingBottom", "padding_bottom");
611
- copyNumberStyle(style, s, "paddingLeft", "paddingLeft", "padding_left");
612
- copyNumberStyle(style, s, "margin", "margin");
613
- copyNumberStyle(style, s, "marginTop", "marginTop", "margin_top");
614
- copyNumberStyle(style, s, "marginRight", "marginRight", "margin_right");
615
- copyNumberStyle(style, s, "marginBottom", "marginBottom", "margin_bottom");
616
- copyNumberStyle(style, s, "marginLeft", "marginLeft", "margin_left");
617
- copyNumberStyle(style, s, "gap", "gap");
618
- copyNumberStyle(style, s, "columnGap", "columnGap", "column_gap");
619
- copyNumberStyle(style, s, "rowGap", "rowGap", "row_gap");
620
- copyRawStyle(style, s, "overflow", "overflow");
621
- copyRawStyle(style, s, "overflowX", "overflowX", "overflow_x");
622
- copyRawStyle(style, s, "overflowY", "overflowY", "overflow_y");
623
- if (Object.keys(style).length > 0) renderNode.style = style;
624
- }
625
- const appearance = {};
626
- const fg = node.props.fg ?? node.props.color;
627
- const bg = node.props.bg ?? node.props.backgroundColor;
628
- if (fg) appearance.fg = fg;
629
- if (bg) appearance.bg = bg;
630
- if (node.props.bold) appearance.bold = node.props.bold;
631
- if (node.props.dim || node.props.dimColor) appearance.dim = Boolean(node.props.dim || node.props.dimColor);
632
- if (node.props.italic) appearance.italic = node.props.italic;
633
- if (node.props.underline) appearance.underline = node.props.underline;
634
- if (node.props.strikethrough) appearance.strikethrough = node.props.strikethrough;
635
- if (node.props.inverse) appearance.inverse = node.props.inverse;
636
- if (Object.keys(appearance).length > 0) renderNode.appearance = appearance;
637
- if (node.children.length > 0) renderNode.children = node.children.map((c) => c.id);
749
+ const renderNode = frescoNodeToRenderNode(node);
638
750
  nodes.push(renderNode);
639
751
  for (const child of node.children) visit(child);
640
752
  }
@@ -1464,4 +1576,4 @@ function useKeyPress(key, handler, options = {}) {
1464
1576
  //#endregion
1465
1577
  export { useFocusManager as C, useFocus as S, updateLastRenderLayouts as _, createApp as a, useStdin as b, lastKeyEvent as c, lastResizeEvent as d, render as f, measureElement as g, getLastRenderLayout as h, useIsScreenReaderEnabled as i, lastMouseEvent as l, createRenderer$1 as m, useKeyPress as n, lastCompositionEvent as o, renderToString as p, usePaste as r, lastFocusEvent as s, useInput as t, lastPasteEvent as u, useCursor as v, useApp as w, useStdout as x, useStderr as y };
1466
1578
 
1467
- //# sourceMappingURL=useInput-BopE5ia7.mjs.map
1579
+ //# sourceMappingURL=useInput-5QozFZon.mjs.map