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,47 +1,99 @@
1
- /* ===== ColaMD Theme: 羊皮纸 Sepia =====
2
- Kindle / Apple Books warm paper, serif body for long-form reading.
3
-
4
- Import: Theme > Import Theme, or place in ~/.colamd/themes/
5
- Variables target :root; element rules target the ColaMD editor DOM. */
6
-
7
- :root {
8
- --bg-color: #f6efe0;
9
- --text-color: #4f4032;
10
- --text-secondary: #7b6b54;
11
- --text-muted: #9a8a72;
12
- --border-color: #e2d7bf;
13
- --link-color: #9c5e29;
14
- --code-bg: rgba(122, 90, 51, 0.1);
15
- --code-block-bg: #ece2cb;
16
- --blockquote-border: #c9a86a;
17
- --blockquote-bg: #efe6d0;
18
- --table-header-bg: #ece2cb;
19
- --selection-bg: rgba(160, 98, 45, 0.15);
20
- --highlight-bg: #f2dfa8;
21
- }
22
-
23
- #editor .cm-content {
24
- font-family: Georgia, 'Source Han Serif SC', 'Noto Serif SC', 'Songti SC', serif;
25
- line-height: 1.85;
26
- }
27
-
28
- #editor .cm-content .cm-md-atxheading1 {
29
- text-align: center;
30
- border-bottom: none;
31
- letter-spacing: 0.02em;
32
- }
33
-
34
- #editor .cm-content .cm-md-atxheading2 {
35
- border-bottom-style: dashed;
36
- }
37
-
38
- #editor .cm-content .cm-md-blockquote {
39
- /* Horizontal only: a quote is one div per line in the editor, so vertical
40
- padding would be added once for every line of the quote. */
41
- padding-left: 24px;
42
- padding-right: 20px;
43
- }
44
-
45
- #editor .cm-content .cm-md-inlinecode {
46
- color: #7a5a33;
47
- }
1
+ /* ===== ColaMD Theme: 羊皮纸 Sepia =====
2
+ Kindle / Apple Books warm paper, serif body for long-form reading.
3
+
4
+ 契约:ColaMD 2.8(与 ColaMD-themes / DSH 插件同一套令牌)。
5
+ 变量写在 :root;编辑器元素规则针对 #editor .cm-content + .cm-md-*。
6
+ 基础版式(行高、字距、列宽、标题度量)由 WebView 的 DSH 对齐层
7
+ 按 BASE_CSS 令牌兜底,这里只保留主题个性。 */
8
+
9
+ /* ── 0. Webfont 镜像:主题栈引用的 Google Fonts(latin 子集,OFL)。
10
+ 与 ColaMD-themes 2.8 契约一致:编辑器与 DSH 插件两侧同字体;
11
+ 离线/断网自动回落主题字体栈;CJK 由系统字体承担,不镜像。 */
12
+ @font-face {
13
+ font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
14
+ src: url("https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbV2o-flEEny0FZhsfKu5WU4xD7OwE.woff2") format("woff2");
15
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
16
+ }
17
+ @font-face {
18
+ font-family: "Fira Code"; font-style: normal; font-weight: 100 900; font-display: swap;
19
+ src: url("https://fonts.gstatic.com/s/firacode/v27/uU9NCBsR6Z2vfE9aq3bh3dSD.woff2") format("woff2");
20
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
21
+ }
22
+
23
+ :root {
24
+ /* ── 1.1 Seed Palette ── */
25
+ --seed-accent: #9c5e29;
26
+ --seed-accent-light: color-mix(in srgb, #9c5e29 15%, transparent);
27
+ --seed-accent-dark: color-mix(in srgb, #9c5e29 85%, #000);
28
+ --seed-surface: #f6efe0;
29
+ --seed-panel: #ece2cb;
30
+ --seed-panel-alt: #ece2cb;
31
+ --seed-ink: #4f4032;
32
+ --seed-ink-muted: #7b6b54;
33
+ --seed-ink-dim: #9a8a72;
34
+ --seed-border: #e7ddc7;
35
+ --seed-border-strong: #9c5e29;
36
+
37
+ /* ── 1.2 Semantic Colors(活变量) ── */
38
+ --bg-color: #f6efe0;
39
+ --text-color: #4f4032;
40
+ --text-secondary: #7b6b54;
41
+ --text-muted: #9a8a72;
42
+ --border-color: #e7ddc7;
43
+ --link-color: #9c5e29;
44
+ --code-bg: rgba(122, 90, 51, 0.1);
45
+ --code-block-bg: #ece2cb;
46
+ --blockquote-border: #c9a86a;
47
+ --blockquote-bg: #efe6d0;
48
+ --table-header-bg: #ece2cb;
49
+ --selection-bg: rgba(160, 98, 45, 0.15);
50
+ --highlight-bg: #f2dfa8;
51
+
52
+ /* ── 1.3 Typography & Metrics(活变量,与 DSH 插件 BASE_CSS 同一消费方) ── */
53
+ --font-body: Georgia, "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
54
+ --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
55
+ --editor-font-size: 16px;
56
+ --editor-column-width: 820px;
57
+ --page-bg: #f6efe0;
58
+ --seed-emphasis: #7a5a33;
59
+ }
60
+
61
+ /* ═══════════════════════════════════════════════════════════
62
+ SECTION 2 — 编辑器 DOM(#editor .cm-content + .cm-md-*)
63
+ ═══════════════════════════════════════════════════════════ */
64
+
65
+ /* ── 2.0 正文:主题字体个性 ── */
66
+ #editor .cm-content {
67
+ font-family: var(--font-body);
68
+ line-height: 1.85;
69
+ }
70
+
71
+ #editor .cm-content .cm-md-atxheading1 {
72
+ text-align: center;
73
+ letter-spacing: 0.02em;
74
+ }
75
+
76
+ #editor .cm-content .cm-md-inlinecode {
77
+ color: #7a5a33;
78
+ }
79
+
80
+ /* ═══════════════════════════════════════════════════════════
81
+ SECTION 3 — 导出 HTML(.colamd-document,只补配色与字体)
82
+ 结构(页边距、标题层级、列表缩进)由导出外壳提供。
83
+ ═══════════════════════════════════════════════════════════ */
84
+
85
+ .colamd-document {
86
+ font-family: var(--font-body);
87
+ font-size: var(--editor-font-size);
88
+ line-height: 1.85;
89
+ background: var(--bg-color);
90
+ color: var(--text-color);
91
+ }
92
+ .colamd-document strong {
93
+ color: var(--seed-emphasis);
94
+ }
95
+ .colamd-document code {
96
+ background: var(--code-bg);
97
+ color: #7a5a33;
98
+ font-family: var(--font-mono);
99
+ }
@@ -1,35 +1,94 @@
1
- /* ===== ColaMD Theme: 夜航 Solarized Dark =====
2
- Deep teal-black sea, muted cyan text, orange and blue stars.
3
-
4
- Import: Theme > Import Theme, or place in ~/.colamd/themes/
5
- Variables target :root; element rules target the ColaMD editor DOM. */
6
-
7
- :root {
8
- --bg-color: #002b36;
9
- --text-color: #c2d5d7;
10
- --text-secondary: #a4bbc3;
11
- --text-muted: #586e75;
12
- --border-color: #0d3d4a;
13
- --link-color: #3093da;
14
- --code-bg: rgba(88, 110, 117, 0.22);
15
- --code-block-bg: #073642;
16
- --blockquote-border: #2aa198;
17
- --table-header-bg: #073642;
18
- --selection-bg: rgba(38, 139, 210, 0.25);
19
- --highlight-bg: rgba(181, 137, 0, 0.3);
20
- }
21
-
22
- #editor .cm-content .cm-md-atxheading1,
23
- #editor .cm-content .cm-md-atxheading2,
24
- #editor .cm-content .cm-md-atxheading3,
25
- #editor .cm-content .cm-md-atxheading4 {
26
- color: #93a1a1;
27
- }
28
-
29
- #editor .cm-content .cm-md-strong {
30
- color: #cb4b16;
31
- }
32
-
33
- #editor .cm-content .cm-md-inlinecode {
34
- color: #2aa198;
35
- }
1
+ /* ===== ColaMD Theme: 夜航 Solarized Dark =====
2
+ Deep teal-black sea, muted cyan text, orange and blue stars.
3
+
4
+ 契约:ColaMD 2.8(与 ColaMD-themes / DSH 插件同一套令牌)。
5
+ 变量写在 :root;编辑器元素规则针对 #editor .cm-content + .cm-md-*。
6
+ 基础版式(行高、字距、列宽、标题度量)由 WebView 的 DSH 对齐层
7
+ 按 BASE_CSS 令牌兜底,这里只保留主题个性。 */
8
+
9
+ /* ── 0. Webfont 镜像:主题栈引用的 Google Fonts(latin 子集,OFL)。
10
+ 与 ColaMD-themes 2.8 契约一致:编辑器与 DSH 插件两侧同字体;
11
+ 离线/断网自动回落主题字体栈;CJK 由系统字体承担,不镜像。 */
12
+ @font-face {
13
+ font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
14
+ src: url("https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbV2o-flEEny0FZhsfKu5WU4xD7OwE.woff2") format("woff2");
15
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
16
+ }
17
+ @font-face {
18
+ font-family: "Fira Code"; font-style: normal; font-weight: 100 900; font-display: swap;
19
+ src: url("https://fonts.gstatic.com/s/firacode/v27/uU9NCBsR6Z2vfE9aq3bh3dSD.woff2") format("woff2");
20
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
21
+ }
22
+
23
+ :root {
24
+ /* ── 1.1 Seed Palette ── */
25
+ --seed-accent: #cb4b16;
26
+ --seed-accent-light: color-mix(in srgb, #cb4b16 15%, transparent);
27
+ --seed-accent-dark: color-mix(in srgb, #cb4b16 85%, #000);
28
+ --seed-surface: #002b36;
29
+ --seed-panel: #073642;
30
+ --seed-panel-alt: #073642;
31
+ --seed-ink: #c2d5d7;
32
+ --seed-ink-muted: #a4bbc3;
33
+ --seed-ink-dim: #586e75;
34
+ --seed-border: #0a3845;
35
+ --seed-border-strong: #cb4b16;
36
+
37
+ /* ── 1.2 Semantic Colors(活变量) ── */
38
+ --bg-color: #002b36;
39
+ --text-color: #c2d5d7;
40
+ --text-secondary: #a4bbc3;
41
+ --text-muted: #586e75;
42
+ --border-color: #0a3845;
43
+ --link-color: #3093da;
44
+ --code-bg: rgba(88, 110, 117, 0.22);
45
+ --code-block-bg: #073642;
46
+ --blockquote-border: #2aa198;
47
+ --table-header-bg: #073642;
48
+ --selection-bg: rgba(38, 139, 210, 0.25);
49
+ --highlight-bg: rgba(181, 137, 0, 0.3);
50
+
51
+ /* ── 1.3 Typography & Metrics(活变量,与 DSH 插件 BASE_CSS 同一消费方) ── */
52
+ --font-body: -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC", sans-serif;
53
+ --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
54
+ --editor-font-size: 16px;
55
+ --editor-column-width: 820px;
56
+ --page-bg: #002b36;
57
+ --seed-emphasis: #cb4b16;
58
+ }
59
+
60
+ /* ═══════════════════════════════════════════════════════════
61
+ SECTION 2 — 编辑器 DOM(#editor .cm-content + .cm-md-*)
62
+ ═══════════════════════════════════════════════════════════ */
63
+
64
+ #editor .cm-content .cm-md-atxheading1,
65
+ #editor .cm-content .cm-md-atxheading2,
66
+ #editor .cm-content .cm-md-atxheading3,
67
+ #editor .cm-content .cm-md-atxheading4 {
68
+ color: #93a1a1;
69
+ }
70
+
71
+ #editor .cm-content .cm-md-inlinecode {
72
+ color: #2aa198;
73
+ }
74
+
75
+ /* ═══════════════════════════════════════════════════════════
76
+ SECTION 3 — 导出 HTML(.colamd-document,只补配色与字体)
77
+ 结构(页边距、标题层级、列表缩进)由导出外壳提供。
78
+ ═══════════════════════════════════════════════════════════ */
79
+
80
+ .colamd-document {
81
+ font-family: var(--font-body);
82
+ font-size: var(--editor-font-size);
83
+ line-height: 1.78;
84
+ background: var(--bg-color);
85
+ color: var(--text-color);
86
+ }
87
+ .colamd-document strong {
88
+ color: var(--seed-emphasis);
89
+ }
90
+ .colamd-document code {
91
+ background: var(--code-bg);
92
+ color: #2aa198;
93
+ font-family: var(--font-mono);
94
+ }
@@ -1,44 +1,99 @@
1
- /* ===== ColaMD Theme: 作家 Writer =====
2
- iA Writer homage: monospace body, zero decoration.
3
-
4
- Import: Theme > Import Theme, or place in ~/.colamd/themes/
5
- Variables target :root; element rules target the ColaMD editor DOM. */
6
-
7
- :root {
8
- --bg-color: #fcfcfa;
9
- --text-color: #1a1a1a;
10
- --text-secondary: #757571;
11
- --text-muted: #8e8e8a;
12
- --border-color: #e3e3de;
13
- --link-color: #3b6ec4;
14
- --code-bg: rgba(0, 0, 0, 0.05);
15
- --code-block-bg: #f2f2ee;
16
- --blockquote-border: #1a1a1a;
17
- --table-header-bg: #f2f2ee;
18
- --selection-bg: rgba(59, 110, 196, 0.15);
19
- --highlight-bg: #fff3a3;
20
- }
21
-
22
- #editor .cm-content {
23
- font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', Menlo, Consolas, 'PingFang SC', 'Noto Sans SC', monospace;
24
- font-size: 15px;
25
- line-height: 1.8;
26
- }
27
-
28
- #editor .cm-content .cm-md-atxheading1,
29
- #editor .cm-content .cm-md-atxheading2,
30
- #editor .cm-content .cm-md-atxheading3 {
31
- font-weight: 700;
32
- border-bottom: none;
33
- padding-bottom: 0;
34
- }
35
-
36
- #editor .cm-content .cm-md-blockquote {
37
- border-left-width: 3px;
38
- font-style: normal;
39
- }
40
-
41
- #editor .cm-content .cm-md-table-widget th,
42
- #editor .cm-content .cm-md-table-widget td {
43
- font-size: 0.9em;
44
- }
1
+ /* ===== ColaMD Theme: 作家 Writer =====
2
+ iA Writer homage: monospace body, zero decoration.
3
+
4
+ 契约:ColaMD 2.8(与 ColaMD-themes / DSH 插件同一套令牌)。
5
+ 变量写在 :root;编辑器元素规则针对 #editor .cm-content + .cm-md-*。
6
+ 基础版式(行高、字距、列宽、标题度量)由 WebView 的 DSH 对齐层
7
+ 按 BASE_CSS 令牌兜底,这里只保留主题个性。 */
8
+
9
+ /* ── 0. Webfont 镜像:主题栈引用的 Google Fonts(latin 子集,OFL)。
10
+ 与 ColaMD-themes 2.8 契约一致:编辑器与 DSH 插件两侧同字体;
11
+ 离线/断网自动回落主题字体栈;CJK 由系统字体承担,不镜像。 */
12
+ @font-face {
13
+ font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
14
+ src: url("https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbV2o-flEEny0FZhsfKu5WU4xD7OwE.woff2") format("woff2");
15
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
16
+ }
17
+ @font-face {
18
+ font-family: "Fira Code"; font-style: normal; font-weight: 100 900; font-display: swap;
19
+ src: url("https://fonts.gstatic.com/s/firacode/v27/uU9NCBsR6Z2vfE9aq3bh3dSD.woff2") format("woff2");
20
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
21
+ }
22
+
23
+ :root {
24
+ /* ── 1.1 Seed Palette ── */
25
+ --seed-accent: #3b6ec4;
26
+ --seed-accent-light: color-mix(in srgb, #3b6ec4 15%, transparent);
27
+ --seed-accent-dark: color-mix(in srgb, #3b6ec4 85%, #000);
28
+ --seed-surface: #fcfcfa;
29
+ --seed-panel: #f2f2ee;
30
+ --seed-panel-alt: #f2f2ee;
31
+ --seed-ink: #1a1a1a;
32
+ --seed-ink-muted: #757571;
33
+ --seed-ink-dim: #8e8e8a;
34
+ --seed-border: #e9e9e5;
35
+ --seed-border-strong: #3b6ec4;
36
+
37
+ /* ── 1.2 Semantic Colors(活变量) ── */
38
+ --bg-color: #fcfcfa;
39
+ --text-color: #1a1a1a;
40
+ --text-secondary: #757571;
41
+ --text-muted: #8e8e8a;
42
+ --border-color: #e9e9e5;
43
+ --link-color: #3b6ec4;
44
+ --code-bg: rgba(0, 0, 0, 0.05);
45
+ --code-block-bg: #f2f2ee;
46
+ --blockquote-border: #1a1a1a;
47
+ --table-header-bg: #f2f2ee;
48
+ --selection-bg: rgba(59, 110, 196, 0.15);
49
+ --highlight-bg: #fff3a3;
50
+
51
+ /* ── 1.3 Typography & Metrics(活变量,与 DSH 插件 BASE_CSS 同一消费方) ── */
52
+ --font-body: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, "PingFang SC", "Noto Sans SC", monospace;
53
+ --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
54
+ --editor-font-size: 15px;
55
+ --editor-column-width: 820px;
56
+ --page-bg: #fcfcfa;
57
+ --seed-emphasis: #2f2f2c;
58
+ }
59
+
60
+ /* ═══════════════════════════════════════════════════════════
61
+ SECTION 2 — 编辑器 DOM(#editor .cm-content + .cm-md-*)
62
+ ═══════════════════════════════════════════════════════════ */
63
+
64
+ /* ── 2.0 正文:主题字体个性 ── */
65
+ #editor .cm-content {
66
+ font-family: var(--font-body);
67
+ line-height: 1.8;
68
+ font-size: var(--editor-font-size);
69
+ }
70
+
71
+ #editor .cm-content .cm-md-inlinecode {
72
+ color: #3b6ec4;
73
+ }
74
+
75
+ #editor .cm-content .cm-md-table-widget th,
76
+ #editor .cm-content .cm-md-table-widget td {
77
+ font-size: 0.9em;
78
+ }
79
+
80
+ /* ═══════════════════════════════════════════════════════════
81
+ SECTION 3 — 导出 HTML(.colamd-document,只补配色与字体)
82
+ 结构(页边距、标题层级、列表缩进)由导出外壳提供。
83
+ ═══════════════════════════════════════════════════════════ */
84
+
85
+ .colamd-document {
86
+ font-family: var(--font-body);
87
+ font-size: var(--editor-font-size);
88
+ line-height: 1.8;
89
+ background: var(--bg-color);
90
+ color: var(--text-color);
91
+ }
92
+ .colamd-document strong {
93
+ color: var(--seed-emphasis);
94
+ }
95
+ .colamd-document code {
96
+ background: var(--code-bg);
97
+ color: #3b6ec4;
98
+ font-family: var(--font-mono);
99
+ }