@box/metadata-editor 1.52.5 → 1.53.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/utils2.js +27 -26
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +81 -67
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +60 -59
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +24 -24
- package/dist/esm/lib/utils/confidence-score/get-fields-needing-review.js +4 -4
- package/dist/esm/lib/utils/confidence-score/index.js +10 -0
- package/dist/esm/lib/utils/confidence-score/is-confidence-score-needing-review.js +7 -0
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/components/metadata-editor-fields/types.d.ts +1 -0
- package/dist/types/lib/utils/confidence-score/index.d.ts +4 -0
- package/dist/types/lib/utils/confidence-score/is-confidence-score-needing-review.d.ts +2 -0
- package/package.json +1 -1
package/dist/chunks/utils2.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { BoxAiLogo as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { convertISOStringtoRFC3339String as
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import '../styles/utils.css';const
|
|
7
|
-
noAttributesText:
|
|
1
|
+
import { BoxAiLogo as b } from "@box/blueprint-web-assets/icons/Logo";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import _ from "../esm/lib/components/interactive-text/interactive-text.js";
|
|
4
|
+
import { convertISOStringtoRFC3339String as p } from "../esm/lib/utils/convertDate.js";
|
|
5
|
+
import { jsxs as d, jsx as s } from "react/jsx-runtime";
|
|
6
|
+
import '../styles/utils.css';const u = "_noAttributesText_6bzgt_2", m = "_fieldWrapper_6bzgt_6", x = "_hasSuggestion_6bzgt_11", T = "_hasConfidenceReview_6bzgt_16", f = "_dateField_6bzgt_44", z = "_suggestionApplied_6bzgt_48", h = "_labelWrapper_6bzgt_95", A = "_labelText_6bzgt_101", N = "_labelTruncated_6bzgt_104", S = "_labelIcon_6bzgt_111", l = {
|
|
7
|
+
noAttributesText: u,
|
|
8
8
|
fieldWrapper: m,
|
|
9
9
|
hasSuggestion: x,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
hasConfidenceReview: T,
|
|
11
|
+
dateField: f,
|
|
12
|
+
suggestionApplied: z,
|
|
12
13
|
labelWrapper: h,
|
|
13
14
|
labelText: A,
|
|
14
15
|
labelTruncated: N,
|
|
15
16
|
labelIcon: S
|
|
16
|
-
},
|
|
17
|
+
}, w = (t, e, a = !1, o = "label") => (c) => {
|
|
17
18
|
const {
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
20
|
-
} =
|
|
21
|
-
return /* @__PURE__ */
|
|
19
|
+
className: i,
|
|
20
|
+
...n
|
|
21
|
+
} = c, r = g(i || l.labelText, l.labelTruncated);
|
|
22
|
+
return /* @__PURE__ */ d("div", {
|
|
22
23
|
className: l.labelWrapper,
|
|
23
|
-
children: [e ? /* @__PURE__ */
|
|
24
|
+
children: [e ? /* @__PURE__ */ s(_, {
|
|
24
25
|
as: o,
|
|
25
|
-
className:
|
|
26
|
+
className: r,
|
|
26
27
|
tooltipText: e,
|
|
27
|
-
...
|
|
28
|
+
...n,
|
|
28
29
|
children: t
|
|
29
|
-
}) : /* @__PURE__ */
|
|
30
|
-
className:
|
|
31
|
-
...
|
|
30
|
+
}) : /* @__PURE__ */ s("label", {
|
|
31
|
+
className: r,
|
|
32
|
+
...n,
|
|
32
33
|
children: t
|
|
33
|
-
}),
|
|
34
|
+
}), a && /* @__PURE__ */ s(b, {
|
|
34
35
|
className: l.labelIcon
|
|
35
36
|
})]
|
|
36
37
|
});
|
|
37
|
-
},
|
|
38
|
+
}, R = (t) => {
|
|
38
39
|
try {
|
|
39
|
-
const e =
|
|
40
|
-
return isNaN(
|
|
40
|
+
const e = p(t), a = new Date(e);
|
|
41
|
+
return isNaN(a.getTime()) ? null : e;
|
|
41
42
|
} catch {
|
|
42
43
|
return null;
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
w as g,
|
|
47
48
|
l as s,
|
|
48
|
-
|
|
49
|
+
R as t
|
|
49
50
|
};
|
|
@@ -1,91 +1,105 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { A as
|
|
6
|
-
import { UpdateModeFieldWrapper as
|
|
7
|
-
import { editorFieldTypes as
|
|
1
|
+
import L from "clsx";
|
|
2
|
+
import { useFormikContext as T } from "formik";
|
|
3
|
+
import b from "lodash/isUndefined";
|
|
4
|
+
import { forwardRef as B, useCallback as r, useEffect as x, useMemo as q } from "react";
|
|
5
|
+
import { A as a } from "../../../../chunks/types.js";
|
|
6
|
+
import { UpdateModeFieldWrapper as z } from "./components/update-mode-field-wrapper/update-mode-field-wrapper.js";
|
|
7
|
+
import { editorFieldTypes as D } from "./editor-field-types.js";
|
|
8
8
|
import { s as l } from "../../../../chunks/utils2.js";
|
|
9
|
-
import { jsx as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { jsx as g, jsxs as G } from "react/jsx-runtime";
|
|
10
|
+
import { isConfidenceScoreNeedingReview as H } from "../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
11
|
+
import { AiSuggestionField as J } from "./components/ai-suggestion-field/ai-suggestion-field.js";
|
|
12
|
+
import { LowConfidenceSuggestionField as K } from "./components/low-confidence-suggestion-field/low-confidence-suggestion-field.js";
|
|
13
|
+
const ae = /* @__PURE__ */ B(({
|
|
14
|
+
disableForm: y,
|
|
15
|
+
portalElement: h,
|
|
14
16
|
field: e,
|
|
15
|
-
index:
|
|
16
|
-
taxonomyOptionsFetcher:
|
|
17
|
-
isExternallyOwned:
|
|
18
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
19
|
-
|
|
17
|
+
index: M,
|
|
18
|
+
taxonomyOptionsFetcher: v,
|
|
19
|
+
isExternallyOwned: C,
|
|
20
|
+
isMultilevelTaxonomyFieldEnabled: w,
|
|
21
|
+
isConfidenceScoreReviewEnabled: I = !1
|
|
22
|
+
}, N) => {
|
|
20
23
|
const {
|
|
21
|
-
setFieldValue:
|
|
22
|
-
} =
|
|
24
|
+
setFieldValue: o
|
|
25
|
+
} = T(), m = e.aiSuggestionState || a.Initial, n = m === a.Pending, V = m === a.Applied, $ = m === a.Initial, f = D[e.type], {
|
|
23
26
|
aiSuggestion: t,
|
|
24
|
-
type:
|
|
25
|
-
value:
|
|
26
|
-
} = e,
|
|
27
|
-
[l.suggestionApplied]:
|
|
28
|
-
[l.hasSuggestion]:
|
|
29
|
-
[l.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
type: d,
|
|
28
|
+
value: p
|
|
29
|
+
} = e, R = f && !e.hidden, W = !b(e.updateMode), i = `metadata.fields[${M}]`, k = e.type === "taxonomy" && e.optionsRules?.multiSelect, u = I && !!e.confidenceScore && H(e.confidenceScore), P = L({
|
|
30
|
+
[l.suggestionApplied]: V,
|
|
31
|
+
[l.hasSuggestion]: n,
|
|
32
|
+
[l.hasConfidenceReview]: !n && u,
|
|
33
|
+
[l.dateField]: d === "date"
|
|
34
|
+
}), c = r((s) => {
|
|
35
|
+
o(`${i}.aiSuggestionState`, s);
|
|
36
|
+
}, [i, o]), S = r((s) => {
|
|
37
|
+
o(`${i}.value`, s), c(a.Applied);
|
|
38
|
+
}, [i, o, c]), A = r(() => {
|
|
39
|
+
c(a.Initial), o(`${i}.aiSuggestion`, void 0);
|
|
40
|
+
}, [c, o, i]), E = r(() => {
|
|
41
|
+
o(`${i}.confidenceScore.isAccepted`, !0);
|
|
42
|
+
}, [i, o]), U = r(() => {
|
|
43
|
+
const s = d === "multiSelect" || d === "taxonomy" ? [] : "";
|
|
44
|
+
o(`${i}.value`, s), o(`${i}.confidenceScore`, void 0);
|
|
45
|
+
}, [i, o, d]), F = r(() => {
|
|
46
|
+
A(), u && o(`${i}.confidenceScore`, void 0);
|
|
47
|
+
}, [A, u, o, i]);
|
|
48
|
+
x(() => {
|
|
49
|
+
n && (!p || Array.isArray(p) && p.length === 0) && S(t);
|
|
50
|
+
}, [t, n, S]), x(() => {
|
|
51
|
+
$ && t && c(a.Pending);
|
|
52
|
+
}, [$, t, c]);
|
|
53
|
+
const j = q(() => t && p === t, [n]);
|
|
54
|
+
return R ? W ? /* @__PURE__ */ g(z, {
|
|
44
55
|
fieldNamePrefix: i,
|
|
45
56
|
fieldType: e.type,
|
|
46
|
-
isTaxonomyMultiSelect:
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
ref:
|
|
57
|
+
isTaxonomyMultiSelect: k,
|
|
58
|
+
children: /* @__PURE__ */ g(f, {
|
|
59
|
+
ref: N,
|
|
49
60
|
description: e.description,
|
|
50
|
-
disableForm:
|
|
61
|
+
disableForm: y,
|
|
51
62
|
fieldNamePrefix: i,
|
|
52
63
|
isAiSuggestionApplied: !1,
|
|
53
|
-
isExternallyOwned:
|
|
54
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
64
|
+
isExternallyOwned: C,
|
|
65
|
+
isMultilevelTaxonomyFieldEnabled: w,
|
|
55
66
|
label: e.displayName,
|
|
56
67
|
levels: e.levels,
|
|
57
|
-
onValueEdited:
|
|
58
|
-
portalElement:
|
|
59
|
-
taxonomyOptionsFetcher:
|
|
68
|
+
onValueEdited: F,
|
|
69
|
+
portalElement: h,
|
|
70
|
+
taxonomyOptionsFetcher: v
|
|
60
71
|
})
|
|
61
|
-
}, e.key) : /* @__PURE__ */
|
|
72
|
+
}, e.key) : /* @__PURE__ */ G("div", {
|
|
62
73
|
className: l.fieldWrapper,
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
-
ref:
|
|
65
|
-
className:
|
|
74
|
+
children: [/* @__PURE__ */ g(f, {
|
|
75
|
+
ref: N,
|
|
76
|
+
className: P,
|
|
66
77
|
description: e.description,
|
|
67
|
-
disableForm:
|
|
78
|
+
disableForm: y,
|
|
68
79
|
fieldNamePrefix: i,
|
|
69
|
-
isAiSuggestionApplied:
|
|
70
|
-
isExternallyOwned:
|
|
71
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
80
|
+
isAiSuggestionApplied: V,
|
|
81
|
+
isExternallyOwned: C,
|
|
82
|
+
isMultilevelTaxonomyFieldEnabled: w,
|
|
72
83
|
label: e.displayName,
|
|
73
|
-
onValueEdited:
|
|
74
|
-
portalElement:
|
|
75
|
-
taxonomyOptionsFetcher:
|
|
76
|
-
}),
|
|
84
|
+
onValueEdited: F,
|
|
85
|
+
portalElement: h,
|
|
86
|
+
taxonomyOptionsFetcher: v
|
|
87
|
+
}), n && /* @__PURE__ */ g(J, {
|
|
77
88
|
aiSuggestion: t,
|
|
78
|
-
isSameValue:
|
|
89
|
+
isSameValue: j,
|
|
79
90
|
onAiSuggestionAppend: () => {
|
|
80
|
-
const
|
|
81
|
-
|
|
91
|
+
const s = [...new Set([p, t].flat().filter(Boolean))];
|
|
92
|
+
S(s);
|
|
82
93
|
},
|
|
83
|
-
onAiSuggestionIgnore:
|
|
84
|
-
onAiSuggestionReplace: () =>
|
|
85
|
-
type:
|
|
94
|
+
onAiSuggestionIgnore: A,
|
|
95
|
+
onAiSuggestionReplace: () => S(t),
|
|
96
|
+
type: d
|
|
97
|
+
}), !n && u && /* @__PURE__ */ g(K, {
|
|
98
|
+
onAccept: E,
|
|
99
|
+
onClear: U
|
|
86
100
|
})]
|
|
87
101
|
}, e.key) : null;
|
|
88
102
|
});
|
|
89
103
|
export {
|
|
90
|
-
|
|
104
|
+
ae as MetadataEditorFieldWrapper
|
|
91
105
|
};
|
|
@@ -5,7 +5,7 @@ import "../metadata-instance-form-header/metadata-instance-form-header.js";
|
|
|
5
5
|
import Q from "clsx";
|
|
6
6
|
import { Formik as X, Form as Y } from "formik";
|
|
7
7
|
import Z from "lodash/isEqual";
|
|
8
|
-
import { useState as
|
|
8
|
+
import { useState as S, useEffect as x, useRef as D, useMemo as ee } from "react";
|
|
9
9
|
import { TEMPLATE_CUSTOM_PROPERTIES as te } from "../../../../constants.js";
|
|
10
10
|
import { useAutofill as ae } from "../../../../utils/autofill-context.js";
|
|
11
11
|
import { TemplateInstance as ne } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
|
@@ -13,15 +13,15 @@ import { MetadataEmptyState as oe } from "../../../metadata-empty-state/metadata
|
|
|
13
13
|
import { AutofillOverlay as se } from "../autofill-overlay/autofill-overlay.js";
|
|
14
14
|
import { CustomInstance as re } from "../custom-instance/custom-instance.js";
|
|
15
15
|
import { c as ie } from "../../../../../../chunks/utils.js";
|
|
16
|
-
import { s as
|
|
17
|
-
import { jsx as n, jsxs as
|
|
16
|
+
import { s as f, M as le } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
|
|
17
|
+
import { jsx as n, jsxs as v } from "react/jsx-runtime";
|
|
18
18
|
import { UnsavedChangesModal as me } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
|
|
19
19
|
const de = ({
|
|
20
20
|
dirty: i,
|
|
21
21
|
onChange: l,
|
|
22
22
|
values: t
|
|
23
23
|
}) => {
|
|
24
|
-
const s =
|
|
24
|
+
const s = D(t);
|
|
25
25
|
return i && !Z(s.current.metadata.fields, t.metadata.fields) && (s.current = t, l(t)), null;
|
|
26
26
|
}, we = (i) => {
|
|
27
27
|
const {
|
|
@@ -30,51 +30,51 @@ const de = ({
|
|
|
30
30
|
isLargeFile: s,
|
|
31
31
|
errorCode: m,
|
|
32
32
|
isAiSuggestionsFeatureEnabled: d,
|
|
33
|
-
isAdvancedExtractAgentEnabled:
|
|
34
|
-
isBetaLanguageEnabled:
|
|
35
|
-
isDeleteButtonDisabled:
|
|
36
|
-
isDeleteConfirmationModalCheckboxEnabled:
|
|
37
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
38
|
-
isUnsavedChangesModalOpen:
|
|
39
|
-
MetadataInstanceFormCustomWrapper:
|
|
33
|
+
isAdvancedExtractAgentEnabled: I = !1,
|
|
34
|
+
isBetaLanguageEnabled: w,
|
|
35
|
+
isDeleteButtonDisabled: A,
|
|
36
|
+
isDeleteConfirmationModalCheckboxEnabled: R,
|
|
37
|
+
isMultilevelTaxonomyFieldEnabled: p,
|
|
38
|
+
isUnsavedChangesModalOpen: T = !1,
|
|
39
|
+
MetadataInstanceFormCustomWrapper: L,
|
|
40
40
|
selectedTemplateInstance: e,
|
|
41
|
-
onCancel:
|
|
42
|
-
onChange:
|
|
43
|
-
onDelete:
|
|
44
|
-
onDiscardUnsavedChanges:
|
|
45
|
-
onSubmit:
|
|
46
|
-
onToggleReviewFilter:
|
|
47
|
-
setIsUnsavedChangesModalOpen:
|
|
48
|
-
shouldShowOnlyReviewFields:
|
|
49
|
-
taxonomyOptionsFetcher:
|
|
50
|
-
isConfidenceScoreReviewEnabled:
|
|
51
|
-
} = i, K =
|
|
41
|
+
onCancel: k,
|
|
42
|
+
onChange: u,
|
|
43
|
+
onDelete: N,
|
|
44
|
+
onDiscardUnsavedChanges: P,
|
|
45
|
+
onSubmit: U,
|
|
46
|
+
onToggleReviewFilter: B,
|
|
47
|
+
setIsUnsavedChangesModalOpen: g,
|
|
48
|
+
shouldShowOnlyReviewFields: h = !1,
|
|
49
|
+
taxonomyOptionsFetcher: E,
|
|
50
|
+
isConfidenceScoreReviewEnabled: c = !1
|
|
51
|
+
} = i, K = L ?? le, [V, C] = S(!1), {
|
|
52
52
|
isFetchingSuggestions: o,
|
|
53
|
-
isLongLoading:
|
|
53
|
+
isLongLoading: F,
|
|
54
54
|
getAiSuggestions: W,
|
|
55
|
-
clearState:
|
|
55
|
+
clearState: b,
|
|
56
56
|
suggestions: j
|
|
57
57
|
} = ae();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
const
|
|
62
|
-
await
|
|
58
|
+
x(() => () => {
|
|
59
|
+
b();
|
|
60
|
+
}, [b, e?.id]);
|
|
61
|
+
const y = e?.templateKey === te, _ = async (a) => {
|
|
62
|
+
await U(a, ie(a, e));
|
|
63
63
|
}, $ = (a) => {
|
|
64
|
-
a ?
|
|
64
|
+
a ? g(!0) : k();
|
|
65
65
|
}, q = () => {
|
|
66
|
-
|
|
66
|
+
C(!0);
|
|
67
67
|
}, J = {
|
|
68
68
|
metadata: {
|
|
69
69
|
...e
|
|
70
70
|
}
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
z(t ??
|
|
71
|
+
}, M = D(null), [O, z] = S(null);
|
|
72
|
+
x(() => {
|
|
73
|
+
z(t ?? M.current);
|
|
74
74
|
}, [t, e?.templateKey, e?.scope]);
|
|
75
75
|
const G = ee(() => {
|
|
76
76
|
const a = e?.fields.length === 0;
|
|
77
|
-
if (
|
|
77
|
+
if (y)
|
|
78
78
|
return /* @__PURE__ */ n(re, {
|
|
79
79
|
isLoading: o
|
|
80
80
|
});
|
|
@@ -84,61 +84,62 @@ const de = ({
|
|
|
84
84
|
level: "instance"
|
|
85
85
|
});
|
|
86
86
|
const r = !!(o || m);
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
className: Q(
|
|
87
|
+
return /* @__PURE__ */ v("div", {
|
|
88
|
+
className: Q(f.metadataInstanceFormContent, r && f.showOverlay),
|
|
89
89
|
children: [/* @__PURE__ */ n(se, {
|
|
90
90
|
errorCode: m,
|
|
91
91
|
isFetchingSuggestions: o,
|
|
92
|
-
isLongLoading:
|
|
92
|
+
isLongLoading: F
|
|
93
93
|
}), /* @__PURE__ */ n(ne, {
|
|
94
94
|
disableForm: o,
|
|
95
|
+
isConfidenceScoreReviewEnabled: c,
|
|
95
96
|
isExternallyOwned: e?.isExternallyOwned,
|
|
96
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
97
|
-
portalElement: t ??
|
|
98
|
-
taxonomyOptionsFetcher:
|
|
97
|
+
isMultilevelTaxonomyFieldEnabled: p,
|
|
98
|
+
portalElement: t ?? O,
|
|
99
|
+
taxonomyOptionsFetcher: E
|
|
99
100
|
})]
|
|
100
101
|
});
|
|
101
|
-
}, [e?.fields.length, e?.isExternallyOwned,
|
|
102
|
+
}, [e?.fields.length, e?.isExternallyOwned, y, o, F, t, O, E, d, c, p, m, h]);
|
|
102
103
|
return /* @__PURE__ */ n(X, {
|
|
103
104
|
initialValues: J,
|
|
104
105
|
onSubmit: _,
|
|
105
106
|
children: ({
|
|
106
107
|
values: a,
|
|
107
108
|
dirty: r
|
|
108
|
-
}) => /* @__PURE__ */
|
|
109
|
+
}) => /* @__PURE__ */ v(Y, {
|
|
109
110
|
children: [/* @__PURE__ */ n(K, {
|
|
110
111
|
areAiSuggestionsAvailable: l,
|
|
111
|
-
className:
|
|
112
|
-
formRef:
|
|
112
|
+
className: f.metadataInstanceForm,
|
|
113
|
+
formRef: M,
|
|
113
114
|
formValues: a,
|
|
114
115
|
getAiSuggestions: W,
|
|
115
116
|
handleCancel: $,
|
|
116
117
|
handleDelete: q,
|
|
117
|
-
isAdvancedExtractAgentEnabled:
|
|
118
|
+
isAdvancedExtractAgentEnabled: I,
|
|
118
119
|
isAiSuggestionsFeatureEnabled: d,
|
|
119
|
-
isBetaLanguageEnabled:
|
|
120
|
-
isConfidenceScoreReviewEnabled:
|
|
121
|
-
isDeleteButtonDisabled:
|
|
120
|
+
isBetaLanguageEnabled: w,
|
|
121
|
+
isConfidenceScoreReviewEnabled: c,
|
|
122
|
+
isDeleteButtonDisabled: A,
|
|
122
123
|
isFetchingSuggestions: o,
|
|
123
124
|
isFormDirty: r,
|
|
124
125
|
isLargeFile: s,
|
|
125
|
-
onToggleReviewFilter:
|
|
126
|
+
onToggleReviewFilter: B,
|
|
126
127
|
selectedTemplateInstance: e,
|
|
127
|
-
shouldShowOnlyReviewFields:
|
|
128
|
+
shouldShowOnlyReviewFields: h,
|
|
128
129
|
suggestions: j,
|
|
129
130
|
children: e && G
|
|
130
|
-
}),
|
|
131
|
+
}), u && /* @__PURE__ */ n(de, {
|
|
131
132
|
dirty: r,
|
|
132
|
-
onChange:
|
|
133
|
+
onChange: u,
|
|
133
134
|
values: a
|
|
134
135
|
}), /* @__PURE__ */ n(me, {
|
|
135
|
-
onBackToEdit: () =>
|
|
136
|
-
onDiscardChanges:
|
|
137
|
-
open:
|
|
136
|
+
onBackToEdit: () => g(!1),
|
|
137
|
+
onDiscardChanges: P,
|
|
138
|
+
open: T
|
|
138
139
|
}), /* @__PURE__ */ n(H, {
|
|
139
|
-
isCheckboxEnabled:
|
|
140
|
-
onConfirm: () =>
|
|
141
|
-
onDismiss: () =>
|
|
140
|
+
isCheckboxEnabled: R,
|
|
141
|
+
onConfirm: () => N(e),
|
|
142
|
+
onDismiss: () => C(!1),
|
|
142
143
|
open: V,
|
|
143
144
|
templateName: e?.displayName
|
|
144
145
|
})]
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Tooltip as
|
|
1
|
+
import { Tooltip as _, Status as g, Text as h } from "@box/blueprint-web";
|
|
2
2
|
import { AlertCircle as x } from "@box/blueprint-web-assets/icons/Medium";
|
|
3
3
|
import { useIntl as C, FormattedDate as T } from "react-intl";
|
|
4
4
|
import { convertISOStringToUTCDate as b } from "../../../../utils/convertDate.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { MetadataEntryDisplay as L } from "./metadata-entry-display.js";
|
|
9
|
-
import A from "./messages.js";
|
|
5
|
+
import D from "../../../interactive-text/interactive-text.js";
|
|
6
|
+
import { MetadataEntryDisplay as E } from "./metadata-entry-display.js";
|
|
7
|
+
import v from "./messages.js";
|
|
10
8
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { isConfidenceScoreNeedingReview as L } from "../../../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
10
|
+
import { getConfidenceScoreTooltip as N } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
|
|
11
|
+
import '../../../../../../styles/metadata-instance-entry.css';const A = "_metadataInstanceEntry_fr9av_1", M = "_name_fr9av_6", j = "_labelContainer_fr9av_14", w = "_confidenceScoreIcon_fr9av_20", n = {
|
|
12
|
+
metadataInstanceEntry: A,
|
|
13
|
+
name: M,
|
|
14
14
|
labelContainer: j,
|
|
15
|
-
confidenceScoreIcon:
|
|
16
|
-
},
|
|
15
|
+
confidenceScoreIcon: w
|
|
16
|
+
}, K = ({
|
|
17
17
|
description: o,
|
|
18
18
|
name: a,
|
|
19
19
|
shouldHideEmptyValues: f,
|
|
@@ -23,10 +23,10 @@ import '../../../../../../styles/metadata-instance-entry.css';const M = "_metada
|
|
|
23
23
|
taxonomyKey: p,
|
|
24
24
|
scope: u,
|
|
25
25
|
isExternallyOwned: y,
|
|
26
|
-
confidenceScore:
|
|
26
|
+
confidenceScore: r,
|
|
27
27
|
isConfidenceScoreReviewEnabled: S = !1
|
|
28
28
|
}) => {
|
|
29
|
-
const i = C(), s = S && !!
|
|
29
|
+
const i = C(), s = S && !!r && L(r) ? N(i.formatMessage, r) : null, l = (() => {
|
|
30
30
|
if (typeof t == "number")
|
|
31
31
|
return t.toString();
|
|
32
32
|
if (!t)
|
|
@@ -45,27 +45,27 @@ import '../../../../../../styles/metadata-instance-entry.css';const M = "_metada
|
|
|
45
45
|
return t;
|
|
46
46
|
})();
|
|
47
47
|
return f && !l ? null : /* @__PURE__ */ m("div", {
|
|
48
|
-
className:
|
|
48
|
+
className: n.metadataInstanceEntry,
|
|
49
49
|
children: [/* @__PURE__ */ m("div", {
|
|
50
|
-
className:
|
|
51
|
-
children: [s && /* @__PURE__ */ e(
|
|
50
|
+
className: n.labelContainer,
|
|
51
|
+
children: [s && /* @__PURE__ */ e(_, {
|
|
52
52
|
content: s,
|
|
53
53
|
children: /* @__PURE__ */ e("span", {
|
|
54
|
-
className:
|
|
55
|
-
children: /* @__PURE__ */ e(
|
|
54
|
+
className: n.confidenceScoreIcon,
|
|
55
|
+
children: /* @__PURE__ */ e(g, {
|
|
56
56
|
color: "SurfaceStatusSurfaceGray",
|
|
57
57
|
hideText: !0,
|
|
58
58
|
icon: x,
|
|
59
59
|
interactive: !0,
|
|
60
|
-
text: i.formatMessage(
|
|
60
|
+
text: i.formatMessage(v.confidenceScoreIconAriaLabel)
|
|
61
61
|
})
|
|
62
62
|
})
|
|
63
|
-
}), /* @__PURE__ */ e(
|
|
63
|
+
}), /* @__PURE__ */ e(h, {
|
|
64
64
|
as: "h5",
|
|
65
65
|
color: "textOnLightSecondary",
|
|
66
66
|
variant: "bodyDefaultBold",
|
|
67
|
-
className:
|
|
68
|
-
children: o ? /* @__PURE__ */ e(
|
|
67
|
+
className: n.name,
|
|
68
|
+
children: o ? /* @__PURE__ */ e(D, {
|
|
69
69
|
as: "span",
|
|
70
70
|
color: "textOnLightSecondary",
|
|
71
71
|
tooltipText: o,
|
|
@@ -73,7 +73,7 @@ import '../../../../../../styles/metadata-instance-entry.css';const M = "_metada
|
|
|
73
73
|
children: a
|
|
74
74
|
}) : a
|
|
75
75
|
})]
|
|
76
|
-
}), /* @__PURE__ */ e(
|
|
76
|
+
}), /* @__PURE__ */ e(E, {
|
|
77
77
|
formattedValue: l,
|
|
78
78
|
isExternallyOwned: y,
|
|
79
79
|
scope: u,
|
|
@@ -85,5 +85,5 @@ import '../../../../../../styles/metadata-instance-entry.css';const M = "_metada
|
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
87
|
export {
|
|
88
|
-
|
|
88
|
+
K as MetadataInstanceEntry
|
|
89
89
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { isConfidenceScoreNeedingReview as i } from "./is-confidence-score-needing-review.js";
|
|
2
|
+
function c(n) {
|
|
3
|
+
return n.filter((e) => !e.hidden && !!e.confidenceScore && i(e.confidenceScore));
|
|
4
4
|
}
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as getFieldsNeedingReview
|
|
7
7
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { formatConfidenceScorePercent as r } from "./format-confidence-score-percent.js";
|
|
2
|
+
import { getConfidenceScoreTooltip as n } from "./get-confidence-score-tooltip.js";
|
|
3
|
+
import { getFieldsNeedingReview as f } from "./get-fields-needing-review.js";
|
|
4
|
+
import { isConfidenceScoreNeedingReview as d } from "./is-confidence-score-needing-review.js";
|
|
5
|
+
export {
|
|
6
|
+
r as formatConfidenceScorePercent,
|
|
7
|
+
n as getConfidenceScoreTooltip,
|
|
8
|
+
f as getFieldsNeedingReview,
|
|
9
|
+
d as isConfidenceScoreNeedingReview
|
|
10
|
+
};
|
package/dist/styles/utils.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._noAttributesText_6bzgt_2{text-align:center}._fieldWrapper_6bzgt_6{position:relative;isolation:isolate}._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>input,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>button,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>div[role=group]>div,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>div>div,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>div>input,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>input,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>button,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div[role=group]>div,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>div,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>input{border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>input:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>button:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>div[role=group]>div:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>div>div:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11>div>input:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>input:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>button:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div[role=group]>div:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>div:not(:disabled,:focus-visible,._error_6bzgt_25):hover,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>input:not(:disabled,:focus-visible,._error_6bzgt_25):hover{border-bottom:none}._fieldWrapper_6bzgt_6 ._hasSuggestion_6bzgt_11 div[role=group]>div,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16 div[role=group]>div{margin-right:var(--bp-border-01);margin-left:var(--bp-border-01)}._fieldWrapper_6bzgt_6 ._dateField_6bzgt_44>div[role=group]>div{padding-inline:var(--bp-space-030)}._fieldWrapper_6bzgt_6 ._suggestionApplied_6bzgt_48>._comboboxContainer_6bzgt_48,._fieldWrapper_6bzgt_6 ._suggestionApplied_6bzgt_48>input,._fieldWrapper_6bzgt_6 ._suggestionApplied_6bzgt_48>button,._fieldWrapper_6bzgt_6 ._suggestionApplied_6bzgt_48>div[role=group]>div,._fieldWrapper_6bzgt_6 ._suggestionApplied_6bzgt_48>div>div,._fieldWrapper_6bzgt_6 ._suggestionApplied_6bzgt_48>div>input{box-sizing:border-box!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:double var(--bp-border-01) transparent!important;outline:none;border-radius:var(--bp-radius-03)}._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>._comboboxContainer_6bzgt_48,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>input,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>button,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div[role=group]>div,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>div,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>input{box-sizing:border-box!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:double var(--bp-border-01) transparent!important;outline:none;border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important;padding-top:var(--bp-border-01)!important}._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>input:focus-visible,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>button:focus-visible,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div[role=group]>div:focus-within,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>div:focus-within,._fieldWrapper_6bzgt_6 ._hasConfidenceReview_6bzgt_16>div>input:focus-visible{background:#fff!important;border-style:solid!important;border-width:.125rem!important;border-color:#2486fc!important;border-bottom:none!important;padding-top:0!important;outline:0}._labelWrapper_6bzgt_95{display:flex;align-items:baseline;justify-content:space-between;width:100%}._labelWrapper_6bzgt_95 ._labelText_6bzgt_101{flex:unset!important}._labelWrapper_6bzgt_95 ._labelTruncated_6bzgt_104{flex:0 1 auto!important;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._labelWrapper_6bzgt_95 ._labelIcon_6bzgt_111{flex-shrink:0;width:var(--bp-space-040);height:var(--bp-space-040);margin-inline:var(--bp-space-030)}
|
|
@@ -7,6 +7,7 @@ export type TemplateInstanceProps = {
|
|
|
7
7
|
taxonomyOptionsFetcher: TaxonomyOptionsFetcher;
|
|
8
8
|
isExternallyOwned?: boolean;
|
|
9
9
|
isMultilevelTaxonomyFieldEnabled: boolean;
|
|
10
|
+
isConfidenceScoreReviewEnabled?: boolean;
|
|
10
11
|
};
|
|
11
12
|
export type MetadataFieldProps = {
|
|
12
13
|
description?: string | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { formatConfidenceScorePercent } from './format-confidence-score-percent';
|
|
2
|
+
export { getConfidenceScoreTooltip } from './get-confidence-score-tooltip';
|
|
3
|
+
export { getFieldsNeedingReview } from './get-fields-needing-review';
|
|
4
|
+
export { isConfidenceScoreNeedingReview } from './is-confidence-score-needing-review';
|