@kungal/editor-vue 0.32.1 → 0.34.0

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.js CHANGED
@@ -1,68 +1,68 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, guardReactiveProps as c, inject as l, nextTick as u, normalizeProps as d, onBeforeUnmount as f, onMounted as p, openBlock as m, provide as h, reactive as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, unref as x, vShow as S, watch as C, withCtx as w, withDirectives as T, withModifiers as E } from "vue";
2
- import { Milkdown as D, MilkdownProvider as O, useEditor as k, useInstance as A } from "@milkdown/vue";
3
- import { ProsemirrorAdapterProvider as j, usePluginViewContext as M, usePluginViewFactory as N } from "@prosemirror-adapter/vue";
4
- import { parseHeadings as P, parseHeadings as ee } from "@kungal/editor-core";
5
- import { Editor as F, defaultValueCtx as I, editorViewCtx as L, editorViewOptionsCtx as R, rootCtx as z } from "@milkdown/kit/core";
6
- import { listenerCtx as B } from "@milkdown/kit/plugin/listener";
7
- import { SlashProvider as V, slashFactory as H } from "@milkdown/kit/plugin/slash";
8
- import { TooltipProvider as te, tooltipFactory as U } from "@milkdown/kit/plugin/tooltip";
9
- import { $prose as ne, callCommand as W, replaceAll as G } from "@milkdown/kit/utils";
10
- import { Plugin as K, PluginKey as q, TextSelection as re } from "@milkdown/kit/prose/state";
11
- import { createCodeBlockCommand as ie, emphasisSchema as ae, inlineCodeSchema as J, insertHrCommand as oe, insertImageCommand as se, strongSchema as ce, toggleEmphasisCommand as le, toggleInlineCodeCommand as ue, toggleStrongCommand as de, wrapInBlockquoteCommand as fe, wrapInBulletListCommand as pe, wrapInOrderedListCommand as me } from "@milkdown/kit/preset/commonmark";
12
- import { createKunEditorPlugins as he, insertKunSpoilerCommand as ge, insertLinkCommand as _e, insertMentionCommand as ve, insertQuoteCommand as ye, kunCM as be, mentionId as xe, setHeadingCommand as Se, startImageUpload as Ce } from "@kungal/editor-core/preset";
13
- import { strikethroughSchema as we, toggleStrikethroughCommand as Te } from "@milkdown/kit/preset/gfm";
14
- import { Annotation as Ee, EditorState as De } from "@codemirror/state";
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, guardReactiveProps as c, inject as l, nextTick as u, normalizeProps as d, onBeforeUnmount as f, onMounted as p, openBlock as m, provide as h, reactive as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, unref as x, vModelText as S, vShow as C, watch as w, withCtx as T, withDirectives as E, withKeys as D, withModifiers as O } from "vue";
2
+ import { Milkdown as k, MilkdownProvider as A, useEditor as j, useInstance as M } from "@milkdown/vue";
3
+ import { ProsemirrorAdapterProvider as N, usePluginViewContext as ee, usePluginViewFactory as P } from "@prosemirror-adapter/vue";
4
+ import { parseHeadings as F, parseHeadings as I } from "@kungal/editor-core";
5
+ import { Editor as L, defaultValueCtx as te, editorViewCtx as R, editorViewOptionsCtx as z, rootCtx as B } from "@milkdown/kit/core";
6
+ import { listenerCtx as ne } from "@milkdown/kit/plugin/listener";
7
+ import { SlashProvider as re, slashFactory as V } from "@milkdown/kit/plugin/slash";
8
+ import { TooltipProvider as ie, tooltipFactory as H } from "@milkdown/kit/plugin/tooltip";
9
+ import { $prose as U, callCommand as W, replaceAll as G } from "@milkdown/kit/utils";
10
+ import { Plugin as ae, PluginKey as oe, TextSelection as K } from "@milkdown/kit/prose/state";
11
+ import { createCodeBlockCommand as q, emphasisSchema as se, inlineCodeSchema as ce, insertHrCommand as le, insertImageCommand as ue, linkSchema as de, strongSchema as fe, toggleEmphasisCommand as pe, toggleInlineCodeCommand as me, toggleStrongCommand as he, wrapInBlockquoteCommand as ge, wrapInBulletListCommand as _e, wrapInOrderedListCommand as ve } from "@milkdown/kit/preset/commonmark";
12
+ import { createKunEditorPlugins as ye, insertKunSpoilerCommand as be, insertLinkCommand as J, insertMentionCommand as xe, insertQuoteCommand as Se, kunCM as Ce, mentionId as we, setHeadingCommand as Te, startImageUpload as Ee } from "@kungal/editor-core/preset";
13
+ import { strikethroughSchema as De, toggleStrikethroughCommand as Oe } from "@milkdown/kit/preset/gfm";
14
+ import { Annotation as ke, EditorState as Ae } from "@codemirror/state";
15
15
  import { EditorView as Y } from "@codemirror/view";
16
- import { markdown as Oe } from "@codemirror/lang-markdown";
17
- import { basicSetup as ke } from "codemirror";
16
+ import { markdown as je } from "@codemirror/lang-markdown";
17
+ import { basicSetup as Me } from "codemirror";
18
18
  //#region src/active-marks.ts
19
- var Ae = [
19
+ var Ne = [
20
20
  "bold",
21
21
  "italic",
22
22
  "strike",
23
23
  "code"
24
- ], je = {
25
- bold: ce,
26
- italic: ae,
27
- strike: we,
28
- code: J
29
- }, Me = () => ({
24
+ ], Pe = {
25
+ bold: fe,
26
+ italic: se,
27
+ strike: De,
28
+ code: ce
29
+ }, Fe = () => ({
30
30
  bold: !1,
31
31
  italic: !1,
32
32
  strike: !1,
33
33
  code: !1
34
- }), Ne = Object.freeze(Me()), Pe = (e, t) => {
35
- let { from: n, $from: r, to: i, empty: a } = e.selection, o = Me();
36
- for (let s of Ae) {
37
- let c = je[s].type(t);
34
+ }), Ie = Object.freeze(Fe()), Le = (e, t) => {
35
+ let { from: n, $from: r, to: i, empty: a } = e.selection, o = Fe();
36
+ for (let s of Ne) {
37
+ let c = Pe[s].type(t);
38
38
  o[s] = a ? !!c.isInSet(e.storedMarks ?? r.marks()) : e.doc.rangeHasMark(n, i, c);
39
39
  }
40
40
  return o;
41
- }, Fe = (e, t, n) => {
42
- let r = Pe(e, t);
43
- for (let e of Ae) n[e] !== r[e] && (n[e] = r[e]);
44
- }, Ie = new q("KUN_ACTIVE_MARKS"), Le = (e) => ne((t) => new K({
45
- key: Ie,
46
- view: (n) => (Fe(n.state, t, e), { update(n) {
47
- Fe(n.state, t, e);
41
+ }, Re = (e, t, n) => {
42
+ let r = Le(e, t);
43
+ for (let e of Ne) n[e] !== r[e] && (n[e] = r[e]);
44
+ }, ze = new oe("KUN_ACTIVE_MARKS"), Be = (e) => U((t) => new ae({
45
+ key: ze,
46
+ view: (n) => (Re(n.state, t, e), { update(n) {
47
+ Re(n.state, t, e);
48
48
  } })
49
- })), X = Symbol("kun-editor-context"), Re = [
49
+ })), X = Symbol("kun-editor-context"), Ve = [
50
50
  "data-active",
51
51
  "onMousedown",
52
52
  "onMouseenter"
53
- ], ze = ["src", "alt"], Be = {
53
+ ], He = ["src", "alt"], Ue = {
54
54
  key: 1,
55
55
  class: "kun-mention-dropdown__avatar kun-mention-dropdown__avatar--fallback"
56
- }, Ve = { class: "kun-mention-dropdown__name" }, He = {
56
+ }, We = { class: "kun-mention-dropdown__name" }, Ge = {
57
57
  key: 1,
58
58
  class: "kun-mention-dropdown__hint"
59
- }, Ue = {
59
+ }, Ke = {
60
60
  key: 2,
61
61
  class: "kun-mention-dropdown__hint"
62
- }, We = {
62
+ }, qe = {
63
63
  key: 3,
64
64
  class: "kun-mention-dropdown__hint"
65
- }, Ge = /* @__PURE__ */ s({
65
+ }, Je = /* @__PURE__ */ s({
66
66
  __name: "MentionDropdown",
67
67
  setup(n) {
68
68
  let r = /(?:^|\s)@([^\s@]{0,30})$/, o = l(X), s = o?.adapters.searchMentionUsers, c = t(() => (o?.locale ?? "zh-cn").toLowerCase().startsWith("en")), u = t(() => c.value ? {
@@ -73,51 +73,51 @@ var Ae = [
73
73
  searching: "搜索中…",
74
74
  empty: "无匹配用户",
75
75
  prompt: "输入用户名以搜索"
76
- }), { view: d, prevState: h } = M(), g = _(null), y, x = _(!1), S = _(""), w = _([]), T = _(0), D = _(!1), O = null, k = 0, A = null, j = () => {
77
- A &&= (clearTimeout(A), null), S.value = "", w.value = [], T.value = 0, D.value = !1, O = null;
78
- }, N = (e) => {
76
+ }), { view: d, prevState: h } = ee(), g = _(null), y, x = _(!1), S = _(""), C = _([]), T = _(0), E = _(!1), D = null, k = 0, A = null, j = () => {
77
+ A &&= (clearTimeout(A), null), S.value = "", C.value = [], T.value = 0, E.value = !1, D = null;
78
+ }, M = (e) => {
79
79
  if (A &&= (clearTimeout(A), null), !e || !s) {
80
- w.value = [], D.value = !1;
80
+ C.value = [], E.value = !1;
81
81
  return;
82
82
  }
83
- D.value = !0, A = setTimeout(async () => {
83
+ E.value = !0, A = setTimeout(async () => {
84
84
  let t = ++k, n = [];
85
85
  try {
86
86
  n = await s(e);
87
87
  } catch {
88
88
  n = [];
89
89
  }
90
- t === k && (w.value = n ?? [], T.value = 0, D.value = !1);
90
+ t === k && (C.value = n ?? [], T.value = 0, E.value = !1);
91
91
  }, 180);
92
- }, P = (e) => {
92
+ }, N = (e) => {
93
93
  let { selection: t } = e.state;
94
94
  if (!t.empty) return null;
95
95
  let { $from: n } = t, i = n.parent.textBetween(Math.max(0, n.parentOffset - 100), n.parentOffset, void 0, "").match(r);
96
96
  return i ? i[1] ?? "" : null;
97
- }, ee = (e) => {
98
- let t = P(e);
97
+ }, P = (e) => {
98
+ let t = N(e);
99
99
  if (t === null) return !1;
100
100
  let n = e.state.selection.$from.pos;
101
- return O = {
101
+ return D = {
102
102
  from: n - (t.length + 1),
103
103
  to: n
104
- }, t !== S.value && (S.value = t, N(t)), !0;
104
+ }, t !== S.value && (S.value = t, M(t)), !0;
105
105
  }, F = (e) => {
106
106
  let t = d.value;
107
- if (!t || !O) return;
108
- let n = t.state.schema.nodes[xe];
107
+ if (!t || !D) return;
108
+ let n = t.state.schema.nodes[we];
109
109
  if (!n) return;
110
110
  let r = n.create({
111
111
  userId: e.id,
112
112
  name: e.name
113
- }), { from: i, to: a } = O, o = t.state.tr.replaceWith(i, a, r), s = i + r.nodeSize;
114
- o.insertText(" ", s), o.setSelection(re.create(o.doc, s + 1)), t.dispatch(o.scrollIntoView()), t.focus(), y.hide();
113
+ }), { from: i, to: a } = D, o = t.state.tr.replaceWith(i, a, r), s = i + r.nodeSize;
114
+ o.insertText(" ", s), o.setSelection(K.create(o.doc, s + 1)), t.dispatch(o.scrollIntoView()), t.focus(), y.hide();
115
115
  }, I = (e) => {
116
- if (!x.value || !w.value.length) {
116
+ if (!x.value || !C.value.length) {
117
117
  x.value && e.key === "Escape" && (e.preventDefault(), y.hide());
118
118
  return;
119
119
  }
120
- let t = w.value.length - 1;
120
+ let t = C.value.length - 1;
121
121
  switch (e.key) {
122
122
  case "ArrowDown":
123
123
  e.preventDefault(), e.stopPropagation(), T.value = T.value >= t ? 0 : T.value + 1;
@@ -127,7 +127,7 @@ var Ae = [
127
127
  break;
128
128
  case "Enter":
129
129
  case "Tab": {
130
- let t = w.value[T.value];
130
+ let t = C.value[T.value];
131
131
  t && (e.preventDefault(), e.stopPropagation(), F(t));
132
132
  break;
133
133
  }
@@ -137,17 +137,17 @@ var Ae = [
137
137
  }
138
138
  };
139
139
  return p(() => {
140
- y = new V({
140
+ y = new re({
141
141
  content: g.value,
142
142
  trigger: "@",
143
- shouldShow: ee,
143
+ shouldShow: P,
144
144
  debounce: 0
145
145
  }), y.onShow = () => {
146
146
  x.value = !0;
147
147
  }, y.onHide = () => {
148
148
  x.value = !1, j();
149
149
  }, y.update(d.value, h.value), window.addEventListener("keydown", I, !0);
150
- }), C([d, h], () => {
150
+ }), w([d, h], () => {
151
151
  y?.update(d.value, h.value);
152
152
  }), f(() => {
153
153
  A && clearTimeout(A), window.removeEventListener("keydown", I, !0), y?.destroy();
@@ -156,21 +156,28 @@ var Ae = [
156
156
  ref: g,
157
157
  class: "kun-mention-dropdown",
158
158
  "data-show": "false"
159
- }, [w.value.length ? (m(!0), i(e, { key: 0 }, v(w.value, (e, t) => (m(), i("button", {
159
+ }, [C.value.length ? (m(!0), i(e, { key: 0 }, v(C.value, (e, t) => (m(), i("button", {
160
160
  key: e.id,
161
161
  type: "button",
162
162
  class: "kun-mention-dropdown__item",
163
163
  "data-active": t === T.value,
164
- onMousedown: E((t) => F(e), ["prevent"]),
164
+ onMousedown: O((t) => F(e), ["prevent"]),
165
165
  onMouseenter: (e) => T.value = t
166
166
  }, [e.avatar ? (m(), i("img", {
167
167
  key: 0,
168
168
  src: e.avatar,
169
169
  alt: e.name,
170
170
  class: "kun-mention-dropdown__avatar"
171
- }, null, 8, ze)) : (m(), i("span", Be, b(e.name.charAt(0)), 1)), a("span", Ve, b(e.name), 1)], 40, Re))), 128)) : D.value ? (m(), i("div", He, b(u.value.searching), 1)) : S.value ? (m(), i("div", Ue, b(u.value.empty), 1)) : (m(), i("div", We, b(u.value.prompt), 1))], 512));
171
+ }, null, 8, He)) : (m(), i("span", Ue, b(e.name.charAt(0)), 1)), a("span", We, b(e.name), 1)], 40, Ve))), 128)) : E.value ? (m(), i("div", Ge, b(u.value.searching), 1)) : S.value ? (m(), i("div", Ke, b(u.value.empty), 1)) : (m(), i("div", qe, b(u.value.prompt), 1))], 512));
172
172
  }
173
- }), Z = (e) => `<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`, Q = (e, t = 13) => `<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><text x="12" y="12" dominant-baseline="central" text-anchor="middle" font-size="${t}" font-weight="700" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor">${e}</text></svg>`, $ = {
173
+ }), Ye = (e, t) => {
174
+ let n = de.type(t), { from: r, to: i } = e.selection, a = "";
175
+ return e.doc.nodesBetween(r, i, (e) => {
176
+ if (a) return !1;
177
+ let t = n.isInSet(e.marks);
178
+ return t && (a = String(t.attrs.href ?? "")), !0;
179
+ }), a;
180
+ }, Z = (e) => `<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`, Q = (e, t = 13) => `<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><text x="12" y="12" dominant-baseline="central" text-anchor="middle" font-size="${t}" font-weight="700" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor">${e}</text></svg>`, $ = {
174
181
  bold: Z("<path d=\"M6 4h8a4 4 0 0 1 0 8H6z\"/><path d=\"M6 12h9a4 4 0 0 1 0 8H6z\"/>"),
175
182
  italic: Z("<line x1=\"19\" y1=\"4\" x2=\"10\" y2=\"4\"/><line x1=\"14\" y1=\"20\" x2=\"5\" y2=\"20\"/><line x1=\"15\" y1=\"4\" x2=\"9\" y2=\"20\"/>"),
176
183
  strike: Z("<path d=\"M16 4H9a3 3 0 0 0-2.83 4\"/><path d=\"M14 12a4 4 0 0 1 0 8H6\"/><line x1=\"4\" y1=\"12\" x2=\"20\" y2=\"12\"/>"),
@@ -187,63 +194,90 @@ var Ae = [
187
194
  spoiler: Z("<path d=\"M9.9 4.24A9.1 9.1 0 0 1 12 4c7 0 10 8 10 8a13.2 13.2 0 0 1-1.67 2.68\"/><path d=\"M6.6 6.6A13.5 13.5 0 0 0 2 12s3 8 10 8a9.7 9.7 0 0 0 5.4-1.6\"/><line x1=\"2\" y1=\"2\" x2=\"22\" y2=\"22\"/>"),
188
195
  link: Z("<path d=\"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"/><path d=\"M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"/>"),
189
196
  latex: Q("Σ", 15),
197
+ check: Z("<path d=\"m5 13 4 4L19 7\"/>"),
198
+ close: Z("<line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/>"),
190
199
  smile: Z("<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M8 14s1.5 2 4 2 4-2 4-2\"/><line x1=\"9\" y1=\"9\" x2=\"9.01\" y2=\"9\"/><line x1=\"15\" y1=\"9\" x2=\"15.01\" y2=\"9\"/>")
191
- }, Ke = {
200
+ }, Xe = ["data-mode"], Ze = ["placeholder", "aria-label"], Qe = ["title", "aria-label"], $e = ["innerHTML"], et = ["title", "aria-label"], tt = ["innerHTML"], nt = {
192
201
  key: 0,
193
202
  class: "kun-editor__toolbar-divider",
194
203
  "aria-hidden": "true"
195
- }, qe = [
204
+ }, rt = [
196
205
  "title",
197
206
  "aria-label",
198
207
  "aria-pressed",
199
208
  "data-active",
200
209
  "onMousedown"
201
- ], Je = ["innerHTML"], Ye = /* @__PURE__ */ s({
210
+ ], it = ["innerHTML"], at = /* @__PURE__ */ s({
202
211
  __name: "SelectionTooltip",
203
212
  setup(n) {
204
- let { view: r, prevState: o } = M(), [, s] = A(), c = l(X), u = c?.activeMarks ?? Ne, d = t(() => (c?.locale ?? "zh-cn").toLowerCase().startsWith("en")), h = _(null), g, y = (e, t) => {
205
- s()?.action(W(e, t));
206
- }, b = async () => {
207
- let e = r.value, { from: t, to: n } = e?.state.selection ?? {
208
- from: 0,
209
- to: 0
210
- }, i = e ? e.state.doc.textBetween(t, n, " ") : "", a = c?.adapters.linkPrompt, o = (a ? await a({ text: i }) : window.prompt(d.value ? "Link URL" : "链接 URL"))?.trim();
211
- o && y(_e.key, { href: o });
212
- }, S = t(() => {
213
- let e = d.value;
213
+ let { view: r, prevState: o } = ee(), [, s] = M(), c = l(X), d = c?.activeMarks ?? Ie, h = t(() => (c?.locale ?? "zh-cn").toLowerCase().startsWith("en")), g = t(() => {
214
+ let e = h.value;
214
215
  return {
215
- bold: {
216
- svg: $.bold,
217
- title: e ? "Bold" : "加粗",
218
- run: () => y(de.key),
219
- mark: "bold"
220
- },
221
- italic: {
222
- svg: $.italic,
223
- title: e ? "Italic" : "斜体",
224
- run: () => y(le.key),
225
- mark: "italic"
226
- },
227
- strike: {
228
- svg: $.strike,
229
- title: e ? "Strikethrough" : "删除线",
230
- run: () => y(Te.key),
231
- mark: "strike"
232
- },
233
- code: {
234
- svg: $.code,
235
- title: e ? "Inline code" : "行内代码",
236
- run: () => y(ue.key),
237
- mark: "code"
238
- },
239
- link: {
240
- svg: $.link,
241
- title: e ? "Link" : "链接",
242
- run: b
243
- }
216
+ bold: e ? "Bold" : "加粗",
217
+ italic: e ? "Italic" : "斜体",
218
+ strike: e ? "Strikethrough" : "删除线",
219
+ code: e ? "Inline code" : "行内代码",
220
+ link: e ? "Link" : "链接",
221
+ linkUrl: e ? "Link URL" : "链接 URL",
222
+ apply: e ? "Apply" : "确定",
223
+ cancel: e ? "Cancel" : "取消"
244
224
  };
245
- }), w = t(() => {
246
- let e = S.value, t = (c?.selectionToolbarItems ?? [
225
+ }), y = _(null), b, C = (e, t) => {
226
+ s()?.action(W(e, t));
227
+ }, T = _(!1), k = _(""), A = _(null), j = () => {
228
+ let e = "";
229
+ return s()?.action((t) => {
230
+ let n = r.value?.state;
231
+ n && (e = Ye(n, t));
232
+ }), e;
233
+ }, N = () => {
234
+ T.value = !1, k.value = "", r.value?.focus();
235
+ }, P = () => {
236
+ let e = k.value.trim();
237
+ e && C(J.key, { href: e }), N();
238
+ }, F = async () => {
239
+ let e = c?.adapters.linkPrompt;
240
+ if (e) {
241
+ let t = r.value, { from: n, to: i } = t?.state.selection ?? {
242
+ from: 0,
243
+ to: 0
244
+ }, a = (await e({ text: t ? t.state.doc.textBetween(n, i, " ") : "" }))?.trim();
245
+ a && C(J.key, { href: a });
246
+ return;
247
+ }
248
+ k.value = j(), T.value = !0, await u(), A.value?.focus(), A.value?.select();
249
+ }, I = t(() => ({
250
+ bold: {
251
+ svg: $.bold,
252
+ title: g.value.bold,
253
+ run: () => C(he.key),
254
+ mark: "bold"
255
+ },
256
+ italic: {
257
+ svg: $.italic,
258
+ title: g.value.italic,
259
+ run: () => C(pe.key),
260
+ mark: "italic"
261
+ },
262
+ strike: {
263
+ svg: $.strike,
264
+ title: g.value.strike,
265
+ run: () => C(Oe.key),
266
+ mark: "strike"
267
+ },
268
+ code: {
269
+ svg: $.code,
270
+ title: g.value.code,
271
+ run: () => C(me.key),
272
+ mark: "code"
273
+ },
274
+ link: {
275
+ svg: $.link,
276
+ title: g.value.link,
277
+ run: F
278
+ }
279
+ })), L = t(() => {
280
+ let e = I.value, t = (c?.selectionToolbarItems ?? [
247
281
  "bold",
248
282
  "italic",
249
283
  "strike",
@@ -258,34 +292,70 @@ var Ae = [
258
292
  return n;
259
293
  });
260
294
  return p(() => {
261
- g = new te({
262
- content: h.value,
295
+ b = new ie({
296
+ content: y.value,
263
297
  offset: 8
264
- }), g.update(r.value, o.value);
265
- }), C([r, o], () => {
266
- g?.update(r.value, o.value);
298
+ }), b.onHide = () => {
299
+ T.value = !1, k.value = "";
300
+ }, b.update(r.value, o.value);
301
+ }), w([r, o], () => {
302
+ b?.update(r.value, o.value);
267
303
  }), f(() => {
268
- g?.destroy();
304
+ b?.destroy();
269
305
  }), (t, n) => (m(), i("div", {
270
306
  ref_key: "divRef",
271
- ref: h,
307
+ ref: y,
272
308
  class: "kun-editor__bubble",
273
- "data-show": "false"
274
- }, [(m(!0), i(e, null, v(w.value, (t, n) => (m(), i(e, { key: n }, [t.divider ? (m(), i("span", Ke)) : (m(), i("button", {
309
+ "data-show": "false",
310
+ "data-mode": T.value ? "link" : "marks"
311
+ }, [T.value ? (m(), i(e, { key: 0 }, [
312
+ E(a("input", {
313
+ ref_key: "inputRef",
314
+ ref: A,
315
+ "onUpdate:modelValue": n[0] ||= (e) => k.value = e,
316
+ type: "url",
317
+ class: "kun-editor__link-input",
318
+ placeholder: g.value.linkUrl,
319
+ "aria-label": g.value.linkUrl,
320
+ spellcheck: "false",
321
+ autocomplete: "off",
322
+ onKeydown: [n[1] ||= D(O((e) => P(), ["prevent"]), ["enter"]), n[2] ||= D(O((e) => N(), ["stop", "prevent"]), ["esc"])]
323
+ }, null, 40, Ze), [[S, k.value]]),
324
+ a("button", {
325
+ type: "button",
326
+ class: "kun-editor__bubble-btn",
327
+ title: g.value.apply,
328
+ "aria-label": g.value.apply,
329
+ onMousedown: n[3] ||= O((e) => P(), ["prevent"])
330
+ }, [a("span", {
331
+ class: "kun-editor__icon",
332
+ innerHTML: x($).check
333
+ }, null, 8, $e)], 40, Qe),
334
+ a("button", {
335
+ type: "button",
336
+ class: "kun-editor__bubble-btn",
337
+ title: g.value.cancel,
338
+ "aria-label": g.value.cancel,
339
+ onMousedown: n[4] ||= O((e) => N(), ["prevent"])
340
+ }, [a("span", {
341
+ class: "kun-editor__icon",
342
+ innerHTML: x($).close
343
+ }, null, 8, tt)], 40, et)
344
+ ], 64)) : (m(!0), i(e, { key: 1 }, v(L.value, (t, n) => (m(), i(e, { key: n }, [t.divider ? (m(), i("span", nt)) : (m(), i("button", {
275
345
  key: 1,
276
346
  type: "button",
277
347
  class: "kun-editor__bubble-btn",
278
348
  title: t.title,
279
349
  "aria-label": t.title,
280
- "aria-pressed": t.mark ? x(u)[t.mark] : void 0,
281
- "data-active": t.mark ? x(u)[t.mark] : void 0,
282
- onMousedown: E((e) => t.run(), ["prevent"])
350
+ "aria-pressed": t.mark ? x(d)[t.mark] : void 0,
351
+ "data-active": t.mark ? x(d)[t.mark] : void 0,
352
+ onMousedown: O((e) => t.run(), ["prevent"])
283
353
  }, [a("span", {
284
354
  class: "kun-editor__icon",
285
355
  innerHTML: t.svg
286
- }, null, 8, Je)], 40, qe))], 64))), 128))], 512));
356
+ }, null, 8, it)], 40, rt))], 64))), 128))], 8, Xe));
287
357
  }
288
- }), Xe = /* @__PURE__ */ s({
358
+ }), ot = /* @__PURE__ */ s({
289
359
  __name: "MilkdownEditor",
290
360
  props: {
291
361
  modelValue: {},
@@ -300,44 +370,44 @@ var Ae = [
300
370
  },
301
371
  emits: ["update:modelValue", "update:loading"],
302
372
  setup(e, { expose: t, emit: r }) {
303
- let i = e, a = r, o = i.modelValue, s = !1, c = l(X), u = N(), d = H("kunMention"), f = i.features.mention !== !1 && !!i.adapters.searchMentionUsers && !!u, p = U("kunSelectionTooltip"), h = i.selectionToolbar && !!u, g = k((e) => {
304
- let t = F.make().config((t) => {
305
- t.set(z, e), t.set(I, i.modelValue), t.get(B).markdownUpdated((e, t, n) => {
373
+ let i = e, a = r, o = i.modelValue, s = !1, c = l(X), u = P(), d = V("kunMention"), f = i.features.mention !== !1 && !!i.adapters.searchMentionUsers && !!u, p = H("kunSelectionTooltip"), h = i.selectionToolbar && !!u, g = j((e) => {
374
+ let t = L.make().config((t) => {
375
+ t.set(B, e), t.set(te, i.modelValue), t.get(ne).markdownUpdated((e, t, n) => {
306
376
  !i.active || s || t === n || (o = t, a("update:modelValue", t));
307
- }), t.update(R, (e) => ({
377
+ }), t.update(z, (e) => ({
308
378
  ...e,
309
379
  editable: () => !i.readonly
310
- })), f && t.set(d.key, { view: u({ component: Ge }) }), h && t.set(p.key, { view: u({ component: Ye }) });
311
- }).use(he(i.adapters, i.features, {
380
+ })), f && t.set(d.key, { view: u({ component: Je }) }), h && t.set(p.key, { view: u({ component: at }) });
381
+ }).use(ye(i.adapters, i.features, {
312
382
  locale: i.locale,
313
383
  placeholder: i.placeholder,
314
384
  placeholderMode: i.placeholderMode
315
385
  }));
316
- return f && t.use(d), h && t.use(p), c && t.use(Le(c.activeMarks)), t;
386
+ return f && t.use(d), h && t.use(p), c && t.use(Be(c.activeMarks)), t;
317
387
  });
318
- C(g.loading, (e) => a("update:loading", e), { immediate: !0 }), C(() => i.modelValue, (e) => {
388
+ w(g.loading, (e) => a("update:loading", e), { immediate: !0 }), w(() => i.modelValue, (e) => {
319
389
  if (e === o) return;
320
390
  o = e;
321
391
  let t = g.get();
322
392
  t && (s = !0, t.action(G(e)), s = !1);
323
- }), C(() => i.readonly, () => {
393
+ }), w(() => i.readonly, () => {
324
394
  g.get()?.action((e) => {
325
- let t = e.get(L);
395
+ let t = e.get(R);
326
396
  t.dispatch(t.state.tr);
327
397
  });
328
398
  });
329
399
  let _ = () => {
330
- g.get()?.action((e) => e.get(L).focus());
400
+ g.get()?.action((e) => e.get(R).focus());
331
401
  };
332
402
  return t({
333
403
  insertQuote: (e) => {
334
- g.get()?.action(W(ye.key, e)), _();
404
+ g.get()?.action(W(Se.key, e)), _();
335
405
  },
336
406
  insertMention: (e) => {
337
- g.get()?.action(W(ve.key, e)), _();
407
+ g.get()?.action(W(xe.key, e)), _();
338
408
  },
339
409
  insertImage: (e) => {
340
- g.get()?.action(W(se.key, {
410
+ g.get()?.action(W(ue.key, {
341
411
  src: e.src,
342
412
  alt: e.alt ?? "",
343
413
  title: e.title ?? ""
@@ -346,7 +416,7 @@ var Ae = [
346
416
  uploadImage: (e) => {
347
417
  let t = i.adapters.uploadImage, n = g.get();
348
418
  !t || !n || n.action((n) => {
349
- Ce(n.get(L), e, {
419
+ Ee(n.get(R), e, {
350
420
  uploadImage: t,
351
421
  notify: i.adapters.notify,
352
422
  locale: i.locale
@@ -356,38 +426,116 @@ var Ae = [
356
426
  focus: _,
357
427
  scrollToHeading: (e) => {
358
428
  g.get()?.action((t) => {
359
- let n = t.get(L), r = 0, i = -1;
429
+ let n = t.get(R), r = 0, i = -1;
360
430
  if (n.state.doc.forEach((t, n) => {
361
431
  t.type.name === "heading" && (r === e && (i = n), r += 1);
362
432
  }), !(i < 0) && (n.nodeDOM(i)?.scrollIntoView({
363
433
  behavior: "smooth",
364
434
  block: "start"
365
435
  }), n.editable)) {
366
- let e = re.near(n.state.doc.resolve(i + 1));
436
+ let e = K.near(n.state.doc.resolve(i + 1));
367
437
  n.dispatch(n.state.tr.setSelection(e)), n.focus();
368
438
  }
369
439
  });
370
440
  }
371
- }), (e, t) => (m(), n(x(D)));
441
+ }), (e, t) => (m(), n(x(k)));
442
+ }
443
+ }), st = [
444
+ "title",
445
+ "aria-label",
446
+ "aria-expanded"
447
+ ], ct = ["innerHTML"], lt = { class: "kun-editor__link-panel" }, ut = ["placeholder", "aria-label"], dt = ["title", "aria-label"], ft = ["innerHTML"], pt = /* @__PURE__ */ s({
448
+ __name: "LinkInput",
449
+ setup(e) {
450
+ let [, n] = M(), r = l(X), o = t(() => (r?.locale ?? "zh-cn").toLowerCase().startsWith("en")), s = t(() => {
451
+ let e = o.value;
452
+ return {
453
+ link: e ? "Link" : "链接",
454
+ linkUrl: e ? "Link URL" : "链接 URL",
455
+ apply: e ? "Apply" : "确定"
456
+ };
457
+ }), c = _(!1), d = _(""), h = _(null), g = _(null), v = (e) => {
458
+ e && n()?.action(W(J.key, { href: e }));
459
+ }, y = () => {
460
+ c.value = !1, d.value = "";
461
+ }, b = () => {
462
+ y(), n()?.action((e) => e.get(R).focus());
463
+ }, w = () => {
464
+ v(d.value.trim()), b();
465
+ }, T = async () => {
466
+ let e = r?.adapters.linkPrompt;
467
+ if (e) {
468
+ let t = "";
469
+ n()?.action((e) => {
470
+ let { state: n } = e.get(R), { from: r, to: i } = n.selection;
471
+ t = n.doc.textBetween(r, i, " ");
472
+ }), v((await e({ text: t }))?.trim() ?? "");
473
+ return;
474
+ }
475
+ if (c.value) {
476
+ y();
477
+ return;
478
+ }
479
+ n()?.action((e) => {
480
+ d.value = Ye(e.get(R).state, e);
481
+ }), c.value = !0, await u(), g.value?.focus(), g.value?.select();
482
+ }, k = (e) => {
483
+ c.value && h.value && !h.value.contains(e.target) && y();
484
+ };
485
+ return p(() => document.addEventListener("click", k)), f(() => document.removeEventListener("click", k)), (e, t) => (m(), i("div", {
486
+ ref_key: "rootRef",
487
+ ref: h,
488
+ class: "kun-editor__link"
489
+ }, [a("button", {
490
+ type: "button",
491
+ class: "kun-editor__tool",
492
+ title: s.value.link,
493
+ "aria-label": s.value.link,
494
+ "aria-expanded": c.value,
495
+ onClick: T
496
+ }, [a("span", {
497
+ class: "kun-editor__icon",
498
+ innerHTML: x($).link
499
+ }, null, 8, ct)], 8, st), E(a("div", lt, [E(a("input", {
500
+ ref_key: "inputRef",
501
+ ref: g,
502
+ "onUpdate:modelValue": t[0] ||= (e) => d.value = e,
503
+ type: "url",
504
+ class: "kun-editor__link-input",
505
+ placeholder: s.value.linkUrl,
506
+ "aria-label": s.value.linkUrl,
507
+ spellcheck: "false",
508
+ autocomplete: "off",
509
+ onKeydown: [t[1] ||= D(O((e) => w(), ["prevent"]), ["enter"]), t[2] ||= D(O((e) => b(), ["stop", "prevent"]), ["esc"])]
510
+ }, null, 40, ut), [[S, d.value]]), a("button", {
511
+ type: "button",
512
+ class: "kun-editor__tool",
513
+ title: s.value.apply,
514
+ "aria-label": s.value.apply,
515
+ onClick: t[3] ||= (e) => w()
516
+ }, [a("span", {
517
+ class: "kun-editor__icon",
518
+ innerHTML: x($).check
519
+ }, null, 8, ft)], 8, dt)], 512), [[C, c.value]])], 512));
372
520
  }
373
- }), Ze = /* @__PURE__ */ "😀.😃.😄.😁.😆.😅.🤣.😂.🙂.🙃.😉.😊.😇.🥰.😍.🤩.😘.😗.😚.😋.😛.😜.🤪.😝.🤗.🤭.🤔.🤐.😐.😑.😶.😏.😒.🙄.😬.😌.😔.😪.🤤.😴.😷.🤒.🤕.🥵.🥶.🥴.😵.🤯.🤠.🥳.😎.🤓.🧐.😕.😟.🙁.😮.😯.😲.😳.🥺.😦.😧.😨.😰.😥.😢.😭.😱.😖.😣.😞.😓.😩.😫.🥱.😤.😡.😠.🤬.😈.👿.💀.💩.🤡.👻.👽.🤖.😺.😸.👍.👎.👌.🤌.🤏.✌️.🤞.🤟.🤘.👋.🤚.🖐️.✋.👏.🙌.🤝.🙏.💪.👀.👁️.❤️.🧡.💛.💚.💙.💜.🖤.🤍.💔.💕.💞.💓.💗.💖.💘.💝.💯.✨.⭐.🌟.🔥.💥.💫.⚡.☀️.🌈.🎉.🎊.🎁.🏆.🐶.🐱.🐭.🦊.🐻.🐼.🐨.🦄.🐢.🐳.🍎.🍑.🍓.🍉.🍰.🍺.🍵.☕.🍜.🍙.✅.❌.❓.❗.💤.👑.🎮.🎵.📌.🔖".split("."), Qe = [
521
+ }), mt = /* @__PURE__ */ "😀.😃.😄.😁.😆.😅.🤣.😂.🙂.🙃.😉.😊.😇.🥰.😍.🤩.😘.😗.😚.😋.😛.😜.🤪.😝.🤗.🤭.🤔.🤐.😐.😑.😶.😏.😒.🙄.😬.😌.😔.😪.🤤.😴.😷.🤒.🤕.🥵.🥶.🥴.😵.🤯.🤠.🥳.😎.🤓.🧐.😕.😟.🙁.😮.😯.😲.😳.🥺.😦.😧.😨.😰.😥.😢.😭.😱.😖.😣.😞.😓.😩.😫.🥱.😤.😡.😠.🤬.😈.👿.💀.💩.🤡.👻.👽.🤖.😺.😸.👍.👎.👌.🤌.🤏.✌️.🤞.🤟.🤘.👋.🤚.🖐️.✋.👏.🙌.🤝.🙏.💪.👀.👁️.❤️.🧡.💛.💚.💙.💜.🖤.🤍.💔.💕.💞.💓.💗.💖.💘.💝.💯.✨.⭐.🌟.🔥.💥.💫.⚡.☀️.🌈.🎉.🎊.🎁.🏆.🐶.🐱.🐭.🦊.🐻.🐼.🐨.🦄.🐢.🐳.🍎.🍑.🍓.🍉.🍰.🍺.🍵.☕.🍜.🍙.✅.❌.❓.❗.💤.👑.🎮.🎵.📌.🔖".split("."), ht = [
374
522
  "title",
375
523
  "aria-label",
376
524
  "aria-expanded"
377
- ], $e = ["innerHTML"], et = { class: "kun-editor__picker-panel" }, tt = {
525
+ ], gt = ["innerHTML"], _t = { class: "kun-editor__picker-panel" }, vt = {
378
526
  key: 0,
379
527
  class: "kun-editor__picker-tabs",
380
528
  role: "tablist"
381
- }, nt = ["data-active"], rt = ["data-active"], it = { class: "kun-editor__emoji-grid" }, at = ["onClick"], ot = {
529
+ }, yt = ["data-active"], bt = ["data-active"], xt = { class: "kun-editor__emoji-grid" }, St = ["onClick"], Ct = {
382
530
  key: 1,
383
531
  class: "kun-editor__sticker-body"
384
- }, st = { class: "kun-editor__pack-name" }, ct = { class: "kun-editor__sticker-grid" }, lt = ["title", "onClick"], ut = ["src", "alt"], dt = {
532
+ }, wt = { class: "kun-editor__pack-name" }, Tt = { class: "kun-editor__sticker-grid" }, Et = ["title", "onClick"], Dt = ["src", "alt"], Ot = {
385
533
  key: 1,
386
534
  class: "kun-editor__picker-hint"
387
- }, ft = /* @__PURE__ */ s({
535
+ }, kt = /* @__PURE__ */ s({
388
536
  __name: "StickerPicker",
389
537
  setup(n) {
390
- let [, o] = A(), s = l(X), c = s?.adapters.stickerSource, u = !!c, d = t(() => (s?.locale ?? "zh-cn").toLowerCase().startsWith("en")), h = t(() => d.value ? {
538
+ let [, o] = M(), s = l(X), c = s?.adapters.stickerSource, u = !!c, d = t(() => (s?.locale ?? "zh-cn").toLowerCase().startsWith("en")), h = t(() => d.value ? {
391
539
  trigger: "Emoji & stickers",
392
540
  emoji: "Emoji",
393
541
  sticker: "Stickers",
@@ -399,9 +547,9 @@ var Ae = [
399
547
  sticker: "贴纸",
400
548
  empty: "暂无贴纸",
401
549
  failed: "贴纸加载失败"
402
- }), g = _(!1), y = _(null), C = _("emoji"), w = _([]), E = _(!1), D = _(!1), O = async () => {
403
- if (!(E.value || !c)) {
404
- E.value = !0;
550
+ }), g = _(!1), y = _(null), S = _("emoji"), w = _([]), T = _(!1), D = _(!1), O = async () => {
551
+ if (!(T.value || !c)) {
552
+ T.value = !0;
405
553
  try {
406
554
  w.value = await c();
407
555
  } catch {
@@ -410,17 +558,17 @@ var Ae = [
410
558
  }
411
559
  }, k = () => {
412
560
  g.value = !g.value, g.value && u && O();
413
- }, j = (e) => {
561
+ }, A = (e) => {
414
562
  g.value && y.value && !y.value.contains(e.target) && (g.value = !1);
415
563
  };
416
- p(() => document.addEventListener("click", j)), f(() => document.removeEventListener("click", j));
417
- let M = (e) => {
564
+ p(() => document.addEventListener("click", A)), f(() => document.removeEventListener("click", A));
565
+ let j = (e) => {
418
566
  o()?.action((t) => {
419
- let n = t.get(L), { state: r } = n;
567
+ let n = t.get(R), { state: r } = n;
420
568
  n.dispatch(r.tr.insertText(e, r.selection.from));
421
569
  });
422
570
  }, N = (e, t) => {
423
- o()?.action(W(se.key, {
571
+ o()?.action(W(ue.key, {
424
572
  src: e,
425
573
  title: t,
426
574
  alt: t
@@ -440,28 +588,28 @@ var Ae = [
440
588
  }, [a("span", {
441
589
  class: "kun-editor__icon",
442
590
  innerHTML: x($).smile
443
- }, null, 8, $e)], 8, Qe), T(a("div", et, [
444
- u ? (m(), i("div", tt, [a("button", {
591
+ }, null, 8, gt)], 8, ht), E(a("div", _t, [
592
+ u ? (m(), i("div", vt, [a("button", {
445
593
  type: "button",
446
594
  class: "kun-editor__picker-tab",
447
- "data-active": C.value === "emoji",
448
- onClick: n[0] ||= (e) => C.value = "emoji"
449
- }, b(h.value.emoji), 9, nt), a("button", {
595
+ "data-active": S.value === "emoji",
596
+ onClick: n[0] ||= (e) => S.value = "emoji"
597
+ }, b(h.value.emoji), 9, yt), a("button", {
450
598
  type: "button",
451
599
  class: "kun-editor__picker-tab",
452
- "data-active": C.value === "sticker",
453
- onClick: n[1] ||= (e) => C.value = "sticker"
454
- }, b(h.value.sticker), 9, rt)])) : r("", !0),
455
- T(a("div", it, [(m(!0), i(e, null, v(x(Ze), (e, t) => (m(), i("button", {
600
+ "data-active": S.value === "sticker",
601
+ onClick: n[1] ||= (e) => S.value = "sticker"
602
+ }, b(h.value.sticker), 9, bt)])) : r("", !0),
603
+ E(a("div", xt, [(m(!0), i(e, null, v(x(mt), (e, t) => (m(), i("button", {
456
604
  key: t,
457
605
  type: "button",
458
606
  class: "kun-editor__emoji",
459
- onClick: (t) => M(e)
460
- }, b(e), 9, at))), 128))], 512), [[S, !u || C.value === "emoji"]]),
461
- u ? T((m(), i("div", ot, [w.value.length ? (m(!0), i(e, { key: 0 }, v(w.value, (t) => (m(), i("div", {
607
+ onClick: (t) => j(e)
608
+ }, b(e), 9, St))), 128))], 512), [[C, !u || S.value === "emoji"]]),
609
+ u ? E((m(), i("div", Ct, [w.value.length ? (m(!0), i(e, { key: 0 }, v(w.value, (t) => (m(), i("div", {
462
610
  key: t.name,
463
611
  class: "kun-editor__pack"
464
- }, [a("div", st, b(t.name), 1), a("div", ct, [(m(!0), i(e, null, v(t.stickers, (e, t) => (m(), i("button", {
612
+ }, [a("div", wt, b(t.name), 1), a("div", Tt, [(m(!0), i(e, null, v(t.stickers, (e, t) => (m(), i("button", {
465
613
  key: t,
466
614
  type: "button",
467
615
  class: "kun-editor__sticker",
@@ -471,44 +619,35 @@ var Ae = [
471
619
  src: e.src,
472
620
  alt: e.name,
473
621
  loading: "lazy"
474
- }, null, 8, ut)], 8, lt))), 128))])]))), 128)) : (m(), i("div", dt, b(D.value ? h.value.failed : h.value.empty), 1))], 512)), [[S, C.value === "sticker"]]) : r("", !0)
475
- ], 512), [[S, g.value]])], 512));
622
+ }, null, 8, Dt)], 8, Et))), 128))])]))), 128)) : (m(), i("div", Ot, b(D.value ? h.value.failed : h.value.empty), 1))], 512)), [[C, S.value === "sticker"]]) : r("", !0)
623
+ ], 512), [[C, g.value]])], 512));
476
624
  }
477
- }), pt = {
625
+ }), At = {
478
626
  class: "kun-editor__format-toolbar",
479
627
  role: "toolbar"
480
- }, mt = ["aria-label"], ht = {
628
+ }, jt = ["aria-label"], Mt = {
481
629
  value: "",
482
630
  disabled: "",
483
631
  selected: ""
484
- }, gt = ["value"], _t = [
632
+ }, Nt = ["value"], Pt = [
485
633
  "title",
486
634
  "aria-label",
487
635
  "aria-pressed",
488
636
  "data-active",
489
637
  "onClick"
490
- ], vt = ["innerHTML"], yt = ["title", "aria-label"], bt = ["innerHTML"], xt = /* @__PURE__ */ s({
638
+ ], Ft = ["innerHTML"], It = ["title", "aria-label"], Lt = ["innerHTML"], Rt = /* @__PURE__ */ s({
491
639
  __name: "EditorToolbar",
492
- setup(n) {
493
- let [, s] = A(), c = l(X), u = c?.activeMarks ?? Ne, d = t(() => c?.adapters.uploadImage), f = t(() => c?.features.sticker !== !1), p = t(() => (c?.locale ?? "zh-cn").toLowerCase().startsWith("en")), h = (e, t) => {
494
- s()?.action(W(e, t));
495
- }, g = async () => {
496
- let e = "";
497
- s()?.action((t) => {
498
- let n = t.get(L), { from: r, to: i } = n.state.selection;
499
- e = n.state.doc.textBetween(r, i, " ");
500
- });
501
- let t = c?.adapters.linkPrompt, n = (t ? await t({ text: e }) : window.prompt(p.value ? "Link URL" : "链接 URL"))?.trim();
502
- n && h(_e.key, { href: n });
640
+ setup(s) {
641
+ let [, c] = M(), u = l(X), d = u?.activeMarks ?? Ie, f = t(() => u?.adapters.uploadImage), p = t(() => u?.features.sticker !== !1), h = t(() => (u?.locale ?? "zh-cn").toLowerCase().startsWith("en")), g = (e, t) => {
642
+ c()?.action(W(e, t));
503
643
  }, y = t(() => {
504
- let e = p.value;
644
+ let e = h.value;
505
645
  return {
506
646
  textSize: e ? "Text size" : "文本大小",
507
647
  bold: e ? "Bold" : "加粗",
508
648
  italic: e ? "Italic" : "斜体",
509
649
  strike: e ? "Strikethrough" : "删除线",
510
650
  code: e ? "Inline code" : "行内代码",
511
- link: e ? "Link" : "链接",
512
651
  bulletList: e ? "Bullet list" : "无序列表",
513
652
  orderedList: e ? "Ordered list" : "有序列表",
514
653
  quote: e ? "Blockquote" : "引用块",
@@ -518,7 +657,7 @@ var Ae = [
518
657
  image: e ? "Upload image" : "上传图片"
519
658
  };
520
659
  }), S = t(() => {
521
- let e = p.value;
660
+ let e = h.value;
522
661
  return [
523
662
  "正文",
524
663
  "一级标题",
@@ -533,110 +672,106 @@ var Ae = [
533
672
  }));
534
673
  }), C = (e) => {
535
674
  let t = e.target;
536
- h(Se.key, Number(t.value)), t.selectedIndex = 0;
675
+ g(Te.key, Number(t.value)), t.selectedIndex = 0;
537
676
  }, w = t(() => [
538
677
  [
539
678
  {
540
679
  svg: $.bold,
541
680
  title: y.value.bold,
542
- run: () => h(de.key),
681
+ run: () => g(he.key),
543
682
  mark: "bold"
544
683
  },
545
684
  {
546
685
  svg: $.italic,
547
686
  title: y.value.italic,
548
- run: () => h(le.key),
687
+ run: () => g(pe.key),
549
688
  mark: "italic"
550
689
  },
551
690
  {
552
691
  svg: $.strike,
553
692
  title: y.value.strike,
554
- run: () => h(Te.key),
693
+ run: () => g(Oe.key),
555
694
  mark: "strike"
556
695
  },
557
696
  {
558
697
  svg: $.code,
559
698
  title: y.value.code,
560
- run: () => h(ue.key),
699
+ run: () => g(me.key),
561
700
  mark: "code"
562
701
  },
563
- {
564
- svg: $.link,
565
- title: y.value.link,
566
- run: g
567
- }
702
+ { link: !0 }
568
703
  ],
569
704
  [
570
705
  {
571
706
  svg: $.bulletList,
572
707
  title: y.value.bulletList,
573
- run: () => h(pe.key)
708
+ run: () => g(_e.key)
574
709
  },
575
710
  {
576
711
  svg: $.orderedList,
577
712
  title: y.value.orderedList,
578
- run: () => h(me.key)
713
+ run: () => g(ve.key)
579
714
  },
580
715
  {
581
716
  svg: $.quote,
582
717
  title: y.value.quote,
583
- run: () => h(fe.key)
718
+ run: () => g(ge.key)
584
719
  },
585
720
  {
586
721
  svg: $.codeBlock,
587
722
  title: y.value.codeBlock,
588
- run: () => h(ie.key, "")
723
+ run: () => g(q.key, "")
589
724
  },
590
725
  {
591
726
  svg: $.hr,
592
727
  title: y.value.hr,
593
- run: () => h(oe.key)
728
+ run: () => g(le.key)
594
729
  }
595
730
  ],
596
731
  [{
597
732
  svg: $.spoiler,
598
733
  title: y.value.spoiler,
599
- run: () => h(ge.key)
734
+ run: () => g(be.key)
600
735
  }]
601
736
  ]), T = _(null), E = () => T.value?.click(), D = (e) => {
602
737
  let t = e.target, n = t.files?.[0];
603
738
  t.value = "";
604
- let r = d.value;
605
- !n || !r || s()?.action((e) => {
606
- Ce(e.get(L), n, {
739
+ let r = f.value;
740
+ !n || !r || c()?.action((e) => {
741
+ Ee(e.get(R), n, {
607
742
  uploadImage: r,
608
- notify: c?.adapters.notify,
609
- locale: c?.locale
743
+ notify: u?.adapters.notify,
744
+ locale: u?.locale
610
745
  });
611
746
  });
612
747
  };
613
- return (t, n) => (m(), i("div", pt, [
748
+ return (t, s) => (m(), i("div", At, [
614
749
  a("select", {
615
750
  class: "kun-editor__heading-select",
616
751
  "aria-label": y.value.textSize,
617
752
  onChange: C
618
- }, [a("option", ht, b(y.value.textSize), 1), (m(!0), i(e, null, v(S.value, (e) => (m(), i("option", {
753
+ }, [a("option", Mt, b(y.value.textSize), 1), (m(!0), i(e, null, v(S.value, (e) => (m(), i("option", {
619
754
  key: e.level,
620
755
  value: e.level
621
- }, b(e.label), 9, gt))), 128))], 40, mt),
622
- (m(!0), i(e, null, v(w.value, (t, r) => (m(), i(e, { key: r }, [n[0] ||= a("span", {
756
+ }, b(e.label), 9, Nt))), 128))], 40, jt),
757
+ (m(!0), i(e, null, v(w.value, (t, r) => (m(), i(e, { key: r }, [s[0] ||= a("span", {
623
758
  class: "kun-editor__toolbar-divider",
624
759
  "aria-hidden": "true"
625
- }, null, -1), (m(!0), i(e, null, v(t, (e, t) => (m(), i("button", {
626
- key: t,
760
+ }, null, -1), (m(!0), i(e, null, v(t, (t, r) => (m(), i(e, { key: r }, ["link" in t ? (m(), n(pt, { key: 0 })) : (m(), i("button", {
761
+ key: 1,
627
762
  type: "button",
628
763
  class: "kun-editor__tool",
629
- title: e.title,
630
- "aria-label": e.title,
631
- "aria-pressed": e.mark ? x(u)[e.mark] : void 0,
632
- "data-active": e.mark ? x(u)[e.mark] : void 0,
633
- onClick: (t) => e.run()
764
+ title: t.title,
765
+ "aria-label": t.title,
766
+ "aria-pressed": t.mark ? x(d)[t.mark] : void 0,
767
+ "data-active": t.mark ? x(d)[t.mark] : void 0,
768
+ onClick: (e) => t.run()
634
769
  }, [a("span", {
635
770
  class: "kun-editor__icon",
636
- innerHTML: e.svg
637
- }, null, 8, vt)], 8, _t))), 128))], 64))), 128)),
638
- d.value ? (m(), i(e, { key: 0 }, [
639
- n[1] ||= a("span", {
771
+ innerHTML: t.svg
772
+ }, null, 8, Ft)], 8, Pt))], 64))), 128))], 64))), 128)),
773
+ f.value ? (m(), i(e, { key: 0 }, [
774
+ s[1] ||= a("span", {
640
775
  class: "kun-editor__toolbar-divider",
641
776
  "aria-hidden": "true"
642
777
  }, null, -1),
@@ -649,7 +784,7 @@ var Ae = [
649
784
  }, [a("span", {
650
785
  class: "kun-editor__icon",
651
786
  innerHTML: x($).image
652
- }, null, 8, bt)], 8, yt),
787
+ }, null, 8, Lt)], 8, It),
653
788
  a("input", {
654
789
  ref_key: "fileInput",
655
790
  ref: T,
@@ -659,34 +794,34 @@ var Ae = [
659
794
  onChange: D
660
795
  }, null, 544)
661
796
  ], 64)) : r("", !0),
662
- f.value ? (m(), i(e, { key: 1 }, [n[2] ||= a("span", {
797
+ p.value ? (m(), i(e, { key: 1 }, [s[2] ||= a("span", {
663
798
  class: "kun-editor__toolbar-divider",
664
799
  "aria-hidden": "true"
665
- }, null, -1), o(ft)], 64)) : r("", !0)
800
+ }, null, -1), o(kt)], 64)) : r("", !0)
666
801
  ]));
667
802
  }
668
- }), St = /* @__PURE__ */ s({
803
+ }), zt = /* @__PURE__ */ s({
669
804
  __name: "ToolbarHost",
670
805
  setup(e) {
671
- let [, t] = A(), n = l(X, void 0), r = (e, n) => {
806
+ let [, t] = M(), n = l(X, void 0), r = (e, n) => {
672
807
  t()?.action(W(e, n));
673
808
  }, i = () => {
674
- t()?.action((e) => e.get(L).focus());
809
+ t()?.action((e) => e.get(R).focus());
675
810
  }, a = {
676
811
  run: r,
677
812
  get activeMarks() {
678
- return n?.activeMarks ?? Ne;
813
+ return n?.activeMarks ?? Ie;
679
814
  },
680
815
  insertText: (e) => {
681
816
  t()?.action((t) => {
682
- let n = t.get(L);
817
+ let n = t.get(R);
683
818
  n.dispatch(n.state.tr.insertText(e));
684
819
  }), i();
685
820
  },
686
821
  uploadImage: (e) => {
687
822
  let r = n?.adapters.uploadImage, i = t();
688
823
  !r || !i || i.action((t) => {
689
- Ce(t.get(L), e, {
824
+ Ee(t.get(R), e, {
690
825
  uploadImage: r,
691
826
  notify: n?.adapters.notify,
692
827
  locale: n?.locale
@@ -694,20 +829,20 @@ var Ae = [
694
829
  });
695
830
  },
696
831
  insertLink: (e) => {
697
- r(_e.key, e), i();
832
+ r(J.key, e), i();
698
833
  },
699
834
  insertImage: (e) => {
700
- r(se.key, {
835
+ r(ue.key, {
701
836
  src: e.src,
702
837
  alt: e.alt ?? "",
703
838
  title: e.title ?? ""
704
839
  }), i();
705
840
  },
706
841
  insertQuote: (e) => {
707
- r(ye.key, e), i();
842
+ r(Se.key, e), i();
708
843
  },
709
844
  insertMention: (e) => {
710
- r(ve.key, e), i();
845
+ r(xe.key, e), i();
711
846
  },
712
847
  focus: i,
713
848
  get adapters() {
@@ -722,7 +857,7 @@ var Ae = [
722
857
  };
723
858
  return (e, t) => y(e.$slots, "default", d(c(a)));
724
859
  }
725
- }), Ct = /* @__PURE__ */ s({
860
+ }), Bt = /* @__PURE__ */ s({
726
861
  __name: "MarkdownSource",
727
862
  props: {
728
863
  modelValue: {},
@@ -730,13 +865,13 @@ var Ae = [
730
865
  },
731
866
  emits: ["update:modelValue"],
732
867
  setup(e, { expose: t, emit: n }) {
733
- let r = e, a = n, o = _(null), s = null, c = Ee.define(), l = (e) => De.create({
868
+ let r = e, a = n, o = _(null), s = null, c = ke.define(), l = (e) => Ae.create({
734
869
  doc: e,
735
870
  extensions: [
736
- be(),
871
+ Ce(),
737
872
  Y.lineWrapping,
738
- ke,
739
- Oe(),
873
+ Me,
874
+ je(),
740
875
  Y.editable.of(!r.readonly),
741
876
  Y.updateListener.of((e) => {
742
877
  e.docChanged && !e.transactions.some((e) => e.annotation(c)) && a("update:modelValue", e.state.doc.toString());
@@ -773,7 +908,7 @@ var Ae = [
773
908
  selection: { anchor: i },
774
909
  scrollIntoView: !0
775
910
  }), s.focus());
776
- } }), C(() => r.modelValue, (e) => {
911
+ } }), w(() => r.modelValue, (e) => {
777
912
  if (!s || s.state.doc.toString() === e) return;
778
913
  let { anchor: t, head: n } = s.state.selection.main, r = e.length;
779
914
  s.dispatch({
@@ -794,23 +929,23 @@ var Ae = [
794
929
  class: "kun-editor__source"
795
930
  }, null, 512));
796
931
  }
797
- }), wt = ["data-mode"], Tt = {
932
+ }), Vt = ["data-mode"], Ht = {
798
933
  key: 0,
799
934
  class: "kun-editor__toolbar",
800
935
  role: "tablist"
801
- }, Et = [
936
+ }, Ut = [
802
937
  "aria-selected",
803
938
  "data-active",
804
939
  "onClick"
805
- ], Dt = ["title", "aria-label"], Ot = [
940
+ ], Wt = ["title", "aria-label"], Gt = [
806
941
  "data-active",
807
942
  "title",
808
943
  "aria-pressed"
809
- ], kt = ["data-swap"], At = { class: "kun-editor__wysiwyg kun-editor__pane" }, jt = {
944
+ ], Kt = ["data-swap"], qt = { class: "kun-editor__wysiwyg kun-editor__pane" }, Jt = {
810
945
  key: 1,
811
946
  class: "kun-editor__loading",
812
947
  "aria-hidden": "true"
813
- }, Mt = /* @__PURE__ */ s({
948
+ }, Yt = /* @__PURE__ */ s({
814
949
  __name: "KunEditor",
815
950
  props: {
816
951
  modelValue: {},
@@ -842,54 +977,54 @@ var Ae = [
842
977
  "update:headings",
843
978
  "update:loading"
844
979
  ],
845
- setup(s, { expose: l, emit: E }) {
980
+ setup(s, { expose: l, emit: S }) {
846
981
  let D = [
847
982
  "bold",
848
983
  "italic",
849
984
  "strike",
850
985
  "code",
851
986
  "link"
852
- ], k = s, A = E, M = _(!1);
987
+ ], O = s, k = S, j = _(!1);
853
988
  p(() => {
854
- M.value = !0;
989
+ j.value = !0;
855
990
  });
856
- let N = _(!0), P = (e) => {
857
- N.value = e, A("update:loading", e);
991
+ let M = _(!0), ee = (e) => {
992
+ M.value = e, k("update:loading", e);
858
993
  };
859
- C(() => k.modelValue, (e) => A("update:headings", ee(e)), { immediate: !0 });
860
- let F = g(Me());
994
+ w(() => O.modelValue, (e) => k("update:headings", I(e)), { immediate: !0 });
995
+ let P = g(Fe());
861
996
  h(X, {
862
997
  get adapters() {
863
- return k.adapters;
998
+ return O.adapters;
864
999
  },
865
1000
  get features() {
866
- return k.features;
1001
+ return O.features;
867
1002
  },
868
1003
  get locale() {
869
- return k.locale;
1004
+ return O.locale;
870
1005
  },
871
1006
  get selectionToolbarItems() {
872
- return Array.isArray(k.selectionToolbar) ? k.selectionToolbar : D;
1007
+ return Array.isArray(O.selectionToolbar) ? O.selectionToolbar : D;
873
1008
  },
874
1009
  get activeMarks() {
875
- return F;
1010
+ return P;
876
1011
  }
877
1012
  });
878
- let I = t(() => k.selectionToolbar !== !1), L = _(k.views.includes("wysiwyg") ? "wysiwyg" : k.views[0] ?? "wysiwyg"), R = (e) => {
1013
+ let F = t(() => O.selectionToolbar !== !1), L = _(O.views.includes("wysiwyg") ? "wysiwyg" : O.views[0] ?? "wysiwyg"), te = (e) => {
879
1014
  L.value = e;
880
1015
  };
881
- C(() => k.views, (e) => {
1016
+ w(() => O.views, (e) => {
882
1017
  e.includes(L.value) || (L.value = e[0] ?? "wysiwyg");
883
1018
  });
884
- let z = _(!1), B = () => {
885
- z.value = !z.value;
886
- }, V = _(k.scrollSync);
887
- C(() => k.scrollSync, (e) => {
888
- V.value = e;
1019
+ let R = _(!1), z = () => {
1020
+ R.value = !R.value;
1021
+ }, B = _(O.scrollSync);
1022
+ w(() => O.scrollSync, (e) => {
1023
+ B.value = e;
889
1024
  });
890
- let H = () => {
891
- V.value = !V.value;
892
- }, te = t(() => k.locale.toLowerCase().startsWith("en")), U = t(() => te.value ? {
1025
+ let ne = () => {
1026
+ B.value = !B.value;
1027
+ }, re = t(() => O.locale.toLowerCase().startsWith("en")), V = t(() => re.value ? {
893
1028
  wysiwyg: "Preview",
894
1029
  source: "Markdown",
895
1030
  split: "Split",
@@ -901,104 +1036,104 @@ var Ae = [
901
1036
  split: "分栏",
902
1037
  swap: "左右互换",
903
1038
  scrollSync: "同步滚动"
904
- }), ne = _(null), W = null, G = null, K = null, q = () => {
905
- W?.(), W = null, G = null;
906
- }, re = () => {
907
- q();
908
- let e = ne.value;
1039
+ }), ie = _(null), H = null, U = null, W = null, G = () => {
1040
+ H?.(), H = null, U = null;
1041
+ }, ae = () => {
1042
+ G();
1043
+ let e = ie.value;
909
1044
  if (!e) return;
910
1045
  let t = e.querySelector(".cm-scroller"), n = e.querySelector(".kun-editor__wysiwyg");
911
1046
  if (!t || !n) return;
912
1047
  let r = (e, t) => () => {
913
- if (G && G !== e) return;
914
- G = e;
1048
+ if (U && U !== e) return;
1049
+ U = e;
915
1050
  let n = e.scrollHeight - e.clientHeight, r = n > 0 ? e.scrollTop / n : 0, i = t.scrollHeight - t.clientHeight;
916
- t.scrollTop = r * (i > 0 ? i : 0), K && clearTimeout(K), K = setTimeout(() => {
917
- G = null;
1051
+ t.scrollTop = r * (i > 0 ? i : 0), W && clearTimeout(W), W = setTimeout(() => {
1052
+ U = null;
918
1053
  }, 120);
919
1054
  }, i = r(t, n), a = r(n, t);
920
- t.addEventListener("scroll", i, { passive: !0 }), n.addEventListener("scroll", a, { passive: !0 }), W = () => {
1055
+ t.addEventListener("scroll", i, { passive: !0 }), n.addEventListener("scroll", a, { passive: !0 }), H = () => {
921
1056
  t.removeEventListener("scroll", i), n.removeEventListener("scroll", a);
922
1057
  };
923
1058
  };
924
- C([L, V], ([e, t]) => {
925
- q(), e === "split" && t && u(re);
926
- }), f(q);
927
- let ie = t(() => k.readonly || L.value === "split"), ae = (e) => A("update:modelValue", e), J = _(null), oe = _(null);
1059
+ w([L, B], ([e, t]) => {
1060
+ G(), e === "split" && t && u(ae);
1061
+ }), f(G);
1062
+ let oe = t(() => O.readonly || L.value === "split"), K = (e) => k("update:modelValue", e), q = _(null), se = _(null);
928
1063
  return l({
929
- insertQuote: (e) => J.value?.insertQuote(e),
930
- insertMention: (e) => J.value?.insertMention(e),
931
- insertImage: (e) => J.value?.insertImage(e),
932
- uploadImage: (e) => J.value?.uploadImage(e),
933
- focus: () => J.value?.focus(),
1064
+ insertQuote: (e) => q.value?.insertQuote(e),
1065
+ insertMention: (e) => q.value?.insertMention(e),
1066
+ insertImage: (e) => q.value?.insertImage(e),
1067
+ uploadImage: (e) => q.value?.uploadImage(e),
1068
+ focus: () => q.value?.focus(),
934
1069
  scrollToHeading: (e) => {
935
- L.value === "source" || L.value === "split" ? oe.value?.scrollToHeading(e) : J.value?.scrollToHeading(e);
1070
+ L.value === "source" || L.value === "split" ? se.value?.scrollToHeading(e) : q.value?.scrollToHeading(e);
936
1071
  }
937
1072
  }), (t, l) => (m(), i("div", {
938
1073
  ref_key: "rootEl",
939
- ref: ne,
1074
+ ref: ie,
940
1075
  class: "kun-editor",
941
1076
  "data-kun-editor": "",
942
1077
  "data-mode": L.value
943
- }, [M.value ? (m(), i(e, { key: 0 }, [y(t.$slots, "view-switch", {
1078
+ }, [j.value ? (m(), i(e, { key: 0 }, [y(t.$slots, "view-switch", {
944
1079
  mode: L.value,
945
- setMode: R,
946
- labels: U.value,
1080
+ setMode: te,
1081
+ labels: V.value,
947
1082
  views: s.views,
948
- swapped: z.value,
949
- swap: B,
950
- scrollSync: V.value,
951
- toggleScrollSync: H
952
- }, () => [s.views.length > 1 ? (m(), i("div", Tt, [(m(!0), i(e, null, v(s.views, (e) => (m(), i("button", {
1083
+ swapped: R.value,
1084
+ swap: z,
1085
+ scrollSync: B.value,
1086
+ toggleScrollSync: ne
1087
+ }, () => [s.views.length > 1 ? (m(), i("div", Ht, [(m(!0), i(e, null, v(s.views, (e) => (m(), i("button", {
953
1088
  key: e,
954
1089
  type: "button",
955
1090
  class: "kun-editor__tab",
956
1091
  "aria-selected": L.value === e,
957
1092
  "data-active": L.value === e,
958
- onClick: (t) => R(e)
959
- }, b(U.value[e]), 9, Et))), 128)), L.value === "split" ? (m(), i(e, { key: 0 }, [a("button", {
1093
+ onClick: (t) => te(e)
1094
+ }, b(V.value[e]), 9, Ut))), 128)), L.value === "split" ? (m(), i(e, { key: 0 }, [a("button", {
960
1095
  type: "button",
961
1096
  class: "kun-editor__tab kun-editor__swap",
962
- title: U.value.swap,
963
- "aria-label": U.value.swap,
964
- onClick: l[0] ||= (e) => B()
965
- }, " ⇄ ", 8, Dt), a("button", {
1097
+ title: V.value.swap,
1098
+ "aria-label": V.value.swap,
1099
+ onClick: l[0] ||= (e) => z()
1100
+ }, " ⇄ ", 8, Wt), a("button", {
966
1101
  type: "button",
967
1102
  class: "kun-editor__tab",
968
- "data-active": V.value,
969
- title: U.value.scrollSync,
970
- "aria-pressed": V.value,
971
- onClick: l[1] ||= (e) => H()
972
- }, b(U.value.scrollSync), 9, Ot)], 64)) : r("", !0)])) : r("", !0)]), o(x(O), null, {
973
- default: w(() => [o(x(j), null, {
974
- default: w(() => [T(a("div", null, [o(St, null, {
975
- default: w((e) => [y(t.$slots, "toolbar", d(c(e)), () => [o(xt)])]),
1103
+ "data-active": B.value,
1104
+ title: V.value.scrollSync,
1105
+ "aria-pressed": B.value,
1106
+ onClick: l[1] ||= (e) => ne()
1107
+ }, b(V.value.scrollSync), 9, Gt)], 64)) : r("", !0)])) : r("", !0)]), o(x(A), null, {
1108
+ default: T(() => [o(x(N), null, {
1109
+ default: T(() => [E(a("div", null, [o(zt, null, {
1110
+ default: T((e) => [y(t.$slots, "toolbar", d(c(e)), () => [o(Rt)])]),
976
1111
  _: 3
977
- })], 512), [[S, L.value === "wysiwyg" && !s.readonly]]), a("div", {
1112
+ })], 512), [[C, L.value === "wysiwyg" && !s.readonly]]), a("div", {
978
1113
  class: "kun-editor__panes",
979
- "data-swap": z.value
980
- }, [L.value === "source" || L.value === "split" ? (m(), n(Ct, {
1114
+ "data-swap": R.value
1115
+ }, [L.value === "source" || L.value === "split" ? (m(), n(Bt, {
981
1116
  key: 0,
982
1117
  ref_key: "source",
983
- ref: oe,
1118
+ ref: se,
984
1119
  class: "kun-editor__pane",
985
1120
  "model-value": s.modelValue,
986
1121
  readonly: s.readonly,
987
- "onUpdate:modelValue": ae
988
- }, null, 8, ["model-value", "readonly"])) : r("", !0), T(a("div", At, [o(Xe, {
1122
+ "onUpdate:modelValue": K
1123
+ }, null, 8, ["model-value", "readonly"])) : r("", !0), E(a("div", qt, [o(ot, {
989
1124
  ref_key: "inner",
990
- ref: J,
1125
+ ref: q,
991
1126
  "model-value": s.modelValue,
992
1127
  adapters: s.adapters,
993
1128
  features: s.features,
994
1129
  locale: s.locale,
995
- readonly: ie.value,
1130
+ readonly: oe.value,
996
1131
  placeholder: s.placeholder,
997
1132
  "placeholder-mode": s.placeholderMode,
998
1133
  active: L.value === "wysiwyg" && !s.readonly,
999
- "selection-toolbar": I.value,
1000
- "onUpdate:modelValue": ae,
1001
- "onUpdate:loading": P
1134
+ "selection-toolbar": F.value,
1135
+ "onUpdate:modelValue": K,
1136
+ "onUpdate:loading": ee
1002
1137
  }, null, 8, [
1003
1138
  "model-value",
1004
1139
  "adapters",
@@ -1009,18 +1144,18 @@ var Ae = [
1009
1144
  "placeholder-mode",
1010
1145
  "active",
1011
1146
  "selection-toolbar"
1012
- ])], 512), [[S, L.value === "wysiwyg" || L.value === "split"]])], 8, kt)]),
1147
+ ])], 512), [[C, L.value === "wysiwyg" || L.value === "split"]])], 8, Kt)]),
1013
1148
  _: 3
1014
1149
  })]),
1015
1150
  _: 3
1016
- })], 64)) : r("", !0), !M.value || N.value ? (m(), i("div", jt, [y(t.$slots, "loading", {}, () => [
1151
+ })], 64)) : r("", !0), !j.value || M.value ? (m(), i("div", Jt, [y(t.$slots, "loading", {}, () => [
1017
1152
  l[2] ||= a("div", { class: "kun-editor__skeleton" }, null, -1),
1018
1153
  l[3] ||= a("div", { class: "kun-editor__skeleton" }, null, -1),
1019
1154
  l[4] ||= a("div", { class: "kun-editor__skeleton" }, null, -1)
1020
- ])])) : r("", !0)], 8, wt));
1155
+ ])])) : r("", !0)], 8, Vt));
1021
1156
  }
1022
- }), Nt = { install(e) {
1023
- e.component("KunEditor", Mt);
1157
+ }), Xt = { install(e) {
1158
+ e.component("KunEditor", Yt);
1024
1159
  } };
1025
1160
  //#endregion
1026
- export { Ze as EMOJI, Mt as KunEditor, Nt as KunEditorPlugin, P as parseHeadings };
1161
+ export { mt as EMOJI, Yt as KunEditor, Xt as KunEditorPlugin, F as parseHeadings };