zydx-plus 1.35.482 → 1.35.483

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.35.482",
3
+ "version": "1.35.483",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -370,7 +370,6 @@ export default {
370
370
  enablePasteRules: true,
371
371
  extensions: [
372
372
  sid,
373
- StarterKit,
374
373
  textStyle,
375
374
  FontSize,
376
375
  titleId,
@@ -391,6 +390,7 @@ export default {
391
390
  class: `editor-img`,
392
391
  }
393
392
  }),
393
+ StarterKit,
394
394
  ],
395
395
  onUpdate: ({editor}) => {
396
396
  _this.$emit('updateData', {
@@ -408,7 +408,7 @@ export default {
408
408
  },
409
409
  })
410
410
  document.addEventListener('keydown', function (e) {
411
- if (e.keyCode === 8 || e.keyCode === 46) {
411
+ if (e.keyCode === 8 || e.keyCode === 46) {
412
412
  const sid = _this.editor.state.selection.$anchor.parent.attrs.sid
413
413
  if (sid === 'prohibit') {
414
414
  _this.editor.setEditable(false);
@@ -867,7 +867,24 @@ export default {
867
867
  toolTap(v) {
868
868
  // 获取当前选中的节点
869
869
  const {$anchor} = this.editor.state.selection
870
- if ($anchor.path[3].attrs.titleId === 'source') return
870
+ console.log(this.editor.chain().focus());
871
+ console.log($anchor);
872
+ if ($anchor.path[3].attrs.titleId === 'source') {
873
+ let html = this.editor.getHTML()
874
+ html += '<p></p>'
875
+ this.editor.commands.setContent(html)
876
+ }
877
+ if (v === 'add') {
878
+ let html = this.editor.getHTML()
879
+ html += '<p class="source" style="text-align: right;"></p>'
880
+ this.editor.commands.setContent(html)
881
+ }
882
+ if (v === 'lookUp') {
883
+ let html = this.editor.getHTML()
884
+ html = '<p class="lookUp" style="text-align: left;"></p>' + html
885
+ this.editor.commands.setContent(html)
886
+ this.editor.chain().focus().setTextSelection(0).run()
887
+ }
871
888
  if (v === 'h1') this.editor.chain().focus().setFontSize('18px').setBold().run()
872
889
  if (v === 'h2') this.editor.chain().focus().setFontSize('16px').setBold().run()
873
890
  if (v === 'h3') this.editor.chain().focus().setFontSize('14px').setBold().run()
@@ -877,11 +894,6 @@ export default {
877
894
  }
878
895
  if (v === 'bold') this.editor.chain().focus().toggleBold().run()
879
896
  if (v === 'center' || v === 'left' || v === 'right') this.editor.chain().focus().setTextAlign(v).run()
880
- if (v === 'add') {
881
- let html = this.editor.getHTML()
882
- html += '<p class="source" style="text-align: right;"></p>'
883
- this.editor.commands.setContent(html)
884
- }
885
897
  if (v === 'centerH2') {
886
898
  this.editor.chain().focus().setFontSize('16px').setTextAlign('center').run()
887
899
  this.editor.chain().focus().setBold().run()
@@ -1011,6 +1023,17 @@ export default {
1011
1023
  height: 0;
1012
1024
  pointer-events: none;
1013
1025
  }
1026
+ :deep(.lookUp) {
1027
+ text-indent: 0;
1028
+ }
1029
+
1030
+ :deep(.lookUp).is-empty::before {
1031
+ color: #adb5bd;
1032
+ content: '添加抬头';
1033
+ float: left;
1034
+ height: 0;
1035
+ pointer-events: none;
1036
+ }
1014
1037
 
1015
1038
  :deep(.editor-img) {
1016
1039
  max-width: 100%;
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.482',
90
+ version: '1.35.483',
91
91
  install,
92
92
  Calendar,
93
93
  Message,