@marimo-team/islands 0.19.7-dev31 → 0.19.7-dev34

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
@@ -34867,7 +34867,7 @@ ${c.sqlString}
34867
34867
  let e2 = r === "validate" ? "default" : "validate";
34868
34868
  e2 === "default" && clearAllSqlValidationErrors(), c(e2);
34869
34869
  }, e[0] = c, e[1] = r, e[2] = d) : d = e[2];
34870
- let f = d, _ = _temp4$12, v = _temp5$8, y;
34870
+ let f = d, _ = _temp4$11, v = _temp5$8, y;
34871
34871
  e[3] === r ? y = e[4] : (y = v(r), e[3] = r, e[4] = y);
34872
34872
  let S;
34873
34873
  e[5] === r ? S = e[6] : (S = _(r), e[5] = r, e[6] = S);
@@ -34931,7 +34931,7 @@ ${c.sqlString}
34931
34931
  function _temp3$20(e) {
34932
34932
  return e = e.filter(_temp$39), e.map(_temp2$27);
34933
34933
  }
34934
- function _temp4$12(e) {
34934
+ function _temp4$11(e) {
34935
34935
  return e === "validate" ? (0, import_jsx_runtime.jsx)(SearchCheck, {
34936
34936
  className: "h-3 w-3"
34937
34937
  }) : (0, import_jsx_runtime.jsx)(DatabaseBackup, {
@@ -51487,7 +51487,7 @@ Database schema: ${c}`), (_a3 = r2.aiFix) == null ? void 0 : _a3.setAiCompletion
51487
51487
  if (c.some(_temp$36)) v = "Interrupted";
51488
51488
  else if (c.some(_temp2$25)) v = "An internal error occurred";
51489
51489
  else if (c.some(_temp3$18)) v = "Ancestor prevented from running", y = "default", S = "text-secondary-foreground";
51490
- else if (c.some(_temp4$11)) v = "Ancestor stopped", y = "default", S = "text-secondary-foreground";
51490
+ else if (c.some(_temp4$10)) v = "Ancestor stopped", y = "default", S = "text-secondary-foreground";
51491
51491
  else if (c.some(_temp5$7)) v = "SQL error";
51492
51492
  else {
51493
51493
  let e2;
@@ -51860,7 +51860,7 @@ Database schema: ${c}`), (_a3 = r2.aiFix) == null ? void 0 : _a3.setAiCompletion
51860
51860
  function _temp3$18(e) {
51861
51861
  return e.type === "ancestor-prevented";
51862
51862
  }
51863
- function _temp4$11(e) {
51863
+ function _temp4$10(e) {
51864
51864
  return e.type === "ancestor-stopped";
51865
51865
  }
51866
51866
  function _temp5$7(e) {
@@ -52191,6 +52191,85 @@ Database schema: ${c}`), (_a3 = r2.aiFix) == null ? void 0 : _a3.setAiCompletion
52191
52191
  function isOutputEmpty(e) {
52192
52192
  return e == null || e.data == null || e.data === "";
52193
52193
  }
52194
+ function createMimeConfig(e) {
52195
+ let r = /* @__PURE__ */ new Map();
52196
+ for (let c2 = 0; c2 < e.precedence.length; c2++) r.set(e.precedence[c2], c2);
52197
+ let c = /* @__PURE__ */ new Map();
52198
+ for (let [r2, d] of Object.entries(e.hidingRules)) c.set(r2, new Set(d));
52199
+ return {
52200
+ precedence: r,
52201
+ hidingRules: c
52202
+ };
52203
+ }
52204
+ const getDefaultMimeConfig = once(() => {
52205
+ let e = [
52206
+ "image/png",
52207
+ "image/jpeg",
52208
+ "image/gif"
52209
+ ];
52210
+ return createMimeConfig({
52211
+ precedence: [
52212
+ "text/html",
52213
+ "application/vnd.vegalite.v6+json",
52214
+ "application/vnd.vegalite.v5+json",
52215
+ "application/vnd.vega.v6+json",
52216
+ "application/vnd.vega.v5+json",
52217
+ "image/svg+xml",
52218
+ "image/png",
52219
+ "image/jpeg",
52220
+ "image/gif",
52221
+ "text/markdown",
52222
+ "text/latex",
52223
+ "text/csv",
52224
+ "application/json",
52225
+ "text/plain",
52226
+ "video/mp4",
52227
+ "video/mpeg"
52228
+ ],
52229
+ hidingRules: {
52230
+ "text/html": [
52231
+ ...e,
52232
+ "image/avif",
52233
+ "image/bmp",
52234
+ "image/tiff"
52235
+ ],
52236
+ "application/vnd.vegalite.v6+json": e,
52237
+ "application/vnd.vegalite.v5+json": e,
52238
+ "application/vnd.vega.v6+json": e,
52239
+ "application/vnd.vega.v5+json": e
52240
+ }
52241
+ });
52242
+ });
52243
+ function applyHidingRules(e, r) {
52244
+ let c = /* @__PURE__ */ new Set();
52245
+ for (let d2 of e) {
52246
+ let f = r.get(d2);
52247
+ if (f) for (let r2 of f) e.has(r2) && c.add(r2);
52248
+ }
52249
+ let d = /* @__PURE__ */ new Set();
52250
+ for (let r2 of e) c.has(r2) || d.add(r2);
52251
+ return {
52252
+ visible: d,
52253
+ hidden: c
52254
+ };
52255
+ }
52256
+ function sortByPrecedence(e, r) {
52257
+ let c = r.size;
52258
+ return [
52259
+ ...e
52260
+ ].sort((e2, d) => (r.get(e2[0]) ?? c) - (r.get(d[0]) ?? c));
52261
+ }
52262
+ function processMimeBundle(e, r = getDefaultMimeConfig()) {
52263
+ if (e.length === 0) return {
52264
+ entries: [],
52265
+ hidden: []
52266
+ };
52267
+ let { visible: c, hidden: d } = applyHidingRules(new Set(e.map(([e2]) => e2)), r.hidingRules);
52268
+ return {
52269
+ entries: sortByPrecedence(e.filter(([e2]) => c.has(e2)), r.precedence),
52270
+ hidden: Array.from(d)
52271
+ };
52272
+ }
52194
52273
  const LazyVegaEmbed = import_react.lazy(() => import("./react-vega-DgHpnZ04.js").then((e) => ({
52195
52274
  default: e.VegaEmbed
52196
52275
  })));
@@ -61390,7 +61469,7 @@ ${r}
61390
61469
  async function toPng$1(e, r = {}) {
61391
61470
  return (await toCanvas(e, r)).toDataURL();
61392
61471
  }
61393
- const defaultHtmlToImageOptions = {
61472
+ const necessaryStyleProperties = "width.height.min-width.min-height.max-width.max-height.box-sizing.aspect-ratio.display.position.top.left.bottom.right.z-index.float.clear.flex.flex-direction.flex-wrap.flex-grow.flex-shrink.flex-basis.align-items.align-self.justify-content.gap.order.grid-template-columns.grid-template-rows.grid-column.grid-row.row-gap.column-gap.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.font.font-family.font-size.font-weight.font-style.line-height.letter-spacing.word-spacing.text-align.text-decoration.text-transform.text-indent.text-shadow.white-space.text-wrap.word-break.text-overflow.vertical-align.color.background.background-color.background-image.background-size.background-position.background-repeat.background-clip.border.border-width.border-style.border-color.border-top.border-right.border-bottom.border-left.border-radius.outline.box-shadow.text-shadow.opacity.filter.backdrop-filter.mix-blend-mode.transform.clip-path.visibility.fill.stroke.stroke-width.object-fit.object-position.list-style.list-style-type.border-collapse.border-spacing.content.cursor".split("."), defaultHtmlToImageOptions = {
61394
61473
  filter: (e) => {
61395
61474
  try {
61396
61475
  return !("classList" in e && (e.classList.contains("mpl-toolbar") || e.classList.contains("no-print")));
@@ -61402,9 +61481,10 @@ ${r}
61402
61481
  Logger.error("Error loading image:", e);
61403
61482
  }
61404
61483
  };
61405
- async function toPng(e, r) {
61484
+ async function toPng(e, r, c) {
61406
61485
  return toPng$1(e, {
61407
61486
  ...defaultHtmlToImageOptions,
61487
+ includeStyleProperties: c ? necessaryStyleProperties : void 0,
61408
61488
  ...r
61409
61489
  });
61410
61490
  }
@@ -62831,7 +62911,7 @@ ${O}`,
62831
62911
  if (r[0] !== y || r[1] !== f || r[2] !== d || r[3] !== S || r[4] !== _) {
62832
62912
  q = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
62833
62913
  bb0: {
62834
- let e2 = Objects.entries(_).filter(_temp$33).map(_temp2$24), c2 = (_a2 = e2[0]) == null ? void 0 : _a2[0];
62914
+ let { entries: e2 } = processMimeBundle(Objects.entries(_).filter(_temp$33).map(_temp2$24)), c2 = (_a2 = e2[0]) == null ? void 0 : _a2[0];
62835
62915
  if (!c2) {
62836
62916
  q = null;
62837
62917
  break bb0;
@@ -62841,18 +62921,18 @@ ${O}`,
62841
62921
  cellId: f,
62842
62922
  message: {
62843
62923
  channel: d,
62844
- data: _[c2],
62924
+ data: e2[0][1],
62845
62925
  mimetype: c2
62846
62926
  },
62847
62927
  metadata: S == null ? void 0 : S[c2]
62848
62928
  });
62849
62929
  break bb0;
62850
62930
  }
62851
- e2.sort(_temp3$17), w = Tabs, z = c2, G = "vertical", M = "flex";
62931
+ w = Tabs, z = c2, G = "vertical", M = "flex";
62852
62932
  let v2 = y && "mt-4", IY2;
62853
62933
  r[13] === v2 ? IY2 = r[14] : (IY2 = cn("self-start max-h-none flex flex-col gap-2 mr-3 shrink-0", v2), r[13] = v2, r[14] = IY2), I = (0, import_jsx_runtime.jsx)(TabsList, {
62854
62934
  className: IY2,
62855
- children: e2.map(_temp4$10)
62935
+ children: e2.map(_temp3$17)
62856
62936
  }), E = "flex-1 w-full";
62857
62937
  let LY2;
62858
62938
  r[15] !== f || r[16] !== d || r[17] !== S ? (LY2 = (e3) => {
@@ -63039,11 +63119,7 @@ ${O}`,
63039
63119
  c
63040
63120
  ];
63041
63121
  }
63042
- function _temp3$17(e, r) {
63043
- let [c] = e;
63044
- return c === "text/html" ? -1 : 0;
63045
- }
63046
- function _temp4$10(e) {
63122
+ function _temp3$17(e) {
63047
63123
  let [r] = e;
63048
63124
  return (0, import_jsx_runtime.jsx)(TabsTrigger, {
63049
63125
  value: r,
@@ -73082,7 +73158,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
73082
73158
  return Logger.warn("Failed to get version from mount config"), null;
73083
73159
  }
73084
73160
  }
73085
- const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.7-dev31"), showCodeInRunModeAtom = atom(true);
73161
+ const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.7-dev34"), showCodeInRunModeAtom = atom(true);
73086
73162
  atom(null);
73087
73163
  var import_compiler_runtime$88 = require_compiler_runtime();
73088
73164
  function useKeydownOnElement(e, r) {