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