jodit-react 5.2.41 → 5.3.14

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.
@@ -5,6 +5,7 @@ function usePrevious(value) {
5
5
  useEffect(() => {
6
6
  ref.current = value;
7
7
  }, [value]);
8
+ // eslint-disable-next-line react-hooks/refs
8
9
  return ref.current;
9
10
  }
10
11
  const JoditEditor = forwardRef(({ JoditConstructor = Jodit, className, config, id, name, onBlur, onChange, tabIndex, value, editorRef }, ref) => {
@@ -1,4 +1,4 @@
1
1
  import type { Jodit as JoditConstructorType } from 'jodit/esm/jodit';
2
-
2
+ ./build/types/JoditEditor.d.ts
3
3
  import 'jodit/esm/plugins/all';
4
4
  export declare const Jodit: typeof JoditConstructorType;
package/package.json CHANGED
@@ -1,8 +1,25 @@
1
1
  {
2
2
  "name": "jodit-react",
3
- "version": "5.2.41",
3
+ "version": "5.3.14",
4
4
  "description": "Jodit is awesome and usefully wysiwyg editor with filebrowser",
5
5
  "main": "build/jodit-react.js",
6
+ "module": "./build/esm/index.mjs",
7
+ "types": "./build/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./build/esm/index.d.mts",
12
+ "default": "./build/esm/index.mjs"
13
+ },
14
+ "require": {
15
+ "types": "./build/types/index.d.ts",
16
+ "default": "./build/react-jodit.js"
17
+ }
18
+ }
19
+ },
20
+ "files": [
21
+ "build"
22
+ ],
6
23
  "author": "Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)",
7
24
  "keywords": [
8
25
  "react",
@@ -16,61 +33,64 @@
16
33
  "rte"
17
34
  ],
18
35
  "dependencies": {
19
- "jodit": "^4.8.3"
36
+ "jodit": "^4.8.8"
20
37
  },
21
38
  "peerDependencies": {
22
39
  "react": "~0.14 || ^15 || ^16 || ^17 || ^18 || ^19",
23
40
  "react-dom": "~0.14 || ^15 || ^16 || ^17 || ^18 || ^19"
24
41
  },
25
42
  "devDependencies": {
26
- "@eslint/compat": "^1.2.5",
27
- "@jest/globals": "^29.7.0",
28
- "@swc-node/register": "^1.10.9",
29
- "@swc/core": "^1.10.7",
30
- "@testing-library/dom": "^10.4.0",
31
- "@testing-library/jest-dom": "^6.6.3",
32
- "@testing-library/react": "^16.2.0",
33
- "@testing-library/user-event": "^14.6.0",
34
- "@types/jest": "^29.5.14",
35
- "@types/react": "^19.0.7",
36
- "@types/react-dom": "^19.0.3",
37
- "@typescript-eslint/eslint-plugin": "^8.20.0",
38
- "css-loader": "^7.1.2",
39
- "eslint": "9.18.0",
40
- "eslint-config-prettier": "^10.0.1",
41
- "eslint-plugin-jest": "^28.11.0",
42
- "eslint-plugin-prettier": "^5.2.3",
43
- "eslint-plugin-react": "^7.37.4",
44
- "eslint-plugin-react-hooks": "^5.1.0",
45
- "jest": "^29.7.0",
46
- "jest-environment-jsdom": "^29.7.0",
47
- "prettier": "^3.4.2",
48
- "react": "^19.0.0",
49
- "react-dom": "^19.0.0",
43
+ "@eslint/compat": "^2.0.2",
44
+ "@swc-node/register": "^1.11.1",
45
+ "@swc/core": "^1.15.11",
46
+ "@testing-library/dom": "^10.4.1",
47
+ "@testing-library/react": "^16.3.2",
48
+ "@testing-library/user-event": "^14.6.1",
49
+ "@types/react": "^19.2.10",
50
+ "@types/react-dom": "^19.2.3",
51
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
52
+ "@typescript-eslint/parser": "^8.54.0",
53
+ "cross-env": "^10.1.0",
54
+ "css-loader": "^7.1.3",
55
+ "eslint": "9.39.2",
56
+ "eslint-config-prettier": "^10.1.8",
57
+ "eslint-plugin-prettier": "^5.5.5",
58
+ "eslint-plugin-react": "^7.37.5",
59
+ "eslint-plugin-react-hooks": "^7.0.1",
60
+ "eslint-plugin-vitest": "^0.5.4",
61
+ "html-webpack-plugin": "^5.6.6",
62
+ "jsdom": "^27.4.0",
63
+ "prettier": "^3.8.1",
64
+ "react": "^19.2.4",
65
+ "react-dom": "^19.2.4",
50
66
  "replace": "^1.2.2",
51
67
  "style-loader": "^4.0.0",
52
- "swc-loader": "^0.2.6",
53
- "ts-jest": "^29.2.5",
68
+ "swc-loader": "^0.2.7",
54
69
  "ts-node": "^10.9.2",
55
- "typescript": "^5.7.3",
56
- "webpack": "^5.97.1",
70
+ "tsup": "^8.5.1",
71
+ "typescript": "^5.9.3",
72
+ "vitest": "^4.0.18",
73
+ "webpack": "^5.104.1",
57
74
  "webpack-cli": "^6.0.1",
58
- "webpack-dev-server": "^5.2.0"
75
+ "webpack-dev-server": "^5.2.3"
59
76
  },
60
77
  "scripts": {
61
78
  "newversion": "npm version patch --no-git-tag-version && npm run github",
62
79
  "lint": "npm run lint:ts && npm run lint:eslint",
63
80
  "lint:ts": "tsc --noEmit",
64
81
  "lint:eslint": "eslint ./",
65
- "demo": "NODE_ENV=development node -r @swc-node/register ./node_modules/.bin/webpack serve --config ./examples/webpack.config.ts --mode development",
82
+ "demo": "cross-env NODE_ENV=development node -r @swc-node/register ./node_modules/.bin/webpack serve --mode development",
66
83
  "start": "npm run demo",
67
- "build": "npm run build:react && npm run build:types",
68
- "build:react": "NODE_ENV=production node -r @swc-node/register ./node_modules/.bin/webpack --mode production",
84
+ "build": "npm run build:react && npm run build:types && npm run build:esm",
85
+ "build:react": "cross-env NODE_ENV=production node -r @swc-node/register ./node_modules/.bin/webpack --mode production",
69
86
  "build:types": "rm -rf ./build/types && tsc --project tsconfig.types.json && npm run remove-css",
70
- "remove-css": "replace \"import '[^']+.css';\" '' ./build/**/*.ts",
87
+ "build:esm": "tsup src/index.ts --dts --format esm -d ./build/esm --clean",
88
+ "remove-css": "replace \"import '[^']+.css';\" ''./build/**/*.ts",
71
89
  "github": "npm run git && git push --tags origin HEAD:main",
72
90
  "git": "git add --all && git commit -m \"New version $npm_package_version. Read more https://github.com/jodit/jodit-react/releases/tag/$npm_package_version \" && git tag $npm_package_version",
73
- "test": "jest"
91
+ "test": "vitest run",
92
+ "test:watch": "vitest",
93
+ "webpack": "./node_modules/.bin/webpack --config ./webpack.config.ts --mode production"
74
94
  },
75
95
  "repository": {
76
96
  "type": "git",
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 20
package/CHANGELOG.md DELETED
@@ -1,98 +0,0 @@
1
- # Changelog
2
-
3
- > **Tags:**
4
- >
5
- > - :boom: [Breaking Change]
6
- > - :rocket: [New Feature]
7
- > - :bug: [Bug Fix]
8
- > - :memo: [Documentation]
9
- > - :house: [Internal]
10
- > - :nail_care: [Polish]
11
-
12
- ## 5.0.9
13
-
14
- - Fixed ref forwarding issue
15
-
16
- ## 5.0.7
17
-
18
- - [Fix: Avoid "Abort async" error by utilizing waitForReady API in Jodit destruct handling #287](https://github.com/jodit/jodit-react/pull/287)
19
- - Fixed Config type issue
20
- - Support React 19
21
-
22
-
23
- ## 4.0.1
24
-
25
- -
26
-
27
- ## 1.3.19
28
-
29
- #### :rocket: New Feature
30
-
31
- - The package now re-exports imperative Jodit, so you can write plugins and use all Jodit helpers
32
-
33
- ```js
34
- import JoditEditor, { Jodit } from '../../src/';
35
-
36
- /**
37
- * @param {Jodit} jodit
38
- */
39
- function preparePaste(jodit) {
40
- jodit.e.on(
41
- 'paste',
42
- e => {
43
- if (confirm('Change pasted content?')) {
44
- jodit.e.stopPropagation('paste');
45
- jodit.s.insertHTML(
46
- Jodit.modules.Helpers.getDataTransfer(e)
47
- .getData(Jodit.constants.TEXT_HTML)
48
- .replace(/a/g, 'b')
49
- );
50
- return false;
51
- }
52
- },
53
- { top: true }
54
- );
55
- }
56
- Jodit.plugins.add('preparePaste', preparePaste);
57
-
58
- //...
59
- return <JoditEditor />;
60
- ```
61
-
62
- #### :house: Internal
63
-
64
- - Update
65
-
66
- ```
67
- eslint-plugin-react-hooks ^4.5.0 → ^4.6.0
68
- @babel/core ^7.16.0 → ^7.19.0
69
- @babel/eslint-parser ^7.17.0 → ^7.18.9
70
- @babel/preset-env ^7.16.0 → ^7.19.0
71
- @babel/preset-react ^7.16.0 → ^7.18.6
72
- @types/react ^16.14.2 → ^18.0.18
73
- babel-loader ^8.2.2 → ^8.2.5
74
- css-loader ^3.6.0 → ^6.7.1
75
- eslint ^8.9.0 → ^8.23.0
76
- eslint-config-prettier ^8.4.0 → ^8.5.0
77
- eslint-plugin-prettier ^4.0.0 → ^4.2.1
78
- eslint-plugin-react ^7.28.0 → ^7.31.8
79
- husky ^7.0.4 → ^8.0.1
80
- lint-staged ^12.3.4 → ^13.0.3
81
- prettier ^2.5.1 → ^2.7.1
82
- style-loader ^0.20.3 → ^3.3.1
83
- webpack ^4.44.2 → ^5.74.0
84
- webpack-cli ^3.3.12 → ^4.10.0
85
- webpack-dev-server ^3.11.0 → ^4.11.0
86
- ```
87
-
88
- ## 1.3.18
89
-
90
- #### :bug: Bug Fix
91
-
92
- - [Jodit not cleaning up after unmount #196](https://github.com/jodit/jodit-react/issues/196)
93
-
94
- ## 1.2.1
95
-
96
- #### :bug: Bug Fix
97
-
98
- - [Editor duplicates after re-render (state change) #172](https://github.com/jodit/jodit-react/issues/172)
package/SECURITY.md DELETED
@@ -1,10 +0,0 @@
1
- # Reporting security issues
2
-
3
- If you believe you have found a security issue in the Jodit software, please contact us immediately.
4
-
5
- When reporting a suspected security problem, please bear this in mind:
6
-
7
- * Make sure to provide as many details as possible about the vulnerability.
8
- * Please do not disclose publicly any security issues until we fix them and publish security releases.
9
-
10
- Contact the security team at security@xdsoft.net. As soon as we receive the security report, we'll work promptly to confirm the issue and then to provide a security fix.