@marimo-team/islands 0.19.7-dev38 → 0.19.7-dev39
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/main.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/app-config/ai-config.tsx +28 -0
- package/src/components/chat/chat-panel.tsx +1 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +1 -0
- package/src/components/editor/ai/ai-completion-editor.tsx +1 -0
- package/src/components/editor/renderers/cell-array.tsx +11 -3
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
BotIcon,
|
|
6
6
|
BrainIcon,
|
|
7
7
|
ChevronRightIcon,
|
|
8
|
+
InfoIcon,
|
|
8
9
|
PlusIcon,
|
|
9
10
|
Trash2Icon,
|
|
10
11
|
} from "lucide-react";
|
|
@@ -61,6 +62,7 @@ import {
|
|
|
61
62
|
} from "../ui/accordion";
|
|
62
63
|
import { Button } from "../ui/button";
|
|
63
64
|
import { Checkbox } from "../ui/checkbox";
|
|
65
|
+
import { DropdownMenuSeparator } from "../ui/dropdown-menu";
|
|
64
66
|
import { Label } from "../ui/label";
|
|
65
67
|
import { ExternalLink } from "../ui/links";
|
|
66
68
|
import {
|
|
@@ -272,6 +274,32 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|
|
272
274
|
placeholder={placeholder}
|
|
273
275
|
onSelect={selectModel}
|
|
274
276
|
triggerClassName="text-sm"
|
|
277
|
+
customDropdownContent={
|
|
278
|
+
<>
|
|
279
|
+
<DropdownMenuSeparator />
|
|
280
|
+
<p className="px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1">
|
|
281
|
+
Enter a custom model
|
|
282
|
+
<Tooltip content="Models should include the provider prefix, e.g. 'openai/gpt-4o'">
|
|
283
|
+
<InfoIcon className="h-3 w-3" />
|
|
284
|
+
</Tooltip>
|
|
285
|
+
</p>
|
|
286
|
+
<div className="px-2 py-1">
|
|
287
|
+
<Input
|
|
288
|
+
className="w-full border-border shadow-none focus-visible:shadow-xs"
|
|
289
|
+
placeholder={placeholder}
|
|
290
|
+
{...field}
|
|
291
|
+
value={asStringOrEmpty(field.value)}
|
|
292
|
+
onKeyDown={Events.stopPropagation()}
|
|
293
|
+
/>
|
|
294
|
+
{value && (
|
|
295
|
+
<IncorrectModelId
|
|
296
|
+
value={value}
|
|
297
|
+
includeSuggestion={false}
|
|
298
|
+
/>
|
|
299
|
+
)}
|
|
300
|
+
</div>
|
|
301
|
+
</>
|
|
302
|
+
}
|
|
275
303
|
forRole={forRole}
|
|
276
304
|
/>
|
|
277
305
|
</FormControl>
|
|
@@ -433,7 +433,7 @@ const ChatPanel = () => {
|
|
|
433
433
|
return (
|
|
434
434
|
<PanelEmptyState
|
|
435
435
|
title="Chat with AI"
|
|
436
|
-
description="No AI provider configured or model selected"
|
|
436
|
+
description="No AI provider configured or Chat model not selected"
|
|
437
437
|
action={
|
|
438
438
|
<Button
|
|
439
439
|
variant="outline"
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
SquareMIcon,
|
|
14
14
|
} from "lucide-react";
|
|
15
15
|
import { useEffect } from "react";
|
|
16
|
+
import { useOpenSettingsToTab } from "@/components/app-config/state";
|
|
16
17
|
import { StartupLogsAlert } from "@/components/editor/alerts/startup-logs-alert";
|
|
17
18
|
import { Cell } from "@/components/editor/notebook-cell";
|
|
18
19
|
import { PackageAlert } from "@/components/editor/package-alert";
|
|
@@ -253,6 +254,7 @@ const AddCellButtons: React.FC<{
|
|
|
253
254
|
const [isAiButtonOpen, isAiButtonOpenActions] = useBoolean(false);
|
|
254
255
|
const aiEnabled = useAtomValue(aiEnabledAtom);
|
|
255
256
|
const canInteractWithApp = useAtomValue(canInteractWithAppAtom);
|
|
257
|
+
const { handleClick } = useOpenSettingsToTab();
|
|
256
258
|
|
|
257
259
|
const buttonClass = cn(
|
|
258
260
|
"mb-0 rounded-none sm:px-4 md:px-5 lg:px-8 tracking-wide no-wrap whitespace-nowrap",
|
|
@@ -320,7 +322,9 @@ const AddCellButtons: React.FC<{
|
|
|
320
322
|
</Button>
|
|
321
323
|
<Tooltip
|
|
322
324
|
content={
|
|
323
|
-
aiEnabled ? null :
|
|
325
|
+
aiEnabled ? null : (
|
|
326
|
+
<span>AI provider not found or Edit model not selected</span>
|
|
327
|
+
)
|
|
324
328
|
}
|
|
325
329
|
delayDuration={100}
|
|
326
330
|
asChild={false}
|
|
@@ -329,8 +333,12 @@ const AddCellButtons: React.FC<{
|
|
|
329
333
|
className={buttonClass}
|
|
330
334
|
variant="text"
|
|
331
335
|
size="sm"
|
|
332
|
-
disabled={!
|
|
333
|
-
onClick={
|
|
336
|
+
disabled={!canInteractWithApp}
|
|
337
|
+
onClick={
|
|
338
|
+
aiEnabled
|
|
339
|
+
? isAiButtonOpenActions.toggle
|
|
340
|
+
: () => handleClick("ai", "ai-providers")
|
|
341
|
+
}
|
|
334
342
|
>
|
|
335
343
|
<SparklesIcon className="mr-2 size-4 shrink-0" />
|
|
336
344
|
Generate with AI
|