@box/box-ai-content-answers 1.19.4 → 1.21.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/chunks/clear-conversation-button.js +15 -16
- package/dist/chunks/stopResponseButton.js +19 -23
- package/dist/chunks/types.js +8 -8
- package/dist/chunks/warning-message.js +15 -16
- package/dist/esm/lib/components/answer/answer-content.js +15 -15
- package/dist/esm/lib/components/answer/answer.js +107 -109
- package/dist/esm/lib/components/answer/citation.js +23 -24
- package/dist/esm/lib/components/answer/copy-button.js +3 -3
- package/dist/esm/lib/components/answer/embed-the-answer-button.js +44 -44
- package/dist/esm/lib/components/answer/feedback-tooltip.js +63 -56
- package/dist/esm/lib/components/answer/inline-error.js +1 -1
- package/dist/esm/lib/components/answer/loading-indicator.js +15 -18
- package/dist/esm/lib/components/answer/references.js +30 -30
- package/dist/esm/lib/components/answer/thumb-buttons.js +95 -96
- package/dist/esm/lib/components/api-wrapper/hooks/useContentAnswers.js +166 -167
- package/dist/esm/lib/components/api-wrapper/reducer.js +1 -1
- package/dist/esm/lib/components/api-wrapper/utils/request.js +8 -8
- package/dist/esm/lib/components/api-wrapper/utils/stream.js +24 -25
- package/dist/esm/lib/components/chat/chat.js +78 -79
- package/dist/esm/lib/components/common/focusInputUtils.js +3 -4
- package/dist/esm/lib/components/common/markdown-react.js +91 -93
- package/dist/esm/lib/components/common/markdown.js +2666 -2696
- package/dist/esm/lib/components/content/content.js +38 -39
- package/dist/esm/lib/components/footer/footer-actions.js +3 -3
- package/dist/esm/lib/components/footer/footer.js +97 -98
- package/dist/esm/lib/components/modal/modal.js +121 -122
- package/dist/esm/lib/components/sidebar/content.js +95 -101
- package/dist/esm/lib/components/sidebar/sidebar.js +82 -83
- package/dist/esm/lib/components/suggested-questions/suggested-questions.js +1 -1
- package/dist/esm/lib/components/suggested-questions/suggestions.js +30 -30
- package/dist/esm/lib/components/welcome-message/contextual-items-message.js +36 -38
- package/dist/esm/lib/components/welcome-message/items-dropdown.js +27 -27
- package/dist/esm/lib/hooks/usePromptFocus.js +13 -14
- package/dist/i18n/en-x-pseudo.js +89 -89
- package/dist/i18n/en-x-pseudo.properties +89 -89
- package/dist/styles/answer-content.css +1 -1
- package/dist/styles/answer.css +1 -1
- package/dist/styles/box-ai-content-answers.css +1 -1
- package/dist/styles/chat.css +1 -1
- package/dist/styles/clear-conversation-button.css +1 -1
- package/dist/styles/content.css +1 -1
- package/dist/styles/content2.css +1 -1
- package/dist/styles/markdown2.css +1 -1
- package/dist/styles/question.css +1 -1
- package/dist/styles/stopResponseButton.css +1 -1
- package/dist/styles/warning-message.css +1 -1
- package/dist/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { useBlueprintModernization as
|
|
2
|
-
import { Trash as
|
|
3
|
-
import { Trash as
|
|
1
|
+
import { useBlueprintModernization as i, Tooltip as c, IconButton as d } from "@box/blueprint-web";
|
|
2
|
+
import { Trash as m } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { Trash as _ } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
4
|
import b from "clsx";
|
|
5
5
|
import { useIntl as C } from "react-intl";
|
|
6
6
|
import t from "../esm/lib/components/modal/messages.js";
|
|
7
7
|
import { jsx as e } from "react/jsx-runtime";
|
|
8
|
-
import '../styles/clear-conversation-button.css';const g = "_BoxAIIconColor_ild3b_1",
|
|
8
|
+
import '../styles/clear-conversation-button.css';const g = "_BoxAIIconColor_ild3b_1", u = "_modalHeader_ild3b_5", p = "_contentAnswersModal_ild3b_10", A = "_boxAiContentAnswers_ild3b_18", B = "_clearButton_ild3b_26", I = "_modalHeaderContainer_ild3b_55", f = "_agentSelectorTrigger_ild3b_63", x = "_agentSelectorContent_ild3b_74", T = {
|
|
9
9
|
BoxAIIconColor: g,
|
|
10
|
-
modalHeader:
|
|
11
|
-
contentAnswersModal:
|
|
12
|
-
boxAiContentAnswers:
|
|
10
|
+
modalHeader: u,
|
|
11
|
+
contentAnswersModal: p,
|
|
12
|
+
boxAiContentAnswers: A,
|
|
13
13
|
clearButton: B,
|
|
14
14
|
"modal-close-button": "_modal-close-button_ild3b_30",
|
|
15
|
-
|
|
16
|
-
modalHeaderContainer: M,
|
|
15
|
+
modalHeaderContainer: I,
|
|
17
16
|
agentSelectorTrigger: f,
|
|
18
|
-
agentSelectorContent:
|
|
19
|
-
},
|
|
17
|
+
agentSelectorContent: x
|
|
18
|
+
}, L = ({
|
|
20
19
|
onClick: n,
|
|
21
20
|
hasRequestInProgress: a,
|
|
22
21
|
className: r
|
|
23
22
|
}) => {
|
|
24
23
|
const o = C(), {
|
|
25
24
|
enableModernizedComponents: s
|
|
26
|
-
} =
|
|
27
|
-
return /* @__PURE__ */ e(
|
|
25
|
+
} = i(), l = s ? _ : m;
|
|
26
|
+
return /* @__PURE__ */ e(c, {
|
|
28
27
|
content: o.formatMessage(t.clearConversationLabel),
|
|
29
28
|
"data-testid": "clear-conversation-tooltip",
|
|
30
29
|
variant: "standard",
|
|
31
30
|
children: /* @__PURE__ */ e(d, {
|
|
32
31
|
"aria-label": o.formatMessage(t.clearConversationLabel),
|
|
33
|
-
className: b(
|
|
32
|
+
className: b(T.clearButton, r),
|
|
34
33
|
"data-testid": "clear-conversation-button",
|
|
35
34
|
disabled: a,
|
|
36
35
|
icon: l,
|
|
@@ -41,6 +40,6 @@ import '../styles/clear-conversation-button.css';const g = "_BoxAIIconColor_ild3
|
|
|
41
40
|
});
|
|
42
41
|
};
|
|
43
42
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
L as C,
|
|
44
|
+
T as s
|
|
46
45
|
};
|
|
@@ -2,52 +2,48 @@ import * as p from "react";
|
|
|
2
2
|
import { useIntl as u } from "react-intl";
|
|
3
3
|
import { Tooltip as _, Button as m } from "@box/blueprint-web";
|
|
4
4
|
import { Stop as c } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
-
import {
|
|
5
|
+
import { LOGGER_ACTION_CLICK as l, LOGGER_BASE_CONFIG as x } from "../esm/lib/components/common/constants.js";
|
|
6
6
|
import e from "../esm/lib/components/footer/messages.js";
|
|
7
|
-
import { jsx as
|
|
8
|
-
import '../styles/stopResponseButton.css';const
|
|
9
|
-
questionInput:
|
|
10
|
-
questionInputWithOutPromptLibrary:
|
|
11
|
-
|
|
12
|
-
inputAreaButton: d,
|
|
13
|
-
square: f,
|
|
7
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
+
import '../styles/stopResponseButton.css';const d = "_questionInput_w27x6_2", f = "_questionInputWithOutPromptLibrary_w27x6_16", B = "_inputAreaButton_w27x6_34", C = "_textArea_w27x6_63", I = "_sidebar_w27x6_89", b = "_actionContainer_w27x6_106", R = "_promptButton_w27x6_112", w = {
|
|
9
|
+
questionInput: d,
|
|
10
|
+
questionInputWithOutPromptLibrary: f,
|
|
11
|
+
inputAreaButton: B,
|
|
14
12
|
textArea: C,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
actionContainer: A,
|
|
19
|
-
promptButton: O
|
|
13
|
+
sidebar: I,
|
|
14
|
+
actionContainer: b,
|
|
15
|
+
promptButton: R
|
|
20
16
|
};
|
|
21
|
-
function
|
|
17
|
+
function G({
|
|
22
18
|
recordAction: t,
|
|
23
19
|
lastQuestion: o,
|
|
24
20
|
onStopQuestion: n,
|
|
25
|
-
size:
|
|
21
|
+
size: r = "large"
|
|
26
22
|
}) {
|
|
27
23
|
const s = u(), i = p.useCallback(() => {
|
|
28
24
|
t && t({
|
|
29
|
-
...
|
|
30
|
-
action:
|
|
25
|
+
...x,
|
|
26
|
+
action: l,
|
|
31
27
|
target: "stopResponse"
|
|
32
28
|
}), n(o);
|
|
33
29
|
}, [o, n, t]);
|
|
34
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ a(_, {
|
|
35
31
|
content: s.formatMessage(e.stopResponse),
|
|
36
32
|
"data-testid": "stop-response-tooltip",
|
|
37
33
|
variant: "standard",
|
|
38
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ a(m, {
|
|
39
35
|
"aria-label": s.formatMessage(e.stopResponse),
|
|
40
36
|
"aria-live": "polite",
|
|
41
|
-
className:
|
|
37
|
+
className: w.inputAreaButton,
|
|
42
38
|
"data-testid": "content-answers-stop-response-button",
|
|
43
39
|
icon: c,
|
|
44
40
|
onClick: i,
|
|
45
|
-
size:
|
|
41
|
+
size: r,
|
|
46
42
|
"data-target-id": "Button-stopResponse"
|
|
47
43
|
})
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
46
|
export {
|
|
51
|
-
S,
|
|
52
|
-
|
|
47
|
+
G as S,
|
|
48
|
+
w as s
|
|
53
49
|
};
|
package/dist/chunks/types.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
let e = /* @__PURE__ */ function(t) {
|
|
1
|
+
let e = /* @__PURE__ */ (function(t) {
|
|
2
2
|
return t.GENERAL = "general", t.RATE_LIMITING = "rate_limiting", t.NO_CONTENT = "no_content", t.PRECONDITION_FAILED = "precondition_failed", t.AGENT_NOT_FOUND = "agent_not_found", t.RESPONSE_FAILED = "response_failed", t.RESPONSE_INTERRUPTED = "response_interrupted", t.RESPONSE_STOPPED = "response_stopped", t;
|
|
3
|
-
}({}), n = /* @__PURE__ */ function(t) {
|
|
3
|
+
})({}), n = /* @__PURE__ */ (function(t) {
|
|
4
4
|
return t.LARGE_FILE = "large_file", t.GENERAL = "general", t;
|
|
5
|
-
}({}), r = /* @__PURE__ */ function(t) {
|
|
5
|
+
})({}), r = /* @__PURE__ */ (function(t) {
|
|
6
6
|
return t.NOT_STARTED = "not_started", t.IN_PROGRESS = "in_progress", t.SUCCESS = "success", t.ERROR = "error", t.CANCELLED = "cancelled", t;
|
|
7
|
-
}({}), s = /* @__PURE__ */ function(t) {
|
|
7
|
+
})({}), s = /* @__PURE__ */ (function(t) {
|
|
8
8
|
return t.CUSTOM = "suggested_question_custom", t.INTELLIGENT = "suggested_question_intelligent", t.STATIC = "suggested_question_static", t;
|
|
9
|
-
}({});
|
|
9
|
+
})({});
|
|
10
10
|
const o = "user_input";
|
|
11
|
-
let i = /* @__PURE__ */ function(t) {
|
|
11
|
+
let i = /* @__PURE__ */ (function(t) {
|
|
12
12
|
return t.DID_NOT_FOLLOW_REQUEST = "did_not_follow_request", t.INACCURATE_ANSWER = "inaccurate_answer", t.OTHER = "other", t;
|
|
13
|
-
}({}), u = /* @__PURE__ */ function(t) {
|
|
13
|
+
})({}), u = /* @__PURE__ */ (function(t) {
|
|
14
14
|
return t.HUBS_METADATA = "hubs_metadata", t;
|
|
15
|
-
}({});
|
|
15
|
+
})({});
|
|
16
16
|
export {
|
|
17
17
|
e as A,
|
|
18
18
|
n as C,
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { InlineNotice as r, Text as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import '../styles/warning-message.css';const
|
|
4
|
-
welcomeMessage:
|
|
5
|
-
warnings:
|
|
6
|
-
warningNotice: g
|
|
7
|
-
|
|
8
|
-
}, v = ({
|
|
1
|
+
import { InlineNotice as r, Text as a } from "@box/blueprint-web";
|
|
2
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import '../styles/warning-message.css';const t = "_welcomeMessage_q7ymc_2", c = "_warnings_q7ymc_5", g = "_warningNotice_q7ymc_10", l = {
|
|
4
|
+
welcomeMessage: t,
|
|
5
|
+
warnings: c,
|
|
6
|
+
warningNotice: g
|
|
7
|
+
}, _ = ({
|
|
9
8
|
ariaLabel: s,
|
|
10
9
|
title: i,
|
|
11
|
-
description:
|
|
12
|
-
}) => /* @__PURE__ */
|
|
13
|
-
className:
|
|
10
|
+
description: n
|
|
11
|
+
}) => /* @__PURE__ */ o(r, {
|
|
12
|
+
className: l.warningNotice,
|
|
14
13
|
variant: "warning",
|
|
15
14
|
variantIconAriaLabel: s,
|
|
16
|
-
children: [/* @__PURE__ */ e(
|
|
15
|
+
children: [/* @__PURE__ */ e(a, {
|
|
17
16
|
as: "p",
|
|
18
17
|
variant: "bodyDefaultBold",
|
|
19
18
|
children: i
|
|
20
|
-
}),
|
|
19
|
+
}), n && /* @__PURE__ */ e(a, {
|
|
21
20
|
as: "p",
|
|
22
21
|
variant: "bodyDefault",
|
|
23
|
-
children:
|
|
22
|
+
children: n
|
|
24
23
|
})]
|
|
25
24
|
});
|
|
26
25
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
_ as W,
|
|
27
|
+
l as s
|
|
29
28
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import i from "clsx";
|
|
2
|
-
import { injectInlineCitation as
|
|
3
|
-
import { markdownToHtmlString as
|
|
4
|
-
import
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import '../../../../styles/answer-content.css';const
|
|
7
|
-
answerContent:
|
|
8
|
-
answerMarkdown:
|
|
2
|
+
import { injectInlineCitation as k } from "../../utils/inlineCitationsUtils.js";
|
|
3
|
+
import { markdownToHtmlString as x } from "../common/markdown.js";
|
|
4
|
+
import M from "../common/markdown-react.js";
|
|
5
|
+
import { jsxs as u, Fragment as b, jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import '../../../../styles/answer-content.css';const g = "_answerContent_9f3o6_2", j = "_answerMarkdown_9f3o6_16", n = {
|
|
7
|
+
answerContent: g,
|
|
8
|
+
answerMarkdown: j
|
|
9
9
|
}, I = ({
|
|
10
10
|
answer: t,
|
|
11
11
|
items: m,
|
|
@@ -13,30 +13,30 @@ import '../../../../styles/answer-content.css';const b = "_answerContent_1va9v_2
|
|
|
13
13
|
isInlineCitationV2Enabled: w,
|
|
14
14
|
isInlineCitationsEnabled: l,
|
|
15
15
|
isMarkdownEnabled: e,
|
|
16
|
-
isReactMarkdownEnabled:
|
|
16
|
+
isReactMarkdownEnabled: f = !1,
|
|
17
17
|
className: o,
|
|
18
|
-
variant:
|
|
18
|
+
variant: C = "modal",
|
|
19
19
|
...s
|
|
20
20
|
}) => {
|
|
21
|
-
const a =
|
|
22
|
-
const d =
|
|
21
|
+
const a = C === "sidebar", _ = (h) => {
|
|
22
|
+
const d = k(h, {
|
|
23
23
|
items: m,
|
|
24
24
|
isCompleted: c,
|
|
25
25
|
isInlineCitationsEnabled: l
|
|
26
26
|
});
|
|
27
|
-
if (
|
|
28
|
-
return /* @__PURE__ */ r(
|
|
27
|
+
if (f)
|
|
28
|
+
return /* @__PURE__ */ r(M, {
|
|
29
29
|
isInlineCitationV2Enabled: w,
|
|
30
30
|
children: d
|
|
31
31
|
});
|
|
32
|
-
const p =
|
|
32
|
+
const p = x(d);
|
|
33
33
|
return /* @__PURE__ */ r("div", {
|
|
34
34
|
dangerouslySetInnerHTML: {
|
|
35
35
|
__html: p
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ u(b, {
|
|
40
40
|
children: [!e && /* @__PURE__ */ r("div", {
|
|
41
41
|
className: i(n.answerContent, a && n.sidebar, "Answer-text", o),
|
|
42
42
|
...s,
|
|
@@ -1,196 +1,194 @@
|
|
|
1
|
-
import { Text as
|
|
1
|
+
import { Text as N } from "@box/blueprint-web";
|
|
2
2
|
import { AlertTriangle as X } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { memo as Z, useState as $, useEffect as
|
|
3
|
+
import { Size4 as T, Gray65 as Y } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
+
import p from "clsx";
|
|
5
|
+
import { memo as Z, useState as $, useEffect as I } from "react";
|
|
6
6
|
import { useIntl as tt } from "react-intl";
|
|
7
7
|
import { A as s } from "../../../../chunks/types.js";
|
|
8
8
|
import { MediaContainer as S } from "../common/media-container.js";
|
|
9
|
-
import { BoxAILoadingIndicator as
|
|
10
|
-
import { AnswerContent as
|
|
11
|
-
import { CopyButton as
|
|
9
|
+
import { BoxAILoadingIndicator as et } from "../thinkingBubble/boxAILoadingIndicator.js";
|
|
10
|
+
import { AnswerContent as nt } from "./answer-content.js";
|
|
11
|
+
import { CopyButton as ot } from "./copy-button.js";
|
|
12
12
|
import { EmbedTheAnswerButton as st } from "./embed-the-answer-button.js";
|
|
13
13
|
import { InlineError as rt } from "./inline-error.js";
|
|
14
|
-
import
|
|
15
|
-
import { References as
|
|
16
|
-
import { ThumbButtons as
|
|
17
|
-
import { jsxs as
|
|
18
|
-
import '../../../../styles/answer.css';const lt = "_answer_1miuw_2",
|
|
14
|
+
import d from "./messages.js";
|
|
15
|
+
import { References as it } from "./references.js";
|
|
16
|
+
import { ThumbButtons as at } from "./thumb-buttons.js";
|
|
17
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
18
|
+
import '../../../../styles/answer.css';const lt = "_answer_1miuw_2", ut = "_loadingContainer_1miuw_6", mt = "_loadingText_1miuw_13", ct = "_alertIcon_1miuw_22", dt = "_error_1miuw_25", _t = "_footer_1miuw_29", ft = "_copyButtonContainer_1miuw_35", ht = "_feedbackButtonsContainer_1miuw_36", Et = "_shouldHaveMarginTop_1miuw_40", gt = "_shouldUseAnimation_1miuw_43", wt = "_shouldAnimateHeight_1miuw_47", Nt = "_footerButtons_1miuw_51", Tt = "_embedTheAnswerButtonContainer_1miuw_72", pt = "_buttonsVisible_1miuw_80", t = {
|
|
19
19
|
answer: lt,
|
|
20
|
-
loadingContainer:
|
|
21
|
-
loadingText:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
shouldUseAnimation: pt,
|
|
20
|
+
loadingContainer: ut,
|
|
21
|
+
loadingText: mt,
|
|
22
|
+
alertIcon: ct,
|
|
23
|
+
error: dt,
|
|
24
|
+
footer: _t,
|
|
25
|
+
copyButtonContainer: ft,
|
|
26
|
+
feedbackButtonsContainer: ht,
|
|
27
|
+
shouldHaveMarginTop: Et,
|
|
28
|
+
shouldUseAnimation: gt,
|
|
30
29
|
shouldAnimateHeight: wt,
|
|
31
|
-
footerButtons:
|
|
32
|
-
iconAvatar: gt,
|
|
30
|
+
footerButtons: Nt,
|
|
33
31
|
embedTheAnswerButtonContainer: Tt,
|
|
34
|
-
buttonsVisible:
|
|
35
|
-
},
|
|
36
|
-
answer:
|
|
32
|
+
buttonsVisible: pt
|
|
33
|
+
}, It = /* @__PURE__ */ new Set([s.RATE_LIMITING, s.NO_CONTENT, s.PRECONDITION_FAILED, s.GENERAL, s.AGENT_NOT_FOUND]), Gt = /* @__PURE__ */ Z(({
|
|
34
|
+
answer: n,
|
|
37
35
|
citations: R,
|
|
38
|
-
error:
|
|
39
|
-
contentType:
|
|
40
|
-
hostAppName:
|
|
41
|
-
feedbackValue:
|
|
42
|
-
isCitationsEnabled:
|
|
36
|
+
error: o,
|
|
37
|
+
contentType: b,
|
|
38
|
+
hostAppName: m,
|
|
39
|
+
feedbackValue: B,
|
|
40
|
+
isCitationsEnabled: C = !1,
|
|
43
41
|
isCompleted: r = !1,
|
|
44
|
-
isFeedbackEnabled:
|
|
45
|
-
isFeedbackFormEnabled:
|
|
46
|
-
isFeedbackTooltipOpen:
|
|
42
|
+
isFeedbackEnabled: O = !1,
|
|
43
|
+
isFeedbackFormEnabled: A,
|
|
44
|
+
isFeedbackTooltipOpen: h,
|
|
47
45
|
isInlineCitationsEnabled: P = !1,
|
|
48
46
|
isInlineCitationV2Enabled: x,
|
|
49
|
-
isLoading:
|
|
50
|
-
isMarkdownEnabled:
|
|
47
|
+
isLoading: M = !1,
|
|
48
|
+
isMarkdownEnabled: y = !1,
|
|
51
49
|
items: l = [],
|
|
52
|
-
onAnswerCopy:
|
|
53
|
-
embedTheAnswerButtonConfig:
|
|
54
|
-
onCitationClick:
|
|
55
|
-
onFeedbackFormSubmit:
|
|
50
|
+
onAnswerCopy: D,
|
|
51
|
+
embedTheAnswerButtonConfig: E,
|
|
52
|
+
onCitationClick: L,
|
|
53
|
+
onFeedbackFormSubmit: v,
|
|
56
54
|
onFeedbackTooltipOpenChange: F,
|
|
57
55
|
prompt: H,
|
|
58
56
|
promptType: U,
|
|
59
|
-
recordAction:
|
|
57
|
+
recordAction: i,
|
|
60
58
|
shouldFeedbackFormIncludeFeedbackText: k,
|
|
61
59
|
shouldFeedbackIncludePromptData: G,
|
|
62
60
|
useAnimation: V = !0,
|
|
63
|
-
variant:
|
|
61
|
+
variant: a = "modal",
|
|
64
62
|
isReactMarkdownEnabled: j,
|
|
65
63
|
setAnswerFeedback: z,
|
|
66
|
-
questionId:
|
|
64
|
+
questionId: g
|
|
67
65
|
}) => {
|
|
68
|
-
const
|
|
69
|
-
formatMessage:
|
|
66
|
+
const _ = It.has(o), f = M && !n && !o, [W, q] = $(r), {
|
|
67
|
+
formatMessage: c
|
|
70
68
|
} = tt();
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
I(() => {
|
|
70
|
+
n && i && r && l.some((Q) => n.includes(Q.name)) && i({
|
|
73
71
|
action: "programmatic",
|
|
74
|
-
component:
|
|
72
|
+
component: a,
|
|
75
73
|
feature: "answers",
|
|
76
74
|
target: "links_detected",
|
|
77
75
|
data: {
|
|
78
|
-
hostAppName:
|
|
76
|
+
hostAppName: m,
|
|
79
77
|
linkCount: l.length,
|
|
80
78
|
fileNameCount: l.length
|
|
81
79
|
}
|
|
82
80
|
});
|
|
83
|
-
}, [
|
|
81
|
+
}, [n, a, m, r, i, l]), I(() => {
|
|
84
82
|
setTimeout(() => q(r), 0);
|
|
85
83
|
}, [r]);
|
|
86
|
-
const
|
|
84
|
+
const w = () => /* @__PURE__ */ e(X, {
|
|
87
85
|
className: t.alertIcon,
|
|
88
86
|
color: Y,
|
|
89
87
|
"data-testid": "content-answers-error-alert-icon",
|
|
90
|
-
height:
|
|
88
|
+
height: T,
|
|
91
89
|
role: "presentation",
|
|
92
|
-
width:
|
|
93
|
-
}), J = () => /* @__PURE__ */
|
|
90
|
+
width: T
|
|
91
|
+
}), J = () => /* @__PURE__ */ u(N, {
|
|
94
92
|
as: "p",
|
|
95
93
|
className: t.error,
|
|
96
94
|
color: "textOnLightSecondary",
|
|
97
95
|
"data-testid": "content-answers-error",
|
|
98
96
|
variant: "caption",
|
|
99
|
-
children: [
|
|
100
|
-
}), K = () =>
|
|
101
|
-
className:
|
|
102
|
-
[t.buttonsVisible]:
|
|
97
|
+
children: [o === s.RESPONSE_INTERRUPTED && c(d.responseInterruptedError), o === s.RESPONSE_FAILED && c(d.responseFailedError), o === s.RESPONSE_STOPPED && c(d.responseStoppedError), o !== s.RESPONSE_STOPPED && w()]
|
|
98
|
+
}), K = () => o !== s.RESPONSE_STOPPED ? /* @__PURE__ */ u("div", {
|
|
99
|
+
className: p(t.footerButtons, "footer-buttons-container", {
|
|
100
|
+
[t.buttonsVisible]: h
|
|
103
101
|
}),
|
|
104
|
-
children: [
|
|
102
|
+
children: [O ? /* @__PURE__ */ e("div", {
|
|
105
103
|
className: t.feedbackButtonsContainer,
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
feedbackValue:
|
|
108
|
-
hostAppName:
|
|
109
|
-
isFeedbackFormEnabled:
|
|
110
|
-
isFeedbackTooltipOpen:
|
|
104
|
+
children: /* @__PURE__ */ e(at, {
|
|
105
|
+
feedbackValue: B,
|
|
106
|
+
hostAppName: m,
|
|
107
|
+
isFeedbackFormEnabled: A,
|
|
108
|
+
isFeedbackTooltipOpen: h,
|
|
111
109
|
items: l,
|
|
112
|
-
onFeedbackFormSubmit:
|
|
110
|
+
onFeedbackFormSubmit: v,
|
|
113
111
|
onFeedbackTooltipOpenChange: F,
|
|
114
112
|
prompt: H,
|
|
115
113
|
promptType: U,
|
|
116
|
-
questionId:
|
|
117
|
-
recordAction:
|
|
118
|
-
response:
|
|
114
|
+
questionId: g,
|
|
115
|
+
recordAction: i,
|
|
116
|
+
response: n,
|
|
119
117
|
setAnswerFeedback: z,
|
|
120
118
|
shouldFeedbackFormIncludeFeedbackText: k,
|
|
121
119
|
shouldFeedbackIncludePromptData: G,
|
|
122
|
-
variant:
|
|
120
|
+
variant: a
|
|
123
121
|
})
|
|
124
|
-
}) : null, /* @__PURE__ */
|
|
122
|
+
}) : null, /* @__PURE__ */ e("div", {
|
|
125
123
|
className: t.copyButtonContainer,
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
answer:
|
|
128
|
-
onAnswerCopy:
|
|
129
|
-
recordAction:
|
|
124
|
+
children: /* @__PURE__ */ e(ot, {
|
|
125
|
+
answer: n,
|
|
126
|
+
onAnswerCopy: D,
|
|
127
|
+
recordAction: i
|
|
130
128
|
})
|
|
131
129
|
})]
|
|
132
|
-
}) :
|
|
133
|
-
return /* @__PURE__ */
|
|
130
|
+
}) : n ? null : w();
|
|
131
|
+
return /* @__PURE__ */ u("div", {
|
|
134
132
|
"aria-live": "polite",
|
|
135
133
|
className: t.answer,
|
|
136
134
|
"data-testid": "content-answers-answer",
|
|
137
|
-
children: [
|
|
135
|
+
children: [f && /* @__PURE__ */ u("div", {
|
|
138
136
|
className: t.loadingContainer,
|
|
139
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ e(et, {}), /* @__PURE__ */ e(N, {
|
|
140
138
|
as: "span",
|
|
141
139
|
className: t.loadingText,
|
|
142
140
|
color: "textOnLightDefault",
|
|
143
141
|
variant: "titleMedium",
|
|
144
|
-
children: d
|
|
142
|
+
children: c(d.analyzingRequest)
|
|
145
143
|
})]
|
|
146
|
-
}), !
|
|
144
|
+
}), !_ && !f && /* @__PURE__ */ e(S, {
|
|
147
145
|
className: "answer",
|
|
148
|
-
variant:
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
-
isUsedInsideSidebar:
|
|
146
|
+
variant: a,
|
|
147
|
+
children: /* @__PURE__ */ u(S.Content, {
|
|
148
|
+
isUsedInsideSidebar: a === "sidebar",
|
|
151
149
|
variant: "answer",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
153
|
-
answer:
|
|
150
|
+
children: [/* @__PURE__ */ e(nt, {
|
|
151
|
+
answer: n,
|
|
154
152
|
isCompleted: r,
|
|
155
153
|
isInlineCitationsEnabled: P,
|
|
156
154
|
isInlineCitationV2Enabled: x,
|
|
157
|
-
isMarkdownEnabled:
|
|
155
|
+
isMarkdownEnabled: y,
|
|
158
156
|
isReactMarkdownEnabled: j,
|
|
159
157
|
items: l,
|
|
160
|
-
variant:
|
|
161
|
-
}), r && /* @__PURE__ */
|
|
162
|
-
className:
|
|
163
|
-
[t.shouldHaveMarginTop]:
|
|
158
|
+
variant: a
|
|
159
|
+
}), r && /* @__PURE__ */ u("div", {
|
|
160
|
+
className: p(t.footer, {
|
|
161
|
+
[t.shouldHaveMarginTop]: n,
|
|
164
162
|
[t.shouldAnimateHeight]: W,
|
|
165
163
|
[t.shouldUseAnimation]: V
|
|
166
164
|
}),
|
|
167
165
|
"data-testid": "content-answers-answer-footer",
|
|
168
|
-
children: [
|
|
166
|
+
children: [o && J(), C && !o && /* @__PURE__ */ e(it, {
|
|
169
167
|
citations: R,
|
|
170
|
-
onCitationClick:
|
|
171
|
-
recordAction:
|
|
168
|
+
onCitationClick: L,
|
|
169
|
+
recordAction: i
|
|
172
170
|
}), K()]
|
|
173
171
|
})]
|
|
174
172
|
})
|
|
175
|
-
}), !
|
|
173
|
+
}), !_ && !f && r && E?.onAction && /* @__PURE__ */ e("div", {
|
|
176
174
|
className: t.embedTheAnswerButtonContainer,
|
|
177
|
-
children: /* @__PURE__ */
|
|
178
|
-
answer:
|
|
179
|
-
embedTheAnswerButtonConfig:
|
|
180
|
-
hostAppName:
|
|
181
|
-
questionId:
|
|
182
|
-
recordAction:
|
|
183
|
-
variant:
|
|
175
|
+
children: /* @__PURE__ */ e(st, {
|
|
176
|
+
answer: n,
|
|
177
|
+
embedTheAnswerButtonConfig: E,
|
|
178
|
+
hostAppName: m,
|
|
179
|
+
questionId: g,
|
|
180
|
+
recordAction: i,
|
|
181
|
+
variant: a
|
|
184
182
|
})
|
|
185
|
-
}),
|
|
186
|
-
contentType:
|
|
187
|
-
error:
|
|
188
|
-
recordAction:
|
|
189
|
-
variant:
|
|
183
|
+
}), _ && /* @__PURE__ */ e(rt, {
|
|
184
|
+
contentType: b,
|
|
185
|
+
error: o,
|
|
186
|
+
recordAction: i,
|
|
187
|
+
variant: a
|
|
190
188
|
})]
|
|
191
189
|
});
|
|
192
190
|
});
|
|
193
191
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
Gt as Answer,
|
|
193
|
+
Gt as default
|
|
196
194
|
};
|