@openviking/react 0.1.3 → 0.1.5
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.arco-design +21 -0
- package/README.md +27 -15
- package/dist/0~0.js +19 -0
- package/dist/28~0.js +15 -0
- package/dist/2~0.js +2270 -29
- package/dist/2~0.js.LICENSE.txt +23 -0
- package/dist/3c~0.js +2208 -0
- package/dist/3~0.js +1207 -1982
- package/dist/4~0.js +18 -0
- package/dist/9~0.js +43 -0
- package/dist/{1~0.js → ae~0.js} +11 -26
- package/dist/ark-message-list-view~0.js +530 -119
- package/dist/a~0.js +1300 -14
- package/dist/c7~0.js +38 -2
- package/dist/ck~0.js +23 -0
- package/dist/client/provider.d.ts +15 -9
- package/dist/client/types.d.ts +5 -5
- package/dist/client.js +2 -1
- package/dist/components/agent-connect/agent-connect-code-block.d.ts +14 -0
- package/dist/components/agent-connect/agent-connect-copy.d.ts +22 -33
- package/dist/components/agent-connect/agent-connect-design.d.ts +1936 -168
- package/dist/components/agent-connect/agent-connect-installer.d.ts +1 -0
- package/dist/components/agent-connect/agent-connect-instructions-view.d.ts +4 -6
- package/dist/components/agent-connect/agent-connect-instructions.d.ts +148 -0
- package/dist/components/agent-connect/agent-connect-markdown.d.ts +8 -2
- package/dist/components/agent-connect/agent-connect-mask.d.ts +10 -0
- package/dist/components/agent-connect/agent-connect.d.ts +1 -1
- package/dist/components/agent-connect/locales/en-US.d.ts +23 -0
- package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
- package/dist/components/agent-connect/style.css +129 -3
- package/dist/components/agent-connect/types.d.ts +7 -4
- package/dist/components/agent-connect/use-agent-connect-copy.d.ts +6 -0
- package/dist/components/directory-tour/directory-tour.d.ts +3 -0
- package/dist/components/directory-tour/index.d.ts +3 -0
- package/dist/components/directory-tour/locales/en-US.d.ts +3 -0
- package/dist/components/directory-tour/locales/zh-CN.d.ts +3 -0
- package/dist/components/directory-tour/steps.d.ts +5 -0
- package/dist/components/directory-tour/style.css +237 -0
- package/dist/components/directory-tour/style.js +0 -0
- package/dist/components/directory-tour/types.d.ts +43 -0
- package/dist/components/directory-tour/use-tour-anchor.d.ts +5 -0
- package/dist/components/directory-tour/use-tour-position.d.ts +12 -0
- package/dist/components/directory-tour.js +40 -0
- package/dist/components/file-browser-entries/file-browser-entries.d.ts +5 -5
- package/dist/components/file-browser-entries/labels.d.ts +3 -0
- package/dist/components/file-browser-entries/locales/en-US.d.ts +6 -0
- package/dist/components/file-browser-entries/locales/zh-CN.d.ts +6 -0
- package/dist/components/file-browser-entries/style.css +866 -2
- package/dist/components/file-browser-entries/types.d.ts +34 -16
- package/dist/components/file-preview/file-preview-adapters.d.ts +2 -1
- package/dist/components/file-preview/file-preview-body.d.ts +2 -1
- package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +2 -1
- package/dist/components/file-preview/file-preview-breadcrumb.d.ts +2 -1
- package/dist/components/file-preview/file-preview-directory.d.ts +2 -1
- package/dist/components/file-preview/file-preview-handle-adapters.d.ts +2 -1
- package/dist/components/file-preview/file-preview-header.d.ts +6 -2
- package/dist/components/file-preview/file-preview-image-frame.d.ts +5 -0
- package/dist/components/file-preview/file-preview-labels.d.ts +2 -14
- package/dist/components/file-preview/file-preview-level-tabs.d.ts +7 -0
- package/dist/components/file-preview/file-preview-markdown-images.d.ts +13 -0
- package/dist/components/file-preview/file-preview-panels.d.ts +5 -2
- package/dist/components/file-preview/file-preview-viewer.d.ts +2 -1
- package/dist/components/file-preview/file-preview.d.ts +0 -1
- package/dist/components/file-preview/index.d.ts +2 -1
- package/dist/components/file-preview/locales/en-US.d.ts +16 -0
- package/dist/components/file-preview/locales/zh-CN.d.ts +16 -0
- package/dist/components/file-preview/style.css +160 -2
- package/dist/components/file-preview/types.d.ts +34 -10
- package/dist/components/file-preview/use-file-preview-levels.d.ts +7 -0
- package/dist/components/file-preview/use-file-preview-view-state.d.ts +15 -0
- package/dist/components/file-preview.js +1 -1
- package/dist/components/file-tree/file-tree-info-labels.d.ts +0 -15
- package/dist/components/file-tree/file-tree-labels.d.ts +4 -0
- package/dist/components/file-tree/file-tree-row-shared.d.ts +2 -12
- package/dist/components/file-tree/file-tree-toolbar.d.ts +11 -0
- package/dist/components/file-tree/locales/en-US.d.ts +69 -0
- package/dist/components/file-tree/locales/zh-CN.d.ts +69 -0
- package/dist/components/file-tree/style.css +143 -15
- package/dist/components/file-tree/types.d.ts +38 -10
- package/dist/components/file-tree/use-file-tree-actions.d.ts +4 -1
- package/dist/components/scope-switcher/labels.d.ts +3 -0
- package/dist/components/scope-switcher/locales/en-US.d.ts +8 -0
- package/dist/components/scope-switcher/locales/zh-CN.d.ts +8 -0
- package/dist/components/scope-switcher/scope-panel.d.ts +1 -1
- package/dist/components/scope-switcher/scope-switcher.d.ts +2 -2
- package/dist/components/scope-switcher/style.css +14 -2
- package/dist/components/scope-switcher/types.d.ts +12 -6
- package/dist/components/style.css +10030 -6763
- package/dist/components/tui/locales/en-US.d.ts +35 -0
- package/dist/components/tui/locales/zh-CN.d.ts +35 -0
- package/dist/components/tui/style.css +310 -18
- package/dist/components/tui/tui-copy-button.d.ts +1 -1
- package/dist/components/tui/tui-empty.d.ts +25 -0
- package/dist/components/tui/tui-labels.d.ts +2 -2
- package/dist/components/tui/tui.d.ts +1 -1
- package/dist/components/tui/types.d.ts +35 -12
- package/dist/components/tui.js +1 -1
- package/dist/components/viking-bot/ark-adapter.d.ts +2 -0
- package/dist/components/viking-bot/ark-message-body.d.ts +1 -7
- package/dist/components/viking-bot/ark-message-list-view.d.ts +4 -1
- package/dist/components/viking-bot/ark-message-row.d.ts +3 -1
- package/dist/components/viking-bot/bot-popover.d.ts +9 -0
- package/dist/components/viking-bot/capabilities.d.ts +49 -0
- package/dist/components/viking-bot/composer-attachments.d.ts +13 -0
- package/dist/components/viking-bot/composer-controls.d.ts +10 -0
- package/dist/components/viking-bot/composer-footer.d.ts +17 -0
- package/dist/components/viking-bot/composer-references.d.ts +20 -0
- package/dist/components/viking-bot/composer-text.d.ts +10 -0
- package/dist/components/viking-bot/index.d.ts +3 -1
- package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +1 -1
- package/dist/components/viking-bot/interaction/labels.d.ts +2 -1
- package/dist/components/viking-bot/interaction/locales/en-US.d.ts +17 -0
- package/dist/components/viking-bot/interaction/locales/zh-CN.d.ts +17 -0
- package/dist/components/viking-bot/interaction/types.d.ts +8 -3
- package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +1 -1
- package/dist/components/viking-bot/labels.d.ts +2 -0
- package/dist/components/viking-bot/locales/en-US.d.ts +40 -0
- package/dist/components/viking-bot/locales/zh-CN.d.ts +40 -0
- package/dist/components/viking-bot/markdown-links.d.ts +27 -0
- package/dist/components/viking-bot/message-activity.d.ts +7 -0
- package/dist/components/viking-bot/message-code-block.d.ts +8 -0
- package/dist/components/viking-bot/message-footer.d.ts +8 -0
- package/dist/components/viking-bot/message-markdown.d.ts +9 -0
- package/dist/components/viking-bot/model.d.ts +37 -3
- package/dist/components/viking-bot/quick-input-tracker.d.ts +16 -0
- package/dist/components/viking-bot/quick-inputs.d.ts +6 -0
- package/dist/components/viking-bot/reference-picker.d.ts +16 -0
- package/dist/components/viking-bot/session-actions.d.ts +11 -0
- package/dist/components/viking-bot/style.css +1486 -48
- package/dist/components/viking-bot/tool-activity.d.ts +9 -0
- package/dist/components/viking-bot/tool-result-links.d.ts +6 -0
- package/dist/components/viking-bot/types.d.ts +20 -8
- package/dist/components/viking-bot/use-quick-input.d.ts +17 -0
- package/dist/components/viking-bot/viking-bot.d.ts +1 -6
- package/dist/components/viking-bot/welcome.d.ts +8 -0
- package/dist/components/viking-bot.js +1 -1
- package/dist/c~0.js +550 -69
- package/dist/e~0.js +335 -0
- package/dist/file-preview-viewer~0.js +90 -8
- package/dist/f~0.js +49 -51
- package/dist/h~0.js +5 -1
- package/dist/icons/console-icons.d.ts +12 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/viking-bot-icons.d.ts +6 -0
- package/dist/icons.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/k~0.js +1 -0
- package/dist/lg~0.js +155 -0
- package/dist/lk~0.js +40 -8
- package/dist/l~0.js +170 -181
- package/dist/modules/console/command-messages.d.ts +19 -0
- package/dist/modules/console/command-parser.d.ts +15 -0
- package/dist/modules/console/command-specs.d.ts +15 -0
- package/dist/modules/console/commands.d.ts +6 -0
- package/dist/modules/console/console-history.d.ts +10 -0
- package/dist/modules/console/console-toolbar.d.ts +18 -0
- package/dist/modules/console/console.d.ts +1 -3
- package/dist/modules/console/controller.d.ts +17 -0
- package/dist/modules/console/index.d.ts +2 -0
- package/dist/modules/console/labels.d.ts +61 -0
- package/dist/modules/console/locales/en-US.d.ts +49 -0
- package/dist/modules/console/locales/zh-CN.d.ts +3 -0
- package/dist/modules/console/localize-records.d.ts +11 -0
- package/dist/modules/console/results.d.ts +2 -0
- package/dist/modules/console/style.css +10905 -15
- package/dist/modules/console/types.d.ts +59 -80
- package/dist/modules/console/use-console.d.ts +3 -0
- package/dist/modules/console.js +1 -1
- package/dist/modules/file-browser/file-browser-detail.d.ts +2 -1
- package/dist/modules/file-browser/file-browser-labels.d.ts +11 -12
- package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -4
- package/dist/modules/file-browser/file-browser-tree-pane.d.ts +7 -5
- package/dist/modules/file-browser/file-browser.d.ts +1 -1
- package/dist/modules/file-browser/fs-read-directory.d.ts +2 -6
- package/dist/modules/file-browser/locales/en-US.d.ts +25 -0
- package/dist/modules/file-browser/locales/zh-CN.d.ts +25 -0
- package/dist/modules/file-browser/style.css +1695 -126
- package/dist/modules/file-browser/types.d.ts +38 -29
- package/dist/modules/file-browser/use-file-browser.d.ts +6 -1
- package/dist/modules/file-browser/use-fs-preview.d.ts +15 -1
- package/dist/modules/scope-cascade/labels.d.ts +6 -0
- package/dist/modules/scope-cascade/locales/en-US.d.ts +6 -0
- package/dist/modules/scope-cascade/locales/zh-CN.d.ts +3 -0
- package/dist/modules/scope-cascade/scope-cascade.d.ts +2 -2
- package/dist/modules/scope-cascade/style.css +14 -2
- package/dist/modules/scope-cascade/types.d.ts +3 -0
- package/dist/modules/style.css +15938 -3455
- package/dist/nx~0.js +15 -0
- package/dist/n~0.js +240 -83
- package/dist/o~0.js +10 -7
- package/dist/p~0.js +27 -0
- package/dist/rslib-runtime~0.js +42 -0
- package/dist/r~0.js +152 -0
- package/dist/shared/components/drawer/drawer.d.ts +13 -0
- package/dist/shared/components/drawer/index.d.ts +1 -0
- package/dist/shared/components/overlay/use-overlay-position.d.ts +2 -2
- package/dist/shared/components/tooltip/use-portal-theme.d.ts +3 -0
- package/dist/shared/locale-context.d.ts +8 -0
- package/dist/shared/locale.d.ts +6 -0
- package/dist/style.css +26339 -10577
- package/dist/u~0.js +397 -152
- package/dist/viking-bot-composer~0.js +436 -77
- package/dist/viking-bot-interaction~0.js +13 -11
- package/package.json +15 -4
- package/dist/30~0.js +0 -1332
- package/dist/components/tui/tui-labels-zh.d.ts +0 -2
- package/dist/modules/file-browser/tree-info-copy.d.ts +0 -15
- package/dist/modules/file-browser/tree-info-copy.zh-CN.d.ts +0 -15
|
@@ -1,101 +1,80 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Locale } from '../../shared/locale.js';
|
|
2
2
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* state when the mode switches.
|
|
7
|
-
*/
|
|
3
|
+
import type { OvRequestOptions } from '../../client/types.js';
|
|
4
|
+
import type { TuiCommandDefinition, TuiLabels, TuiRecord } from '../../components/tui/index.js';
|
|
5
|
+
import type { VikingBotLabels, VikingBotProps } from '../../components/viking-bot/index.js';
|
|
8
6
|
export type ConsoleMode = 'conversation' | 'command';
|
|
9
|
-
/** 交互面板模块的插槽。Slots of the console module. */
|
|
10
7
|
export interface ConsoleSlots {
|
|
11
|
-
/**
|
|
12
|
-
* 面板顶部工具栏。模式切换由模块渲染,这里放宿主专属入口。
|
|
13
|
-
* Panel toolbar. The module renders the mode switch; put host-specific
|
|
14
|
-
* entries here.
|
|
15
|
-
*/
|
|
16
8
|
toolbar?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* 对话模式下输入区上方的附加内容,例如当前资源上下文。
|
|
19
|
-
* Extra content above the composer in conversation mode, for example the
|
|
20
|
-
* current resource context.
|
|
21
|
-
*/
|
|
22
9
|
conversationContext?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* 命令模式下的命令帮助内容。省略时由模块按宿主声明的命令生成。
|
|
25
|
-
* Command help in command mode. When omitted, the module derives it from the
|
|
26
|
-
* commands the host declares.
|
|
27
|
-
*/
|
|
28
10
|
commandHelp?: ReactNode;
|
|
29
11
|
}
|
|
30
|
-
/** 交互面板模块的可替换文案。Replaceable copy of the console module. */
|
|
31
12
|
export interface ConsoleLabels {
|
|
32
|
-
/**
|
|
33
|
-
* 占位说明。缺省为 `Placeholder. Functionality is not available yet.`。
|
|
34
|
-
* Placeholder description. Defaults to "Placeholder. Functionality is not
|
|
35
|
-
* available yet.".
|
|
36
|
-
*/
|
|
13
|
+
/** Conversation welcome description. */
|
|
37
14
|
description?: string;
|
|
38
|
-
/** 对话模式名称。Conversation mode label. */
|
|
39
15
|
conversation?: string;
|
|
40
|
-
/** 命令模式名称。Command mode label. */
|
|
41
16
|
command?: string;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
clear?: string;
|
|
18
|
+
history?: string;
|
|
19
|
+
emptyHistory?: string;
|
|
20
|
+
/** 终端空态标题,转交 Tui 的 `emptyTitle`。Terminal empty-state heading, mapped to Tui `emptyTitle`. */
|
|
21
|
+
commandTitle?: string;
|
|
22
|
+
/** 终端空态说明,转交 Tui 的 `emptyDescription`。Terminal empty-state description, mapped to Tui `emptyDescription`. */
|
|
23
|
+
commandDescription?: string;
|
|
24
|
+
/** 快捷命令引导文案,转交 Tui 的 `quickStart`。Quick-command label, mapped to Tui `quickStart`. */
|
|
25
|
+
quickStart?: string;
|
|
26
|
+
mode?: string;
|
|
27
|
+
tui?: TuiLabels;
|
|
28
|
+
vikingBot?: VikingBotLabels;
|
|
46
29
|
}
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* 模块自己通过 Hook 取数,props 里没有会话与命令记录:宿主给配置、受控模式、
|
|
51
|
-
* 插槽与文案。打开资源通过回调交给宿主,与文件浏览模块的联动不依赖对方的私有
|
|
52
|
-
* 状态。
|
|
53
|
-
*
|
|
54
|
-
* Props of the console module.
|
|
55
|
-
*
|
|
56
|
-
* The module loads its own data through a Hook, so no prop carries sessions or
|
|
57
|
-
* command records: the host supplies configuration, the controlled mode, slots
|
|
58
|
-
* and copy. Opening a resource goes back to the host through a callback, and
|
|
59
|
-
* coordination with the file browser never reaches into the other module's
|
|
60
|
-
* private state.
|
|
61
|
-
*/
|
|
62
|
-
export interface ConsoleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
|
|
63
|
-
/**
|
|
64
|
-
* 受控的当前模式。传入时由宿主决定模式,模块只上报切换意图。
|
|
65
|
-
* The controlled mode. When given, the host owns the mode and the module only
|
|
66
|
-
* reports switch intent.
|
|
67
|
-
*/
|
|
30
|
+
/** Options shared by Console and useConsole. */
|
|
31
|
+
export interface ConsoleOptions {
|
|
32
|
+
locale?: Locale;
|
|
68
33
|
mode?: ConsoleMode;
|
|
69
|
-
/**
|
|
70
|
-
* 非受控时的初始模式,缺省为 `conversation`。
|
|
71
|
-
* Initial mode when uncontrolled; defaults to `conversation`.
|
|
72
|
-
*/
|
|
34
|
+
/** Initial uncontrolled mode. Defaults to VikingBot ('conversation'). */
|
|
73
35
|
defaultMode?: ConsoleMode;
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
* Called after the mode changes.
|
|
77
|
-
*/
|
|
36
|
+
/** Change with the identity when using dynamic credential/identity functions. */
|
|
37
|
+
scopeKey?: string;
|
|
78
38
|
onModeChange?: (mode: ConsoleMode) => void;
|
|
39
|
+
requestOptions?: OvRequestOptions;
|
|
40
|
+
}
|
|
41
|
+
export interface ConsoleProps extends ConsoleOptions, Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
|
|
42
|
+
/** 可选文案语言;继承上层,最终默认英文。Optional locale; inherits or defaults to en-US. */
|
|
43
|
+
locale?: Locale;
|
|
79
44
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
45
|
+
* 终端空态展示的快捷命令名称,按数组顺序取自命令目录,未命中的名称跳过,
|
|
46
|
+
* 重复名称只保留首次出现。
|
|
47
|
+
* 省略时使用默认集合;传空数组不展示内置空态。
|
|
48
|
+
* Quick command names shown in the terminal empty state, resolved from the
|
|
49
|
+
* command catalogue in array order with unknown names skipped. Omitted uses
|
|
50
|
+
* the default set; an empty array shows no built-in empty state.
|
|
83
51
|
*/
|
|
52
|
+
quickCommands?: readonly string[];
|
|
53
|
+
/** Host-owned conversation state/capabilities. Omit draft callbacks to use Console's local draft. */
|
|
54
|
+
conversation?: Partial<VikingBotProps>;
|
|
55
|
+
/** Reports navigation intent; the host opens the resource. */
|
|
84
56
|
onOpenUri?: (uri: string) => void;
|
|
85
|
-
/**
|
|
86
|
-
* 插槽,见 {@link ConsoleSlots}。
|
|
87
|
-
* Slots, see {@link ConsoleSlots}.
|
|
88
|
-
*/
|
|
89
57
|
slots?: ConsoleSlots;
|
|
90
|
-
/**
|
|
91
|
-
* 可替换文案,缺省为英文。
|
|
92
|
-
* Replaceable copy; English by default.
|
|
93
|
-
*/
|
|
94
58
|
labels?: ConsoleLabels;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
59
|
+
}
|
|
60
|
+
/** Local state. Records and drafts are never persisted by the module. */
|
|
61
|
+
export interface ConsoleState {
|
|
62
|
+
records: readonly TuiRecord[];
|
|
63
|
+
command: string;
|
|
64
|
+
conversationDraft: string;
|
|
65
|
+
isExecuting: boolean;
|
|
66
|
+
error?: unknown;
|
|
67
|
+
failedCommand?: string;
|
|
68
|
+
}
|
|
69
|
+
/** Data and operations available independently of Console's view. */
|
|
70
|
+
export interface ConsoleResult extends ConsoleState {
|
|
71
|
+
mode: ConsoleMode;
|
|
72
|
+
commands: readonly TuiCommandDefinition[];
|
|
73
|
+
setMode: (mode: ConsoleMode) => void;
|
|
74
|
+
setCommand: (command: string) => void;
|
|
75
|
+
setConversationDraft: (draft: string) => void;
|
|
76
|
+
execute: (command?: string) => Promise<void>;
|
|
77
|
+
retry: () => Promise<void>;
|
|
78
|
+
cancel: () => void;
|
|
79
|
+
clear: () => void;
|
|
101
80
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ConsoleOptions, ConsoleResult } from './types.js';
|
|
2
|
+
/** Native command execution and draft orchestration, with or without Console. */
|
|
3
|
+
export declare function useConsole({ mode: controlledMode, defaultMode, locale: localeProp, scopeKey, onModeChange, requestOptions, }?: ConsoleOptions): ConsoleResult;
|
package/dist/modules/console.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Console } from "../a~0.js";
|
|
1
|
+
export { Console, useConsole } from "../a~0.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Locale } from '../../shared/locale.js';
|
|
1
2
|
import { type FilePreviewTab } from '../../components/file-preview/index.js';
|
|
2
3
|
import type { FileBrowserLabels } from './types.js';
|
|
3
4
|
/**
|
|
@@ -16,7 +17,7 @@ import type { FileBrowserLabels } from './types.js';
|
|
|
16
17
|
export interface FileBrowserDetailProps {
|
|
17
18
|
tabs: readonly FilePreviewTab[];
|
|
18
19
|
activeKey: string | null;
|
|
19
|
-
locale
|
|
20
|
+
locale: Locale;
|
|
20
21
|
labels?: FileBrowserLabels['preview'];
|
|
21
22
|
footer?: string;
|
|
22
23
|
/** 分段器与图标按钮的文案。Copy for the segmented control and icon buttons. */
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
+
import { type Locale } from '../../shared/locale.js';
|
|
1
2
|
import type { FilePreviewLabels } from '../../components/file-preview/index.js';
|
|
2
3
|
import type { FileTreeLabels } from '../../components/file-tree/index.js';
|
|
3
4
|
import type { FileBrowserLabels } from './types.js';
|
|
4
5
|
/** 模块外壳自己渲染的文案,其余透传给树与预览。 */
|
|
5
|
-
type ShellLabels = Omit<FileBrowserLabels, 'tree' | 'preview'>;
|
|
6
|
+
export type ShellLabels = Omit<FileBrowserLabels, 'tree' | 'preview' | 'entries'>;
|
|
6
7
|
/**
|
|
7
8
|
* 模块外壳的内置文案。树与预览的默认值留在各自组件里,模块不重复一份。
|
|
8
9
|
* Built-in copy of the module shell. The tree and the preview keep their own
|
|
9
10
|
* defaults, so the module does not duplicate them.
|
|
10
11
|
*/
|
|
11
|
-
export declare const DEFAULT_LABELS: Required<ShellLabels>;
|
|
12
12
|
/** 解析后的外壳文案,外加透传给两个组件的文案。 */
|
|
13
13
|
export interface ResolvedLabels extends Required<ShellLabels> {
|
|
14
14
|
tree: FileTreeLabels | undefined;
|
|
15
15
|
previewLabels: FileBrowserLabels['preview'];
|
|
16
16
|
}
|
|
17
17
|
/** 逐项合并默认文案;树与预览的文案原样透传,缺省由组件自己兜底。 */
|
|
18
|
-
export declare function resolveLabels(labels: FileBrowserLabels | undefined): ResolvedLabels;
|
|
19
|
-
/**
|
|
20
|
-
* 预览组件的文案:模块自己的那几项叠在宿主透传的之上。组件那份英文默认值只在
|
|
21
|
-
* 宿主完全不传时才会用到,模块不能让它在中文界面里漏出来。
|
|
22
|
-
*
|
|
23
|
-
* The preview component's copy: the module's own fields layered over what the host
|
|
24
|
-
* passed through. The component's English defaults only apply when a host passes
|
|
25
|
-
* nothing, and must not leak into a Chinese interface.
|
|
26
|
-
*/
|
|
18
|
+
export declare function resolveLabels(labels: FileBrowserLabels | undefined, locale: Locale): ResolvedLabels;
|
|
19
|
+
/** Shared shell labels followed by explicit preview overrides. */
|
|
27
20
|
export declare function resolvePreviewLabels(text: ResolvedLabels): FilePreviewLabels;
|
|
28
|
-
export
|
|
21
|
+
export declare const DEFAULT_LABELS: Required<ShellLabels>;
|
|
22
|
+
/** Summary titles are derived from the module resource, including host overrides. */
|
|
23
|
+
export declare function resolveSummaryLabels(locale: Locale, labels?: FileBrowserLabels): {
|
|
24
|
+
l0: string;
|
|
25
|
+
l1: string;
|
|
26
|
+
failure: string;
|
|
27
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `toolbarActions` 里。
|
|
2
|
+
* 搜索行:搜索框与刷新按钮。内置的连接与导入入口位于上一行。
|
|
4
3
|
*
|
|
5
|
-
* The search row: the search box and
|
|
6
|
-
*
|
|
4
|
+
* The search row: the search box and refresh button. Built-in connection and import
|
|
5
|
+
* entries occupy the row above.
|
|
7
6
|
*/
|
|
8
7
|
export interface FileBrowserToolbarProps {
|
|
9
8
|
searchId: string;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Locale } from '../../shared/locale.js';
|
|
2
|
+
import type { FileBrowserEntriesProps } from '../../components/file-browser-entries/index.js';
|
|
2
3
|
import type { FileTreeLabels } from '../../components/file-tree/index.js';
|
|
3
4
|
import type { FileBrowserApi } from './types.js';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* 左栏:内置入口条、搜索行与目录树。
|
|
6
7
|
*
|
|
7
8
|
* 宽度由外层的可拖拽分隔条决定,因此这里只铺满自己的盒子,不设宽度;树内容
|
|
8
9
|
* 比栏宽时横向滚动,而不是把名称截成省略号。
|
|
9
10
|
*
|
|
10
|
-
* The left column: the
|
|
11
|
+
* The left column: the built-in entries, the search row and the tree.
|
|
11
12
|
*
|
|
12
13
|
* The width comes from the draggable divider outside, so this only fills its own
|
|
13
14
|
* box. When the tree is wider than the column it scrolls sideways rather than
|
|
14
15
|
* truncating names into ellipses.
|
|
15
16
|
*/
|
|
16
17
|
export interface FileBrowserTreePaneProps {
|
|
17
|
-
|
|
18
|
+
entries: Pick<FileBrowserEntriesProps, 'agentConnect' | 'onImportResources' | 'renderImportResources' | 'labels'>;
|
|
19
|
+
locale: Locale;
|
|
18
20
|
searchId: string;
|
|
19
21
|
browser: FileBrowserApi;
|
|
20
22
|
treeLabels: FileTreeLabels | undefined;
|
|
@@ -27,4 +29,4 @@ export interface FileBrowserTreePaneProps {
|
|
|
27
29
|
/** 失败态里的重试按钮。Retry button of the failure state. */
|
|
28
30
|
retryLabel: string;
|
|
29
31
|
}
|
|
30
|
-
export declare function FileBrowserTreePane({
|
|
32
|
+
export declare function FileBrowserTreePane({ entries, locale, searchId, browser, treeLabels, searchPlaceholder, refreshLabel, searchLoading, searchEmpty, searchErrorLabel, retryLabel, }: FileBrowserTreePaneProps): import("react").JSX.Element;
|
|
@@ -12,4 +12,4 @@ export type { FileBrowserActions, FileBrowserApi, FileBrowserLabels, FileBrowser
|
|
|
12
12
|
* tree; loading and coordination live in {@link useFileBrowser}, and this only
|
|
13
13
|
* assembles the view.
|
|
14
14
|
*/
|
|
15
|
-
export declare function FileBrowser({ uri, defaultUri, rootUri, defaultExpandedUri, locale,
|
|
15
|
+
export declare function FileBrowser({ uri, defaultUri, rootUri, defaultExpandedUri, locale: localeProp, agentConnect, onUriChange, onImportResources, renderImportResources, labels, requestOptions, className, style, ...rest }: FileBrowserProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OvClient, OvRequestOptions } from '../../client/types.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type DirectorySummary } from './fs-model.js';
|
|
3
3
|
/**
|
|
4
4
|
* 读目录的两级摘要,各自成一个页签:L0 是摘要,L1 是总览。
|
|
5
5
|
*
|
|
@@ -13,8 +13,4 @@ import type { FilePreviewDirectoryTab } from '../../components/file-preview/inde
|
|
|
13
13
|
* other; when both are empty the tabs still appear, so the user sees that the
|
|
14
14
|
* directory exists but has no generated content instead of blank space.
|
|
15
15
|
*/
|
|
16
|
-
export declare function readDirectory(client: OvClient, uri: string, options: OvRequestOptions
|
|
17
|
-
l0: string;
|
|
18
|
-
l1: string;
|
|
19
|
-
failure: string;
|
|
20
|
-
}, openParent?: (uri: string) => Promise<void>): Promise<FilePreviewDirectoryTab>;
|
|
16
|
+
export declare function readDirectory(client: OvClient, uri: string, options: OvRequestOptions): Promise<DirectorySummary>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
formatCharacterCount: (count: number) => string;
|
|
3
|
+
empty: string;
|
|
4
|
+
error: string;
|
|
5
|
+
retry: string;
|
|
6
|
+
refresh: string;
|
|
7
|
+
searchPlaceholder: string;
|
|
8
|
+
searchEmpty: string;
|
|
9
|
+
searchFailed: string;
|
|
10
|
+
loading: string;
|
|
11
|
+
searchLoading: string;
|
|
12
|
+
previewMode: string;
|
|
13
|
+
sourceMode: string;
|
|
14
|
+
copyPath: string;
|
|
15
|
+
copyContent: string;
|
|
16
|
+
download: string;
|
|
17
|
+
history: string;
|
|
18
|
+
viewSwitch: string;
|
|
19
|
+
resizeTree: string;
|
|
20
|
+
l0Summary: string;
|
|
21
|
+
l1Overview: string;
|
|
22
|
+
summaryEmpty: string;
|
|
23
|
+
summaryFailed: string;
|
|
24
|
+
};
|
|
25
|
+
export default messages;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
formatCharacterCount: (count: number) => string;
|
|
3
|
+
empty: string;
|
|
4
|
+
error: string;
|
|
5
|
+
retry: string;
|
|
6
|
+
refresh: string;
|
|
7
|
+
searchPlaceholder: string;
|
|
8
|
+
searchEmpty: string;
|
|
9
|
+
searchFailed: string;
|
|
10
|
+
loading: string;
|
|
11
|
+
searchLoading: string;
|
|
12
|
+
previewMode: string;
|
|
13
|
+
sourceMode: string;
|
|
14
|
+
copyPath: string;
|
|
15
|
+
copyContent: string;
|
|
16
|
+
download: string;
|
|
17
|
+
history: string;
|
|
18
|
+
viewSwitch: string;
|
|
19
|
+
resizeTree: string;
|
|
20
|
+
l0Summary: string;
|
|
21
|
+
l1Overview: string;
|
|
22
|
+
summaryEmpty: string;
|
|
23
|
+
summaryFailed: string;
|
|
24
|
+
};
|
|
25
|
+
export default messages;
|