reachat 2.1.0-alpha.9 → 2.1.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/README.md +4 -2
- package/dist/AppBar/AppBar.d.ts +1 -1
- package/dist/{CSVFileRenderer-CkRKGiCl.js → CSVFileRenderer-D2mDdCjs.js} +14 -15
- package/dist/CSVFileRenderer-D2mDdCjs.js.map +1 -0
- package/dist/Chat.d.ts +9 -3
- package/dist/ChatBubble/ChatBubble.d.ts +1 -1
- package/dist/ChatContext.d.ts +4 -2
- package/dist/ChatInput/ChatInput.d.ts +23 -13
- package/dist/ChatInput/FileInput.d.ts +1 -1
- package/dist/ChatInput/MentionList.d.ts +32 -0
- package/dist/ChatInput/RichTextInput.d.ts +55 -0
- package/dist/ChatInput/index.d.ts +3 -0
- package/dist/ChatInput/types.d.ts +104 -0
- package/dist/ChatSuggestions/ChatSuggestion.d.ts +9 -0
- package/dist/ChatSuggestions/ChatSuggestions.d.ts +22 -0
- package/dist/ChatSuggestions/index.d.ts +2 -0
- package/dist/{DefaultFileRenderer-C1qZ57tG.js → DefaultFileRenderer-BLV8PtJk.js} +2 -2
- package/dist/DefaultFileRenderer-BLV8PtJk.js.map +1 -0
- package/dist/ImageFileRenderer-C8tVW3I8.js.map +1 -1
- package/dist/Markdown/Markdown.d.ts +4 -3
- package/dist/Markdown/Table.d.ts +1 -1
- package/dist/Markdown/charts/ChartError.d.ts +21 -0
- package/dist/Markdown/charts/ChartPre.d.ts +6 -0
- package/dist/Markdown/charts/ChartRenderer.d.ts +13 -0
- package/dist/Markdown/charts/chartHelpers.d.ts +40 -0
- package/dist/Markdown/charts/chartHelpers.spec.d.ts +1 -0
- package/dist/Markdown/charts/index.d.ts +7 -0
- package/dist/Markdown/index.d.ts +3 -2
- package/dist/Markdown/plugins/index.d.ts +1 -0
- package/dist/Markdown/plugins/remarkChart.d.ts +59 -0
- package/dist/Markdown/plugins/remarkCve.d.ts +1 -1
- package/dist/MessageStatus/MessageStatus.d.ts +44 -0
- package/dist/MessageStatus/MessageStatusItem.d.ts +9 -0
- package/dist/MessageStatus/StatusIcon.d.ts +17 -0
- package/dist/MessageStatus/index.d.ts +3 -0
- package/dist/PDFFileRenderer-DQdFS2l6.js +9 -0
- package/dist/PDFFileRenderer-DQdFS2l6.js.map +1 -0
- package/dist/SessionMessages/SessionEmpty.d.ts +4 -1
- package/dist/SessionMessages/SessionMessage/MessageFile/renderers/index.d.ts +1 -1
- package/dist/SessionMessages/SessionMessage/MessageFiles.d.ts +1 -1
- package/dist/SessionMessages/SessionMessage/MessageSources.d.ts +1 -1
- package/dist/SessionMessages/SessionMessage/SessionMessage.d.ts +0 -4
- package/dist/SessionMessages/SessionMessage/index.d.ts +2 -2
- package/dist/SessionMessages/SessionMessages.d.ts +3 -7
- package/dist/SessionMessages/index.d.ts +2 -2
- package/dist/SessionsList/index.d.ts +2 -2
- package/dist/docs.json +1037 -183
- package/dist/index-B3dZT-5c.js +4369 -0
- package/dist/index-B3dZT-5c.js.map +1 -0
- package/dist/index.css +2129 -6532
- package/dist/index.d.ts +8 -7
- package/dist/index.js +49 -34
- package/dist/index.umd.cjs +3414 -1320
- package/dist/index.umd.cjs.map +1 -1
- package/dist/stories/Changelog.mdx +1 -1
- package/dist/stories/ChartError.stories.tsx +85 -0
- package/dist/stories/Charts.stories.tsx +371 -0
- package/dist/stories/Chat.stories.tsx +5 -5
- package/dist/stories/ChatBubble.stories.tsx +3 -3
- package/dist/stories/ChatSuggestions.stories.tsx +541 -0
- package/dist/stories/Companion.stories.tsx +6 -6
- package/dist/stories/Console.stories.tsx +165 -25
- package/dist/stories/EnhancedInput.stories.tsx +322 -0
- package/dist/stories/Integration.stories.tsx +2 -2
- package/dist/stories/Intro.mdx +1 -1
- package/dist/stories/MessageStatus.stories.tsx +314 -0
- package/dist/stories/RichTextInput.stories.tsx +198 -0
- package/dist/stories/assets/logo.svg +19 -38
- package/dist/stories/assets/paperclip.svg +1 -4
- package/dist/stories/assets/search.svg +1 -5
- package/dist/stories/assets/sparkles.svg +7 -0
- package/dist/stories/examples.ts +47 -20
- package/dist/theme.d.ts +76 -13
- package/dist/types.d.ts +10 -0
- package/package.json +69 -66
- package/dist/CSVFileRenderer-CkRKGiCl.js.map +0 -1
- package/dist/DefaultFileRenderer-C1qZ57tG.js.map +0 -1
- package/dist/PDFFileRenderer-BBn2EVrV.js +0 -16
- package/dist/PDFFileRenderer-BBn2EVrV.js.map +0 -1
- package/dist/index-6CsqxEMx.js +0 -2257
- package/dist/index-6CsqxEMx.js.map +0 -1
- package/dist/utils/index.d.ts +0 -1
package/dist/Markdown/index.d.ts
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Plugin } from 'unified';
|
|
2
|
+
import { Root } from 'mdast';
|
|
3
|
+
/**
|
|
4
|
+
* Supported chart types for the remarkChart plugin.
|
|
5
|
+
*/
|
|
6
|
+
export type ChartType = 'bar' | 'line' | 'area' | 'pie' | 'radialBar' | 'radialArea' | 'sparkline';
|
|
7
|
+
/**
|
|
8
|
+
* Data point structure for charts.
|
|
9
|
+
*/
|
|
10
|
+
export interface ChartDataPoint {
|
|
11
|
+
key: string;
|
|
12
|
+
data: number | ChartDataPoint[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for chart rendering.
|
|
16
|
+
*/
|
|
17
|
+
export interface ChartConfig {
|
|
18
|
+
type: ChartType;
|
|
19
|
+
data: ChartDataPoint[];
|
|
20
|
+
width?: number;
|
|
21
|
+
height?: number;
|
|
22
|
+
title?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Options for the remarkChart plugin.
|
|
26
|
+
*/
|
|
27
|
+
export interface RemarkChartOptions {
|
|
28
|
+
/**
|
|
29
|
+
* Default width for charts.
|
|
30
|
+
* @default 400
|
|
31
|
+
*/
|
|
32
|
+
defaultWidth?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Default height for charts.
|
|
35
|
+
* @default 300
|
|
36
|
+
*/
|
|
37
|
+
defaultHeight?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A remark plugin that preprocesses fenced code blocks with language "chart"
|
|
41
|
+
* by validating and applying default dimensions to the chart configuration.
|
|
42
|
+
*
|
|
43
|
+
* The actual rendering is handled by the ChartRenderer component via
|
|
44
|
+
* chartComponents.
|
|
45
|
+
*
|
|
46
|
+
* Usage in markdown:
|
|
47
|
+
* ```chart
|
|
48
|
+
* {
|
|
49
|
+
* "type": "bar",
|
|
50
|
+
* "data": [
|
|
51
|
+
* { "key": "A", "data": 10 },
|
|
52
|
+
* { "key": "B", "data": 20 }
|
|
53
|
+
* ]
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @param options - Plugin options
|
|
58
|
+
*/
|
|
59
|
+
export declare const remarkChart: Plugin<[RemarkChartOptions?], Root>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function remarkCve(): (tree: any) => void;
|
|
1
|
+
export declare function remarkCve(): (tree: any, _file: any) => void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export type MessageStatusState = 'loading' | 'complete' | 'error';
|
|
3
|
+
export interface MessageStatusStep {
|
|
4
|
+
/**
|
|
5
|
+
* Unique identifier for the step.
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Text to display for the step.
|
|
10
|
+
*/
|
|
11
|
+
text: string;
|
|
12
|
+
/**
|
|
13
|
+
* Current state of the step.
|
|
14
|
+
* @default 'loading'
|
|
15
|
+
*/
|
|
16
|
+
status?: MessageStatusState;
|
|
17
|
+
}
|
|
18
|
+
export interface MessageStatusProps extends PropsWithChildren {
|
|
19
|
+
/**
|
|
20
|
+
* Current status state.
|
|
21
|
+
* @default 'loading'
|
|
22
|
+
*/
|
|
23
|
+
status?: MessageStatusState;
|
|
24
|
+
/**
|
|
25
|
+
* Main status text to display.
|
|
26
|
+
*/
|
|
27
|
+
text: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional sub-steps to display.
|
|
30
|
+
*/
|
|
31
|
+
steps?: MessageStatusStep[];
|
|
32
|
+
/**
|
|
33
|
+
* Custom icon to display. If not provided, uses default icons based on status.
|
|
34
|
+
*/
|
|
35
|
+
icon?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Additional CSS class name.
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Displays status information with optional sub-steps, similar to Claude's tool status UI.
|
|
43
|
+
*/
|
|
44
|
+
export declare const MessageStatus: FC<MessageStatusProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MessageStatusState } from './MessageStatus';
|
|
3
|
+
export interface StatusIconProps {
|
|
4
|
+
/**
|
|
5
|
+
* Current state of the status icon.
|
|
6
|
+
*/
|
|
7
|
+
state: MessageStatusState;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class name for the icon container.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* CSS class name for the icon color based on state.
|
|
14
|
+
*/
|
|
15
|
+
colorClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const StatusIcon: FC<StatusIconProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
const PDFFileRenderer = ({ name, url, fileIcon }) => /* @__PURE__ */ jsxs("figure", { className: "csv-icon flex items-center gap-2", onClick: () => window.open(url, "_blank"), children: [
|
|
3
|
+
fileIcon,
|
|
4
|
+
name && /* @__PURE__ */ jsx("figcaption", { className: "file-name", children: name })
|
|
5
|
+
] });
|
|
6
|
+
export {
|
|
7
|
+
PDFFileRenderer as default
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=PDFFileRenderer-DQdFS2l6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PDFFileRenderer-DQdFS2l6.js","sources":["../src/SessionMessages/SessionMessage/MessageFile/renderers/PDFFileRenderer.tsx"],"sourcesContent":["import { FC, ReactElement } from 'react';\n\ninterface PDFFileRendererProps {\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 PDF files.\n */\nconst PDFFileRenderer: FC<PDFFileRendererProps> = ({ name, url, fileIcon }) => (\n <figure className=\"csv-icon flex items-center gap-2\" onClick={() => window.open(url, '_blank')}>\n {fileIcon}\n {name && <figcaption className=\"file-name\">{name}</figcaption>}\n </figure>\n);\n\nexport default PDFFileRenderer;\n"],"names":[],"mappings":";AAsBA,MAAM,kBAA4C,CAAC,EAAE,MAAM,KAAK,eAC9D,qBAAC,UAAA,EAAO,WAAU,oCAAmC,SAAS,MAAM,OAAO,KAAK,KAAK,QAAQ,GAC1F,UAAA;AAAA,EAAA;AAAA,EACA,QAAQ,oBAAC,cAAA,EAAW,WAAU,aAAa,UAAA,KAAA,CAAK;AAAA,EAAA,CACnD;"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { Conversation } from '../../types';
|
|
3
3
|
interface SessionMessageProps extends PropsWithChildren {
|
|
4
|
-
/**
|
|
5
|
-
* Class name to apply to the root element.
|
|
6
|
-
*/
|
|
7
|
-
className?: string;
|
|
8
4
|
/**
|
|
9
5
|
* Conversation to render.
|
|
10
6
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
export * from './SessionMessage';
|
|
2
|
+
export * from './MessageSource';
|
|
1
3
|
export * from './MessageActions';
|
|
2
4
|
export * from './MessageFile';
|
|
3
5
|
export * from './MessageFiles';
|
|
4
6
|
export * from './MessageQuestion';
|
|
5
7
|
export * from './MessageResponse';
|
|
6
|
-
export * from './MessageSource';
|
|
7
8
|
export * from './MessageSources';
|
|
8
|
-
export * from './SessionMessage';
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { Conversation } from '../types';
|
|
3
3
|
interface SessionMessagesProps {
|
|
4
|
-
/**
|
|
5
|
-
* Class name to apply to the root element.
|
|
6
|
-
*/
|
|
7
|
-
className?: string;
|
|
8
4
|
/**
|
|
9
5
|
* Content to display when there are no sessions selected or a new session is started.
|
|
10
6
|
*/
|
|
@@ -18,9 +14,9 @@ interface SessionMessagesProps {
|
|
|
18
14
|
*/
|
|
19
15
|
showMoreText?: string;
|
|
20
16
|
/**
|
|
21
|
-
* Whether to
|
|
17
|
+
* Whether to display the scroll to bottom button.
|
|
22
18
|
*/
|
|
23
|
-
|
|
19
|
+
showScrollBottomButton?: boolean;
|
|
24
20
|
/**
|
|
25
21
|
* Render function for the session messages.
|
|
26
22
|
*/
|