@kungal/editor-vue 0.27.0 → 0.29.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,71 @@
1
1
  # @kungal/editor-vue
2
2
 
3
+ ## 0.29.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8609e53: Add an `insertImage({ src })` primitive so hosts can build a rich image dialog.
8
+
9
+ The editor already had `uploadImage(file)` (adapter-backed, in-document
10
+ "uploading…" placeholder). The missing piece for a custom image dialog — insert by
11
+ URL, or re-insert from an upload history — was a way to insert an image from a
12
+ ready URL. Added:
13
+
14
+ - `KunEditorToolbarApi.insertImage({ src, alt?, title? })` — for a dialog dropped
15
+ into the `#toolbar` slot.
16
+ - `KunEditorExpose.insertImage(...)` and `KunEditorExpose.uploadImage(file)` — the
17
+ same two, on the `<KunEditor>` template ref, to drive image insertion from
18
+ anywhere.
19
+
20
+ The dialog UI (KunPopover, drag-drop, "recent" history) stays entirely the host's,
21
+ matching the headless design and how TipTap/ProseMirror split this
22
+ (`setImage(url)` command + host-provided upload UI). Drop the built-in image
23
+ button with `:items` and render your own next to `<KunEditorToolbar>`.
24
+
25
+ Verified in a new docs example (`/examples/image-dialog`): a host dialog inserts
26
+ by URL (`api.insertImage`), uploads one or many picked files via the host's own
27
+ uploader then inserts each, keeps a "recent" history, and re-inserts on click; the
28
+ built-in image button is dropped via `:items`; 0 console errors.
29
+
30
+ ### Patch Changes
31
+
32
+ - @kungal/editor-core@0.29.0
33
+
34
+ ## 0.28.0
35
+
36
+ ### Minor Changes
37
+
38
+ - 8d278e5: Make the insert-link URL entry customizable via a `linkPrompt` adapter.
39
+
40
+ The headless toolbar and the selection bubble asked for the link URL with the
41
+ native `window.prompt` (the KunUI toolbar used an inline popover). Hosts can now
42
+ supply their own UI instead — a modal, an article picker, etc.:
43
+
44
+ ```ts
45
+ const adapters = {
46
+ // …uploadImage, notify…
47
+ linkPrompt: async ({ text }) => await openLinkModal(text), // return the URL, or null to cancel
48
+ };
49
+ ```
50
+
51
+ - **editor-core**: new `LinkPrompt` type + `linkPrompt?` on `KunEditorAdapters`.
52
+ It receives the selected text (to prefill / search).
53
+ - **editor-vue**: the default toolbar and the selection bubble use `linkPrompt`
54
+ when supplied, else fall back to `window.prompt`.
55
+ - **editor-nuxt**: when `linkPrompt` is set, `<KunEditorToolbar>`'s link button
56
+ uses it instead of its inline popover — so one override covers every link entry
57
+ point (toolbar, default toolbar, bubble).
58
+
59
+ Verified in the docs production build: with a `linkPrompt` that derives a URL from
60
+ the selected text, the selection bubble inserts
61
+ `[…](https://example.com/search?q=…)` with no native dialog, and the KunUI
62
+ toolbar link becomes a plain button (no popover); 0 console errors.
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [8d278e5]
67
+ - @kungal/editor-core@0.28.0
68
+
3
69
  ## 0.27.0
4
70
 
5
71
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"EditorToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/EditorToolbar.vue"],"names":[],"mappings":"AAieA,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":"AAufA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -56,6 +56,11 @@ declare var __VLS_1: {
56
56
  run: <T>(key: import("@milkdown/kit/core").CmdKey<T>, payload?: T) => void;
57
57
  insertText: (text: string) => void;
58
58
  uploadImage: (file: File) => void;
59
+ insertImage: (payload: {
60
+ src: string;
61
+ alt?: string;
62
+ title?: string;
63
+ }) => void;
59
64
  insertLink: (payload: {
60
65
  href: string;
61
66
  text?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"KunEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/Kun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,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,KAAK,GAAG,OAAO,CAAA;IAChC,gBAAgB,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAC;AAiNF,QAAA,MAAM,YAAY;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MilkdownEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/MilkdownEditor.vue"],"names":[],"mappings":"AAwSA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAI5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,KAAK,GAAG,OAAO,CAAA;IAChC,gBAAgB,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAC;AA2OF,QAAA,MAAM,YAAY;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/SelectionTooltip.vue"],"names":[],"mappings":"AAiTA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SelectionTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/SelectionTooltip.vue"],"names":[],"mappings":"AAiUA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -3,6 +3,11 @@ declare var __VLS_1: {
3
3
  run: <T>(key: CmdKey<T>, payload?: T) => void;
4
4
  insertText: (text: string) => void;
5
5
  uploadImage: (file: File) => void;
6
+ insertImage: (payload: {
7
+ src: string;
8
+ alt?: string;
9
+ title?: string;
10
+ }) => void;
6
11
  insertLink: (payload: {
7
12
  href: string;
8
13
  text?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarHost.vue.d.ts","sourceRoot":"","sources":["../../src/components/ToolbarHost.vue"],"names":[],"mappings":"AA+FA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AA6FhD,QAAA,IAAI,OAAO;oCA9FX,CA1DqB;;;;;YA0DrB,CAvC2C;;;;;;;;;;;;;;CAqIrB,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":"AAyGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAuGhD,QAAA,IAAI,OAAO;oCAxGX,CAvEmB;;;;;WAuEnB,CA9CE;aA8CF,CA9CkB;;;;YA8ClB,CAtCc;;;;;;;;;;;;;;CA8IQ,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
@@ -2,14 +2,14 @@ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r
2
2
  import { Milkdown as E, MilkdownProvider as D, useEditor as O, useInstance as k } from "@milkdown/vue";
3
3
  import { ProsemirrorAdapterProvider as A, usePluginViewContext as j, usePluginViewFactory as M } from "@prosemirror-adapter/vue";
4
4
  import { parseHeadings as N, parseHeadings as ee } from "@kungal/editor-core";
5
- import { Editor as P, defaultValueCtx as F, editorViewCtx as I, editorViewOptionsCtx as L, rootCtx as R } from "@milkdown/kit/core";
6
- import { listenerCtx as z } from "@milkdown/kit/plugin/listener";
7
- import { SlashProvider as B, slashFactory as V } from "@milkdown/kit/plugin/slash";
8
- import { TooltipProvider as H, tooltipFactory as U } from "@milkdown/kit/plugin/tooltip";
9
- import { callCommand as W, replaceAll as te } from "@milkdown/kit/utils";
10
- import { TextSelection as G } from "@milkdown/kit/prose/state";
11
- import { createKunEditorPlugins as K, insertKunSpoilerCommand as q, insertLinkCommand as J, insertMentionCommand as ne, insertQuoteCommand as re, kunCM as ie, mentionId as ae, setHeadingCommand as oe, startImageUpload as se } from "@kungal/editor-core/preset";
12
- import { createCodeBlockCommand as ce, insertHrCommand as le, insertImageCommand as ue, toggleEmphasisCommand as de, toggleInlineCodeCommand as fe, toggleStrongCommand as pe, wrapInBlockquoteCommand as me, wrapInBulletListCommand as he, wrapInOrderedListCommand as ge } from "@milkdown/kit/preset/commonmark";
5
+ import { Editor as P, defaultValueCtx as F, editorViewCtx as I, editorViewOptionsCtx as te, rootCtx as L } from "@milkdown/kit/core";
6
+ import { listenerCtx as R } from "@milkdown/kit/plugin/listener";
7
+ import { SlashProvider as z, slashFactory as B } from "@milkdown/kit/plugin/slash";
8
+ import { TooltipProvider as V, tooltipFactory as H } from "@milkdown/kit/plugin/tooltip";
9
+ import { callCommand as U, replaceAll as ne } from "@milkdown/kit/utils";
10
+ import { TextSelection as W } from "@milkdown/kit/prose/state";
11
+ import { createCodeBlockCommand as G, insertHrCommand as K, insertImageCommand as q, toggleEmphasisCommand as re, toggleInlineCodeCommand as ie, toggleStrongCommand as ae, wrapInBlockquoteCommand as oe, wrapInBulletListCommand as se, wrapInOrderedListCommand as ce } from "@milkdown/kit/preset/commonmark";
12
+ import { createKunEditorPlugins as le, insertKunSpoilerCommand as ue, insertLinkCommand as J, insertMentionCommand as de, insertQuoteCommand as fe, kunCM as pe, mentionId as me, setHeadingCommand as he, startImageUpload as ge } from "@kungal/editor-core/preset";
13
13
  import { toggleStrikethroughCommand as _e } from "@milkdown/kit/preset/gfm";
14
14
  import { Annotation as ve, EditorState as ye } from "@codemirror/state";
15
15
  import { EditorView as Y } from "@codemirror/view";
@@ -75,13 +75,13 @@ var X = Symbol("kun-editor-context"), Se = [
75
75
  }, F = (e) => {
76
76
  let t = d.value;
77
77
  if (!t || !O) return;
78
- let n = t.state.schema.nodes[ae];
78
+ let n = t.state.schema.nodes[me];
79
79
  if (!n) return;
80
80
  let r = n.create({
81
81
  userId: e.id,
82
82
  name: e.name
83
83
  }), { from: i, to: a } = O, o = t.state.tr.replaceWith(i, a, r), s = i + r.nodeSize;
84
- o.insertText(" ", s), o.setSelection(G.create(o.doc, s + 1)), t.dispatch(o.scrollIntoView()), t.focus(), b.hide();
84
+ o.insertText(" ", s), o.setSelection(W.create(o.doc, s + 1)), t.dispatch(o.scrollIntoView()), t.focus(), b.hide();
85
85
  }, I = (e) => {
86
86
  if (!x.value || !w.value.length) {
87
87
  x.value && e.key === "Escape" && (e.preventDefault(), b.hide());
@@ -107,7 +107,7 @@ var X = Symbol("kun-editor-context"), Se = [
107
107
  }
108
108
  };
109
109
  return p(() => {
110
- b = new B({
110
+ b = new z({
111
111
  content: v.value,
112
112
  trigger: "@",
113
113
  shouldShow: P,
@@ -170,22 +170,25 @@ var X = Symbol("kun-editor-context"), Se = [
170
170
  __name: "SelectionTooltip",
171
171
  setup(n) {
172
172
  let { view: r, prevState: o } = j(), [, s] = k(), c = l(X), u = t(() => (c?.locale ?? "zh-cn").toLowerCase().startsWith("en")), d = g(null), h, v = (e, t) => {
173
- s()?.action(W(e, t));
174
- }, y = () => {
175
- let e = window.prompt(u.value ? "Link URL" : "链接 URL")?.trim();
176
- e && v(J.key, { href: e });
173
+ s()?.action(U(e, t));
174
+ }, y = async () => {
175
+ let e = r.value, { from: t, to: n } = e?.state.selection ?? {
176
+ from: 0,
177
+ to: 0
178
+ }, i = e ? e.state.doc.textBetween(t, n, " ") : "", a = c?.adapters.linkPrompt, o = (a ? await a({ text: i }) : window.prompt(u.value ? "Link URL" : "链接 URL"))?.trim();
179
+ o && v(J.key, { href: o });
177
180
  }, b = t(() => {
178
181
  let e = u.value;
179
182
  return {
180
183
  bold: {
181
184
  svg: $.bold,
182
185
  title: e ? "Bold" : "加粗",
183
- run: () => v(pe.key)
186
+ run: () => v(ae.key)
184
187
  },
185
188
  italic: {
186
189
  svg: $.italic,
187
190
  title: e ? "Italic" : "斜体",
188
- run: () => v(de.key)
191
+ run: () => v(re.key)
189
192
  },
190
193
  strike: {
191
194
  svg: $.strike,
@@ -195,7 +198,7 @@ var X = Symbol("kun-editor-context"), Se = [
195
198
  code: {
196
199
  svg: $.code,
197
200
  title: e ? "Inline code" : "行内代码",
198
- run: () => v(fe.key)
201
+ run: () => v(ie.key)
199
202
  },
200
203
  link: {
201
204
  svg: $.link,
@@ -219,7 +222,7 @@ var X = Symbol("kun-editor-context"), Se = [
219
222
  return n;
220
223
  });
221
224
  return p(() => {
222
- h = new H({
225
+ h = new V({
223
226
  content: d.value,
224
227
  offset: 8
225
228
  }), h.update(r.value, o.value);
@@ -259,15 +262,15 @@ var X = Symbol("kun-editor-context"), Se = [
259
262
  },
260
263
  emits: ["update:modelValue"],
261
264
  setup(e, { expose: t, emit: r }) {
262
- let i = e, a = r, o = i.modelValue, s = !1, c = M(), l = V("kunMention"), u = i.features.mention !== !1 && !!i.adapters.searchMentionUsers && !!c, d = U("kunSelectionTooltip"), f = i.selectionToolbar && !!c, p = O((e) => {
265
+ let i = e, a = r, o = i.modelValue, s = !1, c = M(), l = B("kunMention"), u = i.features.mention !== !1 && !!i.adapters.searchMentionUsers && !!c, d = H("kunSelectionTooltip"), f = i.selectionToolbar && !!c, p = O((e) => {
263
266
  let t = P.make().config((t) => {
264
- t.set(R, e), t.set(F, i.modelValue), t.get(z).markdownUpdated((e, t, n) => {
267
+ t.set(L, e), t.set(F, i.modelValue), t.get(R).markdownUpdated((e, t, n) => {
265
268
  !i.active || s || t === n || (o = t, a("update:modelValue", t));
266
- }), t.update(L, (e) => ({
269
+ }), t.update(te, (e) => ({
267
270
  ...e,
268
271
  editable: () => !i.readonly
269
272
  })), u && t.set(l.key, { view: c({ component: ke }) }), f && t.set(d.key, { view: c({ component: Ne }) });
270
- }).use(K(i.adapters, i.features, {
273
+ }).use(le(i.adapters, i.features, {
271
274
  locale: i.locale,
272
275
  placeholder: i.placeholder,
273
276
  placeholderMode: i.placeholderMode
@@ -278,7 +281,7 @@ var X = Symbol("kun-editor-context"), Se = [
278
281
  if (e === o) return;
279
282
  o = e;
280
283
  let t = p.get();
281
- t && (s = !0, t.action(te(e)), s = !1);
284
+ t && (s = !0, t.action(ne(e)), s = !1);
282
285
  }), S(() => i.readonly, () => {
283
286
  p.get()?.action((e) => {
284
287
  let t = e.get(I);
@@ -290,10 +293,27 @@ var X = Symbol("kun-editor-context"), Se = [
290
293
  };
291
294
  return t({
292
295
  insertQuote: (e) => {
293
- p.get()?.action(W(re.key, e)), h();
296
+ p.get()?.action(U(fe.key, e)), h();
294
297
  },
295
298
  insertMention: (e) => {
296
- p.get()?.action(W(ne.key, e)), h();
299
+ p.get()?.action(U(de.key, e)), h();
300
+ },
301
+ insertImage: (e) => {
302
+ p.get()?.action(U(q.key, {
303
+ src: e.src,
304
+ alt: e.alt ?? "",
305
+ title: e.title ?? ""
306
+ })), h();
307
+ },
308
+ uploadImage: (e) => {
309
+ let t = i.adapters.uploadImage, n = p.get();
310
+ !t || !n || n.action((n) => {
311
+ ge(n.get(I), e, {
312
+ uploadImage: t,
313
+ notify: i.adapters.notify,
314
+ locale: i.locale
315
+ });
316
+ });
297
317
  },
298
318
  focus: h,
299
319
  scrollToHeading: (e) => {
@@ -305,7 +325,7 @@ var X = Symbol("kun-editor-context"), Se = [
305
325
  behavior: "smooth",
306
326
  block: "start"
307
327
  }), n.editable)) {
308
- let e = G.near(n.state.doc.resolve(i + 1));
328
+ let e = W.near(n.state.doc.resolve(i + 1));
309
329
  n.dispatch(n.state.tr.setSelection(e)), n.focus();
310
330
  }
311
331
  });
@@ -362,7 +382,7 @@ var X = Symbol("kun-editor-context"), Se = [
362
382
  n.dispatch(r.tr.insertText(e, r.selection.from));
363
383
  });
364
384
  }, N = (e, t) => {
365
- o()?.action(W(ue.key, {
385
+ o()?.action(U(q.key, {
366
386
  src: e,
367
387
  title: t,
368
388
  alt: t
@@ -431,10 +451,15 @@ var X = Symbol("kun-editor-context"), Se = [
431
451
  __name: "EditorToolbar",
432
452
  setup(n) {
433
453
  let [, s] = k(), c = l(X), u = t(() => c?.adapters.uploadImage), d = t(() => c?.features.sticker !== !1), f = t(() => (c?.locale ?? "zh-cn").toLowerCase().startsWith("en")), p = (e, t) => {
434
- s()?.action(W(e, t));
435
- }, h = () => {
436
- let e = window.prompt(f.value ? "Link URL" : "链接 URL")?.trim();
437
- e && p(J.key, { href: e });
454
+ s()?.action(U(e, t));
455
+ }, h = async () => {
456
+ let e = "";
457
+ s()?.action((t) => {
458
+ let n = t.get(I), { from: r, to: i } = n.state.selection;
459
+ e = n.state.doc.textBetween(r, i, " ");
460
+ });
461
+ let t = c?.adapters.linkPrompt, n = (t ? await t({ text: e }) : window.prompt(f.value ? "Link URL" : "链接 URL"))?.trim();
462
+ n && p(J.key, { href: n });
438
463
  }, v = t(() => {
439
464
  let e = f.value;
440
465
  return {
@@ -468,18 +493,18 @@ var X = Symbol("kun-editor-context"), Se = [
468
493
  }));
469
494
  }), S = (e) => {
470
495
  let t = e.target;
471
- p(oe.key, Number(t.value)), t.selectedIndex = 0;
496
+ p(he.key, Number(t.value)), t.selectedIndex = 0;
472
497
  }, C = t(() => [
473
498
  [
474
499
  {
475
500
  svg: $.bold,
476
501
  title: v.value.bold,
477
- run: () => p(pe.key)
502
+ run: () => p(ae.key)
478
503
  },
479
504
  {
480
505
  svg: $.italic,
481
506
  title: v.value.italic,
482
- run: () => p(de.key)
507
+ run: () => p(re.key)
483
508
  },
484
509
  {
485
510
  svg: $.strike,
@@ -489,7 +514,7 @@ var X = Symbol("kun-editor-context"), Se = [
489
514
  {
490
515
  svg: $.code,
491
516
  title: v.value.code,
492
- run: () => p(fe.key)
517
+ run: () => p(ie.key)
493
518
  },
494
519
  {
495
520
  svg: $.link,
@@ -501,40 +526,40 @@ var X = Symbol("kun-editor-context"), Se = [
501
526
  {
502
527
  svg: $.bulletList,
503
528
  title: v.value.bulletList,
504
- run: () => p(he.key)
529
+ run: () => p(se.key)
505
530
  },
506
531
  {
507
532
  svg: $.orderedList,
508
533
  title: v.value.orderedList,
509
- run: () => p(ge.key)
534
+ run: () => p(ce.key)
510
535
  },
511
536
  {
512
537
  svg: $.quote,
513
538
  title: v.value.quote,
514
- run: () => p(me.key)
539
+ run: () => p(oe.key)
515
540
  },
516
541
  {
517
542
  svg: $.codeBlock,
518
543
  title: v.value.codeBlock,
519
- run: () => p(ce.key, "")
544
+ run: () => p(G.key, "")
520
545
  },
521
546
  {
522
547
  svg: $.hr,
523
548
  title: v.value.hr,
524
- run: () => p(le.key)
549
+ run: () => p(K.key)
525
550
  }
526
551
  ],
527
552
  [{
528
553
  svg: $.spoiler,
529
554
  title: v.value.spoiler,
530
- run: () => p(q.key)
555
+ run: () => p(ue.key)
531
556
  }]
532
557
  ]), w = g(null), T = () => w.value?.click(), E = (e) => {
533
558
  let t = e.target, n = t.files?.[0];
534
559
  t.value = "";
535
560
  let r = u.value;
536
561
  !n || !r || s()?.action((e) => {
537
- se(e.get(I), n, {
562
+ ge(e.get(I), n, {
538
563
  uploadImage: r,
539
564
  notify: c?.adapters.notify,
540
565
  locale: c?.locale
@@ -598,7 +623,7 @@ var X = Symbol("kun-editor-context"), Se = [
598
623
  __name: "ToolbarHost",
599
624
  setup(e) {
600
625
  let [, t] = k(), n = l(X, void 0), r = (e, n) => {
601
- t()?.action(W(e, n));
626
+ t()?.action(U(e, n));
602
627
  }, i = () => {
603
628
  t()?.action((e) => e.get(I).focus());
604
629
  }, a = {
@@ -612,7 +637,7 @@ var X = Symbol("kun-editor-context"), Se = [
612
637
  uploadImage: (e) => {
613
638
  let r = n?.adapters.uploadImage, i = t();
614
639
  !r || !i || i.action((t) => {
615
- se(t.get(I), e, {
640
+ ge(t.get(I), e, {
616
641
  uploadImage: r,
617
642
  notify: n?.adapters.notify,
618
643
  locale: n?.locale
@@ -622,11 +647,18 @@ var X = Symbol("kun-editor-context"), Se = [
622
647
  insertLink: (e) => {
623
648
  r(J.key, e), i();
624
649
  },
650
+ insertImage: (e) => {
651
+ r(q.key, {
652
+ src: e.src,
653
+ alt: e.alt ?? "",
654
+ title: e.title ?? ""
655
+ }), i();
656
+ },
625
657
  insertQuote: (e) => {
626
- r(re.key, e), i();
658
+ r(fe.key, e), i();
627
659
  },
628
660
  insertMention: (e) => {
629
- r(ne.key, e), i();
661
+ r(de.key, e), i();
630
662
  },
631
663
  focus: i,
632
664
  get adapters() {
@@ -652,7 +684,7 @@ var X = Symbol("kun-editor-context"), Se = [
652
684
  let r = e, a = n, o = g(null), s = null, c = ve.define(), l = (e) => ye.create({
653
685
  doc: e,
654
686
  extensions: [
655
- ie(),
687
+ pe(),
656
688
  Y.lineWrapping,
657
689
  xe,
658
690
  be(),
@@ -789,7 +821,7 @@ var X = Symbol("kun-editor-context"), Se = [
789
821
  });
790
822
  let I = () => {
791
823
  F.value = !F.value;
792
- }, L = t(() => E.locale.toLowerCase().startsWith("en")), R = t(() => L.value ? {
824
+ }, te = t(() => E.locale.toLowerCase().startsWith("en")), L = t(() => te.value ? {
793
825
  wysiwyg: "Preview",
794
826
  source: "Markdown",
795
827
  split: "Split",
@@ -801,47 +833,49 @@ var X = Symbol("kun-editor-context"), Se = [
801
833
  split: "分栏",
802
834
  swap: "左右互换",
803
835
  scrollSync: "同步滚动"
804
- }), z = g(null), B = null, V = null, H = null, U = () => {
805
- B?.(), B = null, V = null;
806
- }, W = () => {
807
- U();
808
- let e = z.value;
836
+ }), R = g(null), z = null, B = null, V = null, H = () => {
837
+ z?.(), z = null, B = null;
838
+ }, U = () => {
839
+ H();
840
+ let e = R.value;
809
841
  if (!e) return;
810
842
  let t = e.querySelector(".cm-scroller"), n = e.querySelector(".kun-editor__wysiwyg");
811
843
  if (!t || !n) return;
812
844
  let r = (e, t) => () => {
813
- if (V && V !== e) return;
814
- V = e;
845
+ if (B && B !== e) return;
846
+ B = e;
815
847
  let n = e.scrollHeight - e.clientHeight, r = n > 0 ? e.scrollTop / n : 0, i = t.scrollHeight - t.clientHeight;
816
- t.scrollTop = r * (i > 0 ? i : 0), H && clearTimeout(H), H = setTimeout(() => {
817
- V = null;
848
+ t.scrollTop = r * (i > 0 ? i : 0), V && clearTimeout(V), V = setTimeout(() => {
849
+ B = null;
818
850
  }, 120);
819
851
  }, i = r(t, n), a = r(n, t);
820
- t.addEventListener("scroll", i, { passive: !0 }), n.addEventListener("scroll", a, { passive: !0 }), B = () => {
852
+ t.addEventListener("scroll", i, { passive: !0 }), n.addEventListener("scroll", a, { passive: !0 }), z = () => {
821
853
  t.removeEventListener("scroll", i), n.removeEventListener("scroll", a);
822
854
  };
823
855
  };
824
856
  S([j, F], ([e, t]) => {
825
- U(), e === "split" && t && u(W);
826
- }), f(U);
827
- let te = t(() => E.readonly || j.value === "split"), G = (e) => O("update:modelValue", e), K = g(null), q = g(null);
857
+ H(), e === "split" && t && u(U);
858
+ }), f(H);
859
+ let ne = t(() => E.readonly || j.value === "split"), W = (e) => O("update:modelValue", e), G = g(null), K = g(null);
828
860
  return l({
829
- insertQuote: (e) => K.value?.insertQuote(e),
830
- insertMention: (e) => K.value?.insertMention(e),
831
- focus: () => K.value?.focus(),
861
+ insertQuote: (e) => G.value?.insertQuote(e),
862
+ insertMention: (e) => G.value?.insertMention(e),
863
+ insertImage: (e) => G.value?.insertImage(e),
864
+ uploadImage: (e) => G.value?.uploadImage(e),
865
+ focus: () => G.value?.focus(),
832
866
  scrollToHeading: (e) => {
833
- j.value === "source" || j.value === "split" ? q.value?.scrollToHeading(e) : K.value?.scrollToHeading(e);
867
+ j.value === "source" || j.value === "split" ? K.value?.scrollToHeading(e) : G.value?.scrollToHeading(e);
834
868
  }
835
869
  }), (t, l) => (m(), i("div", {
836
870
  ref_key: "rootEl",
837
- ref: z,
871
+ ref: R,
838
872
  class: "kun-editor",
839
873
  "data-kun-editor": "",
840
874
  "data-mode": j.value
841
875
  }, [v(t.$slots, "view-switch", {
842
876
  mode: j.value,
843
877
  setMode: M,
844
- labels: R.value,
878
+ labels: L.value,
845
879
  views: s.views,
846
880
  swapped: N.value,
847
881
  swap: P,
@@ -854,20 +888,20 @@ var X = Symbol("kun-editor-context"), Se = [
854
888
  "aria-selected": j.value === e,
855
889
  "data-active": j.value === e,
856
890
  onClick: (t) => M(e)
857
- }, y(R.value[e]), 9, ut))), 128)), j.value === "split" ? (m(), i(e, { key: 0 }, [a("button", {
891
+ }, y(L.value[e]), 9, ut))), 128)), j.value === "split" ? (m(), i(e, { key: 0 }, [a("button", {
858
892
  type: "button",
859
893
  class: "kun-editor__tab kun-editor__swap",
860
- title: R.value.swap,
861
- "aria-label": R.value.swap,
894
+ title: L.value.swap,
895
+ "aria-label": L.value.swap,
862
896
  onClick: l[0] ||= (e) => P()
863
897
  }, " ⇄ ", 8, dt), a("button", {
864
898
  type: "button",
865
899
  class: "kun-editor__tab",
866
900
  "data-active": F.value,
867
- title: R.value.scrollSync,
901
+ title: L.value.scrollSync,
868
902
  "aria-pressed": F.value,
869
903
  onClick: l[1] ||= (e) => I()
870
- }, y(R.value.scrollSync), 9, ft)], 64)) : r("", !0)])) : r("", !0)]), o(b(D), null, {
904
+ }, y(L.value.scrollSync), 9, ft)], 64)) : r("", !0)])) : r("", !0)]), o(b(D), null, {
871
905
  default: C(() => [o(b(A), null, {
872
906
  default: C(() => [w(a("div", null, [o(ot, null, {
873
907
  default: C((e) => [v(t.$slots, "toolbar", d(c(e)), () => [o(at)])]),
@@ -878,24 +912,24 @@ var X = Symbol("kun-editor-context"), Se = [
878
912
  }, [j.value === "source" || j.value === "split" ? (m(), n(st, {
879
913
  key: 0,
880
914
  ref_key: "source",
881
- ref: q,
915
+ ref: K,
882
916
  class: "kun-editor__pane",
883
917
  "model-value": s.modelValue,
884
918
  readonly: s.readonly,
885
- "onUpdate:modelValue": G
919
+ "onUpdate:modelValue": W
886
920
  }, null, 8, ["model-value", "readonly"])) : r("", !0), w(a("div", mt, [o(Pe, {
887
921
  ref_key: "inner",
888
- ref: K,
922
+ ref: G,
889
923
  "model-value": s.modelValue,
890
924
  adapters: s.adapters,
891
925
  features: s.features,
892
926
  locale: s.locale,
893
- readonly: te.value,
927
+ readonly: ne.value,
894
928
  placeholder: s.placeholder,
895
929
  "placeholder-mode": s.placeholderMode,
896
930
  active: j.value === "wysiwyg" && !s.readonly,
897
931
  "selection-toolbar": k.value,
898
- "onUpdate:modelValue": G
932
+ "onUpdate:modelValue": W
899
933
  }, null, 8, [
900
934
  "model-value",
901
935
  "adapters",
package/dist/types.d.ts CHANGED
@@ -13,6 +13,16 @@ export interface KunEditorToolbarApi {
13
13
  * removing it + notifying on failure. No-op without an `uploadImage` adapter.
14
14
  */
15
15
  uploadImage: (file: File) => void;
16
+ /**
17
+ * Insert an image node at the cursor from a ready URL — for a host-built image
18
+ * dialog (paste a URL, or re-insert from an upload history). For the upload path
19
+ * use `uploadImage`, or call your own upload adapter then this.
20
+ */
21
+ insertImage: (payload: {
22
+ src: string;
23
+ alt?: string;
24
+ title?: string;
25
+ }) => void;
16
26
  /**
17
27
  * Apply a link to the selection, or (empty selection) insert linked text.
18
28
  * `text` defaults to the href. Standard markdown `[text](href)`.
@@ -81,6 +91,17 @@ export interface KunEditorExpose {
81
91
  userId: number;
82
92
  name: string;
83
93
  }): void;
94
+ /** Insert an image at the cursor from a ready URL (a host-built image dialog). */
95
+ insertImage(payload: {
96
+ src: string;
97
+ alt?: string;
98
+ title?: string;
99
+ }): void;
100
+ /**
101
+ * Upload an image File via the `uploadImage` adapter (in-document "uploading…"
102
+ * placeholder, then the image). No-op without the adapter.
103
+ */
104
+ uploadImage(file: File): void;
84
105
  /** Focus the WYSIWYG editor. */
85
106
  focus(): void;
86
107
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAK5B,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,aAAa,GACb,OAAO,GACP,WAAW,GACX,IAAI,GACJ,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,GACR,GAAG,CAAA;AAIP,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,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AAG,IAAI,CAAA;IAC7B,gCAAgC;IAChC,KAAK,IAAI,IAAI,CAAA;IACb;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/editor-vue",
3
- "version": "0.27.0",
3
+ "version": "0.29.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.27.0"
43
+ "@kungal/editor-core": "0.29.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.27.0"
83
+ "@kungal/editor-core": "0.29.0"
84
84
  },
85
85
  "scripts": {
86
86
  "build": "vite build && vue-tsc -p tsconfig.build.json",