@box/metadata-editor 2.3.9 → 2.3.11
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/add-metadata-template-dropdown-with-browser.js +1 -34
- package/dist/chunks/ai-suggestion-field.js +1 -100
- package/dist/chunks/autofill-overlay.js +1 -63
- package/dist/chunks/combobox-with-api-pagination.js +1 -161
- package/dist/chunks/custom-instance-new-field.js +1 -60
- package/dist/chunks/custom-instance.js +1 -74
- package/dist/chunks/delete-confirmation-modal.js +1 -76
- package/dist/chunks/field-action-bar.module.js +1 -7
- package/dist/chunks/filter-dropdown-menu.module.js +1 -12
- package/dist/chunks/filter-instances-dropdown.js +1 -84
- package/dist/chunks/interactive-header-text.js +1 -19
- package/dist/chunks/interactive-text.module.js +1 -5
- package/dist/chunks/metadata-editor.js +1 -9
- package/dist/chunks/metadata-instance-content.js +1 -43
- package/dist/chunks/metadata-instance-entry.js +1 -104
- package/dist/chunks/metadata-instance-footer.js +1 -25
- package/dist/chunks/metadata-instance-form-ai-disclaimer.js +1 -28
- package/dist/chunks/metadata-instance-form-autofill-button.js +1 -113
- package/dist/chunks/metadata-instance-form-card-wrapper.js +1 -54
- package/dist/chunks/metadata-instance-form-footer.js +1 -43
- package/dist/chunks/metadata-instance-form-header.js +1 -45
- package/dist/chunks/metadata-instance-header.js +1 -52
- package/dist/chunks/metadata-instance-list.js +1 -20
- package/dist/chunks/metadata-instance.js +1 -60
- package/dist/chunks/shared-field-styles.module.js +1 -6
- package/dist/chunks/taxonomy-ancestor-status-pill.js +1 -90
- package/dist/chunks/types.js +1 -8
- package/dist/chunks/update-mode-field-wrapper.js +1 -80
- package/dist/chunks/utils.js +1 -88
- package/dist/chunks/utils2.js +1 -53
- package/dist/esm/index.js +1 -25
- package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown-with-browser.js +1 -2
- package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +1 -24
- package/dist/esm/lib/components/add-metadata-template-dropdown/index.js +1 -3
- package/dist/esm/lib/components/add-metadata-template-dropdown/messages.js +1 -20
- package/dist/esm/lib/components/add-metadata-template-dropdown/shared/dropdown-trigger.js +1 -16
- package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +1 -2
- package/dist/esm/lib/components/combobox-with-api-pagination/index.js +1 -2
- package/dist/esm/lib/components/combobox-with-api-pagination/messages.js +1 -32
- package/dist/esm/lib/components/combobox-with-api-pagination/request.js +1 -4
- package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +1 -118
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/is-abort-error.js +1 -11
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +1 -35
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +1 -75
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-content.js +1 -14
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +1 -17
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-item.js +1 -15
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.js +1 -17
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-root.js +1 -14
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +1 -37
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-trigger.js +1 -8
- package/dist/esm/lib/components/filter-dropdown-menu/index.js +1 -17
- package/dist/esm/lib/components/filter-dropdown-menu/messages.js +1 -12
- package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +1 -2
- package/dist/esm/lib/components/filter-instances-dropdown/index.js +1 -2
- package/dist/esm/lib/components/filter-instances-dropdown/messages.js +1 -20
- package/dist/esm/lib/components/interactive-header-text/interactive-header-text.js +1 -2
- package/dist/esm/lib/components/interactive-text/interactive-text.js +1 -18
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +1 -36
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/index.js +1 -2
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +1 -2
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/index.js +1 -2
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +1 -52
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js +1 -13
- package/dist/esm/lib/components/metadata-editor-fields/components/constants.js +1 -2
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/index.js +1 -2
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +1 -24
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/index.js +1 -2
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +1 -68
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/messages.js +1 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +1 -44
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +1 -48
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +1 -34
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +1 -9
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +1 -41
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +1 -29
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/legacy-metadata-taxonomy-field.js +1 -67
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +1 -16
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-picker-field/metadata-taxonomy-picker-field.js +1 -53
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-picker-field/value-mapping.js +1 -30
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js +1 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js +1 -8
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +1 -2
- package/dist/esm/lib/components/metadata-editor-fields/editor-field-types.js +1 -32
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-memoized-field-label.js +1 -12
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-review-field-filter.js +1 -36
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-view-reference-tooltip.js +1 -41
- package/dist/esm/lib/components/metadata-editor-fields/messages.js +1 -12
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +1 -189
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +1 -31
- package/dist/esm/lib/components/metadata-editor-fields/utils.js +1 -2
- package/dist/esm/lib/components/metadata-empty-state/messages.js +1 -44
- package/dist/esm/lib/components/metadata-empty-state/metadata-empty-state.js +1 -47
- package/dist/esm/lib/components/metadata-instance-editor/index.js +1 -9
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +1 -40
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/useErrorMessaging.js +1 -23
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js +1 -16
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js +1 -44
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js +1 -52
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/constants.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +1 -136
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-ai-disclaimer/metadata-instance-form-ai-disclaimer.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +1 -24
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js +1 -20
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +1 -6
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +1 -2
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +1 -20
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +1 -31
- package/dist/esm/lib/components/metadata-instance-list/index.js +1 -6
- package/dist/esm/lib/components/metadata-instance-list/metadata-instance-list.js +1 -2
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +1 -2
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +1 -2
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js +1 -6
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js +1 -15
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +1 -2
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js +1 -24
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.js +1 -2
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.js +1 -25
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js +1 -12
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +1 -2
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +1 -16
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +1 -2
- package/dist/esm/lib/components/metadata-instance-review-notice/messages.js +1 -32
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +1 -24
- package/dist/esm/lib/components/unsaved-changes-modal/index.js +1 -2
- package/dist/esm/lib/components/unsaved-changes-modal/messages.js +1 -24
- package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +1 -45
- package/dist/esm/lib/components/unsaved-changes-modal/utils.js +1 -4
- package/dist/esm/lib/constants.js +1 -15
- package/dist/esm/lib/defaults.js +1 -16
- package/dist/esm/lib/mappers.js +1 -23
- package/dist/esm/lib/messages.js +1 -129
- package/dist/esm/lib/metadata-editor.js +1 -2
- package/dist/esm/lib/utils/analytics/analytics-context.js +1 -11
- package/dist/esm/lib/utils/analytics/events.js +1 -9
- package/dist/esm/lib/utils/analytics/index.js +1 -4
- package/dist/esm/lib/utils/analytics/with-analytics.js +1 -11
- package/dist/esm/lib/utils/api-wrapper.js +1 -13
- package/dist/esm/lib/utils/autofill-context.js +1 -66
- package/dist/esm/lib/utils/check-if-has-bounding-boxes.js +1 -2
- package/dist/esm/lib/utils/confidence-score/format-confidence-score-percent.js +1 -4
- package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +1 -13
- package/dist/esm/lib/utils/confidence-score/get-fields-needing-review.js +1 -6
- package/dist/esm/lib/utils/confidence-score/index.js +1 -5
- package/dist/esm/lib/utils/confidence-score/is-confidence-score-needing-review.js +1 -5
- package/dist/esm/lib/utils/confidence-score/messages.js +1 -16
- package/dist/esm/lib/utils/convertDate.js +1 -24
- package/dist/esm/lib/utils/is-interactive-form-element.js +1 -2
- package/dist/esm/lib/utils/utils.js +1 -4
- package/dist/styles/metadata-instance-footer.css +1 -1
- package/package.json +13 -13
|
@@ -1,84 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import n from "../esm/lib/components/filter-instances-dropdown/messages.js";
|
|
3
|
-
import { useEffect as r } from "react";
|
|
4
|
-
import { useIntl as i } from "react-intl";
|
|
5
|
-
import { Select as a, SelectItem as o, SelectItemCheck as s, SelectPopover as c, SelectProvider as l } from "@ariakit/react";
|
|
6
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
-
import f from "clsx";
|
|
8
|
-
import { Divider as p, ScrollableContainer as m, Text as h, TriggerButton as g } from "@box/blueprint-web";
|
|
9
|
-
import { Checkmark as _ } from "@box/blueprint-web-assets/icons/Fill";
|
|
10
|
-
import { Space1 as v } from "@box/blueprint-web-assets/tokens/px-tokens";
|
|
11
|
-
import '../styles/filter-instances-dropdown.css';var y = {
|
|
12
|
-
details: "_details_1wstu_27",
|
|
13
|
-
triggerContainer: "_triggerContainer_1wstu_31",
|
|
14
|
-
triggerButton: "_triggerButton_1wstu_36",
|
|
15
|
-
popover: "_popover_1wstu_42",
|
|
16
|
-
divider: "_divider_1wstu_71",
|
|
17
|
-
scrollableContainer: "_scrollableContainer_1wstu_74",
|
|
18
|
-
item: "_item_1wstu_78",
|
|
19
|
-
indicator: "_indicator_1wstu_105",
|
|
20
|
-
indicatorIcon: "_indicatorIcon_1wstu_114",
|
|
21
|
-
testContainer: "_testContainer_1wstu_118"
|
|
22
|
-
}, b = parseInt(v, 10);
|
|
23
|
-
function x({ appliedTemplates: v, selectedTemplates: x, setSelectedTemplates: S }) {
|
|
24
|
-
let C = i(), w = C.formatMessage(n.customMetadataName), T = t(v), E = x.length, D = T.length, O = E === 0 ? C.formatMessage(n.allTemplatesTriggerButtonText) : C.formatMessage(n.selectedTemplatesTriggerButtonText, {
|
|
25
|
-
selectedTemplatesNumber: E,
|
|
26
|
-
visibleTemplatesNumber: D
|
|
27
|
-
});
|
|
28
|
-
return r(() => {
|
|
29
|
-
E === D && S([]);
|
|
30
|
-
}, [E, D]), /* @__PURE__ */ d(l, {
|
|
31
|
-
setValue: S,
|
|
32
|
-
value: x,
|
|
33
|
-
children: [/* @__PURE__ */ d("div", {
|
|
34
|
-
className: y.triggerContainer,
|
|
35
|
-
children: [/* @__PURE__ */ u(a, { render: /* @__PURE__ */ u(g, {
|
|
36
|
-
caretDirection: "down",
|
|
37
|
-
className: y.triggerButton,
|
|
38
|
-
label: O,
|
|
39
|
-
size: "small",
|
|
40
|
-
variant: "tertiary",
|
|
41
|
-
"data-target-id": "TriggerButton-allTemplatesTriggerButtonText|selectedTemplatesTriggerButtonText"
|
|
42
|
-
}) }), T.length > 0 && /* @__PURE__ */ u(h, {
|
|
43
|
-
as: "p",
|
|
44
|
-
className: y.details,
|
|
45
|
-
color: "textOnLightSecondary",
|
|
46
|
-
"data-testid": "detailsList",
|
|
47
|
-
variant: "caption",
|
|
48
|
-
children: T.filter((e) => x.some((t) => t === e.id)).map((t) => e(t, w)).join(", ")
|
|
49
|
-
})]
|
|
50
|
-
}), /* @__PURE__ */ u(c, {
|
|
51
|
-
className: y.popover,
|
|
52
|
-
gutter: b,
|
|
53
|
-
children: /* @__PURE__ */ d(m, {
|
|
54
|
-
className: y.scrollableContainer,
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ d(o, {
|
|
57
|
-
autoFocus: E === 0,
|
|
58
|
-
className: y.item,
|
|
59
|
-
hideOnClick: !0,
|
|
60
|
-
onClick: () => {
|
|
61
|
-
S([]);
|
|
62
|
-
},
|
|
63
|
-
children: [E === 0 && /* @__PURE__ */ u(_, { className: f(y.indicator, y.indicatorIcon) }), C.formatMessage(n.allTemplatesTriggerButtonText)]
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ u(p, { className: y.divider }),
|
|
66
|
-
T.map((t) => /* @__PURE__ */ d(o, {
|
|
67
|
-
className: y.item,
|
|
68
|
-
hideOnClick: !0,
|
|
69
|
-
value: t.id,
|
|
70
|
-
children: [/* @__PURE__ */ u(s, {
|
|
71
|
-
className: y.indicator,
|
|
72
|
-
style: {
|
|
73
|
-
width: "none",
|
|
74
|
-
height: "none"
|
|
75
|
-
},
|
|
76
|
-
children: /* @__PURE__ */ u(_, { className: y.indicatorIcon })
|
|
77
|
-
}), e(t, w)]
|
|
78
|
-
}, t.id))
|
|
79
|
-
]
|
|
80
|
-
})
|
|
81
|
-
})]
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
export { x as t };
|
|
1
|
+
import{getTemplateDisplayName,getVisibleTemplates}from"../esm/lib/utils/utils.js";import messages from"../esm/lib/components/filter-instances-dropdown/messages.js";import{useEffect}from"react";import{useIntl}from"react-intl";import{Select,SelectItem,SelectItemCheck,SelectPopover,SelectProvider}from"@ariakit/react";import{jsx,jsxs}from"react/jsx-runtime";import clsx from"clsx";import{Divider,ScrollableContainer,Text,TriggerButton}from"@box/blueprint-web";import{Checkmark}from"@box/blueprint-web-assets/icons/Fill";import{Space1}from"@box/blueprint-web-assets/tokens/px-tokens";import '../styles/filter-instances-dropdown.css';var filter_instances_dropdown_module_default={details:`_details_1wstu_27`,triggerContainer:`_triggerContainer_1wstu_31`,triggerButton:`_triggerButton_1wstu_36`,popover:`_popover_1wstu_42`,divider:`_divider_1wstu_71`,scrollableContainer:`_scrollableContainer_1wstu_74`,item:`_item_1wstu_78`,indicator:`_indicator_1wstu_105`,indicatorIcon:`_indicatorIcon_1wstu_114`,testContainer:`_testContainer_1wstu_118`},selectPopoverGutter=parseInt(Space1,10);function FilterInstancesDropdown({appliedTemplates,selectedTemplates,setSelectedTemplates}){let intl=useIntl(),customMetadataName=intl.formatMessage(messages.customMetadataName),visibleTemplates=getVisibleTemplates(appliedTemplates),selectedTemplatesNumber=selectedTemplates.length,visibleTemplatesNumber=visibleTemplates.length,triggerButtonText=selectedTemplatesNumber===0?intl.formatMessage(messages.allTemplatesTriggerButtonText):intl.formatMessage(messages.selectedTemplatesTriggerButtonText,{selectedTemplatesNumber,visibleTemplatesNumber});return useEffect(()=>{selectedTemplatesNumber===visibleTemplatesNumber&&setSelectedTemplates([])},[selectedTemplatesNumber,visibleTemplatesNumber]),jsxs(SelectProvider,{setValue:setSelectedTemplates,value:selectedTemplates,children:[jsxs(`div`,{className:filter_instances_dropdown_module_default.triggerContainer,children:[jsx(Select,{render:jsx(TriggerButton,{caretDirection:`down`,className:filter_instances_dropdown_module_default.triggerButton,label:triggerButtonText,size:`small`,variant:`tertiary`,"data-target-id":`TriggerButton-allTemplatesTriggerButtonText|selectedTemplatesTriggerButtonText`})}),visibleTemplates.length>0&&jsx(Text,{as:`p`,className:filter_instances_dropdown_module_default.details,color:`textOnLightSecondary`,"data-testid":`detailsList`,variant:`caption`,children:visibleTemplates.filter(visibleTemplate=>selectedTemplates.some(selectedTemplate=>selectedTemplate===visibleTemplate.id)).map(visibleTemplate=>getTemplateDisplayName(visibleTemplate,customMetadataName)).join(`, `)})]}),jsx(SelectPopover,{className:filter_instances_dropdown_module_default.popover,gutter:selectPopoverGutter,children:jsxs(ScrollableContainer,{className:filter_instances_dropdown_module_default.scrollableContainer,children:[jsxs(SelectItem,{autoFocus:selectedTemplatesNumber===0,className:filter_instances_dropdown_module_default.item,hideOnClick:!0,onClick:()=>{setSelectedTemplates([])},children:[selectedTemplatesNumber===0&&jsx(Checkmark,{className:clsx(filter_instances_dropdown_module_default.indicator,filter_instances_dropdown_module_default.indicatorIcon)}),intl.formatMessage(messages.allTemplatesTriggerButtonText)]}),jsx(Divider,{className:filter_instances_dropdown_module_default.divider}),visibleTemplates.map(template=>jsxs(SelectItem,{className:filter_instances_dropdown_module_default.item,hideOnClick:!0,value:template.id,children:[jsx(SelectItemCheck,{className:filter_instances_dropdown_module_default.indicator,style:{width:`none`,height:`none`},children:jsx(Checkmark,{className:filter_instances_dropdown_module_default.indicatorIcon})}),getTemplateDisplayName(template,customMetadataName)]},template.id))]})})]})}export{FilterInstancesDropdown as t};
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
import { useRef
|
|
2
|
-
import { Focusable as t } from "@ariakit/react";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import r from "clsx";
|
|
5
|
-
import { Text as i, Tooltip as a, useIsEllipsized as o } from "@box/blueprint-web";
|
|
6
|
-
import '../styles/interactive-header-text.css';var s = { header: "_header_qqeyd_1" }, c = ({ className: c, title: l }) => {
|
|
7
|
-
let u = e(null), d = o(u), f = /* @__PURE__ */ n(t, { render: /* @__PURE__ */ n(i, {
|
|
8
|
-
ref: u,
|
|
9
|
-
as: "h4",
|
|
10
|
-
className: r(s.header, c),
|
|
11
|
-
variant: "titleMedium",
|
|
12
|
-
children: l
|
|
13
|
-
}) });
|
|
14
|
-
return d ? /* @__PURE__ */ n(a, {
|
|
15
|
-
content: l,
|
|
16
|
-
children: f
|
|
17
|
-
}) : f;
|
|
18
|
-
};
|
|
19
|
-
export { c as t };
|
|
1
|
+
import{useRef}from"react";import{Focusable}from"@ariakit/react";import{jsx}from"react/jsx-runtime";import clsx from"clsx";import{Text,Tooltip,useIsEllipsized}from"@box/blueprint-web";import '../styles/interactive-header-text.css';var interactive_header_text_module_default={header:`_header_qqeyd_1`},InteractiveHeaderText=({className,title})=>{let titleRef=useRef(null),isEllipsized=useIsEllipsized(titleRef),text=jsx(Focusable,{render:jsx(Text,{ref:titleRef,as:`h4`,className:clsx(interactive_header_text_module_default.header,className),variant:`titleMedium`,children:title})});return isEllipsized?jsx(Tooltip,{content:title,children:text}):text};export{InteractiveHeaderText as t};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import '../styles/interactive-text.css';var
|
|
2
|
-
interactiveText: "_interactiveText_1szjz_1",
|
|
3
|
-
interactiveTextHint: "_interactiveTextHint_1szjz_6"
|
|
4
|
-
};
|
|
5
|
-
export { e as t };
|
|
1
|
+
import '../styles/interactive-text.css';var interactive_text_module_default={interactiveText:`_interactiveText_1szjz_1`,interactiveTextHint:`_interactiveTextHint_1szjz_6`};export{interactive_text_module_default as t};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
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 };
|
|
1
|
+
import{jsx}from"react/jsx-runtime";import '../styles/metadata-editor.css';var metadata_editor_module_default={};function MetadataEditor(props){return jsx(`div`,{className:metadata_editor_module_default.container,children:jsx(`h1`,{children:`Welcome to MetadataEditor!`})})}export{MetadataEditor as t};
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useMemo as t } from "react";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import r from "clsx";
|
|
5
|
-
import '../styles/metadata-instance-content.css';var i = {
|
|
6
|
-
metadataInstanceContent: "_metadataInstanceContent_1cb0f_1",
|
|
7
|
-
metadataInstanceContentReducedGap: "_metadataInstanceContentReducedGap_1cb0f_7"
|
|
8
|
-
}, a = ({ onSelectMetadataField: a, selectedMetadataFieldId: o, shouldHideEmptyValues: s, templateInstance: c, taxonomyNodeFetcher: l, isConfidenceScoreReviewEnabled: u, isBoundingBoxEnabled: d }) => {
|
|
9
|
-
let { fields: f = [] } = c, p = d || u, m = t(() => f.filter((e) => !e.hidden).map((t) => {
|
|
10
|
-
let r = a ? () => a(t) : void 0;
|
|
11
|
-
return /* @__PURE__ */ n(e, {
|
|
12
|
-
confidenceScore: t.confidenceScore,
|
|
13
|
-
description: t.description,
|
|
14
|
-
isConfidenceScoreReviewEnabled: u,
|
|
15
|
-
isBoundingBoxEnabled: d,
|
|
16
|
-
isExternallyOwned: c.isExternallyOwned,
|
|
17
|
-
isSelected: o === t.id,
|
|
18
|
-
name: t.displayName || t.key,
|
|
19
|
-
onClick: r,
|
|
20
|
-
scope: t.namespace,
|
|
21
|
-
shouldHideEmptyValues: s,
|
|
22
|
-
taxonomyKey: t.taxonomyKey,
|
|
23
|
-
taxonomyNodeFetcher: l,
|
|
24
|
-
type: t.type,
|
|
25
|
-
value: t.value,
|
|
26
|
-
targetLocation: t.targetLocation
|
|
27
|
-
}, t.id);
|
|
28
|
-
}), [
|
|
29
|
-
f,
|
|
30
|
-
u,
|
|
31
|
-
d,
|
|
32
|
-
a,
|
|
33
|
-
o,
|
|
34
|
-
s,
|
|
35
|
-
l,
|
|
36
|
-
c.isExternallyOwned
|
|
37
|
-
]);
|
|
38
|
-
return /* @__PURE__ */ n("div", {
|
|
39
|
-
className: r(i.metadataInstanceContent, p && i.metadataInstanceContentReducedGap),
|
|
40
|
-
children: m
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
export { a as t };
|
|
1
|
+
import{t as MetadataInstanceEntry}from"./metadata-instance-entry.js";import{useMemo}from"react";import{jsx}from"react/jsx-runtime";import clsx from"clsx";import '../styles/metadata-instance-content.css';var metadata_instance_content_module_default={metadataInstanceContent:`_metadataInstanceContent_1cb0f_1`,metadataInstanceContentReducedGap:`_metadataInstanceContentReducedGap_1cb0f_7`},MetadataInstanceContent=({onSelectMetadataField,selectedMetadataFieldId,shouldHideEmptyValues,templateInstance,taxonomyNodeFetcher,isConfidenceScoreReviewEnabled,isBoundingBoxEnabled})=>{let{fields=[]}=templateInstance,isBoundingBoxOrConfidenceScoreReviewEnabled=isBoundingBoxEnabled||isConfidenceScoreReviewEnabled,content=useMemo(()=>fields.filter(field=>!field.hidden).map(field=>{let handleClick=onSelectMetadataField?()=>onSelectMetadataField(field):void 0;return jsx(MetadataInstanceEntry,{confidenceScore:field.confidenceScore,description:field.description,isConfidenceScoreReviewEnabled,isBoundingBoxEnabled,isExternallyOwned:templateInstance.isExternallyOwned,isSelected:selectedMetadataFieldId===field.id,name:field.displayName||field.key,onClick:handleClick,scope:field.namespace,shouldHideEmptyValues,taxonomyKey:field.taxonomyKey,taxonomyNodeFetcher,type:field.type,value:field.value,targetLocation:field.targetLocation},field.id)}),[fields,isConfidenceScoreReviewEnabled,isBoundingBoxEnabled,onSelectMetadataField,selectedMetadataFieldId,shouldHideEmptyValues,taxonomyNodeFetcher,templateInstance.isExternallyOwned]);return jsx(`div`,{className:clsx(metadata_instance_content_module_default.metadataInstanceContent,isBoundingBoxOrConfidenceScoreReviewEnabled&&metadata_instance_content_module_default.metadataInstanceContentReducedGap),children:content})};export{MetadataInstanceContent as t};
|
|
@@ -1,104 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EVENT_NAMES as t } from "../esm/lib/utils/analytics/events.js";
|
|
3
|
-
import { useMetadataEditorAnalytics as n } from "../esm/lib/utils/analytics/analytics-context.js";
|
|
4
|
-
import { checkIfHasBoundingBoxes as r } from "../esm/lib/utils/check-if-has-bounding-boxes.js";
|
|
5
|
-
import { getConfidenceScoreTooltip as i } from "../esm/lib/utils/confidence-score/get-confidence-score-tooltip.js";
|
|
6
|
-
import { isConfidenceScoreNeedingReview as a } from "../esm/lib/utils/confidence-score/is-confidence-score-needing-review.js";
|
|
7
|
-
import { t as o } from "./shared-field-styles.module.js";
|
|
8
|
-
import { convertISOStringToUTCDate as s } from "../esm/lib/utils/convertDate.js";
|
|
9
|
-
import { t as c } from "./interactive-text.module.js";
|
|
10
|
-
import l from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";
|
|
11
|
-
import { MetadataEntryDisplay as u } from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";
|
|
12
|
-
import { useRef as d } from "react";
|
|
13
|
-
import { FormattedDate as f, useIntl as ee } from "react-intl";
|
|
14
|
-
import { Focusable as p } from "@ariakit/react";
|
|
15
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
16
|
-
import g from "clsx";
|
|
17
|
-
import { Status as _, Text as v, Tooltip as y, useIsEllipsized as b } from "@box/blueprint-web";
|
|
18
|
-
import { AlertCircle as x } from "@box/blueprint-web-assets/icons/Medium";
|
|
19
|
-
import '../styles/metadata-instance-entry.css';var S = {
|
|
20
|
-
metadataInstanceEntry: "_metadataInstanceEntry_1ygbk_1",
|
|
21
|
-
name: "_name_1ygbk_6",
|
|
22
|
-
nameText: "_nameText_1ygbk_13",
|
|
23
|
-
labelContainer: "_labelContainer_1ygbk_21",
|
|
24
|
-
nameLabel: "_nameLabel_1ygbk_28",
|
|
25
|
-
confidenceScoreIcon: "_confidenceScoreIcon_1ygbk_43"
|
|
26
|
-
}, C = ({ description: C, isSelected: w, name: T, onClick: E, shouldHideEmptyValues: D, type: O, value: k, taxonomyNodeFetcher: A, taxonomyKey: j, scope: M, isExternallyOwned: N, confidenceScore: P, isConfidenceScoreReviewEnabled: F = !1, isBoundingBoxEnabled: I = !1, targetLocation: L }) => {
|
|
27
|
-
let R = ee(), { trackEvent: z } = n(), B = d(null), V = b(B), H = (e) => {
|
|
28
|
-
B.current = e instanceof HTMLElement ? e : null;
|
|
29
|
-
}, U = I || F, W = F && !!P && a(P), G = r(L), K = U && G && !!E, q = W ? i(R.formatMessage, P) : null, J = () => z(t.LOW_CONF_ICON_HOVER_READ_MODE, {
|
|
30
|
-
fieldType: O,
|
|
31
|
-
confidenceLevel: P?.level,
|
|
32
|
-
scope: M
|
|
33
|
-
}), Y = typeof k == "number" ? k.toString() : k ? Array.isArray(k) ? k.join(", ") : O === "date" && typeof k == "string" ? /* @__PURE__ */ m(f, {
|
|
34
|
-
day: "numeric",
|
|
35
|
-
month: "long",
|
|
36
|
-
value: s(k),
|
|
37
|
-
year: "numeric"
|
|
38
|
-
}) : k : null, X = {
|
|
39
|
-
"data-metadata-field": !0,
|
|
40
|
-
"data-target-id": "Button-metadataEditorFieldReadClick",
|
|
41
|
-
"data-testid": "metadata-field",
|
|
42
|
-
onClick: E,
|
|
43
|
-
onKeyDown: (e) => {
|
|
44
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), E?.());
|
|
45
|
-
},
|
|
46
|
-
role: "button",
|
|
47
|
-
tabIndex: 0
|
|
48
|
-
};
|
|
49
|
-
if (D && !Y) return null;
|
|
50
|
-
let Z = (() => {
|
|
51
|
-
if (C) return V ? /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", { children: T }), /* @__PURE__ */ m("div", { children: C })] }) : C;
|
|
52
|
-
if (V) return T;
|
|
53
|
-
})(), Q = /* @__PURE__ */ m("h5", {
|
|
54
|
-
className: S.name,
|
|
55
|
-
children: /* @__PURE__ */ m(v, {
|
|
56
|
-
ref: H,
|
|
57
|
-
as: "span",
|
|
58
|
-
className: g(S.nameText, C && c.interactiveTextHint),
|
|
59
|
-
color: "textOnLightSecondary",
|
|
60
|
-
variant: "bodyDefaultBold",
|
|
61
|
-
children: T
|
|
62
|
-
})
|
|
63
|
-
}), $ = /* @__PURE__ */ h("div", {
|
|
64
|
-
className: g(S.metadataInstanceEntry, U && o.spacious, K && o.clickableField, K && w && o.selectedField),
|
|
65
|
-
...K && X,
|
|
66
|
-
children: [/* @__PURE__ */ h("div", {
|
|
67
|
-
className: S.labelContainer,
|
|
68
|
-
children: [q && /* @__PURE__ */ m(y, {
|
|
69
|
-
content: q,
|
|
70
|
-
children: /* @__PURE__ */ m("span", {
|
|
71
|
-
className: S.confidenceScoreIcon,
|
|
72
|
-
children: /* @__PURE__ */ m(_, {
|
|
73
|
-
"data-target-id": "Status-metadataInstanceEntryConfidenceScoreIcon",
|
|
74
|
-
color: "SurfaceStatusSurfaceGray",
|
|
75
|
-
hideText: !0,
|
|
76
|
-
icon: x,
|
|
77
|
-
interactive: !0,
|
|
78
|
-
text: R.formatMessage(l.confidenceScoreIconAriaLabel),
|
|
79
|
-
onMouseEnter: J
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
}), /* @__PURE__ */ m("div", {
|
|
83
|
-
className: S.nameLabel,
|
|
84
|
-
children: Z ? /* @__PURE__ */ m(y, {
|
|
85
|
-
content: Z,
|
|
86
|
-
children: /* @__PURE__ */ m(p, { render: Q })
|
|
87
|
-
}) : Q
|
|
88
|
-
})]
|
|
89
|
-
}), /* @__PURE__ */ m(u, {
|
|
90
|
-
formattedValue: Y,
|
|
91
|
-
isExternallyOwned: N,
|
|
92
|
-
scope: M,
|
|
93
|
-
taxonomyKey: j,
|
|
94
|
-
taxonomyNodeFetcher: A,
|
|
95
|
-
type: O,
|
|
96
|
-
value: k
|
|
97
|
-
})]
|
|
98
|
-
});
|
|
99
|
-
return K ? /* @__PURE__ */ m(y, {
|
|
100
|
-
content: R.formatMessage(e.viewOnDocument),
|
|
101
|
-
children: $
|
|
102
|
-
}) : $;
|
|
103
|
-
};
|
|
104
|
-
export { C as t };
|
|
1
|
+
import messages from"../esm/lib/messages.js";import{EVENT_NAMES}from"../esm/lib/utils/analytics/events.js";import{useMetadataEditorAnalytics}from"../esm/lib/utils/analytics/analytics-context.js";import{checkIfHasBoundingBoxes}from"../esm/lib/utils/check-if-has-bounding-boxes.js";import{getConfidenceScoreTooltip}from"../esm/lib/utils/confidence-score/get-confidence-score-tooltip.js";import{isConfidenceScoreNeedingReview}from"../esm/lib/utils/confidence-score/is-confidence-score-needing-review.js";import{t as shared_field_styles_module_default}from"./shared-field-styles.module.js";import{convertISOStringToUTCDate}from"../esm/lib/utils/convertDate.js";import{t as interactive_text_module_default}from"./interactive-text.module.js";import messages$1 from"../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js";import{MetadataEntryDisplay}from"../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js";import{useRef}from"react";import{FormattedDate,useIntl}from"react-intl";import{Focusable}from"@ariakit/react";import{jsx,jsxs}from"react/jsx-runtime";import clsx from"clsx";import{Status,Text,Tooltip,useIsEllipsized}from"@box/blueprint-web";import{AlertCircle}from"@box/blueprint-web-assets/icons/Medium";import '../styles/metadata-instance-entry.css';var metadata_instance_entry_module_default={metadataInstanceEntry:`_metadataInstanceEntry_1ygbk_1`,name:`_name_1ygbk_6`,nameText:`_nameText_1ygbk_13`,labelContainer:`_labelContainer_1ygbk_21`,nameLabel:`_nameLabel_1ygbk_28`,confidenceScoreIcon:`_confidenceScoreIcon_1ygbk_43`},MetadataInstanceEntry=({description,isSelected,name,onClick,shouldHideEmptyValues,type,value,taxonomyNodeFetcher,taxonomyKey,scope,isExternallyOwned,confidenceScore,isConfidenceScoreReviewEnabled=!1,isBoundingBoxEnabled=!1,targetLocation})=>{let intl=useIntl(),{trackEvent}=useMetadataEditorAnalytics(),nameEllipsisRef=useRef(null),isNameEllipsized=useIsEllipsized(nameEllipsisRef),nameTextRef=node=>{nameEllipsisRef.current=node instanceof HTMLElement?node:null},isBoundingBoxOrConfidenceScoreReviewEnabled=isBoundingBoxEnabled||isConfidenceScoreReviewEnabled,isLowConfidenceScore=isConfidenceScoreReviewEnabled&&!!confidenceScore&&isConfidenceScoreNeedingReview(confidenceScore),hasBoundingBoxes=checkIfHasBoundingBoxes(targetLocation),isClickable=isBoundingBoxOrConfidenceScoreReviewEnabled&&hasBoundingBoxes&&!!onClick,confidenceScoreTooltipText=isLowConfidenceScore?getConfidenceScoreTooltip(intl.formatMessage,confidenceScore):null,handleLowConfIconHover=()=>trackEvent(EVENT_NAMES.LOW_CONF_ICON_HOVER_READ_MODE,{fieldType:type,confidenceLevel:confidenceScore?.level,scope}),formattedValue=typeof value==`number`?value.toString():value?Array.isArray(value)?value.join(`, `):type===`date`&&typeof value==`string`?jsx(FormattedDate,{day:`numeric`,month:`long`,value:convertISOStringToUTCDate(value),year:`numeric`}):value:null,clickableFieldProps={"data-metadata-field":!0,"data-target-id":`Button-metadataEditorFieldReadClick`,"data-testid":`metadata-field`,onClick,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),onClick?.())},role:`button`,tabIndex:0};if(shouldHideEmptyValues&&!formattedValue)return null;let nameTooltipContent=(()=>{if(description)return isNameEllipsized?jsxs(`div`,{children:[jsx(`div`,{children:name}),jsx(`div`,{children:description})]}):description;if(isNameEllipsized)return name})(),nameText=jsx(`h5`,{className:metadata_instance_entry_module_default.name,children:jsx(Text,{ref:nameTextRef,as:`span`,className:clsx(metadata_instance_entry_module_default.nameText,description&&interactive_text_module_default.interactiveTextHint),color:`textOnLightSecondary`,variant:`bodyDefaultBold`,children:name})}),content=jsxs(`div`,{className:clsx(metadata_instance_entry_module_default.metadataInstanceEntry,isBoundingBoxOrConfidenceScoreReviewEnabled&&shared_field_styles_module_default.spacious,isClickable&&shared_field_styles_module_default.clickableField,isClickable&&isSelected&&shared_field_styles_module_default.selectedField),...isClickable&&clickableFieldProps,children:[jsxs(`div`,{className:metadata_instance_entry_module_default.labelContainer,children:[confidenceScoreTooltipText&&jsx(Tooltip,{content:confidenceScoreTooltipText,children:jsx(`span`,{className:metadata_instance_entry_module_default.confidenceScoreIcon,children:jsx(Status,{"data-target-id":`Status-metadataInstanceEntryConfidenceScoreIcon`,color:`SurfaceStatusSurfaceGray`,hideText:!0,icon:AlertCircle,interactive:!0,text:intl.formatMessage(messages$1.confidenceScoreIconAriaLabel),onMouseEnter:handleLowConfIconHover})})}),jsx(`div`,{className:metadata_instance_entry_module_default.nameLabel,children:nameTooltipContent?jsx(Tooltip,{content:nameTooltipContent,children:jsx(Focusable,{render:nameText})}):nameText})]}),jsx(MetadataEntryDisplay,{formattedValue,isExternallyOwned,scope,taxonomyKey,taxonomyNodeFetcher,type,value})]});return isClickable?jsx(Tooltip,{content:intl.formatMessage(messages.viewOnDocument),children:content}):content};export{MetadataInstanceEntry as t};
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useIntl as t } from "react-intl";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import { TextButton as r } from "@box/blueprint-web";
|
|
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 = t();
|
|
10
|
-
return /* @__PURE__ */ n("div", {
|
|
11
|
-
className: i.metadataInstanceFooter,
|
|
12
|
-
children: a ? /* @__PURE__ */ n(r, {
|
|
13
|
-
className: i.button,
|
|
14
|
-
onClick: s,
|
|
15
|
-
"data-target-id": "TextButton-showEmptyValuesCTA",
|
|
16
|
-
children: c.formatMessage(e.showEmptyValuesCTA)
|
|
17
|
-
}) : /* @__PURE__ */ n(r, {
|
|
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 };
|
|
1
|
+
import messages from"../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js";import{useIntl}from"react-intl";import{jsx}from"react/jsx-runtime";import{TextButton}from"@box/blueprint-web";import '../styles/metadata-instance-footer.css';var metadata_instance_footer_module_default={metadataInstanceFooter:`_metadataInstanceFooter_wyn6t_1`,button:`_button_wyn6t_5`},MetadataInstanceFooter=({isAnyEmptyValueHidden,onHideEmptyValues,onShowEmptyValues})=>{let{formatMessage}=useIntl();return jsx(`div`,{className:metadata_instance_footer_module_default.metadataInstanceFooter,children:isAnyEmptyValueHidden?jsx(TextButton,{className:metadata_instance_footer_module_default.button,color:`textOnLightSecondary`,onClick:onShowEmptyValues,variant:`bodyDefault`,"data-target-id":`TextButton-showEmptyValuesCTA`,children:formatMessage(messages.showEmptyValuesCTA)}):jsx(TextButton,{className:metadata_instance_footer_module_default.button,color:`textOnLightSecondary`,onClick:onHideEmptyValues,variant:`bodyDefault`,"data-target-id":`TextButton-hideEmptyValuesCTA`,children:formatMessage(messages.hideEmptyValuesCTA)})})};export{MetadataInstanceFooter as t};
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useMemo as t } from "react";
|
|
3
|
-
import { useIntl as n } from "react-intl";
|
|
4
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
import { Text as a } from "@box/blueprint-web";
|
|
6
|
-
import { bpTextTextOnLightSecondary as o } from "@box/blueprint-web-assets/tokens/tokens";
|
|
7
|
-
import { InfoBadge as s } from "@box/blueprint-web-assets/icons/Line";
|
|
8
|
-
import '../styles/metadata-instance-form-ai-disclaimer.css';var c = {
|
|
9
|
-
aiDisclaimer: "_aiDisclaimer_6i2mf_1",
|
|
10
|
-
infoBadgeIcon: "_infoBadgeIcon_6i2mf_7"
|
|
11
|
-
}, l = (e) => e.some((e) => !!e.confidenceScore || !!e.isExtracted), u = ({ fields: u, isLoading: d, isBoundingBoxOrConfidenceScoreReviewEnabled: f }) => {
|
|
12
|
-
let p = n(), m = t(() => l(u), [u]);
|
|
13
|
-
return !f || !m || d ? null : /* @__PURE__ */ i("div", {
|
|
14
|
-
className: c.aiDisclaimer,
|
|
15
|
-
children: [/* @__PURE__ */ r(s, {
|
|
16
|
-
className: c.infoBadgeIcon,
|
|
17
|
-
width: 12,
|
|
18
|
-
height: 12,
|
|
19
|
-
color: o
|
|
20
|
-
}), /* @__PURE__ */ r(a, {
|
|
21
|
-
as: "p",
|
|
22
|
-
color: "textOnLightSecondary",
|
|
23
|
-
variant: "bodySmall",
|
|
24
|
-
children: p.formatMessage(e.aiDisclaimer)
|
|
25
|
-
})]
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
export { u as t };
|
|
1
|
+
import messages from"../esm/lib/messages.js";import{useMemo}from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import{Text}from"@box/blueprint-web";import{bpSize030,bpTextTextOnLightSecondary}from"@box/blueprint-web-assets/tokens/tokens";import{InfoBadge}from"@box/blueprint-web-assets/icons/Line";import '../styles/metadata-instance-form-ai-disclaimer.css';var metadata_instance_form_ai_disclaimer_module_default={aiDisclaimer:`_aiDisclaimer_6i2mf_1`,infoBadgeIcon:`_infoBadgeIcon_6i2mf_7`},checkHasAutofillValue=fields=>fields.some(field=>!!field.confidenceScore||!!field.isExtracted),MetadataInstanceFormAiDisclaimer=({fields,isLoading,isBoundingBoxOrConfidenceScoreReviewEnabled})=>{let intl=useIntl(),hasAutofillValue=useMemo(()=>checkHasAutofillValue(fields),[fields]);return!isBoundingBoxOrConfidenceScoreReviewEnabled||!hasAutofillValue||isLoading?null:jsxs(`div`,{className:metadata_instance_form_ai_disclaimer_module_default.aiDisclaimer,children:[jsx(InfoBadge,{className:metadata_instance_form_ai_disclaimer_module_default.infoBadgeIcon,color:bpTextTextOnLightSecondary,height:bpSize030,width:bpSize030}),jsx(Text,{as:`p`,color:`textOnLightSecondary`,variant:`bodySmall`,children:intl.formatMessage(messages.aiDisclaimer)})]})};export{MetadataInstanceFormAiDisclaimer as t};
|
|
@@ -1,113 +1 @@
|
|
|
1
|
-
import { EXTRACT_AGENTS_MAP as
|
|
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 { forwardRef as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
7
|
-
import { useIntl as u } from "react-intl";
|
|
8
|
-
import { BoxAiAdvancedLogo24 as d, BoxAiLogo24 as f } from "@box/blueprint-web-assets/icons/Logo";
|
|
9
|
-
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
-
import { Button as h, DropdownMenu as g, IconButton as _, LoadingIndicator as v, SplitButton as y, Text as b, Tooltip as x } from "@box/blueprint-web";
|
|
11
|
-
import { getIn as S, useFormikContext as C } from "formik";
|
|
12
|
-
import { useLocalStorageAIAgents as w } from "@box/box-ai-agent-selector";
|
|
13
|
-
import '../styles/metadata-instance-form-autofill-button.css';var T = {
|
|
14
|
-
loadingIndicator: "_loadingIndicator_zhzu0_1",
|
|
15
|
-
actionMenuItem: "_actionMenuItem_zhzu0_11",
|
|
16
|
-
splitButtonIcon: "_splitButtonIcon_zhzu0_17"
|
|
17
|
-
}, E = /*#__PURE__*/ o(({ isButtonDisabled: t, onAutofill: n, onAgentChange: r, storedAgent: i, icon: o, ...s }, c) => {
|
|
18
|
-
let d = u(), [f, h] = l(i || "standard"), _ = (e) => {
|
|
19
|
-
h(e), r(e), setTimeout(() => {
|
|
20
|
-
n(e);
|
|
21
|
-
}, 0);
|
|
22
|
-
};
|
|
23
|
-
return /* @__PURE__ */ p(y, {
|
|
24
|
-
...s,
|
|
25
|
-
ref: c,
|
|
26
|
-
disabled: t,
|
|
27
|
-
dropdownTriggerAriaLabel: "See agent options.",
|
|
28
|
-
endIcon: o,
|
|
29
|
-
label: d.formatMessage(a.autofillButton),
|
|
30
|
-
onClick: () => n(),
|
|
31
|
-
variant: "secondary",
|
|
32
|
-
children: /* @__PURE__ */ p(g.RadioGroup, {
|
|
33
|
-
onValueChange: (e) => _(e),
|
|
34
|
-
value: f,
|
|
35
|
-
children: Object.entries(e).map(([e, t]) => {
|
|
36
|
-
let n = t.ICON;
|
|
37
|
-
return /* @__PURE__ */ p(g.RadioSelectItem, {
|
|
38
|
-
value: t.AGENT_TYPE,
|
|
39
|
-
children: /* @__PURE__ */ m("div", {
|
|
40
|
-
className: T.actionMenuItem,
|
|
41
|
-
children: [/* @__PURE__ */ p(n, {
|
|
42
|
-
"aria-hidden": !0,
|
|
43
|
-
className: T.splitButtonIcon
|
|
44
|
-
}), /* @__PURE__ */ p(b, {
|
|
45
|
-
as: "span",
|
|
46
|
-
children: d.formatMessage(a[t.DISPLAY_MSG])
|
|
47
|
-
})]
|
|
48
|
-
})
|
|
49
|
-
}, e);
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
});
|
|
53
|
-
}), D = ({ areAiSuggestionsAvailable: o, isBetaLanguageEnabled: l, isLoading: m, variant: g = "secondary-button", isAdvancedExtractAgentEnabled: y = !1, onAutofill: b }) => {
|
|
54
|
-
let { isSubmitting: D, values: O, setFieldValue: k } = C(), A = u(), [j, M] = w(t), { suggestions: N, confidenceScores: P, targetLocations: F } = i();
|
|
55
|
-
s(() => {
|
|
56
|
-
if (N) {
|
|
57
|
-
let e = S(O, "metadata.fields"), t = S(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 = S(O, "metadata.templateKey"), r = S(O, "metadata.scope"), i = t ? e[t]?.AGENT_ID : e[j]?.AGENT_ID;
|
|
76
|
-
b(n, r, y ? i : void 0);
|
|
77
|
-
}, L = !o || D || m, R = j === "enhanced" && y ? d : f, z = c(() => r(y, j, A), [
|
|
78
|
-
y,
|
|
79
|
-
j,
|
|
80
|
-
A
|
|
81
|
-
]);
|
|
82
|
-
return g === "secondary-button" ? /* @__PURE__ */ p(x, {
|
|
83
|
-
content: z,
|
|
84
|
-
children: y ? /* @__PURE__ */ p(E, {
|
|
85
|
-
icon: R,
|
|
86
|
-
isButtonDisabled: L,
|
|
87
|
-
onAgentChange: M,
|
|
88
|
-
onAutofill: I,
|
|
89
|
-
storedAgent: j
|
|
90
|
-
}) : /* @__PURE__ */ p(h, {
|
|
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__ */ p(x, {
|
|
99
|
-
content: z,
|
|
100
|
-
children: m ? /* @__PURE__ */ p(v, {
|
|
101
|
-
"aria-label": A.formatMessage(a.loadingButtonAriaLabel),
|
|
102
|
-
className: T.loadingIndicator
|
|
103
|
-
}) : /* @__PURE__ */ p(_, {
|
|
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
|
+
import{EXTRACT_AGENTS_MAP,EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY}from"../esm/lib/constants.js";import{autofillMessages}from"../esm/lib/messages.js";import{getTooltipContent}from"../esm/lib/utils/utils.js";import{useAutofill}from"../esm/lib/utils/autofill-context.js";import messages from"../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js";import{forwardRef,useEffect,useMemo,useState}from"react";import{useIntl}from"react-intl";import{BoxAiAdvancedLogo24,BoxAiLogo24}from"@box/blueprint-web-assets/icons/Logo";import{jsx,jsxs}from"react/jsx-runtime";import{Button,DropdownMenu,IconButton,LoadingIndicator,SplitButton,Text,Tooltip}from"@box/blueprint-web";import{getIn,useFormikContext}from"formik";import{useLocalStorageAIAgents}from"@box/box-ai-agent-selector";import '../styles/metadata-instance-form-autofill-button.css';var metadata_instance_form_autofill_button_module_default={loadingIndicator:`_loadingIndicator_zhzu0_1`,actionMenuItem:`_actionMenuItem_zhzu0_11`,splitButtonIcon:`_splitButtonIcon_zhzu0_17`},AutofillSplitButton=forwardRef(({isButtonDisabled,onAutofill,onAgentChange,storedAgent,icon,...rest},forwardedRef)=>{let intl=useIntl(),[selectedExtractAgent,setSelectedExtractAgent]=useState(storedAgent||`standard`),handleAgentChange=agentType=>{setSelectedExtractAgent(agentType),onAgentChange(agentType),setTimeout(()=>{onAutofill(agentType)},0)};return jsx(SplitButton,{...rest,ref:forwardedRef,disabled:isButtonDisabled,dropdownTriggerAriaLabel:`See agent options.`,endIcon:icon,label:intl.formatMessage(messages.autofillButton),onClick:()=>onAutofill(),variant:`secondary`,children:jsx(DropdownMenu.RadioGroup,{onValueChange:value=>handleAgentChange(value),value:selectedExtractAgent,children:Object.entries(EXTRACT_AGENTS_MAP).map(([key,agent])=>{let IconComponent=agent.ICON;return jsx(DropdownMenu.RadioSelectItem,{value:agent.AGENT_TYPE,children:jsxs(`div`,{className:metadata_instance_form_autofill_button_module_default.actionMenuItem,children:[jsx(IconComponent,{"aria-hidden":!0,className:metadata_instance_form_autofill_button_module_default.splitButtonIcon}),jsx(Text,{as:`span`,children:intl.formatMessage(messages[agent.DISPLAY_MSG])})]})},key)})})})}),MetadataInstanceFormAutofillButton=({areAiSuggestionsAvailable,isBetaLanguageEnabled,isLoading,variant=`secondary-button`,isAdvancedExtractAgentEnabled=!1,onAutofill})=>{let{isSubmitting,values,setFieldValue}=useFormikContext(),intl=useIntl(),[storedAgent,setStoredAgent]=useLocalStorageAIAgents(EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY),{suggestions,confidenceScores,targetLocations}=useAutofill();useEffect(()=>{if(suggestions){let fields=getIn(values,`metadata.fields`),templateKey=getIn(values,`metadata.templateKey`);setFieldValue(`metadata.fields`,fields?.map(field=>{let suggestion=suggestions?.[templateKey]?.[field.key];return suggestion?{...field,aiSuggestion:suggestion,aiSuggestionConfidenceScore:confidenceScores?.[templateKey]?.[field.key],aiSuggestionTargetLocation:targetLocations?.[templateKey]?.[field.key]}:field}))}},[suggestions,confidenceScores,targetLocations,setFieldValue]);let handleAutofill=selectedAgentId=>{let templateKey=getIn(values,`metadata.templateKey`),scope=getIn(values,`metadata.scope`),agentId=selectedAgentId?EXTRACT_AGENTS_MAP[selectedAgentId]?.AGENT_ID:EXTRACT_AGENTS_MAP[storedAgent]?.AGENT_ID;onAutofill(templateKey,scope,isAdvancedExtractAgentEnabled?agentId:void 0)},isButtonDisabled=!areAiSuggestionsAvailable||isSubmitting||isLoading,buttonIcon=storedAgent===`enhanced`&&isAdvancedExtractAgentEnabled?BoxAiAdvancedLogo24:BoxAiLogo24,tooltipContent=useMemo(()=>getTooltipContent(isAdvancedExtractAgentEnabled,storedAgent,intl),[isAdvancedExtractAgentEnabled,storedAgent,intl]);return variant===`secondary-button`?jsx(Tooltip,{content:tooltipContent,children:isAdvancedExtractAgentEnabled?jsx(AutofillSplitButton,{icon:buttonIcon,isButtonDisabled,onAgentChange:setStoredAgent,onAutofill:handleAutofill,storedAgent}):jsx(Button,{disabled:isButtonDisabled,endIcon:buttonIcon,onClick:()=>handleAutofill(),variant:`secondary`,"data-target-id":`Button-autofillButton`,children:intl.formatMessage(messages.autofillButton)})}):jsx(Tooltip,{content:tooltipContent,children:isLoading?jsx(LoadingIndicator,{"aria-label":intl.formatMessage(messages.loadingButtonAriaLabel),className:metadata_instance_form_autofill_button_module_default.loadingIndicator}):jsx(IconButton,{"aria-label":intl.formatMessage(autofillMessages.autofillButtonAriaLabel),disabled:isButtonDisabled,icon:buttonIcon,onClick:()=>handleAutofill(),variant:`icon-logo`,"data-target-id":`IconButton-autofillButtonAriaLabel`})})};export{MetadataInstanceFormAutofillButton as t};
|
|
@@ -1,54 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t } from "./metadata-instance-form-ai-disclaimer.js";
|
|
3
|
-
import { t as n } from "./metadata-instance-form-footer.js";
|
|
4
|
-
import { t as r } from "./metadata-instance-form-header.js";
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
import o from "clsx";
|
|
7
|
-
import { Card as s, useBlueprintModernization as c } from "@box/blueprint-web";
|
|
8
|
-
import '../styles/metadata-instance-form-card-wrapper.css';var l = {
|
|
9
|
-
metadataInstanceForm: "_metadataInstanceForm_ztv76_1",
|
|
10
|
-
wrapperGradient: "_wrapperGradient_ztv76_7",
|
|
11
|
-
suggestionsFetching: "_suggestionsFetching_ztv76_17",
|
|
12
|
-
metadataInstanceFormContent: "_metadataInstanceFormContent_ztv76_23",
|
|
13
|
-
metadataInstanceFormContentReducedGap: "_metadataInstanceFormContentReducedGap_ztv76_30",
|
|
14
|
-
showOverlay: "_showOverlay_ztv76_34"
|
|
15
|
-
}, u = (u) => {
|
|
16
|
-
let { areAiSuggestionsAvailable: d, children: f, className: p, formRef: m, formValues: h, isAdvancedExtractAgentEnabled: g = !1, isAiSuggestionsFeatureEnabled: _, isBetaLanguageEnabled: v, isConfidenceScoreReviewEnabled: y = !1, isBoundingBoxEnabled: b = !1, isLargeFile: x = !1, isDeleteButtonDisabled: S, onToggleReviewFilter: C, shouldShowOnlyReviewFields: w = !1, suggestions: T, isFetchingSuggestions: E, isFormDirty: D = !1, selectedTemplateInstance: O, getAiSuggestions: k, handleCancel: A, handleDelete: j } = u, { enableModernizedComponents: M } = c(), N = O?.templateKey === e, P = !!T[O?.templateKey], F = y || b;
|
|
17
|
-
return /* @__PURE__ */ i("div", {
|
|
18
|
-
className: E && l.wrapperGradient,
|
|
19
|
-
"data-modern": M,
|
|
20
|
-
children: /* @__PURE__ */ a(s, {
|
|
21
|
-
ref: m,
|
|
22
|
-
className: o(p, { [l.suggestionsFetching]: E }),
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ i(r, {
|
|
25
|
-
areAiSuggestionsAvailable: d,
|
|
26
|
-
hasSuggestions: P,
|
|
27
|
-
isAdvancedExtractAgentEnabled: g,
|
|
28
|
-
isAiSuggestionsFeatureEnabled: _ && !N,
|
|
29
|
-
isBetaLanguageEnabled: v,
|
|
30
|
-
isConfidenceScoreReviewEnabled: y,
|
|
31
|
-
isLargeFile: x,
|
|
32
|
-
isLoading: E,
|
|
33
|
-
onAutofill: k,
|
|
34
|
-
onToggleReviewFilter: C,
|
|
35
|
-
shouldShowOnlyReviewFields: w,
|
|
36
|
-
templateName: O?.displayName
|
|
37
|
-
}),
|
|
38
|
-
O && f,
|
|
39
|
-
/* @__PURE__ */ i(t, {
|
|
40
|
-
isLoading: E,
|
|
41
|
-
isBoundingBoxOrConfidenceScoreReviewEnabled: F,
|
|
42
|
-
fields: h.metadata?.fields ?? []
|
|
43
|
-
}),
|
|
44
|
-
/* @__PURE__ */ i(n, {
|
|
45
|
-
isDeleteButtonDisabled: S,
|
|
46
|
-
isLoading: E,
|
|
47
|
-
onCancel: () => A(D),
|
|
48
|
-
onDelete: j
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
})
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
export { l as n, u as t };
|
|
1
|
+
import{TEMPLATE_CUSTOM_PROPERTIES}from"../esm/lib/constants.js";import{t as MetadataInstanceFormAiDisclaimer}from"./metadata-instance-form-ai-disclaimer.js";import{t as MetadataInstanceFormFooter}from"./metadata-instance-form-footer.js";import{t as MetadataInstanceFormHeader}from"./metadata-instance-form-header.js";import{jsx,jsxs}from"react/jsx-runtime";import clsx from"clsx";import{Card,useBlueprintModernization}from"@box/blueprint-web";import '../styles/metadata-instance-form-card-wrapper.css';var metadata_instance_form_module_default={metadataInstanceForm:`_metadataInstanceForm_ztv76_1`,wrapperGradient:`_wrapperGradient_ztv76_7`,suggestionsFetching:`_suggestionsFetching_ztv76_17`,metadataInstanceFormContent:`_metadataInstanceFormContent_ztv76_23`,metadataInstanceFormContentReducedGap:`_metadataInstanceFormContentReducedGap_ztv76_30`,showOverlay:`_showOverlay_ztv76_34`},MetadataInstanceFormCardWrapper=props=>{let{areAiSuggestionsAvailable,children,className,formRef,formValues,isAdvancedExtractAgentEnabled=!1,isAiSuggestionsFeatureEnabled,isBetaLanguageEnabled,isConfidenceScoreReviewEnabled=!1,isBoundingBoxEnabled=!1,isLargeFile=!1,isDeleteButtonDisabled,onToggleReviewFilter,shouldShowOnlyReviewFields=!1,suggestions,isFetchingSuggestions,isFormDirty=!1,selectedTemplateInstance,getAiSuggestions,handleCancel,handleDelete}=props,{enableModernizedComponents}=useBlueprintModernization(),isCustomMetadata=selectedTemplateInstance?.templateKey===TEMPLATE_CUSTOM_PROPERTIES,hasSuggestions=!!suggestions[selectedTemplateInstance?.templateKey],isBoundingBoxOrConfidenceScoreReviewEnabled=isConfidenceScoreReviewEnabled||isBoundingBoxEnabled;return jsx(`div`,{className:isFetchingSuggestions&&metadata_instance_form_module_default.wrapperGradient,"data-modern":enableModernizedComponents,children:jsxs(Card,{ref:formRef,className:clsx(className,{[metadata_instance_form_module_default.suggestionsFetching]:isFetchingSuggestions}),children:[jsx(MetadataInstanceFormHeader,{areAiSuggestionsAvailable,hasSuggestions,isAdvancedExtractAgentEnabled,isAiSuggestionsFeatureEnabled:isAiSuggestionsFeatureEnabled&&!isCustomMetadata,isBetaLanguageEnabled,isConfidenceScoreReviewEnabled,isLargeFile,isLoading:isFetchingSuggestions,onAutofill:getAiSuggestions,onToggleReviewFilter,shouldShowOnlyReviewFields,templateName:selectedTemplateInstance?.displayName}),selectedTemplateInstance&&children,jsx(MetadataInstanceFormAiDisclaimer,{isLoading:isFetchingSuggestions,isBoundingBoxOrConfidenceScoreReviewEnabled,fields:formValues.metadata?.fields??[]}),jsx(MetadataInstanceFormFooter,{isDeleteButtonDisabled,isLoading:isFetchingSuggestions,onCancel:()=>handleCancel(isFormDirty),onDelete:handleDelete})]})})};export{metadata_instance_form_module_default as n,MetadataInstanceFormCardWrapper as t};
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useIntl as t } from "react-intl";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
import { Button as i, TextButton as a } from "@box/blueprint-web";
|
|
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 = t(), { isSubmitting: p, submitForm: m } = o(), h = l || p;
|
|
12
|
-
return /* @__PURE__ */ n("div", {
|
|
13
|
-
className: s.metadataInstanceFormFooter,
|
|
14
|
-
children: /* @__PURE__ */ r("div", {
|
|
15
|
-
className: s.buttonsContainer,
|
|
16
|
-
children: [/* @__PURE__ */ n(a, {
|
|
17
|
-
disabled: h || c,
|
|
18
|
-
onClick: d,
|
|
19
|
-
"data-target-id": "TextButton-deleteButton",
|
|
20
|
-
children: f.formatMessage(e.deleteButton)
|
|
21
|
-
}), /* @__PURE__ */ r("div", {
|
|
22
|
-
className: s.buttons,
|
|
23
|
-
children: [/* @__PURE__ */ n(i, {
|
|
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__ */ n(i, {
|
|
31
|
-
"data-target-id": "Button-metadataEditorSave",
|
|
32
|
-
disabled: h,
|
|
33
|
-
loading: p,
|
|
34
|
-
loadingAriaLabel: f.formatMessage(e.loadingAriaLabel),
|
|
35
|
-
onClick: m,
|
|
36
|
-
size: "large",
|
|
37
|
-
children: f.formatMessage(e.saveButton)
|
|
38
|
-
})]
|
|
39
|
-
})]
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
export { c as t };
|
|
1
|
+
import messages from"../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import{Button,TextButton}from"@box/blueprint-web";import{useFormikContext}from"formik";import '../styles/metadata-instance-form-footer.css';var metadata_instance_form_footer_module_default={metadataInstanceFormFooter:`_metadataInstanceFormFooter_sqpiw_1`,buttonsContainer:`_buttonsContainer_sqpiw_7`,buttons:`_buttons_sqpiw_7`},MetadataInstanceFormFooter=({isDeleteButtonDisabled,isLoading,onCancel,onDelete})=>{let intl=useIntl(),{isSubmitting,submitForm}=useFormikContext(),isButtonDisabled=isLoading||isSubmitting;return jsx(`div`,{className:metadata_instance_form_footer_module_default.metadataInstanceFormFooter,children:jsxs(`div`,{className:metadata_instance_form_footer_module_default.buttonsContainer,children:[jsx(TextButton,{disabled:isButtonDisabled||isDeleteButtonDisabled,onClick:onDelete,"data-target-id":`TextButton-deleteButton`,children:intl.formatMessage(messages.deleteButton)}),jsxs(`div`,{className:metadata_instance_form_footer_module_default.buttons,children:[jsx(Button,{disabled:isButtonDisabled,onClick:onCancel,size:`large`,variant:`secondary`,"data-target-id":`Button-cancelButton`,children:intl.formatMessage(messages.cancelButton)}),jsx(Button,{"data-target-id":`Button-metadataEditorSave`,disabled:isButtonDisabled,loading:isSubmitting,loadingAriaLabel:intl.formatMessage(messages.loadingAriaLabel),onClick:submitForm,size:`large`,children:intl.formatMessage(messages.saveButton)})]})]})})};export{MetadataInstanceFormFooter as t};
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t } from "./interactive-header-text.js";
|
|
3
|
-
import { MetadataInstanceReviewNotice as n } from "../esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js";
|
|
4
|
-
import { t as r } from "./metadata-instance-form-autofill-button.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(() => _ ? e(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(t, {
|
|
23
|
-
className: d.title,
|
|
24
|
-
title: D
|
|
25
|
-
}), h ? /* @__PURE__ */ c(r, {
|
|
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(n, {
|
|
38
|
-
fieldsNeedingReviewCount: E,
|
|
39
|
-
isLowScoreFilteringEnabled: x,
|
|
40
|
-
onTextToggleClick: b
|
|
41
|
-
})
|
|
42
|
-
]
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
export { f as t };
|
|
1
|
+
import{getFieldsNeedingReview}from"../esm/lib/utils/confidence-score/get-fields-needing-review.js";import{t as InteractiveHeaderText}from"./interactive-header-text.js";import{MetadataInstanceReviewNotice}from"../esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js";import{t as MetadataInstanceFormAutofillButton}from"./metadata-instance-form-autofill-button.js";import{MetadataInstanceFormInlineNotice}from"../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";import messages from"../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js";import{useMemo}from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import{useFormikContext}from"formik";import '../styles/metadata-instance-form-header.css';var metadata_instance_form_header_module_default={metadataInstanceFormHeaderWrapper:`_metadataInstanceFormHeaderWrapper_3nbmr_1`,metadataInstanceFormHeader:`_metadataInstanceFormHeader_3nbmr_1`,title:`_title_3nbmr_15`},MetadataInstanceFormHeader=({areAiSuggestionsAvailable,hasSuggestions,isAdvancedExtractAgentEnabled=!1,isAiSuggestionsFeatureEnabled,isBetaLanguageEnabled,isConfidenceScoreReviewEnabled=!1,isLargeFile,isLoading,onToggleReviewFilter,shouldShowOnlyReviewFields=!1,templateName,onAutofill})=>{let intl=useIntl(),{values}=useFormikContext(),fieldsNeedingReviewCount=useMemo(()=>isConfidenceScoreReviewEnabled?getFieldsNeedingReview(values.metadata?.fields??[]).length:0,[values.metadata?.fields,isConfidenceScoreReviewEnabled]),title=templateName??intl.formatMessage(messages.customInstanceTitle),canShowAiNotice=hasSuggestions&&areAiSuggestionsAvailable,canShowReviewNotice=isConfidenceScoreReviewEnabled&&!isLoading&&(fieldsNeedingReviewCount>0||shouldShowOnlyReviewFields)&&onToggleReviewFilter!==void 0;return jsxs(`div`,{className:metadata_instance_form_header_module_default.metadataInstanceFormHeaderWrapper,children:[jsxs(`div`,{className:metadata_instance_form_header_module_default.metadataInstanceFormHeader,children:[jsx(InteractiveHeaderText,{className:metadata_instance_form_header_module_default.title,title}),isAiSuggestionsFeatureEnabled?jsx(MetadataInstanceFormAutofillButton,{areAiSuggestionsAvailable,isAdvancedExtractAgentEnabled,isBetaLanguageEnabled,isLoading,onAutofill}):null]}),canShowAiNotice&&jsx(MetadataInstanceFormInlineNotice,{isBetaLanguageEnabled,isLargeFile}),canShowReviewNotice&&jsx(MetadataInstanceReviewNotice,{fieldsNeedingReviewCount,isLowScoreFilteringEnabled:shouldShowOnlyReviewFields,onTextToggleClick:onToggleReviewFilter})]})};export{MetadataInstanceFormHeader as t};
|