@box/metadata-editor 1.15.4 → 1.16.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 (30) hide show
  1. package/dist/chunks/filter-dropdown-menu.module.js +9 -12
  2. package/dist/chunks/metadata-instance-form-card-wrapper.js +32 -32
  3. package/dist/chunks/taxonomy-ancestor-status-pill.js +37 -38
  4. package/dist/chunks/types.js +3 -3
  5. package/dist/chunks/utils2.js +28 -30
  6. package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +93 -96
  7. package/dist/esm/lib/components/combobox-with-api-pagination/request.js +2 -2
  8. package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +3 -4
  9. package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +21 -24
  10. package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +59 -61
  11. package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +39 -40
  12. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +37 -37
  13. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +9 -9
  14. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +35 -36
  15. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +52 -52
  16. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +22 -23
  17. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +1 -2
  18. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +31 -32
  19. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +22 -22
  20. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +114 -114
  21. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +96 -98
  22. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +29 -29
  23. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +39 -40
  24. package/dist/esm/lib/constants.js +3 -3
  25. package/dist/i18n/en-x-pseudo.js +129 -129
  26. package/dist/i18n/en-x-pseudo.properties +129 -129
  27. package/dist/styles/autofill-overlay.css +1 -1
  28. package/dist/styles/filter-dropdown-menu.css +1 -1
  29. package/dist/styles/taxonomy-ancestor-status-pill.css +1 -1
  30. package/package.json +9 -9
@@ -1,143 +1,143 @@
1
1
  import "../custom-instance-new-field/custom-instance-new-field.js";
2
- import { DeleteConfirmationModal as G } from "../delete-confirmation-modal/delete-confirmation-modal.js";
2
+ import { DeleteConfirmationModal as J } from "../delete-confirmation-modal/delete-confirmation-modal.js";
3
3
  import "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
4
4
  import "../metadata-instance-form-header/metadata-instance-form-header.js";
5
- import H from "clsx";
6
- import { Formik as Q, Form as X } from "formik";
7
- import Y from "lodash/isEqual";
8
- import { useState as S, useEffect as y, useRef as O, useMemo as Z } from "react";
9
- import { TEMPLATE_CUSTOM_PROPERTIES as I } from "../../../../constants.js";
10
- import { useAutofill as T } from "../../../../utils/autofill-context.js";
11
- import { TemplateInstance as oo } from "../../../metadata-editor-fields/metadata-editor-fields.js";
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";
15
- import { c as ao } from "../../../../../../chunks/utils.js";
16
- import { s as u, M as no } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
17
- import { jsx as i, jsxs as D } from "react/jsx-runtime";
18
- import { UnsavedChangesModal as eo } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
19
- const so = ({
20
- dirty: s,
21
- onChange: m,
22
- values: r
5
+ import z from "clsx";
6
+ import { Formik as G, Form as H } from "formik";
7
+ import Q from "lodash/isEqual";
8
+ import { useState as S, useEffect as y, useRef as O, useMemo as X } from "react";
9
+ import { TEMPLATE_CUSTOM_PROPERTIES as Y } from "../../../../constants.js";
10
+ import { useAutofill as Z } from "../../../../utils/autofill-context.js";
11
+ import { TemplateInstance as ee } from "../../../metadata-editor-fields/metadata-editor-fields.js";
12
+ import { MetadataEmptyState as te } from "../../../metadata-empty-state/metadata-empty-state.js";
13
+ import { AutofillOverlay as ae } from "../autofill-overlay/autofill-overlay.js";
14
+ import { CustomInstance as oe } from "../custom-instance/custom-instance.js";
15
+ import { c as ne } from "../../../../../../chunks/utils.js";
16
+ import { s as d, M as se } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
17
+ import { jsx as o, jsxs as D } from "react/jsx-runtime";
18
+ import { UnsavedChangesModal as re } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
19
+ const ie = ({
20
+ dirty: i,
21
+ onChange: l,
22
+ values: t
23
23
  }) => {
24
- const n = O(r);
25
- return s && !Y(n.current.metadata.fields, r.metadata.fields) && (n.current = r, m(r)), null;
26
- }, Ao = (s) => {
24
+ const s = O(t);
25
+ return i && !Q(s.current.metadata.fields, t.metadata.fields) && (s.current = t, l(t)), null;
26
+ }, Ie = (i) => {
27
27
  const {
28
- areAiSuggestionsAvailable: m,
29
- customRef: r,
30
- isLargeFile: n,
31
- errorCode: l,
32
- isAiSuggestionsFeatureEnabled: f,
33
- isAdvancedExtractAgentEnabled: x = !1,
34
- isBetaLanguageEnabled: A,
35
- isDeleteButtonDisabled: v,
36
- isDeleteConfirmationModalCheckboxEnabled: L,
37
- isMultilevelTaxonomyFieldEnabled: d,
38
- isUnsavedChangesModalOpen: R = !1,
39
- MetadataInstanceFormCustomWrapper: k,
40
- selectedTemplateInstance: o,
41
- onCancel: N,
42
- onChange: g,
43
- onDelete: P,
44
- onDiscardUnsavedChanges: U,
45
- onSubmit: B,
46
- setIsUnsavedChangesModalOpen: p,
47
- taxonomyOptionsFetcher: c
48
- } = s, w = k ?? no, [K, h] = S(!1), {
49
- isFetchingSuggestions: a,
28
+ areAiSuggestionsAvailable: l,
29
+ customRef: t,
30
+ isLargeFile: s,
31
+ errorCode: m,
32
+ isAiSuggestionsFeatureEnabled: c,
33
+ isAdvancedExtractAgentEnabled: I = !1,
34
+ isBetaLanguageEnabled: x,
35
+ isDeleteButtonDisabled: A,
36
+ isDeleteConfirmationModalCheckboxEnabled: v,
37
+ isMultilevelTaxonomyFieldEnabled: p,
38
+ isUnsavedChangesModalOpen: T = !1,
39
+ MetadataInstanceFormCustomWrapper: L,
40
+ selectedTemplateInstance: e,
41
+ onCancel: R,
42
+ onChange: f,
43
+ onDelete: k,
44
+ onDiscardUnsavedChanges: N,
45
+ onSubmit: P,
46
+ setIsUnsavedChangesModalOpen: u,
47
+ taxonomyOptionsFetcher: g
48
+ } = i, U = L ?? se, [B, h] = S(!1), {
49
+ isFetchingSuggestions: n,
50
50
  isLongLoading: C,
51
- getAiSuggestions: V,
51
+ getAiSuggestions: w,
52
52
  clearState: E,
53
- suggestions: W
54
- } = T();
53
+ suggestions: K
54
+ } = Z();
55
55
  y(() => () => {
56
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, ao(t, o));
60
- }, _ = (t) => {
61
- t ? p(!0) : N();
62
- }, $ = () => {
57
+ }, [E, e?.id]);
58
+ const F = e?.templateKey === Y, V = async (a) => {
59
+ await P(a, ne(a, e));
60
+ }, W = (a) => {
61
+ a ? u(!0) : R();
62
+ }, j = () => {
63
63
  h(!0);
64
- }, q = {
64
+ }, _ = {
65
65
  metadata: {
66
- ...o
66
+ ...e
67
67
  }
68
- }, M = O(null), [b, J] = S(null);
68
+ }, M = O(null), [b, $] = S(null);
69
69
  y(() => {
70
- J(r ?? M.current);
71
- }, [r, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
72
- const z = Z(() => {
73
- const t = (o == null ? void 0 : o.fields.length) === 0;
70
+ $(t ?? M.current);
71
+ }, [t, e?.templateKey, e?.scope]);
72
+ const q = X(() => {
73
+ const a = e?.fields.length === 0;
74
74
  if (F)
75
- return /* @__PURE__ */ i(io, {
76
- isLoading: a
75
+ return /* @__PURE__ */ o(oe, {
76
+ isLoading: n
77
77
  });
78
- if (t)
79
- return /* @__PURE__ */ i(ro, {
80
- isBoxAiSuggestionsFeatureEnabled: f,
78
+ if (a)
79
+ return /* @__PURE__ */ o(te, {
80
+ isBoxAiSuggestionsFeatureEnabled: c,
81
81
  level: "instance"
82
82
  });
83
- const e = !!(a || l);
83
+ const r = !!(n || m);
84
84
  return /* @__PURE__ */ D("div", {
85
- className: H(u.metadataInstanceFormContent, e && u.showOverlay),
86
- children: [/* @__PURE__ */ i(to, {
87
- errorCode: l,
88
- isFetchingSuggestions: a,
85
+ className: z(d.metadataInstanceFormContent, r && d.showOverlay),
86
+ children: [/* @__PURE__ */ o(ae, {
87
+ errorCode: m,
88
+ isFetchingSuggestions: n,
89
89
  isLongLoading: C
90
- }), /* @__PURE__ */ i(oo, {
91
- disableForm: a,
92
- isMultilevelTaxonomyFieldEnabled: d,
93
- portalElement: r ?? b,
94
- taxonomyOptionsFetcher: c
90
+ }), /* @__PURE__ */ o(ee, {
91
+ disableForm: n,
92
+ isMultilevelTaxonomyFieldEnabled: p,
93
+ portalElement: t ?? b,
94
+ taxonomyOptionsFetcher: g
95
95
  })]
96
96
  });
97
- }, [o == null ? void 0 : o.fields.length, F, a, C, r, b, c, f, d, l]);
98
- return /* @__PURE__ */ i(Q, {
99
- initialValues: q,
100
- onSubmit: j,
97
+ }, [e?.fields.length, F, n, C, t, b, g, c, p, m]);
98
+ return /* @__PURE__ */ o(G, {
99
+ initialValues: _,
100
+ onSubmit: V,
101
101
  children: ({
102
- values: t,
103
- dirty: e
104
- }) => /* @__PURE__ */ D(X, {
105
- children: [/* @__PURE__ */ i(w, {
106
- areAiSuggestionsAvailable: m,
107
- className: u.metadataInstanceForm,
102
+ values: a,
103
+ dirty: r
104
+ }) => /* @__PURE__ */ D(H, {
105
+ children: [/* @__PURE__ */ o(U, {
106
+ areAiSuggestionsAvailable: l,
107
+ className: d.metadataInstanceForm,
108
108
  formRef: M,
109
- formValues: t,
110
- getAiSuggestions: V,
111
- handleCancel: _,
112
- handleDelete: $,
113
- isAdvancedExtractAgentEnabled: x,
114
- isAiSuggestionsFeatureEnabled: f,
115
- isBetaLanguageEnabled: A,
116
- isDeleteButtonDisabled: v,
117
- isFetchingSuggestions: a,
118
- isFormDirty: e,
119
- isLargeFile: n,
120
- selectedTemplateInstance: o,
121
- suggestions: W,
122
- children: o && z
123
- }), g && /* @__PURE__ */ i(so, {
124
- dirty: e,
125
- onChange: g,
126
- values: t
127
- }), /* @__PURE__ */ i(eo, {
128
- onBackToEdit: () => p(!1),
129
- onDiscardChanges: U,
130
- open: R
131
- }), /* @__PURE__ */ i(G, {
132
- isCheckboxEnabled: L,
133
- onConfirm: () => P(o),
109
+ formValues: a,
110
+ getAiSuggestions: w,
111
+ handleCancel: W,
112
+ handleDelete: j,
113
+ isAdvancedExtractAgentEnabled: I,
114
+ isAiSuggestionsFeatureEnabled: c,
115
+ isBetaLanguageEnabled: x,
116
+ isDeleteButtonDisabled: A,
117
+ isFetchingSuggestions: n,
118
+ isFormDirty: r,
119
+ isLargeFile: s,
120
+ selectedTemplateInstance: e,
121
+ suggestions: K,
122
+ children: e && q
123
+ }), f && /* @__PURE__ */ o(ie, {
124
+ dirty: r,
125
+ onChange: f,
126
+ values: a
127
+ }), /* @__PURE__ */ o(re, {
128
+ onBackToEdit: () => u(!1),
129
+ onDiscardChanges: N,
130
+ open: T
131
+ }), /* @__PURE__ */ o(J, {
132
+ isCheckboxEnabled: v,
133
+ onConfirm: () => k(e),
134
134
  onDismiss: () => h(!1),
135
- open: K,
136
- templateName: o == null ? void 0 : o.displayName
135
+ open: B,
136
+ templateName: e?.displayName
137
137
  })]
138
138
  })
139
- }, `${o == null ? void 0 : o.scope}.${o == null ? void 0 : o.templateKey}`);
139
+ }, `${e?.scope}.${e?.templateKey}`);
140
140
  };
141
141
  export {
142
- Ao as MetadataInstanceForm
142
+ Ie as MetadataInstanceForm
143
143
  };
@@ -1,126 +1,124 @@
1
- import { Tooltip as N, Button as R, LoadingIndicator as k, IconButton as v, SplitButton as x, DropdownMenu as G, Text as D } from "@box/blueprint-web";
2
- import { BoxAiAdvancedLogo24 as K, BoxAiLogo24 as O } from "@box/blueprint-web-assets/icons/Logo";
3
- import { useLocalStorageAIAgents as j } from "@box/box-ai-agent-selector";
4
- import { useFormikContext as w, getIn as p } from "formik";
5
- import { useEffect as F, useMemo as P, forwardRef as Y, useState as V } from "react";
6
- import { useIntl as E } from "react-intl";
7
- import { EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY as X, EXTRACT_AGENTS_MAP as S } from "../../../../constants.js";
8
- import { autofillMessages as q } from "../../../../messages.js";
9
- import { useAutofill as z } from "../../../../utils/autofill-context.js";
10
- import { getTooltipContent as H } from "../../../../utils/utils.js";
1
+ import { Tooltip as b, Button as G, LoadingIndicator as E, IconButton as R, SplitButton as k, DropdownMenu as L, Text as v } from "@box/blueprint-web";
2
+ import { BoxAiAdvancedLogo24 as x, BoxAiLogo24 as D } from "@box/blueprint-web-assets/icons/Logo";
3
+ import { useLocalStorageAIAgents as K } from "@box/box-ai-agent-selector";
4
+ import { useFormikContext as O, getIn as f } from "formik";
5
+ import { useEffect as j, useMemo as w, forwardRef as F, useState as P } from "react";
6
+ import { useIntl as N } from "react-intl";
7
+ import { EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY as Y, EXTRACT_AGENTS_MAP as C } from "../../../../constants.js";
8
+ import { autofillMessages as V } from "../../../../messages.js";
9
+ import { useAutofill as X } from "../../../../utils/autofill-context.js";
10
+ import { getTooltipContent as q } from "../../../../utils/utils.js";
11
11
  import g from "./messages.js";
12
- import { jsx as t, jsxs as J } from "react/jsx-runtime";
13
- import '../../../../../../styles/metadata-instance-form-autofill-button.css';const Q = "_loadingIndicator_i1hyy_1", U = "_actionMenuItem_i1hyy_11", W = "_splitButtonIcon_i1hyy_17", T = {
14
- loadingIndicator: Q,
15
- actionMenuItem: U,
16
- splitButtonIcon: W
17
- }, Z = /* @__PURE__ */ Y(({
18
- isButtonDisabled: I,
19
- onAutofill: A,
20
- onAgentChange: m,
21
- storedAgent: B,
22
- icon: n,
23
- ..._
24
- }, h) => {
25
- const a = E(), [d, i] = V(B || "standard"), r = (o) => {
26
- i(o), m(o), setTimeout(() => {
27
- A(o);
12
+ import { jsx as t, jsxs as z } from "react/jsx-runtime";
13
+ import '../../../../../../styles/metadata-instance-form-autofill-button.css';const H = "_loadingIndicator_i1hyy_1", J = "_actionMenuItem_i1hyy_11", Q = "_splitButtonIcon_i1hyy_17", S = {
14
+ loadingIndicator: H,
15
+ actionMenuItem: J,
16
+ splitButtonIcon: Q
17
+ }, U = /* @__PURE__ */ F(({
18
+ isButtonDisabled: p,
19
+ onAutofill: I,
20
+ onAgentChange: c,
21
+ storedAgent: A,
22
+ icon: e,
23
+ ...B
24
+ }, _) => {
25
+ const n = N(), [u, a] = P(A || "standard"), i = (o) => {
26
+ a(o), c(o), setTimeout(() => {
27
+ I(o);
28
28
  }, 0);
29
29
  };
30
- return /* @__PURE__ */ t(x, {
31
- ..._,
32
- ref: h,
33
- disabled: I,
30
+ return /* @__PURE__ */ t(k, {
31
+ ...B,
32
+ ref: _,
33
+ disabled: p,
34
34
  dropdownTriggerAriaLabel: "See agent options.",
35
- icon: n,
36
- label: a.formatMessage(g.autofillButton),
37
- onClick: () => A(),
35
+ icon: e,
36
+ label: n.formatMessage(g.autofillButton),
37
+ onClick: () => I(),
38
38
  variant: "secondary",
39
- children: /* @__PURE__ */ t(G.RadioGroup, {
40
- onValueChange: (o) => r(o),
41
- value: d,
42
- children: Object.entries(S).map(([o, e]) => {
43
- const l = e.ICON;
44
- return /* @__PURE__ */ t(G.RadioSelectItem, {
45
- value: e.AGENT_TYPE,
46
- children: /* @__PURE__ */ J("div", {
47
- className: T.actionMenuItem,
48
- children: [/* @__PURE__ */ t(l, {
39
+ children: /* @__PURE__ */ t(L.RadioGroup, {
40
+ onValueChange: (o) => i(o),
41
+ value: u,
42
+ children: Object.entries(C).map(([o, s]) => {
43
+ const r = s.ICON;
44
+ return /* @__PURE__ */ t(L.RadioSelectItem, {
45
+ value: s.AGENT_TYPE,
46
+ children: /* @__PURE__ */ z("div", {
47
+ className: S.actionMenuItem,
48
+ children: [/* @__PURE__ */ t(r, {
49
49
  "aria-hidden": !0,
50
- className: T.splitButtonIcon
51
- }), /* @__PURE__ */ t(D, {
50
+ className: S.splitButtonIcon
51
+ }), /* @__PURE__ */ t(v, {
52
52
  as: "span",
53
- children: a.formatMessage(g[e.DISPLAY_MSG])
53
+ children: n.formatMessage(g[s.DISPLAY_MSG])
54
54
  })]
55
55
  })
56
56
  }, o);
57
57
  })
58
58
  })
59
59
  });
60
- }), mt = ({
61
- areAiSuggestionsAvailable: I,
62
- isBetaLanguageEnabled: A,
63
- isLoading: m,
64
- variant: B = "secondary-button",
65
- isAdvancedExtractAgentEnabled: n = !1,
66
- onAutofill: _
60
+ }), ct = ({
61
+ areAiSuggestionsAvailable: p,
62
+ isBetaLanguageEnabled: I,
63
+ isLoading: c,
64
+ variant: A = "secondary-button",
65
+ isAdvancedExtractAgentEnabled: e = !1,
66
+ onAutofill: B
67
67
  }) => {
68
68
  const {
69
- isSubmitting: h,
70
- values: a,
71
- setFieldValue: d
72
- } = w(), i = E(), [r, o] = j(X), {
73
- suggestions: e
74
- } = z();
75
- F(() => {
76
- if (e) {
77
- const s = p(a, "metadata.fields"), C = p(a, "metadata.templateKey");
78
- d("metadata.fields", s == null ? void 0 : s.map((c) => {
79
- var u;
80
- const f = (u = e == null ? void 0 : e[C]) == null ? void 0 : u[c.key];
81
- return f ? {
82
- ...c,
83
- aiSuggestion: f
84
- } : c;
69
+ isSubmitting: _,
70
+ values: n,
71
+ setFieldValue: u
72
+ } = O(), a = N(), [i, o] = K(Y), {
73
+ suggestions: s
74
+ } = X();
75
+ j(() => {
76
+ if (s) {
77
+ const m = f(n, "metadata.fields"), y = f(n, "metadata.templateKey");
78
+ u("metadata.fields", m?.map((l) => {
79
+ const d = s?.[y]?.[l.key];
80
+ return d ? {
81
+ ...l,
82
+ aiSuggestion: d
83
+ } : l;
85
84
  }));
86
85
  }
87
- }, [e, d]);
88
- const l = (s) => {
89
- var u, L;
90
- const C = p(a, "metadata.templateKey"), c = p(a, "metadata.scope"), f = s ? (u = S[s]) == null ? void 0 : u.AGENT_ID : (L = S[r]) == null ? void 0 : L.AGENT_ID;
91
- _(C, c, n ? f : void 0);
92
- }, M = !I || h || m, y = r === "enhanced" && n ? K : O, b = P(() => H(n, r, i), [n, r, i]);
93
- return B === "secondary-button" ? /* @__PURE__ */ t(N, {
94
- content: b,
95
- children: n ? /* @__PURE__ */ t(Z, {
96
- icon: y,
97
- isButtonDisabled: M,
86
+ }, [s, u]);
87
+ const r = (m) => {
88
+ const y = f(n, "metadata.templateKey"), l = f(n, "metadata.scope"), d = m ? C[m]?.AGENT_ID : C[i]?.AGENT_ID;
89
+ B(y, l, e ? d : void 0);
90
+ }, h = !p || _ || c, M = i === "enhanced" && e ? x : D, T = w(() => q(e, i, a), [e, i, a]);
91
+ return A === "secondary-button" ? /* @__PURE__ */ t(b, {
92
+ content: T,
93
+ children: e ? /* @__PURE__ */ t(U, {
94
+ icon: M,
95
+ isButtonDisabled: h,
98
96
  onAgentChange: o,
99
- onAutofill: l,
100
- storedAgent: r
101
- }) : /* @__PURE__ */ t(R, {
102
- disabled: M,
103
- icon: y,
104
- onClick: () => l(),
97
+ onAutofill: r,
98
+ storedAgent: i
99
+ }) : /* @__PURE__ */ t(G, {
100
+ disabled: h,
101
+ icon: M,
102
+ onClick: () => r(),
105
103
  variant: "secondary",
106
104
  "data-target-id": "Button-autofillButton",
107
- children: i.formatMessage(g.autofillButton)
105
+ children: a.formatMessage(g.autofillButton)
108
106
  })
109
- }) : /* @__PURE__ */ t(N, {
110
- content: b,
111
- children: m ? /* @__PURE__ */ t(k, {
112
- "aria-label": i.formatMessage(g.loadingButtonAriaLabel),
113
- className: T.loadingIndicator
114
- }) : /* @__PURE__ */ t(v, {
115
- "aria-label": i.formatMessage(q.autofillButtonAriaLabel),
116
- disabled: M,
117
- icon: y,
118
- onClick: () => l(),
107
+ }) : /* @__PURE__ */ t(b, {
108
+ content: T,
109
+ children: c ? /* @__PURE__ */ t(E, {
110
+ "aria-label": a.formatMessage(g.loadingButtonAriaLabel),
111
+ className: S.loadingIndicator
112
+ }) : /* @__PURE__ */ t(R, {
113
+ "aria-label": a.formatMessage(V.autofillButtonAriaLabel),
114
+ disabled: h,
115
+ icon: M,
116
+ onClick: () => r(),
119
117
  variant: "icon-logo",
120
118
  "data-target-id": "IconButton-autofillButtonAriaLabel"
121
119
  })
122
120
  });
123
121
  };
124
122
  export {
125
- mt as MetadataInstanceFormAutofillButton
123
+ ct as MetadataInstanceFormAutofillButton
126
124
  };
@@ -1,55 +1,55 @@
1
- import { Card as S, Divider as u } from "@box/blueprint-web";
1
+ import { Card as S, Divider as n } from "@box/blueprint-web";
2
2
  import { useState as b } from "react";
3
3
  import { useAutofill as g } from "../../../../utils/autofill-context.js";
4
4
  import { MetadataEmptyState as H } from "../../../metadata-empty-state/metadata-empty-state.js";
5
5
  import { MetadataInstanceContent as _ } from "../metadata-instance-content/metadata-instance-content.js";
6
6
  import { MetadataInstanceFooter as M } from "../metadata-instance-footer/metadata-instance-footer.js";
7
7
  import { MetadataInstanceHeader as N } from "../metadata-instance-header/metadata-instance-header.js";
8
- import { jsxs as a, jsx as t, Fragment as n } from "react/jsx-runtime";
9
- import '../../../../../../styles/metadata-instance.css';const x = "_topDivider_tzhlb_1", F = "_bottomDivider_tzhlb_5", y = {
8
+ import { jsxs as r, jsx as o, Fragment as u } from "react/jsx-runtime";
9
+ import '../../../../../../styles/metadata-instance.css';const x = "_topDivider_tzhlb_1", F = "_bottomDivider_tzhlb_5", p = {
10
10
  topDivider: x,
11
11
  bottomDivider: F
12
12
  }, q = ({
13
- areAiSuggestionsAvailable: p,
14
- isAiSuggestionsFeatureEnabled: d,
13
+ areAiSuggestionsAvailable: y,
14
+ isAiSuggestionsFeatureEnabled: l,
15
15
  isBetaLanguageEnabled: c,
16
- onEdit: l,
17
- templateInstance: o,
16
+ onEdit: d,
17
+ templateInstance: t,
18
18
  taxonomyNodeFetcher: h,
19
19
  isAdvancedExtractAgentEnabled: v = !1
20
20
  }) => {
21
- const i = o.fields, m = (e) => !e.value || Array.isArray(e.value) && e.value.length === 0, E = i.every(m), f = i.some(m), V = i.length > 0, [r, s] = b(!0), {
21
+ const i = t.fields, m = (e) => !e.value || Array.isArray(e.value) && e.value.length === 0, E = i.every(m), f = i.some(m), V = i.length > 0, [a, s] = b(!0), {
22
22
  getAiSuggestions: A
23
23
  } = g(), D = (e) => {
24
- l(o), A(o.templateKey, o.scope, e);
24
+ d(t), A(t.templateKey, t.scope, e);
25
25
  };
26
- return /* @__PURE__ */ a(S, {
27
- children: [/* @__PURE__ */ t(N, {
28
- areAiSuggestionsAvailable: p,
29
- canEdit: o.canEdit,
26
+ return /* @__PURE__ */ r(S, {
27
+ children: [/* @__PURE__ */ o(N, {
28
+ areAiSuggestionsAvailable: y,
29
+ canEdit: t.canEdit,
30
30
  isAdvancedExtractAgentEnabled: v,
31
- isAiSuggestionsFeatureEnabled: d,
31
+ isAiSuggestionsFeatureEnabled: l,
32
32
  isBetaLanguageEnabled: c,
33
33
  onAutofill: D,
34
- onEdit: () => l(o),
35
- templateName: o == null ? void 0 : o.displayName
36
- }), /* @__PURE__ */ t(u, {
37
- className: y.topDivider
38
- }), r && E ? /* @__PURE__ */ t(H, {
34
+ onEdit: () => d(t),
35
+ templateName: t?.displayName
36
+ }), /* @__PURE__ */ o(n, {
37
+ className: p.topDivider
38
+ }), a && E ? /* @__PURE__ */ o(H, {
39
39
  isAnyEmptyValueHidden: V,
40
- isBoxAiSuggestionsFeatureEnabled: d,
40
+ isBoxAiSuggestionsFeatureEnabled: l,
41
41
  level: "instance",
42
42
  onShowEmptyValues: () => s(!1)
43
- }) : /* @__PURE__ */ a(n, {
44
- children: [/* @__PURE__ */ t(_, {
45
- shouldHideEmptyValues: r,
43
+ }) : /* @__PURE__ */ r(u, {
44
+ children: [/* @__PURE__ */ o(_, {
45
+ shouldHideEmptyValues: a,
46
46
  taxonomyNodeFetcher: h,
47
- templateInstance: o
48
- }), f && /* @__PURE__ */ a(n, {
49
- children: [/* @__PURE__ */ t(u, {
50
- className: y.bottomDivider
51
- }), /* @__PURE__ */ t(M, {
52
- isAnyEmptyValueHidden: r,
47
+ templateInstance: t
48
+ }), f && /* @__PURE__ */ r(u, {
49
+ children: [/* @__PURE__ */ o(n, {
50
+ className: p.bottomDivider
51
+ }), /* @__PURE__ */ o(M, {
52
+ isAnyEmptyValueHidden: a,
53
53
  onHideEmptyValues: () => s(!0),
54
54
  onShowEmptyValues: () => s(!1)
55
55
  })]