@copilotkit/react-ui 1.56.1 → 1.56.2-canary.pin-to-send
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/index.cjs +16 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +16 -9
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +16 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/components/chat/Markdown.tsx +20 -17
package/dist/index.cjs
CHANGED
|
@@ -1397,18 +1397,25 @@ const defaultComponents = {
|
|
|
1397
1397
|
children
|
|
1398
1398
|
})
|
|
1399
1399
|
};
|
|
1400
|
-
const MemoizedReactMarkdown = (0, react.memo)(react_markdown.default
|
|
1401
|
-
const Markdown = ({ content, components,
|
|
1400
|
+
const MemoizedReactMarkdown = (0, react.memo)(react_markdown.default);
|
|
1401
|
+
const Markdown = ({ content, components, remarkPlugins, rehypePlugins, ...rest }) => {
|
|
1402
|
+
const mergedComponents = (0, react.useMemo)(() => ({
|
|
1403
|
+
...defaultComponents,
|
|
1404
|
+
...components
|
|
1405
|
+
}), [components]);
|
|
1406
|
+
const mergedRemarkPlugins = (0, react.useMemo)(() => [
|
|
1407
|
+
remark_gfm.default,
|
|
1408
|
+
[remark_math.default, { singleDollarTextMath: false }],
|
|
1409
|
+
...remarkPlugins ?? []
|
|
1410
|
+
], [remarkPlugins]);
|
|
1411
|
+
const mergedRehypePlugins = (0, react.useMemo)(() => [rehype_raw.default, ...rehypePlugins ?? []], [rehypePlugins]);
|
|
1402
1412
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1403
1413
|
className: "copilotKitMarkdown",
|
|
1404
1414
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemoizedReactMarkdown, {
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
remarkPlugins: [remark_gfm.default, [remark_math.default, { singleDollarTextMath: false }]],
|
|
1410
|
-
rehypePlugins: [rehype_raw.default],
|
|
1411
|
-
...urlTransform !== void 0 ? { urlTransform } : {},
|
|
1415
|
+
...rest,
|
|
1416
|
+
components: mergedComponents,
|
|
1417
|
+
remarkPlugins: mergedRemarkPlugins,
|
|
1418
|
+
rehypePlugins: mergedRehypePlugins,
|
|
1412
1419
|
children: content
|
|
1413
1420
|
})
|
|
1414
1421
|
});
|