@box/metadata-editor 1.68.0 → 1.69.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 (35) hide show
  1. package/dist/chunks/ai-suggestion-field.js +77 -60
  2. package/dist/chunks/metadata-instance-content.js +36 -24
  3. package/dist/chunks/metadata-instance-entry.js +61 -52
  4. package/dist/chunks/metadata-instance-form-autofill-button.js +5 -5
  5. package/dist/chunks/metadata-instance-form-card-wrapper.js +6 -6
  6. package/dist/chunks/metadata-instance-form-footer.js +1 -1
  7. package/dist/chunks/metadata-instance-form-header.js +8 -8
  8. package/dist/chunks/metadata-instance-header.js +4 -4
  9. package/dist/esm/index.js +12 -15
  10. package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +19 -16
  11. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +20 -17
  12. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +4 -4
  13. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +1 -1
  14. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +13 -12
  15. package/dist/esm/lib/components/metadata-instance-editor/index.js +9 -7
  16. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +86 -84
  17. package/dist/esm/lib/components/metadata-instance-list/index.js +6 -4
  18. package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +1 -0
  19. package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +34 -31
  20. package/dist/esm/lib/utils/analytics/analytics-context.js +11 -0
  21. package/dist/esm/lib/utils/analytics/events.js +9 -0
  22. package/dist/esm/lib/utils/analytics/index.js +4 -0
  23. package/dist/esm/lib/utils/analytics/with-analytics.js +11 -0
  24. package/dist/esm/lib/utils/confidence-score/index.js +5 -5
  25. package/dist/i18n/en-x-pseudo.js +156 -156
  26. package/dist/i18n/en-x-pseudo.properties +156 -156
  27. package/dist/types/lib/components/metadata-instance-editor/index.d.ts +6 -1
  28. package/dist/types/lib/components/metadata-instance-list/index.d.ts +12 -2
  29. package/dist/types/lib/components/unsaved-changes-modal/types.d.ts +7 -0
  30. package/dist/types/lib/components/unsaved-changes-modal/unsaved-changes-modal.d.ts +1 -1
  31. package/dist/types/lib/utils/analytics/analytics-context.d.ts +12 -0
  32. package/dist/types/lib/utils/analytics/events.d.ts +9 -0
  33. package/dist/types/lib/utils/analytics/index.d.ts +3 -0
  34. package/dist/types/lib/utils/analytics/with-analytics.d.ts +8 -0
  35. package/package.json +4 -4
@@ -1,83 +1,100 @@
1
- import { n as e } from "./types.js";
2
- import { t } from "./field-action-bar.module.js";
3
- import n from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js";
4
- import { formatSuggestionValue as r } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js";
5
- import { DropdownMenu as i, IconButton as a, Text as o, useBlueprintModernization as s } from "@box/blueprint-web";
6
- import { Checkmark as c, Ellipsis as l } from "@box/blueprint-web-assets/icons/Fill";
7
- import { FormattedMessage as u, useIntl as d } from "react-intl";
8
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
9
- import h from "clsx";
10
- import '../styles/ai-suggestion-field.css';var g = {
1
+ import { EVENT_NAMES as e } from "../esm/lib/utils/analytics/events.js";
2
+ import { useMetadataEditorAnalytics as t } from "../esm/lib/utils/analytics/analytics-context.js";
3
+ import { n } from "./types.js";
4
+ import { t as r } from "./field-action-bar.module.js";
5
+ import i from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js";
6
+ import { formatSuggestionValue as a } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js";
7
+ import { DropdownMenu as o, IconButton as s, Text as c, useBlueprintModernization as l } from "@box/blueprint-web";
8
+ import { Checkmark as u, Ellipsis as d } from "@box/blueprint-web-assets/icons/Fill";
9
+ import { useEffect as f, useRef as p } from "react";
10
+ import { FormattedMessage as m, useIntl as h } from "react-intl";
11
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
12
+ import y from "clsx";
13
+ import '../styles/ai-suggestion-field.css';var b = {
11
14
  wrapper: "_wrapper_132y2_1",
12
15
  selectTrigger: "_selectTrigger_132y2_1"
13
16
  };
14
- function _({ aiSuggestion: _, onAiSuggestionAppend: v, onAiSuggestionReplace: y, onAiSuggestionIgnore: b, type: x, isSameValue: S, confidenceLevel: C }) {
15
- let w = d(), { enableModernizedComponents: T } = s(), E = C === e.High ? n.confidenceLevelHigh : n.confidenceLevelLow, D = C ? w.formatMessage(E) : void 0;
16
- return /* @__PURE__ */ p("div", {
17
- className: t.wrapperGradient,
18
- "data-modern": T,
19
- children: /* @__PURE__ */ p("div", {
20
- className: h(t.wrapper, g.wrapper),
21
- children: S ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(o, {
17
+ function x({ aiSuggestion: x, onAiSuggestionAppend: S, onAiSuggestionReplace: C, onAiSuggestionIgnore: w, type: T, isSameValue: E, confidenceLevel: D }) {
18
+ let O = h(), { enableModernizedComponents: k } = l(), { trackEvent: A } = t(), j = p(!1);
19
+ f(() => {
20
+ j.current || x == null || !A || (j.current = !0, A(e.AI_SUGGESTION_SHOWN, {
21
+ fieldType: T,
22
+ confidenceLevel: D,
23
+ isSameValue: E
24
+ }));
25
+ }, [
26
+ x,
27
+ D,
28
+ E,
29
+ T,
30
+ A
31
+ ]);
32
+ let M = D === n.High ? i.confidenceLevelHigh : i.confidenceLevelLow, N = D ? O.formatMessage(M) : void 0;
33
+ return /* @__PURE__ */ _("div", {
34
+ className: r.wrapperGradient,
35
+ "data-modern": k,
36
+ children: /* @__PURE__ */ _("div", {
37
+ className: y(r.wrapper, b.wrapper),
38
+ children: E ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(c, {
22
39
  as: "p",
23
40
  color: "textOnLightSecondary",
24
41
  variant: "caption",
25
- children: C ? w.formatMessage(n.sameValueAiSuggestionCaptionWithLevel, { level: D }) : w.formatMessage(n.sameValueAiSuggestionCaption)
26
- }), /* @__PURE__ */ p("div", {
27
- className: t.buttons,
28
- children: /* @__PURE__ */ p(a, {
29
- "aria-label": C ? w.formatMessage(n.aiSuggestionAccept) : w.formatMessage(n.aiSuggestionConfirm),
30
- icon: c,
31
- onClick: C ? y : b,
32
- size: "x-small",
33
- "data-target-id": "IconButton-aiSuggestionAccept|aiSuggestionConfirm"
42
+ children: D ? O.formatMessage(i.sameValueAiSuggestionCaptionWithLevel, { level: N }) : O.formatMessage(i.sameValueAiSuggestionCaption)
43
+ }), /* @__PURE__ */ _("div", {
44
+ className: r.buttons,
45
+ children: /* @__PURE__ */ _(s, {
46
+ "aria-label": D ? O.formatMessage(i.aiSuggestionAccept) : O.formatMessage(i.aiSuggestionConfirm),
47
+ "data-target-id": D ? "IconButton-aiSuggestionAccept" : "IconButton-aiSuggestionConfirmSame",
48
+ icon: u,
49
+ onClick: D ? C : w,
50
+ size: "x-small"
34
51
  })
35
- })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(o, {
52
+ })] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _(c, {
36
53
  as: "p",
37
54
  color: "textOnLightSecondary",
38
55
  variant: "caption",
39
- children: C ? w.formatMessage(n.aiSuggestionCaptionWithLevel, { level: D }) : w.formatMessage(n.aiSuggestionCaption)
40
- }), /* @__PURE__ */ p(o, {
56
+ children: D ? O.formatMessage(i.aiSuggestionCaptionWithLevel, { level: N }) : O.formatMessage(i.aiSuggestionCaption)
57
+ }), /* @__PURE__ */ _(c, {
41
58
  as: "p",
42
- children: r(_, {
43
- type: x,
44
- locale: w.locale
59
+ children: a(x, {
60
+ type: T,
61
+ locale: O.locale
45
62
  })
46
- })] }), /* @__PURE__ */ m("div", {
47
- className: t.buttons,
48
- children: [/* @__PURE__ */ p(a, {
49
- "aria-label": w.formatMessage(x === "multiSelect" ? n.aiSuggestionAppend : n.aiSuggestionClearAndReplace),
50
- "data-target-id": x === "multiSelect" ? "IconButton-aiSuggestionAppend" : "IconButton-aiSuggestionClearAndReplace",
51
- icon: c,
52
- onClick: x === "multiSelect" ? v : y,
63
+ })] }), /* @__PURE__ */ v("div", {
64
+ className: r.buttons,
65
+ children: [/* @__PURE__ */ _(s, {
66
+ "aria-label": O.formatMessage(T === "multiSelect" ? i.aiSuggestionAppend : i.aiSuggestionClearAndReplace),
67
+ "data-target-id": T === "multiSelect" ? "IconButton-aiSuggestionAppend" : "IconButton-aiSuggestionClearAndReplace",
68
+ icon: u,
69
+ onClick: T === "multiSelect" ? S : C,
53
70
  size: "x-small"
54
- }), /* @__PURE__ */ m(i.Root, { children: [/* @__PURE__ */ p(i.Trigger, {
55
- className: g.selectTrigger,
56
- children: /* @__PURE__ */ p(a, {
57
- "aria-label": w.formatMessage(n.aiSuggestionOptions),
58
- icon: l,
59
- "data-target-id": "IconButton-aiSuggestionOptions"
71
+ }), /* @__PURE__ */ v(o.Root, { children: [/* @__PURE__ */ _(o.Trigger, {
72
+ className: b.selectTrigger,
73
+ children: /* @__PURE__ */ _(s, {
74
+ "aria-label": O.formatMessage(i.aiSuggestionOptions),
75
+ "data-target-id": "IconButton-aiSuggestionOptions",
76
+ icon: d
60
77
  })
61
- }), /* @__PURE__ */ m(i.Content, { children: [
62
- x === "multiSelect" && /* @__PURE__ */ p(i.Item, {
63
- onSelect: v,
78
+ }), /* @__PURE__ */ v(o.Content, { children: [
79
+ T === "multiSelect" && /* @__PURE__ */ _(o.Item, {
64
80
  "data-target-id": "DropdownMenu.Item-aiSuggestionAppend",
65
- children: /* @__PURE__ */ p(u, { ...n.aiSuggestionAppend })
81
+ onSelect: S,
82
+ children: /* @__PURE__ */ _(m, { ...i.aiSuggestionAppend })
66
83
  }),
67
- /* @__PURE__ */ p(i.Item, {
68
- onSelect: y,
69
- "data-target-id": "DropdownMenu.Item-aiSuggestionClearAndReplace",
70
- children: /* @__PURE__ */ p(u, { ...n.aiSuggestionClearAndReplace })
84
+ /* @__PURE__ */ _(o.Item, {
85
+ "data-target-id": "DropdownMenu.Item-metadataAiSuggestionClearAndReplace",
86
+ onSelect: C,
87
+ children: /* @__PURE__ */ _(m, { ...i.aiSuggestionClearAndReplace })
71
88
  }),
72
- /* @__PURE__ */ p(i.Separator, {}),
73
- /* @__PURE__ */ p(i.Item, {
74
- onSelect: b,
75
- "data-target-id": "DropdownMenu.Item-aiSuggestionIgnore",
76
- children: /* @__PURE__ */ p(u, { ...n.aiSuggestionIgnore })
89
+ /* @__PURE__ */ _(o.Separator, {}),
90
+ /* @__PURE__ */ _(o.Item, {
91
+ "data-target-id": "DropdownMenu.Item-metadataAiSuggestionIgnore",
92
+ onSelect: w,
93
+ children: /* @__PURE__ */ _(m, { ...i.aiSuggestionIgnore })
77
94
  })
78
95
  ] })] })]
79
96
  })] })
80
97
  })
81
98
  });
82
99
  }
83
- export { _ as t };
100
+ export { x as t };
@@ -1,29 +1,41 @@
1
1
  import { t as e } from "./metadata-instance-entry.js";
2
- import { jsx as t } from "react/jsx-runtime";
3
- import n from "clsx";
4
- import '../styles/metadata-instance-content.css';var r = {
2
+ import { useMemo as t } from "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import r from "clsx";
5
+ import '../styles/metadata-instance-content.css';var i = {
5
6
  metadataInstanceContent: "_metadataInstanceContent_1cb0f_1",
6
7
  metadataInstanceContentReducedGap: "_metadataInstanceContentReducedGap_1cb0f_7"
7
- }, i = ({ onSelectMetadataField: i, selectedMetadataFieldId: a, shouldHideEmptyValues: o, templateInstance: s, taxonomyNodeFetcher: c, isConfidenceScoreReviewEnabled: l }) => {
8
- let { fields: u = [] } = s;
9
- return /* @__PURE__ */ t("div", {
10
- className: n(r.metadataInstanceContent, l && r.metadataInstanceContentReducedGap),
11
- children: u.filter((e) => !e.hidden).map((n) => /* @__PURE__ */ t(e, {
12
- confidenceScore: n.confidenceScore,
13
- description: n.description,
14
- isConfidenceScoreReviewEnabled: l,
15
- isExternallyOwned: s.isExternallyOwned,
16
- isSelected: a === n.id,
17
- name: n.displayName || n.key,
18
- onClick: i ? () => i(n) : void 0,
19
- scope: n.namespace,
20
- shouldHideEmptyValues: o,
21
- taxonomyKey: n.taxonomyKey,
22
- taxonomyNodeFetcher: c,
23
- type: n.type,
24
- value: n.value,
25
- targetLocation: n.targetLocation
26
- }, n.id))
8
+ }, a = ({ onSelectMetadataField: a, selectedMetadataFieldId: o, shouldHideEmptyValues: s, templateInstance: c, taxonomyNodeFetcher: l, isConfidenceScoreReviewEnabled: u }) => {
9
+ let { fields: d = [] } = c, f = t(() => d.filter((e) => !e.hidden).map((t) => {
10
+ let r = a ? () => a(t) : void 0;
11
+ return /* @__PURE__ */ n(e, {
12
+ confidenceScore: t.confidenceScore,
13
+ description: t.description,
14
+ isConfidenceScoreReviewEnabled: u,
15
+ isExternallyOwned: c.isExternallyOwned,
16
+ isSelected: o === t.id,
17
+ name: t.displayName || t.key,
18
+ onClick: r,
19
+ scope: t.namespace,
20
+ shouldHideEmptyValues: s,
21
+ taxonomyKey: t.taxonomyKey,
22
+ taxonomyNodeFetcher: l,
23
+ type: t.type,
24
+ value: t.value,
25
+ targetLocation: t.targetLocation
26
+ }, t.id);
27
+ }), [
28
+ d,
29
+ u,
30
+ a,
31
+ o,
32
+ s,
33
+ l,
34
+ c.isExternallyOwned
35
+ ]);
36
+ return /* @__PURE__ */ n("div", {
37
+ className: r(i.metadataInstanceContent, u && i.metadataInstanceContentReducedGap),
38
+ children: f
27
39
  });
28
40
  };
29
- export { i as t };
41
+ export { a as t };
@@ -1,82 +1,91 @@
1
1
  import e from "../esm/lib/messages.js";
2
- import { isConfidenceScoreNeedingReview as t } from "../esm/lib/utils/confidence-score/is-confidence-score-needing-review.js";
3
- import { checkIfHasBoundingBoxes as n } from "../esm/lib/utils/check-if-has-bounding-boxes.js";
4
- import { getConfidenceScoreTooltip as r } from "../esm/lib/utils/confidence-score/get-confidence-score-tooltip.js";
5
- import { t as i } from "./shared-field-styles.module.js";
6
- import { convertISOStringToUTCDate as a } from "../esm/lib/utils/convertDate.js";
7
- import o from "../esm/lib/components/interactive-text/interactive-text.js";
8
- import s from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";
9
- import { MetadataEntryDisplay as c } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
10
- import { Status as l, Text as u, Tooltip as d } from "@box/blueprint-web";
11
- import { FormattedDate as f, useIntl as p } from "react-intl";
12
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
13
- import g from "clsx";
14
- import { AlertCircle as _ } from "@box/blueprint-web-assets/icons/Medium";
15
- import '../styles/metadata-instance-entry.css';var v = {
2
+ import { EVENT_NAMES as t } from "../esm/lib/utils/analytics/events.js";
3
+ import { useMetadataEditorAnalytics as n } from "../esm/lib/utils/analytics/analytics-context.js";
4
+ import { checkIfHasBoundingBoxes as r } from "../esm/lib/utils/check-if-has-bounding-boxes.js";
5
+ import { getConfidenceScoreTooltip as i } from "../esm/lib/utils/confidence-score/get-confidence-score-tooltip.js";
6
+ import { isConfidenceScoreNeedingReview as a } from "../esm/lib/utils/confidence-score/is-confidence-score-needing-review.js";
7
+ import { t as o } from "./shared-field-styles.module.js";
8
+ import { convertISOStringToUTCDate as s } from "../esm/lib/utils/convertDate.js";
9
+ import c from "../esm/lib/components/interactive-text/interactive-text.js";
10
+ import l from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";
11
+ import { MetadataEntryDisplay as u } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
12
+ import { Status as d, Text as f, Tooltip as p } from "@box/blueprint-web";
13
+ import { FormattedDate as m, useIntl as h } from "react-intl";
14
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
15
+ import v from "clsx";
16
+ import { AlertCircle as y } from "@box/blueprint-web-assets/icons/Medium";
17
+ import '../styles/metadata-instance-entry.css';var b = {
16
18
  metadataInstanceEntry: "_metadataInstanceEntry_fr9av_1",
17
19
  name: "_name_fr9av_6",
18
20
  labelContainer: "_labelContainer_fr9av_14",
19
21
  confidenceScoreIcon: "_confidenceScoreIcon_fr9av_20"
20
- }, y = ({ description: y, isSelected: b, name: x, onClick: S, shouldHideEmptyValues: C, type: w, value: T, taxonomyNodeFetcher: E, taxonomyKey: D, scope: O, isExternallyOwned: k, confidenceScore: A, isConfidenceScoreReviewEnabled: j = !1, targetLocation: M }) => {
21
- let N = p(), P = j && !!A && t(A), F = n(M), I = j && !!A && F && !!S, L = P ? r(N.formatMessage, A) : null, R = typeof T == "number" ? T.toString() : T ? Array.isArray(T) ? T.join(", ") : w === "date" && typeof T == "string" ? /* @__PURE__ */ m(f, {
22
+ }, x = ({ description: x, isSelected: S, name: C, onClick: w, shouldHideEmptyValues: T, type: E, value: D, taxonomyNodeFetcher: O, taxonomyKey: k, scope: A, isExternallyOwned: j, confidenceScore: M, isConfidenceScoreReviewEnabled: N = !1, targetLocation: P }) => {
23
+ let F = h(), { trackEvent: I } = n(), L = N && !!M && a(M), R = r(P), z = N && !!M && R && !!w, B = L ? i(F.formatMessage, M) : null, V = () => I(t.LOW_CONF_ICON_HOVER_READ_MODE, {
24
+ fieldType: E,
25
+ confidenceLevel: M?.level,
26
+ scope: A
27
+ }), H = typeof D == "number" ? D.toString() : D ? Array.isArray(D) ? D.join(", ") : E === "date" && typeof D == "string" ? /* @__PURE__ */ g(m, {
22
28
  day: "numeric",
23
29
  month: "long",
24
- value: a(T),
30
+ value: s(D),
25
31
  year: "numeric"
26
- }) : T : null, z = {
32
+ }) : D : null, U = {
27
33
  "data-metadata-field": !0,
34
+ "data-target-id": "Button-metadataEditorFieldReadClick",
28
35
  "data-testid": "metadata-field",
29
- onClick: S,
36
+ onClick: w,
30
37
  onKeyDown: (e) => {
31
- e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), S?.());
38
+ e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), w?.());
32
39
  },
33
40
  role: "button",
34
41
  tabIndex: 0
35
42
  };
36
- if (C && !R) return null;
37
- let B = /* @__PURE__ */ h("div", {
38
- className: g(v.metadataInstanceEntry, j && i.spacious, I && i.clickableField, I && b && i.selectedField),
39
- ...I && z,
40
- children: [/* @__PURE__ */ h("div", {
41
- className: v.labelContainer,
42
- children: [L && /* @__PURE__ */ m(d, {
43
- content: L,
44
- children: /* @__PURE__ */ m("span", {
45
- className: v.confidenceScoreIcon,
46
- children: /* @__PURE__ */ m(l, {
43
+ if (T && !H) return null;
44
+ let W = /* @__PURE__ */ _("div", {
45
+ className: v(b.metadataInstanceEntry, N && o.spacious, z && o.clickableField, z && S && o.selectedField),
46
+ ...z && U,
47
+ children: [/* @__PURE__ */ _("div", {
48
+ className: b.labelContainer,
49
+ children: [B && /* @__PURE__ */ g(p, {
50
+ content: B,
51
+ children: /* @__PURE__ */ g("span", {
52
+ className: b.confidenceScoreIcon,
53
+ children: /* @__PURE__ */ g(d, {
54
+ "data-target-id": "Status-metadataInstanceEntryConfidenceScoreIcon",
47
55
  color: "SurfaceStatusSurfaceGray",
48
56
  hideText: !0,
49
- icon: _,
57
+ icon: y,
50
58
  interactive: !0,
51
- text: N.formatMessage(s.confidenceScoreIconAriaLabel)
59
+ text: F.formatMessage(l.confidenceScoreIconAriaLabel),
60
+ onMouseEnter: V
52
61
  })
53
62
  })
54
- }), /* @__PURE__ */ m(u, {
63
+ }), /* @__PURE__ */ g(f, {
55
64
  as: "h5",
56
65
  color: "textOnLightSecondary",
57
66
  variant: "bodyDefaultBold",
58
- className: v.name,
59
- children: y ? /* @__PURE__ */ m(o, {
67
+ className: b.name,
68
+ children: x ? /* @__PURE__ */ g(c, {
60
69
  as: "span",
61
70
  color: "textOnLightSecondary",
62
- tooltipText: y,
71
+ tooltipText: x,
63
72
  variant: "bodyDefaultBold",
64
- children: x
65
- }) : x
73
+ children: C
74
+ }) : C
66
75
  })]
67
- }), /* @__PURE__ */ m(c, {
68
- formattedValue: R,
69
- isExternallyOwned: k,
70
- scope: O,
71
- taxonomyKey: D,
72
- taxonomyNodeFetcher: E,
73
- type: w,
74
- value: T
76
+ }), /* @__PURE__ */ g(u, {
77
+ formattedValue: H,
78
+ isExternallyOwned: j,
79
+ scope: A,
80
+ taxonomyKey: k,
81
+ taxonomyNodeFetcher: O,
82
+ type: E,
83
+ value: D
75
84
  })]
76
85
  });
77
- return I ? /* @__PURE__ */ m(d, {
78
- content: N.formatMessage(e.viewOnDocument),
79
- children: B
80
- }) : B;
86
+ return z ? /* @__PURE__ */ g(p, {
87
+ content: F.formatMessage(e.viewOnDocument),
88
+ children: W
89
+ }) : W;
81
90
  };
82
- export { y as t };
91
+ export { x as t };
@@ -8,8 +8,8 @@ import { forwardRef as p, useEffect as m, useMemo as h, useState as g } from "re
8
8
  import { useIntl as _ } from "react-intl";
9
9
  import { BoxAiAdvancedLogo24 as v, BoxAiLogo24 as y } from "@box/blueprint-web-assets/icons/Logo";
10
10
  import { jsx as b, jsxs as x } from "react/jsx-runtime";
11
- import { useLocalStorageAIAgents as S } from "@box/box-ai-agent-selector";
12
- import { getIn as C, useFormikContext as w } from "formik";
11
+ import { getIn as S, useFormikContext as C } from "formik";
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_i1hyy_1",
15
15
  actionMenuItem: "_actionMenuItem_i1hyy_11",
@@ -51,10 +51,10 @@ import '../styles/metadata-instance-form-autofill-button.css';var T = {
51
51
  })
52
52
  });
53
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 } = w(), A = _(), [j, M] = S(t), { suggestions: N, confidenceScores: P, targetLocations: F } = i();
54
+ let { isSubmitting: D, values: O, setFieldValue: k } = C(), A = _(), [j, M] = w(t), { suggestions: N, confidenceScores: P, targetLocations: F } = i();
55
55
  m(() => {
56
56
  if (N) {
57
- let e = C(O, "metadata.fields"), t = C(O, "metadata.templateKey");
57
+ let e = S(O, "metadata.fields"), t = S(O, "metadata.templateKey");
58
58
  k("metadata.fields", e?.map((e) => {
59
59
  let n = N?.[t]?.[e.key];
60
60
  return n ? {
@@ -72,7 +72,7 @@ import '../styles/metadata-instance-form-autofill-button.css';var T = {
72
72
  k
73
73
  ]);
74
74
  let I = (t) => {
75
- let n = C(O, "metadata.templateKey"), r = C(O, "metadata.scope"), i = t ? e[t]?.AGENT_ID : e[j]?.AGENT_ID;
75
+ let n = S(O, "metadata.templateKey"), r = S(O, "metadata.scope"), i = t ? e[t]?.AGENT_ID : e[j]?.AGENT_ID;
76
76
  x(n, r, g ? i : void 0);
77
77
  }, L = !s || D || d, R = j === "enhanced" && g ? v : y, z = h(() => r(g, j, A), [
78
78
  g,
@@ -1,7 +1,7 @@
1
1
  import { TEMPLATE_CUSTOM_PROPERTIES as e } from "../esm/lib/constants.js";
2
- import { t } from "./metadata-instance-form-header.js";
3
- import { t as n } from "./metadata-instance-form-ai-disclaimer.js";
4
- import { t as r } from "./metadata-instance-form-footer.js";
2
+ import { t } from "./metadata-instance-form-ai-disclaimer.js";
3
+ import { t as n } from "./metadata-instance-form-footer.js";
4
+ import { t as r } from "./metadata-instance-form-header.js";
5
5
  import { Card as i, useBlueprintModernization as a } from "@box/blueprint-web";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  import c from "clsx";
@@ -21,7 +21,7 @@ import '../styles/metadata-instance-form-card-wrapper.css';var l = {
21
21
  ref: m,
22
22
  className: c(p, { [l.suggestionsFetching]: T }),
23
23
  children: [
24
- /* @__PURE__ */ o(t, {
24
+ /* @__PURE__ */ o(r, {
25
25
  areAiSuggestionsAvailable: d,
26
26
  hasSuggestions: N,
27
27
  isAdvancedExtractAgentEnabled: g,
@@ -36,12 +36,12 @@ import '../styles/metadata-instance-form-card-wrapper.css';var l = {
36
36
  templateName: D?.displayName
37
37
  }),
38
38
  D && f,
39
- /* @__PURE__ */ o(n, {
39
+ /* @__PURE__ */ o(t, {
40
40
  isLoading: T,
41
41
  isConfidenceScoreReviewEnabled: y,
42
42
  fields: h.metadata?.fields ?? []
43
43
  }),
44
- /* @__PURE__ */ o(r, {
44
+ /* @__PURE__ */ o(n, {
45
45
  isDeleteButtonDisabled: x,
46
46
  isLoading: T,
47
47
  onCancel: () => k(E),
@@ -28,12 +28,12 @@ import '../styles/metadata-instance-form-footer.css';var s = {
28
28
  "data-target-id": "Button-cancelButton",
29
29
  children: f.formatMessage(e.cancelButton)
30
30
  }), /* @__PURE__ */ i(t, {
31
+ "data-target-id": "Button-metadataEditorSave",
31
32
  disabled: h,
32
33
  loading: p,
33
34
  loadingAriaLabel: f.formatMessage(e.loadingAriaLabel),
34
35
  onClick: m,
35
36
  size: "large",
36
- "data-target-id": "Button-saveButton",
37
37
  children: f.formatMessage(e.saveButton)
38
38
  })]
39
39
  })]
@@ -1,7 +1,7 @@
1
- import { t as e } from "./metadata-instance-form-autofill-button.js";
2
- import { getFieldsNeedingReview as t } from "../esm/lib/utils/confidence-score/get-fields-needing-review.js";
3
- import { t as n } from "./interactive-header-text.js";
4
- import { MetadataInstanceReviewNotice as r } from "../esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js";
1
+ import { getFieldsNeedingReview as e } from "../esm/lib/utils/confidence-score/get-fields-needing-review.js";
2
+ import { t } from "./interactive-header-text.js";
3
+ import { MetadataInstanceReviewNotice as n } from "../esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js";
4
+ import { t as r } from "./metadata-instance-form-autofill-button.js";
5
5
  import { MetadataInstanceFormInlineNotice as i } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";
6
6
  import a from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js";
7
7
  import { useMemo as o } from "react";
@@ -13,16 +13,16 @@ import '../styles/metadata-instance-form-header.css';var d = {
13
13
  metadataInstanceFormHeader: "_metadataInstanceFormHeader_3nbmr_1",
14
14
  title: "_title_3nbmr_15"
15
15
  }, f = ({ areAiSuggestionsAvailable: f, hasSuggestions: p, isAdvancedExtractAgentEnabled: m = !1, isAiSuggestionsFeatureEnabled: h, isBetaLanguageEnabled: g, isConfidenceScoreReviewEnabled: _ = !1, isLargeFile: v, isLoading: y, onToggleReviewFilter: b, shouldShowOnlyReviewFields: x = !1, templateName: S, onAutofill: C }) => {
16
- let w = s(), { values: T } = u(), E = o(() => _ ? t(T.metadata?.fields ?? []).length : 0, [T.metadata?.fields, _]), D = S ?? w.formatMessage(a.customInstanceTitle), O = p && f, k = _ && !y && (E > 0 || x) && b !== void 0;
16
+ let w = s(), { values: T } = u(), E = o(() => _ ? e(T.metadata?.fields ?? []).length : 0, [T.metadata?.fields, _]), D = S ?? w.formatMessage(a.customInstanceTitle), O = p && f, k = _ && !y && (E > 0 || x) && b !== void 0;
17
17
  return /* @__PURE__ */ l("div", {
18
18
  className: d.metadataInstanceFormHeaderWrapper,
19
19
  children: [
20
20
  /* @__PURE__ */ l("div", {
21
21
  className: d.metadataInstanceFormHeader,
22
- children: [/* @__PURE__ */ c(n, {
22
+ children: [/* @__PURE__ */ c(t, {
23
23
  className: d.title,
24
24
  title: D
25
- }), h ? /* @__PURE__ */ c(e, {
25
+ }), h ? /* @__PURE__ */ c(r, {
26
26
  areAiSuggestionsAvailable: f,
27
27
  isAdvancedExtractAgentEnabled: m,
28
28
  isBetaLanguageEnabled: g,
@@ -34,7 +34,7 @@ import '../styles/metadata-instance-form-header.css';var d = {
34
34
  isBetaLanguageEnabled: g,
35
35
  isLargeFile: v
36
36
  }),
37
- k && /* @__PURE__ */ c(r, {
37
+ k && /* @__PURE__ */ c(n, {
38
38
  fieldsNeedingReviewCount: E,
39
39
  isLowScoreFilteringEnabled: x,
40
40
  onTextToggleClick: b
@@ -8,14 +8,14 @@ import { useMemo as c } from "react";
8
8
  import { useIntl as l } from "react-intl";
9
9
  import { BoxAiAdvancedLogo24 as u, BoxAiLogo24 as d } from "@box/blueprint-web-assets/icons/Logo";
10
10
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
11
- import { useLocalStorageAIAgents as m } from "@box/box-ai-agent-selector";
12
- import { Pencil as h } from "@box/blueprint-web-assets/icons/Line";
11
+ import { Pencil as m } from "@box/blueprint-web-assets/icons/Line";
12
+ import { useLocalStorageAIAgents as h } from "@box/box-ai-agent-selector";
13
13
  import '../styles/metadata-instance-header.css';var g = {
14
14
  metadataInstanceHeader: "_metadataInstanceHeader_17bsu_1",
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] = m(t), k = w && e[O]?.AGENT_ID, A = c(() => r(w, O, T), [
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), [
19
19
  w,
20
20
  O,
21
21
  T
@@ -41,7 +41,7 @@ import '../styles/metadata-instance-header.css';var g = {
41
41
  content: T.formatMessage(a.editButtonTooltip),
42
42
  children: /* @__PURE__ */ f(o, {
43
43
  "aria-label": T.formatMessage(a.editButtonAriaLabel, { templateName: C }),
44
- icon: h,
44
+ icon: m,
45
45
  onClick: x,
46
46
  "data-target-id": "IconButton-editButtonAriaLabel"
47
47
  })
package/dist/esm/index.js CHANGED
@@ -7,21 +7,18 @@ import { t as r } from "../chunks/filter-instances-dropdown.js";
7
7
  import "./lib/components/filter-instances-dropdown/index.js";
8
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
9
  import { MetadataEmptyState as s } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
10
- import { t as c } from "../chunks/custom-instance-new-field.js";
11
- import { t as l } from "../chunks/delete-confirmation-modal.js";
12
- import { AutofillContext as u, AutofillContextProvider as d, TIMEOUT_10_SECONDS as f, useAutofill as p } from "./lib/utils/autofill-context.js";
13
- import { t as m } from "../chunks/metadata-instance-form-autofill-button.js";
14
- import { n as h, r as g, t as _ } from "../chunks/types.js";
15
- import { t as v } from "../chunks/metadata-instance-form-header.js";
16
- import { UnsavedChangesModal as y } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
17
- import { r as b } from "../chunks/utils2.js";
18
- import { MetadataInstanceForm as x } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js";
19
- import "./lib/components/metadata-instance-editor/index.js";
20
- import { t as S } from "../chunks/metadata-instance-list.js";
21
- import { t as C } from "../chunks/metadata-instance-header.js";
22
- import { t as w } from "../chunks/metadata-instance.js";
23
- import "./lib/components/metadata-instance-list/index.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";
24
21
  import { defaultInitialValues as T, defaultMetadataValueMap as E } from "./lib/defaults.js";
25
22
  import { t as D } from "../chunks/metadata-editor.js";
26
23
  import { withApiWrapper as O } from "./lib/utils/api-wrapper.js";
27
- export { t as AddMetadataTemplateDropdown, _ as AiSuggestionState, u as AutofillContext, d as AutofillContextProvider, n as ComboboxWithApiPagination, h as ConfidenceLevel, c as CustomInstanceNewField, l as DeleteConfirmationModal, e as FilterDropdownMenu, r as FilterInstancesDropdown, b 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, w as MetadataInstance, x as MetadataInstanceForm, m as MetadataInstanceFormAutofillButton, v as MetadataInstanceFormHeader, C as MetadataInstanceHeader, S as MetadataInstanceList, f as TIMEOUT_10_SECONDS, y as UnsavedChangesModal, g as UpdateMode, T as defaultInitialValues, E as defaultMetadataValueMap, p as useAutofill, O as withApiWrapper };
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 };
@@ -1,21 +1,24 @@
1
- import { getConfidenceScoreTooltip as e } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
2
- import { Status as t, Tooltip as n } from "@box/blueprint-web";
3
- import { useIntl as r } from "react-intl";
4
- import { BoxAiLogo as i } from "@box/blueprint-web-assets/icons/Logo";
5
- import { jsx as a } from "react/jsx-runtime";
6
- import { SurfaceStatusSurfaceGray as o } from "@box/blueprint-web-assets/tokens/tokens";
7
- function s({ confidenceScore: s, className: c }) {
8
- let { formatMessage: l } = r();
9
- return s ? /* @__PURE__ */ a(n, {
10
- content: e(l, s),
11
- children: /* @__PURE__ */ a(t, {
1
+ import { EVENT_NAMES as e } from "../../../../utils/analytics/events.js";
2
+ import { useMetadataEditorAnalytics as t } from "../../../../utils/analytics/analytics-context.js";
3
+ import { getConfidenceScoreTooltip as n } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
4
+ import { Status as r, Tooltip as i } from "@box/blueprint-web";
5
+ import { useIntl as a } from "react-intl";
6
+ import { BoxAiLogo as o } from "@box/blueprint-web-assets/icons/Logo";
7
+ import { jsx as s } from "react/jsx-runtime";
8
+ import { SurfaceStatusSurfaceGray as c } from "@box/blueprint-web-assets/tokens/tokens";
9
+ function l({ confidenceScore: l, className: u }) {
10
+ let { formatMessage: d } = a(), { trackEvent: f } = t();
11
+ return l ? /* @__PURE__ */ s(i, {
12
+ content: n(d, l),
13
+ children: /* @__PURE__ */ s(r, {
12
14
  hideText: !0,
13
- icon: i,
15
+ icon: o,
14
16
  interactive: !0,
15
17
  text: "",
16
- color: o,
17
- "data-testid": "ai-confidence-badge"
18
+ color: c,
19
+ "data-testid": "ai-confidence-badge",
20
+ onMouseEnter: () => f(e.AI_LOGO_BADGE_HOVER, { confidenceLevel: l?.level })
18
21
  })
19
- }) : /* @__PURE__ */ a(i, { className: c });
22
+ }) : /* @__PURE__ */ s(o, { className: u });
20
23
  }
21
- export { s as AiLogoBadge };
24
+ export { l as AiLogoBadge };