diff --git a/.changeset/beige-scissors-complain.md b/.changeset/beige-scissors-complain.md
new file mode 100644
index 0000000000..7dcf53311c
--- /dev/null
+++ b/.changeset/beige-scissors-complain.md
@@ -0,0 +1,5 @@
+---
+'@udecode/plate-core': patch
+---
+
+Fix DefaultLeaf and DefaultElement props
diff --git a/.changeset/chilly-dolls-study.md b/.changeset/chilly-dolls-study.md
new file mode 100644
index 0000000000..1349e41f52
--- /dev/null
+++ b/.changeset/chilly-dolls-study.md
@@ -0,0 +1,5 @@
+---
+'@udecode/plate-callout': patch
+---
+
+useCalloutEmojiPicker
diff --git a/.changeset/curvy-mice-relate.md b/.changeset/curvy-mice-relate.md
new file mode 100644
index 0000000000..69a2c6245a
--- /dev/null
+++ b/.changeset/curvy-mice-relate.md
@@ -0,0 +1,5 @@
+---
+'@udecode/plate-markdown': patch
+---
+
+New `deserializeInlineMd` `serializeInlineMd` `stripMarkdownBlocks` `stripMarkdownInline`
diff --git a/.changeset/eight-gorillas-teach.md b/.changeset/eight-gorillas-teach.md
new file mode 100644
index 0000000000..d4fb141437
--- /dev/null
+++ b/.changeset/eight-gorillas-teach.md
@@ -0,0 +1,7 @@
+---
+'@udecode/plate-selection': patch
+---
+
+BlockSelectionPlugin: New `tf.setBlockSelectionIndent` `tf.insertBlocksAndSelect`
+
+BlockMenuPlugin: Now when the left mouse button is clicked and the menu is open, the default event will not be prevented.
diff --git a/.changeset/fresh-spoons-float.md b/.changeset/fresh-spoons-float.md
new file mode 100644
index 0000000000..8a9218093a
--- /dev/null
+++ b/.changeset/fresh-spoons-float.md
@@ -0,0 +1,5 @@
+---
+'@udecode/plate-math': patch
+---
+
+New `editor.tf.insert.equation` `editor.tf.insert.inlineEquation`
diff --git a/.changeset/new-socks-know.md b/.changeset/new-socks-know.md
new file mode 100644
index 0000000000..1e3a10db72
--- /dev/null
+++ b/.changeset/new-socks-know.md
@@ -0,0 +1,5 @@
+---
+'@udecode/plate-callout': patch
+---
+
+New `editor.tf.insert.callout`
diff --git a/.changeset/small-months-report.md b/.changeset/small-months-report.md
new file mode 100644
index 0000000000..ca3ec99f90
--- /dev/null
+++ b/.changeset/small-months-report.md
@@ -0,0 +1,6 @@
+---
+'@udecode/plate-media': patch
+---
+
+New `editor.tf.insert.audioPlaceholder` `editor.tf.insert.filePlaceholder` `editor.tf.insert.imagePlaceholder` `editor.tf.insert.videoPlaceholder`
+
diff --git a/.changeset/sour-cobras-tease.md b/.changeset/sour-cobras-tease.md
new file mode 100644
index 0000000000..e8f705a775
--- /dev/null
+++ b/.changeset/sour-cobras-tease.md
@@ -0,0 +1,5 @@
+---
+'@udecode/plate-ai': patch
+---
+
+ `CopilotPlugin`, `AIPlugin` is ready from this version.
diff --git a/README.md b/README.md
index 39f81de7fb..525cadba56 100644
--- a/README.md
+++ b/README.md
@@ -35,11 +35,12 @@ Plate
You can choose one of the following templates to get started:
-| Option | NextJS | Tailwind | Plate | Plugins |
-| --------------------------------------------------------------------------------- | ------ | -------- | ----- | ------- |
-| [Plate playground template](https://github.com/udecode/plate-playground-template) | ✅ | ✅ | ✅ | ✅ |
-| [Plate minimal template](https://github.com/udecode/plate-template) | ✅ | ✅ | ✅ | |
-| [NextJS template](https://platejs.org/docs/components/installation/next) | ✅ | ✅ | | |
+| Option | NextJS | Plate | Plugins |AI & Backend |
+| --------------------------------------------------------------------------------- | ------ | ----- | ------- |-------- |
+| [Notion clone template](https://pro.platejs.org/docs/templates/potion) | ✅ | ✅ | ✅ |✅ |
+| [Plate playground template](https://github.com/udecode/plate-playground-template) | ✅ | ✅ | ✅ | |
+| [Plate minimal template](https://github.com/udecode/plate-template) | ✅ | ✅ | | |
+| [NextJS template](https://platejs.org/docs/components/installation/next) | ✅ | | | |
## Documentation
diff --git a/apps/www/content/docs/ai.mdx b/apps/www/content/docs/ai.mdx
new file mode 100644
index 0000000000..5464b3256c
--- /dev/null
+++ b/apps/www/content/docs/ai.mdx
@@ -0,0 +1,432 @@
+---
+title: AI
+description: AI menu with commands, streaming responses in a preview or directly into the editor.
+docs:
+ - route: https://pro.platejs.org/docs/examples/ai
+ title: AI Menu
+---
+
+
+
+
+
+## Features
+
+- Combobox menu with predefined commands:
+ - Generate: continue writing, add summary, explain
+ - Edit: improve writing, make it longer or shorter, fix spelling & grammar, simplify language
+- Three trigger modes:
+ - Cursor mode: trigger at block end
+ - Selection mode: trigger with selected text
+ - Block selection mode: trigger with selected blocks
+- Streaming responses in preview or direct editor insertion
+- Markdown support
+- Built-in support for Vercel AI SDK chat API
+
+
+
+## Installation
+
+```bash
+npm install @udecode/plate-ai @udecode/plate-selection @udecode/plate-markdown @udecode/plate-basic-marks
+```
+
+## Usage
+
+### Plugins
+
+```tsx
+import { withProps } from '@udecode/cn';
+import { AIChatPlugin, AIPlugin } from '@udecode/plate-ai/react';
+import {
+ BoldPlugin,
+ CodePlugin,
+ ItalicPlugin,
+ StrikethroughPlugin,
+ UnderlinePlugin,
+} from '@udecode/plate-basic-marks/react';
+import { PlateLeaf, createPlateEditor } from '@udecode/plate-common/react';
+import { LinkPlugin } from '@udecode/plate-link/react';
+import { MarkdownPlugin } from '@udecode/plate-markdown';
+```
+
+```tsx
+export const createAIEditor = () => {
+ const editor = createPlateEditor({
+ id: 'ai',
+ override: {
+ components: {
+ [BoldPlugin.key]: withProps(PlateLeaf, { as: 'strong' }),
+ [CodePlugin.key]: CodeLeaf,
+ [ItalicPlugin.key]: withProps(PlateLeaf, { as: 'em' }),
+ [LinkPlugin.key]: LinkElement,
+ [StrikethroughPlugin.key]: withProps(PlateLeaf, { as: 's' }),
+ [UnderlinePlugin.key]: withProps(PlateLeaf, { as: 'u' }),
+ },
+ },
+ plugins: [
+ BoldPlugin,
+ ItalicPlugin,
+ UnderlinePlugin,
+ StrikethroughPlugin,
+ CodePlugin,
+ ],
+ value: [{ children: [{ text: '' }], type: 'p' }],
+ });
+
+ return editor;
+};
+
+const systemCommon = `\
+You are an advanced AI-powered note-taking assistant, designed to enhance productivity and creativity in note management.
+Respond directly to user prompts with clear, concise, and relevant content. Maintain a neutral, helpful tone.
+
+Rules:
+- is the entire note the user is working on.
+- is a reminder of how you should reply to INSTRUCTIONS. It does not apply to questions.
+- Anything else is the user prompt.
+- Your response should be tailored to the user's prompt, providing precise assistance to optimize note management.
+- For INSTRUCTIONS: Follow the exactly. Provide ONLY the content to be inserted or replaced. No explanations or comments.
+- For QUESTIONS: Provide a helpful and concise answer. You may include brief explanations if necessary.
+- CRITICAL: Distinguish between INSTRUCTIONS and QUESTIONS. Instructions typically ask you to modify or add content. Questions ask for information or clarification.
+`;
+
+const systemDefault = `\
+${systemCommon}
+- is the current block of text the user is working on.
+- Ensure your output can seamlessly fit into the existing structure.
+- CRITICAL: Provide only a single block of text. DO NOT create multiple paragraphs or separate blocks.
+
+{block}
+
+`;
+
+const systemSelecting = `\
+${systemCommon}
+- is the block of text containing the user's selection, providing context.
+- Ensure your output can seamlessly fit into the existing structure.
+- is the specific text the user has selected in the block and wants to modify or ask about.
+- Consider the context provided by , but only modify . Your response should be a direct replacement for .
+
+{block}
+
+
+{selection}
+
+`;
+
+const systemBlockSelecting = `\
+${systemCommon}
+- represents the full blocks of text the user has selected and wants to modify or ask about.
+- Your response should be a direct replacement for the entire .
+- Maintain the overall structure and formatting of the selected blocks, unless explicitly instructed otherwise.
+- CRITICAL: Provide only the content to replace . Do not add additional blocks or change the block structure unless specifically requested.
+
+{block}
+
+`;
+
+const userDefault = `
+CRITICAL: DO NOT use block formatting. You can only use inline formatting.
+CRITICAL: DO NOT start new lines or paragraphs.
+NEVER write .
+
+{prompt}`;
+
+const userSelecting = `
+If this is a question, provide a helpful and concise answer about .
+If this is an instruction, provide ONLY the text to replace . No explanations.
+Ensure it fits seamlessly within . If is empty, write ONE random sentence.
+NEVER write or .
+
+{prompt} about `;
+
+const userBlockSelecting = `
+If this is a question, provide a helpful and concise answer about .
+If this is an instruction, provide ONLY the content to replace the entire . No explanations.
+Maintain the overall structure unless instructed otherwise.
+NEVER write or .
+
+{prompt} about `;
+
+export const PROMPT_TEMPLATES = {
+ systemBlockSelecting,
+ systemDefault,
+ systemSelecting,
+ userBlockSelecting,
+ userDefault,
+ userSelecting,
+};
+
+const plugins = [
+ // ...otherPlugins,
+ MarkdownPlugin.configure({ options: { indentList: true } }),
+ AIPlugin,
+ AIChatPlugin.configure({
+ options: {
+ createAIEditor,
+ promptTemplate: ({ isBlockSelecting, isSelecting }) => {
+ return isBlockSelecting
+ ? PROMPT_TEMPLATES.userBlockSelecting
+ : isSelecting
+ ? PROMPT_TEMPLATES.userSelecting
+ : PROMPT_TEMPLATES.userDefault;
+ },
+ scrollContainerSelector: '#scroll_container',
+ systemTemplate: ({ isBlockSelecting, isSelecting }) => {
+ return isBlockSelecting
+ ? PROMPT_TEMPLATES.systemBlockSelecting
+ : isSelecting
+ ? PROMPT_TEMPLATES.systemSelecting
+ : PROMPT_TEMPLATES.systemDefault;
+ },
+ },
+ render: { afterEditable: () => },
+ }),
+ SelectionOverlayPlugin,
+];
+```
+
+- [AIMenu](/docs/components/ai-menu)
+
+The [SelectionOverlayPlugin](https://pro.platejs.org/docs/components/cursor-overlay):
+
+- Maintains selection highlight when editor loses focus
+- Essential for AI menu and other external input interactions
+- Prevents double selection with `data-plate-prevent-overlay` attribute
+
+### AI SDK
+
+This plugin is depending on the [ai](https://npmjs.com/package/ai) package:
+
+- Setup a [route handler](https://sdk.vercel.ai/docs/getting-started/nextjs-app-router#create-a-route-handler) using [streamText](https://sdk.vercel.ai/docs/ai-sdk-core/generating-text#streamtext).
+- Wire up [useChat](https://sdk.vercel.ai/docs/reference/ai-sdk-ui/use-chat) in your [AI menu](/docs/components/ai-menu) component.
+
+
+## Keyboard Shortcuts
+
+
+
+ Open AI menu in empty block (cursor mode)
+
+
+ Open AI menu (cursor or selection mode)
+
+ Close AI menu
+
+
+## Examples
+
+### Plate UI
+
+Refer to the preview above.
+
+### Plate Plus
+
+- Combobox menu with free-form prompt input
+- Additional trigger methods:
+ - Block menu button
+ - Slash command menu
+- Beautifully crafted UI
+
+
+
+
+## Plugins
+
+### AIPlugin
+
+Extends the editor with AI transforms.
+
+### AIChatPlugin
+
+Enables chat operations and streaming text generation in the editor.
+
+
+
+ Chat helpers returned by [useChat](https://sdk.vercel.ai/docs/reference/ai-sdk-ui/use-chat).
+
+
+
+
+Function to create editor instance for preview mode.
+
+- **Default:** Creates a basic editor with id 'ai'
+
+
+
+
+
+Specifies how assistant messages are handled:
+
+- `'chat'`: Shows preview with accept/reject options (default)
+- `'insert'`: Directly inserts content into editor
+- **Default:** `'chat'`
+
+
+
+
+
+Whether the AI chat is open.
+
+- **Default:** `false`
+
+
+
+
+
+Template for generating prompts. Supports placeholders:
+
+- `{block}`: Markdown of blocks in selection
+- `{editor}`: Markdown of entire editor content
+- `{selection}`: Markdown of current selection
+- `{prompt}`: Actual user prompt
+- **Default:** `'{prompt}'`
+
+
+
+
+
+CSS selector for scrollable container.
+
+- **Default:** `'#scroll_container'`
+
+
+
+
+
+Template for system messages. Supports same placeholders as `promptTemplate`.
+
+- **Default:** `undefined`
+
+
+
+
+## API
+
+### editor.aiChat.accept()
+
+Accepts the current AI suggestion:
+
+- Removes AI marks from the content
+- Hides the AI chat interface
+- Focuses the editor
+
+### editor.aiChat.insertBelow()
+
+Inserts AI content below the current block.
+
+
+
+ Editor containing the content to insert.
+
+
+
+Handles both block selection and normal selection modes:
+
+- In block selection: Inserts after the last selected block
+- In normal selection: Inserts after the current block
+
+### editor.aiChat.replaceSelection()
+
+Replaces the current selection with AI content.
+
+
+
+ Editor containing the content to replace with.
+
+
+
+Handles both block selection and normal selection modes:
+
+- In block selection: Replaces all selected blocks
+- In normal selection: Replaces the current selection
+
+### editor.aiChat.reset()
+
+Resets the chat state:
+
+- Stops any ongoing generation
+- Clears chat messages
+- Removes all AI nodes from the editor
+
+### editor.aiChat.submit()
+
+Submits a prompt to generate AI content.
+
+
+
+
+
+ Mode to use. Defaults to 'chat' for selection, 'insert' otherwise.
+
+
+ Custom prompt. Uses chat input if not provided.
+
+
+ Custom system message.
+
+
+
+
+
+In insert mode, undoes previous AI changes before submitting.
+
+## Transforms
+
+### editor.ai.insertNodes()
+
+Inserts AI-generated nodes with the AI mark.
+
+
+
+ Nodes to insert with AI mark.
+
+
+
+
+ Target path. Defaults to current selection.
+
+
+
+
+
+### editor.ai.removeMarks()
+
+Removes AI marks from nodes in the specified location.
+
+
+
+
+
+ Location to remove marks from. Defaults to entire document.
+
+
+
+
+
+### editor.ai.removeNodes()
+
+Removes nodes that have the AI mark.
+
+
+
+
+
+ Path to remove nodes from. Defaults to entire document.
+
+
+
+
+
+### editor.ai.undo()
+
+Special undo operation for AI changes:
+
+- Undoes the last operation if it was AI-generated
+- Removes the redo stack entry to prevent redoing AI operations
diff --git a/apps/www/content/docs/api/core/plate.mdx b/apps/www/content/docs/api/core/plate.mdx
index abd247f8ef..8f03361f75 100644
--- a/apps/www/content/docs/api/core/plate.mdx
+++ b/apps/www/content/docs/api/core/plate.mdx
@@ -17,7 +17,7 @@ Children components have access to the plate store.
A controlled `editor` instance. This prop is required.
-See Slate docs.
+See [Slate docs](https://docs.slatejs.org/concepts/09-rendering#decorations).
Controlled callback called when the editor state changes.
diff --git a/apps/www/content/docs/api/core/store.mdx b/apps/www/content/docs/api/core/store.mdx
index 9cc3a5aa15..e4cead40b0 100644
--- a/apps/www/content/docs/api/core/store.mdx
+++ b/apps/www/content/docs/api/core/store.mdx
@@ -3,7 +3,7 @@ title: Store
description: API reference for Plate store.
---
-`Plate` is using jotai to store the state of the editor.
+`Plate` is using [jotai](https://github.com/pmndrs/jotai) to store the state of the editor.
**Note**: To use the store hooks in a component, it needs to be rendered
@@ -32,9 +32,9 @@ A unique ID used as a provider scope. Use it if you have multiple `Plate` in the
Function used to decorate ranges in the editor.
-``ts
+```ts
(options: { editor: PlateEditor; entry: TNodeEntry }) => Range[]
-``
+```
@@ -44,25 +44,25 @@ Whether `Editable` is rendered so slate DOM is resolvable.
Controlled callback called when the editor state changes.
-``ts
+```ts
(options: { editor: PlateEditor; value: ValueOf }) => void
-``
+```
Controlled callback called when the editor.selection changes.
-``ts
+```ts
(options: { editor: PlateEditor; selection: TSelection }) => void
-``
+```
Controlled callback called when the editor.children changes.
-``ts
+```ts
(options: { editor: PlateEditor; value: ValueOf }) => void
-``
+```
@@ -115,14 +115,14 @@ The following store keys are exposed in `editor.setPlateState`:
Use `usePlateSelectors(id).()` when you need to subscribe to a value.
- **Example:** `const value = usePlateSelectors(id).value()` will subscribe to `value` changes.
-- It's using useAtomValue under the hood.
+- It's using [useAtomValue](https://jotai.org/docs/utils/use-atom-value) under the hood.
## Actions
Use `usePlateStates(id).()` when you need both the value and the setter of a store property.
- **Example:** `const [value, setValue] = usePlateStates(id).value()`
-- It's using useAtom under the hood.
+- It's using [useAtom](https://jotai.org/docs/basics/primitives#use-atom) under the hood.
### `useRedecorate`
diff --git a/apps/www/content/docs/api/slate-react.mdx b/apps/www/content/docs/api/slate-react.mdx
index cb45fbf4de..b3ef616505 100644
--- a/apps/www/content/docs/api/slate-react.mdx
+++ b/apps/www/content/docs/api/slate-react.mdx
@@ -7,7 +7,7 @@ description: API reference for @udecode/slate-react.
## React Editor
-Find the corresponding documentation in the Slate React docs.
+Find the corresponding documentation in the [Slate React docs](https://docs.slatejs.org/libraries/slate-react/react-editor).
### `SlateProps`
diff --git a/apps/www/content/docs/api/slate.mdx b/apps/www/content/docs/api/slate.mdx
index 003cfa603d..2b40cdf487 100644
--- a/apps/www/content/docs/api/slate.mdx
+++ b/apps/www/content/docs/api/slate.mdx
@@ -7,7 +7,7 @@ description: API reference for @udecode/slate.
## Editor
-Find the corresponding documentation in the Slate docs.
+Find the corresponding documentation in the [Slate docs](https://docs.slatejs.org/api/transforms).
### `addMark`
@@ -119,7 +119,7 @@ Find the corresponding documentation in the Slate docs.
+Find the corresponding documentation in the [Slate docs](https://docs.slatejs.org/api/nodes/element).
### `elementMatches`
@@ -133,7 +133,7 @@ Find the corresponding documentation in the Slate docs.
+Find the corresponding documentation in the [Slate docs](https://docs.slatejs.org/libraries/slate-history).
### `isHistoryEditor`
@@ -147,7 +147,7 @@ Find the corresponding documentation in the Slate docs.
+Find the corresponding documentation in the [Slate docs](https://docs.slatejs.org/api/nodes/node).
### `TDescendant`
@@ -209,7 +209,7 @@ Find the corresponding documentation in the Slate docs.
+Find the corresponding documentation in the [Slate docs](https://docs.slatejs.org/api/locations/range).
### `isCollapsed`
@@ -217,7 +217,7 @@ Find the corresponding documentation in the Slate docs.
+Find the corresponding documentation in the [Slate docs](https://docs.slatejs.org/api/nodes/text).
### `isText`
@@ -231,7 +231,7 @@ Find the corresponding documentation in the Slate docs.
+Find the corresponding documentation in the [Slate docs](https://docs.slatejs.org/api/transforms).
### `moveNodes`
diff --git a/apps/www/content/docs/block-menu.mdx b/apps/www/content/docs/block-menu.mdx
new file mode 100644
index 0000000000..2d4dc948a0
--- /dev/null
+++ b/apps/www/content/docs/block-menu.mdx
@@ -0,0 +1,137 @@
+---
+title: Block Menu
+description: Provides quick access to block-specific actions.
+docs:
+ - route: /docs/components/block-context-menu
+ title: Block Context Menu
+
+ - route: https://pro.platejs.org/docs/components/block-menu
+ title: Block Menu
+
+ - route: https://pro.platejs.org/docs/components/block-context-menu
+ title: Block Context Menu
+
+---
+
+
+
+
+
+## Features
+
+- Right-click on a block to open the menu.
+- Allows you to perform actions on blocks such as turn into, duplicating or deleting.
+- Customizable menu items and actions.
+- Keyboard navigation
+
+
+
+## Installation
+
+```bash
+npm install @udecode/plate-selection @udecode/plate-node-id
+```
+
+## Usage
+
+```tsx
+import { BlockMenuPlugin } from '@udecode/plate-selection/react';
+import { NodeIdPlugin } from '@udecode/plate-node-id';
+```
+
+```tsx
+const plugins = [
+ // ...otherPlugins,
+ NodeIdPlugin,
+ BlockSelectionPlugin.configure({
+ options: {
+ areaOptions: {
+ behaviour: {
+ scrolling: {
+ speedDivider: 1.5,
+ },
+ startThreshold: 10,
+ },
+ boundaries: '#scroll_container',
+ container: '#scroll_container',
+ selectables: '#scroll_container .slate-selectable',
+ selectionAreaClass: 'slate-selection-area',
+ },
+ enableContextMenu: true,
+ },
+ }),
+ BlockMenuPlugin.configure({
+ render: { aboveEditable: BlockContextMenu },
+ }),
+]
+```
+
+- [BlockContextMenu](/docs/components/block-context-menu)
+
+To control the opening of the context menu for specific elements, you can use the `data-plate-open-context-menu` attribute:
+
+```tsx
+
+ {children}
+
+```
+
+Generally, we only need to prevent right-clicking on the padding of the ``.
+
+## Examples
+
+### Plate UI
+
+Refer to the preview above.
+
+### Plate Plus
+
+- Open the menu via the drag button or the three-dot menu on specific blocks (e.g. images)
+- Includes a combobox that filters options as you type
+- Supports nested menu options
+- Advanced actions such as "Ask AI", colors, and commenting
+- Beautifully crafted UI
+
+
+
+## Plugins
+
+### BlockMenuPlugin
+
+Block menu state management.
+
+## API
+
+### editor.api.blockMenu.hide
+
+Hides the block menu.
+
+### editor.api.blockMenu.show
+
+Shows the block menu for a specific block.
+
+
+
+ The ID of the block to show the menu for.
+
+
+ The position to show the menu at.
+
+
+
+### editor.api.blockMenu.showContextMenu
+
+Shows the context menu for a specific block.
+
+
+
+ The ID of the block to show the context menu for.
+
+
+ The position to show the context menu at.
+
+
diff --git a/apps/www/content/docs/block-selection.mdx b/apps/www/content/docs/block-selection.mdx
index 1dee154020..3f4c13ff23 100644
--- a/apps/www/content/docs/block-selection.mdx
+++ b/apps/www/content/docs/block-selection.mdx
@@ -3,7 +3,7 @@ title: Block Selection
description: Select and manipulate entire text blocks.
---
-
+
@@ -50,8 +50,9 @@ To control the scrollable container, configure the `boundaries` and `container`
For this to work effectively:
-1. Add an `id` or `className` to your scroll container.
+1. Add an `id` or `className` to your scroll container.If you not sure about the container, you can add it to the `` component.
2. Use the appropriate selector in your configuration.
+3. Don't forget to set `position: relative` to your scroll container.
Example configuration:
@@ -93,6 +94,46 @@ Example:
/>
```
+### Set scroll speed
+
+useing `options.areaOptions.behaviour.scrolling.speedDivider` to set the scroll speed.
+
+The value of `1.5` is our recommended speed.Since it's same with the default speed of the browser.
+
+
+```ts
+ areaOptions: {
+ behaviour: {
+ scrolling: {
+ speedDivider: 1.5,
+ },
+ },
+ },
+```
+
+Full configuration recommended:
+
+```ts
+options: {
+ areaOptions: {
+ behaviour: {
+ scrolling: {
+ speedDivider: 1.5,
+ },
+ // The distance needed to move for the selection area to appear.
+ // If it’s too small, it may cause the mouse click event to be blocked. 30 is a good default.
+ startThreshold: 30,
+ },
+ boundaries: '#your-scroll-container-id',
+ container: '#your-scroll-container-id',
+ selectables: '#your-scroll-container-id .slate-selectable',
+ selectionAreaClass: 'slate-selection-area',
+ },
+ // if not using plate-ui context menu, set it to false
+ enableContextMenu: true,
+},
+```
+
## Styling
### Selection area
diff --git a/apps/www/content/docs/callout.mdx b/apps/www/content/docs/callout.mdx
new file mode 100644
index 0000000000..f885712d01
--- /dev/null
+++ b/apps/www/content/docs/callout.mdx
@@ -0,0 +1,158 @@
+---
+title: Callout
+description: Highlight important information or add special notes.
+docs:
+ - route: https://pro.platejs.org/docs/components/callout-element
+ title: Callout Element
+---
+
+
+
+
+
+## Features
+
+- Customizable callout blocks for highlighting important information
+- Support for different callout variants (e.g., info, warning, error)
+- Ability to set custom icons or emojis for callouts
+
+
+
+## Installation
+
+
+```bash
+npm install @udecode/plate-callout
+```
+
+## Usage
+
+```tsx
+import { CalloutPlugin } from '@udecode/plate-callout/react';
+```
+
+```tsx
+const plugins = [
+ // ...otherPlugins,
+ CalloutPlugin,
+]
+```
+
+```tsx
+const components = {
+ // ...otherComponents,
+ [CalloutPlugin.key]: CalloutElement,
+}
+```
+
+- [CalloutElement](https://pro.platejs.org/docs/components/callout-element) (Plus)
+
+## Examples
+
+### Plate UI
+
+Work in progress.
+
+### Plate Plus
+
+- Insert callouts using the slash command
+- Ability to change the callout emoji
+- Beautifully crafted UI
+
+
+
+## Plugins
+
+### CalloutPlugin
+
+Callout element plugin.
+
+## Transforms
+
+### editor.tf.insert.callout
+
+Inserts a callout element into the editor.
+
+
+
+ The editor instance.
+
+
+ Options for inserting the callout.
+
+
+ The variant of the callout to insert.
+
+
+ Other options from `InsertNodesOptions`.
+
+
+
+
+
+## Hooks
+
+### useCalloutEmojiPicker
+
+This hook manages the emoji picker functionality for callouts.
+
+
+
+ Options for the callout emoji picker.
+
+
+ Whether the emoji picker is open.
+
+
+ Function to set the open state of the emoji picker.
+
+
+
+
+
+
+
+ Props for the emoji toolbar dropdown.
+
+
+ Whether the emoji picker is open.
+
+
+ Function to set the open state of the emoji picker, respecting read-only mode.
+
+
+
+
+ Props for the emoji picker component.
+
+
+ Whether the emoji picker is open.
+
+
+ Function to set the open state of the emoji picker.
+
+
+ Function called when an emoji is selected. It updates the callout's icon and closes the picker.
+
+
+
+
+
+## Types
+
+### TCalloutElement
+
+```typescript
+interface TCalloutElement extends TElement {
+ variant?: string;
+ icon?: string;
+}
+```
diff --git a/apps/www/content/docs/collaboration.mdx b/apps/www/content/docs/collaboration.mdx
index b0cf457ea1..3001f78b77 100644
--- a/apps/www/content/docs/collaboration.mdx
+++ b/apps/www/content/docs/collaboration.mdx
@@ -13,7 +13,7 @@ description: Collaborate with others in a single document.
## Features
-- The yjs plugin enables support for collaboration using slate-yjs and Hocuspocus.
+- The yjs plugin enables support for collaboration using [slate-yjs](https://docs.slate-yjs.dev/) and [Hocuspocus](https://docs.slate-yjs.dev/walkthroughs/collaboration-hocuspocus).
@@ -45,7 +45,7 @@ const editor = createPlateEditor({
## Backend
-Follow the backend instructions in Hocuspocus docs.
+Follow the backend instructions in [Hocuspocus docs](https://tiptap.dev/hocuspocus/getting-started).
## Plugins
@@ -56,7 +56,7 @@ Follow the backend instructions in WithCursorsOptions API.
+- [WithCursorsOptions API](https://docs.slate-yjs.dev/api/slate-yjs-core/cursor-plugin#withcursors).
Configuration for the Hocuspocus provider.
-- HocuspocusProviderConfiguration API.
+- [HocuspocusProviderConfiguration API](https://tiptap.dev/hocuspocus/provider/configuration).
Optional configuration for the Yjs integration. These options are passed to
the `withYjs` function.
-- WithYjsOptions API.
+- [WithYjsOptions API](https://docs.slate-yjs.dev/api/slate-yjs-core/yjs-plugin#withyjs).
@@ -102,7 +102,7 @@ Higher-order function that wraps a Plate editor with Yjs support, allowing for r
-Extends `YjsEditorProps` and CursorEditor.
+Extends `YjsEditorProps` and [CursorEditor](https://docs.slate-yjs.dev/api/slate-yjs-core/cursor-plugin#cursoreditor).
@@ -122,8 +122,8 @@ The Hocuspocus provider instance.
### YHistoryEditorProps
-Extends `YjsEditorProps`, YHistoryEditor.
+Extends `YjsEditorProps`, [YHistoryEditor](https://docs.slate-yjs.dev/api/slate-yjs-core/history-plugin#yhistoryeditor).
### YjsEditorProps
-YjsEditor API.
\ No newline at end of file
+[YjsEditor API](https://docs.slate-yjs.dev/api/slate-yjs-core/yjs-plugin#yjseditor).
diff --git a/apps/www/content/docs/components/ai-leaf.mdx b/apps/www/content/docs/components/ai-leaf.mdx
new file mode 100644
index 0000000000..c906b19bdd
--- /dev/null
+++ b/apps/www/content/docs/components/ai-leaf.mdx
@@ -0,0 +1,77 @@
+---
+title: AI Leaf
+description: Opens the AI menu from the editor toolbar.
+component: true
+docs:
+ - route: /docs/ai
+ title: AI
+ - route: https://pro.platejs.org/docs/components/ai-leaf
+ title: AI Leaf
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add ai-leaf -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+- [AI](/docs/ai)
+
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+## Plate Plus
+
+In Plate Plus, we provides more advanced styles and complete backend setup
+
+All of the backend setup is available in [Potion template](https://pro.platejs.org/docs/templates/potion).
+
+
diff --git a/apps/www/content/docs/components/ai-menu.mdx b/apps/www/content/docs/components/ai-menu.mdx
new file mode 100644
index 0000000000..957cfaffa1
--- /dev/null
+++ b/apps/www/content/docs/components/ai-menu.mdx
@@ -0,0 +1,87 @@
+---
+title: AI Menu
+description: AI-powered menu for generating and inserting content in the editor.
+component: true
+docs:
+ - route: /docs/ai
+ title: AI
+ - route: https://pro.platejs.org/docs/components/ai-menu
+ title: AI Menu
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add ai-menu -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+```bash
+npm install ai sonner
+```
+
+- [AI](/docs/ai)
+- [Command](/docs/components/command)
+- [Popover](/docs/components/popover)
+
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+
+
+## Plate Plus
+
+In Plate Plus, we provides more advanced styles and complete backend setup
+
+All of the backend setup is available in [Potion template](https://pro.platejs.org/docs/templates/potion).
+
+
diff --git a/apps/www/content/docs/components/ai-toolbar-button.mdx b/apps/www/content/docs/components/ai-toolbar-button.mdx
new file mode 100644
index 0000000000..ca468a3dad
--- /dev/null
+++ b/apps/www/content/docs/components/ai-toolbar-button.mdx
@@ -0,0 +1,78 @@
+---
+title: AI Toolbar Button
+description: AI toolbar button
+component: true
+docs:
+ - route: /docs/ai
+ title: AI
+ - route: https://pro.platejs.org/docs/components/ai-toolbar-button
+ title: AI Toolbar Button
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add ai-toolbar-button -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+- [AI](/docs/ai)
+- [Toolbar](/docs/components/toolbar)
+
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+## Plate Plus
+
+In Plate Plus, we provides more advanced styles and complete backend setup
+
+All of the backend setup is available in [Potion template](https://pro.platejs.org/docs/templates/potion).
+
+
diff --git a/apps/www/content/docs/components/block-context-menu.mdx b/apps/www/content/docs/components/block-context-menu.mdx
new file mode 100644
index 0000000000..34acb7b461
--- /dev/null
+++ b/apps/www/content/docs/components/block-context-menu.mdx
@@ -0,0 +1,85 @@
+---
+title: Block Context Menu
+description: Display a context menu for blocks.
+component: true
+docs:
+ - route: /docs/block-menu
+ title: Block Menu
+
+ - route: https://pro.platejs.org/docs/components/block-context-menu
+ title: Block Context Menu
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add block-context-menu -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+```bash
+npm install @radix-ui/react-context-menu
+```
+- [ContextMenu](/docs/components/context-menu)
+- [BlockSelection](/docs/block-selection)
+- [BlockMenu](/docs/block-menu)
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+## Plus
+
+In Plate Plus, We have provided a more advanced menu.
+
+1. More advanced menu items.
+2. Supports search functionality and carefully designed shortcuts.
+3. More refined styles and animations.
+4. You can open this menu in various ways, such as through the drag button.
+
+
diff --git a/apps/www/content/docs/components/blockquote-element.mdx b/apps/www/content/docs/components/blockquote-element.mdx
index b030cbb009..810ab525f2 100644
--- a/apps/www/content/docs/components/blockquote-element.mdx
+++ b/apps/www/content/docs/components/blockquote-element.mdx
@@ -5,6 +5,8 @@ component: true
docs:
- route: /docs/basic-elements
title: Block Quote
+ - route: https://pro.platejs.org/docs/components/blockquote-element
+ title: Block Quote
---
## Installation
@@ -60,3 +62,22 @@ Update the import paths to match your project setup.
+
+## Plus
+
+In Plate Plus, we have enhanced the block quote functionality:
+
+- Optimized quote styling for a more polished appearance
+- Added the ability to convert any element into a block quote using:
+ - The toolbar
+ - The right-click context menu
+ - The plus button next to the DnD button.
+- Improved user experience for working with block quotes
+
+These enhancements make it easier and more intuitive to use block quotes in your content.
+
+
diff --git a/apps/www/content/docs/components/caption.mdx b/apps/www/content/docs/components/caption.mdx
index 77a9915be6..836fffdcb1 100644
--- a/apps/www/content/docs/components/caption.mdx
+++ b/apps/www/content/docs/components/caption.mdx
@@ -5,6 +5,8 @@ component: true
docs:
- route: /docs/caption
title: Caption
+ - route: https://pro.platejs.org/docs/components/media-toolbar
+ title: Media Toolbar
---
## Installation
@@ -63,3 +65,18 @@ Update the import paths to match your project setup.
+
+
+## Plus
+
+In Plate Plus, we have enhanced the caption user experience:
+
+Use the media toolbar to add captions when hovering over the image.
+
+Try it out by hovering over the image in the example below.
+
+
diff --git a/apps/www/content/docs/components/changelog.mdx b/apps/www/content/docs/components/changelog.mdx
index 20f9d7dd3d..7c07f1ee92 100644
--- a/apps/www/content/docs/components/changelog.mdx
+++ b/apps/www/content/docs/components/changelog.mdx
@@ -11,6 +11,23 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver
## October 2024 #15
+### October 26 #15.5
+
+- Rename `indent-todo-marker-component` to `indent-todo-marker`.
+
+### October 25 #15.4
+
+- `slash-input-element`: add AI command & add `focusEditor` option
+
+### October 24 #15.3
+
+- Add `ai-menu`, `ai-menu-items`, `ai-toolbar-button`, `ai-chat-editor`, `block-context-menu`, `context-menu`, `ghost-text`, `toc-element`
+- `command`: add `InputCommand`
+- `toolbar` new style
+- `editor` demo variant
+- `heading-element`: remove `isFirstBlock` prop
+- misc: `fixed-toolbar`, `fixed-toolbar-buttons`, `floating-toolbar`, `floating-toolbar-buttons`, `mode-dropdown-menu`, `turn-into-dropdown-menu`, `button`, `cursor-overlay`, `excalidraw-element`, `inline-combobox`, `slash-input-element`
+
### October 14 #15.3
- New cli: `shadcx`. See [CLI](/docs/components/cli) and [components.json](/docs/components/components-json).
diff --git a/apps/www/content/docs/components/cli.mdx b/apps/www/content/docs/components/cli.mdx
index 1dca84cf63..8fe96d40c7 100644
--- a/apps/www/content/docs/components/cli.mdx
+++ b/apps/www/content/docs/components/cli.mdx
@@ -13,7 +13,7 @@ The `init` command installs dependencies, adds the `cn` util, configures `tailwi
npx shadcx@latest init -u https://platejs.org/r -n plate-ui
```
-If you also want to use shadcn/ui in your project, you can use the following command:
+If you also want to use [shadcn/ui](https://ui.shadcn.com/) in your project, you can use the following command:
```bash
npx shadcx@latest init
@@ -103,7 +103,7 @@ npx shadcx@latest add align-dropdown-menu -c ./apps/www
## Example components.json
-Here's an example `components.json` file configured for shadcn/ui and Plate UI:
+Here's an example `components.json` file configured for [shadcn/ui](https://ui.shadcn.com/) and Plate UI:
```json
{
diff --git a/apps/www/content/docs/components/code-block-element.mdx b/apps/www/content/docs/components/code-block-element.mdx
index ab837ebde6..455986cf6d 100644
--- a/apps/www/content/docs/components/code-block-element.mdx
+++ b/apps/www/content/docs/components/code-block-element.mdx
@@ -65,3 +65,20 @@ Update the import paths to match your project setup.
+
+## Plus
+
+In Plate Plus, we've enhanced the code block user experience with two new features:
+
+1. A "Copy" button to easily copy the entire code snippet.
+2. A "Block Menu" button to access additional options and actions.
+
+These buttons appear in the top right corner of the code block when you hover over it, providing a clean and intuitive interface.
+
+This improved functionality makes working with code blocks more efficient and user-friendly in Plate Plus.
+
+
diff --git a/apps/www/content/docs/components/color-dropdown-menu.mdx b/apps/www/content/docs/components/color-dropdown-menu.mdx
index 697360de59..e6418e71c0 100644
--- a/apps/www/content/docs/components/color-dropdown-menu.mdx
+++ b/apps/www/content/docs/components/color-dropdown-menu.mdx
@@ -79,3 +79,18 @@ Update the import paths to match your project setup.
+
+## Plus
+
+In Plate Plus, we've enhanced the color dropdown menu user experience with two new features:
+
+1. Text color can be modified using the floating toolbar or block menu, providing more flexibility in formatting.
+2. An improved color picker interface with custom color options and a color input field for precise color selection.
+
+These enhancements make it easier and more intuitive to customize text colors in your content.
+
+
diff --git a/apps/www/content/docs/components/column-group-element.mdx b/apps/www/content/docs/components/column-group-element.mdx
index 21075c1560..8ad634b1e4 100644
--- a/apps/www/content/docs/components/column-group-element.mdx
+++ b/apps/www/content/docs/components/column-group-element.mdx
@@ -46,7 +46,11 @@ Copy and paste the following code into your project.
-
+
+
diff --git a/apps/www/content/docs/components/comment-leaf.mdx b/apps/www/content/docs/components/comment-leaf.mdx
index bd3b0cca02..ac2dcd8e8d 100644
--- a/apps/www/content/docs/components/comment-leaf.mdx
+++ b/apps/www/content/docs/components/comment-leaf.mdx
@@ -60,3 +60,14 @@ Update the import paths to match your project setup.
+
+
+## Plus
+
+In Plate Plus, we provide more user-friendly styles and a complete **backend** design
+
+
diff --git a/apps/www/content/docs/components/comment-toolbar-button.mdx b/apps/www/content/docs/components/comment-toolbar-button.mdx
index bfc268e7c8..df4f3520df 100644
--- a/apps/www/content/docs/components/comment-toolbar-button.mdx
+++ b/apps/www/content/docs/components/comment-toolbar-button.mdx
@@ -64,3 +64,13 @@ Update the import paths to match your project setup.
+
+## Plus
+
+In Plate Plus, we provide more user-friendly styles and a complete **backend** design
+
+
diff --git a/apps/www/content/docs/components/comments-popover.mdx b/apps/www/content/docs/components/comments-popover.mdx
index 9c8ac6b1da..e7beabde81 100644
--- a/apps/www/content/docs/components/comments-popover.mdx
+++ b/apps/www/content/docs/components/comments-popover.mdx
@@ -78,3 +78,14 @@ Update the import paths to match your project setup.
+
+
+## Plus
+
+In Plate Plus, we provide more user-friendly styles and a complete **backend** design
+
+
diff --git a/apps/www/content/docs/components/components-json.mdx b/apps/www/content/docs/components/components-json.mdx
index b57dbd7857..27c9357f63 100644
--- a/apps/www/content/docs/components/components-json.mdx
+++ b/apps/www/content/docs/components/components-json.mdx
@@ -21,7 +21,7 @@ npx shadcx@latest init
For Plate UI components, you have two options:
-1. Initialize both shadcn/ui and Plate UI:
+1. Initialize both [shadcn/ui](https://ui.shadcn.com/) and Plate UI:
```bash
npx shadcx@latest init
npx shadcx@latest init -u https://platejs.org/r -n plate-ui
@@ -32,7 +32,7 @@ For Plate UI components, you have two options:
npx shadcx@latest init -u https://platejs.org/r -n plate-ui
```
-See the CLI section for more information.
+See the [CLI section](/docs/cli) for more information.
## $schema
@@ -48,7 +48,7 @@ You can see the JSON Schema for `components.json` [here](https://ui.shadcn.com/s
Configuration to help the CLI understand how Tailwind CSS is set up in your project.
-See the installation section for how to set up Tailwind CSS.
+See the [installation section](/docs/components/installation) for how to set up Tailwind CSS.
### tailwind.config
@@ -100,7 +100,7 @@ To use utility classes for theming set `tailwind.cssVariables` to `false`. For C
}
```
-For more information, see the theming docs.
+For more information, see the [theming docs](/docs/components/theming).
**This cannot be changed after initialization.** To switch between CSS variables and utility classes, you'll have to delete and re-install your components.
@@ -191,7 +191,7 @@ Import alias for `hooks` such as `use-media-query` or `use-toast`.
## registries
-The `registries` section allows you to configure multiple component registries for your project. This is particularly useful when working with Plate UI components alongside the shadcn/ui components.
+The `registries` section allows you to configure multiple component registries for your project. This is particularly useful when working with Plate UI components alongside the [shadcn/ui](https://ui.shadcn.com/) components.
```json title="components.json"
{
diff --git a/apps/www/content/docs/components/context-menu.mdx b/apps/www/content/docs/components/context-menu.mdx
new file mode 100644
index 0000000000..ebcb89cde2
--- /dev/null
+++ b/apps/www/content/docs/components/context-menu.mdx
@@ -0,0 +1,69 @@
+---
+title: Context Menu
+description: Displays a menu to the user — such as a set of actions or functions — triggered by a button.
+component: true
+links:
+ doc: https://www.radix-ui.com/docs/primitives/components/context-menu
+ api: https://www.radix-ui.com/docs/primitives/components/context-menu#api-reference
+---
+
+## Installation
+
+
+
+
+ CLI
+ Manual
+
+
+
+```bash
+npx shadcn@latest add context-menu -r plate-ui
+```
+
+
+
+
+
+
+
+Install the following dependencies:
+
+```bash
+npm install @radix-ui/react-context-menu
+```
+
+Copy and paste the following code into your project.
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+## Usage
+
+```tsx
+import {
+ ContextMenu,
+ ContextMenuContent,
+ ContextMenuItem,
+ ContextMenuTrigger,
+} from "@/components/ui/context-menu"
+```
+
+```tsx
+
+ Right click
+
+ Profile
+ Billing
+ Team
+ Subscription
+
+
+```
diff --git a/apps/www/content/docs/components/draggable.mdx b/apps/www/content/docs/components/draggable.mdx
index 94118b952e..d830297a89 100644
--- a/apps/www/content/docs/components/draggable.mdx
+++ b/apps/www/content/docs/components/draggable.mdx
@@ -106,4 +106,15 @@ import { HTML5Backend } from 'react-dnd-html5-backend';
## Examples
-
\ No newline at end of file
+
+
+
+## Plus
+
+In Plate Plus, we provide more user-friendly styles and you can open [block menu](/docs/block-menu) by clicking on the draggable button.
+
+
diff --git a/apps/www/content/docs/components/floating-toolbar-buttons.mdx b/apps/www/content/docs/components/floating-toolbar-buttons.mdx
index 52f069bf84..8aa99bbc0e 100644
--- a/apps/www/content/docs/components/floating-toolbar-buttons.mdx
+++ b/apps/www/content/docs/components/floating-toolbar-buttons.mdx
@@ -11,6 +11,8 @@ docs:
title: More Dropdown Menu
- route: /docs/components/turn-into-dropdown-menu
title: Turn Into Dropdown Menu
+ - route: https://pro.platejs.org/docs/components/ai-toolbar-button
+ title: Toolbar
---
## Installation
@@ -69,3 +71,12 @@ Update the import paths to match your project setup.
+
+
+### Plus
+
+In Plate Plus, we have designed beautiful animations and more comprehensive buttons for the floating toolbar.
+
+Try it out by selecting some text in the below editor.
+
+
\ No newline at end of file
diff --git a/apps/www/content/docs/components/floating-toolbar.mdx b/apps/www/content/docs/components/floating-toolbar.mdx
index 6dabb6ce93..e048bdfc6f 100644
--- a/apps/www/content/docs/components/floating-toolbar.mdx
+++ b/apps/www/content/docs/components/floating-toolbar.mdx
@@ -5,6 +5,8 @@ component: true
docs:
- route: /docs/components/toolbar
title: Toolbar
+ - route: https://pro.platejs.org/docs/components/ai-toolbar-button
+ title: Toolbar
---
## Installation
@@ -61,6 +63,20 @@ Update the import paths to match your project setup.
## Examples
+### Basic
+
+
+### Plus
+
+In Plate Plus, we have designed beautiful animations and more comprehensive buttons for the floating toolbar.
+
+Try it out by selecting some text in the below editor.
+
+
diff --git a/apps/www/content/docs/components/ghost-text.mdx b/apps/www/content/docs/components/ghost-text.mdx
new file mode 100644
index 0000000000..bf5842c42b
--- /dev/null
+++ b/apps/www/content/docs/components/ghost-text.mdx
@@ -0,0 +1,80 @@
+---
+title: Ghost Text
+description: Display AI-generated suggestions in a hover card.
+component: true
+docs:
+ - route: /docs/copilot
+ title: Copilot
+ - route: https://pro.platejs.org/docs/components/ghost-text
+ title: Ghost Text
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add ghost-text -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+- [Copilot](/docs/copilot)
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+## Plate Plus
+
+In Plate Plus, we provides more advanced styles and complete backend setup
+
+1. Hover card: a new style of hover card that is more user-friendly. You can **hover** over the ghost text to see the hover card.
+2. Marks: support for marks like bold, italic, underline, etc.This means you can see bold text and **links** in the ghost text
+3. Backend: complete backend setup.
+
+All of the backend setup is available in [Potion template](https://pro.platejs.org/docs/templates/potion).
+
+
diff --git a/apps/www/content/docs/components/image-element.mdx b/apps/www/content/docs/components/image-element.mdx
index 55df2810c0..42d29d8d8c 100644
--- a/apps/www/content/docs/components/image-element.mdx
+++ b/apps/www/content/docs/components/image-element.mdx
@@ -69,3 +69,15 @@ Update the import paths to match your project setup.
+
+
+## Plus
+
+In Plate Plus, we have significantly enhanced the image user experience with the following features:
+
+1. **Media Toolbar**: A convenient toolbar appears when hovering over an image, providing quick access to editing options.
+2. **Full-Stack Backend Integration**: Seamlessly handle image uploads, storage, and retrieval with our robust backend integration.
+3. **Image preview**: double click to see the image preview.
+4. **Download image**: download the image to your local machine by media toolbar.
+
+
\ No newline at end of file
diff --git a/apps/www/content/docs/components/indent-todo-marker.mdx b/apps/www/content/docs/components/indent-todo-marker.mdx
new file mode 100644
index 0000000000..d1f78ff151
--- /dev/null
+++ b/apps/www/content/docs/components/indent-todo-marker.mdx
@@ -0,0 +1,64 @@
+---
+title: Indent Todo Marker
+description: Turn any block into a todo list item.
+component: true
+docs:
+ - route: /docs/indent-list
+ title: Indent List
+ - route: https://pro.platejs.org/docs/components/indent-todo-marker
+ title: Indent Todo Marker
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add indent-todo-marker -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+- [Indent List](/docs/indent-list)
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
diff --git a/apps/www/content/docs/components/index.mdx b/apps/www/content/docs/components/index.mdx
index d37e77e1bd..5559acf676 100644
--- a/apps/www/content/docs/components/index.mdx
+++ b/apps/www/content/docs/components/index.mdx
@@ -25,12 +25,12 @@ Is it a replacement to shadcn/ui?
-No, it's not a replacement to shadcn/ui.
-Instead, Plate UI an extended collection of components built on top of shadcn/ui and Radix UI, specifically designed for **rich-text editor** design. For other parts of your app, you should continue to use other components such as shadcn/ui.
+No, it's not a replacement to [shadcn/ui](https://ui.shadcn.com/).
+Instead, Plate UI an extended collection of components built on top of [shadcn/ui](https://ui.shadcn.com/) and [Radix UI](https://www.radix-ui.com/), specifically designed for **rich-text editor** design. For other parts of your app, you should continue to use other components such as [shadcn/ui](https://ui.shadcn.com/).
-Plate UI adheres to the same conventions, usage, and patterns as shadcn/ui, meaning you can seamlessly integrate it with your existing shadcn/ui components rather than replacing them.
+Plate UI adheres to the same conventions, usage, and patterns as [shadcn/ui](https://ui.shadcn.com/), meaning you can seamlessly integrate it with your existing [shadcn/ui](https://ui.shadcn.com/) components rather than replacing them.
-Next to shadcn/ui, Plate UI is the first published component registry.
+Next to [shadcn/ui](https://ui.shadcn.com/), Plate UI is the first published component registry.
@@ -75,7 +75,7 @@ Which frameworks are supported?
Can I use this in my project?
-Yes. Free to use for personal and commercial projects. No attribution required, but sharing your editor app here is appreciated!
+Yes. Free to use for personal and commercial projects. No attribution required, but sharing your editor app [here](https://github.com/udecode/plate/issues/818) is appreciated!
@@ -85,8 +85,8 @@ Yes. Free to use for personal and commercial projects. No attribution required,
## Credits
-- shadcn/ui - For the UI, the docs and the CLI.
-- Radix UI - For the primitives.
-- Vercel - For hosting.
-- Shu Ding - The typography style is adapted from his work on Nextra.
-- cmdk - For the `` component.
+- [shadcn/ui](https://ui.shadcn.com/) - For the UI, the docs and the CLI.
+- [Radix UI](https://radix-ui.com) - For the primitives.
+- [Vercel](https://vercel.com) - For hosting.
+- [Shu Ding](https://shud.in) - The typography style is adapted from his work on Nextra.
+- [cmdk](https://cmdk.paco.me) - For the `` component.
diff --git a/apps/www/content/docs/components/insert-dropdown-menu.mdx b/apps/www/content/docs/components/insert-dropdown-menu.mdx
index 7e68f99548..3b6b7030d0 100644
--- a/apps/www/content/docs/components/insert-dropdown-menu.mdx
+++ b/apps/www/content/docs/components/insert-dropdown-menu.mdx
@@ -72,3 +72,11 @@ Update the import paths to match your project setup.
+
+## Plus
+
+In Plate Plus, we provide a new way to insert blocks.
+
+Click the plus button next to the drag button
+
+
\ No newline at end of file
diff --git a/apps/www/content/docs/components/installation/manual.mdx b/apps/www/content/docs/components/installation/manual.mdx
index d9d57ed88e..2d364a26d6 100644
--- a/apps/www/content/docs/components/installation/manual.mdx
+++ b/apps/www/content/docs/components/installation/manual.mdx
@@ -9,7 +9,7 @@ description: Add dependencies to your project manually.
Components are styled using Tailwind CSS. You need to install Tailwind CSS in your project.
-Follow the Tailwind CSS installation instructions to get started.
+[Follow the Tailwind CSS installation instructions](https://tailwindcss.com/docs/installation) to get started.
### Add dependencies
@@ -43,7 +43,7 @@ Add the icons you'll use in `components/icons.tsx`:
-We use icons from Lucide. You can use any icon library you want.
+We use icons from [Lucide](https://lucide.dev). You can use any icon library you want.
### Add components
diff --git a/apps/www/content/docs/components/installation/next.mdx b/apps/www/content/docs/components/installation/next.mdx
index 94edf8882a..e1e8bacfcd 100644
--- a/apps/www/content/docs/components/installation/next.mdx
+++ b/apps/www/content/docs/components/installation/next.mdx
@@ -5,7 +5,7 @@ description: Install and configure Next.js.
-A template is available to help you get started quickly.
+A [template](https://github.com/udecode/plate/tree/main/templates/plate-template) is available to help you get started quickly.
@@ -19,7 +19,7 @@ Run the `init` command to create a new Next.js project or to setup an existing o
npx shadcx@latest init -u https://platejs.org/r -n plate-ui
```
-If you want to use shadcn/ui combined with Plate UI, run instead:
+If you want to use [shadcn/ui](https://ui.shadcn.com/) combined with Plate UI, run instead:
```bash
npx shadcx@latest init
@@ -41,7 +41,7 @@ Add the icons you'll use in `components/icons.tsx`:
-We use icons from Lucide. You can use any icon library you want.
+We use icons from [Lucide](https://lucide.dev). You can use any icon library you want.
### Add components
diff --git a/apps/www/content/docs/components/installation/vite.mdx b/apps/www/content/docs/components/installation/vite.mdx
index 43a48430fb..5728e76a15 100644
--- a/apps/www/content/docs/components/installation/vite.mdx
+++ b/apps/www/content/docs/components/installation/vite.mdx
@@ -115,7 +115,7 @@ Add the icons you'll use in `components/icons.tsx`:
-We use icons from Lucide. You can use any icon library you want.
+We use icons from [Lucide](https://lucide.dev). You can use any icon library you want.
### Add components
diff --git a/apps/www/content/docs/components/slash-input-element.mdx b/apps/www/content/docs/components/slash-input-element.mdx
new file mode 100644
index 0000000000..643782ceef
--- /dev/null
+++ b/apps/www/content/docs/components/slash-input-element.mdx
@@ -0,0 +1,93 @@
+---
+title: Slash Input Element
+description: Allows you to insert various elements into your editor using a slash command.
+component: true
+docs:
+ - route: /docs/slash-command
+ title: Slash Command
+ - route: https://pro.platejs.org/docs/components/slash-input-element
+ title: Slash Input Element
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add slash-input-element -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+- [Combobox](/docs/combobox)
+- [Slash Command](/docs/slash-command)
+- [InlineCombobox](/docs/components/inline-combobox)
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+
+
+## Plate Plus
+
+We offer an enhanced user interface design and a more comprehensive set of options, including premium plugins such as Math Callout and Media Upload.
+This provides a more robust and feature-rich editing experience for users who require advanced functionality.
+
+Some key improvements in Plate Plus include:
+
+- Refined UI design for better usability and aesthetics
+- Extended set of slash menu options
+- Integration of premium plugins like Math Upload for specialized editing needs
+- No need to worry about the focus issue mentioned above.
+- Support grouping and Carefully selected keyword.
+- Trigger slash menu by click the puls button on the left of the paragraph.
+
+You can try typing /``` to quickly insert a code block.
+
+Feel free to experiment with different commands to see how the slash menu enhances your editing experience!
+
+
diff --git a/apps/www/content/docs/components/toc-element.mdx b/apps/www/content/docs/components/toc-element.mdx
new file mode 100644
index 0000000000..fefda5d33c
--- /dev/null
+++ b/apps/www/content/docs/components/toc-element.mdx
@@ -0,0 +1,81 @@
+---
+title: TOC Element
+description: A table of contents element for displaying hierarchical document structure.
+component: true
+docs:
+ - route: /docs/toc
+ title: Table of Contents
+ - route: https://pro.platejs.org/docs/components/toc-sidebar
+ title: TOC Sidebar
+---
+
+## Installation
+
+
+
+
+CLI
+Manual
+
+
+
+```bash
+npx @udecode/plate-ui@latest add toc-element -r plate-ui
+```
+
+
+
+
+
+
+
+
+
+Install the following dependencies:
+
+- [Heading](/docs/toc)
+
+
+
+
+
+
+
+Copy and paste the following code into your project.
+
+
+
+
+
+
+
+Update the import paths to match your project setup.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+## Plate Plus
+The TocSideBar component in Plate Plus offers the following features:
+
+- Responsive design that adapts to different screen sizes
+- Dynamic highlighting of the corresponding thumbnail on the right side based on the current section
+- Hover thumbnail to see the preview of the section with smooth animation
+- Elegant transition effects when navigating between sections
+- Animated highlighting of the current section in the sidebar
+
+Here's an example of how to use the enhanced TocSideBar component in Plate Plus:
+
+
+
+
diff --git a/apps/www/content/docs/components/turn-into-dropdown-menu.mdx b/apps/www/content/docs/components/turn-into-dropdown-menu.mdx
index 9d5fac3507..8649f0f048 100644
--- a/apps/www/content/docs/components/turn-into-dropdown-menu.mdx
+++ b/apps/www/content/docs/components/turn-into-dropdown-menu.mdx
@@ -73,3 +73,12 @@ Update the import paths to match your project setup.
+
+
+## Plus
+
+In Plate Plus, we have optimized the styles and added beautiful animations.
+
+Try it out by selecting some text in the below editor.
+
+
\ No newline at end of file
diff --git a/apps/www/content/docs/copilot.mdx b/apps/www/content/docs/copilot.mdx
new file mode 100644
index 0000000000..78a95a6b49
--- /dev/null
+++ b/apps/www/content/docs/copilot.mdx
@@ -0,0 +1,233 @@
+---
+title: Copilot
+description: Render AI suggestions ghost text as you type.
+docs:
+ - route: /docs/components/ghost-text
+ title: Ghost Text
+ - route: https://pro.platejs.org/docs/components/ghost-text
+ title: Ghost Text
+---
+
+
+
+
+
+## Features
+
+- Renders ghost text suggestions as you type
+- Two trigger modes:
+ - Shortcut (`Ctrl+Space`). Press again for alternative suggestions.
+ - Debounce mode: automatically triggers after a space at paragraph ends
+- Accept suggestions with Tab or word-by-word with `Cmd+→`
+- Built-in support for Vercel AI SDK completion API
+
+
+
+## Installation
+
+```bash
+npm install @udecode/plate-ai @udecode/plate-markdown
+```
+
+## Usage
+
+```tsx
+import { CopilotPlugin } from '@udecode/plate-ai/react';
+import {
+ MarkdownPlugin,
+ serializeMdNodes,
+ stripMarkdown,
+} from '@udecode/plate-markdown';
+```
+
+```tsx
+const plugins = [
+ // ...otherPlugins,
+ MarkdownPlugin.configure({ options: { indentList: true } }),
+ CopilotPlugin.configure(({ api }) => ({
+ options: {
+ completeOptions: {
+ api: '/api/your-api-endpoint',
+ body: {
+ system: `You are an advanced AI writing assistant, similar to VSCode Copilot but for general text. Your task is to predict and generate the next part of the text based on the given context.
+
+Rules:
+- Continue the text naturally up to the next punctuation mark (., ,, ;, :, ?, or !).
+- Maintain style and tone. Don't repeat given text.
+- For unclear context, provide the most likely continuation.
+- Handle code snippets, lists, or structured text if needed.
+- Don't include """ in your response.
+- CRITICAL: Always end with a punctuation mark.
+- CRITICAL: Avoid starting a new block. Do not use block formatting like >, #, 1., 2., -, etc. The suggestion should continue in the same block as the context.
+- If no context is provided or you can't generate a continuation, return "0" without explanation.`,
+ },
+ onFinish: (_, completion) => {
+ if (completion === '0') return;
+
+ api.copilot.setBlockSuggestion({
+ //stripMarkdownBlocks in plus GhostText
+ text: stripMarkdown(completion),
+ });
+ },
+ },
+ debounceDelay: 500,
+ getPrompt: ({ editor }) => {
+ const contextEntry = getAncestorNode(editor);
+
+ if (!contextEntry) return '';
+
+ const prompt = serializeMdNodes([contextEntry[0] as TElement]);
+
+ return `Continue the text up to the next punctuation mark:
+"""
+${prompt}
+"""`;
+ },
+ renderGhostText: GhostText,
+ },
+}));
+```
+
+- [GhostText](/docs/components/ghost-text)
+
+## Tab Key Handling
+
+The Copilot plugin uses the Tab key to accept suggestions. To avoid conflicts with other plugins that use Tab (like `IndentPlugin` or `TabbablePlugin`), ensure `CopilotPlugin` is placed before them in your plugin configuration. This allows Copilot to handle Tab key events first when suggestions are present.
+
+```tsx
+const plugins = [
+ // ...otherPlugins,
+ CopilotPlugin,
+ // Place tab-using plugins after Copilot
+ IndentPlugin,
+ TabbablePlugin,
+];
+```
+
+## Examples
+
+### Plate UI
+
+Refer to the preview above.
+
+### Plate Plus
+
+- Automatic AI inline suggestions powered by AI SDK (OpenAI). Code available in [Potion template](https://pro.platejs.org/docs/templates/potion)
+- Rich text suggestions including marks and links
+- Hover card with additional information
+- Beautifully crafted UI
+
+
+
+## Keyboard Shortcuts
+
+
+
+ Trigger suggestion. Press again for alternative suggestions.
+
+ Accept the entire suggestion.
+
+ Accept the next word of the suggestion.
+
+ Dismiss the current suggestion.
+
+
+## Plugins
+
+### CopilotPlugin
+
+
+
+ Additional conditions to auto trigger copilot. Default checks:
+ - Block above is not empty
+ - Block above ends with a space
+ - No existing suggestion
+
+
+
+ AI completion configuration options. See [AI SDK useCompletion
+ Parameters](https://sdk.vercel.ai/docs/reference/ai-sdk-ui/use-completion#parameters).
+
+
+
+ Delay for debouncing auto-triggered suggestions. **Default:** `0`
+
+
+
+ Function to extract the next word from suggestion text.
+
+
+
+ Function to generate the prompt for AI completion. **Default:** Uses markdown
+ serialization of ancestor node
+
+
+
+ Component to render ghost text suggestions.
+
+
+
+ Conditions to trigger copilot. Default checks:
+ - Selection is not expanded
+ - Selection is at block end
+
+
+
+## API
+
+### editor.api.copilot.accept()
+
+Accepts the current suggestion.
+
+### editor.api.copilot.acceptNextWord()
+
+Accepts the next word of the suggestion.
+
+### editor.api.copilot.reset()
+
+Resets the plugin state:
+
+- Aborts any ongoing API request
+- Clears the current completion
+- Clears suggestion node ID and text
+
+### editor.api.copilot.setBlockSuggestion()
+
+Sets suggestion text for a block.
+
+
+
+
+
+ The suggestion text to set.
+
+
+ Target block ID. Defaults to current block if not provided.
+
+
+
+
+
+### editor.api.copilot.stop()
+
+Stops ongoing suggestion requests:
+
+- Cancels debounced trigger calls
+- Aborts current API request
+- Resets abort controller
+
+### editor.api.copilot.triggerSuggestion()
+
+Triggers a new suggestion request. Can be debounced based on plugin configuration.
diff --git a/apps/www/content/docs/csv.mdx b/apps/www/content/docs/csv.mdx
index 9747325f73..d3e2dea22c 100644
--- a/apps/www/content/docs/csv.mdx
+++ b/apps/www/content/docs/csv.mdx
@@ -55,7 +55,7 @@ Options to be passed to the PapaParse library for parsing CSV data.
- **Default:** **`{ header: true }`** (Indicating that the first row of the CSV data should be treated as a header.)
-Refer to PapaParse documentation for more details about these options.
+Refer to [PapaParse documentation](https://www.papaparse.com/docs#config) for more details about these options.
@@ -85,7 +85,7 @@ Options to be passed to the PapaParse library for parsing CSV data.
- **Default:** **`{ header: true }`** (Indicating that the first row of the CSV data should be treated as a header.)
-Refer to PapaParse documentation for more details about these options.
+Refer to [PapaParse documentation](https://www.papaparse.com/docs#config) for more details about these options.
@@ -100,4 +100,4 @@ Refer to PapaParse documentat
This function creates a table representation of the CSV data. If the CSV file includes headers, they are added as the first row of the table. Each subsequent row represents the values from the CSV file. If the CSV file does not include headers, each row of data is represented as a row in the table.
-Please note that the function assumes the usage of specific plugins corresponding to `ParagraphPlugin.key`, `TablePlugin.key`, `TableCellHeaderPlugin.key`, `TableRowPlugin.key`, and `TableCellPlugin.key`.
\ No newline at end of file
+Please note that the function assumes the usage of specific plugins corresponding to `ParagraphPlugin.key`, `TablePlugin.key`, `TableCellHeaderPlugin.key`, `TableRowPlugin.key`, and `TableCellPlugin.key`.
diff --git a/apps/www/content/docs/debugging.mdx b/apps/www/content/docs/debugging.mdx
index 98188d5b9d..353b2a1baf 100644
--- a/apps/www/content/docs/debugging.mdx
+++ b/apps/www/content/docs/debugging.mdx
@@ -169,9 +169,9 @@ Set breakpoints in your code using browser DevTools:
If you're facing a complex issue:
-1. Pick a [template](docs/getting-started).
+1. Pick a [template](/docs/getting-started).
2. Add only the essential plugins and components to reproduce the issue.
-3. If the issue persists, open an issue on GitHub or share your example on Discord.
+3. If the issue persists, [open an issue on GitHub](https://github.com/udecode/plate/issues/new?assignees=&labels=bug&projects=&template=bug.yml) or share your example on [Discord](https://discord.gg/mAZRuBzGM3).
## Debug Error Types
diff --git a/apps/www/content/docs/editor-methods.mdx b/apps/www/content/docs/editor-methods.mdx
index 4e9fe08063..c052812a38 100644
--- a/apps/www/content/docs/editor-methods.mdx
+++ b/apps/www/content/docs/editor-methods.mdx
@@ -191,7 +191,7 @@ editor.setOptions(FindReplacePlugin, (draft) => {
### getOptionsStore
-Get the zustand-x options store for a plugin:
+Get the [zustand-x](https://github.com/udecode/zustand-x) options store for a plugin:
```ts
const store = editor.getOptionsStore(FindReplacePlugin);
@@ -223,7 +223,7 @@ const MyComponent = () => {
### useOptionsStore
-Get the zustand-x store hook for a plugin:
+Get the [zustand-x](https://github.com/udecode/zustand-x) store hook for a plugin:
```ts
const store = editor.useOptionsStore(FindReplacePlugin);
@@ -237,4 +237,4 @@ Update the global Plate state:
```ts
editor.setPlateState('readOnly', true);
-```
\ No newline at end of file
+```
diff --git a/apps/www/content/docs/equation.mdx b/apps/www/content/docs/equation.mdx
new file mode 100644
index 0000000000..24460a757d
--- /dev/null
+++ b/apps/www/content/docs/equation.mdx
@@ -0,0 +1,122 @@
+---
+title: Equation
+description: Enables the insertion and rendering of LaTeX equations in your editor.
+docs:
+ - route: https://pro.platejs.org/docs/components/equation-element
+ title: Equation Element
+ - route: https://pro.platejs.org/docs/components/inline-equation-element
+ title: Inline Equation Element
+ - route: https://pro.platejs.org/docs/components/inline-equation-toolbar-button
+ title: Inline Equation Toolbar Button
+---
+
+
+
+## Features
+
+- LaTeX syntax support for complex mathematical expressions
+- Both inline and block equation formats
+- Real-time rendering of equations using KaTeX
+- Easy editing and navigation within equations
+
+
+
+## Installation
+
+```bash
+npm install @udecode/plate-math
+```
+
+## Usage
+
+```tsx
+import { EquationPlugin, InlineEquationPlugin } from '@udecode/plate-math/react';
+```
+
+```tsx
+const plugins = [
+ // ...otherPlugins,
+ EquationPlugin,
+ InlineEquationPlugin,
+]
+```
+
+```tsx
+const components = {
+ // ...otherComponents,
+ [EquationPlugin.key]: EquationElement,
+ [InlineEquationPlugin.key]: InlineEquationElement,
+}
+```
+
+- [EquationElement](https://pro.platejs.org/docs/components/equation-element) (Plus)
+- [InlineEquationElement](https://pro.platejs.org/docs/components/inline-equation-element) (Plus)
+
+
+{/* ### How to use
+
+1. Use the slash command `/equation` to insert a block equation.
+2. Use the slash command `/inline equation` to insert an inline equation.
+3. Click on any equation to edit it. Press Escape to close the editor without saving changes.
+4. Navigate through the equation using arrow keys. */}
+
+## Examples
+
+### Plate UI
+
+Work in progress.
+
+### Plate Plus
+
+- Mark text as equation from the toolbar
+- Insert equation from slash command
+- Beautifully crafted UI
+
+
+
+## Plugins
+
+### EquationPlugin
+
+Block equation element plugin.
+
+### InlineEquationPlugin
+
+Inline equation element plugin.
+
+## Transforms
+
+### editor.tf.insert.equation
+
+Inserts an empty block equation.
+
+
+ Options for the insert nodes transform.
+
+
+
+### editor.tf.insert.inlineEquation
+
+Inserts an inline equation.
+
+
+ The LaTeX expression to insert. If not provided, an empty equation will be inserted.
+
+
+ Options for the insert nodes transform.
+
+
+
+## Types
+
+### TEquationElement
+
+```typescript
+interface TEquationElement extends TElement {
+ texExpression: string;
+}
+```
\ No newline at end of file
diff --git a/apps/www/content/docs/examples/version-history.mdx b/apps/www/content/docs/examples/version-history.mdx
index 9ef6ee80f2..8d58397a50 100644
--- a/apps/www/content/docs/examples/version-history.mdx
+++ b/apps/www/content/docs/examples/version-history.mdx
@@ -3,4 +3,25 @@ title: Version History
description: Show a diff of two different points in a Plate document's history.
---
+
+## Examples
+
+### Plate UI
+
+
+### Potion
+
+- Full version history:
+ - Save document snapshots
+ - View all document versions
+ - Compare any two versions
+ - Restore previous versions
+- Visual diff comparison:
+ - Added content in green
+ - Removed content in red
+- Beautifully crafted UI
+
+Try it out. Sign in, then click on the top right clock icon:
+
+
\ No newline at end of file
diff --git a/apps/www/content/docs/getting-started.mdx b/apps/www/content/docs/getting-started.mdx
index d921ef0562..b3e7c68e4b 100644
--- a/apps/www/content/docs/getting-started.mdx
+++ b/apps/www/content/docs/getting-started.mdx
@@ -4,7 +4,7 @@ description: A quick tutorial to get you up and running with Plate.
---
- Use our interactive builder to generate _personalized_ installation steps.
+ Use our [interactive builder](/?builder=true) to generate _personalized_ installation steps.
@@ -13,11 +13,12 @@ description: A quick tutorial to get you up and running with Plate.
You can choose one of the following templates to get started:
-| Option | NextJS | Tailwind | Plate | Plugins |
-| ------------------------------------------------------------------------------------------------------------------ | ------ | -------- | ----- | ------- |
-| Plate playground template | ✅ | ✅ | ✅ | ✅ |
-| Plate minimal template | ✅ | ✅ | ✅ | |
-| NextJS template | ✅ | ✅ | | |
+| Option | NextJS | Plate | Plugins | AI & Backend |
+| --------------------------------------------------------------------------------- | ------ | ----- | ------- | ------------ |
+| [Notion clone template](https://pro.platejs.org/docs/templates/potion) | ✅ | ✅ | ✅ | ✅ |
+| [Plate playground template](https://github.com/udecode/plate-playground-template) | ✅ | ✅ | ✅ | |
+| [Plate minimal template](https://github.com/udecode/plate-template) | ✅ | ✅ | | |
+| [NextJS template](/docs/components/installation/next) | ✅ | | | |
For an existing project, jump to the next step.
@@ -39,8 +40,12 @@ npm install @udecode/plate slate slate-react slate-history slate-hyperscript rea
Let's start with a minimal editor setup.
-```tsx showLineNumbers {4,7-9}
-import { usePlateEditor, Plate, PlateContent } from '@udecode/plate-common/react';
+```tsx showLineNumbers {1-5,11-13}
+import {
+ usePlateEditor,
+ Plate,
+ PlateContent,
+} from '@udecode/plate-common/react';
export default function BasicEditor() {
const editor = usePlateEditor();
@@ -64,7 +69,10 @@ Let's give our editor some styles: [Editor](/docs/components/editor) is a styled
- **Note**: `Editor` is just an example of a styled editor using Tailwind, and if you're using it, make sure to follow the installation steps in the [Manual Installation](/docs/components/installation/manual) guide. You can create your own styled version of `PlateContent`.
+ **Note**: `Editor` is just an example of a styled editor using Tailwind, and
+ if you're using it, make sure to follow the installation steps in the [Manual
+ Installation](/docs/components/installation/manual) guide. You can create your
+ own styled version of `PlateContent`.
@@ -139,15 +147,20 @@ export default function BasicEditor() {
### Plugins
- Use our interactive builder to pick your plugins.
+ Use our [interactive builder](/?builder=true) to pick your plugins.
Let's use the basic plugins for a rich-text editor.
-```tsx showLineNumbers {15-23}
+```tsx showLineNumbers {20-28}
// ...
-import { BoldPlugin, ItalicPlugin, UnderlinePlugin, CodePlugin } from '@udecode/plate-basic-marks/react';
+import {
+ BoldPlugin,
+ ItalicPlugin,
+ UnderlinePlugin,
+ CodePlugin,
+} from '@udecode/plate-basic-marks/react';
import { HeadingPlugin } from '@udecode/plate-heading/react';
import { BlockquotePlugin } from '@udecode/plate-block-quote/react';
import { CodeBlockPlugin } from '@udecode/plate-code-block/react';
@@ -184,7 +197,8 @@ The plugins are functioning correctly. However, since we haven't specified any c
**Note**: You don't need to add core plugins such as **`ReactPlugin`**,
- **`HistoryPlugin`** and **`ParagraphPlugin`** as **`usePlateEditor`** already does it.
+ **`HistoryPlugin`** and **`ParagraphPlugin`** as **`usePlateEditor`** already
+ does it.
### Components
@@ -192,7 +206,7 @@ The plugins are functioning correctly. However, since we haven't specified any c
**Note**: Plate plugins are packaged unstyled, implying that you have complete
control over markup and styling, hence you can integrate your own design
- system or [Plate UI](/docs/components). If using the latter, use our interactive builder to pick your components.
+ system or [Plate UI](/docs/components). If using the latter, use our [interactive builder](/?builder=true) to pick your components.
To plug-in all the components in one place, we can use the **`override.components`** option in **`usePlateEditor`**:
@@ -246,10 +260,7 @@ const htmlValue = '