@box/metadata-editor 0.98.10 → 0.99.1
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/dist/chunks/filter-dropdown-menu.module.js +11 -11
- package/dist/chunks/metadata-instance-form-card-wrapper.js +7 -7
- package/dist/chunks/utils2.js +22 -22
- package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +33 -33
- package/dist/esm/lib/components/interactive-header-text/interactive-header-text.js +6 -6
- package/dist/esm/lib/components/interactive-text/interactive-text.js +7 -7
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +17 -17
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +28 -28
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +16 -16
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +10 -10
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +12 -12
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +19 -19
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +9 -9
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +17 -17
- package/dist/i18n/en-x-pseudo.js +122 -122
- package/dist/i18n/en-x-pseudo.properties +122 -122
- package/dist/i18n/it-IT.js +1 -1
- package/dist/i18n/it-IT.properties +1 -1
- package/dist/i18n/nl-NL.js +2 -2
- package/dist/i18n/nl-NL.properties +2 -2
- package/dist/styles/ai-suggestion-field.css +1 -1
- package/dist/styles/autofill-overlay.css +1 -1
- package/dist/styles/custom-instance-new-field.css +1 -1
- package/dist/styles/filter-dropdown-menu.css +1 -1
- package/dist/styles/filter-instances-dropdown.css +1 -1
- package/dist/styles/interactive-header-text.css +1 -1
- package/dist/styles/interactive-text.css +1 -1
- package/dist/styles/metadata-instance-footer.css +1 -1
- package/dist/styles/metadata-instance-form-autofill-button.css +1 -1
- package/dist/styles/metadata-instance-form-card-wrapper.css +1 -1
- package/dist/styles/metadata-instance-form-footer.css +1 -1
- package/dist/styles/metadata-instance-form-header.css +1 -1
- package/dist/styles/metadata-instance-header.css +1 -1
- package/dist/styles/utils.css +1 -1
- package/package.json +4 -4
@@ -1,17 +1,17 @@
|
|
1
|
-
import '../styles/filter-dropdown-menu.css';const c = "
|
1
|
+
import '../styles/filter-dropdown-menu.css';const c = "_content_3uvu2_1", e = "_scrollableContainer_3uvu2_20", o = "_item_3uvu2_25", t = "_option_3uvu2_35", n = "_search_3uvu2_56", _ = "_searchIcon_3uvu2_61", a = "_global_3uvu2_70", r = "_clearSearchIcon_3uvu2_75", s = "_searchInput_3uvu2_83", i = "_firefoxDefaultOpacityFix_3uvu2_115", u = "_divider_3uvu2_133", l = "_searchDivider_3uvu2_137", v = {
|
2
2
|
content: c,
|
3
3
|
scrollableContainer: e,
|
4
|
-
item:
|
5
|
-
option:
|
6
|
-
search:
|
7
|
-
searchIcon:
|
8
|
-
global:
|
9
|
-
clearSearchIcon:
|
10
|
-
searchInput:
|
4
|
+
item: o,
|
5
|
+
option: t,
|
6
|
+
search: n,
|
7
|
+
searchIcon: _,
|
8
|
+
global: a,
|
9
|
+
clearSearchIcon: r,
|
10
|
+
searchInput: s,
|
11
11
|
firefoxDefaultOpacityFix: i,
|
12
|
-
divider:
|
13
|
-
searchDivider:
|
12
|
+
divider: u,
|
13
|
+
searchDivider: l
|
14
14
|
};
|
15
15
|
export {
|
16
|
-
|
16
|
+
v as s
|
17
17
|
};
|
@@ -4,7 +4,7 @@ import { TEMPLATE_CUSTOM_PROPERTIES as w } from "../esm/lib/constants.js";
|
|
4
4
|
import { MetadataInstanceFormFooter as A } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js";
|
5
5
|
import { MetadataInstanceFormHeader as E } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
|
6
6
|
import { jsx as t, jsxs as M } from "react/jsx-runtime";
|
7
|
-
import '../styles/metadata-instance-form-card-wrapper.css';const b = "
|
7
|
+
import '../styles/metadata-instance-form-card-wrapper.css';const b = "_metadataInstanceForm_1e6l2_1", v = "_wrapperGradient_1e6l2_7", D = "_suggestionsFetching_1e6l2_12", I = "_metadataInstanceFormContent_1e6l2_18", L = "_showOverlay_1e6l2_25", s = {
|
8
8
|
metadataInstanceForm: b,
|
9
9
|
wrapperGradient: v,
|
10
10
|
suggestionsFetching: D,
|
@@ -17,9 +17,9 @@ import '../styles/metadata-instance-form-card-wrapper.css';const b = "_metadataI
|
|
17
17
|
className: i,
|
18
18
|
formRef: g,
|
19
19
|
isAiSuggestionsFeatureEnabled: m,
|
20
|
-
isBetaLanguageEnabled:
|
21
|
-
isLargeFile:
|
22
|
-
isDeleteButtonDisabled:
|
20
|
+
isBetaLanguageEnabled: l,
|
21
|
+
isLargeFile: d = !1,
|
22
|
+
isDeleteButtonDisabled: c,
|
23
23
|
suggestions: F,
|
24
24
|
isFetchingSuggestions: e,
|
25
25
|
isFormDirty: u = !1,
|
@@ -39,13 +39,13 @@ import '../styles/metadata-instance-form-card-wrapper.css';const b = "_metadataI
|
|
39
39
|
areAiSuggestionsAvailable: o,
|
40
40
|
hasSuggestions: C,
|
41
41
|
isAiSuggestionsFeatureEnabled: m && !f,
|
42
|
-
isBetaLanguageEnabled:
|
43
|
-
isLargeFile:
|
42
|
+
isBetaLanguageEnabled: l,
|
43
|
+
isLargeFile: d,
|
44
44
|
isLoading: e,
|
45
45
|
onAutofill: _,
|
46
46
|
templateName: a == null ? void 0 : a.displayName
|
47
47
|
}), a && r, /* @__PURE__ */ t(A, {
|
48
|
-
isDeleteButtonDisabled:
|
48
|
+
isDeleteButtonDisabled: c,
|
49
49
|
isLoading: e,
|
50
50
|
onCancel: () => p(u),
|
51
51
|
onDelete: h
|
package/dist/chunks/utils2.js
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
import { BoxAiLogo as
|
2
|
-
import
|
3
|
-
import { convertISOStringToUTCDate as
|
4
|
-
import { jsxs as
|
5
|
-
import '../styles/utils.css';const
|
6
|
-
noAttributesText:
|
7
|
-
fieldWrapper:
|
8
|
-
hasSuggestion:
|
1
|
+
import { BoxAiLogo as n } from "@box/blueprint-web-assets/icons/Logo";
|
2
|
+
import i from "../esm/lib/components/interactive-text/interactive-text.js";
|
3
|
+
import { convertISOStringToUTCDate as c } from "../esm/lib/utils/convertDate.js";
|
4
|
+
import { jsxs as _, jsx as o } from "react/jsx-runtime";
|
5
|
+
import '../styles/utils.css';const b = "_noAttributesText_1wv72_2", p = "_fieldWrapper_1wv72_6", g = "_hasSuggestion_1wv72_11", x = "_error_1wv72_19", d = "_dateField_1wv72_31", m = "_suggestionApplied_1wv72_35", u = "_comboboxContainer_1wv72_35", v = "_labelWrapper_1wv72_49", T = "_labelText_1wv72_55", w = "_labelIcon_1wv72_58", t = {
|
6
|
+
noAttributesText: b,
|
7
|
+
fieldWrapper: p,
|
8
|
+
hasSuggestion: g,
|
9
9
|
error: x,
|
10
10
|
dateField: d,
|
11
11
|
suggestionApplied: m,
|
12
12
|
comboboxContainer: u,
|
13
|
-
labelWrapper:
|
14
|
-
labelText:
|
15
|
-
labelIcon:
|
16
|
-
},
|
13
|
+
labelWrapper: v,
|
14
|
+
labelText: T,
|
15
|
+
labelIcon: w
|
16
|
+
}, W = (e, r, a = !1, s = "label") => (l) => /* @__PURE__ */ _("div", {
|
17
17
|
className: t.labelWrapper,
|
18
|
-
children: [
|
19
|
-
as:
|
18
|
+
children: [r ? /* @__PURE__ */ o(i, {
|
19
|
+
as: s,
|
20
20
|
className: t.labelText,
|
21
|
-
tooltipText:
|
22
|
-
...
|
21
|
+
tooltipText: r,
|
22
|
+
...l,
|
23
23
|
children: e
|
24
24
|
}) : /* @__PURE__ */ o("label", {
|
25
25
|
className: t.labelText,
|
26
|
-
...
|
26
|
+
...l,
|
27
27
|
children: e
|
28
|
-
}),
|
28
|
+
}), a && /* @__PURE__ */ o(n, {
|
29
29
|
className: t.labelIcon
|
30
30
|
})]
|
31
|
-
}),
|
31
|
+
}), f = (e) => {
|
32
32
|
try {
|
33
|
-
return
|
33
|
+
return c(e).toISOString();
|
34
34
|
} catch {
|
35
35
|
return null;
|
36
36
|
}
|
37
37
|
};
|
38
38
|
export {
|
39
|
-
|
39
|
+
W as g,
|
40
40
|
t as s,
|
41
|
-
|
41
|
+
f as t
|
42
42
|
};
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { TriggerButton as
|
2
|
-
import { useIntl as
|
3
|
-
import { SelectProvider as
|
1
|
+
import { TriggerButton as f, Text as v, ScrollableContainer as C, Divider as N } from "@box/blueprint-web";
|
2
|
+
import { useIntl as x } from "react-intl";
|
3
|
+
import { SelectProvider as B, Select as I, SelectPopover as k, SelectItem as g, SelectItemCheck as M } from "@ariakit/react";
|
4
4
|
import { Space1 as S } from "@box/blueprint-web-assets/tokens/px-tokens";
|
5
5
|
import { useEffect as y } from "react";
|
6
6
|
import D from "clsx";
|
7
7
|
import { Checkmark as p } from "@box/blueprint-web-assets/icons/Fill";
|
8
8
|
import { getVisibleTemplates as j, getTemplateDisplayName as _ } from "../../utils/utils.js";
|
9
9
|
import s from "./messages.js";
|
10
|
-
import { jsxs as o, jsx as
|
11
|
-
import '../../../../styles/filter-instances-dropdown.css';const w = "
|
10
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
11
|
+
import '../../../../styles/filter-instances-dropdown.css';const w = "_details_18edb_1", F = "_triggerContainer_18edb_5", O = "_triggerButton_18edb_10", P = "_popover_18edb_16", L = "_divider_18edb_33", V = "_scrollableContainer_18edb_36", z = "_item_18edb_40", E = "_indicator_18edb_67", G = "_indicatorIcon_18edb_76", R = "_testContainer_18edb_80", e = {
|
12
12
|
details: w,
|
13
13
|
triggerContainer: F,
|
14
14
|
triggerButton: O,
|
@@ -21,69 +21,69 @@ import '../../../../styles/filter-instances-dropdown.css';const w = "_details_19
|
|
21
21
|
testContainer: R
|
22
22
|
}, q = parseInt(S, 10);
|
23
23
|
function $({
|
24
|
-
appliedTemplates:
|
24
|
+
appliedTemplates: u,
|
25
25
|
selectedTemplates: c,
|
26
26
|
setSelectedTemplates: l
|
27
27
|
}) {
|
28
|
-
const a =
|
28
|
+
const a = x(), m = a.formatMessage(s.customMetadataName), n = j(u), i = c.length, d = n.length, b = i === 0 ? a.formatMessage(s.allTemplatesTriggerButtonText) : a.formatMessage(s.selectedTemplatesTriggerButtonText, {
|
29
29
|
selectedTemplatesNumber: i,
|
30
|
-
visibleTemplatesNumber:
|
30
|
+
visibleTemplatesNumber: d
|
31
31
|
}), h = () => {
|
32
32
|
l([]);
|
33
33
|
};
|
34
34
|
return y(() => {
|
35
|
-
i ===
|
36
|
-
}, [i,
|
35
|
+
i === d && l([]);
|
36
|
+
}, [i, d]), /* @__PURE__ */ o(B, {
|
37
37
|
setValue: l,
|
38
38
|
value: c,
|
39
39
|
children: [/* @__PURE__ */ o("div", {
|
40
|
-
className:
|
41
|
-
children: [/* @__PURE__ */
|
42
|
-
render: /* @__PURE__ */
|
40
|
+
className: e.triggerContainer,
|
41
|
+
children: [/* @__PURE__ */ t(I, {
|
42
|
+
render: /* @__PURE__ */ t(f, {
|
43
43
|
caretDirection: "down",
|
44
|
-
className:
|
45
|
-
label:
|
44
|
+
className: e.triggerButton,
|
45
|
+
label: b,
|
46
46
|
size: "small",
|
47
47
|
variant: "tertiary",
|
48
48
|
"data-target-id": "TriggerButton-allTemplatesTriggerButtonText|selectedTemplatesTriggerButtonText"
|
49
49
|
})
|
50
|
-
}), n.length > 0 && /* @__PURE__ */
|
50
|
+
}), n.length > 0 && /* @__PURE__ */ t(v, {
|
51
51
|
as: "p",
|
52
|
-
className:
|
52
|
+
className: e.details,
|
53
53
|
color: "textOnLightSecondary",
|
54
54
|
"data-testid": "detailsList",
|
55
55
|
variant: "caption",
|
56
|
-
children: n.filter((r) => c.some((T) => T === r.id)).map((r) => _(r,
|
56
|
+
children: n.filter((r) => c.some((T) => T === r.id)).map((r) => _(r, m)).join(", ")
|
57
57
|
})]
|
58
|
-
}), /* @__PURE__ */
|
59
|
-
className:
|
58
|
+
}), /* @__PURE__ */ t(k, {
|
59
|
+
className: e.popover,
|
60
60
|
gutter: q,
|
61
|
-
children: /* @__PURE__ */ o(
|
62
|
-
className:
|
61
|
+
children: /* @__PURE__ */ o(C, {
|
62
|
+
className: e.scrollableContainer,
|
63
63
|
children: [/* @__PURE__ */ o(g, {
|
64
64
|
autoFocus: i === 0,
|
65
|
-
className:
|
65
|
+
className: e.item,
|
66
66
|
hideOnClick: !0,
|
67
67
|
onClick: h,
|
68
|
-
children: [i === 0 && /* @__PURE__ */
|
69
|
-
className: D(
|
68
|
+
children: [i === 0 && /* @__PURE__ */ t(p, {
|
69
|
+
className: D(e.indicator, e.indicatorIcon)
|
70
70
|
}), a.formatMessage(s.allTemplatesTriggerButtonText)]
|
71
|
-
}), /* @__PURE__ */
|
72
|
-
className:
|
71
|
+
}), /* @__PURE__ */ t(N, {
|
72
|
+
className: e.divider
|
73
73
|
}), n.map((r) => /* @__PURE__ */ o(g, {
|
74
|
-
className:
|
74
|
+
className: e.item,
|
75
75
|
hideOnClick: !0,
|
76
76
|
value: r.id,
|
77
|
-
children: [/* @__PURE__ */
|
78
|
-
className:
|
77
|
+
children: [/* @__PURE__ */ t(M, {
|
78
|
+
className: e.indicator,
|
79
79
|
style: {
|
80
80
|
width: "none",
|
81
81
|
height: "none"
|
82
82
|
},
|
83
|
-
children: /* @__PURE__ */
|
84
|
-
className:
|
83
|
+
children: /* @__PURE__ */ t(p, {
|
84
|
+
className: e.indicatorIcon
|
85
85
|
})
|
86
|
-
}), _(r,
|
86
|
+
}), _(r, m)]
|
87
87
|
}, r.id))]
|
88
88
|
})
|
89
89
|
})]
|
@@ -1,22 +1,22 @@
|
|
1
1
|
import { Focusable as l } from "@ariakit/react";
|
2
2
|
import { useFullTextTooltip as n, Text as i } from "@box/blueprint-web";
|
3
3
|
import m from "clsx";
|
4
|
-
import { useRef as
|
5
|
-
import { jsx as e, Fragment as
|
6
|
-
import '../../../../styles/interactive-header-text.css';const
|
7
|
-
header:
|
4
|
+
import { useRef as c } from "react";
|
5
|
+
import { jsx as e, Fragment as d } from "react/jsx-runtime";
|
6
|
+
import '../../../../styles/interactive-header-text.css';const p = "_header_qqeyd_1", f = {
|
7
|
+
header: p
|
8
8
|
}, _ = ({
|
9
9
|
className: o,
|
10
10
|
title: r
|
11
11
|
}) => {
|
12
|
-
const t =
|
12
|
+
const t = c(null), {
|
13
13
|
Wrapper: a,
|
14
14
|
wrapperProps: s
|
15
15
|
} = n({
|
16
16
|
ref: t,
|
17
17
|
textValue: r
|
18
18
|
});
|
19
|
-
return /* @__PURE__ */ e(
|
19
|
+
return /* @__PURE__ */ e(d, {
|
20
20
|
children: /* @__PURE__ */ e(a, {
|
21
21
|
...s,
|
22
22
|
children: /* @__PURE__ */ e(l, {
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { Focusable as o } from "@ariakit/react";
|
2
2
|
import { Tooltip as a, Text as s } from "@box/blueprint-web";
|
3
|
-
import
|
3
|
+
import l from "clsx";
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
5
|
-
import '../../../../styles/interactive-text.css';const
|
6
|
-
interactiveText:
|
5
|
+
import '../../../../styles/interactive-text.css';const m = "_interactiveText_1i8lr_1", x = {
|
6
|
+
interactiveText: m
|
7
7
|
}, _ = ({
|
8
8
|
tooltipText: r,
|
9
|
-
className:
|
10
|
-
children:
|
9
|
+
className: i,
|
10
|
+
children: c,
|
11
11
|
...e
|
12
12
|
}) => {
|
13
13
|
const {
|
@@ -19,9 +19,9 @@ import '../../../../styles/interactive-text.css';const x = "_interactiveText_2jv
|
|
19
19
|
children: /* @__PURE__ */ t(o, {
|
20
20
|
render: /* @__PURE__ */ t(s, {
|
21
21
|
as: n,
|
22
|
-
className:
|
22
|
+
className: l(x.interactiveText, i),
|
23
23
|
...e,
|
24
|
-
children:
|
24
|
+
children: c
|
25
25
|
})
|
26
26
|
})
|
27
27
|
});
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { Text as
|
2
|
-
import { Checkmark as
|
1
|
+
import { Text as l, IconButton as c, DropdownMenu as a } from "@box/blueprint-web";
|
2
|
+
import { Checkmark as u, Ellipsis as f } from "@box/blueprint-web-assets/icons/Fill";
|
3
3
|
import { useIntl as I, FormattedMessage as r } from "react-intl";
|
4
4
|
import t from "./messages.js";
|
5
5
|
import { formatSuggestionValue as w } from "./utils.js";
|
6
|
-
import { jsx as e, jsxs as i, Fragment as
|
7
|
-
import '../../../../../../styles/ai-suggestion-field.css';const C = "
|
6
|
+
import { jsx as e, jsxs as i, Fragment as m } from "react/jsx-runtime";
|
7
|
+
import '../../../../../../styles/ai-suggestion-field.css';const C = "_wrapperGradient_z7sut_1", _ = "_wrapper_z7sut_1", b = "_buttons_z7sut_18", x = "_selectTrigger_z7sut_22", o = {
|
8
8
|
wrapperGradient: C,
|
9
9
|
wrapper: _,
|
10
10
|
buttons: b,
|
11
|
-
selectTrigger:
|
11
|
+
selectTrigger: x
|
12
12
|
};
|
13
13
|
function N({
|
14
14
|
aiSuggestion: S,
|
@@ -18,13 +18,13 @@ function N({
|
|
18
18
|
type: n,
|
19
19
|
isSameValue: h
|
20
20
|
}) {
|
21
|
-
const
|
21
|
+
const s = I();
|
22
22
|
return /* @__PURE__ */ e("div", {
|
23
23
|
className: o.wrapperGradient,
|
24
24
|
children: /* @__PURE__ */ e("div", {
|
25
25
|
className: o.wrapper,
|
26
|
-
children: h ? /* @__PURE__ */ i(
|
27
|
-
children: [/* @__PURE__ */ e(
|
26
|
+
children: h ? /* @__PURE__ */ i(m, {
|
27
|
+
children: [/* @__PURE__ */ e(l, {
|
28
28
|
as: "p",
|
29
29
|
color: "textOnLightSecondary",
|
30
30
|
variant: "caption",
|
@@ -34,42 +34,42 @@ function N({
|
|
34
34
|
}), /* @__PURE__ */ e("div", {
|
35
35
|
className: o.buttons,
|
36
36
|
children: /* @__PURE__ */ e(c, {
|
37
|
-
"aria-label":
|
38
|
-
icon:
|
37
|
+
"aria-label": s.formatMessage(t.aiSuggestionConfirm),
|
38
|
+
icon: u,
|
39
39
|
onClick: p,
|
40
40
|
size: "x-small",
|
41
41
|
"data-target-id": "IconButton-aiSuggestionConfirm"
|
42
42
|
})
|
43
43
|
})]
|
44
|
-
}) : /* @__PURE__ */ i(
|
44
|
+
}) : /* @__PURE__ */ i(m, {
|
45
45
|
children: [/* @__PURE__ */ i("div", {
|
46
|
-
children: [/* @__PURE__ */ e(
|
46
|
+
children: [/* @__PURE__ */ e(l, {
|
47
47
|
as: "p",
|
48
48
|
color: "textOnLightSecondary",
|
49
49
|
variant: "caption",
|
50
50
|
children: /* @__PURE__ */ e(r, {
|
51
51
|
...t.aiSuggestionCaption
|
52
52
|
})
|
53
|
-
}), /* @__PURE__ */ e(
|
53
|
+
}), /* @__PURE__ */ e(l, {
|
54
54
|
as: "p",
|
55
55
|
children: w(S, {
|
56
56
|
type: n,
|
57
|
-
locale:
|
57
|
+
locale: s.locale
|
58
58
|
})
|
59
59
|
})]
|
60
60
|
}), /* @__PURE__ */ i("div", {
|
61
61
|
className: o.buttons,
|
62
62
|
children: [/* @__PURE__ */ e(c, {
|
63
|
-
"aria-label":
|
63
|
+
"aria-label": s.formatMessage(n === "multiSelect" ? t.aiSuggestionAppend : t.aiSuggestionClearAndReplace),
|
64
64
|
"data-target-id": n === "multiSelect" ? "IconButton-aiSuggestionAppend" : "IconButton-aiSuggestionClearAndReplace",
|
65
|
-
icon:
|
65
|
+
icon: u,
|
66
66
|
onClick: n === "multiSelect" ? g : d,
|
67
67
|
size: "x-small"
|
68
68
|
}), /* @__PURE__ */ i(a.Root, {
|
69
69
|
children: [/* @__PURE__ */ e(a.Trigger, {
|
70
70
|
className: o.selectTrigger,
|
71
71
|
children: /* @__PURE__ */ e(c, {
|
72
|
-
"aria-label":
|
72
|
+
"aria-label": s.formatMessage(t.aiSuggestionOptions),
|
73
73
|
icon: f,
|
74
74
|
"data-target-id": "IconButton-aiSuggestionOptions"
|
75
75
|
})
|
@@ -3,57 +3,57 @@ import { LoadingIndicator as y, Text as n, TextButton as g } from "@box/blueprin
|
|
3
3
|
import { useIntl as v } from "react-intl";
|
4
4
|
import { AlertTriangle as _ } from "@box/blueprint-web-assets/icons/Line";
|
5
5
|
import { SurfaceStatusSurfaceError as p, Size5 as m } from "@box/blueprint-web-assets/tokens/tokens";
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import { jsxs as
|
9
|
-
import '../../../../../../styles/autofill-overlay.css';const O = "
|
6
|
+
import x from "clsx";
|
7
|
+
import i from "./messages.js";
|
8
|
+
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
9
|
+
import '../../../../../../styles/autofill-overlay.css';const O = "_autofillOverlay_1xnil_1", T = "_withError_1xnil_15", S = "_autofillOverlayTitle_1xnil_19", B = "_dismissButton_1xnil_24", I = "_overlayIcon_1xnil_28", M = "_testContainerStyle_1xnil_34", s = {
|
10
10
|
autofillOverlay: O,
|
11
11
|
withError: T,
|
12
12
|
autofillOverlayTitle: S,
|
13
|
-
dismissButton:
|
14
|
-
overlayIcon:
|
15
|
-
testContainerStyle:
|
16
|
-
},
|
17
|
-
errorCode:
|
13
|
+
dismissButton: B,
|
14
|
+
overlayIcon: I,
|
15
|
+
testContainerStyle: M
|
16
|
+
}, z = ({
|
17
|
+
errorCode: e,
|
18
18
|
isFetchingSuggestions: c,
|
19
|
-
isLongLoading:
|
19
|
+
isLongLoading: o
|
20
20
|
}) => {
|
21
21
|
const t = v(), [f, u] = d(!1);
|
22
|
-
let
|
23
|
-
|
24
|
-
const r =
|
25
|
-
return !c && !
|
26
|
-
className:
|
27
|
-
children: [
|
28
|
-
className:
|
22
|
+
let l = t.formatMessage(i.defaultLoadingMessage);
|
23
|
+
e && (l = t.formatMessage(i.errorTitle)), o && (l = t.formatMessage(i.longLoadingTitle));
|
24
|
+
const r = o ? t.formatMessage(i.longLoadingDescription) : e && t.formatMessage(i.errorDescription);
|
25
|
+
return !c && !e || f ? null : /* @__PURE__ */ h("div", {
|
26
|
+
className: x(s.autofillOverlay, e && s.withError),
|
27
|
+
children: [e ? /* @__PURE__ */ a(_, {
|
28
|
+
className: s.overlayIcon,
|
29
29
|
color: p,
|
30
30
|
height: m,
|
31
31
|
role: "presentation",
|
32
32
|
width: m
|
33
|
-
}) : /* @__PURE__ */
|
34
|
-
"aria-label": t.formatMessage(
|
33
|
+
}) : /* @__PURE__ */ a(y, {
|
34
|
+
"aria-label": t.formatMessage(i.loadingAriaLabel),
|
35
35
|
"aria-live": "polite",
|
36
|
-
className:
|
36
|
+
className: s.overlayIcon,
|
37
37
|
size: "large",
|
38
38
|
variant: "default"
|
39
|
-
}), /* @__PURE__ */
|
39
|
+
}), /* @__PURE__ */ a(n, {
|
40
40
|
as: "p",
|
41
|
-
className:
|
41
|
+
className: s.autofillOverlayTitle,
|
42
42
|
variant: "subtitle",
|
43
|
-
children:
|
44
|
-
}), r && /* @__PURE__ */
|
43
|
+
children: l
|
44
|
+
}), r && /* @__PURE__ */ a(n, {
|
45
45
|
as: "p",
|
46
46
|
color: "textOnLightSecondary",
|
47
47
|
variant: "bodyDefault",
|
48
48
|
children: r
|
49
|
-
}),
|
50
|
-
className:
|
49
|
+
}), e && /* @__PURE__ */ a(g, {
|
50
|
+
className: s.dismissButton,
|
51
51
|
onClick: () => u(!0),
|
52
52
|
"data-target-id": "TextButton-dismissButton",
|
53
|
-
children: t.formatMessage(
|
53
|
+
children: t.formatMessage(i.dismissButton)
|
54
54
|
})]
|
55
55
|
});
|
56
56
|
};
|
57
57
|
export {
|
58
|
-
|
58
|
+
z as AutofillOverlay
|
59
59
|
};
|
@@ -1,23 +1,23 @@
|
|
1
|
-
import { Card as
|
1
|
+
import { Card as y, TextInput as u, Button as m } from "@box/blueprint-web";
|
2
2
|
import { useState as l } from "react";
|
3
|
-
import { useIntl as
|
3
|
+
import { useIntl as v } from "react-intl";
|
4
4
|
import t from "./messages.js";
|
5
5
|
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
6
|
-
import '../../../../../../styles/custom-instance-new-field.css';const M = "
|
6
|
+
import '../../../../../../styles/custom-instance-new-field.css';const M = "_customInstanceNewFieldCard_fcftk_1", _ = "_customInstanceNewFieldFooter_fcftk_6", b = "_inputWrapper_fcftk_13", n = {
|
7
7
|
customInstanceNewFieldCard: M,
|
8
8
|
customInstanceNewFieldFooter: _,
|
9
9
|
inputWrapper: b
|
10
|
-
}, x = (
|
10
|
+
}, x = (f) => {
|
11
11
|
const {
|
12
|
-
onAdd:
|
13
|
-
onCancel:
|
12
|
+
onAdd: g,
|
13
|
+
onCancel: F,
|
14
14
|
formKeys: c = []
|
15
|
-
} =
|
16
|
-
|
17
|
-
},
|
18
|
-
r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) :
|
15
|
+
} = f, e = v(), [r, h] = l(""), [d, C] = l(""), [i, o] = l(""), N = c.length !== 0, I = (s) => {
|
16
|
+
h(s), i && o("");
|
17
|
+
}, w = () => {
|
18
|
+
r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) : g(r, d) : o(e.formatMessage(t.keyFieldRequiredError));
|
19
19
|
};
|
20
|
-
return /* @__PURE__ */ p(
|
20
|
+
return /* @__PURE__ */ p(y, {
|
21
21
|
"aria-label": e.formatMessage(t.addAttributeGroupAriaLabel),
|
22
22
|
className: n.customInstanceNewFieldCard,
|
23
23
|
"data-testid": "customInstanceNewField",
|
@@ -26,9 +26,9 @@ import '../../../../../../styles/custom-instance-new-field.css';const M = "_cust
|
|
26
26
|
className: n.inputWrapper,
|
27
27
|
children: /* @__PURE__ */ a(u, {
|
28
28
|
autoFocus: !0,
|
29
|
-
error:
|
29
|
+
error: i,
|
30
30
|
label: e.formatMessage(t.customKeyLabel),
|
31
|
-
onChange: (s) =>
|
31
|
+
onChange: (s) => I(s.target.value),
|
32
32
|
placeholder: e.formatMessage(t.customKeyPlaceholder),
|
33
33
|
required: !0,
|
34
34
|
value: r
|
@@ -39,17 +39,17 @@ import '../../../../../../styles/custom-instance-new-field.css';const M = "_cust
|
|
39
39
|
label: e.formatMessage(t.valueLabel),
|
40
40
|
onChange: (s) => C(s.target.value),
|
41
41
|
placeholder: e.formatMessage(t.valuePlaceholder),
|
42
|
-
value:
|
42
|
+
value: d
|
43
43
|
})
|
44
44
|
}), /* @__PURE__ */ p("div", {
|
45
45
|
className: n.customInstanceNewFieldFooter,
|
46
46
|
children: [N && /* @__PURE__ */ a(m, {
|
47
|
-
onClick:
|
47
|
+
onClick: F,
|
48
48
|
variant: "secondary",
|
49
49
|
"data-target-id": "Button-cancelCTA",
|
50
50
|
children: e.formatMessage(t.cancelCTA)
|
51
51
|
}), /* @__PURE__ */ a(m, {
|
52
|
-
onClick:
|
52
|
+
onClick: w,
|
53
53
|
variant: "primary",
|
54
54
|
"data-target-id": "Button-addNewFieldCTA",
|
55
55
|
children: e.formatMessage(t.addNewFieldCTA)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { LoadingIndicator as
|
1
|
+
import { LoadingIndicator as k, IconButton as v, Tooltip as x, Button as K } from "@box/blueprint-web";
|
2
2
|
import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
|
3
3
|
import { useFormikContext as L, getIn as i } from "formik";
|
4
4
|
import { useEffect as h } from "react";
|
@@ -6,7 +6,7 @@ import { useIntl as C } from "react-intl";
|
|
6
6
|
import { useAutofill as F } from "../../../../utils/autofill-context.js";
|
7
7
|
import n from "./messages.js";
|
8
8
|
import { jsx as l } from "react/jsx-runtime";
|
9
|
-
import '../../../../../../styles/metadata-instance-form-autofill-button.css';const T = "
|
9
|
+
import '../../../../../../styles/metadata-instance-form-autofill-button.css';const T = "_loadingIndicator_baqvi_1", _ = {
|
10
10
|
loadingIndicator: T
|
11
11
|
}, w = ({
|
12
12
|
areAiSuggestionsAvailable: B,
|
@@ -18,14 +18,14 @@ import '../../../../../../styles/metadata-instance-form-autofill-button.css';con
|
|
18
18
|
const {
|
19
19
|
isSubmitting: A,
|
20
20
|
values: e,
|
21
|
-
setFieldValue:
|
21
|
+
setFieldValue: m
|
22
22
|
} = L(), t = C(), {
|
23
23
|
suggestions: o
|
24
24
|
} = F();
|
25
25
|
h(() => {
|
26
26
|
if (o) {
|
27
27
|
const a = i(e, "metadata.fields"), r = i(e, "metadata.templateKey");
|
28
|
-
|
28
|
+
m("metadata.fields", a == null ? void 0 : a.map((s) => {
|
29
29
|
var g;
|
30
30
|
const f = (g = o == null ? void 0 : o[r]) == null ? void 0 : g[s.key];
|
31
31
|
return f ? {
|
@@ -34,18 +34,18 @@ import '../../../../../../styles/metadata-instance-form-autofill-button.css';con
|
|
34
34
|
} : s;
|
35
35
|
}));
|
36
36
|
}
|
37
|
-
}, [o,
|
38
|
-
const
|
37
|
+
}, [o, m]);
|
38
|
+
const u = () => {
|
39
39
|
const a = i(e, "metadata.templateKey"), r = i(e, "metadata.scope");
|
40
40
|
y(a, r);
|
41
|
-
}, d = !B || A || c, M = c ? /* @__PURE__ */ l(
|
41
|
+
}, d = !B || A || c, M = c ? /* @__PURE__ */ l(k, {
|
42
42
|
"aria-label": t.formatMessage(n.loadingButtonAriaLabel),
|
43
43
|
className: _.loadingIndicator
|
44
|
-
}) : /* @__PURE__ */ l(
|
44
|
+
}) : /* @__PURE__ */ l(v, {
|
45
45
|
"aria-label": t.formatMessage(n.autofillButtonAriaLabel),
|
46
46
|
disabled: d,
|
47
47
|
icon: p,
|
48
|
-
onClick:
|
48
|
+
onClick: u,
|
49
49
|
variant: "icon-logo",
|
50
50
|
"data-target-id": "IconButton-autofillButtonAriaLabel"
|
51
51
|
});
|
@@ -54,7 +54,7 @@ import '../../../../../../styles/metadata-instance-form-autofill-button.css';con
|
|
54
54
|
children: I === "secondary-button" ? /* @__PURE__ */ l(K, {
|
55
55
|
disabled: d,
|
56
56
|
icon: p,
|
57
|
-
onClick:
|
57
|
+
onClick: u,
|
58
58
|
variant: "secondary",
|
59
59
|
"data-target-id": "Button-autofillButton",
|
60
60
|
children: t.formatMessage(n.autofillButton)
|