@vscode/markdown-editor 0.0.2-54 → 0.0.2-55

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
@@ -581,6 +581,13 @@ export declare class CommentsView extends Disposable {
581
581
  private _applyHover;
582
582
  }
583
583
 
584
+ /** The lossless source slices of a complete block HTML comment. */
585
+ declare interface CompleteHtmlCommentSource extends HtmlCommentSourceBase {
586
+ readonly kind: 'complete';
587
+ readonly closing: '-->';
588
+ readonly trailingWhitespace: string;
589
+ }
590
+
584
591
  /**
585
592
  * A {@link MonacoSyntaxHighlighter} preloaded with a handful of common Monarch
586
593
  * grammars (plus the usual short aliases). Unknown languages fall back to an
@@ -1798,6 +1805,15 @@ export declare function hiddenCursorRanges(doc: DocumentAstNode, markerVisibleBl
1798
1805
 
1799
1806
  export declare type HistoryKeyboardAction = 'undo' | 'redo';
1800
1807
 
1808
+ /** A block HTML comment, discriminated by whether its closing delimiter is present. */
1809
+ declare type HtmlCommentSource = OpenHtmlCommentSource | CompleteHtmlCommentSource;
1810
+
1811
+ declare interface HtmlCommentSourceBase {
1812
+ readonly leadingWhitespace: string;
1813
+ readonly opening: '<!--';
1814
+ readonly body: string;
1815
+ }
1816
+
1801
1817
  /**
1802
1818
  * The editor operations a clipboard strategy drives. The strategy never
1803
1819
  * touches the model or the DOM directly — it asks through this seam, so the
@@ -2017,6 +2033,9 @@ export declare const insertParagraph: EditCommand;
2017
2033
  * - block quote — continue the quote (`\n> `); an empty quote line exits it.
2018
2034
  * - list — continue the list with the next marker (incrementing ordered
2019
2035
  * numbers, re-emitting task checkboxes); an empty item exits the list.
2036
+ * - complete HTML comment — at the comment's end, leave it by arming a
2037
+ * transient paragraph; inside it (or while the comment is open), insert a
2038
+ * normal source line break.
2020
2039
  * A non-collapsed selection, or any other block, falls back to a plain soft line
2021
2040
  * break, preserving today's behaviour.
2022
2041
  */
@@ -2485,6 +2504,11 @@ export declare class OffsetRange {
2485
2504
  toString(): string;
2486
2505
  }
2487
2506
 
2507
+ /** The lossless source slices of a block HTML comment whose closer has not been typed. */
2508
+ declare interface OpenHtmlCommentSource extends HtmlCommentSourceBase {
2509
+ readonly kind: 'open';
2510
+ }
2511
+
2488
2512
  /** Outdent the current line, or every line touched by the selection. */
2489
2513
  export declare function outdent(config?: IndentationConfig): EditCommand;
2490
2514
 
@@ -2987,21 +3011,29 @@ declare class UnhandledBlockAstNode extends BlockAstNodeBase {
2987
3011
  constructor(tokenType: string, content: readonly (MarkerAstNode | GlueAstNode)[], leadingTrivia?: GlueAstNode | undefined);
2988
3012
  get children(): readonly AstNode[];
2989
3013
  get code(): MarkerAstNode | undefined;
3014
+ /**
3015
+ * Lossless slices when this raw HTML block starts one comment after optional
3016
+ * whitespace. An open comment consumes the remaining source as its body. A
3017
+ * complete comment permits only trailing whitespace after its closer.
3018
+ */
3019
+ get htmlComment(): HtmlCommentSource | undefined;
2990
3020
  mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
2991
3021
  withLeadingTrivia(trivia: GlueAstNode | undefined): UnhandledBlockAstNode;
2992
3022
  protected _localEquals(o: this): boolean;
2993
3023
  }
2994
3024
 
2995
3025
  /**
2996
- * View-data for an {@link UnhandledBlockAstNode}. It has no active/inactive
2997
- * split — the raw source *is* both the source and the rendered form so it
2998
- * carries no `showMarkup` flag; the renderer always shows the verbatim text.
3026
+ * View-data for an {@link UnhandledBlockAstNode}. The source remains verbatim
3027
+ * in both states. Complete HTML comments use {@link showMarkup} to switch
3028
+ * between their quiet reading treatment and editable source presentation;
3029
+ * other unhandled blocks ignore the flag and keep their warning treatment.
2999
3030
  */
3000
3031
  declare class UnhandledBlockViewData {
3001
3032
  readonly ast: UnhandledBlockAstNode;
3033
+ readonly showMarkup: boolean;
3002
3034
  readonly content: readonly AnyViewData[];
3003
3035
  readonly kind = "unhandledBlock";
3004
- constructor(ast: UnhandledBlockAstNode, content: readonly AnyViewData[]);
3036
+ constructor(ast: UnhandledBlockAstNode, showMarkup: boolean, content: readonly AnyViewData[]);
3005
3037
  }
3006
3038
 
3007
3039
  /**