Skip to content

Commit

Permalink
feat: initialise platejs editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ixahmedxi committed Sep 5, 2024
1 parent b83ad25 commit c55ffda
Show file tree
Hide file tree
Showing 9 changed files with 803 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
9 changes: 6 additions & 3 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ words:
- callees
- classname
- clsx
- combobox
- commitlint
- compat
- esbenp
- excalidraw
- frontmatter
- healthcheck
- hookform
- ianvs
- ixahmedxi
- ixahmedxii
- jiti
- lockb
- esbenp
- lucide
- mitigations
- neondatabase
Expand All @@ -45,12 +48,12 @@ words:
- superjson
- tailwindcss
- tanstack
- timeago
- Todos
- trpc
- tsbuildinfo
- tseslint
- typecheck
- udecode
- Uploadthing
- Upstash
- healthcheck
- timeago
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,53 @@
"@trpc/client": "next",
"@trpc/react-query": "next",
"@trpc/server": "next",
"@udecode/cn": "^37.0.0",
"@udecode/plate-alignment": "^37.0.0",
"@udecode/plate-autoformat": "^37.0.0",
"@udecode/plate-basic-marks": "^37.0.0",
"@udecode/plate-block-quote": "^37.0.2",
"@udecode/plate-break": "^37.0.0",
"@udecode/plate-caption": "^37.0.1",
"@udecode/plate-code-block": "^37.0.0",
"@udecode/plate-combobox": "^37.0.0",
"@udecode/plate-comments": "^37.0.0",
"@udecode/plate-common": "^37.0.7",
"@udecode/plate-csv": "^37.0.0",
"@udecode/plate-cursor": "^37.0.0",
"@udecode/plate-date": "^37.0.0",
"@udecode/plate-dnd": "^37.0.0",
"@udecode/plate-docx": "^37.0.0",
"@udecode/plate-emoji": "^37.0.0",
"@udecode/plate-excalidraw": "^37.0.0",
"@udecode/plate-find-replace": "^37.0.0",
"@udecode/plate-floating": "^37.0.3",
"@udecode/plate-font": "^37.0.0",
"@udecode/plate-heading": "^37.0.0",
"@udecode/plate-highlight": "^37.0.0",
"@udecode/plate-horizontal-rule": "^37.0.0",
"@udecode/plate-html": "^37.0.0",
"@udecode/plate-indent": "^37.0.0",
"@udecode/plate-indent-list": "^37.0.0",
"@udecode/plate-juice": "^37.0.0",
"@udecode/plate-kbd": "^37.0.0",
"@udecode/plate-layout": "^37.0.0",
"@udecode/plate-line-height": "^37.0.0",
"@udecode/plate-link": "^37.0.3",
"@udecode/plate-list": "^37.0.0",
"@udecode/plate-markdown": "^37.0.0",
"@udecode/plate-media": "^37.0.0",
"@udecode/plate-mention": "^37.0.0",
"@udecode/plate-node-id": "^37.0.0",
"@udecode/plate-normalizers": "^37.0.0",
"@udecode/plate-paragraph": "^36.0.0",
"@udecode/plate-reset-node": "^37.0.0",
"@udecode/plate-resizable": "^37.0.0",
"@udecode/plate-select": "^37.0.0",
"@udecode/plate-selection": "^37.0.6",
"@udecode/plate-tabbable": "^37.0.0",
"@udecode/plate-table": "^37.0.0",
"@udecode/plate-toggle": "^37.0.0",
"@udecode/plate-trailing-block": "^37.0.0",
"@upstash/redis": "^1.34.0",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.12",
Expand Down
9 changes: 9 additions & 0 deletions src/app/notebook/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { PlateEditor } from '@/editor';

export default function NotebookPage() {
return (
<div className="px-6 py-4">
<PlateEditor />
</div>
);
}
26 changes: 26 additions & 0 deletions src/editor/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client';

import { createPlateEditor, Plate } from '@udecode/plate-common/react';
import { Editor } from './ui/editor';
import { createPlateUI } from './ui/components';
import { plugins } from './plugins';

export const PlateEditor = () => {
const editor = createPlateEditor({
plugins,
override: {
components: createPlateUI(),
},
});

return (
<Plate editor={editor}>
<Editor
focusRing={false}
className="max-w-2xl"
variant="ghost"
placeholder="Type here..."
/>
</Plate>
);
};
Loading

0 comments on commit c55ffda

Please sign in to comment.