@marimo-team/islands 0.21.2-dev1 → 0.21.2-dev13

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 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
- return d = isSlotElement(e) && e.assignedNodes ? toArray(e.assignedNodes()) : toArray((e.shadowRoot ?? e).childNodes), d.length === 0 || isInstanceOfElement(e, HTMLVideoElement) || await d.reduce((e2, d2) => e2.then(() => cloneNode(d2, c)).then((e3) => {
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
- (e2.style.fontFamily || getComputedStyle(e2).fontFamily).split(",").forEach((e3) => {
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 : r.extraStyleContent.concat(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: "Error",
59429
- description: "Failed to download as PNG.",
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-dev1"), showCodeInRunModeAtom = atom(true);
70789
+ const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-dev13"), showCodeInRunModeAtom = atom(true);
70781
70790
  atom(null);
70782
70791
  var import_compiler_runtime$89 = require_compiler_runtime();
70783
70792
  function useKeydownOnElement(e, r) {
@@ -93082,7 +93091,7 @@ ${c}
93082
93091
  });
93083
93092
  }
93084
93093
  }, SliderComponent = (e) => {
93085
- let r = (0, import_compiler_runtime$26.c)(55), { label: c, setValue: d, value: f, start: _, stop: v, step: y, debounce: S, orientation: w, showValue: E, fullWidth: O, valueMap: M, includeInput: I, disabled: z } = e, G = (0, import_react.useId)(), { locale: q } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), [IY, LY] = (0, import_react.useState)(f), RY, zY;
93094
+ let r = (0, import_compiler_runtime$26.c)(54), { label: c, setValue: d, value: f, start: _, stop: v, step: y, debounce: S, orientation: w, showValue: E, fullWidth: O, valueMap: M, includeInput: I, disabled: z } = e, G = (0, import_react.useId)(), { locale: q } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), [IY, LY] = (0, import_react.useState)(f), RY, zY;
93086
93095
  r[0] === f ? (RY = r[1], zY = r[2]) : (RY = () => {
93087
93096
  LY(f);
93088
93097
  }, zY = [
@@ -93128,10 +93137,10 @@ ${c}
93128
93137
  })
93129
93138
  }), r[27] = IY, r[28] = q, r[29] = E, r[30] = M, r[31] = ZY) : ZY = r[31];
93130
93139
  let QY;
93131
- r[32] !== S || r[33] !== z || r[34] !== I || r[35] !== IY || r[36] !== c || r[37] !== d || r[38] !== _ || r[39] !== y || r[40] !== v || r[41] !== M ? (QY = I && (0, import_jsx_runtime.jsx)(NumberField, {
93140
+ r[32] !== z || r[33] !== I || r[34] !== IY || r[35] !== c || r[36] !== d || r[37] !== _ || r[38] !== y || r[39] !== v || r[40] !== M ? (QY = I && (0, import_jsx_runtime.jsx)(NumberField, {
93132
93141
  value: M(IY),
93133
93142
  onChange: (e2) => {
93134
- (e2 == null || Number.isNaN(e2)) && (e2 = Number(_)), LY(e2), S || d(e2);
93143
+ (e2 == null || Number.isNaN(e2)) && (e2 = Number(_)), LY(e2), d(e2);
93135
93144
  },
93136
93145
  minValue: _,
93137
93146
  maxValue: v,
@@ -93139,25 +93148,25 @@ ${c}
93139
93148
  className: "w-24",
93140
93149
  "aria-label": `${c || "Slider"} value input`,
93141
93150
  isDisabled: z
93142
- }), r[32] = S, r[33] = z, r[34] = I, r[35] = IY, r[36] = c, r[37] = d, r[38] = _, r[39] = y, r[40] = v, r[41] = M, r[42] = QY) : QY = r[42];
93151
+ }), r[32] = z, r[33] = I, r[34] = IY, r[35] = c, r[36] = d, r[37] = _, r[38] = y, r[39] = v, r[40] = M, r[41] = QY) : QY = r[41];
93143
93152
  let $Y;
93144
- r[43] !== XY || r[44] !== ZY || r[45] !== QY || r[46] !== WY ? ($Y = (0, import_jsx_runtime.jsxs)("div", {
93153
+ r[42] !== XY || r[43] !== ZY || r[44] !== QY || r[45] !== WY ? ($Y = (0, import_jsx_runtime.jsxs)("div", {
93145
93154
  className: WY,
93146
93155
  children: [
93147
93156
  XY,
93148
93157
  ZY,
93149
93158
  QY
93150
93159
  ]
93151
- }), r[43] = XY, r[44] = ZY, r[45] = QY, r[46] = WY, r[47] = $Y) : $Y = r[47];
93160
+ }), r[42] = XY, r[43] = ZY, r[44] = QY, r[45] = WY, r[46] = $Y) : $Y = r[46];
93152
93161
  let eX;
93153
- return r[48] !== O || r[49] !== G || r[50] !== c || r[51] !== $Y || r[52] !== BY || r[53] !== HY ? (eX = (0, import_jsx_runtime.jsx)(Labeled, {
93162
+ return r[47] !== O || r[48] !== G || r[49] !== c || r[50] !== $Y || r[51] !== BY || r[52] !== HY ? (eX = (0, import_jsx_runtime.jsx)(Labeled, {
93154
93163
  label: c,
93155
93164
  id: G,
93156
93165
  align: BY,
93157
93166
  fullWidth: O,
93158
93167
  className: HY,
93159
93168
  children: $Y
93160
- }), r[48] = O, r[49] = G, r[50] = c, r[51] = $Y, r[52] = BY, r[53] = HY, r[54] = eX) : eX = r[54], eX;
93169
+ }), r[47] = O, r[48] = G, r[49] = c, r[50] = $Y, r[51] = BY, r[52] = HY, r[53] = eX) : eX = r[53], eX;
93161
93170
  }, import_compiler_runtime$25 = require_compiler_runtime(), SwitchPlugin = class {
93162
93171
  constructor() {
93163
93172
  __publicField(this, "tagName", "marimo-switch");