@udecode/plate-serializer
Advanced tools
Comparing version 3.1.3 to 3.2.0
# @udecode/plate-serializer | ||
## 3.2.0 | ||
### Minor Changes | ||
- [#995](https://github.com/udecode/plate/pull/995) [`58387c6d`](https://github.com/udecode/plate/commit/58387c6d34e86be7880999b40a9105b6178f4ce4) Thanks [@dylans](https://github.com/dylans)! - update slate dependencies and peerDependencies to 0.66.\* | ||
### Patch Changes | ||
- [#995](https://github.com/udecode/plate/pull/995) [`3a590663`](https://github.com/udecode/plate/commit/3a5906637b008e85a6d907a7492a78fe9961bf34) Thanks [@dylans](https://github.com/dylans)! - Slate 0.66 update | ||
- [#995](https://github.com/udecode/plate/pull/995) [`5eb42cdd`](https://github.com/udecode/plate/commit/5eb42cdd47db4fd41936420b86b0bf7df9a8aa09) Thanks [@dylans](https://github.com/dylans)! - update to slate 0.66.x | ||
- Updated dependencies [[`58387c6d`](https://github.com/udecode/plate/commit/58387c6d34e86be7880999b40a9105b6178f4ce4)]: | ||
- @udecode/plate-common@3.2.0 | ||
- @udecode/plate-core@3.2.0 | ||
## 3.1.3 | ||
@@ -4,0 +20,0 @@ |
@@ -1,3 +0,1 @@ | ||
import { isBlockAboveEmpty, setNodes } from '@udecode/plate-common'; | ||
import { getInlineTypes } from '@udecode/plate-core'; | ||
import { Editor } from 'slate'; | ||
@@ -18,3 +16,3 @@ | ||
if (!fragment.length) return; | ||
const preInserted = plugins.some(({ | ||
plugins.some(({ | ||
deserialize | ||
@@ -26,14 +24,2 @@ }) => { | ||
}); | ||
if (!preInserted) { | ||
const inlineTypes = getInlineTypes(editor, plugins); | ||
const firstNodeType = fragment[0].type; // replace the selected node type by the first block type | ||
if (isBlockAboveEmpty(editor) && firstNodeType && !inlineTypes.includes(firstNodeType) && fragment[0].type) { | ||
setNodes(editor, { | ||
type: firstNodeType | ||
}); | ||
} | ||
} | ||
editor.insertFragment(fragment); | ||
@@ -40,0 +26,0 @@ }); |
@@ -5,4 +5,2 @@ 'use strict'; | ||
var plateCommon = require('@udecode/plate-common'); | ||
var plateCore = require('@udecode/plate-core'); | ||
var slate = require('slate'); | ||
@@ -23,3 +21,3 @@ | ||
if (!fragment.length) return; | ||
const preInserted = plugins.some(({ | ||
plugins.some(({ | ||
deserialize | ||
@@ -31,14 +29,2 @@ }) => { | ||
}); | ||
if (!preInserted) { | ||
const inlineTypes = plateCore.getInlineTypes(editor, plugins); | ||
const firstNodeType = fragment[0].type; // replace the selected node type by the first block type | ||
if (plateCommon.isBlockAboveEmpty(editor) && firstNodeType && !inlineTypes.includes(firstNodeType) && fragment[0].type) { | ||
plateCommon.setNodes(editor, { | ||
type: firstNodeType | ||
}); | ||
} | ||
} | ||
editor.insertFragment(fragment); | ||
@@ -45,0 +31,0 @@ }); |
{ | ||
"name": "@udecode/plate-serializer", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"description": "Utilities for Plate serializers", | ||
@@ -36,4 +36,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@udecode/plate-common": "3.1.3", | ||
"@udecode/plate-core": "1.0.0" | ||
"@udecode/plate-common": "3.2.0", | ||
"@udecode/plate-core": "3.2.0" | ||
}, | ||
@@ -43,5 +43,5 @@ "peerDependencies": { | ||
"react-dom": ">=16.8.0", | ||
"slate": ">=0.60.0", | ||
"slate-history": ">=0.60.0", | ||
"slate-react": ">=0.60.0" | ||
"slate": ">=0.66.1", | ||
"slate-history": ">=0.66.0", | ||
"slate-react": ">=0.66.1" | ||
}, | ||
@@ -48,0 +48,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10190
59
+ Added@udecode/plate-common@3.2.0(transitive)
+ Added@udecode/plate-core@3.2.0(transitive)
- Removed@udecode/plate-common@3.1.3(transitive)
- Removed@udecode/plate-core@1.0.0(transitive)
Updated@udecode/plate-common@3.2.0
Updated@udecode/plate-core@3.2.0