@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,35 +1,35 @@
|
|
|
1
1
|
import { Text as w } from "@box/blueprint-web";
|
|
2
2
|
import { BoxAiLogo as L } from "@box/blueprint-web-assets/icons/Logo";
|
|
3
|
-
import { Size10 as
|
|
3
|
+
import { Size10 as x } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
4
|
import P from "clsx";
|
|
5
5
|
import * as S from "react";
|
|
6
6
|
import { useIntl as ee } from "react-intl";
|
|
7
7
|
import { Answer as te } from "../answer/answer.js";
|
|
8
8
|
import { MediaContainer as oe } from "../common/media-container.js";
|
|
9
9
|
import { Question as ae } from "../question/question.js";
|
|
10
|
-
import { SuggestedQuestions as
|
|
11
|
-
import { ThinkingBubble as
|
|
12
|
-
import
|
|
10
|
+
import { SuggestedQuestions as ie } from "../suggested-questions/suggested-questions.js";
|
|
11
|
+
import { ThinkingBubble as re } from "../thinkingBubble/thinkingBubble.js";
|
|
12
|
+
import se from "../welcome-message/messages.js";
|
|
13
13
|
import { WelcomeMessage as ne } from "../welcome-message/welcome-message.js";
|
|
14
14
|
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
15
|
-
import '../../../../styles/chat.css';const ce = "
|
|
15
|
+
import '../../../../styles/chat.css';const ce = "_chat_1dqxr_2", le = "_clearChatText_1dqxr_2", me = "_landingPage_1dqxr_8", de = "_askQuestionText_1dqxr_16", pe = "_iconAvatar_1dqxr_24", xe = "_sidebar_1dqxr_40", a = {
|
|
16
16
|
chat: ce,
|
|
17
17
|
clearChatText: le,
|
|
18
18
|
landingPage: me,
|
|
19
|
-
askQuestionText:
|
|
20
|
-
iconAvatar:
|
|
21
|
-
sidebar:
|
|
19
|
+
askQuestionText: de,
|
|
20
|
+
iconAvatar: pe,
|
|
21
|
+
sidebar: xe
|
|
22
22
|
}, Ne = ({
|
|
23
23
|
askSuggestedQuestion: _,
|
|
24
24
|
contentType: n,
|
|
25
25
|
hasCustomSuggestedQuestions: h,
|
|
26
26
|
hasRequestInProgress: T,
|
|
27
|
-
isCitationsEnabled:
|
|
28
|
-
isFeedbackEnabled:
|
|
29
|
-
isFeedbackFormEnabled:
|
|
30
|
-
isInlineCitationsEnabled:
|
|
31
|
-
isInlineCitationV2Enabled:
|
|
32
|
-
isMarkdownEnabled:
|
|
27
|
+
isCitationsEnabled: b,
|
|
28
|
+
isFeedbackEnabled: C,
|
|
29
|
+
isFeedbackFormEnabled: g,
|
|
30
|
+
isInlineCitationsEnabled: k = !1,
|
|
31
|
+
isInlineCitationV2Enabled: u,
|
|
32
|
+
isMarkdownEnabled: q,
|
|
33
33
|
isSessionLoading: F = !1,
|
|
34
34
|
onCitationClick: A,
|
|
35
35
|
onAnswerCopy: I,
|
|
@@ -44,19 +44,19 @@ import '../../../../styles/chat.css';const ce = "_chat_azszb_1", le = "_clearCha
|
|
|
44
44
|
suggestedQuestions: m,
|
|
45
45
|
suggestedQuestionsRequestState: B,
|
|
46
46
|
shouldFeedbackFormIncludeFeedbackText: M,
|
|
47
|
-
shouldFeedbackIncludePromptData:
|
|
47
|
+
shouldFeedbackIncludePromptData: z,
|
|
48
48
|
shouldShowLandingPage: o,
|
|
49
49
|
useAnimation: R,
|
|
50
50
|
variant: t = "modal",
|
|
51
51
|
hostAppName: W = "",
|
|
52
52
|
isReactMarkdownEnabled: D,
|
|
53
53
|
welcomeMessageClearText: E,
|
|
54
|
-
...
|
|
54
|
+
...d
|
|
55
55
|
}) => {
|
|
56
56
|
const {
|
|
57
57
|
formatMessage: G
|
|
58
|
-
} = ee(), [H, J] = S.useState(null), K = (
|
|
59
|
-
J(
|
|
58
|
+
} = ee(), [H, J] = S.useState(null), K = (i, r) => {
|
|
59
|
+
J(i ? r : null);
|
|
60
60
|
};
|
|
61
61
|
return /* @__PURE__ */ e("div", {
|
|
62
62
|
className: a.chat,
|
|
@@ -71,17 +71,17 @@ import '../../../../styles/chat.css';const ce = "_chat_azszb_1", le = "_clearCha
|
|
|
71
71
|
children: /* @__PURE__ */ e("div", {
|
|
72
72
|
className: a.iconAvatar,
|
|
73
73
|
children: /* @__PURE__ */ e(L, {
|
|
74
|
-
height:
|
|
74
|
+
height: x,
|
|
75
75
|
role: "presentation",
|
|
76
|
-
width:
|
|
76
|
+
width: x
|
|
77
77
|
})
|
|
78
78
|
})
|
|
79
79
|
}), /* @__PURE__ */ e(ne, {
|
|
80
80
|
contentType: "",
|
|
81
81
|
shouldShowLandingPage: o,
|
|
82
|
-
...
|
|
82
|
+
...d,
|
|
83
83
|
variant: t
|
|
84
|
-
}), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(
|
|
84
|
+
}), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(ie, {
|
|
85
85
|
askSuggestedQuestion: _,
|
|
86
86
|
hasCustomSuggestedQuestions: h,
|
|
87
87
|
isLoading: T,
|
|
@@ -94,64 +94,64 @@ import '../../../../styles/chat.css';const ce = "_chat_azszb_1", le = "_clearCha
|
|
|
94
94
|
}), /* @__PURE__ */ e(w, {
|
|
95
95
|
as: "p",
|
|
96
96
|
className: a.clearChatText,
|
|
97
|
-
children: E || G(
|
|
97
|
+
children: E || G(se.welcomeClearChatText, {
|
|
98
98
|
type: n
|
|
99
99
|
})
|
|
100
100
|
}), !o && /* @__PURE__ */ e("ul", {
|
|
101
101
|
children: j.map(({
|
|
102
|
-
answer:
|
|
103
|
-
thinkingAnswer:
|
|
102
|
+
answer: i,
|
|
103
|
+
thinkingAnswer: r,
|
|
104
104
|
citations: U,
|
|
105
|
-
id:
|
|
105
|
+
id: s,
|
|
106
106
|
isCompleted: V,
|
|
107
107
|
isLoading: X,
|
|
108
108
|
error: Y,
|
|
109
|
-
prompt:
|
|
109
|
+
prompt: p,
|
|
110
110
|
promptType: Z,
|
|
111
111
|
feedbackValue: $
|
|
112
112
|
}) => /* @__PURE__ */ f("li", {
|
|
113
113
|
children: [/* @__PURE__ */ e(ae, {
|
|
114
|
-
prompt:
|
|
114
|
+
prompt: p,
|
|
115
115
|
variant: t
|
|
116
|
-
}),
|
|
117
|
-
content:
|
|
118
|
-
isThinkingComplete: !!
|
|
116
|
+
}), r && /* @__PURE__ */ e(re, {
|
|
117
|
+
content: r,
|
|
118
|
+
isThinkingComplete: !!i,
|
|
119
119
|
onDropdownOpenChange: v,
|
|
120
120
|
variant: t
|
|
121
121
|
}), /* @__PURE__ */ e(te, {
|
|
122
|
-
answer:
|
|
122
|
+
answer: i,
|
|
123
123
|
citations: U,
|
|
124
124
|
contentType: n,
|
|
125
125
|
embedTheAnswerButtonConfig: N,
|
|
126
126
|
error: Y,
|
|
127
127
|
feedbackValue: $,
|
|
128
128
|
hostAppName: W,
|
|
129
|
-
isCitationsEnabled:
|
|
129
|
+
isCitationsEnabled: b,
|
|
130
130
|
isCompleted: V,
|
|
131
|
-
isFeedbackEnabled:
|
|
132
|
-
isFeedbackFormEnabled:
|
|
133
|
-
isFeedbackTooltipOpen: H ===
|
|
134
|
-
isInlineCitationsEnabled:
|
|
135
|
-
isInlineCitationV2Enabled:
|
|
131
|
+
isFeedbackEnabled: C,
|
|
132
|
+
isFeedbackFormEnabled: g,
|
|
133
|
+
isFeedbackTooltipOpen: H === s,
|
|
134
|
+
isInlineCitationsEnabled: k,
|
|
135
|
+
isInlineCitationV2Enabled: u,
|
|
136
136
|
isLoading: X || F,
|
|
137
|
-
isMarkdownEnabled:
|
|
137
|
+
isMarkdownEnabled: q,
|
|
138
138
|
isReactMarkdownEnabled: D,
|
|
139
|
-
items:
|
|
139
|
+
items: d.items,
|
|
140
140
|
onAnswerCopy: I,
|
|
141
141
|
onCitationClick: A,
|
|
142
142
|
onFeedbackFormSubmit: O,
|
|
143
143
|
onFeedbackTooltipOpenChange: K,
|
|
144
|
-
prompt:
|
|
144
|
+
prompt: p,
|
|
145
145
|
promptType: Z,
|
|
146
|
-
questionId:
|
|
146
|
+
questionId: s,
|
|
147
147
|
recordAction: c,
|
|
148
148
|
setAnswerFeedback: y,
|
|
149
149
|
shouldFeedbackFormIncludeFeedbackText: M,
|
|
150
|
-
shouldFeedbackIncludePromptData:
|
|
150
|
+
shouldFeedbackIncludePromptData: z,
|
|
151
151
|
useAnimation: R,
|
|
152
152
|
variant: t
|
|
153
153
|
})]
|
|
154
|
-
},
|
|
154
|
+
}, s))
|
|
155
155
|
})]
|
|
156
156
|
})
|
|
157
157
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Card as
|
|
2
|
-
import
|
|
3
|
-
import { jsx as
|
|
4
|
-
import '../../../../styles/media-container.css';const _ = "
|
|
1
|
+
import { Card as i } from "@box/blueprint-web";
|
|
2
|
+
import s from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import '../../../../styles/media-container.css';const _ = "_mediaContainer_1od65_2", c = "_figure_1od65_8", m = "_sidebar_1od65_15", l = "_welcomeMessage_1od65_34", g = "_contentCard_1od65_38", u = "_question_1od65_43", C = "_answer_1od65_65", b = "_body_1od65_69", f = "_error_1od65_103", e = {
|
|
5
5
|
mediaContainer: _,
|
|
6
6
|
figure: c,
|
|
7
7
|
sidebar: m,
|
|
8
|
-
"center-aligned": "_center-
|
|
9
|
-
"top-aligned": "_top-
|
|
8
|
+
"center-aligned": "_center-aligned_1od65_18",
|
|
9
|
+
"top-aligned": "_top-aligned_1od65_25",
|
|
10
10
|
welcomeMessage: l,
|
|
11
11
|
contentCard: g,
|
|
12
12
|
question: u,
|
|
@@ -14,36 +14,36 @@ import '../../../../styles/media-container.css';const _ = "_mediaContainer_10210
|
|
|
14
14
|
body: b,
|
|
15
15
|
error: f
|
|
16
16
|
}, w = ({
|
|
17
|
-
children:
|
|
18
|
-
className:
|
|
19
|
-
variant:
|
|
20
|
-
}) => /* @__PURE__ */
|
|
21
|
-
className:
|
|
17
|
+
children: o,
|
|
18
|
+
className: r,
|
|
19
|
+
variant: a = "modal"
|
|
20
|
+
}) => /* @__PURE__ */ n("div", {
|
|
21
|
+
className: s(e.mediaContainer, e[r], a === "sidebar" && e.sidebar),
|
|
22
22
|
"data-testid": "content-answers-grid-card",
|
|
23
|
-
children:
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
children:
|
|
27
|
-
isUsedInsideSidebar:
|
|
28
|
-
variant:
|
|
29
|
-
}) => /* @__PURE__ */
|
|
30
|
-
className:
|
|
31
|
-
children:
|
|
23
|
+
children: o
|
|
24
|
+
}), t = w;
|
|
25
|
+
t.Figure = ({
|
|
26
|
+
children: o,
|
|
27
|
+
isUsedInsideSidebar: r = !1,
|
|
28
|
+
variant: a
|
|
29
|
+
}) => /* @__PURE__ */ n("div", {
|
|
30
|
+
className: s(e.figure, e[a], r && e.sidebar),
|
|
31
|
+
children: o
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
children:
|
|
35
|
-
isUsedInsideSidebar:
|
|
36
|
-
variant:
|
|
37
|
-
shouldAddCard:
|
|
38
|
-
}) => /* @__PURE__ */
|
|
39
|
-
className:
|
|
40
|
-
children:
|
|
33
|
+
t.Content = ({
|
|
34
|
+
children: o,
|
|
35
|
+
isUsedInsideSidebar: r = !1,
|
|
36
|
+
variant: a,
|
|
37
|
+
shouldAddCard: d = !0
|
|
38
|
+
}) => /* @__PURE__ */ n("div", {
|
|
39
|
+
className: s(e.body, e[a], r && e.sidebar),
|
|
40
|
+
children: d ? /* @__PURE__ */ n(i, {
|
|
41
41
|
className: e.contentCard,
|
|
42
|
-
children:
|
|
43
|
-
}) :
|
|
42
|
+
children: o
|
|
43
|
+
}) : o
|
|
44
44
|
});
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
t as MediaContainer,
|
|
47
47
|
w as MediaContainerBase,
|
|
48
|
-
|
|
48
|
+
t as default
|
|
49
49
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { LoadingIndicator as
|
|
2
|
-
import
|
|
1
|
+
import { LoadingIndicator as M } from "@box/blueprint-web";
|
|
2
|
+
import S from "clsx";
|
|
3
3
|
import * as t from "react";
|
|
4
|
-
import { useIntl as
|
|
4
|
+
import { useIntl as j } from "react-intl";
|
|
5
5
|
import k from "../../messages.js";
|
|
6
6
|
import { C as y } from "../../../../chunks/types.js";
|
|
7
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 = "
|
|
10
|
+
import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1p60c_2", G = "_content_1p60c_6", J = "_sidebar_1p60c_15", K = "_isLoading_1p60c_18", Q = "_messagesEnd_1p60c_22", U = "_innerContent_1p60c_26", o = {
|
|
11
11
|
loadingIndicatorWrapper: D,
|
|
12
12
|
content: G,
|
|
13
13
|
sidebar: J,
|
|
@@ -17,36 +17,36 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
|
|
|
17
17
|
}, ne = ({
|
|
18
18
|
error: u,
|
|
19
19
|
hasCustomSuggestedQuestions: C,
|
|
20
|
-
hasRequestInProgress:
|
|
20
|
+
hasRequestInProgress: a = !1,
|
|
21
21
|
isErrorMessageShown: h = !1,
|
|
22
22
|
isStreamingEnabled: i = !1,
|
|
23
|
-
questions:
|
|
23
|
+
questions: R,
|
|
24
24
|
recordAction: m,
|
|
25
25
|
showLoadingIndicator: p = !1,
|
|
26
|
-
suggestedQuestions:
|
|
27
|
-
askSuggestedQuestion:
|
|
28
|
-
setAskSuggestedQuestion:
|
|
29
|
-
useAnimation:
|
|
26
|
+
suggestedQuestions: b,
|
|
27
|
+
askSuggestedQuestion: v,
|
|
28
|
+
setAskSuggestedQuestion: I,
|
|
29
|
+
useAnimation: L,
|
|
30
30
|
variant: _ = "modal",
|
|
31
|
-
hostAppName:
|
|
32
|
-
...
|
|
31
|
+
hostAppName: N = "",
|
|
32
|
+
...O
|
|
33
33
|
}) => {
|
|
34
|
-
const f = t.useRef(null), l = t.useRef(null), d = t.useRef(null), n = t.useRef(!0), [g,
|
|
35
|
-
formatMessage:
|
|
36
|
-
} =
|
|
34
|
+
const f = t.useRef(null), l = t.useRef(null), d = t.useRef(null), n = t.useRef(!0), [g, w] = t.useState(!1), {
|
|
35
|
+
formatMessage: x
|
|
36
|
+
} = j(), E = u === y.LARGE_FILE, s = t.useCallback((c) => {
|
|
37
37
|
var e;
|
|
38
38
|
(e = d.current) != null && e.scrollIntoView && l.current && (!i || n.current) && d.current.scrollIntoView({
|
|
39
|
-
behavior:
|
|
39
|
+
behavior: c,
|
|
40
40
|
block: "nearest"
|
|
41
41
|
});
|
|
42
|
-
}, [i]),
|
|
42
|
+
}, [i]), z = () => {
|
|
43
43
|
if (l.current) {
|
|
44
44
|
const {
|
|
45
|
-
scrollTop:
|
|
45
|
+
scrollTop: c,
|
|
46
46
|
clientHeight: e,
|
|
47
|
-
scrollHeight:
|
|
48
|
-
} = l.current,
|
|
49
|
-
if (
|
|
47
|
+
scrollHeight: W
|
|
48
|
+
} = l.current, F = W - (c + e);
|
|
49
|
+
if (a && F > 100) {
|
|
50
50
|
n.current = !1;
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -54,45 +54,45 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
t.useEffect(() => {
|
|
57
|
-
g ? n.current = !1 :
|
|
58
|
-
}, [g, s,
|
|
57
|
+
g ? n.current = !1 : a && (n.current = !0, s("instant"));
|
|
58
|
+
}, [g, s, a]), t.useEffect(() => {
|
|
59
59
|
n.current = !0, s("instant");
|
|
60
60
|
}, [s]), t.useLayoutEffect(() => {
|
|
61
61
|
if (!f.current)
|
|
62
62
|
return;
|
|
63
|
-
const
|
|
63
|
+
const c = new ResizeObserver(() => {
|
|
64
64
|
n.current && s(i ? "instant" : "smooth");
|
|
65
65
|
}), e = f.current;
|
|
66
|
-
return e &&
|
|
67
|
-
e &&
|
|
66
|
+
return e && c.observe(e), () => {
|
|
67
|
+
e && c.unobserve(e);
|
|
68
68
|
};
|
|
69
69
|
}, [s, i]);
|
|
70
|
-
const
|
|
70
|
+
const T = () => h && !E ? /* @__PURE__ */ r(A, {
|
|
71
71
|
error: u,
|
|
72
72
|
recordAction: m
|
|
73
73
|
}) : p ? /* @__PURE__ */ r("div", {
|
|
74
74
|
className: o.loadingIndicatorWrapper,
|
|
75
|
-
children: /* @__PURE__ */ r(
|
|
76
|
-
"aria-label":
|
|
75
|
+
children: /* @__PURE__ */ r(M, {
|
|
76
|
+
"aria-label": x(k.loading),
|
|
77
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
82
|
children: [/* @__PURE__ */ r(B, {
|
|
83
|
-
askSuggestedQuestion:
|
|
83
|
+
askSuggestedQuestion: v,
|
|
84
84
|
hasCustomSuggestedQuestions: C,
|
|
85
|
-
hasRequestInProgress:
|
|
86
|
-
hostAppName:
|
|
85
|
+
hasRequestInProgress: a,
|
|
86
|
+
hostAppName: N,
|
|
87
87
|
isFileSizeError: E,
|
|
88
|
-
onDropdownOpenChange:
|
|
89
|
-
questions:
|
|
88
|
+
onDropdownOpenChange: w,
|
|
89
|
+
questions: R,
|
|
90
90
|
recordAction: m,
|
|
91
|
-
setAskSuggestedQuestion:
|
|
92
|
-
suggestedQuestions:
|
|
93
|
-
useAnimation:
|
|
91
|
+
setAskSuggestedQuestion: I,
|
|
92
|
+
suggestedQuestions: b,
|
|
93
|
+
useAnimation: L,
|
|
94
94
|
variant: _,
|
|
95
|
-
...
|
|
95
|
+
...O
|
|
96
96
|
}), /* @__PURE__ */ r("div", {
|
|
97
97
|
ref: d,
|
|
98
98
|
className: o.messagesEnd
|
|
@@ -100,13 +100,13 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
|
|
|
100
100
|
});
|
|
101
101
|
return /* @__PURE__ */ r("div", {
|
|
102
102
|
ref: l,
|
|
103
|
-
className:
|
|
103
|
+
className: S(o.content, _ === "sidebar" && o.sidebar, p && o.isLoading),
|
|
104
104
|
"data-testid": "content-answers-content",
|
|
105
|
-
onScroll:
|
|
105
|
+
onScroll: z,
|
|
106
106
|
children: /* @__PURE__ */ r("div", {
|
|
107
107
|
ref: f,
|
|
108
108
|
className: o.innerContent,
|
|
109
|
-
children:
|
|
109
|
+
children: T()
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
112
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Text as r } from "@box/blueprint-web";
|
|
2
|
-
import
|
|
3
|
-
import { MediaContainer as
|
|
2
|
+
import d from "clsx";
|
|
3
|
+
import { MediaContainer as n } from "../common/media-container.js";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
import '../../../../styles/question.css';const
|
|
6
|
-
question:
|
|
5
|
+
import '../../../../styles/question.css';const c = "_question_axio7_2", m = "_sidebar_axio7_7", l = "_text_axio7_10", e = {
|
|
6
|
+
question: c,
|
|
7
7
|
sidebar: m,
|
|
8
8
|
text: l
|
|
9
|
-
},
|
|
9
|
+
}, q = ({
|
|
10
10
|
prompt: o,
|
|
11
11
|
variant: s = "modal"
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
isUsedInsideSidebar:
|
|
13
|
+
const i = s === "sidebar", a = /* @__PURE__ */ t(n.Content, {
|
|
14
|
+
isUsedInsideSidebar: i,
|
|
15
15
|
variant: "question",
|
|
16
16
|
children: /* @__PURE__ */ t(r, {
|
|
17
17
|
as: "span",
|
|
@@ -20,9 +20,9 @@ import '../../../../styles/question.css';const d = "_question_hbq6c_1", m = "_si
|
|
|
20
20
|
})
|
|
21
21
|
});
|
|
22
22
|
return /* @__PURE__ */ t("div", {
|
|
23
|
-
className:
|
|
23
|
+
className: d(e.question, i && e.sidebar),
|
|
24
24
|
"data-testid": "content-answers-question",
|
|
25
|
-
children: /* @__PURE__ */ t(
|
|
25
|
+
children: /* @__PURE__ */ t(n, {
|
|
26
26
|
className: "question",
|
|
27
27
|
variant: s,
|
|
28
28
|
children: a
|
|
@@ -30,6 +30,6 @@ import '../../../../styles/question.css';const d = "_question_hbq6c_1", m = "_si
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
q as Question,
|
|
34
|
+
q as default
|
|
35
35
|
};
|
|
@@ -7,9 +7,9 @@ import { useIntl as w } from "react-intl";
|
|
|
7
7
|
import { Suggestions as T } from "./suggestions.js";
|
|
8
8
|
import { R as a } from "../../../../chunks/types.js";
|
|
9
9
|
import { LOGGER_BASE_CONFIG as y } from "../common/constants.js";
|
|
10
|
-
import
|
|
10
|
+
import t from "./messages.js";
|
|
11
11
|
import { jsxs as L, jsx as i } from "react/jsx-runtime";
|
|
12
|
-
import '../../../../styles/suggested-questions.css';const P = "
|
|
12
|
+
import '../../../../styles/suggested-questions.css';const P = "_wrapper_1069c_2", U = "_label_1069c_2", j = "_sidebar_1069c_7", v = "_loadingIndicator_1069c_11", F = "_alertIcon_1069c_19", r = {
|
|
13
13
|
wrapper: P,
|
|
14
14
|
label: U,
|
|
15
15
|
sidebar: j,
|
|
@@ -17,49 +17,49 @@ import '../../../../styles/suggested-questions.css';const P = "_wrapper_1peth_1"
|
|
|
17
17
|
alertIcon: F
|
|
18
18
|
}, W = ({
|
|
19
19
|
askSuggestedQuestion: g,
|
|
20
|
-
hasCustomSuggestedQuestions:
|
|
20
|
+
hasCustomSuggestedQuestions: c,
|
|
21
21
|
isLoading: S,
|
|
22
22
|
onSuggestedQuestionInteraction: I,
|
|
23
23
|
recordAction: n,
|
|
24
|
-
setAskSuggestedQuestion:
|
|
24
|
+
setAskSuggestedQuestion: l,
|
|
25
25
|
suggestedQuestions: b,
|
|
26
26
|
suggestedQuestionsRequestState: o = a.SUCCESS,
|
|
27
|
-
variant:
|
|
27
|
+
variant: d = "modal"
|
|
28
28
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
formatMessage:
|
|
31
|
-
} = w(),
|
|
29
|
+
const s = d === "sidebar", {
|
|
30
|
+
formatMessage: e
|
|
31
|
+
} = w(), E = G.useCallback((m) => {
|
|
32
32
|
const {
|
|
33
33
|
prompt: p,
|
|
34
|
-
type:
|
|
34
|
+
type: h
|
|
35
35
|
} = m;
|
|
36
|
-
|
|
36
|
+
l && (l(m), n && p && n({
|
|
37
37
|
...y,
|
|
38
38
|
target: "suggested_questions",
|
|
39
39
|
data: {
|
|
40
|
-
selectedQuestion:
|
|
41
|
-
type:
|
|
40
|
+
selectedQuestion: c ? "dynamic" : p,
|
|
41
|
+
type: h
|
|
42
42
|
}
|
|
43
43
|
}));
|
|
44
|
-
}, [
|
|
44
|
+
}, [l, n, c]), R = () => o === a.IN_PROGRESS ? e(t.loadingSuggestedQuestions) : e(t.loadingSuggestedQuestionsFailed);
|
|
45
45
|
return /* @__PURE__ */ L("div", {
|
|
46
|
-
className: f(r.wrapper,
|
|
46
|
+
className: f(r.wrapper, s && r.sidebar),
|
|
47
47
|
children: [(o === a.IN_PROGRESS || o === a.ERROR) && /* @__PURE__ */ i(N, {
|
|
48
48
|
as: "p",
|
|
49
|
-
className: f(r.label,
|
|
49
|
+
className: f(r.label, s && r.sidebar),
|
|
50
50
|
color: "textOnLightSecondary",
|
|
51
|
-
children:
|
|
51
|
+
children: R()
|
|
52
52
|
}), o === a.SUCCESS && /* @__PURE__ */ i(T, {
|
|
53
53
|
askSuggestedQuestion: g,
|
|
54
54
|
isLoading: S,
|
|
55
|
-
onSuggestedQuestionClick:
|
|
55
|
+
onSuggestedQuestionClick: E,
|
|
56
56
|
onSuggestedQuestionInteraction: I,
|
|
57
57
|
suggestedQuestions: b,
|
|
58
|
-
variant:
|
|
58
|
+
variant: d
|
|
59
59
|
}), o === a.IN_PROGRESS && /* @__PURE__ */ i("div", {
|
|
60
60
|
className: r.loadingIndicator,
|
|
61
61
|
children: /* @__PURE__ */ i(O, {
|
|
62
|
-
"aria-label": t
|
|
62
|
+
"aria-label": e(t.loadingSuggestedQuestions),
|
|
63
63
|
className: r.loadingIndicator,
|
|
64
64
|
variant: "dark"
|
|
65
65
|
})
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { FilterChip as r } from "@box/blueprint-web";
|
|
2
2
|
import d from "clsx";
|
|
3
|
-
import
|
|
3
|
+
import y from "lodash/noop";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
import '../../../../styles/suggestions.css';const
|
|
6
|
-
suggestions:
|
|
7
|
-
suggestion:
|
|
5
|
+
import '../../../../styles/suggestions.css';const u = "_suggestions_1yvk2_2", w = "_suggestion_1yvk2_2", n = {
|
|
6
|
+
suggestions: u,
|
|
7
|
+
suggestion: w
|
|
8
8
|
}, A = ({
|
|
9
9
|
askSuggestedQuestion: s,
|
|
10
10
|
isLoading: p,
|
|
11
11
|
onSuggestedQuestionClick: a,
|
|
12
|
-
onSuggestedQuestionInteraction: e =
|
|
12
|
+
onSuggestedQuestionInteraction: e = y,
|
|
13
13
|
suggestedQuestions: l,
|
|
14
14
|
variant: g = "modal"
|
|
15
15
|
}) => {
|