@box/metadata-editor 0.98.8 → 0.98.9

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.
package/dist/esm/index.js CHANGED
@@ -1,50 +1,50 @@
1
- import { AddMetadataTemplateDropdown as e } from "./lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js";
2
- import { ComboboxWithApiPagination as r } from "./lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js";
3
- import { FilterDropdownMenu as n } from "./lib/components/filter-dropdown-menu/index.js";
4
- import { FilterInstancesDropdown as f } from "./lib/components/filter-instances-dropdown/filter-instances-dropdown.js";
5
- import { MULTI_VALUE_DEFAULT_OPTION as x, MULTI_VALUE_DEFAULT_TAXONOMY_OPTION as i, MULTI_VALUE_DEFAULT_VALUE as l } from "./lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js";
6
- import { MetadataEmptyState as s } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
7
- import { CustomInstanceNewField as I } from "./lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js";
8
- import { DeleteConfirmationModal as u } from "./lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js";
9
- import { MetadataInstanceFormAutofillButton as _ } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
10
- import { MetadataInstanceFormHeader as L } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
11
- import { MetadataInstanceForm as c } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js";
12
- import { J as D } from "../chunks/utils.js";
13
- import { MetadataInstanceList as N } from "./lib/components/metadata-instance-list/metadata-instance-list.js";
14
- import { MetadataInstanceHeader as w } from "./lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js";
15
- import { MetadataInstance as h } from "./lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js";
16
- import { UnsavedChangesModal as b } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
17
- import { defaultInitialValues as v, defaultMetadataValueMap as H } from "./lib/defaults.js";
18
- import { MetadataEditor as W } from "./lib/metadata-editor.js";
19
- import { U as B } from "../chunks/types.js";
20
- import { withApiWrapper as Y } from "./lib/utils/api-wrapper.js";
21
- import { AutofillContext as k, AutofillContextProvider as q, TIMEOUT_10_SECONDS as z, useAutofill as G } from "./lib/utils/autofill-context.js";
1
+ import { FilterDropdownMenu as e } from "./lib/components/filter-dropdown-menu/index.js";
2
+ import { MULTI_VALUE_DEFAULT_OPTION as r, MULTI_VALUE_DEFAULT_TAXONOMY_OPTION as p, MULTI_VALUE_DEFAULT_VALUE as n } from "./lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js";
3
+ import { MetadataEmptyState as f } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
4
+ import { defaultInitialValues as x, defaultMetadataValueMap as i } from "./lib/defaults.js";
5
+ import { MetadataEditor as M } from "./lib/metadata-editor.js";
6
+ import { U as A } from "../chunks/types.js";
7
+ import { withApiWrapper as U } from "./lib/utils/api-wrapper.js";
8
+ import { AutofillContext as T, AutofillContextProvider as _, TIMEOUT_10_SECONDS as E, useAutofill as L } from "./lib/utils/autofill-context.js";
9
+ import { AddMetadataTemplateDropdown as c } from "./lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js";
10
+ import { ComboboxWithApiPagination as D } from "./lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js";
11
+ import { FilterInstancesDropdown as N } from "./lib/components/filter-instances-dropdown/filter-instances-dropdown.js";
12
+ import { CustomInstanceNewField as w } from "./lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js";
13
+ import { DeleteConfirmationModal as h } from "./lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js";
14
+ import { MetadataInstanceFormAutofillButton as b } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
15
+ import { MetadataInstanceFormHeader as v } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
16
+ import { MetadataInstanceForm as J } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js";
17
+ import { J as y } from "../chunks/utils.js";
18
+ import { MetadataInstanceList as X } from "./lib/components/metadata-instance-list/metadata-instance-list.js";
19
+ import { MetadataInstanceHeader as j } from "./lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js";
20
+ import { MetadataInstance as q } from "./lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js";
21
+ import { UnsavedChangesModal as G } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
22
22
  export {
23
- e as AddMetadataTemplateDropdown,
24
- k as AutofillContext,
25
- q as AutofillContextProvider,
26
- r as ComboboxWithApiPagination,
27
- I as CustomInstanceNewField,
28
- u as DeleteConfirmationModal,
29
- n as FilterDropdownMenu,
30
- f as FilterInstancesDropdown,
31
- D as JSONPatchOp,
32
- x as MULTI_VALUE_DEFAULT_OPTION,
33
- i as MULTI_VALUE_DEFAULT_TAXONOMY_OPTION,
34
- l as MULTI_VALUE_DEFAULT_VALUE,
35
- W as MetadataEditor,
36
- s as MetadataEmptyState,
37
- h as MetadataInstance,
38
- c as MetadataInstanceForm,
39
- _ as MetadataInstanceFormAutofillButton,
40
- L as MetadataInstanceFormHeader,
41
- w as MetadataInstanceHeader,
42
- N as MetadataInstanceList,
43
- z as TIMEOUT_10_SECONDS,
44
- b as UnsavedChangesModal,
45
- B as UpdateMode,
46
- v as defaultInitialValues,
47
- H as defaultMetadataValueMap,
48
- G as useAutofill,
49
- Y as withApiWrapper
23
+ c as AddMetadataTemplateDropdown,
24
+ T as AutofillContext,
25
+ _ as AutofillContextProvider,
26
+ D as ComboboxWithApiPagination,
27
+ w as CustomInstanceNewField,
28
+ h as DeleteConfirmationModal,
29
+ e as FilterDropdownMenu,
30
+ N as FilterInstancesDropdown,
31
+ y as JSONPatchOp,
32
+ r as MULTI_VALUE_DEFAULT_OPTION,
33
+ p as MULTI_VALUE_DEFAULT_TAXONOMY_OPTION,
34
+ n as MULTI_VALUE_DEFAULT_VALUE,
35
+ M as MetadataEditor,
36
+ f as MetadataEmptyState,
37
+ q as MetadataInstance,
38
+ J as MetadataInstanceForm,
39
+ b as MetadataInstanceFormAutofillButton,
40
+ v as MetadataInstanceFormHeader,
41
+ j as MetadataInstanceHeader,
42
+ X as MetadataInstanceList,
43
+ E as TIMEOUT_10_SECONDS,
44
+ G as UnsavedChangesModal,
45
+ A as UpdateMode,
46
+ x as defaultInitialValues,
47
+ i as defaultMetadataValueMap,
48
+ L as useAutofill,
49
+ U as withApiWrapper
50
50
  };
@@ -3,9 +3,9 @@ import { useFormikContext as W, getIn as $, Field as j } from "formik";
3
3
  import { forwardRef as D, useCallback as R } from "react";
4
4
  import { useIntl as q } from "react-intl";
5
5
  import z from "../../../../messages.js";
6
- import { ComboboxWithApiPagination as A } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
7
6
  import { g as b } from "../../../../../../chunks/utils2.js";
8
7
  import { jsx as e } from "react/jsx-runtime";
8
+ import { ComboboxWithApiPagination as A } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
9
9
  const X = /* @__PURE__ */ D(({
10
10
  description: i,
11
11
  disableForm: l,
@@ -2,11 +2,11 @@ import w from "clsx";
2
2
  import { useFormikContext as C } from "formik";
3
3
  import T from "lodash/isUndefined";
4
4
  import { forwardRef as U, useState as $, useCallback as j, useEffect as x, useMemo as D } from "react";
5
- import { AiSuggestionField as L } from "./components/ai-suggestion-field/ai-suggestion-field.js";
6
- import { UpdateModeFieldWrapper as R } from "./components/update-mode-field-wrapper/update-mode-field-wrapper.js";
7
- import { editorFieldTypes as b } from "./editor-field-types.js";
5
+ import { UpdateModeFieldWrapper as L } from "./components/update-mode-field-wrapper/update-mode-field-wrapper.js";
6
+ import { editorFieldTypes as R } from "./editor-field-types.js";
8
7
  import { s as p } from "../../../../chunks/utils2.js";
9
- import { jsx as r, jsxs as B } from "react/jsx-runtime";
8
+ import { jsx as r, jsxs as b } from "react/jsx-runtime";
9
+ import { AiSuggestionField as B } from "./components/ai-suggestion-field/ai-suggestion-field.js";
10
10
  var t = /* @__PURE__ */ function(o) {
11
11
  return o.Pending = "PENDING", o.Applied = "APPLIED", o.Initial = "INITIAL", o;
12
12
  }(t || {});
@@ -21,7 +21,7 @@ const Z = /* @__PURE__ */ U(({
21
21
  var v;
22
22
  const {
23
23
  setFieldValue: l
24
- } = C(), [d, u] = $(t.Initial), n = d === t.Pending, N = d === t.Applied, P = d === t.Initial, g = b[e.type], {
24
+ } = C(), [d, u] = $(t.Initial), n = d === t.Pending, N = d === t.Applied, P = d === t.Initial, g = R[e.type], {
25
25
  aiSuggestion: i,
26
26
  type: h,
27
27
  value: c
@@ -40,7 +40,7 @@ const Z = /* @__PURE__ */ U(({
40
40
  P && i && u(t.Pending);
41
41
  }, [P, i]);
42
42
  const k = D(() => i && c === i, [n]);
43
- return M ? E ? /* @__PURE__ */ r(R, {
43
+ return M ? E ? /* @__PURE__ */ r(L, {
44
44
  fieldNamePrefix: s,
45
45
  fieldType: e.type,
46
46
  isTaxonomyMultiSelect: V,
@@ -57,7 +57,7 @@ const Z = /* @__PURE__ */ U(({
57
57
  portalElement: S,
58
58
  taxonomyOptionsFetcher: f
59
59
  })
60
- }, e.key) : /* @__PURE__ */ B("div", {
60
+ }, e.key) : /* @__PURE__ */ b("div", {
61
61
  className: p.fieldWrapper,
62
62
  children: [/* @__PURE__ */ r(g, {
63
63
  ref: I,
@@ -71,7 +71,7 @@ const Z = /* @__PURE__ */ U(({
71
71
  onValueEdited: m,
72
72
  portalElement: S,
73
73
  taxonomyOptionsFetcher: f
74
- }), n && /* @__PURE__ */ r(L, {
74
+ }), n && /* @__PURE__ */ r(B, {
75
75
  aiSuggestion: i,
76
76
  isSameValue: k,
77
77
  onAiSuggestionAppend: () => {
@@ -1,18 +1,21 @@
1
- import $ from "clsx";
2
- import { Formik as J, Form as q } from "formik";
3
- import { useState as M, useEffect as E, useRef as z, useMemo as G } from "react";
4
- import { TEMPLATE_CUSTOM_PROPERTIES as H } from "../../../../constants.js";
5
- import { useAutofill as Q } from "../../../../utils/autofill-context.js";
6
- import { TemplateInstance as X } from "../../../metadata-editor-fields/metadata-editor-fields.js";
7
- import { MetadataEmptyState as Y } from "../../../metadata-empty-state/metadata-empty-state.js";
8
- import { UnsavedChangesModal as Z } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
1
+ import "../custom-instance-new-field/custom-instance-new-field.js";
2
+ import { DeleteConfirmationModal as $ } from "../delete-confirmation-modal/delete-confirmation-modal.js";
3
+ import "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
4
+ import "../metadata-instance-form-header/metadata-instance-form-header.js";
5
+ import J from "clsx";
6
+ import { Formik as q, Form as z } from "formik";
7
+ import { useState as M, useEffect as E, useRef as G, useMemo as H } from "react";
8
+ import { TEMPLATE_CUSTOM_PROPERTIES as Q } from "../../../../constants.js";
9
+ import { useAutofill as X } from "../../../../utils/autofill-context.js";
10
+ import { TemplateInstance as Y } from "../../../metadata-editor-fields/metadata-editor-fields.js";
11
+ import { MetadataEmptyState as Z } from "../../../metadata-empty-state/metadata-empty-state.js";
9
12
  import { AutofillOverlay as I } from "../autofill-overlay/autofill-overlay.js";
10
13
  import { CustomInstance as T } from "../custom-instance/custom-instance.js";
11
- import { DeleteConfirmationModal as oo } from "../delete-confirmation-modal/delete-confirmation-modal.js";
12
- import { c as ro } from "../../../../../../chunks/utils.js";
13
- import { s as m, M as to } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
14
+ import { c as oo } from "../../../../../../chunks/utils.js";
15
+ import { s as m, M as ro } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
14
16
  import { jsx as t, jsxs as c } from "react/jsx-runtime";
15
- const Mo = (y) => {
17
+ import { UnsavedChangesModal as to } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
18
+ const yo = (y) => {
16
19
  const {
17
20
  areAiSuggestionsAvailable: S,
18
21
  customRef: a,
@@ -31,18 +34,18 @@ const Mo = (y) => {
31
34
  onSubmit: P,
32
35
  setIsUnsavedChangesModalOpen: f,
33
36
  taxonomyOptionsFetcher: u
34
- } = y, R = A ?? to, [U, d] = M(!1), {
37
+ } = y, R = A ?? ro, [U, d] = M(!1), {
35
38
  isFetchingSuggestions: i,
36
39
  isLongLoading: g,
37
40
  getAiSuggestions: B,
38
41
  clearState: p,
39
42
  suggestions: w
40
- } = Q();
43
+ } = X();
41
44
  E(() => () => {
42
45
  p();
43
46
  }, [p, o == null ? void 0 : o.id]);
44
- const h = (o == null ? void 0 : o.templateKey) === H, K = async (r) => {
45
- await P(r, ro(r, o));
47
+ const h = (o == null ? void 0 : o.templateKey) === Q, K = async (r) => {
48
+ await P(r, oo(r, o));
46
49
  }, W = (r) => {
47
50
  r ? f(!0) : x();
48
51
  }, j = () => {
@@ -51,29 +54,29 @@ const Mo = (y) => {
51
54
  metadata: {
52
55
  ...o
53
56
  }
54
- }, C = z(null), [F, V] = M(null);
57
+ }, C = G(null), [F, V] = M(null);
55
58
  E(() => {
56
59
  V(a ?? C.current);
57
60
  }, [a, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
58
- const _ = G(() => {
61
+ const _ = H(() => {
59
62
  const r = (o == null ? void 0 : o.fields.length) === 0;
60
63
  if (h)
61
64
  return /* @__PURE__ */ t(T, {
62
65
  isLoading: i
63
66
  });
64
67
  if (r)
65
- return /* @__PURE__ */ t(Y, {
68
+ return /* @__PURE__ */ t(Z, {
66
69
  isBoxAiSuggestionsFeatureEnabled: s,
67
70
  level: "instance"
68
71
  });
69
72
  const e = !!(i || n);
70
73
  return /* @__PURE__ */ c("div", {
71
- className: $(m.metadataInstanceFormContent, e && m.showOverlay),
74
+ className: J(m.metadataInstanceFormContent, e && m.showOverlay),
72
75
  children: [/* @__PURE__ */ t(I, {
73
76
  errorCode: n,
74
77
  isFetchingSuggestions: i,
75
78
  isLongLoading: g
76
- }), /* @__PURE__ */ t(X, {
79
+ }), /* @__PURE__ */ t(Y, {
77
80
  disableForm: i,
78
81
  isMultilevelTaxonomyFieldEnabled: l,
79
82
  portalElement: a ?? F,
@@ -81,13 +84,13 @@ const Mo = (y) => {
81
84
  })]
82
85
  });
83
86
  }, [o == null ? void 0 : o.fields.length, h, i, g, a, F, u, s, l, n]);
84
- return /* @__PURE__ */ t(J, {
87
+ return /* @__PURE__ */ t(q, {
85
88
  initialValues: k,
86
89
  onSubmit: K,
87
90
  children: ({
88
91
  values: r,
89
92
  dirty: e
90
- }) => /* @__PURE__ */ c(q, {
93
+ }) => /* @__PURE__ */ c(z, {
91
94
  children: [/* @__PURE__ */ t(R, {
92
95
  areAiSuggestionsAvailable: S,
93
96
  className: m.metadataInstanceForm,
@@ -105,11 +108,11 @@ const Mo = (y) => {
105
108
  selectedTemplateInstance: o,
106
109
  suggestions: w,
107
110
  children: o && _
108
- }), /* @__PURE__ */ t(Z, {
111
+ }), /* @__PURE__ */ t(to, {
109
112
  onBackToEdit: () => f(!1),
110
113
  onDiscardChanges: N,
111
114
  open: v
112
- }), /* @__PURE__ */ t(oo, {
115
+ }), /* @__PURE__ */ t($, {
113
116
  onConfirm: () => L(o),
114
117
  onDismiss: () => d(!1),
115
118
  open: U,
@@ -119,5 +122,5 @@ const Mo = (y) => {
119
122
  }, `${o == null ? void 0 : o.scope}.${o == null ? void 0 : o.templateKey}`);
120
123
  };
121
124
  export {
122
- Mo as MetadataInstanceForm
125
+ yo as MetadataInstanceForm
123
126
  };
@@ -1,26 +1,27 @@
1
- import { MetadataInstance as d } from "./subcomponents/metadata-instance/metadata-instance.js";
2
- import { getVisibleTemplates as o } from "../../utils/utils.js";
1
+ import { MetadataInstance as r } from "./subcomponents/metadata-instance/metadata-instance.js";
2
+ import { getVisibleTemplates as c } from "../../utils/utils.js";
3
3
  import { jsx as a } from "react/jsx-runtime";
4
- import '../../../../styles/metadata-instance-list.css';const r = "_metadataInstanceList_bd83w_1", p = {
5
- metadataInstanceList: r
6
- }, f = ({
4
+ import "./subcomponents/metadata-instance-header/metadata-instance-header.js";
5
+ import '../../../../styles/metadata-instance-list.css';const d = "_metadataInstanceList_bd83w_1", p = {
6
+ metadataInstanceList: d
7
+ }, _ = ({
7
8
  areAiSuggestionsAvailable: s,
8
9
  isAiSuggestionsFeatureEnabled: e,
9
10
  isBetaLanguageEnabled: n,
10
11
  onEdit: i,
11
12
  templateInstances: m,
12
- taxonomyNodeFetcher: c
13
+ taxonomyNodeFetcher: o
13
14
  }) => /* @__PURE__ */ a("div", {
14
15
  className: p.metadataInstanceList,
15
- children: o(m).map((t) => /* @__PURE__ */ a(d, {
16
+ children: c(m).map((t) => /* @__PURE__ */ a(r, {
16
17
  areAiSuggestionsAvailable: s,
17
18
  isAiSuggestionsFeatureEnabled: e,
18
19
  isBetaLanguageEnabled: n,
19
20
  onEdit: i,
20
- taxonomyNodeFetcher: c,
21
+ taxonomyNodeFetcher: o,
21
22
  templateInstance: t
22
23
  }, t.id))
23
24
  });
24
25
  export {
25
- f as MetadataInstanceList
26
+ _ as MetadataInstanceList
26
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.98.8",
3
+ "version": "0.98.9",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
6
  "@box/blueprint-web": "^7.30.3",
@@ -15,7 +15,7 @@
15
15
  "devDependencies": {
16
16
  "@ariakit/react": "0.4.15",
17
17
  "@box/babel-plugin-target-attributes": "1.3.0",
18
- "@box/blueprint-web": "^10.4.0",
18
+ "@box/blueprint-web": "^10.5.0",
19
19
  "@box/blueprint-web-assets": "^4.39.0",
20
20
  "@box/storybook-utils": "^0.9.0",
21
21
  "@testing-library/react": "^15.0.6",