@openviking/react 0.1.5 → 0.1.6

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 (101) hide show
  1. package/README.md +13 -11
  2. package/dist/37~0.js +27 -0
  3. package/dist/3c~0.js +14 -8
  4. package/dist/3~0.js +1 -1
  5. package/dist/a~0.js +2 -2
  6. package/dist/ck~0.js +4 -0
  7. package/dist/client/paths.d.ts +4 -0
  8. package/dist/components/agent-connect/style.css +48 -4
  9. package/dist/components/directory-tour/style.css +46 -2
  10. package/dist/components/experience-dashboard/dashboard-tabs.d.ts +11 -0
  11. package/dist/components/experience-dashboard/experience-dashboard.d.ts +2 -0
  12. package/dist/components/experience-dashboard/experience-impact.d.ts +11 -0
  13. package/dist/components/experience-dashboard/experience-list.d.ts +9 -0
  14. package/dist/components/experience-dashboard/experience-pagination.d.ts +8 -0
  15. package/dist/components/experience-dashboard/experience-tests.d.ts +6 -0
  16. package/dist/components/experience-dashboard/experience-trajectories.d.ts +6 -0
  17. package/dist/components/experience-dashboard/index.d.ts +2 -0
  18. package/dist/components/experience-dashboard/labels.d.ts +2 -0
  19. package/dist/components/experience-dashboard/style.css +699 -0
  20. package/dist/components/experience-dashboard/style.js +0 -0
  21. package/dist/components/experience-dashboard/types.d.ts +106 -0
  22. package/dist/components/experience-dashboard.js +1 -0
  23. package/dist/components/file-browser-entries/style.css +144 -12
  24. package/dist/components/file-preview/style.css +48 -4
  25. package/dist/components/file-tree/style.css +63 -4
  26. package/dist/components/scope-switcher/style.css +48 -4
  27. package/dist/components/scope-switcher.js +1 -1
  28. package/dist/components/style.css +2168 -84
  29. package/dist/components/tui/style.css +122 -36
  30. package/dist/components/viking-bot/style.css +159 -12
  31. package/dist/components/wiki-dashboard/index.d.ts +2 -0
  32. package/dist/components/wiki-dashboard/labels.d.ts +2 -0
  33. package/dist/components/wiki-dashboard/style.css +741 -0
  34. package/dist/components/wiki-dashboard/style.js +0 -0
  35. package/dist/components/wiki-dashboard/types.d.ts +92 -0
  36. package/dist/components/wiki-dashboard/wiki-action-button.d.ts +9 -0
  37. package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +15 -0
  38. package/dist/components/wiki-dashboard/wiki-dashboard.d.ts +2 -0
  39. package/dist/components/wiki-dashboard/wiki-file-icon.d.ts +3 -0
  40. package/dist/components/wiki-dashboard/wiki-severity-filter.d.ts +8 -0
  41. package/dist/components/wiki-dashboard.js +1 -0
  42. package/dist/c~0.js +1 -1
  43. package/dist/fi~0.js +354 -0
  44. package/dist/fj~0.js +503 -0
  45. package/dist/f~0.js +661 -315
  46. package/dist/icons/index.d.ts +28 -0
  47. package/dist/icons.js +1 -1
  48. package/dist/index.d.ts +4 -0
  49. package/dist/index.js +3 -1
  50. package/dist/k~0.js +277 -1
  51. package/dist/lk~0.js +52 -13
  52. package/dist/l~0.js +1021 -118
  53. package/dist/modules/console/index.d.ts +1 -2
  54. package/dist/modules/console/style.css +377 -56
  55. package/dist/modules/console.js +1 -1
  56. package/dist/modules/file-browser/dashboard-data.d.ts +9 -0
  57. package/dist/modules/file-browser/dashboard-indicator.d.ts +8 -0
  58. package/dist/modules/file-browser/dashboard-labels.d.ts +9 -0
  59. package/dist/modules/file-browser/dashboard-model.d.ts +14 -0
  60. package/dist/modules/file-browser/dashboard-resource.d.ts +12 -0
  61. package/dist/modules/file-browser/experience-dashboard-pane.d.ts +8 -0
  62. package/dist/modules/file-browser/experience-data.d.ts +31 -0
  63. package/dist/modules/file-browser/file-browser-labels.d.ts +1 -1
  64. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +3 -2
  65. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  66. package/dist/modules/file-browser/fs-directories.d.ts +8 -0
  67. package/dist/modules/file-browser/fs-lines.d.ts +36 -0
  68. package/dist/modules/file-browser/fs-memory-fields.d.ts +65 -0
  69. package/dist/modules/file-browser/fs-model.d.ts +12 -2
  70. package/dist/modules/file-browser/fs-read-file.d.ts +14 -0
  71. package/dist/modules/file-browser/fs-selection.d.ts +4 -0
  72. package/dist/modules/file-browser/index.d.ts +2 -2
  73. package/dist/modules/file-browser/style.css +1768 -24
  74. package/dist/modules/file-browser/types.d.ts +62 -0
  75. package/dist/modules/file-browser/use-browser-dashboards.d.ts +31 -0
  76. package/dist/modules/file-browser/use-dashboard-query.d.ts +9 -0
  77. package/dist/modules/file-browser/use-experience-dashboard.d.ts +27 -0
  78. package/dist/modules/file-browser/use-file-browser.d.ts +2 -45
  79. package/dist/modules/file-browser/use-fs-tree.d.ts +2 -0
  80. package/dist/modules/file-browser/use-wiki-dashboard.d.ts +17 -0
  81. package/dist/modules/file-browser/wiki-conflicts.d.ts +12 -0
  82. package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +14 -0
  83. package/dist/modules/file-browser.js +1 -1
  84. package/dist/modules/scope-cascade/controller.d.ts +2 -2
  85. package/dist/modules/scope-cascade/index.d.ts +1 -2
  86. package/dist/modules/scope-cascade/scope-cascade.d.ts +1 -1
  87. package/dist/modules/scope-cascade/style.css +48 -4
  88. package/dist/modules/scope-cascade/types.d.ts +8 -3
  89. package/dist/modules/scope-cascade/use-scope-cascade.d.ts +2 -2
  90. package/dist/modules/scope-cascade.js +1 -1
  91. package/dist/modules/style.css +2344 -191
  92. package/dist/n~0.js +13 -129
  93. package/dist/rt~0.js +152 -0
  94. package/dist/r~0.js +17 -38
  95. package/dist/shared/components/popover/popover.d.ts +1 -1
  96. package/dist/shared/components/popover/types.d.ts +7 -1
  97. package/dist/shared/dashboard/dashboard-state.d.ts +12 -0
  98. package/dist/static/image/dashboard-background.png +0 -0
  99. package/dist/style.css +8897 -4616
  100. package/dist/viking-bot-composer~0.js +1 -1
  101. package/package.json +12 -2
@@ -1,6 +1,7 @@
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';
@@ -13,6 +14,14 @@ import type { ComponentPropsWithRef, HTMLAttributes, ReactElement, ReactNode } f
13
14
  * passed through as-is; the module shell only carries the strings
14
15
  * it renders itself.
15
16
  */
17
+ export interface FileBrowserDashboardLabels {
18
+ experienceTitle?: string;
19
+ wikiTitle?: string;
20
+ openExperience?: string;
21
+ openWiki?: string;
22
+ wikiConflicts?: string;
23
+ failed?: string;
24
+ }
16
25
  export interface FileBrowserLabels {
17
26
  /** 预览底部字符数。Character count in the preview footer. */
18
27
  formatCharacterCount?: (count: number) => string;
@@ -69,6 +78,7 @@ export interface FileBrowserLabels {
69
78
  entries?: FileBrowserEntriesLabels;
70
79
  /** 目录树文案。Copy of the file tree. */
71
80
  tree?: FileTreeLabels;
81
+ dashboard?: FileBrowserDashboardLabels;
72
82
  /** 预览文案。Copy of the file preview. */
73
83
  preview?: FilePreviewLabels;
74
84
  }
@@ -135,6 +145,8 @@ export interface FileBrowserProps extends Omit<HTMLAttributes<HTMLDivElement>, '
135
145
  * Configuration of the built-in connection drawer; enables its entry when provided.
136
146
  */
137
147
  agentConnect?: AgentConnectProps;
148
+ /** Host capability filter. Omitted enables both; an empty array disables discovery. */
149
+ dashboardKinds?: readonly FileBrowserDashboard['kind'][];
138
150
  /**
139
151
  * 当前资源变化后触发,参数为新的 URI。
140
152
  *
@@ -149,6 +161,8 @@ export interface FileBrowserProps extends Omit<HTMLAttributes<HTMLDivElement>, '
149
161
  * pane.
150
162
  */
151
163
  onUriChange?: (uri: string | null) => void;
164
+ /** Host gateway/view override; nullish values retain the native dashboard. */
165
+ renderDashboard?: (dashboard: FileBrowserDashboard) => ReactNode;
152
166
  /**
153
167
  * 默认导入按钮的点击回调,单独传入即可显示导入入口。
154
168
  * Click handler of the default import button; enables its entry on its own.
@@ -183,6 +197,8 @@ export interface FileBrowserProps extends Omit<HTMLAttributes<HTMLDivElement>, '
183
197
  * own view from these without the composite one.
184
198
  */
185
199
  export interface FileBrowserApi {
200
+ dashboards: ReadonlyMap<string, FileBrowserDashboard>;
201
+ dashboardError: Error | null;
186
202
  /** 按渲染顺序排列的可见行。Visible rows in render order. */
187
203
  rows: readonly FileTreeRow[];
188
204
  /** 当前选中的行 id。Selected row id. */
@@ -238,6 +254,7 @@ export interface FileBrowserApi {
238
254
  }
239
255
  /** 模块 Hook 暴露的操作。Operations the module Hook exposes. */
240
256
  export interface FileBrowserActions {
257
+ openDashboard: (uri: string) => void;
241
258
  /** 选中条目。Selects an entry. */
242
259
  select: (row: FileTreeEntryRow) => Promise<void>;
243
260
  /** 展开或折叠目录。Expands or collapses a directory. */
@@ -253,3 +270,48 @@ export interface FileBrowserActions {
253
270
  /** 更新查询词;空串回到目录树。Updates the query; an empty string returns to the tree. */
254
271
  setQuery: (query: string) => void;
255
272
  }
273
+ /** Internal options for the composed FileBrowser loader. */
274
+ export interface UseFileBrowserOptions {
275
+ rootUri: string;
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;
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
+ };
@@ -1,47 +1,4 @@
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
3
  * 文件浏览模块的取数与联动:把目录树、搜索与预览组合成一份视图数据。三者各自
47
4
  * 取数,这里只负责把它们接起来——目录行展开树,文件行与搜索结果打开预览。
@@ -51,4 +8,4 @@ export interface UseFileBrowserOptions {
51
8
  * a directory row expands the tree, while a file row or a search result opens
52
9
  * the preview.
53
10
  */
54
- export declare function useFileBrowser({ rootUri, locale: localeProp, controlled, summaryLabels, formatCharacterCount, defaultExpandedUri, currentUri, requestOptions, onUriChange, }: UseFileBrowserOptions): FileBrowserApi;
11
+ export declare function useFileBrowser({ rootUri, locale: localeProp, dashboardKinds, renderDashboard, dashboardLabels, controlled, summaryLabels, 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
  /**
@@ -17,6 +18,7 @@ export interface FsTreeState {
17
18
  isKnownFile: (uri: string) => boolean;
18
19
  toggleExpand: (row: FileTreeEntryRow) => Promise<void>;
19
20
  open: (uri: string) => Promise<void>;
21
+ openPath: (uri: string) => Promise<void>;
20
22
  loadMore: (parentId: string) => Promise<void>;
21
23
  retry: (parentId: string) => Promise<void>;
22
24
  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;
@@ -1,4 +1,4 @@
1
- .ov-directory-tour, .ov-agent-connect, .ov-console, .ov-divider, .ov-file-browser-entries, .ov-drawer, .ov-file-browser, .ov-file-preview, .ov-file-tree, .ov-module-placeholder, .ov-popover, .ov-scope-switcher, .ov-tooltip, .ov-tui, .ov-viking-bot, .ov-viking-bot__popover, .ov-viking-bot__reference-picker--mention, .ov-viking-bot__interaction {
1
+ .ov-directory-tour, .ov-wiki-dashboard, .ov-experience-dashboard, .ov-agent-connect, .ov-console, .ov-divider, .ov-file-browser-entries, .ov-drawer, .ov-file-browser, .ov-file-preview, .ov-file-tree, .ov-module-placeholder, .ov-popover, .ov-scope-switcher, .ov-tooltip, .ov-tui, .ov-viking-bot, .ov-viking-bot__popover, .ov-viking-bot__reference-picker--mention, .ov-viking-bot__interaction {
2
2
  --ov-ui-tour-shadow-default: 0 15px 35px #0000000d, 0 5px 15px #0000000d;
3
3
  --ov-ui-tour-highlight-default: #5252ff14;
4
4
  --ov-ui-primary-default: #5252ff;
@@ -35,9 +35,29 @@
35
35
  --ov-ui-overlay-default: #0006;
36
36
  --ov-ui-tooltip-bg-default: #1f2329;
37
37
  --ov-ui-tooltip-text-default: #fff;
38
- }
39
-
40
- .dark .ov-directory-tour, .dark .ov-agent-connect, .dark .ov-console, .dark .ov-divider, .dark .ov-file-browser-entries, .dark .ov-drawer, .dark .ov-file-browser, .dark .ov-file-preview, .dark .ov-file-tree, .dark .ov-module-placeholder, .dark .ov-popover, .dark .ov-scope-switcher, .dark .ov-tooltip, .dark .ov-tui, .dark .ov-viking-bot, .dark .ov-viking-bot__popover, .dark .ov-viking-bot__reference-picker--mention, .dark .ov-viking-bot__interaction {
38
+ --ov-ui-library-swatch-1-default: linear-gradient(145deg,
39
+ #ffd8ec 8%,
40
+ #ffabc8 46%,
41
+ #d8cbff 100%);
42
+ --ov-ui-library-swatch-2-default: linear-gradient(145deg,
43
+ #d9e8ff 8%,
44
+ #b8a6ff 52%,
45
+ #f3d6ff 100%);
46
+ --ov-ui-library-swatch-3-default: linear-gradient(145deg,
47
+ #ffe6bc 8%,
48
+ #ffaf96 48%,
49
+ #ff8bc5 100%);
50
+ --ov-ui-library-swatch-4-default: linear-gradient(145deg,
51
+ #eaf7ba 8%,
52
+ #b5efb8 52%,
53
+ #73d9c6 100%);
54
+ --ov-ui-library-swatch-5-default: linear-gradient(145deg,
55
+ #fff1ba 8%,
56
+ #ffc776 52%,
57
+ #bd9cff 100%);
58
+ }
59
+
60
+ .dark .ov-directory-tour, html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, .dark .ov-agent-connect, .dark .ov-console, .dark .ov-divider, .dark .ov-file-browser-entries, .dark .ov-drawer, .dark .ov-file-browser, .dark .ov-file-preview, .dark .ov-file-tree, .dark .ov-module-placeholder, .dark .ov-popover, .dark .ov-scope-switcher, .dark .ov-tooltip, .dark .ov-tui, .dark .ov-viking-bot, .dark .ov-viking-bot__popover, .dark .ov-viking-bot__reference-picker--mention, .dark .ov-viking-bot__interaction {
41
61
  --ov-ui-primary-default: #5f5fff;
42
62
  --ov-ui-primary-hover-default: #7075ff;
43
63
  --ov-ui-primary-active-default: #4242ba;
@@ -91,6 +111,30 @@
91
111
  --ov-ui-connect-notice-default: var(--ov-ui-text-2-default);
92
112
  }
93
113
 
114
+ .ov-wiki-dashboard, .ov-experience-dashboard, .ov-file-browser {
115
+ --ov-ui-dashboard-surface-default: #f8f8f8;
116
+ --ov-ui-dashboard-card-default: #fafafa;
117
+ --ov-ui-dashboard-muted-default: #787c91;
118
+ --ov-ui-dashboard-border-default: #edeef2;
119
+ --ov-ui-dashboard-warning-default: #eb7d00;
120
+ --ov-ui-dashboard-warning-light-default: #fff0e5;
121
+ --ov-ui-dashboard-danger-default: #d92d54;
122
+ --ov-ui-dashboard-danger-light-default: #ffecee;
123
+ --ov-ui-dashboard-success-default: #4f9c70;
124
+ }
125
+
126
+ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-file-browser {
127
+ --ov-ui-dashboard-surface-default: var(--ov-ui-bg-3-default);
128
+ --ov-ui-dashboard-card-default: var(--ov-ui-bg-3-default);
129
+ --ov-ui-dashboard-muted-default: var(--ov-ui-text-3-default);
130
+ --ov-ui-dashboard-border-default: var(--ov-ui-border-1-default);
131
+ --ov-ui-dashboard-warning-default: var(--ov-ui-warning-default);
132
+ --ov-ui-dashboard-warning-light-default: var(--ov-ui-warning-light-default);
133
+ --ov-ui-dashboard-danger-default: var(--ov-ui-status-error-default);
134
+ --ov-ui-dashboard-danger-light-default: var(--ov-ui-bg-5-default);
135
+ --ov-ui-dashboard-success-default: var(--ov-ui-status-success-default);
136
+ }
137
+
94
138
  .ov-scope-switcher {
95
139
  --ov-ui-scope-switcher-divider: var(--ov-ui-color-text-disabled, var(--ov-ui-text-disabled-default, #a5a7bb));
96
140
  --ov-ui-scope-switcher-icon: var(--ov-ui-color-text-2, var(--ov-ui-text-2-default, #3f3f51));
@@ -31,12 +31,17 @@ export interface ScopeCascadeController {
31
31
  ScopeCascadeLevel
32
32
  ];
33
33
  }
34
- export interface ScopeCascadeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
35
- controller: ScopeCascadeController;
36
- /** 可选文案语言;继承上层,最终默认英文。Optional locale; inherits or defaults to en-US. */
34
+ export interface ScopeCascadeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange'>, ScopeCascadeApi {
35
+ /** Optional locale; inherits the nearest module or Provider. */
37
36
  locale?: Locale;
38
37
  /** Accessible names and placeholders, in library / space / user order. */
39
38
  levelNames?: readonly [string, string, string];
40
39
  retryLabel?: string;
40
+ onChange?: (selection: ScopeCascadeSelection | null) => void;
41
41
  labels?: ScopeSwitcherLabels;
42
42
  }
43
+ export interface ScopeCascadeSelection {
44
+ libraryId: string;
45
+ spaceId: string;
46
+ userId: string;
47
+ }
@@ -1,5 +1,5 @@
1
- import type { ScopeCascadeApi, ScopeCascadeLevel } from './types.js';
1
+ import type { ScopeCascadeApi, ScopeCascadeLevel, ScopeCascadeProps } from './types.js';
2
2
  /** Creates a stable coordinator without subscribing the caller to its data. */
3
- export declare function useScopeCascade({ loadLibraries, loadSpaces, loadUsers, }: ScopeCascadeApi): import("./types.js").ScopeCascadeController;
3
+ export declare function useScopeCascade({ loadLibraries, loadSpaces, loadUsers }: ScopeCascadeApi, onChange?: ScopeCascadeProps['onChange']): import("./types.js").ScopeCascadeController;
4
4
  /** Call in a leaf, never aggregate all three subscriptions in the root. */
5
5
  export declare function useScopeCascadeLevel(level: ScopeCascadeLevel): import("./types.js").ScopeCascadeSnapshot;
@@ -1 +1 @@
1
- export { ScopeCascade, useScopeCascade, useScopeCascadeLevel } from "../lk~0.js";
1
+ export { ScopeCascade } from "../lk~0.js";