officialblock 2.2.5 → 2.2.7
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/{style.css → assets/style.BnzxRevz.css} +1 -1
- package/dist/{index-DVmEKzC4.js → index-BLsbfAU6.js} +38 -38
- package/dist/{index-CK3XV-7s.mjs → index-BTFpLRds.mjs} +56 -34
- package/dist/{index-Vq9TgNgB.mjs → index-C-4UlO21.mjs} +13168 -12794
- package/dist/index-CpOxLWqv.js +1 -0
- package/dist/index-Cr0Xkwwt.mjs +4 -0
- package/dist/index-CxAS2uNv.js +1 -0
- package/dist/official-block.cjs.js +1 -1
- package/dist/official-block.es.js +148 -146
- package/dist/official-block.umd.js +35 -35
- package/package.json +1 -1
- package/dist/index-CLIUE4Qc.js +0 -1
- package/dist/index-CdJYhA5A.js +0 -1
- package/dist/index-DJtwxnKH.mjs +0 -168
- package/dist/index-DszDX36P.js +0 -1
- package/dist/index-nRecnlNx.mjs +0 -4
package/package.json
CHANGED
package/dist/index-CLIUE4Qc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DVmEKzC4.js");exports.default=e.a;
|
package/dist/index-CdJYhA5A.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var U=Object.defineProperty;var K=(u,r,i)=>r in u?U(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i;var c=(u,r,i)=>K(u,typeof r!="symbol"?r+"":r,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-DVmEKzC4.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:r,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),p=t.inject("handleUpload",()=>{}),f=t.inject("fileUrl",null),C=t.inject("chooseName",null),h=t.ref(""),v=t.ref(null),b=e=>{if(!p){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;p(!0,l)};t.watch(()=>a.name,()=>{f.value=null},{deep:!0,immediate:!0}),t.watch(()=>[f==null?void 0:f.value],([e])=>{const l=a.name+"_"+h.value;!e||!C.value||C.value!==l||o.value&&t.nextTick(()=>{var n,g;if(o.value){try{if(o.value.focus(),v.value)try{o.value.select(v.value)}catch(s){console.warn("恢复光标位置失败,使用默认位置:",s)}}catch(s){console.warn("聚焦编辑器失败:",s)}if(h.value==="img"){const y=`<img src="${e}" alt="图片" style="max-width: 100%;">`;(n=o.value)==null||n.dangerouslyInsertHtml(y)}else{const y=`<video src="${e}" controls style="max-width: 100%;"></video>`;(g=o.value)==null||g.dangerouslyInsertHtml(y)}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 x={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:{}},M=Math.random().toString(36).substring(2,9),V=`CustomImageMenu_${M}`,S=`CustomVideoMenu_${M}`,j=e=>{o.value=e;try{const l=_(b),n=k(b),g={key:V,factory(){return new l}},s={key:S,factory(){return new n}};w.Boot.registerMenu(g),w.Boot.registerMenu(s)}catch(l){console.warn("菜单注册失败:",l)}x.insertKeys={index:0,keys:[V,S]},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 r({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:x,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-e8d1a61b"]]);exports.default=D;
|
package/dist/index-DJtwxnKH.mjs
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance as B, ref as r, computed as u, watch as x, nextTick as $, onMounted as M, createElementBlock as h, openBlock as _, normalizeStyle as b, normalizeClass as m, createElementVNode as a, withDirectives as N, Fragment as A, renderList as E, toDisplayString as H, vShow as R } from "vue";
|
|
2
|
-
import { _ as j, r as g, $ as W } from "./index-Vq9TgNgB.mjs";
|
|
3
|
-
const Y = ["id"], q = ["id"], G = ["onClick"], J = { class: "accordion-button__title" }, K = ["id", "aria-expanded", "aria-labelledby"], Q = { class: "accordion-body" }, U = ["innerHTML"], X = { class: "flex-center mt-10" }, Z = {
|
|
4
|
-
__name: "index",
|
|
5
|
-
props: {
|
|
6
|
-
modelValue: {
|
|
7
|
-
type: Object,
|
|
8
|
-
default: () => ({})
|
|
9
|
-
},
|
|
10
|
-
// 是否预览
|
|
11
|
-
isPreview: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: !0
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
emits: [
|
|
17
|
-
"update:modelValue",
|
|
18
|
-
"handleDelete",
|
|
19
|
-
"handleCopy",
|
|
20
|
-
"handlePaste"
|
|
21
|
-
],
|
|
22
|
-
setup(p, { emit: S }) {
|
|
23
|
-
const { proxy: P } = B(), {
|
|
24
|
-
$_vsWidth: f,
|
|
25
|
-
$_vsScrollY: ee,
|
|
26
|
-
$vsScreenAddListener: te,
|
|
27
|
-
$vsScreenDestroyListener: le
|
|
28
|
-
} = P, t = p, C = S, I = () => {
|
|
29
|
-
var l;
|
|
30
|
-
if (t.modelValue && t.modelValue.data) {
|
|
31
|
-
t.modelValue.openFirst && t.modelValue.data.length > 0 && n.value.size === 0 && n.value.add(t.modelValue.data[0].key);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const e = {
|
|
35
|
-
id: ((l = t.modelValue) == null ? void 0 : l.id) || g(),
|
|
36
|
-
//componentKey
|
|
37
|
-
type: "AccordionText",
|
|
38
|
-
onlyShowPc: !1,
|
|
39
|
-
openFirst: !1,
|
|
40
|
-
width: "",
|
|
41
|
-
style: {
|
|
42
|
-
// marginTop: "20px",
|
|
43
|
-
// backgroundColor: "#f5f5f5",
|
|
44
|
-
},
|
|
45
|
-
data: [
|
|
46
|
-
{
|
|
47
|
-
key: g(),
|
|
48
|
-
title: "tab1",
|
|
49
|
-
content: "neirng"
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
};
|
|
53
|
-
C("update:modelValue", e);
|
|
54
|
-
}, d = r(Date.now()), i = r(6), y = r(6), n = r(/* @__PURE__ */ new Set()), L = r([]), T = u(() => {
|
|
55
|
-
var e;
|
|
56
|
-
return (e = t.modelValue) != null && e.hasOwnProperty("classes") ? t.modelValue.classes : null;
|
|
57
|
-
}), z = u(() => {
|
|
58
|
-
var e;
|
|
59
|
-
return (e = t.modelValue) != null && e.hasOwnProperty("style") ? t.modelValue.style : null;
|
|
60
|
-
});
|
|
61
|
-
u(() => {
|
|
62
|
-
var e;
|
|
63
|
-
return (e = t.modelValue) != null && e.hasOwnProperty("width") ? t.modelValue.width : null;
|
|
64
|
-
});
|
|
65
|
-
const c = u(() => {
|
|
66
|
-
var e;
|
|
67
|
-
return ((e = t.modelValue) == null ? void 0 : e.data) || [];
|
|
68
|
-
}), V = u(() => c.value.slice(0, i.value)), D = (e) => {
|
|
69
|
-
var l;
|
|
70
|
-
n.value.has(e) ? n.value.delete(e) : ((l = t.modelValue) != null && l.allowMultiple || n.value.clear(), n.value.add(e)), setTimeout(() => {
|
|
71
|
-
F(document.getElementById(`accordion-${d.value}-${e}`));
|
|
72
|
-
}, 350);
|
|
73
|
-
}, v = (e) => n.value.has(e), F = (e) => {
|
|
74
|
-
if (f.value >= 768) return;
|
|
75
|
-
const s = W(e).y - 150;
|
|
76
|
-
window.scroll({ top: s, left: 0, behavior: "smooth" });
|
|
77
|
-
}, w = () => {
|
|
78
|
-
f.value >= 768 ? (i.value = 6, y.value = 6) : (i.value = 4, y.value = 4);
|
|
79
|
-
}, O = () => {
|
|
80
|
-
};
|
|
81
|
-
return x(
|
|
82
|
-
c,
|
|
83
|
-
(e, l) => {
|
|
84
|
-
var s;
|
|
85
|
-
w(), (s = t.modelValue) != null && s.openFirst && e.length > 0 && n.value.size === 0 && n.value.add(e[0].key);
|
|
86
|
-
},
|
|
87
|
-
{ deep: !0, immediate: !0 }
|
|
88
|
-
), x(
|
|
89
|
-
V,
|
|
90
|
-
() => {
|
|
91
|
-
$(O);
|
|
92
|
-
},
|
|
93
|
-
{ immediate: !1 }
|
|
94
|
-
), M(() => {
|
|
95
|
-
var e;
|
|
96
|
-
$(w), (e = t.modelValue) != null && e.openFirst && c.value.length > 0 && n.value.size === 0 && n.value.add(c.value[0].key);
|
|
97
|
-
}), I(), (e, l) => {
|
|
98
|
-
var s, k;
|
|
99
|
-
return _(), h("div", {
|
|
100
|
-
class: m(["accordion-text", T.value]),
|
|
101
|
-
id: `accordion-parent-${d.value}`,
|
|
102
|
-
style: b(z.value)
|
|
103
|
-
}, [
|
|
104
|
-
a("div", {
|
|
105
|
-
class: m(["accordion-text__container", [
|
|
106
|
-
(s = p.modelValue) != null && s.width ? `container-content-${(k = p.modelValue) == null ? void 0 : k.width}` : "container-content"
|
|
107
|
-
]])
|
|
108
|
-
}, [
|
|
109
|
-
(_(!0), h(A, null, E(V.value, (o, oe) => (_(), h("div", {
|
|
110
|
-
key: o.key,
|
|
111
|
-
class: "accordion-item",
|
|
112
|
-
ref_for: !0,
|
|
113
|
-
ref_key: "itemRefs",
|
|
114
|
-
ref: L,
|
|
115
|
-
"data-aos": "fade-in"
|
|
116
|
-
}, [
|
|
117
|
-
a("div", {
|
|
118
|
-
class: "accordion-header",
|
|
119
|
-
id: `accordion-${d.value}-${o.key}`
|
|
120
|
-
}, [
|
|
121
|
-
a("button", {
|
|
122
|
-
class: m(["accordion-button", { collapsed: !v(o.key) }]),
|
|
123
|
-
type: "button",
|
|
124
|
-
onClick: (ae) => D(o.key)
|
|
125
|
-
}, [
|
|
126
|
-
a("div", null, [
|
|
127
|
-
a("div", J, H(o.title), 1)
|
|
128
|
-
]),
|
|
129
|
-
l[1] || (l[1] = a("span", { class: "accordion-button__icon" }, null, -1))
|
|
130
|
-
], 10, G)
|
|
131
|
-
], 8, q),
|
|
132
|
-
a("div", {
|
|
133
|
-
id: `accordion-${d.value}-collapse-${o.key}`,
|
|
134
|
-
class: m(["accordion-collapse collapse", { show: v(o.key) }]),
|
|
135
|
-
"aria-expanded": v(o.key),
|
|
136
|
-
"aria-labelledby": `accordion-${d.value}-${o.key}`,
|
|
137
|
-
style: b({
|
|
138
|
-
height: v(o.key) ? "auto" : "0",
|
|
139
|
-
overflow: "hidden"
|
|
140
|
-
})
|
|
141
|
-
}, [
|
|
142
|
-
a("div", Q, [
|
|
143
|
-
a("div", {
|
|
144
|
-
class: "accordion__content",
|
|
145
|
-
innerHTML: o.content
|
|
146
|
-
}, null, 8, U)
|
|
147
|
-
])
|
|
148
|
-
], 14, K)
|
|
149
|
-
]))), 128)),
|
|
150
|
-
N(a("div", X, [
|
|
151
|
-
a("button", {
|
|
152
|
-
type: "button",
|
|
153
|
-
class: "btn btn__load-more",
|
|
154
|
-
onClick: l[0] || (l[0] = (o) => i.value += y.value)
|
|
155
|
-
}, [...l[2] || (l[2] = [
|
|
156
|
-
a("span", { class: "i i-load-more" }, null, -1)
|
|
157
|
-
])])
|
|
158
|
-
], 512), [
|
|
159
|
-
[R, i.value < c.value.length]
|
|
160
|
-
])
|
|
161
|
-
], 2)
|
|
162
|
-
], 14, Y);
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
}, de = /* @__PURE__ */ j(Z, [["__scopeId", "data-v-e60439d5"]]);
|
|
166
|
-
export {
|
|
167
|
-
de as default
|
|
168
|
-
};
|
package/dist/index-DszDX36P.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DVmEKzC4.js"),S=["id"],z=["id"],C=["onClick"],P={class:"accordion-button__title"},B=["id","aria-expanded","aria-labelledby"],T={class:"accordion-body"},I=["innerHTML"],L={class:"flex-center mt-10"},O={__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(m,{emit:V}){const{proxy:_}=e.getCurrentInstance(),{$_vsWidth:p,$_vsScrollY:F,$vsScreenAddListener:M,$vsScreenDestroyListener:A}=_,l=m,k=V,w=()=>{var o;if(l.modelValue&&l.modelValue.data){l.modelValue.openFirst&&l.modelValue.data.length>0&&n.value.size===0&&n.value.add(l.modelValue.data[0].key);return}const t={id:((o=l.modelValue)==null?void 0:o.id)||u.r(),type:"AccordionText",onlyShowPc:!1,openFirst:!1,width:"",style:{},data:[{key:u.r(),title:"tab1",content:"neirng"}]};k("update:modelValue",t)},d=e.ref(Date.now()),c=e.ref(6),v=e.ref(6),n=e.ref(new Set),b=e.ref([]),x=e.computed(()=>{var t;return(t=l.modelValue)!=null&&t.hasOwnProperty("classes")?l.modelValue.classes:null}),$=e.computed(()=>{var t;return(t=l.modelValue)!=null&&t.hasOwnProperty("style")?l.modelValue.style:null});e.computed(()=>{var t;return(t=l.modelValue)!=null&&t.hasOwnProperty("width")?l.modelValue.width:null});const r=e.computed(()=>{var t;return((t=l.modelValue)==null?void 0:t.data)||[]}),y=e.computed(()=>r.value.slice(0,c.value)),E=t=>{var o;n.value.has(t)?n.value.delete(t):((o=l.modelValue)!=null&&o.allowMultiple||n.value.clear(),n.value.add(t)),setTimeout(()=>{g(document.getElementById(`accordion-${d.value}-${t}`))},350)},i=t=>n.value.has(t),g=t=>{if(p.value>=768)return;const s=u.$(t).y-150;window.scroll({top:s,left:0,behavior:"smooth"})},h=()=>{p.value>=768?(c.value=6,v.value=6):(c.value=4,v.value=4)},N=()=>{};return e.watch(r,(t,o)=>{var s;h(),(s=l.modelValue)!=null&&s.openFirst&&t.length>0&&n.value.size===0&&n.value.add(t[0].key)},{deep:!0,immediate:!0}),e.watch(y,()=>{e.nextTick(N)},{immediate:!1}),e.onMounted(()=>{var t;e.nextTick(h),(t=l.modelValue)!=null&&t.openFirst&&r.value.length>0&&n.value.size===0&&n.value.add(r.value[0].key)}),w(),(t,o)=>{var s,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["accordion-text",x.value]),id:`accordion-parent-${d.value}`,style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:e.normalizeClass(["accordion-text__container",[(s=m.modelValue)!=null&&s.width?`container-content-${(f=m.modelValue)==null?void 0:f.width}`:"container-content"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,j)=>(e.openBlock(),e.createElementBlock("div",{key:a.key,class:"accordion-item",ref_for:!0,ref_key:"itemRefs",ref:b,"data-aos":"fade-in"},[e.createElementVNode("div",{class:"accordion-header",id:`accordion-${d.value}-${a.key}`},[e.createElementVNode("button",{class:e.normalizeClass(["accordion-button",{collapsed:!i(a.key)}]),type:"button",onClick:q=>E(a.key)},[e.createElementVNode("div",null,[e.createElementVNode("div",P,e.toDisplayString(a.title),1)]),o[1]||(o[1]=e.createElementVNode("span",{class:"accordion-button__icon"},null,-1))],10,C)],8,z),e.createElementVNode("div",{id:`accordion-${d.value}-collapse-${a.key}`,class:e.normalizeClass(["accordion-collapse collapse",{show:i(a.key)}]),"aria-expanded":i(a.key),"aria-labelledby":`accordion-${d.value}-${a.key}`,style:e.normalizeStyle({height:i(a.key)?"auto":"0",overflow:"hidden"})},[e.createElementVNode("div",T,[e.createElementVNode("div",{class:"accordion__content",innerHTML:a.content},null,8,I)])],14,B)]))),128)),e.withDirectives(e.createElementVNode("div",L,[e.createElementVNode("button",{type:"button",class:"btn btn__load-more",onClick:o[0]||(o[0]=a=>c.value+=v.value)},[...o[2]||(o[2]=[e.createElementVNode("span",{class:"i i-load-more"},null,-1)])])],512),[[e.vShow,c.value<r.value.length]])],2)],14,S)}}},D=u._(O,[["__scopeId","data-v-e60439d5"]]);exports.default=D;
|
package/dist/index-nRecnlNx.mjs
DELETED