@box/box-ai-content-answers 0.92.4 → 0.93.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/chunks/clear-conversation-button.js +15 -14
- package/chunks/warning-message.js +4 -4
- package/esm/lib/components/answer/citation.js +24 -23
- package/esm/lib/components/answer/copy-button.js +10 -9
- package/esm/lib/components/answer/no-citations.js +8 -7
- package/esm/lib/components/answer/thumb-buttons.js +39 -37
- package/esm/lib/components/common/media-container.js +6 -6
- package/esm/lib/components/footer/footer-actions.js +17 -15
- package/esm/lib/components/footer/footer.js +77 -82
- package/esm/lib/components/modal/modal.js +55 -54
- package/esm/lib/components/question/question.js +15 -14
- package/esm/lib/components/suggested-questions/suggestions.js +8 -8
- package/package.json +8 -7
- package/styles/media-container.css +1 -1
- package/styles/question.css +1 -1
- package/styles/suggestions.css +1 -1
- package/styles/warning-message.css +1 -1
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { Tooltip as a, IconButton as r } from "@box/blueprint-web";
|
|
2
2
|
import { Trash as s } from "@box/blueprint-web-assets/icons/Line";
|
|
3
3
|
import { useIntl as l } from "react-intl";
|
|
4
|
-
import
|
|
5
|
-
import { jsx as
|
|
6
|
-
import '../styles/clear-conversation-button.css';const c = "_BoxAIIconColor_1nf8s_1",
|
|
4
|
+
import t from "../esm/lib/components/modal/messages.js";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
import '../styles/clear-conversation-button.css';const c = "_BoxAIIconColor_1nf8s_1", i = "_modalHeader_1nf8s_5", _ = "_contentAnswersModal_1nf8s_10", d = "_boxAiContentAnswers_1nf8s_17", m = "_clearButton_1nf8s_25", C = "_contentAnswerModal_1nf8s_1", f = "_modalHeaderContainer_1nf8s_54", g = "_agentSelectorTrigger_1nf8s_62", A = "_agentSelectorContent_1nf8s_73", u = {
|
|
7
7
|
BoxAIIconColor: c,
|
|
8
|
-
modalHeader:
|
|
9
|
-
contentAnswersModal:
|
|
8
|
+
modalHeader: i,
|
|
9
|
+
contentAnswersModal: _,
|
|
10
10
|
boxAiContentAnswers: d,
|
|
11
11
|
clearButton: m,
|
|
12
12
|
"modal-close-button": "_modal-close-button_1nf8s_29",
|
|
13
|
-
contentAnswerModal:
|
|
14
|
-
modalHeaderContainer:
|
|
13
|
+
contentAnswerModal: C,
|
|
14
|
+
modalHeaderContainer: f,
|
|
15
15
|
agentSelectorTrigger: g,
|
|
16
16
|
agentSelectorContent: A
|
|
17
|
-
},
|
|
17
|
+
}, x = ({
|
|
18
18
|
onClick: e
|
|
19
19
|
}) => {
|
|
20
20
|
const o = l();
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
content: o.formatMessage(
|
|
21
|
+
return /* @__PURE__ */ n(a, {
|
|
22
|
+
content: o.formatMessage(t.clearConversationLabel),
|
|
23
23
|
"data-testid": "clear-conversation-tooltip",
|
|
24
24
|
variant: "standard",
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
"aria-label": o.formatMessage(
|
|
25
|
+
children: /* @__PURE__ */ n(r, {
|
|
26
|
+
"aria-label": o.formatMessage(t.clearConversationLabel),
|
|
27
27
|
className: u.clearButton,
|
|
28
28
|
"data-testid": "clear-conversation-button",
|
|
29
29
|
icon: s,
|
|
30
30
|
onClick: e,
|
|
31
|
-
size: "small"
|
|
31
|
+
size: "small",
|
|
32
|
+
"data-target-id": "IconButton-clearConversationLabel"
|
|
32
33
|
})
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
x as C,
|
|
37
38
|
u as s
|
|
38
39
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { InlineNotice as o, Text as e } from "@box/blueprint-web";
|
|
2
2
|
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import '../styles/warning-message.css';const c = "
|
|
3
|
+
import '../styles/warning-message.css';const c = "_welcomeMessage_1g76d_1", i = "_clearChatText_1g76d_1", l = "_warningNotice_1g76d_5", g = "_iconAvatar_1g76d_9", _ = {
|
|
4
4
|
welcomeMessage: c,
|
|
5
5
|
clearChatText: i,
|
|
6
6
|
warningNotice: l,
|
|
7
|
-
iconAvatar:
|
|
7
|
+
iconAvatar: g
|
|
8
8
|
}, w = ({
|
|
9
9
|
ariaLabel: t,
|
|
10
10
|
title: r,
|
|
11
11
|
description: a
|
|
12
12
|
}) => /* @__PURE__ */ s(o, {
|
|
13
|
-
className:
|
|
13
|
+
className: _.warningNotice,
|
|
14
14
|
variant: "warning",
|
|
15
15
|
variantIconAriaLabel: t,
|
|
16
16
|
children: [/* @__PURE__ */ n(e, {
|
|
@@ -25,5 +25,5 @@ import '../styles/warning-message.css';const c = "_welcomeMessage_19juh_1", i =
|
|
|
25
25
|
});
|
|
26
26
|
export {
|
|
27
27
|
w as W,
|
|
28
|
-
|
|
28
|
+
_ as s
|
|
29
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Popover as d, Status as E, Text as
|
|
1
|
+
import { Popover as d, Status as E, Text as x, TextButton as L } from "@box/blueprint-web";
|
|
2
2
|
import { ArrowUpRightSquare as M } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
3
|
import D from "clsx";
|
|
4
4
|
import G from "lodash/debounce";
|
|
@@ -8,7 +8,7 @@ import { useIntl as j } from "react-intl";
|
|
|
8
8
|
import { LOGGER_BASE_CONFIG as N, LOGGER_ACTION_CLICK as K } from "../common/constants.js";
|
|
9
9
|
import { MAX_CITATION_LENGTH as P } from "./constants.js";
|
|
10
10
|
import s from "./messages.js";
|
|
11
|
-
import { jsxs as S, jsx as
|
|
11
|
+
import { jsxs as S, jsx as a } from "react/jsx-runtime";
|
|
12
12
|
import '../../../../styles/citation.css';const U = "_citationTrigger_mfhpi_1", q = "_citationStatus_mfhpi_5", H = "_animate_mfhpi_22", W = "_fadeIn_mfhpi_26", X = "_cardTooltip_mfhpi_30", $ = "_cardTooltipTitle_mfhpi_34", k = "_cardTooltipCitation_mfhpi_38", z = "_cardTooltipButton_mfhpi_43", o = {
|
|
13
13
|
citationTrigger: U,
|
|
14
14
|
citationStatus: q,
|
|
@@ -20,8 +20,8 @@ import '../../../../styles/citation.css';const U = "_citationTrigger_mfhpi_1", q
|
|
|
20
20
|
cardTooltipButton: z
|
|
21
21
|
}, rt = ({
|
|
22
22
|
animate: u,
|
|
23
|
-
content:
|
|
24
|
-
id:
|
|
23
|
+
content: m,
|
|
24
|
+
id: e,
|
|
25
25
|
recordAction: i,
|
|
26
26
|
fileId: _,
|
|
27
27
|
title: c,
|
|
@@ -34,47 +34,47 @@ import '../../../../styles/citation.css';const U = "_citationTrigger_mfhpi_1", q
|
|
|
34
34
|
c ? f = n(s.cardTooltipTitleWithDocumentName, {
|
|
35
35
|
title: c.toString()
|
|
36
36
|
}) : f = n(s.cardTooltipTitle);
|
|
37
|
-
const
|
|
37
|
+
const B = G((t) => {
|
|
38
38
|
b(t), t === !0 && i && i({
|
|
39
39
|
...N,
|
|
40
40
|
feature: "answers-citations",
|
|
41
41
|
target: "hovered",
|
|
42
42
|
data: {
|
|
43
|
-
index:
|
|
43
|
+
index: e
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}, 100), p = () => {
|
|
47
|
-
|
|
47
|
+
B(!0);
|
|
48
48
|
}, r = () => {
|
|
49
|
-
|
|
49
|
+
B(!1);
|
|
50
50
|
}, O = A(() => {
|
|
51
51
|
l && i && (l(_, c), i({
|
|
52
52
|
...N,
|
|
53
53
|
feature: "answers-citations",
|
|
54
54
|
target: K,
|
|
55
55
|
data: {
|
|
56
|
-
index:
|
|
56
|
+
index: e
|
|
57
57
|
}
|
|
58
58
|
}));
|
|
59
|
-
}, [l, i,
|
|
59
|
+
}, [l, i, e, _, c]);
|
|
60
60
|
y(() => {
|
|
61
61
|
u && w(!0);
|
|
62
62
|
}, []);
|
|
63
|
-
const
|
|
63
|
+
const T = m ? R(m.toString(), {
|
|
64
64
|
length: P,
|
|
65
65
|
separator: /,? +/
|
|
66
66
|
}) : void 0;
|
|
67
67
|
return /* @__PURE__ */ S(d.Root, {
|
|
68
68
|
modal: !1,
|
|
69
69
|
open: h,
|
|
70
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ a(d.Trigger, {
|
|
71
71
|
className: o.citationTrigger,
|
|
72
72
|
onMouseEnter: p,
|
|
73
73
|
onMouseLeave: r,
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ a(E, {
|
|
75
75
|
ref: C,
|
|
76
|
-
"aria-label": h ?
|
|
77
|
-
number:
|
|
76
|
+
"aria-label": h ? T : n(s.referenceAriaLabel, {
|
|
77
|
+
number: e
|
|
78
78
|
}),
|
|
79
79
|
className: D(o.citationStatus, {
|
|
80
80
|
[o.animate]: u,
|
|
@@ -85,10 +85,10 @@ import '../../../../styles/citation.css';const U = "_citationTrigger_mfhpi_1", q
|
|
|
85
85
|
onBlur: r,
|
|
86
86
|
onFocus: p,
|
|
87
87
|
tabIndex: 0,
|
|
88
|
-
text: `${
|
|
88
|
+
text: `${e}`
|
|
89
89
|
})
|
|
90
|
-
}), /* @__PURE__ */
|
|
91
|
-
"aria-label":
|
|
90
|
+
}), /* @__PURE__ */ a(d.ContentContainer, {
|
|
91
|
+
"aria-label": T,
|
|
92
92
|
collisionPadding: 10,
|
|
93
93
|
"data-testid": "content-answers-citation-card",
|
|
94
94
|
onBlur: r,
|
|
@@ -105,25 +105,26 @@ import '../../../../styles/citation.css';const U = "_citationTrigger_mfhpi_1", q
|
|
|
105
105
|
},
|
|
106
106
|
side: "top",
|
|
107
107
|
sideOffset: 5,
|
|
108
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ a(d.MainContent, {
|
|
109
109
|
children: /* @__PURE__ */ S("div", {
|
|
110
110
|
className: o.cardTooltip,
|
|
111
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ a(x, {
|
|
112
112
|
as: "h4",
|
|
113
113
|
className: o.cardTooltipTitle,
|
|
114
114
|
variant: "bodyDefaultBold",
|
|
115
115
|
children: f
|
|
116
|
-
}), /* @__PURE__ */
|
|
116
|
+
}), /* @__PURE__ */ a(x, {
|
|
117
117
|
as: "p",
|
|
118
118
|
className: o.cardTooltipCitation,
|
|
119
119
|
color: "textOnLightDefault",
|
|
120
120
|
variant: "caption",
|
|
121
|
-
children:
|
|
122
|
-
}), g && /* @__PURE__ */
|
|
121
|
+
children: T
|
|
122
|
+
}), g && /* @__PURE__ */ a(L, {
|
|
123
123
|
"aria-label": n(s.cardTooltipButton),
|
|
124
124
|
className: o.cardTooltipButton,
|
|
125
125
|
icon: M,
|
|
126
126
|
onClick: O,
|
|
127
|
+
"data-target-id": "TextButton-cardTooltipButton",
|
|
127
128
|
children: n(s.cardTooltipButton)
|
|
128
129
|
})]
|
|
129
130
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useNotification as n, Tooltip as l, IconButton as
|
|
2
|
-
import { Clipboard as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import
|
|
1
|
+
import { useNotification as n, Tooltip as l, IconButton as d } from "@box/blueprint-web";
|
|
2
|
+
import { Clipboard as m } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { useIntl as u } from "react-intl";
|
|
4
|
+
import f from "../../messages.js";
|
|
5
5
|
import { LOGGER_BASE_CONFIG as b, LOGGER_ACTION_CLICK as C } from "../common/constants.js";
|
|
6
6
|
import t from "./messages.js";
|
|
7
7
|
import { jsx as s } from "react/jsx-runtime";
|
|
@@ -12,7 +12,7 @@ const L = ({
|
|
|
12
12
|
}) => {
|
|
13
13
|
const {
|
|
14
14
|
formatMessage: o
|
|
15
|
-
} =
|
|
15
|
+
} = u(), {
|
|
16
16
|
addNotification: c
|
|
17
17
|
} = n(), p = () => {
|
|
18
18
|
r && r({
|
|
@@ -25,20 +25,21 @@ const L = ({
|
|
|
25
25
|
styledText: o(t.copyToClipboardSucceeded),
|
|
26
26
|
variant: "success",
|
|
27
27
|
typeIconAriaLabel: o(t.copyButtonSuccessText),
|
|
28
|
-
closeButtonAriaLabel: o(
|
|
28
|
+
closeButtonAriaLabel: o(f.closeButtonText)
|
|
29
29
|
}), a && a(i);
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
return /* @__PURE__ */ s(l, {
|
|
33
33
|
content: o(t.copyToClipboard),
|
|
34
|
-
children: /* @__PURE__ */ s(
|
|
34
|
+
children: /* @__PURE__ */ s(d, {
|
|
35
35
|
"aria-label": o(t.copyToClipboard),
|
|
36
|
-
icon:
|
|
36
|
+
icon: m,
|
|
37
37
|
onClick: p,
|
|
38
38
|
onFocusCapture: (e) => {
|
|
39
39
|
e.target.matches(":focus-visible") || e.stopPropagation();
|
|
40
40
|
},
|
|
41
|
-
size: "x-small"
|
|
41
|
+
size: "x-small",
|
|
42
|
+
"data-target-id": "IconButton-copyToClipboard"
|
|
42
43
|
})
|
|
43
44
|
});
|
|
44
45
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Tooltip as
|
|
1
|
+
import { Tooltip as r, IconButton as s } from "@box/blueprint-web";
|
|
2
2
|
import { InfoBadge as a } from "@box/blueprint-web-assets/icons/Line";
|
|
3
3
|
import { useEffect as f } from "react";
|
|
4
4
|
import { useIntl as i } from "react-intl";
|
|
5
5
|
import { LOGGER_BASE_CONFIG as m } from "../common/constants.js";
|
|
6
6
|
import c from "./messages.js";
|
|
7
7
|
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
-
const
|
|
8
|
+
const x = ({
|
|
9
9
|
recordAction: e
|
|
10
10
|
}) => {
|
|
11
11
|
const {
|
|
@@ -16,19 +16,20 @@ const N = ({
|
|
|
16
16
|
...m,
|
|
17
17
|
target: "noReferences"
|
|
18
18
|
});
|
|
19
|
-
}, [e]), /* @__PURE__ */ o(
|
|
19
|
+
}, [e]), /* @__PURE__ */ o(r, {
|
|
20
20
|
className: "Answer-NoCitations",
|
|
21
21
|
content: t,
|
|
22
22
|
"data-testid": "content-answers-references-no-references-tooltip",
|
|
23
|
-
children: /* @__PURE__ */ o(
|
|
23
|
+
children: /* @__PURE__ */ o(s, {
|
|
24
24
|
"aria-label": t,
|
|
25
25
|
"data-testid": "content-answers-references-no-references",
|
|
26
26
|
icon: a,
|
|
27
|
-
size: "x-small"
|
|
27
|
+
size: "x-small",
|
|
28
|
+
"data-target-id": "IconButton-noReferences"
|
|
28
29
|
})
|
|
29
30
|
});
|
|
30
31
|
};
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
x as NoCitationsIcon,
|
|
34
|
+
x as default
|
|
34
35
|
};
|
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import { Tooltip as _, IconButton as
|
|
2
|
-
import { ThumbUp as
|
|
3
|
-
import { ThumbUp as
|
|
4
|
-
import
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { LOGGER_BASE_CONFIG as
|
|
1
|
+
import { Tooltip as _, IconButton as U } from "@box/blueprint-web";
|
|
2
|
+
import { ThumbUp as B, ThumbDown as M } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { ThumbUp as d, ThumbDown as O } from "@box/blueprint-web-assets/icons/Line";
|
|
4
|
+
import s from "react";
|
|
5
|
+
import { useIntl as C } from "react-intl";
|
|
6
|
+
import { LOGGER_BASE_CONFIG as H, LOGGER_ACTION_PROGRAMMATIC as L } from "../common/constants.js";
|
|
7
7
|
import u from "./messages.js";
|
|
8
|
-
import { jsxs as
|
|
9
|
-
import '../../../../styles/thumb-buttons.css';const
|
|
10
|
-
thumbDown:
|
|
8
|
+
import { jsxs as N, Fragment as g, jsx as b } from "react/jsx-runtime";
|
|
9
|
+
import '../../../../styles/thumb-buttons.css';const w = "_thumbDown_1axcd_1", x = {
|
|
10
|
+
thumbDown: w
|
|
11
11
|
}, o = {
|
|
12
12
|
THUMB_UP: "positive",
|
|
13
13
|
THUMB_DOWN: "negative",
|
|
14
14
|
NONE: "none"
|
|
15
15
|
}, j = ({
|
|
16
16
|
recordAction: m,
|
|
17
|
-
variant:
|
|
17
|
+
variant: i,
|
|
18
18
|
items: h,
|
|
19
|
-
hostAppName:
|
|
20
|
-
questionId:
|
|
21
|
-
feedbackValue:
|
|
19
|
+
hostAppName: p,
|
|
20
|
+
questionId: r,
|
|
21
|
+
feedbackValue: f,
|
|
22
22
|
setAnswerFeedback: l
|
|
23
23
|
}) => {
|
|
24
24
|
const {
|
|
25
|
-
formatMessage:
|
|
26
|
-
} =
|
|
27
|
-
|
|
28
|
-
...
|
|
29
|
-
action:
|
|
25
|
+
formatMessage: e
|
|
26
|
+
} = C(), a = f, T = s.useMemo(() => h.filter((t) => t.status === "supported").map((t) => t.fileType), [h]), n = s.useCallback((t) => {
|
|
27
|
+
a !== t && (l == null || l(r, t), m == null || m({
|
|
28
|
+
...H,
|
|
29
|
+
action: L,
|
|
30
30
|
target: "answer_feedback",
|
|
31
|
-
component:
|
|
31
|
+
component: i,
|
|
32
32
|
data: {
|
|
33
|
-
feedback_value:
|
|
34
|
-
file_types:
|
|
35
|
-
feature:
|
|
33
|
+
feedback_value: t,
|
|
34
|
+
file_types: T,
|
|
35
|
+
feature: p
|
|
36
36
|
}
|
|
37
37
|
}));
|
|
38
|
-
}, [
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
}, [p, m, a, i, T, r, l]), c = s.useCallback(() => n(o.THUMB_UP), [n]), D = s.useCallback(() => n(o.THUMB_DOWN), [n]);
|
|
39
|
+
return /* @__PURE__ */ N(g, {
|
|
40
40
|
children: [/* @__PURE__ */ b(_, {
|
|
41
|
-
content:
|
|
42
|
-
children: /* @__PURE__ */ b(
|
|
43
|
-
"aria-label":
|
|
44
|
-
disabled:
|
|
45
|
-
icon:
|
|
41
|
+
content: e(u.thumbsUpAriaLabel),
|
|
42
|
+
children: /* @__PURE__ */ b(U, {
|
|
43
|
+
"aria-label": e(u.thumbsUpAriaLabel),
|
|
44
|
+
disabled: a === o.THUMB_DOWN,
|
|
45
|
+
icon: a === o.THUMB_UP ? B : d,
|
|
46
46
|
onClick: c,
|
|
47
|
-
size: "x-small"
|
|
47
|
+
size: "x-small",
|
|
48
|
+
"data-target-id": "IconButton-thumbsUpAriaLabel"
|
|
48
49
|
})
|
|
49
50
|
}), /* @__PURE__ */ b(_, {
|
|
50
|
-
content:
|
|
51
|
-
children: /* @__PURE__ */ b(
|
|
52
|
-
"aria-label":
|
|
53
|
-
className:
|
|
54
|
-
disabled:
|
|
55
|
-
icon:
|
|
51
|
+
content: e(u.thumbsDownAriaLabel),
|
|
52
|
+
children: /* @__PURE__ */ b(U, {
|
|
53
|
+
"aria-label": e(u.thumbsDownAriaLabel),
|
|
54
|
+
className: x.thumbDown,
|
|
55
|
+
disabled: a === o.THUMB_UP,
|
|
56
|
+
icon: a === o.THUMB_DOWN ? M : O,
|
|
56
57
|
onClick: D,
|
|
57
|
-
size: "x-small"
|
|
58
|
+
size: "x-small",
|
|
59
|
+
"data-target-id": "IconButton-thumbsDownAriaLabel"
|
|
58
60
|
})
|
|
59
61
|
})]
|
|
60
62
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Card as d } from "@box/blueprint-web";
|
|
2
2
|
import s from "clsx";
|
|
3
3
|
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
-
import '../../../../styles/media-container.css';const _ = "
|
|
4
|
+
import '../../../../styles/media-container.css';const _ = "_mediaContainer_1392k_1", c = "_figure_1392k_7", m = "_sidebar_1392k_14", l = "_welcomeMessage_1392k_33", g = "_modal_1392k_37", u = "_question_1392k_40", k = "_contentCard_1392k_56", C = "_answer_1392k_62", b = "_body_1392k_66", f = "_error_1392k_101", e = {
|
|
5
5
|
mediaContainer: _,
|
|
6
6
|
figure: c,
|
|
7
7
|
sidebar: m,
|
|
8
|
-
"center-aligned": "_center-
|
|
9
|
-
"top-aligned": "_top-
|
|
8
|
+
"center-aligned": "_center-aligned_1392k_17",
|
|
9
|
+
"top-aligned": "_top-aligned_1392k_24",
|
|
10
10
|
welcomeMessage: l,
|
|
11
|
-
modal:
|
|
12
|
-
question:
|
|
13
|
-
contentCard:
|
|
11
|
+
modal: g,
|
|
12
|
+
question: u,
|
|
13
|
+
contentCard: k,
|
|
14
14
|
answer: C,
|
|
15
15
|
body: b,
|
|
16
16
|
error: f
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Button as l } from "@box/blueprint-web";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useIntl as
|
|
2
|
+
import { useRef as N, useCallback as p, useEffect as y } from "react";
|
|
3
|
+
import { useIntl as O } from "react-intl";
|
|
4
4
|
import { A as m } from "../../../../chunks/types.js";
|
|
5
5
|
import { LOGGER_BASE_CONFIG as u, LOGGER_ACTION_CLICK as R } from "../common/constants.js";
|
|
6
6
|
import d from "./messages.js";
|
|
7
|
-
import { jsxs as
|
|
7
|
+
import { jsxs as w, jsx as B } from "react/jsx-runtime";
|
|
8
8
|
import '../../../../styles/footer-actions.css';const k = "_footerActions_1l4g8_1", v = "_footerActionButton_1l4g8_11", a = {
|
|
9
9
|
footerActions: k,
|
|
10
10
|
footerActionButton: v
|
|
11
11
|
}, j = ({
|
|
12
|
-
isStopResponseEnabled:
|
|
13
|
-
isStreamingEnabled:
|
|
12
|
+
isStopResponseEnabled: E = !1,
|
|
13
|
+
isStreamingEnabled: _ = !1,
|
|
14
14
|
lastQuestion: o,
|
|
15
15
|
onRetryQuestion: s,
|
|
16
16
|
onStopQuestion: c,
|
|
@@ -19,43 +19,45 @@ import '../../../../styles/footer-actions.css';const k = "_footerActions_1l4g8_1
|
|
|
19
19
|
const {
|
|
20
20
|
answer: S,
|
|
21
21
|
error: n,
|
|
22
|
-
isCompleted:
|
|
23
|
-
} = o, e = s && n && n !== m.RESPONSE_STOPPED && n !== m.RESPONSE_INTERRUPTED, i =
|
|
22
|
+
isCompleted: g
|
|
23
|
+
} = o, e = s && n && n !== m.RESPONSE_STOPPED && n !== m.RESPONSE_INTERRUPTED, i = _ && !g && (E || S), h = i || e, r = N(null), {
|
|
24
24
|
formatMessage: f
|
|
25
|
-
} =
|
|
25
|
+
} = O(), A = p(() => {
|
|
26
26
|
t && t({
|
|
27
27
|
...u,
|
|
28
28
|
action: R,
|
|
29
29
|
target: "stopResponse"
|
|
30
30
|
}), c(o);
|
|
31
|
-
}, [o, c, t]),
|
|
31
|
+
}, [o, c, t]), C = p(() => {
|
|
32
32
|
t && t({
|
|
33
33
|
...u,
|
|
34
34
|
action: R,
|
|
35
35
|
target: "retryResponse"
|
|
36
36
|
}), s(o);
|
|
37
37
|
}, [o, s, t]);
|
|
38
|
-
return
|
|
38
|
+
return y(() => {
|
|
39
39
|
e && r.current && r.current.focus();
|
|
40
|
-
}, [e]),
|
|
40
|
+
}, [e]), h ? /* @__PURE__ */ w("div", {
|
|
41
41
|
className: a.footerActions,
|
|
42
42
|
"data-testid": "content-answers-modal-footer-actions",
|
|
43
|
-
children: [i && /* @__PURE__ */
|
|
43
|
+
children: [i && /* @__PURE__ */ B(l, {
|
|
44
44
|
"aria-live": "polite",
|
|
45
45
|
className: a.footerActionButton,
|
|
46
46
|
"data-testid": "content-answers-stop-response-button",
|
|
47
|
-
onClick:
|
|
47
|
+
onClick: A,
|
|
48
48
|
size: "large",
|
|
49
49
|
variant: "secondary",
|
|
50
|
+
"data-target-id": "Button-stopResponse",
|
|
50
51
|
children: f(d.stopResponse)
|
|
51
|
-
}), e && /* @__PURE__ */
|
|
52
|
+
}), e && /* @__PURE__ */ B(l, {
|
|
52
53
|
ref: r,
|
|
53
54
|
"aria-live": "polite",
|
|
54
55
|
className: a.footerActionButton,
|
|
55
56
|
"data-testid": "content-answers-retry-response-button",
|
|
56
|
-
onClick:
|
|
57
|
+
onClick: C,
|
|
57
58
|
size: "large",
|
|
58
59
|
variant: "secondary",
|
|
60
|
+
"data-target-id": "Button-retryResponse",
|
|
59
61
|
children: f(d.retryResponse)
|
|
60
62
|
})]
|
|
61
63
|
}) : null;
|
|
@@ -1,133 +1,128 @@
|
|
|
1
|
-
import
|
|
1
|
+
import D from "clsx";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { useBreakpoint as
|
|
5
|
-
import { ArrowUp as
|
|
6
|
-
import { useAgents as
|
|
7
|
-
import { useAgents as
|
|
8
|
-
import { FooterActions as
|
|
9
|
-
import { getAIAgentConfig as
|
|
10
|
-
import { isDebugModeTrigger as
|
|
11
|
-
import { TEXT_AREA as
|
|
12
|
-
import
|
|
13
|
-
import { LOGGER_BASE_CONFIG as
|
|
14
|
-
import { jsxs as
|
|
15
|
-
import '../../../../styles/footer.css';const
|
|
16
|
-
questionInput:
|
|
17
|
-
avatar:
|
|
18
|
-
submitButton:
|
|
19
|
-
textArea:
|
|
20
|
-
error:
|
|
21
|
-
sidebar:
|
|
22
|
-
submitButtonTooltip:
|
|
23
|
-
},
|
|
3
|
+
import { useIntl as U } from "react-intl";
|
|
4
|
+
import { useBreakpoint as V, Breakpoint as Y, TextArea as $, Tooltip as J, Button as Q } from "@box/blueprint-web";
|
|
5
|
+
import { ArrowUp as Z } from "@box/blueprint-web-assets/icons/Fill";
|
|
6
|
+
import { useAgents as q } from "@box/box-ai-agent-selector";
|
|
7
|
+
import { useAgents as g } from "../../contexts/AgentsContext.js";
|
|
8
|
+
import { FooterActions as P } from "./footer-actions.js";
|
|
9
|
+
import { getAIAgentConfig as N } from "../common/agentUtils.js";
|
|
10
|
+
import { isDebugModeTrigger as tt, isEnterTrigger as at } from "../common/keyInputUtils.js";
|
|
11
|
+
import { TEXT_AREA as s } from "./constants.js";
|
|
12
|
+
import u from "./messages.js";
|
|
13
|
+
import { LOGGER_BASE_CONFIG as O, LOGGER_ACTION_CLICK as rt, LOGGER_ACTION_KEYPRESS as et } from "../common/constants.js";
|
|
14
|
+
import { jsxs as X, jsx as d } from "react/jsx-runtime";
|
|
15
|
+
import '../../../../styles/footer.css';const ot = "_questionInput_1o8is_1", st = "_avatar_1o8is_26", it = "_submitButton_1o8is_29", nt = "_textArea_1o8is_45", mt = "_error_1o8is_68", ut = "_sidebar_1o8is_71", ct = "_submitButtonTooltip_1o8is_79", C = {
|
|
16
|
+
questionInput: ot,
|
|
17
|
+
avatar: st,
|
|
18
|
+
submitButton: it,
|
|
19
|
+
textArea: nt,
|
|
20
|
+
error: mt,
|
|
21
|
+
sidebar: ut,
|
|
22
|
+
submitButtonTooltip: ct
|
|
23
|
+
}, Mt = ({
|
|
24
24
|
askSuggestedQuestion: k,
|
|
25
25
|
enableDebugMode: x = !1,
|
|
26
26
|
hasRequestInProgress: e,
|
|
27
27
|
isAgentSelectorEnabled: f,
|
|
28
28
|
isAIStudioAgentSelectorEnabled: p,
|
|
29
|
-
isDebugModeShown:
|
|
29
|
+
isDebugModeShown: h,
|
|
30
30
|
isStopResponseEnabled: w,
|
|
31
31
|
isStreamingEnabled: H,
|
|
32
32
|
lastQuestion: A,
|
|
33
33
|
onRetryQuestion: E,
|
|
34
|
-
onStopQuestion:
|
|
34
|
+
onStopQuestion: R,
|
|
35
35
|
recordAction: o,
|
|
36
36
|
sendQuestion: L,
|
|
37
|
-
setAskSuggestedQuestion:
|
|
38
|
-
toggleDebugMode:
|
|
37
|
+
setAskSuggestedQuestion: M,
|
|
38
|
+
toggleDebugMode: i,
|
|
39
39
|
variant: y = "modal"
|
|
40
40
|
}) => {
|
|
41
|
-
const
|
|
41
|
+
const v = y === "sidebar", n = U(), I = V(), a = /* @__PURE__ */ r.createRef(), K = I <= Y.Medium && !v ? s.MAX_ROWS_MOBILE : s.MAX_ROWS, [c, B] = r.useState(!0), [F, G] = r.useState(!1), {
|
|
42
42
|
selectedAgent: _
|
|
43
|
-
} =
|
|
44
|
-
selectedAgent:
|
|
45
|
-
} =
|
|
43
|
+
} = g(), {
|
|
44
|
+
selectedAgent: b
|
|
45
|
+
} = q(), T = r.useCallback(() => {
|
|
46
46
|
a.current && a.current.focus();
|
|
47
|
-
}, [a]),
|
|
48
|
-
var
|
|
49
|
-
let t = ((
|
|
50
|
-
a.current && t.length >
|
|
47
|
+
}, [a]), j = r.useCallback(() => {
|
|
48
|
+
var m;
|
|
49
|
+
let t = ((m = a.current) == null ? void 0 : m.value) ?? "";
|
|
50
|
+
a.current && t.length > s.MAX_LENGTH && (a.current.value = t.slice(0, s.MAX_LENGTH), t = a.current.value), G(t.length >= s.MAX_LENGTH), B(t.trim().length === 0);
|
|
51
51
|
}, [a]), l = r.useCallback(() => {
|
|
52
|
-
if (
|
|
52
|
+
if (T(), !e && a.current) {
|
|
53
53
|
const t = {
|
|
54
54
|
prompt: a.current.value
|
|
55
55
|
};
|
|
56
56
|
if (t.prompt && t.prompt.trim()) {
|
|
57
|
-
const
|
|
58
|
-
L(t,
|
|
57
|
+
const m = N(f, _, p, b);
|
|
58
|
+
L(t, m), a.current.value = "", B(!0), G(!1);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
h && i && i();
|
|
61
61
|
}
|
|
62
|
-
}, [
|
|
63
|
-
t.preventDefault(), !e && !
|
|
64
|
-
...
|
|
65
|
-
action:
|
|
62
|
+
}, [b, T, e, a, p, f, h, _, L, i]), S = r.useCallback((t) => {
|
|
63
|
+
t.preventDefault(), !e && !c && o && o({
|
|
64
|
+
...O,
|
|
65
|
+
action: rt,
|
|
66
66
|
target: "ask"
|
|
67
67
|
}), l();
|
|
68
|
-
}, [e,
|
|
69
|
-
x &&
|
|
70
|
-
...
|
|
71
|
-
action:
|
|
68
|
+
}, [e, c, o, l]), W = r.useCallback((t) => {
|
|
69
|
+
x && i && tt(t) && i(), at(t) && (t.preventDefault(), !e && !c && o && o({
|
|
70
|
+
...O,
|
|
71
|
+
action: et,
|
|
72
72
|
target: "ask"
|
|
73
73
|
}), l());
|
|
74
|
-
}, [x, e,
|
|
75
|
-
const
|
|
76
|
-
E(t,
|
|
77
|
-
}, [
|
|
78
|
-
r.useEffect(() => {
|
|
79
|
-
queueMicrotask(
|
|
74
|
+
}, [x, e, c, o, l, i]), z = r.useCallback((t) => {
|
|
75
|
+
const m = N(f, _, p, b);
|
|
76
|
+
E(t, m);
|
|
77
|
+
}, [b, p, f, E, _]);
|
|
78
|
+
return r.useEffect(() => {
|
|
79
|
+
queueMicrotask(T);
|
|
80
80
|
}, []), r.useEffect(() => {
|
|
81
|
-
k && a.current && !e &&
|
|
82
|
-
}, [k])
|
|
83
|
-
|
|
84
|
-
if (h)
|
|
85
|
-
return g;
|
|
86
|
-
}
|
|
87
|
-
return /* @__PURE__ */ R("div", {
|
|
88
|
-
children: [A && /* @__PURE__ */ b(at, {
|
|
81
|
+
k && a.current && !e && M && (a.current.value = k, l(), M(null));
|
|
82
|
+
}, [k]), /* @__PURE__ */ X("div", {
|
|
83
|
+
children: [A && /* @__PURE__ */ d(P, {
|
|
89
84
|
isStopResponseEnabled: w,
|
|
90
85
|
isStreamingEnabled: H,
|
|
91
86
|
lastQuestion: A,
|
|
92
|
-
onRetryQuestion:
|
|
93
|
-
onStopQuestion:
|
|
87
|
+
onRetryQuestion: z,
|
|
88
|
+
onStopQuestion: R,
|
|
94
89
|
recordAction: o
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
-
className:
|
|
97
|
-
children: [/* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ X("div", {
|
|
91
|
+
className: D(C.questionInput, v && C.sidebar),
|
|
92
|
+
children: [/* @__PURE__ */ d($, {
|
|
98
93
|
ref: a,
|
|
99
94
|
className: C.textArea,
|
|
100
95
|
"data-testid": "content-answers-question-input",
|
|
101
|
-
error:
|
|
102
|
-
characterLimit:
|
|
96
|
+
error: F && n.formatMessage(u.maxCharactersReachedError, {
|
|
97
|
+
characterLimit: s.MAX_LENGTH
|
|
103
98
|
}),
|
|
104
99
|
hideLabel: !0,
|
|
105
|
-
label:
|
|
106
|
-
maxLength:
|
|
100
|
+
label: n.formatMessage(u.askQuestionPlaceholder),
|
|
101
|
+
maxLength: s.MAX_LENGTH,
|
|
107
102
|
maxRows: K,
|
|
108
|
-
onChange:
|
|
109
|
-
onKeyDown:
|
|
110
|
-
placeholder:
|
|
111
|
-
}), /* @__PURE__ */
|
|
112
|
-
content:
|
|
103
|
+
onChange: j,
|
|
104
|
+
onKeyDown: W,
|
|
105
|
+
placeholder: n.formatMessage(u.askQuestionPlaceholder)
|
|
106
|
+
}), /* @__PURE__ */ d(J, {
|
|
107
|
+
content: n.formatMessage(u.ask),
|
|
113
108
|
"data-testid": "ask-tooltip",
|
|
114
109
|
variant: "standard",
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
-
"aria-label":
|
|
110
|
+
children: /* @__PURE__ */ d(Q, {
|
|
111
|
+
"aria-label": n.formatMessage(u.ask),
|
|
117
112
|
className: C.submitButton,
|
|
118
113
|
"data-testid": "content-answers-submit-button",
|
|
119
|
-
disabled:
|
|
120
|
-
icon:
|
|
114
|
+
disabled: c || e,
|
|
115
|
+
icon: Z,
|
|
121
116
|
loading: e,
|
|
122
|
-
loadingAriaLabel:
|
|
123
|
-
onClick:
|
|
117
|
+
loadingAriaLabel: n.formatMessage(u.askDisabledTooltip),
|
|
118
|
+
onClick: S,
|
|
124
119
|
size: "small",
|
|
125
|
-
|
|
120
|
+
"data-target-id": "Button-ask"
|
|
126
121
|
})
|
|
127
122
|
})]
|
|
128
123
|
})]
|
|
129
124
|
});
|
|
130
125
|
};
|
|
131
126
|
export {
|
|
132
|
-
|
|
127
|
+
Mt as Footer
|
|
133
128
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { useBreakpoint as D, Breakpoint as I, Modal as c, Text as K } from "@box/blueprint-web";
|
|
2
2
|
import { ArrowsCollapse as $ } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
3
|
import { BoxAiLogo as J } from "@box/blueprint-web-assets/icons/Logo";
|
|
4
|
-
import { Size8 as
|
|
4
|
+
import { Size8 as L } from "@box/blueprint-web-assets/tokens/tokens";
|
|
5
5
|
import { BoxAiAgentSelectorWithApi as V, AgentsProvider as X } from "@box/box-ai-agent-selector";
|
|
6
6
|
import l from "react";
|
|
7
7
|
import { useIntl as Y } from "react-intl";
|
|
8
8
|
import { BoxAiContentAnswers as Z } from "../../box-ai-content-answers.js";
|
|
9
9
|
import { AgentsProvider as ee } from "../../contexts/AgentsContext.js";
|
|
10
|
-
import { A as
|
|
10
|
+
import { A as oe, R as te } from "../../../../chunks/types.js";
|
|
11
11
|
import { AgentSelector as se } from "../agents/agent-selector.js";
|
|
12
|
-
import { LOGGER_BASE_CONFIG as
|
|
13
|
-
import { s as
|
|
12
|
+
import { LOGGER_BASE_CONFIG as C, LOGGER_ACTION_CLICK as ae } from "../common/constants.js";
|
|
13
|
+
import { s as t, C as re } from "../../../../chunks/clear-conversation-button.js";
|
|
14
14
|
import le from "./hooks/useStopPropagationOnEsc.js";
|
|
15
|
-
import
|
|
16
|
-
import { jsxs as
|
|
15
|
+
import p from "./messages.js";
|
|
16
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
17
17
|
const Ne = ({
|
|
18
|
-
children:
|
|
19
|
-
getAIStudioAgents:
|
|
20
|
-
hasCustomSuggestedQuestions:
|
|
21
|
-
hostAppName:
|
|
22
|
-
isAgentSelectorEnabled:
|
|
23
|
-
isAIStudioAgentSelectorEnabled:
|
|
24
|
-
isDebugModeEnabled:
|
|
18
|
+
children: _,
|
|
19
|
+
getAIStudioAgents: A,
|
|
20
|
+
hasCustomSuggestedQuestions: x,
|
|
21
|
+
hostAppName: d,
|
|
22
|
+
isAgentSelectorEnabled: M,
|
|
23
|
+
isAIStudioAgentSelectorEnabled: m,
|
|
24
|
+
isDebugModeEnabled: k,
|
|
25
25
|
isResetChatEnabled: B,
|
|
26
26
|
isStopResponseEnabled: S = !1,
|
|
27
27
|
itemSize: T,
|
|
@@ -31,26 +31,26 @@ const Ne = ({
|
|
|
31
31
|
recordAction: a,
|
|
32
32
|
shouldRenderProviders: P = !0,
|
|
33
33
|
stopPropagationOnEsc: q,
|
|
34
|
-
variant:
|
|
34
|
+
variant: f = "closable",
|
|
35
35
|
items: n,
|
|
36
36
|
parentItem: i,
|
|
37
37
|
...H
|
|
38
38
|
}) => {
|
|
39
|
-
var
|
|
39
|
+
var v, w;
|
|
40
40
|
const {
|
|
41
41
|
open: E,
|
|
42
42
|
defaultOpen: z,
|
|
43
43
|
onOpenChange: F,
|
|
44
44
|
modal: j,
|
|
45
45
|
...r
|
|
46
|
-
} = H,
|
|
46
|
+
} = H, g = Y(), Q = D() <= I.Medium;
|
|
47
47
|
le(q, E);
|
|
48
|
-
const u = (
|
|
49
|
-
a && (
|
|
50
|
-
}, [
|
|
48
|
+
const u = (w = (v = r == null ? void 0 : r.questions) == null ? void 0 : v[r.questions.length - 1]) == null ? void 0 : w.error, [U, N] = l.useState(!1), s = l.useCallback((o) => {
|
|
49
|
+
a && (o.data ?? (o.data = {}), o.data.hostAppName = d, a(o));
|
|
50
|
+
}, [d, a]);
|
|
51
51
|
l.useEffect(() => {
|
|
52
52
|
n || s({
|
|
53
|
-
...
|
|
53
|
+
...C,
|
|
54
54
|
target: "loaded",
|
|
55
55
|
data: {
|
|
56
56
|
fileSize: T,
|
|
@@ -59,70 +59,70 @@ const Ne = ({
|
|
|
59
59
|
});
|
|
60
60
|
}, [s, O, T, n, a]), l.useEffect(() => {
|
|
61
61
|
n && s({
|
|
62
|
-
...
|
|
62
|
+
...C,
|
|
63
63
|
target: "loaded",
|
|
64
64
|
data: {
|
|
65
65
|
parentItemType: i == null ? void 0 : i.type,
|
|
66
|
-
items: n.map((
|
|
67
|
-
status:
|
|
68
|
-
fileType:
|
|
66
|
+
items: n.map((o) => ({
|
|
67
|
+
status: o.status,
|
|
68
|
+
fileType: o.fileType
|
|
69
69
|
}))
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}, [s, i, a]), l.useEffect(() => {
|
|
73
|
-
u && u ===
|
|
73
|
+
u && u === oe.AGENT_NOT_FOUND && N(!0);
|
|
74
74
|
}, [u]);
|
|
75
75
|
const W = () => {
|
|
76
76
|
R && (R(), s({
|
|
77
|
-
...
|
|
77
|
+
...C,
|
|
78
78
|
action: ae,
|
|
79
79
|
target: "clearChat"
|
|
80
80
|
}));
|
|
81
|
-
}, y = l.useCallback(async () => (N(!1),
|
|
81
|
+
}, y = l.useCallback(async () => (N(!1), A()), [A]), b = /* @__PURE__ */ h(c, {
|
|
82
82
|
defaultOpen: z,
|
|
83
83
|
modal: j,
|
|
84
84
|
onOpenChange: F,
|
|
85
85
|
open: E,
|
|
86
86
|
children: [/* @__PURE__ */ e(c.Trigger, {
|
|
87
|
-
children:
|
|
88
|
-
}), /* @__PURE__ */
|
|
89
|
-
className:
|
|
87
|
+
children: _
|
|
88
|
+
}), /* @__PURE__ */ h(c.Content, {
|
|
89
|
+
className: t.contentAnswersModal,
|
|
90
90
|
"data-testid": "content-answers-modal",
|
|
91
91
|
size: "xlarge",
|
|
92
92
|
children: [/* @__PURE__ */ e(c.Header, {
|
|
93
|
-
className:
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
className:
|
|
93
|
+
className: t.modalHeaderContainer,
|
|
94
|
+
children: /* @__PURE__ */ h("div", {
|
|
95
|
+
className: t.modalHeader,
|
|
96
96
|
children: [!Q && /* @__PURE__ */ e(J, {
|
|
97
|
-
className:
|
|
97
|
+
className: t.BoxAIIconColor,
|
|
98
98
|
"data-testid": "content-answers-icon-color",
|
|
99
|
-
height:
|
|
100
|
-
width:
|
|
99
|
+
height: L,
|
|
100
|
+
width: L
|
|
101
101
|
}), /* @__PURE__ */ e(K, {
|
|
102
102
|
as: "span",
|
|
103
103
|
variant: "titleMedium",
|
|
104
|
-
children:
|
|
105
|
-
}), !
|
|
104
|
+
children: g.formatMessage(p.contentAnswersTitle)
|
|
105
|
+
}), !m && M && /* @__PURE__ */ e(se, {
|
|
106
106
|
onSelectAgent: G,
|
|
107
107
|
recordAction: s
|
|
108
|
-
}),
|
|
109
|
-
contentClassName:
|
|
108
|
+
}), m && /* @__PURE__ */ e(V, {
|
|
109
|
+
contentClassName: t.agentSelectorContent,
|
|
110
110
|
disabled: r.hasRequestInProgress,
|
|
111
111
|
fetcher: y,
|
|
112
|
-
hostAppName:
|
|
112
|
+
hostAppName: d,
|
|
113
113
|
recordAction: a,
|
|
114
|
-
requestState: U ?
|
|
114
|
+
requestState: U ? te.ERROR : void 0,
|
|
115
115
|
shouldHideAgentSelectorOnLoad: !0,
|
|
116
|
-
triggerChipClassName:
|
|
116
|
+
triggerChipClassName: t.agentSelectorTrigger
|
|
117
117
|
})]
|
|
118
118
|
})
|
|
119
119
|
}), /* @__PURE__ */ e(Z, {
|
|
120
|
-
className:
|
|
121
|
-
hasCustomSuggestedQuestions:
|
|
122
|
-
hostAppName:
|
|
123
|
-
isAgentSelectorEnabled: !
|
|
124
|
-
isAIStudioAgentSelectorEnabled:
|
|
125
|
-
isDebugModeEnabled:
|
|
120
|
+
className: t.boxAiContentAnswers,
|
|
121
|
+
hasCustomSuggestedQuestions: x,
|
|
122
|
+
hostAppName: d,
|
|
123
|
+
isAgentSelectorEnabled: !m && M,
|
|
124
|
+
isAIStudioAgentSelectorEnabled: m,
|
|
125
|
+
isDebugModeEnabled: k,
|
|
126
126
|
isStopResponseEnabled: S,
|
|
127
127
|
items: n,
|
|
128
128
|
parentItem: i,
|
|
@@ -131,18 +131,19 @@ const Ne = ({
|
|
|
131
131
|
}), B && /* @__PURE__ */ e(re, {
|
|
132
132
|
onClick: W
|
|
133
133
|
}), /* @__PURE__ */ e(c.Close, {
|
|
134
|
-
"aria-label":
|
|
135
|
-
className:
|
|
136
|
-
|
|
134
|
+
"aria-label": f === "collapsible" ? g.formatMessage(p.collapseModalAriaLabel) : g.formatMessage(p.closeModalAriaLabel),
|
|
135
|
+
className: t["modal-close-button"],
|
|
136
|
+
"data-target-id": f === "collapsible" ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal",
|
|
137
|
+
icon: f === "collapsible" ? $ : void 0,
|
|
137
138
|
size: "small"
|
|
138
139
|
})]
|
|
139
140
|
})]
|
|
140
141
|
});
|
|
141
142
|
return P ? /* @__PURE__ */ e(X, {
|
|
142
143
|
children: /* @__PURE__ */ e(ee, {
|
|
143
|
-
children:
|
|
144
|
+
children: b
|
|
144
145
|
})
|
|
145
|
-
}) :
|
|
146
|
+
}) : b;
|
|
146
147
|
};
|
|
147
148
|
export {
|
|
148
149
|
Ne as IntelligenceModal,
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { Text as r } from "@box/blueprint-web";
|
|
2
|
-
import
|
|
3
|
-
import { MediaContainer as
|
|
2
|
+
import d from "clsx";
|
|
3
|
+
import { MediaContainer as i } from "../common/media-container.js";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
import '../../../../styles/question.css';const
|
|
6
|
-
question:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import '../../../../styles/question.css';const c = "_question_1qk3n_1", m = "_sidebar_1qk3n_6", l = "_text_1qk3n_9", e = {
|
|
6
|
+
question: c,
|
|
7
|
+
sidebar: m,
|
|
8
|
+
text: l
|
|
9
|
+
}, b = ({
|
|
10
|
+
prompt: o,
|
|
10
11
|
variant: s = "modal"
|
|
11
12
|
}) => {
|
|
12
|
-
const n = s === "sidebar", a = /* @__PURE__ */ t(
|
|
13
|
+
const n = s === "sidebar", a = /* @__PURE__ */ t(i.Content, {
|
|
13
14
|
isUsedInsideSidebar: n,
|
|
14
15
|
variant: "question",
|
|
15
16
|
children: /* @__PURE__ */ t(r, {
|
|
16
17
|
as: "span",
|
|
17
|
-
className:
|
|
18
|
-
children:
|
|
18
|
+
className: e.text,
|
|
19
|
+
children: o
|
|
19
20
|
})
|
|
20
21
|
});
|
|
21
22
|
return /* @__PURE__ */ t("div", {
|
|
22
|
-
className: e.question,
|
|
23
|
+
className: d(e.question, n && e.sidebar),
|
|
23
24
|
"data-testid": "content-answers-question",
|
|
24
|
-
children: /* @__PURE__ */ t(
|
|
25
|
+
children: /* @__PURE__ */ t(i, {
|
|
25
26
|
className: "question",
|
|
26
27
|
variant: s,
|
|
27
28
|
children: a
|
|
@@ -29,6 +30,6 @@ import '../../../../styles/question.css';const d = "_question_yk230_1", m = "_te
|
|
|
29
30
|
});
|
|
30
31
|
};
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
b as Question,
|
|
34
|
+
b as default
|
|
34
35
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { FilterChip as e } from "@box/blueprint-web";
|
|
2
2
|
import l from "clsx";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
import '../../../../styles/suggestions.css';const c = "
|
|
4
|
+
import '../../../../styles/suggestions.css';const c = "_suggestions_z97no_1", u = "_sidebar_z97no_6", m = "_suggestion_z97no_1", n = {
|
|
5
5
|
suggestions: c,
|
|
6
6
|
sidebar: u,
|
|
7
7
|
suggestion: m
|
|
8
8
|
}, h = ({
|
|
9
|
-
askSuggestedQuestion:
|
|
9
|
+
askSuggestedQuestion: i,
|
|
10
10
|
isLoading: a,
|
|
11
11
|
onSuggestedQuestionClick: r,
|
|
12
12
|
suggestedQuestions: g,
|
|
13
13
|
variant: d = "modal"
|
|
14
14
|
}) => /* @__PURE__ */ t(e.Group, {
|
|
15
|
-
className: l(
|
|
15
|
+
className: l(n.suggestions, d === "sidebar" && n.sidebar),
|
|
16
16
|
"data-testid": "content-answers-suggested-questions",
|
|
17
17
|
name: "Singleselect SuggestedQuestions",
|
|
18
18
|
type: "single",
|
|
19
|
-
value:
|
|
19
|
+
value: i,
|
|
20
20
|
children: g.map((s) => {
|
|
21
|
-
const
|
|
21
|
+
const o = s.label || s.prompt;
|
|
22
22
|
return /* @__PURE__ */ t(e.ChipButton, {
|
|
23
|
-
className:
|
|
23
|
+
className: n.suggestion,
|
|
24
24
|
"data-testid": `content-answers-${s.id}`,
|
|
25
25
|
disabled: a,
|
|
26
26
|
onClick: () => r(s.prompt),
|
|
27
|
-
value:
|
|
27
|
+
value: o,
|
|
28
28
|
children: /* @__PURE__ */ t(e.Label, {
|
|
29
|
-
children:
|
|
29
|
+
children: o
|
|
30
30
|
})
|
|
31
31
|
}, s.id);
|
|
32
32
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.93.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.16.0",
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
"remarkable": "^2.0.1"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@box/
|
|
19
|
-
"@box/blueprint-web
|
|
20
|
-
"@box/
|
|
21
|
-
"@box/
|
|
22
|
-
"@box/
|
|
18
|
+
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
19
|
+
"@box/blueprint-web": "^9.18.0",
|
|
20
|
+
"@box/blueprint-web-assets": "^4.33.1",
|
|
21
|
+
"@box/box-ai-agent-selector": "^0.26.1",
|
|
22
|
+
"@box/item-icon": "^0.9.82",
|
|
23
|
+
"@box/storybook-utils": "^0.8.3",
|
|
23
24
|
"@testing-library/react": "^15.0.6",
|
|
24
25
|
"react": "^18.3.0",
|
|
25
26
|
"react-dom": "^18.3.0",
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"**/*.css"
|
|
57
58
|
],
|
|
58
59
|
"license": "SEE LICENSE IN LICENSE",
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "a2056d2f579edc055a85156efe0e93414840445e"
|
|
60
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._mediaContainer_1392k_1{display:flex;align-items:flex-start;margin-top:1rem;margin-bottom:1rem}._mediaContainer_1392k_1 ._figure_1392k_7{flex:0 0 auto;align-self:flex-start;justify-self:flex-start;margin:.75rem .75rem 0 0;padding:0}._mediaContainer_1392k_1 ._figure_1392k_7._sidebar_1392k_14{margin:0}._mediaContainer_1392k_1 ._figure_1392k_7._center-aligned_1392k_17{align-self:center;margin:0 .75rem 0 0}._mediaContainer_1392k_1 ._figure_1392k_7._center-aligned_1392k_17._sidebar_1392k_14{align-self:flex-start}._mediaContainer_1392k_1 ._figure_1392k_7._top-aligned_1392k_24{align-self:top;margin:0 .75rem 0 0}._mediaContainer_1392k_1._sidebar_1392k_14{flex-direction:column;gap:.5rem;margin-bottom:1.25rem}._mediaContainer_1392k_1._welcomeMessage_1392k_33{margin-top:.25rem;margin-bottom:0}._mediaContainer_1392k_1._welcomeMessage_1392k_33._modal_1392k_37{margin-top:0}._mediaContainer_1392k_1._question_1392k_40{align-items:center;justify-content:flex-end;border-radius:1.5rem}._mediaContainer_1392k_1._question_1392k_40 ._figure_1392k_7{align-self:center;margin:0 0 0 .75rem}._mediaContainer_1392k_1._question_1392k_40._sidebar_1392k_14{margin-top:.75rem;margin-bottom:.75rem}._mediaContainer_1392k_1._question_1392k_40._sidebar_1392k_14 ._figure_1392k_7{align-self:flex-end}._mediaContainer_1392k_1._question_1392k_40 ._contentCard_1392k_56{background-color:#ece9f8;border-radius:1.5rem;line-height:1.5rem;padding:.75rem 1rem}._mediaContainer_1392k_1._answer_1392k_62._sidebar_1392k_14{margin-top:.75rem;margin-bottom:.75rem}._mediaContainer_1392k_1 ._body_1392k_66{min-width:0;word-wrap:break-word;word-break:break-word;overflow-wrap:break-word}._mediaContainer_1392k_1 ._body_1392k_66._answer_1392k_62{border:none;width:100%}._mediaContainer_1392k_1 ._body_1392k_66._answer_1392k_62 ._contentCard_1392k_56{background-color:transparent;border:none;border-radius:1.5rem;padding:1rem .75rem}._mediaContainer_1392k_1 ._body_1392k_66._answer_1392k_62 ._contentCard_1392k_56:hover{background-color:#f4f4f4}._mediaContainer_1392k_1 ._body_1392k_66._welcomeMessage_1392k_33{border:none;width:100%}._mediaContainer_1392k_1 ._body_1392k_66._welcomeMessage_1392k_33 ._contentCard_1392k_56{padding:.75rem 1rem .25rem;background-color:transparent;border:none;border-radius:1.5rem}._mediaContainer_1392k_1 ._body_1392k_66._welcomeMessage_1392k_33 ._contentCard_1392k_56._modal_1392k_37{padding-top:1rem}._mediaContainer_1392k_1 ._body_1392k_66._sidebar_1392k_14._question_1392k_40{align-self:flex-end}._mediaContainer_1392k_1 ._body_1392k_66._error_1392k_101{display:flex;align-items:center;box-sizing:border-box;width:100%;padding:.75rem 1rem;background-color:#fdebee;border:.125rem solid #f69bab;border-radius:1.75rem}@media (max-width: 767px){._mediaContainer_1392k_1 ._body_1392k_66._error_1392k_101{flex-wrap:wrap;width:unset}}
|
package/styles/question.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._question_1qk3n_1{margin-top:1rem;margin-left:8rem;white-space:pre-wrap}._question_1qk3n_1._sidebar_1qk3n_6{margin-left:4.5rem}._question_1qk3n_1 ._text_1qk3n_9{font-size:.9375rem;line-height:1.5rem}@media (max-width: 767px){._question_1qk3n_1{margin-left:4.5rem}}
|
package/styles/suggestions.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._suggestions_z97no_1{gap:.75rem;flex-wrap:wrap;margin-top:.75rem}._suggestions_z97no_1._sidebar_z97no_6{margin-top:.5rem;margin-left:1rem}._suggestions_z97no_1 ._suggestion_z97no_1{height:auto;min-height:2.5rem;text-align:start;padding:.5rem 0;border-radius:1.5rem}._suggestions_z97no_1 ._suggestion_z97no_1 span{font-size:.9375rem;line-height:1.5rem;text-align:start;white-space:normal}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._welcomeMessage_1g76d_1 ._clearChatText_1g76d_1{color:#6f6f6f;font-size:.75rem}._welcomeMessage_1g76d_1 ._warningNotice_1g76d_5{margin-bottom:.75rem;border-radius:1.5rem}._welcomeMessage_1g76d_1 ._iconAvatar_1g76d_9{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border-radius:50%}@media (max-width: 374px){._welcomeMessage_1g76d_1 ._iconAvatar_1g76d_9{width:var(--size-6);height:var(--size-6)}}@media (max-width: 374px){._welcomeMessage_1g76d_1{margin-top:0}}
|