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.
@@ -1,10 +1,10 @@
1
- var D = Object.defineProperty;
2
- var L = (a, u, c) => u in a ? D(a, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : a[u] = c;
3
- var r = (a, u, c) => L(a, typeof u != "symbol" ? u + "" : u, c);
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 z } from "@wangeditor/editor";
7
- import { a as X } from "./index-CxDMH1MH.mjs";
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: c }) {
23
- const n = a, d = c, t = R(), i = p(""), k = F(() => typeof n.height == "number" ? `${n.height}px` : n.height), x = y("handleUpload", () => {
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 N(e) {
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 O(e) {
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 B = {
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
- }, U = {
174
+ }, N = {
172
175
  placeholder: n.placeholder,
173
176
  readOnly: n.disabled,
174
177
  maxLength: n.maxLength,
175
- MENU_CONF: {}
176
- }, S = Math.random().toString(36).substring(2, 9), _ = `CustomImageMenu_${S}`, w = `CustomVideoMenu_${S}`, K = (e) => {
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 = N(V), o = O(V), v = {
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
- z.registerMenu(v), z.registerMenu(s);
214
+ k.registerMenu(v), k.registerMenu(s);
193
215
  } catch (l) {
194
216
  console.warn("菜单注册失败:", l);
195
217
  }
196
- B.insertKeys = {
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 !== i.value && (i.value = e || "");
229
+ e !== c.value && (c.value = e || "");
208
230
  },
209
231
  { immediate: !0 }
210
232
  );
211
- const j = (e) => {
212
- d("update:modelValue", i.value), d("change", e);
213
- }, E = () => {
233
+ const U = (e) => {
234
+ d("update:modelValue", c.value), d("change", e);
235
+ }, j = () => {
214
236
  t.value = void 0;
215
- }, T = (e) => {
237
+ }, E = (e) => {
216
238
  d("focus", e);
217
- }, $ = (e) => {
239
+ }, T = (e) => {
218
240
  d("blur", e);
219
241
  };
220
242
  return u({
221
243
  editor: t,
222
- getHtml: () => i.value,
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: B,
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: k.value }),
261
- modelValue: i.value,
262
- "onUpdate:modelValue": l[0] || (l[0] = (o) => i.value = o),
263
- defaultConfig: U,
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: K,
266
- onOnChange: j,
267
- onOnDestroyed: E,
268
- onOnFocus: T,
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-e8d1a61b"]]);
295
+ }), se = /* @__PURE__ */ X(Z, [["__scopeId", "data-v-55807020"]]);
274
296
  export {
275
297
  se as default
276
298
  };