@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.
Files changed (57) hide show
  1. package/dist/chunks/add-metadata-template-dropdown-with-browser.js +34 -0
  2. package/dist/chunks/ai-suggestion-field.js +31 -31
  3. package/dist/chunks/autofill-overlay.js +13 -13
  4. package/dist/chunks/combobox-with-api-pagination.js +40 -40
  5. package/dist/chunks/custom-instance-new-field.js +13 -13
  6. package/dist/chunks/custom-instance.js +19 -19
  7. package/dist/chunks/delete-confirmation-modal.js +20 -20
  8. package/dist/chunks/filter-instances-dropdown.js +24 -24
  9. package/dist/chunks/interactive-header-text.js +8 -8
  10. package/dist/chunks/metadata-instance-entry.js +24 -24
  11. package/dist/chunks/metadata-instance-footer.js +7 -7
  12. package/dist/chunks/metadata-instance-form-ai-disclaimer.js +8 -8
  13. package/dist/chunks/metadata-instance-form-autofill-button.js +32 -32
  14. package/dist/chunks/metadata-instance-form-card-wrapper.js +10 -10
  15. package/dist/chunks/metadata-instance-form-footer.js +10 -10
  16. package/dist/chunks/metadata-instance-header.js +14 -14
  17. package/dist/chunks/metadata-instance.js +12 -12
  18. package/dist/chunks/taxonomy-ancestor-status-pill.js +21 -21
  19. package/dist/chunks/update-mode-field-wrapper.js +22 -22
  20. package/dist/chunks/utils.js +26 -26
  21. package/dist/esm/index.js +21 -20
  22. package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown-with-browser.js +2 -0
  23. package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +24 -2
  24. package/dist/esm/lib/components/add-metadata-template-dropdown/index.js +3 -2
  25. package/dist/esm/lib/components/add-metadata-template-dropdown/shared/dropdown-trigger.js +16 -0
  26. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +5 -5
  27. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.js +5 -5
  28. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +12 -12
  29. package/dist/esm/lib/components/interactive-text/interactive-text.js +7 -7
  30. package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +11 -11
  31. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +5 -5
  32. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +17 -17
  33. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +11 -11
  34. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +17 -17
  35. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +9 -9
  36. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +10 -10
  37. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +11 -11
  38. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/legacy-metadata-taxonomy-field.js +11 -11
  39. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-picker-field/metadata-taxonomy-picker-field.js +11 -11
  40. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +33 -33
  41. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +10 -10
  42. package/dist/esm/lib/components/metadata-empty-state/metadata-empty-state.js +12 -12
  43. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +10 -10
  44. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js +4 -4
  45. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.js +6 -6
  46. package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +7 -7
  47. package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +16 -16
  48. package/dist/styles/add-metadata-template-dropdown-with-browser.css +1 -0
  49. package/dist/types/index.d.ts +1 -1
  50. package/dist/types/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown-with-browser.d.ts +16 -0
  51. package/dist/types/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.d.ts +9 -1
  52. package/dist/types/lib/components/add-metadata-template-dropdown/index.d.ts +3 -1
  53. package/dist/types/lib/components/add-metadata-template-dropdown/shared/dropdown-trigger.d.ts +6 -0
  54. package/dist/types/lib/components/add-metadata-template-dropdown/types.d.ts +32 -22
  55. package/package.json +12 -12
  56. package/dist/chunks/add-metadata-template-dropdown.js +0 -84
  57. 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 { Divider as r, ScrollableContainer as i, Text as a, TriggerButton as o } from "@box/blueprint-web";
4
- import { Checkmark as s } from "@box/blueprint-web-assets/icons/Fill";
5
- import { Space1 as c } from "@box/blueprint-web-assets/tokens/px-tokens";
6
- import { useEffect as l } from "react";
7
- import { useIntl as u } from "react-intl";
8
- import { Select as d, SelectItem as f, SelectItemCheck as p, SelectPopover as m, SelectProvider as h } from "@ariakit/react";
9
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
10
- import v from "clsx";
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(c, 10);
23
- function x({ appliedTemplates: c, selectedTemplates: x, setSelectedTemplates: S }) {
24
- let C = u(), w = C.formatMessage(n.customMetadataName), T = t(c), E = x.length, D = T.length, O = E === 0 ? C.formatMessage(n.allTemplatesTriggerButtonText) : C.formatMessage(n.selectedTemplatesTriggerButtonText, {
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 l(() => {
28
+ return r(() => {
29
29
  E === D && S([]);
30
- }, [E, D]), /* @__PURE__ */ _(h, {
30
+ }, [E, D]), /* @__PURE__ */ d(l, {
31
31
  setValue: S,
32
32
  value: x,
33
- children: [/* @__PURE__ */ _("div", {
33
+ children: [/* @__PURE__ */ d("div", {
34
34
  className: y.triggerContainer,
35
- children: [/* @__PURE__ */ g(d, { render: /* @__PURE__ */ g(o, {
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__ */ g(a, {
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__ */ g(m, {
50
+ }), /* @__PURE__ */ u(c, {
51
51
  className: y.popover,
52
52
  gutter: b,
53
- children: /* @__PURE__ */ _(i, {
53
+ children: /* @__PURE__ */ d(m, {
54
54
  className: y.scrollableContainer,
55
55
  children: [
56
- /* @__PURE__ */ _(f, {
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__ */ g(s, { className: v(y.indicator, y.indicatorIcon) }), C.formatMessage(n.allTemplatesTriggerButtonText)]
63
+ children: [E === 0 && /* @__PURE__ */ u(_, { className: f(y.indicator, y.indicatorIcon) }), C.formatMessage(n.allTemplatesTriggerButtonText)]
64
64
  }),
65
- /* @__PURE__ */ g(r, { className: y.divider }),
66
- T.map((t) => /* @__PURE__ */ _(f, {
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__ */ g(p, {
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__ */ g(s, { className: y.indicatorIcon })
76
+ children: /* @__PURE__ */ u(_, { className: y.indicatorIcon })
77
77
  }), e(t, w)]
78
78
  }, t.id))
79
79
  ]
@@ -1,17 +1,17 @@
1
- import { Text as e, Tooltip as t, useIsEllipsized as n } from "@box/blueprint-web";
2
- import { useRef as r } from "react";
3
- import { Focusable as i } from "@ariakit/react";
4
- import { jsx as a } from "react/jsx-runtime";
5
- import o from "clsx";
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 = r(null), d = n(u), f = /* @__PURE__ */ a(i, { render: /* @__PURE__ */ a(e, {
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: o(s.header, c),
10
+ className: r(s.header, c),
11
11
  variant: "titleMedium",
12
12
  children: l
13
13
  }) });
14
- return d ? /* @__PURE__ */ a(t, {
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 ee } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
12
- import { Status as u, Text as d, Tooltip as f, useIsEllipsized as p } from "@box/blueprint-web";
13
- import { useRef as m } from "react";
14
- import { FormattedDate as h, useIntl as g } from "react-intl";
15
- import { Focusable as _ } from "@ariakit/react";
16
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
17
- import b from "clsx";
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 = g(), { trackEvent: z } = n(), B = m(null), V = p(B), H = (e) => {
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__ */ v(h, {
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__ */ y("div", { children: [/* @__PURE__ */ v("div", { children: T }), /* @__PURE__ */ v("div", { children: C })] }) : C;
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__ */ v("h5", {
53
+ })(), Q = /* @__PURE__ */ m("h5", {
54
54
  className: S.name,
55
- children: /* @__PURE__ */ v(d, {
55
+ children: /* @__PURE__ */ m(v, {
56
56
  ref: H,
57
57
  as: "span",
58
- className: b(S.nameText, C && c.interactiveTextHint),
58
+ className: g(S.nameText, C && c.interactiveTextHint),
59
59
  color: "textOnLightSecondary",
60
60
  variant: "bodyDefaultBold",
61
61
  children: T
62
62
  })
63
- }), $ = /* @__PURE__ */ y("div", {
64
- className: b(S.metadataInstanceEntry, U && o.spacious, K && o.clickableField, K && w && o.selectedField),
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__ */ y("div", {
66
+ children: [/* @__PURE__ */ h("div", {
67
67
  className: S.labelContainer,
68
- children: [q && /* @__PURE__ */ v(f, {
68
+ children: [q && /* @__PURE__ */ m(y, {
69
69
  content: q,
70
- children: /* @__PURE__ */ v("span", {
70
+ children: /* @__PURE__ */ m("span", {
71
71
  className: S.confidenceScoreIcon,
72
- children: /* @__PURE__ */ v(u, {
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__ */ v("div", {
82
+ }), /* @__PURE__ */ m("div", {
83
83
  className: S.nameLabel,
84
- children: Z ? /* @__PURE__ */ v(f, {
84
+ children: Z ? /* @__PURE__ */ m(y, {
85
85
  content: Z,
86
- children: /* @__PURE__ */ v(_, { render: Q })
86
+ children: /* @__PURE__ */ m(p, { render: Q })
87
87
  }) : Q
88
88
  })]
89
- }), /* @__PURE__ */ v(ee, {
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__ */ v(f, {
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 { TextButton as t } from "@box/blueprint-web";
3
- import { useIntl as n } from "react-intl";
4
- import { jsx as r } from "react/jsx-runtime";
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 = n();
10
- return /* @__PURE__ */ r("div", {
9
+ let c = t();
10
+ return /* @__PURE__ */ n("div", {
11
11
  className: i.metadataInstanceFooter,
12
- children: a ? /* @__PURE__ */ r(t, {
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(t, {
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 { Text as t } from "@box/blueprint-web";
3
- import { useMemo as n } from "react";
4
- import { useIntl as r } from "react-intl";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
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 = r(), m = n(() => l(u), [u]);
13
- return !f || !m || d ? null : /* @__PURE__ */ a("div", {
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__ */ i(s, {
15
+ children: [/* @__PURE__ */ r(s, {
16
16
  className: c.infoBadgeIcon,
17
17
  width: 12,
18
18
  height: 12,
19
19
  color: o
20
- }), /* @__PURE__ */ i(t, {
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 { Button as o, DropdownMenu as s, IconButton as c, LoadingIndicator as l, SplitButton as u, Text as d, Tooltip as f } from "@box/blueprint-web";
7
- import { forwardRef as p, useEffect as m, useMemo as h, useState as g } from "react";
8
- import { useIntl as _ } from "react-intl";
9
- import { BoxAiAdvancedLogo24 as v, BoxAiLogo24 as y } from "@box/blueprint-web-assets/icons/Logo";
10
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
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__*/ p(({ isButtonDisabled: t, onAutofill: n, onAgentChange: r, storedAgent: i, icon: o, ...c }, l) => {
18
- let f = _(), [p, m] = g(i || "standard"), h = (e) => {
19
- m(e), r(e), setTimeout(() => {
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__ */ b(u, {
24
- ...c,
25
- ref: l,
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: f.formatMessage(a.autofillButton),
29
+ label: d.formatMessage(a.autofillButton),
30
30
  onClick: () => n(),
31
31
  variant: "secondary",
32
- children: /* @__PURE__ */ b(s.RadioGroup, {
33
- onValueChange: (e) => h(e),
34
- value: p,
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__ */ b(s.RadioSelectItem, {
37
+ return /* @__PURE__ */ p(g.RadioSelectItem, {
38
38
  value: t.AGENT_TYPE,
39
- children: /* @__PURE__ */ x("div", {
39
+ children: /* @__PURE__ */ m("div", {
40
40
  className: T.actionMenuItem,
41
- children: [/* @__PURE__ */ b(n, {
41
+ children: [/* @__PURE__ */ p(n, {
42
42
  "aria-hidden": !0,
43
43
  className: T.splitButtonIcon
44
- }), /* @__PURE__ */ b(d, {
44
+ }), /* @__PURE__ */ p(b, {
45
45
  as: "span",
46
- children: f.formatMessage(a[t.DISPLAY_MSG])
46
+ children: d.formatMessage(a[t.DISPLAY_MSG])
47
47
  })]
48
48
  })
49
49
  }, e);
50
50
  })
51
51
  })
52
52
  });
53
- }), D = ({ areAiSuggestionsAvailable: s, isBetaLanguageEnabled: u, isLoading: d, variant: p = "secondary-button", isAdvancedExtractAgentEnabled: g = !1, onAutofill: x }) => {
54
- let { isSubmitting: D, values: O, setFieldValue: k } = C(), A = _(), [j, M] = w(t), { suggestions: N, confidenceScores: P, targetLocations: F } = i();
55
- m(() => {
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
- x(n, r, g ? i : void 0);
77
- }, L = !s || D || d, R = j === "enhanced" && g ? v : y, z = h(() => r(g, j, A), [
78
- g,
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 p === "secondary-button" ? /* @__PURE__ */ b(f, {
82
+ return g === "secondary-button" ? /* @__PURE__ */ p(x, {
83
83
  content: z,
84
- children: g ? /* @__PURE__ */ b(E, {
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__ */ b(o, {
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__ */ b(f, {
98
+ }) : /* @__PURE__ */ p(x, {
99
99
  content: z,
100
- children: d ? /* @__PURE__ */ b(l, {
100
+ children: m ? /* @__PURE__ */ p(v, {
101
101
  "aria-label": A.formatMessage(a.loadingButtonAriaLabel),
102
102
  className: T.loadingIndicator
103
- }) : /* @__PURE__ */ b(c, {
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 { Card as i, useBlueprintModernization as a } from "@box/blueprint-web";
6
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import c from "clsx";
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 } = a(), N = O?.templateKey === e, P = !!T[O?.templateKey], F = y || b;
17
- return /* @__PURE__ */ o("div", {
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(i, {
20
+ children: /* @__PURE__ */ a(s, {
21
21
  ref: m,
22
- className: c(p, { [l.suggestionsFetching]: E }),
22
+ className: o(p, { [l.suggestionsFetching]: E }),
23
23
  children: [
24
- /* @__PURE__ */ o(r, {
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__ */ o(t, {
39
+ /* @__PURE__ */ i(t, {
40
40
  isLoading: E,
41
41
  isBoundingBoxOrConfidenceScoreReviewEnabled: F,
42
42
  fields: h.metadata?.fields ?? []
43
43
  }),
44
- /* @__PURE__ */ o(n, {
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 { Button as t, TextButton as n } from "@box/blueprint-web";
3
- import { useIntl as r } from "react-intl";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
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 = r(), { isSubmitting: p, submitForm: m } = o(), h = l || p;
12
- return /* @__PURE__ */ i("div", {
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__ */ a("div", {
14
+ children: /* @__PURE__ */ r("div", {
15
15
  className: s.buttonsContainer,
16
- children: [/* @__PURE__ */ i(n, {
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__ */ a("div", {
21
+ }), /* @__PURE__ */ r("div", {
22
22
  className: s.buttons,
23
- children: [/* @__PURE__ */ i(t, {
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(t, {
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 { IconButton as o, Tooltip as s } from "@box/blueprint-web";
7
- import { useMemo as c } from "react";
8
- import { useIntl as l } from "react-intl";
9
- import { BoxAiAdvancedLogo24 as u, BoxAiLogo24 as d } from "@box/blueprint-web-assets/icons/Logo";
10
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
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 = l(), E = C || T.formatMessage(a.customInstanceTitle), D = y && C, [O] = h(t), k = w && e[O]?.AGENT_ID, A = c(() => r(w, O, 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__ */ p("div", {
23
+ return /* @__PURE__ */ d("div", {
24
24
  className: g.metadataInstanceHeader,
25
- children: [/* @__PURE__ */ f(i, {
25
+ children: [/* @__PURE__ */ u(i, {
26
26
  className: g.title,
27
27
  title: E
28
- }), v && /* @__PURE__ */ p("div", {
28
+ }), v && /* @__PURE__ */ d("div", {
29
29
  className: g.iconButtonsContainer,
30
- children: [D && /* @__PURE__ */ f(s, {
30
+ children: [D && /* @__PURE__ */ u(p, {
31
31
  content: A,
32
- children: /* @__PURE__ */ f(o, {
32
+ children: /* @__PURE__ */ u(f, {
33
33
  "aria-label": T.formatMessage(n.autofillButtonAriaLabelWithTemplateName, { templateName: C }),
34
34
  disabled: !_,
35
- icon: O === "enhanced" && w ? u : d,
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__ */ f(s, {
40
+ }), /* @__PURE__ */ u(p, {
41
41
  content: T.formatMessage(a.editButtonTooltip),
42
- children: /* @__PURE__ */ f(o, {
42
+ children: /* @__PURE__ */ u(f, {
43
43
  "aria-label": T.formatMessage(a.editButtonAriaLabel, { templateName: C }),
44
44
  icon: m,
45
45
  onClick: x,