@vscode/markdown-editor 0.0.2-5 → 0.0.2-51

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 (36) hide show
  1. package/README.md +26 -0
  2. package/dist/_observables/observableInternal/index.d.ts +1 -1
  3. package/dist/_observables/observableInternal/logging/consoleObservableLogger.d.ts +1 -1
  4. package/dist/_observables/observableInternal/logging/debugger/devToolsLogger.d.ts +1 -1
  5. package/dist/_observables/observableInternal/logging/logging.d.ts +1 -1
  6. package/dist/_observables/observableInternal/reactions/{autorun.d.ts → createEffect.d.ts} +11 -3
  7. package/dist/config-BGeaJqWk.js +286 -0
  8. package/dist/config-BGeaJqWk.js.map +1 -0
  9. package/dist/config.d.ts +10 -0
  10. package/dist/config.js +6 -0
  11. package/dist/config.js.map +1 -0
  12. package/dist/index.d.ts +1456 -56
  13. package/dist/index.js +6067 -1924
  14. package/dist/index.js.map +1 -1
  15. package/dist/markdown-editor.css +1 -0
  16. package/dist/observables.js +45 -43
  17. package/dist/observables.js.map +1 -1
  18. package/dist/{runOnChange-C00UIwqQ.js → runOnChange-e7FtCqOQ.js} +115 -111
  19. package/dist/runOnChange-e7FtCqOQ.js.map +1 -0
  20. package/dist/stringEdit-CVDbCUBY.js +215 -0
  21. package/dist/stringEdit-CVDbCUBY.js.map +1 -0
  22. package/dist/web-editors.d.ts +130 -0
  23. package/dist/web-editors.js +6185 -0
  24. package/dist/web-editors.js.map +1 -0
  25. package/package.json +48 -9
  26. package/src/contrib/comments/commentInput.css +150 -0
  27. package/src/contrib/comments/comments.css +129 -0
  28. package/src/contrib/commentsVscode/vscodeCommentWidgetV2.css +171 -0
  29. package/src/contrib/find/find.css +347 -0
  30. package/src/view/editor.css +522 -23
  31. package/src/view/themes/default.css +12 -3
  32. package/src/view/themes/github.css +13 -8
  33. package/src/view/themes/vscode-default.css +398 -0
  34. package/src/view/themes/vscode-github.css +395 -0
  35. package/dist/runOnChange-C00UIwqQ.js.map +0 -1
  36. /package/dist/_observables/observableInternal/reactions/{autorunImpl.d.ts → createEffectImpl.d.ts} +0 -0
@@ -14,6 +14,7 @@
14
14
  */
15
15
 
16
16
  .md-editor.github-markdown-theme {
17
+ color-scheme: light;
17
18
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans',
18
19
  Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
19
20
  font-size: 16px;
@@ -99,10 +100,6 @@
99
100
  text-decoration: none;
100
101
  }
101
102
 
102
- .github-markdown-theme a:hover {
103
- text-decoration: underline;
104
- }
105
-
106
103
  /* GitHub uses a 600 weight for bold, not the browser default 700. */
107
104
  .github-markdown-theme strong {
108
105
  font-weight: 600;
@@ -201,10 +198,15 @@
201
198
  line-height: 1;
202
199
  }
203
200
 
204
- .github-markdown-theme .md-table {
205
- border-collapse: collapse;
201
+ .github-markdown-theme .md-table-wrapper {
202
+ /* Block spacing lives on the wrapper (the scroll/BFC box) so it collapses
203
+ with siblings as before; the inner table has no margin of its own. */
206
204
  margin-top: 0;
207
205
  margin-bottom: 16px;
206
+ }
207
+
208
+ .github-markdown-theme .md-table {
209
+ border-collapse: collapse;
208
210
  width: auto;
209
211
  }
210
212
 
@@ -284,6 +286,9 @@
284
286
  * box) so the right outline is a straight line. Absolute removes it from flow,
285
287
  * but it is the trailing node so no text shifts; the leading pipe still fixes
286
288
  * first-text X and the row stays one line tall, keeping the compare invariants.
289
+ * `top: auto` keeps the pipe on the content line (the shared editor.css rule
290
+ * also takes trailing glue out of flow); the previous `top: 0` floated it to
291
+ * the cell's top edge, misaligning it with the leading pipes on wrapping rows.
287
292
  */
288
293
  .github-markdown-theme .md-table.md-block-active td:last-child {
289
294
  position: relative;
@@ -292,7 +297,7 @@
292
297
  .github-markdown-theme .md-table.md-block-active td:last-child>.md-glue-tableCellGlue:last-child {
293
298
  position: absolute;
294
299
  right: 0;
295
- top: 0;
300
+ top: auto;
296
301
  }
297
302
 
298
303
  /*
@@ -303,5 +308,5 @@
303
308
  .github-markdown-theme .md-table.md-block-active .md-table-delimiter-row td:last-child>.md-marker-tableDelimiterClose {
304
309
  position: absolute;
305
310
  right: 0;
306
- top: 0;
311
+ top: auto;
307
312
  }
@@ -0,0 +1,398 @@
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-background: var(--vscode-button-secondaryBackground,
53
+ var(--vscode-editorWidget-background, #f3f3f3));
54
+ --md-readonly-background-hover: var(--vscode-button-secondaryHoverBackground,
55
+ var(--vscode-button-secondaryBackground,
56
+ var(--vscode-editorWidget-background, #e9e9e9)));
57
+ --md-readonly-foreground: var(--vscode-button-secondaryForeground,
58
+ var(--vscode-editorWidget-foreground, #444));
59
+ --md-readonly-border: var(--vscode-button-secondaryBorder,
60
+ var(--vscode-button-border,
61
+ var(--vscode-contrastBorder, var(--vscode-editorWidget-border, #b8b8b8))));
62
+ --md-readonly-border-hover: var(--vscode-button-secondaryBorder,
63
+ var(--vscode-button-border,
64
+ var(--vscode-contrastBorder, var(--vscode-editorWidget-border, #8d8d8d))));
65
+ --md-readonly-accent: var(--vscode-button-background, rgb(45, 92, 180));
66
+ --md-readonly-accent-foreground: var(--vscode-button-foreground, #fff);
67
+ --md-find-widget-background: var(--vscode-editorWidget-background, #f3f3f3);
68
+ --md-find-widget-foreground: var(--vscode-editorWidget-foreground, #222);
69
+ --md-find-widget-border: var(--vscode-editorWidget-border, #c8c8c8);
70
+ --md-find-widget-shadow: var(--vscode-widget-shadow, rgba(0, 0, 0, 0.2));
71
+ --md-find-input-background: var(--vscode-input-background, #fff);
72
+ --md-find-input-foreground: var(--vscode-input-foreground, #222);
73
+ --md-find-placeholder-foreground: var(--vscode-input-placeholderForeground, #767676);
74
+ --md-find-input-caret: var(--vscode-editorCursor-foreground, currentColor);
75
+ --md-find-input-border: var(--vscode-input-border, #cecece);
76
+ --md-find-count-foreground: var(--vscode-editorWidget-foreground, #222);
77
+ --md-find-focus-border: var(--vscode-focusBorder, #007fd4);
78
+ --md-find-button-hover-background: var(--vscode-inputOption-hoverBackground, rgba(128, 128, 128, 0.18));
79
+ --md-find-disabled-foreground: var(--vscode-disabledForeground, rgba(97, 97, 97, 0.5));
80
+ --md-find-editor-background: var(--vscode-editor-background, #ffffff);
81
+ --md-find-match-background: var(--vscode-editor-findMatchHighlightBackground, rgba(234, 92, 0, 0.33));
82
+ --md-find-current-background: var(--vscode-editor-findMatchBackground, #a8ac94);
83
+ --md-find-current-border: var(--vscode-editor-findMatchBorder,
84
+ color-mix(in srgb, var(--vscode-editorWidget-foreground, #616161) 55%,
85
+ var(--vscode-editor-findMatchBackground, #a8ac94)));
86
+ --md-find-option-background: var(--vscode-inputOption-activeBackground, #007acc);
87
+ --md-find-option-border: color-mix(in srgb,
88
+ var(--vscode-focusBorder, #007acc) 70%,
89
+ var(--vscode-inputOption-activeForeground, #000000));
90
+ --md-find-option-foreground: var(--vscode-inputOption-activeForeground, #fff);
91
+ --md-find-error-border: var(--vscode-inputValidation-errorBorder, #be1100);
92
+ --md-find-error-foreground: var(--vscode-errorForeground, #a1260d);
93
+ --md-separator-color: color-mix(in srgb,
94
+ var(--vscode-textSeparator-foreground, #d1d9e0) 60%, transparent);
95
+ --md-inline-code-background: color-mix(in srgb,
96
+ var(--vscode-textPreformat-background, #818b981f) 60%, transparent);
97
+ }
98
+
99
+ .vscode-high-contrast .md-editor.md-theme-vscode-default,
100
+ .vscode-high-contrast-light .md-editor.md-theme-vscode-default {
101
+ --md-separator-color: var(--vscode-textSeparator-foreground, currentColor);
102
+ --md-inline-code-background: var(--vscode-textPreformat-background, #818b981f);
103
+ }
104
+
105
+ .md-theme-vscode-default .md-heading {
106
+ margin-top: 24px;
107
+ margin-bottom: 16px;
108
+ font-weight: 600;
109
+ line-height: 1.25;
110
+ }
111
+
112
+ .md-theme-vscode-default h1.md-heading {
113
+ font-size: 1.75em;
114
+ padding-bottom: 0.3em;
115
+ border-bottom: 1px solid var(--md-separator-color);
116
+ }
117
+
118
+ .md-theme-vscode-default h2.md-heading {
119
+ font-size: 1.4em;
120
+ padding-bottom: 0.3em;
121
+ border-bottom: 1px solid var(--md-separator-color);
122
+ }
123
+
124
+ .md-theme-vscode-default h3.md-heading {
125
+ font-size: 1.2em;
126
+ }
127
+
128
+ .md-theme-vscode-default h4.md-heading {
129
+ font-size: 1em;
130
+ }
131
+
132
+ .md-theme-vscode-default h5.md-heading {
133
+ font-size: 0.875em;
134
+ }
135
+
136
+ .md-theme-vscode-default h6.md-heading {
137
+ font-size: 0.85em;
138
+ }
139
+
140
+ .md-theme-vscode-default .md-paragraph {
141
+ margin-top: 0;
142
+ margin-bottom: 16px;
143
+ }
144
+
145
+ /*
146
+ * Preview blockquotes keep the normal foreground color (no dimming) and use a
147
+ * thick 5px rule with the VS Code blockquote surface tint.
148
+ */
149
+ .md-theme-vscode-default .md-blockquote {
150
+ margin: 0 0 16px 0;
151
+ padding: 0 16px 0 10px;
152
+ /*
153
+ * The left padding the `>` gutter hangs in (matches padding-left: 10px).
154
+ * Must be an absolute length, not `em`: the marker positions itself with
155
+ * this var inside its own (smaller) font context, so an `em` value would
156
+ * resolve against the marker's font-size and pull the `>` out of alignment.
157
+ */
158
+ --md-blockquote-pad: 10px;
159
+ background-color: var(--vscode-textBlockQuote-background, transparent);
160
+ border-left: 5px solid var(--vscode-textBlockQuote-border, #d1d9e0);
161
+ border-radius: 2px;
162
+ }
163
+
164
+ .md-theme-vscode-default .md-list {
165
+ margin-top: 0;
166
+ margin-bottom: 16px;
167
+ padding-left: 2em;
168
+ /* The per-level indentation step the list gutter fills (matches padding-left). */
169
+ --md-list-indent-step: 2em;
170
+ }
171
+
172
+ /* Preview renders thematic breaks as a thin 1px rule rather than a thick bar. */
173
+ .md-theme-vscode-default .md-thematic-break {
174
+ height: 0;
175
+ padding: 0;
176
+ margin: 24px 0;
177
+ border: 0;
178
+ border-bottom: 1px solid var(--md-separator-color);
179
+ }
180
+
181
+ .md-theme-vscode-default a {
182
+ color: var(--vscode-textLink-foreground, #0969da);
183
+ text-decoration: none;
184
+ }
185
+
186
+ .md-theme-vscode-default a:hover {
187
+ text-decoration: underline;
188
+ }
189
+
190
+ .md-theme-vscode-default strong {
191
+ font-weight: 600;
192
+ }
193
+
194
+ /*
195
+ * Inline code. Preview keeps inline code at the body font size (1em) on a
196
+ * softened VS Code preformat surface, with only a small inset — no GitHub-style
197
+ * badge.
198
+ */
199
+ .md-theme-vscode-default :not(pre)>code {
200
+ font-family: var(--vscode-editor-font-family, ui-monospace, SFMono-Regular,
201
+ 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace);
202
+ font-size: 1em;
203
+ line-height: 1.357em;
204
+ padding: 1px 3px;
205
+ margin: 0;
206
+ color: var(--vscode-textPreformat-foreground, inherit);
207
+ background-color: var(--md-inline-code-background);
208
+ border-radius: 4px;
209
+ white-space: break-spaces;
210
+ }
211
+
212
+ /* Fenced code block: framed by a 1px border, preview-style. */
213
+ .md-theme-vscode-default .md-code-block {
214
+ margin-top: 0;
215
+ margin-bottom: 16px;
216
+ padding: 16px;
217
+ line-height: 1.357;
218
+ background-color: var(--vscode-textCodeBlock-background, #f6f8fa);
219
+ border: 1px solid var(--vscode-widget-border, #d1d9e0);
220
+ border-radius: 3px;
221
+ }
222
+
223
+ .md-theme-vscode-default .md-code-block code {
224
+ font-family: var(--vscode-editor-font-family, ui-monospace, SFMono-Regular,
225
+ 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace);
226
+ padding: 0;
227
+ background-color: transparent;
228
+ border-radius: 0;
229
+ }
230
+
231
+ /*
232
+ * Syntax-highlight token colors. Driven by `--md-tok-*` custom properties so
233
+ * the explorer (or any embedder) can supply a palette matched to the active
234
+ * color theme. Fallbacks are the VS Code light theme palette.
235
+ */
236
+ .md-theme-vscode-default .md-code-block .tok-keyword {
237
+ color: var(--md-tok-keyword, #0000ff);
238
+ }
239
+
240
+ .md-theme-vscode-default .md-code-block .tok-string {
241
+ color: var(--md-tok-string, #a31515);
242
+ }
243
+
244
+ .md-theme-vscode-default .md-code-block .tok-comment {
245
+ color: var(--md-tok-comment, #008000);
246
+ }
247
+
248
+ .md-theme-vscode-default .md-code-block .tok-number {
249
+ color: var(--md-tok-number, #098658);
250
+ }
251
+
252
+ .md-theme-vscode-default .md-code-block .tok-regexp {
253
+ color: var(--md-tok-regexp, #811f3f);
254
+ }
255
+
256
+ .md-theme-vscode-default .md-code-block .tok-type {
257
+ color: var(--md-tok-type, #267f99);
258
+ }
259
+
260
+ .md-theme-vscode-default .md-code-block .tok-annotation {
261
+ color: var(--md-tok-annotation, #267f99);
262
+ }
263
+
264
+ .md-theme-vscode-default .md-code-block .tok-tag {
265
+ color: var(--md-tok-tag, #800000);
266
+ }
267
+
268
+ .md-theme-vscode-default .md-code-block .tok-attribute {
269
+ color: var(--md-tok-attribute, #e50000);
270
+ }
271
+
272
+ .md-theme-vscode-default .md-code-block .tok-delimiter {
273
+ color: var(--md-tok-delimiter, inherit);
274
+ }
275
+
276
+ /*
277
+ * Display math has no container styling (KaTeX renders it inline-centered).
278
+ * Keep only the block spacing; horizontal scroll comes from the base sheet.
279
+ */
280
+ .md-theme-vscode-default .md-math-block {
281
+ margin-top: 0;
282
+ margin-bottom: 16px;
283
+ }
284
+
285
+ /*
286
+ * KaTeX renders inline math at 1.21em with its own (larger) line-height, which
287
+ * would inflate the surrounding line box. Collapse it so the rendered math fits
288
+ * the text line and the paragraph height stays identical active vs inactive.
289
+ */
290
+ .md-theme-vscode-default .md-inline-math .katex {
291
+ line-height: 1;
292
+ }
293
+
294
+ .md-theme-vscode-default .md-table-wrapper {
295
+ /* Block spacing lives on the wrapper (the scroll/BFC box) so it collapses
296
+ with siblings as before; the inner table has no margin of its own. */
297
+ margin-top: 0;
298
+ margin-bottom: 16px;
299
+ }
300
+
301
+ .md-theme-vscode-default .md-table {
302
+ border-collapse: collapse;
303
+ width: auto;
304
+ }
305
+
306
+ .md-theme-vscode-default .md-table th,
307
+ .md-theme-vscode-default .md-table td {
308
+ padding: 5px 10px;
309
+ border: 1px solid var(--vscode-editorWidget-border, #d1d9e0);
310
+ text-align: left;
311
+ }
312
+
313
+ /*
314
+ * The editor renders every cell as <td> in a flat <table> of <tr> (no
315
+ * <thead>/<tbody>/<th>). Row order is: header, delimiter row, body rows.
316
+ */
317
+ .md-theme-vscode-default .md-table tr:first-child td {
318
+ font-weight: 600;
319
+ padding-top: 10px;
320
+ padding-bottom: 10px;
321
+ }
322
+
323
+ /* Active: reclaim the header's extra spacing to host the delimiter row. */
324
+ .md-theme-vscode-default .md-table.md-block-active tr:first-child td {
325
+ padding-top: 2px;
326
+ padding-bottom: 2px;
327
+ }
328
+
329
+ .md-theme-vscode-default .md-table tr:nth-child(even):not(.md-table-delimiter-row) {
330
+ background-color: var(--vscode-textCodeBlock-background, #f6f8fa);
331
+ }
332
+
333
+ /*
334
+ * The delimiter row (`| --- | --- |`) is editor source shown only while
335
+ * editing; render it borderless with no vertical padding so it occupies just
336
+ * the compact space reclaimed from the header.
337
+ */
338
+ .md-theme-vscode-default .md-table-delimiter-row td {
339
+ border: 0;
340
+ padding: 0 10px;
341
+ background: transparent;
342
+ }
343
+
344
+ /*
345
+ * Active table: the source `|` pipes ARE the outline. Drop the HTML cell
346
+ * borders (kept as transparent so the 1px box geometry — and thus the table's
347
+ * height and first-text X — is unchanged) and clear the zebra fill so the
348
+ * table reads as plain source.
349
+ */
350
+ .md-theme-vscode-default .md-table.md-block-active td {
351
+ border-color: transparent;
352
+ }
353
+
354
+ .md-theme-vscode-default .md-table.md-block-active tr:nth-child(even):not(.md-table-delimiter-row) td {
355
+ background-color: transparent;
356
+ }
357
+
358
+ /*
359
+ * Shift each cell's leading pipe onto its left gridline (where the border was)
360
+ * and the last cell's closing pipe onto the right gridline. `position:
361
+ * relative` moves only the painted glyph by the cell's horizontal padding;
362
+ * siblings and the glue's reserved width are untouched, so active/inactive
363
+ * height and first-text X stay pixel-identical.
364
+ */
365
+ .md-theme-vscode-default .md-table.md-block-active td>.md-glue-tableCellGlue:first-child,
366
+ .md-theme-vscode-default .md-table.md-block-active .md-table-delimiter-row td>.md-marker-tableDelimiter {
367
+ position: relative;
368
+ left: -10px;
369
+ }
370
+
371
+ /*
372
+ * The last cell's closing `|` floats right after the (left-aligned) cell text.
373
+ * Pin it to the column's right gridline (the cell's border edge, 10px past the
374
+ * content box) so the right outline is a straight line. `top: auto` keeps the
375
+ * pipe on the content line (the shared editor.css rule takes it out of flow);
376
+ * the previous `top: 0` floated it to the cell's top edge, so on tall/wrapping
377
+ * rows it no longer lined up with the in-flow leading pipes.
378
+ */
379
+ .md-theme-vscode-default .md-table.md-block-active td:last-child {
380
+ position: relative;
381
+ }
382
+
383
+ .md-theme-vscode-default .md-table.md-block-active td:last-child>.md-glue-tableCellGlue:last-child {
384
+ position: absolute;
385
+ right: 0;
386
+ top: auto;
387
+ }
388
+
389
+ /*
390
+ * The delimiter row's last cell carries its closing `|` as a separate
391
+ * `tableDelimiterClose` marker; pin it to the same right gridline as the body
392
+ * rows' closing pipe so the last column's outline stays straight.
393
+ */
394
+ .md-theme-vscode-default .md-table.md-block-active .md-table-delimiter-row td:last-child>.md-marker-tableDelimiterClose {
395
+ position: absolute;
396
+ right: 0;
397
+ top: auto;
398
+ }