@box/box-ai-content-answers 0.86.2 → 0.87.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.
Files changed (127) hide show
  1. package/chunks/clear-conversation-button.js +12 -13
  2. package/chunks/markdown.js +12168 -0
  3. package/esm/lib/box-ai-content-answers.js +11 -12
  4. package/esm/lib/components/agents/agent-editor.js +7 -8
  5. package/esm/lib/components/agents/agent-selector.js +3 -4
  6. package/esm/lib/components/answer/answer-content.js +5 -6
  7. package/esm/lib/components/answer/answer.js +604 -107
  8. package/esm/lib/components/answer/citation.js +4 -5
  9. package/esm/lib/components/answer/inline-error.js +4 -5
  10. package/esm/lib/components/answer/loading-element.js +4 -5
  11. package/esm/lib/components/answer/references.js +19 -20
  12. package/esm/lib/components/answer/thumb-buttons.js +11 -12
  13. package/esm/lib/components/chat/chat.js +13 -14
  14. package/esm/lib/components/common/markdown.js +3 -12212
  15. package/esm/lib/components/common/media-container.js +10 -11
  16. package/esm/lib/components/content/content.js +4 -5
  17. package/esm/lib/components/footer/footer-actions.js +3 -4
  18. package/esm/lib/components/footer/footer.js +3 -4
  19. package/esm/lib/components/modal-error/modal-error.js +3 -4
  20. package/esm/lib/components/question/question.js +12 -13
  21. package/esm/lib/components/suggested-questions/suggested-questions.js +10 -11
  22. package/esm/lib/components/suggested-questions/suggestions.js +8 -9
  23. package/esm/lib/components/welcome-message/contextual-items-message.js +4 -5
  24. package/esm/lib/components/welcome-message/items-dropdown.js +15 -16
  25. package/esm/lib/components/welcome-message/unsupported-items-notice.js +9 -10
  26. package/esm/lib/components/welcome-message/welcome-message.js +11 -12
  27. package/i18n/bn-IN.js +3 -3
  28. package/i18n/bn-IN.properties +7 -3
  29. package/i18n/da-DK.js +3 -3
  30. package/i18n/da-DK.properties +7 -3
  31. package/i18n/de-DE.js +3 -3
  32. package/i18n/de-DE.properties +7 -3
  33. package/i18n/en-AU.js +3 -3
  34. package/i18n/en-AU.properties +7 -3
  35. package/i18n/en-CA.js +1 -1
  36. package/i18n/en-CA.properties +5 -1
  37. package/i18n/en-GB.js +3 -3
  38. package/i18n/en-GB.properties +7 -3
  39. package/i18n/en-x-pseudo.js +59 -59
  40. package/i18n/en-x-pseudo.properties +61 -57
  41. package/i18n/es-419.js +3 -3
  42. package/i18n/es-419.properties +7 -3
  43. package/i18n/es-ES.js +3 -3
  44. package/i18n/es-ES.properties +7 -3
  45. package/i18n/fi-FI.js +3 -3
  46. package/i18n/fi-FI.properties +7 -3
  47. package/i18n/fr-CA.js +3 -3
  48. package/i18n/fr-CA.properties +7 -3
  49. package/i18n/fr-FR.js +3 -3
  50. package/i18n/fr-FR.properties +7 -3
  51. package/i18n/hi-IN.js +3 -3
  52. package/i18n/hi-IN.properties +7 -3
  53. package/i18n/it-IT.js +3 -3
  54. package/i18n/it-IT.properties +7 -3
  55. package/i18n/ja-JP.js +4 -4
  56. package/i18n/ja-JP.properties +8 -4
  57. package/i18n/ko-KR.js +3 -3
  58. package/i18n/ko-KR.properties +7 -3
  59. package/i18n/nb-NO.js +3 -3
  60. package/i18n/nb-NO.properties +7 -3
  61. package/i18n/nl-NL.js +3 -3
  62. package/i18n/nl-NL.properties +7 -3
  63. package/i18n/pl-PL.js +3 -3
  64. package/i18n/pl-PL.properties +7 -3
  65. package/i18n/pt-BR.js +3 -3
  66. package/i18n/pt-BR.properties +7 -3
  67. package/i18n/ru-RU.js +3 -3
  68. package/i18n/ru-RU.properties +7 -3
  69. package/i18n/sv-SE.js +3 -3
  70. package/i18n/sv-SE.properties +7 -3
  71. package/i18n/tr-TR.js +3 -3
  72. package/i18n/tr-TR.properties +7 -3
  73. package/i18n/zh-CN.js +3 -3
  74. package/i18n/zh-CN.properties +7 -3
  75. package/i18n/zh-TW.js +3 -3
  76. package/i18n/zh-TW.properties +7 -3
  77. package/package.json +7 -7
  78. package/types/lib/box-ai-content-answers.d.ts +1 -1
  79. package/types/lib/components/agents/agent-editor.d.ts +1 -1
  80. package/types/lib/components/agents/agent-selector.d.ts +1 -1
  81. package/types/lib/components/agents/stories/shared.d.ts +3 -3
  82. package/types/lib/components/answer/answer-content.d.ts +2 -2
  83. package/types/lib/components/answer/answer.d.ts +1 -1
  84. package/types/lib/components/answer/citation.d.ts +1 -1
  85. package/types/lib/components/answer/copy-button.d.ts +1 -1
  86. package/types/lib/components/answer/inline-error.d.ts +1 -1
  87. package/types/lib/components/answer/loading-element.d.ts +1 -1
  88. package/types/lib/components/answer/no-citations.d.ts +1 -1
  89. package/types/lib/components/answer/references.d.ts +1 -1
  90. package/types/lib/components/answer/stories/shared.d.ts +1 -1
  91. package/types/lib/components/answer/thumb-buttons.d.ts +1 -1
  92. package/types/lib/components/api-wrapper/api-wrapper.d.ts +1 -1
  93. package/types/lib/components/api-wrapper/constants.d.ts +1 -1
  94. package/types/lib/components/api-wrapper/content-answers-component.d.ts +1 -1
  95. package/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +4 -4
  96. package/types/lib/components/api-wrapper/records.d.ts +1 -1
  97. package/types/lib/components/api-wrapper/stories/shared.d.ts +1 -1
  98. package/types/lib/components/api-wrapper/test-utils/ReadableStreamSimulator.d.ts +1 -1
  99. package/types/lib/components/api-wrapper/types.d.ts +3 -3
  100. package/types/lib/components/api-wrapper/utils/format.d.ts +1 -1
  101. package/types/lib/components/api-wrapper/utils/request.d.ts +3 -3
  102. package/types/lib/components/api-wrapper/utils/stream.d.ts +1 -1
  103. package/types/lib/components/chat/chat.d.ts +1 -1
  104. package/types/lib/components/common/constants.d.ts +1 -1
  105. package/types/lib/components/common/media-container.d.ts +2 -2
  106. package/types/lib/components/common/mock-data.d.ts +4 -4
  107. package/types/lib/components/content/content.d.ts +1 -1
  108. package/types/lib/components/footer/footer-actions.d.ts +1 -1
  109. package/types/lib/components/footer/footer.d.ts +1 -1
  110. package/types/lib/components/footer/stories/shared.d.ts +7 -7
  111. package/types/lib/components/modal/modal.d.ts +5 -5
  112. package/types/lib/components/modal/stories/shared.d.ts +2 -2
  113. package/types/lib/components/modal-error/stories/shared.d.ts +1 -1
  114. package/types/lib/components/question/question.d.ts +1 -1
  115. package/types/lib/components/question/stories/shared.d.ts +1 -1
  116. package/types/lib/components/suggested-questions/mocks.d.ts +1 -1
  117. package/types/lib/components/suggested-questions/stories/shared.d.ts +1 -1
  118. package/types/lib/components/suggested-questions/suggested-questions.d.ts +1 -1
  119. package/types/lib/components/suggested-questions/suggestions.d.ts +1 -1
  120. package/types/lib/components/welcome-message/contextual-items-message.d.ts +1 -1
  121. package/types/lib/components/welcome-message/items-dropdown.d.ts +1 -1
  122. package/types/lib/components/welcome-message/stories/shared.d.ts +4 -4
  123. package/types/lib/components/welcome-message/unsupported-items-notice.d.ts +1 -1
  124. package/types/lib/components/welcome-message/welcome-message.d.ts +1 -1
  125. package/types/lib/contexts/AgentsContext.d.ts +1 -1
  126. package/types/lib/stories/shared.d.ts +3 -3
  127. package/types/lib/types.d.ts +2 -2
package/i18n/zh-CN.js CHANGED
@@ -10,7 +10,7 @@ export default {
10
10
  "boxAI.contentAnswers.cardTooltipTitleWithDocumentName": "从“{title}”:",
11
11
  "boxAI.contentAnswers.clearConversationLabel": "清除对话",
12
12
  "boxAI.contentAnswers.closeModalAriaLabel": "关闭模式",
13
- "boxAI.contentAnswers.collapseModalAriaLabel": "折叠模式",
13
+ "boxAI.contentAnswers.collapseModalAriaLabel": "切换到侧边栏视图",
14
14
  "boxAI.contentAnswers.contentAnswersTitle": "Box AI",
15
15
  "boxAI.contentAnswers.continueAnyway": "仍然继续",
16
16
  "boxAI.contentAnswers.copyToClipboard": "复制到剪贴板",
@@ -51,10 +51,10 @@ export default {
51
51
  "boxAI.contentAnswers.unsupportedFormatLabel": "格式不受支持",
52
52
  "boxAI.contentAnswers.unsupportedItems": "{numberOfFiles,plural,other{{files} 对 Box AI 不可用}}",
53
53
  "boxAI.contentAnswers.userAvatar": "用户头像",
54
- "boxAI.contentAnswers.welcomeAskQuestionText": "提出有关{numberOfItems,plural,one{{firstItemName}} other{{files}}}{parentItem,select,undefined{} other{ in {parentItem}}}的疑问",
54
+ "boxAI.contentAnswers.welcomeAskQuestionText": "提出有关 {numberOfItems,plural,one{{firstItemName}} other{这些{files}}}{parentItem,select,undefined{ } other{ {parentItem}}} 的疑问",
55
55
  "boxAI.contentAnswers.welcomeClearChatText": "您关闭 {type} 时,此对话框将被清理",
56
56
  "boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems,plural,other{# 个文件}}",
57
- "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems, plural, one {# item} other {# items} }",
57
+ "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,other{# 个项目}}",
58
58
  "boxAI.contentAnswers.welcomeMessageTitle": "欢迎使用 Box AI!",
59
59
  "boxAI.popup.closeButtonText": "关闭",
60
60
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "已复制"
@@ -21,7 +21,7 @@ boxAI.contentAnswers.clearConversationLabel = 清除对话
21
21
  # Content Answers close button aria label
22
22
  boxAI.contentAnswers.closeModalAriaLabel = 关闭模式
23
23
  # Content Answers collapse button aria label
24
- boxAI.contentAnswers.collapseModalAriaLabel = 折叠模式
24
+ boxAI.contentAnswers.collapseModalAriaLabel = 切换到侧边栏视图
25
25
  # Content Answers feature name shown on menu item and modal title
26
26
  boxAI.contentAnswers.contentAnswersTitle = Box AI
27
27
  # Box AI primary action when file is too large
@@ -92,6 +92,10 @@ boxAI.contentAnswers.selectAgent = 选择一个代理
92
92
  boxAI.contentAnswers.stopResponse = 停止响应
93
93
  # Suggested questions title
94
94
  boxAI.contentAnswers.suggestedQuestions = 提出的问题建议:
95
+ # Aria label for thumbs down icon
96
+ boxAI.contentAnswers.thumbsDownAriaLabel = Not helpful
97
+ # Aria label for thumbs up icon
98
+ boxAI.contentAnswers.thumbsUpAriaLabel = Helpful
95
99
  # Label that shows within the modal to show how many files are not supported by Box AI due to correct format
96
100
  boxAI.contentAnswers.unsupportedFormatLabel = 格式不受支持
97
101
  # Warning message that shows how many files are not supported by Box AI
@@ -99,13 +103,13 @@ boxAI.contentAnswers.unsupportedItems = {numberOfFiles,plural,other{{files} 对
99
103
  # Alt text for user avatar image
100
104
  boxAI.contentAnswers.userAvatar = 用户头像
101
105
  # Content Answers welcome message for asking questions. {firstItemName} is the name of the content, {files} is a list of items, and {parentItem} is the name of the parent item.
102
- boxAI.contentAnswers.welcomeAskQuestionText = 提出有关{numberOfItems,plural,one{{firstItemName}} other{{files}}}{parentItem,select,undefined{} other{ in {parentItem}}}的疑问
106
+ boxAI.contentAnswers.welcomeAskQuestionText = 提出有关 {numberOfItems,plural,one{{firstItemName}} other{这些{files}}}{parentItem,select,undefined{ } other{ {parentItem}}} 的疑问
103
107
  # Content Answers welcome message for clearing the chat. {type} is the type of content that we are going to query
104
108
  boxAI.contentAnswers.welcomeClearChatText = 您关闭 {type} 时,此对话框将被清理
105
109
  # Link that show the number of files that are going to be displayed within the modal
106
110
  boxAI.contentAnswers.welcomeMessageFilesLink = {numberOfItems,plural,other{# 个文件}}
107
111
  # Link that show the number of items that are going to be displayed within the modal
108
- boxAI.contentAnswers.welcomeMessageItemsLink = {numberOfItems, plural, one {# item} other {# items} }
112
+ boxAI.contentAnswers.welcomeMessageItemsLink = {numberOfItems,plural,other{# 个项目}}
109
113
  # Content Answers welcome message title
110
114
  boxAI.contentAnswers.welcomeMessageTitle = 欢迎使用 Box AI!
111
115
  # Text for close button in popup
package/i18n/zh-TW.js CHANGED
@@ -10,7 +10,7 @@ export default {
10
10
  "boxAI.contentAnswers.cardTooltipTitleWithDocumentName": "來自「{title}」:",
11
11
  "boxAI.contentAnswers.clearConversationLabel": "清除對話",
12
12
  "boxAI.contentAnswers.closeModalAriaLabel": "關閉互動視窗",
13
- "boxAI.contentAnswers.collapseModalAriaLabel": "收合模式",
13
+ "boxAI.contentAnswers.collapseModalAriaLabel": "切換至側邊欄檢視",
14
14
  "boxAI.contentAnswers.contentAnswersTitle": "Box AI",
15
15
  "boxAI.contentAnswers.continueAnyway": "仍繼續",
16
16
  "boxAI.contentAnswers.copyToClipboard": "複製到剪貼簿",
@@ -51,10 +51,10 @@ export default {
51
51
  "boxAI.contentAnswers.unsupportedFormatLabel": "不支援的格式",
52
52
  "boxAI.contentAnswers.unsupportedItems": "{numberOfFiles,plural,other{{files} 對於 Box AI 不可用}}",
53
53
  "boxAI.contentAnswers.userAvatar": "使用者頭像",
54
- "boxAI.contentAnswers.welcomeAskQuestionText": "詢問 {numberOfItems,plural,other{{files}}}{parentItem,select,undefined{} other{ in {parentItem}}} 的問題",
54
+ "boxAI.contentAnswers.welcomeAskQuestionText": "詢問有關 {numberOfItems,plural,one{{firstItemName}} other{這些{files}}}{parentItem,select,undefined{ } other{ {parentItem}}}的問題",
55
55
  "boxAI.contentAnswers.welcomeClearChatText": "關閉此{type}後會清除此聊天",
56
56
  "boxAI.contentAnswers.welcomeMessageFilesLink": "{numberOfItems,plural,other{# 個檔案}}",
57
- "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems, plural, one {# item} other {# items} }",
57
+ "boxAI.contentAnswers.welcomeMessageItemsLink": "{numberOfItems,plural,other{# 項目}}",
58
58
  "boxAI.contentAnswers.welcomeMessageTitle": "歡迎使用 Box AI",
59
59
  "boxAI.popup.closeButtonText": "關閉",
60
60
  "boxAI.textInputWithCopyButton.copyButtonSuccessText": "已複製"
@@ -21,7 +21,7 @@ boxAI.contentAnswers.clearConversationLabel = 清除對話
21
21
  # Content Answers close button aria label
22
22
  boxAI.contentAnswers.closeModalAriaLabel = 關閉互動視窗
23
23
  # Content Answers collapse button aria label
24
- boxAI.contentAnswers.collapseModalAriaLabel = 收合模式
24
+ boxAI.contentAnswers.collapseModalAriaLabel = 切換至側邊欄檢視
25
25
  # Content Answers feature name shown on menu item and modal title
26
26
  boxAI.contentAnswers.contentAnswersTitle = Box AI
27
27
  # Box AI primary action when file is too large
@@ -92,6 +92,10 @@ boxAI.contentAnswers.selectAgent = 選擇代理
92
92
  boxAI.contentAnswers.stopResponse = 停止回應
93
93
  # Suggested questions title
94
94
  boxAI.contentAnswers.suggestedQuestions = 建議的問題:
95
+ # Aria label for thumbs down icon
96
+ boxAI.contentAnswers.thumbsDownAriaLabel = Not helpful
97
+ # Aria label for thumbs up icon
98
+ boxAI.contentAnswers.thumbsUpAriaLabel = Helpful
95
99
  # Label that shows within the modal to show how many files are not supported by Box AI due to correct format
96
100
  boxAI.contentAnswers.unsupportedFormatLabel = 不支援的格式
97
101
  # Warning message that shows how many files are not supported by Box AI
@@ -99,13 +103,13 @@ boxAI.contentAnswers.unsupportedItems = {numberOfFiles,plural,other{{files} 對
99
103
  # Alt text for user avatar image
100
104
  boxAI.contentAnswers.userAvatar = 使用者頭像
101
105
  # Content Answers welcome message for asking questions. {firstItemName} is the name of the content, {files} is a list of items, and {parentItem} is the name of the parent item.
102
- boxAI.contentAnswers.welcomeAskQuestionText = 詢問 {numberOfItems,plural,other{{files}}}{parentItem,select,undefined{} other{ in {parentItem}}} 的問題
106
+ boxAI.contentAnswers.welcomeAskQuestionText = 詢問有關 {numberOfItems,plural,one{{firstItemName}} other{這些{files}}}{parentItem,select,undefined{ } other{ {parentItem}}}的問題
103
107
  # Content Answers welcome message for clearing the chat. {type} is the type of content that we are going to query
104
108
  boxAI.contentAnswers.welcomeClearChatText = 關閉此{type}後會清除此聊天
105
109
  # Link that show the number of files that are going to be displayed within the modal
106
110
  boxAI.contentAnswers.welcomeMessageFilesLink = {numberOfItems,plural,other{# 個檔案}}
107
111
  # Link that show the number of items that are going to be displayed within the modal
108
- boxAI.contentAnswers.welcomeMessageItemsLink = {numberOfItems, plural, one {# item} other {# items} }
112
+ boxAI.contentAnswers.welcomeMessageItemsLink = {numberOfItems,plural,other{# 項目}}
109
113
  # Content Answers welcome message title
110
114
  boxAI.contentAnswers.welcomeMessageTitle = 歡迎使用 Box AI
111
115
  # Text for close button in popup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "0.86.2",
3
+ "version": "0.87.2",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.16.0",
@@ -15,11 +15,11 @@
15
15
  "remarkable": "^2.0.1"
16
16
  },
17
17
  "devDependencies": {
18
- "@box/blueprint-web": "^9.16.0",
19
- "@box/blueprint-web-assets": "^4.32.0",
20
- "@box/box-ai-agent-selector": "^0.22.8",
21
- "@box/item-icon": "^0.9.72",
22
- "@box/storybook-utils": "^0.8.1",
18
+ "@box/blueprint-web": "^9.16.2",
19
+ "@box/blueprint-web-assets": "^4.32.1",
20
+ "@box/box-ai-agent-selector": "^0.23.2",
21
+ "@box/item-icon": "^0.9.74",
22
+ "@box/storybook-utils": "^0.8.2",
23
23
  "@testing-library/react": "^15.0.6",
24
24
  "react": "^18.3.0",
25
25
  "react-dom": "^18.3.0",
@@ -56,5 +56,5 @@
56
56
  "**/*.css"
57
57
  ],
58
58
  "license": "SEE LICENSE IN LICENSE",
59
- "gitHead": "7167b603859db70120f58d10f8e29117271b9f9a"
59
+ "gitHead": "9c7b8b2a403ff2bc3d0f313cdc8a7fb3a73079ed"
60
60
  }
@@ -1,5 +1,5 @@
1
+ import { AgentType, ContentProps, ItemClickHandler, RetryQuestion, StopQuestion, StyleVariant, SubmitQuestion } from './types';
1
2
  import * as React from 'react';
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;
@@ -1,4 +1,4 @@
1
- import { type AgentType } from '../../types';
1
+ import { AgentType } from '../../types';
2
2
  export interface AgentEditorProps {
3
3
  onAgentEditorToggle?: (agent: AgentType) => void;
4
4
  /** Callback function to handle logging events */
@@ -1,4 +1,4 @@
1
- import { type AgentType, type RecordActionType } from '../../types';
1
+ import { AgentType, RecordActionType } from '../../types';
2
2
  export interface AgentSelectorProps {
3
3
  onSelectAgent?: (agent: AgentType) => void;
4
4
  recordAction?: (params: RecordActionType) => void;
@@ -1,6 +1,6 @@
1
- import { type AgentState } from '../../../types';
2
- import { type AgentEditorProps } from '../agent-editor';
3
- import { type AgentSelectorProps } from '../agent-selector';
1
+ import { AgentState } from '../../../types';
2
+ import { AgentEditorProps } from '../agent-editor';
3
+ import { AgentSelectorProps } from '../agent-selector';
4
4
  type AgentSelectorPropsWithAgentState = AgentSelectorProps & {
5
5
  agentState: AgentState;
6
6
  };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type StyleVariant } from '../../types';
1
+ import { default as React } from 'react';
2
+ import { StyleVariant } from '../../types';
3
3
  export interface AnswerContentProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  answer?: string;
5
5
  /** Whether to render the answer with markdown */
@@ -1,5 +1,5 @@
1
+ import { ANSWER_ERROR, CitationType, ItemClickHandler, RecordActionType, StyleVariant, ItemType } from '../../types';
1
2
  import * as React from 'react';
2
- import { ANSWER_ERROR, type CitationType, type ItemClickHandler, type RecordActionType, type StyleVariant, type ItemType } from '../../types';
3
3
  export interface AnswerProps {
4
4
  answer?: string;
5
5
  /** Citations list */
@@ -1,4 +1,4 @@
1
- import { type CitationResponseRecordType, type ItemClickHandler, type RecordActionType } from '../../types';
1
+ import { CitationResponseRecordType, ItemClickHandler, RecordActionType } from '../../types';
2
2
  export interface CitationProps {
3
3
  /** Whether or not to animate the citation while appearing */
4
4
  animate: boolean;
@@ -1,4 +1,4 @@
1
- import { type RecordActionType } from '../../types';
1
+ import { RecordActionType } from '../../types';
2
2
  export type CopyButtonProps = {
3
3
  answer?: string;
4
4
  onAnswerCopy?: (answer: string) => void;
@@ -1,4 +1,4 @@
1
- import { type RecordActionType, type StyleVariant } from '../../types';
1
+ import { RecordActionType, StyleVariant } from '../../types';
2
2
  export type InlineErrorProps = {
3
3
  error: string | null;
4
4
  contentType: string;
@@ -1,4 +1,4 @@
1
- import { type StyleVariant } from '../../types';
1
+ import { StyleVariant } from '../../types';
2
2
  interface LoadingElementProps {
3
3
  variant?: StyleVariant;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { type RecordActionType } from '../../types';
1
+ import { RecordActionType } from '../../types';
2
2
  export interface NoCitationsIconProps {
3
3
  /** Callback function to handle logging events */
4
4
  recordAction?: (params: RecordActionType) => void;
@@ -1,4 +1,4 @@
1
- import { type CitationType, type ItemClickHandler, type RecordActionType } from '../../types';
1
+ import { CitationType, ItemClickHandler, RecordActionType } from '../../types';
2
2
  export interface ReferencesProps {
3
3
  /** Whether or not to animate the citation while appearing */
4
4
  animate?: boolean;
@@ -1,4 +1,4 @@
1
- import { type AnswerProps } from '../answer';
1
+ import { AnswerProps } from '../answer';
2
2
  export declare const shortAnswer = "This is a short answer";
3
3
  export declare const longAnswer = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed hendrerit nisi eget ligula suscipit, id tempus lorem volutpat. Nam eget placerat justo. Fusce vitae tortor id mi accumsan vestibulum. Integer auctor fermentum nisi, et consequat orci facilisis ac. Ut vitae nisl sit amet orci ullamcorper fringilla non a turpis. Proin nec turpis sed elit mattis efficitur. Sed consequat dui et nisi malesuada, sed sodales nulla hendrerit. Nullam tristique, lorem nec aliquet varius, mauris purus eleifend justo, vitae varius purus mauris sit amet purus. Duis ac odio ut nulla fermentum congue. Integer consequat dui sed libero vulputate commodo. \n Donec rhoncus purus nec turpis pulvinar, ac aliquam neque aliquet. Sed semper libero quis massa vehicula, sit amet rhoncus tortor fringilla. Nulla facilisi. In ut nibh eget mauris dictum suscipit vel eget lacus. Nullam sollicitudin leo nec ligula convallis, eget pharetra nisi tristique. Nulla facilisi. Phasellus vestibulum tristique sollicitudin. Cras lacinia velit quis sapien tristique, sed luctus elit ultricies. Suspendisse ut dictum tortor. Phasellus sed purus nec odio congue ullamcorper. Sed auctor lorem id venenatis cursus. Sed ac quam tortor. Sed vel ante nec nulla vulputate placerat. Maecenas sed ante eget leo ultrices posuere. Vivamus sit amet feugiat risus.";
4
4
  export declare const answerWithMarkdown = "\nParagraphs\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc auctor eleifend odio, id cursus nisl sollicitudin vitae.\nMauris eget iaculis nisl. Praesent at tincidunt dolor. Mauris in pharetra ante, nec laoreet nibh. Sed id ornare dolor, quis aliquam libero.\n\nHeaders\n# Header 1\n## Header 2\n### Header 3\n#### Header 4\n##### Header 5\n###### Header 6\n\n---\n\nEmphasis\n*italic* or _italic_\n**bold** or __bold__\n~~Strikethrough~~\n\n---\n\nUnordered List\n- Item 1\n- Item 2\n - Subitem A\n - Subitem B\n\nOrdered List\n1. Item 1\n2. Item 2\n 1. Subitem A\n 2. Subitem B\n\n---\n\nLinks\n[Link text](https://www.example.com)\n\n---\n\nBlockquotes\n> This is a blockquote.\n> - Anonymous\n\n---\nFootnotes\nHere is a footnote[^1].\n\n[^1]: Footnote content.\n\nReferences\n[Reference link][1]\n\n[1]: https://www.example.com\n";
@@ -1,4 +1,4 @@
1
- import { type ItemType, type RecordActionType, type StyleVariant } from '../../types';
1
+ import { ItemType, RecordActionType, StyleVariant } from '../../types';
2
2
  export type ThumbButtonsProps = {
3
3
  hostAppName: string;
4
4
  items: ItemType[];
@@ -1,3 +1,3 @@
1
- import { type ApiWrapperProps } from './types';
1
+ import { ApiWrapperProps } from './types';
2
2
  export declare const withApiWrapper: (WrappedComponent: any) => (props: ApiWrapperProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default withApiWrapper;
@@ -1,4 +1,4 @@
1
- import { type AgentType } from '../../types';
1
+ import { AgentType } from '../../types';
2
2
  export declare const agentList: AgentType[];
3
3
  export declare const agentState: {
4
4
  agents: AgentType[];
@@ -1,4 +1,4 @@
1
- import { type ApiWrapperProps } from './types';
1
+ import { ApiWrapperProps } from './types';
2
2
  export type ContentAnswersComponentProps = ApiWrapperProps & {
3
3
  WrappedComponent: React.ComponentType<ApiWrapperProps>;
4
4
  };
@@ -1,13 +1,13 @@
1
- import { type AgentType, type QuestionType } from '../../../types';
2
- import { type QuestionRecordType } from '../records';
3
- import { type UseContentAnswersProps } from '../types';
1
+ import { AgentType, QuestionType } from '../../../types';
2
+ import { QuestionRecordType } from '../records';
3
+ import { UseContentAnswersProps } from '../types';
4
4
  export declare function useContentAnswers({ contentAnswers, createSessionRequest, dispatchStateUpdate, fetchTimeout, getAgentConfig, getAnswerStreaming, getAnswer, getSuggestedQuestions, isCitationsEnabled, isStopResponseEnabled, isStreamingEnabled, itemID, items, formatCitations, }: UseContentAnswersProps): {
5
5
  clearConversation: () => void;
6
6
  createSession: () => Promise<void>;
7
7
  fetchAgentConfig: (agent: AgentType) => Promise<void>;
8
8
  fetchSuggestedQuestions: () => Promise<void>;
9
9
  retryQuestion: (question: QuestionRecordType, aiAgent?: unknown) => Promise<void>;
10
- sendQuestion: (question: QuestionType, aiAgent?: unknown, shouldCreateQuestion?: boolean) => import("immutable").Record<QuestionType> & Readonly<QuestionType>;
10
+ sendQuestion: (question: QuestionType, aiAgent?: unknown, shouldCreateQuestion?: boolean) => import('immutable').Record<QuestionType> & Readonly<QuestionType>;
11
11
  sendQuestionAnswerRequest: (questionRecord: any, aiAgent: any) => Promise<void>;
12
12
  stopQuestion: (lastQuestion?: QuestionRecordType) => void;
13
13
  updateQuestionInState: (newQuestion: QuestionType, session?: Record<string, unknown>) => void;
@@ -1,5 +1,5 @@
1
1
  import { Record } from 'immutable';
2
- import { REQUEST_STATE, type QuestionType, type SuggestedQuestionType } from '../../types';
2
+ import { REQUEST_STATE, QuestionType, SuggestedQuestionType } from '../../types';
3
3
  export type ContentAnswersRecordParams = {
4
4
  config: ContentAnswersConfigRecordParams;
5
5
  encodedSession?: string;
@@ -1,2 +1,2 @@
1
- declare const _default: (props: import("../types").ApiWrapperProps) => import("react/jsx-runtime").JSX.Element;
1
+ declare const _default: (props: import('../types').ApiWrapperProps) => import("react/jsx-runtime").JSX.Element;
2
2
  export default _default;
@@ -16,7 +16,7 @@ export default class ReadableStreamSimulator {
16
16
  constructor({ answer, includeCompletion, simulateError, delayChunk, abortController, extraProps, }: ReadableStreamOptions);
17
17
  getReader(): {
18
18
  read: () => Promise<{
19
- value: Uint8Array;
19
+ value: Uint8Array<ArrayBufferLike>;
20
20
  done: boolean;
21
21
  } | {
22
22
  done: boolean;
@@ -1,6 +1,6 @@
1
- import { type AgentListResponse } from '@box/box-ai-agent-selector';
2
- import { type AgentType, type CitationResponse, type CitationType, type CONTENT_ERROR, type ItemClickHandler, type ItemType, type QuestionType, type REQUEST_STATE, type RetryQuestion, type StopQuestion, type SubmitQuestion, type SuggestedQuestionsResponse, type SuggestedQuestionType, type WelcomeMessageType } from '../../types';
3
- import { type ContentAnswersRecordType } from './records';
1
+ import { AgentListResponse } from '@box/box-ai-agent-selector';
2
+ import { AgentType, CitationResponse, CitationType, CONTENT_ERROR, ItemClickHandler, ItemType, QuestionType, REQUEST_STATE, RetryQuestion, StopQuestion, SubmitQuestion, SuggestedQuestionsResponse, SuggestedQuestionType, WelcomeMessageType } from '../../types';
3
+ import { ContentAnswersRecordType } from './records';
4
4
  export type CreateSessionResponse = {
5
5
  encoded_session: string;
6
6
  metadata: {
@@ -1,4 +1,4 @@
1
- import { type CitationResponse, type CitationType, type SuggestedQuestionsResponse, type SuggestedQuestionType } from '../../../types';
1
+ import { CitationResponse, CitationType, SuggestedQuestionsResponse, SuggestedQuestionType } from '../../../types';
2
2
  declare const defaultFormatCitations: (citations: Array<CitationResponse>) => Array<CitationType>;
3
3
  declare const defaultFormatSuggestions: (suggestions: SuggestedQuestionsResponse) => Array<SuggestedQuestionType>;
4
4
  export { defaultFormatCitations, defaultFormatSuggestions };
@@ -1,5 +1,5 @@
1
- import { type ItemType } from '../../../types';
2
- import { type ContentAnswersRecordType } from '../records';
3
- import { type fetcherStreamingType, type fetcherType, type StreamResponseTimeout } from '../types';
1
+ import { ItemType } from '../../../types';
2
+ import { ContentAnswersRecordType } from '../records';
3
+ import { fetcherStreamingType, fetcherType, StreamResponseTimeout } from '../types';
4
4
  declare const getAnswerRequest: (payload: Record<string, unknown>, isStreamingRequest: boolean, requestID: string, itemID?: string, items?: Array<ItemType>, state?: ContentAnswersRecordType, fetcher?: fetcherType, fetcherStreaming?: fetcherStreamingType, abortController?: AbortController, fetchTimeout?: StreamResponseTimeout) => Promise<any>;
5
5
  export { getAnswerRequest };
@@ -1,5 +1,5 @@
1
1
  import { ANSWER_ERROR } from '../../../types';
2
- import { type ExtendedReadableStreamReadResult, type ReadableStreamResponse, type StreamAbort, type StreamResponseProps, type StreamResponseTimeout } from '../types';
2
+ import { ExtendedReadableStreamReadResult, ReadableStreamResponse, StreamAbort, StreamResponseProps, StreamResponseTimeout } from '../types';
3
3
  export declare const FETCH_TIMEOUT: StreamResponseTimeout;
4
4
  export declare const STREAM_ERROR: {
5
5
  RESPONSE_FAILED: ANSWER_ERROR;
@@ -1,3 +1,3 @@
1
- import { type ChatProps } from '../../types';
1
+ import { ChatProps } from '../../types';
2
2
  export declare const Chat: ({ askSuggestedQuestion, hasCustomSuggestedQuestions, hasRequestInProgress, isCitationsEnabled, isFeedbackEnabled, isMarkdownEnabled, onCitationClick, onAnswerCopy, questions, recordAction, setAskSuggestedQuestion, suggestedQuestions, suggestedQuestionsRequestState, useAnimation, userInfo, variant, hostAppName, ...welcomeMessageProps }: ChatProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Chat;
@@ -1,4 +1,4 @@
1
- import { type RecordActionType } from '../../types';
1
+ import { RecordActionType } from '../../types';
2
2
  export declare const LOGGER_COMPONENT = "modal";
3
3
  export declare const LOGGER_FEATURE = "answers";
4
4
  export declare const LOGGER_ACTION_PROGRAMMATIC = "programmatic";
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type StyleVariant } from '../../types';
1
+ import { default as React } from 'react';
2
+ import { StyleVariant } from '../../types';
3
3
  type Props = {
4
4
  children?: React.ReactNode;
5
5
  className?: string;
@@ -1,4 +1,4 @@
1
- import { ANSWER_ERROR, type ItemType } from '../../types';
1
+ import { ANSWER_ERROR, ItemType } from '../../types';
2
2
  export declare const mockQuestions: ({
3
3
  answer: string;
4
4
  id: string;
@@ -20,10 +20,10 @@ export declare const mockQuestions: ({
20
20
  prompt: string;
21
21
  citations?: undefined;
22
22
  })[];
23
- export declare const mockAgents: import("../../types").AgentType[];
23
+ export declare const mockAgents: import('../../types').AgentType[];
24
24
  export declare const mockAgentState: {
25
- agents: import("../../types").AgentType[];
26
- selectedAgent: import("../../types").AgentType;
25
+ agents: import('../../types').AgentType[];
26
+ selectedAgent: import('../../types').AgentType;
27
27
  };
28
28
  export declare const mockItemsAllTypes: Array<ItemType>;
29
29
  export declare const mockLogAllTypes: {
@@ -1,4 +1,4 @@
1
- import { type ContentProps } from '../../types';
1
+ import { ContentProps } from '../../types';
2
2
  export declare const Content: ({ error, hasCustomSuggestedQuestions, hasRequestInProgress, isErrorMessageShown, isStreamingEnabled, setIsErrorMessageShown, onModalClose, questions, recordAction, showLoadingIndicator, userInfo, suggestedQuestions, askSuggestedQuestion, setAskSuggestedQuestion, useAnimation, variant, hostAppName, ...rest }: ContentProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export { type ContentProps };
4
4
  export default Content;
@@ -1,4 +1,4 @@
1
- import { type QuestionType, type RetryQuestion, type StopQuestion } from '../../types';
1
+ import { QuestionType, RetryQuestion, StopQuestion } from '../../types';
2
2
  export interface FooterProps {
3
3
  isStopResponseEnabled?: boolean;
4
4
  isStreamingEnabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { type QuestionType, type RetryQuestion, type StopQuestion, type StyleVariant, type SubmitQuestion, type UserInfoType } from '../../types';
1
+ import { QuestionType, RetryQuestion, StopQuestion, StyleVariant, SubmitQuestion, UserInfoType } from '../../types';
2
2
  export interface FooterProps {
3
3
  /** Selected suggested question */
4
4
  askSuggestedQuestion: string | undefined;
@@ -1,4 +1,4 @@
1
- import { type FooterProps } from '../footer';
1
+ import { FooterProps } from '../footer';
2
2
  export declare const questionWithoutError: {
3
3
  answer: string;
4
4
  id: string;
@@ -16,7 +16,7 @@ export declare const questionWithoutError: {
16
16
  id: string;
17
17
  isCompleted: boolean;
18
18
  isLoading: boolean;
19
- error: import("../../../types").ANSWER_ERROR;
19
+ error: import('../../../types').ANSWER_ERROR;
20
20
  prompt: string;
21
21
  citations?: undefined;
22
22
  };
@@ -37,7 +37,7 @@ export declare const questionWithError: {
37
37
  id: string;
38
38
  isCompleted: boolean;
39
39
  isLoading: boolean;
40
- error: import("../../../types").ANSWER_ERROR;
40
+ error: import('../../../types').ANSWER_ERROR;
41
41
  prompt: string;
42
42
  citations?: undefined;
43
43
  };
@@ -58,7 +58,7 @@ export declare const questionWithStreamError: {
58
58
  id: string;
59
59
  isCompleted: boolean;
60
60
  isLoading: boolean;
61
- error: import("../../../types").ANSWER_ERROR;
61
+ error: import('../../../types').ANSWER_ERROR;
62
62
  prompt: string;
63
63
  citations?: undefined;
64
64
  };
@@ -79,7 +79,7 @@ export declare const questionWithInterruptError: {
79
79
  id: string;
80
80
  isCompleted: boolean;
81
81
  isLoading: boolean;
82
- error: import("../../../types").ANSWER_ERROR;
82
+ error: import('../../../types').ANSWER_ERROR;
83
83
  prompt: string;
84
84
  citations?: undefined;
85
85
  };
@@ -100,7 +100,7 @@ export declare const questionWithStopError: {
100
100
  id: string;
101
101
  isCompleted: boolean;
102
102
  isLoading: boolean;
103
- error: import("../../../types").ANSWER_ERROR;
103
+ error: import('../../../types').ANSWER_ERROR;
104
104
  prompt: string;
105
105
  citations?: undefined;
106
106
  };
@@ -121,7 +121,7 @@ export declare const questionWithStreamIncomplete: {
121
121
  id: string;
122
122
  isCompleted: boolean;
123
123
  isLoading: boolean;
124
- error: import("../../../types").ANSWER_ERROR;
124
+ error: import('../../../types').ANSWER_ERROR;
125
125
  prompt: string;
126
126
  citations?: undefined;
127
127
  };
@@ -1,8 +1,8 @@
1
- import { type ModalProps } from '@box/blueprint-web';
2
- import { type AgentListResponse } from '@box/box-ai-agent-selector';
3
- import React from 'react';
4
- import { type BoxAiContentAnswersProps } from '../../box-ai-content-answers';
5
- import { type AgentType, type RecordActionType } from '../../types';
1
+ import { ModalProps } from '@box/blueprint-web';
2
+ import { AgentListResponse } from '@box/box-ai-agent-selector';
3
+ import { default as React } from 'react';
4
+ import { BoxAiContentAnswersProps } from '../../box-ai-content-answers';
5
+ import { AgentType, RecordActionType } from '../../types';
6
6
  export type IntelligenceModalProps = ModalProps & BoxAiContentAnswersProps & {
7
7
  /** API callback to send to AI Studio Agent Selector */
8
8
  getAIStudioAgents?(): Promise<AgentListResponse>;
@@ -1,4 +1,4 @@
1
- import { type IntelligenceModalProps } from '../modal';
1
+ import { IntelligenceModalProps } from '../modal';
2
2
  export declare const defaultProps: {
3
3
  contentName: string;
4
4
  contentType: string;
@@ -19,7 +19,7 @@ export declare const defaultProps: {
19
19
  id: string;
20
20
  isCompleted: boolean;
21
21
  isLoading: boolean;
22
- error: import("../../../types").ANSWER_ERROR;
22
+ error: import('../../../types').ANSWER_ERROR;
23
23
  prompt: string;
24
24
  citations?: undefined;
25
25
  })[];
@@ -1,2 +1,2 @@
1
- import { type ModalErrorProps } from '../modal-error';
1
+ import { ModalErrorProps } from '../modal-error';
2
2
  export declare const DefaultError: (props: ModalErrorProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type StyleVariant, type UserInfoType } from '../../types';
1
+ import { StyleVariant, UserInfoType } from '../../types';
2
2
  export interface QuestionProps {
3
3
  /** The question prompt sent to the LLM */
4
4
  prompt?: string;
@@ -1,2 +1,2 @@
1
- import { type QuestionProps } from '../question';
1
+ import { QuestionProps } from '../question';
2
2
  export declare const DefaultQuestion: (props: QuestionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import { type SuggestedQuestionType } from '../../types';
1
+ import { SuggestedQuestionType } from '../../types';
2
2
  export declare const DEFAULT_SUGGESTED_QUESTIONS: SuggestedQuestionType[];
@@ -1,3 +1,3 @@
1
- import { type SuggestedQuestionsProps } from '../suggested-questions';
1
+ import { SuggestedQuestionsProps } from '../suggested-questions';
2
2
  export declare const DefaultSuggestedQuestions: (props: SuggestedQuestionsProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export declare const defaultProps: SuggestedQuestionsProps;
@@ -1,4 +1,4 @@
1
- import { REQUEST_STATE, type StyleVariant, type SuggestedQuestionType } from '../../types';
1
+ import { REQUEST_STATE, StyleVariant, SuggestedQuestionType } from '../../types';
2
2
  export type SuggestedQuestionsProps = {
3
3
  /** Selected suggested question. DEPRECATE - Not longer needed */
4
4
  askSuggestedQuestion: string | undefined;
@@ -1,4 +1,4 @@
1
- import { type StyleVariant, type SuggestedQuestionType } from '../../types';
1
+ import { StyleVariant, SuggestedQuestionType } from '../../types';
2
2
  export type SuggestionsProps = {
3
3
  /** Selected suggested question. DEPRECATE - Not longer needed */
4
4
  askSuggestedQuestion: string | undefined;
@@ -1,4 +1,4 @@
1
- import { type ItemClickHandler, type ItemType } from '../../types';
1
+ import { ItemClickHandler, ItemType } from '../../types';
2
2
  export interface Props {
3
3
  contentName: string;
4
4
  isUsedInsideSidebar?: boolean;
@@ -1,3 +1,3 @@
1
- import { type ItemsDropdownProps } from '../../types';
1
+ import { ItemsDropdownProps } from '../../types';
2
2
  export declare const ItemsDropdown: ({ supportedItems, unsupportedItems, noPermissionItems, onItemClick, }: ItemsDropdownProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemsDropdown;
@@ -1,13 +1,13 @@
1
- import { type ItemsDropdownProps, type WelcomeMessageProps } from '../../../types';
1
+ import { ItemsDropdownProps, WelcomeMessageProps } from '../../../types';
2
2
  export declare const defaultWelcomeMessageProps: {
3
3
  contentName: string;
4
4
  contentType: string;
5
5
  useAnimation: boolean;
6
6
  };
7
7
  export declare const defaultItemsDropdownProps: {
8
- supportedItems: import("../../../types").ItemType[];
9
- unsupportedItems: import("../../../types").ItemType[];
10
- noPermissionItems: import("../../../types").ItemType[];
8
+ supportedItems: import('../../../types').ItemType[];
9
+ unsupportedItems: import('../../../types').ItemType[];
10
+ noPermissionItems: import('../../../types').ItemType[];
11
11
  onItemClick: (...args: any[]) => void;
12
12
  };
13
13
  export declare const DefaultWelcomeMessage: (props: WelcomeMessageProps) => import("react/jsx-runtime").JSX.Element;