Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Jan 22, 2025
1 parent 7b59c6e commit 9d58295
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 131 deletions.
31 changes: 11 additions & 20 deletions apps/www/content/docs/en/ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ Enables chat operations and streaming text generation in the editor.
</APIItem>
<APIItem name="systemTemplate" type="(props: EditorPromptParams) => string | void" optional>
Template for system messages. Supports same placeholders as `promptTemplate`.
- **Default:** `undefined`
</APIItem>
</APIOptions>
</API>
Expand All @@ -294,39 +293,31 @@ Enables chat operations and streaming text generation in the editor.

Accepts the current AI suggestion.

<API name="api.aiChat.accept">
<APIReturns type="void">
<APIItem name="behavior" type="string">
- Removes AI marks from the content
- Hides the AI chat interface
- Focuses the editor
</APIItem>
</APIReturns>
</API>
- Removes AI marks from the content
- Hides the AI chat interface
- Focuses the editor

### `api.aiChat.insertBelow`

Inserts AI content below the current block.

<API name="api.aiChat.insertBelow">
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

<API name="insertBelow">
<APIParameters>
<APIItem name="sourceEditor" type="PlateEditor">
Editor containing the content to insert.
</APIItem>
</APIParameters>

<APIReturns type="void">
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
</APIReturns>
</API>

### `api.aiChat.replaceSelection`

Replaces the current selection with AI content.

<API name="api.aiChat.replaceSelection">
<API name="replaceSelection">
<APIParameters>
<APIItem name="sourceEditor" type="PlateEditor">
Editor containing the content to replace with.
Expand Down Expand Up @@ -357,7 +348,7 @@ Replaces the current selection with AI content.

Resets the chat state.

<API name="api.aiChat.reset">
<API name="reset">
<APIReturns type="void">
<APIItem name="behavior" type="string">
- Stops any ongoing generation
Expand All @@ -371,7 +362,7 @@ Resets the chat state.

Submits a prompt to generate AI content.

<API name="api.aiChat.submit">
<API name="submit">
<APIOptions type="SubmitOptions">
<APIItem name="mode" type="'chat' | 'insert'" optional>
Mode to use.
Expand Down
10 changes: 0 additions & 10 deletions apps/www/content/docs/en/alignment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ const editor = createPlateEditor({

Plugin for aligning text within block elements.

<API name="AlignPlugin">
<APIOptions>
<APIItem name="inject" type="object">
<APIItem name="targetPlugins" type="string[]">
Plugin keys to enable alignment for.
</APIItem>
</APIItem>
</APIOptions>
</API>

## API

### `setAlign`
Expand Down
7 changes: 6 additions & 1 deletion apps/www/content/docs/en/autoformat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,17 @@ An interface for autoformat rules for block mode.
<APIAttributes>
<APIItem name="mode" type="'block'">
Block mode: set block type or custom format.

- Text: insert text.
- Block: set block type or custom format.
- Mark: insert mark(s) between matches.
</APIItem>
<APIItem name="match" type="string | string[]">
Pattern to match for the autoformat rule.
</APIItem>
<APIItem name="type" type="string" optional>
Block type to set. Ignored if `format` is defined.
- For `mode: 'block'`: set block type. If `format` is defined, this field is ignored.
- For `mode: 'mark'`: Mark(s) to add.
</APIItem>
<APIItem name="triggerAtBlockStart" type="boolean" optional>
Whether trigger should be at block start.
Expand Down
4 changes: 0 additions & 4 deletions apps/www/content/docs/en/basic-elements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ Plugin for blockquote elements.

### `isCodeBlockEmpty`

Checks if the selection is inside an empty code block.

<API name="isCodeBlockEmpty">
<APIReturns type="boolean">
Whether the selection is in an empty code block.
Expand All @@ -114,8 +112,6 @@ Checks if the selection is inside an empty code block.

### `isSelectionAtCodeBlockStart`

Checks if the selection is at the start of the first code line in a code block.

<API name="isSelectionAtCodeBlockStart">
<APIReturns type="boolean">
Whether the selection is at the start of the first code line in a code block.
Expand Down
56 changes: 7 additions & 49 deletions apps/www/content/docs/en/basic-marks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,70 +76,28 @@ Plugin that includes all basic mark plugins.

### `BoldPlugin`

<API name="BoldPlugin">
<APIOptions>
<APIItem name="clear" type="string | string[]" optional>
Node properties to delete.
</APIItem>
</APIOptions>
</API>
Plugin for bold formatting.

### `CodePlugin`

<API name="CodePlugin">
<APIOptions>
<APIItem name="clear" type="string | string[]" optional>
Node properties to delete.
</APIItem>
</APIOptions>
</API>
Plugin for code formatting.

### `ItalicPlugin`

<API name="ItalicPlugin">
<APIOptions>
<APIItem name="clear" type="string | string[]" optional>
Node properties to delete.
</APIItem>
</APIOptions>
</API>
Plugin for italic formatting.

### `UnderlinePlugin`

<API name="UnderlinePlugin">
<APIOptions>
<APIItem name="clear" type="string | string[]" optional>
Node properties to delete.
</APIItem>
</APIOptions>
</API>
Plugin for underline formatting.

### `StrikethroughPlugin`

<API name="StrikethroughPlugin">
<APIOptions>
<APIItem name="clear" type="string | string[]" optional>
Node properties to delete.
</APIItem>
</APIOptions>
</API>
Plugin for strikethrough formatting.

### `SubscriptPlugin`

<API name="SubscriptPlugin">
<APIOptions>
<APIItem name="clear" type="string | string[]" optional>
Node properties to delete.
</APIItem>
</APIOptions>
</API>
Plugin for subscript formatting.

### `SuperscriptPlugin`

<API name="SuperscriptPlugin">
<APIOptions>
<APIItem name="clear" type="string | string[]" optional>
Node properties to delete.
</APIItem>
</APIOptions>
</API>
Plugin for superscript formatting.
8 changes: 0 additions & 8 deletions apps/www/content/docs/en/block-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ Refer to the preview above.

Block menu state management.

<API name="BlockMenuPlugin">
<APIOptions>
<APIItem name="render" type="object">
Render options for the block menu.
</APIItem>
</APIOptions>
</API>

## API

### `editor.api.blockMenu.hide`
Expand Down
69 changes: 30 additions & 39 deletions apps/www/content/docs/en/block-selection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const plugins = [
];
```

### Exclude blocks from selection
### `Exclude blocks from selection`

You can exclude certain plugins from block selection using:

Expand Down Expand Up @@ -183,12 +183,12 @@ Plugin for block selection functionality.
<APIItem name="areaOptions" type="PartialSelectionOptions" optional>
Options for the selection area.
```ts
```ts
{
boundaries: [`#${editor.uid}`],
container: [`#${editor.uid}`],
selectables: [`#${editor.uid} .slate-selectable`],
selectionAreaClass: 'slate-selection-area',
boundaries: [`#${editor.uid}`],
container: [`#${editor.uid}`],
selectables: [`#${editor.uid} .slate-selectable`],
selectionAreaClass: 'slate-selection-area',
}
```
</APIItem>
Expand Down Expand Up @@ -224,7 +224,7 @@ Plugin for block selection functionality.
## API
### editor.api.blockSelection.add
### `editor.api.blockSelection.add`
Adds one or more blocks to the selection.
Expand All @@ -236,11 +236,11 @@ Adds one or more blocks to the selection.
</APIParameters>
</API>
### editor.api.blockSelection.clear
### `editor.api.blockSelection.clear`
Resets the set of selected IDs to an empty set.
### editor.api.blockSelection.delete
### `editor.api.blockSelection.delete`
Removes one or more blocks from the selection.
Expand All @@ -252,35 +252,25 @@ Removes one or more blocks from the selection.
</APIParameters>
</API>
### editor.api.blockSelection.deselect
### `editor.api.blockSelection.deselect`
Deselects all blocks and sets the `isSelecting` flag to false.
### editor.api.blockSelection.focus
### `editor.api.blockSelection.focus`
Focuses the block selection shadow input. This input handles copy, delete, and paste events for selected blocks.
### editor.api.blockSelection.getNodes
### `editor.api.blockSelection.getNodes`
Gets the selected blocks in the editor.
<API name="getNodes">
<APIReturns>
<APIItem type="NodeEntry[]">
An array of selected block entries.
</APIItem>
</APIReturns>
</API>
### `editor.api.blockSelection.getNodes`
<API name="getNodes">
<APIReturns type="NodeEntry[]">
Array of selected block entries.
</APIReturns>
</API>
### editor.api.blockSelection.has
### `editor.api.blockSelection.has`
Checks if one or more blocks are selected.
Expand All @@ -298,11 +288,11 @@ Checks if one or more blocks are selected.
</APIReturns>
</API>
### editor.api.blockSelection.selectAll
### `editor.api.blockSelection.selectAll`
Selects all selectable blocks in the editor.
### editor.api.blockSelection.set
### `editor.api.blockSelection.set`
Sets the selection to one or more blocks, clearing any existing selection.
Expand Down Expand Up @@ -442,14 +432,6 @@ Initialize and manage selection area functionality.
Moves the selection up or down to the next selectable block.
<API name="moveSelection">
<APIParameters>
<APIItem name="direction" type="'up' | 'down'">
Direction to move selection.
</APIItem>
</APIParameters>
</API>
When moving up:
- Gets the previous selectable block from the top-most selected block
- Sets it as the new anchor
Expand All @@ -459,18 +441,18 @@ When moving down:
- Sets it as the new anchor
- Clears previous selection and selects only this block
### `editor.api.blockSelection.shiftSelection`
Expands or shrinks the selection based on the anchor block.
<API name="shiftSelection">
<API name="moveSelection">
<APIParameters>
<APIItem name="direction" type="'up' | 'down'">
Direction to expand/shrink selection.
Direction to move selection.
</APIItem>
</APIParameters>
</API>
### `editor.api.blockSelection.shiftSelection`
Expands or shrinks the selection based on the anchor block.
For SHIFT + DOWN:
- If anchor is top-most: Expands down by adding block below bottom-most
- Otherwise: Shrinks from top-most (unless top-most is the anchor)
Expand All @@ -480,3 +462,12 @@ For SHIFT + UP:
The anchor block always remains selected. If no anchor is set, it defaults to:
- Bottom-most block for SHIFT + UP
- Top-most block for SHIFT + DOWN
<API name="shiftSelection">
<APIParameters>
<APIItem name="direction" type="'up' | 'down'">
Direction to expand/shrink selection.
</APIItem>
</APIParameters>
</API>
1 change: 1 addition & 0 deletions apps/www/content/docs/en/forced-layout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const plugins = [

### NormalizeTypesPlugin

<API name="NormalizeTypesPlugin">
<APIOptions>
<APIItem name="rules" type="Rule[]" optional>
An array of rule objects for normalizing types.
Expand Down

0 comments on commit 9d58295

Please sign in to comment.