Lexical: Finished up core drawing insert/editing

Added new options that sits on the context, for things needed but not
for the core editor, which are defined out of the editor (drawio URL,
error message text, pageId etc...)
This commit is contained in:
Dan Brown
2024-07-19 12:09:41 +01:00
parent fb87fb5750
commit c7c0df0964
13 changed files with 128 additions and 30 deletions

View File

@ -12,7 +12,14 @@ export class WysiwygEditor extends Component {
window.importVersioned('wysiwyg').then(wysiwyg => {
const editorContent = this.input.value;
this.editor = wysiwyg.createPageEditorInstance(this.editContainer, editorContent);
this.editor = wysiwyg.createPageEditorInstance(this.editContainer, editorContent, {
drawioUrl: this.getDrawIoUrl(),
pageId: Number(this.$opts.pageId),
translations: {
imageUploadErrorText: this.$opts.imageUploadErrorText,
serverUploadLimitText: this.$opts.serverUploadLimitText,
},
});
});
let handlingFormSubmit = false;
@ -35,7 +42,6 @@ export class WysiwygEditor extends Component {
}
getDrawIoUrl() {
// TODO
const drawioUrlElem = document.querySelector('[drawio-url]');
if (drawioUrlElem) {
return drawioUrlElem.getAttribute('drawio-url');