@box/metadata-editor 1.64.5 → 1.64.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/ai-suggestion-field.js +83 -0
- package/dist/chunks/autofill-overlay.js +63 -0
- package/dist/chunks/combobox-with-api-pagination.js +162 -0
- package/dist/chunks/custom-instance-new-field.js +60 -0
- package/dist/chunks/custom-instance.js +74 -0
- package/dist/chunks/delete-confirmation-modal.js +76 -0
- package/dist/chunks/field-action-bar.module.js +6 -8
- package/dist/chunks/filter-dropdown-menu.module.js +14 -13
- package/dist/chunks/filter-instances-dropdown.js +84 -0
- package/dist/chunks/interactive-header-text.js +19 -0
- package/dist/chunks/interactive-text.js +17 -0
- package/dist/chunks/metadata-editor.js +9 -0
- package/dist/chunks/metadata-instance-content.js +29 -0
- package/dist/chunks/metadata-instance-entry.js +82 -0
- package/dist/chunks/metadata-instance-footer.js +25 -0
- package/dist/chunks/metadata-instance-form-autofill-button.js +113 -0
- package/dist/chunks/metadata-instance-form-card-wrapper.js +47 -70
- package/dist/chunks/metadata-instance-form-footer.js +43 -0
- package/dist/chunks/metadata-instance-form-header.js +45 -0
- package/dist/chunks/metadata-instance-header.js +52 -0
- package/dist/chunks/metadata-instance-list.js +19 -0
- package/dist/chunks/metadata-instance.js +59 -0
- package/dist/chunks/shared-field-styles.module.js +5 -7
- package/dist/chunks/taxonomy-ancestor-status-pill.js +88 -109
- package/dist/chunks/types.js +8 -12
- package/dist/chunks/update-mode-field-wrapper.js +80 -0
- package/dist/chunks/utils.js +57 -54
- package/dist/chunks/utils2.js +50 -70
- package/dist/esm/index.js +27 -52
- package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +31 -43
- package/dist/esm/lib/components/add-metadata-template-dropdown/index.js +1 -3
- package/dist/esm/lib/components/add-metadata-template-dropdown/messages.js +15 -17
- package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +2 -205
- package/dist/esm/lib/components/combobox-with-api-pagination/index.js +2 -4
- package/dist/esm/lib/components/combobox-with-api-pagination/messages.js +31 -33
- package/dist/esm/lib/components/combobox-with-api-pagination/request.js +4 -6
- package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +113 -128
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/is-abort-error.js +8 -10
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +32 -34
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +72 -82
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-content.js +13 -18
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +16 -19
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-item.js +12 -17
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.js +15 -20
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-root.js +13 -18
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +36 -44
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-trigger.js +7 -12
- package/dist/esm/lib/components/filter-dropdown-menu/index.js +16 -18
- package/dist/esm/lib/components/filter-dropdown-menu/messages.js +10 -12
- package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +2 -93
- package/dist/esm/lib/components/filter-instances-dropdown/index.js +2 -4
- package/dist/esm/lib/components/filter-instances-dropdown/messages.js +18 -20
- package/dist/esm/lib/components/interactive-header-text/interactive-header-text.js +2 -28
- package/dist/esm/lib/components/interactive-text/interactive-text.js +2 -30
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +20 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +2 -110
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +50 -52
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js +12 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/constants.js +2 -6
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +20 -24
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +66 -75
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/messages.js +30 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +43 -60
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +47 -71
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +32 -54
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +8 -14
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +40 -62
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +28 -44
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +66 -95
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js +30 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js +7 -11
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +2 -92
- package/dist/esm/lib/components/metadata-editor-fields/editor-field-types.js +30 -34
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-memoized-field-label.js +11 -7
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-review-field-filter.js +35 -40
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-view-reference-tooltip.js +39 -34
- package/dist/esm/lib/components/metadata-editor-fields/messages.js +5 -9
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +186 -176
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +30 -42
- package/dist/esm/lib/components/metadata-editor-fields/utils.js +2 -13
- package/dist/esm/lib/components/metadata-empty-state/messages.js +42 -44
- package/dist/esm/lib/components/metadata-empty-state/metadata-empty-state.js +46 -62
- package/dist/esm/lib/components/metadata-instance-editor/index.js +7 -14
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +2 -64
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +39 -41
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/useErrorMessaging.js +21 -26
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +2 -86
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js +15 -17
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +2 -62
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js +42 -44
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js +2 -91
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js +50 -52
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/constants.js +2 -7
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/messages.js +0 -1
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +2 -10
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +126 -155
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.js +2 -9
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +23 -25
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +2 -128
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js +19 -21
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +2 -53
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +6 -10
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +2 -58
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +18 -20
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +30 -37
- package/dist/esm/lib/components/metadata-instance-list/index.js +4 -8
- package/dist/esm/lib/components/metadata-instance-list/metadata-instance-list.js +2 -35
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +2 -79
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +2 -40
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js +5 -9
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js +14 -24
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +2 -112
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js +22 -24
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.js +2 -11
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.js +24 -36
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js +10 -12
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +2 -31
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +15 -17
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +2 -63
- package/dist/esm/lib/components/metadata-instance-review-notice/messages.js +30 -32
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +22 -32
- package/dist/esm/lib/components/unsaved-changes-modal/index.js +2 -4
- package/dist/esm/lib/components/unsaved-changes-modal/messages.js +23 -25
- package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +41 -57
- package/dist/esm/lib/components/unsaved-changes-modal/utils.js +3 -5
- package/dist/esm/lib/constants.js +14 -18
- package/dist/esm/lib/defaults.js +14 -17
- package/dist/esm/lib/mappers.js +22 -28
- package/dist/esm/lib/messages.js +123 -126
- package/dist/esm/lib/metadata-editor.js +2 -14
- package/dist/esm/lib/utils/api-wrapper.js +12 -18
- package/dist/esm/lib/utils/autofill-context.js +65 -67
- package/dist/esm/lib/utils/check-if-has-bounding-boxes.js +2 -4
- package/dist/esm/lib/utils/confidence-score/format-confidence-score-percent.js +3 -5
- package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +12 -19
- package/dist/esm/lib/utils/confidence-score/get-fields-needing-review.js +5 -7
- package/dist/esm/lib/utils/confidence-score/index.js +5 -10
- package/dist/esm/lib/utils/confidence-score/is-confidence-score-needing-review.js +4 -6
- package/dist/esm/lib/utils/confidence-score/messages.js +14 -16
- package/dist/esm/lib/utils/convertDate.js +20 -31
- package/dist/esm/lib/utils/is-interactive-form-element.js +2 -4
- package/dist/esm/lib/utils/utils.js +4 -9
- package/dist/styles/autofill-overlay.css +1 -1
- package/dist/styles/combobox-with-api-pagination.css +1 -1
- package/dist/styles/custom-instance-new-field.css +1 -1
- package/dist/styles/custom-instance.css +1 -1
- package/dist/styles/delete-confirmation-modal.css +1 -1
- package/dist/styles/field-action-bar.css +1 -1
- package/dist/styles/filter-dropdown-menu.css +1 -1
- package/dist/styles/filter-instances-dropdown.css +1 -1
- package/dist/styles/interactive-header-text.css +1 -1
- package/dist/styles/interactive-text.css +1 -1
- package/dist/styles/metadata-editor.css +1 -0
- package/dist/styles/metadata-instance-content.css +1 -1
- package/dist/styles/metadata-instance-entry.css +1 -1
- package/dist/styles/metadata-instance-footer.css +1 -1
- package/dist/styles/metadata-instance-form-autofill-button.css +1 -1
- package/dist/styles/metadata-instance-form-card-wrapper.css +1 -1
- package/dist/styles/metadata-instance-form-footer.css +1 -1
- package/dist/styles/metadata-instance-form-header.css +1 -1
- package/dist/styles/metadata-instance-header.css +1 -1
- package/dist/styles/metadata-instance-list.css +1 -1
- package/dist/styles/shared-field-styles.css +1 -1
- package/dist/styles/taxonomy-ancestor-status-pill.css +1 -1
- package/dist/styles/update-mode-field-wrapper.css +1 -1
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/test-utils/index.d.ts +1 -0
- package/dist/types/lib/test-utils/pending-promise.d.ts +19 -0
- package/package.json +9 -9
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Text as e, Tooltip as t } from "@box/blueprint-web";
|
|
2
|
+
import { Focusable as n } from "@ariakit/react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import i from "clsx";
|
|
5
|
+
import '../styles/interactive-text.css';var a = { interactiveText: "_interactiveText_1i8lr_1" }, o = ({ tooltipText: o, className: s, children: c, ...l }) => {
|
|
6
|
+
let { as: u = "span" } = l;
|
|
7
|
+
return /* @__PURE__ */ r(t, {
|
|
8
|
+
content: o,
|
|
9
|
+
children: /* @__PURE__ */ r(n, { render: /* @__PURE__ */ r(e, {
|
|
10
|
+
as: u,
|
|
11
|
+
className: i(a.interactiveText, s),
|
|
12
|
+
...l,
|
|
13
|
+
children: c
|
|
14
|
+
}) })
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export { o as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import '../styles/metadata-editor.css';var t = {};
|
|
3
|
+
function n(n) {
|
|
4
|
+
return /* @__PURE__ */ e("div", {
|
|
5
|
+
className: t.container,
|
|
6
|
+
children: /* @__PURE__ */ e("h1", { children: "Welcome to MetadataEditor!" })
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export { n as t };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { t as e } from "./metadata-instance-entry.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import '../styles/metadata-instance-content.css';var r = {
|
|
5
|
+
metadataInstanceContent: "_metadataInstanceContent_1cb0f_1",
|
|
6
|
+
metadataInstanceContentReducedGap: "_metadataInstanceContentReducedGap_1cb0f_7"
|
|
7
|
+
}, i = ({ onSelectMetadataField: i, selectedMetadataFieldId: a, shouldHideEmptyValues: o, templateInstance: s, taxonomyNodeFetcher: c, isConfidenceScoreReviewEnabled: l }) => {
|
|
8
|
+
let { fields: u = [] } = s;
|
|
9
|
+
return /* @__PURE__ */ t("div", {
|
|
10
|
+
className: n(r.metadataInstanceContent, l && r.metadataInstanceContentReducedGap),
|
|
11
|
+
children: u.filter((e) => !e.hidden).map((n) => /* @__PURE__ */ t(e, {
|
|
12
|
+
confidenceScore: n.confidenceScore,
|
|
13
|
+
description: n.description,
|
|
14
|
+
isConfidenceScoreReviewEnabled: l,
|
|
15
|
+
isExternallyOwned: s.isExternallyOwned,
|
|
16
|
+
isSelected: a === n.id,
|
|
17
|
+
name: n.displayName || n.key,
|
|
18
|
+
onClick: i ? () => i(n) : void 0,
|
|
19
|
+
scope: n.namespace,
|
|
20
|
+
shouldHideEmptyValues: o,
|
|
21
|
+
taxonomyKey: n.taxonomyKey,
|
|
22
|
+
taxonomyNodeFetcher: c,
|
|
23
|
+
type: n.type,
|
|
24
|
+
value: n.value,
|
|
25
|
+
targetLocation: n.targetLocation
|
|
26
|
+
}, n.id))
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export { i as t };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import e from "../esm/lib/messages.js";
|
|
2
|
+
import { isConfidenceScoreNeedingReview as t } from "../esm/lib/utils/confidence-score/is-confidence-score-needing-review.js";
|
|
3
|
+
import { checkIfHasBoundingBoxes as n } from "../esm/lib/utils/check-if-has-bounding-boxes.js";
|
|
4
|
+
import { getConfidenceScoreTooltip as r } from "../esm/lib/utils/confidence-score/get-confidence-score-tooltip.js";
|
|
5
|
+
import { t as i } from "./shared-field-styles.module.js";
|
|
6
|
+
import { convertISOStringToUTCDate as a } from "../esm/lib/utils/convertDate.js";
|
|
7
|
+
import { t as o } from "./interactive-text.js";
|
|
8
|
+
import s from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";
|
|
9
|
+
import { MetadataEntryDisplay as c } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
|
|
10
|
+
import { Status as l, Text as u, Tooltip as d } from "@box/blueprint-web";
|
|
11
|
+
import { FormattedDate as f, useIntl as p } from "react-intl";
|
|
12
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
|
+
import g from "clsx";
|
|
14
|
+
import { AlertCircle as _ } from "@box/blueprint-web-assets/icons/Medium";
|
|
15
|
+
import '../styles/metadata-instance-entry.css';var v = {
|
|
16
|
+
metadataInstanceEntry: "_metadataInstanceEntry_fr9av_1",
|
|
17
|
+
name: "_name_fr9av_6",
|
|
18
|
+
labelContainer: "_labelContainer_fr9av_14",
|
|
19
|
+
confidenceScoreIcon: "_confidenceScoreIcon_fr9av_20"
|
|
20
|
+
}, y = ({ description: y, isSelected: b, name: x, onClick: S, shouldHideEmptyValues: C, type: w, value: T, taxonomyNodeFetcher: E, taxonomyKey: D, scope: O, isExternallyOwned: k, confidenceScore: A, isConfidenceScoreReviewEnabled: j = !1, targetLocation: M }) => {
|
|
21
|
+
let N = p(), P = j && !!A && t(A), F = n(M), I = j && !!A && F && !!S, L = P ? r(N.formatMessage, A) : null, R = typeof T == "number" ? T.toString() : T ? Array.isArray(T) ? T.join(", ") : w === "date" && typeof T == "string" ? /* @__PURE__ */ m(f, {
|
|
22
|
+
day: "numeric",
|
|
23
|
+
month: "long",
|
|
24
|
+
value: a(T),
|
|
25
|
+
year: "numeric"
|
|
26
|
+
}) : T : null, z = {
|
|
27
|
+
"data-metadata-field": !0,
|
|
28
|
+
"data-testid": "metadata-field",
|
|
29
|
+
onClick: S,
|
|
30
|
+
onKeyDown: (e) => {
|
|
31
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), S?.());
|
|
32
|
+
},
|
|
33
|
+
role: "button",
|
|
34
|
+
tabIndex: 0
|
|
35
|
+
};
|
|
36
|
+
if (C && !R) return null;
|
|
37
|
+
let B = /* @__PURE__ */ h("div", {
|
|
38
|
+
className: g(v.metadataInstanceEntry, j && i.spacious, I && i.clickableField, I && b && i.selectedField),
|
|
39
|
+
...I && z,
|
|
40
|
+
children: [/* @__PURE__ */ h("div", {
|
|
41
|
+
className: v.labelContainer,
|
|
42
|
+
children: [L && /* @__PURE__ */ m(d, {
|
|
43
|
+
content: L,
|
|
44
|
+
children: /* @__PURE__ */ m("span", {
|
|
45
|
+
className: v.confidenceScoreIcon,
|
|
46
|
+
children: /* @__PURE__ */ m(l, {
|
|
47
|
+
color: "SurfaceStatusSurfaceGray",
|
|
48
|
+
hideText: !0,
|
|
49
|
+
icon: _,
|
|
50
|
+
interactive: !0,
|
|
51
|
+
text: N.formatMessage(s.confidenceScoreIconAriaLabel)
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}), /* @__PURE__ */ m(u, {
|
|
55
|
+
as: "h5",
|
|
56
|
+
color: "textOnLightSecondary",
|
|
57
|
+
variant: "bodyDefaultBold",
|
|
58
|
+
className: v.name,
|
|
59
|
+
children: y ? /* @__PURE__ */ m(o, {
|
|
60
|
+
as: "span",
|
|
61
|
+
color: "textOnLightSecondary",
|
|
62
|
+
tooltipText: y,
|
|
63
|
+
variant: "bodyDefaultBold",
|
|
64
|
+
children: x
|
|
65
|
+
}) : x
|
|
66
|
+
})]
|
|
67
|
+
}), /* @__PURE__ */ m(c, {
|
|
68
|
+
formattedValue: R,
|
|
69
|
+
isExternallyOwned: k,
|
|
70
|
+
scope: O,
|
|
71
|
+
taxonomyKey: D,
|
|
72
|
+
taxonomyNodeFetcher: E,
|
|
73
|
+
type: w,
|
|
74
|
+
value: T
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
return I ? /* @__PURE__ */ m(d, {
|
|
78
|
+
content: N.formatMessage(e.viewOnDocument),
|
|
79
|
+
children: B
|
|
80
|
+
}) : B;
|
|
81
|
+
};
|
|
82
|
+
export { y as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import e from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js";
|
|
2
|
+
import { TextButton as t } from "@box/blueprint-web";
|
|
3
|
+
import { useIntl as n } from "react-intl";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import '../styles/metadata-instance-footer.css';var i = {
|
|
6
|
+
metadataInstanceFooter: "_metadataInstanceFooter_r5r5c_1",
|
|
7
|
+
button: "_button_r5r5c_5"
|
|
8
|
+
}, a = ({ isAnyEmptyValueHidden: a, onHideEmptyValues: o, onShowEmptyValues: s }) => {
|
|
9
|
+
let c = n();
|
|
10
|
+
return /* @__PURE__ */ r("div", {
|
|
11
|
+
className: i.metadataInstanceFooter,
|
|
12
|
+
children: a ? /* @__PURE__ */ r(t, {
|
|
13
|
+
className: i.button,
|
|
14
|
+
onClick: s,
|
|
15
|
+
"data-target-id": "TextButton-showEmptyValuesCTA",
|
|
16
|
+
children: c.formatMessage(e.showEmptyValuesCTA)
|
|
17
|
+
}) : /* @__PURE__ */ r(t, {
|
|
18
|
+
className: i.button,
|
|
19
|
+
onClick: o,
|
|
20
|
+
"data-target-id": "TextButton-hideEmptyValuesCTA",
|
|
21
|
+
children: c.formatMessage(e.hideEmptyValuesCTA)
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export { a as t };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { EXTRACT_AGENTS_MAP as e, EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY as t } from "../esm/lib/constants.js";
|
|
2
|
+
import { autofillMessages as n } from "../esm/lib/messages.js";
|
|
3
|
+
import { getTooltipContent as r } from "../esm/lib/utils/utils.js";
|
|
4
|
+
import { useAutofill as i } from "../esm/lib/utils/autofill-context.js";
|
|
5
|
+
import a from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js";
|
|
6
|
+
import { Button as o, DropdownMenu as s, IconButton as c, LoadingIndicator as l, SplitButton as u, Text as d, Tooltip as f } from "@box/blueprint-web";
|
|
7
|
+
import { forwardRef as p, useEffect as m, useMemo as h, useState as g } from "react";
|
|
8
|
+
import { useIntl as _ } from "react-intl";
|
|
9
|
+
import { BoxAiAdvancedLogo24 as v, BoxAiLogo24 as y } from "@box/blueprint-web-assets/icons/Logo";
|
|
10
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
import { useLocalStorageAIAgents as S } from "@box/box-ai-agent-selector";
|
|
12
|
+
import { getIn as C, useFormikContext as w } from "formik";
|
|
13
|
+
import '../styles/metadata-instance-form-autofill-button.css';var T = {
|
|
14
|
+
loadingIndicator: "_loadingIndicator_i1hyy_1",
|
|
15
|
+
actionMenuItem: "_actionMenuItem_i1hyy_11",
|
|
16
|
+
splitButtonIcon: "_splitButtonIcon_i1hyy_17"
|
|
17
|
+
}, E = /* @__PURE__ */ p(({ isButtonDisabled: t, onAutofill: n, onAgentChange: r, storedAgent: i, icon: o, ...c }, l) => {
|
|
18
|
+
let f = _(), [p, m] = g(i || "standard"), h = (e) => {
|
|
19
|
+
m(e), r(e), setTimeout(() => {
|
|
20
|
+
n(e);
|
|
21
|
+
}, 0);
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ b(u, {
|
|
24
|
+
...c,
|
|
25
|
+
ref: l,
|
|
26
|
+
disabled: t,
|
|
27
|
+
dropdownTriggerAriaLabel: "See agent options.",
|
|
28
|
+
endIcon: o,
|
|
29
|
+
label: f.formatMessage(a.autofillButton),
|
|
30
|
+
onClick: () => n(),
|
|
31
|
+
variant: "secondary",
|
|
32
|
+
children: /* @__PURE__ */ b(s.RadioGroup, {
|
|
33
|
+
onValueChange: (e) => h(e),
|
|
34
|
+
value: p,
|
|
35
|
+
children: Object.entries(e).map(([e, t]) => {
|
|
36
|
+
let n = t.ICON;
|
|
37
|
+
return /* @__PURE__ */ b(s.RadioSelectItem, {
|
|
38
|
+
value: t.AGENT_TYPE,
|
|
39
|
+
children: /* @__PURE__ */ x("div", {
|
|
40
|
+
className: T.actionMenuItem,
|
|
41
|
+
children: [/* @__PURE__ */ b(n, {
|
|
42
|
+
"aria-hidden": !0,
|
|
43
|
+
className: T.splitButtonIcon
|
|
44
|
+
}), /* @__PURE__ */ b(d, {
|
|
45
|
+
as: "span",
|
|
46
|
+
children: f.formatMessage(a[t.DISPLAY_MSG])
|
|
47
|
+
})]
|
|
48
|
+
})
|
|
49
|
+
}, e);
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}), D = ({ areAiSuggestionsAvailable: s, isBetaLanguageEnabled: u, isLoading: d, variant: p = "secondary-button", isAdvancedExtractAgentEnabled: g = !1, onAutofill: x }) => {
|
|
54
|
+
let { isSubmitting: D, values: O, setFieldValue: k } = w(), A = _(), [j, M] = S(t), { suggestions: N, confidenceScores: P, targetLocations: F } = i();
|
|
55
|
+
m(() => {
|
|
56
|
+
if (N) {
|
|
57
|
+
let e = C(O, "metadata.fields"), t = C(O, "metadata.templateKey");
|
|
58
|
+
k("metadata.fields", e?.map((e) => {
|
|
59
|
+
let n = N?.[t]?.[e.key];
|
|
60
|
+
return n ? {
|
|
61
|
+
...e,
|
|
62
|
+
aiSuggestion: n,
|
|
63
|
+
aiSuggestionConfidenceScore: P?.[t]?.[e.key],
|
|
64
|
+
aiSuggestionTargetLocation: F?.[t]?.[e.key]
|
|
65
|
+
} : e;
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
}, [
|
|
69
|
+
N,
|
|
70
|
+
P,
|
|
71
|
+
F,
|
|
72
|
+
k
|
|
73
|
+
]);
|
|
74
|
+
let I = (t) => {
|
|
75
|
+
let n = C(O, "metadata.templateKey"), r = C(O, "metadata.scope"), i = t ? e[t]?.AGENT_ID : e[j]?.AGENT_ID;
|
|
76
|
+
x(n, r, g ? i : void 0);
|
|
77
|
+
}, L = !s || D || d, R = j === "enhanced" && g ? v : y, z = h(() => r(g, j, A), [
|
|
78
|
+
g,
|
|
79
|
+
j,
|
|
80
|
+
A
|
|
81
|
+
]);
|
|
82
|
+
return p === "secondary-button" ? /* @__PURE__ */ b(f, {
|
|
83
|
+
content: z,
|
|
84
|
+
children: g ? /* @__PURE__ */ b(E, {
|
|
85
|
+
icon: R,
|
|
86
|
+
isButtonDisabled: L,
|
|
87
|
+
onAgentChange: M,
|
|
88
|
+
onAutofill: I,
|
|
89
|
+
storedAgent: j
|
|
90
|
+
}) : /* @__PURE__ */ b(o, {
|
|
91
|
+
disabled: L,
|
|
92
|
+
endIcon: R,
|
|
93
|
+
onClick: () => I(),
|
|
94
|
+
variant: "secondary",
|
|
95
|
+
"data-target-id": "Button-autofillButton",
|
|
96
|
+
children: A.formatMessage(a.autofillButton)
|
|
97
|
+
})
|
|
98
|
+
}) : /* @__PURE__ */ b(f, {
|
|
99
|
+
content: z,
|
|
100
|
+
children: d ? /* @__PURE__ */ b(l, {
|
|
101
|
+
"aria-label": A.formatMessage(a.loadingButtonAriaLabel),
|
|
102
|
+
className: T.loadingIndicator
|
|
103
|
+
}) : /* @__PURE__ */ b(c, {
|
|
104
|
+
"aria-label": A.formatMessage(n.autofillButtonAriaLabel),
|
|
105
|
+
disabled: L,
|
|
106
|
+
icon: R,
|
|
107
|
+
onClick: () => I(),
|
|
108
|
+
variant: "icon-logo",
|
|
109
|
+
"data-target-id": "IconButton-autofillButtonAriaLabel"
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
export { D as t };
|
|
@@ -1,71 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import '../styles/metadata-instance-form-card-wrapper.css';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
areAiSuggestionsAvailable: o,
|
|
48
|
-
hasSuggestions: S,
|
|
49
|
-
isAdvancedExtractAgentEnabled: c,
|
|
50
|
-
isAiSuggestionsFeatureEnabled: l && !E,
|
|
51
|
-
isBetaLanguageEnabled: m,
|
|
52
|
-
isConfidenceScoreReviewEnabled: g,
|
|
53
|
-
isLargeFile: p,
|
|
54
|
-
isLoading: e,
|
|
55
|
-
onAutofill: v,
|
|
56
|
-
onToggleReviewFilter: F,
|
|
57
|
-
shouldShowOnlyReviewFields: _,
|
|
58
|
-
templateName: t?.displayName
|
|
59
|
-
}), t && r, /* @__PURE__ */ a(b, {
|
|
60
|
-
isDeleteButtonDisabled: u,
|
|
61
|
-
isLoading: e,
|
|
62
|
-
onCancel: () => C(h),
|
|
63
|
-
onDelete: I
|
|
64
|
-
})]
|
|
65
|
-
})
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
W as M,
|
|
70
|
-
n as s
|
|
1
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as e } from "../esm/lib/constants.js";
|
|
2
|
+
import { t } from "./metadata-instance-form-header.js";
|
|
3
|
+
import { t as n } from "./metadata-instance-form-footer.js";
|
|
4
|
+
import { Card as r, useBlueprintModernization as i } from "@box/blueprint-web";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import s from "clsx";
|
|
7
|
+
import '../styles/metadata-instance-form-card-wrapper.css';var c = {
|
|
8
|
+
metadataInstanceForm: "_metadataInstanceForm_ztv76_1",
|
|
9
|
+
wrapperGradient: "_wrapperGradient_ztv76_7",
|
|
10
|
+
suggestionsFetching: "_suggestionsFetching_ztv76_17",
|
|
11
|
+
metadataInstanceFormContent: "_metadataInstanceFormContent_ztv76_23",
|
|
12
|
+
metadataInstanceFormContentReducedGap: "_metadataInstanceFormContentReducedGap_ztv76_30",
|
|
13
|
+
showOverlay: "_showOverlay_ztv76_34"
|
|
14
|
+
}, l = (l) => {
|
|
15
|
+
let { areAiSuggestionsAvailable: u, children: d, className: f, formRef: p, isAdvancedExtractAgentEnabled: m = !1, isAiSuggestionsFeatureEnabled: h, isBetaLanguageEnabled: g, isConfidenceScoreReviewEnabled: _ = !1, isLargeFile: v = !1, isDeleteButtonDisabled: y, onToggleReviewFilter: b, shouldShowOnlyReviewFields: x = !1, suggestions: S, isFetchingSuggestions: C, isFormDirty: w = !1, selectedTemplateInstance: T, getAiSuggestions: E, handleCancel: D, handleDelete: O } = l, { enableModernizedComponents: k } = i(), A = T?.templateKey === e, j = !!S[T?.templateKey];
|
|
16
|
+
return /* @__PURE__ */ a("div", {
|
|
17
|
+
className: C && c.wrapperGradient,
|
|
18
|
+
"data-modern": k,
|
|
19
|
+
children: /* @__PURE__ */ o(r, {
|
|
20
|
+
ref: p,
|
|
21
|
+
className: s(f, { [c.suggestionsFetching]: C }),
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ a(t, {
|
|
24
|
+
areAiSuggestionsAvailable: u,
|
|
25
|
+
hasSuggestions: j,
|
|
26
|
+
isAdvancedExtractAgentEnabled: m,
|
|
27
|
+
isAiSuggestionsFeatureEnabled: h && !A,
|
|
28
|
+
isBetaLanguageEnabled: g,
|
|
29
|
+
isConfidenceScoreReviewEnabled: _,
|
|
30
|
+
isLargeFile: v,
|
|
31
|
+
isLoading: C,
|
|
32
|
+
onAutofill: E,
|
|
33
|
+
onToggleReviewFilter: b,
|
|
34
|
+
shouldShowOnlyReviewFields: x,
|
|
35
|
+
templateName: T?.displayName
|
|
36
|
+
}),
|
|
37
|
+
T && d,
|
|
38
|
+
/* @__PURE__ */ a(n, {
|
|
39
|
+
isDeleteButtonDisabled: y,
|
|
40
|
+
isLoading: C,
|
|
41
|
+
onCancel: () => D(w),
|
|
42
|
+
onDelete: O
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
});
|
|
71
47
|
};
|
|
48
|
+
export { c as n, l as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import e from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js";
|
|
2
|
+
import { Button as t, TextButton as n } from "@box/blueprint-web";
|
|
3
|
+
import { useIntl as r } from "react-intl";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { useFormikContext as o } from "formik";
|
|
6
|
+
import '../styles/metadata-instance-form-footer.css';var s = {
|
|
7
|
+
metadataInstanceFormFooter: "_metadataInstanceFormFooter_sqpiw_1",
|
|
8
|
+
buttonsContainer: "_buttonsContainer_sqpiw_7",
|
|
9
|
+
buttons: "_buttons_sqpiw_7"
|
|
10
|
+
}, c = ({ isDeleteButtonDisabled: c, isLoading: l, onCancel: u, onDelete: d }) => {
|
|
11
|
+
let f = r(), { isSubmitting: p, submitForm: m } = o(), h = l || p;
|
|
12
|
+
return /* @__PURE__ */ i("div", {
|
|
13
|
+
className: s.metadataInstanceFormFooter,
|
|
14
|
+
children: /* @__PURE__ */ a("div", {
|
|
15
|
+
className: s.buttonsContainer,
|
|
16
|
+
children: [/* @__PURE__ */ i(n, {
|
|
17
|
+
disabled: h || c,
|
|
18
|
+
onClick: d,
|
|
19
|
+
"data-target-id": "TextButton-deleteButton",
|
|
20
|
+
children: f.formatMessage(e.deleteButton)
|
|
21
|
+
}), /* @__PURE__ */ a("div", {
|
|
22
|
+
className: s.buttons,
|
|
23
|
+
children: [/* @__PURE__ */ i(t, {
|
|
24
|
+
disabled: h,
|
|
25
|
+
onClick: u,
|
|
26
|
+
size: "large",
|
|
27
|
+
variant: "secondary",
|
|
28
|
+
"data-target-id": "Button-cancelButton",
|
|
29
|
+
children: f.formatMessage(e.cancelButton)
|
|
30
|
+
}), /* @__PURE__ */ i(t, {
|
|
31
|
+
disabled: h,
|
|
32
|
+
loading: p,
|
|
33
|
+
loadingAriaLabel: f.formatMessage(e.loadingAriaLabel),
|
|
34
|
+
onClick: m,
|
|
35
|
+
size: "large",
|
|
36
|
+
"data-target-id": "Button-saveButton",
|
|
37
|
+
children: f.formatMessage(e.saveButton)
|
|
38
|
+
})]
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export { c as t };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as e } from "./metadata-instance-form-autofill-button.js";
|
|
2
|
+
import { getFieldsNeedingReview as t } from "../esm/lib/utils/confidence-score/get-fields-needing-review.js";
|
|
3
|
+
import { t as n } from "./interactive-header-text.js";
|
|
4
|
+
import { MetadataInstanceReviewNotice as r } from "../esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js";
|
|
5
|
+
import { MetadataInstanceFormInlineNotice as i } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";
|
|
6
|
+
import a from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js";
|
|
7
|
+
import { useMemo as o } from "react";
|
|
8
|
+
import { useIntl as s } from "react-intl";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
import { useFormikContext as u } from "formik";
|
|
11
|
+
import '../styles/metadata-instance-form-header.css';var d = {
|
|
12
|
+
metadataInstanceFormHeaderWrapper: "_metadataInstanceFormHeaderWrapper_3nbmr_1",
|
|
13
|
+
metadataInstanceFormHeader: "_metadataInstanceFormHeader_3nbmr_1",
|
|
14
|
+
title: "_title_3nbmr_15"
|
|
15
|
+
}, f = ({ areAiSuggestionsAvailable: f, hasSuggestions: p, isAdvancedExtractAgentEnabled: m = !1, isAiSuggestionsFeatureEnabled: h, isBetaLanguageEnabled: g, isConfidenceScoreReviewEnabled: _ = !1, isLargeFile: v, isLoading: y, onToggleReviewFilter: b, shouldShowOnlyReviewFields: x = !1, templateName: S, onAutofill: C }) => {
|
|
16
|
+
let w = s(), { values: T } = u(), E = o(() => _ ? t(T.metadata?.fields ?? []).length : 0, [T.metadata?.fields, _]), D = S ?? w.formatMessage(a.customInstanceTitle), O = p && f, k = _ && !y && (E > 0 || x) && b !== void 0;
|
|
17
|
+
return /* @__PURE__ */ l("div", {
|
|
18
|
+
className: d.metadataInstanceFormHeaderWrapper,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ l("div", {
|
|
21
|
+
className: d.metadataInstanceFormHeader,
|
|
22
|
+
children: [/* @__PURE__ */ c(n, {
|
|
23
|
+
className: d.title,
|
|
24
|
+
title: D
|
|
25
|
+
}), h ? /* @__PURE__ */ c(e, {
|
|
26
|
+
areAiSuggestionsAvailable: f,
|
|
27
|
+
isAdvancedExtractAgentEnabled: m,
|
|
28
|
+
isBetaLanguageEnabled: g,
|
|
29
|
+
isLoading: y,
|
|
30
|
+
onAutofill: C
|
|
31
|
+
}) : null]
|
|
32
|
+
}),
|
|
33
|
+
O && /* @__PURE__ */ c(i, {
|
|
34
|
+
isBetaLanguageEnabled: g,
|
|
35
|
+
isLargeFile: v
|
|
36
|
+
}),
|
|
37
|
+
k && /* @__PURE__ */ c(r, {
|
|
38
|
+
fieldsNeedingReviewCount: E,
|
|
39
|
+
isLowScoreFilteringEnabled: x,
|
|
40
|
+
onTextToggleClick: b
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export { f as t };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EXTRACT_AGENTS_MAP as e, EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY as t } from "../esm/lib/constants.js";
|
|
2
|
+
import { autofillMessages as n } from "../esm/lib/messages.js";
|
|
3
|
+
import { getTooltipContent as r } from "../esm/lib/utils/utils.js";
|
|
4
|
+
import { t as i } from "./interactive-header-text.js";
|
|
5
|
+
import a from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js";
|
|
6
|
+
import { IconButton as o, Tooltip as s } from "@box/blueprint-web";
|
|
7
|
+
import { useMemo as c } from "react";
|
|
8
|
+
import { useIntl as l } from "react-intl";
|
|
9
|
+
import { BoxAiAdvancedLogo24 as u, BoxAiLogo24 as d } from "@box/blueprint-web-assets/icons/Logo";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
+
import { useLocalStorageAIAgents as m } from "@box/box-ai-agent-selector";
|
|
12
|
+
import { Pencil as h } from "@box/blueprint-web-assets/icons/Line";
|
|
13
|
+
import '../styles/metadata-instance-header.css';var g = {
|
|
14
|
+
metadataInstanceHeader: "_metadataInstanceHeader_17bsu_1",
|
|
15
|
+
iconButtonsContainer: "_iconButtonsContainer_17bsu_6",
|
|
16
|
+
title: "_title_17bsu_14"
|
|
17
|
+
}, _ = ({ areAiSuggestionsAvailable: _, canEdit: v, isAiSuggestionsFeatureEnabled: y, isBetaLanguageEnabled: b, onEdit: x, onAutofill: S, templateName: C, isAdvancedExtractAgentEnabled: w = !1 }) => {
|
|
18
|
+
let T = l(), E = C || T.formatMessage(a.customInstanceTitle), D = y && C, [O] = m(t), k = w && e[O]?.AGENT_ID, A = c(() => r(w, O, T), [
|
|
19
|
+
w,
|
|
20
|
+
O,
|
|
21
|
+
T
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ p("div", {
|
|
24
|
+
className: g.metadataInstanceHeader,
|
|
25
|
+
children: [/* @__PURE__ */ f(i, {
|
|
26
|
+
className: g.title,
|
|
27
|
+
title: E
|
|
28
|
+
}), v && /* @__PURE__ */ p("div", {
|
|
29
|
+
className: g.iconButtonsContainer,
|
|
30
|
+
children: [D && /* @__PURE__ */ f(s, {
|
|
31
|
+
content: A,
|
|
32
|
+
children: /* @__PURE__ */ f(o, {
|
|
33
|
+
"aria-label": T.formatMessage(n.autofillButtonAriaLabelWithTemplateName, { templateName: C }),
|
|
34
|
+
disabled: !_,
|
|
35
|
+
icon: O === "enhanced" && w ? u : d,
|
|
36
|
+
onClick: () => S(k || void 0),
|
|
37
|
+
variant: "icon-logo",
|
|
38
|
+
"data-target-id": "IconButton-autofillButtonAriaLabelWithTemplateName"
|
|
39
|
+
})
|
|
40
|
+
}), /* @__PURE__ */ f(s, {
|
|
41
|
+
content: T.formatMessage(a.editButtonTooltip),
|
|
42
|
+
children: /* @__PURE__ */ f(o, {
|
|
43
|
+
"aria-label": T.formatMessage(a.editButtonAriaLabel, { templateName: C }),
|
|
44
|
+
icon: h,
|
|
45
|
+
onClick: x,
|
|
46
|
+
"data-target-id": "IconButton-editButtonAriaLabel"
|
|
47
|
+
})
|
|
48
|
+
})]
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
export { _ as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getVisibleTemplates as e } from "../esm/lib/utils/utils.js";
|
|
2
|
+
import { t } from "./metadata-instance.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import '../styles/metadata-instance-list.css';var r = { metadataInstanceList: "_metadataInstanceList_bd83w_1" }, i = ({ areAiSuggestionsAvailable: i, isAiSuggestionsFeatureEnabled: a, isBetaLanguageEnabled: o, onEdit: s, onSelectMetadataField: c, selectedMetadataFieldId: l, templateInstances: u, taxonomyNodeFetcher: d, isAdvancedExtractAgentEnabled: f = !1, isConfidenceScoreReviewEnabled: p = !1 }) => /* @__PURE__ */ n("div", {
|
|
5
|
+
className: r.metadataInstanceList,
|
|
6
|
+
children: e(u).map((e) => /* @__PURE__ */ n(t, {
|
|
7
|
+
areAiSuggestionsAvailable: i,
|
|
8
|
+
isAdvancedExtractAgentEnabled: f,
|
|
9
|
+
isAiSuggestionsFeatureEnabled: a,
|
|
10
|
+
isBetaLanguageEnabled: o,
|
|
11
|
+
isConfidenceScoreReviewEnabled: p,
|
|
12
|
+
onEdit: s,
|
|
13
|
+
onSelectMetadataField: c,
|
|
14
|
+
selectedMetadataFieldId: l,
|
|
15
|
+
taxonomyNodeFetcher: d,
|
|
16
|
+
templateInstance: e
|
|
17
|
+
}, e.id))
|
|
18
|
+
});
|
|
19
|
+
export { i as t };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MetadataEmptyState as e } from "../esm/lib/components/metadata-empty-state/metadata-empty-state.js";
|
|
2
|
+
import { useAutofill as t } from "../esm/lib/utils/autofill-context.js";
|
|
3
|
+
import { getFieldsNeedingReview as n } from "../esm/lib/utils/confidence-score/get-fields-needing-review.js";
|
|
4
|
+
import { MetadataInstanceReviewNotice as r } from "../esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js";
|
|
5
|
+
import { t as i } from "./metadata-instance-content.js";
|
|
6
|
+
import { t as a } from "./metadata-instance-footer.js";
|
|
7
|
+
import { t as o } from "./metadata-instance-header.js";
|
|
8
|
+
import { Card as s, Divider as c } from "@box/blueprint-web";
|
|
9
|
+
import { useState as l } from "react";
|
|
10
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
+
import '../styles/metadata-instance.css';var p = {
|
|
12
|
+
topDivider: "_topDivider_1xnom_1",
|
|
13
|
+
reviewNotice: "_reviewNotice_1xnom_5",
|
|
14
|
+
bottomDivider: "_bottomDivider_1xnom_9"
|
|
15
|
+
}, m = ({ areAiSuggestionsAvailable: m, isAiSuggestionsFeatureEnabled: h, isBetaLanguageEnabled: g, onEdit: _, onSelectMetadataField: v, selectedMetadataFieldId: y, templateInstance: b, taxonomyNodeFetcher: x, isAdvancedExtractAgentEnabled: S = !1, isConfidenceScoreReviewEnabled: C = !1 }) => {
|
|
16
|
+
let w = b.fields, T = (e) => !e.value || Array.isArray(e.value) && e.value.length === 0, E = w.every(T), D = w.some(T), O = w.length > 0, k = n(w).length, A = C && k > 0, [j, M] = l(!0), { getAiSuggestions: N } = t();
|
|
17
|
+
return /* @__PURE__ */ f(s, { children: [
|
|
18
|
+
/* @__PURE__ */ d(o, {
|
|
19
|
+
areAiSuggestionsAvailable: m,
|
|
20
|
+
canEdit: b.canEdit,
|
|
21
|
+
isAdvancedExtractAgentEnabled: S,
|
|
22
|
+
isAiSuggestionsFeatureEnabled: h,
|
|
23
|
+
isBetaLanguageEnabled: g,
|
|
24
|
+
onAutofill: (e) => {
|
|
25
|
+
_(b), N(b.templateKey, b.scope, e);
|
|
26
|
+
},
|
|
27
|
+
onEdit: () => _(b),
|
|
28
|
+
templateName: b?.displayName
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ d(c, { className: p.topDivider }),
|
|
31
|
+
A && /* @__PURE__ */ d("div", {
|
|
32
|
+
className: p.reviewNotice,
|
|
33
|
+
children: /* @__PURE__ */ d(r, {
|
|
34
|
+
fieldsNeedingReviewCount: k,
|
|
35
|
+
onTextToggleClick: () => {
|
|
36
|
+
_(b, !0);
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
j && E ? /* @__PURE__ */ d(e, {
|
|
41
|
+
isAnyEmptyValueHidden: O,
|
|
42
|
+
isBoxAiSuggestionsFeatureEnabled: h,
|
|
43
|
+
level: "instance",
|
|
44
|
+
onShowEmptyValues: () => M(!1)
|
|
45
|
+
}) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(i, {
|
|
46
|
+
isConfidenceScoreReviewEnabled: C,
|
|
47
|
+
onSelectMetadataField: v,
|
|
48
|
+
selectedMetadataFieldId: y,
|
|
49
|
+
shouldHideEmptyValues: j,
|
|
50
|
+
taxonomyNodeFetcher: x,
|
|
51
|
+
templateInstance: b
|
|
52
|
+
}), D && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(c, { className: p.bottomDivider }), /* @__PURE__ */ d(a, {
|
|
53
|
+
isAnyEmptyValueHidden: j,
|
|
54
|
+
onHideEmptyValues: () => M(!0),
|
|
55
|
+
onShowEmptyValues: () => M(!1)
|
|
56
|
+
})] })] })
|
|
57
|
+
] });
|
|
58
|
+
};
|
|
59
|
+
export { m as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import '../styles/shared-field-styles.css';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
c as s
|
|
1
|
+
import '../styles/shared-field-styles.css';var e = {
|
|
2
|
+
spacious: "_spacious_1325e_1",
|
|
3
|
+
clickableField: "_clickableField_1325e_5",
|
|
4
|
+
selectedField: "_selectedField_1325e_14"
|
|
8
5
|
};
|
|
6
|
+
export { e as t };
|