@kungal/editor-core 0.33.0 → 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/CHANGELOG.md +36 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/preset/index.d.cts +1 -1
- package/dist/preset/index.d.ts +1 -1
- package/dist/{types-DqQwYYJ1.d.cts → types-Dui0tGlh.d.cts} +4 -5
- package/dist/{types-DqQwYYJ1.d.ts → types-Dui0tGlh.d.ts} +4 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @kungal/editor-core
|
|
2
2
|
|
|
3
|
+
## 0.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ab7fbc2: No native `prompt` left: the headless toolbar gets a link URL panel too
|
|
8
|
+
|
|
9
|
+
0.33.0 gave the selection bubble an inline URL input; the fixed (headless)
|
|
10
|
+
toolbar still popped `window.prompt`. It now opens a small panel under the link
|
|
11
|
+
button — Enter applies, Esc cancels, clicking outside closes, and the editor
|
|
12
|
+
gets focus back. Same behaviour as the bubble otherwise: an existing href is
|
|
13
|
+
prefilled (and selected), and with nothing selected the URL is inserted as
|
|
14
|
+
linked text. A panel rather than an in-place swap because a fixed toolbar row
|
|
15
|
+
that rearranges itself is jarring; the bubble is already a floating layer, so
|
|
16
|
+
there the swap is the right shape.
|
|
17
|
+
|
|
18
|
+
**Breaking (CSS hook, one version old):** `.kun-editor__bubble-input` →
|
|
19
|
+
`.kun-editor__link-input`. Both entry points render the same input, so the hook
|
|
20
|
+
is named after the thing, not the place. Hosts importing
|
|
21
|
+
`@kungal/editor-nuxt/editor.css` need no change; a copied stylesheet wants the
|
|
22
|
+
rename plus the two new hooks:
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
.kun-editor__link {
|
|
26
|
+
position: relative;
|
|
27
|
+
} /* structural */
|
|
28
|
+
.kun-editor__link-panel {
|
|
29
|
+
position: absolute;
|
|
30
|
+
} /* structural */
|
|
31
|
+
.kun-editor__link-input {
|
|
32
|
+
/* shared by the toolbar panel and the bubble */
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`linkPrompt` keeps taking precedence over all three built-in entries (bubble
|
|
37
|
+
input, toolbar panel, KunUI popover), so a host modal is still one override.
|
|
38
|
+
|
|
3
39
|
## 0.33.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { K as KunEditorAdapters, a as KunEditorFeatures, b as KunEditorLocale, L as LinkPrompt, M as MentionUser, N as Notify, c as NotifyLevel, S as SearchMentionUsers, d as StickerItem, e as StickerPack, f as StickerSource, U as UploadImage } from './types-
|
|
1
|
+
export { K as KunEditorAdapters, a as KunEditorFeatures, b as KunEditorLocale, L as LinkPrompt, M as MentionUser, N as Notify, c as NotifyLevel, S as SearchMentionUsers, d as StickerItem, e as StickerPack, f as StickerSource, U as UploadImage } from './types-Dui0tGlh.cjs';
|
|
2
2
|
|
|
3
3
|
interface KunHeading {
|
|
4
4
|
/** Heading level 1–6. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { K as KunEditorAdapters, a as KunEditorFeatures, b as KunEditorLocale, L as LinkPrompt, M as MentionUser, N as Notify, c as NotifyLevel, S as SearchMentionUsers, d as StickerItem, e as StickerPack, f as StickerSource, U as UploadImage } from './types-
|
|
1
|
+
export { K as KunEditorAdapters, a as KunEditorFeatures, b as KunEditorLocale, L as LinkPrompt, M as MentionUser, N as Notify, c as NotifyLevel, S as SearchMentionUsers, d as StickerItem, e as StickerPack, f as StickerSource, U as UploadImage } from './types-Dui0tGlh.js';
|
|
2
2
|
|
|
3
3
|
interface KunHeading {
|
|
4
4
|
/** Heading level 1–6. */
|
package/dist/preset/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MilkdownPlugin, Ctx } from '@milkdown/kit/ctx';
|
|
2
2
|
import { KatexOptions } from 'katex';
|
|
3
|
-
import { b as KunEditorLocale, N as Notify, U as UploadImage, K as KunEditorAdapters, a as KunEditorFeatures } from '../types-
|
|
3
|
+
import { b as KunEditorLocale, N as Notify, U as UploadImage, K as KunEditorAdapters, a as KunEditorFeatures } from '../types-Dui0tGlh.cjs';
|
|
4
4
|
import * as _milkdown_kit_utils from '@milkdown/kit/utils';
|
|
5
5
|
import { Extension } from '@codemirror/state';
|
|
6
6
|
import { Uploader } from '@milkdown/kit/plugin/upload';
|
package/dist/preset/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MilkdownPlugin, Ctx } from '@milkdown/kit/ctx';
|
|
2
2
|
import { KatexOptions } from 'katex';
|
|
3
|
-
import { b as KunEditorLocale, N as Notify, U as UploadImage, K as KunEditorAdapters, a as KunEditorFeatures } from '../types-
|
|
3
|
+
import { b as KunEditorLocale, N as Notify, U as UploadImage, K as KunEditorAdapters, a as KunEditorFeatures } from '../types-Dui0tGlh.js';
|
|
4
4
|
import * as _milkdown_kit_utils from '@milkdown/kit/utils';
|
|
5
5
|
import { Extension } from '@codemirror/state';
|
|
6
6
|
import { Uploader } from '@milkdown/kit/plugin/upload';
|
|
@@ -49,10 +49,9 @@ type Notify = (message: string, level: NotifyLevel) => void;
|
|
|
49
49
|
/**
|
|
50
50
|
* Ask the user for a link URL — provide this to show your OWN UI (a modal, an
|
|
51
51
|
* article picker…) instead of the built-in entry: the selection bubble's inline
|
|
52
|
-
* URL input, the
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* entry point.
|
|
52
|
+
* URL input, the headless toolbar's URL panel, or the KunUI toolbar's popover.
|
|
53
|
+
* Gets the currently selected text (to prefill or search). Return the URL, or a
|
|
54
|
+
* falsy value to cancel. One override covers every link entry point.
|
|
56
55
|
*/
|
|
57
56
|
type LinkPrompt = (context: {
|
|
58
57
|
text: string;
|
|
@@ -70,7 +69,7 @@ interface KunEditorAdapters {
|
|
|
70
69
|
notify?: Notify;
|
|
71
70
|
/**
|
|
72
71
|
* Custom link-URL entry (replaces the selection bubble's inline input, the
|
|
73
|
-
* headless toolbar's
|
|
72
|
+
* headless toolbar's URL panel, and the KunUI toolbar's popover). See
|
|
74
73
|
* {@link LinkPrompt}.
|
|
75
74
|
*/
|
|
76
75
|
linkPrompt?: LinkPrompt;
|
|
@@ -49,10 +49,9 @@ type Notify = (message: string, level: NotifyLevel) => void;
|
|
|
49
49
|
/**
|
|
50
50
|
* Ask the user for a link URL — provide this to show your OWN UI (a modal, an
|
|
51
51
|
* article picker…) instead of the built-in entry: the selection bubble's inline
|
|
52
|
-
* URL input, the
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* entry point.
|
|
52
|
+
* URL input, the headless toolbar's URL panel, or the KunUI toolbar's popover.
|
|
53
|
+
* Gets the currently selected text (to prefill or search). Return the URL, or a
|
|
54
|
+
* falsy value to cancel. One override covers every link entry point.
|
|
56
55
|
*/
|
|
57
56
|
type LinkPrompt = (context: {
|
|
58
57
|
text: string;
|
|
@@ -70,7 +69,7 @@ interface KunEditorAdapters {
|
|
|
70
69
|
notify?: Notify;
|
|
71
70
|
/**
|
|
72
71
|
* Custom link-URL entry (replaces the selection bubble's inline input, the
|
|
73
|
-
* headless toolbar's
|
|
72
|
+
* headless toolbar's URL panel, and the KunUI toolbar's popover). See
|
|
74
73
|
* {@link LinkPrompt}.
|
|
75
74
|
*/
|
|
76
75
|
linkPrompt?: LinkPrompt;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungal/editor-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "KunEditor framework-agnostic core — the Milkdown plugin bundle (spoiler / mention / quote / katex / upload / code-block) plus the adapter contracts. No Vue/React.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|