@vscode/markdown-editor 0.0.2-6 → 0.0.2-60
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/README.md +26 -0
- 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/commands.d.ts +65 -0
- package/dist/commands.js +159 -0
- package/dist/commands.js.map +1 -0
- package/dist/config-BGeaJqWk.js +286 -0
- package/dist/config-BGeaJqWk.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +1459 -104
- package/dist/index.js +6070 -2000
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.css +1 -0
- package/dist/observables.js +45 -43
- package/dist/observables.js.map +1 -1
- package/dist/{runOnChange-C00UIwqQ.js → runOnChange-e7FtCqOQ.js} +115 -111
- package/dist/runOnChange-e7FtCqOQ.js.map +1 -0
- package/dist/stringEdit-CVDbCUBY.js +215 -0
- package/dist/stringEdit-CVDbCUBY.js.map +1 -0
- package/dist/web-editors.d.ts +282 -0
- package/dist/web-editors.js +6471 -0
- package/dist/web-editors.js.map +1 -0
- package/package.json +60 -13
- package/src/contrib/comments/commentInput.css +150 -0
- package/src/contrib/comments/comments.css +129 -0
- package/src/contrib/commentsVscode/vscodeCommentWidgetV2.css +171 -0
- package/src/contrib/find/find.css +347 -0
- package/src/view/editor.css +505 -20
- package/src/view/themes/default.css +13 -4
- package/src/view/themes/github.css +16 -13
- package/src/view/themes/vscode-default.css +397 -0
- package/src/view/themes/vscode-github.css +393 -0
- package/dist/runOnChange-C00UIwqQ.js.map +0 -1
- /package/dist/_observables/observableInternal/reactions/{autorunImpl.d.ts → createEffectImpl.d.ts} +0 -0
package/src/view/editor.css
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@import '@vscode/codicons/dist/codicon.css';
|
|
2
|
+
@import '../contrib/find/find.css';
|
|
3
|
+
|
|
1
4
|
/*
|
|
2
5
|
* Base editor styles — ABSOLUTE MINIMUM.
|
|
3
6
|
*
|
|
@@ -12,14 +15,34 @@
|
|
|
12
15
|
* theme files (`themes/default.css`, `themes/github.css`) applied via the
|
|
13
16
|
* `classNames` editor option; those selectors only ever match inside their
|
|
14
17
|
* own theme class and never style the global scope.
|
|
18
|
+
*
|
|
19
|
+
* NO `--vscode-*` variables may be referenced here. This base file must stay
|
|
20
|
+
* theme-agnostic and know nothing about VS Code. Where a value needs to vary
|
|
21
|
+
* per theme, expose a local `--md-*` custom property WITH a sensible literal
|
|
22
|
+
* fallback (e.g. `var(--md-cursor-background, #000)`) and let a theme file set
|
|
23
|
+
* it. Only the `themes/vscode-*.css` themes are permitted to read `--vscode-*`
|
|
24
|
+
* variables and map them onto these `--md-*` properties.
|
|
15
25
|
*/
|
|
16
26
|
|
|
17
27
|
.md-editor {
|
|
28
|
+
display: flow-root;
|
|
18
29
|
outline: none;
|
|
19
30
|
/* The editor paints its own cursor (`.md-cursor`); hide the native caret. */
|
|
20
31
|
caret-color: transparent;
|
|
21
32
|
}
|
|
22
33
|
|
|
34
|
+
.md-editor-a11y-status {
|
|
35
|
+
position: absolute;
|
|
36
|
+
width: 1px;
|
|
37
|
+
height: 1px;
|
|
38
|
+
padding: 0;
|
|
39
|
+
margin: -1px;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
clip: rect(0, 0, 0, 0);
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
border: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
23
46
|
/*
|
|
24
47
|
* The transient empty paragraph — the blank line conjured by pressing Enter at
|
|
25
48
|
* the end of a paragraph (see `PendingParagraph` in the model). It is not part
|
|
@@ -35,18 +58,58 @@
|
|
|
35
58
|
* overlays, which position themselves relative to this box, so it is the
|
|
36
59
|
* positioning context. In limited-width mode the editor sets an inline
|
|
37
60
|
* `max-width` here and the auto inline margins center it within the full-width
|
|
38
|
-
* `.md-editor`.
|
|
61
|
+
* `.md-editor`. The block-start padding keeps every document clear of the top
|
|
62
|
+
* edge, independent of the first block's theme margins.
|
|
39
63
|
*/
|
|
40
64
|
.md-editor-content {
|
|
65
|
+
--md-editor-content-inline-start-padding: 48px;
|
|
66
|
+
--md-readonly-toggle-width: 58px;
|
|
67
|
+
--md-readonly-toggle-height: 32px;
|
|
68
|
+
/* Leaves 16px of optical separation beyond the active block's 8px outset glow. */
|
|
69
|
+
--md-readonly-toggle-gap: 24px;
|
|
70
|
+
--md-readonly-toggle-inset: 4px;
|
|
71
|
+
--md-editor-content-inline-end-padding: var(--md-editor-content-inline-start-padding);
|
|
41
72
|
position: relative;
|
|
42
73
|
margin-inline: auto;
|
|
43
|
-
padding:
|
|
74
|
+
padding-block: 24px 0;
|
|
75
|
+
padding-inline: var(--md-editor-content-inline-start-padding) var(--md-editor-content-inline-end-padding);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.md-editor-content-with-readonly-toggle {
|
|
79
|
+
--md-editor-content-inline-end-padding: calc(var(--md-readonly-toggle-width) + var(--md-readonly-toggle-gap) + var(--md-readonly-toggle-inset));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.md-editor-content-with-readonly-toggle>.md-document :is(.md-heading, .md-paragraph) {
|
|
83
|
+
overflow-wrap: anywhere;
|
|
44
84
|
}
|
|
45
85
|
|
|
46
86
|
.md-block-active {
|
|
47
|
-
background: #f8f8f8;
|
|
87
|
+
background: var(--md-block-active-background, #f8f8f8);
|
|
48
88
|
border-radius: 4px;
|
|
49
|
-
box-shadow: 0 0 0 8px #f8f8f8;
|
|
89
|
+
box-shadow: 0 0 0 8px var(--md-block-active-background, #f8f8f8);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
* The whole-empty-document case. Markdown has no empty-paragraph node, so a
|
|
94
|
+
* document with no content parses to a single empty paragraph (see
|
|
95
|
+
* `_ensureBlocks` in the parser) which renders as a childless `<p>` of zero
|
|
96
|
+
* height. Give it one line's height so the editor presents an intentional,
|
|
97
|
+
* clickable empty editing surface — and so typing the first character causes no
|
|
98
|
+
* layout shift (a filled line is also one `lh` tall).
|
|
99
|
+
*/
|
|
100
|
+
.md-paragraph:empty {
|
|
101
|
+
min-height: 1lh;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
* ...and never paint the active-block card over that zero-content line: with no
|
|
106
|
+
* text to size it, the card's background + 8px box-shadow glow would show up as
|
|
107
|
+
* a stray gray bar. The two extra classes outrank the base `.md-block-active`
|
|
108
|
+
* rule above in every theme (themes only remap `--md-block-active-background`).
|
|
109
|
+
*/
|
|
110
|
+
.md-paragraph:empty.md-block-active {
|
|
111
|
+
background: transparent;
|
|
112
|
+
box-shadow: none;
|
|
50
113
|
}
|
|
51
114
|
|
|
52
115
|
/*
|
|
@@ -60,6 +123,7 @@
|
|
|
60
123
|
.md-block-active a {
|
|
61
124
|
cursor: inherit;
|
|
62
125
|
}
|
|
126
|
+
|
|
63
127
|
.md-editor.md-mod-down .md-block-active a[href] {
|
|
64
128
|
cursor: pointer;
|
|
65
129
|
}
|
|
@@ -74,6 +138,7 @@
|
|
|
74
138
|
.md-editor a[href]:hover {
|
|
75
139
|
text-decoration: underline;
|
|
76
140
|
}
|
|
141
|
+
|
|
77
142
|
.md-editor:not(.md-mod-down) .md-block-active a[href]:hover {
|
|
78
143
|
text-decoration: none;
|
|
79
144
|
}
|
|
@@ -113,6 +178,69 @@
|
|
|
113
178
|
white-space: pre-wrap;
|
|
114
179
|
}
|
|
115
180
|
|
|
181
|
+
/*
|
|
182
|
+
* An unhandled block: a construct the parser does not model (setext heading,
|
|
183
|
+
* an extension token). Its raw source is shown verbatim,
|
|
184
|
+
* styled like a code block but visibly flagged as "not understood" by a dashed
|
|
185
|
+
* warning border, so the content is preserved and editable rather than silently
|
|
186
|
+
* dropped.
|
|
187
|
+
*
|
|
188
|
+
* The wrapper is the non-scrolling box (border + block spacing); the inner
|
|
189
|
+
* `.md-unhandled-scroll` <pre> is the horizontal scroller.
|
|
190
|
+
*/
|
|
191
|
+
.md-unhandled-block {
|
|
192
|
+
margin: 0.5em 0;
|
|
193
|
+
border: 1px dashed #d0a000;
|
|
194
|
+
border-radius: 4px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/*
|
|
198
|
+
* Inner scroller. Beats the per-theme `.md-theme-* .md-code-block` box rules
|
|
199
|
+
* (same class count) via the extra `pre` type selector: no margin/border of its
|
|
200
|
+
* own (those live on the wrapper).
|
|
201
|
+
*/
|
|
202
|
+
pre.md-unhandled-scroll.md-code-block {
|
|
203
|
+
margin: 0;
|
|
204
|
+
border: 0;
|
|
205
|
+
border-radius: 4px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/*
|
|
209
|
+
* Complete block HTML comments are authoring metadata, not unsupported-syntax
|
|
210
|
+
* warnings. Keep them source-identifiable but quiet while reading, and reveal
|
|
211
|
+
* their exact whitespace when the block becomes active.
|
|
212
|
+
*/
|
|
213
|
+
.md-html-comment {
|
|
214
|
+
margin: 0.125em 0 0.25em;
|
|
215
|
+
padding: 0.125em 0;
|
|
216
|
+
overflow: hidden;
|
|
217
|
+
color: var(--md-html-comment-foreground, #6e7378);
|
|
218
|
+
font-family: var(--md-html-comment-font-family, 'Cascadia Code', 'Fira Code', monospace);
|
|
219
|
+
font-size: 0.85em;
|
|
220
|
+
line-height: 1.5;
|
|
221
|
+
text-overflow: ellipsis;
|
|
222
|
+
white-space: nowrap;
|
|
223
|
+
transition: color 80ms ease-out;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.md-html-comment:not(.md-html-comment-source):hover {
|
|
227
|
+
color: var(--md-html-comment-hover-foreground, #45494e);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.md-html-comment-source {
|
|
231
|
+
overflow: visible;
|
|
232
|
+
text-overflow: clip;
|
|
233
|
+
white-space: pre-wrap;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.md-html-comment-syntax {
|
|
237
|
+
opacity: 0.6;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.md-html-comment-source .md-html-comment-syntax {
|
|
241
|
+
opacity: 1;
|
|
242
|
+
}
|
|
243
|
+
|
|
116
244
|
/*
|
|
117
245
|
* Visible whitespace indicators, shown only in the active/source view. The real
|
|
118
246
|
* whitespace character stays in the DOM (so source ↔ DOM mapping and selection
|
|
@@ -212,15 +340,61 @@
|
|
|
212
340
|
}
|
|
213
341
|
|
|
214
342
|
/*
|
|
215
|
-
* Glue
|
|
216
|
-
*
|
|
217
|
-
*
|
|
343
|
+
* Glue normally keeps its inline footprint when hidden so source padding and
|
|
344
|
+
* widget gutters stay identical between active and inactive states. Hidden
|
|
345
|
+
* table-cell glue is the exception below: leaving it in inline flow lets its
|
|
346
|
+
* invisible spaces wrap around long cell content.
|
|
218
347
|
*/
|
|
219
348
|
.md-glue-hidden {
|
|
220
349
|
display: inline;
|
|
221
350
|
visibility: hidden;
|
|
222
351
|
}
|
|
223
352
|
|
|
353
|
+
/*
|
|
354
|
+
* Inactive table pipes stay in the DOM/source tree, but leave layout and
|
|
355
|
+
* hit-testing entirely. Keeping an invisible rect either in the content flow or
|
|
356
|
+
* over the cell padding can create phantom lines or steal clicks from visible
|
|
357
|
+
* text. Hidden source offsets therefore collapse to the neighboring semantic
|
|
358
|
+
* seam, matching other display-none markers. Visible pipes retain the per-theme
|
|
359
|
+
* active/source layout.
|
|
360
|
+
*/
|
|
361
|
+
.md-table td>.md-glue-tableCellGlue.md-glue-hidden {
|
|
362
|
+
display: none;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/*
|
|
366
|
+
* Active table: take each cell's TRAILING structural glue (the source space
|
|
367
|
+
* after the cell text, and — via the per-theme `right: 0` rule — the last
|
|
368
|
+
* column's closing `|`) out of the cell's inline flow. Left in flow, that glue
|
|
369
|
+
* wraps below long cell content (the same wrapping the hidden-glue note above
|
|
370
|
+
* describes), which makes the cell two lines tall: the browser's default
|
|
371
|
+
* `vertical-align: middle` then re-centres the other cells' single-line content
|
|
372
|
+
* in Y, their runs merge into one oversized VisualLine, and the caret — sized
|
|
373
|
+
* directly from that line box — grows far past the line height while the
|
|
374
|
+
* visible pipes drift apart row-to-row. Positioning the trailing glue
|
|
375
|
+
* absolutely removes it from wrapping flow while keeping its real client rects
|
|
376
|
+
* at the static (content-line) position, so caret placement, hit-testing,
|
|
377
|
+
* source mapping and injectivity are unchanged. `top`/`bottom: auto` keep it on
|
|
378
|
+
* that content line rather than the cell's top edge. This mirrors the inactive
|
|
379
|
+
* `display: none` above; the leading `| ` glue deliberately stays in flow (a
|
|
380
|
+
* relative glyph shift, per theme) so first-text X is preserved.
|
|
381
|
+
*
|
|
382
|
+
* `:not(:first-child)` restricts this to a genuine trailing glue: a non-empty
|
|
383
|
+
* cell emits leading + trailing glue, but an EMPTY cell parses to a single glue
|
|
384
|
+
* node that is simultaneously first and last child. That lone node is the
|
|
385
|
+
* cell's leading pipe, so it must stay in flow like every other leading pipe;
|
|
386
|
+
* excluding it keeps empty cells identical to their previous (base) behaviour.
|
|
387
|
+
*/
|
|
388
|
+
.md-table.md-block-active td {
|
|
389
|
+
position: relative;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.md-table.md-block-active td>.md-glue-tableCellGlue:last-child:not(:first-child) {
|
|
393
|
+
position: absolute;
|
|
394
|
+
top: auto;
|
|
395
|
+
bottom: auto;
|
|
396
|
+
}
|
|
397
|
+
|
|
224
398
|
/*
|
|
225
399
|
* Inter-block glue: the run of blank lines between two top-level blocks. It is
|
|
226
400
|
* mounted as the last inline child of the block that precedes it, so it sits at
|
|
@@ -257,15 +431,6 @@
|
|
|
257
431
|
visibility: hidden;
|
|
258
432
|
}
|
|
259
433
|
|
|
260
|
-
/*
|
|
261
|
-
* Table cell-glue pipes (`| `) keep their inline footprint when hidden so the
|
|
262
|
-
* column widths stay identical active and inactive.
|
|
263
|
-
*/
|
|
264
|
-
.md-marker-tableCellGlue.md-marker-hidden {
|
|
265
|
-
display: inline;
|
|
266
|
-
visibility: hidden;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
434
|
/*
|
|
270
435
|
* The code-block fences (```lang / ```) each sit on their own source line. When
|
|
271
436
|
* hidden they keep their vertical footprint (visibility hidden, not display
|
|
@@ -300,6 +465,48 @@
|
|
|
300
465
|
height: 16px;
|
|
301
466
|
}
|
|
302
467
|
|
|
468
|
+
/*
|
|
469
|
+
* A wide table scrolls horizontally inside its wrapper (the block box) instead
|
|
470
|
+
* of overflowing the page and scrolling the editor's fixed left gutter away.
|
|
471
|
+
* The wrapper is the scroll viewport the selection/caret clipping measures (see
|
|
472
|
+
* `BlockViewNode.scrollElement` / `blockViewportClip`); the inner `<table>`
|
|
473
|
+
* keeps `width: auto` (theme-defined) so it sizes to its content and overflows.
|
|
474
|
+
*
|
|
475
|
+
* `width: fit-content` keeps the wrapper hugging the table's intrinsic width, so
|
|
476
|
+
* a narrow table — and the active-block glow redirected onto the wrapper below —
|
|
477
|
+
* stays as wide as the table (unchanged from before this wrapper existed).
|
|
478
|
+
* `max-width: 100%` caps it at the content column, past which the table
|
|
479
|
+
* overflows and scrolls locally. This is the standard responsive-table pattern
|
|
480
|
+
* (cf. GitHub's own `width: max-content; max-width: 100%`).
|
|
481
|
+
*/
|
|
482
|
+
.md-table-wrapper {
|
|
483
|
+
overflow-x: auto;
|
|
484
|
+
width: fit-content;
|
|
485
|
+
max-width: 100%;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/*
|
|
489
|
+
* The active-block highlight is an *outset* glow (`box-shadow: 0 0 0 8px`).
|
|
490
|
+
* Making the wrapper a scroll box (`overflow-x: auto`, which also forces
|
|
491
|
+
* `overflow-y: auto`) clips descendant paint to its padding box, so the glow on
|
|
492
|
+
* the inner active `<table>` would be cut off (the table has no horizontal
|
|
493
|
+
* margin to give the shadow room). Render the generic active chrome on the
|
|
494
|
+
* wrapper instead — a scroll box's own shadow is never clipped by its own
|
|
495
|
+
* overflow, exactly like a code block carries the glow on its own scroller —
|
|
496
|
+
* and drop it from the table, which keeps `md-block-active` purely for the
|
|
497
|
+
* per-theme source-pipe styling.
|
|
498
|
+
*/
|
|
499
|
+
.md-table-wrapper:has(> .md-table.md-block-active) {
|
|
500
|
+
background: var(--md-block-active-background, #f8f8f8);
|
|
501
|
+
border-radius: 4px;
|
|
502
|
+
box-shadow: 0 0 0 8px var(--md-block-active-background, #f8f8f8);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.md-table.md-block-active {
|
|
506
|
+
background: none;
|
|
507
|
+
box-shadow: none;
|
|
508
|
+
}
|
|
509
|
+
|
|
303
510
|
.md-selection-layer {
|
|
304
511
|
position: absolute;
|
|
305
512
|
top: 0;
|
|
@@ -415,9 +622,26 @@
|
|
|
415
622
|
|
|
416
623
|
.md-blockquote>.md-marker-blockQuoteMarker {
|
|
417
624
|
position: absolute;
|
|
418
|
-
right: calc(100% - var(--md-blockquote-pad, 0px));
|
|
625
|
+
right: calc(100% - var(--md-blockquote-pad, 0px) - 1ch);
|
|
419
626
|
top: auto;
|
|
627
|
+
/*
|
|
628
|
+
* Reserve the optional-space column so adding it cannot move the `>` glyph,
|
|
629
|
+
* then shift and scale every active quote marker consistently to leave a
|
|
630
|
+
* virtual gap before body text without consuming source width. These tuned
|
|
631
|
+
* properties are shared by ordinary and marker-only quote lines.
|
|
632
|
+
*/
|
|
633
|
+
--md-blockquote-marker-shift: -0.18ch;
|
|
634
|
+
--md-blockquote-marker-scale: 0.9;
|
|
635
|
+
display: inline-flex;
|
|
636
|
+
min-width: 2ch;
|
|
637
|
+
font-size: inherit;
|
|
638
|
+
line-height: inherit;
|
|
639
|
+
height: 1lh;
|
|
640
|
+
align-items: center;
|
|
641
|
+
text-align: left;
|
|
420
642
|
white-space: pre;
|
|
643
|
+
transform: translateX(var(--md-blockquote-marker-shift)) scale(var(--md-blockquote-marker-scale));
|
|
644
|
+
transform-origin: left center;
|
|
421
645
|
}
|
|
422
646
|
|
|
423
647
|
/* Inactive: gone entirely (the gutter is empty, the text stays put). */
|
|
@@ -425,6 +649,16 @@
|
|
|
425
649
|
display: none;
|
|
426
650
|
}
|
|
427
651
|
|
|
652
|
+
/* Collapsed block-gap newlines still need one flow box per marker-only line. */
|
|
653
|
+
.md-blockquote-line-anchor {
|
|
654
|
+
display: block;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/* A trailing marker-only source line follows the preceding quoted line directly. */
|
|
658
|
+
.md-blockquote-marker-only-line>.md-paragraph:last-of-type {
|
|
659
|
+
margin-bottom: 0;
|
|
660
|
+
}
|
|
661
|
+
|
|
428
662
|
/* Code/math blocks scroll horizontally; their look is theme-defined. */
|
|
429
663
|
.md-code-block {
|
|
430
664
|
overflow-x: auto;
|
|
@@ -470,6 +704,18 @@
|
|
|
470
704
|
white-space: pre;
|
|
471
705
|
}
|
|
472
706
|
|
|
707
|
+
/*
|
|
708
|
+
* An inactive ordered item uses the browser's native `::marker`. Match its
|
|
709
|
+
* typography when revealing the source marker so switching the active item
|
|
710
|
+
* does not change the number's width or horizontal position. Keep unordered
|
|
711
|
+
* source markers in the standard muted monospace source style.
|
|
712
|
+
*/
|
|
713
|
+
ol.md-list>.md-list-item-active>.md-marker-listItemMarker,
|
|
714
|
+
ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker {
|
|
715
|
+
font-family: inherit;
|
|
716
|
+
font-size: inherit;
|
|
717
|
+
}
|
|
718
|
+
|
|
473
719
|
/*
|
|
474
720
|
* A nested item's source indentation precedes its bullet (`␣␣- text`). The
|
|
475
721
|
* indent glue and the bullet are mounted together in this gutter span, which is
|
|
@@ -514,6 +760,16 @@
|
|
|
514
760
|
white-space: pre;
|
|
515
761
|
}
|
|
516
762
|
|
|
763
|
+
/*
|
|
764
|
+
* A continuation-line indent inside a paragraph is source-only padding. When
|
|
765
|
+
* inactive, the preceding soft-break newline already collapses to the single
|
|
766
|
+
* rendered space Markdown requires; retaining the hidden indent would add the
|
|
767
|
+
* tab/space run's width on top of it.
|
|
768
|
+
*/
|
|
769
|
+
.md-paragraph>.md-glue-indent.md-glue-hidden {
|
|
770
|
+
display: none;
|
|
771
|
+
}
|
|
772
|
+
|
|
517
773
|
/*
|
|
518
774
|
* A loose list item's later block (its second paragraph etc.) owns the source
|
|
519
775
|
* continuation indent that precedes it as its `leadingTrivia`. Like a nested
|
|
@@ -591,8 +847,8 @@
|
|
|
591
847
|
.md-checkbox:checked::after {
|
|
592
848
|
content: '';
|
|
593
849
|
position: absolute;
|
|
594
|
-
left:
|
|
595
|
-
top:
|
|
850
|
+
left: 2.5px;
|
|
851
|
+
top: -1px;
|
|
596
852
|
width: 5px;
|
|
597
853
|
height: 9px;
|
|
598
854
|
border: solid white;
|
|
@@ -617,11 +873,43 @@
|
|
|
617
873
|
.md-cursor {
|
|
618
874
|
position: absolute;
|
|
619
875
|
width: 2px;
|
|
620
|
-
background: #000;
|
|
876
|
+
background: var(--md-cursor-background, #000);
|
|
621
877
|
pointer-events: none;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/*
|
|
881
|
+
* The painted caret is only shown while the editor is genuinely focused — focus
|
|
882
|
+
* rests inside it and its window is focused, mirrored onto the root as
|
|
883
|
+
* `.md-focused`. When unfocused, hide the caret element but keep its layout box
|
|
884
|
+
* (so caret geometry, selection and comment anchoring are unchanged) and stop
|
|
885
|
+
* the blink. Adding the animation on focus restarts it from 0% (a solid caret).
|
|
886
|
+
*/
|
|
887
|
+
.md-editor:not(.md-focused) .md-cursor {
|
|
888
|
+
visibility: hidden;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.md-editor.md-focused .md-cursor {
|
|
622
892
|
animation: md-cursor-blink 1s step-end infinite;
|
|
623
893
|
}
|
|
624
894
|
|
|
895
|
+
/*
|
|
896
|
+
* Read-only mode retains the logical caret for selection and comment anchoring.
|
|
897
|
+
* Hide only its painted element so unlocking can restore it in place.
|
|
898
|
+
*/
|
|
899
|
+
.md-editor.md-readonly .md-cursor {
|
|
900
|
+
visibility: hidden;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.md-editor.md-readonly-editing-attempt {
|
|
904
|
+
animation: md-readonly-editing-attempt 300ms ease-out;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
@keyframes md-readonly-editing-attempt {
|
|
908
|
+
50% {
|
|
909
|
+
box-shadow: inset 0 0 0 2px var(--md-readonly-shine-glow, rgba(255, 255, 255, 0.58));
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
625
913
|
@keyframes md-cursor-blink {
|
|
626
914
|
|
|
627
915
|
0%,
|
|
@@ -632,4 +920,201 @@
|
|
|
632
920
|
50% {
|
|
633
921
|
opacity: 0;
|
|
634
922
|
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/*
|
|
926
|
+
* Edit / read-only lock toggle.
|
|
927
|
+
*
|
|
928
|
+
* The asymmetric content padding reserves a real rail for the control:
|
|
929
|
+
* button width + gap + edge inset. The zero-height sticky host spans the
|
|
930
|
+
* document column and that rail, keeping the button beside (never over) the
|
|
931
|
+
* rendered document as it scrolls. Colors use local `--md-readonly-*` custom
|
|
932
|
+
* properties with literal fallbacks so this base file stays theme-agnostic
|
|
933
|
+
* (themes may override them).
|
|
934
|
+
*/
|
|
935
|
+
.md-readonly-toggle-host {
|
|
936
|
+
position: sticky;
|
|
937
|
+
top: 0;
|
|
938
|
+
width: calc(100% + var(--md-editor-content-inline-end-padding));
|
|
939
|
+
height: 0;
|
|
940
|
+
z-index: 10;
|
|
941
|
+
pointer-events: none;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
.md-readonly-toggle {
|
|
945
|
+
position: absolute;
|
|
946
|
+
top: 4px;
|
|
947
|
+
right: var(--md-readonly-toggle-inset);
|
|
948
|
+
pointer-events: auto;
|
|
949
|
+
display: inline-grid;
|
|
950
|
+
grid-template-columns: repeat(2, 24px);
|
|
951
|
+
align-items: center;
|
|
952
|
+
justify-items: center;
|
|
953
|
+
gap: 2px;
|
|
954
|
+
box-sizing: border-box;
|
|
955
|
+
width: var(--md-readonly-toggle-width);
|
|
956
|
+
height: var(--md-readonly-toggle-height);
|
|
957
|
+
padding: 3px;
|
|
958
|
+
overflow: hidden;
|
|
959
|
+
direction: ltr;
|
|
960
|
+
appearance: none;
|
|
961
|
+
border-radius: 999px;
|
|
962
|
+
border: 1px solid var(--md-readonly-border, #b8b8b8);
|
|
963
|
+
background: var(--md-readonly-background, #f3f3f3);
|
|
964
|
+
color: var(--md-readonly-foreground, #444444);
|
|
965
|
+
font-size: 16px;
|
|
966
|
+
line-height: 1;
|
|
967
|
+
cursor: pointer;
|
|
968
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
969
|
+
transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/*
|
|
973
|
+
* Below this width there is not enough document column for the side rail to be
|
|
974
|
+
* useful. Give the host its own row and stop it from sticking, so neither long
|
|
975
|
+
* unbreakable content nor later content scrolled through the viewport can ever
|
|
976
|
+
* pass underneath the button.
|
|
977
|
+
*/
|
|
978
|
+
.md-editor-narrow .md-readonly-toggle-host {
|
|
979
|
+
position: relative;
|
|
980
|
+
height: calc(var(--md-readonly-toggle-height) + var(--md-readonly-toggle-inset) + var(--md-readonly-toggle-inset));
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.md-readonly-toggle::after {
|
|
984
|
+
content: '';
|
|
985
|
+
position: absolute;
|
|
986
|
+
z-index: 2;
|
|
987
|
+
top: -8px;
|
|
988
|
+
bottom: -8px;
|
|
989
|
+
left: -30px;
|
|
990
|
+
width: 24px;
|
|
991
|
+
background: linear-gradient(90deg,
|
|
992
|
+
transparent,
|
|
993
|
+
var(--md-readonly-shine-edge, rgba(255, 255, 255, 0.16)) 24%,
|
|
994
|
+
var(--md-readonly-shine, #ffffff) 50%,
|
|
995
|
+
var(--md-readonly-shine-edge, rgba(255, 255, 255, 0.16)) 76%,
|
|
996
|
+
transparent);
|
|
997
|
+
box-shadow: 0 0 8px 2px var(--md-readonly-shine-glow, rgba(255, 255, 255, 0.58));
|
|
998
|
+
opacity: 0;
|
|
999
|
+
pointer-events: none;
|
|
1000
|
+
transform: skewX(-20deg);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.md-readonly-toggle.md-readonly-toggle-shine::after {
|
|
1004
|
+
animation: md-readonly-toggle-shine 2s linear;
|
|
1005
|
+
will-change: transform, opacity;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
@keyframes md-readonly-toggle-shine {
|
|
1009
|
+
0% {
|
|
1010
|
+
opacity: 0;
|
|
1011
|
+
transform: translateX(0) skewX(-20deg);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
12%,
|
|
1015
|
+
88% {
|
|
1016
|
+
opacity: 1;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
100% {
|
|
1020
|
+
opacity: 0;
|
|
1021
|
+
transform: translateX(122px) skewX(-20deg);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.md-readonly-toggle:hover {
|
|
1026
|
+
border-color: var(--md-readonly-border-hover, #8d8d8d);
|
|
1027
|
+
background: var(--md-readonly-background-hover, #e9e9e9);
|
|
1028
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(0, 0, 0, 0.1);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.md-readonly-toggle:focus-visible {
|
|
1032
|
+
outline: 2px solid var(--md-readonly-accent, #4c8bf5);
|
|
1033
|
+
outline-offset: 1px;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
.md-readonly-toggle .md-readonly-toggle-indicator {
|
|
1037
|
+
position: absolute;
|
|
1038
|
+
top: 50%;
|
|
1039
|
+
left: 3px;
|
|
1040
|
+
width: 24px;
|
|
1041
|
+
height: 24px;
|
|
1042
|
+
border-radius: 50%;
|
|
1043
|
+
background: var(--md-readonly-accent, #4c8bf5);
|
|
1044
|
+
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25);
|
|
1045
|
+
transform: translate(26px, -50%);
|
|
1046
|
+
transition: background-color 0.12s ease, transform 0.16s ease;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.md-readonly-toggle .md-readonly-toggle-icon {
|
|
1050
|
+
position: relative;
|
|
1051
|
+
z-index: 1;
|
|
1052
|
+
display: block;
|
|
1053
|
+
width: 16px;
|
|
1054
|
+
height: 16px;
|
|
1055
|
+
color: var(--md-readonly-foreground, #444444);
|
|
1056
|
+
opacity: 0.62;
|
|
1057
|
+
pointer-events: none;
|
|
1058
|
+
transition: color 0.12s ease, opacity 0.12s ease;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
.md-readonly-toggle:not(.md-readonly-toggle-locked) .md-readonly-toggle-icon-editing,
|
|
1062
|
+
.md-readonly-toggle.md-readonly-toggle-locked .md-readonly-toggle-icon-locked {
|
|
1063
|
+
color: var(--md-readonly-accent-foreground, #ffffff);
|
|
1064
|
+
opacity: 1;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
.md-readonly-toggle.md-readonly-toggle-locked .md-readonly-toggle-indicator {
|
|
1068
|
+
transform: translate(0, -50%);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1072
|
+
|
|
1073
|
+
.md-editor.md-readonly-editing-attempt,
|
|
1074
|
+
.md-readonly-toggle,
|
|
1075
|
+
.md-readonly-toggle .md-readonly-toggle-indicator,
|
|
1076
|
+
.md-readonly-toggle .md-readonly-toggle-icon,
|
|
1077
|
+
.md-readonly-toggle.md-readonly-toggle-shine::after {
|
|
1078
|
+
animation: none;
|
|
1079
|
+
transition: none;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
@media (forced-colors: active) {
|
|
1084
|
+
.md-readonly-toggle {
|
|
1085
|
+
forced-color-adjust: none;
|
|
1086
|
+
border-color: ButtonText;
|
|
1087
|
+
background: ButtonFace;
|
|
1088
|
+
color: ButtonText;
|
|
1089
|
+
box-shadow: none;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
.md-readonly-toggle::after {
|
|
1093
|
+
display: none;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
.md-readonly-toggle:hover {
|
|
1097
|
+
border-color: Highlight;
|
|
1098
|
+
background: ButtonFace;
|
|
1099
|
+
box-shadow: none;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
.md-readonly-toggle:focus-visible {
|
|
1103
|
+
outline-color: Highlight;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
.md-readonly-toggle .md-readonly-toggle-indicator {
|
|
1107
|
+
background: Highlight;
|
|
1108
|
+
box-shadow: none;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
.md-readonly-toggle .md-readonly-toggle-icon {
|
|
1112
|
+
color: ButtonText;
|
|
1113
|
+
opacity: 1;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
.md-readonly-toggle:not(.md-readonly-toggle-locked) .md-readonly-toggle-icon-editing,
|
|
1117
|
+
.md-readonly-toggle.md-readonly-toggle-locked .md-readonly-toggle-icon-locked {
|
|
1118
|
+
color: HighlightText;
|
|
1119
|
+
}
|
|
635
1120
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
.md-editor.md-theme-default {
|
|
15
|
+
color-scheme: light;
|
|
15
16
|
font-family: system-ui, -apple-system, sans-serif;
|
|
16
17
|
font-size: 16px;
|
|
17
18
|
line-height: 1.6;
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
.md-theme-default .md-code-block {
|
|
30
31
|
background: #f4f4f4;
|
|
31
32
|
border-radius: 4px;
|
|
32
|
-
padding: 12px
|
|
33
|
+
padding: 8px 12px;
|
|
33
34
|
margin: 0.5em 0;
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -121,9 +122,14 @@
|
|
|
121
122
|
--md-list-indent-step: 24px;
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
.md-theme-default .md-table-wrapper {
|
|
126
|
+
/* Block spacing lives on the wrapper (the scroll/BFC box) so it collapses
|
|
127
|
+
with siblings as before; the inner table has no margin of its own. */
|
|
128
|
+
margin: 0.5em 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
124
131
|
.md-theme-default .md-table {
|
|
125
132
|
border-collapse: collapse;
|
|
126
|
-
margin: 0.5em 0;
|
|
127
133
|
width: auto;
|
|
128
134
|
}
|
|
129
135
|
|
|
@@ -201,6 +207,9 @@
|
|
|
201
207
|
* box) so the right outline is a straight line. Absolute removes it from flow,
|
|
202
208
|
* but it is the trailing node so no text shifts; the leading pipe still fixes
|
|
203
209
|
* first-text X and the row stays one line tall, keeping the compare invariants.
|
|
210
|
+
* `top: auto` keeps the pipe on the content line (the shared editor.css rule
|
|
211
|
+
* also takes trailing glue out of flow); the previous `top: 0` floated it to
|
|
212
|
+
* the cell's top edge, misaligning it with the leading pipes on wrapping rows.
|
|
204
213
|
*/
|
|
205
214
|
.md-theme-default .md-table.md-block-active td:last-child {
|
|
206
215
|
position: relative;
|
|
@@ -209,7 +218,7 @@
|
|
|
209
218
|
.md-theme-default .md-table.md-block-active td:last-child>.md-glue-tableCellGlue:last-child {
|
|
210
219
|
position: absolute;
|
|
211
220
|
right: 0;
|
|
212
|
-
top:
|
|
221
|
+
top: auto;
|
|
213
222
|
}
|
|
214
223
|
|
|
215
224
|
/*
|
|
@@ -220,7 +229,7 @@
|
|
|
220
229
|
.md-theme-default .md-table.md-block-active .md-table-delimiter-row td:last-child>.md-marker-tableDelimiterClose {
|
|
221
230
|
position: absolute;
|
|
222
231
|
right: 0;
|
|
223
|
-
top:
|
|
232
|
+
top: auto;
|
|
224
233
|
}
|
|
225
234
|
|
|
226
235
|
.md-theme-default code {
|