@box/box-ai-content-answers 0.157.0 → 0.158.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.
- package/dist/esm/lib/components/answer/answer.js +122 -113
- package/dist/esm/lib/components/answer/messages.js +4 -0
- package/dist/esm/lib/components/chat/chat.js +70 -68
- package/dist/esm/lib/components/content/content.js +25 -25
- package/dist/esm/lib/components/thinkingBubble/thinkingBubble.js +75 -72
- package/dist/esm/lib/components/welcome-message/messages.js +2 -2
- package/dist/i18n/bn-IN.js +3 -2
- package/dist/i18n/bn-IN.properties +13 -3
- package/dist/i18n/da-DK.js +3 -2
- package/dist/i18n/da-DK.properties +13 -3
- package/dist/i18n/de-DE.js +3 -2
- package/dist/i18n/de-DE.properties +13 -3
- package/dist/i18n/en-AU.js +2 -1
- package/dist/i18n/en-AU.properties +12 -2
- package/dist/i18n/en-CA.js +2 -1
- package/dist/i18n/en-CA.properties +12 -2
- package/dist/i18n/en-GB.js +2 -1
- package/dist/i18n/en-GB.properties +12 -2
- package/dist/i18n/en-US.js +3 -2
- package/dist/i18n/en-US.properties +4 -2
- package/dist/i18n/en-x-pseudo.js +86 -85
- package/dist/i18n/en-x-pseudo.properties +91 -81
- package/dist/i18n/es-419.js +3 -2
- package/dist/i18n/es-419.properties +13 -3
- package/dist/i18n/es-ES.js +3 -2
- package/dist/i18n/es-ES.properties +13 -3
- package/dist/i18n/fi-FI.js +3 -2
- package/dist/i18n/fi-FI.properties +13 -3
- package/dist/i18n/fr-CA.js +3 -2
- package/dist/i18n/fr-CA.properties +13 -3
- package/dist/i18n/fr-FR.js +3 -2
- package/dist/i18n/fr-FR.properties +13 -3
- package/dist/i18n/hi-IN.js +3 -2
- package/dist/i18n/hi-IN.properties +13 -3
- package/dist/i18n/it-IT.js +3 -2
- package/dist/i18n/it-IT.properties +13 -3
- package/dist/i18n/ja-JP.js +3 -2
- package/dist/i18n/ja-JP.properties +13 -3
- package/dist/i18n/json/src/lib/components/answer/messages.json +1 -1
- package/dist/i18n/json/src/lib/components/welcome-message/messages.json +1 -1
- package/dist/i18n/ko-KR.js +3 -2
- package/dist/i18n/ko-KR.properties +13 -3
- package/dist/i18n/nb-NO.js +3 -2
- package/dist/i18n/nb-NO.properties +13 -3
- package/dist/i18n/nl-NL.js +3 -2
- package/dist/i18n/nl-NL.properties +13 -3
- package/dist/i18n/pl-PL.js +3 -2
- package/dist/i18n/pl-PL.properties +13 -3
- package/dist/i18n/pt-BR.js +3 -2
- package/dist/i18n/pt-BR.properties +13 -3
- package/dist/i18n/ru-RU.js +3 -2
- package/dist/i18n/ru-RU.properties +13 -3
- package/dist/i18n/sv-SE.js +3 -2
- package/dist/i18n/sv-SE.properties +13 -3
- package/dist/i18n/tr-TR.js +3 -2
- package/dist/i18n/tr-TR.properties +13 -3
- package/dist/i18n/zh-CN.js +3 -2
- package/dist/i18n/zh-CN.properties +13 -3
- package/dist/i18n/zh-TW.js +3 -2
- package/dist/i18n/zh-TW.properties +13 -3
- package/dist/styles/answer.css +1 -1
- package/dist/types/lib/components/answer/messages.d.ts +5 -0
- package/dist/types/lib/components/chat/chat.d.ts +1 -1
- package/dist/types/lib/components/thinkingBubble/thinkingBubble.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,174 +1,183 @@
|
|
|
1
|
-
import { Text as
|
|
1
|
+
import { Text as N } from "@box/blueprint-web";
|
|
2
2
|
import { AlertTriangle as Q } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
-
import { Gray65 as X, Size4 as
|
|
4
|
-
import
|
|
5
|
-
import { memo as Y, useState as Z, useEffect as
|
|
6
|
-
import { useIntl as
|
|
3
|
+
import { Gray65 as X, Size4 as I } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
+
import w from "clsx";
|
|
5
|
+
import { memo as Y, useState as Z, useEffect as T, useMemo as $ } from "react";
|
|
6
|
+
import { useIntl as tt } from "react-intl";
|
|
7
7
|
import { A as r } from "../../../../chunks/types.js";
|
|
8
|
-
import { injectInlineCitation as
|
|
8
|
+
import { injectInlineCitation as ot } from "../../utils/inlineCitationsUtils.js";
|
|
9
9
|
import { MediaContainer as S } from "../common/media-container.js";
|
|
10
|
-
import { BoxAILoadingIndicator as
|
|
11
|
-
import { AnswerContent as
|
|
12
|
-
import { CopyButton as
|
|
13
|
-
import { InlineError as
|
|
14
|
-
import
|
|
15
|
-
import { References as
|
|
16
|
-
import { ThumbButtons as
|
|
17
|
-
import { jsxs as c, jsx as
|
|
18
|
-
import '../../../../styles/answer.css';const
|
|
19
|
-
answer:
|
|
20
|
-
loadingContainer:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
10
|
+
import { BoxAILoadingIndicator as nt } from "../thinkingBubble/boxAILoadingIndicator.js";
|
|
11
|
+
import { AnswerContent as et } from "./answer-content.js";
|
|
12
|
+
import { CopyButton as rt } from "./copy-button.js";
|
|
13
|
+
import { InlineError as st } from "./inline-error.js";
|
|
14
|
+
import u from "./messages.js";
|
|
15
|
+
import { References as at } from "./references.js";
|
|
16
|
+
import { ThumbButtons as it } from "./thumb-buttons.js";
|
|
17
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
18
|
+
import '../../../../styles/answer.css';const lt = "_answer_rp7w7_1", ct = "_loadingContainer_rp7w7_5", dt = "_loadingText_rp7w7_12", ut = "_fadeIn_rp7w7_1", _t = "_alertIcon_rp7w7_21", ft = "_error_rp7w7_24", mt = "_footer_rp7w7_28", pt = "_copyButtonContainer_rp7w7_34", ht = "_feedbackButtonsContainer_rp7w7_35", Et = "_shouldHaveMarginTop_rp7w7_39", gt = "_shouldUseAnimation_rp7w7_42", Nt = "_shouldAnimateHeight_rp7w7_46", It = "_footerButtons_rp7w7_50", wt = "_iconAvatar_rp7w7_56", Tt = "_buttonsVisible_rp7w7_72", t = {
|
|
19
|
+
answer: lt,
|
|
20
|
+
loadingContainer: ct,
|
|
21
|
+
loadingText: dt,
|
|
22
|
+
fadeIn: ut,
|
|
23
|
+
alertIcon: _t,
|
|
24
|
+
error: ft,
|
|
25
|
+
footer: mt,
|
|
26
|
+
copyButtonContainer: pt,
|
|
27
|
+
feedbackButtonsContainer: ht,
|
|
28
|
+
shouldHaveMarginTop: Et,
|
|
29
|
+
shouldUseAnimation: gt,
|
|
30
|
+
shouldAnimateHeight: Nt,
|
|
31
|
+
footerButtons: It,
|
|
32
|
+
iconAvatar: wt,
|
|
33
|
+
buttonsVisible: Tt
|
|
34
|
+
}, St = /* @__PURE__ */ new Set([r.RATE_LIMITING, r.NO_CONTENT, r.PRECONDITION_FAILED, r.GENERAL, r.AGENT_NOT_FOUND]), Vt = /* @__PURE__ */ Y(({
|
|
35
|
+
answer: o,
|
|
36
|
+
citations: R,
|
|
37
|
+
error: e,
|
|
38
|
+
contentType: A,
|
|
39
|
+
hostAppName: _,
|
|
40
|
+
feedbackValue: O,
|
|
41
|
+
isCitationsEnabled: B = !1,
|
|
40
42
|
isCompleted: s = !1,
|
|
41
|
-
isFeedbackEnabled:
|
|
42
|
-
isFeedbackFormEnabled:
|
|
43
|
+
isFeedbackEnabled: b = !1,
|
|
44
|
+
isFeedbackFormEnabled: C,
|
|
43
45
|
isFeedbackTooltipOpen: f,
|
|
44
46
|
isInlineCitationsEnabled: m = !1,
|
|
45
|
-
isLoading:
|
|
46
|
-
isMarkdownEnabled:
|
|
47
|
+
isLoading: P = !1,
|
|
48
|
+
isMarkdownEnabled: x = !1,
|
|
47
49
|
items: a = [],
|
|
48
|
-
onAnswerCopy:
|
|
49
|
-
onCitationClick:
|
|
50
|
-
onFeedbackFormSubmit:
|
|
51
|
-
onFeedbackTooltipOpenChange:
|
|
52
|
-
prompt:
|
|
53
|
-
promptType:
|
|
50
|
+
onAnswerCopy: v,
|
|
51
|
+
onCitationClick: M,
|
|
52
|
+
onFeedbackFormSubmit: y,
|
|
53
|
+
onFeedbackTooltipOpenChange: D,
|
|
54
|
+
prompt: L,
|
|
55
|
+
promptType: F,
|
|
54
56
|
recordAction: i,
|
|
55
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
56
|
-
shouldFeedbackIncludePromptData:
|
|
57
|
-
useAnimation:
|
|
57
|
+
shouldFeedbackFormIncludeFeedbackText: H,
|
|
58
|
+
shouldFeedbackIncludePromptData: U,
|
|
59
|
+
useAnimation: k = !0,
|
|
58
60
|
variant: l = "modal",
|
|
59
|
-
isReactMarkdownEnabled:
|
|
60
|
-
setAnswerFeedback:
|
|
61
|
-
questionId:
|
|
61
|
+
isReactMarkdownEnabled: G,
|
|
62
|
+
setAnswerFeedback: V,
|
|
63
|
+
questionId: j
|
|
62
64
|
}) => {
|
|
63
|
-
const
|
|
64
|
-
formatMessage:
|
|
65
|
-
} =
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
const p = St.has(e), h = P && !o && !e, [z, q] = Z(s), {
|
|
66
|
+
formatMessage: d
|
|
67
|
+
} = tt();
|
|
68
|
+
T(() => {
|
|
69
|
+
o && i && s && a.some((K) => o.includes(K.name)) && i({
|
|
68
70
|
action: "programmatic",
|
|
69
71
|
component: l,
|
|
70
72
|
feature: "answers",
|
|
71
73
|
target: "links_detected",
|
|
72
74
|
data: {
|
|
73
|
-
hostAppName:
|
|
75
|
+
hostAppName: _,
|
|
74
76
|
linkCount: a.length,
|
|
75
77
|
fileNameCount: a.length
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
|
-
}, [
|
|
79
|
-
setTimeout(() =>
|
|
80
|
+
}, [o, l, _, s, i, a]), T(() => {
|
|
81
|
+
setTimeout(() => q(s), 0);
|
|
80
82
|
}, [s]);
|
|
81
|
-
const E = () => /* @__PURE__ */
|
|
82
|
-
className:
|
|
83
|
+
const E = () => /* @__PURE__ */ n(Q, {
|
|
84
|
+
className: t.alertIcon,
|
|
83
85
|
color: X,
|
|
84
86
|
"data-testid": "content-answers-error-alert-icon",
|
|
85
|
-
height:
|
|
87
|
+
height: I,
|
|
86
88
|
role: "presentation",
|
|
87
|
-
width:
|
|
88
|
-
}), W = () => /* @__PURE__ */ c(
|
|
89
|
+
width: I
|
|
90
|
+
}), W = () => /* @__PURE__ */ c(N, {
|
|
89
91
|
as: "p",
|
|
90
|
-
className:
|
|
92
|
+
className: t.error,
|
|
91
93
|
color: "textOnLightSecondary",
|
|
92
94
|
"data-testid": "content-answers-error",
|
|
93
95
|
variant: "caption",
|
|
94
|
-
children: [
|
|
95
|
-
}),
|
|
96
|
-
className:
|
|
97
|
-
[
|
|
96
|
+
children: [e === r.RESPONSE_INTERRUPTED && d(u.responseInterruptedError), e === r.RESPONSE_FAILED && d(u.responseFailedError), e === r.RESPONSE_STOPPED && d(u.responseStoppedError), e !== r.RESPONSE_STOPPED && E()]
|
|
97
|
+
}), J = () => e !== r.RESPONSE_STOPPED ? /* @__PURE__ */ c("div", {
|
|
98
|
+
className: w(t.footerButtons, "footer-buttons-container", {
|
|
99
|
+
[t.buttonsVisible]: f
|
|
98
100
|
}),
|
|
99
|
-
children: [
|
|
100
|
-
className:
|
|
101
|
-
children: /* @__PURE__ */
|
|
102
|
-
feedbackValue:
|
|
103
|
-
hostAppName:
|
|
104
|
-
isFeedbackFormEnabled:
|
|
101
|
+
children: [b ? /* @__PURE__ */ n("div", {
|
|
102
|
+
className: t.feedbackButtonsContainer,
|
|
103
|
+
children: /* @__PURE__ */ n(it, {
|
|
104
|
+
feedbackValue: O,
|
|
105
|
+
hostAppName: _,
|
|
106
|
+
isFeedbackFormEnabled: C,
|
|
105
107
|
isFeedbackTooltipOpen: f,
|
|
106
108
|
items: a,
|
|
107
|
-
onFeedbackFormSubmit:
|
|
108
|
-
onFeedbackTooltipOpenChange:
|
|
109
|
-
prompt:
|
|
110
|
-
promptType:
|
|
111
|
-
questionId:
|
|
109
|
+
onFeedbackFormSubmit: y,
|
|
110
|
+
onFeedbackTooltipOpenChange: D,
|
|
111
|
+
prompt: L,
|
|
112
|
+
promptType: F,
|
|
113
|
+
questionId: j,
|
|
112
114
|
recordAction: i,
|
|
113
|
-
response:
|
|
114
|
-
setAnswerFeedback:
|
|
115
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
116
|
-
shouldFeedbackIncludePromptData:
|
|
115
|
+
response: g,
|
|
116
|
+
setAnswerFeedback: V,
|
|
117
|
+
shouldFeedbackFormIncludeFeedbackText: H,
|
|
118
|
+
shouldFeedbackIncludePromptData: U,
|
|
117
119
|
variant: l
|
|
118
120
|
})
|
|
119
|
-
}) : null, /* @__PURE__ */
|
|
120
|
-
className:
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
answer:
|
|
123
|
-
onAnswerCopy:
|
|
121
|
+
}) : null, /* @__PURE__ */ n("div", {
|
|
122
|
+
className: t.copyButtonContainer,
|
|
123
|
+
children: /* @__PURE__ */ n(rt, {
|
|
124
|
+
answer: o,
|
|
125
|
+
onAnswerCopy: v,
|
|
124
126
|
recordAction: i
|
|
125
127
|
})
|
|
126
128
|
})]
|
|
127
|
-
}) :
|
|
129
|
+
}) : o ? null : E(), g = $(() => o && ot(o, {
|
|
128
130
|
items: a,
|
|
129
131
|
isCompleted: s,
|
|
130
132
|
isInlineCitationsEnabled: m
|
|
131
|
-
}), [
|
|
133
|
+
}), [o, a, s, m]);
|
|
132
134
|
return /* @__PURE__ */ c("div", {
|
|
133
135
|
"aria-live": "polite",
|
|
134
|
-
className:
|
|
136
|
+
className: t.answer,
|
|
135
137
|
"data-testid": "content-answers-answer",
|
|
136
|
-
children: [
|
|
137
|
-
className:
|
|
138
|
-
|
|
138
|
+
children: [h && /* @__PURE__ */ c("div", {
|
|
139
|
+
className: t.loadingContainer,
|
|
140
|
+
children: [/* @__PURE__ */ n(nt, {}), /* @__PURE__ */ n(N, {
|
|
141
|
+
as: "span",
|
|
142
|
+
className: t.loadingText,
|
|
143
|
+
color: "textOnLightDefault",
|
|
144
|
+
variant: "titleMedium",
|
|
145
|
+
children: d(u.analyzingRequest)
|
|
146
|
+
})]
|
|
147
|
+
}), !p && !h && /* @__PURE__ */ n(S, {
|
|
139
148
|
className: "answer",
|
|
140
149
|
variant: l,
|
|
141
150
|
children: /* @__PURE__ */ c(S.Content, {
|
|
142
151
|
isUsedInsideSidebar: l === "sidebar",
|
|
143
152
|
variant: "answer",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
-
answer:
|
|
146
|
-
isMarkdownEnabled:
|
|
147
|
-
isReactMarkdownEnabled:
|
|
153
|
+
children: [/* @__PURE__ */ n(et, {
|
|
154
|
+
answer: g,
|
|
155
|
+
isMarkdownEnabled: x,
|
|
156
|
+
isReactMarkdownEnabled: G,
|
|
148
157
|
variant: l
|
|
149
158
|
}), s && /* @__PURE__ */ c("div", {
|
|
150
|
-
className:
|
|
151
|
-
[
|
|
152
|
-
[
|
|
153
|
-
[
|
|
159
|
+
className: w(t.footer, {
|
|
160
|
+
[t.shouldHaveMarginTop]: o,
|
|
161
|
+
[t.shouldAnimateHeight]: z,
|
|
162
|
+
[t.shouldUseAnimation]: k
|
|
154
163
|
}),
|
|
155
164
|
"data-testid": "content-answers-answer-footer",
|
|
156
|
-
children: [
|
|
157
|
-
citations:
|
|
158
|
-
onCitationClick:
|
|
165
|
+
children: [e && W(), B && !e && /* @__PURE__ */ n(at, {
|
|
166
|
+
citations: R,
|
|
167
|
+
onCitationClick: M,
|
|
159
168
|
recordAction: i
|
|
160
|
-
}),
|
|
169
|
+
}), J()]
|
|
161
170
|
})]
|
|
162
171
|
})
|
|
163
|
-
}),
|
|
164
|
-
contentType:
|
|
165
|
-
error:
|
|
172
|
+
}), p && /* @__PURE__ */ n(st, {
|
|
173
|
+
contentType: A,
|
|
174
|
+
error: e,
|
|
166
175
|
recordAction: i,
|
|
167
176
|
variant: l
|
|
168
177
|
})]
|
|
169
178
|
});
|
|
170
179
|
});
|
|
171
180
|
export {
|
|
172
|
-
|
|
173
|
-
|
|
181
|
+
Vt as Answer,
|
|
182
|
+
Vt as default
|
|
174
183
|
};
|
|
@@ -100,6 +100,10 @@ const t = e({
|
|
|
100
100
|
id: "boxAI.contentAnswers.loadingAnswer",
|
|
101
101
|
defaultMessage: "Loading Answer..."
|
|
102
102
|
},
|
|
103
|
+
analyzingRequest: {
|
|
104
|
+
id: "boxAI.contentAnswers.analyzingRequest",
|
|
105
|
+
defaultMessage: "Analyzing your request"
|
|
106
|
+
},
|
|
103
107
|
noReferences: {
|
|
104
108
|
id: "boxAI.contentAnswers.noReferences",
|
|
105
109
|
defaultMessage: "Response based on general document analysis"
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { BoxAiLogo as
|
|
1
|
+
import { Text as Z } from "@box/blueprint-web";
|
|
2
|
+
import { BoxAiLogo as $ } from "@box/blueprint-web-assets/icons/Logo";
|
|
3
3
|
import { Size10 as f } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import { useIntl as
|
|
7
|
-
import { Answer as
|
|
8
|
-
import { MediaContainer as
|
|
9
|
-
import { Question as
|
|
10
|
-
import { SuggestedQuestions as
|
|
11
|
-
import { ThinkingBubble as
|
|
12
|
-
import
|
|
13
|
-
import { WelcomeMessage as
|
|
4
|
+
import w from "clsx";
|
|
5
|
+
import * as L from "react";
|
|
6
|
+
import { useIntl as P } from "react-intl";
|
|
7
|
+
import { Answer as S } from "../answer/answer.js";
|
|
8
|
+
import { MediaContainer as ee } from "../common/media-container.js";
|
|
9
|
+
import { Question as te } from "../question/question.js";
|
|
10
|
+
import { SuggestedQuestions as oe } from "../suggested-questions/suggested-questions.js";
|
|
11
|
+
import { ThinkingBubble as ae } from "../thinkingBubble/thinkingBubble.js";
|
|
12
|
+
import ie from "../welcome-message/messages.js";
|
|
13
|
+
import { WelcomeMessage as re } from "../welcome-message/welcome-message.js";
|
|
14
14
|
import { jsx as e, jsxs as _ } from "react/jsx-runtime";
|
|
15
|
-
import '../../../../styles/chat.css';const
|
|
16
|
-
chat:
|
|
17
|
-
clearChatText:
|
|
18
|
-
landingPage:
|
|
19
|
-
askQuestionText:
|
|
20
|
-
iconAvatar:
|
|
21
|
-
sidebar:
|
|
22
|
-
},
|
|
15
|
+
import '../../../../styles/chat.css';const se = "_chat_77vqr_1", ne = "_clearChatText_77vqr_1", ce = "_landingPage_77vqr_7", le = "_askQuestionText_77vqr_15", me = "_iconAvatar_77vqr_23", pe = "_sidebar_77vqr_39", a = {
|
|
16
|
+
chat: se,
|
|
17
|
+
clearChatText: ne,
|
|
18
|
+
landingPage: ce,
|
|
19
|
+
askQuestionText: le,
|
|
20
|
+
iconAvatar: me,
|
|
21
|
+
sidebar: pe
|
|
22
|
+
}, Fe = ({
|
|
23
23
|
askSuggestedQuestion: h,
|
|
24
24
|
contentType: n,
|
|
25
25
|
hasCustomSuggestedQuestions: T,
|
|
@@ -33,116 +33,118 @@ import '../../../../styles/chat.css';const re = "_chat_77vqr_1", se = "_clearCha
|
|
|
33
33
|
onCitationClick: q,
|
|
34
34
|
onAnswerCopy: F,
|
|
35
35
|
onFeedbackFormSubmit: A,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
onDropdownOpenChange: I,
|
|
37
|
+
onSuggestedQuestionInteraction: N,
|
|
38
|
+
questions: O,
|
|
38
39
|
recordAction: c,
|
|
39
|
-
setAnswerFeedback:
|
|
40
|
+
setAnswerFeedback: Q,
|
|
40
41
|
setAskSuggestedQuestion: l,
|
|
41
42
|
suggestedQuestions: m,
|
|
42
|
-
suggestedQuestionsRequestState:
|
|
43
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
44
|
-
shouldFeedbackIncludePromptData:
|
|
43
|
+
suggestedQuestionsRequestState: j,
|
|
44
|
+
shouldFeedbackFormIncludeFeedbackText: y,
|
|
45
|
+
shouldFeedbackIncludePromptData: B,
|
|
45
46
|
shouldShowLandingPage: o,
|
|
46
|
-
useAnimation:
|
|
47
|
+
useAnimation: M,
|
|
47
48
|
variant: t = "modal",
|
|
48
|
-
hostAppName:
|
|
49
|
-
isReactMarkdownEnabled:
|
|
50
|
-
welcomeMessageClearText:
|
|
49
|
+
hostAppName: z = "",
|
|
50
|
+
isReactMarkdownEnabled: R,
|
|
51
|
+
welcomeMessageClearText: W,
|
|
51
52
|
...p
|
|
52
53
|
}) => {
|
|
53
54
|
const {
|
|
54
|
-
formatMessage:
|
|
55
|
-
} =
|
|
56
|
-
|
|
55
|
+
formatMessage: D
|
|
56
|
+
} = P(), [E, G] = L.useState(null), H = (i, r) => {
|
|
57
|
+
G(i ? r : null);
|
|
57
58
|
};
|
|
58
59
|
return /* @__PURE__ */ e("div", {
|
|
59
60
|
className: a.chat,
|
|
60
61
|
"data-testid": "content-answers-chat",
|
|
61
62
|
children: /* @__PURE__ */ _("div", {
|
|
62
|
-
className:
|
|
63
|
+
className: w({
|
|
63
64
|
[a.landingPage]: o,
|
|
64
65
|
[a.sidebar]: t === "sidebar"
|
|
65
66
|
}),
|
|
66
|
-
children: [o && /* @__PURE__ */ e(
|
|
67
|
+
children: [o && /* @__PURE__ */ e(ee.Figure, {
|
|
67
68
|
variant: t,
|
|
68
69
|
children: /* @__PURE__ */ e("div", {
|
|
69
70
|
className: a.iconAvatar,
|
|
70
|
-
children: /* @__PURE__ */ e(
|
|
71
|
+
children: /* @__PURE__ */ e($, {
|
|
71
72
|
height: f,
|
|
72
73
|
role: "presentation",
|
|
73
74
|
width: f
|
|
74
75
|
})
|
|
75
76
|
})
|
|
76
|
-
}), /* @__PURE__ */ e(
|
|
77
|
+
}), /* @__PURE__ */ e(re, {
|
|
77
78
|
contentType: "",
|
|
78
79
|
shouldShowLandingPage: o,
|
|
79
80
|
...p,
|
|
80
81
|
variant: t
|
|
81
|
-
}), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(
|
|
82
|
+
}), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(oe, {
|
|
82
83
|
askSuggestedQuestion: h,
|
|
83
84
|
hasCustomSuggestedQuestions: T,
|
|
84
85
|
isLoading: x,
|
|
85
|
-
onSuggestedQuestionInteraction:
|
|
86
|
+
onSuggestedQuestionInteraction: N,
|
|
86
87
|
recordAction: c,
|
|
87
88
|
setAskSuggestedQuestion: l,
|
|
88
89
|
suggestedQuestions: m,
|
|
89
|
-
suggestedQuestionsRequestState:
|
|
90
|
+
suggestedQuestionsRequestState: j,
|
|
90
91
|
variant: t
|
|
91
|
-
}), /* @__PURE__ */ e(
|
|
92
|
+
}), /* @__PURE__ */ e(Z, {
|
|
92
93
|
as: "p",
|
|
93
94
|
className: a.clearChatText,
|
|
94
|
-
children:
|
|
95
|
+
children: W || D(ie.welcomeClearChatText, {
|
|
95
96
|
type: n
|
|
96
97
|
})
|
|
97
98
|
}), !o && /* @__PURE__ */ e("ul", {
|
|
98
|
-
children:
|
|
99
|
+
children: O.map(({
|
|
99
100
|
answer: i,
|
|
100
101
|
thinkingAnswer: r,
|
|
101
|
-
citations:
|
|
102
|
+
citations: J,
|
|
102
103
|
id: s,
|
|
103
|
-
isCompleted:
|
|
104
|
-
isLoading:
|
|
105
|
-
error:
|
|
104
|
+
isCompleted: K,
|
|
105
|
+
isLoading: U,
|
|
106
|
+
error: V,
|
|
106
107
|
prompt: d,
|
|
107
|
-
promptType:
|
|
108
|
-
feedbackValue:
|
|
108
|
+
promptType: X,
|
|
109
|
+
feedbackValue: Y
|
|
109
110
|
}) => /* @__PURE__ */ _("li", {
|
|
110
|
-
children: [/* @__PURE__ */ e(
|
|
111
|
+
children: [/* @__PURE__ */ e(te, {
|
|
111
112
|
prompt: d,
|
|
112
113
|
variant: t
|
|
113
|
-
}), r && /* @__PURE__ */ e(
|
|
114
|
+
}), r && /* @__PURE__ */ e(ae, {
|
|
114
115
|
content: r,
|
|
115
116
|
isThinkingComplete: !!i,
|
|
117
|
+
onDropdownOpenChange: I,
|
|
116
118
|
variant: t
|
|
117
|
-
}), /* @__PURE__ */ e(
|
|
119
|
+
}), /* @__PURE__ */ e(S, {
|
|
118
120
|
answer: i,
|
|
119
|
-
citations:
|
|
121
|
+
citations: J,
|
|
120
122
|
contentType: n,
|
|
121
|
-
error:
|
|
122
|
-
feedbackValue:
|
|
123
|
-
hostAppName:
|
|
123
|
+
error: V,
|
|
124
|
+
feedbackValue: Y,
|
|
125
|
+
hostAppName: z,
|
|
124
126
|
isCitationsEnabled: b,
|
|
125
|
-
isCompleted:
|
|
127
|
+
isCompleted: K,
|
|
126
128
|
isFeedbackEnabled: C,
|
|
127
129
|
isFeedbackFormEnabled: v,
|
|
128
|
-
isFeedbackTooltipOpen:
|
|
130
|
+
isFeedbackTooltipOpen: E === s,
|
|
129
131
|
isInlineCitationsEnabled: g,
|
|
130
|
-
isLoading:
|
|
132
|
+
isLoading: U || u,
|
|
131
133
|
isMarkdownEnabled: k,
|
|
132
|
-
isReactMarkdownEnabled:
|
|
134
|
+
isReactMarkdownEnabled: R,
|
|
133
135
|
items: p.items,
|
|
134
136
|
onAnswerCopy: F,
|
|
135
137
|
onCitationClick: q,
|
|
136
138
|
onFeedbackFormSubmit: A,
|
|
137
|
-
onFeedbackTooltipOpenChange:
|
|
139
|
+
onFeedbackTooltipOpenChange: H,
|
|
138
140
|
prompt: d,
|
|
139
|
-
promptType:
|
|
141
|
+
promptType: X,
|
|
140
142
|
questionId: s,
|
|
141
143
|
recordAction: c,
|
|
142
|
-
setAnswerFeedback:
|
|
143
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
144
|
-
shouldFeedbackIncludePromptData:
|
|
145
|
-
useAnimation:
|
|
144
|
+
setAnswerFeedback: Q,
|
|
145
|
+
shouldFeedbackFormIncludeFeedbackText: y,
|
|
146
|
+
shouldFeedbackIncludePromptData: B,
|
|
147
|
+
useAnimation: M,
|
|
146
148
|
variant: t
|
|
147
149
|
})]
|
|
148
150
|
}, s))
|
|
@@ -151,6 +153,6 @@ import '../../../../styles/chat.css';const re = "_chat_77vqr_1", se = "_clearCha
|
|
|
151
153
|
});
|
|
152
154
|
};
|
|
153
155
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
Fe as Chat,
|
|
157
|
+
Fe as default
|
|
156
158
|
};
|
|
@@ -4,10 +4,10 @@ import * as t from "react";
|
|
|
4
4
|
import { useIntl as S } from "react-intl";
|
|
5
5
|
import k from "../../messages.js";
|
|
6
6
|
import { C as y } from "../../../../chunks/types.js";
|
|
7
|
-
import { jsx as
|
|
7
|
+
import { jsx as r, 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/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",
|
|
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", o = {
|
|
11
11
|
loadingIndicatorWrapper: D,
|
|
12
12
|
content: G,
|
|
13
13
|
sidebar: J,
|
|
@@ -31,11 +31,11 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
|
|
|
31
31
|
hostAppName: I = "",
|
|
32
32
|
...L
|
|
33
33
|
}) => {
|
|
34
|
-
const
|
|
34
|
+
const f = t.useRef(null), l = t.useRef(null), d = t.useRef(null), n = t.useRef(!0), [g, N] = t.useState(!1), {
|
|
35
35
|
formatMessage: O
|
|
36
36
|
} = S(), E = u === y.LARGE_FILE, s = t.useCallback((a) => {
|
|
37
37
|
var e;
|
|
38
|
-
(e =
|
|
38
|
+
(e = d.current) != null && e.scrollIntoView && l.current && (!i || n.current) && d.current.scrollIntoView({
|
|
39
39
|
behavior: a,
|
|
40
40
|
block: "nearest"
|
|
41
41
|
});
|
|
@@ -47,39 +47,39 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
|
|
|
47
47
|
scrollHeight: T
|
|
48
48
|
} = l.current, W = T - (a + e);
|
|
49
49
|
if (c && W > 100) {
|
|
50
|
-
|
|
50
|
+
n.current = !1;
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
n.current = !0;
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
t.useEffect(() => {
|
|
57
|
-
g ?
|
|
57
|
+
g ? n.current = !1 : c && (n.current = !0, s("instant"));
|
|
58
58
|
}, [g, s, c]), t.useEffect(() => {
|
|
59
|
-
|
|
59
|
+
n.current = !0, s("instant");
|
|
60
60
|
}, [s]), t.useLayoutEffect(() => {
|
|
61
|
-
if (!
|
|
61
|
+
if (!f.current)
|
|
62
62
|
return;
|
|
63
63
|
const a = new ResizeObserver(() => {
|
|
64
|
-
s(i ? "instant" : "smooth");
|
|
65
|
-
}), e =
|
|
64
|
+
n.current && s(i ? "instant" : "smooth");
|
|
65
|
+
}), e = f.current;
|
|
66
66
|
return e && a.observe(e), () => {
|
|
67
67
|
e && a.unobserve(e);
|
|
68
68
|
};
|
|
69
69
|
}, [s, i]);
|
|
70
|
-
const z = () => h && !E ? /* @__PURE__ */
|
|
70
|
+
const z = () => h && !E ? /* @__PURE__ */ r(A, {
|
|
71
71
|
error: u,
|
|
72
72
|
recordAction: m
|
|
73
|
-
}) : p ? /* @__PURE__ */
|
|
74
|
-
className:
|
|
75
|
-
children: /* @__PURE__ */
|
|
73
|
+
}) : p ? /* @__PURE__ */ r("div", {
|
|
74
|
+
className: o.loadingIndicatorWrapper,
|
|
75
|
+
children: /* @__PURE__ */ r(F, {
|
|
76
76
|
"aria-label": O(k.loading),
|
|
77
|
-
className:
|
|
77
|
+
className: o.loadingIndicator,
|
|
78
78
|
"data-testid": "content-answers-modal-loading-indicator",
|
|
79
79
|
size: "large"
|
|
80
80
|
})
|
|
81
81
|
}) : /* @__PURE__ */ H(V, {
|
|
82
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ r(B, {
|
|
83
83
|
askSuggestedQuestion: b,
|
|
84
84
|
hasCustomSuggestedQuestions: C,
|
|
85
85
|
hasRequestInProgress: c,
|
|
@@ -93,19 +93,19 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
|
|
|
93
93
|
useAnimation: j,
|
|
94
94
|
variant: _,
|
|
95
95
|
...L
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
-
ref:
|
|
98
|
-
className:
|
|
96
|
+
}), /* @__PURE__ */ r("div", {
|
|
97
|
+
ref: d,
|
|
98
|
+
className: o.messagesEnd
|
|
99
99
|
})]
|
|
100
100
|
});
|
|
101
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ r("div", {
|
|
102
102
|
ref: l,
|
|
103
|
-
className: M(
|
|
103
|
+
className: M(o.content, _ === "sidebar" && o.sidebar, p && o.isLoading),
|
|
104
104
|
"data-testid": "content-answers-content",
|
|
105
105
|
onScroll: x,
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
ref:
|
|
108
|
-
className:
|
|
106
|
+
children: /* @__PURE__ */ r("div", {
|
|
107
|
+
ref: f,
|
|
108
|
+
className: o.innerContent,
|
|
109
109
|
children: z()
|
|
110
110
|
})
|
|
111
111
|
});
|