@kungal/editor-core 0.32.0 → 0.33.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 +53 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/preset/index.cjs +6 -4
- package/dist/preset/index.cjs.map +1 -1
- package/dist/preset/index.d.cts +1 -1
- package/dist/preset/index.d.ts +1 -1
- package/dist/preset/index.js +6 -4
- package/dist/preset/index.js.map +1 -1
- package/dist/{types-BazCkMGt.d.cts → types-DqQwYYJ1.d.cts} +8 -7
- package/dist/{types-BazCkMGt.d.ts → types-DqQwYYJ1.d.ts} +8 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# @kungal/editor-core
|
|
2
2
|
|
|
3
|
+
## 0.33.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9294ba2: Insert a link from the selection bubble without a native `prompt`
|
|
8
|
+
|
|
9
|
+
Selecting text → 「链接」 used to pop `window.prompt`. The bubble now asks for the
|
|
10
|
+
URL **in place**: the button row swaps for a URL input (`data-mode="link"`),
|
|
11
|
+
Enter applies, Esc cancels, and the row comes back. If the selection is already
|
|
12
|
+
a link its href is prefilled (and selected), so editing a URL is the same flow.
|
|
13
|
+
|
|
14
|
+
Why in place, and not a popover/dialog: the bubble is a Milkdown tooltip whose
|
|
15
|
+
`shouldShow` keeps it alive only while focus is in the editor **or inside the
|
|
16
|
+
bubble element**. Any popover teleports its panel to `<body>` — outside that
|
|
17
|
+
element — so the bubble would hide the moment the panel's input took focus. An
|
|
18
|
+
input in our own DOM keeps the bubble put, and the ProseMirror selection
|
|
19
|
+
survives the DOM blur, so the link wraps exactly what was selected.
|
|
20
|
+
|
|
21
|
+
Still headless: a plain `<input>` plus one new class hook.
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
.kun-editor__bubble[data-mode="link"] {
|
|
25
|
+
/* the URL-entry state */
|
|
26
|
+
}
|
|
27
|
+
.kun-editor__bubble-input {
|
|
28
|
+
/* the input itself */
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Hosts that want their own UI keep the escape hatch — the `linkPrompt` adapter
|
|
33
|
+
takes precedence over the inline input, exactly as it does over the KunUI
|
|
34
|
+
toolbar's popover.
|
|
35
|
+
|
|
36
|
+
Also in the shipped reference stylesheet (`@kungal/editor-nuxt/editor.css`): the
|
|
37
|
+
selection bubble, the @mention dropdown and the sticker/emoji picker painted
|
|
38
|
+
themselves with `--color-background` — KunUI's _glassy page_ tint (0.7 alpha) —
|
|
39
|
+
so document text showed through a panel floating over it. They now use the
|
|
40
|
+
RAISED surface token the KunUI popovers use, via one overridable var:
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
:root {
|
|
44
|
+
--kun-editor-surface: var(--color-content1, var(--color-background));
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 0.32.1
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 814c98f: Drive toolbar and bubble toggle-mark state from one editor plugin view, and keep the orphan-link cleanup out of undo history.
|
|
53
|
+
|
|
54
|
+
The previous Milkdown-listener + per-toolbar `refresh()` pair leaked subscriptions, missed stored-mark toggles for 200ms, and left the selection bubble without a pressed state. A single ProseMirror `view.update` plugin now writes one reactive record that the toolbar, the `#toolbar` slot, and the bubble all read. The leftover stored-link cleanup is marked `addToHistory: false`.
|
|
55
|
+
|
|
3
56
|
## 0.32.0
|
|
4
57
|
|
|
5
58
|
### Patch 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-DqQwYYJ1.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-DqQwYYJ1.js';
|
|
2
2
|
|
|
3
3
|
interface KunHeading {
|
|
4
4
|
/** Heading level 1–6. */
|
package/dist/preset/index.cjs
CHANGED
|
@@ -181,7 +181,9 @@ var stopLinkCommand = utils.$command("StopLink", (ctx) => () => {
|
|
|
181
181
|
const markType = commonmark.linkSchema.type(ctx);
|
|
182
182
|
const checkMark = hasMark(state, markType);
|
|
183
183
|
if (checkMark) {
|
|
184
|
-
dispatch?.(
|
|
184
|
+
dispatch?.(
|
|
185
|
+
state.tr.removeStoredMark(markType).setMeta("addToHistory", false)
|
|
186
|
+
);
|
|
185
187
|
}
|
|
186
188
|
return false;
|
|
187
189
|
};
|
|
@@ -205,13 +207,13 @@ var clearOrphanLink = utils.$prose(
|
|
|
205
207
|
return null;
|
|
206
208
|
}
|
|
207
209
|
const linkType = commonmark.linkSchema.type(ctx);
|
|
208
|
-
if (!
|
|
210
|
+
if (!linkType.isInSet(storedMarks)) {
|
|
209
211
|
return null;
|
|
210
212
|
}
|
|
211
|
-
if (selection.$from.marks()
|
|
213
|
+
if (linkType.isInSet(selection.$from.marks())) {
|
|
212
214
|
return null;
|
|
213
215
|
}
|
|
214
|
-
return newState.tr.removeStoredMark(linkType);
|
|
216
|
+
return newState.tr.removeStoredMark(linkType).setMeta("addToHistory", false);
|
|
215
217
|
}
|
|
216
218
|
})
|
|
217
219
|
);
|