@box/box-ai-content-answers 0.115.0 → 0.115.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/warning-message.js +10 -10
- package/dist/esm/lib/box-ai-content-answers.js +40 -40
- package/dist/esm/lib/components/agents/agent-selector.js +34 -34
- package/dist/esm/lib/components/answer/answer.js +49 -49
- package/dist/esm/lib/components/chat/chat.js +46 -46
- package/dist/esm/lib/components/common/media-container.js +35 -35
- package/dist/esm/lib/components/content/content.js +41 -41
- package/dist/esm/lib/components/suggested-questions/suggestions.js +15 -15
- package/dist/esm/lib/components/welcome-message/contextual-items-message.js +27 -27
- package/dist/styles/agent-selector.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/content.css +1 -1
- package/dist/styles/contextual-items-message.css +1 -1
- package/dist/styles/media-container.css +1 -1
- package/dist/styles/suggestions.css +1 -1
- package/dist/styles/warning-message.css +1 -1
- package/package.json +6 -6
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { InlineNotice as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import '../styles/warning-message.css';const o = "
|
|
1
|
+
import { InlineNotice as r, Text as n } from "@box/blueprint-web";
|
|
2
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import '../styles/warning-message.css';const o = "_welcomeMessage_4b90d_1", c = "_warnings_4b90d_4", g = "_warningNotice_4b90d_9", l = "_iconAvatar_4b90d_12", _ = {
|
|
4
4
|
welcomeMessage: o,
|
|
5
5
|
warnings: c,
|
|
6
6
|
warningNotice: g,
|
|
7
7
|
iconAvatar: l
|
|
8
|
-
},
|
|
9
|
-
ariaLabel:
|
|
10
|
-
title:
|
|
8
|
+
}, m = ({
|
|
9
|
+
ariaLabel: s,
|
|
10
|
+
title: i,
|
|
11
11
|
description: a
|
|
12
|
-
}) => /* @__PURE__ */ r
|
|
12
|
+
}) => /* @__PURE__ */ t(r, {
|
|
13
13
|
className: _.warningNotice,
|
|
14
14
|
variant: "warning",
|
|
15
|
-
variantIconAriaLabel:
|
|
15
|
+
variantIconAriaLabel: s,
|
|
16
16
|
children: [/* @__PURE__ */ e(n, {
|
|
17
17
|
as: "p",
|
|
18
18
|
variant: "bodyDefault",
|
|
19
|
-
children:
|
|
19
|
+
children: i
|
|
20
20
|
}), a && /* @__PURE__ */ e(n, {
|
|
21
21
|
as: "p",
|
|
22
22
|
variant: "bodyDefault",
|
|
@@ -24,6 +24,6 @@ import '../styles/warning-message.css';const o = "_welcomeMessage_1tq6g_1", c =
|
|
|
24
24
|
})]
|
|
25
25
|
});
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
m as W,
|
|
28
28
|
_ as s
|
|
29
29
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _ from "clsx";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { AgentEditor as K } from "./components/agents/agent-editor.js";
|
|
4
4
|
import { C as V } from "../../chunks/types.js";
|
|
5
5
|
import { jsx as i, jsxs as W } from "react/jsx-runtime";
|
|
6
6
|
import { Content as X } from "./components/content/content.js";
|
|
7
7
|
import { Footer as Y } from "./components/footer/footer.js";
|
|
8
|
-
import '../../styles/box-ai-content-answers.css';const Z = "
|
|
8
|
+
import '../../styles/box-ai-content-answers.css';const Z = "_container_1p5tb_1", $ = "_contentAnswers_1p5tb_8", v = "_sidebar_1p5tb_19", d = {
|
|
9
9
|
container: Z,
|
|
10
10
|
contentAnswers: $,
|
|
11
11
|
sidebar: v
|
|
12
12
|
}, te = ({
|
|
13
|
-
className:
|
|
13
|
+
className: h,
|
|
14
14
|
contentType: Q,
|
|
15
|
-
contentName:
|
|
15
|
+
contentName: A,
|
|
16
16
|
error: t,
|
|
17
|
-
hasCustomSuggestedQuestions:
|
|
17
|
+
hasCustomSuggestedQuestions: w,
|
|
18
18
|
hasRequestInProgress: l,
|
|
19
|
-
isAgentSelectorEnabled:
|
|
20
|
-
isAIStudioAgentSelectorEnabled:
|
|
21
|
-
isDebugModeEnabled:
|
|
22
|
-
isStopResponseEnabled:
|
|
19
|
+
isAgentSelectorEnabled: E,
|
|
20
|
+
isAIStudioAgentSelectorEnabled: M,
|
|
21
|
+
isDebugModeEnabled: R,
|
|
22
|
+
isStopResponseEnabled: x,
|
|
23
23
|
isStreamingEnabled: c,
|
|
24
24
|
questions: r,
|
|
25
25
|
recordAction: g,
|
|
26
|
-
retryQuestion:
|
|
26
|
+
retryQuestion: C,
|
|
27
27
|
showLoadingIndicator: m,
|
|
28
|
-
stopQuestion:
|
|
29
|
-
submitQuestion:
|
|
30
|
-
suggestedQuestions:
|
|
31
|
-
useAnimation:
|
|
32
|
-
onAgentEditorToggle:
|
|
28
|
+
stopQuestion: F,
|
|
29
|
+
submitQuestion: D,
|
|
30
|
+
suggestedQuestions: N,
|
|
31
|
+
useAnimation: k,
|
|
32
|
+
onAgentEditorToggle: j,
|
|
33
33
|
onUserIntentToUseAI: e,
|
|
34
34
|
variant: o = "modal",
|
|
35
|
-
hostAppName:
|
|
36
|
-
...
|
|
35
|
+
hostAppName: y,
|
|
36
|
+
...O
|
|
37
37
|
}) => {
|
|
38
|
-
const [f,
|
|
38
|
+
const [f, p] = n.useState(null), [S, z] = n.useState(t != null), [s, b] = n.useState(!1), B = t === V.LARGE_FILE, G = (!S || B) && !m, u = (a) => {
|
|
39
39
|
g && g({
|
|
40
40
|
...a,
|
|
41
41
|
component: o
|
|
@@ -43,57 +43,57 @@ import '../../styles/box-ai-content-answers.css';const Z = "_container_xgwyz_1",
|
|
|
43
43
|
}, L = () => {
|
|
44
44
|
e && e(!1);
|
|
45
45
|
}, H = (a) => {
|
|
46
|
-
|
|
46
|
+
p(a), e && e(!0);
|
|
47
47
|
}, J = () => {
|
|
48
48
|
e && e(!0);
|
|
49
49
|
};
|
|
50
50
|
return n.useEffect(() => {
|
|
51
|
-
|
|
51
|
+
z(t != null);
|
|
52
52
|
}, [t]), /* @__PURE__ */ i("div", {
|
|
53
|
-
className: h
|
|
53
|
+
className: _(h, d.container),
|
|
54
54
|
children: /* @__PURE__ */ W("div", {
|
|
55
|
-
className:
|
|
55
|
+
className: _(d.contentAnswers, o === "sidebar" && d.sidebar),
|
|
56
56
|
children: [!s && /* @__PURE__ */ i(X, {
|
|
57
|
-
...
|
|
57
|
+
...O,
|
|
58
58
|
askSuggestedQuestion: f,
|
|
59
|
-
contentName:
|
|
59
|
+
contentName: A,
|
|
60
60
|
contentType: Q,
|
|
61
61
|
error: t,
|
|
62
|
-
hasCustomSuggestedQuestions:
|
|
62
|
+
hasCustomSuggestedQuestions: w,
|
|
63
63
|
hasRequestInProgress: l,
|
|
64
|
-
hostAppName:
|
|
65
|
-
isErrorMessageShown:
|
|
64
|
+
hostAppName: y,
|
|
65
|
+
isErrorMessageShown: S,
|
|
66
66
|
isStreamingEnabled: c,
|
|
67
67
|
onSuggestedQuestionInteraction: L,
|
|
68
68
|
questions: r,
|
|
69
69
|
recordAction: u,
|
|
70
70
|
setAskSuggestedQuestion: H,
|
|
71
71
|
showLoadingIndicator: m,
|
|
72
|
-
suggestedQuestions:
|
|
73
|
-
useAnimation: c &&
|
|
72
|
+
suggestedQuestions: N,
|
|
73
|
+
useAnimation: c && k,
|
|
74
74
|
variant: o
|
|
75
75
|
}), s && /* @__PURE__ */ i(K, {
|
|
76
|
-
onAgentEditorToggle:
|
|
76
|
+
onAgentEditorToggle: j,
|
|
77
77
|
recordAction: u,
|
|
78
|
-
setIsDebugModeShown:
|
|
78
|
+
setIsDebugModeShown: b
|
|
79
79
|
}), G && /* @__PURE__ */ i(Y, {
|
|
80
80
|
askSuggestedQuestion: f,
|
|
81
|
-
enableDebugMode:
|
|
81
|
+
enableDebugMode: R,
|
|
82
82
|
hasRequestInProgress: l,
|
|
83
|
-
isAgentSelectorEnabled:
|
|
84
|
-
isAIStudioAgentSelectorEnabled:
|
|
83
|
+
isAgentSelectorEnabled: E,
|
|
84
|
+
isAIStudioAgentSelectorEnabled: M,
|
|
85
85
|
isDebugModeShown: s,
|
|
86
|
-
isStopResponseEnabled:
|
|
86
|
+
isStopResponseEnabled: x,
|
|
87
87
|
isStreamingEnabled: c,
|
|
88
88
|
lastQuestion: r[r.length - 1],
|
|
89
|
-
onRetryQuestion:
|
|
90
|
-
onStopQuestion:
|
|
89
|
+
onRetryQuestion: C,
|
|
90
|
+
onStopQuestion: F,
|
|
91
91
|
onUserInteraction: J,
|
|
92
92
|
recordAction: u,
|
|
93
|
-
sendQuestion:
|
|
94
|
-
setAskSuggestedQuestion:
|
|
93
|
+
sendQuestion: D,
|
|
94
|
+
setAskSuggestedQuestion: p,
|
|
95
95
|
toggleDebugMode: () => {
|
|
96
|
-
|
|
96
|
+
b(!s);
|
|
97
97
|
},
|
|
98
98
|
variant: o
|
|
99
99
|
})]
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { FilterChip as
|
|
1
|
+
import { FilterChip as a, Popover as n, Status as S, SmallList as c } from "@box/blueprint-web";
|
|
2
2
|
import { useState as f, useCallback as C } from "react";
|
|
3
3
|
import { useIntl as I } from "react-intl";
|
|
4
|
-
import { useAgents as
|
|
5
|
-
import { LOGGER_BASE_CONFIG as
|
|
4
|
+
import { useAgents as v, useAgentsDispatch as N } from "../../contexts/AgentsContext.js";
|
|
5
|
+
import { LOGGER_BASE_CONFIG as G, LOGGER_ACTION_CLICK as O } from "../common/constants.js";
|
|
6
6
|
import p from "./messages.js";
|
|
7
7
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
import '../../../../styles/agent-selector.css';const
|
|
9
|
-
agentSelector:
|
|
10
|
-
agentStatus:
|
|
11
|
-
agentList:
|
|
12
|
-
agentListItem:
|
|
13
|
-
},
|
|
14
|
-
onSelectAgent:
|
|
15
|
-
recordAction:
|
|
8
|
+
import '../../../../styles/agent-selector.css';const A = "_agentSelector_avzc4_1", E = "_agentStatus_avzc4_5", x = "_agentList_avzc4_19", T = "_agentListItem_avzc4_19", s = {
|
|
9
|
+
agentSelector: A,
|
|
10
|
+
agentStatus: E,
|
|
11
|
+
agentList: x,
|
|
12
|
+
agentListItem: T
|
|
13
|
+
}, F = ({
|
|
14
|
+
onSelectAgent: o,
|
|
15
|
+
recordAction: r
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
|
-
formatMessage:
|
|
18
|
+
formatMessage: i
|
|
19
19
|
} = I(), {
|
|
20
20
|
agents: h,
|
|
21
|
-
selectedAgent:
|
|
22
|
-
} =
|
|
21
|
+
selectedAgent: l
|
|
22
|
+
} = v(), m = N(), [_, g] = f(!1), u = i(p.selectAgent), L = C((t) => {
|
|
23
23
|
g(!1), m({
|
|
24
24
|
type: "SELECT_AGENT",
|
|
25
25
|
agentName: t.name
|
|
26
|
-
}),
|
|
27
|
-
...
|
|
28
|
-
action:
|
|
26
|
+
}), r && r({
|
|
27
|
+
...G,
|
|
28
|
+
action: O,
|
|
29
29
|
target: "agentSelector",
|
|
30
30
|
data: {
|
|
31
31
|
agentSelected: t.name
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
34
|
-
}, [m,
|
|
35
|
-
return /* @__PURE__ */ e(
|
|
33
|
+
}), o && o(t);
|
|
34
|
+
}, [m, o, r]);
|
|
35
|
+
return /* @__PURE__ */ e(a.Group, {
|
|
36
36
|
className: s.agentSelector,
|
|
37
37
|
name: u,
|
|
38
38
|
type: "multiple",
|
|
39
|
-
children: /* @__PURE__ */ d(
|
|
39
|
+
children: /* @__PURE__ */ d(n.Root, {
|
|
40
40
|
modal: !1,
|
|
41
41
|
onOpenChange: g,
|
|
42
42
|
open: _,
|
|
43
|
-
children: [/* @__PURE__ */ e(
|
|
44
|
-
children: /* @__PURE__ */ d(
|
|
43
|
+
children: [/* @__PURE__ */ e(n.Trigger, {
|
|
44
|
+
children: /* @__PURE__ */ d(a.TriggerChip, {
|
|
45
45
|
value: "trigger-chip",
|
|
46
46
|
children: [/* @__PURE__ */ e(S, {
|
|
47
47
|
className: s.agentStatus,
|
|
48
48
|
colorIndex: 0,
|
|
49
|
-
text:
|
|
50
|
-
}), /* @__PURE__ */ e(
|
|
51
|
-
children:
|
|
52
|
-
}), /* @__PURE__ */ e(
|
|
49
|
+
text: i(p.agent)
|
|
50
|
+
}), /* @__PURE__ */ e(a.Label, {
|
|
51
|
+
children: l.name
|
|
52
|
+
}), /* @__PURE__ */ e(a.DropdownIndicator, {})]
|
|
53
53
|
})
|
|
54
|
-
}), /* @__PURE__ */ e(
|
|
55
|
-
children: /* @__PURE__ */ e(
|
|
56
|
-
children: /* @__PURE__ */ e(
|
|
54
|
+
}), /* @__PURE__ */ e(n.ContentContainer, {
|
|
55
|
+
children: /* @__PURE__ */ e(n.MainContent, {
|
|
56
|
+
children: /* @__PURE__ */ e(c, {
|
|
57
57
|
className: s.agentList,
|
|
58
|
-
selectedKeys: [
|
|
59
|
-
children: h.map((t) => /* @__PURE__ */ e(
|
|
58
|
+
selectedKeys: [l.name],
|
|
59
|
+
children: h.map((t) => /* @__PURE__ */ e(c.Item, {
|
|
60
60
|
className: s.agentListItem,
|
|
61
61
|
id: t.name,
|
|
62
62
|
onAction: () => L(t),
|
|
63
|
-
children: /* @__PURE__ */ e(
|
|
63
|
+
children: /* @__PURE__ */ e(c.Header, {
|
|
64
64
|
children: t.name
|
|
65
65
|
})
|
|
66
66
|
}, t.name))
|
|
@@ -71,5 +71,5 @@ import '../../../../styles/agent-selector.css';const E = "_agentSelector_rri97_1
|
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
F as AgentSelector
|
|
75
75
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { AlertTriangle as
|
|
3
|
-
import { Gray65 as
|
|
1
|
+
import { Text as H } from "@box/blueprint-web";
|
|
2
|
+
import { AlertTriangle as L } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { Gray65 as F, Size4 as E } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
4
|
import p from "clsx";
|
|
5
5
|
import * as d from "react";
|
|
6
|
-
import { useIntl as
|
|
6
|
+
import { useIntl as U } from "react-intl";
|
|
7
7
|
import { A as n } from "../../../../chunks/types.js";
|
|
8
8
|
import { MediaContainer as h } from "../common/media-container.js";
|
|
9
|
-
import { AnswerContent as
|
|
9
|
+
import { AnswerContent as x } from "./answer-content.js";
|
|
10
10
|
import { CopyButton as k } from "./copy-button.js";
|
|
11
11
|
import { InlineError as G } from "./inline-error.js";
|
|
12
|
-
import { ThumbButtons as
|
|
12
|
+
import { ThumbButtons as j } from "./thumb-buttons.js";
|
|
13
13
|
import { LoadingIndicator as W } from "./loading-indicator.js";
|
|
14
14
|
import m from "./messages.js";
|
|
15
15
|
import { References as q } from "./references.js";
|
|
16
16
|
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
17
|
-
import '../../../../styles/answer.css';const J = "
|
|
17
|
+
import '../../../../styles/answer.css';const J = "_answer_18szz_1", K = "_alertIcon_18szz_5", Q = "_error_18szz_8", V = "_footer_18szz_12", X = "_copyButtonContainer_18szz_18", Y = "_feedbackButtonsContainer_18szz_19", Z = "_shouldHaveMarginTop_18szz_23", $ = "_shouldUseAnimation_18szz_26", tt = "_shouldAnimateHeight_18szz_30", ot = "_footerButtons_18szz_34", et = "_iconAvatar_18szz_40", e = {
|
|
18
18
|
answer: J,
|
|
19
19
|
alertIcon: K,
|
|
20
20
|
error: Q,
|
|
@@ -26,106 +26,106 @@ import '../../../../styles/answer.css';const J = "_answer_15j2x_1", K = "_alertI
|
|
|
26
26
|
shouldAnimateHeight: tt,
|
|
27
27
|
footerButtons: ot,
|
|
28
28
|
iconAvatar: et
|
|
29
|
-
}, nt = /* @__PURE__ */ new Set([n.RATE_LIMITING, n.NO_CONTENT, n.PRECONDITION_FAILED, n.GENERAL, n.AGENT_NOT_FOUND]),
|
|
30
|
-
answer:
|
|
29
|
+
}, nt = /* @__PURE__ */ new Set([n.RATE_LIMITING, n.NO_CONTENT, n.PRECONDITION_FAILED, n.GENERAL, n.AGENT_NOT_FOUND]), zt = /* @__PURE__ */ d.memo(({
|
|
30
|
+
answer: s,
|
|
31
31
|
citations: N,
|
|
32
32
|
error: t,
|
|
33
|
-
contentType:
|
|
34
|
-
hostAppName:
|
|
35
|
-
feedbackValue:
|
|
36
|
-
isCitationsEnabled:
|
|
33
|
+
contentType: z,
|
|
34
|
+
hostAppName: I,
|
|
35
|
+
feedbackValue: S,
|
|
36
|
+
isCitationsEnabled: T = !1,
|
|
37
37
|
isCompleted: i = !1,
|
|
38
|
-
isFeedbackEnabled:
|
|
39
|
-
isLoading:
|
|
38
|
+
isFeedbackEnabled: A = !1,
|
|
39
|
+
isLoading: R = !1,
|
|
40
40
|
isMarkdownEnabled: O = !1,
|
|
41
41
|
items: g = [],
|
|
42
42
|
onCitationClick: w,
|
|
43
43
|
onAnswerCopy: B,
|
|
44
44
|
recordAction: c,
|
|
45
|
-
useAnimation:
|
|
46
|
-
variant:
|
|
47
|
-
setAnswerFeedback:
|
|
48
|
-
questionId:
|
|
45
|
+
useAnimation: P = !0,
|
|
46
|
+
variant: r = "modal",
|
|
47
|
+
setAnswerFeedback: C,
|
|
48
|
+
questionId: v
|
|
49
49
|
}) => {
|
|
50
|
-
const u = nt.has(t), _ =
|
|
50
|
+
const u = nt.has(t), _ = R && !s && !t, [M, b] = d.useState(i), {
|
|
51
51
|
formatMessage: l
|
|
52
|
-
} =
|
|
52
|
+
} = U();
|
|
53
53
|
d.useEffect(() => {
|
|
54
|
-
setTimeout(() =>
|
|
54
|
+
setTimeout(() => b(i), 0);
|
|
55
55
|
}, [i]);
|
|
56
|
-
const f = () => /* @__PURE__ */ o(
|
|
56
|
+
const f = () => /* @__PURE__ */ o(L, {
|
|
57
57
|
className: e.alertIcon,
|
|
58
|
-
color:
|
|
58
|
+
color: F,
|
|
59
59
|
"data-testid": "content-answers-error-alert-icon",
|
|
60
60
|
height: E,
|
|
61
61
|
role: "presentation",
|
|
62
62
|
width: E
|
|
63
|
-
}),
|
|
63
|
+
}), y = () => /* @__PURE__ */ a(H, {
|
|
64
64
|
as: "p",
|
|
65
65
|
className: e.error,
|
|
66
66
|
color: "textOnLightSecondary",
|
|
67
67
|
"data-testid": "content-answers-error",
|
|
68
68
|
variant: "caption",
|
|
69
69
|
children: [t === n.RESPONSE_INTERRUPTED && l(m.responseInterruptedError), t === n.RESPONSE_FAILED && l(m.responseFailedError), t === n.RESPONSE_STOPPED && l(m.responseStoppedError), t !== n.RESPONSE_STOPPED && f()]
|
|
70
|
-
}),
|
|
70
|
+
}), D = () => t !== n.RESPONSE_STOPPED ? /* @__PURE__ */ a("div", {
|
|
71
71
|
className: p(e.footerButtons, "footer-buttons-container"),
|
|
72
|
-
children: [
|
|
72
|
+
children: [A ? /* @__PURE__ */ o("div", {
|
|
73
73
|
className: e.feedbackButtonsContainer,
|
|
74
|
-
children: /* @__PURE__ */ o(
|
|
75
|
-
feedbackValue:
|
|
76
|
-
hostAppName:
|
|
74
|
+
children: /* @__PURE__ */ o(j, {
|
|
75
|
+
feedbackValue: S,
|
|
76
|
+
hostAppName: I,
|
|
77
77
|
items: g,
|
|
78
|
-
questionId:
|
|
78
|
+
questionId: v,
|
|
79
79
|
recordAction: c,
|
|
80
|
-
setAnswerFeedback:
|
|
81
|
-
variant:
|
|
80
|
+
setAnswerFeedback: C,
|
|
81
|
+
variant: r
|
|
82
82
|
})
|
|
83
83
|
}) : null, /* @__PURE__ */ o("div", {
|
|
84
84
|
className: e.copyButtonContainer,
|
|
85
85
|
children: /* @__PURE__ */ o(k, {
|
|
86
|
-
answer:
|
|
86
|
+
answer: s,
|
|
87
87
|
onAnswerCopy: B,
|
|
88
88
|
recordAction: c
|
|
89
89
|
})
|
|
90
90
|
})]
|
|
91
|
-
}) :
|
|
91
|
+
}) : s ? null : f();
|
|
92
92
|
return /* @__PURE__ */ a("div", {
|
|
93
93
|
"aria-live": "polite",
|
|
94
94
|
className: e.answer,
|
|
95
95
|
"data-testid": "content-answers-answer",
|
|
96
96
|
children: [_ && /* @__PURE__ */ o(W, {}), !u && !_ && /* @__PURE__ */ o(h, {
|
|
97
97
|
className: "answer",
|
|
98
|
-
variant:
|
|
98
|
+
variant: r,
|
|
99
99
|
children: /* @__PURE__ */ a(h.Content, {
|
|
100
|
-
isUsedInsideSidebar:
|
|
100
|
+
isUsedInsideSidebar: r === "sidebar",
|
|
101
101
|
variant: "answer",
|
|
102
|
-
children: [/* @__PURE__ */ o(
|
|
103
|
-
answer:
|
|
102
|
+
children: [/* @__PURE__ */ o(x, {
|
|
103
|
+
answer: s,
|
|
104
104
|
isMarkdownEnabled: O,
|
|
105
|
-
variant:
|
|
105
|
+
variant: r
|
|
106
106
|
}), i && /* @__PURE__ */ a("div", {
|
|
107
107
|
className: p(e.footer, {
|
|
108
|
-
[e.shouldHaveMarginTop]:
|
|
109
|
-
[e.shouldAnimateHeight]:
|
|
110
|
-
[e.shouldUseAnimation]:
|
|
108
|
+
[e.shouldHaveMarginTop]: s,
|
|
109
|
+
[e.shouldAnimateHeight]: M,
|
|
110
|
+
[e.shouldUseAnimation]: P
|
|
111
111
|
}),
|
|
112
112
|
"data-testid": "content-answers-answer-footer",
|
|
113
|
-
children: [t &&
|
|
113
|
+
children: [t && y(), T && !t && /* @__PURE__ */ o(q, {
|
|
114
114
|
citations: N,
|
|
115
115
|
onCitationClick: w,
|
|
116
116
|
recordAction: c
|
|
117
|
-
}),
|
|
117
|
+
}), D()]
|
|
118
118
|
})]
|
|
119
119
|
})
|
|
120
120
|
}), u && /* @__PURE__ */ o(G, {
|
|
121
|
-
contentType:
|
|
121
|
+
contentType: z,
|
|
122
122
|
error: t,
|
|
123
123
|
recordAction: c,
|
|
124
|
-
variant:
|
|
124
|
+
variant: r
|
|
125
125
|
})]
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
zt as Answer,
|
|
130
|
+
zt as default
|
|
131
131
|
};
|
|
@@ -10,7 +10,7 @@ import { WelcomeMessage as R } from "../welcome-message/welcome-message.js";
|
|
|
10
10
|
import { MediaContainer as U } from "../common/media-container.js";
|
|
11
11
|
import V from "../welcome-message/messages.js";
|
|
12
12
|
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
13
|
-
import '../../../../styles/chat.css';const X = "
|
|
13
|
+
import '../../../../styles/chat.css';const X = "_chat_77vqr_1", Y = "_clearChatText_77vqr_1", Z = "_landingPage_77vqr_7", $ = "_askQuestionText_77vqr_15", w = "_iconAvatar_77vqr_23", L = "_sidebar_77vqr_39", a = {
|
|
14
14
|
chat: X,
|
|
15
15
|
clearChatText: Y,
|
|
16
16
|
landingPage: Z,
|
|
@@ -19,41 +19,41 @@ import '../../../../styles/chat.css';const X = "_chat_1m7ms_1", Y = "_clearChatT
|
|
|
19
19
|
sidebar: L
|
|
20
20
|
}, lt = ({
|
|
21
21
|
askSuggestedQuestion: _,
|
|
22
|
-
contentType:
|
|
22
|
+
contentType: i,
|
|
23
23
|
hasCustomSuggestedQuestions: p,
|
|
24
24
|
hasRequestInProgress: f,
|
|
25
25
|
isCitationsEnabled: x,
|
|
26
26
|
isFeedbackEnabled: h,
|
|
27
|
-
isMarkdownEnabled:
|
|
28
|
-
isSessionLoading:
|
|
29
|
-
onCitationClick:
|
|
30
|
-
onAnswerCopy:
|
|
31
|
-
onSuggestedQuestionInteraction:
|
|
32
|
-
questions:
|
|
33
|
-
recordAction:
|
|
34
|
-
setAnswerFeedback:
|
|
35
|
-
setAskSuggestedQuestion:
|
|
36
|
-
suggestedQuestions:
|
|
37
|
-
suggestedQuestionsRequestState:
|
|
38
|
-
shouldShowLandingPage:
|
|
39
|
-
useAnimation:
|
|
27
|
+
isMarkdownEnabled: v,
|
|
28
|
+
isSessionLoading: T = !1,
|
|
29
|
+
onCitationClick: C,
|
|
30
|
+
onAnswerCopy: q,
|
|
31
|
+
onSuggestedQuestionInteraction: b,
|
|
32
|
+
questions: g,
|
|
33
|
+
recordAction: o,
|
|
34
|
+
setAnswerFeedback: u,
|
|
35
|
+
setAskSuggestedQuestion: s,
|
|
36
|
+
suggestedQuestions: m,
|
|
37
|
+
suggestedQuestionsRequestState: A,
|
|
38
|
+
shouldShowLandingPage: r,
|
|
39
|
+
useAnimation: N,
|
|
40
40
|
variant: e = "modal",
|
|
41
|
-
hostAppName:
|
|
42
|
-
welcomeMessageClearText:
|
|
41
|
+
hostAppName: Q = "",
|
|
42
|
+
welcomeMessageClearText: j,
|
|
43
43
|
...c
|
|
44
44
|
}) => {
|
|
45
45
|
const {
|
|
46
|
-
formatMessage:
|
|
46
|
+
formatMessage: k
|
|
47
47
|
} = G();
|
|
48
48
|
return /* @__PURE__ */ t("div", {
|
|
49
49
|
className: a.chat,
|
|
50
50
|
"data-testid": "content-answers-chat",
|
|
51
51
|
children: /* @__PURE__ */ d("div", {
|
|
52
52
|
className: H({
|
|
53
|
-
[a.landingPage]:
|
|
53
|
+
[a.landingPage]: r,
|
|
54
54
|
[a.sidebar]: e === "sidebar"
|
|
55
55
|
}),
|
|
56
|
-
children: [
|
|
56
|
+
children: [r && /* @__PURE__ */ t(U.Figure, {
|
|
57
57
|
variant: e,
|
|
58
58
|
children: /* @__PURE__ */ t("div", {
|
|
59
59
|
className: a.iconAvatar,
|
|
@@ -65,31 +65,31 @@ import '../../../../styles/chat.css';const X = "_chat_1m7ms_1", Y = "_clearChatT
|
|
|
65
65
|
})
|
|
66
66
|
}), /* @__PURE__ */ t(R, {
|
|
67
67
|
contentType: "",
|
|
68
|
-
shouldShowLandingPage:
|
|
68
|
+
shouldShowLandingPage: r,
|
|
69
69
|
...c,
|
|
70
70
|
variant: e
|
|
71
|
-
}),
|
|
71
|
+
}), r && m !== void 0 && s !== void 0 && /* @__PURE__ */ t(O, {
|
|
72
72
|
askSuggestedQuestion: _,
|
|
73
73
|
hasCustomSuggestedQuestions: p,
|
|
74
74
|
isLoading: f,
|
|
75
|
-
onSuggestedQuestionInteraction:
|
|
76
|
-
recordAction:
|
|
77
|
-
setAskSuggestedQuestion:
|
|
78
|
-
suggestedQuestions:
|
|
79
|
-
suggestedQuestionsRequestState:
|
|
75
|
+
onSuggestedQuestionInteraction: b,
|
|
76
|
+
recordAction: o,
|
|
77
|
+
setAskSuggestedQuestion: s,
|
|
78
|
+
suggestedQuestions: m,
|
|
79
|
+
suggestedQuestionsRequestState: A,
|
|
80
80
|
variant: e
|
|
81
81
|
}), /* @__PURE__ */ t(E, {
|
|
82
82
|
as: "p",
|
|
83
83
|
className: a.clearChatText,
|
|
84
|
-
children:
|
|
85
|
-
type:
|
|
84
|
+
children: j || k(V.welcomeClearChatText, {
|
|
85
|
+
type: i
|
|
86
86
|
})
|
|
87
|
-
}), !
|
|
88
|
-
children:
|
|
89
|
-
answer:
|
|
90
|
-
citations:
|
|
87
|
+
}), !r && /* @__PURE__ */ t("ul", {
|
|
88
|
+
children: g.map(({
|
|
89
|
+
answer: y,
|
|
90
|
+
citations: I,
|
|
91
91
|
id: n,
|
|
92
|
-
isCompleted:
|
|
92
|
+
isCompleted: M,
|
|
93
93
|
isLoading: z,
|
|
94
94
|
error: B,
|
|
95
95
|
prompt: F,
|
|
@@ -99,24 +99,24 @@ import '../../../../styles/chat.css';const X = "_chat_1m7ms_1", Y = "_clearChatT
|
|
|
99
99
|
prompt: F,
|
|
100
100
|
variant: e
|
|
101
101
|
}), /* @__PURE__ */ t(J, {
|
|
102
|
-
answer:
|
|
103
|
-
citations:
|
|
104
|
-
contentType:
|
|
102
|
+
answer: y,
|
|
103
|
+
citations: I,
|
|
104
|
+
contentType: i,
|
|
105
105
|
error: B,
|
|
106
106
|
feedbackValue: W,
|
|
107
|
-
hostAppName:
|
|
107
|
+
hostAppName: Q,
|
|
108
108
|
isCitationsEnabled: x,
|
|
109
|
-
isCompleted:
|
|
109
|
+
isCompleted: M,
|
|
110
110
|
isFeedbackEnabled: h,
|
|
111
|
-
isLoading: z ||
|
|
112
|
-
isMarkdownEnabled:
|
|
111
|
+
isLoading: z || T,
|
|
112
|
+
isMarkdownEnabled: v,
|
|
113
113
|
items: c.items,
|
|
114
|
-
onAnswerCopy:
|
|
115
|
-
onCitationClick:
|
|
114
|
+
onAnswerCopy: q,
|
|
115
|
+
onCitationClick: C,
|
|
116
116
|
questionId: n,
|
|
117
|
-
recordAction:
|
|
118
|
-
setAnswerFeedback:
|
|
119
|
-
useAnimation:
|
|
117
|
+
recordAction: o,
|
|
118
|
+
setAnswerFeedback: u,
|
|
119
|
+
useAnimation: N,
|
|
120
120
|
variant: e
|
|
121
121
|
})]
|
|
122
122
|
}, n))
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { Card as d } from "@box/blueprint-web";
|
|
2
|
-
import
|
|
3
|
-
import { jsx as
|
|
4
|
-
import '../../../../styles/media-container.css';const _ = "
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import '../../../../styles/media-container.css';const _ = "_mediaContainer_10210_1", c = "_figure_10210_7", m = "_sidebar_10210_14", l = "_welcomeMessage_10210_33", g = "_contentCard_10210_37", u = "_question_10210_42", C = "_answer_10210_64", b = "_body_10210_68", f = "_error_10210_102", e = {
|
|
5
5
|
mediaContainer: _,
|
|
6
6
|
figure: c,
|
|
7
|
-
sidebar:
|
|
8
|
-
"center-aligned": "_center-
|
|
9
|
-
"top-aligned": "_top-
|
|
10
|
-
welcomeMessage:
|
|
11
|
-
contentCard:
|
|
12
|
-
question:
|
|
13
|
-
answer:
|
|
14
|
-
body:
|
|
15
|
-
error:
|
|
16
|
-
},
|
|
17
|
-
children:
|
|
18
|
-
className:
|
|
19
|
-
variant:
|
|
20
|
-
}) => /* @__PURE__ */
|
|
21
|
-
className:
|
|
7
|
+
sidebar: m,
|
|
8
|
+
"center-aligned": "_center-aligned_10210_17",
|
|
9
|
+
"top-aligned": "_top-aligned_10210_24",
|
|
10
|
+
welcomeMessage: l,
|
|
11
|
+
contentCard: g,
|
|
12
|
+
question: u,
|
|
13
|
+
answer: C,
|
|
14
|
+
body: b,
|
|
15
|
+
error: f
|
|
16
|
+
}, w = ({
|
|
17
|
+
children: r,
|
|
18
|
+
className: a,
|
|
19
|
+
variant: n = "modal"
|
|
20
|
+
}) => /* @__PURE__ */ s("div", {
|
|
21
|
+
className: t(e.mediaContainer, e[a], n === "sidebar" && e.sidebar),
|
|
22
22
|
"data-testid": "content-answers-grid-card",
|
|
23
|
-
children:
|
|
24
|
-
}), o =
|
|
23
|
+
children: r
|
|
24
|
+
}), o = w;
|
|
25
25
|
o.Figure = ({
|
|
26
|
-
children:
|
|
27
|
-
isUsedInsideSidebar:
|
|
28
|
-
variant:
|
|
29
|
-
}) => /* @__PURE__ */
|
|
30
|
-
className:
|
|
31
|
-
children:
|
|
26
|
+
children: r,
|
|
27
|
+
isUsedInsideSidebar: a = !1,
|
|
28
|
+
variant: n
|
|
29
|
+
}) => /* @__PURE__ */ s("div", {
|
|
30
|
+
className: t(e.figure, e[n], a && e.sidebar),
|
|
31
|
+
children: r
|
|
32
32
|
});
|
|
33
33
|
o.Content = ({
|
|
34
|
-
children:
|
|
35
|
-
isUsedInsideSidebar:
|
|
36
|
-
variant:
|
|
34
|
+
children: r,
|
|
35
|
+
isUsedInsideSidebar: a = !1,
|
|
36
|
+
variant: n,
|
|
37
37
|
shouldAddCard: i = !0
|
|
38
|
-
}) => /* @__PURE__ */
|
|
39
|
-
className:
|
|
40
|
-
children: i ? /* @__PURE__ */
|
|
38
|
+
}) => /* @__PURE__ */ s("div", {
|
|
39
|
+
className: t(e.body, e[n], a && e.sidebar),
|
|
40
|
+
children: i ? /* @__PURE__ */ s(d, {
|
|
41
41
|
className: e.contentCard,
|
|
42
|
-
children:
|
|
43
|
-
}) :
|
|
42
|
+
children: r
|
|
43
|
+
}) : r
|
|
44
44
|
});
|
|
45
45
|
export {
|
|
46
46
|
o as MediaContainer,
|
|
47
|
-
|
|
47
|
+
w as MediaContainerBase,
|
|
48
48
|
o as default
|
|
49
49
|
};
|
|
@@ -2,18 +2,18 @@ import { LoadingIndicator as F } from "@box/blueprint-web";
|
|
|
2
2
|
import M from "clsx";
|
|
3
3
|
import * as t from "react";
|
|
4
4
|
import { useIntl as S } from "react-intl";
|
|
5
|
-
import
|
|
6
|
-
import { C as
|
|
7
|
-
import { jsx as n, jsxs as
|
|
8
|
-
import { ModalError as
|
|
9
|
-
import { Chat as
|
|
10
|
-
import '../../../../styles/content.css';const
|
|
11
|
-
loadingIndicatorWrapper:
|
|
12
|
-
content:
|
|
13
|
-
sidebar:
|
|
14
|
-
isLoading:
|
|
15
|
-
messagesEnd:
|
|
16
|
-
innerContent:
|
|
5
|
+
import k from "../../messages.js";
|
|
6
|
+
import { C as y } from "../../../../chunks/types.js";
|
|
7
|
+
import { jsx as n, jsxs as H, Fragment as V } from "react/jsx-runtime";
|
|
8
|
+
import { ModalError as A } from "../modal-error/modal-error.js";
|
|
9
|
+
import { Chat as B } from "../chat/chat.js";
|
|
10
|
+
import '../../../../styles/content.css';const D = "_loadingIndicatorWrapper_1juw3_1", G = "_content_1juw3_5", J = "_sidebar_1juw3_14", K = "_isLoading_1juw3_17", Q = "_messagesEnd_1juw3_21", U = "_innerContent_1juw3_25", r = {
|
|
11
|
+
loadingIndicatorWrapper: D,
|
|
12
|
+
content: G,
|
|
13
|
+
sidebar: J,
|
|
14
|
+
isLoading: K,
|
|
15
|
+
messagesEnd: Q,
|
|
16
|
+
innerContent: U
|
|
17
17
|
}, ne = ({
|
|
18
18
|
error: u,
|
|
19
19
|
hasCustomSuggestedQuestions: C,
|
|
@@ -26,73 +26,73 @@ import '../../../../styles/content.css';const B = "_loadingIndicatorWrapper_1qws
|
|
|
26
26
|
suggestedQuestions: R,
|
|
27
27
|
askSuggestedQuestion: b,
|
|
28
28
|
setAskSuggestedQuestion: v,
|
|
29
|
-
useAnimation:
|
|
29
|
+
useAnimation: j,
|
|
30
30
|
variant: _ = "modal",
|
|
31
|
-
hostAppName:
|
|
32
|
-
...
|
|
31
|
+
hostAppName: I = "",
|
|
32
|
+
...L
|
|
33
33
|
}) => {
|
|
34
|
-
const d = t.useRef(null), l = t.useRef(null), f = t.useRef(null),
|
|
35
|
-
formatMessage:
|
|
36
|
-
} = S(), E = u ===
|
|
34
|
+
const d = t.useRef(null), l = t.useRef(null), f = t.useRef(null), o = t.useRef(!0), [g, N] = t.useState(!1), {
|
|
35
|
+
formatMessage: O
|
|
36
|
+
} = S(), E = u === y.LARGE_FILE, s = t.useCallback((a) => {
|
|
37
37
|
var e;
|
|
38
|
-
(e = f.current) != null && e.scrollIntoView && l.current && (!i ||
|
|
38
|
+
(e = f.current) != null && e.scrollIntoView && l.current && (!i || o.current) && f.current.scrollIntoView({
|
|
39
39
|
behavior: a,
|
|
40
40
|
block: "nearest"
|
|
41
41
|
});
|
|
42
|
-
}, [i]),
|
|
42
|
+
}, [i]), x = () => {
|
|
43
43
|
if (l.current) {
|
|
44
44
|
const {
|
|
45
45
|
scrollTop: a,
|
|
46
46
|
clientHeight: e,
|
|
47
|
-
scrollHeight:
|
|
48
|
-
} = l.current,
|
|
49
|
-
if (c &&
|
|
50
|
-
|
|
47
|
+
scrollHeight: T
|
|
48
|
+
} = l.current, W = T - (a + e);
|
|
49
|
+
if (c && W > 100) {
|
|
50
|
+
o.current = !1;
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
o.current = !0;
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
t.useEffect(() => {
|
|
57
|
-
g ?
|
|
58
|
-
}, [g,
|
|
59
|
-
|
|
60
|
-
}, [
|
|
57
|
+
g ? o.current = !1 : c && (o.current = !0, s("instant"));
|
|
58
|
+
}, [g, s, c]), t.useEffect(() => {
|
|
59
|
+
o.current = !0, s("instant");
|
|
60
|
+
}, [s]), t.useLayoutEffect(() => {
|
|
61
61
|
if (!d.current)
|
|
62
62
|
return;
|
|
63
63
|
const a = new ResizeObserver(() => {
|
|
64
|
-
|
|
64
|
+
s(i ? "instant" : "smooth");
|
|
65
65
|
}), e = d.current;
|
|
66
66
|
return e && a.observe(e), () => {
|
|
67
67
|
e && a.unobserve(e);
|
|
68
68
|
};
|
|
69
|
-
}, [
|
|
70
|
-
const
|
|
69
|
+
}, [s, i]);
|
|
70
|
+
const z = () => h && !E ? /* @__PURE__ */ n(A, {
|
|
71
71
|
error: u,
|
|
72
72
|
recordAction: m
|
|
73
73
|
}) : p ? /* @__PURE__ */ n("div", {
|
|
74
74
|
className: r.loadingIndicatorWrapper,
|
|
75
75
|
children: /* @__PURE__ */ n(F, {
|
|
76
|
-
"aria-label":
|
|
76
|
+
"aria-label": O(k.loading),
|
|
77
77
|
className: r.loadingIndicator,
|
|
78
78
|
"data-testid": "content-answers-modal-loading-indicator",
|
|
79
79
|
size: "large"
|
|
80
80
|
})
|
|
81
|
-
}) : /* @__PURE__ */
|
|
82
|
-
children: [/* @__PURE__ */ n(
|
|
81
|
+
}) : /* @__PURE__ */ H(V, {
|
|
82
|
+
children: [/* @__PURE__ */ n(B, {
|
|
83
83
|
askSuggestedQuestion: b,
|
|
84
84
|
hasCustomSuggestedQuestions: C,
|
|
85
85
|
hasRequestInProgress: c,
|
|
86
|
-
hostAppName:
|
|
86
|
+
hostAppName: I,
|
|
87
87
|
isFileSizeError: E,
|
|
88
|
-
onDropdownOpenChange:
|
|
88
|
+
onDropdownOpenChange: N,
|
|
89
89
|
questions: w,
|
|
90
90
|
recordAction: m,
|
|
91
91
|
setAskSuggestedQuestion: v,
|
|
92
92
|
suggestedQuestions: R,
|
|
93
|
-
useAnimation:
|
|
93
|
+
useAnimation: j,
|
|
94
94
|
variant: _,
|
|
95
|
-
...
|
|
95
|
+
...L
|
|
96
96
|
}), /* @__PURE__ */ n("div", {
|
|
97
97
|
ref: f,
|
|
98
98
|
className: r.messagesEnd
|
|
@@ -102,11 +102,11 @@ import '../../../../styles/content.css';const B = "_loadingIndicatorWrapper_1qws
|
|
|
102
102
|
ref: l,
|
|
103
103
|
className: M(r.content, _ === "sidebar" && r.sidebar, p && r.isLoading),
|
|
104
104
|
"data-testid": "content-answers-content",
|
|
105
|
-
onScroll:
|
|
105
|
+
onScroll: x,
|
|
106
106
|
children: /* @__PURE__ */ n("div", {
|
|
107
107
|
ref: d,
|
|
108
108
|
className: r.innerContent,
|
|
109
|
-
children:
|
|
109
|
+
children: z()
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
112
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { FilterChip as o } from "@box/blueprint-web";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import u from "clsx";
|
|
3
|
+
import c from "lodash/noop";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
import '../../../../styles/suggestions.css';const m = "
|
|
5
|
+
import '../../../../styles/suggestions.css';const m = "_suggestions_1d1b9_1", w = "_suggestion_1d1b9_1", e = {
|
|
6
6
|
suggestions: m,
|
|
7
7
|
suggestion: w
|
|
8
|
-
},
|
|
9
|
-
askSuggestedQuestion:
|
|
8
|
+
}, _ = ({
|
|
9
|
+
askSuggestedQuestion: i,
|
|
10
10
|
isLoading: g,
|
|
11
11
|
onSuggestedQuestionClick: a,
|
|
12
|
-
onSuggestedQuestionInteraction: r =
|
|
12
|
+
onSuggestedQuestionInteraction: r = c,
|
|
13
13
|
suggestedQuestions: l,
|
|
14
14
|
variant: p = "modal"
|
|
15
15
|
}) => {
|
|
16
|
-
const
|
|
16
|
+
const d = (s) => {
|
|
17
17
|
(s.key === "ArrowUp" || s.key === "ArrowDown" || s.key === "ArrowLeft" || s.key === "ArrowRight") && s.stopPropagation();
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ t(o.Group, {
|
|
20
|
-
className:
|
|
20
|
+
className: u(e.suggestions, p === "sidebar" && e.sidebar),
|
|
21
21
|
"data-testid": "content-answers-suggested-questions",
|
|
22
22
|
name: "Singleselect SuggestedQuestions",
|
|
23
|
-
onKeyDown:
|
|
23
|
+
onKeyDown: d,
|
|
24
24
|
type: "single",
|
|
25
|
-
value:
|
|
25
|
+
value: i,
|
|
26
26
|
children: l.map((s) => {
|
|
27
|
-
const
|
|
27
|
+
const n = s.label || s.prompt;
|
|
28
28
|
return /* @__PURE__ */ t(o.ChipButton, {
|
|
29
29
|
className: e.suggestion,
|
|
30
30
|
"data-testid": `content-answers-${s.id}`,
|
|
@@ -32,15 +32,15 @@ import '../../../../styles/suggestions.css';const m = "_suggestions_8u37i_1", w
|
|
|
32
32
|
onClick: () => a(s.prompt),
|
|
33
33
|
onFocus: r,
|
|
34
34
|
onMouseEnter: r,
|
|
35
|
-
value:
|
|
35
|
+
value: n,
|
|
36
36
|
children: /* @__PURE__ */ t(o.Label, {
|
|
37
|
-
children:
|
|
37
|
+
children: n
|
|
38
38
|
})
|
|
39
39
|
}, s.id);
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
_ as Suggestions,
|
|
45
|
+
_ as default
|
|
46
46
|
};
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FormattedMessage as
|
|
3
|
-
import { ItemsDropdown as
|
|
1
|
+
import f from "clsx";
|
|
2
|
+
import { FormattedMessage as l } from "react-intl";
|
|
3
|
+
import { ItemsDropdown as g } from "./items-dropdown.js";
|
|
4
4
|
import m from "./messages.js";
|
|
5
5
|
import { jsxs as w, jsx as s } from "react/jsx-runtime";
|
|
6
|
-
import '../../../../styles/contextual-items-message.css';const D = "
|
|
6
|
+
import '../../../../styles/contextual-items-message.css';const D = "_commonWelcomeTextStyles_16t3n_1", L = "_fileLandingText_16t3n_1", u = "_welcomeFileDataLandingText_16t3n_1", b = "_askQuestionText_16t3n_1", N = "_sidebar_16t3n_4", k = "_itemsDropdown_16t3n_38", t = {
|
|
7
7
|
commonWelcomeTextStyles: D,
|
|
8
8
|
fileLandingText: L,
|
|
9
9
|
welcomeFileDataLandingText: u,
|
|
10
10
|
askQuestionText: b,
|
|
11
|
-
sidebar:
|
|
12
|
-
itemsDropdown:
|
|
13
|
-
},
|
|
11
|
+
sidebar: N,
|
|
12
|
+
itemsDropdown: k
|
|
13
|
+
}, W = ({
|
|
14
14
|
contentName: c,
|
|
15
15
|
isUsedInsideSidebar: d = !1,
|
|
16
16
|
onDropdownOpenChange: x,
|
|
17
17
|
onItemClick: r,
|
|
18
18
|
parentItem: e,
|
|
19
|
-
shouldShowLandingPage:
|
|
20
|
-
supportedItems:
|
|
19
|
+
shouldShowLandingPage: o,
|
|
20
|
+
supportedItems: n
|
|
21
21
|
}) => {
|
|
22
|
-
var
|
|
23
|
-
const
|
|
22
|
+
var a;
|
|
23
|
+
const T = n.length || 1, _ = ((a = n[0]) == null ? void 0 : a.name) || c, i = (e == null ? void 0 : e.id) !== "0" ? e == null ? void 0 : e.name : void 0;
|
|
24
24
|
return /* @__PURE__ */ w("div", {
|
|
25
|
-
className:
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
25
|
+
className: f({
|
|
26
|
+
[t.askQuestionText]: !o,
|
|
27
|
+
[t.welcomeFileDataLandingText]: o,
|
|
28
|
+
[t.sidebar]: d
|
|
29
29
|
}),
|
|
30
30
|
children: [/* @__PURE__ */ s("div", {
|
|
31
|
-
className:
|
|
31
|
+
className: t.welcomeText,
|
|
32
32
|
children: /* @__PURE__ */ s("b", {
|
|
33
|
-
children: /* @__PURE__ */ s(
|
|
33
|
+
children: /* @__PURE__ */ s(l, {
|
|
34
34
|
...m.welcomeAskQuestionLandingText
|
|
35
35
|
})
|
|
36
36
|
})
|
|
37
37
|
}), /* @__PURE__ */ s("div", {
|
|
38
|
-
className:
|
|
39
|
-
children: /* @__PURE__ */ s(
|
|
38
|
+
className: t.fileLandingText,
|
|
39
|
+
children: /* @__PURE__ */ s(l, {
|
|
40
40
|
...m.fileLandingText,
|
|
41
41
|
values: {
|
|
42
|
-
firstItemName:
|
|
43
|
-
parentItem:
|
|
44
|
-
numberOfItems:
|
|
45
|
-
files: /* @__PURE__ */ s(
|
|
46
|
-
className:
|
|
42
|
+
firstItemName: _,
|
|
43
|
+
parentItem: i && `'${i}'`,
|
|
44
|
+
numberOfItems: T,
|
|
45
|
+
files: /* @__PURE__ */ s(g, {
|
|
46
|
+
className: t.itemsDropdown,
|
|
47
47
|
onDropdownOpenChange: x,
|
|
48
48
|
onItemClick: r,
|
|
49
|
-
supportedItems:
|
|
49
|
+
supportedItems: n
|
|
50
50
|
})
|
|
51
51
|
}
|
|
52
52
|
})
|
|
@@ -54,6 +54,6 @@ import '../../../../styles/contextual-items-message.css';const D = "_commonWelco
|
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
W as ContextualItemsMessage,
|
|
58
|
+
W as default
|
|
59
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._agentSelector_avzc4_1{margin-left:.75rem}._agentStatus_avzc4_5{margin-left:.5rem}._agentStatus_avzc4_5>span{background:linear-gradient(#f4f4f4 0,#f4f4f4 0) padding-box,linear-gradient(135deg,#fe01da,#2486fc) border-box;border:.0625rem solid rgba(0,0,0,0)}._agentStatus_avzc4_5>span span{color:transparent;text-transform:uppercase;background:linear-gradient(135deg,#fe01da,#2486fc);-webkit-background-clip:text;background-clip:text}._agentList_avzc4_19 ._agentListItem_avzc4_19{grid-template-areas:"head" "subtitle";grid-template-columns:auto}
|
package/dist/styles/answer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._answer_18szz_1{white-space:pre-wrap;border:none}._answer_18szz_1 ._alertIcon_18szz_5{margin-left:.5rem}._answer_18szz_1 ._error_18szz_8{display:flex;align-items:center}._answer_18szz_1 ._footer_18szz_12{display:flex;align-items:center;justify-content:space-between;height:1.5rem}._answer_18szz_1 ._footer_18szz_12 ._copyButtonContainer_18szz_18,._answer_18szz_1 ._footer_18szz_12 ._feedbackButtonsContainer_18szz_19{opacity:0;transition:opacity .3s}._answer_18szz_1 ._footer_18szz_12._shouldHaveMarginTop_18szz_23{margin-top:.75rem}._answer_18szz_1 ._footer_18szz_12._shouldUseAnimation_18szz_26{max-height:0;overflow-y:hidden}._answer_18szz_1 ._footer_18szz_12._shouldUseAnimation_18szz_26._shouldAnimateHeight_18szz_30{max-height:200px;transition:max-height 1s ease-in}._answer_18szz_1 ._footer_18szz_12 ._footerButtons_18szz_34,._answer_18szz_1 ._footer_18szz_12 ._feedbackButtonsContainer_18szz_19{display:flex;gap:.25rem;margin-inline-start:auto}._answer_18szz_1 ._iconAvatar_18szz_40{display:flex;align-items:center;justify-content:center;width:var(--size-16);height:var(--size-16);background-color:#faf5fe;border-radius:50%}@media (max-width: 374px){._answer_18szz_1 ._iconAvatar_18szz_40{width:var(--size-6);height:var(--size-6)}}._answer_18szz_1:hover ._copyButtonContainer_18szz_18,._answer_18szz_1:hover ._feedbackButtonsContainer_18szz_19,._answer_18szz_1 ._copyButtonContainer_18szz_18:focus-within,._answer_18szz_1 ._feedbackButtonsContainer_18szz_19:focus-within{opacity:1}._answer_18szz_1:hover ._copyButtonContainer_18szz_18>button,._answer_18szz_1:hover ._feedbackButtonsContainer_18szz_19>button,._answer_18szz_1 ._copyButtonContainer_18szz_18:focus-within>button,._answer_18szz_1 ._feedbackButtonsContainer_18szz_19:focus-within>button{outline-offset:-2px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1p5tb_1{width:100%;height:100%;container-type:inline-size;container-name:box-ai-sidebar}._contentAnswers_1p5tb_8{display:flex;flex-direction:column;flex-grow:1;height:100%;max-height:39.875rem;margin-top:0;padding:0;overflow:hidden;background-color:#fff}._contentAnswers_1p5tb_8._sidebar_1p5tb_19{max-height:unset}@media (max-width: 374px){._contentAnswers_1p5tb_8{flex-flow:column;max-height:unset;margin-bottom:0}}
|
package/dist/styles/chat.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._chat_77vqr_1 ._clearChatText_77vqr_1{margin:0 1rem;color:#6f6f6f;font-size:.75rem;line-height:.875rem}._chat_77vqr_1 ._landingPage_77vqr_7{display:flex;flex-direction:column;gap:2rem;align-items:center;justify-content:center;padding-top:2rem}._chat_77vqr_1 ._landingPage_77vqr_7 ._askQuestionText_77vqr_15{font-size:1.3125rem}._chat_77vqr_1 ._landingPage_77vqr_7 ._clearChatText_77vqr_1{margin:0;font-size:.9375rem;line-height:1.25rem}._chat_77vqr_1 ._landingPage_77vqr_7 ._iconAvatar_77vqr_23{display:flex;align-items:center;justify-content:center;width:var(--size-16);height:var(--size-16);background-color:#faf5fe;border-radius:50%;margin-top:2.625rem}@media (max-width: 374px){._chat_77vqr_1 ._landingPage_77vqr_7 ._iconAvatar_77vqr_23{width:var(--size-6);height:var(--size-6)}}._chat_77vqr_1 ._landingPage_77vqr_7._sidebar_77vqr_39 ._clearChatText_77vqr_1{font-size:.75rem;line-height:.875rem}._chat_77vqr_1 ._landingPage_77vqr_7._sidebar_77vqr_39 ._iconAvatar_77vqr_23{width:var(--size-12);height:var(--size-12);margin-top:.75rem}._chat_77vqr_1 ._landingPage_77vqr_7._sidebar_77vqr_39 ._iconAvatar_77vqr_23 svg{width:1.875rem;height:1.875rem}._chat_77vqr_1 ul{margin:0;padding:0;list-style:none}._chat_77vqr_1 ul li:last-of-type .footer-buttons-container>div{opacity:1}
|
package/dist/styles/content.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._loadingIndicatorWrapper_1juw3_1{width:100%}._content_1juw3_5{flex:1 1 auto;width:auto;max-height:35.375rem;overflow:auto;padding:0 1.5rem 1rem}._content_1juw3_5._sidebar_1juw3_14{padding:0 .75rem .75rem}._content_1juw3_5._isLoading_1juw3_17{display:flex;align-items:center}._content_1juw3_5 ._messagesEnd_1juw3_21{margin-bottom:-1.25rem;padding-bottom:1.25rem}._content_1juw3_5 ._innerContent_1juw3_25{width:100%}._content_1juw3_5._sidebar_1juw3_14{max-height:unset}@media (max-width: 374px){._content_1juw3_5{flex:1;max-height:unset;padding:1rem;overflow-x:hidden}._content_1juw3_5 ._messagesEnd_1juw3_21{margin-bottom:-1rem;padding-bottom:1rem}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._commonWelcomeTextStyles_16t3n_1 ._fileLandingText_16t3n_1,._welcomeFileDataLandingText_16t3n_1 ._fileLandingText_16t3n_1,._askQuestionText_16t3n_1 ._fileLandingText_16t3n_1{color:#6f6f6f}._commonWelcomeTextStyles_16t3n_1._sidebar_16t3n_4,._sidebar_16t3n_4._welcomeFileDataLandingText_16t3n_1,._sidebar_16t3n_4._askQuestionText_16t3n_1{font-size:1.125rem}._askQuestionText_16t3n_1{padding-top:1.75rem;padding-bottom:.75rem;font-size:1.125rem;line-height:1.5rem}._askQuestionText_16t3n_1 ._fileLandingText_16t3n_1{font-size:.9375rem}._askQuestionText_16t3n_1._sidebar_16t3n_4{padding-top:1.5rem}._welcomeFileDataLandingText_16t3n_1{display:flex;flex-direction:column;gap:0;align-items:center;justify-content:center;font-size:1.3125rem;line-height:2rem}._welcomeFileDataLandingText_16t3n_1 ._fileLandingText_16t3n_1{font-size:1.125rem;text-align:center}._welcomeFileDataLandingText_16t3n_1 ._fileLandingText_16t3n_1 a{font-size:1.125rem;text-decoration:none}._welcomeFileDataLandingText_16t3n_1 ._itemsDropdown_16t3n_38{font-size:.9375rem}._welcomeFileDataLandingText_16t3n_1._sidebar_16t3n_4{line-height:1.5rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._mediaContainer_10210_1{display:flex;align-items:flex-start;margin-top:1rem;margin-bottom:1rem}._mediaContainer_10210_1 ._figure_10210_7{flex:0 0 auto;align-self:flex-start;justify-self:flex-start;margin:.75rem .75rem 0 0;padding:0}._mediaContainer_10210_1 ._figure_10210_7._sidebar_10210_14{margin:0}._mediaContainer_10210_1 ._figure_10210_7._center-aligned_10210_17{align-self:center;margin:0 .75rem 0 0}._mediaContainer_10210_1 ._figure_10210_7._center-aligned_10210_17._sidebar_10210_14{align-self:flex-start}._mediaContainer_10210_1 ._figure_10210_7._top-aligned_10210_24{align-self:top;margin:0 .75rem 0 0}._mediaContainer_10210_1._sidebar_10210_14{flex-direction:column;gap:.5rem;margin-bottom:1.25rem}._mediaContainer_10210_1._welcomeMessage_10210_33{margin-top:0;margin-bottom:0}._mediaContainer_10210_1._welcomeMessage_10210_33 ._contentCard_10210_37{display:flex;flex-direction:column;gap:2rem}._mediaContainer_10210_1._question_10210_42{align-items:center;justify-content:flex-end;border-radius:1.5rem}._mediaContainer_10210_1._question_10210_42 ._figure_10210_7{align-self:center;margin:0 0 0 .75rem}._mediaContainer_10210_1._question_10210_42._sidebar_10210_14{margin-top:.75rem;margin-bottom:.75rem}._mediaContainer_10210_1._question_10210_42._sidebar_10210_14 ._figure_10210_7{align-self:flex-end}._mediaContainer_10210_1._question_10210_42 ._contentCard_10210_37{padding:.75rem 1rem;line-height:1.5rem;background-color:#ece9f8;border-radius:1.5rem}._mediaContainer_10210_1._answer_10210_64._sidebar_10210_14{margin-top:.75rem;margin-bottom:.75rem}._mediaContainer_10210_1 ._body_10210_68{min-width:0;word-wrap:break-word;word-break:break-word;overflow-wrap:break-word}._mediaContainer_10210_1 ._body_10210_68._answer_10210_64{width:100%;border:none}._mediaContainer_10210_1 ._body_10210_68._answer_10210_64 ._contentCard_10210_37{padding:.75rem 1rem;background-color:transparent;border:none;border-radius:1.5rem}._mediaContainer_10210_1 ._body_10210_68._answer_10210_64 ._contentCard_10210_37:hover{background-color:#f4f4f4}._mediaContainer_10210_1 ._body_10210_68._welcomeMessage_10210_33{width:100%;border:none}._mediaContainer_10210_1 ._body_10210_68._welcomeMessage_10210_33 ._contentCard_10210_37{margin:0 1rem;padding:0;background-color:transparent;border:none;border-radius:1.5rem}._mediaContainer_10210_1 ._body_10210_68._sidebar_10210_14._question_10210_42{align-self:flex-end}._mediaContainer_10210_1 ._body_10210_68._error_10210_102{display:flex;flex-wrap:wrap;align-items:center;box-sizing:border-box;width:unset;padding:.75rem 1rem;border-radius:1.75rem}._mediaContainer_10210_1 ._body_10210_68._error_10210_102:hover{background-color:#fdebee}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._suggestions_1d1b9_1{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:center}._suggestions_1d1b9_1 ._suggestion_1d1b9_1{height:auto;min-height:2.5rem;padding:.5rem 0;text-align:start;background-color:#faf5fe;border-radius:1.5rem}._suggestions_1d1b9_1 ._suggestion_1d1b9_1:hover:enabled{background-color:#f5ebfd}._suggestions_1d1b9_1 ._suggestion_1d1b9_1 span{font-size:.9375rem;line-height:1.5rem;white-space:normal;text-align:start}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._welcomeMessage_4b90d_1{font-size:1.3125rem}._welcomeMessage_4b90d_1 ._warnings_4b90d_4{display:flex;flex-direction:column;gap:.5rem}._welcomeMessage_4b90d_1 ._warnings_4b90d_4 ._warningNotice_4b90d_9{border-radius:1.5rem}._welcomeMessage_4b90d_1 ._iconAvatar_4b90d_12{display:flex;align-items:center;justify-content:center;width:var(--size-16);height:var(--size-16);background-color:#faf5fe;border-radius:50%}@media (max-width: 374px){._welcomeMessage_4b90d_1 ._iconAvatar_4b90d_12{width:var(--size-6);height:var(--size-6)}}@media (max-width: 374px){._welcomeMessage_4b90d_1{margin-top:0}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.115.
|
|
3
|
+
"version": "0.115.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.35.0",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
19
|
-
"@box/blueprint-web": "^11.0.
|
|
20
|
-
"@box/blueprint-web-assets": "^4.39.
|
|
21
|
-
"@box/box-ai-agent-selector": "^0.36.
|
|
22
|
-
"@box/item-icon": "^0.9.
|
|
23
|
-
"@box/storybook-utils": "^0.9.
|
|
19
|
+
"@box/blueprint-web": "^11.0.1",
|
|
20
|
+
"@box/blueprint-web-assets": "^4.39.2",
|
|
21
|
+
"@box/box-ai-agent-selector": "^0.36.1",
|
|
22
|
+
"@box/item-icon": "^0.9.111",
|
|
23
|
+
"@box/storybook-utils": "^0.9.1",
|
|
24
24
|
"@testing-library/react": "^15.0.6",
|
|
25
25
|
"react": "^18.3.0",
|
|
26
26
|
"react-dom": "^18.3.0",
|