@box/box-ai-content-answers 0.102.0 → 0.103.0
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/stopResponseButton.js +49 -0
- package/esm/lib/components/footer/footer-actions.js +33 -53
- package/esm/lib/components/footer/footer.js +87 -90
- package/esm/lib/components/footer/stopResponseButton.js +11 -0
- package/package.json +6 -6
- package/styles/stopResponseButton.css +1 -0
- package/types/lib/components/footer/footer-actions.d.ts +2 -5
- package/types/lib/components/footer/stopResponseButton.d.ts +7 -0
- package/styles/footer.css +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { useIntl as p } from "react-intl";
|
|
3
|
+
import { Tooltip as u, Button as _ } from "@box/blueprint-web";
|
|
4
|
+
import { Stop as f } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
+
import { LOGGER_BASE_CONFIG as m, LOGGER_ACTION_CLICK as l } from "../esm/lib/components/common/constants.js";
|
|
6
|
+
import e from "../esm/lib/components/footer/messages.js";
|
|
7
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
8
|
+
import '../styles/stopResponseButton.css';const c = "_questionInput_ff9qa_1", q = "_avatar_ff9qa_26", d = "_inputAreaButton_ff9qa_29", B = "_square_ff9qa_45", b = "_textArea_ff9qa_52", R = "_error_ff9qa_75", A = "_sidebar_ff9qa_78", C = "_submitButtonTooltip_ff9qa_86", I = {
|
|
9
|
+
questionInput: c,
|
|
10
|
+
avatar: q,
|
|
11
|
+
inputAreaButton: d,
|
|
12
|
+
square: B,
|
|
13
|
+
textArea: b,
|
|
14
|
+
error: R,
|
|
15
|
+
sidebar: A,
|
|
16
|
+
submitButtonTooltip: C
|
|
17
|
+
};
|
|
18
|
+
function S({
|
|
19
|
+
recordAction: t,
|
|
20
|
+
lastQuestion: o,
|
|
21
|
+
onStopQuestion: s
|
|
22
|
+
}) {
|
|
23
|
+
const a = p(), r = i.useCallback(() => {
|
|
24
|
+
t && t({
|
|
25
|
+
...m,
|
|
26
|
+
action: l,
|
|
27
|
+
target: "stopResponse"
|
|
28
|
+
}), s(o);
|
|
29
|
+
}, [o, s, t]);
|
|
30
|
+
return /* @__PURE__ */ n(u, {
|
|
31
|
+
content: a.formatMessage(e.stopResponse),
|
|
32
|
+
"data-testid": "stop-response-tooltip",
|
|
33
|
+
variant: "standard",
|
|
34
|
+
children: /* @__PURE__ */ n(_, {
|
|
35
|
+
"aria-label": a.formatMessage(e.stopResponse),
|
|
36
|
+
"aria-live": "polite",
|
|
37
|
+
className: I.inputAreaButton,
|
|
38
|
+
"data-testid": "content-answers-stop-response-button",
|
|
39
|
+
icon: f,
|
|
40
|
+
onClick: r,
|
|
41
|
+
size: "large",
|
|
42
|
+
"data-target-id": "Button-stopResponse"
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
S,
|
|
48
|
+
I as s
|
|
49
|
+
};
|
|
@@ -1,67 +1,47 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { A as
|
|
5
|
-
import { LOGGER_BASE_CONFIG as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import '../../../../styles/footer-actions.css';const
|
|
9
|
-
footerActions:
|
|
10
|
-
footerActionButton:
|
|
11
|
-
},
|
|
12
|
-
isStopResponseEnabled: E = !1,
|
|
13
|
-
isStreamingEnabled: _ = !1,
|
|
1
|
+
import { Button as u } from "@box/blueprint-web";
|
|
2
|
+
import { useRef as R, useCallback as p, useEffect as E } from "react";
|
|
3
|
+
import { useIntl as _ } from "react-intl";
|
|
4
|
+
import { A as c } from "../../../../chunks/types.js";
|
|
5
|
+
import { LOGGER_BASE_CONFIG as A, LOGGER_ACTION_CLICK as d } from "../common/constants.js";
|
|
6
|
+
import B from "./messages.js";
|
|
7
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
+
import '../../../../styles/footer-actions.css';const S = "_footerActions_1l4g8_1", N = "_footerActionButton_1l4g8_11", i = {
|
|
9
|
+
footerActions: S,
|
|
10
|
+
footerActionButton: N
|
|
11
|
+
}, P = ({
|
|
14
12
|
lastQuestion: o,
|
|
15
|
-
onRetryQuestion:
|
|
16
|
-
|
|
17
|
-
recordAction: t
|
|
13
|
+
onRetryQuestion: r,
|
|
14
|
+
recordAction: e
|
|
18
15
|
}) => {
|
|
19
16
|
const {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
...u,
|
|
28
|
-
action: R,
|
|
29
|
-
target: "stopResponse"
|
|
30
|
-
}), c(o);
|
|
31
|
-
}, [o, c, t]), C = p(() => {
|
|
32
|
-
t && t({
|
|
33
|
-
...u,
|
|
34
|
-
action: R,
|
|
17
|
+
error: n
|
|
18
|
+
} = o, t = r && n && n !== c.RESPONSE_STOPPED && n !== c.RESPONSE_INTERRUPTED, f = t, s = R(null), {
|
|
19
|
+
formatMessage: l
|
|
20
|
+
} = _(), m = p(() => {
|
|
21
|
+
e && e({
|
|
22
|
+
...A,
|
|
23
|
+
action: d,
|
|
35
24
|
target: "retryResponse"
|
|
36
|
-
}),
|
|
37
|
-
}, [o,
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
className:
|
|
25
|
+
}), r(o);
|
|
26
|
+
}, [o, r, e]);
|
|
27
|
+
return E(() => {
|
|
28
|
+
t && s.current && s.current.focus();
|
|
29
|
+
}, [t]), f ? /* @__PURE__ */ a("div", {
|
|
30
|
+
className: i.footerActions,
|
|
42
31
|
"data-testid": "content-answers-modal-footer-actions",
|
|
43
|
-
children:
|
|
32
|
+
children: t && /* @__PURE__ */ a(u, {
|
|
33
|
+
ref: s,
|
|
44
34
|
"aria-live": "polite",
|
|
45
|
-
className:
|
|
46
|
-
"data-testid": "content-answers-stop-response-button",
|
|
47
|
-
onClick: A,
|
|
48
|
-
size: "large",
|
|
49
|
-
variant: "secondary",
|
|
50
|
-
"data-target-id": "Button-stopResponse",
|
|
51
|
-
children: f(d.stopResponse)
|
|
52
|
-
}), e && /* @__PURE__ */ B(l, {
|
|
53
|
-
ref: r,
|
|
54
|
-
"aria-live": "polite",
|
|
55
|
-
className: a.footerActionButton,
|
|
35
|
+
className: i.footerActionButton,
|
|
56
36
|
"data-testid": "content-answers-retry-response-button",
|
|
57
|
-
onClick:
|
|
37
|
+
onClick: m,
|
|
58
38
|
size: "large",
|
|
59
39
|
variant: "secondary",
|
|
60
40
|
"data-target-id": "Button-retryResponse",
|
|
61
|
-
children:
|
|
62
|
-
})
|
|
41
|
+
children: l(B.retryResponse)
|
|
42
|
+
})
|
|
63
43
|
}) : null;
|
|
64
44
|
};
|
|
65
45
|
export {
|
|
66
|
-
|
|
46
|
+
P as FooterActions
|
|
67
47
|
};
|
|
@@ -1,122 +1,119 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Y 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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
textArea: mt,
|
|
20
|
-
error: ut,
|
|
21
|
-
sidebar: ct,
|
|
22
|
-
submitButtonTooltip: lt
|
|
23
|
-
}, vt = ({
|
|
24
|
-
askSuggestedQuestion: C,
|
|
25
|
-
enableDebugMode: h = !1,
|
|
3
|
+
import { useIntl as $ } from "react-intl";
|
|
4
|
+
import { useBreakpoint as g, Breakpoint as J, TextArea as Z, Tooltip as P, Button as Q } from "@box/blueprint-web";
|
|
5
|
+
import { ArrowUp as q } from "@box/blueprint-web-assets/icons/Fill";
|
|
6
|
+
import { useAgents as tt } from "@box/box-ai-agent-selector";
|
|
7
|
+
import { useAgents as at } from "../../contexts/AgentsContext.js";
|
|
8
|
+
import { FooterActions as rt } from "./footer-actions.js";
|
|
9
|
+
import { s as T, S as et } from "../../../../chunks/stopResponseButton.js";
|
|
10
|
+
import { getAIAgentConfig as v } from "../common/agentUtils.js";
|
|
11
|
+
import { isDebugModeTrigger as st, isEnterTrigger as it } from "../common/keyInputUtils.js";
|
|
12
|
+
import { TEXT_AREA as i, INPUT_TARGET_ID as ot } from "./constants.js";
|
|
13
|
+
import l from "./messages.js";
|
|
14
|
+
import { LOGGER_BASE_CONFIG as B, LOGGER_ACTION_CLICK as nt, LOGGER_ACTION_KEYPRESS as mt } from "../common/constants.js";
|
|
15
|
+
import { jsxs as R, jsx as u } from "react/jsx-runtime";
|
|
16
|
+
const Gt = ({
|
|
17
|
+
askSuggestedQuestion: _,
|
|
18
|
+
enableDebugMode: L = !1,
|
|
26
19
|
hasRequestInProgress: e,
|
|
27
|
-
isAgentSelectorEnabled:
|
|
28
|
-
isAIStudioAgentSelectorEnabled:
|
|
29
|
-
isDebugModeShown:
|
|
30
|
-
isStopResponseEnabled:
|
|
31
|
-
isStreamingEnabled:
|
|
32
|
-
lastQuestion:
|
|
33
|
-
onRetryQuestion:
|
|
34
|
-
onStopQuestion:
|
|
20
|
+
isAgentSelectorEnabled: p,
|
|
21
|
+
isAIStudioAgentSelectorEnabled: d,
|
|
22
|
+
isDebugModeShown: M,
|
|
23
|
+
isStopResponseEnabled: w,
|
|
24
|
+
isStreamingEnabled: X,
|
|
25
|
+
lastQuestion: C,
|
|
26
|
+
onRetryQuestion: x,
|
|
27
|
+
onStopQuestion: H,
|
|
35
28
|
recordAction: s,
|
|
36
|
-
sendQuestion:
|
|
37
|
-
setAskSuggestedQuestion:
|
|
38
|
-
toggleDebugMode:
|
|
39
|
-
variant:
|
|
29
|
+
sendQuestion: G,
|
|
30
|
+
setAskSuggestedQuestion: A,
|
|
31
|
+
toggleDebugMode: o,
|
|
32
|
+
variant: S = "modal"
|
|
40
33
|
}) => {
|
|
41
|
-
const
|
|
42
|
-
selectedAgent:
|
|
43
|
-
} =
|
|
44
|
-
selectedAgent:
|
|
45
|
-
} =
|
|
34
|
+
const N = S === "sidebar", n = $(), y = g(), a = /* @__PURE__ */ r.createRef(), I = y <= J.Medium && !N ? i.MAX_ROWS_MOBILE : i.MAX_ROWS, [c, b] = r.useState(!0), [K, O] = r.useState(!1), {
|
|
35
|
+
selectedAgent: h
|
|
36
|
+
} = at(), {
|
|
37
|
+
selectedAgent: k
|
|
38
|
+
} = tt(), {
|
|
39
|
+
answer: F,
|
|
40
|
+
isCompleted: j
|
|
41
|
+
} = C ?? {}, D = X && j === !1 && (w || F), E = r.useCallback(() => {
|
|
46
42
|
a.current && a.current.focus();
|
|
47
|
-
}, [a]),
|
|
43
|
+
}, [a]), U = r.useCallback(() => {
|
|
48
44
|
var m;
|
|
49
45
|
let t = ((m = a.current) == null ? void 0 : m.value) ?? "";
|
|
50
|
-
a.current && t.length >
|
|
51
|
-
}, [a]),
|
|
52
|
-
if (
|
|
46
|
+
a.current && t.length > i.MAX_LENGTH && (a.current.value = t.slice(0, i.MAX_LENGTH), t = a.current.value), O(t.length >= i.MAX_LENGTH), b(t.trim().length === 0);
|
|
47
|
+
}, [a]), f = r.useCallback(() => {
|
|
48
|
+
if (E(), !e && a.current) {
|
|
53
49
|
const t = {
|
|
54
50
|
prompt: a.current.value
|
|
55
51
|
};
|
|
56
52
|
if (t.prompt && t.prompt.trim()) {
|
|
57
|
-
const m =
|
|
58
|
-
|
|
53
|
+
const m = v(p, h, d, k);
|
|
54
|
+
G(t, m), a.current.value = "", b(!0), O(!1);
|
|
59
55
|
}
|
|
60
|
-
|
|
56
|
+
M && o && o();
|
|
61
57
|
}
|
|
62
|
-
}, [
|
|
58
|
+
}, [k, E, e, a, d, p, M, h, G, o]), W = r.useCallback((t) => {
|
|
63
59
|
t.preventDefault(), !e && !c && s && s({
|
|
64
|
-
...
|
|
65
|
-
action:
|
|
60
|
+
...B,
|
|
61
|
+
action: nt,
|
|
66
62
|
target: "ask"
|
|
67
|
-
}),
|
|
68
|
-
}, [e, c, s,
|
|
69
|
-
|
|
70
|
-
...
|
|
71
|
-
action:
|
|
63
|
+
}), f();
|
|
64
|
+
}, [e, c, s, f]), z = r.useCallback((t) => {
|
|
65
|
+
L && o && st(t) && o(), it(t) && (t.preventDefault(), !e && !c && s && s({
|
|
66
|
+
...B,
|
|
67
|
+
action: mt,
|
|
72
68
|
target: "ask"
|
|
73
|
-
}),
|
|
74
|
-
}, [
|
|
75
|
-
const m =
|
|
76
|
-
|
|
77
|
-
}, [d, p,
|
|
69
|
+
}), f());
|
|
70
|
+
}, [L, e, c, s, f, o]), V = r.useCallback((t) => {
|
|
71
|
+
const m = v(p, h, d, k);
|
|
72
|
+
x(t, m);
|
|
73
|
+
}, [k, d, p, x, h]);
|
|
78
74
|
return r.useEffect(() => {
|
|
79
|
-
queueMicrotask(
|
|
75
|
+
queueMicrotask(E);
|
|
80
76
|
}, []), r.useEffect(() => {
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
children: [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
lastQuestion: A,
|
|
87
|
-
onRetryQuestion: U,
|
|
88
|
-
onStopQuestion: w,
|
|
77
|
+
_ && a.current && !e && A && (a.current.value = _, f(), A(null));
|
|
78
|
+
}, [_]), /* @__PURE__ */ R("div", {
|
|
79
|
+
children: [C && /* @__PURE__ */ u(rt, {
|
|
80
|
+
lastQuestion: C,
|
|
81
|
+
onRetryQuestion: V,
|
|
89
82
|
recordAction: s
|
|
90
83
|
}), /* @__PURE__ */ R("div", {
|
|
91
|
-
className:
|
|
92
|
-
children: [/* @__PURE__ */
|
|
84
|
+
className: Y(T.questionInput, N && T.sidebar),
|
|
85
|
+
children: [/* @__PURE__ */ u(Z, {
|
|
93
86
|
ref: a,
|
|
94
87
|
className: T.textArea,
|
|
95
|
-
"data-target-id":
|
|
88
|
+
"data-target-id": ot,
|
|
96
89
|
"data-testid": "content-answers-question-input",
|
|
97
|
-
error:
|
|
98
|
-
characterLimit:
|
|
90
|
+
error: K && n.formatMessage(l.maxCharactersReachedError, {
|
|
91
|
+
characterLimit: i.MAX_LENGTH
|
|
99
92
|
}),
|
|
100
93
|
hideLabel: !0,
|
|
101
|
-
label: n.formatMessage(
|
|
102
|
-
maxLength:
|
|
103
|
-
maxRows:
|
|
104
|
-
onChange:
|
|
105
|
-
onKeyDown:
|
|
106
|
-
placeholder: n.formatMessage(
|
|
107
|
-
}), /* @__PURE__ */
|
|
108
|
-
|
|
94
|
+
label: n.formatMessage(l.askQuestionPlaceholder),
|
|
95
|
+
maxLength: i.MAX_LENGTH,
|
|
96
|
+
maxRows: I,
|
|
97
|
+
onChange: U,
|
|
98
|
+
onKeyDown: z,
|
|
99
|
+
placeholder: n.formatMessage(l.askQuestionPlaceholder)
|
|
100
|
+
}), D ? /* @__PURE__ */ u(et, {
|
|
101
|
+
lastQuestion: C,
|
|
102
|
+
onStopQuestion: H,
|
|
103
|
+
recordAction: s
|
|
104
|
+
}) : /* @__PURE__ */ u(P, {
|
|
105
|
+
content: n.formatMessage(l.ask),
|
|
109
106
|
"data-testid": "ask-tooltip",
|
|
110
107
|
variant: "standard",
|
|
111
|
-
children: /* @__PURE__ */
|
|
112
|
-
"aria-label": n.formatMessage(
|
|
113
|
-
className: T.
|
|
108
|
+
children: /* @__PURE__ */ u(Q, {
|
|
109
|
+
"aria-label": n.formatMessage(l.ask),
|
|
110
|
+
className: T.inputAreaButton,
|
|
114
111
|
"data-testid": "content-answers-submit-button",
|
|
115
112
|
disabled: c || e,
|
|
116
|
-
icon:
|
|
113
|
+
icon: q,
|
|
117
114
|
loading: !1,
|
|
118
|
-
loadingAriaLabel: n.formatMessage(
|
|
119
|
-
onClick:
|
|
115
|
+
loadingAriaLabel: n.formatMessage(l.askDisabledTooltip),
|
|
116
|
+
onClick: W,
|
|
120
117
|
size: "large",
|
|
121
118
|
"data-target-id": "Button-ask"
|
|
122
119
|
})
|
|
@@ -125,5 +122,5 @@ import '../../../../styles/footer.css';const ot = "_questionInput_169rs_1", it =
|
|
|
125
122
|
});
|
|
126
123
|
};
|
|
127
124
|
export {
|
|
128
|
-
|
|
125
|
+
Gt as Footer
|
|
129
126
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import "react-intl";
|
|
3
|
+
import "@box/blueprint-web";
|
|
4
|
+
import "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
+
import "../common/constants.js";
|
|
6
|
+
import "./messages.js";
|
|
7
|
+
import { S } from "../../../../chunks/stopResponseButton.js";
|
|
8
|
+
import "react/jsx-runtime";
|
|
9
|
+
export {
|
|
10
|
+
S as StopResponseButton
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
|
-
"@box/blueprint-web-assets": "^4.
|
|
6
|
+
"@box/blueprint-web-assets": "^4.35.0",
|
|
7
7
|
"@box/box-ai-agent-selector": "^0.20.0",
|
|
8
8
|
"@box/item-icon": "^0.9.44",
|
|
9
9
|
"highlight.js": "^11.9.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.9",
|
|
20
20
|
"@box/blueprint-web-assets": "^4.35.0",
|
|
21
|
-
"@box/box-ai-agent-selector": "^0.30.
|
|
22
|
-
"@box/item-icon": "^0.9.
|
|
21
|
+
"@box/box-ai-agent-selector": "^0.30.1",
|
|
22
|
+
"@box/item-icon": "^0.9.91",
|
|
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": "4215fe3a62e09e3b9564665725e4520daf828f58"
|
|
61
61
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._questionInput_ff9qa_1{position:relative;z-index:1;display:flex;flex:1 1 auto;align-items:end;margin:1rem;padding:0;background:#fff;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:1px solid #909090!important;border-radius:1.5rem!important;box-shadow:0 2px 12px #2222221f}._questionInput_ff9qa_1:hover{background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;border:1px solid rgba(0,0,0,0)!important}._questionInput_ff9qa_1: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_ff9qa_1 ._avatar_ff9qa_26{margin-bottom:.25rem}._questionInput_ff9qa_1 ._inputAreaButton_ff9qa_29{position:absolute;right:0;margin-right:.25rem;margin-bottom:.25rem;background:linear-gradient(135deg,#fe03dc,#2784fa);border:0;border-radius:1.5rem!important}._questionInput_ff9qa_1 ._inputAreaButton_ff9qa_29:disabled{background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_ff9qa_1 ._inputAreaButton_ff9qa_29:not(:disabled):hover,._questionInput_ff9qa_1 ._inputAreaButton_ff9qa_29:not(:disabled):active{background:linear-gradient(135deg,#cb02b0,#1f6ac8);border:0}._questionInput_ff9qa_1 ._square_ff9qa_45{display:inline-block;width:15px;height:15px;background-color:#fff;border-radius:3px}._questionInput_ff9qa_1 ._textArea_ff9qa_52{gap:0;width:100%;margin:0 1rem 0 0;padding-right:46px;box-shadow:none}._questionInput_ff9qa_1 ._textArea_ff9qa_52 div{box-shadow:none!important}._questionInput_ff9qa_1 ._textArea_ff9qa_52 span{padding:.5rem .75rem .75rem;margin-block-start:0}._questionInput_ff9qa_1 ._textArea_ff9qa_52 textarea{width:100%;margin:.475rem 0;padding:.4rem 1rem;background:inherit;border:none;border-radius:1.25rem;box-shadow:none}._questionInput_ff9qa_1 ._textArea_ff9qa_52 textarea:not(:disabled):not(:focus-visible):not(._error_ff9qa_75):hover{background:inherit}._questionInput_ff9qa_1._sidebar_ff9qa_78 ._textArea_ff9qa_52{padding-right:26px}._questionInput_ff9qa_1._sidebar_ff9qa_78 ._textArea_ff9qa_52 div{align-items:center;height:100%}._submitButtonTooltip_ff9qa_86{text-align:center}@media (max-width: 767px){._questionInput_ff9qa_1 ._textArea_ff9qa_52{margin:0 .75rem 0 0}}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { QuestionType, RetryQuestion
|
|
1
|
+
import { QuestionType, RetryQuestion } from '../../types';
|
|
2
2
|
export interface FooterProps {
|
|
3
|
-
isStopResponseEnabled?: boolean;
|
|
4
|
-
isStreamingEnabled?: boolean;
|
|
5
3
|
lastQuestion: QuestionType | null;
|
|
6
4
|
onRetryQuestion?: RetryQuestion;
|
|
7
|
-
onStopQuestion?: StopQuestion;
|
|
8
5
|
recordAction?: (payload: Record<string, unknown>) => void;
|
|
9
6
|
}
|
|
10
|
-
export declare const FooterActions: ({
|
|
7
|
+
export declare const FooterActions: ({ lastQuestion, onRetryQuestion, recordAction }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { QuestionType, StopQuestion } from '../../types';
|
|
2
|
+
export interface StopResponseButtonProps {
|
|
3
|
+
lastQuestion: QuestionType | null;
|
|
4
|
+
onStopQuestion?: StopQuestion;
|
|
5
|
+
recordAction?: (payload: Record<string, unknown>) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function StopResponseButton({ recordAction, lastQuestion, onStopQuestion }: StopResponseButtonProps): import("react/jsx-runtime").JSX.Element;
|
package/styles/footer.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._questionInput_169rs_1{position:relative;z-index:1;display:flex;flex:1 1 auto;align-items:end;background:#fff;box-shadow:0 2px 12px #2222221f;margin:1rem;padding:0;border:1px solid #909090!important;border-radius:1.5rem!important;background-origin:border-box!important;background-clip:padding-box,border-box!important}._questionInput_169rs_1:hover{border:1px solid rgba(0,0,0,0)!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important}._questionInput_169rs_1:focus-within{border:2px solid rgba(0,0,0,0)!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;box-sizing:unset!important;margin:calc(1rem - 1px)}._questionInput_169rs_1 ._avatar_169rs_26{margin-bottom:.25rem}._questionInput_169rs_1 ._submitButton_169rs_29{position:absolute;right:0;border:0;background:linear-gradient(135deg,#fe03dc,#2784fa);border-radius:1.5rem!important;margin-right:.25rem;margin-bottom:.25rem}._questionInput_169rs_1 ._submitButton_169rs_29:not(:disabled):hover,._questionInput_169rs_1 ._submitButton_169rs_29:not(:disabled):active{border:0;background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_169rs_1 ._submitButton_169rs_29:disabled{background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_169rs_1 ._textArea_169rs_45{gap:0;width:100%;margin:0 1rem 0 0;box-shadow:none;padding-right:46px}._questionInput_169rs_1 ._textArea_169rs_45 div{box-shadow:none!important}._questionInput_169rs_1 ._textArea_169rs_45 span{padding:.5rem .75rem .75rem;margin-block-start:0}._questionInput_169rs_1 ._textArea_169rs_45 textarea{border:none;box-shadow:none;width:100%;border-radius:1.25rem;padding:.4rem 1rem;margin:.475rem 0;background:inherit}._questionInput_169rs_1 ._textArea_169rs_45 textarea:not(:disabled):not(:focus-visible):not(._error_169rs_68):hover{background:inherit}._questionInput_169rs_1._sidebar_169rs_71 ._textArea_169rs_45{padding-right:26px}._questionInput_169rs_1._sidebar_169rs_71 ._textArea_169rs_45 div{align-items:center;height:100%}._submitButtonTooltip_169rs_79{text-align:center}@media (max-width: 767px){._questionInput_169rs_1 ._textArea_169rs_45{margin:0 .75rem 0 0}}
|