@box/box-ai-content-answers 0.147.1 → 0.148.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/dist/esm/lib/components/answer/answer.js +123 -117
- package/dist/esm/lib/components/answer/constants.js +3 -2
- package/dist/esm/lib/components/answer/feedback-tooltip.js +87 -64
- package/dist/esm/lib/components/answer/messages.js +4 -0
- package/dist/esm/lib/components/chat/chat.js +81 -79
- package/dist/esm/lib/components/common/markdown.js +339 -337
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +78 -77
- package/dist/i18n/en-x-pseudo.properties +77 -77
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/json/src/lib/components/answer/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/styles/feedback-tooltip.css +1 -1
- package/dist/types/lib/components/answer/answer.d.ts +2 -0
- package/dist/types/lib/components/answer/constants.d.ts +1 -0
- package/dist/types/lib/components/answer/messages.d.ts +5 -0
- package/dist/types/lib/components/answer/stories/shared.d.ts +58 -0
- package/dist/types/lib/components/chat/chat.d.ts +1 -1
- package/dist/types/lib/components/chat/stories/index.d.ts +1 -0
- package/dist/types/lib/stories/shared.d.ts +5 -0
- package/dist/types/lib/types.d.ts +2 -0
- package/package.json +6 -6
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { BoxAiLogo as
|
|
1
|
+
import { Text as K } from "@box/blueprint-web";
|
|
2
|
+
import { BoxAiLogo as U } from "@box/blueprint-web-assets/icons/Logo";
|
|
3
3
|
import { Size10 as d } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import { useIntl as
|
|
7
|
-
import { Answer as
|
|
8
|
-
import { MediaContainer as
|
|
9
|
-
import { Question as
|
|
10
|
-
import { SuggestedQuestions as
|
|
11
|
-
import
|
|
12
|
-
import { WelcomeMessage as
|
|
4
|
+
import V from "clsx";
|
|
5
|
+
import * as X from "react";
|
|
6
|
+
import { useIntl as Y } from "react-intl";
|
|
7
|
+
import { Answer as Z } from "../answer/answer.js";
|
|
8
|
+
import { MediaContainer as $ } from "../common/media-container.js";
|
|
9
|
+
import { Question as L } from "../question/question.js";
|
|
10
|
+
import { SuggestedQuestions as P } from "../suggested-questions/suggested-questions.js";
|
|
11
|
+
import S from "../welcome-message/messages.js";
|
|
12
|
+
import { WelcomeMessage as ee } from "../welcome-message/welcome-message.js";
|
|
13
13
|
import { jsx as e, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
-
import '../../../../styles/chat.css';const
|
|
15
|
-
chat:
|
|
16
|
-
clearChatText:
|
|
17
|
-
landingPage:
|
|
18
|
-
askQuestionText:
|
|
19
|
-
iconAvatar:
|
|
14
|
+
import '../../../../styles/chat.css';const te = "_chat_77vqr_1", oe = "_clearChatText_77vqr_1", ae = "_landingPage_77vqr_7", re = "_askQuestionText_77vqr_15", se = "_iconAvatar_77vqr_23", ie = "_sidebar_77vqr_39", a = {
|
|
15
|
+
chat: te,
|
|
16
|
+
clearChatText: oe,
|
|
17
|
+
landingPage: ae,
|
|
18
|
+
askQuestionText: re,
|
|
19
|
+
iconAvatar: se,
|
|
20
20
|
sidebar: ie
|
|
21
|
-
},
|
|
21
|
+
}, ve = ({
|
|
22
22
|
askSuggestedQuestion: f,
|
|
23
23
|
contentType: n,
|
|
24
24
|
hasCustomSuggestedQuestions: h,
|
|
@@ -26,118 +26,120 @@ import '../../../../styles/chat.css';const ee = "_chat_77vqr_1", te = "_clearCha
|
|
|
26
26
|
isCitationsEnabled: T,
|
|
27
27
|
isFeedbackEnabled: b,
|
|
28
28
|
isFeedbackFormEnabled: v,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
isInlineCitationsEnabled: C = !1,
|
|
30
|
+
isMarkdownEnabled: g,
|
|
31
|
+
isSessionLoading: k = !1,
|
|
32
|
+
onCitationClick: q,
|
|
33
|
+
onAnswerCopy: u,
|
|
34
|
+
onFeedbackFormSubmit: A,
|
|
35
|
+
onSuggestedQuestionInteraction: F,
|
|
36
|
+
questions: I,
|
|
36
37
|
recordAction: c,
|
|
37
|
-
setAnswerFeedback:
|
|
38
|
-
setAskSuggestedQuestion:
|
|
39
|
-
suggestedQuestions:
|
|
40
|
-
suggestedQuestionsRequestState:
|
|
41
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
38
|
+
setAnswerFeedback: N,
|
|
39
|
+
setAskSuggestedQuestion: l,
|
|
40
|
+
suggestedQuestions: m,
|
|
41
|
+
suggestedQuestionsRequestState: O,
|
|
42
|
+
shouldFeedbackFormIncludeFeedbackText: Q,
|
|
42
43
|
shouldShowLandingPage: o,
|
|
43
|
-
useAnimation:
|
|
44
|
+
useAnimation: j,
|
|
44
45
|
variant: t = "modal",
|
|
45
|
-
hostAppName:
|
|
46
|
-
welcomeMessageClearText:
|
|
46
|
+
hostAppName: y = "",
|
|
47
|
+
welcomeMessageClearText: M,
|
|
47
48
|
...p
|
|
48
49
|
}) => {
|
|
49
50
|
const {
|
|
50
|
-
formatMessage:
|
|
51
|
-
} =
|
|
52
|
-
|
|
51
|
+
formatMessage: w
|
|
52
|
+
} = Y(), [z, B] = X.useState(null), R = (r, s) => {
|
|
53
|
+
B(r ? s : null);
|
|
53
54
|
};
|
|
54
55
|
return /* @__PURE__ */ e("div", {
|
|
55
56
|
className: a.chat,
|
|
56
57
|
"data-testid": "content-answers-chat",
|
|
57
58
|
children: /* @__PURE__ */ _("div", {
|
|
58
|
-
className:
|
|
59
|
+
className: V({
|
|
59
60
|
[a.landingPage]: o,
|
|
60
61
|
[a.sidebar]: t === "sidebar"
|
|
61
62
|
}),
|
|
62
|
-
children: [o && /* @__PURE__ */ e(
|
|
63
|
+
children: [o && /* @__PURE__ */ e($.Figure, {
|
|
63
64
|
variant: t,
|
|
64
65
|
children: /* @__PURE__ */ e("div", {
|
|
65
66
|
className: a.iconAvatar,
|
|
66
|
-
children: /* @__PURE__ */ e(
|
|
67
|
+
children: /* @__PURE__ */ e(U, {
|
|
67
68
|
height: d,
|
|
68
69
|
role: "presentation",
|
|
69
70
|
width: d
|
|
70
71
|
})
|
|
71
72
|
})
|
|
72
|
-
}), /* @__PURE__ */ e(
|
|
73
|
+
}), /* @__PURE__ */ e(ee, {
|
|
73
74
|
contentType: "",
|
|
74
75
|
shouldShowLandingPage: o,
|
|
75
76
|
...p,
|
|
76
77
|
variant: t
|
|
77
|
-
}), o &&
|
|
78
|
+
}), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(P, {
|
|
78
79
|
askSuggestedQuestion: f,
|
|
79
80
|
hasCustomSuggestedQuestions: h,
|
|
80
81
|
isLoading: x,
|
|
81
|
-
onSuggestedQuestionInteraction:
|
|
82
|
+
onSuggestedQuestionInteraction: F,
|
|
82
83
|
recordAction: c,
|
|
83
|
-
setAskSuggestedQuestion:
|
|
84
|
-
suggestedQuestions:
|
|
85
|
-
suggestedQuestionsRequestState:
|
|
84
|
+
setAskSuggestedQuestion: l,
|
|
85
|
+
suggestedQuestions: m,
|
|
86
|
+
suggestedQuestionsRequestState: O,
|
|
86
87
|
variant: t
|
|
87
|
-
}), /* @__PURE__ */ e(
|
|
88
|
+
}), /* @__PURE__ */ e(K, {
|
|
88
89
|
as: "p",
|
|
89
90
|
className: a.clearChatText,
|
|
90
|
-
children:
|
|
91
|
+
children: M || w(S.welcomeClearChatText, {
|
|
91
92
|
type: n
|
|
92
93
|
})
|
|
93
94
|
}), !o && /* @__PURE__ */ e("ul", {
|
|
94
|
-
children:
|
|
95
|
+
children: I.map(({
|
|
95
96
|
answer: r,
|
|
96
|
-
citations:
|
|
97
|
-
id:
|
|
98
|
-
isCompleted:
|
|
99
|
-
isLoading:
|
|
100
|
-
error:
|
|
101
|
-
prompt:
|
|
102
|
-
promptType:
|
|
103
|
-
feedbackValue:
|
|
97
|
+
citations: s,
|
|
98
|
+
id: i,
|
|
99
|
+
isCompleted: W,
|
|
100
|
+
isLoading: D,
|
|
101
|
+
error: E,
|
|
102
|
+
prompt: G,
|
|
103
|
+
promptType: H,
|
|
104
|
+
feedbackValue: J
|
|
104
105
|
}) => /* @__PURE__ */ _("li", {
|
|
105
|
-
children: [/* @__PURE__ */ e(
|
|
106
|
-
prompt:
|
|
106
|
+
children: [/* @__PURE__ */ e(L, {
|
|
107
|
+
prompt: G,
|
|
107
108
|
variant: t
|
|
108
|
-
}), /* @__PURE__ */ e(
|
|
109
|
+
}), /* @__PURE__ */ e(Z, {
|
|
109
110
|
answer: r,
|
|
110
|
-
citations:
|
|
111
|
+
citations: s,
|
|
111
112
|
contentType: n,
|
|
112
|
-
error:
|
|
113
|
-
feedbackValue:
|
|
114
|
-
hostAppName:
|
|
113
|
+
error: E,
|
|
114
|
+
feedbackValue: J,
|
|
115
|
+
hostAppName: y,
|
|
115
116
|
isCitationsEnabled: T,
|
|
116
|
-
isCompleted:
|
|
117
|
+
isCompleted: W,
|
|
117
118
|
isFeedbackEnabled: b,
|
|
118
119
|
isFeedbackFormEnabled: v,
|
|
119
|
-
isFeedbackTooltipOpen:
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
isFeedbackTooltipOpen: z === i,
|
|
121
|
+
isInlineCitationsEnabled: C,
|
|
122
|
+
isLoading: D || k,
|
|
123
|
+
isMarkdownEnabled: g,
|
|
122
124
|
items: p.items,
|
|
123
|
-
onAnswerCopy:
|
|
124
|
-
onCitationClick:
|
|
125
|
-
onFeedbackFormSubmit:
|
|
126
|
-
onFeedbackTooltipOpenChange:
|
|
127
|
-
promptType:
|
|
128
|
-
questionId:
|
|
125
|
+
onAnswerCopy: u,
|
|
126
|
+
onCitationClick: q,
|
|
127
|
+
onFeedbackFormSubmit: A,
|
|
128
|
+
onFeedbackTooltipOpenChange: R,
|
|
129
|
+
promptType: H,
|
|
130
|
+
questionId: i,
|
|
129
131
|
recordAction: c,
|
|
130
|
-
setAnswerFeedback:
|
|
131
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
132
|
-
useAnimation:
|
|
132
|
+
setAnswerFeedback: N,
|
|
133
|
+
shouldFeedbackFormIncludeFeedbackText: Q,
|
|
134
|
+
useAnimation: j,
|
|
133
135
|
variant: t
|
|
134
136
|
})]
|
|
135
|
-
},
|
|
137
|
+
}, i))
|
|
136
138
|
})]
|
|
137
139
|
})
|
|
138
140
|
});
|
|
139
141
|
};
|
|
140
142
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
ve as Chat,
|
|
144
|
+
ve as default
|
|
143
145
|
};
|