linecraft 0.2.0 → 0.2.2
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/LICENSE +0 -1
- package/README.md +34 -8
- package/lib/component.d.ts +34 -0
- package/lib/component.d.ts.map +1 -0
- package/lib/component.js +42 -0
- package/lib/component.js.map +1 -0
- package/lib/components/code-debug.d.ts +35 -0
- package/lib/components/code-debug.d.ts.map +1 -0
- package/lib/components/code-debug.js +294 -0
- package/lib/components/code-debug.js.map +1 -0
- package/lib/components/fill.d.ts +15 -0
- package/lib/components/fill.d.ts.map +1 -0
- package/lib/components/fill.js +37 -0
- package/lib/components/fill.js.map +1 -0
- package/lib/components/index.d.ts +2 -2
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/index.js.map +1 -1
- package/lib/components/progress-bar-grid.d.ts +1 -1
- package/lib/components/progress-bar-grid.d.ts.map +1 -1
- package/lib/components/progress-bar-grid.js +6 -6
- package/lib/components/progress-bar-grid.js.map +1 -1
- package/lib/components/prompt.d.ts +4 -5
- package/lib/components/prompt.d.ts.map +1 -1
- package/lib/components/prompt.js +17 -69
- package/lib/components/prompt.js.map +1 -1
- package/lib/components/section.d.ts +33 -0
- package/lib/components/section.d.ts.map +1 -0
- package/lib/components/section.js +178 -0
- package/lib/components/section.js.map +1 -0
- package/lib/components/segments.d.ts +26 -0
- package/lib/components/segments.d.ts.map +1 -0
- package/lib/components/segments.js +105 -0
- package/lib/components/segments.js.map +1 -0
- package/lib/components/spinner.d.ts +18 -16
- package/lib/components/spinner.d.ts.map +1 -1
- package/lib/components/spinner.js +63 -47
- package/lib/components/spinner.js.map +1 -1
- package/lib/components/style.test.js +11 -11
- package/lib/components/style.test.js.map +1 -1
- package/lib/components/styled.d.ts +17 -0
- package/lib/components/styled.d.ts.map +1 -0
- package/lib/components/styled.js +107 -0
- package/lib/components/styled.js.map +1 -0
- package/lib/components/styled.test.d.ts +2 -0
- package/lib/components/styled.test.d.ts.map +1 -0
- package/lib/components/styled.test.js +135 -0
- package/lib/components/styled.test.js.map +1 -0
- package/lib/index.d.ts +17 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -13
- package/lib/index.js.map +1 -1
- package/lib/index.test.js +17 -11
- package/lib/index.test.js.map +1 -1
- package/lib/layout/grid.d.ts +31 -35
- package/lib/layout/grid.d.ts.map +1 -1
- package/lib/layout/grid.js +437 -216
- package/lib/layout/grid.js.map +1 -1
- package/lib/layout/grid.test.js +332 -36
- package/lib/layout/grid.test.js.map +1 -1
- package/lib/native/ansi.d.ts +9 -0
- package/lib/native/ansi.d.ts.map +1 -1
- package/lib/native/ansi.js +9 -0
- package/lib/native/ansi.js.map +1 -1
- package/lib/native/diff.d.ts +5 -1
- package/lib/native/diff.d.ts.map +1 -1
- package/lib/native/diff.js +25 -7
- package/lib/native/diff.js.map +1 -1
- package/lib/native/region-renderer-debug.test.d.ts +2 -0
- package/lib/native/region-renderer-debug.test.d.ts.map +1 -0
- package/lib/native/region-renderer-debug.test.js +45 -0
- package/lib/native/region-renderer-debug.test.js.map +1 -0
- package/lib/native/region-renderer.d.ts +57 -148
- package/lib/native/region-renderer.d.ts.map +1 -1
- package/lib/native/region-renderer.js +455 -1124
- package/lib/native/region-renderer.js.map +1 -1
- package/lib/native/region.test.js +2 -20
- package/lib/native/region.test.js.map +1 -1
- package/lib/region-resize.test.d.ts +2 -0
- package/lib/region-resize.test.d.ts.map +1 -0
- package/lib/region-resize.test.js +124 -0
- package/lib/region-resize.test.js.map +1 -0
- package/lib/region.d.ts +97 -9
- package/lib/region.d.ts.map +1 -1
- package/lib/region.js +591 -185
- package/lib/region.js.map +1 -1
- package/lib/region.test.js +3 -3
- package/lib/region.test.js.map +1 -1
- package/lib/types.d.ts +9 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/file-link.d.ts +16 -0
- package/lib/utils/file-link.d.ts.map +1 -0
- package/lib/utils/file-link.js +23 -0
- package/lib/utils/file-link.js.map +1 -0
- package/lib/utils/prompt.d.ts +15 -0
- package/lib/utils/prompt.d.ts.map +1 -0
- package/lib/utils/prompt.js +128 -0
- package/lib/utils/prompt.js.map +1 -0
- package/lib/utils/terminal-theme.d.ts +36 -0
- package/lib/utils/terminal-theme.d.ts.map +1 -0
- package/lib/utils/terminal-theme.js +61 -0
- package/lib/utils/terminal-theme.js.map +1 -0
- package/lib/utils/text.d.ts +53 -3
- package/lib/utils/text.d.ts.map +1 -1
- package/lib/utils/text.js +194 -36
- package/lib/utils/text.js.map +1 -1
- package/lib/utils/wait-for-spacebar.d.ts.map +1 -1
- package/lib/utils/wait-for-spacebar.js +9 -6
- package/lib/utils/wait-for-spacebar.js.map +1 -1
- package/package.json +17 -13
package/lib/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export { TerminalRegion } from './region';
|
|
1
|
+
export { TerminalRegion, SectionReference, ComponentReference } from './region';
|
|
2
2
|
export { getTerminalWidth, getTerminalHeight, isTTY, onResize } from './utils/terminal';
|
|
3
3
|
// Grid system
|
|
4
|
-
export { grid
|
|
5
|
-
export {
|
|
4
|
+
export { grid as Grid } from './layout/grid';
|
|
5
|
+
export { Styled } from './components/styled';
|
|
6
|
+
export { fill } from './components/fill';
|
|
7
|
+
export { Section } from './components/section';
|
|
8
|
+
export { Spinner } from './components/spinner';
|
|
9
|
+
export { Segments } from './components/segments';
|
|
10
|
+
export { CodeDebug } from './components/code-debug';
|
|
6
11
|
// progressBar is exported below as a function
|
|
7
|
-
export {
|
|
12
|
+
export { prompt } from './utils/prompt';
|
|
8
13
|
import { TerminalRegion } from './region';
|
|
9
14
|
import { progressBar as progressBarGrid } from './components/progress-bar-grid';
|
|
10
|
-
|
|
11
|
-
export function region(options) {
|
|
15
|
+
export function Region(options) {
|
|
12
16
|
return new TerminalRegion(options);
|
|
13
17
|
}
|
|
14
|
-
// Keep createRegion as
|
|
15
|
-
export const
|
|
18
|
+
// Keep region and createRegion as aliases for backward compatibility
|
|
19
|
+
export const region = Region;
|
|
20
|
+
export const createRegion = Region;
|
|
16
21
|
// Grid-based progress bar (returns Component)
|
|
17
22
|
export function progressBar(options) {
|
|
18
23
|
return progressBarGrid(options);
|
|
19
24
|
}
|
|
20
25
|
// Keep createProgressBar as alias for backward compatibility
|
|
21
26
|
export const createProgressBar = progressBar;
|
|
22
|
-
export function spinner(region, lineNumber, options) {
|
|
23
|
-
return new Spinner(region, lineNumber, options);
|
|
24
|
-
}
|
|
25
|
-
// Keep createSpinner as alias for backward compatibility
|
|
26
|
-
export const createSpinner = spinner;
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACxF,cAAc;AACd,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAsC,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,SAAS,EAA6C,MAAM,yBAAyB,CAAC;AAC/F,8CAA8C;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AASxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAIhF,MAAM,UAAU,MAAM,CAAC,OAAuB;IAC5C,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AAEnC,8CAA8C;AAC9C,MAAM,UAAU,WAAW,CAAC,OAA+B;IACzD,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC"}
|
package/lib/index.test.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
-
import { createRegion, createProgressBar,
|
|
2
|
+
import { createRegion, createProgressBar, Spinner } from './index';
|
|
3
3
|
import { TerminalRegion } from './region';
|
|
4
|
-
import { Spinner } from './components/spinner';
|
|
5
4
|
describe('createRegion', () => {
|
|
6
5
|
it('should create a TerminalRegion instance', () => {
|
|
7
6
|
const region = createRegion({
|
|
@@ -16,7 +15,7 @@ describe('createRegion', () => {
|
|
|
16
15
|
height: 5,
|
|
17
16
|
disableRendering: true,
|
|
18
17
|
});
|
|
19
|
-
expect(region.width).
|
|
18
|
+
expect(region.width).toBeGreaterThan(0);
|
|
20
19
|
expect(region.height).toBe(5);
|
|
21
20
|
region.destroy();
|
|
22
21
|
});
|
|
@@ -53,7 +52,7 @@ describe('createProgressBar', () => {
|
|
|
53
52
|
expect(typeof progressBar).toBe('function');
|
|
54
53
|
});
|
|
55
54
|
});
|
|
56
|
-
describe('
|
|
55
|
+
describe('spinner', () => {
|
|
57
56
|
let region;
|
|
58
57
|
beforeEach(() => {
|
|
59
58
|
region = createRegion({
|
|
@@ -63,18 +62,25 @@ describe('createSpinner', () => {
|
|
|
63
62
|
afterEach(() => {
|
|
64
63
|
region.destroy();
|
|
65
64
|
});
|
|
66
|
-
it('should create a
|
|
67
|
-
const
|
|
68
|
-
expect(
|
|
69
|
-
|
|
65
|
+
it('should create a spinner with render, start, and stop methods', () => {
|
|
66
|
+
const spinnerInstance = Spinner();
|
|
67
|
+
expect(spinnerInstance).toBeDefined();
|
|
68
|
+
expect(typeof spinnerInstance.render).toBe('function');
|
|
69
|
+
expect(typeof spinnerInstance.start).toBe('function');
|
|
70
|
+
expect(typeof spinnerInstance.stop).toBe('function');
|
|
71
|
+
spinnerInstance.stop();
|
|
70
72
|
});
|
|
71
73
|
it('should create a spinner with options', () => {
|
|
72
|
-
const
|
|
74
|
+
const spinnerInstance = Spinner({
|
|
73
75
|
frames: ['-', '\\', '|', '/'],
|
|
74
76
|
interval: 200,
|
|
77
|
+
color: 'yellow',
|
|
75
78
|
});
|
|
76
|
-
expect(
|
|
77
|
-
|
|
79
|
+
expect(spinnerInstance).toBeDefined();
|
|
80
|
+
expect(typeof spinnerInstance.render).toBe('function');
|
|
81
|
+
expect(typeof spinnerInstance.start).toBe('function');
|
|
82
|
+
expect(typeof spinnerInstance.stop).toBe('function');
|
|
83
|
+
spinnerInstance.stop();
|
|
78
84
|
});
|
|
79
85
|
});
|
|
80
86
|
//# sourceMappingURL=index.test.js.map
|
package/lib/index.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,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eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,MAAM,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrD,eAAe,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,eAAe,GAAG,OAAO,CAAC;YAC9B,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC;YAC7B,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAC;QACtC,MAAM,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,MAAM,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrD,eAAe,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/lib/layout/grid.d.ts
CHANGED
|
@@ -1,53 +1,49 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
/**
|
|
4
|
-
* RenderContext provides information needed for rendering
|
|
5
|
-
*/
|
|
6
|
-
export interface RenderContext {
|
|
7
|
-
availableWidth: number;
|
|
8
|
-
region: TerminalRegion;
|
|
9
|
-
columnIndex: number;
|
|
10
|
-
rowIndex: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Component type: function that takes RenderContext and returns string(s) or null
|
|
14
|
-
*/
|
|
15
|
-
export type Component = (ctx: RenderContext) => string | string[] | null;
|
|
1
|
+
import type { FillChar } from '../types';
|
|
2
|
+
import type { Component } from '../component';
|
|
16
3
|
/**
|
|
17
4
|
* Grid template entry: fixed width, flex unit, or minmax
|
|
18
5
|
*/
|
|
19
|
-
export type GridTemplateEntry = number |
|
|
6
|
+
export type GridTemplateEntry = number | 'auto' | '*' | `${number}*` | {
|
|
20
7
|
min: number;
|
|
21
8
|
width: string;
|
|
22
9
|
};
|
|
23
10
|
export interface GridOptions {
|
|
24
|
-
/**
|
|
25
|
-
|
|
11
|
+
/** Explicit column definitions (like CSS grid-template-columns) */
|
|
12
|
+
columns?: GridTemplateEntry[];
|
|
13
|
+
/** Size for implicitly created columns when there are more children than explicit columns (like CSS grid-auto-columns) */
|
|
14
|
+
autoColumns?: GridTemplateEntry;
|
|
15
|
+
/**
|
|
16
|
+
* Column template (deprecated, use `columns` + `autoColumns` instead)
|
|
17
|
+
* When using `template`, the last value acts as the `autoColumns` value for implicitly created columns.
|
|
18
|
+
* Example: `template: [20, 20]` means 2 explicit columns of 20, and auto columns will also be 20.
|
|
19
|
+
*/
|
|
20
|
+
template?: GridTemplateEntry[];
|
|
21
|
+
/**
|
|
22
|
+
* Explicit row definitions (like CSS grid-template-rows)
|
|
23
|
+
* If not specified, rows are created automatically as needed (auto-wrapping).
|
|
24
|
+
* When specified, children wrap to new rows when explicit columns are filled.
|
|
25
|
+
*/
|
|
26
|
+
rows?: number[];
|
|
27
|
+
/**
|
|
28
|
+
* Height for implicitly created rows when there are more children than explicit rows (like CSS grid-auto-rows)
|
|
29
|
+
* Defaults to 1 line if not specified.
|
|
30
|
+
*/
|
|
31
|
+
autoRows?: number;
|
|
26
32
|
/** Spaces between columns (default: 0) */
|
|
27
33
|
columnGap?: number;
|
|
34
|
+
/** Spaces between rows (default: 0) */
|
|
35
|
+
rowGap?: number;
|
|
28
36
|
/** Characters to draw between columns (fills blank space until next column) */
|
|
29
|
-
spaceBetween?:
|
|
30
|
-
char: string;
|
|
31
|
-
color?: Color;
|
|
32
|
-
};
|
|
37
|
+
spaceBetween?: FillChar | FillChar[];
|
|
33
38
|
/** Justify content: 'space-between' for left/right items with flexing middle */
|
|
34
39
|
justify?: 'start' | 'end' | 'center' | 'space-between';
|
|
35
40
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Grid component that renders to region (like flex)
|
|
38
|
-
* This is the internal implementation
|
|
39
|
-
*/
|
|
40
|
-
export interface GridComponent {
|
|
41
|
-
getHeight(): number;
|
|
42
|
-
render(x: number, y: number, width: number): void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Create a grid component that renders to region
|
|
46
|
-
*/
|
|
47
|
-
export declare function createGrid(region: TerminalRegion, options: GridOptions, ...children: Component[]): GridComponent;
|
|
48
41
|
/**
|
|
49
42
|
* Create a grid component (function-based API)
|
|
50
43
|
* This returns a Component that can be used in other grids
|
|
44
|
+
* Accepts Component children, strings (converted to Styled components), or objects with render methods
|
|
51
45
|
*/
|
|
52
|
-
export declare function grid(options: GridOptions, ...children: Component
|
|
46
|
+
export declare function grid(options: GridOptions, ...children: (Component | string | {
|
|
47
|
+
render: Component;
|
|
48
|
+
})[]): Component;
|
|
53
49
|
//# sourceMappingURL=grid.d.ts.map
|
package/lib/layout/grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/layout/grid.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/layout/grid.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,cAAc,CAAC;AA4B7D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,MAAM,GACN,GAAG,GACH,GAAG,MAAM,GAAG,GACZ;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAE9B,0HAA0H;IAC1H,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAE/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAErC,gFAAgF;IAChF,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,eAAe,CAAC;CACxD;AAiPD;;;;GAIG;AACH,wBAAgB,IAAI,CAClB,OAAO,EAAE,WAAW,EACpB,GAAG,QAAQ,EAAE,CAAC,SAAS,GAAG,MAAM,GAAG;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,CAAC,EAAE,GAC1D,SAAS,CAkeX"}
|