@visulima/tui 2.0.0 → 3.0.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/box.d.ts +25 -25
  3. package/dist/components/canvas.d.ts +26 -31
  4. package/dist/components/cursor.d.ts +39 -44
  5. package/dist/components/error-overview.d.ts +1 -3
  6. package/dist/components/error-overview.js +1 -1
  7. package/dist/components/newline.d.ts +6 -8
  8. package/dist/components/spacer.d.ts +4 -4
  9. package/dist/components/static-render.d.ts +9 -40
  10. package/dist/components/static.d.ts +13 -13
  11. package/dist/components/text.d.ts +34 -47
  12. package/dist/components/transform.d.ts +7 -11
  13. package/dist/core/index.d.ts +11 -11
  14. package/dist/core/index.js +1 -1
  15. package/dist/ink/canvas/index.d.ts +10 -10
  16. package/dist/ink/hooks/use-animation.d.ts +22 -22
  17. package/dist/ink/hooks/use-app.d.ts +3 -3
  18. package/dist/ink/hooks/use-box-metrics.d.ts +16 -16
  19. package/dist/ink/hooks/use-clipboard.d.ts +16 -16
  20. package/dist/ink/hooks/use-color-blindness.d.ts +16 -16
  21. package/dist/ink/hooks/use-console-capture.d.ts +19 -19
  22. package/dist/ink/hooks/use-cursor.d.ts +6 -6
  23. package/dist/ink/hooks/use-focus-manager.d.ts +25 -25
  24. package/dist/ink/hooks/use-focus.d.ts +14 -18
  25. package/dist/ink/hooks/use-form.d.ts +32 -32
  26. package/dist/ink/hooks/use-hotkey.d.ts +17 -17
  27. package/dist/ink/hooks/use-input.d.ts +92 -92
  28. package/dist/ink/hooks/use-input.js +2 -2
  29. package/dist/ink/hooks/use-interval.d.ts +14 -14
  30. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +3 -3
  31. package/dist/ink/hooks/use-key-bindings.d.ts +32 -32
  32. package/dist/ink/hooks/use-key-chord.d.ts +15 -15
  33. package/dist/ink/hooks/use-paste.d.ts +38 -38
  34. package/dist/ink/hooks/use-paste.js +1 -1
  35. package/dist/ink/hooks/use-persistent-state.d.ts +46 -46
  36. package/dist/ink/hooks/use-persistent-state.js +2 -2
  37. package/dist/ink/hooks/use-scroll-acceleration.d.ts +24 -24
  38. package/dist/ink/hooks/use-scroll-input.d.ts +15 -15
  39. package/dist/ink/hooks/use-stderr.d.ts +6 -6
  40. package/dist/ink/hooks/use-stderr.js +1 -1
  41. package/dist/ink/hooks/use-stdin.d.ts +10 -10
  42. package/dist/ink/hooks/use-stdin.js +1 -1
  43. package/dist/ink/hooks/use-stdout.d.ts +6 -6
  44. package/dist/ink/hooks/use-stdout.js +1 -1
  45. package/dist/ink/hooks/use-stopwatch.d.ts +12 -12
  46. package/dist/ink/hooks/use-terminal-palette.d.ts +11 -11
  47. package/dist/ink/hooks/use-text-buffer.d.ts +2 -2
  48. package/dist/ink/hooks/use-text-selection.d.ts +18 -18
  49. package/dist/ink/hooks/use-timeout.d.ts +11 -11
  50. package/dist/ink/hooks/use-timer.d.ts +19 -19
  51. package/dist/ink/hooks/use-window-size.d.ts +8 -8
  52. package/dist/ink/hooks/use-window-size.js +1 -1
  53. package/dist/ink/index.d.ts +109 -122
  54. package/dist/ink/index.js +1 -1
  55. package/dist/ink/mouse/use-element-position.d.ts +6 -6
  56. package/dist/ink/mouse/use-mouse-action.d.ts +1 -1
  57. package/dist/ink/mouse/use-mouse-position.d.ts +1 -1
  58. package/dist/ink/mouse/use-mouse.d.ts +1 -1
  59. package/dist/ink/mouse/use-on-mouse-click.d.ts +3 -3
  60. package/dist/ink/mouse/use-on-mouse-hover.d.ts +2 -2
  61. package/dist/ink/mouse/use-on-mouse-state.d.ts +2 -2
  62. package/dist/ink/public/cursor.d.ts +21 -21
  63. package/dist/ink/public/dom.d.ts +2 -2
  64. package/dist/ink/public/highlighter.d.ts +16 -26
  65. package/dist/ink/public/input.d.ts +6 -6
  66. package/dist/ink/public/styles.d.ts +1 -1
  67. package/dist/ink/public/utils.d.ts +2 -2
  68. package/dist/packem_shared/{DevTools-D9tfChBc.js → DevTools-CZ-O0Ckm.js} +1 -1
  69. package/dist/packem_shared/FocusContext-BWFqf9kb.js +1 -0
  70. package/dist/packem_shared/InputParser-CUAGWKQQ.js +2 -0
  71. package/dist/packem_shared/MouseProvider-DOcWCRVq.js +1 -0
  72. package/dist/packem_shared/{Renderer-DsskdkUd.js → Renderer-BeS49FNq.js} +1 -1
  73. package/dist/packem_shared/{TuiApp-DjIgv5Sk.js → TuiApp-CCVaiKbf.js} +1 -1
  74. package/dist/packem_shared/app-context.d-DMLw5Nxy.d.ts +56 -0
  75. package/dist/packem_shared/{buffer.d-j_dP5JyC.d.ts → buffer.d-CttIC480.d.ts} +26 -26
  76. package/dist/packem_shared/clipboard.d-nDPQkZ2H.d.ts +23 -0
  77. package/dist/packem_shared/color-matrix.d-sTqnJ23h.d.ts +50 -0
  78. package/dist/packem_shared/createInlineLoop-BMDYJkRp.js +2 -0
  79. package/dist/packem_shared/{dom.d-g-nsYquD.d.ts → dom.d-CLGlidfI.d.ts} +138 -151
  80. package/dist/packem_shared/{input.d-D-Yxqha8.d.ts → input.d-CL_4MfL-.d.ts} +30 -24
  81. package/dist/packem_shared/load-native-root-binding-CxJnHcac.js +1 -0
  82. package/dist/packem_shared/{mouse-context.d-BfL9xGk_.d.ts → mouse-context.d-W-nszUps.d.ts} +8 -8
  83. package/dist/packem_shared/reconciler-D4fi5NfR.js +1 -0
  84. package/dist/packem_shared/reconciler-DkwOtC5B.js +1 -0
  85. package/dist/packem_shared/render-CPVY5vpQ.js +1 -0
  86. package/dist/packem_shared/render-CvhjGwOg.js +24 -0
  87. package/dist/packem_shared/render.d-DjQhFsiN.d.ts +435 -0
  88. package/dist/packem_shared/{renderToString-DqLFFPvO.js → renderToString-B1LgWcJe.js} +1 -1
  89. package/dist/packem_shared/{renderToString-DkTmJPaS.js → renderToString-Df6HST7u.js} +1 -1
  90. package/dist/packem_shared/{selection.d-KWphH--_.d.ts → selection.d-BSAWa4ey.d.ts} +16 -16
  91. package/dist/packem_shared/stderr-context-CR2LLec6.js +1 -0
  92. package/dist/packem_shared/stdin-context-BjMA9Sbi.js +1 -0
  93. package/dist/packem_shared/stdout-context-DAAlQct2.js +1 -0
  94. package/dist/packem_shared/styles.d-CKGQFfm4.d.ts +485 -0
  95. package/dist/packem_shared/{terminal-palette.d-D2SQjfn-.d.ts → terminal-palette.d-JbWHISW-.d.ts} +7 -7
  96. package/dist/packem_shared/utils-CVgM8kTn.js +1 -0
  97. package/dist/react/index.d.ts +160 -178
  98. package/dist/react/index.js +1 -1
  99. package/dist/testing/index.d.ts +151 -151
  100. package/dist/testing/index.js +1 -1
  101. package/index.js +52 -52
  102. package/package.json +13 -13
  103. package/dist/packem_shared/FocusContext-C2Sosxa4.js +0 -1
  104. package/dist/packem_shared/InputParser-CiBitCva.js +0 -2
  105. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +0 -1
  106. package/dist/packem_shared/app-context.d-CG88lgkg.d.ts +0 -56
  107. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +0 -23
  108. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +0 -50
  109. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +0 -2
  110. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +0 -1
  111. package/dist/packem_shared/reconciler-ClpU7Y-V.js +0 -1
  112. package/dist/packem_shared/reconciler-DhUGYWCr.js +0 -1
  113. package/dist/packem_shared/render-D7aV_hO1.js +0 -24
  114. package/dist/packem_shared/render-DMcWfI6-.js +0 -1
  115. package/dist/packem_shared/render.d-BvfwvSCx.d.ts +0 -435
  116. package/dist/packem_shared/stderr-context-Bvnik0hL.js +0 -1
  117. package/dist/packem_shared/stdin-context-88AhuztD.js +0 -1
  118. package/dist/packem_shared/stdout-context-BnblEPez.js +0 -1
  119. package/dist/packem_shared/styles.d-D7iZuNC-.d.ts +0 -492
  120. package/dist/packem_shared/utils-C8l_3Dzw.js +0 -1
@@ -1,492 +0,0 @@
1
- import { AnsiColors } from '@visulima/colorize';
2
- import { LiteralUnion } from 'type-fest';
3
- import 'yoga-layout';
4
- /**
5
- Style of the box border.
6
- */
7
- type BoxStyle = {
8
- readonly topLeft: string;
9
- readonly top: string;
10
- readonly topRight: string;
11
- readonly right: string;
12
- readonly bottomRight: string;
13
- readonly bottom: string;
14
- readonly bottomLeft: string;
15
- readonly left: string;
16
- };
17
- /**
18
- All box styles.
19
- */
20
- type Boxes = {
21
- /**
22
- @example
23
- ```
24
- ┌────┐
25
- │ │
26
- └────┘
27
- ```
28
- */
29
- readonly single: BoxStyle;
30
-
31
- /**
32
- @example
33
- ```
34
- ╔════╗
35
- ║ ║
36
- ╚════╝
37
- ```
38
- */
39
- readonly double: BoxStyle;
40
-
41
- /**
42
- @example
43
- ```
44
- ╭────╮
45
- │ │
46
- ╰────╯
47
- ```
48
- */
49
- readonly round: BoxStyle;
50
-
51
- /**
52
- @example
53
- ```
54
- ┏━━━━┓
55
- ┃ ┃
56
- ┗━━━━┛
57
- ```
58
- */
59
- readonly bold: BoxStyle;
60
-
61
- /**
62
- @example
63
- ```
64
- ╓────╖
65
- ║ ║
66
- ╙────╜
67
- ```
68
- */
69
- readonly singleDouble: BoxStyle;
70
-
71
- /**
72
- @example
73
- ```
74
- ╒════╕
75
- │ │
76
- ╘════╛
77
- ```
78
- */
79
- readonly doubleSingle: BoxStyle;
80
-
81
- /**
82
- @example
83
- ```
84
- +----+
85
- | |
86
- +----+
87
- ```
88
- */
89
- readonly classic: BoxStyle;
90
-
91
- /**
92
- @example
93
- ```
94
- ↘↓↓↓↓↙
95
- → ←
96
- ↗↑↑↑↑↖
97
- ```
98
- */
99
- readonly arrow: BoxStyle;
100
- };
101
- type Styles = {
102
- /**
103
- * It defines the alignment along the cross axis when there are multiple lines of flex items (when using flex-wrap).
104
- * See [align-content](https://css-tricks.com/almanac/properties/a/align-content/).
105
- */
106
- readonly alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly";
107
- /**
108
- * The align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis).
109
- * See [align-items](https://css-tricks.com/almanac/properties/a/align-items/).
110
- */
111
- readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
112
- /**
113
- * It makes possible to override the align-items value for specific flex items.
114
- * See [align-self](https://css-tricks.com/almanac/properties/a/align-self/).
115
- */
116
- readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | "stretch" | "baseline";
117
- /**
118
- * Defines the aspect ratio (width/height) for the element.
119
- *
120
- * Use it with at least one size constraint (`width`, `height`, `minHeight`, or `maxHeight`) so Ink can derive the missing dimension.
121
- */
122
- readonly aspectRatio?: number;
123
- /**
124
- * Background color for the element.
125
- *
126
- * Accepts the same values as `color` in the `<Text>` component.
127
- */
128
- readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
129
- /**
130
- * Change border background color. A shorthand for setting `borderTopBackgroundColor`, `borderRightBackgroundColor`, `borderBottomBackgroundColor`, and `borderLeftBackgroundColor`.
131
- */
132
- readonly borderBackgroundColor?: LiteralUnion<AnsiColors, string>;
133
- /**
134
- * Determines whether the bottom border is visible.
135
- * @default true
136
- */
137
- readonly borderBottom?: boolean;
138
- /**
139
- * Change the bottom border background color. Accepts the same values as `backgroundColor` in `Text` component.
140
- */
141
- readonly borderBottomBackgroundColor?: LiteralUnion<AnsiColors, string>;
142
- /**
143
- * Change the bottom border color. Accepts the same values as `color` in `Text` component.
144
- */
145
- readonly borderBottomColor?: LiteralUnion<AnsiColors, string>;
146
- /**
147
- * Dim the bottom border color.
148
- * @default false
149
- */
150
- readonly borderBottomDimColor?: boolean;
151
- /**
152
- * Text to display embedded in the bottom border line.
153
- * Rendered as: `└─ title ─────────┘`
154
- */
155
- readonly borderBottomTitle?: string;
156
- /**
157
- * Alignment of the bottom border title.
158
- * @default "left"
159
- */
160
- readonly borderBottomTitleAlignment?: "center" | "left" | "right";
161
- /**
162
- * Change border color. A shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor`, and `borderLeftColor`.
163
- */
164
- readonly borderColor?: LiteralUnion<AnsiColors, string>;
165
- /**
166
- * Dim the border color. A shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor`, and `borderRightDimColor`.
167
- * @default false
168
- */
169
- readonly borderDimColor?: boolean;
170
- /**
171
- * Determines whether the left border is visible.
172
- * @default true
173
- */
174
- readonly borderLeft?: boolean;
175
- /**
176
- * Change the left border background color. Accepts the same values as `backgroundColor` in `Text` component.
177
- */
178
- readonly borderLeftBackgroundColor?: LiteralUnion<AnsiColors, string>;
179
- /**
180
- * Change the left border color. Accepts the same values as `color` in `Text` component.
181
- */
182
- readonly borderLeftColor?: LiteralUnion<AnsiColors, string>;
183
- /**
184
- * Dim the left border color.
185
- * @default false
186
- */
187
- readonly borderLeftDimColor?: boolean;
188
- /**
189
- * Determines whether the right border is visible.
190
- * @default true
191
- */
192
- readonly borderRight?: boolean;
193
- /**
194
- * Change the right border background color. Accepts the same values as `backgroundColor` in `Text` component.
195
- */
196
- readonly borderRightBackgroundColor?: LiteralUnion<AnsiColors, string>;
197
- /**
198
- * Change the right border color. Accepts the same values as `color` in `Text` component.
199
- */
200
- readonly borderRightColor?: LiteralUnion<AnsiColors, string>;
201
- /**
202
- * Dim the right border color.
203
- * @default false
204
- */
205
- readonly borderRightDimColor?: boolean;
206
- /**
207
- * Add a border with a specified style. If `borderStyle` is `undefined` (the default), no border will be added.
208
- */
209
- readonly borderStyle?: keyof Boxes | BoxStyle;
210
- /**
211
- * Determines whether the top border is visible.
212
- * @default true
213
- */
214
- readonly borderTop?: boolean;
215
- /**
216
- * Change the top border background color. Accepts the same values as `backgroundColor` in `Text` component.
217
- */
218
- readonly borderTopBackgroundColor?: LiteralUnion<AnsiColors, string>;
219
- /**
220
- * Change the top border color. Accepts the same values as `color` in `Text` component.
221
- */
222
- readonly borderTopColor?: LiteralUnion<AnsiColors, string>;
223
- /**
224
- * Dim the top border color.
225
- * @default false
226
- */
227
- readonly borderTopDimColor?: boolean;
228
- /**
229
- * Text to display on the right side of the top border line.
230
- * Rendered as: `┌─ title ──── rightTitle ─┐`
231
- */
232
- readonly borderTopRightTitle?: string;
233
- /**
234
- * Text to display embedded in the top border line.
235
- * Rendered as: `┌─ title ─────────┐`
236
- */
237
- readonly borderTopTitle?: string;
238
- /**
239
- * Alignment of the top border title.
240
- * @default "left"
241
- */
242
- readonly borderTopTitleAlignment?: "center" | "left" | "right";
243
- /**
244
- * Bottom offset for positioned elements.
245
- */
246
- readonly bottom?: number | string;
247
- /**
248
- * Size of the gap between an element's columns.
249
- */
250
- readonly columnGap?: number;
251
- /**
252
- * Set this property to `none` to hide the element.
253
- */
254
- readonly display?: "flex" | "none";
255
- /**
256
- * It specifies the initial size of the flex item, before any available space is distributed according to the flex factors.
257
- * See [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).
258
- */
259
- readonly flexBasis?: number | string;
260
- /**
261
- * It establishes the main-axis, thus defining the direction flex items are placed in the flex container.
262
- * See [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).
263
- */
264
- readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
265
- /**
266
- * This property defines the ability for a flex item to grow if necessary.
267
- * See [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).
268
- */
269
- readonly flexGrow?: number;
270
- /**
271
- * It specifies the “flex shrink factor”, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn’t enough space on the row.
272
- * See [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).
273
- */
274
- readonly flexShrink?: number;
275
- /**
276
- * It defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in.
277
- * See [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).
278
- */
279
- readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
280
- /**
281
- * Size of the gap between an element's columns and rows. A shorthand for `columnGap` and `rowGap`.
282
- */
283
- readonly gap?: number;
284
- /**
285
- * Height of the element in lines (rows). You can also set it as a percentage, which will calculate the height based on the height of the parent element.
286
- */
287
- readonly height?: number | string;
288
- /**
289
- * It defines the alignment along the main axis.
290
- * See [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).
291
- */
292
- readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center";
293
- /**
294
- * Left offset for positioned elements.
295
- */
296
- readonly left?: number | string;
297
- /**
298
- * Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft`, and `marginRight`.
299
- */
300
- readonly margin?: number;
301
- /**
302
- * Bottom margin.
303
- */
304
- readonly marginBottom?: number;
305
- /**
306
- * Left margin.
307
- */
308
- readonly marginLeft?: number;
309
- /**
310
- * Right margin.
311
- */
312
- readonly marginRight?: number;
313
- /**
314
- * Top margin.
315
- */
316
- readonly marginTop?: number;
317
- /**
318
- * Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
319
- */
320
- readonly marginX?: number;
321
- /**
322
- * Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
323
- */
324
- readonly marginY?: number;
325
- /**
326
- * Sets a maximum height of the element in lines (rows). You can also set it as a percentage, which will calculate the maximum height based on the height of the parent element.
327
- */
328
- readonly maxHeight?: number | string;
329
- /**
330
- * Caps how far the stable scroll height is allowed to grow beyond the
331
- * content currently in the box, in rows. Only applies when both
332
- * `stableScrollback` and `overflowToBackbuffer` are enabled.
333
- *
334
- * Without a cap, `scrollHeight` for a stable-scrollback box never shrinks
335
- * and grows monotonically for the lifetime of the box (long-running logs,
336
- * streaming output). That makes the scrollbar/scrollTop math treat an
337
- * ever-growing region as scrollable even after the content is gone. This
338
- * bounds the retained history to at most `maxScrollbackLength` rows past
339
- * the current content. Omit for the previous unbounded behavior.
340
- *
341
- * It also bounds a single-frame backbuffer burst to at most this many rows
342
- * on a large `scrollTop` jump. A value of `0` therefore disables
343
- * terminal-scrollback emission entirely (scrolled-off lines are still
344
- * clipped from the live view, just not flushed to history) — use it to
345
- * cap growth without keeping any backbuffer, or omit it for unbounded
346
- * retention.
347
- */
348
- readonly maxScrollbackLength?: number;
349
- /**
350
- * Sets a maximum width of the element.
351
- * Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
352
- */
353
- readonly maxWidth?: number | string;
354
- /**
355
- * Sets a minimum height of the element in lines (rows). You can also set it as a percentage, which will calculate the minimum height based on the height of the parent element.
356
- */
357
- readonly minHeight?: number | string;
358
- /**
359
- * Sets a minimum width of the element.
360
- * Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
361
- */
362
- readonly minWidth?: number | string;
363
- /**
364
- * Behavior for an element's overflow in both directions.
365
- * @default 'visible'
366
- */
367
- readonly overflow?: "visible" | "hidden" | "scroll";
368
- /**
369
- * If true, content that is scrolled out of the top of the box (when overflowY is 'scroll')
370
- * is flushed into the terminal emulator's real scrollback history instead
371
- * of being clipped and discarded. Scrolling back up in the terminal reveals
372
- * the original lines.
373
- *
374
- * Constraints:
375
- * - Inline mode only. In alternate-screen mode the terminal has no
376
- * scrollback, so this is a no-op. Non-TTY/piped output is also a no-op
377
- * (content is clipped as before).
378
- * - Exactly one scrollable region in the app may enable
379
- * `overflowToBackbuffer`. Results are undefined with more than one.
380
- *
381
- * Each scrolled-off line is emitted exactly once; scrolling back up never
382
- * re-emits. Pair with `stableScrollback` to keep `scrollTop` math stable as
383
- * history accumulates, and `maxScrollbackLength` to bound a single-frame
384
- * burst on a large `scrollTop` jump.
385
- * @default false
386
- */
387
- readonly overflowToBackbuffer?: boolean;
388
- /**
389
- * Behavior for an element's overflow in the horizontal direction.
390
- * @default 'visible'
391
- */
392
- readonly overflowX?: "visible" | "hidden" | "scroll";
393
- /**
394
- * Behavior for an element's overflow in the vertical direction.
395
- * @default 'visible'
396
- */
397
- readonly overflowY?: "visible" | "hidden" | "scroll";
398
- /**
399
- * Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.
400
- */
401
- readonly padding?: number;
402
- /**
403
- * Bottom padding.
404
- */
405
- readonly paddingBottom?: number;
406
- /**
407
- * Left padding.
408
- */
409
- readonly paddingLeft?: number;
410
- /**
411
- * Right padding.
412
- */
413
- readonly paddingRight?: number;
414
- /**
415
- * Top padding.
416
- */
417
- readonly paddingTop?: number;
418
- /**
419
- * Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
420
- */
421
- readonly paddingX?: number;
422
- /**
423
- * Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
424
- */
425
- readonly paddingY?: number;
426
- /**
427
- * Controls how the element is positioned.
428
- *
429
- * When `position` is `static`, `top`, `right`, `bottom`, and `left` are ignored.
430
- */
431
- readonly position?: "absolute" | "relative" | "static";
432
- /**
433
- * Right offset for positioned elements.
434
- */
435
- readonly right?: number | string;
436
- /**
437
- * Size of the gap between an element's rows.
438
- */
439
- readonly rowGap?: number;
440
- /**
441
- * Color of the scrollbar thumb when overflow is set to 'scroll'.
442
- */
443
- readonly scrollbarThumbColor?: LiteralUnion<AnsiColors, string>;
444
- /**
445
- * Horizontal scroll position (in columns). Only applies when overflowX or overflow is 'scroll'.
446
- */
447
- readonly scrollLeft?: number;
448
- /**
449
- * Vertical scroll position (in rows). Only applies when overflowY or overflow is 'scroll'.
450
- */
451
- readonly scrollTop?: number;
452
- /**
453
- * If true, and `overflowToBackbuffer` is also enabled, the `scrollHeight` of the box
454
- * will never decrease as long as the existing history remains valid.
455
- * This prevents the terminal's scrollback from being corrupted when content shrinks.
456
- *
457
- * Growth is bounded by `maxScrollbackLength` (if set); otherwise the stable
458
- * height grows monotonically for the lifetime of the box.
459
- * @default false
460
- */
461
- readonly stableScrollback?: boolean;
462
- /**
463
- * Controls how text wraps when it exceeds the container width.
464
- *
465
- * - `wrap` (default) — Wrap at word boundaries; break inside words only when a single word exceeds the width.
466
- * - `wrap-anywhere` — Break at any character boundary, even when a whitespace break exists earlier.
467
- * - `wrap-preserve-words` — Wrap at word boundaries; never break inside words (long words may overflow).
468
- * - `wrap-strict` — Enforce exact width; always break at the column limit.
469
- * - `hard` — Alias for `wrap-strict`. Fills each line to the full column width, breaking words mid-word as needed.
470
- * - `truncate` / `truncate-end` — Truncate at the end with an ellipsis.
471
- * - `truncate-start` — Truncate at the start with an ellipsis.
472
- * - `truncate-middle` — Truncate in the middle with an ellipsis.
473
- */
474
- readonly textWrap?: "hard" | "wrap" | "wrap-anywhere" | "wrap-preserve-words" | "wrap-strict" | "end" | "middle" | "truncate-end" | "truncate" | "truncate-middle" | "truncate-start";
475
- /**
476
- * Top offset for positioned elements.
477
- */
478
- readonly top?: number | string;
479
- /**
480
- * Determines whether the user can select text within this element.
481
- * - `auto`: Default behavior, text is selectable.
482
- * - `none`: Text cannot be selected.
483
- * - `text`: Only text can be selected.
484
- * - `all`: All content is selected on click.
485
- */
486
- readonly userSelect?: "auto" | "none" | "text" | "all";
487
- /**
488
- * Width of the element in spaces. You can also set it as a percentage, which will calculate the width based on the width of the parent element.
489
- */
490
- readonly width?: number | string;
491
- };
492
- export { Styles as S };
@@ -1 +0,0 @@
1
- import{createRequire as w}from"node:module";const _=w(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=s=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,r]=o.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return o.getBuiltinModule(s)}return _(s)},n=o,{execFileSync:b}=a("node:child_process"),c=a("node:fs"),g=a("node:tty"),d=80,p=24,m=(s,e,{shell:r,env:t}={})=>b(s,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:t}).trim(),u=(s,e)=>({columns:Number.parseInt(s,10),rows:Number.parseInt(e,10)}),N=(s,e)=>{const{columns:r,rows:t}=u(s,e);if(!(Number.isNaN(r)||Number.isNaN(t))&&!(r===d&&t===p))return{columns:r,rows:t}},h=()=>{if(n.platform!=="linux")return!0;try{const s=c.readFileSync("/proc/self/stat","utf8"),e=s.lastIndexOf(") ");if(e===-1)return!1;const r=s.slice(e+2).trim().split(/\s+/),t=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(t)||Number.isNaN(i)||i<=0?!1:t===i}catch{return!1}};function y(){const{env:s,stdout:e,stderr:r}=n;if(e?.columns&&e?.rows)return u(e.columns,e.rows);if(r?.columns&&r?.rows)return u(r.columns,r.rows);if(s.COLUMNS&&s.LINES)return u(s.COLUMNS,s.LINES);const t={columns:d,rows:p};return n.platform==="win32"?l()??t:n.platform==="darwin"?f()??l()??t:f()??l()??v()??t}const f=()=>{try{const s=n.platform==="darwin"?c.constants.O_EVTONLY|c.constants.O_NONBLOCK:c.constants.O_NONBLOCK,{columns:e,rows:r}=g.WriteStream(c.openSync("/dev/tty",s));return{columns:e,rows:r}}catch{}},l=()=>{try{const s=m("tput",["cols"],{env:{TERM:"dumb",...n.env}}),e=m("tput",["lines"],{env:{TERM:"dumb",...n.env}});if(s&&e)return N(s,e)}catch{}},v=()=>{try{if(!h())return;const s=m("resize",["-u"]).match(/\d+/g);if(s.length===2)return N(s[0],s[1])}catch{}},S=s=>{const{columns:e,rows:r}=s;if(e&&r)return{columns:e,rows:r};const t=y();return{columns:e||t.columns||80,rows:r||t.rows||24}};export{S as g};