@box/metadata-editor 0.87.0 → 0.88.0

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 (56) hide show
  1. package/chunks/metadata-instance-form-card-wrapper.js +55 -0
  2. package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-loading-state/autofill-loading-state.js +28 -0
  3. package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-loading-state/messages.js +14 -0
  4. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +8 -40
  5. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +77 -74
  6. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +6 -2
  7. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +34 -33
  8. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +32 -30
  9. package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +21 -20
  10. package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +4 -0
  11. package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +20 -19
  12. package/i18n/bn-IN.js +4 -0
  13. package/i18n/da-DK.js +4 -0
  14. package/i18n/de-DE.js +4 -0
  15. package/i18n/en-AU.js +4 -0
  16. package/i18n/en-CA.js +4 -0
  17. package/i18n/en-GB.js +4 -0
  18. package/i18n/en-US.js +4 -0
  19. package/i18n/en-US.properties +8 -0
  20. package/i18n/en-x-pseudo.js +4 -0
  21. package/i18n/es-419.js +4 -0
  22. package/i18n/es-ES.js +4 -0
  23. package/i18n/fi-FI.js +4 -0
  24. package/i18n/fr-CA.js +4 -0
  25. package/i18n/fr-FR.js +4 -0
  26. package/i18n/hi-IN.js +4 -0
  27. package/i18n/it-IT.js +4 -0
  28. package/i18n/ja-JP.js +4 -0
  29. package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/autofill-loading-state/messages.json +1 -0
  30. package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.json +1 -1
  31. package/i18n/json/src/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.json +1 -1
  32. package/i18n/ko-KR.js +4 -0
  33. package/i18n/nb-NO.js +4 -0
  34. package/i18n/nl-NL.js +4 -0
  35. package/i18n/pl-PL.js +4 -0
  36. package/i18n/pt-BR.js +4 -0
  37. package/i18n/ru-RU.js +4 -0
  38. package/i18n/sv-SE.js +4 -0
  39. package/i18n/tr-TR.js +4 -0
  40. package/i18n/zh-CN.js +4 -0
  41. package/i18n/zh-TW.js +4 -0
  42. package/package.json +2 -2
  43. package/styles/autofill-loading-state.css +1 -0
  44. package/styles/metadata-instance-form-card-wrapper.css +1 -0
  45. package/types/lib/components/metadata-instance-editor/subcomponents/autofill-loading-state/autofill-loading-state.d.ts +1 -0
  46. package/types/lib/components/metadata-instance-editor/subcomponents/autofill-loading-state/messages.d.ts +13 -0
  47. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +2 -0
  48. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.d.ts +5 -0
  49. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.d.ts +1 -1
  50. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/types.d.ts +1 -0
  51. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.d.ts +1 -1
  52. package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/types.d.ts +1 -0
  53. package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.d.ts +5 -0
  54. package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.d.ts +1 -1
  55. package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/types.d.ts +1 -0
  56. package/styles/metadata-instance-form.css +0 -1
@@ -0,0 +1,55 @@
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 C } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
6
+ import { jsx as t, jsxs as b } from "react/jsx-runtime";
7
+ import '../styles/metadata-instance-form-card-wrapper.css';const y = "_metadataInstanceForm_11dqs_1", D = "_wrapperGradient_11dqs_7", N = "_suggestionsFetching_11dqs_12", e = {
8
+ metadataInstanceForm: y,
9
+ wrapperGradient: D,
10
+ suggestionsFetching: N
11
+ }, R = (i) => {
12
+ const {
13
+ areAiSuggestionsAvailable: o,
14
+ children: r,
15
+ className: n,
16
+ formRef: g,
17
+ isAiSuggestionsFeatureEnabled: m,
18
+ iaBetaLanguageEnabled: d,
19
+ isDeleteButtonDisabled: c,
20
+ suggestions: l,
21
+ isFetchingSuggestions: s,
22
+ isFormDirty: u = !1,
23
+ selectedTemplateInstance: a,
24
+ getAiSuggestions: p,
25
+ handleCancel: F,
26
+ handleDelete: f
27
+ } = i, h = (a == null ? void 0 : a.templateKey) === E, _ = !!l[a == null ? void 0 : a.templateKey];
28
+ return /* @__PURE__ */ t("div", {
29
+ className: s && e.wrapperGradient,
30
+ children: /* @__PURE__ */ b(A, {
31
+ ref: g,
32
+ className: S(n, {
33
+ [e.suggestionsFetching]: s
34
+ }),
35
+ children: [/* @__PURE__ */ t(C, {
36
+ areAiSuggestionsAvailable: o,
37
+ hasSuggestions: _,
38
+ iaBetaLanguageEnabled: d,
39
+ isAiSuggestionsFeatureEnabled: m && !h,
40
+ isLoading: s,
41
+ onAutofill: p,
42
+ templateName: a == null ? void 0 : a.displayName
43
+ }), a && r, /* @__PURE__ */ t(M, {
44
+ isDeleteButtonDisabled: c,
45
+ isLoading: s,
46
+ onCancel: () => F(u),
47
+ onDelete: f
48
+ })]
49
+ })
50
+ });
51
+ };
52
+ export {
53
+ R as M,
54
+ e as s
55
+ };
@@ -0,0 +1,28 @@
1
+ import { LoadingIndicator as i, Text as l } from "@box/blueprint-web";
2
+ import { u as n } from "../../../../../../chunks/index.js";
3
+ import a from "./messages.js";
4
+ import { jsxs as s, jsx as o } from "react/jsx-runtime";
5
+ import '../../../../../../styles/autofill-loading-state.css';const r = "_autofillLoadingState_1dfyd_1", d = "_loadingIcon_1dfyd_9", g = "_testContainerStyle_1dfyd_15", e = {
6
+ autofillLoadingState: r,
7
+ loadingIcon: d,
8
+ testContainerStyle: g
9
+ }, S = () => {
10
+ const t = n();
11
+ return /* @__PURE__ */ s("div", {
12
+ className: e.autofillLoadingState,
13
+ children: [/* @__PURE__ */ o(i, {
14
+ "aria-label": t.formatMessage(a.loadingAriaLabel),
15
+ "aria-live": "polite",
16
+ className: e.loadingIcon,
17
+ size: "large",
18
+ variant: "default"
19
+ }), /* @__PURE__ */ o(l, {
20
+ as: "p",
21
+ variant: "titleSmall",
22
+ children: t.formatMessage(a.defaultLoadingMessage)
23
+ })]
24
+ });
25
+ };
26
+ export {
27
+ S as AutofillLoadingState
28
+ };
@@ -0,0 +1,14 @@
1
+ import { d as a } from "../../../../../../chunks/index.js";
2
+ const e = a({
3
+ defaultLoadingMessage: {
4
+ id: "metadataEditor.metadataInstanceEditor.autofillLoadingState.defaultLoadingMessage",
5
+ defaultMessage: "Extracting Metadata"
6
+ },
7
+ loadingAriaLabel: {
8
+ id: "metadataEditor.metadataInstanceEditor.autofillLoadingState.loadingAriaLabel",
9
+ defaultMessage: "Loading"
10
+ }
11
+ });
12
+ export {
13
+ e as default
14
+ };
@@ -1,42 +1,10 @@
1
- import { Card as A } from "@box/blueprint-web";
2
- import { TEMPLATE_CUSTOM_PROPERTIES as h } from "../../../../constants.js";
3
- import { MetadataInstanceFormFooter as C } from "../metadata-instance-form-footer/metadata-instance-form-footer.js";
4
- import { MetadataInstanceFormHeader as E } from "../metadata-instance-form-header/metadata-instance-form-header.js";
5
- import { jsxs as M, jsx as a } from "react/jsx-runtime";
6
- const L = (t) => {
7
- const {
8
- areAiSuggestionsAvailable: r,
9
- children: e,
10
- className: s,
11
- formRef: n,
12
- isAiSuggestionsFeatureEnabled: g,
13
- isDeleteButtonDisabled: m,
14
- suggestions: u,
15
- isFetchingSuggestions: i,
16
- isFormDirty: d = !1,
17
- selectedTemplateInstance: o,
18
- getAiSuggestions: l,
19
- handleCancel: f,
20
- handleDelete: F
21
- } = t, S = (o == null ? void 0 : o.templateKey) === h, p = !!u[o == null ? void 0 : o.templateKey];
22
- return /* @__PURE__ */ M(A, {
23
- ref: n,
24
- className: s,
25
- children: [/* @__PURE__ */ a(E, {
26
- areAiSuggestionsAvailable: r,
27
- hasSuggestions: p,
28
- isAiSuggestionsFeatureEnabled: g && !S,
29
- isLoading: i,
30
- onAutofill: l,
31
- templateName: o == null ? void 0 : o.displayName
32
- }), o && e, /* @__PURE__ */ a(C, {
33
- isDeleteButtonDisabled: m,
34
- isLoading: i,
35
- onCancel: () => f(d),
36
- onDelete: F
37
- })]
38
- });
39
- };
1
+ import "clsx";
2
+ import "@box/blueprint-web";
3
+ import "../../../../constants.js";
4
+ import "../metadata-instance-form-footer/metadata-instance-form-footer.js";
5
+ import "../metadata-instance-form-header/metadata-instance-form-header.js";
6
+ import { M as d } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
7
+ import "react/jsx-runtime";
40
8
  export {
41
- L as MetadataInstanceFormCardWrapper
9
+ d as MetadataInstanceFormCardWrapper
42
10
  };
@@ -1,96 +1,99 @@
1
- import { Formik as K, Form as W } from "formik";
2
- import { useState as d, useEffect as p, useRef as j, useMemo as k } from "react";
3
- import { TEMPLATE_CUSTOM_PROPERTIES as L } from "../../../../constants.js";
4
- import { useAutofill as V } from "../../../../utils/autofill-context.js";
5
- import { TemplateInstance as $ } from "../../../metadata-editor-fields/metadata-editor-fields.js";
6
- import { MetadataEmptyState as w } from "../../../metadata-empty-state/metadata-empty-state.js";
7
- import { UnsavedChangesModal as J } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
8
- import { CustomInstance as q } from "../custom-instance/custom-instance.js";
9
- import { DeleteConfirmationModal as z } from "../delete-confirmation-modal/delete-confirmation-modal.js";
10
- import { c as G } from "../../../../../../chunks/utils.js";
11
- import { MetadataInstanceFormCardWrapper as H } from "./metadata-instance-form-card-wrapper.js";
12
- import { jsx as a, jsxs as Q } from "react/jsx-runtime";
13
- import '../../../../../../styles/metadata-instance-form.css';const X = "_metadataInstanceForm_1hu4u_1", Y = {
14
- metadataInstanceForm: X
15
- }, uo = (c) => {
1
+ import { Formik as W, Form as j } from "formik";
2
+ import { useState as p, useEffect as d, useRef as k, useMemo as V } from "react";
3
+ import { TEMPLATE_CUSTOM_PROPERTIES as _ } from "../../../../constants.js";
4
+ import { AutofillLoadingState as $ } from "../autofill-loading-state/autofill-loading-state.js";
5
+ import { useAutofill as w } from "../../../../utils/autofill-context.js";
6
+ import { TemplateInstance as J } from "../../../metadata-editor-fields/metadata-editor-fields.js";
7
+ import { MetadataEmptyState as q } from "../../../metadata-empty-state/metadata-empty-state.js";
8
+ import { UnsavedChangesModal as z } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
9
+ import { CustomInstance as G } from "../custom-instance/custom-instance.js";
10
+ import { DeleteConfirmationModal as H } from "../delete-confirmation-modal/delete-confirmation-modal.js";
11
+ import { c as Q } from "../../../../../../chunks/utils.js";
12
+ import { s as X, M as Y } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
13
+ import { jsx as r, jsxs as Z } from "react/jsx-runtime";
14
+ const lo = (h) => {
16
15
  const {
17
- areAiSuggestionsAvailable: h,
18
- customRef: r,
19
- isAiSuggestionsFeatureEnabled: s,
20
- isDeleteButtonDisabled: C,
21
- isUnsavedChangesModalOpen: F = !1,
22
- MetadataInstanceFormCustomWrapper: M,
16
+ areAiSuggestionsAvailable: C,
17
+ customRef: i,
18
+ isAiSuggestionsFeatureEnabled: n,
19
+ iaBetaLanguageEnabled: M,
20
+ isDeleteButtonDisabled: S,
21
+ isUnsavedChangesModalOpen: E = !1,
22
+ MetadataInstanceFormCustomWrapper: c,
23
23
  selectedTemplateInstance: o,
24
- onCancel: S,
25
- onDelete: E,
26
- onDiscardUnsavedChanges: D,
27
- onSubmit: y,
28
- setIsUnsavedChangesModalOpen: i,
24
+ onCancel: F,
25
+ onDelete: D,
26
+ onDiscardUnsavedChanges: y,
27
+ onSubmit: b,
28
+ setIsUnsavedChangesModalOpen: s,
29
29
  taxonomyOptionsFetcher: e
30
- } = c, b = M ?? H, [O, m] = d(!1), {
31
- isFetchingSuggestions: n,
32
- getAiSuggestions: A,
30
+ } = h, A = c ?? Y, [O, m] = p(!1), {
31
+ isFetchingSuggestions: a,
32
+ getAiSuggestions: v,
33
33
  clearSuggestions: u,
34
- suggestions: v
35
- } = V();
36
- p(() => () => {
34
+ suggestions: x
35
+ } = w();
36
+ d(() => () => {
37
37
  u();
38
38
  }, [u]);
39
- const f = (o == null ? void 0 : o.templateKey) === L, x = async (t) => {
40
- await y(t, G(t, o));
41
- }, P = (t) => {
42
- t ? i(!0) : S();
43
- }, R = () => {
39
+ const f = (o == null ? void 0 : o.templateKey) === _, P = async (t) => {
40
+ await b(t, Q(t, o));
41
+ }, R = (t) => {
42
+ t ? s(!0) : F();
43
+ }, U = () => {
44
44
  m(!0);
45
- }, U = {
45
+ }, B = {
46
46
  metadata: {
47
47
  ...o
48
48
  }
49
- }, l = j(null), [g, _] = d(null);
50
- p(() => {
51
- _(r ?? l.current);
52
- }, [r, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
53
- const N = k(() => {
49
+ }, l = k(null), [g, L] = p(null);
50
+ d(() => {
51
+ L(i ?? l.current);
52
+ }, [i, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
53
+ const N = V(() => {
54
+ if (a)
55
+ return /* @__PURE__ */ r($, {});
54
56
  const t = (o == null ? void 0 : o.fields.length) === 0;
55
- return f ? /* @__PURE__ */ a(q, {
56
- isLoading: n
57
- }) : t ? /* @__PURE__ */ a(w, {
58
- isBoxAiSuggestionsFeatureEnabled: s,
57
+ return f ? /* @__PURE__ */ r(G, {
58
+ isLoading: a
59
+ }) : t ? /* @__PURE__ */ r(q, {
60
+ isBoxAiSuggestionsFeatureEnabled: n,
59
61
  level: "instance"
60
- }) : /* @__PURE__ */ a($, {
61
- disableForm: n,
62
- portalElement: r ?? g,
62
+ }) : /* @__PURE__ */ r(J, {
63
+ disableForm: a,
64
+ portalElement: i ?? g,
63
65
  taxonomyOptionsFetcher: e
64
66
  });
65
- }, [o == null ? void 0 : o.fields.length, f, n, r, g, e, s]);
66
- return /* @__PURE__ */ a(K, {
67
- initialValues: U,
68
- onSubmit: x,
67
+ }, [o == null ? void 0 : o.fields.length, f, a, i, g, e, n]);
68
+ return /* @__PURE__ */ r(W, {
69
+ initialValues: B,
70
+ onSubmit: P,
69
71
  children: ({
70
72
  values: t,
71
- dirty: B
72
- }) => /* @__PURE__ */ Q(W, {
73
- children: [/* @__PURE__ */ a(b, {
74
- areAiSuggestionsAvailable: h,
75
- className: Y.metadataInstanceForm,
73
+ dirty: K
74
+ }) => /* @__PURE__ */ Z(j, {
75
+ children: [/* @__PURE__ */ r(A, {
76
+ areAiSuggestionsAvailable: C,
77
+ className: X.metadataInstanceForm,
76
78
  formRef: l,
77
79
  formValues: t,
78
- getAiSuggestions: A,
79
- handleCancel: P,
80
- handleDelete: R,
81
- isAiSuggestionsFeatureEnabled: s,
82
- isDeleteButtonDisabled: C,
83
- isFetchingSuggestions: n,
84
- isFormDirty: B,
80
+ getAiSuggestions: v,
81
+ handleCancel: R,
82
+ handleDelete: U,
83
+ iaBetaLanguageEnabled: M,
84
+ isAiSuggestionsFeatureEnabled: n,
85
+ isDeleteButtonDisabled: S,
86
+ isFetchingSuggestions: a,
87
+ isFormDirty: K,
85
88
  selectedTemplateInstance: o,
86
- suggestions: v,
89
+ suggestions: x,
87
90
  children: o && N
88
- }), /* @__PURE__ */ a(J, {
89
- onBackToEdit: () => i(!1),
90
- onDiscardChanges: D,
91
- open: F
92
- }), /* @__PURE__ */ a(z, {
93
- onConfirm: () => E(o),
91
+ }), /* @__PURE__ */ r(z, {
92
+ onBackToEdit: () => s(!1),
93
+ onDiscardChanges: y,
94
+ open: E
95
+ }), /* @__PURE__ */ r(H, {
96
+ onConfirm: () => D(o),
94
97
  onDismiss: () => m(!1),
95
98
  open: O,
96
99
  templateName: o == null ? void 0 : o.displayName
@@ -99,5 +102,5 @@ import '../../../../../../styles/metadata-instance-form.css';const X = "_metadat
99
102
  }, `${o == null ? void 0 : o.scope}.${o == null ? void 0 : o.templateKey}`);
100
103
  };
101
104
  export {
102
- uo as MetadataInstanceForm
105
+ lo as MetadataInstanceForm
103
106
  };
@@ -1,5 +1,5 @@
1
- import { d as a } from "../../../../../../chunks/index.js";
2
- const e = a({
1
+ import { d as t } from "../../../../../../chunks/index.js";
2
+ const e = t({
3
3
  autofillButton: {
4
4
  id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButton",
5
5
  defaultMessage: "Autofill"
@@ -12,6 +12,10 @@ const e = a({
12
12
  id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButtonTooltip",
13
13
  defaultMessage: "Autofill with Box AI (Beta)"
14
14
  },
15
+ autofillButtonTooltipGA: {
16
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButtonTooltipGA",
17
+ defaultMessage: "Autofill with Box AI"
18
+ },
15
19
  loadingButtonAriaLabel: {
16
20
  id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.loadingButtonAriaLabel",
17
21
  defaultMessage: "Loading..."
@@ -1,65 +1,66 @@
1
- import { LoadingIndicator as M, IconButton as v, Tooltip as L, Button as k } from "@box/blueprint-web";
1
+ import { LoadingIndicator as v, IconButton as L, Tooltip as k, Button as x } from "@box/blueprint-web";
2
2
  import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
3
- import { useFormikContext as x, getIn as i } from "formik";
4
- import { useEffect as K } from "react";
5
- import { u as h } from "../../../../../../chunks/index.js";
6
- import { useAutofill as C } from "../../../../utils/autofill-context.js";
7
- import n from "./messages.js";
3
+ import { useFormikContext as K, getIn as i } from "formik";
4
+ import { useEffect as h } from "react";
5
+ import { u as C } from "../../../../../../chunks/index.js";
6
+ import { useAutofill as F } from "../../../../utils/autofill-context.js";
7
+ import o from "./messages.js";
8
8
  import { jsx as l } from "react/jsx-runtime";
9
- import '../../../../../../styles/metadata-instance-form-autofill-button.css';const F = "_loadingIndicator_1vv9u_1", _ = {
10
- loadingIndicator: F
9
+ import '../../../../../../styles/metadata-instance-form-autofill-button.css';const T = "_loadingIndicator_1vv9u_1", _ = {
10
+ loadingIndicator: T
11
11
  }, w = ({
12
12
  areAiSuggestionsAvailable: B,
13
+ iaBetaLanguageEnabled: b,
13
14
  isLoading: r,
14
- variant: b = "secondary-button",
15
+ variant: A = "secondary-button",
15
16
  onAutofill: I
16
17
  }) => {
17
18
  const {
18
19
  isSubmitting: y,
19
20
  values: e,
20
- setFieldValue: u
21
- } = x(), t = h(), {
22
- suggestions: o
23
- } = C();
24
- K(() => {
25
- if (o) {
26
- const a = i(e, "metadata.fields"), s = i(e, "metadata.templateKey");
27
- u("metadata.fields", a == null ? void 0 : a.map((c) => {
21
+ setFieldValue: c
22
+ } = K(), t = C(), {
23
+ suggestions: a
24
+ } = F();
25
+ h(() => {
26
+ if (a) {
27
+ const n = i(e, "metadata.fields"), s = i(e, "metadata.templateKey");
28
+ c("metadata.fields", n == null ? void 0 : n.map((u) => {
28
29
  var g;
29
- const f = (g = o == null ? void 0 : o[s]) == null ? void 0 : g[c.key];
30
+ const f = (g = a == null ? void 0 : a[s]) == null ? void 0 : g[u.key];
30
31
  return f ? {
31
- ...c,
32
+ ...u,
32
33
  aiSuggestion: f
33
- } : c;
34
+ } : u;
34
35
  }));
35
36
  }
36
- }, [o, u]);
37
+ }, [a, c]);
37
38
  const m = () => {
38
- const a = i(e, "metadata.templateKey"), s = i(e, "metadata.scope");
39
- I(a, s);
40
- }, d = !B || y || r, A = r ? /* @__PURE__ */ l(M, {
41
- "aria-label": t.formatMessage(n.loadingButtonAriaLabel),
39
+ const n = i(e, "metadata.templateKey"), s = i(e, "metadata.scope");
40
+ I(n, s);
41
+ }, d = !B || y || r, M = r ? /* @__PURE__ */ l(v, {
42
+ "aria-label": t.formatMessage(o.loadingButtonAriaLabel),
42
43
  className: _.loadingIndicator
43
- }) : /* @__PURE__ */ l(v, {
44
- "aria-label": t.formatMessage(n.autofillButtonAriaLabel),
44
+ }) : /* @__PURE__ */ l(L, {
45
+ "aria-label": t.formatMessage(o.autofillButtonAriaLabel),
45
46
  disabled: d,
46
47
  icon: p,
47
48
  onClick: m,
48
49
  variant: "icon-logo",
49
50
  "data-target-id": "IconButton-autofillButtonAriaLabel"
50
51
  });
51
- return /* @__PURE__ */ l(L, {
52
- content: t.formatMessage(n.autofillButtonTooltip),
53
- children: b === "secondary-button" ? /* @__PURE__ */ l(k, {
52
+ return /* @__PURE__ */ l(k, {
53
+ content: b ? t.formatMessage(o.autofillButtonTooltip) : t.formatMessage(o.autofillButtonTooltipGA),
54
+ children: A === "secondary-button" ? /* @__PURE__ */ l(x, {
54
55
  disabled: d,
55
56
  icon: p,
56
57
  loading: r,
57
- loadingAriaLabel: t.formatMessage(n.loadingButtonAriaLabel),
58
+ loadingAriaLabel: t.formatMessage(o.loadingButtonAriaLabel),
58
59
  onClick: m,
59
60
  variant: "secondary",
60
61
  "data-target-id": "Button-autofillButton",
61
- children: t.formatMessage(n.autofillButton)
62
- }) : A
62
+ children: t.formatMessage(o.autofillButton)
63
+ }) : M
63
64
  });
64
65
  };
65
66
  export {
@@ -1,41 +1,43 @@
1
- import { u } from "../../../../../../chunks/index.js";
2
- import { InlineNotice as I, Text as o } from "@box/blueprint-web";
3
- import g from "../../../interactive-header-text/interactive-header-text.js";
4
- import { MetadataInstanceFormAutofillButton as p } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
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
5
  import e from "./messages.js";
6
- import { jsxs as a, Fragment as H, jsx as r } from "react/jsx-runtime";
7
- import '../../../../../../styles/metadata-instance-form-header.css';const x = "_metadataInstanceFormHeader_13lxr_1", F = "_title_13lxr_9", s = {
8
- metadataInstanceFormHeader: x,
9
- title: F
10
- }, B = ({
11
- areAiSuggestionsAvailable: n,
12
- hasSuggestions: i,
13
- isAiSuggestionsFeatureEnabled: m,
14
- isLoading: c,
15
- templateName: l,
16
- onAutofill: d
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,
9
+ title: N
10
+ }, j = ({
11
+ areAiSuggestionsAvailable: r,
12
+ hasSuggestions: m,
13
+ isAiSuggestionsFeatureEnabled: c,
14
+ iaBetaLanguageEnabled: n,
15
+ isLoading: l,
16
+ templateName: d,
17
+ onAutofill: f
17
18
  }) => {
18
- const t = u(), f = l ?? t.formatMessage(e.customInstanceTitle);
19
- return /* @__PURE__ */ a(H, {
19
+ const t = p(), I = d ?? t.formatMessage(e.customInstanceTitle), u = m && r && n;
20
+ return /* @__PURE__ */ a(x, {
20
21
  children: [/* @__PURE__ */ a("div", {
21
- className: s.metadataInstanceFormHeader,
22
- children: [/* @__PURE__ */ r(g, {
23
- className: s.title,
24
- title: f
25
- }), m ? /* @__PURE__ */ r(p, {
26
- areAiSuggestionsAvailable: n,
27
- isLoading: c,
28
- onAutofill: d
22
+ className: i.metadataInstanceFormHeader,
23
+ children: [/* @__PURE__ */ o(h, {
24
+ className: i.title,
25
+ title: I
26
+ }), c ? /* @__PURE__ */ o(H, {
27
+ areAiSuggestionsAvailable: r,
28
+ iaBetaLanguageEnabled: n,
29
+ isLoading: l,
30
+ onAutofill: f
29
31
  }) : null]
30
- }), i && n ? /* @__PURE__ */ r("div", {
31
- children: /* @__PURE__ */ a(I, {
32
+ }), u ? /* @__PURE__ */ o("div", {
33
+ children: /* @__PURE__ */ a(g, {
32
34
  variant: "info",
33
35
  variantIconAriaLabel: t.formatMessage(e.aiSuggestionNoticeHeader),
34
- children: [/* @__PURE__ */ r(o, {
36
+ children: [/* @__PURE__ */ o(s, {
35
37
  as: "p",
36
38
  variant: "bodyDefaultBold",
37
39
  children: t.formatMessage(e.aiSuggestionNoticeHeader)
38
- }), /* @__PURE__ */ a(o, {
40
+ }), /* @__PURE__ */ a(s, {
39
41
  as: "p",
40
42
  children: [t.formatMessage(e.aiSuggestionNoticeBody), " "]
41
43
  })]
@@ -44,5 +46,5 @@ import '../../../../../../styles/metadata-instance-form-header.css';const x = "_
44
46
  });
45
47
  };
46
48
  export {
47
- B as MetadataInstanceFormHeader
49
+ j as MetadataInstanceFormHeader
48
50
  };
@@ -1,58 +1,59 @@
1
1
  import { Card as A, Divider as u } from "@box/blueprint-web";
2
2
  import { useState as D } from "react";
3
- import { useAutofill as S } from "../../../../utils/autofill-context.js";
3
+ import { useAutofill as g } from "../../../../utils/autofill-context.js";
4
4
  import { MetadataEmptyState as b } from "../../../metadata-empty-state/metadata-empty-state.js";
5
- import { MetadataInstanceContent as g } from "../metadata-instance-content/metadata-instance-content.js";
5
+ import { MetadataInstanceContent as S } from "../metadata-instance-content/metadata-instance-content.js";
6
6
  import { MetadataInstanceFooter as H } from "../metadata-instance-footer/metadata-instance-footer.js";
7
7
  import { MetadataInstanceHeader as _ } from "../metadata-instance-header/metadata-instance-header.js";
8
- import { jsxs as a, jsx as t, Fragment as n } from "react/jsx-runtime";
8
+ import { jsxs as s, jsx as t, Fragment as n } from "react/jsx-runtime";
9
9
  import '../../../../../../styles/metadata-instance.css';const M = "_topDivider_tzhlb_1", N = "_bottomDivider_tzhlb_5", y = {
10
10
  topDivider: M,
11
11
  bottomDivider: N
12
- }, W = ({
12
+ }, L = ({
13
13
  areAiSuggestionsAvailable: p,
14
14
  isAiSuggestionsFeatureEnabled: d,
15
15
  onEdit: l,
16
16
  templateInstance: o,
17
- taxonomyNodeFetcher: c
17
+ taxonomyNodeFetcher: E
18
18
  }) => {
19
- const i = o.fields, m = (s) => !s.value || Array.isArray(s.value) && s.value.length === 0, h = i.every(m), v = i.some(m), E = i.length > 0, [e, r] = D(!0), {
19
+ const e = o.fields, m = (r) => !r.value || Array.isArray(r.value) && r.value.length === 0, c = e.every(m), h = e.some(m), v = e.length > 0, [i, a] = D(!0), {
20
20
  getAiSuggestions: f
21
- } = S(), V = () => {
21
+ } = g(), V = () => {
22
22
  l(o), f(o.templateKey, o.scope);
23
23
  };
24
- return /* @__PURE__ */ a(A, {
24
+ return /* @__PURE__ */ s(A, {
25
25
  children: [/* @__PURE__ */ t(_, {
26
26
  areAiSuggestionsAvailable: p,
27
27
  canEdit: o.canEdit,
28
+ iaBetaLanguageEnabled: !1,
28
29
  isAiSuggestionsFeatureEnabled: d,
29
30
  onAutofill: V,
30
31
  onEdit: () => l(o),
31
32
  templateName: o == null ? void 0 : o.displayName
32
33
  }), /* @__PURE__ */ t(u, {
33
34
  className: y.topDivider
34
- }), e && h ? /* @__PURE__ */ t(b, {
35
- isAnyEmptyValueHidden: E,
35
+ }), i && c ? /* @__PURE__ */ t(b, {
36
+ isAnyEmptyValueHidden: v,
36
37
  isBoxAiSuggestionsFeatureEnabled: d,
37
38
  level: "instance",
38
- onShowEmptyValues: () => r(!1)
39
- }) : /* @__PURE__ */ a(n, {
40
- children: [/* @__PURE__ */ t(g, {
41
- shouldHideEmptyValues: e,
42
- taxonomyNodeFetcher: c,
39
+ onShowEmptyValues: () => a(!1)
40
+ }) : /* @__PURE__ */ s(n, {
41
+ children: [/* @__PURE__ */ t(S, {
42
+ shouldHideEmptyValues: i,
43
+ taxonomyNodeFetcher: E,
43
44
  templateInstance: o
44
- }), v && /* @__PURE__ */ a(n, {
45
+ }), h && /* @__PURE__ */ s(n, {
45
46
  children: [/* @__PURE__ */ t(u, {
46
47
  className: y.bottomDivider
47
48
  }), /* @__PURE__ */ t(H, {
48
- isAnyEmptyValueHidden: e,
49
- onHideEmptyValues: () => r(!0),
50
- onShowEmptyValues: () => r(!1)
49
+ isAnyEmptyValueHidden: i,
50
+ onHideEmptyValues: () => a(!0),
51
+ onShowEmptyValues: () => a(!1)
51
52
  })]
52
53
  })]
53
54
  })]
54
55
  });
55
56
  };
56
57
  export {
57
- W as MetadataInstance
58
+ L as MetadataInstance
58
59
  };
@@ -8,6 +8,10 @@ const e = t({
8
8
  id: "metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonTooltip",
9
9
  defaultMessage: "Autofill with Box AI (Beta)"
10
10
  },
11
+ autofillButtonTooltipGA: {
12
+ id: "metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonTooltipGA",
13
+ defaultMessage: "Autofill with Box AI"
14
+ },
11
15
  autofillButtonAriaLabel: {
12
16
  id: "metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonAriaLabel",
13
17
  defaultMessage: "Autofill {templateName} with Box AI"