@vscode/markdown-editor 0.0.2-55 → 0.0.2-57
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 +10 -3
- package/dist/index.js +33 -30
- package/dist/index.js.map +1 -1
- package/dist/web-editors.d.ts +6 -7
- package/dist/web-editors.js +17 -17
- package/dist/web-editors.js.map +1 -1
- package/package.json +2 -2
- package/src/view/themes/default.css +1 -1
- package/src/view/themes/github.css +1 -1
- package/src/view/themes/vscode-default.css +1 -1
- package/src/view/themes/vscode-github.css +1 -1
package/dist/web-editors.d.ts
CHANGED
|
@@ -65,14 +65,14 @@ declare interface IEmbeddedCodeEditor {
|
|
|
65
65
|
/** Creates an {@link IEmbeddedCodeEditor} for a fenced block, or opts out. */
|
|
66
66
|
declare interface IEmbeddedCodeEditorFactory {
|
|
67
67
|
/**
|
|
68
|
-
* Return an editor for a fenced block
|
|
68
|
+
* Return an editor for a fenced block, or `undefined` to fall
|
|
69
69
|
* back to the default (highlighting / {@link BlockViewOptions.renderCustomCodeBlock}).
|
|
70
70
|
*/
|
|
71
|
-
create(language: string, initialContent: string): IEmbeddedCodeEditor | undefined;
|
|
71
|
+
create(language: string, infoString: string, initialContent: string): IEmbeddedCodeEditor | undefined;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export declare interface IframeEmbeddedEditorProvider extends CodeBlockEditorProviderDefinition {
|
|
75
|
-
readonly resolve: (
|
|
75
|
+
readonly resolve: (infoString: string) => Promise<ResolvedIframeEmbeddedEditor | undefined>;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
export declare type IframeEmbeddedEditorProviderSelector = CodeBlockEditorSelector;
|
|
@@ -153,7 +153,6 @@ declare class PhysicalIframePool implements IDisposable {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
export declare interface ResolvedIframeEmbeddedEditor {
|
|
156
|
-
readonly cacheKey?: string;
|
|
157
156
|
readonly html: string;
|
|
158
157
|
readonly contentType?: ContentType;
|
|
159
158
|
readonly initialHeight?: number;
|
|
@@ -206,13 +205,13 @@ declare class VirtualizedIframeEmbeddedEditor implements IEmbeddedCodeEditor {
|
|
|
206
205
|
frame: PhysicalIframe | undefined;
|
|
207
206
|
disposed: boolean;
|
|
208
207
|
visible: boolean;
|
|
209
|
-
readonly
|
|
208
|
+
readonly infoString: string;
|
|
210
209
|
private readonly _frameHost;
|
|
211
210
|
private _content;
|
|
212
211
|
private _readOnly;
|
|
213
212
|
private _pool;
|
|
214
213
|
private _resolved;
|
|
215
|
-
constructor(_factory: VirtualizedIframeEmbeddedEditorFactory, provider: IframeEmbeddedEditorProvider,
|
|
214
|
+
constructor(_factory: VirtualizedIframeEmbeddedEditorFactory, provider: IframeEmbeddedEditorProvider, infoString: string, initialContent: string, initialHeight: number, generation: number);
|
|
216
215
|
setContent(content: string): void;
|
|
217
216
|
setReadOnly(readOnly: boolean): void;
|
|
218
217
|
setVisible(visible: boolean): void;
|
|
@@ -258,7 +257,7 @@ export declare class VirtualizedIframeEmbeddedEditorFactory implements IEmbedded
|
|
|
258
257
|
constructor(_options: VirtualizedIframeEmbeddedEditorOptions);
|
|
259
258
|
updateProviders(providers: readonly IframeEmbeddedEditorProvider[]): void;
|
|
260
259
|
get diagnostics(): VirtualizedIframeEmbeddedEditorDiagnostics;
|
|
261
|
-
create(language: string, initialContent: string): IEmbeddedCodeEditor | undefined;
|
|
260
|
+
create(language: string, infoString: string, initialContent: string): IEmbeddedCodeEditor | undefined;
|
|
262
261
|
dispose(): void;
|
|
263
262
|
remove(editor: VirtualizedIframeEmbeddedEditor): void;
|
|
264
263
|
resolve(editor: VirtualizedIframeEmbeddedEditor, generation: number): Promise<void>;
|
package/dist/web-editors.js
CHANGED
|
@@ -6173,26 +6173,26 @@ class Cl {
|
|
|
6173
6173
|
descriptorCacheHits: this._descriptorCacheHits
|
|
6174
6174
|
};
|
|
6175
6175
|
}
|
|
6176
|
-
create(t, n) {
|
|
6177
|
-
const
|
|
6178
|
-
if (!
|
|
6176
|
+
create(t, n, r) {
|
|
6177
|
+
const o = zl(this._providers, t);
|
|
6178
|
+
if (!o)
|
|
6179
6179
|
return;
|
|
6180
|
-
if (
|
|
6181
|
-
this._options.onAmbiguous?.(t,
|
|
6180
|
+
if (o.kind === "ambiguous") {
|
|
6181
|
+
this._options.onAmbiguous?.(t, o.providers);
|
|
6182
6182
|
return;
|
|
6183
6183
|
}
|
|
6184
|
-
const
|
|
6185
|
-
if (this._rejectedProviders.has(
|
|
6184
|
+
const s = un(o.provider.id, n);
|
|
6185
|
+
if (this._rejectedProviders.has(s))
|
|
6186
6186
|
return;
|
|
6187
|
-
const
|
|
6187
|
+
const i = new Ol(
|
|
6188
6188
|
this,
|
|
6189
|
-
|
|
6190
|
-
t,
|
|
6189
|
+
o.provider,
|
|
6191
6190
|
n,
|
|
6191
|
+
r,
|
|
6192
6192
|
this._options.defaultHeight ?? 120,
|
|
6193
6193
|
this._generation
|
|
6194
6194
|
);
|
|
6195
|
-
return this._logicalEditors.add(
|
|
6195
|
+
return this._logicalEditors.add(i), this._observer?.observe(i.element), this._layoutObserver && i.observeLayout(this._layoutObserver), this._observer || i.setVisible(!0), i;
|
|
6196
6196
|
}
|
|
6197
6197
|
dispose() {
|
|
6198
6198
|
if (!this._disposed) {
|
|
@@ -6206,10 +6206,10 @@ class Cl {
|
|
|
6206
6206
|
this._observer?.unobserve(t.element), this._layoutObserver?.unobserve(t.element), this._logicalEditors.delete(t), t.frame?.unbind();
|
|
6207
6207
|
}
|
|
6208
6208
|
async resolve(t, n) {
|
|
6209
|
-
const r = un(t.provider.id, t.
|
|
6209
|
+
const r = un(t.provider.id, t.infoString);
|
|
6210
6210
|
let o = this._descriptorCache.get(r), s;
|
|
6211
6211
|
try {
|
|
6212
|
-
o ? this._descriptorCacheHits++ : (o = t.provider.resolve(t.
|
|
6212
|
+
o ? this._descriptorCacheHits++ : (o = t.provider.resolve(t.infoString), this._descriptorCache.set(r, o)), s = await o;
|
|
6213
6213
|
} catch {
|
|
6214
6214
|
o && this._descriptorCache.get(r) === o && this._descriptorCache.delete(r), this._rejectEditor(t, n, r);
|
|
6215
6215
|
return;
|
|
@@ -6218,7 +6218,7 @@ class Cl {
|
|
|
6218
6218
|
this._rejectEditor(t, n, r);
|
|
6219
6219
|
return;
|
|
6220
6220
|
}
|
|
6221
|
-
const i = Zl(t.provider.id, t.
|
|
6221
|
+
const i = Zl(t.provider.id, t.infoString, s);
|
|
6222
6222
|
let a = this._pools.get(i);
|
|
6223
6223
|
if (!a) {
|
|
6224
6224
|
const c = this._ensureFrameRoot(t);
|
|
@@ -6263,7 +6263,7 @@ class Cl {
|
|
|
6263
6263
|
}
|
|
6264
6264
|
class Ol {
|
|
6265
6265
|
constructor(t, n, r, o, s, i) {
|
|
6266
|
-
this._factory = t, this.provider = n, this.
|
|
6266
|
+
this._factory = t, this.provider = n, this.infoString = r, this._content = o, this.element = document.createElement("div"), this.element.style.width = "100%", this.element.style.minHeight = `${s}px`, this._frameHost = document.createElement("div"), this._frameHost.style.width = "100%", this.element.appendChild(this._frameHost), this.estimateHeight = () => parseFloat(this.element.style.minHeight) || s, this._factory.resolve(this, i);
|
|
6267
6267
|
}
|
|
6268
6268
|
element;
|
|
6269
6269
|
onEdit;
|
|
@@ -6271,7 +6271,7 @@ class Ol {
|
|
|
6271
6271
|
frame;
|
|
6272
6272
|
disposed = !1;
|
|
6273
6273
|
visible = !1;
|
|
6274
|
-
|
|
6274
|
+
infoString;
|
|
6275
6275
|
_frameHost;
|
|
6276
6276
|
_content;
|
|
6277
6277
|
_readOnly = !1;
|
|
@@ -6458,7 +6458,7 @@ function un(e, t) {
|
|
|
6458
6458
|
function Zl(e, t, n) {
|
|
6459
6459
|
return [
|
|
6460
6460
|
e,
|
|
6461
|
-
|
|
6461
|
+
t,
|
|
6462
6462
|
n.contentType ?? "text",
|
|
6463
6463
|
ir(n.sandbox),
|
|
6464
6464
|
n.sandbox?.clipboardWrite === !0 ? "clipboard-write" : ""
|