diff --git a/packages/yoopta-editor/package.json b/packages/yoopta-editor/package.json index 57308db6d..512612d4b 100644 --- a/packages/yoopta-editor/package.json +++ b/packages/yoopta-editor/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/editor", - "version": "1.9.24-rc", + "version": "1.9.25-rc", "license": "MIT", "private": false, "type": "module", diff --git a/packages/yoopta-editor/src/components/Editor/plugins/pasteHtml.ts b/packages/yoopta-editor/src/components/Editor/plugins/pasteHtml.ts index d73d28f96..fac4b4fbd 100644 --- a/packages/yoopta-editor/src/components/Editor/plugins/pasteHtml.ts +++ b/packages/yoopta-editor/src/components/Editor/plugins/pasteHtml.ts @@ -1,4 +1,4 @@ -import { Transforms } from 'slate'; +import { Text, Transforms } from 'slate'; import { YooEditor } from '../../../types'; import { deserializeHtml } from '../../../utils/deserializeHTML'; @@ -11,7 +11,9 @@ const withHtml = (editor: YooEditor) => { if (html) { const fragment = deserializeHtml(html, editor.plugins); - Transforms.insertFragment(editor, fragment); + const nodes = fragment.filter((node) => !Text.isText(node)); + + Transforms.insertFragment(editor, nodes); return; } diff --git a/packages/yoopta-lists/src/ui/ListItem.tsx b/packages/yoopta-lists/src/ui/ListItem.tsx index 8c4d60eee..349f76113 100644 --- a/packages/yoopta-lists/src/ui/ListItem.tsx +++ b/packages/yoopta-lists/src/ui/ListItem.tsx @@ -64,7 +64,9 @@ const ListItemList = createYooptaPlugin({ const { anchor } = editor.selection; const [listItemNode, listItemPath] = nodeEntry; - const [parentNode, parentPath] = Editor.parent(editor, listItemPath) as NodeEntry; + const [parentNode, parentPath] = Editor.parent(editor, listItemPath) as NodeEntry< + BulletedListElement | NumberedListElement + >; const text = Editor.string(editor, listItemPath); const isEnd = Editor.isEnd(editor, anchor, listItemPath); @@ -192,7 +194,6 @@ const ListItemList = createYooptaPlugin({ }, html: { serialize: (node, children) => { - console.log('children', children); return `
  • ${children}
  • `; }, deserialize: { diff --git a/web/package.json b/web/package.json index d144add29..acbf21fad 100644 --- a/web/package.json +++ b/web/package.json @@ -20,7 +20,7 @@ "@yoopta/callout": "^1.9.15-rc", "@yoopta/chat-gpt-assistant": "^1.9.16-rc", "@yoopta/code": "^1.9.15-rc", - "@yoopta/editor": "^1.9.24-rc", + "@yoopta/editor": "^1.9.25-rc", "@yoopta/embed": "^1.9.18-rc", "@yoopta/exports": "^1.9.17-rc", "@yoopta/headings": "^1.9.15-rc", diff --git a/web/yarn.lock b/web/yarn.lock index 55e685e01..2fe2daf1a 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -1615,10 +1615,10 @@ prism-material-themes "^1.0.4" prismjs "^1.29.0" -"@yoopta/editor@^1.9.23-rc": - version "1.9.23-rc" - resolved "https://registry.yarnpkg.com/@yoopta/editor/-/editor-1.9.23-rc.tgz#aa6f829149a3225d56c2031d21f6c94fc5e4c950" - integrity sha512-+ms9OVWUoio8taYfwe9CaMeKjvQfupwFroVuIUqaXIh6xuZSadhBe12wtuf2I2MJyWKEgifZjiPQ3LrnwemV3Q== +"@yoopta/editor@^1.9.25-rc": + version "1.9.25-rc" + resolved "https://registry.yarnpkg.com/@yoopta/editor/-/editor-1.9.25-rc.tgz#8ff8113a7fed4edd9f7c6fb59ab41731b0a7f614" + integrity sha512-N6n6yWEYEU+U8mA5Pe/w7SN85vbl6+OsdMsAdnjTrKD/qe/gu6tw7ujE+ETjEqRwA5jD6d8xnSIx0Lnl8KjpGw== dependencies: body-scroll-lock "^4.0.0-beta.0" classnames "^2.3.1"