vscode-colaview 0.4.0 → 0.4.1

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.
@@ -1,99 +1,99 @@
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
- }
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
+ }
@@ -0,0 +1,21 @@
1
+ // pele/lazy 本地类型声明:pele 未随包发布可直接解析的子路径声明,
2
+ // 项目 tsconfig 的 moduleResolution 不认 exports 子路径(与 colamd-renderer.d.ts 同因)。
3
+ declare module 'pele/lazy' {
4
+ export interface RenderResult {
5
+ svg: string;
6
+ type: string;
7
+ [key: string]: unknown;
8
+ }
9
+ export interface RenderOptions {
10
+ measurer?: unknown;
11
+ fontFamily?: string;
12
+ fontFamilyMono?: string;
13
+ fontSize?: number;
14
+ idPrefix?: string;
15
+ responsive?: boolean;
16
+ maxWidth?: number;
17
+ [key: string]: unknown;
18
+ }
19
+ export function renderAsync(text: string, options?: RenderOptions): Promise<RenderResult>;
20
+ export function load(type: string | null): Promise<boolean>;
21
+ }