@vscode/markdown-editor 0.0.2-128 → 0.0.2-129
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 +48 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1395 -1557
- package/dist/index.js.map +1 -1
- package/dist/scrolling-C4GW1cCQ.js +391 -0
- package/dist/scrolling-C4GW1cCQ.js.map +1 -0
- package/dist/web-editors.d.ts +52 -0
- package/dist/web-editors.js +3788 -3631
- package/dist/web-editors.js.map +1 -1
- package/package.json +2 -2
- package/src/view/editor.css +98 -0
- package/src/view/themes/vscode-default.css +5 -0
- package/src/view/themes/vscode-github.css +5 -0
- package/dist/stringEdit-CVDbCUBY.js +0 -215
- package/dist/stringEdit-CVDbCUBY.js.map +0 -1
package/README.md
CHANGED
|
@@ -20,6 +20,54 @@ failed with `EPERM` on the Azure release agent. Keep the exact pin until the new
|
|
|
20
20
|
download route is approved and verified on that agent. This affects test tooling,
|
|
21
21
|
not the published editor's runtime dependencies or Component Explorer's renderer.
|
|
22
22
|
|
|
23
|
+
## Embedded editor presentation
|
|
24
|
+
|
|
25
|
+
Iframe editor descriptors can opt into host-owned presentation controls:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
presentation: {
|
|
29
|
+
resizable: true,
|
|
30
|
+
fullWidth: true,
|
|
31
|
+
fullView: true,
|
|
32
|
+
minHeight: 180,
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
These controls work without an editor protocol implementation in the iframe.
|
|
37
|
+
Full width uses the Markdown viewport width while retaining document flow.
|
|
38
|
+
Full view fills the visible Markdown viewport, keeps the same iframe alive,
|
|
39
|
+
and restores the previous width mode, inline height, and scroll position on exit.
|
|
40
|
+
The host toolbar groups copy and presentation actions in a compact, themed Codicon
|
|
41
|
+
overlay. It appears on hover or keyboard focus without reserving a header row,
|
|
42
|
+
and always provides an exit button in full view. Escape also exits when handled
|
|
43
|
+
by the injected iframe bootstrap (nested remote pages can use the message below).
|
|
44
|
+
Resize handles support pointer capture and Arrow Up/Down. After a user resize,
|
|
45
|
+
content-size reports no longer override the chosen height; **Automatic height**
|
|
46
|
+
returns control to the content. Full view always uses the host viewport height.
|
|
47
|
+
Presentation changes never edit the Markdown source.
|
|
48
|
+
|
|
49
|
+
Cooperative pages can advertise the same preferences with
|
|
50
|
+
`parent.postMessage({ type: 'vscode-markdown-editor::presentation', preferences }, '*')`.
|
|
51
|
+
Explicit descriptor properties override guest preferences, including `false`.
|
|
52
|
+
The host sends `{ type: 'vscode-markdown-editor::presentation', mode }` to the
|
|
53
|
+
iframe on binding, loading, and mode changes. Modes are `inline`, `full-width`,
|
|
54
|
+
and `full-view`; pages measure dimensions with their own resize observer.
|
|
55
|
+
Pages should check `event.source === parent` before accepting this notification.
|
|
56
|
+
Send the same message type with `action: 'request-state'` to request the current
|
|
57
|
+
mode, or `action: 'exit-full-view'` to leave full view.
|
|
58
|
+
|
|
59
|
+
The **Experimental / Embedded presentation** group contains page-sized fixtures,
|
|
60
|
+
each with one embedded editor. Provider controls, guest preferences, and explicit
|
|
61
|
+
provider overrides use a release-notes editor backed by the sample web editor's
|
|
62
|
+
text mode. Its borderless red background
|
|
63
|
+
distinguishes guest UI from the Markdown host's themed controls. Edits update the underlying Markdown
|
|
64
|
+
block through the real web editor protocol. **Transparent editor** shows only
|
|
65
|
+
centered text, with no guest background or border, and a host-owned height-resize
|
|
66
|
+
grip. Embedded mode fills the browser; Explorer page mode supports desktop/mobile
|
|
67
|
+
viewports. Their light/dark Playwright tests exercise scaled-preview alignment,
|
|
68
|
+
drag capture, minimum height, size-report precedence, full-width
|
|
69
|
+
and full-view geometry, mode notifications, state retention, and restoration.
|
|
70
|
+
|
|
23
71
|
## Browser tests
|
|
24
72
|
|
|
25
73
|
`pnpm test:e2e` builds the fixture dependencies and runs the Playwright interaction
|
package/dist/index.d.ts
CHANGED
|
@@ -2009,6 +2009,8 @@ declare interface IEmbeddedCodeEditor {
|
|
|
2009
2009
|
setContent(content: string): void;
|
|
2010
2010
|
/** Update whether the embedded editor may change its content. */
|
|
2011
2011
|
setReadOnly?(readOnly: boolean): void;
|
|
2012
|
+
/** Mount host actions alongside the embedded editor's own presentation controls. */
|
|
2013
|
+
setActions?(actions: HTMLElement): void;
|
|
2012
2014
|
/**
|
|
2013
2015
|
* Optional synchronous height (px) to reserve for `content` *before* the
|
|
2014
2016
|
* editor has laid out. Return `undefined` to let the editor size itself
|