@box/metadata-editor 0.91.2 → 0.92.1
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/chunks/metadata-instance-form-card-wrapper.js +34 -32
- package/esm/index.js +18 -17
- package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +43 -23
- package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +12 -0
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +76 -72
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +3 -11
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +33 -42
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +22 -0
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +46 -0
- package/esm/lib/utils/autofill-context.js +19 -18
- package/i18n/bn-IN.js +10 -3
- package/i18n/da-DK.js +10 -3
- package/i18n/de-DE.js +10 -3
- package/i18n/en-AU.js +10 -3
- package/i18n/en-CA.js +10 -3
- package/i18n/en-GB.js +10 -3
- package/i18n/en-US.js +7 -2
- package/i18n/en-US.properties +14 -4
- package/i18n/en-x-pseudo.js +10 -3
- package/i18n/es-419.js +10 -3
- package/i18n/es-ES.js +10 -3
- package/i18n/fi-FI.js +10 -3
- package/i18n/fr-CA.js +10 -3
- package/i18n/fr-FR.js +10 -3
- package/i18n/hi-IN.js +10 -3
- package/i18n/it-IT.js +10 -3
- package/i18n/ja-JP.js +10 -3
- package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.json +1 -1
- package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.json +1 -1
- package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.json +1 -0
- package/i18n/ko-KR.js +10 -3
- package/i18n/nb-NO.js +10 -3
- package/i18n/nl-NL.js +10 -3
- package/i18n/pl-PL.js +10 -3
- package/i18n/pt-BR.js +10 -3
- package/i18n/ru-RU.js +10 -3
- package/i18n/sv-SE.js +10 -3
- package/i18n/tr-TR.js +10 -3
- package/i18n/zh-CN.js +10 -3
- package/i18n/zh-TW.js +10 -3
- package/package.json +3 -3
- package/styles/autofill-overlay.css +1 -1
- package/styles/metadata-instance-form-inline-notice.css +1 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.d.ts +3 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.d.ts +15 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +3 -2
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.d.ts +0 -10
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/types.d.ts +1 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.d.ts +23 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.d.ts +5 -0
- package/types/lib/utils/autofill-context.d.ts +1 -0
@@ -1,56 +1,58 @@
|
|
1
|
-
import
|
2
|
-
import { Card as
|
3
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
4
|
-
import { MetadataInstanceFormFooter as
|
5
|
-
import { MetadataInstanceFormHeader as
|
6
|
-
import { jsx as e, jsxs as
|
7
|
-
import '../styles/metadata-instance-form-card-wrapper.css';const
|
8
|
-
metadataInstanceForm:
|
9
|
-
wrapperGradient:
|
10
|
-
suggestionsFetching:
|
1
|
+
import S from "clsx";
|
2
|
+
import { Card as A } from "@box/blueprint-web";
|
3
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as E } from "../esm/lib/constants.js";
|
4
|
+
import { MetadataInstanceFormFooter as M } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js";
|
5
|
+
import { MetadataInstanceFormHeader as b } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
|
6
|
+
import { jsx as e, jsxs as y } from "react/jsx-runtime";
|
7
|
+
import '../styles/metadata-instance-form-card-wrapper.css';const D = "_metadataInstanceForm_6uz9p_1", I = "_wrapperGradient_6uz9p_7", L = "_suggestionsFetching_6uz9p_12", N = "_metadataInstanceFormContent_6uz9p_18", s = {
|
8
|
+
metadataInstanceForm: D,
|
9
|
+
wrapperGradient: I,
|
10
|
+
suggestionsFetching: L,
|
11
11
|
metadataInstanceFormContent: N
|
12
|
-
},
|
12
|
+
}, j = (n) => {
|
13
13
|
const {
|
14
14
|
areAiSuggestionsAvailable: o,
|
15
15
|
children: r,
|
16
16
|
className: i,
|
17
|
-
formRef:
|
18
|
-
isAiSuggestionsFeatureEnabled:
|
17
|
+
formRef: g,
|
18
|
+
isAiSuggestionsFeatureEnabled: m,
|
19
19
|
isBetaLanguageEnabled: d,
|
20
|
-
|
21
|
-
|
20
|
+
isLargeFile: c,
|
21
|
+
isDeleteButtonDisabled: u,
|
22
|
+
suggestions: p,
|
22
23
|
isFetchingSuggestions: a,
|
23
|
-
isFormDirty:
|
24
|
+
isFormDirty: l = !1,
|
24
25
|
selectedTemplateInstance: t,
|
25
|
-
getAiSuggestions:
|
26
|
-
handleCancel:
|
27
|
-
handleDelete:
|
28
|
-
} = n,
|
26
|
+
getAiSuggestions: F,
|
27
|
+
handleCancel: _,
|
28
|
+
handleDelete: f
|
29
|
+
} = n, h = (t == null ? void 0 : t.templateKey) === E, C = !!p[t == null ? void 0 : t.templateKey];
|
29
30
|
return /* @__PURE__ */ e("div", {
|
30
31
|
className: a && s.wrapperGradient,
|
31
|
-
children: /* @__PURE__ */
|
32
|
-
ref:
|
33
|
-
className:
|
32
|
+
children: /* @__PURE__ */ y(A, {
|
33
|
+
ref: g,
|
34
|
+
className: S(i, {
|
34
35
|
[s.suggestionsFetching]: a
|
35
36
|
}),
|
36
|
-
children: [/* @__PURE__ */ e(
|
37
|
+
children: [/* @__PURE__ */ e(b, {
|
37
38
|
areAiSuggestionsAvailable: o,
|
38
|
-
hasSuggestions:
|
39
|
-
isAiSuggestionsFeatureEnabled:
|
39
|
+
hasSuggestions: C,
|
40
|
+
isAiSuggestionsFeatureEnabled: m && !h,
|
40
41
|
isBetaLanguageEnabled: d,
|
42
|
+
isLargeFile: c,
|
41
43
|
isLoading: a,
|
42
|
-
onAutofill:
|
44
|
+
onAutofill: F,
|
43
45
|
templateName: t == null ? void 0 : t.displayName
|
44
|
-
}), t && r, /* @__PURE__ */ e(
|
45
|
-
isDeleteButtonDisabled:
|
46
|
+
}), t && r, /* @__PURE__ */ e(M, {
|
47
|
+
isDeleteButtonDisabled: u,
|
46
48
|
isLoading: a,
|
47
|
-
onCancel: () =>
|
48
|
-
onDelete:
|
49
|
+
onCancel: () => _(l),
|
50
|
+
onDelete: f
|
49
51
|
})]
|
50
52
|
})
|
51
53
|
});
|
52
54
|
};
|
53
55
|
export {
|
54
|
-
|
56
|
+
j as M,
|
55
57
|
s
|
56
58
|
};
|
package/esm/index.js
CHANGED
@@ -6,18 +6,18 @@ import { MULTI_VALUE_DEFAULT_OPTION as x, MULTI_VALUE_DEFAULT_TAXONOMY_OPTION as
|
|
6
6
|
import { MetadataEmptyState as s } from "./lib/components/metadata-empty-state/metadata-empty-state.js";
|
7
7
|
import { CustomInstanceNewField as I } from "./lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js";
|
8
8
|
import { DeleteConfirmationModal as u } from "./lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js";
|
9
|
-
import { MetadataInstanceFormAutofillButton as
|
10
|
-
import { MetadataInstanceFormHeader as
|
11
|
-
import { MetadataInstanceForm as
|
9
|
+
import { MetadataInstanceFormAutofillButton as _ } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
10
|
+
import { MetadataInstanceFormHeader as L } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
|
11
|
+
import { MetadataInstanceForm as F } from "./lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js";
|
12
12
|
import { J as D } from "../chunks/utils.js";
|
13
|
-
import { MetadataInstanceList as
|
14
|
-
import { MetadataInstanceHeader as
|
13
|
+
import { MetadataInstanceList as N } from "./lib/components/metadata-instance-list/metadata-instance-list.js";
|
14
|
+
import { MetadataInstanceHeader as w } from "./lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js";
|
15
15
|
import { UnsavedChangesModal as h } from "./lib/components/unsaved-changes-modal/unsaved-changes-modal.js";
|
16
|
-
import { defaultInitialValues as
|
17
|
-
import { MetadataEditor as
|
16
|
+
import { defaultInitialValues as b, defaultMetadataValueMap as g } from "./lib/defaults.js";
|
17
|
+
import { MetadataEditor as H } from "./lib/metadata-editor.js";
|
18
18
|
import { U as W } from "../chunks/types.js";
|
19
19
|
import { withApiWrapper as B } from "./lib/utils/api-wrapper.js";
|
20
|
-
import { AutofillContext as Y, AutofillContextProvider as j,
|
20
|
+
import { AutofillContext as Y, AutofillContextProvider as j, TIMEOUT_10_SECONDS as k, useAutofill as q } from "./lib/utils/autofill-context.js";
|
21
21
|
export {
|
22
22
|
e as AddMetadataTemplateDropdown,
|
23
23
|
Y as AutofillContext,
|
@@ -31,17 +31,18 @@ export {
|
|
31
31
|
x as MULTI_VALUE_DEFAULT_OPTION,
|
32
32
|
i as MULTI_VALUE_DEFAULT_TAXONOMY_OPTION,
|
33
33
|
l as MULTI_VALUE_DEFAULT_VALUE,
|
34
|
-
|
34
|
+
H as MetadataEditor,
|
35
35
|
s as MetadataEmptyState,
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
F as MetadataInstanceForm,
|
37
|
+
_ as MetadataInstanceFormAutofillButton,
|
38
|
+
L as MetadataInstanceFormHeader,
|
39
|
+
w as MetadataInstanceHeader,
|
40
|
+
N as MetadataInstanceList,
|
41
|
+
k as TIMEOUT_10_SECONDS,
|
41
42
|
h as UnsavedChangesModal,
|
42
43
|
W as UpdateMode,
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
b as defaultInitialValues,
|
45
|
+
g as defaultMetadataValueMap,
|
46
|
+
q as useAutofill,
|
46
47
|
B as withApiWrapper
|
47
48
|
};
|
@@ -1,36 +1,56 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
import { useState as d } from "react";
|
2
|
+
import { LoadingIndicator as v, Text as n, TextButton as g } from "@box/blueprint-web";
|
3
|
+
import { u as p } from "../../../../../../chunks/index.js";
|
4
|
+
import { AlertTriangle as y } from "@box/blueprint-web-assets/icons/Line";
|
5
|
+
import { SurfaceStatusSurfaceError as _, Size5 as m } from "@box/blueprint-web-assets/tokens/tokens";
|
6
|
+
import e from "./messages.js";
|
7
|
+
import { jsxs as O, jsx as i } from "react/jsx-runtime";
|
8
|
+
import '../../../../../../styles/autofill-overlay.css';const T = "_autofillOverlay_vvkb0_1", b = "_autofillOverlayTitle_vvkb0_15", S = "_dismissButton_vvkb0_20", h = "_loadingIcon_vvkb0_24", B = "_testContainerStyle_vvkb0_29", s = {
|
9
|
+
autofillOverlay: T,
|
10
|
+
autofillOverlayTitle: b,
|
11
|
+
dismissButton: S,
|
12
|
+
loadingIcon: h,
|
13
|
+
testContainerStyle: B
|
14
|
+
}, A = ({
|
15
|
+
errorCode: a,
|
16
|
+
isFetchingSuggestions: c,
|
17
|
+
isLongLoading: o
|
12
18
|
}) => {
|
13
|
-
const t =
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
19
|
+
const t = p(), [f, u] = d(!1);
|
20
|
+
let l = t.formatMessage(e.defaultLoadingMessage);
|
21
|
+
a && (l = t.formatMessage(e.errorTitle)), o && (l = t.formatMessage(e.longLoadingTitle));
|
22
|
+
const r = o ? t.formatMessage(e.longLoadingDescription) : a && t.formatMessage(e.errorDescription);
|
23
|
+
return !c && !a || f ? null : /* @__PURE__ */ O("div", {
|
24
|
+
className: s.autofillOverlay,
|
25
|
+
children: [a ? /* @__PURE__ */ i(y, {
|
26
|
+
color: _,
|
27
|
+
height: m,
|
28
|
+
role: "presentation",
|
29
|
+
width: m
|
30
|
+
}) : /* @__PURE__ */ i(v, {
|
31
|
+
"aria-label": t.formatMessage(e.loadingAriaLabel),
|
18
32
|
"aria-live": "polite",
|
19
|
-
className:
|
33
|
+
className: s.loadingIcon,
|
20
34
|
size: "large",
|
21
35
|
variant: "default"
|
22
|
-
}), /* @__PURE__ */
|
36
|
+
}), /* @__PURE__ */ i(n, {
|
23
37
|
as: "p",
|
38
|
+
className: s.autofillOverlayTitle,
|
24
39
|
variant: "subtitle",
|
25
|
-
children:
|
26
|
-
}),
|
40
|
+
children: l
|
41
|
+
}), r && /* @__PURE__ */ i(n, {
|
27
42
|
as: "p",
|
28
43
|
color: "textOnLightSecondary",
|
29
44
|
variant: "bodyDefault",
|
30
|
-
children:
|
45
|
+
children: r
|
46
|
+
}), a && /* @__PURE__ */ i(g, {
|
47
|
+
className: s.dismissButton,
|
48
|
+
onClick: () => u(!0),
|
49
|
+
"data-target-id": "TextButton-dismissButton",
|
50
|
+
children: t.formatMessage(e.dismissButton)
|
31
51
|
})]
|
32
|
-
})
|
52
|
+
});
|
33
53
|
};
|
34
54
|
export {
|
35
|
-
|
55
|
+
A as AutofillOverlay
|
36
56
|
};
|
package/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js
CHANGED
@@ -4,6 +4,18 @@ const e = a({
|
|
4
4
|
id: "metadataEditor.metadataInstanceEditor.autofillOverlay.defaultLoadingMessage",
|
5
5
|
defaultMessage: "Extracting Metadata"
|
6
6
|
},
|
7
|
+
dismissButton: {
|
8
|
+
id: "metadataEditor.metadataInstanceEditor.autofillOverlay.dismissButton",
|
9
|
+
defaultMessage: "Dismiss"
|
10
|
+
},
|
11
|
+
errorTitle: {
|
12
|
+
id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorTitle",
|
13
|
+
defaultMessage: "Metadata extraction could not complete"
|
14
|
+
},
|
15
|
+
errorDescription: {
|
16
|
+
id: "metadataEditor.metadataInstanceEditor.autofillOverlay.errorDescription",
|
17
|
+
defaultMessage: "Please try again in a few minutes"
|
18
|
+
},
|
7
19
|
loadingAriaLabel: {
|
8
20
|
id: "metadataEditor.metadataInstanceEditor.autofillOverlay.loadingAriaLabel",
|
9
21
|
defaultMessage: "Loading"
|
@@ -1,111 +1,115 @@
|
|
1
|
-
import { Formik as
|
2
|
-
import { useState as p, useEffect as
|
3
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
4
|
-
import { AutofillOverlay as
|
5
|
-
import { useAutofill as
|
6
|
-
import { TemplateInstance as
|
7
|
-
import { MetadataEmptyState as
|
8
|
-
import { UnsavedChangesModal as
|
9
|
-
import { CustomInstance as
|
10
|
-
import { DeleteConfirmationModal as
|
11
|
-
import { c as
|
12
|
-
import { s as
|
13
|
-
import { jsx as
|
14
|
-
const
|
1
|
+
import { Formik as $, Form as w } from "formik";
|
2
|
+
import { useState as p, useEffect as C, useRef as J, useMemo as q } from "react";
|
3
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as z } from "../../../../constants.js";
|
4
|
+
import { AutofillOverlay as G } from "../autofill-overlay/autofill-overlay.js";
|
5
|
+
import { useAutofill as H } from "../../../../utils/autofill-context.js";
|
6
|
+
import { TemplateInstance as Q } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
7
|
+
import { MetadataEmptyState as X } from "../../../metadata-empty-state/metadata-empty-state.js";
|
8
|
+
import { UnsavedChangesModal as Y } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
|
9
|
+
import { CustomInstance as Z } from "../custom-instance/custom-instance.js";
|
10
|
+
import { DeleteConfirmationModal as I } from "../delete-confirmation-modal/delete-confirmation-modal.js";
|
11
|
+
import { c as T } from "../../../../../../chunks/utils.js";
|
12
|
+
import { s as h, M as oo } from "../../../../../../chunks/metadata-instance-form-card-wrapper.js";
|
13
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
14
|
+
const Co = (F) => {
|
15
15
|
const {
|
16
|
-
areAiSuggestionsAvailable:
|
16
|
+
areAiSuggestionsAvailable: M,
|
17
17
|
customRef: i,
|
18
|
+
isLargeFile: E,
|
19
|
+
errorCode: S,
|
18
20
|
isAiSuggestionsFeatureEnabled: n,
|
19
|
-
isBetaLanguageEnabled:
|
20
|
-
isDeleteButtonDisabled:
|
21
|
-
isUnsavedChangesModalOpen:
|
22
|
-
MetadataInstanceFormCustomWrapper:
|
21
|
+
isBetaLanguageEnabled: y,
|
22
|
+
isDeleteButtonDisabled: D,
|
23
|
+
isUnsavedChangesModalOpen: b = !1,
|
24
|
+
MetadataInstanceFormCustomWrapper: O,
|
23
25
|
selectedTemplateInstance: o,
|
24
|
-
onCancel:
|
25
|
-
onDelete:
|
26
|
-
onDiscardUnsavedChanges:
|
27
|
-
onSubmit:
|
26
|
+
onCancel: A,
|
27
|
+
onDelete: v,
|
28
|
+
onDiscardUnsavedChanges: L,
|
29
|
+
onSubmit: x,
|
28
30
|
setIsUnsavedChangesModalOpen: s,
|
29
31
|
taxonomyOptionsFetcher: e
|
30
|
-
} =
|
31
|
-
isFetchingSuggestions:
|
32
|
+
} = F, N = O ?? oo, [P, m] = p(!1), {
|
33
|
+
isFetchingSuggestions: a,
|
32
34
|
isLongLoading: l,
|
33
|
-
getAiSuggestions:
|
35
|
+
getAiSuggestions: R,
|
34
36
|
clearSuggestions: u,
|
35
|
-
suggestions:
|
36
|
-
} =
|
37
|
-
|
37
|
+
suggestions: U
|
38
|
+
} = H();
|
39
|
+
C(() => () => {
|
38
40
|
u();
|
39
41
|
}, [u]);
|
40
|
-
const f = (o == null ? void 0 : o.templateKey) ===
|
41
|
-
await
|
42
|
-
},
|
43
|
-
t ? s(!0) :
|
44
|
-
},
|
42
|
+
const f = (o == null ? void 0 : o.templateKey) === z, B = async (t) => {
|
43
|
+
await x(t, T(t, o));
|
44
|
+
}, K = (t) => {
|
45
|
+
t ? s(!0) : A();
|
46
|
+
}, W = () => {
|
45
47
|
m(!0);
|
46
|
-
},
|
48
|
+
}, j = {
|
47
49
|
metadata: {
|
48
50
|
...o
|
49
51
|
}
|
50
|
-
}, g =
|
51
|
-
|
52
|
-
|
52
|
+
}, g = J(null), [d, k] = p(null);
|
53
|
+
C(() => {
|
54
|
+
k(i ?? g.current);
|
53
55
|
}, [i, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
|
54
|
-
const
|
56
|
+
const V = q(() => {
|
55
57
|
const t = (o == null ? void 0 : o.fields.length) === 0;
|
56
|
-
return f ? /* @__PURE__ */
|
57
|
-
isLoading:
|
58
|
-
}) : t ? /* @__PURE__ */
|
58
|
+
return f ? /* @__PURE__ */ r(Z, {
|
59
|
+
isLoading: a
|
60
|
+
}) : t ? /* @__PURE__ */ r(X, {
|
59
61
|
isBoxAiSuggestionsFeatureEnabled: n,
|
60
62
|
level: "instance"
|
61
63
|
}) : /* @__PURE__ */ c("div", {
|
62
|
-
className:
|
63
|
-
children: [/* @__PURE__ */
|
64
|
-
|
64
|
+
className: h.metadataInstanceFormContent,
|
65
|
+
children: [/* @__PURE__ */ r(G, {
|
66
|
+
errorCode: S,
|
67
|
+
isFetchingSuggestions: a,
|
65
68
|
isLongLoading: l
|
66
|
-
}), /* @__PURE__ */
|
67
|
-
disableForm:
|
69
|
+
}), /* @__PURE__ */ r(Q, {
|
70
|
+
disableForm: a,
|
68
71
|
portalElement: i ?? d,
|
69
72
|
taxonomyOptionsFetcher: e
|
70
73
|
})]
|
71
74
|
});
|
72
|
-
}, [o == null ? void 0 : o.fields.length, f,
|
73
|
-
return /* @__PURE__ */
|
74
|
-
initialValues:
|
75
|
-
onSubmit:
|
75
|
+
}, [o == null ? void 0 : o.fields.length, f, a, l, i, d, e, n]);
|
76
|
+
return /* @__PURE__ */ r($, {
|
77
|
+
initialValues: j,
|
78
|
+
onSubmit: B,
|
76
79
|
children: ({
|
77
80
|
values: t,
|
78
|
-
dirty:
|
79
|
-
}) => /* @__PURE__ */ c(
|
80
|
-
children: [/* @__PURE__ */
|
81
|
-
areAiSuggestionsAvailable:
|
82
|
-
className:
|
81
|
+
dirty: _
|
82
|
+
}) => /* @__PURE__ */ c(w, {
|
83
|
+
children: [/* @__PURE__ */ r(N, {
|
84
|
+
areAiSuggestionsAvailable: M,
|
85
|
+
className: h.metadataInstanceForm,
|
83
86
|
formRef: g,
|
84
87
|
formValues: t,
|
85
|
-
getAiSuggestions:
|
86
|
-
handleCancel:
|
87
|
-
handleDelete:
|
88
|
+
getAiSuggestions: R,
|
89
|
+
handleCancel: K,
|
90
|
+
handleDelete: W,
|
88
91
|
isAiSuggestionsFeatureEnabled: n,
|
89
|
-
isBetaLanguageEnabled:
|
90
|
-
isDeleteButtonDisabled:
|
91
|
-
isFetchingSuggestions:
|
92
|
-
isFormDirty:
|
92
|
+
isBetaLanguageEnabled: y,
|
93
|
+
isDeleteButtonDisabled: D,
|
94
|
+
isFetchingSuggestions: a,
|
95
|
+
isFormDirty: _,
|
96
|
+
isLargeFile: E,
|
93
97
|
selectedTemplateInstance: o,
|
94
|
-
suggestions:
|
95
|
-
children: o &&
|
96
|
-
}), /* @__PURE__ */
|
98
|
+
suggestions: U,
|
99
|
+
children: o && V
|
100
|
+
}), /* @__PURE__ */ r(Y, {
|
97
101
|
onBackToEdit: () => s(!1),
|
98
|
-
onDiscardChanges:
|
99
|
-
open:
|
100
|
-
}), /* @__PURE__ */
|
101
|
-
onConfirm: () =>
|
102
|
+
onDiscardChanges: L,
|
103
|
+
open: b
|
104
|
+
}), /* @__PURE__ */ r(I, {
|
105
|
+
onConfirm: () => v(o),
|
102
106
|
onDismiss: () => m(!1),
|
103
|
-
open:
|
107
|
+
open: P,
|
104
108
|
templateName: o == null ? void 0 : o.displayName
|
105
109
|
})]
|
106
110
|
})
|
107
111
|
}, `${o == null ? void 0 : o.scope}.${o == null ? void 0 : o.templateKey}`);
|
108
112
|
};
|
109
113
|
export {
|
110
|
-
|
114
|
+
Co as MetadataInstanceForm
|
111
115
|
};
|
@@ -1,18 +1,10 @@
|
|
1
|
-
import { d as
|
2
|
-
const
|
1
|
+
import { d as a } from "../../../../../../chunks/index.js";
|
2
|
+
const e = a({
|
3
3
|
customInstanceTitle: {
|
4
4
|
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.customInstanceTitle",
|
5
5
|
defaultMessage: "Custom Metadata"
|
6
|
-
},
|
7
|
-
aiSuggestionNoticeHeader: {
|
8
|
-
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.aiSuggestionNoticeHeader",
|
9
|
-
defaultMessage: "AI Autofill is in Beta"
|
10
|
-
},
|
11
|
-
aiSuggestionNoticeBody: {
|
12
|
-
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.aiSuggestionNoticeBody",
|
13
|
-
defaultMessage: "Please check responses before saving."
|
14
6
|
}
|
15
7
|
});
|
16
8
|
export {
|
17
|
-
|
9
|
+
e as default
|
18
10
|
};
|
@@ -1,50 +1,41 @@
|
|
1
|
-
import { u as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { jsxs as
|
7
|
-
import '../../../../../../styles/metadata-instance-form-header.css';const
|
8
|
-
metadataInstanceFormHeader:
|
1
|
+
import { u as F } from "../../../../../../chunks/index.js";
|
2
|
+
import p from "../../../interactive-header-text/interactive-header-text.js";
|
3
|
+
import { MetadataInstanceFormAutofillButton as x } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
4
|
+
import H from "./messages.js";
|
5
|
+
import { MetadataInstanceFormInlineNotice as _ } from "../metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js";
|
6
|
+
import { jsxs as r, Fragment as u, jsx as t } from "react/jsx-runtime";
|
7
|
+
import '../../../../../../styles/metadata-instance-form-header.css';const M = "_metadataInstanceFormHeader_13lxr_1", N = "_title_13lxr_9", o = {
|
8
|
+
metadataInstanceFormHeader: M,
|
9
9
|
title: N
|
10
|
-
},
|
11
|
-
areAiSuggestionsAvailable:
|
12
|
-
hasSuggestions:
|
13
|
-
isAiSuggestionsFeatureEnabled:
|
14
|
-
isBetaLanguageEnabled:
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
}, k = ({
|
11
|
+
areAiSuggestionsAvailable: e,
|
12
|
+
hasSuggestions: n,
|
13
|
+
isAiSuggestionsFeatureEnabled: m,
|
14
|
+
isBetaLanguageEnabled: a,
|
15
|
+
isLargeFile: s,
|
16
|
+
isLoading: c,
|
17
|
+
templateName: i,
|
18
|
+
onAutofill: l
|
18
19
|
}) => {
|
19
|
-
const
|
20
|
-
return /* @__PURE__ */
|
21
|
-
children: [/* @__PURE__ */
|
22
|
-
className:
|
23
|
-
children: [/* @__PURE__ */
|
24
|
-
className:
|
20
|
+
const d = F(), I = i ?? d.formatMessage(H.customInstanceTitle), f = n && e;
|
21
|
+
return /* @__PURE__ */ r(u, {
|
22
|
+
children: [/* @__PURE__ */ r("div", {
|
23
|
+
className: o.metadataInstanceFormHeader,
|
24
|
+
children: [/* @__PURE__ */ t(p, {
|
25
|
+
className: o.title,
|
25
26
|
title: I
|
26
|
-
}),
|
27
|
-
areAiSuggestionsAvailable:
|
28
|
-
isBetaLanguageEnabled:
|
29
|
-
isLoading:
|
30
|
-
onAutofill:
|
27
|
+
}), m ? /* @__PURE__ */ t(x, {
|
28
|
+
areAiSuggestionsAvailable: e,
|
29
|
+
isBetaLanguageEnabled: a,
|
30
|
+
isLoading: c,
|
31
|
+
onAutofill: l
|
31
32
|
}) : null]
|
32
|
-
}),
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
children: [/* @__PURE__ */ o(s, {
|
37
|
-
as: "p",
|
38
|
-
variant: "bodyDefaultBold",
|
39
|
-
children: t.formatMessage(e.aiSuggestionNoticeHeader)
|
40
|
-
}), /* @__PURE__ */ a(s, {
|
41
|
-
as: "p",
|
42
|
-
children: [t.formatMessage(e.aiSuggestionNoticeBody), " "]
|
43
|
-
})]
|
44
|
-
})
|
45
|
-
}) : null]
|
33
|
+
}), f && /* @__PURE__ */ t(_, {
|
34
|
+
isBetaLanguageEnabled: a,
|
35
|
+
isLargeFile: s
|
36
|
+
})]
|
46
37
|
});
|
47
38
|
};
|
48
39
|
export {
|
49
|
-
|
40
|
+
k as MetadataInstanceFormHeader
|
50
41
|
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { d as e } from "../../../../../../chunks/index.js";
|
2
|
+
const t = e({
|
3
|
+
autofillInBetaNoticeHeader: {
|
4
|
+
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeHeader",
|
5
|
+
defaultMessage: "AI Autofill is in Beta"
|
6
|
+
},
|
7
|
+
autofillInBetaNoticeBody: {
|
8
|
+
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillInBetaNoticeBody",
|
9
|
+
defaultMessage: "Please check responses before saving."
|
10
|
+
},
|
11
|
+
largeFileNoticeHeader: {
|
12
|
+
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeHeader",
|
13
|
+
defaultMessage: "Text content is too large"
|
14
|
+
},
|
15
|
+
largeFileNoticeBody: {
|
16
|
+
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.largeFileNoticeBody",
|
17
|
+
defaultMessage: "Box AI won’t be able to access the full text, which may impact metadata values"
|
18
|
+
}
|
19
|
+
});
|
20
|
+
export {
|
21
|
+
t as default
|
22
|
+
};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { u as c } from "../../../../../../chunks/index.js";
|
2
|
+
import { InlineNotice as l, Text as t } from "@box/blueprint-web";
|
3
|
+
import a from "./messages.js";
|
4
|
+
import { jsxs as i, Fragment as d, jsx as n } from "react/jsx-runtime";
|
5
|
+
import '../../../../../../styles/metadata-instance-form-inline-notice.css';const m = "_inlineNotice_j1wao_1", s = {
|
6
|
+
inlineNotice: m
|
7
|
+
}, p = ({
|
8
|
+
isLargeFile: o,
|
9
|
+
isBetaLanguageEnabled: r
|
10
|
+
}) => {
|
11
|
+
const e = c();
|
12
|
+
return !r && !o ? null : /* @__PURE__ */ i(d, {
|
13
|
+
children: [o && /* @__PURE__ */ n("div", {
|
14
|
+
className: s.inlineNotice,
|
15
|
+
children: /* @__PURE__ */ i(l, {
|
16
|
+
variant: "warning",
|
17
|
+
variantIconAriaLabel: e.formatMessage(a.largeFileNoticeHeader),
|
18
|
+
children: [/* @__PURE__ */ n(t, {
|
19
|
+
as: "p",
|
20
|
+
variant: "bodyDefaultBold",
|
21
|
+
children: e.formatMessage(a.largeFileNoticeHeader)
|
22
|
+
}), /* @__PURE__ */ i(t, {
|
23
|
+
as: "p",
|
24
|
+
children: [e.formatMessage(a.largeFileNoticeBody), " "]
|
25
|
+
})]
|
26
|
+
})
|
27
|
+
}), r && /* @__PURE__ */ n("div", {
|
28
|
+
className: s.inlineNotice,
|
29
|
+
children: /* @__PURE__ */ i(l, {
|
30
|
+
variant: "info",
|
31
|
+
variantIconAriaLabel: e.formatMessage(a.autofillInBetaNoticeHeader),
|
32
|
+
children: [/* @__PURE__ */ n(t, {
|
33
|
+
as: "p",
|
34
|
+
variant: "bodyDefaultBold",
|
35
|
+
children: e.formatMessage(a.autofillInBetaNoticeHeader)
|
36
|
+
}), /* @__PURE__ */ i(t, {
|
37
|
+
as: "p",
|
38
|
+
children: [e.formatMessage(a.autofillInBetaNoticeBody), " "]
|
39
|
+
})]
|
40
|
+
})
|
41
|
+
})]
|
42
|
+
});
|
43
|
+
};
|
44
|
+
export {
|
45
|
+
p as MetadataInstanceFormInlineNotice
|
46
|
+
};
|