suneditor 3.0.4 → 3.0.6
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/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +1 -1
- package/src/assets/suneditor.css +51 -3
- package/src/core/logic/panel/viewer.js +9 -5
- package/src/core/logic/shell/_commandExecutor.js +38 -1
- package/src/core/section/constructor.js +1 -1
- package/src/helper/markdown.js +18 -3
- package/src/modules/contract/Browser.js +98 -10
- package/src/modules/contract/Controller.js +1 -2
- package/src/modules/contract/Figure.js +1 -1
- package/src/modules/ui/ModalAnchorEditor.js +16 -1
- package/src/plugins/browser/audioGallery.js +13 -0
- package/src/plugins/browser/fileBrowser.js +22 -0
- package/src/plugins/browser/fileGallery.js +14 -0
- package/src/plugins/browser/imageGallery.js +14 -0
- package/src/plugins/browser/videoGallery.js +14 -0
- package/src/plugins/command/codeBlock.js +1 -1
- package/src/plugins/command/fileUpload.js +12 -0
- package/src/plugins/command/list_bulleted.js +1 -1
- package/src/plugins/command/list_numbered.js +1 -1
- package/src/plugins/field/mention.js +2 -2
- package/src/plugins/input/fontSize.js +4 -4
- package/src/plugins/modal/audio.js +12 -0
- package/src/plugins/modal/embed.js +12 -0
- package/src/plugins/modal/image/index.js +12 -0
- package/src/plugins/modal/link.js +12 -0
- package/src/plugins/modal/video/index.js +12 -0
- package/types/langs/_Lang.d.ts +1 -0
- package/types/modules/contract/Browser.d.ts +32 -0
- package/types/modules/ui/ModalAnchorEditor.d.ts +32 -2
- package/types/plugins/browser/audioGallery.d.ts +26 -0
- package/types/plugins/browser/fileBrowser.d.ts +45 -0
- package/types/plugins/browser/fileGallery.d.ts +28 -0
- package/types/plugins/browser/imageGallery.d.ts +28 -0
- package/types/plugins/browser/videoGallery.d.ts +28 -0
- package/types/plugins/command/fileUpload.d.ts +24 -0
- package/types/plugins/field/mention.d.ts +1 -1
- package/types/plugins/modal/audio.d.ts +24 -0
- package/types/plugins/modal/embed.d.ts +24 -0
- package/types/plugins/modal/image/index.d.ts +24 -0
- package/types/plugins/modal/link.d.ts +28 -1
- package/types/plugins/modal/video/index.d.ts +24 -0
|
@@ -32,6 +32,18 @@ export type ImagePluginOptions = {
|
|
|
32
32
|
createUrlInput?: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* - The URL endpoint for image file uploads.
|
|
35
|
+
* - The server must return:
|
|
36
|
+
* ```js
|
|
37
|
+
* {
|
|
38
|
+
* "result": [
|
|
39
|
+
* {
|
|
40
|
+
* "url": "https://example.com/image.jpg",
|
|
41
|
+
* "name": "image.jpg",
|
|
42
|
+
* "size": 123456
|
|
43
|
+
* }
|
|
44
|
+
* ]
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
35
47
|
*/
|
|
36
48
|
uploadUrl?: string;
|
|
37
49
|
/**
|
|
@@ -116,6 +128,18 @@ export type ImageState = {
|
|
|
116
128
|
* @property {boolean} [createUrlInput] - Whether to create a URL input element for image insertion.
|
|
117
129
|
* - Defaults to `true`. Always `true` when `createFileInput` is `false`.
|
|
118
130
|
* @property {string} [uploadUrl] - The URL endpoint for image file uploads.
|
|
131
|
+
* - The server must return:
|
|
132
|
+
* ```js
|
|
133
|
+
* {
|
|
134
|
+
* "result": [
|
|
135
|
+
* {
|
|
136
|
+
* "url": "https://example.com/image.jpg",
|
|
137
|
+
* "name": "image.jpg",
|
|
138
|
+
* "size": 123456
|
|
139
|
+
* }
|
|
140
|
+
* ]
|
|
141
|
+
* }
|
|
142
|
+
* ```
|
|
119
143
|
* @property {Object<string, string>} [uploadHeaders] - Additional headers to include in the file upload request.
|
|
120
144
|
* ```js
|
|
121
145
|
* { uploadUrl: '/api/upload/image', uploadHeaders: { Authorization: 'Bearer token' } }
|
|
@@ -3,6 +3,18 @@ export default Link;
|
|
|
3
3
|
export type LinkOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* - The URL endpoint for file uploads.
|
|
6
|
+
* - The server must return:
|
|
7
|
+
* ```js
|
|
8
|
+
* {
|
|
9
|
+
* "result": [
|
|
10
|
+
* {
|
|
11
|
+
* "url": "https://example.com/file.pdf",
|
|
12
|
+
* "name": "file.pdf",
|
|
13
|
+
* "size": 1048576
|
|
14
|
+
* }
|
|
15
|
+
* ]
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
6
18
|
*/
|
|
7
19
|
uploadUrl?: string;
|
|
8
20
|
/**
|
|
@@ -28,6 +40,18 @@ export type LinkPluginOptions = Omit<LinkOptions & import('../../modules/ui/Moda
|
|
|
28
40
|
/**
|
|
29
41
|
* @typedef {Object} LinkOptions
|
|
30
42
|
* @property {string} [uploadUrl] - The URL endpoint for file uploads.
|
|
43
|
+
* - The server must return:
|
|
44
|
+
* ```js
|
|
45
|
+
* {
|
|
46
|
+
* "result": [
|
|
47
|
+
* {
|
|
48
|
+
* "url": "https://example.com/file.pdf",
|
|
49
|
+
* "name": "file.pdf",
|
|
50
|
+
* "size": 1048576
|
|
51
|
+
* }
|
|
52
|
+
* ]
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
31
55
|
* @property {Object<string, string>} [uploadHeaders] - Additional headers for file upload requests.
|
|
32
56
|
* @property {number} [uploadSizeLimit] - The total file upload size limit in bytes.
|
|
33
57
|
* @property {number} [uploadSingleSizeLimit] - The single file upload size limit in bytes.
|
|
@@ -87,7 +111,10 @@ declare class Link extends PluginModal {
|
|
|
87
111
|
* - Default `rel` values auto-applied by condition.
|
|
88
112
|
* `default` is always applied, `check_new_window` when "Open in new window" is checked, `check_bookmark` for bookmark links.
|
|
89
113
|
* ```js
|
|
90
|
-
* {
|
|
114
|
+
* {
|
|
115
|
+
* relList: ['nofollow', 'noreferrer', 'noopener'],
|
|
116
|
+
* defaultRel: { default: 'noopener', check_new_window: 'noreferrer' }
|
|
117
|
+
* }
|
|
91
118
|
* ```
|
|
92
119
|
*/
|
|
93
120
|
defaultRel?: {
|
|
@@ -32,6 +32,18 @@ export type VideoPluginOptions = {
|
|
|
32
32
|
createUrlInput?: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* - The URL endpoint for video file uploads.
|
|
35
|
+
* - The server must return:
|
|
36
|
+
* ```js
|
|
37
|
+
* {
|
|
38
|
+
* "result": [
|
|
39
|
+
* {
|
|
40
|
+
* "url": "https://example.com/video.mp4",
|
|
41
|
+
* "name": "video.mp4",
|
|
42
|
+
* "size": 5242880
|
|
43
|
+
* }
|
|
44
|
+
* ]
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
35
47
|
*/
|
|
36
48
|
uploadUrl?: string;
|
|
37
49
|
/**
|
|
@@ -155,6 +167,18 @@ export type VideoState = {
|
|
|
155
167
|
* @property {boolean} [createUrlInput] - Whether to create a URL input element for video embedding.
|
|
156
168
|
* - Defaults to `true`. Always `true` when `createFileInput` is `false`.
|
|
157
169
|
* @property {string} [uploadUrl] - The URL endpoint for video file uploads.
|
|
170
|
+
* - The server must return:
|
|
171
|
+
* ```js
|
|
172
|
+
* {
|
|
173
|
+
* "result": [
|
|
174
|
+
* {
|
|
175
|
+
* "url": "https://example.com/video.mp4",
|
|
176
|
+
* "name": "video.mp4",
|
|
177
|
+
* "size": 5242880
|
|
178
|
+
* }
|
|
179
|
+
* ]
|
|
180
|
+
* }
|
|
181
|
+
* ```
|
|
158
182
|
* @property {Object<string, string>} [uploadHeaders] - Additional headers to include in the video upload request.
|
|
159
183
|
* @property {number} [uploadSizeLimit] - The total upload size limit for videos in bytes.
|
|
160
184
|
* @property {number} [uploadSingleSizeLimit] - The single file upload size limit for videos in bytes.
|