@box/metadata-editor 1.58.4 → 1.59.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.
Files changed (28) hide show
  1. package/dist/chunks/metadata-instance-form-card-wrapper.js +41 -40
  2. package/dist/chunks/shared-field-styles.module.js +8 -0
  3. package/dist/chunks/utils2.js +33 -33
  4. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +128 -96
  5. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +110 -106
  6. package/dist/esm/lib/components/metadata-instance-list/metadata-instance-list.js +19 -15
  7. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +39 -35
  8. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +27 -20
  9. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +71 -55
  10. package/dist/esm/lib/utils/check-if-has-bounding-boxes.js +4 -0
  11. package/dist/esm/lib/utils/is-interactive-form-element.js +4 -0
  12. package/dist/styles/metadata-instance-content.css +1 -1
  13. package/dist/styles/metadata-instance-form-card-wrapper.css +1 -1
  14. package/dist/styles/shared-field-styles.css +1 -0
  15. package/dist/styles/utils.css +1 -1
  16. package/dist/types/lib/components/metadata-editor-fields/types.d.ts +2 -0
  17. package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +2 -0
  18. package/dist/types/lib/components/metadata-instance-list/metadata-instance-list.d.ts +1 -1
  19. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.d.ts +1 -1
  20. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/types.d.ts +3 -1
  21. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.d.ts +1 -1
  22. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/types.d.ts +3 -1
  23. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.d.ts +1 -1
  24. package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/types.d.ts +4 -1
  25. package/dist/types/lib/components/metadata-instance-list/types.d.ts +3 -1
  26. package/dist/types/lib/utils/check-if-has-bounding-boxes.d.ts +2 -0
  27. package/dist/types/lib/utils/is-interactive-form-element.d.ts +1 -0
  28. package/package.json +3 -3
@@ -1,89 +1,105 @@
1
- import { Tooltip as _, Status as g, Text as h } from "@box/blueprint-web";
2
- import { AlertCircle as x } from "@box/blueprint-web-assets/icons/Medium";
3
- import { useIntl as C, FormattedDate as T } from "react-intl";
4
- import { convertISOStringToUTCDate as b } from "../../../../utils/convertDate.js";
5
- import D from "../../../interactive-text/interactive-text.js";
6
- import { MetadataEntryDisplay as E } from "./metadata-entry-display.js";
7
- import v from "./messages.js";
8
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
9
- import { isConfidenceScoreNeedingReview as L } from "../../../../utils/confidence-score/is-confidence-score-needing-review.js";
10
- import { getConfidenceScoreTooltip as N } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
11
- import '../../../../../../styles/metadata-instance-entry.css';const A = "_metadataInstanceEntry_fr9av_1", M = "_name_fr9av_6", j = "_labelContainer_fr9av_14", w = "_confidenceScoreIcon_fr9av_20", n = {
12
- metadataInstanceEntry: A,
13
- name: M,
14
- labelContainer: j,
15
- confidenceScoreIcon: w
16
- }, K = ({
17
- description: o,
18
- name: a,
19
- shouldHideEmptyValues: f,
20
- type: c,
1
+ import { Tooltip as C, Status as E, Text as F } from "@box/blueprint-web";
2
+ import { AlertCircle as N } from "@box/blueprint-web-assets/icons/Medium";
3
+ import v from "clsx";
4
+ import { useIntl as A, FormattedDate as L } from "react-intl";
5
+ import { checkIfHasBoundingBoxes as M } from "../../../../utils/check-if-has-bounding-boxes.js";
6
+ import { convertISOStringToUTCDate as j } from "../../../../utils/convertDate.js";
7
+ import k from "../../../interactive-text/interactive-text.js";
8
+ import { s } from "../../../../../../chunks/shared-field-styles.module.js";
9
+ import O from "./messages.js";
10
+ import { MetadataEntryDisplay as V } from "./metadata-entry-display.js";
11
+ import { jsxs as y, jsx as e } from "react/jsx-runtime";
12
+ import { isConfidenceScoreNeedingReview as P } from "../../../../utils/confidence-score/is-confidence-score-needing-review.js";
13
+ import { getConfidenceScoreTooltip as w } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
14
+ import '../../../../../../styles/metadata-instance-entry.css';const G = "_metadataInstanceEntry_fr9av_1", H = "_name_fr9av_6", K = "_labelContainer_fr9av_14", U = "_confidenceScoreIcon_fr9av_20", a = {
15
+ metadataInstanceEntry: G,
16
+ name: H,
17
+ labelContainer: K,
18
+ confidenceScoreIcon: U
19
+ }, at = ({
20
+ description: l,
21
+ isSelected: x,
22
+ name: m,
23
+ onClick: n,
24
+ shouldHideEmptyValues: I,
25
+ type: d,
21
26
  value: t,
22
- taxonomyNodeFetcher: d,
23
- taxonomyKey: p,
24
- scope: u,
25
- isExternallyOwned: y,
27
+ taxonomyNodeFetcher: g,
28
+ taxonomyKey: h,
29
+ scope: S,
30
+ isExternallyOwned: _,
26
31
  confidenceScore: r,
27
- isConfidenceScoreReviewEnabled: S = !1
32
+ isConfidenceScoreReviewEnabled: i = !1,
33
+ targetLocation: b
28
34
  }) => {
29
- const i = C(), s = S && !!r && L(r) ? N(i.formatMessage, r) : null, l = (() => {
35
+ const f = A(), T = i && !!r && P(r), D = M(b), c = i && !!r && D && !!n, p = T ? w(f.formatMessage, r) : null, u = (() => {
30
36
  if (typeof t == "number")
31
37
  return t.toString();
32
38
  if (!t)
33
39
  return null;
34
40
  if (Array.isArray(t))
35
41
  return t.join(", ");
36
- if (c === "date" && typeof t == "string") {
37
- const I = b(t);
38
- return /* @__PURE__ */ e(T, {
42
+ if (d === "date" && typeof t == "string") {
43
+ const o = j(t);
44
+ return /* @__PURE__ */ e(L, {
39
45
  day: "numeric",
40
46
  month: "long",
41
- value: I,
47
+ value: o,
42
48
  year: "numeric"
43
49
  });
44
50
  }
45
51
  return t;
46
- })();
47
- return f && !l ? null : /* @__PURE__ */ m("div", {
48
- className: n.metadataInstanceEntry,
49
- children: [/* @__PURE__ */ m("div", {
50
- className: n.labelContainer,
51
- children: [s && /* @__PURE__ */ e(_, {
52
- content: s,
52
+ })(), B = {
53
+ "data-metadata-field": !0,
54
+ "data-testid": "metadata-field",
55
+ onClick: n,
56
+ onKeyDown: (o) => {
57
+ o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), n?.());
58
+ },
59
+ role: "button",
60
+ tabIndex: 0
61
+ };
62
+ return I && !u ? null : /* @__PURE__ */ y("div", {
63
+ className: v(a.metadataInstanceEntry, i && s.spacious, c && s.clickableField, c && x && s.selectedField),
64
+ ...c && B,
65
+ children: [/* @__PURE__ */ y("div", {
66
+ className: a.labelContainer,
67
+ children: [p && /* @__PURE__ */ e(C, {
68
+ content: p,
53
69
  children: /* @__PURE__ */ e("span", {
54
- className: n.confidenceScoreIcon,
55
- children: /* @__PURE__ */ e(g, {
70
+ className: a.confidenceScoreIcon,
71
+ children: /* @__PURE__ */ e(E, {
56
72
  color: "SurfaceStatusSurfaceGray",
57
73
  hideText: !0,
58
- icon: x,
74
+ icon: N,
59
75
  interactive: !0,
60
- text: i.formatMessage(v.confidenceScoreIconAriaLabel)
76
+ text: f.formatMessage(O.confidenceScoreIconAriaLabel)
61
77
  })
62
78
  })
63
- }), /* @__PURE__ */ e(h, {
79
+ }), /* @__PURE__ */ e(F, {
64
80
  as: "h5",
65
81
  color: "textOnLightSecondary",
66
82
  variant: "bodyDefaultBold",
67
- className: n.name,
68
- children: o ? /* @__PURE__ */ e(D, {
83
+ className: a.name,
84
+ children: l ? /* @__PURE__ */ e(k, {
69
85
  as: "span",
70
86
  color: "textOnLightSecondary",
71
- tooltipText: o,
87
+ tooltipText: l,
72
88
  variant: "bodyDefaultBold",
73
- children: a
74
- }) : a
89
+ children: m
90
+ }) : m
75
91
  })]
76
- }), /* @__PURE__ */ e(E, {
77
- formattedValue: l,
78
- isExternallyOwned: y,
79
- scope: u,
80
- taxonomyKey: p,
81
- taxonomyNodeFetcher: d,
82
- type: c,
92
+ }), /* @__PURE__ */ e(V, {
93
+ formattedValue: u,
94
+ isExternallyOwned: _,
95
+ scope: S,
96
+ taxonomyKey: h,
97
+ taxonomyNodeFetcher: g,
98
+ type: d,
83
99
  value: t
84
100
  })]
85
101
  });
86
102
  };
87
103
  export {
88
- K as MetadataInstanceEntry
104
+ at as MetadataInstanceEntry
89
105
  };
@@ -0,0 +1,4 @@
1
+ const o = (e) => e ? e.some((n) => !!n.boundingBox) : !1;
2
+ export {
3
+ o as checkIfHasBoundingBoxes
4
+ };
@@ -0,0 +1,4 @@
1
+ const n = (t) => t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement || t instanceof HTMLButtonElement;
2
+ export {
3
+ n as isInteractiveFormElement
4
+ };
@@ -1 +1 @@
1
- ._metadataInstanceContent_1a9zf_1{display:flex;flex-direction:column;gap:var(--space-4)}
1
+ ._metadataInstanceContent_1cb0f_1{display:flex;flex-direction:column;gap:var(--space-4)}._metadataInstanceContentReducedGap_1cb0f_7{gap:.375rem}
@@ -1 +1 @@
1
- ._metadataInstanceForm_moyil_1{display:flex;flex-direction:column;gap:var(--space-3)}._wrapperGradient_moyil_7[data-modern=false]{background:linear-gradient(135deg,#fe03dc,#2784fa);border-radius:var(--radius-4)}._wrapperGradient_moyil_7[data-modern=true]{background:linear-gradient(135deg,#fe03dc,#2784fa);border-radius:var(--bp-radius-10)}._suggestionsFetching_moyil_17{background:var(--box-blue-02);background-clip:padding-box;border:var(--border-1) solid transparent}._metadataInstanceFormContent_moyil_23{position:relative;display:flex;flex-direction:column;gap:var(--space-3)}._showOverlay_moyil_30{min-height:172px}
1
+ ._metadataInstanceForm_ztv76_1{display:flex;flex-direction:column;gap:var(--space-3)}._wrapperGradient_ztv76_7[data-modern=false]{background:linear-gradient(135deg,#fe03dc,#2784fa);border-radius:var(--radius-4)}._wrapperGradient_ztv76_7[data-modern=true]{background:linear-gradient(135deg,#fe03dc,#2784fa);border-radius:var(--bp-radius-10)}._suggestionsFetching_ztv76_17{background:var(--box-blue-02);background-clip:padding-box;border:var(--border-1) solid transparent}._metadataInstanceFormContent_ztv76_23{position:relative;display:flex;flex-direction:column;gap:var(--space-3)}._metadataInstanceFormContentReducedGap_ztv76_30{gap:.375rem}._showOverlay_ztv76_34{min-height:172px}
@@ -0,0 +1 @@
1
+ ._spacious_1325e_1{padding:.375rem}._clickableField_1325e_5{cursor:pointer;border-radius:var(--bp-space-030);transition:background-color .25s ease}._clickableField_1325e_5:hover{background-color:var(--bp-surface-surface-hover)}._selectedField_1325e_14{border-radius:var(--bp-space-030);background-color:var(--bp-surface-card-surface-focus);outline:var(--bp-border-02) solid var(--bp-outline-focus-on-light)}._selectedField_1325e_14:hover{background-color:var(--bp-surface-card-surface-focus)}
@@ -1 +1 @@
1
- ._noAttributesText_1u4tq_2{text-align:center}._fieldWrapper_1u4tq_6{position:relative;isolation:isolate}._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>input,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>button,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>div[role=group]>div,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>div>div,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>div>input,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>input,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>button,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div[role=group]>div,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>div,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>input{border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>input:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>button:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>div[role=group]>div:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>div>div:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11>div>input:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>input:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>button:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div[role=group]>div:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>div:not(:disabled,:focus-visible,._error_1u4tq_25):hover,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>input:not(:disabled,:focus-visible,._error_1u4tq_25):hover{border-bottom:none}._fieldWrapper_1u4tq_6 ._hasSuggestion_1u4tq_11 div[role=group]>div,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16 div[role=group]>div{margin-right:var(--bp-border-01);margin-left:var(--bp-border-01)}._fieldWrapper_1u4tq_6 ._dateField_1u4tq_44>div[role=group]>div{padding-inline:var(--bp-space-030)}._fieldWrapper_1u4tq_6 ._aiApproved_1u4tq_48>._comboboxContainer_1u4tq_48,._fieldWrapper_1u4tq_6 ._aiApproved_1u4tq_48>input,._fieldWrapper_1u4tq_6 ._aiApproved_1u4tq_48>button,._fieldWrapper_1u4tq_6 ._aiApproved_1u4tq_48>div[role=group]>div,._fieldWrapper_1u4tq_6 ._aiApproved_1u4tq_48>div>div,._fieldWrapper_1u4tq_6 ._aiApproved_1u4tq_48>div>input{box-sizing:border-box!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:double var(--bp-border-01) transparent!important;outline:none;border-radius:var(--bp-radius-03)}._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>._comboboxContainer_1u4tq_48,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>input,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>button,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div[role=group]>div,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>div,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>input{box-sizing:border-box!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:double var(--bp-border-01) transparent!important;outline:none;border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important;padding-top:var(--bp-border-01)!important}._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>input:focus-visible,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>button:focus-visible,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div[role=group]>div:focus-within,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>div:focus-within,._fieldWrapper_1u4tq_6 ._hasConfidenceReview_1u4tq_16>div>input:focus-visible{background:#fff!important;border-style:solid!important;border-width:.125rem!important;border-color:#2486fc!important;border-bottom:none!important;padding-top:0!important;outline:0}._labelWrapper_1u4tq_95{display:flex;align-items:baseline;justify-content:space-between;width:100%}._labelWrapper_1u4tq_95 ._labelText_1u4tq_101{flex:unset!important}._labelWrapper_1u4tq_95 ._labelTruncated_1u4tq_104{flex:0 1 auto!important;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._labelWrapper_1u4tq_95 ._labelIcon_1u4tq_111{flex-shrink:0;width:var(--bp-space-040);height:var(--bp-space-040);margin-inline:var(--bp-space-030)}
1
+ ._noAttributesText_1oruv_2{text-align:center}._fieldWrapper_1oruv_6{position:relative;isolation:isolate}._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>input,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>button,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>div[role=group]>div,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>div>div,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>div>input,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>input,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>button,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div[role=group]>div,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>div,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>input{border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>input:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>button:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>div[role=group]>div:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>div>div:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11>div>input:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>input:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>button:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div[role=group]>div:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>div:not(:disabled,:focus-visible,._error_1oruv_25):hover,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>input:not(:disabled,:focus-visible,._error_1oruv_25):hover{border-bottom:none}._fieldWrapper_1oruv_6 ._hasSuggestion_1oruv_11 div[role=group]>div,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16 div[role=group]>div{margin-right:var(--bp-border-01);margin-left:var(--bp-border-01)}._fieldWrapper_1oruv_6 ._dateField_1oruv_44>div[role=group]>div{padding-inline:var(--bp-space-030);background:var(--bp-surface-input-surface)}._fieldWrapper_1oruv_6 ._aiApproved_1oruv_49>._comboboxContainer_1oruv_49,._fieldWrapper_1oruv_6 ._aiApproved_1oruv_49>input,._fieldWrapper_1oruv_6 ._aiApproved_1oruv_49>button,._fieldWrapper_1oruv_6 ._aiApproved_1oruv_49>div[role=group]>div,._fieldWrapper_1oruv_6 ._aiApproved_1oruv_49>div>div,._fieldWrapper_1oruv_6 ._aiApproved_1oruv_49>div>input{box-sizing:border-box!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:double var(--bp-border-01) transparent!important;outline:none;border-radius:var(--bp-radius-03)}._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>._comboboxContainer_1oruv_49,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>input,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>button,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div[role=group]>div,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>div,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>input{box-sizing:border-box!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:double var(--bp-border-01) transparent!important;outline:none;border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important;padding-top:var(--bp-border-01)!important}._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>input:focus-visible,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>button:focus-visible,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div[role=group]>div:focus-within,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>div:focus-within,._fieldWrapper_1oruv_6 ._hasConfidenceReview_1oruv_16>div>input:focus-visible{background:#fff!important;border-style:solid!important;border-width:.125rem!important;border-color:#2486fc!important;border-bottom:none!important;padding-top:0!important;outline:0}._labelWrapper_1oruv_96{display:flex;align-items:baseline;justify-content:space-between;width:100%}._labelWrapper_1oruv_96 ._labelText_1oruv_102{flex:unset!important}._labelWrapper_1oruv_96 ._labelTruncated_1oruv_105{flex:0 1 auto!important;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._labelWrapper_1oruv_96 ._labelIcon_1oruv_112{flex-shrink:0;width:var(--bp-space-040);height:var(--bp-space-040);margin-inline:var(--bp-space-030)}
@@ -8,6 +8,8 @@ export type TemplateInstanceProps = {
8
8
  isExternallyOwned?: boolean;
9
9
  isMultilevelTaxonomyFieldEnabled: boolean;
10
10
  isConfidenceScoreReviewEnabled?: boolean;
11
+ onSelectMetadataField?: (field: MetadataTemplateField | null) => void;
12
+ selectedMetadataFieldId?: string | null;
11
13
  };
12
14
  export type MetadataFieldProps = {
13
15
  description?: string | null;
@@ -29,6 +29,8 @@ export type MetadataInstanceFormProps = {
29
29
  MetadataInstanceFormCustomWrapper?: React.ComponentType<MetadataInstanceFormWrapperProps<null>>;
30
30
  isAdvancedExtractAgentEnabled?: boolean;
31
31
  isConfidenceScoreReviewEnabled?: boolean;
32
+ onSelectMetadataField?: (field: MetadataTemplateField | null) => void;
33
+ selectedMetadataFieldId?: string | null;
32
34
  };
33
35
  export type MetadataInstanceFormWrapperProps<T> = {
34
36
  areAiSuggestionsAvailable: boolean;
@@ -1,2 +1,2 @@
1
1
  import { MetadataInstanceListProps } from './types';
2
- export declare const MetadataInstanceList: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, onEdit, templateInstances, taxonomyNodeFetcher, isAdvancedExtractAgentEnabled, isConfidenceScoreReviewEnabled, }: MetadataInstanceListProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataInstanceList: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, onEdit, onSelectMetadataField, selectedMetadataFieldId, templateInstances, taxonomyNodeFetcher, isAdvancedExtractAgentEnabled, isConfidenceScoreReviewEnabled, }: MetadataInstanceListProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { MetadataInstanceProps } from './types';
2
- export declare const MetadataInstance: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, onEdit, templateInstance, taxonomyNodeFetcher, isAdvancedExtractAgentEnabled, isConfidenceScoreReviewEnabled, }: MetadataInstanceProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataInstance: ({ areAiSuggestionsAvailable, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, onEdit, onSelectMetadataField, selectedMetadataFieldId, templateInstance, taxonomyNodeFetcher, isAdvancedExtractAgentEnabled, isConfidenceScoreReviewEnabled, }: MetadataInstanceProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,12 @@
1
- import { MetadataTemplateInstance } from '../../../../types';
1
+ import { MetadataTemplateField, MetadataTemplateInstance } from '../../../../types';
2
2
  import { TaxonomyNodeFetcher } from '../metadata-instance-entry/types';
3
3
  export type MetadataInstanceProps = {
4
4
  areAiSuggestionsAvailable: boolean;
5
5
  isAiSuggestionsFeatureEnabled: boolean;
6
6
  isBetaLanguageEnabled: boolean;
7
7
  onEdit: (templateInstance: MetadataTemplateInstance, shouldEnableReviewFilter?: boolean) => void;
8
+ onSelectMetadataField?: (field: MetadataTemplateField | null) => void;
9
+ selectedMetadataFieldId?: string | null;
8
10
  templateInstance: MetadataTemplateInstance;
9
11
  taxonomyNodeFetcher: TaxonomyNodeFetcher;
10
12
  isAdvancedExtractAgentEnabled?: boolean;
@@ -1,2 +1,2 @@
1
1
  import { MetadataInstanceContentProps } from './types';
2
- export declare const MetadataInstanceContent: ({ shouldHideEmptyValues, templateInstance, taxonomyNodeFetcher, isConfidenceScoreReviewEnabled, }: MetadataInstanceContentProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataInstanceContent: ({ onSelectMetadataField, selectedMetadataFieldId, shouldHideEmptyValues, templateInstance, taxonomyNodeFetcher, isConfidenceScoreReviewEnabled, }: MetadataInstanceContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
- import { MetadataTemplateInstance } from '../../../../types';
1
+ import { MetadataTemplateField, MetadataTemplateInstance } from '../../../../types';
2
2
  import { TaxonomyNodeFetcher } from '../metadata-instance-entry/types';
3
3
  export type MetadataInstanceContentProps = {
4
+ onSelectMetadataField?: (field: MetadataTemplateField | null) => void;
5
+ selectedMetadataFieldId?: string | null;
4
6
  shouldHideEmptyValues: boolean;
5
7
  templateInstance: MetadataTemplateInstance;
6
8
  taxonomyNodeFetcher: TaxonomyNodeFetcher;
@@ -1,2 +1,2 @@
1
1
  import { MetadataInstanceEntryProps } from './types';
2
- export declare const MetadataInstanceEntry: ({ description, name, shouldHideEmptyValues, type, value, taxonomyNodeFetcher, taxonomyKey, scope, isExternallyOwned, confidenceScore, isConfidenceScoreReviewEnabled, }: MetadataInstanceEntryProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataInstanceEntry: ({ description, isSelected, name, onClick, shouldHideEmptyValues, type, value, taxonomyNodeFetcher, taxonomyKey, scope, isExternallyOwned, confidenceScore, isConfidenceScoreReviewEnabled, targetLocation, }: MetadataInstanceEntryProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ConfidenceScoreData, MetadataFieldValue, MetadataTemplateFieldType } from '../../../../types';
2
+ import { ConfidenceScoreData, MetadataFieldValue, MetadataTargetLocationEntry, MetadataTemplateFieldType } from '../../../../types';
3
3
  export type MetadataTaxonomyAncestor = {
4
4
  description?: string;
5
5
  id: string;
@@ -24,6 +24,8 @@ export type TaxonomyAncestorStatusPillProps = {
24
24
  };
25
25
  export type MetadataInstanceEntryProps = {
26
26
  name: string;
27
+ isSelected?: boolean;
28
+ onClick?: () => void;
27
29
  shouldHideEmptyValues: boolean;
28
30
  type: MetadataTemplateFieldType;
29
31
  value?: MetadataFieldValue;
@@ -34,6 +36,7 @@ export type MetadataInstanceEntryProps = {
34
36
  isExternallyOwned?: boolean;
35
37
  confidenceScore?: ConfidenceScoreData;
36
38
  isConfidenceScoreReviewEnabled?: boolean;
39
+ targetLocation?: MetadataTargetLocationEntry[];
37
40
  };
38
41
  export type MetadataEntryDisplayProps = {
39
42
  formattedValue: ReactNode;
@@ -1,4 +1,4 @@
1
- import { MetadataTemplateInstance } from '../../types';
1
+ import { MetadataTemplateField, MetadataTemplateInstance } from '../../types';
2
2
  import { TaxonomyNodeFetcher } from './subcomponents/metadata-instance-entry/types';
3
3
  export type MetadataInstanceListProps = {
4
4
  areAiSuggestionsAvailable: boolean;
@@ -7,6 +7,8 @@ export type MetadataInstanceListProps = {
7
7
  isAdvancedExtractAgentEnabled?: boolean;
8
8
  isConfidenceScoreReviewEnabled?: boolean;
9
9
  onEdit: (templateInstance: MetadataTemplateInstance, shouldEnableReviewFilter?: boolean) => void;
10
+ onSelectMetadataField?: (field: MetadataTemplateField | null) => void;
11
+ selectedMetadataFieldId?: string | null;
10
12
  templateInstances: MetadataTemplateInstance[];
11
13
  taxonomyNodeFetcher: TaxonomyNodeFetcher;
12
14
  };
@@ -0,0 +1,2 @@
1
+ import { MetadataTargetLocationEntry } from '../types';
2
+ export declare const checkIfHasBoundingBoxes: (targetLocation?: MetadataTargetLocationEntry[]) => boolean;
@@ -0,0 +1 @@
1
+ export declare const isInteractiveFormElement: (element: HTMLElement) => boolean;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "1.58.4",
3
+ "version": "1.59.0",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
- "@box/box-ai-agent-selector": "^1.39.8",
7
6
  "@box/blueprint-web": "^13.15.1",
8
7
  "@box/blueprint-web-assets": "^4.111.7",
8
+ "@box/box-ai-agent-selector": "^1.39.8",
9
9
  "@box/combobox-with-api": "^1.42.9",
10
10
  "formik": "^2.0.3",
11
11
  "lodash": "^4.17.15",
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@ariakit/react": "0.4.15",
18
- "@box/box-ai-agent-selector": "^1.39.8",
19
18
  "@box/babel-plugin-target-attributes": "1.5.7",
20
19
  "@box/blueprint-web": "^13.15.1",
21
20
  "@box/blueprint-web-assets": "^4.111.7",
21
+ "@box/box-ai-agent-selector": "^1.39.8",
22
22
  "@box/storybook-utils": "^0.17.7",
23
23
  "@testing-library/react": "^15.0.6",
24
24
  "react": "^18.3.0",