@alchemy.run/sigil 0.0.0-alpha.9 → 0.1.0-alpha.1
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/THIRD_PARTY_NOTICES.md +28 -0
- package/dist/ansi.d.ts +53 -53
- package/dist/capabilities.js +1 -1
- package/dist/{color-policy-DlrZXC0f.js → color-policy-BAC9-TZX.js} +15 -1
- package/dist/color.d.ts +8 -8
- package/dist/{devtools-DbthxoD1.js → devtools-B_2SDRaO.js} +3 -0
- package/dist/index.d.ts +39 -37
- package/dist/index.js +189 -181
- package/dist/jsx-dev-runtime.d.ts +3 -0
- package/dist/jsx-dev-runtime.js +7 -0
- package/dist/jsx-runtime-BS_OosoY.js +42 -0
- package/dist/jsx-runtime.d.ts +2 -0
- package/dist/jsx-runtime.js +8 -0
- package/dist/react-CeO3oT_g.js +394 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +50 -0
- package/dist/rolldown-runtime-BPOCksWG.js +24 -0
- package/dist/router.d.ts +26 -26
- package/dist/router.js +45 -42
- package/dist/{session-Cg6STjFV.js → session-DDQ5V300.js} +34 -11
- package/dist/terminal.d.ts +9 -10
- package/dist/terminal.js +1 -1
- package/dist/use-focus-B1WVNBQm.js +8383 -0
- package/package.json +27 -15
- package/src/ansi/strip.ts +2 -2
- package/src/capabilities/query.ts +22 -0
- package/src/devtools.ts +5 -0
- package/src/hooks/use-window-size.ts +10 -3
- package/src/input-parser.ts +31 -11
- package/src/jsx-dev-runtime.ts +3 -0
- package/src/jsx-runtime.ts +6 -0
- package/src/react.ts +53 -0
- package/src/reconciler.ts +51 -0
- package/src/terminal/input.ts +11 -5
- package/dist/use-focus-Basd0ksv.js +0 -1337
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -179,3 +179,31 @@ Licensed under the MIT License (text above).
|
|
|
179
179
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
180
180
|
|
|
181
181
|
Licensed under the MIT License (text above).
|
|
182
|
+
|
|
183
|
+
## React
|
|
184
|
+
|
|
185
|
+
The published `dist/` bundles [React](https://github.com/facebook/react),
|
|
186
|
+
`react-reconciler`, and `scheduler` so the renderer owns a single React
|
|
187
|
+
instance.
|
|
188
|
+
|
|
189
|
+
MIT License
|
|
190
|
+
|
|
191
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
192
|
+
|
|
193
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
194
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
195
|
+
in the Software without restriction, including without limitation the rights
|
|
196
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
197
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
198
|
+
furnished to do so, subject to the following conditions:
|
|
199
|
+
|
|
200
|
+
The above copyright notice and this permission notice shall be included in all
|
|
201
|
+
copies or substantial portions of the Software.
|
|
202
|
+
|
|
203
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
204
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
205
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
206
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
207
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
208
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
209
|
+
SOFTWARE.
|
package/dist/ansi.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { A as exitAlternativeScreen, C as enableBracketedPaste, D as eraseLines,
|
|
|
3
3
|
import { a as queryClipboard, c as setTerminalProgress, d as tmuxPassthrough, i as notify, l as setWindowTitle, n as TerminalProgressState, o as setClipboard, r as clearClipboard, s as setPointerShape, t as ClipboardSelection, u as setWorkingDirectory } from "./osc-Cn0fw77g.js";
|
|
4
4
|
import { _ as tokenize, a as StyledChar, c as diffAnsiCodes, d as getLinkStartCode, f as isIntensityCode, g as styledCharsToString, h as styledCharsFromTokens, i as ControlToken, l as endCodesSet, m as reduceAnsiCodesIncremental, n as AnsiToken, o as Token, p as reduceAnsiCodes, r as CharToken, s as ansiCodesToString, t as AnsiCode, u as getEndCode, v as undoAnsiCodes } from "./tokenize-Dx1y_l5H.js";
|
|
5
5
|
//#region src/ansi/sgr.d.ts
|
|
6
|
-
type StylePair = {
|
|
6
|
+
export type StylePair = {
|
|
7
7
|
readonly open: string;
|
|
8
8
|
readonly close: string;
|
|
9
9
|
};
|
|
@@ -58,39 +58,39 @@ declare const bgColorCodes: {
|
|
|
58
58
|
readonly bgCyanBright: readonly [106, 49];
|
|
59
59
|
readonly bgWhiteBright: readonly [107, 49];
|
|
60
60
|
};
|
|
61
|
-
type ModifierName = keyof typeof modifierCodes;
|
|
62
|
-
type ForegroundColorName = keyof typeof colorCodes;
|
|
63
|
-
type BackgroundColorName = keyof typeof bgColorCodes;
|
|
64
|
-
type StyleName = ModifierName | ForegroundColorName | BackgroundColorName;
|
|
65
|
-
declare const modifierNames: ModifierName[];
|
|
66
|
-
declare const foregroundColorNames: ForegroundColorName[];
|
|
67
|
-
declare const backgroundColorNames: BackgroundColorName[];
|
|
61
|
+
export type ModifierName = keyof typeof modifierCodes;
|
|
62
|
+
export type ForegroundColorName = keyof typeof colorCodes;
|
|
63
|
+
export type BackgroundColorName = keyof typeof bgColorCodes;
|
|
64
|
+
export type StyleName = ModifierName | ForegroundColorName | BackgroundColorName;
|
|
65
|
+
export declare const modifierNames: ModifierName[];
|
|
66
|
+
export declare const foregroundColorNames: ForegroundColorName[];
|
|
67
|
+
export declare const backgroundColorNames: BackgroundColorName[];
|
|
68
68
|
/**
|
|
69
69
|
Named SGR styles as `{open, close}` escape sequence pairs.
|
|
70
70
|
*/
|
|
71
|
-
declare const styles: Record<StyleName, StylePair>;
|
|
71
|
+
export declare const styles: Record<StyleName, StylePair>;
|
|
72
72
|
/**
|
|
73
73
|
Raw SGR code numbers: open code → close code.
|
|
74
74
|
*/
|
|
75
|
-
declare const codes: ReadonlyMap<number, number>;
|
|
76
|
-
declare const foreground: {
|
|
75
|
+
export declare const codes: ReadonlyMap<number, number>;
|
|
76
|
+
export declare const foreground: {
|
|
77
77
|
close: string;
|
|
78
78
|
ansi: (code: number) => string;
|
|
79
79
|
ansi256: (code: number) => string;
|
|
80
80
|
ansi16m: (red: number, green: number, blue: number) => string;
|
|
81
81
|
};
|
|
82
|
-
declare const background: {
|
|
82
|
+
export declare const background: {
|
|
83
83
|
close: string;
|
|
84
84
|
ansi: (code: number) => string;
|
|
85
85
|
ansi256: (code: number) => string;
|
|
86
86
|
ansi16m: (red: number, green: number, blue: number) => string;
|
|
87
87
|
};
|
|
88
|
-
declare const rgbToAnsi256: (red: number, green: number, blue: number) => number;
|
|
89
|
-
declare const hexToRgb: (hex: string) => [number, number, number];
|
|
90
|
-
declare const hexToAnsi256: (hex: string) => number;
|
|
91
|
-
declare const ansi256ToAnsi: (code: number) => number;
|
|
92
|
-
declare const rgbToAnsi: (red: number, green: number, blue: number) => number;
|
|
93
|
-
declare const hexToAnsi: (hex: string) => number;
|
|
88
|
+
export declare const rgbToAnsi256: (red: number, green: number, blue: number) => number;
|
|
89
|
+
export declare const hexToRgb: (hex: string) => [number, number, number];
|
|
90
|
+
export declare const hexToAnsi256: (hex: string) => number;
|
|
91
|
+
export declare const ansi256ToAnsi: (code: number) => number;
|
|
92
|
+
export declare const rgbToAnsi: (red: number, green: number, blue: number) => number;
|
|
93
|
+
export declare const hexToAnsi: (hex: string) => number;
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/ansi/chalk.d.ts
|
|
96
96
|
type StyleFunction = (text: string) => string;
|
|
@@ -104,8 +104,8 @@ type Chalk = NamedStyles & {
|
|
|
104
104
|
ansi256: (code: number) => StyleFunction;
|
|
105
105
|
bgAnsi256: (code: number) => StyleFunction;
|
|
106
106
|
};
|
|
107
|
-
declare const chalk: Chalk;
|
|
108
|
-
declare const supportsColor: ColorInfo;
|
|
107
|
+
export declare const chalk: Chalk;
|
|
108
|
+
export declare const supportsColor: ColorInfo;
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/ansi/hyperlink.d.ts
|
|
111
111
|
type HyperlinkOptions = {
|
|
@@ -136,66 +136,66 @@ import { hyperlink } from "@alchemy.run/sigil/ansi";
|
|
|
136
136
|
console.log(hyperlink("Documentation", "https://example.com"));
|
|
137
137
|
```
|
|
138
138
|
*/
|
|
139
|
-
declare const hyperlink: (text: string, url: string, { fallback, stream }?: HyperlinkOptions) => string;
|
|
139
|
+
export declare const hyperlink: (text: string, url: string, { fallback, stream }?: HyperlinkOptions) => string;
|
|
140
140
|
//#endregion
|
|
141
141
|
//#region src/ansi/cursor.d.ts
|
|
142
142
|
type CursorStream = {
|
|
143
143
|
isTTY?: boolean;
|
|
144
144
|
write: (data: string) => unknown;
|
|
145
145
|
};
|
|
146
|
-
declare const cliCursor: {
|
|
146
|
+
export declare const cliCursor: {
|
|
147
147
|
show(writableStream?: CursorStream): void;
|
|
148
148
|
hide(writableStream?: CursorStream): void;
|
|
149
149
|
};
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region src/ansi/string-width.d.ts
|
|
152
|
-
declare const stringWidth: (input: string) => number;
|
|
153
|
-
declare const widestLine: (text: string) => number;
|
|
152
|
+
export declare const stringWidth: (input: string) => number;
|
|
153
|
+
export declare const widestLine: (text: string) => number;
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/ansi/east-asian-width.d.ts
|
|
156
|
-
type EastAsianWidthType = "ambiguous" | "fullwidth" | "halfwidth" | "narrow" | "neutral" | "wide";
|
|
157
|
-
declare const ambiguousMinimalCodePoint = 161;
|
|
158
|
-
declare const ambiguousMaximumCodePoint = 1114109;
|
|
159
|
-
declare const ambiguousRanges: readonly number[];
|
|
160
|
-
declare const fullwidthMinimalCodePoint = 12288;
|
|
161
|
-
declare const fullwidthMaximumCodePoint = 65510;
|
|
162
|
-
declare const fullwidthRanges: readonly number[];
|
|
163
|
-
declare const halfwidthMinimalCodePoint = 8361;
|
|
164
|
-
declare const halfwidthMaximumCodePoint = 65518;
|
|
165
|
-
declare const halfwidthRanges: readonly number[];
|
|
166
|
-
declare const narrowMinimalCodePoint = 32;
|
|
167
|
-
declare const narrowMaximumCodePoint = 10630;
|
|
168
|
-
declare const narrowRanges: readonly number[];
|
|
169
|
-
declare const wideMinimalCodePoint = 4352;
|
|
170
|
-
declare const wideMaximumCodePoint = 262141;
|
|
171
|
-
declare const wideRanges: readonly number[];
|
|
172
|
-
declare const isAmbiguous: (codePoint: number) => boolean;
|
|
173
|
-
declare const isFullWidth: (codePoint: number) => boolean;
|
|
174
|
-
declare const isWide: (codePoint: number) => boolean;
|
|
175
|
-
declare function getCategory(codePoint: number): EastAsianWidthType;
|
|
176
|
-
declare function eastAsianWidthType(codePoint: number): EastAsianWidthType;
|
|
177
|
-
declare function eastAsianWidth(codePoint: number, { ambiguousAsWide }?: {
|
|
156
|
+
export type EastAsianWidthType = "ambiguous" | "fullwidth" | "halfwidth" | "narrow" | "neutral" | "wide";
|
|
157
|
+
export declare const ambiguousMinimalCodePoint = 161;
|
|
158
|
+
export declare const ambiguousMaximumCodePoint = 1114109;
|
|
159
|
+
export declare const ambiguousRanges: readonly number[];
|
|
160
|
+
export declare const fullwidthMinimalCodePoint = 12288;
|
|
161
|
+
export declare const fullwidthMaximumCodePoint = 65510;
|
|
162
|
+
export declare const fullwidthRanges: readonly number[];
|
|
163
|
+
export declare const halfwidthMinimalCodePoint = 8361;
|
|
164
|
+
export declare const halfwidthMaximumCodePoint = 65518;
|
|
165
|
+
export declare const halfwidthRanges: readonly number[];
|
|
166
|
+
export declare const narrowMinimalCodePoint = 32;
|
|
167
|
+
export declare const narrowMaximumCodePoint = 10630;
|
|
168
|
+
export declare const narrowRanges: readonly number[];
|
|
169
|
+
export declare const wideMinimalCodePoint = 4352;
|
|
170
|
+
export declare const wideMaximumCodePoint = 262141;
|
|
171
|
+
export declare const wideRanges: readonly number[];
|
|
172
|
+
export declare const isAmbiguous: (codePoint: number) => boolean;
|
|
173
|
+
export declare const isFullWidth: (codePoint: number) => boolean;
|
|
174
|
+
export declare const isWide: (codePoint: number) => boolean;
|
|
175
|
+
export declare function getCategory(codePoint: number): EastAsianWidthType;
|
|
176
|
+
export declare function eastAsianWidthType(codePoint: number): EastAsianWidthType;
|
|
177
|
+
export declare function eastAsianWidth(codePoint: number, { ambiguousAsWide }?: {
|
|
178
178
|
ambiguousAsWide?: boolean;
|
|
179
179
|
}): 1 | 2;
|
|
180
180
|
/**
|
|
181
181
|
Grapheme-cluster width test shared by the tokenizer (slice/clip path): the
|
|
182
182
|
base code point's East Asian Width, plus emoji presentation rules.
|
|
183
183
|
*/
|
|
184
|
-
declare function isFullwidthGrapheme(grapheme: string, baseCodePoint: number): boolean;
|
|
184
|
+
export declare function isFullwidthGrapheme(grapheme: string, baseCodePoint: number): boolean;
|
|
185
185
|
/**
|
|
186
186
|
Wide code points not covered by string-width's CJKT script regex or emoji
|
|
187
187
|
regex — the fallback bucket of its block parser. A disjoint decomposition of
|
|
188
188
|
the `wide` table above, kept alongside it so the width data lives in one
|
|
189
189
|
module.
|
|
190
190
|
*/
|
|
191
|
-
declare const isWideNotCJKTNotEmoji: (x: number) => boolean;
|
|
192
|
-
declare function isFullwidthCodePoint(codePoint: number): boolean;
|
|
191
|
+
export declare const isWideNotCJKTNotEmoji: (x: number) => boolean;
|
|
192
|
+
export declare function isFullwidthCodePoint(codePoint: number): boolean;
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/ansi/strip.d.ts
|
|
195
|
-
declare const stripAnsi: (input: string) => string;
|
|
195
|
+
export declare const stripAnsi: (input: string) => string;
|
|
196
196
|
//#endregion
|
|
197
197
|
//#region src/ansi/slice.d.ts
|
|
198
|
-
declare function sliceAnsi(string: string, start: number, end?: number): string;
|
|
198
|
+
export declare function sliceAnsi(string: string, start: number, end?: number): string;
|
|
199
199
|
//#endregion
|
|
200
200
|
//#region src/ansi/truncate.d.ts
|
|
201
201
|
type TruncateOptions = {
|
|
@@ -212,6 +212,6 @@ type WrapOptions = {
|
|
|
212
212
|
readonly hard?: boolean;
|
|
213
213
|
readonly wordWrap?: boolean;
|
|
214
214
|
};
|
|
215
|
-
declare function wrapAnsi(string: string, columns: number, options?: WrapOptions): string;
|
|
215
|
+
export declare function wrapAnsi(string: string, columns: number, options?: WrapOptions): string;
|
|
216
216
|
//#endregion
|
|
217
|
-
export { AnsiCode, AnsiToken, BEL,
|
|
217
|
+
export { AnsiCode, AnsiToken, BEL, C1_CSI, C1_ST, CSI, CharToken, ClipboardSelection, ControlToken, CursorShape, DEL, ESC, OSC, ST, StyledChar, TerminalProgressState, Token, ansiCodesToString, ansiEscapes, bsu, clearClipboard, clearTerminal, cursorColor, cursorDown, cursorHide, cursorLeft, cursorNextLine, cursorShape, cursorShow, cursorTo, cursorUp, diffAnsiCodes, disableBracketedPaste, enableBracketedPaste, endCodesSet, enterAlternativeScreen, eraseEndLine, eraseLine, eraseLines, eraseScreen, esu, exitAlternativeScreen, getEndCode, getLinkStartCode, isIntensityCode, kittyQuery, link, notify, pasteEnd, pasteStart, popKittyKeyboard, pushKittyKeyboard, queryClipboard, reduceAnsiCodes, reduceAnsiCodesIncremental, resetCursorColor, setClipboard, setPointerShape, setTerminalProgress, setWindowTitle, setWorkingDirectory, styledCharsFromTokens, styledCharsToString, tmuxPassthrough, tokenize, cliTruncate as truncateAnsi, undoAnsiCodes };
|
package/dist/capabilities.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as detectTerminal, i as detectHyperlinkSupport, n as detectCapabilities, o as detectUnicodeSupport, r as detectColorLevel, t as createSupportsColor } from "./detect-B3dL4Q11.js";
|
|
2
|
-
import {
|
|
2
|
+
import { f as queryTerminal, i as getCapabilities, l as getTerminalQuery, n as resolveColorProfile, p as refreshTerminalQuery, r as capabilities, s as applyTerminalQuery, t as colorState } from "./color-policy-BAC9-TZX.js";
|
|
3
3
|
export { applyTerminalQuery, capabilities, colorState, createSupportsColor, detectCapabilities, detectColorLevel, detectHyperlinkSupport, detectTerminal, detectUnicodeSupport, getCapabilities, getTerminalQuery, queryTerminal, refreshTerminalQuery, resolveColorProfile };
|
|
@@ -66,6 +66,18 @@ const kittyGraphicsResponse = new RegExp(`_G([^]*)\\\\`);
|
|
|
66
66
|
const winopsResponse = new RegExp(`\\[(4|6);(\\d+);(\\d+)t`);
|
|
67
67
|
const colorSchemeResponse = new RegExp(`\\[\\?997;(\\d+)n`);
|
|
68
68
|
const da1Response = new RegExp(`\\[\\?([\\d;]*)c`);
|
|
69
|
+
const terminalResponses = [
|
|
70
|
+
oscColorResponse,
|
|
71
|
+
kittyKeyboardResponse,
|
|
72
|
+
decrqmResponse,
|
|
73
|
+
xtversionResponse,
|
|
74
|
+
xtgettcapResponse,
|
|
75
|
+
kittyGraphicsResponse,
|
|
76
|
+
winopsResponse,
|
|
77
|
+
colorSchemeResponse,
|
|
78
|
+
da1Response
|
|
79
|
+
].map((pattern) => new RegExp(`^(?:${pattern.source})$`));
|
|
80
|
+
const isTerminalQueryResponse = (sequence) => terminalResponses.some((pattern) => pattern.test(sequence));
|
|
69
81
|
const buildQuery = (palette, scope) => {
|
|
70
82
|
const queries = [
|
|
71
83
|
`${OSC}10;?`,
|
|
@@ -125,6 +137,7 @@ const queryTerminal = async (stdin, stdout, { timeout = 500, palette = true, sco
|
|
|
125
137
|
if (done) return;
|
|
126
138
|
done = true;
|
|
127
139
|
clearTimeout(timer);
|
|
140
|
+
stdin.pause();
|
|
128
141
|
stdin.removeListener("data", onData);
|
|
129
142
|
if (paletteColors.size === paletteSize) result.palette = Array.from({ length: paletteSize }, (_, index) => paletteColors.get(index));
|
|
130
143
|
result.systemAppearance = reportedAppearance;
|
|
@@ -213,6 +226,7 @@ const queryTerminal = async (stdin, stdout, { timeout = 500, palette = true, sco
|
|
|
213
226
|
};
|
|
214
227
|
stdin.on("data", onData);
|
|
215
228
|
const timer = setTimeout(finish, timeout);
|
|
229
|
+
stdin.resume();
|
|
216
230
|
stdout.write(buildQuery(palette, scope));
|
|
217
231
|
});
|
|
218
232
|
const queryPromises = /* @__PURE__ */ new WeakMap();
|
|
@@ -575,4 +589,4 @@ function colorState(capabilities, policy = "auto") {
|
|
|
575
589
|
};
|
|
576
590
|
}
|
|
577
591
|
//#endregion
|
|
578
|
-
export { registerTerminalIntegration as a, ensureTerminalQuery as c,
|
|
592
|
+
export { registerTerminalIntegration as a, ensureTerminalQuery as c, isTerminalQueryResponse as d, queryTerminal as f, getCapabilities as i, getTerminalQuery as l, resolveColorProfile as n, getRawModeStream as o, refreshTerminalQuery as p, capabilities as r, applyTerminalQuery as s, colorState as t, getTerminalQueryPromise as u };
|
package/dist/color.d.ts
CHANGED
|
@@ -2,20 +2,20 @@ import { c as Color, d as RgbColor } from "./color-profile-CyeHnG1T.js";
|
|
|
2
2
|
import { _ as perimeterGradient, a as LinearGradient, c as PaintContext, d as adaptive, f as ansi, g as perProfile, h as named, i as InterpolationSpace, l as PerimeterGradient, m as linearGradient, n as ColorInput, o as NamedColor, p as ansi256, r as GradientStop, s as Paint, t as AdaptiveColor, u as ProfileColor, v as rgb } from "./paint-Cx-zC_sX.js";
|
|
3
3
|
import { n as Rect } from "./geometry-BxXOzJgo.js";
|
|
4
4
|
//#region src/color/palette.d.ts
|
|
5
|
-
declare const canonicalAnsiPalette: readonly RgbColor[];
|
|
6
|
-
declare function colorToRgb(color: Color, palette?: readonly {
|
|
5
|
+
export declare const canonicalAnsiPalette: readonly RgbColor[];
|
|
6
|
+
export declare function colorToRgb(color: Color, palette?: readonly {
|
|
7
7
|
r: number;
|
|
8
8
|
g: number;
|
|
9
9
|
b: number;
|
|
10
10
|
}[]): RgbColor;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/color/sample.d.ts
|
|
13
|
-
declare function samplePaint(paint: Paint, x: number, y: number, bounds: Rect, context?: PaintContext): Color | undefined;
|
|
14
|
-
declare function blend(source: Color, destination: Color, palette?: PaintContext["palette"]): Color;
|
|
13
|
+
export declare function samplePaint(paint: Paint, x: number, y: number, bounds: Rect, context?: PaintContext): Color | undefined;
|
|
14
|
+
export declare function blend(source: Color, destination: Color, palette?: PaintContext["palette"]): Color;
|
|
15
15
|
/** Progressively moves a color toward white in perceptual OKLab space. */
|
|
16
|
-
declare function lighten(color: Color, amount: number, palette?: PaintContext["palette"]): RgbColor;
|
|
16
|
+
export declare function lighten(color: Color, amount: number, palette?: PaintContext["palette"]): RgbColor;
|
|
17
17
|
/** Progressively moves a color toward black in perceptual OKLab space. */
|
|
18
|
-
declare function darken(color: Color, amount: number, palette?: PaintContext["palette"]): RgbColor;
|
|
19
|
-
declare function interpolateColor(from: Color, to: Color, amount: number, space?: InterpolationSpace, palette?: PaintContext["palette"]): RgbColor;
|
|
18
|
+
export declare function darken(color: Color, amount: number, palette?: PaintContext["palette"]): RgbColor;
|
|
19
|
+
export declare function interpolateColor(from: Color, to: Color, amount: number, space?: InterpolationSpace, palette?: PaintContext["palette"]): RgbColor;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { AdaptiveColor, ColorInput, GradientStop, InterpolationSpace, LinearGradient, NamedColor, Paint, PaintContext, PerimeterGradient, ProfileColor, adaptive, ansi, ansi256,
|
|
21
|
+
export { AdaptiveColor, ColorInput, GradientStop, InterpolationSpace, LinearGradient, NamedColor, Paint, PaintContext, PerimeterGradient, ProfileColor, adaptive, ansi, ansi256, linearGradient, named, perProfile, perimeterGradient, rgb };
|
|
@@ -50,7 +50,10 @@ Object.defineProperty(globalThis, "__REACT_DEVTOOLS_COMPONENT_FILTERS__", { valu
|
|
|
50
50
|
] });
|
|
51
51
|
const isDevToolsReachable = () => new Promise((resolve) => {
|
|
52
52
|
const socket = new WebSocket("ws://localhost:8097");
|
|
53
|
+
let settled = false;
|
|
53
54
|
const settle = (reachable) => {
|
|
55
|
+
if (settled) return;
|
|
56
|
+
settled = true;
|
|
54
57
|
clearTimeout(timeout);
|
|
55
58
|
socket.close();
|
|
56
59
|
resolve(reachable);
|
package/dist/index.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ import { n as Text, r as Styles, t as Props$8 } from "./Text-DV9CuzAT.js";
|
|
|
8
8
|
import { i as Node } from "./index-DDVME65c.js";
|
|
9
9
|
import { t as CursorPosition } from "./cursor-position-D2LAkRG0.js";
|
|
10
10
|
import { Writable } from "node:stream";
|
|
11
|
-
import { Key as Key$1, PropsWithChildren, ReactNode, Ref, RefObject } from "react";
|
|
12
11
|
import { EventEmitter } from "node:events";
|
|
12
|
+
import { Key as Key$1, PropsWithChildren, ReactNode, Ref, RefObject } from "react";
|
|
13
13
|
//#region src/kitty-keyboard.d.ts
|
|
14
|
-
declare const kittyFlags: {
|
|
14
|
+
export declare const kittyFlags: {
|
|
15
15
|
readonly disambiguateEscapeCodes: 1;
|
|
16
16
|
readonly reportEventTypes: 2;
|
|
17
17
|
readonly reportAlternateKeys: 4;
|
|
@@ -19,7 +19,7 @@ declare const kittyFlags: {
|
|
|
19
19
|
readonly reportAssociatedText: 16;
|
|
20
20
|
};
|
|
21
21
|
type KittyFlagName = keyof typeof kittyFlags;
|
|
22
|
-
declare const kittyModifiers: {
|
|
22
|
+
export declare const kittyModifiers: {
|
|
23
23
|
readonly shift: 1;
|
|
24
24
|
readonly alt: 2;
|
|
25
25
|
readonly ctrl: 4;
|
|
@@ -263,7 +263,7 @@ type Instance = {
|
|
|
263
263
|
/**
|
|
264
264
|
Mount a component and render the output.
|
|
265
265
|
*/
|
|
266
|
-
declare const render: (node: ReactNode, options?: Writable | RenderOptions) => Instance;
|
|
266
|
+
export declare const render: (node: ReactNode, options?: Writable | RenderOptions) => Instance;
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/render-to-string.d.ts
|
|
269
269
|
type RenderToStringOptions = {
|
|
@@ -306,7 +306,7 @@ const output = renderToString(
|
|
|
306
306
|
console.log(output);
|
|
307
307
|
```
|
|
308
308
|
*/
|
|
309
|
-
declare const renderToString: (node: ReactNode, options?: RenderToStringOptions) => string;
|
|
309
|
+
export declare const renderToString: (node: ReactNode, options?: RenderToStringOptions) => string;
|
|
310
310
|
//#endregion
|
|
311
311
|
//#region src/semantic-text-style.d.ts
|
|
312
312
|
type SemanticTextStyle = {
|
|
@@ -405,7 +405,7 @@ type Props$2 = Omit<Styles, "textWrap"> & {
|
|
|
405
405
|
/**
|
|
406
406
|
`<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
|
|
407
407
|
*/
|
|
408
|
-
declare function Box({ children, ref, backgroundColor, "aria-label": ariaLabel, "aria-hidden": ariaHidden, "aria-role": role, "aria-state": ariaState, ...style }: PropsWithChildren<Props$2> & {
|
|
408
|
+
export declare function Box({ children, ref, backgroundColor, "aria-label": ariaLabel, "aria-hidden": ariaHidden, "aria-role": role, "aria-state": ariaState, ...style }: PropsWithChildren<Props$2> & {
|
|
409
409
|
readonly ref?: Ref<DOMElement>;
|
|
410
410
|
}): import("react").JSX.Element | null;
|
|
411
411
|
//#endregion
|
|
@@ -421,7 +421,7 @@ type Props = {
|
|
|
421
421
|
* Renders explicitly trusted ANSI-styled output as structured terminal cells.
|
|
422
422
|
* Ordinary `Text` continues to strip terminal control sequences.
|
|
423
423
|
*/
|
|
424
|
-
declare function AnsiText({ children, wrap, "aria-label": ariaLabel, "aria-hidden": ariaHidden }: Props): import("react").JSX.Element | null;
|
|
424
|
+
export declare function AnsiText({ children, wrap, "aria-label": ariaLabel, "aria-hidden": ariaHidden }: Props): import("react").JSX.Element | null;
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region src/components/AppContext.d.ts
|
|
427
427
|
/**
|
|
@@ -565,7 +565,7 @@ It's preferred to use `<Static>` for use cases like these when you can't know or
|
|
|
565
565
|
|
|
566
566
|
For example, [Tap](https://github.com/tapjs/node-tap) uses `<Static>` to display a list of completed tests. [Gatsby](https://github.com/gatsbyjs/gatsby) uses it to display a list of generated pages while still displaying a live progress bar.
|
|
567
567
|
*/
|
|
568
|
-
declare function Static<T>(props: Props$5<T>): import("react").JSX.Element;
|
|
568
|
+
export declare function Static<T>(props: Props$5<T>): import("react").JSX.Element;
|
|
569
569
|
//#endregion
|
|
570
570
|
//#region src/components/Transform.d.ts
|
|
571
571
|
type Props$9 = {
|
|
@@ -582,7 +582,7 @@ type Props$9 = {
|
|
|
582
582
|
/**
|
|
583
583
|
Transform a string representation of React components before they're written to output. For example, you might want to apply a gradient to text, add a clickable link, or create some text effects. These use cases can't accept React nodes as input; they expect a string. That's what the <Transform> component does: it gives you an output string of its child components and lets you transform it in any way.
|
|
584
584
|
*/
|
|
585
|
-
declare function Transform({ children, transform, accessibilityLabel }: Props$9): import("react").JSX.Element | null;
|
|
585
|
+
export declare function Transform({ children, transform, accessibilityLabel }: Props$9): import("react").JSX.Element | null;
|
|
586
586
|
//#endregion
|
|
587
587
|
//#region src/components/Hyperlink.d.ts
|
|
588
588
|
type Props$3 = Omit<Props$8, "children"> & {
|
|
@@ -609,7 +609,7 @@ back to `text (url)`.
|
|
|
609
609
|
<Hyperlink url="https://example.com">Documentation</Hyperlink>
|
|
610
610
|
```
|
|
611
611
|
*/
|
|
612
|
-
declare function Hyperlink({ url, fallback, children, ...textProps }: Props$3): import("react").JSX.Element;
|
|
612
|
+
export declare function Hyperlink({ url, fallback, children, ...textProps }: Props$3): import("react").JSX.Element;
|
|
613
613
|
//#endregion
|
|
614
614
|
//#region src/components/Newline.d.ts
|
|
615
615
|
/** @jsxImportSource react */
|
|
@@ -624,7 +624,7 @@ type Props$4 = {
|
|
|
624
624
|
/**
|
|
625
625
|
Adds one or more newline (`\n`) characters. Must be used within `<Text>` components.
|
|
626
626
|
*/
|
|
627
|
-
declare function Newline({ count }: Props$4): import("react").JSX.Element;
|
|
627
|
+
export declare function Newline({ count }: Props$4): import("react").JSX.Element;
|
|
628
628
|
//#endregion
|
|
629
629
|
//#region src/components/Spacer.d.ts
|
|
630
630
|
/**
|
|
@@ -632,7 +632,7 @@ A flexible space that expands along the major axis of its containing layout.
|
|
|
632
632
|
|
|
633
633
|
It's useful as a shortcut for filling all the available space between elements.
|
|
634
634
|
*/
|
|
635
|
-
declare function Spacer(): import("react").JSX.Element;
|
|
635
|
+
export declare function Spacer(): import("react").JSX.Element;
|
|
636
636
|
//#endregion
|
|
637
637
|
//#region src/components/VirtualList.d.ts
|
|
638
638
|
type Props$10<Item> = {
|
|
@@ -674,7 +674,7 @@ different heights, and the item at the top edge may be partially visible.
|
|
|
674
674
|
Until the first layout pass has measured the viewport, every item is rendered
|
|
675
675
|
inside the clipped box so the first frame already looks right.
|
|
676
676
|
*/
|
|
677
|
-
declare function VirtualList<Item>({ items, itemHeight, renderItem, getKey, focusedIndex, height }: Props$10<Item>): import("react").JSX.Element;
|
|
677
|
+
export declare function VirtualList<Item>({ items, itemHeight, renderItem, getKey, focusedIndex, height }: Props$10<Item>): import("react").JSX.Element;
|
|
678
678
|
//#endregion
|
|
679
679
|
//#region src/hooks/use-capabilities.d.ts
|
|
680
680
|
/**
|
|
@@ -687,7 +687,7 @@ itself can answer fill in after a lazy one-time query, and re-mounting
|
|
|
687
687
|
consumers refreshes the dynamic facts (theme colors, pixel geometry).
|
|
688
688
|
Re-renders on terminal resize and whenever query answers arrive.
|
|
689
689
|
*/
|
|
690
|
-
declare const useCapabilities: () => Capabilities;
|
|
690
|
+
export declare const useCapabilities: () => Capabilities;
|
|
691
691
|
/**
|
|
692
692
|
Calls `onChange` whenever the terminal changes: resizes (including in-band
|
|
693
693
|
pixel geometry), color scheme switches, window focus, and query answers
|
|
@@ -706,7 +706,7 @@ useCapabilitiesChange((next, previous) => {
|
|
|
706
706
|
});
|
|
707
707
|
```
|
|
708
708
|
*/
|
|
709
|
-
declare const useCapabilitiesChange: (onChange: (capabilities: Capabilities, previous: Capabilities) => void) => void;
|
|
709
|
+
export declare const useCapabilitiesChange: (onChange: (capabilities: Capabilities, previous: Capabilities) => void) => void;
|
|
710
710
|
//#endregion
|
|
711
711
|
//#region src/hooks/use-input.d.ts
|
|
712
712
|
/**
|
|
@@ -839,7 +839,7 @@ const UserInput = () => {
|
|
|
839
839
|
};
|
|
840
840
|
```
|
|
841
841
|
*/
|
|
842
|
-
declare const useInput: (inputHandler: Handler, options?: Options$2) => void;
|
|
842
|
+
export declare const useInput: (inputHandler: Handler, options?: Options$2) => void;
|
|
843
843
|
//#endregion
|
|
844
844
|
//#region src/hooks/use-paste.d.ts
|
|
845
845
|
type Options$1 = {
|
|
@@ -875,31 +875,31 @@ const MyInput = () => {
|
|
|
875
875
|
};
|
|
876
876
|
```
|
|
877
877
|
*/
|
|
878
|
-
declare const usePaste: (handler: (text: string) => void, options?: Options$1) => void;
|
|
878
|
+
export declare const usePaste: (handler: (text: string) => void, options?: Options$1) => void;
|
|
879
879
|
//#endregion
|
|
880
880
|
//#region src/hooks/use-app.d.ts
|
|
881
881
|
/**
|
|
882
882
|
A React hook that returns app lifecycle methods like `exit()` and `waitUntilRenderFlush()`.
|
|
883
883
|
*/
|
|
884
|
-
declare const useApp: () => Props$1;
|
|
884
|
+
export declare const useApp: () => Props$1;
|
|
885
885
|
//#endregion
|
|
886
886
|
//#region src/hooks/use-stdin.d.ts
|
|
887
887
|
/**
|
|
888
888
|
A React hook that returns the stdin stream and stdin-related utilities.
|
|
889
889
|
*/
|
|
890
|
-
declare const useStdin: () => PublicProps;
|
|
890
|
+
export declare const useStdin: () => PublicProps;
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/hooks/use-stdout.d.ts
|
|
893
893
|
/**
|
|
894
894
|
A React hook that returns the stdout stream where Ink renders your app.
|
|
895
895
|
*/
|
|
896
|
-
declare const useStdout: () => Props$7;
|
|
896
|
+
export declare const useStdout: () => Props$7;
|
|
897
897
|
//#endregion
|
|
898
898
|
//#region src/hooks/use-stderr.d.ts
|
|
899
899
|
/**
|
|
900
900
|
A React hook that returns the stderr stream.
|
|
901
901
|
*/
|
|
902
|
-
declare const useStderr: () => Props$6;
|
|
902
|
+
export declare const useStderr: () => Props$6;
|
|
903
903
|
//#endregion
|
|
904
904
|
//#region src/hooks/use-focus.d.ts
|
|
905
905
|
type Input = {
|
|
@@ -930,7 +930,7 @@ type Output$2 = {
|
|
|
930
930
|
A React hook that returns focus state and focus controls for the current component.
|
|
931
931
|
A component that uses the `useFocus` hook becomes "focusable" to Ink, so when the user presses <kbd>Tab</kbd>, Ink will switch focus to this component. If there are multiple components that execute the `useFocus` hook, focus will be given to them in the order in which these components are rendered.
|
|
932
932
|
*/
|
|
933
|
-
declare const useFocus: ({ isActive, autoFocus, id: customId }?: Input) => Output$2;
|
|
933
|
+
export declare const useFocus: ({ isActive, autoFocus, id: customId }?: Input) => Output$2;
|
|
934
934
|
//#endregion
|
|
935
935
|
//#region src/components/FocusContext.d.ts
|
|
936
936
|
type Props$11 = {
|
|
@@ -989,14 +989,14 @@ type Output$1 = {
|
|
|
989
989
|
/**
|
|
990
990
|
A React hook that returns methods to enable or disable focus management for all components or manually switch focus to the next or previous components.
|
|
991
991
|
*/
|
|
992
|
-
declare const useFocusManager: () => Output$1;
|
|
992
|
+
export declare const useFocusManager: () => Output$1;
|
|
993
993
|
//#endregion
|
|
994
994
|
//#region src/hooks/use-is-screen-reader-enabled.d.ts
|
|
995
995
|
/**
|
|
996
996
|
A React hook that returns whether a screen reader is enabled.
|
|
997
997
|
This is useful when you want to render different output for screen readers.
|
|
998
998
|
*/
|
|
999
|
-
declare const useIsScreenReaderEnabled: () => boolean;
|
|
999
|
+
export declare const useIsScreenReaderEnabled: () => boolean;
|
|
1000
1000
|
//#endregion
|
|
1001
1001
|
//#region src/hooks/use-cursor.d.ts
|
|
1002
1002
|
/**
|
|
@@ -1006,7 +1006,7 @@ Setting a cursor position makes the cursor visible at the specified coordinates
|
|
|
1006
1006
|
|
|
1007
1007
|
Pass `undefined` to hide the cursor.
|
|
1008
1008
|
*/
|
|
1009
|
-
declare const useCursor: () => {
|
|
1009
|
+
export declare const useCursor: () => {
|
|
1010
1010
|
setCursorPosition: (position: CursorPosition | undefined) => void;
|
|
1011
1011
|
};
|
|
1012
1012
|
//#endregion
|
|
@@ -1058,19 +1058,19 @@ const Spinner = () => {
|
|
|
1058
1058
|
};
|
|
1059
1059
|
```
|
|
1060
1060
|
*/
|
|
1061
|
-
declare function useAnimation(options?: Options): AnimationResult;
|
|
1061
|
+
export declare function useAnimation(options?: Options): AnimationResult;
|
|
1062
1062
|
//#endregion
|
|
1063
1063
|
//#region src/hooks/use-terminal-osc.d.ts
|
|
1064
1064
|
type ProgressOptions = {
|
|
1065
1065
|
readonly state: TerminalProgressState;
|
|
1066
1066
|
readonly value?: number;
|
|
1067
1067
|
};
|
|
1068
|
-
declare const useProgress: ({ state, value }: ProgressOptions) => void;
|
|
1069
|
-
declare const useClipboard: () => ((text: string, selection?: ClipboardSelection) => void);
|
|
1070
|
-
declare const useTitle: (title?: string) => void;
|
|
1071
|
-
declare const useWorkingDirectory: (directory: URL | string) => void;
|
|
1072
|
-
declare const useNotification: () => ((title: string) => void);
|
|
1073
|
-
declare const usePointerShape: (shape: string) => void;
|
|
1068
|
+
export declare const useProgress: ({ state, value }: ProgressOptions) => void;
|
|
1069
|
+
export declare const useClipboard: () => ((text: string, selection?: ClipboardSelection) => void);
|
|
1070
|
+
export declare const useTitle: (title?: string) => void;
|
|
1071
|
+
export declare const useWorkingDirectory: (directory: URL | string) => void;
|
|
1072
|
+
export declare const useNotification: () => ((title: string) => void);
|
|
1073
|
+
export declare const usePointerShape: (shape: string) => void;
|
|
1074
1074
|
//#endregion
|
|
1075
1075
|
//#region src/hooks/use-window-size.d.ts
|
|
1076
1076
|
/**
|
|
@@ -1092,8 +1092,10 @@ A React hook that returns the current terminal window dimensions and re-renders
|
|
|
1092
1092
|
Reads the capabilities store, so on terminals that send in-band size reports
|
|
1093
1093
|
(mode 2048) the dimensions are the emulator's own, arriving after it has
|
|
1094
1094
|
rewrapped its screen; elsewhere they are the stream's `columns`/`rows`.
|
|
1095
|
+
Subscribing to dimensions does not initiate capability queries. In-band reports
|
|
1096
|
+
are used when another consumer has explicitly enabled capability discovery.
|
|
1095
1097
|
*/
|
|
1096
|
-
declare const useWindowSize: () => WindowSize;
|
|
1098
|
+
export declare const useWindowSize: () => WindowSize;
|
|
1097
1099
|
//#endregion
|
|
1098
1100
|
//#region src/hooks/use-box-metrics.d.ts
|
|
1099
1101
|
/**
|
|
@@ -1151,7 +1153,7 @@ const Example = () => {
|
|
|
1151
1153
|
};
|
|
1152
1154
|
```
|
|
1153
1155
|
*/
|
|
1154
|
-
declare const useBoxMetrics: (ref: RefObject<DOMElement | null>) => UseBoxMetricsResult;
|
|
1156
|
+
export declare const useBoxMetrics: (ref: RefObject<DOMElement | null>) => UseBoxMetricsResult;
|
|
1155
1157
|
//#endregion
|
|
1156
1158
|
//#region src/virtual-scroll.d.ts
|
|
1157
1159
|
/**
|
|
@@ -1274,7 +1276,7 @@ const Example = ({ lines, cursor }: { lines: string[]; cursor: number }) => {
|
|
|
1274
1276
|
};
|
|
1275
1277
|
```
|
|
1276
1278
|
*/
|
|
1277
|
-
declare const useVirtualScroll: (options: UseVirtualScrollOptions) => UseVirtualScrollResult;
|
|
1279
|
+
export declare const useVirtualScroll: (options: UseVirtualScrollOptions) => UseVirtualScrollResult;
|
|
1278
1280
|
//#endregion
|
|
1279
1281
|
//#region src/measure-element.d.ts
|
|
1280
1282
|
type Output = {
|
|
@@ -1303,6 +1305,6 @@ Returns an object with `x`, `y`, `width`, and `height` properties.
|
|
|
1303
1305
|
|
|
1304
1306
|
Note: `measureElement()` returns `{x: 0, y: 0, width: 0, height: 0}` when called during render (before layout is calculated). Call it from post-render code, such as `useEffect`, `useLayoutEffect`, input handlers, or timer callbacks. When content changes, pass the relevant dependency to your effect so it re-measures after each update.
|
|
1305
1307
|
*/
|
|
1306
|
-
declare const measureElement: (node: DOMElement) => Output;
|
|
1308
|
+
export declare const measureElement: (node: DOMElement) => Output;
|
|
1307
1309
|
//#endregion
|
|
1308
|
-
export { type AnimationResult,
|
|
1310
|
+
export { type AnimationResult, type Props as AnsiTextProps, type Props$1 as AppProps, type BoxMetrics, type Props$2 as BoxProps, type Capabilities, type CapabilitiesStore, type CapturedOutputSource, type ColorInfo, type ColorSupport, type ColorSupportLevel, type CursorPosition, type DOMElement, type Output as ElementMetrics, type Props$3 as HyperlinkProps, type Instance, type Key, type KittyFlagName, type KittyKeyboardOptions, type Multiplexer, type Props$4 as NewlineProps, type PixelGeometry, type PixelSize, type ProgressOptions, type RenderOptions, type RenderToStringOptions, type RgbColor, type Props$5 as StaticProps, type Props$6 as StderrProps, type PublicProps as StdinProps, type Props$7 as StdoutProps, type SuspendTerminal, type TerminalAppearance, type TerminalIdentity, type TerminalQueryOptions, type TerminalQueryResult, type TerminalSuspension, Text, type Props$8 as TextProps, type Props$9 as TransformProps, type UseBoxMetricsResult, type UseVirtualScrollOptions, type UseVirtualScrollResult, type Props$10 as VirtualListProps, type VirtualScrollWindow, type WindowSize, applyTerminalQuery, capabilities, createSupportsColor, detectCapabilities, detectColorLevel, detectHyperlinkSupport, detectTerminal, detectUnicodeSupport, getCapabilities, getTerminalQuery, queryTerminal, refreshTerminalQuery };
|