@x-otto/tui 0.1.0-alpha.9 → 0.4.0-beta.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/README.md +92 -137
- package/dist/build-revision.json +4 -0
- package/dist/index.d.ts +14713 -2051
- package/dist/index.js +69199 -115
- package/dist/select-rows-C8rsST7Q.js +975 -0
- package/dist/select-rows-plZKwIeW.d.ts +110 -0
- package/dist/select-rows.d.ts +2 -0
- package/dist/select-rows.js +3 -0
- package/package.json +32 -44
- package/dist/Tabable-BRz398OB.d.ts +0 -4129
- package/dist/Tabable-BRz398OB.d.ts.map +0 -1
- package/dist/WizardDialog-y3yLsmoV.js +0 -14
- package/dist/WizardDialog-y3yLsmoV.js.map +0 -1
- package/dist/compat.d.ts +0 -119
- package/dist/compat.d.ts.map +0 -1
- package/dist/compat.js +0 -3
- package/dist/compat.js.map +0 -1
- package/dist/i18n-CpUZSqYB.js +0 -76
- package/dist/i18n-CpUZSqYB.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/standalone.d.ts +0 -324
- package/dist/standalone.d.ts.map +0 -1
- package/dist/standalone.js +0 -2
- package/dist/standalone.js.map +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ThemeColors } from "@x-otto/tui-theme";
|
|
2
|
+
import { ToolRole } from "@x-otto/ui-token";
|
|
3
|
+
|
|
4
|
+
//#region src/contracts/extension.d.ts
|
|
5
|
+
type ExtensionApplies = 'live' | 'next-turn';
|
|
6
|
+
type ExtensionState = 'enabled' | 'disabled' | 'error' | 'busy' | 'awaiting-trust' | 'denied';
|
|
7
|
+
interface ExtensionEntry {
|
|
8
|
+
category: string;
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
state?: ExtensionState;
|
|
13
|
+
description?: string;
|
|
14
|
+
applies?: ExtensionApplies;
|
|
15
|
+
}
|
|
16
|
+
interface ExtensionAction {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
tone?: 'accent' | 'danger' | 'muted';
|
|
20
|
+
}
|
|
21
|
+
interface ExtensionField {
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
tone?: 'text' | 'muted' | 'success' | 'warning' | 'error' | 'accent';
|
|
25
|
+
}
|
|
26
|
+
declare function extensionStateOf(entry: {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
state?: ExtensionState;
|
|
29
|
+
}): ExtensionState;
|
|
30
|
+
interface ExtensionDetail {
|
|
31
|
+
title: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
applies?: ExtensionApplies;
|
|
34
|
+
meta?: string;
|
|
35
|
+
enabled?: boolean;
|
|
36
|
+
state?: ExtensionState;
|
|
37
|
+
metaSuffix?: string;
|
|
38
|
+
actions: readonly ExtensionAction[];
|
|
39
|
+
fields: readonly ExtensionField[];
|
|
40
|
+
fullText?: {
|
|
41
|
+
title: string;
|
|
42
|
+
content: string;
|
|
43
|
+
contentType?: 'markdown' | 'text';
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
type ExtensionActionResult = {
|
|
47
|
+
kind: 'message';
|
|
48
|
+
message: string;
|
|
49
|
+
level?: 'info' | 'success' | 'error';
|
|
50
|
+
} | {
|
|
51
|
+
kind: 'closed';
|
|
52
|
+
};
|
|
53
|
+
interface ExtensionPort {
|
|
54
|
+
subscribe?(listener: () => void): () => void;
|
|
55
|
+
list(): readonly ExtensionEntry[] | Promise<readonly ExtensionEntry[]>;
|
|
56
|
+
detail(category: string, id: string): ExtensionDetail | Promise<ExtensionDetail | undefined>;
|
|
57
|
+
action?(category: string, id: string, value: string, options?: {
|
|
58
|
+
signal?: AbortSignal;
|
|
59
|
+
}): void | ExtensionActionResult | Promise<void | ExtensionActionResult>;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/libs/theme/semantic-color.d.ts
|
|
63
|
+
type ThemeColorRef = keyof ThemeColors | `#${string}`;
|
|
64
|
+
type SoftBorderColorRef = 'softBorder';
|
|
65
|
+
type TranscriptColorRef = ThemeColorRef | ToolRole | SoftBorderColorRef;
|
|
66
|
+
type StatusTagTone = 'success' | 'warning' | 'error' | 'accent' | 'muted';
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/components/primitives/Select/SelectOption.d.ts
|
|
69
|
+
interface SelectOptionSegment {
|
|
70
|
+
text: string;
|
|
71
|
+
tone?: 'accent' | 'success' | 'warning' | 'error' | 'info' | 'muted' | 'text';
|
|
72
|
+
color?: ThemeColorRef;
|
|
73
|
+
dim?: boolean;
|
|
74
|
+
bold?: boolean;
|
|
75
|
+
strikethrough?: boolean;
|
|
76
|
+
italic?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface SelectOptionTag {
|
|
79
|
+
label: string;
|
|
80
|
+
tone?: StatusTagTone;
|
|
81
|
+
}
|
|
82
|
+
interface SelectOption<T = unknown> {
|
|
83
|
+
segments?: readonly SelectOptionSegment[];
|
|
84
|
+
name: string;
|
|
85
|
+
continuation?: readonly (readonly SelectOptionSegment[])[];
|
|
86
|
+
description?: string;
|
|
87
|
+
value?: T;
|
|
88
|
+
group?: string;
|
|
89
|
+
disabled?: boolean;
|
|
90
|
+
trailingLabel?: string;
|
|
91
|
+
statusTag?: SelectOptionTag;
|
|
92
|
+
tags?: readonly SelectOptionTag[];
|
|
93
|
+
searchText?: string;
|
|
94
|
+
labelColor?: 'accent' | 'success' | 'warning' | 'error' | 'info' | 'muted';
|
|
95
|
+
detailHint?: boolean;
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/components/primitives/Select/select-rows.d.ts
|
|
99
|
+
interface SelectRowsOptions {
|
|
100
|
+
numbered?: boolean;
|
|
101
|
+
labelAlignWidth?: number;
|
|
102
|
+
optionGapRows?: number;
|
|
103
|
+
}
|
|
104
|
+
declare function selectRows<T>(options: readonly SelectOption<T>[], innerColumns: number, {
|
|
105
|
+
numbered,
|
|
106
|
+
labelAlignWidth,
|
|
107
|
+
optionGapRows
|
|
108
|
+
}?: SelectRowsOptions): number;
|
|
109
|
+
//#endregion
|
|
110
|
+
export { SelectOptionTag as a, ExtensionAction as c, ExtensionEntry as d, ExtensionField as f, extensionStateOf as h, SelectOptionSegment as i, ExtensionApplies as l, ExtensionState as m, selectRows as n, StatusTagTone as o, ExtensionPort as p, SelectOption as r, TranscriptColorRef as s, SelectRowsOptions as t, ExtensionDetail as u };
|
package/package.json
CHANGED
|
@@ -1,61 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-otto/tui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.4.0-beta.0",
|
|
4
|
+
"description": "终端 UI 应用层(React 19 + ink 7)",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
5
8
|
"type": "module",
|
|
6
9
|
"main": "./dist/index.js",
|
|
7
10
|
"types": "./dist/index.d.ts",
|
|
8
11
|
"exports": {
|
|
9
12
|
".": {
|
|
10
13
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js"
|
|
12
|
-
"default": "./dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./compat": {
|
|
15
|
-
"types": "./dist/compat.d.ts",
|
|
16
|
-
"import": "./dist/compat.js",
|
|
17
|
-
"default": "./dist/compat.js"
|
|
14
|
+
"import": "./dist/index.js"
|
|
18
15
|
},
|
|
19
|
-
"./
|
|
20
|
-
"types": "./dist/
|
|
21
|
-
"import": "./dist/
|
|
22
|
-
"default": "./dist/standalone.js"
|
|
16
|
+
"./select-rows": {
|
|
17
|
+
"types": "./dist/select-rows.d.ts",
|
|
18
|
+
"import": "./dist/select-rows.js"
|
|
23
19
|
}
|
|
24
20
|
},
|
|
25
21
|
"dependencies": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"@x-otto/
|
|
37
|
-
"@x-otto/
|
|
38
|
-
"@x-otto/
|
|
39
|
-
"
|
|
22
|
+
"@types/react": "^19.3.0",
|
|
23
|
+
"@x-otto/autosuggest": "^0.4.0-beta.0",
|
|
24
|
+
"@x-otto/i18n": "^0.4.0-beta.0",
|
|
25
|
+
"@x-otto/kernel": "^0.4.0-beta.0",
|
|
26
|
+
"@x-otto/service": "^0.4.0-beta.0",
|
|
27
|
+
"@x-otto/shared": "^0.4.0-beta.0",
|
|
28
|
+
"@x-otto/tui-focus": "^0.4.0-beta.0",
|
|
29
|
+
"@x-otto/tui-router": "^0.4.0-beta.0",
|
|
30
|
+
"@x-otto/tui-screen": "^0.4.0-beta.0",
|
|
31
|
+
"@x-otto/tui-theme": "^0.4.0-beta.0",
|
|
32
|
+
"@x-otto/ui-model": "^0.4.0-beta.0",
|
|
33
|
+
"@x-otto/ui-token": "^0.4.0-beta.0",
|
|
34
|
+
"@x-otto/universal-refresh": "^0.4.0-beta.0",
|
|
35
|
+
"ink": "8.0.0",
|
|
36
|
+
"markdown-it": "^15.0.1",
|
|
37
|
+
"react": "19.3.1",
|
|
38
|
+
"shiki": "^4.4.3",
|
|
39
|
+
"zustand": "5.0.8",
|
|
40
|
+
"@x-otto/ottofs": "^0.4.0-beta.0"
|
|
40
41
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"ink-testing-library": "4",
|
|
44
|
-
"@x-otto/runtime": "0.1.0-alpha.9"
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "19.3.1"
|
|
45
44
|
},
|
|
46
45
|
"publishConfig": {
|
|
47
46
|
"access": "public",
|
|
48
|
-
"
|
|
49
|
-
"tag": "alpha"
|
|
50
|
-
},
|
|
51
|
-
"files": [
|
|
52
|
-
"dist",
|
|
53
|
-
"README.md"
|
|
54
|
-
],
|
|
55
|
-
"scripts": {
|
|
56
|
-
"build": "tsdown",
|
|
57
|
-
"test": "vitest run",
|
|
58
|
-
"typecheck": "tsc --noEmit",
|
|
59
|
-
"clean": "rm -rf dist"
|
|
47
|
+
"tag": "beta"
|
|
60
48
|
}
|
|
61
|
-
}
|
|
49
|
+
}
|