@openviking/react 0.1.7 → 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.
- package/README.md +11 -1
- package/dist/1~0.js +57 -0
- package/dist/3~0.js +171 -5
- package/dist/5~0.js +181 -0
- package/dist/6~0.js +48 -0
- package/dist/components/agent-connect/style.css +4 -2
- package/dist/components/api-key-login-form/api-key-login-form.d.ts +2 -0
- package/dist/components/api-key-login-form/index.d.ts +3 -0
- package/dist/components/api-key-login-form/style.css +438 -0
- package/dist/components/api-key-login-form/style.js +0 -0
- package/dist/components/api-key-login-form/types.d.ts +7 -0
- package/dist/components/api-key-login-form.js +1 -0
- package/dist/components/directory-tour/directory-tour-intro.d.ts +3 -0
- package/dist/components/directory-tour/index.d.ts +2 -1
- package/dist/components/directory-tour/style.css +154 -26
- package/dist/components/directory-tour/tour-card.d.ts +14 -0
- package/dist/components/directory-tour/types.d.ts +24 -1
- package/dist/components/directory-tour/use-tour-anchor.d.ts +1 -0
- package/dist/components/directory-tour/use-tour-position.d.ts +4 -1
- package/dist/components/directory-tour/use-tour-theme.d.ts +2 -0
- package/dist/components/directory-tour.js +52 -1
- package/dist/components/email-login-form/email-login-form.d.ts +2 -0
- package/dist/components/email-login-form/index.d.ts +3 -0
- package/dist/components/email-login-form/style.css +438 -0
- package/dist/components/email-login-form/style.js +0 -0
- package/dist/components/email-login-form/types.d.ts +11 -0
- package/dist/components/email-login-form.js +1 -0
- package/dist/components/experience-dashboard/experience-impact.d.ts +3 -1
- package/dist/components/experience-dashboard/style.css +4 -2
- package/dist/components/file-browser-entries/style.css +12 -6
- package/dist/components/file-preview/file-preview-header.d.ts +4 -21
- package/dist/components/file-preview/file-preview-toolbar.d.ts +7 -0
- package/dist/components/file-preview/locales/en-US.d.ts +9 -0
- package/dist/components/file-preview/locales/zh-CN.d.ts +9 -0
- package/dist/components/file-preview/style.css +116 -2
- package/dist/components/file-preview/types.d.ts +14 -21
- package/dist/components/file-tree/style.css +4 -2
- package/dist/components/invitation-confirmation/index.d.ts +3 -0
- package/dist/components/invitation-confirmation/invitation-confirmation.d.ts +2 -0
- package/dist/components/invitation-confirmation/style.css +438 -0
- package/dist/components/invitation-confirmation/style.js +0 -0
- package/dist/components/invitation-confirmation/types.d.ts +20 -0
- package/dist/components/invitation-confirmation.js +1 -0
- package/dist/components/login-method-selector/index.d.ts +2 -0
- package/dist/components/login-method-selector/login-method-selector.d.ts +2 -0
- package/dist/components/login-method-selector/style.css +438 -0
- package/dist/components/login-method-selector/style.js +0 -0
- package/dist/components/login-method-selector/types.d.ts +14 -0
- package/dist/components/login-method-selector.js +1 -0
- package/dist/components/password-reset-request-form/index.d.ts +3 -0
- package/dist/components/password-reset-request-form/password-reset-request-form.d.ts +2 -0
- package/dist/components/password-reset-request-form/style.css +438 -0
- package/dist/components/password-reset-request-form/style.js +0 -0
- package/dist/components/password-reset-request-form/types.d.ts +13 -0
- package/dist/components/password-reset-request-form.js +1 -0
- package/dist/components/password-setup-form/index.d.ts +3 -0
- package/dist/components/password-setup-form/password-setup-form.d.ts +2 -0
- package/dist/components/password-setup-form/style.css +438 -0
- package/dist/components/password-setup-form/style.js +0 -0
- package/dist/components/password-setup-form/types.d.ts +10 -0
- package/dist/components/password-setup-form.js +1 -0
- package/dist/components/scope-switcher/style.css +4 -2
- package/dist/components/scope-switcher.js +1 -1
- package/dist/components/style.css +2966 -58
- package/dist/components/tui/style.css +8 -4
- package/dist/components/viking-bot/style.css +12 -6
- package/dist/components/wiki-dashboard/index.d.ts +1 -1
- package/dist/components/wiki-dashboard/style.css +16 -4
- package/dist/components/wiki-dashboard/types.d.ts +12 -16
- package/dist/components/wiki-dashboard/wiki-action-button.d.ts +2 -9
- package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +3 -10
- package/dist/d~0.js +28 -0
- package/dist/ep~0.js +281 -133
- package/dist/fi~0.js +339 -0
- package/dist/fj~0.js +32 -67
- package/dist/fl~0.js +3 -2
- package/dist/f~0.js +63 -326
- package/dist/g~0.js +135 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +8 -2
- package/dist/k~0.js +44 -4
- package/dist/l5~0.js +3813 -0
- package/dist/lk~0.js +1 -1
- package/dist/l~0.js +54 -3811
- package/dist/modules/console/style.css +28 -14
- package/dist/modules/file-browser/file-browser-detail-icons.d.ts +0 -6
- package/dist/modules/file-browser/file-browser-detail.d.ts +2 -23
- package/dist/modules/file-browser/file-browser.d.ts +1 -1
- package/dist/modules/file-browser/fs-file-editing.d.ts +4 -0
- package/dist/modules/file-browser/fs-preview-images.d.ts +3 -0
- package/dist/modules/file-browser/fs-read-file.d.ts +1 -1
- package/dist/modules/file-browser/style.css +156 -70
- package/dist/modules/file-browser/types.d.ts +2 -0
- package/dist/modules/file-browser/use-file-browser-acl.d.ts +1 -0
- package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +2 -4
- package/dist/modules/file-browser.js +1 -1
- package/dist/modules/scope-cascade/style.css +4 -2
- package/dist/modules/style.css +192 -88
- package/dist/n~0.js +1 -1
- package/dist/p0~0.js +27 -0
- package/dist/p~0.js +34 -25
- package/dist/shared/auth/agreements.d.ts +10 -0
- package/dist/shared/auth/fields.d.ts +15 -0
- package/dist/shared/auth/form-frame.d.ts +12 -0
- package/dist/shared/auth/locales/en-US.d.ts +24 -0
- package/dist/shared/auth/locales/zh-CN.d.ts +24 -0
- package/dist/shared/auth/types.d.ts +61 -0
- package/dist/shared/auth/use-auth-labels.d.ts +3 -0
- package/dist/shared/auth/use-form.d.ts +8 -0
- package/dist/style.css +3364 -350
- package/package.json +32 -2
package/dist/f~0.js
CHANGED
|
@@ -1,339 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
274
|
-
className: "ov-
|
|
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
|
-
|
|
38
|
+
/*#__PURE__*/ jsx("strong", {
|
|
39
|
+
children: account
|
|
40
|
+
}),
|
|
298
41
|
/*#__PURE__*/ jsx("span", {
|
|
299
|
-
|
|
300
|
-
"aria-hidden": "true",
|
|
301
|
-
children: /*#__PURE__*/ jsx(chevron_downreact, {})
|
|
42
|
+
children: labels.account
|
|
302
43
|
})
|
|
303
44
|
]
|
|
304
45
|
}),
|
|
305
|
-
|
|
306
|
-
id:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
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 };
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -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;
|
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 "./
|
|
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 "./
|
|
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";
|