@box/box-ai-content-answers 1.8.3 → 1.9.1
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/stopResponseButton.js +23 -23
- package/dist/chunks/warning-message.js +9 -9
- package/dist/esm/lib/components/answer/answer-content.js +7 -7
- package/dist/esm/lib/components/answer/answer.js +111 -111
- package/dist/esm/lib/components/answer/inline-error.js +20 -20
- package/dist/esm/lib/components/chat/chat.js +44 -44
- package/dist/esm/lib/components/common/media-container.js +32 -32
- package/dist/esm/lib/components/content/content.js +41 -41
- package/dist/esm/lib/components/question/question.js +11 -11
- package/dist/esm/lib/components/suggested-questions/suggested-questions.js +19 -19
- package/dist/esm/lib/components/suggested-questions/suggestions.js +5 -5
- 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/chat.css +1 -1
- package/dist/styles/content2.css +1 -1
- package/dist/styles/inline-error.css +1 -1
- package/dist/styles/media-container.css +1 -1
- package/dist/styles/question.css +1 -1
- package/dist/styles/stopResponseButton.css +1 -1
- package/dist/styles/suggested-questions.css +1 -1
- package/dist/styles/suggestions.css +1 -1
- package/dist/styles/warning-message.css +1 -1
- package/package.json +6 -6
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import * as p from "react";
|
|
2
2
|
import { useIntl as u } from "react-intl";
|
|
3
|
-
import { Tooltip as _, Button as
|
|
4
|
-
import { Stop as
|
|
5
|
-
import { LOGGER_BASE_CONFIG as
|
|
3
|
+
import { Tooltip as _, Button as m } from "@box/blueprint-web";
|
|
4
|
+
import { Stop as c } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
+
import { LOGGER_BASE_CONFIG as l, LOGGER_ACTION_CLICK as g } from "../esm/lib/components/common/constants.js";
|
|
6
6
|
import e from "../esm/lib/components/footer/messages.js";
|
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
import '../styles/stopResponseButton.css';const B = "
|
|
9
|
-
questionInput:
|
|
10
|
-
questionInputWithOutPromptLibrary:
|
|
11
|
-
avatar:
|
|
12
|
-
inputAreaButton:
|
|
13
|
-
square:
|
|
14
|
-
textArea:
|
|
15
|
-
error:
|
|
16
|
-
sidebar:
|
|
17
|
-
submitButtonTooltip:
|
|
18
|
-
actionContainer:
|
|
19
|
-
promptButton:
|
|
8
|
+
import '../styles/stopResponseButton.css';const k = "_questionInput_kn61g_2", B = "_questionInputWithOutPromptLibrary_kn61g_15", b = "_avatar_kn61g_30", d = "_inputAreaButton_kn61g_33", f = "_square_kn61g_49", C = "_textArea_kn61g_56", I = "_error_kn61g_79", q = "_sidebar_kn61g_82", R = "_submitButtonTooltip_kn61g_90", A = "_actionContainer_kn61g_99", O = "_promptButton_kn61g_105", L = {
|
|
9
|
+
questionInput: k,
|
|
10
|
+
questionInputWithOutPromptLibrary: B,
|
|
11
|
+
avatar: b,
|
|
12
|
+
inputAreaButton: d,
|
|
13
|
+
square: f,
|
|
14
|
+
textArea: C,
|
|
15
|
+
error: I,
|
|
16
|
+
sidebar: q,
|
|
17
|
+
submitButtonTooltip: R,
|
|
18
|
+
actionContainer: A,
|
|
19
|
+
promptButton: O
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function S({
|
|
22
22
|
recordAction: t,
|
|
23
23
|
lastQuestion: o,
|
|
24
24
|
onStopQuestion: n,
|
|
@@ -26,8 +26,8 @@ function k({
|
|
|
26
26
|
}) {
|
|
27
27
|
const s = u(), i = p.useCallback(() => {
|
|
28
28
|
t && t({
|
|
29
|
-
...
|
|
30
|
-
action:
|
|
29
|
+
...l,
|
|
30
|
+
action: g,
|
|
31
31
|
target: "stopResponse"
|
|
32
32
|
}), n(o);
|
|
33
33
|
}, [o, n, t]);
|
|
@@ -35,12 +35,12 @@ function k({
|
|
|
35
35
|
content: s.formatMessage(e.stopResponse),
|
|
36
36
|
"data-testid": "stop-response-tooltip",
|
|
37
37
|
variant: "standard",
|
|
38
|
-
children: /* @__PURE__ */ r(
|
|
38
|
+
children: /* @__PURE__ */ r(m, {
|
|
39
39
|
"aria-label": s.formatMessage(e.stopResponse),
|
|
40
40
|
"aria-live": "polite",
|
|
41
|
-
className:
|
|
41
|
+
className: L.inputAreaButton,
|
|
42
42
|
"data-testid": "content-answers-stop-response-button",
|
|
43
|
-
icon:
|
|
43
|
+
icon: c,
|
|
44
44
|
onClick: i,
|
|
45
45
|
size: a,
|
|
46
46
|
"data-target-id": "Button-stopResponse"
|
|
@@ -48,6 +48,6 @@ function k({
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
S,
|
|
52
|
+
L as s
|
|
53
53
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { InlineNotice as r, Text as n } from "@box/blueprint-web";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import '../styles/warning-message.css';const
|
|
4
|
-
welcomeMessage:
|
|
5
|
-
warnings:
|
|
2
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import '../styles/warning-message.css';const o = "_welcomeMessage_q7ymc_2", t = "_warnings_q7ymc_5", g = "_warningNotice_q7ymc_10", l = "_iconAvatar_q7ymc_13", m = {
|
|
4
|
+
welcomeMessage: o,
|
|
5
|
+
warnings: t,
|
|
6
6
|
warningNotice: g,
|
|
7
7
|
iconAvatar: l
|
|
8
|
-
},
|
|
8
|
+
}, v = ({
|
|
9
9
|
ariaLabel: s,
|
|
10
10
|
title: i,
|
|
11
11
|
description: a
|
|
12
|
-
}) => /* @__PURE__ */
|
|
13
|
-
className:
|
|
12
|
+
}) => /* @__PURE__ */ c(r, {
|
|
13
|
+
className: m.warningNotice,
|
|
14
14
|
variant: "warning",
|
|
15
15
|
variantIconAriaLabel: s,
|
|
16
16
|
children: [/* @__PURE__ */ e(n, {
|
|
@@ -24,6 +24,6 @@ import '../styles/warning-message.css';const t = "_welcomeMessage_4b90d_1", c =
|
|
|
24
24
|
})]
|
|
25
25
|
});
|
|
26
26
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
v as W,
|
|
28
|
+
m as s
|
|
29
29
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import i from "clsx";
|
|
2
|
-
import { injectInlineCitation as
|
|
2
|
+
import { injectInlineCitation as v } from "../../utils/inlineCitationsUtils.js";
|
|
3
3
|
import { markdownToHtmlString as k } from "../common/markdown.js";
|
|
4
4
|
import x from "../common/markdown-react.js";
|
|
5
|
-
import { jsxs as M, Fragment as
|
|
6
|
-
import '../../../../styles/answer-content.css';const
|
|
7
|
-
answerContent:
|
|
8
|
-
answerMarkdown:
|
|
5
|
+
import { jsxs as M, Fragment as u, jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import '../../../../styles/answer-content.css';const b = "_answerContent_1va9v_2", g = "_answerMarkdown_1va9v_17", n = {
|
|
7
|
+
answerContent: b,
|
|
8
|
+
answerMarkdown: g
|
|
9
9
|
}, I = ({
|
|
10
10
|
answer: t,
|
|
11
11
|
items: m,
|
|
@@ -19,7 +19,7 @@ import '../../../../styles/answer-content.css';const g = "_answerContent_uoab3_1
|
|
|
19
19
|
...s
|
|
20
20
|
}) => {
|
|
21
21
|
const a = f === "sidebar", _ = (h) => {
|
|
22
|
-
const d =
|
|
22
|
+
const d = v(h, {
|
|
23
23
|
items: m,
|
|
24
24
|
isCompleted: c,
|
|
25
25
|
isInlineCitationsEnabled: l
|
|
@@ -36,7 +36,7 @@ import '../../../../styles/answer-content.css';const g = "_answerContent_uoab3_1
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
-
return /* @__PURE__ */ M(
|
|
39
|
+
return /* @__PURE__ */ M(u, {
|
|
40
40
|
children: [!e && /* @__PURE__ */ r("div", {
|
|
41
41
|
className: i(n.answerContent, a && n.sidebar, "Answer-text", o),
|
|
42
42
|
...s,
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { Text as
|
|
1
|
+
import { Text as w } from "@box/blueprint-web";
|
|
2
2
|
import { AlertTriangle as X } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
-
import { Gray65 as Y, Size4 as
|
|
4
|
-
import
|
|
5
|
-
import { memo as Z, useState as $, useEffect as
|
|
6
|
-
import { useIntl as
|
|
3
|
+
import { Gray65 as Y, Size4 as I } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
+
import g from "clsx";
|
|
5
|
+
import { memo as Z, useState as $, useEffect as T } from "react";
|
|
6
|
+
import { useIntl as tt } from "react-intl";
|
|
7
7
|
import { A as s } from "../../../../chunks/types.js";
|
|
8
|
-
import { MediaContainer as
|
|
9
|
-
import { BoxAILoadingIndicator as
|
|
10
|
-
import { AnswerContent as
|
|
11
|
-
import { CopyButton as
|
|
12
|
-
import { EmbedTheAnswerButton 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
|
-
loadingText:
|
|
22
|
-
fadeIn:
|
|
23
|
-
alertIcon:
|
|
24
|
-
error:
|
|
25
|
-
footer:
|
|
26
|
-
copyButtonContainer:
|
|
27
|
-
feedbackButtonsContainer:
|
|
28
|
-
shouldHaveMarginTop:
|
|
29
|
-
shouldUseAnimation:
|
|
30
|
-
shouldAnimateHeight:
|
|
31
|
-
footerButtons:
|
|
32
|
-
iconAvatar:
|
|
33
|
-
embedTheAnswerButtonContainer:
|
|
34
|
-
buttonsVisible:
|
|
35
|
-
},
|
|
36
|
-
answer:
|
|
37
|
-
citations:
|
|
38
|
-
error:
|
|
8
|
+
import { MediaContainer as S } from "../common/media-container.js";
|
|
9
|
+
import { BoxAILoadingIndicator as nt } from "../thinkingBubble/boxAILoadingIndicator.js";
|
|
10
|
+
import { AnswerContent as ot } from "./answer-content.js";
|
|
11
|
+
import { CopyButton as et } from "./copy-button.js";
|
|
12
|
+
import { EmbedTheAnswerButton as st } from "./embed-the-answer-button.js";
|
|
13
|
+
import { InlineError as rt } from "./inline-error.js";
|
|
14
|
+
import _ 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_1miuw_2", ct = "_loadingContainer_1miuw_6", ut = "_loadingText_1miuw_13", mt = "_fadeIn_1miuw_1", dt = "_alertIcon_1miuw_22", _t = "_error_1miuw_25", ft = "_footer_1miuw_29", ht = "_copyButtonContainer_1miuw_35", Et = "_feedbackButtonsContainer_1miuw_36", Nt = "_shouldHaveMarginTop_1miuw_40", pt = "_shouldUseAnimation_1miuw_43", wt = "_shouldAnimateHeight_1miuw_47", It = "_footerButtons_1miuw_51", gt = "_iconAvatar_1miuw_57", Tt = "_embedTheAnswerButtonContainer_1miuw_72", St = "_buttonsVisible_1miuw_80", t = {
|
|
19
|
+
answer: lt,
|
|
20
|
+
loadingContainer: ct,
|
|
21
|
+
loadingText: ut,
|
|
22
|
+
fadeIn: mt,
|
|
23
|
+
alertIcon: dt,
|
|
24
|
+
error: _t,
|
|
25
|
+
footer: ft,
|
|
26
|
+
copyButtonContainer: ht,
|
|
27
|
+
feedbackButtonsContainer: Et,
|
|
28
|
+
shouldHaveMarginTop: Nt,
|
|
29
|
+
shouldUseAnimation: pt,
|
|
30
|
+
shouldAnimateHeight: wt,
|
|
31
|
+
footerButtons: It,
|
|
32
|
+
iconAvatar: gt,
|
|
33
|
+
embedTheAnswerButtonContainer: Tt,
|
|
34
|
+
buttonsVisible: St
|
|
35
|
+
}, Rt = /* @__PURE__ */ new Set([s.RATE_LIMITING, s.NO_CONTENT, s.PRECONDITION_FAILED, s.GENERAL, s.AGENT_NOT_FOUND]), jt = /* @__PURE__ */ Z(({
|
|
36
|
+
answer: o,
|
|
37
|
+
citations: R,
|
|
38
|
+
error: e,
|
|
39
39
|
contentType: O,
|
|
40
|
-
hostAppName:
|
|
40
|
+
hostAppName: u,
|
|
41
41
|
feedbackValue: b,
|
|
42
42
|
isCitationsEnabled: A = !1,
|
|
43
43
|
isCompleted: r = !1,
|
|
@@ -47,150 +47,150 @@ import '../../../../styles/answer.css';const cn = "_answer_1efjn_1", dn = "_load
|
|
|
47
47
|
isInlineCitationsEnabled: P = !1,
|
|
48
48
|
isInlineCitationV2Enabled: x,
|
|
49
49
|
isLoading: v = !1,
|
|
50
|
-
isMarkdownEnabled:
|
|
50
|
+
isMarkdownEnabled: M = !1,
|
|
51
51
|
items: l = [],
|
|
52
|
-
onAnswerCopy:
|
|
53
|
-
embedTheAnswerButtonConfig:
|
|
54
|
-
onCitationClick:
|
|
55
|
-
onFeedbackFormSubmit:
|
|
56
|
-
onFeedbackTooltipOpenChange:
|
|
57
|
-
prompt:
|
|
58
|
-
promptType:
|
|
52
|
+
onAnswerCopy: y,
|
|
53
|
+
embedTheAnswerButtonConfig: m,
|
|
54
|
+
onCitationClick: D,
|
|
55
|
+
onFeedbackFormSubmit: L,
|
|
56
|
+
onFeedbackTooltipOpenChange: F,
|
|
57
|
+
prompt: H,
|
|
58
|
+
promptType: U,
|
|
59
59
|
recordAction: a,
|
|
60
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
61
|
-
shouldFeedbackIncludePromptData:
|
|
62
|
-
useAnimation:
|
|
60
|
+
shouldFeedbackFormIncludeFeedbackText: k,
|
|
61
|
+
shouldFeedbackIncludePromptData: G,
|
|
62
|
+
useAnimation: V = !0,
|
|
63
63
|
variant: i = "modal",
|
|
64
|
-
isReactMarkdownEnabled:
|
|
64
|
+
isReactMarkdownEnabled: j,
|
|
65
65
|
setAnswerFeedback: z,
|
|
66
66
|
questionId: N
|
|
67
67
|
}) => {
|
|
68
|
-
const
|
|
69
|
-
formatMessage:
|
|
70
|
-
} =
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
const f = Rt.has(e), h = v && !o && !e, [W, q] = $(r), {
|
|
69
|
+
formatMessage: d
|
|
70
|
+
} = tt();
|
|
71
|
+
T(() => {
|
|
72
|
+
o && a && r && l.some((Q) => o.includes(Q.name)) && a({
|
|
73
73
|
action: "programmatic",
|
|
74
74
|
component: i,
|
|
75
75
|
feature: "answers",
|
|
76
76
|
target: "links_detected",
|
|
77
77
|
data: {
|
|
78
|
-
hostAppName:
|
|
78
|
+
hostAppName: u,
|
|
79
79
|
linkCount: l.length,
|
|
80
80
|
fileNameCount: l.length
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
}, [
|
|
83
|
+
}, [o, i, u, r, a, l]), T(() => {
|
|
84
84
|
setTimeout(() => q(r), 0);
|
|
85
85
|
}, [r]);
|
|
86
|
-
const p = () => /* @__PURE__ */
|
|
87
|
-
className:
|
|
86
|
+
const p = () => /* @__PURE__ */ n(X, {
|
|
87
|
+
className: t.alertIcon,
|
|
88
88
|
color: Y,
|
|
89
89
|
"data-testid": "content-answers-error-alert-icon",
|
|
90
|
-
height:
|
|
90
|
+
height: I,
|
|
91
91
|
role: "presentation",
|
|
92
|
-
width:
|
|
93
|
-
}), J = () => /* @__PURE__ */ c(
|
|
92
|
+
width: I
|
|
93
|
+
}), J = () => /* @__PURE__ */ c(w, {
|
|
94
94
|
as: "p",
|
|
95
|
-
className:
|
|
95
|
+
className: t.error,
|
|
96
96
|
color: "textOnLightSecondary",
|
|
97
97
|
"data-testid": "content-answers-error",
|
|
98
98
|
variant: "caption",
|
|
99
|
-
children: [
|
|
100
|
-
}), K = () =>
|
|
101
|
-
className:
|
|
102
|
-
[
|
|
99
|
+
children: [e === s.RESPONSE_INTERRUPTED && d(_.responseInterruptedError), e === s.RESPONSE_FAILED && d(_.responseFailedError), e === s.RESPONSE_STOPPED && d(_.responseStoppedError), e !== s.RESPONSE_STOPPED && p()]
|
|
100
|
+
}), K = () => e !== s.RESPONSE_STOPPED ? /* @__PURE__ */ c("div", {
|
|
101
|
+
className: g(t.footerButtons, "footer-buttons-container", {
|
|
102
|
+
[t.buttonsVisible]: E
|
|
103
103
|
}),
|
|
104
|
-
children: [B ? /* @__PURE__ */
|
|
105
|
-
className:
|
|
106
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: [B ? /* @__PURE__ */ n("div", {
|
|
105
|
+
className: t.feedbackButtonsContainer,
|
|
106
|
+
children: /* @__PURE__ */ n(it, {
|
|
107
107
|
feedbackValue: b,
|
|
108
|
-
hostAppName:
|
|
108
|
+
hostAppName: u,
|
|
109
109
|
isFeedbackFormEnabled: C,
|
|
110
110
|
isFeedbackTooltipOpen: E,
|
|
111
111
|
items: l,
|
|
112
|
-
onFeedbackFormSubmit:
|
|
113
|
-
onFeedbackTooltipOpenChange:
|
|
114
|
-
prompt:
|
|
115
|
-
promptType:
|
|
112
|
+
onFeedbackFormSubmit: L,
|
|
113
|
+
onFeedbackTooltipOpenChange: F,
|
|
114
|
+
prompt: H,
|
|
115
|
+
promptType: U,
|
|
116
116
|
questionId: N,
|
|
117
117
|
recordAction: a,
|
|
118
|
-
response:
|
|
118
|
+
response: o,
|
|
119
119
|
setAnswerFeedback: z,
|
|
120
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
121
|
-
shouldFeedbackIncludePromptData:
|
|
120
|
+
shouldFeedbackFormIncludeFeedbackText: k,
|
|
121
|
+
shouldFeedbackIncludePromptData: G,
|
|
122
122
|
variant: i
|
|
123
123
|
})
|
|
124
|
-
}) : null, /* @__PURE__ */
|
|
125
|
-
className:
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
answer:
|
|
128
|
-
onAnswerCopy:
|
|
124
|
+
}) : null, /* @__PURE__ */ n("div", {
|
|
125
|
+
className: t.copyButtonContainer,
|
|
126
|
+
children: /* @__PURE__ */ n(et, {
|
|
127
|
+
answer: o,
|
|
128
|
+
onAnswerCopy: y,
|
|
129
129
|
recordAction: a
|
|
130
130
|
})
|
|
131
131
|
})]
|
|
132
|
-
}) :
|
|
132
|
+
}) : o ? null : p();
|
|
133
133
|
return /* @__PURE__ */ c("div", {
|
|
134
134
|
"aria-live": "polite",
|
|
135
|
-
className:
|
|
135
|
+
className: t.answer,
|
|
136
136
|
"data-testid": "content-answers-answer",
|
|
137
137
|
children: [h && /* @__PURE__ */ c("div", {
|
|
138
|
-
className:
|
|
139
|
-
children: [/* @__PURE__ */
|
|
138
|
+
className: t.loadingContainer,
|
|
139
|
+
children: [/* @__PURE__ */ n(nt, {}), /* @__PURE__ */ n(w, {
|
|
140
140
|
as: "span",
|
|
141
|
-
className:
|
|
141
|
+
className: t.loadingText,
|
|
142
142
|
color: "textOnLightDefault",
|
|
143
143
|
variant: "titleMedium",
|
|
144
|
-
children: _
|
|
144
|
+
children: d(_.analyzingRequest)
|
|
145
145
|
})]
|
|
146
|
-
}), !
|
|
146
|
+
}), !f && !h && /* @__PURE__ */ n(S, {
|
|
147
147
|
className: "answer",
|
|
148
148
|
variant: i,
|
|
149
|
-
children: /* @__PURE__ */ c(
|
|
149
|
+
children: /* @__PURE__ */ c(S.Content, {
|
|
150
150
|
isUsedInsideSidebar: i === "sidebar",
|
|
151
151
|
variant: "answer",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
153
|
-
answer:
|
|
152
|
+
children: [/* @__PURE__ */ n(ot, {
|
|
153
|
+
answer: o,
|
|
154
154
|
isCompleted: r,
|
|
155
155
|
isInlineCitationsEnabled: P,
|
|
156
156
|
isInlineCitationV2Enabled: x,
|
|
157
|
-
isMarkdownEnabled:
|
|
158
|
-
isReactMarkdownEnabled:
|
|
157
|
+
isMarkdownEnabled: M,
|
|
158
|
+
isReactMarkdownEnabled: j,
|
|
159
159
|
items: l,
|
|
160
160
|
variant: i
|
|
161
161
|
}), r && /* @__PURE__ */ c("div", {
|
|
162
|
-
className:
|
|
163
|
-
[
|
|
164
|
-
[
|
|
165
|
-
[
|
|
162
|
+
className: g(t.footer, {
|
|
163
|
+
[t.shouldHaveMarginTop]: o,
|
|
164
|
+
[t.shouldAnimateHeight]: W,
|
|
165
|
+
[t.shouldUseAnimation]: V
|
|
166
166
|
}),
|
|
167
167
|
"data-testid": "content-answers-answer-footer",
|
|
168
|
-
children: [
|
|
169
|
-
citations:
|
|
170
|
-
onCitationClick:
|
|
168
|
+
children: [e && J(), A && !e && /* @__PURE__ */ n(at, {
|
|
169
|
+
citations: R,
|
|
170
|
+
onCitationClick: D,
|
|
171
171
|
recordAction: a
|
|
172
172
|
}), K()]
|
|
173
173
|
})]
|
|
174
174
|
})
|
|
175
|
-
}), !
|
|
176
|
-
className:
|
|
177
|
-
children: /* @__PURE__ */
|
|
178
|
-
answer:
|
|
179
|
-
embedTheAnswerButtonConfig:
|
|
180
|
-
hostAppName:
|
|
175
|
+
}), !f && !h && r && (m == null ? void 0 : m.onAction) && /* @__PURE__ */ n("div", {
|
|
176
|
+
className: t.embedTheAnswerButtonContainer,
|
|
177
|
+
children: /* @__PURE__ */ n(st, {
|
|
178
|
+
answer: o,
|
|
179
|
+
embedTheAnswerButtonConfig: m,
|
|
180
|
+
hostAppName: u,
|
|
181
181
|
questionId: N,
|
|
182
182
|
recordAction: a,
|
|
183
183
|
variant: i
|
|
184
184
|
})
|
|
185
|
-
}),
|
|
185
|
+
}), f && /* @__PURE__ */ n(rt, {
|
|
186
186
|
contentType: O,
|
|
187
|
-
error:
|
|
187
|
+
error: e,
|
|
188
188
|
recordAction: a,
|
|
189
189
|
variant: i
|
|
190
190
|
})]
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
193
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
jt as Answer,
|
|
195
|
+
jt as default
|
|
196
196
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { AlertTriangle as
|
|
3
|
-
import { TextTextDestructiveOnLight as
|
|
1
|
+
import { Text as _ } from "@box/blueprint-web";
|
|
2
|
+
import { AlertTriangle as N } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { TextTextDestructiveOnLight as x, Size4 as c } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
4
|
import * as m from "react";
|
|
5
|
-
import { useIntl as
|
|
5
|
+
import { useIntl as T } from "react-intl";
|
|
6
6
|
import { A as i } from "../../../../chunks/types.js";
|
|
7
|
-
import { LOGGER_BASE_CONFIG as
|
|
7
|
+
import { LOGGER_BASE_CONFIG as u } from "../common/constants.js";
|
|
8
8
|
import { MediaContainer as d } from "../common/media-container.js";
|
|
9
9
|
import e from "./messages.js";
|
|
10
|
-
import { jsx as t, jsxs as
|
|
11
|
-
import '../../../../styles/inline-error.css';const
|
|
12
|
-
inlineError:
|
|
13
|
-
text:
|
|
10
|
+
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
11
|
+
import '../../../../styles/inline-error.css';const p = "_inlineError_gzz3t_2", h = "_text_gzz3t_5", I = "_icon_gzz3t_11", s = {
|
|
12
|
+
inlineError: p,
|
|
13
|
+
text: h,
|
|
14
14
|
icon: I
|
|
15
|
-
},
|
|
15
|
+
}, b = ({
|
|
16
16
|
error: n,
|
|
17
17
|
contentType: a,
|
|
18
18
|
variant: l = "modal",
|
|
@@ -20,14 +20,14 @@ import '../../../../styles/inline-error.css';const h = "_inlineError_iulzu_1", g
|
|
|
20
20
|
}) => {
|
|
21
21
|
const E = l === "sidebar", {
|
|
22
22
|
formatMessage: r
|
|
23
|
-
} =
|
|
23
|
+
} = T();
|
|
24
24
|
m.useEffect(() => {
|
|
25
25
|
o && o({
|
|
26
|
-
...
|
|
26
|
+
...u,
|
|
27
27
|
target: "inlineError"
|
|
28
28
|
});
|
|
29
29
|
}, [o]);
|
|
30
|
-
const
|
|
30
|
+
const f = m.useCallback(() => {
|
|
31
31
|
switch (n) {
|
|
32
32
|
case i.RATE_LIMITING:
|
|
33
33
|
return r(e.inlineRateLimitingErrorText);
|
|
@@ -48,28 +48,28 @@ import '../../../../styles/inline-error.css';const h = "_inlineError_iulzu_1", g
|
|
|
48
48
|
"data-testid": "content-answers-inline-error",
|
|
49
49
|
children: /* @__PURE__ */ t(d, {
|
|
50
50
|
variant: l,
|
|
51
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ g(d.Content, {
|
|
52
52
|
isUsedInsideSidebar: E,
|
|
53
53
|
shouldAddCard: !1,
|
|
54
54
|
variant: "error",
|
|
55
55
|
children: [/* @__PURE__ */ t("div", {
|
|
56
56
|
className: s.icon,
|
|
57
|
-
children: /* @__PURE__ */ t(
|
|
58
|
-
color:
|
|
57
|
+
children: /* @__PURE__ */ t(N, {
|
|
58
|
+
color: x,
|
|
59
59
|
height: c,
|
|
60
60
|
role: "presentation",
|
|
61
61
|
width: c
|
|
62
62
|
})
|
|
63
|
-
}), /* @__PURE__ */ t(
|
|
63
|
+
}), /* @__PURE__ */ t(_, {
|
|
64
64
|
as: "p",
|
|
65
65
|
className: s.text,
|
|
66
|
-
children: n &&
|
|
66
|
+
children: n && f()
|
|
67
67
|
})]
|
|
68
68
|
})
|
|
69
69
|
})
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
b as InlineError,
|
|
74
|
+
b as default
|
|
75
75
|
};
|