@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,128 +1,2 @@
1
- import { Tooltip as N, Button as E, LoadingIndicator as R, IconButton as v, SplitButton as x, DropdownMenu as G, Text as D } from "@box/blueprint-web";
2
- import { BoxAiAdvancedLogo24 as K, BoxAiLogo24 as O } from "@box/blueprint-web-assets/icons/Logo";
3
- import { useLocalStorageAIAgents as j } from "@box/box-ai-agent-selector";
4
- import { useFormikContext as w, getIn as f } from "formik";
5
- import { useEffect as F, useMemo as P, forwardRef as Y, useState as V } from "react";
6
- import { useIntl as k } from "react-intl";
7
- import { EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY as X, EXTRACT_AGENTS_MAP as M } from "../../../../constants.js";
8
- import { autofillMessages as q } from "../../../../messages.js";
9
- import { useAutofill as z } from "../../../../utils/autofill-context.js";
10
- import { getTooltipContent as H } from "../../../../utils/utils.js";
11
- import p from "./messages.js";
12
- import { jsx as t, jsxs as J } from "react/jsx-runtime";
13
- import '../../../../../../styles/metadata-instance-form-autofill-button.css';const Q = "_loadingIndicator_i1hyy_1", U = "_actionMenuItem_i1hyy_11", W = "_splitButtonIcon_i1hyy_17", T = {
14
- loadingIndicator: Q,
15
- actionMenuItem: U,
16
- splitButtonIcon: W
17
- }, Z = /* @__PURE__ */ Y(({
18
- isButtonDisabled: I,
19
- onAutofill: A,
20
- onAgentChange: c,
21
- storedAgent: B,
22
- icon: e,
23
- ..._
24
- }, h) => {
25
- const n = k(), [u, a] = V(B || "standard"), i = (o) => {
26
- a(o), c(o), setTimeout(() => {
27
- A(o);
28
- }, 0);
29
- };
30
- return /* @__PURE__ */ t(x, {
31
- ..._,
32
- ref: h,
33
- disabled: I,
34
- dropdownTriggerAriaLabel: "See agent options.",
35
- endIcon: e,
36
- label: n.formatMessage(p.autofillButton),
37
- onClick: () => A(),
38
- variant: "secondary",
39
- children: /* @__PURE__ */ t(G.RadioGroup, {
40
- onValueChange: (o) => i(o),
41
- value: u,
42
- children: Object.entries(M).map(([o, s]) => {
43
- const m = s.ICON;
44
- return /* @__PURE__ */ t(G.RadioSelectItem, {
45
- value: s.AGENT_TYPE,
46
- children: /* @__PURE__ */ J("div", {
47
- className: T.actionMenuItem,
48
- children: [/* @__PURE__ */ t(m, {
49
- "aria-hidden": !0,
50
- className: T.splitButtonIcon
51
- }), /* @__PURE__ */ t(D, {
52
- as: "span",
53
- children: n.formatMessage(p[s.DISPLAY_MSG])
54
- })]
55
- })
56
- }, o);
57
- })
58
- })
59
- });
60
- }), mt = ({
61
- areAiSuggestionsAvailable: I,
62
- isBetaLanguageEnabled: A,
63
- isLoading: c,
64
- variant: B = "secondary-button",
65
- isAdvancedExtractAgentEnabled: e = !1,
66
- onAutofill: _
67
- }) => {
68
- const {
69
- isSubmitting: h,
70
- values: n,
71
- setFieldValue: u
72
- } = w(), a = k(), [i, o] = j(X), {
73
- suggestions: s,
74
- confidenceScores: m,
75
- targetLocations: b
76
- } = z();
77
- F(() => {
78
- if (s) {
79
- const d = f(n, "metadata.fields"), l = f(n, "metadata.templateKey");
80
- u("metadata.fields", d?.map((r) => {
81
- const g = s?.[l]?.[r.key];
82
- return g ? {
83
- ...r,
84
- aiSuggestion: g,
85
- aiSuggestionConfidenceScore: m?.[l]?.[r.key],
86
- aiSuggestionTargetLocation: b?.[l]?.[r.key]
87
- } : r;
88
- }));
89
- }
90
- }, [s, m, b, u]);
91
- const S = (d) => {
92
- const l = f(n, "metadata.templateKey"), r = f(n, "metadata.scope"), g = d ? M[d]?.AGENT_ID : M[i]?.AGENT_ID;
93
- _(l, r, e ? g : void 0);
94
- }, y = !I || h || c, C = i === "enhanced" && e ? K : O, L = P(() => H(e, i, a), [e, i, a]);
95
- return B === "secondary-button" ? /* @__PURE__ */ t(N, {
96
- content: L,
97
- children: e ? /* @__PURE__ */ t(Z, {
98
- icon: C,
99
- isButtonDisabled: y,
100
- onAgentChange: o,
101
- onAutofill: S,
102
- storedAgent: i
103
- }) : /* @__PURE__ */ t(E, {
104
- disabled: y,
105
- endIcon: C,
106
- onClick: () => S(),
107
- variant: "secondary",
108
- "data-target-id": "Button-autofillButton",
109
- children: a.formatMessage(p.autofillButton)
110
- })
111
- }) : /* @__PURE__ */ t(N, {
112
- content: L,
113
- children: c ? /* @__PURE__ */ t(R, {
114
- "aria-label": a.formatMessage(p.loadingButtonAriaLabel),
115
- className: T.loadingIndicator
116
- }) : /* @__PURE__ */ t(v, {
117
- "aria-label": a.formatMessage(q.autofillButtonAriaLabel),
118
- disabled: y,
119
- icon: C,
120
- onClick: () => S(),
121
- variant: "icon-logo",
122
- "data-target-id": "IconButton-autofillButtonAriaLabel"
123
- })
124
- });
125
- };
126
- export {
127
- mt as MetadataInstanceFormAutofillButton
128
- };
1
+ import { t as e } from "../../../../../../chunks/metadata-instance-form-autofill-button.js";
2
+ export { e as MetadataInstanceFormAutofillButton };
@@ -1,22 +1,20 @@
1
- import { defineMessages as a } from "react-intl";
2
- const e = a({
3
- cancelButton: {
4
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.cancelButton",
5
- defaultMessage: "Cancel"
6
- },
7
- deleteButton: {
8
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.deleteButton",
9
- defaultMessage: "Delete"
10
- },
11
- loadingAriaLabel: {
12
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.loadingAriaLabel",
13
- defaultMessage: "Loading..."
14
- },
15
- saveButton: {
16
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.saveButton",
17
- defaultMessage: "Save"
18
- }
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({
3
+ cancelButton: {
4
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.cancelButton",
5
+ defaultMessage: "Cancel"
6
+ },
7
+ deleteButton: {
8
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.deleteButton",
9
+ defaultMessage: "Delete"
10
+ },
11
+ loadingAriaLabel: {
12
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.loadingAriaLabel",
13
+ defaultMessage: "Loading..."
14
+ },
15
+ saveButton: {
16
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormFooter.saveButton",
17
+ defaultMessage: "Save"
18
+ }
19
19
  });
20
- export {
21
- e as default
22
- };
20
+ export { t as default };
@@ -1,53 +1,2 @@
1
- import { TextButton as b, Button as r } from "@box/blueprint-web";
2
- import { useFormikContext as g } from "formik";
3
- import { useIntl as B } from "react-intl";
4
- import o from "./messages.js";
5
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
6
- import '../../../../../../styles/metadata-instance-form-footer.css';const F = "_metadataInstanceFormFooter_sqpiw_1", f = "_buttonsContainer_sqpiw_7", p = "_buttons_sqpiw_7", n = {
7
- metadataInstanceFormFooter: F,
8
- buttonsContainer: f,
9
- buttons: p
10
- }, I = ({
11
- isDeleteButtonDisabled: d,
12
- isLoading: m,
13
- onCancel: c,
14
- onDelete: l
15
- }) => {
16
- const t = B(), {
17
- isSubmitting: s,
18
- submitForm: u
19
- } = g(), a = m || s;
20
- return /* @__PURE__ */ e("div", {
21
- className: n.metadataInstanceFormFooter,
22
- children: /* @__PURE__ */ i("div", {
23
- className: n.buttonsContainer,
24
- children: [/* @__PURE__ */ e(b, {
25
- disabled: a || d,
26
- onClick: l,
27
- "data-target-id": "TextButton-deleteButton",
28
- children: t.formatMessage(o.deleteButton)
29
- }), /* @__PURE__ */ i("div", {
30
- className: n.buttons,
31
- children: [/* @__PURE__ */ e(r, {
32
- disabled: a,
33
- onClick: c,
34
- size: "large",
35
- variant: "secondary",
36
- "data-target-id": "Button-cancelButton",
37
- children: t.formatMessage(o.cancelButton)
38
- }), /* @__PURE__ */ e(r, {
39
- disabled: a,
40
- loading: s,
41
- loadingAriaLabel: t.formatMessage(o.loadingAriaLabel),
42
- onClick: u,
43
- size: "large",
44
- "data-target-id": "Button-saveButton",
45
- children: t.formatMessage(o.saveButton)
46
- })]
47
- })]
48
- })
49
- });
50
- };
51
- export {
52
- I as MetadataInstanceFormFooter
53
- };
1
+ import { t as e } from "../../../../../../chunks/metadata-instance-form-footer.js";
2
+ export { e as MetadataInstanceFormFooter };
@@ -1,10 +1,6 @@
1
- import { defineMessages as t } from "react-intl";
2
- const e = t({
3
- customInstanceTitle: {
4
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.customInstanceTitle",
5
- defaultMessage: "Custom Metadata"
6
- }
7
- });
8
- export {
9
- e as default
10
- };
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({ customInstanceTitle: {
3
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.customInstanceTitle",
4
+ defaultMessage: "Custom Metadata"
5
+ } });
6
+ export { t as default };
@@ -1,58 +1,2 @@
1
- import { useFormikContext as M } from "formik";
2
- import { useMemo as v } from "react";
3
- import { useIntl as W } from "react-intl";
4
- import { getFieldsNeedingReview as h } from "../../../../utils/confidence-score/get-fields-needing-review.js";
5
- import T from "../../../interactive-header-text/interactive-header-text.js";
6
- import { MetadataInstanceReviewNotice as g } from "../../../metadata-instance-review-notice/metadata-instance-review-notice.js";
7
- import { MetadataInstanceFormAutofillButton as j } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
8
- import { MetadataInstanceFormInlineNotice as k } from "../metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";
9
- import w from "./messages.js";
10
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
11
- import '../../../../../../styles/metadata-instance-form-header.css';const C = "_metadataInstanceFormHeaderWrapper_3nbmr_1", b = "_metadataInstanceFormHeader_3nbmr_1", q = "_title_3nbmr_15", a = {
12
- metadataInstanceFormHeaderWrapper: C,
13
- metadataInstanceFormHeader: b,
14
- title: q
15
- }, R = ({
16
- areAiSuggestionsAvailable: r,
17
- hasSuggestions: l,
18
- isAdvancedExtractAgentEnabled: p = !1,
19
- isAiSuggestionsFeatureEnabled: f,
20
- isBetaLanguageEnabled: m,
21
- isConfidenceScoreReviewEnabled: e = !1,
22
- isLargeFile: I,
23
- isLoading: o,
24
- onToggleReviewFilter: n,
25
- shouldShowOnlyReviewFields: s = !1,
26
- templateName: F,
27
- onAutofill: H
28
- }) => {
29
- const u = W(), {
30
- values: c
31
- } = M(), i = v(() => e ? h(c.metadata?.fields ?? []).length : 0, [c.metadata?.fields, e]), N = F ?? u.formatMessage(w.customInstanceTitle), _ = l && r, x = e && !o && (i > 0 || s) && n !== void 0;
32
- return /* @__PURE__ */ d("div", {
33
- className: a.metadataInstanceFormHeaderWrapper,
34
- children: [/* @__PURE__ */ d("div", {
35
- className: a.metadataInstanceFormHeader,
36
- children: [/* @__PURE__ */ t(T, {
37
- className: a.title,
38
- title: N
39
- }), f ? /* @__PURE__ */ t(j, {
40
- areAiSuggestionsAvailable: r,
41
- isAdvancedExtractAgentEnabled: p,
42
- isBetaLanguageEnabled: m,
43
- isLoading: o,
44
- onAutofill: H
45
- }) : null]
46
- }), _ && /* @__PURE__ */ t(k, {
47
- isBetaLanguageEnabled: m,
48
- isLargeFile: I
49
- }), x && /* @__PURE__ */ t(g, {
50
- fieldsNeedingReviewCount: i,
51
- isLowScoreFilteringEnabled: s,
52
- onTextToggleClick: n
53
- })]
54
- });
55
- };
56
- export {
57
- R as MetadataInstanceFormHeader
58
- };
1
+ import { t as e } from "../../../../../../chunks/metadata-instance-form-header.js";
2
+ export { e as MetadataInstanceFormHeader };
@@ -1,22 +1,20 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- autofillInBetaNoticeHeader: {
4
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeHeader",
5
- defaultMessage: "AI Autofill is in Beta"
6
- },
7
- autofillInBetaNoticeBody: {
8
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeBody",
9
- defaultMessage: "Please check responses before saving."
10
- },
11
- largeFileNoticeHeader: {
12
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeHeader",
13
- defaultMessage: "Content is too large"
14
- },
15
- largeFileNoticeBody: {
16
- id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeBody",
17
- defaultMessage: "Box AI won’t be able to access the entire content, which might affect its answers."
18
- }
2
+ var t = e({
3
+ autofillInBetaNoticeHeader: {
4
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeHeader",
5
+ defaultMessage: "AI Autofill is in Beta"
6
+ },
7
+ autofillInBetaNoticeBody: {
8
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeBody",
9
+ defaultMessage: "Please check responses before saving."
10
+ },
11
+ largeFileNoticeHeader: {
12
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeHeader",
13
+ defaultMessage: "Content is too large"
14
+ },
15
+ largeFileNoticeBody: {
16
+ id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeBody",
17
+ defaultMessage: "Box AI won’t be able to access the entire content, which might affect its answers."
18
+ }
19
19
  });
20
- export {
21
- t as default
22
- };
20
+ export { t as default };
@@ -1,38 +1,31 @@
1
- import { useIntl as s } from "react-intl";
2
- import { InlineNotice as n, Text as t } from "@box/blueprint-web";
3
- import a from "./messages.js";
4
- import { jsxs as r, Fragment as c, jsx as l } from "react/jsx-runtime";
5
- const p = ({
6
- isLargeFile: o,
7
- isBetaLanguageEnabled: i
8
- }) => {
9
- const e = s();
10
- return !i && !o ? null : /* @__PURE__ */ r(c, {
11
- children: [o && /* @__PURE__ */ r(n, {
12
- variant: "warning",
13
- variantIconAriaLabel: e.formatMessage(a.largeFileNoticeHeader),
14
- children: [/* @__PURE__ */ l(t, {
15
- as: "p",
16
- variant: "bodyDefaultBold",
17
- children: e.formatMessage(a.largeFileNoticeHeader)
18
- }), /* @__PURE__ */ r(t, {
19
- as: "p",
20
- children: [e.formatMessage(a.largeFileNoticeBody), " "]
21
- })]
22
- }), i && /* @__PURE__ */ r(n, {
23
- variant: "info",
24
- variantIconAriaLabel: e.formatMessage(a.autofillInBetaNoticeHeader),
25
- children: [/* @__PURE__ */ l(t, {
26
- as: "p",
27
- variant: "bodyDefaultBold",
28
- children: e.formatMessage(a.autofillInBetaNoticeHeader)
29
- }), /* @__PURE__ */ r(t, {
30
- as: "p",
31
- children: [e.formatMessage(a.autofillInBetaNoticeBody), " "]
32
- })]
33
- })]
34
- });
35
- };
36
- export {
37
- p as MetadataInstanceFormInlineNotice
1
+ import e from "./messages.js";
2
+ import { InlineNotice as t, Text as n } from "@box/blueprint-web";
3
+ import { useIntl as r } from "react-intl";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ var s = ({ isLargeFile: s, isBetaLanguageEnabled: c }) => {
6
+ let l = r();
7
+ return !c && !s ? null : /* @__PURE__ */ o(i, { children: [s && /* @__PURE__ */ o(t, {
8
+ variant: "warning",
9
+ variantIconAriaLabel: l.formatMessage(e.largeFileNoticeHeader),
10
+ children: [/* @__PURE__ */ a(n, {
11
+ as: "p",
12
+ variant: "bodyDefaultBold",
13
+ children: l.formatMessage(e.largeFileNoticeHeader)
14
+ }), /* @__PURE__ */ o(n, {
15
+ as: "p",
16
+ children: [l.formatMessage(e.largeFileNoticeBody), " "]
17
+ })]
18
+ }), c && /* @__PURE__ */ o(t, {
19
+ variant: "info",
20
+ variantIconAriaLabel: l.formatMessage(e.autofillInBetaNoticeHeader),
21
+ children: [/* @__PURE__ */ a(n, {
22
+ as: "p",
23
+ variant: "bodyDefaultBold",
24
+ children: l.formatMessage(e.autofillInBetaNoticeHeader)
25
+ }), /* @__PURE__ */ o(n, {
26
+ as: "p",
27
+ children: [l.formatMessage(e.autofillInBetaNoticeBody), " "]
28
+ })]
29
+ })] });
38
30
  };
31
+ export { s as MetadataInstanceFormInlineNotice };
@@ -1,8 +1,4 @@
1
- import { MetadataInstanceList as e } from "./metadata-instance-list.js";
2
- import { MetadataInstanceHeader as n } from "./subcomponents/metadata-instance-header/metadata-instance-header.js";
3
- import { MetadataInstance as d } from "./subcomponents/metadata-instance/metadata-instance.js";
4
- export {
5
- d as MetadataInstance,
6
- n as MetadataInstanceHeader,
7
- e as MetadataInstanceList
8
- };
1
+ import { t as e } from "../../../../chunks/metadata-instance-list.js";
2
+ import { t } from "../../../../chunks/metadata-instance-header.js";
3
+ import { t as n } from "../../../../chunks/metadata-instance.js";
4
+ export { n as MetadataInstance, t as MetadataInstanceHeader, e as MetadataInstanceList };
@@ -1,35 +1,2 @@
1
- import { getVisibleTemplates as p } from "../../utils/utils.js";
2
- import { MetadataInstance as f } from "./subcomponents/metadata-instance/metadata-instance.js";
3
- import { jsx as a } from "react/jsx-runtime";
4
- import "./subcomponents/metadata-instance-header/metadata-instance-header.js";
5
- import '../../../../styles/metadata-instance-list.css';const I = "_metadataInstanceList_bd83w_1", L = {
6
- metadataInstanceList: I
7
- }, g = ({
8
- areAiSuggestionsAvailable: s,
9
- isAiSuggestionsFeatureEnabled: e,
10
- isBetaLanguageEnabled: n,
11
- onEdit: i,
12
- onSelectMetadataField: m,
13
- selectedMetadataFieldId: o,
14
- templateInstances: r,
15
- taxonomyNodeFetcher: c,
16
- isAdvancedExtractAgentEnabled: d = !1,
17
- isConfidenceScoreReviewEnabled: l = !1
18
- }) => /* @__PURE__ */ a("div", {
19
- className: L.metadataInstanceList,
20
- children: p(r).map((t) => /* @__PURE__ */ a(f, {
21
- areAiSuggestionsAvailable: s,
22
- isAdvancedExtractAgentEnabled: d,
23
- isAiSuggestionsFeatureEnabled: e,
24
- isBetaLanguageEnabled: n,
25
- isConfidenceScoreReviewEnabled: l,
26
- onEdit: i,
27
- onSelectMetadataField: m,
28
- selectedMetadataFieldId: o,
29
- taxonomyNodeFetcher: c,
30
- templateInstance: t
31
- }, t.id))
32
- });
33
- export {
34
- g as MetadataInstanceList
35
- };
1
+ import { t as e } from "../../../../chunks/metadata-instance-list.js";
2
+ export { e as MetadataInstanceList };
@@ -1,79 +1,2 @@
1
- import { Card as F, Divider as v } from "@box/blueprint-web";
2
- import { useState as H } from "react";
3
- import { useAutofill as M } from "../../../../utils/autofill-context.js";
4
- import { getFieldsNeedingReview as R } from "../../../../utils/confidence-score/get-fields-needing-review.js";
5
- import { MetadataEmptyState as b } from "../../../metadata-empty-state/metadata-empty-state.js";
6
- import { MetadataInstanceContent as C } from "../metadata-instance-content/metadata-instance-content.js";
7
- import { MetadataInstanceFooter as j } from "../metadata-instance-footer/metadata-instance-footer.js";
8
- import { MetadataInstanceHeader as T } from "../metadata-instance-header/metadata-instance-header.js";
9
- import { MetadataInstanceReviewNotice as k } from "../../../metadata-instance-review-notice/metadata-instance-review-notice.js";
10
- import { jsxs as d, jsx as t, Fragment as p } from "react/jsx-runtime";
11
- import '../../../../../../styles/metadata-instance.css';const B = "_topDivider_1xnom_1", K = "_reviewNotice_1xnom_5", W = "_bottomDivider_1xnom_9", l = {
12
- topDivider: B,
13
- reviewNotice: K,
14
- bottomDivider: W
15
- }, Z = ({
16
- areAiSuggestionsAvailable: y,
17
- isAiSuggestionsFeatureEnabled: n,
18
- isBetaLanguageEnabled: f,
19
- onEdit: s,
20
- onSelectMetadataField: h,
21
- selectedMetadataFieldId: N,
22
- templateInstance: e,
23
- taxonomyNodeFetcher: g,
24
- isAdvancedExtractAgentEnabled: w = !1,
25
- isConfidenceScoreReviewEnabled: m = !1
26
- }) => {
27
- const i = e.fields, c = (o) => !o.value || Array.isArray(o.value) && o.value.length === 0, E = i.every(c), V = i.some(c), A = i.length > 0, u = R(i).length, D = m && u > 0, [r, a] = H(!0), {
28
- getAiSuggestions: _
29
- } = M(), x = (o) => {
30
- s(e), _(e.templateKey, e.scope, o);
31
- }, S = () => {
32
- s(e, !0);
33
- };
34
- return /* @__PURE__ */ d(F, {
35
- children: [/* @__PURE__ */ t(T, {
36
- areAiSuggestionsAvailable: y,
37
- canEdit: e.canEdit,
38
- isAdvancedExtractAgentEnabled: w,
39
- isAiSuggestionsFeatureEnabled: n,
40
- isBetaLanguageEnabled: f,
41
- onAutofill: x,
42
- onEdit: () => s(e),
43
- templateName: e?.displayName
44
- }), /* @__PURE__ */ t(v, {
45
- className: l.topDivider
46
- }), D && /* @__PURE__ */ t("div", {
47
- className: l.reviewNotice,
48
- children: /* @__PURE__ */ t(k, {
49
- fieldsNeedingReviewCount: u,
50
- onTextToggleClick: S
51
- })
52
- }), r && E ? /* @__PURE__ */ t(b, {
53
- isAnyEmptyValueHidden: A,
54
- isBoxAiSuggestionsFeatureEnabled: n,
55
- level: "instance",
56
- onShowEmptyValues: () => a(!1)
57
- }) : /* @__PURE__ */ d(p, {
58
- children: [/* @__PURE__ */ t(C, {
59
- isConfidenceScoreReviewEnabled: m,
60
- onSelectMetadataField: h,
61
- selectedMetadataFieldId: N,
62
- shouldHideEmptyValues: r,
63
- taxonomyNodeFetcher: g,
64
- templateInstance: e
65
- }), V && /* @__PURE__ */ d(p, {
66
- children: [/* @__PURE__ */ t(v, {
67
- className: l.bottomDivider
68
- }), /* @__PURE__ */ t(j, {
69
- isAnyEmptyValueHidden: r,
70
- onHideEmptyValues: () => a(!0),
71
- onShowEmptyValues: () => a(!1)
72
- })]
73
- })]
74
- })]
75
- });
76
- };
77
- export {
78
- Z as MetadataInstance
79
- };
1
+ import { t as e } from "../../../../../../chunks/metadata-instance.js";
2
+ export { e as MetadataInstance };
@@ -1,40 +1,2 @@
1
- import p from "clsx";
2
- import { MetadataInstanceEntry as y } from "../metadata-instance-entry/metadata-instance-entry.js";
3
- import { jsx as o } from "react/jsx-runtime";
4
- import '../../../../../../styles/metadata-instance-content.css';const i = "_metadataInstanceContent_1cb0f_1", C = "_metadataInstanceContentReducedGap_1cb0f_7", c = {
5
- metadataInstanceContent: i,
6
- metadataInstanceContentReducedGap: C
7
- }, _ = ({
8
- onSelectMetadataField: n,
9
- selectedMetadataFieldId: s,
10
- shouldHideEmptyValues: m,
11
- templateInstance: a,
12
- taxonomyNodeFetcher: d,
13
- isConfidenceScoreReviewEnabled: e
14
- }) => {
15
- const {
16
- fields: r = []
17
- } = a;
18
- return /* @__PURE__ */ o("div", {
19
- className: p(c.metadataInstanceContent, e && c.metadataInstanceContentReducedGap),
20
- children: r.filter((t) => !t.hidden).map((t) => /* @__PURE__ */ o(y, {
21
- confidenceScore: t.confidenceScore,
22
- description: t.description,
23
- isConfidenceScoreReviewEnabled: e,
24
- isExternallyOwned: a.isExternallyOwned,
25
- isSelected: s === t.id,
26
- name: t.displayName || t.key,
27
- onClick: n ? () => n(t) : void 0,
28
- scope: t.namespace,
29
- shouldHideEmptyValues: m,
30
- taxonomyKey: t.taxonomyKey,
31
- taxonomyNodeFetcher: d,
32
- type: t.type,
33
- value: t.value,
34
- targetLocation: t.targetLocation
35
- }, t.id))
36
- });
37
- };
38
- export {
39
- _ as MetadataInstanceContent
40
- };
1
+ import { t as e } from "../../../../../../chunks/metadata-instance-content.js";
2
+ export { e as MetadataInstanceContent };
@@ -1,10 +1,6 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const n = e({
3
- confidenceScoreIconAriaLabel: {
4
- id: "metadataEditor.metadataInstanceEntry.confidenceScoreIconAriaLabel",
5
- defaultMessage: "Low confidence score - review needed"
6
- }
7
- });
8
- export {
9
- n as default
10
- };
2
+ var t = e({ confidenceScoreIconAriaLabel: {
3
+ id: "metadataEditor.metadataInstanceEntry.confidenceScoreIconAriaLabel",
4
+ defaultMessage: "Low confidence score - review needed"
5
+ } });
6
+ export { t as default };
@@ -1,25 +1,15 @@
1
- import { Text as s } from "@box/blueprint-web";
2
- import { TaxonomyValue as x } from "./taxonomy-entry/taxonomy-value.js";
3
- import { jsx as r } from "react/jsx-runtime";
4
- const T = ({
5
- type: t,
6
- formattedValue: o,
7
- value: n,
8
- taxonomyNodeFetcher: a,
9
- taxonomyKey: i,
10
- scope: m,
11
- isExternallyOwned: y
12
- }) => t === "taxonomy" ? /* @__PURE__ */ r(x, {
13
- isExternallyOwned: y,
14
- scope: m,
15
- taxonomyKey: i,
16
- taxonomyNodeFetcher: a,
17
- value: n
18
- }) : o && /* @__PURE__ */ r(s, {
19
- as: "p",
20
- variant: "bodyDefaultBold",
21
- children: o
1
+ import { TaxonomyValue as e } from "./taxonomy-entry/taxonomy-value.js";
2
+ import { Text as t } from "@box/blueprint-web";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ var r = ({ type: r, formattedValue: i, value: a, taxonomyNodeFetcher: o, taxonomyKey: s, scope: c, isExternallyOwned: l }) => r === "taxonomy" ? /* @__PURE__ */ n(e, {
5
+ isExternallyOwned: l,
6
+ scope: c,
7
+ taxonomyKey: s,
8
+ taxonomyNodeFetcher: o,
9
+ value: a
10
+ }) : i && /* @__PURE__ */ n(t, {
11
+ as: "p",
12
+ variant: "bodyDefaultBold",
13
+ children: i
22
14
  });
23
- export {
24
- T as MetadataEntryDisplay
25
- };
15
+ export { r as MetadataEntryDisplay };