@vscode/markdown-editor 0.0.2-2 → 0.0.2-21
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/dist/_observables/observableInternal/index.d.ts +1 -1
- package/dist/_observables/observableInternal/logging/consoleObservableLogger.d.ts +1 -1
- package/dist/_observables/observableInternal/logging/debugger/devToolsLogger.d.ts +1 -1
- package/dist/_observables/observableInternal/logging/logging.d.ts +1 -1
- package/dist/_observables/observableInternal/reactions/{autorun.d.ts → createEffect.d.ts} +11 -3
- package/dist/index.d.ts +1000 -52
- package/dist/index.js +4005 -2074
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.css +1 -0
- package/dist/observables.js +79 -101
- package/dist/observables.js.map +1 -1
- package/dist/{runOnChange-owE1SMC0.js → runOnChange-CkxK2gSn.js} +191 -163
- package/dist/runOnChange-CkxK2gSn.js.map +1 -0
- package/dist/stringEdit-DzLs4E1d.js +177 -0
- package/dist/stringEdit-DzLs4E1d.js.map +1 -0
- package/dist/web-editors.d.ts +125 -0
- package/dist/web-editors.js +5185 -0
- package/dist/web-editors.js.map +1 -0
- package/package.json +36 -9
- package/src/contrib/comments/commentInput.css +150 -0
- package/src/contrib/comments/comments.css +129 -0
- package/src/contrib/commentsVscode/vscodeCommentWidgetV2.css +166 -0
- package/src/view/editor.css +526 -32
- package/src/view/themes/default.css +11 -3
- package/src/view/themes/github.css +12 -9
- package/src/view/themes/vscode-default.css +347 -0
- package/src/view/themes/vscode-github.css +349 -0
- package/dist/runOnChange-owE1SMC0.js.map +0 -1
- /package/dist/_observables/observableInternal/reactions/{autorunImpl.d.ts → createEffectImpl.d.ts} +0 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* VS Code markdown theme — GitHub layout variant (`md-theme-vscode-github`).
|
|
3
|
+
*
|
|
4
|
+
* One of two `--vscode-*`-variable-driven themes. This variant keeps the
|
|
5
|
+
* GitHub-style layout/typography (larger 16px base, 1.5 line-height, badge-
|
|
6
|
+
* style inline code, zebra tables); the sibling `vscode-default.css`
|
|
7
|
+
* (`md-theme-vscode-default`) mirrors VS Code's own markdown *preview*
|
|
8
|
+
* (`markdown-language-features/media/markdown.css`: 14px base, code blocks with
|
|
9
|
+
* a 1px border, 5px blockquote rule). Both consume the same `--vscode-*`
|
|
10
|
+
* variables and `--md-tok-*` token palette, so only layout/typography differs.
|
|
11
|
+
*
|
|
12
|
+
* A *variable-driven* theme: every color is expressed as `var(--vscode-*, …)`
|
|
13
|
+
* so the editor adopts whatever VS Code color theme is active (dark, light,
|
|
14
|
+
* high-contrast, or any custom theme) WITHOUT the editor knowing anything
|
|
15
|
+
* about VS Code. The editor only references variable NAMES — a documented
|
|
16
|
+
* contract — and bundles no VS Code CSS.
|
|
17
|
+
*
|
|
18
|
+
* Apply it via the editor `classNames` option:
|
|
19
|
+
*
|
|
20
|
+
* new EditorView(model, { classNames: ['md-theme-vscode-github'] });
|
|
21
|
+
*
|
|
22
|
+
* In a real webview VS Code injects the `--vscode-*` custom properties onto
|
|
23
|
+
* the document root and sets a body theme class, so this theme just works. In
|
|
24
|
+
* the Component Explorer the same variables are supplied by a snapshot
|
|
25
|
+
* stylesheet scoped under a `.vscode-theme.<id>` wrapper (see
|
|
26
|
+
* `fixture/vscodeThemes`). Either way the cascade reaches this theme's rules.
|
|
27
|
+
*
|
|
28
|
+
* Fallbacks: each `var()` carries a light-palette fallback so the theme stays
|
|
29
|
+
* legible even with no `--vscode-*` variables present at all.
|
|
30
|
+
*
|
|
31
|
+
* Layout/typography mirrors the GitHub theme (the basis of the production VS
|
|
32
|
+
* Code markdown editor); only the colors are swapped for variables. Every
|
|
33
|
+
* selector is scoped under the theme class, so importing this file never
|
|
34
|
+
* affects the global page or any editor that did not opt in.
|
|
35
|
+
*
|
|
36
|
+
* Syntax-token colors are exposed as `--md-tok-*` custom properties (with
|
|
37
|
+
* light-palette fallbacks). Real VS Code derives token colors from the live
|
|
38
|
+
* tokenizer's color map (baked in per token), NOT from `--vscode-*`; the
|
|
39
|
+
* Component Explorer supplies a matching `--md-tok-*` palette per color theme.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
.md-editor.md-theme-vscode-github {
|
|
43
|
+
font-family: var(--markdown-font-family, -apple-system, BlinkMacSystemFont,
|
|
44
|
+
'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif);
|
|
45
|
+
font-size: var(--markdown-font-size, 16px);
|
|
46
|
+
line-height: var(--markdown-line-height, 1.5);
|
|
47
|
+
color: var(--vscode-editor-foreground, #1f2328);
|
|
48
|
+
word-wrap: break-word;
|
|
49
|
+
/*
|
|
50
|
+
* Active-block highlight (defined theme-agnostically in editor.css) follows
|
|
51
|
+
* the VS Code surface color so it stays a subtle inset on both light and
|
|
52
|
+
* dark color themes instead of a fixed light-grey box.
|
|
53
|
+
*/
|
|
54
|
+
--md-block-active-background: var(--vscode-editorWidget-background, #f8f8f8);
|
|
55
|
+
/*
|
|
56
|
+
* Cursor color: editor.css paints `.md-cursor` with `--md-cursor-background`
|
|
57
|
+
* (theme-agnostic, black fallback); map it to the VS Code cursor color so it
|
|
58
|
+
* stays visible on dark color themes.
|
|
59
|
+
*/
|
|
60
|
+
--md-cursor-background: var(--vscode-editorCursor-foreground, #000);
|
|
61
|
+
--md-readonly-accent: var(--vscode-button-background, rgb(45, 92, 180));
|
|
62
|
+
--md-readonly-accent-foreground: var(--vscode-button-foreground, #fff);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.md-theme-vscode-github .md-heading {
|
|
66
|
+
margin-top: 24px;
|
|
67
|
+
margin-bottom: 16px;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
line-height: 1.25;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.md-theme-vscode-github h1.md-heading {
|
|
73
|
+
font-size: 2em;
|
|
74
|
+
padding-bottom: 0.3em;
|
|
75
|
+
border-bottom: 1px solid var(--vscode-textSeparator-foreground, #d1d9e0b3);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.md-theme-vscode-github h2.md-heading {
|
|
79
|
+
font-size: 1.5em;
|
|
80
|
+
padding-bottom: 0.3em;
|
|
81
|
+
border-bottom: 1px solid var(--vscode-textSeparator-foreground, #d1d9e0b3);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.md-theme-vscode-github h3.md-heading {
|
|
85
|
+
font-size: 1.25em;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.md-theme-vscode-github h4.md-heading {
|
|
89
|
+
font-size: 1em;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.md-theme-vscode-github h5.md-heading {
|
|
93
|
+
font-size: 0.875em;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.md-theme-vscode-github h6.md-heading {
|
|
97
|
+
font-size: 0.85em;
|
|
98
|
+
color: var(--vscode-descriptionForeground, #59636e);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.md-theme-vscode-github .md-paragraph {
|
|
102
|
+
margin-top: 0;
|
|
103
|
+
margin-bottom: 16px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.md-theme-vscode-github .md-blockquote {
|
|
107
|
+
margin: 0 0 16px 0;
|
|
108
|
+
padding: 0 1em;
|
|
109
|
+
/*
|
|
110
|
+
* The left padding the `>` gutter hangs in (matches padding-left: 1em at
|
|
111
|
+
* the base font). Must be an absolute length, not `1em`: the marker
|
|
112
|
+
* positions itself with this var inside its own (smaller, 0.85em) font
|
|
113
|
+
* context, so an `em` value would resolve against the marker's font-size
|
|
114
|
+
* and pull the `>` out of alignment with the text.
|
|
115
|
+
*/
|
|
116
|
+
--md-blockquote-pad: 16px;
|
|
117
|
+
color: var(--vscode-descriptionForeground, #59636e);
|
|
118
|
+
border-left: 0.25em solid var(--vscode-textBlockQuote-border, #d1d9e0);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.md-theme-vscode-github .md-list {
|
|
122
|
+
margin-top: 0;
|
|
123
|
+
margin-bottom: 16px;
|
|
124
|
+
padding-left: 2em;
|
|
125
|
+
/* The per-level indentation step the list gutter fills (matches padding-left). */
|
|
126
|
+
--md-list-indent-step: 2em;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.md-theme-vscode-github .md-thematic-break {
|
|
130
|
+
height: 0.25em;
|
|
131
|
+
padding: 0;
|
|
132
|
+
margin: 24px 0;
|
|
133
|
+
background-color: var(--vscode-textSeparator-foreground, #d1d9e0);
|
|
134
|
+
border: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.md-theme-vscode-github a {
|
|
138
|
+
color: var(--vscode-textLink-foreground, #0969da);
|
|
139
|
+
text-decoration: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.md-theme-vscode-github a:hover {
|
|
143
|
+
text-decoration: underline;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.md-theme-vscode-github strong {
|
|
147
|
+
font-weight: 600;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Inline code. */
|
|
151
|
+
.md-theme-vscode-github :not(pre)>code {
|
|
152
|
+
font-family: var(--vscode-editor-font-family, ui-monospace, SFMono-Regular,
|
|
153
|
+
'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace);
|
|
154
|
+
font-size: 85%;
|
|
155
|
+
padding: 0.2em 0.4em;
|
|
156
|
+
margin: 0;
|
|
157
|
+
color: var(--vscode-textPreformat-foreground, inherit);
|
|
158
|
+
background-color: var(--vscode-textPreformat-background, #818b981f);
|
|
159
|
+
border-radius: 6px;
|
|
160
|
+
white-space: break-spaces;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Fenced code block. */
|
|
164
|
+
.md-theme-vscode-github .md-code-block {
|
|
165
|
+
margin-top: 0;
|
|
166
|
+
margin-bottom: 16px;
|
|
167
|
+
padding: 10px 16px;
|
|
168
|
+
font-size: 85%;
|
|
169
|
+
line-height: 1.45;
|
|
170
|
+
background-color: var(--vscode-textCodeBlock-background, #f6f8fa);
|
|
171
|
+
border-radius: 6px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.md-theme-vscode-github .md-code-block code {
|
|
175
|
+
font-family: var(--vscode-editor-font-family, ui-monospace, SFMono-Regular,
|
|
176
|
+
'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace);
|
|
177
|
+
padding: 0;
|
|
178
|
+
background-color: transparent;
|
|
179
|
+
border-radius: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/*
|
|
183
|
+
* Syntax-highlight token colors. Driven by `--md-tok-*` custom properties so
|
|
184
|
+
* the explorer (or any embedder) can supply a palette matched to the active
|
|
185
|
+
* color theme. Fallbacks are the VS Code light theme palette.
|
|
186
|
+
*/
|
|
187
|
+
.md-theme-vscode-github .md-code-block .tok-keyword {
|
|
188
|
+
color: var(--md-tok-keyword, #0000ff);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.md-theme-vscode-github .md-code-block .tok-string {
|
|
192
|
+
color: var(--md-tok-string, #a31515);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.md-theme-vscode-github .md-code-block .tok-comment {
|
|
196
|
+
color: var(--md-tok-comment, #008000);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.md-theme-vscode-github .md-code-block .tok-number {
|
|
200
|
+
color: var(--md-tok-number, #098658);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.md-theme-vscode-github .md-code-block .tok-regexp {
|
|
204
|
+
color: var(--md-tok-regexp, #811f3f);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.md-theme-vscode-github .md-code-block .tok-type {
|
|
208
|
+
color: var(--md-tok-type, #267f99);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.md-theme-vscode-github .md-code-block .tok-annotation {
|
|
212
|
+
color: var(--md-tok-annotation, #267f99);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.md-theme-vscode-github .md-code-block .tok-tag {
|
|
216
|
+
color: var(--md-tok-tag, #800000);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.md-theme-vscode-github .md-code-block .tok-attribute {
|
|
220
|
+
color: var(--md-tok-attribute, #e50000);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.md-theme-vscode-github .md-code-block .tok-delimiter {
|
|
224
|
+
color: var(--md-tok-delimiter, inherit);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/*
|
|
228
|
+
* Display math has no container styling (KaTeX renders it inline-centered).
|
|
229
|
+
* Keep only the block spacing; horizontal scroll comes from the base sheet.
|
|
230
|
+
*/
|
|
231
|
+
.md-theme-vscode-github .md-math-block {
|
|
232
|
+
margin-top: 0;
|
|
233
|
+
margin-bottom: 16px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/*
|
|
237
|
+
* KaTeX renders inline math at 1.21em with its own (larger) line-height, which
|
|
238
|
+
* would inflate the surrounding line box. Collapse it so the rendered math fits
|
|
239
|
+
* the text line and the paragraph height stays identical active vs inactive.
|
|
240
|
+
*/
|
|
241
|
+
.md-theme-vscode-github .md-inline-math .katex {
|
|
242
|
+
line-height: 1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.md-theme-vscode-github .md-table-wrapper {
|
|
246
|
+
/* Block spacing lives on the wrapper (the scroll/BFC box) so it collapses
|
|
247
|
+
with siblings as before; the inner table has no margin of its own. */
|
|
248
|
+
margin-top: 0;
|
|
249
|
+
margin-bottom: 16px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.md-theme-vscode-github .md-table {
|
|
253
|
+
border-collapse: collapse;
|
|
254
|
+
width: auto;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.md-theme-vscode-github .md-table th,
|
|
258
|
+
.md-theme-vscode-github .md-table td {
|
|
259
|
+
padding: 6px 13px;
|
|
260
|
+
border: 1px solid var(--vscode-editorWidget-border, #d1d9e0);
|
|
261
|
+
text-align: left;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/*
|
|
265
|
+
* The editor renders every cell as <td> in a flat <table> of <tr> (no
|
|
266
|
+
* <thead>/<tbody>/<th>). Row order is: header, delimiter row, body rows.
|
|
267
|
+
*/
|
|
268
|
+
.md-theme-vscode-github .md-table tr:first-child td {
|
|
269
|
+
font-weight: 600;
|
|
270
|
+
padding-top: 11px;
|
|
271
|
+
padding-bottom: 11px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* Active: reclaim the header's extra spacing to host the delimiter row. */
|
|
275
|
+
.md-theme-vscode-github .md-table.md-block-active tr:first-child td {
|
|
276
|
+
padding-top: 3px;
|
|
277
|
+
padding-bottom: 3px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.md-theme-vscode-github .md-table tr:nth-child(even):not(.md-table-delimiter-row) {
|
|
281
|
+
background-color: var(--vscode-textCodeBlock-background, #f6f8fa);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/*
|
|
285
|
+
* The delimiter row (`| --- | --- |`) is editor source shown only while
|
|
286
|
+
* editing; render it borderless with no vertical padding so it occupies just
|
|
287
|
+
* the compact 10px reclaimed from the header.
|
|
288
|
+
*/
|
|
289
|
+
.md-theme-vscode-github .md-table-delimiter-row td {
|
|
290
|
+
border: 0;
|
|
291
|
+
padding: 0 13px;
|
|
292
|
+
background: transparent;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/*
|
|
296
|
+
* Active table: the source `|` pipes ARE the outline. Drop the HTML cell
|
|
297
|
+
* borders (kept as transparent so the 1px box geometry — and thus the table's
|
|
298
|
+
* height and first-text X — is unchanged) and clear the zebra fill so the
|
|
299
|
+
* table reads as plain source.
|
|
300
|
+
*/
|
|
301
|
+
.md-theme-vscode-github .md-table.md-block-active td {
|
|
302
|
+
border-color: transparent;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.md-theme-vscode-github .md-table.md-block-active tr:nth-child(even):not(.md-table-delimiter-row) td {
|
|
306
|
+
background-color: transparent;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/*
|
|
310
|
+
* Shift each cell's leading pipe onto its left gridline (where the border was)
|
|
311
|
+
* and the last cell's closing pipe onto the right gridline. `position:
|
|
312
|
+
* relative` moves only the painted glyph by the cell's horizontal padding;
|
|
313
|
+
* siblings and the glue's reserved width are untouched, so active/inactive
|
|
314
|
+
* height and first-text X stay pixel-identical.
|
|
315
|
+
*/
|
|
316
|
+
.md-theme-vscode-github .md-table.md-block-active td>.md-glue-tableCellGlue:first-child,
|
|
317
|
+
.md-theme-vscode-github .md-table.md-block-active .md-table-delimiter-row td>.md-marker-tableDelimiter {
|
|
318
|
+
position: relative;
|
|
319
|
+
left: -13px;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/*
|
|
323
|
+
* The last cell's closing `|` floats right after the (left-aligned) cell text.
|
|
324
|
+
* Pin it to the column's right gridline (the cell's border edge, 13px past the
|
|
325
|
+
* content box) so the right outline is a straight line. `top: auto` keeps the
|
|
326
|
+
* pipe on the content line (the shared editor.css rule takes it out of flow);
|
|
327
|
+
* the previous `top: 0` floated it to the cell's top edge, so on tall/wrapping
|
|
328
|
+
* rows it no longer lined up with the in-flow leading pipes.
|
|
329
|
+
*/
|
|
330
|
+
.md-theme-vscode-github .md-table.md-block-active td:last-child {
|
|
331
|
+
position: relative;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.md-theme-vscode-github .md-table.md-block-active td:last-child>.md-glue-tableCellGlue:last-child {
|
|
335
|
+
position: absolute;
|
|
336
|
+
right: 0;
|
|
337
|
+
top: auto;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/*
|
|
341
|
+
* The delimiter row's last cell carries its closing `|` as a separate
|
|
342
|
+
* `tableDelimiterClose` marker; pin it to the same right gridline as the body
|
|
343
|
+
* rows' closing pipe so the last column's outline stays straight.
|
|
344
|
+
*/
|
|
345
|
+
.md-theme-vscode-github .md-table.md-block-active .md-table-delimiter-row td:last-child>.md-marker-tableDelimiterClose {
|
|
346
|
+
position: absolute;
|
|
347
|
+
right: 0;
|
|
348
|
+
top: auto;
|
|
349
|
+
}
|