From f79e321b3eba2d9e68c6f83981a1ff6fe0c9c30c Mon Sep 17 00:00:00 2001 From: Felix Feng Date: Thu, 19 Dec 2024 18:25:14 +0800 Subject: [PATCH] fix --- apps/www/public/r/index.json | 4 + apps/www/public/r/styles/default/ai-demo.json | 2 +- apps/www/public/r/styles/default/ai-menu.json | 6 +- .../public/r/styles/default/ai-plugins.json | 2 +- apps/www/public/r/styles/default/editor.json | 2 +- .../r/styles/default/indent-fire-marker.json | 2 +- .../r/styles/default/indent-todo-marker.json | 6 + .../r/styles/default/slate-to-html.json | 2 +- .../default/block/slate-to-html/page.tsx | 24 +- apps/www/src/__registry__/index.tsx | 4 + .../default/plate-ui/ai-chat-editor.tsx | 2 +- .../default/plate-ui/indent-fire-marker.tsx | 2 +- apps/www/src/registry/registry-ui.ts | 5 +- .../components/editor/plugins/ai-plugins.tsx | 114 +++--- .../components/plate-ui/ai-chat-editor.tsx | 65 +++- .../src/components/plate-ui/ai-menu-items.tsx | 5 +- .../src/components/plate-ui/ai-menu.tsx | 4 +- .../src/components/plate-ui/editor-static.tsx | 2 +- .../plate-ui/indent-fire-marker.tsx | 2 +- .../plate-ui/indent-todo-marker-static.tsx | 35 ++ yarn.lock | 358 +++++++++--------- 21 files changed, 371 insertions(+), 277 deletions(-) create mode 100644 templates/plate-playground-template/src/components/plate-ui/indent-todo-marker-static.tsx diff --git a/apps/www/public/r/index.json b/apps/www/public/r/index.json index 2f1cbe1dcc..8370d9d72b 100644 --- a/apps/www/public/r/index.json +++ b/apps/www/public/r/index.json @@ -2461,6 +2461,10 @@ { "path": "plate-ui/indent-todo-marker.tsx", "type": "registry:ui" + }, + { + "path": "plate-ui/indent-todo-marker-static.tsx", + "type": "registry:ui" } ], "name": "indent-todo-marker", diff --git a/apps/www/public/r/styles/default/ai-demo.json b/apps/www/public/r/styles/default/ai-demo.json index 2c71372b97..f20eccb1ec 100644 --- a/apps/www/public/r/styles/default/ai-demo.json +++ b/apps/www/public/r/styles/default/ai-demo.json @@ -17,7 +17,7 @@ "type": "registry:example" }, { - "content": "'use client';\n\nimport React from 'react';\n\nimport { withProps } from '@udecode/cn';\nimport { AIChatPlugin, AIPlugin } from '@udecode/plate-ai/react';\nimport {\n BoldPlugin,\n CodePlugin,\n ItalicPlugin,\n StrikethroughPlugin,\n UnderlinePlugin,\n} from '@udecode/plate-basic-marks/react';\nimport { BlockquotePlugin } from '@udecode/plate-block-quote/react';\nimport {\n CodeBlockPlugin,\n CodeLinePlugin,\n CodeSyntaxPlugin,\n} from '@udecode/plate-code-block/react';\nimport {\n ParagraphPlugin,\n PlateLeaf,\n createPlateEditor,\n} from '@udecode/plate-common/react';\nimport { HEADING_KEYS } from '@udecode/plate-heading';\nimport { HorizontalRulePlugin } from '@udecode/plate-horizontal-rule/react';\nimport { LinkPlugin } from '@udecode/plate-link/react';\nimport { MarkdownPlugin } from '@udecode/plate-markdown';\n\nimport { cursorOverlayPlugin } from '@/components/editor/plugins/cursor-overlay-plugin';\nimport { AIMenu } from '@/components/plate-ui/ai-menu';\nimport { BlockquoteElement } from '@/components/plate-ui/blockquote-element';\nimport { CodeBlockElement } from '@/components/plate-ui/code-block-element';\nimport { CodeLeaf } from '@/components/plate-ui/code-leaf';\nimport { CodeLineElement } from '@/components/plate-ui/code-line-element';\nimport { CodeSyntaxLeaf } from '@/components/plate-ui/code-syntax-leaf';\nimport { HeadingElement } from '@/components/plate-ui/heading-element';\nimport { HrElement } from '@/components/plate-ui/hr-element';\nimport { LinkElement } from '@/components/plate-ui/link-element';\nimport { ParagraphElement } from '@/components/plate-ui/paragraph-element';\n\nimport { basicNodesPlugins } from './basic-nodes-plugins';\nimport { blockSelectionReadOnlyPlugin } from './block-selection-plugins';\nimport { indentListPlugins } from './indent-list-plugins';\nimport { linkPlugin } from './link-plugin';\n\nconst createAIEditor = () => {\n const editor = createPlateEditor({\n id: 'ai',\n override: {\n components: {\n [BlockquotePlugin.key]: BlockquoteElement,\n [BoldPlugin.key]: withProps(PlateLeaf, { as: 'strong' }),\n [CodeBlockPlugin.key]: CodeBlockElement,\n [CodeLinePlugin.key]: CodeLineElement,\n [CodePlugin.key]: CodeLeaf,\n [CodeSyntaxPlugin.key]: CodeSyntaxLeaf,\n [HEADING_KEYS.h1]: withProps(HeadingElement, { variant: 'h1' }),\n [HEADING_KEYS.h2]: withProps(HeadingElement, { variant: 'h2' }),\n [HEADING_KEYS.h3]: withProps(HeadingElement, { variant: 'h3' }),\n [HorizontalRulePlugin.key]: HrElement,\n [ItalicPlugin.key]: withProps(PlateLeaf, { as: 'em' }),\n [LinkPlugin.key]: LinkElement,\n [ParagraphPlugin.key]: ParagraphElement,\n [StrikethroughPlugin.key]: withProps(PlateLeaf, { as: 's' }),\n [UnderlinePlugin.key]: withProps(PlateLeaf, { as: 'u' }),\n },\n },\n plugins: [\n ...basicNodesPlugins,\n ...indentListPlugins,\n HorizontalRulePlugin,\n linkPlugin,\n MarkdownPlugin.configure({ options: { indentList: true } }),\n blockSelectionReadOnlyPlugin,\n ],\n });\n\n return editor;\n};\n\nconst systemCommon = `\\\nYou are an advanced AI-powered note-taking assistant, designed to enhance productivity and creativity in note management.\nRespond directly to user prompts with clear, concise, and relevant content. Maintain a neutral, helpful tone.\n\nRules:\n- is the entire note the user is working on.\n- is a reminder of how you should reply to INSTRUCTIONS. It does not apply to questions.\n- Anything else is the user prompt.\n- Your response should be tailored to the user's prompt, providing precise assistance to optimize note management.\n- For INSTRUCTIONS: Follow the exactly. Provide ONLY the content to be inserted or replaced. No explanations or comments.\n- For QUESTIONS: Provide a helpful and concise answer. You may include brief explanations if necessary.\n- CRITICAL: Distinguish between INSTRUCTIONS and QUESTIONS. Instructions typically ask you to modify or add content. Questions ask for information or clarification.\n`;\n\nconst systemDefault = `\\\n${systemCommon}\n- is the current block of text the user is working on.\n- Ensure your output can seamlessly fit into the existing structure.\n- CRITICAL: Provide only a single block of text. DO NOT create multiple paragraphs or separate blocks.\n\n{block}\n\n`;\n\nconst systemSelecting = `\\\n${systemCommon}\n- is the block of text containing the user's selection, providing context.\n- Ensure your output can seamlessly fit into the existing structure.\n- is the specific text the user has selected in the block and wants to modify or ask about.\n- Consider the context provided by , but only modify . Your response should be a direct replacement for .\n\n{block}\n\n\n{selection}\n\n`;\n\nconst systemBlockSelecting = `\\\n${systemCommon}\n- represents the full blocks of text the user has selected and wants to modify or ask about.\n- Your response should be a direct replacement for the entire .\n- Maintain the overall structure and formatting of the selected blocks, unless explicitly instructed otherwise.\n- CRITICAL: Provide only the content to replace . Do not add additional blocks or change the block structure unless specifically requested.\n\n{block}\n\n`;\n\nconst userDefault = `\nCRITICAL: DO NOT use block formatting. You can only use inline formatting.\nCRITICAL: DO NOT start new lines or paragraphs.\nNEVER write .\n\n{prompt}`;\n\nconst userSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the text to replace . No explanations.\nEnsure it fits seamlessly within . If is empty, write ONE random sentence.\nNEVER write or .\n\n{prompt} about `;\n\nconst userBlockSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the content to replace the entire . No explanations.\nMaintain the overall structure unless instructed otherwise.\nNEVER write or .\n\n{prompt} about `;\n\nexport const PROMPT_TEMPLATES = {\n systemBlockSelecting,\n systemDefault,\n systemSelecting,\n userBlockSelecting,\n userDefault,\n userSelecting,\n};\n\nexport const aiPlugins = [\n cursorOverlayPlugin,\n MarkdownPlugin.configure({ options: { indentList: true } }),\n AIPlugin,\n AIChatPlugin.configure({\n options: {\n createAIEditor,\n promptTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.userBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.userSelecting\n : PROMPT_TEMPLATES.userDefault;\n },\n systemTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.systemBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.systemSelecting\n : PROMPT_TEMPLATES.systemDefault;\n },\n },\n render: { afterEditable: () => },\n }),\n] as const;\n", + "content": "'use client';\n\nimport React from 'react';\n\nimport { AIChatPlugin, AIPlugin } 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 { BaseParagraphPlugin, createSlateEditor } from '@udecode/plate-common';\nimport { BaseHeadingPlugin, HEADING_LEVELS } from '@udecode/plate-heading';\nimport { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { BaseIndentListPlugin } from '@udecode/plate-indent-list';\nimport { BaseLinkPlugin } from '@udecode/plate-link';\nimport { MarkdownPlugin } from '@udecode/plate-markdown';\n\nimport { AIMenu } from '@/components/plate-ui/ai-menu';\nimport {\n TodoLiStatic,\n TodoMarkerStatic,\n} from '@/components/plate-ui/indent-todo-marker-static';\n\nimport { cursorOverlayPlugin } from './cursor-overlay-plugin';\nconst createAIEditor = () => {\n const editor = createSlateEditor({\n id: 'ai',\n 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 BaseIndentListPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n ...HEADING_LEVELS,\n BaseBlockquotePlugin.key,\n BaseCodeBlockPlugin.key,\n ],\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 });\n\n return editor;\n};\n\nconst systemCommon = `\\\nYou are an advanced AI-powered note-taking assistant, designed to enhance productivity and creativity in note management.\nRespond directly to user prompts with clear, concise, and relevant content. Maintain a neutral, helpful tone.\n\nRules:\n- is the entire note the user is working on.\n- is a reminder of how you should reply to INSTRUCTIONS. It does not apply to questions.\n- Anything else is the user prompt.\n- Your response should be tailored to the user's prompt, providing precise assistance to optimize note management.\n- For INSTRUCTIONS: Follow the exactly. Provide ONLY the content to be inserted or replaced. No explanations or comments.\n- For QUESTIONS: Provide a helpful and concise answer. You may include brief explanations if necessary.\n- CRITICAL: Distinguish between INSTRUCTIONS and QUESTIONS. Instructions typically ask you to modify or add content. Questions ask for information or clarification.\n`;\n\nconst systemDefault = `\\\n${systemCommon}\n- is the current block of text the user is working on.\n- Ensure your output can seamlessly fit into the existing structure.\n- CRITICAL: Provide only a single block of text. DO NOT create multiple paragraphs or separate blocks.\n\n{block}\n\n`;\n\nconst systemSelecting = `\\\n${systemCommon}\n- is the block of text containing the user's selection, providing context.\n- Ensure your output can seamlessly fit into the existing structure.\n- is the specific text the user has selected in the block and wants to modify or ask about.\n- Consider the context provided by , but only modify . Your response should be a direct replacement for .\n\n{block}\n\n\n{selection}\n\n`;\n\nconst systemBlockSelecting = `\\\n${systemCommon}\n- represents the full blocks of text the user has selected and wants to modify or ask about.\n- Your response should be a direct replacement for the entire .\n- Maintain the overall structure and formatting of the selected blocks, unless explicitly instructed otherwise.\n- CRITICAL: Provide only the content to replace . Do not add additional blocks or change the block structure unless specifically requested.\n\n{block}\n\n`;\n\nconst userDefault = `\nCRITICAL: DO NOT use block formatting. You can only use inline formatting.\nCRITICAL: DO NOT start new lines or paragraphs.\nNEVER write .\n\n{prompt}`;\n\nconst userSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the text to replace . No explanations.\nEnsure it fits seamlessly within . If is empty, write ONE random sentence.\nNEVER write or .\n\n{prompt} about `;\n\nconst userBlockSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the content to replace the entire . No explanations.\nMaintain the overall structure unless instructed otherwise.\nNEVER write or .\n\n{prompt} about `;\n\nexport const PROMPT_TEMPLATES = {\n systemBlockSelecting,\n systemDefault,\n systemSelecting,\n userBlockSelecting,\n userDefault,\n userSelecting,\n};\n\nexport const aiPlugins = [\n cursorOverlayPlugin,\n MarkdownPlugin.configure({ options: { indentList: true } }),\n AIPlugin,\n AIChatPlugin.configure({\n options: {\n createAIEditor,\n promptTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.userBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.userSelecting\n : PROMPT_TEMPLATES.userDefault;\n },\n systemTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.systemBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.systemSelecting\n : PROMPT_TEMPLATES.systemDefault;\n },\n },\n render: { afterEditable: () => },\n }),\n] as const;\n", "path": "components/editor/plugins/ai-plugins.tsx", "target": "components/ai-plugins.tsx", "type": "registry:example" diff --git a/apps/www/public/r/styles/default/ai-menu.json b/apps/www/public/r/styles/default/ai-menu.json index 35919c7148..aaacf94647 100644 --- a/apps/www/public/r/styles/default/ai-menu.json +++ b/apps/www/public/r/styles/default/ai-menu.json @@ -27,19 +27,19 @@ }, "files": [ { - "content": "'use client';\n\nimport * as React from 'react';\n\nimport { AIChatPlugin, useEditorChat } from '@udecode/plate-ai/react';\nimport {\n type TElement,\n type TNodeEntry,\n getAncestorNode,\n getBlocks,\n isElementEmpty,\n isHotkey,\n isSelectionAtBlockEnd,\n} from '@udecode/plate-common';\nimport {\n type PlateEditor,\n toDOMNode,\n useEditorPlugin,\n useHotkeys,\n} from '@udecode/plate-common/react';\nimport {\n BlockSelectionPlugin,\n useIsSelecting,\n} from '@udecode/plate-selection/react';\nimport { Loader2Icon } from 'lucide-react';\n\nimport { useChat } from '@/components/editor/use-chat';\n\nimport { AIChatEditor } from './ai-chat-editor';\nimport { AIMenuItems } from './ai-menu-items';\nimport { Command, CommandList, InputCommand } from './command';\nimport { Popover, PopoverAnchor, PopoverContent } from './popover';\n\nexport function AIMenu() {\n const { api, editor, useOption } = useEditorPlugin(AIChatPlugin);\n const open = useOption('open');\n const mode = useOption('mode');\n const isSelecting = useIsSelecting();\n\n const aiEditorRef = React.useRef(null);\n const [value, setValue] = React.useState('');\n\n const chat = useChat();\n\n const { input, isLoading, messages, setInput } = chat;\n const [anchorElement, setAnchorElement] = React.useState(\n null\n );\n\n const setOpen = (open: boolean) => {\n if (open) {\n api.aiChat.show();\n } else {\n api.aiChat.hide();\n }\n };\n\n const show = (anchorElement: HTMLElement) => {\n setAnchorElement(anchorElement);\n setOpen(true);\n };\n\n useEditorChat({\n chat,\n onOpenBlockSelection: (blocks: TNodeEntry[]) => {\n show(toDOMNode(editor, blocks.at(-1)![0])!);\n },\n onOpenChange: (open) => {\n if (!open) {\n setAnchorElement(null);\n setInput('');\n }\n },\n onOpenCursor: () => {\n const ancestor = getAncestorNode(editor)?.[0] as TElement;\n\n if (!isSelectionAtBlockEnd(editor) && !isElementEmpty(editor, ancestor)) {\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.addSelectedRow(ancestor.id as string);\n }\n\n show(toDOMNode(editor, ancestor)!);\n },\n onOpenSelection: () => {\n show(toDOMNode(editor, getBlocks(editor).at(-1)![0])!);\n },\n });\n\n useHotkeys(\n 'meta+j',\n () => {\n api.aiChat.show();\n },\n { enableOnContentEditable: true, enableOnFormTags: true }\n );\n\n return (\n \n \n\n {\n e.preventDefault();\n\n if (isLoading) {\n api.aiChat.stop();\n } else {\n api.aiChat.hide();\n }\n }}\n align=\"center\"\n avoidCollisions={false}\n side=\"bottom\"\n >\n \n {mode === 'chat' && isSelecting && messages.length > 0 && (\n \n )}\n\n {isLoading ? (\n
\n \n {messages.length > 1 ? 'Editing...' : 'Thinking...'}\n
\n ) : (\n {\n if (isHotkey('backspace')(e) && input.length === 0) {\n e.preventDefault();\n api.aiChat.hide();\n }\n if (isHotkey('enter')(e) && !e.shiftKey && !value) {\n e.preventDefault();\n void api.aiChat.submit();\n }\n }}\n onValueChange={setInput}\n placeholder=\"Ask AI anything...\"\n data-plate-focus\n autoFocus\n />\n )}\n\n {!isLoading && (\n \n \n \n )}\n \n \n
\n );\n}\n", + "content": "'use client';\n\nimport * as React from 'react';\n\nimport { AIChatPlugin, useEditorChat } from '@udecode/plate-ai/react';\nimport {\n type SlateEditor,\n type TElement,\n type TNodeEntry,\n getAncestorNode,\n getBlocks,\n isElementEmpty,\n isHotkey,\n isSelectionAtBlockEnd,\n} from '@udecode/plate-common';\nimport {\n toDOMNode,\n useEditorPlugin,\n useHotkeys,\n} from '@udecode/plate-common/react';\nimport {\n BlockSelectionPlugin,\n useIsSelecting,\n} from '@udecode/plate-selection/react';\nimport { Loader2Icon } from 'lucide-react';\n\nimport { useChat } from '@/components/editor/use-chat';\n\nimport { AIChatEditor } from './ai-chat-editor';\nimport { AIMenuItems } from './ai-menu-items';\nimport { Command, CommandList, InputCommand } from './command';\nimport { Popover, PopoverAnchor, PopoverContent } from './popover';\n\nexport function AIMenu() {\n const { api, editor, useOption } = useEditorPlugin(AIChatPlugin);\n const open = useOption('open');\n const mode = useOption('mode');\n const isSelecting = useIsSelecting();\n\n const aiEditorRef = React.useRef(null);\n const [value, setValue] = React.useState('');\n\n const chat = useChat();\n\n const { input, isLoading, messages, setInput } = chat;\n const [anchorElement, setAnchorElement] = React.useState(\n null\n );\n\n const setOpen = (open: boolean) => {\n if (open) {\n api.aiChat.show();\n } else {\n api.aiChat.hide();\n }\n };\n\n const show = (anchorElement: HTMLElement) => {\n setAnchorElement(anchorElement);\n setOpen(true);\n };\n\n useEditorChat({\n chat,\n onOpenBlockSelection: (blocks: TNodeEntry[]) => {\n show(toDOMNode(editor, blocks.at(-1)![0])!);\n },\n onOpenChange: (open) => {\n if (!open) {\n setAnchorElement(null);\n setInput('');\n }\n },\n onOpenCursor: () => {\n const ancestor = getAncestorNode(editor)?.[0] as TElement;\n\n if (!isSelectionAtBlockEnd(editor) && !isElementEmpty(editor, ancestor)) {\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.addSelectedRow(ancestor.id as string);\n }\n\n show(toDOMNode(editor, ancestor)!);\n },\n onOpenSelection: () => {\n show(toDOMNode(editor, getBlocks(editor).at(-1)![0])!);\n },\n });\n\n useHotkeys(\n 'meta+j',\n () => {\n api.aiChat.show();\n },\n { enableOnContentEditable: true, enableOnFormTags: true }\n );\n\n return (\n \n \n\n {\n e.preventDefault();\n\n if (isLoading) {\n api.aiChat.stop();\n } else {\n api.aiChat.hide();\n }\n }}\n align=\"center\"\n avoidCollisions={false}\n side=\"bottom\"\n >\n \n {mode === 'chat' && isSelecting && messages.length > 0 && (\n \n )}\n\n {isLoading ? (\n
\n \n {messages.length > 1 ? 'Editing...' : 'Thinking...'}\n
\n ) : (\n {\n if (isHotkey('backspace')(e) && input.length === 0) {\n e.preventDefault();\n api.aiChat.hide();\n }\n if (isHotkey('enter')(e) && !e.shiftKey && !value) {\n e.preventDefault();\n void api.aiChat.submit();\n }\n }}\n onValueChange={setInput}\n placeholder=\"Ask AI anything...\"\n data-plate-focus\n autoFocus\n />\n )}\n\n {!isLoading && (\n \n \n \n )}\n \n \n
\n );\n}\n", "path": "plate-ui/ai-menu.tsx", "target": "components/plate-ui/ai-menu.tsx", "type": "registry:ui" }, { - "content": "'use client';\n\nimport { useEffect, useMemo } from 'react';\n\nimport { AIChatPlugin, AIPlugin } from '@udecode/plate-ai/react';\nimport {\n getAncestorNode,\n getEndPoint,\n getNodeString,\n} from '@udecode/plate-common';\nimport {\n type PlateEditor,\n focusEditor,\n useEditorPlugin,\n} from '@udecode/plate-common/react';\nimport { useIsSelecting } from '@udecode/plate-selection/react';\nimport {\n Album,\n BadgeHelp,\n Check,\n CornerUpLeft,\n FeatherIcon,\n ListEnd,\n ListMinus,\n ListPlus,\n PenLine,\n Wand,\n X,\n} from 'lucide-react';\n\nimport { CommandGroup, CommandItem } from './command';\n\nexport type EditorChatState =\n | 'cursorCommand'\n | 'cursorSuggestion'\n | 'selectionCommand'\n | 'selectionSuggestion';\n\nexport const aiChatItems = {\n accept: {\n icon: ,\n label: 'Accept',\n value: 'accept',\n onSelect: ({ editor }) => {\n editor.getTransforms(AIChatPlugin).aiChat.accept();\n focusEditor(editor, getEndPoint(editor, editor.selection!));\n },\n },\n continueWrite: {\n icon: ,\n label: 'Continue writing',\n value: 'continueWrite',\n onSelect: ({ editor }) => {\n const ancestorNode = getAncestorNode(editor);\n\n if (!ancestorNode) return;\n\n const isEmpty = getNodeString(ancestorNode[0]).trim().length === 0;\n\n void editor.getApi(AIChatPlugin).aiChat.submit({\n mode: 'insert',\n prompt: isEmpty\n ? `\n{editor}\n\nStart writing a new paragraph AFTER ONLY ONE SENTENCE`\n : 'Continue writing AFTER ONLY ONE SENTENCE. DONT REPEAT THE TEXT.',\n });\n },\n },\n discard: {\n icon: ,\n label: 'Discard',\n shortcut: 'Escape',\n value: 'discard',\n onSelect: ({ editor }) => {\n editor.getTransforms(AIPlugin).ai.undo();\n editor.getApi(AIChatPlugin).aiChat.hide();\n },\n },\n explain: {\n icon: ,\n label: 'Explain',\n value: 'explain',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: {\n default: 'Explain {editor}',\n selecting: 'Explain',\n },\n });\n },\n },\n fixSpelling: {\n icon: ,\n label: 'Fix spelling & grammar',\n value: 'fixSpelling',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Fix spelling and grammar',\n });\n },\n },\n improveWriting: {\n icon: ,\n label: 'Improve writing',\n value: 'improveWriting',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Improve the writing',\n });\n },\n },\n insertBelow: {\n icon: ,\n label: 'Insert below',\n value: 'insertBelow',\n onSelect: ({ aiEditor, editor }) => {\n void editor.getTransforms(AIChatPlugin).aiChat.insertBelow(aiEditor);\n },\n },\n makeLonger: {\n icon: ,\n label: 'Make longer',\n value: 'makeLonger',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Make longer',\n });\n },\n },\n makeShorter: {\n icon: ,\n label: 'Make shorter',\n value: 'makeShorter',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Make shorter',\n });\n },\n },\n replace: {\n icon: ,\n label: 'Replace selection',\n value: 'replace',\n onSelect: ({ aiEditor, editor }) => {\n void editor.getTransforms(AIChatPlugin).aiChat.replaceSelection(aiEditor);\n },\n },\n simplifyLanguage: {\n icon: ,\n label: 'Simplify language',\n value: 'simplifyLanguage',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Simplify the language',\n });\n },\n },\n summarize: {\n icon: ,\n label: 'Add a summary',\n value: 'summarize',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n mode: 'insert',\n prompt: {\n default: 'Summarize {editor}',\n selecting: 'Summarize',\n },\n });\n },\n },\n tryAgain: {\n icon: ,\n label: 'Try again',\n value: 'tryAgain',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.reload();\n },\n },\n} satisfies Record<\n string,\n {\n icon: React.ReactNode;\n label: string;\n value: string;\n component?: React.ComponentType<{ menuState: EditorChatState }>;\n filterItems?: boolean;\n items?: { label: string; value: string }[];\n shortcut?: string;\n onSelect?: ({\n aiEditor,\n editor,\n }: {\n aiEditor: PlateEditor;\n editor: PlateEditor;\n }) => void;\n }\n>;\n\nconst menuStateItems: Record<\n EditorChatState,\n {\n items: (typeof aiChatItems)[keyof typeof aiChatItems][];\n heading?: string;\n }[]\n> = {\n cursorCommand: [\n {\n items: [\n aiChatItems.continueWrite,\n aiChatItems.summarize,\n aiChatItems.explain,\n ],\n },\n ],\n cursorSuggestion: [\n {\n items: [aiChatItems.accept, aiChatItems.discard, aiChatItems.tryAgain],\n },\n ],\n selectionCommand: [\n {\n items: [\n aiChatItems.improveWriting,\n aiChatItems.makeLonger,\n aiChatItems.makeShorter,\n aiChatItems.fixSpelling,\n aiChatItems.simplifyLanguage,\n ],\n },\n ],\n selectionSuggestion: [\n {\n items: [\n aiChatItems.replace,\n aiChatItems.insertBelow,\n aiChatItems.discard,\n aiChatItems.tryAgain,\n ],\n },\n ],\n};\n\nexport const AIMenuItems = ({\n aiEditorRef,\n setValue,\n}: {\n aiEditorRef: React.MutableRefObject;\n setValue: (value: string) => void;\n}) => {\n const { editor, useOption } = useEditorPlugin(AIChatPlugin);\n const { messages } = useOption('chat');\n const isSelecting = useIsSelecting();\n\n const menuState = useMemo(() => {\n if (messages && messages.length > 0) {\n return isSelecting ? 'selectionSuggestion' : 'cursorSuggestion';\n }\n\n return isSelecting ? 'selectionCommand' : 'cursorCommand';\n }, [isSelecting, messages]);\n\n const menuGroups = useMemo(() => {\n const items = menuStateItems[menuState];\n\n return items;\n }, [menuState]);\n\n useEffect(() => {\n if (menuGroups.length > 0 && menuGroups[0].items.length > 0) {\n setValue(menuGroups[0].items[0].value);\n }\n }, [menuGroups, setValue]);\n\n return (\n <>\n {menuGroups.map((group, index) => (\n \n {group.items.map((menuItem) => (\n {\n menuItem.onSelect?.({\n aiEditor: aiEditorRef.current!,\n editor: editor,\n });\n }}\n >\n {menuItem.icon}\n {menuItem.label}\n \n ))}\n \n ))}\n \n );\n};\n", + "content": "'use client';\n\nimport { useEffect, useMemo } from 'react';\n\nimport { AIChatPlugin, AIPlugin } from '@udecode/plate-ai/react';\nimport {\n type SlateEditor,\n getAncestorNode,\n getEndPoint,\n getNodeString,\n} from '@udecode/plate-common';\nimport {\n type PlateEditor,\n focusEditor,\n useEditorPlugin,\n} from '@udecode/plate-common/react';\nimport { useIsSelecting } from '@udecode/plate-selection/react';\nimport {\n Album,\n BadgeHelp,\n Check,\n CornerUpLeft,\n FeatherIcon,\n ListEnd,\n ListMinus,\n ListPlus,\n PenLine,\n Wand,\n X,\n} from 'lucide-react';\n\nimport { CommandGroup, CommandItem } from './command';\n\nexport type EditorChatState =\n | 'cursorCommand'\n | 'cursorSuggestion'\n | 'selectionCommand'\n | 'selectionSuggestion';\n\nexport const aiChatItems = {\n accept: {\n icon: ,\n label: 'Accept',\n value: 'accept',\n onSelect: ({ editor }) => {\n editor.getTransforms(AIChatPlugin).aiChat.accept();\n focusEditor(editor, getEndPoint(editor, editor.selection!));\n },\n },\n continueWrite: {\n icon: ,\n label: 'Continue writing',\n value: 'continueWrite',\n onSelect: ({ editor }) => {\n const ancestorNode = getAncestorNode(editor);\n\n if (!ancestorNode) return;\n\n const isEmpty = getNodeString(ancestorNode[0]).trim().length === 0;\n\n void editor.getApi(AIChatPlugin).aiChat.submit({\n mode: 'insert',\n prompt: isEmpty\n ? `\n{editor}\n\nStart writing a new paragraph AFTER ONLY ONE SENTENCE`\n : 'Continue writing AFTER ONLY ONE SENTENCE. DONT REPEAT THE TEXT.',\n });\n },\n },\n discard: {\n icon: ,\n label: 'Discard',\n shortcut: 'Escape',\n value: 'discard',\n onSelect: ({ editor }) => {\n editor.getTransforms(AIPlugin).ai.undo();\n editor.getApi(AIChatPlugin).aiChat.hide();\n },\n },\n explain: {\n icon: ,\n label: 'Explain',\n value: 'explain',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: {\n default: 'Explain {editor}',\n selecting: 'Explain',\n },\n });\n },\n },\n fixSpelling: {\n icon: ,\n label: 'Fix spelling & grammar',\n value: 'fixSpelling',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Fix spelling and grammar',\n });\n },\n },\n improveWriting: {\n icon: ,\n label: 'Improve writing',\n value: 'improveWriting',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Improve the writing',\n });\n },\n },\n insertBelow: {\n icon: ,\n label: 'Insert below',\n value: 'insertBelow',\n onSelect: ({ aiEditor, editor }) => {\n void editor.getTransforms(AIChatPlugin).aiChat.insertBelow(aiEditor);\n },\n },\n makeLonger: {\n icon: ,\n label: 'Make longer',\n value: 'makeLonger',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Make longer',\n });\n },\n },\n makeShorter: {\n icon: ,\n label: 'Make shorter',\n value: 'makeShorter',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Make shorter',\n });\n },\n },\n replace: {\n icon: ,\n label: 'Replace selection',\n value: 'replace',\n onSelect: ({ aiEditor, editor }) => {\n void editor.getTransforms(AIChatPlugin).aiChat.replaceSelection(aiEditor);\n },\n },\n simplifyLanguage: {\n icon: ,\n label: 'Simplify language',\n value: 'simplifyLanguage',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n prompt: 'Simplify the language',\n });\n },\n },\n summarize: {\n icon: ,\n label: 'Add a summary',\n value: 'summarize',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.submit({\n mode: 'insert',\n prompt: {\n default: 'Summarize {editor}',\n selecting: 'Summarize',\n },\n });\n },\n },\n tryAgain: {\n icon: ,\n label: 'Try again',\n value: 'tryAgain',\n onSelect: ({ editor }) => {\n void editor.getApi(AIChatPlugin).aiChat.reload();\n },\n },\n} satisfies Record<\n string,\n {\n icon: React.ReactNode;\n label: string;\n value: string;\n component?: React.ComponentType<{ menuState: EditorChatState }>;\n filterItems?: boolean;\n items?: { label: string; value: string }[];\n shortcut?: string;\n onSelect?: ({\n aiEditor,\n editor,\n }: {\n aiEditor: SlateEditor;\n editor: PlateEditor;\n }) => void;\n }\n>;\n\nconst menuStateItems: Record<\n EditorChatState,\n {\n items: (typeof aiChatItems)[keyof typeof aiChatItems][];\n heading?: string;\n }[]\n> = {\n cursorCommand: [\n {\n items: [\n aiChatItems.continueWrite,\n aiChatItems.summarize,\n aiChatItems.explain,\n ],\n },\n ],\n cursorSuggestion: [\n {\n items: [aiChatItems.accept, aiChatItems.discard, aiChatItems.tryAgain],\n },\n ],\n selectionCommand: [\n {\n items: [\n aiChatItems.improveWriting,\n aiChatItems.makeLonger,\n aiChatItems.makeShorter,\n aiChatItems.fixSpelling,\n aiChatItems.simplifyLanguage,\n ],\n },\n ],\n selectionSuggestion: [\n {\n items: [\n aiChatItems.replace,\n aiChatItems.insertBelow,\n aiChatItems.discard,\n aiChatItems.tryAgain,\n ],\n },\n ],\n};\n\nexport const AIMenuItems = ({\n aiEditorRef,\n setValue,\n}: {\n aiEditorRef: React.MutableRefObject;\n setValue: (value: string) => void;\n}) => {\n const { editor, useOption } = useEditorPlugin(AIChatPlugin);\n const { messages } = useOption('chat');\n const isSelecting = useIsSelecting();\n\n const menuState = useMemo(() => {\n if (messages && messages.length > 0) {\n return isSelecting ? 'selectionSuggestion' : 'cursorSuggestion';\n }\n\n return isSelecting ? 'selectionCommand' : 'cursorCommand';\n }, [isSelecting, messages]);\n\n const menuGroups = useMemo(() => {\n const items = menuStateItems[menuState];\n\n return items;\n }, [menuState]);\n\n useEffect(() => {\n if (menuGroups.length > 0 && menuGroups[0].items.length > 0) {\n setValue(menuGroups[0].items[0].value);\n }\n }, [menuGroups, setValue]);\n\n return (\n <>\n {menuGroups.map((group, index) => (\n \n {group.items.map((menuItem) => (\n {\n menuItem.onSelect?.({\n aiEditor: aiEditorRef.current!,\n editor: editor,\n });\n }}\n >\n {menuItem.icon}\n {menuItem.label}\n \n ))}\n \n ))}\n \n );\n};\n", "path": "plate-ui/ai-menu-items.tsx", "target": "components/plate-ui/ai-menu-items.tsx", "type": "registry:ui" }, { - "content": "'use client';\n\nimport React, { memo } from 'react';\n\nimport { AIChatPlugin, useLastAssistantMessage } from '@udecode/plate-ai/react';\nimport {\n type PlateEditor,\n Plate,\n useEditorPlugin,\n} from '@udecode/plate-common/react';\nimport { deserializeMd } from '@udecode/plate-markdown';\n\nimport { Editor } from './editor';\n\nexport const AIChatEditor = memo(\n ({\n aiEditorRef,\n }: {\n aiEditorRef: React.MutableRefObject;\n }) => {\n const { getOptions } = useEditorPlugin(AIChatPlugin);\n const lastAssistantMessage = useLastAssistantMessage();\n const content = lastAssistantMessage?.content ?? '';\n\n const aiEditor = React.useMemo(() => {\n const editor = getOptions().createAIEditor();\n\n const fragment = deserializeMd(editor, content);\n editor.children =\n fragment.length > 0 ? fragment : editor.api.create.value();\n\n return editor;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n React.useEffect(() => {\n if (aiEditor && content) {\n aiEditorRef.current = aiEditor;\n\n setTimeout(() => {\n aiEditor.tf.setValue(deserializeMd(aiEditor, content));\n }, 0);\n }\n }, [aiEditor, aiEditorRef, content]);\n\n if (!content) return null;\n\n return (\n \n \n \n );\n }\n);\n", + "content": "'use client';\n\nimport React, { memo } from 'react';\n\nimport { withProps } from '@udecode/cn';\nimport { AIChatPlugin, useLastAssistantMessage } 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 { useEditorPlugin } from '@udecode/plate-common/react';\nimport {\n type SlateEditor,\n BaseParagraphPlugin,\n SlateLeaf,\n} from '@udecode/plate-common';\nimport { HEADING_KEYS } from '@udecode/plate-heading';\nimport { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { BaseLinkPlugin } from '@udecode/plate-link';\nimport { deserializeMd } from '@udecode/plate-markdown';\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 staticComponents = {\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\nexport const AIChatEditor = memo(\n ({\n aiEditorRef,\n }: {\n aiEditorRef: React.MutableRefObject;\n }) => {\n const { getOptions } = useEditorPlugin(AIChatPlugin);\n const lastAssistantMessage = useLastAssistantMessage();\n const content = lastAssistantMessage?.content ?? '';\n\n const aiEditor = React.useMemo(() => {\n const editor = getOptions().createAIEditor();\n\n const fragment = deserializeMd(editor, content);\n editor.children =\n fragment.length > 0 ? fragment : editor.api.create.value();\n\n return editor;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n React.useEffect(() => {\n if (aiEditor && content) {\n aiEditorRef.current = aiEditor;\n\n setTimeout(() => {\n aiEditor.tf.setValue(deserializeMd(aiEditor, content));\n }, 0);\n }\n }, [aiEditor, aiEditorRef, content]);\n\n if (!content) return null;\n\n return (\n \n );\n }\n);\n", "path": "plate-ui/ai-chat-editor.tsx", "target": "components/plate-ui/ai-chat-editor.tsx", "type": "registry:ui" diff --git a/apps/www/public/r/styles/default/ai-plugins.json b/apps/www/public/r/styles/default/ai-plugins.json index b9b1aaa0d5..42ad1006a9 100644 --- a/apps/www/public/r/styles/default/ai-plugins.json +++ b/apps/www/public/r/styles/default/ai-plugins.json @@ -11,7 +11,7 @@ ], "files": [ { - "content": "'use client';\n\nimport React from 'react';\n\nimport { withProps } from '@udecode/cn';\nimport { AIChatPlugin, AIPlugin } from '@udecode/plate-ai/react';\nimport {\n BoldPlugin,\n CodePlugin,\n ItalicPlugin,\n StrikethroughPlugin,\n UnderlinePlugin,\n} from '@udecode/plate-basic-marks/react';\nimport { BlockquotePlugin } from '@udecode/plate-block-quote/react';\nimport {\n CodeBlockPlugin,\n CodeLinePlugin,\n CodeSyntaxPlugin,\n} from '@udecode/plate-code-block/react';\nimport {\n ParagraphPlugin,\n PlateLeaf,\n createPlateEditor,\n} from '@udecode/plate-common/react';\nimport { HEADING_KEYS } from '@udecode/plate-heading';\nimport { HorizontalRulePlugin } from '@udecode/plate-horizontal-rule/react';\nimport { LinkPlugin } from '@udecode/plate-link/react';\nimport { MarkdownPlugin } from '@udecode/plate-markdown';\n\nimport { cursorOverlayPlugin } from '@/components/editor/plugins/cursor-overlay-plugin';\nimport { AIMenu } from '@/components/plate-ui/ai-menu';\nimport { BlockquoteElement } from '@/components/plate-ui/blockquote-element';\nimport { CodeBlockElement } from '@/components/plate-ui/code-block-element';\nimport { CodeLeaf } from '@/components/plate-ui/code-leaf';\nimport { CodeLineElement } from '@/components/plate-ui/code-line-element';\nimport { CodeSyntaxLeaf } from '@/components/plate-ui/code-syntax-leaf';\nimport { HeadingElement } from '@/components/plate-ui/heading-element';\nimport { HrElement } from '@/components/plate-ui/hr-element';\nimport { LinkElement } from '@/components/plate-ui/link-element';\nimport { ParagraphElement } from '@/components/plate-ui/paragraph-element';\n\nimport { basicNodesPlugins } from './basic-nodes-plugins';\nimport { blockSelectionReadOnlyPlugin } from './block-selection-plugins';\nimport { indentListPlugins } from './indent-list-plugins';\nimport { linkPlugin } from './link-plugin';\n\nconst createAIEditor = () => {\n const editor = createPlateEditor({\n id: 'ai',\n override: {\n components: {\n [BlockquotePlugin.key]: BlockquoteElement,\n [BoldPlugin.key]: withProps(PlateLeaf, { as: 'strong' }),\n [CodeBlockPlugin.key]: CodeBlockElement,\n [CodeLinePlugin.key]: CodeLineElement,\n [CodePlugin.key]: CodeLeaf,\n [CodeSyntaxPlugin.key]: CodeSyntaxLeaf,\n [HEADING_KEYS.h1]: withProps(HeadingElement, { variant: 'h1' }),\n [HEADING_KEYS.h2]: withProps(HeadingElement, { variant: 'h2' }),\n [HEADING_KEYS.h3]: withProps(HeadingElement, { variant: 'h3' }),\n [HorizontalRulePlugin.key]: HrElement,\n [ItalicPlugin.key]: withProps(PlateLeaf, { as: 'em' }),\n [LinkPlugin.key]: LinkElement,\n [ParagraphPlugin.key]: ParagraphElement,\n [StrikethroughPlugin.key]: withProps(PlateLeaf, { as: 's' }),\n [UnderlinePlugin.key]: withProps(PlateLeaf, { as: 'u' }),\n },\n },\n plugins: [\n ...basicNodesPlugins,\n ...indentListPlugins,\n HorizontalRulePlugin,\n linkPlugin,\n MarkdownPlugin.configure({ options: { indentList: true } }),\n blockSelectionReadOnlyPlugin,\n ],\n });\n\n return editor;\n};\n\nconst systemCommon = `\\\nYou are an advanced AI-powered note-taking assistant, designed to enhance productivity and creativity in note management.\nRespond directly to user prompts with clear, concise, and relevant content. Maintain a neutral, helpful tone.\n\nRules:\n- is the entire note the user is working on.\n- is a reminder of how you should reply to INSTRUCTIONS. It does not apply to questions.\n- Anything else is the user prompt.\n- Your response should be tailored to the user's prompt, providing precise assistance to optimize note management.\n- For INSTRUCTIONS: Follow the exactly. Provide ONLY the content to be inserted or replaced. No explanations or comments.\n- For QUESTIONS: Provide a helpful and concise answer. You may include brief explanations if necessary.\n- CRITICAL: Distinguish between INSTRUCTIONS and QUESTIONS. Instructions typically ask you to modify or add content. Questions ask for information or clarification.\n`;\n\nconst systemDefault = `\\\n${systemCommon}\n- is the current block of text the user is working on.\n- Ensure your output can seamlessly fit into the existing structure.\n- CRITICAL: Provide only a single block of text. DO NOT create multiple paragraphs or separate blocks.\n\n{block}\n\n`;\n\nconst systemSelecting = `\\\n${systemCommon}\n- is the block of text containing the user's selection, providing context.\n- Ensure your output can seamlessly fit into the existing structure.\n- is the specific text the user has selected in the block and wants to modify or ask about.\n- Consider the context provided by , but only modify . Your response should be a direct replacement for .\n\n{block}\n\n\n{selection}\n\n`;\n\nconst systemBlockSelecting = `\\\n${systemCommon}\n- represents the full blocks of text the user has selected and wants to modify or ask about.\n- Your response should be a direct replacement for the entire .\n- Maintain the overall structure and formatting of the selected blocks, unless explicitly instructed otherwise.\n- CRITICAL: Provide only the content to replace . Do not add additional blocks or change the block structure unless specifically requested.\n\n{block}\n\n`;\n\nconst userDefault = `\nCRITICAL: DO NOT use block formatting. You can only use inline formatting.\nCRITICAL: DO NOT start new lines or paragraphs.\nNEVER write .\n\n{prompt}`;\n\nconst userSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the text to replace . No explanations.\nEnsure it fits seamlessly within . If is empty, write ONE random sentence.\nNEVER write or .\n\n{prompt} about `;\n\nconst userBlockSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the content to replace the entire . No explanations.\nMaintain the overall structure unless instructed otherwise.\nNEVER write or .\n\n{prompt} about `;\n\nexport const PROMPT_TEMPLATES = {\n systemBlockSelecting,\n systemDefault,\n systemSelecting,\n userBlockSelecting,\n userDefault,\n userSelecting,\n};\n\nexport const aiPlugins = [\n cursorOverlayPlugin,\n MarkdownPlugin.configure({ options: { indentList: true } }),\n AIPlugin,\n AIChatPlugin.configure({\n options: {\n createAIEditor,\n promptTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.userBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.userSelecting\n : PROMPT_TEMPLATES.userDefault;\n },\n systemTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.systemBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.systemSelecting\n : PROMPT_TEMPLATES.systemDefault;\n },\n },\n render: { afterEditable: () => },\n }),\n] as const;\n", + "content": "'use client';\n\nimport React from 'react';\n\nimport { AIChatPlugin, AIPlugin } 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 { BaseParagraphPlugin, createSlateEditor } from '@udecode/plate-common';\nimport { BaseHeadingPlugin, HEADING_LEVELS } from '@udecode/plate-heading';\nimport { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { BaseIndentListPlugin } from '@udecode/plate-indent-list';\nimport { BaseLinkPlugin } from '@udecode/plate-link';\nimport { MarkdownPlugin } from '@udecode/plate-markdown';\n\nimport { AIMenu } from '@/components/plate-ui/ai-menu';\nimport {\n TodoLiStatic,\n TodoMarkerStatic,\n} from '@/components/plate-ui/indent-todo-marker-static';\n\nimport { cursorOverlayPlugin } from './cursor-overlay-plugin';\nconst createAIEditor = () => {\n const editor = createSlateEditor({\n id: 'ai',\n 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 BaseIndentListPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n ...HEADING_LEVELS,\n BaseBlockquotePlugin.key,\n BaseCodeBlockPlugin.key,\n ],\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 });\n\n return editor;\n};\n\nconst systemCommon = `\\\nYou are an advanced AI-powered note-taking assistant, designed to enhance productivity and creativity in note management.\nRespond directly to user prompts with clear, concise, and relevant content. Maintain a neutral, helpful tone.\n\nRules:\n- is the entire note the user is working on.\n- is a reminder of how you should reply to INSTRUCTIONS. It does not apply to questions.\n- Anything else is the user prompt.\n- Your response should be tailored to the user's prompt, providing precise assistance to optimize note management.\n- For INSTRUCTIONS: Follow the exactly. Provide ONLY the content to be inserted or replaced. No explanations or comments.\n- For QUESTIONS: Provide a helpful and concise answer. You may include brief explanations if necessary.\n- CRITICAL: Distinguish between INSTRUCTIONS and QUESTIONS. Instructions typically ask you to modify or add content. Questions ask for information or clarification.\n`;\n\nconst systemDefault = `\\\n${systemCommon}\n- is the current block of text the user is working on.\n- Ensure your output can seamlessly fit into the existing structure.\n- CRITICAL: Provide only a single block of text. DO NOT create multiple paragraphs or separate blocks.\n\n{block}\n\n`;\n\nconst systemSelecting = `\\\n${systemCommon}\n- is the block of text containing the user's selection, providing context.\n- Ensure your output can seamlessly fit into the existing structure.\n- is the specific text the user has selected in the block and wants to modify or ask about.\n- Consider the context provided by , but only modify . Your response should be a direct replacement for .\n\n{block}\n\n\n{selection}\n\n`;\n\nconst systemBlockSelecting = `\\\n${systemCommon}\n- represents the full blocks of text the user has selected and wants to modify or ask about.\n- Your response should be a direct replacement for the entire .\n- Maintain the overall structure and formatting of the selected blocks, unless explicitly instructed otherwise.\n- CRITICAL: Provide only the content to replace . Do not add additional blocks or change the block structure unless specifically requested.\n\n{block}\n\n`;\n\nconst userDefault = `\nCRITICAL: DO NOT use block formatting. You can only use inline formatting.\nCRITICAL: DO NOT start new lines or paragraphs.\nNEVER write .\n\n{prompt}`;\n\nconst userSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the text to replace . No explanations.\nEnsure it fits seamlessly within . If is empty, write ONE random sentence.\nNEVER write or .\n\n{prompt} about `;\n\nconst userBlockSelecting = `\nIf this is a question, provide a helpful and concise answer about .\nIf this is an instruction, provide ONLY the content to replace the entire . No explanations.\nMaintain the overall structure unless instructed otherwise.\nNEVER write or .\n\n{prompt} about `;\n\nexport const PROMPT_TEMPLATES = {\n systemBlockSelecting,\n systemDefault,\n systemSelecting,\n userBlockSelecting,\n userDefault,\n userSelecting,\n};\n\nexport const aiPlugins = [\n cursorOverlayPlugin,\n MarkdownPlugin.configure({ options: { indentList: true } }),\n AIPlugin,\n AIChatPlugin.configure({\n options: {\n createAIEditor,\n promptTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.userBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.userSelecting\n : PROMPT_TEMPLATES.userDefault;\n },\n systemTemplate: ({ isBlockSelecting, isSelecting }) => {\n return isBlockSelecting\n ? PROMPT_TEMPLATES.systemBlockSelecting\n : isSelecting\n ? PROMPT_TEMPLATES.systemSelecting\n : PROMPT_TEMPLATES.systemDefault;\n },\n },\n render: { afterEditable: () => },\n }),\n] as const;\n", "path": "components/editor/plugins/ai-plugins.tsx", "target": "components/editor/plugins/ai-plugins.tsx", "type": "registry:component" diff --git a/apps/www/public/r/styles/default/editor.json b/apps/www/public/r/styles/default/editor.json index bc7c709236..126927e2a3 100644 --- a/apps/www/public/r/styles/default/editor.json +++ b/apps/www/public/r/styles/default/editor.json @@ -21,7 +21,7 @@ "type": "registry:ui" }, { - "content": "import React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@udecode/cn';\nimport { type PlateStaticProps, PlateStatic } from '@udecode/plate-common';\nimport { cva } from 'class-variance-authority';\n\nexport const editorVariants = cva(\n cn(\n 'group/editor',\n 'relative w-full cursor-text select-text overflow-x-hidden whitespace-pre-wrap break-words',\n 'rounded-md ring-offset-background focus-visible:outline-none',\n 'placeholder:text-muted-foreground/80 [&_[data-slate-placeholder]]:top-[auto_!important] [&_[data-slate-placeholder]]:text-muted-foreground/80 [&_[data-slate-placeholder]]:!opacity-100',\n '[&_strong]:font-bold'\n ),\n {\n defaultVariants: {\n variant: 'none',\n },\n variants: {\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n },\n focused: {\n true: 'ring-2 ring-ring ring-offset-2',\n },\n variant: {\n ai: 'w-full px-0 text-base md:text-sm',\n aiChat:\n 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm',\n default:\n 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n demo: 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n fullWidth: 'size-full px-16 pb-72 pt-4 text-base sm:px-24',\n none: '',\n select: 'px-3 py-2 text-base data-[readonly]:w-fit',\n },\n },\n }\n);\n\nexport function EditorStatic({\n children,\n className,\n variant,\n ...props\n}: PlateStaticProps & VariantProps) {\n return (\n \n );\n}\n", + "content": "import React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@udecode/cn';\nimport { type PlateStaticProps, PlateStatic } from '@udecode/plate-common';\nimport { cva } from 'class-variance-authority';\n\nexport const editorVariants = cva(\n cn(\n 'group/editor',\n 'relative w-full cursor-text select-text overflow-x-hidden whitespace-pre-wrap break-words',\n 'rounded-md ring-offset-background focus-visible:outline-none',\n 'placeholder:text-muted-foreground/80 [&_[data-slate-placeholder]]:top-[auto_!important] [&_[data-slate-placeholder]]:text-muted-foreground/80 [&_[data-slate-placeholder]]:!opacity-100',\n '[&_strong]:font-bold'\n ),\n {\n defaultVariants: {\n variant: 'none',\n },\n variants: {\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n },\n focused: {\n true: 'ring-2 ring-ring ring-offset-2',\n },\n variant: {\n ai: 'w-full px-0 text-base md:text-sm',\n aiChat:\n 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-10 py-2 text-base md:text-sm',\n default:\n 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n demo: 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n fullWidth: 'size-full px-16 pb-72 pt-4 text-base sm:px-24',\n none: '',\n select: 'px-3 py-2 text-base data-[readonly]:w-fit',\n },\n },\n }\n);\n\nexport function EditorStatic({\n children,\n className,\n variant,\n ...props\n}: PlateStaticProps & VariantProps) {\n return (\n \n );\n}\n", "path": "plate-ui/editor-static.tsx", "target": "components/plate-ui/editor-static.tsx", "type": "registry:ui" diff --git a/apps/www/public/r/styles/default/indent-fire-marker.json b/apps/www/public/r/styles/default/indent-fire-marker.json index 15522bcfa6..aa82bc0308 100644 --- a/apps/www/public/r/styles/default/indent-fire-marker.json +++ b/apps/www/public/r/styles/default/indent-fire-marker.json @@ -4,7 +4,7 @@ ], "files": [ { - "content": "import React from 'react';\n\nimport type { SlateRenderElementProps } from '@udecode/plate-core';\nimport type { TIndentElement } from '@udecode/plate-indent';\n\nexport const FireMarker = (\n props: Omit\n) => {\n const { element } = props;\n\n return (\n
\n \n {(element as TIndentElement).indent % 2 === 0 ? '🔥' : '🚀'}\n \n
\n );\n};\n\nexport const FireLiComponent = (props: SlateRenderElementProps) => {\n const { children } = props;\n\n return {children};\n};\n", + "content": "import React from 'react';\n\nimport type { SlateRenderElementProps } from '@udecode/plate-common';\nimport type { TIndentElement } from '@udecode/plate-indent';\n\nexport const FireMarker = (\n props: Omit\n) => {\n const { element } = props;\n\n return (\n
\n \n {(element as TIndentElement).indent % 2 === 0 ? '🔥' : '🚀'}\n \n
\n );\n};\n\nexport const FireLiComponent = (props: SlateRenderElementProps) => {\n const { children } = props;\n\n return {children};\n};\n", "path": "plate-ui/indent-fire-marker.tsx", "target": "components/plate-ui/indent-fire-marker.tsx", "type": "registry:ui" diff --git a/apps/www/public/r/styles/default/indent-todo-marker.json b/apps/www/public/r/styles/default/indent-todo-marker.json index 3565a02a73..7f3bf7fef7 100644 --- a/apps/www/public/r/styles/default/indent-todo-marker.json +++ b/apps/www/public/r/styles/default/indent-todo-marker.json @@ -22,6 +22,12 @@ "path": "plate-ui/indent-todo-marker.tsx", "target": "components/plate-ui/indent-todo-marker.tsx", "type": "registry:ui" + }, + { + "content": "import React from 'react';\n\nimport type { SlateRenderElementProps } from '@udecode/plate-common';\n\nimport { cn } from '@udecode/cn';\n\nimport { CheckboxStatic } from './checkbox-static';\n\nexport const TodoMarkerStatic = ({\n element,\n}: Omit) => {\n return (\n
\n \n
\n );\n};\n\nexport const TodoLiStatic = ({\n children,\n element,\n}: SlateRenderElementProps) => {\n return (\n \n {children}\n \n );\n};\n", + "path": "plate-ui/indent-todo-marker-static.tsx", + "target": "components/plate-ui/indent-todo-marker-static.tsx", + "type": "registry:ui" } ], "name": "indent-todo-marker", diff --git a/apps/www/public/r/styles/default/slate-to-html.json b/apps/www/public/r/styles/default/slate-to-html.json index b2f345c3b5..6a96a478a5 100644 --- a/apps/www/public/r/styles/default/slate-to-html.json +++ b/apps/www/public/r/styles/default/slate-to-html.json @@ -2,7 +2,7 @@ "description": "Slate to HTML", "files": [ { - "content": "import React from 'react';\n\nimport { withProps } from '@udecode/cn';\nimport { BaseAlignPlugin } from '@udecode/plate-alignment';\nimport {\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\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 { BaseCommentsPlugin } from '@udecode/plate-comments';\nimport {\n type Value,\n BaseParagraphPlugin,\n SlateLeaf,\n createSlateEditor,\n serializeHtml,\n} from '@udecode/plate-common';\nimport { BaseDatePlugin } from '@udecode/plate-date';\nimport {\n BaseFontBackgroundColorPlugin,\n BaseFontColorPlugin,\n BaseFontSizePlugin,\n} from '@udecode/plate-font';\nimport {\n BaseHeadingPlugin,\n BaseTocPlugin,\n HEADING_KEYS,\n HEADING_LEVELS,\n} from '@udecode/plate-heading';\nimport { BaseHighlightPlugin } from '@udecode/plate-highlight';\nimport { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { BaseIndentPlugin } from '@udecode/plate-indent';\nimport { BaseIndentListPlugin } from '@udecode/plate-indent-list';\nimport { BaseKbdPlugin } from '@udecode/plate-kbd';\nimport { BaseColumnItemPlugin, BaseColumnPlugin } from '@udecode/plate-layout';\nimport { BaseLineHeightPlugin } from '@udecode/plate-line-height';\nimport { BaseLinkPlugin } from '@udecode/plate-link';\nimport {\n BaseAudioPlugin,\n BaseFilePlugin,\n BaseImagePlugin,\n BaseMediaEmbedPlugin,\n BaseVideoPlugin,\n} from '@udecode/plate-media';\nimport { BaseMentionPlugin } from '@udecode/plate-mention';\nimport {\n BaseTableCellHeaderPlugin,\n BaseTableCellPlugin,\n BaseTablePlugin,\n BaseTableRowPlugin,\n} from '@udecode/plate-table';\nimport { BaseTogglePlugin } from '@udecode/plate-toggle';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport Prism from 'prismjs';\n\nimport { H3 } from '@/components/typography';\nimport {\n EditorClient,\n ExportHtmlButton,\n HtmlIframe,\n} from '@/components/editor/slate-to-html';\nimport { alignValue } from '@/components/values/align-value';\nimport { basicElementsValue } from '@/components/values/basic-elements-value';\nimport { basicMarksValue } from '@/components/values/basic-marks-value';\nimport { columnValue } from '@/components/values/column-value';\nimport { commentsValue } from '@/components/values/comments-value';\nimport { dateValue } from '@/components/values/date-value';\nimport { fontValue } from '@/components/values/font-value';\nimport { highlightValue } from '@/components/values/highlight-value';\nimport { horizontalRuleValue } from '@/components/values/horizontal-rule-value';\nimport { indentListValue } from '@/components/values/indent-list-value';\nimport { indentValue } from '@/components/values/indent-value';\nimport { kbdValue } from '@/components/values/kbd-value';\nimport { lineHeightValue } from '@/components/values/line-height-value';\nimport { linkValue } from '@/components/values/link-value';\nimport { todoListValue } from '@/components/values/list-value';\nimport { mediaValue } from '@/components/values/media-value';\nimport { mentionValue } from '@/components/values/mention-value';\nimport { tableValue } from '@/components/values/table-value';\nimport { tocPlaygroundValue } from '@/components/values/toc-value';\nimport { createHtmlDocument } from '@/lib/create-html-document';\nimport { BlockquoteElementStatic } from '@/components/plate-ui/blockquote-element-static';\nimport { CodeBlockElementStatic } from '@/components/plate-ui/code-block-element-static';\nimport { CodeLeafStatic } from '@/components/plate-ui/code-leaf-static';\nimport { CodeLineElementStatic } from '@/components/plate-ui/code-line-element-static';\nimport { CodeSyntaxLeafStatic } from '@/components/plate-ui/code-syntax-leaf-static';\nimport { ColumnElementStatic } from '@/components/plate-ui/column-element-static';\nimport { ColumnGroupElementStatic } from '@/components/plate-ui/column-group-element-static';\nimport { CommentLeafStatic } from '@/components/plate-ui/comment-leaf-static';\nimport { DateElementStatic } from '@/components/plate-ui/date-element-static';\nimport { EditorStatic } from '@/components/plate-ui/editor-static';\nimport { HeadingElementStatic } from '@/components/plate-ui/heading-element-static';\nimport { HighlightLeafStatic } from '@/components/plate-ui/highlight-leaf-static';\nimport { HrElementStatic } from '@/components/plate-ui/hr-element-static';\nimport { ImageElementStatic } from '@/components/plate-ui/image-element-static';\nimport {\n FireLiComponent,\n FireMarker,\n} from '@/components/plate-ui/indent-fire-marker';\nimport {\n TodoLiStatic,\n TodoMarkerStatic,\n} from '@/components/plate-ui/indent-todo-marker-static';\nimport { KbdLeafStatic } from '@/components/plate-ui/kbd-leaf-static';\nimport { LinkElementStatic } from '@/components/plate-ui/link-element-static';\nimport { MediaAudioElementStatic } from '@/components/plate-ui/media-audio-element-static';\nimport { MediaFileElementStatic } from '@/components/plate-ui/media-file-element-static';\nimport { MediaVideoElementStatic } from '@/components/plate-ui/media-video-element-static';\nimport { MentionElementStatic } from '@/components/plate-ui/mention-element-static';\nimport { ParagraphElementStatic } from '@/components/plate-ui/paragraph-element-static';\nimport {\n TableCellElementStatic,\n TableCellHeaderStaticElement,\n} from '@/components/plate-ui/table-cell-element-static';\nimport { TableElementStatic } from '@/components/plate-ui/table-element-static';\nimport { TableRowElementStatic } from '@/components/plate-ui/table-row-element-static';\nimport { TocElementStatic } from '@/components/plate-ui/toc-element-static';\nimport { ToggleElementStatic } from '@/components/plate-ui/toggle-element-static';\nconst getCachedTailwindCss = React.cache(async () => {\n const cssPath = path.join(process.cwd(), 'public', 'tailwind.css');\n\n return await fs.readFile(cssPath, 'utf8');\n});\n\nconst getCachedPrismCss = React.cache(async () => {\n const cssPath = path.join(process.cwd(), 'public', 'prism.css');\n\n return await fs.readFile(cssPath, 'utf8');\n});\n\nexport default async function SlateToHtmlBlock() {\n const components = {\n [BaseAudioPlugin.key]: MediaAudioElementStatic,\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 [BaseColumnItemPlugin.key]: ColumnElementStatic,\n [BaseColumnPlugin.key]: ColumnGroupElementStatic,\n [BaseCommentsPlugin.key]: CommentLeafStatic,\n [BaseDatePlugin.key]: DateElementStatic,\n [BaseFilePlugin.key]: MediaFileElementStatic,\n [BaseHighlightPlugin.key]: HighlightLeafStatic,\n [BaseHorizontalRulePlugin.key]: HrElementStatic,\n [BaseImagePlugin.key]: ImageElementStatic,\n [BaseItalicPlugin.key]: withProps(SlateLeaf, { as: 'em' }),\n [BaseKbdPlugin.key]: KbdLeafStatic,\n [BaseLinkPlugin.key]: LinkElementStatic,\n // [BaseMediaEmbedPlugin.key]: MediaEmbedElementStatic,\n [BaseMentionPlugin.key]: MentionElementStatic,\n [BaseParagraphPlugin.key]: ParagraphElementStatic,\n [BaseStrikethroughPlugin.key]: withProps(SlateLeaf, { as: 'del' }),\n [BaseSubscriptPlugin.key]: withProps(SlateLeaf, { as: 'sub' }),\n [BaseSuperscriptPlugin.key]: withProps(SlateLeaf, { as: 'sup' }),\n [BaseTableCellHeaderPlugin.key]: TableCellHeaderStaticElement,\n [BaseTableCellPlugin.key]: TableCellElementStatic,\n [BaseTablePlugin.key]: TableElementStatic,\n [BaseTableRowPlugin.key]: TableRowElementStatic,\n [BaseTocPlugin.key]: TocElementStatic,\n [BaseTogglePlugin.key]: ToggleElementStatic,\n [BaseUnderlinePlugin.key]: withProps(SlateLeaf, { as: 'u' }),\n [BaseVideoPlugin.key]: MediaVideoElementStatic,\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 [HEADING_KEYS.h4]: withProps(HeadingElementStatic, { variant: 'h4' }),\n [HEADING_KEYS.h5]: withProps(HeadingElementStatic, { variant: 'h5' }),\n [HEADING_KEYS.h6]: withProps(HeadingElementStatic, { variant: 'h6' }),\n };\n\n const createValue = (): Value => [\n ...basicElementsValue,\n ...basicMarksValue,\n ...tocPlaygroundValue,\n ...todoListValue,\n ...linkValue,\n ...horizontalRuleValue,\n ...tableValue,\n ...mediaValue,\n ...columnValue,\n ...mentionValue,\n ...dateValue,\n ...fontValue,\n ...highlightValue,\n ...kbdValue,\n ...commentsValue,\n ...alignValue,\n ...lineHeightValue,\n ...indentValue,\n ...indentListValue,\n ];\n\n const editor = createSlateEditor({\n plugins: [\n BaseColumnPlugin,\n BaseColumnItemPlugin,\n BaseTocPlugin,\n BaseVideoPlugin,\n BaseAudioPlugin,\n BaseParagraphPlugin,\n BaseHeadingPlugin,\n BaseMediaEmbedPlugin,\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\n BaseUnderlinePlugin,\n BaseBlockquotePlugin,\n BaseDatePlugin,\n BaseCodeBlockPlugin.configure({\n options: {\n prism: Prism,\n },\n }),\n BaseIndentPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n BaseBlockquotePlugin.key,\n BaseCodeBlockPlugin.key,\n ],\n },\n }),\n BaseIndentListPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n ...HEADING_LEVELS,\n BaseBlockquotePlugin.key,\n BaseCodeBlockPlugin.key,\n BaseTogglePlugin.key,\n ],\n },\n options: {\n listStyleTypes: {\n fire: {\n liComponent: FireLiComponent,\n markerComponent: FireMarker,\n type: 'fire',\n },\n todo: {\n liComponent: TodoLiStatic,\n markerComponent: TodoMarkerStatic,\n type: 'todo',\n },\n },\n },\n }),\n BaseLinkPlugin,\n BaseTableRowPlugin,\n BaseTablePlugin,\n BaseTableCellPlugin,\n BaseHorizontalRulePlugin,\n BaseFontColorPlugin,\n BaseFontBackgroundColorPlugin,\n BaseFontSizePlugin,\n BaseKbdPlugin,\n BaseAlignPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n BaseMediaEmbedPlugin.key,\n ...HEADING_LEVELS,\n BaseImagePlugin.key,\n ],\n },\n }),\n BaseLineHeightPlugin,\n BaseHighlightPlugin,\n BaseFilePlugin,\n BaseImagePlugin,\n BaseMentionPlugin,\n BaseCommentsPlugin,\n BaseTogglePlugin,\n ],\n value: createValue(),\n });\n\n const tailwindCss = await getCachedTailwindCss();\n const prismCss = await getCachedPrismCss();\n // const cookieStore = await cookies();\n // const theme = cookieStore.get('theme')?.value;\n const theme = 'light';\n\n // Get the editor content HTML using EditorStatic\n const editorHtml = await serializeHtml(editor, {\n components,\n editorComponent: EditorStatic,\n props: { style: { padding: '0 calc(50% - 350px)', paddingBottom: '' } },\n });\n\n // Create the full HTML document\n const html = createHtmlDocument({\n editorHtml,\n prismCss,\n tailwindCss,\n theme,\n });\n\n return (\n
\n
\n

Editor

\n \n
\n\n
\n

EditorStatic

\n \n
\n\n
\n
\n

HTML Iframe

\n \n
\n \n
\n
\n );\n}\n", + "content": "import React from 'react';\n\nimport { withProps } from '@udecode/cn';\nimport { BaseAlignPlugin } from '@udecode/plate-alignment';\nimport {\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\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 { BaseCommentsPlugin } from '@udecode/plate-comments';\nimport {\n type Value,\n BaseParagraphPlugin,\n SlateLeaf,\n createSlateEditor,\n serializeHtml,\n} from '@udecode/plate-common';\nimport { BaseDatePlugin } from '@udecode/plate-date';\nimport {\n BaseFontBackgroundColorPlugin,\n BaseFontColorPlugin,\n BaseFontSizePlugin,\n} from '@udecode/plate-font';\nimport {\n BaseHeadingPlugin,\n BaseTocPlugin,\n HEADING_KEYS,\n HEADING_LEVELS,\n} from '@udecode/plate-heading';\nimport { BaseHighlightPlugin } from '@udecode/plate-highlight';\nimport { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { BaseIndentPlugin } from '@udecode/plate-indent';\nimport { BaseIndentListPlugin } from '@udecode/plate-indent-list';\nimport { BaseKbdPlugin } from '@udecode/plate-kbd';\nimport { BaseColumnItemPlugin, BaseColumnPlugin } from '@udecode/plate-layout';\nimport { BaseLineHeightPlugin } from '@udecode/plate-line-height';\nimport { BaseLinkPlugin } from '@udecode/plate-link';\nimport {\n BaseAudioPlugin,\n BaseFilePlugin,\n BaseImagePlugin,\n BaseMediaEmbedPlugin,\n BaseVideoPlugin,\n} from '@udecode/plate-media';\nimport { BaseMentionPlugin } from '@udecode/plate-mention';\nimport {\n BaseTableCellHeaderPlugin,\n BaseTableCellPlugin,\n BaseTablePlugin,\n BaseTableRowPlugin,\n} from '@udecode/plate-table';\nimport { BaseTogglePlugin } from '@udecode/plate-toggle';\nimport Prism from 'prismjs';\n\nimport { H3 } from '@/components/typography';\nimport {\n EditorClient,\n ExportHtmlButton,\n HtmlIframe,\n} from '@/components/editor/slate-to-html';\nimport { alignValue } from '@/components/values/align-value';\nimport { basicElementsValue } from '@/components/values/basic-elements-value';\nimport { basicMarksValue } from '@/components/values/basic-marks-value';\nimport { columnValue } from '@/components/values/column-value';\nimport { commentsValue } from '@/components/values/comments-value';\nimport { dateValue } from '@/components/values/date-value';\nimport { fontValue } from '@/components/values/font-value';\nimport { highlightValue } from '@/components/values/highlight-value';\nimport { horizontalRuleValue } from '@/components/values/horizontal-rule-value';\nimport { indentListValue } from '@/components/values/indent-list-value';\nimport { indentValue } from '@/components/values/indent-value';\nimport { kbdValue } from '@/components/values/kbd-value';\nimport { lineHeightValue } from '@/components/values/line-height-value';\nimport { linkValue } from '@/components/values/link-value';\nimport { todoListValue } from '@/components/values/list-value';\nimport { mediaValue } from '@/components/values/media-value';\nimport { mentionValue } from '@/components/values/mention-value';\nimport { tableValue } from '@/components/values/table-value';\nimport { tocPlaygroundValue } from '@/components/values/toc-value';\nimport { createHtmlDocument } from '@/lib/create-html-document';\nimport { BlockquoteElementStatic } from '@/components/plate-ui/blockquote-element-static';\nimport { CodeBlockElementStatic } from '@/components/plate-ui/code-block-element-static';\nimport { CodeLeafStatic } from '@/components/plate-ui/code-leaf-static';\nimport { CodeLineElementStatic } from '@/components/plate-ui/code-line-element-static';\nimport { CodeSyntaxLeafStatic } from '@/components/plate-ui/code-syntax-leaf-static';\nimport { ColumnElementStatic } from '@/components/plate-ui/column-element-static';\nimport { ColumnGroupElementStatic } from '@/components/plate-ui/column-group-element-static';\nimport { CommentLeafStatic } from '@/components/plate-ui/comment-leaf-static';\nimport { DateElementStatic } from '@/components/plate-ui/date-element-static';\nimport { EditorStatic } from '@/components/plate-ui/editor-static';\nimport { HeadingElementStatic } from '@/components/plate-ui/heading-element-static';\nimport { HighlightLeafStatic } from '@/components/plate-ui/highlight-leaf-static';\nimport { HrElementStatic } from '@/components/plate-ui/hr-element-static';\nimport { ImageElementStatic } from '@/components/plate-ui/image-element-static';\nimport {\n FireLiComponent,\n FireMarker,\n} from '@/components/plate-ui/indent-fire-marker';\nimport {\n TodoLiStatic,\n TodoMarkerStatic,\n} from '@/components/plate-ui/indent-todo-marker-static';\nimport { KbdLeafStatic } from '@/components/plate-ui/kbd-leaf-static';\nimport { LinkElementStatic } from '@/components/plate-ui/link-element-static';\nimport { MediaAudioElementStatic } from '@/components/plate-ui/media-audio-element-static';\nimport { MediaFileElementStatic } from '@/components/plate-ui/media-file-element-static';\nimport { MediaVideoElementStatic } from '@/components/plate-ui/media-video-element-static';\nimport { MentionElementStatic } from '@/components/plate-ui/mention-element-static';\nimport { ParagraphElementStatic } from '@/components/plate-ui/paragraph-element-static';\nimport {\n TableCellElementStatic,\n TableCellHeaderStaticElement,\n} from '@/components/plate-ui/table-cell-element-static';\nimport { TableElementStatic } from '@/components/plate-ui/table-element-static';\nimport { TableRowElementStatic } from '@/components/plate-ui/table-row-element-static';\nimport { TocElementStatic } from '@/components/plate-ui/toc-element-static';\nimport { ToggleElementStatic } from '@/components/plate-ui/toggle-element-static';\n// const getCachedTailwindCss = React.cache(async () => {\n// const cssPath = path.join(process.cwd(), 'public', 'tailwind.css');\n\n// return await fs.readFile(cssPath, 'utf8');\n// });\n\n// const getCachedPrismCss = React.cache(async () => {\n// const cssPath = path.join(process.cwd(), 'public', 'prism.css');\n\n// return await fs.readFile(cssPath, 'utf8');\n// });\n\nexport default async function SlateToHtmlBlock() {\n const components = {\n [BaseAudioPlugin.key]: MediaAudioElementStatic,\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 [BaseColumnItemPlugin.key]: ColumnElementStatic,\n [BaseColumnPlugin.key]: ColumnGroupElementStatic,\n [BaseCommentsPlugin.key]: CommentLeafStatic,\n [BaseDatePlugin.key]: DateElementStatic,\n [BaseFilePlugin.key]: MediaFileElementStatic,\n [BaseHighlightPlugin.key]: HighlightLeafStatic,\n [BaseHorizontalRulePlugin.key]: HrElementStatic,\n [BaseImagePlugin.key]: ImageElementStatic,\n [BaseItalicPlugin.key]: withProps(SlateLeaf, { as: 'em' }),\n [BaseKbdPlugin.key]: KbdLeafStatic,\n [BaseLinkPlugin.key]: LinkElementStatic,\n // [BaseMediaEmbedPlugin.key]: MediaEmbedElementStatic,\n [BaseMentionPlugin.key]: MentionElementStatic,\n [BaseParagraphPlugin.key]: ParagraphElementStatic,\n [BaseStrikethroughPlugin.key]: withProps(SlateLeaf, { as: 'del' }),\n [BaseSubscriptPlugin.key]: withProps(SlateLeaf, { as: 'sub' }),\n [BaseSuperscriptPlugin.key]: withProps(SlateLeaf, { as: 'sup' }),\n [BaseTableCellHeaderPlugin.key]: TableCellHeaderStaticElement,\n [BaseTableCellPlugin.key]: TableCellElementStatic,\n [BaseTablePlugin.key]: TableElementStatic,\n [BaseTableRowPlugin.key]: TableRowElementStatic,\n [BaseTocPlugin.key]: TocElementStatic,\n [BaseTogglePlugin.key]: ToggleElementStatic,\n [BaseUnderlinePlugin.key]: withProps(SlateLeaf, { as: 'u' }),\n [BaseVideoPlugin.key]: MediaVideoElementStatic,\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 [HEADING_KEYS.h4]: withProps(HeadingElementStatic, { variant: 'h4' }),\n [HEADING_KEYS.h5]: withProps(HeadingElementStatic, { variant: 'h5' }),\n [HEADING_KEYS.h6]: withProps(HeadingElementStatic, { variant: 'h6' }),\n };\n\n const createValue = (): Value => [\n ...basicElementsValue,\n ...basicMarksValue,\n ...tocPlaygroundValue,\n ...todoListValue,\n ...linkValue,\n ...horizontalRuleValue,\n ...tableValue,\n ...mediaValue,\n ...columnValue,\n ...mentionValue,\n ...dateValue,\n ...fontValue,\n ...highlightValue,\n ...kbdValue,\n ...commentsValue,\n ...alignValue,\n ...lineHeightValue,\n ...indentValue,\n ...indentListValue,\n ];\n\n const editor = createSlateEditor({\n plugins: [\n BaseColumnPlugin,\n BaseColumnItemPlugin,\n BaseTocPlugin,\n BaseVideoPlugin,\n BaseAudioPlugin,\n BaseParagraphPlugin,\n BaseHeadingPlugin,\n BaseMediaEmbedPlugin,\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseItalicPlugin,\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\n BaseUnderlinePlugin,\n BaseBlockquotePlugin,\n BaseDatePlugin,\n BaseCodeBlockPlugin.configure({\n options: {\n prism: Prism,\n },\n }),\n BaseIndentPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n BaseBlockquotePlugin.key,\n BaseCodeBlockPlugin.key,\n ],\n },\n }),\n BaseIndentListPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n ...HEADING_LEVELS,\n BaseBlockquotePlugin.key,\n BaseCodeBlockPlugin.key,\n BaseTogglePlugin.key,\n ],\n },\n options: {\n listStyleTypes: {\n fire: {\n liComponent: FireLiComponent,\n markerComponent: FireMarker,\n type: 'fire',\n },\n todo: {\n liComponent: TodoLiStatic,\n markerComponent: TodoMarkerStatic,\n type: 'todo',\n },\n },\n },\n }),\n BaseLinkPlugin,\n BaseTableRowPlugin,\n BaseTablePlugin,\n BaseTableCellPlugin,\n BaseHorizontalRulePlugin,\n BaseFontColorPlugin,\n BaseFontBackgroundColorPlugin,\n BaseFontSizePlugin,\n BaseKbdPlugin,\n BaseAlignPlugin.extend({\n inject: {\n targetPlugins: [\n BaseParagraphPlugin.key,\n BaseMediaEmbedPlugin.key,\n ...HEADING_LEVELS,\n BaseImagePlugin.key,\n ],\n },\n }),\n BaseLineHeightPlugin,\n BaseHighlightPlugin,\n BaseFilePlugin,\n BaseImagePlugin,\n BaseMentionPlugin,\n BaseCommentsPlugin,\n BaseTogglePlugin,\n ],\n value: createValue(),\n });\n\n // const tailwindCss = await getCachedTailwindCss();\n // const prismCss = await getCachedPrismCss();\n // const cookieStore = await cookies();\n // const theme = cookieStore.get('theme')?.value;\n const theme = 'light';\n const prismCss = '';\n const tailwindCss = '';\n\n // Get the editor content HTML using EditorStatic\n const editorHtml = await serializeHtml(editor, {\n components,\n editorComponent: EditorStatic,\n props: { style: { padding: '0 calc(50% - 350px)', paddingBottom: '' } },\n });\n\n // Create the full HTML document\n const html = createHtmlDocument({\n editorHtml,\n prismCss,\n tailwindCss,\n theme,\n });\n\n return (\n
\n
\n

Editor

\n \n
\n\n
\n

EditorStatic

\n \n
\n\n
\n
\n

HTML Iframe

\n \n
\n \n
\n
\n );\n}\n", "path": "block/slate-to-html/page.tsx", "target": "app/html/page.tsx", "type": "registry:page" diff --git a/apps/www/src/__registry__/default/block/slate-to-html/page.tsx b/apps/www/src/__registry__/default/block/slate-to-html/page.tsx index 36acdfae45..5ced973ccd 100644 --- a/apps/www/src/__registry__/default/block/slate-to-html/page.tsx +++ b/apps/www/src/__registry__/default/block/slate-to-html/page.tsx @@ -60,8 +60,6 @@ import { BaseTableRowPlugin, } from '@udecode/plate-table'; import { BaseTogglePlugin } from '@udecode/plate-toggle'; -import fs from 'node:fs/promises'; -import path from 'node:path'; import Prism from 'prismjs'; import { H3 } from '@/components/typography'; @@ -134,17 +132,17 @@ export const iframeHeight = '800px'; export const containerClassName = 'w-full h-full'; -const getCachedTailwindCss = React.cache(async () => { - const cssPath = path.join(process.cwd(), 'public', 'tailwind.css'); +// const getCachedTailwindCss = React.cache(async () => { +// const cssPath = path.join(process.cwd(), 'public', 'tailwind.css'); - return await fs.readFile(cssPath, 'utf8'); -}); +// return await fs.readFile(cssPath, 'utf8'); +// }); -const getCachedPrismCss = React.cache(async () => { - const cssPath = path.join(process.cwd(), 'public', 'prism.css'); +// const getCachedPrismCss = React.cache(async () => { +// const cssPath = path.join(process.cwd(), 'public', 'prism.css'); - return await fs.readFile(cssPath, 'utf8'); -}); +// return await fs.readFile(cssPath, 'utf8'); +// }); export default async function SlateToHtmlBlock() { const components = { @@ -298,11 +296,13 @@ export default async function SlateToHtmlBlock() { value: createValue(), }); - const tailwindCss = await getCachedTailwindCss(); - const prismCss = await getCachedPrismCss(); + // const tailwindCss = await getCachedTailwindCss(); + // const prismCss = await getCachedPrismCss(); // const cookieStore = await cookies(); // const theme = cookieStore.get('theme')?.value; const theme = 'light'; + const prismCss = ''; + const tailwindCss = ''; // Get the editor content HTML using EditorStatic const editorHtml = await serializeHtml(editor, { diff --git a/apps/www/src/__registry__/index.tsx b/apps/www/src/__registry__/index.tsx index 812464b3ca..802528d0aa 100644 --- a/apps/www/src/__registry__/index.tsx +++ b/apps/www/src/__registry__/index.tsx @@ -1470,6 +1470,10 @@ export const Index: Record = { path: "src/registry/default/plate-ui/indent-todo-marker.tsx", type: "registry:ui", target: "" + },{ + path: "src/registry/default/plate-ui/indent-todo-marker-static.tsx", + type: "registry:ui", + target: "" }], component: React.lazy(() => import("@/registry/default/plate-ui/indent-todo-marker.tsx")), source: "", diff --git a/apps/www/src/registry/default/plate-ui/ai-chat-editor.tsx b/apps/www/src/registry/default/plate-ui/ai-chat-editor.tsx index d0729695d0..1197966f6a 100644 --- a/apps/www/src/registry/default/plate-ui/ai-chat-editor.tsx +++ b/apps/www/src/registry/default/plate-ui/ai-chat-editor.tsx @@ -22,7 +22,7 @@ import { type SlateEditor, BaseParagraphPlugin, SlateLeaf, -} from '@udecode/plate-core'; +} from '@udecode/plate-common'; import { HEADING_KEYS } from '@udecode/plate-heading'; import { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule'; import { BaseLinkPlugin } from '@udecode/plate-link'; diff --git a/apps/www/src/registry/default/plate-ui/indent-fire-marker.tsx b/apps/www/src/registry/default/plate-ui/indent-fire-marker.tsx index 35dbc5c9d5..8f834fcc63 100644 --- a/apps/www/src/registry/default/plate-ui/indent-fire-marker.tsx +++ b/apps/www/src/registry/default/plate-ui/indent-fire-marker.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import type { SlateRenderElementProps } from '@udecode/plate-core'; +import type { SlateRenderElementProps } from '@udecode/plate-common'; import type { TIndentElement } from '@udecode/plate-indent'; export const FireMarker = ( diff --git a/apps/www/src/registry/registry-ui.ts b/apps/www/src/registry/registry-ui.ts index bdde8a1779..edbbbbd9b1 100644 --- a/apps/www/src/registry/registry-ui.ts +++ b/apps/www/src/registry/registry-ui.ts @@ -544,7 +544,10 @@ import { withDraggables } from './withDraggables';`, ], examples: ['list-demo'], }, - files: [{ path: 'plate-ui/indent-todo-marker.tsx', type: 'registry:ui' }], + files: [ + { path: 'plate-ui/indent-todo-marker.tsx', type: 'registry:ui' }, + { path: 'plate-ui/indent-todo-marker-static.tsx', type: 'registry:ui' }, + ], name: 'indent-todo-marker', registryDependencies: ['checkbox'], type: 'registry:ui', diff --git a/templates/plate-playground-template/src/components/editor/plugins/ai-plugins.tsx b/templates/plate-playground-template/src/components/editor/plugins/ai-plugins.tsx index 29cb89691f..b00d930ba5 100644 --- a/templates/plate-playground-template/src/components/editor/plugins/ai-plugins.tsx +++ b/templates/plate-playground-template/src/components/editor/plugins/ai-plugins.tsx @@ -2,77 +2,71 @@ import React from 'react'; -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 { BlockquotePlugin } from '@udecode/plate-block-quote/react'; + BaseBoldPlugin, + BaseCodePlugin, + BaseItalicPlugin, + BaseStrikethroughPlugin, + BaseUnderlinePlugin, +} from '@udecode/plate-basic-marks'; +import { BaseBlockquotePlugin } from '@udecode/plate-block-quote'; import { - CodeBlockPlugin, - CodeLinePlugin, - CodeSyntaxPlugin, -} from '@udecode/plate-code-block/react'; -import { - ParagraphPlugin, - PlateLeaf, - createPlateEditor, -} from '@udecode/plate-common/react'; -import { HEADING_KEYS } from '@udecode/plate-heading'; -import { HorizontalRulePlugin } from '@udecode/plate-horizontal-rule/react'; -import { LinkPlugin } from '@udecode/plate-link/react'; + BaseCodeBlockPlugin, + BaseCodeLinePlugin, + BaseCodeSyntaxPlugin, +} from '@udecode/plate-code-block'; +import { BaseParagraphPlugin, createSlateEditor } from '@udecode/plate-common'; +import { BaseHeadingPlugin, HEADING_LEVELS } from '@udecode/plate-heading'; +import { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule'; +import { BaseIndentListPlugin } from '@udecode/plate-indent-list'; +import { BaseLinkPlugin } from '@udecode/plate-link'; import { MarkdownPlugin } from '@udecode/plate-markdown'; -import { cursorOverlayPlugin } from '@/components/editor/plugins/cursor-overlay-plugin'; import { AIMenu } from '@/components/plate-ui/ai-menu'; -import { BlockquoteElement } from '@/components/plate-ui/blockquote-element'; -import { CodeBlockElement } from '@/components/plate-ui/code-block-element'; -import { CodeLeaf } from '@/components/plate-ui/code-leaf'; -import { CodeLineElement } from '@/components/plate-ui/code-line-element'; -import { CodeSyntaxLeaf } from '@/components/plate-ui/code-syntax-leaf'; -import { HeadingElement } from '@/components/plate-ui/heading-element'; -import { HrElement } from '@/components/plate-ui/hr-element'; -import { LinkElement } from '@/components/plate-ui/link-element'; -import { ParagraphElement } from '@/components/plate-ui/paragraph-element'; - -import { basicNodesPlugins } from './basic-nodes-plugins'; -import { blockSelectionReadOnlyPlugin } from './block-selection-plugins'; -import { indentListPlugins } from './indent-list-plugins'; -import { linkPlugin } from './link-plugin'; +import { + TodoLiStatic, + TodoMarkerStatic, +} from '@/components/plate-ui/indent-todo-marker-static'; +import { cursorOverlayPlugin } from './cursor-overlay-plugin'; const createAIEditor = () => { - const editor = createPlateEditor({ + const editor = createSlateEditor({ id: 'ai', - override: { - components: { - [BlockquotePlugin.key]: BlockquoteElement, - [BoldPlugin.key]: withProps(PlateLeaf, { as: 'strong' }), - [CodeBlockPlugin.key]: CodeBlockElement, - [CodeLinePlugin.key]: CodeLineElement, - [CodePlugin.key]: CodeLeaf, - [CodeSyntaxPlugin.key]: CodeSyntaxLeaf, - [HEADING_KEYS.h1]: withProps(HeadingElement, { variant: 'h1' }), - [HEADING_KEYS.h2]: withProps(HeadingElement, { variant: 'h2' }), - [HEADING_KEYS.h3]: withProps(HeadingElement, { variant: 'h3' }), - [HorizontalRulePlugin.key]: HrElement, - [ItalicPlugin.key]: withProps(PlateLeaf, { as: 'em' }), - [LinkPlugin.key]: LinkElement, - [ParagraphPlugin.key]: ParagraphElement, - [StrikethroughPlugin.key]: withProps(PlateLeaf, { as: 's' }), - [UnderlinePlugin.key]: withProps(PlateLeaf, { as: 'u' }), - }, - }, plugins: [ - ...basicNodesPlugins, - ...indentListPlugins, - HorizontalRulePlugin, - linkPlugin, + BaseBlockquotePlugin, + BaseBoldPlugin, + BaseCodeBlockPlugin, + BaseCodeLinePlugin, + BaseCodePlugin, + BaseCodeSyntaxPlugin, + BaseItalicPlugin, + BaseStrikethroughPlugin, + BaseUnderlinePlugin, + BaseHeadingPlugin, + BaseHorizontalRulePlugin, + BaseLinkPlugin, + BaseParagraphPlugin, + BaseIndentListPlugin.extend({ + inject: { + targetPlugins: [ + BaseParagraphPlugin.key, + ...HEADING_LEVELS, + BaseBlockquotePlugin.key, + BaseCodeBlockPlugin.key, + ], + }, + options: { + listStyleTypes: { + todo: { + liComponent: TodoLiStatic, + markerComponent: TodoMarkerStatic, + type: 'todo', + }, + }, + }, + }), MarkdownPlugin.configure({ options: { indentList: true } }), - blockSelectionReadOnlyPlugin, ], }); diff --git a/templates/plate-playground-template/src/components/plate-ui/ai-chat-editor.tsx b/templates/plate-playground-template/src/components/plate-ui/ai-chat-editor.tsx index a34755a07d..1197966f6a 100644 --- a/templates/plate-playground-template/src/components/plate-ui/ai-chat-editor.tsx +++ b/templates/plate-playground-template/src/components/plate-ui/ai-chat-editor.tsx @@ -2,21 +2,66 @@ import React, { memo } from 'react'; +import { withProps } from '@udecode/cn'; import { AIChatPlugin, useLastAssistantMessage } from '@udecode/plate-ai/react'; import { - type PlateEditor, - Plate, - useEditorPlugin, -} from '@udecode/plate-common/react'; + BaseBoldPlugin, + BaseCodePlugin, + BaseItalicPlugin, + BaseStrikethroughPlugin, + BaseUnderlinePlugin, +} from '@udecode/plate-basic-marks'; +import { BaseBlockquotePlugin } from '@udecode/plate-block-quote'; +import { + BaseCodeBlockPlugin, + BaseCodeLinePlugin, + BaseCodeSyntaxPlugin, +} from '@udecode/plate-code-block'; +import { useEditorPlugin } from '@udecode/plate-common/react'; +import { + type SlateEditor, + BaseParagraphPlugin, + SlateLeaf, +} from '@udecode/plate-common'; +import { HEADING_KEYS } from '@udecode/plate-heading'; +import { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule'; +import { BaseLinkPlugin } from '@udecode/plate-link'; import { deserializeMd } from '@udecode/plate-markdown'; -import { Editor } from './editor'; +import { BlockquoteElementStatic } from './blockquote-element-static'; +import { CodeBlockElementStatic } from './code-block-element-static'; +import { CodeLeafStatic } from './code-leaf-static'; +import { CodeLineElementStatic } from './code-line-element-static'; +import { CodeSyntaxLeafStatic } from './code-syntax-leaf-static'; +import { EditorStatic } from './editor-static'; +import { HeadingElementStatic } from './heading-element-static'; +import { HrElementStatic } from './hr-element-static'; +import { LinkElementStatic } from './link-element-static'; +import { ParagraphElementStatic } from './paragraph-element-static'; + +const staticComponents = { + [BaseBlockquotePlugin.key]: BlockquoteElementStatic, + [BaseBoldPlugin.key]: withProps(SlateLeaf, { as: 'strong' }), + [BaseCodeBlockPlugin.key]: CodeBlockElementStatic, + [BaseCodeLinePlugin.key]: CodeLineElementStatic, + [BaseCodePlugin.key]: CodeLeafStatic, + [BaseCodeSyntaxPlugin.key]: CodeSyntaxLeafStatic, + [BaseHorizontalRulePlugin.key]: HrElementStatic, + [BaseItalicPlugin.key]: withProps(SlateLeaf, { as: 'em' }), + [BaseLinkPlugin.key]: LinkElementStatic, + [BaseParagraphPlugin.key]: ParagraphElementStatic, + [BaseStrikethroughPlugin.key]: withProps(SlateLeaf, { as: 's' }), + [BaseUnderlinePlugin.key]: withProps(SlateLeaf, { as: 'u' }), + [HEADING_KEYS.h1]: withProps(HeadingElementStatic, { variant: 'h1' }), + [HEADING_KEYS.h2]: withProps(HeadingElementStatic, { variant: 'h2' }), + [HEADING_KEYS.h3]: withProps(HeadingElementStatic, { variant: 'h3' }), +}; export const AIChatEditor = memo( ({ aiEditorRef, }: { - aiEditorRef: React.MutableRefObject; + aiEditorRef: React.MutableRefObject; }) => { const { getOptions } = useEditorPlugin(AIChatPlugin); const lastAssistantMessage = useLastAssistantMessage(); @@ -46,9 +91,11 @@ export const AIChatEditor = memo( if (!content) return null; return ( - - - + ); } ); diff --git a/templates/plate-playground-template/src/components/plate-ui/ai-menu-items.tsx b/templates/plate-playground-template/src/components/plate-ui/ai-menu-items.tsx index a00f8f54d6..e483b10a4e 100644 --- a/templates/plate-playground-template/src/components/plate-ui/ai-menu-items.tsx +++ b/templates/plate-playground-template/src/components/plate-ui/ai-menu-items.tsx @@ -4,6 +4,7 @@ import { useEffect, useMemo } from 'react'; import { AIChatPlugin, AIPlugin } from '@udecode/plate-ai/react'; import { + type SlateEditor, getAncestorNode, getEndPoint, getNodeString, @@ -193,7 +194,7 @@ Start writing a new paragraph AFTER ONLY ONE SENTENCE` aiEditor, editor, }: { - aiEditor: PlateEditor; + aiEditor: SlateEditor; editor: PlateEditor; }) => void; } @@ -247,7 +248,7 @@ export const AIMenuItems = ({ aiEditorRef, setValue, }: { - aiEditorRef: React.MutableRefObject; + aiEditorRef: React.MutableRefObject; setValue: (value: string) => void; }) => { const { editor, useOption } = useEditorPlugin(AIChatPlugin); diff --git a/templates/plate-playground-template/src/components/plate-ui/ai-menu.tsx b/templates/plate-playground-template/src/components/plate-ui/ai-menu.tsx index 7afbe5948e..07c322d64e 100644 --- a/templates/plate-playground-template/src/components/plate-ui/ai-menu.tsx +++ b/templates/plate-playground-template/src/components/plate-ui/ai-menu.tsx @@ -4,6 +4,7 @@ import * as React from 'react'; import { AIChatPlugin, useEditorChat } from '@udecode/plate-ai/react'; import { + type SlateEditor, type TElement, type TNodeEntry, getAncestorNode, @@ -13,7 +14,6 @@ import { isSelectionAtBlockEnd, } from '@udecode/plate-common'; import { - type PlateEditor, toDOMNode, useEditorPlugin, useHotkeys, @@ -37,7 +37,7 @@ export function AIMenu() { const mode = useOption('mode'); const isSelecting = useIsSelecting(); - const aiEditorRef = React.useRef(null); + const aiEditorRef = React.useRef(null); const [value, setValue] = React.useState(''); const chat = useChat(); diff --git a/templates/plate-playground-template/src/components/plate-ui/editor-static.tsx b/templates/plate-playground-template/src/components/plate-ui/editor-static.tsx index f383031c41..d6e1276419 100644 --- a/templates/plate-playground-template/src/components/plate-ui/editor-static.tsx +++ b/templates/plate-playground-template/src/components/plate-ui/editor-static.tsx @@ -28,7 +28,7 @@ export const editorVariants = cva( variant: { ai: 'w-full px-0 text-base md:text-sm', aiChat: - 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm', + 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-10 py-2 text-base md:text-sm', default: 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]', demo: 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]', diff --git a/templates/plate-playground-template/src/components/plate-ui/indent-fire-marker.tsx b/templates/plate-playground-template/src/components/plate-ui/indent-fire-marker.tsx index 35dbc5c9d5..8f834fcc63 100644 --- a/templates/plate-playground-template/src/components/plate-ui/indent-fire-marker.tsx +++ b/templates/plate-playground-template/src/components/plate-ui/indent-fire-marker.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import type { SlateRenderElementProps } from '@udecode/plate-core'; +import type { SlateRenderElementProps } from '@udecode/plate-common'; import type { TIndentElement } from '@udecode/plate-indent'; export const FireMarker = ( diff --git a/templates/plate-playground-template/src/components/plate-ui/indent-todo-marker-static.tsx b/templates/plate-playground-template/src/components/plate-ui/indent-todo-marker-static.tsx new file mode 100644 index 0000000000..4bc0071ed7 --- /dev/null +++ b/templates/plate-playground-template/src/components/plate-ui/indent-todo-marker-static.tsx @@ -0,0 +1,35 @@ +import React from 'react'; + +import type { SlateRenderElementProps } from '@udecode/plate-common'; + +import { cn } from '@udecode/cn'; + +import { CheckboxStatic } from './checkbox-static'; + +export const TodoMarkerStatic = ({ + element, +}: Omit) => { + return ( +
+ +
+ ); +}; + +export const TodoLiStatic = ({ + children, + element, +}: SlateRenderElementProps) => { + return ( + + {children} + + ); +}; diff --git a/yarn.lock b/yarn.lock index 9c97c6b1e9..ef44f0ea08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6399,13 +6399,13 @@ __metadata: version: 0.0.0-use.local resolution: "@udecode/plate-ai@workspace:packages/ai" dependencies: - "@udecode/plate-combobox": "npm:40.0.0" - "@udecode/plate-markdown": "npm:40.2.2" - "@udecode/plate-selection": "npm:40.2.9" + "@udecode/plate-combobox": "npm:41.0.0" + "@udecode/plate-markdown": "npm:41.0.0" + "@udecode/plate-selection": "npm:41.0.0" ai: "npm:^3.4.10" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.0.0" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6416,13 +6416,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-alignment@npm:40.0.0, @udecode/plate-alignment@workspace:^, @udecode/plate-alignment@workspace:packages/alignment": +"@udecode/plate-alignment@npm:41.0.0, @udecode/plate-alignment@workspace:^, @udecode/plate-alignment@workspace:packages/alignment": version: 0.0.0-use.local resolution: "@udecode/plate-alignment@workspace:packages/alignment" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6433,14 +6433,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-autoformat@npm:40.0.0, @udecode/plate-autoformat@workspace:^, @udecode/plate-autoformat@workspace:packages/autoformat": +"@udecode/plate-autoformat@npm:41.0.0, @udecode/plate-autoformat@workspace:^, @udecode/plate-autoformat@workspace:packages/autoformat": version: 0.0.0-use.local resolution: "@udecode/plate-autoformat@workspace:packages/autoformat" dependencies: "@udecode/plate-common": "workspace:^" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6451,16 +6451,16 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-basic-elements@npm:40.3.4, @udecode/plate-basic-elements@workspace:^, @udecode/plate-basic-elements@workspace:packages/basic-elements": +"@udecode/plate-basic-elements@npm:41.0.0, @udecode/plate-basic-elements@workspace:^, @udecode/plate-basic-elements@workspace:packages/basic-elements": version: 0.0.0-use.local resolution: "@udecode/plate-basic-elements@workspace:packages/basic-elements" dependencies: - "@udecode/plate-block-quote": "npm:40.0.0" - "@udecode/plate-code-block": "npm:40.3.4" + "@udecode/plate-block-quote": "npm:41.0.0" + "@udecode/plate-code-block": "npm:41.0.0" "@udecode/plate-common": "workspace:^" - "@udecode/plate-heading": "npm:40.2.6" + "@udecode/plate-heading": "npm:41.0.0" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6471,13 +6471,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-basic-marks@npm:40.0.0, @udecode/plate-basic-marks@workspace:^, @udecode/plate-basic-marks@workspace:packages/basic-marks": +"@udecode/plate-basic-marks@npm:41.0.0, @udecode/plate-basic-marks@workspace:^, @udecode/plate-basic-marks@workspace:packages/basic-marks": version: 0.0.0-use.local resolution: "@udecode/plate-basic-marks@workspace:packages/basic-marks" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6488,13 +6488,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-block-quote@npm:40.0.0, @udecode/plate-block-quote@workspace:^, @udecode/plate-block-quote@workspace:packages/block-quote": +"@udecode/plate-block-quote@npm:41.0.0, @udecode/plate-block-quote@workspace:^, @udecode/plate-block-quote@workspace:packages/block-quote": version: 0.0.0-use.local resolution: "@udecode/plate-block-quote@workspace:packages/block-quote" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6505,13 +6505,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-break@npm:40.0.0, @udecode/plate-break@workspace:^, @udecode/plate-break@workspace:packages/break": +"@udecode/plate-break@npm:41.0.0, @udecode/plate-break@workspace:^, @udecode/plate-break@workspace:packages/break": version: 0.0.0-use.local resolution: "@udecode/plate-break@workspace:packages/break" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6528,7 +6528,7 @@ __metadata: dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6546,7 +6546,7 @@ __metadata: "@udecode/plate-common": "workspace:^" react-textarea-autosize: "npm:^8.5.3" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6566,7 +6566,7 @@ __metadata: delay: "npm:5.0.0" p-defer: "npm:^4.0.1" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6577,14 +6577,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-code-block@npm:40.3.4, @udecode/plate-code-block@workspace:^, @udecode/plate-code-block@workspace:packages/code-block": +"@udecode/plate-code-block@npm:41.0.0, @udecode/plate-code-block@workspace:^, @udecode/plate-code-block@workspace:packages/code-block": version: 0.0.0-use.local resolution: "@udecode/plate-code-block@workspace:packages/code-block" dependencies: "@udecode/plate-common": "workspace:^" prismjs: "npm:^1.29.0" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6595,13 +6595,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-combobox@npm:40.0.0, @udecode/plate-combobox@workspace:^, @udecode/plate-combobox@workspace:packages/combobox": +"@udecode/plate-combobox@npm:41.0.0, @udecode/plate-combobox@workspace:^, @udecode/plate-combobox@workspace:packages/combobox": version: 0.0.0-use.local resolution: "@udecode/plate-combobox@workspace:packages/combobox" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6612,14 +6612,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-comments@npm:40.3.0, @udecode/plate-comments@workspace:^, @udecode/plate-comments@workspace:packages/comments": +"@udecode/plate-comments@npm:41.0.0, @udecode/plate-comments@workspace:^, @udecode/plate-comments@workspace:packages/comments": version: 0.0.0-use.local resolution: "@udecode/plate-comments@workspace:packages/comments" dependencies: "@udecode/plate-common": "workspace:^" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6630,17 +6630,17 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-common@npm:40.3.1, @udecode/plate-common@workspace:^, @udecode/plate-common@workspace:packages/common": +"@udecode/plate-common@npm:41.0.0, @udecode/plate-common@workspace:^, @udecode/plate-common@workspace:packages/common": version: 0.0.0-use.local resolution: "@udecode/plate-common@workspace:packages/common" dependencies: - "@udecode/plate-core": "npm:40.3.1" - "@udecode/plate-utils": "npm:40.3.1" + "@udecode/plate-core": "npm:41.0.0" + "@udecode/plate-utils": "npm:41.0.0" "@udecode/react-hotkeys": "npm:37.0.0" "@udecode/react-utils": "npm:40.2.8" - "@udecode/slate": "npm:40.3.1" - "@udecode/slate-react": "npm:40.3.1" - "@udecode/slate-utils": "npm:40.3.1" + "@udecode/slate": "npm:41.0.0" + "@udecode/slate-react": "npm:41.0.0" + "@udecode/slate-utils": "npm:41.0.0" "@udecode/utils": "npm:37.0.0" peerDependencies: react: ">=16.8.0" @@ -6653,15 +6653,15 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-core@npm:40.3.1, @udecode/plate-core@workspace:^, @udecode/plate-core@workspace:packages/core": +"@udecode/plate-core@npm:41.0.0, @udecode/plate-core@workspace:^, @udecode/plate-core@workspace:packages/core": version: 0.0.0-use.local resolution: "@udecode/plate-core@workspace:packages/core" dependencies: "@udecode/react-hotkeys": "npm:37.0.0" "@udecode/react-utils": "npm:40.2.8" - "@udecode/slate": "npm:40.3.1" - "@udecode/slate-react": "npm:40.3.1" - "@udecode/slate-utils": "npm:40.3.1" + "@udecode/slate": "npm:41.0.0" + "@udecode/slate-react": "npm:41.0.0" + "@udecode/slate-utils": "npm:41.0.0" "@udecode/utils": "npm:37.0.0" clsx: "npm:^2.1.1" html-entities: "npm:^2.5.2" @@ -6686,16 +6686,16 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-csv@npm:40.0.0, @udecode/plate-csv@workspace:^, @udecode/plate-csv@workspace:packages/csv": +"@udecode/plate-csv@npm:41.0.0, @udecode/plate-csv@workspace:^, @udecode/plate-csv@workspace:packages/csv": version: 0.0.0-use.local resolution: "@udecode/plate-csv@workspace:packages/csv" dependencies: "@types/papaparse": "npm:^5.3.14" "@udecode/plate-common": "workspace:^" - "@udecode/plate-table": "npm:40.0.0" + "@udecode/plate-table": "npm:41.0.0" papaparse: "npm:^5.4.1" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6712,7 +6712,7 @@ __metadata: dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6729,7 +6729,7 @@ __metadata: dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.94.0" @@ -6739,7 +6739,7 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-diff@npm:40.0.0, @udecode/plate-diff@workspace:^, @udecode/plate-diff@workspace:packages/diff": +"@udecode/plate-diff@npm:41.0.0, @udecode/plate-diff@workspace:^, @udecode/plate-diff@workspace:packages/diff": version: 0.0.0-use.local resolution: "@udecode/plate-diff@workspace:packages/diff" dependencies: @@ -6747,7 +6747,7 @@ __metadata: diff-match-patch-ts: "npm:^0.6.0" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6766,7 +6766,7 @@ __metadata: lodash: "npm:^4.17.21" raf: "npm:^3.4.1" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dnd: ">=14.0.0" react-dnd-html5-backend: ">=14.0.0" @@ -6779,19 +6779,19 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-docx@npm:40.2.7, @udecode/plate-docx@workspace:^, @udecode/plate-docx@workspace:packages/docx": +"@udecode/plate-docx@npm:41.0.0, @udecode/plate-docx@workspace:^, @udecode/plate-docx@workspace:packages/docx": version: 0.0.0-use.local resolution: "@udecode/plate-docx@workspace:packages/docx" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-heading": "npm:40.2.6" - "@udecode/plate-indent": "npm:40.0.0" - "@udecode/plate-indent-list": "npm:40.0.0" - "@udecode/plate-media": "npm:40.2.7" - "@udecode/plate-table": "npm:40.0.0" + "@udecode/plate-heading": "npm:41.0.0" + "@udecode/plate-indent": "npm:41.0.0" + "@udecode/plate-indent-list": "npm:41.0.0" + "@udecode/plate-media": "npm:41.0.0" + "@udecode/plate-table": "npm:41.0.0" validator: "npm:^13.12.0" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6807,10 +6807,10 @@ __metadata: resolution: "@udecode/plate-emoji@workspace:packages/emoji" dependencies: "@emoji-mart/data": "npm:^1.2.1" - "@udecode/plate-combobox": "npm:40.0.0" + "@udecode/plate-combobox": "npm:41.0.0" "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6828,7 +6828,7 @@ __metadata: "@excalidraw/excalidraw": "npm:0.16.4" "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6839,13 +6839,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-find-replace@npm:40.2.8, @udecode/plate-find-replace@workspace:^, @udecode/plate-find-replace@workspace:packages/find-replace": +"@udecode/plate-find-replace@npm:41.0.0, @udecode/plate-find-replace@workspace:^, @udecode/plate-find-replace@workspace:packages/find-replace": version: 0.0.0-use.local resolution: "@udecode/plate-find-replace@workspace:packages/find-replace" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6856,7 +6856,7 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-floating@npm:40.0.0, @udecode/plate-floating@workspace:^, @udecode/plate-floating@workspace:packages/floating": +"@udecode/plate-floating@npm:41.0.0, @udecode/plate-floating@workspace:^, @udecode/plate-floating@workspace:packages/floating": version: 0.0.0-use.local resolution: "@udecode/plate-floating@workspace:packages/floating" dependencies: @@ -6864,7 +6864,7 @@ __metadata: "@floating-ui/react": "npm:^0.26.23" "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6875,14 +6875,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-font@npm:40.0.0, @udecode/plate-font@workspace:^, @udecode/plate-font@workspace:packages/font": +"@udecode/plate-font@npm:41.0.0, @udecode/plate-font@workspace:^, @udecode/plate-font@workspace:packages/font": version: 0.0.0-use.local resolution: "@udecode/plate-font@workspace:packages/font" dependencies: "@udecode/plate-common": "workspace:^" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6893,13 +6893,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-heading@npm:40.2.6, @udecode/plate-heading@workspace:^, @udecode/plate-heading@workspace:packages/heading": +"@udecode/plate-heading@npm:41.0.0, @udecode/plate-heading@workspace:^, @udecode/plate-heading@workspace:packages/heading": version: 0.0.0-use.local resolution: "@udecode/plate-heading@workspace:packages/heading" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6910,13 +6910,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-highlight@npm:40.0.0, @udecode/plate-highlight@workspace:^, @udecode/plate-highlight@workspace:packages/highlight": +"@udecode/plate-highlight@npm:41.0.0, @udecode/plate-highlight@workspace:^, @udecode/plate-highlight@workspace:packages/highlight": version: 0.0.0-use.local resolution: "@udecode/plate-highlight@workspace:packages/highlight" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6927,13 +6927,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-horizontal-rule@npm:40.0.0, @udecode/plate-horizontal-rule@workspace:^, @udecode/plate-horizontal-rule@workspace:packages/horizontal-rule": +"@udecode/plate-horizontal-rule@npm:41.0.0, @udecode/plate-horizontal-rule@workspace:^, @udecode/plate-horizontal-rule@workspace:packages/horizontal-rule": version: 0.0.0-use.local resolution: "@udecode/plate-horizontal-rule@workspace:packages/horizontal-rule" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6944,16 +6944,16 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-indent-list@npm:40.0.0, @udecode/plate-indent-list@workspace:^, @udecode/plate-indent-list@workspace:packages/indent-list": +"@udecode/plate-indent-list@npm:41.0.0, @udecode/plate-indent-list@workspace:^, @udecode/plate-indent-list@workspace:packages/indent-list": version: 0.0.0-use.local resolution: "@udecode/plate-indent-list@workspace:packages/indent-list" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-indent": "npm:40.0.0" - "@udecode/plate-list": "npm:40.0.0" + "@udecode/plate-indent": "npm:41.0.0" + "@udecode/plate-list": "npm:41.0.0" clsx: "npm:^2.1.1" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6964,13 +6964,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-indent@npm:40.0.0, @udecode/plate-indent@workspace:^, @udecode/plate-indent@workspace:packages/indent": +"@udecode/plate-indent@npm:41.0.0, @udecode/plate-indent@workspace:^, @udecode/plate-indent@workspace:packages/indent": version: 0.0.0-use.local resolution: "@udecode/plate-indent@workspace:packages/indent" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6988,7 +6988,7 @@ __metadata: "@udecode/plate-common": "workspace:^" juice: "npm:^8.1.0" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -6999,13 +6999,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-kbd@npm:40.0.0, @udecode/plate-kbd@workspace:^, @udecode/plate-kbd@workspace:packages/kbd": +"@udecode/plate-kbd@npm:41.0.0, @udecode/plate-kbd@workspace:^, @udecode/plate-kbd@workspace:packages/kbd": version: 0.0.0-use.local resolution: "@udecode/plate-kbd@workspace:packages/kbd" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7016,13 +7016,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-layout@npm:40.0.0, @udecode/plate-layout@workspace:^, @udecode/plate-layout@workspace:packages/layout": +"@udecode/plate-layout@npm:41.0.0, @udecode/plate-layout@workspace:^, @udecode/plate-layout@workspace:packages/layout": version: 0.0.0-use.local resolution: "@udecode/plate-layout@workspace:packages/layout" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7033,13 +7033,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-line-height@npm:40.0.0, @udecode/plate-line-height@workspace:^, @udecode/plate-line-height@workspace:packages/line-height": +"@udecode/plate-line-height@npm:41.0.0, @udecode/plate-line-height@workspace:^, @udecode/plate-line-height@workspace:packages/line-height": version: 0.0.0-use.local resolution: "@udecode/plate-line-height@workspace:packages/line-height" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7050,15 +7050,15 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-link@npm:40.0.0, @udecode/plate-link@workspace:^, @udecode/plate-link@workspace:packages/link": +"@udecode/plate-link@npm:41.0.0, @udecode/plate-link@workspace:^, @udecode/plate-link@workspace:packages/link": version: 0.0.0-use.local resolution: "@udecode/plate-link@workspace:packages/link" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-floating": "npm:40.0.0" - "@udecode/plate-normalizers": "npm:40.0.0" + "@udecode/plate-floating": "npm:41.0.0" + "@udecode/plate-normalizers": "npm:41.0.0" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7069,15 +7069,15 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-list@npm:40.0.0, @udecode/plate-list@workspace:^, @udecode/plate-list@workspace:packages/list": +"@udecode/plate-list@npm:41.0.0, @udecode/plate-list@workspace:^, @udecode/plate-list@workspace:packages/list": version: 0.0.0-use.local resolution: "@udecode/plate-list@workspace:packages/list" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-reset-node": "npm:40.0.0" + "@udecode/plate-reset-node": "npm:41.0.0" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7088,7 +7088,7 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-markdown@npm:40.2.2, @udecode/plate-markdown@workspace:^, @udecode/plate-markdown@workspace:packages/markdown": +"@udecode/plate-markdown@npm:41.0.0, @udecode/plate-markdown@workspace:^, @udecode/plate-markdown@workspace:packages/markdown": version: 0.0.0-use.local resolution: "@udecode/plate-markdown@workspace:packages/markdown" dependencies: @@ -7098,7 +7098,7 @@ __metadata: remark-parse: "npm:^11.0.0" unified: "npm:^11.0.5" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7117,7 +7117,7 @@ __metadata: "@udecode/plate-common": "workspace:^" katex: "npm:0.16.11" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7128,14 +7128,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-media@npm:40.2.7, @udecode/plate-media@workspace:^, @udecode/plate-media@workspace:packages/media": +"@udecode/plate-media@npm:41.0.0, @udecode/plate-media@workspace:^, @udecode/plate-media@workspace:packages/media": version: 0.0.0-use.local resolution: "@udecode/plate-media@workspace:packages/media" dependencies: "@udecode/plate-common": "workspace:^" js-video-url-parser: "npm:^0.5.1" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7146,14 +7146,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-mention@npm:40.0.0, @udecode/plate-mention@workspace:^, @udecode/plate-mention@workspace:packages/mention": +"@udecode/plate-mention@npm:41.0.0, @udecode/plate-mention@workspace:^, @udecode/plate-mention@workspace:packages/mention": version: 0.0.0-use.local resolution: "@udecode/plate-mention@workspace:packages/mention" dependencies: - "@udecode/plate-combobox": "npm:40.0.0" + "@udecode/plate-combobox": "npm:41.0.0" "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7164,14 +7164,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-node-id@npm:40.0.0, @udecode/plate-node-id@workspace:^, @udecode/plate-node-id@workspace:packages/node-id": +"@udecode/plate-node-id@npm:41.0.0, @udecode/plate-node-id@workspace:^, @udecode/plate-node-id@workspace:packages/node-id": version: 0.0.0-use.local resolution: "@udecode/plate-node-id@workspace:packages/node-id" dependencies: "@udecode/plate-common": "workspace:^" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7182,14 +7182,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-normalizers@npm:40.0.0, @udecode/plate-normalizers@workspace:^, @udecode/plate-normalizers@workspace:packages/normalizers": +"@udecode/plate-normalizers@npm:41.0.0, @udecode/plate-normalizers@workspace:^, @udecode/plate-normalizers@workspace:packages/normalizers": version: 0.0.0-use.local resolution: "@udecode/plate-normalizers@workspace:packages/normalizers" dependencies: "@udecode/plate-common": "workspace:^" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7207,7 +7207,7 @@ __metadata: "@udecode/plate-common": "workspace:^" peerDependencies: "@playwright/test": ">=1.42.1" - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7218,13 +7218,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-reset-node@npm:40.0.0, @udecode/plate-reset-node@workspace:^, @udecode/plate-reset-node@workspace:packages/reset-node": +"@udecode/plate-reset-node@npm:41.0.0, @udecode/plate-reset-node@workspace:^, @udecode/plate-reset-node@workspace:packages/reset-node": version: 0.0.0-use.local resolution: "@udecode/plate-reset-node@workspace:packages/reset-node" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7235,13 +7235,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-resizable@npm:40.0.0, @udecode/plate-resizable@workspace:^, @udecode/plate-resizable@workspace:packages/resizable": +"@udecode/plate-resizable@npm:41.0.0, @udecode/plate-resizable@workspace:^, @udecode/plate-resizable@workspace:packages/resizable": version: 0.0.0-use.local resolution: "@udecode/plate-resizable@workspace:packages/resizable" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7252,13 +7252,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-select@npm:40.0.0, @udecode/plate-select@workspace:^, @udecode/plate-select@workspace:packages/select": +"@udecode/plate-select@npm:41.0.0, @udecode/plate-select@workspace:^, @udecode/plate-select@workspace:packages/select": version: 0.0.0-use.local resolution: "@udecode/plate-select@workspace:packages/select" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7269,14 +7269,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-selection@npm:40.2.9, @udecode/plate-selection@workspace:^, @udecode/plate-selection@workspace:packages/selection": +"@udecode/plate-selection@npm:41.0.0, @udecode/plate-selection@workspace:^, @udecode/plate-selection@workspace:packages/selection": version: 0.0.0-use.local resolution: "@udecode/plate-selection@workspace:packages/selection" dependencies: "@udecode/plate-common": "workspace:^" copy-to-clipboard: "npm:^3.3.3" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7287,14 +7287,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-slash-command@npm:40.0.0, @udecode/plate-slash-command@workspace:^, @udecode/plate-slash-command@workspace:packages/slash-command": +"@udecode/plate-slash-command@npm:41.0.0, @udecode/plate-slash-command@workspace:^, @udecode/plate-slash-command@workspace:packages/slash-command": version: 0.0.0-use.local resolution: "@udecode/plate-slash-command@workspace:packages/slash-command" dependencies: - "@udecode/plate-combobox": "npm:40.0.0" + "@udecode/plate-combobox": "npm:41.0.0" "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7305,15 +7305,15 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-suggestion@npm:40.2.8, @udecode/plate-suggestion@workspace:^, @udecode/plate-suggestion@workspace:packages/suggestion": +"@udecode/plate-suggestion@npm:41.0.0, @udecode/plate-suggestion@workspace:^, @udecode/plate-suggestion@workspace:packages/suggestion": version: 0.0.0-use.local resolution: "@udecode/plate-suggestion@workspace:packages/suggestion" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-diff": "npm:40.0.0" + "@udecode/plate-diff": "npm:41.0.0" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7324,14 +7324,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-tabbable@npm:40.0.0, @udecode/plate-tabbable@workspace:^, @udecode/plate-tabbable@workspace:packages/tabbable": +"@udecode/plate-tabbable@npm:41.0.0, @udecode/plate-tabbable@workspace:^, @udecode/plate-tabbable@workspace:packages/tabbable": version: 0.0.0-use.local resolution: "@udecode/plate-tabbable@workspace:packages/tabbable" dependencies: "@udecode/plate-common": "workspace:^" tabbable: "npm:^6.2.0" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7342,15 +7342,15 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-table@npm:40.0.0, @udecode/plate-table@workspace:^, @udecode/plate-table@workspace:packages/table": +"@udecode/plate-table@npm:41.0.0, @udecode/plate-table@workspace:^, @udecode/plate-table@workspace:packages/table": version: 0.0.0-use.local resolution: "@udecode/plate-table@workspace:packages/table" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-resizable": "npm:40.0.0" + "@udecode/plate-resizable": "npm:41.0.0" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7366,7 +7366,7 @@ __metadata: dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7386,16 +7386,16 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-toggle@npm:40.0.0, @udecode/plate-toggle@workspace:^, @udecode/plate-toggle@workspace:packages/toggle": +"@udecode/plate-toggle@npm:41.0.0, @udecode/plate-toggle@workspace:^, @udecode/plate-toggle@workspace:packages/toggle": version: 0.0.0-use.local resolution: "@udecode/plate-toggle@workspace:packages/toggle" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-indent": "npm:40.0.0" - "@udecode/plate-node-id": "npm:40.0.0" + "@udecode/plate-indent": "npm:41.0.0" + "@udecode/plate-node-id": "npm:41.0.0" lodash: "npm:^4.17.21" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7406,13 +7406,13 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-trailing-block@npm:40.0.0, @udecode/plate-trailing-block@workspace:^, @udecode/plate-trailing-block@workspace:packages/trailing-block": +"@udecode/plate-trailing-block@npm:41.0.0, @udecode/plate-trailing-block@workspace:^, @udecode/plate-trailing-block@workspace:packages/trailing-block": version: 0.0.0-use.local resolution: "@udecode/plate-trailing-block@workspace:packages/trailing-block" dependencies: "@udecode/plate-common": "workspace:^" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7423,15 +7423,15 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-utils@npm:40.3.1, @udecode/plate-utils@workspace:^, @udecode/plate-utils@workspace:packages/plate-utils": +"@udecode/plate-utils@npm:41.0.0, @udecode/plate-utils@workspace:^, @udecode/plate-utils@workspace:packages/plate-utils": version: 0.0.0-use.local resolution: "@udecode/plate-utils@workspace:packages/plate-utils" dependencies: - "@udecode/plate-core": "npm:40.3.1" + "@udecode/plate-core": "npm:41.0.0" "@udecode/react-utils": "npm:40.2.8" - "@udecode/slate": "npm:40.3.1" - "@udecode/slate-react": "npm:40.3.1" - "@udecode/slate-utils": "npm:40.3.1" + "@udecode/slate": "npm:41.0.0" + "@udecode/slate-react": "npm:41.0.0" + "@udecode/slate-utils": "npm:41.0.0" "@udecode/utils": "npm:37.0.0" clsx: "npm:^2.1.1" lodash: "npm:^4.17.21" @@ -7454,7 +7454,7 @@ __metadata: "@udecode/plate-common": "workspace:^" yjs: "npm:^13.6.19" peerDependencies: - "@udecode/plate-common": ">=40.3.1" + "@udecode/plate-common": ">=41.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.112.0" @@ -7469,47 +7469,47 @@ __metadata: version: 0.0.0-use.local resolution: "@udecode/plate@workspace:packages/plate" dependencies: - "@udecode/plate-alignment": "npm:40.0.0" - "@udecode/plate-autoformat": "npm:40.0.0" - "@udecode/plate-basic-elements": "npm:40.3.4" - "@udecode/plate-basic-marks": "npm:40.0.0" - "@udecode/plate-block-quote": "npm:40.0.0" - "@udecode/plate-break": "npm:40.0.0" - "@udecode/plate-code-block": "npm:40.3.4" - "@udecode/plate-combobox": "npm:40.0.0" - "@udecode/plate-comments": "npm:40.3.0" - "@udecode/plate-common": "npm:40.3.1" - "@udecode/plate-csv": "npm:40.0.0" - "@udecode/plate-diff": "npm:40.0.0" - "@udecode/plate-docx": "npm:40.2.7" - "@udecode/plate-find-replace": "npm:40.2.8" - "@udecode/plate-floating": "npm:40.0.0" - "@udecode/plate-font": "npm:40.0.0" - "@udecode/plate-heading": "npm:40.2.6" - "@udecode/plate-highlight": "npm:40.0.0" - "@udecode/plate-horizontal-rule": "npm:40.0.0" - "@udecode/plate-indent": "npm:40.0.0" - "@udecode/plate-indent-list": "npm:40.0.0" - "@udecode/plate-kbd": "npm:40.0.0" - "@udecode/plate-layout": "npm:40.0.0" - "@udecode/plate-line-height": "npm:40.0.0" - "@udecode/plate-link": "npm:40.0.0" - "@udecode/plate-list": "npm:40.0.0" - "@udecode/plate-markdown": "npm:40.2.2" - "@udecode/plate-media": "npm:40.2.7" - "@udecode/plate-mention": "npm:40.0.0" - "@udecode/plate-node-id": "npm:40.0.0" - "@udecode/plate-normalizers": "npm:40.0.0" - "@udecode/plate-reset-node": "npm:40.0.0" - "@udecode/plate-resizable": "npm:40.0.0" - "@udecode/plate-select": "npm:40.0.0" - "@udecode/plate-selection": "npm:40.2.9" - "@udecode/plate-slash-command": "npm:40.0.0" - "@udecode/plate-suggestion": "npm:40.2.8" - "@udecode/plate-tabbable": "npm:40.0.0" - "@udecode/plate-table": "npm:40.0.0" - "@udecode/plate-toggle": "npm:40.0.0" - "@udecode/plate-trailing-block": "npm:40.0.0" + "@udecode/plate-alignment": "npm:41.0.0" + "@udecode/plate-autoformat": "npm:41.0.0" + "@udecode/plate-basic-elements": "npm:41.0.0" + "@udecode/plate-basic-marks": "npm:41.0.0" + "@udecode/plate-block-quote": "npm:41.0.0" + "@udecode/plate-break": "npm:41.0.0" + "@udecode/plate-code-block": "npm:41.0.0" + "@udecode/plate-combobox": "npm:41.0.0" + "@udecode/plate-comments": "npm:41.0.0" + "@udecode/plate-common": "npm:41.0.0" + "@udecode/plate-csv": "npm:41.0.0" + "@udecode/plate-diff": "npm:41.0.0" + "@udecode/plate-docx": "npm:41.0.0" + "@udecode/plate-find-replace": "npm:41.0.0" + "@udecode/plate-floating": "npm:41.0.0" + "@udecode/plate-font": "npm:41.0.0" + "@udecode/plate-heading": "npm:41.0.0" + "@udecode/plate-highlight": "npm:41.0.0" + "@udecode/plate-horizontal-rule": "npm:41.0.0" + "@udecode/plate-indent": "npm:41.0.0" + "@udecode/plate-indent-list": "npm:41.0.0" + "@udecode/plate-kbd": "npm:41.0.0" + "@udecode/plate-layout": "npm:41.0.0" + "@udecode/plate-line-height": "npm:41.0.0" + "@udecode/plate-link": "npm:41.0.0" + "@udecode/plate-list": "npm:41.0.0" + "@udecode/plate-markdown": "npm:41.0.0" + "@udecode/plate-media": "npm:41.0.0" + "@udecode/plate-mention": "npm:41.0.0" + "@udecode/plate-node-id": "npm:41.0.0" + "@udecode/plate-normalizers": "npm:41.0.0" + "@udecode/plate-reset-node": "npm:41.0.0" + "@udecode/plate-resizable": "npm:41.0.0" + "@udecode/plate-select": "npm:41.0.0" + "@udecode/plate-selection": "npm:41.0.0" + "@udecode/plate-slash-command": "npm:41.0.0" + "@udecode/plate-suggestion": "npm:41.0.0" + "@udecode/plate-tabbable": "npm:41.0.0" + "@udecode/plate-table": "npm:41.0.0" + "@udecode/plate-toggle": "npm:41.0.0" + "@udecode/plate-trailing-block": "npm:41.0.0" peerDependencies: react: ">=16.8.0" react-dom: ">=16.8.0" @@ -7543,12 +7543,12 @@ __metadata: languageName: unknown linkType: soft -"@udecode/slate-react@npm:40.3.1, @udecode/slate-react@workspace:^, @udecode/slate-react@workspace:packages/slate-react": +"@udecode/slate-react@npm:41.0.0, @udecode/slate-react@workspace:^, @udecode/slate-react@workspace:packages/slate-react": version: 0.0.0-use.local resolution: "@udecode/slate-react@workspace:packages/slate-react" dependencies: "@udecode/react-utils": "npm:40.2.8" - "@udecode/slate": "npm:40.3.1" + "@udecode/slate": "npm:41.0.0" "@udecode/utils": "npm:37.0.0" peerDependencies: react: ">=16.8.0" @@ -7559,11 +7559,11 @@ __metadata: languageName: unknown linkType: soft -"@udecode/slate-utils@npm:40.3.1, @udecode/slate-utils@workspace:^, @udecode/slate-utils@workspace:packages/slate-utils": +"@udecode/slate-utils@npm:41.0.0, @udecode/slate-utils@workspace:^, @udecode/slate-utils@workspace:packages/slate-utils": version: 0.0.0-use.local resolution: "@udecode/slate-utils@workspace:packages/slate-utils" dependencies: - "@udecode/slate": "npm:40.3.1" + "@udecode/slate": "npm:41.0.0" "@udecode/utils": "npm:37.0.0" lodash: "npm:^4.17.21" peerDependencies: @@ -7572,7 +7572,7 @@ __metadata: languageName: unknown linkType: soft -"@udecode/slate@npm:40.3.1, @udecode/slate@workspace:^, @udecode/slate@workspace:packages/slate": +"@udecode/slate@npm:41.0.0, @udecode/slate@workspace:^, @udecode/slate@workspace:packages/slate": version: 0.0.0-use.local resolution: "@udecode/slate@workspace:packages/slate" dependencies: