@box/metadata-editor 1.64.5 → 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 +9 -9
@@ -1,63 +1,47 @@
1
- import { Text as n, EmptyState as m } from "@box/blueprint-web";
2
- import { JobAnalyzeData as c } from "@box/blueprint-web-assets/illustrations/Small";
3
- import { useCallback as f } from "react";
4
- import { useIntl as d } from "react-intl";
5
- import a from "./messages.js";
6
- import { jsx as e } from "react/jsx-runtime";
7
- function E({
8
- isAnyEmptyValueHidden: s = !1,
9
- isBoxAiSuggestionsFeatureEnabled: p = !1,
10
- level: r,
11
- onShowEmptyValues: o
12
- }) {
13
- const t = d(), l = f(() => {
14
- if (r === "manager")
15
- return /* @__PURE__ */ e(n, {
16
- as: "p",
17
- children: t.formatMessage(a.managerLevelEmptyStateBody)
18
- });
19
- if (r === "instance")
20
- return s ? /* @__PURE__ */ e(m.PrimaryAction, {
21
- onClick: o,
22
- children: t.formatMessage(a.instanceLevelSeeEmptyValuesCTA)
23
- }) : (
24
- // EmptyState component requires body element so if level === "instance" && !isAnyEmptyValueHidden we pass heading as body and nothing as heading
25
- /* @__PURE__ */ e(n, {
26
- as: "h1",
27
- variant: "titleSmall",
28
- children: t.formatMessage(a.instanceLevelEmptyStateHeadingNoAttributes)
29
- })
30
- );
31
- const i = t.formatMessage(a.fileLevelEmptyStateDefaultBody);
32
- return /* @__PURE__ */ e(n, {
33
- as: "p",
34
- children: i
35
- });
36
- }, [t, s, r, o]), g = f(() => {
37
- if (r === "manager")
38
- return /* @__PURE__ */ e(n, {
39
- as: "h2",
40
- children: t.formatMessage(a.managerLevelEmptyStateHeading)
41
- });
42
- if (r === "instance")
43
- return s ? /* @__PURE__ */ e(n, {
44
- as: "h2",
45
- children: t.formatMessage(a.instanceLevelEmptyStateHeading)
46
- }) : null;
47
- const i = t.formatMessage(a.fileLevelEmptyStateDefaultHeading);
48
- return /* @__PURE__ */ e(n, {
49
- as: "h2",
50
- children: i
51
- });
52
- }, [t, s, r]);
53
- return /* @__PURE__ */ e(m, {
54
- body: l(),
55
- heading: g(),
56
- illustration: c,
57
- size: "small"
58
- });
1
+ import e from "./messages.js";
2
+ import { EmptyState as t, Text as n } from "@box/blueprint-web";
3
+ import { useCallback as r } from "react";
4
+ import { useIntl as i } from "react-intl";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import { JobAnalyzeData as o } from "@box/blueprint-web-assets/illustrations/Small";
7
+ function s({ isAnyEmptyValueHidden: s = !1, isBoxAiSuggestionsFeatureEnabled: c = !1, level: l, onShowEmptyValues: u }) {
8
+ let d = i(), f = r(() => l === "manager" ? /* @__PURE__ */ a(n, {
9
+ as: "p",
10
+ children: d.formatMessage(e.managerLevelEmptyStateBody)
11
+ }) : l === "instance" ? s ? /* @__PURE__ */ a(t.PrimaryAction, {
12
+ onClick: u,
13
+ children: d.formatMessage(e.instanceLevelSeeEmptyValuesCTA)
14
+ }) : /* @__PURE__ */ a(n, {
15
+ as: "h1",
16
+ variant: "titleSmall",
17
+ children: d.formatMessage(e.instanceLevelEmptyStateHeadingNoAttributes)
18
+ }) : /* @__PURE__ */ a(n, {
19
+ as: "p",
20
+ children: d.formatMessage(e.fileLevelEmptyStateDefaultBody)
21
+ }), [
22
+ d,
23
+ s,
24
+ l,
25
+ u
26
+ ]), p = r(() => l === "manager" ? /* @__PURE__ */ a(n, {
27
+ as: "h2",
28
+ children: d.formatMessage(e.managerLevelEmptyStateHeading)
29
+ }) : l === "instance" ? s ? /* @__PURE__ */ a(n, {
30
+ as: "h2",
31
+ children: d.formatMessage(e.instanceLevelEmptyStateHeading)
32
+ }) : null : /* @__PURE__ */ a(n, {
33
+ as: "h2",
34
+ children: d.formatMessage(e.fileLevelEmptyStateDefaultHeading)
35
+ }), [
36
+ d,
37
+ s,
38
+ l
39
+ ]);
40
+ return /* @__PURE__ */ a(t, {
41
+ body: f(),
42
+ heading: p(),
43
+ illustration: o,
44
+ size: "small"
45
+ });
59
46
  }
60
- export {
61
- E as MetadataEmptyState,
62
- E as default
63
- };
47
+ export { s as MetadataEmptyState, s as default };
@@ -1,14 +1,7 @@
1
- import { CustomInstanceNewField as e } from "./subcomponents/custom-instance-new-field/custom-instance-new-field.js";
2
- import { DeleteConfirmationModal as r } from "./subcomponents/delete-confirmation-modal/delete-confirmation-modal.js";
3
- import { MetadataInstanceFormAutofillButton as n } from "./subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
4
- import { MetadataInstanceFormHeader as p } from "./subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
5
- import { MetadataInstanceForm as s } from "./subcomponents/metadata-instance-form/metadata-instance-form.js";
6
- import { J as c } from "../../../../chunks/utils.js";
7
- export {
8
- e as CustomInstanceNewField,
9
- r as DeleteConfirmationModal,
10
- c as JSONPatchOp,
11
- s as MetadataInstanceForm,
12
- n as MetadataInstanceFormAutofillButton,
13
- p as MetadataInstanceFormHeader
14
- };
1
+ import { t as e } from "../../../../chunks/custom-instance-new-field.js";
2
+ import { t } from "../../../../chunks/delete-confirmation-modal.js";
3
+ import { t as n } from "../../../../chunks/metadata-instance-form-autofill-button.js";
4
+ import { t as r } from "../../../../chunks/metadata-instance-form-header.js";
5
+ import { r as i } from "../../../../chunks/utils2.js";
6
+ import { MetadataInstanceForm as a } from "./subcomponents/metadata-instance-form/metadata-instance-form.js";
7
+ export { e as CustomInstanceNewField, t as DeleteConfirmationModal, i as JSONPatchOp, a as MetadataInstanceForm, n as MetadataInstanceFormAutofillButton, r as MetadataInstanceFormHeader };
@@ -1,64 +1,2 @@
1
- import { LoadingIndicator as g, Text as m, TextButton as v } from "@box/blueprint-web";
2
- import { AlertTriangle as _ } from "@box/blueprint-web-assets/icons/Line";
3
- import { Size5 as f, SurfaceStatusSurfaceError as y } from "@box/blueprint-web-assets/tokens/tokens";
4
- import O from "clsx";
5
- import { useState as T } from "react";
6
- import { useIntl as h } from "react-intl";
7
- import { EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY as E } from "../../../../constants.js";
8
- import s from "./messages.js";
9
- import { useErrorMessaging as I } from "./useErrorMessaging.js";
10
- import { jsxs as A, jsx as e } from "react/jsx-runtime";
11
- import '../../../../../../styles/autofill-overlay.css';const j = "_autofillOverlay_16p2j_1", x = "_withError_16p2j_12", B = "_autofillOverlayTitle_16p2j_16", D = "_autofillOverlayDescription_16p2j_21", M = "_dismissButton_16p2j_25", S = "_overlayIcon_16p2j_29", a = {
12
- autofillOverlay: j,
13
- withError: x,
14
- autofillOverlayTitle: B,
15
- autofillOverlayDescription: D,
16
- dismissButton: M,
17
- overlayIcon: S
18
- }, Y = ({
19
- errorCode: t,
20
- isFetchingSuggestions: u,
21
- isLongLoading: l
22
- }) => {
23
- const i = h(), [p, d] = T(!1), r = I(t);
24
- let o = i.formatMessage(s.defaultLoadingMessage);
25
- t && (o = r.title);
26
- const n = localStorage.getItem(E);
27
- l && n === "standard" && (o = i.formatMessage(s.longLoadingTitle));
28
- const c = l && n === "standard" ? i.formatMessage(s.longLoadingDescription) : t && r.description;
29
- return !u && !t || p ? null : /* @__PURE__ */ A("div", {
30
- className: O(a.autofillOverlay, t && a.withError),
31
- children: [t ? /* @__PURE__ */ e(_, {
32
- className: a.overlayIcon,
33
- color: y,
34
- height: f,
35
- role: "presentation",
36
- width: f
37
- }) : /* @__PURE__ */ e(g, {
38
- "aria-label": i.formatMessage(s.loadingAriaLabel),
39
- "aria-live": "polite",
40
- className: a.overlayIcon,
41
- size: "large",
42
- variant: "default"
43
- }), /* @__PURE__ */ e(m, {
44
- as: "p",
45
- className: a.autofillOverlayTitle,
46
- variant: "subtitle",
47
- children: o
48
- }), c && /* @__PURE__ */ e(m, {
49
- as: "p",
50
- className: a.autofillOverlayDescription,
51
- color: "textOnLightSecondary",
52
- variant: "bodyDefault",
53
- children: c
54
- }), t && /* @__PURE__ */ e(v, {
55
- className: a.dismissButton,
56
- onClick: () => d(!0),
57
- "data-target-id": "TextButton-dismissButton",
58
- children: i.formatMessage(s.dismissButton)
59
- })]
60
- });
61
- };
62
- export {
63
- Y as AutofillOverlay
64
- };
1
+ import { t as e } from "../../../../../../chunks/autofill-overlay.js";
2
+ export { e as AutofillOverlay };
@@ -1,42 +1,40 @@
1
- import { defineMessages as a } from "react-intl";
2
- const e = a({
3
- defaultLoadingMessage: {
4
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.defaultLoadingMessage",
5
- defaultMessage: "Extracting Metadata"
6
- },
7
- dismissButton: {
8
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.dismissButton",
9
- defaultMessage: "Dismiss"
10
- },
11
- errorTitle: {
12
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorTitle",
13
- defaultMessage: "Metadata extraction could not complete"
14
- },
15
- errorDescription: {
16
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorDescription",
17
- defaultMessage: "Please try again in a few minutes"
18
- },
19
- missingPermissionsErrorTitle: {
20
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.missingPermissionsErrorTitle",
21
- defaultMessage: "Can’t Extract Metadata"
22
- },
23
- missingPermissionsErrorDescription: {
24
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.missingPermissionsErrorDescription",
25
- defaultMessage: "You don’t have permission to access the destination folder to extract metadata. Please contact the owner or your admin."
26
- },
27
- loadingAriaLabel: {
28
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.loadingAriaLabel",
29
- defaultMessage: "Loading"
30
- },
31
- longLoadingTitle: {
32
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.longLoadingTitle",
33
- defaultMessage: "This is taking longer than usual"
34
- },
35
- longLoadingDescription: {
36
- id: "metadataEditor.metadataInstanceEditor.autofillOverlay.longLoadingDescription",
37
- defaultMessage: "Still working on it!"
38
- }
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({
3
+ defaultLoadingMessage: {
4
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.defaultLoadingMessage",
5
+ defaultMessage: "Extracting Metadata"
6
+ },
7
+ dismissButton: {
8
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.dismissButton",
9
+ defaultMessage: "Dismiss"
10
+ },
11
+ errorTitle: {
12
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorTitle",
13
+ defaultMessage: "Metadata extraction could not complete"
14
+ },
15
+ errorDescription: {
16
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorDescription",
17
+ defaultMessage: "Please try again in a few minutes"
18
+ },
19
+ missingPermissionsErrorTitle: {
20
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.missingPermissionsErrorTitle",
21
+ defaultMessage: "Can’t Extract Metadata"
22
+ },
23
+ missingPermissionsErrorDescription: {
24
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.missingPermissionsErrorDescription",
25
+ defaultMessage: "You don’t have permission to access the destination folder to extract metadata. Please contact the owner or your admin."
26
+ },
27
+ loadingAriaLabel: {
28
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.loadingAriaLabel",
29
+ defaultMessage: "Loading"
30
+ },
31
+ longLoadingTitle: {
32
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.longLoadingTitle",
33
+ defaultMessage: "This is taking longer than usual"
34
+ },
35
+ longLoadingDescription: {
36
+ id: "metadataEditor.metadataInstanceEditor.autofillOverlay.longLoadingDescription",
37
+ defaultMessage: "Still working on it!"
38
+ }
39
39
  });
40
- export {
41
- e as default
42
- };
40
+ export { t as default };
@@ -1,28 +1,23 @@
1
- import { useIntl as t } from "react-intl";
2
- import { ERROR_CODE_METADATA_PRECONDITION_FAILED as i, ERROR_CODE_METADATA_AUTOFILL_TIMEOUT as o, ERROR_CODE_MISSING_PERMISSIONS as a } from "../metadata-instance-form/constants.js";
3
1
  import e from "./messages.js";
4
- const c = (s) => {
5
- const r = t();
6
- if (!s)
7
- return {
8
- title: r.formatMessage(e.errorTitle),
9
- description: r.formatMessage(e.errorDescription)
10
- };
11
- switch (s) {
12
- case a:
13
- return {
14
- title: r.formatMessage(e.missingPermissionsErrorTitle),
15
- description: r.formatMessage(e.missingPermissionsErrorDescription)
16
- };
17
- case o:
18
- case i:
19
- default:
20
- return {
21
- title: r.formatMessage(e.errorTitle),
22
- description: r.formatMessage(e.errorDescription)
23
- };
24
- }
25
- };
26
- export {
27
- c as useErrorMessaging
2
+ import { ERROR_CODE_METADATA_AUTOFILL_TIMEOUT as t, ERROR_CODE_METADATA_PRECONDITION_FAILED as n, ERROR_CODE_MISSING_PERMISSIONS as r } from "../metadata-instance-form/constants.js";
3
+ import { useIntl as i } from "react-intl";
4
+ var a = (a) => {
5
+ let o = i();
6
+ if (!a) return {
7
+ title: o.formatMessage(e.errorTitle),
8
+ description: o.formatMessage(e.errorDescription)
9
+ };
10
+ switch (a) {
11
+ case r: return {
12
+ title: o.formatMessage(e.missingPermissionsErrorTitle),
13
+ description: o.formatMessage(e.missingPermissionsErrorDescription)
14
+ };
15
+ case t:
16
+ case n:
17
+ default: return {
18
+ title: o.formatMessage(e.errorTitle),
19
+ description: o.formatMessage(e.errorDescription)
20
+ };
21
+ }
28
22
  };
23
+ export { a as useErrorMessaging };
@@ -1,86 +1,2 @@
1
- import { useFormikContext as A, FieldArray as v, Field as N } from "formik";
2
- import { useState as f, useRef as k, useEffect as y } from "react";
3
- import { useIntl as C } from "react-intl";
4
- import { TextInput as q, IconButton as B, TextButton as T } from "@box/blueprint-web";
5
- import { Trash as w } from "@box/blueprint-web-assets/icons/Line";
6
- import { CustomInstanceNewField as M } from "../custom-instance-new-field/custom-instance-new-field.js";
7
- import r from "./messages.js";
8
- import { jsx as e, jsxs as F } from "react/jsx-runtime";
9
- import '../../../../../../styles/custom-instance.css';const R = "_customInstance_xq8r7_1", V = "_customInstanceField_xq8r7_7", j = "_customInstanceFieldInput_xq8r7_12", z = "_customInstanceFieldIcon_xq8r7_16", c = {
10
- customInstance: R,
11
- customInstanceField: V,
12
- customInstanceFieldInput: j,
13
- customInstanceFieldIcon: z
14
- }, H = (p) => {
15
- const {
16
- isLoading: l
17
- } = p, {
18
- values: s
19
- } = A(), i = C(), [m, a] = f(!s.metadata.fields.length), [u, d] = f(0), h = () => {
20
- d(s.metadata.fields.length);
21
- }, b = (o) => {
22
- d(o === 0 ? 0 : o - 1);
23
- }, I = k(null);
24
- return y(() => {
25
- s.metadata.fields.length > 0 ? I.current.focus() : a(!0);
26
- }, [u, s.metadata.fields.length]), /* @__PURE__ */ e("div", {
27
- children: /* @__PURE__ */ e(v, {
28
- name: "metadata.fields",
29
- children: ({
30
- remove: o,
31
- push: _
32
- }) => /* @__PURE__ */ F("div", {
33
- className: c.customInstance,
34
- children: [s?.metadata.fields.map((t, n) => /* @__PURE__ */ F("div", {
35
- className: c.customInstanceField,
36
- children: [/* @__PURE__ */ e("div", {
37
- className: c.customInstanceFieldInput,
38
- children: /* @__PURE__ */ e(N, {
39
- name: `metadata.fields[${n}].value`,
40
- children: ({
41
- field: g,
42
- meta: x
43
- }) => /* @__PURE__ */ e(q, {
44
- ...g,
45
- ref: n === u ? I : null,
46
- disabled: l,
47
- error: x.error,
48
- label: t.key,
49
- placeholder: i.formatMessage(r.setValuePlaceholder)
50
- })
51
- })
52
- }), /* @__PURE__ */ e(B, {
53
- "aria-label": i.formatMessage(r.removeAttribute, {
54
- fieldName: t.key
55
- }),
56
- className: c.customInstanceFieldIcon,
57
- disabled: l,
58
- icon: w,
59
- onClick: () => {
60
- o(n), b(n);
61
- },
62
- size: "x-small",
63
- "data-target-id": "IconButton-removeAttribute"
64
- })]
65
- }, t.key)), m && /* @__PURE__ */ e(M, {
66
- formKeys: s.metadata.fields.map((t) => t.key),
67
- onAdd: (t, n) => {
68
- _({
69
- key: t,
70
- value: n
71
- }), h(), a(!1);
72
- },
73
- onCancel: () => a(!1)
74
- }), !m && /* @__PURE__ */ e(T, {
75
- disabled: l,
76
- onClick: () => a(!0),
77
- "data-target-id": "TextButton-addAttribute",
78
- children: i.formatMessage(r.addAttribute)
79
- })]
80
- })
81
- })
82
- });
83
- };
84
- export {
85
- H as CustomInstance
86
- };
1
+ import { t as e } from "../../../../../../chunks/custom-instance.js";
2
+ export { e as CustomInstance };
@@ -1,18 +1,16 @@
1
- import { defineMessages as t } from "react-intl";
2
- const a = t({
3
- addAttribute: {
4
- id: "metadataEditor.metadataInstanceEditor.customInstance.addAttribute",
5
- defaultMessage: "+ Add Attribute"
6
- },
7
- removeAttribute: {
8
- id: "metadataEditor.metadataInstanceEditor.customInstance.removeAttribute",
9
- defaultMessage: "Delete {fieldName} attribute"
10
- },
11
- setValuePlaceholder: {
12
- id: "metadataEditor.metadataInstanceEditor.customInstance.setValuePlaceholder",
13
- defaultMessage: "Set value"
14
- }
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({
3
+ addAttribute: {
4
+ id: "metadataEditor.metadataInstanceEditor.customInstance.addAttribute",
5
+ defaultMessage: "+ Add Attribute"
6
+ },
7
+ removeAttribute: {
8
+ id: "metadataEditor.metadataInstanceEditor.customInstance.removeAttribute",
9
+ defaultMessage: "Delete {fieldName} attribute"
10
+ },
11
+ setValuePlaceholder: {
12
+ id: "metadataEditor.metadataInstanceEditor.customInstance.setValuePlaceholder",
13
+ defaultMessage: "Set value"
14
+ }
15
15
  });
16
- export {
17
- a as default
18
- };
16
+ export { t as default };
@@ -1,62 +1,2 @@
1
- import { Card as y, TextInput as u, Button as m } from "@box/blueprint-web";
2
- import { useState as l } from "react";
3
- import { useIntl as v } from "react-intl";
4
- import t from "./messages.js";
5
- import { jsxs as p, jsx as a } from "react/jsx-runtime";
6
- import '../../../../../../styles/custom-instance-new-field.css';const M = "_customInstanceNewFieldCard_fcftk_1", _ = "_customInstanceNewFieldFooter_fcftk_6", b = "_inputWrapper_fcftk_13", n = {
7
- customInstanceNewFieldCard: M,
8
- customInstanceNewFieldFooter: _,
9
- inputWrapper: b
10
- }, x = (f) => {
11
- const {
12
- onAdd: g,
13
- onCancel: F,
14
- formKeys: c = []
15
- } = f, e = v(), [r, h] = l(""), [d, C] = l(""), [i, o] = l(""), N = c.length !== 0, I = (s) => {
16
- h(s), i && o("");
17
- }, w = () => {
18
- r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) : g(r, d) : o(e.formatMessage(t.keyFieldRequiredError));
19
- };
20
- return /* @__PURE__ */ p(y, {
21
- "aria-label": e.formatMessage(t.addAttributeGroupAriaLabel),
22
- className: n.customInstanceNewFieldCard,
23
- "data-testid": "customInstanceNewField",
24
- role: "group",
25
- children: [/* @__PURE__ */ a("div", {
26
- className: n.inputWrapper,
27
- children: /* @__PURE__ */ a(u, {
28
- autoFocus: !0,
29
- error: i,
30
- label: e.formatMessage(t.customKeyLabel),
31
- onChange: (s) => I(s.target.value),
32
- placeholder: e.formatMessage(t.customKeyPlaceholder),
33
- required: !0,
34
- value: r
35
- })
36
- }), /* @__PURE__ */ a("div", {
37
- className: n.inputWrapper,
38
- children: /* @__PURE__ */ a(u, {
39
- label: e.formatMessage(t.valueLabel),
40
- onChange: (s) => C(s.target.value),
41
- placeholder: e.formatMessage(t.valuePlaceholder),
42
- value: d
43
- })
44
- }), /* @__PURE__ */ p("div", {
45
- className: n.customInstanceNewFieldFooter,
46
- children: [N && /* @__PURE__ */ a(m, {
47
- onClick: F,
48
- variant: "secondary",
49
- "data-target-id": "Button-cancelCTA",
50
- children: e.formatMessage(t.cancelCTA)
51
- }), /* @__PURE__ */ a(m, {
52
- onClick: w,
53
- variant: "primary",
54
- "data-target-id": "Button-addNewFieldCTA",
55
- children: e.formatMessage(t.addNewFieldCTA)
56
- })]
57
- })]
58
- });
59
- };
60
- export {
61
- x as CustomInstanceNewField
62
- };
1
+ import { t as e } from "../../../../../../chunks/custom-instance-new-field.js";
2
+ export { e as CustomInstanceNewField };
@@ -1,46 +1,44 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- addAttributeGroupAriaLabel: {
4
- id: "metadataEditor.metadataEditor.customIntanceNewField.addAttributeGroupAriaLabel",
5
- defaultMessage: "Add new attribute to Custom Metadata"
6
- },
7
- addNewFieldCTA: {
8
- id: "metadataEditor.metadataEditor.customIntanceNewField.addNewFieldCTA",
9
- defaultMessage: "Add"
10
- },
11
- cancelCTA: {
12
- id: "metadataEditor.metadataEditor.customIntanceNewField.cancelCTA",
13
- defaultMessage: "Cancel"
14
- },
15
- customErrorInternalKey: {
16
- id: "metadataEditor.metadataEditor.customIntanceNewField.customErrorInternalKey",
17
- defaultMessage: "Keys cannot begin with a $."
18
- },
19
- customErrorDuplicateKey: {
20
- id: "metadataEditor.metadataEditor.customIntanceNewField.customErrorDuplicateKey",
21
- defaultMessage: "Key already exists."
22
- },
23
- customKeyLabel: {
24
- id: "metadataEditor.metadataEditor.customIntanceNewField.attributeNameLabel",
25
- defaultMessage: "Attribute Name"
26
- },
27
- customKeyPlaceholder: {
28
- id: "metadataEditor.metadataEditor.customIntanceNewField.customKeyPlaceholder",
29
- defaultMessage: "e.g. Order Number"
30
- },
31
- keyFieldRequiredError: {
32
- id: "metadataEditor.metadataEditor.customIntanceNewField.keyFieldRequired",
33
- defaultMessage: "Key is required"
34
- },
35
- valueLabel: {
36
- id: "metadataEditor.metadataEditor.customIntanceNewField.valueLabel",
37
- defaultMessage: "Value"
38
- },
39
- valuePlaceholder: {
40
- id: "metadataEditor.metadataEditor.customIntanceNewField.valuePlaceholder",
41
- defaultMessage: "e.g. 42"
42
- }
2
+ var t = e({
3
+ addAttributeGroupAriaLabel: {
4
+ id: "metadataEditor.metadataEditor.customIntanceNewField.addAttributeGroupAriaLabel",
5
+ defaultMessage: "Add new attribute to Custom Metadata"
6
+ },
7
+ addNewFieldCTA: {
8
+ id: "metadataEditor.metadataEditor.customIntanceNewField.addNewFieldCTA",
9
+ defaultMessage: "Add"
10
+ },
11
+ cancelCTA: {
12
+ id: "metadataEditor.metadataEditor.customIntanceNewField.cancelCTA",
13
+ defaultMessage: "Cancel"
14
+ },
15
+ customErrorInternalKey: {
16
+ id: "metadataEditor.metadataEditor.customIntanceNewField.customErrorInternalKey",
17
+ defaultMessage: "Keys cannot begin with a $."
18
+ },
19
+ customErrorDuplicateKey: {
20
+ id: "metadataEditor.metadataEditor.customIntanceNewField.customErrorDuplicateKey",
21
+ defaultMessage: "Key already exists."
22
+ },
23
+ customKeyLabel: {
24
+ id: "metadataEditor.metadataEditor.customIntanceNewField.attributeNameLabel",
25
+ defaultMessage: "Attribute Name"
26
+ },
27
+ customKeyPlaceholder: {
28
+ id: "metadataEditor.metadataEditor.customIntanceNewField.customKeyPlaceholder",
29
+ defaultMessage: "e.g. Order Number"
30
+ },
31
+ keyFieldRequiredError: {
32
+ id: "metadataEditor.metadataEditor.customIntanceNewField.keyFieldRequired",
33
+ defaultMessage: "Key is required"
34
+ },
35
+ valueLabel: {
36
+ id: "metadataEditor.metadataEditor.customIntanceNewField.valueLabel",
37
+ defaultMessage: "Value"
38
+ },
39
+ valuePlaceholder: {
40
+ id: "metadataEditor.metadataEditor.customIntanceNewField.valuePlaceholder",
41
+ defaultMessage: "e.g. 42"
42
+ }
43
43
  });
44
- export {
45
- t as default
46
- };
44
+ export { t as default };