vue-editify 0.0.12 → 0.0.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div style="padding: 100px 50px 50px 50px">
3
- <editify ref="editify" border height="600px" v-model="value" placeholder="Please Enter Text..." allow-paste-html show-word-length :menu="menuConfig" @menu-operate="operate"> </editify>
3
+ <editify ref="editify" border height="600px" v-model="value" placeholder="Please Enter Text..." allow-paste-html show-word-length :menu="menuConfig"> </editify>
4
4
  </div>
5
5
  </template>
6
6
  <script>
package/lib/editify.es.js CHANGED
@@ -16253,7 +16253,7 @@ const getMenuConfig = function(editTrans, editLocale) {
16253
16253
  //右侧边框是否显示
16254
16254
  rightBorder: false
16255
16255
  },
16256
- //拓展菜单,每个key表示拓展菜单的唯一名称,value是对象,包含type/title/rightBorder/leftBorder/disabled/active/selectConfig/displayConfig/hideScroll属性
16256
+ //拓展菜单,每个key表示拓展菜单的唯一名称,value是对象,包含type/title/rightBorder/leftBorder/disabled/active/width/maxHeight/options/value/hideScroll/onLayerShow/onLayerShown/onLayerHidden/onOperate/default/layer/option属性
16257
16257
  extends: {}
16258
16258
  };
16259
16259
  };
@@ -20967,7 +20967,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
20967
20967
  ], 14, _hoisted_1$1);
20968
20968
  }
20969
20969
  const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-4c7850ff"]]);
20970
- const Editify_vue_vue_type_style_index_0_scoped_be97ae51_lang = "";
20970
+ const Editify_vue_vue_type_style_index_0_scoped_82396597_lang = "";
20971
20971
  const _sfc_main = {
20972
20972
  name: "editify",
20973
20973
  props: { ...editorProps },
@@ -21432,9 +21432,9 @@ const _sfc_main = {
21432
21432
  const element2 = this.editor.getElementByKey(key);
21433
21433
  this.editor.range.anchor.moveToStart(element2);
21434
21434
  this.editor.range.focus.moveToEnd(element2);
21435
+ this.editor.rangeRender();
21435
21436
  }
21436
21437
  }
21437
- this.editor.rangeRender();
21438
21438
  },
21439
21439
  //编辑器换行
21440
21440
  handleInsertParagraph(element2, previousElement) {
@@ -21452,7 +21452,7 @@ const _sfc_main = {
21452
21452
  this.$emit("insertparagraph", this.value);
21453
21453
  },
21454
21454
  //编辑器焦点更新
21455
- handleRangeUpdate() {
21455
+ handleRangeUpdate(range) {
21456
21456
  if (this.disabled) {
21457
21457
  return;
21458
21458
  }
@@ -21462,7 +21462,7 @@ const _sfc_main = {
21462
21462
  if (this.menuConfig.use) {
21463
21463
  this.$refs.menu.handleRangeUpdate();
21464
21464
  }
21465
- this.$emit("rangeupdate", this.value);
21465
+ this.$emit("rangeupdate", this.value, range);
21466
21466
  },
21467
21467
  //编辑器复制
21468
21468
  handleCopy(text2, html) {
@@ -22382,6 +22382,29 @@ const _sfc_main = {
22382
22382
  this.editor.formatElementStack();
22383
22383
  this.editor.domRender();
22384
22384
  this.editor.rangeRender();
22385
+ },
22386
+ //api:插入文本
22387
+ insertText(text2) {
22388
+ if (this.disabled) {
22389
+ return;
22390
+ }
22391
+ this.editor.insertText(text2);
22392
+ this.editor.formatElementStack();
22393
+ this.editor.domRender();
22394
+ this.editor.rangeRender();
22395
+ },
22396
+ //api:插入html
22397
+ insertHtml(html) {
22398
+ if (this.disabled) {
22399
+ return;
22400
+ }
22401
+ const elements = this.editor.parseHtml(html);
22402
+ for (let i = 0; i < elements.length; i++) {
22403
+ this.editor.insertElement(elements[i]);
22404
+ }
22405
+ this.editor.formatElementStack();
22406
+ this.editor.domRender();
22407
+ this.editor.rangeRender();
22385
22408
  }
22386
22409
  },
22387
22410
  beforeUnmount() {
@@ -22446,7 +22469,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22446
22469
  ])) : createCommentVNode("", true)
22447
22470
  ]);
22448
22471
  }
22449
- const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-be97ae51"]]);
22472
+ const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-82396597"]]);
22450
22473
  const iconfont = "";
22451
22474
  const en_US = {
22452
22475
  textWrapUp: "Up feed",
@@ -22625,7 +22648,7 @@ const i18n = (locale) => {
22625
22648
  return translations[locale][key];
22626
22649
  };
22627
22650
  };
22628
- const version = "0.0.11";
22651
+ const version = "0.0.14";
22629
22652
  const install = (app, props) => {
22630
22653
  const locale = (props ? props.locale : "zh_CN") || "zh_CN";
22631
22654
  app.provide("$editTrans", i18n(locale));
@@ -22637,6 +22660,7 @@ const stdin_default = {
22637
22660
  version
22638
22661
  };
22639
22662
  export {
22663
+ AlexEditor as AlexElement,
22640
22664
  stdin_default as default,
22641
22665
  install,
22642
22666
  version