@vscode/markdown-editor 0.0.2-14 → 0.0.2-16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/markdown-editor",
3
- "version": "0.0.2-14",
3
+ "version": "0.0.2-16",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -53,6 +53,7 @@
53
53
  "test:e2e": "playwright test"
54
54
  },
55
55
  "dependencies": {
56
+ "@vscode/codicons": "^0.0.45",
56
57
  "@vscode/diff": "0.0.2-0",
57
58
  "katex": "^0.16.33",
58
59
  "micromark": "^4.0.1",
@@ -28,11 +28,12 @@
28
28
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.14);
29
29
  font-family: var(--vscode-font-family, system-ui, sans-serif);
30
30
  font-size: 13px;
31
+ animation: md-comment-input-appear 150ms ease-out;
31
32
  }
32
33
 
33
34
  .md-comment-input-textarea {
34
35
  flex: 1 1 auto;
35
- min-width: 150px;
36
+ min-width: 0;
36
37
  max-width: 400px;
37
38
  margin: 0;
38
39
  padding: 0 0 0 6px;
@@ -57,6 +58,24 @@
57
58
  caret-color: var(--vscode-editorCursor-foreground, currentColor);
58
59
  }
59
60
 
61
+ @keyframes md-comment-input-appear {
62
+ from {
63
+ opacity: 0;
64
+ transform: translateY(4px);
65
+ }
66
+
67
+ to {
68
+ opacity: 1;
69
+ transform: translateY(0);
70
+ }
71
+ }
72
+
73
+ @media (prefers-reduced-motion: reduce) {
74
+ .md-comment-input {
75
+ animation: none;
76
+ }
77
+ }
78
+
60
79
  .md-comment-input-textarea:focus {
61
80
  border-color: var(--vscode-focusBorder, #0078d4);
62
81
  outline: none !important;
@@ -1,3 +1,5 @@
1
+ @import '@vscode/codicons/dist/codicon.css';
2
+
1
3
  /*
2
4
  * Base editor styles — ABSOLUTE MINIMUM.
3
5
  *
@@ -22,6 +24,7 @@
22
24
  */
23
25
 
24
26
  .md-editor {
27
+ display: flow-root;
25
28
  outline: none;
26
29
  /* The editor paints its own cursor (`.md-cursor`); hide the native caret. */
27
30
  caret-color: transparent;
@@ -122,6 +125,55 @@
122
125
  white-space: pre-wrap;
123
126
  }
124
127
 
128
+ /*
129
+ * An unhandled block: a construct the parser does not model (setext heading,
130
+ * frontmatter fence, an extension token). Its raw source is shown verbatim,
131
+ * styled like a code block but visibly flagged as "not understood" — a dashed
132
+ * warning border and a small badge naming the originating token type (from the
133
+ * `data-unhandled-token` attribute) — so the content is preserved and editable
134
+ * rather than silently dropped.
135
+ *
136
+ * The wrapper is the non-scrolling box (border + block spacing + the badge); the
137
+ * inner `.md-unhandled-scroll` <pre> is the horizontal scroller. Keeping the
138
+ * badge on the wrapper (not the scroller) pins it to the visible top-right
139
+ * corner instead of letting it drift with the scrolled content.
140
+ */
141
+ .md-unhandled-block {
142
+ position: relative;
143
+ margin: 0.5em 0;
144
+ border: 1px dashed #d0a000;
145
+ border-radius: 4px;
146
+ }
147
+
148
+ /*
149
+ * Inner scroller. Beats the per-theme `.md-theme-* .md-code-block` box rules
150
+ * (same class count) via the extra `pre` type selector: no margin/border of its
151
+ * own (those live on the wrapper), and top padding that reserves room for the
152
+ * pinned badge so it never overlaps the first source line.
153
+ */
154
+ pre.md-unhandled-scroll.md-code-block {
155
+ margin: 0;
156
+ border: 0;
157
+ border-radius: 4px;
158
+ padding-top: 1.7em;
159
+ }
160
+
161
+ .md-unhandled-block::after {
162
+ content: 'unhandled: ' attr(data-unhandled-token);
163
+ position: absolute;
164
+ top: 0;
165
+ right: 0;
166
+ padding: 1px 6px;
167
+ font-family: system-ui, sans-serif;
168
+ font-size: 10px;
169
+ line-height: 1.4;
170
+ color: #6b5200;
171
+ background: #f5e5a8;
172
+ border-bottom-left-radius: 4px;
173
+ pointer-events: none;
174
+ user-select: none;
175
+ }
176
+
125
177
  /*
126
178
  * Visible whitespace indicators, shown only in the active/source view. The real
127
179
  * whitespace character stays in the DOM (so source ↔ DOM mapping and selection
@@ -662,22 +714,21 @@
662
714
 
663
715
  .md-readonly-toggle {
664
716
  position: absolute;
665
- top: 8px;
666
- right: 8px;
717
+ top: 4px;
718
+ right: 4px;
667
719
  pointer-events: auto;
668
720
  display: inline-flex;
669
721
  align-items: center;
670
- gap: 5px;
671
- height: 26px;
672
- padding: 0 10px;
673
- border-radius: 13px;
722
+ gap: 6px;
723
+ padding: 4px 8px;
724
+ border-radius: 999px;
674
725
  border: 1px solid var(--md-readonly-border, #d4d4d4);
675
726
  background: var(--md-readonly-background, #ffffff);
676
727
  color: var(--md-readonly-foreground, #444);
677
- font: 600 11px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
728
+ font: 600 12px / 1 system-ui, -apple-system, 'Segoe UI', sans-serif;
678
729
  letter-spacing: 0.02em;
679
730
  cursor: pointer;
680
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
731
+ box-shadow: 0 0 12px rgba(0, 0, 0, 0.14);
681
732
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
682
733
  }
683
734