1 import {build as buildEditorConfig} from "../wysiwyg/config";
8 this.pageId = this.$opts.pageId;
9 this.textDirection = this.$opts.textDirection;
10 this.isDarkMode = document.documentElement.classList.contains('dark-mode');
12 this.tinyMceConfig = buildEditorConfig({
13 containerElement: this.elem,
14 darkMode: this.isDarkMode,
15 textDirection: this.textDirection,
16 drawioUrl: this.getDrawIoUrl(),
17 pageId: Number(this.pageId),
19 imageUploadErrorText: this.$opts.imageUploadErrorText,
20 serverUploadLimitText: this.$opts.serverUploadLimitText,
24 window.$events.emitPublic(this.elem, 'editor-tinymce::pre-init', {config: this.tinyMceConfig});
25 window.tinymce.init(this.tinyMceConfig);
29 const drawioUrlElem = document.querySelector('[drawio-url]');
31 return drawioUrlElem.getAttribute('drawio-url');
38 export default WysiwygEditor;