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