@visns-studio/visns-components 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useEffect, useRef, useState } from 'react';
2
2
  import DatePicker from 'react-datepicker';
3
3
  import _ from 'lodash';
4
4
  import ReactQuill from 'react-quill';
@@ -7,6 +7,7 @@ import moment from 'moment';
7
7
  import { BlockPicker } from 'react-color';
8
8
  import { CopyToClipboard } from 'react-copy-to-clipboard';
9
9
  import { NumericFormat, PatternFormat } from 'react-number-format';
10
+ import { Editor } from '@tinymce/tinymce-react';
10
11
  import { Copy } from 'akar-icons';
11
12
 
12
13
  import CustomFetch from './Fetch';
@@ -39,6 +40,7 @@ function Field({
39
40
  settings,
40
41
  style,
41
42
  }) {
43
+ const editorRef = useRef(null);
42
44
  const [colorPickerShow, setColorPickerShow] = useState(false);
43
45
  const [dataOptions, setDataOptions] = useState([]);
44
46
  const [formItemStyle, setFormItemStyle] = useState({});
@@ -703,13 +705,48 @@ function Field({
703
705
  return htmlContainer;
704
706
  case 'richeditor':
705
707
  return (
706
- <ReactQuill
707
- theme="snow"
708
- data-name={settings.id}
709
- onChange={(value, event) => {
710
- onChangeRicheditor(event, value, settings.id);
708
+ <Editor
709
+ apiKey="51mqcxkrrco6unmr6h8exc5mkhtjwi6fpyedy3r493px8cbq"
710
+ onChange={(e) => {
711
+ onChangeRicheditor(
712
+ e,
713
+ e.target.getContent(),
714
+ settings.id
715
+ );
716
+ }}
717
+ onInit={(evt, editor) => (editorRef.current = editor)}
718
+ initialValue={inputValue || ''}
719
+ init={{
720
+ height: 500,
721
+ menubar: false,
722
+ plugins: [
723
+ 'advlist',
724
+ 'autolink',
725
+ 'lists',
726
+ 'link',
727
+ 'image',
728
+ 'charmap',
729
+ 'preview',
730
+ 'anchor',
731
+ 'searchreplace',
732
+ 'visualblocks',
733
+ 'code',
734
+ 'fullscreen',
735
+ 'insertdatetime',
736
+ 'media',
737
+ 'table',
738
+ 'code',
739
+ 'help',
740
+ 'wordcount',
741
+ ],
742
+ toolbar:
743
+ 'undo redo | blocks | ' +
744
+ 'bold italic forecolor | alignleft aligncenter ' +
745
+ 'alignright alignjustify | bullist numlist outdent indent | ' +
746
+ 'removeformat | table',
747
+ content_style:
748
+ 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
711
749
  }}
712
- value={inputValue || ''}
713
750
  />
714
751
  );
715
752
  default:
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@inovua/reactdatagrid-community": "^5.10.2",
4
+ "@tinymce/tinymce-react": "^4.3.2",
4
5
  "add": "^2.0.6",
5
6
  "akar-icons": "^1.9.30",
6
7
  "array-move": "^4.0.0",
@@ -45,7 +46,7 @@
45
46
  "react-dom": "^17.0.1"
46
47
  },
47
48
  "name": "@visns-studio/visns-components",
48
- "version": "3.0.3",
49
+ "version": "3.0.4",
49
50
  "description": "Various packages to assist in the development of our Custom Applications.",
50
51
  "main": "index.js",
51
52
  "scripts": {