@box/metadata-editor 0.123.18 → 0.123.19

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