@marimo-team/islands 0.23.12-dev9 → 0.23.12

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.
Files changed (36) hide show
  1. package/dist/{chat-ui-BEOvjkmJ.js → chat-ui-CsPewo4h.js} +2 -2
  2. package/dist/{code-visibility-w2yZTVwB.js → code-visibility-BFhOAQbo.js} +714 -707
  3. package/dist/{html-to-image-Di0mtt6O.js → html-to-image-DXwLcQ6l.js} +22 -15
  4. package/dist/main.js +1160 -1027
  5. package/dist/{process-output-BLd4KuwX.js → process-output-C6_e1pT_.js} +1 -1
  6. package/dist/{reveal-component-CuqTvwmg.js → reveal-component-ghVwQgXR.js} +13 -13
  7. package/dist/style.css +1 -1
  8. package/package.json +1 -1
  9. package/src/components/data-table/TableBottomBar.tsx +4 -1
  10. package/src/components/data-table/data-table.tsx +26 -17
  11. package/src/components/data-table/utils.ts +1 -4
  12. package/src/components/editor/ai/__tests__/completion-utils.test.ts +48 -2
  13. package/src/components/editor/ai/completion-utils.ts +54 -36
  14. package/src/components/editor/app-container.tsx +3 -1
  15. package/src/components/editor/output/ImageOutput.tsx +12 -3
  16. package/src/components/editor/renderers/vertical-layout/vertical-layout-wrapper.tsx +2 -2
  17. package/src/core/codemirror/go-to-definition/__tests__/commands.test.ts +67 -0
  18. package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +47 -0
  19. package/src/core/codemirror/go-to-definition/commands.ts +47 -30
  20. package/src/core/codemirror/go-to-definition/utils.ts +0 -1
  21. package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +54 -0
  22. package/src/core/codemirror/reactive-references/analyzer.ts +44 -35
  23. package/src/core/islands/__tests__/bridge.test.ts +25 -0
  24. package/src/core/islands/__tests__/parse.test.ts +585 -1
  25. package/src/core/islands/__tests__/test-utils.tsx +10 -1
  26. package/src/core/islands/bridge.ts +6 -1
  27. package/src/core/islands/constants.ts +2 -0
  28. package/src/core/islands/parse.ts +290 -13
  29. package/src/plugins/impl/DataTablePlugin.tsx +20 -1
  30. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +141 -1
  31. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +54 -4
  32. package/src/plugins/impl/anywidget/__tests__/AnyWidgetPlugin.test.tsx +104 -1
  33. package/src/plugins/impl/anywidget/__tests__/model.test.ts +19 -0
  34. package/src/plugins/impl/anywidget/model.ts +15 -0
  35. package/src/utils/__tests__/records.test.ts +27 -0
  36. package/src/utils/records.ts +12 -0
@@ -1,6 +1,6 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
3
- import { at as parseHtmlContent, it as ansiToPlainText } from "./html-to-image-Di0mtt6O.js";
3
+ import { at as parseHtmlContent, it as ansiToPlainText } from "./html-to-image-DXwLcQ6l.js";
4
4
  import { u as createLucideIcon } from "./dist--2Bqjvs0.js";
5
5
  import { t as Strings } from "./strings-Dq_j3Rxw.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
@@ -6,10 +6,10 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
6
6
  import { _ as Logger, g as cn, h as Events, l as useEventListener, t as Button } from "./button-BacYv-bE.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 { lt as kioskModeAtom } from "./html-to-image-Di0mtt6O.js";
9
+ import { lt as kioskModeAtom } from "./html-to-image-DXwLcQ6l.js";
10
10
  import "./chunk-5FQGJX7Z-BbqSm5gU.js";
11
11
  import { u as createLucideIcon } from "./dist--2Bqjvs0.js";
12
- import { a as DEFAULT_SLIDE_TYPE, c as Slide, ct as PanelResizeHandle, i as DEFAULT_DECK_TRANSITION, in as Expand, ot as Panel, rn as EyeOff, s as SlideSidebar, sn as Code, st as PanelGroup, t as useNotebookCodeAvailable } from "./code-visibility-w2yZTVwB.js";
12
+ import { a as DEFAULT_SLIDE_TYPE, an as EyeOff, c as Slide, ct as PanelResizeHandle, i as DEFAULT_DECK_TRANSITION, ln as Code, on as Expand, ot as Panel, s as SlideSidebar, st as PanelGroup, t as useNotebookCodeAvailable } from "./code-visibility-BFhOAQbo.js";
13
13
  import { X as useDebouncedCallback } from "./input-CbEz_aj_.js";
14
14
  import "./toDate-D-l5s8nn.js";
15
15
  import "./react-dom-BTJzcVJ9.js";
@@ -7245,12 +7245,12 @@ function _temp(e5) {
7245
7245
  };
7246
7246
  }
7247
7247
  var SubslideView = (e5) => {
7248
- let t = (0, import_compiler_runtime.c)(24), { subslide: n, resolveShowCode: r, isEditable: i, slideConfigs: a } = e5, o, s, c, l, u, ro;
7248
+ let t = (0, import_compiler_runtime.c)(24), { subslide: n, resolveShowCode: r, isEditable: i, slideConfigs: a } = e5, o, s, c, l, u, f;
7249
7249
  if (t[0] !== i || t[1] !== r || t[2] !== a || t[3] !== n) {
7250
7250
  let { slideLevel: e6, cumulativeByBlock: io2 } = buildSubslideNotes(n, a);
7251
7251
  s = e6;
7252
7252
  let p2 = n.blocks.some((e7) => e7.cells.some((e8) => r(e8.id)));
7253
- o = w, ro = "h-full w-full overflow-auto flex", c = p2 ? "mo-slide-content flex flex-col gap-3" : "mo-slide-content", t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = { margin: "auto 20px" }, t[10] = l) : l = t[10], u = n.blocks.map((e7, t2) => {
7253
+ o = w, f = "h-full w-full overflow-auto flex", c = p2 ? "mo-slide-content flex flex-col gap-3" : "mo-slide-content", t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = { margin: "auto 20px" }, t[10] = l) : l = t[10], u = n.blocks.map((e7, t2) => {
7254
7254
  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, {
7255
7255
  cellId: e8.id,
7256
7256
  status: e8.status,
@@ -7264,8 +7264,8 @@ var SubslideView = (e5) => {
7264
7264
  }, t2);
7265
7265
  }
7266
7266
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: n2 }, t2);
7267
- }), t[0] = i, t[1] = r, t[2] = a, t[3] = n, t[4] = o, t[5] = s, t[6] = c, t[7] = l, t[8] = u, t[9] = ro;
7268
- } else o = t[4], s = t[5], c = t[6], l = t[7], u = t[8], ro = t[9];
7267
+ }), t[0] = i, t[1] = r, t[2] = a, t[3] = n, t[4] = o, t[5] = s, t[6] = c, t[7] = l, t[8] = u, t[9] = f;
7268
+ } else o = t[4], s = t[5], c = t[6], l = t[7], u = t[8], f = t[9];
7269
7269
  let io;
7270
7270
  t[11] !== c || t[12] !== l || t[13] !== u ? (io = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7271
7271
  className: c,
@@ -7273,10 +7273,10 @@ var SubslideView = (e5) => {
7273
7273
  children: u
7274
7274
  }), t[11] = c, t[12] = l, t[13] = u, t[14] = io) : io = t[14];
7275
7275
  let p;
7276
- t[15] !== ro || t[16] !== io ? (p = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7277
- className: ro,
7276
+ t[15] !== f || t[16] !== io ? (p = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7277
+ className: f,
7278
7278
  children: io
7279
- }), t[15] = ro, t[16] = io, t[17] = p) : p = t[17];
7279
+ }), t[15] = f, t[16] = io, t[17] = p) : p = t[17];
7280
7280
  let ao;
7281
7281
  t[18] === s ? ao = t[19] : (ao = s && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NotesAside, { text: s }), t[18] = s, t[19] = ao);
7282
7282
  let oo;
@@ -7302,7 +7302,7 @@ var ParkedPreviewContent = (e5) => {
7302
7302
  status: n.status,
7303
7303
  output: n.output
7304
7304
  }), t[3] = n.id, t[4] = n.output, t[5] = n.status, t[6] = o) : o = t[6], o;
7305
- }, reveal_component_default = ({ slideCells: e5, layout: o, setLayout: s, noOutputIds: l, activeIndex: u, onSlideChange: f, mode: io, configWidth: fo, isEditable: po = false }) => {
7305
+ }, reveal_component_default = ({ slideCells: e5, layout: o, setLayout: s, noOutputIds: l, activeIndex: u, onSlideChange: ro, mode: p, configWidth: fo, isEditable: po = false }) => {
7306
7306
  var _a2, _b2;
7307
7307
  let yo = (0, import_react.useRef)(null), bo = (0, import_react.useRef)(null), { width: So, height: Co } = useSlideDimensions(yo), wo = useFullScreenElement() != null, To = useAtomValue(kioskModeAtom), Eo = (0, import_react.useMemo)(() => To ? [] : [ce], [To]), [Do, Oo] = (0, import_react.useState)(() => /* @__PURE__ */ new Set()), ko = useNotebookCodeAvailable(e5), Ao = !isIslands() && ko, jo = u == null ? void 0 : e5[u], Mo = jo ?? e5.at(0), { parkedPreviewCell: No, isHeldEdit: Po, isNoOutputPreview: Fo, heldEditCellId: Io, heldShowsCode: Lo, toggleHeldShowsCode: Ro } = useParkedPreview({
7308
7308
  activeCell: jo,
@@ -7391,14 +7391,14 @@ var ParkedPreviewContent = (e5) => {
7391
7391
  let e6 = bo.current;
7392
7392
  if (!e6) return;
7393
7393
  let t = resolveActiveCellIndex(Go, e6.getIndices());
7394
- t != null && (f == null ? void 0 : f(t));
7394
+ t != null && (ro == null ? void 0 : ro(t));
7395
7395
  }), $o = useEvent_default((t) => {
7396
7396
  if (!No || u == null || Events.fromInput(t)) return;
7397
7397
  let n = classifyNavKey(t);
7398
7398
  if (n === 0) return;
7399
7399
  t.preventDefault(), t.stopPropagation();
7400
7400
  let i = u + n;
7401
- i < 0 || i >= e5.length || (f == null ? void 0 : f(i));
7401
+ i < 0 || i >= e5.length || (ro == null ? void 0 : ro(i));
7402
7402
  }), ns = useEvent_default(() => {
7403
7403
  Qo(), triggerResize(bo.current);
7404
7404
  });
@@ -7494,7 +7494,7 @@ var ParkedPreviewContent = (e5) => {
7494
7494
  ]
7495
7495
  })
7496
7496
  });
7497
- return io === "read" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7497
+ return p === "read" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7498
7498
  className: "flex-1 min-w-0 flex flex-row gap-3",
7499
7499
  children: os
7500
7500
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {