2023-12-16 22:48:35 +08:00
|
|
|
import {Component} from './component';
|
2024-05-27 22:39:41 +08:00
|
|
|
import {buildForInput} from '../wysiwyg-tinymce/config';
|
2023-12-16 22:48:35 +08: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 22:27:09 +08:00
|
|
|
textDirection: this.$opts.textDirection,
|
|
|
|
translations: {},
|
2023-12-16 22:48:35 +08:00
|
|
|
translationMap: window.editor_translations,
|
|
|
|
});
|
|
|
|
|
|
|
|
window.tinymce.init(config).then(editors => {
|
|
|
|
this.editor = editors[0];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|