vue-editify 0.1.8 → 0.1.10

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/lib/editify.es.js CHANGED
@@ -2522,17 +2522,17 @@ const setRecentlyPoint = function(point) {
2522
2522
  const nextElement = this.getNextElementOfPoint(point);
2523
2523
  const block = point.element.getBlock();
2524
2524
  const inblock = point.element.getInblock();
2525
- if (previousElement && inblock && inblock.isContains(previousElement)) {
2525
+ if (previousElement && !AlexElement.VOID_NODES.includes(previousElement.parsedom) && inblock && inblock.isContains(previousElement)) {
2526
2526
  point.moveToEnd(previousElement);
2527
- } else if (nextElement && inblock && inblock.isContains(nextElement)) {
2527
+ } else if (nextElement && !AlexElement.VOID_NODES.includes(nextElement.parsedom) && inblock && inblock.isContains(nextElement)) {
2528
2528
  point.moveToStart(nextElement);
2529
- } else if (previousElement && block.isContains(previousElement)) {
2529
+ } else if (previousElement && !AlexElement.VOID_NODES.includes(previousElement.parsedom) && block.isContains(previousElement)) {
2530
2530
  point.moveToEnd(previousElement);
2531
- } else if (nextElement && block.isContains(nextElement)) {
2531
+ } else if (nextElement && !AlexElement.VOID_NODES.includes(nextElement.parsedom) && block.isContains(nextElement)) {
2532
2532
  point.moveToStart(nextElement);
2533
- } else if (previousElement) {
2533
+ } else if (previousElement && !AlexElement.VOID_NODES.includes(previousElement.parsedom)) {
2534
2534
  point.moveToEnd(previousElement);
2535
- } else if (nextElement) {
2535
+ } else if (nextElement && !AlexElement.VOID_NODES.includes(nextElement.parsedom)) {
2536
2536
  point.moveToStart(nextElement);
2537
2537
  }
2538
2538
  };
@@ -17813,6 +17813,11 @@ const editorProps = {
17813
17813
  autoheight: {
17814
17814
  type: Boolean,
17815
17815
  default: false
17816
+ },
17817
+ //是否使用tab快捷键
17818
+ tab: {
17819
+ type: Boolean,
17820
+ default: true
17816
17821
  }
17817
17822
  };
17818
17823
  const mergeObject = function(o1, o2) {
@@ -24707,7 +24712,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
24707
24712
  ], 14, _hoisted_1$1);
24708
24713
  }
24709
24714
  const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-25262a69"]]);
24710
- const Editify_vue_vue_type_style_index_0_scoped_7535307a_lang = "";
24715
+ const Editify_vue_vue_type_style_index_0_scoped_300d28f4_lang = "";
24711
24716
  const _sfc_main = {
24712
24717
  name: "editify",
24713
24718
  props: { ...editorProps },
@@ -24775,8 +24780,7 @@ const _sfc_main = {
24775
24780
  //是否显示占位符
24776
24781
  showPlaceholder() {
24777
24782
  if (this.editor) {
24778
- const elements = this.editor.parseHtml(this.value);
24779
- if (elements.length == 1 && elements[0].type == "block" && elements[0].parsedom == AlexElement.BLOCK_NODE && elements[0].isOnlyHasBreak()) {
24783
+ if (this.value && this.editor.stack.length == 1 && this.editor.stack[0].type == "block" && this.editor.stack[0].parsedom == AlexElement.BLOCK_NODE && this.editor.stack[0].isOnlyHasBreak() && !this.editor.stack[0].hasStyles() && !this.editor.stack[0].hasMarks()) {
24780
24784
  return !this.isInputChinese;
24781
24785
  }
24782
24786
  }
@@ -25168,22 +25172,12 @@ const _sfc_main = {
25168
25172
  if (this.disabled) {
25169
25173
  return;
25170
25174
  }
25171
- if (e.keyCode == 9 && !e.metaKey && !e.shiftKey && !e.ctrlKey && !e.altKey) {
25172
- e.preventDefault();
25173
- if (!hasTableInRange(this)) {
25174
- setIndentIncrease(this);
25175
- this.editor.formatElementStack();
25176
- this.editor.domRender();
25177
- this.editor.rangeRender();
25178
- }
25179
- } else if (e.keyCode == 9 && !e.metaKey && e.shiftKey && !e.ctrlKey && !e.altKey) {
25175
+ if (e.keyCode == 9 && !e.metaKey && !e.shiftKey && !e.ctrlKey && !e.altKey && this.tab) {
25180
25176
  e.preventDefault();
25181
- if (!hasTableInRange(this)) {
25182
- setIndentDecrease(this);
25183
- this.editor.formatElementStack();
25184
- this.editor.domRender();
25185
- this.editor.rangeRender();
25186
- }
25177
+ this.editor.insertText(" ");
25178
+ this.editor.formatElementStack();
25179
+ this.editor.domRender();
25180
+ this.editor.rangeRender();
25187
25181
  }
25188
25182
  this.$emit("keydown", e);
25189
25183
  },
@@ -25453,7 +25447,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
25453
25447
  ], 2)) : createCommentVNode("", true)
25454
25448
  ], 2);
25455
25449
  }
25456
- const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7535307a"]]);
25450
+ const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-300d28f4"]]);
25457
25451
  const iconfont = "";
25458
25452
  const en_US = {
25459
25453
  textWrapUp: "Up feed",
@@ -25636,7 +25630,7 @@ const i18n = (locale) => {
25636
25630
  return translations[locale][key];
25637
25631
  };
25638
25632
  };
25639
- const version = "0.1.8";
25633
+ const version = "0.1.10";
25640
25634
  const install = (app, props) => {
25641
25635
  const locale = (props ? props.locale : "zh_CN") || "zh_CN";
25642
25636
  app.provide("$editTrans", i18n(locale));