@vscode/markdown-editor 0.0.2-65 → 0.0.2-67

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 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;
@@ -1143,7 +1146,7 @@ export declare class EditorModel {
1143
1146
  * The transient empty-paragraph editing state, or `undefined` when none is
1144
1147
  * armed. See {@link PendingParagraph}. This is *not* document data — it is
1145
1148
  * cleared by any source edit and lives only between the Enter that armed it
1146
- * and the next keystroke.
1149
+ * and the next content-producing edit.
1147
1150
  */
1148
1151
  readonly pendingParagraph: ISettableObservable<PendingParagraph | undefined, void>;
1149
1152
  readonly cursorOffset: IObservableWithChange<number | undefined, void>;
@@ -1198,7 +1201,7 @@ export declare class EditorModel {
1198
1201
  * AST node for it, and park the caret at the gap start. No source edit is
1199
1202
  * applied — the blank line exists only in the view until it is materialized.
1200
1203
  */
1201
- armPendingParagraph(req: Omit<PendingParagraph, 'syntheticAst' | 'cursorLine'>): void;
1204
+ armPendingParagraph(req: Omit<PendingParagraph, 'syntheticAst' | 'cursorLine' | 'text'>): void;
1202
1205
  /** Discard the pending paragraph (if any) without touching the source. */
1203
1206
  cancelPendingParagraph(): void;
1204
1207
  /**
@@ -1207,10 +1210,12 @@ export declare class EditorModel {
1207
1210
  * state anchored to the previous parse.
1208
1211
  */
1209
1212
  replaceSourceText(text: StringValue): void;
1213
+ /** Replace the transient horizontal whitespace on the pending line. */
1214
+ setPendingParagraphText(text: string): void;
1210
1215
  /**
1211
1216
  * Turn the pending paragraph into real source: rewrite its gap so the typed
1212
- * `text` becomes its own paragraph, separated from its neighbours by blank
1213
- * lines, and place the caret after the inserted text.
1217
+ * text, including any transient indentation, is separated from its neighbours
1218
+ * by blank lines, and place the caret after it.
1214
1219
  */
1215
1220
  materializePendingParagraph(text: string): void;
1216
1221
  applyEdit(edit: StringEdit, selection?: Selection_2): void;
@@ -2563,6 +2568,11 @@ declare interface PendingParagraph {
2563
2568
  readonly separateFromPreviousBlock: boolean;
2564
2569
  /** Whether {@link replaceRange} ends at the end of the document. */
2565
2570
  readonly atEof: boolean;
2571
+ /**
2572
+ * Horizontal whitespace typed on the source-less line. It remains transient
2573
+ * until other input materializes the paragraph. Contains only spaces and tabs.
2574
+ */
2575
+ readonly text: string;
2566
2576
  /** The source-less visual line occupied by the pending caret. */
2567
2577
  readonly cursorLine: VirtualCursorLine;
2568
2578
  /**
@@ -2584,29 +2594,34 @@ declare interface PendingParagraphResult {
2584
2594
 
2585
2595
  /**
2586
2596
  * View-data for the transient empty paragraph (see `PendingParagraph` in the
2587
- * model). It carries only the throwaway {@link ParagraphAstNode} that gives the
2588
- * rendered blank line a stable identity across frames, its anchor block, and
2589
- * its source-less cursor line. It has no source content or selection range.
2597
+ * model). It carries the throwaway {@link ParagraphAstNode} that gives the
2598
+ * rendered line a stable identity across frames, its anchor block, source-less
2599
+ * cursor line, and transient horizontal whitespace. It has no source content or
2600
+ * selection range.
2590
2601
  */
2591
2602
  declare class PendingParagraphViewData {
2592
2603
  readonly ast: ParagraphAstNode;
2593
2604
  readonly anchorBlock: BlockAstNode;
2594
2605
  readonly cursorLine: VirtualCursorLine;
2606
+ readonly text: string;
2595
2607
  readonly kind = "pendingParagraph";
2596
- constructor(ast: ParagraphAstNode, anchorBlock: BlockAstNode, cursorLine: VirtualCursorLine);
2608
+ constructor(ast: ParagraphAstNode, anchorBlock: BlockAstNode, cursorLine: VirtualCursorLine, text: string);
2597
2609
  }
2598
2610
 
2599
2611
  /**
2600
2612
  * The mounted transient empty paragraph: a `<p class="md-pending-paragraph">`
2601
- * holding a single `<br>` so it occupies a line's height. It is a leaf view
2602
- * node with no inline source content; the document view publishes its element
2603
- * geometry as a virtual visual line.
2613
+ * holding either a `<br>` or decorated transient horizontal whitespace. It is a
2614
+ * leaf view node with no inline source content; the document view publishes its
2615
+ * element geometry as a virtual visual line.
2604
2616
  */
2605
2617
  declare class PendingParagraphViewNode extends ViewNode {
2606
2618
  readonly element: HTMLElement;
2607
2619
  readonly anchorBlock: BlockAstNode;
2608
2620
  readonly cursorLine: VirtualCursorLine;
2621
+ private _text;
2609
2622
  constructor(view: PendingParagraphViewData);
2623
+ update(text: string): void;
2624
+ getCaretClientRect(): DOMRect;
2610
2625
  }
2611
2626
 
2612
2627
  /**