feat: custom editor

This commit is contained in:
SethBurkart123
2025-06-18 16:47:29 +10:00
parent c4140a2a9d
commit 2638157d25
15 changed files with 2054 additions and 0 deletions
+18
View File
@@ -222,5 +222,23 @@ window.addEventListener("message", (event) => {
});
document.dispatchEvent(keyboardEvent);
} else if (event.data.type === "ckeditorSetData") {
// Handle CKEditor data setting
const { editorId, content } = event.data;
if (window.CKEDITOR && window.CKEDITOR.instances && window.CKEDITOR.instances[editorId]) {
window.CKEDITOR.instances[editorId].setData(content);
} else {
console.warn(`[pageState] CKEditor instance '${editorId}' not found`);
}
} else if (event.data.type === "ckeditorGetData") {
const { editorId } = event.data;
if (window.CKEDITOR && window.CKEDITOR.instances && window.CKEDITOR.instances[editorId]) {
const data = window.CKEDITOR.instances[editorId].getData();
window.postMessage({
type: "ckeditorGetDataResponse",
data,
}, "*");
}
}
});