@box/metadata-editor 1.61.5 → 1.62.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/utils.js +39 -30
- package/dist/chunks/utils2.js +17 -19
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +62 -61
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +16 -0
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +16 -21
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-review-field-filter.js +41 -0
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +77 -68
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +31 -24
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +12 -11
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.js +2 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +40 -40
- package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +10 -18
- package/dist/esm/lib/utils/confidence-score/get-fields-needing-review.js +3 -2
- package/dist/esm/lib/utils/confidence-score/messages.js +5 -5
- package/dist/i18n/bn-IN.js +4 -0
- package/dist/i18n/da-DK.js +4 -0
- package/dist/i18n/de-DE.js +4 -0
- package/dist/i18n/en-AU.js +4 -0
- package/dist/i18n/en-CA.js +4 -0
- package/dist/i18n/en-GB.js +4 -0
- package/dist/i18n/en-US.js +7 -3
- package/dist/i18n/en-US.properties +13 -5
- package/dist/i18n/en-x-pseudo.js +4 -0
- package/dist/i18n/es-419.js +4 -0
- package/dist/i18n/es-ES.js +4 -0
- package/dist/i18n/fi-FI.js +4 -0
- package/dist/i18n/fr-CA.js +4 -0
- package/dist/i18n/fr-FR.js +4 -0
- package/dist/i18n/hi-IN.js +4 -0
- package/dist/i18n/it-IT.js +4 -0
- package/dist/i18n/ja-JP.js +4 -0
- package/dist/i18n/json/src/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.json +1 -1
- package/dist/i18n/json/src/lib/utils/confidence-score/messages.json +1 -1
- package/dist/i18n/ko-KR.js +4 -0
- package/dist/i18n/nb-NO.js +4 -0
- package/dist/i18n/nl-NL.js +4 -0
- package/dist/i18n/pl-PL.js +4 -0
- package/dist/i18n/pt-BR.js +4 -0
- package/dist/i18n/ru-RU.js +4 -0
- package/dist/i18n/sv-SE.js +4 -0
- package/dist/i18n/tr-TR.js +4 -0
- package/dist/i18n/zh-CN.js +4 -0
- package/dist/i18n/zh-TW.js +4 -0
- package/dist/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.d.ts +20 -0
- package/dist/types/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.d.ts +1 -4
- package/dist/types/lib/components/metadata-editor-fields/hooks/use-review-field-filter.d.ts +7 -0
- package/dist/types/lib/components/metadata-editor-fields/types.d.ts +1 -0
- package/dist/types/lib/test-utils/confidence-score-fixtures.d.ts +4 -0
- package/dist/types/lib/utils/confidence-score/get-fields-needing-review.d.ts +4 -3
- package/package.json +10 -10
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import C from "clsx";
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { memo as
|
|
2
|
+
import { useFormikContext as oe } from "formik";
|
|
3
|
+
import ie from "lodash/isEqual";
|
|
4
|
+
import te from "lodash/isUndefined";
|
|
5
|
+
import { memo as ne, forwardRef as se, useCallback as c, useEffect as K, useMemo as re } from "react";
|
|
6
6
|
import { A as p } from "../../../../chunks/types.js";
|
|
7
|
-
import { checkIfHasBoundingBoxes as
|
|
7
|
+
import { checkIfHasBoundingBoxes as ce } from "../../utils/check-if-has-bounding-boxes.js";
|
|
8
8
|
import { isInteractiveFormElement as q } from "../../utils/is-interactive-form-element.js";
|
|
9
9
|
import { s as d } from "../../../../chunks/shared-field-styles.module.js";
|
|
10
|
-
import { UpdateModeFieldWrapper as
|
|
11
|
-
import { editorFieldTypes as
|
|
12
|
-
import { s as
|
|
13
|
-
import { jsx as m, jsxs as
|
|
10
|
+
import { UpdateModeFieldWrapper as ae } from "./components/update-mode-field-wrapper/update-mode-field-wrapper.js";
|
|
11
|
+
import { editorFieldTypes as pe } from "./editor-field-types.js";
|
|
12
|
+
import { s as S } from "../../../../chunks/utils2.js";
|
|
13
|
+
import { jsx as m, jsxs as ue } from "react/jsx-runtime";
|
|
14
14
|
import { isConfidenceScoreNeedingReview as w } from "../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
15
|
-
import { AiSuggestionField as
|
|
16
|
-
import { LowConfidenceSuggestionField as
|
|
17
|
-
const
|
|
15
|
+
import { AiSuggestionField as ge } from "./components/ai-suggestion-field/ai-suggestion-field.js";
|
|
16
|
+
import { LowConfidenceSuggestionField as de } from "./components/low-confidence-suggestion-field/low-confidence-suggestion-field.js";
|
|
17
|
+
const Pe = /* @__PURE__ */ ne(/* @__PURE__ */ se(({
|
|
18
18
|
disableForm: x,
|
|
19
19
|
portalElement: N,
|
|
20
|
-
field:
|
|
20
|
+
field: e,
|
|
21
21
|
index: H,
|
|
22
22
|
taxonomyOptionsFetcher: I,
|
|
23
23
|
isExternallyOwned: L,
|
|
@@ -28,45 +28,54 @@ const Vo = /* @__PURE__ */ io(/* @__PURE__ */ to(({
|
|
|
28
28
|
}, P) => {
|
|
29
29
|
const {
|
|
30
30
|
setFieldValue: i
|
|
31
|
-
} =
|
|
31
|
+
} = oe(), y = e.aiSuggestionState || p.Initial, a = y === p.Pending, B = y === p.Applied, T = y === p.Initial, $ = pe[e.type], {
|
|
32
32
|
aiSuggestion: r,
|
|
33
|
-
aiSuggestionConfidenceScore:
|
|
33
|
+
aiSuggestionConfidenceScore: l,
|
|
34
34
|
aiSuggestionTargetLocation: W,
|
|
35
|
-
type:
|
|
35
|
+
type: f,
|
|
36
36
|
value: u
|
|
37
|
-
} =
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
}), g =
|
|
43
|
-
i(`${
|
|
44
|
-
}, [
|
|
45
|
-
i(`${
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
} = e, G = $ && !e.hidden, J = !te(e.updateMode), o = `metadata.fields[${H}]`, Q = e.type === "taxonomy" && e.optionsRules?.multiSelect, k = s && !!e.confidenceScore, F = k && w(e.confidenceScore), X = k && !a && !w(e.confidenceScore), D = z === e.id, Y = ce(e.targetLocation), A = k && Y && !!n, Z = C({
|
|
38
|
+
[S.aiApproved]: B || X,
|
|
39
|
+
[S.hasSuggestion]: a,
|
|
40
|
+
[S.hasConfidenceReview]: !a && F,
|
|
41
|
+
[S.dateField]: f === "date"
|
|
42
|
+
}), g = c((t) => {
|
|
43
|
+
i(`${o}.aiSuggestionState`, t);
|
|
44
|
+
}, [o, i]), h = c((t, M = !1) => {
|
|
45
|
+
if (i(`${o}.value`, t), g(p.Applied), s && l) {
|
|
46
|
+
const ee = M ? {
|
|
47
|
+
...l,
|
|
48
|
+
isAccepted: !0
|
|
49
|
+
} : l;
|
|
50
|
+
i(`${o}.confidenceScore`, ee), i(`${o}.aiSuggestionConfidenceScore`, void 0), i(`${o}.targetLocation`, W), i(`${o}.aiSuggestionTargetLocation`, void 0);
|
|
51
|
+
}
|
|
52
|
+
}, [o, i, g, l, W, s]), v = c(() => {
|
|
53
|
+
g(p.Initial), i(`${o}.aiSuggestion`, void 0), s && (i(`${o}.aiSuggestionConfidenceScore`, void 0), i(`${o}.aiSuggestionTargetLocation`, void 0));
|
|
54
|
+
}, [g, i, o, s]), _ = c(() => {
|
|
55
|
+
e.confidenceScore && i(`${o}.confidenceScore`, {
|
|
56
|
+
...e.confidenceScore,
|
|
57
|
+
isAccepted: !0
|
|
58
|
+
}), n?.(null);
|
|
59
|
+
}, [o, i, e.confidenceScore, n]), b = c(() => {
|
|
60
|
+
const t = f === "multiSelect" || f === "taxonomy" ? [] : "";
|
|
61
|
+
i(`${o}.value`, t), i(`${o}.confidenceScore`, void 0), n?.(null);
|
|
62
|
+
}, [o, i, f, n]), U = c(() => {
|
|
63
|
+
v(), s && e.confidenceScore && (i(`${o}.confidenceScore`, void 0), n?.(null));
|
|
64
|
+
}, [v, s, e.confidenceScore, i, o, n]), O = c((t) => {
|
|
65
|
+
n && (q(t.target) || n(e));
|
|
66
|
+
}, [e, n]), E = c((t) => {
|
|
58
67
|
if (t.key === "Enter") {
|
|
59
68
|
if (!n || q(t.target))
|
|
60
69
|
return;
|
|
61
|
-
t.preventDefault(), t.stopPropagation(), n(
|
|
70
|
+
t.preventDefault(), t.stopPropagation(), n(e);
|
|
62
71
|
}
|
|
63
|
-
}, [
|
|
72
|
+
}, [e, n]);
|
|
64
73
|
K(() => {
|
|
65
|
-
|
|
66
|
-
}, [r,
|
|
74
|
+
a && (!u || Array.isArray(u) && u.length === 0) && h(r);
|
|
75
|
+
}, [r, a, h]), K(() => {
|
|
67
76
|
T && r && g(p.Pending);
|
|
68
77
|
}, [T, r, g]);
|
|
69
|
-
const R =
|
|
78
|
+
const R = re(() => r ? ie(u, r) : !1, [r, u]);
|
|
70
79
|
if (!G)
|
|
71
80
|
return null;
|
|
72
81
|
const j = {
|
|
@@ -78,65 +87,65 @@ const Vo = /* @__PURE__ */ io(/* @__PURE__ */ to(({
|
|
|
78
87
|
tabIndex: 0
|
|
79
88
|
};
|
|
80
89
|
if (J) {
|
|
81
|
-
const t = /* @__PURE__ */ m(
|
|
82
|
-
fieldNamePrefix:
|
|
83
|
-
fieldType:
|
|
90
|
+
const t = /* @__PURE__ */ m(ae, {
|
|
91
|
+
fieldNamePrefix: o,
|
|
92
|
+
fieldType: e.type,
|
|
84
93
|
isTaxonomyMultiSelect: Q,
|
|
85
|
-
children: /* @__PURE__ */ m(
|
|
94
|
+
children: /* @__PURE__ */ m($, {
|
|
86
95
|
ref: P,
|
|
87
|
-
description:
|
|
96
|
+
description: e.description,
|
|
88
97
|
disableForm: x,
|
|
89
|
-
fieldNamePrefix:
|
|
98
|
+
fieldNamePrefix: o,
|
|
90
99
|
isAiSuggestionApplied: !1,
|
|
91
100
|
isExternallyOwned: L,
|
|
92
101
|
isMultilevelTaxonomyFieldEnabled: V,
|
|
93
|
-
label:
|
|
94
|
-
levels:
|
|
102
|
+
label: e.displayName,
|
|
103
|
+
levels: e.levels,
|
|
95
104
|
onValueEdited: U,
|
|
96
105
|
portalElement: N,
|
|
97
106
|
taxonomyOptionsFetcher: I
|
|
98
107
|
})
|
|
99
|
-
},
|
|
100
|
-
return
|
|
108
|
+
}, e.key);
|
|
109
|
+
return A ? /* @__PURE__ */ m("div", {
|
|
101
110
|
className: C(d.spacious, d.clickableField, D && d.selectedField),
|
|
102
111
|
...j,
|
|
103
112
|
children: t
|
|
104
113
|
}) : t;
|
|
105
114
|
}
|
|
106
|
-
return /* @__PURE__ */
|
|
107
|
-
className: C(
|
|
108
|
-
...
|
|
109
|
-
children: [/* @__PURE__ */ m(
|
|
115
|
+
return /* @__PURE__ */ ue("div", {
|
|
116
|
+
className: C(S.fieldWrapper, s && d.spacious, A && d.clickableField, A && D && d.selectedField),
|
|
117
|
+
...A && j,
|
|
118
|
+
children: [/* @__PURE__ */ m($, {
|
|
110
119
|
ref: P,
|
|
111
120
|
className: Z,
|
|
112
|
-
description:
|
|
121
|
+
description: e.description,
|
|
113
122
|
disableForm: x,
|
|
114
|
-
fieldNamePrefix:
|
|
123
|
+
fieldNamePrefix: o,
|
|
115
124
|
isAiSuggestionApplied: B,
|
|
116
125
|
isExternallyOwned: L,
|
|
117
|
-
confidenceScore: s
|
|
126
|
+
confidenceScore: s ? e.confidenceScore : void 0,
|
|
118
127
|
isMultilevelTaxonomyFieldEnabled: V,
|
|
119
|
-
label:
|
|
128
|
+
label: e.displayName,
|
|
120
129
|
onValueEdited: U,
|
|
121
130
|
portalElement: N,
|
|
122
131
|
taxonomyOptionsFetcher: I
|
|
123
|
-
}),
|
|
132
|
+
}), a && /* @__PURE__ */ m(ge, {
|
|
124
133
|
aiSuggestion: r,
|
|
125
|
-
confidenceLevel: s ?
|
|
134
|
+
confidenceLevel: s ? l?.level : void 0,
|
|
126
135
|
isSameValue: R,
|
|
127
136
|
onAiSuggestionAppend: () => {
|
|
128
137
|
const t = [...new Set([u, r].flat().filter(Boolean))];
|
|
129
|
-
|
|
138
|
+
h(t, !0);
|
|
130
139
|
},
|
|
131
140
|
onAiSuggestionIgnore: v,
|
|
132
|
-
onAiSuggestionReplace: () =>
|
|
133
|
-
type:
|
|
134
|
-
}), !
|
|
141
|
+
onAiSuggestionReplace: () => h(r, !0),
|
|
142
|
+
type: f
|
|
143
|
+
}), !a && F && /* @__PURE__ */ m(de, {
|
|
135
144
|
onAccept: _,
|
|
136
145
|
onClear: b
|
|
137
146
|
})]
|
|
138
|
-
},
|
|
147
|
+
}, e.key);
|
|
139
148
|
}));
|
|
140
149
|
export {
|
|
141
|
-
|
|
150
|
+
Pe as MetadataEditorFieldWrapper
|
|
142
151
|
};
|
|
@@ -1,36 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { FormattedMessage as
|
|
1
|
+
import { Text as d } from "@box/blueprint-web";
|
|
2
|
+
import { useFormikContext as c, getIn as u, FieldArray as p } from "formik";
|
|
3
|
+
import { useRef as F, useEffect as h, createElement as x } from "react";
|
|
4
|
+
import { FormattedMessage as y } from "react-intl";
|
|
5
5
|
import g from "../../messages.js";
|
|
6
|
-
import { MetadataEditorFieldWrapper as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
6
|
+
import { MetadataEditorFieldWrapper as v } from "./metadata-editor-field-wrapper.js";
|
|
7
|
+
import { useReviewFieldFilter as E } from "./hooks/use-review-field-filter.js";
|
|
8
|
+
import { s as R } from "../../../../chunks/utils2.js";
|
|
9
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
10
|
+
const N = (r) => {
|
|
10
11
|
const {
|
|
11
|
-
|
|
12
|
-
} =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
shouldShowOnlyReviewFields: m = !1
|
|
13
|
+
} = r, {
|
|
14
|
+
values: l
|
|
15
|
+
} = c(), s = "metadata.fields", t = u(l, s), n = F(null), f = E(t, m), a = t.findIndex((e) => !e.hidden);
|
|
16
|
+
return h(() => {
|
|
17
|
+
a > -1 && n.current?.focus();
|
|
18
|
+
}, []), t.length ? /* @__PURE__ */ o(p, {
|
|
19
|
+
name: s,
|
|
17
20
|
validateOnChange: !1,
|
|
18
|
-
children: () =>
|
|
19
|
-
...m,
|
|
20
|
-
ref: n === a ? s : null,
|
|
21
|
+
children: () => f.map(({
|
|
21
22
|
field: e,
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
23
|
+
originalIndex: i
|
|
24
|
+
}) => /* @__PURE__ */ x(v, {
|
|
25
|
+
...r,
|
|
26
|
+
key: e.key,
|
|
27
|
+
ref: i === a ? n : null,
|
|
28
|
+
field: e,
|
|
29
|
+
index: i
|
|
30
|
+
}))
|
|
31
|
+
}) : /* @__PURE__ */ o(d, {
|
|
25
32
|
as: "span",
|
|
26
|
-
className:
|
|
33
|
+
className: R.noAttributesText,
|
|
27
34
|
color: "textOnLightSecondary",
|
|
28
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ o(y, {
|
|
29
36
|
...g.noTemplateAtributesError
|
|
30
37
|
})
|
|
31
38
|
});
|
|
32
39
|
};
|
|
33
40
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
N as TemplateInstance,
|
|
42
|
+
N as default
|
|
36
43
|
};
|
|
@@ -34,18 +34,18 @@ const pe = ({
|
|
|
34
34
|
isBetaLanguageEnabled: R,
|
|
35
35
|
isDeleteButtonDisabled: T,
|
|
36
36
|
isDeleteConfirmationModalCheckboxEnabled: L,
|
|
37
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
37
|
+
isMultilevelTaxonomyFieldEnabled: u,
|
|
38
38
|
isUnsavedChangesModalOpen: k = !1,
|
|
39
39
|
MetadataInstanceFormCustomWrapper: N,
|
|
40
40
|
selectedTemplateInstance: e,
|
|
41
41
|
onCancel: P,
|
|
42
|
-
onChange:
|
|
42
|
+
onChange: g,
|
|
43
43
|
onDelete: U,
|
|
44
44
|
onDiscardUnsavedChanges: B,
|
|
45
45
|
onSubmit: K,
|
|
46
46
|
onToggleReviewFilter: V,
|
|
47
|
-
setIsUnsavedChangesModalOpen:
|
|
48
|
-
shouldShowOnlyReviewFields:
|
|
47
|
+
setIsUnsavedChangesModalOpen: h,
|
|
48
|
+
shouldShowOnlyReviewFields: f = !1,
|
|
49
49
|
taxonomyOptionsFetcher: C,
|
|
50
50
|
isConfidenceScoreReviewEnabled: r = !1,
|
|
51
51
|
onSelectMetadataField: E,
|
|
@@ -63,7 +63,7 @@ const pe = ({
|
|
|
63
63
|
const S = e?.templateKey === ne, q = async (a) => {
|
|
64
64
|
await K(a, me(a, e));
|
|
65
65
|
}, G = (a) => {
|
|
66
|
-
a ?
|
|
66
|
+
a ? h(!0) : P();
|
|
67
67
|
}, J = () => {
|
|
68
68
|
M(!0);
|
|
69
69
|
}, z = {
|
|
@@ -96,14 +96,15 @@ const pe = ({
|
|
|
96
96
|
disableForm: o,
|
|
97
97
|
isConfidenceScoreReviewEnabled: r,
|
|
98
98
|
isExternallyOwned: e?.isExternallyOwned,
|
|
99
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
99
|
+
isMultilevelTaxonomyFieldEnabled: u,
|
|
100
100
|
onSelectMetadataField: E,
|
|
101
101
|
selectedMetadataFieldId: F,
|
|
102
102
|
portalElement: t ?? x,
|
|
103
|
+
shouldShowOnlyReviewFields: f,
|
|
103
104
|
taxonomyOptionsFetcher: C
|
|
104
105
|
})]
|
|
105
106
|
});
|
|
106
|
-
}, [e?.fields.length, e?.isExternallyOwned, S, o, b, t, x, C, p, r,
|
|
107
|
+
}, [e?.fields.length, e?.isExternallyOwned, S, o, b, t, x, C, p, r, u, c, f, E, F]);
|
|
107
108
|
return /* @__PURE__ */ n(Z, {
|
|
108
109
|
initialValues: z,
|
|
109
110
|
onSubmit: q,
|
|
@@ -129,15 +130,15 @@ const pe = ({
|
|
|
129
130
|
isLargeFile: s,
|
|
130
131
|
onToggleReviewFilter: V,
|
|
131
132
|
selectedTemplateInstance: e,
|
|
132
|
-
shouldShowOnlyReviewFields:
|
|
133
|
+
shouldShowOnlyReviewFields: f,
|
|
133
134
|
suggestions: $,
|
|
134
135
|
children: e && Q
|
|
135
|
-
}),
|
|
136
|
+
}), g && /* @__PURE__ */ n(pe, {
|
|
136
137
|
dirty: i,
|
|
137
|
-
onChange:
|
|
138
|
+
onChange: g,
|
|
138
139
|
values: a
|
|
139
140
|
}), /* @__PURE__ */ n(ce, {
|
|
140
|
-
onBackToEdit: () =>
|
|
141
|
+
onBackToEdit: () => h(!1),
|
|
141
142
|
onDiscardChanges: B,
|
|
142
143
|
open: k
|
|
143
144
|
}), /* @__PURE__ */ n(X, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "lodash/isEmpty";
|
|
2
1
|
import "lodash/isArray";
|
|
3
|
-
import
|
|
2
|
+
import "lodash/isEmpty";
|
|
4
3
|
import "../../../../constants.js";
|
|
4
|
+
import { c as m, g as i } from "../../../../../../chunks/utils.js";
|
|
5
5
|
export {
|
|
6
6
|
m as createJSONPatch,
|
|
7
7
|
i as getFormatedFieldValue
|
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
import { useFormikContext as M } from "formik";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { getFieldsNeedingReview as
|
|
5
|
-
import
|
|
2
|
+
import { useMemo as v } from "react";
|
|
3
|
+
import { useIntl as W } from "react-intl";
|
|
4
|
+
import { getFieldsNeedingReview as h } from "../../../../utils/confidence-score/get-fields-needing-review.js";
|
|
5
|
+
import T from "../../../interactive-header-text/interactive-header-text.js";
|
|
6
6
|
import { MetadataInstanceReviewNotice as g } from "../../../metadata-instance-review-notice/metadata-instance-review-notice.js";
|
|
7
|
-
import { MetadataInstanceFormAutofillButton as
|
|
8
|
-
import { MetadataInstanceFormInlineNotice as
|
|
9
|
-
import
|
|
10
|
-
import { jsxs as
|
|
11
|
-
import '../../../../../../styles/metadata-instance-form-header.css';const
|
|
12
|
-
metadataInstanceFormHeaderWrapper:
|
|
13
|
-
metadataInstanceFormHeader:
|
|
14
|
-
title:
|
|
15
|
-
},
|
|
7
|
+
import { MetadataInstanceFormAutofillButton as j } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
|
8
|
+
import { MetadataInstanceFormInlineNotice as k } from "../metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";
|
|
9
|
+
import w from "./messages.js";
|
|
10
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
11
|
+
import '../../../../../../styles/metadata-instance-form-header.css';const C = "_metadataInstanceFormHeaderWrapper_3nbmr_1", b = "_metadataInstanceFormHeader_3nbmr_1", q = "_title_3nbmr_15", a = {
|
|
12
|
+
metadataInstanceFormHeaderWrapper: C,
|
|
13
|
+
metadataInstanceFormHeader: b,
|
|
14
|
+
title: q
|
|
15
|
+
}, R = ({
|
|
16
16
|
areAiSuggestionsAvailable: r,
|
|
17
|
-
hasSuggestions:
|
|
18
|
-
isAdvancedExtractAgentEnabled:
|
|
19
|
-
isAiSuggestionsFeatureEnabled:
|
|
20
|
-
isBetaLanguageEnabled:
|
|
17
|
+
hasSuggestions: l,
|
|
18
|
+
isAdvancedExtractAgentEnabled: p = !1,
|
|
19
|
+
isAiSuggestionsFeatureEnabled: f,
|
|
20
|
+
isBetaLanguageEnabled: m,
|
|
21
21
|
isConfidenceScoreReviewEnabled: e = !1,
|
|
22
|
-
isLargeFile:
|
|
23
|
-
isLoading:
|
|
24
|
-
onToggleReviewFilter:
|
|
25
|
-
shouldShowOnlyReviewFields:
|
|
22
|
+
isLargeFile: I,
|
|
23
|
+
isLoading: o,
|
|
24
|
+
onToggleReviewFilter: n,
|
|
25
|
+
shouldShowOnlyReviewFields: s = !1,
|
|
26
26
|
templateName: F,
|
|
27
|
-
onAutofill:
|
|
27
|
+
onAutofill: H
|
|
28
28
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
values:
|
|
31
|
-
} = M(),
|
|
32
|
-
return /* @__PURE__ */
|
|
29
|
+
const u = W(), {
|
|
30
|
+
values: c
|
|
31
|
+
} = M(), i = v(() => e ? h(c.metadata?.fields ?? []).length : 0, [c.metadata?.fields, e]), N = F ?? u.formatMessage(w.customInstanceTitle), _ = l && r, x = e && !o && (i > 0 || s) && n !== void 0;
|
|
32
|
+
return /* @__PURE__ */ d("div", {
|
|
33
33
|
className: a.metadataInstanceFormHeaderWrapper,
|
|
34
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ d("div", {
|
|
35
35
|
className: a.metadataInstanceFormHeader,
|
|
36
|
-
children: [/* @__PURE__ */ t(
|
|
36
|
+
children: [/* @__PURE__ */ t(T, {
|
|
37
37
|
className: a.title,
|
|
38
38
|
title: N
|
|
39
|
-
}),
|
|
39
|
+
}), f ? /* @__PURE__ */ t(j, {
|
|
40
40
|
areAiSuggestionsAvailable: r,
|
|
41
|
-
isAdvancedExtractAgentEnabled:
|
|
42
|
-
isBetaLanguageEnabled:
|
|
43
|
-
isLoading:
|
|
44
|
-
onAutofill:
|
|
41
|
+
isAdvancedExtractAgentEnabled: p,
|
|
42
|
+
isBetaLanguageEnabled: m,
|
|
43
|
+
isLoading: o,
|
|
44
|
+
onAutofill: H
|
|
45
45
|
}) : null]
|
|
46
|
-
}), _ && /* @__PURE__ */ t(
|
|
47
|
-
isBetaLanguageEnabled:
|
|
48
|
-
isLargeFile:
|
|
46
|
+
}), _ && /* @__PURE__ */ t(k, {
|
|
47
|
+
isBetaLanguageEnabled: m,
|
|
48
|
+
isLargeFile: I
|
|
49
49
|
}), x && /* @__PURE__ */ t(g, {
|
|
50
|
-
fieldsNeedingReviewCount:
|
|
51
|
-
isLowScoreFilteringEnabled:
|
|
52
|
-
onTextToggleClick:
|
|
50
|
+
fieldsNeedingReviewCount: i,
|
|
51
|
+
isLowScoreFilteringEnabled: s,
|
|
52
|
+
onTextToggleClick: n
|
|
53
53
|
})]
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
R as MetadataInstanceFormHeader
|
|
58
58
|
};
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
import { C as t } from "../../../../chunks/types.js";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
return o(i.tooltipReviewedAndAccepted, {
|
|
10
|
-
score: r
|
|
11
|
-
});
|
|
12
|
-
switch (e.level) {
|
|
2
|
+
import o from "./messages.js";
|
|
3
|
+
function p(e, i) {
|
|
4
|
+
if (i.isAccepted && i.level === t.High)
|
|
5
|
+
return e(o.tooltipHighConfidence);
|
|
6
|
+
if (i.isAccepted)
|
|
7
|
+
return e(o.tooltipReviewedAndAccepted);
|
|
8
|
+
switch (i.level) {
|
|
13
9
|
case t.Low:
|
|
14
10
|
case t.Medium:
|
|
15
|
-
return o
|
|
16
|
-
score: r
|
|
17
|
-
});
|
|
11
|
+
return e(o.tooltipLowConfidence);
|
|
18
12
|
case t.High:
|
|
19
|
-
return o
|
|
20
|
-
score: r
|
|
21
|
-
});
|
|
13
|
+
return e(o.tooltipHighConfidence);
|
|
22
14
|
default:
|
|
23
15
|
return null;
|
|
24
16
|
}
|
|
25
17
|
}
|
|
26
18
|
export {
|
|
27
|
-
|
|
19
|
+
p as getConfidenceScoreTooltip
|
|
28
20
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as i } from "../../../../chunks/types.js";
|
|
2
|
+
import { isConfidenceScoreNeedingReview as r } from "./is-confidence-score-needing-review.js";
|
|
2
3
|
function c(n) {
|
|
3
|
-
return n.filter((e) =>
|
|
4
|
+
return n.filter((e) => e.hidden ? !1 : e.aiSuggestionConfidenceScore && e.aiSuggestionState === i.Pending ? !0 : !!e.confidenceScore && r(e.confidenceScore));
|
|
4
5
|
}
|
|
5
6
|
export {
|
|
6
7
|
c as getFieldsNeedingReview
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
const
|
|
2
|
+
const o = e({
|
|
3
3
|
tooltipLowConfidence: {
|
|
4
4
|
id: "metadataEditor.confidenceScore.tooltipLowConfidence",
|
|
5
|
-
defaultMessage: "Box AI returned low confidence
|
|
5
|
+
defaultMessage: "Box AI returned low confidence level for this extraction. Review the value."
|
|
6
6
|
},
|
|
7
7
|
tooltipReviewedAndAccepted: {
|
|
8
8
|
id: "metadataEditor.confidenceScore.tooltipReviewedAndAccepted",
|
|
9
|
-
defaultMessage: "Box AI returned low confidence
|
|
9
|
+
defaultMessage: "Box AI returned low confidence level for this extraction but it was accepted by a human."
|
|
10
10
|
},
|
|
11
11
|
tooltipHighConfidence: {
|
|
12
12
|
id: "metadataEditor.confidenceScore.tooltipHighConfidence",
|
|
13
|
-
defaultMessage: "Box AI returned high confidence
|
|
13
|
+
defaultMessage: "Box AI returned high confidence level for this extraction."
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
o as default
|
|
18
18
|
};
|
package/dist/i18n/bn-IN.js
CHANGED
|
@@ -47,14 +47,18 @@ export default {
|
|
|
47
47
|
"metadataEditor.addMetadataTemplate.customMetadataName": "কাস্টম মেটাডেটা",
|
|
48
48
|
"metadataEditor.addMetadataTemplate.search.placeholder": "টেমপ্লেট খুঁজুন",
|
|
49
49
|
"metadataEditor.addMetadataTemplate.trigger.label": "টেমপ্লেট যোগ করুন",
|
|
50
|
+
"metadataEditor.aiSuggestionField.acceptLabel": "Accept suggestion",
|
|
50
51
|
"metadataEditor.aiSuggestionField.aiSuggestionCaption": "Box AI পরামর্শ:",
|
|
51
52
|
"metadataEditor.aiSuggestionField.aiSuggestionCaptionWithLevel": "Box AI-র পরামর্শ ({level} আত্মবিশ্বাস)",
|
|
52
53
|
"metadataEditor.aiSuggestionField.aiSuggestionOptions": "বিকল্প",
|
|
53
54
|
"metadataEditor.aiSuggestionField.appendLabel": "সংযুক্ত করুন",
|
|
54
55
|
"metadataEditor.aiSuggestionField.clearAndReplaceLabel": "পরিষ্কার করুন এবং প্রতিস্থাপন করুন",
|
|
56
|
+
"metadataEditor.aiSuggestionField.confidenceLevelHigh": "High",
|
|
57
|
+
"metadataEditor.aiSuggestionField.confidenceLevelLow": "Low",
|
|
55
58
|
"metadataEditor.aiSuggestionField.dismissLabel": "নিশ্চিত করুন",
|
|
56
59
|
"metadataEditor.aiSuggestionField.ignoreLabel": "উপেক্ষা করুন",
|
|
57
60
|
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaption": "Box AI উপরের মতো একই মান প্রস্তাব করে",
|
|
61
|
+
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaptionWithLevel": "Box AI suggests the same value as above ({level} confidence)",
|
|
58
62
|
"metadataEditor.autofillButton.ariaLabel": "Box AI-এর মাধ্যমে অটোফিল করুন",
|
|
59
63
|
"metadataEditor.autofillButton.ariaLabelWithTemplateName": "Box AI দিয়ে {templateName} অটোফিল করুন",
|
|
60
64
|
"metadataEditor.autofillButton.tooltip.enhanced": "Box AI (বর্ধিত)-এর মাধ্যমে অটোফিল করুন",
|
package/dist/i18n/da-DK.js
CHANGED
|
@@ -47,14 +47,18 @@ export default {
|
|
|
47
47
|
"metadataEditor.addMetadataTemplate.customMetadataName": "Brugerdefineret metadata",
|
|
48
48
|
"metadataEditor.addMetadataTemplate.search.placeholder": "Søg efter skabeloner",
|
|
49
49
|
"metadataEditor.addMetadataTemplate.trigger.label": "Tilføj skabelon",
|
|
50
|
+
"metadataEditor.aiSuggestionField.acceptLabel": "Accept suggestion",
|
|
50
51
|
"metadataEditor.aiSuggestionField.aiSuggestionCaption": "Box AI",
|
|
51
52
|
"metadataEditor.aiSuggestionField.aiSuggestionCaptionWithLevel": "Box AI-forslag ({level} tillid)",
|
|
52
53
|
"metadataEditor.aiSuggestionField.aiSuggestionOptions": "Indstillingsmuligheder",
|
|
53
54
|
"metadataEditor.aiSuggestionField.appendLabel": "Tilføj",
|
|
54
55
|
"metadataEditor.aiSuggestionField.clearAndReplaceLabel": "Ryd og Erstat",
|
|
56
|
+
"metadataEditor.aiSuggestionField.confidenceLevelHigh": "High",
|
|
57
|
+
"metadataEditor.aiSuggestionField.confidenceLevelLow": "Low",
|
|
55
58
|
"metadataEditor.aiSuggestionField.dismissLabel": "Bekræft",
|
|
56
59
|
"metadataEditor.aiSuggestionField.ignoreLabel": "Ignorer",
|
|
57
60
|
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaption": "Box AI foreslår den samme værdi som ovenfor",
|
|
61
|
+
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaptionWithLevel": "Box AI suggests the same value as above ({level} confidence)",
|
|
58
62
|
"metadataEditor.autofillButton.ariaLabel": "Automatisk udfyldning med Box AI",
|
|
59
63
|
"metadataEditor.autofillButton.ariaLabelWithTemplateName": "Automatisk udfyldning af {templateName} med Box AI",
|
|
60
64
|
"metadataEditor.autofillButton.tooltip.enhanced": "Automatisk udfyldning med Box AI (Forbedret)",
|
package/dist/i18n/de-DE.js
CHANGED
|
@@ -47,14 +47,18 @@ export default {
|
|
|
47
47
|
"metadataEditor.addMetadataTemplate.customMetadataName": "Selbst definierte Metadaten",
|
|
48
48
|
"metadataEditor.addMetadataTemplate.search.placeholder": "Suchvorlagen",
|
|
49
49
|
"metadataEditor.addMetadataTemplate.trigger.label": "Vorlage hinzufügen",
|
|
50
|
+
"metadataEditor.aiSuggestionField.acceptLabel": "Accept suggestion",
|
|
50
51
|
"metadataEditor.aiSuggestionField.aiSuggestionCaption": "Box-AI-Vorschlag:",
|
|
51
52
|
"metadataEditor.aiSuggestionField.aiSuggestionCaptionWithLevel": "Box AI-Vorschlag ({level} Konfidenzniveau)",
|
|
52
53
|
"metadataEditor.aiSuggestionField.aiSuggestionOptions": "Optionen",
|
|
53
54
|
"metadataEditor.aiSuggestionField.appendLabel": "Anfügen",
|
|
54
55
|
"metadataEditor.aiSuggestionField.clearAndReplaceLabel": "Löschen und ersetzen",
|
|
56
|
+
"metadataEditor.aiSuggestionField.confidenceLevelHigh": "High",
|
|
57
|
+
"metadataEditor.aiSuggestionField.confidenceLevelLow": "Low",
|
|
55
58
|
"metadataEditor.aiSuggestionField.dismissLabel": "Bestätigen",
|
|
56
59
|
"metadataEditor.aiSuggestionField.ignoreLabel": "Ignorieren",
|
|
57
60
|
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaption": "Box AI schlägt denselben Wert wie oben vor",
|
|
61
|
+
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaptionWithLevel": "Box AI suggests the same value as above ({level} confidence)",
|
|
58
62
|
"metadataEditor.autofillButton.ariaLabel": "Automatisch ausfüllen mit Box AI",
|
|
59
63
|
"metadataEditor.autofillButton.ariaLabelWithTemplateName": "Mit Box KI automatisch ausfüllen {templateName}",
|
|
60
64
|
"metadataEditor.autofillButton.tooltip.enhanced": "Automatisch ausfüllen mit Box AI (erweitert)",
|
package/dist/i18n/en-AU.js
CHANGED
|
@@ -47,14 +47,18 @@ export default {
|
|
|
47
47
|
"metadataEditor.addMetadataTemplate.customMetadataName": "Custom Metadata",
|
|
48
48
|
"metadataEditor.addMetadataTemplate.search.placeholder": "Search templates",
|
|
49
49
|
"metadataEditor.addMetadataTemplate.trigger.label": "Add template",
|
|
50
|
+
"metadataEditor.aiSuggestionField.acceptLabel": "Accept suggestion",
|
|
50
51
|
"metadataEditor.aiSuggestionField.aiSuggestionCaption": "Box AI suggestion:",
|
|
51
52
|
"metadataEditor.aiSuggestionField.aiSuggestionCaptionWithLevel": "Box AI suggestion ({level} confidence)",
|
|
52
53
|
"metadataEditor.aiSuggestionField.aiSuggestionOptions": "Options",
|
|
53
54
|
"metadataEditor.aiSuggestionField.appendLabel": "Append",
|
|
54
55
|
"metadataEditor.aiSuggestionField.clearAndReplaceLabel": "Clear and Replace",
|
|
56
|
+
"metadataEditor.aiSuggestionField.confidenceLevelHigh": "High",
|
|
57
|
+
"metadataEditor.aiSuggestionField.confidenceLevelLow": "Low",
|
|
55
58
|
"metadataEditor.aiSuggestionField.dismissLabel": "Confirm",
|
|
56
59
|
"metadataEditor.aiSuggestionField.ignoreLabel": "Ignore",
|
|
57
60
|
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaption": "Box AI suggests the same value as above",
|
|
61
|
+
"metadataEditor.aiSuggestionField.sameValueAiSuggestionCaptionWithLevel": "Box AI suggests the same value as above ({level} confidence)",
|
|
58
62
|
"metadataEditor.autofillButton.ariaLabel": "Autofill with Box AI",
|
|
59
63
|
"metadataEditor.autofillButton.ariaLabelWithTemplateName": "Autofill {templateName} with Box AI",
|
|
60
64
|
"metadataEditor.autofillButton.tooltip.enhanced": "Autofill with Box AI (Enhanced)",
|