diff --git a/.changeset/few-points-clean.md b/.changeset/few-points-clean.md new file mode 100644 index 0000000000..f1017639d7 --- /dev/null +++ b/.changeset/few-points-clean.md @@ -0,0 +1,12 @@ +--- +'@udecode/plate-indent-list': patch +'@udecode/plate-line-height': patch +'@udecode/plate-code-block': patch +'@udecode/plate-comments': patch +'@udecode/plate-layout': patch +'@udecode/plate-media': patch +'@udecode/plate-table': patch +'@udecode/plate-docx': patch +--- + +Support deserialization from PlateStatic. diff --git a/.changeset/twenty-rivers-tell.md b/.changeset/twenty-rivers-tell.md new file mode 100644 index 0000000000..e9f86a0955 --- /dev/null +++ b/.changeset/twenty-rivers-tell.md @@ -0,0 +1,17 @@ +--- +'@udecode/plate-core': patch +--- + +`editor.api.html.deserialize`: Support deserialization from PlateStatic. + +New: `getEditorDOMFromHtmlString` returns the editor element in html string (the one with `data-slate-editor="true"`). + +New utilities for checking Slate nodes in HTML: +- `isSlateVoid`: Check if an HTML element is a Slate void node +- `isSlateElement`: Check if an HTML element is a Slate element node +- `isSlateString`: Check if an HTML element is a Slate string node +- `isSlateLeaf`: Check if an HTML element is a Slate leaf node +- `isSlateNode`: Check if an HTML element is any type of Slate node +- `isSlatePluginElement`: Check if an HTML element is a Slate element node with a specific plugin key +- `isSlatePluginNode`: Check if an HTML element has a specific plugin key class +- `getSlateElements`: Get all Slate element nodes in an HTML element diff --git a/apps/www/content/docs/cn/html.mdx b/apps/www/content/docs/cn/html.mdx index a3816dfdd8..b12dc385ef 100644 --- a/apps/www/content/docs/cn/html.mdx +++ b/apps/www/content/docs/cn/html.mdx @@ -191,14 +191,14 @@ const html = await serializeHtml(editor, { components }); ### 使用方法 -The `editor.api.html.deserialize` function allows you to convert HTML content into Slate value: +`editor.api.html.deserialize` 函数允许你将 HTML 内容转换为 Slate 值: ```typescript import { createPlateEditor } from '@udecode/plate/react'; const editor = createPlateEditor({ plugins: [ - // all plugins that you want to deserialize + // 所有你想要反序列化的插件 ] }) editor.children = editor.api.html.deserialize('

Hello, world!

') diff --git a/apps/www/public/r/index.json b/apps/www/public/r/index.json index a69602dd6d..5ba4e11882 100644 --- a/apps/www/public/r/index.json +++ b/apps/www/public/r/index.json @@ -1922,6 +1922,34 @@ ], "type": "registry:ui" }, + { + "dependencies": [], + "doc": { + "description": "A toolbar button to import editor content from a file.", + "docs": [ + { + "route": "/docs/import", + "title": "Import" + } + ], + "examples": [ + "basic-nodes-demo" + ], + "label": "New", + "title": "Import Toolbar Button" + }, + "files": [ + { + "path": "plate-ui/import-toolbar-button.tsx", + "type": "registry:ui" + } + ], + "name": "import-toolbar-button", + "registryDependencies": [ + "toolbar" + ], + "type": "registry:ui" + }, { "dependencies": [ "@udecode/plate-caption" diff --git a/apps/www/public/r/styles/default/comments-demo.json b/apps/www/public/r/styles/default/comments-demo.json index a7cbe6d036..7d7f8a5172 100644 --- a/apps/www/public/r/styles/default/comments-demo.json +++ b/apps/www/public/r/styles/default/comments-demo.json @@ -16,7 +16,7 @@ "type": "registry:example" }, { - "content": "import type { Value } from '@udecode/plate';\n\nexport const commentsValue: Value = [\n {\n children: [{ text: 'Comments' }],\n type: 'h2',\n },\n {\n children: [\n {\n text: 'Add ',\n },\n {\n comment: true,\n comment_1: true,\n text: 'comments to your content',\n },\n { text: ' to provide additional context, insights, or ' },\n {\n comment: true,\n comment_2: true,\n text: 'collaborate',\n },\n {\n text: ' with others',\n },\n ],\n type: 'p',\n },\n];\n", + "content": "import type { Value } from '@udecode/plate';\n\nexport const commentsValue: Value = [\n {\n children: [{ text: 'Comments' }],\n type: 'h2',\n },\n {\n children: [\n {\n text: 'Add ',\n },\n {\n comment: true,\n comment_1: true,\n text: 'comments to your content',\n },\n { text: ' to provide additional context, insights, or ' },\n {\n comment: true,\n comment_2: true,\n text: 'collaborate',\n },\n {\n text: ' with others',\n },\n ],\n type: 'p',\n },\n];\n", "path": "example/values/comments-value.tsx", "target": "components/comments-value.tsx", "type": "registry:example" diff --git a/apps/www/public/r/styles/default/fixed-toolbar-buttons.json b/apps/www/public/r/styles/default/fixed-toolbar-buttons.json index a63b3c6f8c..6b28059ca0 100644 --- a/apps/www/public/r/styles/default/fixed-toolbar-buttons.json +++ b/apps/www/public/r/styles/default/fixed-toolbar-buttons.json @@ -14,7 +14,7 @@ }, "files": [ { - "content": "'use client';\n\nimport React from 'react';\n\nimport { useEditorReadOnly } from '@udecode/plate/react';\nimport {\n BoldPlugin,\n CodePlugin,\n ItalicPlugin,\n StrikethroughPlugin,\n UnderlinePlugin,\n} from '@udecode/plate-basic-marks/react';\nimport {\n FontBackgroundColorPlugin,\n FontColorPlugin,\n} from '@udecode/plate-font/react';\nimport { HighlightPlugin } from '@udecode/plate-highlight/react';\nimport {\n AudioPlugin,\n FilePlugin,\n ImagePlugin,\n VideoPlugin,\n} from '@udecode/plate-media/react';\nimport {\n ArrowUpToLineIcon,\n BaselineIcon,\n BoldIcon,\n Code2Icon,\n HighlighterIcon,\n ItalicIcon,\n PaintBucketIcon,\n StrikethroughIcon,\n UnderlineIcon,\n WandSparklesIcon,\n} from 'lucide-react';\n\nimport { MoreDropdownMenu } from '@/components/plate-ui/more-dropdown-menu';\n\nimport { AIToolbarButton } from './ai-toolbar-button';\nimport { AlignDropdownMenu } from './align-dropdown-menu';\nimport { ColorDropdownMenu } from './color-dropdown-menu';\nimport { CommentToolbarButton } from './comment-toolbar-button';\nimport { EmojiDropdownMenu } from './emoji-dropdown-menu';\nimport { ExportToolbarButton } from './export-toolbar-button';\nimport { FontSizeToolbarButton } from './font-size-toolbar-button';\nimport { RedoToolbarButton, UndoToolbarButton } from './history-toolbar-button';\nimport {\n BulletedIndentListToolbarButton,\n NumberedIndentListToolbarButton,\n} from './indent-list-toolbar-button';\nimport { IndentTodoToolbarButton } from './indent-todo-toolbar-button';\nimport { IndentToolbarButton } from './indent-toolbar-button';\nimport { InsertDropdownMenu } from './insert-dropdown-menu';\nimport { LineHeightDropdownMenu } from './line-height-dropdown-menu';\nimport { LinkToolbarButton } from './link-toolbar-button';\nimport { MarkToolbarButton } from './mark-toolbar-button';\nimport { MediaToolbarButton } from './media-toolbar-button';\nimport { ModeDropdownMenu } from './mode-dropdown-menu';\nimport { OutdentToolbarButton } from './outdent-toolbar-button';\nimport { TableDropdownMenu } from './table-dropdown-menu';\nimport { ToggleToolbarButton } from './toggle-toolbar-button';\nimport { ToolbarGroup } from './toolbar';\nimport { TurnIntoDropdownMenu } from './turn-into-dropdown-menu';\n\nexport function FixedToolbarButtons() {\n const readOnly = useEditorReadOnly();\n\n return (\n
\n {!readOnly && (\n <>\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n )}\n\n
\n\n \n \n \n \n \n \n\n \n \n \n
\n );\n}\n", + "content": "'use client';\n\nimport React from 'react';\n\nimport { useEditorReadOnly } from '@udecode/plate/react';\nimport {\n BoldPlugin,\n CodePlugin,\n ItalicPlugin,\n StrikethroughPlugin,\n UnderlinePlugin,\n} from '@udecode/plate-basic-marks/react';\nimport {\n FontBackgroundColorPlugin,\n FontColorPlugin,\n} from '@udecode/plate-font/react';\nimport { HighlightPlugin } from '@udecode/plate-highlight/react';\nimport {\n AudioPlugin,\n FilePlugin,\n ImagePlugin,\n VideoPlugin,\n} from '@udecode/plate-media/react';\nimport {\n ArrowUpToLineIcon,\n BaselineIcon,\n BoldIcon,\n Code2Icon,\n HighlighterIcon,\n ItalicIcon,\n PaintBucketIcon,\n StrikethroughIcon,\n UnderlineIcon,\n WandSparklesIcon,\n} from 'lucide-react';\n\nimport { MoreDropdownMenu } from '@/components/plate-ui/more-dropdown-menu';\n\nimport { AIToolbarButton } from './ai-toolbar-button';\nimport { AlignDropdownMenu } from './align-dropdown-menu';\nimport { ColorDropdownMenu } from './color-dropdown-menu';\nimport { CommentToolbarButton } from './comment-toolbar-button';\nimport { EmojiDropdownMenu } from './emoji-dropdown-menu';\nimport { ExportToolbarButton } from './export-toolbar-button';\nimport { FontSizeToolbarButton } from './font-size-toolbar-button';\nimport { RedoToolbarButton, UndoToolbarButton } from './history-toolbar-button';\nimport { ImportToolbarButton } from './import-toolbar-button';\nimport {\n BulletedIndentListToolbarButton,\n NumberedIndentListToolbarButton,\n} from './indent-list-toolbar-button';\nimport { IndentTodoToolbarButton } from './indent-todo-toolbar-button';\nimport { IndentToolbarButton } from './indent-toolbar-button';\nimport { InsertDropdownMenu } from './insert-dropdown-menu';\nimport { LineHeightDropdownMenu } from './line-height-dropdown-menu';\nimport { LinkToolbarButton } from './link-toolbar-button';\nimport { MarkToolbarButton } from './mark-toolbar-button';\nimport { MediaToolbarButton } from './media-toolbar-button';\nimport { ModeDropdownMenu } from './mode-dropdown-menu';\nimport { OutdentToolbarButton } from './outdent-toolbar-button';\nimport { TableDropdownMenu } from './table-dropdown-menu';\nimport { ToggleToolbarButton } from './toggle-toolbar-button';\nimport { ToolbarGroup } from './toolbar';\nimport { TurnIntoDropdownMenu } from './turn-into-dropdown-menu';\n\nexport function FixedToolbarButtons() {\n const readOnly = useEditorReadOnly();\n\n return (\n
\n {!readOnly && (\n <>\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n )}\n\n
\n\n \n \n \n \n \n \n\n \n \n \n
\n );\n}\n", "path": "plate-ui/fixed-toolbar-buttons.tsx", "target": "components/plate-ui/fixed-toolbar-buttons.tsx", "type": "registry:ui" diff --git a/apps/www/public/r/styles/default/horizontal-rule-demo.json b/apps/www/public/r/styles/default/horizontal-rule-demo.json index e37096e70f..90f8f56c87 100644 --- a/apps/www/public/r/styles/default/horizontal-rule-demo.json +++ b/apps/www/public/r/styles/default/horizontal-rule-demo.json @@ -16,7 +16,7 @@ "type": "registry:example" }, { - "content": "import { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { jsx } from '@udecode/plate-test-utils';\n\njsx;\n\nexport const horizontalRuleValue: any = (\n \n Horizontal Rule\n \n Add horizontal rules to visually separate sections and content within your\n document.\n \n \n \n \n \n);\n", + "content": "import { BaseHorizontalRulePlugin } from '@udecode/plate-horizontal-rule';\nimport { jsx } from '@udecode/plate-test-utils';\n\njsx;\n\nexport const horizontalRuleValue: any = (\n \n Horizontal Rule\n {/* \n Add horizontal rules to visually separate sections and content within your\n document.\n */}\n \n \n \n \n);\n", "path": "example/values/horizontal-rule-value.tsx", "target": "components/horizontal-rule-value.tsx", "type": "registry:example" diff --git a/apps/www/public/r/styles/default/hr-element.json b/apps/www/public/r/styles/default/hr-element.json index 16e07e69db..0e423a2cf4 100644 --- a/apps/www/public/r/styles/default/hr-element.json +++ b/apps/www/public/r/styles/default/hr-element.json @@ -23,7 +23,7 @@ "type": "registry:ui" }, { - "content": "import React from 'react';\n\nimport type { SlateElementProps } from '@udecode/plate';\n\nimport { cn } from '@udecode/cn';\nimport { SlateElement } from '@udecode/plate';\n\nexport function HrElementStatic({\n children,\n className,\n nodeProps,\n ...props\n}: SlateElementProps) {\n return (\n \n
\n \n
\n {children}\n
\n );\n}\n", + "content": "import React from 'react';\n\nimport type { SlateElementProps } from '@udecode/plate';\n\nimport { cn } from '@udecode/cn';\nimport { SlateElement } from '@udecode/plate';\n\nexport function HrElementStatic({\n children,\n className,\n nodeProps,\n ...props\n}: SlateElementProps) {\n return (\n \n
\n \n
\n {children}\n
\n );\n}\n", "path": "plate-ui/hr-element-static.tsx", "target": "components/plate-ui/hr-element-static.tsx", "type": "registry:ui" diff --git a/apps/www/public/r/styles/default/image-element.json b/apps/www/public/r/styles/default/image-element.json index 405ee8a9e6..84d13b9f13 100644 --- a/apps/www/public/r/styles/default/image-element.json +++ b/apps/www/public/r/styles/default/image-element.json @@ -29,7 +29,7 @@ "type": "registry:ui" }, { - "content": "import React from 'react';\n\nimport type { SlateElementProps } from '@udecode/plate';\nimport type { TCaptionElement } from '@udecode/plate-caption';\nimport type { TImageElement } from '@udecode/plate-media';\n\nimport { cn } from '@udecode/cn';\nimport { NodeApi, SlateElement } from '@udecode/plate';\n\nexport function ImageElementStatic({\n children,\n className,\n nodeProps,\n ...props\n}: SlateElementProps) {\n const {\n align = 'center',\n caption,\n url,\n width,\n } = props.element as TImageElement &\n TCaptionElement & {\n width: number;\n };\n\n return (\n \n
\n \n \n {caption && (\n
\n {NodeApi.string(caption[0])}\n
\n )}\n
\n \n {children}\n \n );\n}\n", + "content": "import React from 'react';\n\nimport type { SlateElementProps } from '@udecode/plate';\nimport type { TCaptionElement } from '@udecode/plate-caption';\nimport type { TImageElement } from '@udecode/plate-media';\n\nimport { cn } from '@udecode/cn';\nimport { NodeApi, SlateElement } from '@udecode/plate';\n\nexport function ImageElementStatic({\n children,\n className,\n nodeProps,\n ...props\n}: SlateElementProps) {\n const {\n align = 'center',\n caption,\n url,\n width,\n } = props.element as TImageElement &\n TCaptionElement & {\n width: number;\n };\n\n return (\n \n
\n \n \n {caption && (\n
\n {NodeApi.string(caption[0])}\n
\n )}\n
\n \n {children}\n \n );\n}\n", "path": "plate-ui/image-element-static.tsx", "target": "components/plate-ui/image-element-static.tsx", "type": "registry:ui" diff --git a/apps/www/public/r/styles/default/import-toolbar-button.json b/apps/www/public/r/styles/default/import-toolbar-button.json new file mode 100644 index 0000000000..2853bf0837 --- /dev/null +++ b/apps/www/public/r/styles/default/import-toolbar-button.json @@ -0,0 +1,30 @@ +{ + "dependencies": [], + "doc": { + "description": "A toolbar button to import editor content from a file.", + "docs": [ + { + "route": "/docs/import", + "title": "Import" + } + ], + "examples": [ + "basic-nodes-demo" + ], + "label": "New", + "title": "Import Toolbar Button" + }, + "files": [ + { + "content": "'use client';\n\nimport React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport { getEditorDOMFromHtmlString } from '@udecode/plate';\nimport { useEditorRef } from '@udecode/plate/react';\nimport { ArrowUpToLineIcon } from 'lucide-react';\nimport { useFilePicker } from 'use-file-picker';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n useOpenState,\n} from './dropdown-menu';\nimport { ToolbarButton } from './toolbar';\n\nexport function ImportToolbarButton({ children, ...props }: DropdownMenuProps) {\n const editor = useEditorRef();\n const openState = useOpenState();\n\n const { openFilePicker } = useFilePicker({\n accept: ['text/html'],\n multiple: false,\n onFilesSelected: async ({ plainFiles }) => {\n const text = await plainFiles[0].text();\n\n const editorNode = getEditorDOMFromHtmlString(text);\n\n const nodes = editor.api.html.deserialize({\n collapseWhiteSpace: false,\n element: editorNode,\n });\n\n editor.tf.insertNodes(nodes);\n },\n });\n\n return (\n \n \n \n \n \n \n\n \n \n {\n openFilePicker();\n }}\n >\n Import from HTML\n \n\n \n Import from Word{' '}\n (coming soon)\n \n \n \n \n );\n}\n", + "path": "plate-ui/import-toolbar-button.tsx", + "target": "components/plate-ui/import-toolbar-button.tsx", + "type": "registry:ui" + } + ], + "name": "import-toolbar-button", + "registryDependencies": [ + "toolbar" + ], + "type": "registry:ui" +} \ No newline at end of file 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 1638e5ea63..4e22d5b0d5 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';\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';\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 ef344e408c..4bab085bc2 100644 --- a/apps/www/public/r/styles/default/indent-todo-marker.json +++ b/apps/www/public/r/styles/default/indent-todo-marker.json @@ -18,13 +18,13 @@ }, "files": [ { - "content": "'use client';\n\nimport type { SlateRenderElementProps } from '@udecode/plate';\n\nimport { cn } from '@udecode/cn';\nimport { useReadOnly } from '@udecode/plate/react';\nimport {\n useIndentTodoListElement,\n useIndentTodoListElementState,\n} from '@udecode/plate-indent-list/react';\n\nimport { Checkbox } from './checkbox';\n\nexport const TodoMarker = ({\n element,\n}: Omit) => {\n const state = useIndentTodoListElementState({ element });\n const { checkboxProps } = useIndentTodoListElement(state);\n const readOnly = useReadOnly();\n\n return (\n
    \n \n
    \n );\n};\n\nexport const TodoLi = (props: SlateRenderElementProps) => {\n const { children, element } = props;\n\n return (\n \n {children}\n \n );\n};\n", + "content": "'use client';\n\nimport type { SlateRenderElementProps } from '@udecode/plate';\n\nimport { cn } from '@udecode/cn';\nimport { useReadOnly } from '@udecode/plate/react';\nimport {\n useIndentTodoListElement,\n useIndentTodoListElementState,\n} from '@udecode/plate-indent-list/react';\n\nimport { Checkbox } from './checkbox';\n\nexport const TodoMarker = ({\n element,\n}: Omit) => {\n const state = useIndentTodoListElementState({ element });\n const { checkboxProps } = useIndentTodoListElement(state);\n const readOnly = useReadOnly();\n\n return (\n
    \n \n
    \n );\n};\n\nexport const TodoLi = (props: SlateRenderElementProps) => {\n const { children, element } = props;\n\n return (\n \n {children}\n \n );\n};\n", "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';\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", + "content": "import React from 'react';\n\nimport type { SlateRenderElementProps } from '@udecode/plate';\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" diff --git a/apps/www/public/r/styles/default/link-demo.json b/apps/www/public/r/styles/default/link-demo.json index 46b0793282..a2e9c3761c 100644 --- a/apps/www/public/r/styles/default/link-demo.json +++ b/apps/www/public/r/styles/default/link-demo.json @@ -16,7 +16,7 @@ "type": "registry:example" }, { - "content": "import { jsx } from '@udecode/plate-test-utils';\n\njsx;\n\nexport const linkValue: any = (\n \n Link\n \n Add hyperlinks{' '}\n within your text to reference external sources or provide additional\n information using the Link plugin.\n \n \n Effortlessly create hyperlinks using the toolbar or by pasting a URL while\n selecting the desired text.\n \n \n);\n", + "content": "import { jsx } from '@udecode/plate-test-utils';\n\njsx;\n\nexport const linkValue: any = (\n \n Link\n \n Add{' '}\n \n hyperlinks\n {' '}\n within your text to reference external sources or provide additional\n information using the Link plugin.\n \n \n Effortlessly create hyperlinks using the toolbar or by pasting a URL while\n selecting the desired text.\n \n \n);\n", "path": "example/values/link-value.tsx", "target": "components/link-value.tsx", "type": "registry:example" diff --git a/apps/www/public/r/styles/default/media-demo.json b/apps/www/public/r/styles/default/media-demo.json index 17c36ba0cb..721856e48b 100644 --- a/apps/www/public/r/styles/default/media-demo.json +++ b/apps/www/public/r/styles/default/media-demo.json @@ -10,7 +10,7 @@ "type": "registry:example" }, { - "content": "import { jsx } from '@udecode/plate-test-utils';\n\njsx;\n\nexport const imageValue: any = (\n \n Image\n Add images by either uploading them or providing the image URL:\n \n \n \n Customize image captions and resize images.\n \n);\n\nexport const mediaPlaceholderValue: any = (\n \n Upload\n \n Our editor supports various media types for upload, including images,\n videos, audio, and files.\n \n \n \n \n \n Real-time upload status and progress tracking\n \n \n \n \n \n Configurable file size limits and batch upload settings\n \n \n \n \n \n Clear error messages for any upload issues\n \n \n Try it now - drag an image from your desktop or click the upload button in\n the toolbar\n \n \n);\n\nexport const mediaValue: any = (\n \n {imageValue}\n {mediaPlaceholderValue}\n\n Embed\n Embed various types of content, such as videos and tweets:\n \n \n \n {/* BUG */}\n {/* \n \n */}\n \n);\n", + "content": "import { jsx } from '@udecode/plate-test-utils';\n\njsx;\n\nexport const imageValue: any = (\n \n {/* Image */}\n {/* Add images by either uploading them or providing the image URL: */}\n \n \n \n {/* Customize image captions and resize images. */}\n \n);\n\nexport const mediaPlaceholderValue: any = (\n \n Upload\n \n Our editor supports various media types for upload, including images,\n videos, audio, and files.\n \n \n \n \n \n Real-time upload status and progress tracking\n \n \n \n \n \n Configurable file size limits and batch upload settings\n \n \n \n \n \n Clear error messages for any upload issues\n \n \n Try it now - drag an image from your desktop or click the upload button in\n the toolbar\n \n \n);\n\nexport const mediaValue: any = (\n \n {imageValue}\n {/* {mediaPlaceholderValue}\n\n Embed\n Embed various types of content, such as videos and tweets:\n \n \n */}\n {/* BUG */}\n {/* \n \n */}\n \n);\n", "path": "example/values/media-value.tsx", "target": "components/media-value.tsx", "type": "registry:example" diff --git a/apps/www/src/__registry__/index.tsx b/apps/www/src/__registry__/index.tsx index 8d7ad35cd3..553a20c0b2 100644 --- a/apps/www/src/__registry__/index.tsx +++ b/apps/www/src/__registry__/index.tsx @@ -1165,6 +1165,22 @@ export const Index: Record = { subcategory: "", chunks: [] }, + "import-toolbar-button": { + name: "import-toolbar-button", + description: "", + type: "registry:ui", + registryDependencies: ["toolbar"], + files: [{ + path: "src/registry/default/plate-ui/import-toolbar-button.tsx", + type: "registry:ui", + target: "" + }], + component: React.lazy(() => import("@/registry/default/plate-ui/import-toolbar-button.tsx")), + source: "", + category: "", + subcategory: "", + chunks: [] + }, "caption": { name: "caption", description: "", diff --git a/apps/www/src/registry/default/example/values/comments-value.tsx b/apps/www/src/registry/default/example/values/comments-value.tsx index 272fc4b625..6ac309df35 100644 --- a/apps/www/src/registry/default/example/values/comments-value.tsx +++ b/apps/www/src/registry/default/example/values/comments-value.tsx @@ -22,7 +22,7 @@ export const commentsValue: Value = [ text: 'collaborate', }, { - text: ' with others', + text: ' with others', }, ], type: 'p', diff --git a/apps/www/src/registry/default/example/values/link-value.tsx b/apps/www/src/registry/default/example/values/link-value.tsx index e9404d3fda..13b6772aca 100644 --- a/apps/www/src/registry/default/example/values/link-value.tsx +++ b/apps/www/src/registry/default/example/values/link-value.tsx @@ -8,7 +8,10 @@ export const linkValue: any = ( Link - Add hyperlinks{' '} + Add{' '} + + hyperlinks + {' '} within your text to reference external sources or provide additional information using the Link plugin. diff --git a/apps/www/src/registry/default/plate-ui/fixed-toolbar-buttons.tsx b/apps/www/src/registry/default/plate-ui/fixed-toolbar-buttons.tsx index 6a8138245f..1d21228907 100644 --- a/apps/www/src/registry/default/plate-ui/fixed-toolbar-buttons.tsx +++ b/apps/www/src/registry/default/plate-ui/fixed-toolbar-buttons.tsx @@ -44,6 +44,7 @@ import { EmojiDropdownMenu } from './emoji-dropdown-menu'; import { ExportToolbarButton } from './export-toolbar-button'; import { FontSizeToolbarButton } from './font-size-toolbar-button'; import { RedoToolbarButton, UndoToolbarButton } from './history-toolbar-button'; +import { ImportToolbarButton } from './import-toolbar-button'; import { BulletedIndentListToolbarButton, NumberedIndentListToolbarButton, @@ -84,6 +85,8 @@ export function FixedToolbarButtons() { + + diff --git a/apps/www/src/registry/default/plate-ui/hr-element-static.tsx b/apps/www/src/registry/default/plate-ui/hr-element-static.tsx index 073fd0e03a..052896a70e 100644 --- a/apps/www/src/registry/default/plate-ui/hr-element-static.tsx +++ b/apps/www/src/registry/default/plate-ui/hr-element-static.tsx @@ -12,7 +12,7 @@ export function HrElementStatic({ ...props }: SlateElementProps) { return ( - +

    +
    { + const text = await plainFiles[0].text(); + + const editorNode = getEditorDOMFromHtmlString(text); + + const nodes = editor.api.html.deserialize({ + collapseWhiteSpace: false, + element: editorNode, + }); + + editor.tf.insertNodes(nodes); + }, + }); + + return ( + + + + + + + + + + { + openFilePicker(); + }} + > + Import from HTML + + + + Import from Word{' '} + (coming soon) + + + + + ); +} 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 914d86d26e..83891d28b0 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 @@ -10,7 +10,12 @@ export const FireMarker = ( return (
    - + {(element as TIndentElement).indent % 2 === 0 ? '🔥' : '🚀'}
    @@ -20,5 +25,5 @@ export const FireMarker = ( export const FireLiComponent = (props: SlateRenderElementProps) => { const { children } = props; - return {children}; + return
  • {children}
  • ; }; diff --git a/apps/www/src/registry/default/plate-ui/indent-todo-marker-static.tsx b/apps/www/src/registry/default/plate-ui/indent-todo-marker-static.tsx index c3c7122206..1f33374b26 100644 --- a/apps/www/src/registry/default/plate-ui/indent-todo-marker-static.tsx +++ b/apps/www/src/registry/default/plate-ui/indent-todo-marker-static.tsx @@ -24,12 +24,13 @@ export const TodoLiStatic = ({ element, }: SlateRenderElementProps) => { return ( - {children} - + ); }; diff --git a/apps/www/src/registry/default/plate-ui/indent-todo-marker.tsx b/apps/www/src/registry/default/plate-ui/indent-todo-marker.tsx index 768f2d6f70..5c61d214f2 100644 --- a/apps/www/src/registry/default/plate-ui/indent-todo-marker.tsx +++ b/apps/www/src/registry/default/plate-ui/indent-todo-marker.tsx @@ -35,12 +35,13 @@ export const TodoLi = (props: SlateRenderElementProps) => { const { children, element } = props; return ( - {children} - + ); }; diff --git a/apps/www/src/registry/registry-ui.ts b/apps/www/src/registry/registry-ui.ts index 1b65a6926b..ad8daa3811 100644 --- a/apps/www/src/registry/registry-ui.ts +++ b/apps/www/src/registry/registry-ui.ts @@ -105,6 +105,22 @@ export const uiComponents: Registry = [ registryDependencies: [], type: 'registry:ui', }, + { + dependencies: [], + doc: { + description: 'A toolbar button to import editor content from a file.', + docs: [{ route: '/docs/import', title: 'Import' }], + examples: ['basic-nodes-demo'], + label: 'New', + title: 'Import Toolbar Button', + }, + files: [ + { path: 'plate-ui/import-toolbar-button.tsx', type: 'registry:ui' }, + ], + name: 'import-toolbar-button', + registryDependencies: ['toolbar'], + type: 'registry:ui', + }, { dependencies: ['html2canvas', 'pdf-lib'], doc: { @@ -121,6 +137,7 @@ export const uiComponents: Registry = [ registryDependencies: ['toolbar'], type: 'registry:ui', }, + { dependencies: ['@udecode/plate-caption'], doc: { diff --git a/packages/code-block/src/lib/BaseCodeBlockPlugin.ts b/packages/code-block/src/lib/BaseCodeBlockPlugin.ts index f619e101b4..4d0c7ad87b 100644 --- a/packages/code-block/src/lib/BaseCodeBlockPlugin.ts +++ b/packages/code-block/src/lib/BaseCodeBlockPlugin.ts @@ -9,7 +9,7 @@ import type { Prism } from './types'; import { withCodeBlock } from '../lib/withCodeBlock'; import { decorateCodeLine } from './decorateCodeLine'; -import { htmlDeserializerCodeBlock } from './htmlDeserializerCodeBlock'; +import { htmlDeserializerCodeBlock } from './deserializer/htmlDeserializerCodeBlock'; export type CodeBlockConfig = PluginConfig< 'code_block', diff --git a/packages/code-block/src/lib/htmlDeserializerCodeBlock.ts b/packages/code-block/src/lib/deserializer/htmlDeserializerCodeBlock.ts similarity index 73% rename from packages/code-block/src/lib/htmlDeserializerCodeBlock.ts rename to packages/code-block/src/lib/deserializer/htmlDeserializerCodeBlock.ts index c51a73dc8e..a9cefb2e18 100644 --- a/packages/code-block/src/lib/htmlDeserializerCodeBlock.ts +++ b/packages/code-block/src/lib/deserializer/htmlDeserializerCodeBlock.ts @@ -1,9 +1,19 @@ import type { HtmlDeserializer } from '@udecode/plate'; -import { BaseCodeBlockPlugin, BaseCodeLinePlugin } from './BaseCodeBlockPlugin'; +import { + BaseCodeBlockPlugin, + BaseCodeLinePlugin, +} from '../BaseCodeBlockPlugin'; +import { htmlDeserializerCodeBlockStatic } from './htmlDeserializerCodeBlockStatic'; export const htmlDeserializerCodeBlock: HtmlDeserializer = { parse: ({ element }) => { + const staticCodeBlock = htmlDeserializerCodeBlockStatic(element); + + if (staticCodeBlock) { + return staticCodeBlock; + } + const languageSelectorText = [...element.childNodes].find( (node: ChildNode) => node.nodeName === 'SELECT' diff --git a/packages/code-block/src/lib/deserializer/htmlDeserializerCodeBlockStatic.ts b/packages/code-block/src/lib/deserializer/htmlDeserializerCodeBlockStatic.ts new file mode 100644 index 0000000000..a8559070c0 --- /dev/null +++ b/packages/code-block/src/lib/deserializer/htmlDeserializerCodeBlockStatic.ts @@ -0,0 +1,34 @@ +import { getSlateElements, isSlatePluginElement } from '@udecode/plate'; + +import { + BaseCodeBlockPlugin, + BaseCodeLinePlugin, +} from '../BaseCodeBlockPlugin'; + +export const htmlDeserializerCodeBlockStatic = (element: HTMLElement) => { + if (isSlatePluginElement(element, BaseCodeBlockPlugin.key)) { + const staticCodeLines = getSlateElements(element).filter((el) => + isSlatePluginElement(el, BaseCodeLinePlugin.key) + ); + + if (staticCodeLines) { + const codeLines = staticCodeLines.map((line) => { + const node: any = { + children: [{ text: line.textContent }], + type: BaseCodeLinePlugin.key, + }; + + if (line.dataset.slateId) { + node.id = line.dataset.slateId; + } + + return node; + }); + + return { + children: codeLines, + type: BaseCodeBlockPlugin.key, + }; + } + } +}; diff --git a/packages/code-block/src/lib/deserializer/index.ts b/packages/code-block/src/lib/deserializer/index.ts new file mode 100644 index 0000000000..7b8d56f8f0 --- /dev/null +++ b/packages/code-block/src/lib/deserializer/index.ts @@ -0,0 +1,6 @@ +/** + * @file Automatically generated by barrelsby. + */ + +export * from './htmlDeserializerCodeBlock'; +export * from './htmlDeserializerCodeBlockStatic'; diff --git a/packages/code-block/src/lib/index.ts b/packages/code-block/src/lib/index.ts index 7dc025f6e6..ca856337a4 100644 --- a/packages/code-block/src/lib/index.ts +++ b/packages/code-block/src/lib/index.ts @@ -4,11 +4,11 @@ export * from './BaseCodeBlockPlugin'; export * from './decorateCodeLine'; -export * from './htmlDeserializerCodeBlock'; export * from './types'; export * from './withCodeBlock'; export * from './withInsertDataCodeBlock'; export * from './withInsertFragmentCodeBlock'; export * from './withNormalizeCodeBlock'; +export * from './deserializer/index'; export * from './queries/index'; export * from './transforms/index'; diff --git a/packages/comments/src/lib/BaseCommentsPlugin.ts b/packages/comments/src/lib/BaseCommentsPlugin.ts index 9ce02d6e55..f685c760f4 100644 --- a/packages/comments/src/lib/BaseCommentsPlugin.ts +++ b/packages/comments/src/lib/BaseCommentsPlugin.ts @@ -73,6 +73,39 @@ export const BaseCommentsPlugin = createTSlatePlugin({ onCommentDelete: null, onCommentUpdate: null, }, + parsers: { + html: { + deserializer: { + disabledDefaultNodeProps: true, + toNodeProps: ({ element }) => { + const { slateComment } = element.dataset; + + const ids = Object.keys(element.dataset).filter((key) => + /^slateComment-\d+$/.exec(key) + ); + + const node: any = {}; + + if (slateComment !== undefined) { + node.comment = Boolean(slateComment); + } + // parse data-slate-comment-* attributes to comment_ + if (ids.length > 0) { + ids.forEach((id) => { + const value = element.dataset[id]; + + if (value === undefined) return; + + const key = `comment_${id.replace(/^slateComment-/, '')}`; + node[key] = Boolean(value); + }); + } + + return node; + }, + }, + }, + }, }) .extendOptions>(({ getOptions }) => ({ activeComment: () => { diff --git a/packages/core/src/lib/plugin/BasePlugin.ts b/packages/core/src/lib/plugin/BasePlugin.ts index d876a50bf8..8d713c975e 100644 --- a/packages/core/src/lib/plugin/BasePlugin.ts +++ b/packages/core/src/lib/plugin/BasePlugin.ts @@ -73,7 +73,7 @@ export type BasePlugin = { dependencies: string[]; /** Node-specific configuration for this plugin. */ - node: BasePluginNode; + node: BasePluginNode; /** Extended properties used by any plugin as options. */ options: InferOptions; @@ -112,7 +112,7 @@ export type BasePlugin = { enabled?: boolean; }; -export type BasePluginNode = { +export type BasePluginNode = { /** * Specifies the type identifier for this plugin's nodes. * @@ -133,6 +133,14 @@ export type BasePluginNode = { */ type: string; + /** + * Function that returns an object of data attributes to be added to the + * element. + */ + toDataAttributes?: ( + options: BasePluginContext & { node: TElement } + ) => AnyObject | undefined; + component?: NodeComponent | null; /** diff --git a/packages/core/src/lib/plugin/SlatePlugin.ts b/packages/core/src/lib/plugin/SlatePlugin.ts index ce24a90dfc..f4aa599812 100644 --- a/packages/core/src/lib/plugin/SlatePlugin.ts +++ b/packages/core/src/lib/plugin/SlatePlugin.ts @@ -456,6 +456,16 @@ export type HtmlDeserializer = query?: ( options: SlatePluginContext & { element: HTMLElement } ) => boolean; + toNodeProps?: ( + options: SlatePluginContext & { element: HTMLElement } + ) => Partial | undefined | void; + /** + * Whether to disable the default node props parsing logic. By default, all + * data-slate-* attributes will be parsed into node props. + * + * @default false + */ + disabledDefaultNodeProps?: boolean; }; export type HtmlSerializer = diff --git a/packages/core/src/lib/plugins/html/utils/getDataNodeProps.ts b/packages/core/src/lib/plugins/html/utils/getDataNodeProps.ts new file mode 100644 index 0000000000..1b257d6944 --- /dev/null +++ b/packages/core/src/lib/plugins/html/utils/getDataNodeProps.ts @@ -0,0 +1,81 @@ +import type { SlateEditor } from '../../../editor'; + +import { type AnyEditorPlugin, getEditorPlugin } from '../../../plugin'; +import { isSlatePluginNode } from '../../../static'; + +const getDefaultNodeProps = ({ + element, + type, +}: { + element: HTMLElement; + type: string; +}) => { + if (!isSlatePluginNode(element, type)) return; + + const dataAttributes: Record = {}; + + // Get all data-slate-* attributes from dataset + Object.entries(element.dataset).forEach(([key, value]) => { + if ( + key.startsWith('slate') && + value && + // Ignore slate default attributes + !['slateInline', 'slateLeaf', 'slateNode', 'slateVoid'].includes(key) + ) { + // Remove 'slate' prefix and convert to camelCase + const attributeKey = key.slice(5).charAt(0).toLowerCase() + key.slice(6); + + // Parse value if it's a boolean or number string + + //eslint-disable-next-line + if (value === undefined) return; + + let parsedValue: any = value; + + if (value === 'true') parsedValue = true; + else if (value === 'false') parsedValue = false; + else if (!Number.isNaN(Number(value))) parsedValue = Number(value); + + dataAttributes[attributeKey] = parsedValue; + } + }); + + if (Object.keys(dataAttributes).length > 0) { + return dataAttributes; + } +}; + +export const getDataNodeProps = ({ + editor, + element, + plugin, +}: { + editor: SlateEditor; + element: HTMLElement; + plugin: AnyEditorPlugin; +}) => { + const toNodeProps = plugin.parsers.html?.deserializer?.toNodeProps; + + const disabledDefaultNodeProps = + plugin.parsers.html?.deserializer?.disabledDefaultNodeProps ?? false; + + const defaultNodeProps = disabledDefaultNodeProps + ? {} + : getDefaultNodeProps({ + ...(getEditorPlugin(editor, plugin) as any), + element, + }); + + if (!toNodeProps) return defaultNodeProps; + + const customNodeProps = + toNodeProps({ + ...(getEditorPlugin(editor, plugin) as any), + element, + }) ?? {}; + + return { + ...defaultNodeProps, + ...customNodeProps, + }; +}; diff --git a/packages/core/src/lib/plugins/html/utils/htmlElementToElement.ts b/packages/core/src/lib/plugins/html/utils/htmlElementToElement.ts index a13fe04b6c..2ecb5aab2a 100644 --- a/packages/core/src/lib/plugins/html/utils/htmlElementToElement.ts +++ b/packages/core/src/lib/plugins/html/utils/htmlElementToElement.ts @@ -4,6 +4,7 @@ import { jsx } from 'slate-hyperscript'; import type { SlateEditor } from '../../../editor'; +import { isSlateVoid } from '../../../static'; import { deserializeHtmlNodeChildren } from './deserializeHtmlNodeChildren'; import { pipeDeserializeHtmlElement } from './pipeDeserializeHtmlElement'; @@ -21,7 +22,7 @@ export const htmlElementToElement = ( node.children ?? (deserializeHtmlNodeChildren(editor, element) as Descendant[]); - if (descendants.length === 0 || withoutChildren) { + if (descendants.length === 0 || withoutChildren || isSlateVoid(element)) { descendants = [{ text: '' }]; } diff --git a/packages/core/src/lib/plugins/html/utils/htmlTextNodeToString.ts b/packages/core/src/lib/plugins/html/utils/htmlTextNodeToString.ts index 0b0cb9b619..3d17e006d7 100644 --- a/packages/core/src/lib/plugins/html/utils/htmlTextNodeToString.ts +++ b/packages/core/src/lib/plugins/html/utils/htmlTextNodeToString.ts @@ -3,6 +3,8 @@ import { isHtmlText } from './isHtmlText'; export const htmlTextNodeToString = (node: ChildNode | HTMLElement) => { if (isHtmlText(node)) { + if (node.parentElement?.dataset.platePreventDeserialization) return ''; + return node.textContent || ''; } }; diff --git a/packages/core/src/lib/plugins/html/utils/index.ts b/packages/core/src/lib/plugins/html/utils/index.ts index 768d94e6dd..689609a730 100644 --- a/packages/core/src/lib/plugins/html/utils/index.ts +++ b/packages/core/src/lib/plugins/html/utils/index.ts @@ -14,6 +14,7 @@ export * from './deserializeHtmlElement'; export * from './deserializeHtmlNode'; export * from './deserializeHtmlNodeChildren'; export * from './findHtmlElement'; +export * from './getDataNodeProps'; export * from './getHtmlComments'; export * from './htmlBodyToFragment'; export * from './htmlBrToNewLine'; diff --git a/packages/core/src/lib/plugins/html/utils/pluginDeserializeHtml.ts b/packages/core/src/lib/plugins/html/utils/pluginDeserializeHtml.ts index 424b864017..343167bd77 100644 --- a/packages/core/src/lib/plugins/html/utils/pluginDeserializeHtml.ts +++ b/packages/core/src/lib/plugins/html/utils/pluginDeserializeHtml.ts @@ -9,6 +9,38 @@ import type { import { getEditorPlugin } from '../../../plugin'; import { getInjectedPlugins } from '../../../utils/getInjectedPlugins'; +import { getDataNodeProps } from './getDataNodeProps'; + +/** + * Get a deserializer and add default rules for deserializing plate static + * elements + */ +const getDeserializedWithStaticRules = (plugin: AnyEditorPlugin) => { + let deserializer = plugin.parsers?.html?.deserializer; + + const rules = deserializer?.rules ?? []; + + // Check if rules already contain slate-xxx className + const hasSlateRule = rules.some((rule) => + rule.validClassName?.includes(`slate-${plugin.key}`) + ); + + const staticRules = hasSlateRule + ? rules + : [ + { + validClassName: `slate-${plugin.key}`, + validNodeName: '*', + }, + ...rules, + ]; + + if (!deserializer) deserializer = { rules: staticRules }; + + deserializer.rules = staticRules; + + return deserializer; +}; /** Get a deserializer by type, node names, class names and styles. */ export const pluginDeserializeHtml = ( @@ -21,10 +53,9 @@ export const pluginDeserializeHtml = ( ): (Nullable & { node: AnyObject }) | undefined => { const { node: { isElement: isElementRoot, isLeaf: isLeafRoot }, - parsers, } = plugin; - const deserializer = parsers?.html?.deserializer; + const deserializer = getDeserializedWithStaticRules(plugin); if (!deserializer) return; @@ -115,7 +146,7 @@ export const pluginDeserializeHtml = ( ) { return; } - if (!parse) { + if (!parse) if (isElement) { parse = ({ type }) => ({ type: type }); } else if (isLeaf) { @@ -123,15 +154,25 @@ export const pluginDeserializeHtml = ( } else { return; } - } - let node = + const parsedNode = parse({ ...(getEditorPlugin(editor, plugin) as any), element: el, node: {}, }) ?? {}; + const dataNodeProps = getDataNodeProps({ + editor, + element: el, + plugin, + }); + + let node = { + ...parsedNode, + ...dataNodeProps, + }; + if (Object.keys(node).length === 0) return; const injectedPlugins = getInjectedPlugins(editor, plugin); diff --git a/packages/core/src/lib/plugins/paragraph/BaseParagraphPlugin.ts b/packages/core/src/lib/plugins/paragraph/BaseParagraphPlugin.ts index d62fc5b929..a36785d304 100644 --- a/packages/core/src/lib/plugins/paragraph/BaseParagraphPlugin.ts +++ b/packages/core/src/lib/plugins/paragraph/BaseParagraphPlugin.ts @@ -4,7 +4,9 @@ export type ParagraphConfig = PluginConfig<'p'>; export const BaseParagraphPlugin = createSlatePlugin({ key: 'p', - node: { isElement: true }, + node: { + isElement: true, + }, parsers: { html: { deserializer: { diff --git a/packages/core/src/lib/static/__tests__/create-static-editor.ts b/packages/core/src/lib/static/__tests__/create-static-editor.ts index ed10f6013d..fa14657fcf 100644 --- a/packages/core/src/lib/static/__tests__/create-static-editor.ts +++ b/packages/core/src/lib/static/__tests__/create-static-editor.ts @@ -40,6 +40,10 @@ import { BaseKbdPlugin } from '@udecode/plate-kbd'; import { BaseColumnItemPlugin, BaseColumnPlugin } from '@udecode/plate-layout'; import { BaseLineHeightPlugin } from '@udecode/plate-line-height'; import { BaseLinkPlugin } from '@udecode/plate-link'; +import { + BaseEquationPlugin, + BaseInlineEquationPlugin, +} from '@udecode/plate-math'; import { BaseAudioPlugin, BaseFilePlugin, @@ -64,6 +68,7 @@ import { ColumnElementStatic } from 'www/src/registry/default/plate-ui/column-el import { ColumnGroupElementStatic } from 'www/src/registry/default/plate-ui/column-group-element-static'; import { CommentLeafStatic } from 'www/src/registry/default/plate-ui/comment-leaf-static'; import { DateElementStatic } from 'www/src/registry/default/plate-ui/date-element-static'; +import { EquationElementStatic } from 'www/src/registry/default/plate-ui/equation-element-static'; import { HeadingElementStatic } from 'www/src/registry/default/plate-ui/heading-element-static'; import { HrElementStatic } from 'www/src/registry/default/plate-ui/hr-element-static'; import { ImageElementStatic } from 'www/src/registry/default/plate-ui/image-element-static'; @@ -75,6 +80,7 @@ import { TodoLiStatic, TodoMarkerStatic, } from 'www/src/registry/default/plate-ui/indent-todo-marker-static'; +import { InlineEquationElementStatic } from 'www/src/registry/default/plate-ui/inline-equation-element-static'; import { KbdLeafStatic } from 'www/src/registry/default/plate-ui/kbd-leaf-static'; import { LinkElementStatic } from 'www/src/registry/default/plate-ui/link-element-static'; import { MediaAudioElementStatic } from 'www/src/registry/default/plate-ui/media-audio-element-static'; @@ -175,6 +181,8 @@ export const createStaticEditor = (value: Value) => { BaseMentionPlugin, BaseCommentsPlugin, BaseTogglePlugin, + BaseEquationPlugin, + BaseInlineEquationPlugin, ], value, }); @@ -192,9 +200,11 @@ export const components = { [BaseColumnPlugin.key]: ColumnGroupElementStatic, [BaseCommentsPlugin.key]: CommentLeafStatic, [BaseDatePlugin.key]: DateElementStatic, + [BaseEquationPlugin.key]: EquationElementStatic, [BaseFilePlugin.key]: MediaFileElementStatic, [BaseHorizontalRulePlugin.key]: HrElementStatic, [BaseImagePlugin.key]: ImageElementStatic, + [BaseInlineEquationPlugin.key]: InlineEquationElementStatic, [BaseItalicPlugin.key]: withProps(SlateLeaf, { as: 'em' }), [BaseKbdPlugin.key]: KbdLeafStatic, [BaseLinkPlugin.key]: LinkElementStatic, diff --git a/packages/core/src/lib/static/__tests__/deserialize.spec.ts b/packages/core/src/lib/static/__tests__/deserialize.spec.ts new file mode 100644 index 0000000000..ffb831e554 --- /dev/null +++ b/packages/core/src/lib/static/__tests__/deserialize.spec.ts @@ -0,0 +1,75 @@ +import { alignValue } from 'www/src/registry/default/example/values/align-value'; +import { basicElementsValue } from 'www/src/registry/default/example/values/basic-elements-value'; +import { basicMarksValue } from 'www/src/registry/default/example/values/basic-marks-value'; +import { commentsValue } from 'www/src/registry/default/example/values/comments-value'; +import { dateValue } from 'www/src/registry/default/example/values/date-value'; +// import { equationValue } from 'www/src/registry/default/example/values/equation-value'; +import { highlightValue } from 'www/src/registry/default/example/values/highlight-value'; +import { horizontalRuleValue } from 'www/src/registry/default/example/values/horizontal-rule-value'; +import { indentListValue } from 'www/src/registry/default/example/values/indent-list-value'; +import { indentValue } from 'www/src/registry/default/example/values/indent-value'; +import { kbdValue } from 'www/src/registry/default/example/values/kbd-value'; +import { lineHeightValue } from 'www/src/registry/default/example/values/line-height-value'; +import { linkValue } from 'www/src/registry/default/example/values/link-value'; +import { mentionValue } from 'www/src/registry/default/example/values/mention-value'; +import { tocPlaygroundValue } from 'www/src/registry/default/example/values/toc-value'; + +import { serializeHtml } from '../serializeHtml'; +import { components, createStaticEditor } from './create-static-editor'; + +describe('deserializePlateStatic', () => { + it('should deserialize nodes', async () => { + const editor = createStaticEditor([ + ...basicElementsValue, + ...basicMarksValue, + ...tocPlaygroundValue, + ...linkValue, + ...horizontalRuleValue, + // ...tableValue, + // ...equationValue, + // ...columnValue, + ...mentionValue, + ...dateValue, + // ...fontValue, + ...highlightValue, + ...kbdValue, + ...commentsValue, + ...alignValue, + ...lineHeightValue, + ...indentValue, + ...indentListValue, + // ...mediaValue, + ]); + + const html = await serializeHtml(editor, { + components: components, + }); + + const nodes = editor.api.html.deserialize({ + collapseWhiteSpace: false, + element: html, + }); + + expect(nodes).toEqual([ + ...basicElementsValue, + ...basicMarksValue, + ...tocPlaygroundValue, + ...linkValue, + ...horizontalRuleValue, + // ...tableValue, + // ...equationValue, + // ...columnValue, + ...mentionValue, + ...dateValue, + // ...fontValue, + ...highlightValue, + ...kbdValue, + ...commentsValue, + ...alignValue, + ...lineHeightValue, + ...indentValue, + ...indentListValue, + // ...mediaValue, + ]); + }); +}); diff --git a/packages/core/src/lib/static/__tests__/marks.spec.ts b/packages/core/src/lib/static/__tests__/marks.spec.ts index 7c70383449..bd30bf0f30 100644 --- a/packages/core/src/lib/static/__tests__/marks.spec.ts +++ b/packages/core/src/lib/static/__tests__/marks.spec.ts @@ -20,7 +20,10 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('bold'); + + expect(html).toContain( + 'bold' + ); }); it('should serialize italic to html', async () => { @@ -41,7 +44,9 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('italic'); + expect(html).toContain( + 'italic' + ); }); it('should serialize underline to html', async () => { @@ -62,7 +67,9 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('underlined'); + expect(html).toContain( + 'underlined' + ); }); it('should serialize strikethrough to html', async () => { @@ -83,7 +90,9 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('strikethrough'); + expect(html).toContain( + 'strikethrough' + ); }); it('should serialize code to html', async () => { @@ -104,7 +113,9 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('some code'); + expect(html).toContain( + 'some code' + ); }); it('should serialize subscript to html', async () => { @@ -125,7 +136,9 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('subscripted'); + expect(html).toContain( + 'subscripted' + ); }); it('should serialize superscript to html', async () => { @@ -146,7 +159,9 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('superscripted'); + expect(html).toContain( + 'superscripted' + ); }); it('should serialize kbd to html', async () => { @@ -167,7 +182,9 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); - expect(html).toContain('keyboard shortcut'); + expect(html).toContain( + 'keyboard shortcut' + ); }); it('should serialize multiple marks together to html', async () => { @@ -188,8 +205,10 @@ describe('serializePlateStatic marks', () => { stripClassNames: true, stripDataAttributes: true, }); + + // FIXME: This is not working as expected a bit redundant for data attributes expect(html).toContain( - 'bold and italic' + 'bold and italic' ); }); }); diff --git a/packages/core/src/lib/static/__tests__/with-attributes.spec.ts b/packages/core/src/lib/static/__tests__/with-attributes.spec.ts index 4f8673fa77..457bf596de 100644 --- a/packages/core/src/lib/static/__tests__/with-attributes.spec.ts +++ b/packages/core/src/lib/static/__tests__/with-attributes.spec.ts @@ -17,7 +17,7 @@ describe('serializePlateStatic with attributes', () => { }); expect(html).toEqual( - '
    Right Aligned Heading
    ' + '
    Right Aligned Heading
    ' ); }); }); diff --git a/packages/core/src/lib/static/deserialize/checkUtils.ts b/packages/core/src/lib/static/deserialize/checkUtils.ts new file mode 100644 index 0000000000..23549f5de5 --- /dev/null +++ b/packages/core/src/lib/static/deserialize/checkUtils.ts @@ -0,0 +1,42 @@ +export const isSlateVoid = (element: HTMLElement) => { + return element.dataset.slateVoid === 'true'; +}; + +export const isSlateElement = (element: HTMLElement) => { + return element.dataset.slateNode === 'element'; +}; + +export const isSlateString = (element: HTMLElement) => { + return element.dataset.slateNode === 'text'; +}; + +export const isSlateLeaf = (element: HTMLElement) => { + return element.dataset.slateLeaf === 'true'; +}; + +export const isSlateNode = (element: HTMLElement) => { + return ( + isSlateLeaf(element) || + isSlateElement(element) || + isSlateVoid(element) || + isSlateString(element) + ); +}; + +export const isSlatePluginElement = ( + element: HTMLElement, + pluginKey: string +) => { + return ( + element.dataset.slateNode === 'element' && + element.classList.contains(`slate-${pluginKey}`) + ); +}; + +export const isSlatePluginNode = (element: HTMLElement, pluginKey: string) => { + return element.classList.contains(`slate-${pluginKey}`); +}; + +export const getSlateElements = (element: HTMLElement): HTMLElement[] => { + return Array.from(element.querySelectorAll('[data-slate-node="element"]')); +}; diff --git a/packages/core/src/lib/static/deserialize/htmlStringToEditorDOM.ts b/packages/core/src/lib/static/deserialize/htmlStringToEditorDOM.ts new file mode 100644 index 0000000000..a26a590b6e --- /dev/null +++ b/packages/core/src/lib/static/deserialize/htmlStringToEditorDOM.ts @@ -0,0 +1,13 @@ +/** + * Convert HTML string exported from Plate into HTML element. + * + * @param html - The HTML string to convert exported from Plate. + * @returns The Editor element without head and body. + */ +export const getEditorDOMFromHtmlString = (html: string) => { + const node = document.createElement('body'); + node.innerHTML = html; + const editorNode = node.querySelector('[data-slate-editor="true"]'); + + return editorNode as HTMLElement; +}; diff --git a/packages/core/src/lib/static/deserialize/index.ts b/packages/core/src/lib/static/deserialize/index.ts new file mode 100644 index 0000000000..00f3924a3f --- /dev/null +++ b/packages/core/src/lib/static/deserialize/index.ts @@ -0,0 +1,6 @@ +/** + * @file Automatically generated by barrelsby. + */ + +export * from './checkUtils'; +export * from './htmlStringToEditorDOM'; diff --git a/packages/core/src/lib/static/index.ts b/packages/core/src/lib/static/index.ts index 2e0c6e3f16..8ed19d8a2a 100644 --- a/packages/core/src/lib/static/index.ts +++ b/packages/core/src/lib/static/index.ts @@ -8,4 +8,5 @@ export * from './pluginRenderLeafStatic'; export * from './serializeHtml'; export * from './types'; export * from './components/index'; +export * from './deserialize/index'; export * from './utils/index'; diff --git a/packages/core/src/lib/static/pluginRenderElementStatic.tsx b/packages/core/src/lib/static/pluginRenderElementStatic.tsx index a4ce497f35..218c2635c0 100644 --- a/packages/core/src/lib/static/pluginRenderElementStatic.tsx +++ b/packages/core/src/lib/static/pluginRenderElementStatic.tsx @@ -5,6 +5,7 @@ import type { AnyEditorPlugin, NodeComponents } from '../plugin'; import type { RenderElementProps } from '../types/RenderElementProps'; import { SlateElement } from './components/SlateElement'; +import { getNodeDataAttributes } from './utils/getNodeDataAttributes'; import { getRenderNodeStaticProps } from './utils/getRenderNodeStaticProps'; export type SlateRenderElement = ( @@ -32,9 +33,15 @@ export const pluginRenderElementStatic = ( (o) => o.render?.belowNodes ?? [] ); + const dataAttributes = getNodeDataAttributes(editor, plugin, element); + nodeProps = getRenderNodeStaticProps({ - attributes: element.attributes as any, + attributes: { + ...(element.attributes as any), + ...dataAttributes, + }, editor, + node: element, plugin, props: nodeProps as any, }) as any; diff --git a/packages/core/src/lib/static/pluginRenderLeafStatic.tsx b/packages/core/src/lib/static/pluginRenderLeafStatic.tsx index 81abb77e92..5d8adcc313 100644 --- a/packages/core/src/lib/static/pluginRenderLeafStatic.tsx +++ b/packages/core/src/lib/static/pluginRenderLeafStatic.tsx @@ -5,6 +5,7 @@ import type { NodeComponents, SlatePlugin } from '../plugin'; import type { RenderLeafProps } from '../types/RenderLeafProps'; import { SlateLeaf } from './components/SlateLeaf'; +import { getNodeDataAttributes } from './utils/getNodeDataAttributes'; import { getRenderNodeStaticProps } from './utils/getRenderNodeStaticProps'; export type SlateRenderLeaf = ( @@ -22,9 +23,15 @@ export const pluginRenderLeafStatic = ( if (leaf[plugin.node.type ?? plugin.key]) { const Leaf = components?.[plugin.key] ?? SlateLeaf; + const dataAttributes = getNodeDataAttributes(editor, plugin, leaf); + const ctxProps = getRenderNodeStaticProps({ - attributes: leaf.attributes as any, + attributes: { + ...(leaf.attributes as any), + ...dataAttributes, + }, editor, + node: leaf, plugin, props: nodeProps as any, }) as any; diff --git a/packages/core/src/lib/static/utils/getNodeDataAttributes.ts b/packages/core/src/lib/static/utils/getNodeDataAttributes.ts new file mode 100644 index 0000000000..a85d6c501e --- /dev/null +++ b/packages/core/src/lib/static/utils/getNodeDataAttributes.ts @@ -0,0 +1,52 @@ +import { type TElement, type TText, TextApi } from '@udecode/slate'; +import kebabCase from 'lodash/kebabCase'; + +import type { SlateEditor } from '../../editor'; + +import { type AnyEditorPlugin, getEditorPlugin } from '../../plugin'; + +export const keyToDataAttribute = (key: string) => { + return `data-slate-${kebabCase(key)}`; +}; + +export const getNodeDataAttributes = ( + editor: SlateEditor, + plugin: AnyEditorPlugin, + node: TElement | TText +) => { + const dataAttributes = Object.keys(node).reduce((acc, key) => { + if (typeof node[key] === 'object') return acc; + + const isElement = plugin.node.isElement; + + const isLeaf = plugin.node.isLeaf; + + if (isElement && key === 'children') return acc; + if (isLeaf && key === 'text') return acc; + + const attributeName = keyToDataAttribute(key); + + return { + ...acc, + [attributeName]: node[key], + }; + }, {}); + + const customAttributes = + plugin.node.toDataAttributes?.({ + ...(plugin ? (getEditorPlugin(editor, plugin) as any) : {}), + node, + }) ?? {}; + + return { ...dataAttributes, ...customAttributes }; +}; + +export const getNodeDataAttributeKeys = (node: TElement | TText) => { + return Object.keys(node) + .filter( + (key) => + typeof node[key] !== 'object' && + (!TextApi.isText(node) || key !== 'text') + ) + .map((key) => keyToDataAttribute(key)); +}; diff --git a/packages/core/src/lib/static/utils/getRenderNodeStaticProps.ts b/packages/core/src/lib/static/utils/getRenderNodeStaticProps.ts index bbc4119da1..01a047fc72 100644 --- a/packages/core/src/lib/static/utils/getRenderNodeStaticProps.ts +++ b/packages/core/src/lib/static/utils/getRenderNodeStaticProps.ts @@ -1,3 +1,4 @@ +import type { TElement, TText } from '@udecode/slate'; import type { AnyObject } from '@udecode/utils'; import clsx from 'clsx'; @@ -13,16 +14,19 @@ import { getPluginNodeProps } from '../../utils/getPluginNodeProps'; export const getRenderNodeStaticProps = ({ attributes, editor, + node, plugin, props, }: { editor: SlateEditor; props: SlateRenderNodeProps; attributes?: AnyObject; + node?: TElement | TText; plugin?: AnyEditorPlugin; }): SlateRenderNodeProps => { props = getPluginNodeProps({ attributes, + node, plugin, props, }); diff --git a/packages/core/src/lib/static/utils/index.ts b/packages/core/src/lib/static/utils/index.ts index 416616d14c..f393fff9d8 100644 --- a/packages/core/src/lib/static/utils/index.ts +++ b/packages/core/src/lib/static/utils/index.ts @@ -3,6 +3,7 @@ */ export * from './createStaticString'; +export * from './getNodeDataAttributes'; export * from './getRenderNodeStaticProps'; export * from './pipeDecorate'; export * from './stripHtmlClassNames'; diff --git a/packages/core/src/lib/utils/getPluginNodeProps.ts b/packages/core/src/lib/utils/getPluginNodeProps.ts index 2100fd7e06..b726c4d392 100644 --- a/packages/core/src/lib/utils/getPluginNodeProps.ts +++ b/packages/core/src/lib/utils/getPluginNodeProps.ts @@ -1,17 +1,21 @@ +import type { TElement, TText } from '@udecode/slate'; import type { AnyObject } from '@udecode/utils'; import pick from 'lodash/pick.js'; import type { AnyEditorPlugin } from '../plugin'; -import type { SlateRenderNodeProps } from '../static'; + +import { type SlateRenderNodeProps, getNodeDataAttributeKeys } from '../static'; export const getPluginNodeProps = ({ attributes, + node, plugin, props, }: { props: SlateRenderNodeProps; attributes?: AnyObject; + node?: TElement | TText; plugin?: AnyEditorPlugin; }): any => { let newProps: AnyObject = {}; @@ -30,10 +34,10 @@ export const getPluginNodeProps = ({ * * @see {@link BasePluginNode.dangerouslyAllowAttributes} */ - newProps.nodeProps = pick( - attributes, - plugin.node.dangerouslyAllowAttributes ?? [] - ); + newProps.nodeProps = pick(attributes, [ + ...(plugin.node.dangerouslyAllowAttributes ?? []), + ...(node ? getNodeDataAttributeKeys(node) : []), + ]); } props = { ...props, ...newProps }; diff --git a/packages/docx/src/lib/DocxPlugin.ts b/packages/docx/src/lib/DocxPlugin.ts index dbf3e92c43..08cc3e4db8 100644 --- a/packages/docx/src/lib/DocxPlugin.ts +++ b/packages/docx/src/lib/DocxPlugin.ts @@ -3,6 +3,7 @@ import { type SlatePlugin, HtmlPlugin, createSlatePlugin, + isSlatePluginElement, } from '@udecode/plate'; import { cleanDocx } from './docx-cleaner/cleanDocx'; @@ -21,6 +22,9 @@ const getParse = ({ element }) => { const node: any = { type }; + if (isSlatePluginElement(element, type)) { + return node; + } if (isDocxList(element)) { node.indent = getDocxListIndent(element); diff --git a/packages/indent-list/src/lib/BaseIndentListPlugin.ts b/packages/indent-list/src/lib/BaseIndentListPlugin.ts index cb621f78c9..09cbcb1b79 100644 --- a/packages/indent-list/src/lib/BaseIndentListPlugin.ts +++ b/packages/indent-list/src/lib/BaseIndentListPlugin.ts @@ -90,12 +90,24 @@ export const BaseIndentListPlugin = createTSlatePlugin({ html: { deserializer: { isElement: true, - parse: ({ editor, element, getOptions }) => ({ - // gdoc uses aria-level attribute - indent: Number(element.getAttribute('aria-level')), - listStyleType: getOptions().getListStyleType?.(element), - type: editor.getType(BaseParagraphPlugin), - }), + parse: ({ editor, element, getOptions }) => { + const parent = element.parentElement; + + if ( + parent && + (parent.classList.contains('slate-ol') || + parent.classList.contains('slate-ul')) + ) { + return; + } + + return { + // gdoc uses aria-level attribute + indent: Number(element.getAttribute('aria-level')), + listStyleType: getOptions().getListStyleType?.(element), + type: editor.getType(BaseParagraphPlugin), + }; + }, rules: [ { validNodeName: 'LI', diff --git a/packages/layout/src/lib/BaseColumnPlugin.ts b/packages/layout/src/lib/BaseColumnPlugin.ts index 33b425eba8..a233f565a0 100644 --- a/packages/layout/src/lib/BaseColumnPlugin.ts +++ b/packages/layout/src/lib/BaseColumnPlugin.ts @@ -4,11 +4,40 @@ import { withColumn } from './withColumn'; export const BaseColumnItemPlugin = createSlatePlugin({ key: 'column', - node: { isElement: true }, + node: { + isElement: true, + }, }).overrideEditor(withColumn); export const BaseColumnPlugin = createSlatePlugin({ key: 'column_group', - node: { isElement: true }, + node: { + // dangerouslyAllowAttributes: [keyToDataAttribute('layout')], + isElement: true, + // toDataAttributes: ({ node }) => { + // if (node.layout as TColumnGroupElement['layout']) { + // return { + // [keyToDataAttribute('layout')]: JSON.stringify(node.layout), + // }; + // } + // }, + }, + parsers: { + html: { + deserializer: { + // toNodeProps: ({ element }) => { + // const dangerouslyLayoutString = element.getAttribute( + // keyToDataAttribute('layout') + // ); + // if (!dangerouslyLayoutString) return; + // const layout = JSON.parse(dangerouslyLayoutString); + // if (!Array.isArray(layout)) return; + // return { + // layout: layout, + // }; + // }, + }, + }, + }, plugins: [BaseColumnItemPlugin], }); diff --git a/packages/layout/src/lib/types.ts b/packages/layout/src/lib/types.ts index 53bfa0517c..5321a287d6 100644 --- a/packages/layout/src/lib/types.ts +++ b/packages/layout/src/lib/types.ts @@ -10,4 +10,5 @@ export interface TColumnGroupElement extends TElement { children: TColumnElement[]; type: 'column_group'; id?: string; + layout?: number[]; } diff --git a/packages/line-height/src/lib/BaseLineHeightPlugin.ts b/packages/line-height/src/lib/BaseLineHeightPlugin.ts index 707e41c025..12e9d2972d 100644 --- a/packages/line-height/src/lib/BaseLineHeightPlugin.ts +++ b/packages/line-height/src/lib/BaseLineHeightPlugin.ts @@ -1,4 +1,8 @@ -import { BaseParagraphPlugin, createSlatePlugin } from '@udecode/plate'; +import { + BaseParagraphPlugin, + createSlatePlugin, + isSlatePluginElement, +} from '@udecode/plate'; /** * Enables support for text alignment, useful to align your content to left, @@ -16,7 +20,10 @@ export const BaseLineHeightPlugin = createSlatePlugin({ parsers: { html: { deserializer: { - parse: ({ element, node }) => { + parse: ({ element, node, type }) => { + if (isSlatePluginElement(element, type)) { + return { type }; + } if (element.style.lineHeight) { node[editor.getType(plugin)] = element.style.lineHeight; } diff --git a/packages/media/src/lib/image/BaseImagePlugin.ts b/packages/media/src/lib/image/BaseImagePlugin.ts index 59aae7413e..a8a6156a81 100644 --- a/packages/media/src/lib/image/BaseImagePlugin.ts +++ b/packages/media/src/lib/image/BaseImagePlugin.ts @@ -2,6 +2,7 @@ import { type PluginConfig, bindFirst, createTSlatePlugin, + isSlatePluginElement, } from '@udecode/plate'; import type { MediaPluginOptions, TMediaElement } from '../media'; @@ -55,10 +56,16 @@ export const BaseImagePlugin = createTSlatePlugin({ parsers: { html: { deserializer: { - parse: ({ element }) => ({ - type: plugin.node.type, - url: element.getAttribute('src'), - }), + parse: ({ element, type }) => { + if (isSlatePluginElement(element as HTMLElement, type)) { + return; + } + + return { + type: plugin.node.type, + url: element.getAttribute('src'), + }; + }, rules: [ { validNodeName: 'IMG', diff --git a/packages/table/src/lib/BaseTablePlugin.ts b/packages/table/src/lib/BaseTablePlugin.ts index 25c9e150a5..86e0316040 100644 --- a/packages/table/src/lib/BaseTablePlugin.ts +++ b/packages/table/src/lib/BaseTablePlugin.ts @@ -6,6 +6,7 @@ import { bindFirst, createSlatePlugin, createTSlatePlugin, + isSlatePluginElement, } from '@udecode/plate'; import type { TTableCellElement } from './types'; @@ -174,7 +175,17 @@ type TableTransforms = { export const BaseTablePlugin = createTSlatePlugin({ key: 'table', // dependencies: [NodeIdPlugin.key], - node: { isElement: true }, + node: { + // dangerouslyAllowAttributes: [keyToDataAttribute('colSizes')], + isElement: true, + // toDataAttributes: ({ node }) => { + // if (node.colSizes as TTableElement['colSizes']) { + // return { + // [keyToDataAttribute('colSizes')]: JSON.stringify(node.colSizes), + // }; + // } + // }, + }, normalizeInitialValue: normalizeInitialValueTable, options: { _cellIndices: {}, @@ -184,7 +195,35 @@ export const BaseTablePlugin = createTSlatePlugin({ parsers: { html: { deserializer: { + parse: ({ element, type }) => { + const parent = element.parentNode?.parentNode; + + if ( + parent && + element.tagName === 'TABLE' && + isSlatePluginElement(parent as HTMLElement, type) + ) { + return; + } + + return { type }; + }, rules: [{ validNodeName: 'TABLE' }], + // toNodeProps: ({ element }) => { + // const dangerouslyColSizesString = element.getAttribute( + // keyToDataAttribute('colSizes') + // ); + + // if (!dangerouslyColSizesString) return; + + // const colSizes = JSON.parse(dangerouslyColSizesString); + + // if (!Array.isArray(colSizes)) return; + + // return { + // colSizes: colSizes, + // }; + // }, }, }, }, diff --git a/yarn.lock b/yarn.lock index 6983c1b77e..54fa1d1a9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1852,13 +1852,33 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.6.1, @eslint-community/regexpp@npm:^4.8.0": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.12.1, @eslint-community/regexpp@npm:^4.6.1, @eslint-community/regexpp@npm:^4.8.0": version: 4.12.1 resolution: "@eslint-community/regexpp@npm:4.12.1" checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard +"@eslint/config-array@npm:^0.19.0": + version: 0.19.1 + resolution: "@eslint/config-array@npm:0.19.1" + dependencies: + "@eslint/object-schema": "npm:^2.1.5" + debug: "npm:^4.3.1" + minimatch: "npm:^3.1.2" + checksum: 10c0/43b01f596ddad404473beae5cf95c013d29301c72778d0f5bf8a6699939c8a9a5663dbd723b53c5f476b88b0c694f76ea145d1aa9652230d140fe1161e4a4b49 + languageName: node + linkType: hard + +"@eslint/core@npm:^0.9.0": + version: 0.9.1 + resolution: "@eslint/core@npm:0.9.1" + dependencies: + "@types/json-schema": "npm:^7.0.15" + checksum: 10c0/638104b1b5833a9bbf2329f0c0ddf322e4d6c0410b149477e02cd2b78c04722be90c14b91b8ccdef0d63a2404dff72a17b6b412ce489ea429ae6a8fcb8abff28 + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^2.1.4": version: 2.1.4 resolution: "@eslint/eslintrc@npm:2.1.4" @@ -1876,6 +1896,23 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^3.2.0": + version: 3.2.0 + resolution: "@eslint/eslintrc@npm:3.2.0" + dependencies: + ajv: "npm:^6.12.4" + debug: "npm:^4.3.2" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" + ignore: "npm:^5.2.0" + import-fresh: "npm:^3.2.1" + js-yaml: "npm:^4.1.0" + minimatch: "npm:^3.1.2" + strip-json-comments: "npm:^3.1.1" + checksum: 10c0/43867a07ff9884d895d9855edba41acf325ef7664a8df41d957135a81a477ff4df4196f5f74dc3382627e5cc8b7ad6b815c2cea1b58f04a75aced7c43414ab8b + languageName: node + linkType: hard + "@eslint/js@npm:8.57.1": version: 8.57.1 resolution: "@eslint/js@npm:8.57.1" @@ -1883,6 +1920,29 @@ __metadata: languageName: node linkType: hard +"@eslint/js@npm:9.17.0": + version: 9.17.0 + resolution: "@eslint/js@npm:9.17.0" + checksum: 10c0/a0fda8657a01c60aa540f95397754267ba640ffb126e011b97fd65c322a94969d161beeaef57c1441c495da2f31167c34bd38209f7c146c7225072378c3a933d + languageName: node + linkType: hard + +"@eslint/object-schema@npm:^2.1.5": + version: 2.1.5 + resolution: "@eslint/object-schema@npm:2.1.5" + checksum: 10c0/5320691ed41ecd09a55aff40ce8e56596b4eb81f3d4d6fe530c50fdd6552d88102d1c1a29d970ae798ce30849752a708772de38ded07a6f25b3da32ebea081d8 + languageName: node + linkType: hard + +"@eslint/plugin-kit@npm:^0.2.3": + version: 0.2.4 + resolution: "@eslint/plugin-kit@npm:0.2.4" + dependencies: + levn: "npm:^0.4.1" + checksum: 10c0/1bcfc0a30b1df891047c1d8b3707833bded12a057ba01757a2a8591fdc8d8fe0dbb8d51d4b0b61b2af4ca1d363057abd7d2fb4799f1706b105734f4d3fa0dbf1 + languageName: node + linkType: hard + "@excalidraw/excalidraw@npm:0.16.4": version: 0.16.4 resolution: "@excalidraw/excalidraw@npm:0.16.4" @@ -1908,21 +1968,21 @@ __metadata: linkType: hard "@floating-ui/core@npm:^1.6.0, @floating-ui/core@npm:^1.6.7": - version: 1.6.9 - resolution: "@floating-ui/core@npm:1.6.9" + version: 1.6.8 + resolution: "@floating-ui/core@npm:1.6.8" dependencies: - "@floating-ui/utils": "npm:^0.2.9" - checksum: 10c0/77debdfc26bc36c6f5ae1f26ab3c15468215738b3f5682af4e1915602fa21ba33ad210273f31c9d2da1c531409929e1afb1138b1608c6b54a0f5853ee84c340d + "@floating-ui/utils": "npm:^0.2.8" + checksum: 10c0/d6985462aeccae7b55a2d3f40571551c8c42bf820ae0a477fc40ef462e33edc4f3f5b7f11b100de77c9b58ecb581670c5c3f46d0af82b5e30aa185c735257eb9 languageName: node linkType: hard "@floating-ui/dom@npm:^1.0.0": - version: 1.6.13 - resolution: "@floating-ui/dom@npm:1.6.13" + version: 1.6.12 + resolution: "@floating-ui/dom@npm:1.6.12" dependencies: "@floating-ui/core": "npm:^1.6.0" - "@floating-ui/utils": "npm:^0.2.9" - checksum: 10c0/272242d2eb6238ffcee0cb1f3c66e0eafae804d5d7b449db5ecf904bc37d31ad96cf575a9e650b93c1190f64f49a684b1559d10e05ed3ec210628b19116991a9 + "@floating-ui/utils": "npm:^0.2.8" + checksum: 10c0/c67b39862175b175c6ac299ea970f17a22c7482cfdf3b1bc79313407bf0880188b022b878953fa69d3ce166ff2bd9ae57c86043e5dd800c262b470d877591b7d languageName: node linkType: hard @@ -1952,7 +2012,7 @@ __metadata: languageName: node linkType: hard -"@floating-ui/utils@npm:^0.2.8, @floating-ui/utils@npm:^0.2.9": +"@floating-ui/utils@npm:^0.2.8": version: 0.2.9 resolution: "@floating-ui/utils@npm:0.2.9" checksum: 10c0/48bbed10f91cb7863a796cc0d0e917c78d11aeb89f98d03fc38d79e7eb792224a79f538ed8a2d5d5584511d4ca6354ef35f1712659fd569868e342df4398ad6f @@ -2016,6 +2076,23 @@ __metadata: languageName: node linkType: hard +"@humanfs/core@npm:^0.19.1": + version: 0.19.1 + resolution: "@humanfs/core@npm:0.19.1" + checksum: 10c0/aa4e0152171c07879b458d0e8a704b8c3a89a8c0541726c6b65b81e84fd8b7564b5d6c633feadc6598307d34564bd53294b533491424e8e313d7ab6c7bc5dc67 + languageName: node + linkType: hard + +"@humanfs/node@npm:^0.16.6": + version: 0.16.6 + resolution: "@humanfs/node@npm:0.16.6" + dependencies: + "@humanfs/core": "npm:^0.19.1" + "@humanwhocodes/retry": "npm:^0.3.0" + checksum: 10c0/8356359c9f60108ec204cbd249ecd0356667359b2524886b357617c4a7c3b6aace0fd5a369f63747b926a762a88f8a25bc066fa1778508d110195ce7686243e1 + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.13.0": version: 0.13.0 resolution: "@humanwhocodes/config-array@npm:0.13.0" @@ -2041,6 +2118,20 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/retry@npm:^0.3.0": + version: 0.3.1 + resolution: "@humanwhocodes/retry@npm:0.3.1" + checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b + languageName: node + linkType: hard + +"@humanwhocodes/retry@npm:^0.4.1": + version: 0.4.1 + resolution: "@humanwhocodes/retry@npm:0.4.1" + checksum: 10c0/be7bb6841c4c01d0b767d9bb1ec1c9359ee61421ce8ba66c249d035c5acdfd080f32d55a5c9e859cdd7868788b8935774f65b2caf24ec0b7bd7bf333791f063b + languageName: node + linkType: hard + "@ianvs/prettier-plugin-sort-imports@npm:^4.3.1": version: 4.4.0 resolution: "@ianvs/prettier-plugin-sort-imports@npm:4.4.0" @@ -4679,143 +4770,143 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.30.1" +"@rollup/rollup-android-arm-eabi@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.29.2" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-android-arm64@npm:4.30.1" +"@rollup/rollup-android-arm64@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-android-arm64@npm:4.29.2" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-darwin-arm64@npm:4.30.1" +"@rollup/rollup-darwin-arm64@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-darwin-arm64@npm:4.29.2" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-darwin-x64@npm:4.30.1" +"@rollup/rollup-darwin-x64@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-darwin-x64@npm:4.29.2" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.30.1" +"@rollup/rollup-freebsd-arm64@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.29.2" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-freebsd-x64@npm:4.30.1" +"@rollup/rollup-freebsd-x64@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-freebsd-x64@npm:4.29.2" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.30.1" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.29.2" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.30.1" +"@rollup/rollup-linux-arm-musleabihf@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.29.2" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.30.1" +"@rollup/rollup-linux-arm64-gnu@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.29.2" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.30.1" +"@rollup/rollup-linux-arm64-musl@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.29.2" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-loongarch64-gnu@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.30.1" +"@rollup/rollup-linux-loongarch64-gnu@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.29.2" conditions: os=linux & cpu=loong64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.30.1" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.29.2" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.30.1" +"@rollup/rollup-linux-riscv64-gnu@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.29.2" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.30.1" +"@rollup/rollup-linux-s390x-gnu@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.29.2" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.30.1" +"@rollup/rollup-linux-x64-gnu@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.29.2" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.30.1" +"@rollup/rollup-linux-x64-musl@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.29.2" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.30.1" +"@rollup/rollup-win32-arm64-msvc@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.29.2" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.30.1" +"@rollup/rollup-win32-ia32-msvc@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.29.2" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.30.1": - version: 4.30.1 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.30.1" +"@rollup/rollup-win32-x64-msvc@npm:4.29.2": + version: 4.29.2 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.29.2" conditions: os=win32 & cpu=x64 languageName: node linkType: hard "@rushstack/eslint-patch@npm:^1.10.3": - version: 1.10.5 - resolution: "@rushstack/eslint-patch@npm:1.10.5" - checksum: 10c0/ea66e8be3a78a48d06e8ff33221cef5749386589236bbcd24013577d2b4e1035e3dc919740c6e0f16d44c1e0b62d06d00898508fc74cc2adb0ac6b667aa5a8e4 + version: 1.10.4 + resolution: "@rushstack/eslint-patch@npm:1.10.4" + checksum: 10c0/de312bd7a3cb0f313c9720029eb719d8762fe54946cce2d33ac142b1cbb5817c4a5a92518dfa476c26311602d37f5a8f7caa90a0c73e3d6a56f9a05d2799c172 languageName: node linkType: hard @@ -5156,8 +5247,8 @@ __metadata: linkType: hard "@tailwindcss/typography@npm:^0.5.15": - version: 0.5.16 - resolution: "@tailwindcss/typography@npm:0.5.16" + version: 0.5.15 + resolution: "@tailwindcss/typography@npm:0.5.15" dependencies: lodash.castarray: "npm:^4.4.0" lodash.isplainobject: "npm:^4.0.6" @@ -5165,7 +5256,7 @@ __metadata: postcss-selector-parser: "npm:6.0.10" peerDependencies: tailwindcss: "*" - checksum: 10c0/35a7387876810c23c270a23848b920517229b707c8ead6a63c8bb7d6720a62f23728c3117f0a93b422a66d1e5ee9c7ad8a6c3f0fbf5255b535c0e4971ffa0158 + checksum: 10c0/bd1a1d0ab06816afe129a49cb8a693b4f6ffe77748f5279f07ea29ea9fcb44ef24d1f8b1cfcffaf41dd9cb60065745897cbfc9dcabc57c8a60ceb89d594c97c6 languageName: node linkType: hard @@ -5425,7 +5516,7 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:1.0.6, @types/estree@npm:^1.0.0": +"@types/estree@npm:*, @types/estree@npm:1.0.6, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.6": version: 1.0.6 resolution: "@types/estree@npm:1.0.6" checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a @@ -5529,7 +5620,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.15, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db @@ -5631,11 +5722,11 @@ __metadata: linkType: hard "@types/node@npm:^18.16.3": - version: 18.19.70 - resolution: "@types/node@npm:18.19.70" + version: 18.19.69 + resolution: "@types/node@npm:18.19.69" dependencies: undici-types: "npm:~5.26.4" - checksum: 10c0/68866e53b92be60d8840f5c93232d3ae39c71663101decc1d4f1870d9236c3c89e74177b616c2a2cabce116b1356f3e89c57df3e969c9f9b0e0b5c59b5f790f7 + checksum: 10c0/f10ae0d07bde6b80c02702ecd470c0f710cc2fde48d8cea4140cb7d7715c0b944ca5d9b730e4b56ba9d96f1eb459739da71c54e88586fc6b911600ea1e70af4e languageName: node linkType: hard @@ -5730,11 +5821,11 @@ __metadata: linkType: hard "@types/react@npm:*": - version: 19.0.4 - resolution: "@types/react@npm:19.0.4" + version: 19.0.2 + resolution: "@types/react@npm:19.0.2" dependencies: csstype: "npm:^3.0.2" - checksum: 10c0/96ecd1a73af57fd7b7facf5b36ec069b131c7608a98a0f1098183023bfb21c60a26a0dc09004fbe0ac70c436ef887bbec5690882cfb77c6e0c679f7e45987722 + checksum: 10c0/8992f39701fcf1bf893ef8f94a56196445667baf08fe4f6050a14e229a17aad3265ad3efc01595ff3b4d5d5c69da885f9aa4ff80f164a613018734efcff1eb8f languageName: node linkType: hard @@ -5867,39 +5958,39 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/eslint-plugin@npm:^8.5.0": - version: 8.19.1 - resolution: "@typescript-eslint/eslint-plugin@npm:8.19.1" + version: 8.19.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.19.0" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.19.1" - "@typescript-eslint/type-utils": "npm:8.19.1" - "@typescript-eslint/utils": "npm:8.19.1" - "@typescript-eslint/visitor-keys": "npm:8.19.1" + "@typescript-eslint/scope-manager": "npm:8.19.0" + "@typescript-eslint/type-utils": "npm:8.19.0" + "@typescript-eslint/utils": "npm:8.19.0" + "@typescript-eslint/visitor-keys": "npm:8.19.0" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" - ts-api-utils: "npm:^2.0.0" + ts-api-utils: "npm:^1.3.0" peerDependencies: "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/993784b04533b13c3f3919c793cfc3a369fa61692e1a2d72de6fba27df247c275d852cdcbc4e393c310b73fce8d34d210a9b632b66f4d761a1a3b4781f8fa93f + checksum: 10c0/ceaa5063b68684b5608950b5e69f0caf1eadfc356cba82625240d6aae55f769faff599c38d35252dcb77a40d92e6fbf6d6264bc0c577d5c549da25061c3bd796 languageName: node linkType: hard "@typescript-eslint/parser@npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/parser@npm:^8.5.0": - version: 8.19.1 - resolution: "@typescript-eslint/parser@npm:8.19.1" + version: 8.19.0 + resolution: "@typescript-eslint/parser@npm:8.19.0" dependencies: - "@typescript-eslint/scope-manager": "npm:8.19.1" - "@typescript-eslint/types": "npm:8.19.1" - "@typescript-eslint/typescript-estree": "npm:8.19.1" - "@typescript-eslint/visitor-keys": "npm:8.19.1" + "@typescript-eslint/scope-manager": "npm:8.19.0" + "@typescript-eslint/types": "npm:8.19.0" + "@typescript-eslint/typescript-estree": "npm:8.19.0" + "@typescript-eslint/visitor-keys": "npm:8.19.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/1afbd2d0a25f439943bdc94637417429574eb3889a2a1ce24bd425721713aca213808a975bb518a6616171783bc04fa973167f05fc6a96cfd88c1d1666077ad4 + checksum: 10c0/064b0997963060490fc3f92c90cebc7c694f47a7657f7882ce9eb314786e0cf3e917bfccfad614d23038439d84e69a978bdc7054515b23201001dd427e524e64 languageName: node linkType: hard @@ -5913,6 +6004,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:8.19.0": + version: 8.19.0 + resolution: "@typescript-eslint/scope-manager@npm:8.19.0" + dependencies: + "@typescript-eslint/types": "npm:8.19.0" + "@typescript-eslint/visitor-keys": "npm:8.19.0" + checksum: 10c0/5052863d00db7ae939de27e91dc6c92df3c37a877e1ff44015ae9aa754d419b44d97d98b25fbb30a80dc58cf92606dad599e27f32b86d20c13b77ac12b4f2abc + languageName: node + linkType: hard + "@typescript-eslint/scope-manager@npm:8.19.1": version: 8.19.1 resolution: "@typescript-eslint/scope-manager@npm:8.19.1" @@ -5923,18 +6024,18 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.19.1": - version: 8.19.1 - resolution: "@typescript-eslint/type-utils@npm:8.19.1" +"@typescript-eslint/type-utils@npm:8.19.0": + version: 8.19.0 + resolution: "@typescript-eslint/type-utils@npm:8.19.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:8.19.1" - "@typescript-eslint/utils": "npm:8.19.1" + "@typescript-eslint/typescript-estree": "npm:8.19.0" + "@typescript-eslint/utils": "npm:8.19.0" debug: "npm:^4.3.4" - ts-api-utils: "npm:^2.0.0" + ts-api-utils: "npm:^1.3.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/757592b515beec58c079c605aa648ba94d985ae48ba40460034e849c7bc2b603b1da6113e59688e284608c9d5ccaa27adf0a14fb032cb1782200c6acae51ddd2 + checksum: 10c0/5a460b4d26fd68ded3567390cbac310500e94e9c69583fda3fb9930877663719e6831699bb6d85de6b940bcb7951a51ab1ef67c5fea8b76a13ea3a3783bbae28 languageName: node linkType: hard @@ -5945,6 +6046,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.19.0": + version: 8.19.0 + resolution: "@typescript-eslint/types@npm:8.19.0" + checksum: 10c0/0062e7dce5f374e293c97f1f50fe450187f6b0eaf4971c818e18ef2f6baf4e9aa4e8605fba8d8fc464a504ee1130527b71ecb39d31687c31825942b9f569d902 + languageName: node + linkType: hard + "@typescript-eslint/types@npm:8.19.1, @typescript-eslint/types@npm:^8.9.0": version: 8.19.1 resolution: "@typescript-eslint/types@npm:8.19.1" @@ -5970,6 +6078,24 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:8.19.0": + version: 8.19.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.19.0" + dependencies: + "@typescript-eslint/types": "npm:8.19.0" + "@typescript-eslint/visitor-keys": "npm:8.19.0" + debug: "npm:^4.3.4" + fast-glob: "npm:^3.3.2" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependencies: + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/ff47004588e8ff585af740b3e0bda07dc52310dbfeb2317eb4a723935740cf0c1953fc9ba57f14cf192bcfe373c46be833ba29d3303df8b501181bb852c7b822 + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:8.19.1": version: 8.19.1 resolution: "@typescript-eslint/typescript-estree@npm:8.19.1" @@ -5988,18 +6114,18 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.19.1, @typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@npm:^8.9.0": - version: 8.19.1 - resolution: "@typescript-eslint/utils@npm:8.19.1" +"@typescript-eslint/utils@npm:8.19.0": + version: 8.19.0 + resolution: "@typescript-eslint/utils@npm:8.19.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.19.1" - "@typescript-eslint/types": "npm:8.19.1" - "@typescript-eslint/typescript-estree": "npm:8.19.1" + "@typescript-eslint/scope-manager": "npm:8.19.0" + "@typescript-eslint/types": "npm:8.19.0" + "@typescript-eslint/typescript-estree": "npm:8.19.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/f7d2fe9a2bd8cb3ae6fafe5e465882a6784b2acf81d43d194c579381b92651c2ffc0fca69d2a35eee119f539622752a0e9ec063aaec7576d5d2bfe68b441980d + checksum: 10c0/7731f7fb66d54491769ca68fd04728138ceb6b785778ad491f8e9b2147802fa0ff480e520f6ea5fb73c8484d13a2ed3e35d44635f5bf4cfbdb04c313154097a9 languageName: node linkType: hard @@ -6021,6 +6147,21 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@npm:^8.9.0": + version: 8.19.1 + resolution: "@typescript-eslint/utils@npm:8.19.1" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:8.19.1" + "@typescript-eslint/types": "npm:8.19.1" + "@typescript-eslint/typescript-estree": "npm:8.19.1" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/f7d2fe9a2bd8cb3ae6fafe5e465882a6784b2acf81d43d194c579381b92651c2ffc0fca69d2a35eee119f539622752a0e9ec063aaec7576d5d2bfe68b441980d + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" @@ -6031,6 +6172,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:8.19.0": + version: 8.19.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.19.0" + dependencies: + "@typescript-eslint/types": "npm:8.19.0" + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/a293def05018bb2259506e23cd8f14349f4386d0e51231893fbddf96ef73c219d5f9fe17b82e3c104f5c23956dbd9b87af3cff5e84b887af243139a3b4bbbe0d + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:8.19.1": version: 8.19.1 resolution: "@typescript-eslint/visitor-keys@npm:8.19.1" @@ -6991,7 +7142,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.11.3, acorn@npm:^8.4.1, acorn@npm:^8.8.1, acorn@npm:^8.9.0": +"acorn@npm:^8.0.0, acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.11.3, acorn@npm:^8.14.0, acorn@npm:^8.4.1, acorn@npm:^8.8.1, acorn@npm:^8.9.0": version: 8.14.0 resolution: "acorn@npm:8.14.0" bin: @@ -7528,9 +7679,9 @@ __metadata: linkType: hard "bare-events@npm:^2.0.0, bare-events@npm:^2.2.0": - version: 2.5.3 - resolution: "bare-events@npm:2.5.3" - checksum: 10c0/fc78e068cd1c7e75ab027121b69f104e315af122f10263734a1f3a7c5a8e2e5934d9a46638f5c9eafadf84d64c01fd87cd3169da4f7f8046df29a17fb1c532f5 + version: 2.5.1 + resolution: "bare-events@npm:2.5.1" + checksum: 10c0/7ea9c491ff3a51cc2c7ea2ac8d459c7db2408bc31bc82cac73ba45a466f0e223194771782fa410cbe00b6553b67e7947f2d830c355b53922972ade20397e7abf languageName: node linkType: hard @@ -7680,7 +7831,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.23.3, browserslist@npm:^4.24.0, browserslist@npm:^4.24.3": +"browserslist@npm:^4.23.3, browserslist@npm:^4.24.0": version: 4.24.4 resolution: "browserslist@npm:4.24.4" dependencies: @@ -7694,6 +7845,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.24.2": + version: 4.24.3 + resolution: "browserslist@npm:4.24.3" + dependencies: + caniuse-lite: "npm:^1.0.30001688" + electron-to-chromium: "npm:^1.5.73" + node-releases: "npm:^2.0.19" + update-browserslist-db: "npm:^1.1.1" + bin: + browserslist: cli.js + checksum: 10c0/bab261ef7b6e1656a719a9fa31240ae7ce4d5ba68e479f6b11e348d819346ab4c0ff6f4821f43adcc9c193a734b186775a83b37979e70a69d182965909fe569a + languageName: node + linkType: hard + "bs-logger@npm:^0.2.6": version: 0.2.6 resolution: "bs-logger@npm:0.2.6" @@ -7889,9 +8054,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001579, caniuse-lite@npm:^1.0.30001646, caniuse-lite@npm:^1.0.30001688": - version: 1.0.30001692 - resolution: "caniuse-lite@npm:1.0.30001692" - checksum: 10c0/fca5105561ea12f3de593f3b0f062af82f7d07519e8dbcb97f34e7fd23349bcef1b1622a9a6cd2164d98e3d2f20059ef7e271edae46567aef88caf4c16c7708a + version: 1.0.30001690 + resolution: "caniuse-lite@npm:1.0.30001690" + checksum: 10c0/646bd469032afa90400a84dec30a2b00a6eda62c03ead358117e3f884cda8aacec02ec058a6dbee5eaf9714f83e483b9b0eb4fb42febb8076569f5ca40f1d347 languageName: node linkType: hard @@ -8454,11 +8619,11 @@ __metadata: linkType: hard "core-js-compat@npm:^3.37.0": - version: 3.40.0 - resolution: "core-js-compat@npm:3.40.0" + version: 3.39.0 + resolution: "core-js-compat@npm:3.39.0" dependencies: - browserslist: "npm:^4.24.3" - checksum: 10c0/44f6e88726fe266a5be9581a79766800478a8d5c492885f2d4c2a4e2babd9b06bc1689d5340d3a61ae7332f990aff2e83b6203ff8773137a627cfedfbeefabeb + browserslist: "npm:^4.24.2" + checksum: 10c0/880579a3dab235e3b6350f1e324269c600753b48e891ea859331618d5051e68b7a95db6a03ad2f3cc7df4397318c25a5bc7740562ad39e94f56568638d09d414 languageName: node linkType: hard @@ -8539,7 +8704,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5, cross-spawn@npm:^7.0.6": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -9190,9 +9355,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.5.73": - version: 1.5.80 - resolution: "electron-to-chromium@npm:1.5.80" - checksum: 10c0/6aaf1891e1b05251efac6f4a63c0ddccf567f0f76506cf0cb284f11413762423fddd7786558066f74c3a95e2a533dad7a97bebe38779b46b7a799d8dd20cea53 + version: 1.5.76 + resolution: "electron-to-chromium@npm:1.5.76" + checksum: 10c0/5a977be9fd5810769a7b4eae0e4b41b6beca65f2b3f3b7442819f6c93366d767d183cfbf408714f944a9bf3aa304f8c9ab9d0cdfd8e878ab8f2cbb61f8b22acd languageName: node linkType: hard @@ -10417,6 +10582,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^8.2.0": + version: 8.2.0 + resolution: "eslint-scope@npm:8.2.0" + dependencies: + esrecurse: "npm:^4.3.0" + estraverse: "npm:^5.2.0" + checksum: 10c0/8d2d58e2136d548ac7e0099b1a90d9fab56f990d86eb518de1247a7066d38c908be2f3df477a79cf60d70b30ba18735d6c6e70e9914dca2ee515a729975d70d6 + languageName: node + linkType: hard + "eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" @@ -10479,6 +10654,66 @@ __metadata: languageName: node linkType: hard +"eslint@npm:^9.17.0": + version: 9.17.0 + resolution: "eslint@npm:9.17.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.2.0" + "@eslint-community/regexpp": "npm:^4.12.1" + "@eslint/config-array": "npm:^0.19.0" + "@eslint/core": "npm:^0.9.0" + "@eslint/eslintrc": "npm:^3.2.0" + "@eslint/js": "npm:9.17.0" + "@eslint/plugin-kit": "npm:^0.2.3" + "@humanfs/node": "npm:^0.16.6" + "@humanwhocodes/module-importer": "npm:^1.0.1" + "@humanwhocodes/retry": "npm:^0.4.1" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" + ajv: "npm:^6.12.4" + chalk: "npm:^4.0.0" + cross-spawn: "npm:^7.0.6" + debug: "npm:^4.3.2" + escape-string-regexp: "npm:^4.0.0" + eslint-scope: "npm:^8.2.0" + eslint-visitor-keys: "npm:^4.2.0" + espree: "npm:^10.3.0" + esquery: "npm:^1.5.0" + esutils: "npm:^2.0.2" + fast-deep-equal: "npm:^3.1.3" + file-entry-cache: "npm:^8.0.0" + find-up: "npm:^5.0.0" + glob-parent: "npm:^6.0.2" + ignore: "npm:^5.2.0" + imurmurhash: "npm:^0.1.4" + is-glob: "npm:^4.0.0" + json-stable-stringify-without-jsonify: "npm:^1.0.1" + lodash.merge: "npm:^4.6.2" + minimatch: "npm:^3.1.2" + natural-compare: "npm:^1.4.0" + optionator: "npm:^0.9.3" + peerDependencies: + jiti: "*" + peerDependenciesMeta: + jiti: + optional: true + bin: + eslint: bin/eslint.js + checksum: 10c0/9edd8dd782b4ae2eb00a158ed4708194835d4494d75545fa63a51f020ed17f865c49b4ae1914a2ecbc7fdb262bd8059e811aeef9f0bae63dced9d3293be1bbdd + languageName: node + linkType: hard + +"espree@npm:^10.0.1, espree@npm:^10.3.0": + version: 10.3.0 + resolution: "espree@npm:10.3.0" + dependencies: + acorn: "npm:^8.14.0" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/272beeaca70d0a1a047d61baff64db04664a33d7cfb5d144f84bc8a5c6194c6c8ebe9cc594093ca53add88baa23e59b01e69e8a0160ab32eac570482e165c462 + languageName: node + linkType: hard + "espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" @@ -10933,6 +11168,15 @@ __metadata: languageName: node linkType: hard +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" + dependencies: + flat-cache: "npm:^4.0.0" + checksum: 10c0/9e2b5938b1cd9b6d7e3612bdc533afd4ac17b2fc646569e9a8abbf2eb48e5eb8e316bc38815a3ef6a1b456f4107f0d0f055a614ca613e75db6bf9ff4d72c1638 + languageName: node + linkType: hard + "file-selector@npm:0.2.4": version: 0.2.4 resolution: "file-selector@npm:0.2.4" @@ -10986,15 +11230,19 @@ __metadata: linkType: hard "find-process@npm:^1.4.7": - version: 1.4.10 - resolution: "find-process@npm:1.4.10" + version: 1.4.9 + resolution: "find-process@npm:1.4.9" dependencies: chalk: "npm:~4.1.2" commander: "npm:^12.1.0" + debug: "npm:^4.4.0" + eslint: "npm:^9.17.0" + glob: "npm:^11.0.0" loglevel: "npm:^1.9.2" + rimraf: "npm:^6.0.1" bin: find-process: bin/find-process.js - checksum: 10c0/5f570ba55dca0659d7c063e2296b44fd3329eabff3660399c9db39a59a5f47a5925e0520dd6ea5eae6a36e28592c27701ca75d595c7a6ed12bae421995f5e59f + checksum: 10c0/82156097f1ae442850ca701a66a8f5129eb39dc01dca24639ff316439bc79e03a54bfb87c1f7c4337cab167ca3ca2b2f6a88a2c73451563536271733e27761ff languageName: node linkType: hard @@ -11056,6 +11304,16 @@ __metadata: languageName: node linkType: hard +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" + dependencies: + flatted: "npm:^3.2.9" + keyv: "npm:^4.5.4" + checksum: 10c0/2c59d93e9faa2523e4fda6b4ada749bed432cfa28c8e251f33b25795e426a1c6dbada777afb1f74fcfff33934fdbdea921ee738fcc33e71adc9d6eca984a1cfc + languageName: node + linkType: hard + "flatted@npm:^3.2.9": version: 3.3.2 resolution: "flatted@npm:3.3.2" @@ -11117,11 +11375,11 @@ __metadata: linkType: hard "framer-motion@npm:^11.5.4": - version: 11.16.4 - resolution: "framer-motion@npm:11.16.4" + version: 11.15.0 + resolution: "framer-motion@npm:11.15.0" dependencies: - motion-dom: "npm:^11.16.4" - motion-utils: "npm:^11.16.0" + motion-dom: "npm:^11.14.3" + motion-utils: "npm:^11.14.3" tslib: "npm:^2.4.0" peerDependencies: "@emotion/is-prop-valid": "*" @@ -11134,7 +11392,7 @@ __metadata: optional: true react-dom: optional: true - checksum: 10c0/f0063206098e9ac76da03a5fd47ca23165021c102bd2b89b8bdf81307bc86641d7110194bcedaba2dbdc28ee8d97ce0c6f9136d867aaa21fa2a50a8fd3ec9797 + checksum: 10c0/59f1c1eea09a5cbda346624a7d700bdb1ccff8a8528ed145009db974283064c3a4e55ca9eaaf4950494f254f6233c37634735b9bd8463b25ffeef624030894d6 languageName: node linkType: hard @@ -11511,6 +11769,13 @@ __metadata: languageName: node linkType: hard +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10c0/b96ff42620c9231ad468d4c58ff42afee7777ee1c963013ff8aabe095a451d0ceeb8dcd8ef4cbd64d2538cef45f787a78ba3a9574f4a634438963e334471302d + languageName: node + linkType: hard + "globals@npm:^15.7.0": version: 15.14.0 resolution: "globals@npm:15.14.0" @@ -12224,9 +12489,9 @@ __metadata: linkType: hard "inflection@npm:^3.0.0": - version: 3.0.2 - resolution: "inflection@npm:3.0.2" - checksum: 10c0/ac6b635f029b27834313ce30188d74607fe9751c729bf91698675b2fd82489e0195e884d8a9455676064a74b2db77b407d35b56ada0978d0e8194e72202bf7af + version: 3.0.1 + resolution: "inflection@npm:3.0.1" + checksum: 10c0/80fe70db2b55579a15fcd595660c30a7f355577a120bc6e914747ed962b8f89b48a44496bb689b79b5bb4e7b035e21793753a95065beb46536e5ebe25118b4fe languageName: node linkType: hard @@ -13716,7 +13981,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.3": +"keyv@npm:^4.5.3, keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -14037,9 +14302,9 @@ __metadata: linkType: hard "long@npm:^5.0.0": - version: 5.2.4 - resolution: "long@npm:5.2.4" - checksum: 10c0/0cf819ce2a7bbe48663e79233917552c7667b11e68d4d9ea4ebb99173042509d9af461e5211c22939b913332c264d9a1135937ea533cbd05bc4f8cf46f6d2e07 + version: 5.2.3 + resolution: "long@npm:5.2.3" + checksum: 10c0/6a0da658f5ef683b90330b1af76f06790c623e148222da9d75b60e266bbf88f803232dd21464575681638894a84091616e7f89557aa087fd14116c0f4e0e43d9 languageName: node linkType: hard @@ -14566,14 +14831,14 @@ __metadata: linkType: hard "memfs@npm:^4.8.2": - version: 4.17.0 - resolution: "memfs@npm:4.17.0" + version: 4.15.3 + resolution: "memfs@npm:4.15.3" dependencies: "@jsonjoy.com/json-pack": "npm:^1.0.3" "@jsonjoy.com/util": "npm:^1.3.0" tree-dump: "npm:^1.0.1" tslib: "npm:^2.0.0" - checksum: 10c0/2901f69e80e1fbefa8aafe994a253fff6f34eb176d8b80d57476311611e516a11ab4dd93f852c8739fe04f2b57d6a4ca7a1828fa0bd401ce631bcac214b3d58b + checksum: 10c0/95bab707edcc86ac5acdb3ca53b420be34aa04167d0f03398b702bfadb44b72a6a27198b93593e7d9094cf911d70a0d679301fbc0e309f7ac43fa04a676b1b60 languageName: node linkType: hard @@ -15545,19 +15810,17 @@ __metadata: languageName: node linkType: hard -"motion-dom@npm:^11.16.4": - version: 11.16.4 - resolution: "motion-dom@npm:11.16.4" - dependencies: - motion-utils: "npm:^11.16.0" - checksum: 10c0/66de6d40aef59d3004aaf17e39c7c2d2c679306207fdb28c73917d6a05e8c962747fea53d2e516c25d994109d38e127943a759fed18a0fadfc2572a3335fc0d2 +"motion-dom@npm:^11.14.3": + version: 11.14.3 + resolution: "motion-dom@npm:11.14.3" + checksum: 10c0/14989aba2981dcf618dc77d202ac35325366e645fd9e57c6942d88d0696263bbe7d0680da2e5f84e93339a67255bdbfebb8a4994a46584a661dd9a1e136fa7a1 languageName: node linkType: hard -"motion-utils@npm:^11.16.0": - version: 11.16.0 - resolution: "motion-utils@npm:11.16.0" - checksum: 10c0/e68efa08b9546a2fb065537cedcbab1a416d43cdc5773e02ea01408c276e56bbea9ef76d330e80d8536a6ac585b0bbb6f4f2b9d97637d8d36418483e4492ddff +"motion-utils@npm:^11.14.3": + version: 11.14.3 + resolution: "motion-utils@npm:11.14.3" + checksum: 10c0/7459bcb27311b72b416b2618cbfd56bad7d0fbec27736529e3f45a561fa78c43bf82e05338d9d9b765649b57d1c693821e83b30c6ba449d6f7f66c5245f072fb languageName: node linkType: hard @@ -16380,9 +16643,9 @@ __metadata: linkType: hard "papaparse@npm:^5.4.1": - version: 5.5.0 - resolution: "papaparse@npm:5.5.0" - checksum: 10c0/09e2550e349e71762592403a9eeaf411466e937f4474e1f9d688868df74b77c4e0550c8e6b392f788393e145a8aecb3f4d9710ebf86794ccc8623901992db23a + version: 5.4.1 + resolution: "papaparse@npm:5.4.1" + checksum: 10c0/201f37c4813453fed5bfb4c01816696b099d2db9ff1e8fb610acc4771fdde91d2a22b6094721edb0fedb21ca3c46f04263f68be4beb3e35b8c72278f0cedc7b7 languageName: node linkType: hard @@ -18513,28 +18776,28 @@ __metadata: linkType: hard "rollup@npm:^4.24.0": - version: 4.30.1 - resolution: "rollup@npm:4.30.1" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.30.1" - "@rollup/rollup-android-arm64": "npm:4.30.1" - "@rollup/rollup-darwin-arm64": "npm:4.30.1" - "@rollup/rollup-darwin-x64": "npm:4.30.1" - "@rollup/rollup-freebsd-arm64": "npm:4.30.1" - "@rollup/rollup-freebsd-x64": "npm:4.30.1" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.30.1" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.30.1" - "@rollup/rollup-linux-arm64-gnu": "npm:4.30.1" - "@rollup/rollup-linux-arm64-musl": "npm:4.30.1" - "@rollup/rollup-linux-loongarch64-gnu": "npm:4.30.1" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.30.1" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.30.1" - "@rollup/rollup-linux-s390x-gnu": "npm:4.30.1" - "@rollup/rollup-linux-x64-gnu": "npm:4.30.1" - "@rollup/rollup-linux-x64-musl": "npm:4.30.1" - "@rollup/rollup-win32-arm64-msvc": "npm:4.30.1" - "@rollup/rollup-win32-ia32-msvc": "npm:4.30.1" - "@rollup/rollup-win32-x64-msvc": "npm:4.30.1" + version: 4.29.2 + resolution: "rollup@npm:4.29.2" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.29.2" + "@rollup/rollup-android-arm64": "npm:4.29.2" + "@rollup/rollup-darwin-arm64": "npm:4.29.2" + "@rollup/rollup-darwin-x64": "npm:4.29.2" + "@rollup/rollup-freebsd-arm64": "npm:4.29.2" + "@rollup/rollup-freebsd-x64": "npm:4.29.2" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.29.2" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.29.2" + "@rollup/rollup-linux-arm64-gnu": "npm:4.29.2" + "@rollup/rollup-linux-arm64-musl": "npm:4.29.2" + "@rollup/rollup-linux-loongarch64-gnu": "npm:4.29.2" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.29.2" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.29.2" + "@rollup/rollup-linux-s390x-gnu": "npm:4.29.2" + "@rollup/rollup-linux-x64-gnu": "npm:4.29.2" + "@rollup/rollup-linux-x64-musl": "npm:4.29.2" + "@rollup/rollup-win32-arm64-msvc": "npm:4.29.2" + "@rollup/rollup-win32-ia32-msvc": "npm:4.29.2" + "@rollup/rollup-win32-x64-msvc": "npm:4.29.2" "@types/estree": "npm:1.0.6" fsevents: "npm:~2.3.2" dependenciesMeta: @@ -18580,7 +18843,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/a318c57e2ca9741e1503bcd75483949c6e83edd72234a468010a3098a34248f523e44f7ad4fde90dc5c2da56abc1b78ac42a9329e1dbd708682728adbd8df7cc + checksum: 10c0/460931c5a43e2f7aca59a7db585b938145201bd2ad0bbd941d3bc15f74a21d0437e6f8a398605ab7d870f49ce346ae5759940a0158e679da5c0228afc477ff81 languageName: node linkType: hard @@ -20283,6 +20546,15 @@ __metadata: languageName: node linkType: hard +"ts-api-utils@npm:^1.3.0": + version: 1.4.3 + resolution: "ts-api-utils@npm:1.4.3" + peerDependencies: + typescript: ">=4.2.0" + checksum: 10c0/e65dc6e7e8141140c23e1dc94984bf995d4f6801919c71d6dc27cf0cd51b100a91ffcfe5217626193e5bea9d46831e8586febdc7e172df3f1091a7384299e23a + languageName: node + linkType: hard + "ts-api-utils@npm:^2.0.0": version: 2.0.0 resolution: "ts-api-utils@npm:2.0.0" @@ -20725,9 +20997,9 @@ __metadata: linkType: hard "type-fest@npm:^4.10.0": - version: 4.32.0 - resolution: "type-fest@npm:4.32.0" - checksum: 10c0/e2e877055487d109eba99afc58211db4a480837ff7b243c7de0b3e2ac29fdce55ab55e201c64cb1a8b2aeffce7e8f60ae3ce3a2f7e6fb68261d62743e54288ba + version: 4.31.0 + resolution: "type-fest@npm:4.31.0" + checksum: 10c0/a5bb69e3b0f82e068af8c645ac3d50b1fa5c588ebc83735a6add4ef6dacf277bb3605801f66c72c069af20120ee7387a3ae6dd84e12c152f5982784c710b4051 languageName: node linkType: hard @@ -21122,16 +21394,16 @@ __metadata: linkType: hard "update-browserslist-db@npm:^1.1.1": - version: 1.1.2 - resolution: "update-browserslist-db@npm:1.1.2" + version: 1.1.1 + resolution: "update-browserslist-db@npm:1.1.1" dependencies: escalade: "npm:^3.2.0" - picocolors: "npm:^1.1.1" + picocolors: "npm:^1.1.0" peerDependencies: browserslist: ">= 4.21.0" bin: update-browserslist-db: cli.js - checksum: 10c0/9cb353998d6d7d6ba1e46b8fa3db888822dd972212da4eda609d185eb5c3557a93fd59780ceb757afd4d84240518df08542736969e6a5d6d6ce2d58e9363aac6 + checksum: 10c0/536a2979adda2b4be81b07e311bd2f3ad5e978690987956bc5f514130ad50cac87cd22c710b686d79731e00fbee8ef43efe5fcd72baa241045209195d43dcc80 languageName: node linkType: hard @@ -22187,8 +22459,8 @@ __metadata: linkType: hard "zustand@npm:^5.0.2": - version: 5.0.3 - resolution: "zustand@npm:5.0.3" + version: 5.0.2 + resolution: "zustand@npm:5.0.2" peerDependencies: "@types/react": ">=18.0.0" immer: ">=9.0.6" @@ -22203,7 +22475,7 @@ __metadata: optional: true use-sync-external-store: optional: true - checksum: 10c0/dad96c6c123fda088c583d5df6692e9245cd207583078dc15f93d255a67b0f346bad4535545c98852ecde93d254812a0c799579dfde2ab595016b99fbe20e4d5 + checksum: 10c0/d9bb048d8129fd1aaed3fda974991b15a7c9c31ef06f78e9bf5c4b3678f249850764a6dadb8c93127257d07831995cf7a048281658a37c5d1143ad6f397fe37c languageName: node linkType: hard