suneditor 3.0.5 → 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.
Files changed (35) hide show
  1. package/dist/suneditor.min.css +1 -1
  2. package/dist/suneditor.min.js +1 -1
  3. package/package.json +1 -1
  4. package/src/assets/suneditor.css +51 -3
  5. package/src/core/logic/shell/_commandExecutor.js +38 -1
  6. package/src/core/section/constructor.js +1 -1
  7. package/src/modules/contract/Browser.js +98 -10
  8. package/src/modules/ui/ModalAnchorEditor.js +16 -1
  9. package/src/plugins/browser/audioGallery.js +13 -0
  10. package/src/plugins/browser/fileBrowser.js +22 -0
  11. package/src/plugins/browser/fileGallery.js +14 -0
  12. package/src/plugins/browser/imageGallery.js +14 -0
  13. package/src/plugins/browser/videoGallery.js +14 -0
  14. package/src/plugins/command/fileUpload.js +12 -0
  15. package/src/plugins/field/mention.js +2 -2
  16. package/src/plugins/modal/audio.js +12 -0
  17. package/src/plugins/modal/embed.js +12 -0
  18. package/src/plugins/modal/image/index.js +12 -0
  19. package/src/plugins/modal/link.js +12 -0
  20. package/src/plugins/modal/video/index.js +12 -0
  21. package/types/langs/_Lang.d.ts +1 -0
  22. package/types/modules/contract/Browser.d.ts +32 -0
  23. package/types/modules/ui/ModalAnchorEditor.d.ts +32 -2
  24. package/types/plugins/browser/audioGallery.d.ts +26 -0
  25. package/types/plugins/browser/fileBrowser.d.ts +45 -0
  26. package/types/plugins/browser/fileGallery.d.ts +28 -0
  27. package/types/plugins/browser/imageGallery.d.ts +28 -0
  28. package/types/plugins/browser/videoGallery.d.ts +28 -0
  29. package/types/plugins/command/fileUpload.d.ts +24 -0
  30. package/types/plugins/field/mention.d.ts +1 -1
  31. package/types/plugins/modal/audio.d.ts +24 -0
  32. package/types/plugins/modal/embed.d.ts +24 -0
  33. package/types/plugins/modal/image/index.d.ts +24 -0
  34. package/types/plugins/modal/link.d.ts +28 -1
  35. package/types/plugins/modal/video/index.d.ts +24 -0
@@ -38,6 +38,7 @@ export type _Lang = {
38
38
  caption: string;
39
39
  cellProperties: string;
40
40
  center: string;
41
+ clear: string;
41
42
  close: string;
42
43
  codeView: string;
43
44
  color: string;
@@ -84,6 +84,19 @@ export type BrowserParams = {
84
84
  useSearch?: boolean;
85
85
  /**
86
86
  * - File server search url. Optional. Can be overridden in browser.
87
+ * - Requested as `searchUrl + '?keyword=' + keyword`. The server must return:
88
+ * ```js
89
+ * {
90
+ * "result": [
91
+ * {
92
+ * "src": "https://example.com/file.jpg",
93
+ * "name": "file.jpg",
94
+ * "thumbnail": "https://example.com/file_thumb.jpg",
95
+ * "tag": ["photo"]
96
+ * }
97
+ * ]
98
+ * }
99
+ * ```
87
100
  */
88
101
  searchUrl?: string;
89
102
  /**
@@ -113,6 +126,10 @@ export type BrowserParams = {
113
126
  * - Optional. Can be overridden in browser. Default: 4.
114
127
  */
115
128
  columnSize?: number;
129
+ /**
130
+ * - Initial folder expand depth. `1` expands the first level, `Infinity` expands all. Default: `1`.
131
+ */
132
+ expand?: number;
116
133
  /**
117
134
  * - Default thumbnail
118
135
  */
@@ -142,6 +159,19 @@ export type BrowserParams = {
142
159
  * @property {(target: Node) => void} selectorHandler - Function that actions when an item is clicked. Required. Can be overridden in browser.
143
160
  * @property {boolean} [useSearch] - Whether to use the search function. Optional. Default: `true`.
144
161
  * @property {string} [searchUrl] - File server search url. Optional. Can be overridden in browser.
162
+ * - Requested as `searchUrl + '?keyword=' + keyword`. The server must return:
163
+ * ```js
164
+ * {
165
+ * "result": [
166
+ * {
167
+ * "src": "https://example.com/file.jpg",
168
+ * "name": "file.jpg",
169
+ * "thumbnail": "https://example.com/file_thumb.jpg",
170
+ * "tag": ["photo"]
171
+ * }
172
+ * ]
173
+ * }
174
+ * ```
145
175
  * @property {Object<string, string>} [searchUrlHeader] - File server search http header. Optional. Can be overridden in browser.
146
176
  * @property {string} [listClass] - Class name of list div. Required. Can be overridden in browser.
147
177
  * @property {(item: BrowserFile) => string} [drawItemHandler] - Function that returns HTML string for rendering each file item. Required. Can be overridden in browser.
@@ -152,6 +182,7 @@ export type BrowserParams = {
152
182
  * @property {Array<*>} [props] - `props` argument to `drawItemHandler` function. Optional. Can be overridden in browser.
153
183
  * @property {number} [columnSize] - Number of `div.se-file-item-column` to be created.
154
184
  * - Optional. Can be overridden in browser. Default: 4.
185
+ * @property {number} [expand=1] - Initial folder expand depth. `1` expands the first level, `Infinity` expands all. Default: `1`.
155
186
  * @property {((item: BrowserFile) => string)} [thumbnail] - Default thumbnail
156
187
  */
157
188
  /**
@@ -206,6 +237,7 @@ declare class Browser {
206
237
  drawItemHandler: any;
207
238
  selectorHandler: (target: Node) => void;
208
239
  columnSize: number;
240
+ expand: number;
209
241
  folderDefaultPath: string;
210
242
  closeArrow: any;
211
243
  openArrow: any;
@@ -25,7 +25,10 @@ export type ModalAnchorEditorParams = {
25
25
  * - Default `rel` values auto-applied by condition.
26
26
  * `default` is always applied, `check_new_window` when "Open in new window" is checked, `check_bookmark` for bookmark links.
27
27
  * ```js
28
- * { relList: ['nofollow', 'noreferrer', 'noopener'], defaultRel: { default: 'noopener', check_new_window: 'noreferrer' } }
28
+ * {
29
+ * relList: ['nofollow', 'noreferrer', 'noopener'],
30
+ * defaultRel: { default: 'noopener', check_new_window: 'noreferrer' }
31
+ * }
29
32
  * ```
30
33
  */
31
34
  defaultRel?: {
@@ -35,6 +38,18 @@ export type ModalAnchorEditorParams = {
35
38
  };
36
39
  /**
37
40
  * - File upload URL.
41
+ * - The server must return:
42
+ * ```js
43
+ * {
44
+ * "result": [
45
+ * {
46
+ * "url": "https://example.com/file.pdf",
47
+ * "name": "file.pdf",
48
+ * "size": 1048576
49
+ * }
50
+ * ]
51
+ * }
52
+ * ```
38
53
  */
39
54
  uploadUrl?: string;
40
55
  /**
@@ -70,9 +85,24 @@ export type ModalAnchorEditorParams = {
70
85
  * @property {{default?: string, check_new_window?: string, check_bookmark?: string}} [defaultRel={}] - Default `rel` values auto-applied by condition.
71
86
  * `default` is always applied, `check_new_window` when "Open in new window" is checked, `check_bookmark` for bookmark links.
72
87
  * ```js
73
- * { relList: ['nofollow', 'noreferrer', 'noopener'], defaultRel: { default: 'noopener', check_new_window: 'noreferrer' } }
88
+ * {
89
+ * relList: ['nofollow', 'noreferrer', 'noopener'],
90
+ * defaultRel: { default: 'noopener', check_new_window: 'noreferrer' }
91
+ * }
74
92
  * ```
75
93
  * @property {string} [uploadUrl] - File upload URL.
94
+ * - The server must return:
95
+ * ```js
96
+ * {
97
+ * "result": [
98
+ * {
99
+ * "url": "https://example.com/file.pdf",
100
+ * "name": "file.pdf",
101
+ * "size": 1048576
102
+ * }
103
+ * ]
104
+ * }
105
+ * ```
76
106
  * @property {Object<string, string>} [uploadHeaders] - File upload headers.
77
107
  * @property {number} [uploadSizeLimit] - File upload size limit.
78
108
  * @property {number} [uploadSingleSizeLimit] - File upload single size limit.
@@ -7,6 +7,19 @@ export type AudioGalleryPluginOptions = {
7
7
  data?: Array<SunEditor.Module.Browser.File>;
8
8
  /**
9
9
  * - Server request URL
10
+ * - The server must return:
11
+ * ```js
12
+ * {
13
+ * "result": [
14
+ * {
15
+ * "src": "https://example.com/audio.mp3",
16
+ * "name": "audio.mp3",
17
+ * "thumbnail": "https://example.com/audio_icon.png",
18
+ * "tag": ["music"]
19
+ * }
20
+ * ]
21
+ * }
22
+ * ```
10
23
  */
11
24
  url?: string;
12
25
  /**
@@ -24,6 +37,19 @@ export type AudioGalleryPluginOptions = {
24
37
  * @typedef {Object} AudioGalleryPluginOptions
25
38
  * @property {Array<SunEditor.Module.Browser.File>} [data] - Direct data without server calls
26
39
  * @property {string} [url] - Server request URL
40
+ * - The server must return:
41
+ * ```js
42
+ * {
43
+ * "result": [
44
+ * {
45
+ * "src": "https://example.com/audio.mp3",
46
+ * "name": "audio.mp3",
47
+ * "thumbnail": "https://example.com/audio_icon.png",
48
+ * "tag": ["music"]
49
+ * }
50
+ * ]
51
+ * }
52
+ * ```
27
53
  * @property {Object<string, string>} [headers] - Server request headers
28
54
  * @property {string|((item: SunEditor.Module.Browser.File) => string)} [thumbnail] - Default thumbnail
29
55
  */
@@ -11,6 +11,26 @@ export type FileBrowserPluginOptions = {
11
11
  | Array<any>;
12
12
  /**
13
13
  * - Server request URL
14
+ * - The server must return a nested folder structure.
15
+ * - `_data`: array (inline) or string URL (lazy-loaded on folder click).
16
+ * - `"default": true` sets the initially selected folder.
17
+ * ```js
18
+ * {
19
+ * "result": {
20
+ * "root": {
21
+ * "name": "Root",
22
+ * "default": true,
23
+ * "_data": [
24
+ * { "src": "https://example.com/file1.pdf", "name": "file1.pdf" }
25
+ * ],
26
+ * "documents": {
27
+ * "name": "Documents",
28
+ * "_data": "https://api.example.com/files/documents"
29
+ * }
30
+ * }
31
+ * }
32
+ * }
33
+ * ```
14
34
  */
15
35
  url?: string;
16
36
  /**
@@ -23,6 +43,10 @@ export type FileBrowserPluginOptions = {
23
43
  * - Default thumbnail URL or a function that returns a thumbnail URL per item.
24
44
  */
25
45
  thumbnail?: string | ((item: SunEditor.Module.Browser.File) => string);
46
+ /**
47
+ * - Initial folder expand depth. `1` expands the first level, `Infinity` expands all. Default: `1`.
48
+ */
49
+ expand?: number;
26
50
  /**
27
51
  * - Additional tag names
28
52
  * ```js
@@ -35,8 +59,29 @@ export type FileBrowserPluginOptions = {
35
59
  * @typedef {Object} FileBrowserPluginOptions
36
60
  * @property {Object<string, *>|Array<*>} [data] - Direct data without server calls (bypasses URL fetch).
37
61
  * @property {string} [url] - Server request URL
62
+ * - The server must return a nested folder structure.
63
+ * - `_data`: array (inline) or string URL (lazy-loaded on folder click).
64
+ * - `"default": true` sets the initially selected folder.
65
+ * ```js
66
+ * {
67
+ * "result": {
68
+ * "root": {
69
+ * "name": "Root",
70
+ * "default": true,
71
+ * "_data": [
72
+ * { "src": "https://example.com/file1.pdf", "name": "file1.pdf" }
73
+ * ],
74
+ * "documents": {
75
+ * "name": "Documents",
76
+ * "_data": "https://api.example.com/files/documents"
77
+ * }
78
+ * }
79
+ * }
80
+ * }
81
+ * ```
38
82
  * @property {Object<string, string>} [headers] - Server request headers
39
83
  * @property {string|((item: SunEditor.Module.Browser.File) => string)} [thumbnail] - Default thumbnail URL or a function that returns a thumbnail URL per item.
84
+ * @property {number} [expand=1] - Initial folder expand depth. `1` expands the first level, `Infinity` expands all. Default: `1`.
40
85
  * @property {Array<string>} [props] - Additional tag names
41
86
  * ```js
42
87
  * { url: '/api/files', headers: { Authorization: 'Bearer token' }, thumbnail: (item) => item.thumbUrl }
@@ -7,6 +7,20 @@ export type FileGalleryPluginOptions = {
7
7
  data?: Array<SunEditor.Module.Browser.File>;
8
8
  /**
9
9
  * - Server request URL
10
+ * - The server must return:
11
+ * ```js
12
+ * {
13
+ * "result": [
14
+ * {
15
+ * "src": "https://example.com/doc.pdf",
16
+ * "name": "doc.pdf",
17
+ * "thumbnail": "https://example.com/pdf_icon.png",
18
+ * "type": "file", // video, image ..[plugin name]
19
+ * "tag": ["document"]
20
+ * }
21
+ * ]
22
+ * }
23
+ * ```
10
24
  */
11
25
  url?: string;
12
26
  /**
@@ -24,6 +38,20 @@ export type FileGalleryPluginOptions = {
24
38
  * @typedef {Object} FileGalleryPluginOptions
25
39
  * @property {Array<SunEditor.Module.Browser.File>} [data] - Direct data without server calls
26
40
  * @property {string} [url] - Server request URL
41
+ * - The server must return:
42
+ * ```js
43
+ * {
44
+ * "result": [
45
+ * {
46
+ * "src": "https://example.com/doc.pdf",
47
+ * "name": "doc.pdf",
48
+ * "thumbnail": "https://example.com/pdf_icon.png",
49
+ * "type": "file", // video, image ..[plugin name]
50
+ * "tag": ["document"]
51
+ * }
52
+ * ]
53
+ * }
54
+ * ```
27
55
  * @property {Object<string, string>} [headers] - Server request headers
28
56
  * @property {string|((item: SunEditor.Module.Browser.File) => string)} [thumbnail] - Default thumbnail
29
57
  */
@@ -7,6 +7,20 @@ export type ImageGalleryPluginOptions = {
7
7
  data?: Array<any>;
8
8
  /**
9
9
  * - Server request URL
10
+ * - The server must return:
11
+ * ```js
12
+ * {
13
+ * "result": [
14
+ * {
15
+ * "src": "https://example.com/img.jpg",
16
+ * "name": "img.jpg",
17
+ * "thumbnail": "https://example.com/img_thumb.jpg",
18
+ * "alt": "description",
19
+ * "tag": ["nature"]
20
+ * }
21
+ * ]
22
+ * }
23
+ * ```
10
24
  */
11
25
  url?: string;
12
26
  /**
@@ -20,6 +34,20 @@ export type ImageGalleryPluginOptions = {
20
34
  * @typedef ImageGalleryPluginOptions
21
35
  * @property {Array<*>} [data] - Direct data without server calls
22
36
  * @property {string} [url] - Server request URL
37
+ * - The server must return:
38
+ * ```js
39
+ * {
40
+ * "result": [
41
+ * {
42
+ * "src": "https://example.com/img.jpg",
43
+ * "name": "img.jpg",
44
+ * "thumbnail": "https://example.com/img_thumb.jpg",
45
+ * "alt": "description",
46
+ * "tag": ["nature"]
47
+ * }
48
+ * ]
49
+ * }
50
+ * ```
23
51
  * @property {Object<string, string>} [headers] - Server request headers
24
52
  */
25
53
  /**
@@ -7,6 +7,20 @@ export type VideoGalleryPluginOptions = {
7
7
  data?: Array<SunEditor.Module.Browser.File>;
8
8
  /**
9
9
  * - Server request URL
10
+ * - The server must return:
11
+ * ```js
12
+ * {
13
+ * "result": [
14
+ * {
15
+ * "src": "https://example.com/video.mp4",
16
+ * "name": "video.mp4",
17
+ * "thumbnail": "https://example.com/video_thumb.jpg",
18
+ * "frame": "video",
19
+ * "tag": ["tutorial"]
20
+ * }
21
+ * ]
22
+ * }
23
+ * ```
10
24
  */
11
25
  url?: string;
12
26
  /**
@@ -24,6 +38,20 @@ export type VideoGalleryPluginOptions = {
24
38
  * @typedef {Object} VideoGalleryPluginOptions
25
39
  * @property {Array<SunEditor.Module.Browser.File>} [data] - Direct data without server calls
26
40
  * @property {string} [url] - Server request URL
41
+ * - The server must return:
42
+ * ```js
43
+ * {
44
+ * "result": [
45
+ * {
46
+ * "src": "https://example.com/video.mp4",
47
+ * "name": "video.mp4",
48
+ * "thumbnail": "https://example.com/video_thumb.jpg",
49
+ * "frame": "video",
50
+ * "tag": ["tutorial"]
51
+ * }
52
+ * ]
53
+ * }
54
+ * ```
27
55
  * @property {Object<string, string>} [headers] - Server request headers
28
56
  * @property {string|((item: SunEditor.Module.Browser.File) => string)} [thumbnail] - Default thumbnail
29
57
  */
@@ -3,6 +3,18 @@ export default FileUpload;
3
3
  export type FileUploadPluginOptions = {
4
4
  /**
5
5
  * - Server request URL for file upload
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
  /**
@@ -51,6 +63,18 @@ export type FileUploadPluginOptions = {
51
63
  /**
52
64
  * @typedef FileUploadPluginOptions
53
65
  * @property {string} uploadUrl - Server request URL for file upload
66
+ * - The server must return:
67
+ * ```js
68
+ * {
69
+ * "result": [
70
+ * {
71
+ * "url": "https://example.com/file.pdf",
72
+ * "name": "file.pdf",
73
+ * "size": 1048576
74
+ * }
75
+ * ]
76
+ * }
77
+ * ```
54
78
  * @property {Object<string, string>} [uploadHeaders] - Server request headers
55
79
  * @property {number} [uploadSizeLimit] - Total upload size limit in bytes
56
80
  * @property {number} [uploadSingleSizeLimit] - Single file size limit in bytes
@@ -53,7 +53,7 @@ export type MentionPluginOptions = {
53
53
  * @property {string} [triggerText="@"] - The character that triggers the mention list.
54
54
  * @property {number} [limitSize=5] - The number of items to display in the mention list
55
55
  * @property {number} [searchStartLength=0] - The number of characters to start searching for the mention list
56
- * @property {number} [delayTime=200] - The time to wait before displaying the mention list
56
+ * @property {number} [delayTime=120] - The time to wait before displaying the mention list
57
57
  * @property {Array<{key: string, name: string, url: string}>} [data] - Static mention data (used instead of API).
58
58
  * ```js
59
59
  * // data
@@ -20,6 +20,18 @@ export type AudioPluginOptions = {
20
20
  createUrlInput?: boolean;
21
21
  /**
22
22
  * - The URL to which files will be uploaded.
23
+ * - The server must return:
24
+ * ```js
25
+ * {
26
+ * "result": [
27
+ * {
28
+ * "url": "https://example.com/audio.mp3",
29
+ * "name": "audio.mp3",
30
+ * "size": 3145728
31
+ * }
32
+ * ]
33
+ * }
34
+ * ```
23
35
  */
24
36
  uploadUrl?: string;
25
37
  /**
@@ -71,6 +83,18 @@ export type AudioPluginOptions = {
71
83
  * @property {boolean} [createUrlInput] - Whether to create a URL input element.
72
84
  * - Defaults to `true`. Always `true` when `createFileInput` is `false`.
73
85
  * @property {string} [uploadUrl] - The URL to which files will be uploaded.
86
+ * - The server must return:
87
+ * ```js
88
+ * {
89
+ * "result": [
90
+ * {
91
+ * "url": "https://example.com/audio.mp3",
92
+ * "name": "audio.mp3",
93
+ * "size": 3145728
94
+ * }
95
+ * ]
96
+ * }
97
+ * ```
74
98
  * @property {Object<string, string>} [uploadHeaders] - Headers to include in the file upload request.
75
99
  * @property {number} [uploadSizeLimit] - The total upload size limit in bytes.
76
100
  * @property {number} [uploadSingleSizeLimit] - The single file size limit in bytes.
@@ -23,6 +23,18 @@ export type EmbedPluginOptions = {
23
23
  percentageOnlySize?: boolean;
24
24
  /**
25
25
  * - The URL for file uploads.
26
+ * - The server must return:
27
+ * ```js
28
+ * {
29
+ * "result": [
30
+ * {
31
+ * "url": "https://example.com/embed.html",
32
+ * "name": "embed.html",
33
+ * "size": 2048
34
+ * }
35
+ * ]
36
+ * }
37
+ * ```
26
38
  */
27
39
  uploadUrl?: string;
28
40
  /**
@@ -110,6 +122,18 @@ export type EmbedPluginOptions = {
110
122
  * @property {string} [defaultHeight] - The default height of the embed element (numeric value or with unit).
111
123
  * @property {boolean} [percentageOnlySize=false] - Whether to allow only percentage-based sizing.
112
124
  * @property {string} [uploadUrl] - The URL for file uploads.
125
+ * - The server must return:
126
+ * ```js
127
+ * {
128
+ * "result": [
129
+ * {
130
+ * "url": "https://example.com/embed.html",
131
+ * "name": "embed.html",
132
+ * "size": 2048
133
+ * }
134
+ * ]
135
+ * }
136
+ * ```
113
137
  * @property {Object<string, string>} [uploadHeaders] - Headers to include in file upload requests.
114
138
  * @property {number} [uploadSizeLimit] - The total file upload size limit in bytes.
115
139
  * @property {number} [uploadSingleSizeLimit] - The single file upload size limit in bytes.
@@ -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
- * { relList: ['nofollow', 'noreferrer', 'noopener'], defaultRel: { default: 'noopener', check_new_window: 'noreferrer' } }
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.