officialblock 2.0.4 → 2.0.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/{index-BZsfPtt0.mjs → index-BehsQJZ_.mjs} +19 -18
- package/dist/index-CtRJtHih.js +1 -0
- package/dist/{index-DWO03FuU.js → index-D8m0Y8bQ.js} +3 -3
- package/dist/{index-C2I8wj4a.mjs → index-DGEjlopB.mjs} +51 -51
- package/dist/official-block.cjs.js +1 -1
- package/dist/official-block.es.js +1 -1
- package/dist/official-block.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-B7ydrCuI.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var D = Object.defineProperty;
|
|
2
2
|
var L = (a, u, c) => u in a ? D(a, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : a[u] = c;
|
|
3
3
|
var r = (a, u, c) => L(a, typeof u != "symbol" ? u + "" : u, c);
|
|
4
|
-
import { defineComponent as A, shallowRef as R, ref as
|
|
4
|
+
import { defineComponent as A, shallowRef as R, ref as p, computed as F, inject as y, watch as C, nextTick as b, onBeforeUnmount as q, createElementBlock as J, openBlock as G, createVNode as I, 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-BehsQJZ_.mjs";
|
|
8
8
|
const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
@@ -20,39 +20,39 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:modelValue", "change", "focus", "blur", "created", "upload-image", "upload-video"],
|
|
22
22
|
setup(a, { expose: u, emit: c }) {
|
|
23
|
-
const n = a, d = c, t = R(), i =
|
|
24
|
-
}), m =
|
|
25
|
-
if (!
|
|
23
|
+
const n = a, d = c, t = R(), i = p(""), k = F(() => typeof n.height == "number" ? `${n.height}px` : n.height), x = y("handleUpload", () => {
|
|
24
|
+
}), m = y("fileUrl", null), M = y("chooseName", null), f = p(""), h = p(null), V = (e) => {
|
|
25
|
+
if (!x) {
|
|
26
26
|
console.warn("Upload: handleUpload function not provided by ancestor");
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
if (f.value = e, t.value)
|
|
30
30
|
try {
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const o = t.value.selection;
|
|
32
|
+
o && (h.value = {
|
|
33
33
|
anchor: {
|
|
34
|
-
path: [...
|
|
35
|
-
offset:
|
|
34
|
+
path: [...o.anchor.path],
|
|
35
|
+
offset: o.anchor.offset
|
|
36
36
|
},
|
|
37
37
|
focus: {
|
|
38
|
-
path: [...
|
|
39
|
-
offset:
|
|
38
|
+
path: [...o.focus.path],
|
|
39
|
+
offset: o.focus.offset
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
} catch (
|
|
43
|
-
console.warn("保存光标位置失败:",
|
|
42
|
+
} catch (o) {
|
|
43
|
+
console.warn("保存光标位置失败:", o);
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const l = n.name + "_" + e;
|
|
46
|
+
x(!0, l);
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, { deep: !0, immediate: !0 }),
|
|
48
|
+
C(() => n.name, () => {
|
|
49
|
+
m.value = null;
|
|
50
|
+
}, { deep: !0, immediate: !0 }), C(
|
|
51
51
|
() => [m == null ? void 0 : m.value],
|
|
52
52
|
([e]) => {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
var
|
|
53
|
+
const l = n.name + "_" + f.value;
|
|
54
|
+
!e || !M.value || M.value !== l || t.value && b(() => {
|
|
55
|
+
var o, v;
|
|
56
56
|
if (t.value) {
|
|
57
57
|
try {
|
|
58
58
|
if (t.value.focus(), h.value)
|
|
@@ -65,15 +65,15 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
65
65
|
console.warn("聚焦编辑器失败:", s);
|
|
66
66
|
}
|
|
67
67
|
if (f.value === "img") {
|
|
68
|
-
const
|
|
69
|
-
(
|
|
68
|
+
const g = `<img src="${e}" alt="图片" style="max-width: 100%;">`;
|
|
69
|
+
(o = t.value) == null || o.dangerouslyInsertHtml(g);
|
|
70
70
|
} else {
|
|
71
|
-
const
|
|
72
|
-
(v = t.value) == null || v.dangerouslyInsertHtml(
|
|
71
|
+
const g = `<video src="${e}" controls style="max-width: 100%;"></video>`;
|
|
72
|
+
(v = t.value) == null || v.dangerouslyInsertHtml(g);
|
|
73
73
|
}
|
|
74
74
|
h.value = null, f.value = "";
|
|
75
75
|
}
|
|
76
|
-
})
|
|
76
|
+
});
|
|
77
77
|
},
|
|
78
78
|
{ immediate: !1 }
|
|
79
79
|
);
|
|
@@ -95,7 +95,7 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
95
95
|
return !1;
|
|
96
96
|
}
|
|
97
97
|
exec() {
|
|
98
|
-
|
|
98
|
+
b(() => {
|
|
99
99
|
console.log("点击了自定义上传图片菜单"), e("img");
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -119,13 +119,13 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
119
119
|
return !1;
|
|
120
120
|
}
|
|
121
121
|
exec() {
|
|
122
|
-
|
|
122
|
+
b(() => {
|
|
123
123
|
console.log("点击了自定义上传视频菜单"), e("video");
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const B = {
|
|
129
129
|
toolbarKeys: [
|
|
130
130
|
// 菜单 key
|
|
131
131
|
"headerSelect",
|
|
@@ -168,40 +168,40 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
168
168
|
"codeBlock"
|
|
169
169
|
//代码块
|
|
170
170
|
]
|
|
171
|
-
},
|
|
171
|
+
}, U = {
|
|
172
172
|
placeholder: n.placeholder,
|
|
173
173
|
readOnly: n.disabled,
|
|
174
174
|
maxLength: n.maxLength,
|
|
175
175
|
MENU_CONF: {}
|
|
176
|
-
},
|
|
176
|
+
}, S = Math.random().toString(36).substring(2, 9), _ = `CustomImageMenu_${S}`, w = `CustomVideoMenu_${S}`, K = (e) => {
|
|
177
177
|
t.value = e;
|
|
178
178
|
try {
|
|
179
|
-
const
|
|
180
|
-
key:
|
|
179
|
+
const l = N(V), o = O(V), v = {
|
|
180
|
+
key: _,
|
|
181
181
|
// 使用唯一的 key
|
|
182
182
|
factory() {
|
|
183
|
-
return new
|
|
183
|
+
return new l();
|
|
184
184
|
}
|
|
185
185
|
}, s = {
|
|
186
|
-
key:
|
|
186
|
+
key: w,
|
|
187
187
|
// 使用唯一的 key
|
|
188
188
|
factory() {
|
|
189
|
-
return new
|
|
189
|
+
return new o();
|
|
190
190
|
}
|
|
191
191
|
};
|
|
192
|
-
z.registerMenu(v), z.registerMenu(s)
|
|
193
|
-
} catch (
|
|
194
|
-
console.warn("菜单注册失败:",
|
|
192
|
+
z.registerMenu(v), z.registerMenu(s);
|
|
193
|
+
} catch (l) {
|
|
194
|
+
console.warn("菜单注册失败:", l);
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
B.insertKeys = {
|
|
197
197
|
index: 0,
|
|
198
|
-
keys: [
|
|
198
|
+
keys: [_, w]
|
|
199
199
|
}, d("created", e);
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
q(() => {
|
|
202
202
|
const e = t.value;
|
|
203
203
|
e != null && e.destroy();
|
|
204
|
-
}),
|
|
204
|
+
}), C(
|
|
205
205
|
() => n.modelValue,
|
|
206
206
|
(e) => {
|
|
207
207
|
e !== i.value && (i.value = e || "");
|
|
@@ -248,21 +248,21 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
248
248
|
var e;
|
|
249
249
|
return (e = t.value) == null ? void 0 : e.enable();
|
|
250
250
|
}
|
|
251
|
-
}), (e,
|
|
252
|
-
|
|
251
|
+
}), (e, l) => (G(), J("div", Y, [
|
|
252
|
+
I(H(Q), {
|
|
253
253
|
class: "editor-toolbar",
|
|
254
254
|
editor: t.value,
|
|
255
|
-
defaultConfig:
|
|
255
|
+
defaultConfig: B,
|
|
256
256
|
mode: a.mode
|
|
257
257
|
}, null, 8, ["editor", "mode"]),
|
|
258
|
-
|
|
258
|
+
I(H(W), {
|
|
259
259
|
class: "editor-content",
|
|
260
260
|
style: P({ height: k.value }),
|
|
261
261
|
modelValue: i.value,
|
|
262
|
-
"onUpdate:modelValue":
|
|
263
|
-
defaultConfig:
|
|
262
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => i.value = o),
|
|
263
|
+
defaultConfig: U,
|
|
264
264
|
mode: a.mode,
|
|
265
|
-
onOnCreated:
|
|
265
|
+
onOnCreated: K,
|
|
266
266
|
onOnChange: j,
|
|
267
267
|
onOnDestroyed: E,
|
|
268
268
|
onOnFocus: T,
|
|
@@ -270,7 +270,7 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
270
270
|
}, null, 8, ["style", "modelValue", "mode"])
|
|
271
271
|
]));
|
|
272
272
|
}
|
|
273
|
-
}), se = /* @__PURE__ */ X(Z, [["__scopeId", "data-v-
|
|
273
|
+
}), se = /* @__PURE__ */ X(Z, [["__scopeId", "data-v-4b9e21ef"]]);
|
|
274
274
|
export {
|
|
275
275
|
se as default
|
|
276
276
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./index-D8m0Y8bQ.js");exports.AlummiCommunityList=l.J;exports.AlummiCommunityListPlugin=l.aG;exports.AnimationUtils=l.aQ;exports.ArticleItem=l.j;exports.ArticleItemPlugin=l.ag;exports.ArticleList=l.A;exports.ArticleListPlugin=l.Z;exports.BannerImage=l.B;exports.BannerImagePlugin=l.$;exports.BannerImageWithLink=l.q;exports.BannerImageWithLinkPlugin=l.aq;exports.BannerPage=l.a;exports.BannerPagePlugin=l.a0;exports.BannerQuote=l.i;exports.BannerQuotePlugin=l.af;exports.BasicCollapse=l.x;exports.BasicCollapsePlugin=l.aA;exports.BlessingMessage=l.K;exports.BlessingMessagePlugin=l.aH;exports.BlessingSlider=l.U;exports.BlessingSliderPlugin=l.aI;exports.BtnList=l.b;exports.BtnListPlugin=l.a1;exports.CardCarousel=l.g;exports.CardCarouselArticlesPlugin=l.av;exports.CardCarouselMultiRow=l.h;exports.CardCarouselMultiRowArticles=l.I;exports.CardCarouselMultiRowArticlesPlugin=l.aF;exports.CardCarouselMultiRowPlugin=l.ae;exports.CardCarouselMultiRowPublications=l.Y;exports.CardCarouselMultiRowPublicationsPlugin=l.aM;exports.CardCarouselPlugin=l.ad;exports.CardShowcase=l.V;exports.CardShowcasePlugin=l.aJ;exports.CardShowcaseProfile=l.l;exports.CardShowcaseProfilePlugin=l.al;exports.CarouselLogo=l.t;exports.CarouselLogoPlugin=l.aw;exports.ContactUsInfo=l.r;exports.ContactUsInfoPlugin=l.as;exports.ContactUsList=l.o;exports.ContactUsListPlugin=l.an;exports.CountDown=l.m;exports.CountDownPlugin=l.am;exports.CustomIframe=l.n;exports.CustomIframePlugin=l.ao;exports.CustomSpace=l.C;exports.CustomSpacePlugin=l.a7;exports.Disc=l.w;exports.DiscPlugin=l.az;exports.DonorLinks=l.D;exports.DonorLinksPlugin=l.ac;exports.ExploreLinks=l.W;exports.ExploreLinksPlugin=l.aK;exports.GalleryBlock=l.F;exports.GalleryBlockPlugin=l.aE;exports.GalleryCaptionRound=l.c;exports.GalleryCaptionRoundPlugin=l.a3;exports.GalleryDefault=l.G;exports.GalleryDefaultPlugin=l.a2;exports.GalleryList=l.f;exports.GalleryListPlugin=l.a8;exports.GalleryTimeline=l.d;exports.GalleryTimelineCol=l.e;exports.GalleryTimelineColPlugin=l.a5;exports.GalleryTimelinePlugin=l.a4;exports.HeroSlide=l.H;exports.HeroSlidePlugin=l.a9;exports.LinkList=l.L;exports.LinkListPlugin=l.aa;exports.MapStatic=l.M;exports.MapStaticPlugin=l.au;exports.MediaLogo=l.z;exports.MediaLogoPlugin=l.aC;exports.NewsList=l.N;exports.NewsListPlugin=l.aj;exports.Process=l.P;exports.ProcessPlugin=l.a6;exports.Publications=l.s;exports.PublicationsPlugin=l.at;exports.QuoteText=l.Q;exports.QuoteTextPlugin=l.ab;exports.RegisterForm=l.E;exports.RegisterFormPlugin=l.aD;exports.Resources=l.u;exports.ResourcesPlugin=l.ax;exports.ResourcesTwo=l.v;exports.ResourcesTwoPlugin=l.ay;exports.ResponsiveUtils=l.aP;exports.RibbonBlock=l.R;exports.RibbonBlockPlugin=l.ah;exports.SchoolLayout=l.X;exports.SchoolLayoutPlugin=l.aL;exports.ScrollKeyInfo=l.S;exports.ScrollKeyInfoPlugin=l.ar;exports.StorageUtils=l.aR;exports.TableCollapse=l.y;exports.TableCollapsePlugin=l.aB;exports.TableTwo=l.p;exports.TableTwoPlugin=l.ap;exports.TheHistoryCarousel=l.k;exports.TheHistoryCarouselPlugin=l.ak;exports.ThemeUtils=l.aO;exports.TimelineStory=l.T;exports.TimelineStoryPlugin=l.ai;exports.default=l.O;exports.useTheme=l.aN;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as l, aG as i, aQ as e, j as n, ag as o, A as u, Z as r, B as t, $ as g, q as P, aq as C, a as c, a0 as m, i as L, af as d, x as y, aA as B, K as T, aH as w, U as S, aI as R, b as p, a1 as b, g as f, av as h, h as k, I as G, aF as I, ae as M, Y as A, aM as D, ad as U, V as x, aJ as H, l as Q, al as E, t as F, aw as K, r as N, as as v, o as W, an as j, m as q, am as z, n as J, ao as O, C as V, a7 as X, w as Y, az as Z, D as $, ac as _, W as aa, aK as sa, F as la, aE as ia, c as ea, a3 as na, G as oa, a2 as ua, f as ra, a8 as ta, d as ga, e as Pa, a5 as Ca, a4 as ca, H as ma, a9 as La, L as da, aa as ya, M as Ba, au as Ta, z as wa, aC as Sa, N as Ra, aj as pa, P as ba, a6 as fa, s as ha, at as ka, Q as Ga, ab as Ia, E as Ma, aD as Aa, u as Da, ax as Ua, v as xa, ay as Ha, aP as Qa, R as Ea, ah as Fa, X as Ka, aL as Na, S as va, ar as Wa, aR as ja, y as qa, aB as za, p as Ja, ap as Oa, k as Va, ak as Xa, aO as Ya, T as Za, ai as $a, O as _a, aN as as } from "./index-
|
|
1
|
+
import { J as l, aG as i, aQ as e, j as n, ag as o, A as u, Z as r, B as t, $ as g, q as P, aq as C, a as c, a0 as m, i as L, af as d, x as y, aA as B, K as T, aH as w, U as S, aI as R, b as p, a1 as b, g as f, av as h, h as k, I as G, aF as I, ae as M, Y as A, aM as D, ad as U, V as x, aJ as H, l as Q, al as E, t as F, aw as K, r as N, as as v, o as W, an as j, m as q, am as z, n as J, ao as O, C as V, a7 as X, w as Y, az as Z, D as $, ac as _, W as aa, aK as sa, F as la, aE as ia, c as ea, a3 as na, G as oa, a2 as ua, f as ra, a8 as ta, d as ga, e as Pa, a5 as Ca, a4 as ca, H as ma, a9 as La, L as da, aa as ya, M as Ba, au as Ta, z as wa, aC as Sa, N as Ra, aj as pa, P as ba, a6 as fa, s as ha, at as ka, Q as Ga, ab as Ia, E as Ma, aD as Aa, u as Da, ax as Ua, v as xa, ay as Ha, aP as Qa, R as Ea, ah as Fa, X as Ka, aL as Na, S as va, ar as Wa, aR as ja, y as qa, aB as za, p as Ja, ap as Oa, k as Va, ak as Xa, aO as Ya, T as Za, ai as $a, O as _a, aN as as } from "./index-BehsQJZ_.mjs";
|
|
2
2
|
export {
|
|
3
3
|
l as AlummiCommunityList,
|
|
4
4
|
i as AlummiCommunityListPlugin,
|