vue-editify 0.2.13 → 0.2.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/examples/App.vue +49 -67
- package/lib/components/button/button.vue.d.ts +62 -60
- package/lib/components/button/index.d.ts +4 -0
- package/lib/components/button/props.d.ts +12 -1
- package/lib/components/checkbox/checkbox.vue.d.ts +9 -9
- package/lib/components/checkbox/index.d.ts +4 -0
- package/lib/components/checkbox/props.d.ts +2 -2
- package/lib/components/colors/colors.vue.d.ts +4 -4
- package/lib/components/colors/index.d.ts +4 -0
- package/lib/components/colors/props.d.ts +2 -2
- package/lib/components/icon/index.d.ts +4 -0
- package/lib/components/insertAttachment/index.d.ts +4 -0
- package/lib/{plugins/attachment → components}/insertAttachment/insertAttachment.vue.d.ts +3 -3
- package/lib/{plugins/attachment → components}/insertAttachment/props.d.ts +1 -1
- package/lib/components/insertImage/index.d.ts +4 -0
- package/lib/components/insertImage/insertImage.vue.d.ts +3 -3
- package/lib/components/insertImage/props.d.ts +1 -1
- package/lib/components/insertLink/index.d.ts +4 -0
- package/lib/components/insertLink/insertLink.vue.d.ts +6 -6
- package/lib/components/insertLink/props.d.ts +3 -3
- package/lib/components/insertMathformula/index.d.ts +4 -0
- package/lib/{plugins/mathformula → components}/insertMathformula/insertMathformula.vue.d.ts +3 -3
- package/lib/{plugins/mathformula → components}/insertMathformula/props.d.ts +2 -2
- package/lib/components/insertTable/index.d.ts +4 -0
- package/lib/components/insertTable/insertTable.vue.d.ts +3 -3
- package/lib/components/insertTable/props.d.ts +2 -2
- package/lib/components/insertVideo/index.d.ts +4 -0
- package/lib/components/insertVideo/insertVideo.vue.d.ts +3 -3
- package/lib/components/insertVideo/props.d.ts +1 -1
- package/lib/components/layer/index.d.ts +4 -0
- package/lib/components/layer/layer.vue.d.ts +10 -8
- package/lib/components/tooltip/index.d.ts +4 -0
- package/lib/components/tooltip/tooltip.vue.d.ts +6 -4
- package/lib/components/triangle/index.d.ts +4 -0
- package/lib/components/triangle/triangle.vue.d.ts +1 -1
- package/lib/components/updateLink/index.d.ts +4 -0
- package/lib/components/updateLink/props.d.ts +17 -0
- package/lib/components/updateLink/updateLink.vue.d.ts +38 -0
- package/lib/core/function.d.ts +113 -36
- package/lib/core/rule.d.ts +20 -0
- package/lib/core/tool.d.ts +36 -34
- package/lib/editify/editify.vue.d.ts +86 -53
- package/lib/editify/menu/index.d.ts +4 -0
- package/lib/{components → editify}/menu/menu.vue.d.ts +3 -4
- package/lib/{components → editify}/menu/props.d.ts +1 -1
- package/lib/editify/props.d.ts +3 -7
- package/lib/editify/toolbar/index.d.ts +4 -0
- package/lib/{components → editify}/toolbar/props.d.ts +2 -2
- package/lib/{components → editify}/toolbar/toolbar.vue.d.ts +53 -53
- package/lib/editify.es.js +8879 -7668
- package/lib/editify.umd.js +2 -2
- package/lib/feature/align.d.ts +32 -0
- package/lib/feature/attachment.d.ts +18 -0
- package/lib/feature/backColor.d.ts +32 -0
- package/lib/feature/bold.d.ts +32 -0
- package/lib/feature/code.d.ts +32 -0
- package/lib/feature/codeBlock.d.ts +32 -0
- package/lib/feature/fontFamily.d.ts +32 -0
- package/lib/feature/fontSize.d.ts +32 -0
- package/lib/feature/foreColor.d.ts +32 -0
- package/lib/feature/formatClear.d.ts +32 -0
- package/lib/feature/fullScreen.d.ts +18 -0
- package/lib/feature/heading.d.ts +32 -0
- package/lib/feature/image.d.ts +32 -0
- package/lib/feature/indent.d.ts +18 -0
- package/lib/feature/infoBlock.d.ts +18 -0
- package/lib/feature/italic.d.ts +32 -0
- package/lib/feature/lineHeight.d.ts +32 -0
- package/lib/feature/link.d.ts +26 -0
- package/lib/feature/mathformula.d.ts +22 -0
- package/lib/feature/orderList.d.ts +32 -0
- package/lib/feature/panel.d.ts +18 -0
- package/lib/feature/quote.d.ts +18 -0
- package/lib/feature/redo.d.ts +18 -0
- package/lib/feature/separator.d.ts +18 -0
- package/lib/feature/sourceView.d.ts +18 -0
- package/lib/feature/strikethrough.d.ts +32 -0
- package/lib/feature/sub.d.ts +32 -0
- package/lib/feature/super.d.ts +32 -0
- package/lib/feature/table.d.ts +32 -0
- package/lib/feature/task.d.ts +32 -0
- package/lib/feature/underline.d.ts +32 -0
- package/lib/feature/undo.d.ts +18 -0
- package/lib/feature/unorderList.d.ts +32 -0
- package/lib/feature/video.d.ts +38 -0
- package/lib/index.d.ts +104 -69
- package/package.json +5 -5
- package/src/components/button/button.vue +21 -24
- package/src/components/button/index.ts +5 -0
- package/src/components/button/props.ts +14 -1
- package/src/components/checkbox/checkbox.vue +1 -1
- package/src/components/checkbox/index.ts +5 -0
- package/src/components/checkbox/props.ts +1 -1
- package/src/components/colors/colors.vue +3 -3
- package/src/components/colors/index.ts +5 -0
- package/src/components/colors/props.ts +2 -2
- package/src/components/icon/index.ts +5 -0
- package/src/components/insertAttachment/index.ts +5 -0
- package/src/{plugins/attachment → components}/insertAttachment/insertAttachment.vue +4 -2
- package/src/{plugins/attachment → components}/insertAttachment/props.ts +1 -1
- package/src/components/insertImage/index.ts +5 -0
- package/src/components/insertImage/insertImage.vue +5 -5
- package/src/components/insertImage/props.ts +1 -1
- package/src/components/insertLink/index.ts +5 -0
- package/src/components/insertLink/insertLink.vue +10 -10
- package/src/components/insertLink/props.ts +3 -3
- package/src/components/insertMathformula/index.ts +5 -0
- package/src/{plugins/mathformula → components}/insertMathformula/props.ts +2 -2
- package/src/components/insertTable/index.ts +5 -0
- package/src/components/insertTable/props.ts +2 -2
- package/src/components/insertVideo/index.ts +5 -0
- package/src/components/insertVideo/insertVideo.vue +2 -2
- package/src/components/insertVideo/props.ts +1 -1
- package/src/components/layer/index.ts +5 -0
- package/src/components/layer/layer.vue +42 -4
- package/src/components/tooltip/index.ts +5 -0
- package/src/components/tooltip/tooltip.vue +1 -1
- package/src/components/triangle/index.ts +5 -0
- package/src/components/triangle/triangle.vue +1 -1
- package/src/components/updateLink/index.ts +5 -0
- package/src/components/updateLink/props.ts +21 -0
- package/src/components/{toolbar/toolbar.less → updateLink/updateLink.less} +4 -20
- package/src/components/updateLink/updateLink.vue +74 -0
- package/src/core/function.ts +289 -97
- package/src/core/rule.ts +96 -7
- package/src/core/tool.ts +234 -78
- package/src/editify/editify.less +2 -0
- package/src/editify/editify.vue +182 -185
- package/src/editify/menu/index.ts +5 -0
- package/src/editify/menu/menu.vue +215 -0
- package/src/{components → editify}/menu/props.ts +1 -1
- package/src/editify/props.ts +7 -11
- package/src/editify/toolbar/index.ts +5 -0
- package/src/{components → editify}/toolbar/props.ts +1 -1
- package/src/editify/toolbar/toolbar.less +10 -0
- package/src/editify/toolbar/toolbar.vue +103 -0
- package/src/feature/align.ts +128 -0
- package/src/feature/attachment.ts +109 -0
- package/src/feature/backColor.ts +171 -0
- package/src/feature/bold.ts +136 -0
- package/src/feature/code.ts +136 -0
- package/src/feature/codeBlock.ts +204 -0
- package/src/feature/fontFamily.ts +140 -0
- package/src/feature/fontSize.ts +142 -0
- package/src/feature/foreColor.ts +173 -0
- package/src/feature/formatClear.ts +118 -0
- package/src/feature/fullScreen.ts +57 -0
- package/src/feature/heading.ts +154 -0
- package/src/feature/image.ts +225 -0
- package/src/feature/indent.ts +73 -0
- package/src/feature/infoBlock.ts +94 -0
- package/src/feature/italic.ts +136 -0
- package/src/feature/lineHeight.ts +165 -0
- package/src/feature/link.ts +149 -0
- package/src/feature/mathformula.ts +147 -0
- package/src/feature/orderList.ts +116 -0
- package/src/feature/panel.ts +108 -0
- package/src/feature/quote.ts +61 -0
- package/src/feature/redo.ts +56 -0
- package/src/feature/separator.ts +62 -0
- package/src/feature/sourceView.ts +59 -0
- package/src/feature/strikethrough.ts +136 -0
- package/src/feature/sub.ts +136 -0
- package/src/feature/super.ts +136 -0
- package/src/feature/table.ts +994 -0
- package/src/feature/task.ts +116 -0
- package/src/feature/underline.ts +136 -0
- package/src/feature/undo.ts +56 -0
- package/src/feature/unorderList.ts +116 -0
- package/src/feature/video.ts +339 -0
- package/src/hljs/index.ts +1 -1
- package/src/index.ts +69 -21
- package/src/locale/en_US.ts +3 -3
- package/src/locale/zh_CN.ts +3 -3
- package/lib/plugins/attachment/index.d.ts +0 -37
- package/lib/plugins/infoBlock/index.d.ts +0 -55
- package/lib/plugins/mathformula/index.d.ts +0 -49
- package/lib/plugins/panel/index.d.ts +0 -48
- package/src/components/menu/menu.vue +0 -1655
- package/src/components/toolbar/toolbar.vue +0 -1677
- package/src/plugins/attachment/index.ts +0 -237
- package/src/plugins/infoBlock/index.ts +0 -238
- package/src/plugins/mathformula/index.ts +0 -295
- package/src/plugins/panel/index.ts +0 -228
- package/tsconfig.json +0 -31
- package/tsconfig.node.json +0 -11
- /package/src/{plugins/attachment → components}/insertAttachment/insertAttachment.less +0 -0
- /package/src/{plugins/mathformula → components}/insertMathformula/insertMathformula.less +0 -0
- /package/src/{plugins/mathformula → components}/insertMathformula/insertMathformula.vue +0 -0
- /package/src/{components → editify}/menu/menu.less +0 -0
package/lib/core/function.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlexElement, AlexElementsRangeType
|
|
1
|
+
import { AlexEditor, AlexElement, AlexElementsRangeType } from 'alex-editor';
|
|
2
2
|
import { ObjectType } from './tool';
|
|
3
3
|
|
|
4
4
|
export type ElementMatchConfigType = {
|
|
@@ -63,110 +63,187 @@ export declare const getMatchElementByElement: (element: AlexElement, config: El
|
|
|
63
63
|
*/
|
|
64
64
|
export declare const getMatchElementByRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType, config: ElementMatchConfigType) => AlexElement | null;
|
|
65
65
|
/**
|
|
66
|
-
* Open API
|
|
66
|
+
* Open API:判断元素是否有序或者无序列表,不做空元素判断
|
|
67
67
|
* @param element
|
|
68
68
|
* @param ordered
|
|
69
69
|
* @returns
|
|
70
70
|
*/
|
|
71
|
-
export declare const
|
|
71
|
+
export declare const elementIsList: (element: AlexElement, ordered?: boolean | undefined) => boolean;
|
|
72
72
|
/**
|
|
73
|
-
* Open API
|
|
73
|
+
* Open API:判断元素是否在有序列表或者无序列表下,是的话返回有序列表或者无序列表元素,否则返回null
|
|
74
74
|
* @param element
|
|
75
|
+
* @param ordered
|
|
75
76
|
* @returns
|
|
76
77
|
*/
|
|
77
|
-
export declare const
|
|
78
|
+
export declare const getListByElement: (element: AlexElement, ordered: boolean) => AlexElement | null;
|
|
78
79
|
/**
|
|
79
|
-
* Open API
|
|
80
|
-
* @param
|
|
80
|
+
* Open API:选区是否含有有序列表或者无序列表,不一定是同一个有序列表或者序列表,只要含有有序列表或者序列表即返回true
|
|
81
|
+
* @param editor
|
|
82
|
+
* @param dataRangeCaches
|
|
83
|
+
* @param ordered
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
export declare const hasListInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType, ordered?: boolean | undefined) => boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Open API:选区是否全部在有序列表或者无序列表内,不一定是同一个有序列表或者无序列表
|
|
89
|
+
* @param editor
|
|
90
|
+
* @param dataRangeCaches
|
|
81
91
|
* @param ordered
|
|
82
92
|
* @returns
|
|
83
93
|
*/
|
|
84
|
-
export declare const
|
|
94
|
+
export declare const rangeIsInList: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType, ordered?: boolean | undefined) => boolean;
|
|
85
95
|
/**
|
|
86
|
-
* Open API
|
|
96
|
+
* Open API:判断元素是否任务列表,不做空元素判断
|
|
87
97
|
* @param element
|
|
88
98
|
* @returns
|
|
89
99
|
*/
|
|
90
|
-
export declare const
|
|
100
|
+
export declare const elementIsTask: (element: AlexElement) => boolean;
|
|
91
101
|
/**
|
|
92
|
-
* Open API
|
|
102
|
+
* Open API:判断元素是否在任务列表下,是的话返回任务列表元素,否则返回null
|
|
103
|
+
* @param element
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
export declare const getTaskByElement: (element: AlexElement) => AlexElement | null;
|
|
107
|
+
/**
|
|
108
|
+
* Open API:选区是否含有任务列表,不一定是同一个任务列表,只要含有任务列表即返回true
|
|
93
109
|
* @param editor
|
|
94
110
|
* @param dataRangeCaches
|
|
95
111
|
* @returns
|
|
96
112
|
*/
|
|
97
|
-
export declare const
|
|
113
|
+
export declare const hasTaskInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
98
114
|
/**
|
|
99
|
-
* Open API
|
|
115
|
+
* Open API:选区是否全部在任务列表里,不一定是同一个任务列表
|
|
100
116
|
* @param editor
|
|
101
117
|
* @param dataRangeCaches
|
|
102
118
|
* @returns
|
|
103
119
|
*/
|
|
104
|
-
export declare const
|
|
120
|
+
export declare const rangeIsInTask: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
105
121
|
/**
|
|
106
|
-
* Open API
|
|
122
|
+
* Open API:判断元素是否附件,不做空元素判断
|
|
123
|
+
* @param element
|
|
124
|
+
* @returns
|
|
125
|
+
*/
|
|
126
|
+
export declare const elementIsAttachment: (element: AlexElement) => boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Open API:选区是否含有附件,不一定是同一个附件,只要含有附件即返回true
|
|
107
129
|
* @param editor
|
|
108
130
|
* @param dataRangeCaches
|
|
109
|
-
* @param ordered
|
|
110
131
|
* @returns
|
|
111
132
|
*/
|
|
112
|
-
export declare const
|
|
133
|
+
export declare const hasAttachmentInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Open API:判断元素是否数学公式,不做空元素判断
|
|
136
|
+
* @param element
|
|
137
|
+
* @returns
|
|
138
|
+
*/
|
|
139
|
+
export declare const elementIsMathformula: (element: AlexElement) => boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Open API:判断元素是否在数学公式下,是的话返回数学公式元素,否则返回null
|
|
142
|
+
* @param element
|
|
143
|
+
* @returns
|
|
144
|
+
*/
|
|
145
|
+
export declare const getMathformulaByElement: (element: AlexElement) => AlexElement | null;
|
|
113
146
|
/**
|
|
114
|
-
* Open API
|
|
147
|
+
* Open API:选区是否含有数学公式,不一定是同一个数学公式,只要含有数学公式即返回true
|
|
115
148
|
* @param editor
|
|
116
149
|
* @param dataRangeCaches
|
|
117
150
|
* @returns
|
|
118
151
|
*/
|
|
119
|
-
export declare const
|
|
152
|
+
export declare const hasMathformulaInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Open API:判断元素是否面板,不做空元素判断
|
|
155
|
+
* @param el
|
|
156
|
+
* @returns
|
|
157
|
+
*/
|
|
158
|
+
export declare const elementIsPanel: (element: AlexElement) => boolean;
|
|
120
159
|
/**
|
|
121
|
-
* Open API
|
|
160
|
+
* Open API:判断元素是否在面板内,是的话返回面板元素,否则返回null
|
|
161
|
+
* @param el
|
|
162
|
+
* @returns
|
|
163
|
+
*/
|
|
164
|
+
export declare const getPanelByElement: (element: AlexElement) => AlexElement | null;
|
|
165
|
+
/**
|
|
166
|
+
* Open API:选区是否含有面板,不一定是同一个面板,只要含有面板即返回true
|
|
122
167
|
* @param editor
|
|
123
168
|
* @param dataRangeCaches
|
|
124
169
|
* @returns
|
|
125
170
|
*/
|
|
126
|
-
export declare const
|
|
171
|
+
export declare const hasPanelInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Open API:判断元素是否信息块,不做空元素判断
|
|
174
|
+
* @param el
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
177
|
+
export declare const elementIsInfoBlock: (element: AlexElement) => boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Open API:判断元素是否在信息块内,是的话返回信息块元素,否则返回null
|
|
180
|
+
* @param el
|
|
181
|
+
* @returns
|
|
182
|
+
*/
|
|
183
|
+
export declare const getInfoBlockByElement: (element: AlexElement) => AlexElement | null;
|
|
127
184
|
/**
|
|
128
|
-
* Open API
|
|
185
|
+
* Open API:选区是否含有信息块,不一定是同一个信息块,只要含有信息块即返回true
|
|
129
186
|
* @param editor
|
|
130
187
|
* @param dataRangeCaches
|
|
131
188
|
* @returns
|
|
132
189
|
*/
|
|
133
|
-
export declare const
|
|
190
|
+
export declare const hasInfoBlockInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
134
191
|
/**
|
|
135
|
-
* Open API
|
|
192
|
+
* Open API:选区是否全部在信息块里,不一定是同一个信息块
|
|
136
193
|
* @param editor
|
|
137
194
|
* @param dataRangeCaches
|
|
138
195
|
* @returns
|
|
139
196
|
*/
|
|
140
|
-
export declare const
|
|
197
|
+
export declare const rangeIsInInfoBlock: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
141
198
|
/**
|
|
142
|
-
* Open API
|
|
199
|
+
* Open API:选区是否含有代码块,不一定是同一个代码块,只要含有代码块即返回true
|
|
143
200
|
* @param editor
|
|
144
201
|
* @param dataRangeCaches
|
|
145
202
|
* @returns
|
|
146
203
|
*/
|
|
147
|
-
export declare const
|
|
204
|
+
export declare const hasPreInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
148
205
|
/**
|
|
149
|
-
* Open API
|
|
206
|
+
* Open API:选区是否含有引用,不一定是同一个引用,只要含有引用即返回true
|
|
150
207
|
* @param editor
|
|
151
208
|
* @param dataRangeCaches
|
|
152
209
|
* @returns
|
|
153
210
|
*/
|
|
154
|
-
export declare const
|
|
211
|
+
export declare const hasQuoteInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
155
212
|
/**
|
|
156
|
-
* Open API
|
|
213
|
+
* Open API:选区是否含有链接,不一定是同一个链接,只要含有链接即返回true
|
|
157
214
|
* @param editor
|
|
158
215
|
* @param dataRangeCaches
|
|
159
|
-
* @param ordered
|
|
160
216
|
* @returns
|
|
161
217
|
*/
|
|
162
|
-
export declare const
|
|
218
|
+
export declare const hasLinkInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Open API:选区是否含有表格,不一定是同一个表格,只要含有表格即返回true
|
|
221
|
+
* @param editor
|
|
222
|
+
* @param dataRangeCaches
|
|
223
|
+
* @returns
|
|
224
|
+
*/
|
|
225
|
+
export declare const hasTableInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Open API:选区是否含有图片,不一定是同一个图片,只要含有图片即返回true
|
|
228
|
+
* @param editor
|
|
229
|
+
* @param dataRangeCaches
|
|
230
|
+
* @returns
|
|
231
|
+
*/
|
|
232
|
+
export declare const hasImageInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Open API:选区是否含有视频,不一定是同一个视频,只要含有视频即返回true
|
|
235
|
+
* @param editor
|
|
236
|
+
* @param dataRangeCaches
|
|
237
|
+
* @returns
|
|
238
|
+
*/
|
|
239
|
+
export declare const hasVideoInRange: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
163
240
|
/**
|
|
164
|
-
* Open API
|
|
241
|
+
* Open API:选区是否全部在引用内,不一定是同一个引用
|
|
165
242
|
* @param editor
|
|
166
243
|
* @param dataRangeCaches
|
|
167
244
|
* @returns
|
|
168
245
|
*/
|
|
169
|
-
export declare const
|
|
246
|
+
export declare const rangeIsInQuote: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType) => boolean;
|
|
170
247
|
/**
|
|
171
248
|
* Open API:查询光标所在的文本元素是否具有某个样式
|
|
172
249
|
* @param editor
|
|
@@ -186,7 +263,7 @@ export declare const queryTextStyle: (editor: AlexEditor, dataRangeCaches: AlexE
|
|
|
186
263
|
*/
|
|
187
264
|
export declare const queryTextMark: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType, name: string, value?: string | number) => boolean;
|
|
188
265
|
/**
|
|
189
|
-
* Open API
|
|
266
|
+
* Open API:获取选区内的文字内容
|
|
190
267
|
* @param dataRangeCaches
|
|
191
268
|
* @returns
|
|
192
269
|
*/
|
|
@@ -253,7 +330,7 @@ export declare const setQuote: (editor: AlexEditor, dataRangeCaches: AlexElement
|
|
|
253
330
|
* @param value 取值justify/left/right/center
|
|
254
331
|
* @returns
|
|
255
332
|
*/
|
|
256
|
-
export declare const setAlign: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType, value:
|
|
333
|
+
export declare const setAlign: (editor: AlexEditor, dataRangeCaches: AlexElementsRangeType, value: "justify" | "left" | "right" | "center") => void;
|
|
257
334
|
/**
|
|
258
335
|
* Open API:插入或者取消 有序或者无序列表
|
|
259
336
|
* @param editor
|
package/lib/core/rule.d.ts
CHANGED
|
@@ -45,6 +45,26 @@ export declare const tableRangeMergedHandle: (editor: AlexEditor, element: AlexE
|
|
|
45
45
|
* @param languages
|
|
46
46
|
*/
|
|
47
47
|
export declare const preHandle: (editor: AlexEditor, element: AlexElement, highlight: boolean, languages: (string | LanguagesItemType)[]) => void;
|
|
48
|
+
/**
|
|
49
|
+
* 元素格式化时处理附件元素
|
|
50
|
+
* @param editor
|
|
51
|
+
* @param element
|
|
52
|
+
* @param $editTrans
|
|
53
|
+
*/
|
|
54
|
+
export declare const attachmentHandle: (editor: AlexEditor, element: AlexElement, $editTrans: (key: string) => any) => void;
|
|
55
|
+
/**
|
|
56
|
+
* 元素格式化时处理数学公式元素
|
|
57
|
+
* @param editor
|
|
58
|
+
* @param element
|
|
59
|
+
*/
|
|
60
|
+
export declare const mathformulaHandle: (editor: AlexEditor, element: AlexElement) => void;
|
|
61
|
+
/**
|
|
62
|
+
* 元素格式化时处理信息块元素
|
|
63
|
+
* @param editor
|
|
64
|
+
* @param element
|
|
65
|
+
* @param color
|
|
66
|
+
*/
|
|
67
|
+
export declare const infoBlockHandle: (_editor: AlexEditor, element: AlexElement, color: string) => void;
|
|
48
68
|
/**
|
|
49
69
|
* 元素格式化时处理一些特殊的内部块元素,转为根级块元素
|
|
50
70
|
* @param editor
|
package/lib/core/tool.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { App, Component,
|
|
2
|
-
import { AlexElement } from 'alex-editor';
|
|
3
|
-
import { ButtonOptionsItemType, ButtonTypeType } from '../components/button/props';
|
|
1
|
+
import { App, Component, VNode } from 'vue';
|
|
4
2
|
import { LocaleType } from '../locale';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { Button, ButtonOptionsItemType, ButtonTypeType } from '../components/button';
|
|
4
|
+
import { InsertImageUploadErrorType } from '../components/insertImage';
|
|
5
|
+
import { InsertAttachmentUploadErrorType } from '../components/insertAttachment';
|
|
7
6
|
|
|
8
7
|
export type ObjectType = {
|
|
9
8
|
[key: string]: any;
|
|
@@ -22,6 +21,7 @@ export interface MenuButtonType {
|
|
|
22
21
|
show?: boolean;
|
|
23
22
|
leftBorder?: boolean;
|
|
24
23
|
rightBorder?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
25
|
}
|
|
26
26
|
export interface MenuSelectButtonType extends MenuButtonType {
|
|
27
27
|
options?: (string | number | ButtonOptionsItemType)[];
|
|
@@ -34,23 +34,35 @@ export interface MenuDisplayButtonType extends MenuSelectButtonType {
|
|
|
34
34
|
export interface MenuImageButtonType extends MenuButtonType {
|
|
35
35
|
allowedFileType?: string[];
|
|
36
36
|
multiple?: boolean;
|
|
37
|
-
maxSize?: number
|
|
38
|
-
minSize?: number
|
|
39
|
-
customUpload?: ((files: File[]) => string[]) | ((files: File[]) => Promise<string[]>)
|
|
40
|
-
handleError?: (
|
|
37
|
+
maxSize?: number;
|
|
38
|
+
minSize?: number;
|
|
39
|
+
customUpload?: ((files: File[]) => string[]) | ((files: File[]) => Promise<string[]>);
|
|
40
|
+
handleError?: (error: InsertImageUploadErrorType, file: File) => void;
|
|
41
41
|
}
|
|
42
42
|
export interface MenuVideoButtonType extends MenuButtonType {
|
|
43
43
|
allowedFileType?: string[];
|
|
44
44
|
multiple?: boolean;
|
|
45
|
-
maxSize?: number
|
|
46
|
-
minSize?: number
|
|
47
|
-
customUpload?: ((files: File[]) => string[]) | ((files: File[]) => Promise<string[]>)
|
|
48
|
-
handleError?: (
|
|
45
|
+
maxSize?: number;
|
|
46
|
+
minSize?: number;
|
|
47
|
+
customUpload?: ((files: File[]) => string[]) | ((files: File[]) => Promise<string[]>);
|
|
48
|
+
handleError?: (error: InsertImageUploadErrorType, file: File) => void;
|
|
49
49
|
}
|
|
50
50
|
export interface MenuTableButtonType extends MenuButtonType {
|
|
51
51
|
maxRows?: number;
|
|
52
52
|
maxColumns?: number;
|
|
53
53
|
}
|
|
54
|
+
export interface MenuAttachmentButtonType extends MenuButtonType {
|
|
55
|
+
accept?: string;
|
|
56
|
+
allowedFileType?: string[];
|
|
57
|
+
multiple?: boolean;
|
|
58
|
+
maxSize?: number;
|
|
59
|
+
minSize?: number;
|
|
60
|
+
customUpload?: ((files: File[]) => string[]) | ((files: File[]) => Promise<string[]>);
|
|
61
|
+
handleError?: (error: InsertAttachmentUploadErrorType, file: File) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface MenuMathformulaButtonType extends MenuButtonType {
|
|
64
|
+
handleError?: (error: Error) => void;
|
|
65
|
+
}
|
|
54
66
|
export type MenuCustomButtonType = {
|
|
55
67
|
type?: ButtonTypeType;
|
|
56
68
|
title?: string;
|
|
@@ -96,11 +108,10 @@ export type TextToolbarType = {
|
|
|
96
108
|
};
|
|
97
109
|
export type ToolbarConfigType = {
|
|
98
110
|
use?: boolean;
|
|
99
|
-
style?: ObjectType
|
|
111
|
+
style?: ObjectType;
|
|
100
112
|
tooltip?: boolean;
|
|
101
113
|
codeBlock?: CodeBlockToolbarType;
|
|
102
114
|
text?: TextToolbarType;
|
|
103
|
-
extraDisabled?: ((name: string) => boolean) | null;
|
|
104
115
|
};
|
|
105
116
|
export type MenuSequenceType = {
|
|
106
117
|
[key: string]: number | undefined;
|
|
@@ -133,6 +144,10 @@ export type MenuSequenceType = {
|
|
|
133
144
|
codeBlock?: number;
|
|
134
145
|
sourceView?: number;
|
|
135
146
|
fullScreen?: number;
|
|
147
|
+
attachment?: number;
|
|
148
|
+
mathformula?: number;
|
|
149
|
+
panel?: number;
|
|
150
|
+
infoBlock?: number;
|
|
136
151
|
};
|
|
137
152
|
export type MenuModeType = 'default' | 'inner' | 'fixed';
|
|
138
153
|
export type MenuExtendType = {
|
|
@@ -142,8 +157,7 @@ export type MenuConfigType = {
|
|
|
142
157
|
use?: boolean;
|
|
143
158
|
tooltip?: boolean;
|
|
144
159
|
mode?: MenuModeType;
|
|
145
|
-
|
|
146
|
-
style?: ObjectType | null;
|
|
160
|
+
style?: ObjectType;
|
|
147
161
|
sequence?: MenuSequenceType;
|
|
148
162
|
undo?: MenuButtonType;
|
|
149
163
|
redo?: MenuButtonType;
|
|
@@ -175,24 +189,12 @@ export type MenuConfigType = {
|
|
|
175
189
|
codeBlock?: MenuButtonType;
|
|
176
190
|
sourceView?: MenuButtonType;
|
|
177
191
|
fullScreen?: MenuButtonType;
|
|
192
|
+
attachment?: MenuAttachmentButtonType;
|
|
193
|
+
mathformula?: MenuMathformulaButtonType;
|
|
194
|
+
panel?: MenuButtonType;
|
|
195
|
+
infoBlock?: MenuButtonType;
|
|
178
196
|
extends?: MenuExtendType;
|
|
179
197
|
};
|
|
180
|
-
export type PluginMenuConfigType = {
|
|
181
|
-
extraDisabled?: ((name: string) => boolean) | null;
|
|
182
|
-
sequence: number;
|
|
183
|
-
extend: MenuCustomButtonType;
|
|
184
|
-
};
|
|
185
|
-
export type PluginResultType = {
|
|
186
|
-
name: string;
|
|
187
|
-
menu?: PluginMenuConfigType;
|
|
188
|
-
updateView?: () => void;
|
|
189
|
-
customParseNode?: (element: AlexElement) => AlexElement;
|
|
190
|
-
extraKeepTags?: string[];
|
|
191
|
-
renderRule?: (el: AlexElement) => void;
|
|
192
|
-
pasteKeepMarks?: (el: AlexElement) => ObjectType;
|
|
193
|
-
pasteKeepStyles?: (el: AlexElement) => ObjectType;
|
|
194
|
-
};
|
|
195
|
-
export type PluginType = (editifyInstance: ComponentInternalInstance, editTrans: (key: string) => any) => PluginResultType;
|
|
196
198
|
export type SFCWithInstall<T> = T & {
|
|
197
199
|
install(app: App): void;
|
|
198
200
|
};
|
|
@@ -242,7 +244,7 @@ export declare const getMenuConfig: (editTrans: (key: string) => any, editLocale
|
|
|
242
244
|
* @param component
|
|
243
245
|
* @returns
|
|
244
246
|
*/
|
|
245
|
-
export declare const withInstall: <T extends Component>(component: T) => SFCWithInstall<
|
|
247
|
+
export declare const withInstall: <T extends Component>(component: T) => SFCWithInstall<typeof component>;
|
|
246
248
|
/**
|
|
247
249
|
* 是否点击了编辑器以外的元素
|
|
248
250
|
* @param editor
|