officialblock 2.0.2 → 2.0.4
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/dist/{index-DeLBjUjl.js → index-B7ydrCuI.js} +1 -1
- package/dist/{index-VBxjGI6P.mjs → index-BZsfPtt0.mjs} +26 -25
- package/dist/{index-C76jpZ87.mjs → index-C2I8wj4a.mjs} +1 -1
- package/dist/{index-LnEd-7FK.js → index-DWO03FuU.js} +3 -3
- package/dist/official-block.cjs.js +1 -1
- package/dist/official-block.es.js +1 -1
- package/dist/official-block.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var K=Object.defineProperty;var U=(u,s,i)=>s in u?K(u,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[s]=i;var c=(u,s,i)=>U(u,typeof s!="symbol"?s+"":s,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),B=require("@wangeditor/editor-for-vue"),w=require("@wangeditor/editor"),q=require("./index-
|
|
1
|
+
"use strict";var K=Object.defineProperty;var U=(u,s,i)=>s in u?K(u,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[s]=i;var c=(u,s,i)=>U(u,typeof s!="symbol"?s+"":s,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),B=require("@wangeditor/editor-for-vue"),w=require("@wangeditor/editor"),q=require("./index-DWO03FuU.js"),E={class:"rich-text-editor"},$=t.defineComponent({__name:"index",props:{name:{default:""},modelValue:{default:""},placeholder:{default:"请输入内容..."},height:{default:"400px"},mode:{default:"default"},disabled:{type:Boolean,default:!1},maxLength:{default:1e4},excludeKeys:{default:()=>[]},includeKeys:{default:()=>[]}},emits:["update:modelValue","change","focus","blur","created","upload-image","upload-video"],setup(u,{expose:s,emit:i}){const a=u,m=i,o=t.shallowRef(),d=t.ref(""),I=t.computed(()=>typeof a.height=="number"?`${a.height}px`:a.height),x=t.inject("handleUpload",()=>{}),f=t.inject("fileUrl",null),p=t.inject("chooseName",null),h=t.ref(""),v=t.ref(null),M=e=>{if(!x){console.warn("Upload: handleUpload function not provided by ancestor");return}if(h.value=e,o.value)try{const n=o.value.selection;n&&(v.value={anchor:{path:[...n.anchor.path],offset:n.anchor.offset},focus:{path:[...n.focus.path],offset:n.focus.offset}})}catch(n){console.warn("保存光标位置失败:",n)}const l=a.name+"_"+e;console.log("🚀 富文本编辑器传递name:",l,"props.name:",a.name),x(!0,l)};t.watch(()=>a.name,e=>{console.log("🚀 富文本编辑器name变化:",e),f.value=null},{deep:!0,immediate:!0}),t.watch(()=>[f==null?void 0:f.value],([e])=>{const l=a.name+"_"+h.value;console.log("🚀 富文本编辑器获取信息:",p.value,e,l),!(!e||!p.value||p.value!==l)&&(console.log("🚀 富文本编辑器ref:",o.value),o.value&&t.nextTick(()=>{var n,g;if(o.value){try{if(o.value.focus(),v.value)try{o.value.select(v.value)}catch(r){console.warn("恢复光标位置失败,使用默认位置:",r)}}catch(r){console.warn("聚焦编辑器失败:",r)}if(h.value==="img"){const b=`<img src="${e}" alt="图片" style="max-width: 100%;">`;(n=o.value)==null||n.dangerouslyInsertHtml(b)}else{const b=`<video src="${e}" controls style="max-width: 100%;"></video>`;(g=o.value)==null||g.dangerouslyInsertHtml(b)}v.value=null,h.value=""}}))},{immediate:!1});function _(e){return class{constructor(){c(this,"title");c(this,"tag");c(this,"iconSvg");this.title="上传图片",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>'}isActive(){return!1}getValue(){return""}isDisabled(){return!1}exec(){t.nextTick(()=>{console.log("点击了自定义上传图片菜单"),e("img")})}}}function k(e){return class{constructor(){c(this,"title");c(this,"tag");c(this,"iconSvg");this.title="上传视频",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>'}getValue(){return""}isActive(){return!1}isDisabled(){return!1}exec(){t.nextTick(()=>{console.log("点击了自定义上传视频菜单"),e("video")})}}}const V={toolbarKeys:["headerSelect","bold","italic","through","underline","color","fontSize","lineHeight","delIndent","indent","divider","insertTable","justifyCenter","justifyJustify","justifyLeft","justifyRight","undo","redo","clearStyle","codeBlock"]},H={placeholder:a.placeholder,readOnly:a.disabled,maxLength:a.maxLength,MENU_CONF:{}},S=Math.random().toString(36).substring(2,9),y=`CustomImageMenu_${S}`,C=`CustomVideoMenu_${S}`,j=e=>{o.value=e;try{const l=_(M),n=k(M),g={key:y,factory(){return new l}},r={key:C,factory(){return new n}};w.Boot.registerMenu(g),w.Boot.registerMenu(r),console.log("自定义菜单注册成功:",y,C)}catch(l){console.warn("菜单注册失败:",l)}V.insertKeys={index:0,keys:[y,C]},m("created",e)};t.onBeforeUnmount(()=>{const e=o.value;e!=null&&e.destroy()}),t.watch(()=>a.modelValue,e=>{e!==d.value&&(d.value=e||"")},{immediate:!0});const z=e=>{m("update:modelValue",d.value),m("change",e)},N=()=>{o.value=void 0},O=e=>{m("focus",e)},T=e=>{m("blur",e)};return s({editor:o,getHtml:()=>d.value,getText:()=>{var e;return((e=o.value)==null?void 0:e.getText())||""},isEmpty:()=>{var e;return((e=o.value)==null?void 0:e.isEmpty())||!0},clear:()=>{var e;return(e=o.value)==null?void 0:e.clear()},focus:()=>{var e;return(e=o.value)==null?void 0:e.focus()},blur:()=>{var e;return(e=o.value)==null?void 0:e.blur()},disable:()=>{var e;return(e=o.value)==null?void 0:e.disable()},enable:()=>{var e;return(e=o.value)==null?void 0:e.enable()}}),(e,l)=>(t.openBlock(),t.createElementBlock("div",E,[t.createVNode(t.unref(B.Toolbar),{class:"editor-toolbar",editor:o.value,defaultConfig:V,mode:u.mode},null,8,["editor","mode"]),t.createVNode(t.unref(B.Editor),{class:"editor-content",style:t.normalizeStyle({height:I.value}),modelValue:d.value,"onUpdate:modelValue":l[0]||(l[0]=n=>d.value=n),defaultConfig:H,mode:u.mode,onOnCreated:j,onOnChange:z,onOnDestroyed:N,onOnFocus:O,onOnBlur:T},null,8,["style","modelValue","mode"])]))}}),D=q._($,[["__scopeId","data-v-b85f2258"]]);exports.default=D;
|
|
@@ -427,7 +427,7 @@ const qs = { class: "button-text" }, Ks = { class: "link-text" }, Xs = /* @__PUR
|
|
|
427
427
|
},
|
|
428
428
|
emits: ["update:show"],
|
|
429
429
|
setup(e, { emit: u }) {
|
|
430
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
430
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
431
431
|
animation: 200,
|
|
432
432
|
group: "item",
|
|
433
433
|
disabled: !1,
|
|
@@ -2776,7 +2776,7 @@ const qs = { class: "button-text" }, Ks = { class: "link-text" }, Xs = /* @__PUR
|
|
|
2776
2776
|
},
|
|
2777
2777
|
emits: ["update:show"],
|
|
2778
2778
|
setup(e, { emit: u }) {
|
|
2779
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
2779
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
2780
2780
|
animation: 200,
|
|
2781
2781
|
group: "gallerys",
|
|
2782
2782
|
// 链接专用分组
|
|
@@ -4354,7 +4354,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
4354
4354
|
},
|
|
4355
4355
|
emits: ["update:show"],
|
|
4356
4356
|
setup(e, { emit: u }) {
|
|
4357
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
4357
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
4358
4358
|
animation: 200,
|
|
4359
4359
|
group: "gallerys",
|
|
4360
4360
|
// 链接专用分组
|
|
@@ -5234,7 +5234,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
5234
5234
|
},
|
|
5235
5235
|
emits: ["update:show"],
|
|
5236
5236
|
setup(e, { emit: u }) {
|
|
5237
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
5237
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
5238
5238
|
animation: 200,
|
|
5239
5239
|
group: "btns",
|
|
5240
5240
|
// 链接专用分组
|
|
@@ -5978,7 +5978,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
5978
5978
|
}
|
|
5979
5979
|
},
|
|
5980
5980
|
setup(e) {
|
|
5981
|
-
const u = Le(() => import("vuedraggable")), l = Le(() => import("./index-
|
|
5981
|
+
const u = Le(() => import("vuedraggable")), l = Le(() => import("./index-C2I8wj4a.mjs")), n = U(!1), i = N(() => ({
|
|
5982
5982
|
animation: 200,
|
|
5983
5983
|
group: "buttons",
|
|
5984
5984
|
// 按钮专用分组
|
|
@@ -6505,10 +6505,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
6505
6505
|
}), Am = /* @__PURE__ */ ae(Bm, [["__scopeId", "data-v-265d9bc6"]]), Nm = { class: "lightbox__content" }, jm = { class: "lightbox__content__head" }, Rm = { class: "lightbox__content__head__image" }, Fm = ["src", "alt"], zm = { class: "lightbox__content__head__info" }, Wm = { class: "lightbox__content__head__info__title" }, Ym = { class: "lightbox__content__head__info__subtitle" }, Gm = { class: "lightbox__content__head__info__label" }, qm = { class: "lightbox__content__head__info__btn" }, Km = {
|
|
6506
6506
|
class: "lightbox__content__main",
|
|
6507
6507
|
style: { "--head-height": "297px" }
|
|
6508
|
-
}, Xm = {
|
|
6509
|
-
class: "scroll-bar",
|
|
6510
|
-
style: { overflow: "auto" }
|
|
6511
|
-
}, Qm = {
|
|
6508
|
+
}, Xm = { class: "scroll-bar" }, Qm = {
|
|
6512
6509
|
"data-simplebar-auto-hide": "false",
|
|
6513
6510
|
class: "simple-bar",
|
|
6514
6511
|
"data-simplebar": "init"
|
|
@@ -6523,7 +6520,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
6523
6520
|
tabindex: "0",
|
|
6524
6521
|
role: "region",
|
|
6525
6522
|
"aria-label": "scrollable content",
|
|
6526
|
-
style: {
|
|
6523
|
+
style: { overflow: "auto" }
|
|
6527
6524
|
}, lp = {
|
|
6528
6525
|
class: "simplebar-content",
|
|
6529
6526
|
style: { padding: "0px 24px 0px 0px" }
|
|
@@ -6607,9 +6604,13 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
6607
6604
|
])
|
|
6608
6605
|
])
|
|
6609
6606
|
])
|
|
6610
|
-
])
|
|
6607
|
+
]),
|
|
6608
|
+
s[2] || (s[2] = t("div", {
|
|
6609
|
+
class: "simplebar-placeholder",
|
|
6610
|
+
style: { width: "auto", height: "300px" }
|
|
6611
|
+
}, null, -1))
|
|
6611
6612
|
]),
|
|
6612
|
-
s[
|
|
6613
|
+
s[3] || (s[3] = t("div", {
|
|
6613
6614
|
class: "simplebar-track simplebar-horizontal",
|
|
6614
6615
|
style: { visibility: "hidden" }
|
|
6615
6616
|
}, [
|
|
@@ -6618,7 +6619,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
6618
6619
|
style: { width: "0px", display: "none" }
|
|
6619
6620
|
})
|
|
6620
6621
|
], -1)),
|
|
6621
|
-
s[
|
|
6622
|
+
s[4] || (s[4] = t("div", {
|
|
6622
6623
|
class: "simplebar-track simplebar-vertical",
|
|
6623
6624
|
style: { visibility: "hidden" }
|
|
6624
6625
|
}, [
|
|
@@ -6633,7 +6634,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
6633
6634
|
]);
|
|
6634
6635
|
};
|
|
6635
6636
|
}
|
|
6636
|
-
}), up = /* @__PURE__ */ ae(rp, [["__scopeId", "data-v-
|
|
6637
|
+
}), up = /* @__PURE__ */ ae(rp, [["__scopeId", "data-v-f73080bd"]]), ln = /* @__PURE__ */ le({
|
|
6637
6638
|
__name: "modal",
|
|
6638
6639
|
props: {
|
|
6639
6640
|
show: {
|
|
@@ -7966,7 +7967,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
7966
7967
|
},
|
|
7967
7968
|
emits: ["update:show"],
|
|
7968
7969
|
setup(e, { emit: u }) {
|
|
7969
|
-
const l = Le(() => import("./index-
|
|
7970
|
+
const l = Le(() => import("./index-C2I8wj4a.mjs")), n = u, i = () => {
|
|
7970
7971
|
n("update:show", !1);
|
|
7971
7972
|
};
|
|
7972
7973
|
return (s, r) => {
|
|
@@ -9342,7 +9343,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
9342
9343
|
},
|
|
9343
9344
|
emits: ["update:show"],
|
|
9344
9345
|
setup(e, { emit: u }) {
|
|
9345
|
-
const l = Le(() => import("./index-
|
|
9346
|
+
const l = Le(() => import("./index-C2I8wj4a.mjs")), n = u, i = () => {
|
|
9346
9347
|
n("update:show", !1);
|
|
9347
9348
|
};
|
|
9348
9349
|
return (s, r) => {
|
|
@@ -9512,7 +9513,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
9512
9513
|
},
|
|
9513
9514
|
emits: ["update:show"],
|
|
9514
9515
|
setup(e, { emit: u }) {
|
|
9515
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
9516
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
9516
9517
|
animation: 200,
|
|
9517
9518
|
group: "links",
|
|
9518
9519
|
// 链接专用分组
|
|
@@ -9838,7 +9839,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
9838
9839
|
},
|
|
9839
9840
|
emits: ["update:show"],
|
|
9840
9841
|
setup(e, { emit: u }) {
|
|
9841
|
-
const l = Le(() => import("./index-
|
|
9842
|
+
const l = Le(() => import("./index-C2I8wj4a.mjs")), n = u, i = () => {
|
|
9842
9843
|
n("update:show", !1);
|
|
9843
9844
|
};
|
|
9844
9845
|
return (s, r) => {
|
|
@@ -10307,7 +10308,7 @@ const pu = { class: "gallery-timeline" }, vu = { class: "gallery-timeline__list"
|
|
|
10307
10308
|
},
|
|
10308
10309
|
emits: ["update:show"],
|
|
10309
10310
|
setup(e, { emit: u }) {
|
|
10310
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
10311
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
10311
10312
|
animation: 200,
|
|
10312
10313
|
group: "gallerys",
|
|
10313
10314
|
// 链接专用分组
|
|
@@ -12096,7 +12097,7 @@ const Xt = ss(), ag = ss(), ng = { class: "list-sort" }, og = ["onClick"], sg =
|
|
|
12096
12097
|
},
|
|
12097
12098
|
emits: ["update:show"],
|
|
12098
12099
|
setup(e, { emit: u }) {
|
|
12099
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
12100
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
12100
12101
|
animation: 200,
|
|
12101
12102
|
group: "gallerys",
|
|
12102
12103
|
// 链接专用分组
|
|
@@ -13250,7 +13251,7 @@ const Xt = ss(), ag = ss(), ng = { class: "list-sort" }, og = ["onClick"], sg =
|
|
|
13250
13251
|
},
|
|
13251
13252
|
emits: ["update:show"],
|
|
13252
13253
|
setup(e, { emit: u }) {
|
|
13253
|
-
const l = Le(() => import("./index-
|
|
13254
|
+
const l = Le(() => import("./index-C2I8wj4a.mjs")), n = u, i = U({
|
|
13254
13255
|
title: "",
|
|
13255
13256
|
content: "",
|
|
13256
13257
|
imgSrc: "https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg"
|
|
@@ -14585,7 +14586,7 @@ const Xt = ss(), ag = ss(), ng = { class: "list-sort" }, og = ["onClick"], sg =
|
|
|
14585
14586
|
setup(e, { emit: u }) {
|
|
14586
14587
|
var M;
|
|
14587
14588
|
const l = Le(() => import("vuedraggable")), n = Le(
|
|
14588
|
-
() => import("./index-
|
|
14589
|
+
() => import("./index-C2I8wj4a.mjs")
|
|
14589
14590
|
), i = N(() => ({
|
|
14590
14591
|
animation: 200,
|
|
14591
14592
|
group: "links",
|
|
@@ -16610,7 +16611,7 @@ const Xt = ss(), ag = ss(), ng = { class: "list-sort" }, og = ["onClick"], sg =
|
|
|
16610
16611
|
},
|
|
16611
16612
|
emits: ["update:show"],
|
|
16612
16613
|
setup(e, { emit: u }) {
|
|
16613
|
-
const l = Le(() => import("./index-
|
|
16614
|
+
const l = Le(() => import("./index-C2I8wj4a.mjs")), n = Le(() => import("vuedraggable")), i = e, s = U(!1), r = U(/* @__PURE__ */ new Set()), h = U(/* @__PURE__ */ new Set());
|
|
16614
16615
|
De(
|
|
16615
16616
|
() => {
|
|
16616
16617
|
var C;
|
|
@@ -19785,7 +19786,7 @@ const Xt = ss(), ag = ss(), ng = { class: "list-sort" }, og = ["onClick"], sg =
|
|
|
19785
19786
|
},
|
|
19786
19787
|
emits: ["update:show"],
|
|
19787
19788
|
setup(e, { emit: u }) {
|
|
19788
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
19789
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
19789
19790
|
animation: 200,
|
|
19790
19791
|
group: "data",
|
|
19791
19792
|
// 专用分组
|
|
@@ -20062,7 +20063,7 @@ const Xt = ss(), ag = ss(), ng = { class: "list-sort" }, og = ["onClick"], sg =
|
|
|
20062
20063
|
},
|
|
20063
20064
|
emits: ["update:show"],
|
|
20064
20065
|
setup(e, { emit: u }) {
|
|
20065
|
-
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-
|
|
20066
|
+
const l = Le(() => import("vuedraggable")), n = Le(() => import("./index-C2I8wj4a.mjs")), i = U(!1), s = N(() => ({
|
|
20066
20067
|
animation: 200,
|
|
20067
20068
|
group: "data",
|
|
20068
20069
|
// 专用分组
|
|
@@ -4,7 +4,7 @@ var r = (a, u, c) => L(a, typeof u != "symbol" ? u + "" : u, c);
|
|
|
4
4
|
import { defineComponent as A, shallowRef as R, ref as b, computed as q, inject as x, watch as M, nextTick as V, onBeforeUnmount as F, createElementBlock as J, openBlock as G, createVNode as w, unref as H, normalizeStyle as P } from "vue";
|
|
5
5
|
import { Toolbar as Q, Editor as W } from "@wangeditor/editor-for-vue";
|
|
6
6
|
import { Boot as z } from "@wangeditor/editor";
|
|
7
|
-
import { _ as X } from "./index-
|
|
7
|
+
import { _ as X } from "./index-BZsfPtt0.mjs";
|
|
8
8
|
const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|