@marimo-team/islands 0.25.3-dev431 → 0.25.3-dev432
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/{ErrorBoundary-CRk39Htl.js → ErrorBoundary-B43oV3b6.js} +1 -1
- package/dist/{chat-ui-BrqZd6Qb.js → chat-ui-BEMyRpmS.js} +720 -721
- package/dist/{code-visibility-IOaiwld2.js → code-visibility-S6mDxnr2.js} +1 -1
- package/dist/{common-e3QeLbF6.js → common-CIHg51sQ.js} +301 -301
- package/dist/{data-grid-overlay-editor-BNtYFq14.js → data-grid-overlay-editor-BCWPWxh4.js} +1 -1
- package/dist/{feedback-button-DEHXkqTr.js → feedback-button-DI9se_Ct.js} +2 -2
- package/dist/{glide-data-editor-CcmkcHzC.js → glide-data-editor-BeLtV7nF.js} +3 -3
- package/dist/{globals-Bwn2Opww.js → globals-DLPrOEeB.js} +1 -1
- package/dist/{html-to-image-ffxLmS29.js → html-to-image-DuNAF8H5.js} +1 -1
- package/dist/main.js +251 -251
- package/dist/{number-overlay-editor-iF4C4jgs.js → number-overlay-editor-CZLODMHG.js} +1 -1
- package/dist/{process-output-BEi2k7G4.js → process-output-Cl97_Reh.js} +1 -1
- package/dist/{reveal-component-Lmc4rqUp.js → reveal-component-CcavTIL_.js} +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/chat/chat-panel.tsx +21 -11
- package/src/components/editor/ai/prompt-input.tsx +11 -1
- package/src/components/chat/chat-empty-state.tsx +0 -55
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
SettingsIcon,
|
|
19
19
|
XIcon,
|
|
20
20
|
} from "lucide-react";
|
|
21
|
-
import { memo, useEffect, useRef, useState } from "react";
|
|
21
|
+
import { memo, useEffect, useMemo, useRef, useState } from "react";
|
|
22
22
|
import useEvent from "react-use-event-hook";
|
|
23
23
|
import { Button } from "@/components/ui/button";
|
|
24
24
|
import { replaceMessagesInChat } from "@/core/ai/chat-utils";
|
|
@@ -41,11 +41,15 @@ import { aiAtom, aiModelConfiguredAtom } from "@/core/config/config";
|
|
|
41
41
|
import { DEFAULT_AI_MODEL } from "@/core/config/config-schema";
|
|
42
42
|
import { useRequestClient } from "@/core/network/requests";
|
|
43
43
|
import { useRuntimeManager } from "@/core/runtime/config";
|
|
44
|
+
import { isWasm } from "@/core/wasm/utils";
|
|
44
45
|
import { ErrorBanner } from "@/plugins/impl/common/error-banner";
|
|
45
46
|
import { Logger } from "@/utils/Logger";
|
|
46
47
|
import { AIModelDropdown } from "../ai/ai-model-dropdown";
|
|
47
48
|
import { useOpenSettingsToTab } from "../app-config/state";
|
|
48
|
-
import {
|
|
49
|
+
import {
|
|
50
|
+
PairWithAgentBanner,
|
|
51
|
+
usePairWithAgentModal,
|
|
52
|
+
} from "../editor/actions/pair-with-agent";
|
|
49
53
|
import { PromptInput } from "../editor/ai/prompt-input";
|
|
50
54
|
import { PendingAICells } from "../editor/chrome/wrapper/pending-ai-cells";
|
|
51
55
|
import {
|
|
@@ -76,7 +80,6 @@ import {
|
|
|
76
80
|
import { AgentActivity } from "./agent-activity";
|
|
77
81
|
import { getAnswerText, renderUIMessage } from "./chat-display";
|
|
78
82
|
import { ChatHistoryPopover } from "./chat-history-popover";
|
|
79
|
-
import { ChatEmptyState } from "./chat-empty-state";
|
|
80
83
|
import { CapabilitiesPopover } from "./capabilities-popover";
|
|
81
84
|
import { NotebookAccessSelector } from "./notebook-access-selector";
|
|
82
85
|
import {
|
|
@@ -378,6 +381,20 @@ const ChatInput: React.FC<ChatInputProps> = memo(
|
|
|
378
381
|
onAddFiles,
|
|
379
382
|
onClose,
|
|
380
383
|
}) => {
|
|
384
|
+
const openPairWithAgentModal = usePairWithAgentModal();
|
|
385
|
+
const placeholderAction = useMemo(
|
|
386
|
+
() =>
|
|
387
|
+
isWasm()
|
|
388
|
+
? undefined
|
|
389
|
+
: {
|
|
390
|
+
beforeText: "Type your message or ",
|
|
391
|
+
linkText: "pair your own coding agent",
|
|
392
|
+
afterText: ". Use @ to reference variables and cells.",
|
|
393
|
+
onClick: openPairWithAgentModal,
|
|
394
|
+
},
|
|
395
|
+
[openPairWithAgentModal],
|
|
396
|
+
);
|
|
397
|
+
|
|
381
398
|
const handleSendClick = useEvent(() => {
|
|
382
399
|
if (input.trim()) {
|
|
383
400
|
onSubmit(undefined, input);
|
|
@@ -396,6 +413,7 @@ const ChatInput: React.FC<ChatInputProps> = memo(
|
|
|
396
413
|
onClose={onClose}
|
|
397
414
|
onAddFiles={onAddFiles}
|
|
398
415
|
placeholder="Type your message. Use @ to reference variables and cells."
|
|
416
|
+
placeholderAction={placeholderAction}
|
|
399
417
|
/>
|
|
400
418
|
</div>
|
|
401
419
|
<ChatInputFooter
|
|
@@ -1069,14 +1087,6 @@ const ChatPanelBody = () => {
|
|
|
1069
1087
|
ref={scrollContainerRef}
|
|
1070
1088
|
onScroll={handleScroll}
|
|
1071
1089
|
>
|
|
1072
|
-
{isNewThread && !isTurnActive && !error && (
|
|
1073
|
-
<ChatEmptyState
|
|
1074
|
-
onSelectPrompt={(prompt) => {
|
|
1075
|
-
setNewThreadInput(prompt);
|
|
1076
|
-
focusInputAndMoveToEnd(newThreadInputRef);
|
|
1077
|
-
}}
|
|
1078
|
-
/>
|
|
1079
|
-
)}
|
|
1080
1090
|
<TooltipProvider>
|
|
1081
1091
|
{messages.map((message, idx) => {
|
|
1082
1092
|
const isLast = idx === messages.length - 1;
|
|
@@ -19,6 +19,7 @@ import { useStore } from "jotai";
|
|
|
19
19
|
import { useMemo } from "react";
|
|
20
20
|
import useEvent from "react-use-event-hook";
|
|
21
21
|
import { z } from "zod";
|
|
22
|
+
import { clickablePlaceholderExtension } from "@/core/codemirror/placeholder/extensions";
|
|
22
23
|
import { resourceExtension } from "@/core/codemirror/ai/resources";
|
|
23
24
|
import { useTheme } from "@/theme/useTheme";
|
|
24
25
|
import { cn } from "@/utils/cn";
|
|
@@ -36,6 +37,7 @@ export interface AdditionalCompletions {
|
|
|
36
37
|
interface PromptInputProps {
|
|
37
38
|
inputRef?: React.RefObject<ReactCodeMirrorRef | null>;
|
|
38
39
|
placeholder?: string;
|
|
40
|
+
placeholderAction?: Parameters<typeof clickablePlaceholderExtension>[0];
|
|
39
41
|
value: string;
|
|
40
42
|
className?: string;
|
|
41
43
|
onKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
@@ -56,6 +58,7 @@ interface PromptInputProps {
|
|
|
56
58
|
export const PromptInput = ({
|
|
57
59
|
value,
|
|
58
60
|
placeholder,
|
|
61
|
+
placeholderAction,
|
|
59
62
|
inputRef,
|
|
60
63
|
className,
|
|
61
64
|
onChange,
|
|
@@ -89,6 +92,9 @@ export const PromptInput = ({
|
|
|
89
92
|
const extensions = useMemo(() => {
|
|
90
93
|
const markdownLanguage = markdown();
|
|
91
94
|
return [
|
|
95
|
+
...(placeholderAction
|
|
96
|
+
? clickablePlaceholderExtension(placeholderAction)
|
|
97
|
+
: []),
|
|
92
98
|
autocompletion({}),
|
|
93
99
|
markdownLanguage,
|
|
94
100
|
resourceExtension({
|
|
@@ -150,6 +156,7 @@ export const PromptInput = ({
|
|
|
150
156
|
];
|
|
151
157
|
}, [
|
|
152
158
|
store,
|
|
159
|
+
placeholderAction,
|
|
153
160
|
onAddFiles,
|
|
154
161
|
additionalCompletionsSource,
|
|
155
162
|
handleSubmit,
|
|
@@ -172,7 +179,10 @@ export const PromptInput = ({
|
|
|
172
179
|
onKeyDown={onKeyDown}
|
|
173
180
|
theme={theme === "dark" ? "dark" : "light"}
|
|
174
181
|
placeholder={
|
|
175
|
-
|
|
182
|
+
placeholderAction
|
|
183
|
+
? undefined
|
|
184
|
+
: placeholder ||
|
|
185
|
+
`Generate with AI, ${CONTEXT_TRIGGER} to include context`
|
|
176
186
|
}
|
|
177
187
|
/>
|
|
178
188
|
);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { PlugIcon } from "lucide-react";
|
|
4
|
-
import { usePairWithAgentModal } from "@/components/editor/actions/pair-with-agent";
|
|
5
|
-
import { MarimoIcon } from "@/components/icons/marimo-icons";
|
|
6
|
-
import { Button } from "@/components/ui/button";
|
|
7
|
-
import { isWasm } from "@/core/wasm/utils";
|
|
8
|
-
|
|
9
|
-
const STARTER_PROMPTS = [
|
|
10
|
-
"Explain this notebook",
|
|
11
|
-
"Help me visualize my data",
|
|
12
|
-
"Suggest improvements",
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
interface ChatEmptyStateProps {
|
|
16
|
-
onSelectPrompt: (prompt: string) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const ChatEmptyState = ({ onSelectPrompt }: ChatEmptyStateProps) => {
|
|
20
|
-
const openPairWithAgentModal = usePairWithAgentModal();
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div className="flex flex-1 flex-col justify-center pb-12">
|
|
24
|
-
<div className="mx-auto flex w-full max-w-xs flex-col items-center gap-5 px-3 py-6">
|
|
25
|
-
<MarimoIcon size={40} stroke="#1c7361" />
|
|
26
|
-
<h2 className="text-center text-base font-medium leading-6 text-foreground">
|
|
27
|
-
What would you like to do?
|
|
28
|
-
</h2>
|
|
29
|
-
<div className="flex w-full flex-col gap-2">
|
|
30
|
-
{STARTER_PROMPTS.map((prompt) => (
|
|
31
|
-
<Button
|
|
32
|
-
key={prompt}
|
|
33
|
-
variant="outline"
|
|
34
|
-
className="h-auto min-h-9 justify-start border-border px-3 py-2 text-left text-xs font-normal shadow-none whitespace-normal"
|
|
35
|
-
onClick={() => onSelectPrompt(prompt)}
|
|
36
|
-
>
|
|
37
|
-
{prompt}
|
|
38
|
-
</Button>
|
|
39
|
-
))}
|
|
40
|
-
</div>
|
|
41
|
-
{!isWasm() && (
|
|
42
|
-
<Button
|
|
43
|
-
type="button"
|
|
44
|
-
variant="link"
|
|
45
|
-
className="h-auto gap-1.5 p-0 text-xs font-normal"
|
|
46
|
-
onClick={openPairWithAgentModal}
|
|
47
|
-
>
|
|
48
|
-
<PlugIcon className="size-3.5" aria-hidden={true} />
|
|
49
|
-
Pair your own coding agent
|
|
50
|
-
</Button>
|
|
51
|
-
)}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
};
|