@openviking/react 0.1.5 → 0.1.7

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 (145) hide show
  1. package/README.md +15 -11
  2. package/dist/2~0.js +6 -5
  3. package/dist/37~0.js +27 -0
  4. package/dist/3c~0.js +24 -12
  5. package/dist/3~0.js +19 -9
  6. package/dist/ae~0.js +8 -1
  7. package/dist/ark-message-list-view~0.js +9 -4
  8. package/dist/a~0.js +13 -7
  9. package/dist/c7r~0.js +50 -0
  10. package/dist/ck~0.js +7 -0
  11. package/dist/client/paths.d.ts +10 -0
  12. package/dist/client/provider.d.ts +6 -1
  13. package/dist/components/agent-connect/style.css +268 -37
  14. package/dist/components/directory-tour/style.css +265 -21
  15. package/dist/components/directory-tour.js +1 -1
  16. package/dist/components/experience-dashboard/dashboard-tabs.d.ts +11 -0
  17. package/dist/components/experience-dashboard/experience-dashboard.d.ts +2 -0
  18. package/dist/components/experience-dashboard/experience-impact.d.ts +11 -0
  19. package/dist/components/experience-dashboard/experience-list.d.ts +9 -0
  20. package/dist/components/experience-dashboard/experience-pagination.d.ts +8 -0
  21. package/dist/components/experience-dashboard/experience-tests.d.ts +6 -0
  22. package/dist/components/experience-dashboard/experience-trajectories.d.ts +6 -0
  23. package/dist/components/experience-dashboard/index.d.ts +2 -0
  24. package/dist/components/experience-dashboard/labels.d.ts +2 -0
  25. package/dist/components/experience-dashboard/style.css +914 -0
  26. package/dist/components/experience-dashboard/style.js +0 -0
  27. package/dist/components/experience-dashboard/types.d.ts +106 -0
  28. package/dist/components/experience-dashboard.js +1 -0
  29. package/dist/components/file-browser-entries/style.css +463 -86
  30. package/dist/components/file-preview/style.css +267 -78
  31. package/dist/components/file-tree/file-tree-toolbar.d.ts +3 -3
  32. package/dist/components/file-tree/locales/en-US.d.ts +3 -0
  33. package/dist/components/file-tree/locales/zh-CN.d.ts +3 -0
  34. package/dist/components/file-tree/style.css +372 -88
  35. package/dist/components/file-tree/types.d.ts +13 -4
  36. package/dist/components/scope-switcher/style.css +412 -39
  37. package/dist/components/style.css +9326 -4553
  38. package/dist/components/tui/style.css +385 -67
  39. package/dist/components/viking-bot/interaction/style.css +143 -22
  40. package/dist/components/viking-bot/style.css +1075 -278
  41. package/dist/components/wiki-dashboard/index.d.ts +2 -0
  42. package/dist/components/wiki-dashboard/labels.d.ts +2 -0
  43. package/dist/components/wiki-dashboard/style.css +956 -0
  44. package/dist/components/wiki-dashboard/style.js +0 -0
  45. package/dist/components/wiki-dashboard/types.d.ts +92 -0
  46. package/dist/components/wiki-dashboard/wiki-action-button.d.ts +9 -0
  47. package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +15 -0
  48. package/dist/components/wiki-dashboard/wiki-dashboard.d.ts +2 -0
  49. package/dist/components/wiki-dashboard/wiki-file-icon.d.ts +3 -0
  50. package/dist/components/wiki-dashboard/wiki-severity-filter.d.ts +8 -0
  51. package/dist/components/wiki-dashboard.js +1 -0
  52. package/dist/c~0.js +16 -8
  53. package/dist/ep~0.js +345 -0
  54. package/dist/e~0.js +33 -328
  55. package/dist/fj~0.js +507 -0
  56. package/dist/fl~0.js +709 -0
  57. package/dist/f~0.js +12 -27
  58. package/dist/icons/index.d.ts +28 -0
  59. package/dist/icons.js +1 -1
  60. package/dist/index.d.ts +4 -0
  61. package/dist/index.js +3 -1
  62. package/dist/k~0.js +277 -1
  63. package/dist/lk~0.js +56 -14
  64. package/dist/l~0.js +2786 -446
  65. package/dist/modules/console/index.d.ts +1 -2
  66. package/dist/modules/console/style.css +1787 -346
  67. package/dist/modules/console.js +1 -1
  68. package/dist/modules/file-browser/acl/acl-add-principal.d.ts +12 -0
  69. package/dist/modules/file-browser/acl/acl-candidate.d.ts +8 -0
  70. package/dist/modules/file-browser/acl/acl-client.d.ts +13 -0
  71. package/dist/modules/file-browser/acl/acl-confirmation.d.ts +6 -0
  72. package/dist/modules/file-browser/acl/acl-entry.d.ts +13 -0
  73. package/dist/modules/file-browser/acl/acl-labels.d.ts +47 -0
  74. package/dist/modules/file-browser/acl/acl-menu.d.ts +10 -0
  75. package/dist/modules/file-browser/acl/acl-modal.d.ts +17 -0
  76. package/dist/modules/file-browser/acl/acl-model.d.ts +17 -0
  77. package/dist/modules/file-browser/acl/acl-principal-tabs.d.ts +6 -0
  78. package/dist/modules/file-browser/acl/acl-tag.d.ts +7 -0
  79. package/dist/modules/file-browser/acl/locales/en-US.d.ts +44 -0
  80. package/dist/modules/file-browser/acl/locales/zh-CN.d.ts +44 -0
  81. package/dist/modules/file-browser/acl/use-acl-principals.d.ts +17 -0
  82. package/dist/modules/file-browser/acl/use-acl-report.d.ts +27 -0
  83. package/dist/modules/file-browser/acl-types.d.ts +86 -0
  84. package/dist/modules/file-browser/dashboard-data.d.ts +9 -0
  85. package/dist/modules/file-browser/dashboard-indicator.d.ts +8 -0
  86. package/dist/modules/file-browser/dashboard-labels.d.ts +9 -0
  87. package/dist/modules/file-browser/dashboard-model.d.ts +17 -0
  88. package/dist/modules/file-browser/dashboard-resource.d.ts +12 -0
  89. package/dist/modules/file-browser/experience-dashboard-pane.d.ts +8 -0
  90. package/dist/modules/file-browser/experience-data.d.ts +31 -0
  91. package/dist/modules/file-browser/file-browser-detail.d.ts +4 -1
  92. package/dist/modules/file-browser/file-browser-labels.d.ts +1 -1
  93. package/dist/modules/file-browser/file-browser-search.d.ts +20 -0
  94. package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -10
  95. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +4 -7
  96. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  97. package/dist/modules/file-browser/fs-directories.d.ts +9 -0
  98. package/dist/modules/file-browser/fs-lines.d.ts +36 -0
  99. package/dist/modules/file-browser/fs-memory-fields.d.ts +65 -0
  100. package/dist/modules/file-browser/fs-model.d.ts +15 -3
  101. package/dist/modules/file-browser/fs-read-file.d.ts +14 -0
  102. package/dist/modules/file-browser/index.d.ts +3 -2
  103. package/dist/modules/file-browser/locales/en-US.d.ts +5 -0
  104. package/dist/modules/file-browser/locales/zh-CN.d.ts +5 -0
  105. package/dist/modules/file-browser/style.css +4033 -483
  106. package/dist/modules/file-browser/types.d.ts +82 -20
  107. package/dist/modules/file-browser/use-browser-dashboards.d.ts +31 -0
  108. package/dist/modules/file-browser/use-dashboard-query.d.ts +9 -0
  109. package/dist/modules/file-browser/use-experience-dashboard.d.ts +27 -0
  110. package/dist/modules/file-browser/use-file-browser-acl.d.ts +15 -0
  111. package/dist/modules/file-browser/use-file-browser.d.ts +6 -51
  112. package/dist/modules/file-browser/use-fs-tree.d.ts +3 -0
  113. package/dist/modules/file-browser/use-wiki-dashboard.d.ts +17 -0
  114. package/dist/modules/file-browser/wiki-conflicts.d.ts +12 -0
  115. package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +14 -0
  116. package/dist/modules/file-browser.js +1 -1
  117. package/dist/modules/scope-cascade/controller.d.ts +2 -2
  118. package/dist/modules/scope-cascade/index.d.ts +1 -2
  119. package/dist/modules/scope-cascade/scope-cascade.d.ts +1 -1
  120. package/dist/modules/scope-cascade/style.css +581 -39
  121. package/dist/modules/scope-cascade/types.d.ts +8 -3
  122. package/dist/modules/scope-cascade/use-scope-cascade.d.ts +2 -2
  123. package/dist/modules/scope-cascade.js +1 -1
  124. package/dist/modules/style.css +13589 -7966
  125. package/dist/n~0.js +73 -165
  126. package/dist/rt~0.js +255 -0
  127. package/dist/r~0.js +18 -39
  128. package/dist/shared/components/button/button.d.ts +20 -0
  129. package/dist/shared/components/input/input.d.ts +17 -0
  130. package/dist/shared/components/modal/locales/en-US.d.ts +4 -0
  131. package/dist/shared/components/modal/locales/zh-CN.d.ts +4 -0
  132. package/dist/shared/components/modal/modal.d.ts +2 -0
  133. package/dist/shared/components/modal/types.d.ts +18 -0
  134. package/dist/shared/components/overlay/lock-body-scroll.d.ts +1 -0
  135. package/dist/shared/components/popover/popover.d.ts +1 -1
  136. package/dist/shared/components/popover/types.d.ts +7 -1
  137. package/dist/shared/dashboard/dashboard-state.d.ts +12 -0
  138. package/dist/static/image/dashboard-background.png +0 -0
  139. package/dist/style.css +16088 -5602
  140. package/dist/s~0.js +16 -0
  141. package/dist/u~0.js +15 -6
  142. package/dist/viking-bot-composer~0.js +30 -12
  143. package/dist/viking-bot-interaction~0.js +2 -1
  144. package/package.json +14 -3
  145. package/dist/o~0.js +0 -106
@@ -1,9 +1,11 @@
1
1
  import type { Locale } from '../../shared/locale.js';
2
2
  import type { AgentConnectProps } from '../../components/agent-connect/index.js';
3
3
  import type { FileBrowserEntriesLabels } from '../../components/file-browser-entries/index.js';
4
+ import type { FileBrowserDashboard } from './dashboard-model.js';
4
5
  import type { FilePreviewLabels, FilePreviewTab } from '../../components/file-preview/index.js';
5
6
  import type { FileTreeEntryRow, FileTreeLabels, FileTreeRow } from '../../components/file-tree/index.js';
6
7
  import type { OvRequestOptions } from '../../client/index.js';
8
+ import type { FileBrowserAclLabels, FileBrowserAclOptions } from './acl-types.js';
7
9
  import type { ComponentPropsWithRef, HTMLAttributes, ReactElement, ReactNode } from 'react';
8
10
  /**
9
11
  * 文件浏览模块的可替换文案。入口、树与预览的文案分别透传,模块外壳只提供
@@ -13,7 +15,19 @@ import type { ComponentPropsWithRef, HTMLAttributes, ReactElement, ReactNode } f
13
15
  * passed through as-is; the module shell only carries the strings
14
16
  * it renders itself.
15
17
  */
18
+ export interface FileBrowserDashboardLabels {
19
+ experienceTitle?: string;
20
+ wikiTitle?: string;
21
+ openExperience?: string;
22
+ openWiki?: string;
23
+ wikiConflicts?: string;
24
+ failed?: string;
25
+ }
16
26
  export interface FileBrowserLabels {
27
+ accessDenied?: string;
28
+ traverseOnly?: string;
29
+ /** 权限管理文案。Permission management copy. */
30
+ acl?: FileBrowserAclLabels;
17
31
  /** 预览底部字符数。Character count in the preview footer. */
18
32
  formatCharacterCount?: (count: number) => string;
19
33
  /** 未选中资源时的提示。Message shown when no resource is selected. */
@@ -24,8 +38,14 @@ export interface FileBrowserLabels {
24
38
  retry?: string;
25
39
  /** 刷新按钮的无障碍名称。Accessible name of the refresh control. */
26
40
  refresh?: string;
27
- /** 搜索框占位文案。Search placeholder. */
41
+ /** 搜索入口的占位文案。Placeholder of the search trigger. */
28
42
  searchPlaceholder?: string;
43
+ /** 内置搜索弹窗标题。Title of the built-in search dialog. */
44
+ searchTitle?: string;
45
+ /** 搜索提交按钮。Search submit button. */
46
+ searchAction?: string;
47
+ /** 尚未提交查询时的提示。Hint before a query is submitted. */
48
+ searchHint?: string;
29
49
  /** 搜索无结果提示。Message shown when a search returns nothing. */
30
50
  searchEmpty?: string;
31
51
  /** 搜索请求失败的结论,原因由服务端返回。Conclusion when the search request fails; the reason comes from the server. */
@@ -69,6 +89,7 @@ export interface FileBrowserLabels {
69
89
  entries?: FileBrowserEntriesLabels;
70
90
  /** 目录树文案。Copy of the file tree. */
71
91
  tree?: FileTreeLabels;
92
+ dashboard?: FileBrowserDashboardLabels;
72
93
  /** 预览文案。Copy of the file preview. */
73
94
  preview?: FilePreviewLabels;
74
95
  }
@@ -77,7 +98,7 @@ export interface FileBrowserLabels {
77
98
  *
78
99
  * 模块自己通过 Hook 取数,props 里没有数据字段:宿主给配置、受控的当前资源、
79
100
  * 接入配置、导入交互、文案与请求配置。入口条、目录、搜索、预览页签与行级
80
- * 状态都在模块内维护。
101
+ * 状态都在模块内维护,包含基础搜索弹窗与接口调用。
81
102
  *
82
103
  * 模块包含文件树、文件预览与顶部入口。命令面板属于 `console`。
83
104
  *
@@ -86,12 +107,17 @@ export interface FileBrowserLabels {
86
107
  * The module loads its own data through a Hook, so no prop carries data: the
87
108
  * host supplies configuration, the controlled current resource, import interactions,
88
109
  * copy and request configuration. The entry row, directory, search, preview tabs
89
- * and per-row state all live inside the module.
110
+ * and per-row state all live inside the module, including basic search UI and requests.
90
111
  *
91
112
  * The module includes the file tree, file preview and top entries. The command panel
92
113
  * belongs to `console`.
93
114
  */
94
115
  export interface FileBrowserProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
116
+ /**
117
+ * 共享资源 ACL;默认关闭。开启后显示有效权限并通过 Modal 管理授权。
118
+ * Shared-resource ACL, off by default. Shows effective permissions and manages grants in a Modal.
119
+ */
120
+ acl?: boolean | FileBrowserAclOptions;
95
121
  /** 可选文案语言;继承上层,最终默认英文。Optional locale; inherits or defaults to en-US. */
96
122
  locale?: Locale;
97
123
  /**
@@ -135,6 +161,8 @@ export interface FileBrowserProps extends Omit<HTMLAttributes<HTMLDivElement>, '
135
161
  * Configuration of the built-in connection drawer; enables its entry when provided.
136
162
  */
137
163
  agentConnect?: AgentConnectProps;
164
+ /** Host capability filter. Omitted enables both; an empty array disables discovery. */
165
+ dashboardKinds?: readonly FileBrowserDashboard['kind'][];
138
166
  /**
139
167
  * 当前资源变化后触发,参数为新的 URI。
140
168
  *
@@ -149,6 +177,8 @@ export interface FileBrowserProps extends Omit<HTMLAttributes<HTMLDivElement>, '
149
177
  * pane.
150
178
  */
151
179
  onUriChange?: (uri: string | null) => void;
180
+ /** Host gateway/view override; nullish values retain the native dashboard. */
181
+ renderDashboard?: (dashboard: FileBrowserDashboard) => ReactNode;
152
182
  /**
153
183
  * 默认导入按钮的点击回调,单独传入即可显示导入入口。
154
184
  * Click handler of the default import button; enables its entry on its own.
@@ -183,18 +213,14 @@ export interface FileBrowserProps extends Omit<HTMLAttributes<HTMLDivElement>, '
183
213
  * own view from these without the composite one.
184
214
  */
185
215
  export interface FileBrowserApi {
216
+ dashboards: ReadonlyMap<string, FileBrowserDashboard>;
217
+ dashboardError: Error | null;
186
218
  /** 按渲染顺序排列的可见行。Visible rows in render order. */
187
219
  rows: readonly FileTreeRow[];
188
220
  /** 当前选中的行 id。Selected row id. */
189
221
  selectedId: string | null;
190
222
  /** 当前资源 URI。Current resource URI. */
191
223
  currentUri: string | null;
192
- /** 当前查询词。The current query. */
193
- query: string;
194
- /** 是否正在展示搜索结果。Whether search results are showing. */
195
- searching: boolean;
196
- /** 搜索是否进行中。Whether a search is running. */
197
- searchLoading: boolean;
198
224
  /** 刷新是否进行中。Whether a refresh is running. */
199
225
  refreshing: boolean;
200
226
  /** 预览底部元信息,例如字符数与更新时间;没有时为 `undefined`。 */
@@ -212,15 +238,6 @@ export interface FileBrowserApi {
212
238
  * instead of showing a 403 as "no files".
213
239
  */
214
240
  treeError: Error | null;
215
- /**
216
- * 搜索请求本身的失败原因。与「搜索成功但没有结果」不同:前者要显示原因与重试,
217
- * 后者才是空态文案。
218
- *
219
- * Why the search request failed. It differs from "the search succeeded but matched
220
- * nothing": the former needs the reason and a retry, only the latter is the empty
221
- * copy.
222
- */
223
- searchError: Error | null;
224
241
  /**
225
242
  * 当前资源预览的失败原因。选中了资源但读不出来时用它区分「读失败」与「什么
226
243
  * 都没选」。
@@ -238,6 +255,7 @@ export interface FileBrowserApi {
238
255
  }
239
256
  /** 模块 Hook 暴露的操作。Operations the module Hook exposes. */
240
257
  export interface FileBrowserActions {
258
+ openDashboard: (uri: string) => void;
241
259
  /** 选中条目。Selects an entry. */
242
260
  select: (row: FileTreeEntryRow) => Promise<void>;
243
261
  /** 展开或折叠目录。Expands or collapses a directory. */
@@ -250,6 +268,50 @@ export interface FileBrowserActions {
250
268
  refresh: () => Promise<void>;
251
269
  /** 切换预览页签。Switches the preview tab. */
252
270
  setPreviewKey: (key: string) => void;
253
- /** 更新查询词;空串回到目录树。Updates the query; an empty string returns to the tree. */
254
- setQuery: (query: string) => void;
271
+ }
272
+ /** Internal options for the composed FileBrowser loader. */
273
+ export interface UseFileBrowserOptions {
274
+ rootUri: string;
275
+ accessLabels?: Pick<FileBrowserLabels, 'accessDenied' | 'traverseOnly'>;
276
+ /** Built-in copy; inherits the Provider locale, otherwise en-US. */
277
+ locale?: Locale;
278
+ dashboardLabels?: FileBrowserDashboardLabels;
279
+ dashboardKinds?: readonly FileBrowserDashboard['kind'][];
280
+ renderDashboard?: (dashboard: FileBrowserDashboard) => ReactNode;
281
+ /**
282
+ * 宿主是否受控地持有当前资源。受控时 `currentUri` 就是唯一事实;非受控时
283
+ * `currentUri` 只是初始值,之后的选中由模块自己记在 `pendingUri` 里。
284
+ *
285
+ * 两者的区别只在「谁拥有选中」:非受控模块在初始没有选中时 `currentUri` 也是
286
+ * `null`,因此不能靠值来区分,必须显式声明。
287
+ *
288
+ * Whether the host owns the current resource. While controlled, `currentUri` is the
289
+ * single source of truth; while uncontrolled it is only the initial value and later
290
+ * selections live in the module's own `pendingUri`.
291
+ *
292
+ * The distinction is only about who owns the selection: an uncontrolled module also
293
+ * has a `null` `currentUri` when nothing is selected initially, so the value itself
294
+ * cannot tell the two apart and the mode has to be declared.
295
+ */
296
+ controlled?: boolean;
297
+ /**
298
+ * 目录两级摘要的标题与失败兜底文案。两级摘要各自可能请求失败,失败且服务端没给
299
+ * 消息时用 `failure` 显示——它必须可替换,否则宿主无法本地化。
300
+ *
301
+ * Titles of the two summary levels and the fallback copy for a failure. Either level
302
+ * can fail; when it fails without a server message, `failure` is shown — it has to be
303
+ * replaceable, or a host cannot localise it.
304
+ */
305
+ summaryLabels?: {
306
+ l0: string;
307
+ l1: string;
308
+ failure: string;
309
+ };
310
+ /** 字符数文案;省略时跟随语言。Character count copy; follows the resolved locale. */
311
+ formatCharacterCount?: (count: number) => string;
312
+ /** 首次加载后自动展开到的路径。Path to expand to after the first load. */
313
+ defaultExpandedUri?: string;
314
+ currentUri: string | null;
315
+ requestOptions?: OvRequestOptions;
316
+ onUriChange: (uri: string | null) => void;
255
317
  }
@@ -0,0 +1,31 @@
1
+ import type { FileBrowserDashboardLabels } from './types.js';
2
+ import { type ReactNode } from 'react';
3
+ import type { OvRequestOptions } from '../../client/types.js';
4
+ import type { FileTreeRow } from '../../components/file-tree/index.js';
5
+ import { type FileBrowserDashboard } from './dashboard-model.js';
6
+ export declare function useBrowserDashboards({ rows, metadataRows, uri, rootUri, generation, locale, requestOptions, onOpenUri, dashboardKinds, renderDashboard, dashboardLabels, }: {
7
+ rows: readonly FileTreeRow[];
8
+ metadataRows: readonly FileTreeRow[];
9
+ uri: string | null;
10
+ rootUri: string;
11
+ generation: number;
12
+ dashboardLabels?: FileBrowserDashboardLabels;
13
+ dashboardKinds?: readonly FileBrowserDashboard['kind'][];
14
+ renderDashboard?: (dashboard: FileBrowserDashboard) => ReactNode;
15
+ locale?: 'en-US' | 'zh-CN';
16
+ requestOptions?: OvRequestOptions;
17
+ onOpenUri: (uri: string) => Promise<void>;
18
+ }): {
19
+ dashboards: Map<string, {
20
+ kind: 'experience' | 'wiki';
21
+ pendingConflicts?: boolean;
22
+ isRoot?: boolean;
23
+ uri: string;
24
+ }>;
25
+ tab: import("../../components/file-preview/types.js").FilePreviewContentTab | undefined;
26
+ isOpen: boolean;
27
+ open: (target: string) => void;
28
+ close: () => void;
29
+ error: Error | null;
30
+ retry: () => void;
31
+ };
@@ -0,0 +1,9 @@
1
+ import type { OvClient, OvRequestOptions } from '../../client/types.js';
2
+ export interface DashboardQuery<T> {
3
+ data?: T;
4
+ loading: boolean;
5
+ error: Error | null;
6
+ retry: () => void;
7
+ }
8
+ /** Instance-local, cancellable queries. A changed identity never exposes old data. */
9
+ export declare function useDashboardQuery<T>(load: (client: OvClient, options: OvRequestOptions) => Promise<T>, requestOptions?: OvRequestOptions, enabled?: boolean, refreshGeneration?: number): DashboardQuery<T>;
@@ -0,0 +1,27 @@
1
+ import type { OvRequestOptions } from '../../client/types.js';
2
+ import type { ExperienceTrajectoryPage } from './experience-data.js';
3
+ export declare function useExperienceDashboard({ uri, requestOptions, enabled, refreshGeneration, }: {
4
+ uri: string;
5
+ requestOptions?: OvRequestOptions;
6
+ enabled?: boolean;
7
+ refreshGeneration?: number;
8
+ }): {
9
+ list: import("./use-dashboard-query.js").DashboardQuery<{
10
+ items: (import("../../components/experience-dashboard/types.js").ExperienceItem & {
11
+ isDir?: boolean;
12
+ })[];
13
+ hasMore: boolean;
14
+ }>;
15
+ sources: import("./use-dashboard-query.js").DashboardQuery<import("../../components/experience-dashboard/types.js").ExperienceTrajectory[]>;
16
+ trajectories: import("./use-dashboard-query.js").DashboardQuery<ExperienceTrajectoryPage>;
17
+ outcomes: import("./use-dashboard-query.js").DashboardQuery<{
18
+ outcome: import("../../components/experience-dashboard/types.js").ExperienceOutcome;
19
+ count: number;
20
+ }[]>;
21
+ page: number;
22
+ setPage: (value: number) => void;
23
+ days: number;
24
+ setDays: (value: number) => void;
25
+ tab: "impact" | "source" | "test";
26
+ setTab: (value: 'impact' | 'source' | 'test') => void;
27
+ };
@@ -0,0 +1,15 @@
1
+ import type { OvRequestOptions } from '../../client/types.js';
2
+ import type { Locale } from '../../shared/locale.js';
3
+ import type { FileBrowserAclLabels, FileBrowserAclOptions } from './acl-types.js';
4
+ export declare function useFileBrowserAcl({ uri, acl, locale, labels, requestOptions, refresh, }: {
5
+ uri: string | null;
6
+ acl?: boolean | FileBrowserAclOptions;
7
+ locale: Locale;
8
+ labels?: FileBrowserAclLabels;
9
+ requestOptions?: OvRequestOptions;
10
+ refresh: () => Promise<void>;
11
+ }): {
12
+ titleExtra: import("react").JSX.Element | null;
13
+ actions: import("react").JSX.Element | null;
14
+ drawer: import("react").JSX.Element | null;
15
+ };
@@ -1,54 +1,9 @@
1
- import type { Locale } from '../../shared/locale.js';
2
- import type { OvRequestOptions } from '../../client/types.js';
3
- import type { FileBrowserApi } from './types.js';
4
- export interface UseFileBrowserOptions {
5
- rootUri: string;
6
- /** Built-in copy; inherits the Provider locale, otherwise en-US. */
7
- locale?: Locale;
8
- /**
9
- * 宿主是否受控地持有当前资源。受控时 `currentUri` 就是唯一事实;非受控时
10
- * `currentUri` 只是初始值,之后的选中由模块自己记在 `pendingUri` 里。
11
- *
12
- * 两者的区别只在「谁拥有选中」:非受控模块在初始没有选中时 `currentUri` 也是
13
- * `null`,因此不能靠值来区分,必须显式声明。
14
- *
15
- * Whether the host owns the current resource. While controlled, `currentUri` is the
16
- * single source of truth; while uncontrolled it is only the initial value and later
17
- * selections live in the module's own `pendingUri`.
18
- *
19
- * The distinction is only about who owns the selection: an uncontrolled module also
20
- * has a `null` `currentUri` when nothing is selected initially, so the value itself
21
- * cannot tell the two apart and the mode has to be declared.
22
- */
23
- controlled?: boolean;
24
- /**
25
- * 目录两级摘要的标题与失败兜底文案。两级摘要各自可能请求失败,失败且服务端没给
26
- * 消息时用 `failure` 显示——它必须可替换,否则宿主无法本地化。
27
- *
28
- * Titles of the two summary levels and the fallback copy for a failure. Either level
29
- * can fail; when it fails without a server message, `failure` is shown — it has to be
30
- * replaceable, or a host cannot localise it.
31
- */
32
- summaryLabels?: {
33
- l0: string;
34
- l1: string;
35
- failure: string;
36
- };
37
- /** 字符数文案;省略时跟随语言。Character count copy; follows the resolved locale. */
38
- formatCharacterCount?: (count: number) => string;
39
- /** 首次加载后自动展开到的路径。Path to expand to after the first load. */
40
- defaultExpandedUri?: string;
41
- currentUri: string | null;
42
- requestOptions?: OvRequestOptions;
43
- onUriChange: (uri: string | null) => void;
44
- }
1
+ import type { FileBrowserApi, UseFileBrowserOptions } from './types.js';
45
2
  /**
46
- * 文件浏览模块的取数与联动:把目录树、搜索与预览组合成一份视图数据。三者各自
47
- * 取数,这里只负责把它们接起来——目录行展开树,文件行与搜索结果打开预览。
3
+ * 文件浏览模块的目录与预览联动:目录行展开树,文件行打开预览。
4
+ * 占位搜索弹窗独立管理查询,不改变目录树。
48
5
  *
49
- * Data loading and coordination of the file browser module: the tree, the search
50
- * and the preview each load their own data, and this only wires them together —
51
- * a directory row expands the tree, while a file row or a search result opens
52
- * the preview.
6
+ * Coordinates directory loading and preview selection. The placeholder search
7
+ * dialog owns its query separately and leaves the tree unchanged.
53
8
  */
54
- export declare function useFileBrowser({ rootUri, locale: localeProp, controlled, summaryLabels, formatCharacterCount, defaultExpandedUri, currentUri, requestOptions, onUriChange, }: UseFileBrowserOptions): FileBrowserApi;
9
+ export declare function useFileBrowser({ rootUri, locale: localeProp, dashboardKinds, renderDashboard, dashboardLabels, controlled, summaryLabels, accessLabels, formatCharacterCount, defaultExpandedUri, currentUri, requestOptions, onUriChange, }: UseFileBrowserOptions): FileBrowserApi;
@@ -2,6 +2,7 @@ import type { FileTreeEntryRow, FileTreeRow } from '../../components/file-tree/i
2
2
  import type { OvClient, OvRequestOptions } from '../../client/types.js';
3
3
  export interface FsTreeState {
4
4
  rows: readonly FileTreeRow[];
5
+ metadataRows: readonly FileTreeRow[];
5
6
  isReady: boolean;
6
7
  error: Error | null;
7
8
  /**
@@ -15,8 +16,10 @@ export interface FsTreeState {
15
16
  * {@link directoryUris} means the type is unknown.
16
17
  */
17
18
  isKnownFile: (uri: string) => boolean;
19
+ accessOf: (uri: string | null) => 'denied' | 'container' | undefined;
18
20
  toggleExpand: (row: FileTreeEntryRow) => Promise<void>;
19
21
  open: (uri: string) => Promise<void>;
22
+ openPath: (uri: string) => Promise<void>;
20
23
  loadMore: (parentId: string) => Promise<void>;
21
24
  retry: (parentId: string) => Promise<void>;
22
25
  refresh: () => Promise<void>;
@@ -0,0 +1,17 @@
1
+ import type { OvClient, OvRequestOptions } from '../../client/types.js';
2
+ import type { WikiDirectoryData, WikiFileData } from '../../components/wiki-dashboard/types.js';
3
+ type WikiDashboardResult = {
4
+ kind: 'directory';
5
+ data: WikiDirectoryData;
6
+ } | {
7
+ kind: 'file';
8
+ data: WikiFileData;
9
+ };
10
+ export declare function readWikiDashboard(client: OvClient, uri: string, options: OvRequestOptions): Promise<WikiDashboardResult>;
11
+ export declare function useWikiDashboard({ uri, requestOptions, enabled, refreshGeneration, }: {
12
+ uri: string;
13
+ requestOptions?: OvRequestOptions;
14
+ enabled?: boolean;
15
+ refreshGeneration?: number;
16
+ }): import("./use-dashboard-query.js").DashboardQuery<WikiDashboardResult>;
17
+ export {};
@@ -0,0 +1,12 @@
1
+ /** Native CONFLICTS_CONTENT protocol. These IDs exist only in the view model. */
2
+ import type { WikiConflict as WikiFileConflictRecord } from '../../components/wiki-dashboard/types.js';
3
+ export type WikiFileConflicts = {
4
+ status: 'available';
5
+ document: string;
6
+ records: WikiFileConflictRecord[];
7
+ } | {
8
+ status: 'missing' | 'invalid';
9
+ };
10
+ /** Keep source offsets while excluding metadata and comments from conflict anchors. */
11
+ export declare const locateWikiConflict: (document: string, matchText: string) => WikiFileConflictRecord['location'];
12
+ export declare const parseWikiFileConflicts: (content: string) => WikiFileConflicts;
@@ -0,0 +1,14 @@
1
+ import { type WikiDashboardProps, type WikiConflict } from '../../components/wiki-dashboard/index.js';
2
+ import type { OvRequestOptions } from '../../client/types.js';
3
+ type Props = Pick<WikiDashboardProps, 'locale' | 'labels' | 'className' | 'style'> & {
4
+ uri: string;
5
+ kind: 'directory' | 'file';
6
+ onOpenUri?: (uri: string) => void;
7
+ onOpenDashboard?: (uri: string) => void;
8
+ onEdit?: (uri: string, conflict?: WikiConflict) => void;
9
+ onDiscuss?: (uri: string, conflict: WikiConflict) => void;
10
+ requestOptions?: OvRequestOptions;
11
+ refreshGeneration?: number;
12
+ };
13
+ export declare function WikiDashboardPane({ uri, kind, requestOptions, refreshGeneration, onOpenUri, onOpenDashboard, onEdit, onDiscuss, ...props }: Props): import("react").JSX.Element;
14
+ export {};
@@ -1 +1 @@
1
- export { FileBrowser, useFileBrowser } from "../l~0.js";
1
+ export { FileBrowser } from "../l~0.js";
@@ -1,6 +1,6 @@
1
- import type { ScopeCascadeApi, ScopeCascadeController } from './types.js';
1
+ import type { ScopeCascadeApi, ScopeCascadeController, ScopeCascadeSelection } from './types.js';
2
2
  /** Instance-owned channels. Creating a controller does not start requests. */
3
- export declare function createScopeController(): {
3
+ export declare function createScopeController(onChange?: (selection: ScopeCascadeSelection | null) => void): {
4
4
  controller: ScopeCascadeController;
5
5
  start(nextApi: ScopeCascadeApi): () => void;
6
6
  };
@@ -1,3 +1,2 @@
1
1
  export { ScopeCascade } from './scope-cascade.js';
2
- export { useScopeCascade, useScopeCascadeLevel } from './use-scope-cascade.js';
3
- export type { ScopeCascadeApi, ScopeCascadeController, ScopeCascadeIndex, ScopeCascadeLevel, ScopeCascadeProps, ScopeCascadeSnapshot, } from './types.js';
2
+ export type { ScopeCascadeApi, ScopeCascadeProps, ScopeCascadeSelection, } from './types.js';
@@ -1,3 +1,3 @@
1
1
  import type { ScopeCascadeProps } from './types.js';
2
2
  /** Only leaf selectors subscribe to request state; this wrapper resolves language. */
3
- export declare function ScopeCascade({ controller, locale: localeProp, labels, levelNames: names, retryLabel, ...props }: ScopeCascadeProps): import("react").JSX.Element;
3
+ export declare function ScopeCascade({ locale: localeProp, loadLibraries, loadSpaces, loadUsers, onChange, labels, levelNames: names, retryLabel, ...props }: ScopeCascadeProps): import("react").JSX.Element;