@kungal/editor-nuxt 0.37.0 → 0.38.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/editor.css +11 -0
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @kungal/editor-nuxt
2
2
 
3
+ ## 0.38.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0f3ceab: 隐藏文本:编辑时看得出被隐藏,光标锚点不再进入存库的 markdown
8
+
9
+ - **剧透块的底色不再依赖宿主 token。** 原来是 `background: var(--color-default-500)`,
10
+ 没有 fallback —— 宿主没定义这个调色板变量时整条声明作废,实测算出来是
11
+ `rgba(0, 0, 0, 0)`:编辑时剧透块和正文长得一模一样。而「零 CSS 的 headless 编辑器」
12
+ 正是这样的宿主。现在自带一份不依赖任何设计 token 的默认底色(由 `currentColor`
13
+ 混出,明暗主题都成立),并留出 `--kun-spoiler-bg` 这个换肤钩子 —— 内联样式压得过
14
+ 任何选择器,但压不过自定义属性,所以这是宿主唯一能用纯 CSS 改它的入口。
15
+ `@kungal/editor-nuxt/editor.css` 把它映射成 `--color-default-200`,KunUI 宿主观感不变。
16
+ - **光标锚点(`U+200B`)只留在编辑器文档里,不再写进 markdown。** 锚点是编辑器的
17
+ 内部装置(光标必须落在某个 text 节点上),但它一直跟着正文一起被序列化出去,存库的
18
+ 文本会变成 `鲲 ||Galgame||<U+200B> 论坛` —— 数据库、diff、以及每一个不认识本编辑器的
19
+ 下游都得吃下这个看不见的字符。现在在 **serializer** 这一层统一剥掉:`getMarkdown()`、
20
+ `v-model`、源码视图、宿主自己的 action 都读同一个 slice,所以一处收口全部干净;
21
+ 从旧内容或粘贴带进来的锚点也一并清掉 —— **旧帖打开再保存一次就自愈**。
22
+ 解析时反过来给每个 `||…||` 补回锚点,所以「点在段尾的剧透块后面接着打字,字落在
23
+ 块外面」这件事和以前一样成立。
24
+
25
+ 对下游没有破坏性改动:markdown 少了一个不可见字符,DOM 结构与命令行为不变。
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [0f3ceab]
30
+ - @kungal/editor-core@0.38.0
31
+ - @kungal/editor-vue@0.38.0
32
+
3
33
  ## 0.37.0
4
34
 
5
35
  ### Minor Changes
package/editor.css CHANGED
@@ -105,6 +105,17 @@
105
105
  word-wrap: break-word;
106
106
  }
107
107
 
108
+ /* The spoiler chip while you EDIT it (`||hidden||`). @kungal/editor-core paints
109
+ * a `currentColor`-derived tint on its own — it must look hidden in a host with
110
+ * no design tokens at all — and reads `--kun-spoiler-bg` first, which is this
111
+ * hook: KunUI's muted surface, so the chip matches the rest of the chrome.
112
+ * Setting a custom property works from here even though the chip's `background`
113
+ * is an inline style (specificity applies per property, and this sets a
114
+ * different one). */
115
+ .kun-editor__wysiwyg .kun-spoiler {
116
+ --kun-spoiler-bg: var(--color-default-200);
117
+ }
118
+
108
119
  /* Placeholder: the editor sets a `data-placeholder` attr + this class on the
109
120
  * empty block (a decoration, not real content). Render the text via ::before so
110
121
  * it never affects the doc / caret. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/editor-nuxt",
3
- "version": "0.37.0",
3
+ "version": "0.38.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": [
@@ -32,8 +32,8 @@
32
32
  "nuxt.config.ts"
33
33
  ],
34
34
  "dependencies": {
35
- "@kungal/editor-core": "0.37.0",
36
- "@kungal/editor-vue": "0.37.0"
35
+ "@kungal/editor-vue": "0.38.0",
36
+ "@kungal/editor-core": "0.38.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@kungal/ui-vue": "^2.7.0",