@box/box-ai-content-answers 0.87.4 → 0.88.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 (92) hide show
  1. package/esm/lib/box-ai-content-answers.js +57 -60
  2. package/esm/lib/components/agents/agent-editor.js +18 -18
  3. package/esm/lib/components/answer/answer-content.js +18 -19
  4. package/esm/lib/components/answer/answer.js +320 -322
  5. package/esm/lib/components/answer/citation.js +61 -62
  6. package/esm/lib/components/answer/inline-error.js +28 -28
  7. package/esm/lib/components/chat/chat.js +30 -32
  8. package/esm/lib/components/common/media-container.js +30 -29
  9. package/esm/lib/components/content/content.js +61 -63
  10. package/esm/lib/components/footer/footer.js +98 -109
  11. package/esm/lib/components/question/question.js +21 -43
  12. package/esm/lib/components/suggested-questions/suggested-questions.js +52 -61
  13. package/esm/lib/components/suggested-questions/suggestions.js +3 -3
  14. package/esm/lib/components/welcome-message/contextual-items-message.js +23 -23
  15. package/esm/lib/components/welcome-message/messages.js +1 -5
  16. package/esm/lib/components/welcome-message/welcome-message.js +55 -60
  17. package/i18n/bn-IN.js +2 -3
  18. package/i18n/bn-IN.properties +2 -4
  19. package/i18n/da-DK.js +2 -3
  20. package/i18n/da-DK.properties +2 -4
  21. package/i18n/de-DE.js +2 -3
  22. package/i18n/de-DE.properties +2 -4
  23. package/i18n/en-AU.js +0 -1
  24. package/i18n/en-AU.properties +0 -2
  25. package/i18n/en-CA.js +1 -2
  26. package/i18n/en-CA.properties +1 -3
  27. package/i18n/en-GB.js +0 -1
  28. package/i18n/en-GB.properties +0 -2
  29. package/i18n/en-US.js +1 -2
  30. package/i18n/en-US.properties +1 -3
  31. package/i18n/en-x-pseudo.js +58 -59
  32. package/i18n/en-x-pseudo.properties +58 -60
  33. package/i18n/es-419.js +2 -3
  34. package/i18n/es-419.properties +2 -4
  35. package/i18n/es-ES.js +2 -3
  36. package/i18n/es-ES.properties +2 -4
  37. package/i18n/fi-FI.js +2 -3
  38. package/i18n/fi-FI.properties +2 -4
  39. package/i18n/fr-CA.js +2 -3
  40. package/i18n/fr-CA.properties +2 -4
  41. package/i18n/fr-FR.js +2 -3
  42. package/i18n/fr-FR.properties +2 -4
  43. package/i18n/hi-IN.js +2 -3
  44. package/i18n/hi-IN.properties +2 -4
  45. package/i18n/it-IT.js +2 -3
  46. package/i18n/it-IT.properties +2 -4
  47. package/i18n/ja-JP.js +2 -3
  48. package/i18n/ja-JP.properties +2 -4
  49. package/i18n/json/src/lib/components/welcome-message/messages.json +1 -1
  50. package/i18n/ko-KR.js +2 -3
  51. package/i18n/ko-KR.properties +2 -4
  52. package/i18n/nb-NO.js +2 -3
  53. package/i18n/nb-NO.properties +2 -4
  54. package/i18n/nl-NL.js +2 -3
  55. package/i18n/nl-NL.properties +2 -4
  56. package/i18n/pl-PL.js +2 -3
  57. package/i18n/pl-PL.properties +2 -4
  58. package/i18n/pt-BR.js +2 -3
  59. package/i18n/pt-BR.properties +2 -4
  60. package/i18n/ru-RU.js +2 -3
  61. package/i18n/ru-RU.properties +2 -4
  62. package/i18n/sv-SE.js +2 -3
  63. package/i18n/sv-SE.properties +2 -4
  64. package/i18n/tr-TR.js +2 -3
  65. package/i18n/tr-TR.properties +2 -4
  66. package/i18n/zh-CN.js +2 -3
  67. package/i18n/zh-CN.properties +2 -4
  68. package/i18n/zh-TW.js +2 -3
  69. package/i18n/zh-TW.properties +2 -4
  70. package/package.json +3 -3
  71. package/styles/agent-editor.css +1 -1
  72. package/styles/answer-content.css +1 -1
  73. package/styles/answer.css +1 -1
  74. package/styles/box-ai-content-answers.css +1 -1
  75. package/styles/citation.css +1 -1
  76. package/styles/content.css +1 -1
  77. package/styles/footer.css +1 -1
  78. package/styles/inline-error.css +1 -1
  79. package/styles/media-container.css +1 -1
  80. package/styles/question.css +1 -1
  81. package/styles/suggestions.css +1 -1
  82. package/styles/welcome-message.css +1 -1
  83. package/types/lib/components/chat/chat.d.ts +1 -1
  84. package/types/lib/components/content/content.d.ts +1 -1
  85. package/types/lib/components/footer/footer.d.ts +2 -4
  86. package/types/lib/components/modal/stories/shared.d.ts +0 -3
  87. package/types/lib/components/question/question.d.ts +2 -4
  88. package/types/lib/components/welcome-message/messages.d.ts +0 -5
  89. package/types/lib/types.d.ts +0 -6
  90. package/esm/lib/components/answer/loading-element.js +0 -47
  91. package/styles/loading-element.css +0 -1
  92. package/types/lib/components/answer/loading-element.d.ts +0 -6
@@ -1,96 +1,93 @@
1
- import S from "clsx";
1
+ import _ from "clsx";
2
2
  import * as t from "react";
3
- import { AgentEditor as R } from "./components/agents/agent-editor.js";
4
- import { Content as z } from "./components/content/content.js";
5
- import { Footer as G } from "./components/footer/footer.js";
6
- import { jsx as o, jsxs as H } from "react/jsx-runtime";
7
- import '../../styles/box-ai-content-answers.css';const J = "_container_m6vks_1", K = "_contentAnswers_m6vks_8", O = "_sidebar_m6vks_19", a = {
8
- container: J,
9
- contentAnswers: K,
10
- sidebar: O
11
- }, Z = ({
12
- className: p,
3
+ import { AgentEditor as B } from "./components/agents/agent-editor.js";
4
+ import { Content as R } from "./components/content/content.js";
5
+ import { Footer as v } from "./components/footer/footer.js";
6
+ import { jsx as o, jsxs as G } from "react/jsx-runtime";
7
+ import '../../styles/box-ai-content-answers.css';const H = "_container_xgwyz_1", I = "_contentAnswers_xgwyz_8", J = "_sidebar_xgwyz_19", a = {
8
+ container: H,
9
+ contentAnswers: I,
10
+ sidebar: J
11
+ }, X = ({
12
+ className: x,
13
13
  contentType: c,
14
- contentName: A,
14
+ contentName: S,
15
15
  error: e,
16
- hasCustomSuggestedQuestions: M,
16
+ hasCustomSuggestedQuestions: p,
17
17
  hasRequestInProgress: l,
18
- isAgentSelectorEnabled: Q,
19
- isAIStudioAgentSelectorEnabled: h,
20
- isDebugModeEnabled: k,
21
- isStopResponseEnabled: x,
18
+ isAgentSelectorEnabled: A,
19
+ isAIStudioAgentSelectorEnabled: M,
20
+ isDebugModeEnabled: Q,
21
+ isStopResponseEnabled: h,
22
22
  isStreamingEnabled: n,
23
- userInfo: m,
24
23
  questions: r,
25
24
  recordAction: i,
26
- retryQuestion: D,
25
+ retryQuestion: y,
27
26
  showLoadingIndicator: d,
28
- stopQuestion: v,
29
- submitQuestion: E,
30
- suggestedQuestions: j,
31
- useAnimation: C,
32
- onAgentEditorToggle: F,
27
+ stopQuestion: D,
28
+ submitQuestion: z,
29
+ suggestedQuestions: E,
30
+ useAnimation: j,
31
+ onAgentEditorToggle: k,
33
32
  variant: u = "modal",
34
- hostAppName: N,
35
- ...y
33
+ hostAppName: C,
34
+ ...F
36
35
  }) => {
37
- const [g, b] = t.useState(null), [f, _] = t.useState(e != null), [s, w] = t.useState(!1), B = !f && !d;
36
+ const [m, g] = t.useState(null), [w, f] = t.useState(e != null), [s, b] = t.useState(!1), N = !w && !d;
38
37
  return t.useEffect(() => {
39
- _(e != null);
38
+ f(e != null);
40
39
  }, [e]), /* @__PURE__ */ o("div", {
41
- className: S(p, a.container),
42
- children: /* @__PURE__ */ H("div", {
43
- className: S(a.contentAnswers, u === "sidebar" && a.sidebar),
44
- children: [!s && /* @__PURE__ */ o(z, {
45
- ...y,
46
- askSuggestedQuestion: g,
47
- contentName: A,
40
+ className: _(x, a.container),
41
+ children: /* @__PURE__ */ G("div", {
42
+ className: _(a.contentAnswers, u === "sidebar" && a.sidebar),
43
+ children: [!s && /* @__PURE__ */ o(R, {
44
+ ...F,
45
+ askSuggestedQuestion: m,
46
+ contentName: S,
48
47
  contentType: c,
49
48
  error: e,
50
- hasCustomSuggestedQuestions: M,
49
+ hasCustomSuggestedQuestions: p,
51
50
  hasRequestInProgress: l,
52
- hostAppName: N,
53
- isErrorMessageShown: f,
51
+ hostAppName: C,
52
+ isErrorMessageShown: w,
54
53
  isStreamingEnabled: n,
55
54
  questions: r,
56
55
  recordAction: i,
57
- setAskSuggestedQuestion: b,
58
- setIsErrorMessageShown: _,
56
+ setAskSuggestedQuestion: g,
57
+ setIsErrorMessageShown: f,
59
58
  showLoadingIndicator: d,
60
- suggestedQuestions: j,
61
- useAnimation: n && C,
62
- userInfo: m,
59
+ suggestedQuestions: E,
60
+ useAnimation: n && j,
63
61
  variant: u
64
- }), s && /* @__PURE__ */ o(R, {
65
- onAgentEditorToggle: F,
62
+ }), s && /* @__PURE__ */ o(B, {
63
+ onAgentEditorToggle: k,
66
64
  recordAction: i,
67
- setIsDebugModeShown: w
68
- }), B && /* @__PURE__ */ o(G, {
69
- askSuggestedQuestion: g,
65
+ setIsDebugModeShown: b
66
+ }), N && /* @__PURE__ */ o(v, {
67
+ askSuggestedQuestion: m,
70
68
  contentType: c,
71
- enableDebugMode: k,
69
+ enableDebugMode: Q,
72
70
  hasRequestInProgress: l,
73
- isAgentSelectorEnabled: Q,
74
- isAIStudioAgentSelectorEnabled: h,
71
+ isAgentSelectorEnabled: A,
72
+ isAIStudioAgentSelectorEnabled: M,
75
73
  isDebugModeShown: s,
76
- isStopResponseEnabled: x,
74
+ isStopResponseEnabled: h,
77
75
  isStreamingEnabled: n,
78
76
  lastQuestion: r[r.length - 1],
79
- onRetryQuestion: D,
80
- onStopQuestion: v,
77
+ onRetryQuestion: y,
78
+ onStopQuestion: D,
81
79
  recordAction: i,
82
- sendQuestion: E,
83
- setAskSuggestedQuestion: b,
80
+ sendQuestion: z,
81
+ setAskSuggestedQuestion: g,
84
82
  toggleDebugMode: () => {
85
- w(!s);
83
+ b(!s);
86
84
  },
87
- user: m,
88
85
  variant: u
89
86
  })]
90
87
  })
91
88
  });
92
89
  };
93
90
  export {
94
- Z as BoxAiContentAnswers,
95
- Z as default
91
+ X as BoxAiContentAnswers,
92
+ X as default
96
93
  };
@@ -1,4 +1,4 @@
1
- import { TextArea as m } from "@box/blueprint-web";
1
+ import { TextArea as g } from "@box/blueprint-web";
2
2
  import { useEffect as a, createRef as u } from "react";
3
3
  import { useIntl as d } from "react-intl";
4
4
  import { isDebugModeTrigger as l } from "../common/keyInputUtils.js";
@@ -6,50 +6,50 @@ import p from "../footer/messages.js";
6
6
  import { useAgents as b, useAgentsDispatch as _ } from "../../contexts/AgentsContext.js";
7
7
  import { LOGGER_BASE_CONFIG as h } from "../common/constants.js";
8
8
  import { jsx as E } from "react/jsx-runtime";
9
- import '../../../../styles/agent-editor.css';const N = "_debug_gfw1n_1", O = "_sidebar_gfw1n_9", R = {
9
+ import '../../../../styles/agent-editor.css';const N = "_debug_1ov4h_1", O = "_sidebar_1ov4h_9", R = {
10
10
  debug: N,
11
11
  sidebar: O
12
- }, w = 25, S = ({
13
- onAgentEditorToggle: n,
14
- recordAction: o,
12
+ }, A = 25, M = ({
13
+ onAgentEditorToggle: o,
14
+ recordAction: r,
15
15
  setIsDebugModeShown: i
16
16
  }) => {
17
17
  const {
18
- formatMessage: r
18
+ formatMessage: n
19
19
  } = d(), {
20
20
  selectedAgent: t
21
- } = b(), f = _(), e = /* @__PURE__ */ u();
21
+ } = b(), c = _(), e = /* @__PURE__ */ u();
22
22
  a(() => {
23
23
  if (e.current) {
24
24
  const s = JSON.stringify(t.config, null, 4);
25
25
  e.current.value = s || "";
26
26
  }
27
- }, [e, t, r]), a(() => {
28
- n && (n(t), o && o({
27
+ }, [e, t, n]), a(() => {
28
+ o && (o(t), r && r({
29
29
  ...h,
30
30
  target: "debugMode"
31
31
  }));
32
32
  }, []);
33
- const g = () => {
34
- f({
33
+ const f = () => {
34
+ c({
35
35
  type: "OVERRIDE_AGENT_CONFIG",
36
36
  agentName: t.name,
37
37
  agentConfig: JSON.parse(e.current.value)
38
38
  });
39
- }, c = (s) => {
39
+ }, m = (s) => {
40
40
  l(s) && i(!1);
41
41
  };
42
- return /* @__PURE__ */ E(m, {
42
+ return /* @__PURE__ */ E(g, {
43
43
  ref: e,
44
44
  className: R.debug,
45
45
  "data-testid": "content-answers-debug",
46
46
  hideLabel: !0,
47
- label: r(p.askQuestionPlaceholder),
48
- maxRows: w,
49
- onChange: g,
50
- onKeyDown: c
47
+ label: n(p.askQuestionPlaceholder),
48
+ maxRows: A,
49
+ onChange: f,
50
+ onKeyDown: m
51
51
  });
52
52
  };
53
53
  export {
54
- S as AgentEditor
54
+ M as AgentEditor
55
55
  };
@@ -1,26 +1,25 @@
1
1
  import d from "clsx";
2
2
  import { m as w } from "../../../../chunks/markdown.js";
3
- import { jsxs as _, Fragment as c, jsx as i } from "react/jsx-runtime";
4
- import '../../../../styles/answer-content.css';const b = "_answerContent_o18bz_1", l = "_sidebar_o18bz_15", C = "_answerMarkdown_o18bz_18", e = {
5
- answerContent: b,
6
- sidebar: l,
3
+ import { jsxs as c, Fragment as l, jsx as m } from "react/jsx-runtime";
4
+ import '../../../../styles/answer-content.css';const _ = "_answerContent_qhum2_1", C = "_answerMarkdown_qhum2_16", n = {
5
+ answerContent: _,
7
6
  answerMarkdown: C
8
- }, p = ({
9
- answer: n,
10
- isMarkdownEnabled: r,
11
- className: t,
12
- variant: m = "modal",
7
+ }, u = ({
8
+ answer: e,
9
+ isMarkdownEnabled: t,
10
+ className: r,
11
+ variant: i = "modal",
13
12
  ...s
14
13
  }) => {
15
- const o = m === "sidebar";
16
- let a = n;
17
- return r && n && (a = w.render(n)), /* @__PURE__ */ _(c, {
18
- children: [!r && /* @__PURE__ */ i("div", {
19
- className: d(e.answerContent, o && e.sidebar, "Answer-text", t),
14
+ const o = i === "sidebar";
15
+ let a = e;
16
+ return t && e && (a = w.render(e)), /* @__PURE__ */ c(l, {
17
+ children: [!t && /* @__PURE__ */ m("div", {
18
+ className: d(n.answerContent, o && n.sidebar, "Answer-text", r),
20
19
  ...s,
21
- children: n
22
- }), r && /* @__PURE__ */ i("div", {
23
- className: d(e.answerContent, e.answerMarkdown, o && e.sidebar, "Answer-text", t),
20
+ children: e
21
+ }), t && /* @__PURE__ */ m("div", {
22
+ className: d(n.answerContent, n.answerMarkdown, o && n.sidebar, "Answer-text", r),
24
23
  dangerouslySetInnerHTML: {
25
24
  __html: a
26
25
  },
@@ -29,6 +28,6 @@ import '../../../../styles/answer-content.css';const b = "_answerContent_o18bz_1
29
28
  });
30
29
  };
31
30
  export {
32
- p as AnswerContent,
33
- p as default
31
+ u as AnswerContent,
32
+ u as default
34
33
  };