@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/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # @kungal/editor-vue
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
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [ab7fbc2]
42
+ - @kungal/editor-core@0.34.0
43
+
44
+ ## 0.33.0
45
+
46
+ ### Minor Changes
47
+
48
+ - 9294ba2: Insert a link from the selection bubble without a native `prompt`
49
+
50
+ Selecting text → 「链接」 used to pop `window.prompt`. The bubble now asks for the
51
+ URL **in place**: the button row swaps for a URL input (`data-mode="link"`),
52
+ Enter applies, Esc cancels, and the row comes back. If the selection is already
53
+ a link its href is prefilled (and selected), so editing a URL is the same flow.
54
+
55
+ Why in place, and not a popover/dialog: the bubble is a Milkdown tooltip whose
56
+ `shouldShow` keeps it alive only while focus is in the editor **or inside the
57
+ bubble element**. Any popover teleports its panel to `<body>` — outside that
58
+ element — so the bubble would hide the moment the panel's input took focus. An
59
+ input in our own DOM keeps the bubble put, and the ProseMirror selection
60
+ survives the DOM blur, so the link wraps exactly what was selected.
61
+
62
+ Still headless: a plain `<input>` plus one new class hook.
63
+
64
+ ```css
65
+ .kun-editor__bubble[data-mode="link"] {
66
+ /* the URL-entry state */
67
+ }
68
+ .kun-editor__bubble-input {
69
+ /* the input itself */
70
+ }
71
+ ```
72
+
73
+ Hosts that want their own UI keep the escape hatch — the `linkPrompt` adapter
74
+ takes precedence over the inline input, exactly as it does over the KunUI
75
+ toolbar's popover.
76
+
77
+ Also in the shipped reference stylesheet (`@kungal/editor-nuxt/editor.css`): the
78
+ selection bubble, the @mention dropdown and the sticker/emoji picker painted
79
+ themselves with `--color-background` — KunUI's _glassy page_ tint (0.7 alpha) —
80
+ so document text showed through a panel floating over it. They now use the
81
+ RAISED surface token the KunUI popovers use, via one overridable var:
82
+
83
+ ```css
84
+ :root {
85
+ --kun-editor-surface: var(--color-content1, var(--color-background));
86
+ }
87
+ ```
88
+
89
+ ### Patch Changes
90
+
91
+ - Updated dependencies [9294ba2]
92
+ - @kungal/editor-core@0.33.0
93
+
3
94
  ## 0.32.1
4
95
 
5
96
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"EditorToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/EditorToolbar.vue"],"names":[],"mappings":"AAsgBA,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":"AAifA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -95,11 +95,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, KunEditorEx
95
95
  "onUpdate:loading"?: ((loading: boolean) => any) | undefined;
96
96
  "onUpdate:headings"?: ((headings: KunHeading[]) => any) | undefined;
97
97
  }>, {
98
+ placeholder: string;
98
99
  adapters: KunEditorAdapters;
99
100
  features: KunEditorFeatures;
100
101
  locale: KunEditorLocale;
101
102
  readonly: boolean;
102
- placeholder: string;
103
103
  placeholderMode: "doc" | "block";
104
104
  selectionToolbar: boolean | KunSelectionItem[];
105
105
  views: ViewMode[];
@@ -1 +1 @@
1
- {"version":3,"file":"KunEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/KunEditor.vue"],"names":[],"mappings":"AA8bA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACX,MAAM,qBAAqB,CAAA;AAQ5B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAUjE,KAAK,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE9C,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,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,KAAK,GAAG,OAAO,CAAA;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;IAClB;oEACgE;IAChE,UAAU,C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D,QAAA,MAAM,UAAU;;;;;;;;;iBAzhBE,MAAM;cART,iBAAiB;cAEjB,iBAAiB;YAEnB,eAAe;cAEb,OAAO;qBAQA,KAAK,GAAG,OAAO;sBAgBd,OAAO,GAAG,gBAAgB,EAAE;WAVvC,QAAQ,EAAE;gBAGL,OAAO;6EA+gBtB,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"}
@@ -0,0 +1,4 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ //# sourceMappingURL=LinkInput.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkInput.vue.d.ts","sourceRoot":"","sources":["../../src/components/LinkInput.vue"],"names":[],"mappings":"AA0UA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/SelectionTooltip.vue"],"names":[],"mappings":"AA8UA,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":"AAkkBA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}