@vscode/markdown-editor 0.0.2-4 → 0.0.2-41

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