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 +1 -1
- package/README.md +24 -5
- package/build/jodit-react.js +1 -1
- package/build/jodit-react.js.LICENSE.txt +1 -1
- package/build/types/JoditEditor.d.ts +21 -0
- package/build/types/include.jodit.d.ts +3 -0
- package/build/types/index.d.ts +4 -0
- package/examples/{app.js → app.tsx} +1 -1
- package/examples/components/{Form.js → Form.tsx} +22 -17
- package/examples/index.html +9 -9
- package/index.d.ts +1 -27
- package/package.json +44 -45
- package/src/JoditEditor.tsx +159 -0
- package/src/include.jodit.ts +7 -0
- package/tsconfig.json +18 -0
- package/.github/ISSUE_TEMPLATE.md +0 -18
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
- package/.github/workflows/new-version.yml +0 -42
- package/.github/workflows/release.yml +0 -36
- package/babel.config.json +0 -12
- package/examples/.babelrc +0 -12
- package/examples/webpack.config.js +0 -45
- package/src/JoditEditor.js +0 -146
- package/src/include.jodit.js +0 -4
- package/webpack.config.js +0 -70
- /package/src/{index.js → index.ts} +0 -0
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
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 '
|
|
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.
|