vue-editify 0.2.15 → 0.2.16

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 (42) hide show
  1. package/examples/App.vue +8 -37
  2. package/lib/editify/editify.vue.d.ts +0 -1
  3. package/lib/editify.es.js +17950 -17950
  4. package/lib/editify.umd.js +2 -2
  5. package/lib/index.d.ts +163 -164
  6. package/package.json +2 -2
  7. package/src/core/rule.ts +12 -22
  8. package/src/core/tool.ts +3 -3
  9. package/src/editify/editify.less +2 -0
  10. package/src/editify/editify.vue +1 -9
  11. package/src/editify/toolbar/toolbar.less +1 -1
  12. package/src/feature/align.ts +0 -2
  13. package/src/feature/attachment.ts +0 -1
  14. package/src/feature/backColor.ts +0 -2
  15. package/src/feature/bold.ts +0 -2
  16. package/src/feature/code.ts +0 -2
  17. package/src/feature/codeBlock.ts +0 -3
  18. package/src/feature/fontFamily.ts +0 -2
  19. package/src/feature/fontSize.ts +0 -2
  20. package/src/feature/foreColor.ts +0 -2
  21. package/src/feature/formatClear.ts +0 -2
  22. package/src/feature/heading.ts +0 -2
  23. package/src/feature/image.ts +0 -3
  24. package/src/feature/indent.ts +0 -1
  25. package/src/feature/infoBlock.ts +0 -1
  26. package/src/feature/italic.ts +0 -2
  27. package/src/feature/lineHeight.ts +1 -3
  28. package/src/feature/link.ts +0 -3
  29. package/src/feature/mathformula.ts +0 -1
  30. package/src/feature/orderList.ts +0 -2
  31. package/src/feature/panel.ts +0 -1
  32. package/src/feature/quote.ts +0 -1
  33. package/src/feature/separator.ts +0 -1
  34. package/src/feature/strikethrough.ts +0 -2
  35. package/src/feature/sub.ts +0 -2
  36. package/src/feature/super.ts +0 -2
  37. package/src/feature/table.ts +0 -13
  38. package/src/feature/task.ts +0 -2
  39. package/src/feature/underline.ts +0 -2
  40. package/src/feature/unorderList.ts +0 -2
  41. package/src/feature/video.ts +0 -4
  42. package/src/index.ts +14 -5
@@ -52,7 +52,6 @@ export const UnderlineToolbarButton = defineComponent(
52
52
  'text-decoration': 'underline'
53
53
  })
54
54
  }
55
- editor.value.formatElementStack()
56
55
  editor.value.domRender()
57
56
  editor.value.rangeRender()
58
57
  }
@@ -111,7 +110,6 @@ export const UnderlineMenuButton = defineComponent(
111
110
  'text-decoration': 'underline'
112
111
  })
113
112
  }
114
- editor.value.formatElementStack()
115
113
  editor.value.domRender()
116
114
  editor.value.rangeRender()
117
115
  }
@@ -42,7 +42,6 @@ export const UnorderListToolbarButton = defineComponent(
42
42
  disabled: props.config.disabled,
43
43
  onOperate: () => {
44
44
  setList(editor.value, dataRangeCaches.value, false)
45
- editor.value.formatElementStack()
46
45
  editor.value.domRender()
47
46
  editor.value.rangeRender()
48
47
  }
@@ -91,7 +90,6 @@ export const UnorderListMenuButton = defineComponent(
91
90
  disabled: props.disabled || isSourceView.value || hasPreInRange(editor.value, dataRangeCaches.value) || hasTableInRange(editor.value, dataRangeCaches.value) || hasPanelInRange(editor.value, dataRangeCaches.value) || props.config.disabled,
92
91
  onOperate: () => {
93
92
  setList(editor.value, dataRangeCaches.value, false)
94
- editor.value.formatElementStack()
95
93
  editor.value.domRender()
96
94
  editor.value.rangeRender()
97
95
  }
@@ -58,7 +58,6 @@ export const VideoToolbar = defineComponent(
58
58
  } else {
59
59
  element.styles = styles
60
60
  }
61
- editor.value.formatElementStack()
62
61
  editor.value.domRender()
63
62
  editor.value.rangeRender()
64
63
  //更新工具条位置
@@ -79,7 +78,6 @@ export const VideoToolbar = defineComponent(
79
78
  element.marks![prop] = true
80
79
  }
81
80
  videoConfig.value[prop] = !videoConfig.value[prop]
82
- editor.value.formatElementStack()
83
81
  editor.value.domRender()
84
82
  editor.value.rangeRender()
85
83
  }
@@ -233,7 +231,6 @@ export const VideoToolbar = defineComponent(
233
231
  const element = getMatchElementByRange(editor.value, dataRangeCaches.value, { parsedom: 'video' })
234
232
  if (element) {
235
233
  element.toEmpty()
236
- editor.value.formatElementStack()
237
234
  editor.value.domRender()
238
235
  editor.value.rangeRender()
239
236
  }
@@ -315,7 +312,6 @@ export const VideoMenuButton = defineComponent(
315
312
  urls.forEach(url => {
316
313
  insertVideo(editor.value, url)
317
314
  })
318
- editor.value.formatElementStack()
319
315
  editor.value.domRender()
320
316
  editor.value.rangeRender()
321
317
  btnRef.value!.show = false
package/src/index.ts CHANGED
@@ -1,5 +1,17 @@
1
1
  import { App } from 'vue'
2
+ import { AlexElement } from 'alex-editor'
2
3
  import { withInstall } from '@/core/tool'
4
+
5
+ //重写AlexElement.isPreStyle,将td加入到代码块样式中去
6
+ const originFn = AlexElement.prototype.isPreStyle
7
+ AlexElement.prototype.isPreStyle = function () {
8
+ const block = this.getInblock() || this.getBlock()
9
+ if (block.parsedom == 'td') {
10
+ return true
11
+ }
12
+ return originFn.apply(this)
13
+ }
14
+
3
15
  //引入根节点颜色变量样式
4
16
  import '@/css/var.less'
5
17
  //引入字体图标样式
@@ -86,12 +98,9 @@ const install = (app: App) => {
86
98
  app.component(Editify.name!, Editify)
87
99
  }
88
100
  //版本号
89
- const version = '0.2.15'
90
-
91
- //导出AlexElement元素
92
- export { AlexElement } from 'alex-editor'
101
+ const version = '0.2.16'
93
102
 
94
103
  //导出组件和安装函数
95
- export { Editify as default, Editify, install, version }
104
+ export { Editify as default, Editify, install, AlexElement, version }
96
105
 
97
106
  console.log(`%c vue-editify %c v${version} `, 'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;', 'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;')