<commit_before><template>
  <tiny-mce :init="tinyMceOptions" :initial-value="data" @input="input" v-model="data"/>
</template>

<script>
  import TinyMce from '@tinymce/tinymce-vue';
  import FileUtils from '@/framework/IO/FileUtils';

  export default {
    name: 'jinya-tiny-mce',
    components: {
      TinyMce,
    },
    watch: {
      content(newValue) {
        this.data = newValue;
      },
    },
    props: {
      content: {
        type: String,
      },
      height: {
        type: String,
        default() {
          return '600px';
        },
      },
      required: {
        type: Boolean,
        default() {
          return false;
        },
      },
    },
    methods: {
      input($event) {
        this.$emit('input', $event);
        if (this.required && !$event) {
          const validityState = { valueMissing: true };
          this.$emit('invalid', validityState);
        } else {
          this.$emit('valid');
        }
      },
    },
    data() {
      const { height } = this;
      return {
        data: this.content,
        tinyMceOptions: {
          plugins: [
            'anchor',
            'autolink',
            'colorpicker',
            'contextmenu',
            'fullscreen',
            'help',
            'image',
            'table',
            'textcolor',<commit_msg>JGCMS-64 Page editor no links possible<commit_after><template>
  <tiny-mce :init="tinyMceOptions" :initial-value="data" @input="input" v-model="data"/>
</template>

<script>
  import TinyMce from '@tinymce/tinymce-vue';
  import FileUtils from '@/framework/IO/FileUtils';

  export default {
    name: 'jinya-tiny-mce',
    components: {
      TinyMce,
    },
    watch: {
      content(newValue) {
        this.data = newValue;
      },
    },
    props: {
      content: {
        type: String,
      },
      height: {
        type: String,
        default() {
          return '600px';
        },
      },
      required: {
        type: Boolean,
        default() {
          return false;
        },
      },
    },
    methods: {
      input($event) {
        this.$emit('input', $event);
        if (this.required && !$event) {
          const validityState = { valueMissing: true };
          this.$emit('invalid', validityState);
        } else {
          this.$emit('valid');
        }
      },
    },
    data() {
      const { height } = this;
      return {
        data: this.content,
        tinyMceOptions: {
          plugins: [
            'anchor',
            'autolink',
            'code',
            'colorpicker',
            'contextmenu',
            'fullscreen',
            'help',
            'hr',
            'image',
            'link',
            'lists',
            'table',
            'textcolor',
{'fraction_non_alphanumeric': 0.14599855803893294, 'fraction_numerical': 0.002883922134102379, 'mean_word_length': 1.4406332453825859, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2361200', 'n_tokens_mistral': 837, 'n_tokens_neox': 821, 'n_words': 158}