@scrider/formatter 1.6.1 → 1.6.2

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.cts CHANGED
@@ -1011,11 +1011,13 @@ declare const blockFormat: Format<Record<string, unknown>>;
1011
1011
  *
1012
1012
  * Markdown: ![Widget](url)
1013
1013
  * HTML: <iframe data-code-widget src="<embed-url>" frameborder="0" allowfullscreen
1014
- * allow="…; cross-origin-isolated">
1014
+ * allow="…; cross-origin-isolated" credentialless>
1015
1015
  *
1016
1016
  * The `allow="…; cross-origin-isolated"` list (see CODE_WIDGET_IFRAME_ALLOW)
1017
1017
  * delegates the cross-origin-isolated capability so StackBlitz WebContainer
1018
1018
  * embeds can boot SharedArrayBuffer; without it those embeds render blank.
1019
+ * `credentialless` keeps the frame loadable under a cross-origin-isolated host
1020
+ * (COEP) — enabling the live preview is the host's responsibility.
1019
1021
  *
1020
1022
  * The src is run through `toCodeWidgetEmbedUrl` at render time, which is
1021
1023
  * idempotent, so resize/float attributes and the Delta ↔ HTML round-trip stay
package/dist/index.d.ts CHANGED
@@ -1011,11 +1011,13 @@ declare const blockFormat: Format<Record<string, unknown>>;
1011
1011
  *
1012
1012
  * Markdown: ![Widget](url)
1013
1013
  * HTML: <iframe data-code-widget src="<embed-url>" frameborder="0" allowfullscreen
1014
- * allow="…; cross-origin-isolated">
1014
+ * allow="…; cross-origin-isolated" credentialless>
1015
1015
  *
1016
1016
  * The `allow="…; cross-origin-isolated"` list (see CODE_WIDGET_IFRAME_ALLOW)
1017
1017
  * delegates the cross-origin-isolated capability so StackBlitz WebContainer
1018
1018
  * embeds can boot SharedArrayBuffer; without it those embeds render blank.
1019
+ * `credentialless` keeps the frame loadable under a cross-origin-isolated host
1020
+ * (COEP) — enabling the live preview is the host's responsibility.
1019
1021
  *
1020
1022
  * The src is run through `toCodeWidgetEmbedUrl` at render time, which is
1021
1023
  * idempotent, so resize/float attributes and the Delta ↔ HTML round-trip stay
package/dist/index.js CHANGED
@@ -1893,7 +1893,7 @@ var EMBED_RENDERERS = {
1893
1893
  const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
1894
1894
  const embedSrc = toVideoEmbedUrl(src);
1895
1895
  if (embedSrc) {
1896
- return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen${float}${style}></iframe>`;
1896
+ return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen credentialless${float}${style}></iframe>`;
1897
1897
  }
1898
1898
  return `<video src="${escapeHtml(src)}" controls${float}${style}></video>`;
1899
1899
  },
@@ -1914,7 +1914,7 @@ var EMBED_RENDERERS = {
1914
1914
  }
1915
1915
  const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
1916
1916
  const embedSrc = toCodeWidgetEmbedUrl(src);
1917
- return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen allow="${CODE_WIDGET_IFRAME_ALLOW}"${float}${style}></iframe>`;
1917
+ return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen allow="${CODE_WIDGET_IFRAME_ALLOW}" credentialless${float}${style}></iframe>`;
1918
1918
  },
1919
1919
  formula: (value) => {
1920
1920
  const latex = typeof value === "string" ? value : "";
@@ -2103,7 +2103,7 @@ var codeWidgetFormat = {
2103
2103
  }
2104
2104
  const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
2105
2105
  const embedSrc = toCodeWidgetEmbedUrl(src);
2106
- return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen allow="${CODE_WIDGET_IFRAME_ALLOW}"${float}${style}></iframe>`;
2106
+ return `<iframe data-code-widget src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen allow="${CODE_WIDGET_IFRAME_ALLOW}" credentialless${float}${style}></iframe>`;
2107
2107
  },
2108
2108
  match(element) {
2109
2109
  if (element.tagName.toLowerCase() !== "iframe") return null;
@@ -2367,7 +2367,7 @@ var videoFormat = {
2367
2367
  const style = styles.length > 0 ? ` style="${styles.join("; ")}"` : "";
2368
2368
  const embedSrc = toVideoEmbedUrl(src);
2369
2369
  if (embedSrc) {
2370
- return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen${float}${style}></iframe>`;
2370
+ return `<iframe src="${escapeHtml(embedSrc)}" frameborder="0" allowfullscreen credentialless${float}${style}></iframe>`;
2371
2371
  }
2372
2372
  return `<video src="${escapeHtml(src)}" controls${float}${style}></video>`;
2373
2373
  },