@box/box-ai-content-answers 0.86.2 → 0.87.2
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 +12 -13
- package/chunks/markdown.js +12168 -0
- package/esm/lib/box-ai-content-answers.js +11 -12
- package/esm/lib/components/agents/agent-editor.js +7 -8
- package/esm/lib/components/agents/agent-selector.js +3 -4
- package/esm/lib/components/answer/answer-content.js +5 -6
- package/esm/lib/components/answer/answer.js +604 -107
- package/esm/lib/components/answer/citation.js +4 -5
- package/esm/lib/components/answer/inline-error.js +4 -5
- package/esm/lib/components/answer/loading-element.js +4 -5
- package/esm/lib/components/answer/references.js +19 -20
- package/esm/lib/components/answer/thumb-buttons.js +11 -12
- package/esm/lib/components/chat/chat.js +13 -14
- package/esm/lib/components/common/markdown.js +3 -12212
- package/esm/lib/components/common/media-container.js +10 -11
- package/esm/lib/components/content/content.js +4 -5
- package/esm/lib/components/footer/footer-actions.js +3 -4
- package/esm/lib/components/footer/footer.js +3 -4
- package/esm/lib/components/modal-error/modal-error.js +3 -4
- package/esm/lib/components/question/question.js +12 -13
- package/esm/lib/components/suggested-questions/suggested-questions.js +10 -11
- package/esm/lib/components/suggested-questions/suggestions.js +8 -9
- package/esm/lib/components/welcome-message/contextual-items-message.js +4 -5
- package/esm/lib/components/welcome-message/items-dropdown.js +15 -16
- package/esm/lib/components/welcome-message/unsupported-items-notice.js +9 -10
- package/esm/lib/components/welcome-message/welcome-message.js +11 -12
- package/i18n/bn-IN.js +3 -3
- package/i18n/bn-IN.properties +7 -3
- package/i18n/da-DK.js +3 -3
- package/i18n/da-DK.properties +7 -3
- package/i18n/de-DE.js +3 -3
- package/i18n/de-DE.properties +7 -3
- package/i18n/en-AU.js +3 -3
- package/i18n/en-AU.properties +7 -3
- package/i18n/en-CA.js +1 -1
- package/i18n/en-CA.properties +5 -1
- package/i18n/en-GB.js +3 -3
- package/i18n/en-GB.properties +7 -3
- package/i18n/en-x-pseudo.js +59 -59
- package/i18n/en-x-pseudo.properties +61 -57
- package/i18n/es-419.js +3 -3
- package/i18n/es-419.properties +7 -3
- package/i18n/es-ES.js +3 -3
- package/i18n/es-ES.properties +7 -3
- package/i18n/fi-FI.js +3 -3
- package/i18n/fi-FI.properties +7 -3
- package/i18n/fr-CA.js +3 -3
- package/i18n/fr-CA.properties +7 -3
- package/i18n/fr-FR.js +3 -3
- package/i18n/fr-FR.properties +7 -3
- package/i18n/hi-IN.js +3 -3
- package/i18n/hi-IN.properties +7 -3
- package/i18n/it-IT.js +3 -3
- package/i18n/it-IT.properties +7 -3
- package/i18n/ja-JP.js +4 -4
- package/i18n/ja-JP.properties +8 -4
- package/i18n/ko-KR.js +3 -3
- package/i18n/ko-KR.properties +7 -3
- package/i18n/nb-NO.js +3 -3
- package/i18n/nb-NO.properties +7 -3
- package/i18n/nl-NL.js +3 -3
- package/i18n/nl-NL.properties +7 -3
- package/i18n/pl-PL.js +3 -3
- package/i18n/pl-PL.properties +7 -3
- package/i18n/pt-BR.js +3 -3
- package/i18n/pt-BR.properties +7 -3
- package/i18n/ru-RU.js +3 -3
- package/i18n/ru-RU.properties +7 -3
- package/i18n/sv-SE.js +3 -3
- package/i18n/sv-SE.properties +7 -3
- package/i18n/tr-TR.js +3 -3
- package/i18n/tr-TR.properties +7 -3
- package/i18n/zh-CN.js +3 -3
- package/i18n/zh-CN.properties +7 -3
- package/i18n/zh-TW.js +3 -3
- package/i18n/zh-TW.properties +7 -3
- package/package.json +7 -7
- package/types/lib/box-ai-content-answers.d.ts +1 -1
- package/types/lib/components/agents/agent-editor.d.ts +1 -1
- package/types/lib/components/agents/agent-selector.d.ts +1 -1
- package/types/lib/components/agents/stories/shared.d.ts +3 -3
- package/types/lib/components/answer/answer-content.d.ts +2 -2
- package/types/lib/components/answer/answer.d.ts +1 -1
- package/types/lib/components/answer/citation.d.ts +1 -1
- package/types/lib/components/answer/copy-button.d.ts +1 -1
- package/types/lib/components/answer/inline-error.d.ts +1 -1
- package/types/lib/components/answer/loading-element.d.ts +1 -1
- package/types/lib/components/answer/no-citations.d.ts +1 -1
- package/types/lib/components/answer/references.d.ts +1 -1
- package/types/lib/components/answer/stories/shared.d.ts +1 -1
- package/types/lib/components/answer/thumb-buttons.d.ts +1 -1
- package/types/lib/components/api-wrapper/api-wrapper.d.ts +1 -1
- package/types/lib/components/api-wrapper/constants.d.ts +1 -1
- package/types/lib/components/api-wrapper/content-answers-component.d.ts +1 -1
- package/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +4 -4
- package/types/lib/components/api-wrapper/records.d.ts +1 -1
- package/types/lib/components/api-wrapper/stories/shared.d.ts +1 -1
- package/types/lib/components/api-wrapper/test-utils/ReadableStreamSimulator.d.ts +1 -1
- package/types/lib/components/api-wrapper/types.d.ts +3 -3
- package/types/lib/components/api-wrapper/utils/format.d.ts +1 -1
- package/types/lib/components/api-wrapper/utils/request.d.ts +3 -3
- package/types/lib/components/api-wrapper/utils/stream.d.ts +1 -1
- package/types/lib/components/chat/chat.d.ts +1 -1
- package/types/lib/components/common/constants.d.ts +1 -1
- package/types/lib/components/common/media-container.d.ts +2 -2
- package/types/lib/components/common/mock-data.d.ts +4 -4
- package/types/lib/components/content/content.d.ts +1 -1
- package/types/lib/components/footer/footer-actions.d.ts +1 -1
- package/types/lib/components/footer/footer.d.ts +1 -1
- package/types/lib/components/footer/stories/shared.d.ts +7 -7
- package/types/lib/components/modal/modal.d.ts +5 -5
- package/types/lib/components/modal/stories/shared.d.ts +2 -2
- package/types/lib/components/modal-error/stories/shared.d.ts +1 -1
- package/types/lib/components/question/question.d.ts +1 -1
- package/types/lib/components/question/stories/shared.d.ts +1 -1
- package/types/lib/components/suggested-questions/mocks.d.ts +1 -1
- package/types/lib/components/suggested-questions/stories/shared.d.ts +1 -1
- package/types/lib/components/suggested-questions/suggested-questions.d.ts +1 -1
- package/types/lib/components/suggested-questions/suggestions.d.ts +1 -1
- package/types/lib/components/welcome-message/contextual-items-message.d.ts +1 -1
- package/types/lib/components/welcome-message/items-dropdown.d.ts +1 -1
- package/types/lib/components/welcome-message/stories/shared.d.ts +4 -4
- package/types/lib/components/welcome-message/unsupported-items-notice.d.ts +1 -1
- package/types/lib/components/welcome-message/welcome-message.d.ts +1 -1
- package/types/lib/contexts/AgentsContext.d.ts +1 -1
- package/types/lib/stories/shared.d.ts +3 -3
- package/types/lib/types.d.ts +2 -2
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import w from "clsx";
|
|
1
|
+
import S from "clsx";
|
|
3
2
|
import * as t from "react";
|
|
4
3
|
import { AgentEditor as R } from "./components/agents/agent-editor.js";
|
|
5
4
|
import { Content as z } from "./components/content/content.js";
|
|
6
5
|
import { Footer as G } from "./components/footer/footer.js";
|
|
7
6
|
import { jsx as o, jsxs as H } from "react/jsx-runtime";
|
|
8
|
-
const J = "_container_m6vks_1", K = "_contentAnswers_m6vks_8", O = "_sidebar_m6vks_19", a = {
|
|
7
|
+
import '../../styles/box-ai-content-answers.css';const J = "_container_m6vks_1", K = "_contentAnswers_m6vks_8", O = "_sidebar_m6vks_19", a = {
|
|
9
8
|
container: J,
|
|
10
9
|
contentAnswers: K,
|
|
11
10
|
sidebar: O
|
|
12
|
-
},
|
|
13
|
-
className:
|
|
11
|
+
}, Z = ({
|
|
12
|
+
className: p,
|
|
14
13
|
contentType: c,
|
|
15
14
|
contentName: A,
|
|
16
15
|
error: e,
|
|
@@ -35,13 +34,13 @@ const J = "_container_m6vks_1", K = "_contentAnswers_m6vks_8", O = "_sidebar_m6v
|
|
|
35
34
|
hostAppName: N,
|
|
36
35
|
...y
|
|
37
36
|
}) => {
|
|
38
|
-
const [g, b] = t.useState(null), [f, _] = t.useState(e != null), [s,
|
|
37
|
+
const [g, b] = t.useState(null), [f, _] = t.useState(e != null), [s, w] = t.useState(!1), B = !f && !d;
|
|
39
38
|
return t.useEffect(() => {
|
|
40
39
|
_(e != null);
|
|
41
40
|
}, [e]), /* @__PURE__ */ o("div", {
|
|
42
|
-
className:
|
|
41
|
+
className: S(p, a.container),
|
|
43
42
|
children: /* @__PURE__ */ H("div", {
|
|
44
|
-
className:
|
|
43
|
+
className: S(a.contentAnswers, u === "sidebar" && a.sidebar),
|
|
45
44
|
children: [!s && /* @__PURE__ */ o(z, {
|
|
46
45
|
...y,
|
|
47
46
|
askSuggestedQuestion: g,
|
|
@@ -65,7 +64,7 @@ const J = "_container_m6vks_1", K = "_contentAnswers_m6vks_8", O = "_sidebar_m6v
|
|
|
65
64
|
}), s && /* @__PURE__ */ o(R, {
|
|
66
65
|
onAgentEditorToggle: F,
|
|
67
66
|
recordAction: i,
|
|
68
|
-
setIsDebugModeShown:
|
|
67
|
+
setIsDebugModeShown: w
|
|
69
68
|
}), B && /* @__PURE__ */ o(G, {
|
|
70
69
|
askSuggestedQuestion: g,
|
|
71
70
|
contentType: c,
|
|
@@ -83,7 +82,7 @@ const J = "_container_m6vks_1", K = "_contentAnswers_m6vks_8", O = "_sidebar_m6v
|
|
|
83
82
|
sendQuestion: E,
|
|
84
83
|
setAskSuggestedQuestion: b,
|
|
85
84
|
toggleDebugMode: () => {
|
|
86
|
-
|
|
85
|
+
w(!s);
|
|
87
86
|
},
|
|
88
87
|
user: m,
|
|
89
88
|
variant: u
|
|
@@ -92,6 +91,6 @@ const J = "_container_m6vks_1", K = "_contentAnswers_m6vks_8", O = "_sidebar_m6v
|
|
|
92
91
|
});
|
|
93
92
|
};
|
|
94
93
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
Z as BoxAiContentAnswers,
|
|
95
|
+
Z as default
|
|
97
96
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { TextArea as c } from "@box/blueprint-web";
|
|
1
|
+
import { TextArea as m } from "@box/blueprint-web";
|
|
3
2
|
import { useEffect as a, createRef as u } from "react";
|
|
4
3
|
import { useIntl as d } from "react-intl";
|
|
5
4
|
import { isDebugModeTrigger as l } from "../common/keyInputUtils.js";
|
|
@@ -7,10 +6,10 @@ import p from "../footer/messages.js";
|
|
|
7
6
|
import { useAgents as b, useAgentsDispatch as _ } from "../../contexts/AgentsContext.js";
|
|
8
7
|
import { LOGGER_BASE_CONFIG as h } from "../common/constants.js";
|
|
9
8
|
import { jsx as E } from "react/jsx-runtime";
|
|
10
|
-
const N = "_debug_gfw1n_1", O = "_sidebar_gfw1n_9", R = {
|
|
9
|
+
import '../../../../styles/agent-editor.css';const N = "_debug_gfw1n_1", O = "_sidebar_gfw1n_9", R = {
|
|
11
10
|
debug: N,
|
|
12
11
|
sidebar: O
|
|
13
|
-
}, w = 25,
|
|
12
|
+
}, w = 25, S = ({
|
|
14
13
|
onAgentEditorToggle: n,
|
|
15
14
|
recordAction: o,
|
|
16
15
|
setIsDebugModeShown: i
|
|
@@ -37,10 +36,10 @@ const N = "_debug_gfw1n_1", O = "_sidebar_gfw1n_9", R = {
|
|
|
37
36
|
agentName: t.name,
|
|
38
37
|
agentConfig: JSON.parse(e.current.value)
|
|
39
38
|
});
|
|
40
|
-
},
|
|
39
|
+
}, c = (s) => {
|
|
41
40
|
l(s) && i(!1);
|
|
42
41
|
};
|
|
43
|
-
return /* @__PURE__ */ E(
|
|
42
|
+
return /* @__PURE__ */ E(m, {
|
|
44
43
|
ref: e,
|
|
45
44
|
className: R.debug,
|
|
46
45
|
"data-testid": "content-answers-debug",
|
|
@@ -48,9 +47,9 @@ const N = "_debug_gfw1n_1", O = "_sidebar_gfw1n_9", R = {
|
|
|
48
47
|
label: r(p.askQuestionPlaceholder),
|
|
49
48
|
maxRows: w,
|
|
50
49
|
onChange: g,
|
|
51
|
-
onKeyDown:
|
|
50
|
+
onKeyDown: c
|
|
52
51
|
});
|
|
53
52
|
};
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
S as AgentEditor
|
|
56
55
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../../../../styles/agent-selector.css";
|
|
2
1
|
import { FilterChip as n, Popover as a, Status as S, SmallList as i } from "@box/blueprint-web";
|
|
3
2
|
import { useState as f, useCallback as C } from "react";
|
|
4
3
|
import { useIntl as I } from "react-intl";
|
|
@@ -6,12 +5,12 @@ import { useAgents as N, useAgentsDispatch as G } from "../../contexts/AgentsCon
|
|
|
6
5
|
import { LOGGER_BASE_CONFIG as O, LOGGER_ACTION_CLICK as A } from "../common/constants.js";
|
|
7
6
|
import p from "./messages.js";
|
|
8
7
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
9
|
-
const E = "_agentSelector_rri97_1", x = "_agentStatus_rri97_5", T = "_agentList_rri97_20", v = "_agentListItem_rri97_20", s = {
|
|
8
|
+
import '../../../../styles/agent-selector.css';const E = "_agentSelector_rri97_1", x = "_agentStatus_rri97_5", T = "_agentList_rri97_20", v = "_agentListItem_rri97_20", s = {
|
|
10
9
|
agentSelector: E,
|
|
11
10
|
agentStatus: x,
|
|
12
11
|
agentList: T,
|
|
13
12
|
agentListItem: v
|
|
14
|
-
},
|
|
13
|
+
}, K = ({
|
|
15
14
|
onSelectAgent: r,
|
|
16
15
|
recordAction: o
|
|
17
16
|
}) => {
|
|
@@ -72,5 +71,5 @@ const E = "_agentSelector_rri97_1", x = "_agentStatus_rri97_5", T = "_agentList_
|
|
|
72
71
|
});
|
|
73
72
|
};
|
|
74
73
|
export {
|
|
75
|
-
|
|
74
|
+
K as AgentSelector
|
|
76
75
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import "../../../../styles/answer-content.css";
|
|
2
1
|
import d from "clsx";
|
|
3
|
-
import w from "
|
|
2
|
+
import { m as w } from "../../../../chunks/markdown.js";
|
|
4
3
|
import { jsxs as _, Fragment as c, jsx as i } from "react/jsx-runtime";
|
|
5
|
-
const b = "_answerContent_o18bz_1", l = "_sidebar_o18bz_15", C = "_answerMarkdown_o18bz_18", e = {
|
|
4
|
+
import '../../../../styles/answer-content.css';const b = "_answerContent_o18bz_1", l = "_sidebar_o18bz_15", C = "_answerMarkdown_o18bz_18", e = {
|
|
6
5
|
answerContent: b,
|
|
7
6
|
sidebar: l,
|
|
8
7
|
answerMarkdown: C
|
|
9
|
-
},
|
|
8
|
+
}, p = ({
|
|
10
9
|
answer: n,
|
|
11
10
|
isMarkdownEnabled: r,
|
|
12
11
|
className: t,
|
|
@@ -30,6 +29,6 @@ const b = "_answerContent_o18bz_1", l = "_sidebar_o18bz_15", C = "_answerMarkdow
|
|
|
30
29
|
});
|
|
31
30
|
};
|
|
32
31
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
p as AnswerContent,
|
|
33
|
+
p as default
|
|
35
34
|
};
|