@box/metadata-editor 1.64.4 → 1.64.6
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 +83 -0
- package/dist/chunks/autofill-overlay.js +63 -0
- package/dist/chunks/combobox-with-api-pagination.js +162 -0
- package/dist/chunks/custom-instance-new-field.js +60 -0
- package/dist/chunks/custom-instance.js +74 -0
- package/dist/chunks/delete-confirmation-modal.js +76 -0
- package/dist/chunks/field-action-bar.module.js +6 -8
- package/dist/chunks/filter-dropdown-menu.module.js +14 -13
- package/dist/chunks/filter-instances-dropdown.js +84 -0
- package/dist/chunks/interactive-header-text.js +19 -0
- package/dist/chunks/interactive-text.js +17 -0
- package/dist/chunks/metadata-editor.js +9 -0
- package/dist/chunks/metadata-instance-content.js +29 -0
- package/dist/chunks/metadata-instance-entry.js +82 -0
- package/dist/chunks/metadata-instance-footer.js +25 -0
- package/dist/chunks/metadata-instance-form-autofill-button.js +113 -0
- package/dist/chunks/metadata-instance-form-card-wrapper.js +47 -70
- package/dist/chunks/metadata-instance-form-footer.js +43 -0
- package/dist/chunks/metadata-instance-form-header.js +45 -0
- package/dist/chunks/metadata-instance-header.js +52 -0
- package/dist/chunks/metadata-instance-list.js +19 -0
- package/dist/chunks/metadata-instance.js +59 -0
- package/dist/chunks/shared-field-styles.module.js +5 -7
- package/dist/chunks/taxonomy-ancestor-status-pill.js +88 -109
- package/dist/chunks/types.js +8 -12
- package/dist/chunks/update-mode-field-wrapper.js +80 -0
- package/dist/chunks/utils.js +57 -54
- package/dist/chunks/utils2.js +50 -70
- package/dist/esm/index.js +27 -52
- package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +31 -43
- package/dist/esm/lib/components/add-metadata-template-dropdown/index.js +1 -3
- package/dist/esm/lib/components/add-metadata-template-dropdown/messages.js +15 -17
- package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +2 -205
- package/dist/esm/lib/components/combobox-with-api-pagination/index.js +2 -4
- package/dist/esm/lib/components/combobox-with-api-pagination/messages.js +31 -33
- package/dist/esm/lib/components/combobox-with-api-pagination/request.js +4 -6
- package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +113 -128
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/is-abort-error.js +8 -10
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +32 -34
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +72 -82
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-content.js +13 -18
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +16 -19
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-item.js +12 -17
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.js +15 -20
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-root.js +13 -18
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +36 -44
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-trigger.js +7 -12
- package/dist/esm/lib/components/filter-dropdown-menu/index.js +16 -18
- package/dist/esm/lib/components/filter-dropdown-menu/messages.js +10 -12
- package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +2 -93
- package/dist/esm/lib/components/filter-instances-dropdown/index.js +2 -4
- package/dist/esm/lib/components/filter-instances-dropdown/messages.js +18 -20
- package/dist/esm/lib/components/interactive-header-text/interactive-header-text.js +2 -28
- package/dist/esm/lib/components/interactive-text/interactive-text.js +2 -30
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +20 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +2 -110
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +50 -52
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js +12 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/constants.js +2 -6
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +20 -24
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +66 -75
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/messages.js +30 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +43 -60
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +47 -71
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +32 -54
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +8 -14
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +40 -62
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +28 -44
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +66 -95
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js +30 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js +7 -11
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +2 -92
- package/dist/esm/lib/components/metadata-editor-fields/editor-field-types.js +30 -34
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-memoized-field-label.js +11 -7
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-review-field-filter.js +35 -40
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-view-reference-tooltip.js +39 -34
- package/dist/esm/lib/components/metadata-editor-fields/messages.js +5 -9
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +186 -176
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +30 -42
- package/dist/esm/lib/components/metadata-editor-fields/utils.js +2 -13
- package/dist/esm/lib/components/metadata-empty-state/messages.js +42 -44
- package/dist/esm/lib/components/metadata-empty-state/metadata-empty-state.js +46 -62
- package/dist/esm/lib/components/metadata-instance-editor/index.js +7 -14
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +2 -64
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +39 -41
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/useErrorMessaging.js +21 -26
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +2 -86
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js +15 -17
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +2 -62
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js +42 -44
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js +2 -91
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js +50 -52
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/constants.js +2 -7
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/messages.js +0 -1
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +2 -10
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +126 -155
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.js +2 -9
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +23 -25
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +2 -128
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js +19 -21
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +2 -53
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +6 -10
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +2 -58
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +18 -20
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +30 -37
- package/dist/esm/lib/components/metadata-instance-list/index.js +4 -8
- package/dist/esm/lib/components/metadata-instance-list/metadata-instance-list.js +2 -35
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +2 -79
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +2 -40
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js +5 -9
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js +14 -24
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +2 -112
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js +22 -24
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.js +2 -11
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.js +24 -36
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js +10 -12
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +2 -31
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +15 -17
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +2 -63
- package/dist/esm/lib/components/metadata-instance-review-notice/messages.js +30 -32
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +22 -32
- package/dist/esm/lib/components/unsaved-changes-modal/index.js +2 -4
- package/dist/esm/lib/components/unsaved-changes-modal/messages.js +23 -25
- package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +41 -57
- package/dist/esm/lib/components/unsaved-changes-modal/utils.js +3 -5
- package/dist/esm/lib/constants.js +14 -18
- package/dist/esm/lib/defaults.js +14 -17
- package/dist/esm/lib/mappers.js +22 -28
- package/dist/esm/lib/messages.js +123 -126
- package/dist/esm/lib/metadata-editor.js +2 -14
- package/dist/esm/lib/utils/api-wrapper.js +12 -18
- package/dist/esm/lib/utils/autofill-context.js +65 -67
- package/dist/esm/lib/utils/check-if-has-bounding-boxes.js +2 -4
- package/dist/esm/lib/utils/confidence-score/format-confidence-score-percent.js +3 -5
- package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +12 -19
- package/dist/esm/lib/utils/confidence-score/get-fields-needing-review.js +5 -7
- package/dist/esm/lib/utils/confidence-score/index.js +5 -10
- package/dist/esm/lib/utils/confidence-score/is-confidence-score-needing-review.js +4 -6
- package/dist/esm/lib/utils/confidence-score/messages.js +14 -16
- package/dist/esm/lib/utils/convertDate.js +20 -31
- package/dist/esm/lib/utils/is-interactive-form-element.js +2 -4
- package/dist/esm/lib/utils/utils.js +4 -9
- package/dist/styles/autofill-overlay.css +1 -1
- package/dist/styles/combobox-with-api-pagination.css +1 -1
- package/dist/styles/custom-instance-new-field.css +1 -1
- package/dist/styles/custom-instance.css +1 -1
- package/dist/styles/delete-confirmation-modal.css +1 -1
- package/dist/styles/field-action-bar.css +1 -1
- package/dist/styles/filter-dropdown-menu.css +1 -1
- package/dist/styles/filter-instances-dropdown.css +1 -1
- package/dist/styles/interactive-header-text.css +1 -1
- package/dist/styles/interactive-text.css +1 -1
- package/dist/styles/metadata-editor.css +1 -0
- package/dist/styles/metadata-instance-content.css +1 -1
- package/dist/styles/metadata-instance-entry.css +1 -1
- package/dist/styles/metadata-instance-footer.css +1 -1
- package/dist/styles/metadata-instance-form-autofill-button.css +1 -1
- package/dist/styles/metadata-instance-form-card-wrapper.css +1 -1
- package/dist/styles/metadata-instance-form-footer.css +1 -1
- package/dist/styles/metadata-instance-form-header.css +1 -1
- package/dist/styles/metadata-instance-header.css +1 -1
- package/dist/styles/metadata-instance-list.css +1 -1
- package/dist/styles/shared-field-styles.css +1 -1
- package/dist/styles/taxonomy-ancestor-status-pill.css +1 -1
- package/dist/styles/update-mode-field-wrapper.css +1 -1
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/test-utils/index.d.ts +1 -0
- package/dist/types/lib/test-utils/pending-promise.d.ts +19 -0
- package/package.json +10 -10
|
@@ -1,177 +1,187 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
1
|
+
import e from "../../messages.js";
|
|
2
|
+
import { t } from "../../../../chunks/types.js";
|
|
3
|
+
import { isConfidenceScoreNeedingReview as n } from "../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
4
|
+
import { checkIfHasBoundingBoxes as r } from "../../utils/check-if-has-bounding-boxes.js";
|
|
5
|
+
import { isInteractiveFormElement as i } from "../../utils/is-interactive-form-element.js";
|
|
6
|
+
import { t as a } from "../../../../chunks/shared-field-styles.module.js";
|
|
7
|
+
import { t as ee } from "../../../../chunks/ai-suggestion-field.js";
|
|
8
|
+
import { LowConfidenceSuggestionField as o } from "./components/low-confidence-suggestion-field/low-confidence-suggestion-field.js";
|
|
9
|
+
import { t as s } from "../../../../chunks/update-mode-field-wrapper.js";
|
|
10
|
+
import { r as c } from "../../../../chunks/utils.js";
|
|
11
|
+
import { editorFieldTypes as te } from "./editor-field-types.js";
|
|
12
|
+
import { useViewReferenceTooltip as l } from "./hooks/use-view-reference-tooltip.js";
|
|
13
|
+
import { Tooltip as u } from "@box/blueprint-web";
|
|
14
|
+
import { forwardRef as d, memo as f, useCallback as p, useEffect as m, useMemo as ne } from "react";
|
|
15
|
+
import { useIntl as re } from "react-intl";
|
|
16
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
17
|
+
import _ from "clsx";
|
|
18
|
+
import { useFormikContext as v } from "formik";
|
|
19
|
+
import ie from "lodash/isEqual";
|
|
20
|
+
import ae from "lodash/isUndefined";
|
|
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 } = v(), { formatMessage: D } = re(), O = y.aiSuggestionState || t.Initial, k = O === t.Pending, A = O === t.Applied, j = O === t.Initial, M = te[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 && n(y.confidenceScore), W = H && !k && !n(y.confidenceScore), G = se === y.id, ce = r(y.targetLocation), K = H && ce && !!w, { isTooltipOpen: q, handleMouseOver: le, handleMouseLeave: ue, handleFocus: de, handleBlur: fe } = l(K), pe = _({
|
|
23
|
+
[c.aiApproved]: A || W,
|
|
24
|
+
[c.hasSuggestion]: k,
|
|
25
|
+
[c.hasConfidenceReview]: !k && U,
|
|
26
|
+
[c.dateField]: I === "date"
|
|
27
|
+
}), J = p((e) => {
|
|
28
|
+
E(`${B}.aiSuggestionState`, e);
|
|
29
|
+
}, [B, E]), Y = p((e, n = !1) => {
|
|
30
|
+
if (E(`${B}.value`, e), J(t.Applied), C && P) {
|
|
31
|
+
let e = n ? {
|
|
32
|
+
...P,
|
|
33
|
+
isAccepted: !0
|
|
34
|
+
} : P;
|
|
35
|
+
E(`${B}.confidenceScore`, e), E(`${B}.aiSuggestionConfidenceScore`, void 0), E(`${B}.targetLocation`, F), E(`${B}.aiSuggestionTargetLocation`, void 0);
|
|
36
|
+
}
|
|
37
|
+
}, [
|
|
38
|
+
B,
|
|
39
|
+
E,
|
|
40
|
+
J,
|
|
41
|
+
P,
|
|
42
|
+
F,
|
|
43
|
+
C
|
|
44
|
+
]), X = p(() => {
|
|
45
|
+
J(t.Initial), E(`${B}.aiSuggestion`, void 0), C && (E(`${B}.aiSuggestionConfidenceScore`, void 0), E(`${B}.aiSuggestionTargetLocation`, void 0));
|
|
46
|
+
}, [
|
|
47
|
+
J,
|
|
48
|
+
E,
|
|
49
|
+
B,
|
|
50
|
+
C
|
|
51
|
+
]), me = p(() => {
|
|
52
|
+
y.confidenceScore && E(`${B}.confidenceScore`, {
|
|
53
|
+
...y.confidenceScore,
|
|
54
|
+
isAccepted: !0
|
|
55
|
+
}), w?.(null);
|
|
56
|
+
}, [
|
|
57
|
+
B,
|
|
58
|
+
E,
|
|
59
|
+
y.confidenceScore,
|
|
60
|
+
w
|
|
61
|
+
]), he = p(() => {
|
|
62
|
+
J(t.Initial), E(`${B}.aiSuggestion`, void 0);
|
|
63
|
+
let e = I === "multiSelect" || I === "taxonomy" ? [] : "";
|
|
64
|
+
E(`${B}.value`, e), E(`${B}.confidenceScore`, void 0), E(`${B}.targetLocation`, void 0), w?.(null);
|
|
65
|
+
}, [
|
|
66
|
+
B,
|
|
67
|
+
E,
|
|
68
|
+
I,
|
|
69
|
+
w,
|
|
70
|
+
J
|
|
71
|
+
]), Z = p(() => {
|
|
72
|
+
X(), C && y.confidenceScore && (E(`${B}.confidenceScore`, void 0), w?.(null));
|
|
73
|
+
}, [
|
|
74
|
+
X,
|
|
75
|
+
C,
|
|
76
|
+
y.confidenceScore,
|
|
77
|
+
E,
|
|
78
|
+
B,
|
|
79
|
+
w
|
|
80
|
+
]), ge = p((e) => {
|
|
81
|
+
w && (i(e.target) || w(y));
|
|
82
|
+
}, [y, w]), _e = p((e) => {
|
|
83
|
+
if (e.key === "Enter") {
|
|
84
|
+
if (!w || i(e.target)) return;
|
|
85
|
+
e.preventDefault(), e.stopPropagation(), w(y);
|
|
86
|
+
}
|
|
87
|
+
}, [y, w]);
|
|
88
|
+
m(() => {
|
|
89
|
+
k && (!L || Array.isArray(L) && L.length === 0) && Y(N);
|
|
90
|
+
}, [
|
|
91
|
+
N,
|
|
92
|
+
k,
|
|
93
|
+
Y
|
|
94
|
+
]), m(() => {
|
|
95
|
+
j && N && J(t.Pending);
|
|
96
|
+
}, [
|
|
97
|
+
j,
|
|
98
|
+
N,
|
|
99
|
+
J
|
|
100
|
+
]);
|
|
101
|
+
let ve = ne(() => N ? ie(L, N) : !1, [N, L]);
|
|
102
|
+
if (!R) return null;
|
|
103
|
+
let Q = {
|
|
104
|
+
"data-metadata-field": !0,
|
|
105
|
+
"data-testid": "metadata-field",
|
|
106
|
+
onClick: ge,
|
|
107
|
+
onKeyDown: _e,
|
|
108
|
+
onMouseOver: le,
|
|
109
|
+
onMouseLeave: ue,
|
|
110
|
+
onFocus: de,
|
|
111
|
+
onBlur: fe,
|
|
112
|
+
role: "button",
|
|
113
|
+
tabIndex: 0
|
|
114
|
+
};
|
|
115
|
+
if (z) {
|
|
116
|
+
let t = /* @__PURE__ */ h(s, {
|
|
117
|
+
fieldNamePrefix: B,
|
|
118
|
+
fieldType: y.type,
|
|
119
|
+
isTaxonomyMultiSelect: V,
|
|
120
|
+
children: /* @__PURE__ */ h(M, {
|
|
121
|
+
ref: T,
|
|
122
|
+
description: y.description,
|
|
123
|
+
disableForm: d,
|
|
124
|
+
fieldNamePrefix: B,
|
|
125
|
+
isAiSuggestionApplied: !1,
|
|
126
|
+
isExternallyOwned: x,
|
|
127
|
+
isMultilevelTaxonomyFieldEnabled: S,
|
|
128
|
+
label: y.displayName,
|
|
129
|
+
levels: y.levels,
|
|
130
|
+
onValueEdited: Z,
|
|
131
|
+
portalElement: f,
|
|
132
|
+
taxonomyOptionsFetcher: b
|
|
133
|
+
})
|
|
134
|
+
}, y.key);
|
|
135
|
+
return K ? /* @__PURE__ */ h(u, {
|
|
136
|
+
content: D(e.viewOnDocument),
|
|
137
|
+
open: q,
|
|
138
|
+
children: /* @__PURE__ */ h("div", {
|
|
139
|
+
className: _(a.spacious, a.clickableField, G && a.selectedField),
|
|
140
|
+
...Q,
|
|
141
|
+
children: t
|
|
142
|
+
})
|
|
143
|
+
}) : t;
|
|
144
|
+
}
|
|
145
|
+
let $ = /* @__PURE__ */ g("div", {
|
|
146
|
+
className: _(c.fieldWrapper, C && a.spacious, K && a.clickableField, K && G && a.selectedField),
|
|
147
|
+
...K && Q,
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ h(M, {
|
|
150
|
+
ref: T,
|
|
151
|
+
className: pe,
|
|
152
|
+
description: y.description,
|
|
153
|
+
disableForm: d,
|
|
154
|
+
fieldNamePrefix: B,
|
|
155
|
+
isAiSuggestionApplied: A,
|
|
156
|
+
isExternallyOwned: x,
|
|
157
|
+
confidenceScore: C ? y.confidenceScore : void 0,
|
|
158
|
+
isMultilevelTaxonomyFieldEnabled: S,
|
|
159
|
+
label: y.displayName,
|
|
160
|
+
onValueEdited: Z,
|
|
161
|
+
portalElement: f,
|
|
162
|
+
taxonomyOptionsFetcher: b
|
|
163
|
+
}),
|
|
164
|
+
k && /* @__PURE__ */ h(ee, {
|
|
165
|
+
aiSuggestion: N,
|
|
166
|
+
confidenceLevel: C ? P?.level : void 0,
|
|
167
|
+
isSameValue: ve,
|
|
168
|
+
onAiSuggestionAppend: () => {
|
|
169
|
+
Y([...new Set([L, N].flat().filter(Boolean))], !0);
|
|
170
|
+
},
|
|
171
|
+
onAiSuggestionIgnore: X,
|
|
172
|
+
onAiSuggestionReplace: () => Y(N, !0),
|
|
173
|
+
type: I
|
|
174
|
+
}),
|
|
175
|
+
!k && U && /* @__PURE__ */ h(o, {
|
|
176
|
+
onAccept: me,
|
|
177
|
+
onClear: he
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
}, y.key);
|
|
181
|
+
return K ? /* @__PURE__ */ h(u, {
|
|
182
|
+
content: D(e.viewOnDocument),
|
|
183
|
+
open: q,
|
|
184
|
+
children: $
|
|
185
|
+
}) : $;
|
|
174
186
|
}));
|
|
175
|
-
export {
|
|
176
|
-
Je as MetadataEditorFieldWrapper
|
|
177
|
-
};
|
|
187
|
+
export { y as MetadataEditorFieldWrapper };
|
|
@@ -1,43 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}))
|
|
31
|
-
}) : /* @__PURE__ */ o(d, {
|
|
32
|
-
as: "span",
|
|
33
|
-
className: R.noAttributesText,
|
|
34
|
-
color: "textOnLightSecondary",
|
|
35
|
-
children: /* @__PURE__ */ o(y, {
|
|
36
|
-
...g.noTemplateAtributesError
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
N as TemplateInstance,
|
|
42
|
-
N as default
|
|
1
|
+
import e from "../../messages.js";
|
|
2
|
+
import { r as t } from "../../../../chunks/utils.js";
|
|
3
|
+
import { MetadataEditorFieldWrapper as n } from "./metadata-editor-field-wrapper.js";
|
|
4
|
+
import { useReviewFieldFilter as r } from "./hooks/use-review-field-filter.js";
|
|
5
|
+
import { Text as i } from "@box/blueprint-web";
|
|
6
|
+
import { createElement as a, useEffect as o, useRef as s } from "react";
|
|
7
|
+
import { FormattedMessage as c } from "react-intl";
|
|
8
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
+
import { FieldArray as u, getIn as d, useFormikContext as f } from "formik";
|
|
10
|
+
var p = (p) => {
|
|
11
|
+
let { shouldShowOnlyReviewFields: m = !1 } = p, { values: h } = f(), g = "metadata.fields", _ = d(h, g), v = s(null), y = r(_, m), b = _.findIndex((e) => !e.hidden);
|
|
12
|
+
return o(() => {
|
|
13
|
+
b > -1 && v.current?.focus();
|
|
14
|
+
}, []), _.length ? /* @__PURE__ */ l(u, {
|
|
15
|
+
name: g,
|
|
16
|
+
validateOnChange: !1,
|
|
17
|
+
children: () => y.map(({ field: e, originalIndex: t }) => /* @__PURE__ */ a(n, {
|
|
18
|
+
...p,
|
|
19
|
+
key: e.key,
|
|
20
|
+
ref: t === b ? v : null,
|
|
21
|
+
field: e,
|
|
22
|
+
index: t
|
|
23
|
+
}))
|
|
24
|
+
}) : /* @__PURE__ */ l(i, {
|
|
25
|
+
as: "span",
|
|
26
|
+
className: t.noAttributesText,
|
|
27
|
+
color: "textOnLightSecondary",
|
|
28
|
+
children: /* @__PURE__ */ l(c, { ...e.noTemplateAtributesError })
|
|
29
|
+
});
|
|
43
30
|
};
|
|
31
|
+
export { p as TemplateInstance, p as default };
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
3
|
-
import "../../utils/convertDate.js";
|
|
4
|
-
import "../interactive-text/interactive-text.js";
|
|
5
|
-
import { g as l, t as b } from "../../../../chunks/utils2.js";
|
|
6
|
-
import "react/jsx-runtime";
|
|
7
|
-
import "../../utils/confidence-score/is-confidence-score-needing-review.js";
|
|
8
|
-
import "./components/low-confidence-badge/low-confidence-badge.js";
|
|
9
|
-
import "./components/ai-logo-badge/ai-logo-badge.js";
|
|
10
|
-
export {
|
|
11
|
-
l as getFieldLabel,
|
|
12
|
-
b as tryParseDateSuggestion
|
|
13
|
-
};
|
|
1
|
+
import { n as e, t } from "../../../../chunks/utils.js";
|
|
2
|
+
export { t as getFieldLabel, e as tryParseDateSuggestion };
|
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
managerLevelEmptyStateHeading: {
|
|
4
|
+
id: "metadataEditor.managerLevel.emptyState.heading",
|
|
5
|
+
defaultMessage: "Apply Metadata Templates"
|
|
6
|
+
},
|
|
7
|
+
managerLevelEmptyStateBody: {
|
|
8
|
+
id: "metadataEditor.managerLevel.emptyState.body",
|
|
9
|
+
defaultMessage: "Browse or search for your items to apply and edit metadata"
|
|
10
|
+
},
|
|
11
|
+
fileLevelEmptyStateBoxAiEnabledHeading: {
|
|
12
|
+
id: "metadataEditor.fileLevel.emptyState.boxAiEnabled.heading",
|
|
13
|
+
defaultMessage: "Autofill Metadata with Box AI"
|
|
14
|
+
},
|
|
15
|
+
fileLevelEmptyStateBoxAiEnabledBody: {
|
|
16
|
+
id: "metadataEditor.fileLevel.emptyState.boxAiEnabled.body",
|
|
17
|
+
defaultMessage: "Use the power of Box AI to quickly capture document metadata, with ever-increasing accuracy."
|
|
18
|
+
},
|
|
19
|
+
fileLevelEmptyStateDefaultHeading: {
|
|
20
|
+
id: "metadataEditor.fileLevel.emptyState.default.heading",
|
|
21
|
+
defaultMessage: "Add Metadata Templates"
|
|
22
|
+
},
|
|
23
|
+
fileLevelEmptyStateDefaultBody: {
|
|
24
|
+
id: "metadataEditor.fileLevel.emptyState.default.body",
|
|
25
|
+
defaultMessage: "Add Metadata to your file to support business operations, workflows, and more!"
|
|
26
|
+
},
|
|
27
|
+
instanceLevelEmptyStateHeading: {
|
|
28
|
+
id: "metadataEditor.instanceLevel.emptyState.heading",
|
|
29
|
+
defaultMessage: "This template has no values"
|
|
30
|
+
},
|
|
31
|
+
instanceLevelEmptyStateHeadingNoAttributes: {
|
|
32
|
+
id: "metadataEditor.instanceLevel.emptyState.noAttributes.heading",
|
|
33
|
+
defaultMessage: "This template has no attributes"
|
|
34
|
+
},
|
|
35
|
+
instanceLevelEmptyStateNoEmptyValuesBody: {
|
|
36
|
+
id: "metadataEditor.instanceLevel.emptyState.noEmptyValues.body",
|
|
37
|
+
defaultMessage: "This template has no values"
|
|
38
|
+
},
|
|
39
|
+
instanceLevelSeeEmptyValuesCTA: {
|
|
40
|
+
id: "metadataEditor.instanceLevel.emptyState.emptyValues.Cta",
|
|
41
|
+
defaultMessage: "See empty values"
|
|
42
|
+
}
|
|
43
43
|
});
|
|
44
|
-
export {
|
|
45
|
-
a as default
|
|
46
|
-
};
|
|
44
|
+
export { t as default };
|