@box/box-ai-content-answers 0.71.2 → 0.71.3
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/agents/agent-editor.js +21 -20
- package/esm/lib/components/answer/answer-content.js +8 -8
- package/esm/lib/components/answer/answer.js +43 -42
- package/esm/lib/components/answer/inline-error.js +16 -15
- package/esm/lib/components/answer/loading-element.js +18 -18
- package/esm/lib/components/common/media-container.js +22 -19
- package/esm/lib/components/content/content.js +46 -46
- package/esm/lib/components/footer/footer.js +50 -50
- package/esm/lib/components/question/question.js +46 -44
- package/esm/lib/components/suggested-questions/suggested-questions.js +29 -29
- package/esm/lib/components/suggested-questions/suggestions.js +15 -15
- package/esm/lib/components/welcome-message/welcome-message.js +34 -33
- package/package.json +2 -2
- package/styles/agent-editor.css +1 -1
- package/styles/answer-content.css +1 -1
- package/styles/answer.css +1 -1
- package/styles/content.css +1 -1
- package/styles/footer.css +1 -1
- package/styles/inline-error.css +1 -1
- package/styles/loading-element.css +1 -1
- package/styles/media-container.css +1 -1
- package/styles/question.css +1 -1
- package/styles/suggested-questions.css +1 -1
- package/styles/suggestions.css +1 -1
- package/styles/welcome-message.css +1 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import "../../../../styles/footer.css";
|
|
2
2
|
import D from "clsx";
|
|
3
|
-
import * as
|
|
3
|
+
import * as e from "react";
|
|
4
4
|
import { useIntl as V } from "react-intl";
|
|
5
5
|
import { useBreakpoint as Y, Breakpoint as q, Avatar as J, TextArea as Q, Button as Z } from "@box/blueprint-web";
|
|
6
6
|
import { ArrowUp as g } from "@box/blueprint-web-assets/icons/Line";
|
|
7
7
|
import { useAgents as P } from "@box/box-ai-agent-selector";
|
|
8
8
|
import { useAgents as tt } from "../../contexts/AgentsContext.js";
|
|
9
9
|
import { FooterActions as at } from "./footer-actions.js";
|
|
10
|
-
import
|
|
11
|
-
import { getAIAgentConfig as
|
|
12
|
-
import { isDebugModeTrigger as
|
|
10
|
+
import et from "../../messages.js";
|
|
11
|
+
import { getAIAgentConfig as z } from "../common/agentUtils.js";
|
|
12
|
+
import { isDebugModeTrigger as rt, isEnterTrigger as st } from "../common/keyInputUtils.js";
|
|
13
13
|
import { TEXT_AREA as o } from "./constants.js";
|
|
14
|
-
import
|
|
14
|
+
import u from "./messages.js";
|
|
15
15
|
import { LOGGER_BASE_CONFIG as R, LOGGER_ACTION_CLICK as it, LOGGER_ACTION_KEYPRESS as ot } from "../common/constants.js";
|
|
16
16
|
import { jsxs as w, jsx as f } from "react/jsx-runtime";
|
|
17
|
-
const nt = "
|
|
17
|
+
const nt = "_questionInput_luzem_1", mt = "_avatar_luzem_11", ut = "_submitButton_luzem_14", lt = "_textArea_luzem_17", ct = "_sidebar_luzem_25", ft = "_submitButtonTooltip_luzem_35", p = {
|
|
18
18
|
questionInput: nt,
|
|
19
19
|
avatar: mt,
|
|
20
|
-
submitButton:
|
|
21
|
-
textArea:
|
|
22
|
-
sidebar:
|
|
20
|
+
submitButton: ut,
|
|
21
|
+
textArea: lt,
|
|
22
|
+
sidebar: ct,
|
|
23
23
|
submitButtonTooltip: ft
|
|
24
|
-
},
|
|
24
|
+
}, Nt = ({
|
|
25
25
|
askSuggestedQuestion: h,
|
|
26
26
|
contentType: A,
|
|
27
27
|
enableDebugMode: k = !1,
|
|
28
|
-
hasRequestInProgress:
|
|
28
|
+
hasRequestInProgress: r,
|
|
29
29
|
isAgentSelectorEnabled: _,
|
|
30
30
|
isAIStudioAgentSelectorEnabled: d,
|
|
31
31
|
isDebugModeShown: L,
|
|
@@ -35,105 +35,105 @@ const nt = "_questionInput_1l8jj_1", mt = "_avatar_1l8jj_11", lt = "_submitButto
|
|
|
35
35
|
onRetryQuestion: T,
|
|
36
36
|
onStopQuestion: F,
|
|
37
37
|
recordAction: s,
|
|
38
|
-
sendQuestion:
|
|
39
|
-
setAskSuggestedQuestion:
|
|
38
|
+
sendQuestion: E,
|
|
39
|
+
setAskSuggestedQuestion: B,
|
|
40
40
|
toggleDebugMode: n,
|
|
41
|
-
user:
|
|
41
|
+
user: G,
|
|
42
42
|
variant: I = "modal"
|
|
43
43
|
}) => {
|
|
44
|
-
const
|
|
44
|
+
const N = I === "sidebar", i = V(), K = Y(), a = /* @__PURE__ */ e.createRef(), b = K <= q.Medium || N, [l, O] = e.useState(!0), [j, X] = e.useState(!1), {
|
|
45
45
|
selectedAgent: v
|
|
46
46
|
} = tt(), {
|
|
47
47
|
selectedAgent: C
|
|
48
|
-
} = P(), x =
|
|
48
|
+
} = P(), x = e.useCallback(() => {
|
|
49
49
|
a.current && a.current.focus();
|
|
50
|
-
}, [a]),
|
|
50
|
+
}, [a]), S = e.useCallback(() => {
|
|
51
51
|
var m;
|
|
52
52
|
let t = ((m = a.current) == null ? void 0 : m.value) ?? "";
|
|
53
|
-
a.current && t.length > o.MAX_LENGTH && (a.current.value = t.slice(0, o.MAX_LENGTH), t = a.current.value),
|
|
54
|
-
}, [a]),
|
|
55
|
-
if (x(), !
|
|
53
|
+
a.current && t.length > o.MAX_LENGTH && (a.current.value = t.slice(0, o.MAX_LENGTH), t = a.current.value), X(t.length >= o.MAX_LENGTH), O(t.trim().length === 0);
|
|
54
|
+
}, [a]), c = e.useCallback(() => {
|
|
55
|
+
if (x(), !r && a.current) {
|
|
56
56
|
const t = {
|
|
57
57
|
prompt: a.current.value
|
|
58
58
|
};
|
|
59
59
|
if (t.prompt && t.prompt.trim()) {
|
|
60
|
-
const m =
|
|
61
|
-
|
|
60
|
+
const m = z(_, v, d, C);
|
|
61
|
+
E(t, m), a.current.value = "", O(!0), X(!1);
|
|
62
62
|
}
|
|
63
63
|
L && n && n();
|
|
64
64
|
}
|
|
65
|
-
}, [C, x,
|
|
66
|
-
t.preventDefault(), !
|
|
65
|
+
}, [C, x, r, a, d, _, L, v, E, n]), U = e.useCallback((t) => {
|
|
66
|
+
t.preventDefault(), !r && !l && s && s({
|
|
67
67
|
...R,
|
|
68
68
|
action: it,
|
|
69
69
|
target: "ask"
|
|
70
|
-
}),
|
|
71
|
-
}, [
|
|
72
|
-
k && n &&
|
|
70
|
+
}), c();
|
|
71
|
+
}, [r, l, s, c]), W = e.useCallback((t) => {
|
|
72
|
+
k && n && rt(t) && n(), st(t) && (t.preventDefault(), !r && !l && s && s({
|
|
73
73
|
...R,
|
|
74
74
|
action: ot,
|
|
75
75
|
target: "ask"
|
|
76
|
-
}),
|
|
77
|
-
}, [k,
|
|
78
|
-
const m =
|
|
76
|
+
}), c());
|
|
77
|
+
}, [k, r, l, s, c, n]), $ = e.useCallback((t) => {
|
|
78
|
+
const m = z(_, v, d, C);
|
|
79
79
|
T(t, m);
|
|
80
80
|
}, [C, d, _, T, v]);
|
|
81
|
-
return
|
|
81
|
+
return e.useEffect(() => {
|
|
82
82
|
queueMicrotask(x);
|
|
83
|
-
}, []),
|
|
84
|
-
h && a.current && !
|
|
83
|
+
}, []), e.useEffect(() => {
|
|
84
|
+
h && a.current && !r && B && (a.current.value = h, c(), B(null));
|
|
85
85
|
}, [h]), /* @__PURE__ */ w("div", {
|
|
86
86
|
children: [M && /* @__PURE__ */ f(at, {
|
|
87
87
|
isStopResponseEnabled: H,
|
|
88
88
|
isStreamingEnabled: y,
|
|
89
89
|
lastQuestion: M,
|
|
90
|
-
onRetryQuestion:
|
|
90
|
+
onRetryQuestion: $,
|
|
91
91
|
onStopQuestion: F,
|
|
92
92
|
recordAction: s
|
|
93
93
|
}), /* @__PURE__ */ w("div", {
|
|
94
|
-
className: D(p.questionInput,
|
|
94
|
+
className: D(p.questionInput, N && p.sidebar),
|
|
95
95
|
children: [!b && /* @__PURE__ */ f("div", {
|
|
96
96
|
className: p.avatar,
|
|
97
97
|
"data-testid": "content-answers-question-input-avatar",
|
|
98
98
|
children: /* @__PURE__ */ f(J, {
|
|
99
|
-
alt: i.formatMessage(
|
|
99
|
+
alt: i.formatMessage(et.userAvatar),
|
|
100
100
|
colorIndex: 0,
|
|
101
|
-
src:
|
|
102
|
-
text:
|
|
101
|
+
src: G.avatarURL,
|
|
102
|
+
text: G.name.charAt(0)
|
|
103
103
|
})
|
|
104
104
|
}), /* @__PURE__ */ f(Q, {
|
|
105
105
|
ref: a,
|
|
106
106
|
className: p.textArea,
|
|
107
107
|
"data-testid": "content-answers-question-input",
|
|
108
|
-
error:
|
|
108
|
+
error: j && i.formatMessage(u.maxCharactersReachedError, {
|
|
109
109
|
characterLimit: o.MAX_LENGTH
|
|
110
110
|
}),
|
|
111
111
|
hideLabel: !0,
|
|
112
|
-
label: i.formatMessage(
|
|
112
|
+
label: i.formatMessage(u.askQuestionPlaceholder, {
|
|
113
113
|
type: A
|
|
114
114
|
}),
|
|
115
115
|
maxLength: o.MAX_LENGTH,
|
|
116
116
|
maxRows: b ? o.MAX_ROWS_MOBILE : o.MAX_ROWS,
|
|
117
|
-
onChange:
|
|
118
|
-
onKeyDown:
|
|
119
|
-
placeholder: i.formatMessage(
|
|
117
|
+
onChange: S,
|
|
118
|
+
onKeyDown: W,
|
|
119
|
+
placeholder: i.formatMessage(u.askQuestionPlaceholder, {
|
|
120
120
|
type: A
|
|
121
121
|
})
|
|
122
122
|
}), /* @__PURE__ */ f(Z, {
|
|
123
|
-
"aria-label": i.formatMessage(
|
|
123
|
+
"aria-label": i.formatMessage(u.ask),
|
|
124
124
|
className: p.submitButton,
|
|
125
125
|
"data-testid": "content-answers-submit-button",
|
|
126
|
-
disabled:
|
|
126
|
+
disabled: l || r,
|
|
127
127
|
icon: b ? g : void 0,
|
|
128
|
-
loading:
|
|
129
|
-
loadingAriaLabel: i.formatMessage(
|
|
130
|
-
onClick:
|
|
128
|
+
loading: r,
|
|
129
|
+
loadingAriaLabel: i.formatMessage(u.askDisabledTooltip),
|
|
130
|
+
onClick: U,
|
|
131
131
|
size: "large",
|
|
132
|
-
children: b ? void 0 : i.formatMessage(
|
|
132
|
+
children: b ? void 0 : i.formatMessage(u.ask)
|
|
133
133
|
})]
|
|
134
134
|
})]
|
|
135
135
|
});
|
|
136
136
|
};
|
|
137
137
|
export {
|
|
138
|
-
|
|
138
|
+
Nt as Footer
|
|
139
139
|
};
|
|
@@ -1,55 +1,57 @@
|
|
|
1
1
|
import "../../../../styles/question.css";
|
|
2
|
-
import { useBreakpoint as
|
|
3
|
-
import
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
2
|
+
import { useBreakpoint as b, Avatar as h, Breakpoint as _, Text as f } from "@box/blueprint-web";
|
|
3
|
+
import q from "clsx";
|
|
4
|
+
import { useIntl as v } from "react-intl";
|
|
5
|
+
import g from "../../messages.js";
|
|
6
6
|
import { MediaContainer as s } from "../common/media-container.js";
|
|
7
|
-
import { jsx as
|
|
8
|
-
const
|
|
9
|
-
question:
|
|
10
|
-
text:
|
|
11
|
-
sidebar:
|
|
12
|
-
},
|
|
13
|
-
prompt:
|
|
14
|
-
userInfo:
|
|
15
|
-
variant:
|
|
7
|
+
import { jsx as t, jsxs as o, Fragment as d } from "react/jsx-runtime";
|
|
8
|
+
const I = "_question_183tu_1", S = "_text_183tu_5", k = "_sidebar_183tu_8", r = {
|
|
9
|
+
question: I,
|
|
10
|
+
text: S,
|
|
11
|
+
sidebar: k
|
|
12
|
+
}, M = ({
|
|
13
|
+
prompt: c,
|
|
14
|
+
userInfo: m,
|
|
15
|
+
variant: a = "modal"
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
|
-
avatarURL:
|
|
19
|
-
name:
|
|
20
|
-
} =
|
|
21
|
-
formatMessage:
|
|
22
|
-
} =
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
avatarURL: l,
|
|
19
|
+
name: u
|
|
20
|
+
} = m, e = a === "sidebar", p = b(), {
|
|
21
|
+
formatMessage: x
|
|
22
|
+
} = v(), n = /* @__PURE__ */ t(s.Figure, {
|
|
23
|
+
isUsedInsideSidebar: e,
|
|
24
|
+
children: /* @__PURE__ */ t(h, {
|
|
25
|
+
alt: x(g.userAvatar),
|
|
26
|
+
colorIndex: 0,
|
|
27
|
+
size: p === _.Small ? "small" : "large",
|
|
28
|
+
src: l || void 0,
|
|
29
|
+
text: u.charAt(0)
|
|
30
|
+
})
|
|
31
|
+
}), i = /* @__PURE__ */ t(s.Content, {
|
|
32
|
+
isUsedInsideSidebar: e,
|
|
33
|
+
variant: "question",
|
|
34
|
+
children: /* @__PURE__ */ t(f, {
|
|
35
|
+
as: "span",
|
|
36
|
+
className: q(r.text, e && r.sidebar),
|
|
37
|
+
children: c
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ t("div", {
|
|
41
|
+
className: r.question,
|
|
25
42
|
"data-testid": "content-answers-question",
|
|
26
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ t(s, {
|
|
27
44
|
className: "question",
|
|
28
|
-
variant:
|
|
29
|
-
children:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
children:
|
|
33
|
-
|
|
34
|
-
colorIndex: 0,
|
|
35
|
-
size: l === p.Small ? "small" : "large",
|
|
36
|
-
src: n || void 0,
|
|
37
|
-
text: d.charAt(0)
|
|
38
|
-
})
|
|
39
|
-
}), /* @__PURE__ */ e(s.Content, {
|
|
40
|
-
isUsedInsideSidebar: t,
|
|
41
|
-
shouldAddCard: t,
|
|
42
|
-
variant: "question",
|
|
43
|
-
children: /* @__PURE__ */ e(x, {
|
|
44
|
-
as: "span",
|
|
45
|
-
className: b(a.text, t && a.sidebar),
|
|
46
|
-
children: r
|
|
47
|
-
})
|
|
48
|
-
})]
|
|
45
|
+
variant: a,
|
|
46
|
+
children: e ? /* @__PURE__ */ o(d, {
|
|
47
|
+
children: [n, i]
|
|
48
|
+
}) : /* @__PURE__ */ o(d, {
|
|
49
|
+
children: [i, n]
|
|
50
|
+
})
|
|
49
51
|
})
|
|
50
52
|
});
|
|
51
53
|
};
|
|
52
54
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
M as Question,
|
|
56
|
+
M as default
|
|
55
57
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import "../../../../styles/suggested-questions.css";
|
|
2
|
-
import { Text as
|
|
3
|
-
import { AlertTriangle as
|
|
2
|
+
import { Text as E, LoadingIndicator as R } from "@box/blueprint-web";
|
|
3
|
+
import { AlertTriangle as h } from "@box/blueprint-web-assets/icons/Line";
|
|
4
4
|
import { Gray65 as u, Size4 as p } from "@box/blueprint-web-assets/tokens/tokens";
|
|
5
5
|
import g from "clsx";
|
|
6
|
-
import * as
|
|
7
|
-
import { useIntl as
|
|
8
|
-
import { Suggestions as
|
|
9
|
-
import { R as
|
|
6
|
+
import * as N from "react";
|
|
7
|
+
import { useIntl as O } from "react-intl";
|
|
8
|
+
import { Suggestions as j } from "./suggestions.js";
|
|
9
|
+
import { R as o } from "../../../../chunks/types.js";
|
|
10
10
|
import { LOGGER_BASE_CONFIG as w } from "../common/constants.js";
|
|
11
|
-
import
|
|
12
|
-
import { jsxs as x, jsx as
|
|
13
|
-
const C = "
|
|
11
|
+
import n from "./messages.js";
|
|
12
|
+
import { jsxs as x, jsx as r } from "react/jsx-runtime";
|
|
13
|
+
const C = "_wrapper_po1oj_1", G = "_sidebar_po1oj_4", T = "_label_po1oj_7", y = "_loadingIndicator_po1oj_16", L = "_alertIcon_po1oj_24", a = {
|
|
14
14
|
wrapper: C,
|
|
15
15
|
sidebar: G,
|
|
16
16
|
label: T,
|
|
17
|
-
loadingIndicator:
|
|
18
|
-
alertIcon:
|
|
17
|
+
loadingIndicator: y,
|
|
18
|
+
alertIcon: L
|
|
19
19
|
}, J = ({
|
|
20
20
|
askSuggestedQuestion: _,
|
|
21
21
|
hasCustomSuggestedQuestions: d,
|
|
@@ -23,12 +23,12 @@ const C = "_wrapper_1hyn7_1", G = "_sidebar_1hyn7_5", T = "_label_1hyn7_9", L =
|
|
|
23
23
|
recordAction: t,
|
|
24
24
|
setAskSuggestedQuestion: s,
|
|
25
25
|
suggestedQuestions: S,
|
|
26
|
-
suggestedQuestionsRequestState:
|
|
26
|
+
suggestedQuestionsRequestState: e = o.SUCCESS,
|
|
27
27
|
variant: c = "modal"
|
|
28
28
|
}) => {
|
|
29
29
|
const m = c === "sidebar", {
|
|
30
|
-
formatMessage:
|
|
31
|
-
} =
|
|
30
|
+
formatMessage: i
|
|
31
|
+
} = O(), b = N.useCallback((l) => {
|
|
32
32
|
s && (s(l), t && l && t({
|
|
33
33
|
...w,
|
|
34
34
|
target: "suggested_questions",
|
|
@@ -36,37 +36,37 @@ const C = "_wrapper_1hyn7_1", G = "_sidebar_1hyn7_5", T = "_label_1hyn7_9", L =
|
|
|
36
36
|
selectedQuestion: d ? "dynamic" : l
|
|
37
37
|
}
|
|
38
38
|
}));
|
|
39
|
-
}, [s, t, d]),
|
|
40
|
-
switch (
|
|
41
|
-
case
|
|
42
|
-
return
|
|
43
|
-
case
|
|
44
|
-
return
|
|
39
|
+
}, [s, t, d]), I = () => {
|
|
40
|
+
switch (e) {
|
|
41
|
+
case o.IN_PROGRESS:
|
|
42
|
+
return i(n.loadingSuggestedQuestions);
|
|
43
|
+
case o.ERROR:
|
|
44
|
+
return i(n.loadingSuggestedQuestionsFailed);
|
|
45
45
|
default:
|
|
46
|
-
return
|
|
46
|
+
return i(n.suggestedQuestions);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ x("div", {
|
|
50
50
|
className: g(a.wrapper, m && a.sidebar),
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ r(E, {
|
|
52
52
|
as: "p",
|
|
53
53
|
className: g(a.label, m && a.sidebar),
|
|
54
54
|
color: "textOnLightSecondary",
|
|
55
|
-
children:
|
|
56
|
-
}),
|
|
55
|
+
children: I()
|
|
56
|
+
}), e === o.SUCCESS && /* @__PURE__ */ r(j, {
|
|
57
57
|
askSuggestedQuestion: _,
|
|
58
58
|
isLoading: f,
|
|
59
|
-
onSuggestedQuestionClick:
|
|
59
|
+
onSuggestedQuestionClick: b,
|
|
60
60
|
suggestedQuestions: S,
|
|
61
61
|
variant: c
|
|
62
|
-
}),
|
|
62
|
+
}), e === o.IN_PROGRESS && /* @__PURE__ */ r("div", {
|
|
63
63
|
className: a.loadingIndicator,
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
"aria-label":
|
|
64
|
+
children: /* @__PURE__ */ r(R, {
|
|
65
|
+
"aria-label": i(n.loadingSuggestedQuestions),
|
|
66
66
|
className: a.loadingIndicator,
|
|
67
67
|
variant: "dark"
|
|
68
68
|
})
|
|
69
|
-
}),
|
|
69
|
+
}), e === o.ERROR && /* @__PURE__ */ r(h, {
|
|
70
70
|
className: a.alertIcon,
|
|
71
71
|
color: u,
|
|
72
72
|
"data-testid": "content-answers-suggested-questions-failed-alert-icon",
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import "../../../../styles/suggestions.css";
|
|
2
2
|
import { FilterChip as e } from "@box/blueprint-web";
|
|
3
|
-
import
|
|
3
|
+
import d from "clsx";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
const
|
|
6
|
-
suggestions:
|
|
5
|
+
const c = "_suggestions_bw4l0_1", u = "_sidebar_bw4l0_5", m = "_suggestion_bw4l0_1", i = {
|
|
6
|
+
suggestions: c,
|
|
7
7
|
sidebar: u,
|
|
8
|
-
suggestion:
|
|
9
|
-
},
|
|
10
|
-
askSuggestedQuestion:
|
|
8
|
+
suggestion: m
|
|
9
|
+
}, w = ({
|
|
10
|
+
askSuggestedQuestion: o,
|
|
11
11
|
isLoading: r,
|
|
12
12
|
onSuggestedQuestionClick: a,
|
|
13
13
|
suggestedQuestions: g,
|
|
14
|
-
variant:
|
|
14
|
+
variant: l = "modal"
|
|
15
15
|
}) => /* @__PURE__ */ t(e.Group, {
|
|
16
|
-
className:
|
|
16
|
+
className: d(i.suggestions, l === "sidebar" && i.sidebar),
|
|
17
17
|
"data-testid": "content-answers-suggested-questions",
|
|
18
18
|
name: "Singleselect SuggestedQuestions",
|
|
19
19
|
type: "single",
|
|
20
|
-
value:
|
|
20
|
+
value: o,
|
|
21
21
|
children: g.map((s) => {
|
|
22
|
-
const
|
|
22
|
+
const n = s.label || s.prompt;
|
|
23
23
|
return /* @__PURE__ */ t(e.ChipButton, {
|
|
24
|
-
className:
|
|
24
|
+
className: i.suggestion,
|
|
25
25
|
"data-testid": `content-answers-${s.id}`,
|
|
26
26
|
disabled: r,
|
|
27
27
|
onClick: () => a(s.prompt),
|
|
28
|
-
value:
|
|
28
|
+
value: n,
|
|
29
29
|
children: /* @__PURE__ */ t(e.Label, {
|
|
30
|
-
children:
|
|
30
|
+
children: n
|
|
31
31
|
})
|
|
32
32
|
}, s.id);
|
|
33
33
|
})
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
w as Suggestions,
|
|
37
|
+
w as default
|
|
38
38
|
};
|
|
@@ -1,75 +1,76 @@
|
|
|
1
1
|
import "../../../../styles/welcome-message.css";
|
|
2
|
-
import { InlineNotice as x, Text as
|
|
3
|
-
import {
|
|
2
|
+
import { InlineNotice as x, Text as s } from "@box/blueprint-web";
|
|
3
|
+
import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
|
|
4
4
|
import { Size6 as m } from "@box/blueprint-web-assets/tokens/tokens";
|
|
5
5
|
import T from "clsx";
|
|
6
6
|
import { useIntl as b } from "react-intl";
|
|
7
7
|
import { MediaContainer as n } from "../common/media-container.js";
|
|
8
|
-
import
|
|
9
|
-
import { jsx as e, jsxs as
|
|
10
|
-
const f = "
|
|
8
|
+
import o from "./messages.js";
|
|
9
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
10
|
+
const f = "_welcomeMessage_1wm3q_1", u = "_askQuestionText_1wm3q_4", v = "_sidebar_1wm3q_8", M = "_clearChatText_1wm3q_11", N = "_warningNotice_1wm3q_15", C = "_iconAvatar_1wm3q_18", a = {
|
|
11
11
|
welcomeMessage: f,
|
|
12
12
|
askQuestionText: u,
|
|
13
|
-
sidebar:
|
|
14
|
-
clearChatText:
|
|
15
|
-
warningNotice:
|
|
13
|
+
sidebar: v,
|
|
14
|
+
clearChatText: M,
|
|
15
|
+
warningNotice: N,
|
|
16
16
|
iconAvatar: C
|
|
17
|
-
},
|
|
17
|
+
}, L = ({
|
|
18
18
|
contentName: d,
|
|
19
|
-
contentType:
|
|
19
|
+
contentType: w,
|
|
20
20
|
variant: c = "modal",
|
|
21
21
|
warningNotice: l,
|
|
22
|
-
warningNoticeAriaLabel:
|
|
23
|
-
welcomeMessageClearText:
|
|
22
|
+
warningNoticeAriaLabel: h,
|
|
23
|
+
welcomeMessageClearText: g
|
|
24
24
|
}) => {
|
|
25
25
|
const t = c === "sidebar", {
|
|
26
26
|
formatMessage: i
|
|
27
|
-
} = b(),
|
|
28
|
-
className:
|
|
27
|
+
} = b(), _ = l && /* @__PURE__ */ e(x, {
|
|
28
|
+
className: a.warningNotice,
|
|
29
29
|
"data-testid": "content-answers-warning-notice",
|
|
30
30
|
variant: "warning",
|
|
31
|
-
variantIconAriaLabel:
|
|
32
|
-
children: /* @__PURE__ */ e(
|
|
31
|
+
variantIconAriaLabel: h,
|
|
32
|
+
children: /* @__PURE__ */ e(s, {
|
|
33
33
|
as: "p",
|
|
34
34
|
variant: "bodyDefaultBold",
|
|
35
35
|
children: l
|
|
36
36
|
})
|
|
37
37
|
});
|
|
38
38
|
return /* @__PURE__ */ e("div", {
|
|
39
|
-
className:
|
|
39
|
+
className: a.welcomeMessage,
|
|
40
40
|
"data-testid": "content-answers-welcome-message",
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ r(n, {
|
|
42
42
|
variant: c,
|
|
43
43
|
children: [/* @__PURE__ */ e(n.Figure, {
|
|
44
44
|
isUsedInsideSidebar: t,
|
|
45
45
|
children: /* @__PURE__ */ e("div", {
|
|
46
|
-
className:
|
|
46
|
+
className: a.iconAvatar,
|
|
47
47
|
children: /* @__PURE__ */ e(p, {
|
|
48
48
|
height: m,
|
|
49
49
|
role: "presentation",
|
|
50
50
|
width: m
|
|
51
51
|
})
|
|
52
52
|
})
|
|
53
|
-
}), /* @__PURE__ */
|
|
53
|
+
}), /* @__PURE__ */ r(n.Content, {
|
|
54
54
|
isUsedInsideSidebar: t,
|
|
55
|
-
|
|
55
|
+
variant: "welcomeMessage",
|
|
56
|
+
children: [_, /* @__PURE__ */ e(s, {
|
|
56
57
|
as: "h1",
|
|
57
|
-
className:
|
|
58
|
+
className: a.title,
|
|
58
59
|
variant: "titleSmall",
|
|
59
|
-
children: i(
|
|
60
|
-
}), /* @__PURE__ */ e(
|
|
60
|
+
children: i(o.welcomeMessageTitle)
|
|
61
|
+
}), /* @__PURE__ */ e(s, {
|
|
61
62
|
as: "p",
|
|
62
|
-
className: T(
|
|
63
|
-
children: i(
|
|
64
|
-
name: /* @__PURE__ */
|
|
63
|
+
className: T(a.askQuestionText, t && a.sidebar),
|
|
64
|
+
children: i(o.welcomeAskQuestionText, {
|
|
65
|
+
name: /* @__PURE__ */ r("b", {
|
|
65
66
|
children: ["“", d, "”"]
|
|
66
67
|
})
|
|
67
68
|
})
|
|
68
|
-
}), /* @__PURE__ */ e(
|
|
69
|
+
}), /* @__PURE__ */ e(s, {
|
|
69
70
|
as: "p",
|
|
70
|
-
className:
|
|
71
|
-
children:
|
|
72
|
-
type:
|
|
71
|
+
className: a.clearChatText,
|
|
72
|
+
children: g || i(o.welcomeClearChatText, {
|
|
73
|
+
type: w
|
|
73
74
|
})
|
|
74
75
|
})]
|
|
75
76
|
})]
|
|
@@ -77,6 +78,6 @@ const f = "_welcomeMessage_s48ml_1", u = "_askQuestionText_s48ml_4", N = "_sideb
|
|
|
77
78
|
});
|
|
78
79
|
};
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
L as WelcomeMessage,
|
|
82
|
+
L as default
|
|
82
83
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.16.0",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"**/*.css"
|
|
55
55
|
],
|
|
56
56
|
"license": "SEE LICENSE IN LICENSE",
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "443177ffa309257fcee35e12328a2d4e94b5ee39"
|
|
58
58
|
}
|
package/styles/agent-editor.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._debug_gfw1n_1{flex:1 1 auto;width:auto;max-height:35.375rem;padding:0 1.25rem 1.25rem;overflow:auto;padding:1.25rem}._debug_gfw1n_1._sidebar_gfw1n_9{padding:0 1rem 1rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._answerContent_79stl_1{font-weight:400;font-size:.875rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:1.25rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none;font-size:.9375rem;width:100%;overflow-x:auto}._answerContent_79stl_1._sidebar_79stl_13{font-size:.875rem}._answerContent_79stl_1._answerMarkdown_79stl_16{white-space:normal}._answerContent_79stl_1._answerMarkdown_79stl_16 p,._answerContent_79stl_1._answerMarkdown_79stl_16 ul,._answerContent_79stl_1._answerMarkdown_79stl_16 ol,._answerContent_79stl_1._answerMarkdown_79stl_16 table,._answerContent_79stl_1._answerMarkdown_79stl_16 img,._answerContent_79stl_1._answerMarkdown_79stl_16 pre,._answerContent_79stl_1._answerMarkdown_79stl_16 h1,._answerContent_79stl_1._answerMarkdown_79stl_16 h2,._answerContent_79stl_1._answerMarkdown_79stl_16 h3,._answerContent_79stl_1._answerMarkdown_79stl_16 h4,._answerContent_79stl_1._answerMarkdown_79stl_16 h5,._answerContent_79stl_1._answerMarkdown_79stl_16 h6,._answerContent_79stl_1._answerMarkdown_79stl_16 blockquote{color:#222;margin-block-start:0;margin-block-end:1.25rem}._answerContent_79stl_1._answerMarkdown_79stl_16 p:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 ul:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 ol:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 table:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 img:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 pre:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 h1:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 h2:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 h3:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 h4:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 h5:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 h6:last-child,._answerContent_79stl_1._answerMarkdown_79stl_16 blockquote:last-child{margin-block-end:0}._answerContent_79stl_1._answerMarkdown_79stl_16 hr{margin-block-start:1.25rem;margin-block-end:1.25rem;border:.0625rem solid #e8e8e8}._answerContent_79stl_1._answerMarkdown_79stl_16 h1{font-weight:700;font-size:1.3125rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:2rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none}._answerContent_79stl_1._answerMarkdown_79stl_16 h2{font-weight:700;font-size:1.125rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:1.5rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none}._answerContent_79stl_1._answerMarkdown_79stl_16 h3{font-weight:700;font-size:1rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:1.5rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none}._answerContent_79stl_1._answerMarkdown_79stl_16 h4{font-weight:700;font-size:.9375rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:1.25rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none}._answerContent_79stl_1._answerMarkdown_79stl_16 h5{font-weight:700;font-size:.875rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:1.25rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none}._answerContent_79stl_1._answerMarkdown_79stl_16 h6{font-weight:400;font-size:.75rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:.875rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none;color:#6f6f6f}._answerContent_79stl_1._answerMarkdown_79stl_16 a{font-weight:400;font-size:.875rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:1.25rem;letter-spacing:.01875rem;text-transform:none;text-decoration:underline;font-size:.9375rem}._answerContent_79stl_1._answerMarkdown_79stl_16 .footnote-ref a,._answerContent_79stl_1._answerMarkdown_79stl_16 a.footnote-backref{font-size:.75rem}._answerContent_79stl_1._answerMarkdown_79stl_16 strong{font-weight:700;font-size:.875rem;font-family:Lato,-apple-system,BlinkMacSystemFont,San Francisco,Segoe UI,Roboto,Helvetica Neue,sans-serif;line-height:1.25rem;letter-spacing:.01875rem;text-transform:none;text-decoration:none;font-size:.9375rem}._answerContent_79stl_1._answerMarkdown_79stl_16 img{max-width:100%}._answerContent_79stl_1._answerMarkdown_79stl_16 ul,._answerContent_79stl_1._answerMarkdown_79stl_16 ol{padding-left:1.25rem;list-style-position:outside}._answerContent_79stl_1._answerMarkdown_79stl_16 ul ul,._answerContent_79stl_1._answerMarkdown_79stl_16 ul ol,._answerContent_79stl_1._answerMarkdown_79stl_16 ol ul,._answerContent_79stl_1._answerMarkdown_79stl_16 ol ol{padding-left:1.25rem}._answerContent_79stl_1._answerMarkdown_79stl_16 ul li p,._answerContent_79stl_1._answerMarkdown_79stl_16 ol li p{display:inline}._answerContent_79stl_1._answerMarkdown_79stl_16 ul li{list-style-type:disc}._answerContent_79stl_1._answerMarkdown_79stl_16 ol li{list-style-type:decimal}._answerContent_79stl_1._answerMarkdown_79stl_16 li>ul,._answerContent_79stl_1._answerMarkdown_79stl_16 li>ol,._answerContent_79stl_1._answerMarkdown_79stl_16 li+li{margin-top:.5rem}._answerContent_79stl_1._answerMarkdown_79stl_16 blockquote{background-color:#f4f4f4;border-left:.125rem solid #e8e8e8;padding:.5rem .75rem;margin-inline-start:1rem;margin-inline-end:1rem}._answerContent_79stl_1._answerMarkdown_79stl_16 pre{color:#fff}
|
package/styles/answer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._answer_brr49_1{white-space:pre-wrap}._answer_brr49_1 ._alertIcon_brr49_4{margin-left:.5rem}._answer_brr49_1 ._error_brr49_7{display:flex;align-items:center}._answer_brr49_1 ._footer_brr49_11{height:1.5rem;display:flex;justify-content:space-between;align-items:center}._answer_brr49_1 ._footer_brr49_11._shouldHaveMarginTop_brr49_17{margin-top:.75rem}._answer_brr49_1 ._footer_brr49_11._shouldUseAnimation_brr49_20{max-height:0;overflow-y:hidden}._answer_brr49_1 ._footer_brr49_11._shouldUseAnimation_brr49_20._shouldAnimateHeight_brr49_24{max-height:200px;transition:max-height 1s ease-in}._answer_brr49_1 ._iconAvatar_brr49_28{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border-radius:50%;border:.0625rem solid #e8e8e8}@media (max-width: 374px){._answer_brr49_1 ._iconAvatar_brr49_28{width:var(--size-6);height:var(--size-6)}}
|
package/styles/content.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._loadingIndicatorWrapper_n9px6_1{width:100%}._content_n9px6_5{flex:1 1 auto;width:auto;max-height:35.375rem;padding:0 1.25rem 1.25rem;overflow:auto}._content_n9px6_5._sidebar_n9px6_12{padding:0 1rem 1rem}._content_n9px6_5._isLoading_n9px6_15{display:flex;align-items:center}._content_n9px6_5 ._messagesEnd_n9px6_19{margin-bottom:-1.25rem;padding-bottom:1.25rem}._content_n9px6_5 ._innerContent_n9px6_23{width:100%}._content_n9px6_5._sidebar_n9px6_12{max-height:unset}@media (max-width: 374px){._content_n9px6_5{flex:1;max-height:unset;padding:1rem;overflow-x:hidden}._content_n9px6_5 ._messagesEnd_n9px6_19{margin-bottom:-1rem;padding-bottom:1rem}}
|
package/styles/footer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._questionInput_luzem_1{position:relative;z-index:1;display:flex;flex:1 1 auto;align-items:end;padding:1rem 1.25rem;background:#fff;box-shadow:0 0 8px #0000000d,0 -1px #e8e8e8}._questionInput_luzem_1 ._avatar_luzem_11{margin-bottom:.25rem}._questionInput_luzem_1 ._submitButton_luzem_14{margin:0}._questionInput_luzem_1 ._textArea_luzem_17{gap:0;width:100%;margin:0 1rem}._questionInput_luzem_1 ._textArea_luzem_17 textarea{border:none}._questionInput_luzem_1._sidebar_luzem_25{padding:1rem}._questionInput_luzem_1._sidebar_luzem_25 ._textArea_luzem_17{margin:0 .75rem 0 0}._questionInput_luzem_1._sidebar_luzem_25 ._textArea_luzem_17 textarea{width:100%}._submitButtonTooltip_luzem_35{text-align:center}@media (max-width: 767px){._questionInput_luzem_1{padding:1rem}._questionInput_luzem_1 ._textArea_luzem_17{margin:0 .75rem 0 0}}
|