@box/metadata-editor 1.68.0 → 1.69.1
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/ai-suggestion-field.js +77 -60
- package/dist/chunks/metadata-instance-content.js +36 -24
- package/dist/chunks/metadata-instance-entry.js +61 -52
- package/dist/chunks/metadata-instance-form-autofill-button.js +5 -5
- package/dist/chunks/metadata-instance-form-card-wrapper.js +6 -6
- package/dist/chunks/metadata-instance-form-footer.js +1 -1
- package/dist/chunks/metadata-instance-form-header.js +8 -8
- package/dist/chunks/metadata-instance-header.js +4 -4
- package/dist/esm/index.js +12 -15
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +19 -16
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +20 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +4 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +1 -1
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +13 -12
- package/dist/esm/lib/components/metadata-instance-editor/index.js +9 -7
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +86 -84
- package/dist/esm/lib/components/metadata-instance-list/index.js +6 -4
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +1 -0
- package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +34 -31
- package/dist/esm/lib/utils/analytics/analytics-context.js +11 -0
- package/dist/esm/lib/utils/analytics/events.js +9 -0
- package/dist/esm/lib/utils/analytics/index.js +4 -0
- package/dist/esm/lib/utils/analytics/with-analytics.js +11 -0
- package/dist/esm/lib/utils/confidence-score/index.js +5 -5
- package/dist/i18n/en-x-pseudo.js +156 -156
- package/dist/i18n/en-x-pseudo.properties +156 -156
- package/dist/types/lib/components/metadata-instance-editor/index.d.ts +6 -1
- package/dist/types/lib/components/metadata-instance-list/index.d.ts +12 -2
- package/dist/types/lib/components/unsaved-changes-modal/types.d.ts +7 -0
- package/dist/types/lib/components/unsaved-changes-modal/unsaved-changes-modal.d.ts +1 -1
- package/dist/types/lib/utils/analytics/analytics-context.d.ts +12 -0
- package/dist/types/lib/utils/analytics/events.d.ts +9 -0
- package/dist/types/lib/utils/analytics/index.d.ts +3 -0
- package/dist/types/lib/utils/analytics/with-analytics.d.ts +8 -0
- package/package.json +9 -9
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import e from "../../../../utils/
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { EVENT_NAMES as e } from "../../../../utils/analytics/events.js";
|
|
2
|
+
import { useMetadataEditorAnalytics as t } from "../../../../utils/analytics/analytics-context.js";
|
|
3
|
+
import n from "../../../../utils/confidence-score/messages.js";
|
|
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 { jsx as s } from "react/jsx-runtime";
|
|
8
|
+
import { SurfaceStatusSurfaceGray as c } from "@box/blueprint-web-assets/tokens/tokens";
|
|
9
|
+
import { AlertCircle as l } from "@box/blueprint-web-assets/icons/Medium";
|
|
10
|
+
function u() {
|
|
11
|
+
let { formatMessage: u } = o(), { trackEvent: d } = t(), f = /* @__PURE__ */ s(i, {
|
|
12
|
+
color: c,
|
|
11
13
|
interactive: !0,
|
|
12
|
-
text:
|
|
13
|
-
icon:
|
|
14
|
-
iconPosition: "left"
|
|
14
|
+
text: u(r.lowConfidenceBadge).toUpperCase(),
|
|
15
|
+
icon: l,
|
|
16
|
+
iconPosition: "left",
|
|
17
|
+
onMouseEnter: () => d(e.LOW_CONF_BADGE_HOVER)
|
|
15
18
|
});
|
|
16
|
-
return /* @__PURE__ */ a
|
|
17
|
-
content:
|
|
18
|
-
children:
|
|
19
|
+
return /* @__PURE__ */ s(a, {
|
|
20
|
+
content: u(n.tooltipLowConfidence),
|
|
21
|
+
children: f
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
|
-
export {
|
|
24
|
+
export { u as LowConfidenceBadge };
|
|
@@ -46,19 +46,19 @@ function g({ onAccept: g, onClear: _ }) {
|
|
|
46
46
|
content: v.formatMessage(t.acceptValueTooltip),
|
|
47
47
|
children: /* @__PURE__ */ d(n, {
|
|
48
48
|
"aria-label": v.formatMessage(t.acceptValueAriaLabel),
|
|
49
|
+
"data-target-id": "IconButton-metadataEditorLowConfAccept",
|
|
49
50
|
icon: p,
|
|
50
51
|
onClick: () => C(g),
|
|
51
|
-
size: "x-small"
|
|
52
|
-
"data-target-id": "IconButton-acceptValueAriaLabel"
|
|
52
|
+
size: "x-small"
|
|
53
53
|
})
|
|
54
54
|
}), /* @__PURE__ */ d(a, {
|
|
55
55
|
content: v.formatMessage(t.clearValueTooltip),
|
|
56
56
|
children: /* @__PURE__ */ d(n, {
|
|
57
57
|
"aria-label": v.formatMessage(t.clearValueAriaLabel),
|
|
58
|
+
"data-target-id": "IconButton-metadataEditorLowConfClear",
|
|
58
59
|
icon: m,
|
|
59
60
|
onClick: () => C(_),
|
|
60
|
-
size: "x-small"
|
|
61
|
-
"data-target-id": "IconButton-clearValueAriaLabel"
|
|
61
|
+
size: "x-small"
|
|
62
62
|
})
|
|
63
63
|
})]
|
|
64
64
|
})]
|
|
@@ -15,7 +15,7 @@ var s = /* @__PURE__ */ r(({ className: r, description: s, isAiSuggestionApplied
|
|
|
15
15
|
...t,
|
|
16
16
|
ref: h,
|
|
17
17
|
className: r,
|
|
18
|
-
"data-target-id": "TextInput-
|
|
18
|
+
"data-target-id": "TextInput-metadataEditorStringField",
|
|
19
19
|
disabled: u,
|
|
20
20
|
error: i.error,
|
|
21
21
|
label: v,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import e from "../../messages.js";
|
|
2
2
|
import { t } from "../../../../chunks/types.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { checkIfHasBoundingBoxes as n } from "../../utils/check-if-has-bounding-boxes.js";
|
|
4
|
+
import { isConfidenceScoreNeedingReview as r } from "../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
5
5
|
import { isInteractiveFormElement as i } from "../../utils/is-interactive-form-element.js";
|
|
6
6
|
import { t as a } from "../../../../chunks/shared-field-styles.module.js";
|
|
7
|
-
import { t as
|
|
8
|
-
import { LowConfidenceSuggestionField as
|
|
7
|
+
import { t as o } from "../../../../chunks/ai-suggestion-field.js";
|
|
8
|
+
import { LowConfidenceSuggestionField as ee } from "./components/low-confidence-suggestion-field/low-confidence-suggestion-field.js";
|
|
9
9
|
import { t as s } from "../../../../chunks/update-mode-field-wrapper.js";
|
|
10
10
|
import { r as c } from "../../../../chunks/utils.js";
|
|
11
|
-
import { editorFieldTypes as
|
|
12
|
-
import { useViewReferenceTooltip as
|
|
11
|
+
import { editorFieldTypes as l } from "./editor-field-types.js";
|
|
12
|
+
import { useViewReferenceTooltip as te } from "./hooks/use-view-reference-tooltip.js";
|
|
13
13
|
import { Tooltip as u } from "@box/blueprint-web";
|
|
14
14
|
import { forwardRef as d, memo as f, useCallback as p, useEffect as m, useMemo as ne } from "react";
|
|
15
15
|
import { useIntl as re } from "react-intl";
|
|
16
16
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
17
17
|
import _ from "clsx";
|
|
18
|
-
import { useFormikContext as
|
|
19
|
-
import
|
|
18
|
+
import { useFormikContext as ie } from "formik";
|
|
19
|
+
import v from "lodash/isEqual";
|
|
20
20
|
import ae from "lodash/isUndefined";
|
|
21
21
|
var y = /* @__PURE__ */ f(/* @__PURE__ */ d(({ disableForm: d, portalElement: f, field: y, index: oe, taxonomyOptionsFetcher: b, isExternallyOwned: x, isMultilevelTaxonomyFieldEnabled: S, isConfidenceScoreReviewEnabled: C = !1, onSelectMetadataField: w, selectedMetadataFieldId: se }, T) => {
|
|
22
|
-
let { setFieldValue: E } =
|
|
22
|
+
let { setFieldValue: E } = ie(), { formatMessage: D } = re(), O = y.aiSuggestionState || t.Initial, k = O === t.Pending, A = O === t.Applied, j = O === t.Initial, M = l[y.type], { aiSuggestion: N, aiSuggestionConfidenceScore: P, aiSuggestionTargetLocation: F, type: I, value: L } = y, R = M && !y.hidden, z = !ae(y.updateMode), B = `metadata.fields[${oe}]`, V = y.type === "taxonomy" && y.optionsRules?.multiSelect, H = C && !!y.confidenceScore, U = H && r(y.confidenceScore), W = H && !k && !r(y.confidenceScore), G = se === y.id, ce = n(y.targetLocation), K = H && ce && !!w, { isTooltipOpen: q, handleMouseOver: le, handleMouseLeave: ue, handleFocus: de, handleBlur: fe } = te(K), pe = _({
|
|
23
23
|
[c.aiApproved]: A || W,
|
|
24
24
|
[c.hasSuggestion]: k,
|
|
25
25
|
[c.hasConfidenceReview]: !k && U,
|
|
@@ -98,10 +98,11 @@ var y = /* @__PURE__ */ f(/* @__PURE__ */ d(({ disableForm: d, portalElement: f,
|
|
|
98
98
|
N,
|
|
99
99
|
J
|
|
100
100
|
]);
|
|
101
|
-
let ve = ne(() => N ?
|
|
101
|
+
let ve = ne(() => N ? v(L, N) : !1, [N, L]);
|
|
102
102
|
if (!R) return null;
|
|
103
103
|
let Q = {
|
|
104
104
|
"data-metadata-field": !0,
|
|
105
|
+
"data-target-id": "Button-metadataEditorFieldEditClick",
|
|
105
106
|
"data-testid": "metadata-field",
|
|
106
107
|
onClick: ge,
|
|
107
108
|
onKeyDown: _e,
|
|
@@ -161,7 +162,7 @@ var y = /* @__PURE__ */ f(/* @__PURE__ */ d(({ disableForm: d, portalElement: f,
|
|
|
161
162
|
portalElement: f,
|
|
162
163
|
taxonomyOptionsFetcher: b
|
|
163
164
|
}),
|
|
164
|
-
k && /* @__PURE__ */ h(
|
|
165
|
+
k && /* @__PURE__ */ h(o, {
|
|
165
166
|
aiSuggestion: N,
|
|
166
167
|
confidenceLevel: C ? P?.level : void 0,
|
|
167
168
|
isSameValue: ve,
|
|
@@ -172,7 +173,7 @@ var y = /* @__PURE__ */ f(/* @__PURE__ */ d(({ disableForm: d, portalElement: f,
|
|
|
172
173
|
onAiSuggestionReplace: () => Y(N, !0),
|
|
173
174
|
type: I
|
|
174
175
|
}),
|
|
175
|
-
!k && U && /* @__PURE__ */ h(
|
|
176
|
+
!k && U && /* @__PURE__ */ h(ee, {
|
|
176
177
|
onAccept: me,
|
|
177
178
|
onClear: he
|
|
178
179
|
})
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../../../chunks/
|
|
3
|
-
import { t as n } from "../../../../chunks/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { withAnalytics as e } from "../../utils/analytics/with-analytics.js";
|
|
2
|
+
import { t } from "../../../../chunks/custom-instance-new-field.js";
|
|
3
|
+
import { t as n } from "../../../../chunks/delete-confirmation-modal.js";
|
|
4
|
+
import { r } from "../../../../chunks/utils2.js";
|
|
5
|
+
import { t as i } from "../../../../chunks/metadata-instance-form-autofill-button.js";
|
|
6
|
+
import { t as a } from "../../../../chunks/metadata-instance-form-header.js";
|
|
7
|
+
import { MetadataInstanceForm as o } from "./subcomponents/metadata-instance-form/metadata-instance-form.js";
|
|
8
|
+
var s = e(o);
|
|
9
|
+
export { t as CustomInstanceNewField, n as DeleteConfirmationModal, r as JSONPatchOp, s as MetadataInstanceForm, i as MetadataInstanceFormAutofillButton, a as MetadataInstanceFormHeader };
|
|
@@ -1,127 +1,129 @@
|
|
|
1
1
|
import { TEMPLATE_CUSTOM_PROPERTIES as e } from "../../../../constants.js";
|
|
2
2
|
import { MetadataEmptyState as t } from "../../../metadata-empty-state/metadata-empty-state.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useMetadataEditorAnalytics as n } from "../../../../utils/analytics/analytics-context.js";
|
|
4
4
|
import { useAutofill as r } from "../../../../utils/autofill-context.js";
|
|
5
5
|
import { TemplateInstance as i } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
|
6
6
|
import { UnsavedChangesModal as a } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
|
|
7
7
|
import { t as o } from "../../../../../../chunks/autofill-overlay.js";
|
|
8
8
|
import { t as s } from "../../../../../../chunks/custom-instance.js";
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import g from "
|
|
14
|
-
import
|
|
15
|
-
import y from "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
import { t as c } from "../../../../../../chunks/delete-confirmation-modal.js";
|
|
10
|
+
import { t as l } from "../../../../../../chunks/utils2.js";
|
|
11
|
+
import { n as u, t as d } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
|
|
12
|
+
import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
import v from "clsx";
|
|
15
|
+
import { Form as y, Formik as b } from "formik";
|
|
16
|
+
import x from "lodash/isEqual";
|
|
17
|
+
var S = ({ dirty: e, onChange: t, values: n }) => {
|
|
18
|
+
let r = m(n);
|
|
19
|
+
return e && !x(r.current.metadata.fields, n.metadata.fields) && (r.current = n, t(n)), null;
|
|
20
|
+
}, C = (x) => {
|
|
21
|
+
let { areAiSuggestionsAvailable: C, customRef: w, isLargeFile: T, errorCode: E, isAiSuggestionsFeatureEnabled: D, isAdvancedExtractAgentEnabled: O = !1, isBetaLanguageEnabled: ee, isDeleteButtonDisabled: te, isDeleteConfirmationModalCheckboxEnabled: ne, isMultilevelTaxonomyFieldEnabled: k, isUnsavedChangesModalOpen: A = !1, MetadataInstanceFormCustomWrapper: j, selectedTemplateInstance: M, onCancel: N, onChange: P, onDelete: F, onDiscardUnsavedChanges: I, onSubmit: L, onToggleReviewFilter: R, setIsUnsavedChangesModalOpen: z, shouldShowOnlyReviewFields: B = !1, taxonomyOptionsFetcher: V, isConfidenceScoreReviewEnabled: H = !1, onSelectMetadataField: U, selectedMetadataFieldId: W } = x, re = j ?? d, [G, K] = h(!1), { isFetchingSuggestions: q, isLongLoading: J, getAiSuggestions: Y, clearState: X, suggestions: ie } = r(), { trackEvent: ae } = n();
|
|
22
|
+
f(() => () => {
|
|
22
23
|
X();
|
|
23
|
-
}, [X,
|
|
24
|
-
let Z =
|
|
25
|
-
await
|
|
26
|
-
},
|
|
27
|
-
e ?
|
|
28
|
-
},
|
|
24
|
+
}, [X, M?.id]);
|
|
25
|
+
let Z = M?.templateKey === e, oe = async (e) => {
|
|
26
|
+
await L(e, l(e, M));
|
|
27
|
+
}, se = (e) => {
|
|
28
|
+
e ? z(!0) : N();
|
|
29
|
+
}, ce = () => {
|
|
29
30
|
K(!0);
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
}, le = { metadata: { ...M } }, Q = m(null), [$, ue] = h(null);
|
|
32
|
+
f(() => {
|
|
33
|
+
ue(w ?? Q.current);
|
|
33
34
|
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
w,
|
|
36
|
+
M?.templateKey,
|
|
37
|
+
M?.scope
|
|
37
38
|
]);
|
|
38
|
-
let
|
|
39
|
-
let e =
|
|
40
|
-
if (Z) return /* @__PURE__ */
|
|
41
|
-
if (e) return /* @__PURE__ */
|
|
42
|
-
isBoxAiSuggestionsFeatureEnabled:
|
|
39
|
+
let de = p(() => {
|
|
40
|
+
let e = M?.fields.length === 0;
|
|
41
|
+
if (Z) return /* @__PURE__ */ g(s, { isLoading: q });
|
|
42
|
+
if (e) return /* @__PURE__ */ g(t, {
|
|
43
|
+
isBoxAiSuggestionsFeatureEnabled: D,
|
|
43
44
|
level: "instance"
|
|
44
45
|
});
|
|
45
|
-
let n = !!(q ||
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
className:
|
|
48
|
-
children: [/* @__PURE__ */
|
|
49
|
-
errorCode:
|
|
46
|
+
let n = !!(q || E);
|
|
47
|
+
return /* @__PURE__ */ _("div", {
|
|
48
|
+
className: v(u.metadataInstanceFormContent, n && u.showOverlay, H && u.metadataInstanceFormContentReducedGap),
|
|
49
|
+
children: [/* @__PURE__ */ g(o, {
|
|
50
|
+
errorCode: E,
|
|
50
51
|
isFetchingSuggestions: q,
|
|
51
52
|
isLongLoading: J
|
|
52
|
-
}), /* @__PURE__ */
|
|
53
|
+
}), /* @__PURE__ */ g(i, {
|
|
53
54
|
disableForm: q,
|
|
54
|
-
isConfidenceScoreReviewEnabled:
|
|
55
|
-
isExternallyOwned:
|
|
56
|
-
isMultilevelTaxonomyFieldEnabled:
|
|
57
|
-
onSelectMetadataField:
|
|
58
|
-
selectedMetadataFieldId:
|
|
59
|
-
portalElement:
|
|
60
|
-
shouldShowOnlyReviewFields:
|
|
61
|
-
taxonomyOptionsFetcher:
|
|
55
|
+
isConfidenceScoreReviewEnabled: H,
|
|
56
|
+
isExternallyOwned: M?.isExternallyOwned,
|
|
57
|
+
isMultilevelTaxonomyFieldEnabled: k,
|
|
58
|
+
onSelectMetadataField: U,
|
|
59
|
+
selectedMetadataFieldId: W,
|
|
60
|
+
portalElement: w ?? $,
|
|
61
|
+
shouldShowOnlyReviewFields: B,
|
|
62
|
+
taxonomyOptionsFetcher: V
|
|
62
63
|
})]
|
|
63
64
|
});
|
|
64
65
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
M?.fields.length,
|
|
67
|
+
M?.isExternallyOwned,
|
|
67
68
|
Z,
|
|
68
69
|
q,
|
|
69
70
|
J,
|
|
70
|
-
|
|
71
|
+
w,
|
|
71
72
|
$,
|
|
72
|
-
B,
|
|
73
|
-
T,
|
|
74
73
|
V,
|
|
75
|
-
|
|
76
|
-
w,
|
|
77
|
-
z,
|
|
74
|
+
D,
|
|
78
75
|
H,
|
|
79
|
-
|
|
76
|
+
k,
|
|
77
|
+
E,
|
|
78
|
+
B,
|
|
79
|
+
U,
|
|
80
|
+
W
|
|
80
81
|
]);
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
initialValues:
|
|
83
|
-
onSubmit:
|
|
84
|
-
children: ({ values: e, dirty: t }) => /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
areAiSuggestionsAvailable:
|
|
87
|
-
className:
|
|
82
|
+
return /* @__PURE__ */ g(b, {
|
|
83
|
+
initialValues: le,
|
|
84
|
+
onSubmit: oe,
|
|
85
|
+
children: ({ values: e, dirty: t }) => /* @__PURE__ */ _(y, { children: [
|
|
86
|
+
/* @__PURE__ */ g(re, {
|
|
87
|
+
areAiSuggestionsAvailable: C,
|
|
88
|
+
className: u.metadataInstanceForm,
|
|
88
89
|
formRef: Q,
|
|
89
90
|
formValues: e,
|
|
90
91
|
getAiSuggestions: Y,
|
|
91
|
-
handleCancel:
|
|
92
|
-
handleDelete:
|
|
93
|
-
isAdvancedExtractAgentEnabled:
|
|
94
|
-
isAiSuggestionsFeatureEnabled:
|
|
95
|
-
isBetaLanguageEnabled:
|
|
96
|
-
isConfidenceScoreReviewEnabled:
|
|
92
|
+
handleCancel: se,
|
|
93
|
+
handleDelete: ce,
|
|
94
|
+
isAdvancedExtractAgentEnabled: O,
|
|
95
|
+
isAiSuggestionsFeatureEnabled: D,
|
|
96
|
+
isBetaLanguageEnabled: ee,
|
|
97
|
+
isConfidenceScoreReviewEnabled: H,
|
|
97
98
|
isDeleteButtonDisabled: te,
|
|
98
99
|
isFetchingSuggestions: q,
|
|
99
100
|
isFormDirty: t,
|
|
100
|
-
isLargeFile:
|
|
101
|
-
onToggleReviewFilter:
|
|
102
|
-
selectedTemplateInstance:
|
|
103
|
-
shouldShowOnlyReviewFields:
|
|
104
|
-
suggestions:
|
|
105
|
-
children:
|
|
101
|
+
isLargeFile: T,
|
|
102
|
+
onToggleReviewFilter: R,
|
|
103
|
+
selectedTemplateInstance: M,
|
|
104
|
+
shouldShowOnlyReviewFields: B,
|
|
105
|
+
suggestions: ie,
|
|
106
|
+
children: M && de
|
|
106
107
|
}),
|
|
107
|
-
|
|
108
|
+
P && /* @__PURE__ */ g(S, {
|
|
108
109
|
dirty: t,
|
|
109
|
-
onChange:
|
|
110
|
+
onChange: P,
|
|
110
111
|
values: e
|
|
111
112
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
onBackToEdit: () =>
|
|
114
|
-
onDiscardChanges:
|
|
115
|
-
open:
|
|
113
|
+
/* @__PURE__ */ g(a, {
|
|
114
|
+
onBackToEdit: () => z(!1),
|
|
115
|
+
onDiscardChanges: I,
|
|
116
|
+
open: A,
|
|
117
|
+
trackEvent: ae
|
|
116
118
|
}),
|
|
117
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ g(c, {
|
|
118
120
|
isCheckboxEnabled: ne,
|
|
119
|
-
onConfirm: () =>
|
|
121
|
+
onConfirm: () => F(M),
|
|
120
122
|
onDismiss: () => K(!1),
|
|
121
123
|
open: G,
|
|
122
|
-
templateName:
|
|
124
|
+
templateName: M?.displayName
|
|
123
125
|
})
|
|
124
126
|
] })
|
|
125
|
-
}, `${
|
|
127
|
+
}, `${M?.scope}.${M?.templateKey}`);
|
|
126
128
|
};
|
|
127
|
-
export {
|
|
129
|
+
export { C as MetadataInstanceForm };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../../../chunks/metadata-instance-
|
|
3
|
-
import { t as n } from "../../../../chunks/metadata-instance.js";
|
|
4
|
-
|
|
1
|
+
import { withAnalytics as e } from "../../utils/analytics/with-analytics.js";
|
|
2
|
+
import { t } from "../../../../chunks/metadata-instance-list.js";
|
|
3
|
+
import { t as n } from "../../../../chunks/metadata-instance-header.js";
|
|
4
|
+
import { t as r } from "../../../../chunks/metadata-instance.js";
|
|
5
|
+
var i = e(t), a = e(r);
|
|
6
|
+
export { a as MetadataInstance, n as MetadataInstanceHeader, i as MetadataInstanceList };
|
package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js
CHANGED
|
@@ -13,6 +13,7 @@ var s = ({ fieldsNeedingReviewCount: s, isLowScoreFilteringEnabled: c = !1, onTe
|
|
|
13
13
|
children: /* @__PURE__ */ a(r, {
|
|
14
14
|
content: f,
|
|
15
15
|
children: /* @__PURE__ */ a(n, {
|
|
16
|
+
"data-target-id": c ? "TextToggleButton-metadataEditorReviewFilterHide" : "TextToggleButton-metadataEditorReviewFilterView",
|
|
16
17
|
onPressedChange: l,
|
|
17
18
|
pressed: c,
|
|
18
19
|
children: c ? u.formatMessage(e.hideReviewFieldsCTA) : u.formatMessage(e.viewReviewFieldsCTA)
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { EVENT_NAMES as e } from "../../utils/analytics/events.js";
|
|
2
|
+
import t from "./messages.js";
|
|
3
|
+
import { Modal as n } from "@box/blueprint-web";
|
|
4
|
+
import { useCallback as r, useEffect as i, useState as a } from "react";
|
|
5
|
+
import { FormattedMessage as o, useIntl as s } from "react-intl";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
function u({ onBackToEdit: u, onDiscardChanges: d, defaultOpen: f = !0, open: p = f, trackEvent: m }) {
|
|
8
|
+
let h = s(), [g, _] = a(p);
|
|
9
|
+
i(() => _(p), [p]), i(() => {
|
|
10
|
+
g && m?.(e.UNSAVED_MODAL_SHOWN);
|
|
11
|
+
}, [g, m]);
|
|
12
|
+
let v = r(() => {
|
|
13
|
+
u(), _(!1);
|
|
14
|
+
}, [u]), y = r(() => {
|
|
15
|
+
m?.(e.UNSAVED_MODAL_DISCARD), d(), _(!1);
|
|
16
|
+
}, [d, m]);
|
|
17
|
+
return /* @__PURE__ */ c(n, {
|
|
15
18
|
modal: !0,
|
|
16
|
-
onOpenChange:
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
open:
|
|
20
|
-
children: /* @__PURE__ */
|
|
19
|
+
onOpenChange: r((e) => {
|
|
20
|
+
_(e), e || v();
|
|
21
|
+
}, [v]),
|
|
22
|
+
open: g,
|
|
23
|
+
children: /* @__PURE__ */ l(n.Content, {
|
|
21
24
|
onEscapeKeyDown: (e) => e.stopPropagation(),
|
|
22
25
|
size: "small",
|
|
23
26
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
27
|
+
/* @__PURE__ */ c(n.Header, { children: /* @__PURE__ */ c(o, { ...t.unsavedChangesModalHeader }) }),
|
|
28
|
+
/* @__PURE__ */ c(n.ScrollableContainer, { children: /* @__PURE__ */ c(n.Body, { children: /* @__PURE__ */ c(o, { ...t.unsavedChangesModalBody }) }) }),
|
|
29
|
+
/* @__PURE__ */ l(n.Footer, { children: [/* @__PURE__ */ c(n.Footer.SecondaryButton, {
|
|
30
|
+
"data-target-id": "Modal.Footer.SecondaryButton-metadataEditorUnsavedDiscard",
|
|
31
|
+
onClick: y,
|
|
28
32
|
size: "large",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onClick:
|
|
33
|
+
children: h.formatMessage(t.unsavedChangesModalDiscardChangesCTA)
|
|
34
|
+
}), /* @__PURE__ */ c(n.Footer.PrimaryButton, {
|
|
35
|
+
"data-target-id": "Modal.Footer.PrimaryButton-metadataEditorUnsavedBackToEdit",
|
|
36
|
+
onClick: v,
|
|
33
37
|
size: "large",
|
|
34
|
-
|
|
35
|
-
children: p.formatMessage(e.unsavedChangesModalContinueEditingCTA)
|
|
38
|
+
children: h.formatMessage(t.unsavedChangesModalContinueEditingCTA)
|
|
36
39
|
})] }),
|
|
37
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ c(n.Close, { "aria-label": h.formatMessage(t.unsavedChangesModalCloseLabel) })
|
|
38
41
|
]
|
|
39
42
|
})
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
|
-
export {
|
|
45
|
+
export { u as UnsavedChangesModal };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext as e, useContext as t, useMemo as n } from "react";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import i from "lodash/noop";
|
|
4
|
+
var a = /* @__PURE__ */ e({ trackEvent: i }), o = ({ children: e, trackEvent: t }) => {
|
|
5
|
+
let o = n(() => ({ trackEvent: t ?? i }), [t]);
|
|
6
|
+
return /* @__PURE__ */ r(a.Provider, {
|
|
7
|
+
value: o,
|
|
8
|
+
children: e
|
|
9
|
+
});
|
|
10
|
+
}, s = () => t(a);
|
|
11
|
+
export { a as AnalyticsContext, o as AnalyticsContextProvider, s as useMetadataEditorAnalytics };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var e = {
|
|
2
|
+
LOW_CONF_BADGE_HOVER: "metadata_editor_low_conf_badge_hover",
|
|
3
|
+
LOW_CONF_ICON_HOVER_READ_MODE: "metadata_editor_low_conf_icon_hover_read_mode",
|
|
4
|
+
AI_SUGGESTION_SHOWN: "metadata_editor_ai_suggestion_shown",
|
|
5
|
+
UNSAVED_MODAL_SHOWN: "metadata_editor_unsaved_modal_shown",
|
|
6
|
+
UNSAVED_MODAL_DISCARD: "metadata_editor_unsaved_modal_discard",
|
|
7
|
+
AI_LOGO_BADGE_HOVER: "metadata_editor_conf_score_icon_hover"
|
|
8
|
+
};
|
|
9
|
+
export { e as EVENT_NAMES };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EVENT_NAMES as e } from "./events.js";
|
|
2
|
+
import { AnalyticsContext as t, AnalyticsContextProvider as n, useMetadataEditorAnalytics as r } from "./analytics-context.js";
|
|
3
|
+
import { withAnalytics as i } from "./with-analytics.js";
|
|
4
|
+
export { t as AnalyticsContext, n as AnalyticsContextProvider, e as EVENT_NAMES, r as useMetadataEditorAnalytics, i as withAnalytics };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnalyticsContextProvider as e } from "./analytics-context.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = ({ trackEvent: r, ...i }) => /* @__PURE__ */ t(e, {
|
|
6
|
+
trackEvent: r,
|
|
7
|
+
children: /* @__PURE__ */ t(n, { ...i })
|
|
8
|
+
});
|
|
9
|
+
return r.displayName = `withAnalytics(${n.displayName || n.name || "Component"})`, r;
|
|
10
|
+
}
|
|
11
|
+
export { n as withAnalytics };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
1
|
+
import { formatConfidenceScorePercent as e } from "./format-confidence-score-percent.js";
|
|
2
|
+
import { getConfidenceScoreTooltip as t } from "./get-confidence-score-tooltip.js";
|
|
3
|
+
import { isConfidenceScoreNeedingReview as n } from "./is-confidence-score-needing-review.js";
|
|
4
|
+
import { getFieldsNeedingReview as r } from "./get-fields-needing-review.js";
|
|
5
|
+
export { e as formatConfidenceScorePercent, t as getConfidenceScoreTooltip, r as getFieldsNeedingReview, n as isConfidenceScoreNeedingReview };
|