@box/box-ai-content-answers 0.75.2 → 0.76.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/components/common/mock-data.js +132 -5
- package/esm/lib/components/welcome-message/items-dropdown.js +83 -0
- package/esm/lib/components/welcome-message/messages.js +4 -0
- package/i18n/bn-IN.js +1 -0
- package/i18n/da-DK.js +1 -0
- package/i18n/de-DE.js +1 -0
- package/i18n/en-AU.js +1 -0
- package/i18n/en-CA.js +1 -0
- package/i18n/en-GB.js +1 -0
- package/i18n/en-US.js +1 -0
- package/i18n/en-US.properties +2 -0
- package/i18n/en-x-pseudo.js +1 -0
- package/i18n/es-419.js +1 -0
- package/i18n/es-ES.js +1 -0
- package/i18n/fi-FI.js +1 -0
- package/i18n/fr-CA.js +1 -0
- package/i18n/fr-FR.js +1 -0
- package/i18n/hi-IN.js +1 -0
- package/i18n/it-IT.js +1 -0
- package/i18n/ja-JP.js +1 -0
- package/i18n/json/src/lib/components/welcome-message/messages.json +1 -1
- package/i18n/ko-KR.js +1 -0
- package/i18n/nb-NO.js +1 -0
- package/i18n/nl-NL.js +1 -0
- package/i18n/pl-PL.js +1 -0
- package/i18n/pt-BR.js +1 -0
- package/i18n/ru-RU.js +1 -0
- package/i18n/sv-SE.js +1 -0
- package/i18n/tr-TR.js +1 -0
- package/i18n/zh-CN.js +1 -0
- package/i18n/zh-TW.js +1 -0
- package/package.json +6 -4
- package/styles/items-dropdown.css +1 -0
- package/types/lib/box-ai-content-answers.d.ts +2 -2
- package/types/lib/components/answer/answer.d.ts +2 -2
- package/types/lib/components/answer/citation.d.ts +2 -2
- package/types/lib/components/answer/references.d.ts +2 -2
- package/types/lib/components/common/mock-data.d.ts +3 -1
- package/types/lib/components/welcome-message/items-dropdown.d.ts +3 -0
- package/types/lib/components/welcome-message/messages.d.ts +5 -0
- package/types/lib/components/welcome-message/stories/shared.d.ts +6 -1
- package/types/lib/types.d.ts +13 -1
|
@@ -3,7 +3,7 @@ import "@box/blueprint-web";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "../answer/answer.js";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
|
-
import { agentList as
|
|
6
|
+
import { agentList as t, agentState as i } from "../api-wrapper/constants.js";
|
|
7
7
|
const a = [{
|
|
8
8
|
location: "location1",
|
|
9
9
|
fileId: "123",
|
|
@@ -16,7 +16,7 @@ const a = [{
|
|
|
16
16
|
location: "location3",
|
|
17
17
|
fileId: "789",
|
|
18
18
|
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst."
|
|
19
|
-
}],
|
|
19
|
+
}], u = [{
|
|
20
20
|
answer: "I am a mock answer",
|
|
21
21
|
id: "1",
|
|
22
22
|
isCompleted: !0,
|
|
@@ -80,9 +80,136 @@ const a = [{
|
|
|
80
80
|
isLoading: !1,
|
|
81
81
|
error: e.NO_CONTENT,
|
|
82
82
|
prompt: "What is the capital of Italy?"
|
|
83
|
-
}], d = i, c =
|
|
83
|
+
}], d = t, m = i, c = [{
|
|
84
|
+
type: "file",
|
|
85
|
+
name: "Document.docx",
|
|
86
|
+
status: "supported",
|
|
87
|
+
fileType: "word-document",
|
|
88
|
+
id: "0"
|
|
89
|
+
}, {
|
|
90
|
+
type: "file",
|
|
91
|
+
name: "Spreadsheet.xlsx",
|
|
92
|
+
status: "supported",
|
|
93
|
+
fileType: "spreadsheet",
|
|
94
|
+
id: "1"
|
|
95
|
+
}, {
|
|
96
|
+
type: "file",
|
|
97
|
+
name: "Presentation.pptx",
|
|
98
|
+
status: "supported",
|
|
99
|
+
fileType: "powerpoint-presentation",
|
|
100
|
+
id: "2"
|
|
101
|
+
}, {
|
|
102
|
+
type: "file",
|
|
103
|
+
name: "PDFFile.pdf",
|
|
104
|
+
status: "supported",
|
|
105
|
+
fileType: "pdf",
|
|
106
|
+
id: "3"
|
|
107
|
+
}, {
|
|
108
|
+
type: "file",
|
|
109
|
+
name: "Image.jpg",
|
|
110
|
+
status: "unsupported",
|
|
111
|
+
fileType: "image",
|
|
112
|
+
id: "4"
|
|
113
|
+
}, {
|
|
114
|
+
type: "file",
|
|
115
|
+
name: "Video.mp4",
|
|
116
|
+
status: "unsupported",
|
|
117
|
+
fileType: "video",
|
|
118
|
+
id: "5"
|
|
119
|
+
}, {
|
|
120
|
+
type: "file",
|
|
121
|
+
name: "Audio.mp3",
|
|
122
|
+
status: "unsupported",
|
|
123
|
+
fileType: "audio",
|
|
124
|
+
id: "6"
|
|
125
|
+
}, {
|
|
126
|
+
type: "file",
|
|
127
|
+
name: "Code.js",
|
|
128
|
+
status: "supported",
|
|
129
|
+
fileType: "code",
|
|
130
|
+
id: "7"
|
|
131
|
+
}, {
|
|
132
|
+
type: "file",
|
|
133
|
+
name: "Archive.zip",
|
|
134
|
+
status: "supported",
|
|
135
|
+
fileType: "archive",
|
|
136
|
+
id: "8"
|
|
137
|
+
}, {
|
|
138
|
+
type: "file",
|
|
139
|
+
name: "Note.boxnote",
|
|
140
|
+
status: "supported",
|
|
141
|
+
fileType: "boxnote",
|
|
142
|
+
id: "9"
|
|
143
|
+
}, {
|
|
144
|
+
type: "file",
|
|
145
|
+
name: "Note.boxnote",
|
|
146
|
+
status: "supported",
|
|
147
|
+
id: "10"
|
|
148
|
+
}], _ = [{
|
|
149
|
+
type: "file",
|
|
150
|
+
name: "This_is_a_very_long_file_name_that_tests_the_boundary_conditions_for_file_names.docx",
|
|
151
|
+
status: "supported",
|
|
152
|
+
fileType: "word-document",
|
|
153
|
+
id: "0"
|
|
154
|
+
}, {
|
|
155
|
+
type: "file",
|
|
156
|
+
name: "Another_extremely_long_file_name_that_could_exist_in_the_real_world_but_is_unlikely.pdf",
|
|
157
|
+
status: "supported",
|
|
158
|
+
fileType: "pdf",
|
|
159
|
+
id: "1"
|
|
160
|
+
}, {
|
|
161
|
+
type: "file",
|
|
162
|
+
name: "Presentation_with_a_very_descriptive_and_lengthy_title_about_its_content.pptx",
|
|
163
|
+
status: "supported",
|
|
164
|
+
fileType: "powerpoint-presentation",
|
|
165
|
+
id: "2"
|
|
166
|
+
}, {
|
|
167
|
+
type: "file",
|
|
168
|
+
name: "Spreadsheet_with_detailed_information_about_company_finances_and_other_details.xlsx",
|
|
169
|
+
status: "supported",
|
|
170
|
+
fileType: "spreadsheet",
|
|
171
|
+
id: "3"
|
|
172
|
+
}, {
|
|
173
|
+
type: "file",
|
|
174
|
+
name: "Image_with_a_very_long_description_of_what_the_image_is_about_and_its_context.jpg",
|
|
175
|
+
status: "unsupported",
|
|
176
|
+
fileType: "image",
|
|
177
|
+
id: "4"
|
|
178
|
+
}, {
|
|
179
|
+
type: "file",
|
|
180
|
+
name: "Video_with_a_long_title_describing_its_contents_and_context_in_full.mp4",
|
|
181
|
+
status: "unsupported",
|
|
182
|
+
fileType: "video",
|
|
183
|
+
id: "5"
|
|
184
|
+
}, {
|
|
185
|
+
type: "file",
|
|
186
|
+
name: "Audio_file_with_a_detailed_and_verbose_description_of_its_contents_and_purpose.mp3",
|
|
187
|
+
status: "unsupported",
|
|
188
|
+
fileType: "audio",
|
|
189
|
+
id: "6"
|
|
190
|
+
}, {
|
|
191
|
+
type: "file",
|
|
192
|
+
name: "Document_with_restricted_access_and_a_long_title_describing_its_sensitivity.docx",
|
|
193
|
+
status: "no_permission",
|
|
194
|
+
fileType: "word-document",
|
|
195
|
+
id: "7"
|
|
196
|
+
}, {
|
|
197
|
+
type: "file",
|
|
198
|
+
name: "PDF_with_restricted_access_and_a_long_title_about_its_contents_and_privacy.pdf",
|
|
199
|
+
status: "no_permission",
|
|
200
|
+
fileType: "pdf",
|
|
201
|
+
id: "8"
|
|
202
|
+
}, {
|
|
203
|
+
type: "file",
|
|
204
|
+
name: "Image_with_a_restricted_access_and_a_lengthy_name_describing_its_context.jpg",
|
|
205
|
+
status: "no_permission",
|
|
206
|
+
fileType: "image",
|
|
207
|
+
id: "9"
|
|
208
|
+
}];
|
|
84
209
|
export {
|
|
85
|
-
|
|
210
|
+
m as mockAgentState,
|
|
86
211
|
d as mockAgents,
|
|
87
|
-
|
|
212
|
+
c as mockItemsAllTypes,
|
|
213
|
+
_ as mockItemsWithLongNames,
|
|
214
|
+
u as mockQuestions
|
|
88
215
|
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import "../../../../styles/items-dropdown.css";
|
|
2
|
+
import { DropdownMenu as m, Link as u, Text as f } from "@box/blueprint-web";
|
|
3
|
+
import { Size5 as h } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
+
import { ItemIcon as I } from "@box/item-icon";
|
|
5
|
+
import _ from "lodash/throttle";
|
|
6
|
+
import { useState as N, useCallback as d, useEffect as T } from "react";
|
|
7
|
+
import { useIntl as L } from "react-intl";
|
|
8
|
+
import M from "./messages.js";
|
|
9
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
10
|
+
const k = "_itemsDropdownTriggerLink_c19hd_1", x = "_itemsDropdownContent_c19hd_6", C = "_itemsDropdownItemIcon_c19hd_11", y = "_itemsDropdownItemName_c19hd_15", o = {
|
|
11
|
+
itemsDropdownTriggerLink: k,
|
|
12
|
+
itemsDropdownContent: x,
|
|
13
|
+
itemsDropdownItemIcon: C,
|
|
14
|
+
itemsDropdownItemName: y
|
|
15
|
+
}, H = ({
|
|
16
|
+
items: a,
|
|
17
|
+
onItemClick: s
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
formatMessage: c
|
|
21
|
+
} = L(), [l, w] = N(!1), D = d(({
|
|
22
|
+
id: e,
|
|
23
|
+
name: g
|
|
24
|
+
}) => {
|
|
25
|
+
s == null || s(e, g);
|
|
26
|
+
}, [s]), n = d(_((e) => {
|
|
27
|
+
w(e);
|
|
28
|
+
}, 100, {
|
|
29
|
+
leading: !0,
|
|
30
|
+
trailing: !1
|
|
31
|
+
}), []), r = () => {
|
|
32
|
+
n(!0);
|
|
33
|
+
}, i = () => {
|
|
34
|
+
n(!1);
|
|
35
|
+
};
|
|
36
|
+
return T(() => () => {
|
|
37
|
+
n.cancel();
|
|
38
|
+
}, [n]), /* @__PURE__ */ p(m.Root, {
|
|
39
|
+
onOpenChange: n,
|
|
40
|
+
open: l,
|
|
41
|
+
children: [/* @__PURE__ */ t(m.Trigger, {
|
|
42
|
+
className: o.itemsDropdownTrigger,
|
|
43
|
+
children: /* @__PURE__ */ t(u, {
|
|
44
|
+
className: o.itemsDropdownTriggerLink,
|
|
45
|
+
href: "#",
|
|
46
|
+
onBlur: i,
|
|
47
|
+
onFocus: r,
|
|
48
|
+
onMouseEnter: r,
|
|
49
|
+
onMouseLeave: i,
|
|
50
|
+
children: c(M.welcomeMessageFilesLink, {
|
|
51
|
+
numberOfItems: a.length
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}), /* @__PURE__ */ t(m.Content, {
|
|
55
|
+
align: "start",
|
|
56
|
+
className: o.itemsDropdownContent,
|
|
57
|
+
"data-testid": "content-answers-items-dropdown-content",
|
|
58
|
+
onFocus: r,
|
|
59
|
+
onMouseEnter: r,
|
|
60
|
+
onMouseLeave: i,
|
|
61
|
+
children: a.map((e) => /* @__PURE__ */ p(m.Item, {
|
|
62
|
+
className: o.itemsDropdownItem,
|
|
63
|
+
onClick: () => {
|
|
64
|
+
D(e);
|
|
65
|
+
},
|
|
66
|
+
children: [/* @__PURE__ */ t(I, {
|
|
67
|
+
ariaHidden: !0,
|
|
68
|
+
className: o.itemsDropdownItemIcon,
|
|
69
|
+
dimension: h,
|
|
70
|
+
iconType: e.fileType
|
|
71
|
+
}), /* @__PURE__ */ t(f, {
|
|
72
|
+
as: "span",
|
|
73
|
+
className: o.itemsDropdownItemName,
|
|
74
|
+
children: e.name
|
|
75
|
+
})]
|
|
76
|
+
}, e.id))
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
H as ItemsDropdown,
|
|
82
|
+
H as default
|
|
83
|
+
};
|
|
@@ -4,6 +4,10 @@ const t = e({
|
|
|
4
4
|
id: "boxAI.contentAnswers.welcomeAskQuestionText",
|
|
5
5
|
defaultMessage: "Ask questions about {name}"
|
|
6
6
|
},
|
|
7
|
+
welcomeMessageFilesLink: {
|
|
8
|
+
id: "boxAI.contentAnswers.welcomeMessageFilesLink",
|
|
9
|
+
defaultMessage: "{numberOfItems} files"
|
|
10
|
+
},
|
|
7
11
|
welcomeClearChatText: {
|
|
8
12
|
id: "boxAI.contentAnswers.welcomeClearChatText",
|
|
9
13
|
defaultMessage: "This chat will be cleared when you close this {type}"
|
package/i18n/bn-IN.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "ব্যবহারকারীর অবতার",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "{name} সম্পর্কে প্রশ্ন করুন",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "আপনি যখন এই {type}-টি বন্ধ করবেন, তখন এই চ্যাটটি মুছে দেওয়া হবে",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Box AI-এ স্বাগত",
|
|
52
53
|
"boxAI.popup.closeButtonText": "বন্ধ করুন",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "অনুলিপি হয়েছে"
|
package/i18n/da-DK.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Brugeravatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Stil spørgsmål om {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Denne chat vil blive ryddet, når du lukker dette {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Velkommen til Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Luk",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopieret"
|
package/i18n/de-DE.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Benutzeravatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Fragen zu {name} stellen",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Dieser Chat wird gelöscht, wenn Sie diese(s) {type} schließen",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Willkommen bei Box AI!",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Schließen",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopiert"
|
package/i18n/en-AU.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "User avatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Ask questions about {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "This chat will be cleared when you close this {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Welcome to Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Close",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copied"
|
package/i18n/en-CA.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "User avatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Ask questions about {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "This chat will be cleared when you close this {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Welcome to Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Close",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copied"
|
package/i18n/en-GB.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "User avatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Ask questions about {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "This chat will be cleared when you close this {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Welcome to Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Close",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copied"
|
package/i18n/en-US.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "User avatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Ask questions about {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "This chat will be cleared when you close this {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Welcome to Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Close",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copied"
|
package/i18n/en-US.properties
CHANGED
|
@@ -96,6 +96,8 @@ boxAI.contentAnswers.userAvatar = User avatar
|
|
|
96
96
|
boxAI.contentAnswers.welcomeAskQuestionText = Ask questions about {name}
|
|
97
97
|
# Content Answers welcome message for clearing the chat. {type} is the type of content that we are going to query
|
|
98
98
|
boxAI.contentAnswers.welcomeClearChatText = This chat will be cleared when you close this {type}
|
|
99
|
+
# Link that show the number of files that are going to be displayed within the modal
|
|
100
|
+
boxAI.contentAnswers.welcomeMessageFilesLink = {numberOfItems} files
|
|
99
101
|
# Content Answers welcome message title
|
|
100
102
|
boxAI.contentAnswers.welcomeMessageTitle = Welcome to Box AI
|
|
101
103
|
# Text for close button in popup
|
package/i18n/en-x-pseudo.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "⟦萬萬萬 Ûѕεř ǻνąŧàя 國國國⟧",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "⟦萬萬萬萬萬萬萬 Ǻśĸ qüęŝťįοňѕ āьöμŧ {name} 國國國國國國國⟧",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 Τħíş ĉнäţ ωίļĺ вė сľєǻгёď шħей γőū čļøŝé ţнίś {type} 國國國國國國國國國國國國國國國⟧",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "⟦萬萬萬萬萬 Ẁěļсõmĕ ţò ßó× ÃĪ 國國國國國⟧",
|
|
52
53
|
"boxAI.popup.closeButtonText": "⟦萬 Ćľóśё 國⟧",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "⟦萬 ĆόΡіёď 國⟧"
|
package/i18n/es-419.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Avatar del usuario",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Haz preguntas sobre {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Este chat se borrará cuando cierre este {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "¡Te damos la bienvenida a Box AI!",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Cerrar",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copiado"
|
package/i18n/es-ES.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Avatar del usuario",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Haz preguntas sobre {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Este chat se borrará cuando cierre este {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "¡Te damos la bienvenida a Box AI!",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Cerrar",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copiado"
|
package/i18n/fi-FI.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Käyttäjän avatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Kysy aiheesta {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Keskustelu poistetaan, kun suljet kohteen {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Tervetuloa Box AI -palveluun",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Sulje",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopioitu"
|
package/i18n/fr-CA.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Avatar de l'utilisateur",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Poser des questions sur {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Ce chat sera effacé lorsque vous fermerez ce {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Bienvenue dans Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Fermer",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copié"
|
package/i18n/fr-FR.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Avatar de l'utilisateur",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Poser des questions sur {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Ce chat sera effacé lorsque vous fermerez ce {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Bienvenue dans Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Fermer",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copié"
|
package/i18n/hi-IN.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "उपयोगकर्ता अवतार",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "{name} से जुड़े सवाल पूछें",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "जब आप यह {type} बंद करेंगे तब यह चैट साफ हो जाएगा",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Box AI में आपका स्वागत है",
|
|
52
53
|
"boxAI.popup.closeButtonText": "बंद करें",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "कॉपी की गई"
|
package/i18n/it-IT.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Avatar utente",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Fai domande su {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Chiudendo {type}, questa chat verrà eliminata",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Ti diamo il benvenuto in Box AI!",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Chiudi",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copia eseguita"
|
package/i18n/ja-JP.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "ユーザーのアバター",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "{name}について質問してください",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "この{type}を閉じるとチャットがクリアされます",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Box AIへようこそ",
|
|
52
53
|
"boxAI.popup.closeButtonText": "閉じる",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "コピー済み"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"boxAI.contentAnswers.welcomeAskQuestionText","description":"Content Answers welcome message for asking questions {Name} is the name of the content","defaultMessage":"Ask questions about {name}"},{"id":"boxAI.contentAnswers.welcomeClearChatText","description":"Content Answers welcome message for clearing the chat. {type} is the type of content that we are going to query","defaultMessage":"This chat will be cleared when you close this {type}"},{"id":"boxAI.contentAnswers.welcomeMessageTitle","description":"Content Answers welcome message title","defaultMessage":"Welcome to Box AI"}]
|
|
1
|
+
[{"id":"boxAI.contentAnswers.welcomeAskQuestionText","description":"Content Answers welcome message for asking questions {Name} is the name of the content","defaultMessage":"Ask questions about {name}"},{"id":"boxAI.contentAnswers.welcomeMessageFilesLink","description":"Link that show the number of files that are going to be displayed within the modal","defaultMessage":"{numberOfItems} files"},{"id":"boxAI.contentAnswers.welcomeClearChatText","description":"Content Answers welcome message for clearing the chat. {type} is the type of content that we are going to query","defaultMessage":"This chat will be cleared when you close this {type}"},{"id":"boxAI.contentAnswers.welcomeMessageTitle","description":"Content Answers welcome message title","defaultMessage":"Welcome to Box AI"}]
|
package/i18n/ko-KR.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "사용자 아바타",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "{name}에 대해 질문하기",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "이 {type}를 닫으면 이 대화는 삭제됩니다",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Box AI에 오신 것을 환영합니다!",
|
|
52
53
|
"boxAI.popup.closeButtonText": "닫기",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "복사함"
|
package/i18n/nb-NO.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Brukeravatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Still spørsmål om {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Denne chatten tømmes når du lukker {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Velkommen til Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Lukk",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopiert"
|
package/i18n/nl-NL.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Avatar van de gebruiker",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Stel vragen over {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Deze chat wordt gewist wanneer u dit {type} sluit",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Welkom bij Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Sluiten",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Gekopieerd"
|
package/i18n/pl-PL.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Awatar użytkownika",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Zadaj pytania dotyczące {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Ten czat zostanie skasowany po zamknięciu tego {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Witamy w usłudze Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Zamknij",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Skopiowano"
|
package/i18n/pt-BR.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Avatar do usuário",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Faça perguntas sobre {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Este bate-papo será apagado quando você fechar este {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Bem-vindo(a) ao Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Fechar",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Copiado"
|
package/i18n/ru-RU.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Аватар пользователя",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Задавайте вопросы о {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Данные этого чата будут очищены после закрытия следующего типа контента: {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Добро пожаловать в ИИ Box",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Закрыть",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Скопировано"
|
package/i18n/sv-SE.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Användaravatar",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "Ställ frågor om {name}",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Chatten rensas när du stänger detta {type}",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Välkommen till Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Stäng",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopierad"
|
package/i18n/tr-TR.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "Kullanıcı avatarı",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "{name} hakkında soru sorun",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "Bu {type} türünü kapattığınızda sohbet silinecektir",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "Box AI'ye hoş geldiniz!",
|
|
52
53
|
"boxAI.popup.closeButtonText": "Kapat",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "Kopyalandı"
|
package/i18n/zh-CN.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "用户头像",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "询问关于 {name} 的问题",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "您关闭 {type} 时,此对话框将被清理",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "欢迎使用 Box AI!",
|
|
52
53
|
"boxAI.popup.closeButtonText": "关闭",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "已复制"
|
package/i18n/zh-TW.js
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
"boxAI.contentAnswers.userAvatar": "使用者頭像",
|
|
49
49
|
"boxAI.contentAnswers.welcomeAskQuestionText": "提出有關{name}的問題",
|
|
50
50
|
"boxAI.contentAnswers.welcomeClearChatText": "關閉此{type}後會清除此聊天",
|
|
51
|
+
"boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems} files",
|
|
51
52
|
"boxAI.contentAnswers.welcomeMessageTitle": "歡迎使用 Box AI",
|
|
52
53
|
"boxAI.popup.closeButtonText": "關閉",
|
|
53
54
|
"boxAI.textInputWithCopyButton.copyButtonSuccessText": "已複製"
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.16.0",
|
|
7
7
|
"@box/box-ai-agent-selector": "^0.15.2",
|
|
8
|
+
"@box/item-icon": "^0.9.44",
|
|
8
9
|
"highlight.js": "^11.9.0",
|
|
9
10
|
"immutable": "^4.0.0",
|
|
10
11
|
"lodash": "^4.17.15",
|
|
@@ -14,9 +15,10 @@
|
|
|
14
15
|
"remarkable": "^2.0.1"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
|
-
"@box/blueprint-web": "^9.6.
|
|
18
|
+
"@box/blueprint-web": "^9.6.2",
|
|
18
19
|
"@box/blueprint-web-assets": "^4.31.0",
|
|
19
|
-
"@box/box-ai-agent-selector": "^0.18.
|
|
20
|
+
"@box/box-ai-agent-selector": "^0.18.6",
|
|
21
|
+
"@box/item-icon": "^0.9.44",
|
|
20
22
|
"@box/storybook-utils": "^0.8.0",
|
|
21
23
|
"@testing-library/react": "^15.0.6",
|
|
22
24
|
"react": "^18.3.0",
|
|
@@ -54,5 +56,5 @@
|
|
|
54
56
|
"**/*.css"
|
|
55
57
|
],
|
|
56
58
|
"license": "SEE LICENSE IN LICENSE",
|
|
57
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "f11cf55d3b28b3dd68b08ce96010da512a74c050"
|
|
58
60
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._itemsDropdownTriggerLink_c19hd_1{display:inline;cursor:pointer}._itemsDropdownContent_c19hd_6{--blueprint-web-dropdown-content-max-width: 14.875rem;--blueprint-web-dropdown-menu-max-height: 12.5rem}._itemsDropdownItemIcon_c19hd_11{vertical-align:middle}._itemsDropdownItemName_c19hd_15{margin-left:.5rem;line-height:1.5rem;vertical-align:middle}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type AgentType, type
|
|
2
|
+
import { type AgentType, type ContentProps, type ItemClickHandler, type RetryQuestion, type StopQuestion, type StyleVariant, type SubmitQuestion } from './types';
|
|
3
3
|
export type BoxAiContentAnswersProps = Omit<ContentProps, 'isErrorMessageShown' | 'setIsErrorMessageShown' | 'askSuggestedQuestion' | 'setAskSuggestedQuestion'> & {
|
|
4
4
|
/** Flag to indicate if the host application has custom suggested questions */
|
|
5
5
|
hasCustomSuggestedQuestions?: boolean;
|
|
@@ -13,7 +13,7 @@ export type BoxAiContentAnswersProps = Omit<ContentProps, 'isErrorMessageShown'
|
|
|
13
13
|
/** Callback function when the agent editor is toggled */
|
|
14
14
|
onAgentEditorToggle?: (agent: AgentType) => void;
|
|
15
15
|
/** Callback function when citation button is clicked */
|
|
16
|
-
onCitationClick?:
|
|
16
|
+
onCitationClick?: ItemClickHandler;
|
|
17
17
|
/** Callback function when the user clicks on the answer copy button */
|
|
18
18
|
onAnswerCopy?: (answer: string) => void;
|
|
19
19
|
variant?: StyleVariant;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ANSWER_ERROR, type
|
|
2
|
+
import { ANSWER_ERROR, type CitationType, type ItemClickHandler, type RecordActionType, type StyleVariant } from '../../types';
|
|
3
3
|
export interface AnswerProps {
|
|
4
4
|
answer?: string;
|
|
5
5
|
/** Citations list */
|
|
@@ -17,7 +17,7 @@ export interface AnswerProps {
|
|
|
17
17
|
/** Whether the answer supports markdown */
|
|
18
18
|
isMarkdownEnabled?: boolean;
|
|
19
19
|
/** Callback function when citation button is clicked */
|
|
20
|
-
onCitationClick?:
|
|
20
|
+
onCitationClick?: ItemClickHandler;
|
|
21
21
|
/** Callback function when the user clicks on the answer copy button */
|
|
22
22
|
onAnswerCopy?: (answer: string) => void;
|
|
23
23
|
/** Callback function to handle logging events */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CitationResponseRecordType, type RecordActionType } from '../../types';
|
|
1
|
+
import { type CitationResponseRecordType, type ItemClickHandler, type RecordActionType } from '../../types';
|
|
2
2
|
export interface CitationProps {
|
|
3
3
|
/** Whether or not to animate the citation while appearing */
|
|
4
4
|
animate: boolean;
|
|
@@ -9,7 +9,7 @@ export interface CitationProps {
|
|
|
9
9
|
/** Citation id */
|
|
10
10
|
id: number;
|
|
11
11
|
/** Callback function when citation button is clicked */
|
|
12
|
-
onCitationClick?:
|
|
12
|
+
onCitationClick?: ItemClickHandler;
|
|
13
13
|
/** Callback function to handle logging events */
|
|
14
14
|
recordAction?: (params: RecordActionType) => void;
|
|
15
15
|
/** Citation title */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CitationType, type ItemClickHandler, type RecordActionType } from '../../types';
|
|
2
2
|
export interface ReferencesProps {
|
|
3
3
|
/** Whether or not to animate the citation while appearing */
|
|
4
4
|
animate?: boolean;
|
|
5
5
|
/** Citations list */
|
|
6
6
|
citations?: Array<CitationType>;
|
|
7
7
|
/** Callback function when citation button is clicked */
|
|
8
|
-
onCitationClick?:
|
|
8
|
+
onCitationClick?: ItemClickHandler;
|
|
9
9
|
/** Callback function to handle logging events */
|
|
10
10
|
recordAction?: (params: RecordActionType) => void;
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ANSWER_ERROR } from '../../types';
|
|
1
|
+
import { ANSWER_ERROR, type ItemType } from '../../types';
|
|
2
2
|
export declare const mockQuestions: ({
|
|
3
3
|
answer: string;
|
|
4
4
|
id: string;
|
|
@@ -25,3 +25,5 @@ export declare const mockAgentState: {
|
|
|
25
25
|
agents: import("../../types").AgentType[];
|
|
26
26
|
selectedAgent: import("../../types").AgentType;
|
|
27
27
|
};
|
|
28
|
+
export declare const mockItemsAllTypes: Array<ItemType>;
|
|
29
|
+
export declare const mockItemsWithLongNames: Array<ItemType>;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import { type WelcomeMessageProps } from '../../../types';
|
|
1
|
+
import { type ItemsDropdownProps, type WelcomeMessageProps } from '../../../types';
|
|
2
|
+
export declare const defaultItemsDropdownProps: {
|
|
3
|
+
items: import("../../../types").ItemType[];
|
|
4
|
+
onItemClick: (...args: any[]) => void;
|
|
5
|
+
};
|
|
2
6
|
export declare const DefaultWelcomeMessage: (props: WelcomeMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const DefaultItemsDropdown: (props: ItemsDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
package/types/lib/types.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export type RetryQuestion = (question: QuestionType, aiAgent?: unknown | undefin
|
|
|
25
25
|
export type StopQuestion = (question: QuestionType) => void;
|
|
26
26
|
export type SubmitQuestion = (question: QuestionType, aiAgent?: unknown | undefined) => void;
|
|
27
27
|
export type HandleScrollToBottomType = (behavior: string, streamingAnswer: boolean) => void;
|
|
28
|
+
export type ItemClickHandler = (fileId: CitationResponseRecordType, title: CitationResponseRecordType) => void;
|
|
28
29
|
export type WelcomeMessageProps = {
|
|
29
30
|
/** Content name used in the welcome message in Ask questions about {contentName} */
|
|
30
31
|
contentName: string;
|
|
@@ -79,7 +80,7 @@ export type ChatProps = WelcomeMessageProps & {
|
|
|
79
80
|
/** Whether to indicate if there is a request in progress like an answer being fetched or streamed */
|
|
80
81
|
hasRequestInProgress?: boolean;
|
|
81
82
|
/** Callback function when citation button is clicked */
|
|
82
|
-
onCitationClick?:
|
|
83
|
+
onCitationClick?: ItemClickHandler;
|
|
83
84
|
/** Callback function when the user clicks on the answer copy button */
|
|
84
85
|
onAnswerCopy?: (answer: string) => void;
|
|
85
86
|
variant?: StyleVariant;
|
|
@@ -134,6 +135,13 @@ export type QuestionType = {
|
|
|
134
135
|
citations?: CitationType[];
|
|
135
136
|
created_at?: string;
|
|
136
137
|
};
|
|
138
|
+
export type ItemType = {
|
|
139
|
+
id: string;
|
|
140
|
+
type: 'file' | 'hub' | 'folder' | 'collection';
|
|
141
|
+
fileType?: string;
|
|
142
|
+
name: string;
|
|
143
|
+
status: 'supported' | 'unsupported' | 'no_permission';
|
|
144
|
+
};
|
|
137
145
|
export type SuggestedQuestionType = {
|
|
138
146
|
label?: string;
|
|
139
147
|
prompt: string;
|
|
@@ -155,3 +163,7 @@ export type SuggestedQuestionsResponse = {
|
|
|
155
163
|
areSomeItemsNotFound: boolean;
|
|
156
164
|
suggestedPrompts: string[];
|
|
157
165
|
};
|
|
166
|
+
export type ItemsDropdownProps = {
|
|
167
|
+
items: Array<ItemType>;
|
|
168
|
+
onItemClick?: ItemClickHandler;
|
|
169
|
+
};
|