jodit-react 4.1.2 → 5.0.0-beta.2

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.
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- 18.17.1
1
+ 20
package/README.md CHANGED
@@ -45,11 +45,10 @@ const Example = ({ placeholder }) => {
45
45
  const editor = useRef(null);
46
46
  const [content, setContent] = useState('');
47
47
 
48
- const config = useMemo(
49
- {
48
+ const config = useMemo(() => ({
50
49
  readonly: false, // all options from https://xdsoft.net/jodit/docs/,
51
50
  placeholder: placeholder || 'Start typings...'
52
- },
51
+ }),
53
52
  [placeholder]
54
53
  );
55
54
 
@@ -71,7 +70,7 @@ const Example = ({ placeholder }) => {
71
70
  You can use all Jodit features and write your [own plugin](https://xdsoft.net/jodit/docs/modules/plugin.html) for example.
72
71
 
73
72
  ```js
74
- import JoditEditor, { Jodit } from '../../src/';
73
+ import JoditEditor, { Jodit } from 'jodit-react';
75
74
 
76
75
  /**
77
76
  * @param {Jodit} jodit
@@ -96,9 +95,29 @@ function preparePaste(jodit) {
96
95
  Jodit.plugins.add('preparePaste', preparePaste);
97
96
 
98
97
  //...
99
- return <JoditEditor/>;
98
+ return <JoditEditor />;
99
+ ```
100
+
101
+ You can see how to write plugins [in the documentation](https://xdsoft.net/jodit/pro/docs/how-to/create-plugin.md) or [on the stand](https://xdsoft.net/jodit/pro/docs/getting-started/examples.md#jodit-example-paste-link)
102
+
103
+ ## Use with Jodit PRO
104
+
105
+ You can connect any Jodit constructor and set it as the `JoditConstructor` property of the component.
106
+
107
+ ```jsx
108
+ import React from 'react';
109
+ import JoditEditor from 'jodit-react';
110
+ import {Jodit} from 'jodit-pro';
111
+ import 'jodit-pro/es5/jodit.min.css';
112
+ // ...
113
+
114
+ function App() {
115
+ return <JoditEditor JoditConstructor={Jodit} />;
116
+ }
117
+
100
118
  ```
101
119
 
120
+
102
121
  ## License
103
122
 
104
123
  This package is available under `MIT` License.