2023-12-16 15:48:35 +01:00
|
|
|
import {Component} from './component';
|
2024-05-27 16:39:41 +02:00
|
|
|
import {buildForInput} from '../wysiwyg-tinymce/config';
|
2023-12-16 15:48:35 +01:00
|
|
|
|
|
|
|
export class WysiwygInput extends Component {
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
this.elem = this.$el;
|
|
|
|
|
|
|
|
const config = buildForInput({
|
|
|
|
language: this.$opts.language,
|
|
|
|
containerElement: this.elem,
|
|
|
|
darkMode: document.documentElement.classList.contains('dark-mode'),
|
2024-01-30 15:27:09 +01:00
|
|
|
textDirection: this.$opts.textDirection,
|
|
|
|
translations: {},
|
2023-12-16 15:48:35 +01:00
|
|
|
translationMap: window.editor_translations,
|
|
|
|
});
|
|
|
|
|
|
|
|
window.tinymce.init(config).then(editors => {
|
|
|
|
this.editor = editors[0];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|