@majapisoftwares/ui 4.0.6 → 4.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.
@@ -1,8 +1,8 @@
1
- import React from "react";
2
- import { ConverterOptions } from "showdown";
1
+ import React, { ComponentProps } from "react";
2
+ import ReactMarkdown from "react-markdown";
3
3
  export type MarkdownProps = {
4
4
  children?: string;
5
5
  className?: string;
6
- options?: ConverterOptions;
6
+ options?: ComponentProps<typeof ReactMarkdown>;
7
7
  };
8
8
  export default function Markdown({ children, className, options, }: MarkdownProps): React.JSX.Element;
@@ -1,13 +1,11 @@
1
- import React, { useMemo } from "react";
1
+ import React from "react";
2
+ import ReactMarkdown from "react-markdown";
2
3
  import clsx from "../../utils/clsx";
3
- import showdown from "showdown";
4
+ import remarkGfm from "remark-gfm";
4
5
  export default function Markdown({ children, className, options, }) {
5
- const converter = useMemo(() => new showdown.Converter(options),
6
- // eslint-disable-next-line react-hooks/exhaustive-deps
7
- [JSON.stringify(options)]);
8
- return (<div className={clsx("prose prose-zinc max-w-full dark:prose-invert", className)} dangerouslySetInnerHTML={children
9
- ? {
10
- __html: converter.makeHtml(children),
11
- }
12
- : undefined}/>);
6
+ return (<div className={clsx("prose prose-zinc dark:prose-invert max-w-full", "[&_.contains-task-list]:list-none [&_.contains-task-list]:pl-0", "[&_.task-list-item_input[type='checkbox']]:-mt-1", className)}>
7
+ <ReactMarkdown remarkPlugins={[remarkGfm, ...(options?.remarkPlugins || [])]} {...options}>
8
+ {children}
9
+ </ReactMarkdown>
10
+ </div>);
13
11
  }
package/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/majapisoftwares/ui.git"
6
6
  },
7
- "version": "4.0.6",
7
+ "version": "4.1.0",
8
8
  "type": "module"
9
9
  }