jodit-react 4.1.2 → 5.0.0-beta.1
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/.github/workflows/new-version.yml +2 -2
- package/.github/workflows/release.yml +3 -3
- 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/examples/webpack.config.ts +43 -0
- 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/{webpack.config.js → webpack.config.ts} +8 -7
- 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/src/{index.js → index.ts} +0 -0
|
@@ -10,11 +10,11 @@ jobs:
|
|
|
10
10
|
newversion:
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
14
|
with:
|
|
15
15
|
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
|
|
16
16
|
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
|
|
17
|
-
- uses: actions/setup-node@
|
|
17
|
+
- uses: actions/setup-node@v4 #Setup Node
|
|
18
18
|
with:
|
|
19
19
|
node-version-file: '.nvmrc'
|
|
20
20
|
cache: 'npm'
|
|
@@ -13,8 +13,8 @@ jobs:
|
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
17
|
-
- uses: actions/setup-node@
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-node@v4 #Setup Node
|
|
18
18
|
with:
|
|
19
19
|
node-version-file: '.nvmrc'
|
|
20
20
|
cache: 'npm'
|
|
@@ -33,4 +33,4 @@ jobs:
|
|
|
33
33
|
|
|
34
34
|
- name: Publish
|
|
35
35
|
run: |
|
|
36
|
-
NPM_TOKEN=${{ secrets.NPM_TOKEN }} npm publish ./ --access public
|
|
36
|
+
NPM_TOKEN=${{ secrets.NPM_TOKEN }} npm publish ./ --access public --tag beta
|
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.
|