officialblock 1.8.4 → 1.8.6
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-CXOWxR2L.mjs → index-B898HGW2.mjs} +78 -88
- package/dist/index-BDlwVUIL.js +16 -0
- package/dist/{index-DmjHG1Mk.mjs → index-BZXCZXXX.mjs} +7839 -7550
- package/dist/index-GBBND-Sa.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 +4 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-B00sdBWG.js +0 -1
- package/dist/index-BVmrkk8g.js +0 -16
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import "@wangeditor/editor-for-vue";
|
|
6
|
-
import { Boot as
|
|
7
|
-
import { _ as G } from "./index-
|
|
8
|
-
const
|
|
9
|
-
__name: "
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var D = (o, l, u) => l in o ? T(o, l, { enumerable: !0, configurable: !0, writable: !0, value: u }) : o[l] = u;
|
|
3
|
+
var s = (o, l, u) => D(o, typeof l != "symbol" ? l + "" : l, u);
|
|
4
|
+
import { defineComponent as F, shallowRef as K, ref as b, computed as L, inject as f, watch as x, onBeforeUnmount as A, createElementBlock as R, openBlock as $, createVNode as C, unref as M, normalizeStyle as N, nextTick as V } from "vue";
|
|
5
|
+
import { Toolbar as J, Editor as q } from "@wangeditor/editor-for-vue";
|
|
6
|
+
import { Boot as w } from "@wangeditor/editor";
|
|
7
|
+
import { _ as G } from "./index-BZXCZXXX.mjs";
|
|
8
|
+
const P = { class: "rich-text-editor" }, Q = /* @__PURE__ */ F({
|
|
9
|
+
__name: "index",
|
|
10
10
|
props: {
|
|
11
11
|
name: { default: "" },
|
|
12
12
|
modelValue: { default: "" },
|
|
@@ -19,68 +19,68 @@ const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
19
19
|
includeKeys: { default: () => [] }
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:modelValue", "change", "focus", "blur", "created", "upload-image", "upload-video"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
}), m =
|
|
25
|
-
if (!
|
|
22
|
+
setup(o, { expose: l, emit: u }) {
|
|
23
|
+
const a = o, d = u, t = K(), i = b(""), B = L(() => typeof a.height == "number" ? `${a.height}px` : a.height), g = f("handleUpload", () => {
|
|
24
|
+
}), m = f("fileUrl", null), h = f("chooseName", null), c = b(""), v = () => {
|
|
25
|
+
if (!g) {
|
|
26
26
|
console.warn("Upload: handleUpload function not provided by ancestor");
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
g(!0, a.name + c.value);
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
x(
|
|
32
32
|
() => [m == null ? void 0 : m.value, h == null ? void 0 : h.value],
|
|
33
|
-
([e,
|
|
34
|
-
var r,
|
|
35
|
-
!e || !
|
|
33
|
+
([e, n]) => {
|
|
34
|
+
var r, p;
|
|
35
|
+
!e || !n || n !== a.name + c.value || (c.value === "img" ? (r = t.value) == null || r.dangerouslyInsertHtml('<img src="https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg" alt="图片" style="max-width: 100%;">') : (p = t.value) == null || p.dangerouslyInsertHtml('<video src="https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg" controls style="max-width: 100%;"></video>'));
|
|
36
36
|
},
|
|
37
37
|
{ immediate: !1 }
|
|
38
38
|
);
|
|
39
|
-
class
|
|
39
|
+
class S {
|
|
40
40
|
constructor() {
|
|
41
41
|
s(this, "title");
|
|
42
42
|
s(this, "tag");
|
|
43
43
|
s(this, "iconSvg");
|
|
44
44
|
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>';
|
|
45
45
|
}
|
|
46
|
-
isActive(
|
|
46
|
+
isActive() {
|
|
47
47
|
return !1;
|
|
48
48
|
}
|
|
49
|
-
getValue(
|
|
49
|
+
getValue() {
|
|
50
50
|
return "";
|
|
51
51
|
}
|
|
52
|
-
isDisabled(
|
|
52
|
+
isDisabled() {
|
|
53
53
|
return !1;
|
|
54
54
|
}
|
|
55
|
-
exec(
|
|
56
|
-
|
|
57
|
-
console.log("点击了自定义上传图片菜单"), c.value = "img",
|
|
55
|
+
exec() {
|
|
56
|
+
V(() => {
|
|
57
|
+
console.log("点击了自定义上传图片菜单"), c.value = "img", v();
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
class
|
|
61
|
+
class j {
|
|
62
62
|
constructor() {
|
|
63
63
|
s(this, "title");
|
|
64
64
|
s(this, "tag");
|
|
65
65
|
s(this, "iconSvg");
|
|
66
66
|
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>';
|
|
67
67
|
}
|
|
68
|
-
getValue(
|
|
68
|
+
getValue() {
|
|
69
69
|
return "";
|
|
70
70
|
}
|
|
71
|
-
isActive(
|
|
71
|
+
isActive() {
|
|
72
72
|
return !1;
|
|
73
73
|
}
|
|
74
|
-
isDisabled(
|
|
74
|
+
isDisabled() {
|
|
75
75
|
return !1;
|
|
76
76
|
}
|
|
77
|
-
exec(
|
|
78
|
-
|
|
79
|
-
c.value = "video",
|
|
77
|
+
exec() {
|
|
78
|
+
V(() => {
|
|
79
|
+
c.value = "video", v();
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const y = {
|
|
84
84
|
toolbarKeys: [
|
|
85
85
|
// 菜单 key
|
|
86
86
|
"headerSelect",
|
|
@@ -124,113 +124,103 @@ const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
124
124
|
//代码块
|
|
125
125
|
]
|
|
126
126
|
}, H = {
|
|
127
|
-
placeholder:
|
|
128
|
-
readOnly:
|
|
129
|
-
maxLength:
|
|
127
|
+
placeholder: a.placeholder,
|
|
128
|
+
readOnly: a.disabled,
|
|
129
|
+
maxLength: a.maxLength,
|
|
130
130
|
MENU_CONF: {}
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
const
|
|
131
|
+
}, z = (e) => {
|
|
132
|
+
t.value = e;
|
|
133
|
+
const n = {
|
|
134
134
|
key: "CustomImageMenu",
|
|
135
135
|
// 定义 menu key :要保证唯一、不重复(重要)
|
|
136
136
|
factory() {
|
|
137
|
-
return new
|
|
137
|
+
return new S();
|
|
138
138
|
}
|
|
139
139
|
}, r = {
|
|
140
140
|
key: "CustomVideoMenu",
|
|
141
141
|
// 定义 menu key :要保证唯一、不重复(重要)
|
|
142
142
|
factory() {
|
|
143
|
-
return new
|
|
143
|
+
return new j();
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
|
-
|
|
146
|
+
w.registerMenu(n), w.registerMenu(r), y.insertKeys = {
|
|
147
147
|
index: 0,
|
|
148
148
|
keys: ["CustomImageMenu", "CustomVideoMenu"]
|
|
149
149
|
}, d("created", e);
|
|
150
150
|
};
|
|
151
|
-
|
|
152
|
-
const e =
|
|
151
|
+
A(() => {
|
|
152
|
+
const e = t.value;
|
|
153
153
|
e != null && e.destroy();
|
|
154
|
-
}),
|
|
155
|
-
() =>
|
|
154
|
+
}), x(
|
|
155
|
+
() => a.modelValue,
|
|
156
156
|
(e) => {
|
|
157
|
-
e !==
|
|
157
|
+
e !== i.value && (i.value = e || "");
|
|
158
158
|
},
|
|
159
159
|
{ immediate: !0 }
|
|
160
160
|
);
|
|
161
|
-
const
|
|
162
|
-
d("update:modelValue",
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
},
|
|
161
|
+
const I = (e) => {
|
|
162
|
+
d("update:modelValue", i.value), d("change", e);
|
|
163
|
+
}, U = () => {
|
|
164
|
+
t.value = void 0;
|
|
165
|
+
}, _ = (e) => {
|
|
166
166
|
d("focus", e);
|
|
167
167
|
}, k = (e) => {
|
|
168
168
|
d("blur", e);
|
|
169
169
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
const e = await import("@wangeditor/editor-for-vue");
|
|
175
|
-
b = e.Editor, x = e.Toolbar, await Promise.resolve().then(() => Q), S.value = !0;
|
|
176
|
-
} catch (e) {
|
|
177
|
-
console.error("编辑器加载失败:", e);
|
|
178
|
-
}
|
|
179
|
-
}), a({
|
|
180
|
-
editor: o,
|
|
181
|
-
getHtml: () => u.value,
|
|
170
|
+
return l({
|
|
171
|
+
editor: t,
|
|
172
|
+
getHtml: () => i.value,
|
|
182
173
|
getText: () => {
|
|
183
174
|
var e;
|
|
184
|
-
return ((e =
|
|
175
|
+
return ((e = t.value) == null ? void 0 : e.getText()) || "";
|
|
185
176
|
},
|
|
186
177
|
isEmpty: () => {
|
|
187
178
|
var e;
|
|
188
|
-
return ((e =
|
|
179
|
+
return ((e = t.value) == null ? void 0 : e.isEmpty()) || !0;
|
|
189
180
|
},
|
|
190
181
|
clear: () => {
|
|
191
182
|
var e;
|
|
192
|
-
return (e =
|
|
183
|
+
return (e = t.value) == null ? void 0 : e.clear();
|
|
193
184
|
},
|
|
194
185
|
focus: () => {
|
|
195
186
|
var e;
|
|
196
|
-
return (e =
|
|
187
|
+
return (e = t.value) == null ? void 0 : e.focus();
|
|
197
188
|
},
|
|
198
189
|
blur: () => {
|
|
199
190
|
var e;
|
|
200
|
-
return (e =
|
|
191
|
+
return (e = t.value) == null ? void 0 : e.blur();
|
|
201
192
|
},
|
|
202
193
|
disable: () => {
|
|
203
194
|
var e;
|
|
204
|
-
return (e =
|
|
195
|
+
return (e = t.value) == null ? void 0 : e.disable();
|
|
205
196
|
},
|
|
206
197
|
enable: () => {
|
|
207
198
|
var e;
|
|
208
|
-
return (e =
|
|
199
|
+
return (e = t.value) == null ? void 0 : e.enable();
|
|
209
200
|
}
|
|
210
|
-
}), (e,
|
|
211
|
-
M(
|
|
201
|
+
}), (e, n) => ($(), R("div", P, [
|
|
202
|
+
C(M(J), {
|
|
212
203
|
class: "editor-toolbar",
|
|
213
|
-
editor:
|
|
214
|
-
defaultConfig:
|
|
215
|
-
mode:
|
|
204
|
+
editor: t.value,
|
|
205
|
+
defaultConfig: y,
|
|
206
|
+
mode: o.mode
|
|
216
207
|
}, null, 8, ["editor", "mode"]),
|
|
217
|
-
M(
|
|
208
|
+
C(M(q), {
|
|
218
209
|
class: "editor-content",
|
|
219
|
-
style:
|
|
220
|
-
modelValue:
|
|
221
|
-
"onUpdate:modelValue":
|
|
210
|
+
style: N({ height: B.value }),
|
|
211
|
+
modelValue: i.value,
|
|
212
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => i.value = r),
|
|
222
213
|
defaultConfig: H,
|
|
223
|
-
mode:
|
|
224
|
-
onOnCreated:
|
|
225
|
-
onOnChange:
|
|
226
|
-
onOnDestroyed:
|
|
227
|
-
onOnFocus:
|
|
214
|
+
mode: o.mode,
|
|
215
|
+
onOnCreated: z,
|
|
216
|
+
onOnChange: I,
|
|
217
|
+
onOnDestroyed: U,
|
|
218
|
+
onOnFocus: _,
|
|
228
219
|
onOnBlur: k
|
|
229
220
|
}, null, 8, ["style", "modelValue", "mode"])
|
|
230
221
|
]));
|
|
231
222
|
}
|
|
232
|
-
}),
|
|
223
|
+
}), te = /* @__PURE__ */ G(Q, [["__scopeId", "data-v-b409e38f"]]);
|
|
233
224
|
export {
|
|
234
|
-
|
|
235
|
-
le as default
|
|
225
|
+
te as default
|
|
236
226
|
};
|