@vscode/markdown-editor 0.0.2-30 → 0.0.2-32
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/dist/index.d.ts +43 -7
- package/dist/index.js +1346 -1189
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/view/editor.css +63 -2
- package/src/view/themes/vscode-default.css +7 -3
- package/src/view/themes/vscode-github.css +8 -1
package/package.json
CHANGED
package/src/view/editor.css
CHANGED
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
* overlays, which position themselves relative to this box, so it is the
|
|
46
46
|
* positioning context. In limited-width mode the editor sets an inline
|
|
47
47
|
* `max-width` here and the auto inline margins center it within the full-width
|
|
48
|
-
* `.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.
|
|
49
50
|
*/
|
|
50
51
|
.md-editor-content {
|
|
51
52
|
--md-editor-content-inline-start-padding: 48px;
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
--md-editor-content-inline-end-padding: var(--md-editor-content-inline-start-padding);
|
|
58
59
|
position: relative;
|
|
59
60
|
margin-inline: auto;
|
|
60
|
-
padding-block: 0;
|
|
61
|
+
padding-block: 24px 0;
|
|
61
62
|
padding-inline: var(--md-editor-content-inline-start-padding) var(--md-editor-content-inline-end-padding);
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -815,6 +816,52 @@ pre.md-unhandled-scroll.md-code-block {
|
|
|
815
816
|
animation: md-readonly-editing-attempt 300ms ease-out;
|
|
816
817
|
}
|
|
817
818
|
|
|
819
|
+
.md-readonly-edit-at {
|
|
820
|
+
position: absolute;
|
|
821
|
+
z-index: 20;
|
|
822
|
+
display: inline-flex;
|
|
823
|
+
align-items: center;
|
|
824
|
+
gap: 4px;
|
|
825
|
+
box-sizing: border-box;
|
|
826
|
+
min-height: 26px;
|
|
827
|
+
padding: 4px 9px 4px 7px;
|
|
828
|
+
white-space: nowrap;
|
|
829
|
+
appearance: none;
|
|
830
|
+
border: 1px solid var(--md-readonly-accent, #4c8bf5);
|
|
831
|
+
border-radius: 999px;
|
|
832
|
+
background: var(--md-readonly-accent, #4c8bf5);
|
|
833
|
+
color: var(--md-readonly-accent-foreground, #ffffff);
|
|
834
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
|
|
835
|
+
font: 600 12px/1 system-ui, sans-serif;
|
|
836
|
+
cursor: pointer;
|
|
837
|
+
animation: md-readonly-edit-at-appear 120ms ease-out;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.md-readonly-edit-at[hidden] {
|
|
841
|
+
display: none;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.md-readonly-edit-at:hover {
|
|
845
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
|
|
846
|
+
filter: brightness(1.08);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.md-readonly-edit-at:focus-visible {
|
|
850
|
+
outline: 2px solid var(--md-readonly-accent, #4c8bf5);
|
|
851
|
+
outline-offset: 2px;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.md-readonly-edit-at .codicon {
|
|
855
|
+
font-size: 14px;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
@keyframes md-readonly-edit-at-appear {
|
|
859
|
+
from {
|
|
860
|
+
opacity: 0;
|
|
861
|
+
transform: translateY(-2px) scale(0.96);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
818
865
|
@keyframes md-readonly-editing-attempt {
|
|
819
866
|
50% {
|
|
820
867
|
box-shadow: inset 0 0 0 2px var(--md-readonly-shine-glow, rgba(255, 255, 255, 0.58));
|
|
@@ -982,6 +1029,7 @@ pre.md-unhandled-scroll.md-code-block {
|
|
|
982
1029
|
@media (prefers-reduced-motion: reduce) {
|
|
983
1030
|
|
|
984
1031
|
.md-editor.md-readonly-editing-attempt,
|
|
1032
|
+
.md-readonly-edit-at,
|
|
985
1033
|
.md-readonly-toggle,
|
|
986
1034
|
.md-readonly-toggle .md-readonly-toggle-indicator,
|
|
987
1035
|
.md-readonly-toggle .md-readonly-toggle-icon,
|
|
@@ -992,6 +1040,19 @@ pre.md-unhandled-scroll.md-code-block {
|
|
|
992
1040
|
}
|
|
993
1041
|
|
|
994
1042
|
@media (forced-colors: active) {
|
|
1043
|
+
.md-readonly-edit-at {
|
|
1044
|
+
forced-color-adjust: none;
|
|
1045
|
+
border-color: Highlight;
|
|
1046
|
+
background: Highlight;
|
|
1047
|
+
color: HighlightText;
|
|
1048
|
+
box-shadow: none;
|
|
1049
|
+
filter: none;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.md-readonly-edit-at:focus-visible {
|
|
1053
|
+
outline-color: Highlight;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
995
1056
|
.md-readonly-toggle {
|
|
996
1057
|
forced-color-adjust: none;
|
|
997
1058
|
border-color: ButtonText;
|
|
@@ -53,11 +53,14 @@
|
|
|
53
53
|
--md-readonly-accent-foreground: var(--vscode-button-foreground, #fff);
|
|
54
54
|
--md-separator-color: color-mix(in srgb,
|
|
55
55
|
var(--vscode-textSeparator-foreground, #d1d9e0) 60%, transparent);
|
|
56
|
+
--md-inline-code-background: color-mix(in srgb,
|
|
57
|
+
var(--vscode-textPreformat-background, #818b981f) 60%, transparent);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
.vscode-high-contrast .md-editor.md-theme-vscode-default,
|
|
59
61
|
.vscode-high-contrast-light .md-editor.md-theme-vscode-default {
|
|
60
62
|
--md-separator-color: var(--vscode-textSeparator-foreground, currentColor);
|
|
63
|
+
--md-inline-code-background: var(--vscode-textPreformat-background, #818b981f);
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
.md-theme-vscode-default .md-heading {
|
|
@@ -150,8 +153,9 @@
|
|
|
150
153
|
}
|
|
151
154
|
|
|
152
155
|
/*
|
|
153
|
-
* Inline code. Preview keeps inline code at the body font size (1em) on
|
|
154
|
-
* Code preformat surface, with only a small inset — no GitHub-style
|
|
156
|
+
* Inline code. Preview keeps inline code at the body font size (1em) on a
|
|
157
|
+
* softened VS Code preformat surface, with only a small inset — no GitHub-style
|
|
158
|
+
* badge.
|
|
155
159
|
*/
|
|
156
160
|
.md-theme-vscode-default :not(pre)>code {
|
|
157
161
|
font-family: var(--vscode-editor-font-family, ui-monospace, SFMono-Regular,
|
|
@@ -161,7 +165,7 @@
|
|
|
161
165
|
padding: 1px 3px;
|
|
162
166
|
margin: 0;
|
|
163
167
|
color: var(--vscode-textPreformat-foreground, inherit);
|
|
164
|
-
background-color: var(--
|
|
168
|
+
background-color: var(--md-inline-code-background);
|
|
165
169
|
border-radius: 4px;
|
|
166
170
|
white-space: break-spaces;
|
|
167
171
|
}
|
|
@@ -60,6 +60,13 @@
|
|
|
60
60
|
--md-cursor-background: var(--vscode-editorCursor-foreground, #000);
|
|
61
61
|
--md-readonly-accent: var(--vscode-button-background, rgb(45, 92, 180));
|
|
62
62
|
--md-readonly-accent-foreground: var(--vscode-button-foreground, #fff);
|
|
63
|
+
--md-inline-code-background: color-mix(in srgb,
|
|
64
|
+
var(--vscode-textPreformat-background, #818b981f) 60%, transparent);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.vscode-high-contrast .md-editor.md-theme-vscode-github,
|
|
68
|
+
.vscode-high-contrast-light .md-editor.md-theme-vscode-github {
|
|
69
|
+
--md-inline-code-background: var(--vscode-textPreformat-background, #818b981f);
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
.md-theme-vscode-github .md-heading {
|
|
@@ -155,7 +162,7 @@
|
|
|
155
162
|
padding: 0.2em 0.4em;
|
|
156
163
|
margin: 0;
|
|
157
164
|
color: var(--vscode-textPreformat-foreground, inherit);
|
|
158
|
-
background-color: var(--
|
|
165
|
+
background-color: var(--md-inline-code-background);
|
|
159
166
|
border-radius: 6px;
|
|
160
167
|
white-space: break-spaces;
|
|
161
168
|
}
|