@box/metadata-editor 1.8.0 → 1.8.2

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