Skip to content

Commit 6128029

Browse files
committed
BUGFIX: Move ckeditor body collection wrapper into guest frame
The inline editor uses various elements for highlights which don’t work in the host frame. With this patch, we instead attach the collection to the guestframe body.
1 parent aa0dca9 commit 6128029

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed
1.58 MB
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"moment": "^2.20.1",
1010
"vfile-message": "^2.0.2",
1111
"[email protected]": "patch:isemail@npm:3.2.0#./patches/isemail-npm-3.2.0-browserified.patch",
12-
"[email protected]": "patch:react-codemirror2@npm:7.2.1#./patches/react-codemirror2-npm-7.2.1-browserified.patch"
12+
"[email protected]": "patch:react-codemirror2@npm:7.2.1#./patches/react-codemirror2-npm-7.2.1-browserified.patch",
13+
"@ckeditor/[email protected]": "patch:@ckeditor/ckeditor5-ui@npm:44.0.0#./patches/@ckeditor-ckeditor5-ui-npm-44.0.0.patch"
1314
},
1415
"scripts": {
1516
"lint": "tsc --noemit && stylelint 'packages/*/src/**/*.css' && yarn eslint 'packages/*/src/**/*.{js,jsx,ts,tsx}'",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/src/editorui/bodycollection.js b/src/editorui/bodycollection.js
2+
index 28d6243667e624929adc7f04470dd9e93b408363..def417300b6ffda95e90a6550f888af7d7d9655a 100644
3+
--- a/src/editorui/bodycollection.js
4+
+++ b/src/editorui/bodycollection.js
5+
@@ -93,9 +93,10 @@ export default class BodyCollection extends ViewCollection {
6+
children: this
7+
}).render();
8+
// Create a shared wrapper if there were none or the previous one got disconnected from DOM.
9+
+ const documentForWrapper = document.querySelector('[name="neos-content-main"]').contentDocument;
10+
if (!BodyCollection._bodyWrapper || !BodyCollection._bodyWrapper.isConnected) {
11+
- BodyCollection._bodyWrapper = createElement(document, 'div', { class: 'ck-body-wrapper' });
12+
- document.body.appendChild(BodyCollection._bodyWrapper);
13+
+ BodyCollection._bodyWrapper = createElement(documentForWrapper, 'div', { class: 'ck-body-wrapper' });
14+
+ documentForWrapper.body.appendChild(BodyCollection._bodyWrapper);
15+
}
16+
BodyCollection._bodyWrapper.appendChild(this._bodyCollectionContainer);
17+
}

yarn.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,6 +2670,21 @@ __metadata:
26702670
languageName: node
26712671
linkType: hard
26722672

2673+
"@ckeditor/ckeditor5-ui@patch:@ckeditor/ckeditor5-ui@npm:44.0.0#./patches/@ckeditor-ckeditor5-ui-npm-44.0.0.patch::locator=root-workspace-0b6124%40workspace%3A.":
2674+
version: 44.0.0
2675+
resolution: "@ckeditor/ckeditor5-ui@patch:@ckeditor/ckeditor5-ui@npm%3A44.0.0#./patches/@ckeditor-ckeditor5-ui-npm-44.0.0.patch::version=44.0.0&hash=69931c&locator=root-workspace-0b6124%40workspace%3A."
2676+
dependencies:
2677+
"@ckeditor/ckeditor5-core": 44.0.0
2678+
"@ckeditor/ckeditor5-engine": 44.0.0
2679+
"@ckeditor/ckeditor5-utils": 44.0.0
2680+
color-convert: 2.0.1
2681+
color-parse: 1.4.2
2682+
lodash-es: 4.17.21
2683+
vanilla-colorful: 0.7.2
2684+
checksum: 953066f1a04095d4a6f4324b569bdc71975378ece55e646d2411c14755ac384b17df24e1ca12c540bfd996c49ad02cbd8b2b839a70cbb9118ed5f5ee13a50846
2685+
languageName: node
2686+
linkType: hard
2687+
26732688
"@ckeditor/ckeditor5-undo@npm:44.0.0":
26742689
version: 44.0.0
26752690
resolution: "@ckeditor/ckeditor5-undo@npm:44.0.0"

0 commit comments

Comments
 (0)