@box/box-ai-content-answers 1.1.5 → 1.3.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 (54) hide show
  1. package/dist/esm/lib/components/answer/answer-content.js +12 -12
  2. package/dist/esm/lib/components/answer/copy-button.js +37 -27
  3. package/dist/esm/lib/components/common/markdown.js +18 -17
  4. package/dist/i18n/bn-IN.js +1 -1
  5. package/dist/i18n/bn-IN.properties +1 -1
  6. package/dist/i18n/da-DK.js +1 -1
  7. package/dist/i18n/da-DK.properties +1 -1
  8. package/dist/i18n/de-DE.js +1 -1
  9. package/dist/i18n/de-DE.properties +1 -1
  10. package/dist/i18n/en-AU.js +1 -1
  11. package/dist/i18n/en-AU.properties +1 -1
  12. package/dist/i18n/en-GB.js +1 -1
  13. package/dist/i18n/en-GB.properties +1 -1
  14. package/dist/i18n/en-x-pseudo.js +88 -88
  15. package/dist/i18n/en-x-pseudo.properties +88 -88
  16. package/dist/i18n/es-419.js +1 -1
  17. package/dist/i18n/es-419.properties +1 -1
  18. package/dist/i18n/es-ES.js +1 -1
  19. package/dist/i18n/es-ES.properties +1 -1
  20. package/dist/i18n/fi-FI.js +1 -1
  21. package/dist/i18n/fi-FI.properties +1 -1
  22. package/dist/i18n/fr-CA.js +1 -1
  23. package/dist/i18n/fr-CA.properties +1 -1
  24. package/dist/i18n/fr-FR.js +1 -1
  25. package/dist/i18n/fr-FR.properties +1 -1
  26. package/dist/i18n/hi-IN.js +1 -1
  27. package/dist/i18n/hi-IN.properties +1 -1
  28. package/dist/i18n/it-IT.js +1 -1
  29. package/dist/i18n/it-IT.properties +1 -1
  30. package/dist/i18n/ja-JP.js +1 -1
  31. package/dist/i18n/ja-JP.properties +1 -1
  32. package/dist/i18n/ko-KR.js +1 -1
  33. package/dist/i18n/ko-KR.properties +1 -1
  34. package/dist/i18n/nb-NO.js +1 -1
  35. package/dist/i18n/nb-NO.properties +1 -1
  36. package/dist/i18n/nl-NL.js +1 -1
  37. package/dist/i18n/nl-NL.properties +1 -1
  38. package/dist/i18n/pl-PL.js +1 -1
  39. package/dist/i18n/pl-PL.properties +1 -1
  40. package/dist/i18n/pt-BR.js +1 -1
  41. package/dist/i18n/pt-BR.properties +1 -1
  42. package/dist/i18n/ru-RU.js +1 -1
  43. package/dist/i18n/ru-RU.properties +1 -1
  44. package/dist/i18n/sv-SE.js +1 -1
  45. package/dist/i18n/sv-SE.properties +1 -1
  46. package/dist/i18n/tr-TR.js +1 -1
  47. package/dist/i18n/tr-TR.properties +1 -1
  48. package/dist/i18n/zh-CN.js +1 -1
  49. package/dist/i18n/zh-CN.properties +1 -1
  50. package/dist/i18n/zh-TW.js +1 -1
  51. package/dist/i18n/zh-TW.properties +1 -1
  52. package/dist/types/lib/components/answer/stories/shared.d.ts +3 -0
  53. package/dist/types/lib/components/common/markdown.d.ts +7 -2
  54. package/package.json +6 -6
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  "boxAI.contentAnswers.addToNote": "Lägg till anteckning",
3
3
  "boxAI.contentAnswers.addedToNote": "Tillagd",
4
- "boxAI.contentAnswers.analyzingRequest": "Analyserar din begäran",
4
+ "boxAI.contentAnswers.analyzingRequest": "Analyserar",
5
5
  "boxAI.contentAnswers.ariaTypeSuccessIconLabel": "lyckades",
6
6
  "boxAI.contentAnswers.ask": "Fråga",
7
7
  "boxAI.contentAnswers.askDisabledTooltip": "Du kan skicka en ännu en fråga när Box AI har slutat svara",
@@ -3,7 +3,7 @@ boxAI.contentAnswers.addToNote = Lägg till anteckning
3
3
  # Added to note confirmation text
4
4
  boxAI.contentAnswers.addedToNote = Tillagd
5
5
  # Text shown next to the loading indicator while analyzing the request
6
- boxAI.contentAnswers.analyzingRequest = Analyserar din begäran
6
+ boxAI.contentAnswers.analyzingRequest = Analyserar
7
7
  # Notification banner success icon aria label
8
8
  boxAI.contentAnswers.ariaTypeSuccessIconLabel = lyckades
9
9
  # Content Answers submit input button text
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  "boxAI.contentAnswers.addToNote": "Nota ekle",
3
3
  "boxAI.contentAnswers.addedToNote": "Eklendi",
4
- "boxAI.contentAnswers.analyzingRequest": "İsteğiniz analiz ediliyor",
4
+ "boxAI.contentAnswers.analyzingRequest": "Analiz Ediliyor…",
5
5
  "boxAI.contentAnswers.ariaTypeSuccessIconLabel": "başarılı",
6
6
  "boxAI.contentAnswers.ask": "Sor",
7
7
  "boxAI.contentAnswers.askDisabledTooltip": "Box AI yanıt vermeyi bitirdikten sonra başka bir soru gönderebilirsiniz",
@@ -3,7 +3,7 @@ boxAI.contentAnswers.addToNote = Nota ekle
3
3
  # Added to note confirmation text
4
4
  boxAI.contentAnswers.addedToNote = Eklendi
5
5
  # Text shown next to the loading indicator while analyzing the request
6
- boxAI.contentAnswers.analyzingRequest = İsteğiniz analiz ediliyor
6
+ boxAI.contentAnswers.analyzingRequest = Analiz Ediliyor…
7
7
  # Notification banner success icon aria label
8
8
  boxAI.contentAnswers.ariaTypeSuccessIconLabel = başarılı
9
9
  # Content Answers submit input button text
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  "boxAI.contentAnswers.addToNote": "添加到注释",
3
3
  "boxAI.contentAnswers.addedToNote": "已添加",
4
- "boxAI.contentAnswers.analyzingRequest": "正在分析您的请求",
4
+ "boxAI.contentAnswers.analyzingRequest": "正在分析…",
5
5
  "boxAI.contentAnswers.ariaTypeSuccessIconLabel": "成功",
6
6
  "boxAI.contentAnswers.ask": "询问",
7
7
  "boxAI.contentAnswers.askDisabledTooltip": "您可以在 Box AI 完成响应后提交另一个问题",
@@ -3,7 +3,7 @@ boxAI.contentAnswers.addToNote = 添加到注释
3
3
  # Added to note confirmation text
4
4
  boxAI.contentAnswers.addedToNote = 已添加
5
5
  # Text shown next to the loading indicator while analyzing the request
6
- boxAI.contentAnswers.analyzingRequest = 正在分析您的请求
6
+ boxAI.contentAnswers.analyzingRequest = 正在分析…
7
7
  # Notification banner success icon aria label
8
8
  boxAI.contentAnswers.ariaTypeSuccessIconLabel = 成功
9
9
  # Content Answers submit input button text
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  "boxAI.contentAnswers.addToNote": "新增至記事",
3
3
  "boxAI.contentAnswers.addedToNote": "已新增",
4
- "boxAI.contentAnswers.analyzingRequest": "正在分析您的要求",
4
+ "boxAI.contentAnswers.analyzingRequest": "分析中…",
5
5
  "boxAI.contentAnswers.ariaTypeSuccessIconLabel": "成功",
6
6
  "boxAI.contentAnswers.ask": "詢問",
7
7
  "boxAI.contentAnswers.askDisabledTooltip": "您可在 Box AI 完成回覆後提交另一個問題",
@@ -3,7 +3,7 @@ boxAI.contentAnswers.addToNote = 新增至記事
3
3
  # Added to note confirmation text
4
4
  boxAI.contentAnswers.addedToNote = 已新增
5
5
  # Text shown next to the loading indicator while analyzing the request
6
- boxAI.contentAnswers.analyzingRequest = 正在分析您的要求
6
+ boxAI.contentAnswers.analyzingRequest = 分析中…
7
7
  # Notification banner success icon aria label
8
8
  boxAI.contentAnswers.ariaTypeSuccessIconLabel = 成功
9
9
  # Content Answers submit input button text
@@ -30,6 +30,7 @@ export declare const citationsFromHubsMetadata: {
30
30
  export declare const answerWithLargeTable = "\n| English | Spanish | French | German | Italian | Portuguese | Dutch | Russian | Japanese | Color | Origin | Taste | Uses | Season | Nutritional Benefits |\n|---------------|---------------|---------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|---------------------|------------------|-------------------------------------------|\n| Apple | Manzana | Pomme | Apfel | Mela | Ma\u00E7\u00E3 | Appel | \u042F\u0431\u043B\u043E\u043A\u043E | \u308A\u3093\u3054 | Red | Europe | Sweet | Eating, Cooking | Autumn | High in fiber, vitamin C |\n| Banana | Pl\u00E1tano | Banane | Banane | Banana | Banana | Banaan | \u0411\u0430\u043D\u0430\u043D | \u30D0\u30CA\u30CA | Yellow | Tropical | Sweet | Eating, Smoothies | Year-round | High in potassium, vitamin B6 |\n| Orange | Naranja | Orange | Orange | Arancia | Laranja | Sinaasappel | \u0410\u043F\u0435\u043B\u044C\u0441\u0438\u043D | \u30AA\u30EC\u30F3\u30B8 | Orange | Asia | Tangy | Juice, Eating | Winter | High in vitamin C, antioxidants |\n| Grape | Uva | Raisin | Traube | Uva | Uva | Druif | \u0412\u0438\u043D\u043E\u0433\u0440\u0430\u0434 | \u3076\u3069\u3046 | Purple | Europe | Sweet | Eating, Wine | Autumn | High in antioxidants |\n| Strawberry | Fresa | Fraisier | Erdbeere | Fragola | Morango | Aardbei | \u041A\u043B\u0443\u0431\u043D\u0438\u043A\u0430 | \u3044\u3061\u3054 | Red | Europe | Sweet | Eating, Desserts | Spring | High in vitamin C, fiber |\n| Blueberry | Ar\u00E1ndano | Myrtille | Heidelbeere | Mirtillo | Mirtilo | Bosbes | \u0413\u043E\u043B\u0443\u0431\u0438\u043A\u0430 | \u30D6\u30EB\u30FC\u30D9\u30EA\u30FC | Blue | North America| Sweet | Eating, Baking | Summer | High in antioxidants |\n| Lemon | Lim\u00F3n | Citron | Zitrone | Limone | Lim\u00E3o | Citroen | \u041B\u0438\u043C\u043E\u043D | \u30EC\u30E2\u30F3 | Yellow | Asia | Sour | Juice, Cooking | Year-round | High in vitamin C, aids digestion |\n| Pineapple | Pi\u00F1a | Ananas | Ananas | Ananas | Abacaxi | Ananas | \u0410\u043D\u0430\u043D\u0430\u0441 | \u30D1\u30A4\u30CA\u30C3\u30D7\u30EB | Brown/Yellow | South America| Sweet | Eating, Juicing | Summer | Rich in vitamin C, aids digestion |\n| Watermelon | Sand\u00EDa | Past\u00E8que | Wassermelone | Anguria | Melancia | Watermeloen | \u0410\u0440\u0431\u0443\u0437 | \u30B9\u30A4\u30AB | Green/Red | Africa | Sweet | Eating, Juicing | Summer | Hydrating, low in calories |\n| Cherry | Cereza | Cerise | Kirsche | Ciliegia | Cereja | Kers | \u0412\u0438\u0448\u043D\u044F | \u3055\u304F\u3089\u3093\u307C | Red | Europe | Sweet | Eating, Desserts | Spring | High in antioxidants, anti-inflammatory |\nLorem 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.\n";
31
31
  export declare const answerWithTable = "\n| English | Spanish | Color |\n|---------------|---------------|-------------|\n| Apple | Manzana | Red |\n| Banana | Pl\u00E1tano | Yellow |\n| Orange | Naranja | Orange |\n| Grape | Uva | Purple |\n| Strawberry | Fresa | Red |\n| Blueberry | Ar\u00E1ndano | Blue |\n| Lemon | Lim\u00F3n | Yellow |\n| Pineapple | Pi\u00F1a | Brown/Yellow|\n| Watermelon | Sand\u00EDa | Green/Red |\n| Cherry | Cereza | Red |\n";
32
32
  export declare const answerWithCodeBlocks = "\nCode Blocks\n```html\n<div>\n <p>This is a paragraph inside a &lt;div&gt; block.</p>\n</div>\n```\n\n```\nfunction greet(name) {\n console.log('Hello, ' + name + '!');\n}\n\ngreet('World');\n```\n\n```c++\n#include <iostream>\n\nint main() {\n std::cout << \"Hello, world! This is a long line that will cause overflow in the code block when displayed on a narrow screen or container.\" << std::endl;\n return 0;\n}\n```\n";
33
+ export declare const comprehensiveMarkdownAnswer = "\n# Comprehensive AI Answer with All Markdown Features\n\nThis is a comprehensive mock AI answer designed to test all markdown rendering capabilities in the Box AI content answers system.\n\n## Text Formatting\n\nHere we demonstrate various text formatting options:\n\n- **Bold text** using double asterisks\n- *Italic text* using single asterisks \n- ***Bold and italic*** using triple asterisks\n- ~~Strikethrough text~~ using double tildes\n- `Inline code` using backticks\n- [External link](https://www.example.com) to external websites\n- [Box file link](https://app.box.com/file/123) to Box documents\n\n## Headers\n\nWe support all header levels:\n\n# Header 1\n## Header 2 \n### Header 3\n#### Header 4\n##### Header 5\n###### Header 6\n\n## Lists\n\n### Unordered Lists\n- First item\n- Second item\n - Nested item A\n - Nested item B\n - Deeply nested item\n- Third item\n\n### Ordered Lists\n1. First numbered item\n2. Second numbered item\n 1. Nested numbered item A\n 2. Nested numbered item B\n 1. Deeply nested numbered item\n3. Third numbered item\n\n### Mixed Lists\n1. Ordered item with unordered sub-items\n - Unordered sub-item 1\n - Unordered sub-item 2\n2. Another ordered item\n - More unordered content\n - Even more content\n\n## Code Blocks\n\n### JavaScript\n```javascript\nfunction calculateSum(a, b) {\n return a + b;\n}\n\nconst result = calculateSum(5, 3);\nconsole.log('Result:', result);\n```\n\n### Python\n```python\ndef fibonacci(n):\n if n <= 1:\n return n\n return fibonacci(n-1) + fibonacci(n-2)\n\n# Calculate first 10 Fibonacci numbers\nfor i in range(10):\n print(f\"F({i}) = {fibonacci(i)}\")\n```\n\n### HTML\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Sample Page</title>\n</head>\n<body>\n <h1>Welcome to our site</h1>\n <p>This is a sample paragraph with <strong>bold</strong> and <em>italic</em> text.</p>\n</body>\n</html>\n```\n\n### CSS\n```css\n.container {\n max-width: 1200px;\n margin: 0 auto;\n padding: 20px;\n}\n\n.button {\n background-color: #007bff;\n color: white;\n padding: 10px 20px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n}\n\n.button:hover {\n background-color: #0056b3;\n}\n```\n\n## Tables\n\n### Simple Table\n| Feature | Status | Notes |\n|---------|--------|-------|\n| Headers | \u2705 | All 6 levels supported |\n| Lists | \u2705 | Ordered, unordered, mixed |\n| Code | \u2705 | Inline and blocks |\n| Links | \u2705 | External and Box files |\n\n### Complex Table\n| Language | Type | Paradigm | Popularity | Use Cases |\n|----------|------|----------|------------|-----------|\n| JavaScript | Dynamic | Multi-paradigm | Very High | Web development, Node.js |\n| Python | Dynamic | Multi-paradigm | Very High | Data science, AI, web |\n| Java | Static | Object-oriented | High | Enterprise, Android |\n| C++ | Static | Multi-paradigm | High | Systems, games, performance |\n| Rust | Static | Multi-paradigm | Growing | Systems, safety-critical |\n\n## Blockquotes\n\n> This is a simple blockquote. It can contain multiple lines and will be properly formatted.\n\n> **Important Note:** Blockquotes can also contain other markdown elements like **bold text** and [links](https://example.com).\n\n> ### Blockquote with Header\n> \n> This blockquote contains a header and demonstrates how nested elements work within blockquotes.\n\n## Horizontal Rules\n\nWe can use horizontal rules to separate sections:\n\n---\n\n## Footnotes\n\nHere's some text with a footnote[^1] and another footnote[^2].\n\n[^1]: This is the first footnote with additional information.\n[^2]: This is the second footnote that might contain links to [external resources](https://example.com).\n\n## Task Lists\n\n- [x] Implement basic markdown support\n- [x] Add code block syntax highlighting \n- [x] Support tables and lists\n- [ ] Add custom components for Box files\n- [ ] Implement advanced table features\n- [ ] Add support for mathematical expressions\n\n## Mixed Content Example\n\nHere's a paragraph that combines multiple markdown features:\n\nThe **Box AI system** supports various content types including:\n1. *Text documents* with formatting\n2. `Code files` with syntax highlighting\n3. [Spreadsheets](https://app.box.com/file/456) with data analysis\n4. [Presentations](https://app.box.com/file/789) with visual content\n\n> **Pro Tip:** You can reference multiple file types in a single answer, and the system will automatically create clickable links to Box files while showing external links with their URLs.\n\n---\n\n## Conclusion\n\nThis comprehensive example demonstrates the full range of markdown features supported by the Box AI content answers system. All elements should render correctly in both legacy and React markdown modes.\n\n**Key Features Tested:**\n- \u2705 Headers (H1-H6)\n- \u2705 Text formatting (bold, italic, strikethrough, code)\n- \u2705 Lists (ordered, unordered, mixed, nested)\n- \u2705 Code blocks with syntax highlighting\n- \u2705 Tables (simple and complex)\n- \u2705 Blockquotes\n- \u2705 Links (external and Box files)\n- \u2705 Horizontal rules\n- \u2705 Footnotes\n- \u2705 Task lists\n- \u2705 Mixed content scenarios\n";
33
34
  export declare const testItems: {
34
35
  id: string;
35
36
  name: string;
@@ -104,3 +105,5 @@ export declare const AnswerWithNonBoxUrlsMarkdown: (props: AnswerProps) => impor
104
105
  export declare const AnswerWithMixedUrlsMarkdown: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
105
106
  export declare const AnswerWithReactModeCitations: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
106
107
  export declare const AnswerWithReactModeMixedUrls: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
108
+ export declare const AnswerWithComprehensiveMarkdown: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
109
+ export declare const AnswerWithComprehensiveMarkdownReact: (props: AnswerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,7 @@
1
- declare const md: any;
2
- export default md;
1
+ /**
2
+ * Renders markdown content to HTML string.
3
+ * This abstraction makes it easier to replace the underlying markdown library in the future.
4
+ * @param content - The markdown content to render
5
+ * @returns The rendered HTML string
6
+ */
7
+ export declare const markdownToHtmlString: (content: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "1.1.5",
3
+ "version": "1.3.0",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.56.1",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^12.85.0",
21
- "@box/blueprint-web-assets": "^4.72.0",
22
- "@box/box-ai-agent-selector": "^1.1.4",
23
- "@box/item-icon": "^1.1.4",
24
- "@box/storybook-utils": "^0.14.8",
20
+ "@box/blueprint-web": "^12.85.1",
21
+ "@box/blueprint-web-assets": "^4.73.0",
22
+ "@box/box-ai-agent-selector": "^1.2.0",
23
+ "@box/item-icon": "^1.2.0",
24
+ "@box/storybook-utils": "^0.14.9",
25
25
  "@testing-library/react": "^15.0.6",
26
26
  "react": "^18.3.0",
27
27
  "react-dom": "^18.3.0",