@box/metadata-editor 2.2.32 → 2.3.0
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 +1 -1
- package/dist/chunks/add-metadata-template-dropdown.js +0 -84
- package/dist/styles/add-metadata-template-dropdown.css +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getTemplateDisplayName as e, getVisibleTemplates as t } from "../esm/lib/utils/utils.js";
|
|
2
2
|
import n from "../esm/lib/components/filter-instances-dropdown/messages.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import v from "
|
|
3
|
+
import { useEffect as r } from "react";
|
|
4
|
+
import { useIntl as i } from "react-intl";
|
|
5
|
+
import { Select as a, SelectItem as o, SelectItemCheck as s, SelectPopover as c, SelectProvider as l } from "@ariakit/react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import f from "clsx";
|
|
8
|
+
import { Divider as p, ScrollableContainer as m, Text as h, TriggerButton as g } from "@box/blueprint-web";
|
|
9
|
+
import { Checkmark as _ } from "@box/blueprint-web-assets/icons/Fill";
|
|
10
|
+
import { Space1 as v } from "@box/blueprint-web-assets/tokens/px-tokens";
|
|
11
11
|
import '../styles/filter-instances-dropdown.css';var y = {
|
|
12
12
|
details: "_details_h8q4r_27",
|
|
13
13
|
triggerContainer: "_triggerContainer_h8q4r_31",
|
|
@@ -19,27 +19,27 @@ import '../styles/filter-instances-dropdown.css';var y = {
|
|
|
19
19
|
indicator: "_indicator_h8q4r_93",
|
|
20
20
|
indicatorIcon: "_indicatorIcon_h8q4r_102",
|
|
21
21
|
testContainer: "_testContainer_h8q4r_106"
|
|
22
|
-
}, b = parseInt(
|
|
23
|
-
function x({ appliedTemplates:
|
|
24
|
-
let C =
|
|
22
|
+
}, b = parseInt(v, 10);
|
|
23
|
+
function x({ appliedTemplates: v, selectedTemplates: x, setSelectedTemplates: S }) {
|
|
24
|
+
let C = i(), w = C.formatMessage(n.customMetadataName), T = t(v), E = x.length, D = T.length, O = E === 0 ? C.formatMessage(n.allTemplatesTriggerButtonText) : C.formatMessage(n.selectedTemplatesTriggerButtonText, {
|
|
25
25
|
selectedTemplatesNumber: E,
|
|
26
26
|
visibleTemplatesNumber: D
|
|
27
27
|
});
|
|
28
|
-
return
|
|
28
|
+
return r(() => {
|
|
29
29
|
E === D && S([]);
|
|
30
|
-
}, [E, D]), /* @__PURE__ */
|
|
30
|
+
}, [E, D]), /* @__PURE__ */ d(l, {
|
|
31
31
|
setValue: S,
|
|
32
32
|
value: x,
|
|
33
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ d("div", {
|
|
34
34
|
className: y.triggerContainer,
|
|
35
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ u(a, { render: /* @__PURE__ */ u(g, {
|
|
36
36
|
caretDirection: "down",
|
|
37
37
|
className: y.triggerButton,
|
|
38
38
|
label: O,
|
|
39
39
|
size: "small",
|
|
40
40
|
variant: "tertiary",
|
|
41
41
|
"data-target-id": "TriggerButton-allTemplatesTriggerButtonText|selectedTemplatesTriggerButtonText"
|
|
42
|
-
}) }), T.length > 0 && /* @__PURE__ */
|
|
42
|
+
}) }), T.length > 0 && /* @__PURE__ */ u(h, {
|
|
43
43
|
as: "p",
|
|
44
44
|
className: y.details,
|
|
45
45
|
color: "textOnLightSecondary",
|
|
@@ -47,33 +47,33 @@ function x({ appliedTemplates: c, selectedTemplates: x, setSelectedTemplates: S
|
|
|
47
47
|
variant: "caption",
|
|
48
48
|
children: T.filter((e) => x.some((t) => t === e.id)).map((t) => e(t, w)).join(", ")
|
|
49
49
|
})]
|
|
50
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ u(c, {
|
|
51
51
|
className: y.popover,
|
|
52
52
|
gutter: b,
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ d(m, {
|
|
54
54
|
className: y.scrollableContainer,
|
|
55
55
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ d(o, {
|
|
57
57
|
autoFocus: E === 0,
|
|
58
58
|
className: y.item,
|
|
59
59
|
hideOnClick: !0,
|
|
60
60
|
onClick: () => {
|
|
61
61
|
S([]);
|
|
62
62
|
},
|
|
63
|
-
children: [E === 0 && /* @__PURE__ */
|
|
63
|
+
children: [E === 0 && /* @__PURE__ */ u(_, { className: f(y.indicator, y.indicatorIcon) }), C.formatMessage(n.allTemplatesTriggerButtonText)]
|
|
64
64
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
T.map((t) => /* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ u(p, { className: y.divider }),
|
|
66
|
+
T.map((t) => /* @__PURE__ */ d(o, {
|
|
67
67
|
className: y.item,
|
|
68
68
|
hideOnClick: !0,
|
|
69
69
|
value: t.id,
|
|
70
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ u(s, {
|
|
71
71
|
className: y.indicator,
|
|
72
72
|
style: {
|
|
73
73
|
width: "none",
|
|
74
74
|
height: "none"
|
|
75
75
|
},
|
|
76
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ u(_, { className: y.indicatorIcon })
|
|
77
77
|
}), e(t, w)]
|
|
78
78
|
}, t.id))
|
|
79
79
|
]
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import o from "
|
|
1
|
+
import { useRef as e } from "react";
|
|
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, useIsEllipsized as o } from "@box/blueprint-web";
|
|
6
6
|
import '../styles/interactive-header-text.css';var s = { header: "_header_qqeyd_1" }, c = ({ className: c, title: l }) => {
|
|
7
|
-
let u =
|
|
7
|
+
let u = e(null), d = o(u), f = /* @__PURE__ */ n(t, { render: /* @__PURE__ */ n(i, {
|
|
8
8
|
ref: u,
|
|
9
9
|
as: "h4",
|
|
10
|
-
className:
|
|
10
|
+
className: r(s.header, c),
|
|
11
11
|
variant: "titleMedium",
|
|
12
12
|
children: l
|
|
13
13
|
}) });
|
|
14
|
-
return d ? /* @__PURE__ */ a
|
|
14
|
+
return d ? /* @__PURE__ */ n(a, {
|
|
15
15
|
content: l,
|
|
16
16
|
children: f
|
|
17
17
|
}) : f;
|
|
@@ -8,13 +8,13 @@ import { t as o } from "./shared-field-styles.module.js";
|
|
|
8
8
|
import { convertISOStringToUTCDate as s } from "../esm/lib/utils/convertDate.js";
|
|
9
9
|
import { t as c } from "./interactive-text.module.js";
|
|
10
10
|
import l from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";
|
|
11
|
-
import { MetadataEntryDisplay as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import b from "
|
|
11
|
+
import { MetadataEntryDisplay as u } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
|
|
12
|
+
import { useRef as d } from "react";
|
|
13
|
+
import { FormattedDate as f, useIntl as ee } from "react-intl";
|
|
14
|
+
import { Focusable as p } from "@ariakit/react";
|
|
15
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
16
|
+
import g from "clsx";
|
|
17
|
+
import { Status as _, Text as v, Tooltip as y, useIsEllipsized as b } from "@box/blueprint-web";
|
|
18
18
|
import { AlertCircle as x } from "@box/blueprint-web-assets/icons/Medium";
|
|
19
19
|
import '../styles/metadata-instance-entry.css';var S = {
|
|
20
20
|
metadataInstanceEntry: "_metadataInstanceEntry_1ygbk_1",
|
|
@@ -24,13 +24,13 @@ import '../styles/metadata-instance-entry.css';var S = {
|
|
|
24
24
|
nameLabel: "_nameLabel_1ygbk_28",
|
|
25
25
|
confidenceScoreIcon: "_confidenceScoreIcon_1ygbk_43"
|
|
26
26
|
}, C = ({ description: C, isSelected: w, name: T, onClick: E, shouldHideEmptyValues: D, type: O, value: k, taxonomyNodeFetcher: A, taxonomyKey: j, scope: M, isExternallyOwned: N, confidenceScore: P, isConfidenceScoreReviewEnabled: F = !1, isBoundingBoxEnabled: I = !1, targetLocation: L }) => {
|
|
27
|
-
let R =
|
|
27
|
+
let R = ee(), { trackEvent: z } = n(), B = d(null), V = b(B), H = (e) => {
|
|
28
28
|
B.current = e instanceof HTMLElement ? e : null;
|
|
29
29
|
}, U = I || F, W = F && !!P && a(P), G = r(L), K = U && G && !!E, q = W ? i(R.formatMessage, P) : null, J = () => z(t.LOW_CONF_ICON_HOVER_READ_MODE, {
|
|
30
30
|
fieldType: O,
|
|
31
31
|
confidenceLevel: P?.level,
|
|
32
32
|
scope: M
|
|
33
|
-
}), Y = typeof k == "number" ? k.toString() : k ? Array.isArray(k) ? k.join(", ") : O === "date" && typeof k == "string" ? /* @__PURE__ */
|
|
33
|
+
}), Y = typeof k == "number" ? k.toString() : k ? Array.isArray(k) ? k.join(", ") : O === "date" && typeof k == "string" ? /* @__PURE__ */ m(f, {
|
|
34
34
|
day: "numeric",
|
|
35
35
|
month: "long",
|
|
36
36
|
value: s(k),
|
|
@@ -48,28 +48,28 @@ import '../styles/metadata-instance-entry.css';var S = {
|
|
|
48
48
|
};
|
|
49
49
|
if (D && !Y) return null;
|
|
50
50
|
let Z = (() => {
|
|
51
|
-
if (C) return V ? /* @__PURE__ */
|
|
51
|
+
if (C) return V ? /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", { children: T }), /* @__PURE__ */ m("div", { children: C })] }) : C;
|
|
52
52
|
if (V) return T;
|
|
53
|
-
})(), Q = /* @__PURE__ */
|
|
53
|
+
})(), Q = /* @__PURE__ */ m("h5", {
|
|
54
54
|
className: S.name,
|
|
55
|
-
children: /* @__PURE__ */ v
|
|
55
|
+
children: /* @__PURE__ */ m(v, {
|
|
56
56
|
ref: H,
|
|
57
57
|
as: "span",
|
|
58
|
-
className:
|
|
58
|
+
className: g(S.nameText, C && c.interactiveTextHint),
|
|
59
59
|
color: "textOnLightSecondary",
|
|
60
60
|
variant: "bodyDefaultBold",
|
|
61
61
|
children: T
|
|
62
62
|
})
|
|
63
|
-
}), $ = /* @__PURE__ */
|
|
64
|
-
className:
|
|
63
|
+
}), $ = /* @__PURE__ */ h("div", {
|
|
64
|
+
className: g(S.metadataInstanceEntry, U && o.spacious, K && o.clickableField, K && w && o.selectedField),
|
|
65
65
|
...K && X,
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ h("div", {
|
|
67
67
|
className: S.labelContainer,
|
|
68
|
-
children: [q && /* @__PURE__ */
|
|
68
|
+
children: [q && /* @__PURE__ */ m(y, {
|
|
69
69
|
content: q,
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ m("span", {
|
|
71
71
|
className: S.confidenceScoreIcon,
|
|
72
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ m(_, {
|
|
73
73
|
"data-target-id": "Status-metadataInstanceEntryConfidenceScoreIcon",
|
|
74
74
|
color: "SurfaceStatusSurfaceGray",
|
|
75
75
|
hideText: !0,
|
|
@@ -79,14 +79,14 @@ import '../styles/metadata-instance-entry.css';var S = {
|
|
|
79
79
|
onMouseEnter: J
|
|
80
80
|
})
|
|
81
81
|
})
|
|
82
|
-
}), /* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ m("div", {
|
|
83
83
|
className: S.nameLabel,
|
|
84
|
-
children: Z ? /* @__PURE__ */
|
|
84
|
+
children: Z ? /* @__PURE__ */ m(y, {
|
|
85
85
|
content: Z,
|
|
86
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ m(p, { render: Q })
|
|
87
87
|
}) : Q
|
|
88
88
|
})]
|
|
89
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ m(u, {
|
|
90
90
|
formattedValue: Y,
|
|
91
91
|
isExternallyOwned: N,
|
|
92
92
|
scope: M,
|
|
@@ -96,7 +96,7 @@ import '../styles/metadata-instance-entry.css';var S = {
|
|
|
96
96
|
value: k
|
|
97
97
|
})]
|
|
98
98
|
});
|
|
99
|
-
return K ? /* @__PURE__ */
|
|
99
|
+
return K ? /* @__PURE__ */ m(y, {
|
|
100
100
|
content: R.formatMessage(e.viewOnDocument),
|
|
101
101
|
children: $
|
|
102
102
|
}) : $;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useIntl as t } from "react-intl";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { TextButton as r } from "@box/blueprint-web";
|
|
5
5
|
import '../styles/metadata-instance-footer.css';var i = {
|
|
6
6
|
metadataInstanceFooter: "_metadataInstanceFooter_r5r5c_1",
|
|
7
7
|
button: "_button_r5r5c_5"
|
|
8
8
|
}, a = ({ isAnyEmptyValueHidden: a, onHideEmptyValues: o, onShowEmptyValues: s }) => {
|
|
9
|
-
let c =
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
let c = t();
|
|
10
|
+
return /* @__PURE__ */ n("div", {
|
|
11
11
|
className: i.metadataInstanceFooter,
|
|
12
|
-
children: a ? /* @__PURE__ */ r
|
|
12
|
+
children: a ? /* @__PURE__ */ n(r, {
|
|
13
13
|
className: i.button,
|
|
14
14
|
onClick: s,
|
|
15
15
|
"data-target-id": "TextButton-showEmptyValuesCTA",
|
|
16
16
|
children: c.formatMessage(e.showEmptyValuesCTA)
|
|
17
|
-
}) : /* @__PURE__ */ r
|
|
17
|
+
}) : /* @__PURE__ */ n(r, {
|
|
18
18
|
className: i.button,
|
|
19
19
|
onClick: o,
|
|
20
20
|
"data-target-id": "TextButton-hideEmptyValuesCTA",
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import e from "../esm/lib/messages.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { useIntl as n } from "react-intl";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { Text as a } from "@box/blueprint-web";
|
|
6
6
|
import { bpTextTextOnLightSecondary as o } from "@box/blueprint-web-assets/tokens/tokens";
|
|
7
7
|
import { InfoBadge as s } from "@box/blueprint-web-assets/icons/Line";
|
|
8
8
|
import '../styles/metadata-instance-form-ai-disclaimer.css';var c = {
|
|
9
9
|
aiDisclaimer: "_aiDisclaimer_6i2mf_1",
|
|
10
10
|
infoBadgeIcon: "_infoBadgeIcon_6i2mf_7"
|
|
11
11
|
}, l = (e) => e.some((e) => !!e.confidenceScore || !!e.isExtracted), u = ({ fields: u, isLoading: d, isBoundingBoxOrConfidenceScoreReviewEnabled: f }) => {
|
|
12
|
-
let p =
|
|
13
|
-
return !f || !m || d ? null : /* @__PURE__ */
|
|
12
|
+
let p = n(), m = t(() => l(u), [u]);
|
|
13
|
+
return !f || !m || d ? null : /* @__PURE__ */ i("div", {
|
|
14
14
|
className: c.aiDisclaimer,
|
|
15
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ r(s, {
|
|
16
16
|
className: c.infoBadgeIcon,
|
|
17
17
|
width: 12,
|
|
18
18
|
height: 12,
|
|
19
19
|
color: o
|
|
20
|
-
}), /* @__PURE__ */
|
|
20
|
+
}), /* @__PURE__ */ r(a, {
|
|
21
21
|
as: "p",
|
|
22
22
|
color: "textOnLightSecondary",
|
|
23
23
|
variant: "bodySmall",
|
|
@@ -3,56 +3,56 @@ import { autofillMessages as n } from "../esm/lib/messages.js";
|
|
|
3
3
|
import { getTooltipContent as r } from "../esm/lib/utils/utils.js";
|
|
4
4
|
import { useAutofill as i } from "../esm/lib/utils/autofill-context.js";
|
|
5
5
|
import a from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { forwardRef as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
7
|
+
import { useIntl as u } from "react-intl";
|
|
8
|
+
import { BoxAiAdvancedLogo24 as d, BoxAiLogo24 as f } from "@box/blueprint-web-assets/icons/Logo";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import { Button as h, DropdownMenu as g, IconButton as _, LoadingIndicator as v, SplitButton as y, Text as b, Tooltip as x } from "@box/blueprint-web";
|
|
11
11
|
import { getIn as S, useFormikContext as C } from "formik";
|
|
12
12
|
import { useLocalStorageAIAgents as w } from "@box/box-ai-agent-selector";
|
|
13
13
|
import '../styles/metadata-instance-form-autofill-button.css';var T = {
|
|
14
14
|
loadingIndicator: "_loadingIndicator_zhzu0_1",
|
|
15
15
|
actionMenuItem: "_actionMenuItem_zhzu0_11",
|
|
16
16
|
splitButtonIcon: "_splitButtonIcon_zhzu0_17"
|
|
17
|
-
}, E = /*#__PURE__*/
|
|
18
|
-
let
|
|
19
|
-
|
|
17
|
+
}, E = /*#__PURE__*/ o(({ isButtonDisabled: t, onAutofill: n, onAgentChange: r, storedAgent: i, icon: o, ...s }, c) => {
|
|
18
|
+
let d = u(), [f, h] = l(i || "standard"), _ = (e) => {
|
|
19
|
+
h(e), r(e), setTimeout(() => {
|
|
20
20
|
n(e);
|
|
21
21
|
}, 0);
|
|
22
22
|
};
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
...
|
|
25
|
-
ref:
|
|
23
|
+
return /* @__PURE__ */ p(y, {
|
|
24
|
+
...s,
|
|
25
|
+
ref: c,
|
|
26
26
|
disabled: t,
|
|
27
27
|
dropdownTriggerAriaLabel: "See agent options.",
|
|
28
28
|
endIcon: o,
|
|
29
|
-
label:
|
|
29
|
+
label: d.formatMessage(a.autofillButton),
|
|
30
30
|
onClick: () => n(),
|
|
31
31
|
variant: "secondary",
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
onValueChange: (e) =>
|
|
34
|
-
value:
|
|
32
|
+
children: /* @__PURE__ */ p(g.RadioGroup, {
|
|
33
|
+
onValueChange: (e) => _(e),
|
|
34
|
+
value: f,
|
|
35
35
|
children: Object.entries(e).map(([e, t]) => {
|
|
36
36
|
let n = t.ICON;
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ p(g.RadioSelectItem, {
|
|
38
38
|
value: t.AGENT_TYPE,
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ m("div", {
|
|
40
40
|
className: T.actionMenuItem,
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ p(n, {
|
|
42
42
|
"aria-hidden": !0,
|
|
43
43
|
className: T.splitButtonIcon
|
|
44
|
-
}), /* @__PURE__ */ b
|
|
44
|
+
}), /* @__PURE__ */ p(b, {
|
|
45
45
|
as: "span",
|
|
46
|
-
children:
|
|
46
|
+
children: d.formatMessage(a[t.DISPLAY_MSG])
|
|
47
47
|
})]
|
|
48
48
|
})
|
|
49
49
|
}, e);
|
|
50
50
|
})
|
|
51
51
|
})
|
|
52
52
|
});
|
|
53
|
-
}), D = ({ areAiSuggestionsAvailable:
|
|
54
|
-
let { isSubmitting: D, values: O, setFieldValue: k } = C(), A =
|
|
55
|
-
|
|
53
|
+
}), D = ({ areAiSuggestionsAvailable: o, isBetaLanguageEnabled: l, isLoading: m, variant: g = "secondary-button", isAdvancedExtractAgentEnabled: y = !1, onAutofill: b }) => {
|
|
54
|
+
let { isSubmitting: D, values: O, setFieldValue: k } = C(), A = u(), [j, M] = w(t), { suggestions: N, confidenceScores: P, targetLocations: F } = i();
|
|
55
|
+
s(() => {
|
|
56
56
|
if (N) {
|
|
57
57
|
let e = S(O, "metadata.fields"), t = S(O, "metadata.templateKey");
|
|
58
58
|
k("metadata.fields", e?.map((e) => {
|
|
@@ -73,21 +73,21 @@ import '../styles/metadata-instance-form-autofill-button.css';var T = {
|
|
|
73
73
|
]);
|
|
74
74
|
let I = (t) => {
|
|
75
75
|
let n = S(O, "metadata.templateKey"), r = S(O, "metadata.scope"), i = t ? e[t]?.AGENT_ID : e[j]?.AGENT_ID;
|
|
76
|
-
|
|
77
|
-
}, L = !
|
|
78
|
-
|
|
76
|
+
b(n, r, y ? i : void 0);
|
|
77
|
+
}, L = !o || D || m, R = j === "enhanced" && y ? d : f, z = c(() => r(y, j, A), [
|
|
78
|
+
y,
|
|
79
79
|
j,
|
|
80
80
|
A
|
|
81
81
|
]);
|
|
82
|
-
return
|
|
82
|
+
return g === "secondary-button" ? /* @__PURE__ */ p(x, {
|
|
83
83
|
content: z,
|
|
84
|
-
children:
|
|
84
|
+
children: y ? /* @__PURE__ */ p(E, {
|
|
85
85
|
icon: R,
|
|
86
86
|
isButtonDisabled: L,
|
|
87
87
|
onAgentChange: M,
|
|
88
88
|
onAutofill: I,
|
|
89
89
|
storedAgent: j
|
|
90
|
-
}) : /* @__PURE__ */
|
|
90
|
+
}) : /* @__PURE__ */ p(h, {
|
|
91
91
|
disabled: L,
|
|
92
92
|
endIcon: R,
|
|
93
93
|
onClick: () => I(),
|
|
@@ -95,12 +95,12 @@ import '../styles/metadata-instance-form-autofill-button.css';var T = {
|
|
|
95
95
|
"data-target-id": "Button-autofillButton",
|
|
96
96
|
children: A.formatMessage(a.autofillButton)
|
|
97
97
|
})
|
|
98
|
-
}) : /* @__PURE__ */
|
|
98
|
+
}) : /* @__PURE__ */ p(x, {
|
|
99
99
|
content: z,
|
|
100
|
-
children:
|
|
100
|
+
children: m ? /* @__PURE__ */ p(v, {
|
|
101
101
|
"aria-label": A.formatMessage(a.loadingButtonAriaLabel),
|
|
102
102
|
className: T.loadingIndicator
|
|
103
|
-
}) : /* @__PURE__ */
|
|
103
|
+
}) : /* @__PURE__ */ p(_, {
|
|
104
104
|
"aria-label": A.formatMessage(n.autofillButtonAriaLabel),
|
|
105
105
|
disabled: L,
|
|
106
106
|
icon: R,
|
|
@@ -2,9 +2,9 @@ import { TEMPLATE_CUSTOM_PROPERTIES as e } from "../esm/lib/constants.js";
|
|
|
2
2
|
import { t } from "./metadata-instance-form-ai-disclaimer.js";
|
|
3
3
|
import { t as n } from "./metadata-instance-form-footer.js";
|
|
4
4
|
import { t as r } from "./metadata-instance-form-header.js";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import c from "
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import o from "clsx";
|
|
7
|
+
import { Card as s, useBlueprintModernization as c } from "@box/blueprint-web";
|
|
8
8
|
import '../styles/metadata-instance-form-card-wrapper.css';var l = {
|
|
9
9
|
metadataInstanceForm: "_metadataInstanceForm_ztv76_1",
|
|
10
10
|
wrapperGradient: "_wrapperGradient_ztv76_7",
|
|
@@ -13,15 +13,15 @@ import '../styles/metadata-instance-form-card-wrapper.css';var l = {
|
|
|
13
13
|
metadataInstanceFormContentReducedGap: "_metadataInstanceFormContentReducedGap_ztv76_30",
|
|
14
14
|
showOverlay: "_showOverlay_ztv76_34"
|
|
15
15
|
}, u = (u) => {
|
|
16
|
-
let { areAiSuggestionsAvailable: d, children: f, className: p, formRef: m, formValues: h, isAdvancedExtractAgentEnabled: g = !1, isAiSuggestionsFeatureEnabled: _, isBetaLanguageEnabled: v, isConfidenceScoreReviewEnabled: y = !1, isBoundingBoxEnabled: b = !1, isLargeFile: x = !1, isDeleteButtonDisabled: S, onToggleReviewFilter: C, shouldShowOnlyReviewFields: w = !1, suggestions: T, isFetchingSuggestions: E, isFormDirty: D = !1, selectedTemplateInstance: O, getAiSuggestions: k, handleCancel: A, handleDelete: j } = u, { enableModernizedComponents: M } =
|
|
17
|
-
return /* @__PURE__ */
|
|
16
|
+
let { areAiSuggestionsAvailable: d, children: f, className: p, formRef: m, formValues: h, isAdvancedExtractAgentEnabled: g = !1, isAiSuggestionsFeatureEnabled: _, isBetaLanguageEnabled: v, isConfidenceScoreReviewEnabled: y = !1, isBoundingBoxEnabled: b = !1, isLargeFile: x = !1, isDeleteButtonDisabled: S, onToggleReviewFilter: C, shouldShowOnlyReviewFields: w = !1, suggestions: T, isFetchingSuggestions: E, isFormDirty: D = !1, selectedTemplateInstance: O, getAiSuggestions: k, handleCancel: A, handleDelete: j } = u, { enableModernizedComponents: M } = c(), N = O?.templateKey === e, P = !!T[O?.templateKey], F = y || b;
|
|
17
|
+
return /* @__PURE__ */ i("div", {
|
|
18
18
|
className: E && l.wrapperGradient,
|
|
19
19
|
"data-modern": M,
|
|
20
|
-
children: /* @__PURE__ */ s
|
|
20
|
+
children: /* @__PURE__ */ a(s, {
|
|
21
21
|
ref: m,
|
|
22
|
-
className:
|
|
22
|
+
className: o(p, { [l.suggestionsFetching]: E }),
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ i(r, {
|
|
25
25
|
areAiSuggestionsAvailable: d,
|
|
26
26
|
hasSuggestions: P,
|
|
27
27
|
isAdvancedExtractAgentEnabled: g,
|
|
@@ -36,12 +36,12 @@ import '../styles/metadata-instance-form-card-wrapper.css';var l = {
|
|
|
36
36
|
templateName: O?.displayName
|
|
37
37
|
}),
|
|
38
38
|
O && f,
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ i(t, {
|
|
40
40
|
isLoading: E,
|
|
41
41
|
isBoundingBoxOrConfidenceScoreReviewEnabled: F,
|
|
42
42
|
fields: h.metadata?.fields ?? []
|
|
43
43
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ i(n, {
|
|
45
45
|
isDeleteButtonDisabled: S,
|
|
46
46
|
isLoading: E,
|
|
47
47
|
onCancel: () => A(D),
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import e from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useIntl as t } from "react-intl";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Button as i, TextButton as a } from "@box/blueprint-web";
|
|
5
5
|
import { useFormikContext as o } from "formik";
|
|
6
6
|
import '../styles/metadata-instance-form-footer.css';var s = {
|
|
7
7
|
metadataInstanceFormFooter: "_metadataInstanceFormFooter_sqpiw_1",
|
|
8
8
|
buttonsContainer: "_buttonsContainer_sqpiw_7",
|
|
9
9
|
buttons: "_buttons_sqpiw_7"
|
|
10
10
|
}, c = ({ isDeleteButtonDisabled: c, isLoading: l, onCancel: u, onDelete: d }) => {
|
|
11
|
-
let f =
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
let f = t(), { isSubmitting: p, submitForm: m } = o(), h = l || p;
|
|
12
|
+
return /* @__PURE__ */ n("div", {
|
|
13
13
|
className: s.metadataInstanceFormFooter,
|
|
14
|
-
children: /* @__PURE__ */
|
|
14
|
+
children: /* @__PURE__ */ r("div", {
|
|
15
15
|
className: s.buttonsContainer,
|
|
16
|
-
children: [/* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ n(a, {
|
|
17
17
|
disabled: h || c,
|
|
18
18
|
onClick: d,
|
|
19
19
|
"data-target-id": "TextButton-deleteButton",
|
|
20
20
|
children: f.formatMessage(e.deleteButton)
|
|
21
|
-
}), /* @__PURE__ */
|
|
21
|
+
}), /* @__PURE__ */ r("div", {
|
|
22
22
|
className: s.buttons,
|
|
23
|
-
children: [/* @__PURE__ */ i
|
|
23
|
+
children: [/* @__PURE__ */ n(i, {
|
|
24
24
|
disabled: h,
|
|
25
25
|
onClick: u,
|
|
26
26
|
size: "large",
|
|
27
27
|
variant: "secondary",
|
|
28
28
|
"data-target-id": "Button-cancelButton",
|
|
29
29
|
children: f.formatMessage(e.cancelButton)
|
|
30
|
-
}), /* @__PURE__ */ i
|
|
30
|
+
}), /* @__PURE__ */ n(i, {
|
|
31
31
|
"data-target-id": "Button-metadataEditorSave",
|
|
32
32
|
disabled: h,
|
|
33
33
|
loading: p,
|
|
@@ -3,11 +3,11 @@ import { autofillMessages as n } from "../esm/lib/messages.js";
|
|
|
3
3
|
import { getTooltipContent as r } from "../esm/lib/utils/utils.js";
|
|
4
4
|
import { t as i } from "./interactive-header-text.js";
|
|
5
5
|
import a from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { useMemo as o } from "react";
|
|
7
|
+
import { useIntl as s } from "react-intl";
|
|
8
|
+
import { BoxAiAdvancedLogo24 as c, BoxAiLogo24 as l } from "@box/blueprint-web-assets/icons/Logo";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import { IconButton as f, Tooltip as p } from "@box/blueprint-web";
|
|
11
11
|
import { Pencil as m } from "@box/blueprint-web-assets/icons/Line";
|
|
12
12
|
import { useLocalStorageAIAgents as h } from "@box/box-ai-agent-selector";
|
|
13
13
|
import '../styles/metadata-instance-header.css';var g = {
|
|
@@ -15,31 +15,31 @@ import '../styles/metadata-instance-header.css';var g = {
|
|
|
15
15
|
iconButtonsContainer: "_iconButtonsContainer_17bsu_6",
|
|
16
16
|
title: "_title_17bsu_14"
|
|
17
17
|
}, _ = ({ areAiSuggestionsAvailable: _, canEdit: v, isAiSuggestionsFeatureEnabled: y, isBetaLanguageEnabled: b, onEdit: x, onAutofill: S, templateName: C, isAdvancedExtractAgentEnabled: w = !1 }) => {
|
|
18
|
-
let T =
|
|
18
|
+
let T = s(), E = C || T.formatMessage(a.customInstanceTitle), D = y && C, [O] = h(t), k = w && e[O]?.AGENT_ID, A = o(() => r(w, O, T), [
|
|
19
19
|
w,
|
|
20
20
|
O,
|
|
21
21
|
T
|
|
22
22
|
]);
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ d("div", {
|
|
24
24
|
className: g.metadataInstanceHeader,
|
|
25
|
-
children: [/* @__PURE__ */
|
|
25
|
+
children: [/* @__PURE__ */ u(i, {
|
|
26
26
|
className: g.title,
|
|
27
27
|
title: E
|
|
28
|
-
}), v && /* @__PURE__ */
|
|
28
|
+
}), v && /* @__PURE__ */ d("div", {
|
|
29
29
|
className: g.iconButtonsContainer,
|
|
30
|
-
children: [D && /* @__PURE__ */
|
|
30
|
+
children: [D && /* @__PURE__ */ u(p, {
|
|
31
31
|
content: A,
|
|
32
|
-
children: /* @__PURE__ */ f
|
|
32
|
+
children: /* @__PURE__ */ u(f, {
|
|
33
33
|
"aria-label": T.formatMessage(n.autofillButtonAriaLabelWithTemplateName, { templateName: C }),
|
|
34
34
|
disabled: !_,
|
|
35
|
-
icon: O === "enhanced" && w ?
|
|
35
|
+
icon: O === "enhanced" && w ? c : l,
|
|
36
36
|
onClick: () => S(k || void 0),
|
|
37
37
|
variant: "icon-logo",
|
|
38
38
|
"data-target-id": "IconButton-autofillButtonAriaLabelWithTemplateName"
|
|
39
39
|
})
|
|
40
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ u(p, {
|
|
41
41
|
content: T.formatMessage(a.editButtonTooltip),
|
|
42
|
-
children: /* @__PURE__ */ f
|
|
42
|
+
children: /* @__PURE__ */ u(f, {
|
|
43
43
|
"aria-label": T.formatMessage(a.editButtonAriaLabel, { templateName: C }),
|
|
44
44
|
icon: m,
|
|
45
45
|
onClick: x,
|