<commit_before>import * as React from 'react';
import { useEffect } from 'react';

import { Tyr } from 'tyranid/client';

import { byName, TyrTypeProps, mapPropsToForm, onTypeChange } from './type';
import { stringFilter, stringFinder } from './string';
import { withThemedTypeContext } from '../core/theme';
import { decorateField } from '../core';
import { registerComponent } from '../common';

import CKEditor from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

const CKEditorWrapper = <D extends Tyr.Document = Tyr.Document>({
  value = {},
  onChange,
  props,
}: {
  value?: any;
  onChange?: any;
  props: TyrTypeProps<D>;
}) => {
  const [editor, setEditor] = React.useState<any>();

  React.useEffect(() => {
    if (editor) editor.setData(value);
  }, [editor]);

  return (
    <CKEditor
      editor={ClassicEditor}
      onInit={(editor: any) => {
        setEditor(editor);
      }}
      config={{<commit_msg>another minor change for publish<commit_after>import * as React from 'react';
import { useEffect } from 'react';

import { Tyr } from 'tyranid/client';

import { byName, TyrTypeProps, mapPropsToForm, onTypeChange } from './type';
import { stringFilter, stringFinder } from './string';
import { withThemedTypeContext } from '../core/theme';
import { decorateField } from '../core';
import { registerComponent } from '../common';

import CKEditor from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

const CKEditorWrapper = <D extends Tyr.Document = Tyr.Document>({
  value = {},
  onChange,
  props,
}: {
  value?: any;
  onChange?: any;
  props: TyrTypeProps<D>;
}) => {
  const [editor, setEditor] = React.useState<any>();

  React.useEffect(() => {
    if (editor) {
      editor.setData(value);
    }
  }, [editor]);

  return (
    <CKEditor
      editor={ClassicEditor}
      onInit={(editor: any) => {
        setEditor(editor);
      }}
      config={{
{'fraction_non_alphanumeric': 0.1589873417721519, 'fraction_numerical': 0.0020253164556962027, 'mean_word_length': 3.7845036319612593, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '2628719', 'n_tokens_mistral': 622, 'n_tokens_neox': 612, 'n_words': 155}