@copilotkit/react-ui 1.56.2 → 1.56.3

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.umd.js CHANGED
@@ -1395,18 +1395,25 @@ rehype_raw = __toESM(rehype_raw);
1395
1395
  children
1396
1396
  })
1397
1397
  };
1398
- const MemoizedReactMarkdown = (0, react.memo)(react_markdown.default, (prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.components === nextProps.components && prevProps.urlTransform === nextProps.urlTransform);
1399
- const Markdown = ({ content, components, urlTransform }) => {
1398
+ const MemoizedReactMarkdown = (0, react.memo)(react_markdown.default);
1399
+ const Markdown = ({ content, components, remarkPlugins, rehypePlugins, ...rest }) => {
1400
+ const mergedComponents = (0, react.useMemo)(() => ({
1401
+ ...defaultComponents,
1402
+ ...components
1403
+ }), [components]);
1404
+ const mergedRemarkPlugins = (0, react.useMemo)(() => [
1405
+ remark_gfm.default,
1406
+ [remark_math.default, { singleDollarTextMath: false }],
1407
+ ...remarkPlugins !== null && remarkPlugins !== void 0 ? remarkPlugins : []
1408
+ ], [remarkPlugins]);
1409
+ const mergedRehypePlugins = (0, react.useMemo)(() => [rehype_raw.default, ...rehypePlugins !== null && rehypePlugins !== void 0 ? rehypePlugins : []], [rehypePlugins]);
1400
1410
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1401
1411
  className: "copilotKitMarkdown",
1402
1412
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemoizedReactMarkdown, {
1403
- components: (0, react.useMemo)(() => ({
1404
- ...defaultComponents,
1405
- ...components
1406
- }), [components]),
1407
- remarkPlugins: [remark_gfm.default, [remark_math.default, { singleDollarTextMath: false }]],
1408
- rehypePlugins: [rehype_raw.default],
1409
- ...urlTransform !== void 0 ? { urlTransform } : {},
1413
+ ...rest,
1414
+ components: mergedComponents,
1415
+ remarkPlugins: mergedRemarkPlugins,
1416
+ rehypePlugins: mergedRehypePlugins,
1410
1417
  children: content
1411
1418
  })
1412
1419
  });