@marimo-team/islands 0.23.9-dev30 → 0.23.9-dev32
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/{code-visibility-DYjjXY63.js → code-visibility-Bq6MzjHR.js} +662 -657
- package/dist/main.js +3 -3
- package/dist/{reveal-component-COtLtzC0.js → reveal-component-BQijUbYE.js} +3 -3
- package/package.json +1 -1
- package/src/components/chat/chat-panel.tsx +36 -3
- package/src/components/editor/actions/pair-with-agent-modal.tsx +1 -0
- package/src/components/editor/renderers/slides-layout/slides-layout.tsx +1 -1
- package/src/components/slides/reveal-component.tsx +3 -3
- package/src/components/slides/slide-form.tsx +11 -3
package/dist/main.js
CHANGED
|
@@ -26,7 +26,7 @@ import { $ as useCellActions, At as DeferredRequestRegistry, B as safeExtractSet
|
|
|
26
26
|
import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
27
27
|
import { o as useSize, s as Root$2, u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
28
28
|
import { A as SquareFunction, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, O as TIME_UNIT_DESCRIPTIONS, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as ChartColumn, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON } from "./spec-BKuFJIDz.js";
|
|
29
|
-
import { $ as TableBody, $t as ChevronLeft, A as ComboboxItem, At as ChartErrorState, B as contextAwarePanelOpen, Bt as $fae977aafc393c5c$export$6b862160d295c8e, C as prettifyRowColumnCount, Ct as dateToLocalISODate, D as DatePicker, Dt as TabsContent, E as useInternalStateWithSync, Et as Tabs, F as CommandList, Ft as RenderTextWithLinks, G as slotsController, H as contextAwarePanelType, Ht as GripHorizontal, I as CommandSeparator, It as Kbd, Jt as Code, K as Toggle, Kt as Ellipsis, L as smartMatch, Lt as HtmlOutput, M as CommandEmpty, Mt as ChartLoadingState, N as CommandInput, Nt as LazyVegaEmbed, O as DateRangePicker, Ot as TabsList, P as CommandItem, Pt as useOverflowDetection, Q as Table, Qt as ChevronsDownUp, R as ContextAwarePanelItem, Rt as EmotionCacheProvider, S as downloadSizeLimitAtom, St as Maps, T as getColumnCountForDisplay, Tt as dateToLocalISOTime, U as isCellAwareAtom, Ut as Funnel, V as contextAwarePanelOwner, Vt as TextWrap, W as SlotNames, Wt as EyeOff, X as Fill, Xt as ChevronsRight, Yt as ChevronsUpDown, Z as Provider$1, Zt as ChevronsLeft, _ as downloadBlob, _t as SELECT_COLUMN_ID, at as generateColumns, b as Progress, bt as getMimeValues, c as Slide, ct as ColumnChartContext, d as JsonOutput, dt as useIntersectionObserver, en as ArrowDownWideNarrow, et as TableCell, f as OutputArea, ft as usePrevious$1, g as ADD_PRINTING_CLASS, gt as INDEX_COLUMN_NAME, h as InstallPackageButton, ht as loadTableData, it as NAMELESS_COLUMN_PREFIX, j as Command, jt as ChartInfoState, k as Combobox, kt as TabsTrigger, l as RadioGroup, lt as ColumnChartSpecModel, m as DataTable, mt as loadTableAndRawData, n as marimoVersionAtom, nt as TableHeader, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as inferFieldTypes, p as OutputRenderer, pt as getPageIndexForRow, qt as Download, r as showCodeInRunModeAtom, rt as TableRow, st as renderCellValue, t as useNotebookCodeAvailable, tt as TableHead, u as RadioGroupItem, ut as DelayMount, v as downloadByURL, vt as TOO_MANY_ROWS, w as prettifyRowCount, wt as dateToLocalISODateTime, x as Filenames, xt as isNullishFilter, y as downloadHTMLAsImage, yt as toFieldTypes, z as PANEL_TYPES, zt as $fae977aafc393c5c$export$588937bcd60ade55, __tla as __tla_2 } from "./code-visibility-
|
|
29
|
+
import { $ as TableBody, $t as ChevronLeft, A as ComboboxItem, At as ChartErrorState, B as contextAwarePanelOpen, Bt as $fae977aafc393c5c$export$6b862160d295c8e, C as prettifyRowColumnCount, Ct as dateToLocalISODate, D as DatePicker, Dt as TabsContent, E as useInternalStateWithSync, Et as Tabs, F as CommandList, Ft as RenderTextWithLinks, G as slotsController, H as contextAwarePanelType, Ht as GripHorizontal, I as CommandSeparator, It as Kbd, Jt as Code, K as Toggle, Kt as Ellipsis, L as smartMatch, Lt as HtmlOutput, M as CommandEmpty, Mt as ChartLoadingState, N as CommandInput, Nt as LazyVegaEmbed, O as DateRangePicker, Ot as TabsList, P as CommandItem, Pt as useOverflowDetection, Q as Table, Qt as ChevronsDownUp, R as ContextAwarePanelItem, Rt as EmotionCacheProvider, S as downloadSizeLimitAtom, St as Maps, T as getColumnCountForDisplay, Tt as dateToLocalISOTime, U as isCellAwareAtom, Ut as Funnel, V as contextAwarePanelOwner, Vt as TextWrap, W as SlotNames, Wt as EyeOff, X as Fill, Xt as ChevronsRight, Yt as ChevronsUpDown, Z as Provider$1, Zt as ChevronsLeft, _ as downloadBlob, _t as SELECT_COLUMN_ID, at as generateColumns, b as Progress, bt as getMimeValues, c as Slide, ct as ColumnChartContext, d as JsonOutput, dt as useIntersectionObserver, en as ArrowDownWideNarrow, et as TableCell, f as OutputArea, ft as usePrevious$1, g as ADD_PRINTING_CLASS, gt as INDEX_COLUMN_NAME, h as InstallPackageButton, ht as loadTableData, it as NAMELESS_COLUMN_PREFIX, j as Command, jt as ChartInfoState, k as Combobox, kt as TabsTrigger, l as RadioGroup, lt as ColumnChartSpecModel, m as DataTable, mt as loadTableAndRawData, n as marimoVersionAtom, nt as TableHeader, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as inferFieldTypes, p as OutputRenderer, pt as getPageIndexForRow, qt as Download, r as showCodeInRunModeAtom, rt as TableRow, st as renderCellValue, t as useNotebookCodeAvailable, tt as TableHead, u as RadioGroupItem, ut as DelayMount, v as downloadByURL, vt as TOO_MANY_ROWS, w as prettifyRowCount, wt as dateToLocalISODateTime, x as Filenames, xt as isNullishFilter, y as downloadHTMLAsImage, yt as toFieldTypes, z as PANEL_TYPES, zt as $fae977aafc393c5c$export$588937bcd60ade55, __tla as __tla_2 } from "./code-visibility-Bq6MzjHR.js";
|
|
30
30
|
import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-CsYXf0Ln.js";
|
|
31
31
|
import { t as Check } from "./check-DTbrK0zt.js";
|
|
32
32
|
import { A as Trigger$1, C as $a916eb452884faea$export$b7a616150fdb9f44, E as $18f2051aff69b9bf$export$a54013f0d02a8f82, F as X, L as ChevronDown, M as usePrevious$2, N as useDirection, P as createCollection, S as logNever, T as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, a as SelectGroup, c as SelectSeparator, d as NativeSelect, i as SelectContent, j as clamp$2, k as Icon, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, x as assertNever } from "./strings-Bu3vlb6W.js";
|
|
@@ -36093,7 +36093,7 @@ ${c}
|
|
|
36093
36093
|
if (l && l !== "slide") return l;
|
|
36094
36094
|
if (c == null ? void 0 : c.has(e)) return "skip";
|
|
36095
36095
|
}
|
|
36096
|
-
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-
|
|
36096
|
+
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-BQijUbYE.js"));
|
|
36097
36097
|
const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
|
|
36098
36098
|
var _a3;
|
|
36099
36099
|
let u = useAtomValue(kioskModeAtom), d = l === "read" || u, f = useAtomValue(numColumnsAtom) > 1, [p, m] = (0, import_react.useState)(null), { cellsWithOutput: h, skippedIds: g, slideTypes: _, startCellIndex: v } = (0, import_react.useMemo)(() => computeSlideCellsInfo(c, e), [
|
|
@@ -36108,7 +36108,7 @@ ${c}
|
|
|
36108
36108
|
setLayout: r,
|
|
36109
36109
|
activeIndex: b,
|
|
36110
36110
|
onSlideChange: S,
|
|
36111
|
-
configWidth:
|
|
36111
|
+
configWidth: 280,
|
|
36112
36112
|
mode: d ? "read" : l,
|
|
36113
36113
|
isEditable: !d
|
|
36114
36114
|
});
|
|
@@ -9,7 +9,7 @@ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
|
9
9
|
import { ct as kioskModeAtom } from "./html-to-image-QL7QveRm.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
11
11
|
import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
12
|
-
import { Gt as Expand, J as PanelGroup, Jt as Code, Wt as EyeOff, Y as PanelResizeHandle, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, q as Panel, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-
|
|
12
|
+
import { Gt as Expand, J as PanelGroup, Jt as Code, Wt as EyeOff, Y as PanelResizeHandle, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, q as Panel, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-Bq6MzjHR.js";
|
|
13
13
|
import { q as useDebouncedCallback } from "./input-Dh0iMVFM.js";
|
|
14
14
|
import "./toDate-BeKbrOvs.js";
|
|
15
15
|
import "./react-dom-BTJzcVJ9.js";
|
|
@@ -7223,7 +7223,7 @@ var NotesAside = (e5) => {
|
|
|
7223
7223
|
t[18] === s ? p = t[19] : (p = s && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NotesAside, { text: s }), t[18] = s, t[19] = p);
|
|
7224
7224
|
let io;
|
|
7225
7225
|
return t[20] !== o || t[21] !== ro || t[22] !== p ? (io = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(o, { children: [ro, p] }), t[20] = o, t[21] = ro, t[22] = p, t[23] = io) : io = t[23], io;
|
|
7226
|
-
}, reveal_component_default = ({ cellsWithOutput: e5, layout: o, setLayout: s, activeIndex: l, onSlideChange: io, mode: oo, configWidth: uo
|
|
7226
|
+
}, reveal_component_default = ({ cellsWithOutput: e5, layout: o, setLayout: s, activeIndex: l, onSlideChange: io, mode: oo, configWidth: uo, isEditable: fo = false }) => {
|
|
7227
7227
|
var _a2, _b2;
|
|
7228
7228
|
let _o = (0, import_react.useRef)(null), vo = (0, import_react.useRef)(null), { width: bo, height: xo } = useSlideDimensions(_o), So = useAtomValue(kioskModeAtom), Co = (0, import_react.useMemo)(() => So ? [] : [ce], [So]), [wo, To] = (0, import_react.useState)(false), Eo = useNotebookCodeAvailable(e5), Do = !isIslands() && Eo, Oo = Do && wo, ko = l == null ? void 0 : e5[l], Ao = ko ?? e5.at(0), jo = (0, import_react.useMemo)(() => composeSlides({
|
|
7229
7229
|
cells: e5,
|
|
@@ -7318,7 +7318,7 @@ var NotesAside = (e5) => {
|
|
|
7318
7318
|
children: [
|
|
7319
7319
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(b, {
|
|
7320
7320
|
deckRef: vo,
|
|
7321
|
-
className: "aspect-video w-full overflow-hidden border rounded bg-background mo-slides-theme prose-slides",
|
|
7321
|
+
className: "aspect-video w-full overflow-hidden border rounded bg-background mo-slides-theme prose-slides focus:outline-none focus-visible:outline-none",
|
|
7322
7322
|
config: Lo,
|
|
7323
7323
|
onReady: Bo,
|
|
7324
7324
|
onSlideChange: Wo,
|
package/package.json
CHANGED
|
@@ -15,11 +15,13 @@ import { useAtom, useAtomValue, useSetAtom, useStore } from "jotai";
|
|
|
15
15
|
import {
|
|
16
16
|
BotMessageSquareIcon,
|
|
17
17
|
HatGlasses,
|
|
18
|
+
ArrowRightIcon,
|
|
18
19
|
Loader2,
|
|
19
20
|
type LucideIcon,
|
|
20
21
|
MessageCircleIcon,
|
|
21
22
|
NotebookText,
|
|
22
23
|
PlusIcon,
|
|
24
|
+
SparklesIcon,
|
|
23
25
|
SettingsIcon,
|
|
24
26
|
} from "lucide-react";
|
|
25
27
|
import { memo, useEffect, useRef, useState } from "react";
|
|
@@ -53,11 +55,13 @@ import { aiAtom, aiEnabledAtom } from "@/core/config/config";
|
|
|
53
55
|
import { DEFAULT_AI_MODEL } from "@/core/config/config-schema";
|
|
54
56
|
import { useRequestClient } from "@/core/network/requests";
|
|
55
57
|
import { useRuntimeManager } from "@/core/runtime/config";
|
|
58
|
+
import { isWasm } from "@/core/wasm/utils";
|
|
56
59
|
import { ErrorBanner } from "@/plugins/impl/common/error-banner";
|
|
57
60
|
import { cn } from "@/utils/cn";
|
|
58
61
|
import { Logger } from "@/utils/Logger";
|
|
59
62
|
import { AIModelDropdown } from "../ai/ai-model-dropdown";
|
|
60
63
|
import { useOpenSettingsToTab } from "../app-config/state";
|
|
64
|
+
import { PairWithAgentModal } from "../editor/actions/pair-with-agent-modal";
|
|
61
65
|
import { PromptInput } from "../editor/ai/add-cell-with-ai";
|
|
62
66
|
import {
|
|
63
67
|
addContextCompletion,
|
|
@@ -65,6 +69,7 @@ import {
|
|
|
65
69
|
} from "../editor/ai/completion-utils";
|
|
66
70
|
import { PanelEmptyState } from "../editor/chrome/panels/empty-state";
|
|
67
71
|
import { CopyClipboardIcon } from "../icons/copy-icon";
|
|
72
|
+
import { useImperativeModal } from "../modal/ImperativeModal";
|
|
68
73
|
import { MCPStatusIndicator } from "../mcp/mcp-status-indicator";
|
|
69
74
|
import { Tooltip, TooltipProvider } from "../ui/tooltip";
|
|
70
75
|
import {
|
|
@@ -416,6 +421,26 @@ const ChatInput: React.FC<ChatInputProps> = memo(
|
|
|
416
421
|
|
|
417
422
|
ChatInput.displayName = "ChatInput";
|
|
418
423
|
|
|
424
|
+
const PairWithAgentCallout: React.FC<{
|
|
425
|
+
onPairWithAgent: () => void;
|
|
426
|
+
}> = ({ onPairWithAgent }) => {
|
|
427
|
+
if (isWasm()) {
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return (
|
|
432
|
+
<Button
|
|
433
|
+
variant="text"
|
|
434
|
+
className="gap-1.5 text-sm text-link hover:underline"
|
|
435
|
+
onClick={onPairWithAgent}
|
|
436
|
+
>
|
|
437
|
+
<SparklesIcon className="h-3.5 w-3.5 shrink-0" />
|
|
438
|
+
<span>Work on this notebook with your own agent</span>
|
|
439
|
+
<ArrowRightIcon className="h-3 w-3 shrink-0" />
|
|
440
|
+
</Button>
|
|
441
|
+
);
|
|
442
|
+
};
|
|
443
|
+
|
|
419
444
|
const ChatPanel = () => {
|
|
420
445
|
const aiConfigured = useAtomValue(aiEnabledAtom);
|
|
421
446
|
const { handleClick } = useOpenSettingsToTab();
|
|
@@ -455,6 +480,7 @@ const ChatPanelBody = () => {
|
|
|
455
480
|
const messagesEndRef = useRef<HTMLDivElement>(null);
|
|
456
481
|
const runtimeManager = useRuntimeManager();
|
|
457
482
|
const { invokeAiTool, sendRun } = useRequestClient();
|
|
483
|
+
const { openModal, closeModal } = useImperativeModal();
|
|
458
484
|
|
|
459
485
|
const activeChatId = activeChat?.id;
|
|
460
486
|
const store = useStore();
|
|
@@ -614,6 +640,10 @@ const ChatPanelBody = () => {
|
|
|
614
640
|
clearFiles();
|
|
615
641
|
});
|
|
616
642
|
|
|
643
|
+
const handlePairWithAgent = useEvent(() => {
|
|
644
|
+
openModal(<PairWithAgentModal onClose={closeModal} />);
|
|
645
|
+
});
|
|
646
|
+
|
|
617
647
|
const handleMessageEdit = useEvent((index: number, newValue: string) => {
|
|
618
648
|
const editedMessage = messages[index];
|
|
619
649
|
const fileParts = editedMessage.parts?.filter((p) => p.type === "file");
|
|
@@ -724,9 +754,12 @@ const ChatPanelBody = () => {
|
|
|
724
754
|
ref={scrollContainerRef}
|
|
725
755
|
>
|
|
726
756
|
{isNewThread && (
|
|
727
|
-
<div className="
|
|
728
|
-
|
|
729
|
-
|
|
757
|
+
<div className="flex flex-col gap-2">
|
|
758
|
+
<div className="rounded-md border bg-background">
|
|
759
|
+
{filesPills}
|
|
760
|
+
{chatInput}
|
|
761
|
+
</div>
|
|
762
|
+
<PairWithAgentCallout onPairWithAgent={handlePairWithAgent} />
|
|
730
763
|
</div>
|
|
731
764
|
)}
|
|
732
765
|
|
|
@@ -231,7 +231,7 @@ const RevealSlidesComponent = ({
|
|
|
231
231
|
activeIndex,
|
|
232
232
|
onSlideChange,
|
|
233
233
|
mode,
|
|
234
|
-
configWidth
|
|
234
|
+
configWidth, // px
|
|
235
235
|
isEditable = false,
|
|
236
236
|
}: {
|
|
237
237
|
cellsWithOutput: RuntimeCell[];
|
|
@@ -240,7 +240,7 @@ const RevealSlidesComponent = ({
|
|
|
240
240
|
activeIndex?: number;
|
|
241
241
|
onSlideChange?: (index: number) => void;
|
|
242
242
|
mode: AppMode;
|
|
243
|
-
configWidth
|
|
243
|
+
configWidth: number;
|
|
244
244
|
isEditable?: boolean;
|
|
245
245
|
}) => {
|
|
246
246
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -439,7 +439,7 @@ const RevealSlidesComponent = ({
|
|
|
439
439
|
<div className="group relative" style={{ width, height }}>
|
|
440
440
|
<Deck
|
|
441
441
|
deckRef={deckRef}
|
|
442
|
-
className="aspect-video w-full overflow-hidden border rounded bg-background mo-slides-theme prose-slides"
|
|
442
|
+
className="aspect-video w-full overflow-hidden border rounded bg-background mo-slides-theme prose-slides focus:outline-none focus-visible:outline-none"
|
|
443
443
|
config={revealConfig}
|
|
444
444
|
onReady={handleDeckReady}
|
|
445
445
|
onSlideChange={handleSlideChange}
|
|
@@ -26,15 +26,23 @@ import type {
|
|
|
26
26
|
SlidesLayout,
|
|
27
27
|
SlideType,
|
|
28
28
|
} from "../editor/renderers/slides-layout/types";
|
|
29
|
-
import {
|
|
29
|
+
import { useAtom } from "jotai";
|
|
30
|
+
import { atomWithStorage } from "jotai/utils";
|
|
30
31
|
import { Tooltip } from "../ui/tooltip";
|
|
31
32
|
import { Button } from "../ui/button";
|
|
32
33
|
import { Kbd } from "../ui/kbd";
|
|
33
34
|
import type { RuntimeCell } from "@/core/cells/types";
|
|
35
|
+
import { jotaiJsonStorage } from "@/utils/storage/jotai";
|
|
34
36
|
|
|
35
37
|
export const DEFAULT_SLIDE_TYPE: SlideType = "slide";
|
|
36
38
|
export const DEFAULT_DECK_TRANSITION: DeckTransition = "slide";
|
|
37
39
|
const COLLAPSED_CONFIG_WIDTH = 36;
|
|
40
|
+
const slideConfigOpenAtom = atomWithStorage<boolean>(
|
|
41
|
+
"marimo:slides:config-open",
|
|
42
|
+
true,
|
|
43
|
+
jotaiJsonStorage,
|
|
44
|
+
{ getOnInit: true },
|
|
45
|
+
);
|
|
38
46
|
|
|
39
47
|
export interface SlideTypeOption {
|
|
40
48
|
value: SlideType;
|
|
@@ -322,7 +330,7 @@ export const SlideSidebar = ({
|
|
|
322
330
|
setLayout: (layout: SlidesLayout) => void;
|
|
323
331
|
activeConfigCell?: RuntimeCell;
|
|
324
332
|
}) => {
|
|
325
|
-
const [isConfigOpen, setIsConfigOpen] =
|
|
333
|
+
const [isConfigOpen, setIsConfigOpen] = useAtom(slideConfigOpenAtom);
|
|
326
334
|
|
|
327
335
|
return (
|
|
328
336
|
<aside
|
|
@@ -350,7 +358,7 @@ export const SlideSidebar = ({
|
|
|
350
358
|
variant="ghost"
|
|
351
359
|
size="icon"
|
|
352
360
|
className="h-7 w-7 text-muted-foreground hover:text-foreground"
|
|
353
|
-
onClick={() => setIsConfigOpen(!
|
|
361
|
+
onClick={() => setIsConfigOpen((open) => !open)}
|
|
354
362
|
aria-expanded={isConfigOpen}
|
|
355
363
|
aria-controls="slide-config-panel"
|
|
356
364
|
>
|