reachat 3.4.0 → 3.4.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/Chat.d.ts +1 -1
- package/dist/Markdown/Markdown.d.ts +1 -0
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/Chat.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,14 +15,14 @@ import { AnimatePresence, motion } from "motion/react";
|
|
|
15
15
|
import ReactMarkdown from "react-markdown";
|
|
16
16
|
import rehypeKatex from "rehype-katex";
|
|
17
17
|
import rehypeRaw from "rehype-raw";
|
|
18
|
+
import remarkGfm from "remark-gfm";
|
|
19
|
+
import remarkMath from "remark-math";
|
|
20
|
+
import remarkYoutube from "remark-youtube";
|
|
18
21
|
import { Prism } from "react-syntax-highlighter";
|
|
19
22
|
import { AreaChart, AreaSeries, BarChart, BarSeries, LineChart, LineSeries, LinearXAxis, LinearYAxis, PieArcSeries, PieChart, RadialAreaChart, RadialAreaSeries, RadialBarChart, RadialBarSeries, SparklineChart } from "reaviz";
|
|
20
23
|
import { findAndReplace } from "mdast-util-find-and-replace";
|
|
21
24
|
import debounce from "lodash/debounce.js";
|
|
22
25
|
import { useHotkeys } from "reakeys";
|
|
23
|
-
import remarkGfm from "remark-gfm";
|
|
24
|
-
import remarkYoutube from "remark-youtube";
|
|
25
|
-
import remarkMath from "remark-math";
|
|
26
26
|
import { differenceInYears, format, isThisWeek, isToday, isYesterday } from "date-fns";
|
|
27
27
|
import { offset } from "@floating-ui/react";
|
|
28
28
|
import { z } from "zod";
|
|
@@ -1413,7 +1413,12 @@ var TableDataCell = ({ children, ...props }) => /* @__PURE__ */ jsx("td", {
|
|
|
1413
1413
|
});
|
|
1414
1414
|
//#endregion
|
|
1415
1415
|
//#region src/Markdown/Markdown.tsx
|
|
1416
|
-
var
|
|
1416
|
+
var defaultRemarkPlugins = [
|
|
1417
|
+
remarkGfm,
|
|
1418
|
+
remarkYoutube,
|
|
1419
|
+
remarkMath
|
|
1420
|
+
];
|
|
1421
|
+
var Markdown = ({ children, remarkPlugins = defaultRemarkPlugins, rehypePlugins = [rehypeRaw, rehypeKatex], theme, customComponents }) => {
|
|
1417
1422
|
return /* @__PURE__ */ jsx(ReactMarkdown, {
|
|
1418
1423
|
remarkPlugins,
|
|
1419
1424
|
rehypePlugins,
|
|
@@ -2420,12 +2425,7 @@ var useDimensions = () => {
|
|
|
2420
2425
|
};
|
|
2421
2426
|
//#endregion
|
|
2422
2427
|
//#region src/Chat.tsx
|
|
2423
|
-
var
|
|
2424
|
-
remarkGfm,
|
|
2425
|
-
remarkYoutube,
|
|
2426
|
-
remarkMath
|
|
2427
|
-
];
|
|
2428
|
-
var Chat = ({ children, viewType = "console", sessions, onSelectSession, onDeleteSession, onSendMessage, onStopMessage, onFileUpload, isLoading, activeSessionId, theme: customTheme = chatTheme, onNewSession, remarkPlugins = defaultRemarkPlugins, markdownComponents, components: componentCatalog, disabled, style, className }) => {
|
|
2428
|
+
var Chat = ({ children, viewType = "console", sessions, onSelectSession, onDeleteSession, onSendMessage, onStopMessage, onFileUpload, isLoading, activeSessionId, theme: customTheme = chatTheme, onNewSession, remarkPlugins, markdownComponents, components: componentCatalog, disabled, style, className }) => {
|
|
2429
2429
|
const theme = useComponentTheme("chat", customTheme);
|
|
2430
2430
|
const [internalActiveSessionID, setInternalActiveSessionID] = useState(activeSessionId);
|
|
2431
2431
|
const { width, observe } = useDimensions();
|
|
@@ -2457,7 +2457,8 @@ var Chat = ({ children, viewType = "console", sessions, onSelectSession, onDelet
|
|
|
2457
2457
|
const activeSession = useMemo(() => sessions.find((session) => session.id === internalActiveSessionID), [sessions, internalActiveSessionID]);
|
|
2458
2458
|
const mergedRemarkPlugins = useMemo(() => {
|
|
2459
2459
|
if (!componentCatalog) return remarkPlugins;
|
|
2460
|
-
|
|
2460
|
+
if (!remarkPlugins) return;
|
|
2461
|
+
return [...remarkPlugins ?? [], componentCatalog.remarkPlugin];
|
|
2461
2462
|
}, [remarkPlugins, componentCatalog]);
|
|
2462
2463
|
const mergedMarkdownComponents = useMemo(() => {
|
|
2463
2464
|
if (!componentCatalog) return markdownComponents;
|