@box/metadata-editor 0.97.2 → 0.97.3

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.
@@ -1,69 +1,69 @@
1
1
  import { ComboboxWithApiTreeView as K } from "@box/combobox-with-api";
2
2
  import { useFormikContext as W, getIn as $, Field as j } from "formik";
3
- import { forwardRef as D } from "react";
4
- import { useIntl as R } from "react-intl";
5
- import q from "../../../../messages.js";
6
- import { ComboboxWithApiPagination as z } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
7
- import { g as x } from "../../../../../../chunks/utils2.js";
3
+ import { forwardRef as D, useCallback as R } from "react";
4
+ import { useIntl as q } from "react-intl";
5
+ import z from "../../../../messages.js";
6
+ import { ComboboxWithApiPagination as A } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
7
+ import { g as b } from "../../../../../../chunks/utils2.js";
8
8
  import { jsx as e } from "react/jsx-runtime";
9
- const U = /* @__PURE__ */ D(({
9
+ const X = /* @__PURE__ */ D(({
10
10
  description: i,
11
11
  disableForm: l,
12
12
  isAiSuggestionApplied: u,
13
13
  fieldNamePrefix: p,
14
14
  label: r,
15
15
  portalElement: s,
16
- taxonomyOptionsFetcher: y,
17
- updateModePrefix: F,
18
- className: c,
19
- isMultilevelTaxonomyFieldEnabled: C
20
- }, d) => {
21
- const b = R(), n = `${F ?? p}.value`, {
22
- setFieldValue: h,
23
- values: f
16
+ taxonomyOptionsFetcher: c,
17
+ updateModePrefix: k,
18
+ className: d,
19
+ isMultilevelTaxonomyFieldEnabled: M
20
+ }, h) => {
21
+ const P = q(), a = `${k ?? p}.value`, {
22
+ setFieldValue: f,
23
+ values: g
24
24
  } = W(), {
25
25
  metadata: {
26
- templateKey: k,
27
- scope: M
26
+ templateKey: v,
27
+ scope: x
28
28
  }
29
- } = f, P = $(f, p), {
30
- key: T,
29
+ } = g, T = $(g, p), {
30
+ key: C,
31
31
  optionsRules: {
32
- multiSelect: a,
32
+ multiSelect: n,
33
33
  selectableLevels: t
34
34
  },
35
35
  levels: w
36
- } = P, I = C && (t == null ? void 0 : t.some((o) => o > 1)), g = (o) => y(M, k, T, t == null ? void 0 : t[0], o), v = (o) => a || !(o != null && o.length) ? b.formatMessage(q.taxonomyPlaceholder) : void 0;
36
+ } = T, I = M && (t == null ? void 0 : t.some((o) => o > 1)), y = R((o) => c(x, v, C, t == null ? void 0 : t[0], o), [C, x, t, c, v]), F = (o) => n || !(o != null && o.length) ? P.formatMessage(z.taxonomyPlaceholder) : void 0;
37
37
  return /* @__PURE__ */ e("div", {
38
38
  "data-testid": `${r}-field`,
39
39
  onKeyDown: (o) => o.stopPropagation(),
40
40
  role: "presentation",
41
41
  children: /* @__PURE__ */ e(j, {
42
- name: n,
42
+ name: a,
43
43
  children: ({
44
44
  field: o
45
45
  }) => I ? /* @__PURE__ */ e(K, {
46
- ref: d,
47
- className: c,
48
- defaultFetcher: g,
46
+ ref: h,
47
+ className: d,
48
+ defaultFetcher: y,
49
49
  disabled: l,
50
- label: x(r, i, u),
50
+ label: b(r, i, u),
51
51
  levels: w,
52
- multiselect: a,
53
- onValueChange: (m) => h(n, m),
54
- placeholder: v(o.value),
52
+ multiselect: n,
53
+ onValueChange: (m) => f(a, m),
54
+ placeholder: F(o.value),
55
55
  portalElement: s,
56
56
  selectableLevels: t,
57
57
  value: o.value
58
- }) : /* @__PURE__ */ e(z, {
59
- ref: d,
60
- className: c,
61
- defaultFetcher: g,
58
+ }) : /* @__PURE__ */ e(A, {
59
+ ref: h,
60
+ className: d,
61
+ defaultFetcher: y,
62
62
  disabled: l,
63
- label: x(r, i, u),
64
- multiselect: a,
65
- onValueChange: (m) => h(n, m),
66
- placeholder: v(o.value),
63
+ label: b(r, i, u),
64
+ multiselect: n,
65
+ onValueChange: (m) => f(a, m),
66
+ placeholder: F(o.value),
67
67
  portalElement: s,
68
68
  value: o.value
69
69
  })
@@ -71,5 +71,5 @@ const U = /* @__PURE__ */ D(({
71
71
  });
72
72
  });
73
73
  export {
74
- U as MetadataTaxonomyField
74
+ X as MetadataTaxonomyField
75
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.97.2",
3
+ "version": "0.97.3",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
6
  "@box/blueprint-web": "^7.30.3",