@editora/react 1.0.2 → 1.0.3
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/README.md +12 -26
- package/package.json +3 -3
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ The React package provides ready-to-use React components for building rich text
|
|
|
37
37
|
```tsx
|
|
38
38
|
import { EditoraEditor } from '@editora/react';
|
|
39
39
|
import { BoldPlugin, ItalicPlugin } from '@editora/plugins';
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
import "@editora/themes/themes/default.css";
|
|
41
42
|
|
|
42
43
|
function App() {
|
|
43
44
|
const [content, setContent] = useState('<p>Start writing...</p>');
|
|
@@ -68,12 +69,13 @@ import {
|
|
|
68
69
|
ParagraphPlugin,
|
|
69
70
|
ListPlugin,
|
|
70
71
|
LinkPlugin,
|
|
71
|
-
|
|
72
|
+
MediaManagerPlugin,
|
|
72
73
|
TablePlugin,
|
|
73
74
|
CodeSamplePlugin,
|
|
74
75
|
HistoryPlugin
|
|
75
76
|
} from '@editora/plugins';
|
|
76
|
-
|
|
77
|
+
|
|
78
|
+
import "@editora/themes/themes/default.css";
|
|
77
79
|
|
|
78
80
|
function FullEditor() {
|
|
79
81
|
const [content, setContent] = useState('');
|
|
@@ -84,24 +86,7 @@ function FullEditor() {
|
|
|
84
86
|
UnderlinePlugin(),
|
|
85
87
|
HeadingPlugin(),
|
|
86
88
|
ListPlugin(),
|
|
87
|
-
|
|
88
|
-
onLinkClick: (url) => window.open(url, '_blank')
|
|
89
|
-
}),
|
|
90
|
-
createImagePlugin({
|
|
91
|
-
upload: async (file) => {
|
|
92
|
-
const formData = new FormData();
|
|
93
|
-
formData.append('image', file);
|
|
94
|
-
const response = await fetch('/api/upload', {
|
|
95
|
-
method: 'POST',
|
|
96
|
-
body: formData
|
|
97
|
-
});
|
|
98
|
-
const data = await response.json();
|
|
99
|
-
return data.url;
|
|
100
|
-
}
|
|
101
|
-
}),
|
|
102
|
-
createTablePlugin(),
|
|
103
|
-
createCodeSamplePlugin(),
|
|
104
|
-
createHistoryPlugin()
|
|
89
|
+
MediaManagerPlugin()
|
|
105
90
|
];
|
|
106
91
|
|
|
107
92
|
return (
|
|
@@ -279,7 +264,8 @@ const {
|
|
|
279
264
|
### Using Built-in Themes
|
|
280
265
|
|
|
281
266
|
```tsx
|
|
282
|
-
|
|
267
|
+
|
|
268
|
+
import "@editora/themes/themes/default.css";
|
|
283
269
|
|
|
284
270
|
<EditoraEditor theme="dark" />
|
|
285
271
|
```
|
|
@@ -320,9 +306,9 @@ const boldPlugin = BoldPlugin({
|
|
|
320
306
|
### Image Plugin with Upload
|
|
321
307
|
|
|
322
308
|
```tsx
|
|
323
|
-
import {
|
|
309
|
+
import { MediaManagerPlugin } from '@editora/plugins';
|
|
324
310
|
|
|
325
|
-
const imagePlugin =
|
|
311
|
+
const imagePlugin = MediaManagerPlugin({
|
|
326
312
|
upload: async (file) => {
|
|
327
313
|
const url = await uploadToServer(file);
|
|
328
314
|
return url;
|
|
@@ -338,9 +324,9 @@ const imagePlugin = createImagePlugin({
|
|
|
338
324
|
### Link Plugin
|
|
339
325
|
|
|
340
326
|
```tsx
|
|
341
|
-
import {
|
|
327
|
+
import { LinkPlugin } from '@editora/plugins';
|
|
342
328
|
|
|
343
|
-
const linkPlugin =
|
|
329
|
+
const linkPlugin = LinkPlugin({
|
|
344
330
|
openOnClick: false,
|
|
345
331
|
validate: (url) => {
|
|
346
332
|
return url.startsWith('http') || url.startsWith('https');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editora/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "React components for Editora - Best Free Premium Rich Text Editor. Free React WYSIWYG editor with enterprise features, 30+ free plugins, and accessibility support.",
|
|
5
5
|
"author": "Ajay Kumar <ajaykr089@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"react-dom": ">=16.8.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@editora/core": "^1.0.
|
|
63
|
+
"@editora/core": "^1.0.3",
|
|
64
64
|
"@editora/light-code-editor": "^1.0.2"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "694494db58b809f0dcf24501696284faa1ab68a5"
|
|
76
76
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Ajay Kumar
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|