@box/metadata-editor 0.45.0 → 0.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/chunks/metadata-editor-field-wrapper.js +65 -0
  2. package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +76 -0
  3. package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/index.js +4 -0
  4. package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +26 -0
  5. package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js +13 -0
  6. package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +49 -45
  7. package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +21 -19
  8. package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +28 -26
  9. package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +27 -25
  10. package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +22 -20
  11. package/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +12 -0
  12. package/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +22 -43
  13. package/esm/lib/test-utils/sample-data.js +8 -8
  14. package/i18n/bn-IN.js +5 -0
  15. package/i18n/da-DK.js +5 -0
  16. package/i18n/de-DE.js +5 -0
  17. package/i18n/en-AU.js +5 -0
  18. package/i18n/en-CA.js +5 -0
  19. package/i18n/en-GB.js +5 -0
  20. package/i18n/en-US.js +5 -0
  21. package/i18n/en-US.properties +10 -0
  22. package/i18n/en-x-pseudo.js +5 -0
  23. package/i18n/es-419.js +5 -0
  24. package/i18n/es-ES.js +5 -0
  25. package/i18n/fi-FI.js +5 -0
  26. package/i18n/fr-CA.js +5 -0
  27. package/i18n/fr-FR.js +5 -0
  28. package/i18n/hi-IN.js +5 -0
  29. package/i18n/it-IT.js +5 -0
  30. package/i18n/ja-JP.js +5 -0
  31. package/i18n/json/src/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.json +1 -0
  32. package/i18n/ko-KR.js +5 -0
  33. package/i18n/nb-NO.js +5 -0
  34. package/i18n/nl-NL.js +5 -0
  35. package/i18n/pl-PL.js +5 -0
  36. package/i18n/pt-BR.js +5 -0
  37. package/i18n/ru-RU.js +5 -0
  38. package/i18n/sv-SE.js +5 -0
  39. package/i18n/tr-TR.js +5 -0
  40. package/i18n/zh-CN.js +5 -0
  41. package/i18n/zh-TW.js +5 -0
  42. package/package.json +5 -5
  43. package/styles/ai-suggestion-field.css +1 -0
  44. package/styles/metadata-editor-field-wrapper.css +1 -0
  45. package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.d.ts +2 -0
  46. package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/index.d.ts +1 -0
  47. package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.d.ts +28 -0
  48. package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/types.d.ts +21 -0
  49. package/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.d.ts +3 -0
  50. package/types/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.d.ts +1 -1
  51. package/types/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.d.ts +1 -1
  52. package/types/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.d.ts +1 -1
  53. package/types/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.d.ts +1 -1
  54. package/types/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.d.ts +1 -1
  55. package/types/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.d.ts +2 -0
  56. package/types/lib/components/metadata-editor-fields/metadata-editor-fields.d.ts +1 -1
  57. package/types/lib/components/metadata-editor-fields/types.d.ts +6 -1
  58. package/types/lib/test-utils/sample-data.d.ts +2 -2
  59. package/types/lib/types.d.ts +2 -1
  60. package/styles/metadata-editor-fields.css +0 -1
@@ -0,0 +1,65 @@
1
+ import "../styles/metadata-editor-field-wrapper.css";
2
+ import S from "clsx";
3
+ import { useFormikContext as x } from "formik";
4
+ import _ from "lodash/isUndefined";
5
+ import { useState as h } from "react";
6
+ import { AiSuggestionField as A } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js";
7
+ import { UpdateModeFieldWrapper as v } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js";
8
+ import { editorFieldTypes as k } from "../esm/lib/components/metadata-editor-fields/editor-field-types.js";
9
+ import { jsx as o, jsxs as F } from "react/jsx-runtime";
10
+ const W = "_noAttributesText_vykxc_1", M = "_fieldWrapper_vykxc_5", N = "_hasSuggestion_vykxc_5", T = "_error_vykxc_13", u = {
11
+ noAttributesText: W,
12
+ fieldWrapper: M,
13
+ hasSuggestion: N,
14
+ error: T
15
+ }, E = ({
16
+ disableForm: a,
17
+ portalElement: n,
18
+ field: e,
19
+ index: p
20
+ }) => {
21
+ const {
22
+ setFieldValue: d
23
+ } = x(), [g, r] = h(!0), i = k[e.type], c = i && !e.hidden, m = !_(e.updateMode), s = `metadata.fields[${p}]`;
24
+ if (!c)
25
+ return null;
26
+ if (m)
27
+ return /* @__PURE__ */ o(v, {
28
+ fieldNamePrefix: s,
29
+ fieldType: e.type,
30
+ children: /* @__PURE__ */ o(i, {
31
+ disableForm: a,
32
+ fieldNamePrefix: s,
33
+ label: e.displayName,
34
+ portalElement: n
35
+ })
36
+ }, e.key);
37
+ const {
38
+ aiSuggestion: t,
39
+ value: f
40
+ } = e, l = t && g;
41
+ return /* @__PURE__ */ F("div", {
42
+ className: u.fieldWrapper,
43
+ children: [/* @__PURE__ */ o(i, {
44
+ className: S(l && u.hasSuggestion),
45
+ disableForm: a,
46
+ fieldNamePrefix: `metadata.fields[${p}]`,
47
+ label: e.displayName,
48
+ portalElement: n
49
+ }), l && /* @__PURE__ */ o(A, {
50
+ aiSuggestion: t,
51
+ onAiSuggestionAppend: () => {
52
+ const y = e.type === "multiSelect" ? [f, t].flat() : t;
53
+ d(`${s}.value`, y), r(!1);
54
+ },
55
+ onAiSuggestionIgnore: () => r(!1),
56
+ onAiSuggestionReplace: () => {
57
+ d(`${s}.value`, t), r(!1);
58
+ }
59
+ })]
60
+ }, e.key);
61
+ };
62
+ export {
63
+ E as M,
64
+ u as s
65
+ };
@@ -0,0 +1,76 @@
1
+ import "../../../../../../styles/ai-suggestion-field.css";
2
+ import { Text as l, IconButton as c, DropdownMenu as r } from "@box/blueprint-web";
3
+ import { Checkmark as d, Ellipsis as u } from "@box/blueprint-web-assets/icons/Fill";
4
+ import { useIntl as h, FormattedMessage as n } from "react-intl";
5
+ import t from "./messages.js";
6
+ import { formatSuggestionValue as S } from "./utils.js";
7
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
8
+ const _ = "_wrapperGradient_1izxt_1", f = "_wrapper_1izxt_1", x = "_buttons_1izxt_18", w = "_selectTrigger_1izxt_22", o = {
9
+ wrapperGradient: _,
10
+ wrapper: f,
11
+ buttons: x,
12
+ selectTrigger: w
13
+ };
14
+ function M({
15
+ aiSuggestion: p,
16
+ onAiSuggestionAppend: a,
17
+ onAiSuggestionReplace: g,
18
+ onAiSuggestionIgnore: m
19
+ }) {
20
+ const s = h();
21
+ return /* @__PURE__ */ e("div", {
22
+ className: o.wrapperGradient,
23
+ children: /* @__PURE__ */ i("div", {
24
+ className: o.wrapper,
25
+ children: [/* @__PURE__ */ i("div", {
26
+ children: [/* @__PURE__ */ e(l, {
27
+ as: "p",
28
+ color: "textOnLightSecondary",
29
+ variant: "caption",
30
+ children: /* @__PURE__ */ e(n, {
31
+ ...t.aiSuggestionCaption
32
+ })
33
+ }), /* @__PURE__ */ e(l, {
34
+ as: "p",
35
+ children: S(p)
36
+ })]
37
+ }), /* @__PURE__ */ i("div", {
38
+ className: o.buttons,
39
+ children: [/* @__PURE__ */ e(c, {
40
+ "aria-label": s.formatMessage(t.aiSuggestionAppend),
41
+ icon: d,
42
+ onClick: a,
43
+ size: "x-small"
44
+ }), /* @__PURE__ */ i(r.Root, {
45
+ children: [/* @__PURE__ */ e(r.Trigger, {
46
+ className: o.selectTrigger,
47
+ children: /* @__PURE__ */ e(c, {
48
+ "aria-label": s.formatMessage(t.aiSuggestionOptions),
49
+ icon: u
50
+ })
51
+ }), /* @__PURE__ */ i(r.Content, {
52
+ children: [/* @__PURE__ */ e(r.Item, {
53
+ onSelect: a,
54
+ children: /* @__PURE__ */ e(n, {
55
+ ...t.aiSuggestionAppend
56
+ })
57
+ }), /* @__PURE__ */ e(r.Item, {
58
+ onSelect: g,
59
+ children: /* @__PURE__ */ e(n, {
60
+ ...t.aiSuggestionClearAndReplace
61
+ })
62
+ }), /* @__PURE__ */ e(r.Separator, {}), /* @__PURE__ */ e(r.Item, {
63
+ onSelect: m,
64
+ children: /* @__PURE__ */ e(n, {
65
+ ...t.aiSuggestionIgnore
66
+ })
67
+ })]
68
+ })]
69
+ })]
70
+ })]
71
+ })
72
+ });
73
+ }
74
+ export {
75
+ M as AiSuggestionField
76
+ };
@@ -0,0 +1,4 @@
1
+ import { AiSuggestionField as o } from "./ai-suggestion-field.js";
2
+ export {
3
+ o as AiSuggestionField
4
+ };
@@ -0,0 +1,26 @@
1
+ import { defineMessages as e } from "react-intl";
2
+ const i = e({
3
+ aiSuggestionCaption: {
4
+ id: "metadataEditor.aiSuggestionField.aiSuggestionCaption",
5
+ defaultMessage: "Box AI suggestion:"
6
+ },
7
+ aiSuggestionOptions: {
8
+ id: "metadataEditor.aiSuggestionField.aiSuggestionOptions",
9
+ defaultMessage: "Options"
10
+ },
11
+ aiSuggestionAppend: {
12
+ id: "metadataEditor.aiSuggestionField.appendLabel",
13
+ defaultMessage: "Append"
14
+ },
15
+ aiSuggestionClearAndReplace: {
16
+ id: "metadataEditor.aiSuggestionField.clearAndReplaceLabel",
17
+ defaultMessage: "Clear and Replace"
18
+ },
19
+ aiSuggestionIgnore: {
20
+ id: "metadataEditor.aiSuggestionField.ignoreLabel",
21
+ defaultMessage: "Ignore"
22
+ }
23
+ });
24
+ export {
25
+ i as default
26
+ };
@@ -0,0 +1,13 @@
1
+ function n(t) {
2
+ if (t == null)
3
+ return null;
4
+ if (typeof t == "number")
5
+ return t.toString();
6
+ if (Array.isArray(t))
7
+ return t.join(", ");
8
+ const r = new Date(t);
9
+ return !isNaN(r.getTime()) && r.toISOString() === t ? r.toLocaleDateString() : t;
10
+ }
11
+ export {
12
+ n as formatSuggestionValue
13
+ };
@@ -1,60 +1,64 @@
1
- import { DateI18nProvider as v, DatePicker as P } from "@box/blueprint-web";
2
- import { useFormikContext as x, getIn as F, Field as T } from "formik";
3
- import { useMemo as V } from "react";
4
- import { useIntl as b } from "react-intl";
5
- import { convertToDatePickerValue as A, convertToFormikValue as C } from "./date-conversion-utils.js";
6
- import { useDateInternationalization as L } from "./use-date-internationalization.js";
7
- import a from "../../../../messages.js";
1
+ import { DateI18nProvider as P, DatePicker as x } from "@box/blueprint-web";
2
+ import { useFormikContext as F, getIn as T, Field as V } from "formik";
3
+ import { useMemo as b } from "react";
4
+ import { useIntl as A } from "react-intl";
5
+ import { convertToDatePickerValue as C, convertToFormikValue as L } from "./date-conversion-utils.js";
6
+ import { useDateInternationalization as I } from "./use-date-internationalization.js";
7
+ import o from "../../../../messages.js";
8
8
  import { jsx as t } from "react/jsx-runtime";
9
- const S = ({
10
- disableForm: s,
11
- fieldNamePrefix: c,
12
- label: l,
13
- portalElement: m
9
+ const q = ({
10
+ disableForm: c,
11
+ fieldNamePrefix: m,
12
+ label: i,
13
+ portalElement: d,
14
+ className: u
14
15
  }) => {
15
- const o = `${c}.value`, e = b(), {
16
- values: d,
17
- setFieldTouched: u,
18
- setFieldValue: f
19
- } = x(), {
20
- localTimezone: h
21
- } = L(e.locale), i = F(d, o), p = V(() => A(i), [i]), D = {
22
- clearDatePickerAriaLabel: e.formatMessage(a.clearSelectedDate),
23
- nextMonthAriaLabel: e.formatMessage(a.switchToNextMonth),
24
- openCalendarDropdownAriaLabel: e.formatMessage(a.openCalendar),
25
- previousMonthAriaLabel: e.formatMessage(a.switchToNextMonth)
26
- }, M = (r) => {
27
- const n = C(r, h);
28
- f(o, n);
29
- }, g = () => {
30
- u(o, !0);
16
+ const a = `${m}.value`, e = A(), {
17
+ values: f,
18
+ setFieldTouched: h,
19
+ setFieldValue: p
20
+ } = F(), {
21
+ localTimezone: D
22
+ } = I(e.locale), r = T(f, a), s = b(() => C(r), [r]);
23
+ console.log(0, r, s);
24
+ const M = {
25
+ clearDatePickerAriaLabel: e.formatMessage(o.clearSelectedDate),
26
+ nextMonthAriaLabel: e.formatMessage(o.switchToNextMonth),
27
+ openCalendarDropdownAriaLabel: e.formatMessage(o.openCalendar),
28
+ previousMonthAriaLabel: e.formatMessage(o.switchToNextMonth)
29
+ }, g = (l) => {
30
+ const n = L(l, D);
31
+ p(a, n);
32
+ }, k = () => {
33
+ h(a, !0);
31
34
  };
32
35
  return /* @__PURE__ */ t("div", {
33
- "data-testid": `${l}-field`,
34
- children: /* @__PURE__ */ t(v, {
36
+ "data-testid": `${i}-field`,
37
+ children: /* @__PURE__ */ t(P, {
35
38
  locale: e.locale,
36
- children: /* @__PURE__ */ t(T, {
37
- name: o,
39
+ children: /* @__PURE__ */ t(V, {
40
+ name: a,
38
41
  children: ({
39
- field: r,
42
+ field: l,
40
43
  meta: n
41
- }) => /* @__PURE__ */ t(P, {
42
- ...r,
43
- ...D,
44
- calendarAriaLabel: e.formatMessage(a.selectDate),
44
+ }) => /* @__PURE__ */ t(x, {
45
+ ...l,
46
+ ...M,
47
+ calendarAriaLabel: e.formatMessage(o.selectDate),
48
+ className: u,
45
49
  error: n.error,
46
- isDisabled: s,
47
- label: l,
48
- onBlur: () => g(),
49
- onChange: (k) => M(k),
50
- portalElement: m,
51
- value: p
50
+ isDisabled: c,
51
+ label: i,
52
+ onBlur: () => k(),
53
+ onChange: (v) => g(v),
54
+ portalElement: d,
55
+ value: s
52
56
  })
53
57
  })
54
58
  })
55
59
  });
56
60
  };
57
61
  export {
58
- S as MetadataDateField,
59
- S as default
62
+ q as MetadataDateField,
63
+ q as default
60
64
  };
@@ -1,42 +1,44 @@
1
1
  import { Select as l, SELECT_EMPTY_VALUE as r } from "@box/blueprint-web";
2
- import { useFormikContext as f, getIn as x, Field as E } from "formik";
3
- import { useIntl as F, FormattedMessage as M } from "react-intl";
2
+ import { useFormikContext as x, getIn as E, Field as F } from "formik";
3
+ import { useIntl as M, FormattedMessage as V } from "react-intl";
4
4
  import d from "../../../../messages.js";
5
- import { jsx as t, jsxs as V } from "react/jsx-runtime";
6
- const S = ({
7
- disableForm: m,
5
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
6
+ const T = ({
7
+ className: m,
8
+ disableForm: i,
8
9
  fieldNamePrefix: n,
9
10
  label: o,
10
- options: i,
11
- portalElement: h
11
+ options: h,
12
+ portalElement: v
12
13
  }) => {
13
14
  const {
14
- setFieldValue: v,
15
- values: p
16
- } = f(), g = F(), c = `${n}.value`, s = i || x(p, `${n}.options`, []).map(({
15
+ setFieldValue: p,
16
+ values: g
17
+ } = x(), f = M(), c = `${n}.value`, s = h || E(g, `${n}.options`, []).map(({
17
18
  key: a
18
- }) => a), u = g.formatMessage(d.selectValuePlaceholder);
19
+ }) => a), u = f.formatMessage(d.selectValuePlaceholder);
19
20
  return /* @__PURE__ */ t("div", {
20
21
  "data-testid": `${o}-field`,
21
- children: /* @__PURE__ */ t(E, {
22
+ children: /* @__PURE__ */ t(F, {
22
23
  name: c,
23
24
  children: ({
24
25
  field: a
25
26
  }) => /* @__PURE__ */ t(l, {
26
- disabled: m,
27
+ className: m,
28
+ disabled: i,
27
29
  label: o,
28
30
  onValueChange: (e) => {
29
- v(c, e === r ? "" : e);
31
+ p(c, e === r ? "" : e);
30
32
  },
31
33
  placeholder: u,
32
34
  ...a,
33
35
  value: a.value === r ? "" : a.value,
34
- children: /* @__PURE__ */ V(l.Content, {
35
- container: h,
36
+ children: /* @__PURE__ */ C(l.Content, {
37
+ container: v,
36
38
  children: [/* @__PURE__ */ t(l.Option, {
37
39
  text: u,
38
40
  value: r,
39
- children: /* @__PURE__ */ t(M, {
41
+ children: /* @__PURE__ */ t(V, {
40
42
  ...d.selectValuePlaceholder
41
43
  })
42
44
  }), s == null ? void 0 : s.map((e) => /* @__PURE__ */ t(l.Option, {
@@ -50,6 +52,6 @@ const S = ({
50
52
  });
51
53
  };
52
54
  export {
53
- S as MetadataEnumField,
54
- S as default
55
+ T as MetadataEnumField,
56
+ T as default
55
57
  };
@@ -1,47 +1,49 @@
1
- import { TextInput as F } from "@box/blueprint-web";
2
- import { useFormikContext as v, getIn as g, Field as x } from "formik";
3
- import { useRef as C } from "react";
4
- import { fieldDefaultProps as T } from "../constants.js";
5
- import { useFloatValidation as V } from "./use-float-validation.js";
1
+ import { TextInput as v } from "@box/blueprint-web";
2
+ import { useFormikContext as g, getIn as x, Field as C } from "formik";
3
+ import { useRef as T } from "react";
4
+ import { fieldDefaultProps as V } from "../constants.js";
5
+ import { useFloatValidation as $ } from "./use-float-validation.js";
6
6
  import { jsx as r } from "react/jsx-runtime";
7
- const k = ({
7
+ const D = ({
8
8
  label: o,
9
9
  fieldNamePrefix: l,
10
- disableForm: n
10
+ disableForm: n,
11
+ className: i
11
12
  }) => {
12
13
  const {
13
- values: i,
14
- setFieldValue: d,
15
- setFieldTouched: s
16
- } = v(), t = `${l}.value`, u = g(i, t), a = C(u), {
17
- validateFloats: c
18
- } = V(), m = (e) => {
19
- a.current = e, d(t, e);
20
- }, f = (e) => {
21
- s(e, !0);
14
+ values: d,
15
+ setFieldValue: s,
16
+ setFieldTouched: u
17
+ } = g(), t = `${l}.value`, c = x(d, t), a = T(c), {
18
+ validateFloats: m
19
+ } = $(), f = (e) => {
20
+ a.current = e, s(t, e);
21
+ }, p = (e) => {
22
+ u(e, !0);
22
23
  };
23
24
  return /* @__PURE__ */ r("div", {
24
25
  "data-testid": `${o}-field`,
25
- children: /* @__PURE__ */ r(x, {
26
+ children: /* @__PURE__ */ r(C, {
26
27
  name: `${t}`,
27
- validate: () => c(a.current),
28
+ validate: () => m(a.current),
28
29
  children: ({
29
30
  field: e,
30
- meta: p
31
- }) => /* @__PURE__ */ r(F, {
32
- ...T,
31
+ meta: h
32
+ }) => /* @__PURE__ */ r(v, {
33
+ ...V,
33
34
  ...e,
35
+ className: i,
34
36
  disabled: n,
35
- error: p.error,
37
+ error: h.error,
36
38
  label: o,
37
- onBlur: () => f(t),
38
- onChange: (h) => m(h.currentTarget.value),
39
+ onBlur: () => p(t),
40
+ onChange: (F) => f(F.currentTarget.value),
39
41
  placeholder: "0"
40
42
  })
41
43
  })
42
44
  });
43
45
  };
44
46
  export {
45
- k as MetadataFloatField,
46
- k as default
47
+ D as MetadataFloatField,
48
+ D as default
47
49
  };
@@ -1,43 +1,45 @@
1
- import { TooltipProvider as h, Combobox as v } from "@box/blueprint-web";
2
- import { useFormikContext as F, getIn as g, Field as C } from "formik";
3
- import { useIntl as x } from "react-intl";
4
- import M from "../../../../messages.js";
5
- import { fieldDefaultProps as $ } from "../constants.js";
1
+ import { TooltipProvider as v, Combobox as F } from "@box/blueprint-web";
2
+ import { useFormikContext as g, getIn as C, Field as x } from "formik";
3
+ import { useIntl as M } from "react-intl";
4
+ import $ from "../../../../messages.js";
5
+ import { fieldDefaultProps as b } from "../constants.js";
6
6
  import { jsx as o } from "react/jsx-runtime";
7
- const j = ({
8
- disableForm: s,
7
+ const k = ({
8
+ className: s,
9
+ disableForm: a,
9
10
  fieldNamePrefix: l,
10
11
  label: r,
11
- portalElement: a,
12
- options: n
12
+ portalElement: n,
13
+ options: m
13
14
  }) => {
14
15
  const {
15
- setFieldValue: m,
16
- values: u
17
- } = F(), d = x(), i = `${l}.value`, c = n || g(u, `${l}.options`, []).map(({
16
+ setFieldValue: u,
17
+ values: d
18
+ } = g(), c = M(), i = `${l}.value`, p = m || C(d, `${l}.options`, []).map(({
18
19
  key: e
19
- }) => e), p = (e, t) => t.toLowerCase().includes(e.toLowerCase());
20
+ }) => e), f = (e, t) => t.toLowerCase().includes(e.toLowerCase());
20
21
  return /* @__PURE__ */ o("div", {
21
22
  "data-testid": `${r}-field`,
22
- children: /* @__PURE__ */ o(C, {
23
+ children: /* @__PURE__ */ o(x, {
23
24
  name: i,
24
25
  children: ({
25
26
  field: e
26
27
  }) => {
27
28
  var t;
28
- return /* @__PURE__ */ o(h, {
29
- children: /* @__PURE__ */ o(v, {
30
- ...$,
29
+ return /* @__PURE__ */ o(v, {
30
+ children: /* @__PURE__ */ o(F, {
31
+ ...b,
31
32
  as: "input",
32
- disabled: s,
33
- filterFn: p,
33
+ className: s,
34
+ disabled: a,
35
+ filterFn: f,
34
36
  label: r,
35
37
  multiselect: !0,
36
38
  name: e.name,
37
- onValueChange: (f) => m(i, f),
38
- options: c,
39
- placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? d.formatMessage(M.multiselectPlaceholder) : "",
40
- portalElement: a,
39
+ onValueChange: (h) => u(i, h),
40
+ options: p,
41
+ placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? c.formatMessage($.multiselectPlaceholder) : "",
42
+ portalElement: n,
41
43
  value: e.value
42
44
  })
43
45
  });
@@ -46,6 +48,6 @@ const j = ({
46
48
  });
47
49
  };
48
50
  export {
49
- j as MetadataMultiSelectField,
50
- j as default
51
+ k as MetadataMultiSelectField,
52
+ k as default
51
53
  };
@@ -1,35 +1,37 @@
1
- import { TextInput as m } from "@box/blueprint-web";
2
- import { Field as s } from "formik";
3
- import { useIntl as f } from "react-intl";
4
- import n from "../../../../messages.js";
5
- import { fieldDefaultProps as p } from "../constants.js";
1
+ import { TextInput as s } from "@box/blueprint-web";
2
+ import { Field as f } from "formik";
3
+ import { useIntl as n } from "react-intl";
4
+ import p from "../../../../messages.js";
5
+ import { fieldDefaultProps as c } from "../constants.js";
6
6
  import { jsx as e } from "react/jsx-runtime";
7
- const c = ({
7
+ const u = ({
8
8
  label: r,
9
9
  fieldNamePrefix: t,
10
- disableForm: a
10
+ disableForm: a,
11
+ className: o
11
12
  }) => {
12
- const o = f(), i = `${t}.value`;
13
+ const i = n(), d = `${t}.value`;
13
14
  return /* @__PURE__ */ e("div", {
14
15
  "data-testid": `${r}-field`,
15
- children: /* @__PURE__ */ e(s, {
16
- name: i,
16
+ children: /* @__PURE__ */ e(f, {
17
+ name: d,
17
18
  children: ({
18
- field: d,
19
- meta: l
20
- }) => /* @__PURE__ */ e(m, {
21
- ...p,
22
- ...d,
19
+ field: l,
20
+ meta: m
21
+ }) => /* @__PURE__ */ e(s, {
22
+ ...c,
23
+ ...l,
24
+ className: o,
23
25
  disabled: a,
24
- error: l.error,
26
+ error: m.error,
25
27
  label: r,
26
- placeholder: o.formatMessage(n.setValuePlaceholder)
28
+ placeholder: i.formatMessage(p.setValuePlaceholder)
27
29
  })
28
30
  })
29
31
  });
30
32
  };
31
- c.displayName = "MetadataStringField";
33
+ u.displayName = "MetadataStringField";
32
34
  export {
33
- c as MetadataStringField,
34
- c as default
35
+ u as MetadataStringField,
36
+ u as default
35
37
  };
@@ -0,0 +1,12 @@
1
+ import "clsx";
2
+ import "formik";
3
+ import "lodash/isUndefined";
4
+ import "react";
5
+ import "./components/ai-suggestion-field/ai-suggestion-field.js";
6
+ import "./components/update-mode-field-wrapper/update-mode-field-wrapper.js";
7
+ import "./editor-field-types.js";
8
+ import { M as f } from "../../../../chunks/metadata-editor-field-wrapper.js";
9
+ import "react/jsx-runtime";
10
+ export {
11
+ f as MetadataEditorFieldWrapper
12
+ };