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.
Files changed (190) hide show
  1. package/examples/App.vue +49 -67
  2. package/lib/components/button/button.vue.d.ts +62 -60
  3. package/lib/components/button/index.d.ts +4 -0
  4. package/lib/components/button/props.d.ts +12 -1
  5. package/lib/components/checkbox/checkbox.vue.d.ts +9 -9
  6. package/lib/components/checkbox/index.d.ts +4 -0
  7. package/lib/components/checkbox/props.d.ts +2 -2
  8. package/lib/components/colors/colors.vue.d.ts +4 -4
  9. package/lib/components/colors/index.d.ts +4 -0
  10. package/lib/components/colors/props.d.ts +2 -2
  11. package/lib/components/icon/index.d.ts +4 -0
  12. package/lib/components/insertAttachment/index.d.ts +4 -0
  13. package/lib/{plugins/attachment → components}/insertAttachment/insertAttachment.vue.d.ts +3 -3
  14. package/lib/{plugins/attachment → components}/insertAttachment/props.d.ts +1 -1
  15. package/lib/components/insertImage/index.d.ts +4 -0
  16. package/lib/components/insertImage/insertImage.vue.d.ts +3 -3
  17. package/lib/components/insertImage/props.d.ts +1 -1
  18. package/lib/components/insertLink/index.d.ts +4 -0
  19. package/lib/components/insertLink/insertLink.vue.d.ts +6 -6
  20. package/lib/components/insertLink/props.d.ts +3 -3
  21. package/lib/components/insertMathformula/index.d.ts +4 -0
  22. package/lib/{plugins/mathformula → components}/insertMathformula/insertMathformula.vue.d.ts +3 -3
  23. package/lib/{plugins/mathformula → components}/insertMathformula/props.d.ts +2 -2
  24. package/lib/components/insertTable/index.d.ts +4 -0
  25. package/lib/components/insertTable/insertTable.vue.d.ts +3 -3
  26. package/lib/components/insertTable/props.d.ts +2 -2
  27. package/lib/components/insertVideo/index.d.ts +4 -0
  28. package/lib/components/insertVideo/insertVideo.vue.d.ts +3 -3
  29. package/lib/components/insertVideo/props.d.ts +1 -1
  30. package/lib/components/layer/index.d.ts +4 -0
  31. package/lib/components/layer/layer.vue.d.ts +10 -8
  32. package/lib/components/tooltip/index.d.ts +4 -0
  33. package/lib/components/tooltip/tooltip.vue.d.ts +6 -4
  34. package/lib/components/triangle/index.d.ts +4 -0
  35. package/lib/components/triangle/triangle.vue.d.ts +1 -1
  36. package/lib/components/updateLink/index.d.ts +4 -0
  37. package/lib/components/updateLink/props.d.ts +17 -0
  38. package/lib/components/updateLink/updateLink.vue.d.ts +38 -0
  39. package/lib/core/function.d.ts +113 -36
  40. package/lib/core/rule.d.ts +20 -0
  41. package/lib/core/tool.d.ts +36 -34
  42. package/lib/editify/editify.vue.d.ts +86 -53
  43. package/lib/editify/menu/index.d.ts +4 -0
  44. package/lib/{components → editify}/menu/menu.vue.d.ts +3 -4
  45. package/lib/{components → editify}/menu/props.d.ts +1 -1
  46. package/lib/editify/props.d.ts +3 -7
  47. package/lib/editify/toolbar/index.d.ts +4 -0
  48. package/lib/{components → editify}/toolbar/props.d.ts +2 -2
  49. package/lib/{components → editify}/toolbar/toolbar.vue.d.ts +53 -53
  50. package/lib/editify.es.js +8879 -7668
  51. package/lib/editify.umd.js +2 -2
  52. package/lib/feature/align.d.ts +32 -0
  53. package/lib/feature/attachment.d.ts +18 -0
  54. package/lib/feature/backColor.d.ts +32 -0
  55. package/lib/feature/bold.d.ts +32 -0
  56. package/lib/feature/code.d.ts +32 -0
  57. package/lib/feature/codeBlock.d.ts +32 -0
  58. package/lib/feature/fontFamily.d.ts +32 -0
  59. package/lib/feature/fontSize.d.ts +32 -0
  60. package/lib/feature/foreColor.d.ts +32 -0
  61. package/lib/feature/formatClear.d.ts +32 -0
  62. package/lib/feature/fullScreen.d.ts +18 -0
  63. package/lib/feature/heading.d.ts +32 -0
  64. package/lib/feature/image.d.ts +32 -0
  65. package/lib/feature/indent.d.ts +18 -0
  66. package/lib/feature/infoBlock.d.ts +18 -0
  67. package/lib/feature/italic.d.ts +32 -0
  68. package/lib/feature/lineHeight.d.ts +32 -0
  69. package/lib/feature/link.d.ts +26 -0
  70. package/lib/feature/mathformula.d.ts +22 -0
  71. package/lib/feature/orderList.d.ts +32 -0
  72. package/lib/feature/panel.d.ts +18 -0
  73. package/lib/feature/quote.d.ts +18 -0
  74. package/lib/feature/redo.d.ts +18 -0
  75. package/lib/feature/separator.d.ts +18 -0
  76. package/lib/feature/sourceView.d.ts +18 -0
  77. package/lib/feature/strikethrough.d.ts +32 -0
  78. package/lib/feature/sub.d.ts +32 -0
  79. package/lib/feature/super.d.ts +32 -0
  80. package/lib/feature/table.d.ts +32 -0
  81. package/lib/feature/task.d.ts +32 -0
  82. package/lib/feature/underline.d.ts +32 -0
  83. package/lib/feature/undo.d.ts +18 -0
  84. package/lib/feature/unorderList.d.ts +32 -0
  85. package/lib/feature/video.d.ts +38 -0
  86. package/lib/index.d.ts +104 -69
  87. package/package.json +5 -5
  88. package/src/components/button/button.vue +21 -24
  89. package/src/components/button/index.ts +5 -0
  90. package/src/components/button/props.ts +14 -1
  91. package/src/components/checkbox/checkbox.vue +1 -1
  92. package/src/components/checkbox/index.ts +5 -0
  93. package/src/components/checkbox/props.ts +1 -1
  94. package/src/components/colors/colors.vue +3 -3
  95. package/src/components/colors/index.ts +5 -0
  96. package/src/components/colors/props.ts +2 -2
  97. package/src/components/icon/index.ts +5 -0
  98. package/src/components/insertAttachment/index.ts +5 -0
  99. package/src/{plugins/attachment → components}/insertAttachment/insertAttachment.vue +4 -2
  100. package/src/{plugins/attachment → components}/insertAttachment/props.ts +1 -1
  101. package/src/components/insertImage/index.ts +5 -0
  102. package/src/components/insertImage/insertImage.vue +5 -5
  103. package/src/components/insertImage/props.ts +1 -1
  104. package/src/components/insertLink/index.ts +5 -0
  105. package/src/components/insertLink/insertLink.vue +10 -10
  106. package/src/components/insertLink/props.ts +3 -3
  107. package/src/components/insertMathformula/index.ts +5 -0
  108. package/src/{plugins/mathformula → components}/insertMathformula/props.ts +2 -2
  109. package/src/components/insertTable/index.ts +5 -0
  110. package/src/components/insertTable/props.ts +2 -2
  111. package/src/components/insertVideo/index.ts +5 -0
  112. package/src/components/insertVideo/insertVideo.vue +2 -2
  113. package/src/components/insertVideo/props.ts +1 -1
  114. package/src/components/layer/index.ts +5 -0
  115. package/src/components/layer/layer.vue +42 -4
  116. package/src/components/tooltip/index.ts +5 -0
  117. package/src/components/tooltip/tooltip.vue +1 -1
  118. package/src/components/triangle/index.ts +5 -0
  119. package/src/components/triangle/triangle.vue +1 -1
  120. package/src/components/updateLink/index.ts +5 -0
  121. package/src/components/updateLink/props.ts +21 -0
  122. package/src/components/{toolbar/toolbar.less → updateLink/updateLink.less} +4 -20
  123. package/src/components/updateLink/updateLink.vue +74 -0
  124. package/src/core/function.ts +289 -97
  125. package/src/core/rule.ts +96 -7
  126. package/src/core/tool.ts +234 -78
  127. package/src/editify/editify.less +2 -0
  128. package/src/editify/editify.vue +182 -185
  129. package/src/editify/menu/index.ts +5 -0
  130. package/src/editify/menu/menu.vue +215 -0
  131. package/src/{components → editify}/menu/props.ts +1 -1
  132. package/src/editify/props.ts +7 -11
  133. package/src/editify/toolbar/index.ts +5 -0
  134. package/src/{components → editify}/toolbar/props.ts +1 -1
  135. package/src/editify/toolbar/toolbar.less +10 -0
  136. package/src/editify/toolbar/toolbar.vue +103 -0
  137. package/src/feature/align.ts +128 -0
  138. package/src/feature/attachment.ts +109 -0
  139. package/src/feature/backColor.ts +171 -0
  140. package/src/feature/bold.ts +136 -0
  141. package/src/feature/code.ts +136 -0
  142. package/src/feature/codeBlock.ts +204 -0
  143. package/src/feature/fontFamily.ts +140 -0
  144. package/src/feature/fontSize.ts +142 -0
  145. package/src/feature/foreColor.ts +173 -0
  146. package/src/feature/formatClear.ts +118 -0
  147. package/src/feature/fullScreen.ts +57 -0
  148. package/src/feature/heading.ts +154 -0
  149. package/src/feature/image.ts +225 -0
  150. package/src/feature/indent.ts +73 -0
  151. package/src/feature/infoBlock.ts +94 -0
  152. package/src/feature/italic.ts +136 -0
  153. package/src/feature/lineHeight.ts +165 -0
  154. package/src/feature/link.ts +149 -0
  155. package/src/feature/mathformula.ts +147 -0
  156. package/src/feature/orderList.ts +116 -0
  157. package/src/feature/panel.ts +108 -0
  158. package/src/feature/quote.ts +61 -0
  159. package/src/feature/redo.ts +56 -0
  160. package/src/feature/separator.ts +62 -0
  161. package/src/feature/sourceView.ts +59 -0
  162. package/src/feature/strikethrough.ts +136 -0
  163. package/src/feature/sub.ts +136 -0
  164. package/src/feature/super.ts +136 -0
  165. package/src/feature/table.ts +994 -0
  166. package/src/feature/task.ts +116 -0
  167. package/src/feature/underline.ts +136 -0
  168. package/src/feature/undo.ts +56 -0
  169. package/src/feature/unorderList.ts +116 -0
  170. package/src/feature/video.ts +339 -0
  171. package/src/hljs/index.ts +1 -1
  172. package/src/index.ts +69 -21
  173. package/src/locale/en_US.ts +3 -3
  174. package/src/locale/zh_CN.ts +3 -3
  175. package/lib/plugins/attachment/index.d.ts +0 -37
  176. package/lib/plugins/infoBlock/index.d.ts +0 -55
  177. package/lib/plugins/mathformula/index.d.ts +0 -49
  178. package/lib/plugins/panel/index.d.ts +0 -48
  179. package/src/components/menu/menu.vue +0 -1655
  180. package/src/components/toolbar/toolbar.vue +0 -1677
  181. package/src/plugins/attachment/index.ts +0 -237
  182. package/src/plugins/infoBlock/index.ts +0 -238
  183. package/src/plugins/mathformula/index.ts +0 -295
  184. package/src/plugins/panel/index.ts +0 -228
  185. package/tsconfig.json +0 -31
  186. package/tsconfig.node.json +0 -11
  187. /package/src/{plugins/attachment → components}/insertAttachment/insertAttachment.less +0 -0
  188. /package/src/{plugins/mathformula → components}/insertMathformula/insertMathformula.less +0 -0
  189. /package/src/{plugins/mathformula → components}/insertMathformula/insertMathformula.vue +0 -0
  190. /package/src/{components → editify}/menu/menu.less +0 -0
package/lib/index.d.ts CHANGED
@@ -42,9 +42,9 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
42
42
  default: boolean;
43
43
  };
44
44
  color: {
45
- type: import('vue').PropType<string | null>;
45
+ type: StringConstructor;
46
46
  default: string;
47
- validator(value: any): boolean;
47
+ validator(value: string): boolean;
48
48
  };
49
49
  videoRatio: {
50
50
  type: NumberConstructor;
@@ -110,10 +110,6 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
110
110
  type: BooleanConstructor;
111
111
  default: boolean;
112
112
  };
113
- plugins: {
114
- type: import('vue').PropType<import('./core/tool').PluginType[]>;
115
- default: () => never[];
116
- };
117
113
  dark: {
118
114
  type: BooleanConstructor;
119
115
  default: boolean;
@@ -150,8 +146,8 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
150
146
  key: number;
151
147
  type: import('alex-editor').AlexElementType;
152
148
  parsedom: string | null;
153
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
154
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
149
+ marks: import('alex-editor').ObjectType | null;
150
+ styles: import('alex-editor').ObjectType | null;
155
151
  textContent: string | null;
156
152
  children: any[] | null;
157
153
  parent: any | null;
@@ -170,7 +166,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
170
166
  getUneditableElement: () => import('alex-editor').AlexElement | null;
171
167
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
172
168
  isContains: (element: import('alex-editor').AlexElement) => boolean;
173
- isOnlyHasBreak: () => boolean;
169
+ isOnlyHasBreak: () => boolean | 0;
174
170
  isPreStyle: () => boolean;
175
171
  hasMarks: () => boolean;
176
172
  hasStyles: () => boolean;
@@ -195,8 +191,8 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
195
191
  key: number;
196
192
  type: import('alex-editor').AlexElementType;
197
193
  parsedom: string | null;
198
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
199
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
194
+ marks: import('alex-editor').ObjectType | null;
195
+ styles: import('alex-editor').ObjectType | null;
200
196
  textContent: string | null;
201
197
  children: any[] | null;
202
198
  parent: any | null;
@@ -215,7 +211,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
215
211
  getUneditableElement: () => import('alex-editor').AlexElement | null;
216
212
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
217
213
  isContains: (element: import('alex-editor').AlexElement) => boolean;
218
- isOnlyHasBreak: () => boolean;
214
+ isOnlyHasBreak: () => boolean | 0;
219
215
  isPreStyle: () => boolean;
220
216
  hasMarks: () => boolean;
221
217
  hasStyles: () => boolean;
@@ -244,8 +240,8 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
244
240
  key: number;
245
241
  type: import('alex-editor').AlexElementType;
246
242
  parsedom: string | null;
247
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
248
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
243
+ marks: import('alex-editor').ObjectType | null;
244
+ styles: import('alex-editor').ObjectType | null;
249
245
  textContent: string | null;
250
246
  children: any[] | null;
251
247
  parent: any | null;
@@ -264,7 +260,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
264
260
  getUneditableElement: () => import('alex-editor').AlexElement | null;
265
261
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
266
262
  isContains: (element: import('alex-editor').AlexElement) => boolean;
267
- isOnlyHasBreak: () => boolean;
263
+ isOnlyHasBreak: () => boolean | 0;
268
264
  isPreStyle: () => boolean;
269
265
  hasMarks: () => boolean;
270
266
  hasStyles: () => boolean;
@@ -291,17 +287,17 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
291
287
  } | null;
292
288
  }[];
293
289
  current: number;
294
- push: (stack: import('alex-editor').AlexElement[], range?: import('alex-editor').AlexRange | null | undefined) => void;
295
- get: (type: 1 | -1) => import('alex-editor').AlexHistoryResultType | null;
290
+ push: (stack: import('alex-editor').AlexElement[], range?: import('alex-editor').AlexRange | null) => void;
291
+ get: (type: -1 | 1) => import('alex-editor').AlexHistoryResultType | null;
296
292
  updateCurrentRange: (range: import('alex-editor').AlexRange) => void;
297
- __cloneRange: (newStack: import('alex-editor').AlexElement[], range?: import('alex-editor').AlexRange | null | undefined) => import('alex-editor').AlexRange | null;
293
+ __cloneRange: (newStack: import('alex-editor').AlexElement[], range?: import('alex-editor').AlexRange | null) => import('alex-editor').AlexRange | null;
298
294
  };
299
295
  stack: {
300
296
  key: number;
301
297
  type: import('alex-editor').AlexElementType;
302
298
  parsedom: string | null;
303
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
304
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
299
+ marks: import('alex-editor').ObjectType | null;
300
+ styles: import('alex-editor').ObjectType | null;
305
301
  textContent: string | null;
306
302
  children: any[] | null;
307
303
  parent: any | null;
@@ -320,7 +316,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
320
316
  getUneditableElement: () => import('alex-editor').AlexElement | null;
321
317
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
322
318
  isContains: (element: import('alex-editor').AlexElement) => boolean;
323
- isOnlyHasBreak: () => boolean;
319
+ isOnlyHasBreak: () => boolean | 0;
324
320
  isPreStyle: () => boolean;
325
321
  hasMarks: () => boolean;
326
322
  hasStyles: () => boolean;
@@ -345,8 +341,8 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
345
341
  key: number;
346
342
  type: import('alex-editor').AlexElementType;
347
343
  parsedom: string | null;
348
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
349
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
344
+ marks: import('alex-editor').ObjectType | null;
345
+ styles: import('alex-editor').ObjectType | null;
350
346
  textContent: string | null;
351
347
  children: any[] | null;
352
348
  parent: any | null;
@@ -365,7 +361,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
365
361
  getUneditableElement: () => import('alex-editor').AlexElement | null;
366
362
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
367
363
  isContains: (element: import('alex-editor').AlexElement) => boolean;
368
- isOnlyHasBreak: () => boolean;
364
+ isOnlyHasBreak: () => boolean | 0;
369
365
  isPreStyle: () => boolean;
370
366
  hasMarks: () => boolean;
371
367
  hasStyles: () => boolean;
@@ -394,8 +390,8 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
394
390
  key: number;
395
391
  type: import('alex-editor').AlexElementType;
396
392
  parsedom: string | null;
397
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
398
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
393
+ marks: import('alex-editor').ObjectType | null;
394
+ styles: import('alex-editor').ObjectType | null;
399
395
  textContent: string | null;
400
396
  children: any[] | null;
401
397
  parent: any | null;
@@ -414,7 +410,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
414
410
  getUneditableElement: () => import('alex-editor').AlexElement | null;
415
411
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
416
412
  isContains: (element: import('alex-editor').AlexElement) => boolean;
417
- isOnlyHasBreak: () => boolean;
413
+ isOnlyHasBreak: () => boolean | 0;
418
414
  isPreStyle: () => boolean;
419
415
  hasMarks: () => boolean;
420
416
  hasStyles: () => boolean;
@@ -440,8 +436,50 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
440
436
  };
441
437
  } | null;
442
438
  __guid: number;
443
- __events: import('alex-editor/lib/core/tool').ObjectType;
444
- __firstRender: boolean;
439
+ __events: import('alex-editor').ObjectType;
440
+ __oldStack: {
441
+ key: number;
442
+ type: import('alex-editor').AlexElementType;
443
+ parsedom: string | null;
444
+ marks: import('alex-editor').ObjectType | null;
445
+ styles: import('alex-editor').ObjectType | null;
446
+ textContent: string | null;
447
+ children: any[] | null;
448
+ parent: any | null;
449
+ behavior: "default" | "block";
450
+ namespace: string | null;
451
+ locked: boolean;
452
+ elm: HTMLElement | null;
453
+ isBlock: () => boolean;
454
+ isInblock: () => boolean;
455
+ isInline: () => boolean;
456
+ isClosed: () => boolean;
457
+ isText: () => boolean;
458
+ isBreak: () => boolean;
459
+ isEmpty: () => boolean;
460
+ isSpaceText: () => boolean;
461
+ getUneditableElement: () => import('alex-editor').AlexElement | null;
462
+ isEqual: (element: import('alex-editor').AlexElement) => boolean;
463
+ isContains: (element: import('alex-editor').AlexElement) => boolean;
464
+ isOnlyHasBreak: () => boolean | 0;
465
+ isPreStyle: () => boolean;
466
+ hasMarks: () => boolean;
467
+ hasStyles: () => boolean;
468
+ hasChildren: () => boolean;
469
+ hasContains: (element: import('alex-editor').AlexElement) => boolean;
470
+ clone: (deep?: boolean | undefined) => import('alex-editor').AlexElement;
471
+ convertToBlock: () => void;
472
+ toEmpty: () => void;
473
+ getBlock: () => import('alex-editor').AlexElement;
474
+ getInblock: () => import('alex-editor').AlexElement | null;
475
+ getInline: () => import('alex-editor').AlexElement | null;
476
+ isEqualStyles: (element: import('alex-editor').AlexElement) => boolean;
477
+ isEqualMarks: (element: import('alex-editor').AlexElement) => boolean;
478
+ isFirst: (element: import('alex-editor').AlexElement) => boolean;
479
+ isLast: (element: import('alex-editor').AlexElement) => boolean;
480
+ __render: () => void;
481
+ __fullClone: () => import('alex-editor').AlexElement;
482
+ }[];
445
483
  __isInputChinese: boolean;
446
484
  __innerSelectionChange: boolean;
447
485
  __chineseInputTimer: any;
@@ -465,8 +503,8 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
465
503
  addElementTo: (childEle: import('alex-editor').AlexElement, parentEle: import('alex-editor').AlexElement, index?: number | undefined) => void;
466
504
  addElementBefore: (newEle: import('alex-editor').AlexElement, targetEle: import('alex-editor').AlexElement) => void;
467
505
  addElementAfter: (newEle: import('alex-editor').AlexElement, targetEle: import('alex-editor').AlexElement) => void;
468
- collapseToStart: (element?: import('alex-editor').AlexElement | undefined) => void;
469
- collapseToEnd: (element?: import('alex-editor').AlexElement | undefined) => void;
506
+ collapseToStart: (element?: import('alex-editor').AlexElement) => void;
507
+ collapseToEnd: (element?: import('alex-editor').AlexElement) => void;
470
508
  setDisabled: () => void;
471
509
  setEnabled: () => void;
472
510
  emit: (eventName: string, ...value: any) => boolean;
@@ -475,15 +513,15 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
475
513
  } | null>;
476
514
  isSourceView: import('vue').Ref<boolean>;
477
515
  isFullScreen: import('vue').Ref<boolean>;
478
- canUseMenu: import('vue').Ref<boolean>;
516
+ rangeKey: import('vue').Ref<number | null>;
479
517
  dataRangeCaches: import('vue').Ref<{
480
518
  list: {
481
519
  element: {
482
520
  key: number;
483
521
  type: import('alex-editor').AlexElementType;
484
522
  parsedom: string | null;
485
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
486
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
523
+ marks: import('alex-editor').ObjectType | null;
524
+ styles: import('alex-editor').ObjectType | null;
487
525
  textContent: string | null;
488
526
  children: any[] | null;
489
527
  parent: any | null;
@@ -502,7 +540,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
502
540
  getUneditableElement: () => import('alex-editor').AlexElement | null;
503
541
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
504
542
  isContains: (element: import('alex-editor').AlexElement) => boolean;
505
- isOnlyHasBreak: () => boolean;
543
+ isOnlyHasBreak: () => boolean | 0;
506
544
  isPreStyle: () => boolean;
507
545
  hasMarks: () => boolean;
508
546
  hasStyles: () => boolean;
@@ -521,15 +559,15 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
521
559
  __render: () => void;
522
560
  __fullClone: () => import('alex-editor').AlexElement;
523
561
  };
524
- offset: false | number[];
562
+ offset: number[] | false;
525
563
  }[];
526
564
  flatList: {
527
565
  element: {
528
566
  key: number;
529
567
  type: import('alex-editor').AlexElementType;
530
568
  parsedom: string | null;
531
- marks: import('alex-editor/lib/core/tool').ObjectType | null;
532
- styles: import('alex-editor/lib/core/tool').ObjectType | null;
569
+ marks: import('alex-editor').ObjectType | null;
570
+ styles: import('alex-editor').ObjectType | null;
533
571
  textContent: string | null;
534
572
  children: any[] | null;
535
573
  parent: any | null;
@@ -548,7 +586,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
548
586
  getUneditableElement: () => import('alex-editor').AlexElement | null;
549
587
  isEqual: (element: import('alex-editor').AlexElement) => boolean;
550
588
  isContains: (element: import('alex-editor').AlexElement) => boolean;
551
- isOnlyHasBreak: () => boolean;
589
+ isOnlyHasBreak: () => boolean | 0;
552
590
  isPreStyle: () => boolean;
553
591
  hasMarks: () => boolean;
554
592
  hasStyles: () => boolean;
@@ -567,7 +605,7 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
567
605
  __render: () => void;
568
606
  __fullClone: () => import('alex-editor').AlexElement;
569
607
  };
570
- offset: false | number[];
608
+ offset: number[] | false;
571
609
  }[];
572
610
  }>;
573
611
  textValue: import('vue').ComputedRef<string>;
@@ -577,10 +615,10 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
577
615
  undo: () => void;
578
616
  redo: () => void;
579
617
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
580
- "update:modelValue": (...args: any[]) => void;
581
618
  change: (...args: any[]) => void;
582
619
  blur: (...args: any[]) => void;
583
620
  focus: (...args: any[]) => void;
621
+ "update:modelValue": (...args: any[]) => void;
584
622
  keydown: (...args: any[]) => void;
585
623
  keyup: (...args: any[]) => void;
586
624
  insertparagraph: (...args: any[]) => void;
@@ -628,9 +666,9 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
628
666
  default: boolean;
629
667
  };
630
668
  color: {
631
- type: import('vue').PropType<string | null>;
669
+ type: StringConstructor;
632
670
  default: string;
633
- validator(value: any): boolean;
671
+ validator(value: string): boolean;
634
672
  };
635
673
  videoRatio: {
636
674
  type: NumberConstructor;
@@ -696,10 +734,6 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
696
734
  type: BooleanConstructor;
697
735
  default: boolean;
698
736
  };
699
- plugins: {
700
- type: import('vue').PropType<import('./core/tool').PluginType[]>;
701
- default: () => never[];
702
- };
703
737
  dark: {
704
738
  type: BooleanConstructor;
705
739
  default: boolean;
@@ -713,24 +747,23 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
713
747
  default: number;
714
748
  };
715
749
  }>> & {
716
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
717
750
  onFocus?: ((...args: any[]) => any) | undefined;
718
751
  onBlur?: ((...args: any[]) => any) | undefined;
719
752
  onChange?: ((...args: any[]) => any) | undefined;
720
753
  onKeydown?: ((...args: any[]) => any) | undefined;
721
754
  onKeyup?: ((...args: any[]) => any) | undefined;
755
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
722
756
  onInsertparagraph?: ((...args: any[]) => any) | undefined;
723
757
  onRangeupdate?: ((...args: any[]) => any) | undefined;
724
758
  onUpdateview?: ((...args: any[]) => any) | undefined;
725
759
  }, {
726
- color: string | null;
760
+ color: string;
727
761
  disabled: boolean;
728
762
  zIndex: number;
729
- modelValue: string;
730
- border: boolean;
731
763
  menu: import('./core/tool').MenuConfigType;
732
764
  placeholder: string;
733
- autoheight: boolean;
765
+ modelValue: string;
766
+ border: boolean;
734
767
  toolbar: import('./core/tool').ToolbarConfigType;
735
768
  locale: import('./locale').LocaleType;
736
769
  autofocus: boolean;
@@ -750,27 +783,29 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
750
783
  customParseNode: (el: import('alex-editor').AlexElement) => import('alex-editor').AlexElement;
751
784
  extraKeepTags: string[];
752
785
  renderRules: ((el: import('alex-editor').AlexElement) => void)[];
786
+ autoheight: boolean;
753
787
  tab: boolean;
754
- plugins: import('./core/tool').PluginType[];
755
788
  dark: boolean;
756
789
  offset: number;
757
790
  }, {}>>;
758
- export type { ButtonTypeType, ButtonOptionsItemType, ButtonSelectConfigType, ButtonDisplayConfigType } from './components/button/props';
759
- export type { InsertImageUploadErrorType } from './components/insertImage/props';
760
- export type { InsertVideoUploadErrorType } from './components/insertVideo/props';
761
- export type { MenuButtonType, MenuSelectButtonType, MenuDisplayButtonType, MenuImageButtonType, MenuVideoButtonType, MenuTableButtonType, MenuCustomButtonType, CodeBlockToolbarType, TextToolbarType, ToolbarConfigType, MenuSequenceType, MenuModeType, MenuExtendType, MenuConfigType, PluginMenuConfigType, PluginType, PluginResultType } from './core/tool';
762
- export type { ElementMatchConfigType } from './core/function';
763
- export { elementIsMatch, getMatchElementByElement, getMatchElementByRange, isList, isTask, elementIsInList, elementIsInTask, hasPreInRange, hasQuoteInRange, hasListInRange, hasTaskInRange, hasLinkInRange, hasTableInRange, hasImageInRange, hasVideoInRange, isRangeInQuote, isRangeInList, isRangeInTask, queryTextStyle, queryTextMark, getRangeText, setIndentIncrease, setIndentDecrease, setQuote, setAlign, setList, setTask, setTextStyle, setTextMark, removeTextStyle, removeTextMark, setLineHeight, insertLink, insertImage, insertVideo, insertTable, insertCodeBlock, insertSeparator } from './core/function';
791
+ export type * from './components/button';
792
+ export type * from './components/checkbox';
793
+ export type * from './components/colors';
794
+ export type * from './components/icon';
795
+ export type * from './components/insertImage';
796
+ export type * from './components/insertLink';
797
+ export type * from './components/insertTable';
798
+ export type * from './components/insertVideo';
799
+ export type * from './components/layer';
800
+ export type * from './components/tooltip';
801
+ export type * from './components/triangle';
802
+ export type * from './components/updateLink';
803
+ export type * from './core/tool';
804
+ export type * from './core/function';
805
+ export type * from './editify/menu';
806
+ export type * from './editify/toolbar';
807
+ export { elementIsMatch, getMatchElementByElement, getMatchElementByRange, elementIsList, getListByElement, hasListInRange, rangeIsInList, elementIsTask, getTaskByElement, hasTaskInRange, rangeIsInTask, elementIsAttachment, hasAttachmentInRange, elementIsMathformula, getMathformulaByElement, hasMathformulaInRange, elementIsPanel, getPanelByElement, hasPanelInRange, elementIsInfoBlock, getInfoBlockByElement, hasInfoBlockInRange, rangeIsInInfoBlock, hasPreInRange, hasQuoteInRange, hasLinkInRange, hasTableInRange, hasImageInRange, hasVideoInRange, rangeIsInQuote, queryTextStyle, queryTextMark, getRangeText, setIndentIncrease, setIndentDecrease, setQuote, setAlign, setList, setTask, setTextStyle, setTextMark, removeTextStyle, removeTextMark, setLineHeight, insertLink, insertImage, insertVideo, insertTable, insertCodeBlock, insertSeparator } from './core/function';
764
808
  declare const install: (app: App) => void;
765
- declare const version = "0.2.13";
809
+ declare const version = "0.2.15";
766
810
  export { AlexElement } from 'alex-editor';
767
- export type { AttachmentOptionsType } from './plugins/attachment';
768
- export type { InsertAttachmentUploadErrorType } from './plugins/attachment/insertAttachment/props';
769
- export { attachment, isAttachment, hasAttachmentInRange } from './plugins/attachment';
770
- export type { MathformulaOptionsType } from './plugins/mathformula';
771
- export { mathformula, isMathformula, isUnderMathformula, getMathformulaElement, hasMathformulaInRange, getMathformulaElementByRange } from './plugins/mathformula';
772
- export type { PanelOptionsType } from './plugins/panel';
773
- export { panel, isPanel, isUnderPanel, getPanelElement, hasPanelInRange, getPanelElementByRange } from './plugins/panel';
774
- export type { InfoBlockOptionsType } from './plugins/infoBlock';
775
- export { infoBlock, isInfoBlock, isUnderInfoBlock, getInfoBlockElement, hasInfoBlockInRange, getInfoBlockElementByRange } from './plugins/infoBlock';
776
811
  export { Editify as default, Editify, install, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-editify",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -17,7 +17,7 @@
17
17
  "lib": "vue-tsc && vite build"
18
18
  },
19
19
  "dependencies": {
20
- "alex-editor": "^1.4.20",
20
+ "alex-editor": "^1.4.21",
21
21
  "dap-util": "^1.5.8",
22
22
  "highlight.js": "^11.8.0",
23
23
  "katex": "^0.16.10",
@@ -29,11 +29,11 @@
29
29
  "@vitejs/plugin-vue": "^5.0.4",
30
30
  "less": "^3.0.4",
31
31
  "terser": "^5.16.9",
32
- "typescript": "^5.2.2",
32
+ "typescript": "^5.5.3",
33
33
  "vite": "^5.2.8",
34
34
  "vite-plugin-css-injected-by-js": "^3.5.1",
35
- "vite-plugin-dts": "^3.7.3",
36
- "vue-tsc": "^1.8.27"
35
+ "vite-plugin-dts": "^3.9.1",
36
+ "vue-tsc": "^2.0.26"
37
37
  },
38
38
  "browserslist": [
39
39
  "> 1%",
@@ -30,11 +30,11 @@
30
30
  <script setup lang="ts">
31
31
  import { computed, ref } from 'vue'
32
32
  import { common as DapCommon, color as DapColor } from 'dap-util'
33
- import Tooltip from '@/components/tooltip/tooltip.vue'
34
- import Layer from '@/components/layer/layer.vue'
35
- import Icon from '@/components/icon/icon.vue'
36
33
  import { ObjectType } from '@/core/tool'
37
- import { ButtonDisplayConfigType, ButtonOptionsItemType, ButtonProps, ButtonSelectConfigType } from './props'
34
+ import { Tooltip } from '@/components/tooltip'
35
+ import { Layer } from '@/components/layer'
36
+ import { Icon } from '@/components/icon'
37
+ import { ButtonOptionsItemType, ButtonParseDisplayConfigType, ButtonParseSelectConfigType, ButtonProps } from './props'
38
38
 
39
39
  defineOptions({
40
40
  name: 'Button'
@@ -50,7 +50,7 @@ const btnRef = ref<HTMLElement | null>(null)
50
50
  const layerRef = ref<InstanceType<typeof Layer> | null>(null)
51
51
 
52
52
  //处理后的select配置
53
- const parseSelectConfig = computed<ButtonSelectConfigType>(() => {
53
+ const parseSelectConfig = computed<ButtonParseSelectConfigType>(() => {
54
54
  let options: ButtonOptionsItemType[] = []
55
55
  let width: number | '' = ''
56
56
  let maxHeight: number | '' = ''
@@ -59,15 +59,15 @@ const parseSelectConfig = computed<ButtonSelectConfigType>(() => {
59
59
  options = props.selectConfig.options.map(item => {
60
60
  if (DapCommon.isObject(item)) {
61
61
  return {
62
- label: (<ButtonOptionsItemType>item).label,
63
- value: (<ButtonOptionsItemType>item).value,
64
- icon: (<ButtonOptionsItemType>item).icon,
65
- style: (<ButtonOptionsItemType>item).style
62
+ label: (item as ButtonOptionsItemType).label,
63
+ value: (item as ButtonOptionsItemType).value,
64
+ icon: (item as ButtonOptionsItemType).icon,
65
+ style: (item as ButtonOptionsItemType).style
66
66
  }
67
67
  }
68
68
  return {
69
- label: <string | number>item,
70
- value: <string | number>item
69
+ label: item as string | number,
70
+ value: item as string | number
71
71
  }
72
72
  })
73
73
  }
@@ -85,7 +85,7 @@ const parseSelectConfig = computed<ButtonSelectConfigType>(() => {
85
85
  }
86
86
  })
87
87
  //处理后的display配置
88
- const parseDisplayConfig = computed<ButtonDisplayConfigType>(() => {
88
+ const parseDisplayConfig = computed<ButtonParseDisplayConfigType>(() => {
89
89
  let options: ButtonOptionsItemType[] = []
90
90
  let width: number | '' = ''
91
91
  let maxHeight: number | '' = ''
@@ -98,15 +98,15 @@ const parseDisplayConfig = computed<ButtonDisplayConfigType>(() => {
98
98
  options = props.displayConfig.options.map(item => {
99
99
  if (DapCommon.isObject(item)) {
100
100
  return {
101
- label: (<ButtonOptionsItemType>item).label,
102
- value: (<ButtonOptionsItemType>item).value,
103
- icon: (<ButtonOptionsItemType>item).icon,
104
- style: (<ButtonOptionsItemType>item).style
101
+ label: (item as ButtonOptionsItemType).label,
102
+ value: (item as ButtonOptionsItemType).value,
103
+ icon: (item as ButtonOptionsItemType).icon,
104
+ style: (item as ButtonOptionsItemType).style
105
105
  }
106
106
  }
107
107
  return {
108
- label: <string | number>item,
109
- value: <string | number>item
108
+ label: item as string | number,
109
+ value: item as string | number
110
110
  }
111
111
  })
112
112
  let optItem = options.find(item => {
@@ -132,11 +132,11 @@ const parseDisplayConfig = computed<ButtonDisplayConfigType>(() => {
132
132
  })
133
133
  //渲染的浮层列表数据
134
134
  const cmpOptions = computed<ButtonOptionsItemType[]>(() => {
135
- return props.type == 'select' ? <ButtonOptionsItemType[]>parseSelectConfig.value.options : <ButtonOptionsItemType[]>parseDisplayConfig.value.options
135
+ return props.type == 'select' ? parseSelectConfig.value.options! : parseDisplayConfig.value.options!
136
136
  })
137
137
  //显示在页面的value值对应的label
138
138
  const displayLabel = computed<string | number>(() => {
139
- const val = (<ButtonOptionsItemType[]>parseDisplayConfig.value.options).find(item => {
139
+ const val = parseDisplayConfig.value.options!.find(item => {
140
140
  return item.value == parseDisplayConfig.value.value
141
141
  })
142
142
  return val ? val.label! : ''
@@ -150,10 +150,7 @@ const parseColor = computed<number[]>(() => {
150
150
  })
151
151
  //按钮样式
152
152
  const btnStyle = computed<ObjectType>(() => {
153
- if (props.disabled) {
154
- return {}
155
- }
156
- if (props.color) {
153
+ if (!props.disabled && props.color) {
157
154
  //激活情况下和鼠标按下状态
158
155
  if (props.active || status.value == 'down') {
159
156
  return {
@@ -0,0 +1,5 @@
1
+ import Button from './button.vue'
2
+
3
+ export type * from './props'
4
+
5
+ export { Button }
@@ -16,6 +16,12 @@ export type ButtonSelectConfigType = {
16
16
  maxHeight?: number | ''
17
17
  }
18
18
 
19
+ export type ButtonParseSelectConfigType = {
20
+ options?: ButtonOptionsItemType[]
21
+ width?: number | ''
22
+ maxHeight?: number | ''
23
+ }
24
+
19
25
  export type ButtonDisplayConfigType = {
20
26
  options?: (ButtonOptionsItemType | number | string)[]
21
27
  width?: number | ''
@@ -23,6 +29,13 @@ export type ButtonDisplayConfigType = {
23
29
  value?: string | number
24
30
  }
25
31
 
32
+ export type ButtonParseDisplayConfigType = {
33
+ options?: ButtonOptionsItemType[]
34
+ width?: number | ''
35
+ maxHeight?: number | ''
36
+ value?: string | number
37
+ }
38
+
26
39
  export const ButtonProps = {
27
40
  //按钮类型
28
41
  type: {
@@ -62,7 +75,7 @@ export const ButtonProps = {
62
75
  },
63
76
  //主题色,用于按钮悬浮颜色变化使用,仅支持十六进制
64
77
  color: {
65
- type: String as PropType<string | null>,
78
+ type: String,
66
79
  default: ''
67
80
  },
68
81
  //是否禁用
@@ -12,7 +12,7 @@
12
12
  <script setup lang="ts">
13
13
  import { computed } from 'vue'
14
14
  import { common as DapCommon } from 'dap-util'
15
- import Icon from '@/components/icon/icon.vue'
15
+ import { Icon } from '@/components/icon'
16
16
  import { ObjectType } from '@/core/tool'
17
17
  import { CheckboxProps } from './props'
18
18
 
@@ -0,0 +1,5 @@
1
+ import Checkbox from './checkbox.vue'
2
+
3
+ export type * from './props'
4
+
5
+ export { Checkbox }
@@ -38,7 +38,7 @@ export const CheckboxProps = {
38
38
  },
39
39
  //主题颜色
40
40
  color: {
41
- type: String as PropType<string | null>,
41
+ type: String,
42
42
  default: '',
43
43
  validator(value: any) {
44
44
  return DapCommon.matchingText(value, 'hex')
@@ -15,9 +15,9 @@
15
15
  </template>
16
16
  <script setup lang="ts">
17
17
  import { inject } from 'vue'
18
- import Icon from '@/components/icon/icon.vue'
19
- import Tooltip from '@/components/tooltip/tooltip.vue'
20
- import { ButtonOptionsItemType } from '@/components/button/props'
18
+ import { Icon } from '@/components/icon'
19
+ import { Tooltip } from '@/components/tooltip'
20
+ import { ButtonOptionsItemType } from '@/components/button'
21
21
  import { ColorsProps } from './props'
22
22
 
23
23
  defineOptions({
@@ -0,0 +1,5 @@
1
+ import Colors from './colors.vue'
2
+
3
+ export type * from './props'
4
+
5
+ export { Colors }
@@ -1,5 +1,5 @@
1
1
  import { ExtractPublicPropTypes, PropType } from 'vue'
2
- import { ButtonOptionsItemType } from '@/components/button/props'
2
+ import { ButtonOptionsItemType } from '@/components/button'
3
3
 
4
4
  export const ColorsProps = {
5
5
  //颜色数组
@@ -16,7 +16,7 @@ export const ColorsProps = {
16
16
  },
17
17
  //激活状态颜色
18
18
  color: {
19
- type: String as PropType<string | null>,
19
+ type: String,
20
20
  default: ''
21
21
  },
22
22
  //是否使用工具提示
@@ -0,0 +1,5 @@
1
+ import Icon from './icon.vue'
2
+
3
+ export type * from './props'
4
+
5
+ export { Icon }
@@ -0,0 +1,5 @@
1
+ import InsertAttachment from './insertAttachment.vue'
2
+
3
+ export type * from './props'
4
+
5
+ export { InsertAttachment }