@box/box-ai-content-answers 0.150.0 → 0.152.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/markdown.module.js +19 -0
- package/dist/esm/lib/components/answer/answer.js +123 -127
- package/dist/esm/lib/components/answer/messages.js +4 -0
- package/dist/esm/lib/components/answer/thumb-buttons.js +31 -31
- package/dist/esm/lib/components/common/inline-citation.js +47 -0
- package/dist/esm/lib/components/common/markdown-react.js +81 -59
- package/dist/esm/lib/components/common/markdown.js +723 -721
- package/dist/esm/lib/utils/inlineCitationsUtils.js +36 -0
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/bn-IN.properties +2 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/da-DK.properties +2 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/de-DE.properties +2 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-AU.properties +2 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-CA.properties +2 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-GB.properties +2 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +79 -78
- package/dist/i18n/en-x-pseudo.properties +80 -78
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-419.properties +2 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/es-ES.properties +2 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fi-FI.properties +2 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-CA.properties +2 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/fr-FR.properties +2 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/hi-IN.properties +2 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/it-IT.properties +2 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/ja-JP.properties +2 -0
- package/dist/i18n/json/src/lib/components/answer/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/ko-KR.properties +2 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nb-NO.properties +2 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/nl-NL.properties +2 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pl-PL.properties +2 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/pt-BR.properties +2 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/ru-RU.properties +2 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/sv-SE.properties +2 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/tr-TR.properties +2 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-CN.properties +2 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/i18n/zh-TW.properties +2 -0
- package/dist/styles/markdown.css +1 -7
- package/dist/styles/markdown2.css +7 -0
- package/dist/types/lib/components/answer/answer.d.ts +1 -2
- package/dist/types/lib/components/answer/messages.d.ts +5 -0
- package/dist/types/lib/components/answer/stories/shared.d.ts +15 -3
- package/dist/types/lib/components/common/inline-citation.d.ts +7 -0
- package/dist/types/lib/utils/inlineCitationsUtils.d.ts +17 -0
- package/package.json +3 -3
- package/dist/esm/lib/utils/getBoxLinks.js +0 -13
- package/dist/types/lib/utils/getBoxLinks.d.ts +0 -15
package/dist/i18n/ru-RU.js
CHANGED
|
@@ -34,6 +34,7 @@ export default {
|
|
|
34
34
|
"boxAI.contentAnswers.fileLandingText": "{numberOfItems, plural, =1 {{firstItemName}} other {{files}}}{parentItem, select, undefined {} other { в {parentItem}}}",
|
|
35
35
|
"boxAI.contentAnswers.hasQuestionsTooltip": "Возврат к ИИ Box",
|
|
36
36
|
"boxAI.contentAnswers.inlineAgentNotFoundErrorText": "Выбранный агент недоступен. Переход к агенту по умолчанию.",
|
|
37
|
+
"boxAI.contentAnswers.inlineCitationAriaLabel": "Open {fileName} in new tab",
|
|
37
38
|
"boxAI.contentAnswers.inlineErrorText": "В настоящий момент у Box AI возникают проблемы с генерацией ответа. Повторите попытку.",
|
|
38
39
|
"boxAI.contentAnswers.inlineNoContentErrorText": "Не удалось найти соответствующий контент. Повторите попытку позже или задайте другой вопрос.",
|
|
39
40
|
"boxAI.contentAnswers.inlinePreconditionFailedErrorText": "Для обработки этого {type} требуется дополнительное время. Повторите попытку позже.",
|
|
@@ -68,6 +68,8 @@ boxAI.contentAnswers.fileLandingText = {numberOfItems, plural, =1 {{firstItemNam
|
|
|
68
68
|
boxAI.contentAnswers.hasQuestionsTooltip = Возврат к ИИ Box
|
|
69
69
|
# Content Answers error message when the answer fails due to an invalid agent
|
|
70
70
|
boxAI.contentAnswers.inlineAgentNotFoundErrorText = Выбранный агент недоступен. Переход к агенту по умолчанию.
|
|
71
|
+
# Aria label for inline citation button to open file in new tab
|
|
72
|
+
boxAI.contentAnswers.inlineCitationAriaLabel = Open {fileName} in new tab
|
|
71
73
|
# Content Answers error message when the service fails
|
|
72
74
|
boxAI.contentAnswers.inlineErrorText = В настоящий момент у Box AI возникают проблемы с генерацией ответа. Повторите попытку.
|
|
73
75
|
# Content Answers error message when the service returns 204 (no content)
|
package/dist/i18n/sv-SE.js
CHANGED
|
@@ -34,6 +34,7 @@ export default {
|
|
|
34
34
|
"boxAI.contentAnswers.fileLandingText": "{numberOfItems,plural,=1{{firstItemName}} other{{files}}}{parentItem,select,undefined{} other{ in {parentItem}}}",
|
|
35
35
|
"boxAI.contentAnswers.hasQuestionsTooltip": "Återgå till Box AI Q&A",
|
|
36
36
|
"boxAI.contentAnswers.inlineAgentNotFoundErrorText": "Den valda agenten är inte tillgänglig. Växlar till standardagenten.",
|
|
37
|
+
"boxAI.contentAnswers.inlineCitationAriaLabel": "Open {fileName} in new tab",
|
|
37
38
|
"boxAI.contentAnswers.inlineErrorText": "Box AI har problem med att generera ett svar just nu. Försök igen.",
|
|
38
39
|
"boxAI.contentAnswers.inlineNoContentErrorText": "Relevant innehåll kan inte hittas. Försök igen senare eller ställ en annan fråga.",
|
|
39
40
|
"boxAI.contentAnswers.inlinePreconditionFailedErrorText": "Mer tid behövs för att bearbeta denna {type}, försök igen senare.",
|
|
@@ -68,6 +68,8 @@ boxAI.contentAnswers.fileLandingText = {numberOfItems,plural,=1{{firstItemName}}
|
|
|
68
68
|
boxAI.contentAnswers.hasQuestionsTooltip = Återgå till Box AI Q&A
|
|
69
69
|
# Content Answers error message when the answer fails due to an invalid agent
|
|
70
70
|
boxAI.contentAnswers.inlineAgentNotFoundErrorText = Den valda agenten är inte tillgänglig. Växlar till standardagenten.
|
|
71
|
+
# Aria label for inline citation button to open file in new tab
|
|
72
|
+
boxAI.contentAnswers.inlineCitationAriaLabel = Open {fileName} in new tab
|
|
71
73
|
# Content Answers error message when the service fails
|
|
72
74
|
boxAI.contentAnswers.inlineErrorText = Box AI har problem med att generera ett svar just nu. Försök igen.
|
|
73
75
|
# Content Answers error message when the service returns 204 (no content)
|
package/dist/i18n/tr-TR.js
CHANGED
|
@@ -34,6 +34,7 @@ export default {
|
|
|
34
34
|
"boxAI.contentAnswers.fileLandingText": "{numberOfItems,plural,=1{{firstItemName}} other{{files}}}{parentItem,select,other{ konum {parentItem}}}",
|
|
35
35
|
"boxAI.contentAnswers.hasQuestionsTooltip": "Box AI Soruları ve Yanıtları'na dön",
|
|
36
36
|
"boxAI.contentAnswers.inlineAgentNotFoundErrorText": "Seçilen aracıya erişilemiyor. Varsayılan aracıya geçiliyor.",
|
|
37
|
+
"boxAI.contentAnswers.inlineCitationAriaLabel": "Open {fileName} in new tab",
|
|
37
38
|
"boxAI.contentAnswers.inlineErrorText": "Box AI şu anda bir yanıt oluşturmakta sorun yaşıyor. Lütfen tekrar deneyin.",
|
|
38
39
|
"boxAI.contentAnswers.inlineNoContentErrorText": "İlgili içerik bulunamıyor. Lütfen daha sonra tekrar deneyin veya farklı bir soru sorun.",
|
|
39
40
|
"boxAI.contentAnswers.inlinePreconditionFailedErrorText": "Bu {type} işleminin gerçekleştirilmesi için ek süre gereklidir, lütfen daha sonra tekrar deneyin.",
|
|
@@ -68,6 +68,8 @@ boxAI.contentAnswers.fileLandingText = {numberOfItems,plural,=1{{firstItemName}}
|
|
|
68
68
|
boxAI.contentAnswers.hasQuestionsTooltip = Box AI Soruları ve Yanıtları'na dön
|
|
69
69
|
# Content Answers error message when the answer fails due to an invalid agent
|
|
70
70
|
boxAI.contentAnswers.inlineAgentNotFoundErrorText = Seçilen aracıya erişilemiyor. Varsayılan aracıya geçiliyor.
|
|
71
|
+
# Aria label for inline citation button to open file in new tab
|
|
72
|
+
boxAI.contentAnswers.inlineCitationAriaLabel = Open {fileName} in new tab
|
|
71
73
|
# Content Answers error message when the service fails
|
|
72
74
|
boxAI.contentAnswers.inlineErrorText = Box AI şu anda bir yanıt oluşturmakta sorun yaşıyor. Lütfen tekrar deneyin.
|
|
73
75
|
# Content Answers error message when the service returns 204 (no content)
|
package/dist/i18n/zh-CN.js
CHANGED
|
@@ -34,6 +34,7 @@ export default {
|
|
|
34
34
|
"boxAI.contentAnswers.fileLandingText": "{numberOfItems,plural,=1{{firstItemName}} other{{files}}}{parentItem,select,other{ (位于 {parentItem})}}",
|
|
35
35
|
"boxAI.contentAnswers.hasQuestionsTooltip": "返回至 Box AI 常见问题解答",
|
|
36
36
|
"boxAI.contentAnswers.inlineAgentNotFoundErrorText": "选定的代理不可用。切换到默认代理。",
|
|
37
|
+
"boxAI.contentAnswers.inlineCitationAriaLabel": "Open {fileName} in new tab",
|
|
37
38
|
"boxAI.contentAnswers.inlineErrorText": "Box AI 当前无法生成响应。请重试。",
|
|
38
39
|
"boxAI.contentAnswers.inlineNoContentErrorText": "无法找到相关内容。请稍后重试,或询问不同问题。",
|
|
39
40
|
"boxAI.contentAnswers.inlinePreconditionFailedErrorText": "处理此 {type} 需要额外的时间,请稍后重试。",
|
|
@@ -68,6 +68,8 @@ boxAI.contentAnswers.fileLandingText = {numberOfItems,plural,=1{{firstItemName}}
|
|
|
68
68
|
boxAI.contentAnswers.hasQuestionsTooltip = 返回至 Box AI 常见问题解答
|
|
69
69
|
# Content Answers error message when the answer fails due to an invalid agent
|
|
70
70
|
boxAI.contentAnswers.inlineAgentNotFoundErrorText = 选定的代理不可用。切换到默认代理。
|
|
71
|
+
# Aria label for inline citation button to open file in new tab
|
|
72
|
+
boxAI.contentAnswers.inlineCitationAriaLabel = Open {fileName} in new tab
|
|
71
73
|
# Content Answers error message when the service fails
|
|
72
74
|
boxAI.contentAnswers.inlineErrorText = Box AI 当前无法生成响应。请重试。
|
|
73
75
|
# Content Answers error message when the service returns 204 (no content)
|
package/dist/i18n/zh-TW.js
CHANGED
|
@@ -34,6 +34,7 @@ export default {
|
|
|
34
34
|
"boxAI.contentAnswers.fileLandingText": "{numberOfItems,plural,=1{{firstItemName}} other{{files}}}{parentItem,select,other{ 於 {parentItem}}}",
|
|
35
35
|
"boxAI.contentAnswers.hasQuestionsTooltip": "返回 Box AI",
|
|
36
36
|
"boxAI.contentAnswers.inlineAgentNotFoundErrorText": "選擇的代理無法使用。切換至預設代理。",
|
|
37
|
+
"boxAI.contentAnswers.inlineCitationAriaLabel": "Open {fileName} in new tab",
|
|
37
38
|
"boxAI.contentAnswers.inlineErrorText": "Box AI 目前無法產生回應。請再試一次。",
|
|
38
39
|
"boxAI.contentAnswers.inlineNoContentErrorText": "無法找到相關內容。 請稍後再試一次,或詢問不同的問題。",
|
|
39
40
|
"boxAI.contentAnswers.inlinePreconditionFailedErrorText": "處理此 {type} 需要更長時間,請稍後再試一次。",
|
|
@@ -68,6 +68,8 @@ boxAI.contentAnswers.fileLandingText = {numberOfItems,plural,=1{{firstItemName}}
|
|
|
68
68
|
boxAI.contentAnswers.hasQuestionsTooltip = 返回 Box AI
|
|
69
69
|
# Content Answers error message when the answer fails due to an invalid agent
|
|
70
70
|
boxAI.contentAnswers.inlineAgentNotFoundErrorText = 選擇的代理無法使用。切換至預設代理。
|
|
71
|
+
# Aria label for inline citation button to open file in new tab
|
|
72
|
+
boxAI.contentAnswers.inlineCitationAriaLabel = Open {fileName} in new tab
|
|
71
73
|
# Content Answers error message when the service fails
|
|
72
74
|
boxAI.contentAnswers.inlineErrorText = Box AI 目前無法產生回應。請再試一次。
|
|
73
75
|
# Content Answers error message when the service returns 204 (no content)
|
package/dist/styles/markdown.css
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Theme: a11y-dark
|
|
3
|
-
Author: @ericwbailey
|
|
4
|
-
Maintainer: @ericwbailey
|
|
5
|
-
|
|
6
|
-
Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css
|
|
7
|
-
*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast:active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}._tableWrapper_15th0_1{margin:1.25rem 0;overflow-x:auto}._tableWrapper_15th0_1 table{width:max-content;min-width:100%;border-collapse:collapse}._tableWrapper_15th0_1 table,._tableWrapper_15th0_1 th,._tableWrapper_15th0_1 td{padding:.5rem .75rem;border:.0625rem solid #e8e8e8}._tableWrapper_15th0_1 th{font-weight:var(--title-medium-font-weight);font-size:var(--title-medium-font-size);font-family:var(--title-medium-font-family);line-height:var(--title-medium-line-height);letter-spacing:var(--title-medium-letter-spacing);text-transform:var(--title-medium-text-case);text-decoration:var(--title-medium-text-decoration);color:#222;background-color:#f4f4f4}._tableWrapper_15th0_1 th,._tableWrapper_15th0_1 td{max-width:15rem}._hljs_15th0_32{position:relative;display:flex;flex-direction:column;overflow-x:auto;background:#222}._hljs_15th0_32 code{display:grid;white-space:pre}._hljsLanguage_15th0_44{position:sticky;top:0;left:0;padding:.5rem .75rem;color:#fff;background:#383838;border-bottom:.0625rem solid #4e4e4e;font-weight:var(--title-medium-font-weight);font-size:var(--title-medium-font-size);font-family:var(--title-medium-font-family);line-height:var(--title-medium-line-height);letter-spacing:var(--title-medium-letter-spacing);text-transform:var(--title-medium-text-case);text-decoration:var(--title-medium-text-decoration)}._hljsContent_15th0_61{flex:1 1 auto;padding:1.25rem}._hljsLine_15th0_66{display:flex;align-items:flex-start}._hljsLineNumber_15th0_71{flex:0 0 auto;box-sizing:border-box;width:2.5rem;padding:.5rem .25rem;color:#a7a7a7;text-align:center;background:#383838;border-right:.0625rem solid #4e4e4e;-webkit-user-select:none;user-select:none}._hljsLineContent_15th0_83{padding:.5rem 0 0 .25rem;overflow:hidden}
|
|
1
|
+
._markdownContent_hd94b_1{display:block}._inlineParagraph_hd94b_5{display:block;margin:0 0 1em;line-height:1.6}._tableWrapper_hd94b_11{margin:var(--space-5) 0;overflow-x:auto}._tableWrapper_hd94b_11 table{width:max-content;min-width:100%;border-collapse:collapse}._tableWrapper_hd94b_11 table,._tableWrapper_hd94b_11 th,._tableWrapper_hd94b_11 td{padding:var(--space-2) var(--space-3);border:var(--border-1) solid var(--gray-10)}._tableWrapper_hd94b_11 th{color:var(--text-text-on-light);font-weight:var(--bp-font-weight-semibold);font-size:var(--bp-font-size-05);line-height:var(--bp-font-line-height-05);background-color:var(--gray-05)}._tableWrapper_hd94b_11 th,._tableWrapper_hd94b_11 td{max-width:calc(var(--space-20) * 3)}._hljs_hd94b_38{position:relative;display:flex;flex-direction:column;overflow-x:auto;background:var(--gray-100)}._hljs_hd94b_38 code{display:grid;white-space:pre}._hljsLanguage_hd94b_50{position:sticky;top:0;left:0;padding:var(--space-2) var(--space-3);color:var(--gray-white);font-weight:var(--bp-font-weight-semibold);font-size:var(--bp-font-size-05);line-height:var(--bp-font-line-height-05);background:var(--gray-90);border-bottom:var(--border-1) solid var(--gray-80)}._hljsContent_hd94b_63{flex:1 1 auto;padding:var(--space-5)}._hljsLine_hd94b_68{display:flex;align-items:flex-start}._hljsLineNumber_hd94b_73{flex:0 0 auto;box-sizing:border-box;width:var(--size-10);padding:var(--space-2) var(--space-1);color:var(--gray-40);text-align:center;background:var(--gray-90);border-right:var(--border-1) solid var(--gray-80);-webkit-user-select:none;user-select:none}._hljsLineContent_hd94b_85{padding:var(--space-2) 0 0 var(--space-1);overflow:hidden}._inlineCitationGroup_hd94b_90{display:inline-flex;max-width:calc(var(--size-20) * 2.5);vertical-align:baseline}._inlineCitationGroup_hd94b_90 ._inline-citation-chip-button_hd94b_95{display:flex;gap:var(--space-2);align-items:center;min-width:0;max-width:100%;overflow:hidden}._inlineCitationGroup_hd94b_90 ._inline-citation-chip-button_hd94b_95 svg,._inlineCitationGroup_hd94b_90 ._inline-citation-chip-button_hd94b_95 ._inline-citation-file-icon_hd94b_104{flex-shrink:0;width:var(--size-5);height:var(--size-5)}._inlineCitationGroup_hd94b_90 ._inline-citation-chip-button_hd94b_95 ._bp-filter-chip-label_hd94b_109,._inlineCitationGroup_hd94b_90 ._inline-citation-chip-button_hd94b_95 ._inline-citation-filename-label_hd94b_110{flex:1 1 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
|
+
Theme: a11y-dark
|
|
3
|
+
Author: @ericwbailey
|
|
4
|
+
Maintainer: @ericwbailey
|
|
5
|
+
|
|
6
|
+
Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css
|
|
7
|
+
*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast:active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ANSWER_ERROR, CitationType, FeedbackFormData, FeedbackValue, ItemClickHandler, ItemType, PromptType, RecordActionType, StyleVariant } from '../../types';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
export interface AnswerProps {
|
|
4
3
|
answer?: string;
|
|
5
4
|
/** Citations list */
|
|
@@ -52,5 +51,5 @@ export interface AnswerProps {
|
|
|
52
51
|
/** ID of a question that this answer answers to, used for providing feedback */
|
|
53
52
|
questionId?: string;
|
|
54
53
|
}
|
|
55
|
-
export declare const Answer:
|
|
54
|
+
export declare const Answer: import('react').NamedExoticComponent<AnswerProps>;
|
|
56
55
|
export default Answer;
|
|
@@ -55,15 +55,20 @@ export declare const testItemsWithBoxUrls: {
|
|
|
55
55
|
id: string;
|
|
56
56
|
name: string;
|
|
57
57
|
type: string;
|
|
58
|
-
url: string;
|
|
59
58
|
}[];
|
|
60
59
|
export declare const testItemsWithNonBoxUrls: {
|
|
61
60
|
id: string;
|
|
62
61
|
name: string;
|
|
63
62
|
type: string;
|
|
64
|
-
url: string;
|
|
65
63
|
}[];
|
|
66
|
-
export declare const
|
|
64
|
+
export declare const answerWithBoxUrls = "This answer contains Box files like document.pdf and presentation.pptx. These Box links should be clickable in legacy mode.";
|
|
65
|
+
export declare const answerWithNonBoxUrls = "This answer contains external files like document.pdf and presentation.pptx. These external links should show as plain text with URLs in parentheses in legacy mode.";
|
|
66
|
+
export declare const answerWithMixedUrls = "This answer contains both Box files like [document.pdf](https://app.box.com/file/123) and external links like [external doc](https://example.com/doc). The Box links should be clickable in legacy mode, while external links should show the URL in parentheses.";
|
|
67
|
+
export declare const answerWithBoxUrlsMarkdown = "This answer contains Box files like [document.pdf](https://app.box.com/file/123) and [presentation.pptx](https://app.box.com/file/456). These Box links should be clickable in legacy mode.";
|
|
68
|
+
export declare const answerWithNonBoxUrlsMarkdown = "This answer contains external files like [document.pdf](https://example.com/file/123) and [presentation.pptx](https://external-site.com/file/456). These external links should show as plain text with URLs in parentheses in legacy mode.";
|
|
69
|
+
export declare const answerWithMixedUrlsMarkdown = "This answer contains both Box files like [document.pdf](https://app.box.com/file/123) and external links like [external doc](https://example.com/doc). The Box links should be clickable in legacy mode, while external links should show the URL in parentheses.";
|
|
70
|
+
export declare const answerWithReactModeCitations = "This answer contains Box files like [document.pdf](https://app.box.com/file/123) and [presentation.pptx](https://app.box.com/file/456). These should render as FilterChip components in React mode.";
|
|
71
|
+
export declare const answerWithReactModeMixedUrls = "This answer contains both Box files like [document.pdf](https://app.box.com/file/123) and external files like [external-doc.pdf](https://external-site.com/file/999). Box files should be FilterChip components, external files should be plain text.";
|
|
67
72
|
export declare const expectedAnswerWithMixedUrls = "This answer contains both Box files like <a href=\"https://app.box.com/file/123\" target=\"_blank\">document.pdf</a> and external links like external doc (https://example.com/doc). The Box links should be clickable, while external links should show the URL in parentheses.";
|
|
68
73
|
export declare const DefaultAnswer: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
74
|
export declare const StoppedAnswer: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -84,3 +89,10 @@ export declare const AnswerWithInlineCitationsNullItems: (props: AnswerProps) =>
|
|
|
84
89
|
export declare const AnswerWithBoxUrls: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
85
90
|
export declare const AnswerWithNonBoxUrls: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
86
91
|
export declare const AnswerWithMixedUrlTypes: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
export declare const AnswerWithBoxUrlsReact: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
export declare const AnswerWithNonBoxUrlsReact: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
export declare const AnswerWithBoxUrlsMarkdown: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
export declare const AnswerWithNonBoxUrlsMarkdown: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
export declare const AnswerWithMixedUrlsMarkdown: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
export declare const AnswerWithReactModeCitations: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
export declare const AnswerWithReactModeMixedUrls: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface InjectInlineCitationOptions {
|
|
2
|
+
items?: Array<{
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}>;
|
|
6
|
+
isCompleted?: boolean;
|
|
7
|
+
isInlineCitationsEnabled?: boolean;
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const isBoxDomain: (url: string) => boolean;
|
|
11
|
+
export declare const isBoxCitation: (url: string) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Injects inline citations into markdown text by converting file references to markdown links.
|
|
14
|
+
* Supports multiple formats: (filename.pdf), "filename.pptx", filename.js, [filename.pdf], {filename.pdf}
|
|
15
|
+
*/
|
|
16
|
+
export declare const injectInlineCitation: (text: string, options?: InjectInlineCitationOptions) => string;
|
|
17
|
+
export default injectInlineCitation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.152.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.56.1",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
20
20
|
"@box/blueprint-web": "^12.76.0",
|
|
21
21
|
"@box/blueprint-web-assets": "^4.68.0",
|
|
22
|
-
"@box/box-ai-agent-selector": "^0.
|
|
23
|
-
"@box/item-icon": "^0.
|
|
22
|
+
"@box/box-ai-agent-selector": "^0.62.0",
|
|
23
|
+
"@box/item-icon": "^0.26.0",
|
|
24
24
|
"@box/storybook-utils": "^0.14.4",
|
|
25
25
|
"@testing-library/react": "^15.0.6",
|
|
26
26
|
"react": "^18.3.0",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BOX_SUPPORTED_FILE_EXTENSIONS as o } from "./constants.js";
|
|
2
|
-
function s(t) {
|
|
3
|
-
const e = /(https?:\/\/([^\/\s\)]+\.)?box\.com[^\s\)]*)/gi, n = t.match(e) || [];
|
|
4
|
-
return [...new Set(n)];
|
|
5
|
-
}
|
|
6
|
-
function i(t) {
|
|
7
|
-
const e = new RegExp(`\\b[\\w\\-.]+\\.(${o.join("|")})\\b`, "gi"), n = t.match(e) || [];
|
|
8
|
-
return [...new Set(n)];
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
s as extractBoxLinks,
|
|
12
|
-
i as extractFileNames
|
|
13
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for tracking files and links in AI responses
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Gets all box.com file links from text
|
|
6
|
-
* @param text - The text content to analyze
|
|
7
|
-
* @returns Array of box.com file links
|
|
8
|
-
*/
|
|
9
|
-
export declare function extractBoxLinks(text: string): string[];
|
|
10
|
-
/**
|
|
11
|
-
* Extracts file names with extensions from text content
|
|
12
|
-
* @param text - The text content to analyze
|
|
13
|
-
* @returns Array of detected file names
|
|
14
|
-
*/
|
|
15
|
-
export declare function extractFileNames(text: string): string[];
|