@box/metadata-editor 0.63.0 → 0.64.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 (64) hide show
  1. package/chunks/metadata-editor-field-wrapper.js +55 -50
  2. package/esm/index.js +26 -26
  3. package/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +132 -131
  4. package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +37 -43
  5. package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +38 -44
  6. package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +30 -36
  7. package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +39 -47
  8. package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +28 -34
  9. package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +54 -0
  10. package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +49 -48
  11. package/esm/lib/components/metadata-editor-fields/editor-field-types.js +19 -15
  12. package/esm/lib/components/metadata-editor-fields/utils.js +13 -0
  13. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +48 -46
  14. package/esm/lib/defaults.js +2 -1
  15. package/esm/lib/messages.js +4 -0
  16. package/i18n/bn-IN.js +1 -0
  17. package/i18n/da-DK.js +1 -0
  18. package/i18n/de-DE.js +1 -0
  19. package/i18n/en-AU.js +1 -0
  20. package/i18n/en-CA.js +1 -0
  21. package/i18n/en-GB.js +1 -0
  22. package/i18n/en-US.js +1 -0
  23. package/i18n/en-US.properties +2 -0
  24. package/i18n/en-x-pseudo.js +1 -0
  25. package/i18n/es-419.js +1 -0
  26. package/i18n/es-ES.js +1 -0
  27. package/i18n/fi-FI.js +1 -0
  28. package/i18n/fr-CA.js +1 -0
  29. package/i18n/fr-FR.js +1 -0
  30. package/i18n/hi-IN.js +1 -0
  31. package/i18n/it-IT.js +1 -0
  32. package/i18n/ja-JP.js +1 -0
  33. package/i18n/json/src/lib/messages.json +1 -1
  34. package/i18n/ko-KR.js +1 -0
  35. package/i18n/nb-NO.js +1 -0
  36. package/i18n/nl-NL.js +1 -0
  37. package/i18n/pl-PL.js +1 -0
  38. package/i18n/pt-BR.js +1 -0
  39. package/i18n/ru-RU.js +1 -0
  40. package/i18n/sv-SE.js +1 -0
  41. package/i18n/tr-TR.js +1 -0
  42. package/i18n/zh-CN.js +1 -0
  43. package/i18n/zh-TW.js +1 -0
  44. package/package.json +3 -3
  45. package/types/index.d.ts +1 -1
  46. package/types/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.d.ts +16 -2
  47. package/types/lib/components/combobox-with-api-pagination/index.d.ts +1 -1
  48. package/types/lib/components/combobox-with-api-pagination/types.d.ts +5 -8
  49. package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.d.ts +3 -0
  50. package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/types.d.ts +6 -21
  51. package/types/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.d.ts +2 -1
  52. package/types/lib/components/metadata-editor-fields/editor-field-types.d.ts +1 -0
  53. package/types/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.d.ts +1 -0
  54. package/types/lib/components/metadata-editor-fields/types.d.ts +5 -0
  55. package/types/lib/components/metadata-editor-fields/utils.d.ts +3 -0
  56. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +4 -2
  57. package/types/lib/components/metadata-instance-editor/types.d.ts +2 -4
  58. package/types/lib/messages.d.ts +5 -0
  59. package/types/lib/test-utils/sample-data.d.ts +4 -1
  60. package/types/lib/types.d.ts +11 -3
  61. package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/index.js +0 -4
  62. package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/single-level-taxonomy-field.js +0 -8
  63. package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/index.d.ts +0 -2
  64. package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/single-level-taxonomy-field.d.ts +0 -5
@@ -1,58 +1,52 @@
1
- import { Select as l, SELECT_EMPTY_VALUE as s } from "@box/blueprint-web";
2
- import { useFormikContext as F, getIn as M, Field as V } from "formik";
3
- import { useIntl as C, FormattedMessage as T } from "react-intl";
4
- import { forwardRef as I } from "react";
5
- import u from "../../../../messages.js";
6
- import $ from "../../../interactive-text/interactive-text.js";
7
- import { jsx as t, jsxs as j } from "react/jsx-runtime";
8
- const R = /* @__PURE__ */ I(({
9
- className: i,
10
- description: n,
11
- disableForm: h,
12
- fieldNamePrefix: m,
13
- label: r,
14
- options: v,
15
- portalElement: f
16
- }, p) => {
1
+ import { Select as l, SELECT_EMPTY_VALUE as o } from "@box/blueprint-web";
2
+ import { useFormikContext as M, getIn as V, Field as C } from "formik";
3
+ import { useIntl as L, FormattedMessage as $ } from "react-intl";
4
+ import { forwardRef as b } from "react";
5
+ import c from "../../../../messages.js";
6
+ import { getFieldLabel as j } from "../../utils.js";
7
+ import { jsx as t, jsxs as I } from "react/jsx-runtime";
8
+ const U = /* @__PURE__ */ b(({
9
+ className: u,
10
+ description: i,
11
+ disableForm: f,
12
+ fieldNamePrefix: s,
13
+ label: n,
14
+ options: h,
15
+ portalElement: p,
16
+ updateModePrefix: v
17
+ }, g) => {
17
18
  const {
18
- setFieldValue: x,
19
- values: g
20
- } = F(), E = C(), c = `${m}.value`, o = v || M(g, `${m}.options`, []).map(({
19
+ setFieldValue: F,
20
+ values: x
21
+ } = M(), E = L(), m = `${v ?? s}.value`, r = h || V(x, `${s}.options`, []).map(({
21
22
  key: a
22
- }) => a), d = E.formatMessage(u.selectValuePlaceholder);
23
+ }) => a), d = E.formatMessage(c.selectValuePlaceholder);
23
24
  return /* @__PURE__ */ t("div", {
24
- "data-testid": `${r}-field`,
25
- children: /* @__PURE__ */ t(V, {
26
- name: c,
25
+ "data-testid": `${n}-field`,
26
+ children: /* @__PURE__ */ t(C, {
27
+ name: m,
27
28
  children: ({
28
29
  field: a
29
30
  }) => /* @__PURE__ */ t(l, {
30
- ref: p,
31
- className: i,
32
- disabled: h,
33
- label: n ? ({
34
- ...e
35
- }) => $({
36
- as: "label",
37
- tooltipText: n,
38
- children: r,
39
- ...e
40
- }) : r,
31
+ ref: g,
32
+ className: u,
33
+ disabled: f,
34
+ label: j(n, i),
41
35
  onValueChange: (e) => {
42
- x(c, e === s ? "" : e);
36
+ F(m, e === o ? "" : e);
43
37
  },
44
38
  placeholder: d,
45
39
  ...a,
46
- value: a.value === s ? "" : a.value,
47
- children: /* @__PURE__ */ j(l.Content, {
48
- container: f,
40
+ value: a.value === o ? "" : a.value,
41
+ children: /* @__PURE__ */ I(l.Content, {
42
+ container: p,
49
43
  children: [/* @__PURE__ */ t(l.Option, {
50
44
  text: d,
51
- value: s,
52
- children: /* @__PURE__ */ t(T, {
53
- ...u.selectValuePlaceholder
45
+ value: o,
46
+ children: /* @__PURE__ */ t($, {
47
+ ...c.selectValuePlaceholder
54
48
  })
55
- }), o == null ? void 0 : o.map((e) => /* @__PURE__ */ t(l.Option, {
49
+ }), r == null ? void 0 : r.map((e) => /* @__PURE__ */ t(l.Option, {
56
50
  text: e,
57
51
  value: e,
58
52
  children: e
@@ -63,6 +57,6 @@ const R = /* @__PURE__ */ I(({
63
57
  });
64
58
  });
65
59
  export {
66
- R as MetadataEnumField,
67
- R as default
60
+ U as MetadataEnumField,
61
+ U as default
68
62
  };
@@ -1,53 +1,47 @@
1
- import { TextInput as T } from "@box/blueprint-web";
2
- import { useFormikContext as g, getIn as C, Field as I } from "formik";
3
- import { forwardRef as R, useRef as V } from "react";
4
- import $ from "../../../interactive-text/interactive-text.js";
5
- import { fieldDefaultProps as b } from "../constants.js";
6
- import { useFloatValidation as B } from "./use-float-validation.js";
7
- import { jsx as a } from "react/jsx-runtime";
8
- const N = /* @__PURE__ */ R(({
9
- className: i,
10
- description: l,
11
- label: r,
12
- fieldNamePrefix: d,
13
- disableForm: s
1
+ import { TextInput as b } from "@box/blueprint-web";
2
+ import { useFormikContext as C, getIn as R, Field as T } from "formik";
3
+ import { forwardRef as V, useRef as $ } from "react";
4
+ import { fieldDefaultProps as B } from "../constants.js";
5
+ import { useFloatValidation as I } from "./use-float-validation.js";
6
+ import { getFieldLabel as O } from "../../utils.js";
7
+ import { jsx as r } from "react/jsx-runtime";
8
+ const N = /* @__PURE__ */ V(({
9
+ className: l,
10
+ description: n,
11
+ label: o,
12
+ fieldNamePrefix: i,
13
+ disableForm: d,
14
+ updateModePrefix: s
14
15
  }, u) => {
15
16
  const {
16
17
  values: f,
17
18
  setFieldValue: m,
18
19
  setFieldTouched: c
19
- } = g(), t = `${d}.value`, p = C(f, t), n = V(p), {
20
- validateFloats: h
21
- } = B(), F = (e) => {
22
- n.current = e, m(t, e);
20
+ } = C(), t = `${s ?? i}.value`, p = R(f, t), a = $(p), {
21
+ validateFloats: F
22
+ } = I(), h = (e) => {
23
+ a.current = e, m(t, e);
23
24
  }, v = (e) => {
24
25
  c(e, !0);
25
26
  };
26
- return /* @__PURE__ */ a("div", {
27
- "data-testid": `${r}-field`,
28
- children: /* @__PURE__ */ a(I, {
27
+ return /* @__PURE__ */ r("div", {
28
+ "data-testid": `${o}-field`,
29
+ children: /* @__PURE__ */ r(T, {
29
30
  name: `${t}`,
30
- validate: () => h(n.current),
31
+ validate: () => F(a.current),
31
32
  children: ({
32
33
  field: e,
33
- meta: x
34
- }) => /* @__PURE__ */ a(T, {
35
- ...b,
34
+ meta: g
35
+ }) => /* @__PURE__ */ r(b, {
36
+ ...B,
36
37
  ...e,
37
38
  ref: u,
38
- className: i,
39
- disabled: s,
40
- error: x.error,
41
- label: l ? ({
42
- ...o
43
- }) => $({
44
- as: "label",
45
- tooltipText: l,
46
- children: r,
47
- ...o
48
- }) : r,
39
+ className: l,
40
+ disabled: d,
41
+ error: g.error,
42
+ label: O(o, n),
49
43
  onBlur: () => v(t),
50
- onChange: (o) => F(o.currentTarget.value),
44
+ onChange: (x) => h(x.currentTarget.value),
51
45
  placeholder: "0",
52
46
  type: "number"
53
47
  })
@@ -1,64 +1,56 @@
1
- import { TooltipProvider as g, Combobox as x } from "@box/blueprint-web";
2
- import { useFormikContext as C, getIn as b, Field as w } from "formik";
3
- import { useIntl as I } from "react-intl";
1
+ import { Combobox as C } from "@box/blueprint-web";
2
+ import { useFormikContext as b, getIn as w, Field as x } from "formik";
3
+ import { useIntl as L } from "react-intl";
4
4
  import { forwardRef as M } from "react";
5
- import T from "../../../../messages.js";
6
- import $ from "../../../interactive-text/interactive-text.js";
7
- import { fieldDefaultProps as L } from "../constants.js";
5
+ import $ from "../../../../messages.js";
6
+ import { fieldDefaultProps as I } from "../constants.js";
7
+ import { getFieldLabel as V } from "../../utils.js";
8
8
  import { jsx as o } from "react/jsx-runtime";
9
- const q = /* @__PURE__ */ M(({
10
- className: s,
11
- description: a,
12
- disableForm: m,
13
- fieldNamePrefix: i,
14
- label: r,
15
- portalElement: d,
16
- options: u
9
+ const y = /* @__PURE__ */ M(({
10
+ className: i,
11
+ description: s,
12
+ disableForm: n,
13
+ fieldNamePrefix: r,
14
+ label: l,
15
+ portalElement: m,
16
+ options: u,
17
+ updateModePrefix: d
17
18
  }, p) => {
18
19
  const {
19
- setFieldValue: c,
20
- values: f
21
- } = C(), h = I(), n = `${i}.value`, v = u || b(f, `${i}.options`, []).map(({
20
+ setFieldValue: f,
21
+ values: c
22
+ } = b(), F = L(), a = `${d ?? r}.value`, g = u || w(c, `${r}.options`, []).map(({
22
23
  key: e
23
- }) => e), F = (e, t) => t.toLowerCase().includes(e.toLowerCase());
24
+ }) => e), h = (e, t) => t.toLowerCase().includes(e.toLowerCase());
24
25
  return /* @__PURE__ */ o("div", {
25
- "data-testid": `${r}-field`,
26
- children: /* @__PURE__ */ o(w, {
27
- name: n,
26
+ "data-testid": `${l}-field`,
27
+ children: /* @__PURE__ */ o(x, {
28
+ name: a,
28
29
  children: ({
29
30
  field: e
30
31
  }) => {
31
32
  var t;
32
- return /* @__PURE__ */ o(g, {
33
- children: /* @__PURE__ */ o(x, {
34
- ...L,
35
- ref: p,
36
- as: "input",
37
- className: s,
38
- disabled: m,
39
- filterFn: F,
40
- label: a ? ({
41
- ...l
42
- }) => $({
43
- as: "label",
44
- tooltipText: a,
45
- children: r,
46
- ...l
47
- }) : r,
48
- multiselect: !0,
49
- name: e.name,
50
- onValueChange: (l) => c(n, l),
51
- options: v,
52
- placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? h.formatMessage(T.multiselectPlaceholder) : "",
53
- portalElement: d,
54
- value: e.value
55
- })
33
+ return /* @__PURE__ */ o(C, {
34
+ ...I,
35
+ ref: p,
36
+ as: "input",
37
+ className: i,
38
+ disabled: n,
39
+ filterFn: h,
40
+ label: V(l, s),
41
+ multiselect: !0,
42
+ name: e.name,
43
+ onValueChange: (v) => f(a, v),
44
+ options: g,
45
+ placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? F.formatMessage($.multiselectPlaceholder) : "",
46
+ portalElement: m,
47
+ value: e.value
56
48
  });
57
49
  }
58
50
  })
59
51
  });
60
52
  });
61
53
  export {
62
- q as MetadataMultiSelectField,
63
- q as default
54
+ y as MetadataMultiSelectField,
55
+ y as default
64
56
  };
@@ -1,48 +1,42 @@
1
- import { TextInput as p } from "@box/blueprint-web";
1
+ import { TextInput as n } from "@box/blueprint-web";
2
2
  import { Field as c } from "formik";
3
3
  import { useIntl as u } from "react-intl";
4
- import { forwardRef as h } from "react";
5
- import x from "../../../../messages.js";
6
- import g from "../../../interactive-text/interactive-text.js";
7
- import { fieldDefaultProps as v } from "../constants.js";
8
- import { jsx as r } from "react/jsx-runtime";
9
- const F = /* @__PURE__ */ h(({
4
+ import { forwardRef as g } from "react";
5
+ import h from "../../../../messages.js";
6
+ import { fieldDefaultProps as F } from "../constants.js";
7
+ import { getFieldLabel as x } from "../../utils.js";
8
+ import { jsx as e } from "react/jsx-runtime";
9
+ const M = /* @__PURE__ */ g(({
10
10
  description: t,
11
- label: e,
11
+ label: r,
12
12
  fieldNamePrefix: o,
13
13
  disableForm: a,
14
- className: i
15
- }, l) => {
16
- const m = u(), d = `${o}.value`;
17
- return /* @__PURE__ */ r("div", {
18
- "data-testid": `${e}-field`,
19
- children: /* @__PURE__ */ r(c, {
20
- name: d,
14
+ className: i,
15
+ updateModePrefix: l
16
+ }, d) => {
17
+ const m = u(), f = `${l ?? o}.value`;
18
+ return /* @__PURE__ */ e("div", {
19
+ "data-testid": `${r}-field`,
20
+ children: /* @__PURE__ */ e(c, {
21
+ name: f,
21
22
  children: ({
22
- field: f,
23
- meta: s
24
- }) => /* @__PURE__ */ r(p, {
25
- ...v,
26
- ...f,
27
- ref: l,
23
+ field: s,
24
+ meta: p
25
+ }) => /* @__PURE__ */ e(n, {
26
+ ...F,
27
+ ...s,
28
+ ref: d,
28
29
  className: i,
29
30
  disabled: a,
30
- error: s.error,
31
- label: t ? ({
32
- ...n
33
- }) => g({
34
- as: "label",
35
- tooltipText: t,
36
- children: e,
37
- ...n
38
- }) : e,
39
- placeholder: m.formatMessage(x.setValuePlaceholder)
31
+ error: p.error,
32
+ label: x(r, t),
33
+ placeholder: m.formatMessage(h.setValuePlaceholder)
40
34
  })
41
35
  })
42
36
  });
43
37
  });
44
- F.displayName = "MetadataStringField";
38
+ M.displayName = "MetadataStringField";
45
39
  export {
46
- F as MetadataStringField,
47
- F as default
40
+ M as MetadataStringField,
41
+ M as default
48
42
  };
@@ -0,0 +1,54 @@
1
+ import { forwardRef as k } from "react";
2
+ import { useFormikContext as C, getIn as I, Field as M } from "formik";
3
+ import { useIntl as R } from "react-intl";
4
+ import { ComboboxWithApiPagination as V } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
5
+ import $ from "../../../../messages.js";
6
+ import { getFieldLabel as j } from "../../utils.js";
7
+ import { jsx as o } from "react/jsx-runtime";
8
+ const q = /* @__PURE__ */ k(({
9
+ description: m,
10
+ disableForm: n,
11
+ fieldNamePrefix: r,
12
+ label: a,
13
+ portalElement: s,
14
+ taxonomyOptionsFetcher: d,
15
+ updateModePrefix: c
16
+ }, u) => {
17
+ const f = R(), i = `${c ?? r}.value`, {
18
+ setFieldValue: p,
19
+ values: l
20
+ } = C(), {
21
+ metadata: {
22
+ templateKey: h,
23
+ scope: F
24
+ }
25
+ } = l, g = I(l, r), {
26
+ key: x,
27
+ optionsRules: {
28
+ multiSelect: v,
29
+ selectableLevels: e
30
+ }
31
+ } = g, y = (t) => d(F, h, x, e == null ? void 0 : e[0], t);
32
+ return /* @__PURE__ */ o("div", {
33
+ "data-testid": `${a}-field`,
34
+ children: /* @__PURE__ */ o(M, {
35
+ name: i,
36
+ children: ({
37
+ field: t
38
+ }) => /* @__PURE__ */ o(V, {
39
+ ref: u,
40
+ defaultFetcher: y,
41
+ disabled: n,
42
+ label: j(a, m),
43
+ multiselect: v,
44
+ onValueChange: (b) => p(i, b),
45
+ placeholder: f.formatMessage($.taxonomyPlaceholder),
46
+ portalElement: s,
47
+ value: t.value
48
+ })
49
+ })
50
+ });
51
+ });
52
+ export {
53
+ q as MetadataTaxonomyField
54
+ };
@@ -1,30 +1,31 @@
1
1
  import "../../../../../../styles/update-mode-field-wrapper.css";
2
- import { IconButton as F, Radio as l } from "@box/blueprint-web";
3
- import { Settings as I, XMark as R } from "@box/blueprint-web-assets/icons/Fill";
4
- import w from "clsx";
5
- import { useFormikContext as A, getIn as C, Field as E } from "formik";
6
- import _, { useState as S } from "react";
7
- import { useIntl as B } from "react-intl";
8
- import { U as d } from "../../../../../../chunks/types.js";
9
- import { messages as n } from "./messages.js";
2
+ import { IconButton as I, Radio as d } from "@box/blueprint-web";
3
+ import { Settings as R, XMark as w } from "@box/blueprint-web-assets/icons/Fill";
4
+ import A from "clsx";
5
+ import { useFormikContext as E, getIn as C, Field as S } from "formik";
6
+ import _, { useState as B } from "react";
7
+ import { useIntl as U } from "react-intl";
8
+ import { U as i } from "../../../../../../chunks/types.js";
9
+ import { messages as l } from "./messages.js";
10
10
  import { jsxs as s, jsx as o } from "react/jsx-runtime";
11
- const N = "_wrapperContianer_1n09p_1", U = "_fieldContainer_1n09p_6", $ = "_field_1n09p_6", k = "_collapseButton_1n09p_13", x = "_radioContainer_1n09p_19", G = "_additionalFieldContainer_1n09p_22", V = "_hidden_1n09p_26", t = {
12
- wrapperContianer: N,
13
- fieldContainer: U,
14
- field: $,
15
- collapseButton: k,
16
- radioContainer: x,
17
- additionalFieldContainer: G,
18
- hidden: V
19
- }, j = (e) => e === d.ReplaceEntered, y = (e) => e === "string" || e === "multiSelect", L = ({
11
+ const $ = "_wrapperContianer_1n09p_1", N = "_fieldContainer_1n09p_6", k = "_field_1n09p_6", x = "_collapseButton_1n09p_13", G = "_radioContainer_1n09p_19", V = "_additionalFieldContainer_1n09p_22", j = "_hidden_1n09p_26", t = {
12
+ wrapperContianer: $,
13
+ fieldContainer: N,
14
+ field: k,
15
+ collapseButton: x,
16
+ radioContainer: G,
17
+ additionalFieldContainer: V,
18
+ hidden: j
19
+ }, y = (e) => e === i.ReplaceEntered, L = (e, a) => e === "string" || e === "multiSelect" || a, O = ({
20
20
  children: e,
21
- fieldNamePrefix: i,
22
- fieldType: f
21
+ fieldNamePrefix: a,
22
+ fieldType: f,
23
+ isTaxonomyMultiSelect: g
23
24
  }) => {
24
25
  const {
25
- setFieldValue: g,
26
+ setFieldValue: M,
26
27
  values: m
27
- } = A(), [p, M] = S(!0), a = B(), u = `${i}.updateMode.mode`, h = C(m, u), r = e && _.Children.only(e), v = C(m, `${i}.options`, []).map(({
28
+ } = E(), [p, h] = B(!0), n = U(), u = `${a}.updateMode.mode`, v = C(m, u), r = e && _.Children.only(e), b = C(m, `${a}.options`, []).map(({
28
29
  key: c
29
30
  }) => c);
30
31
  return /* @__PURE__ */ s("div", {
@@ -34,58 +35,58 @@ const N = "_wrapperContianer_1n09p_1", U = "_fieldContainer_1n09p_6", $ = "_fiel
34
35
  children: [/* @__PURE__ */ o("span", {
35
36
  className: t.field,
36
37
  children: e
37
- }), /* @__PURE__ */ o(F, {
38
- "aria-label": a.formatMessage(n.toggleUpdateModeSelectiorAriaLabel),
38
+ }), /* @__PURE__ */ o(I, {
39
+ "aria-label": n.formatMessage(l.toggleUpdateModeSelectiorAriaLabel),
39
40
  className: t.collapseButton,
40
41
  "data-testid": `${r.props.label}-update-mode-toggle`,
41
- icon: p ? I : R,
42
+ icon: p ? R : w,
42
43
  onClick: () => {
43
- M(!p);
44
+ h(!p);
44
45
  },
45
46
  size: "small",
46
47
  "data-target-id": "IconButton-toggleUpdateModeSelectiorAriaLabel"
47
48
  })]
48
49
  }), /* @__PURE__ */ s("div", {
49
- className: w(t.radioContainer, {
50
+ className: A(t.radioContainer, {
50
51
  [t.hidden]: p
51
52
  }),
52
- children: [/* @__PURE__ */ o(E, {
53
- name: `${i}.updateMode.mode`,
53
+ children: [/* @__PURE__ */ o(S, {
54
+ name: `${a}.updateMode.mode`,
54
55
  children: ({
55
56
  field: c
56
- }) => /* @__PURE__ */ s(l.Group, {
57
+ }) => /* @__PURE__ */ s(d.Group, {
57
58
  "data-testid": `${r.props.label}-radio-group`,
58
59
  loop: !0,
59
- onValueChange: (b) => g(u, b),
60
+ onValueChange: (F) => M(u, F),
60
61
  orientation: "vertical",
61
62
  value: c.value,
62
- children: [y(f) && /* @__PURE__ */ o(l.Item, {
63
- label: a.formatMessage(n.append),
64
- value: d.Append
65
- }), /* @__PURE__ */ o(l.Item, {
66
- label: a.formatMessage(n.clearAndReplace),
67
- value: d.ClearAndReplace
68
- }), /* @__PURE__ */ o(l.Item, {
69
- label: a.formatMessage(n.removeEntered),
70
- value: d.RemoveEntered
71
- }), /* @__PURE__ */ o(l.Item, {
72
- label: a.formatMessage(n.replaceEntered),
73
- value: d.ReplaceEntered
63
+ children: [L(f, g) && /* @__PURE__ */ o(d.Item, {
64
+ label: n.formatMessage(l.append),
65
+ value: i.Append
66
+ }), /* @__PURE__ */ o(d.Item, {
67
+ label: n.formatMessage(l.clearAndReplace),
68
+ value: i.ClearAndReplace
69
+ }), /* @__PURE__ */ o(d.Item, {
70
+ label: n.formatMessage(l.removeEntered),
71
+ value: i.RemoveEntered
72
+ }), /* @__PURE__ */ o(d.Item, {
73
+ label: n.formatMessage(l.replaceEntered),
74
+ value: i.ReplaceEntered
74
75
  })]
75
76
  })
76
- }), j(h) && r && /* @__PURE__ */ o("div", {
77
+ }), y(v) && r && /* @__PURE__ */ o("div", {
77
78
  className: t.additionalFieldContainer,
78
79
  children: /* @__PURE__ */ _.cloneElement(r, {
79
80
  // This field edits ${fieldNamePrefix}.updateMode.value, the '.value' is added by the field component
80
- fieldNamePrefix: `${i}.updateMode`,
81
- options: v,
82
- label: a.formatMessage(n.with)
81
+ updateModePrefix: `${a}.updateMode`,
82
+ options: b,
83
+ label: n.formatMessage(l.with)
83
84
  })
84
85
  })]
85
86
  })]
86
87
  });
87
88
  };
88
- L.displayName = "UpdateModeFieldWrapper";
89
+ O.displayName = "UpdateModeFieldWrapper";
89
90
  export {
90
- L as UpdateModeFieldWrapper
91
+ O as UpdateModeFieldWrapper
91
92
  };
@@ -1,32 +1,36 @@
1
- import { forwardRef as r } from "react";
2
- import { MetadataDateField as o } from "./components/metadata-date-field/metadata-date-field.js";
3
- import { MetadataEnumField as i } from "./components/metadata-enum-field/metadata-enum-field.js";
4
- import { MetadataFloatField as m } from "./components/metadata-float-field/metadata-float-field.js";
5
- import { MetadataMultiSelectField as f } from "./components/metadata-multi-select-field/metadata-multi-select-field.js";
6
- import { MetadataStringField as d } from "./components/metadata-string-field/metadata-string-field.js";
7
- import { jsx as a } from "react/jsx-runtime";
8
- const c = {
9
- date: /* @__PURE__ */ r((t, e) => /* @__PURE__ */ a(o, {
1
+ import { forwardRef as o } from "react";
2
+ import { MetadataDateField as a } from "./components/metadata-date-field/metadata-date-field.js";
3
+ import { MetadataEnumField as m } from "./components/metadata-enum-field/metadata-enum-field.js";
4
+ import { MetadataFloatField as i } from "./components/metadata-float-field/metadata-float-field.js";
5
+ import { MetadataMultiSelectField as d } from "./components/metadata-multi-select-field/metadata-multi-select-field.js";
6
+ import { MetadataStringField as f } from "./components/metadata-string-field/metadata-string-field.js";
7
+ import { MetadataTaxonomyField as l } from "./components/metadata-taxonomy-field/metadata-taxonomy-field.js";
8
+ import { jsx as r } from "react/jsx-runtime";
9
+ const y = {
10
+ date: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(a, {
10
11
  ...t,
11
12
  ref: e
12
13
  })),
13
- enum: /* @__PURE__ */ r((t, e) => /* @__PURE__ */ a(i, {
14
+ enum: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(m, {
14
15
  ...t,
15
16
  ref: e
16
17
  })),
17
- float: /* @__PURE__ */ r((t, e) => /* @__PURE__ */ a(m, {
18
+ float: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(i, {
18
19
  ...t,
19
20
  ref: e
20
21
  })),
21
- multiSelect: /* @__PURE__ */ r((t, e) => /* @__PURE__ */ a(f, {
22
+ multiSelect: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(d, {
22
23
  ...t,
23
24
  ref: e
24
25
  })),
25
- string: /* @__PURE__ */ r((t, e) => /* @__PURE__ */ a(d, {
26
+ string: /* @__PURE__ */ o((t, e) => /* @__PURE__ */ r(f, {
26
27
  ...t,
27
28
  ref: e
28
- }))
29
+ })),
30
+ taxonomy: (t) => /* @__PURE__ */ r(l, {
31
+ ...t
32
+ })
29
33
  };
30
34
  export {
31
- c as editorFieldTypes
35
+ y as editorFieldTypes
32
36
  };
@@ -0,0 +1,13 @@
1
+ import o from "../interactive-text/interactive-text.js";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ const n = (t, e) => e ? ({
4
+ ...r
5
+ }) => /* @__PURE__ */ i(o, {
6
+ ...r,
7
+ as: "label",
8
+ tooltipText: e,
9
+ children: t
10
+ }) : t;
11
+ export {
12
+ n as getFieldLabel
13
+ };