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