vue-editify 0.0.20 → 0.0.21
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 +6 -3
- package/lib/editify.es.js +111 -47
- package/lib/editify.umd.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +2 -2
- package/src/Editify.vue +12 -8
- package/src/components/bussiness/InsertTable.vue +31 -0
- package/src/components/bussiness/Menu.vue +1 -5
- package/src/components/bussiness/Toolbar.vue +0 -1
- package/src/core/index.js +10 -10
- package/src/hljs/index.js +3 -1
- package/src/index.js +1 -1
package/examples/App.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div style="padding: 100px 50px 50px 50px">
|
|
3
|
-
<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
|
-
|
|
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
|
@@ -3296,7 +3296,7 @@ class AlexEditor {
|
|
|
3296
3296
|
const data2 = await blob.text();
|
|
3297
3297
|
if (data2) {
|
|
3298
3298
|
if (typeof this.customTextPaste == "function") {
|
|
3299
|
-
this.customTextPaste.apply(this, [data2]);
|
|
3299
|
+
await this.customTextPaste.apply(this, [data2]);
|
|
3300
3300
|
} else {
|
|
3301
3301
|
this.insertText(data2);
|
|
3302
3302
|
this.emit("pasteText", data2);
|
|
@@ -3309,7 +3309,7 @@ class AlexEditor {
|
|
|
3309
3309
|
return !el.isEmpty();
|
|
3310
3310
|
});
|
|
3311
3311
|
if (typeof this.customHtmlPaste == "function") {
|
|
3312
|
-
this.customHtmlPaste.apply(this, [elements, data2]);
|
|
3312
|
+
await this.customHtmlPaste.apply(this, [elements, data2]);
|
|
3313
3313
|
} else {
|
|
3314
3314
|
for (let i2 = 0; i2 < elements.length; i2++) {
|
|
3315
3315
|
this.formatElement(elements[i2]);
|
|
@@ -3326,7 +3326,7 @@ class AlexEditor {
|
|
|
3326
3326
|
if (blob.type.startsWith("image/")) {
|
|
3327
3327
|
const url2 = await blobToBase64(blob);
|
|
3328
3328
|
if (typeof this.customImagePaste == "function") {
|
|
3329
|
-
this.customImagePaste.apply(this, [url2]);
|
|
3329
|
+
await this.customImagePaste.apply(this, [url2]);
|
|
3330
3330
|
} else {
|
|
3331
3331
|
const image = new AlexElement(
|
|
3332
3332
|
"closed",
|
|
@@ -3343,7 +3343,7 @@ class AlexEditor {
|
|
|
3343
3343
|
} else if (blob.type.startsWith("video/")) {
|
|
3344
3344
|
const url2 = await blobToBase64(blob);
|
|
3345
3345
|
if (typeof this.customVideoPaste == "function") {
|
|
3346
|
-
this.customVideoPaste.apply(this, [url2]);
|
|
3346
|
+
await this.customVideoPaste.apply(this, [url2]);
|
|
3347
3347
|
} else {
|
|
3348
3348
|
const video = new AlexElement(
|
|
3349
3349
|
"closed",
|
|
@@ -3361,7 +3361,7 @@ class AlexEditor {
|
|
|
3361
3361
|
const data2 = await blob.text();
|
|
3362
3362
|
if (data2) {
|
|
3363
3363
|
if (typeof this.customTextPaste == "function") {
|
|
3364
|
-
this.customTextPaste.apply(this, [data2]);
|
|
3364
|
+
await this.customTextPaste.apply(this, [data2]);
|
|
3365
3365
|
} else {
|
|
3366
3366
|
this.insertText(data2);
|
|
3367
3367
|
this.emit("pasteText", data2);
|
|
@@ -8282,6 +8282,43 @@ function plaintext(hljs2) {
|
|
|
8282
8282
|
disableAutodetect: true
|
|
8283
8283
|
};
|
|
8284
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
|
+
}
|
|
8285
8322
|
const IDENT_RE$1 = "[A-Za-z$_][0-9A-Za-z$_]*";
|
|
8286
8323
|
const KEYWORDS$1 = [
|
|
8287
8324
|
"as",
|
|
@@ -15168,6 +15205,7 @@ function python(hljs2) {
|
|
|
15168
15205
|
}
|
|
15169
15206
|
const hljs = "";
|
|
15170
15207
|
HighlightJS.registerLanguage("plaintext", plaintext);
|
|
15208
|
+
HighlightJS.registerLanguage("json", json);
|
|
15171
15209
|
HighlightJS.registerLanguage("javascript", javascript$1);
|
|
15172
15210
|
HighlightJS.registerLanguage("java", java);
|
|
15173
15211
|
HighlightJS.registerLanguage("typescript", typescript);
|
|
@@ -15196,7 +15234,7 @@ const getHljsHtml = function(code, language) {
|
|
|
15196
15234
|
}
|
|
15197
15235
|
return HighlightJS.highlightAuto(code).value;
|
|
15198
15236
|
};
|
|
15199
|
-
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"];
|
|
15200
15238
|
const pasteKeepData = {
|
|
15201
15239
|
//粘贴html时元素保留的样式(全部元素)
|
|
15202
15240
|
marks: {
|
|
@@ -15581,7 +15619,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
|
|
|
15581
15619
|
label: editTrans("h1"),
|
|
15582
15620
|
value: "h1",
|
|
15583
15621
|
style: {
|
|
15584
|
-
fontSize: "
|
|
15622
|
+
fontSize: "26px",
|
|
15585
15623
|
fontWeight: "bold"
|
|
15586
15624
|
}
|
|
15587
15625
|
},
|
|
@@ -15589,7 +15627,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
|
|
|
15589
15627
|
label: editTrans("h2"),
|
|
15590
15628
|
value: "h2",
|
|
15591
15629
|
style: {
|
|
15592
|
-
fontSize: "
|
|
15630
|
+
fontSize: "24px",
|
|
15593
15631
|
fontWeight: "bold"
|
|
15594
15632
|
}
|
|
15595
15633
|
},
|
|
@@ -15597,7 +15635,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
|
|
|
15597
15635
|
label: editTrans("h3"),
|
|
15598
15636
|
value: "h3",
|
|
15599
15637
|
style: {
|
|
15600
|
-
fontSize: "
|
|
15638
|
+
fontSize: "22px",
|
|
15601
15639
|
fontWeight: "bold"
|
|
15602
15640
|
}
|
|
15603
15641
|
},
|
|
@@ -15605,7 +15643,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
|
|
|
15605
15643
|
label: editTrans("h4"),
|
|
15606
15644
|
value: "h4",
|
|
15607
15645
|
style: {
|
|
15608
|
-
fontSize: "
|
|
15646
|
+
fontSize: "20px",
|
|
15609
15647
|
fontWeight: "bold"
|
|
15610
15648
|
}
|
|
15611
15649
|
},
|
|
@@ -15613,7 +15651,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
|
|
|
15613
15651
|
label: editTrans("h5"),
|
|
15614
15652
|
value: "h5",
|
|
15615
15653
|
style: {
|
|
15616
|
-
fontSize: "
|
|
15654
|
+
fontSize: "18px",
|
|
15617
15655
|
fontWeight: "bold"
|
|
15618
15656
|
}
|
|
15619
15657
|
},
|
|
@@ -15621,7 +15659,7 @@ const getButtonOptionsConfig = function(editTrans, editLocale) {
|
|
|
15621
15659
|
label: editTrans("h6"),
|
|
15622
15660
|
value: "h6",
|
|
15623
15661
|
style: {
|
|
15624
|
-
fontSize: "
|
|
15662
|
+
fontSize: "16px",
|
|
15625
15663
|
fontWeight: "bold"
|
|
15626
15664
|
}
|
|
15627
15665
|
}
|
|
@@ -15806,7 +15844,7 @@ const getToolbarConfig = function(editTrans, editLocale) {
|
|
|
15806
15844
|
//按钮默认显示的值
|
|
15807
15845
|
defaultValue: "p",
|
|
15808
15846
|
//浮层宽度
|
|
15809
|
-
width: editLocale == "en_US" ?
|
|
15847
|
+
width: editLocale == "en_US" ? 150 : 130,
|
|
15810
15848
|
//浮层最大高度
|
|
15811
15849
|
maxHeight: "",
|
|
15812
15850
|
//左侧边框是否显示
|
|
@@ -16012,7 +16050,7 @@ const getMenuConfig = function(editTrans, editLocale) {
|
|
|
16012
16050
|
use: true,
|
|
16013
16051
|
//是否使用工具提示
|
|
16014
16052
|
tooltip: true,
|
|
16015
|
-
//菜单栏显示模式,支持default/inner/fixed
|
|
16053
|
+
//菜单栏显示模式,支持default/inner/fixed
|
|
16016
16054
|
mode: "default",
|
|
16017
16055
|
//添加额外的按钮禁用判定,回调参数为name,this指向组件实例
|
|
16018
16056
|
extraDisabled: null,
|
|
@@ -16076,7 +16114,7 @@ const getMenuConfig = function(editTrans, editLocale) {
|
|
|
16076
16114
|
//按钮默认显示的值
|
|
16077
16115
|
defaultValue: "p",
|
|
16078
16116
|
//浮层宽度
|
|
16079
|
-
width: editLocale == "en_US" ?
|
|
16117
|
+
width: editLocale == "en_US" ? 150 : 130,
|
|
16080
16118
|
//浮层最大高度
|
|
16081
16119
|
maxHeight: "",
|
|
16082
16120
|
//左侧边框是否显示
|
|
@@ -16333,7 +16371,7 @@ const getMenuConfig = function(editTrans, editLocale) {
|
|
|
16333
16371
|
leftBorder: false,
|
|
16334
16372
|
//右侧边框是否显示
|
|
16335
16373
|
rightBorder: false,
|
|
16336
|
-
|
|
16374
|
+
//视频支持上传的类型,不区分大小写
|
|
16337
16375
|
accept: ["mp4", "avi", "mpg", "wmv", "mov", "rm", "swf", "flv"],
|
|
16338
16376
|
//是否多选视频
|
|
16339
16377
|
multiple: false,
|
|
@@ -17474,7 +17512,7 @@ const _hoisted_4$6 = {
|
|
|
17474
17512
|
key: 1,
|
|
17475
17513
|
class: "editify-button-options"
|
|
17476
17514
|
};
|
|
17477
|
-
const _hoisted_5$
|
|
17515
|
+
const _hoisted_5$6 = ["onClick"];
|
|
17478
17516
|
const _hoisted_6$5 = {
|
|
17479
17517
|
key: 1,
|
|
17480
17518
|
class: "editify-button-option-flex"
|
|
@@ -17553,7 +17591,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
17553
17591
|
}, null, 8, ["value"])) : createCommentVNode("", true),
|
|
17554
17592
|
createElementVNode("span", null, toDisplayString(item.label), 1)
|
|
17555
17593
|
]))
|
|
17556
|
-
], 14, _hoisted_5$
|
|
17594
|
+
], 14, _hoisted_5$6);
|
|
17557
17595
|
}), 256))
|
|
17558
17596
|
]))
|
|
17559
17597
|
], 4)
|
|
@@ -17777,7 +17815,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
17777
17815
|
]);
|
|
17778
17816
|
}
|
|
17779
17817
|
const Colors = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-dc6d3d68"]]);
|
|
17780
|
-
const
|
|
17818
|
+
const Toolbar_vue_vue_type_style_index_0_scoped_6b9cdbc6_lang = "";
|
|
17781
17819
|
const _sfc_main$6 = {
|
|
17782
17820
|
name: "Toolbar",
|
|
17783
17821
|
emits: ["update:modelValue"],
|
|
@@ -18547,7 +18585,7 @@ const _hoisted_1$6 = {
|
|
|
18547
18585
|
const _hoisted_2$5 = { class: "editify-toolbar-link-label" };
|
|
18548
18586
|
const _hoisted_3$5 = ["placeholder"];
|
|
18549
18587
|
const _hoisted_4$5 = { class: "editify-toolbar-link-footer" };
|
|
18550
|
-
const _hoisted_5$
|
|
18588
|
+
const _hoisted_5$5 = { class: "editify-toolbar-link-operations" };
|
|
18551
18589
|
const _hoisted_6$4 = ["href"];
|
|
18552
18590
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18553
18591
|
const _component_Checkbox = resolveComponent("Checkbox");
|
|
@@ -18597,7 +18635,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
18597
18635
|
color: _ctx.$parent.color,
|
|
18598
18636
|
size: 10
|
|
18599
18637
|
}, null, 8, ["onChange", "modelValue", "label", "color"]),
|
|
18600
|
-
createElementVNode("div", _hoisted_5$
|
|
18638
|
+
createElementVNode("div", _hoisted_5$5, [
|
|
18601
18639
|
createElementVNode("span", {
|
|
18602
18640
|
onClick: _cache[5] || (_cache[5] = (...args) => _ctx.$parent.removeLink && _ctx.$parent.removeLink(...args))
|
|
18603
18641
|
}, toDisplayString($options.$editTrans("removeLink")), 1),
|
|
@@ -19248,7 +19286,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19248
19286
|
_: 1
|
|
19249
19287
|
}, 8, ["modelValue", "node", "onShow", "useRange"]);
|
|
19250
19288
|
}
|
|
19251
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-
|
|
19289
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-6b9cdbc6"]]);
|
|
19252
19290
|
const InsertLink_vue_vue_type_style_index_0_scoped_e6c3c2ee_lang = "";
|
|
19253
19291
|
const _sfc_main$5 = {
|
|
19254
19292
|
name: "InsertLink",
|
|
@@ -19308,7 +19346,7 @@ const _hoisted_1$5 = { class: "editify-link" };
|
|
|
19308
19346
|
const _hoisted_2$4 = { class: "editify-link-label" };
|
|
19309
19347
|
const _hoisted_3$4 = ["placeholder"];
|
|
19310
19348
|
const _hoisted_4$4 = ["placeholder"];
|
|
19311
|
-
const _hoisted_5$
|
|
19349
|
+
const _hoisted_5$4 = { class: "editify-link-footer" };
|
|
19312
19350
|
const _hoisted_6$3 = { class: "editify-link-operations" };
|
|
19313
19351
|
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19314
19352
|
const _component_Checkbox = resolveComponent("Checkbox");
|
|
@@ -19342,7 +19380,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19342
19380
|
{ trim: true }
|
|
19343
19381
|
]
|
|
19344
19382
|
]),
|
|
19345
|
-
createElementVNode("div", _hoisted_5$
|
|
19383
|
+
createElementVNode("div", _hoisted_5$4, [
|
|
19346
19384
|
createVNode(_component_Checkbox, {
|
|
19347
19385
|
modelValue: $data.newOpen,
|
|
19348
19386
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.newOpen = $event),
|
|
@@ -19513,7 +19551,7 @@ const _hoisted_3$3 = {
|
|
|
19513
19551
|
class: "editify-image-remote"
|
|
19514
19552
|
};
|
|
19515
19553
|
const _hoisted_4$3 = ["placeholder"];
|
|
19516
|
-
const _hoisted_5$
|
|
19554
|
+
const _hoisted_5$3 = {
|
|
19517
19555
|
key: 1,
|
|
19518
19556
|
class: "editify-image-upload"
|
|
19519
19557
|
};
|
|
@@ -19559,7 +19597,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19559
19597
|
onClick: _cache[5] || (_cache[5] = (...args) => $options.insertRemoteImage && $options.insertRemoteImage(...args))
|
|
19560
19598
|
}, toDisplayString($options.$editTrans("insert")), 1)
|
|
19561
19599
|
], 4)
|
|
19562
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_5$
|
|
19600
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_5$3, [
|
|
19563
19601
|
createVNode(_component_Icon, { value: "upload" }),
|
|
19564
19602
|
createElementVNode("input", {
|
|
19565
19603
|
multiple: $props.multiple,
|
|
@@ -19724,7 +19762,7 @@ const _hoisted_3$2 = {
|
|
|
19724
19762
|
class: "editify-video-remote"
|
|
19725
19763
|
};
|
|
19726
19764
|
const _hoisted_4$2 = ["placeholder"];
|
|
19727
|
-
const _hoisted_5$
|
|
19765
|
+
const _hoisted_5$2 = {
|
|
19728
19766
|
key: 1,
|
|
19729
19767
|
class: "editify-video-upload"
|
|
19730
19768
|
};
|
|
@@ -19770,7 +19808,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19770
19808
|
onClick: _cache[5] || (_cache[5] = (...args) => $options.insertRemoteVideo && $options.insertRemoteVideo(...args))
|
|
19771
19809
|
}, toDisplayString($options.$editTrans("insert")), 1)
|
|
19772
19810
|
], 4)
|
|
19773
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_5$
|
|
19811
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
|
|
19774
19812
|
createVNode(_component_Icon, { value: "upload" }),
|
|
19775
19813
|
createElementVNode("input", {
|
|
19776
19814
|
multiple: $props.multiple,
|
|
@@ -19782,7 +19820,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19782
19820
|
]);
|
|
19783
19821
|
}
|
|
19784
19822
|
const InsertVideo = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-cbc84525"]]);
|
|
19785
|
-
const
|
|
19823
|
+
const InsertTable_vue_vue_type_style_index_0_scoped_8b802b11_lang = "";
|
|
19786
19824
|
const _sfc_main$2 = {
|
|
19787
19825
|
name: "InsertTable",
|
|
19788
19826
|
emits: ["insert"],
|
|
@@ -19808,6 +19846,25 @@ const _sfc_main$2 = {
|
|
|
19808
19846
|
tableGrids: this.getTableGrids()
|
|
19809
19847
|
};
|
|
19810
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
|
+
},
|
|
19811
19868
|
methods: {
|
|
19812
19869
|
//确认创立表格
|
|
19813
19870
|
createTable(data2) {
|
|
@@ -19845,13 +19902,17 @@ const _sfc_main$2 = {
|
|
|
19845
19902
|
}
|
|
19846
19903
|
}
|
|
19847
19904
|
};
|
|
19848
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
19905
|
+
const _withScopeId = (n) => (pushScopeId("data-v-8b802b11"), n = n(), popScopeId(), n);
|
|
19849
19906
|
const _hoisted_1$2 = { class: "editify-table" };
|
|
19850
19907
|
const _hoisted_2$1 = ["onMouseenter", "onClick"];
|
|
19851
19908
|
const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, null, -1));
|
|
19852
19909
|
const _hoisted_4$1 = [
|
|
19853
19910
|
_hoisted_3$1
|
|
19854
19911
|
];
|
|
19912
|
+
const _hoisted_5$1 = {
|
|
19913
|
+
key: 0,
|
|
19914
|
+
class: "editify-table-footer"
|
|
19915
|
+
};
|
|
19855
19916
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19856
19917
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
19857
19918
|
createElementVNode("table", null, [
|
|
@@ -19866,11 +19927,12 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19866
19927
|
}), 256))
|
|
19867
19928
|
]);
|
|
19868
19929
|
}), 256))
|
|
19869
|
-
])
|
|
19930
|
+
]),
|
|
19931
|
+
$options.specification ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString($options.specification.x) + " x " + toDisplayString($options.specification.y), 1)) : createCommentVNode("", true)
|
|
19870
19932
|
]);
|
|
19871
19933
|
}
|
|
19872
|
-
const InsertTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
|
19873
|
-
const
|
|
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 = "";
|
|
19874
19936
|
const _sfc_main$1 = {
|
|
19875
19937
|
name: "Menu",
|
|
19876
19938
|
props: {
|
|
@@ -20941,8 +21003,6 @@ const _sfc_main$1 = {
|
|
|
20941
21003
|
if (!this.$parent.isSourceView) {
|
|
20942
21004
|
this.$parent.editor.rangeRender();
|
|
20943
21005
|
}
|
|
20944
|
-
} else {
|
|
20945
|
-
this.$parent.$emit("menu-operate", name, val);
|
|
20946
21006
|
}
|
|
20947
21007
|
},
|
|
20948
21008
|
//处理光标更新
|
|
@@ -21090,8 +21150,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
21090
21150
|
}), 256))
|
|
21091
21151
|
], 14, _hoisted_1$1);
|
|
21092
21152
|
}
|
|
21093
|
-
const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
|
|
21094
|
-
const
|
|
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 = "";
|
|
21095
21155
|
const _sfc_main = {
|
|
21096
21156
|
name: "editify",
|
|
21097
21157
|
props: { ...editorProps },
|
|
@@ -22242,7 +22302,7 @@ const _sfc_main = {
|
|
|
22242
22302
|
this.editor.rangeRender();
|
|
22243
22303
|
},
|
|
22244
22304
|
//api:插入图片
|
|
22245
|
-
insertImage(url2) {
|
|
22305
|
+
insertImage(url2, isRender = true) {
|
|
22246
22306
|
if (this.disabled) {
|
|
22247
22307
|
return;
|
|
22248
22308
|
}
|
|
@@ -22262,12 +22322,14 @@ const _sfc_main = {
|
|
|
22262
22322
|
null
|
|
22263
22323
|
);
|
|
22264
22324
|
this.editor.insertElement(image);
|
|
22265
|
-
|
|
22266
|
-
|
|
22267
|
-
|
|
22325
|
+
if (isRender) {
|
|
22326
|
+
this.editor.formatElementStack();
|
|
22327
|
+
this.editor.domRender();
|
|
22328
|
+
this.editor.rangeRender();
|
|
22329
|
+
}
|
|
22268
22330
|
},
|
|
22269
22331
|
//api:插入视频
|
|
22270
|
-
insertVideo(url2) {
|
|
22332
|
+
insertVideo(url2, isRender = true) {
|
|
22271
22333
|
if (this.disabled) {
|
|
22272
22334
|
return;
|
|
22273
22335
|
}
|
|
@@ -22293,9 +22355,11 @@ const _sfc_main = {
|
|
|
22293
22355
|
this.editor.addElementBefore(leftSpace, video);
|
|
22294
22356
|
this.editor.range.anchor.moveToEnd(rightSpace);
|
|
22295
22357
|
this.editor.range.focus.moveToEnd(rightSpace);
|
|
22296
|
-
|
|
22297
|
-
|
|
22298
|
-
|
|
22358
|
+
if (isRender) {
|
|
22359
|
+
this.editor.formatElementStack();
|
|
22360
|
+
this.editor.domRender();
|
|
22361
|
+
this.editor.rangeRender();
|
|
22362
|
+
}
|
|
22299
22363
|
},
|
|
22300
22364
|
//api:选区是否含有代码块样式
|
|
22301
22365
|
hasPreStyle() {
|
|
@@ -22684,7 +22748,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
22684
22748
|
])) : createCommentVNode("", true)
|
|
22685
22749
|
]);
|
|
22686
22750
|
}
|
|
22687
|
-
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
22751
|
+
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9c5b94e"]]);
|
|
22688
22752
|
const iconfont = "";
|
|
22689
22753
|
const en_US = {
|
|
22690
22754
|
textWrapUp: "Up feed",
|
|
@@ -22863,7 +22927,7 @@ const i18n = (locale) => {
|
|
|
22863
22927
|
return translations[locale][key];
|
|
22864
22928
|
};
|
|
22865
22929
|
};
|
|
22866
|
-
const version = "0.0.
|
|
22930
|
+
const version = "0.0.21";
|
|
22867
22931
|
const install = (app, props) => {
|
|
22868
22932
|
const locale = (props ? props.locale : "zh_CN") || "zh_CN";
|
|
22869
22933
|
app.provide("$editTrans", i18n(locale));
|