@box/box-ai-content-answers 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/clear-conversation-button.js +25 -22
- package/dist/chunks/stopResponseButton.js +8 -8
- package/dist/esm/lib/components/answer/copy-button.js +27 -24
- package/dist/esm/lib/components/answer/no-citations.js +22 -19
- package/dist/esm/lib/components/answer/thumb-buttons.js +85 -79
- package/dist/esm/lib/components/modal/clear-conversation-button.js +4 -3
- package/dist/esm/lib/components/modal/modal.js +114 -111
- package/dist/esm/lib/components/sidebar/content.js +100 -97
- package/dist/styles/stopResponseButton.css +1 -1
- package/package.json +6 -6
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
import { Tooltip as
|
|
2
|
-
import { Trash as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { useBlueprintModernization as c, Tooltip as i, IconButton as d } from "@box/blueprint-web";
|
|
2
|
+
import { Trash as _ } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { Trash as m } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
|
+
import b from "clsx";
|
|
5
|
+
import { useIntl as C } from "react-intl";
|
|
5
6
|
import t from "../esm/lib/components/modal/messages.js";
|
|
6
7
|
import { jsx as e } from "react/jsx-runtime";
|
|
7
|
-
import '../styles/clear-conversation-button.css';const
|
|
8
|
-
BoxAIIconColor:
|
|
9
|
-
modalHeader:
|
|
10
|
-
contentAnswersModal:
|
|
11
|
-
boxAiContentAnswers:
|
|
12
|
-
clearButton:
|
|
8
|
+
import '../styles/clear-conversation-button.css';const g = "_BoxAIIconColor_ild3b_1", A = "_modalHeader_ild3b_5", u = "_contentAnswersModal_ild3b_10", p = "_boxAiContentAnswers_ild3b_18", B = "_clearButton_ild3b_26", I = "_contentAnswerModal_ild3b_1", M = "_modalHeaderContainer_ild3b_55", f = "_agentSelectorTrigger_ild3b_63", w = "_agentSelectorContent_ild3b_74", x = {
|
|
9
|
+
BoxAIIconColor: g,
|
|
10
|
+
modalHeader: A,
|
|
11
|
+
contentAnswersModal: u,
|
|
12
|
+
boxAiContentAnswers: p,
|
|
13
|
+
clearButton: B,
|
|
13
14
|
"modal-close-button": "_modal-close-button_ild3b_30",
|
|
14
|
-
contentAnswerModal:
|
|
15
|
-
modalHeaderContainer:
|
|
16
|
-
agentSelectorTrigger:
|
|
17
|
-
agentSelectorContent:
|
|
18
|
-
},
|
|
15
|
+
contentAnswerModal: I,
|
|
16
|
+
modalHeaderContainer: M,
|
|
17
|
+
agentSelectorTrigger: f,
|
|
18
|
+
agentSelectorContent: w
|
|
19
|
+
}, j = ({
|
|
19
20
|
onClick: n,
|
|
20
21
|
hasRequestInProgress: a,
|
|
21
22
|
className: r
|
|
22
23
|
}) => {
|
|
23
|
-
const o =
|
|
24
|
-
|
|
24
|
+
const o = C(), {
|
|
25
|
+
enableModernizedComponents: s
|
|
26
|
+
} = c(), l = s ? m : _;
|
|
27
|
+
return /* @__PURE__ */ e(i, {
|
|
25
28
|
content: o.formatMessage(t.clearConversationLabel),
|
|
26
29
|
"data-testid": "clear-conversation-tooltip",
|
|
27
30
|
variant: "standard",
|
|
28
|
-
children: /* @__PURE__ */ e(
|
|
31
|
+
children: /* @__PURE__ */ e(d, {
|
|
29
32
|
"aria-label": o.formatMessage(t.clearConversationLabel),
|
|
30
|
-
className:
|
|
33
|
+
className: b(x.clearButton, r),
|
|
31
34
|
"data-testid": "clear-conversation-button",
|
|
32
35
|
disabled: a,
|
|
33
|
-
icon:
|
|
36
|
+
icon: l,
|
|
34
37
|
onClick: n,
|
|
35
38
|
size: "small",
|
|
36
39
|
"data-target-id": "IconButton-clearConversationLabel"
|
|
@@ -38,6 +41,6 @@ import '../styles/clear-conversation-button.css';const _ = "_BoxAIIconColor_ild3
|
|
|
38
41
|
});
|
|
39
42
|
};
|
|
40
43
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
j as C,
|
|
45
|
+
x as s
|
|
43
46
|
};
|
|
@@ -2,13 +2,13 @@ import * as p from "react";
|
|
|
2
2
|
import { useIntl as u } from "react-intl";
|
|
3
3
|
import { Tooltip as _, Button as m } from "@box/blueprint-web";
|
|
4
4
|
import { Stop as c } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
-
import { LOGGER_BASE_CONFIG as l, LOGGER_ACTION_CLICK as
|
|
5
|
+
import { LOGGER_BASE_CONFIG as l, LOGGER_ACTION_CLICK as x } from "../esm/lib/components/common/constants.js";
|
|
6
6
|
import e from "../esm/lib/components/footer/messages.js";
|
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
import '../styles/stopResponseButton.css';const
|
|
9
|
-
questionInput:
|
|
10
|
-
questionInputWithOutPromptLibrary:
|
|
11
|
-
avatar:
|
|
8
|
+
import '../styles/stopResponseButton.css';const B = "_questionInput_w27x6_2", b = "_questionInputWithOutPromptLibrary_w27x6_16", w = "_avatar_w27x6_31", d = "_inputAreaButton_w27x6_34", f = "_square_w27x6_56", C = "_textArea_w27x6_63", I = "_error_w27x6_86", q = "_sidebar_w27x6_89", R = "_submitButtonTooltip_w27x6_97", A = "_actionContainer_w27x6_106", O = "_promptButton_w27x6_112", g = {
|
|
9
|
+
questionInput: B,
|
|
10
|
+
questionInputWithOutPromptLibrary: b,
|
|
11
|
+
avatar: w,
|
|
12
12
|
inputAreaButton: d,
|
|
13
13
|
square: f,
|
|
14
14
|
textArea: C,
|
|
@@ -27,7 +27,7 @@ function S({
|
|
|
27
27
|
const s = u(), i = p.useCallback(() => {
|
|
28
28
|
t && t({
|
|
29
29
|
...l,
|
|
30
|
-
action:
|
|
30
|
+
action: x,
|
|
31
31
|
target: "stopResponse"
|
|
32
32
|
}), n(o);
|
|
33
33
|
}, [o, n, t]);
|
|
@@ -38,7 +38,7 @@ function S({
|
|
|
38
38
|
children: /* @__PURE__ */ r(m, {
|
|
39
39
|
"aria-label": s.formatMessage(e.stopResponse),
|
|
40
40
|
"aria-live": "polite",
|
|
41
|
-
className:
|
|
41
|
+
className: g.inputAreaButton,
|
|
42
42
|
"data-testid": "content-answers-stop-response-button",
|
|
43
43
|
icon: c,
|
|
44
44
|
onClick: i,
|
|
@@ -49,5 +49,5 @@ function S({
|
|
|
49
49
|
}
|
|
50
50
|
export {
|
|
51
51
|
S,
|
|
52
|
-
|
|
52
|
+
g as s
|
|
53
53
|
};
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import { useNotification as
|
|
2
|
-
import { Clipboard as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useNotification as d, useBlueprintModernization as b, Tooltip as u, IconButton as f } from "@box/blueprint-web";
|
|
2
|
+
import { Clipboard as C } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { Clipboard as g } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
|
+
import { useIntl as y } from "react-intl";
|
|
5
|
+
import T from "../../messages.js";
|
|
6
|
+
import { LOGGER_BASE_CONFIG as I, LOGGER_ACTION_CLICK as x } from "../common/constants.js";
|
|
7
|
+
import { focusInput as B } from "../common/focusInputUtils.js";
|
|
8
|
+
import { markdownToHtmlString as v } from "../common/markdown.js";
|
|
8
9
|
import a from "./messages.js";
|
|
9
|
-
import { jsx as
|
|
10
|
-
const
|
|
10
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
11
|
+
const E = ({
|
|
11
12
|
answer: t,
|
|
12
13
|
onAnswerCopy: r,
|
|
13
14
|
recordAction: e
|
|
14
15
|
}) => {
|
|
15
16
|
const {
|
|
16
17
|
formatMessage: o
|
|
17
|
-
} =
|
|
18
|
+
} = y(), {
|
|
18
19
|
addNotification: s
|
|
19
|
-
} =
|
|
20
|
+
} = d(), {
|
|
21
|
+
enableModernizedComponents: c
|
|
22
|
+
} = b(), l = async () => {
|
|
20
23
|
if (e && e({
|
|
21
|
-
...
|
|
22
|
-
action:
|
|
24
|
+
...I,
|
|
25
|
+
action: x,
|
|
23
26
|
target: "copyToClipboard"
|
|
24
27
|
}), t && navigator && navigator.clipboard && navigator.clipboard.write) {
|
|
25
|
-
const i =
|
|
28
|
+
const i = v(t), n = new ClipboardItem({
|
|
26
29
|
"text/html": new Blob([i], {
|
|
27
30
|
type: "text/html"
|
|
28
31
|
}),
|
|
@@ -30,22 +33,22 @@ const N = ({
|
|
|
30
33
|
type: "text/plain"
|
|
31
34
|
})
|
|
32
35
|
});
|
|
33
|
-
await navigator.clipboard.write([
|
|
36
|
+
await navigator.clipboard.write([n]), s({
|
|
34
37
|
sensitivity: "foreground",
|
|
35
38
|
styledText: o(a.copyToClipboardSucceeded),
|
|
36
39
|
variant: "success",
|
|
37
40
|
typeIconAriaLabel: o(a.copyButtonSuccessText),
|
|
38
|
-
closeButtonAriaLabel: o(
|
|
41
|
+
closeButtonAriaLabel: o(T.closeButtonText)
|
|
39
42
|
}), r && r(t);
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
B();
|
|
45
|
+
}, m = c ? g : C;
|
|
46
|
+
return /* @__PURE__ */ p(u, {
|
|
44
47
|
content: o(a.copyToClipboard),
|
|
45
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ p(f, {
|
|
46
49
|
"aria-label": o(a.copyToClipboard),
|
|
47
|
-
icon:
|
|
48
|
-
onClick:
|
|
50
|
+
icon: m,
|
|
51
|
+
onClick: l,
|
|
49
52
|
onFocusCapture: (i) => {
|
|
50
53
|
i.target.matches(":focus-visible") || i.stopPropagation();
|
|
51
54
|
},
|
|
@@ -55,6 +58,6 @@ const N = ({
|
|
|
55
58
|
});
|
|
56
59
|
};
|
|
57
60
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
E as CopyButton,
|
|
62
|
+
E as default
|
|
60
63
|
};
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { Tooltip as
|
|
2
|
-
import { InfoBadge as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
import { useBlueprintModernization as s, Tooltip as a, IconButton as i } from "@box/blueprint-web";
|
|
2
|
+
import { InfoBadge as f } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { InformationCircle as c } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
|
+
import { useEffect as m } from "react";
|
|
5
|
+
import { useIntl as l } from "react-intl";
|
|
6
|
+
import { LOGGER_BASE_CONFIG as p } from "../common/constants.js";
|
|
7
|
+
import d from "./messages.js";
|
|
8
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
9
|
+
const z = ({
|
|
9
10
|
recordAction: e
|
|
10
11
|
}) => {
|
|
11
12
|
const {
|
|
12
|
-
formatMessage:
|
|
13
|
-
} =
|
|
14
|
-
|
|
13
|
+
formatMessage: t
|
|
14
|
+
} = l(), {
|
|
15
|
+
enableModernizedComponents: r
|
|
16
|
+
} = s(), o = t(d.noReferences);
|
|
17
|
+
return m(() => {
|
|
15
18
|
e && e({
|
|
16
|
-
...
|
|
19
|
+
...p,
|
|
17
20
|
target: "noReferences"
|
|
18
21
|
});
|
|
19
|
-
}, [e]), /* @__PURE__ */
|
|
22
|
+
}, [e]), /* @__PURE__ */ n(a, {
|
|
20
23
|
className: "Answer-NoCitations",
|
|
21
|
-
content:
|
|
24
|
+
content: o,
|
|
22
25
|
"data-testid": "content-answers-references-no-references-tooltip",
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
"aria-label":
|
|
26
|
+
children: /* @__PURE__ */ n(i, {
|
|
27
|
+
"aria-label": o,
|
|
25
28
|
"data-testid": "content-answers-references-no-references",
|
|
26
|
-
icon:
|
|
29
|
+
icon: r ? c : f,
|
|
27
30
|
size: "x-small",
|
|
28
31
|
"data-target-id": "IconButton-noReferences"
|
|
29
32
|
})
|
|
30
33
|
});
|
|
31
34
|
};
|
|
32
35
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
z as NoCitationsIcon,
|
|
37
|
+
z as default
|
|
35
38
|
};
|
|
@@ -1,114 +1,120 @@
|
|
|
1
|
-
import { useNotification as
|
|
2
|
-
import { ThumbUp as
|
|
3
|
-
import { ThumbUp as
|
|
4
|
-
import {
|
|
1
|
+
import { useBlueprintModernization as J, useNotification as K, Tooltip as N, IconButton as y } from "@box/blueprint-web";
|
|
2
|
+
import { ThumbUp as Q, ThumbDown as V } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { ThumbUp as X, ThumbDown as Y } from "@box/blueprint-web-assets/icons/Line";
|
|
4
|
+
import { ThumbsUp as Z, ThumbsDown as C } from "@box/blueprint-web-assets/icons/Medium";
|
|
5
|
+
import { ThumbsUp as O, ThumbsDown as q } from "@box/blueprint-web-assets/icons/MediumFilled";
|
|
6
|
+
import { useAgents as k } from "@box/box-ai-agent-selector";
|
|
5
7
|
import b from "react";
|
|
6
|
-
import { useIntl as
|
|
7
|
-
import { LOGGER_BASE_CONFIG as
|
|
8
|
-
import { FeedbackTooltip as
|
|
8
|
+
import { useIntl as F } from "react-intl";
|
|
9
|
+
import { LOGGER_BASE_CONFIG as tt, LOGGER_ACTION_PROGRAMMATIC as st } from "../common/constants.js";
|
|
10
|
+
import { FeedbackTooltip as at } from "./feedback-tooltip.js";
|
|
9
11
|
import x from "../../messages.js";
|
|
10
|
-
import { focusInput as
|
|
11
|
-
import
|
|
12
|
-
import { jsxs as
|
|
13
|
-
import '../../../../styles/thumb-buttons.css';const
|
|
14
|
-
thumbDown:
|
|
15
|
-
},
|
|
12
|
+
import { focusInput as mt } from "../common/focusInputUtils.js";
|
|
13
|
+
import i from "./messages.js";
|
|
14
|
+
import { jsxs as ot, Fragment as lt, jsx as n } from "react/jsx-runtime";
|
|
15
|
+
import '../../../../styles/thumb-buttons.css';const ut = "_thumbDown_1axcd_1", rt = {
|
|
16
|
+
thumbDown: ut
|
|
17
|
+
}, r = {
|
|
16
18
|
THUMB_UP: "positive",
|
|
17
19
|
THUMB_DOWN: "negative",
|
|
18
20
|
NONE: "none"
|
|
19
|
-
},
|
|
21
|
+
}, Mt = ({
|
|
20
22
|
feedbackValue: H,
|
|
21
|
-
hostAppName:
|
|
22
|
-
isFeedbackFormEnabled:
|
|
23
|
-
isFeedbackTooltipOpen:
|
|
24
|
-
items:
|
|
25
|
-
onFeedbackFormSubmit:
|
|
23
|
+
hostAppName: h,
|
|
24
|
+
isFeedbackFormEnabled: I = !1,
|
|
25
|
+
isFeedbackTooltipOpen: P = !1,
|
|
26
|
+
items: U,
|
|
27
|
+
onFeedbackFormSubmit: D,
|
|
26
28
|
onFeedbackTooltipOpenChange: s,
|
|
27
|
-
prompt:
|
|
28
|
-
promptType:
|
|
29
|
+
prompt: p,
|
|
30
|
+
promptType: _,
|
|
29
31
|
questionId: a,
|
|
30
|
-
recordAction:
|
|
31
|
-
response:
|
|
32
|
+
recordAction: f,
|
|
33
|
+
response: B,
|
|
32
34
|
setAnswerFeedback: e,
|
|
33
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
35
|
+
shouldFeedbackFormIncludeFeedbackText: w = !1,
|
|
34
36
|
shouldFeedbackIncludePromptData: M = !1,
|
|
35
|
-
variant:
|
|
37
|
+
variant: d
|
|
36
38
|
}) => {
|
|
37
39
|
const {
|
|
38
|
-
|
|
39
|
-
} =
|
|
40
|
-
|
|
41
|
-
} =
|
|
42
|
-
|
|
43
|
-
} = K(),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
enableModernizedComponents: m
|
|
41
|
+
} = J(), {
|
|
42
|
+
formatMessage: o
|
|
43
|
+
} = F(), {
|
|
44
|
+
addNotification: v
|
|
45
|
+
} = K(), {
|
|
46
|
+
selectedAgent: L
|
|
47
|
+
} = k(), u = H, T = b.useMemo(() => U.filter((t) => t.status === "supported").map((t) => t.fileType), [U]), c = b.useCallback((t) => {
|
|
48
|
+
u !== t && (e == null || e(a, t), f == null || f({
|
|
49
|
+
...tt,
|
|
50
|
+
action: st,
|
|
47
51
|
target: "answer_feedback",
|
|
48
|
-
component:
|
|
52
|
+
component: d,
|
|
49
53
|
data: {
|
|
50
54
|
feedback_value: t,
|
|
51
|
-
file_types:
|
|
52
|
-
feature:
|
|
53
|
-
prompt_type:
|
|
55
|
+
file_types: T,
|
|
56
|
+
feature: h,
|
|
57
|
+
prompt_type: _
|
|
54
58
|
}
|
|
55
|
-
}),
|
|
56
|
-
}, [
|
|
59
|
+
}), mt());
|
|
60
|
+
}, [h, f, u, d, T, a, e, _]), G = ({
|
|
57
61
|
feedback: t,
|
|
58
|
-
feedbackPromptShareConsent:
|
|
59
|
-
issueType:
|
|
62
|
+
feedbackPromptShareConsent: j,
|
|
63
|
+
issueType: g
|
|
60
64
|
}) => {
|
|
61
|
-
if (s == null || s(!1, a), !
|
|
65
|
+
if (s == null || s(!1, a), !D)
|
|
62
66
|
return;
|
|
63
67
|
const l = {
|
|
64
|
-
fileTypes:
|
|
68
|
+
fileTypes: T,
|
|
65
69
|
hasPromptData: !1,
|
|
66
|
-
hostApp:
|
|
67
|
-
issueType:
|
|
70
|
+
hostApp: h,
|
|
71
|
+
issueType: g,
|
|
68
72
|
timestamp: Date.now(),
|
|
69
73
|
questionId: a
|
|
70
74
|
};
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
w && (l.feedback = t, l.hasFeedback = !!t), M && j && p && B && (l.hasPromptData = !0, l.prompt = p, l.response = B), L && (l.selectedAgentName = L.name), D(l, () => {
|
|
76
|
+
v({
|
|
73
77
|
sensitivity: "foreground",
|
|
74
|
-
styledText:
|
|
78
|
+
styledText: o(i.feedbackTooltipConfirmation),
|
|
75
79
|
variant: "success",
|
|
76
|
-
typeIconAriaLabel:
|
|
77
|
-
closeButtonAriaLabel:
|
|
80
|
+
typeIconAriaLabel: o(x.ariaTypeSuccessIconLabel),
|
|
81
|
+
closeButtonAriaLabel: o(x.closeButtonText)
|
|
78
82
|
});
|
|
79
83
|
});
|
|
80
|
-
},
|
|
84
|
+
}, R = (t) => {
|
|
81
85
|
t || s == null || s(!1, a);
|
|
82
|
-
},
|
|
83
|
-
c(
|
|
84
|
-
}, [c, s, a]);
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
children: [/* @__PURE__ */
|
|
87
|
-
content:
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
"aria-label":
|
|
90
|
-
disabled:
|
|
91
|
-
icon:
|
|
92
|
-
onClick:
|
|
86
|
+
}, S = b.useCallback(() => c(r.THUMB_UP), [c]), $ = b.useCallback(() => {
|
|
87
|
+
c(r.THUMB_DOWN), s == null || s(!0, a);
|
|
88
|
+
}, [c, s, a]), z = m ? Z : X, A = m ? C : Y, E = m ? O : Q, W = m ? q : V;
|
|
89
|
+
return /* @__PURE__ */ ot(lt, {
|
|
90
|
+
children: [/* @__PURE__ */ n(N, {
|
|
91
|
+
content: o(i.thumbsUpAriaLabel),
|
|
92
|
+
children: /* @__PURE__ */ n(y, {
|
|
93
|
+
"aria-label": o(i.thumbsUpAriaLabel),
|
|
94
|
+
disabled: u === r.THUMB_DOWN,
|
|
95
|
+
icon: u === r.THUMB_UP ? E : z,
|
|
96
|
+
onClick: S,
|
|
93
97
|
size: "x-small",
|
|
98
|
+
variant: m ? "icon-logo" : "default",
|
|
94
99
|
"data-target-id": "IconButton-thumbsUpAriaLabel"
|
|
95
100
|
})
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
-
isOpen:
|
|
98
|
-
onOpenChange:
|
|
99
|
-
onSubmit:
|
|
100
|
-
shouldIncludeFeedbackText:
|
|
101
|
+
}), /* @__PURE__ */ n(at, {
|
|
102
|
+
isOpen: P,
|
|
103
|
+
onOpenChange: R,
|
|
104
|
+
onSubmit: G,
|
|
105
|
+
shouldIncludeFeedbackText: w,
|
|
101
106
|
shouldIncludePromptShareConsent: M,
|
|
102
|
-
shouldShow:
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
-
content:
|
|
105
|
-
children: /* @__PURE__ */
|
|
106
|
-
"aria-label":
|
|
107
|
-
className:
|
|
108
|
-
disabled:
|
|
109
|
-
icon:
|
|
110
|
-
onClick:
|
|
107
|
+
shouldShow: I,
|
|
108
|
+
children: /* @__PURE__ */ n(N, {
|
|
109
|
+
content: o(i.thumbsDownAriaLabel),
|
|
110
|
+
children: /* @__PURE__ */ n(y, {
|
|
111
|
+
"aria-label": o(i.thumbsDownAriaLabel),
|
|
112
|
+
className: m ? "" : rt.thumbDown,
|
|
113
|
+
disabled: u === r.THUMB_UP,
|
|
114
|
+
icon: u === r.THUMB_DOWN ? W : A,
|
|
115
|
+
onClick: $,
|
|
111
116
|
size: "x-small",
|
|
117
|
+
variant: m ? "icon-logo" : "default",
|
|
112
118
|
"data-target-id": "IconButton-thumbsDownAriaLabel"
|
|
113
119
|
})
|
|
114
120
|
})
|
|
@@ -116,6 +122,6 @@ import '../../../../styles/thumb-buttons.css';const C = "_thumbDown_1axcd_1", q
|
|
|
116
122
|
});
|
|
117
123
|
};
|
|
118
124
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
Mt as ThumbButtons,
|
|
126
|
+
Mt as default
|
|
121
127
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "@box/blueprint-web";
|
|
2
2
|
import "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import "@box/blueprint-web-assets/icons/Medium";
|
|
3
4
|
import "clsx";
|
|
4
5
|
import "react-intl";
|
|
5
6
|
import "./messages.js";
|
|
6
|
-
import { C, C as
|
|
7
|
+
import { C as n, C as s } from "../../../../chunks/clear-conversation-button.js";
|
|
7
8
|
import "react/jsx-runtime";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
n as ClearConversationButton,
|
|
11
|
+
s as default
|
|
11
12
|
};
|
|
@@ -1,168 +1,171 @@
|
|
|
1
|
-
import { useBreakpoint as
|
|
2
|
-
import { ArrowsCollapse as
|
|
3
|
-
import { BoxAiLogo as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
1
|
+
import { useBlueprintModernization as Y, useBreakpoint as Z, Breakpoint as ee, Modal as m, TooltipProvider as oe, Tooltip as te } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsCollapse as se } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { BoxAiLogo as ae } from "@box/blueprint-web-assets/icons/Logo";
|
|
4
|
+
import { ArrowsMinimize as re } from "@box/blueprint-web-assets/icons/Medium";
|
|
5
|
+
import { Size8 as S } from "@box/blueprint-web-assets/tokens/tokens";
|
|
6
|
+
import { BoxAiAgentSelectorWithApi as le, AgentsProvider as ne } from "@box/box-ai-agent-selector";
|
|
7
|
+
import { useState as ie, useMemo as ce, useCallback as x, useEffect as p } from "react";
|
|
8
|
+
import { useIntl as de } from "react-intl";
|
|
9
|
+
import { BoxAiContentAnswers as me } from "../../box-ai-content-answers.js";
|
|
10
|
+
import { A as fe, R as ge } from "../../../../chunks/types.js";
|
|
11
|
+
import { LOGGER_BASE_CONFIG as M, LOGGER_ACTION_CLICK as ue } from "../common/constants.js";
|
|
12
|
+
import { s, C as Ce } from "../../../../chunks/clear-conversation-button.js";
|
|
13
|
+
import pe from "./hooks/useStopPropagationOnEsc.js";
|
|
14
|
+
import { Title as Me } from "./title.js";
|
|
15
|
+
import B from "./messages.js";
|
|
15
16
|
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
16
|
-
const
|
|
17
|
+
const he = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", Te = (o) => o ? B.collapseModalAriaLabel : B.closeModalAriaLabel, be = (o, r) => o ? r ? re : se : void 0, Ae = (o, r) => {
|
|
17
18
|
const l = o === "collapsible";
|
|
18
19
|
return {
|
|
19
|
-
closeModalLabel:
|
|
20
|
-
closeModalTargetId:
|
|
21
|
-
closeModalIcon:
|
|
20
|
+
closeModalLabel: Te(l),
|
|
21
|
+
closeModalTargetId: he(l),
|
|
22
|
+
closeModalIcon: be(l, r)
|
|
22
23
|
};
|
|
23
|
-
},
|
|
24
|
+
}, He = ({
|
|
24
25
|
children: o,
|
|
25
|
-
getAIStudioAgents:
|
|
26
|
-
hasCustomSuggestedQuestions:
|
|
27
|
-
hostAppName:
|
|
26
|
+
getAIStudioAgents: r,
|
|
27
|
+
hasCustomSuggestedQuestions: l,
|
|
28
|
+
hostAppName: f,
|
|
28
29
|
isAIStudioAgentSelectorEnabled: g = !1,
|
|
29
|
-
isDebugModeEnabled:
|
|
30
|
-
isStopResponseEnabled:
|
|
31
|
-
itemSize:
|
|
32
|
-
extension:
|
|
33
|
-
onClearAction:
|
|
34
|
-
onSelectAgent:
|
|
35
|
-
onSelectedAgentCallback:
|
|
36
|
-
promptValue:
|
|
37
|
-
recordAction:
|
|
30
|
+
isDebugModeEnabled: _,
|
|
31
|
+
isStopResponseEnabled: k = !1,
|
|
32
|
+
itemSize: T,
|
|
33
|
+
extension: b,
|
|
34
|
+
onClearAction: u,
|
|
35
|
+
onSelectAgent: P,
|
|
36
|
+
onSelectedAgentCallback: q,
|
|
37
|
+
promptValue: z,
|
|
38
|
+
recordAction: n,
|
|
38
39
|
setPromptValue: G,
|
|
39
40
|
shouldRenderProviders: H = !0,
|
|
40
|
-
shouldShowLandingPage:
|
|
41
|
-
stopPropagationOnEsc:
|
|
42
|
-
variant:
|
|
43
|
-
items:
|
|
44
|
-
parentItem:
|
|
45
|
-
...
|
|
41
|
+
shouldShowLandingPage: F = !1,
|
|
42
|
+
stopPropagationOnEsc: j,
|
|
43
|
+
variant: A = "closable",
|
|
44
|
+
items: c,
|
|
45
|
+
parentItem: d,
|
|
46
|
+
...D
|
|
46
47
|
}) => {
|
|
47
|
-
var
|
|
48
|
+
var v, I;
|
|
48
49
|
const {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
enableModernizedComponents: L
|
|
51
|
+
} = Y(), {
|
|
52
|
+
open: R,
|
|
53
|
+
defaultOpen: Q,
|
|
54
|
+
onOpenChange: U,
|
|
55
|
+
modal: W,
|
|
53
56
|
...a
|
|
54
|
-
} =
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
closeModalLabel:
|
|
58
|
-
closeModalTargetId:
|
|
59
|
-
closeModalIcon:
|
|
60
|
-
} =
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
...
|
|
57
|
+
} = D, O = de(), y = Z() <= ee.Medium;
|
|
58
|
+
pe(j, R);
|
|
59
|
+
const C = (I = (v = a == null ? void 0 : a.questions) == null ? void 0 : v[a.questions.length - 1]) == null ? void 0 : I.error, [K, w] = ie(!1), {
|
|
60
|
+
closeModalLabel: N,
|
|
61
|
+
closeModalTargetId: $,
|
|
62
|
+
closeModalIcon: J
|
|
63
|
+
} = ce(() => Ae(A, L), [A, L]), i = x((t) => {
|
|
64
|
+
n && (t.data ?? (t.data = {}), t.data.hostAppName = f, n(t));
|
|
65
|
+
}, [f, n]);
|
|
66
|
+
p(() => {
|
|
67
|
+
c || i({
|
|
68
|
+
...M,
|
|
66
69
|
target: "loaded",
|
|
67
70
|
data: {
|
|
68
|
-
fileSize:
|
|
69
|
-
fileType:
|
|
71
|
+
fileSize: T,
|
|
72
|
+
fileType: b
|
|
70
73
|
}
|
|
71
74
|
});
|
|
72
|
-
}, [
|
|
73
|
-
|
|
74
|
-
...
|
|
75
|
+
}, [i, b, T, c, n]), p(() => {
|
|
76
|
+
c && i({
|
|
77
|
+
...M,
|
|
75
78
|
target: "loaded",
|
|
76
79
|
data: {
|
|
77
|
-
parentItemType:
|
|
78
|
-
items:
|
|
80
|
+
parentItemType: d == null ? void 0 : d.type,
|
|
81
|
+
items: c.map((t) => ({
|
|
79
82
|
status: t.status,
|
|
80
83
|
fileType: t.fileType
|
|
81
84
|
}))
|
|
82
85
|
}
|
|
83
86
|
});
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
}, [
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
...
|
|
90
|
-
action:
|
|
87
|
+
}, [i, d, n]), p(() => {
|
|
88
|
+
C && C === fe.AGENT_NOT_FOUND && w(!0);
|
|
89
|
+
}, [C]);
|
|
90
|
+
const V = () => {
|
|
91
|
+
u && (u(), i({
|
|
92
|
+
...M,
|
|
93
|
+
action: ue,
|
|
91
94
|
target: "clearChat"
|
|
92
95
|
}));
|
|
93
|
-
},
|
|
94
|
-
defaultOpen:
|
|
95
|
-
modal:
|
|
96
|
-
onOpenChange:
|
|
97
|
-
open:
|
|
98
|
-
children: [/* @__PURE__ */ e(
|
|
96
|
+
}, X = x(async () => (w(!1), r()), [r]), E = /* @__PURE__ */ h(m, {
|
|
97
|
+
defaultOpen: Q,
|
|
98
|
+
modal: W,
|
|
99
|
+
onOpenChange: U,
|
|
100
|
+
open: R,
|
|
101
|
+
children: [/* @__PURE__ */ e(m.Trigger, {
|
|
99
102
|
children: o
|
|
100
|
-
}), /* @__PURE__ */ h(
|
|
103
|
+
}), /* @__PURE__ */ h(m.Content, {
|
|
101
104
|
className: s.contentAnswersModal,
|
|
102
105
|
"data-testid": "content-answers-modal",
|
|
103
106
|
size: "xlarge",
|
|
104
|
-
children: [/* @__PURE__ */ e(
|
|
107
|
+
children: [/* @__PURE__ */ e(m.Header, {
|
|
105
108
|
className: s.modalHeaderContainer,
|
|
106
109
|
children: /* @__PURE__ */ h("div", {
|
|
107
110
|
className: s.modalHeader,
|
|
108
|
-
children: [!
|
|
111
|
+
children: [!y && /* @__PURE__ */ e(ae, {
|
|
109
112
|
className: s.BoxAIIconColor,
|
|
110
113
|
"data-testid": "content-answers-icon-color",
|
|
111
|
-
height:
|
|
112
|
-
width:
|
|
113
|
-
}), /* @__PURE__ */ e(
|
|
114
|
+
height: S,
|
|
115
|
+
width: S
|
|
116
|
+
}), /* @__PURE__ */ e(Me, {
|
|
114
117
|
isAIStudioAgentSelectorEnabled: g
|
|
115
|
-
}), g && /* @__PURE__ */ e(
|
|
118
|
+
}), g && /* @__PURE__ */ e(le, {
|
|
116
119
|
contentClassName: s.agentSelectorContent,
|
|
117
120
|
disabled: a.hasRequestInProgress,
|
|
118
|
-
fetcher:
|
|
119
|
-
hostAppName:
|
|
120
|
-
onSelectAgent:
|
|
121
|
-
onSelectedAgentCallback:
|
|
122
|
-
recordAction:
|
|
123
|
-
requestState:
|
|
121
|
+
fetcher: X,
|
|
122
|
+
hostAppName: f,
|
|
123
|
+
onSelectAgent: P,
|
|
124
|
+
onSelectedAgentCallback: q,
|
|
125
|
+
recordAction: n,
|
|
126
|
+
requestState: K ? ge.ERROR : void 0,
|
|
124
127
|
shouldHideAgentSelectorOnLoad: !0,
|
|
125
128
|
triggerChipClassName: s.agentSelectorTrigger,
|
|
126
129
|
useAgentLocalStorage: !0
|
|
127
130
|
})]
|
|
128
131
|
})
|
|
129
|
-
}), /* @__PURE__ */ e(
|
|
132
|
+
}), /* @__PURE__ */ e(me, {
|
|
130
133
|
className: `box-content-answers-chat-container ${s.boxAiContentAnswers}`,
|
|
131
|
-
hasCustomSuggestedQuestions:
|
|
132
|
-
hostAppName:
|
|
134
|
+
hasCustomSuggestedQuestions: l,
|
|
135
|
+
hostAppName: f,
|
|
133
136
|
isAIStudioAgentSelectorEnabled: g,
|
|
134
|
-
isDebugModeEnabled:
|
|
135
|
-
isStopResponseEnabled:
|
|
136
|
-
items:
|
|
137
|
-
parentItem:
|
|
138
|
-
promptValue:
|
|
139
|
-
recordAction:
|
|
137
|
+
isDebugModeEnabled: _,
|
|
138
|
+
isStopResponseEnabled: k,
|
|
139
|
+
items: c,
|
|
140
|
+
parentItem: d,
|
|
141
|
+
promptValue: z,
|
|
142
|
+
recordAction: i,
|
|
140
143
|
setPromptValue: G,
|
|
141
|
-
shouldShowLandingPage:
|
|
144
|
+
shouldShowLandingPage: F,
|
|
142
145
|
...a
|
|
143
|
-
}),
|
|
146
|
+
}), u && /* @__PURE__ */ e(Ce, {
|
|
144
147
|
hasRequestInProgress: a.hasRequestInProgress,
|
|
145
|
-
onClick:
|
|
146
|
-
}), /* @__PURE__ */ e(
|
|
147
|
-
children: /* @__PURE__ */ e(
|
|
148
|
-
content:
|
|
148
|
+
onClick: V
|
|
149
|
+
}), /* @__PURE__ */ e(oe, {
|
|
150
|
+
children: /* @__PURE__ */ e(te, {
|
|
151
|
+
content: O.formatMessage(N),
|
|
149
152
|
"data-testid": "content-answers-close-modal-tooltip",
|
|
150
|
-
children: /* @__PURE__ */ e(
|
|
151
|
-
"aria-label":
|
|
153
|
+
children: /* @__PURE__ */ e(m.Close, {
|
|
154
|
+
"aria-label": O.formatMessage(N),
|
|
152
155
|
className: s["modal-close-button"],
|
|
153
|
-
"data-target-id":
|
|
154
|
-
icon:
|
|
156
|
+
"data-target-id": $,
|
|
157
|
+
icon: J,
|
|
155
158
|
size: "small"
|
|
156
159
|
})
|
|
157
160
|
})
|
|
158
161
|
})]
|
|
159
162
|
})]
|
|
160
163
|
});
|
|
161
|
-
return H ? /* @__PURE__ */ e(
|
|
162
|
-
children:
|
|
163
|
-
}) :
|
|
164
|
+
return H ? /* @__PURE__ */ e(ne, {
|
|
165
|
+
children: E
|
|
166
|
+
}) : E;
|
|
164
167
|
};
|
|
165
168
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
He as IntelligenceModal,
|
|
170
|
+
He as default
|
|
168
171
|
};
|
|
@@ -1,64 +1,65 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { ArrowsExpand as
|
|
3
|
-
import {
|
|
1
|
+
import { useBlueprintModernization as se, Text as ae, Tooltip as $, IconButton as y } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsExpand as ie, XMark as re } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { ArrowsMaximize as ce } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
|
+
import { useAgents as de, BoxAiAgentSelectorWithApi as le } from "@box/box-ai-agent-selector";
|
|
4
5
|
import D from "clsx";
|
|
5
|
-
import
|
|
6
|
+
import H from "lodash/isEqual";
|
|
6
7
|
import * as b from "react";
|
|
7
|
-
import { useIntl as
|
|
8
|
-
import { BoxAiContentAnswers as
|
|
9
|
-
import { withApiWrapper as
|
|
10
|
-
import { ORIGIN_BOXAI_SIDEBAR as
|
|
11
|
-
import { mark as
|
|
12
|
-
import { C as
|
|
13
|
-
import { IntelligenceModal as
|
|
14
|
-
import { IntelligenceSidebarContext as
|
|
8
|
+
import { useIntl as be } from "react-intl";
|
|
9
|
+
import { BoxAiContentAnswers as pe } from "../../box-ai-content-answers.js";
|
|
10
|
+
import { withApiWrapper as Se } from "../api-wrapper/api-wrapper.js";
|
|
11
|
+
import { ORIGIN_BOXAI_SIDEBAR as Ae, EVENT_JS_READY as me } from "../common/constants.js";
|
|
12
|
+
import { mark as he } from "../common/performance.js";
|
|
13
|
+
import { C as ue } from "../../../../chunks/clear-conversation-button.js";
|
|
14
|
+
import { IntelligenceModal as Ie } from "../modal/modal.js";
|
|
15
|
+
import { IntelligenceSidebarContext as _e } from "./context.js";
|
|
15
16
|
import p from "./messages.js";
|
|
16
|
-
import
|
|
17
|
-
import { jsxs as h, Fragment as
|
|
18
|
-
import '../../../../styles/content.css';const
|
|
19
|
-
bcsSidebarBase:
|
|
20
|
-
bcsContent:
|
|
21
|
-
bcsBoxAISidebar:
|
|
22
|
-
bcsContentHeader:
|
|
23
|
-
bcsTitle:
|
|
24
|
-
bcsScrollContent:
|
|
25
|
-
withModalOpen:
|
|
26
|
-
bcsBoxAISidebarAgentSelector:
|
|
27
|
-
bcsBoxAISidebarAgentSelectorContainer:
|
|
28
|
-
bcsBoxAISidebarChatActions:
|
|
29
|
-
bcsBoxAISidebarContent:
|
|
30
|
-
bcsBoxAISidebarExpand:
|
|
31
|
-
bcsBoxAISidebarClear:
|
|
32
|
-
bcsBoxAISidebarTitlePart:
|
|
33
|
-
bcsBoxAISidebarClose:
|
|
34
|
-
sidebarChip:
|
|
35
|
-
bcsContentSubheader:
|
|
36
|
-
bcsScrollContentWrapper:
|
|
37
|
-
withSubheader:
|
|
38
|
-
expanded:
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
const
|
|
17
|
+
import Ce from "./title.js";
|
|
18
|
+
import { jsxs as h, Fragment as Q, jsx as e } from "react/jsx-runtime";
|
|
19
|
+
import '../../../../styles/content.css';const xe = "_bcsSidebarBase_1kkpe_2", ge = "_bcsContent_1kkpe_2", Be = "_bcsBoxAISidebar_1kkpe_2", fe = "_bcsContentHeader_1kkpe_6", ke = "_bcsTitle_1kkpe_15", we = "_bcsScrollContent_1kkpe_22", Te = "_withModalOpen_1kkpe_32", Ee = "_bcsBoxAISidebarAgentSelector_1kkpe_35", Ne = "_bcsBoxAISidebarAgentSelectorContainer_1kkpe_39", Me = "_bcsBoxAISidebarChatActions_1kkpe_43", ve = "_bcsBoxAISidebarContent_1kkpe_47", Pe = "_bcsBoxAISidebarExpand_1kkpe_50", Le = "_bcsBoxAISidebarClear_1kkpe_53", Oe = "_bcsBoxAISidebarTitlePart_1kkpe_56", Re = "_bcsBoxAISidebarClose_1kkpe_77", qe = "_sidebarChip_1kkpe_88", Ue = "_bcsContentSubheader_1kkpe_101", Ve = "_bcsScrollContentWrapper_1kkpe_110", We = "_withSubheader_1kkpe_115", ze = "_expanded_1kkpe_118", t = {
|
|
20
|
+
bcsSidebarBase: xe,
|
|
21
|
+
bcsContent: ge,
|
|
22
|
+
bcsBoxAISidebar: Be,
|
|
23
|
+
bcsContentHeader: fe,
|
|
24
|
+
bcsTitle: ke,
|
|
25
|
+
bcsScrollContent: we,
|
|
26
|
+
withModalOpen: Te,
|
|
27
|
+
bcsBoxAISidebarAgentSelector: Ee,
|
|
28
|
+
bcsBoxAISidebarAgentSelectorContainer: Ne,
|
|
29
|
+
bcsBoxAISidebarChatActions: Me,
|
|
30
|
+
bcsBoxAISidebarContent: ve,
|
|
31
|
+
bcsBoxAISidebarExpand: Pe,
|
|
32
|
+
bcsBoxAISidebarClear: Le,
|
|
33
|
+
bcsBoxAISidebarTitlePart: Oe,
|
|
34
|
+
bcsBoxAISidebarClose: Re,
|
|
35
|
+
sidebarChip: qe,
|
|
36
|
+
bcsContentSubheader: Ue,
|
|
37
|
+
bcsScrollContentWrapper: Ve,
|
|
38
|
+
withSubheader: We,
|
|
39
|
+
expanded: ze
|
|
40
|
+
}, Fe = `${Ae}_${me}`;
|
|
41
|
+
he(Fe);
|
|
42
|
+
const $e = ({
|
|
42
43
|
actions: f,
|
|
43
44
|
children: i,
|
|
44
45
|
className: o,
|
|
45
46
|
elementId: S = "",
|
|
46
|
-
sidebarView:
|
|
47
|
+
sidebarView: u = "",
|
|
47
48
|
title: r,
|
|
48
49
|
subheader: c,
|
|
49
50
|
...d
|
|
50
51
|
}) => {
|
|
51
|
-
const A = `${S}${S === "" ? "" : "_"}${
|
|
52
|
+
const A = `${S}${S === "" ? "" : "_"}${u}`, I = `${A}-content`;
|
|
52
53
|
return /* @__PURE__ */ h("div", {
|
|
53
54
|
"aria-labelledby": A,
|
|
54
55
|
className: D(t.bcsContent, o),
|
|
55
56
|
"data-testid": "bcs-content",
|
|
56
|
-
id:
|
|
57
|
+
id: I,
|
|
57
58
|
role: "tabpanel",
|
|
58
59
|
...d,
|
|
59
60
|
children: [/* @__PURE__ */ h("div", {
|
|
60
61
|
className: t.bcsContentHeader,
|
|
61
|
-
children: [r && /* @__PURE__ */ e(
|
|
62
|
+
children: [r && /* @__PURE__ */ e(ae, {
|
|
62
63
|
as: "h3",
|
|
63
64
|
className: t.bcsTitle,
|
|
64
65
|
children: r
|
|
@@ -75,59 +76,61 @@ const We = ({
|
|
|
75
76
|
})]
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
|
-
function
|
|
79
|
+
function ye(f) {
|
|
79
80
|
const {
|
|
80
81
|
createSession: i,
|
|
81
82
|
encodedSession: o,
|
|
82
83
|
onClearAction: S,
|
|
83
|
-
getAIStudioAgents:
|
|
84
|
+
getAIStudioAgents: u,
|
|
84
85
|
hasRequestInProgress: r,
|
|
85
86
|
hostAppName: c,
|
|
86
87
|
isAIStudioAgentSelectorEnabled: d,
|
|
87
88
|
isLoading: A,
|
|
88
|
-
onSelectAgent:
|
|
89
|
+
onSelectAgent: I,
|
|
89
90
|
questions: _,
|
|
90
91
|
shouldShowLandingPage: N = !0,
|
|
91
92
|
sendQuestion: C,
|
|
92
93
|
stopQuestion: k,
|
|
93
94
|
embedTheAnswerButtonConfig: j,
|
|
94
|
-
onClose:
|
|
95
|
-
...
|
|
95
|
+
onClose: M,
|
|
96
|
+
...v
|
|
96
97
|
} = f, {
|
|
97
98
|
formatMessage: l
|
|
98
|
-
} =
|
|
99
|
+
} = be(), {
|
|
100
|
+
enableModernizedComponents: J
|
|
101
|
+
} = se(), P = b.useRef(!1), [w, L] = b.useState(!1), {
|
|
99
102
|
cache: s,
|
|
100
103
|
contentName: O,
|
|
101
|
-
elementId:
|
|
102
|
-
fileExtension:
|
|
104
|
+
elementId: X,
|
|
105
|
+
fileExtension: Y,
|
|
103
106
|
isFeedbackEnabled: R,
|
|
104
107
|
isFeedbackFormEnabled: q,
|
|
105
108
|
isStopResponseEnabled: U,
|
|
106
109
|
items: T,
|
|
107
|
-
itemSize:
|
|
110
|
+
itemSize: G,
|
|
108
111
|
onFeedbackFormSubmit: V,
|
|
109
112
|
onUserInteraction: W,
|
|
110
|
-
onSelectedAgentCallback:
|
|
113
|
+
onSelectedAgentCallback: K,
|
|
111
114
|
recordAction: m,
|
|
112
115
|
setCacheValue: x,
|
|
113
116
|
shouldPreinitSession: g
|
|
114
|
-
} = b.useContext(
|
|
115
|
-
agents:
|
|
116
|
-
requestState:
|
|
117
|
+
} = b.useContext(_e), {
|
|
118
|
+
agents: Z,
|
|
119
|
+
requestState: ee,
|
|
117
120
|
selectedAgent: E
|
|
118
|
-
} =
|
|
121
|
+
} = de(), {
|
|
119
122
|
questions: a
|
|
120
|
-
} = s, [
|
|
121
|
-
s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o),
|
|
122
|
-
agents:
|
|
123
|
-
requestState:
|
|
123
|
+
} = s, [z, F] = b.useState("");
|
|
124
|
+
s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o), H(s.questions, _) || x("questions", _), H(s.agents.selectedAgent, E) || x("agents", {
|
|
125
|
+
agents: Z,
|
|
126
|
+
requestState: ee,
|
|
124
127
|
selectedAgent: E
|
|
125
128
|
});
|
|
126
129
|
const B = (n = !1) => {
|
|
127
130
|
!g && !o && !A && i && i(!0, !1), n && W && W();
|
|
128
|
-
}, ee = () => {
|
|
129
|
-
L(!1);
|
|
130
131
|
}, te = () => {
|
|
132
|
+
L(!1);
|
|
133
|
+
}, oe = () => {
|
|
131
134
|
B(), L(!0);
|
|
132
135
|
};
|
|
133
136
|
b.useEffect(() => (g && !o && i && i(!0, !0), o && a.length > 0 && a[a.length - 1].isCompleted === !1 && C({
|
|
@@ -147,21 +150,21 @@ function Fe(f) {
|
|
|
147
150
|
k();
|
|
148
151
|
}), []), b.useEffect(() => {
|
|
149
152
|
const n = a[a.length - 1];
|
|
150
|
-
!g && !
|
|
153
|
+
!g && !P.current && o && (n != null && n.isLoading) && (C(n, E, !1), P.current = !0);
|
|
151
154
|
}, [o]);
|
|
152
|
-
const
|
|
155
|
+
const ne = () => /* @__PURE__ */ h("div", {
|
|
153
156
|
className: t.bcsBoxAISidebarTitlePart,
|
|
154
|
-
children: [/* @__PURE__ */ e(
|
|
157
|
+
children: [/* @__PURE__ */ e(Ce, {
|
|
155
158
|
isAIStudioAgentSelectorEnabled: d
|
|
156
159
|
}), d && /* @__PURE__ */ e("div", {
|
|
157
160
|
className: t.bcsBoxAISidebarAgentSelector,
|
|
158
|
-
children: /* @__PURE__ */ e(
|
|
161
|
+
children: /* @__PURE__ */ e(le, {
|
|
159
162
|
disabled: r,
|
|
160
|
-
fetcher:
|
|
163
|
+
fetcher: u,
|
|
161
164
|
hostAppName: c,
|
|
162
165
|
onAgentsListOpen: B,
|
|
163
|
-
onSelectAgent:
|
|
164
|
-
onSelectedAgentCallback:
|
|
166
|
+
onSelectAgent: I,
|
|
167
|
+
onSelectedAgentCallback: K,
|
|
165
168
|
recordAction: m,
|
|
166
169
|
shouldHideAgentSelectorOnLoad: !0,
|
|
167
170
|
useAgentLocalStorage: !0,
|
|
@@ -169,35 +172,35 @@ function Fe(f) {
|
|
|
169
172
|
})
|
|
170
173
|
})]
|
|
171
174
|
});
|
|
172
|
-
return /* @__PURE__ */ h(
|
|
173
|
-
children: [/* @__PURE__ */ e(
|
|
174
|
-
actions: /* @__PURE__ */ h(
|
|
175
|
-
children: [
|
|
175
|
+
return /* @__PURE__ */ h(Q, {
|
|
176
|
+
children: [/* @__PURE__ */ e($e, {
|
|
177
|
+
actions: /* @__PURE__ */ h(Q, {
|
|
178
|
+
children: [ne(), /* @__PURE__ */ e(ue, {
|
|
176
179
|
className: t.bcsBoxAISidebarClear,
|
|
177
180
|
hasRequestInProgress: r,
|
|
178
181
|
onClick: S
|
|
179
|
-
}), /* @__PURE__ */ e(
|
|
182
|
+
}), /* @__PURE__ */ e($, {
|
|
180
183
|
content: l(p.sidebarBoxAISwitchToModalView),
|
|
181
184
|
"data-testid": "content-answers-open-modal-tooltip",
|
|
182
185
|
variant: "standard",
|
|
183
|
-
children: /* @__PURE__ */ e(
|
|
186
|
+
children: /* @__PURE__ */ e(y, {
|
|
184
187
|
"aria-label": l(p.sidebarBoxAISwitchToModalView),
|
|
185
188
|
className: t.bcsBoxAISidebarExpand,
|
|
186
189
|
"data-target-id": "IconButton-expandBoxAISidebar",
|
|
187
|
-
icon:
|
|
188
|
-
onClick:
|
|
190
|
+
icon: J ? ce : ie,
|
|
191
|
+
onClick: oe,
|
|
189
192
|
size: "small"
|
|
190
193
|
})
|
|
191
|
-
}),
|
|
194
|
+
}), M && /* @__PURE__ */ e($, {
|
|
192
195
|
content: l(p.sidebarBoxAIClose),
|
|
193
196
|
"data-testid": "content-answers-close-tooltip",
|
|
194
197
|
variant: "standard",
|
|
195
|
-
children: /* @__PURE__ */ e(
|
|
198
|
+
children: /* @__PURE__ */ e(y, {
|
|
196
199
|
"aria-label": l(p.sidebarBoxAIClose),
|
|
197
200
|
className: t.bcsBoxAISidebarClose,
|
|
198
201
|
"data-target-id": "IconButton-closeBoxAISidebar",
|
|
199
|
-
icon:
|
|
200
|
-
onClick:
|
|
202
|
+
icon: re,
|
|
203
|
+
onClick: M,
|
|
201
204
|
size: "small"
|
|
202
205
|
})
|
|
203
206
|
})]
|
|
@@ -205,11 +208,11 @@ function Fe(f) {
|
|
|
205
208
|
className: D(t.bcsBoxAISidebar, {
|
|
206
209
|
[t.withModalOpen]: w
|
|
207
210
|
}),
|
|
208
|
-
elementId:
|
|
211
|
+
elementId: X,
|
|
209
212
|
sidebarView: "box-ai",
|
|
210
213
|
children: /* @__PURE__ */ e("div", {
|
|
211
214
|
className: t.bcsBoxAISidebarContent,
|
|
212
|
-
children: /* @__PURE__ */ e(
|
|
215
|
+
children: /* @__PURE__ */ e(pe, {
|
|
213
216
|
className: t.bcsBoxAISidebarContentAnswers,
|
|
214
217
|
contentName: O,
|
|
215
218
|
contentType: l(p.sidebarBoxAIContent),
|
|
@@ -222,23 +225,23 @@ function Fe(f) {
|
|
|
222
225
|
items: T,
|
|
223
226
|
onFeedbackFormSubmit: V,
|
|
224
227
|
onUserIntentToUseAI: B,
|
|
225
|
-
promptValue:
|
|
228
|
+
promptValue: z,
|
|
226
229
|
questions: _,
|
|
227
230
|
recordAction: m,
|
|
228
|
-
setPromptValue:
|
|
231
|
+
setPromptValue: F,
|
|
229
232
|
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
230
233
|
showLoadingIndicator: A && g,
|
|
231
234
|
stopQuestion: k,
|
|
232
235
|
submitQuestion: C,
|
|
233
236
|
variant: "sidebar",
|
|
234
|
-
...
|
|
237
|
+
...v
|
|
235
238
|
})
|
|
236
239
|
})
|
|
237
|
-
}), /* @__PURE__ */ e(
|
|
240
|
+
}), /* @__PURE__ */ e(Ie, {
|
|
238
241
|
contentName: O,
|
|
239
242
|
contentType: l(p.sidebarBoxAIContent),
|
|
240
|
-
extension:
|
|
241
|
-
getAIStudioAgents:
|
|
243
|
+
extension: Y,
|
|
244
|
+
getAIStudioAgents: u,
|
|
242
245
|
hasRequestInProgress: r,
|
|
243
246
|
hostAppName: c,
|
|
244
247
|
isAIStudioAgentSelectorEnabled: d,
|
|
@@ -246,29 +249,29 @@ function Fe(f) {
|
|
|
246
249
|
isFeedbackFormEnabled: q,
|
|
247
250
|
isStopResponseEnabled: U,
|
|
248
251
|
items: T,
|
|
249
|
-
itemSize:
|
|
252
|
+
itemSize: G,
|
|
250
253
|
onClearAction: S,
|
|
251
254
|
onFeedbackFormSubmit: V,
|
|
252
|
-
onOpenChange:
|
|
253
|
-
onSelectAgent:
|
|
255
|
+
onOpenChange: te,
|
|
256
|
+
onSelectAgent: I,
|
|
254
257
|
onUserIntentToUseAI: B,
|
|
255
258
|
open: w,
|
|
256
|
-
promptValue:
|
|
259
|
+
promptValue: z,
|
|
257
260
|
questions: _,
|
|
258
261
|
recordAction: w ? m : void 0,
|
|
259
|
-
setPromptValue:
|
|
262
|
+
setPromptValue: F,
|
|
260
263
|
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
261
264
|
showLoadingIndicator: !1,
|
|
262
265
|
stopPropagationOnEsc: !0,
|
|
263
266
|
stopQuestion: k,
|
|
264
267
|
submitQuestion: C,
|
|
265
268
|
variant: "collapsible",
|
|
266
|
-
...
|
|
269
|
+
...v,
|
|
267
270
|
shouldRenderProviders: !1
|
|
268
271
|
})]
|
|
269
272
|
});
|
|
270
273
|
}
|
|
271
|
-
const
|
|
274
|
+
const ct = Se(ye);
|
|
272
275
|
export {
|
|
273
|
-
|
|
276
|
+
ct as default
|
|
274
277
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._questionInput_w27x6_2{position:relative;z-index:1;align-items:end;min-height:3rem;margin:1rem;padding:0;background:#fff;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:1px solid #d3d3d3!important;border-radius:1.25rem!important;box-shadow:0 2px 12px #2222221f}._questionInput_w27x6_2._questionInputWithOutPromptLibrary_w27x6_16{display:flex;flex:1 1 auto;border-radius:1.5rem!important}._questionInput_w27x6_2:hover{background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;border:1px solid rgba(0,0,0,0)!important}._questionInput_w27x6_2:focus-within{box-sizing:unset!important;margin:calc(1rem - 1px);background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;border:2px solid rgba(0,0,0,0)!important}._questionInput_w27x6_2 ._avatar_w27x6_31{margin-bottom:.25rem}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34{position:absolute;right:0;margin-right:.25rem;margin-bottom:.25rem;background:linear-gradient(135deg,#fe03dc,#2784fa);border:0;border-radius:1.5rem!important}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:disabled{background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):hover,._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):active{background:linear-gradient(135deg,#cb02b0,#1f6ac8);border:0}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):focus,._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):focus-visible{background:linear-gradient(135deg,#fe03dc,#2784fa)}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):hover:focus,._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):hover:focus-visible{background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_w27x6_2 ._square_w27x6_56{display:inline-block;width:15px;height:15px;background-color:#fff;border-radius:3px}._questionInput_w27x6_2 ._textArea_w27x6_63{gap:0;width:100%;margin:0 1rem 0 0;padding-right:46px;box-shadow:none}._questionInput_w27x6_2 ._textArea_w27x6_63 div{box-shadow:none!important}._questionInput_w27x6_2 ._textArea_w27x6_63 span{padding:.5rem .75rem .75rem;margin-block-start:0}._questionInput_w27x6_2 ._textArea_w27x6_63 textarea{width:100%;margin:.475rem 0;padding:.4rem 1rem;background:inherit;border:none;border-radius:1.25rem;box-shadow:none}._questionInput_w27x6_2 ._textArea_w27x6_63 textarea:not(:disabled):not(:focus-visible):not(._error_w27x6_86):hover{background:inherit}._questionInput_w27x6_2._sidebar_w27x6_89 ._textArea_w27x6_63{padding-right:26px}._questionInput_w27x6_2._sidebar_w27x6_89 ._textArea_w27x6_63 div{align-items:center;height:100%}._submitButtonTooltip_w27x6_97{text-align:center}@media (max-width: 767px){._questionInput_w27x6_2 ._textArea_w27x6_63{margin:0 .75rem 0 0}}._actionContainer_w27x6_106{display:flex;justify-content:space-between;margin:0 0 0 .25rem}._promptButton_w27x6_112{margin-bottom:.25rem;color:#6f6f6f;background-color:#fff!important;border:1px solid rgba(0,0,0,.08)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.56.1",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
20
|
-
"@box/blueprint-web": "^12.93.
|
|
21
|
-
"@box/blueprint-web-assets": "^4.
|
|
22
|
-
"@box/box-ai-agent-selector": "^1.7.
|
|
23
|
-
"@box/item-icon": "^1.8.
|
|
24
|
-
"@box/storybook-utils": "^0.14.
|
|
20
|
+
"@box/blueprint-web": "^12.93.6",
|
|
21
|
+
"@box/blueprint-web-assets": "^4.79.0",
|
|
22
|
+
"@box/box-ai-agent-selector": "^1.7.2",
|
|
23
|
+
"@box/item-icon": "^1.8.2",
|
|
24
|
+
"@box/storybook-utils": "^0.14.16",
|
|
25
25
|
"@testing-library/react": "^15.0.6",
|
|
26
26
|
"react": "^18.3.0",
|
|
27
27
|
"react-dom": "^18.3.0",
|