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 6e9697a commit bb3b812
Show file tree
Hide file tree
Showing 84 changed files with 1,191 additions and 1,581 deletions.
10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .env.example

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
},
],
plugins: ['tailwindcss', 'unused-imports', 'perfectionist', 'prettier'],

root: true,
rules: {
'@next/next/no-html-link-for-pages': 'off',
Expand Down
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
## Getting Started
# Playground Template

### Requirements
A Next.js 15 template with [Plate](https://platejs.org/) AI, plugins and components.

- Node.js
- pnpm
## Features

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

Copy the example env file:
## Installation

Choose one of these methods:

### 1. Using CLI (Recommended)

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

Set up your environment variables:

- `OPENAI_API_KEY` – OpenAI API key ([get one here](https://platform.openai.com/account/api-keys))
```bash
npx shadcx@latest add editor-ai -r plate
```

### Development
### 2. Using Template

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

```bash
pnpm install
```

2. Start the development server:
## Development

Copy the example env file:

```bash
cp .env.example .env.local
```

Configure `.env.local`:

- `OPENAI_API_KEY` – OpenAI API key ([get one here](https://platform.openai.com/account/api-keys))

Start the development server:

```bash
pnpm dev
```

Visit http://localhost:3000/editor to see the editor in action.
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
}
14 changes: 14 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
async redirects() {
return [
{
source: '/',
destination: '/editor',
permanent: true,
},
];
},
};

export default nextConfig;
5 changes: 0 additions & 5 deletions next.config.ts

This file was deleted.

57 changes: 25 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,91 +1,85 @@
{
"name": "plate-playground-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": {
"@ai-sdk/openai": "^0.0.68",
"@ariakit/react": "0.4.11",
"@ai-sdk/openai": "^0.0.71",
"@ariakit/react": "^0.4.13",
"@faker-js/faker": "^9.2.0",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-context-menu": "^2.2.1",
"@radix-ui/react-context-menu": "^2.2.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "2.1.2",
"@radix-ui/react-icons": "^1.3.1",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toolbar": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@udecode/cn": "^39.0.0",
"@udecode/plate-ai": "39.2.19",
"@udecode/plate-ai": "^39.2.19",
"@udecode/plate-alignment": "^39.0.0",
"@udecode/plate-autoformat": "^39.0.0",
"@udecode/plate-basic-elements": "^39.0.0",
"@udecode/plate-basic-marks": "^39.0.0",
"@udecode/plate-block-quote": "^39.0.0",
"@udecode/plate-break": "^39.0.0",
"@udecode/plate-callout": "^39.2.18",
"@udecode/plate-caption": "^39.0.0",
"@udecode/plate-code-block": "^39.0.0",
"@udecode/plate-combobox": "39.0.0",
"@udecode/plate-combobox": "^39.0.0",
"@udecode/plate-comments": "^39.0.0",
"@udecode/plate-common": "39.2.20",
"@udecode/plate-csv": "^39.1.6",
"@udecode/plate-common": "^39.2.21",
"@udecode/plate-cursor": "^39.2.11",
"@udecode/plate-date": "^39.0.0",
"@udecode/plate-dnd": "^39.0.0",
"@udecode/plate-docx": "39.2.13",
"@udecode/plate-docx": "^39.2.13",
"@udecode/plate-emoji": "^39.0.0",
"@udecode/plate-excalidraw": "^39.0.0",
"@udecode/plate-find-replace": "^39.0.0",
"@udecode/plate-floating": "^39.1.6",
"@udecode/plate-font": "^39.0.0",
"@udecode/plate-heading": "^39.0.0",
"@udecode/plate-highlight": "^39.0.0",
"@udecode/plate-horizontal-rule": "^39.0.0",
"@udecode/plate-html": "^39.0.0",
"@udecode/plate-indent": "^39.0.0",
"@udecode/plate-indent-list": "39.1.10",
"@udecode/plate-indent-list": "^39.1.10",
"@udecode/plate-juice": "^39.0.0",
"@udecode/plate-kbd": "^39.0.0",
"@udecode/plate-layout": "^39.0.0",
"@udecode/plate-line-height": "^39.0.0",
"@udecode/plate-link": "^39.1.9",
"@udecode/plate-list": "^39.0.0",
"@udecode/plate-markdown": "39.2.0",
"@udecode/plate-markdown": "^39.2.0",
"@udecode/plate-math": "^39.2.0",
"@udecode/plate-media": "39.2.13",
"@udecode/plate-media": "^39.2.13",
"@udecode/plate-mention": "^39.0.0",
"@udecode/plate-node-id": "^39.0.0",
"@udecode/plate-normalizers": "^39.0.0",
"@udecode/plate-reset-node": "^39.0.0",
"@udecode/plate-resizable": "^39.1.6",
"@udecode/plate-select": "^39.0.0",
"@udecode/plate-selection": "39.2.12",
"@udecode/plate-selection": "^39.2.12",
"@udecode/plate-slash-command": "^39.0.0",
"@udecode/plate-tabbable": "^39.0.0",
"@udecode/plate-table": "^39.1.6",
"@udecode/plate-toggle": "^39.0.0",
"@udecode/plate-trailing-block": "^39.0.0",
"ai": "^3.4.30",
"ai": "^3.4.33",
"class-variance-authority": "0.7.0",
"cmdk": "1.0.3",
"clsx": "^2.1.1",
"cmdk": "^1.0.4",
"date-fns": "^4.1.0",
"eslint-plugin-prettier": "^5.2.1",
"lucide-react": "0.454.0",
"next": "^15.0.2",
"next-themes": "^0.3.0",
"prismjs": "^1.29.0",
"react": "^18.3.1",
"react-day-picker": "8.10.1",
Expand All @@ -95,11 +89,10 @@
"react-lite-youtube-embed": "^2.4.0",
"react-resizable-panels": "^2.1.6",
"react-tweet": "^3.2.1",
"slate": "0.110.2",
"slate-history": "0.110.3",
"slate-hyperscript": "0.100.0",
"slate-react": "0.110.3",
"sonner": "^1.5.0",
"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 @@ -113,7 +106,7 @@
"eslint": "^8.56.0",
"eslint-config-next": "15.0.2",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-perfectionist": "^3.9.1",
"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 bb3b812

Please sign in to comment.