@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
@@ -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 { Card as s, Divider as c } from "@box/blueprint-web";
9
- import { useState as l } from "react";
10
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
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] = l(!0), { getAiSuggestions: P } = t();
17
- return /* @__PURE__ */ f(s, { children: [
18
- /* @__PURE__ */ d(o, {
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__ */ d(c, { className: p.topDivider }),
31
- j && /* @__PURE__ */ d("div", {
30
+ /* @__PURE__ */ l(f, { className: p.topDivider }),
31
+ j && /* @__PURE__ */ l("div", {
32
32
  className: p.reviewNotice,
33
- children: /* @__PURE__ */ d(r, {
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__ */ d(e, {
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__ */ f(u, { children: [/* @__PURE__ */ d(i, {
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__ */ f(u, { children: [/* @__PURE__ */ d(c, { className: p.bottomDivider }), /* @__PURE__ */ d(a, {
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 { FilterChip as t, InlineNotice as n, LoadingIndicator as r, Popover as i, TextButton as a } from "@box/blueprint-web";
3
- import { Loader as o } from "@box/blueprint-web-assets/icons/Fill";
4
- import { useState as s } from "react";
5
- import { FormattedMessage as c, useIntl as l } from "react-intl";
6
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
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 } = l(), [C, w] = s([]), [T, E] = s(!1), [D, O] = s(!1), [k, A] = s(!1), j = f(C, (e) => e.level), M = async () => {
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__ */ d(i.Root, {
35
+ return /* @__PURE__ */ a(l.Root, {
36
36
  onOpenChange: A,
37
37
  open: k,
38
- children: [/* @__PURE__ */ u(i.Trigger, { children: /* @__PURE__ */ u(t.ChipButton, {
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__ */ u(t.Label, {
46
+ children: /* @__PURE__ */ i(o.Label, {
47
47
  className: p.taxonomyValueLabel,
48
48
  children: x
49
49
  })
50
- }) }), /* @__PURE__ */ u(i.ContentContainer, {
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__ */ d(i.MainContent, {
55
+ children: /* @__PURE__ */ a(l.MainContent, {
56
56
  className: p.popoverMainContent,
57
57
  children: [
58
- D && /* @__PURE__ */ d("div", {
58
+ D && /* @__PURE__ */ a("div", {
59
59
  className: p.errorMessageWrapper,
60
- children: [/* @__PURE__ */ u(n, {
60
+ children: [/* @__PURE__ */ i(s, {
61
61
  variant: "error",
62
62
  variantIconAriaLabel: S(e.loadingResultsErrorIconLabel),
63
- children: /* @__PURE__ */ u(c, { ...e.loadingResultsErrorMessage })
64
- }), /* @__PURE__ */ u(a, {
63
+ children: /* @__PURE__ */ i(n, { ...e.loadingResultsErrorMessage })
64
+ }), /* @__PURE__ */ i(u, {
65
65
  className: p.errorMessageWrapperText,
66
- icon: o,
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__ */ u("div", {
72
+ T && /* @__PURE__ */ i("div", {
73
73
  className: p.loadingIndicatorWrapper,
74
- children: /* @__PURE__ */ u(r, {
74
+ children: /* @__PURE__ */ i(c, {
75
75
  "aria-label": S(e.loadingAriaLabel),
76
76
  size: "large"
77
77
  })
78
78
  }),
79
- !D && !T && /* @__PURE__ */ u("table", {
79
+ !D && !T && /* @__PURE__ */ i("table", {
80
80
  className: p.taxonomyAncestorTable,
81
- children: /* @__PURE__ */ u("tbody", { children: j.map((t) => /* @__PURE__ */ d("tr", { children: [/* @__PURE__ */ u("th", {
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__ */ u("td", { children: t.levelValue || /* @__PURE__ */ u(c, { ...e.emptyAncestorLevelValue }) })] }, t.id || t.level)) })
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 { IconButton as r, Radio as i } from "@box/blueprint-web";
5
- import { Settings as a, XMark as o } from "@box/blueprint-web-assets/icons/Fill";
6
- import s from "react";
7
- import { useIntl as c } from "react-intl";
8
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
- import d from "clsx";
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 = c(), T = `${y}.updateMode.mode`, E = p(C, T), D = v && s.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__ */ u("div", {
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__ */ u("div", {
23
+ children: [/* @__PURE__ */ o("div", {
24
24
  className: h.fieldContainer,
25
- children: [/* @__PURE__ */ l("span", {
25
+ children: [/* @__PURE__ */ a("span", {
26
26
  className: h.field,
27
27
  children: v
28
- }), /* @__PURE__ */ l(r, {
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 ? o : a,
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__ */ u("div", {
40
- className: d(h.radioContainer, { [h.hidden]: !k }),
41
- children: [/* @__PURE__ */ l(f, {
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__ */ u(i.Group, {
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(i.Item, {
50
+ _(b, x) && /* @__PURE__ */ a(l.Item, {
51
51
  label: w.formatMessage(n.append),
52
52
  value: t.Append
53
53
  }),
54
- /* @__PURE__ */ l(i.Item, {
54
+ /* @__PURE__ */ a(l.Item, {
55
55
  label: w.formatMessage(n.clearAndReplace),
56
56
  value: t.ClearAndReplace
57
57
  }),
58
- /* @__PURE__ */ l(i.Item, {
58
+ /* @__PURE__ */ a(l.Item, {
59
59
  label: w.formatMessage(n.removeEntered),
60
60
  value: t.RemoveEntered
61
61
  }),
62
- /* @__PURE__ */ l(i.Item, {
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__ */ l("div", {
68
+ }), g(E) && D && /* @__PURE__ */ a("div", {
69
69
  className: h.additionalFieldContainer,
70
- children: /*#__PURE__*/ s.cloneElement(D, {
70
+ children: /*#__PURE__*/ r.cloneElement(D, {
71
71
  updateModePrefix: `${y}.updateMode`,
72
72
  options: O,
73
73
  label: w.formatMessage(n.with)
@@ -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 { Tooltip as a, useForkRef as o, useIsEllipsized as s } from "@box/blueprint-web";
7
- import { createElement as c, memo as l, useRef as u } from "react";
8
- import { Focusable as d } from "@ariakit/react";
9
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
10
- import m from "clsx";
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: l, ...h }) {
26
- let g = u(null), _ = o(g, l);
27
- return /* @__PURE__ */ f(a, {
28
- content: s(g) ? /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("div", { children: r }), /* @__PURE__ */ f("div", { children: t })] }) : t,
29
- children: /* @__PURE__ */ f(d, { render: /*#__PURE__*/ c(e, {
30
- className: m(i, n.interactiveTextHint),
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 l = u(null), p = o(l, r), m = s(l) ? t : void 0, h = /*#__PURE__*/ c(e, {
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: p
40
+ ref: u
41
41
  }, t);
42
- return m ? /* @__PURE__ */ f(a, {
43
- content: m,
44
- children: /* @__PURE__ */ f(d, { render: h })
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__*/ l(function({ fieldName: t, fieldDescription: n, isAiSuggestionApplied: a, as: o, confidenceScore: s, labelProps: c }) {
48
- let { className: l, ref: u, ...d } = c, v = m(l || h.labelText, h.labelTruncated), y = !!s && e(s), b = () => s && y ? /* @__PURE__ */ f(i, {}) : a || s ? /* @__PURE__ */ f(r, { confidenceScore: s }) : null, x = n ? /* @__PURE__ */ f(g, {
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: u,
54
- ...d
55
- }) : /* @__PURE__ */ f(_, {
53
+ labelRef: p,
54
+ ...m
55
+ }) : /* @__PURE__ */ l(_, {
56
56
  as: o,
57
57
  fieldName: t,
58
58
  labelClassName: v,
59
- labelRef: u,
60
- ...d
59
+ labelRef: p,
60
+ ...m
61
61
  });
62
- return /* @__PURE__ */ p("div", {
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__ */ f(v, {
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__ */ f(v, {
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 "../chunks/add-metadata-template-dropdown.js";
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 n } from "../chunks/combobox-with-api-pagination.js";
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 r } from "../chunks/filter-instances-dropdown.js";
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 i, MULTI_VALUE_DEFAULT_TAXONOMY_OPTION as a, MULTI_VALUE_DEFAULT_VALUE as o } from "./lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js";
9
- import { MetadataEmptyState as s } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
10
- import { AutofillContext as c, AutofillContextProvider as l, TIMEOUT_10_SECONDS as u, useAutofill as d } from "./lib/utils/autofill-context.js";
11
- import { n as f, r as p, t as m } from "../chunks/types.js";
12
- import { UnsavedChangesModal as h } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
13
- import { t as g } from "../chunks/custom-instance-new-field.js";
14
- import { t as _ } from "../chunks/delete-confirmation-modal.js";
15
- import { r as v } from "../chunks/utils2.js";
16
- import { t as y } from "../chunks/metadata-instance-form-autofill-button.js";
17
- import { t as b } from "../chunks/metadata-instance-form-header.js";
18
- import { MetadataInstanceForm as x } from "./lib/components/metadata-instance-editor/index.js";
19
- import { t as S } from "../chunks/metadata-instance-header.js";
20
- import { MetadataInstance as C, MetadataInstanceList as w } from "./lib/components/metadata-instance-list/index.js";
21
- import { defaultInitialValues as T, defaultMetadataValueMap as E } from "./lib/defaults.js";
22
- import { t as D } from "../chunks/metadata-editor.js";
23
- import { withApiWrapper as O } from "./lib/utils/api-wrapper.js";
24
- export { t as AddMetadataTemplateDropdown, m as AiSuggestionState, c as AutofillContext, l as AutofillContextProvider, n as ComboboxWithApiPagination, f as ConfidenceLevel, g as CustomInstanceNewField, _ as DeleteConfirmationModal, e as FilterDropdownMenu, r as FilterInstancesDropdown, v as JSONPatchOp, i as MULTI_VALUE_DEFAULT_OPTION, a as MULTI_VALUE_DEFAULT_TAXONOMY_OPTION, o as MULTI_VALUE_DEFAULT_VALUE, D as MetadataEditor, s as MetadataEmptyState, C as MetadataInstance, x as MetadataInstanceForm, y as MetadataInstanceFormAutofillButton, b as MetadataInstanceFormHeader, S as MetadataInstanceHeader, w as MetadataInstanceList, u as TIMEOUT_10_SECONDS, h as UnsavedChangesModal, p as UpdateMode, T as defaultInitialValues, E as defaultMetadataValueMap, d as useAutofill, O as withApiWrapper };
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 };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../../../chunks/add-metadata-template-dropdown-with-browser.js";
2
+ export { e as AddMetadataTemplateDropdownWithBrowser };
@@ -1,2 +1,24 @@
1
- import { t as e } from "../../../../chunks/add-metadata-template-dropdown.js";
2
- export { e as AddMetadataTemplateDropdown };
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 { t as e } from "../../../../chunks/add-metadata-template-dropdown.js";
2
- export { e as AddMetadataTemplateDropdown };
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 { Text as n } from "@box/blueprint-web";
4
- import { useIntl as r } from "react-intl";
5
- import { jsx as i } from "react/jsx-runtime";
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 = r().formatMessage(t.noResultsFound);
8
- return /* @__PURE__ */ i(n, {
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 { ScrollableContainer as t } from "@box/blueprint-web";
3
- import { ComboboxList as n } from "@ariakit/react";
4
- import { jsx as r } from "react/jsx-runtime";
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__ */ r(n, {
7
+ return /* @__PURE__ */ n(t, {
8
8
  className: e.comboboxList,
9
9
  ...o,
10
- children: /* @__PURE__ */ r(t, {
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 { Divider as n, IconButton as r } from "@box/blueprint-web";
4
- import { Search as i, XMark as a } from "@box/blueprint-web-assets/icons/Fill";
5
- import { useIntl as o } from "react-intl";
6
- import { Combobox as s, ComboboxCancel as c } from "@ariakit/react";
7
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
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__ */ u(a, { role: "presentation" }), h = (a) => {
10
- let { ...h } = a, g = o().formatMessage(t.cancelButtonAriaLabel);
11
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
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(i, {
14
+ /* @__PURE__ */ o(u, {
15
15
  className: e.searchIcon,
16
16
  color: p,
17
17
  role: "presentation"
18
18
  }),
19
- /* @__PURE__ */ u(s, {
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__ */ u(c, { render: /* @__PURE__ */ u(r, {
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__ */ u(n, { className: e.searchDivider })] });
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 { Text as t, Tooltip as n } from "@box/blueprint-web";
3
- import { Focusable as r } from "@ariakit/react";
4
- import { jsx as i } from "react/jsx-runtime";
5
- import a from "clsx";
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__ */ i(n, {
8
+ return /* @__PURE__ */ n(a, {
9
9
  content: o,
10
- children: /* @__PURE__ */ i(r, { render: /* @__PURE__ */ i(t, {
10
+ children: /* @__PURE__ */ n(t, { render: /* @__PURE__ */ n(i, {
11
11
  as: u,
12
- className: a(e.interactiveText, s),
12
+ className: r(e.interactiveText, s),
13
13
  ...l,
14
14
  children: c
15
15
  }) })
@@ -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 { Status as i, Tooltip as a } from "@box/blueprint-web";
6
- import { useIntl as o } from "react-intl";
7
- import { BoxAiLogo as s } from "@box/blueprint-web-assets/icons/Logo";
8
- import { jsx as c } from "react/jsx-runtime";
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 } = o(), { trackEvent: f } = t(), p = () => f(e.AI_LOGO_BADGE_HOVER, { confidenceLevel: u?.level });
12
- return u ? /* @__PURE__ */ c(a, {
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__ */ c(i, {
14
+ children: /* @__PURE__ */ o(s, {
15
15
  hideText: !0,
16
- icon: s,
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(a, {
23
+ }) : /* @__PURE__ */ o(c, {
24
24
  content: d(r.aiExtractedBadgeTooltip),
25
- children: /* @__PURE__ */ c(i, {
25
+ children: /* @__PURE__ */ o(s, {
26
26
  hideText: !0,
27
- icon: s,
27
+ icon: a,
28
28
  interactive: !0,
29
29
  text: "",
30
30
  color: l,