vue-editify 0.0.40 → 0.0.42
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 +154 -94
- package/lib/editify.umd.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/Editify.vue +104 -70
- package/src/components/bussiness/Toolbar.vue +9 -1
- package/src/icon/iconfont.css +8 -0
- package/src/icon/iconfont.ttf +0 -0
- package/src/icon/iconfont.woff +0 -0
- package/src/index.js +2 -2
- package/src/locale/en_US.js +2 -1
- package/src/locale/zh_CN.js +2 -1
package/lib/editify.es.js
CHANGED
@@ -17869,7 +17869,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17869
17869
|
]);
|
17870
17870
|
}
|
17871
17871
|
const Colors = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-dc6d3d68"]]);
|
17872
|
-
const
|
17872
|
+
const Toolbar_vue_vue_type_style_index_0_scoped_29d60c70_lang = "";
|
17873
17873
|
const _sfc_main$6 = {
|
17874
17874
|
name: "Toolbar",
|
17875
17875
|
emits: ["update:modelValue"],
|
@@ -18649,7 +18649,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18649
18649
|
const _component_Layer = resolveComponent("Layer");
|
18650
18650
|
return openBlock(), createBlock(_component_Layer, {
|
18651
18651
|
modelValue: $options.show,
|
18652
|
-
"onUpdate:modelValue": _cache[
|
18652
|
+
"onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => $options.show = $event),
|
18653
18653
|
ref: "layer",
|
18654
18654
|
node: $props.node,
|
18655
18655
|
border: "",
|
@@ -18739,7 +18739,19 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18739
18739
|
_: 1
|
18740
18740
|
}, 8, ["title", "tooltip", "color"]),
|
18741
18741
|
createVNode(_component_Button, {
|
18742
|
-
onOperate: _cache[9] || (_cache[9] = ($event) =>
|
18742
|
+
onOperate: _cache[9] || (_cache[9] = ($event) => $options.setWidth("auto")),
|
18743
|
+
name: "setAutoWidth",
|
18744
|
+
title: $options.$editTrans("widthAuto"),
|
18745
|
+
tooltip: $props.config.tooltip,
|
18746
|
+
color: _ctx.$parent.color
|
18747
|
+
}, {
|
18748
|
+
default: withCtx(() => [
|
18749
|
+
createVNode(_component_Icon, { value: "auto-width" })
|
18750
|
+
]),
|
18751
|
+
_: 1
|
18752
|
+
}, 8, ["title", "tooltip", "color"]),
|
18753
|
+
createVNode(_component_Button, {
|
18754
|
+
onOperate: _cache[10] || (_cache[10] = ($event) => _ctx.$parent.deleteByParsedom("img")),
|
18743
18755
|
name: "deleteImage",
|
18744
18756
|
title: $options.$editTrans("deleteImage"),
|
18745
18757
|
tooltip: $props.config.tooltip,
|
@@ -18752,7 +18764,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18752
18764
|
}, 8, ["title", "tooltip", "color"])
|
18753
18765
|
], 64)) : $props.type == "video" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
18754
18766
|
createVNode(_component_Button, {
|
18755
|
-
onOperate: _cache[
|
18767
|
+
onOperate: _cache[11] || (_cache[11] = ($event) => $options.setWidth("30%")),
|
18756
18768
|
name: "set30Width",
|
18757
18769
|
title: $options.$editTrans("width30"),
|
18758
18770
|
tooltip: $props.config.tooltip,
|
@@ -18764,7 +18776,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18764
18776
|
_: 1
|
18765
18777
|
}, 8, ["title", "tooltip", "color"]),
|
18766
18778
|
createVNode(_component_Button, {
|
18767
|
-
onOperate: _cache[
|
18779
|
+
onOperate: _cache[12] || (_cache[12] = ($event) => $options.setWidth("50%")),
|
18768
18780
|
name: "set50Width",
|
18769
18781
|
title: $options.$editTrans("width50"),
|
18770
18782
|
tooltip: $props.config.tooltip,
|
@@ -18776,8 +18788,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18776
18788
|
_: 1
|
18777
18789
|
}, 8, ["title", "tooltip", "color"]),
|
18778
18790
|
createVNode(_component_Button, {
|
18779
|
-
|
18780
|
-
onOperate: _cache[12] || (_cache[12] = ($event) => $options.setWidth("100%")),
|
18791
|
+
onOperate: _cache[13] || (_cache[13] = ($event) => $options.setWidth("100%")),
|
18781
18792
|
name: "set100Width",
|
18782
18793
|
title: $options.$editTrans("width100"),
|
18783
18794
|
tooltip: $props.config.tooltip,
|
@@ -18788,6 +18799,19 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18788
18799
|
]),
|
18789
18800
|
_: 1
|
18790
18801
|
}, 8, ["title", "tooltip", "color"]),
|
18802
|
+
createVNode(_component_Button, {
|
18803
|
+
rightBorder: "",
|
18804
|
+
onOperate: _cache[14] || (_cache[14] = ($event) => $options.setWidth("auto")),
|
18805
|
+
name: "setAutoWidth",
|
18806
|
+
title: $options.$editTrans("widthAuto"),
|
18807
|
+
tooltip: $props.config.tooltip,
|
18808
|
+
color: _ctx.$parent.color
|
18809
|
+
}, {
|
18810
|
+
default: withCtx(() => [
|
18811
|
+
createVNode(_component_Icon, { value: "auto-width" })
|
18812
|
+
]),
|
18813
|
+
_: 1
|
18814
|
+
}, 8, ["title", "tooltip", "color"]),
|
18791
18815
|
createVNode(_component_Button, {
|
18792
18816
|
onOperate: $options.setVideo,
|
18793
18817
|
name: "autoplay",
|
@@ -18844,7 +18868,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18844
18868
|
_: 1
|
18845
18869
|
}, 8, ["onOperate", "title", "tooltip", "color"]),
|
18846
18870
|
createVNode(_component_Button, {
|
18847
|
-
onOperate: _cache[
|
18871
|
+
onOperate: _cache[15] || (_cache[15] = ($event) => _ctx.$parent.deleteByParsedom("video")),
|
18848
18872
|
name: "deleteVideo",
|
18849
18873
|
title: $options.$editTrans("deleteVideo"),
|
18850
18874
|
tooltip: $props.config.tooltip,
|
@@ -18857,7 +18881,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18857
18881
|
}, 8, ["title", "tooltip", "color"])
|
18858
18882
|
], 64)) : $props.type == "table" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
18859
18883
|
createVNode(_component_Button, {
|
18860
|
-
onOperate: _cache[
|
18884
|
+
onOperate: _cache[16] || (_cache[16] = ($event) => $options.insertParagraphWithTable("up")),
|
18861
18885
|
name: "textWrapUp",
|
18862
18886
|
title: $options.$editTrans("textWrapUp"),
|
18863
18887
|
tooltip: $props.config.tooltip,
|
@@ -18872,7 +18896,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18872
18896
|
_: 1
|
18873
18897
|
}, 8, ["title", "tooltip", "color"]),
|
18874
18898
|
createVNode(_component_Button, {
|
18875
|
-
onOperate: _cache[
|
18899
|
+
onOperate: _cache[17] || (_cache[17] = ($event) => $options.insertParagraphWithTable("down")),
|
18876
18900
|
rightBorder: "",
|
18877
18901
|
name: "textWrapDown",
|
18878
18902
|
title: $options.$editTrans("textWrapDown"),
|
@@ -18885,7 +18909,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18885
18909
|
_: 1
|
18886
18910
|
}, 8, ["title", "tooltip", "color"]),
|
18887
18911
|
createVNode(_component_Button, {
|
18888
|
-
onOperate: _cache[
|
18912
|
+
onOperate: _cache[18] || (_cache[18] = ($event) => $options.insertTableRow("up")),
|
18889
18913
|
name: "insertRowTop",
|
18890
18914
|
title: $options.$editTrans("insertRowTop"),
|
18891
18915
|
tooltip: $props.config.tooltip,
|
@@ -18897,7 +18921,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18897
18921
|
_: 1
|
18898
18922
|
}, 8, ["title", "tooltip", "color"]),
|
18899
18923
|
createVNode(_component_Button, {
|
18900
|
-
onOperate: _cache[
|
18924
|
+
onOperate: _cache[19] || (_cache[19] = ($event) => $options.insertTableRow("down")),
|
18901
18925
|
name: "insertRowBottom",
|
18902
18926
|
title: $options.$editTrans("insertRowBottom"),
|
18903
18927
|
tooltip: $props.config.tooltip,
|
@@ -18922,7 +18946,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18922
18946
|
_: 1
|
18923
18947
|
}, 8, ["onOperate", "title", "tooltip", "color"]),
|
18924
18948
|
createVNode(_component_Button, {
|
18925
|
-
onOperate: _cache[
|
18949
|
+
onOperate: _cache[20] || (_cache[20] = ($event) => $options.insertTableColumn("left")),
|
18926
18950
|
name: "insertColumnLeft",
|
18927
18951
|
title: $options.$editTrans("insertColumnLeft"),
|
18928
18952
|
tooltip: $props.config.tooltip,
|
@@ -18934,7 +18958,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18934
18958
|
_: 1
|
18935
18959
|
}, 8, ["title", "tooltip", "color"]),
|
18936
18960
|
createVNode(_component_Button, {
|
18937
|
-
onOperate: _cache[
|
18961
|
+
onOperate: _cache[21] || (_cache[21] = ($event) => $options.insertTableColumn("right")),
|
18938
18962
|
name: "insertColumnRight",
|
18939
18963
|
title: $options.$editTrans("insertColumnRight"),
|
18940
18964
|
tooltip: $props.config.tooltip,
|
@@ -18959,7 +18983,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18959
18983
|
_: 1
|
18960
18984
|
}, 8, ["onOperate", "title", "tooltip", "color"]),
|
18961
18985
|
createVNode(_component_Button, {
|
18962
|
-
onOperate: _cache[
|
18986
|
+
onOperate: _cache[22] || (_cache[22] = ($event) => _ctx.$parent.deleteByParsedom("table")),
|
18963
18987
|
name: "deleteTable",
|
18964
18988
|
title: $options.$editTrans("deleteTable"),
|
18965
18989
|
tooltip: $props.config.tooltip,
|
@@ -18973,7 +18997,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18973
18997
|
], 64)) : createCommentVNode("", true),
|
18974
18998
|
$props.type == "codeBlock" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
18975
18999
|
createVNode(_component_Button, {
|
18976
|
-
onOperate: _cache[
|
19000
|
+
onOperate: _cache[23] || (_cache[23] = ($event) => $options.insertParagraphWithPre("up")),
|
18977
19001
|
name: "textWrapUp",
|
18978
19002
|
title: $options.$editTrans("textWrapUp"),
|
18979
19003
|
tooltip: $props.config.tooltip,
|
@@ -18988,7 +19012,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18988
19012
|
_: 1
|
18989
19013
|
}, 8, ["title", "tooltip", "color"]),
|
18990
19014
|
createVNode(_component_Button, {
|
18991
|
-
onOperate: _cache[
|
19015
|
+
onOperate: _cache[24] || (_cache[24] = ($event) => $options.insertParagraphWithPre("down")),
|
18992
19016
|
name: "textWrapDown",
|
18993
19017
|
title: $options.$editTrans("textWrapDown"),
|
18994
19018
|
tooltip: $props.config.tooltip,
|
@@ -19340,7 +19364,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19340
19364
|
_: 1
|
19341
19365
|
}, 8, ["modelValue", "node", "onShow", "useRange"]);
|
19342
19366
|
}
|
19343
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-
|
19367
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-29d60c70"]]);
|
19344
19368
|
const InsertLink_vue_vue_type_style_index_0_scoped_e6c3c2ee_lang = "";
|
19345
19369
|
const _sfc_main$5 = {
|
19346
19370
|
name: "InsertLink",
|
@@ -21207,7 +21231,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21207
21231
|
], 14, _hoisted_1$1);
|
21208
21232
|
}
|
21209
21233
|
const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-85cbaf03"]]);
|
21210
|
-
const
|
21234
|
+
const Editify_vue_vue_type_style_index_0_scoped_6e31db33_lang = "";
|
21211
21235
|
const _sfc_main = {
|
21212
21236
|
name: "editify",
|
21213
21237
|
props: { ...editorProps },
|
@@ -21877,7 +21901,7 @@ const _sfc_main = {
|
|
21877
21901
|
return null;
|
21878
21902
|
},
|
21879
21903
|
//api:删除光标所在的指定标签元素
|
21880
|
-
deleteByParsedom(parsedom) {
|
21904
|
+
deleteByParsedom(parsedom, isRender = true) {
|
21881
21905
|
if (this.disabled) {
|
21882
21906
|
return;
|
21883
21907
|
}
|
@@ -21887,13 +21911,15 @@ const _sfc_main = {
|
|
21887
21911
|
const element2 = this.getCurrentParsedomElement(parsedom);
|
21888
21912
|
if (element2) {
|
21889
21913
|
element2.toEmpty();
|
21890
|
-
|
21891
|
-
|
21892
|
-
|
21914
|
+
if (isRender) {
|
21915
|
+
this.editor.formatElementStack();
|
21916
|
+
this.editor.domRender();
|
21917
|
+
this.editor.rangeRender();
|
21918
|
+
}
|
21893
21919
|
}
|
21894
21920
|
},
|
21895
21921
|
//api:当光标在链接上时可以移除链接
|
21896
|
-
removeLink() {
|
21922
|
+
removeLink(isRender = true) {
|
21897
21923
|
if (this.disabled) {
|
21898
21924
|
return;
|
21899
21925
|
}
|
@@ -21905,13 +21931,15 @@ const _sfc_main = {
|
|
21905
21931
|
link.parsedom = AlexElement.TEXT_NODE;
|
21906
21932
|
delete link.marks.target;
|
21907
21933
|
delete link.marks.href;
|
21908
|
-
|
21909
|
-
|
21910
|
-
|
21934
|
+
if (isRender) {
|
21935
|
+
this.editor.formatElementStack();
|
21936
|
+
this.editor.domRender();
|
21937
|
+
this.editor.rangeRender();
|
21938
|
+
}
|
21911
21939
|
}
|
21912
21940
|
},
|
21913
21941
|
//api:设置标题
|
21914
|
-
setHeading(parsedom) {
|
21942
|
+
setHeading(parsedom, isRender = true) {
|
21915
21943
|
if (this.disabled) {
|
21916
21944
|
return;
|
21917
21945
|
}
|
@@ -21941,12 +21969,14 @@ const _sfc_main = {
|
|
21941
21969
|
}
|
21942
21970
|
});
|
21943
21971
|
}
|
21944
|
-
|
21945
|
-
|
21946
|
-
|
21972
|
+
if (isRender) {
|
21973
|
+
this.editor.formatElementStack();
|
21974
|
+
this.editor.domRender();
|
21975
|
+
this.editor.rangeRender();
|
21976
|
+
}
|
21947
21977
|
},
|
21948
21978
|
//api:插入有序列表 ordered为true表示有序列表
|
21949
|
-
setList(ordered) {
|
21979
|
+
setList(ordered, isRender = true) {
|
21950
21980
|
if (this.disabled) {
|
21951
21981
|
return;
|
21952
21982
|
}
|
@@ -21980,12 +22010,14 @@ const _sfc_main = {
|
|
21980
22010
|
}
|
21981
22011
|
});
|
21982
22012
|
}
|
21983
|
-
|
21984
|
-
|
21985
|
-
|
22013
|
+
if (isRender) {
|
22014
|
+
this.editor.formatElementStack();
|
22015
|
+
this.editor.domRender();
|
22016
|
+
this.editor.rangeRender();
|
22017
|
+
}
|
21986
22018
|
},
|
21987
22019
|
//api:插入任务列表
|
21988
|
-
setTask() {
|
22020
|
+
setTask(isRender = true) {
|
21989
22021
|
if (this.disabled) {
|
21990
22022
|
return;
|
21991
22023
|
}
|
@@ -22019,12 +22051,14 @@ const _sfc_main = {
|
|
22019
22051
|
}
|
22020
22052
|
});
|
22021
22053
|
}
|
22022
|
-
|
22023
|
-
|
22024
|
-
|
22054
|
+
if (isRender) {
|
22055
|
+
this.editor.formatElementStack();
|
22056
|
+
this.editor.domRender();
|
22057
|
+
this.editor.rangeRender();
|
22058
|
+
}
|
22025
22059
|
},
|
22026
22060
|
//api:设置样式
|
22027
|
-
setTextStyle(name, value) {
|
22061
|
+
setTextStyle(name, value, isRender = true) {
|
22028
22062
|
if (this.disabled) {
|
22029
22063
|
return;
|
22030
22064
|
}
|
@@ -22039,16 +22073,18 @@ const _sfc_main = {
|
|
22039
22073
|
styles[name] = value;
|
22040
22074
|
this.editor.setTextStyle(styles);
|
22041
22075
|
}
|
22042
|
-
|
22043
|
-
|
22044
|
-
|
22076
|
+
if (isRender) {
|
22077
|
+
this.editor.formatElementStack();
|
22078
|
+
this.editor.domRender();
|
22079
|
+
this.editor.rangeRender();
|
22080
|
+
}
|
22045
22081
|
},
|
22046
22082
|
//api:查询是否具有某个样式
|
22047
22083
|
queryTextStyle(name, value, useCache) {
|
22048
22084
|
return this.editor.queryTextStyle(name, value, useCache);
|
22049
22085
|
},
|
22050
22086
|
//api:设置标记
|
22051
|
-
setTextMark(name, value) {
|
22087
|
+
setTextMark(name, value, isRender = true) {
|
22052
22088
|
if (this.disabled) {
|
22053
22089
|
return;
|
22054
22090
|
}
|
@@ -22063,16 +22099,18 @@ const _sfc_main = {
|
|
22063
22099
|
marks[name] = value;
|
22064
22100
|
this.editor.setTextMark(marks);
|
22065
22101
|
}
|
22066
|
-
|
22067
|
-
|
22068
|
-
|
22102
|
+
if (isRender) {
|
22103
|
+
this.editor.formatElementStack();
|
22104
|
+
this.editor.domRender();
|
22105
|
+
this.editor.rangeRender();
|
22106
|
+
}
|
22069
22107
|
},
|
22070
22108
|
//api:查询是否具有某个标记
|
22071
22109
|
queryTextMark(name, value, useCache) {
|
22072
22110
|
return this.editor.queryTextMark(name, value, useCache);
|
22073
22111
|
},
|
22074
22112
|
//api:清除文本样式和标记
|
22075
|
-
formatText() {
|
22113
|
+
formatText(isRender = true) {
|
22076
22114
|
if (this.disabled) {
|
22077
22115
|
return;
|
22078
22116
|
}
|
@@ -22081,12 +22119,14 @@ const _sfc_main = {
|
|
22081
22119
|
}
|
22082
22120
|
this.editor.removeTextStyle();
|
22083
22121
|
this.editor.removeTextMark();
|
22084
|
-
|
22085
|
-
|
22086
|
-
|
22122
|
+
if (isRender) {
|
22123
|
+
this.editor.formatElementStack();
|
22124
|
+
this.editor.domRender();
|
22125
|
+
this.editor.rangeRender();
|
22126
|
+
}
|
22087
22127
|
},
|
22088
22128
|
//api:设置对齐方式,参数取值justify/left/right/center
|
22089
|
-
setAlign(value) {
|
22129
|
+
setAlign(value, isRender = true) {
|
22090
22130
|
if (this.disabled) {
|
22091
22131
|
return;
|
22092
22132
|
}
|
@@ -22147,9 +22187,11 @@ const _sfc_main = {
|
|
22147
22187
|
}
|
22148
22188
|
});
|
22149
22189
|
}
|
22150
|
-
|
22151
|
-
|
22152
|
-
|
22190
|
+
if (isRender) {
|
22191
|
+
this.editor.formatElementStack();
|
22192
|
+
this.editor.domRender();
|
22193
|
+
this.editor.rangeRender();
|
22194
|
+
}
|
22153
22195
|
},
|
22154
22196
|
//api:撤销
|
22155
22197
|
undo() {
|
@@ -22182,7 +22224,7 @@ const _sfc_main = {
|
|
22182
22224
|
}
|
22183
22225
|
},
|
22184
22226
|
//api:插入引用
|
22185
|
-
setQuote() {
|
22227
|
+
setQuote(isRender = true) {
|
22186
22228
|
if (this.disabled) {
|
22187
22229
|
return;
|
22188
22230
|
}
|
@@ -22214,12 +22256,14 @@ const _sfc_main = {
|
|
22214
22256
|
}
|
22215
22257
|
});
|
22216
22258
|
}
|
22217
|
-
|
22218
|
-
|
22219
|
-
|
22259
|
+
if (isRender) {
|
22260
|
+
this.editor.formatElementStack();
|
22261
|
+
this.editor.domRender();
|
22262
|
+
this.editor.rangeRender();
|
22263
|
+
}
|
22220
22264
|
},
|
22221
22265
|
//api:设置行高
|
22222
|
-
setLineHeight(value) {
|
22266
|
+
setLineHeight(value, isRender = true) {
|
22223
22267
|
if (this.disabled) {
|
22224
22268
|
return;
|
22225
22269
|
}
|
@@ -22280,12 +22324,14 @@ const _sfc_main = {
|
|
22280
22324
|
}
|
22281
22325
|
});
|
22282
22326
|
}
|
22283
|
-
|
22284
|
-
|
22285
|
-
|
22327
|
+
if (isRender) {
|
22328
|
+
this.editor.formatElementStack();
|
22329
|
+
this.editor.domRender();
|
22330
|
+
this.editor.rangeRender();
|
22331
|
+
}
|
22286
22332
|
},
|
22287
22333
|
//api:增加缩进
|
22288
|
-
setIndentIncrease() {
|
22334
|
+
setIndentIncrease(isRender = true) {
|
22289
22335
|
if (this.disabled) {
|
22290
22336
|
return;
|
22291
22337
|
}
|
@@ -22331,12 +22377,14 @@ const _sfc_main = {
|
|
22331
22377
|
}
|
22332
22378
|
});
|
22333
22379
|
}
|
22334
|
-
|
22335
|
-
|
22336
|
-
|
22380
|
+
if (isRender) {
|
22381
|
+
this.editor.formatElementStack();
|
22382
|
+
this.editor.domRender();
|
22383
|
+
this.editor.rangeRender();
|
22384
|
+
}
|
22337
22385
|
},
|
22338
22386
|
//api:减少缩进
|
22339
|
-
setIndentDecrease() {
|
22387
|
+
setIndentDecrease(isRender = true) {
|
22340
22388
|
if (this.disabled) {
|
22341
22389
|
return;
|
22342
22390
|
}
|
@@ -22374,9 +22422,11 @@ const _sfc_main = {
|
|
22374
22422
|
}
|
22375
22423
|
});
|
22376
22424
|
}
|
22377
|
-
|
22378
|
-
|
22379
|
-
|
22425
|
+
if (isRender) {
|
22426
|
+
this.editor.formatElementStack();
|
22427
|
+
this.editor.domRender();
|
22428
|
+
this.editor.rangeRender();
|
22429
|
+
}
|
22380
22430
|
},
|
22381
22431
|
//api:插入图片
|
22382
22432
|
insertImage(url2, isRender = true) {
|
@@ -22542,7 +22592,7 @@ const _sfc_main = {
|
|
22542
22592
|
}
|
22543
22593
|
});
|
22544
22594
|
},
|
22545
|
-
|
22595
|
+
//api:选区是否含有图片
|
22546
22596
|
hasImage() {
|
22547
22597
|
if (!this.editor.range) {
|
22548
22598
|
return false;
|
@@ -22555,7 +22605,7 @@ const _sfc_main = {
|
|
22555
22605
|
return item.element.isClosed() && item.element.parsedom == "img";
|
22556
22606
|
});
|
22557
22607
|
},
|
22558
|
-
|
22608
|
+
//api:选区是否含有视频
|
22559
22609
|
hasVideo() {
|
22560
22610
|
if (!this.editor.range) {
|
22561
22611
|
return false;
|
@@ -22626,7 +22676,7 @@ const _sfc_main = {
|
|
22626
22676
|
});
|
22627
22677
|
},
|
22628
22678
|
//api:创建一个空的表格
|
22629
|
-
insertTable(rowLength, colLength) {
|
22679
|
+
insertTable(rowLength, colLength, isRender = true) {
|
22630
22680
|
if (this.disabled) {
|
22631
22681
|
return;
|
22632
22682
|
}
|
@@ -22651,14 +22701,16 @@ const _sfc_main = {
|
|
22651
22701
|
const breakEl = new AlexElement("closed", "br", null, null, null);
|
22652
22702
|
this.editor.addElementTo(breakEl, paragraph);
|
22653
22703
|
this.editor.addElementAfter(paragraph, table);
|
22654
|
-
this.editor.formatElementStack();
|
22655
22704
|
this.editor.range.anchor.moveToStart(tbody);
|
22656
22705
|
this.editor.range.focus.moveToStart(tbody);
|
22657
|
-
|
22658
|
-
|
22706
|
+
if (isRender) {
|
22707
|
+
this.editor.formatElementStack();
|
22708
|
+
this.editor.domRender();
|
22709
|
+
this.editor.rangeRender();
|
22710
|
+
}
|
22659
22711
|
},
|
22660
22712
|
//api:插入代码块
|
22661
|
-
insertCodeBlock() {
|
22713
|
+
insertCodeBlock(isRender = true) {
|
22662
22714
|
if (this.disabled) {
|
22663
22715
|
return;
|
22664
22716
|
}
|
@@ -22729,12 +22781,14 @@ const _sfc_main = {
|
|
22729
22781
|
this.editor.addElementAfter(paragraph, pre2);
|
22730
22782
|
}
|
22731
22783
|
}
|
22732
|
-
|
22733
|
-
|
22734
|
-
|
22784
|
+
if (isRender) {
|
22785
|
+
this.editor.formatElementStack();
|
22786
|
+
this.editor.domRender();
|
22787
|
+
this.editor.rangeRender();
|
22788
|
+
}
|
22735
22789
|
},
|
22736
22790
|
//api:插入文本
|
22737
|
-
insertText(text2) {
|
22791
|
+
insertText(text2, isRender = true) {
|
22738
22792
|
if (this.disabled) {
|
22739
22793
|
return;
|
22740
22794
|
}
|
@@ -22742,12 +22796,14 @@ const _sfc_main = {
|
|
22742
22796
|
return;
|
22743
22797
|
}
|
22744
22798
|
this.editor.insertText(text2);
|
22745
|
-
|
22746
|
-
|
22747
|
-
|
22799
|
+
if (isRender) {
|
22800
|
+
this.editor.formatElementStack();
|
22801
|
+
this.editor.domRender();
|
22802
|
+
this.editor.rangeRender();
|
22803
|
+
}
|
22748
22804
|
},
|
22749
22805
|
//api:插入html
|
22750
|
-
insertHtml(html) {
|
22806
|
+
insertHtml(html, isRender = true) {
|
22751
22807
|
if (this.disabled) {
|
22752
22808
|
return;
|
22753
22809
|
}
|
@@ -22758,9 +22814,11 @@ const _sfc_main = {
|
|
22758
22814
|
for (let i = 0; i < elements.length; i++) {
|
22759
22815
|
this.editor.insertElement(elements[i], false);
|
22760
22816
|
}
|
22761
|
-
|
22762
|
-
|
22763
|
-
|
22817
|
+
if (isRender) {
|
22818
|
+
this.editor.formatElementStack();
|
22819
|
+
this.editor.domRender();
|
22820
|
+
this.editor.rangeRender();
|
22821
|
+
}
|
22764
22822
|
}
|
22765
22823
|
},
|
22766
22824
|
beforeUnmount() {
|
@@ -22825,7 +22883,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
22825
22883
|
])) : createCommentVNode("", true)
|
22826
22884
|
]);
|
22827
22885
|
}
|
22828
|
-
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
22886
|
+
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6e31db33"]]);
|
22829
22887
|
const iconfont = "";
|
22830
22888
|
const en_US = {
|
22831
22889
|
textWrapUp: "Up feed",
|
@@ -22909,7 +22967,8 @@ const en_US = {
|
|
22909
22967
|
alignCenter: "Align center",
|
22910
22968
|
alignRight: "Align right",
|
22911
22969
|
alignJustify: "Align justify",
|
22912
|
-
defaultLineHeight: "Default"
|
22970
|
+
defaultLineHeight: "Default",
|
22971
|
+
widthAuto: "auto"
|
22913
22972
|
};
|
22914
22973
|
const zh_CN = {
|
22915
22974
|
textWrapUp: "向上换行",
|
@@ -22993,7 +23052,8 @@ const zh_CN = {
|
|
22993
23052
|
alignCenter: "居中对齐",
|
22994
23053
|
alignRight: "右对齐",
|
22995
23054
|
alignJustify: "两端对齐",
|
22996
|
-
defaultLineHeight: "默认行高"
|
23055
|
+
defaultLineHeight: "默认行高",
|
23056
|
+
widthAuto: "宽度自适应"
|
22997
23057
|
};
|
22998
23058
|
const translations = {
|
22999
23059
|
zh_CN,
|
@@ -23004,7 +23064,7 @@ const i18n = (locale) => {
|
|
23004
23064
|
return translations[locale][key];
|
23005
23065
|
};
|
23006
23066
|
};
|
23007
|
-
const version = "0.0.
|
23067
|
+
const version = "0.0.42";
|
23008
23068
|
const install = (app, props) => {
|
23009
23069
|
const locale = (props ? props.locale : "zh_CN") || "zh_CN";
|
23010
23070
|
app.provide("$editTrans", i18n(locale));
|
@@ -23018,6 +23078,6 @@ const stdin_default = {
|
|
23018
23078
|
export {
|
23019
23079
|
AlexElement,
|
23020
23080
|
stdin_default as default,
|
23021
|
-
install,
|
23081
|
+
install as editify,
|
23022
23082
|
version
|
23023
23083
|
};
|