@marimo-team/islands 0.23.16-dev13 → 0.23.16-dev15

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.
@@ -6,13 +6,13 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
6
6
  import { c as useEventListener, g as Logger, h as cn, m as Events, t as Button } from "./button-BSm8IXRU.js";
7
7
  import { t as require_react } from "./react-DA-nE2FX.js";
8
8
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
9
- import { dt as kioskModeAtom, ht as outputIsStale } from "./html-to-image-Bif4utQZ.js";
9
+ import { ut as outputIsStale } from "./html-to-image-C0Yzb7i_.js";
10
10
  import "./chunk-5FQGJX7Z-B9WoXK1R.js";
11
11
  import { u as createLucideIcon } from "./dist-DIlxLFXG.js";
12
- import { a as DEFAULT_DECK_VERTICAL_ALIGN, c as SlideSidebar, cn as EyeOff, ct as Panel, fn as Code, i as DEFAULT_DECK_TRANSITION, l as Slide, ln as Expand, lt as PanelGroup, o as DEFAULT_SLIDE_TYPE, t as useNotebookCodeAvailable, ut as PanelResizeHandle } from "./code-visibility-DgtKp1AN.js";
12
+ import { a as DEFAULT_DECK_VERTICAL_ALIGN, c as SlideSidebar, cn as EyeOff, ct as Panel, fn as Code, i as DEFAULT_DECK_TRANSITION, l as Slide, ln as Expand, lt as PanelGroup, o as DEFAULT_SLIDE_TYPE, t as useNotebookCodeAvailable, ut as PanelResizeHandle } from "./code-visibility-D3Ara34d.js";
13
13
  import { R as ChevronDown } from "./strings-DIy9NAmg.js";
14
14
  import { X as useDebouncedCallback } from "./input-C5K4VBvB.js";
15
- import "./toDate-CmR_xR3P.js";
15
+ import { v as kioskModeAtom } from "./toDate-CqhBWjvO.js";
16
16
  import "./react-dom-BTJzcVJ9.js";
17
17
  import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
18
18
  import { X as useFullScreenElement } from "./zod-BUcyXSdR.js";
@@ -4739,8 +4739,8 @@ const SlideNotesEditor = (e5) => {
4739
4739
  className: "flex items-center gap-1.5 px-3 h-8 shrink-0 text-xs font-medium uppercase tracking-wide text-muted-foreground",
4740
4740
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StickyNote, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Speaker notes" })]
4741
4741
  }), t[17] = To) : To = t[17];
4742
- let Eo;
4743
- t[18] !== o || t[19] !== l || t[20] !== Co ? (Eo = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4742
+ let Do;
4743
+ t[18] !== o || t[19] !== l || t[20] !== Co ? (Do = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
4744
4744
  className: "flex-1 min-h-0 p-2",
4745
4745
  children: o ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
4746
4746
  value: l,
@@ -4753,14 +4753,14 @@ const SlideNotesEditor = (e5) => {
4753
4753
  className: "h-full flex items-center justify-center text-xs text-muted-foreground",
4754
4754
  children: "Select a slide to add notes."
4755
4755
  })
4756
- }), t[18] = o, t[19] = l, t[20] = Co, t[21] = Eo) : Eo = t[21];
4756
+ }), t[18] = o, t[19] = l, t[20] = Co, t[21] = Do) : Do = t[21];
4757
4757
  let Oo;
4758
- return t[22] !== wo || t[23] !== Eo ? (Oo = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
4758
+ return t[22] !== wo || t[23] !== Do ? (Oo = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
4759
4759
  className: wo,
4760
4760
  "aria-label": "Speaker notes",
4761
4761
  onKeyDown: _temp$1,
4762
- children: [To, Eo]
4763
- }), t[22] = wo, t[23] = Eo, t[24] = Oo) : Oo = t[24], Oo;
4762
+ children: [To, Do]
4763
+ }), t[22] = wo, t[23] = Do, t[24] = Oo) : Oo = t[24], Oo;
4764
4764
  };
4765
4765
  function _temp$1(e5) {
4766
4766
  return e5.stopPropagation();
@@ -7326,12 +7326,12 @@ function resolveSlideContentStyle(e5) {
7326
7326
  }
7327
7327
  }
7328
7328
  var SubslideView = (e5) => {
7329
- let t = (0, import_compiler_runtime.c)(24), { subslide: n, resolveShowCode: r, isEditable: i, slideConfigs: a, contentStyle: o } = e5, s, c, u, f, go, _o;
7329
+ let t = (0, import_compiler_runtime.c)(24), { subslide: n, resolveShowCode: r, isEditable: i, slideConfigs: a, contentStyle: o } = e5, s, l, u, f, go, _o;
7330
7330
  if (t[0] !== o || t[1] !== i || t[2] !== r || t[3] !== a || t[4] !== n) {
7331
7331
  let { slideLevel: e6, cumulativeByBlock: p2 } = buildSubslideNotes(n, a);
7332
7332
  u = e6;
7333
7333
  let vo2 = n.blocks.some((e7) => e7.cells.some((e8) => r(e8.id)));
7334
- c = w, s = SlideScrollContainer, f = vo2 ? "mo-slide-content flex flex-col gap-3" : "mo-slide-content", go = o, _o = n.blocks.map((e7, t2) => {
7334
+ l = w, s = SlideScrollContainer, f = vo2 ? "mo-slide-content flex flex-col gap-3" : "mo-slide-content", go = o, _o = n.blocks.map((e7, t2) => {
7335
7335
  let n2 = e7.cells.map((e8) => r(e8.id) ? i ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlideCellView, { cell: e8 }, e8.id) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlideCellReadOnlyView, { cell: e8 }, e8.id) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slide, {
7336
7336
  cellId: e8.id,
7337
7337
  status: e8.status,
@@ -7346,8 +7346,8 @@ var SubslideView = (e5) => {
7346
7346
  }, t2);
7347
7347
  }
7348
7348
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: n2 }, t2);
7349
- }), t[0] = o, t[1] = i, t[2] = r, t[3] = a, t[4] = n, t[5] = s, t[6] = c, t[7] = u, t[8] = f, t[9] = go, t[10] = _o;
7350
- } else s = t[5], c = t[6], u = t[7], f = t[8], go = t[9], _o = t[10];
7349
+ }), t[0] = o, t[1] = i, t[2] = r, t[3] = a, t[4] = n, t[5] = s, t[6] = l, t[7] = u, t[8] = f, t[9] = go, t[10] = _o;
7350
+ } else s = t[5], l = t[6], u = t[7], f = t[8], go = t[9], _o = t[10];
7351
7351
  let p;
7352
7352
  t[11] !== f || t[12] !== go || t[13] !== _o ? (p = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7353
7353
  className: f,
@@ -7356,10 +7356,10 @@ var SubslideView = (e5) => {
7356
7356
  }), t[11] = f, t[12] = go, t[13] = _o, t[14] = p) : p = t[14];
7357
7357
  let vo;
7358
7358
  t[15] !== s || t[16] !== p ? (vo = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(s, { children: p }), t[15] = s, t[16] = p, t[17] = vo) : vo = t[17];
7359
- let yo;
7360
- t[18] === u ? yo = t[19] : (yo = u && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NotesAside, { text: u }), t[18] = u, t[19] = yo);
7359
+ let bo;
7360
+ t[18] === u ? bo = t[19] : (bo = u && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NotesAside, { text: u }), t[18] = u, t[19] = bo);
7361
7361
  let xo;
7362
- return t[20] !== c || t[21] !== vo || t[22] !== yo ? (xo = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(c, { children: [vo, yo] }), t[20] = c, t[21] = vo, t[22] = yo, t[23] = xo) : xo = t[23], xo;
7362
+ return t[20] !== l || t[21] !== vo || t[22] !== bo ? (xo = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(l, { children: [vo, bo] }), t[20] = l, t[21] = vo, t[22] = bo, t[23] = xo) : xo = t[23], xo;
7363
7363
  };
7364
7364
  function parkedRendersSource(e5) {
7365
7365
  let { isNoOutputPreview: t, isEditable: n, showCode: r } = e5;
@@ -7375,21 +7375,21 @@ var ParkedPreviewContent = (e5) => {
7375
7375
  let e6;
7376
7376
  return t[0] !== n || t[1] !== i ? (e6 = i ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlideCellView, { cell: n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlideCellReadOnlyView, { cell: n }), t[0] = n, t[1] = i, t[2] = e6) : e6 = t[2], e6;
7377
7377
  }
7378
- let o = n.id, s = n.status, c = n.output, u;
7378
+ let o = n.id, s = n.status, l = n.output, u;
7379
7379
  t[3] === n ? u = t[4] : (u = outputIsStale(n, false), t[3] = n, t[4] = u);
7380
7380
  let f;
7381
7381
  return t[5] !== n.id || t[6] !== n.output || t[7] !== n.status || t[8] !== u ? (f = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slide, {
7382
7382
  cellId: o,
7383
7383
  status: s,
7384
- output: c,
7384
+ output: l,
7385
7385
  stale: u
7386
7386
  }), t[5] = n.id, t[6] = n.output, t[7] = n.status, t[8] = u, t[9] = f) : f = t[9], f;
7387
- }, reveal_component_default = ({ slideCells: e5, layout: o, setLayout: s, noOutputIds: l, activeIndex: u, onSlideChange: f, mode: yo, configWidth: bo, isEditable: Co = false }) => {
7387
+ }, reveal_component_default = ({ slideCells: e5, layout: o, setLayout: s, noOutputIds: c, activeIndex: l, onSlideChange: u, mode: vo, configWidth: yo, isEditable: So = false }) => {
7388
7388
  var _a2, _b2, _c;
7389
- let Eo = (0, import_react.useRef)(null), Do = (0, import_react.useRef)(null), { width: Oo, height: Po } = useSlideDimensions(Eo), Fo = useFullScreenElement() != null, Lo = useAtomValue(kioskModeAtom), Ro = (0, import_react.useMemo)(() => Lo ? [] : [ce], [Lo]), [zo, Bo] = (0, import_react.useState)(() => /* @__PURE__ */ new Set()), Vo = useNotebookCodeAvailable(e5), Ho = !isIslands() && Vo, Uo = u == null ? void 0 : e5[u], Wo = Uo ?? e5.at(0), { parkedPreviewCell: Go, isHeldEdit: Ko, isNoOutputPreview: qo, heldEditCellId: Jo, heldShowsCode: Yo, toggleHeldShowsCode: Xo } = useParkedPreview({
7389
+ let To = (0, import_react.useRef)(null), Eo = (0, import_react.useRef)(null), { width: Oo, height: Po } = useSlideDimensions(To), Fo = useFullScreenElement() != null, Lo = useAtomValue(kioskModeAtom), Ro = (0, import_react.useMemo)(() => Lo ? [] : [ce], [Lo]), [zo, Bo] = (0, import_react.useState)(() => /* @__PURE__ */ new Set()), Vo = useNotebookCodeAvailable(e5), Ho = !isIslands() && Vo, Uo = l == null ? void 0 : e5[l], Wo = Uo ?? e5.at(0), { parkedPreviewCell: Go, isHeldEdit: Ko, isNoOutputPreview: qo, heldEditCellId: Jo, heldShowsCode: Yo, toggleHeldShowsCode: Xo } = useParkedPreview({
7390
7390
  activeCell: Uo,
7391
7391
  slideConfigs: o.cells,
7392
- noOutputIds: l
7392
+ noOutputIds: c
7393
7393
  }), Zo = (e6) => shouldShowCode({
7394
7394
  cells: o.cells,
7395
7395
  cellId: e6,
@@ -7399,13 +7399,13 @@ var ParkedPreviewContent = (e5) => {
7399
7399
  cells: e5,
7400
7400
  getType: (e6) => deckSlideType({
7401
7401
  cell: e6,
7402
- noOutputIds: l,
7402
+ noOutputIds: c,
7403
7403
  heldEditCellId: Jo,
7404
7404
  slideConfigs: o.cells
7405
7405
  })
7406
7406
  }), [
7407
7407
  e5,
7408
- l,
7408
+ c,
7409
7409
  o.cells,
7410
7410
  Jo
7411
7411
  ]), { cellToTarget: is, targetToCellIndex: as } = (0, import_react.useMemo)(() => buildSlideIndices({
@@ -7433,7 +7433,7 @@ var ParkedPreviewContent = (e5) => {
7433
7433
  cs
7434
7434
  ]), us = useEvent_default((t) => {
7435
7435
  let n = resolveDeckNavigationTarget({
7436
- activeIndex: u,
7436
+ activeIndex: l,
7437
7437
  cells: e5,
7438
7438
  cellToTarget: is,
7439
7439
  getId: (e6) => e6.id
@@ -7441,10 +7441,10 @@ var ParkedPreviewContent = (e5) => {
7441
7441
  r && (t.slide(r.h, r.v, r.f), clearPreviousVerticalIndices(t));
7442
7442
  });
7443
7443
  (0, import_react.useEffect)(() => {
7444
- let e6 = Do.current;
7444
+ let e6 = Eo.current;
7445
7445
  e6 != null && us(e6);
7446
7446
  }, [
7447
- u,
7447
+ l,
7448
7448
  is,
7449
7449
  e5,
7450
7450
  us
@@ -7471,27 +7471,27 @@ var ParkedPreviewContent = (e5) => {
7471
7471
  t instanceof HTMLElement && (t.tabIndex = -1, t.focus({ preventScroll: true }));
7472
7472
  }), ps = useEvent_default(() => {
7473
7473
  if (Go != null) return;
7474
- let e6 = Do.current;
7474
+ let e6 = Eo.current;
7475
7475
  if (!e6) return;
7476
7476
  let t = resolveActiveCellIndex(as, e6.getIndices());
7477
- t != null && (f == null ? void 0 : f(t));
7477
+ t != null && (u == null ? void 0 : u(t));
7478
7478
  }), ms = useEvent_default((t) => {
7479
- if (!Go || u == null || Events.fromInput(t)) return;
7479
+ if (!Go || l == null || Events.fromInput(t)) return;
7480
7480
  let n = classifyNavKey(t);
7481
7481
  if (n === 0) return;
7482
7482
  t.preventDefault(), t.stopPropagation();
7483
- let r = u + n;
7484
- r < 0 || r >= e5.length || (f == null ? void 0 : f(r));
7483
+ let r = l + n;
7484
+ r < 0 || r >= e5.length || (u == null ? void 0 : u(r));
7485
7485
  }), hs = useEvent_default(() => {
7486
7486
  ps();
7487
7487
  });
7488
7488
  useEventListener(document, "keydown", ms, { capture: true });
7489
7489
  let gs = Ko ? null : qo ? "Hidden as there is no output" : "Skipped in presentation", _s = Ko ? Yo : Zo(Go == null ? void 0 : Go.id), vs = parkedRendersSource({
7490
7490
  isNoOutputPreview: qo,
7491
- isEditable: Co,
7491
+ isEditable: So,
7492
7492
  showCode: _s
7493
7493
  }), ys = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7494
- ref: Eo,
7494
+ ref: To,
7495
7495
  className: "h-full w-full min-w-0 flex items-center justify-center overflow-hidden",
7496
7496
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7497
7497
  className: "group relative",
@@ -7501,7 +7501,7 @@ var ParkedPreviewContent = (e5) => {
7501
7501
  },
7502
7502
  children: [
7503
7503
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(b, {
7504
- deckRef: Do,
7504
+ deckRef: Eo,
7505
7505
  className: "aspect-video w-full overflow-hidden border rounded bg-background mo-slides-theme prose-slides focus:outline-hidden focus-visible:outline-hidden",
7506
7506
  config: ls,
7507
7507
  onReady: fs,
@@ -7512,13 +7512,13 @@ var ParkedPreviewContent = (e5) => {
7512
7512
  children: rs.stacks.map((e6, t) => e6.subslides.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubslideView, {
7513
7513
  subslide: e6.subslides[0],
7514
7514
  resolveShowCode: Zo,
7515
- isEditable: Co,
7515
+ isEditable: So,
7516
7516
  slideConfigs: o.cells,
7517
7517
  contentStyle: ss
7518
7518
  }, t) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ne, { children: e6.subslides.map((e7, t2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubslideView, {
7519
7519
  subslide: e7,
7520
7520
  resolveShowCode: Zo,
7521
- isEditable: Co,
7521
+ isEditable: So,
7522
7522
  slideConfigs: o.cells,
7523
7523
  contentStyle: ss
7524
7524
  }, t2)) }, t))
@@ -7537,7 +7537,7 @@ var ParkedPreviewContent = (e5) => {
7537
7537
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ParkedPreviewContent, {
7538
7538
  cell: Go,
7539
7539
  isNoOutputPreview: qo,
7540
- isEditable: Co,
7540
+ isEditable: So,
7541
7541
  showCode: _s
7542
7542
  })
7543
7543
  })
@@ -7568,7 +7568,7 @@ var ParkedPreviewContent = (e5) => {
7568
7568
  "aria-label": "Enter fullscreen",
7569
7569
  onClick: () => {
7570
7570
  var _a3, _b3;
7571
- (_b3 = (_a3 = Do.current) == null ? void 0 : _a3.getViewportElement()) == null ? void 0 : _b3.requestFullscreen().catch((e6) => {
7571
+ (_b3 = (_a3 = Eo.current) == null ? void 0 : _a3.getViewportElement()) == null ? void 0 : _b3.requestFullscreen().catch((e6) => {
7572
7572
  Logger.error("Failed to request fullscreen", e6);
7573
7573
  });
7574
7574
  },
@@ -7579,7 +7579,7 @@ var ParkedPreviewContent = (e5) => {
7579
7579
  ]
7580
7580
  })
7581
7581
  });
7582
- return yo === "read" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7582
+ return vo === "read" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7583
7583
  className: "flex-1 min-w-0 flex flex-row gap-3",
7584
7584
  children: ys
7585
7585
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -7615,7 +7615,7 @@ var ParkedPreviewContent = (e5) => {
7615
7615
  })
7616
7616
  ]
7617
7617
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlideSidebar, {
7618
- configWidth: bo,
7618
+ configWidth: yo,
7619
7619
  layout: o,
7620
7620
  setLayout: s,
7621
7621
  activeConfigCell: Wo