@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.
- package/CHANGELOG.md +13 -0
- package/dist/components/box.d.ts +25 -25
- package/dist/components/canvas.d.ts +26 -31
- package/dist/components/cursor.d.ts +39 -44
- package/dist/components/error-overview.d.ts +1 -3
- package/dist/components/error-overview.js +1 -1
- package/dist/components/newline.d.ts +6 -8
- package/dist/components/spacer.d.ts +4 -4
- package/dist/components/static-render.d.ts +9 -40
- package/dist/components/static.d.ts +13 -13
- package/dist/components/text.d.ts +34 -47
- package/dist/components/transform.d.ts +7 -11
- package/dist/core/index.d.ts +11 -11
- package/dist/core/index.js +1 -1
- package/dist/ink/canvas/index.d.ts +10 -10
- package/dist/ink/hooks/use-animation.d.ts +22 -22
- package/dist/ink/hooks/use-app.d.ts +3 -3
- package/dist/ink/hooks/use-box-metrics.d.ts +16 -16
- package/dist/ink/hooks/use-clipboard.d.ts +16 -16
- package/dist/ink/hooks/use-color-blindness.d.ts +16 -16
- package/dist/ink/hooks/use-console-capture.d.ts +19 -19
- package/dist/ink/hooks/use-cursor.d.ts +6 -6
- package/dist/ink/hooks/use-focus-manager.d.ts +25 -25
- package/dist/ink/hooks/use-focus.d.ts +14 -18
- package/dist/ink/hooks/use-form.d.ts +32 -32
- package/dist/ink/hooks/use-hotkey.d.ts +17 -17
- package/dist/ink/hooks/use-input.d.ts +92 -92
- package/dist/ink/hooks/use-input.js +2 -2
- package/dist/ink/hooks/use-interval.d.ts +14 -14
- package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +3 -3
- package/dist/ink/hooks/use-key-bindings.d.ts +32 -32
- package/dist/ink/hooks/use-key-chord.d.ts +15 -15
- package/dist/ink/hooks/use-paste.d.ts +38 -38
- package/dist/ink/hooks/use-paste.js +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +46 -46
- package/dist/ink/hooks/use-persistent-state.js +2 -2
- package/dist/ink/hooks/use-scroll-acceleration.d.ts +24 -24
- package/dist/ink/hooks/use-scroll-input.d.ts +15 -15
- package/dist/ink/hooks/use-stderr.d.ts +6 -6
- package/dist/ink/hooks/use-stderr.js +1 -1
- package/dist/ink/hooks/use-stdin.d.ts +10 -10
- package/dist/ink/hooks/use-stdin.js +1 -1
- package/dist/ink/hooks/use-stdout.d.ts +6 -6
- package/dist/ink/hooks/use-stdout.js +1 -1
- package/dist/ink/hooks/use-stopwatch.d.ts +12 -12
- package/dist/ink/hooks/use-terminal-palette.d.ts +11 -11
- package/dist/ink/hooks/use-text-buffer.d.ts +2 -2
- package/dist/ink/hooks/use-text-selection.d.ts +18 -18
- package/dist/ink/hooks/use-timeout.d.ts +11 -11
- package/dist/ink/hooks/use-timer.d.ts +19 -19
- package/dist/ink/hooks/use-window-size.d.ts +8 -8
- package/dist/ink/hooks/use-window-size.js +1 -1
- package/dist/ink/index.d.ts +109 -122
- package/dist/ink/index.js +1 -1
- package/dist/ink/mouse/use-element-position.d.ts +6 -6
- package/dist/ink/mouse/use-mouse-action.d.ts +1 -1
- package/dist/ink/mouse/use-mouse-position.d.ts +1 -1
- package/dist/ink/mouse/use-mouse.d.ts +1 -1
- package/dist/ink/mouse/use-on-mouse-click.d.ts +3 -3
- package/dist/ink/mouse/use-on-mouse-hover.d.ts +2 -2
- package/dist/ink/mouse/use-on-mouse-state.d.ts +2 -2
- package/dist/ink/public/cursor.d.ts +21 -21
- package/dist/ink/public/dom.d.ts +2 -2
- package/dist/ink/public/highlighter.d.ts +16 -26
- package/dist/ink/public/input.d.ts +6 -6
- package/dist/ink/public/styles.d.ts +1 -1
- package/dist/ink/public/utils.d.ts +2 -2
- package/dist/packem_shared/{DevTools-D9tfChBc.js → DevTools-CZ-O0Ckm.js} +1 -1
- package/dist/packem_shared/FocusContext-BWFqf9kb.js +1 -0
- package/dist/packem_shared/InputParser-CUAGWKQQ.js +2 -0
- package/dist/packem_shared/MouseProvider-DOcWCRVq.js +1 -0
- package/dist/packem_shared/{Renderer-DsskdkUd.js → Renderer-BeS49FNq.js} +1 -1
- package/dist/packem_shared/{TuiApp-DjIgv5Sk.js → TuiApp-CCVaiKbf.js} +1 -1
- package/dist/packem_shared/app-context.d-DMLw5Nxy.d.ts +56 -0
- package/dist/packem_shared/{buffer.d-j_dP5JyC.d.ts → buffer.d-CttIC480.d.ts} +26 -26
- package/dist/packem_shared/clipboard.d-nDPQkZ2H.d.ts +23 -0
- package/dist/packem_shared/color-matrix.d-sTqnJ23h.d.ts +50 -0
- package/dist/packem_shared/createInlineLoop-BMDYJkRp.js +2 -0
- package/dist/packem_shared/{dom.d-g-nsYquD.d.ts → dom.d-CLGlidfI.d.ts} +138 -151
- package/dist/packem_shared/{input.d-D-Yxqha8.d.ts → input.d-CL_4MfL-.d.ts} +30 -24
- package/dist/packem_shared/load-native-root-binding-CxJnHcac.js +1 -0
- package/dist/packem_shared/{mouse-context.d-BfL9xGk_.d.ts → mouse-context.d-W-nszUps.d.ts} +8 -8
- package/dist/packem_shared/reconciler-D4fi5NfR.js +1 -0
- package/dist/packem_shared/reconciler-DkwOtC5B.js +1 -0
- package/dist/packem_shared/render-CPVY5vpQ.js +1 -0
- package/dist/packem_shared/render-CvhjGwOg.js +24 -0
- package/dist/packem_shared/render.d-DjQhFsiN.d.ts +435 -0
- package/dist/packem_shared/{renderToString-DqLFFPvO.js → renderToString-B1LgWcJe.js} +1 -1
- package/dist/packem_shared/{renderToString-DkTmJPaS.js → renderToString-Df6HST7u.js} +1 -1
- package/dist/packem_shared/{selection.d-KWphH--_.d.ts → selection.d-BSAWa4ey.d.ts} +16 -16
- package/dist/packem_shared/stderr-context-CR2LLec6.js +1 -0
- package/dist/packem_shared/stdin-context-BjMA9Sbi.js +1 -0
- package/dist/packem_shared/stdout-context-DAAlQct2.js +1 -0
- package/dist/packem_shared/styles.d-CKGQFfm4.d.ts +485 -0
- package/dist/packem_shared/{terminal-palette.d-D2SQjfn-.d.ts → terminal-palette.d-JbWHISW-.d.ts} +7 -7
- package/dist/packem_shared/utils-CVgM8kTn.js +1 -0
- package/dist/react/index.d.ts +160 -178
- package/dist/react/index.js +1 -1
- package/dist/testing/index.d.ts +151 -151
- package/dist/testing/index.js +1 -1
- package/index.js +52 -52
- package/package.json +13 -13
- package/dist/packem_shared/FocusContext-C2Sosxa4.js +0 -1
- package/dist/packem_shared/InputParser-CiBitCva.js +0 -2
- package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +0 -1
- package/dist/packem_shared/app-context.d-CG88lgkg.d.ts +0 -56
- package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +0 -23
- package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +0 -50
- package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +0 -2
- package/dist/packem_shared/load-native-root-binding-DDikxNox.js +0 -1
- package/dist/packem_shared/reconciler-ClpU7Y-V.js +0 -1
- package/dist/packem_shared/reconciler-DhUGYWCr.js +0 -1
- package/dist/packem_shared/render-D7aV_hO1.js +0 -24
- package/dist/packem_shared/render-DMcWfI6-.js +0 -1
- package/dist/packem_shared/render.d-BvfwvSCx.d.ts +0 -435
- package/dist/packem_shared/stderr-context-Bvnik0hL.js +0 -1
- package/dist/packem_shared/stdin-context-88AhuztD.js +0 -1
- package/dist/packem_shared/stdout-context-BnblEPez.js +0 -1
- package/dist/packem_shared/styles.d-D7iZuNC-.d.ts +0 -492
- package/dist/packem_shared/utils-C8l_3Dzw.js +0 -1
package/dist/ink/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { type C as ClipboardTarget, c as clearOsc52, i as isOsc52Supported, w as writeOsc52 } from "../packem_shared/clipboard.d-
|
|
2
|
-
export { b as COLOR_BLINDNESS_COMPENSATION, c as COLOR_BLINDNESS_SIMULATION, type C as ColorBlindnessType, type a as ColorMatrix, I as IDENTITY_MATRIX, d as applyColorMatrix, h as hexToRgb, r as rgbToHex, t as transformHexColor } from "../packem_shared/color-matrix.d-
|
|
3
|
-
import { D as DOMElement, b as DOMNode, e as StyledLine } from "../packem_shared/dom.d-
|
|
4
|
-
export { R as ResizeObserver, type f as ResizeObserverCallback, g as ResizeObserverEntry, type h as ScrollState, type S as StickyHeader, i as calculateScroll, j as getPathToRoot, k as getScrollHeight, l as getScrollLeft, m as getScrollTop, n as getScrollWidth, o as isNodeSelectable } from "../packem_shared/dom.d-
|
|
5
|
-
export { type I as Instance, type K as KittyFlagName, type a as KittyKeyboardOptions, type R as RenderOptions, k as kittyFlags, b as kittyModifiers, r as render } from "../packem_shared/render.d-
|
|
1
|
+
export { type C as ClipboardTarget, c as clearOsc52, i as isOsc52Supported, w as writeOsc52 } from "../packem_shared/clipboard.d-nDPQkZ2H.js";
|
|
2
|
+
export { b as COLOR_BLINDNESS_COMPENSATION, c as COLOR_BLINDNESS_SIMULATION, type C as ColorBlindnessType, type a as ColorMatrix, I as IDENTITY_MATRIX, d as applyColorMatrix, h as hexToRgb, r as rgbToHex, t as transformHexColor } from "../packem_shared/color-matrix.d-sTqnJ23h.js";
|
|
3
|
+
import { D as DOMElement, b as DOMNode, e as StyledLine } from "../packem_shared/dom.d-CLGlidfI.js";
|
|
4
|
+
export { R as ResizeObserver, type f as ResizeObserverCallback, g as ResizeObserverEntry, type h as ScrollState, type S as StickyHeader, i as calculateScroll, j as getPathToRoot, k as getScrollHeight, l as getScrollLeft, m as getScrollTop, n as getScrollWidth, o as isNodeSelectable } from "../packem_shared/dom.d-CLGlidfI.js";
|
|
5
|
+
export { type I as Instance, type K as KittyFlagName, type a as KittyKeyboardOptions, type R as RenderOptions, k as kittyFlags, b as kittyModifiers, r as render } from "../packem_shared/render.d-DjQhFsiN.js";
|
|
6
6
|
import 'node:stream';
|
|
7
7
|
export type { CursorPosition } from "./public/cursor.js";
|
|
8
|
-
import { e as MouseButton, d as MousePosition } from "../packem_shared/mouse-context.d-
|
|
9
|
-
export type { f as MouseAction, a as MouseClickAction, M as MouseContextShape, b as MouseDragAction, g as MouseEvents, c as MouseScrollAction } from "../packem_shared/mouse-context.d-
|
|
8
|
+
import { e as MouseButton, d as MousePosition } from "../packem_shared/mouse-context.d-W-nszUps.js";
|
|
9
|
+
export type { f as MouseAction, a as MouseClickAction, M as MouseContextShape, b as MouseDragAction, g as MouseEvents, c as MouseScrollAction } from "../packem_shared/mouse-context.d-W-nszUps.js";
|
|
10
10
|
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
11
11
|
export { useElementDimensions, useElementPosition } from "./mouse/use-element-position.js";
|
|
12
12
|
export { default as useMouseContext } from "./mouse/use-mouse.js";
|
|
@@ -15,76 +15,73 @@ export { default as useMousePosition } from "./mouse/use-mouse-position.js";
|
|
|
15
15
|
export { type UseOnMouseClickOptions, useOnMouseClick } from "./mouse/use-on-mouse-click.js";
|
|
16
16
|
export { default as useOnMouseHover } from "./mouse/use-on-mouse-hover.js";
|
|
17
17
|
export { default as useOnMouseState } from "./mouse/use-on-mouse-state.js";
|
|
18
|
-
export { R as Range, S as Selection, a as applySelectionToStyledLine, c as comparePoints } from "../packem_shared/selection.d-
|
|
19
|
-
export { type T as TerminalPalette, i as isTerminalPaletteQuerySupported, q as queryTerminalPalette } from "../packem_shared/terminal-palette.d-
|
|
18
|
+
export { R as Range, S as Selection, a as applySelectionToStyledLine, c as comparePoints } from "../packem_shared/selection.d-BSAWa4ey.js";
|
|
19
|
+
export { type T as TerminalPalette, i as isTerminalPaletteQuerySupported, q as queryTerminalPalette } from "../packem_shared/terminal-palette.d-JbWHISW-.js";
|
|
20
20
|
import 'yoga-layout';
|
|
21
21
|
import '@visulima/colorize';
|
|
22
|
-
import "../packem_shared/styles.d-
|
|
22
|
+
import "../packem_shared/styles.d-CKGQFfm4.js";
|
|
23
23
|
import 'type-fest';
|
|
24
|
-
import "../packem_shared/app-context.d-
|
|
24
|
+
import "../packem_shared/app-context.d-DMLw5Nxy.js";
|
|
25
25
|
import 'node:events';
|
|
26
26
|
/**
|
|
27
|
-
* Detect whether a string contains non-ASCII characters that are likely
|
|
28
|
-
* IME (Input Method Editor) composition input — CJK ideographs, Hangul,
|
|
29
|
-
* Thai, Vietnamese diacritics, etc.
|
|
30
|
-
*/
|
|
27
|
+
* Detect whether a string contains non-ASCII characters that are likely
|
|
28
|
+
* IME (Input Method Editor) composition input — CJK ideographs, Hangul,
|
|
29
|
+
* Thai, Vietnamese diacritics, etc.
|
|
30
|
+
*/
|
|
31
31
|
declare const isIMEInput: (data: string) => boolean;
|
|
32
32
|
type IMECompositionBufferOptions = {
|
|
33
33
|
onFlush: (text: string) => void;
|
|
34
34
|
timeout: number;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* Buffers rapid multi-byte character input from IME and flushes the
|
|
38
|
-
* accumulated text after a configurable timeout.
|
|
39
|
-
*/
|
|
37
|
+
* Buffers rapid multi-byte character input from IME and flushes the
|
|
38
|
+
* accumulated text after a configurable timeout.
|
|
39
|
+
*/
|
|
40
40
|
declare class IMECompositionBuffer {
|
|
41
41
|
private buffer;
|
|
42
42
|
private timer;
|
|
43
43
|
private readonly onFlush;
|
|
44
44
|
private readonly timeout;
|
|
45
|
-
constructor({
|
|
46
|
-
onFlush,
|
|
47
|
-
timeout
|
|
48
|
-
}: IMECompositionBufferOptions);
|
|
45
|
+
constructor({ onFlush, timeout }: IMECompositionBufferOptions);
|
|
49
46
|
add(text: string): void;
|
|
50
47
|
flush(): void;
|
|
51
48
|
destroy(): void;
|
|
52
49
|
}
|
|
53
50
|
type Output = {
|
|
54
51
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
* Element height.
|
|
53
|
+
*/
|
|
57
54
|
height: number;
|
|
58
55
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
* Element width.
|
|
57
|
+
*/
|
|
61
58
|
width: number;
|
|
62
59
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
* Element X position relative to Ink output origin.
|
|
61
|
+
*/
|
|
65
62
|
x: number;
|
|
66
63
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
* Element Y position relative to Ink output origin.
|
|
65
|
+
*/
|
|
69
66
|
y: number;
|
|
70
67
|
};
|
|
71
68
|
/**
|
|
72
|
-
* Measure the dimensions of a particular `<Box>` element.
|
|
73
|
-
* Returns an object with `x`, `y`, `width` and `height` properties.
|
|
74
|
-
*/
|
|
69
|
+
* Measure the dimensions of a particular `<Box>` element.
|
|
70
|
+
* Returns an object with `x`, `y`, `width` and `height` properties.
|
|
71
|
+
*/
|
|
75
72
|
declare const measureElement: (node: DOMElement) => Output;
|
|
76
73
|
/**
|
|
77
|
-
* Get an element's inner width (excluding borders).
|
|
78
|
-
*/
|
|
74
|
+
* Get an element's inner width (excluding borders).
|
|
75
|
+
*/
|
|
79
76
|
declare const getInnerWidth: (node: DOMElement) => number;
|
|
80
77
|
/**
|
|
81
|
-
* Get an element's inner height (excluding borders).
|
|
82
|
-
*/
|
|
78
|
+
* Get an element's inner height (excluding borders).
|
|
79
|
+
*/
|
|
83
80
|
declare const getInnerHeight: (node: DOMElement) => number;
|
|
84
81
|
/**
|
|
85
|
-
* Get an element's position and dimensions relative to the root,
|
|
86
|
-
* accounting for scroll offsets of ancestor elements.
|
|
87
|
-
*/
|
|
82
|
+
* Get an element's position and dimensions relative to the root,
|
|
83
|
+
* accounting for scroll offsets of ancestor elements.
|
|
84
|
+
*/
|
|
88
85
|
declare const getBoundingBox: (node: DOMElement) => {
|
|
89
86
|
height: number;
|
|
90
87
|
width: number;
|
|
@@ -92,8 +89,8 @@ declare const getBoundingBox: (node: DOMElement) => {
|
|
|
92
89
|
y: number;
|
|
93
90
|
};
|
|
94
91
|
/**
|
|
95
|
-
* Get how much scroll height was added by stableScrollback.
|
|
96
|
-
*/
|
|
92
|
+
* Get how much scroll height was added by stableScrollback.
|
|
93
|
+
*/
|
|
97
94
|
declare const getAddedScrollHeight: (node: DOMElement) => number;
|
|
98
95
|
type ScrollbarBoundingBox = {
|
|
99
96
|
height: number;
|
|
@@ -137,39 +134,39 @@ declare const calculateScrollbarLayout: (options: {
|
|
|
137
134
|
y: number;
|
|
138
135
|
}) => ScrollbarBoundingBox | undefined;
|
|
139
136
|
/**
|
|
140
|
-
* Get the bounding box of the vertical scrollbar.
|
|
141
|
-
*/
|
|
137
|
+
* Get the bounding box of the vertical scrollbar.
|
|
138
|
+
*/
|
|
142
139
|
declare const getVerticalScrollbarBoundingBox: (node: DOMElement, offset?: {
|
|
143
140
|
x: number;
|
|
144
141
|
y: number;
|
|
145
142
|
}) => ScrollbarBoundingBox | undefined;
|
|
146
143
|
/**
|
|
147
|
-
* Get the bounding box of the horizontal scrollbar.
|
|
148
|
-
*/
|
|
144
|
+
* Get the bounding box of the horizontal scrollbar.
|
|
145
|
+
*/
|
|
149
146
|
declare const getHorizontalScrollbarBoundingBox: (node: DOMElement, offset?: {
|
|
150
147
|
x: number;
|
|
151
148
|
y: number;
|
|
152
149
|
}) => ScrollbarBoundingBox | undefined;
|
|
153
150
|
/**
|
|
154
|
-
* Get the top position of a node relative to a given ancestor.
|
|
155
|
-
* Returns undefined if the ancestor is not in the node's parent chain.
|
|
156
|
-
*
|
|
157
|
-
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
158
|
-
*/
|
|
151
|
+
* Get the top position of a node relative to a given ancestor.
|
|
152
|
+
* Returns undefined if the ancestor is not in the node's parent chain.
|
|
153
|
+
*
|
|
154
|
+
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
155
|
+
*/
|
|
159
156
|
declare const getRelativeTop: (node: DOMElement, ancestor?: DOMElement) => number | undefined;
|
|
160
157
|
/**
|
|
161
|
-
* Get the left position of a node relative to a given ancestor.
|
|
162
|
-
* Returns undefined if the ancestor is not in the node's parent chain.
|
|
163
|
-
*
|
|
164
|
-
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
165
|
-
*/
|
|
158
|
+
* Get the left position of a node relative to a given ancestor.
|
|
159
|
+
* Returns undefined if the ancestor is not in the node's parent chain.
|
|
160
|
+
*
|
|
161
|
+
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
162
|
+
*/
|
|
166
163
|
declare const getRelativeLeft: (node: DOMElement, ancestor?: DOMElement) => number | undefined;
|
|
167
164
|
/**
|
|
168
|
-
* A text fragment from the layout tree with its position and dimensions.
|
|
169
|
-
* Used by `processLayout` for text extraction and selection.
|
|
170
|
-
*
|
|
171
|
-
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
172
|
-
*/
|
|
165
|
+
* A text fragment from the layout tree with its position and dimensions.
|
|
166
|
+
* Used by `processLayout` for text extraction and selection.
|
|
167
|
+
*
|
|
168
|
+
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
169
|
+
*/
|
|
173
170
|
type TextFragment = {
|
|
174
171
|
height: number;
|
|
175
172
|
node: DOMElement;
|
|
@@ -181,26 +178,26 @@ type TextFragment = {
|
|
|
181
178
|
y: number;
|
|
182
179
|
};
|
|
183
180
|
/**
|
|
184
|
-
* Get the text content of a DOM node (text node value or squashed children).
|
|
185
|
-
*/
|
|
181
|
+
* Get the text content of a DOM node (text node value or squashed children).
|
|
182
|
+
*/
|
|
186
183
|
declare const getText: (node: DOMNode) => string;
|
|
187
184
|
/**
|
|
188
|
-
* Walk the layout tree to collect all text fragments in document order,
|
|
189
|
-
* with their positions adjusted for borders and flex layout.
|
|
190
|
-
*
|
|
191
|
-
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
192
|
-
*/
|
|
185
|
+
* Walk the layout tree to collect all text fragments in document order,
|
|
186
|
+
* with their positions adjusted for borders and flex layout.
|
|
187
|
+
*
|
|
188
|
+
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
189
|
+
*/
|
|
193
190
|
declare const collectSortedFragments: (node: DOMNode) => {
|
|
194
191
|
fragments: TextFragment[];
|
|
195
192
|
removedHorizontal: number;
|
|
196
193
|
removedVertical: number;
|
|
197
194
|
};
|
|
198
195
|
/**
|
|
199
|
-
* Generic layout tree walker with callbacks for text, newline, and space events.
|
|
200
|
-
* Used by selection.ts for extracting text from the DOM tree with proper layout positioning.
|
|
201
|
-
*
|
|
202
|
-
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
203
|
-
*/
|
|
196
|
+
* Generic layout tree walker with callbacks for text, newline, and space events.
|
|
197
|
+
* Used by selection.ts for extracting text from the DOM tree with proper layout positioning.
|
|
198
|
+
*
|
|
199
|
+
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
200
|
+
*/
|
|
204
201
|
type LayoutCallbacks<T> = {
|
|
205
202
|
initialState: () => T;
|
|
206
203
|
onNewline: (count: number, state: T) => void;
|
|
@@ -213,37 +210,37 @@ declare const processLayout: <T>(node: DOMNode, callbacks: LayoutCallbacks<T>) =
|
|
|
213
210
|
};
|
|
214
211
|
type StringWidthFunction = (text: string) => number;
|
|
215
212
|
/**
|
|
216
|
-
* Enable or disable the StyledLine tokenization cache at runtime.
|
|
217
|
-
* Disabling clears the existing cache.
|
|
218
|
-
*/
|
|
213
|
+
* Enable or disable the StyledLine tokenization cache at runtime.
|
|
214
|
+
* Disabling clears the existing cache.
|
|
215
|
+
*/
|
|
219
216
|
declare const setEnableStyledLineCache: (enabled: boolean) => void;
|
|
220
217
|
/**
|
|
221
|
-
* Clear only the StyledLine tokenization cache.
|
|
222
|
-
*/
|
|
218
|
+
* Clear only the StyledLine tokenization cache.
|
|
219
|
+
*/
|
|
223
220
|
declare const clearStyledLineCache: () => void;
|
|
224
221
|
/**
|
|
225
|
-
* Replace the string width function used for text measurement.
|
|
226
|
-
* Useful for terminals with non-standard character widths.
|
|
227
|
-
* Clears the measurement cache when called.
|
|
228
|
-
*/
|
|
222
|
+
* Replace the string width function used for text measurement.
|
|
223
|
+
* Useful for terminals with non-standard character widths.
|
|
224
|
+
* Clears the measurement cache when called.
|
|
225
|
+
*/
|
|
229
226
|
declare const setStringWidthFunction: (function_: StringWidthFunction) => void;
|
|
230
227
|
/**
|
|
231
|
-
* Clear the string width measurement cache. Call this if the terminal
|
|
232
|
-
* environment changes in a way that affects character widths.
|
|
233
|
-
*/
|
|
228
|
+
* Clear the string width measurement cache. Call this if the terminal
|
|
229
|
+
* environment changes in a way that affects character widths.
|
|
230
|
+
*/
|
|
234
231
|
declare const clearStringWidthCache: () => void;
|
|
235
232
|
/**
|
|
236
|
-
* Get the visual width of a single character, with caching and error handling.
|
|
237
|
-
*
|
|
238
|
-
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
239
|
-
*/
|
|
233
|
+
* Get the visual width of a single character, with caching and error handling.
|
|
234
|
+
*
|
|
235
|
+
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
236
|
+
*/
|
|
240
237
|
declare const inkCharacterWidth: (text: string) => number;
|
|
241
238
|
/**
|
|
242
|
-
* Convert a text string to a StyledLine, with caching.
|
|
243
|
-
* Uses the direct text → StyledLine pipeline (handles combining chars,
|
|
244
|
-
* tabs, regional indicators, ANSI codes, etc.) without intermediate
|
|
245
|
-
* StyledChar objects.
|
|
246
|
-
*/
|
|
239
|
+
* Convert a text string to a StyledLine, with caching.
|
|
240
|
+
* Uses the direct text → StyledLine pipeline (handles combining chars,
|
|
241
|
+
* tabs, regional indicators, ANSI codes, etc.) without intermediate
|
|
242
|
+
* StyledChar objects.
|
|
243
|
+
*/
|
|
247
244
|
declare const toStyledLine: (text: string) => StyledLine;
|
|
248
245
|
type SgrMouseEvent = {
|
|
249
246
|
action: "press" | "release";
|
|
@@ -268,24 +265,16 @@ type SgrMouseEvent = {
|
|
|
268
265
|
y: number;
|
|
269
266
|
};
|
|
270
267
|
/**
|
|
271
|
-
* Parse an SGR 1006 mouse escape sequence into a structured event.
|
|
272
|
-
*
|
|
273
|
-
* Returns `undefined` if the input is not a valid SGR mouse sequence.
|
|
274
|
-
*/
|
|
268
|
+
* Parse an SGR 1006 mouse escape sequence into a structured event.
|
|
269
|
+
*
|
|
270
|
+
* Returns `undefined` if the input is not a valid SGR mouse sequence.
|
|
271
|
+
*/
|
|
275
272
|
declare const parseSgrMouse: (input: string) => SgrMouseEvent | undefined;
|
|
276
|
-
declare const Fullscreen: ({
|
|
277
|
-
children
|
|
278
|
-
}: PropsWithChildren) => React.JSX.Element;
|
|
273
|
+
declare const Fullscreen: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
279
274
|
/**
|
|
280
|
-
* Determines if the mouse position is intersecting with the element's layout bounds.
|
|
281
|
-
*/
|
|
282
|
-
declare const isIntersecting: ({
|
|
283
|
-
element,
|
|
284
|
-
mouse: {
|
|
285
|
-
x,
|
|
286
|
-
y
|
|
287
|
-
}
|
|
288
|
-
}: {
|
|
275
|
+
* Determines if the mouse position is intersecting with the element's layout bounds.
|
|
276
|
+
*/
|
|
277
|
+
declare const isIntersecting: ({ element, mouse: { x, y } }: {
|
|
289
278
|
element: {
|
|
290
279
|
height: number;
|
|
291
280
|
left: number;
|
|
@@ -294,14 +283,12 @@ declare const isIntersecting: ({
|
|
|
294
283
|
};
|
|
295
284
|
mouse: MousePosition;
|
|
296
285
|
}) => boolean;
|
|
297
|
-
declare const MouseProvider: ({
|
|
298
|
-
children
|
|
299
|
-
}: PropsWithChildren) => React.JSX.Element;
|
|
286
|
+
declare const MouseProvider: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
300
287
|
type RenderToStringOptions = {
|
|
301
288
|
/**
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
289
|
+
* Width of the virtual terminal in columns.
|
|
290
|
+
* @default 80
|
|
291
|
+
*/
|
|
305
292
|
columns?: number;
|
|
306
293
|
};
|
|
307
294
|
/**
|
|
@@ -340,12 +327,12 @@ type CharOffsetRange = {
|
|
|
340
327
|
};
|
|
341
328
|
type CharOffsetMap = Map<DOMNode, CharOffsetRange>;
|
|
342
329
|
/**
|
|
343
|
-
* Squash text nodes while building a character offset map.
|
|
344
|
-
* Each DOM node is mapped to its start/end character offsets in the resulting string.
|
|
345
|
-
* Used for selection text extraction and cursor position calculation.
|
|
346
|
-
*
|
|
347
|
-
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
348
|
-
*/
|
|
330
|
+
* Squash text nodes while building a character offset map.
|
|
331
|
+
* Each DOM node is mapped to its start/end character offsets in the resulting string.
|
|
332
|
+
* Used for selection text extraction and cursor position calculation.
|
|
333
|
+
*
|
|
334
|
+
* Ported from jacob314/ink fork (Google LLC, Apache-2.0).
|
|
335
|
+
*/
|
|
349
336
|
declare const squashTextNodesWithMap: (node: DOMElement, map: CharOffsetMap, offsetRef: {
|
|
350
337
|
current: number;
|
|
351
338
|
}) => string;
|
package/dist/ink/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{clearOsc52 as o,isOsc52Supported as r,writeOsc52 as a}from"../packem_shared/clearOsc52-BUpnQOav.js";import{COLOR_BLINDNESS_COMPENSATION as l,COLOR_BLINDNESS_SIMULATION as i,IDENTITY_MATRIX as n,applyColorMatrix as u,hexToRgb as f,rgbToHex as p,transformHexColor as c}from"../packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js";import{g as d,i as x}from"../packem_shared/dom-rphpG0kf.js";import{IMECompositionBuffer as S,isIMEInput as h}from"../packem_shared/IMECompositionBuffer-VhC9HRCv.js";import{kittyFlags as M,kittyModifiers as O}from"../packem_shared/kittyFlags-g8ALyoCU.js";import{processLayout as I}from"../packem_shared/processLayout-I83k6vXE.js";import{c as b,a as C,b as E,g as R,d as N,e as B,f as P,h as H,i as v,j as W,k,l as A,R as _}from"../packem_shared/measure-element-D4M9iSYp.js";import{c as F,a as z,i as q,s as w,b as j,t as Q}from"../packem_shared/measure-text-B7juNq4Y.js";import{default as V}from"../packem_shared/render-
|
|
1
|
+
import{clearOsc52 as o,isOsc52Supported as r,writeOsc52 as a}from"../packem_shared/clearOsc52-BUpnQOav.js";import{COLOR_BLINDNESS_COMPENSATION as l,COLOR_BLINDNESS_SIMULATION as i,IDENTITY_MATRIX as n,applyColorMatrix as u,hexToRgb as f,rgbToHex as p,transformHexColor as c}from"../packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js";import{g as d,i as x}from"../packem_shared/dom-rphpG0kf.js";import{IMECompositionBuffer as S,isIMEInput as h}from"../packem_shared/IMECompositionBuffer-VhC9HRCv.js";import{kittyFlags as M,kittyModifiers as O}from"../packem_shared/kittyFlags-g8ALyoCU.js";import{processLayout as I}from"../packem_shared/processLayout-I83k6vXE.js";import{c as b,a as C,b as E,g as R,d as N,e as B,f as P,h as H,i as v,j as W,k,l as A,R as _}from"../packem_shared/measure-element-D4M9iSYp.js";import{c as F,a as z,i as q,s as w,b as j,t as Q}from"../packem_shared/measure-text-B7juNq4Y.js";import{default as V}from"../packem_shared/render-CvhjGwOg.js";import{default as Y}from"../packem_shared/renderToString-B1LgWcJe.js";import{default as J,ResizeObserverEntry as K}from"../packem_shared/ResizeObserver-BI9bDy-j.js";import{calculateScroll as $,getScrollHeight as ee,getScrollLeft as te,getScrollTop as oe,getScrollWidth as re}from"../packem_shared/calculateScroll-D4Y_JR4H.js";import{Range as se,Selection as le,applySelectionToStyledLine as ie,comparePoints as ne}from"../packem_shared/Range-BsVYNWtg.js";import{squashTextNodesWithMap as fe}from"../packem_shared/squashTextNodesWithMap-BmUSBPfc.js";import{isTerminalPaletteQuerySupported as ce,queryTerminalPalette as me}from"../packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js";import{wrapOrTruncateStyledLine as xe}from"../packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js";import{default as Se}from"../packem_shared/Fullscreen-BRhuBLBh.js";import{default as Te}from"../packem_shared/MouseProvider-DOcWCRVq.js";import{default as Oe}from"../packem_shared/isIntersecting-Bo2npvMR.js";import{default as Ie}from"./mouse/use-mouse-action.js";import{default as be}from"./mouse/use-mouse.js";import{default as Ee}from"./mouse/use-mouse-position.js";import{default as Ne}from"./mouse/use-on-mouse-hover.js";import{default as Pe}from"./mouse/use-on-mouse-state.js";import{d as ve}from"../packem_shared/ansi-parser-DlgLtOYO.js";import{useElementDimensions as ke,useElementPosition as Ae}from"./mouse/use-element-position.js";import{useOnMouseClick as De}from"./mouse/use-on-mouse-click.js";export{l as COLOR_BLINDNESS_COMPENSATION,i as COLOR_BLINDNESS_SIMULATION,Se as Fullscreen,n as IDENTITY_MATRIX,S as IMECompositionBuffer,Te as MouseProvider,se as Range,J as ResizeObserver,K as ResizeObserverEntry,le as Selection,u as applyColorMatrix,ie as applySelectionToStyledLine,$ as calculateScroll,b as calculateScrollbarLayout,C as calculateScrollbarThumb,o as clearOsc52,F as clearStringWidthCache,z as clearStyledLineCache,E as collectSortedFragments,ne as comparePoints,R as getAddedScrollHeight,N as getBoundingBox,B as getHorizontalScrollbarBoundingBox,P as getInnerHeight,H as getInnerWidth,d as getPathToRoot,v as getRelativeLeft,W as getRelativeTop,ee as getScrollHeight,te as getScrollLeft,oe as getScrollTop,re as getScrollWidth,k as getText,A as getVerticalScrollbarBoundingBox,f as hexToRgb,q as inkCharacterWidth,h as isIMEInput,Oe as isIntersecting,x as isNodeSelectable,r as isOsc52Supported,ce as isTerminalPaletteQuerySupported,M as kittyFlags,O as kittyModifiers,_ as measureElement,ve as parseSgrMouse,I as processLayout,me as queryTerminalPalette,V as render,Y as renderToString,p as rgbToHex,w as setEnableStyledLineCache,j as setStringWidthFunction,fe as squashTextNodesWithMap,Q as toStyledLine,c as transformHexColor,ke as useElementDimensions,Ae as useElementPosition,Ie as useMouseAction,be as useMouseContext,Ee as useMousePosition,De as useOnMouseClick,Ne as useOnMouseHover,Pe as useOnMouseState,xe as wrapOrTruncateStyledLine,a as writeOsc52};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { D as DOMElement } from "../../packem_shared/dom.d-
|
|
2
|
+
import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
|
|
3
3
|
import 'yoga-layout';
|
|
4
4
|
import "../public/cursor.js";
|
|
5
5
|
import '@visulima/colorize';
|
|
6
|
-
import "../../packem_shared/styles.d-
|
|
6
|
+
import "../../packem_shared/styles.d-CKGQFfm4.js";
|
|
7
7
|
import 'type-fest';
|
|
8
8
|
declare const getElementPosition: (node: DOMElement | null) => {
|
|
9
9
|
left: number;
|
|
@@ -14,15 +14,15 @@ declare const getElementDimensions: (node: DOMElement | null) => {
|
|
|
14
14
|
width: number;
|
|
15
15
|
} | undefined;
|
|
16
16
|
/**
|
|
17
|
-
* Stateful hook to provide the absolute position of the referenced element.
|
|
18
|
-
*/
|
|
17
|
+
* Stateful hook to provide the absolute position of the referenced element.
|
|
18
|
+
*/
|
|
19
19
|
declare const useElementPosition: (ref: RefObject<DOMElement | null>, deps?: unknown[]) => {
|
|
20
20
|
left: number;
|
|
21
21
|
top: number;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Stateful hook to provide the dimensions of the referenced element.
|
|
25
|
-
*/
|
|
24
|
+
* Stateful hook to provide the dimensions of the referenced element.
|
|
25
|
+
*/
|
|
26
26
|
declare const useElementDimensions: (ref: RefObject<DOMElement | null>, deps?: unknown[]) => {
|
|
27
27
|
height: number;
|
|
28
28
|
width: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as MouseClickAction, b as MouseDragAction, c as MouseScrollAction } from "../../packem_shared/mouse-context.d-
|
|
1
|
+
import { a as MouseClickAction, b as MouseDragAction, c as MouseScrollAction } from "../../packem_shared/mouse-context.d-W-nszUps.js";
|
|
2
2
|
import 'node:events';
|
|
3
3
|
import 'react';
|
|
4
4
|
declare const useMouseAction: () => MouseClickAction | MouseDragAction | MouseScrollAction | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MouseContextShape } from "../../packem_shared/mouse-context.d-
|
|
1
|
+
import { M as MouseContextShape } from "../../packem_shared/mouse-context.d-W-nszUps.js";
|
|
2
2
|
import 'node:events';
|
|
3
3
|
import 'react';
|
|
4
4
|
declare const useMouseContext: () => MouseContextShape;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { D as DOMElement } from "../../packem_shared/dom.d-
|
|
3
|
-
import { e as MouseButton } from "../../packem_shared/mouse-context.d-
|
|
2
|
+
import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
|
|
3
|
+
import { e as MouseButton } from "../../packem_shared/mouse-context.d-W-nszUps.js";
|
|
4
4
|
import 'yoga-layout';
|
|
5
5
|
import "../public/cursor.js";
|
|
6
6
|
import '@visulima/colorize';
|
|
7
|
-
import "../../packem_shared/styles.d-
|
|
7
|
+
import "../../packem_shared/styles.d-CKGQFfm4.js";
|
|
8
8
|
import 'type-fest';
|
|
9
9
|
import 'node:events';
|
|
10
10
|
type UseOnMouseClickOptions = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { D as DOMElement } from "../../packem_shared/dom.d-
|
|
2
|
+
import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
|
|
3
3
|
import 'yoga-layout';
|
|
4
4
|
import "../public/cursor.js";
|
|
5
5
|
import '@visulima/colorize';
|
|
6
|
-
import "../../packem_shared/styles.d-
|
|
6
|
+
import "../../packem_shared/styles.d-CKGQFfm4.js";
|
|
7
7
|
import 'type-fest';
|
|
8
8
|
declare const useOnMouseHover: (ref: RefObject<DOMElement | null>, onChange: (event: boolean) => void) => void;
|
|
9
9
|
export { useOnMouseHover as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { D as DOMElement } from "../../packem_shared/dom.d-
|
|
2
|
+
import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
|
|
3
3
|
import 'yoga-layout';
|
|
4
4
|
import "../public/cursor.js";
|
|
5
5
|
import '@visulima/colorize';
|
|
6
|
-
import "../../packem_shared/styles.d-
|
|
6
|
+
import "../../packem_shared/styles.d-CKGQFfm4.js";
|
|
7
7
|
import 'type-fest';
|
|
8
8
|
declare const useOnMouseState: (ref: RefObject<DOMElement | null>) => {
|
|
9
9
|
clicking: boolean;
|
|
@@ -3,29 +3,29 @@ type CursorPosition = {
|
|
|
3
3
|
y: number;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
|
-
* Declarative cursor shape, mapped to DECSCUSR (`CSI Ps SP q`).
|
|
7
|
-
*
|
|
8
|
-
* `"default"` restores the terminal's user-configured shape (`Ps=0`).
|
|
9
|
-
* Steady variants are non-blinking; `blinking-*` variants opt into blink.
|
|
10
|
-
*/
|
|
6
|
+
* Declarative cursor shape, mapped to DECSCUSR (`CSI Ps SP q`).
|
|
7
|
+
*
|
|
8
|
+
* `"default"` restores the terminal's user-configured shape (`Ps=0`).
|
|
9
|
+
* Steady variants are non-blinking; `blinking-*` variants opt into blink.
|
|
10
|
+
*/
|
|
11
11
|
type CursorShape = "bar" | "blinking-bar" | "blinking-block" | "blinking-underline" | "block" | "default" | "underline";
|
|
12
12
|
/**
|
|
13
|
-
* Build the DECSCUSR escape sequence for a cursor shape.
|
|
14
|
-
*/
|
|
13
|
+
* Build the DECSCUSR escape sequence for a cursor shape.
|
|
14
|
+
*/
|
|
15
15
|
declare const buildCursorShapeSequence: (shape: CursorShape) => string;
|
|
16
16
|
/**
|
|
17
|
-
* Compare two cursor positions. Returns true if they differ.
|
|
18
|
-
*/
|
|
17
|
+
* Compare two cursor positions. Returns true if they differ.
|
|
18
|
+
*/
|
|
19
19
|
declare const cursorPositionChanged: (a: CursorPosition | undefined, b: CursorPosition | undefined) => boolean;
|
|
20
20
|
/**
|
|
21
|
-
* Build escape sequence to move cursor from bottom of output to the target position and show it.
|
|
22
|
-
* Assumes cursor is at (col 0, line visibleLineCount) — i.e. just after the last output line.
|
|
23
|
-
*/
|
|
21
|
+
* Build escape sequence to move cursor from bottom of output to the target position and show it.
|
|
22
|
+
* Assumes cursor is at (col 0, line visibleLineCount) — i.e. just after the last output line.
|
|
23
|
+
*/
|
|
24
24
|
declare const buildCursorSuffix: (visibleLineCount: number, cursorPosition: CursorPosition | undefined) => string;
|
|
25
25
|
/**
|
|
26
|
-
* Build escape sequence to move cursor from previousCursorPosition back to the bottom of output.
|
|
27
|
-
* This must be done before eraseLines or any operation that assumes cursor is at the bottom.
|
|
28
|
-
*/
|
|
26
|
+
* Build escape sequence to move cursor from previousCursorPosition back to the bottom of output.
|
|
27
|
+
* This must be done before eraseLines or any operation that assumes cursor is at the bottom.
|
|
28
|
+
*/
|
|
29
29
|
declare const buildReturnToBottom: (previousLineCount: number, previousCursorPosition: CursorPosition | undefined) => string;
|
|
30
30
|
type CursorOnlyInput = {
|
|
31
31
|
cursorPosition: CursorPosition | undefined;
|
|
@@ -35,13 +35,13 @@ type CursorOnlyInput = {
|
|
|
35
35
|
visibleLineCount: number;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
* Build the escape sequence for cursor-only updates (output unchanged, cursor moved).
|
|
39
|
-
* Hides cursor if it was previously shown, returns to bottom, then repositions.
|
|
40
|
-
*/
|
|
38
|
+
* Build the escape sequence for cursor-only updates (output unchanged, cursor moved).
|
|
39
|
+
* Hides cursor if it was previously shown, returns to bottom, then repositions.
|
|
40
|
+
*/
|
|
41
41
|
declare const buildCursorOnlySequence: (input: CursorOnlyInput) => string;
|
|
42
42
|
/**
|
|
43
|
-
* Build the prefix that hides cursor and returns to bottom before erasing or rewriting.
|
|
44
|
-
* Returns empty string if cursor was not shown.
|
|
45
|
-
*/
|
|
43
|
+
* Build the prefix that hides cursor and returns to bottom before erasing or rewriting.
|
|
44
|
+
* Returns empty string if cursor was not shown.
|
|
45
|
+
*/
|
|
46
46
|
declare const buildReturnToBottomPrefix: (cursorWasShown: boolean, previousLineCount: number, previousCursorPosition: CursorPosition | undefined) => string;
|
|
47
47
|
export { type CursorOnlyInput, type CursorPosition, type CursorShape, buildCursorOnlySequence, buildCursorShapeSequence, buildCursorSuffix, buildReturnToBottom, buildReturnToBottomPrefix, cursorPositionChanged };
|
package/dist/ink/public/dom.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { C as CursorAnchorRef, a as CursorMarker, D as DOMElement, b as DOMNode, c as DOMNodeAttribute, E as ElementNames, N as NodeNames, S as StickyHeader, T as TextName, d as TextNode } from "../../packem_shared/dom.d-
|
|
1
|
+
export type { C as CursorAnchorRef, a as CursorMarker, D as DOMElement, b as DOMNode, c as DOMNodeAttribute, E as ElementNames, N as NodeNames, S as StickyHeader, T as TextName, d as TextNode } from "../../packem_shared/dom.d-CLGlidfI.js";
|
|
2
2
|
import 'yoga-layout';
|
|
3
3
|
import "./cursor.js";
|
|
4
4
|
import '@visulima/colorize';
|
|
5
|
-
import "../../packem_shared/styles.d-
|
|
5
|
+
import "../../packem_shared/styles.d-CKGQFfm4.js";
|
|
6
6
|
import 'type-fest';
|
|
@@ -5,34 +5,24 @@ type BundledLanguage = '1c' | '1c-query' | 'abap' | 'actionscript-3' | 'ada' | '
|
|
|
5
5
|
type BundledTheme = 'andromeeda' | 'aurora-x' | 'ayu-dark' | 'ayu-light' | 'ayu-mirage' | 'catppuccin-frappe' | 'catppuccin-latte' | 'catppuccin-macchiato' | 'catppuccin-mocha' | 'dark-plus' | 'dracula' | 'dracula-soft' | 'everforest-dark' | 'everforest-light' | 'github-dark' | 'github-dark-default' | 'github-dark-dimmed' | 'github-dark-high-contrast' | 'github-light' | 'github-light-default' | 'github-light-high-contrast' | 'gruvbox-dark-hard' | 'gruvbox-dark-medium' | 'gruvbox-dark-soft' | 'gruvbox-light-hard' | 'gruvbox-light-medium' | 'gruvbox-light-soft' | 'horizon' | 'horizon-bright' | 'houston' | 'kanagawa-dragon' | 'kanagawa-lotus' | 'kanagawa-wave' | 'laserwave' | 'light-plus' | 'material-theme' | 'material-theme-darker' | 'material-theme-lighter' | 'material-theme-ocean' | 'material-theme-palenight' | 'min-dark' | 'min-light' | 'monokai' | 'night-owl' | 'night-owl-light' | 'nord' | 'one-dark-pro' | 'one-light' | 'plastic' | 'poimandres' | 'red' | 'rose-pine' | 'rose-pine-dawn' | 'rose-pine-moon' | 'slack-dark' | 'slack-ochin' | 'snazzy-light' | 'solarized-dark' | 'solarized-light' | 'synthwave-84' | 'tokyo-night' | 'vesper' | 'vitesse-black' | 'vitesse-dark' | 'vitesse-light';
|
|
6
6
|
type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
* Importing this function will bundle all languages and themes.
|
|
12
|
-
* @see https://shiki.style/guide/bundles#shiki-bundle-full
|
|
13
|
-
*
|
|
14
|
-
* For granular control over the bundle, check:
|
|
15
|
-
* @see https://shiki.style/guide/bundles#fine-grained-bundle
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Get cached tokens or compute and cache them.
|
|
19
|
-
*/
|
|
8
|
+
* Get cached tokens or compute and cache them.
|
|
9
|
+
*/
|
|
20
10
|
declare const getCachedTokens: (highlighter: Highlighter, code: string, lang: string, theme: string) => TokensResult;
|
|
21
11
|
/**
|
|
22
|
-
* Resolve a language name to a canonical name, handling aliases.
|
|
23
|
-
*/
|
|
12
|
+
* Resolve a language name to a canonical name, handling aliases.
|
|
13
|
+
*/
|
|
24
14
|
declare const resolveLanguage: (lang: string) => string;
|
|
25
15
|
/**
|
|
26
|
-
* Check if a language is supported.
|
|
27
|
-
*/
|
|
16
|
+
* Check if a language is supported.
|
|
17
|
+
*/
|
|
28
18
|
declare const isLanguageSupported: (lang: string) => boolean;
|
|
29
19
|
/**
|
|
30
|
-
* Get or create the singleton Shiki highlighter, optionally loading languages and themes.
|
|
31
|
-
*/
|
|
20
|
+
* Get or create the singleton Shiki highlighter, optionally loading languages and themes.
|
|
21
|
+
*/
|
|
32
22
|
declare const getHighlighter: (languages?: string[], theme?: string) => Promise<Highlighter>;
|
|
33
23
|
/**
|
|
34
|
-
* Dispose the singleton highlighter, freeing resources.
|
|
35
|
-
*/
|
|
24
|
+
* Dispose the singleton highlighter, freeing resources.
|
|
25
|
+
*/
|
|
36
26
|
declare const disposeHighlighter: () => void;
|
|
37
27
|
type TokenRenderOptions = {
|
|
38
28
|
readonly highlightLines?: ReadonlySet<number>;
|
|
@@ -40,15 +30,15 @@ type TokenRenderOptions = {
|
|
|
40
30
|
readonly startLine?: number;
|
|
41
31
|
};
|
|
42
32
|
/**
|
|
43
|
-
* Render a single ThemedToken as a styled <Text> element.
|
|
44
|
-
*/
|
|
33
|
+
* Render a single ThemedToken as a styled <Text> element.
|
|
34
|
+
*/
|
|
45
35
|
declare const renderToken: (token: ThemedToken, key: number) => ReactElement;
|
|
46
36
|
/**
|
|
47
|
-
* Render a single line of tokens as inline React elements (no Box wrapper).
|
|
48
|
-
*/
|
|
37
|
+
* Render a single line of tokens as inline React elements (no Box wrapper).
|
|
38
|
+
*/
|
|
49
39
|
declare const renderTokenLine: (tokens: ThemedToken[]) => ReactElement;
|
|
50
40
|
/**
|
|
51
|
-
* Convert Shiki token lines to Ink React elements with optional line numbers.
|
|
52
|
-
*/
|
|
41
|
+
* Convert Shiki token lines to Ink React elements with optional line numbers.
|
|
42
|
+
*/
|
|
53
43
|
declare const tokenLinesToElements: (lines: ThemedToken[][], options?: TokenRenderOptions) => ReactElement;
|
|
54
44
|
export { type TokenRenderOptions, disposeHighlighter, getCachedTokens, getHighlighter, isLanguageSupported, renderToken, renderTokenLine, resolveLanguage, tokenLinesToElements };
|