@box/box-ai-content-answers 0.123.0 → 0.124.0

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.
Files changed (50) hide show
  1. package/dist/esm/index.js +15 -13
  2. package/dist/esm/lib/components/common/constants.js +10 -9
  3. package/dist/esm/lib/components/common/mock-data.js +13 -12
  4. package/dist/esm/lib/components/content/content.js +1 -1
  5. package/dist/esm/lib/components/sidebar/content.js +245 -0
  6. package/dist/esm/lib/components/sidebar/context.js +18 -0
  7. package/dist/esm/lib/components/sidebar/messages.js +26 -0
  8. package/dist/esm/lib/components/sidebar/sidebar.js +92 -0
  9. package/dist/esm/lib/components/sidebar/title.js +23 -0
  10. package/dist/i18n/bn-IN.js +6 -1
  11. package/dist/i18n/da-DK.js +6 -1
  12. package/dist/i18n/de-DE.js +6 -1
  13. package/dist/i18n/en-AU.js +6 -1
  14. package/dist/i18n/en-CA.js +6 -1
  15. package/dist/i18n/en-GB.js +6 -1
  16. package/dist/i18n/en-US.js +6 -1
  17. package/dist/i18n/en-US.properties +10 -0
  18. package/dist/i18n/en-x-pseudo.js +6 -1
  19. package/dist/i18n/es-419.js +6 -1
  20. package/dist/i18n/es-ES.js +6 -1
  21. package/dist/i18n/fi-FI.js +6 -1
  22. package/dist/i18n/fr-CA.js +6 -1
  23. package/dist/i18n/fr-FR.js +6 -1
  24. package/dist/i18n/hi-IN.js +6 -1
  25. package/dist/i18n/it-IT.js +6 -1
  26. package/dist/i18n/ja-JP.js +6 -1
  27. package/dist/i18n/json/src/lib/components/sidebar/messages.json +1 -0
  28. package/dist/i18n/ko-KR.js +6 -1
  29. package/dist/i18n/nb-NO.js +6 -1
  30. package/dist/i18n/nl-NL.js +6 -1
  31. package/dist/i18n/pl-PL.js +6 -1
  32. package/dist/i18n/pt-BR.js +6 -1
  33. package/dist/i18n/ru-RU.js +6 -1
  34. package/dist/i18n/sv-SE.js +6 -1
  35. package/dist/i18n/tr-TR.js +6 -1
  36. package/dist/i18n/zh-CN.js +6 -1
  37. package/dist/i18n/zh-TW.js +6 -1
  38. package/dist/styles/content.css +1 -1
  39. package/dist/styles/content2.css +1 -0
  40. package/dist/types/index.d.ts +1 -0
  41. package/dist/types/lib/components/common/constants.d.ts +1 -0
  42. package/dist/types/lib/components/common/mock-data.d.ts +1 -0
  43. package/dist/types/lib/components/sidebar/content.d.ts +2 -0
  44. package/dist/types/lib/components/sidebar/context.d.ts +26 -0
  45. package/dist/types/lib/components/sidebar/messages.d.ts +28 -0
  46. package/dist/types/lib/components/sidebar/sidebar.d.ts +46 -0
  47. package/dist/types/lib/components/sidebar/stories/shared.d.ts +55 -0
  48. package/dist/types/lib/components/sidebar/title.d.ts +5 -0
  49. package/dist/types/lib/components/sidebar/types.d.ts +10 -0
  50. package/package.json +6 -6
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 n } from "./lib/components/api-wrapper/api-wrapper.js";
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 R } from "./lib/components/modal/modal.js";
6
- import { APP_MODE as A } from "./lib/constants.js";
7
- import { usePromptFocus as C } from "./lib/hooks/usePromptFocus.js";
8
- import { A as i, C as l, F as u, R as O } from "../chunks/types.js";
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
- i as ANSWER_ERROR,
11
- A as APP_MODE,
11
+ c as ANSWER_ERROR,
12
+ i as APP_MODE,
12
13
  p as AnswerContent,
13
14
  r as BoxAiContentAnswers,
14
- l as CONTENT_ERROR,
15
+ u as CONTENT_ERROR,
15
16
  m as ClearConversationButton,
16
- u as FeedbackIssueType,
17
- R as IntelligenceModal,
18
- O as REQUEST_STATE,
19
- C as usePromptFocus,
20
- n as withApiWrapper
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,13 +1,14 @@
1
- const G = "modal", O = "answers", o = "programmatic", E = "click", c = "keypress", t = {
1
+ const s = "modal", E = "answers", o = "programmatic", G = "click", O = "keypress", c = {
2
2
  action: o,
3
- component: G,
4
- feature: O
5
- };
3
+ component: s,
4
+ feature: E
5
+ }, t = ["xls", "xlsx", "xlsm", "xlsb", "csv", "ods", "gsheet"];
6
6
  export {
7
- E as LOGGER_ACTION_CLICK,
8
- c as LOGGER_ACTION_KEYPRESS,
7
+ G as LOGGER_ACTION_CLICK,
8
+ O as LOGGER_ACTION_KEYPRESS,
9
9
  o as LOGGER_ACTION_PROGRAMMATIC,
10
- t as LOGGER_BASE_CONFIG,
11
- G as LOGGER_COMPONENT,
12
- O as LOGGER_FEATURE
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
- }], n = [{
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
- }], r = [{
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
- }], l = t, p = i, u = [{
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
- }], m = [{
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
- p as mockAgentState,
254
- l as mockAgents,
255
- r as mockConversation,
256
- u as mockItemsAllTypes,
257
- m as mockItemsWithLongNames,
258
- d as mockLogAllTypes,
259
- n as mockQuestions
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/content.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 = {
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
+ };
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -138,3 +138,13 @@ boxAI.popup.closeButtonText = Close
138
138
  boxAI.textInputWithCopyButton.copyButtonSuccessText = Copied
139
139
  # Label that shows up while someone hover on close button of files dropdown
140
140
  boxAi.contentAnswers.closeItemList = Close file items list
141
+ # Content Answers welcome message spreadsheet supported by Intelligent Query notification
142
+ 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!
143
+ # Content Answers welcome message spreadsheet notification
144
+ boxui.contentAnswers.welcomeMessageSpreadsheetNotice = Spreadsheet support works best for text dense files
145
+ # Aria label for the icon inside spreadsheet notification
146
+ boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel = spreadsheet support notification banner
147
+ # Generic Box AI content type opened used in welcome message and placeholder
148
+ contentAnswersSidebar.sidebarBoxAIContent = content
149
+ # Label for button that triggers switch to Box AI Modal
150
+ contentAnswersSidebar.sidebarBoxAISwitchToModalView = Switch to modal view
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "⟦萬萬萬萬萬萬萬萬 {numberOfItems, plural, one {# ιťĕm} other {# ïţēmś} } 國國國國國國國國⟧",
69
69
  "boxAI.popup.closeButtonText": "⟦萬 Ćľöѕé 國⟧",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "⟦萬 ĊôΡíёď 國⟧",
71
- "boxAi.contentAnswers.closeItemList": "⟦萬萬萬萬萬萬 Čĺоѕё ƒϊĺέ ϊťėmѕ ļįśτ 國國國國國國⟧"
71
+ "boxAi.contentAnswers.closeItemList": "⟦萬萬萬萬萬萬 Čĺоѕё ƒϊĺέ ϊťėmѕ ļįśτ 國國國國國國⟧",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# elemento} other{# elementos}}",
69
69
  "boxAI.popup.closeButtonText": "Cerrar",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copiado",
71
- "boxAi.contentAnswers.closeItemList": "Cerrar lista de elementos del archivo"
71
+ "boxAi.contentAnswers.closeItemList": "Cerrar lista de elementos del archivo",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# elemento} other{# elementos}}",
69
69
  "boxAI.popup.closeButtonText": "Cerrar",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copiado",
71
- "boxAi.contentAnswers.closeItemList": "Cerrar lista de elementos del archivo"
71
+ "boxAi.contentAnswers.closeItemList": "Cerrar lista de elementos del archivo",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# kohde} other{# kohdetta}}",
69
69
  "boxAI.popup.closeButtonText": "Sulje",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopioitu",
71
- "boxAi.contentAnswers.closeItemList": "Sulje tiedostokohteiden luettelo"
71
+ "boxAi.contentAnswers.closeItemList": "Sulje tiedostokohteiden luettelo",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# élément} other{# éléments}}",
69
69
  "boxAI.popup.closeButtonText": "Fermer",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copié",
71
- "boxAi.contentAnswers.closeItemList": "Fermer la liste des éléments de fichier"
71
+ "boxAi.contentAnswers.closeItemList": "Fermer la liste des éléments de fichier",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# élément} other{# éléments}}",
69
69
  "boxAI.popup.closeButtonText": "Fermer",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copié",
71
- "boxAi.contentAnswers.closeItemList": "Fermer la liste des éléments de fichier"
71
+ "boxAi.contentAnswers.closeItemList": "Fermer la liste des éléments de fichier",
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
  }
@@ -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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# elemento} other{# elementi}}",
69
69
  "boxAI.popup.closeButtonText": "Chiudi",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copia eseguita",
71
- "boxAi.contentAnswers.closeItemList": "Chiudi elenco elementi file"
71
+ "boxAi.contentAnswers.closeItemList": "Chiudi elenco elementi file",
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
  }
@@ -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
  }
@@ -0,0 +1 @@
1
+ [{"id":"boxui.contentAnswers.welcomeMessageIntelligentQueryNotice","description":"Content Answers welcome message spreadsheet supported by Intelligent Query notification","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!"},{"id":"boxui.contentAnswers.welcomeMessageSpreadsheetNotice","description":"Content Answers welcome message spreadsheet notification","defaultMessage":"Spreadsheet support works best for text dense files"},{"id":"boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel","description":"Aria label for the icon inside spreadsheet notification","defaultMessage":"spreadsheet support notification banner"},{"id":"contentAnswersSidebar.sidebarBoxAISwitchToModalView","description":"Label for button that triggers switch to Box AI Modal","defaultMessage":"Switch to modal view"},{"id":"contentAnswersSidebar.sidebarBoxAIContent","description":"Generic Box AI content type opened used in welcome message and placeholder","defaultMessage":"content"}]
@@ -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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# element} other{# elementer}}",
69
69
  "boxAI.popup.closeButtonText": "Lukk",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopiert",
71
- "boxAi.contentAnswers.closeItemList": "Lukk liste over filelementer"
71
+ "boxAi.contentAnswers.closeItemList": "Lukk liste 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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# item} other{# items}}",
69
69
  "boxAI.popup.closeButtonText": "Sluiten",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Gekopieerd",
71
- "boxAi.contentAnswers.closeItemList": "Lijst met bestandsitems sluiten"
71
+ "boxAi.contentAnswers.closeItemList": "Lijst met bestandsitems sluiten",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# element} other{# elementów} few{# elementy}}",
69
69
  "boxAI.popup.closeButtonText": "Zamknij",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Skopiowano",
71
- "boxAi.contentAnswers.closeItemList": "Zamknij listę elementów pliku"
71
+ "boxAi.contentAnswers.closeItemList": "Zamknij listę elementów pliku",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# item} other{# items}}",
69
69
  "boxAI.popup.closeButtonText": "Fechar",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copiado",
71
- "boxAi.contentAnswers.closeItemList": "Fechar lista de itens de arquivos"
71
+ "boxAi.contentAnswers.closeItemList": "Fechar lista de itens de arquivos",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# элемент} other{# элемента} few{# элемента} many{# элементов}}",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# objekt } other{# objekt }}",
69
69
  "boxAI.popup.closeButtonText": "Stäng",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopierad",
71
- "boxAi.contentAnswers.closeItemList": "Stäng lista med filobjekt"
71
+ "boxAi.contentAnswers.closeItemList": "Stäng lista med filobjekt",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,one{# madde} other{# madde}}",
69
69
  "boxAI.popup.closeButtonText": "Kapat",
70
70
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopyalandı",
71
- "boxAi.contentAnswers.closeItemList": "Dosya öğeleri listesini kapat"
71
+ "boxAi.contentAnswers.closeItemList": "Dosya öğeleri listesini kapat",
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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,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
  }
@@ -68,5 +68,10 @@ export default {
68
68
  "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,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
  }
@@ -1 +1 @@
1
- ._loadingIndicatorWrapper_1juw3_1{width:100%}._content_1juw3_5{flex:1 1 auto;width:auto;max-height:35.375rem;overflow:auto;padding:0 1.5rem 1rem}._content_1juw3_5._sidebar_1juw3_14{padding:0 .75rem .75rem}._content_1juw3_5._isLoading_1juw3_17{display:flex;align-items:center}._content_1juw3_5 ._messagesEnd_1juw3_21{margin-bottom:-1.25rem;padding-bottom:1.25rem}._content_1juw3_5 ._innerContent_1juw3_25{width:100%}._content_1juw3_5._sidebar_1juw3_14{max-height:unset}@media (max-width: 374px){._content_1juw3_5{flex:1;max-height:unset;padding:1rem;overflow-x:hidden}._content_1juw3_5 ._messagesEnd_1juw3_21{margin-bottom:-1rem;padding-bottom:1rem}}
1
+ ._bcsSidebarBase_168tq_2,._bcsContent_168tq_2,._bcsBoxAISidebar_168tq_2{position:relative;overflow:hidden auto;border-left:1px solid #e8e8e8}._bcsSidebarBase_168tq_2 ._bcsContentHeader_168tq_7,._bcsContent_168tq_2 ._bcsContentHeader_168tq_7,._bcsBoxAISidebar_168tq_2 ._bcsContentHeader_168tq_7{display:flex;align-items:center;justify-content:space-between;height:60px;margin:0;padding:0 20px;border-bottom:1px solid #e8e8e8}._bcsSidebarBase_168tq_2 ._bcsContentHeader_168tq_7 ._bcsTitle_168tq_16,._bcsContent_168tq_2 ._bcsContentHeader_168tq_7 ._bcsTitle_168tq_16,._bcsBoxAISidebar_168tq_2 ._bcsContentHeader_168tq_7 ._bcsTitle_168tq_16{display:flex;margin:0;padding:0;font-weight:400;font-size:16px}._bcsSidebarBase_168tq_2 ._bcsScrollContent_168tq_23,._bcsContent_168tq_2 ._bcsScrollContent_168tq_23,._bcsBoxAISidebar_168tq_2 ._bcsScrollContent_168tq_23{width:323px;top:60px;right:0;bottom:0;left:0}._bcsBoxAISidebar_168tq_2{height:100%;max-height:100%}._bcsBoxAISidebar_168tq_2._withModalOpen_168tq_33{display:none}._bcsBoxAISidebar_168tq_2 ._bcsBoxAISidebarAgentSelector_168tq_36{max-width:279px}@media (max-width: 767px){._bcsBoxAISidebar_168tq_2 ._bcsBoxAISidebarAgentSelectorContainer_168tq_40{max-width:none}}._bcsBoxAISidebar_168tq_2 ._bcsBoxAISidebarChatActions_168tq_44{display:flex;justify-content:right}._bcsBoxAISidebar_168tq_2 ._bcsBoxAISidebarContent_168tq_48{height:100%}._bcsBoxAISidebar_168tq_2 ._bcsBoxAISidebarExpand_168tq_51{margin-left:.5rem}._bcsBoxAISidebar_168tq_2 ._bcsBoxAISidebarTitlePart_168tq_54{display:flex;align-items:center;justify-content:left;width:100%;margin:0;padding:0;font-weight:400;font-size:1rem}._bcsBoxAISidebar_168tq_2 ._bcsBoxAISidebarTitlePart_168tq_54 ._bcsTitle_168tq_16{margin-right:.5rem;white-space:nowrap}._bcsBoxAISidebar_168tq_2 ._bcsContentHeader_168tq_7{padding:0 1rem}._bcsBoxAISidebar_168tq_2 ._bcsContentHeader_168tq_7 ._bcsBoxAISidebarExpand_168tq_51{margin-left:.5rem}._bcsBoxAISidebar_168tq_2 ._bcsScrollContent_168tq_23{width:auto;height:100%}._bcsBoxAISidebar_168tq_2 ._sidebarChip_168tq_78{max-width:211px;margin-inline-start:0}._bcsBoxAISidebar_168tq_2 ._sidebarChip_168tq_78 button{width:100%}._bcsContent_168tq_2{width:341px;margin-left:-1px}._bcsContent_168tq_2 ._bcsContentSubheader_168tq_91{display:flex;align-items:center;justify-content:space-between;height:56px;margin:0 20px;padding:0;border-bottom:1px solid #e8e8e8}._bcsContent_168tq_2 ._bcsScrollContentWrapper_168tq_100{position:absolute;overflow:hidden auto;top:60px;right:0;bottom:0;left:0}._bcsContent_168tq_2 ._bcsScrollContentWrapper_168tq_100._withSubheader_168tq_105{top:116px}._bcsContent_168tq_2._expanded_168tq_108{width:381px}._bcsContent_168tq_2._expanded_168tq_108 ._bcsScrollContent_168tq_23{width:363px}@media (max-width: 767px){._bcsContent_168tq_2,._bcsBoxAISidebar_168tq_2{flex-basis:100%;width:auto}._bcsContent_168tq_2 ._bcsScrollContent_168tq_23,._bcsBoxAISidebar_168tq_2 ._bcsScrollContent_168tq_23{width:auto}}
@@ -0,0 +1 @@
1
+ ._loadingIndicatorWrapper_1juw3_1{width:100%}._content_1juw3_5{flex:1 1 auto;width:auto;max-height:35.375rem;overflow:auto;padding:0 1.5rem 1rem}._content_1juw3_5._sidebar_1juw3_14{padding:0 .75rem .75rem}._content_1juw3_5._isLoading_1juw3_17{display:flex;align-items:center}._content_1juw3_5 ._messagesEnd_1juw3_21{margin-bottom:-1.25rem;padding-bottom:1.25rem}._content_1juw3_5 ._innerContent_1juw3_25{width:100%}._content_1juw3_5._sidebar_1juw3_14{max-height:unset}@media (max-width: 374px){._content_1juw3_5{flex:1;max-height:unset;padding:1rem;overflow-x:hidden}._content_1juw3_5 ._messagesEnd_1juw3_21{margin-bottom:-1rem;padding-bottom:1rem}}
@@ -4,6 +4,7 @@ export * from './lib/components/api-wrapper/api-wrapper';
4
4
  export * from './lib/components/api-wrapper/types';
5
5
  export * from './lib/components/modal/clear-conversation-button';
6
6
  export * from './lib/components/modal/modal';
7
+ export * from './lib/components/sidebar/sidebar';
7
8
  export * from './lib/constants';
8
9
  export * from './lib/hooks/usePromptFocus';
9
10
  export * from './lib/types';
@@ -5,3 +5,4 @@ export declare const LOGGER_ACTION_PROGRAMMATIC = "programmatic";
5
5
  export declare const LOGGER_ACTION_CLICK = "click";
6
6
  export declare const LOGGER_ACTION_KEYPRESS = "keypress";
7
7
  export declare const LOGGER_BASE_CONFIG: RecordActionType;
8
+ export declare const SPREADSHEET_FILE_EXTENSIONS: string[];
@@ -34,6 +34,7 @@ export declare const mockAgentState: {
34
34
  selectedAgent: import('../../types').AgentType;
35
35
  };
36
36
  export declare const mockItemsAllTypes: Array<ItemType>;
37
+ export declare const spreadsheetItem: ItemType;
37
38
  export declare const mockLogAllTypes: {
38
39
  status: string;
39
40
  fileType: string;
@@ -0,0 +1,2 @@
1
+ declare const _default: (props: import('../api-wrapper/types').ApiWrapperProps) => import("react/jsx-runtime").JSX.Element;
2
+ export default _default;
@@ -0,0 +1,26 @@
1
+ import { RecordActionType as AgentSelectorRecordActionType } from '@box/box-ai-agent-selector';
2
+ import { RecordActionType as ContentAnswersRecordActionType, FeedbackFormData, ItemType } from '../../types';
3
+ import { IntelligenceSidebarCache, IntelligenceSidebarCacheSetter } from './types';
4
+ import * as React from 'react';
5
+ export type IntelligenceSidebarRecordActionType = AgentSelectorRecordActionType | ContentAnswersRecordActionType | (Omit<ContentAnswersRecordActionType, 'data'> & {
6
+ data: {
7
+ items: Array<Pick<ItemType, 'fileType' | 'status'>>;
8
+ };
9
+ });
10
+ export interface IntelligenceSidebarContextValues {
11
+ cache: IntelligenceSidebarCache;
12
+ contentName: string;
13
+ elementId: string;
14
+ fileExtension: string;
15
+ isFeedbackEnabled: boolean;
16
+ isFeedbackFormEnabled: boolean;
17
+ isStopResponseEnabled: boolean;
18
+ items: Array<ItemType>;
19
+ itemSize?: string;
20
+ onFeedbackFormSubmit?: (data: FeedbackFormData, onSuccess: () => void) => void;
21
+ onUserInteraction?: () => void;
22
+ recordAction: (params: IntelligenceSidebarRecordActionType) => void;
23
+ setCacheValue: IntelligenceSidebarCacheSetter;
24
+ shouldPreinitSession: boolean;
25
+ }
26
+ export declare const IntelligenceSidebarContext: React.Context<IntelligenceSidebarContextValues>;
@@ -0,0 +1,28 @@
1
+ declare const messages: {
2
+ welcomeMessageIntelligentQueryNotice: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ welcomeMessageSpreadsheetNotice: {
8
+ defaultMessage: string;
9
+ description: string;
10
+ id: string;
11
+ };
12
+ welcomeMessageSpreadsheetNoticeAriaLabel: {
13
+ defaultMessage: string;
14
+ description: string;
15
+ id: string;
16
+ };
17
+ sidebarBoxAISwitchToModalView: {
18
+ defaultMessage: string;
19
+ description: string;
20
+ id: string;
21
+ };
22
+ sidebarBoxAIContent: {
23
+ defaultMessage: string;
24
+ description: string;
25
+ id: string;
26
+ };
27
+ };
28
+ export default messages;
@@ -0,0 +1,46 @@
1
+ import { AgentListResponse } from '@box/box-ai-agent-selector';
2
+ import { FeedbackFormData, ItemType } from '../../types';
3
+ import { CreateSessionResponse, StreamResponseTimeout, SuggestedQuestionFetcherType, agentFetcherType, fetcherStreamingType, fetcherType } from '../api-wrapper/types';
4
+ import { IntelligenceSidebarRecordActionType } from './context';
5
+ import { IntelligenceSidebarCache, IntelligenceSidebarCacheSetter } from './types';
6
+ export interface IntelligenceSidebarProps {
7
+ contentName: string;
8
+ cache: IntelligenceSidebarCache;
9
+ createSessionRequest: (payload: Record<string, unknown>, itemID: string) => Promise<CreateSessionResponse>;
10
+ elementId: string;
11
+ fetchTimeout: StreamResponseTimeout;
12
+ fileExtension: string;
13
+ fileID: string;
14
+ getAgentConfig: agentFetcherType;
15
+ getAIStudioAgents: () => Promise<AgentListResponse>;
16
+ getAnswer: fetcherType;
17
+ getAnswerStreaming: fetcherStreamingType;
18
+ getSuggestedQuestions: SuggestedQuestionFetcherType;
19
+ hostAppName: string;
20
+ isAgentSelectorEnabled: boolean;
21
+ isAIStudioAgentSelectorEnabled: boolean;
22
+ isCitationsEnabled: boolean;
23
+ isDebugModeEnabled: boolean;
24
+ isFeedbackEnabled: boolean;
25
+ isFeedbackFormEnabled: boolean;
26
+ isIntelligentQueryMode: boolean;
27
+ isMarkdownEnabled: boolean;
28
+ isResetChatEnabled: boolean;
29
+ isStopResponseEnabled?: boolean;
30
+ isStreamingEnabled: boolean;
31
+ items: Array<ItemType>;
32
+ itemSize?: string;
33
+ localizedQuestions: Array<{
34
+ id: string;
35
+ label: string;
36
+ prompt: string;
37
+ }>;
38
+ onUserInteraction?: () => void;
39
+ onFeedbackFormSubmit?: (data: FeedbackFormData, onSuccess: () => void) => void;
40
+ recordAction: (params: IntelligenceSidebarRecordActionType) => void;
41
+ setCacheValue: IntelligenceSidebarCacheSetter;
42
+ shouldPreinitSession?: boolean;
43
+ setHasQuestions: (hasQuestions: boolean) => void;
44
+ }
45
+ export declare const IntelligenceSidebar: (props: IntelligenceSidebarProps) => import("react/jsx-runtime").JSX.Element;
46
+ export default IntelligenceSidebar;
@@ -0,0 +1,55 @@
1
+ import { REQUEST_STATE } from '@box/box-ai-agent-selector';
2
+ import { IntelligenceSidebarProps } from '../sidebar';
3
+ export declare const sidebarCache: {
4
+ agents: {
5
+ requestState: REQUEST_STATE;
6
+ agents: import('../../../types').AgentType[];
7
+ selectedAgent: import('../../../types').AgentType;
8
+ };
9
+ encodedSession: string;
10
+ questions: any[];
11
+ shouldShowLandingPage: boolean;
12
+ suggestedQuestions: any[];
13
+ };
14
+ export declare const defaultIntelligenceSidebarProps: {
15
+ contentName: string;
16
+ cache: {
17
+ agents: {
18
+ requestState: REQUEST_STATE;
19
+ agents: import('../../../types').AgentType[];
20
+ selectedAgent: import('../../../types').AgentType;
21
+ };
22
+ encodedSession: string;
23
+ questions: any[];
24
+ shouldShowLandingPage: boolean;
25
+ suggestedQuestions: any[];
26
+ };
27
+ setCacheValue: (key: string, value: unknown) => void;
28
+ getAIStudioAgents: () => Promise<{
29
+ agents: import('../../../types').AgentType[];
30
+ }>;
31
+ fetchTimeout: {
32
+ initial: number;
33
+ chunk: number;
34
+ };
35
+ fileID: string;
36
+ fileExtension: string;
37
+ elementId: string;
38
+ error: any;
39
+ hostAppName: string;
40
+ items: {
41
+ type: string;
42
+ name: string;
43
+ status: "supported";
44
+ fileType: string;
45
+ id: string;
46
+ }[];
47
+ userInfo: {
48
+ name: string;
49
+ };
50
+ isCitationsEnabled: boolean;
51
+ isAIStudioAgentSelectorEnabled: boolean;
52
+ isResetChatEnabled: boolean;
53
+ isFeedbackEnabled: boolean;
54
+ };
55
+ export declare const DefaultIntelligenceSidebar: (props: IntelligenceSidebarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface IntelligenceSidebarTitleProps {
2
+ isAIStudioAgentSelectorEnabled?: boolean;
3
+ }
4
+ declare function IntelligenceSidebarTitle({ isAIStudioAgentSelectorEnabled }: IntelligenceSidebarTitleProps): import("react/jsx-runtime").JSX.Element;
5
+ export default IntelligenceSidebarTitle;
@@ -0,0 +1,10 @@
1
+ import { AgentState } from '@box/box-ai-agent-selector';
2
+ import { QuestionType, SuggestedQuestionType } from '@box/box-ai-content-answers';
3
+ export type IntelligenceSidebarCache = {
4
+ agents: AgentState;
5
+ encodedSession: string | undefined;
6
+ questions: QuestionType[];
7
+ shouldShowLandingPage: boolean;
8
+ suggestedQuestions: SuggestedQuestionType[];
9
+ };
10
+ export type IntelligenceSidebarCacheSetter = (key: 'agents' | 'encodedSession' | 'questions' | 'shouldShowLandingPage' | 'suggestedQuestions', value: AgentState | QuestionType[] | SuggestedQuestionType[] | string | boolean | null) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "0.123.0",
3
+ "version": "0.124.0",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.35.0",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^11.10.1",
21
- "@box/blueprint-web-assets": "^4.41.1",
22
- "@box/box-ai-agent-selector": "^0.40.0",
23
- "@box/item-icon": "^0.9.133",
24
- "@box/storybook-utils": "^0.12.0",
20
+ "@box/blueprint-web": "^11.10.2",
21
+ "@box/blueprint-web-assets": "^4.42.0",
22
+ "@box/box-ai-agent-selector": "^0.40.2",
23
+ "@box/item-icon": "^0.9.134",
24
+ "@box/storybook-utils": "^0.12.1",
25
25
  "@testing-library/react": "^15.0.6",
26
26
  "react": "^18.3.0",
27
27
  "react-dom": "^18.3.0",