@marimo-team/islands 0.21.2-dev1 → 0.21.2-dev12
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/main.js +18 -9
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/css/md.css +7 -0
- package/src/utils/__tests__/download.test.tsx +2 -2
- package/src/utils/download.ts +4 -3
- package/src/utils/html-to-image.ts +6 -0
package/dist/main.js
CHANGED
|
@@ -58976,9 +58976,16 @@ ${r}
|
|
|
58976
58976
|
}
|
|
58977
58977
|
var isSlotElement = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", isSVGElement = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
58978
58978
|
async function cloneChildren(e, r, c) {
|
|
58979
|
+
var _a3;
|
|
58979
58980
|
if (isSVGElement(r)) return r;
|
|
58980
58981
|
let d = [];
|
|
58981
|
-
|
|
58982
|
+
if (isSlotElement(e) && e.assignedNodes) d = toArray(e.assignedNodes());
|
|
58983
|
+
else if (isInstanceOfElement(e, HTMLIFrameElement)) try {
|
|
58984
|
+
((_a3 = e.contentDocument) == null ? void 0 : _a3.body) && (d = toArray(e.contentDocument.body.childNodes));
|
|
58985
|
+
} catch {
|
|
58986
|
+
}
|
|
58987
|
+
else d = toArray((e.shadowRoot ?? e).childNodes);
|
|
58988
|
+
return d.length === 0 || isInstanceOfElement(e, HTMLVideoElement) || await d.reduce((e2, d2) => e2.then(() => cloneNode(d2, c)).then((e3) => {
|
|
58982
58989
|
e3 && r.appendChild(e3);
|
|
58983
58990
|
}), Promise.resolve()), r;
|
|
58984
58991
|
}
|
|
@@ -59190,12 +59197,13 @@ ${r}
|
|
|
59190
59197
|
return getWebFontRules(await getCSSRules(toArray(e.ownerDocument.styleSheets), r));
|
|
59191
59198
|
}
|
|
59192
59199
|
function normalizeFontFamily(e) {
|
|
59193
|
-
return e.trim().replace(/["']/g, "");
|
|
59200
|
+
return (e || "").trim().replace(/["']/g, "");
|
|
59194
59201
|
}
|
|
59195
59202
|
function getUsedFonts(e) {
|
|
59196
59203
|
let r = /* @__PURE__ */ new Set();
|
|
59197
59204
|
function c(e2) {
|
|
59198
|
-
|
|
59205
|
+
let d = e2.style.fontFamily || getComputedStyle(e2).fontFamily;
|
|
59206
|
+
d && d.split(",").forEach((e3) => {
|
|
59199
59207
|
r.add(normalizeFontFamily(e3));
|
|
59200
59208
|
}), Array.from(e2.children).forEach((e3) => {
|
|
59201
59209
|
e3 instanceof HTMLElement && c(e3);
|
|
@@ -59211,7 +59219,7 @@ ${r}
|
|
|
59211
59219
|
}))).join("\n");
|
|
59212
59220
|
}
|
|
59213
59221
|
async function embedWebFonts(e, r) {
|
|
59214
|
-
let c = r.fontEmbedCSS == null ? r.skipFonts ? null : await getWebFontCSS(e, r) : r.fontEmbedCSS, d = r.extraStyleContent == null ? c :
|
|
59222
|
+
let c = r.fontEmbedCSS == null ? r.skipFonts ? null : await getWebFontCSS(e, r) : r.fontEmbedCSS, d = r.extraStyleContent == null ? c : (c || "").concat(r.extraStyleContent);
|
|
59215
59223
|
if (d) {
|
|
59216
59224
|
let r2 = document.createElement("style"), c2 = document.createTextNode(d);
|
|
59217
59225
|
r2.appendChild(c2), e.firstChild ? e.insertBefore(r2, e.firstChild) : e.appendChild(r2);
|
|
@@ -59240,6 +59248,7 @@ ${r}
|
|
|
59240
59248
|
return Logger.error("Error filtering node:", e2), true;
|
|
59241
59249
|
}
|
|
59242
59250
|
},
|
|
59251
|
+
imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQI12NgAAIABQABNjN9GQAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAA0lEQVQI12P4z8BQDwAEgAF/QualIQAAAABJRU5ErkJggg==",
|
|
59243
59252
|
onImageErrorHandler: (e) => {
|
|
59244
59253
|
Logger.error("Error loading image:", e);
|
|
59245
59254
|
},
|
|
@@ -59423,10 +59432,10 @@ Defaulting to \`null\`.`;
|
|
|
59423
59432
|
d && (v = d(r));
|
|
59424
59433
|
try {
|
|
59425
59434
|
downloadByURL(await toPng(r), Filenames.toPNG(c));
|
|
59426
|
-
} catch {
|
|
59427
|
-
toast({
|
|
59428
|
-
title: "
|
|
59429
|
-
description:
|
|
59435
|
+
} catch (e2) {
|
|
59436
|
+
Logger.error("Error downloading as PNG", e2), toast({
|
|
59437
|
+
title: "Failed to download as PNG",
|
|
59438
|
+
description: prettyError(e2),
|
|
59430
59439
|
variant: "danger"
|
|
59431
59440
|
});
|
|
59432
59441
|
} finally {
|
|
@@ -70777,7 +70786,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
|
|
|
70777
70786
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
70778
70787
|
}
|
|
70779
70788
|
}
|
|
70780
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-
|
|
70789
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-dev12"), showCodeInRunModeAtom = atom(true);
|
|
70781
70790
|
atom(null);
|
|
70782
70791
|
var import_compiler_runtime$89 = require_compiler_runtime();
|
|
70783
70792
|
function useKeydownOnElement(e, r) {
|