@vscode/markdown-editor 0.0.2-66 → 0.0.2-68
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 +42 -23
- package/dist/index.js +1310 -1216
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/view/editor.css +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -956,6 +956,9 @@ export declare class EditorController extends Disposable {
|
|
|
956
956
|
private _lastPointerDown;
|
|
957
957
|
constructor(_model: EditorModel, _view: EditorView, options?: EditorControllerOptions);
|
|
958
958
|
private readonly _handleTextUpdate;
|
|
959
|
+
/** Handle typed, pasted, or command-generated text while a paragraph is pending. */
|
|
960
|
+
private _handlePendingInput;
|
|
961
|
+
private _deletePendingText;
|
|
959
962
|
private readonly _handlePointerDown;
|
|
960
963
|
private _makeCursorContext;
|
|
961
964
|
private _makeVisualCursorContext;
|
|
@@ -1096,11 +1099,12 @@ export declare class EditorModel {
|
|
|
1096
1099
|
/**
|
|
1097
1100
|
* Read-only mode. When `true`, the editor never reveals a block's source
|
|
1098
1101
|
* markers (markdown special characters like `**`, `#`, list bullets, code
|
|
1099
|
-
* fences, `$…$`) — every block stays in its clean rendered form regardless
|
|
1100
|
-
*
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1102
|
+
* fences, `$…$`) — every block stays in its clean rendered form regardless of
|
|
1103
|
+
* where the caret/selection is — and text-editing commands are ignored.
|
|
1104
|
+
* Explicit interactions with rendered controls, such as task checkboxes,
|
|
1105
|
+
* remain available. Plain text selection still works everywhere (so the user
|
|
1106
|
+
* can copy). The default (`false`) is the normal editing mode where the active
|
|
1107
|
+
* block reveals its markers.
|
|
1104
1108
|
*/
|
|
1105
1109
|
readonly readonlyMode: ISettableObservable<boolean, void>;
|
|
1106
1110
|
/**
|
|
@@ -1143,7 +1147,7 @@ export declare class EditorModel {
|
|
|
1143
1147
|
* The transient empty-paragraph editing state, or `undefined` when none is
|
|
1144
1148
|
* armed. See {@link PendingParagraph}. This is *not* document data — it is
|
|
1145
1149
|
* cleared by any source edit and lives only between the Enter that armed it
|
|
1146
|
-
* and the next
|
|
1150
|
+
* and the next content-producing edit.
|
|
1147
1151
|
*/
|
|
1148
1152
|
readonly pendingParagraph: ISettableObservable<PendingParagraph | undefined, void>;
|
|
1149
1153
|
readonly cursorOffset: IObservableWithChange<number | undefined, void>;
|
|
@@ -1152,8 +1156,8 @@ export declare class EditorModel {
|
|
|
1152
1156
|
* The parsed document. Threads the previous document into the parser so
|
|
1153
1157
|
* unchanged blocks keep their object identity across reparses (see
|
|
1154
1158
|
* {@link MarkdownParser.parse}). Writing `previous` inside the compute is
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1159
|
+
* safe: unchanged source reuses it directly, while changed source produces
|
|
1160
|
+
* a result structurally identical to a full reparse.
|
|
1157
1161
|
*/
|
|
1158
1162
|
readonly document: IObservableWithChange<DocumentAstNode, void>;
|
|
1159
1163
|
/**
|
|
@@ -1198,7 +1202,7 @@ export declare class EditorModel {
|
|
|
1198
1202
|
* AST node for it, and park the caret at the gap start. No source edit is
|
|
1199
1203
|
* applied — the blank line exists only in the view until it is materialized.
|
|
1200
1204
|
*/
|
|
1201
|
-
armPendingParagraph(req: Omit<PendingParagraph, 'syntheticAst' | 'cursorLine'>): void;
|
|
1205
|
+
armPendingParagraph(req: Omit<PendingParagraph, 'syntheticAst' | 'cursorLine' | 'text'>): void;
|
|
1202
1206
|
/** Discard the pending paragraph (if any) without touching the source. */
|
|
1203
1207
|
cancelPendingParagraph(): void;
|
|
1204
1208
|
/**
|
|
@@ -1207,12 +1211,16 @@ export declare class EditorModel {
|
|
|
1207
1211
|
* state anchored to the previous parse.
|
|
1208
1212
|
*/
|
|
1209
1213
|
replaceSourceText(text: StringValue): void;
|
|
1214
|
+
/** Replace the transient horizontal whitespace on the pending line. */
|
|
1215
|
+
setPendingParagraphText(text: string): void;
|
|
1210
1216
|
/**
|
|
1211
1217
|
* Turn the pending paragraph into real source: rewrite its gap so the typed
|
|
1212
|
-
*
|
|
1213
|
-
* lines, and place the caret after
|
|
1218
|
+
* text, including any transient indentation, is separated from its neighbours
|
|
1219
|
+
* by blank lines, and place the caret after it.
|
|
1214
1220
|
*/
|
|
1215
1221
|
materializePendingParagraph(text: string): void;
|
|
1222
|
+
/** Sets a rendered task checkbox state in either editing or read-only mode. */
|
|
1223
|
+
setTaskCheckboxChecked(item: ListItemAstNode, checked: boolean): void;
|
|
1216
1224
|
applyEdit(edit: StringEdit, selection?: Selection_2): void;
|
|
1217
1225
|
applyEditForSelection(edit: StringEdit): void;
|
|
1218
1226
|
private _applySourceEdit;
|
|
@@ -1433,12 +1441,13 @@ export declare class EditorView extends Disposable {
|
|
|
1433
1441
|
*/
|
|
1434
1442
|
isPointInContent(point: Point2D): boolean;
|
|
1435
1443
|
/**
|
|
1436
|
-
* Whether `
|
|
1437
|
-
* selection this editor paints itself from `model.selection`.
|
|
1438
|
-
*
|
|
1439
|
-
*
|
|
1444
|
+
* Whether `range` intersects the rendered source text — the region whose
|
|
1445
|
+
* selection this editor paints itself from `model.selection`. This also
|
|
1446
|
+
* catches select-all ranges whose endpoints surround the rendered content.
|
|
1447
|
+
* Overlays anchored beside the text (comment widgets and the like) are *not*
|
|
1448
|
+
* part of it and keep their own native selection behaviour.
|
|
1440
1449
|
*/
|
|
1441
|
-
|
|
1450
|
+
intersectsRenderedContent(range: Range): boolean;
|
|
1442
1451
|
private readonly _renderAutorun;
|
|
1443
1452
|
/** Current mounted blocks, or empty before the first render. */
|
|
1444
1453
|
private get _blocks();
|
|
@@ -2563,6 +2572,11 @@ declare interface PendingParagraph {
|
|
|
2563
2572
|
readonly separateFromPreviousBlock: boolean;
|
|
2564
2573
|
/** Whether {@link replaceRange} ends at the end of the document. */
|
|
2565
2574
|
readonly atEof: boolean;
|
|
2575
|
+
/**
|
|
2576
|
+
* Horizontal whitespace typed on the source-less line. It remains transient
|
|
2577
|
+
* until other input materializes the paragraph. Contains only spaces and tabs.
|
|
2578
|
+
*/
|
|
2579
|
+
readonly text: string;
|
|
2566
2580
|
/** The source-less visual line occupied by the pending caret. */
|
|
2567
2581
|
readonly cursorLine: VirtualCursorLine;
|
|
2568
2582
|
/**
|
|
@@ -2584,29 +2598,34 @@ declare interface PendingParagraphResult {
|
|
|
2584
2598
|
|
|
2585
2599
|
/**
|
|
2586
2600
|
* View-data for the transient empty paragraph (see `PendingParagraph` in the
|
|
2587
|
-
* model). It carries
|
|
2588
|
-
* rendered
|
|
2589
|
-
*
|
|
2601
|
+
* model). It carries the throwaway {@link ParagraphAstNode} that gives the
|
|
2602
|
+
* rendered line a stable identity across frames, its anchor block, source-less
|
|
2603
|
+
* cursor line, and transient horizontal whitespace. It has no source content or
|
|
2604
|
+
* selection range.
|
|
2590
2605
|
*/
|
|
2591
2606
|
declare class PendingParagraphViewData {
|
|
2592
2607
|
readonly ast: ParagraphAstNode;
|
|
2593
2608
|
readonly anchorBlock: BlockAstNode;
|
|
2594
2609
|
readonly cursorLine: VirtualCursorLine;
|
|
2610
|
+
readonly text: string;
|
|
2595
2611
|
readonly kind = "pendingParagraph";
|
|
2596
|
-
constructor(ast: ParagraphAstNode, anchorBlock: BlockAstNode, cursorLine: VirtualCursorLine);
|
|
2612
|
+
constructor(ast: ParagraphAstNode, anchorBlock: BlockAstNode, cursorLine: VirtualCursorLine, text: string);
|
|
2597
2613
|
}
|
|
2598
2614
|
|
|
2599
2615
|
/**
|
|
2600
2616
|
* The mounted transient empty paragraph: a `<p class="md-pending-paragraph">`
|
|
2601
|
-
* holding a
|
|
2602
|
-
* node with no inline source content; the document view publishes its
|
|
2603
|
-
* geometry as a virtual visual line.
|
|
2617
|
+
* holding either a `<br>` or decorated transient horizontal whitespace. It is a
|
|
2618
|
+
* leaf view node with no inline source content; the document view publishes its
|
|
2619
|
+
* element geometry as a virtual visual line.
|
|
2604
2620
|
*/
|
|
2605
2621
|
declare class PendingParagraphViewNode extends ViewNode {
|
|
2606
2622
|
readonly element: HTMLElement;
|
|
2607
2623
|
readonly anchorBlock: BlockAstNode;
|
|
2608
2624
|
readonly cursorLine: VirtualCursorLine;
|
|
2625
|
+
private _text;
|
|
2609
2626
|
constructor(view: PendingParagraphViewData);
|
|
2627
|
+
update(text: string): void;
|
|
2628
|
+
getCaretClientRect(): DOMRect;
|
|
2610
2629
|
}
|
|
2611
2630
|
|
|
2612
2631
|
/**
|