@box/metadata-editor 0.119.0 → 0.119.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.
@@ -10,20 +10,20 @@ import { TEMPLATE_CUSTOM_PROPERTIES as I } from "../../../../constants.js";
10
10
  import { useAutofill as T } from "../../../../utils/autofill-context.js";
11
11
  import { TemplateInstance as oo } from "../../../metadata-editor-fields/metadata-editor-fields.js";
12
12
  import { MetadataEmptyState as ro } from "../../../metadata-empty-state/metadata-empty-state.js";
13
- import { AutofillOverlay as to } from "../autofill-overlay/autofill-overlay.js";
14
- import { CustomInstance as io } from "../custom-instance/custom-instance.js";
13
+ import { AutofillOverlay as io } from "../autofill-overlay/autofill-overlay.js";
14
+ import { CustomInstance as to } from "../custom-instance/custom-instance.js";
15
15
  import { e as ao, c as no } from "../../../../../../chunks/utils.js";
16
- import { s as d, M as eo } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
17
- import { jsx as i, jsxs as D } from "react/jsx-runtime";
18
- import { UnsavedChangesModal as so } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
16
+ import { s as u, M as so } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
17
+ import { jsx as t, jsxs as D } from "react/jsx-runtime";
18
+ import { UnsavedChangesModal as eo } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
19
19
  const mo = ({
20
- dirty: s,
20
+ dirty: e,
21
21
  onChange: m,
22
22
  values: r
23
23
  }) => {
24
24
  const n = O(r);
25
- return s && !Y(n.current.metadata.fields, r.metadata.fields) && (n.current = r, m(r)), null;
26
- }, vo = (s) => {
25
+ return e && !Y(n.current.metadata.fields, r.metadata.fields) && (n.current = r, m(r)), null;
26
+ }, vo = (e) => {
27
27
  const {
28
28
  areAiSuggestionsAvailable: m,
29
29
  customRef: r,
@@ -34,7 +34,7 @@ const mo = ({
34
34
  isBetaLanguageEnabled: A,
35
35
  isDeleteButtonDisabled: v,
36
36
  isDeleteConfirmationModalCheckboxEnabled: L,
37
- isMultilevelTaxonomyFieldEnabled: u,
37
+ isMultilevelTaxonomyFieldEnabled: d,
38
38
  isUnsavedChangesModalOpen: R = !1,
39
39
  MetadataInstanceFormCustomWrapper: k,
40
40
  selectedTemplateInstance: o,
@@ -45,69 +45,69 @@ const mo = ({
45
45
  onSubmit: B,
46
46
  setIsUnsavedChangesModalOpen: p,
47
47
  taxonomyOptionsFetcher: h
48
- } = s, V = k ?? eo, [W, c] = S(!1), {
48
+ } = e, V = k ?? so, [W, C] = S(!1), {
49
49
  isFetchingSuggestions: a,
50
- isLongLoading: C,
50
+ isLongLoading: E,
51
51
  getAiSuggestions: w,
52
- clearState: E,
52
+ clearState: c,
53
53
  suggestions: K
54
54
  } = T();
55
55
  y(() => () => {
56
- E();
57
- }, [E, o == null ? void 0 : o.id]);
58
- const F = (o == null ? void 0 : o.templateKey) === I, j = async (t) => {
59
- await B(t, no(t, o));
60
- }, _ = (t) => {
61
- t ? p(!0) : N();
56
+ c();
57
+ }, [c, o == null ? void 0 : o.id]);
58
+ const F = (o == null ? void 0 : o.templateKey) === I, j = async (i) => {
59
+ await B(i, no(i, o));
60
+ }, _ = (i) => {
61
+ i ? p(!0) : N();
62
62
  }, $ = () => {
63
- c(!0);
63
+ C(!0);
64
64
  }, q = {
65
65
  metadata: {
66
66
  ...o,
67
- fields: ao(o.fields)
67
+ fields: ao((o == null ? void 0 : o.fields) ?? [])
68
68
  }
69
69
  }, M = O(null), [b, J] = S(null);
70
70
  y(() => {
71
71
  J(r ?? M.current);
72
72
  }, [r, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
73
73
  const z = Z(() => {
74
- const t = (o == null ? void 0 : o.fields.length) === 0;
74
+ const i = (o == null ? void 0 : o.fields.length) === 0;
75
75
  if (F)
76
- return /* @__PURE__ */ i(io, {
76
+ return /* @__PURE__ */ t(to, {
77
77
  isLoading: a
78
78
  });
79
- if (t)
80
- return /* @__PURE__ */ i(ro, {
79
+ if (i)
80
+ return /* @__PURE__ */ t(ro, {
81
81
  isBoxAiSuggestionsFeatureEnabled: f,
82
82
  level: "instance"
83
83
  });
84
- const e = !!(a || l);
84
+ const s = !!(a || l);
85
85
  return /* @__PURE__ */ D("div", {
86
- className: H(d.metadataInstanceFormContent, e && d.showOverlay),
87
- children: [/* @__PURE__ */ i(to, {
86
+ className: H(u.metadataInstanceFormContent, s && u.showOverlay),
87
+ children: [/* @__PURE__ */ t(io, {
88
88
  errorCode: l,
89
89
  isFetchingSuggestions: a,
90
- isLongLoading: C
91
- }), /* @__PURE__ */ i(oo, {
90
+ isLongLoading: E
91
+ }), /* @__PURE__ */ t(oo, {
92
92
  disableForm: a,
93
- isMultilevelTaxonomyFieldEnabled: u,
93
+ isMultilevelTaxonomyFieldEnabled: d,
94
94
  portalElement: r ?? b,
95
95
  taxonomyOptionsFetcher: h
96
96
  })]
97
97
  });
98
- }, [o == null ? void 0 : o.fields.length, F, a, C, r, b, h, f, u, l]);
99
- return /* @__PURE__ */ i(Q, {
98
+ }, [o == null ? void 0 : o.fields.length, F, a, E, r, b, h, f, d, l]);
99
+ return /* @__PURE__ */ t(Q, {
100
100
  initialValues: q,
101
101
  onSubmit: j,
102
102
  children: ({
103
- values: t,
104
- dirty: e
103
+ values: i,
104
+ dirty: s
105
105
  }) => /* @__PURE__ */ D(X, {
106
- children: [/* @__PURE__ */ i(V, {
106
+ children: [/* @__PURE__ */ t(V, {
107
107
  areAiSuggestionsAvailable: m,
108
- className: d.metadataInstanceForm,
108
+ className: u.metadataInstanceForm,
109
109
  formRef: M,
110
- formValues: t,
110
+ formValues: i,
111
111
  getAiSuggestions: w,
112
112
  handleCancel: _,
113
113
  handleDelete: $,
@@ -116,23 +116,23 @@ const mo = ({
116
116
  isBetaLanguageEnabled: A,
117
117
  isDeleteButtonDisabled: v,
118
118
  isFetchingSuggestions: a,
119
- isFormDirty: e,
119
+ isFormDirty: s,
120
120
  isLargeFile: n,
121
121
  selectedTemplateInstance: o,
122
122
  suggestions: K,
123
123
  children: o && z
124
- }), g && /* @__PURE__ */ i(mo, {
125
- dirty: e,
124
+ }), g && /* @__PURE__ */ t(mo, {
125
+ dirty: s,
126
126
  onChange: g,
127
- values: t
128
- }), /* @__PURE__ */ i(so, {
127
+ values: i
128
+ }), /* @__PURE__ */ t(eo, {
129
129
  onBackToEdit: () => p(!1),
130
130
  onDiscardChanges: U,
131
131
  open: R
132
- }), /* @__PURE__ */ i(G, {
132
+ }), /* @__PURE__ */ t(G, {
133
133
  isCheckboxEnabled: L,
134
134
  onConfirm: () => P(o),
135
- onDismiss: () => c(!1),
135
+ onDismiss: () => C(!1),
136
136
  open: W,
137
137
  templateName: o == null ? void 0 : o.displayName
138
138
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.119.0",
3
+ "version": "0.119.1",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
6
  "@box/box-ai-agent-selector": "^0.41.7",
@@ -15,11 +15,11 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@ariakit/react": "0.4.15",
18
- "@box/box-ai-agent-selector": "^0.46.0",
18
+ "@box/box-ai-agent-selector": "^0.46.1",
19
19
  "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^12.24.0",
21
- "@box/blueprint-web-assets": "^4.56.6",
22
- "@box/storybook-utils": "^0.13.10",
20
+ "@box/blueprint-web": "^12.25.0",
21
+ "@box/blueprint-web-assets": "^4.57.0",
22
+ "@box/storybook-utils": "^0.13.11",
23
23
  "@testing-library/react": "^15.0.6",
24
24
  "react": "^18.3.0",
25
25
  "react-dom": "^18.3.0",