@kungal/editor-nuxt 0.29.0 → 0.31.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,47 @@
1
1
  # @kungal/editor-nuxt
2
2
 
3
+ ## 0.31.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6b3a2f7]
8
+ - @kungal/editor-vue@0.31.0
9
+ - @kungal/editor-core@0.31.0
10
+
11
+ ## 0.30.0
12
+
13
+ ### Minor Changes
14
+
15
+ - afdeb84: `<KunEditorViewSwitch>` now forwards `variant` / `color` / `size` to its KunTab, so
16
+ the 预览 / Markdown / 分栏 switch can be restyled without rebuilding it:
17
+
18
+ ```vue
19
+ <template #view-switch="s">
20
+ <KunEditorViewSwitch
21
+ v-bind="s"
22
+ variant="solid"
23
+ color="secondary"
24
+ size="md"
25
+ />
26
+ </template>
27
+ ```
28
+
29
+ Defaults stay `underlined` / `primary` / `sm` (`size` also sizes the swap /
30
+ scroll-sync buttons). This is the middle of the three customization layers, now all
31
+ documented on the KunUI-toolbar example: (1) the default headless switch is styled
32
+ via the `.kun-editor__toolbar` / `.kun-editor__tab` (`[data-active]`) CSS hooks;
33
+ (2) `<KunEditorViewSwitch>` takes these appearance props; (3) the `#view-switch`
34
+ slot API lets you render a completely different control.
35
+
36
+ Verified in the docs production build: a `solid` / `secondary` / `md` switch
37
+ renders a bordered, taller tab group distinct from the default underlined one; 0
38
+ console errors.
39
+
40
+ ### Patch Changes
41
+
42
+ - @kungal/editor-core@0.30.0
43
+ - @kungal/editor-vue@0.30.0
44
+
3
45
  ## 0.29.0
4
46
 
5
47
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/editor-nuxt",
3
- "version": "0.29.0",
3
+ "version": "0.31.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.29.0",
35
- "@kungal/editor-vue": "0.29.0"
34
+ "@kungal/editor-core": "0.31.0",
35
+ "@kungal/editor-vue": "0.31.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 = defineProps<KunEditorViewSwitchApi>()
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="underlined"
37
- color="primary"
38
- size="sm"
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="sm"
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="sm"
73
+ :size="size"
55
74
  :is-icon-only="true"
56
75
  :aria-label="labels.scrollSync"
57
76
  :aria-pressed="scrollSync"