@kungal/editor-nuxt 0.19.0 → 0.20.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/package.json +3 -3
- package/runtime/KunEditorViewSwitch.vue +22 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @kungal/editor-nuxt
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 62e14f5: Split view: sync scrolling between the panes, with an off switch.
|
|
8
|
+
|
|
9
|
+
Scrolling the markdown source pane now scrolls the WYSIWYG preview to the same
|
|
10
|
+
position (and vice-versa) — proportional/percentage sync (source↔preview line
|
|
11
|
+
mapping is impractical across two separate renderers), with an active-pane +
|
|
12
|
+
idle-timeout guard so the echoed scroll doesn't feed back into a loop.
|
|
13
|
+
|
|
14
|
+
Turn it off two ways (for downstream customization):
|
|
15
|
+
|
|
16
|
+
- **`scrollSync` prop** on `<KunEditor>` (default `true`) — pass
|
|
17
|
+
`:scroll-sync="false"` to disable entirely.
|
|
18
|
+
- **A runtime toggle** in the view switch: `KunEditorViewSwitchApi` gains
|
|
19
|
+
`scrollSync` / `toggleScrollSync()` (+ `labels.scrollSync`). The default view
|
|
20
|
+
switch shows a 同步滚动 toggle in split mode; `<KunEditorViewSwitch>` (editor-nuxt)
|
|
21
|
+
shows a KunUI link/unlink toggle button. Or replace the whole control via the
|
|
22
|
+
`#view-switch` slot.
|
|
23
|
+
|
|
24
|
+
Sync needs each pane to scroll internally, so the reference `kun-editor.css` now
|
|
25
|
+
gives split panes a bounded height (`--kun-editor-split-height`, default `60vh`,
|
|
26
|
+
overridable) with `overflow: auto`. editor-vue still ships zero CSS.
|
|
27
|
+
|
|
28
|
+
Verified in the docs production build (headless + KunUI view switches): with the
|
|
29
|
+
panes overflowing, scrolling the source drives the preview to the same ratio;
|
|
30
|
+
toggling off makes them scroll independently; toggling on resumes; 0 console
|
|
31
|
+
errors.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [62e14f5]
|
|
36
|
+
- @kungal/editor-vue@0.20.0
|
|
37
|
+
- @kungal/editor-core@0.20.0
|
|
38
|
+
|
|
3
39
|
## 0.19.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungal/editor-nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
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": [
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"nuxt.config.ts"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@kungal/editor-core": "0.
|
|
35
|
-
"@kungal/editor-vue": "0.
|
|
34
|
+
"@kungal/editor-core": "0.20.0",
|
|
35
|
+
"@kungal/editor-vue": "0.20.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@kungal/ui-vue": "^2.7.0",
|
|
@@ -38,15 +38,27 @@ const onChange = (value: string) => {
|
|
|
38
38
|
size="sm"
|
|
39
39
|
@update:model-value="onChange"
|
|
40
40
|
/>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
<template v-if="mode === 'split'">
|
|
42
|
+
<KunButton
|
|
43
|
+
variant="light"
|
|
44
|
+
size="sm"
|
|
45
|
+
:is-icon-only="true"
|
|
46
|
+
:aria-label="labels.swap"
|
|
47
|
+
@click="swap()"
|
|
48
|
+
>
|
|
49
|
+
<KunIcon name="lucide:arrow-left-right" />
|
|
50
|
+
</KunButton>
|
|
51
|
+
<KunButton
|
|
52
|
+
:variant="scrollSync ? 'flat' : 'light'"
|
|
53
|
+
:color="scrollSync ? 'primary' : 'default'"
|
|
54
|
+
size="sm"
|
|
55
|
+
:is-icon-only="true"
|
|
56
|
+
:aria-label="labels.scrollSync"
|
|
57
|
+
:aria-pressed="scrollSync"
|
|
58
|
+
@click="toggleScrollSync()"
|
|
59
|
+
>
|
|
60
|
+
<KunIcon :name="scrollSync ? 'lucide:link' : 'lucide:unlink'" />
|
|
61
|
+
</KunButton>
|
|
62
|
+
</template>
|
|
51
63
|
</div>
|
|
52
64
|
</template>
|