@box/metadata-editor 1.53.16 → 1.54.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 +43 -38
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +37 -0
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/index.js +4 -0
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +57 -56
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +4 -0
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/index.js +4 -0
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +30 -0
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +37 -36
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +32 -31
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +32 -31
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +35 -34
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +26 -25
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +64 -63
- package/dist/esm/lib/components/metadata-editor-fields/messages.js +10 -0
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +89 -85
- package/dist/esm/lib/components/metadata-editor-fields/utils.js +7 -5
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +90 -88
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +5 -5
- package/dist/esm/lib/utils/autofill-context.js +51 -47
- package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +18 -16
- package/dist/esm/lib/utils/confidence-score/messages.js +1 -1
- package/dist/i18n/bn-IN.js +2 -0
- package/dist/i18n/da-DK.js +2 -0
- package/dist/i18n/de-DE.js +2 -0
- package/dist/i18n/en-AU.js +2 -0
- package/dist/i18n/en-CA.js +2 -0
- package/dist/i18n/en-GB.js +2 -0
- package/dist/i18n/en-US.js +3 -1
- package/dist/i18n/en-US.properties +5 -1
- package/dist/i18n/en-x-pseudo.js +2 -0
- package/dist/i18n/es-419.js +2 -0
- package/dist/i18n/es-ES.js +2 -0
- package/dist/i18n/fi-FI.js +2 -0
- package/dist/i18n/fr-CA.js +2 -0
- package/dist/i18n/fr-FR.js +2 -0
- package/dist/i18n/hi-IN.js +2 -0
- package/dist/i18n/it-IT.js +2 -0
- package/dist/i18n/ja-JP.js +2 -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/components/metadata-editor-fields/messages.json +1 -0
- package/dist/i18n/json/src/lib/utils/confidence-score/messages.json +1 -1
- package/dist/i18n/ko-KR.js +2 -0
- package/dist/i18n/nb-NO.js +2 -0
- package/dist/i18n/nl-NL.js +2 -0
- package/dist/i18n/pl-PL.js +2 -0
- package/dist/i18n/pt-BR.js +2 -0
- package/dist/i18n/ru-RU.js +2 -0
- package/dist/i18n/sv-SE.js +2 -0
- package/dist/i18n/tr-TR.js +2 -0
- package/dist/i18n/zh-CN.js +2 -0
- package/dist/i18n/zh-TW.js +2 -0
- package/dist/types/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.d.ts +5 -0
- package/dist/types/lib/components/metadata-editor-fields/components/ai-logo-badge/index.d.ts +1 -0
- package/dist/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.d.ts +1 -1
- package/dist/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.d.ts +5 -0
- package/dist/types/lib/components/metadata-editor-fields/components/ai-suggestion-field/types.d.ts +9 -1
- package/dist/types/lib/components/metadata-editor-fields/components/low-confidence-badge/index.d.ts +1 -0
- package/dist/types/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.d.ts +4 -0
- package/dist/types/lib/components/metadata-editor-fields/messages.d.ts +8 -0
- package/dist/types/lib/components/metadata-editor-fields/types.d.ts +2 -1
- package/dist/types/lib/components/metadata-editor-fields/utils.d.ts +2 -1
- package/dist/types/lib/test-utils/confidence-score-fixtures.d.ts +37 -0
- package/dist/types/lib/test-utils/index.d.ts +1 -0
- package/dist/types/lib/test-utils/sample-data.d.ts +1 -3
- package/dist/types/lib/types.d.ts +1 -0
- package/dist/types/lib/utils/autofill-context.d.ts +2 -1
- package/package.json +9 -9
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import { Combobox as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { g as
|
|
7
|
-
import { messages as
|
|
8
|
-
import { MULTI_VALUE_DEFAULT_VALUE as
|
|
1
|
+
import { Combobox as y } from "@box/blueprint-web";
|
|
2
|
+
import { useFormikContext as x, getIn as E, Field as U } from "formik";
|
|
3
|
+
import { forwardRef as $ } from "react";
|
|
4
|
+
import { useIntl as w } from "react-intl";
|
|
5
|
+
import A from "../../../../messages.js";
|
|
6
|
+
import { g as D } from "../../../../../../chunks/utils2.js";
|
|
7
|
+
import { messages as I } from "../update-mode-field-wrapper/messages.js";
|
|
8
|
+
import { MULTI_VALUE_DEFAULT_VALUE as _ } from "../update-mode-field-wrapper/mulitple-values-utils.js";
|
|
9
9
|
import { jsx as l } from "react/jsx-runtime";
|
|
10
|
-
const
|
|
10
|
+
const H = /* @__PURE__ */ $(({
|
|
11
11
|
className: m,
|
|
12
12
|
isAiSuggestionApplied: n,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
confidenceScore: u,
|
|
14
|
+
description: d,
|
|
15
|
+
disableForm: p,
|
|
15
16
|
fieldNamePrefix: o,
|
|
16
17
|
label: a,
|
|
17
|
-
onValueEdited:
|
|
18
|
-
options:
|
|
19
|
-
portalElement:
|
|
20
|
-
updateModePrefix:
|
|
21
|
-
},
|
|
18
|
+
onValueEdited: c,
|
|
19
|
+
options: f,
|
|
20
|
+
portalElement: g,
|
|
21
|
+
updateModePrefix: V
|
|
22
|
+
}, L) => {
|
|
22
23
|
const {
|
|
23
|
-
setFieldValue:
|
|
24
|
-
values:
|
|
25
|
-
} =
|
|
24
|
+
setFieldValue: F,
|
|
25
|
+
values: b
|
|
26
|
+
} = x(), {
|
|
26
27
|
formatMessage: s
|
|
27
|
-
} =
|
|
28
|
+
} = w(), r = `${V ?? o}.value`, h = s(I.multipleValues), C = (f || E(b, `${o}.options`, [])).map((e) => typeof e == "string" ? e : e.key), M = (e, i) => i.toLowerCase().includes(e.toLowerCase());
|
|
28
29
|
return /* @__PURE__ */ l("div", {
|
|
29
30
|
"data-testid": `${a}-field`,
|
|
30
|
-
children: /* @__PURE__ */ l(
|
|
31
|
+
children: /* @__PURE__ */ l(U, {
|
|
31
32
|
name: r,
|
|
32
33
|
children: ({
|
|
33
34
|
field: e
|
|
34
35
|
}) => {
|
|
35
|
-
const
|
|
36
|
-
return /* @__PURE__ */ l(
|
|
37
|
-
ref:
|
|
36
|
+
const v = (e.value?.length || 0) === 0 ? s(A.multiselectPlaceholder) : "";
|
|
37
|
+
return /* @__PURE__ */ l(y, {
|
|
38
|
+
ref: L,
|
|
38
39
|
as: "input",
|
|
39
40
|
className: m,
|
|
40
41
|
"data-target-id": "Combobox-MetadataEditorMultiSelectField",
|
|
41
|
-
disabled:
|
|
42
|
-
displayValue: (t) => t ===
|
|
43
|
-
filterFn:
|
|
44
|
-
label:
|
|
42
|
+
disabled: p,
|
|
43
|
+
displayValue: (t) => t === _ ? h : t,
|
|
44
|
+
filterFn: M,
|
|
45
|
+
label: D(a, d, n, "label", u),
|
|
45
46
|
multiselect: !0,
|
|
46
47
|
name: e.name,
|
|
47
48
|
onValueChange: (t) => {
|
|
48
|
-
|
|
49
|
+
F(r, t), c();
|
|
49
50
|
},
|
|
50
|
-
options:
|
|
51
|
-
placeholder:
|
|
52
|
-
portalElement:
|
|
51
|
+
options: C,
|
|
52
|
+
placeholder: v,
|
|
53
|
+
portalElement: g,
|
|
53
54
|
value: e.value
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -57,6 +58,6 @@ const G = /* @__PURE__ */ U(({
|
|
|
57
58
|
});
|
|
58
59
|
});
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
H as MetadataMultiSelectField,
|
|
62
|
+
H as default
|
|
62
63
|
};
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { TextInput as
|
|
2
|
-
import { Field as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { g as
|
|
1
|
+
import { TextInput as c } from "@box/blueprint-web";
|
|
2
|
+
import { Field as h } from "formik";
|
|
3
|
+
import { forwardRef as F } from "react";
|
|
4
|
+
import { useIntl as x } from "react-intl";
|
|
5
|
+
import M from "../../../../messages.js";
|
|
6
|
+
import { g as b } from "../../../../../../chunks/utils2.js";
|
|
7
7
|
import { jsx as e } from "react/jsx-runtime";
|
|
8
|
-
const I = /* @__PURE__ */
|
|
8
|
+
const I = /* @__PURE__ */ F(({
|
|
9
9
|
className: r,
|
|
10
10
|
description: a,
|
|
11
11
|
isAiSuggestionApplied: i,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
confidenceScore: o,
|
|
13
|
+
disableForm: d,
|
|
14
|
+
fieldNamePrefix: l,
|
|
14
15
|
label: t,
|
|
15
|
-
onValueEdited:
|
|
16
|
-
updateModePrefix:
|
|
17
|
-
},
|
|
18
|
-
const
|
|
16
|
+
onValueEdited: m,
|
|
17
|
+
updateModePrefix: n
|
|
18
|
+
}, s) => {
|
|
19
|
+
const f = x(), p = `${n ?? l}.value`;
|
|
19
20
|
return /* @__PURE__ */ e("div", {
|
|
20
21
|
"data-testid": `${t}-field`,
|
|
21
|
-
children: /* @__PURE__ */ e(
|
|
22
|
-
name:
|
|
22
|
+
children: /* @__PURE__ */ e(h, {
|
|
23
|
+
name: p,
|
|
23
24
|
children: ({
|
|
24
|
-
field:
|
|
25
|
-
meta:
|
|
26
|
-
}) => /* @__PURE__ */ e(
|
|
27
|
-
...
|
|
28
|
-
ref:
|
|
25
|
+
field: g,
|
|
26
|
+
meta: u
|
|
27
|
+
}) => /* @__PURE__ */ e(c, {
|
|
28
|
+
...g,
|
|
29
|
+
ref: s,
|
|
29
30
|
className: r,
|
|
30
31
|
"data-target-id": "TextInput-MetadataEditorStringField",
|
|
31
|
-
disabled:
|
|
32
|
-
error:
|
|
33
|
-
label:
|
|
34
|
-
onChangeCapture:
|
|
35
|
-
placeholder:
|
|
32
|
+
disabled: d,
|
|
33
|
+
error: u.error,
|
|
34
|
+
label: b(t, a, i, "label", o),
|
|
35
|
+
onChangeCapture: m,
|
|
36
|
+
placeholder: f.formatMessage(M.setValuePlaceholder)
|
|
36
37
|
})
|
|
37
38
|
})
|
|
38
39
|
});
|
|
@@ -1,95 +1,96 @@
|
|
|
1
|
-
import { Tooltip as
|
|
2
|
-
import { ComboboxWithApiTreeView as
|
|
3
|
-
import { useFormikContext as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import
|
|
7
|
-
import { g as
|
|
8
|
-
import { messages as
|
|
9
|
-
import { MULTI_VALUE_DEFAULT_VALUE as
|
|
1
|
+
import { Tooltip as K } from "@box/blueprint-web";
|
|
2
|
+
import { ComboboxWithApiTreeView as j, ComboboxWithApiPagination as R } from "@box/combobox-with-api";
|
|
3
|
+
import { useFormikContext as q, getIn as z, Field as B } from "formik";
|
|
4
|
+
import { forwardRef as G, useCallback as H } from "react";
|
|
5
|
+
import { useIntl as J } from "react-intl";
|
|
6
|
+
import k from "../../../../messages.js";
|
|
7
|
+
import { g as E } from "../../../../../../chunks/utils2.js";
|
|
8
|
+
import { messages as O } from "../update-mode-field-wrapper/messages.js";
|
|
9
|
+
import { MULTI_VALUE_DEFAULT_VALUE as Q } from "../update-mode-field-wrapper/mulitple-values-utils.js";
|
|
10
10
|
import { jsx as t } from "react/jsx-runtime";
|
|
11
|
-
const
|
|
11
|
+
const S = (o, l) => o === Q ? l : o, ie = /* @__PURE__ */ G(({
|
|
12
12
|
description: o,
|
|
13
13
|
disableForm: l,
|
|
14
14
|
isAiSuggestionApplied: s,
|
|
15
|
-
|
|
15
|
+
confidenceScore: m,
|
|
16
|
+
fieldNamePrefix: d,
|
|
16
17
|
label: r,
|
|
17
|
-
onValueEdited:
|
|
18
|
-
portalElement:
|
|
19
|
-
taxonomyOptionsFetcher:
|
|
20
|
-
updateModePrefix:
|
|
21
|
-
className:
|
|
22
|
-
isExternallyOwned:
|
|
23
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
18
|
+
onValueEdited: P,
|
|
19
|
+
portalElement: u,
|
|
20
|
+
taxonomyOptionsFetcher: c,
|
|
21
|
+
updateModePrefix: U,
|
|
22
|
+
className: p,
|
|
23
|
+
isExternallyOwned: b,
|
|
24
|
+
isMultilevelTaxonomyFieldEnabled: W
|
|
24
25
|
}, h) => {
|
|
25
26
|
const {
|
|
26
|
-
formatMessage:
|
|
27
|
-
} =
|
|
28
|
-
setFieldValue:
|
|
29
|
-
values:
|
|
30
|
-
} =
|
|
27
|
+
formatMessage: i
|
|
28
|
+
} = J(), g = `${U ?? d}.value`, {
|
|
29
|
+
setFieldValue: w,
|
|
30
|
+
values: V
|
|
31
|
+
} = q(), {
|
|
31
32
|
metadata: {
|
|
32
|
-
templateKey:
|
|
33
|
-
scope:
|
|
33
|
+
templateKey: v,
|
|
34
|
+
scope: y
|
|
34
35
|
}
|
|
35
|
-
} =
|
|
36
|
+
} = V, D = z(V, d), {
|
|
36
37
|
key: f,
|
|
37
38
|
optionsRules: {
|
|
38
|
-
multiSelect:
|
|
39
|
+
multiSelect: n,
|
|
39
40
|
selectableLevels: a
|
|
40
41
|
},
|
|
41
|
-
levels:
|
|
42
|
-
} =
|
|
43
|
-
|
|
44
|
-
},
|
|
42
|
+
levels: _
|
|
43
|
+
} = D, $ = i(O.multipleValues), x = W && a?.some((e) => e > 1), T = l || b, C = H((e) => c(y, v, f, a?.[0], e), [f, y, a, c, v]), F = (e) => n || !e?.length ? i(k.taxonomyPlaceholder) : void 0, A = (e) => {
|
|
44
|
+
w(g, e), P();
|
|
45
|
+
}, L = /* @__PURE__ */ t("div", {
|
|
45
46
|
"data-testid": `${r}-field`,
|
|
46
47
|
onKeyDown: (e) => e.stopPropagation(),
|
|
47
48
|
role: "presentation",
|
|
48
|
-
children: /* @__PURE__ */ t(
|
|
49
|
-
name:
|
|
49
|
+
children: /* @__PURE__ */ t(B, {
|
|
50
|
+
name: g,
|
|
50
51
|
children: ({
|
|
51
52
|
field: e
|
|
52
53
|
}) => {
|
|
53
|
-
const
|
|
54
|
-
...
|
|
55
|
-
displayValue:
|
|
54
|
+
const M = Array.isArray(e.value) ? e.value.map((I) => ({
|
|
55
|
+
...I,
|
|
56
|
+
displayValue: S(I.displayValue, $)
|
|
56
57
|
})) : e.value;
|
|
57
|
-
return
|
|
58
|
+
return x ? /* @__PURE__ */ t(j, {
|
|
58
59
|
ref: h,
|
|
59
|
-
className:
|
|
60
|
-
closeOnSelection:
|
|
60
|
+
className: p,
|
|
61
|
+
closeOnSelection: x,
|
|
61
62
|
dataTargetId: "ComboboxWithApiTreeView-MetadataEditorTaxonomyField",
|
|
62
|
-
defaultFetcher:
|
|
63
|
-
disabled:
|
|
64
|
-
label:
|
|
65
|
-
levels:
|
|
66
|
-
multiselect:
|
|
67
|
-
onValueChange:
|
|
68
|
-
placeholder:
|
|
69
|
-
portalElement:
|
|
63
|
+
defaultFetcher: C,
|
|
64
|
+
disabled: T,
|
|
65
|
+
label: E(r, o, s, "label", m),
|
|
66
|
+
levels: _,
|
|
67
|
+
multiselect: n,
|
|
68
|
+
onValueChange: A,
|
|
69
|
+
placeholder: F(e.value),
|
|
70
|
+
portalElement: u,
|
|
70
71
|
selectableLevels: a,
|
|
71
|
-
value:
|
|
72
|
-
}) : /* @__PURE__ */ t(
|
|
72
|
+
value: M
|
|
73
|
+
}) : /* @__PURE__ */ t(R, {
|
|
73
74
|
ref: h,
|
|
74
|
-
className:
|
|
75
|
+
className: p,
|
|
75
76
|
dataTargetId: "ComboboxWithApiPagination-MetadataEditorTaxonomyField",
|
|
76
|
-
defaultFetcher:
|
|
77
|
-
disabled:
|
|
78
|
-
label:
|
|
79
|
-
multiselect:
|
|
80
|
-
onValueChange:
|
|
81
|
-
placeholder:
|
|
82
|
-
portalElement:
|
|
83
|
-
value:
|
|
77
|
+
defaultFetcher: C,
|
|
78
|
+
disabled: T,
|
|
79
|
+
label: E(r, o, s, "label", m),
|
|
80
|
+
multiselect: n,
|
|
81
|
+
onValueChange: A,
|
|
82
|
+
placeholder: F(e.value),
|
|
83
|
+
portalElement: u,
|
|
84
|
+
value: M
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
87
|
})
|
|
87
88
|
});
|
|
88
|
-
return
|
|
89
|
-
content:
|
|
90
|
-
children:
|
|
91
|
-
}) :
|
|
89
|
+
return b ? /* @__PURE__ */ t(K, {
|
|
90
|
+
content: i(k.taxonomyExternallyOwned),
|
|
91
|
+
children: L
|
|
92
|
+
}) : L;
|
|
92
93
|
});
|
|
93
94
|
export {
|
|
94
|
-
|
|
95
|
+
ie as MetadataTaxonomyField
|
|
95
96
|
};
|
|
@@ -1,105 +1,109 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import w from "clsx";
|
|
2
|
+
import { useFormikContext as z } from "formik";
|
|
3
|
+
import D from "lodash/isEqual";
|
|
4
|
+
import G from "lodash/isUndefined";
|
|
5
|
+
import { forwardRef as H, useCallback as d, useEffect as W, useMemo as J } from "react";
|
|
6
|
+
import { A as r } from "../../../../chunks/types.js";
|
|
7
|
+
import { UpdateModeFieldWrapper as K } from "./components/update-mode-field-wrapper/update-mode-field-wrapper.js";
|
|
8
|
+
import { editorFieldTypes as Q } from "./editor-field-types.js";
|
|
9
|
+
import { s as u } from "../../../../chunks/utils2.js";
|
|
10
|
+
import { jsx as l, jsxs as X } from "react/jsx-runtime";
|
|
11
|
+
import { isConfidenceScoreNeedingReview as Y } from "../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
12
|
+
import { AiSuggestionField as Z } from "./components/ai-suggestion-field/ai-suggestion-field.js";
|
|
13
|
+
import { LowConfidenceSuggestionField as _ } from "./components/low-confidence-suggestion-field/low-confidence-suggestion-field.js";
|
|
14
|
+
const pe = /* @__PURE__ */ H(({
|
|
15
|
+
disableForm: h,
|
|
16
|
+
portalElement: $,
|
|
16
17
|
field: e,
|
|
17
|
-
index:
|
|
18
|
+
index: k,
|
|
18
19
|
taxonomyOptionsFetcher: v,
|
|
19
|
-
isExternallyOwned:
|
|
20
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
21
|
-
isConfidenceScoreReviewEnabled:
|
|
22
|
-
},
|
|
20
|
+
isExternallyOwned: N,
|
|
21
|
+
isMultilevelTaxonomyFieldEnabled: V,
|
|
22
|
+
isConfidenceScoreReviewEnabled: n = !1
|
|
23
|
+
}, F) => {
|
|
23
24
|
const {
|
|
24
|
-
setFieldValue:
|
|
25
|
-
} =
|
|
26
|
-
aiSuggestion:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
25
|
+
setFieldValue: t
|
|
26
|
+
} = z(), m = e.aiSuggestionState || r.Initial, s = m === r.Pending, x = m === r.Applied, C = m === r.Initial, f = Q[e.type], {
|
|
27
|
+
aiSuggestion: i,
|
|
28
|
+
aiSuggestionConfidenceScore: A,
|
|
29
|
+
type: g,
|
|
30
|
+
value: a
|
|
31
|
+
} = e, P = f && !e.hidden, L = !G(e.updateMode), o = `metadata.fields[${k}]`, U = e.type === "taxonomy" && e.optionsRules?.multiSelect, M = n && !!e.confidenceScore && Y(e.confidenceScore), j = w({
|
|
32
|
+
[u.suggestionApplied]: x,
|
|
33
|
+
[u.hasSuggestion]: s,
|
|
34
|
+
[u.hasConfidenceReview]: !s && M,
|
|
35
|
+
[u.dateField]: g === "date"
|
|
36
|
+
}), p = d((c) => {
|
|
37
|
+
t(`${o}.aiSuggestionState`, c);
|
|
38
|
+
}, [o, t]), S = d((c) => {
|
|
39
|
+
t(`${o}.value`, c), p(r.Applied), n && (t(`${o}.confidenceScore`, A), t(`${o}.aiSuggestionConfidenceScore`, void 0));
|
|
40
|
+
}, [o, t, p, A, n]), y = d(() => {
|
|
41
|
+
p(r.Initial), t(`${o}.aiSuggestion`, void 0), n && t(`${o}.aiSuggestionConfidenceScore`, void 0);
|
|
42
|
+
}, [p, t, o, n]), T = d(() => {
|
|
43
|
+
t(`${o}.confidenceScore.isAccepted`, !0);
|
|
44
|
+
}, [o, t]), q = d(() => {
|
|
45
|
+
const c = g === "multiSelect" || g === "taxonomy" ? [] : "";
|
|
46
|
+
t(`${o}.value`, c), t(`${o}.confidenceScore`, void 0);
|
|
47
|
+
}, [o, t, g]), I = d(() => {
|
|
48
|
+
y(), n && e.confidenceScore && t(`${o}.confidenceScore`, void 0);
|
|
49
|
+
}, [y, n, e.confidenceScore, t, o]);
|
|
50
|
+
W(() => {
|
|
51
|
+
s && (!a || Array.isArray(a) && a.length === 0) && S(i);
|
|
52
|
+
}, [i, s, S]), W(() => {
|
|
53
|
+
C && i && p(r.Pending);
|
|
54
|
+
}, [C, i, p]);
|
|
55
|
+
const B = J(() => i ? D(a, i) : !1, [i, a]);
|
|
56
|
+
return P ? L ? /* @__PURE__ */ l(K, {
|
|
57
|
+
fieldNamePrefix: o,
|
|
56
58
|
fieldType: e.type,
|
|
57
|
-
isTaxonomyMultiSelect:
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
ref:
|
|
59
|
+
isTaxonomyMultiSelect: U,
|
|
60
|
+
children: /* @__PURE__ */ l(f, {
|
|
61
|
+
ref: F,
|
|
60
62
|
description: e.description,
|
|
61
|
-
disableForm:
|
|
62
|
-
fieldNamePrefix:
|
|
63
|
+
disableForm: h,
|
|
64
|
+
fieldNamePrefix: o,
|
|
63
65
|
isAiSuggestionApplied: !1,
|
|
64
|
-
isExternallyOwned:
|
|
65
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
66
|
+
isExternallyOwned: N,
|
|
67
|
+
isMultilevelTaxonomyFieldEnabled: V,
|
|
66
68
|
label: e.displayName,
|
|
67
69
|
levels: e.levels,
|
|
68
|
-
onValueEdited:
|
|
69
|
-
portalElement:
|
|
70
|
+
onValueEdited: I,
|
|
71
|
+
portalElement: $,
|
|
70
72
|
taxonomyOptionsFetcher: v
|
|
71
73
|
})
|
|
72
|
-
}, e.key) : /* @__PURE__ */
|
|
73
|
-
className:
|
|
74
|
-
children: [/* @__PURE__ */
|
|
75
|
-
ref:
|
|
76
|
-
className:
|
|
74
|
+
}, e.key) : /* @__PURE__ */ X("div", {
|
|
75
|
+
className: u.fieldWrapper,
|
|
76
|
+
children: [/* @__PURE__ */ l(f, {
|
|
77
|
+
ref: F,
|
|
78
|
+
className: j,
|
|
77
79
|
description: e.description,
|
|
78
|
-
disableForm:
|
|
79
|
-
fieldNamePrefix:
|
|
80
|
-
isAiSuggestionApplied:
|
|
81
|
-
isExternallyOwned:
|
|
82
|
-
|
|
80
|
+
disableForm: h,
|
|
81
|
+
fieldNamePrefix: o,
|
|
82
|
+
isAiSuggestionApplied: x,
|
|
83
|
+
isExternallyOwned: N,
|
|
84
|
+
confidenceScore: n && !s ? e.confidenceScore : void 0,
|
|
85
|
+
isMultilevelTaxonomyFieldEnabled: V,
|
|
83
86
|
label: e.displayName,
|
|
84
|
-
onValueEdited:
|
|
85
|
-
portalElement:
|
|
87
|
+
onValueEdited: I,
|
|
88
|
+
portalElement: $,
|
|
86
89
|
taxonomyOptionsFetcher: v
|
|
87
|
-
}),
|
|
88
|
-
aiSuggestion:
|
|
89
|
-
|
|
90
|
+
}), s && /* @__PURE__ */ l(Z, {
|
|
91
|
+
aiSuggestion: i,
|
|
92
|
+
confidenceLevel: n ? A?.level : void 0,
|
|
93
|
+
isSameValue: B,
|
|
90
94
|
onAiSuggestionAppend: () => {
|
|
91
|
-
const
|
|
92
|
-
S(
|
|
95
|
+
const c = [...new Set([a, i].flat().filter(Boolean))];
|
|
96
|
+
S(c);
|
|
93
97
|
},
|
|
94
|
-
onAiSuggestionIgnore:
|
|
95
|
-
onAiSuggestionReplace: () => S(
|
|
96
|
-
type:
|
|
97
|
-
}), !
|
|
98
|
-
onAccept:
|
|
99
|
-
onClear:
|
|
98
|
+
onAiSuggestionIgnore: y,
|
|
99
|
+
onAiSuggestionReplace: () => S(i),
|
|
100
|
+
type: g
|
|
101
|
+
}), !s && M && /* @__PURE__ */ l(_, {
|
|
102
|
+
onAccept: T,
|
|
103
|
+
onClear: q
|
|
100
104
|
})]
|
|
101
105
|
}, e.key) : null;
|
|
102
106
|
});
|
|
103
107
|
export {
|
|
104
|
-
|
|
108
|
+
pe as MetadataEditorFieldWrapper
|
|
105
109
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import "@box/blueprint-web-assets/icons/Logo";
|
|
2
1
|
import "clsx";
|
|
3
|
-
import "../interactive-text/interactive-text.js";
|
|
4
|
-
import { g as a, t as g } from "../../../../chunks/utils2.js";
|
|
5
2
|
import "../../utils/convertDate.js";
|
|
3
|
+
import "../interactive-text/interactive-text.js";
|
|
4
|
+
import { g as s, t as l } from "../../../../chunks/utils2.js";
|
|
6
5
|
import "react/jsx-runtime";
|
|
6
|
+
import "../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
7
|
+
import "./components/low-confidence-badge/low-confidence-badge.js";
|
|
8
|
+
import "./components/ai-logo-badge/ai-logo-badge.js";
|
|
7
9
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
s as getFieldLabel,
|
|
11
|
+
l as tryParseDateSuggestion
|
|
10
12
|
};
|