@box/box-ai-content-answers 0.87.4 → 0.88.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/esm/lib/box-ai-content-answers.js +57 -60
- package/esm/lib/components/agents/agent-editor.js +18 -18
- package/esm/lib/components/answer/answer-content.js +18 -19
- package/esm/lib/components/answer/answer.js +320 -322
- package/esm/lib/components/answer/citation.js +61 -62
- package/esm/lib/components/answer/inline-error.js +28 -28
- package/esm/lib/components/chat/chat.js +30 -32
- package/esm/lib/components/common/media-container.js +30 -29
- package/esm/lib/components/content/content.js +61 -63
- package/esm/lib/components/footer/footer.js +98 -109
- package/esm/lib/components/question/question.js +21 -43
- package/esm/lib/components/suggested-questions/suggested-questions.js +52 -61
- package/esm/lib/components/suggested-questions/suggestions.js +3 -3
- package/esm/lib/components/welcome-message/contextual-items-message.js +23 -23
- package/esm/lib/components/welcome-message/messages.js +1 -5
- package/esm/lib/components/welcome-message/welcome-message.js +55 -60
- package/i18n/bn-IN.js +2 -3
- package/i18n/bn-IN.properties +2 -4
- package/i18n/da-DK.js +2 -3
- package/i18n/da-DK.properties +2 -4
- package/i18n/de-DE.js +2 -3
- package/i18n/de-DE.properties +2 -4
- package/i18n/en-AU.js +0 -1
- package/i18n/en-AU.properties +0 -2
- package/i18n/en-CA.js +1 -2
- package/i18n/en-CA.properties +1 -3
- package/i18n/en-GB.js +0 -1
- package/i18n/en-GB.properties +0 -2
- package/i18n/en-US.js +1 -2
- package/i18n/en-US.properties +1 -3
- package/i18n/en-x-pseudo.js +58 -59
- package/i18n/en-x-pseudo.properties +58 -60
- package/i18n/es-419.js +2 -3
- package/i18n/es-419.properties +2 -4
- package/i18n/es-ES.js +2 -3
- package/i18n/es-ES.properties +2 -4
- package/i18n/fi-FI.js +2 -3
- package/i18n/fi-FI.properties +2 -4
- package/i18n/fr-CA.js +2 -3
- package/i18n/fr-CA.properties +2 -4
- package/i18n/fr-FR.js +2 -3
- package/i18n/fr-FR.properties +2 -4
- package/i18n/hi-IN.js +2 -3
- package/i18n/hi-IN.properties +2 -4
- package/i18n/it-IT.js +2 -3
- package/i18n/it-IT.properties +2 -4
- package/i18n/ja-JP.js +2 -3
- package/i18n/ja-JP.properties +2 -4
- package/i18n/json/src/lib/components/welcome-message/messages.json +1 -1
- package/i18n/ko-KR.js +2 -3
- package/i18n/ko-KR.properties +2 -4
- package/i18n/nb-NO.js +2 -3
- package/i18n/nb-NO.properties +2 -4
- package/i18n/nl-NL.js +2 -3
- package/i18n/nl-NL.properties +2 -4
- package/i18n/pl-PL.js +2 -3
- package/i18n/pl-PL.properties +2 -4
- package/i18n/pt-BR.js +2 -3
- package/i18n/pt-BR.properties +2 -4
- package/i18n/ru-RU.js +2 -3
- package/i18n/ru-RU.properties +2 -4
- package/i18n/sv-SE.js +2 -3
- package/i18n/sv-SE.properties +2 -4
- package/i18n/tr-TR.js +2 -3
- package/i18n/tr-TR.properties +2 -4
- package/i18n/zh-CN.js +2 -3
- package/i18n/zh-CN.properties +2 -4
- package/i18n/zh-TW.js +2 -3
- package/i18n/zh-TW.properties +2 -4
- package/package.json +3 -3
- package/styles/agent-editor.css +1 -1
- package/styles/answer-content.css +1 -1
- package/styles/answer.css +1 -1
- package/styles/box-ai-content-answers.css +1 -1
- package/styles/citation.css +1 -1
- package/styles/content.css +1 -1
- package/styles/footer.css +1 -1
- package/styles/inline-error.css +1 -1
- package/styles/media-container.css +1 -1
- package/styles/question.css +1 -1
- package/styles/suggestions.css +1 -1
- package/styles/welcome-message.css +1 -1
- package/types/lib/components/chat/chat.d.ts +1 -1
- package/types/lib/components/content/content.d.ts +1 -1
- package/types/lib/components/footer/footer.d.ts +2 -4
- package/types/lib/components/modal/stories/shared.d.ts +0 -3
- package/types/lib/components/question/question.d.ts +2 -4
- package/types/lib/components/welcome-message/messages.d.ts +0 -5
- package/types/lib/types.d.ts +0 -6
- package/esm/lib/components/answer/loading-element.js +0 -47
- package/styles/loading-element.css +0 -1
- package/types/lib/components/answer/loading-element.d.ts +0 -6
|
@@ -1,96 +1,93 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _ from "clsx";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import { AgentEditor as
|
|
4
|
-
import { Content as
|
|
5
|
-
import { Footer as
|
|
6
|
-
import { jsx as o, jsxs as
|
|
7
|
-
import '../../styles/box-ai-content-answers.css';const
|
|
8
|
-
container:
|
|
9
|
-
contentAnswers:
|
|
10
|
-
sidebar:
|
|
11
|
-
},
|
|
12
|
-
className:
|
|
3
|
+
import { AgentEditor as B } from "./components/agents/agent-editor.js";
|
|
4
|
+
import { Content as R } from "./components/content/content.js";
|
|
5
|
+
import { Footer as v } from "./components/footer/footer.js";
|
|
6
|
+
import { jsx as o, jsxs as G } from "react/jsx-runtime";
|
|
7
|
+
import '../../styles/box-ai-content-answers.css';const H = "_container_xgwyz_1", I = "_contentAnswers_xgwyz_8", J = "_sidebar_xgwyz_19", a = {
|
|
8
|
+
container: H,
|
|
9
|
+
contentAnswers: I,
|
|
10
|
+
sidebar: J
|
|
11
|
+
}, X = ({
|
|
12
|
+
className: x,
|
|
13
13
|
contentType: c,
|
|
14
|
-
contentName:
|
|
14
|
+
contentName: S,
|
|
15
15
|
error: e,
|
|
16
|
-
hasCustomSuggestedQuestions:
|
|
16
|
+
hasCustomSuggestedQuestions: p,
|
|
17
17
|
hasRequestInProgress: l,
|
|
18
|
-
isAgentSelectorEnabled:
|
|
19
|
-
isAIStudioAgentSelectorEnabled:
|
|
20
|
-
isDebugModeEnabled:
|
|
21
|
-
isStopResponseEnabled:
|
|
18
|
+
isAgentSelectorEnabled: A,
|
|
19
|
+
isAIStudioAgentSelectorEnabled: M,
|
|
20
|
+
isDebugModeEnabled: Q,
|
|
21
|
+
isStopResponseEnabled: h,
|
|
22
22
|
isStreamingEnabled: n,
|
|
23
|
-
userInfo: m,
|
|
24
23
|
questions: r,
|
|
25
24
|
recordAction: i,
|
|
26
|
-
retryQuestion:
|
|
25
|
+
retryQuestion: y,
|
|
27
26
|
showLoadingIndicator: d,
|
|
28
|
-
stopQuestion:
|
|
29
|
-
submitQuestion:
|
|
30
|
-
suggestedQuestions:
|
|
31
|
-
useAnimation:
|
|
32
|
-
onAgentEditorToggle:
|
|
27
|
+
stopQuestion: D,
|
|
28
|
+
submitQuestion: z,
|
|
29
|
+
suggestedQuestions: E,
|
|
30
|
+
useAnimation: j,
|
|
31
|
+
onAgentEditorToggle: k,
|
|
33
32
|
variant: u = "modal",
|
|
34
|
-
hostAppName:
|
|
35
|
-
...
|
|
33
|
+
hostAppName: C,
|
|
34
|
+
...F
|
|
36
35
|
}) => {
|
|
37
|
-
const [
|
|
36
|
+
const [m, g] = t.useState(null), [w, f] = t.useState(e != null), [s, b] = t.useState(!1), N = !w && !d;
|
|
38
37
|
return t.useEffect(() => {
|
|
39
|
-
|
|
38
|
+
f(e != null);
|
|
40
39
|
}, [e]), /* @__PURE__ */ o("div", {
|
|
41
|
-
className:
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
className:
|
|
44
|
-
children: [!s && /* @__PURE__ */ o(
|
|
45
|
-
...
|
|
46
|
-
askSuggestedQuestion:
|
|
47
|
-
contentName:
|
|
40
|
+
className: _(x, a.container),
|
|
41
|
+
children: /* @__PURE__ */ G("div", {
|
|
42
|
+
className: _(a.contentAnswers, u === "sidebar" && a.sidebar),
|
|
43
|
+
children: [!s && /* @__PURE__ */ o(R, {
|
|
44
|
+
...F,
|
|
45
|
+
askSuggestedQuestion: m,
|
|
46
|
+
contentName: S,
|
|
48
47
|
contentType: c,
|
|
49
48
|
error: e,
|
|
50
|
-
hasCustomSuggestedQuestions:
|
|
49
|
+
hasCustomSuggestedQuestions: p,
|
|
51
50
|
hasRequestInProgress: l,
|
|
52
|
-
hostAppName:
|
|
53
|
-
isErrorMessageShown:
|
|
51
|
+
hostAppName: C,
|
|
52
|
+
isErrorMessageShown: w,
|
|
54
53
|
isStreamingEnabled: n,
|
|
55
54
|
questions: r,
|
|
56
55
|
recordAction: i,
|
|
57
|
-
setAskSuggestedQuestion:
|
|
58
|
-
setIsErrorMessageShown:
|
|
56
|
+
setAskSuggestedQuestion: g,
|
|
57
|
+
setIsErrorMessageShown: f,
|
|
59
58
|
showLoadingIndicator: d,
|
|
60
|
-
suggestedQuestions:
|
|
61
|
-
useAnimation: n &&
|
|
62
|
-
userInfo: m,
|
|
59
|
+
suggestedQuestions: E,
|
|
60
|
+
useAnimation: n && j,
|
|
63
61
|
variant: u
|
|
64
|
-
}), s && /* @__PURE__ */ o(
|
|
65
|
-
onAgentEditorToggle:
|
|
62
|
+
}), s && /* @__PURE__ */ o(B, {
|
|
63
|
+
onAgentEditorToggle: k,
|
|
66
64
|
recordAction: i,
|
|
67
|
-
setIsDebugModeShown:
|
|
68
|
-
}),
|
|
69
|
-
askSuggestedQuestion:
|
|
65
|
+
setIsDebugModeShown: b
|
|
66
|
+
}), N && /* @__PURE__ */ o(v, {
|
|
67
|
+
askSuggestedQuestion: m,
|
|
70
68
|
contentType: c,
|
|
71
|
-
enableDebugMode:
|
|
69
|
+
enableDebugMode: Q,
|
|
72
70
|
hasRequestInProgress: l,
|
|
73
|
-
isAgentSelectorEnabled:
|
|
74
|
-
isAIStudioAgentSelectorEnabled:
|
|
71
|
+
isAgentSelectorEnabled: A,
|
|
72
|
+
isAIStudioAgentSelectorEnabled: M,
|
|
75
73
|
isDebugModeShown: s,
|
|
76
|
-
isStopResponseEnabled:
|
|
74
|
+
isStopResponseEnabled: h,
|
|
77
75
|
isStreamingEnabled: n,
|
|
78
76
|
lastQuestion: r[r.length - 1],
|
|
79
|
-
onRetryQuestion:
|
|
80
|
-
onStopQuestion:
|
|
77
|
+
onRetryQuestion: y,
|
|
78
|
+
onStopQuestion: D,
|
|
81
79
|
recordAction: i,
|
|
82
|
-
sendQuestion:
|
|
83
|
-
setAskSuggestedQuestion:
|
|
80
|
+
sendQuestion: z,
|
|
81
|
+
setAskSuggestedQuestion: g,
|
|
84
82
|
toggleDebugMode: () => {
|
|
85
|
-
|
|
83
|
+
b(!s);
|
|
86
84
|
},
|
|
87
|
-
user: m,
|
|
88
85
|
variant: u
|
|
89
86
|
})]
|
|
90
87
|
})
|
|
91
88
|
});
|
|
92
89
|
};
|
|
93
90
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
X as BoxAiContentAnswers,
|
|
92
|
+
X as default
|
|
96
93
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextArea as
|
|
1
|
+
import { TextArea as g } from "@box/blueprint-web";
|
|
2
2
|
import { useEffect as a, createRef as u } from "react";
|
|
3
3
|
import { useIntl as d } from "react-intl";
|
|
4
4
|
import { isDebugModeTrigger as l } from "../common/keyInputUtils.js";
|
|
@@ -6,50 +6,50 @@ import p from "../footer/messages.js";
|
|
|
6
6
|
import { useAgents as b, useAgentsDispatch as _ } from "../../contexts/AgentsContext.js";
|
|
7
7
|
import { LOGGER_BASE_CONFIG as h } from "../common/constants.js";
|
|
8
8
|
import { jsx as E } from "react/jsx-runtime";
|
|
9
|
-
import '../../../../styles/agent-editor.css';const N = "
|
|
9
|
+
import '../../../../styles/agent-editor.css';const N = "_debug_1ov4h_1", O = "_sidebar_1ov4h_9", R = {
|
|
10
10
|
debug: N,
|
|
11
11
|
sidebar: O
|
|
12
|
-
},
|
|
13
|
-
onAgentEditorToggle:
|
|
14
|
-
recordAction:
|
|
12
|
+
}, A = 25, M = ({
|
|
13
|
+
onAgentEditorToggle: o,
|
|
14
|
+
recordAction: r,
|
|
15
15
|
setIsDebugModeShown: i
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
|
-
formatMessage:
|
|
18
|
+
formatMessage: n
|
|
19
19
|
} = d(), {
|
|
20
20
|
selectedAgent: t
|
|
21
|
-
} = b(),
|
|
21
|
+
} = b(), c = _(), e = /* @__PURE__ */ u();
|
|
22
22
|
a(() => {
|
|
23
23
|
if (e.current) {
|
|
24
24
|
const s = JSON.stringify(t.config, null, 4);
|
|
25
25
|
e.current.value = s || "";
|
|
26
26
|
}
|
|
27
|
-
}, [e, t,
|
|
28
|
-
|
|
27
|
+
}, [e, t, n]), a(() => {
|
|
28
|
+
o && (o(t), r && r({
|
|
29
29
|
...h,
|
|
30
30
|
target: "debugMode"
|
|
31
31
|
}));
|
|
32
32
|
}, []);
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const f = () => {
|
|
34
|
+
c({
|
|
35
35
|
type: "OVERRIDE_AGENT_CONFIG",
|
|
36
36
|
agentName: t.name,
|
|
37
37
|
agentConfig: JSON.parse(e.current.value)
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, m = (s) => {
|
|
40
40
|
l(s) && i(!1);
|
|
41
41
|
};
|
|
42
|
-
return /* @__PURE__ */ E(
|
|
42
|
+
return /* @__PURE__ */ E(g, {
|
|
43
43
|
ref: e,
|
|
44
44
|
className: R.debug,
|
|
45
45
|
"data-testid": "content-answers-debug",
|
|
46
46
|
hideLabel: !0,
|
|
47
|
-
label:
|
|
48
|
-
maxRows:
|
|
49
|
-
onChange:
|
|
50
|
-
onKeyDown:
|
|
47
|
+
label: n(p.askQuestionPlaceholder),
|
|
48
|
+
maxRows: A,
|
|
49
|
+
onChange: f,
|
|
50
|
+
onKeyDown: m
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
M as AgentEditor
|
|
55
55
|
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import d from "clsx";
|
|
2
2
|
import { m as w } from "../../../../chunks/markdown.js";
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import '../../../../styles/answer-content.css';const
|
|
5
|
-
answerContent:
|
|
6
|
-
sidebar: l,
|
|
3
|
+
import { jsxs as c, Fragment as l, jsx as m } from "react/jsx-runtime";
|
|
4
|
+
import '../../../../styles/answer-content.css';const _ = "_answerContent_qhum2_1", C = "_answerMarkdown_qhum2_16", n = {
|
|
5
|
+
answerContent: _,
|
|
7
6
|
answerMarkdown: C
|
|
8
|
-
},
|
|
9
|
-
answer:
|
|
10
|
-
isMarkdownEnabled:
|
|
11
|
-
className:
|
|
12
|
-
variant:
|
|
7
|
+
}, u = ({
|
|
8
|
+
answer: e,
|
|
9
|
+
isMarkdownEnabled: t,
|
|
10
|
+
className: r,
|
|
11
|
+
variant: i = "modal",
|
|
13
12
|
...s
|
|
14
13
|
}) => {
|
|
15
|
-
const o =
|
|
16
|
-
let a =
|
|
17
|
-
return
|
|
18
|
-
children: [!
|
|
19
|
-
className: d(
|
|
14
|
+
const o = i === "sidebar";
|
|
15
|
+
let a = e;
|
|
16
|
+
return t && e && (a = w.render(e)), /* @__PURE__ */ c(l, {
|
|
17
|
+
children: [!t && /* @__PURE__ */ m("div", {
|
|
18
|
+
className: d(n.answerContent, o && n.sidebar, "Answer-text", r),
|
|
20
19
|
...s,
|
|
21
|
-
children:
|
|
22
|
-
}),
|
|
23
|
-
className: d(
|
|
20
|
+
children: e
|
|
21
|
+
}), t && /* @__PURE__ */ m("div", {
|
|
22
|
+
className: d(n.answerContent, n.answerMarkdown, o && n.sidebar, "Answer-text", r),
|
|
24
23
|
dangerouslySetInnerHTML: {
|
|
25
24
|
__html: a
|
|
26
25
|
},
|
|
@@ -29,6 +28,6 @@ import '../../../../styles/answer-content.css';const b = "_answerContent_o18bz_1
|
|
|
29
28
|
});
|
|
30
29
|
};
|
|
31
30
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
u as AnswerContent,
|
|
32
|
+
u as default
|
|
34
33
|
};
|