officialblock 2.9.6 → 2.9.8
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-CCyqMHag.mjs → index-CH5wxxQU.mjs} +116 -116
- package/dist/index-Cefj1f_r.js +1 -0
- package/dist/{index-BdAKIdHU.mjs → index-DzaQCQTY.mjs} +2599 -2579
- package/dist/{index-CpAk1XyT.js → index-bm04d5OJ.js} +1 -1
- package/dist/{index-CxzvwMQZ.js → index-dKy0JrnP.js} +5 -5
- package/dist/index-usgyrDBH.mjs +4 -0
- package/dist/official-block.cjs.js +1 -1
- package/dist/official-block.es.js +1 -1
- package/dist/official-block.umd.js +105 -105
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-CyjUYG97.js +0 -1
- package/dist/index-DioqR7oU.mjs +0 -4
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { Toolbar as
|
|
6
|
-
import { Boot as
|
|
7
|
-
import { a as
|
|
8
|
-
const
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var T = (a, u, c) => u in a ? j(a, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : a[u] = c;
|
|
3
|
+
var r = (a, u, c) => T(a, typeof u != "symbol" ? u + "" : u, c);
|
|
4
|
+
import { defineComponent as $, shallowRef as R, ref as g, computed as q, inject as C, watch as p, nextTick as y, onBeforeUnmount as J, createElementBlock as P, openBlock as G, createVNode as S, unref as _, normalizeStyle as Q } from "vue";
|
|
5
|
+
import { Toolbar as W, Editor as X } from "@wangeditor/editor-for-vue";
|
|
6
|
+
import { Boot as w } from "@wangeditor/editor";
|
|
7
|
+
import { a as Y } from "./index-DzaQCQTY.mjs";
|
|
8
|
+
const Z = { class: "rich-text-editor" }, ee = /* @__PURE__ */ $({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
11
11
|
name: { default: "" },
|
|
12
12
|
modelValue: { default: "" },
|
|
13
|
-
placeholder: { default:
|
|
13
|
+
placeholder: { default: "Please input content..." },
|
|
14
14
|
height: { default: "400px" },
|
|
15
15
|
mode: { default: "default" },
|
|
16
16
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -19,70 +19,70 @@ const ee = { class: "rich-text-editor" }, te = /* @__PURE__ */ R({
|
|
|
19
19
|
includeKeys: { default: () => [] }
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:modelValue", "change", "focus", "blur", "created", "upload-image", "upload-video"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
}),
|
|
25
|
-
if (!
|
|
22
|
+
setup(a, { expose: u, emit: c }) {
|
|
23
|
+
const n = a, d = c, t = R(), i = g(""), I = q(() => typeof n.height == "number" ? `${n.height}px` : n.height), D = C("handleUpload", () => {
|
|
24
|
+
}), m = C("fileUrl", null), E = C("chooseName", null), F = g(""), f = g(null), b = (e) => {
|
|
25
|
+
if (!D) {
|
|
26
26
|
console.warn("Upload: handleUpload function not provided by ancestor");
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
if (
|
|
29
|
+
if (F.value = e, t.value)
|
|
30
30
|
try {
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const o = t.value.selection;
|
|
32
|
+
o && (f.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
|
+
D(!0, l);
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, { deep: !0, immediate: !0 }),
|
|
51
|
-
() => [
|
|
48
|
+
p(() => n.name, () => {
|
|
49
|
+
m.value = null;
|
|
50
|
+
}, { deep: !0, immediate: !0 }), p(
|
|
51
|
+
() => [m == null ? void 0 : m.value],
|
|
52
52
|
([e]) => {
|
|
53
|
-
const
|
|
54
|
-
!e || !
|
|
55
|
-
var
|
|
56
|
-
if (
|
|
53
|
+
const l = n.name + "_" + F.value;
|
|
54
|
+
!e || !E.value || E.value !== l || t.value && y(() => {
|
|
55
|
+
var o, h;
|
|
56
|
+
if (t.value) {
|
|
57
57
|
try {
|
|
58
|
-
if (
|
|
58
|
+
if (t.value.focus(), f.value)
|
|
59
59
|
try {
|
|
60
|
-
|
|
61
|
-
} catch (
|
|
62
|
-
console.warn("恢复光标位置失败,使用默认位置:",
|
|
60
|
+
t.value.select(f.value);
|
|
61
|
+
} catch (s) {
|
|
62
|
+
console.warn("恢复光标位置失败,使用默认位置:", s);
|
|
63
63
|
}
|
|
64
|
-
} catch (
|
|
65
|
-
console.warn("聚焦编辑器失败:",
|
|
64
|
+
} catch (s) {
|
|
65
|
+
console.warn("聚焦编辑器失败:", s);
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
(
|
|
67
|
+
if (F.value === "img") {
|
|
68
|
+
const v = `<img src="${e}" alt="图片" style="max-width: 100%;">`;
|
|
69
|
+
(o = t.value) == null || o.dangerouslyInsertHtml(v);
|
|
70
70
|
} else {
|
|
71
|
-
const
|
|
72
|
-
(
|
|
71
|
+
const v = `<video src="${e}" controls style="max-width: 100%;"></video>`;
|
|
72
|
+
(h = t.value) == null || h.dangerouslyInsertHtml(v);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
f.value = null, F.value = "";
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
},
|
|
78
78
|
{ immediate: !1 }
|
|
79
79
|
);
|
|
80
|
-
function
|
|
80
|
+
function H(e) {
|
|
81
81
|
return class {
|
|
82
82
|
constructor() {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
r(this, "title");
|
|
84
|
+
r(this, "tag");
|
|
85
|
+
r(this, "iconSvg");
|
|
86
86
|
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>';
|
|
87
87
|
}
|
|
88
88
|
isActive() {
|
|
@@ -95,18 +95,18 @@ const ee = { class: "rich-text-editor" }, te = /* @__PURE__ */ R({
|
|
|
95
95
|
return !1;
|
|
96
96
|
}
|
|
97
97
|
exec() {
|
|
98
|
-
|
|
98
|
+
y(() => {
|
|
99
99
|
console.log("点击了自定义上传图片菜单"), e("img");
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function k(e) {
|
|
105
105
|
return class {
|
|
106
106
|
constructor() {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
r(this, "title");
|
|
108
|
+
r(this, "tag");
|
|
109
|
+
r(this, "iconSvg");
|
|
110
110
|
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>';
|
|
111
111
|
}
|
|
112
112
|
getValue() {
|
|
@@ -119,13 +119,13 @@ const ee = { class: "rich-text-editor" }, te = /* @__PURE__ */ R({
|
|
|
119
119
|
return !1;
|
|
120
120
|
}
|
|
121
121
|
exec() {
|
|
122
|
-
|
|
122
|
+
y(() => {
|
|
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",
|
|
@@ -171,7 +171,7 @@ const ee = { class: "rich-text-editor" }, te = /* @__PURE__ */ R({
|
|
|
171
171
|
"codeBlock"
|
|
172
172
|
//代码块
|
|
173
173
|
]
|
|
174
|
-
},
|
|
174
|
+
}, x = [
|
|
175
175
|
// 5个品牌默认颜色
|
|
176
176
|
"#0032A0",
|
|
177
177
|
"#FF0044",
|
|
@@ -248,16 +248,16 @@ const ee = { class: "rich-text-editor" }, te = /* @__PURE__ */ R({
|
|
|
248
248
|
"#061178",
|
|
249
249
|
"#22075E",
|
|
250
250
|
"#780650"
|
|
251
|
-
],
|
|
252
|
-
placeholder:
|
|
253
|
-
readOnly:
|
|
254
|
-
maxLength:
|
|
251
|
+
], z = {
|
|
252
|
+
placeholder: n.placeholder,
|
|
253
|
+
readOnly: n.disabled,
|
|
254
|
+
maxLength: n.maxLength,
|
|
255
255
|
MENU_CONF: {
|
|
256
256
|
color: {
|
|
257
|
-
colors:
|
|
257
|
+
colors: x
|
|
258
258
|
},
|
|
259
259
|
bgColor: {
|
|
260
|
-
colors:
|
|
260
|
+
colors: x
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
263
|
// --- 新增:自定义选中文字时的气泡菜单 ---
|
|
@@ -279,104 +279,104 @@ const ee = { class: "rich-text-editor" }, te = /* @__PURE__ */ R({
|
|
|
279
279
|
]
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
},
|
|
283
|
-
|
|
282
|
+
}, M = Math.random().toString(36).substring(2, 9), A = `CustomImageMenu_${M}`, V = `CustomVideoMenu_${M}`, K = (e) => {
|
|
283
|
+
t.value = e;
|
|
284
284
|
try {
|
|
285
|
-
const
|
|
286
|
-
key:
|
|
285
|
+
const l = H(b), o = k(b), h = {
|
|
286
|
+
key: A,
|
|
287
287
|
// 使用唯一的 key
|
|
288
288
|
factory() {
|
|
289
|
-
return new
|
|
289
|
+
return new l();
|
|
290
290
|
}
|
|
291
|
-
},
|
|
292
|
-
key:
|
|
291
|
+
}, s = {
|
|
292
|
+
key: V,
|
|
293
293
|
// 使用唯一的 key
|
|
294
294
|
factory() {
|
|
295
|
-
return new
|
|
295
|
+
return new o();
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
|
-
|
|
299
|
-
} catch (
|
|
300
|
-
console.warn("菜单注册失败:",
|
|
298
|
+
w.registerMenu(h), w.registerMenu(s);
|
|
299
|
+
} catch (l) {
|
|
300
|
+
console.warn("菜单注册失败:", l);
|
|
301
301
|
}
|
|
302
|
-
|
|
302
|
+
B.insertKeys = {
|
|
303
303
|
index: 0,
|
|
304
|
-
keys: [
|
|
305
|
-
},
|
|
304
|
+
keys: [A, V]
|
|
305
|
+
}, d("created", e);
|
|
306
306
|
};
|
|
307
|
-
|
|
308
|
-
const e =
|
|
307
|
+
J(() => {
|
|
308
|
+
const e = t.value;
|
|
309
309
|
e != null && e.destroy();
|
|
310
|
-
}),
|
|
311
|
-
() =>
|
|
310
|
+
}), p(
|
|
311
|
+
() => n.modelValue,
|
|
312
312
|
(e) => {
|
|
313
|
-
e !==
|
|
313
|
+
e !== i.value && (i.value = e || "");
|
|
314
314
|
},
|
|
315
315
|
{ immediate: !0 }
|
|
316
316
|
);
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
|
|
317
|
+
const L = (e) => {
|
|
318
|
+
d("update:modelValue", i.value), d("change", e);
|
|
319
|
+
}, N = () => {
|
|
320
|
+
t.value = void 0;
|
|
321
|
+
}, O = (e) => {
|
|
322
|
+
d("focus", e);
|
|
321
323
|
}, U = (e) => {
|
|
322
|
-
|
|
323
|
-
}, j = (e) => {
|
|
324
|
-
m("blur", e);
|
|
324
|
+
d("blur", e);
|
|
325
325
|
};
|
|
326
|
-
return
|
|
327
|
-
editor:
|
|
328
|
-
getHtml: () =>
|
|
326
|
+
return u({
|
|
327
|
+
editor: t,
|
|
328
|
+
getHtml: () => i.value,
|
|
329
329
|
getText: () => {
|
|
330
330
|
var e;
|
|
331
|
-
return ((e =
|
|
331
|
+
return ((e = t.value) == null ? void 0 : e.getText()) || "";
|
|
332
332
|
},
|
|
333
333
|
isEmpty: () => {
|
|
334
334
|
var e;
|
|
335
|
-
return ((e =
|
|
335
|
+
return ((e = t.value) == null ? void 0 : e.isEmpty()) || !0;
|
|
336
336
|
},
|
|
337
337
|
clear: () => {
|
|
338
338
|
var e;
|
|
339
|
-
return (e =
|
|
339
|
+
return (e = t.value) == null ? void 0 : e.clear();
|
|
340
340
|
},
|
|
341
341
|
focus: () => {
|
|
342
342
|
var e;
|
|
343
|
-
return (e =
|
|
343
|
+
return (e = t.value) == null ? void 0 : e.focus();
|
|
344
344
|
},
|
|
345
345
|
blur: () => {
|
|
346
346
|
var e;
|
|
347
|
-
return (e =
|
|
347
|
+
return (e = t.value) == null ? void 0 : e.blur();
|
|
348
348
|
},
|
|
349
349
|
disable: () => {
|
|
350
350
|
var e;
|
|
351
|
-
return (e =
|
|
351
|
+
return (e = t.value) == null ? void 0 : e.disable();
|
|
352
352
|
},
|
|
353
353
|
enable: () => {
|
|
354
354
|
var e;
|
|
355
|
-
return (e =
|
|
355
|
+
return (e = t.value) == null ? void 0 : e.enable();
|
|
356
356
|
}
|
|
357
|
-
}), (e,
|
|
358
|
-
_(
|
|
357
|
+
}), (e, l) => (G(), P("div", Z, [
|
|
358
|
+
S(_(W), {
|
|
359
359
|
class: "editor-toolbar",
|
|
360
|
-
editor:
|
|
361
|
-
defaultConfig:
|
|
362
|
-
mode:
|
|
360
|
+
editor: t.value,
|
|
361
|
+
defaultConfig: B,
|
|
362
|
+
mode: a.mode
|
|
363
363
|
}, null, 8, ["editor", "mode"]),
|
|
364
|
-
_(
|
|
364
|
+
S(_(X), {
|
|
365
365
|
class: "editor-content",
|
|
366
|
-
style:
|
|
367
|
-
modelValue:
|
|
368
|
-
"onUpdate:modelValue":
|
|
369
|
-
defaultConfig:
|
|
370
|
-
mode:
|
|
371
|
-
onOnCreated:
|
|
372
|
-
onOnChange:
|
|
373
|
-
onOnDestroyed:
|
|
374
|
-
onOnFocus:
|
|
375
|
-
onOnBlur:
|
|
366
|
+
style: Q({ height: I.value }),
|
|
367
|
+
modelValue: i.value,
|
|
368
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => i.value = o),
|
|
369
|
+
defaultConfig: z,
|
|
370
|
+
mode: a.mode,
|
|
371
|
+
onOnCreated: K,
|
|
372
|
+
onOnChange: L,
|
|
373
|
+
onOnDestroyed: N,
|
|
374
|
+
onOnFocus: O,
|
|
375
|
+
onOnBlur: U
|
|
376
376
|
}, null, 8, ["style", "modelValue", "mode"])
|
|
377
377
|
]));
|
|
378
378
|
}
|
|
379
|
-
}),
|
|
379
|
+
}), re = /* @__PURE__ */ Y(ee, [["__scopeId", "data-v-e97d4bf7"]]);
|
|
380
380
|
export {
|
|
381
|
-
|
|
381
|
+
re as default
|
|
382
382
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var K=Object.defineProperty;var N=(u,r,i)=>r in u?K(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i;var c=(u,r,i)=>N(u,typeof r!="symbol"?r+"":r,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),M=require("@wangeditor/editor-for-vue"),A=require("@wangeditor/editor"),O=require("./index-dKy0JrnP.js"),T={class:"rich-text-editor"},L=t.defineComponent({__name:"index",props:{name:{default:""},modelValue:{default:""},placeholder:{default:"Please input content..."},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,F=i,o=t.shallowRef(),d=t.ref(""),V=t.computed(()=>typeof a.height=="number"?`${a.height}px`:a.height),C=t.inject("handleUpload",()=>{}),m=t.inject("fileUrl",null),y=t.inject("chooseName",null),f=t.ref(""),h=t.ref(null),p=e=>{if(!C){console.warn("Upload: handleUpload function not provided by ancestor");return}if(f.value=e,o.value)try{const l=o.value.selection;l&&(h.value={anchor:{path:[...l.anchor.path],offset:l.anchor.offset},focus:{path:[...l.focus.path],offset:l.focus.offset}})}catch(l){console.warn("保存光标位置失败:",l)}const n=a.name+"_"+e;C(!0,n)};t.watch(()=>a.name,()=>{m.value=null},{deep:!0,immediate:!0}),t.watch(()=>[m==null?void 0:m.value],([e])=>{const n=a.name+"_"+f.value;!e||!y.value||y.value!==n||o.value&&t.nextTick(()=>{var l,v;if(o.value){try{if(o.value.focus(),h.value)try{o.value.select(h.value)}catch(s){console.warn("恢复光标位置失败,使用默认位置:",s)}}catch(s){console.warn("聚焦编辑器失败:",s)}if(f.value==="img"){const g=`<img src="${e}" alt="图片" style="max-width: 100%;">`;(l=o.value)==null||l.dangerouslyInsertHtml(g)}else{const g=`<video src="${e}" controls style="max-width: 100%;"></video>`;(v=o.value)==null||v.dangerouslyInsertHtml(g)}h.value=null,f.value=""}})},{immediate:!1});function S(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 w(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 D={toolbarKeys:["headerSelect","bold","italic","through","underline","color","fontSize","lineHeight","delIndent","indent","divider","insertTable","justifyCenter","justifyJustify","justifyLeft","justifyRight","bulletedList","numberedList","undo","redo","clearStyle","codeBlock"]},E=["#0032A0","#FF0044","#FF8200","#001E60","#E3E3E6","#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E8E8E8","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96","#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB","#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2","#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB","#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F","#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"],k={placeholder:a.placeholder,readOnly:a.disabled,maxLength:a.maxLength,MENU_CONF:{color:{colors:E},bgColor:{colors:E}},hoverbarKeys:{text:{menuKeys:["headerSelect","insertLink","bold","italic","underline","through","clearStyle"]}}},b=Math.random().toString(36).substring(2,9),B=`CustomImageMenu_${b}`,x=`CustomVideoMenu_${b}`,I=e=>{o.value=e;try{const n=S(p),l=w(p),v={key:B,factory(){return new n}},s={key:x,factory(){return new l}};A.Boot.registerMenu(v),A.Boot.registerMenu(s)}catch(n){console.warn("菜单注册失败:",n)}D.insertKeys={index:0,keys:[B,x]},F("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 H=e=>{F("update:modelValue",d.value),F("change",e)},_=()=>{o.value=void 0},j=e=>{F("focus",e)},z=e=>{F("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,n)=>(t.openBlock(),t.createElementBlock("div",T,[t.createVNode(t.unref(M.Toolbar),{class:"editor-toolbar",editor:o.value,defaultConfig:D,mode:u.mode},null,8,["editor","mode"]),t.createVNode(t.unref(M.Editor),{class:"editor-content",style:t.normalizeStyle({height:V.value}),modelValue:d.value,"onUpdate:modelValue":n[0]||(n[0]=l=>d.value=l),defaultConfig:k,mode:u.mode,onOnCreated:I,onOnChange:H,onOnDestroyed:_,onOnFocus:j,onOnBlur:z},null,8,["style","modelValue","mode"])]))}}),U=O.a(L,[["__scopeId","data-v-e97d4bf7"]]);exports.default=U;
|