@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
package/dist/f~0.js CHANGED
@@ -3,20 +3,9 @@ import { useCallback, useEffect, useId, useRef, useState } from "react";
3
3
  import { resolveLocale } from "./nx~0.js";
4
4
  import { checkreact } from "./0~0.js";
5
5
  import { searchreact } from "./p~0.js";
6
+ import { input_Input } from "./c7r~0.js";
7
+ import { chevron_downreact } from "./s~0.js";
6
8
  import { useLocale, LocaleProvider } from "./28~0.js";
7
- const SvgChevronDown = (props)=>/*#__PURE__*/ jsx("svg", {
8
- xmlns: "http://www.w3.org/2000/svg",
9
- width: 14,
10
- height: 14,
11
- fill: "none",
12
- viewBox: "0 0 14 14",
13
- ...props,
14
- children: /*#__PURE__*/ jsx("path", {
15
- fill: "currentColor",
16
- d: "M9.607 5.232a.437.437 0 1 1 .619.619L7.309 8.768a.437.437 0 0 1-.618 0L3.774 5.85a.437.437 0 1 1 .619-.619L7 7.84z"
17
- })
18
- });
19
- const chevron_downreact = SvgChevronDown;
20
9
  const messages = {
21
10
  loading: 'Loading…',
22
11
  searchPlaceholder: 'Search',
@@ -93,21 +82,17 @@ function ScopePanel({ label, data, state, slots, actions, onSelect, labels }) {
93
82
  const keyword = state?.searchKeyword ?? '';
94
83
  const hasKeyword = keyword.trim().length > 0;
95
84
  const searchVisible = actions?.onSearchKeywordChange && (hasKeyword || Math.max(options.length, data.options.length, data.total ?? 0) > 10);
96
- const search = searchVisible ? /*#__PURE__*/ jsxs("div", {
85
+ const search = searchVisible ? /*#__PURE__*/ jsx(input_Input, {
86
+ size: "small",
87
+ prefix: /*#__PURE__*/ jsx(searchreact, {
88
+ className: "ov-scope-switcher__search-icon"
89
+ }),
90
+ type: "search",
97
91
  className: "ov-scope-switcher__search-field",
98
- children: [
99
- /*#__PURE__*/ jsx(searchreact, {
100
- className: "ov-scope-switcher__search-icon"
101
- }),
102
- /*#__PURE__*/ jsx("input", {
103
- type: "search",
104
- className: "ov-scope-switcher__search",
105
- value: keyword,
106
- "aria-label": labels.searchPlaceholder,
107
- placeholder: labels.searchPlaceholder,
108
- onChange: (event)=>actions?.onSearchKeywordChange?.(event.currentTarget.value)
109
- })
110
- ]
92
+ value: keyword,
93
+ "aria-label": labels.searchPlaceholder,
94
+ placeholder: labels.searchPlaceholder,
95
+ onChange: (event)=>actions?.onSearchKeywordChange?.(event.currentTarget.value)
111
96
  }) : null;
112
97
  let list;
113
98
  list = state?.loading ? /*#__PURE__*/ jsx("div", {
@@ -29,7 +29,35 @@ export declare const PdfIcon: IconComponent;
29
29
  export declare const PptIcon: IconComponent;
30
30
  export declare const VideoIcon: IconComponent;
31
31
  export declare const WordIcon: IconComponent;
32
+ export declare const ExperienceBoardIcon: IconComponent;
33
+ export declare const WikiBoardIcon: IconComponent;
34
+ export declare const WikiConflictBoardIcon: IconComponent;
35
+ export declare const SpaceIcon: IconComponent;
36
+ export declare const UserIcon: IconComponent;
37
+ /**
38
+ * 库的默认图标:14 × 14 的圆形渐变块。装饰性图形,不进入可访问性树。
39
+ *
40
+ * `name` 决定取哪一种渐变,同一个名字始终一致;不传时取第一种。
41
+ *
42
+ * The default library icon: a 14 × 14 round gradient swatch. It is decorative and
43
+ * stays out of the accessibility tree.
44
+ *
45
+ * `name` selects the gradient and always resolves the same way for one name; the
46
+ * first gradient applies when it is omitted.
47
+ */
48
+ export declare function LibraryIcon({ name }: {
49
+ name?: string;
50
+ }): import("react").JSX.Element;
32
51
  export { getFileTypeColor, getFileTypeIcon, resolveFileTypeIconKey, } from './file-type-icon.js';
33
52
  export type { FileTypeIconComponent } from './file-type-icon.js';
34
53
  export { VikingBotIcon } from './viking-bot-icons.js';
35
54
  export type { VikingBotIconName } from './viking-bot-icons.js';
55
+ export declare const WikiWarningIcon: IconComponent;
56
+ export declare const WikiBookIcon: IconComponent;
57
+ export declare const FileInputIcon: IconComponent;
58
+ export declare const ScanSearchIcon: IconComponent;
59
+ export declare const ActivityIcon: IconComponent;
60
+ export declare const WikiEditIcon: IconComponent;
61
+ export declare const WikiSuccessIcon: IconComponent;
62
+ export declare const WikiHistoryIcon: IconComponent;
63
+ export declare const WikiDiscussIcon: IconComponent;
package/dist/icons.js CHANGED
@@ -1,2 +1,2 @@
1
- export { ArrowRightIcon, AudioIcon, ChevronRightIcon, DocumentIcon, FolderIcon, FolderOpenIcon, PdfIcon, PptIcon, VideoIcon, WordIcon, getFileTypeColor, getFileTypeIcon, resolveFileTypeIconKey } from "./k~0.js";
1
+ export { ActivityIcon, ArrowRightIcon, AudioIcon, ChevronRightIcon, DocumentIcon, ExperienceBoardIcon, FileInputIcon, FolderIcon, FolderOpenIcon, LibraryIcon, PdfIcon, PptIcon, ScanSearchIcon, SpaceIcon, UserIcon, VideoIcon, WikiBoardIcon, WikiBookIcon, WikiConflictBoardIcon, WikiDiscussIcon, WikiEditIcon, WikiHistoryIcon, WikiSuccessIcon, WikiWarningIcon, WordIcon, getFileTypeColor, getFileTypeIcon, resolveFileTypeIconKey } from "./k~0.js";
2
2
  export { VikingBotIcon } from "./lg~0.js";
package/dist/index.d.ts CHANGED
@@ -18,3 +18,7 @@ export { ScopeCascade } from './modules/scope-cascade/index.js';
18
18
  export type { ScopeCascadeProps } from './modules/scope-cascade/index.js';
19
19
  export { DirectoryTour } from './components/directory-tour/index.js';
20
20
  export type { DirectoryTourProps } from './components/directory-tour/index.js';
21
+ export { WikiDashboard } from './components/wiki-dashboard/index.js';
22
+ export type { WikiDashboardProps } from './components/wiki-dashboard/index.js';
23
+ export { ExperienceDashboard } from './components/experience-dashboard/index.js';
24
+ export type { ExperienceDashboardProps } from './components/experience-dashboard/index.js';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { AgentConnect } from "./u~0.js";
2
2
  export { Console } from "./a~0.js";
3
- export { DirectoryTour } from "./e~0.js";
3
+ export { DirectoryTour } from "./ep~0.js";
4
+ export { ExperienceDashboard } from "./fl~0.js";
4
5
  export { FileBrowser } from "./l~0.js";
5
6
  export { FileBrowserEntries } from "./2~0.js";
6
7
  export { FileTree } from "./n~0.js";
@@ -8,3 +9,4 @@ export { ScopeCascade } from "./lk~0.js";
8
9
  export { ScopeSelector, ScopeSwitcher } from "./f~0.js";
9
10
  export { Tui } from "./3c~0.js";
10
11
  export { VikingBot } from "./c~0.js";
12
+ export { WikiDashboard } from "./fj~0.js";
package/dist/k~0.js CHANGED
@@ -1,6 +1,109 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import "./lg~0.js";
4
+ const SvgDiscuss = (props)=>/*#__PURE__*/ jsx("svg", {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: 14,
7
+ height: 14,
8
+ fill: "none",
9
+ viewBox: "0 0 12.928 12.867",
10
+ ...props,
11
+ children: /*#__PURE__*/ jsx("path", {
12
+ stroke: "currentColor",
13
+ strokeLinecap: "round",
14
+ strokeLinejoin: "round",
15
+ strokeWidth: 1.2,
16
+ d: "M2.988 5.983a5 5 0 0 1-.055-.716C2.933 2.689 5.036.6 7.631.6c2.594 0 4.697 2.09 4.697 4.667a4.6 4.6 0 0 1-.303 1.653c-.041.107-.061.16-.07.202a.5.5 0 0 0-.014.113c-.001.042.004.09.016.183l.235 1.908c.025.206.038.31.004.385a.3.3 0 0 1-.15.146c-.076.033-.18.018-.385-.012l-1.858-.273a1.4 1.4 0 0 0-.19-.02.5.5 0 0 0-.116.012c-.044.009-.099.03-.21.07a4.7 4.7 0 0 1-2.374.245m-3.028 2.388c1.73 0 3.132-1.437 3.132-3.209S5.615 5.85 3.885 5.85.754 7.286.754 9.058c0 .357.056.7.16 1.02.045.135.067.202.074.248a.5.5 0 0 1 .006.125c-.002.046-.014.1-.037.205L.6 12.266l1.747-.238c.095-.013.143-.02.185-.02.043.001.067.004.11.012.04.008.101.03.223.072.32.113.663.175 1.02.175"
17
+ })
18
+ });
19
+ const discussreact = SvgDiscuss;
20
+ const SvgHistory = (props)=>/*#__PURE__*/ jsx("svg", {
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ width: 12,
23
+ height: 12,
24
+ fill: "none",
25
+ viewBox: "0 0 12 12",
26
+ ...props,
27
+ children: /*#__PURE__*/ jsx("path", {
28
+ stroke: "currentColor",
29
+ strokeLinecap: "round",
30
+ strokeLinejoin: "round",
31
+ strokeWidth: 1.2,
32
+ d: "M1.5 6A4.5 4.5 0 1 0 6 1.5a4.88 4.88 0 0 0-3.37 1.37L1.5 4M4 4H1.5V1.5m4.5 2V6l2 1"
33
+ })
34
+ });
35
+ const historyreact = SvgHistory;
36
+ const SvgSuccess = (props)=>/*#__PURE__*/ jsx("svg", {
37
+ xmlns: "http://www.w3.org/2000/svg",
38
+ width: 14,
39
+ height: 14,
40
+ fill: "none",
41
+ viewBox: "0 0 14 14",
42
+ ...props,
43
+ children: /*#__PURE__*/ jsx("path", {
44
+ fill: "currentColor",
45
+ d: "M11.813 7a4.813 4.813 0 1 0-9.626 0 4.813 4.813 0 0 0 9.626 0m-2.76-1.884a.438.438 0 0 1 .619.618l-3.15 3.15a.44.44 0 0 1-.619 0L4.328 7.31a.437.437 0 1 1 .619-.618l1.265 1.265zM12.687 7A5.688 5.688 0 1 1 1.313 7a5.688 5.688 0 0 1 11.376 0"
46
+ })
47
+ });
48
+ const successreact = SvgSuccess;
49
+ const SvgEdit = (props)=>/*#__PURE__*/ jsx("svg", {
50
+ xmlns: "http://www.w3.org/2000/svg",
51
+ width: 14,
52
+ height: 14,
53
+ fill: "none",
54
+ viewBox: "0 0 14 14",
55
+ ...props,
56
+ children: /*#__PURE__*/ jsx("path", {
57
+ fill: "currentColor",
58
+ d: "M9.366 2.266a1.604 1.604 0 0 1 2.268 0l.1.1a1.605 1.605 0 0 1 0 2.268l-6.758 6.759a.44.44 0 0 1-.203.115l-2.334.583a.438.438 0 0 1-.53-.53l.583-2.334.018-.056a.4.4 0 0 1 .097-.147zm2.884 8.963a.437.437 0 1 1 0 .875H7.583a.438.438 0 0 1 0-.875zM3.311 9.557l-.377 1.508 1.509-.377L9.88 5.25 8.75 4.119zm7.704-6.673a.73.73 0 0 0-1.03 0l-.616.616L10.5 4.631l.616-.615a.73.73 0 0 0 0-1.032z"
59
+ })
60
+ });
61
+ const editreact = SvgEdit;
62
+ const SvgActivity = (props)=>/*#__PURE__*/ jsx("svg", {
63
+ xmlns: "http://www.w3.org/2000/svg",
64
+ width: 14,
65
+ height: 14,
66
+ fill: "none",
67
+ viewBox: "0 0 14 14",
68
+ ...props,
69
+ children: /*#__PURE__*/ jsx("path", {
70
+ stroke: "currentColor",
71
+ strokeLinecap: "round",
72
+ strokeLinejoin: "round",
73
+ d: "M12.833 7H10.5l-1.75 5.25-3.5-10.5L3.5 7H1.167"
74
+ })
75
+ });
76
+ const activityreact = SvgActivity;
77
+ const SvgScanSearch = (props)=>/*#__PURE__*/ jsx("svg", {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ width: 14,
80
+ height: 14,
81
+ fill: "none",
82
+ viewBox: "0 0 14 14",
83
+ ...props,
84
+ children: /*#__PURE__*/ jsx("path", {
85
+ stroke: "currentColor",
86
+ strokeLinecap: "round",
87
+ strokeLinejoin: "round",
88
+ d: "M1.75 4.083V2.917A1.167 1.167 0 0 1 2.917 1.75h1.166m5.834 0h1.166a1.167 1.167 0 0 1 1.167 1.167v1.166m0 5.834v1.166a1.167 1.167 0 0 1-1.167 1.167H9.917m-5.834 0H2.917a1.167 1.167 0 0 1-1.167-1.167V9.917m7.583-.584L8.225 8.225M8.75 7a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0"
89
+ })
90
+ });
91
+ const scan_searchreact = SvgScanSearch;
92
+ const SvgFileInput = (props)=>/*#__PURE__*/ jsx("svg", {
93
+ xmlns: "http://www.w3.org/2000/svg",
94
+ width: 14,
95
+ height: 14,
96
+ fill: "none",
97
+ viewBox: "0 0 14 14",
98
+ ...props,
99
+ children: /*#__PURE__*/ jsx("path", {
100
+ stroke: "currentColor",
101
+ strokeLinecap: "round",
102
+ strokeLinejoin: "round",
103
+ d: "M2.333 12.833H10.5a1.167 1.167 0 0 0 1.167-1.166V4.083L8.75 1.167H3.5a1.167 1.167 0 0 0-1.167 1.166v2.334m5.834-3.5V3.5a1.167 1.167 0 0 0 1.166 1.167h2.334M1.167 8.75H7M5.25 7 7 8.75 5.25 10.5"
104
+ })
105
+ });
106
+ const file_inputreact = SvgFileInput;
4
107
  const SvgArrowRight = (props)=>/*#__PURE__*/ jsx("svg", {
5
108
  xmlns: "http://www.w3.org/2000/svg",
6
109
  width: 14,
@@ -181,6 +284,39 @@ const SvgPdf = (props)=>/*#__PURE__*/ jsxs("svg", {
181
284
  ]
182
285
  });
183
286
  const pdfreact = SvgPdf;
287
+ const SvgSpace = (props)=>/*#__PURE__*/ jsx("svg", {
288
+ xmlns: "http://www.w3.org/2000/svg",
289
+ width: 14,
290
+ height: 14,
291
+ fill: "none",
292
+ viewBox: "0 0 14 14",
293
+ ...props,
294
+ children: /*#__PURE__*/ jsx("path", {
295
+ stroke: "currentColor",
296
+ strokeLinecap: "round",
297
+ strokeLinejoin: "round",
298
+ strokeWidth: 1.2,
299
+ d: "M1.925 4.083 7 7l5.075-2.917M7 7v5.833m5.25-8.166c0-.205-.054-.406-.157-.583a1.17 1.17 0 0 0-.426-.427L7.583 1.324a1.17 1.17 0 0 0-1.167 0L2.333 3.657a1.17 1.17 0 0 0-.583 1.01v4.666a1.16 1.16 0 0 0 .583 1.009l4.084 2.334a1.17 1.17 0 0 0 1.167 0l4.083-2.334a1.17 1.17 0 0 0 .583-1.009z"
300
+ })
301
+ });
302
+ const spacereact = SvgSpace;
303
+ const SvgUser = (props)=>/*#__PURE__*/ jsx("svg", {
304
+ xmlns: "http://www.w3.org/2000/svg",
305
+ width: 14,
306
+ height: 14,
307
+ fill: "none",
308
+ viewBox: "0 0 14 14",
309
+ ...props,
310
+ children: /*#__PURE__*/ jsx("path", {
311
+ stroke: "currentColor",
312
+ strokeLinecap: "round",
313
+ strokeLinejoin: "round",
314
+ strokeWidth: 1.2,
315
+ d: "M1.75 11.667A7.58 7.58 0 0 1 7 9.333c2.038 0 3.888.888 5.25 2.334M9.625 4.375a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0"
316
+ })
317
+ });
318
+ const userreact = SvgUser;
319
+ var library_swatches_namespaceObject = /*#__PURE__*/ JSON.parse('{"z":["linear-gradient(145deg, #ffd8ec 8%, #ffabc8 46%, #d8cbff 100%)","linear-gradient(145deg, #d9e8ff 8%, #b8a6ff 52%, #f3d6ff 100%)","linear-gradient(145deg, #ffe6bc 8%, #ffaf96 48%, #ff8bc5 100%)","linear-gradient(145deg, #eaf7ba 8%, #b5efb8 52%, #73d9c6 100%)","linear-gradient(145deg, #fff1ba 8%, #ffc776 52%, #bd9cff 100%)"]}');
184
320
  const SvgPpt = (props)=>/*#__PURE__*/ jsxs("svg", {
185
321
  xmlns: "http://www.w3.org/2000/svg",
186
322
  width: 16,
@@ -236,6 +372,44 @@ const SvgVideo = (props)=>/*#__PURE__*/ jsx("svg", {
236
372
  })
237
373
  });
238
374
  const videoreact = SvgVideo;
375
+ const SvgWarning = (props)=>/*#__PURE__*/ jsx("svg", {
376
+ xmlns: "http://www.w3.org/2000/svg",
377
+ width: 14,
378
+ height: 14,
379
+ fill: "none",
380
+ overflow: "visible",
381
+ preserveAspectRatio: "none",
382
+ style: {
383
+ display: "block"
384
+ },
385
+ viewBox: "0 0 14 14",
386
+ ...props,
387
+ children: /*#__PURE__*/ jsx("path", {
388
+ fill: "currentColor",
389
+ d: "M6.344 2.034a1.62 1.62 0 0 1 1.311 0c.285.125.495.358.686.626.192.269.404.635.668 1.087l2.852 4.9c.264.451.477.816.616 1.116.139.297.237.596.204.905a1.6 1.6 0 0 1-.658 1.13c-.252.182-.56.247-.888.277-.33.03-.755.03-1.281.03H4.146c-.526 0-.951 0-1.282-.03-.328-.03-.635-.095-.887-.276a1.6 1.6 0 0 1-.658-1.13c-.033-.31.065-.609.204-.906.139-.3.352-.665.616-1.117l2.853-4.9c.263-.452.475-.817.667-1.086.19-.268.4-.5.685-.626m.958.8a.75.75 0 0 0-.604 0c-.065.03-.162.103-.326.333-.163.229-.352.552-.624 1.019l-2.854 4.9c-.271.468-.46.792-.578 1.046-.119.256-.134.376-.127.444.022.204.13.39.3.513.057.041.171.088.455.114.281.026.659.026 1.202.026h5.708c.543 0 .92 0 1.202-.026.284-.026.398-.073.456-.114a.73.73 0 0 0 .299-.513c.007-.068-.008-.188-.127-.444-.118-.254-.307-.578-.578-1.045l-2.853-4.9c-.272-.467-.462-.791-.625-1.02-.164-.23-.261-.304-.326-.332m-.74 4.75V5.25a.438.438 0 0 1 .875 0v2.333a.437.437 0 1 1-.875 0m.905 1.807a.437.437 0 0 1-.436.438h-.06a.44.44 0 0 1-.438-.437v-.059c0-.241.196-.437.438-.437h.059c.241 0 .437.196.437.437z"
390
+ })
391
+ });
392
+ const warningreact = SvgWarning;
393
+ const SvgWikiBook = (props)=>/*#__PURE__*/ jsx("svg", {
394
+ xmlns: "http://www.w3.org/2000/svg",
395
+ width: 16,
396
+ height: 16,
397
+ fill: "none",
398
+ overflow: "visible",
399
+ preserveAspectRatio: "none",
400
+ style: {
401
+ display: "block"
402
+ },
403
+ viewBox: "0 0 16 16",
404
+ ...props,
405
+ children: /*#__PURE__*/ jsx("path", {
406
+ stroke: "currentColor",
407
+ strokeLinecap: "round",
408
+ strokeLinejoin: "round",
409
+ d: "M8.056 7.556c0-1.245 0-1.867.242-2.343.213-.418.553-.758.97-.97C9.745 4 10.368 4 11.612 4h.222c.623 0 .934 0 1.171.121.21.107.38.277.486.486.121.237.121.548.121 1.17v4.779c0 .622 0 .933-.121 1.17a1.1 1.1 0 0 1-.486.486c-.237.121-.548.121-1.17.121h-.764c-.696 0-1.044 0-1.36.096-.28.085-.54.224-.765.41-.255.21-.448.499-.834 1.078L8.056 14 8 13.917c-.386-.58-.579-.869-.834-1.078a2.2 2.2 0 0 0-.765-.41c-.316-.096-.664-.096-1.36-.096h-.763c-.622 0-.934 0-1.171-.12a1.1 1.1 0 0 1-.486-.486c-.121-.238-.121-.55-.121-1.171V5.778c0-.622 0-.934.121-1.171.107-.21.277-.38.486-.486C3.344 4 3.655 4 4.277 4H4.5c1.245 0 1.867 0 2.342.242.418.213.758.553.971.971.243.476.243 1.098.243 2.343m0 6.444V7.556"
410
+ })
411
+ });
412
+ const wiki_bookreact = SvgWikiBook;
239
413
  const SvgWord = (props)=>/*#__PURE__*/ jsxs("svg", {
240
414
  xmlns: "http://www.w3.org/2000/svg",
241
415
  width: 16,
@@ -312,6 +486,75 @@ const SvgWord = (props)=>/*#__PURE__*/ jsxs("svg", {
312
486
  ]
313
487
  });
314
488
  const wordreact = SvgWord;
489
+ const SvgExperienceBoard = (props)=>/*#__PURE__*/ jsx("svg", {
490
+ xmlns: "http://www.w3.org/2000/svg",
491
+ width: 14,
492
+ height: 14,
493
+ fill: "none",
494
+ "aria-hidden": "true",
495
+ viewBox: "0 0 14 14",
496
+ ...props,
497
+ children: /*#__PURE__*/ jsx("g", {
498
+ stroke: "currentColor",
499
+ strokeLinecap: "round",
500
+ strokeLinejoin: "round",
501
+ strokeWidth: 1.2,
502
+ children: /*#__PURE__*/ jsx("path", {
503
+ d: "M5.25 1.75H2.333a.583.583 0 0 0-.583.583v4.084c0 .322.261.583.583.583H5.25a.583.583 0 0 0 .583-.583V2.333a.583.583 0 0 0-.583-.583M11.667 1.75H8.75a.583.583 0 0 0-.583.583v1.75c0 .322.26.584.583.584h2.917a.583.583 0 0 0 .583-.584v-1.75a.583.583 0 0 0-.583-.583M11.667 7H8.75a.583.583 0 0 0-.583.583v4.084c0 .322.26.583.583.583h2.917a.583.583 0 0 0 .583-.583V7.583A.583.583 0 0 0 11.667 7M5.25 9.333H2.333a.583.583 0 0 0-.583.584v1.75c0 .322.261.583.583.583H5.25a.583.583 0 0 0 .583-.583v-1.75a.583.583 0 0 0-.583-.584"
504
+ })
505
+ })
506
+ });
507
+ const experience_boardreact = SvgExperienceBoard;
508
+ const SvgWikiBoard = (props)=>/*#__PURE__*/ jsx("svg", {
509
+ xmlns: "http://www.w3.org/2000/svg",
510
+ width: 14,
511
+ height: 14,
512
+ fill: "none",
513
+ "aria-hidden": "true",
514
+ viewBox: "0 0 14 14",
515
+ ...props,
516
+ children: /*#__PURE__*/ jsx("g", {
517
+ stroke: "currentColor",
518
+ strokeLinecap: "round",
519
+ strokeLinejoin: "round",
520
+ strokeWidth: 1.2,
521
+ children: /*#__PURE__*/ jsx("path", {
522
+ d: "M5.25 1.75H2.333a.583.583 0 0 0-.583.583v4.084c0 .322.261.583.583.583H5.25a.583.583 0 0 0 .583-.583V2.333a.583.583 0 0 0-.583-.583M11.667 1.75H8.75a.583.583 0 0 0-.583.583v1.75c0 .322.26.584.583.584h2.917a.583.583 0 0 0 .583-.584v-1.75a.583.583 0 0 0-.583-.583M11.667 7H8.75a.583.583 0 0 0-.583.583v4.084c0 .322.26.583.583.583h2.917a.583.583 0 0 0 .583-.583V7.583A.583.583 0 0 0 11.667 7M5.25 9.333H2.333a.583.583 0 0 0-.583.584v1.75c0 .322.261.583.583.583H5.25a.583.583 0 0 0 .583-.583v-1.75a.583.583 0 0 0-.583-.584"
523
+ })
524
+ })
525
+ });
526
+ const wiki_boardreact = SvgWikiBoard;
527
+ const SvgWikiConflictBoard = (props)=>/*#__PURE__*/ jsxs("svg", {
528
+ xmlns: "http://www.w3.org/2000/svg",
529
+ width: 12,
530
+ height: 12,
531
+ fill: "none",
532
+ "aria-hidden": "true",
533
+ viewBox: "0 0 12 12",
534
+ ...props,
535
+ children: [
536
+ /*#__PURE__*/ jsx("path", {
537
+ stroke: "currentColor",
538
+ strokeLinecap: "round",
539
+ strokeLinejoin: "round",
540
+ strokeWidth: 0.8,
541
+ d: "M2 1.5h2.5A.5.5 0 0 1 5 2v3.5a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V2a.5.5 0 0 1 .5-.5m5.5 0H10a.5.5 0 0 1 .5.5v1.5a.5.5 0 0 1-.5.5H7.5a.5.5 0 0 1-.5-.5V2a.5.5 0 0 1 .5-.5m0 4.5H10a.5.5 0 0 1 .5.5V10a.5.5 0 0 1-.5.5H7.5A.5.5 0 0 1 7 10V6.5a.5.5 0 0 1 .5-.5M2 8h2.5a.5.5 0 0 1 .5.5V10a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 2 8"
542
+ }),
543
+ /*#__PURE__*/ jsx("path", {
544
+ fill: "var(--ov-ui-color-dashboard-surface, var(--ov-ui-color-bg-3, var(--ov-ui-bg-3-default, #f7f7f9)))",
545
+ d: "M4.5 8a4 4 0 0 1 8 0 4 4 0 0 1-4 4H4.658a.16.16 0 0 1-.158-.158z"
546
+ }),
547
+ /*#__PURE__*/ jsx("path", {
548
+ fill: "currentColor",
549
+ d: "M8.125 5.162a.93.93 0 0 1 .75 0c.162.072.282.205.39.358.11.154.232.363.383.621l1.63 2.8c.15.258.273.466.352.637.08.17.135.341.116.518a.92.92 0 0 1-.376.647c-.143.103-.32.14-.507.157-.19.017-.432.016-.732.016H6.87c-.3 0-.543.001-.732-.016-.187-.017-.364-.054-.508-.157a.92.92 0 0 1-.376-.647c-.019-.177.038-.348.117-.518s.202-.38.352-.637l1.63-2.801c.15-.258.272-.466.382-.62s.229-.286.391-.358"
550
+ }),
551
+ /*#__PURE__*/ jsx("path", {
552
+ fill: "#fff",
553
+ d: "M8.25 8.333V7a.25.25 0 0 1 .5 0v1.333a.25.25 0 0 1-.5 0m.517 1.034a.25.25 0 0 1-.25.25h-.033a.25.25 0 0 1-.25-.25v-.034a.25.25 0 0 1 .25-.25h.033a.25.25 0 0 1 .25.25z"
554
+ })
555
+ ]
556
+ });
557
+ const wiki_conflict_boardreact = SvgWikiConflictBoard;
315
558
  function NextjsIcon({ 'aria-label': ariaLabel, ...props }) {
316
559
  const gradientId = `ov-ft-nextjs-${useId().replaceAll(':', '')}`;
317
560
  return /*#__PURE__*/ jsxs("svg", {
@@ -1438,4 +1681,37 @@ const PdfIcon = createIcon(pdfreact, 'PdfIcon');
1438
1681
  const PptIcon = createIcon(pptreact, 'PptIcon');
1439
1682
  const VideoIcon = createIcon(videoreact, 'VideoIcon');
1440
1683
  const WordIcon = createIcon(wordreact, 'WordIcon');
1441
- export { ArrowRightIcon, AudioIcon, ChevronRightIcon, DocumentIcon, FolderIcon, FolderOpenIcon, PdfIcon, PptIcon, VideoIcon, WordIcon, getFileTypeColor, getFileTypeIcon, resolveFileTypeIconKey };
1684
+ const ExperienceBoardIcon = createIcon(experience_boardreact, 'ExperienceBoardIcon');
1685
+ const WikiBoardIcon = createIcon(wiki_boardreact, 'WikiBoardIcon');
1686
+ const WikiConflictBoardIcon = createIcon(wiki_conflict_boardreact, 'WikiConflictBoardIcon');
1687
+ const SpaceIcon = createIcon(spacereact, 'SpaceIcon');
1688
+ const UserIcon = createIcon(userreact, 'UserIcon');
1689
+ const LIBRARY_FALLBACKS = library_swatches_namespaceObject.z;
1690
+ function gradientOf(name) {
1691
+ const hash = Array.from(name).reduce((total, character)=>total + character.charCodeAt(0), 0);
1692
+ return hash % LIBRARY_FALLBACKS.length;
1693
+ }
1694
+ function LibraryIcon({ name = '' }) {
1695
+ const index = gradientOf(name);
1696
+ const swatch = index + 1;
1697
+ return /*#__PURE__*/ jsx("span", {
1698
+ "aria-hidden": "true",
1699
+ style: {
1700
+ display: 'block',
1701
+ width: 14,
1702
+ height: 14,
1703
+ borderRadius: '50%',
1704
+ background: `var(--ov-ui-color-library-swatch-${swatch}, var(--ov-ui-library-swatch-${swatch}-default, ${LIBRARY_FALLBACKS[index]}))`
1705
+ }
1706
+ });
1707
+ }
1708
+ const WikiWarningIcon = createIcon(warningreact, 'WikiWarningIcon');
1709
+ const WikiBookIcon = createIcon(wiki_bookreact, 'WikiBookIcon');
1710
+ const FileInputIcon = createIcon(file_inputreact, 'FileInputIcon');
1711
+ const ScanSearchIcon = createIcon(scan_searchreact, 'ScanSearchIcon');
1712
+ const ActivityIcon = createIcon(activityreact, 'ActivityIcon');
1713
+ const WikiEditIcon = createIcon(editreact, 'WikiEditIcon');
1714
+ const WikiSuccessIcon = createIcon(successreact, 'WikiSuccessIcon');
1715
+ const WikiHistoryIcon = createIcon(historyreact, 'WikiHistoryIcon');
1716
+ const WikiDiscussIcon = createIcon(discussreact, 'WikiDiscussIcon');
1717
+ export { ActivityIcon, ArrowRightIcon, AudioIcon, ChevronRightIcon, DocumentIcon, ExperienceBoardIcon, FileInputIcon, FolderIcon, FolderOpenIcon, LibraryIcon, PdfIcon, PptIcon, ScanSearchIcon, SpaceIcon, UserIcon, VideoIcon, WikiBoardIcon, WikiBookIcon, WikiConflictBoardIcon, WikiDiscussIcon, WikiEditIcon, WikiHistoryIcon, WikiSuccessIcon, WikiWarningIcon, WordIcon, getFileTypeColor, getFileTypeIcon, resolveFileTypeIconKey };
package/dist/lk~0.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState, useSyncExternalStore } from "react";
2
+ import { useEffect, useRef, useState, useSyncExternalStore } from "react";
3
3
  import { resolveLocale } from "./nx~0.js";
4
+ import { LibraryIcon, SpaceIcon, UserIcon } from "./k~0.js";
4
5
  import { ScopeSelector, ScopeSwitcher } from "./f~0.js";
6
+ import { button_Button } from "./e~0.js";
5
7
  import { useLocale } from "./28~0.js";
6
8
  const messages = {
7
9
  levelNames: [
@@ -42,7 +44,7 @@ const empty = (enabled, parentIds = [])=>({
42
44
  scopeKey: JSON.stringify(parentIds),
43
45
  parentIds
44
46
  });
45
- function createScopeController() {
47
+ function createScopeController(onChange) {
46
48
  const snapshots = [
47
49
  empty(true),
48
50
  empty(false),
@@ -52,7 +54,21 @@ function createScopeController() {
52
54
  const requests = [];
53
55
  let api;
54
56
  let active = false;
55
- const notify = (index)=>listeners[index].forEach((listener)=>listener());
57
+ let selectionKey = '';
58
+ const notify = (index)=>{
59
+ listeners[index].forEach((listener)=>listener());
60
+ const [library, space, user] = snapshots;
61
+ const selection = library.selected && space.selected && user.selected ? {
62
+ libraryId: library.selected.id,
63
+ spaceId: space.selected.id,
64
+ userId: user.selected.id
65
+ } : null;
66
+ const key = JSON.stringify(selection);
67
+ if (key !== selectionKey) {
68
+ selectionKey = key;
69
+ onChange?.(selection);
70
+ }
71
+ };
56
72
  const update = (index, patch)=>{
57
73
  snapshots[index] = {
58
74
  ...snapshots[index],
@@ -158,8 +174,10 @@ function createScopeController() {
158
174
  }
159
175
  };
160
176
  }
161
- function useScopeCascade({ loadLibraries, loadSpaces, loadUsers }) {
162
- const [instance] = useState(createScopeController);
177
+ function useScopeCascade({ loadLibraries, loadSpaces, loadUsers }, onChange) {
178
+ const notify = useRef(onChange);
179
+ notify.current = onChange;
180
+ const [instance] = useState(()=>createScopeController((selection)=>notify.current?.(selection)));
163
181
  useEffect(()=>instance.start({
164
182
  loadLibraries,
165
183
  loadSpaces,
@@ -175,6 +193,19 @@ function useScopeCascade({ loadLibraries, loadSpaces, loadUsers }) {
175
193
  function useScopeCascadeLevel(level) {
176
194
  return useSyncExternalStore(level.subscribe, level.getSnapshot, level.getSnapshot);
177
195
  }
196
+ function defaultIcon(index, option) {
197
+ if (0 === index) return /*#__PURE__*/ jsx(LibraryIcon, {
198
+ name: option?.id ?? ''
199
+ });
200
+ return 1 === index ? /*#__PURE__*/ jsx(SpaceIcon, {}) : /*#__PURE__*/ jsx(UserIcon, {});
201
+ }
202
+ function withDefaultIcons(options, index) {
203
+ if (options.every((option)=>null != option.icon)) return options;
204
+ return options.map((option)=>null != option.icon ? option : {
205
+ ...option,
206
+ icon: defaultIcon(index, option)
207
+ });
208
+ }
178
209
  function ConnectedLevel(props) {
179
210
  const state = useScopeCascadeLevel(props.level);
180
211
  return /*#__PURE__*/ jsx(LevelView, {
@@ -182,9 +213,10 @@ function ConnectedLevel(props) {
182
213
  state: state
183
214
  }, state.scopeKey);
184
215
  }
185
- function LevelView({ level, locale, state, name, labels, retryLabel }) {
216
+ function LevelView({ index, level, locale, state, name, labels, retryLabel }) {
186
217
  const [keyword, setKeyword] = useState('');
187
218
  const text = resolveScopeCascadeLabels(locale);
219
+ const options = withDefaultIcons(state.options, index);
188
220
  return /*#__PURE__*/ jsx(ScopeSelector, {
189
221
  locale: locale,
190
222
  labels: labels,
@@ -195,13 +227,13 @@ function LevelView({ level, locale, state, name, labels, retryLabel }) {
195
227
  },
196
228
  trigger: {
197
229
  label: state.selected?.label ?? name,
198
- icon: state.selected?.icon
230
+ icon: state.selected?.icon ?? defaultIcon(index, state.selected)
199
231
  },
200
232
  data: {
201
233
  selectedId: state.selected?.id ?? '',
202
- total: state.options.length,
203
- options: state.options,
204
- visibleOptions: state.options.filter((option)=>option.label.toLocaleLowerCase().includes(keyword.toLocaleLowerCase()))
234
+ total: options.length,
235
+ options,
236
+ visibleOptions: options.filter((option)=>option.label.toLocaleLowerCase().includes(keyword.toLocaleLowerCase()))
205
237
  },
206
238
  state: {
207
239
  disabled: !state.enabled,
@@ -221,8 +253,10 @@ function LevelView({ level, locale, state, name, labels, retryLabel }) {
221
253
  children: [
222
254
  labels?.error ?? text.error,
223
255
  ' ',
224
- /*#__PURE__*/ jsx("button", {
225
- type: "button",
256
+ /*#__PURE__*/ jsx(button_Button, {
257
+ size: "small",
258
+ type: "default",
259
+ htmlType: "button",
226
260
  onClick: level.refresh,
227
261
  children: retryLabel ?? text.retry
228
262
  })
@@ -231,14 +265,20 @@ function LevelView({ level, locale, state, name, labels, retryLabel }) {
231
265
  }
232
266
  });
233
267
  }
234
- function ScopeCascade({ controller, locale: localeProp, labels, levelNames: names, retryLabel, ...props }) {
268
+ function ScopeCascade({ locale: localeProp, loadLibraries, loadSpaces, loadUsers, onChange, labels, levelNames: names, retryLabel, ...props }) {
235
269
  const locale = useLocale(localeProp);
236
270
  const levelNames = names ?? resolveScopeCascadeLabels(locale).levelNames;
271
+ const controller = useScopeCascade({
272
+ loadLibraries,
273
+ loadSpaces,
274
+ loadUsers
275
+ }, onChange);
237
276
  return /*#__PURE__*/ jsxs(ScopeSwitcher, {
238
277
  ...props,
239
278
  locale: locale,
240
279
  children: [
241
280
  /*#__PURE__*/ jsx(ConnectedLevel, {
281
+ index: 0,
242
282
  locale: locale,
243
283
  level: controller.levels[0],
244
284
  name: levelNames[0],
@@ -246,6 +286,7 @@ function ScopeCascade({ controller, locale: localeProp, labels, levelNames: name
246
286
  retryLabel: retryLabel
247
287
  }),
248
288
  /*#__PURE__*/ jsx(ConnectedLevel, {
289
+ index: 1,
249
290
  locale: locale,
250
291
  level: controller.levels[1],
251
292
  name: levelNames[1],
@@ -253,6 +294,7 @@ function ScopeCascade({ controller, locale: localeProp, labels, levelNames: name
253
294
  retryLabel: retryLabel
254
295
  }),
255
296
  /*#__PURE__*/ jsx(ConnectedLevel, {
297
+ index: 2,
256
298
  locale: locale,
257
299
  level: controller.levels[2],
258
300
  name: levelNames[2],
@@ -262,4 +304,4 @@ function ScopeCascade({ controller, locale: localeProp, labels, levelNames: name
262
304
  ]
263
305
  });
264
306
  }
265
- export { ScopeCascade, useScopeCascade, useScopeCascadeLevel };
307
+ export { ScopeCascade };