@box/box-ai-content-answers 0.123.1 → 0.124.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/dist/esm/index.js +15 -13
- package/dist/esm/lib/components/answer/feedback-tooltip.js +13 -12
- package/dist/esm/lib/components/common/constants.js +10 -9
- package/dist/esm/lib/components/common/mock-data.js +13 -12
- package/dist/esm/lib/components/content/content.js +1 -1
- package/dist/esm/lib/components/sidebar/content.js +245 -0
- package/dist/esm/lib/components/sidebar/context.js +18 -0
- package/dist/esm/lib/components/sidebar/messages.js +26 -0
- package/dist/esm/lib/components/sidebar/sidebar.js +92 -0
- package/dist/esm/lib/components/sidebar/title.js +23 -0
- package/dist/i18n/bn-IN.js +6 -1
- package/dist/i18n/da-DK.js +6 -1
- package/dist/i18n/de-DE.js +6 -1
- package/dist/i18n/en-AU.js +6 -1
- package/dist/i18n/en-CA.js +6 -1
- package/dist/i18n/en-GB.js +6 -1
- package/dist/i18n/en-US.js +6 -1
- package/dist/i18n/en-US.properties +10 -0
- package/dist/i18n/en-x-pseudo.js +6 -1
- package/dist/i18n/es-419.js +6 -1
- package/dist/i18n/es-ES.js +6 -1
- package/dist/i18n/fi-FI.js +6 -1
- package/dist/i18n/fr-CA.js +6 -1
- package/dist/i18n/fr-FR.js +6 -1
- package/dist/i18n/hi-IN.js +6 -1
- package/dist/i18n/it-IT.js +6 -1
- package/dist/i18n/ja-JP.js +6 -1
- package/dist/i18n/json/src/lib/components/sidebar/messages.json +1 -0
- package/dist/i18n/ko-KR.js +6 -1
- package/dist/i18n/nb-NO.js +6 -1
- package/dist/i18n/nl-NL.js +6 -1
- package/dist/i18n/pl-PL.js +6 -1
- package/dist/i18n/pt-BR.js +6 -1
- package/dist/i18n/ru-RU.js +6 -1
- package/dist/i18n/sv-SE.js +6 -1
- package/dist/i18n/tr-TR.js +6 -1
- package/dist/i18n/zh-CN.js +6 -1
- package/dist/i18n/zh-TW.js +6 -1
- package/dist/styles/content.css +1 -1
- package/dist/styles/content2.css +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/components/common/constants.d.ts +1 -0
- package/dist/types/lib/components/common/mock-data.d.ts +1 -0
- package/dist/types/lib/components/sidebar/content.d.ts +2 -0
- package/dist/types/lib/components/sidebar/context.d.ts +26 -0
- package/dist/types/lib/components/sidebar/messages.d.ts +28 -0
- package/dist/types/lib/components/sidebar/sidebar.d.ts +46 -0
- package/dist/types/lib/components/sidebar/stories/shared.d.ts +55 -0
- package/dist/types/lib/components/sidebar/title.d.ts +5 -0
- package/dist/types/lib/components/sidebar/types.d.ts +10 -0
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { BoxAiContentAnswers as r } from "./lib/box-ai-content-answers.js";
|
|
2
2
|
import { AnswerContent as p } from "./lib/components/answer/answer-content.js";
|
|
3
|
-
import { withApiWrapper as
|
|
3
|
+
import { withApiWrapper as s } from "./lib/components/api-wrapper/api-wrapper.js";
|
|
4
4
|
import { C as m } from "../chunks/clear-conversation-button.js";
|
|
5
|
-
import { IntelligenceModal as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { IntelligenceModal as f } from "./lib/components/modal/modal.js";
|
|
6
|
+
import { IntelligenceSidebar as A } from "./lib/components/sidebar/sidebar.js";
|
|
7
|
+
import { APP_MODE as i } from "./lib/constants.js";
|
|
8
|
+
import { usePromptFocus as l } from "./lib/hooks/usePromptFocus.js";
|
|
9
|
+
import { A as c, C as u, F as O, R as S } from "../chunks/types.js";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
c as ANSWER_ERROR,
|
|
12
|
+
i as APP_MODE,
|
|
12
13
|
p as AnswerContent,
|
|
13
14
|
r as BoxAiContentAnswers,
|
|
14
|
-
|
|
15
|
+
u as CONTENT_ERROR,
|
|
15
16
|
m as ClearConversationButton,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
O as FeedbackIssueType,
|
|
18
|
+
f as IntelligenceModal,
|
|
19
|
+
A as IntelligenceSidebar,
|
|
20
|
+
S as REQUEST_STATE,
|
|
21
|
+
l as usePromptFocus,
|
|
22
|
+
s as withApiWrapper
|
|
21
23
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Formik as F, Form as I } from "formik";
|
|
2
|
-
import { GuidedTooltip as t, Radio as l, TextArea as
|
|
3
|
-
import { useIntl as
|
|
2
|
+
import { GuidedTooltip as t, Radio as l, TextArea as g } from "@box/blueprint-web";
|
|
3
|
+
import { useIntl as x } from "react-intl";
|
|
4
4
|
import { F as d } from "../../../../chunks/types.js";
|
|
5
|
-
import
|
|
5
|
+
import S from "../../messages.js";
|
|
6
6
|
import a from "./messages.js";
|
|
7
7
|
import { jsx as o, jsxs as i, Fragment as A } from "react/jsx-runtime";
|
|
8
8
|
import '../../../../styles/feedback-tooltip.css';const v = "_feedbackTooltip_rsbqj_1", C = "_feedbackTooltipTitle_rsbqj_4", N = "_feedbackTooltipTextarea_rsbqj_7", R = "_feedbackTooltipSubmitBtn_rsbqj_10", c = {
|
|
@@ -11,26 +11,27 @@ import '../../../../styles/feedback-tooltip.css';const v = "_feedbackTooltip_rsb
|
|
|
11
11
|
feedbackTooltipTextarea: N,
|
|
12
12
|
feedbackTooltipSubmitBtn: R
|
|
13
13
|
}, z = ({
|
|
14
|
-
children:
|
|
14
|
+
children: n,
|
|
15
15
|
isOpen: f,
|
|
16
|
-
onOpenChange:
|
|
16
|
+
onOpenChange: b,
|
|
17
17
|
onSubmit: m,
|
|
18
18
|
shouldIncludeFeedbackText: k,
|
|
19
19
|
shouldShow: u
|
|
20
20
|
}) => {
|
|
21
21
|
const {
|
|
22
22
|
formatMessage: e
|
|
23
|
-
} =
|
|
23
|
+
} = x();
|
|
24
24
|
if (!u)
|
|
25
|
-
return
|
|
25
|
+
return n;
|
|
26
26
|
const _ = () => {
|
|
27
|
-
|
|
27
|
+
b(!1);
|
|
28
28
|
}, h = (s) => {
|
|
29
29
|
m(s);
|
|
30
30
|
};
|
|
31
31
|
return /* @__PURE__ */ o(t, {
|
|
32
|
+
align: "end",
|
|
32
33
|
className: c.feedbackTooltip,
|
|
33
|
-
closeLabel: e(
|
|
34
|
+
closeLabel: e(S.closeButtonText),
|
|
34
35
|
content: /* @__PURE__ */ o(F, {
|
|
35
36
|
initialValues: {
|
|
36
37
|
feedback: "",
|
|
@@ -70,7 +71,7 @@ import '../../../../styles/feedback-tooltip.css';const v = "_feedbackTooltip_rsb
|
|
|
70
71
|
value: d.OTHER
|
|
71
72
|
})]
|
|
72
73
|
})
|
|
73
|
-
}), k && /* @__PURE__ */ o(
|
|
74
|
+
}), k && /* @__PURE__ */ o(g, {
|
|
74
75
|
className: c.feedbackTooltipTextarea,
|
|
75
76
|
label: e(a.feedbackTooltipFeedbackLabel),
|
|
76
77
|
maxRows: 4,
|
|
@@ -95,10 +96,10 @@ import '../../../../styles/feedback-tooltip.css';const v = "_feedbackTooltip_rsb
|
|
|
95
96
|
})]
|
|
96
97
|
})
|
|
97
98
|
}),
|
|
98
|
-
onOpenChange:
|
|
99
|
+
onOpenChange: b,
|
|
99
100
|
open: f,
|
|
100
101
|
side: "left",
|
|
101
|
-
children:
|
|
102
|
+
children: n
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
105
|
export {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = "modal", E = "answers", o = "programmatic", G = "click", O = "keypress", c = {
|
|
2
2
|
action: o,
|
|
3
|
-
component:
|
|
4
|
-
feature:
|
|
5
|
-
};
|
|
3
|
+
component: s,
|
|
4
|
+
feature: E
|
|
5
|
+
}, t = ["xls", "xlsx", "xlsm", "xlsb", "csv", "ods", "gsheet"];
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
G as LOGGER_ACTION_CLICK,
|
|
8
|
+
O as LOGGER_ACTION_KEYPRESS,
|
|
9
9
|
o as LOGGER_ACTION_PROGRAMMATIC,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
c as LOGGER_BASE_CONFIG,
|
|
11
|
+
s as LOGGER_COMPONENT,
|
|
12
|
+
E as LOGGER_FEATURE,
|
|
13
|
+
t as SPREADSHEET_FILE_EXTENSIONS
|
|
13
14
|
};
|
|
@@ -12,7 +12,7 @@ const s = [{
|
|
|
12
12
|
location: "location3",
|
|
13
13
|
fileId: "789",
|
|
14
14
|
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst."
|
|
15
|
-
}],
|
|
15
|
+
}], r = [{
|
|
16
16
|
answer: "I am a mock answer",
|
|
17
17
|
id: "1",
|
|
18
18
|
isCompleted: !0,
|
|
@@ -76,7 +76,7 @@ const s = [{
|
|
|
76
76
|
isLoading: !1,
|
|
77
77
|
error: e.NO_CONTENT,
|
|
78
78
|
prompt: "What is the capital of Italy?"
|
|
79
|
-
}],
|
|
79
|
+
}], l = [{
|
|
80
80
|
answer: "Washington, D.C.",
|
|
81
81
|
id: "0",
|
|
82
82
|
isCompleted: !0,
|
|
@@ -90,7 +90,7 @@ const s = [{
|
|
|
90
90
|
isLoading: !1,
|
|
91
91
|
error: null,
|
|
92
92
|
prompt: "What is the capital of Poland?"
|
|
93
|
-
}],
|
|
93
|
+
}], p = t, u = i, a = [{
|
|
94
94
|
type: "file",
|
|
95
95
|
name: "Document.docx",
|
|
96
96
|
status: "supported",
|
|
@@ -155,7 +155,7 @@ const s = [{
|
|
|
155
155
|
name: "Note.boxnote",
|
|
156
156
|
status: "no_permission",
|
|
157
157
|
id: "10"
|
|
158
|
-
}], d = [{
|
|
158
|
+
}], d = a[1], m = [{
|
|
159
159
|
status: "supported",
|
|
160
160
|
fileType: "word-document"
|
|
161
161
|
}, {
|
|
@@ -188,7 +188,7 @@ const s = [{
|
|
|
188
188
|
}, {
|
|
189
189
|
status: "no_permission",
|
|
190
190
|
fileType: void 0
|
|
191
|
-
}],
|
|
191
|
+
}], c = [{
|
|
192
192
|
type: "file",
|
|
193
193
|
name: "This_is_a_very_long_file_name_that_tests_the_boundary_conditions_for_file_names.docx",
|
|
194
194
|
status: "supported",
|
|
@@ -250,11 +250,12 @@ const s = [{
|
|
|
250
250
|
id: "9"
|
|
251
251
|
}];
|
|
252
252
|
export {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
253
|
+
u as mockAgentState,
|
|
254
|
+
p as mockAgents,
|
|
255
|
+
l as mockConversation,
|
|
256
|
+
a as mockItemsAllTypes,
|
|
257
|
+
c as mockItemsWithLongNames,
|
|
258
|
+
m as mockLogAllTypes,
|
|
259
|
+
r as mockQuestions,
|
|
260
|
+
d as spreadsheetItem
|
|
260
261
|
};
|
|
@@ -7,7 +7,7 @@ import { C as y } from "../../../../chunks/types.js";
|
|
|
7
7
|
import { jsx as n, jsxs as H, Fragment as V } from "react/jsx-runtime";
|
|
8
8
|
import { ModalError as A } from "../modal-error/modal-error.js";
|
|
9
9
|
import { Chat as B } from "../chat/chat.js";
|
|
10
|
-
import '../../../../styles/
|
|
10
|
+
import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1juw3_1", G = "_content_1juw3_5", J = "_sidebar_1juw3_14", K = "_isLoading_1juw3_17", Q = "_messagesEnd_1juw3_21", U = "_innerContent_1juw3_25", r = {
|
|
11
11
|
loadingIndicatorWrapper: D,
|
|
12
12
|
content: G,
|
|
13
13
|
sidebar: J,
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { Text as K, Tooltip as X, IconButton as Y } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsExpand as Z } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { useAgents as ee, BoxAiAgentSelectorWithApi as te } from "@box/box-ai-agent-selector";
|
|
4
|
+
import H from "clsx";
|
|
5
|
+
import * as p from "react";
|
|
6
|
+
import { useIntl as ne } from "react-intl";
|
|
7
|
+
import { BoxAiContentAnswers as oe } from "../../box-ai-content-answers.js";
|
|
8
|
+
import { withApiWrapper as se } from "../api-wrapper/api-wrapper.js";
|
|
9
|
+
import { C as ae } from "../../../../chunks/clear-conversation-button.js";
|
|
10
|
+
import { IntelligenceModal as ie } from "../modal/modal.js";
|
|
11
|
+
import { IntelligenceSidebarContext as re } from "./context.js";
|
|
12
|
+
import f from "./messages.js";
|
|
13
|
+
import ce from "./title.js";
|
|
14
|
+
import { jsxs as h, Fragment as y, jsx as e } from "react/jsx-runtime";
|
|
15
|
+
import '../../../../styles/content.css';const de = "_bcsSidebarBase_168tq_2", le = "_bcsContent_168tq_2", be = "_bcsBoxAISidebar_168tq_2", Se = "_bcsContentHeader_168tq_7", pe = "_bcsTitle_168tq_16", he = "_bcsScrollContent_168tq_23", Ae = "_withModalOpen_168tq_33", me = "_bcsBoxAISidebarAgentSelector_168tq_36", ue = "_bcsBoxAISidebarAgentSelectorContainer_168tq_40", ge = "_bcsBoxAISidebarChatActions_168tq_44", Ie = "_bcsBoxAISidebarContent_168tq_48", _e = "_bcsBoxAISidebarExpand_168tq_51", xe = "_bcsBoxAISidebarTitlePart_168tq_54", Ce = "_sidebarChip_168tq_78", fe = "_bcsContentSubheader_168tq_91", Be = "_bcsScrollContentWrapper_168tq_100", we = "_withSubheader_168tq_105", qe = "_expanded_168tq_108", t = {
|
|
16
|
+
bcsSidebarBase: de,
|
|
17
|
+
bcsContent: le,
|
|
18
|
+
bcsBoxAISidebar: be,
|
|
19
|
+
bcsContentHeader: Se,
|
|
20
|
+
bcsTitle: pe,
|
|
21
|
+
bcsScrollContent: he,
|
|
22
|
+
withModalOpen: Ae,
|
|
23
|
+
bcsBoxAISidebarAgentSelector: me,
|
|
24
|
+
bcsBoxAISidebarAgentSelectorContainer: ue,
|
|
25
|
+
bcsBoxAISidebarChatActions: ge,
|
|
26
|
+
bcsBoxAISidebarContent: Ie,
|
|
27
|
+
bcsBoxAISidebarExpand: _e,
|
|
28
|
+
bcsBoxAISidebarTitlePart: xe,
|
|
29
|
+
sidebarChip: Ce,
|
|
30
|
+
bcsContentSubheader: fe,
|
|
31
|
+
bcsScrollContentWrapper: Be,
|
|
32
|
+
withSubheader: we,
|
|
33
|
+
expanded: qe
|
|
34
|
+
}, Te = ({
|
|
35
|
+
actions: B,
|
|
36
|
+
children: i,
|
|
37
|
+
className: n,
|
|
38
|
+
elementId: d = "",
|
|
39
|
+
sidebarView: A = "",
|
|
40
|
+
title: l,
|
|
41
|
+
subheader: r,
|
|
42
|
+
...c
|
|
43
|
+
}) => {
|
|
44
|
+
const b = `${d}${d === "" ? "" : "_"}${A}`, m = `${b}-content`;
|
|
45
|
+
return /* @__PURE__ */ h("div", {
|
|
46
|
+
"aria-labelledby": b,
|
|
47
|
+
className: H(t.bcsContent, n),
|
|
48
|
+
"data-testid": "bcs-content",
|
|
49
|
+
id: m,
|
|
50
|
+
role: "tabpanel",
|
|
51
|
+
...c,
|
|
52
|
+
children: [/* @__PURE__ */ h("div", {
|
|
53
|
+
className: t.bcsContentHeader,
|
|
54
|
+
children: [l && /* @__PURE__ */ e(K, {
|
|
55
|
+
as: "h3",
|
|
56
|
+
className: t.bcsTitle,
|
|
57
|
+
children: l
|
|
58
|
+
}), B]
|
|
59
|
+
}), r && /* @__PURE__ */ e("div", {
|
|
60
|
+
className: t.bcsContentSubheader,
|
|
61
|
+
children: r
|
|
62
|
+
}), /* @__PURE__ */ e("div", {
|
|
63
|
+
className: t.bcsScrollContentWrapper,
|
|
64
|
+
children: /* @__PURE__ */ e("div", {
|
|
65
|
+
className: t.bcsScrollContent,
|
|
66
|
+
children: i
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
function ve(B) {
|
|
72
|
+
const {
|
|
73
|
+
createSession: i,
|
|
74
|
+
encodedSession: n,
|
|
75
|
+
onClearAction: d,
|
|
76
|
+
getAIStudioAgents: A,
|
|
77
|
+
hasRequestInProgress: l,
|
|
78
|
+
hostAppName: r,
|
|
79
|
+
isAIStudioAgentSelectorEnabled: c,
|
|
80
|
+
isLoading: b,
|
|
81
|
+
isResetChatEnabled: m,
|
|
82
|
+
onSelectAgent: P,
|
|
83
|
+
questions: u,
|
|
84
|
+
shouldShowLandingPage: E,
|
|
85
|
+
sendQuestion: g,
|
|
86
|
+
stopQuestion: w,
|
|
87
|
+
...N
|
|
88
|
+
} = B, {
|
|
89
|
+
formatMessage: I
|
|
90
|
+
} = ne(), L = p.useRef(!1), [q, M] = p.useState(!1), {
|
|
91
|
+
cache: s,
|
|
92
|
+
contentName: O,
|
|
93
|
+
elementId: Q,
|
|
94
|
+
fileExtension: V,
|
|
95
|
+
isFeedbackEnabled: U,
|
|
96
|
+
isFeedbackFormEnabled: W,
|
|
97
|
+
isStopResponseEnabled: k,
|
|
98
|
+
items: T,
|
|
99
|
+
itemSize: $,
|
|
100
|
+
onFeedbackFormSubmit: F,
|
|
101
|
+
onUserInteraction: R,
|
|
102
|
+
recordAction: S,
|
|
103
|
+
setCacheValue: _,
|
|
104
|
+
shouldPreinitSession: x
|
|
105
|
+
} = p.useContext(re), {
|
|
106
|
+
agents: j,
|
|
107
|
+
requestState: z,
|
|
108
|
+
selectedAgent: v
|
|
109
|
+
} = ee(), {
|
|
110
|
+
questions: a
|
|
111
|
+
} = s;
|
|
112
|
+
s.shouldShowLandingPage !== E && _("shouldShowLandingPage", E), s.encodedSession !== n && _("encodedSession", n), s.questions !== u && _("questions", u), s.agents.selectedAgent !== v && _("agents", {
|
|
113
|
+
agents: j,
|
|
114
|
+
requestState: z,
|
|
115
|
+
selectedAgent: v
|
|
116
|
+
});
|
|
117
|
+
const C = (o = !1) => {
|
|
118
|
+
!x && !n && !b && i && i(!0, !1), o && R && R();
|
|
119
|
+
}, D = () => {
|
|
120
|
+
M(!1);
|
|
121
|
+
}, G = () => {
|
|
122
|
+
C(), M(!0);
|
|
123
|
+
};
|
|
124
|
+
p.useEffect(() => (x && !n && i && i(!0, !0), n && a.length > 0 && a[a.length - 1].isCompleted === !1 && g({
|
|
125
|
+
prompt: a[a.length - 1].prompt
|
|
126
|
+
}), S && S({
|
|
127
|
+
action: "programmatic",
|
|
128
|
+
component: "sidebar",
|
|
129
|
+
feature: "answers",
|
|
130
|
+
target: "loaded",
|
|
131
|
+
data: {
|
|
132
|
+
items: T.map((o) => ({
|
|
133
|
+
status: o.status,
|
|
134
|
+
fileType: o.fileType
|
|
135
|
+
}))
|
|
136
|
+
}
|
|
137
|
+
}), () => {
|
|
138
|
+
w();
|
|
139
|
+
}), []), p.useEffect(() => {
|
|
140
|
+
const o = a[a.length - 1];
|
|
141
|
+
!x && !L.current && n && (o != null && o.isLoading) && (g(o, v, !1), L.current = !0);
|
|
142
|
+
}, [n]);
|
|
143
|
+
const J = () => /* @__PURE__ */ h("div", {
|
|
144
|
+
className: t.bcsBoxAISidebarTitlePart,
|
|
145
|
+
children: [/* @__PURE__ */ e(ce, {
|
|
146
|
+
isAIStudioAgentSelectorEnabled: c
|
|
147
|
+
}), c && /* @__PURE__ */ e("div", {
|
|
148
|
+
className: t.bcsBoxAISidebarAgentSelector,
|
|
149
|
+
children: /* @__PURE__ */ e(te, {
|
|
150
|
+
disabled: l,
|
|
151
|
+
fetcher: A,
|
|
152
|
+
hostAppName: r,
|
|
153
|
+
onAgentsListOpen: C,
|
|
154
|
+
onSelectAgent: P,
|
|
155
|
+
recordAction: S,
|
|
156
|
+
shouldHideAgentSelectorOnLoad: !0,
|
|
157
|
+
variant: "sidebar"
|
|
158
|
+
})
|
|
159
|
+
})]
|
|
160
|
+
});
|
|
161
|
+
return /* @__PURE__ */ h(y, {
|
|
162
|
+
children: [/* @__PURE__ */ e(Te, {
|
|
163
|
+
actions: /* @__PURE__ */ h(y, {
|
|
164
|
+
children: [J(), m && /* @__PURE__ */ e(ae, {
|
|
165
|
+
onClick: d
|
|
166
|
+
}), /* @__PURE__ */ e(X, {
|
|
167
|
+
content: I(f.sidebarBoxAISwitchToModalView),
|
|
168
|
+
"data-testid": "content-answers-open-modal-tooltip",
|
|
169
|
+
variant: "standard",
|
|
170
|
+
children: /* @__PURE__ */ e(Y, {
|
|
171
|
+
"aria-label": I(f.sidebarBoxAISwitchToModalView),
|
|
172
|
+
className: t.bcsBoxAISidebarExpand,
|
|
173
|
+
"data-target-id": "IconButton-expandBoxAISidebar",
|
|
174
|
+
icon: Z,
|
|
175
|
+
onClick: G,
|
|
176
|
+
size: "small"
|
|
177
|
+
})
|
|
178
|
+
})]
|
|
179
|
+
}),
|
|
180
|
+
className: H(t.bcsBoxAISidebar, {
|
|
181
|
+
[t.withModalOpen]: q
|
|
182
|
+
}),
|
|
183
|
+
elementId: Q,
|
|
184
|
+
sidebarView: "box-ai",
|
|
185
|
+
children: /* @__PURE__ */ e("div", {
|
|
186
|
+
className: t.bcsBoxAISidebarContent,
|
|
187
|
+
children: /* @__PURE__ */ e(oe, {
|
|
188
|
+
className: t.bcsBoxAISidebarContentAnswers,
|
|
189
|
+
contentName: O,
|
|
190
|
+
contentType: I(f.sidebarBoxAIContent),
|
|
191
|
+
hostAppName: r,
|
|
192
|
+
isAIStudioAgentSelectorEnabled: c,
|
|
193
|
+
isFeedbackEnabled: U,
|
|
194
|
+
isFeedbackFormEnabled: W,
|
|
195
|
+
isStopResponseEnabled: k,
|
|
196
|
+
items: T,
|
|
197
|
+
onFeedbackFormSubmit: F,
|
|
198
|
+
onUserIntentToUseAI: C,
|
|
199
|
+
questions: u,
|
|
200
|
+
recordAction: S,
|
|
201
|
+
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
202
|
+
showLoadingIndicator: b && x,
|
|
203
|
+
stopQuestion: w,
|
|
204
|
+
submitQuestion: g,
|
|
205
|
+
variant: "sidebar",
|
|
206
|
+
...N
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
}), /* @__PURE__ */ e(ie, {
|
|
210
|
+
contentName: O,
|
|
211
|
+
contentType: I(f.sidebarBoxAIContent),
|
|
212
|
+
extension: V,
|
|
213
|
+
getAIStudioAgents: A,
|
|
214
|
+
hasRequestInProgress: l,
|
|
215
|
+
hostAppName: r,
|
|
216
|
+
isAIStudioAgentSelectorEnabled: c,
|
|
217
|
+
isFeedbackEnabled: U,
|
|
218
|
+
isFeedbackFormEnabled: W,
|
|
219
|
+
isResetChatEnabled: m,
|
|
220
|
+
isStopResponseEnabled: k,
|
|
221
|
+
items: T,
|
|
222
|
+
itemSize: $,
|
|
223
|
+
onClearAction: d,
|
|
224
|
+
onFeedbackFormSubmit: F,
|
|
225
|
+
onOpenChange: D,
|
|
226
|
+
onSelectAgent: P,
|
|
227
|
+
onUserIntentToUseAI: C,
|
|
228
|
+
open: q,
|
|
229
|
+
questions: u,
|
|
230
|
+
recordAction: q ? S : void 0,
|
|
231
|
+
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
232
|
+
showLoadingIndicator: !1,
|
|
233
|
+
stopPropagationOnEsc: !0,
|
|
234
|
+
stopQuestion: w,
|
|
235
|
+
submitQuestion: g,
|
|
236
|
+
variant: "collapsible",
|
|
237
|
+
...N,
|
|
238
|
+
shouldRenderProviders: !1
|
|
239
|
+
})]
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
const Ve = se(ve);
|
|
243
|
+
export {
|
|
244
|
+
Ve as default
|
|
245
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "lodash/noop";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
const n = /* @__PURE__ */ t.createContext({
|
|
4
|
+
cache: {},
|
|
5
|
+
contentName: "",
|
|
6
|
+
elementId: "",
|
|
7
|
+
fileExtension: "",
|
|
8
|
+
isFeedbackEnabled: !1,
|
|
9
|
+
isFeedbackFormEnabled: !1,
|
|
10
|
+
isStopResponseEnabled: !1,
|
|
11
|
+
items: [],
|
|
12
|
+
recordAction: e,
|
|
13
|
+
setCacheValue: e,
|
|
14
|
+
shouldPreinitSession: !0
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
n as IntelligenceSidebarContext
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const t = e({
|
|
3
|
+
welcomeMessageIntelligentQueryNotice: {
|
|
4
|
+
id: "boxui.contentAnswers.welcomeMessageIntelligentQueryNotice",
|
|
5
|
+
defaultMessage: "You can ask Box AI both simple and complex questions in your spreadsheet: total counts, averages, advanced comparisons, trend analyses and so on. Try it out today!"
|
|
6
|
+
},
|
|
7
|
+
welcomeMessageSpreadsheetNotice: {
|
|
8
|
+
id: "boxui.contentAnswers.welcomeMessageSpreadsheetNotice",
|
|
9
|
+
defaultMessage: "Spreadsheet support works best for text dense files"
|
|
10
|
+
},
|
|
11
|
+
welcomeMessageSpreadsheetNoticeAriaLabel: {
|
|
12
|
+
id: "boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel",
|
|
13
|
+
defaultMessage: "spreadsheet support notification banner"
|
|
14
|
+
},
|
|
15
|
+
sidebarBoxAISwitchToModalView: {
|
|
16
|
+
id: "contentAnswersSidebar.sidebarBoxAISwitchToModalView",
|
|
17
|
+
defaultMessage: "Switch to modal view"
|
|
18
|
+
},
|
|
19
|
+
sidebarBoxAIContent: {
|
|
20
|
+
id: "contentAnswersSidebar.sidebarBoxAIContent",
|
|
21
|
+
defaultMessage: "content"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
t as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { AgentsProvider as D } from "@box/box-ai-agent-selector";
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { useIntl as R } from "react-intl";
|
|
4
|
+
import { SPREADSHEET_FILE_EXTENSIONS as q } from "../common/constants.js";
|
|
5
|
+
import y from "./content.js";
|
|
6
|
+
import { IntelligenceSidebarContext as z } from "./context.js";
|
|
7
|
+
import o from "./messages.js";
|
|
8
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
9
|
+
const W = (F) => {
|
|
10
|
+
const {
|
|
11
|
+
cache: e,
|
|
12
|
+
contentName: u,
|
|
13
|
+
elementId: m,
|
|
14
|
+
fileExtension: n,
|
|
15
|
+
fileID: M,
|
|
16
|
+
getSuggestedQuestions: h,
|
|
17
|
+
isIntelligentQueryMode: P,
|
|
18
|
+
isFeedbackEnabled: S,
|
|
19
|
+
isFeedbackFormEnabled: f,
|
|
20
|
+
isStopResponseEnabled: i = !1,
|
|
21
|
+
items: p,
|
|
22
|
+
itemSize: Q,
|
|
23
|
+
localizedQuestions: x,
|
|
24
|
+
onFeedbackFormSubmit: I,
|
|
25
|
+
onUserInteraction: b,
|
|
26
|
+
recordAction: E,
|
|
27
|
+
setCacheValue: r,
|
|
28
|
+
shouldPreinitSession: l = !0,
|
|
29
|
+
setHasQuestions: a,
|
|
30
|
+
...A
|
|
31
|
+
} = F, {
|
|
32
|
+
questions: s
|
|
33
|
+
} = e, {
|
|
34
|
+
formatMessage: t
|
|
35
|
+
} = R(), L = w.useMemo(() => ({
|
|
36
|
+
cache: e,
|
|
37
|
+
contentName: u,
|
|
38
|
+
elementId: m,
|
|
39
|
+
fileExtension: n,
|
|
40
|
+
isFeedbackEnabled: S,
|
|
41
|
+
isFeedbackFormEnabled: f,
|
|
42
|
+
isStopResponseEnabled: i,
|
|
43
|
+
items: p,
|
|
44
|
+
itemSize: Q,
|
|
45
|
+
onFeedbackFormSubmit: I,
|
|
46
|
+
onUserInteraction: b,
|
|
47
|
+
recordAction: E,
|
|
48
|
+
setCacheValue: r,
|
|
49
|
+
shouldPreinitSession: l
|
|
50
|
+
}), [e, u, m, n, S, f, i, p, Q, I, b, E, r, l]);
|
|
51
|
+
w.useEffect(() => {
|
|
52
|
+
a && a(s.length > 0);
|
|
53
|
+
}, [s.length, a]);
|
|
54
|
+
let d = s;
|
|
55
|
+
s.length > 0 && !s[s.length - 1].isCompleted && (d = d.slice(0, -1));
|
|
56
|
+
const N = q.includes(n);
|
|
57
|
+
let g = N ? t(o.welcomeMessageSpreadsheetNotice) : "";
|
|
58
|
+
P ? g = t(o.welcomeMessageIntelligentQueryNotice) : N && (g = t(o.welcomeMessageSpreadsheetNotice));
|
|
59
|
+
const v = (k) => {
|
|
60
|
+
r("suggestedQuestions", k);
|
|
61
|
+
}, C = h === null ? x : [];
|
|
62
|
+
return (
|
|
63
|
+
// IntelligenceSidebarContent is using withApiWrapper that is not passing all provided props,
|
|
64
|
+
// that's why we need to use provider to pass other props
|
|
65
|
+
/* @__PURE__ */ c(D, {
|
|
66
|
+
value: e.agents,
|
|
67
|
+
children: /* @__PURE__ */ c(z.Provider, {
|
|
68
|
+
value: L,
|
|
69
|
+
children: /* @__PURE__ */ c(y, {
|
|
70
|
+
cachedSuggestedQuestions: e.suggestedQuestions,
|
|
71
|
+
getSuggestedQuestions: h,
|
|
72
|
+
isOpen: !0,
|
|
73
|
+
isStopResponseEnabled: i,
|
|
74
|
+
itemID: M,
|
|
75
|
+
onSuggestedQuestionsFetched: v,
|
|
76
|
+
restoredQuestions: d,
|
|
77
|
+
restoredSession: e.encodedSession,
|
|
78
|
+
restoredShouldShowLandingPage: e.shouldShowLandingPage,
|
|
79
|
+
shouldPreinitSession: l,
|
|
80
|
+
suggestedQuestions: e.suggestedQuestions.length > 0 ? e.suggestedQuestions : C,
|
|
81
|
+
warningNotice: g,
|
|
82
|
+
warningNoticeAriaLabel: t(o.welcomeMessageSpreadsheetNoticeAriaLabel),
|
|
83
|
+
...A
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
W as IntelligenceSidebar,
|
|
91
|
+
W as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Text as a } from "@box/blueprint-web";
|
|
2
|
+
import { useAgents as c, REQUEST_STATE as t } from "@box/box-ai-agent-selector";
|
|
3
|
+
import { useIntl as m } from "react-intl";
|
|
4
|
+
import S from "../../messages.js";
|
|
5
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
6
|
+
function A({
|
|
7
|
+
isAIStudioAgentSelectorEnabled: s = !1
|
|
8
|
+
}) {
|
|
9
|
+
const {
|
|
10
|
+
formatMessage: n
|
|
11
|
+
} = m(), {
|
|
12
|
+
agents: o,
|
|
13
|
+
requestState: e
|
|
14
|
+
} = c(), r = e !== t.NOT_STARTED && e !== t.IN_PROGRESS, l = e === t.ERROR || e === t.CANCELLED, i = o.length > 1 && e === t.SUCCESS;
|
|
15
|
+
return !s || l || !i && r ? /* @__PURE__ */ E(a, {
|
|
16
|
+
as: "h3",
|
|
17
|
+
className: "bcs-title",
|
|
18
|
+
children: n(S.contentAnswersTitle)
|
|
19
|
+
}) : null;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
A as default
|
|
23
|
+
};
|
package/dist/i18n/bn-IN.js
CHANGED
|
@@ -68,5 +68,10 @@ export default {
|
|
|
68
68
|
"boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# আইটেম} other{# আইটেম}}",
|
|
69
69
|
"boxAI.popup.closeButtonText": "বন্ধ করুন",
|
|
70
70
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "অনুলিপি হয়েছে",
|
|
71
|
-
"boxAi.contentAnswers.closeItemList": "ফাইলের আইটেমের তালিকা বন্ধ করুন"
|
|
71
|
+
"boxAi.contentAnswers.closeItemList": "ফাইলের আইটেমের তালিকা বন্ধ করুন",
|
|
72
|
+
"boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "You can ask Box AI both simple and complex questions in your spreadsheet: total counts, averages, advanced comparisons, trend analyses and so on. Try it out today!",
|
|
73
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Spreadsheet support works best for text dense files",
|
|
74
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "spreadsheet support notification banner",
|
|
75
|
+
"contentAnswersSidebar.sidebarBoxAIContent": "content",
|
|
76
|
+
"contentAnswersSidebar.sidebarBoxAISwitchToModalView": "Switch to modal view"
|
|
72
77
|
}
|
package/dist/i18n/da-DK.js
CHANGED
|
@@ -68,5 +68,10 @@ export default {
|
|
|
68
68
|
"boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# element} other{# elementer}}",
|
|
69
69
|
"boxAI.popup.closeButtonText": "Luk",
|
|
70
70
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopieret",
|
|
71
|
-
"boxAi.contentAnswers.closeItemList": "Luk listen over filelementer"
|
|
71
|
+
"boxAi.contentAnswers.closeItemList": "Luk listen over filelementer",
|
|
72
|
+
"boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "You can ask Box AI both simple and complex questions in your spreadsheet: total counts, averages, advanced comparisons, trend analyses and so on. Try it out today!",
|
|
73
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Spreadsheet support works best for text dense files",
|
|
74
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "spreadsheet support notification banner",
|
|
75
|
+
"contentAnswersSidebar.sidebarBoxAIContent": "content",
|
|
76
|
+
"contentAnswersSidebar.sidebarBoxAISwitchToModalView": "Switch to modal view"
|
|
72
77
|
}
|
package/dist/i18n/de-DE.js
CHANGED
|
@@ -68,5 +68,10 @@ export default {
|
|
|
68
68
|
"boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# Element} other{# Elemente}}",
|
|
69
69
|
"boxAI.popup.closeButtonText": "Schließen",
|
|
70
70
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopiert",
|
|
71
|
-
"boxAi.contentAnswers.closeItemList": "Liste der Dateielemente schließen"
|
|
71
|
+
"boxAi.contentAnswers.closeItemList": "Liste der Dateielemente schließen",
|
|
72
|
+
"boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "You can ask Box AI both simple and complex questions in your spreadsheet: total counts, averages, advanced comparisons, trend analyses and so on. Try it out today!",
|
|
73
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Spreadsheet support works best for text dense files",
|
|
74
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "spreadsheet support notification banner",
|
|
75
|
+
"contentAnswersSidebar.sidebarBoxAIContent": "content",
|
|
76
|
+
"contentAnswersSidebar.sidebarBoxAISwitchToModalView": "Switch to modal view"
|
|
72
77
|
}
|
package/dist/i18n/en-AU.js
CHANGED
|
@@ -68,5 +68,10 @@ export default {
|
|
|
68
68
|
"boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# item} other{# items}}",
|
|
69
69
|
"boxAI.popup.closeButtonText": "Close",
|
|
70
70
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copied",
|
|
71
|
-
"boxAi.contentAnswers.closeItemList": "Close file items list"
|
|
71
|
+
"boxAi.contentAnswers.closeItemList": "Close file items list",
|
|
72
|
+
"boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "You can ask Box AI both simple and complex questions in your spreadsheet: total counts, averages, advanced comparisons, trend analyses and so on. Try it out today!",
|
|
73
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Spreadsheet support works best for text dense files",
|
|
74
|
+
"boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "spreadsheet support notification banner",
|
|
75
|
+
"contentAnswersSidebar.sidebarBoxAIContent": "content",
|
|
76
|
+
"contentAnswersSidebar.sidebarBoxAISwitchToModalView": "Switch to modal view"
|
|
72
77
|
}
|