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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +13 -1
  2. package/dist/1~0.js +57 -0
  3. package/dist/2~0.js +6 -5
  4. package/dist/3c~0.js +10 -4
  5. package/dist/3~0.js +189 -13
  6. package/dist/5~0.js +181 -0
  7. package/dist/6~0.js +48 -0
  8. package/dist/ae~0.js +8 -1
  9. package/dist/ark-message-list-view~0.js +9 -4
  10. package/dist/a~0.js +12 -6
  11. package/dist/c7r~0.js +50 -0
  12. package/dist/ck~0.js +3 -0
  13. package/dist/client/paths.d.ts +6 -0
  14. package/dist/client/provider.d.ts +6 -1
  15. package/dist/components/agent-connect/style.css +224 -35
  16. package/dist/components/api-key-login-form/api-key-login-form.d.ts +2 -0
  17. package/dist/components/api-key-login-form/index.d.ts +3 -0
  18. package/dist/components/api-key-login-form/style.css +438 -0
  19. package/dist/components/api-key-login-form/style.js +0 -0
  20. package/dist/components/api-key-login-form/types.d.ts +7 -0
  21. package/dist/components/api-key-login-form.js +1 -0
  22. package/dist/components/directory-tour/directory-tour-intro.d.ts +3 -0
  23. package/dist/components/directory-tour/index.d.ts +2 -1
  24. package/dist/components/directory-tour/style.css +367 -39
  25. package/dist/components/directory-tour/tour-card.d.ts +14 -0
  26. package/dist/components/directory-tour/types.d.ts +24 -1
  27. package/dist/components/directory-tour/use-tour-anchor.d.ts +1 -0
  28. package/dist/components/directory-tour/use-tour-position.d.ts +4 -1
  29. package/dist/components/directory-tour/use-tour-theme.d.ts +2 -0
  30. package/dist/components/directory-tour.js +53 -2
  31. package/dist/components/email-login-form/email-login-form.d.ts +2 -0
  32. package/dist/components/email-login-form/index.d.ts +3 -0
  33. package/dist/components/email-login-form/style.css +438 -0
  34. package/dist/components/email-login-form/style.js +0 -0
  35. package/dist/components/email-login-form/types.d.ts +11 -0
  36. package/dist/components/email-login-form.js +1 -0
  37. package/dist/components/experience-dashboard/experience-impact.d.ts +3 -1
  38. package/dist/components/experience-dashboard/style.css +229 -12
  39. package/dist/components/experience-dashboard.js +1 -1
  40. package/dist/components/file-browser-entries/style.css +331 -80
  41. package/dist/components/file-preview/file-preview-header.d.ts +4 -21
  42. package/dist/components/file-preview/file-preview-toolbar.d.ts +7 -0
  43. package/dist/components/file-preview/locales/en-US.d.ts +9 -0
  44. package/dist/components/file-preview/locales/zh-CN.d.ts +9 -0
  45. package/dist/components/file-preview/style.css +335 -76
  46. package/dist/components/file-preview/types.d.ts +14 -21
  47. package/dist/components/file-tree/file-tree-toolbar.d.ts +3 -3
  48. package/dist/components/file-tree/locales/en-US.d.ts +3 -0
  49. package/dist/components/file-tree/locales/zh-CN.d.ts +3 -0
  50. package/dist/components/file-tree/style.css +313 -86
  51. package/dist/components/file-tree/types.d.ts +13 -4
  52. package/dist/components/invitation-confirmation/index.d.ts +3 -0
  53. package/dist/components/invitation-confirmation/invitation-confirmation.d.ts +2 -0
  54. package/dist/components/invitation-confirmation/style.css +438 -0
  55. package/dist/components/invitation-confirmation/style.js +0 -0
  56. package/dist/components/invitation-confirmation/types.d.ts +20 -0
  57. package/dist/components/invitation-confirmation.js +1 -0
  58. package/dist/components/login-method-selector/index.d.ts +2 -0
  59. package/dist/components/login-method-selector/login-method-selector.d.ts +2 -0
  60. package/dist/components/login-method-selector/style.css +438 -0
  61. package/dist/components/login-method-selector/style.js +0 -0
  62. package/dist/components/login-method-selector/types.d.ts +14 -0
  63. package/dist/components/login-method-selector.js +1 -0
  64. package/dist/components/password-reset-request-form/index.d.ts +3 -0
  65. package/dist/components/password-reset-request-form/password-reset-request-form.d.ts +2 -0
  66. package/dist/components/password-reset-request-form/style.css +438 -0
  67. package/dist/components/password-reset-request-form/style.js +0 -0
  68. package/dist/components/password-reset-request-form/types.d.ts +13 -0
  69. package/dist/components/password-reset-request-form.js +1 -0
  70. package/dist/components/password-setup-form/index.d.ts +3 -0
  71. package/dist/components/password-setup-form/password-setup-form.d.ts +2 -0
  72. package/dist/components/password-setup-form/style.css +438 -0
  73. package/dist/components/password-setup-form/style.js +0 -0
  74. package/dist/components/password-setup-form/types.d.ts +10 -0
  75. package/dist/components/password-setup-form.js +1 -0
  76. package/dist/components/scope-switcher/style.css +368 -37
  77. package/dist/components/style.css +13071 -7474
  78. package/dist/components/tui/style.css +271 -35
  79. package/dist/components/viking-bot/interaction/style.css +143 -22
  80. package/dist/components/viking-bot/style.css +951 -295
  81. package/dist/components/wiki-dashboard/index.d.ts +1 -1
  82. package/dist/components/wiki-dashboard/style.css +241 -14
  83. package/dist/components/wiki-dashboard/types.d.ts +12 -16
  84. package/dist/components/wiki-dashboard/wiki-action-button.d.ts +2 -9
  85. package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +3 -10
  86. package/dist/c~0.js +16 -8
  87. package/dist/d~0.js +28 -0
  88. package/dist/ep~0.js +493 -0
  89. package/dist/e~0.js +33 -328
  90. package/dist/fi~0.js +13 -28
  91. package/dist/fj~0.js +38 -69
  92. package/dist/fl~0.js +710 -0
  93. package/dist/f~0.js +61 -685
  94. package/dist/g~0.js +135 -0
  95. package/dist/icons/index.d.ts +2 -0
  96. package/dist/icons.js +1 -1
  97. package/dist/index.d.ts +12 -0
  98. package/dist/index.js +9 -3
  99. package/dist/k~0.js +44 -4
  100. package/dist/l5~0.js +3813 -0
  101. package/dist/lk~0.js +5 -2
  102. package/dist/l~0.js +49 -2369
  103. package/dist/modules/console/style.css +1485 -351
  104. package/dist/modules/file-browser/acl/acl-add-principal.d.ts +12 -0
  105. package/dist/modules/file-browser/acl/acl-candidate.d.ts +8 -0
  106. package/dist/modules/file-browser/acl/acl-client.d.ts +13 -0
  107. package/dist/modules/file-browser/acl/acl-confirmation.d.ts +6 -0
  108. package/dist/modules/file-browser/acl/acl-entry.d.ts +13 -0
  109. package/dist/modules/file-browser/acl/acl-labels.d.ts +47 -0
  110. package/dist/modules/file-browser/acl/acl-menu.d.ts +10 -0
  111. package/dist/modules/file-browser/acl/acl-modal.d.ts +17 -0
  112. package/dist/modules/file-browser/acl/acl-model.d.ts +17 -0
  113. package/dist/modules/file-browser/acl/acl-principal-tabs.d.ts +6 -0
  114. package/dist/modules/file-browser/acl/acl-tag.d.ts +7 -0
  115. package/dist/modules/file-browser/acl/locales/en-US.d.ts +44 -0
  116. package/dist/modules/file-browser/acl/locales/zh-CN.d.ts +44 -0
  117. package/dist/modules/file-browser/acl/use-acl-principals.d.ts +17 -0
  118. package/dist/modules/file-browser/acl/use-acl-report.d.ts +27 -0
  119. package/dist/modules/file-browser/acl-types.d.ts +86 -0
  120. package/dist/modules/file-browser/dashboard-model.d.ts +3 -0
  121. package/dist/modules/file-browser/file-browser-detail-icons.d.ts +0 -6
  122. package/dist/modules/file-browser/file-browser-detail.d.ts +5 -23
  123. package/dist/modules/file-browser/file-browser-labels.d.ts +1 -1
  124. package/dist/modules/file-browser/file-browser-search.d.ts +20 -0
  125. package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -10
  126. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +2 -6
  127. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  128. package/dist/modules/file-browser/fs-directories.d.ts +1 -0
  129. package/dist/modules/file-browser/fs-file-editing.d.ts +4 -0
  130. package/dist/modules/file-browser/fs-model.d.ts +3 -1
  131. package/dist/modules/file-browser/fs-preview-images.d.ts +3 -0
  132. package/dist/modules/file-browser/fs-read-file.d.ts +1 -1
  133. package/dist/modules/file-browser/index.d.ts +1 -0
  134. package/dist/modules/file-browser/locales/en-US.d.ts +5 -0
  135. package/dist/modules/file-browser/locales/zh-CN.d.ts +5 -0
  136. package/dist/modules/file-browser/style.css +2595 -703
  137. package/dist/modules/file-browser/types.d.ts +22 -20
  138. package/dist/modules/file-browser/use-file-browser-acl.d.ts +16 -0
  139. package/dist/modules/file-browser/use-file-browser.d.ts +5 -7
  140. package/dist/modules/file-browser/use-fs-tree.d.ts +1 -0
  141. package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +2 -4
  142. package/dist/modules/file-browser.js +1 -1
  143. package/dist/modules/scope-cascade/style.css +537 -37
  144. package/dist/modules/style.css +12429 -8855
  145. package/dist/n~0.js +61 -37
  146. package/dist/p0~0.js +27 -0
  147. package/dist/p~0.js +34 -25
  148. package/dist/rt~0.js +107 -4
  149. package/dist/r~0.js +1 -1
  150. package/dist/shared/auth/agreements.d.ts +10 -0
  151. package/dist/shared/auth/fields.d.ts +15 -0
  152. package/dist/shared/auth/form-frame.d.ts +12 -0
  153. package/dist/shared/auth/locales/en-US.d.ts +24 -0
  154. package/dist/shared/auth/locales/zh-CN.d.ts +24 -0
  155. package/dist/shared/auth/types.d.ts +61 -0
  156. package/dist/shared/auth/use-auth-labels.d.ts +3 -0
  157. package/dist/shared/auth/use-form.d.ts +8 -0
  158. package/dist/shared/components/button/button.d.ts +20 -0
  159. package/dist/shared/components/input/input.d.ts +17 -0
  160. package/dist/shared/components/modal/locales/en-US.d.ts +4 -0
  161. package/dist/shared/components/modal/locales/zh-CN.d.ts +4 -0
  162. package/dist/shared/components/modal/modal.d.ts +2 -0
  163. package/dist/shared/components/modal/types.d.ts +18 -0
  164. package/dist/shared/components/overlay/lock-body-scroll.d.ts +1 -0
  165. package/dist/style.css +15477 -6258
  166. package/dist/s~0.js +16 -0
  167. package/dist/u~0.js +15 -6
  168. package/dist/viking-bot-composer~0.js +29 -11
  169. package/dist/viking-bot-interaction~0.js +2 -1
  170. package/package.json +34 -3
  171. package/dist/modules/file-browser/fs-selection.d.ts +0 -4
  172. package/dist/o~0.js +0 -106
package/dist/e~0.js CHANGED
@@ -1,335 +1,40 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useEffect, useId, useRef, useState } from "react";
3
- import { createPortal } from "react-dom";
4
- import { useLocale } from "./28~0.js";
5
- import { resolveLocale } from "./nx~0.js";
6
- function useTourAnchor(target, locateTarget, timeout, attempt) {
7
- const [state, setState] = useState({
8
- anchor: null,
9
- failed: false
10
- });
11
- useEffect(()=>{
12
- const controller = new AbortController();
13
- setState({
14
- anchor: null,
15
- failed: false
16
- });
17
- const timer = window.setTimeout(()=>{
18
- controller.abort();
19
- setState({
20
- anchor: null,
21
- failed: true
22
- });
23
- }, timeout);
24
- Promise.resolve().then(()=>locateTarget?.(target, controller.signal) ?? null).then((anchor)=>{
25
- if (controller.signal.aborted) return;
26
- window.clearTimeout(timer);
27
- if (anchor?.isConnected) {
28
- anchor.scrollIntoView({
29
- block: 'nearest',
30
- inline: 'nearest'
31
- });
32
- setState({
33
- anchor,
34
- failed: false
35
- });
36
- } else setState({
37
- anchor: null,
38
- failed: true
39
- });
40
- }, ()=>{
41
- if (controller.signal.aborted) return;
42
- window.clearTimeout(timer);
43
- setState({
44
- anchor: null,
45
- failed: true
46
- });
47
- });
48
- return ()=>{
49
- controller.abort();
50
- window.clearTimeout(timer);
51
- };
52
- }, [
53
- target,
54
- locateTarget,
55
- timeout,
56
- attempt
57
- ]);
58
- return state;
59
- }
60
- function useTourPosition(anchor, surface, placement) {
61
- const [position, setPosition] = useState();
62
- useEffect(()=>{
63
- if (!surface) return;
64
- surface.showPopover?.();
65
- const update = ()=>{
66
- const a = anchor?.getBoundingClientRect();
67
- const box = surface.getBoundingClientRect();
68
- const width = window.innerWidth;
69
- const height = window.innerHeight;
70
- const margin = 8;
71
- let left = (width - box.width) / 2;
72
- let top = (height - box.height) / 2;
73
- const missing = Boolean(anchor && !anchor.isConnected);
74
- let visible = !anchor || missing;
75
- if (anchor && a && !missing) {
76
- let clip = {
77
- left: 0,
78
- top: 0,
79
- right: width,
80
- bottom: height
81
- };
82
- for(let parent = anchor.parentElement; parent; parent = parent.parentElement){
83
- const css = window.getComputedStyle(parent);
84
- const rect = parent.getBoundingClientRect();
85
- if (/(auto|scroll|hidden|clip)/.test(css.overflowX)) clip = {
86
- ...clip,
87
- left: Math.max(clip.left, rect.left),
88
- right: Math.min(clip.right, rect.right)
89
- };
90
- if (/(auto|scroll|hidden|clip)/.test(css.overflowY)) clip = {
91
- ...clip,
92
- top: Math.max(clip.top, rect.top),
93
- bottom: Math.min(clip.bottom, rect.bottom)
94
- };
95
- }
96
- visible = anchor.isConnected && a.width > 0 && a.height > 0 && a.top < clip.bottom && a.bottom > clip.top && a.left < clip.right && a.right > clip.left;
97
- const right = a.right + 6;
98
- const leftSide = a.left - box.width - 6;
99
- left = 'right' === placement ? right + box.width <= width - margin || leftSide < margin ? right : leftSide : leftSide >= margin || right + box.width > width - margin ? leftSide : right;
100
- top = a.top - 16;
101
- const css = window.getComputedStyle(anchor);
102
- for(let i = 0; i < css.length; i++){
103
- const name = css[i];
104
- if (name?.startsWith('--ov-ui-')) surface.style.setProperty(name, css.getPropertyValue(name));
105
- }
106
- }
107
- const next = {
108
- left: Math.max(margin, Math.min(left, width - box.width - margin)),
109
- top: Math.max(margin, Math.min(top, height - box.height - margin)),
110
- targetTop: a?.top ?? 0,
111
- targetLeft: a?.left ?? 0,
112
- targetWidth: a?.width ?? 0,
113
- targetHeight: a?.height ?? 0,
114
- visible,
115
- missing
116
- };
117
- setPosition((old)=>old && Object.keys(next).every((key)=>old[key] === next[key]) ? old : next);
118
- };
119
- update();
120
- const resize = new ResizeObserver(update);
121
- resize.observe(surface);
122
- for(let node = anchor; node; node = node.parentElement)resize.observe(node);
123
- const mutation = new MutationObserver(update);
124
- mutation.observe(document.body, {
125
- childList: true,
126
- subtree: true
127
- });
128
- window.addEventListener('scroll', update, true);
129
- window.addEventListener('resize', update);
130
- window.visualViewport?.addEventListener('resize', update);
131
- window.visualViewport?.addEventListener('scroll', update);
132
- return ()=>{
133
- resize.disconnect();
134
- mutation.disconnect();
135
- window.removeEventListener('scroll', update, true);
136
- window.removeEventListener('resize', update);
137
- window.visualViewport?.removeEventListener('resize', update);
138
- window.visualViewport?.removeEventListener('scroll', update);
139
- if (surface.isConnected) surface.hidePopover?.();
140
- };
141
- }, [
142
- anchor,
143
- surface,
144
- placement
145
- ]);
146
- return position;
147
- }
148
- const messages = {
149
- close: 'Close guide',
150
- next: 'Next',
151
- done: 'Got it',
152
- locating: 'Locating directory…',
153
- unavailable: 'This directory is unavailable. Retry or skip this step.',
154
- retry: 'Retry',
155
- skip: 'Skip',
156
- progress: (current, total)=>`${current}/${total}`
157
- };
158
- const en_US = messages;
159
- const zh_CN_messages = {
160
- close: '关闭引导',
161
- next: '下一步',
162
- done: '知道了',
163
- locating: '正在定位目录…',
164
- unavailable: '此目录暂不可用,请重试或跳过这一步。',
165
- retry: '重试',
166
- skip: '跳过',
167
- progress: (current, total)=>`${current}/${total}`
168
- };
169
- const zh_CN = zh_CN_messages;
170
- function DirectoryTour(props) {
171
- if (!props.open || 0 === props.steps.length) return null;
172
- return /*#__PURE__*/ jsx(TourSession, {
173
- ...props
174
- });
175
- }
176
- function TourSession(props) {
177
- const [index, setIndex] = useState(props.defaultStep ?? 0);
178
- const skipped = useRef(new Set());
179
- const current = props.currentStep ?? index;
180
- const step = props.steps[current];
181
- if (!step) return null;
182
- const advance = (skip)=>{
183
- if (skip) skipped.current.add(step.id);
184
- if (current === props.steps.length - 1) props.onComplete?.({
185
- skippedStepIds: [
186
- ...skipped.current
187
- ]
188
- });
189
- else {
190
- if (void 0 === props.currentStep) setIndex(current + 1);
191
- props.onStepChange?.(current + 1);
192
- }
193
- };
194
- return /*#__PURE__*/ jsx(TourStep, {
195
- ...props,
196
- step: step,
197
- index: current,
198
- advance: advance
199
- }, step.id);
200
- }
201
- function TourStep({ step, index, advance, steps, locateTarget, locateTimeout = 10000, placement = 'right', onClose, labels, locale: localeProp, className, style }) {
202
- const locale = useLocale(localeProp);
203
- const text = resolveLocale({
204
- 'en-US': en_US,
205
- 'zh-CN': zh_CN
206
- }, locale, labels);
207
- const [attempt, retry] = useState(0);
208
- const [surface, setSurface] = useState(null);
209
- const { anchor, failed } = useTourAnchor(step.target, locateTarget, locateTimeout, attempt);
210
- const position = useTourPosition(anchor, surface, placement);
211
- const titleId = useId();
212
- const bodyId = useId();
213
- useEffect(()=>{
214
- const close = (event)=>{
215
- if ('Escape' === event.key) {
216
- event.preventDefault();
217
- onClose?.();
218
- }
219
- };
220
- document.addEventListener('keydown', close);
221
- return ()=>document.removeEventListener('keydown', close);
222
- }, [
223
- onClose
224
- ]);
225
- useEffect(()=>{
226
- const previous = document.activeElement;
227
- return ()=>{
228
- if (previous instanceof HTMLElement && previous.isConnected) previous.focus({
229
- preventScroll: true
230
- });
231
- };
232
- }, []);
233
- const visible = position?.visible;
234
- useEffect(()=>{
235
- if (surface && visible) surface.focus({
236
- preventScroll: true
237
- });
238
- }, [
239
- surface,
240
- visible
241
- ]);
242
- if ("u" < typeof document) return null;
243
- const unavailable = failed || position?.missing;
244
- const locating = !anchor && !failed;
245
- return /*#__PURE__*/ createPortal(/*#__PURE__*/ jsxs("div", {
246
- ref: setSurface,
247
- popover: "manual",
248
- role: "dialog",
249
- "aria-modal": "false",
250
- "aria-labelledby": titleId,
251
- "aria-describedby": bodyId,
252
- "aria-busy": locating,
253
- tabIndex: -1,
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ const button_Button = /*#__PURE__*/ forwardRef(function({ type = 'default', htmlType = 'button', size = 'default', shape = 'square', icon, iconOnly, loading, long, disabled, className, children, onClick, ...rest }, ref) {
4
+ const inactive = disabled || loading || true === rest['aria-disabled'] || 'true' === rest['aria-disabled'];
5
+ const variant = 'default' === type ? 'secondary' : type;
6
+ const onlyIcon = iconOnly || null != icon && null == children;
7
+ return /*#__PURE__*/ jsxs("button", {
8
+ ...rest,
9
+ ref: ref,
10
+ type: htmlType,
11
+ disabled: disabled || loading,
12
+ "aria-busy": loading || rest['aria-busy'],
254
13
  className: [
255
- 'ov-directory-tour',
14
+ 'ov-button',
15
+ `ov-button--${variant}`,
16
+ `ov-button--${size}`,
17
+ `ov-button--${shape}`,
18
+ onlyIcon && 'ov-button--icon-only',
19
+ disabled && 'ov-button--disabled',
20
+ loading && 'ov-button--loading',
21
+ long && 'ov-button--long',
256
22
  className
257
23
  ].filter(Boolean).join(' '),
258
- style: {
259
- ...style,
260
- top: position?.top ?? 0,
261
- left: position?.left ?? 0,
262
- visibility: position?.visible ? 'visible' : 'hidden'
24
+ onClick: (event)=>{
25
+ if (inactive) return void event.preventDefault();
26
+ onClick?.(event);
263
27
  },
264
28
  children: [
265
- anchor && !unavailable && position?.visible && /*#__PURE__*/ jsx("div", {
266
- className: "ov-directory-tour__highlight",
29
+ loading || null != icon ? /*#__PURE__*/ jsx("span", {
30
+ className: "ov-button__icon",
267
31
  "aria-hidden": "true",
268
- style: {
269
- top: position.targetTop,
270
- left: position.targetLeft,
271
- width: position.targetWidth,
272
- height: position.targetHeight
273
- }
274
- }),
275
- /*#__PURE__*/ jsxs("div", {
276
- className: "ov-directory-tour__card",
277
- children: [
278
- onClose && /*#__PURE__*/ jsx("button", {
279
- className: "ov-directory-tour__close",
280
- type: "button",
281
- "aria-label": text.close,
282
- onClick: onClose,
283
- children: "\xd7"
284
- }),
285
- !locating && !unavailable && step.illustration && /*#__PURE__*/ jsx("div", {
286
- className: "ov-directory-tour__illustration",
287
- children: step.illustration
288
- }),
289
- /*#__PURE__*/ jsx("h2", {
290
- id: titleId,
291
- className: "ov-directory-tour__title",
292
- children: step.title
293
- }),
294
- /*#__PURE__*/ jsx("div", {
295
- id: bodyId,
296
- className: "ov-directory-tour__description",
297
- role: unavailable ? 'alert' : void 0,
298
- children: unavailable ? text.unavailable : locating ? text.locating : step.description
299
- }),
300
- /*#__PURE__*/ jsxs("footer", {
301
- className: "ov-directory-tour__actions",
302
- children: [
303
- /*#__PURE__*/ jsx("span", {
304
- className: "ov-directory-tour__progress",
305
- "aria-live": "polite",
306
- children: text.progress(index + 1, steps.length)
307
- }),
308
- unavailable ? /*#__PURE__*/ jsxs(Fragment, {
309
- children: [
310
- /*#__PURE__*/ jsx("button", {
311
- type: "button",
312
- onClick: ()=>retry((value)=>value + 1),
313
- children: text.retry
314
- }),
315
- /*#__PURE__*/ jsx("button", {
316
- type: "button",
317
- onClick: ()=>advance(true),
318
- children: text.skip
319
- })
320
- ]
321
- }) : /*#__PURE__*/ jsx("button", {
322
- type: "button",
323
- className: "ov-directory-tour__primary",
324
- disabled: locating,
325
- onClick: ()=>advance(false),
326
- children: step.nextLabel ?? (index === steps.length - 1 ? text.done : text.next)
327
- })
328
- ]
329
- })
330
- ]
331
- })
32
+ children: loading ? /*#__PURE__*/ jsx("span", {
33
+ className: "ov-button__spinner"
34
+ }) : icon
35
+ }) : null,
36
+ children
332
37
  ]
333
- }), document.body);
334
- }
335
- export { DirectoryTour };
38
+ });
39
+ });
40
+ export { button_Button };
package/dist/fi~0.js CHANGED
@@ -2,21 +2,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  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
- import { searchreact } from "./p~0.js";
5
+ import { searchreact } from "./p0~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", {
package/dist/fj~0.js CHANGED
@@ -1,15 +1,15 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useId, useRef, useState } from "react";
3
3
  import { mergeLabels } from "./nx~0.js";
4
- import { getFileTypeColor, getFileTypeIcon, WikiWarningIcon, WikiSuccessIcon, WikiEditIcon, WikiDiscussIcon, WikiHistoryIcon, resolveFileTypeIconKey } from "./k~0.js";
4
+ import { getFileTypeColor, resolveFileTypeIconKey, WikiWarningIcon, WikiSuccessIcon, getFileTypeIcon } from "./k~0.js";
5
5
  import { Tooltip } from "./rt~0.js";
6
+ import { button_Button } from "./e~0.js";
6
7
  import { Popover } from "./r~0.js";
7
8
  import { useLocale } from "./28~0.js";
8
9
  import { DashboardState } from "./37~0.js";
9
10
  const en = {
10
11
  title: 'Generation results',
11
12
  pendingLabel: 'Pending',
12
- discuss: 'VikingBot discussion',
13
13
  conflicts: 'All conflicts',
14
14
  conflictFiles: 'Conflicting files',
15
15
  pending: 'Pending conflicts',
@@ -26,20 +26,15 @@ const en = {
26
26
  failed: 'Could not load conflicts',
27
27
  retry: 'Retry',
28
28
  open: 'Open',
29
- edit: 'Manual edit',
30
29
  solution: 'Solution',
31
30
  occurred: 'Detected',
32
31
  fixedAt: 'Resolved',
33
32
  evidence: 'Resolution basis',
34
- history: 'Resolution history',
35
- historyHint: 'View the resolution plan and evidence',
36
- unavailable: 'Action unavailable',
37
33
  limited: 'Showing up to 100 conflicting files'
38
34
  };
39
35
  const zh = {
40
36
  title: '生成效果',
41
37
  pendingLabel: '待确认',
42
- discuss: 'VikingBot 对话',
43
38
  conflicts: '全部冲突',
44
39
  conflictFiles: '冲突文件数',
45
40
  pending: '待确认冲突',
@@ -56,14 +51,10 @@ const zh = {
56
51
  failed: '冲突加载失败',
57
52
  retry: '重试',
58
53
  open: '打开',
59
- edit: '人工修改',
60
54
  solution: '修复方案',
61
55
  occurred: '检测时间',
62
56
  fixedAt: '修复时间',
63
57
  evidence: '修复依据',
64
- history: '修复回溯',
65
- historyHint: '查看修复方案与依据',
66
- unavailable: '当前不可操作',
67
58
  limited: '最多展示 100 个存在待确认冲突的文件'
68
59
  };
69
60
  const wikiLabels = (locale, labels)=>mergeLabels('zh-CN' === locale ? zh : en, labels);
@@ -79,21 +70,23 @@ function WikiFileIcon({ name }) {
79
70
  }
80
71
  });
81
72
  }
82
- function WikiActionButton({ label, hint, onClick, children, ...aria }) {
73
+ function WikiActionButton({ icon, tooltip, disabled, onClick }) {
74
+ const inactive = disabled || !onClick;
83
75
  return /*#__PURE__*/ jsx(Tooltip, {
84
- content: hint,
85
- children: /*#__PURE__*/ jsx("button", {
86
- ...aria,
87
- type: "button",
88
- "aria-label": label,
89
- "aria-disabled": !onClick || void 0,
90
- "aria-description": onClick ? void 0 : hint,
91
- onClick: ()=>onClick?.(),
92
- children: children
76
+ content: tooltip,
77
+ children: /*#__PURE__*/ jsx(button_Button, {
78
+ size: "mini",
79
+ type: "text",
80
+ iconOnly: true,
81
+ htmlType: "button",
82
+ "aria-label": tooltip,
83
+ "aria-disabled": inactive || void 0,
84
+ icon: icon,
85
+ onClick: onClick
93
86
  })
94
87
  });
95
88
  }
96
- function WikiConflictCard({ conflict, path, labels: t, editDisabledReason, discussDisabledReason, onOpenUri, onEdit, onDiscuss }) {
89
+ function WikiConflictCard({ conflict, path, labels: t, actions = [], onOpenUri }) {
97
90
  const [expanded, setExpanded] = useState(false);
98
91
  const id = useId();
99
92
  const fixed = 'fixed' === conflict.state;
@@ -102,7 +95,11 @@ function WikiConflictCard({ conflict, path, labels: t, editDisabledReason, discu
102
95
  className: "ov-wiki-dashboard__conflict",
103
96
  children: [
104
97
  /*#__PURE__*/ jsxs("div", {
105
- className: `ov-wiki-dashboard__conflict-row${path ? '' : ' ov-wiki-dashboard__conflict-row--without-path'}`,
98
+ className: [
99
+ 'ov-wiki-dashboard__conflict-row',
100
+ !path && 'ov-wiki-dashboard__conflict-row--without-path',
101
+ actions.length > 0 && 'ov-wiki-dashboard__conflict-row--with-actions'
102
+ ].filter(Boolean).join(' '),
106
103
  children: [
107
104
  /*#__PURE__*/ jsxs("span", {
108
105
  className: `ov-wiki-dashboard__status ov-wiki-dashboard__status--${conflict.state}`,
@@ -159,41 +156,12 @@ function WikiConflictCard({ conflict, path, labels: t, editDisabledReason, discu
159
156
  className: `ov-wiki-dashboard__severity ov-wiki-dashboard__severity--${conflict.severity}`,
160
157
  children: t[conflict.severity]
161
158
  }),
162
- /*#__PURE__*/ jsx("div", {
159
+ actions.length > 0 ? /*#__PURE__*/ jsx("div", {
163
160
  className: "ov-wiki-dashboard__actions",
164
- children: fixed ? /*#__PURE__*/ jsx(WikiActionButton, {
165
- label: t.history,
166
- hint: t.historyHint,
167
- "aria-expanded": expanded,
168
- "aria-controls": id,
169
- onClick: ()=>setExpanded(!expanded),
170
- children: /*#__PURE__*/ jsx(WikiHistoryIcon, {
171
- width: 14,
172
- height: 14
173
- })
174
- }) : /*#__PURE__*/ jsxs(Fragment, {
175
- children: [
176
- /*#__PURE__*/ jsx(WikiActionButton, {
177
- label: `${t.edit}: ${conflict.description}`,
178
- hint: onEdit ? t.edit : editDisabledReason || t.unavailable,
179
- onClick: onEdit ? ()=>onEdit(conflict) : void 0,
180
- children: /*#__PURE__*/ jsx(WikiEditIcon, {
181
- width: 14,
182
- height: 14
183
- })
184
- }),
185
- /*#__PURE__*/ jsx(WikiActionButton, {
186
- label: `${t.discuss}: ${conflict.description}`,
187
- hint: onDiscuss ? t.discuss : discussDisabledReason || t.unavailable,
188
- onClick: onDiscuss ? ()=>onDiscuss(conflict) : void 0,
189
- children: /*#__PURE__*/ jsx(WikiDiscussIcon, {
190
- width: 14,
191
- height: 14
192
- })
193
- })
194
- ]
195
- })
196
- })
161
+ children: actions.map(({ key, ...action })=>/*#__PURE__*/ jsx(WikiActionButton, {
162
+ ...action
163
+ }, key))
164
+ }) : null
197
165
  ]
198
166
  }),
199
167
  /*#__PURE__*/ jsx("div", {
@@ -384,7 +352,7 @@ function WikiSeverityFilter({ value, onChange, labels: t }) {
384
352
  });
385
353
  }
386
354
  function WikiDashboard(props) {
387
- const { kind, data, editDisabledReason, discussDisabledReason, locale: localeProp, onOpenUri, onOpenDashboard, onEdit, onDiscuss, labels, loading, error, onRetry, className, ...rest } = props;
355
+ const { kind, data, locale: localeProp, onOpenUri, onOpenDashboard, defineActions, labels, loading, error, onRetry, className, ...rest } = props;
388
356
  const locale = useLocale(localeProp);
389
357
  const t = wikiLabels(locale, labels);
390
358
  const [severity, setSeverity] = useState('all');
@@ -445,15 +413,14 @@ function WikiDashboard(props) {
445
413
  conflict: conflict,
446
414
  path: data?.path,
447
415
  labels: t,
448
- editDisabledReason: editDisabledReason,
449
- discussDisabledReason: discussDisabledReason,
450
416
  onOpenUri: onOpenUri,
451
- onEdit: onEdit,
452
- onDiscuss: onDiscuss
417
+ actions: defineActions?.(conflict)
453
418
  }, conflict.id))
454
419
  }) : 'directory' === kind && data?.files.length ? /*#__PURE__*/ jsx("ul", {
455
420
  className: "ov-wiki-dashboard__files",
456
- children: data.files.map((file)=>/*#__PURE__*/ jsxs("li", {
421
+ children: data.files.map((file)=>{
422
+ const actions = defineActions?.(file) ?? [];
423
+ return /*#__PURE__*/ jsxs("li", {
457
424
  children: [
458
425
  /*#__PURE__*/ jsx(WikiFileIcon, {
459
426
  name: file
@@ -473,13 +440,15 @@ function WikiDashboard(props) {
473
440
  })
474
441
  ]
475
442
  }),
476
- onEdit ? /*#__PURE__*/ jsx("button", {
477
- type: "button",
478
- onClick: ()=>onEdit(file),
479
- children: t.edit
443
+ actions.length > 0 ? /*#__PURE__*/ jsx("div", {
444
+ className: "ov-wiki-dashboard__actions",
445
+ children: actions.map(({ key, ...action })=>/*#__PURE__*/ jsx(WikiActionButton, {
446
+ ...action
447
+ }, key))
480
448
  }) : null
481
449
  ]
482
- }, file))
450
+ }, file);
451
+ })
483
452
  }) : /*#__PURE__*/ jsx(DashboardState, {
484
453
  state: {
485
454
  loading,