@openviking/react 0.1.6 → 0.1.8-beta.10.1.g8e5299efeb0a

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 (172) hide show
  1. package/README.md +13 -1
  2. package/dist/1~0.js +57 -0
  3. package/dist/2~0.js +6 -5
  4. package/dist/3c~0.js +10 -4
  5. package/dist/3~0.js +189 -13
  6. package/dist/5~0.js +181 -0
  7. package/dist/6~0.js +48 -0
  8. package/dist/ae~0.js +8 -1
  9. package/dist/ark-message-list-view~0.js +9 -4
  10. package/dist/a~0.js +12 -6
  11. package/dist/c7r~0.js +50 -0
  12. package/dist/ck~0.js +3 -0
  13. package/dist/client/paths.d.ts +6 -0
  14. package/dist/client/provider.d.ts +6 -1
  15. package/dist/components/agent-connect/style.css +224 -35
  16. package/dist/components/api-key-login-form/api-key-login-form.d.ts +2 -0
  17. package/dist/components/api-key-login-form/index.d.ts +3 -0
  18. package/dist/components/api-key-login-form/style.css +438 -0
  19. package/dist/components/api-key-login-form/style.js +0 -0
  20. package/dist/components/api-key-login-form/types.d.ts +7 -0
  21. package/dist/components/api-key-login-form.js +1 -0
  22. package/dist/components/directory-tour/directory-tour-intro.d.ts +3 -0
  23. package/dist/components/directory-tour/index.d.ts +2 -1
  24. package/dist/components/directory-tour/style.css +367 -39
  25. package/dist/components/directory-tour/tour-card.d.ts +14 -0
  26. package/dist/components/directory-tour/types.d.ts +24 -1
  27. package/dist/components/directory-tour/use-tour-anchor.d.ts +1 -0
  28. package/dist/components/directory-tour/use-tour-position.d.ts +4 -1
  29. package/dist/components/directory-tour/use-tour-theme.d.ts +2 -0
  30. package/dist/components/directory-tour.js +53 -2
  31. package/dist/components/email-login-form/email-login-form.d.ts +2 -0
  32. package/dist/components/email-login-form/index.d.ts +3 -0
  33. package/dist/components/email-login-form/style.css +438 -0
  34. package/dist/components/email-login-form/style.js +0 -0
  35. package/dist/components/email-login-form/types.d.ts +11 -0
  36. package/dist/components/email-login-form.js +1 -0
  37. package/dist/components/experience-dashboard/experience-impact.d.ts +3 -1
  38. package/dist/components/experience-dashboard/style.css +229 -12
  39. package/dist/components/experience-dashboard.js +1 -1
  40. package/dist/components/file-browser-entries/style.css +331 -80
  41. package/dist/components/file-preview/file-preview-header.d.ts +4 -21
  42. package/dist/components/file-preview/file-preview-toolbar.d.ts +7 -0
  43. package/dist/components/file-preview/locales/en-US.d.ts +9 -0
  44. package/dist/components/file-preview/locales/zh-CN.d.ts +9 -0
  45. package/dist/components/file-preview/style.css +335 -76
  46. package/dist/components/file-preview/types.d.ts +14 -21
  47. package/dist/components/file-tree/file-tree-toolbar.d.ts +3 -3
  48. package/dist/components/file-tree/locales/en-US.d.ts +3 -0
  49. package/dist/components/file-tree/locales/zh-CN.d.ts +3 -0
  50. package/dist/components/file-tree/style.css +313 -86
  51. package/dist/components/file-tree/types.d.ts +13 -4
  52. package/dist/components/invitation-confirmation/index.d.ts +3 -0
  53. package/dist/components/invitation-confirmation/invitation-confirmation.d.ts +2 -0
  54. package/dist/components/invitation-confirmation/style.css +438 -0
  55. package/dist/components/invitation-confirmation/style.js +0 -0
  56. package/dist/components/invitation-confirmation/types.d.ts +20 -0
  57. package/dist/components/invitation-confirmation.js +1 -0
  58. package/dist/components/login-method-selector/index.d.ts +2 -0
  59. package/dist/components/login-method-selector/login-method-selector.d.ts +2 -0
  60. package/dist/components/login-method-selector/style.css +438 -0
  61. package/dist/components/login-method-selector/style.js +0 -0
  62. package/dist/components/login-method-selector/types.d.ts +14 -0
  63. package/dist/components/login-method-selector.js +1 -0
  64. package/dist/components/password-reset-request-form/index.d.ts +3 -0
  65. package/dist/components/password-reset-request-form/password-reset-request-form.d.ts +2 -0
  66. package/dist/components/password-reset-request-form/style.css +438 -0
  67. package/dist/components/password-reset-request-form/style.js +0 -0
  68. package/dist/components/password-reset-request-form/types.d.ts +13 -0
  69. package/dist/components/password-reset-request-form.js +1 -0
  70. package/dist/components/password-setup-form/index.d.ts +3 -0
  71. package/dist/components/password-setup-form/password-setup-form.d.ts +2 -0
  72. package/dist/components/password-setup-form/style.css +438 -0
  73. package/dist/components/password-setup-form/style.js +0 -0
  74. package/dist/components/password-setup-form/types.d.ts +10 -0
  75. package/dist/components/password-setup-form.js +1 -0
  76. package/dist/components/scope-switcher/style.css +368 -37
  77. package/dist/components/style.css +13071 -7474
  78. package/dist/components/tui/style.css +271 -35
  79. package/dist/components/viking-bot/interaction/style.css +143 -22
  80. package/dist/components/viking-bot/style.css +951 -295
  81. package/dist/components/wiki-dashboard/index.d.ts +1 -1
  82. package/dist/components/wiki-dashboard/style.css +241 -14
  83. package/dist/components/wiki-dashboard/types.d.ts +12 -16
  84. package/dist/components/wiki-dashboard/wiki-action-button.d.ts +2 -9
  85. package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +3 -10
  86. package/dist/c~0.js +16 -8
  87. package/dist/d~0.js +28 -0
  88. package/dist/ep~0.js +493 -0
  89. package/dist/e~0.js +33 -328
  90. package/dist/fi~0.js +13 -28
  91. package/dist/fj~0.js +38 -69
  92. package/dist/fl~0.js +710 -0
  93. package/dist/f~0.js +61 -685
  94. package/dist/g~0.js +135 -0
  95. package/dist/icons/index.d.ts +2 -0
  96. package/dist/icons.js +1 -1
  97. package/dist/index.d.ts +12 -0
  98. package/dist/index.js +9 -3
  99. package/dist/k~0.js +44 -4
  100. package/dist/l5~0.js +3813 -0
  101. package/dist/lk~0.js +5 -2
  102. package/dist/l~0.js +49 -2369
  103. package/dist/modules/console/style.css +1485 -351
  104. package/dist/modules/file-browser/acl/acl-add-principal.d.ts +12 -0
  105. package/dist/modules/file-browser/acl/acl-candidate.d.ts +8 -0
  106. package/dist/modules/file-browser/acl/acl-client.d.ts +13 -0
  107. package/dist/modules/file-browser/acl/acl-confirmation.d.ts +6 -0
  108. package/dist/modules/file-browser/acl/acl-entry.d.ts +13 -0
  109. package/dist/modules/file-browser/acl/acl-labels.d.ts +47 -0
  110. package/dist/modules/file-browser/acl/acl-menu.d.ts +10 -0
  111. package/dist/modules/file-browser/acl/acl-modal.d.ts +17 -0
  112. package/dist/modules/file-browser/acl/acl-model.d.ts +17 -0
  113. package/dist/modules/file-browser/acl/acl-principal-tabs.d.ts +6 -0
  114. package/dist/modules/file-browser/acl/acl-tag.d.ts +7 -0
  115. package/dist/modules/file-browser/acl/locales/en-US.d.ts +44 -0
  116. package/dist/modules/file-browser/acl/locales/zh-CN.d.ts +44 -0
  117. package/dist/modules/file-browser/acl/use-acl-principals.d.ts +17 -0
  118. package/dist/modules/file-browser/acl/use-acl-report.d.ts +27 -0
  119. package/dist/modules/file-browser/acl-types.d.ts +86 -0
  120. package/dist/modules/file-browser/dashboard-model.d.ts +3 -0
  121. package/dist/modules/file-browser/file-browser-detail-icons.d.ts +0 -6
  122. package/dist/modules/file-browser/file-browser-detail.d.ts +5 -23
  123. package/dist/modules/file-browser/file-browser-labels.d.ts +1 -1
  124. package/dist/modules/file-browser/file-browser-search.d.ts +20 -0
  125. package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -10
  126. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +2 -6
  127. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  128. package/dist/modules/file-browser/fs-directories.d.ts +1 -0
  129. package/dist/modules/file-browser/fs-file-editing.d.ts +4 -0
  130. package/dist/modules/file-browser/fs-model.d.ts +3 -1
  131. package/dist/modules/file-browser/fs-preview-images.d.ts +3 -0
  132. package/dist/modules/file-browser/fs-read-file.d.ts +1 -1
  133. package/dist/modules/file-browser/index.d.ts +1 -0
  134. package/dist/modules/file-browser/locales/en-US.d.ts +5 -0
  135. package/dist/modules/file-browser/locales/zh-CN.d.ts +5 -0
  136. package/dist/modules/file-browser/style.css +2595 -703
  137. package/dist/modules/file-browser/types.d.ts +22 -20
  138. package/dist/modules/file-browser/use-file-browser-acl.d.ts +16 -0
  139. package/dist/modules/file-browser/use-file-browser.d.ts +5 -7
  140. package/dist/modules/file-browser/use-fs-tree.d.ts +1 -0
  141. package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +2 -4
  142. package/dist/modules/file-browser.js +1 -1
  143. package/dist/modules/scope-cascade/style.css +537 -37
  144. package/dist/modules/style.css +12429 -8855
  145. package/dist/n~0.js +61 -37
  146. package/dist/p0~0.js +27 -0
  147. package/dist/p~0.js +34 -25
  148. package/dist/rt~0.js +107 -4
  149. package/dist/r~0.js +1 -1
  150. package/dist/shared/auth/agreements.d.ts +10 -0
  151. package/dist/shared/auth/fields.d.ts +15 -0
  152. package/dist/shared/auth/form-frame.d.ts +12 -0
  153. package/dist/shared/auth/locales/en-US.d.ts +24 -0
  154. package/dist/shared/auth/locales/zh-CN.d.ts +24 -0
  155. package/dist/shared/auth/types.d.ts +61 -0
  156. package/dist/shared/auth/use-auth-labels.d.ts +3 -0
  157. package/dist/shared/auth/use-form.d.ts +8 -0
  158. package/dist/shared/components/button/button.d.ts +20 -0
  159. package/dist/shared/components/input/input.d.ts +17 -0
  160. package/dist/shared/components/modal/locales/en-US.d.ts +4 -0
  161. package/dist/shared/components/modal/locales/zh-CN.d.ts +4 -0
  162. package/dist/shared/components/modal/modal.d.ts +2 -0
  163. package/dist/shared/components/modal/types.d.ts +18 -0
  164. package/dist/shared/components/overlay/lock-body-scroll.d.ts +1 -0
  165. package/dist/style.css +15477 -6258
  166. package/dist/s~0.js +16 -0
  167. package/dist/u~0.js +15 -6
  168. package/dist/viking-bot-composer~0.js +29 -11
  169. package/dist/viking-bot-interaction~0.js +2 -1
  170. package/package.json +34 -3
  171. package/dist/modules/file-browser/fs-selection.d.ts +0 -4
  172. package/dist/o~0.js +0 -106
@@ -5,6 +5,7 @@ import type { FileBrowserDashboard } from './dashboard-model.js';
5
5
  import type { FilePreviewLabels, FilePreviewTab } from '../../components/file-preview/index.js';
6
6
  import type { FileTreeEntryRow, FileTreeLabels, FileTreeRow } from '../../components/file-tree/index.js';
7
7
  import type { OvRequestOptions } from '../../client/index.js';
8
+ import type { FileBrowserAclLabels, FileBrowserAclOptions } from './acl-types.js';
8
9
  import type { ComponentPropsWithRef, HTMLAttributes, ReactElement, ReactNode } from 'react';
9
10
  /**
10
11
  * 文件浏览模块的可替换文案。入口、树与预览的文案分别透传,模块外壳只提供
@@ -23,6 +24,10 @@ export interface FileBrowserDashboardLabels {
23
24
  failed?: string;
24
25
  }
25
26
  export interface FileBrowserLabels {
27
+ accessDenied?: string;
28
+ traverseOnly?: string;
29
+ /** 权限管理文案。Permission management copy. */
30
+ acl?: FileBrowserAclLabels;
26
31
  /** 预览底部字符数。Character count in the preview footer. */
27
32
  formatCharacterCount?: (count: number) => string;
28
33
  /** 未选中资源时的提示。Message shown when no resource is selected. */
@@ -33,8 +38,14 @@ export interface FileBrowserLabels {
33
38
  retry?: string;
34
39
  /** 刷新按钮的无障碍名称。Accessible name of the refresh control. */
35
40
  refresh?: string;
36
- /** 搜索框占位文案。Search placeholder. */
41
+ /** 搜索入口的占位文案。Placeholder of the search trigger. */
37
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;
38
49
  /** 搜索无结果提示。Message shown when a search returns nothing. */
39
50
  searchEmpty?: string;
40
51
  /** 搜索请求失败的结论,原因由服务端返回。Conclusion when the search request fails; the reason comes from the server. */
@@ -87,7 +98,7 @@ export interface FileBrowserLabels {
87
98
  *
88
99
  * 模块自己通过 Hook 取数,props 里没有数据字段:宿主给配置、受控的当前资源、
89
100
  * 接入配置、导入交互、文案与请求配置。入口条、目录、搜索、预览页签与行级
90
- * 状态都在模块内维护。
101
+ * 状态都在模块内维护,包含基础搜索弹窗与接口调用。
91
102
  *
92
103
  * 模块包含文件树、文件预览与顶部入口。命令面板属于 `console`。
93
104
  *
@@ -96,12 +107,19 @@ export interface FileBrowserLabels {
96
107
  * The module loads its own data through a Hook, so no prop carries data: the
97
108
  * host supplies configuration, the controlled current resource, import interactions,
98
109
  * copy and request configuration. The entry row, directory, search, preview tabs
99
- * 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.
100
111
  *
101
112
  * The module includes the file tree, file preview and top entries. The command panel
102
113
  * belongs to `console`.
103
114
  */
104
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;
121
+ /** 隐藏文件编辑入口。Disables editing in the preview. */
122
+ readOnly?: boolean;
105
123
  /** 可选文案语言;继承上层,最终默认英文。Optional locale; inherits or defaults to en-US. */
106
124
  locale?: Locale;
107
125
  /**
@@ -205,12 +223,6 @@ export interface FileBrowserApi {
205
223
  selectedId: string | null;
206
224
  /** 当前资源 URI。Current resource URI. */
207
225
  currentUri: string | null;
208
- /** 当前查询词。The current query. */
209
- query: string;
210
- /** 是否正在展示搜索结果。Whether search results are showing. */
211
- searching: boolean;
212
- /** 搜索是否进行中。Whether a search is running. */
213
- searchLoading: boolean;
214
226
  /** 刷新是否进行中。Whether a refresh is running. */
215
227
  refreshing: boolean;
216
228
  /** 预览底部元信息,例如字符数与更新时间;没有时为 `undefined`。 */
@@ -228,15 +240,6 @@ export interface FileBrowserApi {
228
240
  * instead of showing a 403 as "no files".
229
241
  */
230
242
  treeError: Error | null;
231
- /**
232
- * 搜索请求本身的失败原因。与「搜索成功但没有结果」不同:前者要显示原因与重试,
233
- * 后者才是空态文案。
234
- *
235
- * Why the search request failed. It differs from "the search succeeded but matched
236
- * nothing": the former needs the reason and a retry, only the latter is the empty
237
- * copy.
238
- */
239
- searchError: Error | null;
240
243
  /**
241
244
  * 当前资源预览的失败原因。选中了资源但读不出来时用它区分「读失败」与「什么
242
245
  * 都没选」。
@@ -267,12 +270,11 @@ export interface FileBrowserActions {
267
270
  refresh: () => Promise<void>;
268
271
  /** 切换预览页签。Switches the preview tab. */
269
272
  setPreviewKey: (key: string) => void;
270
- /** 更新查询词;空串回到目录树。Updates the query; an empty string returns to the tree. */
271
- setQuery: (query: string) => void;
272
273
  }
273
274
  /** Internal options for the composed FileBrowser loader. */
274
275
  export interface UseFileBrowserOptions {
275
276
  rootUri: string;
277
+ accessLabels?: Pick<FileBrowserLabels, 'accessDenied' | 'traverseOnly'>;
276
278
  /** Built-in copy; inherits the Provider locale, otherwise en-US. */
277
279
  locale?: Locale;
278
280
  dashboardLabels?: FileBrowserDashboardLabels;
@@ -0,0 +1,16 @@
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
+ canEdit: boolean;
13
+ titleExtra: import("react").JSX.Element | null;
14
+ actions: import("react").JSX.Element | null;
15
+ drawer: import("react").JSX.Element | null;
16
+ };
@@ -1,11 +1,9 @@
1
1
  import type { FileBrowserApi, UseFileBrowserOptions } from './types.js';
2
2
  /**
3
- * 文件浏览模块的取数与联动:把目录树、搜索与预览组合成一份视图数据。三者各自
4
- * 取数,这里只负责把它们接起来——目录行展开树,文件行与搜索结果打开预览。
3
+ * 文件浏览模块的目录与预览联动:目录行展开树,文件行打开预览。
4
+ * 占位搜索弹窗独立管理查询,不改变目录树。
5
5
  *
6
- * Data loading and coordination of the file browser module: the tree, the search
7
- * and the preview each load their own data, and this only wires them together —
8
- * a directory row expands the tree, while a file row or a search result opens
9
- * the preview.
6
+ * Coordinates directory loading and preview selection. The placeholder search
7
+ * dialog owns its query separately and leaves the tree unchanged.
10
8
  */
11
- export declare function useFileBrowser({ rootUri, locale: localeProp, dashboardKinds, renderDashboard, dashboardLabels, 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;
@@ -16,6 +16,7 @@ export interface FsTreeState {
16
16
  * {@link directoryUris} means the type is unknown.
17
17
  */
18
18
  isKnownFile: (uri: string) => boolean;
19
+ accessOf: (uri: string | null) => 'denied' | 'container' | undefined;
19
20
  toggleExpand: (row: FileTreeEntryRow) => Promise<void>;
20
21
  open: (uri: string) => Promise<void>;
21
22
  openPath: (uri: string) => Promise<void>;
@@ -1,14 +1,12 @@
1
- import { type WikiDashboardProps, type WikiConflict } from '../../components/wiki-dashboard/index.js';
1
+ import { type WikiDashboardProps } from '../../components/wiki-dashboard/index.js';
2
2
  import type { OvRequestOptions } from '../../client/types.js';
3
3
  type Props = Pick<WikiDashboardProps, 'locale' | 'labels' | 'className' | 'style'> & {
4
4
  uri: string;
5
5
  kind: 'directory' | 'file';
6
6
  onOpenUri?: (uri: string) => void;
7
7
  onOpenDashboard?: (uri: string) => void;
8
- onEdit?: (uri: string, conflict?: WikiConflict) => void;
9
- onDiscuss?: (uri: string, conflict: WikiConflict) => void;
10
8
  requestOptions?: OvRequestOptions;
11
9
  refreshGeneration?: number;
12
10
  };
13
- export declare function WikiDashboardPane({ uri, kind, requestOptions, refreshGeneration, onOpenUri, onOpenDashboard, onEdit, onDiscuss, ...props }: Props): import("react").JSX.Element;
11
+ export declare function WikiDashboardPane({ uri, kind, requestOptions, refreshGeneration, onOpenUri, onOpenDashboard, ...props }: Props): import("react").JSX.Element;
14
12
  export {};
@@ -1 +1 @@
1
- export { FileBrowser } from "../l~0.js";
1
+ export { FileBrowser } from "../l5~0.js";