@box/box-ai-content-answers 0.71.2 → 0.71.3
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/esm/lib/components/agents/agent-editor.js +21 -20
- package/esm/lib/components/answer/answer-content.js +8 -8
- package/esm/lib/components/answer/answer.js +43 -42
- package/esm/lib/components/answer/inline-error.js +16 -15
- package/esm/lib/components/answer/loading-element.js +18 -18
- package/esm/lib/components/common/media-container.js +22 -19
- package/esm/lib/components/content/content.js +46 -46
- package/esm/lib/components/footer/footer.js +50 -50
- package/esm/lib/components/question/question.js +46 -44
- package/esm/lib/components/suggested-questions/suggested-questions.js +29 -29
- package/esm/lib/components/suggested-questions/suggestions.js +15 -15
- package/esm/lib/components/welcome-message/welcome-message.js +34 -33
- package/package.json +2 -2
- package/styles/agent-editor.css +1 -1
- package/styles/answer-content.css +1 -1
- package/styles/answer.css +1 -1
- package/styles/content.css +1 -1
- package/styles/footer.css +1 -1
- package/styles/inline-error.css +1 -1
- package/styles/loading-element.css +1 -1
- package/styles/media-container.css +1 -1
- package/styles/question.css +1 -1
- package/styles/suggested-questions.css +1 -1
- package/styles/suggestions.css +1 -1
- package/styles/welcome-message.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../../styles/agent-editor.css";
|
|
2
|
-
import { TextArea as
|
|
2
|
+
import { TextArea as c } from "@box/blueprint-web";
|
|
3
3
|
import { useEffect as a, createRef as u } from "react";
|
|
4
4
|
import { useIntl as d } from "react-intl";
|
|
5
5
|
import { isDebugModeTrigger as l } from "../common/keyInputUtils.js";
|
|
@@ -7,49 +7,50 @@ import p from "../footer/messages.js";
|
|
|
7
7
|
import { useAgents as b, useAgentsDispatch as _ } from "../../contexts/AgentsContext.js";
|
|
8
8
|
import { LOGGER_BASE_CONFIG as h } from "../common/constants.js";
|
|
9
9
|
import { jsx as E } from "react/jsx-runtime";
|
|
10
|
-
const N = "
|
|
11
|
-
debug: N
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const N = "_debug_gfw1n_1", O = "_sidebar_gfw1n_9", R = {
|
|
11
|
+
debug: N,
|
|
12
|
+
sidebar: O
|
|
13
|
+
}, w = 25, T = ({
|
|
14
|
+
onAgentEditorToggle: n,
|
|
15
|
+
recordAction: o,
|
|
15
16
|
setIsDebugModeShown: i
|
|
16
17
|
}) => {
|
|
17
18
|
const {
|
|
18
19
|
formatMessage: r
|
|
19
20
|
} = d(), {
|
|
20
21
|
selectedAgent: t
|
|
21
|
-
} = b(),
|
|
22
|
+
} = b(), f = _(), e = /* @__PURE__ */ u();
|
|
22
23
|
a(() => {
|
|
23
24
|
if (e.current) {
|
|
24
|
-
const
|
|
25
|
-
e.current.value =
|
|
25
|
+
const s = JSON.stringify(t.config, null, 4);
|
|
26
|
+
e.current.value = s || "";
|
|
26
27
|
}
|
|
27
28
|
}, [e, t, r]), a(() => {
|
|
28
|
-
|
|
29
|
+
n && (n(t), o && o({
|
|
29
30
|
...h,
|
|
30
31
|
target: "debugMode"
|
|
31
32
|
}));
|
|
32
33
|
}, []);
|
|
33
|
-
const
|
|
34
|
-
|
|
34
|
+
const g = () => {
|
|
35
|
+
f({
|
|
35
36
|
type: "OVERRIDE_AGENT_CONFIG",
|
|
36
37
|
agentName: t.name,
|
|
37
38
|
agentConfig: JSON.parse(e.current.value)
|
|
38
39
|
});
|
|
39
|
-
},
|
|
40
|
-
l(
|
|
40
|
+
}, m = (s) => {
|
|
41
|
+
l(s) && i(!1);
|
|
41
42
|
};
|
|
42
|
-
return /* @__PURE__ */ E(
|
|
43
|
+
return /* @__PURE__ */ E(c, {
|
|
43
44
|
ref: e,
|
|
44
|
-
className:
|
|
45
|
+
className: R.debug,
|
|
45
46
|
"data-testid": "content-answers-debug",
|
|
46
47
|
hideLabel: !0,
|
|
47
48
|
label: r(p.askQuestionPlaceholder),
|
|
48
|
-
maxRows:
|
|
49
|
-
onChange:
|
|
50
|
-
onKeyDown:
|
|
49
|
+
maxRows: w,
|
|
50
|
+
onChange: g,
|
|
51
|
+
onKeyDown: m
|
|
51
52
|
});
|
|
52
53
|
};
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
T as AgentEditor
|
|
55
56
|
};
|
|
@@ -2,26 +2,26 @@ import "../../../../styles/answer-content.css";
|
|
|
2
2
|
import d from "clsx";
|
|
3
3
|
import l from "../common/markdown.js";
|
|
4
4
|
import { jsxs as w, Fragment as _, jsx as i } from "react/jsx-runtime";
|
|
5
|
-
const c = "
|
|
5
|
+
const c = "_answerContent_79stl_1", C = "_sidebar_79stl_13", x = "_answerMarkdown_79stl_16", e = {
|
|
6
6
|
answerContent: c,
|
|
7
7
|
sidebar: C,
|
|
8
8
|
answerMarkdown: x
|
|
9
9
|
}, u = ({
|
|
10
10
|
answer: n,
|
|
11
|
-
isMarkdownEnabled:
|
|
12
|
-
className:
|
|
11
|
+
isMarkdownEnabled: t,
|
|
12
|
+
className: r,
|
|
13
13
|
variant: m = "modal",
|
|
14
14
|
...s
|
|
15
15
|
}) => {
|
|
16
16
|
const o = m === "sidebar";
|
|
17
17
|
let a = n;
|
|
18
|
-
return
|
|
19
|
-
children: [!
|
|
20
|
-
className: d(e.answerContent, o && e.sidebar, "Answer-text",
|
|
18
|
+
return t && n && (a = l.render(n)), /* @__PURE__ */ w(_, {
|
|
19
|
+
children: [!t && /* @__PURE__ */ i("div", {
|
|
20
|
+
className: d(e.answerContent, o && e.sidebar, "Answer-text", r),
|
|
21
21
|
...s,
|
|
22
22
|
children: n
|
|
23
|
-
}),
|
|
24
|
-
className: d(e.answerContent, e.answerMarkdown, o && e.sidebar, "Answer-text",
|
|
23
|
+
}), t && /* @__PURE__ */ i("div", {
|
|
24
|
+
className: d(e.answerContent, e.answerMarkdown, o && e.sidebar, "Answer-text", r),
|
|
25
25
|
dangerouslySetInnerHTML: {
|
|
26
26
|
__html: a
|
|
27
27
|
},
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "../../../../styles/answer.css";
|
|
2
|
-
import { useBreakpoint as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import U from "
|
|
2
|
+
import { useBreakpoint as L, Breakpoint as M, Text as D } from "@box/blueprint-web";
|
|
3
|
+
import { AlertTriangle as F } from "@box/blueprint-web-assets/icons/Line";
|
|
4
|
+
import { BoxAiLogo as H } from "@box/blueprint-web-assets/icons/Logo";
|
|
5
|
+
import { Size5 as x, Size6 as U, Gray65 as k, Size4 as u } from "@box/blueprint-web-assets/tokens/tokens";
|
|
6
|
+
import y from "clsx";
|
|
6
7
|
import * as m from "react";
|
|
7
|
-
import { useIntl as
|
|
8
|
-
import { A as
|
|
8
|
+
import { useIntl as z } from "react-intl";
|
|
9
|
+
import { A as r } from "../../../../chunks/types.js";
|
|
9
10
|
import { MediaContainer as d } from "../common/media-container.js";
|
|
10
11
|
import { AnswerContent as B } from "./answer-content.js";
|
|
11
12
|
import { CopyButton as C } from "./copy-button.js";
|
|
@@ -13,8 +14,8 @@ import { InlineError as G } from "./inline-error.js";
|
|
|
13
14
|
import { LoadingElement as j } from "./loading-element.js";
|
|
14
15
|
import _ from "./messages.js";
|
|
15
16
|
import { References as W } from "./references.js";
|
|
16
|
-
import { jsxs as i, jsx as
|
|
17
|
-
const q = "
|
|
17
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
18
|
+
const q = "_answer_brr49_1", J = "_alertIcon_brr49_4", K = "_error_brr49_7", Q = "_footer_brr49_11", V = "_shouldHaveMarginTop_brr49_17", X = "_shouldUseAnimation_brr49_20", Y = "_shouldAnimateHeight_brr49_24", Z = "_iconAvatar_brr49_28", t = {
|
|
18
19
|
answer: q,
|
|
19
20
|
alertIcon: J,
|
|
20
21
|
error: K,
|
|
@@ -23,57 +24,57 @@ const q = "_answer_5bwzk_1", J = "_alertIcon_5bwzk_4", K = "_error_5bwzk_7", Q =
|
|
|
23
24
|
shouldUseAnimation: X,
|
|
24
25
|
shouldAnimateHeight: Y,
|
|
25
26
|
iconAvatar: Z
|
|
26
|
-
}, $ = /* @__PURE__ */ new Set([
|
|
27
|
+
}, $ = /* @__PURE__ */ new Set([r.RATE_LIMITING, r.NO_CONTENT, r.PRECONDITION_FAILED, r.GENERAL, r.AGENT_NOT_FOUND]), Se = /* @__PURE__ */ m.memo(({
|
|
27
28
|
answer: s,
|
|
28
29
|
citations: S,
|
|
29
30
|
error: e,
|
|
30
31
|
contentType: N,
|
|
31
32
|
isCitationsEnabled: A = !1,
|
|
32
33
|
isCompleted: a = !1,
|
|
33
|
-
isLoading:
|
|
34
|
-
isMarkdownEnabled:
|
|
35
|
-
onCitationClick:
|
|
34
|
+
isLoading: I = !1,
|
|
35
|
+
isMarkdownEnabled: T = !1,
|
|
36
|
+
onCitationClick: g,
|
|
36
37
|
onAnswerCopy: R,
|
|
37
38
|
recordAction: l,
|
|
38
|
-
useAnimation:
|
|
39
|
+
useAnimation: O = !0,
|
|
39
40
|
variant: n = "modal"
|
|
40
41
|
}) => {
|
|
41
|
-
const
|
|
42
|
+
const p = $.has(e), E = I && !s && !e, [P, w] = m.useState(a), {
|
|
42
43
|
formatMessage: c
|
|
43
|
-
} =
|
|
44
|
+
} = z(), h = L() === M.Small ? x : U;
|
|
44
45
|
m.useEffect(() => {
|
|
45
|
-
setTimeout(() =>
|
|
46
|
+
setTimeout(() => w(a), 0);
|
|
46
47
|
}, [a]);
|
|
47
|
-
const f = () => /* @__PURE__ */
|
|
48
|
-
className:
|
|
49
|
-
color:
|
|
48
|
+
const f = () => /* @__PURE__ */ o(F, {
|
|
49
|
+
className: t.alertIcon,
|
|
50
|
+
color: k,
|
|
50
51
|
"data-testid": "content-answers-error-alert-icon",
|
|
51
52
|
height: u,
|
|
52
53
|
role: "presentation",
|
|
53
54
|
width: u
|
|
54
|
-
}), b = () => /* @__PURE__ */ i(
|
|
55
|
+
}), b = () => /* @__PURE__ */ i(D, {
|
|
55
56
|
as: "p",
|
|
56
|
-
className:
|
|
57
|
+
className: t.error,
|
|
57
58
|
color: "textOnLightSecondary",
|
|
58
59
|
"data-testid": "content-answers-error",
|
|
59
60
|
variant: "caption",
|
|
60
|
-
children: [e ===
|
|
61
|
-
}),
|
|
61
|
+
children: [e === r.RESPONSE_INTERRUPTED && c(_.responseInterruptedError), e === r.RESPONSE_FAILED && c(_.responseFailedError), e === r.RESPONSE_STOPPED && c(_.responseStoppedError), e !== r.RESPONSE_STOPPED && f()]
|
|
62
|
+
}), v = () => e !== r.RESPONSE_STOPPED ? /* @__PURE__ */ o(C, {
|
|
62
63
|
answer: s,
|
|
63
64
|
onAnswerCopy: R,
|
|
64
65
|
recordAction: l
|
|
65
66
|
}) : s ? null : f();
|
|
66
67
|
return /* @__PURE__ */ i("div", {
|
|
67
68
|
"aria-live": "polite",
|
|
68
|
-
className:
|
|
69
|
+
className: t.answer,
|
|
69
70
|
"data-testid": "content-answers-answer",
|
|
70
|
-
children: [!
|
|
71
|
+
children: [!p && !E && /* @__PURE__ */ i(d, {
|
|
71
72
|
variant: n,
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ o(d.Figure, {
|
|
73
74
|
variant: n,
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
className:
|
|
76
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ o("div", {
|
|
76
|
+
className: t.iconAvatar,
|
|
77
|
+
children: /* @__PURE__ */ o(H, {
|
|
77
78
|
height: h,
|
|
78
79
|
role: "presentation",
|
|
79
80
|
width: h
|
|
@@ -82,35 +83,35 @@ const q = "_answer_5bwzk_1", J = "_alertIcon_5bwzk_4", K = "_error_5bwzk_7", Q =
|
|
|
82
83
|
}), /* @__PURE__ */ i(d.Content, {
|
|
83
84
|
isUsedInsideSidebar: n === "sidebar",
|
|
84
85
|
variant: "answer",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ o(B, {
|
|
86
87
|
answer: s,
|
|
87
|
-
isMarkdownEnabled:
|
|
88
|
+
isMarkdownEnabled: T,
|
|
88
89
|
variant: n
|
|
89
90
|
}), a && /* @__PURE__ */ i("div", {
|
|
90
|
-
className:
|
|
91
|
-
[
|
|
92
|
-
[
|
|
93
|
-
[
|
|
91
|
+
className: y(t.footer, {
|
|
92
|
+
[t.shouldHaveMarginTop]: s,
|
|
93
|
+
[t.shouldAnimateHeight]: P,
|
|
94
|
+
[t.shouldUseAnimation]: O
|
|
94
95
|
}),
|
|
95
96
|
"data-testid": "content-answers-answer-footer",
|
|
96
|
-
children: [e && b(), A && !e && /* @__PURE__ */
|
|
97
|
+
children: [e && b(), A && !e && /* @__PURE__ */ o(W, {
|
|
97
98
|
citations: S,
|
|
98
|
-
onCitationClick:
|
|
99
|
+
onCitationClick: g,
|
|
99
100
|
recordAction: l
|
|
100
|
-
}),
|
|
101
|
+
}), v()]
|
|
101
102
|
})]
|
|
102
103
|
})]
|
|
103
|
-
}),
|
|
104
|
+
}), p && /* @__PURE__ */ o(G, {
|
|
104
105
|
contentType: N,
|
|
105
106
|
error: e,
|
|
106
107
|
recordAction: l,
|
|
107
108
|
variant: n
|
|
108
|
-
}),
|
|
109
|
+
}), E && /* @__PURE__ */ o(j, {
|
|
109
110
|
variant: n
|
|
110
111
|
})]
|
|
111
112
|
});
|
|
112
113
|
});
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
Se as Answer,
|
|
116
|
+
Se as default
|
|
116
117
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import "../../../../styles/inline-error.css";
|
|
2
2
|
import { useBreakpoint as N, Breakpoint as h, Text as u } from "@box/blueprint-web";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { AlertTriangle as x } from "@box/blueprint-web-assets/icons/Line";
|
|
4
|
+
import { BoxAiLogo as g } from "@box/blueprint-web-assets/icons/Logo";
|
|
5
|
+
import { Size5 as s, Size6 as S } from "@box/blueprint-web-assets/tokens/tokens";
|
|
6
|
+
import * as p from "react";
|
|
7
|
+
import { useIntl as T } from "react-intl";
|
|
7
8
|
import { A as t } from "../../../../chunks/types.js";
|
|
8
9
|
import { LOGGER_BASE_CONFIG as A } from "../common/constants.js";
|
|
9
10
|
import { MediaContainer as l } from "../common/media-container.js";
|
|
10
11
|
import i from "./messages.js";
|
|
11
12
|
import { jsx as r, jsxs as _ } from "react/jsx-runtime";
|
|
12
|
-
const v = "
|
|
13
|
+
const v = "_inlineError_4osra_1", I = "_text_4osra_4", O = "_icon_4osra_14", R = "_iconAvatar_4osra_18", n = {
|
|
13
14
|
inlineError: v,
|
|
14
15
|
text: I,
|
|
15
16
|
icon: O,
|
|
16
17
|
iconAvatar: R
|
|
17
|
-
},
|
|
18
|
+
}, j = ({
|
|
18
19
|
error: o,
|
|
19
20
|
contentType: c,
|
|
20
21
|
variant: d = "modal",
|
|
@@ -22,14 +23,14 @@ const v = "_inlineError_ft07o_1", I = "_text_ft07o_4", O = "_icon_ft07o_14", R =
|
|
|
22
23
|
}) => {
|
|
23
24
|
const m = d === "sidebar", {
|
|
24
25
|
formatMessage: e
|
|
25
|
-
} =
|
|
26
|
-
|
|
26
|
+
} = T();
|
|
27
|
+
p.useEffect(() => {
|
|
27
28
|
a && a({
|
|
28
29
|
...A,
|
|
29
30
|
target: "inlineError"
|
|
30
31
|
});
|
|
31
32
|
}, [a]);
|
|
32
|
-
const
|
|
33
|
+
const f = p.useCallback(() => {
|
|
33
34
|
switch (o) {
|
|
34
35
|
case t.RATE_LIMITING:
|
|
35
36
|
return e(i.inlineRateLimitingErrorText);
|
|
@@ -44,7 +45,7 @@ const v = "_inlineError_ft07o_1", I = "_text_ft07o_4", O = "_icon_ft07o_14", R =
|
|
|
44
45
|
default:
|
|
45
46
|
return e(i.inlineErrorText);
|
|
46
47
|
}
|
|
47
|
-
}, [c, o, e]), E = N() === h.Small ? s :
|
|
48
|
+
}, [c, o, e]), E = N() === h.Small ? s : S;
|
|
48
49
|
return /* @__PURE__ */ r("div", {
|
|
49
50
|
className: n.inlineError,
|
|
50
51
|
"data-testid": "content-answers-inline-error",
|
|
@@ -55,7 +56,7 @@ const v = "_inlineError_ft07o_1", I = "_text_ft07o_4", O = "_icon_ft07o_14", R =
|
|
|
55
56
|
variant: "center-aligned",
|
|
56
57
|
children: /* @__PURE__ */ r("div", {
|
|
57
58
|
className: n.iconAvatar,
|
|
58
|
-
children: /* @__PURE__ */ r(
|
|
59
|
+
children: /* @__PURE__ */ r(g, {
|
|
59
60
|
height: E,
|
|
60
61
|
role: "presentation",
|
|
61
62
|
width: E
|
|
@@ -67,7 +68,7 @@ const v = "_inlineError_ft07o_1", I = "_text_ft07o_4", O = "_icon_ft07o_14", R =
|
|
|
67
68
|
variant: "error",
|
|
68
69
|
children: [/* @__PURE__ */ r("div", {
|
|
69
70
|
className: n.icon,
|
|
70
|
-
children: /* @__PURE__ */ r(
|
|
71
|
+
children: /* @__PURE__ */ r(x, {
|
|
71
72
|
height: s,
|
|
72
73
|
role: "presentation",
|
|
73
74
|
width: s
|
|
@@ -75,13 +76,13 @@ const v = "_inlineError_ft07o_1", I = "_text_ft07o_4", O = "_icon_ft07o_14", R =
|
|
|
75
76
|
}), /* @__PURE__ */ r(u, {
|
|
76
77
|
as: "p",
|
|
77
78
|
className: n.text,
|
|
78
|
-
children: o &&
|
|
79
|
+
children: o && f()
|
|
79
80
|
})]
|
|
80
81
|
})]
|
|
81
82
|
})
|
|
82
83
|
});
|
|
83
84
|
};
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
j as InlineError,
|
|
87
|
+
j as default
|
|
87
88
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import "../../../../styles/loading-element.css";
|
|
2
|
-
import { useBreakpoint as
|
|
3
|
-
import {
|
|
2
|
+
import { useBreakpoint as r, Breakpoint as s, LoadingIndicator as d } from "@box/blueprint-web";
|
|
3
|
+
import { BoxAiLogo as l } from "@box/blueprint-web-assets/icons/Logo";
|
|
4
4
|
import { Size5 as c, Size6 as m } from "@box/blueprint-web-assets/tokens/tokens";
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { MediaContainer as
|
|
7
|
-
import
|
|
5
|
+
import { useIntl as g } from "react-intl";
|
|
6
|
+
import { MediaContainer as o } from "../common/media-container.js";
|
|
7
|
+
import p from "./messages.js";
|
|
8
8
|
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
9
|
-
const f = "
|
|
9
|
+
const f = "_loadingElement_ts52l_1", _ = "_loadingIndicator_ts52l_1", h = "_iconAvatar_ts52l_5", n = {
|
|
10
10
|
loadingElement: f,
|
|
11
11
|
loadingIndicator: _,
|
|
12
12
|
iconAvatar: h
|
|
13
|
-
},
|
|
13
|
+
}, B = ({
|
|
14
14
|
variant: e = "modal"
|
|
15
15
|
}) => {
|
|
16
16
|
const {
|
|
17
|
-
formatMessage:
|
|
18
|
-
} =
|
|
17
|
+
formatMessage: t
|
|
18
|
+
} = g(), a = r() === s.Small ? c : m;
|
|
19
19
|
return /* @__PURE__ */ i("div", {
|
|
20
|
-
className:
|
|
21
|
-
children: /* @__PURE__ */ S(
|
|
20
|
+
className: n.loadingElement,
|
|
21
|
+
children: /* @__PURE__ */ S(o, {
|
|
22
22
|
variant: e,
|
|
23
|
-
children: [/* @__PURE__ */ i(
|
|
23
|
+
children: [/* @__PURE__ */ i(o.Figure, {
|
|
24
24
|
isUsedInsideSidebar: e === "sidebar",
|
|
25
25
|
children: /* @__PURE__ */ i("div", {
|
|
26
|
-
className:
|
|
26
|
+
className: n.iconAvatar,
|
|
27
27
|
children: /* @__PURE__ */ i(l, {
|
|
28
28
|
height: a,
|
|
29
29
|
role: "presentation",
|
|
30
30
|
width: a
|
|
31
31
|
})
|
|
32
32
|
})
|
|
33
|
-
}), /* @__PURE__ */ i(
|
|
33
|
+
}), /* @__PURE__ */ i(o.Content, {
|
|
34
34
|
isUsedInsideSidebar: e === "sidebar",
|
|
35
35
|
variant: "answer",
|
|
36
36
|
children: /* @__PURE__ */ i(d, {
|
|
37
|
-
"aria-label":
|
|
38
|
-
className:
|
|
37
|
+
"aria-label": t(p.loadingAnswer),
|
|
38
|
+
className: n.loadingIndicator,
|
|
39
39
|
"data-testid": "content-answers-loading-indicator"
|
|
40
40
|
})
|
|
41
41
|
})]
|
|
@@ -43,6 +43,6 @@ const f = "_loadingElement_1pjir_1", _ = "_loadingIndicator_1pjir_1", h = "_icon
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
B as LoadingElement,
|
|
47
|
+
B as default
|
|
48
48
|
};
|
|
@@ -1,47 +1,50 @@
|
|
|
1
1
|
import "../../../../styles/media-container.css";
|
|
2
2
|
import { Card as d } from "@box/blueprint-web";
|
|
3
|
-
import
|
|
3
|
+
import s from "clsx";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
const _ = "
|
|
5
|
+
const _ = "_mediaContainer_8h14q_1", c = "_sidebar_8h14q_7", m = "_question_8h14q_12", l = "_figure_8h14q_16", q = "_contentCard_8h14q_23", g = "_body_8h14q_26", u = "_answer_8h14q_32", C = "_welcomeMessage_8h14q_35", b = "_error_8h14q_41", e = {
|
|
6
6
|
mediaContainer: _,
|
|
7
7
|
sidebar: c,
|
|
8
8
|
question: m,
|
|
9
|
-
|
|
9
|
+
figure: l,
|
|
10
|
+
contentCard: q,
|
|
11
|
+
body: g,
|
|
10
12
|
answer: u,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"center-aligned": "_center-
|
|
14
|
-
"top-aligned": "_top-
|
|
15
|
-
},
|
|
13
|
+
welcomeMessage: C,
|
|
14
|
+
error: b,
|
|
15
|
+
"center-aligned": "_center-aligned_8h14q_67",
|
|
16
|
+
"top-aligned": "_top-aligned_8h14q_74"
|
|
17
|
+
}, h = ({
|
|
16
18
|
children: r,
|
|
17
19
|
className: a,
|
|
18
20
|
variant: n = "modal"
|
|
19
21
|
}) => /* @__PURE__ */ t("div", {
|
|
20
|
-
className:
|
|
22
|
+
className: s(e.mediaContainer, e[a], n === "sidebar" && e.sidebar),
|
|
21
23
|
"data-testid": "content-answers-grid-card",
|
|
22
24
|
children: r
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
+
}), o = h;
|
|
26
|
+
o.Figure = ({
|
|
25
27
|
children: r,
|
|
26
28
|
isUsedInsideSidebar: a = !1,
|
|
27
29
|
variant: n
|
|
28
30
|
}) => /* @__PURE__ */ t("div", {
|
|
29
|
-
className:
|
|
31
|
+
className: s(e.figure, e[n], a && e.sidebar),
|
|
30
32
|
children: r
|
|
31
33
|
});
|
|
32
|
-
|
|
34
|
+
o.Content = ({
|
|
33
35
|
children: r,
|
|
34
36
|
isUsedInsideSidebar: a = !1,
|
|
35
37
|
variant: n,
|
|
36
|
-
shouldAddCard:
|
|
38
|
+
shouldAddCard: i = !0
|
|
37
39
|
}) => /* @__PURE__ */ t("div", {
|
|
38
|
-
className:
|
|
39
|
-
children:
|
|
40
|
+
className: s(e.body, e[n], a && e.sidebar),
|
|
41
|
+
children: i ? /* @__PURE__ */ t(d, {
|
|
42
|
+
className: e.contentCard,
|
|
40
43
|
children: r
|
|
41
44
|
}) : r
|
|
42
45
|
});
|
|
43
46
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
o as MediaContainer,
|
|
48
|
+
h as MediaContainerBase,
|
|
49
|
+
o as default
|
|
47
50
|
};
|
|
@@ -6,14 +6,14 @@ import { useIntl as H } from "react-intl";
|
|
|
6
6
|
import O from "../../messages.js";
|
|
7
7
|
import { Chat as T } from "../chat/chat.js";
|
|
8
8
|
import { ModalError as V } from "../modal-error/modal-error.js";
|
|
9
|
-
import { jsx as
|
|
10
|
-
const S = "
|
|
9
|
+
import { jsx as n, jsxs as B, Fragment as F } from "react/jsx-runtime";
|
|
10
|
+
const S = "_loadingIndicatorWrapper_n9px6_1", A = "_content_n9px6_5", D = "_sidebar_n9px6_12", G = "_isLoading_n9px6_15", J = "_messagesEnd_n9px6_19", K = "_innerContent_n9px6_23", t = {
|
|
11
11
|
loadingIndicatorWrapper: S,
|
|
12
12
|
content: A,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
sidebar: D,
|
|
14
|
+
isLoading: G,
|
|
15
|
+
messagesEnd: J,
|
|
16
|
+
innerContent: K
|
|
17
17
|
}, ee = ({
|
|
18
18
|
error: _,
|
|
19
19
|
hasCustomSuggestedQuestions: g,
|
|
@@ -21,26 +21,26 @@ const S = "_loadingIndicatorWrapper_u70wz_1", A = "_content_u70wz_5", D = "_isLo
|
|
|
21
21
|
isErrorMessageShown: b = !1,
|
|
22
22
|
isStreamingEnabled: i = !1,
|
|
23
23
|
setIsErrorMessageShown: h,
|
|
24
|
-
onModalClose:
|
|
25
|
-
questions:
|
|
26
|
-
recordAction:
|
|
24
|
+
onModalClose: x,
|
|
25
|
+
questions: C,
|
|
26
|
+
recordAction: u,
|
|
27
27
|
showLoadingIndicator: m = !1,
|
|
28
|
-
userInfo:
|
|
29
|
-
suggestedQuestions:
|
|
30
|
-
askSuggestedQuestion:
|
|
31
|
-
setAskSuggestedQuestion:
|
|
32
|
-
useAnimation:
|
|
28
|
+
userInfo: v,
|
|
29
|
+
suggestedQuestions: E,
|
|
30
|
+
askSuggestedQuestion: R,
|
|
31
|
+
setAskSuggestedQuestion: I,
|
|
32
|
+
useAnimation: L,
|
|
33
33
|
variant: p = "modal",
|
|
34
|
-
...
|
|
34
|
+
...N
|
|
35
35
|
}) => {
|
|
36
|
-
const
|
|
37
|
-
formatMessage:
|
|
36
|
+
const f = e.useRef(null), l = e.useRef(null), d = e.useRef(null), c = e.useRef(!0), {
|
|
37
|
+
formatMessage: w
|
|
38
38
|
} = H(), r = e.useCallback((o) => {
|
|
39
39
|
d.current && d.current.scrollIntoView && l.current && (!i || c.current) && d.current.scrollIntoView({
|
|
40
40
|
behavior: o,
|
|
41
41
|
block: "nearest"
|
|
42
42
|
});
|
|
43
|
-
}, [i]),
|
|
43
|
+
}, [i]), W = () => {
|
|
44
44
|
if (l.current) {
|
|
45
45
|
const {
|
|
46
46
|
scrollTop: o,
|
|
@@ -59,55 +59,55 @@ const S = "_loadingIndicatorWrapper_u70wz_1", A = "_content_u70wz_5", D = "_isLo
|
|
|
59
59
|
}, [r, a]), e.useEffect(() => {
|
|
60
60
|
c.current = !0, r("instant");
|
|
61
61
|
}, [r]), e.useLayoutEffect(() => {
|
|
62
|
-
if (!
|
|
62
|
+
if (!f.current)
|
|
63
63
|
return;
|
|
64
64
|
const o = new ResizeObserver(() => {
|
|
65
65
|
r(i ? "instant" : "smooth");
|
|
66
|
-
}), s =
|
|
66
|
+
}), s = f.current;
|
|
67
67
|
return s && o.observe(s), () => {
|
|
68
68
|
s && o.unobserve(s);
|
|
69
69
|
};
|
|
70
70
|
}, [r, i]);
|
|
71
|
-
const
|
|
71
|
+
const z = () => b ? /* @__PURE__ */ n(V, {
|
|
72
72
|
clearError: () => h(!1),
|
|
73
73
|
error: _,
|
|
74
|
-
onModalClose:
|
|
75
|
-
recordAction:
|
|
76
|
-
}) : m ? /* @__PURE__ */
|
|
77
|
-
className:
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
"aria-label":
|
|
80
|
-
className:
|
|
74
|
+
onModalClose: x,
|
|
75
|
+
recordAction: u
|
|
76
|
+
}) : m ? /* @__PURE__ */ n("div", {
|
|
77
|
+
className: t.loadingIndicatorWrapper,
|
|
78
|
+
children: /* @__PURE__ */ n(k, {
|
|
79
|
+
"aria-label": w(O.loading),
|
|
80
|
+
className: t.loadingIndicator,
|
|
81
81
|
"data-testid": "content-answers-modal-loading-indicator",
|
|
82
82
|
size: "large"
|
|
83
83
|
})
|
|
84
84
|
}) : /* @__PURE__ */ B(F, {
|
|
85
|
-
children: [/* @__PURE__ */
|
|
86
|
-
askSuggestedQuestion:
|
|
85
|
+
children: [/* @__PURE__ */ n(T, {
|
|
86
|
+
askSuggestedQuestion: R,
|
|
87
87
|
hasCustomSuggestedQuestions: g,
|
|
88
88
|
hasRequestInProgress: a,
|
|
89
|
-
questions:
|
|
90
|
-
recordAction:
|
|
91
|
-
setAskSuggestedQuestion:
|
|
92
|
-
suggestedQuestions:
|
|
93
|
-
useAnimation:
|
|
94
|
-
userInfo:
|
|
89
|
+
questions: C,
|
|
90
|
+
recordAction: u,
|
|
91
|
+
setAskSuggestedQuestion: I,
|
|
92
|
+
suggestedQuestions: E,
|
|
93
|
+
useAnimation: L,
|
|
94
|
+
userInfo: v,
|
|
95
95
|
variant: p,
|
|
96
|
-
...
|
|
97
|
-
}), /* @__PURE__ */
|
|
96
|
+
...N
|
|
97
|
+
}), /* @__PURE__ */ n("div", {
|
|
98
98
|
ref: d,
|
|
99
|
-
className:
|
|
99
|
+
className: t.messagesEnd
|
|
100
100
|
})]
|
|
101
101
|
});
|
|
102
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ n("div", {
|
|
103
103
|
ref: l,
|
|
104
|
-
className: y(
|
|
104
|
+
className: y(t.content, p === "sidebar" && t.sidebar, m && t.isLoading),
|
|
105
105
|
"data-testid": "content-answers-content",
|
|
106
|
-
onScroll:
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
ref:
|
|
109
|
-
className:
|
|
110
|
-
children:
|
|
106
|
+
onScroll: W,
|
|
107
|
+
children: /* @__PURE__ */ n("div", {
|
|
108
|
+
ref: f,
|
|
109
|
+
className: t.innerContent,
|
|
110
|
+
children: z()
|
|
111
111
|
})
|
|
112
112
|
});
|
|
113
113
|
};
|