@vscode/markdown-editor 0.0.2-4 → 0.0.2-6
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 +170 -3
- package/dist/index.js +1503 -1160
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/src/view/editor.css +81 -4
- package/src/view/themes/github.css +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vscode/markdown-editor",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vite build",
|
|
38
|
+
"build:explorer": "vite build --config vite.fixture.config.ts --outDir dist-explorer --emptyOutDir",
|
|
38
39
|
"dev": "vite build --watch",
|
|
39
40
|
"pack": "pnpm run build && pnpm pack",
|
|
40
41
|
"test": "vitest --run",
|
|
@@ -58,6 +59,8 @@
|
|
|
58
59
|
"@vscode/component-explorer-cli": "next",
|
|
59
60
|
"@vscode/component-explorer-vite-plugin": "next",
|
|
60
61
|
"@vscode/observables": "workspace:*",
|
|
62
|
+
"github-markdown-css": "^5.9.0",
|
|
63
|
+
"golden-layout": "^2.6.0",
|
|
61
64
|
"markdown-it": "^14.2.0",
|
|
62
65
|
"mermaid": "^11.15.0",
|
|
63
66
|
"monaco-editor": "^0.52.2",
|
package/src/view/editor.css
CHANGED
|
@@ -20,6 +20,16 @@
|
|
|
20
20
|
caret-color: transparent;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/*
|
|
24
|
+
* The transient empty paragraph — the blank line conjured by pressing Enter at
|
|
25
|
+
* the end of a paragraph (see `PendingParagraph` in the model). It is not part
|
|
26
|
+
* of the document (Markdown has no empty-paragraph node); it holds a single
|
|
27
|
+
* `<br>` so it occupies one line's height, and the caret is painted over it.
|
|
28
|
+
*/
|
|
29
|
+
.md-pending-paragraph {
|
|
30
|
+
min-height: 1em;
|
|
31
|
+
}
|
|
32
|
+
|
|
23
33
|
/*
|
|
24
34
|
* Inner content container. Holds the rendered document and the cursor/selection
|
|
25
35
|
* overlays, which position themselves relative to this box, so it is the
|
|
@@ -40,14 +50,33 @@
|
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
/*
|
|
43
|
-
*
|
|
44
|
-
* pointer cursor
|
|
45
|
-
*
|
|
46
|
-
*
|
|
53
|
+
* Cursor mirrors the same open affordance as the underline below: the anchor's
|
|
54
|
+
* pointer cursor appears exactly when a click would open the link. An inactive
|
|
55
|
+
* (rendered) link opens on a plain click, so it keeps the browser's default
|
|
56
|
+
* anchor pointer. Once its block is active a plain click places the caret, so
|
|
57
|
+
* the link shows the normal editing cursor — except while Ctrl/Cmd is held
|
|
58
|
+
* (`.md-mod-down`), when a click opens it and the pointer returns.
|
|
47
59
|
*/
|
|
48
60
|
.md-block-active a {
|
|
49
61
|
cursor: inherit;
|
|
50
62
|
}
|
|
63
|
+
.md-editor.md-mod-down .md-block-active a[href] {
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
* Link underline is an "open affordance": show it only while a click on the
|
|
69
|
+
* link right now would actually open it. An inactive (rendered) link opens on
|
|
70
|
+
* a plain click, so hovering it underlines. An active link's plain click edits
|
|
71
|
+
* its source — it only opens with Ctrl/Cmd — so it underlines on hover only
|
|
72
|
+
* while that modifier is held (`.md-mod-down`, set live by the view).
|
|
73
|
+
*/
|
|
74
|
+
.md-editor a[href]:hover {
|
|
75
|
+
text-decoration: underline;
|
|
76
|
+
}
|
|
77
|
+
.md-editor:not(.md-mod-down) .md-block-active a[href]:hover {
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
}
|
|
51
80
|
|
|
52
81
|
.md-fence-spacer {
|
|
53
82
|
visibility: hidden;
|
|
@@ -285,6 +314,54 @@
|
|
|
285
314
|
fill: rgba(59, 130, 246, 0.25);
|
|
286
315
|
}
|
|
287
316
|
|
|
317
|
+
/*
|
|
318
|
+
* Gutter markers (source-control style change indicators). The layer fills the
|
|
319
|
+
* content box; each marker is an absolutely-positioned bar pinned to the left
|
|
320
|
+
* gutter (inside `.md-editor-content`'s 48px padding). The view sets only
|
|
321
|
+
* `top`/`height`; horizontal placement, width and color live here so themes can
|
|
322
|
+
* tune them without touching layout. Like the other overlays it never eats
|
|
323
|
+
* pointer events.
|
|
324
|
+
*/
|
|
325
|
+
.md-gutter-layer {
|
|
326
|
+
position: absolute;
|
|
327
|
+
top: 0;
|
|
328
|
+
left: 0;
|
|
329
|
+
width: 100%;
|
|
330
|
+
height: 100%;
|
|
331
|
+
pointer-events: none;
|
|
332
|
+
overflow: visible;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.md-gutter-marker {
|
|
336
|
+
position: absolute;
|
|
337
|
+
left: var(--md-gutter-marker-left, 18px);
|
|
338
|
+
width: var(--md-gutter-marker-width, 3px);
|
|
339
|
+
border-radius: 2px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.md-gutter-marker-added {
|
|
343
|
+
background: var(--md-gutter-added, #2ea043);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.md-gutter-marker-modified {
|
|
347
|
+
background: var(--md-gutter-modified, #0969da);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/*
|
|
351
|
+
* A deletion has no lines to span, so it is drawn as a downward-pointing
|
|
352
|
+
* triangle centered on the seam where the removed text used to be (the top of
|
|
353
|
+
* the line that now follows it), matching the git deleted-lines affordance.
|
|
354
|
+
*/
|
|
355
|
+
.md-gutter-marker-deleted {
|
|
356
|
+
width: 0;
|
|
357
|
+
height: 0;
|
|
358
|
+
border-radius: 0;
|
|
359
|
+
border-left: var(--md-gutter-marker-width, 3px) solid var(--md-gutter-deleted, #cf222e);
|
|
360
|
+
border-top: 4px solid transparent;
|
|
361
|
+
border-bottom: 4px solid transparent;
|
|
362
|
+
transform: translateY(-4px);
|
|
363
|
+
}
|
|
364
|
+
|
|
288
365
|
/* Source markers occupy the gutter so toggling them never shifts content. */
|
|
289
366
|
.md-heading {
|
|
290
367
|
position: relative;
|