@box/metadata-editor 2.2.9 → 2.2.11
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-content.js +3 -3
- package/dist/chunks/metadata-instance-form-ai-disclaimer.js +1 -1
- package/dist/chunks/metadata-instance-form-card-wrapper.js +19 -19
- package/dist/esm/lib/components/metadata-editor-fields/messages.js +1 -1
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +69 -69
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +58 -57
- package/dist/i18n/en-US.js +1 -1
- package/dist/i18n/en-US.properties +1 -1
- package/dist/i18n/json/src/lib/components/metadata-editor-fields/messages.json +1 -1
- package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +1 -0
- package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-ai-disclaimer/metadata-instance-form-ai-disclaimer.d.ts +2 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import '../styles/metadata-instance-content.css';var i = {
|
|
|
6
6
|
metadataInstanceContent: "_metadataInstanceContent_1cb0f_1",
|
|
7
7
|
metadataInstanceContentReducedGap: "_metadataInstanceContentReducedGap_1cb0f_7"
|
|
8
8
|
}, a = ({ onSelectMetadataField: a, selectedMetadataFieldId: o, shouldHideEmptyValues: s, templateInstance: c, taxonomyNodeFetcher: l, isConfidenceScoreReviewEnabled: u, isBoundingBoxEnabled: d }) => {
|
|
9
|
-
let { fields: f = [] } = c, p = t(() => f.filter((e) => !e.hidden).map((t) => {
|
|
9
|
+
let { fields: f = [] } = c, p = d || u, m = t(() => f.filter((e) => !e.hidden).map((t) => {
|
|
10
10
|
let r = a ? () => a(t) : void 0;
|
|
11
11
|
return /* @__PURE__ */ n(e, {
|
|
12
12
|
confidenceScore: t.confidenceScore,
|
|
@@ -36,8 +36,8 @@ import '../styles/metadata-instance-content.css';var i = {
|
|
|
36
36
|
c.isExternallyOwned
|
|
37
37
|
]);
|
|
38
38
|
return /* @__PURE__ */ n("div", {
|
|
39
|
-
className: r(i.metadataInstanceContent,
|
|
40
|
-
children:
|
|
39
|
+
className: r(i.metadataInstanceContent, p && i.metadataInstanceContentReducedGap),
|
|
40
|
+
children: m
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
export { a as t };
|
|
@@ -8,7 +8,7 @@ import { InfoBadge as s } from "@box/blueprint-web-assets/icons/Line";
|
|
|
8
8
|
import '../styles/metadata-instance-form-ai-disclaimer.css';var c = {
|
|
9
9
|
aiDisclaimer: "_aiDisclaimer_6i2mf_1",
|
|
10
10
|
infoBadgeIcon: "_infoBadgeIcon_6i2mf_7"
|
|
11
|
-
}, l = (e) => e.some((e) => !!e.confidenceScore), u = ({ fields: u, isLoading: d,
|
|
11
|
+
}, l = (e) => e.some((e) => !!e.confidenceScore || !!e.isExtracted), u = ({ fields: u, isLoading: d, isBoundingBoxOrConfidenceScoreReviewEnabled: f }) => {
|
|
12
12
|
let p = r(), m = n(() => l(u), [u]);
|
|
13
13
|
return !f || !m || d ? null : /* @__PURE__ */ a("div", {
|
|
14
14
|
className: c.aiDisclaimer,
|
|
@@ -13,39 +13,39 @@ import '../styles/metadata-instance-form-card-wrapper.css';var l = {
|
|
|
13
13
|
metadataInstanceFormContentReducedGap: "_metadataInstanceFormContentReducedGap_ztv76_30",
|
|
14
14
|
showOverlay: "_showOverlay_ztv76_34"
|
|
15
15
|
}, u = (u) => {
|
|
16
|
-
let { areAiSuggestionsAvailable: d, children: f, className: p, formRef: m, formValues: h, isAdvancedExtractAgentEnabled: g = !1, isAiSuggestionsFeatureEnabled: _, isBetaLanguageEnabled: v, isConfidenceScoreReviewEnabled: y = !1,
|
|
16
|
+
let { areAiSuggestionsAvailable: d, children: f, className: p, formRef: m, formValues: h, isAdvancedExtractAgentEnabled: g = !1, isAiSuggestionsFeatureEnabled: _, isBetaLanguageEnabled: v, isConfidenceScoreReviewEnabled: y = !1, isBoundingBoxEnabled: b = !1, isLargeFile: x = !1, isDeleteButtonDisabled: S, onToggleReviewFilter: C, shouldShowOnlyReviewFields: w = !1, suggestions: T, isFetchingSuggestions: E, isFormDirty: D = !1, selectedTemplateInstance: O, getAiSuggestions: k, handleCancel: A, handleDelete: j } = u, { enableModernizedComponents: M } = a(), N = O?.templateKey === e, P = !!T[O?.templateKey], F = y || b;
|
|
17
17
|
return /* @__PURE__ */ o("div", {
|
|
18
|
-
className:
|
|
19
|
-
"data-modern":
|
|
18
|
+
className: E && l.wrapperGradient,
|
|
19
|
+
"data-modern": M,
|
|
20
20
|
children: /* @__PURE__ */ s(i, {
|
|
21
21
|
ref: m,
|
|
22
|
-
className: c(p, { [l.suggestionsFetching]:
|
|
22
|
+
className: c(p, { [l.suggestionsFetching]: E }),
|
|
23
23
|
children: [
|
|
24
24
|
/* @__PURE__ */ o(r, {
|
|
25
25
|
areAiSuggestionsAvailable: d,
|
|
26
|
-
hasSuggestions:
|
|
26
|
+
hasSuggestions: P,
|
|
27
27
|
isAdvancedExtractAgentEnabled: g,
|
|
28
|
-
isAiSuggestionsFeatureEnabled: _ && !
|
|
28
|
+
isAiSuggestionsFeatureEnabled: _ && !N,
|
|
29
29
|
isBetaLanguageEnabled: v,
|
|
30
30
|
isConfidenceScoreReviewEnabled: y,
|
|
31
|
-
isLargeFile:
|
|
32
|
-
isLoading:
|
|
33
|
-
onAutofill:
|
|
34
|
-
onToggleReviewFilter:
|
|
35
|
-
shouldShowOnlyReviewFields:
|
|
36
|
-
templateName:
|
|
31
|
+
isLargeFile: x,
|
|
32
|
+
isLoading: E,
|
|
33
|
+
onAutofill: k,
|
|
34
|
+
onToggleReviewFilter: C,
|
|
35
|
+
shouldShowOnlyReviewFields: w,
|
|
36
|
+
templateName: O?.displayName
|
|
37
37
|
}),
|
|
38
|
-
|
|
38
|
+
O && f,
|
|
39
39
|
/* @__PURE__ */ o(t, {
|
|
40
|
-
isLoading:
|
|
41
|
-
|
|
40
|
+
isLoading: E,
|
|
41
|
+
isBoundingBoxOrConfidenceScoreReviewEnabled: F,
|
|
42
42
|
fields: h.metadata?.fields ?? []
|
|
43
43
|
}),
|
|
44
44
|
/* @__PURE__ */ o(n, {
|
|
45
|
-
isDeleteButtonDisabled:
|
|
46
|
-
isLoading:
|
|
47
|
-
onCancel: () =>
|
|
48
|
-
onDelete:
|
|
45
|
+
isDeleteButtonDisabled: S,
|
|
46
|
+
isLoading: E,
|
|
47
|
+
onCancel: () => A(D),
|
|
48
|
+
onDelete: j
|
|
49
49
|
})
|
|
50
50
|
]
|
|
51
51
|
})
|
|
@@ -19,107 +19,107 @@ import { useFormikContext as h } from "formik";
|
|
|
19
19
|
import se from "lodash/isEqual";
|
|
20
20
|
import ce from "lodash/isUndefined";
|
|
21
21
|
var g = /*#__PURE__*/ u(/*#__PURE__*/ l(({ disableForm: l, portalElement: u, field: g, index: le, taxonomyOptionsFetcher: _, isExternallyOwned: v, isMultilevelTaxonomyFieldEnabled: y, isTaxonomyPickerEnabled: b, createTaxonomyItemsService: x, isConfidenceScoreReviewEnabled: S = !1, isBoundingBoxEnabled: ue = !1, onSelectMetadataField: C, selectedMetadataFieldId: de }, w) => {
|
|
22
|
-
let { setFieldValue: T } = h(), { formatMessage: E } = ae(), D = g.aiSuggestionState || t.Initial, O = D === t.Pending, k = D === t.Applied, A = D === t.Initial, j = ne[g.type], { aiSuggestion: M, aiSuggestionConfidenceScore: N, aiSuggestionTargetLocation: P, type: F, value: I } = g,
|
|
23
|
-
[s.aiApproved]: k ||
|
|
22
|
+
let { setFieldValue: T } = h(), { formatMessage: E } = ae(), D = g.aiSuggestionState || t.Initial, O = D === t.Pending, k = D === t.Applied, A = D === t.Initial, j = ne[g.type], { aiSuggestion: M, aiSuggestionConfidenceScore: N, aiSuggestionTargetLocation: P, type: F, value: I } = g, L = j && !g.hidden, R = !ce(g.updateMode), z = `metadata.fields[${le}]`, B = g.type === "taxonomy" && g.optionsRules?.multiSelect, V = ue || S, H = S && !!g.confidenceScore, U = H && r(g.confidenceScore), fe = H && !O && !r(g.confidenceScore), W = de === g.id, pe = n(g.targetLocation), G = V && pe && !!C, { isTooltipOpen: K, handleMouseOver: me, handleMouseLeave: he, handleFocus: ge, handleBlur: _e } = re(G), ve = m({
|
|
23
|
+
[s.aiApproved]: k || fe || g.isExtracted,
|
|
24
24
|
[s.hasSuggestion]: O,
|
|
25
|
-
[s.hasConfidenceReview]: !O &&
|
|
25
|
+
[s.hasConfidenceReview]: !O && U,
|
|
26
26
|
[s.dateField]: F === "date"
|
|
27
|
-
}),
|
|
28
|
-
T(`${
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
|
|
27
|
+
}), q = d((e, t) => {
|
|
28
|
+
T(`${z}.${e}`, t);
|
|
29
|
+
}, [z, T]), J = d((e) => {
|
|
30
|
+
q("aiSuggestionState", e);
|
|
31
|
+
}, [q]), Y = d((e, n = !1) => {
|
|
32
|
+
q("value", e), J(t.Applied), q("isExtracted", !0), V && P && (q("targetLocation", P), q("aiSuggestionTargetLocation", void 0)), S && N && (q("confidenceScore", n ? {
|
|
33
33
|
...N,
|
|
34
34
|
isAccepted: !0
|
|
35
|
-
} : N),
|
|
35
|
+
} : N), q("aiSuggestionConfidenceScore", void 0));
|
|
36
36
|
}, [
|
|
37
|
-
K,
|
|
38
37
|
q,
|
|
38
|
+
J,
|
|
39
39
|
N,
|
|
40
40
|
P,
|
|
41
41
|
S,
|
|
42
|
-
|
|
43
|
-
]),
|
|
44
|
-
|
|
42
|
+
V
|
|
43
|
+
]), X = d(() => {
|
|
44
|
+
J(t.Initial), q("aiSuggestion", void 0), V && q("aiSuggestionTargetLocation", void 0), S && q("aiSuggestionConfidenceScore", void 0);
|
|
45
45
|
}, [
|
|
46
|
+
J,
|
|
46
47
|
q,
|
|
47
|
-
K,
|
|
48
48
|
S,
|
|
49
|
-
|
|
50
|
-
]),
|
|
51
|
-
g.confidenceScore &&
|
|
49
|
+
V
|
|
50
|
+
]), Z = d(() => {
|
|
51
|
+
g.confidenceScore && q("confidenceScore", {
|
|
52
52
|
...g.confidenceScore,
|
|
53
53
|
isAccepted: !0
|
|
54
54
|
}), C?.(null);
|
|
55
55
|
}, [
|
|
56
|
-
|
|
56
|
+
q,
|
|
57
57
|
g.confidenceScore,
|
|
58
58
|
C
|
|
59
|
-
]),
|
|
60
|
-
|
|
59
|
+
]), ye = d(() => {
|
|
60
|
+
J(t.Initial), q("aiSuggestion", void 0), q("isExtracted", !1), q("value", F === "multiSelect" || F === "taxonomy" ? [] : ""), q("confidenceScore", void 0), q("targetLocation", void 0), C?.(null);
|
|
61
61
|
}, [
|
|
62
|
-
|
|
62
|
+
q,
|
|
63
63
|
F,
|
|
64
64
|
C,
|
|
65
|
-
|
|
66
|
-
]),
|
|
67
|
-
|
|
65
|
+
J
|
|
66
|
+
]), Q = d(() => {
|
|
67
|
+
X(), g.isExtracted && q("isExtracted", !1), V && g.targetLocation && (q("targetLocation", void 0), C?.(null)), S && g.confidenceScore && (q("confidenceScore", void 0), C?.(null));
|
|
68
68
|
}, [
|
|
69
|
-
|
|
69
|
+
X,
|
|
70
70
|
S,
|
|
71
71
|
g.confidenceScore,
|
|
72
72
|
g.isExtracted,
|
|
73
73
|
g.targetLocation,
|
|
74
|
-
|
|
74
|
+
q,
|
|
75
75
|
C,
|
|
76
|
-
|
|
77
|
-
]),
|
|
76
|
+
V
|
|
77
|
+
]), be = d((e) => {
|
|
78
78
|
C && (i(e.target) || C(g));
|
|
79
|
-
}, [g, C]),
|
|
79
|
+
}, [g, C]), xe = d((e) => {
|
|
80
80
|
if (e.key === "Enter") {
|
|
81
81
|
if (!C || i(e.target)) return;
|
|
82
82
|
e.preventDefault(), e.stopPropagation(), C(g);
|
|
83
83
|
}
|
|
84
84
|
}, [g, C]);
|
|
85
85
|
f(() => {
|
|
86
|
-
O && (!I || Array.isArray(I) && I.length === 0) &&
|
|
86
|
+
O && (!I || Array.isArray(I) && I.length === 0) && Y(M);
|
|
87
87
|
}, [
|
|
88
88
|
M,
|
|
89
89
|
O,
|
|
90
|
-
|
|
90
|
+
Y
|
|
91
91
|
]), f(() => {
|
|
92
|
-
A && M &&
|
|
92
|
+
A && M && J(t.Pending);
|
|
93
93
|
}, [
|
|
94
94
|
A,
|
|
95
95
|
M,
|
|
96
|
-
|
|
96
|
+
J
|
|
97
97
|
]);
|
|
98
|
-
let
|
|
99
|
-
if (!
|
|
100
|
-
let
|
|
98
|
+
let Se = ie(() => M ? se(I, M) : !1, [M, I]);
|
|
99
|
+
if (!L) return null;
|
|
100
|
+
let $ = {
|
|
101
101
|
"data-metadata-field": !0,
|
|
102
102
|
"data-target-id": "Button-metadataEditorFieldEditClick",
|
|
103
103
|
"data-testid": "metadata-field",
|
|
104
|
-
onClick:
|
|
105
|
-
onKeyDown:
|
|
106
|
-
onMouseOver:
|
|
107
|
-
onMouseLeave:
|
|
108
|
-
onFocus:
|
|
109
|
-
onBlur:
|
|
104
|
+
onClick: be,
|
|
105
|
+
onKeyDown: xe,
|
|
106
|
+
onMouseOver: me,
|
|
107
|
+
onMouseLeave: he,
|
|
108
|
+
onFocus: ge,
|
|
109
|
+
onBlur: _e,
|
|
110
110
|
role: "button",
|
|
111
111
|
tabIndex: 0
|
|
112
112
|
};
|
|
113
|
-
if (
|
|
113
|
+
if (R) {
|
|
114
114
|
let t = /* @__PURE__ */ p(te, {
|
|
115
|
-
fieldNamePrefix:
|
|
115
|
+
fieldNamePrefix: z,
|
|
116
116
|
fieldType: g.type,
|
|
117
|
-
isTaxonomyMultiSelect:
|
|
117
|
+
isTaxonomyMultiSelect: B,
|
|
118
118
|
children: /* @__PURE__ */ p(j, {
|
|
119
119
|
ref: w,
|
|
120
120
|
description: g.description,
|
|
121
121
|
disableForm: l,
|
|
122
|
-
fieldNamePrefix:
|
|
122
|
+
fieldNamePrefix: z,
|
|
123
123
|
isAiSuggestionApplied: !1,
|
|
124
124
|
isExternallyOwned: v,
|
|
125
125
|
isMultilevelTaxonomyFieldEnabled: y,
|
|
@@ -127,31 +127,31 @@ var g = /*#__PURE__*/ u(/*#__PURE__*/ l(({ disableForm: l, portalElement: u, fie
|
|
|
127
127
|
createTaxonomyItemsService: x,
|
|
128
128
|
label: g.displayName,
|
|
129
129
|
levels: g.levels,
|
|
130
|
-
onValueEdited:
|
|
130
|
+
onValueEdited: Q,
|
|
131
131
|
portalElement: u,
|
|
132
132
|
taxonomyOptionsFetcher: _
|
|
133
133
|
})
|
|
134
134
|
}, g.key);
|
|
135
|
-
return
|
|
135
|
+
return G ? /* @__PURE__ */ p(c, {
|
|
136
136
|
content: E(e.viewOnDocument),
|
|
137
|
-
open:
|
|
137
|
+
open: K,
|
|
138
138
|
children: /* @__PURE__ */ p("div", {
|
|
139
|
-
className: m(a.spacious, a.clickableField,
|
|
140
|
-
|
|
139
|
+
className: m(a.spacious, a.clickableField, W && a.selectedField),
|
|
140
|
+
...$,
|
|
141
141
|
children: t
|
|
142
142
|
})
|
|
143
143
|
}) : t;
|
|
144
144
|
}
|
|
145
|
-
let
|
|
146
|
-
className: m(s.fieldWrapper,
|
|
147
|
-
...
|
|
145
|
+
let Ce = /* @__PURE__ */ oe("div", {
|
|
146
|
+
className: m(s.fieldWrapper, V && a.spacious, G && a.clickableField, G && W && a.selectedField),
|
|
147
|
+
...G && $,
|
|
148
148
|
children: [
|
|
149
149
|
/* @__PURE__ */ p(j, {
|
|
150
150
|
ref: w,
|
|
151
|
-
className:
|
|
151
|
+
className: ve,
|
|
152
152
|
description: g.description,
|
|
153
153
|
disableForm: l,
|
|
154
|
-
fieldNamePrefix:
|
|
154
|
+
fieldNamePrefix: z,
|
|
155
155
|
isAiSuggestionApplied: k || g.isExtracted,
|
|
156
156
|
isExternallyOwned: v,
|
|
157
157
|
confidenceScore: S ? g.confidenceScore : void 0,
|
|
@@ -159,31 +159,31 @@ var g = /*#__PURE__*/ u(/*#__PURE__*/ l(({ disableForm: l, portalElement: u, fie
|
|
|
159
159
|
isTaxonomyPickerEnabled: b,
|
|
160
160
|
createTaxonomyItemsService: x,
|
|
161
161
|
label: g.displayName,
|
|
162
|
-
onValueEdited:
|
|
162
|
+
onValueEdited: Q,
|
|
163
163
|
portalElement: u,
|
|
164
164
|
taxonomyOptionsFetcher: _
|
|
165
165
|
}),
|
|
166
166
|
O && /* @__PURE__ */ p(o, {
|
|
167
167
|
aiSuggestion: M,
|
|
168
168
|
confidenceLevel: S ? N?.level : void 0,
|
|
169
|
-
isSameValue:
|
|
169
|
+
isSameValue: Se,
|
|
170
170
|
onAiSuggestionAppend: () => {
|
|
171
|
-
|
|
171
|
+
Y([...new Set([I, M].flat().filter(Boolean))], !0);
|
|
172
172
|
},
|
|
173
|
-
onAiSuggestionIgnore:
|
|
174
|
-
onAiSuggestionReplace: () =>
|
|
173
|
+
onAiSuggestionIgnore: X,
|
|
174
|
+
onAiSuggestionReplace: () => Y(M, !0),
|
|
175
175
|
type: F
|
|
176
176
|
}),
|
|
177
|
-
!O &&
|
|
178
|
-
onAccept:
|
|
179
|
-
onClear:
|
|
177
|
+
!O && U && /* @__PURE__ */ p(ee, {
|
|
178
|
+
onAccept: Z,
|
|
179
|
+
onClear: ye
|
|
180
180
|
})
|
|
181
181
|
]
|
|
182
182
|
}, g.key);
|
|
183
|
-
return
|
|
183
|
+
return /* @__PURE__ */ p(c, {
|
|
184
184
|
content: E(e.viewOnDocument),
|
|
185
|
-
open: G,
|
|
186
|
-
children:
|
|
187
|
-
})
|
|
185
|
+
open: G && K,
|
|
186
|
+
children: Ce
|
|
187
|
+
});
|
|
188
188
|
}));
|
|
189
189
|
export { g as MetadataEditorFieldWrapper };
|
|
@@ -18,26 +18,26 @@ var y = ({ dirty: e, onChange: t, values: n }) => {
|
|
|
18
18
|
let r = d(n);
|
|
19
19
|
return e && !v(r.current.metadata.fields, n.metadata.fields) && (r.current = n, t(n)), null;
|
|
20
20
|
}, b = (v) => {
|
|
21
|
-
let { areAiSuggestionsAvailable: b, customRef: x, isLargeFile: S, errorCode: C, isAiSuggestionsFeatureEnabled: w, isAdvancedExtractAgentEnabled:
|
|
21
|
+
let { areAiSuggestionsAvailable: b, customRef: x, isLargeFile: S, errorCode: C, isAiSuggestionsFeatureEnabled: w, isAdvancedExtractAgentEnabled: re = !1, isBetaLanguageEnabled: ie, isDeleteButtonDisabled: ae, isDeleteConfirmationModalCheckboxEnabled: oe, isMultilevelTaxonomyFieldEnabled: T, isTaxonomyPickerEnabled: E, createTaxonomyItemsService: D, isUnsavedChangesModalOpen: O = !1, MetadataInstanceFormCustomWrapper: k, selectedTemplateInstance: A, onCancel: j, onChange: M, onDelete: N, onDiscardUnsavedChanges: P, onSubmit: F, onToggleReviewFilter: I, setIsUnsavedChangesModalOpen: L, shouldShowOnlyReviewFields: R = !1, taxonomyOptionsFetcher: z, isConfidenceScoreReviewEnabled: B = !1, isBoundingBoxEnabled: V = !1, onSelectMetadataField: H, selectedMetadataFieldId: U } = v, se = V || B, W = k ?? c, [G, K] = f(!1), { isFetchingSuggestions: q, isLongLoading: J, getAiSuggestions: ce, clearState: Y, suggestions: le } = r(), { trackEvent: ue } = n();
|
|
22
22
|
l(() => () => {
|
|
23
23
|
Y();
|
|
24
|
-
}, [Y,
|
|
25
|
-
let X =
|
|
26
|
-
await
|
|
27
|
-
},
|
|
28
|
-
e ?
|
|
29
|
-
},
|
|
24
|
+
}, [Y, A?.id]);
|
|
25
|
+
let X = A?.templateKey === e, de = async (e) => {
|
|
26
|
+
await F(e, ne(e, A));
|
|
27
|
+
}, Z = (e) => {
|
|
28
|
+
e ? L(!0) : j();
|
|
29
|
+
}, fe = () => {
|
|
30
30
|
K(!0);
|
|
31
|
-
},
|
|
31
|
+
}, pe = { metadata: { ...A } }, Q = d(null), [$, me] = f(null);
|
|
32
32
|
l(() => {
|
|
33
|
-
|
|
33
|
+
me(x ?? Q.current);
|
|
34
34
|
}, [
|
|
35
35
|
x,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
A?.templateKey,
|
|
37
|
+
A?.scope
|
|
38
38
|
]);
|
|
39
|
-
let
|
|
40
|
-
let e =
|
|
39
|
+
let he = u(() => {
|
|
40
|
+
let e = A?.fields.length === 0;
|
|
41
41
|
if (X) return /* @__PURE__ */ p(ee, { isLoading: q });
|
|
42
42
|
if (e) return /* @__PURE__ */ p(t, {
|
|
43
43
|
isBoxAiSuggestionsFeatureEnabled: w,
|
|
@@ -45,91 +45,92 @@ var y = ({ dirty: e, onChange: t, values: n }) => {
|
|
|
45
45
|
});
|
|
46
46
|
let n = !!(q || C);
|
|
47
47
|
return /* @__PURE__ */ m("div", {
|
|
48
|
-
className: h(s.metadataInstanceFormContent, n && s.showOverlay,
|
|
48
|
+
className: h(s.metadataInstanceFormContent, n && s.showOverlay, se && s.metadataInstanceFormContentReducedGap),
|
|
49
49
|
children: [/* @__PURE__ */ p(o, {
|
|
50
50
|
errorCode: C,
|
|
51
51
|
isFetchingSuggestions: q,
|
|
52
52
|
isLongLoading: J
|
|
53
53
|
}), /* @__PURE__ */ p(i, {
|
|
54
54
|
disableForm: q,
|
|
55
|
-
isConfidenceScoreReviewEnabled:
|
|
56
|
-
isBoundingBoxEnabled:
|
|
57
|
-
isExternallyOwned:
|
|
58
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
59
|
-
isTaxonomyPickerEnabled:
|
|
60
|
-
createTaxonomyItemsService:
|
|
61
|
-
onSelectMetadataField:
|
|
62
|
-
selectedMetadataFieldId:
|
|
55
|
+
isConfidenceScoreReviewEnabled: B,
|
|
56
|
+
isBoundingBoxEnabled: V,
|
|
57
|
+
isExternallyOwned: A?.isExternallyOwned,
|
|
58
|
+
isMultilevelTaxonomyFieldEnabled: T,
|
|
59
|
+
isTaxonomyPickerEnabled: E,
|
|
60
|
+
createTaxonomyItemsService: D,
|
|
61
|
+
onSelectMetadataField: H,
|
|
62
|
+
selectedMetadataFieldId: U,
|
|
63
63
|
portalElement: x ?? $,
|
|
64
|
-
shouldShowOnlyReviewFields:
|
|
65
|
-
taxonomyOptionsFetcher:
|
|
64
|
+
shouldShowOnlyReviewFields: R,
|
|
65
|
+
taxonomyOptionsFetcher: z
|
|
66
66
|
})]
|
|
67
67
|
});
|
|
68
68
|
}, [
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
A?.fields.length,
|
|
70
|
+
A?.isExternallyOwned,
|
|
71
71
|
X,
|
|
72
72
|
q,
|
|
73
73
|
J,
|
|
74
74
|
x,
|
|
75
75
|
$,
|
|
76
|
-
|
|
76
|
+
z,
|
|
77
77
|
w,
|
|
78
|
+
B,
|
|
78
79
|
V,
|
|
79
|
-
|
|
80
|
+
T,
|
|
80
81
|
E,
|
|
81
82
|
D,
|
|
82
|
-
O,
|
|
83
83
|
C,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
R,
|
|
85
|
+
H,
|
|
86
|
+
U
|
|
87
87
|
]);
|
|
88
88
|
return /* @__PURE__ */ p(_, {
|
|
89
|
-
initialValues:
|
|
90
|
-
onSubmit:
|
|
89
|
+
initialValues: pe,
|
|
90
|
+
onSubmit: de,
|
|
91
91
|
children: ({ values: e, dirty: t }) => /* @__PURE__ */ m(g, { children: [
|
|
92
|
-
/* @__PURE__ */ p(
|
|
92
|
+
/* @__PURE__ */ p(W, {
|
|
93
93
|
areAiSuggestionsAvailable: b,
|
|
94
94
|
className: s.metadataInstanceForm,
|
|
95
95
|
formRef: Q,
|
|
96
96
|
formValues: e,
|
|
97
|
-
getAiSuggestions:
|
|
98
|
-
handleCancel:
|
|
99
|
-
handleDelete:
|
|
100
|
-
isAdvancedExtractAgentEnabled:
|
|
97
|
+
getAiSuggestions: ce,
|
|
98
|
+
handleCancel: Z,
|
|
99
|
+
handleDelete: fe,
|
|
100
|
+
isAdvancedExtractAgentEnabled: re,
|
|
101
101
|
isAiSuggestionsFeatureEnabled: w,
|
|
102
|
-
isBetaLanguageEnabled:
|
|
103
|
-
isConfidenceScoreReviewEnabled:
|
|
104
|
-
|
|
102
|
+
isBetaLanguageEnabled: ie,
|
|
103
|
+
isConfidenceScoreReviewEnabled: B,
|
|
104
|
+
isBoundingBoxEnabled: V,
|
|
105
|
+
isDeleteButtonDisabled: ae,
|
|
105
106
|
isFetchingSuggestions: q,
|
|
106
107
|
isFormDirty: t,
|
|
107
108
|
isLargeFile: S,
|
|
108
|
-
onToggleReviewFilter:
|
|
109
|
-
selectedTemplateInstance:
|
|
110
|
-
shouldShowOnlyReviewFields:
|
|
111
|
-
suggestions:
|
|
112
|
-
children:
|
|
109
|
+
onToggleReviewFilter: I,
|
|
110
|
+
selectedTemplateInstance: A,
|
|
111
|
+
shouldShowOnlyReviewFields: R,
|
|
112
|
+
suggestions: le,
|
|
113
|
+
children: A && he
|
|
113
114
|
}),
|
|
114
|
-
|
|
115
|
+
M && /* @__PURE__ */ p(y, {
|
|
115
116
|
dirty: t,
|
|
116
|
-
onChange:
|
|
117
|
+
onChange: M,
|
|
117
118
|
values: e
|
|
118
119
|
}),
|
|
119
120
|
/* @__PURE__ */ p(a, {
|
|
120
|
-
onBackToEdit: () =>
|
|
121
|
-
onDiscardChanges:
|
|
122
|
-
open:
|
|
123
|
-
trackEvent:
|
|
121
|
+
onBackToEdit: () => L(!1),
|
|
122
|
+
onDiscardChanges: P,
|
|
123
|
+
open: O,
|
|
124
|
+
trackEvent: ue
|
|
124
125
|
}),
|
|
125
126
|
/* @__PURE__ */ p(te, {
|
|
126
|
-
isCheckboxEnabled:
|
|
127
|
-
onConfirm: () =>
|
|
127
|
+
isCheckboxEnabled: oe,
|
|
128
|
+
onConfirm: () => N(A),
|
|
128
129
|
onDismiss: () => K(!1),
|
|
129
130
|
open: G,
|
|
130
|
-
templateName:
|
|
131
|
+
templateName: A?.displayName
|
|
131
132
|
})
|
|
132
133
|
] })
|
|
133
|
-
}, `${
|
|
134
|
+
}, `${A?.scope}.${A?.templateKey}`);
|
|
134
135
|
};
|
|
135
136
|
export { b as MetadataInstanceForm };
|
package/dist/i18n/en-US.js
CHANGED
|
@@ -82,7 +82,7 @@ export default {
|
|
|
82
82
|
"metadataEditor.editInstance.deleteConfirmationModal.dismissButton": "Dismiss",
|
|
83
83
|
"metadataEditor.editInstance.deleteConfirmationModal.header": "Delete \"{templateName}\"",
|
|
84
84
|
"metadataEditor.editInstance.deleteConfirmationModal.headerAriaLabel": "Delete Metadata Template",
|
|
85
|
-
"metadataEditor.fieldLabel.aiExtractedBadgeTooltip": "
|
|
85
|
+
"metadataEditor.fieldLabel.aiExtractedBadgeTooltip": "Auto-extracted with Box AI",
|
|
86
86
|
"metadataEditor.fieldLabel.lowConfidenceBadge": "Low",
|
|
87
87
|
"metadataEditor.fileLevel.emptyState.boxAiEnabled.body": "Use the power of Box AI to quickly capture document metadata, with ever-increasing accuracy.",
|
|
88
88
|
"metadataEditor.fileLevel.emptyState.boxAiEnabled.heading": "Autofill Metadata with Box AI",
|
|
@@ -165,7 +165,7 @@ metadataEditor.editInstance.deleteConfirmationModal.header = Delete "{templateNa
|
|
|
165
165
|
# Aria label for header informing that template will be deleted
|
|
166
166
|
metadataEditor.editInstance.deleteConfirmationModal.headerAriaLabel = Delete Metadata Template
|
|
167
167
|
# Tooltip shown on the Box AI badge when a value was extracted by Box AI
|
|
168
|
-
metadataEditor.fieldLabel.aiExtractedBadgeTooltip =
|
|
168
|
+
metadataEditor.fieldLabel.aiExtractedBadgeTooltip = Auto-extracted with Box AI
|
|
169
169
|
# Badge shown on field label indicating a low confidence AI extraction
|
|
170
170
|
metadataEditor.fieldLabel.lowConfidenceBadge = Low
|
|
171
171
|
# Description of Box AI features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"metadataEditor.fieldLabel.lowConfidenceBadge","description":"Badge shown on field label indicating a low confidence AI extraction","defaultMessage":"Low"},{"id":"metadataEditor.fieldLabel.aiExtractedBadgeTooltip","description":"Tooltip shown on the Box AI badge when a value was extracted by Box AI","defaultMessage":"
|
|
1
|
+
[{"id":"metadataEditor.fieldLabel.lowConfidenceBadge","description":"Badge shown on field label indicating a low confidence AI extraction","defaultMessage":"Low"},{"id":"metadataEditor.fieldLabel.aiExtractedBadgeTooltip","description":"Tooltip shown on the Box AI badge when a value was extracted by Box AI","defaultMessage":"Auto-extracted with Box AI"}]
|
|
@@ -45,6 +45,7 @@ export type MetadataInstanceFormWrapperProps<T> = {
|
|
|
45
45
|
isAiSuggestionsFeatureEnabled: boolean;
|
|
46
46
|
isBetaLanguageEnabled: boolean;
|
|
47
47
|
isConfidenceScoreReviewEnabled?: boolean;
|
|
48
|
+
isBoundingBoxEnabled?: boolean;
|
|
48
49
|
isLargeFile?: boolean;
|
|
49
50
|
isDeleteButtonDisabled: boolean;
|
|
50
51
|
isFetchingSuggestions: boolean;
|
|
@@ -2,7 +2,7 @@ import { MetadataTemplateField } from '../../../../types';
|
|
|
2
2
|
type MetadataInstanceFormAiDisclaimerProps = {
|
|
3
3
|
fields: MetadataTemplateField[];
|
|
4
4
|
isLoading: boolean;
|
|
5
|
-
|
|
5
|
+
isBoundingBoxOrConfidenceScoreReviewEnabled: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const MetadataInstanceFormAiDisclaimer: ({ fields, isLoading,
|
|
7
|
+
export declare const MetadataInstanceFormAiDisclaimer: ({ fields, isLoading, isBoundingBoxOrConfidenceScoreReviewEnabled, }: MetadataInstanceFormAiDisclaimerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|