@openviking/react 0.1.1 → 0.1.3

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.
Files changed (229) hide show
  1. package/README.md +18 -15
  2. package/dist/1~0.js +506 -0
  3. package/dist/2~0.js +122 -0
  4. package/dist/30~0.js +1332 -0
  5. package/dist/3~0.js +2113 -4
  6. package/dist/ark-message-list-view~0.js +310 -0
  7. package/dist/c7~0.js +24 -0
  8. package/dist/client/index.d.ts +2 -1
  9. package/dist/client/paths.d.ts +64 -0
  10. package/dist/client/response.d.ts +31 -0
  11. package/dist/client/sse.d.ts +39 -0
  12. package/dist/client/stream.d.ts +26 -0
  13. package/dist/client/types.d.ts +104 -0
  14. package/dist/client.js +1 -239
  15. package/dist/components/agent-connect/agent-connect-copy.d.ts +34 -0
  16. package/dist/components/agent-connect/agent-connect-design.d.ts +1781 -0
  17. package/dist/components/agent-connect/agent-connect-detail.d.ts +13 -0
  18. package/dist/components/agent-connect/agent-connect-installer.d.ts +3 -0
  19. package/dist/components/agent-connect/agent-connect-instructions-view.d.ts +14 -0
  20. package/dist/components/agent-connect/agent-connect-instructions.d.ts +145 -0
  21. package/dist/components/agent-connect/agent-connect-markdown.d.ts +3 -0
  22. package/dist/components/agent-connect/agent-connect.d.ts +3 -3
  23. package/dist/components/agent-connect/content-en.d.ts +137 -0
  24. package/dist/components/agent-connect/content-zh.d.ts +137 -0
  25. package/dist/components/agent-connect/style.css +495 -6
  26. package/dist/components/agent-connect/types.d.ts +20 -166
  27. package/dist/components/file-browser-entries/file-browser-entries-icons.d.ts +18 -0
  28. package/dist/components/file-browser-entries/file-browser-entries.d.ts +14 -0
  29. package/dist/components/file-browser-entries/index.d.ts +1 -0
  30. package/dist/components/file-browser-entries/style.css +155 -0
  31. package/dist/components/file-browser-entries/types.d.ts +45 -0
  32. package/dist/components/file-browser-entries.js +1 -0
  33. package/dist/components/file-preview/file-preview-adapters.d.ts +33 -0
  34. package/dist/components/file-preview/file-preview-body.d.ts +24 -12
  35. package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +16 -0
  36. package/dist/components/file-preview/file-preview-breadcrumb.d.ts +21 -0
  37. package/dist/components/file-preview/file-preview-copy-path.d.ts +12 -0
  38. package/dist/components/file-preview/file-preview-directory.d.ts +32 -0
  39. package/dist/components/file-preview/file-preview-editor.d.ts +22 -0
  40. package/dist/components/file-preview/file-preview-handle-adapters.d.ts +26 -0
  41. package/dist/components/file-preview/file-preview-header.d.ts +41 -14
  42. package/dist/components/file-preview/file-preview-labels.d.ts +15 -4
  43. package/dist/components/file-preview/file-preview-lazy-viewer.d.ts +3 -0
  44. package/dist/components/file-preview/file-preview-panels.d.ts +41 -0
  45. package/dist/components/file-preview/file-preview-path.d.ts +30 -0
  46. package/dist/components/file-preview/file-preview-source.d.ts +24 -0
  47. package/dist/components/file-preview/file-preview-state.d.ts +35 -0
  48. package/dist/components/file-preview/file-preview-tab-row.d.ts +16 -0
  49. package/dist/components/file-preview/file-preview-viewer.d.ts +31 -0
  50. package/dist/components/file-preview/file-preview.d.ts +9 -11
  51. package/dist/components/file-preview/level-selection.d.ts +25 -0
  52. package/dist/components/file-preview/style.css +4055 -126
  53. package/dist/components/file-preview/types.d.ts +350 -170
  54. package/dist/components/file-preview/use-directory-level.d.ts +30 -0
  55. package/dist/components/file-preview/use-file-preview-actions-context.d.ts +27 -0
  56. package/dist/components/file-preview/use-file-preview-actions.d.ts +19 -0
  57. package/dist/components/file-preview/use-file-preview-editing.d.ts +21 -2
  58. package/dist/components/file-preview/use-file-preview-ids.d.ts +24 -0
  59. package/dist/components/file-preview.js +1 -442
  60. package/dist/components/file-tree/file-tree-body.d.ts +8 -4
  61. package/dist/components/file-tree/file-tree-entry-row.d.ts +9 -3
  62. package/dist/components/file-tree/file-tree-icons.d.ts +12 -5
  63. package/dist/components/file-tree/file-tree-info-labels.d.ts +21 -0
  64. package/dist/components/file-tree/file-tree-info-tooltip.d.ts +43 -0
  65. package/dist/components/file-tree/file-tree-info.d.ts +29 -0
  66. package/dist/components/file-tree/file-tree-keyboard.d.ts +8 -4
  67. package/dist/components/file-tree/file-tree-row-context.d.ts +29 -12
  68. package/dist/components/file-tree/file-tree-row-shared.d.ts +18 -0
  69. package/dist/components/file-tree/file-tree-spinner.d.ts +10 -0
  70. package/dist/components/file-tree/file-tree-state-row.d.ts +7 -0
  71. package/dist/components/file-tree/file-tree-tooltip-surface.d.ts +22 -0
  72. package/dist/components/file-tree/file-tree.d.ts +12 -1
  73. package/dist/components/file-tree/style.css +280 -75
  74. package/dist/components/file-tree/types.d.ts +203 -0
  75. package/dist/components/file-tree/use-file-tree-actions.d.ts +7 -0
  76. package/dist/components/file-tree.js +1 -1
  77. package/dist/components/scope-switcher/scope-panel.d.ts +9 -3
  78. package/dist/components/scope-switcher/scope-selector.d.ts +1 -1
  79. package/dist/components/scope-switcher/scope-switcher.d.ts +1 -1
  80. package/dist/components/scope-switcher/style.css +282 -76
  81. package/dist/components/scope-switcher/types.d.ts +230 -108
  82. package/dist/components/style.css +14128 -390
  83. package/dist/components/tui/command-catalog.d.ts +58 -0
  84. package/dist/components/tui/command-completion.d.ts +19 -0
  85. package/dist/components/tui/command-definitions.d.ts +10 -0
  86. package/dist/components/tui/command-input.d.ts +16 -0
  87. package/dist/components/tui/style.css +1543 -5
  88. package/dist/components/tui/tui-assist.d.ts +15 -0
  89. package/dist/components/tui/tui-code-block.d.ts +8 -0
  90. package/dist/components/tui/tui-command-help.d.ts +9 -0
  91. package/dist/components/tui/tui-command-text.d.ts +6 -0
  92. package/dist/components/tui/tui-composer.d.ts +24 -0
  93. package/dist/components/tui/tui-copy-button.d.ts +9 -0
  94. package/dist/components/tui/tui-input-mirror.d.ts +14 -0
  95. package/dist/components/tui/tui-labels-zh.d.ts +2 -0
  96. package/dist/components/tui/tui-labels.d.ts +5 -0
  97. package/dist/components/tui/tui-markdown-renderers.d.ts +10 -0
  98. package/dist/components/tui/tui-markdown.d.ts +6 -0
  99. package/dist/components/tui/tui-param-hint.d.ts +7 -0
  100. package/dist/components/tui/tui-record-time.d.ts +11 -0
  101. package/dist/components/tui/tui-record.d.ts +13 -0
  102. package/dist/components/tui/tui-resource-preview.d.ts +10 -0
  103. package/dist/components/tui/tui-resource-tree.d.ts +10 -0
  104. package/dist/components/tui/tui-result-header.d.ts +7 -0
  105. package/dist/components/tui/tui-result-text.d.ts +5 -0
  106. package/dist/components/tui/tui-search-list.d.ts +8 -0
  107. package/dist/components/tui/tui-skeleton.d.ts +6 -0
  108. package/dist/components/tui/tui-status-card.d.ts +7 -0
  109. package/dist/components/tui/tui-text.d.ts +10 -0
  110. package/dist/components/tui/tui-uri-text.d.ts +19 -0
  111. package/dist/components/tui/tui-write-result.d.ts +7 -0
  112. package/dist/components/tui/tui.d.ts +10 -2
  113. package/dist/components/tui/types.d.ts +57 -15
  114. package/dist/components/tui/use-tui-assist-position.d.ts +3 -0
  115. package/dist/components/tui/use-tui-completion.d.ts +14 -0
  116. package/dist/components/tui/use-tui-composer-keyboard.d.ts +25 -0
  117. package/dist/components/viking-bot/ark-adapter.d.ts +45 -0
  118. package/dist/components/viking-bot/ark-message-body.d.ts +16 -0
  119. package/dist/components/viking-bot/ark-message-list-view.d.ts +7 -0
  120. package/dist/components/viking-bot/ark-message-row.d.ts +19 -0
  121. package/dist/components/viking-bot/index.d.ts +10 -0
  122. package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +10 -0
  123. package/dist/components/viking-bot/interaction/index.d.ts +4 -0
  124. package/dist/components/viking-bot/interaction/labels.d.ts +7 -0
  125. package/dist/components/viking-bot/interaction/lazy-interaction.d.ts +3 -0
  126. package/dist/components/viking-bot/interaction/schedule-input.d.ts +13 -0
  127. package/dist/components/viking-bot/interaction/style.css +189 -0
  128. package/dist/components/viking-bot/interaction/style.js +0 -0
  129. package/dist/components/viking-bot/interaction/types.d.ts +188 -0
  130. package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +9 -0
  131. package/dist/components/viking-bot/interaction.js +2 -0
  132. package/dist/components/viking-bot/labels.d.ts +2 -0
  133. package/dist/components/viking-bot/lazy-composer.d.ts +3 -0
  134. package/dist/components/viking-bot/message-groups.d.ts +12 -0
  135. package/dist/components/viking-bot/model.d.ts +252 -0
  136. package/dist/components/viking-bot/render-part.d.ts +12 -0
  137. package/dist/components/viking-bot/style.css +7135 -0
  138. package/dist/components/viking-bot/style.js +0 -0
  139. package/dist/components/viking-bot/types.d.ts +140 -0
  140. package/dist/components/viking-bot/viking-bot-composer.d.ts +6 -0
  141. package/dist/components/viking-bot/viking-bot-message-list.d.ts +3 -0
  142. package/dist/components/viking-bot/viking-bot.d.ts +16 -0
  143. package/dist/components/viking-bot.js +4 -0
  144. package/dist/c~0.js +201 -0
  145. package/dist/file-preview-viewer~0.js +191 -0
  146. package/dist/f~0.js +149 -77
  147. package/dist/h~0.js +58 -0
  148. package/dist/icons/file-type-icon.d.ts +31 -0
  149. package/dist/icons/index.d.ts +33 -23
  150. package/dist/icons/nextjs-icon.d.ts +19 -0
  151. package/dist/icons.js +1 -25
  152. package/dist/index.d.ts +4 -2
  153. package/dist/index.js +2 -1
  154. package/dist/k~0.js +1440 -0
  155. package/dist/lk~0.js +25 -12
  156. package/dist/l~0.js +1464 -25
  157. package/dist/modules/console/style.css +83 -1
  158. package/dist/modules/file-browser/file-browser-detail-icons.d.ts +10 -0
  159. package/dist/modules/file-browser/file-browser-detail.d.ts +33 -0
  160. package/dist/modules/file-browser/file-browser-empty.d.ts +3 -0
  161. package/dist/modules/file-browser/file-browser-failure.d.ts +22 -0
  162. package/dist/modules/file-browser/file-browser-icons.d.ts +18 -0
  163. package/dist/modules/file-browser/file-browser-labels.d.ts +28 -0
  164. package/dist/modules/file-browser/file-browser-layout.d.ts +27 -0
  165. package/dist/modules/file-browser/file-browser-toolbar.d.ts +18 -0
  166. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +30 -0
  167. package/dist/modules/file-browser/file-browser.d.ts +14 -5
  168. package/dist/modules/file-browser/find-result.d.ts +24 -0
  169. package/dist/modules/file-browser/fs-directories.d.ts +33 -0
  170. package/dist/modules/file-browser/fs-file-kind.d.ts +19 -0
  171. package/dist/modules/file-browser/fs-icon.d.ts +17 -0
  172. package/dist/modules/file-browser/fs-model.d.ts +106 -0
  173. package/dist/modules/file-browser/fs-page.d.ts +16 -0
  174. package/dist/modules/file-browser/fs-path.d.ts +16 -0
  175. package/dist/modules/file-browser/fs-read-directory.d.ts +20 -0
  176. package/dist/modules/file-browser/fs-scope.d.ts +22 -0
  177. package/dist/modules/file-browser/fs-stat.d.ts +25 -0
  178. package/dist/modules/file-browser/index.d.ts +3 -1
  179. package/dist/modules/file-browser/style.css +5009 -34
  180. package/dist/modules/file-browser/tree-info-copy.d.ts +15 -0
  181. package/dist/modules/file-browser/tree-info-copy.zh-CN.d.ts +15 -0
  182. package/dist/modules/file-browser/types.d.ts +189 -44
  183. package/dist/modules/file-browser/use-container-width.d.ts +17 -0
  184. package/dist/modules/file-browser/use-file-browser.d.ts +49 -0
  185. package/dist/modules/file-browser/use-fs-preview.d.ts +51 -0
  186. package/dist/modules/file-browser/use-fs-search.d.ts +35 -0
  187. package/dist/modules/file-browser/use-fs-tree.d.ts +43 -0
  188. package/dist/modules/file-browser/use-request-scope.d.ts +39 -0
  189. package/dist/modules/file-browser.js +1 -1
  190. package/dist/modules/scope-cascade/style.css +282 -76
  191. package/dist/modules/style.css +5445 -130
  192. package/dist/n~0.js +568 -236
  193. package/dist/o~0.js +103 -0
  194. package/dist/shared/components/divider/divider.d.ts +18 -0
  195. package/dist/shared/components/divider/index.d.ts +1 -0
  196. package/dist/shared/components/divider/types.d.ts +35 -0
  197. package/dist/shared/components/overlay/types.d.ts +7 -0
  198. package/dist/shared/components/overlay/use-overlay-position.d.ts +38 -0
  199. package/dist/shared/components/popover/index.d.ts +1 -0
  200. package/dist/shared/components/popover/popover.d.ts +23 -0
  201. package/dist/shared/components/popover/types.d.ts +50 -0
  202. package/dist/shared/components/resizable/clamp.d.ts +13 -0
  203. package/dist/shared/components/resizable/index.d.ts +2 -0
  204. package/dist/shared/components/resizable/resizable-handle.d.ts +25 -0
  205. package/dist/shared/components/resizable/types.d.ts +48 -0
  206. package/dist/shared/components/tooltip/index.d.ts +1 -0
  207. package/dist/shared/components/tooltip/tooltip.d.ts +25 -0
  208. package/dist/shared/components/tooltip/types.d.ts +42 -0
  209. package/dist/style.css +19664 -530
  210. package/dist/u~0.js +1597 -4
  211. package/dist/viking-bot-composer~0.js +164 -0
  212. package/dist/viking-bot-interaction~0.js +284 -0
  213. package/dist/w~0.js +19 -0
  214. package/package.json +23 -10
  215. package/dist/components/file-preview/file-preview-icons.d.ts +0 -2
  216. package/dist/components/file-preview/file-preview-operations.d.ts +0 -1
  217. package/dist/components/file-tree/file-tree-dom.d.ts +0 -4
  218. package/dist/components/file-tree/file-tree-labels.d.ts +0 -5
  219. package/dist/components/file-tree/file-tree-rows.d.ts +0 -12
  220. package/dist/components/file-tree/file-tree-tooltip.d.ts +0 -11
  221. package/dist/i~0.js +0 -21
  222. package/dist/modules/file-browser/file-browser-toolbar-button.d.ts +0 -10
  223. package/dist/modules/task-center/columns.d.ts +0 -129
  224. package/dist/modules/task-center/index.d.ts +0 -1
  225. package/dist/modules/task-center/style.css +0 -29
  226. package/dist/modules/task-center/task-center.d.ts +0 -4
  227. package/dist/modules/task-center/types.d.ts +0 -168
  228. package/dist/modules/task-center.js +0 -1
  229. /package/dist/{modules/task-center → components/file-browser-entries}/style.js +0 -0
@@ -1,129 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- /**
3
- * 编译目标的定时规则,与原生接口的 `update_schedule` 同形:每日或每周的固定
4
- * 时刻(北京时间)。
5
- * The schedule rule of a compile target, matching the native
6
- * `update_schedule`: a daily or weekly clock time in Beijing time.
7
- */
8
- export type TaskCenterCompileSchedule = {
9
- frequency: 'daily';
10
- hour: number;
11
- minute: number;
12
- } | {
13
- frequency: 'weekly';
14
- /** 1 为周一,7 为周日。1 is Monday, 7 is Sunday. */
15
- weekday: number;
16
- hour: number;
17
- minute: number;
18
- };
19
- /**
20
- * 数据源导入任务的一行,来自 `/api/v1/watches`。
21
- * One data-source import task, from `/api/v1/watches`.
22
- */
23
- export interface TaskCenterImportRow {
24
- /** 行唯一标识,对应 watch 的 task id。Unique row key, the watch task id. */
25
- id: string;
26
- /** 资源名称。Resource name. */
27
- name: string;
28
- /** 数据来源类型,例如飞书文档、代码仓库。Source type, for example a Feishu doc or a Git repository. */
29
- sourceLabel: string;
30
- /** 原始地址,例如 Git 仓库链接。Original address, for example the Git URL. */
31
- sourceUrl?: string;
32
- /** 导入后的 OpenViking 路径。The OpenViking path after import. */
33
- openVikingPath: string;
34
- /** 定时同步状态文案,例如「每 1 天」「未开启」。Schedule status copy, for example "every day" or "off". */
35
- scheduleLabel: string;
36
- /** 定时同步是否开启。Whether scheduled sync is on. */
37
- scheduleEnabled: boolean;
38
- /**
39
- * 当前的同步间隔,单位分钟。未开启时省略。对应原生 watch 的
40
- * `watch_interval`。
41
- *
42
- * The current sync interval in minutes, omitted when scheduling is off. It
43
- * matches the native watch's `watch_interval`.
44
- */
45
- scheduleIntervalMinutes?: number;
46
- /** 最近一次执行时间,毫秒时间戳。Last execution time in milliseconds. */
47
- lastExecutionTime?: number;
48
- /** 任务创建时间,毫秒时间戳。Creation time in milliseconds. */
49
- createdAt?: number;
50
- }
51
- /**
52
- * 知识编译任务的一行,来自编译目标列表。
53
- * One knowledge-compile task, from the compile target list.
54
- */
55
- export interface TaskCenterCompileRow {
56
- /** 行唯一标识,对应编译目标 URI。Unique row key, the compile target URI. */
57
- id: string;
58
- /** 目录名称。Directory name. */
59
- name: string;
60
- /** 编译目标的完整 URI。Full URI of the compile target. */
61
- toUri: string;
62
- /** 状态文案,例如「执行中」「空闲」「未初始化」。Status copy, for example "running", "idle" or "not initialized". */
63
- statusLabel: string;
64
- /** 冲突文件数。Number of conflicting files. */
65
- conflictFileCount: number;
66
- /** 任务类型,例如首次编译或定时编译。Task type, for example initial or scheduled compile. */
67
- taskType: string;
68
- /** 定时更新状态文案,例如「每日 09:30(北京时间)」「未开启」。Schedule copy. */
69
- scheduleLabel: string;
70
- /** 定时更新是否开启。Whether scheduled updates are on. */
71
- scheduleEnabled: boolean;
72
- /**
73
- * 当前的定时规则。未开启时省略。与原生编译目标的 `update_schedule` 同形,
74
- * 宿主改完直接回传即可。
75
- *
76
- * The current schedule rule, omitted when scheduling is off. It matches the
77
- * native compile target's `update_schedule`, so a host can pass it straight
78
- * back after an edit.
79
- */
80
- schedule?: TaskCenterCompileSchedule;
81
- /** 内容最近更新时间,毫秒时间戳。Last content update in milliseconds. */
82
- updatedAt?: number;
83
- /** 任务创建时间,毫秒时间戳。Creation time in milliseconds. */
84
- createdAt?: number;
85
- }
86
- /** 数据源导入任务的内置列。Built-in columns of the import task list. */
87
- export type TaskCenterImportColumnKey = 'name' | 'schedule' | 'source' | 'lastExecution' | 'createdAt' | 'path';
88
- /** 知识编译任务的内置列。Built-in columns of the compile task list. */
89
- export type TaskCenterCompileColumnKey = 'name' | 'status' | 'conflicts' | 'taskType' | 'schedule' | 'updatedAt' | 'createdAt' | 'path';
90
- /**
91
- * 一列的配置。省略 `columns` 时使用该列表的全部内置列与默认顺序。
92
- *
93
- * A column configuration. Omitting `columns` uses every built-in column of that
94
- * list in its default order.
95
- */
96
- export interface TaskCenterColumn<TRow> {
97
- /**
98
- * 列标识。内置列用该列表的列 key,自定义列用任意字符串。
99
- * Column key. A built-in column uses a key of that list; a custom column uses
100
- * any string.
101
- */
102
- key: string;
103
- /**
104
- * 覆盖表头文案。省略时使用内置文案或 `labels`。
105
- * Header override. Omission uses the built-in copy or `labels`.
106
- */
107
- title?: ReactNode;
108
- /** 列宽,单位像素。Column width in pixels. */
109
- width?: number;
110
- /** 单元格对齐方式。Cell alignment. */
111
- align?: 'left' | 'center' | 'right';
112
- /**
113
- * 覆盖单元格内容。内置列省略时使用默认渲染;自定义列必须提供。
114
- * Cell content override. A built-in column falls back to its default
115
- * rendering; a custom column must provide it.
116
- */
117
- render?: (row: TRow) => ReactNode;
118
- }
119
- /**
120
- * 各页签的列配置。只传需要调整的页签,另一个页签保持默认。
121
- * Column configuration per tab. Pass only the tab you adjust; the other keeps
122
- * its default.
123
- */
124
- export interface TaskCenterColumns {
125
- import?: readonly TaskCenterColumn<TaskCenterImportRow>[];
126
- compile?: readonly TaskCenterColumn<TaskCenterCompileRow>[];
127
- }
128
- /** 任意一行的联合类型,供打开任务等回调使用。 */
129
- export type TaskCenterRow = TaskCenterImportRow | TaskCenterCompileRow;
@@ -1 +0,0 @@
1
- export * from './task-center.js';
@@ -1,29 +0,0 @@
1
- .ov-module-placeholder {
2
- box-sizing: border-box;
3
- border: 1px dashed var(--ov-ui-border, currentColor);
4
- border-radius: var(--ov-ui-radius, 6px);
5
- min-width: 0;
6
- min-height: 160px;
7
- color: inherit;
8
- font: inherit;
9
- text-align: center;
10
- overflow-wrap: anywhere;
11
- flex-direction: column;
12
- justify-content: center;
13
- align-items: center;
14
- gap: 8px;
15
- padding: 24px;
16
- display: flex;
17
- }
18
-
19
- .ov-module-placeholder__title {
20
- margin: 0;
21
- }
22
-
23
- .ov-module-placeholder__description {
24
- color: var(--ov-ui-text-muted, color-mix(in srgb, currentColor 75%, transparent));
25
- margin: 0;
26
- }
27
-
28
-
29
-
@@ -1,4 +0,0 @@
1
- import type { TaskCenterProps } from './types.js';
2
- export type { TaskCenterColumn, TaskCenterColumns, TaskCenterCompileColumnKey, TaskCenterCompileRow, TaskCenterCompileSchedule, TaskCenterImportColumnKey, TaskCenterImportRow, TaskCenterLabels, TaskCenterProps, TaskCenterRow, TaskCenterScope, TaskCenterSlots, TaskCenterTab, } from './types.js';
3
- /** 占位组件:渲染一个带模块名的空容器,真实实现随模块 Hook 与组合视图迁入。 */
4
- export declare function TaskCenter({ className, style, labels }: TaskCenterProps): import("react").JSX.Element;
@@ -1,168 +0,0 @@
1
- import type { OvRequestOptions } from '../../client/index.js';
2
- import type { HTMLAttributes, ReactNode } from 'react';
3
- import type { TaskCenterColumns, TaskCenterCompileRow, TaskCenterCompileSchedule, TaskCenterImportRow } from './columns.js';
4
- /**
5
- * 任务管理的页签。数据源导入对应定时同步的 watch,知识编译对应编译目标。
6
- * Tabs of the task center. Data-source import covers scheduled watches; knowledge
7
- * compile covers compile targets.
8
- */
9
- export type TaskCenterTab = 'import' | 'compile';
10
- /**
11
- * 页签的可见范围。「其他成员」只在能查看账号下全部任务时出现,由模块从当前
12
- * 身份判断,不需要宿主传开关。
13
- *
14
- * Visibility scope of a tab. "Others" appears only when the current identity can
15
- * see every task in the account; the module decides that from the current
16
- * identity, so the host passes no switch.
17
- */
18
- export type TaskCenterScope = 'mine' | 'others';
19
- /** 任务中心模块的插槽。Slots of the task center module. */
20
- export interface TaskCenterSlots {
21
- /**
22
- * 列表上方的工具栏,例如新建任务、搜索。筛选在表头由模块提供。
23
- * Toolbar above the list, for example a create action or search. The module
24
- * provides filtering in the table header.
25
- */
26
- toolbar?: ReactNode;
27
- /**
28
- * 空态内容,例如引导导入资源的入口。
29
- * Empty state, for example an entry that starts importing resources.
30
- */
31
- emptyState?: ReactNode;
32
- }
33
- /** 任务中心模块的可替换文案。Replaceable copy of the task center module. */
34
- export interface TaskCenterLabels {
35
- /**
36
- * 占位说明。缺省为 `Placeholder. Functionality is not available yet.`。
37
- * Placeholder description. Defaults to "Placeholder. Functionality is not
38
- * available yet.".
39
- */
40
- description?: string;
41
- /** 区域标题。Area title. */
42
- title?: string;
43
- /** 数据源导入页签名称。Label of the import tab. */
44
- importTab?: string;
45
- /** 知识编译页签名称。Label of the compile tab. */
46
- compileTab?: string;
47
- /** 「我的任务」范围名称。Label of the "my tasks" scope. */
48
- mineScope?: string;
49
- /** 「其他成员任务」范围名称。Label of the "others' tasks" scope. */
50
- othersScope?: string;
51
- /** 没有任务时的提示。Message shown when there are no tasks. */
52
- empty?: string;
53
- /** 加载失败提示。Load failure message. */
54
- error?: string;
55
- /** 重试按钮文案。Retry button label. */
56
- retry?: string;
57
- /** 定时同步列的表头。Header of the scheduled-sync column. */
58
- scheduleColumn?: string;
59
- /** 定时同步开启状态文案。Copy for an enabled schedule. */
60
- scheduleEnabled?: string;
61
- /** 定时同步关闭状态文案。Copy for a disabled schedule. */
62
- scheduleDisabled?: string;
63
- /** 编辑定时周期的按钮文案。Label of the control that edits a schedule. */
64
- editSchedule?: string;
65
- /** 定时保存失败时的提示。Message shown when saving a schedule fails. */
66
- saveFailed?: string;
67
- }
68
- /**
69
- * 任务中心模块的属性。
70
- *
71
- * 模块自己通过 Hook 取数,props 里没有任务数据:宿主给配置、受控状态、回调、
72
- * 列配置、插槽与文案。两个页签各有自己的数据源与列,页签内筛选由模块维护。
73
- *
74
- * 能查看「其他成员任务」取决于当前身份,模块自行判断,宿主不需要传权限开关。
75
- *
76
- * Props of the task center module.
77
- *
78
- * The module loads its own data through a Hook, so no prop carries tasks: the
79
- * host supplies configuration, controlled state, callbacks, column
80
- * configuration, slots and copy. Each tab has its own data source and columns,
81
- * and the module maintains filtering inside a tab.
82
- *
83
- * Whether "others' tasks" is available depends on the current identity; the
84
- * module decides that itself, so the host passes no permission switch.
85
- */
86
- export interface TaskCenterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
87
- /**
88
- * 受控的当前页签。传入时由宿主决定页签,模块只上报切换意图。
89
- * The controlled tab. When given, the host owns the tab and the module only
90
- * reports switch intent.
91
- */
92
- tab?: TaskCenterTab;
93
- /**
94
- * 非受控时的初始页签,缺省为 `import`。
95
- * Initial tab when uncontrolled; defaults to `import`.
96
- */
97
- defaultTab?: TaskCenterTab;
98
- /**
99
- * 受控的页签可见范围。传入时由宿主决定范围,模块只上报切换意图。
100
- * The controlled scope. When given, the host owns it and the module only
101
- * reports switch intent.
102
- */
103
- scope?: TaskCenterScope;
104
- /**
105
- * 非受控时的初始范围,缺省为 `mine`。
106
- * Initial scope when uncontrolled; defaults to `mine`.
107
- */
108
- defaultScope?: TaskCenterScope;
109
- /**
110
- * 列配置。省略时两个页签都用各自的内置列与默认顺序。
111
- * Column configuration. Omission uses each tab's built-in columns in their
112
- * default order.
113
- */
114
- columns?: TaskCenterColumns;
115
- /**
116
- * 页签变化后触发。
117
- * Called after the tab changes.
118
- */
119
- onTabChange?: (tab: TaskCenterTab) => void;
120
- /**
121
- * 可见范围变化后触发。
122
- * Called after the scope changes.
123
- */
124
- onScopeChange?: (scope: TaskCenterScope) => void;
125
- /**
126
- * 打开资源时触发,例如点击导入任务的目标路径。任务详情由模块内部以抽屉展示,
127
- * 不需要宿主参与。
128
- * Called when a resource is opened, for example the target path of an import
129
- * task. Task details are shown by the module in a drawer, so the host takes no
130
- * part in that.
131
- */
132
- onOpenResource?: (uri: string) => void;
133
- /**
134
- * 导入任务的同步间隔保存。返回的 Promise 成功即视为已写入,模块随后重新取数;
135
- * 失败时保留编辑内容并展示错误,错误文案取 `labels.saveFailed`。
136
- *
137
- * Saving the sync interval of an import task. A resolved Promise means the
138
- * write succeeded and the module reloads; a rejection keeps the edit and shows
139
- * the error from `labels.saveFailed`.
140
- */
141
- onSaveScheduleInterval?: (row: TaskCenterImportRow, intervalMinutes: number) => Promise<void>;
142
- /**
143
- * 编译目标的定时规则保存。参数与原生 `update_schedule` 同形,宿主可直接转发。
144
- * 成功与失败的处理同 {@link onSaveScheduleInterval}。
145
- *
146
- * Saving the schedule of a compile target. The argument matches the native
147
- * `update_schedule`, so a host can forward it as-is. Success and failure are
148
- * handled the same way as {@link onSaveScheduleInterval}.
149
- */
150
- onSaveCompileSchedule?: (row: TaskCenterCompileRow, schedule: TaskCenterCompileSchedule | null) => Promise<void>;
151
- /**
152
- * 插槽,见 {@link TaskCenterSlots}。
153
- * Slots, see {@link TaskCenterSlots}.
154
- */
155
- slots?: TaskCenterSlots;
156
- /**
157
- * 可替换文案,缺省为英文。
158
- * Replaceable copy; English by default.
159
- */
160
- labels?: TaskCenterLabels;
161
- /**
162
- * 请求配置覆盖,逐字段覆盖最近的 Provider。
163
- * Request configuration override, applied field by field over the nearest
164
- * Provider.
165
- */
166
- requestOptions?: OvRequestOptions;
167
- }
168
- export type { TaskCenterColumn, TaskCenterColumns, TaskCenterCompileColumnKey, TaskCenterCompileRow, TaskCenterCompileSchedule, TaskCenterImportColumnKey, TaskCenterImportRow, TaskCenterRow, } from './columns.js';
@@ -1 +0,0 @@
1
- export { TaskCenter } from "../i~0.js";