@box/metadata-editor 0.86.1 → 0.87.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/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +31 -29
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +62 -60
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +6 -2
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +34 -33
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +32 -30
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +21 -20
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +4 -0
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +20 -19
- package/i18n/bn-IN.js +2 -0
- package/i18n/da-DK.js +2 -0
- package/i18n/de-DE.js +2 -0
- package/i18n/en-AU.js +2 -0
- package/i18n/en-CA.js +2 -0
- package/i18n/en-GB.js +2 -0
- package/i18n/en-US.js +2 -0
- package/i18n/en-US.properties +4 -0
- package/i18n/en-x-pseudo.js +113 -111
- package/i18n/en-x-pseudo.properties +111 -111
- package/i18n/es-419.js +2 -0
- package/i18n/es-ES.js +2 -0
- package/i18n/fi-FI.js +2 -0
- package/i18n/fr-CA.js +2 -0
- package/i18n/fr-FR.js +2 -0
- package/i18n/hi-IN.js +2 -0
- package/i18n/it-IT.js +2 -0
- package/i18n/ja-JP.js +6 -4
- package/i18n/ja-JP.properties +4 -4
- package/i18n/json/src/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.json +1 -1
- package/i18n/json/src/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.json +1 -1
- package/i18n/ko-KR.js +2 -0
- package/i18n/nb-NO.js +2 -0
- package/i18n/nl-NL.js +2 -0
- package/i18n/pl-PL.js +2 -0
- package/i18n/pt-BR.js +2 -0
- package/i18n/ru-RU.js +2 -0
- package/i18n/sv-SE.js +2 -0
- package/i18n/tr-TR.js +2 -0
- package/i18n/zh-CN.js +2 -0
- package/i18n/zh-TW.js +2 -0
- package/package.json +2 -2
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +2 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.d.ts +5 -0
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/types.d.ts +1 -0
- 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-list/subcomponents/metadata-instance-header/messages.d.ts +5 -0
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.d.ts +1 -1
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/types.d.ts +1 -0
@@ -1,42 +1,44 @@
|
|
1
|
-
import { Card as
|
1
|
+
import { Card as E } from "@box/blueprint-web";
|
2
2
|
import { TEMPLATE_CUSTOM_PROPERTIES as h } from "../../../../constants.js";
|
3
3
|
import { MetadataInstanceFormFooter as C } from "../metadata-instance-form-footer/metadata-instance-form-footer.js";
|
4
|
-
import { MetadataInstanceFormHeader as
|
5
|
-
import { jsxs as
|
6
|
-
const
|
4
|
+
import { MetadataInstanceFormHeader as M } from "../metadata-instance-form-header/metadata-instance-form-header.js";
|
5
|
+
import { jsxs as b, jsx as i } from "react/jsx-runtime";
|
6
|
+
const N = (t) => {
|
7
7
|
const {
|
8
|
-
areAiSuggestionsAvailable:
|
9
|
-
children:
|
8
|
+
areAiSuggestionsAvailable: e,
|
9
|
+
children: r,
|
10
10
|
className: s,
|
11
11
|
formRef: n,
|
12
12
|
isAiSuggestionsFeatureEnabled: g,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
iaBetaLanguageEnabled: m,
|
14
|
+
isDeleteButtonDisabled: u,
|
15
|
+
suggestions: d,
|
16
|
+
isFetchingSuggestions: o,
|
17
|
+
isFormDirty: l = !1,
|
18
|
+
selectedTemplateInstance: a,
|
19
|
+
getAiSuggestions: f,
|
20
|
+
handleCancel: F,
|
21
|
+
handleDelete: S
|
22
|
+
} = t, p = (a == null ? void 0 : a.templateKey) === h, A = !!d[a == null ? void 0 : a.templateKey];
|
23
|
+
return /* @__PURE__ */ b(E, {
|
23
24
|
ref: n,
|
24
25
|
className: s,
|
25
|
-
children: [/* @__PURE__ */
|
26
|
-
areAiSuggestionsAvailable:
|
27
|
-
hasSuggestions:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
children: [/* @__PURE__ */ i(M, {
|
27
|
+
areAiSuggestionsAvailable: e,
|
28
|
+
hasSuggestions: A,
|
29
|
+
iaBetaLanguageEnabled: m,
|
30
|
+
isAiSuggestionsFeatureEnabled: g && !p,
|
31
|
+
isLoading: o,
|
32
|
+
onAutofill: f,
|
33
|
+
templateName: a == null ? void 0 : a.displayName
|
34
|
+
}), a && r, /* @__PURE__ */ i(C, {
|
35
|
+
isDeleteButtonDisabled: u,
|
36
|
+
isLoading: o,
|
37
|
+
onCancel: () => F(l),
|
38
|
+
onDelete: S
|
37
39
|
})]
|
38
40
|
});
|
39
41
|
};
|
40
42
|
export {
|
41
|
-
|
43
|
+
N as MetadataInstanceFormCardWrapper
|
42
44
|
};
|
@@ -1,103 +1,105 @@
|
|
1
|
-
import { Formik as
|
1
|
+
import { Formik as L, Form as W } from "formik";
|
2
2
|
import { useState as d, useEffect as p, useRef as j, useMemo as k } from "react";
|
3
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
4
|
-
import { useAutofill as
|
5
|
-
import { TemplateInstance as
|
6
|
-
import { MetadataEmptyState as
|
7
|
-
import { UnsavedChangesModal as
|
8
|
-
import { CustomInstance as
|
9
|
-
import { DeleteConfirmationModal as
|
10
|
-
import { c as
|
11
|
-
import { MetadataInstanceFormCardWrapper as
|
12
|
-
import { jsx as a, jsxs as
|
13
|
-
import '../../../../../../styles/metadata-instance-form.css';const
|
14
|
-
metadataInstanceForm:
|
15
|
-
},
|
3
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as V } from "../../../../constants.js";
|
4
|
+
import { useAutofill as $ } from "../../../../utils/autofill-context.js";
|
5
|
+
import { TemplateInstance as w } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
6
|
+
import { MetadataEmptyState as J } from "../../../metadata-empty-state/metadata-empty-state.js";
|
7
|
+
import { UnsavedChangesModal as q } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
|
8
|
+
import { CustomInstance as z } from "../custom-instance/custom-instance.js";
|
9
|
+
import { DeleteConfirmationModal as G } from "../delete-confirmation-modal/delete-confirmation-modal.js";
|
10
|
+
import { c as H } from "../../../../../../chunks/utils.js";
|
11
|
+
import { MetadataInstanceFormCardWrapper as Q } from "./metadata-instance-form-card-wrapper.js";
|
12
|
+
import { jsx as a, jsxs as X } from "react/jsx-runtime";
|
13
|
+
import '../../../../../../styles/metadata-instance-form.css';const Y = "_metadataInstanceForm_1hu4u_1", Z = {
|
14
|
+
metadataInstanceForm: Y
|
15
|
+
}, fo = (c) => {
|
16
16
|
const {
|
17
17
|
areAiSuggestionsAvailable: h,
|
18
18
|
customRef: r,
|
19
|
-
isAiSuggestionsFeatureEnabled:
|
20
|
-
|
21
|
-
|
19
|
+
isAiSuggestionsFeatureEnabled: i,
|
20
|
+
iaBetaLanguageEnabled: C,
|
21
|
+
isDeleteButtonDisabled: F,
|
22
|
+
isUnsavedChangesModalOpen: E = !1,
|
22
23
|
MetadataInstanceFormCustomWrapper: M,
|
23
24
|
selectedTemplateInstance: o,
|
24
25
|
onCancel: S,
|
25
|
-
onDelete:
|
26
|
-
onDiscardUnsavedChanges:
|
27
|
-
onSubmit:
|
28
|
-
setIsUnsavedChangesModalOpen:
|
26
|
+
onDelete: D,
|
27
|
+
onDiscardUnsavedChanges: y,
|
28
|
+
onSubmit: b,
|
29
|
+
setIsUnsavedChangesModalOpen: s,
|
29
30
|
taxonomyOptionsFetcher: e
|
30
|
-
} = c,
|
31
|
+
} = c, O = M ?? Q, [A, m] = d(!1), {
|
31
32
|
isFetchingSuggestions: n,
|
32
|
-
getAiSuggestions:
|
33
|
+
getAiSuggestions: v,
|
33
34
|
clearSuggestions: u,
|
34
|
-
suggestions:
|
35
|
-
} =
|
35
|
+
suggestions: x
|
36
|
+
} = $();
|
36
37
|
p(() => () => {
|
37
38
|
u();
|
38
39
|
}, [u]);
|
39
|
-
const f = (o == null ? void 0 : o.templateKey) ===
|
40
|
-
await
|
41
|
-
},
|
42
|
-
t ?
|
43
|
-
},
|
40
|
+
const f = (o == null ? void 0 : o.templateKey) === V, P = async (t) => {
|
41
|
+
await b(t, H(t, o));
|
42
|
+
}, R = (t) => {
|
43
|
+
t ? s(!0) : S();
|
44
|
+
}, U = () => {
|
44
45
|
m(!0);
|
45
|
-
},
|
46
|
+
}, _ = {
|
46
47
|
metadata: {
|
47
48
|
...o
|
48
49
|
}
|
49
|
-
}, l = j(null), [g,
|
50
|
+
}, l = j(null), [g, B] = d(null);
|
50
51
|
p(() => {
|
51
|
-
|
52
|
+
B(r ?? l.current);
|
52
53
|
}, [r, o == null ? void 0 : o.templateKey, o == null ? void 0 : o.scope]);
|
53
54
|
const N = k(() => {
|
54
55
|
const t = (o == null ? void 0 : o.fields.length) === 0;
|
55
|
-
return f ? /* @__PURE__ */ a(
|
56
|
+
return f ? /* @__PURE__ */ a(z, {
|
56
57
|
isLoading: n
|
57
|
-
}) : t ? /* @__PURE__ */ a(
|
58
|
-
isBoxAiSuggestionsFeatureEnabled:
|
58
|
+
}) : t ? /* @__PURE__ */ a(J, {
|
59
|
+
isBoxAiSuggestionsFeatureEnabled: i,
|
59
60
|
level: "instance"
|
60
|
-
}) : /* @__PURE__ */ a(
|
61
|
+
}) : /* @__PURE__ */ a(w, {
|
61
62
|
disableForm: n,
|
62
63
|
portalElement: r ?? g,
|
63
64
|
taxonomyOptionsFetcher: e
|
64
65
|
});
|
65
|
-
}, [o == null ? void 0 : o.fields.length, f, n, r, g, e,
|
66
|
-
return /* @__PURE__ */ a(
|
67
|
-
initialValues:
|
68
|
-
onSubmit:
|
66
|
+
}, [o == null ? void 0 : o.fields.length, f, n, r, g, e, i]);
|
67
|
+
return /* @__PURE__ */ a(L, {
|
68
|
+
initialValues: _,
|
69
|
+
onSubmit: P,
|
69
70
|
children: ({
|
70
71
|
values: t,
|
71
|
-
dirty:
|
72
|
-
}) => /* @__PURE__ */
|
73
|
-
children: [/* @__PURE__ */ a(
|
72
|
+
dirty: K
|
73
|
+
}) => /* @__PURE__ */ X(W, {
|
74
|
+
children: [/* @__PURE__ */ a(O, {
|
74
75
|
areAiSuggestionsAvailable: h,
|
75
|
-
className:
|
76
|
+
className: Z.metadataInstanceForm,
|
76
77
|
formRef: l,
|
77
78
|
formValues: t,
|
78
|
-
getAiSuggestions:
|
79
|
-
handleCancel:
|
80
|
-
handleDelete:
|
81
|
-
|
82
|
-
|
79
|
+
getAiSuggestions: v,
|
80
|
+
handleCancel: R,
|
81
|
+
handleDelete: U,
|
82
|
+
iaBetaLanguageEnabled: C,
|
83
|
+
isAiSuggestionsFeatureEnabled: i,
|
84
|
+
isDeleteButtonDisabled: F,
|
83
85
|
isFetchingSuggestions: n,
|
84
|
-
isFormDirty:
|
86
|
+
isFormDirty: K,
|
85
87
|
selectedTemplateInstance: o,
|
86
|
-
suggestions:
|
88
|
+
suggestions: x,
|
87
89
|
children: o && N
|
88
|
-
}), /* @__PURE__ */ a(
|
89
|
-
onBackToEdit: () =>
|
90
|
-
onDiscardChanges:
|
91
|
-
open:
|
92
|
-
}), /* @__PURE__ */ a(
|
93
|
-
onConfirm: () =>
|
90
|
+
}), /* @__PURE__ */ a(q, {
|
91
|
+
onBackToEdit: () => s(!1),
|
92
|
+
onDiscardChanges: y,
|
93
|
+
open: E
|
94
|
+
}), /* @__PURE__ */ a(G, {
|
95
|
+
onConfirm: () => D(o),
|
94
96
|
onDismiss: () => m(!1),
|
95
|
-
open:
|
97
|
+
open: A,
|
96
98
|
templateName: o == null ? void 0 : o.displayName
|
97
99
|
})]
|
98
100
|
})
|
99
101
|
}, `${o == null ? void 0 : o.scope}.${o == null ? void 0 : o.templateKey}`);
|
100
102
|
};
|
101
103
|
export {
|
102
|
-
|
104
|
+
fo as MetadataInstanceForm
|
103
105
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { d as
|
2
|
-
const e =
|
1
|
+
import { d as t } from "../../../../../../chunks/index.js";
|
2
|
+
const e = t({
|
3
3
|
autofillButton: {
|
4
4
|
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButton",
|
5
5
|
defaultMessage: "Autofill"
|
@@ -12,6 +12,10 @@ const e = a({
|
|
12
12
|
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButtonTooltip",
|
13
13
|
defaultMessage: "Autofill with Box AI (Beta)"
|
14
14
|
},
|
15
|
+
autofillButtonTooltipGA: {
|
16
|
+
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButtonTooltipGA",
|
17
|
+
defaultMessage: "Autofill with Box AI"
|
18
|
+
},
|
15
19
|
loadingButtonAriaLabel: {
|
16
20
|
id: "metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.loadingButtonAriaLabel",
|
17
21
|
defaultMessage: "Loading..."
|
@@ -1,65 +1,66 @@
|
|
1
|
-
import { LoadingIndicator as
|
1
|
+
import { LoadingIndicator as v, IconButton as L, Tooltip as k, Button as x } from "@box/blueprint-web";
|
2
2
|
import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
|
3
|
-
import { useFormikContext as
|
4
|
-
import { useEffect as
|
5
|
-
import { u as
|
6
|
-
import { useAutofill as
|
7
|
-
import
|
3
|
+
import { useFormikContext as K, getIn as i } from "formik";
|
4
|
+
import { useEffect as h } from "react";
|
5
|
+
import { u as C } from "../../../../../../chunks/index.js";
|
6
|
+
import { useAutofill as F } from "../../../../utils/autofill-context.js";
|
7
|
+
import o from "./messages.js";
|
8
8
|
import { jsx as l } from "react/jsx-runtime";
|
9
|
-
import '../../../../../../styles/metadata-instance-form-autofill-button.css';const
|
10
|
-
loadingIndicator:
|
9
|
+
import '../../../../../../styles/metadata-instance-form-autofill-button.css';const T = "_loadingIndicator_1vv9u_1", _ = {
|
10
|
+
loadingIndicator: T
|
11
11
|
}, w = ({
|
12
12
|
areAiSuggestionsAvailable: B,
|
13
|
+
iaBetaLanguageEnabled: b,
|
13
14
|
isLoading: r,
|
14
|
-
variant:
|
15
|
+
variant: A = "secondary-button",
|
15
16
|
onAutofill: I
|
16
17
|
}) => {
|
17
18
|
const {
|
18
19
|
isSubmitting: y,
|
19
20
|
values: e,
|
20
|
-
setFieldValue:
|
21
|
-
} =
|
22
|
-
suggestions:
|
23
|
-
} =
|
24
|
-
|
25
|
-
if (
|
26
|
-
const
|
27
|
-
|
21
|
+
setFieldValue: c
|
22
|
+
} = K(), t = C(), {
|
23
|
+
suggestions: a
|
24
|
+
} = F();
|
25
|
+
h(() => {
|
26
|
+
if (a) {
|
27
|
+
const n = i(e, "metadata.fields"), s = i(e, "metadata.templateKey");
|
28
|
+
c("metadata.fields", n == null ? void 0 : n.map((u) => {
|
28
29
|
var g;
|
29
|
-
const f = (g =
|
30
|
+
const f = (g = a == null ? void 0 : a[s]) == null ? void 0 : g[u.key];
|
30
31
|
return f ? {
|
31
|
-
...
|
32
|
+
...u,
|
32
33
|
aiSuggestion: f
|
33
|
-
} :
|
34
|
+
} : u;
|
34
35
|
}));
|
35
36
|
}
|
36
|
-
}, [
|
37
|
+
}, [a, c]);
|
37
38
|
const m = () => {
|
38
|
-
const
|
39
|
-
I(
|
40
|
-
}, d = !B || y || r,
|
41
|
-
"aria-label": t.formatMessage(
|
39
|
+
const n = i(e, "metadata.templateKey"), s = i(e, "metadata.scope");
|
40
|
+
I(n, s);
|
41
|
+
}, d = !B || y || r, M = r ? /* @__PURE__ */ l(v, {
|
42
|
+
"aria-label": t.formatMessage(o.loadingButtonAriaLabel),
|
42
43
|
className: _.loadingIndicator
|
43
|
-
}) : /* @__PURE__ */ l(
|
44
|
-
"aria-label": t.formatMessage(
|
44
|
+
}) : /* @__PURE__ */ l(L, {
|
45
|
+
"aria-label": t.formatMessage(o.autofillButtonAriaLabel),
|
45
46
|
disabled: d,
|
46
47
|
icon: p,
|
47
48
|
onClick: m,
|
48
49
|
variant: "icon-logo",
|
49
50
|
"data-target-id": "IconButton-autofillButtonAriaLabel"
|
50
51
|
});
|
51
|
-
return /* @__PURE__ */ l(
|
52
|
-
content: t.formatMessage(
|
53
|
-
children:
|
52
|
+
return /* @__PURE__ */ l(k, {
|
53
|
+
content: b ? t.formatMessage(o.autofillButtonTooltip) : t.formatMessage(o.autofillButtonTooltipGA),
|
54
|
+
children: A === "secondary-button" ? /* @__PURE__ */ l(x, {
|
54
55
|
disabled: d,
|
55
56
|
icon: p,
|
56
57
|
loading: r,
|
57
|
-
loadingAriaLabel: t.formatMessage(
|
58
|
+
loadingAriaLabel: t.formatMessage(o.loadingButtonAriaLabel),
|
58
59
|
onClick: m,
|
59
60
|
variant: "secondary",
|
60
61
|
"data-target-id": "Button-autofillButton",
|
61
|
-
children: t.formatMessage(
|
62
|
-
}) :
|
62
|
+
children: t.formatMessage(o.autofillButton)
|
63
|
+
}) : M
|
63
64
|
});
|
64
65
|
};
|
65
66
|
export {
|
@@ -1,41 +1,43 @@
|
|
1
|
-
import { u } from "../../../../../../chunks/index.js";
|
2
|
-
import { InlineNotice as
|
3
|
-
import
|
4
|
-
import { MetadataInstanceFormAutofillButton as
|
1
|
+
import { u as p } from "../../../../../../chunks/index.js";
|
2
|
+
import { InlineNotice as g, Text as s } from "@box/blueprint-web";
|
3
|
+
import h from "../../../interactive-header-text/interactive-header-text.js";
|
4
|
+
import { MetadataInstanceFormAutofillButton as H } from "../metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js";
|
5
5
|
import e from "./messages.js";
|
6
|
-
import { jsxs as a, Fragment as
|
7
|
-
import '../../../../../../styles/metadata-instance-form-header.css';const
|
8
|
-
metadataInstanceFormHeader:
|
9
|
-
title:
|
10
|
-
},
|
11
|
-
areAiSuggestionsAvailable:
|
12
|
-
hasSuggestions:
|
13
|
-
isAiSuggestionsFeatureEnabled:
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
import { jsxs as a, Fragment as x, jsx as o } from "react/jsx-runtime";
|
7
|
+
import '../../../../../../styles/metadata-instance-form-header.css';const F = "_metadataInstanceFormHeader_13lxr_1", N = "_title_13lxr_9", i = {
|
8
|
+
metadataInstanceFormHeader: F,
|
9
|
+
title: N
|
10
|
+
}, j = ({
|
11
|
+
areAiSuggestionsAvailable: r,
|
12
|
+
hasSuggestions: m,
|
13
|
+
isAiSuggestionsFeatureEnabled: c,
|
14
|
+
iaBetaLanguageEnabled: n,
|
15
|
+
isLoading: l,
|
16
|
+
templateName: d,
|
17
|
+
onAutofill: f
|
17
18
|
}) => {
|
18
|
-
const t =
|
19
|
-
return /* @__PURE__ */ a(
|
19
|
+
const t = p(), I = d ?? t.formatMessage(e.customInstanceTitle), u = m && r && n;
|
20
|
+
return /* @__PURE__ */ a(x, {
|
20
21
|
children: [/* @__PURE__ */ a("div", {
|
21
|
-
className:
|
22
|
-
children: [/* @__PURE__ */
|
23
|
-
className:
|
24
|
-
title:
|
25
|
-
}),
|
26
|
-
areAiSuggestionsAvailable:
|
27
|
-
|
28
|
-
|
22
|
+
className: i.metadataInstanceFormHeader,
|
23
|
+
children: [/* @__PURE__ */ o(h, {
|
24
|
+
className: i.title,
|
25
|
+
title: I
|
26
|
+
}), c ? /* @__PURE__ */ o(H, {
|
27
|
+
areAiSuggestionsAvailable: r,
|
28
|
+
iaBetaLanguageEnabled: n,
|
29
|
+
isLoading: l,
|
30
|
+
onAutofill: f
|
29
31
|
}) : null]
|
30
|
-
}),
|
31
|
-
children: /* @__PURE__ */ a(
|
32
|
+
}), u ? /* @__PURE__ */ o("div", {
|
33
|
+
children: /* @__PURE__ */ a(g, {
|
32
34
|
variant: "info",
|
33
35
|
variantIconAriaLabel: t.formatMessage(e.aiSuggestionNoticeHeader),
|
34
|
-
children: [/* @__PURE__ */
|
36
|
+
children: [/* @__PURE__ */ o(s, {
|
35
37
|
as: "p",
|
36
38
|
variant: "bodyDefaultBold",
|
37
39
|
children: t.formatMessage(e.aiSuggestionNoticeHeader)
|
38
|
-
}), /* @__PURE__ */ a(
|
40
|
+
}), /* @__PURE__ */ a(s, {
|
39
41
|
as: "p",
|
40
42
|
children: [t.formatMessage(e.aiSuggestionNoticeBody), " "]
|
41
43
|
})]
|
@@ -44,5 +46,5 @@ import '../../../../../../styles/metadata-instance-form-header.css';const x = "_
|
|
44
46
|
});
|
45
47
|
};
|
46
48
|
export {
|
47
|
-
|
49
|
+
j as MetadataInstanceFormHeader
|
48
50
|
};
|
@@ -1,58 +1,59 @@
|
|
1
1
|
import { Card as A, Divider as u } from "@box/blueprint-web";
|
2
2
|
import { useState as D } from "react";
|
3
|
-
import { useAutofill as
|
3
|
+
import { useAutofill as g } from "../../../../utils/autofill-context.js";
|
4
4
|
import { MetadataEmptyState as b } from "../../../metadata-empty-state/metadata-empty-state.js";
|
5
|
-
import { MetadataInstanceContent as
|
5
|
+
import { MetadataInstanceContent as S } from "../metadata-instance-content/metadata-instance-content.js";
|
6
6
|
import { MetadataInstanceFooter as H } from "../metadata-instance-footer/metadata-instance-footer.js";
|
7
7
|
import { MetadataInstanceHeader as _ } from "../metadata-instance-header/metadata-instance-header.js";
|
8
|
-
import { jsxs as
|
8
|
+
import { jsxs as s, jsx as t, Fragment as n } from "react/jsx-runtime";
|
9
9
|
import '../../../../../../styles/metadata-instance.css';const M = "_topDivider_tzhlb_1", N = "_bottomDivider_tzhlb_5", y = {
|
10
10
|
topDivider: M,
|
11
11
|
bottomDivider: N
|
12
|
-
},
|
12
|
+
}, L = ({
|
13
13
|
areAiSuggestionsAvailable: p,
|
14
14
|
isAiSuggestionsFeatureEnabled: d,
|
15
15
|
onEdit: l,
|
16
16
|
templateInstance: o,
|
17
|
-
taxonomyNodeFetcher:
|
17
|
+
taxonomyNodeFetcher: E
|
18
18
|
}) => {
|
19
|
-
const
|
19
|
+
const e = o.fields, m = (r) => !r.value || Array.isArray(r.value) && r.value.length === 0, c = e.every(m), h = e.some(m), v = e.length > 0, [i, a] = D(!0), {
|
20
20
|
getAiSuggestions: f
|
21
|
-
} =
|
21
|
+
} = g(), V = () => {
|
22
22
|
l(o), f(o.templateKey, o.scope);
|
23
23
|
};
|
24
|
-
return /* @__PURE__ */
|
24
|
+
return /* @__PURE__ */ s(A, {
|
25
25
|
children: [/* @__PURE__ */ t(_, {
|
26
26
|
areAiSuggestionsAvailable: p,
|
27
27
|
canEdit: o.canEdit,
|
28
|
+
iaBetaLanguageEnabled: !1,
|
28
29
|
isAiSuggestionsFeatureEnabled: d,
|
29
30
|
onAutofill: V,
|
30
31
|
onEdit: () => l(o),
|
31
32
|
templateName: o == null ? void 0 : o.displayName
|
32
33
|
}), /* @__PURE__ */ t(u, {
|
33
34
|
className: y.topDivider
|
34
|
-
}),
|
35
|
-
isAnyEmptyValueHidden:
|
35
|
+
}), i && c ? /* @__PURE__ */ t(b, {
|
36
|
+
isAnyEmptyValueHidden: v,
|
36
37
|
isBoxAiSuggestionsFeatureEnabled: d,
|
37
38
|
level: "instance",
|
38
|
-
onShowEmptyValues: () =>
|
39
|
-
}) : /* @__PURE__ */
|
40
|
-
children: [/* @__PURE__ */ t(
|
41
|
-
shouldHideEmptyValues:
|
42
|
-
taxonomyNodeFetcher:
|
39
|
+
onShowEmptyValues: () => a(!1)
|
40
|
+
}) : /* @__PURE__ */ s(n, {
|
41
|
+
children: [/* @__PURE__ */ t(S, {
|
42
|
+
shouldHideEmptyValues: i,
|
43
|
+
taxonomyNodeFetcher: E,
|
43
44
|
templateInstance: o
|
44
|
-
}),
|
45
|
+
}), h && /* @__PURE__ */ s(n, {
|
45
46
|
children: [/* @__PURE__ */ t(u, {
|
46
47
|
className: y.bottomDivider
|
47
48
|
}), /* @__PURE__ */ t(H, {
|
48
|
-
isAnyEmptyValueHidden:
|
49
|
-
onHideEmptyValues: () =>
|
50
|
-
onShowEmptyValues: () =>
|
49
|
+
isAnyEmptyValueHidden: i,
|
50
|
+
onHideEmptyValues: () => a(!0),
|
51
|
+
onShowEmptyValues: () => a(!1)
|
51
52
|
})]
|
52
53
|
})]
|
53
54
|
})]
|
54
55
|
});
|
55
56
|
};
|
56
57
|
export {
|
57
|
-
|
58
|
+
L as MetadataInstance
|
58
59
|
};
|
package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js
CHANGED
@@ -8,6 +8,10 @@ const e = t({
|
|
8
8
|
id: "metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonTooltip",
|
9
9
|
defaultMessage: "Autofill with Box AI (Beta)"
|
10
10
|
},
|
11
|
+
autofillButtonTooltipGA: {
|
12
|
+
id: "metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonTooltipGA",
|
13
|
+
defaultMessage: "Autofill with Box AI"
|
14
|
+
},
|
11
15
|
autofillButtonAriaLabel: {
|
12
16
|
id: "metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonAriaLabel",
|
13
17
|
defaultMessage: "Autofill {templateName} with Box AI"
|
@@ -1,39 +1,40 @@
|
|
1
1
|
import { Tooltip as i, IconButton as s } from "@box/blueprint-web";
|
2
|
-
import { Pencil as
|
2
|
+
import { Pencil as g } from "@box/blueprint-web-assets/icons/Line";
|
3
3
|
import { BoxAiLogo as I } from "@box/blueprint-web-assets/icons/Logo";
|
4
|
-
import { u as
|
5
|
-
import
|
4
|
+
import { u as _ } from "../../../../../../chunks/index.js";
|
5
|
+
import x from "../../../interactive-header-text/interactive-header-text.js";
|
6
6
|
import o from "./messages.js";
|
7
7
|
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
8
|
-
import '../../../../../../styles/metadata-instance-header.css';const
|
9
|
-
metadataInstanceHeader:
|
10
|
-
iconButtonsContainer:
|
11
|
-
title:
|
12
|
-
},
|
8
|
+
import '../../../../../../styles/metadata-instance-header.css';const b = "_metadataInstanceHeader_54pdx_1", A = "_iconButtonsContainer_54pdx_6", M = "_title_54pdx_14", e = {
|
9
|
+
metadataInstanceHeader: b,
|
10
|
+
iconButtonsContainer: A,
|
11
|
+
title: M
|
12
|
+
}, k = ({
|
13
13
|
areAiSuggestionsAvailable: c,
|
14
14
|
canEdit: l,
|
15
15
|
isAiSuggestionsFeatureEnabled: d,
|
16
|
-
|
17
|
-
|
16
|
+
iaBetaLanguageEnabled: m,
|
17
|
+
onEdit: u,
|
18
|
+
onAutofill: f,
|
18
19
|
templateName: n
|
19
20
|
}) => {
|
20
|
-
const t =
|
21
|
+
const t = _(), B = n || t.formatMessage(o.customInstanceTitle), p = d && n;
|
21
22
|
return /* @__PURE__ */ r("div", {
|
22
23
|
className: e.metadataInstanceHeader,
|
23
|
-
children: [/* @__PURE__ */ a(
|
24
|
+
children: [/* @__PURE__ */ a(x, {
|
24
25
|
className: e.title,
|
25
|
-
title:
|
26
|
+
title: B
|
26
27
|
}), l && /* @__PURE__ */ r("div", {
|
27
28
|
className: e.iconButtonsContainer,
|
28
|
-
children: [
|
29
|
-
content: t.formatMessage(o.autofillButtonTooltip),
|
29
|
+
children: [p && /* @__PURE__ */ a(i, {
|
30
|
+
content: m ? t.formatMessage(o.autofillButtonTooltip) : t.formatMessage(o.autofillButtonTooltipGA),
|
30
31
|
children: /* @__PURE__ */ a(s, {
|
31
32
|
"aria-label": t.formatMessage(o.autofillButtonAriaLabel, {
|
32
33
|
templateName: n
|
33
34
|
}),
|
34
35
|
disabled: !c,
|
35
36
|
icon: I,
|
36
|
-
onClick:
|
37
|
+
onClick: f,
|
37
38
|
variant: "icon-logo",
|
38
39
|
"data-target-id": "IconButton-autofillButtonAriaLabel"
|
39
40
|
})
|
@@ -43,8 +44,8 @@ import '../../../../../../styles/metadata-instance-header.css';const x = "_metad
|
|
43
44
|
"aria-label": t.formatMessage(o.editButtonAriaLabel, {
|
44
45
|
templateName: n
|
45
46
|
}),
|
46
|
-
icon:
|
47
|
-
onClick:
|
47
|
+
icon: g,
|
48
|
+
onClick: u,
|
48
49
|
"data-target-id": "IconButton-editButtonAriaLabel"
|
49
50
|
})
|
50
51
|
})]
|
@@ -52,5 +53,5 @@ import '../../../../../../styles/metadata-instance-header.css';const x = "_metad
|
|
52
53
|
});
|
53
54
|
};
|
54
55
|
export {
|
55
|
-
|
56
|
+
k as MetadataInstanceHeader
|
56
57
|
};
|
package/i18n/bn-IN.js
CHANGED
@@ -92,6 +92,7 @@ export default {
|
|
92
92
|
"metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButton": "অটোফিল",
|
93
93
|
"metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButtonAriaLabel": "Box AI দিয়ে অটোফিল করুন",
|
94
94
|
"metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButtonTooltip": "Box AI দিয়ে অটোফিল করুন (বিটা)",
|
95
|
+
"metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.autofillButtonTooltipGA": "Autofill with Box AI",
|
95
96
|
"metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.customInstanceTitle": "কাস্টম মেটাডেটা",
|
96
97
|
"metadataEditor.metadataInstanceEditor.metadataInstanceFormHeader.loadingButtonAriaLabel": "লোড করা হচ্ছে...",
|
97
98
|
"metadataEditor.unsavedChangesModal.body": "মেটাডেটা টেমপ্লেট(গুলো) পরিবর্তন আনসেভ করেছে। আপনি কীভাবে এগিয়ে যেতে চান?",
|
@@ -103,6 +104,7 @@ export default {
|
|
103
104
|
"metadataEditor.viewInstance.metadataInstanceFooter.showEmptyValuesCTA": "খালি মান দেখান",
|
104
105
|
"metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonAriaLabel": "Box AI দিয়ে {templateName} অটোফিল করুন",
|
105
106
|
"metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonTooltip": "Box AI দিয়ে অটোফিল করুন (বিটা)",
|
107
|
+
"metadataEditor.viewInstance.metadataInstanceHeader.autofillButtonTooltipGA": "Autofill with Box AI",
|
106
108
|
"metadataEditor.viewInstance.metadataInstanceHeader.customMetadataTitle": "কাস্টম মেটাডেটা",
|
107
109
|
"metadataEditor.viewInstance.metadataInstanceHeader.editButtonAriaLabel": "{templateName} এডিট করুন",
|
108
110
|
"metadataEditor.viewInstance.metadataInstanceHeader.editButtonTooltip": "সম্পাদনা করুন",
|