@openviking/react 0.1.6 → 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 (94) hide show
  1. package/README.md +2 -0
  2. package/dist/2~0.js +6 -5
  3. package/dist/3c~0.js +10 -4
  4. package/dist/3~0.js +18 -8
  5. package/dist/ae~0.js +8 -1
  6. package/dist/ark-message-list-view~0.js +9 -4
  7. package/dist/a~0.js +12 -6
  8. package/dist/c7r~0.js +50 -0
  9. package/dist/ck~0.js +3 -0
  10. package/dist/client/paths.d.ts +6 -0
  11. package/dist/client/provider.d.ts +6 -1
  12. package/dist/components/agent-connect/style.css +222 -35
  13. package/dist/components/directory-tour/style.css +221 -21
  14. package/dist/components/directory-tour.js +1 -1
  15. package/dist/components/experience-dashboard/style.css +227 -12
  16. package/dist/components/experience-dashboard.js +1 -1
  17. package/dist/components/file-browser-entries/style.css +325 -80
  18. package/dist/components/file-preview/style.css +221 -76
  19. package/dist/components/file-tree/file-tree-toolbar.d.ts +3 -3
  20. package/dist/components/file-tree/locales/en-US.d.ts +3 -0
  21. package/dist/components/file-tree/locales/zh-CN.d.ts +3 -0
  22. package/dist/components/file-tree/style.css +311 -86
  23. package/dist/components/file-tree/types.d.ts +13 -4
  24. package/dist/components/scope-switcher/style.css +366 -37
  25. package/dist/components/scope-switcher.js +1 -1
  26. package/dist/components/style.css +3329 -640
  27. package/dist/components/tui/style.css +267 -35
  28. package/dist/components/viking-bot/interaction/style.css +143 -22
  29. package/dist/components/viking-bot/style.css +945 -295
  30. package/dist/components/wiki-dashboard/style.css +227 -12
  31. package/dist/c~0.js +16 -8
  32. package/dist/ep~0.js +345 -0
  33. package/dist/e~0.js +33 -328
  34. package/dist/fj~0.js +8 -4
  35. package/dist/fl~0.js +709 -0
  36. package/dist/f~0.js +302 -663
  37. package/dist/index.js +3 -3
  38. package/dist/lk~0.js +6 -3
  39. package/dist/l~0.js +1874 -437
  40. package/dist/modules/console/style.css +1471 -351
  41. package/dist/modules/file-browser/acl/acl-add-principal.d.ts +12 -0
  42. package/dist/modules/file-browser/acl/acl-candidate.d.ts +8 -0
  43. package/dist/modules/file-browser/acl/acl-client.d.ts +13 -0
  44. package/dist/modules/file-browser/acl/acl-confirmation.d.ts +6 -0
  45. package/dist/modules/file-browser/acl/acl-entry.d.ts +13 -0
  46. package/dist/modules/file-browser/acl/acl-labels.d.ts +47 -0
  47. package/dist/modules/file-browser/acl/acl-menu.d.ts +10 -0
  48. package/dist/modules/file-browser/acl/acl-modal.d.ts +17 -0
  49. package/dist/modules/file-browser/acl/acl-model.d.ts +17 -0
  50. package/dist/modules/file-browser/acl/acl-principal-tabs.d.ts +6 -0
  51. package/dist/modules/file-browser/acl/acl-tag.d.ts +7 -0
  52. package/dist/modules/file-browser/acl/locales/en-US.d.ts +44 -0
  53. package/dist/modules/file-browser/acl/locales/zh-CN.d.ts +44 -0
  54. package/dist/modules/file-browser/acl/use-acl-principals.d.ts +17 -0
  55. package/dist/modules/file-browser/acl/use-acl-report.d.ts +27 -0
  56. package/dist/modules/file-browser/acl-types.d.ts +86 -0
  57. package/dist/modules/file-browser/dashboard-model.d.ts +3 -0
  58. package/dist/modules/file-browser/file-browser-detail.d.ts +4 -1
  59. package/dist/modules/file-browser/file-browser-labels.d.ts +1 -1
  60. package/dist/modules/file-browser/file-browser-search.d.ts +20 -0
  61. package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -10
  62. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +2 -6
  63. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  64. package/dist/modules/file-browser/fs-directories.d.ts +1 -0
  65. package/dist/modules/file-browser/fs-model.d.ts +3 -1
  66. package/dist/modules/file-browser/index.d.ts +1 -0
  67. package/dist/modules/file-browser/locales/en-US.d.ts +5 -0
  68. package/dist/modules/file-browser/locales/zh-CN.d.ts +5 -0
  69. package/dist/modules/file-browser/style.css +2409 -603
  70. package/dist/modules/file-browser/types.d.ts +20 -20
  71. package/dist/modules/file-browser/use-file-browser-acl.d.ts +15 -0
  72. package/dist/modules/file-browser/use-file-browser.d.ts +5 -7
  73. package/dist/modules/file-browser/use-fs-tree.d.ts +1 -0
  74. package/dist/modules/scope-cascade/style.css +535 -37
  75. package/dist/modules/style.css +12227 -8757
  76. package/dist/n~0.js +60 -36
  77. package/dist/rt~0.js +107 -4
  78. package/dist/r~0.js +1 -1
  79. package/dist/shared/components/button/button.d.ts +20 -0
  80. package/dist/shared/components/input/input.d.ts +17 -0
  81. package/dist/shared/components/modal/locales/en-US.d.ts +4 -0
  82. package/dist/shared/components/modal/locales/zh-CN.d.ts +4 -0
  83. package/dist/shared/components/modal/modal.d.ts +2 -0
  84. package/dist/shared/components/modal/types.d.ts +18 -0
  85. package/dist/shared/components/overlay/lock-body-scroll.d.ts +1 -0
  86. package/dist/style.css +7776 -1571
  87. package/dist/s~0.js +16 -0
  88. package/dist/u~0.js +15 -6
  89. package/dist/viking-bot-composer~0.js +29 -11
  90. package/dist/viking-bot-interaction~0.js +2 -1
  91. package/package.json +3 -2
  92. package/dist/fi~0.js +0 -354
  93. package/dist/modules/file-browser/fs-selection.d.ts +0 -4
  94. package/dist/o~0.js +0 -106
@@ -0,0 +1,12 @@
1
+ import type { OvIdentityValue } from '../../../client/types.js';
2
+ import type { FileBrowserAclContext, FileBrowserAclEntry, FileBrowserAclOptions } from '../acl-types.js';
3
+ import type { AclText } from './acl-labels.js';
4
+ export declare function AclAddPrincipal({ entries, text, disabled, context, accountId, options, onAdd, }: {
5
+ entries: FileBrowserAclEntry[];
6
+ text: AclText;
7
+ disabled: boolean;
8
+ context: FileBrowserAclContext;
9
+ accountId?: OvIdentityValue;
10
+ options?: FileBrowserAclOptions;
11
+ onAdd: (entries: FileBrowserAclEntry[]) => void;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { FileBrowserAclLevel } from '../acl-types.js';
2
+ import type { AclText } from './acl-labels.js';
3
+ export declare function AclCandidate({ principal, level, text, onChange, }: {
4
+ principal: string;
5
+ level?: FileBrowserAclLevel;
6
+ text: AclText;
7
+ onChange: (level?: FileBrowserAclLevel) => void;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { OvClient, OvIdentityValue, OvRequestOptions } from '../../../client/types.js';
2
+ import type { FileBrowserAclContext, FileBrowserAclPrincipalPage, FileBrowserAclReport } from '../acl-types.js';
3
+ export declare const readAcl: (client: OvClient, uri: string, options: OvRequestOptions) => Promise<FileBrowserAclReport>;
4
+ export declare function readPermission(client: OvClient, uri: string, options: OvRequestOptions): Promise<import("../acl-types.js").FileBrowserAclLevel | undefined>;
5
+ export declare function writeAcl(client: OvClient, uri: string, options: OvRequestOptions, change?: Pick<FileBrowserAclReport, 'direct_entries'> & {
6
+ mode: 'inherit' | 'restricted';
7
+ }): Promise<FileBrowserAclReport>;
8
+ export declare function identityValue(value: OvIdentityValue | undefined): Promise<string>;
9
+ export declare function listPrincipals(query: {
10
+ type: 'user' | 'group';
11
+ keyword: string;
12
+ page: number;
13
+ }, context: FileBrowserAclContext, accountId: OvIdentityValue | undefined): Promise<FileBrowserAclPrincipalPage>;
@@ -0,0 +1,6 @@
1
+ import type { AclText } from './acl-labels.js';
2
+ import type { AclModel } from './use-acl-report.js';
3
+ export declare function AclConfirmation({ model, text, }: {
4
+ model: AclModel;
5
+ text: AclText;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { FileBrowserAclEntry, FileBrowserAclLevel } from '../acl-types.js';
2
+ import type { AclText } from './acl-labels.js';
3
+ export declare function AclAvatar({ principal }: {
4
+ principal: string;
5
+ }): import("react").JSX.Element;
6
+ export declare function AclEntry({ entry, source, text, disabled, onChange, onRemove, }: {
7
+ entry: FileBrowserAclEntry;
8
+ source?: string;
9
+ text: AclText;
10
+ disabled: boolean;
11
+ onChange: (level: FileBrowserAclLevel) => void;
12
+ onRemove: () => void;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { type Locale } from '../../../shared/locale.js';
2
+ import type { FileBrowserAclLabels, FileBrowserAclLevel } from '../acl-types.js';
3
+ export type AclText = Required<FileBrowserAclLabels>;
4
+ export declare const aclLabels: (locale: Locale, labels?: FileBrowserAclLabels) => {
5
+ title: string;
6
+ manage: string;
7
+ read: string;
8
+ write: string;
9
+ manageLevel: string;
10
+ readDescription: string;
11
+ writeDescription: string;
12
+ manageDescription: string;
13
+ effectivePermission: string;
14
+ addPrincipal: string;
15
+ search: string;
16
+ users: string;
17
+ groups: string;
18
+ allUsers: string;
19
+ administrator: string;
20
+ administratorDescription: string;
21
+ direct: string;
22
+ inherited: string;
23
+ remove: string;
24
+ add: string;
25
+ cancel: string;
26
+ confirm: string;
27
+ close: string;
28
+ retry: string;
29
+ loadMore: string;
30
+ loading: string;
31
+ saving: string;
32
+ saved: string;
33
+ loadFailed: string;
34
+ saveFailed: string;
35
+ principalsFailed: string;
36
+ empty: string;
37
+ noMatches: string;
38
+ restricted: string;
39
+ restore: string;
40
+ stopTitle: string;
41
+ stopDescription: string;
42
+ restoreTitle: string;
43
+ restoreDescription: string;
44
+ restoreRemoved: string;
45
+ readOnly: string;
46
+ };
47
+ export declare const levelLabel: (level: FileBrowserAclLevel, text: AclText) => string;
@@ -0,0 +1,10 @@
1
+ import type { FileBrowserAclLevel } from '../acl-types.js';
2
+ import { type AclText } from './acl-labels.js';
3
+ export declare function AclMenu({ level, text, name, disabled, onChange, onRemove, }: {
4
+ level: FileBrowserAclLevel;
5
+ text: AclText;
6
+ name: string;
7
+ disabled?: boolean;
8
+ onChange: (level: FileBrowserAclLevel) => void;
9
+ onRemove?: () => void;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { type RefObject } from 'react';
2
+ import type { Locale } from '../../../shared/locale.js';
3
+ import type { OvIdentityValue } from '../../../client/types.js';
4
+ import type { FileBrowserAclContext, FileBrowserAclOptions, FileBrowserAclReport } from '../acl-types.js';
5
+ import { type AclText } from './acl-labels.js';
6
+ export declare function AclModal({ uri, open, text, locale, context, triggerRef, accountId, options, onClose, onUpdated, }: {
7
+ uri: string;
8
+ open: boolean;
9
+ text: AclText;
10
+ locale: Locale;
11
+ context: FileBrowserAclContext;
12
+ triggerRef: RefObject<HTMLButtonElement | null>;
13
+ accountId?: OvIdentityValue;
14
+ options?: FileBrowserAclOptions;
15
+ onClose: () => void;
16
+ onUpdated: (report: FileBrowserAclReport) => void;
17
+ }): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { FileBrowserAclEntry as Entry, FileBrowserAclLevel as Level, FileBrowserAclReport as Report } from '../acl-types.js';
2
+ export declare const LEVELS: readonly Level[];
3
+ export declare const isLevel: (value: unknown) => value is Level;
4
+ export declare function isAclTarget(uri: string | null): uri is string;
5
+ export declare function normalizeEntries(entries: readonly Entry[]): Entry[];
6
+ export declare function parseReport(value: unknown, uri: string): Report;
7
+ /** Increases preserve inheritance; reducing an inherited grant needs a restricted boundary. */
8
+ export declare function planChange(report: Report, next: Entry[]): {
9
+ entries: Entry[];
10
+ mode: 'restricted';
11
+ confirmation: boolean;
12
+ } | {
13
+ entries: Entry[];
14
+ mode: 'inherit';
15
+ confirmation: boolean;
16
+ };
17
+ export declare function restoreDiff(report: Report): Entry[];
@@ -0,0 +1,6 @@
1
+ import type { AclText } from './acl-labels.js';
2
+ export declare function AclPrincipalTabs({ type, text, onChange, }: {
3
+ type: 'user' | 'group';
4
+ text: AclText;
5
+ onChange: (type: 'user' | 'group') => void;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { FileBrowserAclLevel } from '../acl-types.js';
2
+ import { type AclText } from './acl-labels.js';
3
+ export declare function AclTag({ level, text, onManage, }: {
4
+ level: FileBrowserAclLevel;
5
+ text: AclText;
6
+ onManage: () => void;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,44 @@
1
+ declare const _default: {
2
+ title: string;
3
+ manage: string;
4
+ read: string;
5
+ write: string;
6
+ manageLevel: string;
7
+ readDescription: string;
8
+ writeDescription: string;
9
+ manageDescription: string;
10
+ effectivePermission: string;
11
+ addPrincipal: string;
12
+ search: string;
13
+ users: string;
14
+ groups: string;
15
+ allUsers: string;
16
+ administrator: string;
17
+ administratorDescription: string;
18
+ direct: string;
19
+ inherited: string;
20
+ remove: string;
21
+ add: string;
22
+ cancel: string;
23
+ confirm: string;
24
+ close: string;
25
+ retry: string;
26
+ loadMore: string;
27
+ loading: string;
28
+ saving: string;
29
+ saved: string;
30
+ loadFailed: string;
31
+ saveFailed: string;
32
+ principalsFailed: string;
33
+ empty: string;
34
+ noMatches: string;
35
+ restricted: string;
36
+ restore: string;
37
+ stopTitle: string;
38
+ stopDescription: string;
39
+ restoreTitle: string;
40
+ restoreDescription: string;
41
+ restoreRemoved: string;
42
+ readOnly: string;
43
+ };
44
+ export default _default;
@@ -0,0 +1,44 @@
1
+ declare const _default: {
2
+ title: string;
3
+ manage: string;
4
+ read: string;
5
+ write: string;
6
+ manageLevel: string;
7
+ readDescription: string;
8
+ writeDescription: string;
9
+ manageDescription: string;
10
+ effectivePermission: string;
11
+ addPrincipal: string;
12
+ search: string;
13
+ users: string;
14
+ groups: string;
15
+ allUsers: string;
16
+ administrator: string;
17
+ administratorDescription: string;
18
+ direct: string;
19
+ inherited: string;
20
+ remove: string;
21
+ add: string;
22
+ cancel: string;
23
+ confirm: string;
24
+ close: string;
25
+ retry: string;
26
+ loadMore: string;
27
+ loading: string;
28
+ saving: string;
29
+ saved: string;
30
+ loadFailed: string;
31
+ saveFailed: string;
32
+ principalsFailed: string;
33
+ empty: string;
34
+ noMatches: string;
35
+ restricted: string;
36
+ restore: string;
37
+ stopTitle: string;
38
+ stopDescription: string;
39
+ restoreTitle: string;
40
+ restoreDescription: string;
41
+ restoreRemoved: string;
42
+ readOnly: string;
43
+ };
44
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type { OvIdentityValue } from '../../../client/types.js';
2
+ import type { FileBrowserAclContext, FileBrowserAclOptions } from '../acl-types.js';
3
+ export declare function useAclPrincipals({ open, type, keyword, context, accountId, options, }: {
4
+ open: boolean;
5
+ type: 'user' | 'group';
6
+ keyword: string;
7
+ context: FileBrowserAclContext;
8
+ accountId?: OvIdentityValue;
9
+ options?: FileBrowserAclOptions;
10
+ }): {
11
+ items: string[];
12
+ loading: boolean;
13
+ error: Error | undefined;
14
+ hasMore: boolean;
15
+ more: () => void;
16
+ retry: () => void;
17
+ };
@@ -0,0 +1,27 @@
1
+ import type { FileBrowserAclContext, FileBrowserAclEntry, FileBrowserAclReport } from '../acl-types.js';
2
+ type Confirmation = {
3
+ kind: 'restrict';
4
+ entries: FileBrowserAclEntry[];
5
+ } | {
6
+ kind: 'restore';
7
+ };
8
+ export declare function useAclReport({ uri, context, open, readOnly, onUpdated, }: {
9
+ uri: string;
10
+ context: FileBrowserAclContext;
11
+ open: boolean;
12
+ readOnly: boolean;
13
+ onUpdated: (report: FileBrowserAclReport) => void;
14
+ }): {
15
+ report: FileBrowserAclReport | undefined;
16
+ confirmation: Confirmation | undefined;
17
+ error: Error | undefined;
18
+ phase: "loading" | "ready" | "saving";
19
+ saved: boolean;
20
+ retry: () => void;
21
+ change: (entries: FileBrowserAclEntry[]) => void;
22
+ restore: () => void;
23
+ cancel: () => void;
24
+ confirm: () => void;
25
+ };
26
+ export type AclModel = ReturnType<typeof useAclReport>;
27
+ export {};
@@ -0,0 +1,86 @@
1
+ import type { OvClient, OvRequestOptions } from '../../client/types.js';
2
+ export type FileBrowserAclLevel = 'read' | 'write' | 'manage';
3
+ export interface FileBrowserAclEntry {
4
+ principal: string;
5
+ level: FileBrowserAclLevel;
6
+ }
7
+ export interface FileBrowserAclReport {
8
+ uri: string;
9
+ acl_mode: 'none' | 'inherit' | 'restricted';
10
+ direct_entries: FileBrowserAclEntry[];
11
+ inherited_entries: FileBrowserAclEntry[];
12
+ effective_entries: FileBrowserAclEntry[];
13
+ }
14
+ export interface FileBrowserAclContext {
15
+ client: OvClient;
16
+ requestOptions: OvRequestOptions;
17
+ }
18
+ export interface FileBrowserAclPrincipalPage {
19
+ principals: string[];
20
+ hasMore: boolean;
21
+ }
22
+ /** Optional integration where a service has additional permission metadata. */
23
+ export interface FileBrowserAclOptions {
24
+ /** 禁止授权修改,仍可查看。Prevent mutations while retaining the grant list. */
25
+ readOnly?: boolean;
26
+ /**
27
+ * 自身有效权限;默认先读 fs/stat.permission,缺失时仅探测管理权限。
28
+ * Own effective level. Defaults to fs/stat.permission, then a manage-only ACL probe.
29
+ * No particular user ID is assumed to be an administrator.
30
+ */
31
+ resolvePermission?: (uri: string, context: FileBrowserAclContext) => Promise<FileBrowserAclLevel | undefined>;
32
+ /**
33
+ * 可选候选目录;默认调用原生账号用户/用户组接口,不读取密钥。
34
+ * Optional principal directory; defaults to native account APIs without credentials.
35
+ */
36
+ listPrincipals?: (query: {
37
+ type: 'user' | 'group';
38
+ keyword: string;
39
+ page: number;
40
+ }, context: FileBrowserAclContext) => Promise<FileBrowserAclPrincipalPage>;
41
+ /** 保存成功后的通知;失败不触发。Notification after a successful ACL mutation. */
42
+ onChange?: (report: FileBrowserAclReport) => void;
43
+ }
44
+ export interface FileBrowserAclLabels {
45
+ title?: string;
46
+ manage?: string;
47
+ read?: string;
48
+ write?: string;
49
+ manageLevel?: string;
50
+ readDescription?: string;
51
+ writeDescription?: string;
52
+ manageDescription?: string;
53
+ effectivePermission?: string;
54
+ addPrincipal?: string;
55
+ search?: string;
56
+ users?: string;
57
+ groups?: string;
58
+ allUsers?: string;
59
+ administrator?: string;
60
+ administratorDescription?: string;
61
+ direct?: string;
62
+ inherited?: string;
63
+ remove?: string;
64
+ add?: string;
65
+ cancel?: string;
66
+ confirm?: string;
67
+ close?: string;
68
+ retry?: string;
69
+ loadMore?: string;
70
+ loading?: string;
71
+ saving?: string;
72
+ saved?: string;
73
+ loadFailed?: string;
74
+ saveFailed?: string;
75
+ principalsFailed?: string;
76
+ empty?: string;
77
+ noMatches?: string;
78
+ restricted?: string;
79
+ restore?: string;
80
+ stopTitle?: string;
81
+ stopDescription?: string;
82
+ restoreTitle?: string;
83
+ restoreDescription?: string;
84
+ restoreRemoved?: string;
85
+ readOnly?: string;
86
+ }
@@ -1,3 +1,4 @@
1
+ import type { FilePreviewTab } from '../../components/file-preview/index.js';
1
2
  import type { FileTreeRow } from '../../components/file-tree/index.js';
2
3
  export interface FileBrowserDashboard {
3
4
  kind: 'experience' | 'wiki';
@@ -12,3 +13,5 @@ export declare function resolveDashboard(uri: string, rows: readonly FileTreeRow
12
13
  to: string;
13
14
  conflicts_num?: number;
14
15
  }[]): FileBrowserDashboard | undefined;
16
+ /** Keep the normal tabs when no board is open, and suppress all detail tabs for blocked resources. */
17
+ export declare function mergeDashboardTab(tabs: readonly FilePreviewTab[] | null, dashboard: FilePreviewTab | undefined, blocked: boolean): readonly FilePreviewTab[] | null;
@@ -1,5 +1,6 @@
1
1
  import type { Locale } from '../../shared/locale.js';
2
2
  import { type FilePreviewTab } from '../../components/file-preview/index.js';
3
+ import type { ReactNode } from 'react';
3
4
  import type { FileBrowserLabels } from './types.js';
4
5
  /**
5
6
  * 详情区:页签行与正文。分段器(预览 / 源码)与右侧图标按钮由这里渲染,通过
@@ -20,6 +21,8 @@ export interface FileBrowserDetailProps {
20
21
  locale: Locale;
21
22
  labels?: FileBrowserLabels['preview'];
22
23
  footer?: string;
24
+ titleExtra?: ReactNode;
25
+ extraActions?: ReactNode;
23
26
  /** 分段器与图标按钮的文案。Copy for the segmented control and icon buttons. */
24
27
  viewLabels: {
25
28
  preview: string;
@@ -31,4 +34,4 @@ export interface FileBrowserDetailProps {
31
34
  };
32
35
  onActiveKeyChange: (key: string) => void;
33
36
  }
34
- export declare function FileBrowserDetail({ tabs, activeKey, locale, labels, footer, viewLabels, onActiveKeyChange, }: FileBrowserDetailProps): import("react").JSX.Element;
37
+ export declare function FileBrowserDetail({ tabs, activeKey, locale, labels, footer, titleExtra, extraActions, viewLabels, onActiveKeyChange, }: FileBrowserDetailProps): import("react").JSX.Element;
@@ -3,7 +3,7 @@ import type { FilePreviewLabels } from '../../components/file-preview/index.js';
3
3
  import type { FileTreeLabels } from '../../components/file-tree/index.js';
4
4
  import type { FileBrowserLabels } from './types.js';
5
5
  /** 模块外壳自己渲染的文案,其余透传给树与预览。 */
6
- export type ShellLabels = Omit<FileBrowserLabels, 'tree' | 'preview' | 'entries' | 'dashboard'>;
6
+ export type ShellLabels = Omit<FileBrowserLabels, 'tree' | 'preview' | 'entries' | 'dashboard' | 'acl'>;
7
7
  /**
8
8
  * 模块外壳的内置文案。树与预览的默认值留在各自组件里,模块不重复一份。
9
9
  * Built-in copy of the module shell. The tree and the preview keep their own
@@ -0,0 +1,20 @@
1
+ import { type RefObject } from 'react';
2
+ import type { OvRequestOptions } from '../../client/types.js';
3
+ import type { Locale } from '../../shared/locale.js';
4
+ import type { ResolvedLabels } from './file-browser-labels.js';
5
+ interface FileBrowserSearchProps {
6
+ open: boolean;
7
+ rootUri: string;
8
+ triggerRef: RefObject<HTMLElement | null>;
9
+ locale: Locale;
10
+ text: ResolvedLabels;
11
+ requestOptions?: OvRequestOptions;
12
+ onClose: () => void;
13
+ }
14
+ /**
15
+ * TODO: 占位搜索弹窗,目前只提交关键词并展示原生接口结果。
16
+ * 后续补齐筛选、分页、结果定位和快捷键;此视图仅供 FileBrowser 内部使用。
17
+ * Placeholder: query submission and results only; richer search interactions follow.
18
+ */
19
+ export declare function FileBrowserSearch({ open, rootUri, triggerRef, locale, text, requestOptions, onClose, }: FileBrowserSearchProps): import("react").JSX.Element;
20
+ export {};
@@ -1,17 +1,10 @@
1
- /**
2
- * 搜索行:搜索框与刷新按钮。内置的连接与导入入口位于上一行。
3
- *
4
- * The search row: the search box and refresh button. Built-in connection and import
5
- * entries occupy the row above.
6
- */
1
+ /** Host-owned search intent and module-owned refresh share the file-tree controls. */
7
2
  export interface FileBrowserToolbarProps {
8
- searchId: string;
9
- query: string;
10
3
  refreshing: boolean;
11
4
  canRefresh: boolean;
12
5
  placeholder: string;
13
6
  refreshLabel: string;
14
- onQueryChange: (value: string) => void;
7
+ onSearch?: () => void;
15
8
  onRefresh: () => void;
16
9
  }
17
- export declare function FileBrowserToolbar({ searchId, query, refreshing, canRefresh, placeholder, refreshLabel, onQueryChange, onRefresh, }: FileBrowserToolbarProps): import("react").JSX.Element;
10
+ export declare function FileBrowserToolbar({ refreshing, canRefresh, placeholder, refreshLabel, onSearch, onRefresh, }: FileBrowserToolbarProps): import("react").JSX.Element;
@@ -18,16 +18,12 @@ export interface FileBrowserTreePaneProps {
18
18
  entries: Pick<FileBrowserEntriesProps, 'agentConnect' | 'onImportResources' | 'renderImportResources' | 'labels'>;
19
19
  locale: Locale;
20
20
  dashboardLabels?: FileBrowserDashboardLabels;
21
- searchId: string;
21
+ onSearch?: () => void;
22
22
  browser: FileBrowserApi;
23
23
  treeLabels: FileTreeLabels | undefined;
24
24
  searchPlaceholder: string;
25
25
  refreshLabel: string;
26
- searchLoading: string;
27
- searchEmpty: string;
28
- /** 搜索失败时的结论文案。Conclusion shown when the search request fails. */
29
- searchErrorLabel: string;
30
26
  /** 失败态里的重试按钮。Retry button of the failure state. */
31
27
  retryLabel: string;
32
28
  }
33
- export declare function FileBrowserTreePane({ entries, locale, dashboardLabels, searchId, browser, treeLabels, searchPlaceholder, refreshLabel, searchLoading, searchEmpty, searchErrorLabel, retryLabel, }: FileBrowserTreePaneProps): import("react").JSX.Element;
29
+ export declare function FileBrowserTreePane({ entries, locale, dashboardLabels, onSearch, browser, treeLabels, searchPlaceholder, refreshLabel, 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: localeProp, agentConnect, dashboardKinds, renderDashboard, onUriChange, onImportResources, renderImportResources, labels, requestOptions, className, style, ...rest }: FileBrowserProps): import("react").JSX.Element;
15
+ export declare function FileBrowser({ uri, defaultUri, rootUri, defaultExpandedUri, locale: localeProp, agentConnect, dashboardKinds, renderDashboard, acl, onUriChange, onImportResources, renderImportResources, labels, requestOptions, className, style, ...rest }: FileBrowserProps): import("react").JSX.Element;
@@ -38,4 +38,5 @@ export declare function useTreeMetadata(rootUri: string, dirs: Record<string, Di
38
38
  metadataRows: (import("../../components/file-tree/types.js").FileTreeEntryRow & {
39
39
  tags?: readonly string[];
40
40
  })[];
41
+ accessOf: (uri: string | null) => "container" | "denied" | undefined;
41
42
  };
@@ -13,6 +13,8 @@ export interface FsEntry {
13
13
  modTime?: string;
14
14
  abstract?: string;
15
15
  tags?: readonly string[];
16
+ access?: 'denied' | 'container';
17
+ permission?: 'read' | 'write' | 'manage';
16
18
  }
17
19
  /** 一个目录已加载的子节点与分页状态。 */
18
20
  export interface DirState {
@@ -113,4 +115,4 @@ export declare function flattenTree(uri: string, depth: number, dirs: Record<str
113
115
  /** 请求被取消时不需要写回状态。A cancelled request has no state to write. */
114
116
  export declare function isAbort(error: unknown): boolean;
115
117
  /** 把任意抛出物归一成 Error。Normalises a thrown value into an Error. */
116
- export declare function toError(cause: unknown): Error;
118
+ export declare const toError: (cause: unknown) => Error;
@@ -1,3 +1,4 @@
1
1
  export { FileBrowser } from './file-browser.js';
2
2
  export type { FileBrowserLabels, FileBrowserDashboardLabels, FileBrowserProps, } from './types.js';
3
3
  export type { FileBrowserDashboard } from './dashboard-model.js';
4
+ export type { FileBrowserAclLevel, FileBrowserAclEntry, FileBrowserAclReport, FileBrowserAclContext, FileBrowserAclPrincipalPage, FileBrowserAclOptions, FileBrowserAclLabels, } from './acl-types.js';
@@ -1,10 +1,15 @@
1
1
  declare const messages: {
2
2
  formatCharacterCount: (count: number) => string;
3
+ accessDenied: string;
4
+ traverseOnly: string;
3
5
  empty: string;
4
6
  error: string;
5
7
  retry: string;
6
8
  refresh: string;
7
9
  searchPlaceholder: string;
10
+ searchTitle: string;
11
+ searchAction: string;
12
+ searchHint: string;
8
13
  searchEmpty: string;
9
14
  searchFailed: string;
10
15
  loading: string;
@@ -1,10 +1,15 @@
1
1
  declare const messages: {
2
2
  formatCharacterCount: (count: number) => string;
3
+ accessDenied: string;
4
+ traverseOnly: string;
3
5
  empty: string;
4
6
  error: string;
5
7
  retry: string;
6
8
  refresh: string;
7
9
  searchPlaceholder: string;
10
+ searchTitle: string;
11
+ searchAction: string;
12
+ searchHint: string;
8
13
  searchEmpty: string;
9
14
  searchFailed: string;
10
15
  loading: string;