Skip to content

Commit a9f9dd1

Browse files
committed
Merge pull request #3712 from udecode/feat/block
Blocks
1 parent 8856588 commit a9f9dd1

36 files changed

+524
-1293
lines changed

.editorconfig

-10
This file was deleted.

README.md

+37-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
11
# Playground Template
22

3-
A minimal template for building rich-text editors with [Plate](https://platejs.org/) and Next.js 14.
3+
A minimal template for building rich-text editors with [Plate](https://platejs.org/) and Next.js 15.
44

5-
## Usage
5+
## Features
6+
7+
- Next.js 15 App Directory
8+
- [Plate](https://platejs.org/) editor
9+
- [shadcn/ui](https://ui.shadcn.com/)
10+
11+
## Installation
12+
13+
Choose one of these methods:
14+
15+
### 1. Using CLI (Recommended)
16+
17+
```bash
18+
npx shadcx@latest init -u https://platejs.org/r
19+
```
20+
21+
```bash
22+
npx shadcx@latest add editor-basic -r plate
23+
```
24+
25+
### 2. Using Template
26+
27+
[Use this template](https://github.com/plate-editor/plate-template/generate), then install dependencies:
628

729
```bash
830
pnpm install
31+
```
32+
33+
## Development
34+
35+
```bash
936
pnpm dev
1037
```
1138

12-
## Features
39+
Visit http://localhost:3000/editor to see the editor in action.
1340

14-
- Next.js 14 App Directory
15-
- [Plate](https://platejs.org/) Editor
16-
- [shadcn/ui](https://ui.shadcn.com/)
17-
- Radix UI Primitives
18-
- Tailwind CSS
19-
- Icons from [Lucide](https://lucide.dev)
20-
- Dark mode with `next-themes`
21-
- Tailwind CSS class sorting, merging and linting.
41+
## Upgrade
42+
43+
Using the CLI, you can upgrade to `editor-ai` by running:
44+
45+
```bash
46+
npx shadcx@latest add editor-ai -r plate -o
47+
```

components.json

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
{
22
"$schema": "https://ui.shadcn.com/schema.json",
3-
"style": "default",
3+
"aliases": {
4+
"components": "@/components",
5+
"hooks": "@/hooks",
6+
"lib": "@/lib",
7+
"ui": "@/components/ui",
8+
"utils": "@/lib/utils"
9+
},
10+
"registries": {
11+
"plate": {
12+
"aliases": {
13+
"ui": "@/components/plate-ui"
14+
},
15+
"url": "https://platejs.org/r"
16+
}
17+
},
418
"rsc": true,
5-
"tsx": true,
19+
"style": "default",
620
"tailwind": {
7-
"config": "tailwind.config.js",
8-
"css": "src/styles/globals.css",
921
"baseColor": "slate",
22+
"config": "tailwind.config.ts",
23+
"css": "src/app/globals.css",
1024
"cssVariables": true,
1125
"prefix": ""
1226
},
13-
"aliases": {
14-
"components": "@/components",
15-
"utils": "@/lib/utils",
16-
"ui": "@/components/plate-ui",
17-
"lib": "@/lib",
18-
"hooks": "@/hooks"
19-
},
20-
"url": "https://platejs.org/r"
21-
}
27+
"tsx": true
28+
}

next.config.mjs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {};
2+
const nextConfig = {
3+
async redirects() {
4+
return [
5+
{
6+
source: '/',
7+
destination: '/editor',
8+
permanent: true,
9+
},
10+
];
11+
},
12+
};
313

414
export default nextConfig;

package.json

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
11
{
22
"name": "plate-template",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev --turbo",
76
"build": "next build",
8-
"start": "next start",
7+
"dev": "next dev --turbo",
98
"lint": "next lint",
109
"lint:fix": "next lint --fix",
1110
"preview": "next build && next start",
11+
"start": "next start",
1212
"sync": "tsx --tsconfig ./scripts/tsconfig.scripts.json scripts/sync.mts",
1313
"typecheck": "tsc --noEmit"
1414
},
1515
"dependencies": {
16-
"@radix-ui/react-slot": "^1.1.0",
17-
"@radix-ui/react-tooltip": "^1.1.3",
1816
"@udecode/cn": "^39.0.0",
19-
"@udecode/plate-common": "^39.2.21",
2017
"@udecode/plate-basic-elements": "^39.0.0",
2118
"@udecode/plate-basic-marks": "^39.0.0",
19+
"@udecode/plate-common": "^39.2.21",
2220
"class-variance-authority": "0.7.0",
2321
"clsx": "^2.1.1",
24-
"eslint-plugin-prettier": "^5.2.1",
2522
"lucide-react": "0.454.0",
2623
"next": "^15.0.2",
27-
"next-themes": "^0.3.0",
2824
"react": "^18.3.1",
29-
"react-dnd": "^16.0.1",
30-
"react-dnd-html5-backend": "^16.0.1",
3125
"react-dom": "^18.3.1",
32-
"slate": "0.110.2",
33-
"slate-history": "0.110.3",
34-
"slate-hyperscript": "0.100.0",
35-
"slate-react": "0.110.3",
26+
"slate": "^0.110.2",
27+
"slate-history": "^0.110.3",
28+
"slate-hyperscript": "^0.100.0",
29+
"slate-react": "^0.111.0",
3630
"tailwind-merge": "2.5.4",
3731
"tailwindcss-animate": "1.0.7"
3832
},
@@ -45,8 +39,8 @@
4539
"encoding": "^0.1.13",
4640
"eslint": "^8.56.0",
4741
"eslint-config-next": "15.0.2",
48-
"eslint-plugin-perfectionist": "3.9.1",
4942
"eslint-config-prettier": "^9.1.0",
43+
"eslint-plugin-perfectionist": "3.9.1",
5044
"eslint-plugin-react": "^7.37.2",
5145
"eslint-plugin-tailwindcss": "^3.17.5",
5246
"eslint-plugin-unused-imports": "^4.1.3",

0 commit comments

Comments
 (0)