@box/box-ai-content-answers 1.3.0 → 1.5.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 (64) hide show
  1. package/dist/chunks/clear-conversation-button.js +24 -22
  2. package/dist/esm/lib/components/modal/clear-conversation-button.js +4 -3
  3. package/dist/esm/lib/components/sidebar/content.js +168 -152
  4. package/dist/esm/lib/components/sidebar/messages.js +4 -0
  5. package/dist/esm/lib/components/sidebar/sidebar.js +26 -24
  6. package/dist/i18n/bn-IN.js +1 -0
  7. package/dist/i18n/bn-IN.properties +2 -0
  8. package/dist/i18n/da-DK.js +1 -0
  9. package/dist/i18n/da-DK.properties +2 -0
  10. package/dist/i18n/de-DE.js +1 -0
  11. package/dist/i18n/de-DE.properties +2 -0
  12. package/dist/i18n/en-AU.js +1 -0
  13. package/dist/i18n/en-AU.properties +2 -0
  14. package/dist/i18n/en-CA.js +1 -0
  15. package/dist/i18n/en-CA.properties +2 -0
  16. package/dist/i18n/en-GB.js +1 -0
  17. package/dist/i18n/en-GB.properties +2 -0
  18. package/dist/i18n/en-US.js +1 -0
  19. package/dist/i18n/en-US.properties +2 -0
  20. package/dist/i18n/en-x-pseudo.js +89 -88
  21. package/dist/i18n/en-x-pseudo.properties +90 -88
  22. package/dist/i18n/es-419.js +1 -0
  23. package/dist/i18n/es-419.properties +2 -0
  24. package/dist/i18n/es-ES.js +1 -0
  25. package/dist/i18n/es-ES.properties +2 -0
  26. package/dist/i18n/fi-FI.js +1 -0
  27. package/dist/i18n/fi-FI.properties +2 -0
  28. package/dist/i18n/fr-CA.js +1 -0
  29. package/dist/i18n/fr-CA.properties +2 -0
  30. package/dist/i18n/fr-FR.js +1 -0
  31. package/dist/i18n/fr-FR.properties +2 -0
  32. package/dist/i18n/hi-IN.js +1 -0
  33. package/dist/i18n/hi-IN.properties +2 -0
  34. package/dist/i18n/it-IT.js +1 -0
  35. package/dist/i18n/it-IT.properties +2 -0
  36. package/dist/i18n/ja-JP.js +1 -0
  37. package/dist/i18n/ja-JP.properties +2 -0
  38. package/dist/i18n/json/src/lib/components/sidebar/messages.json +1 -1
  39. package/dist/i18n/ko-KR.js +1 -0
  40. package/dist/i18n/ko-KR.properties +2 -0
  41. package/dist/i18n/nb-NO.js +1 -0
  42. package/dist/i18n/nb-NO.properties +2 -0
  43. package/dist/i18n/nl-NL.js +1 -0
  44. package/dist/i18n/nl-NL.properties +2 -0
  45. package/dist/i18n/pl-PL.js +1 -0
  46. package/dist/i18n/pl-PL.properties +2 -0
  47. package/dist/i18n/pt-BR.js +1 -0
  48. package/dist/i18n/pt-BR.properties +2 -0
  49. package/dist/i18n/ru-RU.js +1 -0
  50. package/dist/i18n/ru-RU.properties +2 -0
  51. package/dist/i18n/sv-SE.js +1 -0
  52. package/dist/i18n/sv-SE.properties +2 -0
  53. package/dist/i18n/tr-TR.js +1 -0
  54. package/dist/i18n/tr-TR.properties +2 -0
  55. package/dist/i18n/zh-CN.js +1 -0
  56. package/dist/i18n/zh-CN.properties +2 -0
  57. package/dist/i18n/zh-TW.js +1 -0
  58. package/dist/i18n/zh-TW.properties +2 -0
  59. package/dist/styles/content.css +1 -1
  60. package/dist/types/lib/components/modal/clear-conversation-button.d.ts +2 -1
  61. package/dist/types/lib/components/sidebar/content.d.ts +1 -0
  62. package/dist/types/lib/components/sidebar/messages.d.ts +5 -0
  63. package/dist/types/lib/components/sidebar/sidebar.d.ts +1 -0
  64. package/package.json +4 -4
@@ -1,34 +1,36 @@
1
- import { Tooltip as r, IconButton as l } from "@box/blueprint-web";
2
- import { Trash as s } from "@box/blueprint-web-assets/icons/Line";
3
- import { useIntl as c } from "react-intl";
1
+ import { Tooltip as l, IconButton as s } from "@box/blueprint-web";
2
+ import { Trash as c } from "@box/blueprint-web-assets/icons/Line";
3
+ import i from "clsx";
4
+ import { useIntl as d } from "react-intl";
4
5
  import t from "../esm/lib/components/modal/messages.js";
5
6
  import { jsx as e } from "react/jsx-runtime";
6
- import '../styles/clear-conversation-button.css';const i = "_BoxAIIconColor_ild3b_1", d = "_modalHeader_ild3b_5", _ = "_contentAnswersModal_ild3b_10", m = "_boxAiContentAnswers_ild3b_18", b = "_clearButton_ild3b_26", C = "_contentAnswerModal_ild3b_1", g = "_modalHeaderContainer_ild3b_55", A = "_agentSelectorTrigger_ild3b_63", u = "_agentSelectorContent_ild3b_74", B = {
7
- BoxAIIconColor: i,
8
- modalHeader: d,
9
- contentAnswersModal: _,
10
- boxAiContentAnswers: m,
11
- clearButton: b,
7
+ import '../styles/clear-conversation-button.css';const _ = "_BoxAIIconColor_ild3b_1", m = "_modalHeader_ild3b_5", b = "_contentAnswersModal_ild3b_10", C = "_boxAiContentAnswers_ild3b_18", g = "_clearButton_ild3b_26", A = "_contentAnswerModal_ild3b_1", u = "_modalHeaderContainer_ild3b_55", B = "_agentSelectorTrigger_ild3b_63", p = "_agentSelectorContent_ild3b_74", w = {
8
+ BoxAIIconColor: _,
9
+ modalHeader: m,
10
+ contentAnswersModal: b,
11
+ boxAiContentAnswers: C,
12
+ clearButton: g,
12
13
  "modal-close-button": "_modal-close-button_ild3b_30",
13
- contentAnswerModal: C,
14
- modalHeaderContainer: g,
15
- agentSelectorTrigger: A,
16
- agentSelectorContent: u
17
- }, f = ({
14
+ contentAnswerModal: A,
15
+ modalHeaderContainer: u,
16
+ agentSelectorTrigger: B,
17
+ agentSelectorContent: p
18
+ }, S = ({
18
19
  onClick: n,
19
- hasRequestInProgress: a
20
+ hasRequestInProgress: a,
21
+ className: r
20
22
  }) => {
21
- const o = c();
22
- return /* @__PURE__ */ e(r, {
23
+ const o = d();
24
+ return /* @__PURE__ */ e(l, {
23
25
  content: o.formatMessage(t.clearConversationLabel),
24
26
  "data-testid": "clear-conversation-tooltip",
25
27
  variant: "standard",
26
- children: /* @__PURE__ */ e(l, {
28
+ children: /* @__PURE__ */ e(s, {
27
29
  "aria-label": o.formatMessage(t.clearConversationLabel),
28
- className: B.clearButton,
30
+ className: i(w.clearButton, r),
29
31
  "data-testid": "clear-conversation-button",
30
32
  disabled: a,
31
- icon: s,
33
+ icon: c,
32
34
  onClick: n,
33
35
  size: "small",
34
36
  "data-target-id": "IconButton-clearConversationLabel"
@@ -36,6 +38,6 @@ import '../styles/clear-conversation-button.css';const i = "_BoxAIIconColor_ild3
36
38
  });
37
39
  };
38
40
  export {
39
- f as C,
40
- B as s
41
+ S as C,
42
+ w as s
41
43
  };
@@ -1,10 +1,11 @@
1
1
  import "@box/blueprint-web";
2
2
  import "@box/blueprint-web-assets/icons/Line";
3
+ import "clsx";
3
4
  import "react-intl";
4
5
  import "./messages.js";
5
- import { C as e, C } from "../../../../chunks/clear-conversation-button.js";
6
+ import { C, C as n } from "../../../../chunks/clear-conversation-button.js";
6
7
  import "react/jsx-runtime";
7
8
  export {
8
- e as ClearConversationButton,
9
- C as default
9
+ C as ClearConversationButton,
10
+ n as default
10
11
  };
@@ -1,66 +1,68 @@
1
- import { Text as X, Tooltip as Z, IconButton as ee } from "@box/blueprint-web";
2
- import { ArrowsExpand as te } from "@box/blueprint-web-assets/icons/Fill";
3
- import { useAgents as ne, BoxAiAgentSelectorWithApi as oe } from "@box/box-ai-agent-selector";
4
- import y from "clsx";
5
- import F from "lodash/isEqual";
6
- import * as u from "react";
7
- import { useIntl as se } from "react-intl";
8
- import { BoxAiContentAnswers as ae } from "../../box-ai-content-answers.js";
9
- import { withApiWrapper as ie } from "../api-wrapper/api-wrapper.js";
10
- import { ORIGIN_BOXAI_SIDEBAR as re, EVENT_JS_READY as ce } from "../common/constants.js";
11
- import { mark as de } from "../common/performance.js";
12
- import { C as le } from "../../../../chunks/clear-conversation-button.js";
13
- import { IntelligenceModal as be } from "../modal/modal.js";
14
- import { IntelligenceSidebarContext as Se } from "./context.js";
15
- import x from "./messages.js";
16
- import ue from "./title.js";
17
- import { jsxs as A, Fragment as $, jsx as e } from "react/jsx-runtime";
18
- import '../../../../styles/content.css';const Ae = "_bcsSidebarBase_gfv6u_2", ge = "_bcsContent_gfv6u_2", pe = "_bcsBoxAISidebar_gfv6u_2", he = "_bcsContentHeader_gfv6u_6", me = "_bcsTitle_gfv6u_15", fe = "_bcsScrollContent_gfv6u_22", _e = "_withModalOpen_gfv6u_32", Ie = "_bcsBoxAISidebarAgentSelector_gfv6u_35", Ce = "_bcsBoxAISidebarAgentSelectorContainer_gfv6u_39", xe = "_bcsBoxAISidebarChatActions_gfv6u_43", Be = "_bcsBoxAISidebarContent_gfv6u_47", ve = "_bcsBoxAISidebarExpand_gfv6u_50", we = "_bcsBoxAISidebarTitlePart_gfv6u_53", Te = "_sidebarChip_gfv6u_77", Ee = "_bcsContentSubheader_gfv6u_90", Ne = "_bcsScrollContentWrapper_gfv6u_99", Pe = "_withSubheader_gfv6u_104", Le = "_expanded_gfv6u_107", t = {
19
- bcsSidebarBase: Ae,
20
- bcsContent: ge,
21
- bcsBoxAISidebar: pe,
22
- bcsContentHeader: he,
23
- bcsTitle: me,
24
- bcsScrollContent: fe,
25
- withModalOpen: _e,
26
- bcsBoxAISidebarAgentSelector: Ie,
27
- bcsBoxAISidebarAgentSelectorContainer: Ce,
28
- bcsBoxAISidebarChatActions: xe,
29
- bcsBoxAISidebarContent: Be,
30
- bcsBoxAISidebarExpand: ve,
31
- bcsBoxAISidebarTitlePart: we,
32
- sidebarChip: Te,
33
- bcsContentSubheader: Ee,
34
- bcsScrollContentWrapper: Ne,
35
- withSubheader: Pe,
36
- expanded: Le
37
- }, Me = `${re}_${ce}`;
38
- de(Me);
39
- const Oe = ({
40
- actions: B,
1
+ import { Text as te, Tooltip as $, IconButton as y } from "@box/blueprint-web";
2
+ import { ArrowsExpand as oe, XMark as ne } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { useAgents as se, BoxAiAgentSelectorWithApi as ae } from "@box/box-ai-agent-selector";
4
+ import Q from "clsx";
5
+ import H from "lodash/isEqual";
6
+ import * as h from "react";
7
+ import { useIntl as ie } from "react-intl";
8
+ import { BoxAiContentAnswers as re } from "../../box-ai-content-answers.js";
9
+ import { withApiWrapper as ce } from "../api-wrapper/api-wrapper.js";
10
+ import { ORIGIN_BOXAI_SIDEBAR as de, EVENT_JS_READY as le } from "../common/constants.js";
11
+ import { mark as be } from "../common/performance.js";
12
+ import { C as Se } from "../../../../chunks/clear-conversation-button.js";
13
+ import { IntelligenceModal as pe } from "../modal/modal.js";
14
+ import { IntelligenceSidebarContext as Ae } from "./context.js";
15
+ import b from "./messages.js";
16
+ import he from "./title.js";
17
+ import { jsxs as m, Fragment as V, jsx as e } from "react/jsx-runtime";
18
+ import '../../../../styles/content.css';const me = "_bcsSidebarBase_1kkpe_2", Ie = "_bcsContent_1kkpe_2", _e = "_bcsBoxAISidebar_1kkpe_2", ue = "_bcsContentHeader_1kkpe_6", Ce = "_bcsTitle_1kkpe_15", xe = "_bcsScrollContent_1kkpe_22", ge = "_withModalOpen_1kkpe_32", Be = "_bcsBoxAISidebarAgentSelector_1kkpe_35", fe = "_bcsBoxAISidebarAgentSelectorContainer_1kkpe_39", ke = "_bcsBoxAISidebarChatActions_1kkpe_43", we = "_bcsBoxAISidebarContent_1kkpe_47", Te = "_bcsBoxAISidebarExpand_1kkpe_50", Ee = "_bcsBoxAISidebarClear_1kkpe_53", Ne = "_bcsBoxAISidebarTitlePart_1kkpe_56", ve = "_bcsBoxAISidebarClose_1kkpe_77", Me = "_sidebarChip_1kkpe_88", Pe = "_bcsContentSubheader_1kkpe_101", Le = "_bcsScrollContentWrapper_1kkpe_110", Oe = "_withSubheader_1kkpe_115", Re = "_expanded_1kkpe_118", t = {
19
+ bcsSidebarBase: me,
20
+ bcsContent: Ie,
21
+ bcsBoxAISidebar: _e,
22
+ bcsContentHeader: ue,
23
+ bcsTitle: Ce,
24
+ bcsScrollContent: xe,
25
+ withModalOpen: ge,
26
+ bcsBoxAISidebarAgentSelector: Be,
27
+ bcsBoxAISidebarAgentSelectorContainer: fe,
28
+ bcsBoxAISidebarChatActions: ke,
29
+ bcsBoxAISidebarContent: we,
30
+ bcsBoxAISidebarExpand: Te,
31
+ bcsBoxAISidebarClear: Ee,
32
+ bcsBoxAISidebarTitlePart: Ne,
33
+ bcsBoxAISidebarClose: ve,
34
+ sidebarChip: Me,
35
+ bcsContentSubheader: Pe,
36
+ bcsScrollContentWrapper: Le,
37
+ withSubheader: Oe,
38
+ expanded: Re
39
+ }, qe = `${de}_${le}`;
40
+ be(qe);
41
+ const Ue = ({
42
+ actions: f,
41
43
  children: i,
42
- className: n,
43
- elementId: l = "",
44
- sidebarView: g = "",
44
+ className: o,
45
+ elementId: S = "",
46
+ sidebarView: I = "",
45
47
  title: r,
46
48
  subheader: c,
47
49
  ...d
48
50
  }) => {
49
- const b = `${l}${l === "" ? "" : "_"}${g}`, p = `${b}-content`;
50
- return /* @__PURE__ */ A("div", {
51
- "aria-labelledby": b,
52
- className: y(t.bcsContent, n),
51
+ const p = `${S}${S === "" ? "" : "_"}${I}`, _ = `${p}-content`;
52
+ return /* @__PURE__ */ m("div", {
53
+ "aria-labelledby": p,
54
+ className: Q(t.bcsContent, o),
53
55
  "data-testid": "bcs-content",
54
- id: p,
56
+ id: _,
55
57
  role: "tabpanel",
56
58
  ...d,
57
- children: [/* @__PURE__ */ A("div", {
59
+ children: [/* @__PURE__ */ m("div", {
58
60
  className: t.bcsContentHeader,
59
- children: [r && /* @__PURE__ */ e(X, {
61
+ children: [r && /* @__PURE__ */ e(te, {
60
62
  as: "h3",
61
63
  className: t.bcsTitle,
62
64
  children: r
63
- }), B]
65
+ }), f]
64
66
  }), c && /* @__PURE__ */ e("div", {
65
67
  className: t.bcsContentSubheader,
66
68
  children: c
@@ -73,182 +75,196 @@ const Oe = ({
73
75
  })]
74
76
  });
75
77
  };
76
- function Re(B) {
78
+ function We(f) {
77
79
  const {
78
80
  createSession: i,
79
- encodedSession: n,
80
- onClearAction: l,
81
- getAIStudioAgents: g,
81
+ encodedSession: o,
82
+ onClearAction: S,
83
+ getAIStudioAgents: I,
82
84
  hasRequestInProgress: r,
83
85
  hostAppName: c,
84
86
  isAIStudioAgentSelectorEnabled: d,
85
- isLoading: b,
86
- onSelectAgent: p,
87
- questions: h,
87
+ isLoading: p,
88
+ onSelectAgent: _,
89
+ questions: u,
88
90
  shouldShowLandingPage: N = !0,
89
- sendQuestion: m,
90
- stopQuestion: v,
91
- embedTheAnswerButtonConfig: H,
92
- ...P
93
- } = B, {
94
- formatMessage: f
95
- } = se(), L = u.useRef(!1), [w, M] = u.useState(!1), {
91
+ sendQuestion: C,
92
+ stopQuestion: k,
93
+ embedTheAnswerButtonConfig: z,
94
+ onClose: v,
95
+ ...M
96
+ } = f, {
97
+ formatMessage: l
98
+ } = ie(), P = h.useRef(!1), [w, L] = h.useState(!1), {
96
99
  cache: s,
97
100
  contentName: O,
98
- elementId: V,
99
- fileExtension: Q,
101
+ elementId: D,
102
+ fileExtension: j,
100
103
  isFeedbackEnabled: R,
101
- isFeedbackFormEnabled: k,
102
- isStopResponseEnabled: q,
104
+ isFeedbackFormEnabled: q,
105
+ isStopResponseEnabled: U,
103
106
  items: T,
104
- itemSize: D,
105
- onFeedbackFormSubmit: U,
106
- onUserInteraction: W,
107
- onSelectedAgentCallback: j,
108
- recordAction: S,
109
- setCacheValue: _,
110
- shouldPreinitSession: I
111
- } = u.useContext(Se), {
112
- agents: z,
113
- requestState: J,
107
+ itemSize: J,
108
+ onFeedbackFormSubmit: W,
109
+ onUserInteraction: F,
110
+ onSelectedAgentCallback: X,
111
+ recordAction: A,
112
+ setCacheValue: x,
113
+ shouldPreinitSession: g
114
+ } = h.useContext(Ae), {
115
+ agents: Y,
116
+ requestState: G,
114
117
  selectedAgent: E
115
- } = ne(), {
118
+ } = se(), {
116
119
  questions: a
117
120
  } = s;
118
- s.shouldShowLandingPage !== N && _("shouldShowLandingPage", N), s.encodedSession !== n && _("encodedSession", n), F(s.questions, h) || _("questions", h), F(s.agents.selectedAgent, E) || _("agents", {
119
- agents: z,
120
- requestState: J,
121
+ s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o), H(s.questions, u) || x("questions", u), H(s.agents.selectedAgent, E) || x("agents", {
122
+ agents: Y,
123
+ requestState: G,
121
124
  selectedAgent: E
122
125
  });
123
- const C = (o = !1) => {
124
- !I && !n && !b && i && i(!0, !1), o && W && W();
125
- }, Y = () => {
126
- M(!1);
127
- }, G = () => {
128
- C(), M(!0);
126
+ const B = (n = !1) => {
127
+ !g && !o && !p && i && i(!0, !1), n && F && F();
128
+ }, K = () => {
129
+ L(!1);
130
+ }, Z = () => {
131
+ B(), L(!0);
129
132
  };
130
- u.useEffect(() => (I && !n && i && i(!0, !0), n && a.length > 0 && a[a.length - 1].isCompleted === !1 && m({
133
+ h.useEffect(() => (g && !o && i && i(!0, !0), o && a.length > 0 && a[a.length - 1].isCompleted === !1 && C({
131
134
  prompt: a[a.length - 1].prompt
132
- }), S && S({
135
+ }), A && A({
133
136
  action: "programmatic",
134
137
  component: "sidebar",
135
138
  feature: "answers",
136
139
  target: "loaded",
137
140
  data: {
138
- items: T.map((o) => ({
139
- status: o.status,
140
- fileType: o.fileType
141
+ items: T.map((n) => ({
142
+ status: n.status,
143
+ fileType: n.fileType
141
144
  }))
142
145
  }
143
146
  }), () => {
144
- v();
145
- }), []), u.useEffect(() => {
146
- const o = a[a.length - 1];
147
- !I && !L.current && n && (o != null && o.isLoading) && (m(o, E, !1), L.current = !0);
148
- }, [n]);
149
- const K = () => /* @__PURE__ */ A("div", {
147
+ k();
148
+ }), []), h.useEffect(() => {
149
+ const n = a[a.length - 1];
150
+ !g && !P.current && o && (n != null && n.isLoading) && (C(n, E, !1), P.current = !0);
151
+ }, [o]);
152
+ const ee = () => /* @__PURE__ */ m("div", {
150
153
  className: t.bcsBoxAISidebarTitlePart,
151
- children: [/* @__PURE__ */ e(ue, {
154
+ children: [/* @__PURE__ */ e(he, {
152
155
  isAIStudioAgentSelectorEnabled: d
153
156
  }), d && /* @__PURE__ */ e("div", {
154
157
  className: t.bcsBoxAISidebarAgentSelector,
155
- children: /* @__PURE__ */ e(oe, {
158
+ children: /* @__PURE__ */ e(ae, {
156
159
  disabled: r,
157
- fetcher: g,
160
+ fetcher: I,
158
161
  hostAppName: c,
159
- onAgentsListOpen: C,
160
- onSelectAgent: p,
161
- onSelectedAgentCallback: j,
162
- recordAction: S,
162
+ onAgentsListOpen: B,
163
+ onSelectAgent: _,
164
+ onSelectedAgentCallback: X,
165
+ recordAction: A,
163
166
  shouldHideAgentSelectorOnLoad: !0,
164
167
  useAgentLocalStorage: !0,
165
168
  variant: "sidebar"
166
169
  })
167
170
  })]
168
171
  });
169
- return /* @__PURE__ */ A($, {
170
- children: [/* @__PURE__ */ e(Oe, {
171
- actions: /* @__PURE__ */ A($, {
172
- children: [K(), /* @__PURE__ */ e(le, {
172
+ return /* @__PURE__ */ m(V, {
173
+ children: [/* @__PURE__ */ e(Ue, {
174
+ actions: /* @__PURE__ */ m(V, {
175
+ children: [ee(), /* @__PURE__ */ e(Se, {
176
+ className: t.bcsBoxAISidebarClear,
173
177
  hasRequestInProgress: r,
174
- onClick: l
175
- }), /* @__PURE__ */ e(Z, {
176
- content: f(x.sidebarBoxAISwitchToModalView),
178
+ onClick: S
179
+ }), /* @__PURE__ */ e($, {
180
+ content: l(b.sidebarBoxAISwitchToModalView),
177
181
  "data-testid": "content-answers-open-modal-tooltip",
178
182
  variant: "standard",
179
- children: /* @__PURE__ */ e(ee, {
180
- "aria-label": f(x.sidebarBoxAISwitchToModalView),
183
+ children: /* @__PURE__ */ e(y, {
184
+ "aria-label": l(b.sidebarBoxAISwitchToModalView),
181
185
  className: t.bcsBoxAISidebarExpand,
182
186
  "data-target-id": "IconButton-expandBoxAISidebar",
183
- icon: te,
184
- onClick: G,
187
+ icon: oe,
188
+ onClick: Z,
189
+ size: "small"
190
+ })
191
+ }), v && /* @__PURE__ */ e($, {
192
+ content: l(b.sidebarBoxAIClose),
193
+ "data-testid": "content-answers-close-tooltip",
194
+ variant: "standard",
195
+ children: /* @__PURE__ */ e(y, {
196
+ "aria-label": l(b.sidebarBoxAIClose),
197
+ className: t.bcsBoxAISidebarClose,
198
+ "data-target-id": "IconButton-closeBoxAISidebar",
199
+ icon: ne,
200
+ onClick: v,
185
201
  size: "small"
186
202
  })
187
203
  })]
188
204
  }),
189
- className: y(t.bcsBoxAISidebar, {
205
+ className: Q(t.bcsBoxAISidebar, {
190
206
  [t.withModalOpen]: w
191
207
  }),
192
- elementId: V,
208
+ elementId: D,
193
209
  sidebarView: "box-ai",
194
210
  children: /* @__PURE__ */ e("div", {
195
211
  className: t.bcsBoxAISidebarContent,
196
- children: /* @__PURE__ */ e(ae, {
212
+ children: /* @__PURE__ */ e(re, {
197
213
  className: t.bcsBoxAISidebarContentAnswers,
198
214
  contentName: O,
199
- contentType: f(x.sidebarBoxAIContent),
200
- embedTheAnswerButtonConfig: H,
215
+ contentType: l(b.sidebarBoxAIContent),
216
+ embedTheAnswerButtonConfig: z,
201
217
  hostAppName: c,
202
218
  isAIStudioAgentSelectorEnabled: d,
203
219
  isFeedbackEnabled: R,
204
- isFeedbackFormEnabled: k,
205
- isStopResponseEnabled: q,
220
+ isFeedbackFormEnabled: q,
221
+ isStopResponseEnabled: U,
206
222
  items: T,
207
- onFeedbackFormSubmit: U,
208
- onUserIntentToUseAI: C,
209
- questions: h,
210
- recordAction: S,
223
+ onFeedbackFormSubmit: W,
224
+ onUserIntentToUseAI: B,
225
+ questions: u,
226
+ recordAction: A,
211
227
  shouldShowLandingPage: s.shouldShowLandingPage,
212
- showLoadingIndicator: b && I,
213
- stopQuestion: v,
214
- submitQuestion: m,
228
+ showLoadingIndicator: p && g,
229
+ stopQuestion: k,
230
+ submitQuestion: C,
215
231
  variant: "sidebar",
216
- ...P
232
+ ...M
217
233
  })
218
234
  })
219
- }), /* @__PURE__ */ e(be, {
235
+ }), /* @__PURE__ */ e(pe, {
220
236
  contentName: O,
221
- contentType: f(x.sidebarBoxAIContent),
222
- extension: Q,
223
- getAIStudioAgents: g,
237
+ contentType: l(b.sidebarBoxAIContent),
238
+ extension: j,
239
+ getAIStudioAgents: I,
224
240
  hasRequestInProgress: r,
225
241
  hostAppName: c,
226
242
  isAIStudioAgentSelectorEnabled: d,
227
243
  isFeedbackEnabled: R,
228
- isFeedbackFormEnabled: k,
229
- isStopResponseEnabled: q,
244
+ isFeedbackFormEnabled: q,
245
+ isStopResponseEnabled: U,
230
246
  items: T,
231
- itemSize: D,
232
- onClearAction: l,
233
- onFeedbackFormSubmit: U,
234
- onOpenChange: Y,
235
- onSelectAgent: p,
236
- onUserIntentToUseAI: C,
247
+ itemSize: J,
248
+ onClearAction: S,
249
+ onFeedbackFormSubmit: W,
250
+ onOpenChange: K,
251
+ onSelectAgent: _,
252
+ onUserIntentToUseAI: B,
237
253
  open: w,
238
- questions: h,
239
- recordAction: w ? S : void 0,
254
+ questions: u,
255
+ recordAction: w ? A : void 0,
240
256
  shouldShowLandingPage: s.shouldShowLandingPage,
241
257
  showLoadingIndicator: !1,
242
258
  stopPropagationOnEsc: !0,
243
- stopQuestion: v,
244
- submitQuestion: m,
259
+ stopQuestion: k,
260
+ submitQuestion: C,
245
261
  variant: "collapsible",
246
- ...P,
262
+ ...M,
247
263
  shouldRenderProviders: !1
248
264
  })]
249
265
  });
250
266
  }
251
- const Xe = ie(Re);
267
+ const ot = ce(We);
252
268
  export {
253
- Xe as default
269
+ ot as default
254
270
  };
@@ -16,6 +16,10 @@ const t = e({
16
16
  id: "contentAnswersSidebar.sidebarBoxAISwitchToModalView",
17
17
  defaultMessage: "Switch to modal view"
18
18
  },
19
+ sidebarBoxAIClose: {
20
+ id: "contentAnswersSidebar.sidebarBoxAIClose",
21
+ defaultMessage: "Close"
22
+ },
19
23
  sidebarBoxAIContent: {
20
24
  id: "contentAnswersSidebar.sidebarBoxAIContent",
21
25
  defaultMessage: "content"
@@ -1,12 +1,12 @@
1
- import { AgentsProvider as U } from "@box/box-ai-agent-selector";
1
+ import { AgentsProvider as V } from "@box/box-ai-agent-selector";
2
2
  import * as F from "react";
3
- import { useIntl as V } from "react-intl";
4
- import { SPREADSHEET_FILE_EXTENSIONS as X, INTELLIGENT_QUERY_COMPATIBLE_SPREADSHEET_EXTENSIONS as j } from "../common/constants.js";
5
- import G from "./content.js";
6
- import { IntelligenceSidebarContext as W } from "./context.js";
3
+ import { useIntl as X } from "react-intl";
4
+ import { SPREADSHEET_FILE_EXTENSIONS as j, INTELLIGENT_QUERY_COMPATIBLE_SPREADSHEET_EXTENSIONS as G } from "../common/constants.js";
5
+ import W from "./content.js";
6
+ import { IntelligenceSidebarContext as Y } from "./context.js";
7
7
  import g from "./messages.js";
8
8
  import { jsx as m } from "react/jsx-runtime";
9
- const te = (L) => {
9
+ const oe = (L) => {
10
10
  var P;
11
11
  const {
12
12
  cache: e,
@@ -31,15 +31,16 @@ const te = (L) => {
31
31
  setHasQuestions: l,
32
32
  promptButtonClickHandler: H,
33
33
  embedTheAnswerButtonConfig: _,
34
- ...v
34
+ onClose: v,
35
+ ...x
35
36
  } = L, {
36
37
  questions: s,
37
- agents: x
38
+ agents: R
38
39
  } = e, {
39
40
  selectedAgent: a
40
- } = x, {
41
+ } = R, {
41
42
  formatMessage: u
42
- } = V(), R = F.useMemo(() => ({
43
+ } = X(), y = F.useMemo(() => ({
43
44
  cache: e,
44
45
  contentName: S,
45
46
  elementId: f,
@@ -61,20 +62,20 @@ const te = (L) => {
61
62
  }, [w, l]);
62
63
  let d = s;
63
64
  s.length > 0 && !s[s.length - 1].isCompleted && (d = d.slice(0, -1));
64
- const y = X.includes(t), D = j.includes(t);
65
+ const D = j.includes(t), O = G.includes(t);
65
66
  let c = "";
66
- M && D ? c = u(g.welcomeMessageIntelligentQueryNotice) : y && (c = u(g.welcomeMessageSpreadsheetNotice));
67
- const A = (a == null ? void 0 : a.suggestedQuestions) !== null, O = (z) => {
68
- i("suggestedQuestions", z);
69
- }, B = typeof h == "function" ? [] : k, q = ((P = e.suggestedQuestions) == null ? void 0 : P.length) > 0 && !A ? e.suggestedQuestions : B;
67
+ M && O ? c = u(g.welcomeMessageIntelligentQueryNotice) : D && (c = u(g.welcomeMessageSpreadsheetNotice));
68
+ const A = (a == null ? void 0 : a.suggestedQuestions) !== null, B = (U) => {
69
+ i("suggestedQuestions", U);
70
+ }, q = typeof h == "function" ? [] : k, z = ((P = e.suggestedQuestions) == null ? void 0 : P.length) > 0 && !A ? e.suggestedQuestions : q;
70
71
  return (
71
72
  // IntelligenceSidebarContent is using withApiWrapper that is not passing all provided props,
72
73
  // that's why we need to use provider to pass other props
73
- /* @__PURE__ */ m(U, {
74
+ /* @__PURE__ */ m(V, {
74
75
  value: e.agents,
75
- children: /* @__PURE__ */ m(W.Provider, {
76
- value: R,
77
- children: /* @__PURE__ */ m(G, {
76
+ children: /* @__PURE__ */ m(Y.Provider, {
77
+ value: y,
78
+ children: /* @__PURE__ */ m(W, {
78
79
  cachedSuggestedQuestions: A ? [] : e.suggestedQuestions,
79
80
  embedTheAnswerButtonConfig: _,
80
81
  getSuggestedQuestions: h,
@@ -82,22 +83,23 @@ const te = (L) => {
82
83
  isStopResponseEnabled: o,
83
84
  itemID: T,
84
85
  items: n,
85
- onSuggestedQuestionsFetched: O,
86
+ onClose: v,
87
+ onSuggestedQuestionsFetched: B,
86
88
  promptButtonClickHandler: H,
87
89
  restoredQuestions: d,
88
90
  restoredSession: e.encodedSession,
89
91
  restoredShouldShowLandingPage: e.shouldShowLandingPage,
90
92
  shouldPreinitSession: r,
91
- suggestedQuestions: q,
93
+ suggestedQuestions: z,
92
94
  warningNotice: c,
93
95
  warningNoticeAriaLabel: u(g.welcomeMessageSpreadsheetNoticeAriaLabel),
94
- ...v
96
+ ...x
95
97
  })
96
98
  })
97
99
  })
98
100
  );
99
101
  };
100
102
  export {
101
- te as IntelligenceSidebar,
102
- te as default
103
+ oe as IntelligenceSidebar,
104
+ oe as default
103
105
  };
@@ -85,6 +85,7 @@ export default {
85
85
  "boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "আপনি নিজের স্প্রেডশিটে সরল ও জটিল প্রশ্ন, উভয়ই Box AI-কে জিজ্ঞাসা করতে পারেন: মোট হিসাব, গড়পড়তা, উন্নত তুলনা, ট্রেন্ড বিশ্লেষণ এবং আরও অনেক কিছু। আজই এটি ব্যবহার করে করুন!",
86
86
  "boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "বেশি টেক্সট থাকা ফাইলে স্প্রেডশীট সাপোর্ট সবচেয়ে ভালো কাজ করে",
87
87
  "boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "স্প্রেডশীট সাপোর্ট বিজ্ঞপ্তি ব্যানার",
88
+ "contentAnswersSidebar.sidebarBoxAIClose": "বন্ধ করুন",
88
89
  "contentAnswersSidebar.sidebarBoxAIContent": "বিষয়বস্তু",
89
90
  "contentAnswersSidebar.sidebarBoxAISwitchToModalView": "মোডাল ভিউতে সুইচ করুন"
90
91
  }
@@ -170,6 +170,8 @@ boxui.contentAnswers.welcomeMessageIntelligentQueryNotice = আপনি নি
170
170
  boxui.contentAnswers.welcomeMessageSpreadsheetNotice = বেশি টেক্সট থাকা ফাইলে স্প্রেডশীট সাপোর্ট সবচেয়ে ভালো কাজ করে
171
171
  # Aria label for the icon inside spreadsheet notification
172
172
  boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel = স্প্রেডশীট সাপোর্ট বিজ্ঞপ্তি ব্যানার
173
+ # Label for button that closes the Box AI Sidebar
174
+ contentAnswersSidebar.sidebarBoxAIClose = বন্ধ করুন
173
175
  # Generic Box AI content type opened used in welcome message and placeholder
174
176
  contentAnswersSidebar.sidebarBoxAIContent = বিষয়বস্তু
175
177
  # Label for button that triggers switch to Box AI Modal
@@ -85,6 +85,7 @@ export default {
85
85
  "boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "Du kan stille Box AI både enkle og komplekse spørgsmål i dit regneark: totaltællinger, gennemsnit, avancerede sammenligninger, trendanalyser og så videre. Prøv det i dag!",
86
86
  "boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Regnearkssupport virker bedst med de teksttunge filer",
87
87
  "boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "banner til meddelelse om regnearksstøtte",
88
+ "contentAnswersSidebar.sidebarBoxAIClose": "Luk",
88
89
  "contentAnswersSidebar.sidebarBoxAIContent": "Indhold",
89
90
  "contentAnswersSidebar.sidebarBoxAISwitchToModalView": "Skift til modal visning"
90
91
  }