@kungal/editor-nuxt 0.38.0 → 0.38.1
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 +30 -0
- package/README.md +6 -0
- package/package.json +4 -3
- package/runtime/KunEditorToolbar.vue +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @kungal/editor-nuxt
|
|
2
2
|
|
|
3
|
+
## 0.38.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f078b5b: KunUI 工具栏的链接面板不再抢着聚焦,页面不会被弹到顶部
|
|
8
|
+
|
|
9
|
+
下游报的两个 bug:① 滚到页面中部点「链接」,整页跳回顶部;② 编辑器放进 `KunModal` /
|
|
10
|
+
`KunDrawer` 时,链接面板里的输入框一个字都打不进去。
|
|
11
|
+
|
|
12
|
+
两个都属实,但根因都在 KunUI 侧,且 `@kungal/ui-vue` **2.26.0 已经全部修好**(库里每一处
|
|
13
|
+
主动 `focus()` 都带 `preventScroll`;浮层面板会登记进开它的那个弹窗的焦点陷阱)。
|
|
14
|
+
|
|
15
|
+
这里只做一件事:**把工具栏链接面板上那个多余的 `:autofocus="true"` 删掉。**
|
|
16
|
+
`KunPopover` 打开时本来就会带着 `preventScroll` 聚焦面板里第一个可聚焦元素 ——
|
|
17
|
+
输入框自己的挂载聚焦比它早一拍,发生在 floating-ui 量出位置**之前**,此时 teleport 到
|
|
18
|
+
`<body>` 的面板还停在文档原点(实测 `getBoundingClientRect().top === -1440`),
|
|
19
|
+
浏览器「滚动到该元素」就把整页拉回了顶部。这个 prop 从来没做过 popover 没做对的事,
|
|
20
|
+
删掉之后即使宿主的 KunUI 还没升到 2.26.0,也不会再跳顶。
|
|
21
|
+
|
|
22
|
+
第二个问题(弹窗里的焦点陷阱)编辑器这一侧无解 —— 面板是 KunUI teleport 的,陷阱也是
|
|
23
|
+
KunUI 建的。**编辑器放进 `KunModal` / `KunDrawer`,请把 `@kungal/ui-vue` 升到 2.26.0 及以上**,
|
|
24
|
+
这一点已写进 `@kungal/editor-nuxt` 的 README 与文档的「Nuxt 接入」页(那页还加了一个
|
|
25
|
+
「弹窗里的编辑器」实测 demo)。
|
|
26
|
+
|
|
27
|
+
无破坏性变更:面板照样自动聚焦,行为不变。
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [f078b5b]
|
|
30
|
+
- @kungal/editor-core@0.38.1
|
|
31
|
+
- @kungal/editor-vue@0.38.1
|
|
32
|
+
|
|
3
33
|
## 0.38.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -30,6 +30,12 @@ Then, anywhere in a template:
|
|
|
30
30
|
`@kungal/ui-tokens` + `@kungal/ui-vue` setup. This layer intentionally owns no
|
|
31
31
|
Tailwind entry — the `@source` scan path is node_modules-layout-specific, so
|
|
32
32
|
only the app can write it correctly.
|
|
33
|
+
- **Rendering the editor inside a `KunModal` / `KunDrawer` needs
|
|
34
|
+
`@kungal/ui-vue` >= 2.26.0.** The toolbar's link and sticker panels are
|
|
35
|
+
`KunPopover`s, which teleport to `<body>`; before 2.26.0 an overlay's focus
|
|
36
|
+
trap did not know about them and pulled focus straight back to the trigger, so
|
|
37
|
+
those panels could not be typed into. 2.26.0 registers a popover with the
|
|
38
|
+
overlay that opened it. Nothing to configure on the editor side.
|
|
33
39
|
|
|
34
40
|
## Status
|
|
35
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungal/editor-nuxt",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"description": "KunEditor Nuxt Layer — wraps @kungal/editor-vue and auto-imports <KunEditor> so an existing Nuxt app keeps its exact DX (no import needed).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"nuxt.config.ts"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@kungal/editor-
|
|
36
|
-
"@kungal/editor-
|
|
35
|
+
"@kungal/editor-core": "0.38.1",
|
|
36
|
+
"@kungal/editor-vue": "0.38.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@kungal/ui-vue": "^2.7.0",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"vue": "^3.5.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@kungal/ui-vue": "^2.26.0",
|
|
45
46
|
"@nuxt/kit": "^4.4.7"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
@@ -321,7 +321,16 @@ const insertSticker = (src: string, name: string) =>
|
|
|
321
321
|
</template>
|
|
322
322
|
<!-- `type="text"` + `inputmode="url"`, never `type="url"`: this IS a
|
|
323
323
|
form, so native URL validation would block submit on a schemeless
|
|
324
|
-
`www.a.com/x` — the very input insertLinkCommand normalizes.
|
|
324
|
+
`www.a.com/x` — the very input insertLinkCommand normalizes.
|
|
325
|
+
|
|
326
|
+
NO `autofocus`: KunPopover already focuses the first focusable
|
|
327
|
+
element in its panel when it opens, and does it with
|
|
328
|
+
`preventScroll`. The input's own mount-time focus ran a tick
|
|
329
|
+
EARLIER — while the panel, teleported to <body>, was still sitting
|
|
330
|
+
at the document origin because floating-ui had not measured yet —
|
|
331
|
+
so "scroll the focused element into view" yanked the whole page to
|
|
332
|
+
the top. KunUI ≥ 2.26.0 passes preventScroll there too, but this
|
|
333
|
+
prop was doing nothing the popover wasn't already doing right. -->
|
|
325
334
|
<form class="flex items-center gap-1" @submit.prevent="applyLink">
|
|
326
335
|
<KunInput
|
|
327
336
|
v-model="linkUrl"
|
|
@@ -329,7 +338,6 @@ const insertSticker = (src: string, name: string) =>
|
|
|
329
338
|
inputmode="url"
|
|
330
339
|
size="sm"
|
|
331
340
|
:placeholder="t.linkPlaceholder"
|
|
332
|
-
:autofocus="true"
|
|
333
341
|
class="flex-1"
|
|
334
342
|
/>
|
|
335
343
|
<KunButton type="submit" variant="flat" color="primary" size="sm">
|