@copilotkit/react-ui 1.56.2 → 1.56.4-canary.1777529757

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 CHANGED
@@ -1397,18 +1397,25 @@ const defaultComponents = {
1397
1397
  children
1398
1398
  })
1399
1399
  };
1400
- const MemoizedReactMarkdown = (0, react.memo)(react_markdown.default, (prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.components === nextProps.components && prevProps.urlTransform === nextProps.urlTransform);
1401
- const Markdown = ({ content, components, urlTransform }) => {
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
- components: (0, react.useMemo)(() => ({
1406
- ...defaultComponents,
1407
- ...components
1408
- }), [components]),
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
  });