@box/box-ai-content-answers 0.57.0 → 0.57.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.
@@ -5,71 +5,72 @@ import { AgentEditor as k } from "./components/agents/agent-editor.js";
5
5
  import { Content as C } from "./components/content/content.js";
6
6
  import { Footer as F } from "./components/footer/footer.js";
7
7
  import { jsx as n, jsxs as N } from "react/jsx-runtime";
8
- const y = "_container_hi5vt_1", B = "_contentAnswers_hi5vt_5", f = {
8
+ const y = "_container_hi5vt_1", B = "_contentAnswers_hi5vt_5", w = {
9
9
  container: y,
10
10
  contentAnswers: B
11
11
  }, O = ({
12
- className: p,
13
- contentType: r,
12
+ className: S,
13
+ contentType: u,
14
14
  error: t,
15
- hasRequestInProgress: a,
16
- isAgentSelectorEnabled: w,
17
- isDebugModeEnabled: h,
18
- isStreamingEnabled: b,
15
+ hasRequestInProgress: c,
16
+ isAgentSelectorEnabled: h,
17
+ isDebugModeEnabled: A,
18
+ isStreamingEnabled: o,
19
19
  userInfo: l,
20
- questions: o,
21
- recordAction: i,
22
- retryQuestion: A,
23
- showLoadingIndicator: u,
24
- stopQuestion: M,
25
- submitQuestion: Q,
26
- suggestedQuestions: _,
27
- useAnimation: x,
28
- onAgentEditorToggle: E,
29
- ...v
20
+ questions: i,
21
+ recordAction: r,
22
+ retryQuestion: M,
23
+ showLoadingIndicator: a,
24
+ stopQuestion: Q,
25
+ submitQuestion: _,
26
+ suggestedQuestions: x,
27
+ useAnimation: b,
28
+ onAgentEditorToggle: v,
29
+ ...D
30
30
  }) => {
31
- const [c, m] = s.useState(null), [g, d] = s.useState(t != null), [e, S] = s.useState(!1), D = !g && !u;
31
+ const [m, g] = s.useState(null), [f, d] = s.useState(t != null), [e, p] = s.useState(!1), E = !f && !a;
32
32
  return s.useEffect(() => {
33
33
  d(t != null);
34
34
  }, [t]), /* @__PURE__ */ n("div", {
35
- className: j(p, f.container),
35
+ className: j(S, w.container),
36
36
  children: /* @__PURE__ */ N("div", {
37
- className: f.contentAnswers,
37
+ className: w.contentAnswers,
38
38
  children: [!e && /* @__PURE__ */ n(C, {
39
- ...v,
40
- askSuggestedQuestion: c,
41
- contentType: r,
39
+ ...D,
40
+ askSuggestedQuestion: m,
41
+ contentType: u,
42
42
  error: t,
43
- hasRequestInProgress: a,
44
- isErrorMessageShown: g,
45
- questions: o,
46
- recordAction: i,
47
- setAskSuggestedQuestion: m,
43
+ hasRequestInProgress: c,
44
+ isErrorMessageShown: f,
45
+ isStreamingEnabled: o,
46
+ questions: i,
47
+ recordAction: r,
48
+ setAskSuggestedQuestion: g,
48
49
  setIsErrorMessageShown: d,
49
- showLoadingIndicator: u,
50
- suggestedQuestions: _,
51
- useAnimation: x,
50
+ showLoadingIndicator: a,
51
+ suggestedQuestions: x,
52
+ useAnimation: o && b,
52
53
  userInfo: l
53
54
  }), e && /* @__PURE__ */ n(k, {
54
- onAgentEditorToggle: E,
55
- recordAction: i,
56
- setIsDebugModeShown: S
57
- }), D && /* @__PURE__ */ n(F, {
58
- askSuggestedQuestion: c,
59
- contentType: r,
60
- enableDebugMode: h,
61
- hasRequestInProgress: a,
62
- isAgentSelectorEnabled: w,
55
+ onAgentEditorToggle: v,
56
+ recordAction: r,
57
+ setIsDebugModeShown: p
58
+ }), E && /* @__PURE__ */ n(F, {
59
+ askSuggestedQuestion: m,
60
+ contentType: u,
61
+ enableDebugMode: A,
62
+ hasRequestInProgress: c,
63
+ isAgentSelectorEnabled: h,
63
64
  isDebugModeShown: e,
64
- isStreamingEnabled: b,
65
- lastQuestion: o[o.length - 1],
66
- onRetryQuestion: A,
67
- onStopQuestion: M,
68
- recordAction: i,
69
- sendQuestion: Q,
70
- setAskSuggestedQuestion: m,
65
+ isStreamingEnabled: o,
66
+ lastQuestion: i[i.length - 1],
67
+ onRetryQuestion: M,
68
+ onStopQuestion: Q,
69
+ recordAction: r,
70
+ sendQuestion: _,
71
+ setAskSuggestedQuestion: g,
71
72
  toggleDebugMode: () => {
72
- S(!e);
73
+ p(!e);
73
74
  },
74
75
  user: l
75
76
  })]
@@ -1,110 +1,103 @@
1
1
  import "../../../../styles/answer.css";
2
- import { useBreakpoint as g, Breakpoint as x, Text as T } from "@box/blueprint-web";
3
- import { BoxAi as L, AlertTriangle as C } from "@box/blueprint-web-assets/icons/Line";
4
- import { Size5 as D, Size6 as F, Gray65 as k, Size4 as S } from "@box/blueprint-web-assets/tokens/tokens";
5
- import y from "clsx";
6
- import * as l from "react";
7
- import { useIntl as z } from "react-intl";
8
- import { A as r } from "../../../../chunks/types.js";
9
- import { MediaContainer as p } from "../common/media-container.js";
10
- import { AnswerContent as M } from "./answer-content.js";
11
- import { CopyButton as G } from "./copy-button.js";
12
- import { InlineError as b } from "./inline-error.js";
13
- import { LoadingElement as j } from "./loading-element.js";
14
- import f from "./messages.js";
15
- import { References as B } from "./references.js";
16
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
17
- const U = "_answer_13vnd_9", W = "_alertIcon_13vnd_12", q = "_error_13vnd_15", H = "_footer_13vnd_19", J = "_animated_13vnd_24", K = "_heightExpand_13vnd_1", Q = "_iconAvatar_13vnd_28", o = {
18
- answer: U,
19
- alertIcon: W,
20
- error: q,
21
- footer: H,
22
- animated: J,
23
- heightExpand: K,
24
- iconAvatar: Q
25
- }, V = /* @__PURE__ */ new Set([r.RATE_LIMITING, r.NO_CONTENT, r.PRECONDITION_FAILED, r.GENERAL]), Ee = /* @__PURE__ */ l.memo(({
26
- answer: n,
27
- citations: I,
28
- error: e,
29
- contentType: N,
30
- handleScrollToBottom: a,
31
- isCitationsEnabled: R = !1,
32
- isCompleted: u = !1,
33
- isLoading: w = !1,
34
- isMarkdownEnabled: O = !1,
35
- isStreamingEnabled: i = !1,
36
- onCitationClick: P,
37
- recordAction: c,
38
- useAnimation: m = !0
2
+ import { useBreakpoint as v, Breakpoint as P, Text as T } from "@box/blueprint-web";
3
+ import { BoxAi as j, AlertTriangle as L } from "@box/blueprint-web-assets/icons/Line";
4
+ import { Size5 as x, Size6 as D, Gray65 as F, Size4 as f } from "@box/blueprint-web-assets/tokens/tokens";
5
+ import M from "clsx";
6
+ import * as m from "react";
7
+ import { useIntl as U } from "react-intl";
8
+ import { A as t } from "../../../../chunks/types.js";
9
+ import { MediaContainer as l } from "../common/media-container.js";
10
+ import { AnswerContent as k } from "./answer-content.js";
11
+ import { CopyButton as y } from "./copy-button.js";
12
+ import { InlineError as z } from "./inline-error.js";
13
+ import { LoadingElement as B } from "./loading-element.js";
14
+ import d from "./messages.js";
15
+ import { References as H } from "./references.js";
16
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
17
+ const C = "_answer_17ojr_1", G = "_alertIcon_17ojr_4", b = "_error_17ojr_7", W = "_footer_17ojr_11", q = "_shouldUseAnimation_17ojr_16", J = "_shouldAnimateHeight_17ojr_20", K = "_iconAvatar_17ojr_24", r = {
18
+ answer: C,
19
+ alertIcon: G,
20
+ error: b,
21
+ footer: W,
22
+ shouldUseAnimation: q,
23
+ shouldAnimateHeight: J,
24
+ iconAvatar: K
25
+ }, Q = /* @__PURE__ */ new Set([t.RATE_LIMITING, t.NO_CONTENT, t.PRECONDITION_FAILED, t.GENERAL]), po = /* @__PURE__ */ m.memo(({
26
+ answer: a,
27
+ citations: h,
28
+ error: o,
29
+ contentType: S,
30
+ isCitationsEnabled: u = !1,
31
+ isCompleted: s = !1,
32
+ isLoading: A = !1,
33
+ isMarkdownEnabled: I = !1,
34
+ onCitationClick: N,
35
+ recordAction: i,
36
+ useAnimation: R = !0
39
37
  }) => {
40
- const E = l.useRef(!0), _ = V.has(e), h = w && !n && !e, {
41
- formatMessage: d
42
- } = z(), v = g() === x.Small ? D : F;
43
- l.useEffect(() => {
44
- if (E.current) {
45
- E.current = !1;
46
- return;
47
- }
48
- n && a && a(i ? "instant" : "smooth", i);
49
- }, [n, a, i]);
50
- const A = () => /* @__PURE__ */ s(T, {
38
+ const E = Q.has(o), p = A && !a && !o, [w, g] = m.useState(s), {
39
+ formatMessage: c
40
+ } = U(), _ = v() === P.Small ? x : D;
41
+ m.useEffect(() => {
42
+ setTimeout(() => g(s), 0);
43
+ }, [s]);
44
+ const O = () => /* @__PURE__ */ n(T, {
51
45
  as: "p",
52
- className: o.error,
46
+ className: r.error,
53
47
  color: "textOnLightSecondary",
54
48
  "data-testid": "content-answers-error",
55
49
  variant: "caption",
56
- children: [e === r.RESPONSE_INTERRUPTED && d(f.responseInterruptedError), e === r.RESPONSE_FAILED && d(f.responseFailedError), e === r.RESPONSE_STOPPED && d(f.responseStoppedError), e !== r.RESPONSE_STOPPED && /* @__PURE__ */ t(C, {
57
- className: o.alertIcon,
58
- color: k,
50
+ children: [o === t.RESPONSE_INTERRUPTED && c(d.responseInterruptedError), o === t.RESPONSE_FAILED && c(d.responseFailedError), o === t.RESPONSE_STOPPED && c(d.responseStoppedError), o !== t.RESPONSE_STOPPED && /* @__PURE__ */ e(L, {
51
+ className: r.alertIcon,
52
+ color: F,
59
53
  "data-testid": "content-answers-error-alert-icon",
60
- height: S,
54
+ height: f,
61
55
  role: "presentation",
62
- width: S
56
+ width: f
63
57
  })]
64
58
  });
65
- return /* @__PURE__ */ s("div", {
59
+ return /* @__PURE__ */ n("div", {
66
60
  "aria-live": "polite",
67
- className: o.answer,
61
+ className: r.answer,
68
62
  "data-testid": "content-answers-answer",
69
- children: [!_ && !h && /* @__PURE__ */ s(p, {
70
- children: [/* @__PURE__ */ t(p.Figure, {
71
- children: /* @__PURE__ */ t("div", {
72
- className: o.iconAvatar,
73
- children: /* @__PURE__ */ t(L, {
74
- height: v,
63
+ children: [!E && !p && /* @__PURE__ */ n(l, {
64
+ children: [/* @__PURE__ */ e(l.Figure, {
65
+ children: /* @__PURE__ */ e("div", {
66
+ className: r.iconAvatar,
67
+ children: /* @__PURE__ */ e(j, {
68
+ height: _,
75
69
  role: "presentation",
76
- width: v
70
+ width: _
77
71
  })
78
72
  })
79
- }), /* @__PURE__ */ s(p.Content, {
80
- useAnimation: m,
81
- children: [/* @__PURE__ */ t(M, {
82
- answer: n,
83
- isMarkdownEnabled: O
84
- }), u && /* @__PURE__ */ s("div", {
85
- className: y(o.footer, {
86
- [o.animated]: m
73
+ }), /* @__PURE__ */ n(l.Content, {
74
+ children: [/* @__PURE__ */ e(k, {
75
+ answer: a,
76
+ isMarkdownEnabled: I
77
+ }), s && /* @__PURE__ */ n("div", {
78
+ className: M(r.footer, {
79
+ [r.shouldUseAnimation]: R,
80
+ [r.shouldAnimateHeight]: w
87
81
  }),
88
82
  "data-testid": "content-answers-answer-footer",
89
- children: [e && A(), R && !e && /* @__PURE__ */ t(B, {
90
- citations: I,
91
- onCitationClick: P,
92
- recordAction: c
93
- }), /* @__PURE__ */ t(G, {
94
- answer: n,
95
- recordAction: c
83
+ children: [o && O(), u && !o && /* @__PURE__ */ e(H, {
84
+ citations: h,
85
+ onCitationClick: N,
86
+ recordAction: i
87
+ }), /* @__PURE__ */ e(y, {
88
+ answer: a,
89
+ recordAction: i
96
90
  })]
97
91
  })]
98
92
  })]
99
- }), _ && /* @__PURE__ */ t(b, {
100
- contentType: N,
101
- error: e,
102
- recordAction: c,
103
- useAnimation: m
104
- }), h && /* @__PURE__ */ t(j, {})]
93
+ }), E && /* @__PURE__ */ e(z, {
94
+ contentType: S,
95
+ error: o,
96
+ recordAction: i
97
+ }), p && /* @__PURE__ */ e(B, {})]
105
98
  });
106
99
  });
107
100
  export {
108
- Ee as Answer,
109
- Ee as default
101
+ po as Answer,
102
+ po as default
110
103
  };
@@ -1,35 +1,34 @@
1
1
  import "../../../../styles/inline-error.css";
2
- import { useBreakpoint as _, Breakpoint as h, Text as u } from "@box/blueprint-web";
3
- import { BoxAi as x, AlertTriangle as N } from "@box/blueprint-web-assets/icons/Line";
4
- import { Size5 as a, Size6 as v } from "@box/blueprint-web-assets/tokens/tokens";
2
+ import { useBreakpoint as p, Breakpoint as _, Text as h } from "@box/blueprint-web";
3
+ import { BoxAi as u, AlertTriangle as x } from "@box/blueprint-web-assets/icons/Line";
4
+ import { Size5 as a, Size6 as N } from "@box/blueprint-web-assets/tokens/tokens";
5
5
  import * as d from "react";
6
- import { useIntl as g } from "react-intl";
6
+ import { useIntl as v } from "react-intl";
7
7
  import { A as s } from "../../../../chunks/types.js";
8
- import { LOGGER_BASE_CONFIG as A } from "../common/constants.js";
8
+ import { LOGGER_BASE_CONFIG as g } from "../common/constants.js";
9
9
  import { MediaContainer as l } from "../common/media-container.js";
10
10
  import t from "./messages.js";
11
11
  import { jsx as r, jsxs as f } from "react/jsx-runtime";
12
- const S = "_inlineError_ft07o_1", T = "_text_ft07o_4", I = "_icon_ft07o_14", R = "_iconAvatar_ft07o_18", i = {
13
- inlineError: S,
14
- text: T,
15
- icon: I,
16
- iconAvatar: R
17
- }, j = ({
12
+ const A = "_inlineError_ft07o_1", S = "_text_ft07o_4", T = "_icon_ft07o_14", I = "_iconAvatar_ft07o_18", i = {
13
+ inlineError: A,
14
+ text: S,
15
+ icon: T,
16
+ iconAvatar: I
17
+ }, z = ({
18
18
  error: n,
19
19
  contentType: c,
20
- recordAction: o,
21
- useAnimation: E
20
+ recordAction: o
22
21
  }) => {
23
22
  const {
24
23
  formatMessage: e
25
- } = g();
24
+ } = v();
26
25
  d.useEffect(() => {
27
26
  o && o({
28
- ...A,
27
+ ...g,
29
28
  target: "inlineError"
30
29
  });
31
30
  }, [o]);
32
- const p = d.useCallback(() => {
31
+ const E = d.useCallback(() => {
33
32
  switch (n) {
34
33
  case s.RATE_LIMITING:
35
34
  return e(t.inlineRateLimitingErrorText);
@@ -42,7 +41,7 @@ const S = "_inlineError_ft07o_1", T = "_text_ft07o_4", I = "_icon_ft07o_14", R =
42
41
  default:
43
42
  return e(t.inlineErrorText);
44
43
  }
45
- }, [c, n, e]), m = _() === h.Small ? a : v;
44
+ }, [c, n, e]), m = p() === _.Small ? a : N;
46
45
  return /* @__PURE__ */ r("div", {
47
46
  className: i.inlineError,
48
47
  "data-testid": "content-answers-inline-error",
@@ -51,7 +50,7 @@ const S = "_inlineError_ft07o_1", T = "_text_ft07o_4", I = "_icon_ft07o_14", R =
51
50
  variant: "center-aligned",
52
51
  children: /* @__PURE__ */ r("div", {
53
52
  className: i.iconAvatar,
54
- children: /* @__PURE__ */ r(x, {
53
+ children: /* @__PURE__ */ r(u, {
55
54
  height: m,
56
55
  role: "presentation",
57
56
  width: m
@@ -59,25 +58,24 @@ const S = "_inlineError_ft07o_1", T = "_text_ft07o_4", I = "_icon_ft07o_14", R =
59
58
  })
60
59
  }), /* @__PURE__ */ f(l.Content, {
61
60
  shouldAddCard: !1,
62
- useAnimation: E,
63
61
  variant: "error",
64
62
  children: [/* @__PURE__ */ r("div", {
65
63
  className: i.icon,
66
- children: /* @__PURE__ */ r(N, {
64
+ children: /* @__PURE__ */ r(x, {
67
65
  height: a,
68
66
  role: "presentation",
69
67
  width: a
70
68
  })
71
- }), /* @__PURE__ */ r(u, {
69
+ }), /* @__PURE__ */ r(h, {
72
70
  as: "p",
73
71
  className: i.text,
74
- children: n && p()
72
+ children: n && E()
75
73
  })]
76
74
  })]
77
75
  })
78
76
  });
79
77
  };
80
78
  export {
81
- j as InlineError,
82
- j as default
79
+ z as InlineError,
80
+ z as default
83
81
  };
@@ -1,37 +1,34 @@
1
1
  import "../../../../styles/loading-element.css";
2
- import { useBreakpoint as e, Breakpoint as l, LoadingIndicator as s } from "@box/blueprint-web";
3
- import { BoxAi as d } from "@box/blueprint-web-assets/icons/Line";
4
- import { Size5 as c, Size6 as m } from "@box/blueprint-web-assets/tokens/tokens";
5
- import { useIntl as p } from "react-intl";
2
+ import { useBreakpoint as t, Breakpoint as e, LoadingIndicator as l } from "@box/blueprint-web";
3
+ import { BoxAi as s } from "@box/blueprint-web-assets/icons/Line";
4
+ import { Size5 as d, Size6 as c } from "@box/blueprint-web-assets/tokens/tokens";
5
+ import { useIntl as m } from "react-intl";
6
6
  import { MediaContainer as o } from "../common/media-container.js";
7
- import g from "./messages.js";
8
- import { jsx as i, jsxs as f } from "react/jsx-runtime";
9
- const v = "_loadingElement_1pjir_1", _ = "_loadingIndicator_1pjir_1", h = "_iconAvatar_1pjir_5", n = {
10
- loadingElement: v,
11
- loadingIndicator: _,
12
- iconAvatar: h
13
- }, z = ({
14
- useAnimation: r
15
- }) => {
7
+ import p from "./messages.js";
8
+ import { jsx as i, jsxs as g } from "react/jsx-runtime";
9
+ const f = "_loadingElement_1pjir_1", v = "_loadingIndicator_1pjir_1", _ = "_iconAvatar_1pjir_5", n = {
10
+ loadingElement: f,
11
+ loadingIndicator: v,
12
+ iconAvatar: _
13
+ }, w = () => {
16
14
  const {
17
- formatMessage: t
18
- } = p(), a = e() === l.Small ? c : m;
15
+ formatMessage: r
16
+ } = m(), a = t() === e.Small ? d : c;
19
17
  return /* @__PURE__ */ i("div", {
20
18
  className: n.loadingElement,
21
- children: /* @__PURE__ */ f(o, {
19
+ children: /* @__PURE__ */ g(o, {
22
20
  children: [/* @__PURE__ */ i(o.Figure, {
23
21
  children: /* @__PURE__ */ i("div", {
24
22
  className: n.iconAvatar,
25
- children: /* @__PURE__ */ i(d, {
23
+ children: /* @__PURE__ */ i(s, {
26
24
  height: a,
27
25
  role: "presentation",
28
26
  width: a
29
27
  })
30
28
  })
31
29
  }), /* @__PURE__ */ i(o.Content, {
32
- useAnimation: r,
33
- children: /* @__PURE__ */ i(s, {
34
- "aria-label": t(g.loadingAnswer),
30
+ children: /* @__PURE__ */ i(l, {
31
+ "aria-label": r(p.loadingAnswer),
35
32
  className: n.loadingIndicator,
36
33
  "data-testid": "content-answers-loading-indicator"
37
34
  })
@@ -40,6 +37,6 @@ const v = "_loadingElement_1pjir_1", _ = "_loadingIndicator_1pjir_1", h = "_icon
40
37
  });
41
38
  };
42
39
  export {
43
- z as LoadingElement,
44
- z as default
40
+ w as LoadingElement,
41
+ w as default
45
42
  };
@@ -1,76 +1,67 @@
1
1
  import "../../../../styles/chat.css";
2
- import b from "lodash/throttle";
3
- import { useCallback as w } from "react";
4
- import { Answer as L } from "../answer/answer.js";
5
- import { Question as N } from "../question/question.js";
6
- import { SuggestedQuestions as W } from "../suggested-questions/suggested-questions.js";
7
- import { WelcomeMessage as k } from "../welcome-message/welcome-message.js";
8
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
9
- const q = "_chat_fj1ue_1", z = {
10
- chat: q
11
- }, M = ({
12
- askSuggestedQuestion: e,
13
- handleScrollToBottom: i,
14
- hasRequestInProgress: l,
15
- isCitationsEnabled: n,
2
+ import { Answer as w } from "../answer/answer.js";
3
+ import { Question as C } from "../question/question.js";
4
+ import { SuggestedQuestions as L } from "../suggested-questions/suggested-questions.js";
5
+ import { WelcomeMessage as N } from "../welcome-message/welcome-message.js";
6
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
7
+ const W = "_chat_fj1ue_1", b = {
8
+ chat: W
9
+ }, G = ({
10
+ askSuggestedQuestion: c,
11
+ hasRequestInProgress: e,
12
+ isCitationsEnabled: m,
16
13
  isMarkdownEnabled: s,
17
- isStreamingEnabled: h,
18
- onCitationClick: p,
19
- questions: d,
14
+ onCitationClick: h,
15
+ questions: p,
20
16
  recordAction: o,
21
17
  setAskSuggestedQuestion: r,
22
- suggestedQuestions: m,
23
- suggestedQuestionsRequestState: f,
24
- useAnimation: u,
25
- userInfo: T,
26
- ...a
27
- }) => {
28
- const j = w(b(i, 150), []);
29
- return /* @__PURE__ */ c("div", {
30
- className: z.chat,
31
- "data-testid": "content-answers-chat",
32
- children: [/* @__PURE__ */ t(k, {
33
- ...a
34
- }), m !== void 0 && r !== void 0 && /* @__PURE__ */ t(W, {
35
- askSuggestedQuestion: e,
36
- isLoading: l,
37
- recordAction: o,
38
- setAskSuggestedQuestion: r,
39
- suggestedQuestions: m,
40
- suggestedQuestionsRequestState: f
41
- }), /* @__PURE__ */ t("ul", {
42
- children: d.map(({
43
- answer: v,
44
- citations: x,
45
- id: y,
46
- isCompleted: _,
47
- isLoading: B,
48
- error: C,
49
- prompt: S
50
- }) => /* @__PURE__ */ c("li", {
51
- children: [/* @__PURE__ */ t(N, {
52
- prompt: S,
53
- userInfo: T
54
- }), /* @__PURE__ */ t(L, {
55
- answer: v,
56
- citations: x,
57
- contentType: a.contentType,
58
- error: C,
59
- handleScrollToBottom: j,
60
- isCitationsEnabled: n,
61
- isCompleted: _,
62
- isLoading: B,
63
- isMarkdownEnabled: s,
64
- isStreamingEnabled: h,
65
- onCitationClick: p,
66
- recordAction: o,
67
- useAnimation: u
68
- })]
69
- }, y))
70
- })]
71
- });
72
- };
18
+ suggestedQuestions: a,
19
+ suggestedQuestionsRequestState: d,
20
+ useAnimation: l,
21
+ userInfo: f,
22
+ ...i
23
+ }) => /* @__PURE__ */ n("div", {
24
+ className: b.chat,
25
+ "data-testid": "content-answers-chat",
26
+ children: [/* @__PURE__ */ t(N, {
27
+ ...i
28
+ }), a !== void 0 && r !== void 0 && /* @__PURE__ */ t(L, {
29
+ askSuggestedQuestion: c,
30
+ isLoading: e,
31
+ recordAction: o,
32
+ setAskSuggestedQuestion: r,
33
+ suggestedQuestions: a,
34
+ suggestedQuestionsRequestState: d
35
+ }), /* @__PURE__ */ t("ul", {
36
+ children: p.map(({
37
+ answer: j,
38
+ citations: u,
39
+ id: v,
40
+ isCompleted: x,
41
+ isLoading: y,
42
+ error: _,
43
+ prompt: T
44
+ }) => /* @__PURE__ */ n("li", {
45
+ children: [/* @__PURE__ */ t(C, {
46
+ prompt: T,
47
+ userInfo: f
48
+ }), /* @__PURE__ */ t(w, {
49
+ answer: j,
50
+ citations: u,
51
+ contentType: i.contentType,
52
+ error: _,
53
+ isCitationsEnabled: m,
54
+ isCompleted: x,
55
+ isLoading: y,
56
+ isMarkdownEnabled: s,
57
+ onCitationClick: h,
58
+ recordAction: o,
59
+ useAnimation: l
60
+ })]
61
+ }, v))
62
+ })]
63
+ });
73
64
  export {
74
- M as Chat,
75
- M as default
65
+ G as Chat,
66
+ G as default
76
67
  };
@@ -1,48 +1,42 @@
1
1
  import "../../../../styles/media-container.css";
2
2
  import { Card as s } from "@box/blueprint-web";
3
- import n from "clsx";
4
- import { jsx as r } from "react/jsx-runtime";
5
- const _ = "_mediaContainer_ydawk_9", c = "_question_ydawk_15", m = "_body_ydawk_18", u = "_animated_ydawk_25", y = "_heightExpand_ydawk_1", g = "_error_ydawk_29", l = "_figure_ydawk_42", e = {
6
- mediaContainer: _,
7
- question: c,
8
- body: m,
9
- animated: u,
10
- heightExpand: y,
11
- error: g,
12
- figure: l,
13
- "center-aligned": "_center-aligned_ydawk_49",
14
- "top-aligned": "_top-aligned_ydawk_53"
15
- }, p = ({
16
- children: a,
3
+ import o from "clsx";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ const d = "_mediaContainer_1x69w_1", _ = "_question_1x69w_7", c = "_body_1x69w_10", m = "_error_1x69w_17", u = "_figure_1x69w_30", r = {
6
+ mediaContainer: d,
7
+ question: _,
8
+ body: c,
9
+ error: m,
10
+ figure: u,
11
+ "center-aligned": "_center-aligned_1x69w_37",
12
+ "top-aligned": "_top-aligned_1x69w_41"
13
+ }, g = ({
14
+ children: e,
17
15
  className: t
18
- }) => /* @__PURE__ */ r("div", {
19
- className: n(e.mediaContainer, e[t]),
16
+ }) => /* @__PURE__ */ n("div", {
17
+ className: o(r.mediaContainer, r[t]),
20
18
  "data-testid": "content-answers-grid-card",
21
- children: a
22
- }), i = p;
19
+ children: e
20
+ }), i = g;
23
21
  i.Figure = ({
24
- children: a,
22
+ children: e,
25
23
  variant: t
26
- }) => /* @__PURE__ */ r("div", {
27
- className: n(e.figure, e[t]),
28
- children: a
24
+ }) => /* @__PURE__ */ n("div", {
25
+ className: o(r.figure, r[t]),
26
+ children: e
29
27
  });
30
28
  i.Content = ({
31
- children: a,
29
+ children: e,
32
30
  variant: t,
33
- shouldAddCard: d = !0,
34
- useAnimation: o = !0
35
- }) => /* @__PURE__ */ r("div", {
36
- className: n(e.body, e[t]),
37
- children: d ? /* @__PURE__ */ r(s, {
38
- className: n({
39
- [e.animated]: o
40
- }),
41
- children: a
42
- }) : a
31
+ shouldAddCard: a = !0
32
+ }) => /* @__PURE__ */ n("div", {
33
+ className: o(r.body, r[t]),
34
+ children: a ? /* @__PURE__ */ n(s, {
35
+ children: e
36
+ }) : e
43
37
  });
44
38
  export {
45
39
  i as MediaContainer,
46
- p as MediaContainerBase,
40
+ g as MediaContainerBase,
47
41
  i as default
48
42
  };
@@ -1,94 +1,110 @@
1
1
  import "../../../../styles/content.css";
2
- import { LoadingIndicator as v } from "@box/blueprint-web";
3
- import w from "clsx";
2
+ import { LoadingIndicator as M } from "@box/blueprint-web";
3
+ import j from "clsx";
4
4
  import * as t from "react";
5
- import { useIntl as M } from "react-intl";
6
- import j from "../../messages.js";
7
- import { Chat as k } from "../chat/chat.js";
8
- import { ModalError as H } from "../modal-error/modal-error.js";
5
+ import { useIntl as k } from "react-intl";
6
+ import y from "../../messages.js";
7
+ import { Chat as H } from "../chat/chat.js";
8
+ import { ModalError as O } from "../modal-error/modal-error.js";
9
9
  import { jsx as e, jsxs as T, Fragment as V } from "react/jsx-runtime";
10
- const y = "_loadingIndicatorWrapper_12a8t_1", z = "_content_12a8t_5", B = "_isLoading_12a8t_12", F = "_messagesEnd_12a8t_16", r = {
11
- loadingIndicatorWrapper: y,
12
- content: z,
13
- isLoading: B,
14
- messagesEnd: F
15
- }, Y = ({
16
- error: m,
17
- hasRequestInProgress: a = !1,
18
- isErrorMessageShown: u = !1,
19
- setIsErrorMessageShown: g,
20
- onModalClose: p,
21
- questions: _,
22
- recordAction: d,
23
- showLoadingIndicator: f = !1,
10
+ const B = "_loadingIndicatorWrapper_12a8t_1", F = "_content_12a8t_5", S = "_isLoading_12a8t_12", A = "_messagesEnd_12a8t_16", a = {
11
+ loadingIndicatorWrapper: B,
12
+ content: F,
13
+ isLoading: S,
14
+ messagesEnd: A
15
+ }, Z = ({
16
+ error: p,
17
+ hasRequestInProgress: c = !1,
18
+ isErrorMessageShown: g = !1,
19
+ isStreamingEnabled: l = !1,
20
+ setIsErrorMessageShown: _,
21
+ onModalClose: h,
22
+ questions: v,
23
+ recordAction: u,
24
+ showLoadingIndicator: m = !1,
24
25
  userInfo: E,
25
- suggestedQuestions: h,
26
- askSuggestedQuestion: I,
27
- setAskSuggestedQuestion: x,
28
- useAnimation: C,
26
+ suggestedQuestions: R,
27
+ askSuggestedQuestion: b,
28
+ setAskSuggestedQuestion: C,
29
+ useAnimation: I,
29
30
  ...L
30
31
  }) => {
31
- const o = t.useRef(null), s = t.useRef(null), l = t.useRef(null), {
32
- formatMessage: N
33
- } = M(), n = t.useCallback((c, i = !1) => {
34
- s.current && s.current.scrollIntoView && o.current && (!i || !l.current) && s.current.scrollIntoView({
35
- behavior: c,
32
+ const d = t.useRef(null), i = t.useRef(null), f = t.useRef(null), s = t.useRef(!0), {
33
+ formatMessage: w
34
+ } = k(), r = t.useCallback((n) => {
35
+ f.current && f.current.scrollIntoView && i.current && (!l || s.current) && f.current.scrollIntoView({
36
+ behavior: n,
36
37
  block: "nearest"
37
38
  });
38
- }, []), R = () => {
39
- if (o.current) {
39
+ }, [l]), x = () => {
40
+ if (i.current) {
40
41
  const {
41
- scrollTop: c,
42
- clientHeight: i,
42
+ scrollTop: n,
43
+ clientHeight: o,
43
44
  scrollHeight: W
44
- } = o.current, b = W - (c + i);
45
- l.current = b > 5;
45
+ } = i.current, z = W - (n + o);
46
+ if (c && z > 100) {
47
+ s.current = !1;
48
+ return;
49
+ }
50
+ s.current = !0;
46
51
  }
47
52
  };
48
53
  t.useEffect(() => {
49
- n("instant");
50
- }, [n]), t.useEffect(() => {
51
- a && (l.current = !1, n("instant"));
52
- }, [n, a]);
53
- const S = () => u ? /* @__PURE__ */ e(H, {
54
- clearError: () => g(!1),
55
- error: m,
56
- onModalClose: p,
57
- recordAction: d
58
- }) : f ? /* @__PURE__ */ e("div", {
59
- className: r.loadingIndicatorWrapper,
60
- children: /* @__PURE__ */ e(v, {
61
- "aria-label": N(j.loading),
62
- className: r.loadingIndicator,
54
+ c && (s.current = !0, r("instant"));
55
+ }, [r, c]), t.useEffect(() => {
56
+ s.current = !0, r("instant");
57
+ }, [r]), t.useLayoutEffect(() => {
58
+ if (!d.current)
59
+ return;
60
+ const n = new ResizeObserver(() => {
61
+ r(l ? "instant" : "smooth");
62
+ }), o = d.current;
63
+ return o && n.observe(o), () => {
64
+ o && n.unobserve(o);
65
+ };
66
+ }, [r, l]);
67
+ const N = () => g ? /* @__PURE__ */ e(O, {
68
+ clearError: () => _(!1),
69
+ error: p,
70
+ onModalClose: h,
71
+ recordAction: u
72
+ }) : m ? /* @__PURE__ */ e("div", {
73
+ className: a.loadingIndicatorWrapper,
74
+ children: /* @__PURE__ */ e(M, {
75
+ "aria-label": w(y.loading),
76
+ className: a.loadingIndicator,
63
77
  "data-testid": "content-answers-modal-loading-indicator",
64
78
  size: "large"
65
79
  })
66
80
  }) : /* @__PURE__ */ T(V, {
67
- children: [/* @__PURE__ */ e(k, {
68
- askSuggestedQuestion: I,
69
- handleScrollToBottom: n,
70
- hasRequestInProgress: a,
71
- questions: _,
72
- recordAction: d,
73
- setAskSuggestedQuestion: x,
74
- suggestedQuestions: h,
75
- useAnimation: C,
81
+ children: [/* @__PURE__ */ e(H, {
82
+ askSuggestedQuestion: b,
83
+ hasRequestInProgress: c,
84
+ questions: v,
85
+ recordAction: u,
86
+ setAskSuggestedQuestion: C,
87
+ suggestedQuestions: R,
88
+ useAnimation: I,
76
89
  userInfo: E,
77
90
  ...L
78
91
  }), /* @__PURE__ */ e("div", {
79
- ref: s,
80
- className: r.messagesEnd
92
+ ref: f,
93
+ className: a.messagesEnd
81
94
  })]
82
95
  });
83
96
  return /* @__PURE__ */ e("div", {
84
- ref: o,
85
- className: w(r.content, f ? r.isLoading : null),
97
+ ref: i,
98
+ className: j(a.content, m ? a.isLoading : null),
86
99
  "data-testid": "content-answers-content",
87
- onScroll: R,
88
- children: S()
100
+ onScroll: x,
101
+ children: /* @__PURE__ */ e("div", {
102
+ ref: d,
103
+ children: N()
104
+ })
89
105
  });
90
106
  };
91
107
  export {
92
- Y as Content,
93
- Y as default
108
+ Z as Content,
109
+ Z as default
94
110
  };
@@ -1,41 +1,39 @@
1
1
  import "../../../../styles/question.css";
2
- import { useBreakpoint as c, Avatar as d, Breakpoint as u, Text as p } from "@box/blueprint-web";
3
- import { useIntl as x } from "react-intl";
4
- import h from "../../messages.js";
2
+ import { useBreakpoint as m, Avatar as c, Breakpoint as d, Text as u } from "@box/blueprint-web";
3
+ import { useIntl as p } from "react-intl";
4
+ import x from "../../messages.js";
5
5
  import { MediaContainer as e } from "../common/media-container.js";
6
- import { jsx as t, jsxs as f } from "react/jsx-runtime";
7
- const v = "_question_1menh_1", q = "_text_1menh_5", s = {
8
- question: v,
9
- text: q
10
- }, j = ({
6
+ import { jsx as t, jsxs as h } from "react/jsx-runtime";
7
+ const f = "_question_1menh_1", v = "_text_1menh_5", s = {
8
+ question: f,
9
+ text: v
10
+ }, N = ({
11
11
  prompt: a,
12
- userInfo: o,
13
- useAnimation: n
12
+ userInfo: o
14
13
  }) => {
15
14
  const {
16
- avatarURL: r,
17
- name: i
18
- } = o, l = c(), {
19
- formatMessage: m
20
- } = x();
15
+ avatarURL: n,
16
+ name: r
17
+ } = o, i = m(), {
18
+ formatMessage: l
19
+ } = p();
21
20
  return /* @__PURE__ */ t("div", {
22
21
  className: s.question,
23
22
  "data-testid": "content-answers-question",
24
- children: /* @__PURE__ */ f(e, {
23
+ children: /* @__PURE__ */ h(e, {
25
24
  className: "question",
26
25
  children: [/* @__PURE__ */ t(e.Figure, {
27
26
  variant: "top-aligned",
28
- children: /* @__PURE__ */ t(d, {
29
- alt: m(h.userAvatar),
27
+ children: /* @__PURE__ */ t(c, {
28
+ alt: l(x.userAvatar),
30
29
  colorIndex: 0,
31
- size: l === u.Small ? "small" : "large",
32
- src: r || void 0,
33
- text: i.charAt(0)
30
+ size: i === d.Small ? "small" : "large",
31
+ src: n || void 0,
32
+ text: r.charAt(0)
34
33
  })
35
34
  }), /* @__PURE__ */ t(e.Content, {
36
35
  shouldAddCard: !1,
37
- useAnimation: n,
38
- children: /* @__PURE__ */ t(p, {
36
+ children: /* @__PURE__ */ t(u, {
39
37
  as: "span",
40
38
  className: s.text,
41
39
  children: a
@@ -45,6 +43,6 @@ const v = "_question_1menh_1", q = "_text_1menh_5", s = {
45
43
  });
46
44
  };
47
45
  export {
48
- j as Question,
49
- j as default
46
+ N as Question,
47
+ N as default
50
48
  };
@@ -1,28 +1,27 @@
1
1
  import "../../../../styles/welcome-message.css";
2
- import { InlineNotice as g, Text as a } from "@box/blueprint-web";
3
- import { BoxAi as w } from "@box/blueprint-web-assets/icons/Line";
2
+ import { InlineNotice as p, Text as a } from "@box/blueprint-web";
3
+ import { BoxAi as g } from "@box/blueprint-web-assets/icons/Line";
4
4
  import { Size6 as c } from "@box/blueprint-web-assets/tokens/tokens";
5
- import { useIntl as f } from "react-intl";
5
+ import { useIntl as w } from "react-intl";
6
6
  import { MediaContainer as n } from "../common/media-container.js";
7
7
  import i from "./messages.js";
8
8
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
9
- const _ = "_welcomeMessage_1px1f_1", T = "_askQuestionText_1px1f_4", u = "_clearChatText_1px1f_8", v = "_warningNotice_1px1f_12", N = "_iconAvatar_1px1f_15", t = {
10
- welcomeMessage: _,
11
- askQuestionText: T,
12
- clearChatText: u,
13
- warningNotice: v,
14
- iconAvatar: N
15
- }, j = ({
9
+ const f = "_welcomeMessage_1px1f_1", _ = "_askQuestionText_1px1f_4", T = "_clearChatText_1px1f_8", u = "_warningNotice_1px1f_12", v = "_iconAvatar_1px1f_15", t = {
10
+ welcomeMessage: f,
11
+ askQuestionText: _,
12
+ clearChatText: T,
13
+ warningNotice: u,
14
+ iconAvatar: v
15
+ }, I = ({
16
16
  contentName: l,
17
17
  contentType: m,
18
18
  warningNotice: r,
19
19
  warningNoticeAriaLabel: d,
20
- welcomeMessageClearText: h,
21
- useAnimation: x
20
+ welcomeMessageClearText: h
22
21
  }) => {
23
22
  const {
24
23
  formatMessage: s
25
- } = f(), p = r && /* @__PURE__ */ e(g, {
24
+ } = w(), x = r && /* @__PURE__ */ e(p, {
26
25
  className: t.warningNotice,
27
26
  "data-testid": "content-answers-warning-notice",
28
27
  variant: "warning",
@@ -40,15 +39,14 @@ const _ = "_welcomeMessage_1px1f_1", T = "_askQuestionText_1px1f_4", u = "_clear
40
39
  children: [/* @__PURE__ */ e(n.Figure, {
41
40
  children: /* @__PURE__ */ e("div", {
42
41
  className: t.iconAvatar,
43
- children: /* @__PURE__ */ e(w, {
42
+ children: /* @__PURE__ */ e(g, {
44
43
  height: c,
45
44
  role: "presentation",
46
45
  width: c
47
46
  })
48
47
  })
49
48
  }), /* @__PURE__ */ o(n.Content, {
50
- useAnimation: x,
51
- children: [p, /* @__PURE__ */ e(a, {
49
+ children: [x, /* @__PURE__ */ e(a, {
52
50
  as: "h1",
53
51
  className: t.title,
54
52
  variant: "titleSmall",
@@ -73,6 +71,6 @@ const _ = "_welcomeMessage_1px1f_1", T = "_askQuestionText_1px1f_4", u = "_clear
73
71
  });
74
72
  };
75
73
  export {
76
- j as WelcomeMessage,
77
- j as default
74
+ I as WelcomeMessage,
75
+ I as default
78
76
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "0.57.0",
3
+ "version": "0.57.2",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.16.0",
@@ -13,7 +13,7 @@
13
13
  "remarkable": "^2.0.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@box/blueprint-web": "^7.32.1",
16
+ "@box/blueprint-web": "^7.33.0",
17
17
  "@box/blueprint-web-assets": "^4.27.0",
18
18
  "@box/storybook-utils": "^0.6.1",
19
19
  "@testing-library/react": "^15.0.6",
@@ -52,5 +52,5 @@
52
52
  "**/*.css"
53
53
  ],
54
54
  "license": "SEE LICENSE IN LICENSE",
55
- "gitHead": "186037ff79d3ae07cc0cd07ff075e07fa916a0c1"
55
+ "gitHead": "655a58b8accd00ab49186551834a7a0c7b9237f4"
56
56
  }
package/styles/answer.css CHANGED
@@ -1 +1 @@
1
- @keyframes _heightExpand_13vnd_1{0%{max-height:0}to{max-height:5000px}}._answer_13vnd_9{white-space:pre-wrap}._answer_13vnd_9 ._alertIcon_13vnd_12{margin-left:.5rem}._answer_13vnd_9 ._error_13vnd_15{display:flex;align-items:center}._answer_13vnd_9 ._footer_13vnd_19{display:flex;justify-content:space-between;margin-top:.75rem}._answer_13vnd_9 ._footer_13vnd_19._animated_13vnd_24{overflow-y:hidden;animation:_heightExpand_13vnd_1 .4s ease-in-out}._answer_13vnd_9 ._iconAvatar_13vnd_28{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border-radius:50%}@media (max-width: 374px){._answer_13vnd_9 ._iconAvatar_13vnd_28{width:var(--size-6);height:var(--size-6)}}
1
+ ._answer_17ojr_1{white-space:pre-wrap}._answer_17ojr_1 ._alertIcon_17ojr_4{margin-left:.5rem}._answer_17ojr_1 ._error_17ojr_7{display:flex;align-items:center}._answer_17ojr_1 ._footer_17ojr_11{display:flex;justify-content:space-between;margin-top:.75rem}._answer_17ojr_1 ._footer_17ojr_11._shouldUseAnimation_17ojr_16{max-height:0;overflow-y:hidden}._answer_17ojr_1 ._footer_17ojr_11._shouldUseAnimation_17ojr_16._shouldAnimateHeight_17ojr_20{max-height:200px;transition:max-height 1s ease-in}._answer_17ojr_1 ._iconAvatar_17ojr_24{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border-radius:50%}@media (max-width: 374px){._answer_17ojr_1 ._iconAvatar_17ojr_24{width:var(--size-6);height:var(--size-6)}}
@@ -1 +1 @@
1
- @keyframes _heightExpand_ydawk_1{0%{max-height:0}to{max-height:5000px}}._mediaContainer_ydawk_9{margin-top:1rem;margin-bottom:1.5rem;align-items:flex-start;display:flex}._mediaContainer_ydawk_9._question_ydawk_15{align-items:center}._mediaContainer_ydawk_9 ._body_ydawk_18{word-wrap:break-word;flex:1 1 100%;min-width:0;overflow-wrap:break-word;word-break:break-word}._mediaContainer_ydawk_9 ._body_ydawk_18 ._animated_ydawk_25{overflow-y:hidden;animation:_heightExpand_ydawk_1 .4s ease-in-out}._mediaContainer_ydawk_9 ._body_ydawk_18._error_ydawk_29{display:flex;align-items:center;padding:.75rem 1rem;background-color:#fdebee;border:.125rem solid #f69bab;border-radius:.75rem}@media (max-width: 767px){._mediaContainer_ydawk_9 ._body_ydawk_18._error_ydawk_29{flex-wrap:wrap}}._mediaContainer_ydawk_9 ._figure_ydawk_42{align-self:flex-start;flex:0 0 auto;justify-self:flex-start;margin:.75rem .75rem 0 0;padding:0}._mediaContainer_ydawk_9 ._figure_ydawk_42._center-aligned_ydawk_49{align-self:center;margin:0 .75rem 0 0}._mediaContainer_ydawk_9 ._figure_ydawk_42._top-aligned_ydawk_53{align-self:top;margin:0 .75rem 0 0}
1
+ ._mediaContainer_1x69w_1{margin-top:1rem;margin-bottom:1.5rem;align-items:flex-start;display:flex}._mediaContainer_1x69w_1._question_1x69w_7{align-items:center}._mediaContainer_1x69w_1 ._body_1x69w_10{word-wrap:break-word;flex:1 1 100%;min-width:0;overflow-wrap:break-word;word-break:break-word}._mediaContainer_1x69w_1 ._body_1x69w_10._error_1x69w_17{display:flex;align-items:center;padding:.75rem 1rem;background-color:#fdebee;border:.125rem solid #f69bab;border-radius:.75rem}@media (max-width: 767px){._mediaContainer_1x69w_1 ._body_1x69w_10._error_1x69w_17{flex-wrap:wrap}}._mediaContainer_1x69w_1 ._figure_1x69w_30{align-self:flex-start;flex:0 0 auto;justify-self:flex-start;margin:.75rem .75rem 0 0;padding:0}._mediaContainer_1x69w_1 ._figure_1x69w_30._center-aligned_1x69w_37{align-self:center;margin:0 .75rem 0 0}._mediaContainer_1x69w_1 ._figure_1x69w_30._top-aligned_1x69w_41{align-self:top;margin:0 .75rem 0 0}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ANSWER_ERROR, type CitationResponseRecordType, type CitationType, type HandleScrollToBottomType, type RecordActionType } from '../../types';
2
+ import { ANSWER_ERROR, type CitationResponseRecordType, type CitationType, type RecordActionType } from '../../types';
3
3
  export interface AnswerProps {
4
4
  answer?: string;
5
5
  /** Citations list */
@@ -8,8 +8,6 @@ export interface AnswerProps {
8
8
  error?: ANSWER_ERROR;
9
9
  /** Content name used in some of the error messages */
10
10
  contentType: string;
11
- /** Callback function to handle the scroll bottom when an answer is updated */
12
- handleScrollToBottom?: HandleScrollToBottomType;
13
11
  /** Whether if the answer supports citations or not */
14
12
  isCitationsEnabled?: boolean;
15
13
  /** Whether if the answer finished loading (used to show the references and the copy button) */
@@ -18,8 +16,6 @@ export interface AnswerProps {
18
16
  isLoading?: boolean;
19
17
  /** Whether the answer supports markdown */
20
18
  isMarkdownEnabled?: boolean;
21
- /** Whether if the client supports streaming or not */
22
- isStreamingEnabled?: boolean;
23
19
  /** Callback function when citation button is clicked */
24
20
  onCitationClick?: (fileId: CitationResponseRecordType, title: CitationResponseRecordType) => void;
25
21
  /** Callback function to handle logging events */
@@ -3,7 +3,6 @@ export type InlineErrorProps = {
3
3
  error: string | null;
4
4
  contentType: string;
5
5
  recordAction?: (params: RecordActionType) => void;
6
- useAnimation?: boolean;
7
6
  };
8
- export declare const InlineError: ({ error, contentType, recordAction, useAnimation }: InlineErrorProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const InlineError: ({ error, contentType, recordAction }: InlineErrorProps) => import("react/jsx-runtime").JSX.Element;
9
8
  export default InlineError;
@@ -1,5 +1,2 @@
1
- export interface LoadingElementProps {
2
- useAnimation?: boolean;
3
- }
4
- export declare const LoadingElement: ({ useAnimation }: LoadingElementProps) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const LoadingElement: () => import("react/jsx-runtime").JSX.Element;
5
2
  export default LoadingElement;
@@ -1,3 +1,3 @@
1
1
  import { type ChatProps } from '../../types';
2
- export declare const Chat: ({ askSuggestedQuestion, handleScrollToBottom, hasRequestInProgress, isCitationsEnabled, isMarkdownEnabled, isStreamingEnabled, onCitationClick, questions, recordAction, setAskSuggestedQuestion, suggestedQuestions, suggestedQuestionsRequestState, useAnimation, userInfo, ...welcomeMessageProps }: ChatProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Chat: ({ askSuggestedQuestion, hasRequestInProgress, isCitationsEnabled, isMarkdownEnabled, onCitationClick, questions, recordAction, setAskSuggestedQuestion, suggestedQuestions, suggestedQuestionsRequestState, useAnimation, userInfo, ...welcomeMessageProps }: ChatProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Chat;
@@ -11,7 +11,6 @@ type ContentProps = {
11
11
  children?: React.ReactNode;
12
12
  variant?: string;
13
13
  shouldAddCard?: boolean;
14
- useAnimation?: boolean;
15
14
  };
16
15
  export declare const MediaContainerBase: React.FC<Props>;
17
16
  export declare const MediaContainer: React.FC<Props> & {
@@ -1,4 +1,4 @@
1
1
  import { type ContentProps } from '../../types';
2
- export declare const Content: ({ error, hasRequestInProgress, isErrorMessageShown, setIsErrorMessageShown, onModalClose, questions, recordAction, showLoadingIndicator, userInfo, suggestedQuestions, askSuggestedQuestion, setAskSuggestedQuestion, useAnimation, ...rest }: ContentProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Content: ({ error, hasRequestInProgress, isErrorMessageShown, isStreamingEnabled, setIsErrorMessageShown, onModalClose, questions, recordAction, showLoadingIndicator, userInfo, suggestedQuestions, askSuggestedQuestion, setAskSuggestedQuestion, useAnimation, ...rest }: ContentProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export { type ContentProps };
4
4
  export default Content;
@@ -4,8 +4,6 @@ export interface QuestionProps {
4
4
  prompt?: string;
5
5
  /** User information consisting on their name and an optional avatar */
6
6
  userInfo: UserInfoType;
7
- /** If keyframe animation should be applied to chat elements; defaults to true */
8
- useAnimation?: boolean;
9
7
  }
10
- export declare const Question: ({ prompt, userInfo, useAnimation }: QuestionProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Question: ({ prompt, userInfo }: QuestionProps) => import("react/jsx-runtime").JSX.Element;
11
9
  export default Question;
@@ -1,3 +1,3 @@
1
1
  import { type WelcomeMessageProps } from '../../types';
2
- export declare const WelcomeMessage: ({ contentName, contentType, warningNotice, warningNoticeAriaLabel, welcomeMessageClearText, useAnimation, }: WelcomeMessageProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const WelcomeMessage: ({ contentName, contentType, warningNotice, warningNoticeAriaLabel, welcomeMessageClearText, }: WelcomeMessageProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default WelcomeMessage;
@@ -47,8 +47,6 @@ export type ChatProps = WelcomeMessageProps & {
47
47
  isDebugModeEnabled?: boolean;
48
48
  /** Whether if the client supports streaming or not */
49
49
  isStreamingEnabled?: boolean;
50
- /** Callback function to handle the scroll bottom when an answer is updated */
51
- handleScrollToBottom: HandleScrollToBottomType;
52
50
  /** Question list */
53
51
  questions: QuestionType[];
54
52
  /** Callback function to handle logging events */