@box/metadata-editor 2.2.32 → 2.3.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/add-metadata-template-dropdown-with-browser.js +34 -0
- package/dist/chunks/ai-suggestion-field.js +31 -31
- package/dist/chunks/autofill-overlay.js +13 -13
- package/dist/chunks/combobox-with-api-pagination.js +40 -40
- package/dist/chunks/custom-instance-new-field.js +13 -13
- package/dist/chunks/custom-instance.js +19 -19
- package/dist/chunks/delete-confirmation-modal.js +20 -20
- package/dist/chunks/filter-instances-dropdown.js +24 -24
- package/dist/chunks/interactive-header-text.js +8 -8
- package/dist/chunks/metadata-instance-entry.js +24 -24
- package/dist/chunks/metadata-instance-footer.js +7 -7
- package/dist/chunks/metadata-instance-form-ai-disclaimer.js +8 -8
- package/dist/chunks/metadata-instance-form-autofill-button.js +32 -32
- package/dist/chunks/metadata-instance-form-card-wrapper.js +10 -10
- package/dist/chunks/metadata-instance-form-footer.js +10 -10
- package/dist/chunks/metadata-instance-header.js +14 -14
- package/dist/chunks/metadata-instance.js +12 -12
- package/dist/chunks/taxonomy-ancestor-status-pill.js +21 -21
- package/dist/chunks/update-mode-field-wrapper.js +22 -22
- package/dist/chunks/utils.js +26 -26
- package/dist/esm/index.js +21 -20
- package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown-with-browser.js +2 -0
- package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +24 -2
- package/dist/esm/lib/components/add-metadata-template-dropdown/index.js +3 -2
- package/dist/esm/lib/components/add-metadata-template-dropdown/shared/dropdown-trigger.js +16 -0
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +5 -5
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.js +5 -5
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +12 -12
- package/dist/esm/lib/components/interactive-text/interactive-text.js +7 -7
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +11 -11
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +5 -5
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +17 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +11 -11
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +17 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +9 -9
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +10 -10
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +11 -11
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/legacy-metadata-taxonomy-field.js +11 -11
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-picker-field/metadata-taxonomy-picker-field.js +11 -11
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +33 -33
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +10 -10
- package/dist/esm/lib/components/metadata-empty-state/metadata-empty-state.js +12 -12
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +10 -10
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js +4 -4
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.js +6 -6
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +7 -7
- package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +16 -16
- package/dist/styles/add-metadata-template-dropdown-with-browser.css +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown-with-browser.d.ts +16 -0
- package/dist/types/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.d.ts +9 -1
- package/dist/types/lib/components/add-metadata-template-dropdown/index.d.ts +3 -1
- package/dist/types/lib/components/add-metadata-template-dropdown/shared/dropdown-trigger.d.ts +6 -0
- package/dist/types/lib/components/add-metadata-template-dropdown/types.d.ts +32 -22
- package/package.json +12 -12
- package/dist/chunks/add-metadata-template-dropdown.js +0 -84
- package/dist/styles/add-metadata-template-dropdown.css +0 -1
|
@@ -5,17 +5,17 @@ import { MetadataInstanceReviewNotice as r } from "../esm/lib/components/metadat
|
|
|
5
5
|
import { t as i } from "./metadata-instance-content.js";
|
|
6
6
|
import { t as a } from "./metadata-instance-footer.js";
|
|
7
7
|
import { t as o } from "./metadata-instance-header.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { useState as s } from "react";
|
|
9
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
import { Card as d, Divider as f } from "@box/blueprint-web";
|
|
11
11
|
import '../styles/metadata-instance.css';var p = {
|
|
12
12
|
topDivider: "_topDivider_1xnom_1",
|
|
13
13
|
reviewNotice: "_reviewNotice_1xnom_5",
|
|
14
14
|
bottomDivider: "_bottomDivider_1xnom_9"
|
|
15
15
|
}, m = ({ areAiSuggestionsAvailable: m, isAiSuggestionsFeatureEnabled: h, isBetaLanguageEnabled: g, onEdit: _, onSelectMetadataField: v, selectedMetadataFieldId: y, templateInstance: b, taxonomyNodeFetcher: x, isAdvancedExtractAgentEnabled: S = !1, isConfidenceScoreReviewEnabled: C = !1, isBoundingBoxEnabled: w = !1 }) => {
|
|
16
|
-
let T = b.fields, E = (e) => !e.value || Array.isArray(e.value) && e.value.length === 0, D = T.every(E), O = T.some(E), k = T.length > 0, A = n(T).length, j = C && A > 0 && b.canEdit, [M, N] =
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
16
|
+
let T = b.fields, E = (e) => !e.value || Array.isArray(e.value) && e.value.length === 0, D = T.every(E), O = T.some(E), k = T.length > 0, A = n(T).length, j = C && A > 0 && b.canEdit, [M, N] = s(!0), { getAiSuggestions: P } = t();
|
|
17
|
+
return /* @__PURE__ */ u(d, { children: [
|
|
18
|
+
/* @__PURE__ */ l(o, {
|
|
19
19
|
areAiSuggestionsAvailable: m,
|
|
20
20
|
canEdit: b.canEdit,
|
|
21
21
|
isAdvancedExtractAgentEnabled: S,
|
|
@@ -27,22 +27,22 @@ import '../styles/metadata-instance.css';var p = {
|
|
|
27
27
|
onEdit: () => _(b),
|
|
28
28
|
templateName: b?.displayName
|
|
29
29
|
}),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
j && /* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ l(f, { className: p.topDivider }),
|
|
31
|
+
j && /* @__PURE__ */ l("div", {
|
|
32
32
|
className: p.reviewNotice,
|
|
33
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ l(r, {
|
|
34
34
|
fieldsNeedingReviewCount: A,
|
|
35
35
|
onTextToggleClick: () => {
|
|
36
36
|
_(b, !0);
|
|
37
37
|
}
|
|
38
38
|
})
|
|
39
39
|
}),
|
|
40
|
-
M && D ? /* @__PURE__ */
|
|
40
|
+
M && D ? /* @__PURE__ */ l(e, {
|
|
41
41
|
isAnyEmptyValueHidden: k,
|
|
42
42
|
isBoxAiSuggestionsFeatureEnabled: h,
|
|
43
43
|
level: "instance",
|
|
44
44
|
onShowEmptyValues: () => N(!1)
|
|
45
|
-
}) : /* @__PURE__ */
|
|
45
|
+
}) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(i, {
|
|
46
46
|
isConfidenceScoreReviewEnabled: C,
|
|
47
47
|
isBoundingBoxEnabled: w,
|
|
48
48
|
onSelectMetadataField: v,
|
|
@@ -50,7 +50,7 @@ import '../styles/metadata-instance.css';var p = {
|
|
|
50
50
|
shouldHideEmptyValues: M,
|
|
51
51
|
taxonomyNodeFetcher: x,
|
|
52
52
|
templateInstance: b
|
|
53
|
-
}), O && /* @__PURE__ */
|
|
53
|
+
}), O && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(f, { className: p.bottomDivider }), /* @__PURE__ */ l(a, {
|
|
54
54
|
isAnyEmptyValueHidden: M,
|
|
55
55
|
onHideEmptyValues: () => N(!0),
|
|
56
56
|
onShowEmptyValues: () => N(!1)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { FormattedMessage as n, useIntl as r } from "react-intl";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { FilterChip as o, InlineNotice as s, LoadingIndicator as c, Popover as l, TextButton as u } from "@box/blueprint-web";
|
|
6
|
+
import { Loader as d } from "@box/blueprint-web-assets/icons/Fill";
|
|
7
7
|
import f from "lodash/orderBy";
|
|
8
8
|
import '../styles/taxonomy-ancestor-status-pill.css';var p = {
|
|
9
9
|
popoverContentContainer: "_popoverContentContainer_161fk_27",
|
|
@@ -22,7 +22,7 @@ import '../styles/taxonomy-ancestor-status-pill.css';var p = {
|
|
|
22
22
|
(e.key === "ArrowLeft" || e.key === "ArrowRight") && e.stopPropagation();
|
|
23
23
|
};
|
|
24
24
|
function _({ taxonomyNodeFetcher: _, scope: v, taxonomyKey: y, value: b, displayValue: x }) {
|
|
25
|
-
let { formatMessage: S } =
|
|
25
|
+
let { formatMessage: S } = r(), [C, w] = t([]), [T, E] = t(!1), [D, O] = t(!1), [k, A] = t(!1), j = f(C, (e) => e.level), M = async () => {
|
|
26
26
|
E(!0), O(!1), A(!0);
|
|
27
27
|
try {
|
|
28
28
|
w(await _(v, y, b));
|
|
@@ -32,10 +32,10 @@ function _({ taxonomyNodeFetcher: _, scope: v, taxonomyKey: y, value: b, display
|
|
|
32
32
|
E(!1);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ a(l.Root, {
|
|
36
36
|
onOpenChange: A,
|
|
37
37
|
open: k,
|
|
38
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ i(l.Trigger, { children: /* @__PURE__ */ i(o.ChipButton, {
|
|
39
39
|
"aria-checked": void 0,
|
|
40
40
|
className: p.taxonomyValueButton,
|
|
41
41
|
disabled: !_,
|
|
@@ -43,45 +43,45 @@ function _({ taxonomyNodeFetcher: _, scope: v, taxonomyKey: y, value: b, display
|
|
|
43
43
|
onKeyDown: g,
|
|
44
44
|
role: void 0,
|
|
45
45
|
value: x,
|
|
46
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ i(o.Label, {
|
|
47
47
|
className: p.taxonomyValueLabel,
|
|
48
48
|
children: x
|
|
49
49
|
})
|
|
50
|
-
}) }), /* @__PURE__ */
|
|
50
|
+
}) }), /* @__PURE__ */ i(l.ContentContainer, {
|
|
51
51
|
align: "start",
|
|
52
52
|
className: p.popoverContentContainer,
|
|
53
53
|
collisionPadding: m,
|
|
54
54
|
onEscapeKeyDown: h,
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ a(l.MainContent, {
|
|
56
56
|
className: p.popoverMainContent,
|
|
57
57
|
children: [
|
|
58
|
-
D && /* @__PURE__ */
|
|
58
|
+
D && /* @__PURE__ */ a("div", {
|
|
59
59
|
className: p.errorMessageWrapper,
|
|
60
|
-
children: [/* @__PURE__ */
|
|
60
|
+
children: [/* @__PURE__ */ i(s, {
|
|
61
61
|
variant: "error",
|
|
62
62
|
variantIconAriaLabel: S(e.loadingResultsErrorIconLabel),
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
}), /* @__PURE__ */ u
|
|
63
|
+
children: /* @__PURE__ */ i(n, { ...e.loadingResultsErrorMessage })
|
|
64
|
+
}), /* @__PURE__ */ i(u, {
|
|
65
65
|
className: p.errorMessageWrapperText,
|
|
66
|
-
icon:
|
|
66
|
+
icon: d,
|
|
67
67
|
onClick: M,
|
|
68
68
|
"data-target-id": "TextButton-loadingResultsErrorAction",
|
|
69
69
|
children: S(e.loadingResultsErrorAction)
|
|
70
70
|
})]
|
|
71
71
|
}),
|
|
72
|
-
T && /* @__PURE__ */
|
|
72
|
+
T && /* @__PURE__ */ i("div", {
|
|
73
73
|
className: p.loadingIndicatorWrapper,
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ i(c, {
|
|
75
75
|
"aria-label": S(e.loadingAriaLabel),
|
|
76
76
|
size: "large"
|
|
77
77
|
})
|
|
78
78
|
}),
|
|
79
|
-
!D && !T && /* @__PURE__ */
|
|
79
|
+
!D && !T && /* @__PURE__ */ i("table", {
|
|
80
80
|
className: p.taxonomyAncestorTable,
|
|
81
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ i("tbody", { children: j.map((t) => /* @__PURE__ */ a("tr", { children: [/* @__PURE__ */ i("th", {
|
|
82
82
|
scope: "row",
|
|
83
83
|
children: t.levelName
|
|
84
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ i("td", { children: t.levelValue || /* @__PURE__ */ i(n, { ...e.emptyAncestorLevelValue }) })] }, t.id || t.level)) })
|
|
85
85
|
})
|
|
86
86
|
]
|
|
87
87
|
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { MULTI_VALUE_DEFAULT_OPTION as e } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js";
|
|
2
2
|
import { r as t } from "./types.js";
|
|
3
3
|
import { messages as n } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import d from "
|
|
4
|
+
import r from "react";
|
|
5
|
+
import { useIntl as i } from "react-intl";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import s from "clsx";
|
|
8
|
+
import { IconButton as c, Radio as l } from "@box/blueprint-web";
|
|
9
|
+
import { Settings as u, XMark as d } from "@box/blueprint-web-assets/icons/Fill";
|
|
10
10
|
import { Field as f, getIn as p, useFormikContext as m } from "formik";
|
|
11
11
|
import '../styles/update-mode-field-wrapper.css';var h = {
|
|
12
12
|
wrapperContianer: "_wrapperContianer_19nqy_1",
|
|
@@ -17,57 +17,57 @@ import '../styles/update-mode-field-wrapper.css';var h = {
|
|
|
17
17
|
additionalFieldContainer: "_additionalFieldContainer_19nqy_23",
|
|
18
18
|
hidden: "_hidden_19nqy_27"
|
|
19
19
|
}, g = (e) => e === t.ReplaceEntered, _ = (e, t) => e === "string" || e === "multiSelect" || t, v = ({ children: v, fieldNamePrefix: y, fieldType: b, isTaxonomyMultiSelect: x }) => {
|
|
20
|
-
let { setFieldValue: S, values: C } = m(), w =
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
let { setFieldValue: S, values: C } = m(), w = i(), T = `${y}.updateMode.mode`, E = p(C, T), D = v && r.Children.only(v), O = p(C, `${y}.options`, []).filter((t) => t.id !== e.id).map(({ key: e }) => e), k = p(C, `${y}.updateMode.isOpened`);
|
|
21
|
+
return /* @__PURE__ */ o("div", {
|
|
22
22
|
className: h.wrapperContianer,
|
|
23
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ o("div", {
|
|
24
24
|
className: h.fieldContainer,
|
|
25
|
-
children: [/* @__PURE__ */
|
|
25
|
+
children: [/* @__PURE__ */ a("span", {
|
|
26
26
|
className: h.field,
|
|
27
27
|
children: v
|
|
28
|
-
}), /* @__PURE__ */
|
|
28
|
+
}), /* @__PURE__ */ a(c, {
|
|
29
29
|
"aria-label": w.formatMessage(n.toggleUpdateModeSelectiorAriaLabel),
|
|
30
30
|
className: h.collapseButton,
|
|
31
31
|
"data-testid": `${D.props.label}-update-mode-toggle`,
|
|
32
|
-
icon: k ?
|
|
32
|
+
icon: k ? d : u,
|
|
33
33
|
onClick: () => {
|
|
34
34
|
S(`${y}.updateMode.isOpened`, !k);
|
|
35
35
|
},
|
|
36
36
|
size: "small",
|
|
37
37
|
"data-target-id": "IconButton-toggleUpdateModeSelectiorAriaLabel"
|
|
38
38
|
})]
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
className:
|
|
41
|
-
children: [/* @__PURE__ */
|
|
39
|
+
}), /* @__PURE__ */ o("div", {
|
|
40
|
+
className: s(h.radioContainer, { [h.hidden]: !k }),
|
|
41
|
+
children: [/* @__PURE__ */ a(f, {
|
|
42
42
|
name: `${y}.updateMode.mode`,
|
|
43
|
-
children: ({ field: e }) => /* @__PURE__ */
|
|
43
|
+
children: ({ field: e }) => /* @__PURE__ */ o(l.Group, {
|
|
44
44
|
"data-testid": `${D.props.label}-radio-group`,
|
|
45
45
|
loop: !0,
|
|
46
46
|
onValueChange: (e) => S(T, e),
|
|
47
47
|
orientation: "vertical",
|
|
48
48
|
value: e.value,
|
|
49
49
|
children: [
|
|
50
|
-
_(b, x) && /* @__PURE__ */ l
|
|
50
|
+
_(b, x) && /* @__PURE__ */ a(l.Item, {
|
|
51
51
|
label: w.formatMessage(n.append),
|
|
52
52
|
value: t.Append
|
|
53
53
|
}),
|
|
54
|
-
/* @__PURE__ */ l
|
|
54
|
+
/* @__PURE__ */ a(l.Item, {
|
|
55
55
|
label: w.formatMessage(n.clearAndReplace),
|
|
56
56
|
value: t.ClearAndReplace
|
|
57
57
|
}),
|
|
58
|
-
/* @__PURE__ */ l
|
|
58
|
+
/* @__PURE__ */ a(l.Item, {
|
|
59
59
|
label: w.formatMessage(n.removeEntered),
|
|
60
60
|
value: t.RemoveEntered
|
|
61
61
|
}),
|
|
62
|
-
/* @__PURE__ */ l
|
|
62
|
+
/* @__PURE__ */ a(l.Item, {
|
|
63
63
|
label: w.formatMessage(n.replaceEntered),
|
|
64
64
|
value: t.ReplaceEntered
|
|
65
65
|
})
|
|
66
66
|
]
|
|
67
67
|
})
|
|
68
|
-
}), g(E) && D && /* @__PURE__ */
|
|
68
|
+
}), g(E) && D && /* @__PURE__ */ a("div", {
|
|
69
69
|
className: h.additionalFieldContainer,
|
|
70
|
-
children: /*#__PURE__*/
|
|
70
|
+
children: /*#__PURE__*/ r.cloneElement(D, {
|
|
71
71
|
updateModePrefix: `${y}.updateMode`,
|
|
72
72
|
options: O,
|
|
73
73
|
label: w.formatMessage(n.with)
|
package/dist/chunks/utils.js
CHANGED
|
@@ -3,11 +3,11 @@ import { convertISOStringtoRFC3339String as t } from "../esm/lib/utils/convertDa
|
|
|
3
3
|
import { t as n } from "./interactive-text.module.js";
|
|
4
4
|
import { AiLogoBadge as r } from "../esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js";
|
|
5
5
|
import { LowConfidenceBadge as i } from "../esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import m from "
|
|
6
|
+
import { createElement as a, memo as o, useRef as s } from "react";
|
|
7
|
+
import { Focusable as c } from "@ariakit/react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import d from "clsx";
|
|
10
|
+
import { Tooltip as f, useForkRef as p, useIsEllipsized as m } from "@box/blueprint-web";
|
|
11
11
|
import '../styles/utils.css';var h = {
|
|
12
12
|
noAttributesText: "_noAttributesText_1o3kr_2",
|
|
13
13
|
fieldWrapper: "_fieldWrapper_1o3kr_6",
|
|
@@ -22,58 +22,58 @@ import '../styles/utils.css';var h = {
|
|
|
22
22
|
labelTruncated: "_labelTruncated_1o3kr_105",
|
|
23
23
|
labelTooltipStack: "_labelTooltipStack_1o3kr_113"
|
|
24
24
|
};
|
|
25
|
-
function g({ as: e, fieldDescription: t, fieldName: r, labelClassName: i, labelRef:
|
|
26
|
-
let g =
|
|
27
|
-
return /* @__PURE__ */ f
|
|
28
|
-
content:
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
className:
|
|
25
|
+
function g({ as: e, fieldDescription: t, fieldName: r, labelClassName: i, labelRef: o, ...h }) {
|
|
26
|
+
let g = s(null), _ = p(g, o);
|
|
27
|
+
return /* @__PURE__ */ l(f, {
|
|
28
|
+
content: m(g) ? /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("div", { children: r }), /* @__PURE__ */ l("div", { children: t })] }) : t,
|
|
29
|
+
children: /* @__PURE__ */ l(c, { render: /*#__PURE__*/ a(e, {
|
|
30
|
+
className: d(i, n.interactiveTextHint),
|
|
31
31
|
...h,
|
|
32
32
|
ref: _
|
|
33
33
|
}, r) })
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
function _({ as: e, fieldName: t, labelClassName: n, labelRef: r, ...i }) {
|
|
37
|
-
let
|
|
37
|
+
let o = s(null), u = p(o, r), d = m(o) ? t : void 0, h = /*#__PURE__*/ a(e, {
|
|
38
38
|
className: n,
|
|
39
39
|
...i,
|
|
40
|
-
ref:
|
|
40
|
+
ref: u
|
|
41
41
|
}, t);
|
|
42
|
-
return
|
|
43
|
-
content:
|
|
44
|
-
children: /* @__PURE__ */
|
|
42
|
+
return d ? /* @__PURE__ */ l(f, {
|
|
43
|
+
content: d,
|
|
44
|
+
children: /* @__PURE__ */ l(c, { render: h })
|
|
45
45
|
}) : h;
|
|
46
46
|
}
|
|
47
|
-
var v = /*#__PURE__*/
|
|
48
|
-
let { className:
|
|
47
|
+
var v = /*#__PURE__*/ o(function({ fieldName: t, fieldDescription: n, isAiSuggestionApplied: a, as: o, confidenceScore: s, labelProps: c }) {
|
|
48
|
+
let { className: f, ref: p, ...m } = c, v = d(f || h.labelText, h.labelTruncated), y = !!s && e(s), b = () => s && y ? /* @__PURE__ */ l(i, {}) : a || s ? /* @__PURE__ */ l(r, { confidenceScore: s }) : null, x = n ? /* @__PURE__ */ l(g, {
|
|
49
49
|
as: o,
|
|
50
50
|
fieldDescription: n,
|
|
51
51
|
fieldName: t,
|
|
52
52
|
labelClassName: v,
|
|
53
|
-
labelRef:
|
|
54
|
-
...
|
|
55
|
-
}) : /* @__PURE__ */
|
|
53
|
+
labelRef: p,
|
|
54
|
+
...m
|
|
55
|
+
}) : /* @__PURE__ */ l(_, {
|
|
56
56
|
as: o,
|
|
57
57
|
fieldName: t,
|
|
58
58
|
labelClassName: v,
|
|
59
|
-
labelRef:
|
|
60
|
-
...
|
|
59
|
+
labelRef: p,
|
|
60
|
+
...m
|
|
61
61
|
});
|
|
62
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ u("div", {
|
|
63
63
|
className: h.labelWrapper,
|
|
64
64
|
children: [x, b()]
|
|
65
65
|
});
|
|
66
66
|
}, (e, t) => {
|
|
67
67
|
let n = e.labelProps, r = t.labelProps;
|
|
68
68
|
return e.fieldName === t.fieldName && e.fieldDescription === t.fieldDescription && e.isAiSuggestionApplied === t.isAiSuggestionApplied && e.confidenceScore === t.confidenceScore && e.as === t.as && n.className === r.className && n.htmlFor === r.htmlFor && n.id === r.id;
|
|
69
|
-
}), y = (e, t, n = !1, r = "label", i) => (a) => /* @__PURE__ */
|
|
69
|
+
}), y = (e, t, n = !1, r = "label", i) => (a) => /* @__PURE__ */ l(v, {
|
|
70
70
|
as: r,
|
|
71
71
|
confidenceScore: i,
|
|
72
72
|
fieldDescription: t,
|
|
73
73
|
fieldName: e,
|
|
74
74
|
isAiSuggestionApplied: n,
|
|
75
75
|
labelProps: a
|
|
76
|
-
}), b = (e, t, n = !1, r) => /* @__PURE__ */
|
|
76
|
+
}), b = (e, t, n = !1, r) => /* @__PURE__ */ l(v, {
|
|
77
77
|
as: "span",
|
|
78
78
|
confidenceScore: r,
|
|
79
79
|
fieldDescription: t,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { FilterDropdownMenu as e } from "./lib/components/filter-dropdown-menu/index.js";
|
|
2
|
-
import { t } from "
|
|
2
|
+
import { AddMetadataTemplateDropdown as t } from "./lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js";
|
|
3
|
+
import { t as n } from "../chunks/add-metadata-template-dropdown-with-browser.js";
|
|
3
4
|
import "./lib/components/add-metadata-template-dropdown/index.js";
|
|
4
|
-
import { t as
|
|
5
|
+
import { t as r } from "../chunks/combobox-with-api-pagination.js";
|
|
5
6
|
import "./lib/components/combobox-with-api-pagination/index.js";
|
|
6
|
-
import { t as
|
|
7
|
+
import { t as i } from "../chunks/filter-instances-dropdown.js";
|
|
7
8
|
import "./lib/components/filter-instances-dropdown/index.js";
|
|
8
|
-
import { MULTI_VALUE_DEFAULT_OPTION as
|
|
9
|
-
import { MetadataEmptyState as
|
|
10
|
-
import { AutofillContext as
|
|
11
|
-
import { n as
|
|
12
|
-
import { UnsavedChangesModal as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { r as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import { MetadataInstanceForm as
|
|
19
|
-
import { t as
|
|
20
|
-
import { MetadataInstance as
|
|
21
|
-
import { defaultInitialValues as
|
|
22
|
-
import { t as
|
|
23
|
-
import { withApiWrapper as
|
|
24
|
-
export { t as AddMetadataTemplateDropdown,
|
|
9
|
+
import { MULTI_VALUE_DEFAULT_OPTION as a, MULTI_VALUE_DEFAULT_TAXONOMY_OPTION as o, MULTI_VALUE_DEFAULT_VALUE as s } from "./lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js";
|
|
10
|
+
import { MetadataEmptyState as c } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
|
|
11
|
+
import { AutofillContext as l, AutofillContextProvider as u, TIMEOUT_10_SECONDS as d, useAutofill as f } from "./lib/utils/autofill-context.js";
|
|
12
|
+
import { n as p, r as m, t as h } from "../chunks/types.js";
|
|
13
|
+
import { UnsavedChangesModal as g } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
|
|
14
|
+
import { t as _ } from "../chunks/custom-instance-new-field.js";
|
|
15
|
+
import { t as v } from "../chunks/delete-confirmation-modal.js";
|
|
16
|
+
import { r as y } from "../chunks/utils2.js";
|
|
17
|
+
import { t as b } from "../chunks/metadata-instance-form-autofill-button.js";
|
|
18
|
+
import { t as x } from "../chunks/metadata-instance-form-header.js";
|
|
19
|
+
import { MetadataInstanceForm as S } from "./lib/components/metadata-instance-editor/index.js";
|
|
20
|
+
import { t as C } from "../chunks/metadata-instance-header.js";
|
|
21
|
+
import { MetadataInstance as w, MetadataInstanceList as T } from "./lib/components/metadata-instance-list/index.js";
|
|
22
|
+
import { defaultInitialValues as E, defaultMetadataValueMap as D } from "./lib/defaults.js";
|
|
23
|
+
import { t as O } from "../chunks/metadata-editor.js";
|
|
24
|
+
import { withApiWrapper as k } from "./lib/utils/api-wrapper.js";
|
|
25
|
+
export { t as AddMetadataTemplateDropdown, n as AddMetadataTemplateDropdownWithBrowser, h as AiSuggestionState, l as AutofillContext, u as AutofillContextProvider, r as ComboboxWithApiPagination, p as ConfidenceLevel, _ as CustomInstanceNewField, v as DeleteConfirmationModal, e as FilterDropdownMenu, i as FilterInstancesDropdown, y as JSONPatchOp, a as MULTI_VALUE_DEFAULT_OPTION, o as MULTI_VALUE_DEFAULT_TAXONOMY_OPTION, s as MULTI_VALUE_DEFAULT_VALUE, O as MetadataEditor, c as MetadataEmptyState, w as MetadataInstance, S as MetadataInstanceForm, b as MetadataInstanceFormAutofillButton, x as MetadataInstanceFormHeader, C as MetadataInstanceHeader, T as MetadataInstanceList, d as TIMEOUT_10_SECONDS, g as UnsavedChangesModal, m as UpdateMode, E as defaultInitialValues, D as defaultMetadataValueMap, f as useAutofill, k as withApiWrapper };
|
package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getTemplateDisplayName as e } from "../../utils/utils.js";
|
|
2
|
+
import { FilterDropdownMenu as t } from "../filter-dropdown-menu/index.js";
|
|
3
|
+
import n from "./messages.js";
|
|
4
|
+
import { DropdownTrigger as r } from "./shared/dropdown-trigger.js";
|
|
5
|
+
import { useMemo as i, useState as a } from "react";
|
|
6
|
+
import { useIntl as o } from "react-intl";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
function l({ availableTemplates: l, onSelect: u, selectedTemplates: d }) {
|
|
9
|
+
let f = o(), p = f.formatMessage(n.customMetadataName), [m, h] = a(""), g = i(() => l.filter((t) => e(t, p).toLowerCase().includes(m.toLowerCase())), [
|
|
10
|
+
l,
|
|
11
|
+
m,
|
|
12
|
+
p
|
|
13
|
+
]), _ = m.length > 0 && g.length === 0, v = (e) => d.some((t) => t.scope === e.scope && t.templateKey === e.templateKey);
|
|
14
|
+
return /* @__PURE__ */ c(t.Root, {
|
|
15
|
+
resetValueOnHide: !0,
|
|
16
|
+
setValue: h,
|
|
17
|
+
children: [/* @__PURE__ */ s(r, {}), /* @__PURE__ */ c(t.Content, { children: [/* @__PURE__ */ s(t.Search, { placeholder: f.formatMessage(n.addMetadataTemplatesSearchPlaceholder) }), /* @__PURE__ */ s(t.List, { children: _ ? /* @__PURE__ */ s(t.EmptyState, {}) : g.map((n) => /* @__PURE__ */ s(t.Item, {
|
|
18
|
+
disabled: v(n),
|
|
19
|
+
onClick: () => u(n),
|
|
20
|
+
value: e(n, p)
|
|
21
|
+
}, n.id)) })] })]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { l as AddMetadataTemplateDropdown };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { AddMetadataTemplateDropdown as e } from "./add-metadata-template-dropdown.js";
|
|
2
|
+
import { t } from "../../../../chunks/add-metadata-template-dropdown-with-browser.js";
|
|
3
|
+
export { e as AddMetadataTemplateDropdown, t as AddMetadataTemplateDropdownWithBrowser };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FilterDropdownMenu as e } from "../../filter-dropdown-menu/index.js";
|
|
2
|
+
import t from "../messages.js";
|
|
3
|
+
import { useIntl as n } from "react-intl";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { IconButton as i } from "@box/blueprint-web";
|
|
6
|
+
import { Plus as a } from "@box/blueprint-web-assets/icons/Fill";
|
|
7
|
+
function o() {
|
|
8
|
+
let o = n();
|
|
9
|
+
return /* @__PURE__ */ r(e.Trigger, { triggerButton: /* @__PURE__ */ r(i, {
|
|
10
|
+
"aria-label": o.formatMessage(t.addMetadataTemplatesTriggerButtonLabel),
|
|
11
|
+
icon: a,
|
|
12
|
+
size: "x-small",
|
|
13
|
+
"data-target-id": "IconButton-addMetadataTemplatesTriggerButtonLabel"
|
|
14
|
+
}) });
|
|
15
|
+
}
|
|
16
|
+
export { o as DropdownTrigger };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as e } from "../../../../chunks/filter-dropdown-menu.module.js";
|
|
2
2
|
import t from "./messages.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useIntl as n } from "react-intl";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { Text as i } from "@box/blueprint-web";
|
|
6
6
|
var a = () => {
|
|
7
|
-
let a =
|
|
8
|
-
return /* @__PURE__ */ i
|
|
7
|
+
let a = n().formatMessage(t.noResultsFound);
|
|
8
|
+
return /* @__PURE__ */ r(i, {
|
|
9
9
|
as: "p",
|
|
10
10
|
className: e.item,
|
|
11
11
|
color: "textOnLightSecondary",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as e } from "../../../../chunks/filter-dropdown-menu.module.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ComboboxList as t } from "@ariakit/react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { ScrollableContainer as r } from "@box/blueprint-web";
|
|
5
5
|
var i = (i) => {
|
|
6
6
|
let { children: a, ...o } = i;
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ n(t, {
|
|
8
8
|
className: e.comboboxList,
|
|
9
9
|
...o,
|
|
10
|
-
children: /* @__PURE__ */ r
|
|
10
|
+
children: /* @__PURE__ */ n(r, {
|
|
11
11
|
className: e.scrollableContainer,
|
|
12
12
|
children: a
|
|
13
13
|
})
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { t as e } from "../../../../chunks/filter-dropdown-menu.module.js";
|
|
2
2
|
import t from "./messages.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useIntl as n } from "react-intl";
|
|
4
|
+
import { Combobox as r, ComboboxCancel as i } from "@ariakit/react";
|
|
5
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { Divider as c, IconButton as l } from "@box/blueprint-web";
|
|
7
|
+
import { Search as u, XMark as d } from "@box/blueprint-web-assets/icons/Fill";
|
|
8
8
|
import { IconCtaIcon as f, IconIconOnLightSecondary as p } from "@box/blueprint-web-assets/tokens/tokens";
|
|
9
|
-
var m = () => /* @__PURE__ */
|
|
10
|
-
let { ...h } =
|
|
11
|
-
return /* @__PURE__ */
|
|
9
|
+
var m = () => /* @__PURE__ */ o(d, { role: "presentation" }), h = (d) => {
|
|
10
|
+
let { ...h } = d, g = n().formatMessage(t.cancelButtonAriaLabel);
|
|
11
|
+
return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s("div", {
|
|
12
12
|
className: e.search,
|
|
13
13
|
children: [
|
|
14
|
-
/* @__PURE__ */ u
|
|
14
|
+
/* @__PURE__ */ o(u, {
|
|
15
15
|
className: e.searchIcon,
|
|
16
16
|
color: p,
|
|
17
17
|
role: "presentation"
|
|
18
18
|
}),
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ o(r, {
|
|
20
20
|
"aria-haspopup": "false",
|
|
21
21
|
autoSelect: !0,
|
|
22
22
|
className: e.searchInput,
|
|
23
23
|
...h
|
|
24
24
|
}),
|
|
25
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ o(i, { render: /* @__PURE__ */ o(l, {
|
|
26
26
|
"aria-label": g,
|
|
27
27
|
className: e.clearSearchIcon,
|
|
28
28
|
color: f,
|
|
@@ -31,7 +31,7 @@ var m = () => /* @__PURE__ */ u(a, { role: "presentation" }), h = (a) => {
|
|
|
31
31
|
"data-target-id": "IconButton-cancelButtonAriaLabel"
|
|
32
32
|
}) })
|
|
33
33
|
]
|
|
34
|
-
}), /* @__PURE__ */
|
|
34
|
+
}), /* @__PURE__ */ o(c, { className: e.searchDivider })] });
|
|
35
35
|
};
|
|
36
36
|
h.displayName = "FilterDropdownMenuItem";
|
|
37
37
|
export { h as FilterDropdownMenuSearch };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as e } from "../../../../chunks/interactive-text.module.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import a from "
|
|
2
|
+
import { Focusable as t } from "@ariakit/react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { Text as i, Tooltip as a } from "@box/blueprint-web";
|
|
6
6
|
var o = ({ tooltipText: o, className: s, children: c, ...l }) => {
|
|
7
7
|
let { as: u = "span" } = l;
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ n(a, {
|
|
9
9
|
content: o,
|
|
10
|
-
children: /* @__PURE__ */
|
|
10
|
+
children: /* @__PURE__ */ n(t, { render: /* @__PURE__ */ n(i, {
|
|
11
11
|
as: u,
|
|
12
|
-
className:
|
|
12
|
+
className: r(e.interactiveText, s),
|
|
13
13
|
...l,
|
|
14
14
|
children: c
|
|
15
15
|
}) })
|
package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js
CHANGED
|
@@ -2,29 +2,29 @@ import { EVENT_NAMES as e } from "../../../../utils/analytics/events.js";
|
|
|
2
2
|
import { useMetadataEditorAnalytics as t } from "../../../../utils/analytics/analytics-context.js";
|
|
3
3
|
import { getConfidenceScoreTooltip as n } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
|
|
4
4
|
import r from "../../messages.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { useIntl as i } from "react-intl";
|
|
6
|
+
import { BoxAiLogo as a } from "@box/blueprint-web-assets/icons/Logo";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
import { Status as s, Tooltip as c } from "@box/blueprint-web";
|
|
9
9
|
import { SurfaceStatusSurfaceGray as l } from "@box/blueprint-web-assets/tokens/tokens";
|
|
10
10
|
function u({ confidenceScore: u }) {
|
|
11
|
-
let { formatMessage: d } =
|
|
12
|
-
return u ? /* @__PURE__ */ c
|
|
11
|
+
let { formatMessage: d } = i(), { trackEvent: f } = t(), p = () => f(e.AI_LOGO_BADGE_HOVER, { confidenceLevel: u?.level });
|
|
12
|
+
return u ? /* @__PURE__ */ o(c, {
|
|
13
13
|
content: n(d, u),
|
|
14
|
-
children: /* @__PURE__ */
|
|
14
|
+
children: /* @__PURE__ */ o(s, {
|
|
15
15
|
hideText: !0,
|
|
16
|
-
icon:
|
|
16
|
+
icon: a,
|
|
17
17
|
interactive: !0,
|
|
18
18
|
text: "",
|
|
19
19
|
color: l,
|
|
20
20
|
"data-testid": "ai-confidence-badge",
|
|
21
21
|
onMouseEnter: p
|
|
22
22
|
})
|
|
23
|
-
}) : /* @__PURE__ */ c
|
|
23
|
+
}) : /* @__PURE__ */ o(c, {
|
|
24
24
|
content: d(r.aiExtractedBadgeTooltip),
|
|
25
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ o(s, {
|
|
26
26
|
hideText: !0,
|
|
27
|
-
icon:
|
|
27
|
+
icon: a,
|
|
28
28
|
interactive: !0,
|
|
29
29
|
text: "",
|
|
30
30
|
color: l,
|