@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
@@ -1,3 +1,5 @@
1
+ @import '@vscode/codicons/dist/codicon.css';
2
+
1
3
  /*
2
4
  * Base editor styles — ABSOLUTE MINIMUM.
3
5
  *
@@ -12,43 +14,122 @@
12
14
  * theme files (`themes/default.css`, `themes/github.css`) applied via the
13
15
  * `classNames` editor option; those selectors only ever match inside their
14
16
  * own theme class and never style the global scope.
17
+ *
18
+ * NO `--vscode-*` variables may be referenced here. This base file must stay
19
+ * theme-agnostic and know nothing about VS Code. Where a value needs to vary
20
+ * per theme, expose a local `--md-*` custom property WITH a sensible literal
21
+ * fallback (e.g. `var(--md-cursor-background, #000)`) and let a theme file set
22
+ * it. Only the `themes/vscode-*.css` themes are permitted to read `--vscode-*`
23
+ * variables and map them onto these `--md-*` properties.
15
24
  */
16
25
 
17
26
  .md-editor {
27
+ display: flow-root;
18
28
  outline: none;
19
29
  /* The editor paints its own cursor (`.md-cursor`); hide the native caret. */
20
30
  caret-color: transparent;
21
31
  }
22
32
 
33
+ /*
34
+ * The transient empty paragraph — the blank line conjured by pressing Enter at
35
+ * the end of a paragraph (see `PendingParagraph` in the model). It is not part
36
+ * of the document (Markdown has no empty-paragraph node); it holds a single
37
+ * `<br>` so it occupies one line's height, and the caret is painted over it.
38
+ */
39
+ .md-pending-paragraph {
40
+ min-height: 1em;
41
+ }
42
+
23
43
  /*
24
44
  * Inner content container. Holds the rendered document and the cursor/selection
25
45
  * overlays, which position themselves relative to this box, so it is the
26
46
  * positioning context. In limited-width mode the editor sets an inline
27
47
  * `max-width` here and the auto inline margins center it within the full-width
28
- * `.md-editor`.
48
+ * `.md-editor`. The block-start padding keeps every document clear of the top
49
+ * edge, independent of the first block's theme margins.
29
50
  */
30
51
  .md-editor-content {
52
+ --md-editor-content-inline-start-padding: 48px;
53
+ --md-readonly-toggle-width: 58px;
54
+ --md-readonly-toggle-height: 32px;
55
+ /* Leaves 16px of optical separation beyond the active block's 8px outset glow. */
56
+ --md-readonly-toggle-gap: 24px;
57
+ --md-readonly-toggle-inset: 4px;
58
+ --md-editor-content-inline-end-padding: var(--md-editor-content-inline-start-padding);
31
59
  position: relative;
32
60
  margin-inline: auto;
33
- padding: 48px;
61
+ padding-block: 24px 0;
62
+ padding-inline: var(--md-editor-content-inline-start-padding) var(--md-editor-content-inline-end-padding);
63
+ }
64
+
65
+ .md-editor-content-with-readonly-toggle {
66
+ --md-editor-content-inline-end-padding: calc(var(--md-readonly-toggle-width) + var(--md-readonly-toggle-gap) + var(--md-readonly-toggle-inset));
67
+ }
68
+
69
+ .md-editor-content-with-readonly-toggle>.md-document :is(.md-heading, .md-paragraph) {
70
+ overflow-wrap: anywhere;
34
71
  }
35
72
 
36
73
  .md-block-active {
37
- background: #f8f8f8;
74
+ background: var(--md-block-active-background, #f8f8f8);
38
75
  border-radius: 4px;
39
- box-shadow: 0 0 0 8px #f8f8f8;
76
+ box-shadow: 0 0 0 8px var(--md-block-active-background, #f8f8f8);
40
77
  }
41
78
 
42
79
  /*
43
- * A rendered (inactive) link opens on a plain click, so it keeps the anchor's
44
- * pointer cursor. Once its block is active the link is editable source and a
45
- * plain click places the caret (Ctrl/Cmd+click still opens), so it shows the
46
- * normal editing cursor like the surrounding text.
80
+ * The whole-empty-document case. Markdown has no empty-paragraph node, so a
81
+ * document with no content parses to a single empty paragraph (see
82
+ * `_ensureBlocks` in the parser) which renders as a childless `<p>` of zero
83
+ * height. Give it one line's height so the editor presents an intentional,
84
+ * clickable empty editing surface — and so typing the first character causes no
85
+ * layout shift (a filled line is also one `lh` tall).
86
+ */
87
+ .md-paragraph:empty {
88
+ min-height: 1lh;
89
+ }
90
+
91
+ /*
92
+ * ...and never paint the active-block card over that zero-content line: with no
93
+ * text to size it, the card's background + 8px box-shadow glow would show up as
94
+ * a stray gray bar. The two extra classes outrank the base `.md-block-active`
95
+ * rule above in every theme (themes only remap `--md-block-active-background`).
96
+ */
97
+ .md-paragraph:empty.md-block-active {
98
+ background: transparent;
99
+ box-shadow: none;
100
+ }
101
+
102
+ /*
103
+ * Cursor mirrors the same open affordance as the underline below: the anchor's
104
+ * pointer cursor appears exactly when a click would open the link. An inactive
105
+ * (rendered) link opens on a plain click, so it keeps the browser's default
106
+ * anchor pointer. Once its block is active a plain click places the caret, so
107
+ * the link shows the normal editing cursor — except while Ctrl/Cmd is held
108
+ * (`.md-mod-down`), when a click opens it and the pointer returns.
47
109
  */
48
110
  .md-block-active a {
49
111
  cursor: inherit;
50
112
  }
51
113
 
114
+ .md-editor.md-mod-down .md-block-active a[href] {
115
+ cursor: pointer;
116
+ }
117
+
118
+ /*
119
+ * Link underline is an "open affordance": show it only while a click on the
120
+ * link right now would actually open it. An inactive (rendered) link opens on
121
+ * a plain click, so hovering it underlines. An active link's plain click edits
122
+ * its source — it only opens with Ctrl/Cmd — so it underlines on hover only
123
+ * while that modifier is held (`.md-mod-down`, set live by the view).
124
+ */
125
+ .md-editor a[href]:hover {
126
+ text-decoration: underline;
127
+ }
128
+
129
+ .md-editor:not(.md-mod-down) .md-block-active a[href]:hover {
130
+ text-decoration: none;
131
+ }
132
+
52
133
  .md-fence-spacer {
53
134
  visibility: hidden;
54
135
  font-family: 'Cascadia Code', 'Fira Code', monospace;
@@ -84,6 +165,33 @@
84
165
  white-space: pre-wrap;
85
166
  }
86
167
 
168
+ /*
169
+ * An unhandled block: a construct the parser does not model (setext heading,
170
+ * an extension token). Its raw source is shown verbatim,
171
+ * styled like a code block but visibly flagged as "not understood" by a dashed
172
+ * warning border, so the content is preserved and editable rather than silently
173
+ * dropped.
174
+ *
175
+ * The wrapper is the non-scrolling box (border + block spacing); the inner
176
+ * `.md-unhandled-scroll` <pre> is the horizontal scroller.
177
+ */
178
+ .md-unhandled-block {
179
+ margin: 0.5em 0;
180
+ border: 1px dashed #d0a000;
181
+ border-radius: 4px;
182
+ }
183
+
184
+ /*
185
+ * Inner scroller. Beats the per-theme `.md-theme-* .md-code-block` box rules
186
+ * (same class count) via the extra `pre` type selector: no margin/border of its
187
+ * own (those live on the wrapper).
188
+ */
189
+ pre.md-unhandled-scroll.md-code-block {
190
+ margin: 0;
191
+ border: 0;
192
+ border-radius: 4px;
193
+ }
194
+
87
195
  /*
88
196
  * Visible whitespace indicators, shown only in the active/source view. The real
89
197
  * whitespace character stays in the DOM (so source ↔ DOM mapping and selection
@@ -183,15 +291,61 @@
183
291
  }
184
292
 
185
293
  /*
186
- * Glue (table cell pipes, the task `[x] ` source, source padding) keeps its
187
- * inline footprint when hidden so column widths and the checkbox gutter stay
188
- * identical between active and inactive states.
294
+ * Glue normally keeps its inline footprint when hidden so source padding and
295
+ * widget gutters stay identical between active and inactive states. Hidden
296
+ * table-cell glue is the exception below: leaving it in inline flow lets its
297
+ * invisible spaces wrap around long cell content.
189
298
  */
190
299
  .md-glue-hidden {
191
300
  display: inline;
192
301
  visibility: hidden;
193
302
  }
194
303
 
304
+ /*
305
+ * Inactive table pipes stay in the DOM/source tree, but leave layout and
306
+ * hit-testing entirely. Keeping an invisible rect either in the content flow or
307
+ * over the cell padding can create phantom lines or steal clicks from visible
308
+ * text. Hidden source offsets therefore collapse to the neighboring semantic
309
+ * seam, matching other display-none markers. Visible pipes retain the per-theme
310
+ * active/source layout.
311
+ */
312
+ .md-table td>.md-glue-tableCellGlue.md-glue-hidden {
313
+ display: none;
314
+ }
315
+
316
+ /*
317
+ * Active table: take each cell's TRAILING structural glue (the source space
318
+ * after the cell text, and — via the per-theme `right: 0` rule — the last
319
+ * column's closing `|`) out of the cell's inline flow. Left in flow, that glue
320
+ * wraps below long cell content (the same wrapping the hidden-glue note above
321
+ * describes), which makes the cell two lines tall: the browser's default
322
+ * `vertical-align: middle` then re-centres the other cells' single-line content
323
+ * in Y, their runs merge into one oversized VisualLine, and the caret — sized
324
+ * directly from that line box — grows far past the line height while the
325
+ * visible pipes drift apart row-to-row. Positioning the trailing glue
326
+ * absolutely removes it from wrapping flow while keeping its real client rects
327
+ * at the static (content-line) position, so caret placement, hit-testing,
328
+ * source mapping and injectivity are unchanged. `top`/`bottom: auto` keep it on
329
+ * that content line rather than the cell's top edge. This mirrors the inactive
330
+ * `display: none` above; the leading `| ` glue deliberately stays in flow (a
331
+ * relative glyph shift, per theme) so first-text X is preserved.
332
+ *
333
+ * `:not(:first-child)` restricts this to a genuine trailing glue: a non-empty
334
+ * cell emits leading + trailing glue, but an EMPTY cell parses to a single glue
335
+ * node that is simultaneously first and last child. That lone node is the
336
+ * cell's leading pipe, so it must stay in flow like every other leading pipe;
337
+ * excluding it keeps empty cells identical to their previous (base) behaviour.
338
+ */
339
+ .md-table.md-block-active td {
340
+ position: relative;
341
+ }
342
+
343
+ .md-table.md-block-active td>.md-glue-tableCellGlue:last-child:not(:first-child) {
344
+ position: absolute;
345
+ top: auto;
346
+ bottom: auto;
347
+ }
348
+
195
349
  /*
196
350
  * Inter-block glue: the run of blank lines between two top-level blocks. It is
197
351
  * mounted as the last inline child of the block that precedes it, so it sits at
@@ -228,15 +382,6 @@
228
382
  visibility: hidden;
229
383
  }
230
384
 
231
- /*
232
- * Table cell-glue pipes (`| `) keep their inline footprint when hidden so the
233
- * column widths stay identical active and inactive.
234
- */
235
- .md-marker-tableCellGlue.md-marker-hidden {
236
- display: inline;
237
- visibility: hidden;
238
- }
239
-
240
385
  /*
241
386
  * The code-block fences (```lang / ```) each sit on their own source line. When
242
387
  * hidden they keep their vertical footprint (visibility hidden, not display
@@ -271,6 +416,48 @@
271
416
  height: 16px;
272
417
  }
273
418
 
419
+ /*
420
+ * A wide table scrolls horizontally inside its wrapper (the block box) instead
421
+ * of overflowing the page and scrolling the editor's fixed left gutter away.
422
+ * The wrapper is the scroll viewport the selection/caret clipping measures (see
423
+ * `BlockViewNode.scrollElement` / `blockViewportClip`); the inner `<table>`
424
+ * keeps `width: auto` (theme-defined) so it sizes to its content and overflows.
425
+ *
426
+ * `width: fit-content` keeps the wrapper hugging the table's intrinsic width, so
427
+ * a narrow table — and the active-block glow redirected onto the wrapper below —
428
+ * stays as wide as the table (unchanged from before this wrapper existed).
429
+ * `max-width: 100%` caps it at the content column, past which the table
430
+ * overflows and scrolls locally. This is the standard responsive-table pattern
431
+ * (cf. GitHub's own `width: max-content; max-width: 100%`).
432
+ */
433
+ .md-table-wrapper {
434
+ overflow-x: auto;
435
+ width: fit-content;
436
+ max-width: 100%;
437
+ }
438
+
439
+ /*
440
+ * The active-block highlight is an *outset* glow (`box-shadow: 0 0 0 8px`).
441
+ * Making the wrapper a scroll box (`overflow-x: auto`, which also forces
442
+ * `overflow-y: auto`) clips descendant paint to its padding box, so the glow on
443
+ * the inner active `<table>` would be cut off (the table has no horizontal
444
+ * margin to give the shadow room). Render the generic active chrome on the
445
+ * wrapper instead — a scroll box's own shadow is never clipped by its own
446
+ * overflow, exactly like a code block carries the glow on its own scroller —
447
+ * and drop it from the table, which keeps `md-block-active` purely for the
448
+ * per-theme source-pipe styling.
449
+ */
450
+ .md-table-wrapper:has(> .md-table.md-block-active) {
451
+ background: var(--md-block-active-background, #f8f8f8);
452
+ border-radius: 4px;
453
+ box-shadow: 0 0 0 8px var(--md-block-active-background, #f8f8f8);
454
+ }
455
+
456
+ .md-table.md-block-active {
457
+ background: none;
458
+ box-shadow: none;
459
+ }
460
+
274
461
  .md-selection-layer {
275
462
  position: absolute;
276
463
  top: 0;
@@ -285,6 +472,54 @@
285
472
  fill: rgba(59, 130, 246, 0.25);
286
473
  }
287
474
 
475
+ /*
476
+ * Gutter markers (source-control style change indicators). The layer fills the
477
+ * content box; each marker is an absolutely-positioned bar pinned to the left
478
+ * gutter (inside `.md-editor-content`'s 48px padding). The view sets only
479
+ * `top`/`height`; horizontal placement, width and color live here so themes can
480
+ * tune them without touching layout. Like the other overlays it never eats
481
+ * pointer events.
482
+ */
483
+ .md-gutter-layer {
484
+ position: absolute;
485
+ top: 0;
486
+ left: 0;
487
+ width: 100%;
488
+ height: 100%;
489
+ pointer-events: none;
490
+ overflow: visible;
491
+ }
492
+
493
+ .md-gutter-marker {
494
+ position: absolute;
495
+ left: var(--md-gutter-marker-left, 18px);
496
+ width: var(--md-gutter-marker-width, 3px);
497
+ border-radius: 2px;
498
+ }
499
+
500
+ .md-gutter-marker-added {
501
+ background: var(--md-gutter-added, #2ea043);
502
+ }
503
+
504
+ .md-gutter-marker-modified {
505
+ background: var(--md-gutter-modified, #0969da);
506
+ }
507
+
508
+ /*
509
+ * A deletion has no lines to span, so it is drawn as a downward-pointing
510
+ * triangle centered on the seam where the removed text used to be (the top of
511
+ * the line that now follows it), matching the git deleted-lines affordance.
512
+ */
513
+ .md-gutter-marker-deleted {
514
+ width: 0;
515
+ height: 0;
516
+ border-radius: 0;
517
+ border-left: var(--md-gutter-marker-width, 3px) solid var(--md-gutter-deleted, #cf222e);
518
+ border-top: 4px solid transparent;
519
+ border-bottom: 4px solid transparent;
520
+ transform: translateY(-4px);
521
+ }
522
+
288
523
  /* Source markers occupy the gutter so toggling them never shifts content. */
289
524
  .md-heading {
290
525
  position: relative;
@@ -437,6 +672,16 @@
437
672
  white-space: pre;
438
673
  }
439
674
 
675
+ /*
676
+ * A continuation-line indent inside a paragraph is source-only padding. When
677
+ * inactive, the preceding soft-break newline already collapses to the single
678
+ * rendered space Markdown requires; retaining the hidden indent would add the
679
+ * tab/space run's width on top of it.
680
+ */
681
+ .md-paragraph>.md-glue-indent.md-glue-hidden {
682
+ display: none;
683
+ }
684
+
440
685
  /*
441
686
  * A loose list item's later block (its second paragraph etc.) owns the source
442
687
  * continuation indent that precedes it as its `leadingTrivia`. Like a nested
@@ -540,11 +785,43 @@
540
785
  .md-cursor {
541
786
  position: absolute;
542
787
  width: 2px;
543
- background: #000;
788
+ background: var(--md-cursor-background, #000);
544
789
  pointer-events: none;
790
+ }
791
+
792
+ /*
793
+ * The painted caret is only shown while the editor is genuinely focused — focus
794
+ * rests inside it and its window is focused, mirrored onto the root as
795
+ * `.md-focused`. When unfocused, hide the caret element but keep its layout box
796
+ * (so caret geometry, selection and comment anchoring are unchanged) and stop
797
+ * the blink. Adding the animation on focus restarts it from 0% (a solid caret).
798
+ */
799
+ .md-editor:not(.md-focused) .md-cursor {
800
+ visibility: hidden;
801
+ }
802
+
803
+ .md-editor.md-focused .md-cursor {
545
804
  animation: md-cursor-blink 1s step-end infinite;
546
805
  }
547
806
 
807
+ /*
808
+ * Read-only mode retains the logical caret for selection and comment anchoring.
809
+ * Hide only its painted element so unlocking can restore it in place.
810
+ */
811
+ .md-editor.md-readonly .md-cursor {
812
+ visibility: hidden;
813
+ }
814
+
815
+ .md-editor.md-readonly-editing-attempt {
816
+ animation: md-readonly-editing-attempt 300ms ease-out;
817
+ }
818
+
819
+ @keyframes md-readonly-editing-attempt {
820
+ 50% {
821
+ box-shadow: inset 0 0 0 2px var(--md-readonly-shine-glow, rgba(255, 255, 255, 0.58));
822
+ }
823
+ }
824
+
548
825
  @keyframes md-cursor-blink {
549
826
 
550
827
  0%,
@@ -555,4 +832,201 @@
555
832
  50% {
556
833
  opacity: 0;
557
834
  }
835
+ }
836
+
837
+ /*
838
+ * Edit / read-only lock toggle.
839
+ *
840
+ * The asymmetric content padding reserves a real rail for the control:
841
+ * button width + gap + edge inset. The zero-height sticky host spans the
842
+ * document column and that rail, keeping the button beside (never over) the
843
+ * rendered document as it scrolls. Colors use local `--md-readonly-*` custom
844
+ * properties with literal fallbacks so this base file stays theme-agnostic
845
+ * (themes may override them).
846
+ */
847
+ .md-readonly-toggle-host {
848
+ position: sticky;
849
+ top: 0;
850
+ width: calc(100% + var(--md-editor-content-inline-end-padding));
851
+ height: 0;
852
+ z-index: 10;
853
+ pointer-events: none;
854
+ }
855
+
856
+ .md-readonly-toggle {
857
+ position: absolute;
858
+ top: 4px;
859
+ right: var(--md-readonly-toggle-inset);
860
+ pointer-events: auto;
861
+ display: inline-grid;
862
+ grid-template-columns: repeat(2, 24px);
863
+ align-items: center;
864
+ justify-items: center;
865
+ gap: 2px;
866
+ box-sizing: border-box;
867
+ width: var(--md-readonly-toggle-width);
868
+ height: var(--md-readonly-toggle-height);
869
+ padding: 3px;
870
+ overflow: hidden;
871
+ direction: ltr;
872
+ appearance: none;
873
+ border-radius: 999px;
874
+ border: 1px solid var(--md-readonly-border, #b8b8b8);
875
+ background: var(--md-readonly-background, #f3f3f3);
876
+ color: var(--md-readonly-foreground, #444444);
877
+ font-size: 16px;
878
+ line-height: 1;
879
+ cursor: pointer;
880
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
881
+ transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
882
+ }
883
+
884
+ /*
885
+ * Below this width there is not enough document column for the side rail to be
886
+ * useful. Give the host its own row and stop it from sticking, so neither long
887
+ * unbreakable content nor later content scrolled through the viewport can ever
888
+ * pass underneath the button.
889
+ */
890
+ .md-editor-narrow .md-readonly-toggle-host {
891
+ position: relative;
892
+ height: calc(var(--md-readonly-toggle-height) + var(--md-readonly-toggle-inset) + var(--md-readonly-toggle-inset));
893
+ }
894
+
895
+ .md-readonly-toggle::after {
896
+ content: '';
897
+ position: absolute;
898
+ z-index: 2;
899
+ top: -8px;
900
+ bottom: -8px;
901
+ left: -30px;
902
+ width: 24px;
903
+ background: linear-gradient(90deg,
904
+ transparent,
905
+ var(--md-readonly-shine-edge, rgba(255, 255, 255, 0.16)) 24%,
906
+ var(--md-readonly-shine, #ffffff) 50%,
907
+ var(--md-readonly-shine-edge, rgba(255, 255, 255, 0.16)) 76%,
908
+ transparent);
909
+ box-shadow: 0 0 8px 2px var(--md-readonly-shine-glow, rgba(255, 255, 255, 0.58));
910
+ opacity: 0;
911
+ pointer-events: none;
912
+ transform: skewX(-20deg);
913
+ }
914
+
915
+ .md-readonly-toggle.md-readonly-toggle-shine::after {
916
+ animation: md-readonly-toggle-shine 2s linear;
917
+ will-change: transform, opacity;
918
+ }
919
+
920
+ @keyframes md-readonly-toggle-shine {
921
+ 0% {
922
+ opacity: 0;
923
+ transform: translateX(0) skewX(-20deg);
924
+ }
925
+
926
+ 12%,
927
+ 88% {
928
+ opacity: 1;
929
+ }
930
+
931
+ 100% {
932
+ opacity: 0;
933
+ transform: translateX(122px) skewX(-20deg);
934
+ }
935
+ }
936
+
937
+ .md-readonly-toggle:hover {
938
+ border-color: var(--md-readonly-border-hover, #8d8d8d);
939
+ background: var(--md-readonly-background-hover, #e9e9e9);
940
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(0, 0, 0, 0.1);
941
+ }
942
+
943
+ .md-readonly-toggle:focus-visible {
944
+ outline: 2px solid var(--md-readonly-accent, #4c8bf5);
945
+ outline-offset: 1px;
946
+ }
947
+
948
+ .md-readonly-toggle .md-readonly-toggle-indicator {
949
+ position: absolute;
950
+ top: 50%;
951
+ left: 3px;
952
+ width: 24px;
953
+ height: 24px;
954
+ border-radius: 50%;
955
+ background: var(--md-readonly-accent, #4c8bf5);
956
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.25);
957
+ transform: translate(26px, -50%);
958
+ transition: background-color 0.12s ease, transform 0.16s ease;
959
+ }
960
+
961
+ .md-readonly-toggle .md-readonly-toggle-icon {
962
+ position: relative;
963
+ z-index: 1;
964
+ display: block;
965
+ width: 16px;
966
+ height: 16px;
967
+ color: var(--md-readonly-foreground, #444444);
968
+ opacity: 0.62;
969
+ pointer-events: none;
970
+ transition: color 0.12s ease, opacity 0.12s ease;
971
+ }
972
+
973
+ .md-readonly-toggle:not(.md-readonly-toggle-locked) .md-readonly-toggle-icon-editing,
974
+ .md-readonly-toggle.md-readonly-toggle-locked .md-readonly-toggle-icon-locked {
975
+ color: var(--md-readonly-accent-foreground, #ffffff);
976
+ opacity: 1;
977
+ }
978
+
979
+ .md-readonly-toggle.md-readonly-toggle-locked .md-readonly-toggle-indicator {
980
+ transform: translate(0, -50%);
981
+ }
982
+
983
+ @media (prefers-reduced-motion: reduce) {
984
+
985
+ .md-editor.md-readonly-editing-attempt,
986
+ .md-readonly-toggle,
987
+ .md-readonly-toggle .md-readonly-toggle-indicator,
988
+ .md-readonly-toggle .md-readonly-toggle-icon,
989
+ .md-readonly-toggle.md-readonly-toggle-shine::after {
990
+ animation: none;
991
+ transition: none;
992
+ }
993
+ }
994
+
995
+ @media (forced-colors: active) {
996
+ .md-readonly-toggle {
997
+ forced-color-adjust: none;
998
+ border-color: ButtonText;
999
+ background: ButtonFace;
1000
+ color: ButtonText;
1001
+ box-shadow: none;
1002
+ }
1003
+
1004
+ .md-readonly-toggle::after {
1005
+ display: none;
1006
+ }
1007
+
1008
+ .md-readonly-toggle:hover {
1009
+ border-color: Highlight;
1010
+ background: ButtonFace;
1011
+ box-shadow: none;
1012
+ }
1013
+
1014
+ .md-readonly-toggle:focus-visible {
1015
+ outline-color: Highlight;
1016
+ }
1017
+
1018
+ .md-readonly-toggle .md-readonly-toggle-indicator {
1019
+ background: Highlight;
1020
+ box-shadow: none;
1021
+ }
1022
+
1023
+ .md-readonly-toggle .md-readonly-toggle-icon {
1024
+ color: ButtonText;
1025
+ opacity: 1;
1026
+ }
1027
+
1028
+ .md-readonly-toggle:not(.md-readonly-toggle-locked) .md-readonly-toggle-icon-editing,
1029
+ .md-readonly-toggle.md-readonly-toggle-locked .md-readonly-toggle-icon-locked {
1030
+ color: HighlightText;
1031
+ }
558
1032
  }
@@ -121,9 +121,14 @@
121
121
  --md-list-indent-step: 24px;
122
122
  }
123
123
 
124
+ .md-theme-default .md-table-wrapper {
125
+ /* Block spacing lives on the wrapper (the scroll/BFC box) so it collapses
126
+ with siblings as before; the inner table has no margin of its own. */
127
+ margin: 0.5em 0;
128
+ }
129
+
124
130
  .md-theme-default .md-table {
125
131
  border-collapse: collapse;
126
- margin: 0.5em 0;
127
132
  width: auto;
128
133
  }
129
134
 
@@ -201,6 +206,9 @@
201
206
  * box) so the right outline is a straight line. Absolute removes it from flow,
202
207
  * but it is the trailing node so no text shifts; the leading pipe still fixes
203
208
  * first-text X and the row stays one line tall, keeping the compare invariants.
209
+ * `top: auto` keeps the pipe on the content line (the shared editor.css rule
210
+ * also takes trailing glue out of flow); the previous `top: 0` floated it to
211
+ * the cell's top edge, misaligning it with the leading pipes on wrapping rows.
204
212
  */
205
213
  .md-theme-default .md-table.md-block-active td:last-child {
206
214
  position: relative;
@@ -209,7 +217,7 @@
209
217
  .md-theme-default .md-table.md-block-active td:last-child>.md-glue-tableCellGlue:last-child {
210
218
  position: absolute;
211
219
  right: 0;
212
- top: 0;
220
+ top: auto;
213
221
  }
214
222
 
215
223
  /*
@@ -220,7 +228,7 @@
220
228
  .md-theme-default .md-table.md-block-active .md-table-delimiter-row td:last-child>.md-marker-tableDelimiterClose {
221
229
  position: absolute;
222
230
  right: 0;
223
- top: 0;
231
+ top: auto;
224
232
  }
225
233
 
226
234
  .md-theme-default code {