@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.
@@ -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 of `language`, or `undefined` to fall
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: (language: string) => Promise<ResolvedIframeEmbeddedEditor | undefined>;
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 language: string;
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, language: string, initialContent: string, initialHeight: number, generation: number);
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>;
@@ -6173,26 +6173,26 @@ class Cl {
6173
6173
  descriptorCacheHits: this._descriptorCacheHits
6174
6174
  };
6175
6175
  }
6176
- create(t, n) {
6177
- const r = zl(this._providers, t);
6178
- if (!r)
6176
+ create(t, n, r) {
6177
+ const o = zl(this._providers, t);
6178
+ if (!o)
6179
6179
  return;
6180
- if (r.kind === "ambiguous") {
6181
- this._options.onAmbiguous?.(t, r.providers);
6180
+ if (o.kind === "ambiguous") {
6181
+ this._options.onAmbiguous?.(t, o.providers);
6182
6182
  return;
6183
6183
  }
6184
- const o = un(r.provider.id, t);
6185
- if (this._rejectedProviders.has(o))
6184
+ const s = un(o.provider.id, n);
6185
+ if (this._rejectedProviders.has(s))
6186
6186
  return;
6187
- const s = new Ol(
6187
+ const i = new Ol(
6188
6188
  this,
6189
- r.provider,
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(s), this._observer?.observe(s.element), this._layoutObserver && s.observeLayout(this._layoutObserver), this._observer || s.setVisible(!0), s;
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.language);
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.language), this._descriptorCache.set(r, o)), s = await o;
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.language, s);
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.language = 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);
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
- language;
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
- n.cacheKey ?? t,
6461
+ t,
6462
6462
  n.contentType ?? "text",
6463
6463
  ir(n.sandbox),
6464
6464
  n.sandbox?.clipboardWrite === !0 ? "clipboard-write" : ""