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.
- package/.vscode/settings.json +1 -1
- package/CHANGELOG.md +30 -0
- package/README.md +311 -279
- package/README_CN.md +311 -279
- package/RELEASE_NOTES.md +56 -0
- package/esbuild.js +2 -0
- package/package.json +58 -19
- package/package.nls.json +14 -0
- package/package.nls.zh-cn.json +14 -0
- package/src/commands/commands.ts +48 -0
- package/src/docx/docx-builder.ts +241 -0
- package/src/export/docx-exporter.ts +961 -961
- package/src/export/html-exporter.ts +8 -2
- package/src/export/pdf-exporter.ts +65 -0
- package/src/export/pptx-exporter.ts +63 -0
- package/src/export/render-export-images.ts +386 -372
- package/src/export/theme-style.ts +195 -155
- package/src/pptx/pptx-builder.ts +249 -0
- package/src/pptx/zip.ts +158 -0
- package/src/present/presenter.ts +64 -0
- package/src/preview/preview-manager.ts +783 -541
- package/src/preview/webview/app.ts +588 -366
- package/src/preview/webview/index.html +167 -134
- package/src/slides/deck.ts +397 -0
- package/src/slides/markdown.ts +393 -0
- package/src/slides/render.ts +484 -0
- package/src/slides/slides.css +1082 -0
- package/src/themes/built-in/bear.css +89 -38
- package/src/themes/built-in/dark.css +87 -20
- package/src/themes/built-in/dracula.css +93 -38
- package/src/themes/built-in/elegant.css +109 -52
- package/src/themes/built-in/gruvbox.css +97 -42
- package/src/themes/built-in/light.css +80 -20
- package/src/themes/built-in/midnight.css +93 -31
- package/src/themes/built-in/nord.css +93 -38
- package/src/themes/built-in/notion.css +98 -48
- package/src/themes/built-in/sepia.css +99 -47
- package/src/themes/built-in/solarized-dark.css +94 -35
- package/src/themes/built-in/writer.css +99 -44
- package/src/themes/theme-manager.ts +207 -180
- package/src/types/colamd-renderer.d.ts +47 -47
- package/patches/@bytechain.cn+colamd+2.7.11.patch +0 -22
|
@@ -1,134 +1,167 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline' vscode-webview-resource:; script-src 'unsafe-inline' vscode-webview-resource:; font-src vscode-webview-resource: data:; img-src file: data: vscode-webview-resource: https:; connect-src https: vscode-webview-resource:;">
|
|
7
|
-
<link rel="stylesheet" href="colamd.css" id="colamd-css">
|
|
8
|
-
<!-- 变量名对齐 ColaMD 2.7.9 主题契约: --bg-color / --text-color / --border-color 等 -->
|
|
9
|
-
<style>
|
|
10
|
-
html, body {
|
|
11
|
-
height: 100%;
|
|
12
|
-
margin: 0;
|
|
13
|
-
padding: 0;
|
|
14
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
15
|
-
background: var(--bg-color, #fff) !important;
|
|
16
|
-
color: var(--text-color, #24292f) !important;
|
|
17
|
-
}
|
|
18
|
-
/* CodeMirror 6
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
#editor .cm-
|
|
39
|
-
#editor .cm-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
position:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
background: var(--
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
position: absolute;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
padding:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline' https://fonts.googleapis.com vscode-webview-resource:; script-src 'unsafe-inline' vscode-webview-resource:; font-src https://fonts.gstatic.com vscode-webview-resource: data:; img-src file: data: vscode-webview-resource: https:; connect-src https: vscode-webview-resource:;">
|
|
7
|
+
<link rel="stylesheet" href="colamd.css" id="colamd-css">
|
|
8
|
+
<!-- 变量名对齐 ColaMD 2.7.9 主题契约: --bg-color / --text-color / --border-color 等 -->
|
|
9
|
+
<style>
|
|
10
|
+
html, body {
|
|
11
|
+
height: 100%;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
15
|
+
background: var(--bg-color, #fff) !important;
|
|
16
|
+
color: var(--text-color, #24292f) !important;
|
|
17
|
+
}
|
|
18
|
+
/* CodeMirror 6 编辑器容器。列宽与内边距不在这里写死 —— 由 DSH 对齐层
|
|
19
|
+
按 --editor-column-width 等令牌下发(对齐 ColaMD-themes / DSH 插件)。 */
|
|
20
|
+
#editor {
|
|
21
|
+
min-height: 100vh;
|
|
22
|
+
}
|
|
23
|
+
/* CodeMirror 焦点轮廓去除 */
|
|
24
|
+
#editor.cm-editor.cm-focused {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
#editor .cm-content {
|
|
28
|
+
min-height: calc(100vh - 60px);
|
|
29
|
+
cursor: default;
|
|
30
|
+
}
|
|
31
|
+
#editor .cm-editor.cm-focused > .cm-scroller > .cm-content,
|
|
32
|
+
#editor .cm-editor.cm-focused > .cm-scroller > .cm-gutters {
|
|
33
|
+
cursor: default;
|
|
34
|
+
}
|
|
35
|
+
/* 隐藏光标和选区高亮(只读预览) */
|
|
36
|
+
#editor .cm-cursor,
|
|
37
|
+
#editor .cm-selectionBackground,
|
|
38
|
+
#editor.cm-focused .cm-selectionBackground,
|
|
39
|
+
#editor .cm-content ::selection {
|
|
40
|
+
opacity: 0 !important;
|
|
41
|
+
}
|
|
42
|
+
/* CodeMirror 6 默认不换行,Markdown 预览必须换行 */
|
|
43
|
+
#editor .cm-content {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
word-wrap: break-word;
|
|
46
|
+
}
|
|
47
|
+
/* 滚动容器 */
|
|
48
|
+
#editor .cm-scroller {
|
|
49
|
+
overflow: auto;
|
|
50
|
+
}
|
|
51
|
+
/* ── 幻灯片模式:文档编辑器让位给幻灯片舞台 ── */
|
|
52
|
+
#slides-host {
|
|
53
|
+
display: none;
|
|
54
|
+
padding: 24px 0 40px;
|
|
55
|
+
}
|
|
56
|
+
body.slides-mode #editor { display: none !important; }
|
|
57
|
+
body.slides-mode #slides-host { display: block; }
|
|
58
|
+
body.slides-mode { overflow-y: auto; }
|
|
59
|
+
/* mermaid 图画在页面底色上(与 ColaMD-extend 一致):围栏是整块替换,
|
|
60
|
+
没有代码块底,图表配色按页面底色/正文色推导。引擎的
|
|
61
|
+
`.cm-content .cm-md-mermaid` 以代码块配色推导 --pele-*,这里用
|
|
62
|
+
#editor 提高特异性覆盖。background 铺页面色是为了盖住 2.7.x 引擎
|
|
63
|
+
可能残留的代码块行底色。 */
|
|
64
|
+
#editor .cm-md-mermaid {
|
|
65
|
+
background: var(--bg-color);
|
|
66
|
+
border-radius: 0;
|
|
67
|
+
padding: 0.8em 0;
|
|
68
|
+
--pele-bg: var(--bg-color);
|
|
69
|
+
--pele-fg: var(--text-color);
|
|
70
|
+
--pele-muted: color-mix(in srgb, var(--text-color) 70%, var(--bg-color));
|
|
71
|
+
--pele-line: var(--text-color);
|
|
72
|
+
--pele-surface: color-mix(in srgb, var(--text-color) 18%, var(--bg-color));
|
|
73
|
+
--pele-surface-alt: color-mix(in srgb, var(--text-color) 28%, var(--bg-color));
|
|
74
|
+
--pele-border: color-mix(in srgb, var(--text-color) 45%, var(--bg-color));
|
|
75
|
+
--pele-accent: var(--link-color);
|
|
76
|
+
--pele-radius: 6px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ── Context Menu ── */
|
|
80
|
+
.ctx-menu {
|
|
81
|
+
position: fixed;
|
|
82
|
+
z-index: 9999;
|
|
83
|
+
min-width: 180px;
|
|
84
|
+
background: var(--bg-color, #fff);
|
|
85
|
+
color: var(--text-color, #24292f);
|
|
86
|
+
border: 1px solid var(--border-color, #d0d7de);
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.12);
|
|
89
|
+
padding: 4px 0;
|
|
90
|
+
font-size: 13px;
|
|
91
|
+
line-height: 1.5;
|
|
92
|
+
user-select: none;
|
|
93
|
+
}
|
|
94
|
+
.ctx-menu-item {
|
|
95
|
+
position: relative;
|
|
96
|
+
padding: 6px 16px;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
}
|
|
100
|
+
.ctx-menu-item:hover {
|
|
101
|
+
background: var(--code-bg, rgba(0,0,0,0.06));
|
|
102
|
+
color: var(--link-color, #0969da);
|
|
103
|
+
}
|
|
104
|
+
.ctx-menu-disabled {
|
|
105
|
+
color: var(--text-muted, #8b949e);
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
}
|
|
108
|
+
.ctx-menu-active {
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
}
|
|
111
|
+
.ctx-menu-active::before {
|
|
112
|
+
content: '✓';
|
|
113
|
+
position: absolute;
|
|
114
|
+
left: 4px;
|
|
115
|
+
}
|
|
116
|
+
.ctx-menu-separator {
|
|
117
|
+
height: 1px;
|
|
118
|
+
margin: 4px 0;
|
|
119
|
+
background: var(--border-color, #d0d7de);
|
|
120
|
+
}
|
|
121
|
+
.ctx-menu-has-submenu {
|
|
122
|
+
padding-right: 28px;
|
|
123
|
+
}
|
|
124
|
+
.ctx-menu-has-submenu::after {
|
|
125
|
+
content: '▸';
|
|
126
|
+
position: absolute;
|
|
127
|
+
right: 10px;
|
|
128
|
+
color: var(--text-muted, #8b949e);
|
|
129
|
+
}
|
|
130
|
+
.ctx-menu-submenu {
|
|
131
|
+
position: absolute;
|
|
132
|
+
top: -4px;
|
|
133
|
+
left: 100%;
|
|
134
|
+
min-width: 160px;
|
|
135
|
+
max-height: 70vh;
|
|
136
|
+
overflow-y: auto;
|
|
137
|
+
background: var(--bg-color, #fff);
|
|
138
|
+
color: var(--text-color, #24292f);
|
|
139
|
+
border: 1px solid var(--border-color, #d0d7de);
|
|
140
|
+
border-radius: 8px;
|
|
141
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.12);
|
|
142
|
+
padding: 4px 0;
|
|
143
|
+
display: none;
|
|
144
|
+
}
|
|
145
|
+
.ctx-menu-has-submenu:hover > .ctx-menu-submenu {
|
|
146
|
+
display: block;
|
|
147
|
+
}
|
|
148
|
+
.ctx-menu-group {
|
|
149
|
+
padding: 6px 16px 3px;
|
|
150
|
+
font-size: 11px;
|
|
151
|
+
letter-spacing: 0.04em;
|
|
152
|
+
color: var(--text-muted, #8b949e);
|
|
153
|
+
cursor: default;
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
}
|
|
156
|
+
.ctx-menu-group:not(:first-child) {
|
|
157
|
+
border-top: 1px solid var(--border-color, #d0d7de);
|
|
158
|
+
margin-top: 4px;
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
161
|
+
</head>
|
|
162
|
+
<body>
|
|
163
|
+
<div id="editor"></div>
|
|
164
|
+
<div id="slides-host"></div>
|
|
165
|
+
<script src="app.js"></script>
|
|
166
|
+
</body>
|
|
167
|
+
</html>
|