@box/box-ai-content-answers 0.97.2 → 0.97.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/lib/components/answer/citation.js +52 -52
- package/esm/lib/components/answer/copy-button.js +11 -10
- package/esm/lib/components/answer/thumb-buttons.js +28 -27
- package/esm/lib/components/common/focusInputUtils.js +8 -0
- package/esm/lib/components/footer/constants.js +2 -1
- package/esm/lib/components/footer/footer.js +52 -52
- package/package.json +5 -5
- package/styles/citation.css +1 -1
- package/types/lib/components/common/focusInputUtils.d.ts +1 -0
- package/types/lib/components/footer/constants.d.ts +1 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Popover as
|
|
2
|
-
import { ArrowUpRightSquare as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useState as
|
|
1
|
+
import { Popover as u, Status as O, Text as x, TextButton as E } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowUpRightSquare as L } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import M from "clsx";
|
|
4
|
+
import D from "lodash/debounce";
|
|
5
|
+
import G from "lodash/truncate";
|
|
6
|
+
import { useState as y, useRef as R, useCallback as F, useEffect as A } from "react";
|
|
7
7
|
import { useIntl as j } from "react-intl";
|
|
8
|
-
import { LOGGER_BASE_CONFIG as
|
|
8
|
+
import { LOGGER_BASE_CONFIG as I, 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
|
|
12
|
-
import '../../../../styles/citation.css';const U = "
|
|
11
|
+
import { jsxs as N, jsx as a } from "react/jsx-runtime";
|
|
12
|
+
import '../../../../styles/citation.css';const U = "_citationTrigger_4yo68_1", q = "_citationStatus_4yo68_5", H = "_animate_4yo68_26", W = "_fadeIn_4yo68_30", X = "_cardTooltip_4yo68_34", $ = "_cardTooltipTitle_4yo68_38", k = "_cardTooltipCitation_4yo68_42", z = "_cardTooltipButton_4yo68_47", o = {
|
|
13
13
|
citationTrigger: U,
|
|
14
14
|
citationStatus: q,
|
|
15
15
|
animate: H,
|
|
@@ -19,76 +19,76 @@ import '../../../../styles/citation.css';const U = "_citationTrigger_mfhpi_1", q
|
|
|
19
19
|
cardTooltipCitation: k,
|
|
20
20
|
cardTooltipButton: z
|
|
21
21
|
}, rt = ({
|
|
22
|
-
animate:
|
|
22
|
+
animate: p,
|
|
23
23
|
content: m,
|
|
24
24
|
id: e,
|
|
25
|
-
recordAction:
|
|
25
|
+
recordAction: n,
|
|
26
26
|
fileId: _,
|
|
27
27
|
title: c,
|
|
28
28
|
onCitationClick: l
|
|
29
29
|
}) => {
|
|
30
|
-
const [
|
|
31
|
-
formatMessage:
|
|
32
|
-
} = j(),
|
|
33
|
-
let
|
|
34
|
-
c ?
|
|
30
|
+
const [g, S] = y(!1), [b, v] = y(!p), {
|
|
31
|
+
formatMessage: i
|
|
32
|
+
} = j(), h = !!l, C = R(null);
|
|
33
|
+
let T;
|
|
34
|
+
c ? T = i(s.cardTooltipTitleWithDocumentName, {
|
|
35
35
|
title: c.toString()
|
|
36
|
-
}) :
|
|
37
|
-
const B =
|
|
38
|
-
|
|
39
|
-
...
|
|
36
|
+
}) : T = i(s.cardTooltipTitle);
|
|
37
|
+
const B = D((t) => {
|
|
38
|
+
S(t), t === !0 && n && n({
|
|
39
|
+
...I,
|
|
40
40
|
feature: "answers-citations",
|
|
41
41
|
target: "hovered",
|
|
42
42
|
data: {
|
|
43
43
|
index: e
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
}, 100),
|
|
46
|
+
}, 100), d = () => {
|
|
47
47
|
B(!0);
|
|
48
48
|
}, r = () => {
|
|
49
49
|
B(!1);
|
|
50
|
-
},
|
|
51
|
-
l &&
|
|
52
|
-
...
|
|
50
|
+
}, w = F(() => {
|
|
51
|
+
l && n && (l(_, c), n({
|
|
52
|
+
...I,
|
|
53
53
|
feature: "answers-citations",
|
|
54
54
|
target: K,
|
|
55
55
|
data: {
|
|
56
56
|
index: e
|
|
57
57
|
}
|
|
58
58
|
}));
|
|
59
|
-
}, [l,
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
}, [l, n, e, _, c]);
|
|
60
|
+
A(() => {
|
|
61
|
+
p && v(!0);
|
|
62
62
|
}, []);
|
|
63
|
-
const
|
|
63
|
+
const f = m ? G(m.toString(), {
|
|
64
64
|
length: P,
|
|
65
65
|
separator: /,? +/
|
|
66
66
|
}) : void 0;
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ N(u.Root, {
|
|
68
68
|
modal: !1,
|
|
69
|
-
open:
|
|
70
|
-
children: [/* @__PURE__ */ a(
|
|
69
|
+
open: g,
|
|
70
|
+
children: [/* @__PURE__ */ a(u.Trigger, {
|
|
71
71
|
className: o.citationTrigger,
|
|
72
|
-
onMouseEnter:
|
|
72
|
+
onMouseEnter: d,
|
|
73
73
|
onMouseLeave: r,
|
|
74
|
-
children: /* @__PURE__ */ a(
|
|
74
|
+
children: /* @__PURE__ */ a(O, {
|
|
75
75
|
ref: C,
|
|
76
|
-
"aria-label":
|
|
76
|
+
"aria-label": g ? f : i(s.referenceAriaLabel, {
|
|
77
77
|
number: e
|
|
78
78
|
}),
|
|
79
|
-
className:
|
|
80
|
-
[o.animate]:
|
|
81
|
-
[o.fadeIn]:
|
|
79
|
+
className: M(o.citationStatus, {
|
|
80
|
+
[o.animate]: p,
|
|
81
|
+
[o.fadeIn]: b
|
|
82
82
|
}),
|
|
83
83
|
colorIndex: 0,
|
|
84
84
|
"data-testid": "content-answers-citation-status",
|
|
85
85
|
onBlur: r,
|
|
86
|
-
onFocus:
|
|
86
|
+
onFocus: d,
|
|
87
87
|
tabIndex: 0,
|
|
88
88
|
text: `${e}`
|
|
89
89
|
})
|
|
90
|
-
}), /* @__PURE__ */ a(
|
|
91
|
-
"aria-label":
|
|
90
|
+
}), /* @__PURE__ */ a(u.ContentContainer, {
|
|
91
|
+
"aria-label": f,
|
|
92
92
|
collisionPadding: 10,
|
|
93
93
|
"data-testid": "content-answers-citation-card",
|
|
94
94
|
onBlur: r,
|
|
@@ -97,35 +97,35 @@ import '../../../../styles/citation.css';const U = "_citationTrigger_mfhpi_1", q
|
|
|
97
97
|
var t;
|
|
98
98
|
(t = C.current) == null || t.focus(), r();
|
|
99
99
|
},
|
|
100
|
-
onFocus:
|
|
101
|
-
onMouseEnter:
|
|
100
|
+
onFocus: d,
|
|
101
|
+
onMouseEnter: d,
|
|
102
102
|
onMouseLeave: r,
|
|
103
103
|
onOpenAutoFocus: (t) => {
|
|
104
|
-
|
|
104
|
+
h || t.preventDefault();
|
|
105
105
|
},
|
|
106
106
|
side: "top",
|
|
107
107
|
sideOffset: 5,
|
|
108
|
-
children: /* @__PURE__ */ a(
|
|
109
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ a(u.MainContent, {
|
|
109
|
+
children: /* @__PURE__ */ N("div", {
|
|
110
110
|
className: o.cardTooltip,
|
|
111
111
|
children: [/* @__PURE__ */ a(x, {
|
|
112
112
|
as: "h4",
|
|
113
113
|
className: o.cardTooltipTitle,
|
|
114
114
|
variant: "bodyDefaultBold",
|
|
115
|
-
children:
|
|
115
|
+
children: T
|
|
116
116
|
}), /* @__PURE__ */ a(x, {
|
|
117
117
|
as: "p",
|
|
118
118
|
className: o.cardTooltipCitation,
|
|
119
119
|
color: "textOnLightDefault",
|
|
120
120
|
variant: "caption",
|
|
121
|
-
children:
|
|
122
|
-
}),
|
|
123
|
-
"aria-label":
|
|
121
|
+
children: f
|
|
122
|
+
}), h && /* @__PURE__ */ a(E, {
|
|
123
|
+
"aria-label": i(s.cardTooltipButton),
|
|
124
124
|
className: o.cardTooltipButton,
|
|
125
|
-
icon:
|
|
126
|
-
onClick:
|
|
125
|
+
icon: L,
|
|
126
|
+
onClick: w,
|
|
127
127
|
"data-target-id": "TextButton-cardTooltipButton",
|
|
128
|
-
children:
|
|
128
|
+
children: i(s.cardTooltipButton)
|
|
129
129
|
})]
|
|
130
130
|
})
|
|
131
131
|
})
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { useNotification as n, Tooltip as l, IconButton as
|
|
2
|
-
import { Clipboard as
|
|
3
|
-
import { useIntl as
|
|
1
|
+
import { useNotification as n, Tooltip as l, IconButton as m } from "@box/blueprint-web";
|
|
2
|
+
import { Clipboard as u } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { useIntl as d } from "react-intl";
|
|
4
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
|
+
import { focusInput as T } from "../common/focusInputUtils.js";
|
|
7
8
|
import { jsx as s } from "react/jsx-runtime";
|
|
8
|
-
const
|
|
9
|
+
const N = ({
|
|
9
10
|
answer: i,
|
|
10
11
|
onAnswerCopy: a,
|
|
11
12
|
recordAction: r
|
|
12
13
|
}) => {
|
|
13
14
|
const {
|
|
14
15
|
formatMessage: o
|
|
15
|
-
} =
|
|
16
|
+
} = d(), {
|
|
16
17
|
addNotification: c
|
|
17
18
|
} = n(), p = () => {
|
|
18
19
|
r && r({
|
|
@@ -27,13 +28,13 @@ const L = ({
|
|
|
27
28
|
typeIconAriaLabel: o(t.copyButtonSuccessText),
|
|
28
29
|
closeButtonAriaLabel: o(f.closeButtonText)
|
|
29
30
|
}), a && a(i);
|
|
30
|
-
});
|
|
31
|
+
}), T();
|
|
31
32
|
};
|
|
32
33
|
return /* @__PURE__ */ s(l, {
|
|
33
34
|
content: o(t.copyToClipboard),
|
|
34
|
-
children: /* @__PURE__ */ s(
|
|
35
|
+
children: /* @__PURE__ */ s(m, {
|
|
35
36
|
"aria-label": o(t.copyToClipboard),
|
|
36
|
-
icon:
|
|
37
|
+
icon: u,
|
|
37
38
|
onClick: p,
|
|
38
39
|
onFocusCapture: (e) => {
|
|
39
40
|
e.target.matches(":focus-visible") || e.stopPropagation();
|
|
@@ -44,6 +45,6 @@ const L = ({
|
|
|
44
45
|
});
|
|
45
46
|
};
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
N as CopyButton,
|
|
49
|
+
N as default
|
|
49
50
|
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { Tooltip as
|
|
1
|
+
import { Tooltip as f, IconButton as _ } from "@box/blueprint-web";
|
|
2
2
|
import { ThumbUp as B, ThumbDown as M } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
3
|
import { ThumbUp as d, ThumbDown as O } from "@box/blueprint-web-assets/icons/Line";
|
|
4
|
-
import
|
|
4
|
+
import e from "react";
|
|
5
5
|
import { useIntl as C } from "react-intl";
|
|
6
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 {
|
|
9
|
-
import
|
|
10
|
-
|
|
8
|
+
import { focusInput as N } from "../common/focusInputUtils.js";
|
|
9
|
+
import { jsxs as g, Fragment as w, jsx as b } from "react/jsx-runtime";
|
|
10
|
+
import '../../../../styles/thumb-buttons.css';const I = "_thumbDown_1axcd_1", x = {
|
|
11
|
+
thumbDown: I
|
|
11
12
|
}, o = {
|
|
12
13
|
THUMB_UP: "positive",
|
|
13
14
|
THUMB_DOWN: "negative",
|
|
14
15
|
NONE: "none"
|
|
15
|
-
},
|
|
16
|
+
}, z = ({
|
|
16
17
|
recordAction: m,
|
|
17
18
|
variant: i,
|
|
18
|
-
items:
|
|
19
|
-
hostAppName:
|
|
20
|
-
questionId:
|
|
21
|
-
feedbackValue:
|
|
19
|
+
items: p,
|
|
20
|
+
hostAppName: r,
|
|
21
|
+
questionId: h,
|
|
22
|
+
feedbackValue: U,
|
|
22
23
|
setAnswerFeedback: l
|
|
23
24
|
}) => {
|
|
24
25
|
const {
|
|
25
|
-
formatMessage:
|
|
26
|
-
} = C(), a =
|
|
27
|
-
a !== t && (l == null || l(
|
|
26
|
+
formatMessage: n
|
|
27
|
+
} = C(), a = U, T = e.useMemo(() => p.filter((t) => t.status === "supported").map((t) => t.fileType), [p]), s = e.useCallback((t) => {
|
|
28
|
+
a !== t && (l == null || l(h, t), m == null || m({
|
|
28
29
|
...H,
|
|
29
30
|
action: L,
|
|
30
31
|
target: "answer_feedback",
|
|
@@ -32,25 +33,25 @@ import '../../../../styles/thumb-buttons.css';const w = "_thumbDown_1axcd_1", x
|
|
|
32
33
|
data: {
|
|
33
34
|
feedback_value: t,
|
|
34
35
|
file_types: T,
|
|
35
|
-
feature:
|
|
36
|
+
feature: r
|
|
36
37
|
}
|
|
37
|
-
}));
|
|
38
|
-
}, [
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
children: [/* @__PURE__ */ b(
|
|
41
|
-
content:
|
|
42
|
-
children: /* @__PURE__ */ b(
|
|
43
|
-
"aria-label":
|
|
38
|
+
}), N());
|
|
39
|
+
}, [r, m, a, i, T, h, l]), c = e.useCallback(() => s(o.THUMB_UP), [s]), D = e.useCallback(() => s(o.THUMB_DOWN), [s]);
|
|
40
|
+
return /* @__PURE__ */ g(w, {
|
|
41
|
+
children: [/* @__PURE__ */ b(f, {
|
|
42
|
+
content: n(u.thumbsUpAriaLabel),
|
|
43
|
+
children: /* @__PURE__ */ b(_, {
|
|
44
|
+
"aria-label": n(u.thumbsUpAriaLabel),
|
|
44
45
|
disabled: a === o.THUMB_DOWN,
|
|
45
46
|
icon: a === o.THUMB_UP ? B : d,
|
|
46
47
|
onClick: c,
|
|
47
48
|
size: "x-small",
|
|
48
49
|
"data-target-id": "IconButton-thumbsUpAriaLabel"
|
|
49
50
|
})
|
|
50
|
-
}), /* @__PURE__ */ b(
|
|
51
|
-
content:
|
|
52
|
-
children: /* @__PURE__ */ b(
|
|
53
|
-
"aria-label":
|
|
51
|
+
}), /* @__PURE__ */ b(f, {
|
|
52
|
+
content: n(u.thumbsDownAriaLabel),
|
|
53
|
+
children: /* @__PURE__ */ b(_, {
|
|
54
|
+
"aria-label": n(u.thumbsDownAriaLabel),
|
|
54
55
|
className: x.thumbDown,
|
|
55
56
|
disabled: a === o.THUMB_UP,
|
|
56
57
|
icon: a === o.THUMB_DOWN ? M : O,
|
|
@@ -62,6 +63,6 @@ import '../../../../styles/thumb-buttons.css';const w = "_thumbDown_1axcd_1", x
|
|
|
62
63
|
});
|
|
63
64
|
};
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
z as ThumbButtons,
|
|
67
|
+
z as default
|
|
67
68
|
};
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import W from "clsx";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { useBreakpoint as
|
|
3
|
+
import { useIntl as z } from "react-intl";
|
|
4
|
+
import { useBreakpoint as V, Breakpoint as Y, TextArea as $, Tooltip as J, Button as Q } from "@box/blueprint-web";
|
|
5
5
|
import { ArrowUp as Z } from "@box/blueprint-web-assets/icons/Fill";
|
|
6
6
|
import { useAgents as g } from "@box/box-ai-agent-selector";
|
|
7
7
|
import { useAgents as q } from "../../contexts/AgentsContext.js";
|
|
8
8
|
import { FooterActions as P } from "./footer-actions.js";
|
|
9
9
|
import { getAIAgentConfig as N } from "../common/agentUtils.js";
|
|
10
10
|
import { isDebugModeTrigger as tt, isEnterTrigger as at } from "../common/keyInputUtils.js";
|
|
11
|
-
import { TEXT_AREA as
|
|
11
|
+
import { TEXT_AREA as i, INPUT_TARGET_ID as rt } from "./constants.js";
|
|
12
12
|
import u from "./messages.js";
|
|
13
|
-
import { LOGGER_BASE_CONFIG as O, LOGGER_ACTION_CLICK as
|
|
13
|
+
import { LOGGER_BASE_CONFIG as O, LOGGER_ACTION_CLICK as et, LOGGER_ACTION_KEYPRESS as st } from "../common/constants.js";
|
|
14
14
|
import { jsxs as X, jsx as b } from "react/jsx-runtime";
|
|
15
|
-
import '../../../../styles/footer.css';const
|
|
16
|
-
questionInput:
|
|
15
|
+
import '../../../../styles/footer.css';const it = "_questionInput_169rs_1", ot = "_avatar_169rs_26", nt = "_submitButton_169rs_29", mt = "_textArea_169rs_45", ut = "_error_169rs_68", ct = "_sidebar_169rs_71", lt = "_submitButtonTooltip_169rs_79", T = {
|
|
16
|
+
questionInput: it,
|
|
17
17
|
avatar: ot,
|
|
18
|
-
submitButton:
|
|
19
|
-
textArea:
|
|
20
|
-
error:
|
|
21
|
-
sidebar:
|
|
22
|
-
submitButtonTooltip:
|
|
23
|
-
},
|
|
24
|
-
askSuggestedQuestion:
|
|
18
|
+
submitButton: nt,
|
|
19
|
+
textArea: mt,
|
|
20
|
+
error: ut,
|
|
21
|
+
sidebar: ct,
|
|
22
|
+
submitButtonTooltip: lt
|
|
23
|
+
}, vt = ({
|
|
24
|
+
askSuggestedQuestion: C,
|
|
25
25
|
enableDebugMode: x = !1,
|
|
26
26
|
hasRequestInProgress: e,
|
|
27
27
|
isAgentSelectorEnabled: f,
|
|
28
28
|
isAIStudioAgentSelectorEnabled: p,
|
|
29
|
-
isDebugModeShown:
|
|
30
|
-
isStopResponseEnabled:
|
|
31
|
-
isStreamingEnabled:
|
|
32
|
-
lastQuestion:
|
|
29
|
+
isDebugModeShown: h,
|
|
30
|
+
isStopResponseEnabled: R,
|
|
31
|
+
isStreamingEnabled: w,
|
|
32
|
+
lastQuestion: A,
|
|
33
33
|
onRetryQuestion: E,
|
|
34
|
-
onStopQuestion:
|
|
34
|
+
onStopQuestion: H,
|
|
35
35
|
recordAction: s,
|
|
36
36
|
sendQuestion: L,
|
|
37
37
|
setAskSuggestedQuestion: M,
|
|
38
|
-
toggleDebugMode:
|
|
38
|
+
toggleDebugMode: o,
|
|
39
39
|
variant: I = "modal"
|
|
40
40
|
}) => {
|
|
41
|
-
const v = I === "sidebar", n =
|
|
41
|
+
const v = I === "sidebar", n = z(), y = V(), a = /* @__PURE__ */ r.createRef(), K = y <= Y.Medium && !v ? i.MAX_ROWS_MOBILE : i.MAX_ROWS, [c, B] = r.useState(!0), [F, G] = r.useState(!1), {
|
|
42
42
|
selectedAgent: _
|
|
43
43
|
} = q(), {
|
|
44
44
|
selectedAgent: d
|
|
45
|
-
} = g(),
|
|
45
|
+
} = g(), k = r.useCallback(() => {
|
|
46
46
|
a.current && a.current.focus();
|
|
47
47
|
}, [a]), j = r.useCallback(() => {
|
|
48
48
|
var m;
|
|
49
49
|
let t = ((m = a.current) == null ? void 0 : m.value) ?? "";
|
|
50
|
-
a.current && t.length >
|
|
50
|
+
a.current && t.length > i.MAX_LENGTH && (a.current.value = t.slice(0, i.MAX_LENGTH), t = a.current.value), G(t.length >= i.MAX_LENGTH), B(t.trim().length === 0);
|
|
51
51
|
}, [a]), l = r.useCallback(() => {
|
|
52
|
-
if (
|
|
52
|
+
if (k(), !e && a.current) {
|
|
53
53
|
const t = {
|
|
54
54
|
prompt: a.current.value
|
|
55
55
|
};
|
|
@@ -57,66 +57,66 @@ import '../../../../styles/footer.css';const st = "_questionInput_169rs_1", ot =
|
|
|
57
57
|
const m = N(f, _, p, d);
|
|
58
58
|
L(t, m), a.current.value = "", B(!0), G(!1);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
h && o && o();
|
|
61
61
|
}
|
|
62
|
-
}, [d,
|
|
62
|
+
}, [d, k, e, a, p, f, h, _, L, o]), D = r.useCallback((t) => {
|
|
63
63
|
t.preventDefault(), !e && !c && s && s({
|
|
64
64
|
...O,
|
|
65
|
-
action:
|
|
65
|
+
action: et,
|
|
66
66
|
target: "ask"
|
|
67
67
|
}), l();
|
|
68
|
-
}, [e, c, s, l]),
|
|
69
|
-
x &&
|
|
68
|
+
}, [e, c, s, l]), S = r.useCallback((t) => {
|
|
69
|
+
x && o && tt(t) && o(), at(t) && (t.preventDefault(), !e && !c && s && s({
|
|
70
70
|
...O,
|
|
71
|
-
action:
|
|
71
|
+
action: st,
|
|
72
72
|
target: "ask"
|
|
73
73
|
}), l());
|
|
74
|
-
}, [x, e, c, s, l,
|
|
74
|
+
}, [x, e, c, s, l, o]), U = r.useCallback((t) => {
|
|
75
75
|
const m = N(f, _, p, d);
|
|
76
76
|
E(t, m);
|
|
77
77
|
}, [d, p, f, E, _]);
|
|
78
78
|
return r.useEffect(() => {
|
|
79
|
-
queueMicrotask(
|
|
79
|
+
queueMicrotask(k);
|
|
80
80
|
}, []), r.useEffect(() => {
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
children: [
|
|
84
|
-
isStopResponseEnabled:
|
|
85
|
-
isStreamingEnabled:
|
|
86
|
-
lastQuestion:
|
|
87
|
-
onRetryQuestion:
|
|
88
|
-
onStopQuestion:
|
|
81
|
+
C && a.current && !e && M && (a.current.value = C, l(), M(null));
|
|
82
|
+
}, [C]), /* @__PURE__ */ X("div", {
|
|
83
|
+
children: [A && /* @__PURE__ */ b(P, {
|
|
84
|
+
isStopResponseEnabled: R,
|
|
85
|
+
isStreamingEnabled: w,
|
|
86
|
+
lastQuestion: A,
|
|
87
|
+
onRetryQuestion: U,
|
|
88
|
+
onStopQuestion: H,
|
|
89
89
|
recordAction: s
|
|
90
90
|
}), /* @__PURE__ */ X("div", {
|
|
91
|
-
className:
|
|
92
|
-
children: [/* @__PURE__ */ b(
|
|
91
|
+
className: W(T.questionInput, v && T.sidebar),
|
|
92
|
+
children: [/* @__PURE__ */ b($, {
|
|
93
93
|
ref: a,
|
|
94
|
-
className:
|
|
95
|
-
"data-target-id":
|
|
94
|
+
className: T.textArea,
|
|
95
|
+
"data-target-id": rt,
|
|
96
96
|
"data-testid": "content-answers-question-input",
|
|
97
97
|
error: F && n.formatMessage(u.maxCharactersReachedError, {
|
|
98
|
-
characterLimit:
|
|
98
|
+
characterLimit: i.MAX_LENGTH
|
|
99
99
|
}),
|
|
100
100
|
hideLabel: !0,
|
|
101
101
|
label: n.formatMessage(u.askQuestionPlaceholder),
|
|
102
|
-
maxLength:
|
|
102
|
+
maxLength: i.MAX_LENGTH,
|
|
103
103
|
maxRows: K,
|
|
104
104
|
onChange: j,
|
|
105
|
-
onKeyDown:
|
|
105
|
+
onKeyDown: S,
|
|
106
106
|
placeholder: n.formatMessage(u.askQuestionPlaceholder)
|
|
107
|
-
}), /* @__PURE__ */ b(
|
|
107
|
+
}), /* @__PURE__ */ b(J, {
|
|
108
108
|
content: n.formatMessage(u.ask),
|
|
109
109
|
"data-testid": "ask-tooltip",
|
|
110
110
|
variant: "standard",
|
|
111
|
-
children: /* @__PURE__ */ b(
|
|
111
|
+
children: /* @__PURE__ */ b(Q, {
|
|
112
112
|
"aria-label": n.formatMessage(u.ask),
|
|
113
|
-
className:
|
|
113
|
+
className: T.submitButton,
|
|
114
114
|
"data-testid": "content-answers-submit-button",
|
|
115
115
|
disabled: c || e,
|
|
116
116
|
icon: Z,
|
|
117
117
|
loading: e,
|
|
118
118
|
loadingAriaLabel: n.formatMessage(u.askDisabledTooltip),
|
|
119
|
-
onClick:
|
|
119
|
+
onClick: D,
|
|
120
120
|
size: "large",
|
|
121
121
|
"data-target-id": "Button-ask"
|
|
122
122
|
})
|
|
@@ -125,5 +125,5 @@ import '../../../../styles/footer.css';const st = "_questionInput_169rs_1", ot =
|
|
|
125
125
|
});
|
|
126
126
|
};
|
|
127
127
|
export {
|
|
128
|
-
|
|
128
|
+
vt as Footer
|
|
129
129
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.97.
|
|
3
|
+
"version": "0.97.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.16.0",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
19
|
-
"@box/blueprint-web": "^9.18.
|
|
19
|
+
"@box/blueprint-web": "^9.18.4",
|
|
20
20
|
"@box/blueprint-web-assets": "^4.33.2",
|
|
21
|
-
"@box/box-ai-agent-selector": "^0.26.
|
|
22
|
-
"@box/item-icon": "^0.9.
|
|
21
|
+
"@box/box-ai-agent-selector": "^0.26.7",
|
|
22
|
+
"@box/item-icon": "^0.9.86",
|
|
23
23
|
"@box/storybook-utils": "^0.8.3",
|
|
24
24
|
"@testing-library/react": "^15.0.6",
|
|
25
25
|
"react": "^18.3.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"**/*.css"
|
|
58
58
|
],
|
|
59
59
|
"license": "SEE LICENSE IN LICENSE",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "ff309281b56a2d40c62ad0a40677e9f8c64d4c9f"
|
|
61
61
|
}
|
package/styles/citation.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._citationTrigger_4yo68_1{pointer-events:"auto"}._citationStatus_4yo68_5{margin-right:.25rem}._citationStatus_4yo68_5>span{box-sizing:border-box;color:#6f6f6f;background-color:transparent;outline:.0625rem solid #e8e8e8}._citationStatus_4yo68_5>span:hover{background-color:transparent!important;cursor:pointer}._citationStatus_4yo68_5>span:focus-visible{background-color:transparent!important;outline:.125rem solid #2486fc;outline-offset:-1px}._animate_4yo68_26{opacity:0;transition:opacity .3s ease-in-out}._animate_4yo68_26._fadeIn_4yo68_30{opacity:1}._cardTooltip_4yo68_34{margin:.3rem;text-align:left}._cardTooltip_4yo68_34 ._cardTooltipTitle_4yo68_38{gap:.5rem;margin-bottom:1rem}._cardTooltip_4yo68_34 ._cardTooltipCitation_4yo68_42{gap:.6rem;padding-left:1rem;border-left:.125rem solid #e8e8e8}._cardTooltip_4yo68_34 ._cardTooltipButton_4yo68_47{margin-top:.6rem}._cardTooltip_4yo68_34 ._cardTooltipButton_4yo68_47:focus-visible{box-shadow:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function focusInput(): void;
|