@box/box-ai-content-answers 0.155.0 → 0.156.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 (44) hide show
  1. package/dist/esm/lib/components/api-wrapper/hooks/useContentAnswers.js +113 -109
  2. package/dist/esm/lib/components/api-wrapper/records.js +10 -8
  3. package/dist/esm/lib/components/api-wrapper/utils/stream.js +27 -27
  4. package/dist/esm/lib/components/chat/chat.js +90 -84
  5. package/dist/esm/lib/components/thinkingBubble/boxAILoadingIndicator.js +235 -0
  6. package/dist/esm/lib/components/thinkingBubble/messages.js +26 -0
  7. package/dist/esm/lib/components/thinkingBubble/thinkingBubble.js +122 -0
  8. package/dist/i18n/bn-IN.js +5 -0
  9. package/dist/i18n/da-DK.js +5 -0
  10. package/dist/i18n/de-DE.js +5 -0
  11. package/dist/i18n/en-AU.js +5 -0
  12. package/dist/i18n/en-CA.js +5 -0
  13. package/dist/i18n/en-GB.js +5 -0
  14. package/dist/i18n/en-US.js +5 -0
  15. package/dist/i18n/en-US.properties +10 -0
  16. package/dist/i18n/en-x-pseudo.js +5 -0
  17. package/dist/i18n/es-419.js +5 -0
  18. package/dist/i18n/es-ES.js +5 -0
  19. package/dist/i18n/fi-FI.js +5 -0
  20. package/dist/i18n/fr-CA.js +5 -0
  21. package/dist/i18n/fr-FR.js +5 -0
  22. package/dist/i18n/hi-IN.js +5 -0
  23. package/dist/i18n/it-IT.js +5 -0
  24. package/dist/i18n/ja-JP.js +5 -0
  25. package/dist/i18n/json/src/lib/components/thinkingBubble/messages.json +1 -0
  26. package/dist/i18n/ko-KR.js +5 -0
  27. package/dist/i18n/nb-NO.js +5 -0
  28. package/dist/i18n/nl-NL.js +5 -0
  29. package/dist/i18n/pl-PL.js +5 -0
  30. package/dist/i18n/pt-BR.js +5 -0
  31. package/dist/i18n/ru-RU.js +5 -0
  32. package/dist/i18n/sv-SE.js +5 -0
  33. package/dist/i18n/tr-TR.js +5 -0
  34. package/dist/i18n/zh-CN.js +5 -0
  35. package/dist/i18n/zh-TW.js +5 -0
  36. package/dist/styles/boxAILoadingIndicator.css +1 -0
  37. package/dist/styles/thinkingBubble.css +1 -0
  38. package/dist/types/lib/components/api-wrapper/records.d.ts +1 -0
  39. package/dist/types/lib/components/api-wrapper/types.d.ts +1 -0
  40. package/dist/types/lib/components/thinkingBubble/boxAILoadingIndicator.d.ts +3 -0
  41. package/dist/types/lib/components/thinkingBubble/messages.d.ts +28 -0
  42. package/dist/types/lib/components/thinkingBubble/thinkingBubble.d.ts +26 -0
  43. package/dist/types/lib/types.d.ts +1 -0
  44. package/package.json +1 -1
@@ -1,37 +1,38 @@
1
- import { Text as V } from "@box/blueprint-web";
2
- import { BoxAiLogo as X } from "@box/blueprint-web-assets/icons/Logo";
3
- import { Size10 as _ } from "@box/blueprint-web-assets/tokens/tokens";
4
- import Y from "clsx";
5
- import * as Z from "react";
6
- import { useIntl as $ } from "react-intl";
7
- import { Answer as L } from "../answer/answer.js";
8
- import { MediaContainer as P } from "../common/media-container.js";
9
- import { Question as S } from "../question/question.js";
10
- import { SuggestedQuestions as ee } from "../suggested-questions/suggested-questions.js";
11
- import te from "../welcome-message/messages.js";
12
- import { WelcomeMessage as oe } from "../welcome-message/welcome-message.js";
13
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
14
- import '../../../../styles/chat.css';const ae = "_chat_77vqr_1", re = "_clearChatText_77vqr_1", se = "_landingPage_77vqr_7", ie = "_askQuestionText_77vqr_15", ne = "_iconAvatar_77vqr_23", ce = "_sidebar_77vqr_39", a = {
15
- chat: ae,
16
- clearChatText: re,
17
- landingPage: se,
18
- askQuestionText: ie,
19
- iconAvatar: ne,
20
- sidebar: ce
21
- }, ge = ({
1
+ import { Text as Y } from "@box/blueprint-web";
2
+ import { BoxAiLogo as Z } from "@box/blueprint-web-assets/icons/Logo";
3
+ import { Size10 as f } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import $ from "clsx";
5
+ import * as w from "react";
6
+ import { useIntl as L } from "react-intl";
7
+ import { Answer as P } from "../answer/answer.js";
8
+ import { MediaContainer as S } from "../common/media-container.js";
9
+ import { Question as ee } from "../question/question.js";
10
+ import { SuggestedQuestions as te } from "../suggested-questions/suggested-questions.js";
11
+ import { ThinkingBubble as oe } from "../thinkingBubble/thinkingBubble.js";
12
+ import ae from "../welcome-message/messages.js";
13
+ import { WelcomeMessage as ie } from "../welcome-message/welcome-message.js";
14
+ import { jsx as e, jsxs as _ } from "react/jsx-runtime";
15
+ import '../../../../styles/chat.css';const re = "_chat_77vqr_1", se = "_clearChatText_77vqr_1", ne = "_landingPage_77vqr_7", ce = "_askQuestionText_77vqr_15", le = "_iconAvatar_77vqr_23", me = "_sidebar_77vqr_39", a = {
16
+ chat: re,
17
+ clearChatText: se,
18
+ landingPage: ne,
19
+ askQuestionText: ce,
20
+ iconAvatar: le,
21
+ sidebar: me
22
+ }, qe = ({
22
23
  askSuggestedQuestion: h,
23
24
  contentType: n,
24
- hasCustomSuggestedQuestions: x,
25
- hasRequestInProgress: T,
25
+ hasCustomSuggestedQuestions: T,
26
+ hasRequestInProgress: x,
26
27
  isCitationsEnabled: b,
27
- isFeedbackEnabled: v,
28
- isFeedbackFormEnabled: C,
28
+ isFeedbackEnabled: C,
29
+ isFeedbackFormEnabled: v,
29
30
  isInlineCitationsEnabled: g = !1,
30
31
  isMarkdownEnabled: k,
31
- isSessionLoading: q = !1,
32
- onCitationClick: u,
33
- onAnswerCopy: A,
34
- onFeedbackFormSubmit: F,
32
+ isSessionLoading: u = !1,
33
+ onCitationClick: q,
34
+ onAnswerCopy: F,
35
+ onFeedbackFormSubmit: A,
35
36
  onSuggestedQuestionInteraction: I,
36
37
  questions: N,
37
38
  recordAction: c,
@@ -42,109 +43,114 @@ import '../../../../styles/chat.css';const ae = "_chat_77vqr_1", re = "_clearCha
42
43
  shouldFeedbackFormIncludeFeedbackText: j,
43
44
  shouldFeedbackIncludePromptData: y,
44
45
  shouldShowLandingPage: o,
45
- useAnimation: M,
46
+ useAnimation: B,
46
47
  variant: t = "modal",
47
- hostAppName: w = "",
48
+ hostAppName: M = "",
48
49
  isReactMarkdownEnabled: z,
49
- welcomeMessageClearText: B,
50
- ...d
50
+ welcomeMessageClearText: R,
51
+ ...p
51
52
  }) => {
52
53
  const {
53
- formatMessage: R
54
- } = $(), [W, D] = Z.useState(null), E = (r, s) => {
55
- D(r ? s : null);
54
+ formatMessage: W
55
+ } = L(), [D, E] = w.useState(null), G = (i, r) => {
56
+ E(i ? r : null);
56
57
  };
57
58
  return /* @__PURE__ */ e("div", {
58
59
  className: a.chat,
59
60
  "data-testid": "content-answers-chat",
60
- children: /* @__PURE__ */ f("div", {
61
- className: Y({
61
+ children: /* @__PURE__ */ _("div", {
62
+ className: $({
62
63
  [a.landingPage]: o,
63
64
  [a.sidebar]: t === "sidebar"
64
65
  }),
65
- children: [o && /* @__PURE__ */ e(P.Figure, {
66
+ children: [o && /* @__PURE__ */ e(S.Figure, {
66
67
  variant: t,
67
68
  children: /* @__PURE__ */ e("div", {
68
69
  className: a.iconAvatar,
69
- children: /* @__PURE__ */ e(X, {
70
- height: _,
70
+ children: /* @__PURE__ */ e(Z, {
71
+ height: f,
71
72
  role: "presentation",
72
- width: _
73
+ width: f
73
74
  })
74
75
  })
75
- }), /* @__PURE__ */ e(oe, {
76
+ }), /* @__PURE__ */ e(ie, {
76
77
  contentType: "",
77
78
  shouldShowLandingPage: o,
78
- ...d,
79
+ ...p,
79
80
  variant: t
80
- }), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(ee, {
81
+ }), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(te, {
81
82
  askSuggestedQuestion: h,
82
- hasCustomSuggestedQuestions: x,
83
- isLoading: T,
83
+ hasCustomSuggestedQuestions: T,
84
+ isLoading: x,
84
85
  onSuggestedQuestionInteraction: I,
85
86
  recordAction: c,
86
87
  setAskSuggestedQuestion: l,
87
88
  suggestedQuestions: m,
88
89
  suggestedQuestionsRequestState: Q,
89
90
  variant: t
90
- }), /* @__PURE__ */ e(V, {
91
+ }), /* @__PURE__ */ e(Y, {
91
92
  as: "p",
92
93
  className: a.clearChatText,
93
- children: B || R(te.welcomeClearChatText, {
94
+ children: R || W(ae.welcomeClearChatText, {
94
95
  type: n
95
96
  })
96
97
  }), !o && /* @__PURE__ */ e("ul", {
97
98
  children: N.map(({
98
- answer: r,
99
- citations: s,
100
- id: i,
101
- isCompleted: G,
102
- isLoading: H,
103
- error: J,
104
- prompt: p,
105
- promptType: K,
106
- feedbackValue: U
107
- }) => /* @__PURE__ */ f("li", {
108
- children: [/* @__PURE__ */ e(S, {
109
- prompt: p,
99
+ answer: i,
100
+ thinkingAnswer: r,
101
+ citations: H,
102
+ id: s,
103
+ isCompleted: J,
104
+ isLoading: K,
105
+ error: U,
106
+ prompt: d,
107
+ promptType: V,
108
+ feedbackValue: X
109
+ }) => /* @__PURE__ */ _("li", {
110
+ children: [/* @__PURE__ */ e(ee, {
111
+ prompt: d,
110
112
  variant: t
111
- }), /* @__PURE__ */ e(L, {
112
- answer: r,
113
- citations: s,
113
+ }), r && /* @__PURE__ */ e(oe, {
114
+ content: r,
115
+ isThinkingComplete: !!i,
116
+ variant: t
117
+ }), /* @__PURE__ */ e(P, {
118
+ answer: i,
119
+ citations: H,
114
120
  contentType: n,
115
- error: J,
116
- feedbackValue: U,
117
- hostAppName: w,
121
+ error: U,
122
+ feedbackValue: X,
123
+ hostAppName: M,
118
124
  isCitationsEnabled: b,
119
- isCompleted: G,
120
- isFeedbackEnabled: v,
121
- isFeedbackFormEnabled: C,
122
- isFeedbackTooltipOpen: W === i,
125
+ isCompleted: J,
126
+ isFeedbackEnabled: C,
127
+ isFeedbackFormEnabled: v,
128
+ isFeedbackTooltipOpen: D === s,
123
129
  isInlineCitationsEnabled: g,
124
- isLoading: H || q,
130
+ isLoading: K || u,
125
131
  isMarkdownEnabled: k,
126
132
  isReactMarkdownEnabled: z,
127
- items: d.items,
128
- onAnswerCopy: A,
129
- onCitationClick: u,
130
- onFeedbackFormSubmit: F,
131
- onFeedbackTooltipOpenChange: E,
132
- prompt: p,
133
- promptType: K,
134
- questionId: i,
133
+ items: p.items,
134
+ onAnswerCopy: F,
135
+ onCitationClick: q,
136
+ onFeedbackFormSubmit: A,
137
+ onFeedbackTooltipOpenChange: G,
138
+ prompt: d,
139
+ promptType: V,
140
+ questionId: s,
135
141
  recordAction: c,
136
142
  setAnswerFeedback: O,
137
143
  shouldFeedbackFormIncludeFeedbackText: j,
138
144
  shouldFeedbackIncludePromptData: y,
139
- useAnimation: M,
145
+ useAnimation: B,
140
146
  variant: t
141
147
  })]
142
- }, i))
148
+ }, s))
143
149
  })]
144
150
  })
145
151
  });
146
152
  };
147
153
  export {
148
- ge as Chat,
149
- ge as default
154
+ qe as Chat,
155
+ qe as default
150
156
  };
@@ -0,0 +1,235 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import '../../../../styles/boxAILoadingIndicator.css';const t = "_boxAILoadingIndicator_ddl80_1", l = "_ring_ddl80_1", i = "_ringTwo_ddl80_11", a = "_blueRing_ddl80_18", n = "_blueDraw_ddl80_1", s = "_blueFade_ddl80_1", p = "_blueRingTwo_ddl80_22", c = "_purpleRing_ddl80_25", d = "_purpleDraw_ddl80_1", g = "_purpleFade_ddl80_1", y = "_purpleRingTwo_ddl80_29", _ = "_magentaRing_ddl80_32", u = "_magentaDraw_ddl80_1", w = "_magentaFade_ddl80_1", m = "_magentaRingTwo_ddl80_36", x = "_bgRings_ddl80_39", o = {
3
+ boxAILoadingIndicator: t,
4
+ ring: l,
5
+ ringTwo: i,
6
+ blueRing: a,
7
+ blueDraw: n,
8
+ blueFade: s,
9
+ blueRingTwo: p,
10
+ purpleRing: c,
11
+ purpleDraw: d,
12
+ purpleFade: g,
13
+ purpleRingTwo: y,
14
+ magentaRing: _,
15
+ magentaDraw: u,
16
+ magentaFade: w,
17
+ magentaRingTwo: m,
18
+ bgRings: x
19
+ }, h = () => /* @__PURE__ */ r("svg", {
20
+ className: o.boxAILoadingIndicator,
21
+ viewBox: "0 0 400 400",
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ children: [/* @__PURE__ */ r("defs", {
24
+ children: [/* @__PURE__ */ r("linearGradient", {
25
+ id: "magentaGradient",
26
+ x1: "0%",
27
+ x2: "100%",
28
+ y1: "0%",
29
+ y2: "100%",
30
+ children: [/* @__PURE__ */ e("stop", {
31
+ offset: "0%",
32
+ style: {
33
+ stopColor: "#FF80FF",
34
+ stopOpacity: 1
35
+ }
36
+ }), /* @__PURE__ */ e("stop", {
37
+ offset: "50%",
38
+ style: {
39
+ stopColor: "#FF00FF",
40
+ stopOpacity: 1
41
+ }
42
+ }), /* @__PURE__ */ e("stop", {
43
+ offset: "100%",
44
+ style: {
45
+ stopColor: "#CC00CC",
46
+ stopOpacity: 1
47
+ }
48
+ })]
49
+ }), /* @__PURE__ */ r("linearGradient", {
50
+ id: "purpleGradient",
51
+ x1: "0%",
52
+ x2: "100%",
53
+ y1: "0%",
54
+ y2: "100%",
55
+ children: [/* @__PURE__ */ e("stop", {
56
+ offset: "0%",
57
+ style: {
58
+ stopColor: "#BB66EE",
59
+ stopOpacity: 1
60
+ }
61
+ }), /* @__PURE__ */ e("stop", {
62
+ offset: "50%",
63
+ style: {
64
+ stopColor: "#9933CC",
65
+ stopOpacity: 1
66
+ }
67
+ }), /* @__PURE__ */ e("stop", {
68
+ offset: "100%",
69
+ style: {
70
+ stopColor: "#7722AA",
71
+ stopOpacity: 1
72
+ }
73
+ })]
74
+ }), /* @__PURE__ */ r("linearGradient", {
75
+ id: "blueGradient",
76
+ x1: "0%",
77
+ x2: "100%",
78
+ y1: "0%",
79
+ y2: "100%",
80
+ children: [/* @__PURE__ */ e("stop", {
81
+ offset: "0%",
82
+ style: {
83
+ stopColor: "#77BBFF",
84
+ stopOpacity: 1
85
+ }
86
+ }), /* @__PURE__ */ e("stop", {
87
+ offset: "50%",
88
+ style: {
89
+ stopColor: "#3399FF",
90
+ stopOpacity: 1
91
+ }
92
+ }), /* @__PURE__ */ e("stop", {
93
+ offset: "100%",
94
+ style: {
95
+ stopColor: "#0077DD",
96
+ stopOpacity: 1
97
+ }
98
+ })]
99
+ }), /* @__PURE__ */ r("filter", {
100
+ height: "140%",
101
+ id: "whiteBorder",
102
+ width: "140%",
103
+ x: "-20%",
104
+ y: "-20%",
105
+ children: [/* @__PURE__ */ e("feMorphology", {
106
+ in: "SourceAlpha",
107
+ operator: "dilate",
108
+ radius: "5",
109
+ result: "expanded"
110
+ }), /* @__PURE__ */ e("feFlood", {
111
+ floodColor: "white",
112
+ floodOpacity: "1",
113
+ result: "whiteColor"
114
+ }), /* @__PURE__ */ e("feComposite", {
115
+ in: "whiteColor",
116
+ in2: "expanded",
117
+ operator: "in",
118
+ result: "whiteBorder"
119
+ }), /* @__PURE__ */ e("feComposite", {
120
+ in: "SourceGraphic",
121
+ in2: "whiteBorder",
122
+ operator: "over"
123
+ })]
124
+ }), /* @__PURE__ */ e("clipPath", {
125
+ id: "clip1",
126
+ children: /* @__PURE__ */ e("path", {
127
+ d: "M0,200 L400,200 L400,400 L0,400 z"
128
+ })
129
+ }), /* @__PURE__ */ e("clipPath", {
130
+ id: "clip2",
131
+ children: /* @__PURE__ */ e("path", {
132
+ d: "M0,0 L400,0 L400,200 L0,200 z"
133
+ })
134
+ })]
135
+ }), /* @__PURE__ */ r("g", {
136
+ className: o.bgRings,
137
+ children: [/* @__PURE__ */ r("g", {
138
+ clipPath: "url(#clip1)",
139
+ children: [/* @__PURE__ */ e("ellipse", {
140
+ className: `${o.ringTwo} ${o.blueRingTwo}`,
141
+ cx: "200",
142
+ cy: "200",
143
+ rx: "80",
144
+ ry: "160",
145
+ transform: "rotate(-60, 200, 200)"
146
+ }), /* @__PURE__ */ e("ellipse", {
147
+ className: `${o.ringTwo} ${o.purpleRingTwo}`,
148
+ cx: "200",
149
+ cy: "200",
150
+ rx: "80",
151
+ ry: "160",
152
+ transform: "rotate(60, 200, 200)"
153
+ }), /* @__PURE__ */ e("ellipse", {
154
+ className: `${o.ringTwo} ${o.magentaRingTwo}`,
155
+ cx: "200",
156
+ cy: "200",
157
+ rx: "80",
158
+ ry: "160"
159
+ })]
160
+ }), /* @__PURE__ */ r("g", {
161
+ clipPath: "url(#clip2)",
162
+ children: [/* @__PURE__ */ e("ellipse", {
163
+ className: `${o.ringTwo} ${o.magentaRingTwo}`,
164
+ cx: "200",
165
+ cy: "200",
166
+ rx: "80",
167
+ ry: "160"
168
+ }), /* @__PURE__ */ e("ellipse", {
169
+ className: `${o.ringTwo} ${o.blueRingTwo}`,
170
+ cx: "200",
171
+ cy: "200",
172
+ rx: "80",
173
+ ry: "160",
174
+ transform: "rotate(-60, 200, 200)"
175
+ }), /* @__PURE__ */ e("ellipse", {
176
+ className: `${o.ringTwo} ${o.purpleRingTwo}`,
177
+ cx: "200",
178
+ cy: "200",
179
+ rx: "80",
180
+ ry: "160",
181
+ transform: "rotate(60, 200, 200)"
182
+ })]
183
+ })]
184
+ }), /* @__PURE__ */ r("g", {
185
+ clipPath: "url(#clip1)",
186
+ children: [/* @__PURE__ */ e("ellipse", {
187
+ className: `${o.ring} ${o.blueRing}`,
188
+ cx: "200",
189
+ cy: "200",
190
+ rx: "80",
191
+ ry: "160",
192
+ transform: "rotate(-60, 200, 200)"
193
+ }), /* @__PURE__ */ e("ellipse", {
194
+ className: `${o.ring} ${o.purpleRing}`,
195
+ cx: "200",
196
+ cy: "200",
197
+ rx: "80",
198
+ ry: "160",
199
+ transform: "rotate(60, 200, 200)"
200
+ }), /* @__PURE__ */ e("ellipse", {
201
+ className: `${o.ring} ${o.magentaRing}`,
202
+ cx: "200",
203
+ cy: "200",
204
+ rx: "80",
205
+ ry: "160"
206
+ })]
207
+ }), /* @__PURE__ */ r("g", {
208
+ clipPath: "url(#clip2)",
209
+ children: [/* @__PURE__ */ e("ellipse", {
210
+ className: `${o.ring} ${o.magentaRing}`,
211
+ cx: "200",
212
+ cy: "200",
213
+ rx: "80",
214
+ ry: "160"
215
+ }), /* @__PURE__ */ e("ellipse", {
216
+ className: `${o.ring} ${o.blueRing}`,
217
+ cx: "200",
218
+ cy: "200",
219
+ rx: "80",
220
+ ry: "160",
221
+ transform: "rotate(-60, 200, 200)"
222
+ }), /* @__PURE__ */ e("ellipse", {
223
+ className: `${o.ring} ${o.purpleRing}`,
224
+ cx: "200",
225
+ cy: "200",
226
+ rx: "80",
227
+ ry: "160",
228
+ transform: "rotate(60, 200, 200)"
229
+ })]
230
+ })]
231
+ });
232
+ export {
233
+ h as BoxAILoadingIndicator,
234
+ h as default
235
+ };
@@ -0,0 +1,26 @@
1
+ import { defineMessages as n } from "react-intl";
2
+ const t = n({
3
+ thinkingInProgress: {
4
+ id: "boxui.contentAnswers.thinkingInProgress",
5
+ defaultMessage: "Thinking..."
6
+ },
7
+ thinkingCompleted: {
8
+ id: "boxui.contentAnswers.thinkingCompleted",
9
+ defaultMessage: "Thinking Complete"
10
+ },
11
+ thinkingContentScrollableArea: {
12
+ id: "boxui.contentAnswers.thinkingContentScrollableArea",
13
+ defaultMessage: "Thinking content scrollable area"
14
+ },
15
+ expandThinkingContent: {
16
+ id: "boxui.contentAnswers.expandThinkingContent",
17
+ defaultMessage: "Expand"
18
+ },
19
+ collapseThinkingContent: {
20
+ id: "boxui.contentAnswers.collapseThinkingContent",
21
+ defaultMessage: "Collapse"
22
+ }
23
+ });
24
+ export {
25
+ t as default
26
+ };
@@ -0,0 +1,122 @@
1
+ import x from "clsx";
2
+ import { useState as b, useId as C, useRef as k, useEffect as u, useCallback as _ } from "react";
3
+ import { useIntl as y } from "react-intl";
4
+ import { Text as M, Tooltip as j } from "@box/blueprint-web";
5
+ import { ChevronRight as X, BoxAi as Y } from "@box/blueprint-web-assets/icons/Medium";
6
+ import { BlackOpacity50 as G } from "@box/blueprint-web-assets/tokens/tokens";
7
+ import U from "../common/markdown-react.js";
8
+ import { BoxAILoadingIndicator as V } from "./boxAILoadingIndicator.js";
9
+ import l from "./messages.js";
10
+ import { jsxs as g, jsx as n } from "react/jsx-runtime";
11
+ import '../../../../styles/thinkingBubble.css';const q = "_thinkingBubbleContainer_vtaw4_2", z = "_thinkingBubbleHeader_vtaw4_8", F = "_headerLeft_vtaw4_20", J = "_thinkingBubbleLogo_vtaw4_25", K = "_chevronIcon_vtaw4_29", Q = "_chevronRotated_vtaw4_34", W = "_chevronDisabled_vtaw4_37", Z = "_logoState_vtaw4_41", $ = "_headerExpanded_vtaw4_50", ee = "_thinkingBubbleContent_vtaw4_56", te = "_scrollableContainer_vtaw4_64", ne = "_contentExpanded_vtaw4_82", oe = "_sidebar_vtaw4_88", ae = "_pillState_vtaw4_106", e = {
12
+ thinkingBubbleContainer: q,
13
+ thinkingBubbleHeader: z,
14
+ headerLeft: F,
15
+ thinkingBubbleLogo: J,
16
+ chevronIcon: K,
17
+ chevronRotated: Q,
18
+ chevronDisabled: W,
19
+ logoState: Z,
20
+ headerExpanded: $,
21
+ thinkingBubbleContent: ee,
22
+ scrollableContainer: te,
23
+ contentExpanded: ne,
24
+ sidebar: oe,
25
+ pillState: ae
26
+ }, re = 5, se = 50, ie = 300, le = 120, Ee = ({
27
+ content: s,
28
+ className: B,
29
+ variant: L = "modal",
30
+ isThinkingComplete: t = !1,
31
+ ...I
32
+ }) => {
33
+ const {
34
+ formatMessage: i
35
+ } = y(), S = L === "sidebar", [c, h] = b(!1), [r, f] = b(!1), [d, w] = b(!1), p = C(), H = C(), o = k(null), v = k(!1);
36
+ u(() => {
37
+ if (s) {
38
+ const a = [setTimeout(() => w(!0), se), setTimeout(() => h(!0), ie)];
39
+ return () => a.forEach(clearTimeout);
40
+ }
41
+ }, [s]);
42
+ const m = _(() => {
43
+ o.current && s && c && !v.current && o.current.scrollTo({
44
+ top: o.current.scrollHeight,
45
+ behavior: "smooth"
46
+ });
47
+ }, [s, c]);
48
+ u(() => {
49
+ m();
50
+ }, [m]);
51
+ const A = _(() => {
52
+ if (o.current) {
53
+ const a = o.current, P = a.scrollTop + a.clientHeight >= a.scrollHeight - re;
54
+ v.current = !P;
55
+ }
56
+ }, []), E = _(() => o.current ? o.current.scrollHeight > le : !1, []), D = () => {
57
+ const a = !r;
58
+ f(a), t && h(a);
59
+ };
60
+ u(() => {
61
+ t && (f(!1), h(!1));
62
+ }, [t]);
63
+ const N = () => t ? /* @__PURE__ */ n(Y, {
64
+ color: G,
65
+ height: 24,
66
+ width: 24
67
+ }) : /* @__PURE__ */ n(V, {}), R = !E() && !t, O = x(e.thinkingBubbleContainer, {
68
+ [e.logoState]: !d,
69
+ [e.headerExpanded]: d,
70
+ [e.contentExpanded]: r,
71
+ [e.pillState]: t && !r,
72
+ [e.sidebar]: S
73
+ }, B), T = !E() && !t;
74
+ return /* @__PURE__ */ g("div", {
75
+ className: O,
76
+ ...I,
77
+ children: [/* @__PURE__ */ g("button", {
78
+ "aria-controls": H,
79
+ "aria-expanded": c && (!t || r),
80
+ "aria-labelledby": p,
81
+ className: e.thinkingBubbleHeader,
82
+ disabled: T,
83
+ onClick: D,
84
+ type: "button",
85
+ "data-target-id": "button-thinkingCompleted|thinkingInProgress|thinkingCompleted|thinkingInProgress|collapseThinkingContent|expandThinkingContent",
86
+ children: [/* @__PURE__ */ g("div", {
87
+ className: e.headerLeft,
88
+ children: [/* @__PURE__ */ n("div", {
89
+ className: e.thinkingBubbleLogo,
90
+ children: N()
91
+ }), d && /* @__PURE__ */ n(M, {
92
+ as: "h3",
93
+ color: t ? "textOnLightSecondary" : "textOnLightDefault",
94
+ id: p,
95
+ variant: "titleMedium",
96
+ children: i(t ? l.thinkingCompleted : l.thinkingInProgress)
97
+ })]
98
+ }), d && /* @__PURE__ */ n(j, {
99
+ content: i(r ? l.collapseThinkingContent : l.expandThinkingContent),
100
+ children: /* @__PURE__ */ n(X, {
101
+ "aria-hidden": "true",
102
+ className: x(e.chevronIcon, r && e.chevronRotated, R && e.chevronDisabled)
103
+ })
104
+ })]
105
+ }), c && (!t || r) && /* @__PURE__ */ n("div", {
106
+ className: e.thinkingBubbleContent,
107
+ children: /* @__PURE__ */ n("div", {
108
+ ref: o,
109
+ "aria-label": i(l.thinkingContentScrollableArea),
110
+ className: e.scrollableContainer,
111
+ onScroll: A,
112
+ children: /* @__PURE__ */ n(U, {
113
+ children: s
114
+ })
115
+ })
116
+ })]
117
+ });
118
+ };
119
+ export {
120
+ Ee as ThinkingBubble,
121
+ Ee as default
122
+ };
@@ -74,6 +74,11 @@ export default {
74
74
  "boxAI.popup.closeButtonText": "বন্ধ করুন",
75
75
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "অনুলিপি হয়েছে",
76
76
  "boxAi.contentAnswers.closeItemList": "ফাইলের আইটেমের তালিকা বন্ধ করুন",
77
+ "boxui.contentAnswers.collapseThinkingContent": "Collapse",
78
+ "boxui.contentAnswers.expandThinkingContent": "Expand",
79
+ "boxui.contentAnswers.thinkingCompleted": "Thinking Complete",
80
+ "boxui.contentAnswers.thinkingContentScrollableArea": "Thinking content scrollable area",
81
+ "boxui.contentAnswers.thinkingInProgress": "Thinking...",
77
82
  "boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "আপনি নিজের স্প্রেডশিটে সরল ও জটিল প্রশ্ন, উভয়ই Box AI-কে জিজ্ঞাসা করতে পারেন: মোট হিসাব, গড়পড়তা, উন্নত তুলনা, ট্রেন্ড বিশ্লেষণ এবং আরও অনেক কিছু। আজই এটি ব্যবহার করে করুন!",
78
83
  "boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "বেশি টেক্সট থাকা ফাইলে স্প্রেডশীট সাপোর্ট সবচেয়ে ভালো কাজ করে",
79
84
  "boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "স্প্রেডশীট সাপোর্ট বিজ্ঞপ্তি ব্যানার",
@@ -74,6 +74,11 @@ export default {
74
74
  "boxAI.popup.closeButtonText": "Luk",
75
75
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopieret",
76
76
  "boxAi.contentAnswers.closeItemList": "Luk listen over filelementer",
77
+ "boxui.contentAnswers.collapseThinkingContent": "Collapse",
78
+ "boxui.contentAnswers.expandThinkingContent": "Expand",
79
+ "boxui.contentAnswers.thinkingCompleted": "Thinking Complete",
80
+ "boxui.contentAnswers.thinkingContentScrollableArea": "Thinking content scrollable area",
81
+ "boxui.contentAnswers.thinkingInProgress": "Thinking...",
77
82
  "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!",
78
83
  "boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Regnearkssupport virker bedst med de teksttunge filer",
79
84
  "boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "banner til meddelelse om regnearksstøtte",
@@ -74,6 +74,11 @@ export default {
74
74
  "boxAI.popup.closeButtonText": "Schließen",
75
75
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopiert",
76
76
  "boxAi.contentAnswers.closeItemList": "Liste der Dateielemente schließen",
77
+ "boxui.contentAnswers.collapseThinkingContent": "Collapse",
78
+ "boxui.contentAnswers.expandThinkingContent": "Expand",
79
+ "boxui.contentAnswers.thinkingCompleted": "Thinking Complete",
80
+ "boxui.contentAnswers.thinkingContentScrollableArea": "Thinking content scrollable area",
81
+ "boxui.contentAnswers.thinkingInProgress": "Thinking...",
77
82
  "boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "Sie können Box AI in Ihrer Tabelle sowohl einfache als auch komplexe Fragen stellen: Gesamtzahlen, Durchschnittswerte, erweiterte Vergleiche, Trendanalysen usw. Probieren Sie es aus!",
78
83
  "boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Der Tabellen-Support funktioniert am besten für Dateien mit hoher Textdichte",
79
84
  "boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "Support-Benachrichtigungsbanner für eine Tabellenkalkulation",