@kungal/editor-vue 0.17.0 → 0.18.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/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @kungal/editor-vue
2
2
 
3
+ ## 0.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6545866: Toolbar image upload now shows an in-document "uploading…" placeholder.
8
+
9
+ Previously only paste/drop showed the in-flight placeholder (Milkdown's `upload`
10
+ plugin); the toolbar image button uploaded silently — the image just popped in
11
+ when the adapter resolved. Now the toolbar path uses the same placeholder UX
12
+ (ProseMirror's official upload-example pattern).
13
+
14
+ - **editor-core**: `startImageUpload(view, file, { uploadImage, notify, locale })`
15
+ - the `imageUploadPlaceholder` decoration plugin (exported from `/preset`;
16
+ wired by the preset when `uploadImage` is present). Inserts a
17
+ `.kun-editor__uploading` widget at the caret, uploads, then replaces it with the
18
+ image (or removes it + notifies on failure); not an undo step. The paste/drop
19
+ placeholder now uses the same `.kun-editor__uploading` class so both look
20
+ identical.
21
+ - **editor-vue**: `KunEditorToolbarApi` gains `uploadImage(file)`; both the
22
+ headless `EditorToolbar` and the `#toolbar` slot API route uploads through
23
+ `startImageUpload`.
24
+ - **editor-nuxt**: `<KunEditorToolbar>`'s image button uses it.
25
+ - **Headless kept**: the placeholder is a class + widget hook only; style it via
26
+ `.kun-editor__uploading` in the reference `kun-editor.css` (primary-colored).
27
+
28
+ Customizable: style the placeholder via `.kun-editor__uploading`; the text is
29
+ localized (zh/en). Verified in the docs production build: uploading via either
30
+ toolbar inserts the image; the unit tests confirm the placeholder shows during a
31
+ pending upload and is replaced on success / removed on failure.
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [6545866]
36
+ - @kungal/editor-core@0.18.0
37
+
3
38
  ## 0.17.0
4
39
 
5
40
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"EditorToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/EditorToolbar.vue"],"names":[],"mappings":"AAmcA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EditorToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/EditorToolbar.vue"],"names":[],"mappings":"AAycA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -25,6 +25,7 @@ declare var __VLS_1: {
25
25
  }, __VLS_22: {
26
26
  run: <T>(key: import("@milkdown/kit/core").CmdKey<T>, payload?: T) => void;
27
27
  insertText: (text: string) => void;
28
+ uploadImage: (file: File) => void;
28
29
  insertQuote: (payload: {
29
30
  refId: string;
30
31
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"KunEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/KunEditor.vue"],"names":[],"mappings":"AAsLA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAM5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,WAAW,GAAG;IACf,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,qDAAqD;IACrD,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAqCJ,KAAK,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;AA8MpC,QAAA,IAAI,OAAO;;iBA5MS,QAAQ;;;;;CA4MP,EAAE,QAAQ;iEA/Q/B,CAzKwB;;;;;;;;;;;;;;CAwbwC,CAAE;AAClE,KAAK,WA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Q;iEA/Q/B,CAzKwB;;;;;;;;;;;;;;;CAwbwC,CAAE;AAClE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAClD;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAOhD,QAAA,MAAM,UAAU;;;;;cAtQD,iBAAiB;cAEjB,iBAAiB;YAEnB,eAAe;cAEb,OAAO;iBAEJ,MAAM;6EAmQtB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,6 +2,7 @@ import type { CmdKey } from '@milkdown/kit/core';
2
2
  declare var __VLS_1: {
3
3
  run: <T>(key: CmdKey<T>, payload?: T) => void;
4
4
  insertText: (text: string) => void;
5
+ uploadImage: (file: File) => void;
5
6
  insertQuote: (payload: {
6
7
  refId: string;
7
8
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarHost.vue.d.ts","sourceRoot":"","sources":["../../src/components/ToolbarHost.vue"],"names":[],"mappings":"AAyEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAuEhD,QAAA,IAAI,OAAO;oCAxEX,CA9De;;;;;;;;;;;;;;CAsIO,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ToolbarHost.vue.d.ts","sourceRoot":"","sources":["../../src/components/ToolbarHost.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAuFhD,QAAA,IAAI,OAAO;oCAxFX,CA9Ee;;;;;;;;;;;;;;;CAsKO,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
package/dist/index.js CHANGED
@@ -4,33 +4,33 @@ import { ProsemirrorAdapterProvider as k, usePluginViewContext as A, usePluginVi
4
4
  import { Editor as M, defaultValueCtx as N, editorViewCtx as P, editorViewOptionsCtx as F, rootCtx as I } from "@milkdown/kit/core";
5
5
  import { listenerCtx as L } from "@milkdown/kit/plugin/listener";
6
6
  import { SlashProvider as ee, slashFactory as te } from "@milkdown/kit/plugin/slash";
7
- import { callCommand as R, replaceAll as z } from "@milkdown/kit/utils";
8
- import { createKunEditorPlugins as ne, insertKunSpoilerCommand as re, insertMentionCommand as B, insertQuoteCommand as V, kunCM as ie, mentionId as ae, setHeadingCommand as oe } from "@kungal/editor-core/preset";
9
- import { TextSelection as se } from "@milkdown/kit/prose/state";
10
- import { createCodeBlockCommand as ce, insertHrCommand as H, insertImageCommand as U, toggleEmphasisCommand as W, toggleInlineCodeCommand as G, toggleStrongCommand as le, wrapInBlockquoteCommand as ue, wrapInBulletListCommand as de, wrapInOrderedListCommand as fe } from "@milkdown/kit/preset/commonmark";
11
- import { toggleStrikethroughCommand as pe } from "@milkdown/kit/preset/gfm";
12
- import { EditorState as me } from "@codemirror/state";
7
+ import { callCommand as R, replaceAll as ne } from "@milkdown/kit/utils";
8
+ import { createKunEditorPlugins as re, insertKunSpoilerCommand as ie, insertMentionCommand as z, insertQuoteCommand as B, kunCM as ae, mentionId as oe, setHeadingCommand as se, startImageUpload as V } from "@kungal/editor-core/preset";
9
+ import { TextSelection as ce } from "@milkdown/kit/prose/state";
10
+ import { createCodeBlockCommand as H, insertHrCommand as U, insertImageCommand as W, toggleEmphasisCommand as G, toggleInlineCodeCommand as le, toggleStrongCommand as ue, wrapInBlockquoteCommand as de, wrapInBulletListCommand as fe, wrapInOrderedListCommand as pe } from "@milkdown/kit/preset/commonmark";
11
+ import { toggleStrikethroughCommand as me } from "@milkdown/kit/preset/gfm";
12
+ import { EditorState as he } from "@codemirror/state";
13
13
  import { EditorView as K } from "@codemirror/view";
14
- import { markdown as he } from "@codemirror/lang-markdown";
15
- import { basicSetup as ge } from "codemirror";
14
+ import { markdown as ge } from "@codemirror/lang-markdown";
15
+ import { basicSetup as _e } from "codemirror";
16
16
  //#region src/context.ts
17
- var q = Symbol("kun-editor-context"), _e = [
17
+ var q = Symbol("kun-editor-context"), ve = [
18
18
  "data-active",
19
19
  "onMousedown",
20
20
  "onMouseenter"
21
- ], ve = ["src", "alt"], ye = {
21
+ ], ye = ["src", "alt"], be = {
22
22
  key: 1,
23
23
  class: "kun-mention-dropdown__avatar kun-mention-dropdown__avatar--fallback"
24
- }, be = { class: "kun-mention-dropdown__name" }, xe = {
24
+ }, xe = { class: "kun-mention-dropdown__name" }, Se = {
25
25
  key: 1,
26
26
  class: "kun-mention-dropdown__hint"
27
- }, Se = {
27
+ }, Ce = {
28
28
  key: 2,
29
29
  class: "kun-mention-dropdown__hint"
30
- }, Ce = {
30
+ }, we = {
31
31
  key: 3,
32
32
  class: "kun-mention-dropdown__hint"
33
- }, we = /* @__PURE__ */ s({
33
+ }, Te = /* @__PURE__ */ s({
34
34
  __name: "MentionDropdown",
35
35
  setup(n) {
36
36
  let r = /(?:^|\s)@([^\s@]{0,30})$/, o = l(q), s = o?.adapters.searchMentionUsers, c = t(() => (o?.locale ?? "zh-cn").toLowerCase().startsWith("en")), u = t(() => c.value ? {
@@ -73,13 +73,13 @@ var q = Symbol("kun-editor-context"), _e = [
73
73
  }, I = (e) => {
74
74
  let t = m.value;
75
75
  if (!t || !O) return;
76
- let n = t.state.schema.nodes[ae];
76
+ let n = t.state.schema.nodes[oe];
77
77
  if (!n) return;
78
78
  let r = n.create({
79
79
  userId: e.id,
80
80
  name: e.name
81
81
  }), { from: i, to: a } = O, o = t.state.tr.replaceWith(i, a, r), s = i + r.nodeSize;
82
- o.insertText(" ", s), o.setSelection(se.create(o.doc, s + 1)), t.dispatch(o.scrollIntoView()), t.focus(), b.hide();
82
+ o.insertText(" ", s), o.setSelection(ce.create(o.doc, s + 1)), t.dispatch(o.scrollIntoView()), t.focus(), b.hide();
83
83
  }, L = (e) => {
84
84
  if (!S.value || !T.value.length) {
85
85
  S.value && e.key === "Escape" && (e.preventDefault(), b.hide());
@@ -136,9 +136,9 @@ var q = Symbol("kun-editor-context"), _e = [
136
136
  src: e.avatar,
137
137
  alt: e.name,
138
138
  class: "kun-mention-dropdown__avatar"
139
- }, null, 8, ve)) : (p(), i("span", ye, v(e.name.charAt(0)), 1)), a("span", be, v(e.name), 1)], 40, _e))), 128)) : D.value ? (p(), i("div", xe, v(u.value.searching), 1)) : C.value ? (p(), i("div", Se, v(u.value.empty), 1)) : (p(), i("div", Ce, v(u.value.prompt), 1))], 512));
139
+ }, null, 8, ye)) : (p(), i("span", be, v(e.name.charAt(0)), 1)), a("span", xe, v(e.name), 1)], 40, ve))), 128)) : D.value ? (p(), i("div", Se, v(u.value.searching), 1)) : C.value ? (p(), i("div", Ce, v(u.value.empty), 1)) : (p(), i("div", we, v(u.value.prompt), 1))], 512));
140
140
  }
141
- }), Te = /* @__PURE__ */ s({
141
+ }), Ee = /* @__PURE__ */ s({
142
142
  __name: "MilkdownEditor",
143
143
  props: {
144
144
  modelValue: {},
@@ -157,25 +157,25 @@ var q = Symbol("kun-editor-context"), _e = [
157
157
  }), t.update(F, (e) => ({
158
158
  ...e,
159
159
  editable: () => !i.readonly
160
- })), l && t.set(c.key, { view: s({ component: we }) });
161
- }).use(ne(i.adapters, i.features, {
160
+ })), l && t.set(c.key, { view: s({ component: Te }) });
161
+ }).use(re(i.adapters, i.features, {
162
162
  locale: i.locale,
163
163
  placeholder: i.placeholder
164
164
  }));
165
165
  return l && t.use(c), t;
166
166
  });
167
167
  x(() => i.modelValue, (e) => {
168
- e !== o && (o = e, u.get()?.action(z(e)));
168
+ e !== o && (o = e, u.get()?.action(ne(e)));
169
169
  });
170
170
  let d = () => {
171
171
  u.get()?.action((e) => e.get(P).focus());
172
172
  };
173
173
  return t({
174
174
  insertQuote: (e) => {
175
- u.get()?.action(R(V.key, e)), d();
175
+ u.get()?.action(R(B.key, e)), d();
176
176
  },
177
177
  insertMention: (e) => {
178
- u.get()?.action(R(B.key, e)), d();
178
+ u.get()?.action(R(z.key, e)), d();
179
179
  },
180
180
  focus: d
181
181
  }), (e, t) => (p(), n(y(T)));
@@ -197,21 +197,21 @@ var q = Symbol("kun-editor-context"), _e = [
197
197
  spoiler: J("<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\"/>"),
198
198
  latex: Y("Σ", 15),
199
199
  smile: J("<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\"/>")
200
- }, Z = /* @__PURE__ */ "😀.😃.😄.😁.😆.😅.🤣.😂.🙂.🙃.😉.😊.😇.🥰.😍.🤩.😘.😗.😚.😋.😛.😜.🤪.😝.🤗.🤭.🤔.🤐.😐.😑.😶.😏.😒.🙄.😬.😌.😔.😪.🤤.😴.😷.🤒.🤕.🥵.🥶.🥴.😵.🤯.🤠.🥳.😎.🤓.🧐.😕.😟.🙁.😮.😯.😲.😳.🥺.😦.😧.😨.😰.😥.😢.😭.😱.😖.😣.😞.😓.😩.😫.🥱.😤.😡.😠.🤬.😈.👿.💀.💩.🤡.👻.👽.🤖.😺.😸.👍.👎.👌.🤌.🤏.✌️.🤞.🤟.🤘.👋.🤚.🖐️.✋.👏.🙌.🤝.🙏.💪.👀.👁️.❤️.🧡.💛.💚.💙.💜.🖤.🤍.💔.💕.💞.💓.💗.💖.💘.💝.💯.✨.⭐.🌟.🔥.💥.💫.⚡.☀️.🌈.🎉.🎊.🎁.🏆.🐶.🐱.🐭.🦊.🐻.🐼.🐨.🦄.🐢.🐳.🍎.🍑.🍓.🍉.🍰.🍺.🍵.☕.🍜.🍙.✅.❌.❓.❗.💤.👑.🎮.🎵.📌.🔖".split("."), Ee = [
200
+ }, Z = /* @__PURE__ */ "😀.😃.😄.😁.😆.😅.🤣.😂.🙂.🙃.😉.😊.😇.🥰.😍.🤩.😘.😗.😚.😋.😛.😜.🤪.😝.🤗.🤭.🤔.🤐.😐.😑.😶.😏.😒.🙄.😬.😌.😔.😪.🤤.😴.😷.🤒.🤕.🥵.🥶.🥴.😵.🤯.🤠.🥳.😎.🤓.🧐.😕.😟.🙁.😮.😯.😲.😳.🥺.😦.😧.😨.😰.😥.😢.😭.😱.😖.😣.😞.😓.😩.😫.🥱.😤.😡.😠.🤬.😈.👿.💀.💩.🤡.👻.👽.🤖.😺.😸.👍.👎.👌.🤌.🤏.✌️.🤞.🤟.🤘.👋.🤚.🖐️.✋.👏.🙌.🤝.🙏.💪.👀.👁️.❤️.🧡.💛.💚.💙.💜.🖤.🤍.💔.💕.💞.💓.💗.💖.💘.💝.💯.✨.⭐.🌟.🔥.💥.💫.⚡.☀️.🌈.🎉.🎊.🎁.🏆.🐶.🐱.🐭.🦊.🐻.🐼.🐨.🦄.🐢.🐳.🍎.🍑.🍓.🍉.🍰.🍺.🍵.☕.🍜.🍙.✅.❌.❓.❗.💤.👑.🎮.🎵.📌.🔖".split("."), De = [
201
201
  "title",
202
202
  "aria-label",
203
203
  "aria-expanded"
204
- ], De = ["innerHTML"], Oe = { class: "kun-editor__picker-panel" }, ke = {
204
+ ], Oe = ["innerHTML"], ke = { class: "kun-editor__picker-panel" }, Ae = {
205
205
  key: 0,
206
206
  class: "kun-editor__picker-tabs",
207
207
  role: "tablist"
208
- }, Ae = ["data-active"], je = ["data-active"], Me = { class: "kun-editor__emoji-grid" }, Ne = ["onClick"], Pe = {
208
+ }, je = ["data-active"], Me = ["data-active"], Ne = { class: "kun-editor__emoji-grid" }, Pe = ["onClick"], Fe = {
209
209
  key: 1,
210
210
  class: "kun-editor__sticker-body"
211
- }, Fe = { class: "kun-editor__pack-name" }, Ie = { class: "kun-editor__sticker-grid" }, Le = ["title", "onClick"], Re = ["src", "alt"], ze = {
211
+ }, Ie = { class: "kun-editor__pack-name" }, Le = { class: "kun-editor__sticker-grid" }, Re = ["title", "onClick"], ze = ["src", "alt"], Be = {
212
212
  key: 1,
213
213
  class: "kun-editor__picker-hint"
214
- }, Be = /* @__PURE__ */ s({
214
+ }, Ve = /* @__PURE__ */ s({
215
215
  __name: "StickerPicker",
216
216
  setup(n) {
217
217
  let [, o] = O(), s = l(q), c = s?.adapters.stickerSource, u = !!c, m = t(() => (s?.locale ?? "zh-cn").toLowerCase().startsWith("en")), _ = t(() => m.value ? {
@@ -247,7 +247,7 @@ var q = Symbol("kun-editor-context"), _e = [
247
247
  n.dispatch(r.tr.insertText(e, r.selection.from));
248
248
  });
249
249
  }, N = (e, t) => {
250
- o()?.action(R(U.key, {
250
+ o()?.action(R(W.key, {
251
251
  src: e,
252
252
  title: t,
253
253
  alt: t
@@ -267,28 +267,28 @@ var q = Symbol("kun-editor-context"), _e = [
267
267
  }, [a("span", {
268
268
  class: "kun-editor__icon",
269
269
  innerHTML: y(X).smile
270
- }, null, 8, De)], 8, Ee), C(a("div", Oe, [
271
- u ? (p(), i("div", ke, [a("button", {
270
+ }, null, 8, Oe)], 8, De), C(a("div", ke, [
271
+ u ? (p(), i("div", Ae, [a("button", {
272
272
  type: "button",
273
273
  class: "kun-editor__picker-tab",
274
274
  "data-active": w.value === "emoji",
275
275
  onClick: n[0] ||= (e) => w.value = "emoji"
276
- }, v(_.value.emoji), 9, Ae), a("button", {
276
+ }, v(_.value.emoji), 9, je), a("button", {
277
277
  type: "button",
278
278
  class: "kun-editor__picker-tab",
279
279
  "data-active": w.value === "sticker",
280
280
  onClick: n[1] ||= (e) => w.value = "sticker"
281
- }, v(_.value.sticker), 9, je)])) : r("", !0),
282
- C(a("div", Me, [(p(!0), i(e, null, g(y(Z), (e, t) => (p(), i("button", {
281
+ }, v(_.value.sticker), 9, Me)])) : r("", !0),
282
+ C(a("div", Ne, [(p(!0), i(e, null, g(y(Z), (e, t) => (p(), i("button", {
283
283
  key: t,
284
284
  type: "button",
285
285
  class: "kun-editor__emoji",
286
286
  onClick: (t) => M(e)
287
- }, v(e), 9, Ne))), 128))], 512), [[b, !u || w.value === "emoji"]]),
288
- u ? C((p(), i("div", Pe, [T.value.length ? (p(!0), i(e, { key: 0 }, g(T.value, (t) => (p(), i("div", {
287
+ }, v(e), 9, Pe))), 128))], 512), [[b, !u || w.value === "emoji"]]),
288
+ u ? C((p(), i("div", Fe, [T.value.length ? (p(!0), i(e, { key: 0 }, g(T.value, (t) => (p(), i("div", {
289
289
  key: t.name,
290
290
  class: "kun-editor__pack"
291
- }, [a("div", Fe, v(t.name), 1), a("div", Ie, [(p(!0), i(e, null, g(t.stickers, (e, t) => (p(), i("button", {
291
+ }, [a("div", Ie, v(t.name), 1), a("div", Le, [(p(!0), i(e, null, g(t.stickers, (e, t) => (p(), i("button", {
292
292
  key: t,
293
293
  type: "button",
294
294
  class: "kun-editor__sticker",
@@ -298,27 +298,27 @@ var q = Symbol("kun-editor-context"), _e = [
298
298
  src: e.src,
299
299
  alt: e.name,
300
300
  loading: "lazy"
301
- }, null, 8, Re)], 8, Le))), 128))])]))), 128)) : (p(), i("div", ze, v(D.value ? _.value.failed : _.value.empty), 1))], 512)), [[b, w.value === "sticker"]]) : r("", !0)
301
+ }, null, 8, ze)], 8, Re))), 128))])]))), 128)) : (p(), i("div", Be, v(D.value ? _.value.failed : _.value.empty), 1))], 512)), [[b, w.value === "sticker"]]) : r("", !0)
302
302
  ], 512), [[b, x.value]])], 512));
303
303
  }
304
- }), Ve = {
304
+ }), He = {
305
305
  class: "kun-editor__format-toolbar",
306
306
  role: "toolbar"
307
- }, He = ["aria-label"], Q = {
307
+ }, Ue = ["aria-label"], We = {
308
308
  value: "",
309
309
  disabled: "",
310
310
  selected: ""
311
- }, Ue = ["value"], We = [
311
+ }, Ge = ["value"], Ke = [
312
312
  "title",
313
313
  "aria-label",
314
314
  "onClick"
315
- ], Ge = ["innerHTML"], Ke = ["title", "aria-label"], qe = ["innerHTML"], Je = /* @__PURE__ */ s({
315
+ ], qe = ["innerHTML"], Je = ["title", "aria-label"], Ye = ["innerHTML"], Q = /* @__PURE__ */ s({
316
316
  __name: "EditorToolbar",
317
317
  setup(n) {
318
- let [, s] = O(), c = l(q), u = t(() => c?.adapters.uploadImage), d = () => c?.adapters.notify, f = t(() => c?.features.sticker !== !1), m = t(() => (c?.locale ?? "zh-cn").toLowerCase().startsWith("en")), _ = (e, t) => {
318
+ let [, s] = O(), c = l(q), u = t(() => c?.adapters.uploadImage), d = t(() => c?.features.sticker !== !1), f = t(() => (c?.locale ?? "zh-cn").toLowerCase().startsWith("en")), m = (e, t) => {
319
319
  s()?.action(R(e, t));
320
- }, b = t(() => {
321
- let e = m.value;
320
+ }, _ = t(() => {
321
+ let e = f.value;
322
322
  return {
323
323
  textSize: e ? "Text size" : "文本大小",
324
324
  bold: e ? "Bold" : "加粗",
@@ -333,8 +333,8 @@ var q = Symbol("kun-editor-context"), _e = [
333
333
  spoiler: e ? "Spoiler" : "隐藏文本",
334
334
  image: e ? "Upload image" : "上传图片"
335
335
  };
336
- }), x = t(() => {
337
- let e = m.value;
336
+ }), b = t(() => {
337
+ let e = f.value;
338
338
  return [
339
339
  "正文",
340
340
  "一级标题",
@@ -347,89 +347,86 @@ var q = Symbol("kun-editor-context"), _e = [
347
347
  level: n,
348
348
  label: e ? n === 0 ? "Paragraph" : `Heading ${n}` : t
349
349
  }));
350
- }), S = (e) => {
350
+ }), x = (e) => {
351
351
  let t = e.target;
352
- _(oe.key, Number(t.value)), t.selectedIndex = 0;
353
- }, C = t(() => [
352
+ m(se.key, Number(t.value)), t.selectedIndex = 0;
353
+ }, S = t(() => [
354
354
  [
355
355
  {
356
356
  svg: X.bold,
357
- title: b.value.bold,
358
- run: () => _(le.key)
357
+ title: _.value.bold,
358
+ run: () => m(ue.key)
359
359
  },
360
360
  {
361
361
  svg: X.italic,
362
- title: b.value.italic,
363
- run: () => _(W.key)
362
+ title: _.value.italic,
363
+ run: () => m(G.key)
364
364
  },
365
365
  {
366
366
  svg: X.strike,
367
- title: b.value.strike,
368
- run: () => _(pe.key)
367
+ title: _.value.strike,
368
+ run: () => m(me.key)
369
369
  },
370
370
  {
371
371
  svg: X.code,
372
- title: b.value.code,
373
- run: () => _(G.key)
372
+ title: _.value.code,
373
+ run: () => m(le.key)
374
374
  }
375
375
  ],
376
376
  [
377
377
  {
378
378
  svg: X.bulletList,
379
- title: b.value.bulletList,
380
- run: () => _(de.key)
379
+ title: _.value.bulletList,
380
+ run: () => m(fe.key)
381
381
  },
382
382
  {
383
383
  svg: X.orderedList,
384
- title: b.value.orderedList,
385
- run: () => _(fe.key)
384
+ title: _.value.orderedList,
385
+ run: () => m(pe.key)
386
386
  },
387
387
  {
388
388
  svg: X.quote,
389
- title: b.value.quote,
390
- run: () => _(ue.key)
389
+ title: _.value.quote,
390
+ run: () => m(de.key)
391
391
  },
392
392
  {
393
393
  svg: X.codeBlock,
394
- title: b.value.codeBlock,
395
- run: () => _(ce.key, "")
394
+ title: _.value.codeBlock,
395
+ run: () => m(H.key, "")
396
396
  },
397
397
  {
398
398
  svg: X.hr,
399
- title: b.value.hr,
400
- run: () => _(H.key)
399
+ title: _.value.hr,
400
+ run: () => m(U.key)
401
401
  }
402
402
  ],
403
403
  [{
404
404
  svg: X.spoiler,
405
- title: b.value.spoiler,
406
- run: () => _(re.key)
405
+ title: _.value.spoiler,
406
+ run: () => m(ie.key)
407
407
  }]
408
- ]), w = h(null), T = () => w.value?.click(), E = async (e) => {
408
+ ]), C = h(null), w = () => C.value?.click(), T = (e) => {
409
409
  let t = e.target, n = t.files?.[0];
410
410
  t.value = "";
411
411
  let r = u.value;
412
- if (!(!n || !r)) try {
413
- let e = await r(n);
414
- _(U.key, {
415
- src: e,
416
- title: n.name,
417
- alt: n.name
412
+ !n || !r || s()?.action((e) => {
413
+ V(e.get(P), n, {
414
+ uploadImage: r,
415
+ notify: c?.adapters.notify,
416
+ locale: c?.locale
418
417
  });
419
- } catch {
420
- d()?.(m.value ? "Image upload failed" : "图片上传失败", "error");
421
- }
418
+ });
422
419
  };
423
- return (t, n) => (p(), i("div", Ve, [
420
+ return (t, n) => (p(), i("div", He, [
424
421
  a("select", {
425
422
  class: "kun-editor__heading-select",
426
- "aria-label": b.value.textSize,
427
- onChange: S
428
- }, [a("option", Q, v(b.value.textSize), 1), (p(!0), i(e, null, g(x.value, (e) => (p(), i("option", {
423
+ "aria-label": _.value.textSize,
424
+ onChange: x
425
+ }, [a("option", We, v(_.value.textSize), 1), (p(!0), i(e, null, g(b.value, (e) => (p(), i("option", {
429
426
  key: e.level,
430
427
  value: e.level
431
- }, v(e.label), 9, Ue))), 128))], 40, He),
432
- (p(!0), i(e, null, g(C.value, (t, r) => (p(), i(e, { key: r }, [n[0] ||= a("span", {
428
+ }, v(e.label), 9, Ge))), 128))], 40, Ue),
429
+ (p(!0), i(e, null, g(S.value, (t, r) => (p(), i(e, { key: r }, [n[0] ||= a("span", {
433
430
  class: "kun-editor__toolbar-divider",
434
431
  "aria-hidden": "true"
435
432
  }, null, -1), (p(!0), i(e, null, g(t, (e, t) => (p(), i("button", {
@@ -442,7 +439,7 @@ var q = Symbol("kun-editor-context"), _e = [
442
439
  }, [a("span", {
443
440
  class: "kun-editor__icon",
444
441
  innerHTML: e.svg
445
- }, null, 8, Ge)], 8, We))), 128))], 64))), 128)),
442
+ }, null, 8, qe)], 8, Ke))), 128))], 64))), 128)),
446
443
  u.value ? (p(), i(e, { key: 0 }, [
447
444
  n[1] ||= a("span", {
448
445
  class: "kun-editor__toolbar-divider",
@@ -451,29 +448,29 @@ var q = Symbol("kun-editor-context"), _e = [
451
448
  a("button", {
452
449
  type: "button",
453
450
  class: "kun-editor__tool",
454
- title: b.value.image,
455
- "aria-label": b.value.image,
456
- onClick: T
451
+ title: _.value.image,
452
+ "aria-label": _.value.image,
453
+ onClick: w
457
454
  }, [a("span", {
458
455
  class: "kun-editor__icon",
459
456
  innerHTML: y(X).image
460
- }, null, 8, qe)], 8, Ke),
457
+ }, null, 8, Ye)], 8, Je),
461
458
  a("input", {
462
459
  ref_key: "fileInput",
463
- ref: w,
460
+ ref: C,
464
461
  type: "file",
465
462
  accept: ".jpg,.jpeg,.png,.webp,.gif",
466
463
  hidden: "",
467
- onChange: E
464
+ onChange: T
468
465
  }, null, 544)
469
466
  ], 64)) : r("", !0),
470
- f.value ? (p(), i(e, { key: 1 }, [n[2] ||= a("span", {
467
+ d.value ? (p(), i(e, { key: 1 }, [n[2] ||= a("span", {
471
468
  class: "kun-editor__toolbar-divider",
472
469
  "aria-hidden": "true"
473
- }, null, -1), o(Be)], 64)) : r("", !0)
470
+ }, null, -1), o(Ve)], 64)) : r("", !0)
474
471
  ]));
475
472
  }
476
- }), Ye = /* @__PURE__ */ s({
473
+ }), Xe = /* @__PURE__ */ s({
477
474
  __name: "ToolbarHost",
478
475
  setup(e) {
479
476
  let [, t] = O(), n = l(q, void 0), r = (e, n) => {
@@ -488,11 +485,21 @@ var q = Symbol("kun-editor-context"), _e = [
488
485
  n.dispatch(n.state.tr.insertText(e));
489
486
  }), i();
490
487
  },
488
+ uploadImage: (e) => {
489
+ let r = n?.adapters.uploadImage, i = t();
490
+ !r || !i || i.action((t) => {
491
+ V(t.get(P), e, {
492
+ uploadImage: r,
493
+ notify: n?.adapters.notify,
494
+ locale: n?.locale
495
+ });
496
+ });
497
+ },
491
498
  insertQuote: (e) => {
492
- r(V.key, e), i();
499
+ r(B.key, e), i();
493
500
  },
494
501
  insertMention: (e) => {
495
- r(B.key, e), i();
502
+ r(z.key, e), i();
496
503
  },
497
504
  focus: i,
498
505
  get adapters() {
@@ -507,7 +514,7 @@ var q = Symbol("kun-editor-context"), _e = [
507
514
  };
508
515
  return (e, t) => _(e.$slots, "default", u(c(a)));
509
516
  }
510
- }), Xe = /* @__PURE__ */ s({
517
+ }), Ze = /* @__PURE__ */ s({
511
518
  __name: "MarkdownSource",
512
519
  props: {
513
520
  modelValue: {},
@@ -515,13 +522,13 @@ var q = Symbol("kun-editor-context"), _e = [
515
522
  },
516
523
  emits: ["update:modelValue"],
517
524
  setup(e, { emit: t }) {
518
- let n = e, r = t, a = h(null), o = null, s = (e) => me.create({
525
+ let n = e, r = t, a = h(null), o = null, s = (e) => he.create({
519
526
  doc: e,
520
527
  extensions: [
521
- ie(),
528
+ ae(),
522
529
  K.lineWrapping,
523
- ge,
524
- he(),
530
+ _e,
531
+ ge(),
525
532
  K.editable.of(!n.readonly),
526
533
  K.updateListener.of((e) => {
527
534
  e.docChanged && r("update:modelValue", e.state.doc.toString());
@@ -543,13 +550,13 @@ var q = Symbol("kun-editor-context"), _e = [
543
550
  class: "kun-editor__source"
544
551
  }, null, 512));
545
552
  }
546
- }), Ze = {
553
+ }), Qe = {
547
554
  class: "kun-editor",
548
555
  "data-kun-editor": ""
549
- }, Qe = {
556
+ }, $e = {
550
557
  class: "kun-editor__toolbar",
551
558
  role: "tablist"
552
- }, $e = ["aria-selected", "data-active"], et = ["aria-selected", "data-active"], tt = { class: "kun-editor__wysiwyg" }, $ = /* @__PURE__ */ s({
559
+ }, et = ["aria-selected", "data-active"], tt = ["aria-selected", "data-active"], nt = { class: "kun-editor__wysiwyg" }, $ = /* @__PURE__ */ s({
553
560
  __name: "KunEditor",
554
561
  props: {
555
562
  modelValue: {},
@@ -589,30 +596,30 @@ var q = Symbol("kun-editor-context"), _e = [
589
596
  insertQuote: (e) => O.value?.insertQuote(e),
590
597
  insertMention: (e) => O.value?.insertMention(e),
591
598
  focus: () => O.value?.focus()
592
- }), (t, s) => (p(), i("div", Ze, [
599
+ }), (t, s) => (p(), i("div", Qe, [
593
600
  _(t.$slots, "view-switch", {
594
601
  mode: g.value,
595
602
  setMode: x,
596
603
  labels: T.value
597
- }, () => [a("div", Qe, [a("button", {
604
+ }, () => [a("div", $e, [a("button", {
598
605
  type: "button",
599
606
  class: "kun-editor__tab",
600
607
  "aria-selected": g.value === "wysiwyg",
601
608
  "data-active": g.value === "wysiwyg",
602
609
  onClick: s[0] ||= (e) => x("wysiwyg")
603
- }, v(T.value.wysiwyg), 9, $e), a("button", {
610
+ }, v(T.value.wysiwyg), 9, et), a("button", {
604
611
  type: "button",
605
612
  class: "kun-editor__tab",
606
613
  "aria-selected": g.value === "source",
607
614
  "data-active": g.value === "source",
608
615
  onClick: s[1] ||= (e) => x("source")
609
- }, v(T.value.source), 9, et)])]),
616
+ }, v(T.value.source), 9, tt)])]),
610
617
  o(y(E), null, {
611
618
  default: S(() => [o(y(k), null, {
612
- default: S(() => [C(a("div", null, [o(Ye, null, {
613
- default: S((e) => [_(t.$slots, "toolbar", u(c(e)), () => [o(Je)])]),
619
+ default: S(() => [C(a("div", null, [o(Xe, null, {
620
+ default: S((e) => [_(t.$slots, "toolbar", u(c(e)), () => [o(Q)])]),
614
621
  _: 3
615
- })], 512), [[b, g.value === "wysiwyg" && !e.readonly]]), C(a("div", tt, [o(Te, {
622
+ })], 512), [[b, g.value === "wysiwyg" && !e.readonly]]), C(a("div", nt, [o(Ee, {
616
623
  ref_key: "inner",
617
624
  ref: O,
618
625
  "model-value": e.modelValue,
@@ -634,7 +641,7 @@ var q = Symbol("kun-editor-context"), _e = [
634
641
  })]),
635
642
  _: 3
636
643
  }),
637
- g.value === "source" ? (p(), n(Xe, {
644
+ g.value === "source" ? (p(), n(Ze, {
638
645
  key: 0,
639
646
  "model-value": e.modelValue,
640
647
  readonly: e.readonly,
@@ -642,8 +649,8 @@ var q = Symbol("kun-editor-context"), _e = [
642
649
  }, null, 8, ["model-value", "readonly"])) : r("", !0)
643
650
  ]));
644
651
  }
645
- }), nt = { install(e) {
652
+ }), rt = { install(e) {
646
653
  e.component("KunEditor", $);
647
654
  } };
648
655
  //#endregion
649
- export { Z as EMOJI, $ as KunEditor, nt as KunEditorPlugin };
656
+ export { Z as EMOJI, $ as KunEditor, rt as KunEditorPlugin };
package/dist/types.d.ts CHANGED
@@ -5,6 +5,12 @@ export interface KunEditorToolbarApi {
5
5
  run: <T>(key: CmdKey<T>, payload?: T) => void;
6
6
  /** Insert plain text at the cursor (e.g. an emoji). */
7
7
  insertText: (text: string) => void;
8
+ /**
9
+ * Upload an image File via the `uploadImage` adapter, showing an in-document
10
+ * "uploading…" placeholder at the caret until it resolves (then the image), or
11
+ * removing it + notifying on failure. No-op without an `uploadImage` adapter.
12
+ */
13
+ uploadImage: (file: File) => void;
8
14
  /** Insert a reference atom at the cursor (requires the quote feature). */
9
15
  insertQuote: (payload: {
10
16
  refId: string;
@@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AAQ,EAAE,iBAAiB,CAAA;IACpC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAA;IACpC,yCAAyC;IACzC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CACjC;AAMD,MAAM,WAAW,sBAAsB;IACrC,uBAAuB;IACvB,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC1B,8BAA8B;IAC9B,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,KAAK,IAAI,CAAA;IAC7C,uEAAuE;IACvE,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5C;AASD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC5D;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC9D,gCAAgC;IAChC,KAAK,IAAI,IAAI,CAAA;CACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/editor-vue",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "KunEditor Vue 3 layer — the headless <KunEditor> component (dual WYSIWYG / markdown-source), toolbar and plugin views. Ships zero CSS and no UI-kit dependency; consumes @kungal/editor-core, and pairs with @kungal/editor-nuxt for optional KunUI chrome.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@prosemirror-adapter/vue": "^0.4.6",
43
- "@kungal/editor-core": "0.17.0"
43
+ "@kungal/editor-core": "0.18.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@codemirror/lang-markdown": "^6.0.0",
@@ -80,7 +80,7 @@
80
80
  "vite": "^8.0.16",
81
81
  "vue": "^3.5.35",
82
82
  "vue-tsc": "^3.3.3",
83
- "@kungal/editor-core": "0.17.0"
83
+ "@kungal/editor-core": "0.18.0"
84
84
  },
85
85
  "scripts": {
86
86
  "build": "vite build && vue-tsc -p tsconfig.build.json",