@vscode/markdown-editor 0.0.2-19 → 0.0.2-20
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 +31 -4
- package/dist/index.js +277 -216
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/view/editor.css +146 -47
- package/src/view/themes/default.css +6 -1
- package/src/view/themes/github.css +7 -2
- package/src/view/themes/vscode-default.css +9 -2
- package/src/view/themes/vscode-github.css +9 -2
package/dist/index.d.ts
CHANGED
|
@@ -168,6 +168,17 @@ export declare class BlockViewNode<T extends AnyViewData = AnyViewData> extends
|
|
|
168
168
|
constructor(data: T, dom: globalThis.Node, children: readonly ViewNode[]);
|
|
169
169
|
get block(): BlockAstNode;
|
|
170
170
|
get element(): HTMLElement;
|
|
171
|
+
/**
|
|
172
|
+
* The horizontal scroll viewport for selection/caret clipping
|
|
173
|
+
* ({@link blockViewportClip}). For most blocks the scroller *is*
|
|
174
|
+
* {@link element} — a code / math / unhandled block's `element` is the very
|
|
175
|
+
* `overflow-x: auto` box that scrolls. A table is the exception: its
|
|
176
|
+
* `element` stays the inner `<table>` (so the active/markers classes and
|
|
177
|
+
* `.md-table` theme styling are unaffected), but the box that actually
|
|
178
|
+
* scrolls is the wrapping `.md-table-wrapper`, so {@link TableViewNode}
|
|
179
|
+
* overrides this to return that wrapper.
|
|
180
|
+
*/
|
|
181
|
+
get scrollElement(): HTMLElement;
|
|
171
182
|
/**
|
|
172
183
|
* Whether this already-built node can stand in for `data` unchanged. The
|
|
173
184
|
* builder preserves view-data identity for any subtree whose ast and
|
|
@@ -1105,7 +1116,7 @@ export declare class EditorView extends Disposable {
|
|
|
1105
1116
|
*/
|
|
1106
1117
|
private _setupModifierTracking;
|
|
1107
1118
|
/**
|
|
1108
|
-
* Renders the edit/read-only
|
|
1119
|
+
* Renders the edit/read-only mode toggle. It flips the model's
|
|
1109
1120
|
* {@link EditorModel.readonlyMode}: when locked (read-only) every block stays
|
|
1110
1121
|
* in its clean rendered form (no markdown markers revealed) and edits are
|
|
1111
1122
|
* ignored, while text selection still works. The control lives in a
|
|
@@ -1134,6 +1145,13 @@ export declare class EditorView extends Disposable {
|
|
|
1134
1145
|
* original block. Honours {@link geometricHitTest}.
|
|
1135
1146
|
*/
|
|
1136
1147
|
resolveOffsetFromPoint(point: Point2D): SourceOffset | undefined;
|
|
1148
|
+
/**
|
|
1149
|
+
* Resolve table-cell hits that have no measurable text run. Empty cells map
|
|
1150
|
+
* from their own box instead of snapping to a neighboring cell; element-only
|
|
1151
|
+
* content (for example an inactive image) maps through the hit element's view
|
|
1152
|
+
* node. Text-bearing cells keep the normal pixel-precise line-map/DOM path.
|
|
1153
|
+
*/
|
|
1154
|
+
private _resolveTableCellOffset;
|
|
1137
1155
|
/**
|
|
1138
1156
|
* Whether a client point falls on the rendered document content, as
|
|
1139
1157
|
* opposed to the surrounding editor padding (the green area). Uses DOM
|
|
@@ -1172,9 +1190,9 @@ export declare interface EditorViewOptions extends BlockViewOptions {
|
|
|
1172
1190
|
*/
|
|
1173
1191
|
readonly classNames?: readonly string[];
|
|
1174
1192
|
/**
|
|
1175
|
-
* Whether to render the sticky
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1193
|
+
* Whether to render the sticky edit/read-only toggle in the top-right
|
|
1194
|
+
* corner. Defaults to `true`; set to `false` to omit it (e.g. in fixtures
|
|
1195
|
+
* that focus on selection rendering).
|
|
1178
1196
|
*/
|
|
1179
1197
|
readonly showReadonlyToggle?: boolean;
|
|
1180
1198
|
/**
|
|
@@ -2048,6 +2066,15 @@ export declare interface SelectionBlock {
|
|
|
2048
2066
|
readonly absoluteStart: number;
|
|
2049
2067
|
readonly viewNode: ViewNode;
|
|
2050
2068
|
readonly element: HTMLElement;
|
|
2069
|
+
/**
|
|
2070
|
+
* The block's horizontal scroll viewport. Equal to {@link element} for every
|
|
2071
|
+
* block whose element is itself the `overflow-x: auto` scroller (code, math,
|
|
2072
|
+
* unhandled), but the wrapping `.md-table-wrapper` for a table, whose
|
|
2073
|
+
* {@link element} is the content-sized inner `<table>`. Only
|
|
2074
|
+
* {@link blockViewportClip} needs the scroll box; connector/rect geometry
|
|
2075
|
+
* still uses {@link element}.
|
|
2076
|
+
*/
|
|
2077
|
+
readonly scrollElement: HTMLElement;
|
|
2051
2078
|
}
|
|
2052
2079
|
|
|
2053
2080
|
export declare type SelectionCommand = (ctx: CursorCommandContext, offset: SourceOffset) => Selection_2;
|