jodit-react 5.3.1 → 5.3.15

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 It can be easy
3
+ Copyright (c) 2026 Jodit WYSIWYG Editor
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -42,26 +42,27 @@ import React, { useState, useRef, useMemo } from 'react';
42
42
  import JoditEditor from 'jodit-react';
43
43
 
44
44
  const Example = ({ placeholder }) => {
45
- const editor = useRef(null);
46
- const [content, setContent] = useState('');
47
-
48
- const config = useMemo(() => ({
49
- readonly: false, // all options from https://xdsoft.net/jodit/docs/,
50
- placeholder: placeholder || 'Start typings...'
51
- }),
52
- [placeholder]
53
- );
54
-
55
- return (
56
- <JoditEditor
57
- ref={editor}
58
- value={content}
59
- config={config}
60
- tabIndex={1} // tabIndex of textarea
61
- onBlur={newContent => setContent(newContent)} // preferred to use only this option to update the content for performance reasons
62
- onChange={newContent => {}}
63
- />
64
- );
45
+ const editor = useRef(null);
46
+ const [content, setContent] = useState('');
47
+
48
+ const config = useMemo(
49
+ () => ({
50
+ readonly: false, // all options from https://xdsoft.net/jodit/docs/,
51
+ placeholder: placeholder || 'Start typings...'
52
+ }),
53
+ [placeholder]
54
+ );
55
+
56
+ return (
57
+ <JoditEditor
58
+ ref={editor}
59
+ value={content}
60
+ config={config}
61
+ tabIndex={1} // tabIndex of textarea
62
+ onBlur={newContent => setContent(newContent)} // preferred to use only this option to update the content for performance reasons
63
+ onChange={newContent => {}}
64
+ />
65
+ );
65
66
  };
66
67
  ```
67
68
 
@@ -76,21 +77,21 @@ import JoditEditor, { Jodit } from 'jodit-react';
76
77
  * @param {Jodit} jodit
77
78
  */
78
79
  function preparePaste(jodit) {
79
- jodit.e.on(
80
- 'paste',
81
- e => {
82
- if (confirm('Change pasted content?')) {
83
- jodit.e.stopPropagation('paste');
84
- jodit.s.insertHTML(
85
- Jodit.modules.Helpers.getDataTransfer(e)
86
- .getData(Jodit.constants.TEXT_HTML)
87
- .replace(/a/g, 'b')
88
- );
89
- return false;
90
- }
91
- },
92
- { top: true }
93
- );
80
+ jodit.e.on(
81
+ 'paste',
82
+ e => {
83
+ if (confirm('Change pasted content?')) {
84
+ jodit.e.stopPropagation('paste');
85
+ jodit.s.insertHTML(
86
+ Jodit.modules.Helpers.getDataTransfer(e)
87
+ .getData(Jodit.constants.TEXT_HTML)
88
+ .replace(/a/g, 'b')
89
+ );
90
+ return false;
91
+ }
92
+ },
93
+ { top: true }
94
+ );
94
95
  }
95
96
  Jodit.plugins.add('preparePaste', preparePaste);
96
97
 
@@ -107,16 +108,24 @@ You can connect any Jodit constructor and set it as the `JoditConstructor` prope
107
108
  ```jsx
108
109
  import React from 'react';
109
110
  import JoditEditor from 'jodit-react';
110
- import {Jodit} from 'jodit-pro';
111
+ import { Jodit } from 'jodit-pro';
111
112
  import 'jodit-pro/es5/jodit.min.css';
112
113
  // ...
113
114
 
114
115
  function App() {
115
116
  return <JoditEditor JoditConstructor={Jodit} />;
116
117
  }
117
-
118
118
  ```
119
119
 
120
+ ### Import and use Jodit-react inside your Next.js application
121
+
122
+ ```js
123
+ import dynamic from 'next/dynamic';
124
+
125
+ const JoditEditor = dynamic(() => import('jodit-react'), {
126
+ ssr: false
127
+ });
128
+ ```
120
129
 
121
130
  ## License
122
131