vue-editify 0.0.39 → 0.0.41
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 +114 -80
- package/lib/editify.umd.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/Editify.vue +106 -71
- package/src/components/base/Button.vue +1 -1
- package/src/components/bussiness/Menu.vue +1 -1
- package/src/index.js +2 -2
package/lib/editify.es.js
CHANGED
@@ -17291,7 +17291,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17291
17291
|
}, null, 2);
|
17292
17292
|
}
|
17293
17293
|
const Icon = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-5ed6cd4d"]]);
|
17294
|
-
const
|
17294
|
+
const Button_vue_vue_type_style_index_0_scoped_32253355_lang = "";
|
17295
17295
|
const _sfc_main$9 = {
|
17296
17296
|
name: "Button",
|
17297
17297
|
emits: ["operate", "layerShow", "layerShown", "layerHidden"],
|
@@ -17614,7 +17614,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17614
17614
|
border: "",
|
17615
17615
|
fade: "",
|
17616
17616
|
placement: "bottom-start",
|
17617
|
-
"z-index":
|
17617
|
+
"z-index": 12,
|
17618
17618
|
animation: "translate",
|
17619
17619
|
onShow: $options.layerShow,
|
17620
17620
|
onShown: $options.layerShown,
|
@@ -17655,7 +17655,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17655
17655
|
], 2)
|
17656
17656
|
]);
|
17657
17657
|
}
|
17658
|
-
const Button = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-
|
17658
|
+
const Button = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-32253355"]]);
|
17659
17659
|
const Checkbox_vue_vue_type_style_index_0_scoped_50cd9e6c_lang = "";
|
17660
17660
|
const _sfc_main$8 = {
|
17661
17661
|
name: "Checkbox",
|
@@ -19988,7 +19988,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19988
19988
|
]);
|
19989
19989
|
}
|
19990
19990
|
const InsertTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-227ede65"]]);
|
19991
|
-
const
|
19991
|
+
const Menu_vue_vue_type_style_index_0_scoped_85cbaf03_lang = "";
|
19992
19992
|
const _sfc_main$1 = {
|
19993
19993
|
name: "Menu",
|
19994
19994
|
props: {
|
@@ -21206,8 +21206,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21206
21206
|
}), 256))
|
21207
21207
|
], 14, _hoisted_1$1);
|
21208
21208
|
}
|
21209
|
-
const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
|
21210
|
-
const
|
21209
|
+
const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-85cbaf03"]]);
|
21210
|
+
const Editify_vue_vue_type_style_index_0_scoped_6e31db33_lang = "";
|
21211
21211
|
const _sfc_main = {
|
21212
21212
|
name: "editify",
|
21213
21213
|
props: { ...editorProps },
|
@@ -21536,7 +21536,7 @@ const _sfc_main = {
|
|
21536
21536
|
}
|
21537
21537
|
}
|
21538
21538
|
}
|
21539
|
-
if (!obj.element.isContains(this.$el, e.target)) {
|
21539
|
+
if (!obj.element.isContains(this.$el, e.target) && !this.isSourceView) {
|
21540
21540
|
this.canUseMenu = false;
|
21541
21541
|
}
|
21542
21542
|
},
|
@@ -21877,7 +21877,7 @@ const _sfc_main = {
|
|
21877
21877
|
return null;
|
21878
21878
|
},
|
21879
21879
|
//api:删除光标所在的指定标签元素
|
21880
|
-
deleteByParsedom(parsedom) {
|
21880
|
+
deleteByParsedom(parsedom, isRender = true) {
|
21881
21881
|
if (this.disabled) {
|
21882
21882
|
return;
|
21883
21883
|
}
|
@@ -21887,13 +21887,15 @@ const _sfc_main = {
|
|
21887
21887
|
const element2 = this.getCurrentParsedomElement(parsedom);
|
21888
21888
|
if (element2) {
|
21889
21889
|
element2.toEmpty();
|
21890
|
-
|
21891
|
-
|
21892
|
-
|
21890
|
+
if (isRender) {
|
21891
|
+
this.editor.formatElementStack();
|
21892
|
+
this.editor.domRender();
|
21893
|
+
this.editor.rangeRender();
|
21894
|
+
}
|
21893
21895
|
}
|
21894
21896
|
},
|
21895
21897
|
//api:当光标在链接上时可以移除链接
|
21896
|
-
removeLink() {
|
21898
|
+
removeLink(isRender = true) {
|
21897
21899
|
if (this.disabled) {
|
21898
21900
|
return;
|
21899
21901
|
}
|
@@ -21905,13 +21907,15 @@ const _sfc_main = {
|
|
21905
21907
|
link.parsedom = AlexElement.TEXT_NODE;
|
21906
21908
|
delete link.marks.target;
|
21907
21909
|
delete link.marks.href;
|
21908
|
-
|
21909
|
-
|
21910
|
-
|
21910
|
+
if (isRender) {
|
21911
|
+
this.editor.formatElementStack();
|
21912
|
+
this.editor.domRender();
|
21913
|
+
this.editor.rangeRender();
|
21914
|
+
}
|
21911
21915
|
}
|
21912
21916
|
},
|
21913
21917
|
//api:设置标题
|
21914
|
-
setHeading(parsedom) {
|
21918
|
+
setHeading(parsedom, isRender = true) {
|
21915
21919
|
if (this.disabled) {
|
21916
21920
|
return;
|
21917
21921
|
}
|
@@ -21941,12 +21945,14 @@ const _sfc_main = {
|
|
21941
21945
|
}
|
21942
21946
|
});
|
21943
21947
|
}
|
21944
|
-
|
21945
|
-
|
21946
|
-
|
21948
|
+
if (isRender) {
|
21949
|
+
this.editor.formatElementStack();
|
21950
|
+
this.editor.domRender();
|
21951
|
+
this.editor.rangeRender();
|
21952
|
+
}
|
21947
21953
|
},
|
21948
21954
|
//api:插入有序列表 ordered为true表示有序列表
|
21949
|
-
setList(ordered) {
|
21955
|
+
setList(ordered, isRender = true) {
|
21950
21956
|
if (this.disabled) {
|
21951
21957
|
return;
|
21952
21958
|
}
|
@@ -21980,12 +21986,14 @@ const _sfc_main = {
|
|
21980
21986
|
}
|
21981
21987
|
});
|
21982
21988
|
}
|
21983
|
-
|
21984
|
-
|
21985
|
-
|
21989
|
+
if (isRender) {
|
21990
|
+
this.editor.formatElementStack();
|
21991
|
+
this.editor.domRender();
|
21992
|
+
this.editor.rangeRender();
|
21993
|
+
}
|
21986
21994
|
},
|
21987
21995
|
//api:插入任务列表
|
21988
|
-
setTask() {
|
21996
|
+
setTask(isRender = true) {
|
21989
21997
|
if (this.disabled) {
|
21990
21998
|
return;
|
21991
21999
|
}
|
@@ -22019,12 +22027,14 @@ const _sfc_main = {
|
|
22019
22027
|
}
|
22020
22028
|
});
|
22021
22029
|
}
|
22022
|
-
|
22023
|
-
|
22024
|
-
|
22030
|
+
if (isRender) {
|
22031
|
+
this.editor.formatElementStack();
|
22032
|
+
this.editor.domRender();
|
22033
|
+
this.editor.rangeRender();
|
22034
|
+
}
|
22025
22035
|
},
|
22026
22036
|
//api:设置样式
|
22027
|
-
setTextStyle(name, value) {
|
22037
|
+
setTextStyle(name, value, isRender = true) {
|
22028
22038
|
if (this.disabled) {
|
22029
22039
|
return;
|
22030
22040
|
}
|
@@ -22039,16 +22049,18 @@ const _sfc_main = {
|
|
22039
22049
|
styles[name] = value;
|
22040
22050
|
this.editor.setTextStyle(styles);
|
22041
22051
|
}
|
22042
|
-
|
22043
|
-
|
22044
|
-
|
22052
|
+
if (isRender) {
|
22053
|
+
this.editor.formatElementStack();
|
22054
|
+
this.editor.domRender();
|
22055
|
+
this.editor.rangeRender();
|
22056
|
+
}
|
22045
22057
|
},
|
22046
22058
|
//api:查询是否具有某个样式
|
22047
22059
|
queryTextStyle(name, value, useCache) {
|
22048
22060
|
return this.editor.queryTextStyle(name, value, useCache);
|
22049
22061
|
},
|
22050
22062
|
//api:设置标记
|
22051
|
-
setTextMark(name, value) {
|
22063
|
+
setTextMark(name, value, isRender = true) {
|
22052
22064
|
if (this.disabled) {
|
22053
22065
|
return;
|
22054
22066
|
}
|
@@ -22063,16 +22075,18 @@ const _sfc_main = {
|
|
22063
22075
|
marks[name] = value;
|
22064
22076
|
this.editor.setTextMark(marks);
|
22065
22077
|
}
|
22066
|
-
|
22067
|
-
|
22068
|
-
|
22078
|
+
if (isRender) {
|
22079
|
+
this.editor.formatElementStack();
|
22080
|
+
this.editor.domRender();
|
22081
|
+
this.editor.rangeRender();
|
22082
|
+
}
|
22069
22083
|
},
|
22070
22084
|
//api:查询是否具有某个标记
|
22071
22085
|
queryTextMark(name, value, useCache) {
|
22072
22086
|
return this.editor.queryTextMark(name, value, useCache);
|
22073
22087
|
},
|
22074
22088
|
//api:清除文本样式和标记
|
22075
|
-
formatText() {
|
22089
|
+
formatText(isRender = true) {
|
22076
22090
|
if (this.disabled) {
|
22077
22091
|
return;
|
22078
22092
|
}
|
@@ -22081,12 +22095,14 @@ const _sfc_main = {
|
|
22081
22095
|
}
|
22082
22096
|
this.editor.removeTextStyle();
|
22083
22097
|
this.editor.removeTextMark();
|
22084
|
-
|
22085
|
-
|
22086
|
-
|
22098
|
+
if (isRender) {
|
22099
|
+
this.editor.formatElementStack();
|
22100
|
+
this.editor.domRender();
|
22101
|
+
this.editor.rangeRender();
|
22102
|
+
}
|
22087
22103
|
},
|
22088
22104
|
//api:设置对齐方式,参数取值justify/left/right/center
|
22089
|
-
setAlign(value) {
|
22105
|
+
setAlign(value, isRender = true) {
|
22090
22106
|
if (this.disabled) {
|
22091
22107
|
return;
|
22092
22108
|
}
|
@@ -22147,9 +22163,11 @@ const _sfc_main = {
|
|
22147
22163
|
}
|
22148
22164
|
});
|
22149
22165
|
}
|
22150
|
-
|
22151
|
-
|
22152
|
-
|
22166
|
+
if (isRender) {
|
22167
|
+
this.editor.formatElementStack();
|
22168
|
+
this.editor.domRender();
|
22169
|
+
this.editor.rangeRender();
|
22170
|
+
}
|
22153
22171
|
},
|
22154
22172
|
//api:撤销
|
22155
22173
|
undo() {
|
@@ -22182,7 +22200,7 @@ const _sfc_main = {
|
|
22182
22200
|
}
|
22183
22201
|
},
|
22184
22202
|
//api:插入引用
|
22185
|
-
setQuote() {
|
22203
|
+
setQuote(isRender = true) {
|
22186
22204
|
if (this.disabled) {
|
22187
22205
|
return;
|
22188
22206
|
}
|
@@ -22214,12 +22232,14 @@ const _sfc_main = {
|
|
22214
22232
|
}
|
22215
22233
|
});
|
22216
22234
|
}
|
22217
|
-
|
22218
|
-
|
22219
|
-
|
22235
|
+
if (isRender) {
|
22236
|
+
this.editor.formatElementStack();
|
22237
|
+
this.editor.domRender();
|
22238
|
+
this.editor.rangeRender();
|
22239
|
+
}
|
22220
22240
|
},
|
22221
22241
|
//api:设置行高
|
22222
|
-
setLineHeight(value) {
|
22242
|
+
setLineHeight(value, isRender = true) {
|
22223
22243
|
if (this.disabled) {
|
22224
22244
|
return;
|
22225
22245
|
}
|
@@ -22280,12 +22300,14 @@ const _sfc_main = {
|
|
22280
22300
|
}
|
22281
22301
|
});
|
22282
22302
|
}
|
22283
|
-
|
22284
|
-
|
22285
|
-
|
22303
|
+
if (isRender) {
|
22304
|
+
this.editor.formatElementStack();
|
22305
|
+
this.editor.domRender();
|
22306
|
+
this.editor.rangeRender();
|
22307
|
+
}
|
22286
22308
|
},
|
22287
22309
|
//api:增加缩进
|
22288
|
-
setIndentIncrease() {
|
22310
|
+
setIndentIncrease(isRender = true) {
|
22289
22311
|
if (this.disabled) {
|
22290
22312
|
return;
|
22291
22313
|
}
|
@@ -22331,12 +22353,14 @@ const _sfc_main = {
|
|
22331
22353
|
}
|
22332
22354
|
});
|
22333
22355
|
}
|
22334
|
-
|
22335
|
-
|
22336
|
-
|
22356
|
+
if (isRender) {
|
22357
|
+
this.editor.formatElementStack();
|
22358
|
+
this.editor.domRender();
|
22359
|
+
this.editor.rangeRender();
|
22360
|
+
}
|
22337
22361
|
},
|
22338
22362
|
//api:减少缩进
|
22339
|
-
setIndentDecrease() {
|
22363
|
+
setIndentDecrease(isRender = true) {
|
22340
22364
|
if (this.disabled) {
|
22341
22365
|
return;
|
22342
22366
|
}
|
@@ -22374,9 +22398,11 @@ const _sfc_main = {
|
|
22374
22398
|
}
|
22375
22399
|
});
|
22376
22400
|
}
|
22377
|
-
|
22378
|
-
|
22379
|
-
|
22401
|
+
if (isRender) {
|
22402
|
+
this.editor.formatElementStack();
|
22403
|
+
this.editor.domRender();
|
22404
|
+
this.editor.rangeRender();
|
22405
|
+
}
|
22380
22406
|
},
|
22381
22407
|
//api:插入图片
|
22382
22408
|
insertImage(url2, isRender = true) {
|
@@ -22542,7 +22568,7 @@ const _sfc_main = {
|
|
22542
22568
|
}
|
22543
22569
|
});
|
22544
22570
|
},
|
22545
|
-
|
22571
|
+
//api:选区是否含有图片
|
22546
22572
|
hasImage() {
|
22547
22573
|
if (!this.editor.range) {
|
22548
22574
|
return false;
|
@@ -22555,7 +22581,7 @@ const _sfc_main = {
|
|
22555
22581
|
return item.element.isClosed() && item.element.parsedom == "img";
|
22556
22582
|
});
|
22557
22583
|
},
|
22558
|
-
|
22584
|
+
//api:选区是否含有视频
|
22559
22585
|
hasVideo() {
|
22560
22586
|
if (!this.editor.range) {
|
22561
22587
|
return false;
|
@@ -22626,7 +22652,7 @@ const _sfc_main = {
|
|
22626
22652
|
});
|
22627
22653
|
},
|
22628
22654
|
//api:创建一个空的表格
|
22629
|
-
insertTable(rowLength, colLength) {
|
22655
|
+
insertTable(rowLength, colLength, isRender = true) {
|
22630
22656
|
if (this.disabled) {
|
22631
22657
|
return;
|
22632
22658
|
}
|
@@ -22651,14 +22677,16 @@ const _sfc_main = {
|
|
22651
22677
|
const breakEl = new AlexElement("closed", "br", null, null, null);
|
22652
22678
|
this.editor.addElementTo(breakEl, paragraph);
|
22653
22679
|
this.editor.addElementAfter(paragraph, table);
|
22654
|
-
this.editor.formatElementStack();
|
22655
22680
|
this.editor.range.anchor.moveToStart(tbody);
|
22656
22681
|
this.editor.range.focus.moveToStart(tbody);
|
22657
|
-
|
22658
|
-
|
22682
|
+
if (isRender) {
|
22683
|
+
this.editor.formatElementStack();
|
22684
|
+
this.editor.domRender();
|
22685
|
+
this.editor.rangeRender();
|
22686
|
+
}
|
22659
22687
|
},
|
22660
22688
|
//api:插入代码块
|
22661
|
-
insertCodeBlock() {
|
22689
|
+
insertCodeBlock(isRender = true) {
|
22662
22690
|
if (this.disabled) {
|
22663
22691
|
return;
|
22664
22692
|
}
|
@@ -22729,12 +22757,14 @@ const _sfc_main = {
|
|
22729
22757
|
this.editor.addElementAfter(paragraph, pre2);
|
22730
22758
|
}
|
22731
22759
|
}
|
22732
|
-
|
22733
|
-
|
22734
|
-
|
22760
|
+
if (isRender) {
|
22761
|
+
this.editor.formatElementStack();
|
22762
|
+
this.editor.domRender();
|
22763
|
+
this.editor.rangeRender();
|
22764
|
+
}
|
22735
22765
|
},
|
22736
22766
|
//api:插入文本
|
22737
|
-
insertText(text2) {
|
22767
|
+
insertText(text2, isRender = true) {
|
22738
22768
|
if (this.disabled) {
|
22739
22769
|
return;
|
22740
22770
|
}
|
@@ -22742,12 +22772,14 @@ const _sfc_main = {
|
|
22742
22772
|
return;
|
22743
22773
|
}
|
22744
22774
|
this.editor.insertText(text2);
|
22745
|
-
|
22746
|
-
|
22747
|
-
|
22775
|
+
if (isRender) {
|
22776
|
+
this.editor.formatElementStack();
|
22777
|
+
this.editor.domRender();
|
22778
|
+
this.editor.rangeRender();
|
22779
|
+
}
|
22748
22780
|
},
|
22749
22781
|
//api:插入html
|
22750
|
-
insertHtml(html) {
|
22782
|
+
insertHtml(html, isRender = true) {
|
22751
22783
|
if (this.disabled) {
|
22752
22784
|
return;
|
22753
22785
|
}
|
@@ -22758,9 +22790,11 @@ const _sfc_main = {
|
|
22758
22790
|
for (let i = 0; i < elements.length; i++) {
|
22759
22791
|
this.editor.insertElement(elements[i], false);
|
22760
22792
|
}
|
22761
|
-
|
22762
|
-
|
22763
|
-
|
22793
|
+
if (isRender) {
|
22794
|
+
this.editor.formatElementStack();
|
22795
|
+
this.editor.domRender();
|
22796
|
+
this.editor.rangeRender();
|
22797
|
+
}
|
22764
22798
|
}
|
22765
22799
|
},
|
22766
22800
|
beforeUnmount() {
|
@@ -22825,7 +22859,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
22825
22859
|
])) : createCommentVNode("", true)
|
22826
22860
|
]);
|
22827
22861
|
}
|
22828
|
-
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
22862
|
+
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6e31db33"]]);
|
22829
22863
|
const iconfont = "";
|
22830
22864
|
const en_US = {
|
22831
22865
|
textWrapUp: "Up feed",
|
@@ -23004,7 +23038,7 @@ const i18n = (locale) => {
|
|
23004
23038
|
return translations[locale][key];
|
23005
23039
|
};
|
23006
23040
|
};
|
23007
|
-
const version = "0.0.
|
23041
|
+
const version = "0.0.41";
|
23008
23042
|
const install = (app, props) => {
|
23009
23043
|
const locale = (props ? props.locale : "zh_CN") || "zh_CN";
|
23010
23044
|
app.provide("$editTrans", i18n(locale));
|
@@ -23018,6 +23052,6 @@ const stdin_default = {
|
|
23018
23052
|
export {
|
23019
23053
|
AlexElement,
|
23020
23054
|
stdin_default as default,
|
23021
|
-
install,
|
23055
|
+
install as editify,
|
23022
23056
|
version
|
23023
23057
|
};
|