-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
2,915 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use client"; | ||
import dynamic from "next/dynamic"; | ||
import "@repo/ui/css"; | ||
const Mdxeditor = dynamic( | ||
() => import("@repo/ui").then((mod) => mod.Mdxeditor), | ||
{ ssr: false } | ||
); | ||
|
||
function MdxeditorComponent() { | ||
return ( | ||
<div className=""> | ||
<Mdxeditor markdown="" className="prose max-w-none bg-slate-200" /> | ||
</div> | ||
); | ||
} | ||
|
||
export default MdxeditorComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
darkMode: ["class"], | ||
content: [ | ||
"./app/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./pages/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./components/**/*.{js,ts,jsx,tsx,mdx}", | ||
], | ||
theme: { | ||
extend: { | ||
borderRadius: { | ||
lg: 'var(--radius)', | ||
md: 'calc(var(--radius) - 2px)', | ||
sm: 'calc(var(--radius) - 4px)' | ||
}, | ||
colors: { | ||
background: 'hsl(var(--background))', | ||
foreground: 'hsl(var(--foreground))', | ||
card: { | ||
DEFAULT: 'hsl(var(--card))', | ||
foreground: 'hsl(var(--card-foreground))' | ||
}, | ||
popover: { | ||
DEFAULT: 'hsl(var(--popover))', | ||
foreground: 'hsl(var(--popover-foreground))' | ||
}, | ||
primary: { | ||
DEFAULT: 'hsl(var(--primary))', | ||
foreground: 'hsl(var(--primary-foreground))' | ||
}, | ||
secondary: { | ||
DEFAULT: 'hsl(var(--secondary))', | ||
foreground: 'hsl(var(--secondary-foreground))' | ||
}, | ||
muted: { | ||
DEFAULT: 'hsl(var(--muted))', | ||
foreground: 'hsl(var(--muted-foreground))' | ||
}, | ||
accent: { | ||
DEFAULT: 'hsl(var(--accent))', | ||
foreground: 'hsl(var(--accent-foreground))' | ||
}, | ||
destructive: { | ||
DEFAULT: 'hsl(var(--destructive))', | ||
foreground: 'hsl(var(--destructive-foreground))' | ||
}, | ||
border: 'hsl(var(--border))', | ||
input: 'hsl(var(--input))', | ||
ring: 'hsl(var(--ring))', | ||
chart: { | ||
'1': 'hsl(var(--chart-1))', | ||
'2': 'hsl(var(--chart-2))', | ||
'3': 'hsl(var(--chart-3))', | ||
'4': 'hsl(var(--chart-4))', | ||
'5': 'hsl(var(--chart-5))' | ||
} | ||
} | ||
} | ||
}, | ||
plugins: [require("tailwindcss-animate")], | ||
darkMode: ["class"], | ||
content: [ | ||
"./app/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./pages/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./components/**/*.{js,ts,jsx,tsx,mdx}", | ||
], | ||
theme: { | ||
extend: { | ||
borderRadius: { | ||
lg: 'var(--radius)', | ||
md: 'calc(var(--radius) - 2px)', | ||
sm: 'calc(var(--radius) - 4px)' | ||
}, | ||
colors: { | ||
background: 'hsl(var(--background))', | ||
foreground: 'hsl(var(--foreground))', | ||
card: { | ||
DEFAULT: 'hsl(var(--card))', | ||
foreground: 'hsl(var(--card-foreground))' | ||
}, | ||
popover: { | ||
DEFAULT: 'hsl(var(--popover))', | ||
foreground: 'hsl(var(--popover-foreground))' | ||
}, | ||
primary: { | ||
DEFAULT: 'hsl(var(--primary))', | ||
foreground: 'hsl(var(--primary-foreground))' | ||
}, | ||
secondary: { | ||
DEFAULT: 'hsl(var(--secondary))', | ||
foreground: 'hsl(var(--secondary-foreground))' | ||
}, | ||
muted: { | ||
DEFAULT: 'hsl(var(--muted))', | ||
foreground: 'hsl(var(--muted-foreground))' | ||
}, | ||
accent: { | ||
DEFAULT: 'hsl(var(--accent))', | ||
foreground: 'hsl(var(--accent-foreground))' | ||
}, | ||
destructive: { | ||
DEFAULT: 'hsl(var(--destructive))', | ||
foreground: 'hsl(var(--destructive-foreground))' | ||
}, | ||
border: 'hsl(var(--border))', | ||
input: 'hsl(var(--input))', | ||
ring: 'hsl(var(--ring))', | ||
chart: { | ||
'1': 'hsl(var(--chart-1))', | ||
'2': 'hsl(var(--chart-2))', | ||
'3': 'hsl(var(--chart-3))', | ||
'4': 'hsl(var(--chart-4))', | ||
'5': 'hsl(var(--chart-5))' | ||
} | ||
} | ||
} | ||
}, | ||
plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
packages/ui/src/components/MdxEditor/InitializedMDXEditor.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { ForwardedRef } from "react"; | ||
import { | ||
headingsPlugin, | ||
listsPlugin, | ||
quotePlugin, | ||
thematicBreakPlugin, | ||
markdownShortcutPlugin, | ||
MDXEditor, | ||
type MDXEditorMethods, | ||
type MDXEditorProps, | ||
} from "@mdxeditor/editor"; | ||
|
||
// Only import this to the next file | ||
export default function InitializedMDXEditor({ | ||
editorRef, | ||
...props | ||
}: { editorRef: ForwardedRef<MDXEditorMethods> | null } & MDXEditorProps) { | ||
return ( | ||
<MDXEditor | ||
plugins={[ | ||
headingsPlugin(), | ||
listsPlugin(), | ||
quotePlugin(), | ||
thematicBreakPlugin(), | ||
markdownShortcutPlugin(), | ||
]} | ||
{...props} | ||
ref={editorRef} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { MDXEditorMethods, MDXEditorProps } from "@mdxeditor/editor"; | ||
import { forwardRef } from "react"; | ||
import InitializedMDXEditor from "./InitializedMDXEditor.js"; | ||
// This is what is imported by other components. Pre-initialized with plugins, and ready | ||
// to accept other props, including a ref. | ||
export const Mdxeditor = forwardRef<MDXEditorMethods, MDXEditorProps>( | ||
(props, ref) => <InitializedMDXEditor {...props} editorRef={ref} /> | ||
); | ||
|
||
// TS complains without the following line | ||
Mdxeditor.displayName = "ForwardRefEditor"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { Button } from "./components/ui/button"; | ||
import "./global.css"; | ||
export { Button } from "@/src/components/ui/button"; | ||
export { Mdxeditor } from "@/src/components/MdxEditor/MdxEditor"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.