@vonaffenfels/slate-editor 1.1.65 → 1.1.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BlockEditor.js +1 -1
- package/dist/Renderer.js +1 -1
- package/dist/index.js +3 -3
- package/package.json +2 -2
- package/src/BlockEditor.js +4 -1
- package/src/Serializer/Serializer.js +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonaffenfels/slate-editor",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.69",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"cssnano": "^5.0.1",
|
|
73
73
|
"escape-html": "^1.0.3"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "d16994da870bb2bc4798e09f17f938726136683b",
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
}
|
package/src/BlockEditor.js
CHANGED
|
@@ -137,10 +137,13 @@ export default function BlockEditor({
|
|
|
137
137
|
},
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
+
} else if (node?.type === "layout-slot") {
|
|
141
|
+
// Don't allow layout slot outside of layout. Don't know how it happens, maybe when copied and pasted?
|
|
142
|
+
return;
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
return node;
|
|
143
|
-
});
|
|
146
|
+
}).filter(Boolean);
|
|
144
147
|
};
|
|
145
148
|
|
|
146
149
|
const onSlateChange = (newValue) => {
|
|
@@ -69,7 +69,6 @@ export function Serializer({
|
|
|
69
69
|
adDefinitionDesktop = [],
|
|
70
70
|
adDefinitionMobile = [],
|
|
71
71
|
}) {
|
|
72
|
-
|
|
73
72
|
const processedValue = useMemo(() => {
|
|
74
73
|
let val = addAdsToValue(value, adDefinitionDesktop, adDefinitionMobile);
|
|
75
74
|
val = addFixedPositionsToValue(val, fixedPositions, fixedPositionTypes);
|
|
@@ -216,7 +215,7 @@ export function Serializer({
|
|
|
216
215
|
node = modifyElementFunc(node);
|
|
217
216
|
}
|
|
218
217
|
|
|
219
|
-
if (node.type === "paragraph") {
|
|
218
|
+
if (node.type === "paragraph" && !node.text) {
|
|
220
219
|
if (!node.children || node.children.length === 0) {
|
|
221
220
|
return null;
|
|
222
221
|
}
|
|
@@ -234,7 +233,7 @@ export function Serializer({
|
|
|
234
233
|
return null;
|
|
235
234
|
}
|
|
236
235
|
} catch (e) {
|
|
237
|
-
console.error(e)
|
|
236
|
+
console.error(e);
|
|
238
237
|
}
|
|
239
238
|
|
|
240
239
|
if (!node.children || !node.children.length) {
|