@box/metadata-editor 1.73.2 → 1.73.4
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 +6 -4
- package/dist/chunks/metadata-instance-entry.js +59 -59
- package/dist/chunks/metadata-instance-list.js +2 -1
- package/dist/chunks/metadata-instance.js +14 -13
- package/dist/chunks/utils.js +13 -17
- package/dist/chunks/utils2.js +20 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +27 -15
- package/dist/esm/lib/components/metadata-editor-fields/messages.js +10 -4
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +133 -136
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +86 -84
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +1 -0
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/json/src/lib/components/metadata-editor-fields/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.d.ts +1 -2
- package/dist/types/lib/components/metadata-editor-fields/messages.d.ts +5 -0
- package/dist/types/lib/components/metadata-editor-fields/types.d.ts +1 -0
- package/dist/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +1 -0
- package/dist/types/lib/components/metadata-instance-list/metadata-instance-list.d.ts +1 -1
- package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.d.ts +1 -1
- package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance/types.d.ts +1 -0
- package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.d.ts +1 -1
- package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/types.d.ts +1 -0
- package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.d.ts +1 -1
- package/dist/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/types.d.ts +1 -0
- package/dist/types/lib/components/metadata-instance-list/types.d.ts +1 -0
- package/dist/types/lib/types.d.ts +1 -0
- package/package.json +11 -11
|
@@ -5,13 +5,14 @@ import r from "clsx";
|
|
|
5
5
|
import '../styles/metadata-instance-content.css';var i = {
|
|
6
6
|
metadataInstanceContent: "_metadataInstanceContent_1cb0f_1",
|
|
7
7
|
metadataInstanceContentReducedGap: "_metadataInstanceContentReducedGap_1cb0f_7"
|
|
8
|
-
}, a = ({ onSelectMetadataField: a, selectedMetadataFieldId: o, shouldHideEmptyValues: s, templateInstance: c, taxonomyNodeFetcher: l, isConfidenceScoreReviewEnabled: u }) => {
|
|
9
|
-
let { fields:
|
|
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) => {
|
|
10
10
|
let r = a ? () => a(t) : void 0;
|
|
11
11
|
return /* @__PURE__ */ n(e, {
|
|
12
12
|
confidenceScore: t.confidenceScore,
|
|
13
13
|
description: t.description,
|
|
14
14
|
isConfidenceScoreReviewEnabled: u,
|
|
15
|
+
isBoundingBoxEnabled: d,
|
|
15
16
|
isExternallyOwned: c.isExternallyOwned,
|
|
16
17
|
isSelected: o === t.id,
|
|
17
18
|
name: t.displayName || t.key,
|
|
@@ -25,8 +26,9 @@ import '../styles/metadata-instance-content.css';var i = {
|
|
|
25
26
|
targetLocation: t.targetLocation
|
|
26
27
|
}, t.id);
|
|
27
28
|
}), [
|
|
28
|
-
|
|
29
|
+
f,
|
|
29
30
|
u,
|
|
31
|
+
d,
|
|
30
32
|
a,
|
|
31
33
|
o,
|
|
32
34
|
s,
|
|
@@ -35,7 +37,7 @@ import '../styles/metadata-instance-content.css';var i = {
|
|
|
35
37
|
]);
|
|
36
38
|
return /* @__PURE__ */ n("div", {
|
|
37
39
|
className: r(i.metadataInstanceContent, u && i.metadataInstanceContentReducedGap),
|
|
38
|
-
children:
|
|
40
|
+
children: p
|
|
39
41
|
});
|
|
40
42
|
};
|
|
41
43
|
export { a as t };
|
|
@@ -8,97 +8,97 @@ import { t as o } from "./shared-field-styles.module.js";
|
|
|
8
8
|
import { convertISOStringToUTCDate as s } from "../esm/lib/utils/convertDate.js";
|
|
9
9
|
import { t as c } from "./interactive-text.module.js";
|
|
10
10
|
import l from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";
|
|
11
|
-
import { MetadataEntryDisplay as
|
|
12
|
-
import { Status as
|
|
13
|
-
import { useRef as
|
|
14
|
-
import { FormattedDate as
|
|
15
|
-
import { Focusable as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import
|
|
18
|
-
import { AlertCircle as
|
|
19
|
-
import '../styles/metadata-instance-entry.css';var
|
|
11
|
+
import { MetadataEntryDisplay as ee } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
|
|
12
|
+
import { Status as u, Text as d, Tooltip as f, useIsEllipsized as p } from "@box/blueprint-web";
|
|
13
|
+
import { useRef as m } from "react";
|
|
14
|
+
import { FormattedDate as h, useIntl as g } from "react-intl";
|
|
15
|
+
import { Focusable as _ } from "@ariakit/react";
|
|
16
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
17
|
+
import b from "clsx";
|
|
18
|
+
import { AlertCircle as x } from "@box/blueprint-web-assets/icons/Medium";
|
|
19
|
+
import '../styles/metadata-instance-entry.css';var S = {
|
|
20
20
|
metadataInstanceEntry: "_metadataInstanceEntry_1ygbk_1",
|
|
21
21
|
name: "_name_1ygbk_6",
|
|
22
22
|
nameText: "_nameText_1ygbk_13",
|
|
23
23
|
labelContainer: "_labelContainer_1ygbk_21",
|
|
24
24
|
nameLabel: "_nameLabel_1ygbk_28",
|
|
25
25
|
confidenceScoreIcon: "_confidenceScoreIcon_1ygbk_43"
|
|
26
|
-
},
|
|
27
|
-
let R =
|
|
26
|
+
}, C = ({ description: C, isSelected: w, name: T, onClick: E, shouldHideEmptyValues: D, type: O, value: k, taxonomyNodeFetcher: A, taxonomyKey: j, scope: M, isExternallyOwned: N, confidenceScore: P, isConfidenceScoreReviewEnabled: F = !1, isBoundingBoxEnabled: I = !1, targetLocation: L }) => {
|
|
27
|
+
let R = g(), { trackEvent: z } = n(), B = m(null), V = p(B), H = (e) => {
|
|
28
28
|
B.current = e instanceof HTMLElement ? e : null;
|
|
29
|
-
}, U = I && !!
|
|
30
|
-
fieldType:
|
|
31
|
-
confidenceLevel:
|
|
32
|
-
scope:
|
|
33
|
-
}),
|
|
29
|
+
}, U = I || F, W = F && !!P && a(P), G = r(L), K = U && G && !!E, q = W ? i(R.formatMessage, P) : null, J = () => z(t.LOW_CONF_ICON_HOVER_READ_MODE, {
|
|
30
|
+
fieldType: O,
|
|
31
|
+
confidenceLevel: P?.level,
|
|
32
|
+
scope: M
|
|
33
|
+
}), Y = typeof k == "number" ? k.toString() : k ? Array.isArray(k) ? k.join(", ") : O === "date" && typeof k == "string" ? /* @__PURE__ */ v(h, {
|
|
34
34
|
day: "numeric",
|
|
35
35
|
month: "long",
|
|
36
|
-
value: s(
|
|
36
|
+
value: s(k),
|
|
37
37
|
year: "numeric"
|
|
38
|
-
}) :
|
|
38
|
+
}) : k : null, X = {
|
|
39
39
|
"data-metadata-field": !0,
|
|
40
40
|
"data-target-id": "Button-metadataEditorFieldReadClick",
|
|
41
41
|
"data-testid": "metadata-field",
|
|
42
|
-
onClick:
|
|
42
|
+
onClick: E,
|
|
43
43
|
onKeyDown: (e) => {
|
|
44
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(),
|
|
44
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), E?.());
|
|
45
45
|
},
|
|
46
46
|
role: "button",
|
|
47
47
|
tabIndex: 0
|
|
48
48
|
};
|
|
49
|
-
if (
|
|
50
|
-
let
|
|
51
|
-
if (
|
|
52
|
-
if (V) return
|
|
53
|
-
})(),
|
|
54
|
-
className:
|
|
55
|
-
children: /* @__PURE__ */
|
|
49
|
+
if (D && !Y) return null;
|
|
50
|
+
let Z = (() => {
|
|
51
|
+
if (C) return V ? /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", { children: T }), /* @__PURE__ */ v("div", { children: C })] }) : C;
|
|
52
|
+
if (V) return T;
|
|
53
|
+
})(), Q = /* @__PURE__ */ v("h5", {
|
|
54
|
+
className: S.name,
|
|
55
|
+
children: /* @__PURE__ */ v(d, {
|
|
56
56
|
ref: H,
|
|
57
57
|
as: "span",
|
|
58
|
-
className:
|
|
58
|
+
className: b(S.nameText, C && c.interactiveTextHint),
|
|
59
59
|
color: "textOnLightSecondary",
|
|
60
60
|
variant: "bodyDefaultBold",
|
|
61
|
-
children:
|
|
61
|
+
children: T
|
|
62
62
|
})
|
|
63
|
-
}),
|
|
64
|
-
className:
|
|
65
|
-
...
|
|
66
|
-
children: [/* @__PURE__ */
|
|
67
|
-
className:
|
|
68
|
-
children: [
|
|
69
|
-
content:
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
className:
|
|
72
|
-
children: /* @__PURE__ */
|
|
63
|
+
}), $ = /* @__PURE__ */ y("div", {
|
|
64
|
+
className: b(S.metadataInstanceEntry, U && o.spacious, K && o.clickableField, K && w && o.selectedField),
|
|
65
|
+
...K && X,
|
|
66
|
+
children: [/* @__PURE__ */ y("div", {
|
|
67
|
+
className: S.labelContainer,
|
|
68
|
+
children: [q && /* @__PURE__ */ v(f, {
|
|
69
|
+
content: q,
|
|
70
|
+
children: /* @__PURE__ */ v("span", {
|
|
71
|
+
className: S.confidenceScoreIcon,
|
|
72
|
+
children: /* @__PURE__ */ v(u, {
|
|
73
73
|
"data-target-id": "Status-metadataInstanceEntryConfidenceScoreIcon",
|
|
74
74
|
color: "SurfaceStatusSurfaceGray",
|
|
75
75
|
hideText: !0,
|
|
76
|
-
icon:
|
|
76
|
+
icon: x,
|
|
77
77
|
interactive: !0,
|
|
78
78
|
text: R.formatMessage(l.confidenceScoreIconAriaLabel),
|
|
79
|
-
onMouseEnter:
|
|
79
|
+
onMouseEnter: J
|
|
80
80
|
})
|
|
81
81
|
})
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
-
className:
|
|
84
|
-
children:
|
|
85
|
-
content:
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
}) :
|
|
82
|
+
}), /* @__PURE__ */ v("div", {
|
|
83
|
+
className: S.nameLabel,
|
|
84
|
+
children: Z ? /* @__PURE__ */ v(f, {
|
|
85
|
+
content: Z,
|
|
86
|
+
children: /* @__PURE__ */ v(_, { render: Q })
|
|
87
|
+
}) : Q
|
|
88
88
|
})]
|
|
89
|
-
}), /* @__PURE__ */
|
|
90
|
-
formattedValue:
|
|
91
|
-
isExternallyOwned:
|
|
92
|
-
scope:
|
|
93
|
-
taxonomyKey:
|
|
94
|
-
taxonomyNodeFetcher:
|
|
95
|
-
type:
|
|
96
|
-
value:
|
|
89
|
+
}), /* @__PURE__ */ v(ee, {
|
|
90
|
+
formattedValue: Y,
|
|
91
|
+
isExternallyOwned: N,
|
|
92
|
+
scope: M,
|
|
93
|
+
taxonomyKey: j,
|
|
94
|
+
taxonomyNodeFetcher: A,
|
|
95
|
+
type: O,
|
|
96
|
+
value: k
|
|
97
97
|
})]
|
|
98
98
|
});
|
|
99
|
-
return
|
|
99
|
+
return K ? /* @__PURE__ */ v(f, {
|
|
100
100
|
content: R.formatMessage(e.viewOnDocument),
|
|
101
|
-
children:
|
|
102
|
-
}) :
|
|
101
|
+
children: $
|
|
102
|
+
}) : $;
|
|
103
103
|
};
|
|
104
|
-
export {
|
|
104
|
+
export { C as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getVisibleTemplates as e } from "../esm/lib/utils/utils.js";
|
|
2
2
|
import { t } from "./metadata-instance.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import '../styles/metadata-instance-list.css';var r = { metadataInstanceList: "_metadataInstanceList_bd83w_1" }, i = ({ areAiSuggestionsAvailable: i, isAiSuggestionsFeatureEnabled: a, isBetaLanguageEnabled: o, onEdit: s, onSelectMetadataField: c, selectedMetadataFieldId: l, templateInstances: u, taxonomyNodeFetcher: d, isAdvancedExtractAgentEnabled: f = !1, isConfidenceScoreReviewEnabled: p = !1 }) => /* @__PURE__ */ n("div", {
|
|
4
|
+
import '../styles/metadata-instance-list.css';var r = { metadataInstanceList: "_metadataInstanceList_bd83w_1" }, i = ({ areAiSuggestionsAvailable: i, isAiSuggestionsFeatureEnabled: a, isBetaLanguageEnabled: o, onEdit: s, onSelectMetadataField: c, selectedMetadataFieldId: l, templateInstances: u, taxonomyNodeFetcher: d, isAdvancedExtractAgentEnabled: f = !1, isConfidenceScoreReviewEnabled: p = !1, isBoundingBoxEnabled: m = !1 }) => /* @__PURE__ */ n("div", {
|
|
5
5
|
className: r.metadataInstanceList,
|
|
6
6
|
children: e(u).map((e) => /* @__PURE__ */ n(t, {
|
|
7
7
|
areAiSuggestionsAvailable: i,
|
|
@@ -9,6 +9,7 @@ import '../styles/metadata-instance-list.css';var r = { metadataInstanceList: "_
|
|
|
9
9
|
isAiSuggestionsFeatureEnabled: a,
|
|
10
10
|
isBetaLanguageEnabled: o,
|
|
11
11
|
isConfidenceScoreReviewEnabled: p,
|
|
12
|
+
isBoundingBoxEnabled: m,
|
|
12
13
|
onEdit: s,
|
|
13
14
|
onSelectMetadataField: c,
|
|
14
15
|
selectedMetadataFieldId: l,
|
|
@@ -12,8 +12,8 @@ import '../styles/metadata-instance.css';var p = {
|
|
|
12
12
|
topDivider: "_topDivider_1xnom_1",
|
|
13
13
|
reviewNotice: "_reviewNotice_1xnom_5",
|
|
14
14
|
bottomDivider: "_bottomDivider_1xnom_9"
|
|
15
|
-
}, m = ({ areAiSuggestionsAvailable: m, isAiSuggestionsFeatureEnabled: h, isBetaLanguageEnabled: g, onEdit: _, onSelectMetadataField: v, selectedMetadataFieldId: y, templateInstance: b, taxonomyNodeFetcher: x, isAdvancedExtractAgentEnabled: S = !1, isConfidenceScoreReviewEnabled: C = !1 }) => {
|
|
16
|
-
let
|
|
15
|
+
}, m = ({ areAiSuggestionsAvailable: m, isAiSuggestionsFeatureEnabled: h, isBetaLanguageEnabled: g, onEdit: _, onSelectMetadataField: v, selectedMetadataFieldId: y, templateInstance: b, taxonomyNodeFetcher: x, isAdvancedExtractAgentEnabled: S = !1, isConfidenceScoreReviewEnabled: C = !1, isBoundingBoxEnabled: w = !1 }) => {
|
|
16
|
+
let T = b.fields, E = (e) => !e.value || Array.isArray(e.value) && e.value.length === 0, D = T.every(E), O = T.some(E), k = T.length > 0, A = n(T).length, j = C && A > 0 && b.canEdit, [M, N] = l(!0), { getAiSuggestions: P } = t();
|
|
17
17
|
return /* @__PURE__ */ f(s, { children: [
|
|
18
18
|
/* @__PURE__ */ d(o, {
|
|
19
19
|
areAiSuggestionsAvailable: m,
|
|
@@ -22,37 +22,38 @@ import '../styles/metadata-instance.css';var p = {
|
|
|
22
22
|
isAiSuggestionsFeatureEnabled: h,
|
|
23
23
|
isBetaLanguageEnabled: g,
|
|
24
24
|
onAutofill: (e) => {
|
|
25
|
-
_(b),
|
|
25
|
+
_(b), P(b.templateKey, b.scope, e);
|
|
26
26
|
},
|
|
27
27
|
onEdit: () => _(b),
|
|
28
28
|
templateName: b?.displayName
|
|
29
29
|
}),
|
|
30
30
|
/* @__PURE__ */ d(c, { className: p.topDivider }),
|
|
31
|
-
|
|
31
|
+
j && /* @__PURE__ */ d("div", {
|
|
32
32
|
className: p.reviewNotice,
|
|
33
33
|
children: /* @__PURE__ */ d(r, {
|
|
34
|
-
fieldsNeedingReviewCount:
|
|
34
|
+
fieldsNeedingReviewCount: A,
|
|
35
35
|
onTextToggleClick: () => {
|
|
36
36
|
_(b, !0);
|
|
37
37
|
}
|
|
38
38
|
})
|
|
39
39
|
}),
|
|
40
|
-
|
|
41
|
-
isAnyEmptyValueHidden:
|
|
40
|
+
M && D ? /* @__PURE__ */ d(e, {
|
|
41
|
+
isAnyEmptyValueHidden: k,
|
|
42
42
|
isBoxAiSuggestionsFeatureEnabled: h,
|
|
43
43
|
level: "instance",
|
|
44
|
-
onShowEmptyValues: () =>
|
|
44
|
+
onShowEmptyValues: () => N(!1)
|
|
45
45
|
}) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(i, {
|
|
46
46
|
isConfidenceScoreReviewEnabled: C,
|
|
47
|
+
isBoundingBoxEnabled: w,
|
|
47
48
|
onSelectMetadataField: v,
|
|
48
49
|
selectedMetadataFieldId: y,
|
|
49
|
-
shouldHideEmptyValues:
|
|
50
|
+
shouldHideEmptyValues: M,
|
|
50
51
|
taxonomyNodeFetcher: x,
|
|
51
52
|
templateInstance: b
|
|
52
|
-
}),
|
|
53
|
-
isAnyEmptyValueHidden:
|
|
54
|
-
onHideEmptyValues: () =>
|
|
55
|
-
onShowEmptyValues: () =>
|
|
53
|
+
}), O && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(c, { className: p.bottomDivider }), /* @__PURE__ */ d(a, {
|
|
54
|
+
isAnyEmptyValueHidden: M,
|
|
55
|
+
onHideEmptyValues: () => N(!0),
|
|
56
|
+
onShowEmptyValues: () => N(!1)
|
|
56
57
|
})] })] })
|
|
57
58
|
] });
|
|
58
59
|
};
|
package/dist/chunks/utils.js
CHANGED
|
@@ -9,19 +9,18 @@ import { Focusable as d } from "@ariakit/react";
|
|
|
9
9
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
10
|
import m from "clsx";
|
|
11
11
|
import '../styles/utils.css';var h = {
|
|
12
|
-
noAttributesText: "
|
|
13
|
-
fieldWrapper: "
|
|
14
|
-
hasSuggestion: "
|
|
15
|
-
hasConfidenceReview: "
|
|
16
|
-
error: "
|
|
17
|
-
dateField: "
|
|
18
|
-
aiApproved: "
|
|
19
|
-
comboboxContainer: "
|
|
20
|
-
labelWrapper: "
|
|
21
|
-
labelText: "
|
|
22
|
-
labelTruncated: "
|
|
23
|
-
|
|
24
|
-
labelTooltipStack: "_labelTooltipStack_19lyy_118"
|
|
12
|
+
noAttributesText: "_noAttributesText_1o3kr_2",
|
|
13
|
+
fieldWrapper: "_fieldWrapper_1o3kr_6",
|
|
14
|
+
hasSuggestion: "_hasSuggestion_1o3kr_11",
|
|
15
|
+
hasConfidenceReview: "_hasConfidenceReview_1o3kr_16",
|
|
16
|
+
error: "_error_1o3kr_25",
|
|
17
|
+
dateField: "_dateField_1o3kr_44",
|
|
18
|
+
aiApproved: "_aiApproved_1o3kr_49",
|
|
19
|
+
comboboxContainer: "_comboboxContainer_1o3kr_49",
|
|
20
|
+
labelWrapper: "_labelWrapper_1o3kr_95",
|
|
21
|
+
labelText: "_labelText_1o3kr_102",
|
|
22
|
+
labelTruncated: "_labelTruncated_1o3kr_105",
|
|
23
|
+
labelTooltipStack: "_labelTooltipStack_1o3kr_113"
|
|
25
24
|
};
|
|
26
25
|
function g({ as: e, fieldDescription: t, fieldName: r, labelClassName: i, labelRef: l, ...h }) {
|
|
27
26
|
let g = u(null), _ = o(g, l);
|
|
@@ -46,10 +45,7 @@ function _({ as: e, fieldName: t, labelClassName: n, labelRef: r, ...i }) {
|
|
|
46
45
|
}) : h;
|
|
47
46
|
}
|
|
48
47
|
var v = /* @__PURE__ */ l(function({ fieldName: t, fieldDescription: n, isAiSuggestionApplied: a, as: o, confidenceScore: s, labelProps: c }) {
|
|
49
|
-
let { className: l, ref: u, ...d } = c, v = m(l || h.labelText, h.labelTruncated), y = !!s && e(s), b = () => s && y ? /* @__PURE__ */ f(i, {}) : a || s ? /* @__PURE__ */ f(r, {
|
|
50
|
-
className: h.labelIcon,
|
|
51
|
-
confidenceScore: s
|
|
52
|
-
}) : null, x = n ? /* @__PURE__ */ f(g, {
|
|
48
|
+
let { className: l, ref: u, ...d } = c, v = m(l || h.labelText, h.labelTruncated), y = !!s && e(s), b = () => s && y ? /* @__PURE__ */ f(i, {}) : a || s ? /* @__PURE__ */ f(r, { confidenceScore: s }) : null, x = n ? /* @__PURE__ */ f(g, {
|
|
53
49
|
as: o,
|
|
54
50
|
fieldDescription: n,
|
|
55
51
|
fieldName: t,
|
package/dist/chunks/utils2.js
CHANGED
|
@@ -7,44 +7,47 @@ var i = {
|
|
|
7
7
|
REMOVE: "remove",
|
|
8
8
|
REPLACE: "replace",
|
|
9
9
|
TEST: "test"
|
|
10
|
-
}, a = "AI_ACCEPTED", o =
|
|
10
|
+
}, a = "AI_ACCEPTED", o = "AI_EXTRACTED", s = (e, n, r) => {
|
|
11
|
+
let i = !n.isExtracted && r.isExtracted, a = r.targetLocation && !t(n.targetLocation, r.targetLocation);
|
|
12
|
+
return i || a ? [g(`${e}/process`, o)] : [];
|
|
13
|
+
}, c = (e, t) => e.value === t.value && e.level === t.level && e.isAccepted === t.isAccepted, l = (e) => e.value === void 0 || e.value === null || e.value === "" || n(e.value) && r(e.value), u = (e, t, n) => {
|
|
11
14
|
let r = t.confidenceScore, i = n.confidenceScore;
|
|
12
|
-
return !i || r &&
|
|
13
|
-
},
|
|
15
|
+
return !i || r && c(r, i) ? [] : d(e, i);
|
|
16
|
+
}, d = (e, t) => {
|
|
14
17
|
let n = [];
|
|
15
|
-
return t.isAccepted && n.push(
|
|
16
|
-
},
|
|
18
|
+
return t.isAccepted && n.push(g(`${e}/process`, a)), n.push(g(`${e}/confidenceScore`, t.value), g(`${e}/confidenceLevel`, t.level)), n;
|
|
19
|
+
}, f = (e, n, r) => {
|
|
17
20
|
let i = n.targetLocation, a = r.targetLocation, o = n.confidenceScore?.isAccepted ?? !1, s = r.confidenceScore?.isAccepted ?? !1, c = !o && s;
|
|
18
|
-
return a && (!t(i, a) || c) ? [
|
|
19
|
-
},
|
|
20
|
-
let i = [], a = n.metadata.fields, o = r.templateKey === e,
|
|
21
|
+
return a && (!t(i, a) || c) ? [g(`${e}/targetLocation`, JSON.stringify(a))] : [];
|
|
22
|
+
}, p = (n, r) => {
|
|
23
|
+
let i = [], a = n.metadata.fields, o = r.templateKey === e, c = new Map(r.fields.map((e) => [e.key, e])), d = new Map(a.map((e) => [e.key, e]));
|
|
21
24
|
return a.forEach((e) => {
|
|
22
|
-
let n =
|
|
25
|
+
let n = c.get(e.key);
|
|
23
26
|
if (!n) {
|
|
24
|
-
i.push(
|
|
27
|
+
i.push(g(e.key, m(e)));
|
|
25
28
|
return;
|
|
26
29
|
}
|
|
27
30
|
if (t(e, n)) return;
|
|
28
31
|
let r = !t(e.value, n.value);
|
|
29
|
-
!o &&
|
|
32
|
+
!o && l(n) && !l(e) ? i.push(g(e.key, m(e))) : (!o && r && n.value !== null && !l(e) || o && r) && (i.push(h(n.key, m(n))), i.push(v(e.key, m(e)))), i.push(...s(e.key, n, e)), i.push(...u(e.key, n, e)), i.push(...f(e.key, n, e));
|
|
30
33
|
}), r.fields.forEach((e) => {
|
|
31
34
|
let t = d.get(e.key);
|
|
32
|
-
(!t || !o &&
|
|
35
|
+
(!t || !o && l(t) && !l(e)) && (i.push(h(e.key, m(e))), i.push(_(e.key)));
|
|
33
36
|
}), i;
|
|
34
|
-
},
|
|
37
|
+
}, m = (e) => e.type === "float" ? Number(e.value) : e.type === "taxonomy" ? e.value.map((e) => e.value) : e.type === "date" && typeof e.value == "string" ? new Date(e.value).toISOString() : e.value, h = (e, t) => ({
|
|
35
38
|
op: i.TEST,
|
|
36
39
|
path: `/${e}`,
|
|
37
40
|
value: t
|
|
38
|
-
}),
|
|
41
|
+
}), g = (e, t) => ({
|
|
39
42
|
op: i.ADD,
|
|
40
43
|
path: `/${e}`,
|
|
41
44
|
value: t
|
|
42
|
-
}),
|
|
45
|
+
}), _ = (e) => ({
|
|
43
46
|
op: i.REMOVE,
|
|
44
47
|
path: `/${e}`
|
|
45
|
-
}),
|
|
48
|
+
}), v = (e, t) => ({
|
|
46
49
|
op: i.REPLACE,
|
|
47
50
|
path: `/${e}`,
|
|
48
51
|
value: t
|
|
49
52
|
});
|
|
50
|
-
export {
|
|
53
|
+
export { m as n, i as r, p as t };
|
package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
import { EVENT_NAMES as e } from "../../../../utils/analytics/events.js";
|
|
2
2
|
import { useMetadataEditorAnalytics as t } from "../../../../utils/analytics/analytics-context.js";
|
|
3
3
|
import { getConfidenceScoreTooltip as n } from "../../../../utils/confidence-score/get-confidence-score-tooltip.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import r from "../../messages.js";
|
|
5
|
+
import { Status as i, Tooltip as a } from "@box/blueprint-web";
|
|
6
|
+
import { useIntl as o } from "react-intl";
|
|
7
|
+
import { BoxAiLogo as s } from "@box/blueprint-web-assets/icons/Logo";
|
|
8
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
9
|
+
import { SurfaceStatusSurfaceGray as l } from "@box/blueprint-web-assets/tokens/tokens";
|
|
10
|
+
function u({ confidenceScore: u }) {
|
|
11
|
+
let { formatMessage: d } = o(), { trackEvent: f } = t(), p = () => f(e.AI_LOGO_BADGE_HOVER, { confidenceLevel: u?.level });
|
|
12
|
+
return u ? /* @__PURE__ */ c(a, {
|
|
13
|
+
content: n(d, u),
|
|
14
|
+
children: /* @__PURE__ */ c(i, {
|
|
14
15
|
hideText: !0,
|
|
15
|
-
icon:
|
|
16
|
+
icon: s,
|
|
16
17
|
interactive: !0,
|
|
17
18
|
text: "",
|
|
18
|
-
color:
|
|
19
|
+
color: l,
|
|
19
20
|
"data-testid": "ai-confidence-badge",
|
|
20
|
-
onMouseEnter:
|
|
21
|
+
onMouseEnter: p
|
|
21
22
|
})
|
|
22
|
-
}) : /* @__PURE__ */
|
|
23
|
+
}) : /* @__PURE__ */ c(a, {
|
|
24
|
+
content: d(r.aiExtractedBadgeTooltip),
|
|
25
|
+
children: /* @__PURE__ */ c(i, {
|
|
26
|
+
hideText: !0,
|
|
27
|
+
icon: s,
|
|
28
|
+
interactive: !0,
|
|
29
|
+
text: "",
|
|
30
|
+
color: l,
|
|
31
|
+
"data-testid": "ai-extracted-badge",
|
|
32
|
+
onMouseEnter: p
|
|
33
|
+
})
|
|
34
|
+
});
|
|
23
35
|
}
|
|
24
|
-
export {
|
|
36
|
+
export { u as AiLogoBadge };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
var t = e({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
lowConfidenceBadge: {
|
|
4
|
+
id: "metadataEditor.fieldLabel.lowConfidenceBadge",
|
|
5
|
+
defaultMessage: "Low"
|
|
6
|
+
},
|
|
7
|
+
aiExtractedBadgeTooltip: {
|
|
8
|
+
id: "metadataEditor.fieldLabel.aiExtractedBadgeTooltip",
|
|
9
|
+
defaultMessage: "Extraction value returned by Box AI"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
export { t as default };
|