@vscode/markdown-editor 0.0.2-82 → 0.0.2-83

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
@@ -955,12 +955,16 @@ export declare class EditorController extends Disposable {
955
955
  private readonly _indentation;
956
956
  private readonly _tabFocusStatus;
957
957
  private _tabMovesFocus;
958
+ /** Indentation copied by the most recent fenced-code Enter, while still untouched. */
959
+ private _generatedIndentation;
958
960
  /** Running click count for the current multi-click sequence (1, 2, 3, …). */
959
961
  private _clickCount;
960
962
  /** Timestamp and position of the previous pointer-down, for multi-click detection. */
961
963
  private _lastPointerDown;
962
964
  constructor(_model: EditorModel, _view: EditorView, options?: EditorControllerOptions);
963
965
  private readonly _handleTextUpdate;
966
+ private _insertText;
967
+ private _remainingGeneratedIndentation;
964
968
  /** Handle typed, pasted, or command-generated text while a paragraph is pending. */
965
969
  private _handlePendingInput;
966
970
  private _deletePendingText;
@@ -1281,6 +1285,9 @@ export declare class EditorView extends Disposable {
1281
1285
  private _readonlyToggleButton;
1282
1286
  private readonly _editContextSuspensions;
1283
1287
  private readonly _revealOcclusions;
1288
+ private _caretRevealRaf;
1289
+ private _followedCaretBlock;
1290
+ private _followCaretAfterEdit;
1284
1291
  /**
1285
1292
  * The mounted block sequence, in source order. Rebuilt (not mutated) each
1286
1293
  * frame by {@link DocumentViewNode.create}; the view just swaps one
@@ -1359,6 +1366,7 @@ export declare class EditorView extends Disposable {
1359
1366
  * and caret geometry intact.
1360
1367
  */
1361
1368
  private _setupFocusTracking;
1369
+ private _setupCaretScrollPadding;
1362
1370
  /**
1363
1371
  * Renders the edit/read-only mode toggle. It flips the model's
1364
1372
  * {@link EditorModel.readonlyMode}: when locked (read-only) every block stays
@@ -1384,6 +1392,18 @@ export declare class EditorView extends Disposable {
1384
1392
  */
1385
1393
  suspendEditContextWhileFocused(element: HTMLElement): IDisposable;
1386
1394
  revealRangeInCenterIfOutsideViewport(range: OffsetRange, behavior?: ScrollBehavior): IDisposable;
1395
+ /**
1396
+ * Keeps the caret visible after an editor-driven text edit. The reveal is
1397
+ * deferred until the rebuilt document has been laid out and uses nearest-edge
1398
+ * scrolling so ordinary typing only moves the containing viewport as far as
1399
+ * needed. While this mode is active, a later resize of the same active block
1400
+ * also re-reveals the caret (for asynchronous code, math, or diagram layout).
1401
+ */
1402
+ revealCaretAfterEdit(): void;
1403
+ /** Keeps a keyboard-moved caret visible without enabling edit-resize following. */
1404
+ revealCaretAfterKeyboardNavigation(): void;
1405
+ /** Stops edit-driven caret following before pointer-based selection begins. */
1406
+ stopFollowingCaret(): void;
1387
1407
  /**
1388
1408
  * Samples the ambient focus state that decides whether taking focus on open
1389
1409
  * would steal it from an explicit user target: whether the window is focused
@@ -1473,6 +1493,13 @@ export declare class EditorView extends Disposable {
1473
1493
  private _clearDiff;
1474
1494
  private _syncEditContextAttachment;
1475
1495
  private _revealRange;
1496
+ private _revealTarget;
1497
+ private _scheduleCaretReveal;
1498
+ private _revealCaretNearest;
1499
+ private _revealCaretAfterActiveBlockResize;
1500
+ private _caretBlockAt;
1501
+ private _measurementAt;
1502
+ private _stopFollowingCaret;
1476
1503
  private _isRevealOccluded;
1477
1504
  }
1478
1505
 
@@ -2086,7 +2113,7 @@ export declare const insertSmartEnter: (ctx: CursorCommandContext) => SmartEnter
2086
2113
  */
2087
2114
  export declare function insertTab(config?: IndentationConfig): EditCommand;
2088
2115
 
2089
- export declare function insertText(text: string): EditCommand;
2116
+ export declare function insertText(text: string, generatedIndentation?: OffsetRange): EditCommand;
2090
2117
 
2091
2118
  /**
2092
2119
  * An immutable view of one document's tokens at a point in time. It may be a
@@ -2877,6 +2904,8 @@ export declare type SmartEnterResult = {
2877
2904
  readonly kind: 'edit';
2878
2905
  readonly edit: StringEdit;
2879
2906
  readonly selection: Selection_2;
2907
+ /** Post-edit range of indentation copied onto a new fenced-code line. */
2908
+ readonly generatedIndentation?: OffsetRange;
2880
2909
  } | PendingParagraphResult;
2881
2910
 
2882
2911
  /**