Skip to content

Commit

Permalink
Merge pull request #3712 from udecode/feat/block
Browse files Browse the repository at this point in the history
Blocks
  • Loading branch information
zbeyens committed Nov 5, 2024
1 parent 8856588 commit a9f9dd1
Show file tree
Hide file tree
Showing 36 changed files with 524 additions and 1,293 deletions.
10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

48 changes: 37 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,47 @@
# Playground Template

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

## Usage
## Features

- Next.js 15 App Directory
- [Plate](https://platejs.org/) editor
- [shadcn/ui](https://ui.shadcn.com/)

## Installation

Choose one of these methods:

### 1. Using CLI (Recommended)

```bash
npx shadcx@latest init -u https://platejs.org/r
```

```bash
npx shadcx@latest add editor-basic -r plate
```

### 2. Using Template

[Use this template](https://github.com/plate-editor/plate-template/generate), then install dependencies:

```bash
pnpm install
```

## Development

```bash
pnpm dev
```

## Features
Visit http://localhost:3000/editor to see the editor in action.

- Next.js 14 App Directory
- [Plate](https://platejs.org/) Editor
- [shadcn/ui](https://ui.shadcn.com/)
- Radix UI Primitives
- Tailwind CSS
- Icons from [Lucide](https://lucide.dev)
- Dark mode with `next-themes`
- Tailwind CSS class sorting, merging and linting.
## Upgrade

Using the CLI, you can upgrade to `editor-ai` by running:

```bash
npx shadcx@latest add editor-ai -r plate -o
```
33 changes: 20 additions & 13 deletions components.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"aliases": {
"components": "@/components",
"hooks": "@/hooks",
"lib": "@/lib",
"ui": "@/components/ui",
"utils": "@/lib/utils"
},
"registries": {
"plate": {
"aliases": {
"ui": "@/components/plate-ui"
},
"url": "https://platejs.org/r"
}
},
"rsc": true,
"tsx": true,
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/styles/globals.css",
"baseColor": "slate",
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/plate-ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"url": "https://platejs.org/r"
}
"tsx": true
}
12 changes: 11 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
async redirects() {
return [
{
source: '/',
destination: '/editor',
permanent: true,
},
];
},
};

export default nextConfig;
24 changes: 9 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
{
"name": "plate-template",
"version": "0.0.1",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"dev": "next dev --turbo",
"lint": "next lint",
"lint:fix": "next lint --fix",
"preview": "next build && next start",
"start": "next start",
"sync": "tsx --tsconfig ./scripts/tsconfig.scripts.json scripts/sync.mts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@udecode/cn": "^39.0.0",
"@udecode/plate-common": "^39.2.21",
"@udecode/plate-basic-elements": "^39.0.0",
"@udecode/plate-basic-marks": "^39.0.0",
"@udecode/plate-common": "^39.2.21",
"class-variance-authority": "0.7.0",
"clsx": "^2.1.1",
"eslint-plugin-prettier": "^5.2.1",
"lucide-react": "0.454.0",
"next": "^15.0.2",
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.3.1",
"slate": "0.110.2",
"slate-history": "0.110.3",
"slate-hyperscript": "0.100.0",
"slate-react": "0.110.3",
"slate": "^0.110.2",
"slate-history": "^0.110.3",
"slate-hyperscript": "^0.100.0",
"slate-react": "^0.111.0",
"tailwind-merge": "2.5.4",
"tailwindcss-animate": "1.0.7"
},
Expand All @@ -45,8 +39,8 @@
"encoding": "^0.1.13",
"eslint": "^8.56.0",
"eslint-config-next": "15.0.2",
"eslint-plugin-perfectionist": "3.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-perfectionist": "3.9.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-tailwindcss": "^3.17.5",
"eslint-plugin-unused-imports": "^4.1.3",
Expand Down
Loading

0 comments on commit a9f9dd1

Please sign in to comment.