@box/metadata-editor 1.48.0 → 1.49.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.
- package/dist/chunks/metadata-instance-form-card-wrapper.js +39 -33
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +87 -82
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +51 -36
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +30 -38
- package/dist/styles/metadata-instance-form-header.css +1 -1
- package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +5 -0
- package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.d.ts +1 -1
- package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/types.d.ts +3 -0
- package/package.json +2 -2
- package/dist/styles/metadata-instance-form-inline-notice.css +0 -1
|
@@ -1,64 +1,70 @@
|
|
|
1
|
-
import { useBlueprintModernization as
|
|
1
|
+
import { useBlueprintModernization as v, Card as A } from "@box/blueprint-web";
|
|
2
2
|
import M from "clsx";
|
|
3
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
|
4
|
-
import { MetadataInstanceFormFooter as
|
|
5
|
-
import { MetadataInstanceFormHeader as
|
|
6
|
-
import { jsx as a, jsxs as
|
|
7
|
-
import '../styles/metadata-instance-form-card-wrapper.css';const x = "_metadataInstanceForm_moyil_1", D = "_wrapperGradient_moyil_7", L = "_suggestionsFetching_moyil_17", N = "_metadataInstanceFormContent_moyil_23",
|
|
3
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as b } from "../esm/lib/constants.js";
|
|
4
|
+
import { MetadataInstanceFormFooter as O } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js";
|
|
5
|
+
import { MetadataInstanceFormHeader as R } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
|
|
6
|
+
import { jsx as a, jsxs as T } from "react/jsx-runtime";
|
|
7
|
+
import '../styles/metadata-instance-form-card-wrapper.css';const x = "_metadataInstanceForm_moyil_1", D = "_wrapperGradient_moyil_7", L = "_suggestionsFetching_moyil_17", N = "_metadataInstanceFormContent_moyil_23", G = "_showOverlay_moyil_30", s = {
|
|
8
8
|
metadataInstanceForm: x,
|
|
9
9
|
wrapperGradient: D,
|
|
10
10
|
suggestionsFetching: L,
|
|
11
11
|
metadataInstanceFormContent: N,
|
|
12
|
-
showOverlay:
|
|
13
|
-
},
|
|
12
|
+
showOverlay: G
|
|
13
|
+
}, U = (n) => {
|
|
14
14
|
const {
|
|
15
15
|
areAiSuggestionsAvailable: o,
|
|
16
16
|
children: i,
|
|
17
17
|
className: r,
|
|
18
|
-
formRef:
|
|
19
|
-
isAdvancedExtractAgentEnabled:
|
|
18
|
+
formRef: l,
|
|
19
|
+
isAdvancedExtractAgentEnabled: m = !1,
|
|
20
20
|
isAiSuggestionsFeatureEnabled: d,
|
|
21
21
|
isBetaLanguageEnabled: c,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
isConfidenceScoreReviewEnabled: g = !1,
|
|
23
|
+
isLargeFile: p = !1,
|
|
24
|
+
isDeleteButtonDisabled: u,
|
|
25
|
+
onToggleReviewFilter: F,
|
|
26
|
+
shouldShowOnlyReviewFields: _ = !1,
|
|
27
|
+
suggestions: f,
|
|
25
28
|
isFetchingSuggestions: e,
|
|
26
|
-
isFormDirty:
|
|
29
|
+
isFormDirty: h = !1,
|
|
27
30
|
selectedTemplateInstance: t,
|
|
28
|
-
getAiSuggestions:
|
|
29
|
-
handleCancel:
|
|
30
|
-
handleDelete:
|
|
31
|
+
getAiSuggestions: y,
|
|
32
|
+
handleCancel: w,
|
|
33
|
+
handleDelete: C
|
|
31
34
|
} = n, {
|
|
32
|
-
enableModernizedComponents:
|
|
33
|
-
} =
|
|
35
|
+
enableModernizedComponents: I
|
|
36
|
+
} = v(), E = t?.templateKey === b, S = !!f[t?.templateKey];
|
|
34
37
|
return /* @__PURE__ */ a("div", {
|
|
35
38
|
className: e && s.wrapperGradient,
|
|
36
|
-
"data-modern":
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
-
ref:
|
|
39
|
+
"data-modern": I,
|
|
40
|
+
children: /* @__PURE__ */ T(A, {
|
|
41
|
+
ref: l,
|
|
39
42
|
className: M(r, {
|
|
40
43
|
[s.suggestionsFetching]: e
|
|
41
44
|
}),
|
|
42
|
-
children: [/* @__PURE__ */ a(
|
|
45
|
+
children: [/* @__PURE__ */ a(R, {
|
|
43
46
|
areAiSuggestionsAvailable: o,
|
|
44
|
-
hasSuggestions:
|
|
45
|
-
isAdvancedExtractAgentEnabled:
|
|
46
|
-
isAiSuggestionsFeatureEnabled: d && !
|
|
47
|
+
hasSuggestions: S,
|
|
48
|
+
isAdvancedExtractAgentEnabled: m,
|
|
49
|
+
isAiSuggestionsFeatureEnabled: d && !E,
|
|
47
50
|
isBetaLanguageEnabled: c,
|
|
48
|
-
|
|
51
|
+
isConfidenceScoreReviewEnabled: g,
|
|
52
|
+
isLargeFile: p,
|
|
49
53
|
isLoading: e,
|
|
50
|
-
onAutofill:
|
|
54
|
+
onAutofill: y,
|
|
55
|
+
onToggleReviewFilter: F,
|
|
56
|
+
shouldShowOnlyReviewFields: _,
|
|
51
57
|
templateName: t?.displayName
|
|
52
|
-
}), t && i, /* @__PURE__ */ a(
|
|
53
|
-
isDeleteButtonDisabled:
|
|
58
|
+
}), t && i, /* @__PURE__ */ a(O, {
|
|
59
|
+
isDeleteButtonDisabled: u,
|
|
54
60
|
isLoading: e,
|
|
55
|
-
onCancel: () => h
|
|
56
|
-
onDelete:
|
|
61
|
+
onCancel: () => w(h),
|
|
62
|
+
onDelete: C
|
|
57
63
|
})]
|
|
58
64
|
})
|
|
59
65
|
});
|
|
60
66
|
};
|
|
61
67
|
export {
|
|
62
|
-
|
|
68
|
+
U as M,
|
|
63
69
|
s
|
|
64
70
|
};
|
|
@@ -1,145 +1,150 @@
|
|
|
1
1
|
import "../custom-instance-new-field/custom-instance-new-field.js";
|
|
2
|
-
import { DeleteConfirmationModal as
|
|
2
|
+
import { DeleteConfirmationModal as H } 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
|
|
6
|
-
import { Formik as
|
|
7
|
-
import
|
|
8
|
-
import { useState as
|
|
9
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
|
10
|
-
import { useAutofill as
|
|
11
|
-
import { TemplateInstance as
|
|
12
|
-
import { MetadataEmptyState as
|
|
13
|
-
import { AutofillOverlay as
|
|
14
|
-
import { CustomInstance as
|
|
15
|
-
import { c as
|
|
16
|
-
import { s as
|
|
17
|
-
import { jsx as n, jsxs as
|
|
18
|
-
import { UnsavedChangesModal as
|
|
19
|
-
const
|
|
5
|
+
import Q from "clsx";
|
|
6
|
+
import { Formik as X, Form as Y } from "formik";
|
|
7
|
+
import Z from "lodash/isEqual";
|
|
8
|
+
import { useState as O, useEffect as S, useRef as v, useMemo as ee } from "react";
|
|
9
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as te } from "../../../../constants.js";
|
|
10
|
+
import { useAutofill as ae } from "../../../../utils/autofill-context.js";
|
|
11
|
+
import { TemplateInstance as ne } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
|
12
|
+
import { MetadataEmptyState as oe } from "../../../metadata-empty-state/metadata-empty-state.js";
|
|
13
|
+
import { AutofillOverlay as se } from "../autofill-overlay/autofill-overlay.js";
|
|
14
|
+
import { CustomInstance as re } from "../custom-instance/custom-instance.js";
|
|
15
|
+
import { c as ie } from "../../../../../../chunks/utils.js";
|
|
16
|
+
import { s as c, M as le } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
|
|
17
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
18
|
+
import { UnsavedChangesModal as me } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
|
|
19
|
+
const de = ({
|
|
20
20
|
dirty: i,
|
|
21
21
|
onChange: l,
|
|
22
22
|
values: t
|
|
23
23
|
}) => {
|
|
24
|
-
const s =
|
|
25
|
-
return i && !
|
|
26
|
-
},
|
|
24
|
+
const s = v(t);
|
|
25
|
+
return i && !Z(s.current.metadata.fields, t.metadata.fields) && (s.current = t, l(t)), null;
|
|
26
|
+
}, we = (i) => {
|
|
27
27
|
const {
|
|
28
28
|
areAiSuggestionsAvailable: l,
|
|
29
29
|
customRef: t,
|
|
30
30
|
isLargeFile: s,
|
|
31
31
|
errorCode: m,
|
|
32
|
-
isAiSuggestionsFeatureEnabled:
|
|
32
|
+
isAiSuggestionsFeatureEnabled: d,
|
|
33
33
|
isAdvancedExtractAgentEnabled: D = !1,
|
|
34
34
|
isBetaLanguageEnabled: I,
|
|
35
|
-
isDeleteButtonDisabled:
|
|
35
|
+
isDeleteButtonDisabled: w,
|
|
36
36
|
isDeleteConfirmationModalCheckboxEnabled: A,
|
|
37
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
38
|
-
isUnsavedChangesModalOpen:
|
|
39
|
-
MetadataInstanceFormCustomWrapper:
|
|
37
|
+
isMultilevelTaxonomyFieldEnabled: f,
|
|
38
|
+
isUnsavedChangesModalOpen: R = !1,
|
|
39
|
+
MetadataInstanceFormCustomWrapper: T,
|
|
40
40
|
selectedTemplateInstance: e,
|
|
41
|
-
onCancel:
|
|
42
|
-
onChange:
|
|
43
|
-
onDelete:
|
|
44
|
-
onDiscardUnsavedChanges:
|
|
45
|
-
onSubmit:
|
|
41
|
+
onCancel: L,
|
|
42
|
+
onChange: p,
|
|
43
|
+
onDelete: k,
|
|
44
|
+
onDiscardUnsavedChanges: N,
|
|
45
|
+
onSubmit: P,
|
|
46
|
+
onToggleReviewFilter: U,
|
|
46
47
|
setIsUnsavedChangesModalOpen: u,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
shouldShowOnlyReviewFields: g = !1,
|
|
49
|
+
taxonomyOptionsFetcher: h,
|
|
50
|
+
isConfidenceScoreReviewEnabled: B = !1
|
|
51
|
+
} = i, K = T ?? le, [V, E] = O(!1), {
|
|
50
52
|
isFetchingSuggestions: o,
|
|
51
53
|
isLongLoading: C,
|
|
52
|
-
getAiSuggestions:
|
|
53
|
-
clearState:
|
|
54
|
-
suggestions:
|
|
55
|
-
} =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
const b = e?.templateKey ===
|
|
60
|
-
await
|
|
61
|
-
},
|
|
62
|
-
a ? u(!0) :
|
|
63
|
-
},
|
|
54
|
+
getAiSuggestions: W,
|
|
55
|
+
clearState: F,
|
|
56
|
+
suggestions: j
|
|
57
|
+
} = ae();
|
|
58
|
+
S(() => () => {
|
|
59
|
+
F();
|
|
60
|
+
}, [F, e?.id]);
|
|
61
|
+
const b = e?.templateKey === te, _ = async (a) => {
|
|
62
|
+
await P(a, ie(a, e));
|
|
63
|
+
}, $ = (a) => {
|
|
64
|
+
a ? u(!0) : L();
|
|
65
|
+
}, q = () => {
|
|
64
66
|
E(!0);
|
|
65
|
-
},
|
|
67
|
+
}, J = {
|
|
66
68
|
metadata: {
|
|
67
69
|
...e
|
|
68
70
|
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
}, y = v(null), [M, z] = O(null);
|
|
72
|
+
S(() => {
|
|
73
|
+
z(t ?? y.current);
|
|
72
74
|
}, [t, e?.templateKey, e?.scope]);
|
|
73
|
-
const
|
|
75
|
+
const G = ee(() => {
|
|
74
76
|
const a = e?.fields.length === 0;
|
|
75
77
|
if (b)
|
|
76
|
-
return /* @__PURE__ */ n(
|
|
78
|
+
return /* @__PURE__ */ n(re, {
|
|
77
79
|
isLoading: o
|
|
78
80
|
});
|
|
79
81
|
if (a)
|
|
80
|
-
return /* @__PURE__ */ n(
|
|
81
|
-
isBoxAiSuggestionsFeatureEnabled:
|
|
82
|
+
return /* @__PURE__ */ n(oe, {
|
|
83
|
+
isBoxAiSuggestionsFeatureEnabled: d,
|
|
82
84
|
level: "instance"
|
|
83
85
|
});
|
|
84
86
|
const r = !!(o || m);
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
className:
|
|
87
|
-
children: [/* @__PURE__ */ n(
|
|
87
|
+
return /* @__PURE__ */ x("div", {
|
|
88
|
+
className: Q(c.metadataInstanceFormContent, r && c.showOverlay),
|
|
89
|
+
children: [/* @__PURE__ */ n(se, {
|
|
88
90
|
errorCode: m,
|
|
89
91
|
isFetchingSuggestions: o,
|
|
90
92
|
isLongLoading: C
|
|
91
|
-
}), /* @__PURE__ */ n(
|
|
93
|
+
}), /* @__PURE__ */ n(ne, {
|
|
92
94
|
disableForm: o,
|
|
93
95
|
isExternallyOwned: e?.isExternallyOwned,
|
|
94
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
96
|
+
isMultilevelTaxonomyFieldEnabled: f,
|
|
95
97
|
portalElement: t ?? M,
|
|
96
|
-
taxonomyOptionsFetcher:
|
|
98
|
+
taxonomyOptionsFetcher: h
|
|
97
99
|
})]
|
|
98
100
|
});
|
|
99
|
-
}, [e?.fields.length, b, o, C, t, M,
|
|
100
|
-
return /* @__PURE__ */ n(
|
|
101
|
-
initialValues:
|
|
102
|
-
onSubmit:
|
|
101
|
+
}, [e?.fields.length, e?.isExternallyOwned, b, o, C, t, M, h, d, f, m, g]);
|
|
102
|
+
return /* @__PURE__ */ n(X, {
|
|
103
|
+
initialValues: J,
|
|
104
|
+
onSubmit: _,
|
|
103
105
|
children: ({
|
|
104
106
|
values: a,
|
|
105
107
|
dirty: r
|
|
106
|
-
}) => /* @__PURE__ */
|
|
107
|
-
children: [/* @__PURE__ */ n(
|
|
108
|
+
}) => /* @__PURE__ */ x(Y, {
|
|
109
|
+
children: [/* @__PURE__ */ n(K, {
|
|
108
110
|
areAiSuggestionsAvailable: l,
|
|
109
|
-
className:
|
|
110
|
-
formRef:
|
|
111
|
+
className: c.metadataInstanceForm,
|
|
112
|
+
formRef: y,
|
|
111
113
|
formValues: a,
|
|
112
|
-
getAiSuggestions:
|
|
113
|
-
handleCancel:
|
|
114
|
-
handleDelete:
|
|
114
|
+
getAiSuggestions: W,
|
|
115
|
+
handleCancel: $,
|
|
116
|
+
handleDelete: q,
|
|
115
117
|
isAdvancedExtractAgentEnabled: D,
|
|
116
|
-
isAiSuggestionsFeatureEnabled:
|
|
118
|
+
isAiSuggestionsFeatureEnabled: d,
|
|
117
119
|
isBetaLanguageEnabled: I,
|
|
118
|
-
|
|
120
|
+
isConfidenceScoreReviewEnabled: B,
|
|
121
|
+
isDeleteButtonDisabled: w,
|
|
119
122
|
isFetchingSuggestions: o,
|
|
120
123
|
isFormDirty: r,
|
|
121
124
|
isLargeFile: s,
|
|
125
|
+
onToggleReviewFilter: U,
|
|
122
126
|
selectedTemplateInstance: e,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
shouldShowOnlyReviewFields: g,
|
|
128
|
+
suggestions: j,
|
|
129
|
+
children: e && G
|
|
130
|
+
}), p && /* @__PURE__ */ n(de, {
|
|
126
131
|
dirty: r,
|
|
127
|
-
onChange:
|
|
132
|
+
onChange: p,
|
|
128
133
|
values: a
|
|
129
|
-
}), /* @__PURE__ */ n(
|
|
134
|
+
}), /* @__PURE__ */ n(me, {
|
|
130
135
|
onBackToEdit: () => u(!1),
|
|
131
|
-
onDiscardChanges:
|
|
132
|
-
open:
|
|
133
|
-
}), /* @__PURE__ */ n(
|
|
136
|
+
onDiscardChanges: N,
|
|
137
|
+
open: R
|
|
138
|
+
}), /* @__PURE__ */ n(H, {
|
|
134
139
|
isCheckboxEnabled: A,
|
|
135
|
-
onConfirm: () =>
|
|
140
|
+
onConfirm: () => k(e),
|
|
136
141
|
onDismiss: () => E(!1),
|
|
137
|
-
open:
|
|
142
|
+
open: V,
|
|
138
143
|
templateName: e?.displayName
|
|
139
144
|
})]
|
|
140
145
|
})
|
|
141
146
|
}, `${e?.scope}.${e?.templateKey}`);
|
|
142
147
|
};
|
|
143
148
|
export {
|
|
144
|
-
|
|
149
|
+
we as MetadataInstanceForm
|
|
145
150
|
};
|
|
@@ -1,43 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { useFormikContext as M } from "formik";
|
|
2
|
+
import { useMemo as h } from "react";
|
|
3
|
+
import { useIntl as v } from "react-intl";
|
|
4
|
+
import { getFieldsNeedingReview as w } from "../../../../utils/confidence-score/get-fields-needing-review.js";
|
|
5
|
+
import W from "../../../interactive-header-text/interactive-header-text.js";
|
|
6
|
+
import { MetadataInstanceReviewNotice as g } from "../../../metadata-instance-review-notice/metadata-instance-review-notice.js";
|
|
7
|
+
import { MetadataInstanceFormAutofillButton as T } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
|
8
|
+
import { MetadataInstanceFormInlineNotice as j } from "../metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";
|
|
9
|
+
import k from "./messages.js";
|
|
10
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
11
|
+
import '../../../../../../styles/metadata-instance-form-header.css';const y = "_metadataInstanceFormHeaderWrapper_3nbmr_1", C = "_metadataInstanceFormHeader_3nbmr_1", R = "_title_3nbmr_15", a = {
|
|
12
|
+
metadataInstanceFormHeaderWrapper: y,
|
|
13
|
+
metadataInstanceFormHeader: C,
|
|
14
|
+
title: R
|
|
15
|
+
}, O = ({
|
|
16
|
+
areAiSuggestionsAvailable: r,
|
|
17
|
+
hasSuggestions: i,
|
|
18
|
+
isAdvancedExtractAgentEnabled: d = !1,
|
|
19
|
+
isAiSuggestionsFeatureEnabled: l,
|
|
20
|
+
isBetaLanguageEnabled: o,
|
|
21
|
+
isConfidenceScoreReviewEnabled: e = !1,
|
|
22
|
+
isLargeFile: p,
|
|
23
|
+
isLoading: f,
|
|
24
|
+
onToggleReviewFilter: m,
|
|
25
|
+
shouldShowOnlyReviewFields: I = !1,
|
|
26
|
+
templateName: F,
|
|
27
|
+
onAutofill: u
|
|
20
28
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const H = v(), {
|
|
30
|
+
values: n
|
|
31
|
+
} = M(), s = h(() => e ? w(n.metadata?.fields ?? []).length : 0, [n.metadata?.fields, e]), N = F ?? H.formatMessage(k.customInstanceTitle), _ = i && r, x = e && s > 0 && m !== void 0;
|
|
32
|
+
return /* @__PURE__ */ c("div", {
|
|
33
|
+
className: a.metadataInstanceFormHeaderWrapper,
|
|
34
|
+
children: [/* @__PURE__ */ c("div", {
|
|
35
|
+
className: a.metadataInstanceFormHeader,
|
|
36
|
+
children: [/* @__PURE__ */ t(W, {
|
|
37
|
+
className: a.title,
|
|
38
|
+
title: N
|
|
39
|
+
}), l ? /* @__PURE__ */ t(T, {
|
|
40
|
+
areAiSuggestionsAvailable: r,
|
|
41
|
+
isAdvancedExtractAgentEnabled: d,
|
|
42
|
+
isBetaLanguageEnabled: o,
|
|
43
|
+
isLoading: f,
|
|
44
|
+
onAutofill: u
|
|
34
45
|
}) : null]
|
|
35
|
-
}),
|
|
36
|
-
isBetaLanguageEnabled:
|
|
37
|
-
isLargeFile:
|
|
46
|
+
}), _ && /* @__PURE__ */ t(j, {
|
|
47
|
+
isBetaLanguageEnabled: o,
|
|
48
|
+
isLargeFile: p
|
|
49
|
+
}), x && /* @__PURE__ */ t(g, {
|
|
50
|
+
fieldsNeedingReviewCount: s,
|
|
51
|
+
isLowScoreFilteringEnabled: I,
|
|
52
|
+
onTextToggleClick: m
|
|
38
53
|
})]
|
|
39
54
|
});
|
|
40
55
|
};
|
|
41
56
|
export {
|
|
42
|
-
|
|
57
|
+
O as MetadataInstanceFormHeader
|
|
43
58
|
};
|
|
@@ -1,43 +1,35 @@
|
|
|
1
|
-
import { useIntl as
|
|
2
|
-
import { InlineNotice as
|
|
3
|
-
import
|
|
4
|
-
import { jsxs as
|
|
5
|
-
|
|
6
|
-
inlineNotice: m
|
|
7
|
-
}, p = ({
|
|
1
|
+
import { useIntl as s } from "react-intl";
|
|
2
|
+
import { InlineNotice as n, Text as t } from "@box/blueprint-web";
|
|
3
|
+
import a from "./messages.js";
|
|
4
|
+
import { jsxs as r, Fragment as c, jsx as l } from "react/jsx-runtime";
|
|
5
|
+
const p = ({
|
|
8
6
|
isLargeFile: o,
|
|
9
|
-
isBetaLanguageEnabled:
|
|
7
|
+
isBetaLanguageEnabled: i
|
|
10
8
|
}) => {
|
|
11
|
-
const e =
|
|
12
|
-
return !
|
|
13
|
-
children: [o && /* @__PURE__ */ n
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
children: e.formatMessage(i.autofillInBetaNoticeHeader)
|
|
36
|
-
}), /* @__PURE__ */ a(t, {
|
|
37
|
-
as: "p",
|
|
38
|
-
children: [e.formatMessage(i.autofillInBetaNoticeBody), " "]
|
|
39
|
-
})]
|
|
40
|
-
})
|
|
9
|
+
const e = s();
|
|
10
|
+
return !i && !o ? null : /* @__PURE__ */ r(c, {
|
|
11
|
+
children: [o && /* @__PURE__ */ r(n, {
|
|
12
|
+
variant: "warning",
|
|
13
|
+
variantIconAriaLabel: e.formatMessage(a.largeFileNoticeHeader),
|
|
14
|
+
children: [/* @__PURE__ */ l(t, {
|
|
15
|
+
as: "p",
|
|
16
|
+
variant: "bodyDefaultBold",
|
|
17
|
+
children: e.formatMessage(a.largeFileNoticeHeader)
|
|
18
|
+
}), /* @__PURE__ */ r(t, {
|
|
19
|
+
as: "p",
|
|
20
|
+
children: [e.formatMessage(a.largeFileNoticeBody), " "]
|
|
21
|
+
})]
|
|
22
|
+
}), i && /* @__PURE__ */ r(n, {
|
|
23
|
+
variant: "info",
|
|
24
|
+
variantIconAriaLabel: e.formatMessage(a.autofillInBetaNoticeHeader),
|
|
25
|
+
children: [/* @__PURE__ */ l(t, {
|
|
26
|
+
as: "p",
|
|
27
|
+
variant: "bodyDefaultBold",
|
|
28
|
+
children: e.formatMessage(a.autofillInBetaNoticeHeader)
|
|
29
|
+
}), /* @__PURE__ */ r(t, {
|
|
30
|
+
as: "p",
|
|
31
|
+
children: [e.formatMessage(a.autofillInBetaNoticeBody), " "]
|
|
32
|
+
})]
|
|
41
33
|
})]
|
|
42
34
|
});
|
|
43
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._metadataInstanceFormHeaderWrapper_3nbmr_1{display:flex;flex-direction:column;gap:var(--bp-space-040)}._metadataInstanceFormHeader_3nbmr_1{display:flex;gap:var(--bp-space-020);align-items:center;justify-content:space-between;padding-block-end:var(--bp-space-040);border-block-end:solid var(--bp-gray-10) var(--bp-border-01)}._metadataInstanceFormHeader_3nbmr_1 ._title_3nbmr_15{width:100%}
|
|
@@ -21,7 +21,9 @@ export type MetadataInstanceFormProps = {
|
|
|
21
21
|
/** Callback invoked when clicking Discard Changes button on the UnsavedChangesModal - can be used to reset form values */
|
|
22
22
|
onDiscardUnsavedChanges?: () => void;
|
|
23
23
|
onSubmit: (values: FormValues, operations: JSONPatchOperations) => Promise<void>;
|
|
24
|
+
onToggleReviewFilter?: () => void;
|
|
24
25
|
setIsUnsavedChangesModalOpen: (isUnsavedChangesModalOpen: boolean) => void;
|
|
26
|
+
shouldShowOnlyReviewFields?: boolean;
|
|
25
27
|
taxonomyOptionsFetcher: TaxonomyOptionsFetcher;
|
|
26
28
|
customRef?: HTMLDivElement | null;
|
|
27
29
|
MetadataInstanceFormCustomWrapper?: React.ComponentType<MetadataInstanceFormWrapperProps<null>>;
|
|
@@ -35,11 +37,14 @@ export type MetadataInstanceFormWrapperProps<T> = {
|
|
|
35
37
|
isAdvancedExtractAgentEnabled?: boolean;
|
|
36
38
|
isAiSuggestionsFeatureEnabled: boolean;
|
|
37
39
|
isBetaLanguageEnabled: boolean;
|
|
40
|
+
isConfidenceScoreReviewEnabled?: boolean;
|
|
38
41
|
isLargeFile?: boolean;
|
|
39
42
|
isDeleteButtonDisabled: boolean;
|
|
40
43
|
isFetchingSuggestions: boolean;
|
|
41
44
|
isFormDirty: boolean;
|
|
45
|
+
onToggleReviewFilter?: () => void;
|
|
42
46
|
selectedTemplateInstance: MetadataTemplateInstance | null;
|
|
47
|
+
shouldShowOnlyReviewFields?: boolean;
|
|
43
48
|
suggestions: AutofillSuggestions;
|
|
44
49
|
handleDelete: () => void;
|
|
45
50
|
handleCancel: (isDirty: boolean) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MetadataInstanceFormHeaderProps } from './types';
|
|
2
|
-
export declare const MetadataInstanceFormHeader: ({ areAiSuggestionsAvailable, hasSuggestions, isAdvancedExtractAgentEnabled, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, isLargeFile, isLoading, templateName, onAutofill, }: MetadataInstanceFormHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MetadataInstanceFormHeader: ({ areAiSuggestionsAvailable, hasSuggestions, isAdvancedExtractAgentEnabled, isAiSuggestionsFeatureEnabled, isBetaLanguageEnabled, isConfidenceScoreReviewEnabled, isLargeFile, isLoading, onToggleReviewFilter, shouldShowOnlyReviewFields, templateName, onAutofill, }: MetadataInstanceFormHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,8 +5,11 @@ export type MetadataInstanceFormHeaderProps = {
|
|
|
5
5
|
isAdvancedExtractAgentEnabled?: boolean;
|
|
6
6
|
isAiSuggestionsFeatureEnabled: boolean;
|
|
7
7
|
isBetaLanguageEnabled: boolean;
|
|
8
|
+
isConfidenceScoreReviewEnabled?: boolean;
|
|
8
9
|
isLargeFile: boolean;
|
|
9
10
|
isLoading: boolean;
|
|
10
11
|
onAutofill?: (templateKey: MetadataTemplateInstance['templateKey'], scope: MetadataTemplateInstance['scope']) => Promise<MetadataTemplateField[]>;
|
|
12
|
+
onToggleReviewFilter?: () => void;
|
|
13
|
+
shouldShowOnlyReviewFields?: boolean;
|
|
11
14
|
templateName?: string;
|
|
12
15
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.49.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@ariakit/react": "0.4.15",
|
|
6
6
|
"@box/box-ai-agent-selector": "^1.38.0",
|
|
7
7
|
"@box/blueprint-web": "^13.3.0",
|
|
8
8
|
"@box/blueprint-web-assets": "^4.101.14",
|
|
9
|
-
"@box/combobox-with-api": "^1.41.
|
|
9
|
+
"@box/combobox-with-api": "^1.41.1",
|
|
10
10
|
"formik": "^2.0.3",
|
|
11
11
|
"lodash": "^4.17.15",
|
|
12
12
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._inlineNotice_j1wao_1{padding-top:var(--space-4)}
|