vue-editify 0.0.20 → 0.0.22
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 +122 -56
- 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 +45 -1
- 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,8 +17512,8 @@ const _hoisted_4$6 = {
|
|
17474
17512
|
key: 1,
|
17475
17513
|
class: "editify-button-options"
|
17476
17514
|
};
|
17477
|
-
const _hoisted_5$
|
17478
|
-
const _hoisted_6$
|
17515
|
+
const _hoisted_5$6 = ["onClick"];
|
17516
|
+
const _hoisted_6$6 = {
|
17479
17517
|
key: 1,
|
17480
17518
|
class: "editify-button-option-flex"
|
17481
17519
|
};
|
@@ -17546,14 +17584,14 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17546
17584
|
_ctx.$slots.option ? renderSlot(_ctx.$slots, "option", {
|
17547
17585
|
key: 0,
|
17548
17586
|
item
|
17549
|
-
}, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_6$
|
17587
|
+
}, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_6$6, [
|
17550
17588
|
item.icon ? (openBlock(), createBlock(_component_Icon, {
|
17551
17589
|
key: 0,
|
17552
17590
|
value: item.icon
|
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,8 +18585,8 @@ 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$
|
18551
|
-
const _hoisted_6$
|
18588
|
+
const _hoisted_5$5 = { class: "editify-toolbar-link-operations" };
|
18589
|
+
const _hoisted_6$5 = ["href"];
|
18552
18590
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
18553
18591
|
const _component_Checkbox = resolveComponent("Checkbox");
|
18554
18592
|
const _component_Button = resolveComponent("Button");
|
@@ -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),
|
@@ -18605,7 +18643,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18605
18643
|
href: $data.linkConfig.url,
|
18606
18644
|
target: "_blank",
|
18607
18645
|
style: normalizeStyle({ color: _ctx.$parent.color })
|
18608
|
-
}, toDisplayString($options.$editTrans("viewLink")), 13, _hoisted_6$
|
18646
|
+
}, toDisplayString($options.$editTrans("viewLink")), 13, _hoisted_6$5)
|
18609
18647
|
])
|
18610
18648
|
])
|
18611
18649
|
])) : $props.type == "image" ? (openBlock(), createElementBlock(Fragment, { key: 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,8 +19346,8 @@ 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$
|
19312
|
-
const _hoisted_6$
|
19349
|
+
const _hoisted_5$4 = { class: "editify-link-footer" };
|
19350
|
+
const _hoisted_6$4 = { class: "editify-link-operations" };
|
19313
19351
|
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
19314
19352
|
const _component_Checkbox = resolveComponent("Checkbox");
|
19315
19353
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
@@ -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),
|
@@ -19350,7 +19388,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19350
19388
|
color: $props.color,
|
19351
19389
|
size: 10
|
19352
19390
|
}, null, 8, ["modelValue", "label", "color"]),
|
19353
|
-
createElementVNode("div", _hoisted_6$
|
19391
|
+
createElementVNode("div", _hoisted_6$4, [
|
19354
19392
|
createElementVNode("span", {
|
19355
19393
|
style: normalizeStyle({ color: $props.color }),
|
19356
19394
|
onClick: _cache[7] || (_cache[7] = (...args) => $options.insertLink && $options.insertLink(...args))
|
@@ -19513,11 +19551,11 @@ 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
|
};
|
19520
|
-
const _hoisted_6$
|
19558
|
+
const _hoisted_6$3 = ["multiple"];
|
19521
19559
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
19522
19560
|
const _component_Icon = resolveComponent("Icon");
|
19523
19561
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
@@ -19559,14 +19597,14 @@ 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,
|
19566
19604
|
accept: "image/*",
|
19567
19605
|
onChange: _cache[6] || (_cache[6] = (...args) => $options.selectFile && $options.selectFile(...args)),
|
19568
19606
|
type: "file"
|
19569
|
-
}, null, 40, _hoisted_6$
|
19607
|
+
}, null, 40, _hoisted_6$3)
|
19570
19608
|
]))
|
19571
19609
|
]);
|
19572
19610
|
}
|
@@ -19724,11 +19762,11 @@ 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
|
};
|
19731
|
-
const _hoisted_6$
|
19769
|
+
const _hoisted_6$2 = ["multiple"];
|
19732
19770
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
19733
19771
|
const _component_Icon = resolveComponent("Icon");
|
19734
19772
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
@@ -19770,22 +19808,23 @@ 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,
|
19777
19815
|
accept: "video/*",
|
19778
19816
|
onChange: _cache[6] || (_cache[6] = (...args) => $options.selectFile && $options.selectFile(...args)),
|
19779
19817
|
type: "file"
|
19780
|
-
}, null, 40, _hoisted_6$
|
19818
|
+
}, null, 40, _hoisted_6$2)
|
19781
19819
|
]))
|
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_cd5ad93c_lang = "";
|
19786
19824
|
const _sfc_main$2 = {
|
19787
19825
|
name: "InsertTable",
|
19788
19826
|
emits: ["insert"],
|
19827
|
+
inject: ["$editTrans"],
|
19789
19828
|
props: {
|
19790
19829
|
//主题色
|
19791
19830
|
color: {
|
@@ -19808,6 +19847,25 @@ const _sfc_main$2 = {
|
|
19808
19847
|
tableGrids: this.getTableGrids()
|
19809
19848
|
};
|
19810
19849
|
},
|
19850
|
+
computed: {
|
19851
|
+
//表格规格
|
19852
|
+
specification() {
|
19853
|
+
return this.tableGrids.flat().filter((item) => {
|
19854
|
+
return item.inside;
|
19855
|
+
}).sort((a, b) => {
|
19856
|
+
if (a.x > b.x && a.y > b.y) {
|
19857
|
+
return -1;
|
19858
|
+
}
|
19859
|
+
if (a.x > b.x) {
|
19860
|
+
return -1;
|
19861
|
+
}
|
19862
|
+
if (a.y > b.y) {
|
19863
|
+
return -1;
|
19864
|
+
}
|
19865
|
+
return 1;
|
19866
|
+
})[0];
|
19867
|
+
}
|
19868
|
+
},
|
19811
19869
|
methods: {
|
19812
19870
|
//确认创立表格
|
19813
19871
|
createTable(data2) {
|
@@ -19845,13 +19903,16 @@ const _sfc_main$2 = {
|
|
19845
19903
|
}
|
19846
19904
|
}
|
19847
19905
|
};
|
19848
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
19906
|
+
const _withScopeId = (n) => (pushScopeId("data-v-cd5ad93c"), n = n(), popScopeId(), n);
|
19849
19907
|
const _hoisted_1$2 = { class: "editify-table" };
|
19850
19908
|
const _hoisted_2$1 = ["onMouseenter", "onClick"];
|
19851
19909
|
const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, null, -1));
|
19852
19910
|
const _hoisted_4$1 = [
|
19853
19911
|
_hoisted_3$1
|
19854
19912
|
];
|
19913
|
+
const _hoisted_5$1 = { class: "editify-table-footer" };
|
19914
|
+
const _hoisted_6$1 = { key: 0 };
|
19915
|
+
const _hoisted_7 = { key: 1 };
|
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,14 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19866
19927
|
}), 256))
|
19867
19928
|
]);
|
19868
19929
|
}), 256))
|
19930
|
+
]),
|
19931
|
+
createElementVNode("div", _hoisted_5$1, [
|
19932
|
+
$options.specification ? (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString($options.specification.x) + " x " + toDisplayString($options.specification.y), 1)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString($options.$editTrans("insertTable")), 1))
|
19869
19933
|
])
|
19870
19934
|
]);
|
19871
19935
|
}
|
19872
|
-
const InsertTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
19873
|
-
const
|
19936
|
+
const InsertTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-cd5ad93c"]]);
|
19937
|
+
const Menu_vue_vue_type_style_index_0_scoped_3fc2d533_lang = "";
|
19874
19938
|
const _sfc_main$1 = {
|
19875
19939
|
name: "Menu",
|
19876
19940
|
props: {
|
@@ -20941,8 +21005,6 @@ const _sfc_main$1 = {
|
|
20941
21005
|
if (!this.$parent.isSourceView) {
|
20942
21006
|
this.$parent.editor.rangeRender();
|
20943
21007
|
}
|
20944
|
-
} else {
|
20945
|
-
this.$parent.$emit("menu-operate", name, val);
|
20946
21008
|
}
|
20947
21009
|
},
|
20948
21010
|
//处理光标更新
|
@@ -21090,8 +21152,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21090
21152
|
}), 256))
|
21091
21153
|
], 14, _hoisted_1$1);
|
21092
21154
|
}
|
21093
|
-
const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
|
21094
|
-
const
|
21155
|
+
const Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-3fc2d533"]]);
|
21156
|
+
const Editify_vue_vue_type_style_index_0_scoped_e9c5b94e_lang = "";
|
21095
21157
|
const _sfc_main = {
|
21096
21158
|
name: "editify",
|
21097
21159
|
props: { ...editorProps },
|
@@ -22242,7 +22304,7 @@ const _sfc_main = {
|
|
22242
22304
|
this.editor.rangeRender();
|
22243
22305
|
},
|
22244
22306
|
//api:插入图片
|
22245
|
-
insertImage(url2) {
|
22307
|
+
insertImage(url2, isRender = true) {
|
22246
22308
|
if (this.disabled) {
|
22247
22309
|
return;
|
22248
22310
|
}
|
@@ -22262,12 +22324,14 @@ const _sfc_main = {
|
|
22262
22324
|
null
|
22263
22325
|
);
|
22264
22326
|
this.editor.insertElement(image);
|
22265
|
-
|
22266
|
-
|
22267
|
-
|
22327
|
+
if (isRender) {
|
22328
|
+
this.editor.formatElementStack();
|
22329
|
+
this.editor.domRender();
|
22330
|
+
this.editor.rangeRender();
|
22331
|
+
}
|
22268
22332
|
},
|
22269
22333
|
//api:插入视频
|
22270
|
-
insertVideo(url2) {
|
22334
|
+
insertVideo(url2, isRender = true) {
|
22271
22335
|
if (this.disabled) {
|
22272
22336
|
return;
|
22273
22337
|
}
|
@@ -22293,9 +22357,11 @@ const _sfc_main = {
|
|
22293
22357
|
this.editor.addElementBefore(leftSpace, video);
|
22294
22358
|
this.editor.range.anchor.moveToEnd(rightSpace);
|
22295
22359
|
this.editor.range.focus.moveToEnd(rightSpace);
|
22296
|
-
|
22297
|
-
|
22298
|
-
|
22360
|
+
if (isRender) {
|
22361
|
+
this.editor.formatElementStack();
|
22362
|
+
this.editor.domRender();
|
22363
|
+
this.editor.rangeRender();
|
22364
|
+
}
|
22299
22365
|
},
|
22300
22366
|
//api:选区是否含有代码块样式
|
22301
22367
|
hasPreStyle() {
|
@@ -22684,7 +22750,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
22684
22750
|
])) : createCommentVNode("", true)
|
22685
22751
|
]);
|
22686
22752
|
}
|
22687
|
-
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
22753
|
+
const Editify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9c5b94e"]]);
|
22688
22754
|
const iconfont = "";
|
22689
22755
|
const en_US = {
|
22690
22756
|
textWrapUp: "Up feed",
|
@@ -22863,7 +22929,7 @@ const i18n = (locale) => {
|
|
22863
22929
|
return translations[locale][key];
|
22864
22930
|
};
|
22865
22931
|
};
|
22866
|
-
const version = "0.0.
|
22932
|
+
const version = "0.0.22";
|
22867
22933
|
const install = (app, props) => {
|
22868
22934
|
const locale = (props ? props.locale : "zh_CN") || "zh_CN";
|
22869
22935
|
app.provide("$editTrans", i18n(locale));
|