@kungal/editor-nuxt 0.29.0 → 0.30.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 +34 -0
- package/package.json +3 -3
- package/runtime/KunEditorViewSwitch.vue +25 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @kungal/editor-nuxt
|
|
2
2
|
|
|
3
|
+
## 0.30.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- afdeb84: `<KunEditorViewSwitch>` now forwards `variant` / `color` / `size` to its KunTab, so
|
|
8
|
+
the 预览 / Markdown / 分栏 switch can be restyled without rebuilding it:
|
|
9
|
+
|
|
10
|
+
```vue
|
|
11
|
+
<template #view-switch="s">
|
|
12
|
+
<KunEditorViewSwitch
|
|
13
|
+
v-bind="s"
|
|
14
|
+
variant="solid"
|
|
15
|
+
color="secondary"
|
|
16
|
+
size="md"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defaults stay `underlined` / `primary` / `sm` (`size` also sizes the swap /
|
|
22
|
+
scroll-sync buttons). This is the middle of the three customization layers, now all
|
|
23
|
+
documented on the KunUI-toolbar example: (1) the default headless switch is styled
|
|
24
|
+
via the `.kun-editor__toolbar` / `.kun-editor__tab` (`[data-active]`) CSS hooks;
|
|
25
|
+
(2) `<KunEditorViewSwitch>` takes these appearance props; (3) the `#view-switch`
|
|
26
|
+
slot API lets you render a completely different control.
|
|
27
|
+
|
|
28
|
+
Verified in the docs production build: a `solid` / `secondary` / `md` switch
|
|
29
|
+
renders a bordered, taller tab group distinct from the default underlined one; 0
|
|
30
|
+
console errors.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- @kungal/editor-core@0.30.0
|
|
35
|
+
- @kungal/editor-vue@0.30.0
|
|
36
|
+
|
|
3
37
|
## 0.29.0
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungal/editor-nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.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.30.0",
|
|
35
|
+
"@kungal/editor-vue": "0.30.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@kungal/ui-vue": "^2.7.0",
|
|
@@ -10,10 +10,29 @@
|
|
|
10
10
|
// </KunEditor>
|
|
11
11
|
//
|
|
12
12
|
// KunTab / KunButton / KunIcon are auto-imported by @kungal/ui-nuxt.
|
|
13
|
+
//
|
|
14
|
+
// Look is customizable: pass `variant` / `color` / `size` (forwarded to the
|
|
15
|
+
// KunTab, and `size` to the swap / scroll-sync buttons) to restyle without
|
|
16
|
+
// rebuilding the switch. For a completely different control, use the raw
|
|
17
|
+
// #view-switch slot API instead.
|
|
13
18
|
import { computed } from 'vue'
|
|
14
19
|
import type { KunEditorViewSwitchApi } from '@kungal/editor-vue'
|
|
20
|
+
import type { KunTabColor, KunTabSize, KunTabVariant } from '@kungal/ui-vue'
|
|
15
21
|
|
|
16
|
-
const props =
|
|
22
|
+
const props = withDefaults(
|
|
23
|
+
defineProps<
|
|
24
|
+
KunEditorViewSwitchApi & {
|
|
25
|
+
variant?: KunTabVariant
|
|
26
|
+
color?: KunTabColor
|
|
27
|
+
size?: KunTabSize
|
|
28
|
+
}
|
|
29
|
+
>(),
|
|
30
|
+
{
|
|
31
|
+
variant: 'underlined',
|
|
32
|
+
color: 'primary',
|
|
33
|
+
size: 'sm'
|
|
34
|
+
}
|
|
35
|
+
)
|
|
17
36
|
|
|
18
37
|
// Only the offered views (from the `views` prop). Hidden entirely for one view.
|
|
19
38
|
const items = computed(() =>
|
|
@@ -33,15 +52,15 @@ const onChange = (value: string) => {
|
|
|
33
52
|
<KunTab
|
|
34
53
|
:model-value="mode"
|
|
35
54
|
:items="items"
|
|
36
|
-
variant="
|
|
37
|
-
color="
|
|
38
|
-
size="
|
|
55
|
+
:variant="variant"
|
|
56
|
+
:color="color"
|
|
57
|
+
:size="size"
|
|
39
58
|
@update:model-value="onChange"
|
|
40
59
|
/>
|
|
41
60
|
<template v-if="mode === 'split'">
|
|
42
61
|
<KunButton
|
|
43
62
|
variant="light"
|
|
44
|
-
size="
|
|
63
|
+
:size="size"
|
|
45
64
|
:is-icon-only="true"
|
|
46
65
|
:aria-label="labels.swap"
|
|
47
66
|
@click="swap()"
|
|
@@ -51,7 +70,7 @@ const onChange = (value: string) => {
|
|
|
51
70
|
<KunButton
|
|
52
71
|
:variant="scrollSync ? 'flat' : 'light'"
|
|
53
72
|
:color="scrollSync ? 'primary' : 'default'"
|
|
54
|
-
size="
|
|
73
|
+
:size="size"
|
|
55
74
|
:is-icon-only="true"
|
|
56
75
|
:aria-label="labels.scrollSync"
|
|
57
76
|
:aria-pressed="scrollSync"
|