diff --git a/src/components/Editor.module.css b/src/components/Editor.module.css new file mode 100644 index 0000000..2555946 --- /dev/null +++ b/src/components/Editor.module.css @@ -0,0 +1,29 @@ +.editor { + :global .bangle-editor { + @apply outline-none; + } + + :global pre { + @apply bg-secondary rounded-md px-6; + } + + :global blockquote { + @apply flex flex-col justify-center border-l-8 bg-secondary/50 text-secondary-foreground px-3 py-3 gap-2; + + > * { + @apply leading-none; + } + } + + :global li[data-bangle-is-todo] { + @apply flex gap-2; + + > span:first-child > input { + @apply m-0; + } + } + + :global img { + @apply rounded-md border-none; + } +} diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 469c8f6..8c1b6f2 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -1,3 +1,4 @@ +import { cn } from '@/lib/utils'; import { blockquote, bold, @@ -12,7 +13,6 @@ import { link, listItem, orderedList, - paragraph, strike, underline, } from '@bangle.dev/base-components'; @@ -21,6 +21,7 @@ import '@bangle.dev/core/style.css'; import { markdownParser, markdownSerializer } from '@bangle.dev/markdown'; import { BangleEditor, useEditorState } from '@bangle.dev/react'; import { ComponentProps, useMemo } from 'react'; +import styles from './Editor.module.css'; // TODO: Remove this when https://github.com/bangle-io/bangle-editor/pull/272 is merged ((has) => { @@ -45,7 +46,6 @@ const specRegistry = new SpecRegistry([ link.spec(), listItem.spec(), orderedList.spec(), - paragraph.spec(), strike.spec(), underline.spec(), ]); @@ -93,7 +93,6 @@ export function DevkitEditor({ initialValue: externalInitialValue, onChange, ... link.plugins(), listItem.plugins(), orderedList.plugins(), - paragraph.plugins(), strike.plugins(), underline.plugins(), ] as any, @@ -101,12 +100,8 @@ export function DevkitEditor({ initialValue: externalInitialValue, onChange, ... }); return ( -