vue-editify 0.0.19 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
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"> </editify>
3
+ <editify v-model="value" placeholder="请输入正文内容..." allow-paste-html border @change="change" :menu="menuConfig" ref="editify"></editify>
4
4
  </div>
5
5
  </template>
6
6
  <script>
@@ -11,10 +11,13 @@ export default {
11
11
  return {
12
12
  value: '<p><span>这是一个基于 </span><span data-editify-code="true">Vue3 + alex-editor</span><span> 构建的一套</span><span style="font-weight: bold;">精美UI样式</span><span>的</span><span style="font-weight: bold;">开箱即用</span><span>的</span><span style="color: #ec1a0a;">富文本编辑器</span></p>',
13
13
  menuConfig: {
14
- mode: 'fixed',
15
14
  sequence: {
16
15
  alert: 100
17
16
  },
17
+ table: {
18
+ maxRows: 20,
19
+ maxColumns: 20
20
+ },
18
21
  extends: {
19
22
  alert: {
20
23
  title: '自定义菜单按钮',
@@ -60,7 +63,7 @@ export default {
60
63
  },
61
64
  methods: {
62
65
  change() {
63
- this.$refs.editify.isSourceView = !this.$refs.editify.isSourceView
66
+ console.log(this.$refs.editify.textValue)
64
67
  },
65
68
  operate(name, val) {
66
69
  console.log('触发operate事件', name, val)
package/lib/editify.es.js CHANGED
@@ -1914,7 +1914,6 @@ const queryHasValue = (obj$1$1, name, value) => {
1914
1914
  const arr = obj$1.color.hex2rgb(ownValue);
1915
1915
  ownValue = `rgb(${arr[0]},${arr[1]},${arr[2]})`;
1916
1916
  }
1917
- console.log(ownValue, value);
1918
1917
  return ownValue == value;
1919
1918
  };
1920
1919
  const _AlexElement = class _AlexElement2 {
@@ -3297,7 +3296,7 @@ class AlexEditor {
3297
3296
  const data2 = await blob.text();
3298
3297
  if (data2) {
3299
3298
  if (typeof this.customTextPaste == "function") {
3300
- this.customTextPaste.apply(this, [data2]);
3299
+ await this.customTextPaste.apply(this, [data2]);
3301
3300
  } else {
3302
3301
  this.insertText(data2);
3303
3302
  this.emit("pasteText", data2);
@@ -3310,7 +3309,7 @@ class AlexEditor {
3310
3309
  return !el.isEmpty();
3311
3310
  });
3312
3311
  if (typeof this.customHtmlPaste == "function") {
3313
- this.customHtmlPaste.apply(this, [elements, data2]);
3312
+ await this.customHtmlPaste.apply(this, [elements, data2]);
3314
3313
  } else {
3315
3314
  for (let i2 = 0; i2 < elements.length; i2++) {
3316
3315
  this.formatElement(elements[i2]);
@@ -3327,7 +3326,7 @@ class AlexEditor {
3327
3326
  if (blob.type.startsWith("image/")) {
3328
3327
  const url2 = await blobToBase64(blob);
3329
3328
  if (typeof this.customImagePaste == "function") {
3330
- this.customImagePaste.apply(this, [url2]);
3329
+ await this.customImagePaste.apply(this, [url2]);
3331
3330
  } else {
3332
3331
  const image = new AlexElement(
3333
3332
  "closed",
@@ -3344,7 +3343,7 @@ class AlexEditor {
3344
3343
  } else if (blob.type.startsWith("video/")) {
3345
3344
  const url2 = await blobToBase64(blob);
3346
3345
  if (typeof this.customVideoPaste == "function") {
3347
- this.customVideoPaste.apply(this, [url2]);
3346
+ await this.customVideoPaste.apply(this, [url2]);
3348
3347
  } else {
3349
3348
  const video = new AlexElement(
3350
3349
  "closed",
@@ -3362,7 +3361,7 @@ class AlexEditor {
3362
3361
  const data2 = await blob.text();
3363
3362
  if (data2) {
3364
3363
  if (typeof this.customTextPaste == "function") {
3365
- this.customTextPaste.apply(this, [data2]);
3364
+ await this.customTextPaste.apply(this, [data2]);
3366
3365
  } else {
3367
3366
  this.insertText(data2);
3368
3367
  this.emit("pasteText", data2);
@@ -8283,6 +8282,43 @@ function plaintext(hljs2) {
8283
8282
  disableAutodetect: true
8284
8283
  };
8285
8284
  }
8285
+ function json(hljs2) {
8286
+ const ATTRIBUTE = {
8287
+ className: "attr",
8288
+ begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
8289
+ relevance: 1.01
8290
+ };
8291
+ const PUNCTUATION = {
8292
+ match: /[{}[\],:]/,
8293
+ className: "punctuation",
8294
+ relevance: 0
8295
+ };
8296
+ const LITERALS2 = [
8297
+ "true",
8298
+ "false",
8299
+ "null"
8300
+ ];
8301
+ const LITERALS_MODE = {
8302
+ scope: "literal",
8303
+ beginKeywords: LITERALS2.join(" ")
8304
+ };
8305
+ return {
8306
+ name: "JSON",
8307
+ keywords: {
8308
+ literal: LITERALS2
8309
+ },
8310
+ contains: [
8311
+ ATTRIBUTE,
8312
+ PUNCTUATION,
8313
+ hljs2.QUOTE_STRING_MODE,
8314
+ LITERALS_MODE,
8315
+ hljs2.C_NUMBER_MODE,
8316
+ hljs2.C_LINE_COMMENT_MODE,
8317
+ hljs2.C_BLOCK_COMMENT_MODE
8318
+ ],
8319
+ illegal: "\\S"
8320
+ };
8321
+ }
8286
8322
  const IDENT_RE$1 = "[A-Za-z$_][0-9A-Za-z$_]*";
8287
8323
  const KEYWORDS$1 = [
8288
8324
  "as",
@@ -15169,6 +15205,7 @@ function python(hljs2) {
15169
15205
  }
15170
15206
  const hljs = "";
15171
15207
  HighlightJS.registerLanguage("plaintext", plaintext);
15208
+ HighlightJS.registerLanguage("json", json);
15172
15209
  HighlightJS.registerLanguage("javascript", javascript$1);
15173
15210
  HighlightJS.registerLanguage("java", java);
15174
15211
  HighlightJS.registerLanguage("typescript", typescript);
@@ -15197,7 +15234,7 @@ const getHljsHtml = function(code, language) {
15197
15234
  }
15198
15235
  return HighlightJS.highlightAuto(code).value;
15199
15236
  };
15200
- const languages = ["plaintext", "javascript", "html", "css", "less", "scss", "java", "markdown", "swift", "objectivec", "typescript", "dart", "nginx", "php", "python"];
15237
+ const languages = ["plaintext", "json", "javascript", "html", "css", "less", "scss", "java", "markdown", "swift", "objectivec", "typescript", "dart", "nginx", "php", "python"];
15201
15238
  const pasteKeepData = {
15202
15239
  //粘贴html时元素保留的样式(全部元素)
15203
15240
  marks: {
@@ -15582,7 +15619,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
15582
15619
  label: editTrans("h1"),
15583
15620
  value: "h1",
15584
15621
  style: {
15585
- fontSize: "22px",
15622
+ fontSize: "26px",
15586
15623
  fontWeight: "bold"
15587
15624
  }
15588
15625
  },
@@ -15590,7 +15627,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
15590
15627
  label: editTrans("h2"),
15591
15628
  value: "h2",
15592
15629
  style: {
15593
- fontSize: "20px",
15630
+ fontSize: "24px",
15594
15631
  fontWeight: "bold"
15595
15632
  }
15596
15633
  },
@@ -15598,7 +15635,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
15598
15635
  label: editTrans("h3"),
15599
15636
  value: "h3",
15600
15637
  style: {
15601
- fontSize: "18px",
15638
+ fontSize: "22px",
15602
15639
  fontWeight: "bold"
15603
15640
  }
15604
15641
  },
@@ -15606,7 +15643,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
15606
15643
  label: editTrans("h4"),
15607
15644
  value: "h4",
15608
15645
  style: {
15609
- fontSize: "16px",
15646
+ fontSize: "20px",
15610
15647
  fontWeight: "bold"
15611
15648
  }
15612
15649
  },
@@ -15614,7 +15651,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
15614
15651
  label: editTrans("h5"),
15615
15652
  value: "h5",
15616
15653
  style: {
15617
- fontSize: "15px",
15654
+ fontSize: "18px",
15618
15655
  fontWeight: "bold"
15619
15656
  }
15620
15657
  },
@@ -15622,7 +15659,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
15622
15659
  label: editTrans("h6"),
15623
15660
  value: "h6",
15624
15661
  style: {
15625
- fontSize: "14px",
15662
+ fontSize: "16px",
15626
15663
  fontWeight: "bold"
15627
15664
  }
15628
15665
  }
@@ -15807,7 +15844,7 @@ const getToolbarConfig = function(editTrans, editLocale) {
15807
15844
  //按钮默认显示的值
15808
15845
  defaultValue: "p",
15809
15846
  //浮层宽度
15810
- width: editLocale == "en_US" ? 140 : 120,
15847
+ width: editLocale == "en_US" ? 150 : 130,
15811
15848
  //浮层最大高度
15812
15849
  maxHeight: "",
15813
15850
  //左侧边框是否显示
@@ -16013,7 +16050,7 @@ const getMenuConfig = function(editTrans, editLocale) {
16013
16050
  use: true,
16014
16051
  //是否使用工具提示
16015
16052
  tooltip: true,
16016
- //菜单栏显示模式,支持default/inner/fixed/custom
16053
+ //菜单栏显示模式,支持default/inner/fixed
16017
16054
  mode: "default",
16018
16055
  //添加额外的按钮禁用判定,回调参数为name,this指向组件实例
16019
16056
  extraDisabled: null,
@@ -16077,7 +16114,7 @@ const getMenuConfig = function(editTrans, editLocale) {
16077
16114
  //按钮默认显示的值
16078
16115
  defaultValue: "p",
16079
16116
  //浮层宽度
16080
- width: editLocale == "en_US" ? 140 : 120,
16117
+ width: editLocale == "en_US" ? 150 : 130,
16081
16118
  //浮层最大高度
16082
16119
  maxHeight: "",
16083
16120
  //左侧边框是否显示
@@ -16334,7 +16371,7 @@ const getMenuConfig = function(editTrans, editLocale) {
16334
16371
  leftBorder: false,
16335
16372
  //右侧边框是否显示
16336
16373
  rightBorder: false,
16337
- //图片支持上传的类型,不区分大小写
16374
+ //视频支持上传的类型,不区分大小写
16338
16375
  accept: ["mp4", "avi", "mpg", "wmv", "mov", "rm", "swf", "flv"],
16339
16376
  //是否多选视频
16340
16377
  multiple: false,
@@ -17475,7 +17512,7 @@ const _hoisted_4$6 = {
17475
17512
  key: 1,
17476
17513
  class: "editify-button-options"
17477
17514
  };
17478
- const _hoisted_5$5 = ["onClick"];
17515
+ const _hoisted_5$6 = ["onClick"];
17479
17516
  const _hoisted_6$5 = {
17480
17517
  key: 1,
17481
17518
  class: "editify-button-option-flex"
@@ -17554,7 +17591,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
17554
17591
  }, null, 8, ["value"])) : createCommentVNode("", true),
17555
17592
  createElementVNode("span", null, toDisplayString(item.label), 1)
17556
17593
  ]))
17557
- ], 14, _hoisted_5$5);
17594
+ ], 14, _hoisted_5$6);
17558
17595
  }), 256))
17559
17596
  ]))
17560
17597
  ], 4)
@@ -17778,7 +17815,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
17778
17815
  ]);
17779
17816
  }
17780
17817
  const Colors = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-dc6d3d68"]]);
17781
- const Toolbar_vue_vue_type_style_index_0_scoped_c318ca15_lang = "";
17818
+ const Toolbar_vue_vue_type_style_index_0_scoped_6b9cdbc6_lang = "";
17782
17819
  const _sfc_main$6 = {
17783
17820
  name: "Toolbar",
17784
17821
  emits: ["update:modelValue"],
@@ -18548,7 +18585,7 @@ const _hoisted_1$6 = {
18548
18585
  const _hoisted_2$5 = { class: "editify-toolbar-link-label" };
18549
18586
  const _hoisted_3$5 = ["placeholder"];
18550
18587
  const _hoisted_4$5 = { class: "editify-toolbar-link-footer" };
18551
- const _hoisted_5$4 = { class: "editify-toolbar-link-operations" };
18588
+ const _hoisted_5$5 = { class: "editify-toolbar-link-operations" };
18552
18589
  const _hoisted_6$4 = ["href"];
18553
18590
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
18554
18591
  const _component_Checkbox = resolveComponent("Checkbox");
@@ -18598,7 +18635,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
18598
18635
  color: _ctx.$parent.color,
18599
18636
  size: 10
18600
18637
  }, null, 8, ["onChange", "modelValue", "label", "color"]),
18601
- createElementVNode("div", _hoisted_5$4, [
18638
+ createElementVNode("div", _hoisted_5$5, [
18602
18639
  createElementVNode("span", {
18603
18640
  onClick: _cache[5] || (_cache[5] = (...args) => _ctx.$parent.removeLink && _ctx.$parent.removeLink(...args))
18604
18641
  }, toDisplayString($options.$editTrans("removeLink")), 1),
@@ -19249,7 +19286,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
19249
19286
  _: 1
19250
19287
  }, 8, ["modelValue", "node", "onShow", "useRange"]);
19251
19288
  }
19252
- const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-c318ca15"]]);
19289
+ const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-6b9cdbc6"]]);
19253
19290
  const InsertLink_vue_vue_type_style_index_0_scoped_e6c3c2ee_lang = "";
19254
19291
  const _sfc_main$5 = {
19255
19292
  name: "InsertLink",
@@ -19309,7 +19346,7 @@ const _hoisted_1$5 = { class: "editify-link" };
19309
19346
  const _hoisted_2$4 = { class: "editify-link-label" };
19310
19347
  const _hoisted_3$4 = ["placeholder"];
19311
19348
  const _hoisted_4$4 = ["placeholder"];
19312
- const _hoisted_5$3 = { class: "editify-link-footer" };
19349
+ const _hoisted_5$4 = { class: "editify-link-footer" };
19313
19350
  const _hoisted_6$3 = { class: "editify-link-operations" };
19314
19351
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19315
19352
  const _component_Checkbox = resolveComponent("Checkbox");
@@ -19343,7 +19380,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19343
19380
  { trim: true }
19344
19381
  ]
19345
19382
  ]),
19346
- createElementVNode("div", _hoisted_5$3, [
19383
+ createElementVNode("div", _hoisted_5$4, [
19347
19384
  createVNode(_component_Checkbox, {
19348
19385
  modelValue: $data.newOpen,
19349
19386
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.newOpen = $event),
@@ -19514,7 +19551,7 @@ const _hoisted_3$3 = {
19514
19551
  class: "editify-image-remote"
19515
19552
  };
19516
19553
  const _hoisted_4$3 = ["placeholder"];
19517
- const _hoisted_5$2 = {
19554
+ const _hoisted_5$3 = {
19518
19555
  key: 1,
19519
19556
  class: "editify-image-upload"
19520
19557
  };
@@ -19560,7 +19597,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
19560
19597
  onClick: _cache[5] || (_cache[5] = (...args) => $options.insertRemoteImage && $options.insertRemoteImage(...args))
19561
19598
  }, toDisplayString($options.$editTrans("insert")), 1)
19562
19599
  ], 4)
19563
- ])) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
19600
+ ])) : (openBlock(), createElementBlock("div", _hoisted_5$3, [
19564
19601
  createVNode(_component_Icon, { value: "upload" }),
19565
19602
  createElementVNode("input", {
19566
19603
  multiple: $props.multiple,
@@ -19725,7 +19762,7 @@ const _hoisted_3$2 = {
19725
19762
  class: "editify-video-remote"
19726
19763
  };
19727
19764
  const _hoisted_4$2 = ["placeholder"];
19728
- const _hoisted_5$1 = {
19765
+ const _hoisted_5$2 = {
19729
19766
  key: 1,
19730
19767
  class: "editify-video-upload"
19731
19768
  };
@@ -19771,7 +19808,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
19771
19808
  onClick: _cache[5] || (_cache[5] = (...args) => $options.insertRemoteVideo && $options.insertRemoteVideo(...args))
19772
19809
  }, toDisplayString($options.$editTrans("insert")), 1)
19773
19810
  ], 4)
19774
- ])) : (openBlock(), createElementBlock("div", _hoisted_5$1, [
19811
+ ])) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
19775
19812
  createVNode(_component_Icon, { value: "upload" }),
19776
19813
  createElementVNode("input", {
19777
19814
  multiple: $props.multiple,
@@ -19783,7 +19820,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
19783
19820
  ]);
19784
19821
  }
19785
19822
  const InsertVideo = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-cbc84525"]]);
19786
- const InsertTable_vue_vue_type_style_index_0_scoped_0277a84c_lang = "";
19823
+ const InsertTable_vue_vue_type_style_index_0_scoped_8b802b11_lang = "";
19787
19824
  const _sfc_main$2 = {
19788
19825
  name: "InsertTable",
19789
19826
  emits: ["insert"],
@@ -19809,6 +19846,25 @@ const _sfc_main$2 = {
19809
19846
  tableGrids: this.getTableGrids()
19810
19847
  };
19811
19848
  },
19849
+ computed: {
19850
+ //表格规格
19851
+ specification() {
19852
+ return this.tableGrids.flat().filter((item) => {
19853
+ return item.inside;
19854
+ }).sort((a, b) => {
19855
+ if (a.x > b.x && a.y > b.y) {
19856
+ return -1;
19857
+ }
19858
+ if (a.x > b.x) {
19859
+ return -1;
19860
+ }
19861
+ if (a.y > b.y) {
19862
+ return -1;
19863
+ }
19864
+ return 1;
19865
+ })[0];
19866
+ }
19867
+ },
19812
19868
  methods: {
19813
19869
  //确认创立表格
19814
19870
  createTable(data2) {
@@ -19846,13 +19902,17 @@ const _sfc_main$2 = {
19846
19902
  }
19847
19903
  }
19848
19904
  };
19849
- const _withScopeId = (n) => (pushScopeId("data-v-0277a84c"), n = n(), popScopeId(), n);
19905
+ const _withScopeId = (n) => (pushScopeId("data-v-8b802b11"), n = n(), popScopeId(), n);
19850
19906
  const _hoisted_1$2 = { class: "editify-table" };
19851
19907
  const _hoisted_2$1 = ["onMouseenter", "onClick"];
19852
19908
  const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, null, -1));
19853
19909
  const _hoisted_4$1 = [
19854
19910
  _hoisted_3$1
19855
19911
  ];
19912
+ const _hoisted_5$1 = {
19913
+ key: 0,
19914
+ class: "editify-table-footer"
19915
+ };
19856
19916
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
19857
19917
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
19858
19918
  createElementVNode("table", null, [
@@ -19867,11 +19927,12 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
19867
19927
  }), 256))
19868
19928
  ]);
19869
19929
  }), 256))
19870
- ])
19930
+ ]),
19931
+ $options.specification ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString($options.specification.x) + " x " + toDisplayString($options.specification.y), 1)) : createCommentVNode("", true)
19871
19932
  ]);
19872
19933
  }
19873
- const InsertTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-0277a84c"]]);
19874
- const Menu_vue_vue_type_style_index_0_scoped_4c7850ff_lang = "";
19934
+ const InsertTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-8b802b11"]]);
19935
+ const Menu_vue_vue_type_style_index_0_scoped_3fc2d533_lang = "";
19875
19936
  const _sfc_main$1 = {
19876
19937
  name: "Menu",
19877
19938
  props: {
@@ -20942,8 +21003,6 @@ const _sfc_main$1 = {
20942
21003
  if (!this.$parent.isSourceView) {
20943
21004
  this.$parent.editor.rangeRender();
20944
21005
  }
20945
- } else {
20946
- this.$parent.$emit("menu-operate", name, val);
20947
21006
  }
20948
21007
  },
20949
21008
  //处理光标更新
@@ -21091,8 +21150,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
21091
21150
  }), 256))
21092
21151
  ], 14, _hoisted_1$1);
21093
21152
  }
21094
- const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-4c7850ff"]]);
21095
- const Editify_vue_vue_type_style_index_0_scoped_bcab43d0_lang = "";
21153
+ const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-3fc2d533"]]);
21154
+ const Editify_vue_vue_type_style_index_0_scoped_e9c5b94e_lang = "";
21096
21155
  const _sfc_main = {
21097
21156
  name: "editify",
21098
21157
  props: { ...editorProps },
@@ -22243,7 +22302,7 @@ const _sfc_main = {
22243
22302
  this.editor.rangeRender();
22244
22303
  },
22245
22304
  //api:插入图片
22246
- insertImage(url2) {
22305
+ insertImage(url2, isRender = true) {
22247
22306
  if (this.disabled) {
22248
22307
  return;
22249
22308
  }
@@ -22263,12 +22322,14 @@ const _sfc_main = {
22263
22322
  null
22264
22323
  );
22265
22324
  this.editor.insertElement(image);
22266
- this.editor.formatElementStack();
22267
- this.editor.domRender();
22268
- this.editor.rangeRender();
22325
+ if (isRender) {
22326
+ this.editor.formatElementStack();
22327
+ this.editor.domRender();
22328
+ this.editor.rangeRender();
22329
+ }
22269
22330
  },
22270
22331
  //api:插入视频
22271
- insertVideo(url2) {
22332
+ insertVideo(url2, isRender = true) {
22272
22333
  if (this.disabled) {
22273
22334
  return;
22274
22335
  }
@@ -22294,9 +22355,11 @@ const _sfc_main = {
22294
22355
  this.editor.addElementBefore(leftSpace, video);
22295
22356
  this.editor.range.anchor.moveToEnd(rightSpace);
22296
22357
  this.editor.range.focus.moveToEnd(rightSpace);
22297
- this.editor.formatElementStack();
22298
- this.editor.domRender();
22299
- this.editor.rangeRender();
22358
+ if (isRender) {
22359
+ this.editor.formatElementStack();
22360
+ this.editor.domRender();
22361
+ this.editor.rangeRender();
22362
+ }
22300
22363
  },
22301
22364
  //api:选区是否含有代码块样式
22302
22365
  hasPreStyle() {
@@ -22685,7 +22748,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22685
22748
  ])) : createCommentVNode("", true)
22686
22749
  ]);
22687
22750
  }
22688
- const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bcab43d0"]]);
22751
+ const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9c5b94e"]]);
22689
22752
  const iconfont = "";
22690
22753
  const en_US = {
22691
22754
  textWrapUp: "Up feed",
@@ -22864,7 +22927,7 @@ const i18n = (locale) => {
22864
22927
  return translations[locale][key];
22865
22928
  };
22866
22929
  };
22867
- const version = "0.0.19";
22930
+ const version = "0.0.21";
22868
22931
  const install = (app, props) => {
22869
22932
  const locale = (props ? props.locale : "zh_CN") || "zh_CN";
22870
22933
  app.provide("$editTrans", i18n(locale));