@vscode/markdown-editor 0.0.2-53 → 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 +40 -5
- package/dist/index.js +2668 -2573
- package/dist/index.js.map +1 -1
- package/dist/web-editors.d.ts +0 -32
- package/dist/web-editors.js +899 -1009
- package/dist/web-editors.js.map +1 -1
- package/package.json +7 -4
- package/src/view/editor.css +36 -0
- package/src/view/themes/vscode-default.css +4 -0
- package/src/view/themes/vscode-github.css +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ export declare class BlockViewNode<T extends AnyViewData = AnyViewData> extends
|
|
|
200
200
|
* single identity check captures "nothing in my subtree changed" — and its
|
|
201
201
|
* whole subtree, and any session it owns, are kept as-is.
|
|
202
202
|
*/
|
|
203
|
-
canReuse(data: AnyViewData): boolean;
|
|
203
|
+
canReuse(data: AnyViewData, _options: BlockViewOptions | undefined): boolean;
|
|
204
204
|
/**
|
|
205
205
|
* Called by the view after this block is mounted and measured, with the
|
|
206
206
|
* block's rendered height in px. The default is a no-op; subclasses whose
|
|
@@ -342,6 +342,8 @@ export declare class CodeBlockViewNode extends BlockViewNode<CodeBlockViewData>
|
|
|
342
342
|
*/
|
|
343
343
|
private _embeddedEditor;
|
|
344
344
|
private readonly _embeddedEditorFactoryVersion;
|
|
345
|
+
private readonly _embeddedEditorReadOnly;
|
|
346
|
+
canReuse(data: AnyViewData, options: BlockViewOptions | undefined): boolean;
|
|
345
347
|
constructor(data: CodeBlockViewData, options: BlockViewOptions | undefined, previous: ViewNode | undefined);
|
|
346
348
|
dispose(): void;
|
|
347
349
|
}
|
|
@@ -579,6 +581,13 @@ export declare class CommentsView extends Disposable {
|
|
|
579
581
|
private _applyHover;
|
|
580
582
|
}
|
|
581
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
|
+
|
|
582
591
|
/**
|
|
583
592
|
* A {@link MonacoSyntaxHighlighter} preloaded with a handful of common Monarch
|
|
584
593
|
* grammars (plus the usual short aliases). Unknown languages fall back to an
|
|
@@ -1233,6 +1242,7 @@ export declare class EditorView extends Disposable {
|
|
|
1233
1242
|
* to their parent's box) stay aligned with the content.
|
|
1234
1243
|
*/
|
|
1235
1244
|
private readonly _contentContainer;
|
|
1245
|
+
private readonly _resizeObserver;
|
|
1236
1246
|
private readonly _cursorView;
|
|
1237
1247
|
private readonly _selectionView;
|
|
1238
1248
|
private readonly _gutterMarkersView;
|
|
@@ -1795,6 +1805,15 @@ export declare function hiddenCursorRanges(doc: DocumentAstNode, markerVisibleBl
|
|
|
1795
1805
|
|
|
1796
1806
|
export declare type HistoryKeyboardAction = 'undo' | 'redo';
|
|
1797
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
|
+
|
|
1798
1817
|
/**
|
|
1799
1818
|
* The editor operations a clipboard strategy drives. The strategy never
|
|
1800
1819
|
* touches the model or the DOM directly — it asks through this seam, so the
|
|
@@ -2014,6 +2033,9 @@ export declare const insertParagraph: EditCommand;
|
|
|
2014
2033
|
* - block quote — continue the quote (`\n> `); an empty quote line exits it.
|
|
2015
2034
|
* - list — continue the list with the next marker (incrementing ordered
|
|
2016
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.
|
|
2017
2039
|
* A non-collapsed selection, or any other block, falls back to a plain soft line
|
|
2018
2040
|
* break, preserving today's behaviour.
|
|
2019
2041
|
*/
|
|
@@ -2482,6 +2504,11 @@ export declare class OffsetRange {
|
|
|
2482
2504
|
toString(): string;
|
|
2483
2505
|
}
|
|
2484
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
|
+
|
|
2485
2512
|
/** Outdent the current line, or every line touched by the selection. */
|
|
2486
2513
|
export declare function outdent(config?: IndentationConfig): EditCommand;
|
|
2487
2514
|
|
|
@@ -2984,21 +3011,29 @@ declare class UnhandledBlockAstNode extends BlockAstNodeBase {
|
|
|
2984
3011
|
constructor(tokenType: string, content: readonly (MarkerAstNode | GlueAstNode)[], leadingTrivia?: GlueAstNode | undefined);
|
|
2985
3012
|
get children(): readonly AstNode[];
|
|
2986
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;
|
|
2987
3020
|
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
2988
3021
|
withLeadingTrivia(trivia: GlueAstNode | undefined): UnhandledBlockAstNode;
|
|
2989
3022
|
protected _localEquals(o: this): boolean;
|
|
2990
3023
|
}
|
|
2991
3024
|
|
|
2992
3025
|
/**
|
|
2993
|
-
* View-data for an {@link UnhandledBlockAstNode}.
|
|
2994
|
-
*
|
|
2995
|
-
*
|
|
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.
|
|
2996
3030
|
*/
|
|
2997
3031
|
declare class UnhandledBlockViewData {
|
|
2998
3032
|
readonly ast: UnhandledBlockAstNode;
|
|
3033
|
+
readonly showMarkup: boolean;
|
|
2999
3034
|
readonly content: readonly AnyViewData[];
|
|
3000
3035
|
readonly kind = "unhandledBlock";
|
|
3001
|
-
constructor(ast: UnhandledBlockAstNode, content: readonly AnyViewData[]);
|
|
3036
|
+
constructor(ast: UnhandledBlockAstNode, showMarkup: boolean, content: readonly AnyViewData[]);
|
|
3002
3037
|
}
|
|
3003
3038
|
|
|
3004
3039
|
/**
|