reachat 2.0.0-beta.0 → 2.0.0-beta.1
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/AppBar/AppBar.d.ts +13 -0
- package/dist/AppBar/index.d.ts +1 -0
- package/dist/{CSVFileRenderer-Bn_xBvPJ.js → CSVFileRenderer-C95MrG0M.js} +2 -2
- package/dist/{CSVFileRenderer-Bn_xBvPJ.js.map → CSVFileRenderer-C95MrG0M.js.map} +1 -1
- package/dist/ChatBubble/ChatBubble.d.ts +31 -0
- package/dist/ChatBubble/index.d.ts +1 -0
- package/dist/{DefaultFileRenderer-CSWfBI1o.js → DefaultFileRenderer-Chpp-Qiu.js} +2 -2
- package/dist/{DefaultFileRenderer-CSWfBI1o.js.map → DefaultFileRenderer-Chpp-Qiu.js.map} +1 -1
- package/dist/SessionMessages/SessionMessagePanel.d.ts +5 -1
- package/dist/SessionsList/SessionsList.d.ts +8 -1
- package/dist/docs.json +218 -2
- package/dist/{index-9RlgGcc-.js → index-B1krf7tH.js} +203 -32
- package/dist/index-B1krf7tH.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/index.umd.cjs +199 -29
- package/dist/index.umd.cjs.map +1 -1
- package/dist/theme.d.ts +1 -0
- package/dist/types.d.ts +19 -0
- package/package.json +4 -4
- package/dist/index-9RlgGcc-.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode, FC } from 'react';
|
|
2
|
+
import { ChatTheme } from '../theme';
|
|
3
|
+
export interface AppBarProps {
|
|
4
|
+
/**
|
|
5
|
+
* Content to display in the header
|
|
6
|
+
*/
|
|
7
|
+
content?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Custom theme for the appbar
|
|
10
|
+
*/
|
|
11
|
+
theme?: ChatTheme;
|
|
12
|
+
}
|
|
13
|
+
export declare const AppBar: FC<AppBarProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AppBar';
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { useState, useRef, useEffect } from "react";
|
|
4
4
|
import { AnimatePresence, motion } from "motion/react";
|
|
5
|
-
import { a as SvgCopy } from "./index-
|
|
5
|
+
import { a as SvgCopy } from "./index-B1krf7tH.js";
|
|
6
6
|
import { IconButton } from "reablocks";
|
|
7
7
|
const sanitizeSVGCell = (cell) => {
|
|
8
8
|
const trimmed = cell.trim();
|
|
@@ -138,4 +138,4 @@ const CSVFileRenderer = ({ name, url, fileIcon }) => {
|
|
|
138
138
|
export {
|
|
139
139
|
CSVFileRenderer as default
|
|
140
140
|
};
|
|
141
|
-
//# sourceMappingURL=CSVFileRenderer-
|
|
141
|
+
//# sourceMappingURL=CSVFileRenderer-C95MrG0M.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSVFileRenderer-Bn_xBvPJ.js","sources":["../src/utils/sanitize.ts","../src/utils/parseCSV.ts","../src/assets/download.svg?react","../src/SessionMessages/SessionMessage/MessageFile/renderers/CSVFileRenderer.tsx"],"sourcesContent":["\n/**\n * Sanitizes cell content to prevent CSV injection and other potential vulnerabilities.\n * Based on the documentation of OWASP for CSV Injection\n * https://owasp.org/www-community/attacks/CSV_Injection\n * @param cell The cell content to sanitize.\n * @returns The sanitized cell content.\n */\nexport const sanitizeSVGCell = (cell: string): string => {\n const trimmed = cell.trim();\n // Escape double quotes by doubling them\n const escaped = trimmed.replace(/\"/g, '\"\"');\n // Add single quote prefix only for potentially dangerous content\n const prefix = /^[=+\\-@]/.test(trimmed) ? '\\'' : '';\n // Only wrap in quotes if the content contains special characters\n const needsQuotes = /[\",\\n\\r]/.test(escaped) || prefix;\n\n return needsQuotes ? `\"${prefix}${escaped}\"` : escaped;\n};\n","import { sanitizeSVGCell } from './sanitize';\n\n/**\n * Parses a CSV string from a local file and returns an array of rows.\n * Sanitizes cell data to prevent injection attacks.\n * @param csvString The raw CSV string content to parse.\n * @returns The parsed CSV data as a 2D array of strings.\n */\nexport const parseCSV = (csvString: string): string[][] => {\n try {\n const rows = csvString.split('\\n');\n return rows.map((row) => row.split(',').map((cell) => sanitizeSVGCell(cell)));\n } catch (error) {\n console.error('Error parsing CSV:', error);\n throw new Error('Failed to parse CSV file.');\n }\n};\n","import * as React from \"react\";\nconst SvgDownload = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\", className: \"lucide lucide-cloud-download\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M12 12v9\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"m8 17 4 4 4-4\" }));\nexport default SvgDownload;\n","import { FC, useEffect, useState, ReactElement, useRef } from 'react';\nimport { motion, AnimatePresence } from 'motion/react';\nimport { parseCSV } from '@/utils/parseCSV';\nimport DownloadIcon from '@/assets/download.svg?react';\nimport PlaceholderIcon from '@/assets/copy.svg?react';\nimport { IconButton } from 'reablocks';\n\ninterface CSVFileRendererProps {\n /**\n * Name of the file.\n */\n name?: string;\n\n /**\n * URL of the file.\n */\n url: string;\n\n /**\n * Icon to for file type.\n */\n fileIcon?: ReactElement;\n}\n\n/**\n * Renderer for CSV files that fetches and displays a snippet of the file data.\n */\nconst CSVFileRenderer: FC<CSVFileRendererProps> = ({ name, url, fileIcon }) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [csvData, setCsvData] = useState<string[][]>([]);\n const [error, setError] = useState<string | null>(null);\n const [isModalOpen, setIsModalOpen] = useState(false);\n const modalRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const fetchCsvData = async () => {\n try {\n setIsLoading(true);\n const response = await fetch(url);\n const data = parseCSV(await response.text());\n setCsvData(data);\n } catch {\n setError('Failed to load CSV file.');\n } finally {\n setIsLoading(false);\n }\n };\n\n fetchCsvData();\n }, [url]);\n\n const toggleModal = () => {\n setIsModalOpen(prev => !prev);\n };\n\n const handleClickOutside = (event: MouseEvent) => {\n if (modalRef.current && !modalRef.current.contains(event.target as Node)) {\n setIsModalOpen(false);\n }\n };\n\n useEffect(() => {\n if (isModalOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n } else {\n document.removeEventListener('mousedown', handleClickOutside);\n }\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [isModalOpen]);\n\n const downloadCSV = () => {\n if (csvData.length === 0) return;\n\n const csvContent = csvData.map(row => row.join(',')).join('\\n');\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.setAttribute('download', `${name || 'data'}`);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n\n const renderTable = (data: string[][], maxRows?: number) => (\n <motion.table\n layout\n className=\"w-full\"\n transition={{ type: 'spring', stiffness: 100, damping: 20 }}\n >\n <thead className=\"sticky top-0 bg-gray-200 dark:bg-gray-800 z-10\">\n <tr>\n <th className=\"py-4 px-6\">#</th>\n {data[0].map((header, index) => (\n <th key={`header-${index}`} className=\"py-4 px-6\">\n {header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.slice(1, maxRows).map((row, rowIndex) => (\n <tr\n key={`row-${rowIndex}`}\n className=\"border-b border-panel-accent light:border-gray-700 hover:bg-panel-accent hover:light:bg-gray-700/40 transition-colors text-base\"\n >\n <td className=\"py-4 px-6\">{rowIndex + 1}</td>\n {row.map((cell, cellIndex) => (\n <td key={`cell-${rowIndex}-${cellIndex}`} className=\"py-4 px-6\">\n {cell}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </motion.table>\n );\n\n return (\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex justify-between items-center gap-4\">\n <div className=\"csv-icon flex items-center\">\n {fileIcon}\n {name && <figcaption className=\"ml-1\">{name}</figcaption>}\n </div>\n <div className=\"csv-icon flex items-center gap-6\">\n <IconButton size=\"small\" variant=\"text\" onClick={downloadCSV}>\n <DownloadIcon />\n </IconButton>\n <IconButton size=\"small\" variant=\"text\" onClick={toggleModal}>\n <PlaceholderIcon />\n </IconButton>\n </div>\n </div>\n\n {error && <div className=\"error-message\">{error}</div>}\n\n {isLoading && !csvData && (\n <div className=\"text-text-secondary\">Loading...</div>\n )}\n\n <div className=\"flex justify-between\">\n {!error && csvData.length > 0 && renderTable(csvData, 6)}\n </div>\n\n <AnimatePresence>\n {isModalOpen && (\n <motion.div\n className=\"fixed inset-0 bg-black/70 flex justify-center items-center z-50\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3 }}\n >\n <motion.div\n ref={modalRef}\n className=\"bg-white dark:bg-gray-900 rounded-md w-11/12 h-5/6 overflow-auto\"\n initial={{ scale: 0.8 }}\n animate={{ scale: 1 }}\n exit={{ scale: 0.8 }}\n transition={{ duration: 0.3 }}\n >\n {!error && csvData.length > 0 && renderTable(csvData)}\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n );\n};\n\nexport default CSVFileRenderer;\n"],"names":["url","DownloadIcon","PlaceholderIcon"],"mappings":";;;;;;AAQa,MAAA,kBAAkB,CAAC,SAAyB;AACjD,QAAA,UAAU,KAAK,KAAK;AAE1B,QAAM,UAAU,QAAQ,QAAQ,MAAM,IAAI;AAE1C,QAAM,SAAS,WAAW,KAAK,OAAO,IAAI,MAAO;AAEjD,QAAM,cAAc,WAAW,KAAK,OAAO,KAAK;AAEhD,SAAO,cAAc,IAAI,MAAM,GAAG,OAAO,MAAM;AACjD;ACVa,MAAA,WAAW,CAAC,cAAkC;AACrD,MAAA;AACI,UAAA,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A,WAAU,uBAAsB,UAAU,cAAA;AAAA,IAGhD,oBAAA,OAAA,EAAI,WAAU,wBACZ,UAAC,CAAA,SAAS,QAAQ,SAAS,KAAK,YAAY,SAAS,CAAC,EACzD,CAAA;AAAA,IAEA,oBAAC,mBACE,UACC,eAAA;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACC,WAAU;AAAA,QACV,SAAS,EAAE,SAAS,EAAE;AAAA,QACtB,SAAS,EAAE,SAAS,EAAE;AAAA,QACtB,MAAM,EAAE,SAAS,EAAE;AAAA,QACnB,YAAY,EAAE,UAAU,IAAI;AAAA,QAE5B,UAAA;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YACC,KAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAS,EAAE,OAAO,IAAI;AAAA,YACtB,SAAS,EAAE,OAAO,EAAE;AAAA,YACpB,MAAM,EAAE,OAAO,IAAI;AAAA,YACnB,YAAY,EAAE,UAAU,IAAI;AAAA,YAE3B,WAAC,SAAS,QAAQ,SAAS,KAAK,YAAY,OAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MACtD;AAAA,IAAA,EAGN,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"CSVFileRenderer-C95MrG0M.js","sources":["../src/utils/sanitize.ts","../src/utils/parseCSV.ts","../src/assets/download.svg?react","../src/SessionMessages/SessionMessage/MessageFile/renderers/CSVFileRenderer.tsx"],"sourcesContent":["\n/**\n * Sanitizes cell content to prevent CSV injection and other potential vulnerabilities.\n * Based on the documentation of OWASP for CSV Injection\n * https://owasp.org/www-community/attacks/CSV_Injection\n * @param cell The cell content to sanitize.\n * @returns The sanitized cell content.\n */\nexport const sanitizeSVGCell = (cell: string): string => {\n const trimmed = cell.trim();\n // Escape double quotes by doubling them\n const escaped = trimmed.replace(/\"/g, '\"\"');\n // Add single quote prefix only for potentially dangerous content\n const prefix = /^[=+\\-@]/.test(trimmed) ? '\\'' : '';\n // Only wrap in quotes if the content contains special characters\n const needsQuotes = /[\",\\n\\r]/.test(escaped) || prefix;\n\n return needsQuotes ? `\"${prefix}${escaped}\"` : escaped;\n};\n","import { sanitizeSVGCell } from './sanitize';\n\n/**\n * Parses a CSV string from a local file and returns an array of rows.\n * Sanitizes cell data to prevent injection attacks.\n * @param csvString The raw CSV string content to parse.\n * @returns The parsed CSV data as a 2D array of strings.\n */\nexport const parseCSV = (csvString: string): string[][] => {\n try {\n const rows = csvString.split('\\n');\n return rows.map((row) => row.split(',').map((cell) => sanitizeSVGCell(cell)));\n } catch (error) {\n console.error('Error parsing CSV:', error);\n throw new Error('Failed to parse CSV file.');\n }\n};\n","import * as React from \"react\";\nconst SvgDownload = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\", className: \"lucide lucide-cloud-download\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M12 12v9\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"m8 17 4 4 4-4\" }));\nexport default SvgDownload;\n","import { FC, useEffect, useState, ReactElement, useRef } from 'react';\nimport { motion, AnimatePresence } from 'motion/react';\nimport { parseCSV } from '@/utils/parseCSV';\nimport DownloadIcon from '@/assets/download.svg?react';\nimport PlaceholderIcon from '@/assets/copy.svg?react';\nimport { IconButton } from 'reablocks';\n\ninterface CSVFileRendererProps {\n /**\n * Name of the file.\n */\n name?: string;\n\n /**\n * URL of the file.\n */\n url: string;\n\n /**\n * Icon to for file type.\n */\n fileIcon?: ReactElement;\n}\n\n/**\n * Renderer for CSV files that fetches and displays a snippet of the file data.\n */\nconst CSVFileRenderer: FC<CSVFileRendererProps> = ({ name, url, fileIcon }) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [csvData, setCsvData] = useState<string[][]>([]);\n const [error, setError] = useState<string | null>(null);\n const [isModalOpen, setIsModalOpen] = useState(false);\n const modalRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const fetchCsvData = async () => {\n try {\n setIsLoading(true);\n const response = await fetch(url);\n const data = parseCSV(await response.text());\n setCsvData(data);\n } catch {\n setError('Failed to load CSV file.');\n } finally {\n setIsLoading(false);\n }\n };\n\n fetchCsvData();\n }, [url]);\n\n const toggleModal = () => {\n setIsModalOpen(prev => !prev);\n };\n\n const handleClickOutside = (event: MouseEvent) => {\n if (modalRef.current && !modalRef.current.contains(event.target as Node)) {\n setIsModalOpen(false);\n }\n };\n\n useEffect(() => {\n if (isModalOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n } else {\n document.removeEventListener('mousedown', handleClickOutside);\n }\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [isModalOpen]);\n\n const downloadCSV = () => {\n if (csvData.length === 0) return;\n\n const csvContent = csvData.map(row => row.join(',')).join('\\n');\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.setAttribute('download', `${name || 'data'}`);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n\n const renderTable = (data: string[][], maxRows?: number) => (\n <motion.table\n layout\n className=\"w-full\"\n transition={{ type: 'spring', stiffness: 100, damping: 20 }}\n >\n <thead className=\"sticky top-0 bg-gray-200 dark:bg-gray-800 z-10\">\n <tr>\n <th className=\"py-4 px-6\">#</th>\n {data[0].map((header, index) => (\n <th key={`header-${index}`} className=\"py-4 px-6\">\n {header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.slice(1, maxRows).map((row, rowIndex) => (\n <tr\n key={`row-${rowIndex}`}\n className=\"border-b border-panel-accent light:border-gray-700 hover:bg-panel-accent hover:light:bg-gray-700/40 transition-colors text-base\"\n >\n <td className=\"py-4 px-6\">{rowIndex + 1}</td>\n {row.map((cell, cellIndex) => (\n <td key={`cell-${rowIndex}-${cellIndex}`} className=\"py-4 px-6\">\n {cell}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </motion.table>\n );\n\n return (\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex justify-between items-center gap-4\">\n <div className=\"csv-icon flex items-center\">\n {fileIcon}\n {name && <figcaption className=\"ml-1\">{name}</figcaption>}\n </div>\n <div className=\"csv-icon flex items-center gap-6\">\n <IconButton size=\"small\" variant=\"text\" onClick={downloadCSV}>\n <DownloadIcon />\n </IconButton>\n <IconButton size=\"small\" variant=\"text\" onClick={toggleModal}>\n <PlaceholderIcon />\n </IconButton>\n </div>\n </div>\n\n {error && <div className=\"error-message\">{error}</div>}\n\n {isLoading && !csvData && (\n <div className=\"text-text-secondary\">Loading...</div>\n )}\n\n <div className=\"flex justify-between\">\n {!error && csvData.length > 0 && renderTable(csvData, 6)}\n </div>\n\n <AnimatePresence>\n {isModalOpen && (\n <motion.div\n className=\"fixed inset-0 bg-black/70 flex justify-center items-center z-50\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3 }}\n >\n <motion.div\n ref={modalRef}\n className=\"bg-white dark:bg-gray-900 rounded-md w-11/12 h-5/6 overflow-auto\"\n initial={{ scale: 0.8 }}\n animate={{ scale: 1 }}\n exit={{ scale: 0.8 }}\n transition={{ duration: 0.3 }}\n >\n {!error && csvData.length > 0 && renderTable(csvData)}\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n );\n};\n\nexport default CSVFileRenderer;\n"],"names":["url","DownloadIcon","PlaceholderIcon"],"mappings":";;;;;;AAQa,MAAA,kBAAkB,CAAC,SAAyB;AACjD,QAAA,UAAU,KAAK,KAAK;AAE1B,QAAM,UAAU,QAAQ,QAAQ,MAAM,IAAI;AAE1C,QAAM,SAAS,WAAW,KAAK,OA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AgB,CAAA,EACnB,CAAA;AAAA,MAAA,EACF,CAAA;AAAA,IAAA,GACF;AAAA,IAEC,SAAS,oBAAC,OAAI,EAAA,WAAU,iBAAiB,UAAM,OAAA;AAAA,IAE/C,aAAa,CAAC,+BACZ,OAAI,EAAA,WAAU,uBAAsB,UAAU,cAAA;AAAA,IAGhD,oBAAA,OAAA,EAAI,WAAU,wBACZ,UAAC,CAAA,SAAS,QAAQ,SAAS,KAAK,YAAY,SAAS,CAAC,EACzD,CAAA;AAAA,IAEA,oBAAC,mBACE,UACC,eAAA;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACC,WAAU;AAAA,QACV,SAAS,EAAE,SAAS,EAAE;AAAA,QACtB,SAAS,EAAE,SAAS,EAAE;AAAA,QACtB,MAAM,EAAE,SAAS,EAAE;AAAA,QACnB,YAAY,EAAE,UAAU,IAAI;AAAA,QAE5B,UAAA;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YACC,KAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAS,EAAE,OAAO,IAAI;AAAA,YACtB,SAAS,EAAE,OAAO,EAAE;AAAA,YACpB,MAAM,EAAE,OAAO,IAAI;AAAA,YACnB,YAAY,EAAE,UAAU,IAAI;AAAA,YAE3B,WAAC,SAAS,QAAQ,SAAS,KAAK,YAAY,OAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MACtD;AAAA,IAAA,EAGN,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export type Position = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
3
|
+
export interface ChatBubbleProps {
|
|
4
|
+
/**
|
|
5
|
+
* The main content to be rendered.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The content to be rendered in the trigger bubble.
|
|
10
|
+
*/
|
|
11
|
+
bubbleContent: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The position of the chat bubble on the screen.
|
|
14
|
+
* @default 'bottom-left'
|
|
15
|
+
*/
|
|
16
|
+
position?: Position;
|
|
17
|
+
/**
|
|
18
|
+
* Custom CSS styles to override the default positioning.
|
|
19
|
+
*/
|
|
20
|
+
customPosition?: CSSProperties;
|
|
21
|
+
/**
|
|
22
|
+
* The DOM element where the chat bubble should be rendered.
|
|
23
|
+
* @default document.body
|
|
24
|
+
*/
|
|
25
|
+
portalTarget?: HTMLElement | null;
|
|
26
|
+
/**
|
|
27
|
+
* Additional CSS classes to apply to the chat bubble.
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const ChatBubble: import('react').NamedExoticComponent<ChatBubbleProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChatBubble';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { S as SvgFile } from "./index-
|
|
2
|
+
import { S as SvgFile } from "./index-B1krf7tH.js";
|
|
3
3
|
import { cn, Ellipsis } from "reablocks";
|
|
4
4
|
const DefaultFileRenderer = ({
|
|
5
5
|
name,
|
|
@@ -12,4 +12,4 @@ const DefaultFileRenderer = ({
|
|
|
12
12
|
export {
|
|
13
13
|
DefaultFileRenderer as default
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=DefaultFileRenderer-
|
|
15
|
+
//# sourceMappingURL=DefaultFileRenderer-Chpp-Qiu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFileRenderer-
|
|
1
|
+
{"version":3,"file":"DefaultFileRenderer-Chpp-Qiu.js","sources":["../src/SessionMessages/SessionMessage/MessageFile/renderers/DefaultFileRenderer.tsx"],"sourcesContent":["import { FC, ReactElement } from 'react';\nimport FileIcon from '@/assets/file.svg?react';\nimport { Ellipsis, cn } from 'reablocks';\n\ninterface DefaultFileRendererProps {\n /**\n * Limit for the name.\n */\n limit?: number;\n\n /**\n * Name of the file.\n */\n name?: string;\n\n /**\n * URL of the file.\n */\n url: string;\n\n /**\n * Icon to for file type.\n */\n fileIcon?: ReactElement;\n}\n\n/**\n * Default renderer for unspecified file types.\n */\nconst DefaultFileRenderer: FC<DefaultFileRendererProps> = ({\n name,\n limit = 100,\n fileIcon = <FileIcon />,\n}) => (\n <figure className=\"flex items-center gap-2\">\n {fileIcon}\n {name && (\n <figcaption className={cn('file-name-class')}>\n <Ellipsis value={name} limit={limit} />\n </figcaption>\n )}\n </figure>\n);\n\nexport default DefaultFileRenderer;\n"],"names":["FileIcon"],"mappings":";;;AA6BA,MAAM,sBAAoD,CAAC;AAAA,EACzD;AAAA,EACA,QAAQ;AAAA,EACR,+BAAYA,SAAS,CAAA,CAAA;AACvB,MACE,qBAAC,UAAO,EAAA,WAAU,2BACf,UAAA;AAAA,EAAA;AAAA,EACA,QACC,oBAAC,cAAW,EAAA,WAAW,GAAG,iBAAiB,GACzC,UAAA,oBAAC,UAAS,EAAA,OAAO,MAAM,MAAc,CAAA,EACvC,CAAA;AAAA,EAEJ,CAAA;"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
interface SessionMessagePanelProps extends PropsWithChildren {
|
|
3
|
+
allowBack?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const SessionMessagePanel: FC<SessionMessagePanelProps>;
|
|
6
|
+
export {};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
import { Template } from '../types';
|
|
3
|
+
export interface SessionsListProps extends PropsWithChildren {
|
|
4
|
+
/**
|
|
5
|
+
* Templates to show when no session is active
|
|
6
|
+
*/
|
|
7
|
+
templates?: Template[];
|
|
8
|
+
}
|
|
9
|
+
export declare const SessionsList: FC<SessionsListProps>;
|
package/dist/docs.json
CHANGED
|
@@ -297,6 +297,180 @@
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
|
+
{
|
|
301
|
+
"tags": {},
|
|
302
|
+
"filePath": "src/AppBar/AppBar.tsx",
|
|
303
|
+
"description": "",
|
|
304
|
+
"displayName": "AppBar",
|
|
305
|
+
"methods": [],
|
|
306
|
+
"props": {
|
|
307
|
+
"content": {
|
|
308
|
+
"defaultValue": null,
|
|
309
|
+
"description": "Content to display in the header",
|
|
310
|
+
"name": "content",
|
|
311
|
+
"parent": {
|
|
312
|
+
"fileName": "src/AppBar/AppBar.tsx",
|
|
313
|
+
"name": "AppBarProps"
|
|
314
|
+
},
|
|
315
|
+
"declarations": [
|
|
316
|
+
{
|
|
317
|
+
"fileName": "src/AppBar/AppBar.tsx",
|
|
318
|
+
"name": "AppBarProps"
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"required": false,
|
|
322
|
+
"type": {
|
|
323
|
+
"name": "ReactNode"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"theme": {
|
|
327
|
+
"defaultValue": null,
|
|
328
|
+
"description": "Custom theme for the appbar",
|
|
329
|
+
"name": "theme",
|
|
330
|
+
"parent": {
|
|
331
|
+
"fileName": "src/AppBar/AppBar.tsx",
|
|
332
|
+
"name": "AppBarProps"
|
|
333
|
+
},
|
|
334
|
+
"declarations": [
|
|
335
|
+
{
|
|
336
|
+
"fileName": "src/AppBar/AppBar.tsx",
|
|
337
|
+
"name": "AppBarProps"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"required": false,
|
|
341
|
+
"type": {
|
|
342
|
+
"name": "ChatTheme"
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"tags": {},
|
|
349
|
+
"filePath": "src/ChatBubble/ChatBubble.tsx",
|
|
350
|
+
"description": "",
|
|
351
|
+
"displayName": "ChatBubble",
|
|
352
|
+
"methods": [],
|
|
353
|
+
"props": {
|
|
354
|
+
"children": {
|
|
355
|
+
"defaultValue": null,
|
|
356
|
+
"description": "The main content to be rendered.",
|
|
357
|
+
"name": "children",
|
|
358
|
+
"parent": {
|
|
359
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
360
|
+
"name": "ChatBubbleProps"
|
|
361
|
+
},
|
|
362
|
+
"declarations": [
|
|
363
|
+
{
|
|
364
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
365
|
+
"name": "ChatBubbleProps"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"required": true,
|
|
369
|
+
"type": {
|
|
370
|
+
"name": "ReactNode"
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"bubbleContent": {
|
|
374
|
+
"defaultValue": null,
|
|
375
|
+
"description": "The content to be rendered in the trigger bubble.",
|
|
376
|
+
"name": "bubbleContent",
|
|
377
|
+
"parent": {
|
|
378
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
379
|
+
"name": "ChatBubbleProps"
|
|
380
|
+
},
|
|
381
|
+
"declarations": [
|
|
382
|
+
{
|
|
383
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
384
|
+
"name": "ChatBubbleProps"
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
"required": true,
|
|
388
|
+
"type": {
|
|
389
|
+
"name": "ReactNode"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"position": {
|
|
393
|
+
"defaultValue": {
|
|
394
|
+
"value": "'bottom-left'"
|
|
395
|
+
},
|
|
396
|
+
"description": "The position of the chat bubble on the screen.",
|
|
397
|
+
"name": "position",
|
|
398
|
+
"parent": {
|
|
399
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
400
|
+
"name": "ChatBubbleProps"
|
|
401
|
+
},
|
|
402
|
+
"declarations": [
|
|
403
|
+
{
|
|
404
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
405
|
+
"name": "ChatBubbleProps"
|
|
406
|
+
}
|
|
407
|
+
],
|
|
408
|
+
"required": false,
|
|
409
|
+
"type": {
|
|
410
|
+
"name": "Position"
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
"customPosition": {
|
|
414
|
+
"defaultValue": null,
|
|
415
|
+
"description": "Custom CSS styles to override the default positioning.",
|
|
416
|
+
"name": "customPosition",
|
|
417
|
+
"parent": {
|
|
418
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
419
|
+
"name": "ChatBubbleProps"
|
|
420
|
+
},
|
|
421
|
+
"declarations": [
|
|
422
|
+
{
|
|
423
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
424
|
+
"name": "ChatBubbleProps"
|
|
425
|
+
}
|
|
426
|
+
],
|
|
427
|
+
"required": false,
|
|
428
|
+
"type": {
|
|
429
|
+
"name": "CSSProperties"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
"portalTarget": {
|
|
433
|
+
"defaultValue": {
|
|
434
|
+
"value": "document.body"
|
|
435
|
+
},
|
|
436
|
+
"description": "The DOM element where the chat bubble should be rendered.",
|
|
437
|
+
"name": "portalTarget",
|
|
438
|
+
"parent": {
|
|
439
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
440
|
+
"name": "ChatBubbleProps"
|
|
441
|
+
},
|
|
442
|
+
"declarations": [
|
|
443
|
+
{
|
|
444
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
445
|
+
"name": "ChatBubbleProps"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"required": false,
|
|
449
|
+
"type": {
|
|
450
|
+
"name": "HTMLElement"
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
"className": {
|
|
454
|
+
"defaultValue": null,
|
|
455
|
+
"description": "Additional CSS classes to apply to the chat bubble.",
|
|
456
|
+
"name": "className",
|
|
457
|
+
"parent": {
|
|
458
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
459
|
+
"name": "ChatBubbleProps"
|
|
460
|
+
},
|
|
461
|
+
"declarations": [
|
|
462
|
+
{
|
|
463
|
+
"fileName": "src/ChatBubble/ChatBubble.tsx",
|
|
464
|
+
"name": "ChatBubbleProps"
|
|
465
|
+
}
|
|
466
|
+
],
|
|
467
|
+
"required": false,
|
|
468
|
+
"type": {
|
|
469
|
+
"name": "string"
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
},
|
|
300
474
|
{
|
|
301
475
|
"tags": {},
|
|
302
476
|
"filePath": "src/ChatInput/ChatInput.tsx",
|
|
@@ -744,7 +918,29 @@
|
|
|
744
918
|
"description": "",
|
|
745
919
|
"displayName": "SessionMessagePanel",
|
|
746
920
|
"methods": [],
|
|
747
|
-
"props": {
|
|
921
|
+
"props": {
|
|
922
|
+
"allowBack": {
|
|
923
|
+
"defaultValue": {
|
|
924
|
+
"value": "true"
|
|
925
|
+
},
|
|
926
|
+
"description": "",
|
|
927
|
+
"name": "allowBack",
|
|
928
|
+
"parent": {
|
|
929
|
+
"fileName": "src/SessionMessages/SessionMessagePanel.tsx",
|
|
930
|
+
"name": "SessionMessagePanelProps"
|
|
931
|
+
},
|
|
932
|
+
"declarations": [
|
|
933
|
+
{
|
|
934
|
+
"fileName": "src/SessionMessages/SessionMessagePanel.tsx",
|
|
935
|
+
"name": "SessionMessagePanelProps"
|
|
936
|
+
}
|
|
937
|
+
],
|
|
938
|
+
"required": false,
|
|
939
|
+
"type": {
|
|
940
|
+
"name": "boolean"
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
748
944
|
},
|
|
749
945
|
{
|
|
750
946
|
"tags": {},
|
|
@@ -1047,7 +1243,27 @@
|
|
|
1047
1243
|
"description": "",
|
|
1048
1244
|
"displayName": "SessionsList",
|
|
1049
1245
|
"methods": [],
|
|
1050
|
-
"props": {
|
|
1246
|
+
"props": {
|
|
1247
|
+
"templates": {
|
|
1248
|
+
"defaultValue": null,
|
|
1249
|
+
"description": "Templates to show when no session is active",
|
|
1250
|
+
"name": "templates",
|
|
1251
|
+
"parent": {
|
|
1252
|
+
"fileName": "src/SessionsList/SessionsList.tsx",
|
|
1253
|
+
"name": "SessionsListProps"
|
|
1254
|
+
},
|
|
1255
|
+
"declarations": [
|
|
1256
|
+
{
|
|
1257
|
+
"fileName": "src/SessionsList/SessionsList.tsx",
|
|
1258
|
+
"name": "SessionsListProps"
|
|
1259
|
+
}
|
|
1260
|
+
],
|
|
1261
|
+
"required": false,
|
|
1262
|
+
"type": {
|
|
1263
|
+
"name": "Template[]"
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1051
1267
|
},
|
|
1052
1268
|
{
|
|
1053
1269
|
"tags": {},
|