@marimo-team/islands 0.26.1-dev105 → 0.26.1-dev108

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 (97) hide show
  1. package/dist/{ConnectedDataExplorerComponent-C6dY5fiI.js → ConnectedDataExplorerComponent-DQaiOY7w.js} +15 -15
  2. package/dist/{ErrorBoundary-Bn664FZa.js → ErrorBoundary-BW4TciqU.js} +19 -19
  3. package/dist/{abnfDiagram-VCTEODGH-Ba0MYVW8.js → abnfDiagram-VCTEODGH-Df80tEYq.js} +2 -2
  4. package/dist/{any-language-editor-BNe8do3C.js → any-language-editor-BW-gNmbk.js} +2 -2
  5. package/dist/{architectureDiagram-5GKGNRK7-7MqAehef.js → architectureDiagram-5GKGNRK7-DNNMvKkY.js} +1 -1
  6. package/dist/{assertNever-5vhHGKOK.js → assertNever-B9_7z-dW.js} +13 -13
  7. package/dist/{chat-ui-zGgiq5zN.js → chat-ui-Be9X-W22.js} +49 -49
  8. package/dist/{check-DUIc04aK.js → check-BqF09bSG.js} +1 -1
  9. package/dist/{chunk-IMKFNOWR-CAWA0HGB.js → chunk-IMKFNOWR-pXqnQ_fj.js} +1 -1
  10. package/dist/{chunk-SHT3W25Y-BIwVQjG5.js → chunk-SHT3W25Y-BWrxB3I2.js} +1 -1
  11. package/dist/{chunk-SVP7TREG-Cux251TB.js → chunk-SVP7TREG-CPdQP8_U.js} +1 -1
  12. package/dist/{chunk-TICWLB2K-DJVQ6khO.js → chunk-TICWLB2K-C5MYCwBz.js} +1 -1
  13. package/dist/{circle-question-mark-evCnVIut.js → circle-question-mark-YmLYXyvS.js} +1 -1
  14. package/dist/{classDiagram-ZZMXUADV-Cwve77ev.js → classDiagram-ZZMXUADV-Ba0SRm01.js} +2 -2
  15. package/dist/{classDiagram-v2-VYDZK3BY-BAeHKXmD.js → classDiagram-v2-VYDZK3BY-DSSzL_Dk.js} +2 -2
  16. package/dist/{code-visibility-CMgSFUs7.js → code-visibility-BKmktPMd.js} +18 -18
  17. package/dist/{common-DWnR77Qk.js → common-CSJAjJGa.js} +168 -168
  18. package/dist/{copy-icon-CmNLxT5_.js → copy-icon-zP4__HPI.js} +2 -2
  19. package/dist/{createReducer-m7yAXmDu.js → createReducer-CArOwUaJ.js} +1 -1
  20. package/dist/{cynefinDiagram-5FMLGOSQ-t4eEkPJh.js → cynefinDiagram-5FMLGOSQ-BOtNvA04.js} +1 -1
  21. package/dist/{dagre-GXQ25YYZ-IuZuI28B.js → dagre-GXQ25YYZ-FpCEOTxX.js} +1 -1
  22. package/dist/{data-grid-overlay-editor-zS1h3iMI.js → data-grid-overlay-editor-DTibdR4H.js} +1 -1
  23. package/dist/{diagram-S7CK7UJ4-D8R5Q_ok.js → diagram-S7CK7UJ4-Cm1HaBuu.js} +1 -1
  24. package/dist/{diagram-UQ7AKVKN-BGuMPsr-.js → diagram-UQ7AKVKN-D1lA7Ggu.js} +1 -1
  25. package/dist/{diagram-VX7I27RA-BkTtpO8P.js → diagram-VX7I27RA-BX3e-Rue.js} +1 -1
  26. package/dist/{diagram-Z3DM3KII-C0__Mxfm.js → diagram-Z3DM3KII-Dgoj7bPf.js} +1 -1
  27. package/dist/{dialog-BvjfalZ9.js → dialog-DfKgafXJ.js} +30 -30
  28. package/dist/{dropdown-menu-D0DeN-aL.js → dropdown-menu-Dge_SmqE.js} +168 -168
  29. package/dist/{ebnfDiagram-PWID7BFC-CSESPZoz.js → ebnfDiagram-PWID7BFC-B0xWiXrz.js} +2 -2
  30. package/dist/{erDiagram-RLTQ6QDP-DsDTtabH.js → erDiagram-RLTQ6QDP-Cm-GO31-.js} +1 -1
  31. package/dist/{error-banner-CXLjTW24.js → error-banner-CfYrJaIb.js} +91 -91
  32. package/dist/{error-entries-DVclFjaE.js → error-entries-23Z_1oDM.js} +584 -590
  33. package/dist/{export-context-CkgZeARR.js → export-context-B1jdxzHF.js} +21 -21
  34. package/dist/{feedback-button-BMGqp8Ff.js → feedback-button-CPu5SV3b.js} +72 -72
  35. package/dist/{flowDiagram-HODETNUW-qxDPYbfV.js → flowDiagram-HODETNUW-CH6xMlW_.js} +2 -2
  36. package/dist/{formats-CcQrzFo8.js → formats-Y52bg800.js} +1 -1
  37. package/dist/{glide-data-editor-Bra6h4KB.js → glide-data-editor-CC9_NDNi.js} +11 -11
  38. package/dist/{glide-utils-CD8BaFTm.js → glide-utils-BRcuSTCx.js} +2 -2
  39. package/dist/{globals-_bXqC0R8.js → globals-BFlYTNoR.js} +3 -3
  40. package/dist/{html-to-image-Cst4BlIm.js → html-to-image-Cw7o1IbE.js} +5073 -5076
  41. package/dist/{infoDiagram-27XIBGKW-B5hq8RM_.js → infoDiagram-27XIBGKW-DbUO63CX.js} +1 -1
  42. package/dist/{ishikawaDiagram-5VMMS53U-DkHc_9ET.js → ishikawaDiagram-5VMMS53U-CfQrrELH.js} +1 -1
  43. package/dist/{kanban-definition-UXKFOSKX-CqkTFXmU.js → kanban-definition-UXKFOSKX-C5SJcu1W.js} +1 -1
  44. package/dist/{loader-CGrYn73j.js → loader-C9-qRO3m.js} +2 -2
  45. package/dist/main.js +6696 -6602
  46. package/dist/{mermaid-pmVHDUQA.js → mermaid-C2alqcd8.js} +34 -34
  47. package/dist/{mindmap-definition-YA3MSWOX-D6cNa__z.js → mindmap-definition-YA3MSWOX-ByVHE0Ax.js} +1 -1
  48. package/dist/{number-overlay-editor-XLUhOVa7.js → number-overlay-editor-qDcRKPE0.js} +1 -1
  49. package/dist/{pegDiagram-XKGWAZYB-CmWJX_s1.js → pegDiagram-XKGWAZYB-DF5FBKZi.js} +2 -2
  50. package/dist/{pencil-CxMgOe04.js → pencil-D7jyZPnP.js} +1 -1
  51. package/dist/{pieDiagram-E7YTZNPT-CAQAxHah.js → pieDiagram-E7YTZNPT-B5n9nBQN.js} +1 -1
  52. package/dist/{process-output-DizFa5IE.js → process-output-DdBM0lmd.js} +4 -4
  53. package/dist/{railroadDiagram-O6MQD6OU-jlSsiQg3.js → railroadDiagram-O6MQD6OU-r5t7OYNE.js} +2 -2
  54. package/dist/{requirementDiagram-BXWQKSXE-DkDjfPhn.js → requirementDiagram-BXWQKSXE-D4QtEyZQ.js} +1 -1
  55. package/dist/{reveal-component-llpC324_.js → reveal-component-BE1xhtNc.js} +1008 -1008
  56. package/dist/{select-CEnB18uc.js → select-Buk3aXi1.js} +341 -341
  57. package/dist/{sequenceDiagram-WJ2MYXX4-DLywsGCW.js → sequenceDiagram-WJ2MYXX4-CK3Atn-z.js} +1 -1
  58. package/dist/{spec-Dz-Avv1m.js → spec-BEp9O9dy.js} +4 -4
  59. package/dist/{stateDiagram-D77RDMKH-DUmlKwYU.js → stateDiagram-D77RDMKH-C1SxRI8V.js} +2 -2
  60. package/dist/{stateDiagram-v2-MP3YSRHH-D646KiXs.js → stateDiagram-v2-MP3YSRHH-DK5X6bsr.js} +2 -2
  61. package/dist/{static-state-iw0PrHK4.js → static-state-D-aT9dOr.js} +9 -9
  62. package/dist/{swimlanes-42K2YHIH-L7B1GphF.js → swimlanes-42K2YHIH-DdH5TZdu.js} +1 -1
  63. package/dist/{swimlanesDiagram-VR7AAH4N-DEu2wxtC.js → swimlanesDiagram-VR7AAH4N-CWBIvzgR.js} +2 -2
  64. package/dist/{timeline-definition-24CTP7MA-DDPyx1yG.js → timeline-definition-24CTP7MA-DE7-o2zU.js} +1 -1
  65. package/dist/{toast-BTjH6fIf.js → toast-b3k4YxaT.js} +54 -54
  66. package/dist/{tooltip-DyLdBIM4.js → tooltip-D-9pDheN.js} +62 -62
  67. package/dist/{use-restore-focus-DJ_-uSn_.js → use-restore-focus-CCfk-ey2.js} +1 -1
  68. package/dist/{useDateFormatter-HpKD0jEC.js → useDateFormatter-DH0uFwfL.js} +2 -2
  69. package/dist/{useDeepCompareMemoize-CHx-NxMl.js → useDeepCompareMemoize-Dn-ZJVTd.js} +1 -1
  70. package/dist/{useLifecycle-tPpAt-OE.js → useLifecycle-yjK7JsRL.js} +1 -1
  71. package/dist/{vega-component-BzNDFvQf.js → vega-component-BIq0qzhQ.js} +8 -8
  72. package/dist/{vennDiagram-4TSXK5OY-CRwWeb7g.js → vennDiagram-4TSXK5OY-D7yfNz0d.js} +1 -1
  73. package/dist/{wardleyDiagram-VM6X3IG4-DVlG9eoq.js → wardleyDiagram-VM6X3IG4-m5Jcz26Z.js} +1 -1
  74. package/dist/{xychartDiagram-S5SC5T6Z-CM32AISp.js → xychartDiagram-S5SC5T6Z-CA3zV3RW.js} +1 -1
  75. package/package.json +1 -1
  76. package/src/__mocks__/intersection-observer.ts +13 -12
  77. package/src/components/editor/Output.tsx +1 -1
  78. package/src/components/editor/__tests__/cell-renders.test.tsx +17 -1
  79. package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +517 -68
  80. package/src/components/editor/chrome/panels/outline/__tests__/useActiveOutline.test.ts +17 -5
  81. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +29 -59
  82. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +333 -133
  83. package/src/components/editor/chrome/panels/outline-panel.tsx +5 -19
  84. package/src/components/editor/notebook-cell.tsx +263 -267
  85. package/src/core/cells/__tests__/layout.test.ts +1 -1
  86. package/src/core/cells/__tests__/notebook-outline.test.ts +31 -3
  87. package/src/core/cells/cells.ts +21 -14
  88. package/src/core/cells/outline.ts +8 -8
  89. package/src/core/codemirror/language/extension.ts +6 -3
  90. package/src/core/codemirror/language/panel/panel.test.tsx +144 -0
  91. package/src/core/codemirror/language/panel/panel.tsx +9 -6
  92. package/src/core/codemirror/react-dom/createPanel.tsx +15 -15
  93. package/src/core/dom/__tests__/outline.test.ts +29 -170
  94. package/src/core/dom/outline.ts +21 -61
  95. package/src/core/executions/atoms.ts +12 -4
  96. package/src/core/islands/components/output-wrapper.tsx +7 -2
  97. package/src/plugins/layout/OutlinePlugin.tsx +5 -17
@@ -1,25 +1,17 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
- import { useAtomValue } from "jotai";
4
3
  import { ScrollTextIcon } from "lucide-react";
5
- import React, { useMemo } from "react";
6
- import { notebookOutline } from "../../../../core/cells/cells";
4
+ import React from "react";
7
5
  import { PanelEmptyState } from "./empty-state";
8
6
 
9
7
  import "./outline-panel.css";
10
8
  import { OutlineList } from "./outline/floating-outline";
11
- import {
12
- findOutlineElements,
13
- useActiveOutline,
14
- } from "./outline/useActiveOutline";
9
+ import { useActiveOutline } from "./outline/useActiveOutline";
15
10
 
16
11
  const OutlinePanel: React.FC = () => {
17
- const { items } = useAtomValue(notebookOutline);
18
- const headerElements = useMemo(() => findOutlineElements(items), [items]);
19
- const { activeHeaderId, activeOccurrences } =
20
- useActiveOutline(headerElements);
12
+ const outline = useActiveOutline();
21
13
 
22
- if (items.length === 0) {
14
+ if (outline.entries.length === 0) {
23
15
  return (
24
16
  <PanelEmptyState
25
17
  title="No outline found"
@@ -29,13 +21,7 @@ const OutlinePanel: React.FC = () => {
29
21
  );
30
22
  }
31
23
 
32
- return (
33
- <OutlineList
34
- items={items}
35
- activeHeaderId={activeHeaderId}
36
- activeOccurrences={activeOccurrences}
37
- />
38
- );
24
+ return <OutlineList {...outline} />;
39
25
  };
40
26
 
41
27
  export default OutlinePanel;
@@ -20,7 +20,7 @@ import { mergeProps } from "react-aria";
20
20
  import useEvent from "react-use-event-hook";
21
21
  import { StopButton } from "@/components/editor/cell/StopButton";
22
22
  import { Toolbar, ToolbarItem } from "@/components/editor/cell/toolbar";
23
- import { Tooltip, TooltipProvider } from "@/components/ui/tooltip";
23
+ import { Tooltip } from "@/components/ui/tooltip";
24
24
  import { aiCompletionCellAtom } from "@/core/ai/state";
25
25
  import {
26
26
  consoleOutputIsStale,
@@ -618,156 +618,154 @@ const EditableCellComponent = ({
618
618
  };
619
619
 
620
620
  return (
621
- <TooltipProvider>
622
- <CellActionsContextMenu
621
+ <CellActionsContextMenu
622
+ cellId={cellId}
623
+ getEditorView={getEditorView}
624
+ disabled={isPresenting}
625
+ >
626
+ <SortableCell
627
+ tabIndex={-1}
628
+ ref={cellRef}
629
+ data-status={execution.status}
630
+ onBlur={closeCompletionHandler}
631
+ onKeyDown={resumeCompletionHandler}
623
632
  cellId={cellId}
624
- getEditorView={getEditorView}
633
+ canMoveX={canMoveX}
625
634
  disabled={isPresenting}
635
+ hidden={presentHidden}
636
+ title={renderCellTitle()}
626
637
  >
627
- <SortableCell
638
+ <div
628
639
  tabIndex={-1}
629
- ref={cellRef}
630
- data-status={execution.status}
631
- onBlur={closeCompletionHandler}
632
- onKeyDown={resumeCompletionHandler}
633
- cellId={cellId}
634
- canMoveX={canMoveX}
635
- disabled={isPresenting}
636
- hidden={presentHidden}
637
- title={renderCellTitle()}
640
+ {...(isPresenting ? undefined : navigationProps)}
641
+ className={cn(
642
+ className,
643
+ !isPresenting && navigationProps.className,
644
+ !isPresenting &&
645
+ "focus:ring-1 focus:ring-(--slate-8) focus:ring-offset-2",
646
+ )}
647
+ ref={cellContainerRef}
648
+ {...cellDomProps(cellId, cellData.name)}
638
649
  >
650
+ {!isPresenting && (
651
+ <CellLeftSideActions cellId={cellId} actions={actions} />
652
+ )}
653
+ {cellOutput === "above" && (outputArea || emptyMarkdownPlaceholder)}
654
+ {/* The tray is hidden-but-mounted while presenting so CodeMirror
655
+ state survives mode toggles. Hide via the `hidden` attribute:
656
+ preflight's `[hidden] { display: none !important }` beats
657
+ `.tray { display: flex }`, which a display class would not. */}
639
658
  <div
640
- tabIndex={-1}
641
- {...(isPresenting ? undefined : navigationProps)}
642
- className={cn(
643
- className,
644
- !isPresenting && navigationProps.className,
645
- !isPresenting &&
646
- "focus:ring-1 focus:ring-(--slate-8) focus:ring-offset-2",
647
- )}
648
- ref={cellContainerRef}
649
- {...cellDomProps(cellId, cellData.name)}
659
+ data-testid="cell-tray"
660
+ className="tray"
661
+ hidden={isPresenting}
662
+ data-has-output-above={hasOutputAbove}
663
+ data-hidden={isMarkdownCodeHidden}
650
664
  >
651
- {!isPresenting && (
652
- <CellLeftSideActions cellId={cellId} actions={actions} />
653
- )}
654
- {cellOutput === "above" && (outputArea || emptyMarkdownPlaceholder)}
655
- {/* The tray is hidden-but-mounted while presenting so CodeMirror
656
- state survives mode toggles. Hide via the `hidden` attribute:
657
- preflight's `[hidden] { display: none !important }` beats
658
- `.tray { display: flex }`, which a display class would not. */}
659
- <div
660
- data-testid="cell-tray"
661
- className="tray"
662
- hidden={isPresenting}
663
- data-has-output-above={hasOutputAbove}
664
- data-hidden={isMarkdownCodeHidden}
665
- >
666
- <StagedAIDeletionMarker cellId={cellId} />
667
- <div className="absolute right-2 -top-4 z-10">
668
- <CellToolbar
669
- edited={freshness.sourceChanged}
670
- status={execution.status}
671
- blocked={execution.blocked}
672
- cellConfig={cellData.config}
673
- needsRun={needsRun}
674
- hasOutput={hasOutput}
675
- hasConsoleOutput={hasConsoleOutput}
676
- cellActionDropdownRef={cellActionDropdownRef}
677
- cellId={cellId}
678
- name={cellData.name}
679
- getEditorView={getEditorView}
680
- onRun={runCell}
681
- />
682
- </div>
683
- <CellEditor
684
- theme={theme}
685
- showPlaceholder={showPlaceholder}
686
- id={cellId}
687
- code={cellData.code}
688
- config={cellData.config}
665
+ <StagedAIDeletionMarker cellId={cellId} />
666
+ <div className="absolute right-2 -top-4 z-10">
667
+ <CellToolbar
668
+ edited={freshness.sourceChanged}
689
669
  status={execution.status}
690
- runCell={runCell}
691
- setEditorView={setEditorView}
692
- userConfig={userConfig}
693
- editorViewRef={editorView}
694
- editorViewParentRef={editorViewParentRef}
695
- hidden={!isCellCodeShown}
670
+ blocked={execution.blocked}
671
+ cellConfig={cellData.config}
672
+ needsRun={needsRun}
696
673
  hasOutput={hasOutput}
697
- showHiddenCode={showHiddenCode}
698
- languageAdapter={languageAdapter}
699
- setLanguageAdapter={setLanguageAdapter}
700
- outputArea={cellOutput}
701
- />
702
- {/* Unmounted while presenting: the status timer re-renders every
703
- frame for running cells. */}
704
- {!isPresenting && (
705
- <CellRightSideActions
706
- className={cn(
707
- isMarkdownCodeHidden && cellOutput === "below" && "top-14",
708
- )}
709
- execution={execution}
710
- freshness={freshness}
711
- isCellStatusInline={isCellStatusInline}
712
- uninstantiated={uninstantiated}
713
- disabled={cellData.config.disabled}
714
- />
715
- )}
716
- <div className="shoulder-bottom hover-action">
717
- {canDelete && isCellCodeShown && (
718
- <DeleteButton
719
- status={execution.status}
720
- connectionState={connection.state}
721
- onClick={() => {
722
- if (
723
- !loading &&
724
- !isAppInteractionDisabled(connection.state)
725
- ) {
726
- deleteCell({ cellId });
727
- }
728
- }}
729
- />
730
- )}
731
- </div>
732
- </div>
733
- {!isPresenting && (
734
- <SqlValidationErrorBanner
674
+ hasConsoleOutput={hasConsoleOutput}
675
+ cellActionDropdownRef={cellActionDropdownRef}
735
676
  cellId={cellId}
736
- hide={errored && !isStaleCell}
677
+ name={cellData.name}
678
+ getEditorView={getEditorView}
679
+ onRun={runCell}
737
680
  />
738
- )}
739
- {cellOutput === "below" && (outputArea || emptyMarkdownPlaceholder)}
740
- {!isPresenting && reusable && (
741
- <ReusableDefinitionBadge finding={reusable} />
742
- )}
681
+ </div>
682
+ <CellEditor
683
+ theme={theme}
684
+ showPlaceholder={showPlaceholder}
685
+ id={cellId}
686
+ code={cellData.code}
687
+ config={cellData.config}
688
+ status={execution.status}
689
+ runCell={runCell}
690
+ setEditorView={setEditorView}
691
+ userConfig={userConfig}
692
+ editorViewRef={editorView}
693
+ editorViewParentRef={editorViewParentRef}
694
+ hidden={!isCellCodeShown}
695
+ hasOutput={hasOutput}
696
+ showHiddenCode={showHiddenCode}
697
+ languageAdapter={languageAdapter}
698
+ setLanguageAdapter={setLanguageAdapter}
699
+ outputArea={cellOutput}
700
+ />
701
+ {/* Unmounted while presenting: the status timer re-renders every
702
+ frame for running cells. */}
743
703
  {!isPresenting && (
744
- <ConsoleOutput
745
- consoleOutputs={cellRuntime.consoleOutputs}
746
- stale={consoleOutputStale}
747
- cellName={reusable ? "_" : cellData.name}
748
- onRefactorWithAI={handleRefactorWithAI}
749
- onClear={() => {
750
- actions.clearCellConsoleOutput({ cellId });
751
- // The debugger "Clear" (trashcan) also drops this cell's
752
- // breakpoints; no-op when none are set.
753
- clearCellBreakpoints(cellId);
754
- }}
755
- onSubmitDebugger={answerPrompt}
756
- cellId={cellId}
704
+ <CellRightSideActions
705
+ className={cn(
706
+ isMarkdownCodeHidden && cellOutput === "below" && "top-14",
707
+ )}
708
+ execution={execution}
709
+ freshness={freshness}
710
+ isCellStatusInline={isCellStatusInline}
711
+ uninstantiated={uninstantiated}
712
+ disabled={cellData.config.disabled}
757
713
  />
758
714
  )}
759
- <PendingDeleteConfirmation cellId={cellId} />
715
+ <div className="shoulder-bottom hover-action">
716
+ {canDelete && isCellCodeShown && (
717
+ <DeleteButton
718
+ status={execution.status}
719
+ connectionState={connection.state}
720
+ onClick={() => {
721
+ if (
722
+ !loading &&
723
+ !isAppInteractionDisabled(connection.state)
724
+ ) {
725
+ deleteCell({ cellId });
726
+ }
727
+ }}
728
+ />
729
+ )}
730
+ </div>
760
731
  </div>
761
- {isCollapsed && !isPresenting && (
762
- <CollapsedCellBanner
763
- onClick={() => actions.expandCell({ cellId })}
764
- count={collapseCount}
732
+ {!isPresenting && (
733
+ <SqlValidationErrorBanner
734
+ cellId={cellId}
735
+ hide={errored && !isStaleCell}
736
+ />
737
+ )}
738
+ {cellOutput === "below" && (outputArea || emptyMarkdownPlaceholder)}
739
+ {!isPresenting && reusable && (
740
+ <ReusableDefinitionBadge finding={reusable} />
741
+ )}
742
+ {!isPresenting && (
743
+ <ConsoleOutput
744
+ consoleOutputs={cellRuntime.consoleOutputs}
745
+ stale={consoleOutputStale}
746
+ cellName={reusable ? "_" : cellData.name}
747
+ onRefactorWithAI={handleRefactorWithAI}
748
+ onClear={() => {
749
+ actions.clearCellConsoleOutput({ cellId });
750
+ // The debugger "Clear" (trashcan) also drops this cell's
751
+ // breakpoints; no-op when none are set.
752
+ clearCellBreakpoints(cellId);
753
+ }}
754
+ onSubmitDebugger={answerPrompt}
765
755
  cellId={cellId}
766
756
  />
767
757
  )}
768
- </SortableCell>
769
- </CellActionsContextMenu>
770
- </TooltipProvider>
758
+ <PendingDeleteConfirmation cellId={cellId} />
759
+ </div>
760
+ {isCollapsed && !isPresenting && (
761
+ <CollapsedCellBanner
762
+ onClick={() => actions.expandCell({ cellId })}
763
+ count={collapseCount}
764
+ cellId={cellId}
765
+ />
766
+ )}
767
+ </SortableCell>
768
+ </CellActionsContextMenu>
771
769
  );
772
770
  };
773
771
 
@@ -1066,152 +1064,150 @@ const SetupCellComponent = ({
1066
1064
  }, [isPresenting, editorView]);
1067
1065
 
1068
1066
  return (
1069
- <TooltipProvider>
1070
- <CellActionsContextMenu
1071
- cellId={cellId}
1072
- getEditorView={getEditorView}
1073
- disabled={isPresenting}
1074
- >
1075
- {/* The setup cell has no visible output, so it is hidden (but stays
1076
- mounted) while presenting. */}
1077
- <div hidden={isPresenting}>
1067
+ <CellActionsContextMenu
1068
+ cellId={cellId}
1069
+ getEditorView={getEditorView}
1070
+ disabled={isPresenting}
1071
+ >
1072
+ {/* The setup cell has no visible output, so it is hidden (but stays
1073
+ mounted) while presenting. */}
1074
+ <div hidden={isPresenting}>
1075
+ <div
1076
+ data-status={execution.status}
1077
+ ref={cellRef}
1078
+ {...mergeProps(navigationProps, {
1079
+ className: cn(
1080
+ className,
1081
+ "focus:ring-1 focus:ring-(--slate-8) focus:ring-offset-2",
1082
+ ),
1083
+ onBlur: closeCompletionHandler,
1084
+ onKeyDown: resumeCompletionHandler,
1085
+ })}
1086
+ {...cellDomProps(cellId, cellData.name)}
1087
+ title={renderCellTitle()}
1088
+ tabIndex={-1}
1089
+ data-setup-cell={true}
1090
+ >
1078
1091
  <div
1079
- data-status={execution.status}
1080
- ref={cellRef}
1081
- {...mergeProps(navigationProps, {
1082
- className: cn(
1083
- className,
1084
- "focus:ring-1 focus:ring-(--slate-8) focus:ring-offset-2",
1085
- ),
1086
- onBlur: closeCompletionHandler,
1087
- onKeyDown: resumeCompletionHandler,
1088
- })}
1089
- {...cellDomProps(cellId, cellData.name)}
1090
- title={renderCellTitle()}
1091
- tabIndex={-1}
1092
- data-setup-cell={true}
1092
+ className={cn("tray")}
1093
+ data-has-output-above={false}
1094
+ data-hidden={!isCellCodeShown}
1093
1095
  >
1094
- <div
1095
- className={cn("tray")}
1096
- data-has-output-above={false}
1097
- data-hidden={!isCellCodeShown}
1098
- >
1099
- <StagedAIDeletionMarker cellId={cellId} />
1100
- <div className="absolute right-2 -top-4 z-10">
1101
- <CellToolbar
1102
- edited={freshness.sourceChanged}
1103
- status={execution.status}
1104
- blocked={execution.blocked}
1105
- cellConfig={cellData.config}
1106
- needsRun={needsRun}
1107
- hasOutput={hasOutput}
1108
- hasConsoleOutput={hasConsoleOutput}
1109
- cellActionDropdownRef={cellActionDropdownRef}
1110
- cellId={cellId}
1111
- name={cellData.name}
1112
- getEditorView={getEditorView}
1113
- onRun={runCell}
1114
- includeCellActions={true}
1115
- />
1116
- </div>
1117
- <CellEditor
1118
- theme={theme}
1119
- showPlaceholder={showPlaceholder}
1120
- id={cellId}
1121
- code={cellData.code}
1122
- config={cellData.config}
1096
+ <StagedAIDeletionMarker cellId={cellId} />
1097
+ <div className="absolute right-2 -top-4 z-10">
1098
+ <CellToolbar
1099
+ edited={freshness.sourceChanged}
1123
1100
  status={execution.status}
1124
- runCell={runCell}
1125
- setEditorView={setEditorView}
1126
- userConfig={userConfig}
1127
- editorViewRef={editorView}
1128
- editorViewParentRef={editorViewParentRef}
1129
- hidden={!isCellCodeShown}
1101
+ blocked={execution.blocked}
1102
+ cellConfig={cellData.config}
1103
+ needsRun={needsRun}
1130
1104
  hasOutput={hasOutput}
1131
- showHiddenCode={showHiddenCode}
1132
- languageAdapter={"python"}
1133
- setLanguageAdapter={Functions.NOOP}
1134
- showLanguageToggles={false}
1105
+ hasConsoleOutput={hasConsoleOutput}
1106
+ cellActionDropdownRef={cellActionDropdownRef}
1107
+ cellId={cellId}
1108
+ name={cellData.name}
1109
+ getEditorView={getEditorView}
1110
+ onRun={runCell}
1111
+ includeCellActions={true}
1135
1112
  />
1136
- {/* Unmounted while presenting: the status timer re-renders every
1137
- frame for running cells. */}
1138
- {!isPresenting && (
1139
- <CellRightSideActions
1140
- execution={execution}
1141
- freshness={freshness}
1142
- isCellStatusInline={false}
1143
- uninstantiated={uninstantiated}
1144
- disabled={cellData.config.disabled}
1145
- />
1146
- )}
1147
- <div className="shoulder-bottom hover-action">
1148
- {canDelete && (
1149
- <DeleteButton
1150
- connectionState={connection.state}
1151
- status={execution.status}
1152
- onClick={() => {
1153
- if (
1154
- !loading &&
1155
- !isAppInteractionDisabled(connection.state)
1156
- ) {
1157
- deleteCell({ cellId });
1158
- }
1159
- }}
1160
- />
1161
- )}
1162
- </div>
1163
1113
  </div>
1164
- <div className="py-1 px-2 flex justify-end gap-2 last:rounded-b">
1165
- <span className="text-muted-foreground text-xs font-bold">
1166
- setup cell
1167
- </span>
1168
- <Tooltip
1169
- content={
1170
- <span className="max-w-16">
1171
- This <b>setup cell</b> is guaranteed to run before all other
1172
- cells. Include <br />
1173
- initialization or imports and constants required by
1174
- top-level functions.
1175
- </span>
1176
- }
1177
- >
1178
- <HelpCircleIcon
1179
- size={16}
1180
- strokeWidth={1.5}
1181
- className="rounded-lg text-muted-foreground"
1114
+ <CellEditor
1115
+ theme={theme}
1116
+ showPlaceholder={showPlaceholder}
1117
+ id={cellId}
1118
+ code={cellData.code}
1119
+ config={cellData.config}
1120
+ status={execution.status}
1121
+ runCell={runCell}
1122
+ setEditorView={setEditorView}
1123
+ userConfig={userConfig}
1124
+ editorViewRef={editorView}
1125
+ editorViewParentRef={editorViewParentRef}
1126
+ hidden={!isCellCodeShown}
1127
+ hasOutput={hasOutput}
1128
+ showHiddenCode={showHiddenCode}
1129
+ languageAdapter={"python"}
1130
+ setLanguageAdapter={Functions.NOOP}
1131
+ showLanguageToggles={false}
1132
+ />
1133
+ {/* Unmounted while presenting: the status timer re-renders every
1134
+ frame for running cells. */}
1135
+ {!isPresenting && (
1136
+ <CellRightSideActions
1137
+ execution={execution}
1138
+ freshness={freshness}
1139
+ isCellStatusInline={false}
1140
+ uninstantiated={uninstantiated}
1141
+ disabled={cellData.config.disabled}
1142
+ />
1143
+ )}
1144
+ <div className="shoulder-bottom hover-action">
1145
+ {canDelete && (
1146
+ <DeleteButton
1147
+ connectionState={connection.state}
1148
+ status={execution.status}
1149
+ onClick={() => {
1150
+ if (
1151
+ !loading &&
1152
+ !isAppInteractionDisabled(connection.state)
1153
+ ) {
1154
+ deleteCell({ cellId });
1155
+ }
1156
+ }}
1182
1157
  />
1183
- </Tooltip>
1158
+ )}
1184
1159
  </div>
1185
- {isErrorOutput && (
1186
- <OutputArea
1187
- allowExpand={true}
1188
- forceExpand={true}
1189
- className={CSSClasses.outputArea}
1190
- cellId={cellId}
1191
- output={output}
1192
- stale={false}
1193
- loading={loading}
1160
+ </div>
1161
+ <div className="py-1 px-2 flex justify-end gap-2 last:rounded-b">
1162
+ <span className="text-muted-foreground text-xs font-bold">
1163
+ setup cell
1164
+ </span>
1165
+ <Tooltip
1166
+ content={
1167
+ <span className="max-w-16">
1168
+ This <b>setup cell</b> is guaranteed to run before all other
1169
+ cells. Include <br />
1170
+ initialization or imports and constants required by top-level
1171
+ functions.
1172
+ </span>
1173
+ }
1174
+ >
1175
+ <HelpCircleIcon
1176
+ size={16}
1177
+ strokeWidth={1.5}
1178
+ className="rounded-lg text-muted-foreground"
1194
1179
  />
1195
- )}
1196
- <ConsoleOutput
1197
- consoleOutputs={cellRuntime.consoleOutputs}
1198
- stale={consoleOutputStale}
1199
- // Don't show name
1200
- cellName={"_"}
1201
- onRefactorWithAI={handleRefactorWithAI}
1202
- onClear={() => {
1203
- actions.clearCellConsoleOutput({ cellId });
1204
- // The debugger "Clear" (trashcan) also drops this cell's
1205
- // breakpoints; no-op when none are set.
1206
- clearCellBreakpoints(cellId);
1207
- }}
1208
- onSubmitDebugger={answerPrompt}
1180
+ </Tooltip>
1181
+ </div>
1182
+ {isErrorOutput && (
1183
+ <OutputArea
1184
+ allowExpand={true}
1185
+ forceExpand={true}
1186
+ className={CSSClasses.outputArea}
1209
1187
  cellId={cellId}
1188
+ output={output}
1189
+ stale={false}
1190
+ loading={loading}
1210
1191
  />
1211
- </div>
1192
+ )}
1193
+ <ConsoleOutput
1194
+ consoleOutputs={cellRuntime.consoleOutputs}
1195
+ stale={consoleOutputStale}
1196
+ // Don't show name
1197
+ cellName={"_"}
1198
+ onRefactorWithAI={handleRefactorWithAI}
1199
+ onClear={() => {
1200
+ actions.clearCellConsoleOutput({ cellId });
1201
+ // The debugger "Clear" (trashcan) also drops this cell's
1202
+ // breakpoints; no-op when none are set.
1203
+ clearCellBreakpoints(cellId);
1204
+ }}
1205
+ onSubmitDebugger={answerPrompt}
1206
+ cellId={cellId}
1207
+ />
1212
1208
  </div>
1213
- </CellActionsContextMenu>
1214
- </TooltipProvider>
1209
+ </div>
1210
+ </CellActionsContextMenu>
1215
1211
  );
1216
1212
  };
1217
1213
 
@@ -27,7 +27,7 @@ const [h1, a, h2, b, c, h1b, d] = ["h1", "a", "h2", "b", "c", "h1b", "d"].map(
27
27
  const ids = [h1, a, h2, b, c, h1b, d];
28
28
 
29
29
  function heading(level: number): Outline {
30
- return { items: [{ name: `H${level}`, level, by: { id: `h${level}` } }] };
30
+ return { items: [{ name: `H${level}`, level, id: `h${level}` }] };
31
31
  }
32
32
  const outlines = new Map<CellId, Outline>([
33
33
  [h1, heading(1)],