@box/metadata-editor 1.53.15 → 1.54.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 (67) hide show
  1. package/dist/chunks/utils2.js +43 -38
  2. package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +37 -0
  3. package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/index.js +4 -0
  4. package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +57 -56
  5. package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +4 -0
  6. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/index.js +4 -0
  7. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +30 -0
  8. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +37 -36
  9. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +32 -31
  10. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +32 -31
  11. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +35 -34
  12. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +26 -25
  13. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +64 -63
  14. package/dist/esm/lib/components/metadata-editor-fields/messages.js +10 -0
  15. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +89 -85
  16. package/dist/esm/lib/components/metadata-editor-fields/utils.js +7 -5
  17. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +90 -88
  18. package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +5 -5
  19. package/dist/esm/lib/utils/autofill-context.js +51 -47
  20. package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +18 -16
  21. package/dist/esm/lib/utils/confidence-score/messages.js +1 -1
  22. package/dist/i18n/bn-IN.js +2 -0
  23. package/dist/i18n/da-DK.js +2 -0
  24. package/dist/i18n/de-DE.js +2 -0
  25. package/dist/i18n/en-AU.js +2 -0
  26. package/dist/i18n/en-CA.js +2 -0
  27. package/dist/i18n/en-GB.js +2 -0
  28. package/dist/i18n/en-US.js +3 -1
  29. package/dist/i18n/en-US.properties +5 -1
  30. package/dist/i18n/en-x-pseudo.js +2 -0
  31. package/dist/i18n/es-419.js +2 -0
  32. package/dist/i18n/es-ES.js +2 -0
  33. package/dist/i18n/fi-FI.js +2 -0
  34. package/dist/i18n/fr-CA.js +2 -0
  35. package/dist/i18n/fr-FR.js +2 -0
  36. package/dist/i18n/hi-IN.js +2 -0
  37. package/dist/i18n/it-IT.js +2 -0
  38. package/dist/i18n/ja-JP.js +2 -0
  39. package/dist/i18n/json/src/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.json +1 -1
  40. package/dist/i18n/json/src/lib/components/metadata-editor-fields/messages.json +1 -0
  41. package/dist/i18n/json/src/lib/utils/confidence-score/messages.json +1 -1
  42. package/dist/i18n/ko-KR.js +2 -0
  43. package/dist/i18n/nb-NO.js +2 -0
  44. package/dist/i18n/nl-NL.js +2 -0
  45. package/dist/i18n/pl-PL.js +2 -0
  46. package/dist/i18n/pt-BR.js +2 -0
  47. package/dist/i18n/ru-RU.js +2 -0
  48. package/dist/i18n/sv-SE.js +2 -0
  49. package/dist/i18n/tr-TR.js +2 -0
  50. package/dist/i18n/zh-CN.js +2 -0
  51. package/dist/i18n/zh-TW.js +2 -0
  52. package/dist/types/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.d.ts +5 -0
  53. package/dist/types/lib/components/metadata-editor-fields/components/ai-logo-badge/index.d.ts +1 -0
  54. package/dist/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.d.ts +1 -1
  55. package/dist/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.d.ts +5 -0
  56. package/dist/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/types.d.ts +9 -1
  57. package/dist/types/lib/components/metadata-editor-fields/components/low-confidence-badge/index.d.ts +1 -0
  58. package/dist/types/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.d.ts +4 -0
  59. package/dist/types/lib/components/metadata-editor-fields/messages.d.ts +8 -0
  60. package/dist/types/lib/components/metadata-editor-fields/types.d.ts +2 -1
  61. package/dist/types/lib/components/metadata-editor-fields/utils.d.ts +2 -1
  62. package/dist/types/lib/test-utils/confidence-score-fixtures.d.ts +37 -0
  63. package/dist/types/lib/test-utils/index.d.ts +1 -0
  64. package/dist/types/lib/test-utils/sample-data.d.ts +1 -3
  65. package/dist/types/lib/types.d.ts +1 -0
  66. package/dist/types/lib/utils/autofill-context.d.ts +2 -1
  67. package/package.json +9 -9
@@ -1,50 +1,55 @@
1
- import { BoxAiLogo as b } from "@box/blueprint-web-assets/icons/Logo";
2
- import g from "clsx";
3
- import _ from "../esm/lib/components/interactive-text/interactive-text.js";
4
- import { convertISOStringtoRFC3339String as p } from "../esm/lib/utils/convertDate.js";
5
- import { jsxs as d, jsx as s } from "react/jsx-runtime";
6
- import '../styles/utils.css';const u = "_noAttributesText_6bzgt_2", m = "_fieldWrapper_6bzgt_6", x = "_hasSuggestion_6bzgt_11", T = "_hasConfidenceReview_6bzgt_16", f = "_dateField_6bzgt_44", z = "_suggestionApplied_6bzgt_48", h = "_labelWrapper_6bzgt_95", A = "_labelText_6bzgt_101", N = "_labelTruncated_6bzgt_104", S = "_labelIcon_6bzgt_111", l = {
7
- noAttributesText: u,
8
- fieldWrapper: m,
9
- hasSuggestion: x,
10
- hasConfidenceReview: T,
11
- dateField: f,
12
- suggestionApplied: z,
13
- labelWrapper: h,
14
- labelText: A,
15
- labelTruncated: N,
16
- labelIcon: S
17
- }, w = (t, e, a = !1, o = "label") => (c) => {
1
+ import p from "clsx";
2
+ import { convertISOStringtoRFC3339String as d } from "../esm/lib/utils/convertDate.js";
3
+ import u from "../esm/lib/components/interactive-text/interactive-text.js";
4
+ import { jsxs as m, jsx as l } from "react/jsx-runtime";
5
+ import { isConfidenceScoreNeedingReview as T } from "../esm/lib/utils/confidence-score/is-confidence-score-needing-review.js";
6
+ import { LowConfidenceBadge as f } from "../esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js";
7
+ import { AiLogoBadge as x } from "../esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js";
8
+ import '../styles/utils.css';const z = "_noAttributesText_6bzgt_2", h = "_fieldWrapper_6bzgt_6", C = "_hasSuggestion_6bzgt_11", N = "_hasConfidenceReview_6bzgt_16", v = "_dateField_6bzgt_44", w = "_suggestionApplied_6bzgt_48", A = "_labelWrapper_6bzgt_95", W = "_labelText_6bzgt_101", I = "_labelTruncated_6bzgt_104", F = "_labelIcon_6bzgt_111", s = {
9
+ noAttributesText: z,
10
+ fieldWrapper: h,
11
+ hasSuggestion: C,
12
+ hasConfidenceReview: N,
13
+ dateField: v,
14
+ suggestionApplied: w,
15
+ labelWrapper: A,
16
+ labelText: W,
17
+ labelTruncated: I,
18
+ labelIcon: F
19
+ }, O = (a, t, r = !1, i = "label", e) => (b) => {
18
20
  const {
19
- className: i,
21
+ className: g,
20
22
  ...n
21
- } = c, r = g(i || l.labelText, l.labelTruncated);
22
- return /* @__PURE__ */ d("div", {
23
- className: l.labelWrapper,
24
- children: [e ? /* @__PURE__ */ s(_, {
25
- as: o,
26
- className: r,
27
- tooltipText: e,
23
+ } = b, o = p(g || s.labelText, s.labelTruncated), c = !!e && T(e), _ = () => e && c ? /* @__PURE__ */ l(f, {
24
+ confidenceScore: e
25
+ }) : r || e ? /* @__PURE__ */ l(x, {
26
+ className: s.labelIcon,
27
+ confidenceScore: e
28
+ }) : null;
29
+ return /* @__PURE__ */ m("div", {
30
+ className: s.labelWrapper,
31
+ children: [t ? /* @__PURE__ */ l(u, {
32
+ as: i,
33
+ className: o,
34
+ tooltipText: t,
28
35
  ...n,
29
- children: t
30
- }) : /* @__PURE__ */ s("label", {
31
- className: r,
36
+ children: a
37
+ }) : /* @__PURE__ */ l("label", {
38
+ className: o,
32
39
  ...n,
33
- children: t
34
- }), a && /* @__PURE__ */ s(b, {
35
- className: l.labelIcon
36
- })]
40
+ children: a
41
+ }), _()]
37
42
  });
38
- }, R = (t) => {
43
+ }, P = (a) => {
39
44
  try {
40
- const e = p(t), a = new Date(e);
41
- return isNaN(a.getTime()) ? null : e;
45
+ const t = d(a), r = new Date(t);
46
+ return isNaN(r.getTime()) ? null : t;
42
47
  } catch {
43
48
  return null;
44
49
  }
45
50
  };
46
51
  export {
47
- w as g,
48
- l as s,
49
- R as t
52
+ O as g,
53
+ s,
54
+ P as t
50
55
  };
@@ -0,0 +1,37 @@
1
+ import { Focusable as a, Status as m, Tooltip as f } from "@box/blueprint-web";
2
+ import { BoxAiLogo as r } from "@box/blueprint-web-assets/icons/Logo";
3
+ import { SurfaceStatusSurfaceGray as p } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import { useIntl as u } from "react-intl";
5
+ import { jsx as t } from "react/jsx-runtime";
6
+ import { getConfidenceScoreTooltip as s } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
7
+ function S({
8
+ confidenceScore: o,
9
+ className: e
10
+ }) {
11
+ const {
12
+ formatMessage: i
13
+ } = u();
14
+ if (!o)
15
+ return /* @__PURE__ */ t(r, {
16
+ className: e
17
+ });
18
+ const n = s(i, o), c = o.isAccepted ? /* @__PURE__ */ t(a, {
19
+ children: /* @__PURE__ */ t(r, {
20
+ className: e
21
+ })
22
+ }) : /* @__PURE__ */ t(m, {
23
+ hideText: !0,
24
+ icon: r,
25
+ interactive: !0,
26
+ text: "",
27
+ color: p,
28
+ "data-testid": "ai-confidence-badge"
29
+ });
30
+ return /* @__PURE__ */ t(f, {
31
+ content: n,
32
+ children: c
33
+ });
34
+ }
35
+ export {
36
+ S as AiLogoBadge
37
+ };
@@ -0,0 +1,4 @@
1
+ import { AiLogoBadge as g } from "./ai-logo-badge.js";
2
+ export {
3
+ g as AiLogoBadge
4
+ };
@@ -1,98 +1,99 @@
1
- import { useBlueprintModernization as I, Text as s, IconButton as c, DropdownMenu as a } from "@box/blueprint-web";
2
- import { Checkmark as p, Ellipsis as w } from "@box/blueprint-web-assets/icons/Fill";
3
- import M from "clsx";
4
- import { useIntl as x, FormattedMessage as r } from "react-intl";
1
+ import { useBlueprintModernization as w, Text as c, IconButton as g, DropdownMenu as a } from "@box/blueprint-web";
2
+ import { Checkmark as u, Ellipsis as x } from "@box/blueprint-web-assets/icons/Fill";
3
+ import v from "clsx";
4
+ import { useIntl as A, FormattedMessage as s } from "react-intl";
5
5
  import { s as l } from "../../../../../../chunks/field-action-bar.module.js";
6
6
  import t from "./messages.js";
7
- import { formatSuggestionValue as v } from "./utils.js";
8
- import { jsx as e, jsxs as i, Fragment as u } from "react/jsx-runtime";
9
- import '../../../../../../styles/ai-suggestion-field.css';const b = "_wrapper_132y2_1", A = "_selectTrigger_132y2_1", S = {
10
- wrapper: b,
11
- selectTrigger: A
7
+ import { formatSuggestionValue as b } from "./utils.js";
8
+ import { jsx as e, jsxs as r, Fragment as S } from "react/jsx-runtime";
9
+ import '../../../../../../styles/ai-suggestion-field.css';const B = "_wrapper_132y2_1", T = "_selectTrigger_132y2_1", h = {
10
+ wrapper: B,
11
+ selectTrigger: T
12
12
  };
13
- function R({
14
- aiSuggestion: h,
13
+ function j({
14
+ aiSuggestion: C,
15
15
  onAiSuggestionAppend: d,
16
- onAiSuggestionReplace: g,
17
- onAiSuggestionIgnore: m,
18
- type: n,
19
- isSameValue: f
16
+ onAiSuggestionReplace: m,
17
+ onAiSuggestionIgnore: p,
18
+ type: o,
19
+ isSameValue: f,
20
+ confidenceLevel: n
20
21
  }) {
21
- const o = x(), {
22
- enableModernizedComponents: C
23
- } = I();
22
+ const i = A(), {
23
+ enableModernizedComponents: I
24
+ } = w(), M = n ? n.charAt(0).toUpperCase() + n.slice(1).toLowerCase() : void 0;
24
25
  return /* @__PURE__ */ e("div", {
25
26
  className: l.wrapperGradient,
26
- "data-modern": C,
27
+ "data-modern": I,
27
28
  children: /* @__PURE__ */ e("div", {
28
- className: M(l.wrapper, S.wrapper),
29
- children: f ? /* @__PURE__ */ i(u, {
30
- children: [/* @__PURE__ */ e(s, {
29
+ className: v(l.wrapper, h.wrapper),
30
+ children: f ? /* @__PURE__ */ r(S, {
31
+ children: [/* @__PURE__ */ e(c, {
31
32
  as: "p",
32
33
  color: "textOnLightSecondary",
33
34
  variant: "caption",
34
- children: /* @__PURE__ */ e(r, {
35
+ children: /* @__PURE__ */ e(s, {
35
36
  ...t.sameValueAiSuggestionCaption
36
37
  })
37
38
  }), /* @__PURE__ */ e("div", {
38
39
  className: l.buttons,
39
- children: /* @__PURE__ */ e(c, {
40
- "aria-label": o.formatMessage(t.aiSuggestionConfirm),
41
- icon: p,
42
- onClick: m,
40
+ children: /* @__PURE__ */ e(g, {
41
+ "aria-label": i.formatMessage(t.aiSuggestionConfirm),
42
+ icon: u,
43
+ onClick: p,
43
44
  size: "x-small",
44
45
  "data-target-id": "IconButton-aiSuggestionConfirm"
45
46
  })
46
47
  })]
47
- }) : /* @__PURE__ */ i(u, {
48
- children: [/* @__PURE__ */ i("div", {
49
- children: [/* @__PURE__ */ e(s, {
48
+ }) : /* @__PURE__ */ r(S, {
49
+ children: [/* @__PURE__ */ r("div", {
50
+ children: [/* @__PURE__ */ e(c, {
50
51
  as: "p",
51
52
  color: "textOnLightSecondary",
52
53
  variant: "caption",
53
- children: /* @__PURE__ */ e(r, {
54
- ...t.aiSuggestionCaption
55
- })
56
- }), /* @__PURE__ */ e(s, {
54
+ children: n ? i.formatMessage(t.aiSuggestionCaptionWithLevel, {
55
+ level: M
56
+ }) : i.formatMessage(t.aiSuggestionCaption)
57
+ }), /* @__PURE__ */ e(c, {
57
58
  as: "p",
58
- children: v(h, {
59
- type: n,
60
- locale: o.locale
59
+ children: b(C, {
60
+ type: o,
61
+ locale: i.locale
61
62
  })
62
63
  })]
63
- }), /* @__PURE__ */ i("div", {
64
+ }), /* @__PURE__ */ r("div", {
64
65
  className: l.buttons,
65
- children: [/* @__PURE__ */ e(c, {
66
- "aria-label": o.formatMessage(n === "multiSelect" ? t.aiSuggestionAppend : t.aiSuggestionClearAndReplace),
67
- "data-target-id": n === "multiSelect" ? "IconButton-aiSuggestionAppend" : "IconButton-aiSuggestionClearAndReplace",
68
- icon: p,
69
- onClick: n === "multiSelect" ? d : g,
66
+ children: [/* @__PURE__ */ e(g, {
67
+ "aria-label": i.formatMessage(o === "multiSelect" ? t.aiSuggestionAppend : t.aiSuggestionClearAndReplace),
68
+ "data-target-id": o === "multiSelect" ? "IconButton-aiSuggestionAppend" : "IconButton-aiSuggestionClearAndReplace",
69
+ icon: u,
70
+ onClick: o === "multiSelect" ? d : m,
70
71
  size: "x-small"
71
- }), /* @__PURE__ */ i(a.Root, {
72
+ }), /* @__PURE__ */ r(a.Root, {
72
73
  children: [/* @__PURE__ */ e(a.Trigger, {
73
- className: S.selectTrigger,
74
- children: /* @__PURE__ */ e(c, {
75
- "aria-label": o.formatMessage(t.aiSuggestionOptions),
76
- icon: w,
74
+ className: h.selectTrigger,
75
+ children: /* @__PURE__ */ e(g, {
76
+ "aria-label": i.formatMessage(t.aiSuggestionOptions),
77
+ icon: x,
77
78
  "data-target-id": "IconButton-aiSuggestionOptions"
78
79
  })
79
- }), /* @__PURE__ */ i(a.Content, {
80
- children: [n === "multiSelect" && /* @__PURE__ */ e(a.Item, {
80
+ }), /* @__PURE__ */ r(a.Content, {
81
+ children: [o === "multiSelect" && /* @__PURE__ */ e(a.Item, {
81
82
  onSelect: d,
82
83
  "data-target-id": "DropdownMenu.Item-aiSuggestionAppend",
83
- children: /* @__PURE__ */ e(r, {
84
+ children: /* @__PURE__ */ e(s, {
84
85
  ...t.aiSuggestionAppend
85
86
  })
86
87
  }), /* @__PURE__ */ e(a.Item, {
87
- onSelect: g,
88
+ onSelect: m,
88
89
  "data-target-id": "DropdownMenu.Item-aiSuggestionClearAndReplace",
89
- children: /* @__PURE__ */ e(r, {
90
+ children: /* @__PURE__ */ e(s, {
90
91
  ...t.aiSuggestionClearAndReplace
91
92
  })
92
93
  }), /* @__PURE__ */ e(a.Separator, {}), /* @__PURE__ */ e(a.Item, {
93
- onSelect: m,
94
+ onSelect: p,
94
95
  "data-target-id": "DropdownMenu.Item-aiSuggestionIgnore",
95
- children: /* @__PURE__ */ e(r, {
96
+ children: /* @__PURE__ */ e(s, {
96
97
  ...t.aiSuggestionIgnore
97
98
  })
98
99
  })]
@@ -104,5 +105,5 @@ function R({
104
105
  });
105
106
  }
106
107
  export {
107
- R as AiSuggestionField
108
+ j as AiSuggestionField
108
109
  };
@@ -24,6 +24,10 @@ const i = e({
24
24
  id: "metadataEditor.aiSuggestionField.ignoreLabel",
25
25
  defaultMessage: "Ignore"
26
26
  },
27
+ aiSuggestionCaptionWithLevel: {
28
+ id: "metadataEditor.aiSuggestionField.aiSuggestionCaptionWithLevel",
29
+ defaultMessage: "Box AI suggestion ({level} confidence)"
30
+ },
27
31
  aiSuggestionConfirm: {
28
32
  id: "metadataEditor.aiSuggestionField.dismissLabel",
29
33
  defaultMessage: "Confirm"
@@ -0,0 +1,4 @@
1
+ import { LowConfidenceBadge as d } from "./low-confidence-badge.js";
2
+ export {
3
+ d as LowConfidenceBadge
4
+ };
@@ -0,0 +1,30 @@
1
+ import { Status as c, Tooltip as m } from "@box/blueprint-web";
2
+ import { AlertCircle as s } from "@box/blueprint-web-assets/icons/Medium";
3
+ import { SurfaceStatusSurfaceGray as f } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import { useIntl as a } from "react-intl";
5
+ import p from "../../../../utils/confidence-score/messages.js";
6
+ import l from "../../messages.js";
7
+ import { jsx as t } from "react/jsx-runtime";
8
+ import { formatConfidenceScorePercent as u } from "../../../../utils/confidence-score/format-confidence-score-percent.js";
9
+ function L({
10
+ confidenceScore: e
11
+ }) {
12
+ const {
13
+ formatMessage: o
14
+ } = a(), r = /* @__PURE__ */ t(c, {
15
+ color: f,
16
+ interactive: !0,
17
+ text: o(l.lowConfidenceBadge).toUpperCase(),
18
+ icon: s,
19
+ iconPosition: "left"
20
+ }), i = u(e.value), n = o(p.tooltipLowConfidence, {
21
+ score: i
22
+ });
23
+ return /* @__PURE__ */ t(m, {
24
+ content: n,
25
+ children: r
26
+ });
27
+ }
28
+ export {
29
+ L as LowConfidenceBadge
30
+ };
@@ -1,66 +1,67 @@
1
- import { DateI18nProvider as x, DatePicker as I } from "@box/blueprint-web";
2
- import { useFormikContext as L, getIn as T, Field as A } from "formik";
3
- import { forwardRef as w, useMemo as S } from "react";
4
- import { useIntl as V } from "react-intl";
5
- import { convertIsoStringToCalendarDate as N, convertCalendarDateToISOString as O } from "../../../../utils/convertDate.js";
1
+ import { DateI18nProvider as I, DatePicker as L } from "@box/blueprint-web";
2
+ import { useFormikContext as T, getIn as A, Field as w } from "formik";
3
+ import { forwardRef as S, useMemo as V } from "react";
4
+ import { useIntl as N } from "react-intl";
5
+ import { convertIsoStringToCalendarDate as O, convertCalendarDateToISOString as B } from "../../../../utils/convertDate.js";
6
6
  import a from "../../../../messages.js";
7
- import { g as B } from "../../../../../../chunks/utils2.js";
7
+ import { g as $ } from "../../../../../../chunks/utils2.js";
8
8
  import { jsx as r } from "react/jsx-runtime";
9
- const H = /* @__PURE__ */ w(({
9
+ const J = /* @__PURE__ */ S(({
10
10
  className: s,
11
11
  description: d,
12
12
  isAiSuggestionApplied: c,
13
- disableForm: m,
14
- fieldNamePrefix: f,
13
+ confidenceScore: m,
14
+ disableForm: f,
15
+ fieldNamePrefix: u,
15
16
  label: n,
16
- onValueEdited: u,
17
- portalElement: h,
18
- updateModePrefix: p
19
- }, D) => {
20
- const t = `${p ?? f}.value`, e = V(), {
21
- values: g,
22
- setFieldTouched: M,
23
- setFieldValue: k
24
- } = L(), i = T(g, t), v = S(() => N(i), [i]), b = {
17
+ onValueEdited: h,
18
+ portalElement: p,
19
+ updateModePrefix: D
20
+ }, g) => {
21
+ const t = `${D ?? u}.value`, e = N(), {
22
+ values: M,
23
+ setFieldTouched: k,
24
+ setFieldValue: v
25
+ } = T(), i = A(M, t), b = V(() => O(i), [i]), C = {
25
26
  clearDatePickerAriaLabel: e.formatMessage(a.clearSelectedDate),
26
27
  nextMonthAriaLabel: e.formatMessage(a.switchToNextMonth),
27
28
  openCalendarDropdownAriaLabel: e.formatMessage(a.openCalendar),
28
29
  previousMonthAriaLabel: e.formatMessage(a.switchToNextMonth)
29
- }, C = (o) => {
30
- const l = O(o);
31
- k(t, l), u();
32
- }, F = () => {
33
- M(t, !0);
30
+ }, F = (o) => {
31
+ const l = B(o);
32
+ v(t, l), h();
33
+ }, P = () => {
34
+ k(t, !0);
34
35
  };
35
36
  return /* @__PURE__ */ r("div", {
36
37
  "data-testid": `${n}-field`,
37
- children: /* @__PURE__ */ r(x, {
38
+ children: /* @__PURE__ */ r(I, {
38
39
  locale: e.locale,
39
- children: /* @__PURE__ */ r(A, {
40
+ children: /* @__PURE__ */ r(w, {
40
41
  name: t,
41
42
  children: ({
42
43
  field: o,
43
44
  meta: l
44
- }) => /* @__PURE__ */ r(I, {
45
+ }) => /* @__PURE__ */ r(L, {
45
46
  ...o,
46
- ...b,
47
- ref: D,
47
+ ...C,
48
+ ref: g,
48
49
  calendarAriaLabel: e.formatMessage(a.selectDate),
49
50
  className: s,
50
51
  dataTargetId: "DatePicker-MetadataEditorDateField",
51
52
  error: l.error,
52
- isDisabled: m,
53
- label: B(n, d, c, "span"),
54
- onBlur: () => F(),
55
- onChange: (P) => C(P),
56
- portalElement: h,
57
- value: v
53
+ isDisabled: f,
54
+ label: $(n, d, c, "span", m),
55
+ onBlur: () => P(),
56
+ onChange: (x) => F(x),
57
+ portalElement: p,
58
+ value: b
58
59
  })
59
60
  })
60
61
  })
61
62
  });
62
63
  });
63
64
  export {
64
- H as MetadataDateField,
65
- H as default
65
+ J as MetadataDateField,
66
+ J as default
66
67
  };
@@ -1,59 +1,60 @@
1
1
  import { Select as l, SELECT_EMPTY_VALUE as r } from "@box/blueprint-web";
2
- import { useFormikContext as _, getIn as A, Field as C } from "formik";
3
- import { forwardRef as O } from "react";
4
- import { useIntl as T, FormattedMessage as $ } from "react-intl";
2
+ import { useFormikContext as A, getIn as C, Field as O } from "formik";
3
+ import { forwardRef as T } from "react";
4
+ import { useIntl as $, FormattedMessage as I } from "react-intl";
5
5
  import u from "../../../../messages.js";
6
- import { g as I } from "../../../../../../chunks/utils2.js";
7
- import { messages as P } from "../update-mode-field-wrapper/messages.js";
8
- import { MULTI_VALUE_DEFAULT_VALUE as S } from "../update-mode-field-wrapper/mulitple-values-utils.js";
9
- import { jsx as a, jsxs as j } from "react/jsx-runtime";
10
- const B = /* @__PURE__ */ O(({
6
+ import { g as P } from "../../../../../../chunks/utils2.js";
7
+ import { messages as S } from "../update-mode-field-wrapper/messages.js";
8
+ import { MULTI_VALUE_DEFAULT_VALUE as j } from "../update-mode-field-wrapper/mulitple-values-utils.js";
9
+ import { jsx as a, jsxs as w } from "react/jsx-runtime";
10
+ const G = /* @__PURE__ */ T(({
11
11
  className: c,
12
12
  isAiSuggestionApplied: p,
13
- description: f,
14
- disableForm: g,
13
+ confidenceScore: f,
14
+ description: g,
15
+ disableForm: E,
15
16
  fieldNamePrefix: s,
16
- updateModePrefix: E,
17
+ updateModePrefix: h,
17
18
  label: n,
18
- onValueEdited: h,
19
- options: v,
20
- portalElement: L
21
- }, V) => {
19
+ onValueEdited: v,
20
+ options: L,
21
+ portalElement: V
22
+ }, F) => {
22
23
  const {
23
- setFieldValue: F,
24
- values: M
25
- } = _(), {
24
+ setFieldValue: M,
25
+ values: b
26
+ } = A(), {
26
27
  formatMessage: i
27
- } = T(), m = `${E ?? s}.value`, b = i(P.multipleValues), x = (v || A(M, `${s}.options`, [])).map((e) => typeof e == "string" ? e : e.key), d = i(u.selectValuePlaceholder), U = (e) => e === S ? b : e;
28
+ } = $(), m = `${h ?? s}.value`, x = i(S.multipleValues), U = (L || C(b, `${s}.options`, [])).map((e) => typeof e == "string" ? e : e.key), d = i(u.selectValuePlaceholder), _ = (e) => e === j ? x : e;
28
29
  return /* @__PURE__ */ a("div", {
29
30
  "data-testid": `${n}-field`,
30
- children: /* @__PURE__ */ a(C, {
31
+ children: /* @__PURE__ */ a(O, {
31
32
  name: m,
32
33
  children: ({
33
34
  field: e
34
35
  }) => /* @__PURE__ */ a(l, {
35
- ref: V,
36
+ ref: F,
36
37
  className: c,
37
38
  "data-target-id": "Select-MetadataEditorEnumField",
38
- disabled: g,
39
- label: I(n, f, p),
39
+ disabled: E,
40
+ label: P(n, g, p, "label", f),
40
41
  onValueChange: (t) => {
41
- F(m, t === r ? "" : t), h();
42
+ M(m, t === r ? "" : t), v();
42
43
  },
43
44
  placeholder: d,
44
45
  ...e,
45
46
  value: e.value === r ? "" : e.value,
46
- children: /* @__PURE__ */ j(l.Content, {
47
- container: L,
47
+ children: /* @__PURE__ */ w(l.Content, {
48
+ container: V,
48
49
  onEscapeKeyDown: (t) => t.stopPropagation(),
49
50
  children: [/* @__PURE__ */ a(l.Option, {
50
51
  text: d,
51
52
  value: r,
52
- children: /* @__PURE__ */ a($, {
53
+ children: /* @__PURE__ */ a(I, {
53
54
  ...u.selectValuePlaceholder
54
55
  })
55
- }), x?.map((t) => {
56
- const o = U(t);
56
+ }), U?.map((t) => {
57
+ const o = _(t);
57
58
  return /* @__PURE__ */ a(l.Option, {
58
59
  text: o,
59
60
  value: t,
@@ -66,6 +67,6 @@ const B = /* @__PURE__ */ O(({
66
67
  });
67
68
  });
68
69
  export {
69
- B as MetadataEnumField,
70
- B as default
70
+ G as MetadataEnumField,
71
+ G as default
71
72
  };
@@ -1,55 +1,56 @@
1
1
  import { TextInput as I } from "@box/blueprint-web";
2
2
  import { useFormikContext as M, getIn as R, Field as V } from "formik";
3
- import { forwardRef as $, useRef as b } from "react";
4
- import { g as B } from "../../../../../../chunks/utils2.js";
5
- import { useFloatValidation as O } from "./use-float-validation.js";
3
+ import { forwardRef as $, useRef as B } from "react";
4
+ import { g as O } from "../../../../../../chunks/utils2.js";
5
+ import { useFloatValidation as j } from "./use-float-validation.js";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
- const q = /* @__PURE__ */ $(({
8
- className: d,
9
- description: l,
7
+ const y = /* @__PURE__ */ $(({
8
+ className: l,
9
+ description: d,
10
10
  isAiSuggestionApplied: i,
11
+ confidenceScore: n,
11
12
  label: r,
12
- fieldNamePrefix: n,
13
- disableForm: s,
14
- onValueEdited: u,
15
- updateModePrefix: c
16
- }, m) => {
13
+ fieldNamePrefix: s,
14
+ disableForm: u,
15
+ onValueEdited: c,
16
+ updateModePrefix: m
17
+ }, f) => {
17
18
  const {
18
- values: f,
19
- setFieldValue: p,
20
- setFieldTouched: F
21
- } = M(), t = `${c ?? n}.value`, h = R(f, t), o = b(h), {
22
- validateFloats: g
23
- } = O(), v = (e) => {
24
- o.current = e, p(t, e), u();
25
- }, x = (e) => {
26
- F(e, !0);
19
+ values: p,
20
+ setFieldValue: F,
21
+ setFieldTouched: h
22
+ } = M(), t = `${m ?? s}.value`, g = R(p, t), o = B(g), {
23
+ validateFloats: v
24
+ } = j(), x = (e) => {
25
+ o.current = e, F(t, e), c();
26
+ }, T = (e) => {
27
+ h(e, !0);
27
28
  };
28
29
  return /* @__PURE__ */ a("div", {
29
30
  "data-testid": `${r}-field`,
30
31
  children: /* @__PURE__ */ a(V, {
31
32
  name: `${t}`,
32
- validate: () => g(o.current),
33
+ validate: () => v(o.current),
33
34
  children: ({
34
35
  field: e,
35
- meta: T
36
+ meta: b
36
37
  }) => /* @__PURE__ */ a(I, {
37
38
  ...e,
38
- ref: m,
39
- className: d,
39
+ ref: f,
40
+ className: l,
40
41
  "data-target-id": "TextInput-MetadataEditorFloatField",
41
- disabled: s,
42
- error: T.error,
42
+ disabled: u,
43
+ error: b.error,
43
44
  inputMode: "decimal",
44
- label: B(r, l, i),
45
- onBlur: () => x(t),
46
- onChange: (C) => v(C.currentTarget.value),
45
+ label: O(r, d, i, "label", n),
46
+ onBlur: () => T(t),
47
+ onChange: (C) => x(C.currentTarget.value),
47
48
  placeholder: "0"
48
49
  })
49
50
  })
50
51
  });
51
52
  });
52
53
  export {
53
- q as MetadataFloatField,
54
- q as default
54
+ y as MetadataFloatField,
55
+ y as default
55
56
  };