@kungal/editor-vue 0.7.0 → 0.8.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,29 @@
1
1
  # @kungal/editor-vue
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c0908c5: Make `<KunEditor>` headless — ship zero CSS.
8
+
9
+ **BREAKING** (pre-1.0): the `@kungal/editor-vue/style.css` export is removed. The
10
+ component now renders only stable class hooks (`.kun-editor__*`,
11
+ `.kun-mention-dropdown*`) and `data-*` state; all styling is the host's.
12
+
13
+ Migration: copy the reference stylesheet
14
+ `apps/docs/app/assets/css/kun-editor.css` (themed with KunUI tokens) into your
15
+ app and import it, or write your own targeting the same hooks. Also import each
16
+ enabled peer's CSS (e.g. `katex/dist/katex.min.css`). The reference stylesheet
17
+ carries the two structural rules the editor needs (ProseMirror `white-space`,
18
+ popover positioning / show-hide).
19
+
20
+ Also drops the unused `@kungal/ui-vue` peer dependency — the editor no longer
21
+ references any UI kit, so it installs in any Vue 3 app.
22
+
23
+ ### Patch Changes
24
+
25
+ - @kungal/editor-core@0.8.0
26
+
3
27
  ## 0.7.0
4
28
 
5
29
  ### Minor Changes
package/README.md CHANGED
@@ -2,18 +2,22 @@
2
2
 
3
3
  The **Vue 3 render layer** of KunEditor: the `<KunEditor>` component (dual
4
4
  WYSIWYG preview + markdown-source), its toolbar and the Vue plugin views
5
- (mention dropdown, tooltip, sticker/emoji picker). Consumes
6
- [`@kungal/editor-core`](../editor-core) for the plugin brain and pairs with
7
- [`@kungal/ui-vue`](https://github.com/kungal/kun-ui) for the chrome.
5
+ (mention dropdown, sticker/emoji picker). Consumes
6
+ [`@kungal/editor-core`](../editor-core) for the plugin brain.
8
7
 
9
- Works in any Vue 3 app; `@kungal/editor-nuxt` adds Nuxt auto-import sugar.
8
+ **Headless ships zero CSS.** The component only renders stable class hooks
9
+ (`.kun-editor__*`, `.kun-mention-dropdown*`) + `data-*` state; you own the look.
10
+ Copy the reference stylesheet [`apps/docs/app/assets/css/kun-editor.css`](../../apps/docs/app/assets/css/kun-editor.css)
11
+ (themed with KunUI tokens), or write your own. It works in any Vue 3 app;
12
+ `@kungal/editor-nuxt` adds Nuxt auto-import sugar.
10
13
 
11
14
  ## Usage
12
15
 
13
16
  ```vue
14
17
  <script setup lang="ts">
15
18
  import { KunEditor, type KunEditorAdapters } from '@kungal/editor-vue'
16
- import '@kungal/editor-vue/style.css'
19
+ // Headless: bring your own styles. See apps/docs for the KunUI-themed reference.
20
+ import '~/assets/kun-editor.css'
17
21
 
18
22
  const markdown = ref('')
19
23
 
@@ -38,13 +42,13 @@ no other config.
38
42
  Install the Milkdown stack **once in the host** (single ProseMirror instance):
39
43
 
40
44
  ```bash
41
- pnpm add @kungal/editor-vue @kungal/editor-core \
42
- @kungal/ui-vue vue \
45
+ pnpm add @kungal/editor-vue @kungal/editor-core vue \
43
46
  @milkdown/kit @milkdown/prose @milkdown/vue
44
47
  ```
45
48
 
46
- Enable optional plugins by also installing their peers: `katex` (LaTeX),
47
- `codemirror` + `@codemirror/view` + `@codemirror/language-data` (code blocks).
49
+ Enable optional plugins by also installing their peers: `katex` (LaTeX, also
50
+ import `katex/dist/katex.min.css`), the `@codemirror/*` packages + `codemirror`
51
+ (code blocks and the markdown-source view).
48
52
 
49
53
  ## Status
50
54
 
@@ -1 +1 @@
1
- {"version":3,"file":"EditorToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/EditorToolbar.vue"],"names":[],"mappings":"AAqbA,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":"AAgZA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"KunEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/KunEditor.vue"],"names":[],"mappings":"AAuMA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAM5B,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;CACnB,CAAC;AAuMJ,QAAA,MAAM,YAAY;;;;;cA9MH,iBAAiB;cAEjB,iBAAiB;YAEnB,eAAe;cAEb,OAAO;6EA4MpB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"KunEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/KunEditor.vue"],"names":[],"mappings":"AA6JA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAM5B,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;CACnB,CAAC;AAuMJ,QAAA,MAAM,YAAY;;;;;cA9MH,iBAAiB;cAEjB,iBAAiB;YAEnB,eAAe;cAEb,OAAO;6EA4MpB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownSource.vue.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownSource.vue"],"names":[],"mappings":"AAkGA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC;AA2EF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MarkdownSource.vue.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownSource.vue"],"names":[],"mappings":"AA2FA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC;AA2EF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MentionDropdown.vue.d.ts","sourceRoot":"","sources":["../../src/components/MentionDropdown.vue"],"names":[],"mappings":"AA8pBA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MentionDropdown.vue.d.ts","sourceRoot":"","sources":["../../src/components/MentionDropdown.vue"],"names":[],"mappings":"AAulBA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StickerPicker.vue.d.ts","sourceRoot":"","sources":["../../src/components/StickerPicker.vue"],"names":[],"mappings":"AAyhBA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"StickerPicker.vue.d.ts","sourceRoot":"","sources":["../../src/components/StickerPicker.vue"],"names":[],"mappings":"AA8aA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/editor-vue",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "KunEditor Vue 3 layer — the <KunEditor> component (dual WYSIWYG / markdown-source), toolbar and plugin views. Consumes @kungal/editor-core; pairs with @kungal/ui-vue.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -24,10 +24,7 @@
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  },
27
- "sideEffects": [
28
- "*.css",
29
- "*.vue"
30
- ],
27
+ "sideEffects": false,
31
28
  "files": [
32
29
  "CHANGELOG.md",
33
30
  "dist"
@@ -39,18 +36,16 @@
39
36
  ".": {
40
37
  "types": "./dist/index.d.ts",
41
38
  "import": "./dist/index.js"
42
- },
43
- "./style.css": "./dist/style.css"
39
+ }
44
40
  },
45
41
  "dependencies": {
46
42
  "@prosemirror-adapter/vue": "^0.4.6",
47
- "@kungal/editor-core": "0.7.0"
43
+ "@kungal/editor-core": "0.8.0"
48
44
  },
49
45
  "peerDependencies": {
50
46
  "@codemirror/lang-markdown": "^6.0.0",
51
47
  "@codemirror/state": "^6.0.0",
52
48
  "@codemirror/view": "^6.0.0",
53
- "@kungal/ui-vue": "^2.7.0",
54
49
  "@milkdown/kit": "^7.21.2",
55
50
  "@milkdown/prose": "^7.21.2",
56
51
  "@milkdown/vue": "^7.21.2",
@@ -85,7 +80,7 @@
85
80
  "vite": "^8.0.16",
86
81
  "vue": "^3.5.35",
87
82
  "vue-tsc": "^3.3.3",
88
- "@kungal/editor-core": "0.7.0"
83
+ "@kungal/editor-core": "0.8.0"
89
84
  },
90
85
  "scripts": {
91
86
  "build": "vite build && vue-tsc -p tsconfig.build.json",
package/dist/style.css DELETED
@@ -1,2 +0,0 @@
1
- .kun-mention-dropdown{z-index:30;background:var(--color-background,#fff);border:1px solid var(--color-default-200,#e4e4e7);border-radius:.5rem;min-width:12rem;max-width:20rem;max-height:16rem;padding:.25rem;display:none;position:absolute;overflow-y:auto;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.kun-mention-dropdown[data-show=true]{display:block}.kun-mention-dropdown__item{width:100%;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:.375rem;align-items:center;gap:.5rem;padding:.375rem .5rem;display:flex}.kun-mention-dropdown__item:hover,.kun-mention-dropdown__item[data-active=true]{background:var(--color-default-100,#f4f4f5)}.kun-mention-dropdown__avatar{object-fit:cover;border-radius:9999px;flex-shrink:0;width:1.5rem;height:1.5rem}.kun-mention-dropdown__avatar--fallback{background:var(--color-default-200,#e4e4e7);color:var(--color-default-600,#52525b);justify-content:center;align-items:center;font-size:.75rem;display:flex}.kun-mention-dropdown__name{text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;overflow:hidden}.kun-mention-dropdown__hint{color:var(--color-default-400,#a1a1aa);padding:.375rem .5rem;font-size:.875rem}.kun-editor__picker{display:inline-flex;position:relative}.kun-editor__picker-panel{z-index:30;background:var(--color-background,#fff);border:1px solid var(--color-default-200,#e4e4e7);border-radius:.5rem;width:18rem;padding:.5rem;position:absolute;top:calc(100% + .25rem);left:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.kun-editor__picker-tabs{gap:.25rem;margin-bottom:.5rem;display:flex}.kun-editor__picker-tab{font:inherit;cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;flex:1;padding:.25rem .5rem}.kun-editor__picker-tab[data-active=true]{border-bottom-color:var(--color-primary,#006fee);color:var(--color-primary,#006fee)}.kun-editor__emoji-grid{grid-template-columns:repeat(8,1fr);gap:.125rem;max-height:16rem;display:grid;overflow-y:auto}.kun-editor__emoji{aspect-ratio:1;cursor:pointer;background:0 0;border:none;border-radius:.375rem;font-size:1.25rem;line-height:1}.kun-editor__emoji:hover{background:var(--color-default-100,#f4f4f5)}.kun-editor__sticker-body{max-height:16rem;overflow-y:auto}.kun-editor__pack-name{color:var(--color-default-500,#71717a);padding:.25rem .125rem;font-size:.75rem}.kun-editor__sticker-grid{grid-template-columns:repeat(5,1fr);gap:.25rem;display:grid}.kun-editor__sticker{aspect-ratio:1;cursor:pointer;background:0 0;border:none;border-radius:.375rem;padding:.125rem}.kun-editor__sticker:hover{background:var(--color-default-100,#f4f4f5)}.kun-editor__sticker img{object-fit:contain;width:100%;height:100%}.kun-editor__picker-hint{color:var(--color-default-400,#a1a1aa);text-align:center;padding:1rem;font-size:.875rem}.kun-editor__format-toolbar{flex-wrap:wrap;align-items:center;gap:.125rem;display:flex}.kun-editor__toolbar-divider{background:var(--color-default-200,#e4e4e7);align-self:stretch;width:1px;margin:.25rem}.kun-editor__tool{width:1.75rem;height:1.75rem;color:var(--color-foreground,#27272a);cursor:pointer;background:0 0;border:none;border-radius:.375rem;justify-content:center;align-items:center;padding:0;display:inline-flex}.kun-editor__tool:hover{background:var(--color-default-100,#f4f4f5)}.kun-editor__icon{display:inline-flex}.kun-editor__source .cm-editor{border:1px solid var(--color-default-200,#e4e4e7);border-radius:.5rem;overflow:hidden}.kun-editor{flex-direction:column;gap:.5rem;display:flex}.kun-editor__toolbar{gap:.25rem;display:flex}.kun-editor__tab{border:1px solid var(--color-default-200,#e4e4e7);font:inherit;cursor:pointer;background:0 0;border-radius:.5rem;padding:.25rem .75rem}.kun-editor__tab[data-active=true]{background:var(--color-primary,#006fee);border-color:var(--color-primary,#006fee);color:#fff}.kun-editor__wysiwyg .milkdown{outline:none}.kun-editor__wysiwyg .ProseMirror{border:1px solid var(--color-default-200,#e4e4e7);white-space:pre-wrap;word-wrap:break-word;border-radius:.5rem;outline:none;min-height:8rem;padding:.75rem}
2
- /*$vite$:1*/