@vscode/markdown-editor 0.0.2-111 → 0.0.2-113
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 +17 -1
- package/dist/index.js +1565 -1488
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/view/editor.css +93 -3
- package/src/view/themes/default.css +8 -0
- package/src/view/themes/github.css +9 -0
- package/src/view/themes/vscode-default.css +9 -0
- package/src/view/themes/vscode-github.css +9 -0
package/dist/index.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ declare interface AstVisualizationNode {
|
|
|
86
86
|
export declare class AsyncClipboardStrategy implements IClipboardStrategy {
|
|
87
87
|
private readonly _clipboard;
|
|
88
88
|
constructor(_clipboard?: Clipboard);
|
|
89
|
+
writeText(text: string): Promise<void>;
|
|
89
90
|
connect(context: IClipboardContext): IDisposable;
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -216,6 +217,8 @@ export declare class BlockViewNode<T extends AnyViewData = AnyViewData> extends
|
|
|
216
217
|
}
|
|
217
218
|
|
|
218
219
|
export declare interface BlockViewOptions {
|
|
220
|
+
/** Writes explicit copy actions through the host clipboard; defaults to the browser API. */
|
|
221
|
+
readonly writeClipboardText?: (text: string) => Promise<void>;
|
|
219
222
|
readonly renderCustomCodeBlock?: (language: string, content: string) => HTMLElement | undefined;
|
|
220
223
|
readonly onToggleCheckbox?: (item: ListItemAstNode, newChecked: boolean) => void;
|
|
221
224
|
/** Temporarily yields the host editor's text input while a nested control owns focus. */
|
|
@@ -280,6 +283,8 @@ export declare class CodeBlockAstNode extends BlockAstNodeBase {
|
|
|
280
283
|
readonly infoString: string;
|
|
281
284
|
readonly content: readonly (MarkerAstNode | GlueAstNode)[];
|
|
282
285
|
readonly leadingTrivia?: GlueAstNode | undefined;
|
|
286
|
+
/** Logical code tokens, excluding Markdown container prefixes and structural indentation. */
|
|
287
|
+
readonly codeText?: string | undefined;
|
|
283
288
|
readonly kind = "codeBlock";
|
|
284
289
|
private _previous?;
|
|
285
290
|
private _contentEdit?;
|
|
@@ -287,7 +292,9 @@ export declare class CodeBlockAstNode extends BlockAstNodeBase {
|
|
|
287
292
|
/** First token of the fenced code block info string, used for syntax highlighting. */
|
|
288
293
|
language: string,
|
|
289
294
|
/** Complete fenced code block info string, including metadata after the language token. */
|
|
290
|
-
infoString: string, content: readonly (MarkerAstNode | GlueAstNode)[], leadingTrivia?: GlueAstNode | undefined
|
|
295
|
+
infoString: string, content: readonly (MarkerAstNode | GlueAstNode)[], leadingTrivia?: GlueAstNode | undefined,
|
|
296
|
+
/** Logical code tokens, excluding Markdown container prefixes and structural indentation. */
|
|
297
|
+
codeText?: string | undefined);
|
|
291
298
|
get children(): readonly AstNode[];
|
|
292
299
|
get openFence(): MarkerAstNode | undefined;
|
|
293
300
|
get closeFence(): MarkerAstNode | undefined;
|
|
@@ -342,6 +349,8 @@ declare class CodeBlockViewData {
|
|
|
342
349
|
* only, so a nested block currently builds a fresh session on each rebuild.
|
|
343
350
|
*/
|
|
344
351
|
export declare class CodeBlockViewNode extends BlockViewNode<CodeBlockViewData> {
|
|
352
|
+
private readonly _contentElement;
|
|
353
|
+
private _copyAction;
|
|
345
354
|
private _session;
|
|
346
355
|
/**
|
|
347
356
|
* Subscription that re-tokenises the rendered `<code>` in place whenever the
|
|
@@ -364,6 +373,7 @@ export declare class CodeBlockViewNode extends BlockViewNode<CodeBlockViewData>
|
|
|
364
373
|
private readonly _embeddedEditorReadOnly;
|
|
365
374
|
canReuse(data: AnyViewData, options: BlockViewOptions | undefined): boolean;
|
|
366
375
|
constructor(data: CodeBlockViewData, options: BlockViewOptions | undefined, previous: ViewNode | undefined);
|
|
376
|
+
get element(): HTMLElement;
|
|
367
377
|
dispose(): void;
|
|
368
378
|
}
|
|
369
379
|
|
|
@@ -1273,6 +1283,10 @@ export declare class EditorView extends Disposable {
|
|
|
1273
1283
|
private readonly _document;
|
|
1274
1284
|
private readonly _embeddedCodeEditorFactoryVersion;
|
|
1275
1285
|
private readonly _suspendEditContextForBlockControl;
|
|
1286
|
+
private _clipboardWriter;
|
|
1287
|
+
private readonly _writeClipboardText;
|
|
1288
|
+
/** Connects explicit copy actions to the controller's host clipboard strategy. */
|
|
1289
|
+
setClipboardWriter(writeText: (text: string) => Promise<void>): IDisposable;
|
|
1276
1290
|
/** The current view-node tree (AST overlaid with rendered DOM), for debugging. */
|
|
1277
1291
|
get documentViewNode(): IObservable<DocumentViewNode | undefined>;
|
|
1278
1292
|
/** Re-resolves embedded code editors while preserving the surrounding editor view. */
|
|
@@ -1915,6 +1929,8 @@ export declare interface IClipboardContext {
|
|
|
1915
1929
|
* swallow the native clipboard events before they reach the editor.
|
|
1916
1930
|
*/
|
|
1917
1931
|
export declare interface IClipboardStrategy {
|
|
1932
|
+
/** Copy an explicit payload without changing the editor selection. Falls back to the browser API when omitted. */
|
|
1933
|
+
writeText?(text: string): Promise<void>;
|
|
1918
1934
|
/**
|
|
1919
1935
|
* Wire up clipboard handling against `context`. The returned disposable
|
|
1920
1936
|
* tears down every listener the strategy installed.
|