@keyblade/tinymce-editor-vue2 0.0.12-alpha.9 → 0.1.1

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 CHANGED
@@ -1,17 +1,17 @@
1
1
  # tinymce 富文本编辑器
2
- tinymce编辑器
2
+ 一码游 tinymce 编辑器
3
3
 
4
4
  ## 前提
5
- 必须将vue 版本升级至2.7+,按如下文档操作,一般来说只需要升级 vue、及 @vue/cli-xxx 版本即可
5
+ 必须将 `vue` 版本升级至 `2.7+`,按如下文档操作,一般来说只需要升级 vue、及 @vue/cli-xxx 版本即可
6
6
 
7
- 升级指南:- https://v2.cn.vuejs.org/v2/guide/migration-vue-2-7.html
7
+ 升级指南:https://v2.cn.vuejs.org/v2/guide/migration-vue-2-7.html
8
8
 
9
9
  ## 一、安装
10
10
  ```shell
11
11
  yarn add @keyblade/tinymce-editor-vue2
12
- # 下面两个第三方依赖注意版本,必须匹配,否则css样式有问题
13
- yarn add pic-viewer@0.5.1 (如项目中已有,则忽略)
14
- yarn add imgpond@0.6.2 (如项目中已有,则忽略)
12
+ # 下面两个是编辑器需要的第三方依赖,如原项目中有,可以不用安装,但要注意版本,必须匹配,否则css样式有问题。
13
+ yarn add pic-viewer@0.5.1
14
+ yarn add imgpond@0.6.2
15
15
  ```
16
16
 
17
17
  ## 二、使用
@@ -31,24 +31,37 @@ Vue.use(PicViewer, {})
31
31
  Vue.use(ImgPond, {})
32
32
 
33
33
  Vue.use(TinymceEditor, {
34
- imageUploadHandle: (file, filename, parameters: { extParameters: Record<string, any> }) => {
35
- return new Promise((resolve) => {
36
- setTimeout(() => {
37
- resolve({
38
- success: true,
39
- url: 'https://object.gcongo.com.cn/onecode-travel/nonClassic/8cefe379c03b5f39cd8ef725293a3c02/2024/5/1715995588295/d0b5bb458b694130be0c63e2f1d0090b.png',
40
- errorMessage: '',
41
- })
42
- }, 1000)
43
- })
34
+ // 图片
35
+ imageUploadOptions: {
36
+ handleRequest: (file: File, filename: string, parameters: { extParameters: Record<string, any> }) => {
37
+ return new Promise((resolve) => {
38
+ setTimeout(() => {
39
+ resolve({
40
+ success: true,
41
+ url: 'https://object.gcongo.com.cn/onecode-travel/nonClassic/8cefe379c03b5f39cd8ef725293a3c02/2024/5/1715995588295/d0b5bb458b694130be0c63e2f1d0090b.png'
42
+ })
43
+ }, 1000)
44
+ })
45
+ },
46
+ // 网络图片,将URL传给后端,让后端下载后校验、转换、压缩等操作
47
+ handleRequestByUrl: (url: string, parameters: { extParameters: Record<string, any> }) => {
48
+ return new Promise((resolve) => {
49
+ setTimeout(() => {
50
+ resolve({
51
+ success: true,
52
+ url: 'https://object.gcongo.com.cn/onecode-travel/nonClassic/8cefe379c03b5f39cd8ef725293a3c02/2024/5/1715995588295/d0b5bb458b694130be0c63e2f1d0090b.png'
53
+ })
54
+ }, 1000)
55
+ })
56
+ }
44
57
  },
45
58
  // 音频
46
59
  audioUploadOptions: {
47
- action: 'https://qt.gcongo.com.cn/msg/file/upload',
60
+ action: '/api/man/file/upload',
48
61
  headers: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => {
49
62
  return {
50
63
  Appkey: 'dsy_2AeyG8N0CqEC',
51
- Authorization: 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJOelF4WW1jeU5qUmtabU5tTlRWaU9UUTZaREV6WkdOa1l6TXpZemt5WmpSbE16RXhNVEkyTVRJek9VeGJSRUpSTWpBPTlZNjNYN1dVRzNPQiIsImlzcyI6ImRlMjdkNDAzNzNiZjY3NGJkYTUyN2E5Yzg4NjliZTI1Iiwic3ViIjoiQVBQIiwiYXVkIjoiZHN5X1FPTXF2R0haU1MyZCIsImlhdCI6MTcxNjE5NDc4MSwiZXhwIjoxNzE2Nzk5NTgxfQ.krM-HWCvR-PLa6dcup6RGthxpST1pFrHN9cngyK89lU'
64
+ Authorization: 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJNell4T1RnNE1qSmtOVGhuWnpVM05qbGlaamM2WWpFMlpUTTBNak16Tnpkbk16RXhNVEkyTVRJek9VSk1SRnRNTjFZPTQ2VkdDWk84VzFDUSIsImlzcyI6IjM2MTFlY2IyYTY3NzMzZDk1OTI4OWQzYzM4ZjY0Y2Q3Iiwic3ViIjoiQVBQIiwiYXVkIjoiZHN5XzJBZXlHOE4wQ3FFQyIsImlhdCI6MTcxNjY4NzU2MCwiZXhwIjoxNzE3MjkyMzYwfQ.PPhupuc_X0yHB3ex1dVEGVdFyCMmlGYRvZHokVIGcaU'
52
65
  }
53
66
  },
54
67
  data: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => {
@@ -60,17 +73,15 @@ Vue.use(TinymceEditor, {
60
73
  },
61
74
  // 视频
62
75
  videoUploadOptions: {
63
- action: 'https://qt.gcongo.com.cn/msg/file/upload',
76
+ action: '/api/man/file/upload',
64
77
  headers: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => {
65
78
  return {
66
79
  Appkey: 'dsy_2AeyG8N0CqEC',
67
- Authorization: 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJOelF4WW1jeU5qUmtabU5tTlRWaU9UUTZaREV6WkdOa1l6TXpZemt5WmpSbE16RXhNVEkyTVRJek9VeGJSRUpSTWpBPTlZNjNYN1dVRzNPQiIsImlzcyI6ImRlMjdkNDAzNzNiZjY3NGJkYTUyN2E5Yzg4NjliZTI1Iiwic3ViIjoiQVBQIiwiYXVkIjoiZHN5X1FPTXF2R0haU1MyZCIsImlhdCI6MTcxNjE5NDc4MSwiZXhwIjoxNzE2Nzk5NTgxfQ.krM-HWCvR-PLa6dcup6RGthxpST1pFrHN9cngyK89lU'
80
+ Authorization: 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJNell4T1RnNE1qSmtOVGhuWnpVM05qbGlaamM2WWpFMlpUTTBNak16Tnpkbk16RXhNVEkyTVRJek9VSk1SRnRNTjFZPTQ2VkdDWk84VzFDUSIsImlzcyI6IjM2MTFlY2IyYTY3NzMzZDk1OTI4OWQzYzM4ZjY0Y2Q3Iiwic3ViIjoiQVBQIiwiYXVkIjoiZHN5XzJBZXlHOE4wQ3FFQyIsImlhdCI6MTcxNjY4NzU2MCwiZXhwIjoxNzE3MjkyMzYwfQ.PPhupuc_X0yHB3ex1dVEGVdFyCMmlGYRvZHokVIGcaU'
68
81
  }
69
82
  },
70
83
  data: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => {
71
- return {
72
- a: '1'
73
- }
84
+ return {}
74
85
  },
75
86
  handlerResponse: (response: any) => {
76
87
  return { url: response.data, errorMessage: response.msg }
@@ -99,127 +110,131 @@ onMounted(() => {
99
110
  </script>
100
111
  ```
101
112
 
102
- ### 3.使用工具类(单独使用图片上传组件的,可使用这两个工具类自行处理)
103
- ```typescript
104
- import { oneTravelImageCheck, oneTravelImageCompressor } from '@keyblade/tinymce-editor-vue2'
105
-
106
- // oneTravelImageCheck: 一码游图片检测工具
107
- // oneTravelImageCompressor: 一码游图片压缩工具
108
- ```
109
-
110
113
  ## 三、Api
111
114
  ### 1.全局属性
112
115
  ```typescript
113
116
  interface TinymceEditorGlobalOptions {
114
- /** 图片上传请求处理,需要返回图片地址 */
115
- imageUploadHandle?: (file: File | Blob, filename: string, options?: {
116
- extParameters?: Record<string, any>
117
- }) => Promise<{success: boolean; url?: string; errorMessage?: string}>;
118
- /** 接着默认配置进行处理 */
119
- paste_preprocess?: (editor: Editor, args: {
120
- content: string;
121
- readonly internal: boolean;
122
- }) => void;
123
- /** 接着默认配置进行处理 */
124
- paste_postprocess?: (editor: Editor, args: {
125
- node: HTMLElement;
126
- readonly internal: boolean;
127
- }) => void;
128
- tinymceOptions?: RawEditorOptions;
117
+ /** 富文本编辑器选项 */
118
+ options?: RawEditorOptions;
119
+
120
+ /** 图片上传选项 */
121
+ imageUploadOptions?: ImageUploadOptions;
122
+
129
123
  /** imgPond 选项 */
130
- imgPondOptions?: Record<string, any>
124
+ imgPondOptions?: Record<string, any>;
125
+
131
126
  /** 音频上传选项 */
132
- audioUploadOptions?: {
133
- action: string;
134
- handlerResponse: (response: any) => { url?: string; errorMessage?: string }
135
- headers?: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => Record<string, any>;
136
- data?: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => Record<string, any>;
137
- },
127
+ audioUploadOptions?: AudioUploadOptions;
128
+
138
129
  /** 视频上传选项 */
139
- videoUploadOptions?: {
140
- action: string;
141
- handlerResponse: (response: any) => { url?: string; errorMessage?: string }
142
- headers?: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => Record<string, any>;
143
- data?: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => Record<string, any>;
144
- }
130
+ videoUploadOptions?: VideoUploadOptions;
145
131
  }
146
132
  ```
147
133
 
148
134
  ### 2.组件属性
149
135
  ```typescript
150
- interface ComponentProps {
136
+ interface ComponentOptions {
151
137
  /** vue2 v-model */
152
138
  value?: string
153
- /** vue3 v-model */
154
- modelValue?: string;
155
139
  /** 是否禁止编辑 */
156
140
  disabled?: boolean;
157
141
  /** 额外参数 */
158
- extParameters?: Record<string, any>,
142
+ extParameters?: Record<string, any>;
143
+
144
+ /** 富文本编辑器选项 */
145
+ options?: Partial<RawEditorOptions>
146
+
147
+ /** 图片上传选项 */
148
+ imageUploadOptions?: ImageUploadOptions;
149
+
150
+ /** imgPond选项 */
151
+ imgPondOptions?: Record<string, any>;
152
+
153
+ /** 音频上传组件选项 */
154
+ audioUploadOptions?: AudioUploadOptions;
155
+
156
+ /** 视频上传选项 */
157
+ videoUploadOptions?: VideoUploadOptions;
158
+
159
+ /** 初始化完成 */
160
+ initComplete?: (params: { editorIns: Editor }) => void;
161
+ }
162
+ ```
163
+
164
+ ### 3.图片上传配置
165
+ ```typescript
166
+ export interface ImageUploadOptions {
159
167
  /** 图片上传组件最大数量 */
160
- imageUploadMaxCount?: number;
161
- /** 图片上传提示 */
162
- imageUploadTip?: string;
168
+ maxCount?: number;
169
+ /** 图片上传组件下方文字 */
170
+ tipText?: string;
163
171
  /** 图片最大值(单位M,主要用于错误提示) */
164
- imageMaxSize?: number;
165
- /** 图片允许的类型 */
166
- imageAllowedType?: string[];
167
- /** 图片允许的类型 */
168
- imageAllowedMineType?: string[];
172
+ maxSize?: number;
173
+ /** 图片允许的后缀类型(小写,如: png、jpg) */
174
+ allowedType?: string[];
169
175
  /** 图片最小宽度 */
170
- imageMinWidth?: number;
176
+ minWidth?: number;
171
177
  /** 图片最小高度 */
172
- imageMinHeight?: number;
178
+ minHeight?: number;
173
179
  /** 图片最大宽度 */
174
- imageMaxWidth?: number;
180
+ maxWidth?: number;
175
181
  /** 图片最大高度 */
176
- imageMaxHeight?: number;
177
- /** 是否开启音频 */
178
- audioEnable?: boolean
179
- /** 音频最大尺寸(M) */
180
- audioMaxSize?: number;
181
- /** 音频结尾格式 */
182
- audioAllowedType?: string[];
183
- /** 音频上传选项 */
184
- audioUploadOptions?: {
185
- action: string;
186
- handlerResponse: (response: any) => { url?: string; errorMessage?: string }
187
- headers?: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => Record<string, any>;
188
- data?: (parameters: { file: File | Blob, extParameters: Record<string, any> }) => Record<string, any>;
189
- },
190
- /** 是否开启视频 */
191
- videoEnable?: boolean
192
- /** 视频最大尺寸(M) */
193
- videoMaxSize?: number;
194
- /** 视频结尾格式 */
195
- videoAllowedType?: string[];
196
- /** 视频上传选项 */
197
- videoUploadOptions?: {
198
- action: string;
199
- handlerResponse: (response: any) => { url?: string; errorMessage?: string }
200
- headers?: (parameters: { file: File | Blob, extParameters: {} }) => Record<string, any>;
201
- data?: (parameters: { file: File | Blob, extParameters: {} }) => Record<string, any>;
202
- }
203
- /** 图片上传请求处理,需要返回图片地址 */
204
- imageUploadHandle?: (file: File | Blob, filename: string, options?: {
182
+ maxHeight?: number;
183
+ /** 图片上传请求处理 */
184
+ handleRequest?: (file: File, filename: string, options?: {
185
+ extParameters?: Record<string, any>
186
+ }) => Promise<{success: boolean; url?: string; errorMessage?: string}>;
187
+ /** 图片URL上传请求处理(前端跨域,交给后端处理) */
188
+ handleRequestByUrl?: (url: string, options?: {
205
189
  extParameters?: Record<string, any>
206
190
  }) => Promise<{success: boolean; url?: string; errorMessage?: string}>;
207
- /** 接着默认配置进行处理 */
208
- paste_preprocess?: (editor: Editor, args: {
209
- content: string;
210
- readonly internal: boolean;
211
- }) => void;
212
- /** 接着默认配置进行处理 */
213
- paste_postprocess?: (editor: Editor, args: {
214
- node: HTMLElement;
215
- readonly internal: boolean;
216
- }) => void;
217
- /** 初始化完成 */
218
- initComplete?: (params: { editorIns: Editor }) => void,
219
- /** 富文本编辑器选项 */
220
- options?: Partial<RawEditorOptions>
221
- /** imgPond 选项 */
222
- imgPondOptions?: Record<string, any>
223
191
  }
224
192
  ```
225
193
 
194
+ ### 4.视频上传配置
195
+ ```typescript
196
+ export interface VideoUploadOptions {
197
+ /** 是否启用 */
198
+ enable?: boolean;
199
+ /** 最大尺寸(M) */
200
+ maxSize?: number;
201
+ /** 允许的后缀类型(小写,如: mp4) */
202
+ allowedType?: string[];
203
+ /** 文件接收的类型 */
204
+ accept?: string;
205
+ /** 上传地址(启用必传) */
206
+ action?: string;
207
+ /** 请求头 */
208
+ headers?: (parameters: { file: File | Blob, extParameters?: Record<string, any> }) => Record<string, any>;
209
+ /** 额外请求体 */
210
+ data?: (parameters: { file: File | Blob, extParameters?: Record<string, any> }) => Record<string, any>;
211
+ /** 上传之前回调结束(开始调用上传接口) */
212
+ beforeUploadEnd?: (file: File | Blob) => void
213
+ /** 响应处理(启用必传) */
214
+ handlerResponse?: (response: any) => { url?: string; errorMessage?: string }
215
+ }
216
+ ```
217
+
218
+ ### 5.音频上传配置
219
+ ```typescript
220
+ export interface AudioUploadOptions {
221
+ /** 是否启用 */
222
+ enable?: boolean;
223
+ /** 最大尺寸(M) */
224
+ maxSize?: number;
225
+ /** 允许的后缀类型(小写,如: mp4) */
226
+ allowedType?: string[];
227
+ /** 文件接收的类型 */
228
+ accept?: string;
229
+ /** 上传地址(启用必传) */
230
+ action?: string;
231
+ /** 请求头 */
232
+ headers?: (parameters: { file: File | Blob, extParameters?: Record<string, any> }) => Record<string, any>;
233
+ /** 额外请求体 */
234
+ data?: (parameters: { file: File | Blob, extParameters?: Record<string, any> }) => Record<string, any>;
235
+ /** 上传之前回调结束(开始调用上传接口) */
236
+ beforeUploadEnd?: (file: File | Blob) => void
237
+ /** 响应处理(启用必传) */
238
+ handlerResponse?: (response: any) => { url?: string; errorMessage?: string }
239
+ }
240
+ ```
@@ -1,258 +1,64 @@
1
1
  import { Editor, RawEditorOptions } from 'tinymce';
2
+ import { AudioUploadOptions, ImageUploadOptions, VideoUploadOptions } from './types';
2
3
 
3
4
  declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
5
  /** vue2 v-model */
5
6
  value?: string | undefined;
6
- /** vue3 v-model */
7
- modelValue?: string | undefined;
8
7
  /** 是否禁止编辑 */
9
8
  disabled?: boolean | undefined;
10
9
  /** 额外参数 */
11
10
  extParameters?: Record<string, any> | undefined;
12
- /** 图片上传组件最大数量 */
13
- imageUploadMaxCount?: number | undefined;
14
- /** 图片上传提示 */
15
- imageUploadTip?: string | undefined;
16
- /** 图片最大值(单位M,主要用于错误提示) */
17
- imageMaxSize?: number | undefined;
18
- /** 图片允许的类型 */
19
- imageAllowedType?: string[] | undefined;
20
- /** 图片允许的类型 */
21
- imageAllowedMineType?: string[] | undefined;
22
- /** 图片最小宽度 */
23
- imageMinWidth?: number | undefined;
24
- /** 图片最小高度 */
25
- imageMinHeight?: number | undefined;
26
- /** 图片最大宽度 */
27
- imageMaxWidth?: number | undefined;
28
- /** 图片最大高度 */
29
- imageMaxHeight?: number | undefined;
30
- /** 是否开启音频 */
31
- audioEnable?: boolean | undefined;
32
- /** 音频最大尺寸(M) */
33
- audioMaxSize?: number | undefined;
34
- /** 音频结尾格式 */
35
- audioAllowedType?: string[] | undefined;
36
- /** 音频上传选项 */
37
- audioUploadOptions?: {
38
- action: string;
39
- handlerResponse: (response: any) => {
40
- url?: string;
41
- errorMessage?: string;
42
- };
43
- headers?: ((parameters: {
44
- file: File | Blob;
45
- extParameters: Record<string, any>;
46
- }) => Record<string, any>) | undefined;
47
- data?: ((parameters: {
48
- file: File | Blob;
49
- extParameters: Record<string, any>;
50
- }) => Record<string, any>) | undefined;
51
- } | undefined;
52
- /** 是否开启视频 */
53
- videoEnable?: boolean | undefined;
54
- /** 视频最大尺寸(M) */
55
- videoMaxSize?: number | undefined;
56
- /** 视频结尾格式 */
57
- videoAllowedType?: string[] | undefined;
11
+ /** 富文本编辑器选项 */
12
+ options?: Partial<RawEditorOptions> | undefined;
13
+ /** 图片上传选项 */
14
+ imageUploadOptions?: ImageUploadOptions | undefined;
15
+ /** imgPond选项 */
16
+ imgPondOptions?: Record<string, any> | undefined;
17
+ /** 音频上传组件选项 */
18
+ audioUploadOptions?: AudioUploadOptions | undefined;
58
19
  /** 视频上传选项 */
59
- videoUploadOptions?: {
60
- action: string;
61
- handlerResponse: (response: any) => {
62
- url?: string;
63
- errorMessage?: string;
64
- };
65
- headers?: ((parameters: {
66
- file: File | Blob;
67
- extParameters: {};
68
- }) => Record<string, any>) | undefined;
69
- data?: ((parameters: {
70
- file: File | Blob;
71
- extParameters: {};
72
- }) => Record<string, any>) | undefined;
73
- } | undefined;
74
- /** 图片上传请求处理,需要返回图片地址 */
75
- imageUploadHandle?: ((file: File | Blob, filename: string, options?: {
76
- extParameters?: Record<string, any>;
77
- }) => Promise<{
78
- success: boolean;
79
- url?: string;
80
- errorMessage?: string;
81
- }>) | undefined;
82
- /** 接着默认配置进行处理 */
83
- paste_preprocess?: ((editor: Editor, args: {
84
- content: string;
85
- readonly internal: boolean;
86
- }) => void) | undefined;
87
- /** 接着默认配置进行处理 */
88
- paste_postprocess?: ((editor: Editor, args: {
89
- node: HTMLElement;
90
- readonly internal: boolean;
91
- }) => void) | undefined;
20
+ videoUploadOptions?: VideoUploadOptions | undefined;
92
21
  /** 初始化完成 */
93
22
  initComplete?: ((params: {
94
23
  editorIns: Editor;
95
24
  }) => void) | undefined;
96
- /** 富文本编辑器选项 */
97
- options?: Partial<RawEditorOptions> | undefined;
98
- /** imgPond 选项 */
99
- imgPondOptions?: Record<string, any> | undefined;
100
25
  }>, {
101
26
  value: string;
102
- modelValue: string;
103
- imageUploadMaxCount: number;
104
- imageUploadTip: string;
105
- imageMaxSize: number;
106
- imageAllowedType: () => string[];
107
- imageAllowedMineType: () => string[];
108
- imageMinWidth: number;
109
- imageMinHeight: number;
110
- imageMaxWidth: number;
111
- imageMaxHeight: number;
112
- audioEnable: boolean;
113
- videoEnable: boolean;
114
- audioMaxSize: number;
115
- videoMaxSize: number;
116
- audioAllowedType: () => string[];
117
- videoAllowedType: () => string[];
27
+ disabled: boolean;
28
+ extParameters: () => {};
118
29
  options: () => {};
119
30
  }>, {}, {}, {}, {}, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {
120
31
  input: (value: string) => void;
121
- "update:modelValue": (value: string) => void;
122
32
  }, string, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
123
33
  /** vue2 v-model */
124
34
  value?: string | undefined;
125
- /** vue3 v-model */
126
- modelValue?: string | undefined;
127
35
  /** 是否禁止编辑 */
128
36
  disabled?: boolean | undefined;
129
37
  /** 额外参数 */
130
38
  extParameters?: Record<string, any> | undefined;
131
- /** 图片上传组件最大数量 */
132
- imageUploadMaxCount?: number | undefined;
133
- /** 图片上传提示 */
134
- imageUploadTip?: string | undefined;
135
- /** 图片最大值(单位M,主要用于错误提示) */
136
- imageMaxSize?: number | undefined;
137
- /** 图片允许的类型 */
138
- imageAllowedType?: string[] | undefined;
139
- /** 图片允许的类型 */
140
- imageAllowedMineType?: string[] | undefined;
141
- /** 图片最小宽度 */
142
- imageMinWidth?: number | undefined;
143
- /** 图片最小高度 */
144
- imageMinHeight?: number | undefined;
145
- /** 图片最大宽度 */
146
- imageMaxWidth?: number | undefined;
147
- /** 图片最大高度 */
148
- imageMaxHeight?: number | undefined;
149
- /** 是否开启音频 */
150
- audioEnable?: boolean | undefined;
151
- /** 音频最大尺寸(M) */
152
- audioMaxSize?: number | undefined;
153
- /** 音频结尾格式 */
154
- audioAllowedType?: string[] | undefined;
155
- /** 音频上传选项 */
156
- audioUploadOptions?: {
157
- action: string;
158
- handlerResponse: (response: any) => {
159
- url?: string;
160
- errorMessage?: string;
161
- };
162
- headers?: ((parameters: {
163
- file: File | Blob;
164
- extParameters: Record<string, any>;
165
- }) => Record<string, any>) | undefined;
166
- data?: ((parameters: {
167
- file: File | Blob;
168
- extParameters: Record<string, any>;
169
- }) => Record<string, any>) | undefined;
170
- } | undefined;
171
- /** 是否开启视频 */
172
- videoEnable?: boolean | undefined;
173
- /** 视频最大尺寸(M) */
174
- videoMaxSize?: number | undefined;
175
- /** 视频结尾格式 */
176
- videoAllowedType?: string[] | undefined;
39
+ /** 富文本编辑器选项 */
40
+ options?: Partial<RawEditorOptions> | undefined;
41
+ /** 图片上传选项 */
42
+ imageUploadOptions?: ImageUploadOptions | undefined;
43
+ /** imgPond选项 */
44
+ imgPondOptions?: Record<string, any> | undefined;
45
+ /** 音频上传组件选项 */
46
+ audioUploadOptions?: AudioUploadOptions | undefined;
177
47
  /** 视频上传选项 */
178
- videoUploadOptions?: {
179
- action: string;
180
- handlerResponse: (response: any) => {
181
- url?: string;
182
- errorMessage?: string;
183
- };
184
- headers?: ((parameters: {
185
- file: File | Blob;
186
- extParameters: {};
187
- }) => Record<string, any>) | undefined;
188
- data?: ((parameters: {
189
- file: File | Blob;
190
- extParameters: {};
191
- }) => Record<string, any>) | undefined;
192
- } | undefined;
193
- /** 图片上传请求处理,需要返回图片地址 */
194
- imageUploadHandle?: ((file: File | Blob, filename: string, options?: {
195
- extParameters?: Record<string, any>;
196
- }) => Promise<{
197
- success: boolean;
198
- url?: string;
199
- errorMessage?: string;
200
- }>) | undefined;
201
- /** 接着默认配置进行处理 */
202
- paste_preprocess?: ((editor: Editor, args: {
203
- content: string;
204
- readonly internal: boolean;
205
- }) => void) | undefined;
206
- /** 接着默认配置进行处理 */
207
- paste_postprocess?: ((editor: Editor, args: {
208
- node: HTMLElement;
209
- readonly internal: boolean;
210
- }) => void) | undefined;
48
+ videoUploadOptions?: VideoUploadOptions | undefined;
211
49
  /** 初始化完成 */
212
50
  initComplete?: ((params: {
213
51
  editorIns: Editor;
214
52
  }) => void) | undefined;
215
- /** 富文本编辑器选项 */
216
- options?: Partial<RawEditorOptions> | undefined;
217
- /** imgPond 选项 */
218
- imgPondOptions?: Record<string, any> | undefined;
219
53
  }>, {
220
54
  value: string;
221
- modelValue: string;
222
- imageUploadMaxCount: number;
223
- imageUploadTip: string;
224
- imageMaxSize: number;
225
- imageAllowedType: () => string[];
226
- imageAllowedMineType: () => string[];
227
- imageMinWidth: number;
228
- imageMinHeight: number;
229
- imageMaxWidth: number;
230
- imageMaxHeight: number;
231
- audioEnable: boolean;
232
- videoEnable: boolean;
233
- audioMaxSize: number;
234
- videoMaxSize: number;
235
- audioAllowedType: () => string[];
236
- videoAllowedType: () => string[];
55
+ disabled: boolean;
56
+ extParameters: () => {};
237
57
  options: () => {};
238
58
  }>>>, {
239
- imageMaxSize: number;
240
- imageAllowedMineType: string[];
241
- imageMinWidth: number;
242
- imageMinHeight: number;
243
- imageMaxWidth: number;
244
- imageMaxHeight: number;
245
59
  value: string;
246
- modelValue: string;
247
- imageUploadMaxCount: number;
248
- imageUploadTip: string;
249
- imageAllowedType: string[];
250
- audioEnable: boolean;
251
- audioMaxSize: number;
252
- audioAllowedType: string[];
253
- videoEnable: boolean;
254
- videoMaxSize: number;
255
- videoAllowedType: string[];
60
+ disabled: boolean;
61
+ extParameters: Record<string, any>;
256
62
  options: Partial<RawEditorOptions>;
257
63
  }>;
258
64
  export default _default;