@vscode/markdown-editor 0.0.2-130 → 0.0.2-132
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 +20 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/web-editors.d.ts +4 -0
- package/dist/web-editors.js +15 -10
- package/dist/web-editors.js.map +1 -1
- package/package.json +2 -2
- package/src/view/editor.css +29 -4
- package/src/view/themes/vscode-default.css +1 -1
- package/src/view/themes/vscode-github.css +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,10 @@ not the published editor's runtime dependencies or Component Explorer's renderer
|
|
|
22
22
|
|
|
23
23
|
## Embedded editor presentation
|
|
24
24
|
|
|
25
|
+
`EditorView` calls the embedded editor factory's optional `layout()` hook after
|
|
26
|
+
measuring the document. The virtualized iframe factory uses it to keep retained
|
|
27
|
+
iframes aligned when edits move their placeholders without resizing them.
|
|
28
|
+
|
|
25
29
|
Iframe editor descriptors can opt into host-owned presentation controls:
|
|
26
30
|
|
|
27
31
|
```ts
|
|
@@ -39,12 +43,19 @@ Full view fills the visible Markdown viewport, keeps the same iframe alive,
|
|
|
39
43
|
and restores the previous width mode, inline height, and scroll position on exit.
|
|
40
44
|
The host toolbar groups copy and presentation actions in a compact, themed Codicon
|
|
41
45
|
overlay. It appears on hover or keyboard focus without reserving a header row,
|
|
42
|
-
|
|
46
|
+
alongside a rounded border around the iframe and its resize grip. These use the
|
|
47
|
+
same 4px frame and 6px toolbar radii as the Mermaid preview controls.
|
|
48
|
+
The toolbar and border fade in and out over 200ms with `ease-in-out`, matching
|
|
49
|
+
Markdown preview. Reduced-motion preferences disable these transitions.
|
|
50
|
+
The toolbar always provides an exit button in full view. Escape also exits when handled
|
|
43
51
|
by the injected iframe bootstrap (nested remote pages can use the message below).
|
|
44
52
|
Resize handles support pointer capture and Arrow Up/Down. After a user resize,
|
|
45
53
|
content-size reports no longer override the chosen height; **Automatic height**
|
|
46
54
|
returns control to the content. Full view always uses the host viewport height.
|
|
47
55
|
Presentation changes never edit the Markdown source.
|
|
56
|
+
The host iframe uses the page theme's background in every presentation mode.
|
|
57
|
+
Guest HTML can remain transparent to show that color without revealing the
|
|
58
|
+
Markdown document behind it in full view.
|
|
48
59
|
|
|
49
60
|
Cooperative pages can advertise the same preferences with
|
|
50
61
|
`parent.postMessage({ type: 'vscode-markdown-editor::presentation', preferences }, '*')`.
|
|
@@ -68,6 +79,14 @@ viewports. Their light/dark Playwright tests exercise scaled-preview alignment,
|
|
|
68
79
|
drag capture, minimum height, size-report precedence, full-width
|
|
69
80
|
and full-view geometry, mode notifications, state retention, and restoration.
|
|
70
81
|
|
|
82
|
+
**Red editor (hover)** and **Transparent editor (hover)** default the `mockHover`
|
|
83
|
+
fixture input to true for deterministic visual verification. This sets
|
|
84
|
+
`data-md-iframe-hover="true"` on the fixture container, exercising the same chrome
|
|
85
|
+
visibility rules as real hover/focus without moving the pointer. Set the input
|
|
86
|
+
to false to test natural hover behavior.
|
|
87
|
+
The `animations` fixture input defaults to false for stable screenshots. Set it
|
|
88
|
+
to true to exercise the production fades, with either real or mocked hover.
|
|
89
|
+
|
|
71
90
|
## Browser tests
|
|
72
91
|
|
|
73
92
|
`pnpm test:e2e` builds the fixture dependencies and runs the Playwright interaction
|
package/dist/index.d.ts
CHANGED
|
@@ -2034,6 +2034,8 @@ declare interface IEmbeddedCodeEditorFactory {
|
|
|
2034
2034
|
* back to the default (highlighting / {@link BlockViewOptions.renderCustomCodeBlock}).
|
|
2035
2035
|
*/
|
|
2036
2036
|
create(language: string, infoString: string, initialContent: string): IEmbeddedCodeEditor | undefined;
|
|
2037
|
+
/** Reposition overlays after the document's layout has been measured. */
|
|
2038
|
+
layout?(): void;
|
|
2037
2039
|
}
|
|
2038
2040
|
|
|
2039
2041
|
/**
|
package/dist/index.js
CHANGED
|
@@ -7559,7 +7559,7 @@ class Yd extends W {
|
|
|
7559
7559
|
)
|
|
7560
7560
|
});
|
|
7561
7561
|
}
|
|
7562
|
-
this.measuredLayout.setMeasurements(i, r);
|
|
7562
|
+
this.measuredLayout.setMeasurements(i, r), this._options?.embeddedCodeEditorFactory?.layout?.();
|
|
7563
7563
|
}
|
|
7564
7564
|
/**
|
|
7565
7565
|
* Paint the diff highlights via the CSS Custom Highlight API: green over the
|