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 55d2ad6 commit 7b59c6e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
3 changes: 2 additions & 1 deletion apps/www/content/docs/en/ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ This plugin is experimental.

Enables chat operations and streaming text generation in the editor.

<API name="useAIHelpers">
<API name="AIChatPlugin">
<APIOptions>
<APIItem name="chat" type="UseChatHelpers">
Chat helpers returned by [useChat](https://sdk.vercel.ai/docs/reference/ai-sdk-ui/use-chat).
Expand Down Expand Up @@ -503,3 +503,4 @@ const AIChatEditor = ({ content }: { content: string }) => {
return <Editor editor={aiEditor} />;
};
```
</API>
13 changes: 11 additions & 2 deletions apps/www/content/docs/en/block-selection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,13 @@ Plugin for block selection functionality.
Adds one or more blocks to the selection.
<API name="add">
<APIParameters>
<APIItem name="id" type="string | string[]">
The ID(s) of the block(s) to be selected.
</APIItem>
</APIParameters>
</API>
### editor.api.blockSelection.clear
Expand All @@ -242,11 +244,13 @@ Resets the set of selected IDs to an empty set.
Removes one or more blocks from the selection.
<API name="delete">
<APIParameters>
<APIItem name="id" type="string | string[]">
The ID(s) of the block(s) to remove from selection.
</APIItem>
</APIParameters>
</API>
### editor.api.blockSelection.deselect
Expand All @@ -260,11 +264,12 @@ Focuses the block selection shadow input. This input handles copy, delete, and p
Gets the selected blocks in the editor.
<API name="getNodes">
<APIReturns>
<APIItem type="NodeEntry[]">
An array of selected block entries.
</APIItem>
</APIOptions>
</APIReturns>
</API>
### `editor.api.blockSelection.getNodes`
Expand All @@ -279,6 +284,7 @@ Gets the selected blocks in the editor.
Checks if one or more blocks are selected.
<API name="has">
<APIParameters>
<APIItem name="id" type="string | string[]">
The ID(s) of the block(s) to check.
Expand All @@ -287,9 +293,10 @@ Checks if one or more blocks are selected.
<APIReturns>
<APIItem type="boolean">
Returns true if all specified blocks are selected.
Whether the block(s) are selected.
</APIItem>
</APIReturns>
</API>
### editor.api.blockSelection.selectAll
Expand All @@ -299,11 +306,13 @@ Selects all selectable blocks in the editor.
Sets the selection to one or more blocks, clearing any existing selection.
<API name="set">
<APIParameters>
<APIItem name="id" type="string | string[]">
The ID(s) of the block(s) to be selected.
</APIItem>
</APIParameters>
</API>
## Transforms
Expand Down
1 change: 0 additions & 1 deletion apps/www/content/docs/en/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ Contains the following element plugins:
- `ListItemPlugin`
- `ListItemContentPlugin`

<API name="ListPlugin">
<APIOptions type="object">
<APIItem name="validLiChildrenTypes" type="string[]" optional>
Valid child node types for list items (besides `p` and `ul`).
Expand Down
2 changes: 1 addition & 1 deletion apps/www/public/r/styles/default/ai-menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"type": "registry:ui"
},
{
"content": "'use client';\n\nimport React, { memo } from 'react';\n\nimport { withProps } from '@udecode/cn';\nimport { BaseParagraphPlugin, SlateLeaf } from '@udecode/plate';\nimport { usePlateEditor } from '@udecode/plate/react';\nimport { useAIChatEditor } from '@udecode/plate-ai/react';\nimport {\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseUnderlinePlugin,\n} from '@udecode/plate-basic-marks';\nimport { BaseBlockquotePlugin } from '@udecode/plate-block-quote';\nimport {\n BaseCodeBlockPlugin,\n BaseCodeLinePlugin,\n BaseCodeSyntaxPlugin,\n} from '@udecode/plate-code-block';\nimport { usePlateEditor } from '@udecode/plate-core/react';\nimport { BaseHeadingPlugin, HEADING_KEYS } from '@udecode/plate-heading';\nimport { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { BaseIndentPlugin } from '@udecode/plate-indent';\nimport { BaseIndentListPlugin } from '@udecode/plate-indent-list';\nimport { BaseLinkPlugin } from '@udecode/plate-link';\nimport { MarkdownPlugin } from '@udecode/plate-markdown';\n\nimport {\n TodoLiStatic,\n TodoMarkerStatic,\n} from '@/components/plate-ui/indent-todo-marker-static';\n\nimport { BlockquoteElementStatic } from './blockquote-element-static';\nimport { CodeBlockElementStatic } from './code-block-element-static';\nimport { CodeLeafStatic } from './code-leaf-static';\nimport { CodeLineElementStatic } from './code-line-element-static';\nimport { CodeSyntaxLeafStatic } from './code-syntax-leaf-static';\nimport { EditorStatic } from './editor-static';\nimport { HeadingElementStatic } from './heading-element-static';\nimport { HrElementStatic } from './hr-element-static';\nimport { LinkElementStatic } from './link-element-static';\nimport { ParagraphElementStatic } from './paragraph-element-static';\n\nconst components = {\n [BaseBlockquotePlugin.key]: BlockquoteElementStatic,\n [BaseBoldPlugin.key]: withProps(SlateLeaf, { as: 'strong' }),\n [BaseCodeBlockPlugin.key]: CodeBlockElementStatic,\n [BaseCodeLinePlugin.key]: CodeLineElementStatic,\n [BaseCodePlugin.key]: CodeLeafStatic,\n [BaseCodeSyntaxPlugin.key]: CodeSyntaxLeafStatic,\n [BaseHorizontalRulePlugin.key]: HrElementStatic,\n [BaseItalicPlugin.key]: withProps(SlateLeaf, { as: 'em' }),\n [BaseLinkPlugin.key]: LinkElementStatic,\n [BaseParagraphPlugin.key]: ParagraphElementStatic,\n [BaseStrikethroughPlugin.key]: withProps(SlateLeaf, { as: 's' }),\n [BaseUnderlinePlugin.key]: withProps(SlateLeaf, { as: 'u' }),\n [HEADING_KEYS.h1]: withProps(HeadingElementStatic, { variant: 'h1' }),\n [HEADING_KEYS.h2]: withProps(HeadingElementStatic, { variant: 'h2' }),\n [HEADING_KEYS.h3]: withProps(HeadingElementStatic, { variant: 'h3' }),\n};\n\nconst plugins = [\n BaseBlockquotePlugin,\n BaseBoldPlugin,\n BaseCodeBlockPlugin,\n BaseCodeLinePlugin,\n BaseCodePlugin,\n BaseCodeSyntaxPlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseUnderlinePlugin,\n BaseHeadingPlugin,\n BaseHorizontalRulePlugin,\n BaseLinkPlugin,\n BaseParagraphPlugin,\n BaseIndentPlugin.extend({\n inject: {\n targetPlugins: [BaseParagraphPlugin.key],\n },\n }),\n BaseIndentListPlugin.extend({\n inject: {\n targetPlugins: [BaseParagraphPlugin.key],\n },\n options: {\n listStyleTypes: {\n todo: {\n liComponent: TodoLiStatic,\n markerComponent: TodoMarkerStatic,\n type: 'todo',\n },\n },\n },\n }),\n MarkdownPlugin.configure({ options: { indentList: true } }),\n];\n\nexport const AIChatEditor = memo(({ content }: { content: string }) => {\n const aiEditor = usePlateEditor({\n plugins,\n });\n\n useAIChatEditor(aiEditor, content);\n\n return (\n <EditorStatic variant=\"aiChat\" components={components} editor={aiEditor} />\n );\n});\n",
"content": "'use client';\n\nimport React, { memo } from 'react';\n\nimport { withProps } from '@udecode/cn';\nimport { BaseParagraphPlugin, SlateLeaf } from '@udecode/plate';\nimport { usePlateEditor } from '@udecode/plate/react';\nimport { useAIChatEditor } from '@udecode/plate-ai/react';\nimport {\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseUnderlinePlugin,\n} from '@udecode/plate-basic-marks';\nimport { BaseBlockquotePlugin } from '@udecode/plate-block-quote';\nimport {\n BaseCodeBlockPlugin,\n BaseCodeLinePlugin,\n BaseCodeSyntaxPlugin,\n} from '@udecode/plate-code-block';\nimport { BaseHeadingPlugin, HEADING_KEYS } from '@udecode/plate-heading';\nimport { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { BaseIndentPlugin } from '@udecode/plate-indent';\nimport { BaseIndentListPlugin } from '@udecode/plate-indent-list';\nimport { BaseLinkPlugin } from '@udecode/plate-link';\nimport { MarkdownPlugin } from '@udecode/plate-markdown';\n\nimport {\n TodoLiStatic,\n TodoMarkerStatic,\n} from '@/components/plate-ui/indent-todo-marker-static';\n\nimport { BlockquoteElementStatic } from './blockquote-element-static';\nimport { CodeBlockElementStatic } from './code-block-element-static';\nimport { CodeLeafStatic } from './code-leaf-static';\nimport { CodeLineElementStatic } from './code-line-element-static';\nimport { CodeSyntaxLeafStatic } from './code-syntax-leaf-static';\nimport { EditorStatic } from './editor-static';\nimport { HeadingElementStatic } from './heading-element-static';\nimport { HrElementStatic } from './hr-element-static';\nimport { LinkElementStatic } from './link-element-static';\nimport { ParagraphElementStatic } from './paragraph-element-static';\n\nconst components = {\n [BaseBlockquotePlugin.key]: BlockquoteElementStatic,\n [BaseBoldPlugin.key]: withProps(SlateLeaf, { as: 'strong' }),\n [BaseCodeBlockPlugin.key]: CodeBlockElementStatic,\n [BaseCodeLinePlugin.key]: CodeLineElementStatic,\n [BaseCodePlugin.key]: CodeLeafStatic,\n [BaseCodeSyntaxPlugin.key]: CodeSyntaxLeafStatic,\n [BaseHorizontalRulePlugin.key]: HrElementStatic,\n [BaseItalicPlugin.key]: withProps(SlateLeaf, { as: 'em' }),\n [BaseLinkPlugin.key]: LinkElementStatic,\n [BaseParagraphPlugin.key]: ParagraphElementStatic,\n [BaseStrikethroughPlugin.key]: withProps(SlateLeaf, { as: 's' }),\n [BaseUnderlinePlugin.key]: withProps(SlateLeaf, { as: 'u' }),\n [HEADING_KEYS.h1]: withProps(HeadingElementStatic, { variant: 'h1' }),\n [HEADING_KEYS.h2]: withProps(HeadingElementStatic, { variant: 'h2' }),\n [HEADING_KEYS.h3]: withProps(HeadingElementStatic, { variant: 'h3' }),\n};\n\nconst plugins = [\n BaseBlockquotePlugin,\n BaseBoldPlugin,\n BaseCodeBlockPlugin,\n BaseCodeLinePlugin,\n BaseCodePlugin,\n BaseCodeSyntaxPlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseUnderlinePlugin,\n BaseHeadingPlugin,\n BaseHorizontalRulePlugin,\n BaseLinkPlugin,\n BaseParagraphPlugin,\n BaseIndentPlugin.extend({\n inject: {\n targetPlugins: [BaseParagraphPlugin.key],\n },\n }),\n BaseIndentListPlugin.extend({\n inject: {\n targetPlugins: [BaseParagraphPlugin.key],\n },\n options: {\n listStyleTypes: {\n todo: {\n liComponent: TodoLiStatic,\n markerComponent: TodoMarkerStatic,\n type: 'todo',\n },\n },\n },\n }),\n MarkdownPlugin.configure({ options: { indentList: true } }),\n];\n\nexport const AIChatEditor = memo(({ content }: { content: string }) => {\n const aiEditor = usePlateEditor({\n plugins,\n });\n\n useAIChatEditor(aiEditor, content);\n\n return (\n <EditorStatic variant=\"aiChat\" components={components} editor={aiEditor} />\n );\n});\n",
"path": "plate-ui/ai-chat-editor.tsx",
"target": "components/plate-ui/ai-chat-editor.tsx",
"type": "registry:ui"
Expand Down
1 change: 0 additions & 1 deletion apps/www/src/registry/default/plate-ui/ai-chat-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
BaseCodeLinePlugin,
BaseCodeSyntaxPlugin,
} from '@udecode/plate-code-block';
import { usePlateEditor } from '@udecode/plate-core/react';
import { BaseHeadingPlugin, HEADING_KEYS } from '@udecode/plate-heading';
import { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';
import { BaseIndentPlugin } from '@udecode/plate-indent';
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6224,9 +6224,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@udecode/plate-ai@workspace:packages/ai"
dependencies:
"@udecode/plate-combobox": "npm:42.0.0"
"@udecode/plate-combobox": "npm:42.2.4"
"@udecode/plate-markdown": "npm:42.0.3"
"@udecode/plate-selection": "npm:42.2.0"
"@udecode/plate-selection": "npm:42.2.4"
ai: "npm:^3.4.10"
lodash: "npm:^4.17.21"
peerDependencies:
Expand Down Expand Up @@ -6350,7 +6350,7 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-combobox@npm:42.0.0, @udecode/plate-combobox@workspace:^, @udecode/plate-combobox@workspace:packages/combobox":
"@udecode/plate-combobox@npm:42.2.4, @udecode/plate-combobox@workspace:^, @udecode/plate-combobox@workspace:packages/combobox":
version: 0.0.0-use.local
resolution: "@udecode/plate-combobox@workspace:packages/combobox"
dependencies:
Expand Down Expand Up @@ -6409,7 +6409,7 @@ __metadata:
dependencies:
"@types/papaparse": "npm:^5.3.14"
"@udecode/plate": "workspace:^"
"@udecode/plate-table": "npm:42.2.2"
"@udecode/plate-table": "npm:42.2.4"
papaparse: "npm:^5.4.1"
peerDependencies:
"@udecode/plate": ">=42.2.2"
Expand Down Expand Up @@ -6481,7 +6481,7 @@ __metadata:
"@udecode/plate-indent": "npm:42.0.0"
"@udecode/plate-indent-list": "npm:42.2.2"
"@udecode/plate-media": "npm:42.2.2"
"@udecode/plate-table": "npm:42.2.2"
"@udecode/plate-table": "npm:42.2.4"
validator: "npm:^13.12.0"
peerDependencies:
"@udecode/plate": ">=42.2.2"
Expand All @@ -6496,7 +6496,7 @@ __metadata:
dependencies:
"@emoji-mart/data": "npm:^1.2.1"
"@udecode/plate": "workspace:^"
"@udecode/plate-combobox": "npm:42.0.0"
"@udecode/plate-combobox": "npm:42.2.4"
peerDependencies:
"@emoji-mart/data": ">=1.2.0"
"@udecode/plate": ">=42.2.2"
Expand Down Expand Up @@ -6746,7 +6746,7 @@ __metadata:
resolution: "@udecode/plate-mention@workspace:packages/mention"
dependencies:
"@udecode/plate": "workspace:^"
"@udecode/plate-combobox": "npm:42.0.0"
"@udecode/plate-combobox": "npm:42.2.4"
peerDependencies:
"@udecode/plate": ">=42.2.2"
react: ">=18.0.0"
Expand Down Expand Up @@ -6829,7 +6829,7 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-selection@npm:42.2.0, @udecode/plate-selection@workspace:^, @udecode/plate-selection@workspace:packages/selection":
"@udecode/plate-selection@npm:42.2.4, @udecode/plate-selection@workspace:^, @udecode/plate-selection@workspace:packages/selection":
version: 0.0.0-use.local
resolution: "@udecode/plate-selection@workspace:packages/selection"
dependencies:
Expand All @@ -6847,7 +6847,7 @@ __metadata:
resolution: "@udecode/plate-slash-command@workspace:packages/slash-command"
dependencies:
"@udecode/plate": "workspace:^"
"@udecode/plate-combobox": "npm:42.0.0"
"@udecode/plate-combobox": "npm:42.2.4"
peerDependencies:
"@udecode/plate": ">=42.2.2"
react: ">=18.0.0"
Expand Down Expand Up @@ -6882,7 +6882,7 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-table@npm:42.2.2, @udecode/plate-table@workspace:^, @udecode/plate-table@workspace:packages/table":
"@udecode/plate-table@npm:42.2.4, @udecode/plate-table@workspace:^, @udecode/plate-table@workspace:packages/table":
version: 0.0.0-use.local
resolution: "@udecode/plate-table@workspace:packages/table"
dependencies:
Expand Down

0 comments on commit 7b59c6e

Please sign in to comment.