@cloudcannon/editable-regions 0.0.16 → 0.0.17
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.
|
@@ -215,6 +215,12 @@ export default class EditableComponent extends Editable {
|
|
|
215
215
|
continue;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
// Both children are the same subclass (node/element) but are of different types (e.g. text -> comment)
|
|
219
|
+
if (renderChild.nodeName !== targetChild.nodeName) {
|
|
220
|
+
targetChild.replaceWith(renderChild);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
|
|
218
224
|
// Both existing and rendered children are nodes (i.e. some text)
|
|
219
225
|
if (
|
|
220
226
|
!(renderChild instanceof Element) &&
|
|
@@ -225,12 +231,6 @@ export default class EditableComponent extends Editable {
|
|
|
225
231
|
continue;
|
|
226
232
|
}
|
|
227
233
|
|
|
228
|
-
// Both children are elements but are different types
|
|
229
|
-
if (renderChild.nodeName !== targetChild.nodeName) {
|
|
230
|
-
targetChild.replaceWith(renderChild);
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
234
|
// Both existing and rendered children are the same kind of element, and neither is editable
|
|
235
235
|
if (!isEditableElement(renderChild) && !isEditableElement(targetChild)) {
|
|
236
236
|
// Update the existing element to match the rendered element and recurse their subtrees
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcannon/editable-regions",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Visual Editing for the CloudCannon CMS.",
|
|
6
6
|
"keywords": [
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"./internal/styles": "./styles/index.js"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@biomejs/biome": "2.5.
|
|
67
|
-
"@cloudcannon/visual-editor-api": "0.0.
|
|
66
|
+
"@biomejs/biome": "2.5.1",
|
|
67
|
+
"@cloudcannon/visual-editor-api": "0.0.19",
|
|
68
68
|
"@sindresorhus/slugify": "3.0.0",
|
|
69
69
|
"@types/js-beautify": "1.14.3",
|
|
70
70
|
"@types/node": "25.9.4",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/react-dom": "19.2.3",
|
|
73
73
|
"astro": "6.4.8",
|
|
74
74
|
"js-beautify": "1.15.4",
|
|
75
|
-
"liquidjs": "10.27.
|
|
75
|
+
"liquidjs": "10.27.1",
|
|
76
76
|
"typescript": "6.0.3"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|