@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.
Files changed (173) hide show
  1. package/dist/chunks/ai-suggestion-field.js +83 -0
  2. package/dist/chunks/autofill-overlay.js +63 -0
  3. package/dist/chunks/combobox-with-api-pagination.js +162 -0
  4. package/dist/chunks/custom-instance-new-field.js +60 -0
  5. package/dist/chunks/custom-instance.js +74 -0
  6. package/dist/chunks/delete-confirmation-modal.js +76 -0
  7. package/dist/chunks/field-action-bar.module.js +6 -8
  8. package/dist/chunks/filter-dropdown-menu.module.js +14 -13
  9. package/dist/chunks/filter-instances-dropdown.js +84 -0
  10. package/dist/chunks/interactive-header-text.js +19 -0
  11. package/dist/chunks/interactive-text.js +17 -0
  12. package/dist/chunks/metadata-editor.js +9 -0
  13. package/dist/chunks/metadata-instance-content.js +29 -0
  14. package/dist/chunks/metadata-instance-entry.js +82 -0
  15. package/dist/chunks/metadata-instance-footer.js +25 -0
  16. package/dist/chunks/metadata-instance-form-autofill-button.js +113 -0
  17. package/dist/chunks/metadata-instance-form-card-wrapper.js +47 -70
  18. package/dist/chunks/metadata-instance-form-footer.js +43 -0
  19. package/dist/chunks/metadata-instance-form-header.js +45 -0
  20. package/dist/chunks/metadata-instance-header.js +52 -0
  21. package/dist/chunks/metadata-instance-list.js +19 -0
  22. package/dist/chunks/metadata-instance.js +59 -0
  23. package/dist/chunks/shared-field-styles.module.js +5 -7
  24. package/dist/chunks/taxonomy-ancestor-status-pill.js +88 -109
  25. package/dist/chunks/types.js +8 -12
  26. package/dist/chunks/update-mode-field-wrapper.js +80 -0
  27. package/dist/chunks/utils.js +57 -54
  28. package/dist/chunks/utils2.js +50 -70
  29. package/dist/esm/index.js +27 -52
  30. package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +31 -43
  31. package/dist/esm/lib/components/add-metadata-template-dropdown/index.js +1 -3
  32. package/dist/esm/lib/components/add-metadata-template-dropdown/messages.js +15 -17
  33. package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +2 -205
  34. package/dist/esm/lib/components/combobox-with-api-pagination/index.js +2 -4
  35. package/dist/esm/lib/components/combobox-with-api-pagination/messages.js +31 -33
  36. package/dist/esm/lib/components/combobox-with-api-pagination/request.js +4 -6
  37. package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +113 -128
  38. package/dist/esm/lib/components/combobox-with-api-pagination/utils/is-abort-error.js +8 -10
  39. package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +32 -34
  40. package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +72 -82
  41. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-content.js +13 -18
  42. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +16 -19
  43. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-item.js +12 -17
  44. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.js +15 -20
  45. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-root.js +13 -18
  46. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +36 -44
  47. package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-trigger.js +7 -12
  48. package/dist/esm/lib/components/filter-dropdown-menu/index.js +16 -18
  49. package/dist/esm/lib/components/filter-dropdown-menu/messages.js +10 -12
  50. package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +2 -93
  51. package/dist/esm/lib/components/filter-instances-dropdown/index.js +2 -4
  52. package/dist/esm/lib/components/filter-instances-dropdown/messages.js +18 -20
  53. package/dist/esm/lib/components/interactive-header-text/interactive-header-text.js +2 -28
  54. package/dist/esm/lib/components/interactive-text/interactive-text.js +2 -30
  55. package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +20 -32
  56. package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/index.js +2 -4
  57. package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +2 -110
  58. package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/index.js +2 -4
  59. package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +50 -52
  60. package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js +12 -17
  61. package/dist/esm/lib/components/metadata-editor-fields/components/constants.js +2 -6
  62. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/index.js +2 -4
  63. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +20 -24
  64. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/index.js +2 -4
  65. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +66 -75
  66. package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/messages.js +30 -32
  67. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +43 -60
  68. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +47 -71
  69. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +32 -54
  70. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +8 -14
  71. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +40 -62
  72. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +28 -44
  73. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +66 -95
  74. package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js +30 -32
  75. package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js +7 -11
  76. package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +2 -92
  77. package/dist/esm/lib/components/metadata-editor-fields/editor-field-types.js +30 -34
  78. package/dist/esm/lib/components/metadata-editor-fields/hooks/use-memoized-field-label.js +11 -7
  79. package/dist/esm/lib/components/metadata-editor-fields/hooks/use-review-field-filter.js +35 -40
  80. package/dist/esm/lib/components/metadata-editor-fields/hooks/use-view-reference-tooltip.js +39 -34
  81. package/dist/esm/lib/components/metadata-editor-fields/messages.js +5 -9
  82. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +186 -176
  83. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +30 -42
  84. package/dist/esm/lib/components/metadata-editor-fields/utils.js +2 -13
  85. package/dist/esm/lib/components/metadata-empty-state/messages.js +42 -44
  86. package/dist/esm/lib/components/metadata-empty-state/metadata-empty-state.js +46 -62
  87. package/dist/esm/lib/components/metadata-instance-editor/index.js +7 -14
  88. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +2 -64
  89. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +39 -41
  90. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/useErrorMessaging.js +21 -26
  91. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +2 -86
  92. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js +15 -17
  93. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +2 -62
  94. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js +42 -44
  95. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js +2 -91
  96. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js +50 -52
  97. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/constants.js +2 -7
  98. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/messages.js +0 -1
  99. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +2 -10
  100. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +126 -155
  101. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.js +2 -9
  102. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +23 -25
  103. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +2 -128
  104. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js +19 -21
  105. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +2 -53
  106. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +6 -10
  107. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +2 -58
  108. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +18 -20
  109. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +30 -37
  110. package/dist/esm/lib/components/metadata-instance-list/index.js +4 -8
  111. package/dist/esm/lib/components/metadata-instance-list/metadata-instance-list.js +2 -35
  112. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +2 -79
  113. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +2 -40
  114. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js +5 -9
  115. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js +14 -24
  116. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +2 -112
  117. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js +22 -24
  118. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.js +2 -11
  119. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.js +24 -36
  120. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js +10 -12
  121. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +2 -31
  122. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +15 -17
  123. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +2 -63
  124. package/dist/esm/lib/components/metadata-instance-review-notice/messages.js +30 -32
  125. package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +22 -32
  126. package/dist/esm/lib/components/unsaved-changes-modal/index.js +2 -4
  127. package/dist/esm/lib/components/unsaved-changes-modal/messages.js +23 -25
  128. package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +41 -57
  129. package/dist/esm/lib/components/unsaved-changes-modal/utils.js +3 -5
  130. package/dist/esm/lib/constants.js +14 -18
  131. package/dist/esm/lib/defaults.js +14 -17
  132. package/dist/esm/lib/mappers.js +22 -28
  133. package/dist/esm/lib/messages.js +123 -126
  134. package/dist/esm/lib/metadata-editor.js +2 -14
  135. package/dist/esm/lib/utils/api-wrapper.js +12 -18
  136. package/dist/esm/lib/utils/autofill-context.js +65 -67
  137. package/dist/esm/lib/utils/check-if-has-bounding-boxes.js +2 -4
  138. package/dist/esm/lib/utils/confidence-score/format-confidence-score-percent.js +3 -5
  139. package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +12 -19
  140. package/dist/esm/lib/utils/confidence-score/get-fields-needing-review.js +5 -7
  141. package/dist/esm/lib/utils/confidence-score/index.js +5 -10
  142. package/dist/esm/lib/utils/confidence-score/is-confidence-score-needing-review.js +4 -6
  143. package/dist/esm/lib/utils/confidence-score/messages.js +14 -16
  144. package/dist/esm/lib/utils/convertDate.js +20 -31
  145. package/dist/esm/lib/utils/is-interactive-form-element.js +2 -4
  146. package/dist/esm/lib/utils/utils.js +4 -9
  147. package/dist/styles/autofill-overlay.css +1 -1
  148. package/dist/styles/combobox-with-api-pagination.css +1 -1
  149. package/dist/styles/custom-instance-new-field.css +1 -1
  150. package/dist/styles/custom-instance.css +1 -1
  151. package/dist/styles/delete-confirmation-modal.css +1 -1
  152. package/dist/styles/field-action-bar.css +1 -1
  153. package/dist/styles/filter-dropdown-menu.css +1 -1
  154. package/dist/styles/filter-instances-dropdown.css +1 -1
  155. package/dist/styles/interactive-header-text.css +1 -1
  156. package/dist/styles/interactive-text.css +1 -1
  157. package/dist/styles/metadata-editor.css +1 -0
  158. package/dist/styles/metadata-instance-content.css +1 -1
  159. package/dist/styles/metadata-instance-entry.css +1 -1
  160. package/dist/styles/metadata-instance-footer.css +1 -1
  161. package/dist/styles/metadata-instance-form-autofill-button.css +1 -1
  162. package/dist/styles/metadata-instance-form-card-wrapper.css +1 -1
  163. package/dist/styles/metadata-instance-form-footer.css +1 -1
  164. package/dist/styles/metadata-instance-form-header.css +1 -1
  165. package/dist/styles/metadata-instance-header.css +1 -1
  166. package/dist/styles/metadata-instance-list.css +1 -1
  167. package/dist/styles/shared-field-styles.css +1 -1
  168. package/dist/styles/taxonomy-ancestor-status-pill.css +1 -1
  169. package/dist/styles/update-mode-field-wrapper.css +1 -1
  170. package/dist/styles/utils.css +1 -1
  171. package/dist/types/lib/test-utils/index.d.ts +1 -0
  172. package/dist/types/lib/test-utils/pending-promise.d.ts +19 -0
  173. package/package.json +10 -10
@@ -1,54 +1,52 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const i = e({
3
- aiSuggestionCaption: {
4
- id: "metadataEditor.aiSuggestionField.aiSuggestionCaption",
5
- defaultMessage: "Box AI suggestion:"
6
- },
7
- sameValueAiSuggestionCaption: {
8
- id: "metadataEditor.aiSuggestionField.sameValueAiSuggestionCaption",
9
- defaultMessage: "Box AI suggests the same value as above"
10
- },
11
- sameValueAiSuggestionCaptionWithLevel: {
12
- id: "metadataEditor.aiSuggestionField.sameValueAiSuggestionCaptionWithLevel",
13
- defaultMessage: "Box AI suggests the same value as above ({level} confidence)"
14
- },
15
- aiSuggestionOptions: {
16
- id: "metadataEditor.aiSuggestionField.aiSuggestionOptions",
17
- defaultMessage: "Options"
18
- },
19
- aiSuggestionAppend: {
20
- id: "metadataEditor.aiSuggestionField.appendLabel",
21
- defaultMessage: "Append"
22
- },
23
- aiSuggestionClearAndReplace: {
24
- id: "metadataEditor.aiSuggestionField.clearAndReplaceLabel",
25
- defaultMessage: "Clear and Replace"
26
- },
27
- aiSuggestionIgnore: {
28
- id: "metadataEditor.aiSuggestionField.ignoreLabel",
29
- defaultMessage: "Ignore"
30
- },
31
- aiSuggestionCaptionWithLevel: {
32
- id: "metadataEditor.aiSuggestionField.aiSuggestionCaptionWithLevel",
33
- defaultMessage: "Box AI suggestion ({level} confidence)"
34
- },
35
- confidenceLevelHigh: {
36
- id: "metadataEditor.aiSuggestionField.confidenceLevelHigh",
37
- defaultMessage: "High"
38
- },
39
- confidenceLevelLow: {
40
- id: "metadataEditor.aiSuggestionField.confidenceLevelLow",
41
- defaultMessage: "Low"
42
- },
43
- aiSuggestionConfirm: {
44
- id: "metadataEditor.aiSuggestionField.dismissLabel",
45
- defaultMessage: "Confirm"
46
- },
47
- aiSuggestionAccept: {
48
- id: "metadataEditor.aiSuggestionField.acceptLabel",
49
- defaultMessage: "Accept suggestion"
50
- }
2
+ var t = e({
3
+ aiSuggestionCaption: {
4
+ id: "metadataEditor.aiSuggestionField.aiSuggestionCaption",
5
+ defaultMessage: "Box AI suggestion:"
6
+ },
7
+ sameValueAiSuggestionCaption: {
8
+ id: "metadataEditor.aiSuggestionField.sameValueAiSuggestionCaption",
9
+ defaultMessage: "Box AI suggests the same value as above"
10
+ },
11
+ sameValueAiSuggestionCaptionWithLevel: {
12
+ id: "metadataEditor.aiSuggestionField.sameValueAiSuggestionCaptionWithLevel",
13
+ defaultMessage: "Box AI suggests the same value as above ({level} confidence)"
14
+ },
15
+ aiSuggestionOptions: {
16
+ id: "metadataEditor.aiSuggestionField.aiSuggestionOptions",
17
+ defaultMessage: "Options"
18
+ },
19
+ aiSuggestionAppend: {
20
+ id: "metadataEditor.aiSuggestionField.appendLabel",
21
+ defaultMessage: "Append"
22
+ },
23
+ aiSuggestionClearAndReplace: {
24
+ id: "metadataEditor.aiSuggestionField.clearAndReplaceLabel",
25
+ defaultMessage: "Clear and Replace"
26
+ },
27
+ aiSuggestionIgnore: {
28
+ id: "metadataEditor.aiSuggestionField.ignoreLabel",
29
+ defaultMessage: "Ignore"
30
+ },
31
+ aiSuggestionCaptionWithLevel: {
32
+ id: "metadataEditor.aiSuggestionField.aiSuggestionCaptionWithLevel",
33
+ defaultMessage: "Box AI suggestion ({level} confidence)"
34
+ },
35
+ confidenceLevelHigh: {
36
+ id: "metadataEditor.aiSuggestionField.confidenceLevelHigh",
37
+ defaultMessage: "High"
38
+ },
39
+ confidenceLevelLow: {
40
+ id: "metadataEditor.aiSuggestionField.confidenceLevelLow",
41
+ defaultMessage: "Low"
42
+ },
43
+ aiSuggestionConfirm: {
44
+ id: "metadataEditor.aiSuggestionField.dismissLabel",
45
+ defaultMessage: "Confirm"
46
+ },
47
+ aiSuggestionAccept: {
48
+ id: "metadataEditor.aiSuggestionField.acceptLabel",
49
+ defaultMessage: "Accept suggestion"
50
+ }
51
51
  });
52
- export {
53
- i as default
54
- };
52
+ export { t as default };
@@ -1,18 +1,13 @@
1
- import { getLocalTimeZone as a, DateFormatter as f } from "@box/blueprint-web";
2
- import { convertIsoStringToCalendarDate as m } from "../../../../utils/convertDate.js";
3
- function c(t, {
4
- type: n = "string",
5
- locale: i = "en"
6
- } = {}) {
7
- if (n === "date" && typeof t == "string") {
8
- const r = !isNaN(new Date(t).getTime()), o = m(t);
9
- if (o && r) {
10
- const e = o.toDate(a());
11
- return new f(i).format(e);
12
- }
13
- }
14
- return n === "taxonomy" ? Array.isArray(t) && t.length > 0 ? t.map((r) => r.displayValue).join(", ") : t.toString() : t == null ? null : typeof t == "number" ? t.toString() : Array.isArray(t) ? t.join(", ") : t;
1
+ import { convertIsoStringToCalendarDate as e } from "../../../../utils/convertDate.js";
2
+ import { DateFormatter as t, getLocalTimeZone as n } from "@box/blueprint-web";
3
+ function r(r, { type: i = "string", locale: a = "en" } = {}) {
4
+ if (i === "date" && typeof r == "string") {
5
+ let i = !isNaN(new Date(r).getTime()), o = e(r);
6
+ if (o && i) {
7
+ let e = o.toDate(n());
8
+ return new t(a).format(e);
9
+ }
10
+ }
11
+ return i === "taxonomy" ? Array.isArray(r) && r.length > 0 ? r.map((e) => e.displayValue).join(", ") : r.toString() : r == null ? null : typeof r == "number" ? r.toString() : Array.isArray(r) ? r.join(", ") : r;
15
12
  }
16
- export {
17
- c as formatSuggestionValue
18
- };
13
+ export { r as formatSuggestionValue };
@@ -1,6 +1,2 @@
1
- const e = {
2
- maxLength: 255
3
- };
4
- export {
5
- e as fieldDefaultProps
6
- };
1
+ var e = { maxLength: 255 };
2
+ export { e as fieldDefaultProps };
@@ -1,4 +1,2 @@
1
- import { LowConfidenceBadge as d } from "./low-confidence-badge.js";
2
- export {
3
- d as LowConfidenceBadge
4
- };
1
+ import { LowConfidenceBadge as e } from "./low-confidence-badge.js";
2
+ export { e as LowConfidenceBadge };
@@ -1,25 +1,21 @@
1
- import { Status as i, Tooltip as n } from "@box/blueprint-web";
2
- import { AlertCircle as m } from "@box/blueprint-web-assets/icons/Medium";
3
- import { SurfaceStatusSurfaceGray as s } from "@box/blueprint-web-assets/tokens/tokens";
4
- import { useIntl as c } from "react-intl";
5
- import f from "../../../../utils/confidence-score/messages.js";
6
- import a from "../../messages.js";
7
- import { jsx as t } from "react/jsx-runtime";
8
- function w() {
9
- const {
10
- formatMessage: o
11
- } = c(), e = /* @__PURE__ */ t(i, {
12
- color: s,
13
- interactive: !0,
14
- text: o(a.lowConfidenceBadge).toUpperCase(),
15
- icon: m,
16
- iconPosition: "left"
17
- }), r = o(f.tooltipLowConfidence);
18
- return /* @__PURE__ */ t(n, {
19
- content: r,
20
- children: e
21
- });
1
+ import e from "../../../../utils/confidence-score/messages.js";
2
+ import t from "../../messages.js";
3
+ import { Status as n, Tooltip as r } from "@box/blueprint-web";
4
+ import { useIntl as i } from "react-intl";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import { SurfaceStatusSurfaceGray as o } from "@box/blueprint-web-assets/tokens/tokens";
7
+ import { AlertCircle as s } from "@box/blueprint-web-assets/icons/Medium";
8
+ function c() {
9
+ let { formatMessage: c } = i(), l = /* @__PURE__ */ a(n, {
10
+ color: o,
11
+ interactive: !0,
12
+ text: c(t.lowConfidenceBadge).toUpperCase(),
13
+ icon: s,
14
+ iconPosition: "left"
15
+ });
16
+ return /* @__PURE__ */ a(r, {
17
+ content: c(e.tooltipLowConfidence),
18
+ children: l
19
+ });
22
20
  }
23
- export {
24
- w as LowConfidenceBadge
25
- };
21
+ export { c as LowConfidenceBadge };
@@ -1,4 +1,2 @@
1
- import { LowConfidenceSuggestionField as i } from "./low-confidence-suggestion-field.js";
2
- export {
3
- i as LowConfidenceSuggestionField
4
- };
1
+ import { LowConfidenceSuggestionField as e } from "./low-confidence-suggestion-field.js";
2
+ export { e as LowConfidenceSuggestionField };
@@ -1,77 +1,68 @@
1
- import { useState as h, useRef as L, useEffect as b } from "react";
2
- import { useIntl as M } from "react-intl";
3
- import { useBlueprintModernization as v, Text as s, LoadingIndicator as x, Tooltip as c, IconButton as d } from "@box/blueprint-web";
4
- import { Checkmark as A, XMark as I } from "@box/blueprint-web-assets/icons/Medium";
5
- import { s as r } from "../../../../../../chunks/field-action-bar.module.js";
1
+ import { t as e } from "../../../../../../chunks/field-action-bar.module.js";
6
2
  import t from "./messages.js";
7
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
8
- const T = 800;
9
- function N({
10
- onAccept: m,
11
- onClear: u
12
- }) {
13
- const a = M(), {
14
- enableModernizedComponents: f
15
- } = v(), [p, n] = h(!1), o = L(void 0);
16
- b(() => () => clearTimeout(o.current), []);
17
- const l = (g) => {
18
- clearTimeout(o.current), n(!0);
19
- try {
20
- g();
21
- } finally {
22
- o.current = setTimeout(() => {
23
- n(!1);
24
- }, T);
25
- }
26
- };
27
- return /* @__PURE__ */ e("div", {
28
- className: r.wrapperGradient,
29
- "data-modern": f,
30
- children: /* @__PURE__ */ i("div", {
31
- className: r.wrapper,
32
- children: [/* @__PURE__ */ i("div", {
33
- children: [/* @__PURE__ */ e(s, {
34
- as: "p",
35
- color: "textOnLightSecondary",
36
- variant: "caption",
37
- children: a.formatMessage(t.needsReview)
38
- }), /* @__PURE__ */ e(s, {
39
- as: "p",
40
- color: "textOnLightDefault",
41
- variant: "bodySmallSemibold",
42
- children: a.formatMessage(t.description)
43
- })]
44
- }), p ? /* @__PURE__ */ e("div", {
45
- className: r.loader,
46
- children: /* @__PURE__ */ e(x, {
47
- "aria-label": a.formatMessage(t.reviewActionLoadingAriaLabel),
48
- size: "small"
49
- })
50
- }) : /* @__PURE__ */ i("div", {
51
- className: r.buttons,
52
- children: [/* @__PURE__ */ e(c, {
53
- content: a.formatMessage(t.acceptValueTooltip),
54
- children: /* @__PURE__ */ e(d, {
55
- "aria-label": a.formatMessage(t.acceptValueAriaLabel),
56
- icon: A,
57
- onClick: () => l(m),
58
- size: "x-small",
59
- "data-target-id": "IconButton-acceptValueAriaLabel"
60
- })
61
- }), /* @__PURE__ */ e(c, {
62
- content: a.formatMessage(t.clearValueTooltip),
63
- children: /* @__PURE__ */ e(d, {
64
- "aria-label": a.formatMessage(t.clearValueAriaLabel),
65
- icon: I,
66
- onClick: () => l(u),
67
- size: "x-small",
68
- "data-target-id": "IconButton-clearValueAriaLabel"
69
- })
70
- })]
71
- })]
72
- })
73
- });
3
+ import { IconButton as n, LoadingIndicator as r, Text as i, Tooltip as a, useBlueprintModernization as o } from "@box/blueprint-web";
4
+ import { useEffect as s, useRef as c, useState as l } from "react";
5
+ import { useIntl as u } from "react-intl";
6
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ import { Checkmark as p, XMark as m } from "@box/blueprint-web-assets/icons/Medium";
8
+ var h = 800;
9
+ function g({ onAccept: g, onClear: _ }) {
10
+ let v = u(), { enableModernizedComponents: y } = o(), [b, x] = l(!1), S = c(void 0);
11
+ s(() => () => clearTimeout(S.current), []);
12
+ let C = (e) => {
13
+ clearTimeout(S.current), x(!0);
14
+ try {
15
+ e();
16
+ } finally {
17
+ S.current = setTimeout(() => {
18
+ x(!1);
19
+ }, h);
20
+ }
21
+ };
22
+ return /* @__PURE__ */ d("div", {
23
+ className: e.wrapperGradient,
24
+ "data-modern": y,
25
+ children: /* @__PURE__ */ f("div", {
26
+ className: e.wrapper,
27
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d(i, {
28
+ as: "p",
29
+ color: "textOnLightSecondary",
30
+ variant: "caption",
31
+ children: v.formatMessage(t.needsReview)
32
+ }), /* @__PURE__ */ d(i, {
33
+ as: "p",
34
+ color: "textOnLightDefault",
35
+ variant: "bodySmallSemibold",
36
+ children: v.formatMessage(t.description)
37
+ })] }), b ? /* @__PURE__ */ d("div", {
38
+ className: e.loader,
39
+ children: /* @__PURE__ */ d(r, {
40
+ "aria-label": v.formatMessage(t.reviewActionLoadingAriaLabel),
41
+ size: "small"
42
+ })
43
+ }) : /* @__PURE__ */ f("div", {
44
+ className: e.buttons,
45
+ children: [/* @__PURE__ */ d(a, {
46
+ content: v.formatMessage(t.acceptValueTooltip),
47
+ children: /* @__PURE__ */ d(n, {
48
+ "aria-label": v.formatMessage(t.acceptValueAriaLabel),
49
+ icon: p,
50
+ onClick: () => C(g),
51
+ size: "x-small",
52
+ "data-target-id": "IconButton-acceptValueAriaLabel"
53
+ })
54
+ }), /* @__PURE__ */ d(a, {
55
+ content: v.formatMessage(t.clearValueTooltip),
56
+ children: /* @__PURE__ */ d(n, {
57
+ "aria-label": v.formatMessage(t.clearValueAriaLabel),
58
+ icon: m,
59
+ onClick: () => C(_),
60
+ size: "x-small",
61
+ "data-target-id": "IconButton-clearValueAriaLabel"
62
+ })
63
+ })]
64
+ })]
65
+ })
66
+ });
74
67
  }
75
- export {
76
- N as LowConfidenceSuggestionField
77
- };
68
+ export { g as LowConfidenceSuggestionField };
@@ -1,34 +1,32 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const i = e({
3
- needsReview: {
4
- id: "metadataEditor.lowConfidenceSuggestionField.needsReview",
5
- defaultMessage: "Needs review"
6
- },
7
- description: {
8
- id: "metadataEditor.lowConfidenceSuggestionField.description",
9
- defaultMessage: "Box AI returned low confidence"
10
- },
11
- acceptValueTooltip: {
12
- id: "metadataEditor.lowConfidenceSuggestionField.acceptValueTooltip",
13
- defaultMessage: "Accept Value"
14
- },
15
- clearValueTooltip: {
16
- id: "metadataEditor.lowConfidenceSuggestionField.clearValueTooltip",
17
- defaultMessage: "Clear Value"
18
- },
19
- acceptValueAriaLabel: {
20
- id: "metadataEditor.lowConfidenceSuggestionField.acceptValueAriaLabel",
21
- defaultMessage: "Accept extracted value"
22
- },
23
- clearValueAriaLabel: {
24
- id: "metadataEditor.lowConfidenceSuggestionField.clearValueAriaLabel",
25
- defaultMessage: "Clear extracted value"
26
- },
27
- reviewActionLoadingAriaLabel: {
28
- id: "metadataEditor.lowConfidenceSuggestionField.reviewActionLoadingAriaLabel",
29
- defaultMessage: "Processing review action"
30
- }
2
+ var t = e({
3
+ needsReview: {
4
+ id: "metadataEditor.lowConfidenceSuggestionField.needsReview",
5
+ defaultMessage: "Needs review"
6
+ },
7
+ description: {
8
+ id: "metadataEditor.lowConfidenceSuggestionField.description",
9
+ defaultMessage: "Box AI returned low confidence"
10
+ },
11
+ acceptValueTooltip: {
12
+ id: "metadataEditor.lowConfidenceSuggestionField.acceptValueTooltip",
13
+ defaultMessage: "Accept Value"
14
+ },
15
+ clearValueTooltip: {
16
+ id: "metadataEditor.lowConfidenceSuggestionField.clearValueTooltip",
17
+ defaultMessage: "Clear Value"
18
+ },
19
+ acceptValueAriaLabel: {
20
+ id: "metadataEditor.lowConfidenceSuggestionField.acceptValueAriaLabel",
21
+ defaultMessage: "Accept extracted value"
22
+ },
23
+ clearValueAriaLabel: {
24
+ id: "metadataEditor.lowConfidenceSuggestionField.clearValueAriaLabel",
25
+ defaultMessage: "Clear extracted value"
26
+ },
27
+ reviewActionLoadingAriaLabel: {
28
+ id: "metadataEditor.lowConfidenceSuggestionField.reviewActionLoadingAriaLabel",
29
+ defaultMessage: "Processing review action"
30
+ }
31
31
  });
32
- export {
33
- i as default
34
- };
32
+ export { t as default };
@@ -1,61 +1,44 @@
1
- import { DateI18nProvider as w, DatePicker as S } from "@box/blueprint-web";
2
- import { useFormikContext as O, getIn as r } from "formik";
3
- import { forwardRef as V, useMemo as z, useCallback as c, memo as B } from "react";
4
- import { useIntl as N } from "react-intl";
5
- import { convertIsoStringToCalendarDate as $, convertCalendarDateToISOString as j } from "../../../../utils/convertDate.js";
6
- import { useMemoizedFieldLabel as E } from "../../hooks/use-memoized-field-label.js";
7
- import t from "../../../../messages.js";
8
- import { jsx as o } from "react/jsx-runtime";
9
- const R = /* @__PURE__ */ B(S), W = /* @__PURE__ */ V(({
10
- className: m,
11
- description: f,
12
- isAiSuggestionApplied: u,
13
- confidenceScore: D,
14
- disableForm: h,
15
- fieldNamePrefix: p,
16
- label: i,
17
- onValueEdited: l,
18
- portalElement: M,
19
- updateModePrefix: g
20
- }, v) => {
21
- const e = `${g ?? p}.value`, a = N(), {
22
- values: b,
23
- errors: k,
24
- touched: C,
25
- setFieldTouched: n,
26
- setFieldValue: s
27
- } = O(), d = r(b, e), L = z(() => $(d), [d]), P = r(C, e) ? r(k, e) : void 0, F = E(i, f, u, "span", D), I = c((x) => {
28
- const A = j(x);
29
- s(e, A), l();
30
- }, [e, s, l]), T = c(() => {
31
- n(e, !0);
32
- }, [e, n]);
33
- return /* @__PURE__ */ o("div", {
34
- "data-testid": `${i}-field`,
35
- children: /* @__PURE__ */ o(w, {
36
- locale: a.locale,
37
- children: /* @__PURE__ */ o(R, {
38
- calendarAriaLabel: a.formatMessage(t.selectDate),
39
- clearDatePickerAriaLabel: a.formatMessage(t.clearSelectedDate),
40
- nextMonthAriaLabel: a.formatMessage(t.switchToNextMonth),
41
- openCalendarDropdownAriaLabel: a.formatMessage(t.openCalendar),
42
- previousMonthAriaLabel: a.formatMessage(t.switchToPreviousMonth),
43
- ref: v,
44
- className: m,
45
- dataTargetId: "DatePicker-MetadataEditorDateField",
46
- error: P,
47
- isDisabled: h,
48
- label: F,
49
- name: e,
50
- onBlur: T,
51
- onChange: I,
52
- portalElement: M,
53
- value: L
54
- })
55
- })
56
- });
1
+ import e from "../../../../messages.js";
2
+ import { convertCalendarDateToISOString as t, convertIsoStringToCalendarDate as n } from "../../../../utils/convertDate.js";
3
+ import { useMemoizedFieldLabel as r } from "../../hooks/use-memoized-field-label.js";
4
+ import { DateI18nProvider as i, DatePicker as a } from "@box/blueprint-web";
5
+ import { forwardRef as o, memo as s, useCallback as c, useMemo as l } from "react";
6
+ import { useIntl as u } from "react-intl";
7
+ import { jsx as d } from "react/jsx-runtime";
8
+ import { getIn as f, useFormikContext as p } from "formik";
9
+ var m = /* @__PURE__ */ s(a), h = /* @__PURE__ */ o(({ className: a, description: o, isAiSuggestionApplied: s, confidenceScore: h, disableForm: g, fieldNamePrefix: _, label: v, onValueEdited: y, portalElement: b, updateModePrefix: x }, S) => {
10
+ let C = `${x ?? _}.value`, w = u(), { values: T, errors: E, touched: D, setFieldTouched: O, setFieldValue: k } = p(), A = f(T, C), j = l(() => n(A), [A]), M = f(D, C) ? f(E, C) : void 0, N = r(v, o, s, "span", h), P = c((e) => {
11
+ k(C, t(e)), y();
12
+ }, [
13
+ C,
14
+ k,
15
+ y
16
+ ]), F = c(() => {
17
+ O(C, !0);
18
+ }, [C, O]);
19
+ return /* @__PURE__ */ d("div", {
20
+ "data-testid": `${v}-field`,
21
+ children: /* @__PURE__ */ d(i, {
22
+ locale: w.locale,
23
+ children: /* @__PURE__ */ d(m, {
24
+ calendarAriaLabel: w.formatMessage(e.selectDate),
25
+ clearDatePickerAriaLabel: w.formatMessage(e.clearSelectedDate),
26
+ nextMonthAriaLabel: w.formatMessage(e.switchToNextMonth),
27
+ openCalendarDropdownAriaLabel: w.formatMessage(e.openCalendar),
28
+ previousMonthAriaLabel: w.formatMessage(e.switchToPreviousMonth),
29
+ ref: S,
30
+ className: a,
31
+ dataTargetId: "DatePicker-MetadataEditorDateField",
32
+ error: M,
33
+ isDisabled: g,
34
+ label: N,
35
+ name: C,
36
+ onBlur: F,
37
+ onChange: P,
38
+ portalElement: b,
39
+ value: j
40
+ })
41
+ })
42
+ });
57
43
  });
58
- export {
59
- W as MetadataDateField,
60
- W as default
61
- };
44
+ export { h as MetadataDateField, h as default };