@firecms/ui 3.0.0-canary.16 → 3.0.0-canary.18

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/ui",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.16",
4
+ "version": "3.0.0-canary.18",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -114,7 +114,7 @@
114
114
  "src",
115
115
  "tailwind.config.js"
116
116
  ],
117
- "gitHead": "6c7d1dd64fa4b9f31433ab6dd938835589e8a25a",
117
+ "gitHead": "56dc6d6af0b2cfb0f91ac91a4f30be6d796efd98",
118
118
  "publishConfig": {
119
119
  "access": "public"
120
120
  }
@@ -3,26 +3,37 @@ import equal from "react-fast-compare"
3
3
 
4
4
  // @ts-ignore
5
5
  import MarkdownIt from "markdown-it";
6
+ import { cn } from "../util";
6
7
 
7
8
  export interface MarkdownProps {
8
9
  source: string,
10
+ size?: "small" | "medium" | "large" | "xl" | "2xl";
9
11
  className?: string
10
12
  }
11
13
 
12
- const md = new MarkdownIt({ html: true, });
14
+ const proseClasses = {
15
+ small: "prose-sm",
16
+ medium: "prose",
17
+ large: "prose-lg",
18
+ xl: "prose-xl",
19
+ "2xl": "prose-2xl"
20
+ };
21
+
22
+ const md = new MarkdownIt({ html: true });
13
23
  /**
14
24
  * @group Preview components
15
25
  */
16
26
  export const Markdown = React.memo<MarkdownProps>(function Markdown({
17
27
  source,
18
- className
28
+ className,
29
+ size = "medium"
19
30
  }: MarkdownProps) {
20
31
  const html = useMemo(() => {
21
32
  return md.render(typeof source === "string" ? source : "");
22
33
  }, [source]);
23
34
 
24
35
  return <div
25
- className={className}
36
+ className={cn(proseClasses[size], "dark:prose-invert prose-headings:font-title", className)}
26
37
  dangerouslySetInnerHTML={{ __html: html }}
27
38
  />;
28
39
  }
@@ -7,6 +7,9 @@ export default {
7
7
  "./node_modules/firecms/src/**/*.{js,ts,jsx,tsx}",
8
8
  "./node_modules/@firecms/**/src/**/*.{js,ts,jsx,tsx}"
9
9
  ],
10
+ plugins: [
11
+ require("@tailwindcss/typography")
12
+ ],
10
13
  theme: {
11
14
  extend: {
12
15
  fontFamily: {