@vscode/markdown-editor 0.0.2-73 → 0.0.2-74
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 +73 -1
- package/dist/index.js +1382 -1228
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/view/editor.css +526 -0
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,11 @@ export declare class BlockViewNode<T extends AnyViewData = AnyViewData> extends
|
|
|
217
217
|
export declare interface BlockViewOptions {
|
|
218
218
|
readonly renderCustomCodeBlock?: (language: string, content: string) => HTMLElement | undefined;
|
|
219
219
|
readonly onToggleCheckbox?: (item: ListItemAstNode, newChecked: boolean) => void;
|
|
220
|
+
/**
|
|
221
|
+
* Supplies live, declarative metadata for recognized links. The editor owns
|
|
222
|
+
* the markup and styling; providers own lookup, caching, and updates.
|
|
223
|
+
*/
|
|
224
|
+
readonly linkPresentationProvider?: ILinkPresentationProvider;
|
|
220
225
|
/**
|
|
221
226
|
* Opens a link's URL. Called when the user activates a link: a plain click
|
|
222
227
|
* while the link's block is inactive (rendered), or a Ctrl/Cmd+click while it
|
|
@@ -1952,6 +1957,19 @@ export declare interface IHistoryStrategy {
|
|
|
1952
1957
|
record?(operation: () => void, edit?: StringEdit): void;
|
|
1953
1958
|
}
|
|
1954
1959
|
|
|
1960
|
+
export declare interface ILinkPresentation extends IDisposable {
|
|
1961
|
+
/** Current presentation, updated without rebuilding the editor. */
|
|
1962
|
+
readonly presentation: IObservable<LinkPresentation | undefined>;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
export declare interface ILinkPresentationProvider {
|
|
1966
|
+
/**
|
|
1967
|
+
* Returns `undefined` for unsupported links. The caller disposes the returned
|
|
1968
|
+
* reference when the rendered link disappears.
|
|
1969
|
+
*/
|
|
1970
|
+
createLinkPresentation(url: string): ILinkPresentation | undefined;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1955
1973
|
export declare class ImageAstNode extends AstNode {
|
|
1956
1974
|
readonly alt: string;
|
|
1957
1975
|
readonly url: string;
|
|
@@ -2187,11 +2205,41 @@ export declare class LinkAstNode extends AstNode {
|
|
|
2187
2205
|
protected _localEquals(o: this): boolean;
|
|
2188
2206
|
}
|
|
2189
2207
|
|
|
2208
|
+
/**
|
|
2209
|
+
* Declarative rendering data for one link. `kind` selects the package-owned
|
|
2210
|
+
* visual treatment; providers never supply DOM or CSS.
|
|
2211
|
+
*/
|
|
2212
|
+
export declare interface LinkPresentation {
|
|
2213
|
+
readonly kind: LinkPresentationKind;
|
|
2214
|
+
readonly title?: string;
|
|
2215
|
+
readonly detail?: string;
|
|
2216
|
+
readonly reference?: string;
|
|
2217
|
+
/** Primary resource state, such as pull-request lifecycle or session state. */
|
|
2218
|
+
readonly status?: LinkPresentationStatus;
|
|
2219
|
+
/** Secondary state, such as pull-request CI status. */
|
|
2220
|
+
readonly secondaryStatus?: LinkPresentationStatus;
|
|
2221
|
+
readonly tooltip?: string;
|
|
2222
|
+
readonly ariaLabel?: string;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
export declare type LinkPresentationKind = 'resource' | 'issue' | 'pullRequest' | 'commit' | 'file' | 'folder' | 'session' | 'repository' | 'branch';
|
|
2226
|
+
|
|
2227
|
+
export declare interface LinkPresentationStatus {
|
|
2228
|
+
readonly kind: LinkPresentationStatusKind;
|
|
2229
|
+
readonly label: string;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
export declare type LinkPresentationStatusKind = 'neutral' | 'pending' | 'success' | 'warning' | 'error' | 'open' | 'closed' | 'merged' | 'draft' | 'notPlanned';
|
|
2233
|
+
|
|
2190
2234
|
declare class LinkViewData {
|
|
2191
2235
|
readonly ast: LinkAstNode;
|
|
2236
|
+
/** Active: render the Markdown source; inactive: allow a rich presentation. */
|
|
2237
|
+
readonly showMarkup: boolean;
|
|
2192
2238
|
readonly content: readonly AnyViewData[];
|
|
2193
2239
|
readonly kind = "link";
|
|
2194
|
-
constructor(ast: LinkAstNode,
|
|
2240
|
+
constructor(ast: LinkAstNode,
|
|
2241
|
+
/** Active: render the Markdown source; inactive: allow a rich presentation. */
|
|
2242
|
+
showMarkup: boolean, content: readonly AnyViewData[]);
|
|
2195
2243
|
}
|
|
2196
2244
|
|
|
2197
2245
|
export declare class ListAstNode extends BlockAstNodeBase {
|
|
@@ -2700,6 +2748,30 @@ declare interface ReplacedItem {
|
|
|
2700
2748
|
readonly deletedLocal: readonly AnnotatedRange[];
|
|
2701
2749
|
}
|
|
2702
2750
|
|
|
2751
|
+
export declare class RichLink {
|
|
2752
|
+
static create(options: RichLinkOptions): RichLink;
|
|
2753
|
+
static mount(element: HTMLElement, authoredLabel: HTMLSpanElement): RichLink;
|
|
2754
|
+
static clear(element: HTMLElement): void;
|
|
2755
|
+
readonly element: HTMLElement;
|
|
2756
|
+
readonly authoredLabel: HTMLSpanElement;
|
|
2757
|
+
private readonly _icon;
|
|
2758
|
+
private readonly _title;
|
|
2759
|
+
private readonly _detail;
|
|
2760
|
+
private readonly _reference;
|
|
2761
|
+
private readonly _status;
|
|
2762
|
+
private readonly _secondaryStatus;
|
|
2763
|
+
private constructor();
|
|
2764
|
+
update(presentation: LinkPresentation | undefined): void;
|
|
2765
|
+
private _renderUnavailable;
|
|
2766
|
+
private _setDefaultOrder;
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
export declare interface RichLinkOptions {
|
|
2770
|
+
readonly href: string;
|
|
2771
|
+
readonly authoredLabel: string;
|
|
2772
|
+
readonly presentation?: LinkPresentation;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2703
2775
|
export declare const selectAll: SelectionCommand;
|
|
2704
2776
|
|
|
2705
2777
|
export declare function selectBlock(ctx: CursorCommandContext, blockRange: OffsetRange): Selection_2;
|