@box/metadata-editor 0.91.2 → 0.92.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.
Files changed (52) hide show
  1. package/chunks/metadata-instance-form-card-wrapper.js +34 -32
  2. package/esm/index.js +18 -17
  3. package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +43 -23
  4. package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +12 -0
  5. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +76 -72
  6. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +3 -11
  7. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +33 -42
  8. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +22 -0
  9. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +46 -0
  10. package/esm/lib/utils/autofill-context.js +19 -18
  11. package/i18n/bn-IN.js +10 -3
  12. package/i18n/da-DK.js +10 -3
  13. package/i18n/de-DE.js +10 -3
  14. package/i18n/en-AU.js +10 -3
  15. package/i18n/en-CA.js +10 -3
  16. package/i18n/en-GB.js +10 -3
  17. package/i18n/en-US.js +7 -2
  18. package/i18n/en-US.properties +14 -4
  19. package/i18n/en-x-pseudo.js +10 -3
  20. package/i18n/es-419.js +10 -3
  21. package/i18n/es-ES.js +10 -3
  22. package/i18n/fi-FI.js +10 -3
  23. package/i18n/fr-CA.js +10 -3
  24. package/i18n/fr-FR.js +10 -3
  25. package/i18n/hi-IN.js +10 -3
  26. package/i18n/it-IT.js +10 -3
  27. package/i18n/ja-JP.js +10 -3
  28. package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.json +1 -1
  29. package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.json +1 -1
  30. package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.json +1 -0
  31. package/i18n/ko-KR.js +10 -3
  32. package/i18n/nb-NO.js +10 -3
  33. package/i18n/nl-NL.js +10 -3
  34. package/i18n/pl-PL.js +10 -3
  35. package/i18n/pt-BR.js +10 -3
  36. package/i18n/ru-RU.js +10 -3
  37. package/i18n/sv-SE.js +10 -3
  38. package/i18n/tr-TR.js +10 -3
  39. package/i18n/zh-CN.js +10 -3
  40. package/i18n/zh-TW.js +10 -3
  41. package/package.json +3 -3
  42. package/styles/autofill-overlay.css +1 -1
  43. package/styles/metadata-instance-form-inline-notice.css +1 -0
  44. package/types/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.d.ts +3 -1
  45. package/types/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.d.ts +15 -0
  46. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +3 -2
  47. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.d.ts +0 -10
  48. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.d.ts +1 -1
  49. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/types.d.ts +1 -0
  50. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.d.ts +23 -0
  51. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.d.ts +5 -0
  52. package/types/lib/utils/autofill-context.d.ts +1 -0
@@ -1,56 +1,58 @@
1
- import C from "clsx";
2
- import { Card as S } from "@box/blueprint-web";
3
- import { TEMPLATE_CUSTOM_PROPERTIES as A } from "../esm/lib/constants.js";
4
- import { MetadataInstanceFormFooter as E } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js";
5
- import { MetadataInstanceFormHeader as M } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
6
- import { jsx as e, jsxs as b } from "react/jsx-runtime";
7
- import '../styles/metadata-instance-form-card-wrapper.css';const y = "_metadataInstanceForm_6uz9p_1", D = "_wrapperGradient_6uz9p_7", I = "_suggestionsFetching_6uz9p_12", N = "_metadataInstanceFormContent_6uz9p_18", s = {
8
- metadataInstanceForm: y,
9
- wrapperGradient: D,
10
- suggestionsFetching: I,
1
+ import S from "clsx";
2
+ import { Card as A } from "@box/blueprint-web";
3
+ import { TEMPLATE_CUSTOM_PROPERTIES as E } from "../esm/lib/constants.js";
4
+ import { MetadataInstanceFormFooter as M } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js";
5
+ import { MetadataInstanceFormHeader as b } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
6
+ import { jsx as e, jsxs as y } from "react/jsx-runtime";
7
+ import '../styles/metadata-instance-form-card-wrapper.css';const D = "_metadataInstanceForm_6uz9p_1", I = "_wrapperGradient_6uz9p_7", L = "_suggestionsFetching_6uz9p_12", N = "_metadataInstanceFormContent_6uz9p_18", s = {
8
+ metadataInstanceForm: D,
9
+ wrapperGradient: I,
10
+ suggestionsFetching: L,
11
11
  metadataInstanceFormContent: N
12
- }, R = (n) => {
12
+ }, j = (n) => {
13
13
  const {
14
14
  areAiSuggestionsAvailable: o,
15
15
  children: r,
16
16
  className: i,
17
- formRef: m,
18
- isAiSuggestionsFeatureEnabled: g,
17
+ formRef: g,
18
+ isAiSuggestionsFeatureEnabled: m,
19
19
  isBetaLanguageEnabled: d,
20
- isDeleteButtonDisabled: c,
21
- suggestions: u,
20
+ isLargeFile: c,
21
+ isDeleteButtonDisabled: u,
22
+ suggestions: p,
22
23
  isFetchingSuggestions: a,
23
- isFormDirty: p = !1,
24
+ isFormDirty: l = !1,
24
25
  selectedTemplateInstance: t,
25
- getAiSuggestions: l,
26
- handleCancel: F,
27
- handleDelete: _
28
- } = n, f = (t == null ? void 0 : t.templateKey) === A, h = !!u[t == null ? void 0 : t.templateKey];
26
+ getAiSuggestions: F,
27
+ handleCancel: _,
28
+ handleDelete: f
29
+ } = n, h = (t == null ? void 0 : t.templateKey) === E, C = !!p[t == null ? void 0 : t.templateKey];
29
30
  return /* @__PURE__ */ e("div", {
30
31
  className: a && s.wrapperGradient,
31
- children: /* @__PURE__ */ b(S, {
32
- ref: m,
33
- className: C(i, {
32
+ children: /* @__PURE__ */ y(A, {
33
+ ref: g,
34
+ className: S(i, {
34
35
  [s.suggestionsFetching]: a
35
36
  }),
36
- children: [/* @__PURE__ */ e(M, {
37
+ children: [/* @__PURE__ */ e(b, {
37
38
  areAiSuggestionsAvailable: o,
38
- hasSuggestions: h,
39
- isAiSuggestionsFeatureEnabled: g && !f,
39
+ hasSuggestions: C,
40
+ isAiSuggestionsFeatureEnabled: m && !h,
40
41
  isBetaLanguageEnabled: d,
42
+ isLargeFile: c,
41
43
  isLoading: a,
42
- onAutofill: l,
44
+ onAutofill: F,
43
45
  templateName: t == null ? void 0 : t.displayName
44
- }), t && r, /* @__PURE__ */ e(E, {
45
- isDeleteButtonDisabled: c,
46
+ }), t && r, /* @__PURE__ */ e(M, {
47
+ isDeleteButtonDisabled: u,
46
48
  isLoading: a,
47
- onCancel: () => F(p),
48
- onDelete: _
49
+ onCancel: () => _(l),
50
+ onDelete: f
49
51
  })]
50
52
  })
51
53
  });
52
54
  };
53
55
  export {
54
- R as M,
56
+ j as M,
55
57
  s
56
58
  };
package/esm/index.js CHANGED
@@ -6,18 +6,18 @@ import { MULTI_VALUE_DEFAULT_OPTION as x, MULTI_VALUE_DEFAULT_TAXONOMY_OPTION as
6
6
  import { MetadataEmptyState as s } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
7
7
  import { CustomInstanceNewField as I } from "./lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js";
8
8
  import { DeleteConfirmationModal as u } from "./lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js";
9
- import { MetadataInstanceFormAutofillButton as T } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
10
- import { MetadataInstanceFormHeader as E } 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";
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 F } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js";
12
12
  import { J as D } from "../chunks/utils.js";
13
- import { MetadataInstanceList as V } from "./lib/components/metadata-instance-list/metadata-instance-list.js";
14
- import { MetadataInstanceHeader as N } from "./lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.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
15
  import { UnsavedChangesModal as h } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
16
- import { defaultInitialValues as g, defaultMetadataValueMap as v } from "./lib/defaults.js";
17
- import { MetadataEditor as J } from "./lib/metadata-editor.js";
16
+ import { defaultInitialValues as b, defaultMetadataValueMap as g } from "./lib/defaults.js";
17
+ import { MetadataEditor as H } from "./lib/metadata-editor.js";
18
18
  import { U as W } from "../chunks/types.js";
19
19
  import { withApiWrapper as B } from "./lib/utils/api-wrapper.js";
20
- import { AutofillContext as Y, AutofillContextProvider as j, useAutofill as k } from "./lib/utils/autofill-context.js";
20
+ import { AutofillContext as Y, AutofillContextProvider as j, TIMEOUT_10_SECONDS as k, useAutofill as q } from "./lib/utils/autofill-context.js";
21
21
  export {
22
22
  e as AddMetadataTemplateDropdown,
23
23
  Y as AutofillContext,
@@ -31,17 +31,18 @@ export {
31
31
  x as MULTI_VALUE_DEFAULT_OPTION,
32
32
  i as MULTI_VALUE_DEFAULT_TAXONOMY_OPTION,
33
33
  l as MULTI_VALUE_DEFAULT_VALUE,
34
- J as MetadataEditor,
34
+ H as MetadataEditor,
35
35
  s as MetadataEmptyState,
36
- c as MetadataInstanceForm,
37
- T as MetadataInstanceFormAutofillButton,
38
- E as MetadataInstanceFormHeader,
39
- N as MetadataInstanceHeader,
40
- V as MetadataInstanceList,
36
+ F as MetadataInstanceForm,
37
+ _ as MetadataInstanceFormAutofillButton,
38
+ L as MetadataInstanceFormHeader,
39
+ w as MetadataInstanceHeader,
40
+ N as MetadataInstanceList,
41
+ k as TIMEOUT_10_SECONDS,
41
42
  h as UnsavedChangesModal,
42
43
  W as UpdateMode,
43
- g as defaultInitialValues,
44
- v as defaultMetadataValueMap,
45
- k as useAutofill,
44
+ b as defaultInitialValues,
45
+ g as defaultMetadataValueMap,
46
+ q as useAutofill,
46
47
  B as withApiWrapper
47
48
  };
@@ -1,36 +1,56 @@
1
- import { LoadingIndicator as c, Text as o } from "@box/blueprint-web";
2
- import { u as m } from "../../../../../../chunks/index.js";
3
- import a from "./messages.js";
4
- import { jsxs as d, jsx as l } from "react/jsx-runtime";
5
- import '../../../../../../styles/autofill-overlay.css';const f = "_autofillOverlay_m4rm9_1", g = "_loadingIcon_m4rm9_14", u = "_testContainerStyle_m4rm9_21", r = {
6
- autofillOverlay: f,
7
- loadingIcon: g,
8
- testContainerStyle: u
9
- }, I = ({
10
- isFetchingSuggestions: i,
11
- isLongLoading: e
1
+ import { useState as d } from "react";
2
+ import { LoadingIndicator as v, Text as n, TextButton as g } from "@box/blueprint-web";
3
+ import { u as p } from "../../../../../../chunks/index.js";
4
+ import { AlertTriangle as y } from "@box/blueprint-web-assets/icons/Line";
5
+ import { SurfaceStatusSurfaceError as _, Size5 as m } from "@box/blueprint-web-assets/tokens/tokens";
6
+ import e from "./messages.js";
7
+ import { jsxs as O, jsx as i } from "react/jsx-runtime";
8
+ import '../../../../../../styles/autofill-overlay.css';const T = "_autofillOverlay_vvkb0_1", b = "_autofillOverlayTitle_vvkb0_15", S = "_dismissButton_vvkb0_20", h = "_loadingIcon_vvkb0_24", B = "_testContainerStyle_vvkb0_29", s = {
9
+ autofillOverlay: T,
10
+ autofillOverlayTitle: b,
11
+ dismissButton: S,
12
+ loadingIcon: h,
13
+ testContainerStyle: B
14
+ }, A = ({
15
+ errorCode: a,
16
+ isFetchingSuggestions: c,
17
+ isLongLoading: o
12
18
  }) => {
13
- const t = m(), n = e ? t.formatMessage(a.longLoadingTitle) : t.formatMessage(a.defaultLoadingMessage), s = e && t.formatMessage(a.longLoadingDescription);
14
- return i ? /* @__PURE__ */ d("div", {
15
- className: r.autofillOverlay,
16
- children: [/* @__PURE__ */ l(c, {
17
- "aria-label": t.formatMessage(a.loadingAriaLabel),
19
+ const t = p(), [f, u] = d(!1);
20
+ let l = t.formatMessage(e.defaultLoadingMessage);
21
+ a && (l = t.formatMessage(e.errorTitle)), o && (l = t.formatMessage(e.longLoadingTitle));
22
+ const r = o ? t.formatMessage(e.longLoadingDescription) : a && t.formatMessage(e.errorDescription);
23
+ return !c && !a || f ? null : /* @__PURE__ */ O("div", {
24
+ className: s.autofillOverlay,
25
+ children: [a ? /* @__PURE__ */ i(y, {
26
+ color: _,
27
+ height: m,
28
+ role: "presentation",
29
+ width: m
30
+ }) : /* @__PURE__ */ i(v, {
31
+ "aria-label": t.formatMessage(e.loadingAriaLabel),
18
32
  "aria-live": "polite",
19
- className: r.loadingIcon,
33
+ className: s.loadingIcon,
20
34
  size: "large",
21
35
  variant: "default"
22
- }), /* @__PURE__ */ l(o, {
36
+ }), /* @__PURE__ */ i(n, {
23
37
  as: "p",
38
+ className: s.autofillOverlayTitle,
24
39
  variant: "subtitle",
25
- children: n
26
- }), e && /* @__PURE__ */ l(o, {
40
+ children: l
41
+ }), r && /* @__PURE__ */ i(n, {
27
42
  as: "p",
28
43
  color: "textOnLightSecondary",
29
44
  variant: "bodyDefault",
30
- children: s
45
+ children: r
46
+ }), a && /* @__PURE__ */ i(g, {
47
+ className: s.dismissButton,
48
+ onClick: () => u(!0),
49
+ "data-target-id": "TextButton-dismissButton",
50
+ children: t.formatMessage(e.dismissButton)
31
51
  })]
32
- }) : null;
52
+ });
33
53
  };
34
54
  export {
35
- I as AutofillOverlay
55
+ A as AutofillOverlay
36
56
  };
@@ -4,6 +4,18 @@ const e = a({
4
4
  id: "metadataEditor.metadataInstanceEditor.autofillOverlay.defaultLoadingMessage",
5
5
  defaultMessage: "Extracting Metadata"
6
6
  },
7
+ dismissButton: {
8
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.dismissButton",
9
+ defaultMessage: "Dismiss"
10
+ },
11
+ errorTitle: {
12
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorTitle",
13
+ defaultMessage: "Metadata extraction could not complete"
14
+ },
15
+ errorDescription: {
16
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorDescription",
17
+ defaultMessage: "Please try again in a few minutes"
18
+ },
7
19
  loadingAriaLabel: {
8
20
  id: "metadataEditor.metadataInstanceEditor.autofillOverlay.loadingAriaLabel",
9
21
  defaultMessage: "Loading"
@@ -1,111 +1,115 @@
1
- import { Formik as V, Form as _ } from "formik";
2
- import { useState as p, useEffect as h, useRef as $, useMemo as w } from "react";
3
- import { TEMPLATE_CUSTOM_PROPERTIES as J } from "../../../../constants.js";
4
- import { AutofillOverlay as q } from "../autofill-overlay/autofill-overlay.js";
5
- import { useAutofill as z } from "../../../../utils/autofill-context.js";
6
- import { TemplateInstance as G } from "../../../metadata-editor-fields/metadata-editor-fields.js";
7
- import { MetadataEmptyState as H } from "../../../metadata-empty-state/metadata-empty-state.js";
8
- import { UnsavedChangesModal as Q } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
9
- import { CustomInstance as X } from "../custom-instance/custom-instance.js";
10
- import { DeleteConfirmationModal as Y } from "../delete-confirmation-modal/delete-confirmation-modal.js";
11
- import { c as Z } from "../../../../../../chunks/utils.js";
12
- import { s as C, M as I } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
13
- import { jsx as a, jsxs as c } from "react/jsx-runtime";
14
- const go = (M) => {
1
+ import { Formik as $, Form as w } from "formik";
2
+ import { useState as p, useEffect as C, useRef as J, useMemo as q } from "react";
3
+ import { TEMPLATE_CUSTOM_PROPERTIES as z } from "../../../../constants.js";
4
+ import { AutofillOverlay as G } from "../autofill-overlay/autofill-overlay.js";
5
+ import { useAutofill as H } from "../../../../utils/autofill-context.js";
6
+ import { TemplateInstance as Q } from "../../../metadata-editor-fields/metadata-editor-fields.js";
7
+ import { MetadataEmptyState as X } from "../../../metadata-empty-state/metadata-empty-state.js";
8
+ import { UnsavedChangesModal as Y } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
9
+ import { CustomInstance as Z } from "../custom-instance/custom-instance.js";
10
+ import { DeleteConfirmationModal as I } from "../delete-confirmation-modal/delete-confirmation-modal.js";
11
+ import { c as T } from "../../../../../../chunks/utils.js";
12
+ import { s as h, M as oo } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
13
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
14
+ const Co = (F) => {
15
15
  const {
16
- areAiSuggestionsAvailable: E,
16
+ areAiSuggestionsAvailable: M,
17
17
  customRef: i,
18
+ isLargeFile: E,
19
+ errorCode: S,
18
20
  isAiSuggestionsFeatureEnabled: n,
19
- isBetaLanguageEnabled: F,
20
- isDeleteButtonDisabled: S,
21
- isUnsavedChangesModalOpen: y = !1,
22
- MetadataInstanceFormCustomWrapper: D,
21
+ isBetaLanguageEnabled: y,
22
+ isDeleteButtonDisabled: D,
23
+ isUnsavedChangesModalOpen: b = !1,
24
+ MetadataInstanceFormCustomWrapper: O,
23
25
  selectedTemplateInstance: o,
24
- onCancel: b,
25
- onDelete: O,
26
- onDiscardUnsavedChanges: A,
27
- onSubmit: v,
26
+ onCancel: A,
27
+ onDelete: v,
28
+ onDiscardUnsavedChanges: L,
29
+ onSubmit: x,
28
30
  setIsUnsavedChangesModalOpen: s,
29
31
  taxonomyOptionsFetcher: e
30
- } = M, x = D ?? I, [L, m] = p(!1), {
31
- isFetchingSuggestions: r,
32
+ } = F, N = O ?? oo, [P, m] = p(!1), {
33
+ isFetchingSuggestions: a,
32
34
  isLongLoading: l,
33
- getAiSuggestions: N,
35
+ getAiSuggestions: R,
34
36
  clearSuggestions: u,
35
- suggestions: P
36
- } = z();
37
- h(() => () => {
37
+ suggestions: U
38
+ } = H();
39
+ C(() => () => {
38
40
  u();
39
41
  }, [u]);
40
- const f = (o == null ? void 0 : o.templateKey) === J, R = async (t) => {
41
- await v(t, Z(t, o));
42
- }, U = (t) => {
43
- t ? s(!0) : b();
44
- }, B = () => {
42
+ const f = (o == null ? void 0 : o.templateKey) === z, B = async (t) => {
43
+ await x(t, T(t, o));
44
+ }, K = (t) => {
45
+ t ? s(!0) : A();
46
+ }, W = () => {
45
47
  m(!0);
46
- }, K = {
48
+ }, j = {
47
49
  metadata: {
48
50
  ...o
49
51
  }
50
- }, g = $(null), [d, W] = p(null);
51
- h(() => {
52
- W(i ?? g.current);
52
+ }, g = J(null), [d, k] = p(null);
53
+ C(() => {
54
+ k(i ?? g.current);
53
55
  }, [i, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
54
- const j = w(() => {
56
+ const V = q(() => {
55
57
  const t = (o == null ? void 0 : o.fields.length) === 0;
56
- return f ? /* @__PURE__ */ a(X, {
57
- isLoading: r
58
- }) : t ? /* @__PURE__ */ a(H, {
58
+ return f ? /* @__PURE__ */ r(Z, {
59
+ isLoading: a
60
+ }) : t ? /* @__PURE__ */ r(X, {
59
61
  isBoxAiSuggestionsFeatureEnabled: n,
60
62
  level: "instance"
61
63
  }) : /* @__PURE__ */ c("div", {
62
- className: C.metadataInstanceFormContent,
63
- children: [/* @__PURE__ */ a(q, {
64
- isFetchingSuggestions: r,
64
+ className: h.metadataInstanceFormContent,
65
+ children: [/* @__PURE__ */ r(G, {
66
+ errorCode: S,
67
+ isFetchingSuggestions: a,
65
68
  isLongLoading: l
66
- }), /* @__PURE__ */ a(G, {
67
- disableForm: r,
69
+ }), /* @__PURE__ */ r(Q, {
70
+ disableForm: a,
68
71
  portalElement: i ?? d,
69
72
  taxonomyOptionsFetcher: e
70
73
  })]
71
74
  });
72
- }, [o == null ? void 0 : o.fields.length, f, r, l, i, d, e, n]);
73
- return /* @__PURE__ */ a(V, {
74
- initialValues: K,
75
- onSubmit: R,
75
+ }, [o == null ? void 0 : o.fields.length, f, a, l, i, d, e, n]);
76
+ return /* @__PURE__ */ r($, {
77
+ initialValues: j,
78
+ onSubmit: B,
76
79
  children: ({
77
80
  values: t,
78
- dirty: k
79
- }) => /* @__PURE__ */ c(_, {
80
- children: [/* @__PURE__ */ a(x, {
81
- areAiSuggestionsAvailable: E,
82
- className: C.metadataInstanceForm,
81
+ dirty: _
82
+ }) => /* @__PURE__ */ c(w, {
83
+ children: [/* @__PURE__ */ r(N, {
84
+ areAiSuggestionsAvailable: M,
85
+ className: h.metadataInstanceForm,
83
86
  formRef: g,
84
87
  formValues: t,
85
- getAiSuggestions: N,
86
- handleCancel: U,
87
- handleDelete: B,
88
+ getAiSuggestions: R,
89
+ handleCancel: K,
90
+ handleDelete: W,
88
91
  isAiSuggestionsFeatureEnabled: n,
89
- isBetaLanguageEnabled: F,
90
- isDeleteButtonDisabled: S,
91
- isFetchingSuggestions: r,
92
- isFormDirty: k,
92
+ isBetaLanguageEnabled: y,
93
+ isDeleteButtonDisabled: D,
94
+ isFetchingSuggestions: a,
95
+ isFormDirty: _,
96
+ isLargeFile: E,
93
97
  selectedTemplateInstance: o,
94
- suggestions: P,
95
- children: o && j
96
- }), /* @__PURE__ */ a(Q, {
98
+ suggestions: U,
99
+ children: o && V
100
+ }), /* @__PURE__ */ r(Y, {
97
101
  onBackToEdit: () => s(!1),
98
- onDiscardChanges: A,
99
- open: y
100
- }), /* @__PURE__ */ a(Y, {
101
- onConfirm: () => O(o),
102
+ onDiscardChanges: L,
103
+ open: b
104
+ }), /* @__PURE__ */ r(I, {
105
+ onConfirm: () => v(o),
102
106
  onDismiss: () => m(!1),
103
- open: L,
107
+ open: P,
104
108
  templateName: o == null ? void 0 : o.displayName
105
109
  })]
106
110
  })
107
111
  }, `${o == null ? void 0 : o.scope}.${o == null ? void 0 : o.templateKey}`);
108
112
  };
109
113
  export {
110
- go as MetadataInstanceForm
114
+ Co as MetadataInstanceForm
111
115
  };
@@ -1,18 +1,10 @@
1
- import { d as e } from "../../../../../../chunks/index.js";
2
- const t = e({
1
+ import { d as a } from "../../../../../../chunks/index.js";
2
+ const e = a({
3
3
  customInstanceTitle: {
4
4
  id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.customInstanceTitle",
5
5
  defaultMessage: "Custom Metadata"
6
- },
7
- aiSuggestionNoticeHeader: {
8
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.aiSuggestionNoticeHeader",
9
- defaultMessage: "AI Autofill is in Beta"
10
- },
11
- aiSuggestionNoticeBody: {
12
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.aiSuggestionNoticeBody",
13
- defaultMessage: "Please check responses before saving."
14
6
  }
15
7
  });
16
8
  export {
17
- t as default
9
+ e as default
18
10
  };
@@ -1,50 +1,41 @@
1
- import { u as p } from "../../../../../../chunks/index.js";
2
- import { InlineNotice as g, Text as s } from "@box/blueprint-web";
3
- import h from "../../../interactive-header-text/interactive-header-text.js";
4
- import { MetadataInstanceFormAutofillButton as H } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
5
- import e from "./messages.js";
6
- import { jsxs as a, Fragment as x, jsx as o } from "react/jsx-runtime";
7
- import '../../../../../../styles/metadata-instance-form-header.css';const F = "_metadataInstanceFormHeader_13lxr_1", N = "_title_13lxr_9", i = {
8
- metadataInstanceFormHeader: F,
1
+ import { u as F } from "../../../../../../chunks/index.js";
2
+ import p from "../../../interactive-header-text/interactive-header-text.js";
3
+ import { MetadataInstanceFormAutofillButton as x } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
4
+ import H from "./messages.js";
5
+ import { MetadataInstanceFormInlineNotice as _ } from "../metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";
6
+ import { jsxs as r, Fragment as u, jsx as t } from "react/jsx-runtime";
7
+ import '../../../../../../styles/metadata-instance-form-header.css';const M = "_metadataInstanceFormHeader_13lxr_1", N = "_title_13lxr_9", o = {
8
+ metadataInstanceFormHeader: M,
9
9
  title: N
10
- }, j = ({
11
- areAiSuggestionsAvailable: r,
12
- hasSuggestions: m,
13
- isAiSuggestionsFeatureEnabled: c,
14
- isBetaLanguageEnabled: n,
15
- isLoading: l,
16
- templateName: d,
17
- onAutofill: f
10
+ }, k = ({
11
+ areAiSuggestionsAvailable: e,
12
+ hasSuggestions: n,
13
+ isAiSuggestionsFeatureEnabled: m,
14
+ isBetaLanguageEnabled: a,
15
+ isLargeFile: s,
16
+ isLoading: c,
17
+ templateName: i,
18
+ onAutofill: l
18
19
  }) => {
19
- const t = p(), I = d ?? t.formatMessage(e.customInstanceTitle), u = m && r && n;
20
- return /* @__PURE__ */ a(x, {
21
- children: [/* @__PURE__ */ a("div", {
22
- className: i.metadataInstanceFormHeader,
23
- children: [/* @__PURE__ */ o(h, {
24
- className: i.title,
20
+ const d = F(), I = i ?? d.formatMessage(H.customInstanceTitle), f = n && e;
21
+ return /* @__PURE__ */ r(u, {
22
+ children: [/* @__PURE__ */ r("div", {
23
+ className: o.metadataInstanceFormHeader,
24
+ children: [/* @__PURE__ */ t(p, {
25
+ className: o.title,
25
26
  title: I
26
- }), c ? /* @__PURE__ */ o(H, {
27
- areAiSuggestionsAvailable: r,
28
- isBetaLanguageEnabled: n,
29
- isLoading: l,
30
- onAutofill: f
27
+ }), m ? /* @__PURE__ */ t(x, {
28
+ areAiSuggestionsAvailable: e,
29
+ isBetaLanguageEnabled: a,
30
+ isLoading: c,
31
+ onAutofill: l
31
32
  }) : null]
32
- }), u ? /* @__PURE__ */ o("div", {
33
- children: /* @__PURE__ */ a(g, {
34
- variant: "info",
35
- variantIconAriaLabel: t.formatMessage(e.aiSuggestionNoticeHeader),
36
- children: [/* @__PURE__ */ o(s, {
37
- as: "p",
38
- variant: "bodyDefaultBold",
39
- children: t.formatMessage(e.aiSuggestionNoticeHeader)
40
- }), /* @__PURE__ */ a(s, {
41
- as: "p",
42
- children: [t.formatMessage(e.aiSuggestionNoticeBody), " "]
43
- })]
44
- })
45
- }) : null]
33
+ }), f && /* @__PURE__ */ t(_, {
34
+ isBetaLanguageEnabled: a,
35
+ isLargeFile: s
36
+ })]
46
37
  });
47
38
  };
48
39
  export {
49
- j as MetadataInstanceFormHeader
40
+ k as MetadataInstanceFormHeader
50
41
  };
@@ -0,0 +1,22 @@
1
+ import { d as e } from "../../../../../../chunks/index.js";
2
+ const t = e({
3
+ autofillInBetaNoticeHeader: {
4
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeHeader",
5
+ defaultMessage: "AI Autofill is in Beta"
6
+ },
7
+ autofillInBetaNoticeBody: {
8
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeBody",
9
+ defaultMessage: "Please check responses before saving."
10
+ },
11
+ largeFileNoticeHeader: {
12
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeHeader",
13
+ defaultMessage: "Text content is too large"
14
+ },
15
+ largeFileNoticeBody: {
16
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeBody",
17
+ defaultMessage: "Box AI won’t be able to access the full text, which may impact metadata values"
18
+ }
19
+ });
20
+ export {
21
+ t as default
22
+ };
@@ -0,0 +1,46 @@
1
+ import { u as c } from "../../../../../../chunks/index.js";
2
+ import { InlineNotice as l, Text as t } from "@box/blueprint-web";
3
+ import a from "./messages.js";
4
+ import { jsxs as i, Fragment as d, jsx as n } from "react/jsx-runtime";
5
+ import '../../../../../../styles/metadata-instance-form-inline-notice.css';const m = "_inlineNotice_j1wao_1", s = {
6
+ inlineNotice: m
7
+ }, p = ({
8
+ isLargeFile: o,
9
+ isBetaLanguageEnabled: r
10
+ }) => {
11
+ const e = c();
12
+ return !r && !o ? null : /* @__PURE__ */ i(d, {
13
+ children: [o && /* @__PURE__ */ n("div", {
14
+ className: s.inlineNotice,
15
+ children: /* @__PURE__ */ i(l, {
16
+ variant: "warning",
17
+ variantIconAriaLabel: e.formatMessage(a.largeFileNoticeHeader),
18
+ children: [/* @__PURE__ */ n(t, {
19
+ as: "p",
20
+ variant: "bodyDefaultBold",
21
+ children: e.formatMessage(a.largeFileNoticeHeader)
22
+ }), /* @__PURE__ */ i(t, {
23
+ as: "p",
24
+ children: [e.formatMessage(a.largeFileNoticeBody), " "]
25
+ })]
26
+ })
27
+ }), r && /* @__PURE__ */ n("div", {
28
+ className: s.inlineNotice,
29
+ children: /* @__PURE__ */ i(l, {
30
+ variant: "info",
31
+ variantIconAriaLabel: e.formatMessage(a.autofillInBetaNoticeHeader),
32
+ children: [/* @__PURE__ */ n(t, {
33
+ as: "p",
34
+ variant: "bodyDefaultBold",
35
+ children: e.formatMessage(a.autofillInBetaNoticeHeader)
36
+ }), /* @__PURE__ */ i(t, {
37
+ as: "p",
38
+ children: [e.formatMessage(a.autofillInBetaNoticeBody), " "]
39
+ })]
40
+ })
41
+ })]
42
+ });
43
+ };
44
+ export {
45
+ p as MetadataInstanceFormInlineNotice
46
+ };