@openviking/react 0.1.7 → 0.1.8-beta.11.1.gc6def608a25e

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 (127) hide show
  1. package/README.md +11 -1
  2. package/dist/1~0.js +57 -0
  3. package/dist/3~0.js +171 -5
  4. package/dist/5~0.js +181 -0
  5. package/dist/6~0.js +48 -0
  6. package/dist/ark-message-list-view~0.js +50 -8
  7. package/dist/components/agent-connect/style.css +4 -2
  8. package/dist/components/api-key-login-form/api-key-login-form.d.ts +2 -0
  9. package/dist/components/api-key-login-form/index.d.ts +3 -0
  10. package/dist/components/api-key-login-form/style.css +438 -0
  11. package/dist/components/api-key-login-form/style.js +0 -0
  12. package/dist/components/api-key-login-form/types.d.ts +7 -0
  13. package/dist/components/api-key-login-form.js +1 -0
  14. package/dist/components/directory-tour/directory-tour-intro.d.ts +3 -0
  15. package/dist/components/directory-tour/index.d.ts +2 -1
  16. package/dist/components/directory-tour/style.css +154 -26
  17. package/dist/components/directory-tour/tour-card.d.ts +14 -0
  18. package/dist/components/directory-tour/types.d.ts +24 -1
  19. package/dist/components/directory-tour/use-tour-anchor.d.ts +1 -0
  20. package/dist/components/directory-tour/use-tour-position.d.ts +4 -1
  21. package/dist/components/directory-tour/use-tour-theme.d.ts +2 -0
  22. package/dist/components/directory-tour.js +52 -1
  23. package/dist/components/email-login-form/email-login-form.d.ts +2 -0
  24. package/dist/components/email-login-form/index.d.ts +3 -0
  25. package/dist/components/email-login-form/style.css +438 -0
  26. package/dist/components/email-login-form/style.js +0 -0
  27. package/dist/components/email-login-form/types.d.ts +11 -0
  28. package/dist/components/email-login-form.js +1 -0
  29. package/dist/components/experience-dashboard/experience-impact.d.ts +3 -1
  30. package/dist/components/experience-dashboard/style.css +4 -2
  31. package/dist/components/file-browser-entries/style.css +12 -6
  32. package/dist/components/file-preview/file-preview-header.d.ts +4 -21
  33. package/dist/components/file-preview/file-preview-toolbar.d.ts +7 -0
  34. package/dist/components/file-preview/locales/en-US.d.ts +9 -0
  35. package/dist/components/file-preview/locales/zh-CN.d.ts +9 -0
  36. package/dist/components/file-preview/style.css +116 -2
  37. package/dist/components/file-preview/types.d.ts +14 -21
  38. package/dist/components/file-tree/style.css +4 -2
  39. package/dist/components/invitation-confirmation/index.d.ts +3 -0
  40. package/dist/components/invitation-confirmation/invitation-confirmation.d.ts +2 -0
  41. package/dist/components/invitation-confirmation/style.css +438 -0
  42. package/dist/components/invitation-confirmation/style.js +0 -0
  43. package/dist/components/invitation-confirmation/types.d.ts +20 -0
  44. package/dist/components/invitation-confirmation.js +1 -0
  45. package/dist/components/login-method-selector/index.d.ts +2 -0
  46. package/dist/components/login-method-selector/login-method-selector.d.ts +2 -0
  47. package/dist/components/login-method-selector/style.css +438 -0
  48. package/dist/components/login-method-selector/style.js +0 -0
  49. package/dist/components/login-method-selector/types.d.ts +14 -0
  50. package/dist/components/login-method-selector.js +1 -0
  51. package/dist/components/password-reset-request-form/index.d.ts +3 -0
  52. package/dist/components/password-reset-request-form/password-reset-request-form.d.ts +2 -0
  53. package/dist/components/password-reset-request-form/style.css +438 -0
  54. package/dist/components/password-reset-request-form/style.js +0 -0
  55. package/dist/components/password-reset-request-form/types.d.ts +13 -0
  56. package/dist/components/password-reset-request-form.js +1 -0
  57. package/dist/components/password-setup-form/index.d.ts +3 -0
  58. package/dist/components/password-setup-form/password-setup-form.d.ts +2 -0
  59. package/dist/components/password-setup-form/style.css +438 -0
  60. package/dist/components/password-setup-form/style.js +0 -0
  61. package/dist/components/password-setup-form/types.d.ts +10 -0
  62. package/dist/components/password-setup-form.js +1 -0
  63. package/dist/components/scope-switcher/style.css +4 -2
  64. package/dist/components/scope-switcher.js +1 -1
  65. package/dist/components/style.css +3120 -79
  66. package/dist/components/tui/style.css +8 -4
  67. package/dist/components/viking-bot/bot-popover.d.ts +2 -1
  68. package/dist/components/viking-bot/composer-reference-tags.d.ts +8 -0
  69. package/dist/components/viking-bot/composer-references.d.ts +0 -5
  70. package/dist/components/viking-bot/locales/en-US.d.ts +1 -0
  71. package/dist/components/viking-bot/locales/zh-CN.d.ts +1 -0
  72. package/dist/components/viking-bot/model.d.ts +1 -0
  73. package/dist/components/viking-bot/popover-tab-navigation.d.ts +3 -0
  74. package/dist/components/viking-bot/style.css +166 -27
  75. package/dist/components/viking-bot/types.d.ts +3 -1
  76. package/dist/components/viking-bot/user-message-group.d.ts +9 -0
  77. package/dist/components/wiki-dashboard/index.d.ts +1 -1
  78. package/dist/components/wiki-dashboard/style.css +16 -4
  79. package/dist/components/wiki-dashboard/types.d.ts +12 -16
  80. package/dist/components/wiki-dashboard/wiki-action-button.d.ts +2 -9
  81. package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +3 -10
  82. package/dist/c~0.js +77 -6
  83. package/dist/d~0.js +28 -0
  84. package/dist/ep~0.js +281 -133
  85. package/dist/fi~0.js +339 -0
  86. package/dist/fj~0.js +32 -67
  87. package/dist/fl~0.js +3 -2
  88. package/dist/f~0.js +63 -326
  89. package/dist/g~0.js +135 -0
  90. package/dist/icons/index.d.ts +2 -0
  91. package/dist/icons/viking-bot-icons.d.ts +1 -1
  92. package/dist/icons.js +1 -1
  93. package/dist/index.d.ts +12 -0
  94. package/dist/index.js +8 -2
  95. package/dist/k~0.js +44 -4
  96. package/dist/l5~0.js +3813 -0
  97. package/dist/lg~0.js +41 -1
  98. package/dist/lk~0.js +1 -1
  99. package/dist/l~0.js +54 -3811
  100. package/dist/modules/console/style.css +182 -35
  101. package/dist/modules/file-browser/file-browser-detail-icons.d.ts +0 -6
  102. package/dist/modules/file-browser/file-browser-detail.d.ts +2 -23
  103. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  104. package/dist/modules/file-browser/fs-file-editing.d.ts +4 -0
  105. package/dist/modules/file-browser/fs-preview-images.d.ts +3 -0
  106. package/dist/modules/file-browser/fs-read-file.d.ts +1 -1
  107. package/dist/modules/file-browser/style.css +156 -70
  108. package/dist/modules/file-browser/types.d.ts +2 -0
  109. package/dist/modules/file-browser/use-file-browser-acl.d.ts +1 -0
  110. package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +2 -4
  111. package/dist/modules/file-browser.js +1 -1
  112. package/dist/modules/scope-cascade/style.css +4 -2
  113. package/dist/modules/style.css +346 -109
  114. package/dist/n~0.js +1 -1
  115. package/dist/p0~0.js +27 -0
  116. package/dist/p~0.js +34 -25
  117. package/dist/shared/auth/agreements.d.ts +10 -0
  118. package/dist/shared/auth/fields.d.ts +15 -0
  119. package/dist/shared/auth/form-frame.d.ts +12 -0
  120. package/dist/shared/auth/locales/en-US.d.ts +24 -0
  121. package/dist/shared/auth/locales/zh-CN.d.ts +24 -0
  122. package/dist/shared/auth/types.d.ts +61 -0
  123. package/dist/shared/auth/use-auth-labels.d.ts +3 -0
  124. package/dist/shared/auth/use-form.d.ts +8 -0
  125. package/dist/style.css +3690 -410
  126. package/dist/viking-bot-composer~0.js +86 -29
  127. package/package.json +32 -2
package/dist/f~0.js CHANGED
@@ -1,339 +1,76 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useId, useRef, useState } from "react";
3
- import { resolveLocale } from "./nx~0.js";
4
- import { checkreact } from "./0~0.js";
5
- import { searchreact } from "./p~0.js";
6
- import { input_Input } from "./c7r~0.js";
7
- import { chevron_downreact } from "./s~0.js";
8
- import { useLocale, LocaleProvider } from "./28~0.js";
9
- const messages = {
10
- loading: 'Loading…',
11
- searchPlaceholder: 'Search',
12
- empty: 'No options',
13
- noMatch: 'No matches',
14
- error: 'Unable to load options'
15
- };
16
- const en_US = messages;
17
- const zh_CN_messages = {
18
- loading: '加载中…',
19
- searchPlaceholder: '搜索',
20
- empty: '暂无选项',
21
- noMatch: '没有匹配项',
22
- error: '选项加载失败'
23
- };
24
- const zh_CN = zh_CN_messages;
25
- const LOCALES = {
26
- 'en-US': en_US,
27
- 'zh-CN': zh_CN
28
- };
29
- function resolveScopeLabels(locale = 'en-US', labels) {
30
- const defaults = resolveLocale(LOCALES, locale, labels);
31
- return {
32
- ...defaults,
33
- noMatch: labels?.noMatch ?? labels?.empty ?? defaults.noMatch
34
- };
35
- }
36
- function moveScopeFocus(event) {
37
- if (![
38
- 'ArrowDown',
39
- 'ArrowUp',
40
- 'Home',
41
- 'End'
42
- ].includes(event.key)) return;
43
- const target = event.target;
44
- const isSearch = target.matches('input.ov-scope-switcher__search');
45
- if (event.defaultPrevented || !target.matches('[role="option"]') && !isSearch || isSearch && !event.key.startsWith('Arrow')) return;
46
- const options = Array.from(event.currentTarget.querySelectorAll('[role="option"]:not([aria-disabled="true"])'));
47
- if (!options.length) return;
48
- event.preventDefault();
49
- const current = options.indexOf(document.activeElement);
50
- const next = 'Home' === event.key ? 0 : 'End' === event.key ? options.length - 1 : 'ArrowDown' === event.key ? (current + 1) % options.length : current < 0 ? options.length - 1 : (current - 1 + options.length) % options.length;
51
- options[next]?.focus();
52
- }
53
- function Highlight({ text, keyword }) {
54
- const needle = keyword.trim().toLocaleLowerCase();
55
- if (!needle) return /*#__PURE__*/ jsx(Fragment, {
56
- children: text
57
- });
58
- const haystack = text.toLocaleLowerCase();
59
- const parts = [];
60
- let cursor = 0;
61
- let hit = haystack.indexOf(needle);
62
- while(hit >= 0){
63
- if (hit > cursor) parts.push(text.slice(cursor, hit));
64
- const end = hit + needle.length;
65
- parts.push(/*#__PURE__*/ jsx("mark", {
66
- children: text.slice(hit, end)
67
- }, `${hit}-${end}`));
68
- cursor = end;
69
- hit = haystack.indexOf(needle, cursor);
70
- }
71
- if (cursor < text.length) parts.push(text.slice(cursor));
72
- return /*#__PURE__*/ jsx(Fragment, {
73
- children: parts
74
- });
75
- }
76
- function ScopePanel({ label, data, state, slots, actions, onSelect, labels }) {
77
- const focusPanel = useCallback((node)=>{
78
- const target = node?.querySelector('input') ?? node?.querySelector('[role="option"][aria-selected="true"]:not([aria-disabled="true"])') ?? node?.querySelector('[role="option"]:not([aria-disabled="true"])');
79
- (target ?? node)?.focus();
80
- }, []);
81
- const options = data.visibleOptions ?? data.options;
82
- const keyword = state?.searchKeyword ?? '';
83
- const hasKeyword = keyword.trim().length > 0;
84
- const searchVisible = actions?.onSearchKeywordChange && (hasKeyword || Math.max(options.length, data.options.length, data.total ?? 0) > 10);
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",
91
- className: "ov-scope-switcher__search-field",
92
- value: keyword,
93
- "aria-label": labels.searchPlaceholder,
94
- placeholder: labels.searchPlaceholder,
95
- onChange: (event)=>actions?.onSearchKeywordChange?.(event.currentTarget.value)
96
- }) : null;
97
- let list;
98
- list = state?.loading ? /*#__PURE__*/ jsx("div", {
99
- className: "ov-scope-switcher__state",
100
- role: "status",
101
- children: labels.loading
102
- }) : state?.error ? /*#__PURE__*/ jsx("div", {
103
- className: "ov-scope-switcher__state",
104
- role: "alert",
105
- children: slots?.errorFallback ?? labels.error
106
- }) : options.length ? /*#__PURE__*/ jsx("div", {
107
- className: "ov-scope-switcher__list",
108
- role: "listbox",
109
- "aria-label": label,
110
- "aria-busy": state?.busy,
111
- onScroll: (event)=>{
112
- const { scrollTop, scrollHeight, clientHeight } = event.currentTarget;
113
- actions?.onScroll?.({
114
- scrollTop,
115
- scrollHeight,
116
- clientHeight
117
- });
118
- },
119
- children: options.map((option)=>{
120
- const selected = option.id === data.selectedId;
121
- const content = /*#__PURE__*/ jsxs(Fragment, {
122
- children: [
123
- option.icon && /*#__PURE__*/ jsx("span", {
124
- className: "ov-scope-switcher__icon",
125
- "aria-hidden": "true",
126
- children: option.icon
127
- }),
128
- /*#__PURE__*/ jsxs("span", {
129
- className: "ov-scope-switcher__option-text",
130
- children: [
131
- /*#__PURE__*/ jsx("span", {
132
- children: /*#__PURE__*/ jsx(Highlight, {
133
- text: option.label,
134
- keyword: keyword
135
- })
136
- }),
137
- option.description && /*#__PURE__*/ jsx("small", {
138
- children: option.description
139
- })
140
- ]
141
- }),
142
- selected && /*#__PURE__*/ jsx("span", {
143
- className: "ov-scope-switcher__check",
144
- "aria-hidden": "true",
145
- children: /*#__PURE__*/ jsx(checkreact, {})
146
- })
147
- ]
148
- });
149
- return /*#__PURE__*/ jsx("div", {
150
- tabIndex: option.disabled || state?.busy ? -1 : 0,
151
- role: "option",
152
- "aria-selected": selected,
153
- className: "ov-scope-switcher__option",
154
- title: option.label,
155
- "aria-disabled": option.disabled || state?.busy || void 0,
156
- onClick: (event)=>{
157
- const target = event.target;
158
- if (option.disabled || state?.busy || target.closest('button, a, input, select, textarea, [role="button"]')) return;
159
- onSelect(option);
160
- },
161
- onKeyDown: (event)=>{
162
- if (event.target !== event.currentTarget || option.disabled || state?.busy) return;
163
- if ('Enter' === event.key || ' ' === event.key) {
164
- event.preventDefault();
165
- onSelect(option);
166
- }
167
- },
168
- children: slots?.renderOption ? slots?.renderOption(content, option) : content
169
- }, option.id);
170
- })
171
- }, keyword) : /*#__PURE__*/ jsx("div", {
172
- className: "ov-scope-switcher__state",
173
- role: "status",
174
- children: slots?.emptyFallback ?? (hasKeyword ? labels.noMatch : labels.empty)
175
- });
176
- return /*#__PURE__*/ jsx("div", {
177
- role: "group",
178
- tabIndex: -1,
179
- ref: focusPanel,
180
- className: "ov-scope-switcher__panel-inner",
181
- onKeyDownCapture: moveScopeFocus,
182
- children: slots?.renderPanel ? slots?.renderPanel({
183
- search,
184
- list
185
- }) : /*#__PURE__*/ jsxs("div", {
186
- className: "ov-scope-switcher__panel-body",
187
- children: [
188
- search,
189
- list
190
- ]
191
- })
192
- });
193
- }
194
- function ScopeSelector(props) {
195
- const { identity, trigger: triggerContent } = props;
196
- const locale = useLocale(props.locale);
197
- const labels = resolveScopeLabels(locale, props.labels);
198
- const selectable = 'selectable' === props.kind ? props : void 0;
199
- const data = selectable?.data;
200
- const state = selectable?.state;
201
- const actions = selectable?.actions;
202
- const slots = selectable?.slots;
203
- const [localVisible, setLocalVisible] = useState(false);
204
- const root = useRef(null);
205
- const trigger = useRef(null);
206
- const restoreSelectionFocus = useRef(false);
207
- const panelId = useId();
208
- const open = void 0 !== selectable && (state?.visible ?? localVisible) && !state?.disabled;
209
- const onVisibleChange = actions?.onVisibleChange;
210
- const changeVisible = useCallback((visible)=>{
211
- setLocalVisible(visible);
212
- onVisibleChange?.(visible);
213
- }, [
214
- onVisibleChange
215
- ]);
216
- useEffect(()=>{
217
- if (!open) return;
218
- const dismiss = (event)=>{
219
- if (event.target instanceof Node && !root.current?.contains(event.target)) changeVisible(false);
220
- };
221
- const escape = (event)=>{
222
- if ('Escape' === event.key) {
223
- event.preventDefault();
224
- changeVisible(false);
225
- trigger.current?.focus();
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import { useAuthLabels, Field } from "./g~0.js";
4
+ import { useForm, FormFrame } from "./5~0.js";
5
+ function PasswordSetupForm({ account, passwordHint, validatePassword, onSubmit, locale, labels: overrides, ...options }) {
6
+ const id = useId();
7
+ const labels = useAuthLabels(locale, overrides);
8
+ const form = useForm({
9
+ password: '',
10
+ confirmation: ''
11
+ }, ({ password, confirmation })=>{
12
+ const message = password ? validatePassword?.(password) : void 0;
13
+ return {
14
+ password: password ? void 0 === message ? void 0 : {
15
+ message
16
+ } : {
17
+ key: 'required'
18
+ },
19
+ confirmation: confirmation ? password !== confirmation ? {
20
+ key: 'mismatch'
21
+ } : void 0 : {
22
+ key: 'required'
226
23
  }
227
24
  };
228
- document.addEventListener('pointerdown', dismiss);
229
- document.addEventListener('keydown', escape);
230
- return ()=>{
231
- document.removeEventListener('pointerdown', dismiss);
232
- document.removeEventListener('keydown', escape);
233
- };
234
- }, [
235
- open,
236
- changeVisible
237
- ]);
238
- useEffect(()=>{
239
- if (open || !restoreSelectionFocus.current) return;
240
- restoreSelectionFocus.current = false;
241
- if (document.activeElement === document.body || root.current?.contains(document.activeElement)) trigger.current?.focus();
242
- }, [
243
- open
244
- ]);
245
- const selected = data?.options.find((o)=>o.id === data.selectedId);
246
- const label = triggerContent?.label ?? selected?.label ?? '';
247
- const icon = triggerContent?.icon ?? selected?.icon;
248
- const content = /*#__PURE__*/ jsxs(Fragment, {
249
- children: [
250
- icon && /*#__PURE__*/ jsx("span", {
251
- className: "ov-scope-switcher__icon",
252
- "aria-hidden": "true",
253
- children: icon
254
- }),
255
- /*#__PURE__*/ jsx("span", {
256
- className: "ov-scope-switcher__label",
257
- children: label
258
- }),
259
- identity.tag && /*#__PURE__*/ jsx("span", {
260
- className: "ov-scope-switcher__tag",
261
- children: identity.tag
262
- })
263
- ]
264
25
  });
265
- return /*#__PURE__*/ jsxs("div", {
266
- ref: root,
267
- role: "group",
268
- className: "ov-scope-switcher__level",
269
- onBlur: (event)=>{
270
- if (open && event.relatedTarget instanceof Node && !event.currentTarget.contains(event.relatedTarget)) changeVisible(false);
271
- },
26
+ return /*#__PURE__*/ jsxs(FormFrame, {
27
+ ...options,
28
+ labels: labels,
29
+ submitLabel: labels.confirm,
30
+ validate: form.validate,
31
+ onSubmit: ()=>onSubmit?.({
32
+ password: form.values.password
33
+ }),
272
34
  children: [
273
- void 0 === selectable ? /*#__PURE__*/ jsx("span", {
274
- className: "ov-scope-switcher__trigger",
275
- "aria-label": identity.ariaLabel,
276
- title: label,
277
- children: content
278
- }) : /*#__PURE__*/ jsxs("button", {
279
- ref: trigger,
280
- type: "button",
281
- className: "ov-scope-switcher__trigger",
282
- "aria-label": identity.ariaLabel,
283
- title: label,
284
- disabled: state?.disabled,
285
- "aria-expanded": open,
286
- "aria-haspopup": "dialog",
287
- "aria-controls": open ? panelId : void 0,
288
- onClick: ()=>changeVisible(!open),
289
- onKeyDown: (event)=>{
290
- if ('ArrowDown' === event.key || 'ArrowUp' === event.key) {
291
- event.preventDefault();
292
- if (open) root.current?.querySelector('[role="option"]:not([aria-disabled="true"])')?.focus();
293
- else changeVisible(true);
294
- }
295
- },
35
+ account && /*#__PURE__*/ jsxs("div", {
36
+ className: "ov-auth__account",
296
37
  children: [
297
- content,
38
+ /*#__PURE__*/ jsx("strong", {
39
+ children: account
40
+ }),
298
41
  /*#__PURE__*/ jsx("span", {
299
- className: "ov-scope-switcher__arrow",
300
- "aria-hidden": "true",
301
- children: /*#__PURE__*/ jsx(chevron_downreact, {})
42
+ children: labels.account
302
43
  })
303
44
  ]
304
45
  }),
305
- open && void 0 !== selectable && void 0 !== data && /*#__PURE__*/ jsx("div", {
306
- id: panelId,
307
- className: slots?.renderPanel ? 'ov-scope-switcher__panel ov-scope-switcher__panel--custom' : 'ov-scope-switcher__panel',
308
- role: "dialog",
309
- "aria-label": identity.ariaLabel ?? label,
310
- children: /*#__PURE__*/ jsx(ScopePanel, {
311
- label: identity.ariaLabel ?? label,
312
- data: data,
313
- state: state,
314
- slots: slots,
315
- actions: actions,
316
- onSelect: (option)=>{
317
- restoreSelectionFocus.current = true;
318
- changeVisible(false);
319
- actions?.onSelect?.(option);
320
- },
321
- labels: labels
322
- })
46
+ /*#__PURE__*/ jsx(Field, {
47
+ id: `${id}-password`,
48
+ label: labels.newPassword,
49
+ labels: labels,
50
+ value: form.values.password,
51
+ secret: true,
52
+ autoComplete: "new-password",
53
+ "aria-describedby": `${id}-hint`,
54
+ error: form.errors.password,
55
+ onChange: (value)=>form.update('password', value)
56
+ }),
57
+ /*#__PURE__*/ jsx(Field, {
58
+ id: `${id}-confirmation`,
59
+ label: labels.confirmation,
60
+ labels: labels,
61
+ value: form.values.confirmation,
62
+ secret: true,
63
+ autoComplete: "new-password",
64
+ "aria-describedby": `${id}-hint`,
65
+ error: form.errors.confirmation,
66
+ onChange: (value)=>form.update('confirmation', value)
67
+ }),
68
+ /*#__PURE__*/ jsx("p", {
69
+ className: "ov-auth__description",
70
+ id: `${id}-hint`,
71
+ children: passwordHint
323
72
  })
324
73
  ]
325
74
  });
326
75
  }
327
- function ScopeSwitcher({ locale: localeProp, children, className = '', ...props }) {
328
- const locale = useLocale(localeProp);
329
- return /*#__PURE__*/ jsx(LocaleProvider, {
330
- locale: locale,
331
- children: /*#__PURE__*/ jsx("div", {
332
- lang: locale,
333
- ...props,
334
- className: `ov-scope-switcher ${className}`,
335
- children: children
336
- })
337
- });
338
- }
339
- export { ScopeSelector, ScopeSwitcher };
76
+ export { PasswordSetupForm };
package/dist/g~0.js ADDED
@@ -0,0 +1,135 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { resolveLocale } from "./nx~0.js";
4
+ import { useLocale } from "./28~0.js";
5
+ function Action({ action }) {
6
+ return action?.onClick ? /*#__PURE__*/ jsx("button", {
7
+ className: "ov-auth__link",
8
+ type: "button",
9
+ onClick: action.onClick,
10
+ children: action.label
11
+ }) : null;
12
+ }
13
+ function Field({ label, error, secret, labels, action, onChange, id, ...input }) {
14
+ const [visible, setVisible] = useState(false);
15
+ const message = error && ('key' in error ? labels[error.key] : error.message);
16
+ return /*#__PURE__*/ jsxs("div", {
17
+ className: "ov-auth__field",
18
+ children: [
19
+ /*#__PURE__*/ jsxs("div", {
20
+ className: "ov-auth__label",
21
+ children: [
22
+ /*#__PURE__*/ jsx("label", {
23
+ htmlFor: id,
24
+ children: label
25
+ }),
26
+ /*#__PURE__*/ jsx(Action, {
27
+ action: action
28
+ })
29
+ ]
30
+ }),
31
+ /*#__PURE__*/ jsxs("div", {
32
+ className: "ov-auth__input-wrap",
33
+ children: [
34
+ /*#__PURE__*/ jsx("input", {
35
+ ...input,
36
+ id: id,
37
+ onChange: (event)=>onChange(event.target.value),
38
+ type: secret ? visible ? 'text' : 'password' : input.type,
39
+ "aria-invalid": void 0 !== error,
40
+ "aria-describedby": message ? `${id}-error` : input['aria-describedby']
41
+ }),
42
+ secret && /*#__PURE__*/ jsx("button", {
43
+ type: "button",
44
+ className: "ov-auth__visibility",
45
+ disabled: input.disabled,
46
+ "aria-label": visible ? labels.hidePassword : labels.showPassword,
47
+ "aria-pressed": visible,
48
+ onClick: ()=>setVisible(!visible),
49
+ children: /*#__PURE__*/ jsx("svg", {
50
+ viewBox: "0 0 16 16",
51
+ fill: "none",
52
+ "aria-hidden": "true",
53
+ children: visible ? /*#__PURE__*/ jsxs(Fragment, {
54
+ children: [
55
+ /*#__PURE__*/ jsx("path", {
56
+ d: "M1.5 8s2.2-4 6.5-4 6.5 4 6.5 4-2.2 4-6.5 4-6.5-4-6.5-4Z"
57
+ }),
58
+ /*#__PURE__*/ jsx("circle", {
59
+ cx: "8",
60
+ cy: "8",
61
+ r: "2"
62
+ })
63
+ ]
64
+ }) : /*#__PURE__*/ jsx("path", {
65
+ d: "M2 6.25C3.5 8.35 5.5 9.5 8 9.5s4.5-1.15 6-3.25M4.3 8.45l-1.1 1.8M8 9.5v2M11.7 8.45l1.1 1.8"
66
+ })
67
+ })
68
+ })
69
+ ]
70
+ }),
71
+ message && /*#__PURE__*/ jsx("p", {
72
+ className: "ov-auth__error",
73
+ id: `${id}-error`,
74
+ role: "alert",
75
+ children: message
76
+ })
77
+ ]
78
+ });
79
+ }
80
+ const messages = {
81
+ email: 'Email',
82
+ password: 'Password',
83
+ apiKey: 'API Key',
84
+ newPassword: 'New password',
85
+ confirmation: 'Confirm new password',
86
+ showPassword: 'Show password',
87
+ hidePassword: 'Hide password',
88
+ required: 'This field is required.',
89
+ invalidEmail: 'Enter a valid email address.',
90
+ mismatch: 'Passwords do not match.',
91
+ login: 'Log in',
92
+ send: 'Send reset email',
93
+ resend: 'Resend email',
94
+ confirm: 'Confirm and log in',
95
+ agreementPrefix: 'I have read and agree to',
96
+ agreementTitle: 'Read and accept the agreements',
97
+ agreementDescription: 'Please read and accept the following agreements before continuing.',
98
+ agree: 'Agree and continue',
99
+ cancel: 'Cancel',
100
+ account: 'Login account',
101
+ acceptInvitation: 'Accept invitation'
102
+ };
103
+ const en_US = messages;
104
+ const zh_CN_messages = {
105
+ email: '邮箱',
106
+ password: '密码',
107
+ apiKey: 'API Key',
108
+ newPassword: '新密码',
109
+ confirmation: '确认新密码',
110
+ showPassword: '显示密码',
111
+ hidePassword: '隐藏密码',
112
+ required: '此项为必填项。',
113
+ invalidEmail: '请输入有效的邮箱地址。',
114
+ mismatch: '两次输入的密码不一致。',
115
+ login: '登录',
116
+ send: '发送重置邮件',
117
+ resend: '重新发送邮件',
118
+ confirm: '确认并登录',
119
+ agreementPrefix: '我已阅读并同意',
120
+ agreementTitle: '阅读并同意协议',
121
+ agreementDescription: '请阅读并同意以下协议后继续。',
122
+ agree: '同意并继续',
123
+ cancel: '取消',
124
+ account: '登录账号',
125
+ acceptInvitation: '接受邀请'
126
+ };
127
+ const zh_CN = zh_CN_messages;
128
+ const MESSAGES = {
129
+ 'en-US': en_US,
130
+ 'zh-CN': zh_CN
131
+ };
132
+ function useAuthLabels(locale, labels) {
133
+ return resolveLocale(MESSAGES, useLocale(locale), labels);
134
+ }
135
+ export { Action, Field, useAuthLabels };
@@ -20,6 +20,8 @@ export type IconProps = Omit<ComponentPropsWithoutRef<'svg'>, 'children'>;
20
20
  */
21
21
  export type IconComponent = ComponentType<IconProps>;
22
22
  export declare const ArrowRightIcon: IconComponent;
23
+ export declare const ArrowUpRightIcon: IconComponent;
24
+ export declare const DirectoryTourFolderIcon: IconComponent;
23
25
  export declare const AudioIcon: IconComponent;
24
26
  export declare const ChevronRightIcon: IconComponent;
25
27
  export declare const DocumentIcon: IconComponent;
@@ -1,5 +1,5 @@
1
1
  import type { SVGProps } from 'react';
2
- export type VikingBotIconName = 'bulb' | 'book' | 'video' | 'report' | 'history' | 'newSession' | 'remove' | 'tool';
2
+ export type VikingBotIconName = 'bulb' | 'book' | 'video' | 'report' | 'history' | 'newSession' | 'remove' | 'tool' | 'contextFolder' | 'contextClose';
3
3
  /** Reference artwork and the local remove glyph. See packages/icons/README.md. */
4
4
  export declare function VikingBotIcon({ name, 'aria-label': ariaLabel, ...props }: SVGProps<SVGSVGElement> & {
5
5
  name: VikingBotIconName;
package/dist/icons.js CHANGED
@@ -1,2 +1,2 @@
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";
1
+ export { ActivityIcon, ArrowRightIcon, ArrowUpRightIcon, AudioIcon, ChevronRightIcon, DirectoryTourFolderIcon, 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
@@ -22,3 +22,15 @@ export { WikiDashboard } from './components/wiki-dashboard/index.js';
22
22
  export type { WikiDashboardProps } from './components/wiki-dashboard/index.js';
23
23
  export { ExperienceDashboard } from './components/experience-dashboard/index.js';
24
24
  export type { ExperienceDashboardProps } from './components/experience-dashboard/index.js';
25
+ export { EmailLoginForm } from './components/email-login-form/index.js';
26
+ export type { EmailLoginFormProps } from './components/email-login-form/index.js';
27
+ export { ApiKeyLoginForm } from './components/api-key-login-form/index.js';
28
+ export type { ApiKeyLoginFormProps } from './components/api-key-login-form/index.js';
29
+ export { PasswordResetRequestForm } from './components/password-reset-request-form/index.js';
30
+ export type { PasswordResetRequestFormProps } from './components/password-reset-request-form/index.js';
31
+ export { PasswordSetupForm } from './components/password-setup-form/index.js';
32
+ export type { PasswordSetupFormProps } from './components/password-setup-form/index.js';
33
+ export { LoginMethodSelector } from './components/login-method-selector/index.js';
34
+ export type { LoginMethodSelectorProps } from './components/login-method-selector/index.js';
35
+ export { InvitationConfirmation } from './components/invitation-confirmation/index.js';
36
+ export type { InvitationConfirmationProps } from './components/invitation-confirmation/index.js';
package/dist/index.js CHANGED
@@ -1,12 +1,18 @@
1
1
  export { AgentConnect } from "./u~0.js";
2
+ export { ApiKeyLoginForm } from "./p~0.js";
2
3
  export { Console } from "./a~0.js";
3
4
  export { DirectoryTour } from "./ep~0.js";
5
+ export { EmailLoginForm } from "./l~0.js";
4
6
  export { ExperienceDashboard } from "./fl~0.js";
5
- export { FileBrowser } from "./l~0.js";
7
+ export { FileBrowser } from "./l5~0.js";
6
8
  export { FileBrowserEntries } from "./2~0.js";
7
9
  export { FileTree } from "./n~0.js";
10
+ export { InvitationConfirmation } from "./1~0.js";
11
+ export { LoginMethodSelector } from "./d~0.js";
12
+ export { PasswordResetRequestForm } from "./6~0.js";
13
+ export { PasswordSetupForm } from "./f~0.js";
8
14
  export { ScopeCascade } from "./lk~0.js";
9
- export { ScopeSelector, ScopeSwitcher } from "./f~0.js";
15
+ export { ScopeSelector, ScopeSwitcher } from "./fi~0.js";
10
16
  export { Tui } from "./3c~0.js";
11
17
  export { VikingBot } from "./c~0.js";
12
18
  export { WikiDashboard } from "./fj~0.js";