@termdraw/opentui 0.3.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/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/app.d.ts +71 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +826 -0
- package/dist/draw-state.d.ts +207 -0
- package/dist/draw-state.d.ts.map +1 -0
- package/dist/draw-state.js +2058 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/react.d.ts +22 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +30 -0
- package/package.json +77 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TermDrawAppRenderable, TermDrawEditorRenderable, TermDrawRenderable, buildHelpText, formatSavedOutput, type TermDrawAppRenderableOptions, type TermDrawEditorRenderableOptions, type TermDrawRenderableOptions } from "./app.js";
|
|
2
|
+
import { TERM_DRAW_APP_COMPONENT_NAME, TERM_DRAW_COMPONENT_NAME, TERM_DRAW_EDITOR_COMPONENT_NAME, TermDraw, TermDrawApp, TermDrawEditor, registerTermDrawComponent, registerTermDrawComponents, type TermDrawAppProps, type TermDrawEditorProps, type TermDrawProps } from "./react.js";
|
|
3
|
+
export { TERM_DRAW_APP_COMPONENT_NAME, TERM_DRAW_COMPONENT_NAME, TERM_DRAW_EDITOR_COMPONENT_NAME, TermDraw, TermDrawApp, TermDrawAppRenderable, TermDrawEditor, TermDrawEditorRenderable, TermDrawRenderable, buildHelpText, formatSavedOutput, registerTermDrawComponent, registerTermDrawComponents, type TermDrawAppProps, type TermDrawAppRenderableOptions, type TermDrawEditorProps, type TermDrawEditorRenderableOptions, type TermDrawProps, type TermDrawRenderableOptions, };
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC/B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,QAAQ,EACR,WAAW,EACX,cAAc,EACd,yBAAyB,EACzB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,QAAQ,EACR,WAAW,EACX,qBAAqB,EACrB,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,KAAK,aAAa,EAClB,KAAK,yBAAyB,GAC/B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TermDrawAppRenderable, TermDrawEditorRenderable, TermDrawRenderable, buildHelpText, formatSavedOutput, } from "./app.js";
|
|
2
|
+
import { TERM_DRAW_APP_COMPONENT_NAME, TERM_DRAW_COMPONENT_NAME, TERM_DRAW_EDITOR_COMPONENT_NAME, TermDraw, TermDrawApp, TermDrawEditor, registerTermDrawComponent, registerTermDrawComponents, } from "./react.js";
|
|
3
|
+
export { TERM_DRAW_APP_COMPONENT_NAME, TERM_DRAW_COMPONENT_NAME, TERM_DRAW_EDITOR_COMPONENT_NAME, TermDraw, TermDrawApp, TermDrawAppRenderable, TermDrawEditor, TermDrawEditorRenderable, TermDrawRenderable, buildHelpText, formatSavedOutput, registerTermDrawComponent, registerTermDrawComponents, };
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type ExtendedComponentProps } from "@opentui/react";
|
|
3
|
+
import { TermDrawAppRenderable, TermDrawEditorRenderable } from "./app.js";
|
|
4
|
+
export declare const TERM_DRAW_COMPONENT_NAME = "term-draw";
|
|
5
|
+
export declare const TERM_DRAW_APP_COMPONENT_NAME = "term-draw-app";
|
|
6
|
+
export declare const TERM_DRAW_EDITOR_COMPONENT_NAME = "term-draw-editor";
|
|
7
|
+
export declare function registerTermDrawComponent(): void;
|
|
8
|
+
export declare const registerTermDrawComponents: typeof registerTermDrawComponent;
|
|
9
|
+
declare module "@opentui/react" {
|
|
10
|
+
interface OpenTUIComponents {
|
|
11
|
+
"term-draw": typeof TermDrawAppRenderable;
|
|
12
|
+
"term-draw-app": typeof TermDrawAppRenderable;
|
|
13
|
+
"term-draw-editor": typeof TermDrawEditorRenderable;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export type TermDrawProps = ExtendedComponentProps<typeof TermDrawAppRenderable>;
|
|
17
|
+
export type TermDrawAppProps = ExtendedComponentProps<typeof TermDrawAppRenderable>;
|
|
18
|
+
export type TermDrawEditorProps = ExtendedComponentProps<typeof TermDrawEditorRenderable>;
|
|
19
|
+
export declare function TermDraw(props: TermDrawProps): React.ReactElement;
|
|
20
|
+
export declare function TermDrawApp(props: TermDrawAppProps): React.ReactElement;
|
|
21
|
+
export declare function TermDrawEditor(props: TermDrawEditorProps): React.ReactElement;
|
|
22
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAU,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE3E,eAAO,MAAM,wBAAwB,cAAc,CAAC;AACpD,eAAO,MAAM,4BAA4B,kBAAkB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,qBAAqB,CAAC;AAIlE,wBAAgB,yBAAyB,IAAI,IAAI,CAUhD;AAED,eAAO,MAAM,0BAA0B,kCAA4B,CAAC;AAEpE,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,iBAAiB;QACzB,WAAW,EAAE,OAAO,qBAAqB,CAAC;QAC1C,eAAe,EAAE,OAAO,qBAAqB,CAAC;QAC9C,kBAAkB,EAAE,OAAO,wBAAwB,CAAC;KACrD;CACF;AAED,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACjF,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpF,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1F,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CAGjE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAGvE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAG7E"}
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { extend } from "@opentui/react";
|
|
3
|
+
import { TermDrawAppRenderable, TermDrawEditorRenderable } from "./app.js";
|
|
4
|
+
export const TERM_DRAW_COMPONENT_NAME = "term-draw";
|
|
5
|
+
export const TERM_DRAW_APP_COMPONENT_NAME = "term-draw-app";
|
|
6
|
+
export const TERM_DRAW_EDITOR_COMPONENT_NAME = "term-draw-editor";
|
|
7
|
+
let registered = false;
|
|
8
|
+
export function registerTermDrawComponent() {
|
|
9
|
+
if (registered)
|
|
10
|
+
return;
|
|
11
|
+
extend({
|
|
12
|
+
[TERM_DRAW_COMPONENT_NAME]: TermDrawAppRenderable,
|
|
13
|
+
[TERM_DRAW_APP_COMPONENT_NAME]: TermDrawAppRenderable,
|
|
14
|
+
[TERM_DRAW_EDITOR_COMPONENT_NAME]: TermDrawEditorRenderable,
|
|
15
|
+
});
|
|
16
|
+
registered = true;
|
|
17
|
+
}
|
|
18
|
+
export const registerTermDrawComponents = registerTermDrawComponent;
|
|
19
|
+
export function TermDraw(props) {
|
|
20
|
+
registerTermDrawComponent();
|
|
21
|
+
return React.createElement(TERM_DRAW_COMPONENT_NAME, props);
|
|
22
|
+
}
|
|
23
|
+
export function TermDrawApp(props) {
|
|
24
|
+
registerTermDrawComponent();
|
|
25
|
+
return React.createElement(TERM_DRAW_APP_COMPONENT_NAME, props);
|
|
26
|
+
}
|
|
27
|
+
export function TermDrawEditor(props) {
|
|
28
|
+
registerTermDrawComponent();
|
|
29
|
+
return React.createElement(TERM_DRAW_EDITOR_COMPONENT_NAME, props);
|
|
30
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@termdraw/opentui",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "OpenTUI components and renderables for embedding termDRAW in terminal apps.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ascii-art",
|
|
7
|
+
"diagram",
|
|
8
|
+
"drawing",
|
|
9
|
+
"opentui",
|
|
10
|
+
"react",
|
|
11
|
+
"terminal",
|
|
12
|
+
"tui"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/benvinegar/termdraw/tree/main/packages/opentui#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/benvinegar/termdraw/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Ben Vinegar",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/benvinegar/termdraw.git"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"module": "./dist/index.js",
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"clean": "rm -rf dist",
|
|
46
|
+
"build": "bun run clean && bun run build:lib",
|
|
47
|
+
"build:lib": "tsc -p tsconfig.build.json",
|
|
48
|
+
"check": "bun run format:check && bun run lint && bun test && bun run typecheck",
|
|
49
|
+
"pack:check": "bun run build && npm pack --dry-run --ignore-scripts",
|
|
50
|
+
"prepack": "bun run build",
|
|
51
|
+
"prepublishOnly": "bun run lint && bun test && bun run typecheck",
|
|
52
|
+
"test": "bun test",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"format": "oxfmt .",
|
|
55
|
+
"format:check": "oxfmt --check .",
|
|
56
|
+
"lint": "oxlint .",
|
|
57
|
+
"lint:fix": "oxlint --fix ."
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@opentui/core": "^0.1.97",
|
|
61
|
+
"@opentui/react": "^0.1.97",
|
|
62
|
+
"@types/bun": "latest",
|
|
63
|
+
"@types/react": "^19.2.14",
|
|
64
|
+
"oxfmt": "^0.44.0",
|
|
65
|
+
"oxlint": "^1.59.0",
|
|
66
|
+
"react": "^19.2.5",
|
|
67
|
+
"typescript": "^5.9.3"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@opentui/core": "^0.1.97",
|
|
71
|
+
"@opentui/react": "^0.1.97",
|
|
72
|
+
"react": "^19.0.0"
|
|
73
|
+
},
|
|
74
|
+
"engines": {
|
|
75
|
+
"bun": ">=1.3.0"
|
|
76
|
+
}
|
|
77
|
+
}
|