ink 3.2.0 → 4.1.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/build/colorize.d.ts +3 -3
- package/build/colorize.js +30 -35
- package/build/colorize.js.map +1 -1
- package/build/components/App.d.ts +12 -12
- package/build/components/App.js +287 -208
- package/build/components/App.js.map +1 -1
- package/build/components/AppContext.d.ts +2 -2
- package/build/components/AppContext.js +5 -6
- package/build/components/AppContext.js.map +1 -1
- package/build/components/Box.d.ts +77 -5
- package/build/components/Box.js +20 -38
- package/build/components/Box.js.map +1 -1
- package/build/components/ErrorOverview.d.ts +5 -5
- package/build/components/ErrorOverview.js +40 -58
- package/build/components/ErrorOverview.js.map +1 -1
- package/build/components/FocusContext.d.ts +2 -2
- package/build/components/FocusContext.js +13 -14
- package/build/components/FocusContext.js.map +1 -1
- package/build/components/Newline.d.ts +4 -5
- package/build/components/Newline.js +4 -9
- package/build/components/Newline.js.map +1 -1
- package/build/components/Spacer.d.ts +2 -3
- package/build/components/Spacer.js +5 -10
- package/build/components/Spacer.js.map +1 -1
- package/build/components/Static.d.ts +5 -9
- package/build/components/Static.js +12 -33
- package/build/components/Static.js.map +1 -1
- package/build/components/StderrContext.d.ts +4 -4
- package/build/components/StderrContext.js +7 -7
- package/build/components/StderrContext.js.map +1 -1
- package/build/components/StdinContext.d.ts +4 -4
- package/build/components/StdinContext.js +8 -7
- package/build/components/StdinContext.js.map +1 -1
- package/build/components/StdoutContext.d.ts +4 -4
- package/build/components/StdoutContext.js +7 -7
- package/build/components/StdoutContext.js.map +1 -1
- package/build/components/Text.d.ts +9 -10
- package/build/components/Text.js +14 -29
- package/build/components/Text.js.map +1 -1
- package/build/components/Transform.d.ts +4 -5
- package/build/components/Transform.js +4 -11
- package/build/components/Transform.js.map +1 -1
- package/build/devtools-window-polyfill.js +3 -8
- package/build/devtools-window-polyfill.js.map +1 -1
- package/build/devtools.d.ts +1 -1
- package/build/devtools.js +6 -6
- package/build/devtools.js.map +1 -1
- package/build/dom.d.ts +17 -20
- package/build/dom.js +35 -47
- package/build/dom.js.map +1 -1
- package/build/get-max-width.d.ts +3 -3
- package/build/get-max-width.js +8 -11
- package/build/get-max-width.js.map +1 -1
- package/build/hooks/use-app.d.ts +1 -1
- package/build/hooks/use-app.js +4 -9
- package/build/hooks/use-app.js.map +1 -1
- package/build/hooks/use-focus-manager.d.ts +3 -3
- package/build/hooks/use-focus-manager.js +4 -9
- package/build/hooks/use-focus-manager.js.map +1 -1
- package/build/hooks/use-focus.d.ts +4 -4
- package/build/hooks/use-focus.js +11 -16
- package/build/hooks/use-focus.js.map +1 -1
- package/build/hooks/use-input.d.ts +5 -5
- package/build/hooks/use-input.js +13 -14
- package/build/hooks/use-input.js.map +1 -1
- package/build/hooks/use-stderr.d.ts +1 -1
- package/build/hooks/use-stderr.js +4 -9
- package/build/hooks/use-stderr.js.map +1 -1
- package/build/hooks/use-stdin.d.ts +1 -1
- package/build/hooks/use-stdin.js +4 -9
- package/build/hooks/use-stdin.js.map +1 -1
- package/build/hooks/use-stdout.d.ts +1 -1
- package/build/hooks/use-stdout.js +4 -9
- package/build/hooks/use-stdout.js.map +1 -1
- package/build/index.d.ts +27 -20
- package/build/index.js +15 -32
- package/build/index.js.map +1 -1
- package/build/ink.d.ts +6 -4
- package/build/ink.js +188 -99
- package/build/ink.js.map +1 -1
- package/build/instances.d.ts +4 -2
- package/build/instances.js +2 -3
- package/build/instances.js.map +1 -1
- package/build/log-update.d.ts +5 -6
- package/build/log-update.js +8 -12
- package/build/log-update.js.map +1 -1
- package/build/measure-element.d.ts +5 -5
- package/build/measure-element.js +5 -9
- package/build/measure-element.js.map +1 -1
- package/build/measure-text.d.ts +4 -4
- package/build/measure-text.js +7 -10
- package/build/measure-text.js.map +1 -1
- package/build/output.d.ts +12 -4
- package/build/output.js +108 -31
- package/build/output.js.map +1 -1
- package/build/reconciler.d.ts +1 -1
- package/build/reconciler.js +104 -76
- package/build/reconciler.js.map +1 -1
- package/build/render-border.d.ts +4 -4
- package/build/render-border.js +8 -12
- package/build/render-border.js.map +1 -1
- package/build/render-node-to-output.d.ts +3 -3
- package/build/render-node-to-output.js +44 -24
- package/build/render-node-to-output.js.map +1 -1
- package/build/render.d.ts +8 -8
- package/build/render.js +23 -20
- package/build/render.js.map +1 -1
- package/build/renderer.d.ts +5 -5
- package/build/renderer.js +9 -17
- package/build/renderer.js.map +1 -1
- package/build/squash-text-nodes.d.ts +1 -1
- package/build/squash-text-nodes.js +1 -3
- package/build/squash-text-nodes.js.map +1 -1
- package/build/styles.d.ts +30 -9
- package/build/styles.js +60 -46
- package/build/styles.js.map +1 -1
- package/build/wrap-text.d.ts +3 -3
- package/build/wrap-text.js +9 -12
- package/build/wrap-text.js.map +1 -1
- package/license +1 -1
- package/package.json +87 -67
- package/readme.md +202 -57
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const react_1 = require("react");
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import { createContext } from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* `StderrContext` is a React context, which exposes stderr stream.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
const StderrContext = createContext({
|
|
8
|
+
stderr: process.stderr,
|
|
9
|
+
write() { }
|
|
10
10
|
});
|
|
11
11
|
StderrContext.displayName = 'InternalStderrContext';
|
|
12
|
-
|
|
12
|
+
export default StderrContext;
|
|
13
13
|
//# sourceMappingURL=StderrContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StderrContext.js","sourceRoot":"","sources":["../../src/components/StderrContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StderrContext.js","sourceRoot":"","sources":["../../src/components/StderrContext.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAgBpC;;GAEG;AACH,gEAAgE;AAChE,MAAM,aAAa,GAAG,aAAa,CAAQ;IAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,KAAK,KAAI,CAAC;CACV,CAAC,CAAC;AAEH,aAAa,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAEpD,eAAe,aAAa,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
export
|
|
3
|
+
export type Props = {
|
|
4
4
|
/**
|
|
5
5
|
* Stdin stream passed to `render()` in `options.stdin` or `process.stdin` by default. Useful if your app needs to handle user input.
|
|
6
6
|
*/
|
|
7
|
-
readonly stdin
|
|
7
|
+
readonly stdin: NodeJS.ReadStream;
|
|
8
8
|
/**
|
|
9
9
|
* Ink exposes this function via own `<StdinContext>` to be able to handle Ctrl+C, that's why you should use Ink's `setRawMode` instead of `process.stdin.setRawMode`.
|
|
10
10
|
* If the `stdin` stream passed to Ink does not support setRawMode, this function does nothing.
|
|
@@ -15,7 +15,7 @@ export interface Props {
|
|
|
15
15
|
*/
|
|
16
16
|
readonly isRawModeSupported: boolean;
|
|
17
17
|
readonly internal_exitOnCtrlC: boolean;
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
/**
|
|
20
20
|
* `StdinContext` is a React context, which exposes input stream.
|
|
21
21
|
*/
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const react_1 = require("react");
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import { createContext } from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* `StdinContext` is a React context, which exposes input stream.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
const StdinContext = createContext({
|
|
8
|
+
stdin: process.stdin,
|
|
9
|
+
setRawMode() { },
|
|
10
10
|
isRawModeSupported: false,
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
12
|
internal_exitOnCtrlC: true
|
|
12
13
|
});
|
|
13
14
|
StdinContext.displayName = 'InternalStdinContext';
|
|
14
|
-
|
|
15
|
+
export default StdinContext;
|
|
15
16
|
//# sourceMappingURL=StdinContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StdinContext.js","sourceRoot":"","sources":["../../src/components/StdinContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StdinContext.js","sourceRoot":"","sources":["../../src/components/StdinContext.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAsBpC;;GAEG;AACH,gEAAgE;AAChE,MAAM,YAAY,GAAG,aAAa,CAAQ;IACzC,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,UAAU,KAAI,CAAC;IACf,kBAAkB,EAAE,KAAK;IACzB,gEAAgE;IAChE,oBAAoB,EAAE,IAAI;CAC1B,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAElD,eAAe,YAAY,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
export
|
|
3
|
+
export type Props = {
|
|
4
4
|
/**
|
|
5
5
|
* Stdout stream passed to `render()` in `options.stdout` or `process.stdout` by default.
|
|
6
6
|
*/
|
|
7
|
-
readonly stdout
|
|
7
|
+
readonly stdout: NodeJS.WriteStream;
|
|
8
8
|
/**
|
|
9
9
|
* Write any string to stdout, while preserving Ink's output.
|
|
10
10
|
* It's useful when you want to display some external information outside of Ink's rendering and ensure there's no conflict between the two.
|
|
11
11
|
* It's similar to `<Static>`, except it can't accept components, it only works with strings.
|
|
12
12
|
*/
|
|
13
13
|
readonly write: (data: string) => void;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
/**
|
|
16
16
|
* `StdoutContext` is a React context, which exposes stdout stream, where Ink renders your app.
|
|
17
17
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const react_1 = require("react");
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import { createContext } from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* `StdoutContext` is a React context, which exposes stdout stream, where Ink renders your app.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
const StdoutContext = createContext({
|
|
8
|
+
stdout: process.stdout,
|
|
9
|
+
write() { }
|
|
10
10
|
});
|
|
11
11
|
StdoutContext.displayName = 'InternalStdoutContext';
|
|
12
|
-
|
|
12
|
+
export default StdoutContext;
|
|
13
13
|
//# sourceMappingURL=StdoutContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StdoutContext.js","sourceRoot":"","sources":["../../src/components/StdoutContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StdoutContext.js","sourceRoot":"","sources":["../../src/components/StdoutContext.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAgBpC;;GAEG;AACH,gEAAgE;AAChE,MAAM,aAAa,GAAG,aAAa,CAAQ;IAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,KAAK,KAAI,CAAC;CACV,CAAC,CAAC;AAEH,aAAa,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAEpD,eAAe,aAAa,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ForegroundColorName } from 'chalk';
|
|
3
|
+
import { type LiteralUnion } from 'type-fest';
|
|
4
|
+
import { type Styles } from '../styles.js';
|
|
5
|
+
export type Props = {
|
|
6
6
|
/**
|
|
7
7
|
* Change text color. Ink uses chalk under the hood, so all its functionality is supported.
|
|
8
8
|
*/
|
|
9
|
-
readonly color?: LiteralUnion<
|
|
9
|
+
readonly color?: LiteralUnion<ForegroundColorName, string>;
|
|
10
10
|
/**
|
|
11
11
|
* Same as `color`, but for background.
|
|
12
12
|
*/
|
|
13
|
-
readonly backgroundColor?: LiteralUnion<
|
|
13
|
+
readonly backgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
14
14
|
/**
|
|
15
15
|
* Dim the color (emit a small amount of light).
|
|
16
16
|
*/
|
|
@@ -42,9 +42,8 @@ export interface Props {
|
|
|
42
42
|
*/
|
|
43
43
|
readonly wrap?: Styles['textWrap'];
|
|
44
44
|
readonly children?: ReactNode;
|
|
45
|
-
}
|
|
45
|
+
};
|
|
46
46
|
/**
|
|
47
47
|
* This component can display text, and change its style to make it colorful, bold, underline, italic or strikethrough.
|
|
48
48
|
*/
|
|
49
|
-
|
|
50
|
-
export default Text;
|
|
49
|
+
export default function Text({ color, backgroundColor, dimColor, bold, italic, underline, strikethrough, inverse, wrap, children }: Props): JSX.Element | null;
|
package/build/components/Text.js
CHANGED
|
@@ -1,55 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
const colorize_1 = __importDefault(require("../colorize"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import colorize from '../colorize.js';
|
|
9
4
|
/**
|
|
10
5
|
* This component can display text, and change its style to make it colorful, bold, underline, italic or strikethrough.
|
|
11
6
|
*/
|
|
12
|
-
|
|
7
|
+
export default function Text({ color, backgroundColor, dimColor = false, bold = false, italic = false, underline = false, strikethrough = false, inverse = false, wrap = 'wrap', children }) {
|
|
13
8
|
if (children === undefined || children === null) {
|
|
14
9
|
return null;
|
|
15
10
|
}
|
|
16
11
|
const transform = (children) => {
|
|
17
12
|
if (dimColor) {
|
|
18
|
-
children =
|
|
13
|
+
children = chalk.dim(children);
|
|
19
14
|
}
|
|
20
15
|
if (color) {
|
|
21
|
-
children =
|
|
16
|
+
children = colorize(children, color, 'foreground');
|
|
22
17
|
}
|
|
23
18
|
if (backgroundColor) {
|
|
24
|
-
children =
|
|
19
|
+
children = colorize(children, backgroundColor, 'background');
|
|
25
20
|
}
|
|
26
21
|
if (bold) {
|
|
27
|
-
children =
|
|
22
|
+
children = chalk.bold(children);
|
|
28
23
|
}
|
|
29
24
|
if (italic) {
|
|
30
|
-
children =
|
|
25
|
+
children = chalk.italic(children);
|
|
31
26
|
}
|
|
32
27
|
if (underline) {
|
|
33
|
-
children =
|
|
28
|
+
children = chalk.underline(children);
|
|
34
29
|
}
|
|
35
30
|
if (strikethrough) {
|
|
36
|
-
children =
|
|
31
|
+
children = chalk.strikethrough(children);
|
|
37
32
|
}
|
|
38
33
|
if (inverse) {
|
|
39
|
-
children =
|
|
34
|
+
children = chalk.inverse(children);
|
|
40
35
|
}
|
|
41
36
|
return children;
|
|
42
37
|
};
|
|
43
|
-
return (
|
|
44
|
-
}
|
|
45
|
-
Text.displayName = 'Text';
|
|
46
|
-
Text.defaultProps = {
|
|
47
|
-
dimColor: false,
|
|
48
|
-
bold: false,
|
|
49
|
-
italic: false,
|
|
50
|
-
underline: false,
|
|
51
|
-
strikethrough: false,
|
|
52
|
-
wrap: 'wrap'
|
|
53
|
-
};
|
|
54
|
-
exports.default = Text;
|
|
38
|
+
return (React.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: 'row', textWrap: wrap }, internal_transform: transform }, children));
|
|
39
|
+
}
|
|
55
40
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAsDtC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC5B,KAAK,EACL,eAAe,EACf,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,KAAK,EACZ,MAAM,GAAG,KAAK,EACd,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,KAAK,EACrB,OAAO,GAAG,KAAK,EACf,IAAI,GAAG,MAAM,EACb,QAAQ,EACD;IACP,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,EAAE;QAChD,OAAO,IAAI,CAAC;KACZ;IAED,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAU,EAAE;QAC9C,IAAI,QAAQ,EAAE;YACb,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SAC/B;QAED,IAAI,KAAK,EAAE;YACV,QAAQ,GAAG,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;SACnD;QAED,IAAI,eAAe,EAAE;YACpB,QAAQ,GAAG,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;SAC7D;QAED,IAAI,IAAI,EAAE;YACT,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAChC;QAED,IAAI,MAAM,EAAE;YACX,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SAClC;QAED,IAAI,SAAS,EAAE;YACd,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;SACrC;QAED,IAAI,aAAa,EAAE;YAClB,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;SACzC;QAED,IAAI,OAAO,EAAE;YACZ,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACnC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACN,kCACC,KAAK,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAC,EACzE,kBAAkB,EAAE,SAAS,IAE5B,QAAQ,CACC,CACX,CAAC;AACH,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type Props = {
|
|
3
3
|
/**
|
|
4
4
|
* Function which transforms children output. It accepts children and must return transformed children too.
|
|
5
5
|
*/
|
|
6
6
|
readonly transform: (children: string) => string;
|
|
7
7
|
readonly children?: ReactNode;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
/**
|
|
10
10
|
* Transform a string representation of React components before they are written to output.
|
|
11
11
|
* For example, you might want to apply a gradient to text, add a clickable link or create some text effects.
|
|
12
12
|
* These use cases can't accept React nodes as input, they are expecting a string.
|
|
13
13
|
* That's what <Transform> component does, it gives you an output string of its child components and lets you transform it in any way.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
export default Transform;
|
|
15
|
+
export default function Transform({ children, transform }: Props): JSX.Element | null;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
1
|
+
import React from 'react';
|
|
7
2
|
/**
|
|
8
3
|
* Transform a string representation of React components before they are written to output.
|
|
9
4
|
* For example, you might want to apply a gradient to text, add a clickable link or create some text effects.
|
|
10
5
|
* These use cases can't accept React nodes as input, they are expecting a string.
|
|
11
6
|
* That's what <Transform> component does, it gives you an output string of its child components and lets you transform it in any way.
|
|
12
7
|
*/
|
|
13
|
-
|
|
8
|
+
export default function Transform({ children, transform }) {
|
|
14
9
|
if (children === undefined || children === null) {
|
|
15
10
|
return null;
|
|
16
11
|
}
|
|
17
|
-
return (
|
|
18
|
-
}
|
|
19
|
-
Transform.displayName = 'Transform';
|
|
20
|
-
exports.default = Transform;
|
|
12
|
+
return (React.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: 'row' }, internal_transform: transform }, children));
|
|
13
|
+
}
|
|
21
14
|
//# sourceMappingURL=Transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../src/components/Transform.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../src/components/Transform.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAW5C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAQ;IAC7D,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,EAAE;QAChD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,CACN,kCACC,KAAK,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAC,EACzD,kBAAkB,EAAE,SAAS,IAE5B,QAAQ,CACC,CACX,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
1
|
// Ignoring missing types error to avoid adding another dependency for this hack to work
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import ws from 'ws';
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
9
4
|
const customGlobal = global;
|
|
10
5
|
// These things must exist before importing `react-devtools-core`
|
|
11
6
|
if (!customGlobal.WebSocket) {
|
|
12
|
-
customGlobal.WebSocket =
|
|
7
|
+
customGlobal.WebSocket = ws;
|
|
13
8
|
}
|
|
14
9
|
if (!customGlobal.window) {
|
|
15
10
|
customGlobal.window = global;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-window-polyfill.js","sourceRoot":"","sources":["../src/devtools-window-polyfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devtools-window-polyfill.js","sourceRoot":"","sources":["../src/devtools-window-polyfill.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,mEAAmE;AACnE,MAAM,YAAY,GAAG,MAAa,CAAC;AAEnC,iEAAiE;AACjE,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;IAC5B,YAAY,CAAC,SAAS,GAAG,EAAE,CAAC;CAC5B;AAED,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;IACzB,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC;CAC7B;AAED,yEAAyE;AACzE,8EAA8E;AAC9E,gFAAgF;AAChF,sIAAsI;AACtI,YAAY,CAAC,MAAM,CAAC,oCAAoC,GAAG;IAC1D;QACC,6BAA6B;QAC7B,IAAI,EAAE,CAAC;QACP,2BAA2B;QAC3B,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,IAAI;KACf;IACD;QACC,6BAA6B;QAC7B,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;KACb;IACD;QACC,6BAA6B;QAC7B,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,oBAAoB;QAC3B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;KACb;IACD;QACC,6BAA6B;QAC7B,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,uBAAuB;QAC9B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;KACb;IACD;QACC,6BAA6B;QAC7B,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,uBAAuB;QAC9B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;KACb;IACD;QACC,6BAA6B;QAC7B,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,sBAAsB;QAC7B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;KACb;IACD;QACC,6BAA6B;QAC7B,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,sBAAsB;QAC7B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;KACb;CACD,CAAC"}
|
package/build/devtools.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import './devtools-window-polyfill';
|
|
1
|
+
import './devtools-window-polyfill.js';
|
package/build/devtools.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
// eslint-disable-next-line import/no-unassigned-import
|
|
4
|
-
|
|
5
|
-
// @ts-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import './devtools-window-polyfill.js';
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
+
// @ts-expect-error
|
|
5
|
+
import devtools from 'react-devtools-core';
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
7
|
+
devtools.connectToDevTools();
|
|
8
8
|
//# sourceMappingURL=devtools.js.map
|
package/build/devtools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.js","sourceRoot":"","sources":["../src/devtools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devtools.js","sourceRoot":"","sources":["../src/devtools.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,+BAA+B,CAAC;AAEvC,6DAA6D;AAC7D,mBAAmB;AACnB,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,6DAA6D;AAC5D,QAAgB,CAAC,iBAAiB,EAAE,CAAC"}
|
package/build/dom.d.ts
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
yogaNode?: Yoga.YogaNode;
|
|
1
|
+
import { type Node as YogaNode } from 'yoga-wasm-web/auto';
|
|
2
|
+
import { type Styles } from './styles.js';
|
|
3
|
+
import { type OutputTransformer } from './render-node-to-output.js';
|
|
4
|
+
type InkNode = {
|
|
5
|
+
parentNode: DOMElement | undefined;
|
|
6
|
+
yogaNode?: YogaNode;
|
|
8
7
|
internal_static?: boolean;
|
|
9
8
|
style: Styles;
|
|
10
|
-
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export declare type DOMElement = {
|
|
9
|
+
};
|
|
10
|
+
export type TextName = '#text';
|
|
11
|
+
export type ElementNames = 'ink-root' | 'ink-box' | 'ink-text' | 'ink-virtual-text';
|
|
12
|
+
export type NodeNames = ElementNames | TextName;
|
|
13
|
+
export type DOMElement = {
|
|
16
14
|
nodeName: ElementNames;
|
|
17
|
-
attributes:
|
|
18
|
-
[key: string]: DOMNodeAttribute;
|
|
19
|
-
};
|
|
15
|
+
attributes: Record<string, DOMNodeAttribute>;
|
|
20
16
|
childNodes: DOMNode[];
|
|
21
17
|
internal_transform?: OutputTransformer;
|
|
22
18
|
isStaticDirty?: boolean;
|
|
23
|
-
staticNode?:
|
|
19
|
+
staticNode?: DOMElement;
|
|
20
|
+
onComputeLayout?: () => void;
|
|
24
21
|
onRender?: () => void;
|
|
25
22
|
onImmediateRender?: () => void;
|
|
26
23
|
} & InkNode;
|
|
27
|
-
export
|
|
24
|
+
export type TextNode = {
|
|
28
25
|
nodeName: TextName;
|
|
29
26
|
nodeValue: string;
|
|
30
27
|
} & InkNode;
|
|
31
|
-
export
|
|
28
|
+
export type DOMNode<T = {
|
|
32
29
|
nodeName: NodeNames;
|
|
33
30
|
}> = T extends {
|
|
34
31
|
nodeName: infer U;
|
|
35
32
|
} ? U extends '#text' ? TextNode : DOMElement : never;
|
|
36
|
-
export
|
|
33
|
+
export type DOMNodeAttribute = boolean | string | number;
|
|
37
34
|
export declare const createNode: (nodeName: ElementNames) => DOMElement;
|
|
38
35
|
export declare const appendChildNode: (node: DOMElement, childNode: DOMElement) => void;
|
|
39
36
|
export declare const insertBeforeNode: (node: DOMElement, newChildNode: DOMNode, beforeChildNode: DOMNode) => void;
|
package/build/dom.js
CHANGED
|
@@ -1,72 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const measure_text_1 = __importDefault(require("./measure-text"));
|
|
9
|
-
const styles_1 = __importDefault(require("./styles"));
|
|
10
|
-
const wrap_text_1 = __importDefault(require("./wrap-text"));
|
|
11
|
-
const squash_text_nodes_1 = __importDefault(require("./squash-text-nodes"));
|
|
12
|
-
exports.TEXT_NAME = '#text';
|
|
13
|
-
exports.createNode = (nodeName) => {
|
|
14
|
-
var _a;
|
|
1
|
+
// eslint-disable-next-line n/file-extension-in-import
|
|
2
|
+
import Yoga from 'yoga-wasm-web/auto';
|
|
3
|
+
import measureText from './measure-text.js';
|
|
4
|
+
import applyStyles from './styles.js';
|
|
5
|
+
import wrapText from './wrap-text.js';
|
|
6
|
+
import squashTextNodes from './squash-text-nodes.js';
|
|
7
|
+
export const createNode = (nodeName) => {
|
|
15
8
|
const node = {
|
|
16
9
|
nodeName,
|
|
17
10
|
style: {},
|
|
18
11
|
attributes: {},
|
|
19
12
|
childNodes: [],
|
|
20
|
-
parentNode:
|
|
21
|
-
yogaNode: nodeName === 'ink-virtual-text' ? undefined :
|
|
13
|
+
parentNode: undefined,
|
|
14
|
+
yogaNode: nodeName === 'ink-virtual-text' ? undefined : Yoga.Node.create()
|
|
22
15
|
};
|
|
23
16
|
if (nodeName === 'ink-text') {
|
|
24
|
-
|
|
17
|
+
node.yogaNode?.setMeasureFunc(measureTextNode.bind(null, node));
|
|
25
18
|
}
|
|
26
19
|
return node;
|
|
27
20
|
};
|
|
28
|
-
|
|
29
|
-
var _a;
|
|
21
|
+
export const appendChildNode = (node, childNode) => {
|
|
30
22
|
if (childNode.parentNode) {
|
|
31
|
-
|
|
23
|
+
removeChildNode(childNode.parentNode, childNode);
|
|
32
24
|
}
|
|
33
25
|
childNode.parentNode = node;
|
|
34
26
|
node.childNodes.push(childNode);
|
|
35
27
|
if (childNode.yogaNode) {
|
|
36
|
-
|
|
28
|
+
node.yogaNode?.insertChild(childNode.yogaNode, node.yogaNode.getChildCount());
|
|
37
29
|
}
|
|
38
30
|
if (node.nodeName === 'ink-text' || node.nodeName === 'ink-virtual-text') {
|
|
39
31
|
markNodeAsDirty(node);
|
|
40
32
|
}
|
|
41
33
|
};
|
|
42
|
-
|
|
43
|
-
var _a, _b;
|
|
34
|
+
export const insertBeforeNode = (node, newChildNode, beforeChildNode) => {
|
|
44
35
|
if (newChildNode.parentNode) {
|
|
45
|
-
|
|
36
|
+
removeChildNode(newChildNode.parentNode, newChildNode);
|
|
46
37
|
}
|
|
47
38
|
newChildNode.parentNode = node;
|
|
48
39
|
const index = node.childNodes.indexOf(beforeChildNode);
|
|
49
40
|
if (index >= 0) {
|
|
50
41
|
node.childNodes.splice(index, 0, newChildNode);
|
|
51
42
|
if (newChildNode.yogaNode) {
|
|
52
|
-
|
|
43
|
+
node.yogaNode?.insertChild(newChildNode.yogaNode, index);
|
|
53
44
|
}
|
|
54
45
|
return;
|
|
55
46
|
}
|
|
56
47
|
node.childNodes.push(newChildNode);
|
|
57
48
|
if (newChildNode.yogaNode) {
|
|
58
|
-
|
|
49
|
+
node.yogaNode?.insertChild(newChildNode.yogaNode, node.yogaNode.getChildCount());
|
|
59
50
|
}
|
|
60
51
|
if (node.nodeName === 'ink-text' || node.nodeName === 'ink-virtual-text') {
|
|
61
52
|
markNodeAsDirty(node);
|
|
62
53
|
}
|
|
63
54
|
};
|
|
64
|
-
|
|
65
|
-
var _a, _b;
|
|
55
|
+
export const removeChildNode = (node, removeNode) => {
|
|
66
56
|
if (removeNode.yogaNode) {
|
|
67
|
-
|
|
57
|
+
removeNode.parentNode?.yogaNode?.removeChild(removeNode.yogaNode);
|
|
68
58
|
}
|
|
69
|
-
removeNode.parentNode =
|
|
59
|
+
removeNode.parentNode = undefined;
|
|
70
60
|
const index = node.childNodes.indexOf(removeNode);
|
|
71
61
|
if (index >= 0) {
|
|
72
62
|
node.childNodes.splice(index, 1);
|
|
@@ -75,30 +65,29 @@ exports.removeChildNode = (node, removeNode) => {
|
|
|
75
65
|
markNodeAsDirty(node);
|
|
76
66
|
}
|
|
77
67
|
};
|
|
78
|
-
|
|
68
|
+
export const setAttribute = (node, key, value) => {
|
|
79
69
|
node.attributes[key] = value;
|
|
80
70
|
};
|
|
81
|
-
|
|
71
|
+
export const setStyle = (node, style) => {
|
|
82
72
|
node.style = style;
|
|
83
73
|
if (node.yogaNode) {
|
|
84
|
-
|
|
74
|
+
applyStyles(node.yogaNode, style);
|
|
85
75
|
}
|
|
86
76
|
};
|
|
87
|
-
|
|
77
|
+
export const createTextNode = (text) => {
|
|
88
78
|
const node = {
|
|
89
79
|
nodeName: '#text',
|
|
90
80
|
nodeValue: text,
|
|
91
81
|
yogaNode: undefined,
|
|
92
|
-
parentNode:
|
|
82
|
+
parentNode: undefined,
|
|
93
83
|
style: {}
|
|
94
84
|
};
|
|
95
|
-
|
|
85
|
+
setTextNodeValue(node, text);
|
|
96
86
|
return node;
|
|
97
87
|
};
|
|
98
88
|
const measureTextNode = function (node, width) {
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
const dimensions = measure_text_1.default(text);
|
|
89
|
+
const text = node.nodeName === '#text' ? node.nodeValue : squashTextNodes(node);
|
|
90
|
+
const dimensions = measureText(text);
|
|
102
91
|
// Text fits into container, no need to wrap
|
|
103
92
|
if (dimensions.width <= width) {
|
|
104
93
|
return dimensions;
|
|
@@ -108,23 +97,22 @@ const measureTextNode = function (node, width) {
|
|
|
108
97
|
if (dimensions.width >= 1 && width > 0 && width < 1) {
|
|
109
98
|
return dimensions;
|
|
110
99
|
}
|
|
111
|
-
const textWrap =
|
|
112
|
-
const wrappedText =
|
|
113
|
-
return
|
|
100
|
+
const textWrap = node.style?.textWrap ?? 'wrap';
|
|
101
|
+
const wrappedText = wrapText(text, width, textWrap);
|
|
102
|
+
return measureText(wrappedText);
|
|
114
103
|
};
|
|
115
104
|
const findClosestYogaNode = (node) => {
|
|
116
|
-
|
|
117
|
-
if (!node || !node.parentNode) {
|
|
105
|
+
if (!node?.parentNode) {
|
|
118
106
|
return undefined;
|
|
119
107
|
}
|
|
120
|
-
return
|
|
108
|
+
return node.yogaNode ?? findClosestYogaNode(node.parentNode);
|
|
121
109
|
};
|
|
122
110
|
const markNodeAsDirty = (node) => {
|
|
123
111
|
// Mark closest Yoga node as dirty to measure text dimensions again
|
|
124
112
|
const yogaNode = findClosestYogaNode(node);
|
|
125
|
-
yogaNode
|
|
113
|
+
yogaNode?.markDirty();
|
|
126
114
|
};
|
|
127
|
-
|
|
115
|
+
export const setTextNodeValue = (node, text) => {
|
|
128
116
|
if (typeof text !== 'string') {
|
|
129
117
|
text = String(text);
|
|
130
118
|
}
|
package/build/dom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,IAA6B,MAAM,oBAAoB,CAAC;AAC/D,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,WAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,eAAe,MAAM,wBAAwB,CAAC;AAmDrD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAsB,EAAc,EAAE;IAChE,MAAM,IAAI,GAAe;QACxB,QAAQ;QACR,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,QAAQ,KAAK,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;KAC1E,CAAC;IAEF,IAAI,QAAQ,KAAK,UAAU,EAAE;QAC5B,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;KAChE;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC9B,IAAgB,EAChB,SAAqB,EACd,EAAE;IACT,IAAI,SAAS,CAAC,UAAU,EAAE;QACzB,eAAe,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KACjD;IAED,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC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gB,GAAG,CAAC,IAAc,EAAE,IAAY,EAAQ,EAAE;IACtE,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;KACpB;IAED,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACtB,eAAe,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC,CAAC"}
|
package/build/get-max-width.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
1
|
+
import { type Node as YogaNode } from 'yoga-wasm-web/auto';
|
|
2
|
+
declare const getMaxWidth: (yogaNode: YogaNode) => number;
|
|
3
|
+
export default getMaxWidth;
|