officialblock 2.2.6 → 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-Yvkp7IRe.js → index-BLsbfAU6.js} +33 -33
- package/dist/{index-BlhIDKnv.mjs → index-BTFpLRds.mjs} +56 -34
- package/dist/{index-CxDMH1MH.mjs → index-C-4UlO21.mjs} +9804 -9794
- package/dist/{index-CSB-f2SH.js → index-CpOxLWqv.js} +1 -1
- 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 +1 -1
- package/dist/official-block.umd.js +31 -31
- package/package.json +1 -1
- package/dist/index-BmST88vq.mjs +0 -4
- package/dist/index-DhZdVJgn.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (a, u,
|
|
1
|
+
var $ = Object.defineProperty;
|
|
2
|
+
var D = (a, u, i) => u in a ? $(a, u, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[u] = i;
|
|
3
|
+
var r = (a, u, i) => D(a, typeof u != "symbol" ? u + "" : u, i);
|
|
4
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
|
-
import { Boot as
|
|
7
|
-
import { a as X } from "./index-
|
|
6
|
+
import { Boot as k } from "@wangeditor/editor";
|
|
7
|
+
import { a as X } from "./index-C-4UlO21.mjs";
|
|
8
8
|
const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
@@ -19,8 +19,8 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
19
19
|
includeKeys: { default: () => [] }
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:modelValue", "change", "focus", "blur", "created", "upload-image", "upload-video"],
|
|
22
|
-
setup(a, { expose: u, emit:
|
|
23
|
-
const n = a, d =
|
|
22
|
+
setup(a, { expose: u, emit: i }) {
|
|
23
|
+
const n = a, d = i, t = R(), c = p(""), z = F(() => typeof n.height == "number" ? `${n.height}px` : n.height), x = y("handleUpload", () => {
|
|
24
24
|
}), m = y("fileUrl", null), M = y("chooseName", null), f = p(""), h = p(null), V = (e) => {
|
|
25
25
|
if (!x) {
|
|
26
26
|
console.warn("Upload: handleUpload function not provided by ancestor");
|
|
@@ -77,7 +77,7 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
77
77
|
},
|
|
78
78
|
{ immediate: !1 }
|
|
79
79
|
);
|
|
80
|
-
function
|
|
80
|
+
function K(e) {
|
|
81
81
|
return class {
|
|
82
82
|
constructor() {
|
|
83
83
|
r(this, "title");
|
|
@@ -101,7 +101,7 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function L(e) {
|
|
105
105
|
return class {
|
|
106
106
|
constructor() {
|
|
107
107
|
r(this, "title");
|
|
@@ -125,7 +125,7 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const S = {
|
|
129
129
|
toolbarKeys: [
|
|
130
130
|
// 菜单 key
|
|
131
131
|
"headerSelect",
|
|
@@ -159,6 +159,9 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
159
159
|
// 左对齐
|
|
160
160
|
"justifyRight",
|
|
161
161
|
// 右对齐
|
|
162
|
+
"bulletedList",
|
|
163
|
+
"numberedList",
|
|
164
|
+
// 列表
|
|
162
165
|
"undo",
|
|
163
166
|
// 撤销
|
|
164
167
|
"redo",
|
|
@@ -168,15 +171,34 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
168
171
|
"codeBlock"
|
|
169
172
|
//代码块
|
|
170
173
|
]
|
|
171
|
-
},
|
|
174
|
+
}, N = {
|
|
172
175
|
placeholder: n.placeholder,
|
|
173
176
|
readOnly: n.disabled,
|
|
174
177
|
maxLength: n.maxLength,
|
|
175
|
-
MENU_CONF: {}
|
|
176
|
-
|
|
178
|
+
MENU_CONF: {},
|
|
179
|
+
// --- 新增:自定义选中文字时的气泡菜单 ---
|
|
180
|
+
hoverbarKeys: {
|
|
181
|
+
// text 类型代表选中文字时弹出的菜单
|
|
182
|
+
text: {
|
|
183
|
+
// 通过配置来覆盖默认菜单
|
|
184
|
+
// 我们重新定义 key 列表,排除掉 'color' (文字颜色) 和 'bgColor' (背景色)
|
|
185
|
+
menuKeys: [
|
|
186
|
+
"headerSelect",
|
|
187
|
+
"insertLink",
|
|
188
|
+
"bold",
|
|
189
|
+
"italic",
|
|
190
|
+
"underline",
|
|
191
|
+
"through",
|
|
192
|
+
// 'color', <-- 去掉这两个
|
|
193
|
+
// 'bgColor', <-- 去掉这两个
|
|
194
|
+
"clearStyle"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}, B = Math.random().toString(36).substring(2, 9), _ = `CustomImageMenu_${B}`, w = `CustomVideoMenu_${B}`, O = (e) => {
|
|
177
199
|
t.value = e;
|
|
178
200
|
try {
|
|
179
|
-
const l =
|
|
201
|
+
const l = K(V), o = L(V), v = {
|
|
180
202
|
key: _,
|
|
181
203
|
// 使用唯一的 key
|
|
182
204
|
factory() {
|
|
@@ -189,11 +211,11 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
189
211
|
return new o();
|
|
190
212
|
}
|
|
191
213
|
};
|
|
192
|
-
|
|
214
|
+
k.registerMenu(v), k.registerMenu(s);
|
|
193
215
|
} catch (l) {
|
|
194
216
|
console.warn("菜单注册失败:", l);
|
|
195
217
|
}
|
|
196
|
-
|
|
218
|
+
S.insertKeys = {
|
|
197
219
|
index: 0,
|
|
198
220
|
keys: [_, w]
|
|
199
221
|
}, d("created", e);
|
|
@@ -204,22 +226,22 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
204
226
|
}), C(
|
|
205
227
|
() => n.modelValue,
|
|
206
228
|
(e) => {
|
|
207
|
-
e !==
|
|
229
|
+
e !== c.value && (c.value = e || "");
|
|
208
230
|
},
|
|
209
231
|
{ immediate: !0 }
|
|
210
232
|
);
|
|
211
|
-
const
|
|
212
|
-
d("update:modelValue",
|
|
213
|
-
},
|
|
233
|
+
const U = (e) => {
|
|
234
|
+
d("update:modelValue", c.value), d("change", e);
|
|
235
|
+
}, j = () => {
|
|
214
236
|
t.value = void 0;
|
|
215
|
-
},
|
|
237
|
+
}, E = (e) => {
|
|
216
238
|
d("focus", e);
|
|
217
|
-
},
|
|
239
|
+
}, T = (e) => {
|
|
218
240
|
d("blur", e);
|
|
219
241
|
};
|
|
220
242
|
return u({
|
|
221
243
|
editor: t,
|
|
222
|
-
getHtml: () =>
|
|
244
|
+
getHtml: () => c.value,
|
|
223
245
|
getText: () => {
|
|
224
246
|
var e;
|
|
225
247
|
return ((e = t.value) == null ? void 0 : e.getText()) || "";
|
|
@@ -252,25 +274,25 @@ const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
|
|
|
252
274
|
I(H(Q), {
|
|
253
275
|
class: "editor-toolbar",
|
|
254
276
|
editor: t.value,
|
|
255
|
-
defaultConfig:
|
|
277
|
+
defaultConfig: S,
|
|
256
278
|
mode: a.mode
|
|
257
279
|
}, null, 8, ["editor", "mode"]),
|
|
258
280
|
I(H(W), {
|
|
259
281
|
class: "editor-content",
|
|
260
|
-
style: P({ height:
|
|
261
|
-
modelValue:
|
|
262
|
-
"onUpdate:modelValue": l[0] || (l[0] = (o) =>
|
|
263
|
-
defaultConfig:
|
|
282
|
+
style: P({ height: z.value }),
|
|
283
|
+
modelValue: c.value,
|
|
284
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => c.value = o),
|
|
285
|
+
defaultConfig: N,
|
|
264
286
|
mode: a.mode,
|
|
265
|
-
onOnCreated:
|
|
266
|
-
onOnChange:
|
|
267
|
-
onOnDestroyed:
|
|
268
|
-
onOnFocus:
|
|
269
|
-
onOnBlur:
|
|
287
|
+
onOnCreated: O,
|
|
288
|
+
onOnChange: U,
|
|
289
|
+
onOnDestroyed: j,
|
|
290
|
+
onOnFocus: E,
|
|
291
|
+
onOnBlur: T
|
|
270
292
|
}, null, 8, ["style", "modelValue", "mode"])
|
|
271
293
|
]));
|
|
272
294
|
}
|
|
273
|
-
}), se = /* @__PURE__ */ X(Z, [["__scopeId", "data-v-
|
|
295
|
+
}), se = /* @__PURE__ */ X(Z, [["__scopeId", "data-v-55807020"]]);
|
|
274
296
|
export {
|
|
275
297
|
se as default
|
|
276
298
|
};
|