@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.
- package/README.md +13 -1
- package/dist/1~0.js +57 -0
- package/dist/2~0.js +6 -5
- package/dist/3c~0.js +10 -4
- package/dist/3~0.js +189 -13
- package/dist/5~0.js +181 -0
- package/dist/6~0.js +48 -0
- package/dist/ae~0.js +8 -1
- package/dist/ark-message-list-view~0.js +9 -4
- package/dist/a~0.js +12 -6
- package/dist/c7r~0.js +50 -0
- package/dist/ck~0.js +3 -0
- package/dist/client/paths.d.ts +6 -0
- package/dist/client/provider.d.ts +6 -1
- package/dist/components/agent-connect/style.css +224 -35
- 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 +367 -39
- 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 +53 -2
- 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 +229 -12
- package/dist/components/experience-dashboard.js +1 -1
- package/dist/components/file-browser-entries/style.css +331 -80
- 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 +335 -76
- package/dist/components/file-preview/types.d.ts +14 -21
- package/dist/components/file-tree/file-tree-toolbar.d.ts +3 -3
- package/dist/components/file-tree/locales/en-US.d.ts +3 -0
- package/dist/components/file-tree/locales/zh-CN.d.ts +3 -0
- package/dist/components/file-tree/style.css +313 -86
- package/dist/components/file-tree/types.d.ts +13 -4
- 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 +368 -37
- package/dist/components/style.css +13071 -7474
- package/dist/components/tui/style.css +271 -35
- package/dist/components/viking-bot/interaction/style.css +143 -22
- package/dist/components/viking-bot/style.css +951 -295
- package/dist/components/wiki-dashboard/index.d.ts +1 -1
- package/dist/components/wiki-dashboard/style.css +241 -14
- 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/c~0.js +16 -8
- package/dist/d~0.js +28 -0
- package/dist/ep~0.js +493 -0
- package/dist/e~0.js +33 -328
- package/dist/fi~0.js +13 -28
- package/dist/fj~0.js +38 -69
- package/dist/fl~0.js +710 -0
- package/dist/f~0.js +61 -685
- 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 +9 -3
- package/dist/k~0.js +44 -4
- package/dist/l5~0.js +3813 -0
- package/dist/lk~0.js +5 -2
- package/dist/l~0.js +49 -2369
- package/dist/modules/console/style.css +1485 -351
- package/dist/modules/file-browser/acl/acl-add-principal.d.ts +12 -0
- package/dist/modules/file-browser/acl/acl-candidate.d.ts +8 -0
- package/dist/modules/file-browser/acl/acl-client.d.ts +13 -0
- package/dist/modules/file-browser/acl/acl-confirmation.d.ts +6 -0
- package/dist/modules/file-browser/acl/acl-entry.d.ts +13 -0
- package/dist/modules/file-browser/acl/acl-labels.d.ts +47 -0
- package/dist/modules/file-browser/acl/acl-menu.d.ts +10 -0
- package/dist/modules/file-browser/acl/acl-modal.d.ts +17 -0
- package/dist/modules/file-browser/acl/acl-model.d.ts +17 -0
- package/dist/modules/file-browser/acl/acl-principal-tabs.d.ts +6 -0
- package/dist/modules/file-browser/acl/acl-tag.d.ts +7 -0
- package/dist/modules/file-browser/acl/locales/en-US.d.ts +44 -0
- package/dist/modules/file-browser/acl/locales/zh-CN.d.ts +44 -0
- package/dist/modules/file-browser/acl/use-acl-principals.d.ts +17 -0
- package/dist/modules/file-browser/acl/use-acl-report.d.ts +27 -0
- package/dist/modules/file-browser/acl-types.d.ts +86 -0
- package/dist/modules/file-browser/dashboard-model.d.ts +3 -0
- package/dist/modules/file-browser/file-browser-detail-icons.d.ts +0 -6
- package/dist/modules/file-browser/file-browser-detail.d.ts +5 -23
- package/dist/modules/file-browser/file-browser-labels.d.ts +1 -1
- package/dist/modules/file-browser/file-browser-search.d.ts +20 -0
- package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -10
- package/dist/modules/file-browser/file-browser-tree-pane.d.ts +2 -6
- package/dist/modules/file-browser/file-browser.d.ts +1 -1
- package/dist/modules/file-browser/fs-directories.d.ts +1 -0
- package/dist/modules/file-browser/fs-file-editing.d.ts +4 -0
- package/dist/modules/file-browser/fs-model.d.ts +3 -1
- 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/index.d.ts +1 -0
- package/dist/modules/file-browser/locales/en-US.d.ts +5 -0
- package/dist/modules/file-browser/locales/zh-CN.d.ts +5 -0
- package/dist/modules/file-browser/style.css +2595 -703
- package/dist/modules/file-browser/types.d.ts +22 -20
- package/dist/modules/file-browser/use-file-browser-acl.d.ts +16 -0
- package/dist/modules/file-browser/use-file-browser.d.ts +5 -7
- package/dist/modules/file-browser/use-fs-tree.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 +537 -37
- package/dist/modules/style.css +12429 -8855
- package/dist/n~0.js +61 -37
- package/dist/p0~0.js +27 -0
- package/dist/p~0.js +34 -25
- package/dist/rt~0.js +107 -4
- package/dist/r~0.js +1 -1
- 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/shared/components/button/button.d.ts +20 -0
- package/dist/shared/components/input/input.d.ts +17 -0
- package/dist/shared/components/modal/locales/en-US.d.ts +4 -0
- package/dist/shared/components/modal/locales/zh-CN.d.ts +4 -0
- package/dist/shared/components/modal/modal.d.ts +2 -0
- package/dist/shared/components/modal/types.d.ts +18 -0
- package/dist/shared/components/overlay/lock-body-scroll.d.ts +1 -0
- package/dist/style.css +15477 -6258
- package/dist/s~0.js +16 -0
- package/dist/u~0.js +15 -6
- package/dist/viking-bot-composer~0.js +29 -11
- package/dist/viking-bot-interaction~0.js +2 -1
- package/package.json +34 -3
- package/dist/modules/file-browser/fs-selection.d.ts +0 -4
- package/dist/o~0.js +0 -106
package/dist/s~0.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgChevronDown = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: 14,
|
|
6
|
+
height: 14,
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 14 14",
|
|
9
|
+
...props,
|
|
10
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
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"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
const chevron_downreact = SvgChevronDown;
|
|
16
|
+
export { chevron_downreact };
|
package/dist/u~0.js
CHANGED
|
@@ -6,6 +6,7 @@ import rehype_sanitize from "rehype-sanitize";
|
|
|
6
6
|
import remark_gfm from "remark-gfm";
|
|
7
7
|
import { resolveLocale } from "./nx~0.js";
|
|
8
8
|
import { checkreact } from "./0~0.js";
|
|
9
|
+
import { button_Button } from "./e~0.js";
|
|
9
10
|
import { useLocale } from "./28~0.js";
|
|
10
11
|
const SvgCodexDetail = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
11
12
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -693,8 +694,11 @@ function AgentConnectCodeBlock({ display, copyText, language, locale, visibleBlo
|
|
|
693
694
|
/*#__PURE__*/ jsxs("div", {
|
|
694
695
|
className: "ov-agent-connect__code-actions",
|
|
695
696
|
children: [
|
|
696
|
-
hasKey ? /*#__PURE__*/ jsx(
|
|
697
|
-
|
|
697
|
+
hasKey ? /*#__PURE__*/ jsx(button_Button, {
|
|
698
|
+
size: "mini",
|
|
699
|
+
type: "text",
|
|
700
|
+
iconOnly: true,
|
|
701
|
+
htmlType: "button",
|
|
698
702
|
"aria-pressed": revealed,
|
|
699
703
|
"aria-label": revealLabel,
|
|
700
704
|
title: revealLabel,
|
|
@@ -703,8 +707,11 @@ function AgentConnectCodeBlock({ display, copyText, language, locale, visibleBlo
|
|
|
703
707
|
"aria-hidden": "true"
|
|
704
708
|
})
|
|
705
709
|
}) : null,
|
|
706
|
-
/*#__PURE__*/ jsx(
|
|
707
|
-
|
|
710
|
+
/*#__PURE__*/ jsx(button_Button, {
|
|
711
|
+
size: "mini",
|
|
712
|
+
type: "text",
|
|
713
|
+
iconOnly: true,
|
|
714
|
+
htmlType: "button",
|
|
708
715
|
disabled: 'pending' === status,
|
|
709
716
|
"aria-label": copyLabel,
|
|
710
717
|
title: copyLabel,
|
|
@@ -907,9 +914,11 @@ function AgentConnectInstructionsView({ instructions, apiKey, locale, agreementU
|
|
|
907
914
|
className: "ov-agent-connect__instructions-title",
|
|
908
915
|
children: labels.instructions
|
|
909
916
|
}),
|
|
910
|
-
/*#__PURE__*/ jsxs(
|
|
917
|
+
/*#__PURE__*/ jsxs(button_Button, {
|
|
918
|
+
size: "mini",
|
|
919
|
+
type: "text",
|
|
911
920
|
className: "ov-agent-connect__copy",
|
|
912
|
-
|
|
921
|
+
htmlType: "button",
|
|
913
922
|
disabled: 'pending' === status,
|
|
914
923
|
onClick: ()=>void copy(),
|
|
915
924
|
children: [
|
|
@@ -2,9 +2,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Sender } from "@ark-design/ui/sender";
|
|
3
3
|
import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { Tooltip } from "./rt~0.js";
|
|
5
|
+
import { button_Button } from "./e~0.js";
|
|
5
6
|
import { VikingBotIcon } from "./lg~0.js";
|
|
6
7
|
import { resolveVikingBotLabels, BotPopover, useQuickInput, QuickInputs } from "./c~0.js";
|
|
7
8
|
import { usePortalTheme } from "./9~0.js";
|
|
9
|
+
import { input_Input } from "./c7r~0.js";
|
|
8
10
|
import { FileTree as file_tree_FileTree } from "./n~0.js";
|
|
9
11
|
import { useLocale } from "./28~0.js";
|
|
10
12
|
const SvgSend = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
@@ -34,9 +36,13 @@ const attachreact = SvgAttach;
|
|
|
34
36
|
function VikingBotSubmit({ onSend, onStop, sending, tip, className, label, ...props }) {
|
|
35
37
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
36
38
|
content: tip ?? label,
|
|
37
|
-
children: /*#__PURE__*/ jsx(
|
|
39
|
+
children: /*#__PURE__*/ jsx(button_Button, {
|
|
38
40
|
...props,
|
|
39
|
-
|
|
41
|
+
size: "default",
|
|
42
|
+
type: "primary",
|
|
43
|
+
shape: "circle",
|
|
44
|
+
iconOnly: true,
|
|
45
|
+
htmlType: "button",
|
|
40
46
|
className: [
|
|
41
47
|
'ov-viking-bot__submit',
|
|
42
48
|
className
|
|
@@ -56,9 +62,12 @@ function VikingBotSubmit({ onSend, onStop, sending, tip, className, label, ...pr
|
|
|
56
62
|
function VikingBotAttach({ label, ...props }) {
|
|
57
63
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
58
64
|
content: label,
|
|
59
|
-
children: /*#__PURE__*/ jsx(
|
|
65
|
+
children: /*#__PURE__*/ jsx(button_Button, {
|
|
60
66
|
...props,
|
|
61
|
-
|
|
67
|
+
size: "mini",
|
|
68
|
+
type: "text",
|
|
69
|
+
iconOnly: true,
|
|
70
|
+
htmlType: "button",
|
|
62
71
|
className: "ov-viking-bot__attach",
|
|
63
72
|
"aria-label": label,
|
|
64
73
|
children: /*#__PURE__*/ jsx(attachreact, {
|
|
@@ -106,8 +115,11 @@ function ComposerAttachments({ items, onRemove, disabled, labels }) {
|
|
|
106
115
|
className: "ov-viking-bot__attachment-status",
|
|
107
116
|
children: item.errorMessage ?? labels.toolError
|
|
108
117
|
}) : null,
|
|
109
|
-
onRemove ? /*#__PURE__*/ jsx(
|
|
110
|
-
|
|
118
|
+
onRemove ? /*#__PURE__*/ jsx(button_Button, {
|
|
119
|
+
size: "mini",
|
|
120
|
+
type: "text",
|
|
121
|
+
iconOnly: true,
|
|
122
|
+
htmlType: "button",
|
|
111
123
|
"aria-label": `${labels.removeAttachment}: ${item.name}`,
|
|
112
124
|
disabled: disabled,
|
|
113
125
|
onClick: ()=>onRemove(item),
|
|
@@ -182,7 +194,7 @@ function ReferencePicker({ config, locale, query: externalQuery, editor, onSelec
|
|
|
182
194
|
htmlFor: id,
|
|
183
195
|
children: [
|
|
184
196
|
labels.searchReferences,
|
|
185
|
-
/*#__PURE__*/ jsx(
|
|
197
|
+
/*#__PURE__*/ jsx(input_Input, {
|
|
186
198
|
id: id,
|
|
187
199
|
type: "search",
|
|
188
200
|
value: search,
|
|
@@ -270,10 +282,13 @@ function ReferenceButton({ locale, config, disabled, labels, senderRef }) {
|
|
|
270
282
|
trigger: (props)=>/*#__PURE__*/ jsx(Tooltip, {
|
|
271
283
|
content: labels.reference,
|
|
272
284
|
disabled: true === props['aria-expanded'],
|
|
273
|
-
children: /*#__PURE__*/ jsx(
|
|
285
|
+
children: /*#__PURE__*/ jsx(button_Button, {
|
|
274
286
|
...props,
|
|
287
|
+
size: "mini",
|
|
288
|
+
type: "text",
|
|
289
|
+
iconOnly: true,
|
|
275
290
|
className: "ov-viking-bot__attach",
|
|
276
|
-
|
|
291
|
+
htmlType: "button",
|
|
277
292
|
"aria-label": labels.reference,
|
|
278
293
|
disabled: disabled,
|
|
279
294
|
children: "@"
|
|
@@ -304,8 +319,11 @@ function ReferenceTags({ config, labels, disabled }) {
|
|
|
304
319
|
children: item.name
|
|
305
320
|
})
|
|
306
321
|
}),
|
|
307
|
-
/*#__PURE__*/ jsx(
|
|
308
|
-
|
|
322
|
+
/*#__PURE__*/ jsx(button_Button, {
|
|
323
|
+
size: "mini",
|
|
324
|
+
type: "text",
|
|
325
|
+
iconOnly: true,
|
|
326
|
+
htmlType: "button",
|
|
309
327
|
disabled: disabled,
|
|
310
328
|
"aria-label": `${labels.removeReference}: ${item.name}`,
|
|
311
329
|
onClick: ()=>config.onChange(config.selected.filter((entry)=>entry.uri !== item.uri)),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { AskHuman } from "@ark-design/ui/ask-human";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { input_TextArea } from "./c7r~0.js";
|
|
4
5
|
import { useLocale } from "./28~0.js";
|
|
5
6
|
import { resolveInteractionLabels } from "./c7~0.js";
|
|
6
7
|
const toFields = (request, other)=>{
|
|
@@ -185,7 +186,7 @@ const TextInput = ({ request, label, disabled, onChange })=>/*#__PURE__*/ jsxs(F
|
|
|
185
186
|
request.description ? /*#__PURE__*/ jsx("p", {
|
|
186
187
|
children: request.description
|
|
187
188
|
}) : null,
|
|
188
|
-
/*#__PURE__*/ jsx(
|
|
189
|
+
/*#__PURE__*/ jsx(input_TextArea, {
|
|
189
190
|
className: "ov-viking-bot__interaction-input",
|
|
190
191
|
defaultValue: request.initialValue,
|
|
191
192
|
disabled: disabled,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openviking/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8-beta.10.1.g8e5299efeb0a",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"README.md",
|
|
18
|
-
"LICENSE.arco-design"
|
|
18
|
+
"LICENSE.arco-design",
|
|
19
|
+
"!dist/docs/**"
|
|
19
20
|
],
|
|
20
21
|
"sideEffects": [
|
|
21
22
|
"**/*.css"
|
|
@@ -106,7 +107,37 @@
|
|
|
106
107
|
"types": "./dist/components/experience-dashboard/index.d.ts",
|
|
107
108
|
"import": "./dist/components/experience-dashboard.js"
|
|
108
109
|
},
|
|
109
|
-
"./components/experience-dashboard/style.css": "./dist/components/experience-dashboard/style.css"
|
|
110
|
+
"./components/experience-dashboard/style.css": "./dist/components/experience-dashboard/style.css",
|
|
111
|
+
"./components/email-login-form": {
|
|
112
|
+
"types": "./dist/components/email-login-form/index.d.ts",
|
|
113
|
+
"import": "./dist/components/email-login-form.js"
|
|
114
|
+
},
|
|
115
|
+
"./components/email-login-form/style.css": "./dist/components/email-login-form/style.css",
|
|
116
|
+
"./components/api-key-login-form": {
|
|
117
|
+
"types": "./dist/components/api-key-login-form/index.d.ts",
|
|
118
|
+
"import": "./dist/components/api-key-login-form.js"
|
|
119
|
+
},
|
|
120
|
+
"./components/api-key-login-form/style.css": "./dist/components/api-key-login-form/style.css",
|
|
121
|
+
"./components/password-reset-request-form": {
|
|
122
|
+
"types": "./dist/components/password-reset-request-form/index.d.ts",
|
|
123
|
+
"import": "./dist/components/password-reset-request-form.js"
|
|
124
|
+
},
|
|
125
|
+
"./components/password-reset-request-form/style.css": "./dist/components/password-reset-request-form/style.css",
|
|
126
|
+
"./components/password-setup-form": {
|
|
127
|
+
"types": "./dist/components/password-setup-form/index.d.ts",
|
|
128
|
+
"import": "./dist/components/password-setup-form.js"
|
|
129
|
+
},
|
|
130
|
+
"./components/password-setup-form/style.css": "./dist/components/password-setup-form/style.css",
|
|
131
|
+
"./components/login-method-selector": {
|
|
132
|
+
"types": "./dist/components/login-method-selector/index.d.ts",
|
|
133
|
+
"import": "./dist/components/login-method-selector.js"
|
|
134
|
+
},
|
|
135
|
+
"./components/login-method-selector/style.css": "./dist/components/login-method-selector/style.css",
|
|
136
|
+
"./components/invitation-confirmation": {
|
|
137
|
+
"types": "./dist/components/invitation-confirmation/index.d.ts",
|
|
138
|
+
"import": "./dist/components/invitation-confirmation.js"
|
|
139
|
+
},
|
|
140
|
+
"./components/invitation-confirmation/style.css": "./dist/components/invitation-confirmation/style.css"
|
|
110
141
|
},
|
|
111
142
|
"scripts": {
|
|
112
143
|
"dev": "rslib build --watch",
|
package/dist/o~0.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { useEffect, useLayoutEffect, useState } from "react";
|
|
2
|
-
const usePositionEffect = "u" < typeof window ? useEffect : useLayoutEffect;
|
|
3
|
-
const OVERLAY_OFFSET = 6;
|
|
4
|
-
const VIEWPORT_MARGIN = 8;
|
|
5
|
-
const OPPOSITE = {
|
|
6
|
-
top: 'bottom',
|
|
7
|
-
bottom: 'top',
|
|
8
|
-
left: 'right',
|
|
9
|
-
right: 'left'
|
|
10
|
-
};
|
|
11
|
-
function resolvePosition(trigger, surface, placement, alignment = 'center') {
|
|
12
|
-
const viewportWidth = window.innerWidth;
|
|
13
|
-
const viewportHeight = window.innerHeight;
|
|
14
|
-
const fits = (side)=>{
|
|
15
|
-
if ('top' === side) return trigger.top - surface.height - OVERLAY_OFFSET >= VIEWPORT_MARGIN;
|
|
16
|
-
if ('bottom' === side) return trigger.bottom + surface.height + OVERLAY_OFFSET <= viewportHeight - VIEWPORT_MARGIN;
|
|
17
|
-
if ('left' === side) return trigger.left - surface.width - OVERLAY_OFFSET >= VIEWPORT_MARGIN;
|
|
18
|
-
return trigger.right + surface.width + OVERLAY_OFFSET <= viewportWidth - VIEWPORT_MARGIN;
|
|
19
|
-
};
|
|
20
|
-
const side = fits(placement) || !fits(OPPOSITE[placement]) ? placement : OPPOSITE[placement];
|
|
21
|
-
const clamp = (value, size, limit)=>Math.min(Math.max(value, VIEWPORT_MARGIN), limit - size - VIEWPORT_MARGIN);
|
|
22
|
-
if ('top' === side || 'bottom' === side) {
|
|
23
|
-
const top = 'top' === side ? trigger.top - surface.height - OVERLAY_OFFSET : trigger.bottom + OVERLAY_OFFSET;
|
|
24
|
-
const left = 'end' === alignment ? trigger.right - surface.width : trigger.left + trigger.width / 2 - surface.width / 2;
|
|
25
|
-
return {
|
|
26
|
-
top: clamp(top, surface.height, viewportHeight),
|
|
27
|
-
left: clamp(left, surface.width, viewportWidth),
|
|
28
|
-
placement: side
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const left = 'left' === side ? trigger.left - surface.width - OVERLAY_OFFSET : trigger.right + OVERLAY_OFFSET;
|
|
32
|
-
const top = trigger.top + trigger.height / 2 - surface.height / 2;
|
|
33
|
-
return {
|
|
34
|
-
top: clamp(top, surface.height, viewportHeight),
|
|
35
|
-
left: clamp(left, surface.width, viewportWidth),
|
|
36
|
-
placement: side
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function useOverlayPosition(open, triggerRef, surface, placement, alignment = 'center') {
|
|
40
|
-
const [position, setPosition] = useState({
|
|
41
|
-
top: 0,
|
|
42
|
-
left: 0,
|
|
43
|
-
placement
|
|
44
|
-
});
|
|
45
|
-
usePositionEffect(()=>{
|
|
46
|
-
if (!open) return;
|
|
47
|
-
const trigger = triggerRef.current;
|
|
48
|
-
if (!trigger || !surface) return;
|
|
49
|
-
const written = new Set();
|
|
50
|
-
const syncTheme = ()=>{
|
|
51
|
-
const triggerStyle = window.getComputedStyle(trigger);
|
|
52
|
-
const seen = new Set();
|
|
53
|
-
for (const name of Array.from(triggerStyle)){
|
|
54
|
-
if (!name.startsWith('--ov-ui-color-')) continue;
|
|
55
|
-
const value = triggerStyle.getPropertyValue(name).trim();
|
|
56
|
-
if (value) {
|
|
57
|
-
seen.add(name);
|
|
58
|
-
surface.style.setProperty(name, value);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
for (const name of written)if (!seen.has(name)) surface.style.removeProperty(name);
|
|
62
|
-
written.clear();
|
|
63
|
-
seen.forEach((name)=>written.add(name));
|
|
64
|
-
};
|
|
65
|
-
syncTheme();
|
|
66
|
-
const themeObserver = new MutationObserver(syncTheme);
|
|
67
|
-
const observerOptions = {
|
|
68
|
-
attributes: true,
|
|
69
|
-
attributeFilter: [
|
|
70
|
-
'class',
|
|
71
|
-
'style',
|
|
72
|
-
'data-theme'
|
|
73
|
-
]
|
|
74
|
-
};
|
|
75
|
-
for(let node = trigger; node; node = node.parentElement)themeObserver.observe(node, observerOptions);
|
|
76
|
-
const update = ()=>{
|
|
77
|
-
const triggerRect = trigger.getBoundingClientRect();
|
|
78
|
-
const surfaceRect = surface.getBoundingClientRect();
|
|
79
|
-
const next = resolvePosition(triggerRect, {
|
|
80
|
-
width: surfaceRect.width,
|
|
81
|
-
height: surfaceRect.height
|
|
82
|
-
}, placement, alignment);
|
|
83
|
-
setPosition((previous)=>previous.top === next.top && previous.left === next.left && previous.placement === next.placement ? previous : next);
|
|
84
|
-
};
|
|
85
|
-
update();
|
|
86
|
-
const observer = new ResizeObserver(update);
|
|
87
|
-
observer.observe(surface);
|
|
88
|
-
window.addEventListener('scroll', update, true);
|
|
89
|
-
window.addEventListener('resize', update);
|
|
90
|
-
return ()=>{
|
|
91
|
-
observer.disconnect();
|
|
92
|
-
themeObserver.disconnect();
|
|
93
|
-
written.forEach((name)=>surface.style.removeProperty(name));
|
|
94
|
-
window.removeEventListener('scroll', update, true);
|
|
95
|
-
window.removeEventListener('resize', update);
|
|
96
|
-
};
|
|
97
|
-
}, [
|
|
98
|
-
open,
|
|
99
|
-
placement,
|
|
100
|
-
surface,
|
|
101
|
-
triggerRef,
|
|
102
|
-
alignment
|
|
103
|
-
]);
|
|
104
|
-
return position;
|
|
105
|
-
}
|
|
106
|
-
export { useOverlayPosition };
|