vscode-colaview 0.3.2 → 0.4.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 (42) hide show
  1. package/.vscode/settings.json +1 -1
  2. package/CHANGELOG.md +30 -0
  3. package/README.md +311 -279
  4. package/README_CN.md +311 -279
  5. package/RELEASE_NOTES.md +56 -0
  6. package/esbuild.js +2 -0
  7. package/package.json +58 -19
  8. package/package.nls.json +14 -0
  9. package/package.nls.zh-cn.json +14 -0
  10. package/src/commands/commands.ts +48 -0
  11. package/src/docx/docx-builder.ts +241 -0
  12. package/src/export/docx-exporter.ts +961 -961
  13. package/src/export/html-exporter.ts +8 -2
  14. package/src/export/pdf-exporter.ts +65 -0
  15. package/src/export/pptx-exporter.ts +63 -0
  16. package/src/export/render-export-images.ts +386 -372
  17. package/src/export/theme-style.ts +195 -155
  18. package/src/pptx/pptx-builder.ts +249 -0
  19. package/src/pptx/zip.ts +158 -0
  20. package/src/present/presenter.ts +64 -0
  21. package/src/preview/preview-manager.ts +783 -541
  22. package/src/preview/webview/app.ts +588 -366
  23. package/src/preview/webview/index.html +167 -134
  24. package/src/slides/deck.ts +397 -0
  25. package/src/slides/markdown.ts +393 -0
  26. package/src/slides/render.ts +484 -0
  27. package/src/slides/slides.css +1082 -0
  28. package/src/themes/built-in/bear.css +89 -38
  29. package/src/themes/built-in/dark.css +87 -20
  30. package/src/themes/built-in/dracula.css +93 -38
  31. package/src/themes/built-in/elegant.css +109 -52
  32. package/src/themes/built-in/gruvbox.css +97 -42
  33. package/src/themes/built-in/light.css +80 -20
  34. package/src/themes/built-in/midnight.css +93 -31
  35. package/src/themes/built-in/nord.css +93 -38
  36. package/src/themes/built-in/notion.css +98 -48
  37. package/src/themes/built-in/sepia.css +99 -47
  38. package/src/themes/built-in/solarized-dark.css +94 -35
  39. package/src/themes/built-in/writer.css +99 -44
  40. package/src/themes/theme-manager.ts +207 -180
  41. package/src/types/colamd-renderer.d.ts +47 -47
  42. package/patches/@bytechain.cn+colamd+2.7.11.patch +0 -22
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "colaview.autoPreview": false,
3
- "colaview.theme": "elegant"
3
+ "colaview.theme": "notion"
4
4
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.4.0] - 2026-12-01
6
+
7
+ ### Added
8
+ - **Menu optimization** — the editor context menu now only offers "Show Preview" and "Show Slides Preview". The preview context menu keeps Present (Fullscreen) pinned first and scopes exports to the current mode: documents get PDF / HTML / Word, slides get PDF / PPTX. Command titles are localized via `package.nls.json` / `package.nls.zh-cn.json` (following the VS Code display language), and the preview commands ship keybindings `Ctrl+Alt+V` (preview) / `Ctrl+Alt+S` (slides preview), active only in Markdown files.
9
+ - **Grouped theme submenu** — theme groups are Built-in · Light / Built-in · Dark / Custom, and the submenu is capped at 70vh with scrolling, so long custom-theme lists no longer overflow the page.
10
+ - **DSH rendering alignment** — the 12 built-in themes are upgraded to the ColaMD 2.8 contract (seed palette, `--font-body`/`--font-mono`/`--editor-font-size`/`--editor-column-width` typography tokens, JetBrains Mono / Fira Code webfont mirroring with `fonts.gstatic.com` allowed by CSP), and the WebView injects a DSH BASE_CSS alignment layer via zero-specificity `:where()` rules: 820px column + 2.2rem gutters, 1.78 body line-height (per-theme values win), 0.01em letter-spacing, token-driven heading metrics with h1/h2 underlines removed. Cascade: engine defaults < alignment layer < theme identity rules.
11
+ - **Slide preview, presenting & exports** (merged from the 0.2.x line, released as v0.3.4 on main) — dedicated slide render layer at 1920×1080, fullscreen presenting via the system browser, slide exports to PDF / standalone `.slides.html` / PPTX, and bilingual preview menus.
12
+
13
+ ### Changed
14
+ - **Engine upgrade: ColaMD 2.8.2** — `@bytechain.cn/colamd` bumped from 2.7.11 to 2.8.2. The engine now ships the CM6 whole-line `block: true` replace-decoration fix natively (mermaid always, block math / HTML blocks when covering full lines, tables always), and its own `.cm-md-mermaid` palette is page-based. The `patch-package` patch is retired — no more node_modules patching.
15
+ - **All 12 built-in theme files synced with ColaMD-extend** (the 2.7.12+ theme contract): refined border colors in every theme, Elegant drops the dead `--table-border` variable, Dark/Midnight/Writer add strong and inline-code accent colors, Notion replaces the link-underline rules with strong/URL colors, Dracula/Gruvbox/Nord/Midnight drop blockquote text overrides, Elegant/Sepia drop blockquote horizontal padding.
16
+ - **Mermaid diagrams now render on the page, not on the code block** — preview and HTML/PDF exports derive the `--pele-*` tokens from `--bg-color`/`--text-color` (18%/28%/45% mixes, same ratios as the engine) instead of `--code-block-bg`/`--code-block-text`, and no longer paint a code-block background behind the diagram. This matches ColaMD-extend: diagrams are dark-lines-on-paper in light themes and light-lines-on-dark in dark themes. Most visible with Elegant/Bear, which previously drew pale lines on the dark code-block background.
17
+ - **Word export color rules hardened** (mirroring ColaMD-extend `docx-style.ts`) — dark themes fall back entirely to the light palette (Word is white paper; light-on-dark text would be invisible), and light themes with a dark code block (Elegant/Bear) render diagrams on a white background with the body text color instead of pale code-block text on white.
18
+
19
+ ### Fixed
20
+ - **Slides mode reverted to the original theme after switching** — `switchTheme` wrote `colaview.theme` to user settings while a workspace value (e.g. `.vscode/settings.json`) shadowed it, so `pushSlides` recomposed the deck CSS from the stale `getCurrentTheme()`. Theme writes now target the workspace when one is open, and theme switches pass the theme name explicitly to `pushSlides`.
21
+ - **Theme-file variables were inert in the preview** — the engine writes the same variables on `body.theme-x` (specificity 0,1,1), which always beat the injected `:root` block (0,1,0), so the built-in and custom theme files' variable values never took effect in the preview (while their element rules did, producing mixed rendering). Theme CSS is now injected as `:root, body.theme-x` so it wins, and HTML exports apply the same scoping — preview and export stay identical.
22
+
23
+ ### Removed
24
+ - `patches/` — the CM6 `block: true` patch is no longer needed with engine 2.8.2 (`patch-package` stays wired through `postinstall` and simply finds nothing to apply).
25
+
26
+ ## [0.3.4] - 2026-12-01
27
+
28
+ ### Added
29
+ - **幻灯片预览与放映(合入 0.2.x 分支的能力,适配 0.4.0 的 CodeMirror 6 预览层)** — 复用上游 `slides.css` 行级契约的独立渲染层(`src/slides/`),按 `<!-- slide: cover -->` 等指令分页,每页固定 1920×1080;预览面板内可在文档/幻灯片两种模式间切换。
30
+ - **全屏放映** — 文档与幻灯片都交给系统浏览器放映(`src/present/`):幻灯片 ←/→ 翻页、`F` 切换全屏、点击左右半屏翻页。
31
+ - **幻灯片导出** — PDF(每页 1920×1080)、独立 HTML(`.slides.html`,自带翻页与全屏)、PPTX(16:9,零依赖 OOXML)。
32
+ - **中英双语的预览菜单** — 右键菜单文案由扩展宿主按 `vscode.env.language` 下发;「全屏显示」固定置顶,导出项按文档/幻灯片模式区分(文档给 Word,幻灯片给 PPTX)。
33
+
34
+
5
35
  ## [0.3.2] - 2026-11-07
6
36
 
7
37
  ### Fixed