@alivault/pico 0.5.2 → 0.6.1

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.
@@ -2,7 +2,7 @@ import { i as __toESM } from "../_runtime.mjs";
2
2
  import { A as DialogRoot, C as MenuPortal, D as TabsTab, E as TabsList$1, F as DialogBackdrop, I as Separator, K as mergeProps, L as Input, M as DialogPopup, N as DialogDescription$1, O as TabsRoot, P as DialogClose, R as Button, S as MenuPositioner, T as MenuItem, X as require_react, Y as require_jsx_runtime, _ as AccordionRoot, a as CollapsiblePanel, b as MenuSubmenuRoot, c as PopoverPopup, d as PopoverTrigger$1, f as PopoverRoot, g as AccordionItem$1, h as AccordionHeader, i as ContextMenuRoot, j as DialogPortal$1, k as DialogTitle$1, l as PopoverPositioner, m as AccordionTrigger$1, n as Toggle, o as CollapsibleTrigger$1, p as AccordionPanel, r as ContextMenuTrigger$1, s as CollapsibleRoot, t as ToggleGroup, u as PopoverPortal, v as MenuSubmenuTrigger, w as MenuPopup, x as MenuRoot, y as MenuTrigger, z as useRender } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
4
4
  import { A as ChevronsUpDown, B as ArrowDown, C as FolderPlus, D as Copy, E as Download, F as Check, I as ArrowUp, L as ArrowUpToLine, N as ChevronRight, O as Command, P as ChevronDown, S as Folder, T as EllipsisVertical, _ as ListEnd, a as Square, b as GitBranch, c as Settings2, d as PanelLeft, f as PanelLeftOpen, g as ListStart, h as OctagonX, j as ChevronsDownUp, l as Search, n as WandSparkles, o as SquarePen, p as PanelLeftClose, r as Upload, s as SquareArrowOutUpRight, t as X, u as PanelRight, w as Ellipsis, x as GitCommitHorizontal, y as ImagePlus, z as ArrowLeft } from "../_libs/lucide-react.mjs";
5
- import { $ as readStoredRightSidebarOpen, B as normalizeSessionSelectionKeys, C as TooltipContent, E as VIEWER_CONTEXT_STORAGE_KEY, G as readStoredAutoScrollEnabled, H as normalizeThemeMode, I as flattenTree, J as readStoredDraftDirectory, K as readStoredCenterMessages, L as getSessionTitle, M as createInitialSessionState, O as buildItemsFromSync, Q as readStoredRecentDirectories, S as Tooltip$1, T as TooltipTrigger, U as previewUrlForImage, V as normalizeStoredDirectoryList, W as promptDraftKey, X as readStoredPinnedSessionKeys, Y as readStoredHideToolBlocks, Z as readStoredPromptDraft, _ as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, a as HIDE_TOOL_BLOCKS_STORAGE_KEY, at as safeLocalStorageSetItem, c as PINNED_SESSIONS_STORAGE_KEY, ct as thinkingSummaryText, d as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, et as readStoredSessionDoneDesktopNotificationsEnabled, f as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, g as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, h as Route, i as DRAFT_DIRECTORY_STORAGE_KEY, it as safeLocalStorageGetItem, j as createContextId, k as cn, l as RECENT_DIRECTORIES_STORAGE_KEY, m as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, n as CENTER_MESSAGES_STORAGE_KEY, nt as readStoredSidebarDirectories, o as Kbd, ot as sameContextUsage, p as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, q as readStoredCollapsedDirectories, r as COLLAPSED_DIRECTORIES_STORAGE_KEY, rt as rememberStoredPromptDraft, s as KeyboardShortcutContent, st as sessionListEntryKey, t as AUTO_SCROLL_ENABLED_STORAGE_KEY, tt as readStoredSessionDoneSoundEnabled, u as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, v as SIDEBAR_DIRECTORIES_STORAGE_KEY, x as TitleTooltip, y as Spinner, z as normalizePromptImage } from "./routes-Dmryr4Ep.mjs";
5
+ import { $ as readStoredCenterMessages, A as TooltipTrigger, C as THEME_COLOR_MODE_STORAGE_KEY, D as Tooltip$1, E as TitleTooltip, F as cn, G as normalizePromptImage, H as flattenTree, J as normalizeThemeColorMode, K as normalizeSessionSelectionKeys, L as createContextId, M as appliedThemeClass, O as TooltipContent, P as buildItemsFromSync, Q as readStoredAutoScrollEnabled, R as createInitialSessionState, S as THEME_COLOR_MODES, T as THEME_STORAGE_KEY, U as getSessionTitle, X as previewUrlForImage, Y as normalizeThemeFamily, Z as promptDraftKey, _ as Route, _t as themeColorModeLabel, a as COLLAPSED_DIRECTORIES_STORAGE_KEY, at as readStoredRecentDirectories, b as SIDEBAR_DIRECTORIES_STORAGE_KEY, c as Kbd, ct as readStoredSessionDoneSoundEnabled, d as RECENT_DIRECTORIES_STORAGE_KEY, dt as readStoredThemeColorMode, et as readStoredCollapsedDirectories, f as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, ft as rememberStoredPromptDraft, g as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, gt as sessionListEntryKey, h as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, ht as sameContextUsage, i as CENTER_MESSAGES_STORAGE_KEY, it as readStoredPromptDraft, j as VIEWER_CONTEXT_STORAGE_KEY, l as KeyboardShortcutContent, lt as readStoredSidebarDirectories, m as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, mt as safeLocalStorageSetItem, n as APPLIED_THEME_STORAGE_KEY, nt as readStoredHideToolBlocks, o as DRAFT_DIRECTORY_STORAGE_KEY, ot as readStoredRightSidebarOpen, p as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, pt as safeLocalStorageGetItem, q as normalizeStoredDirectoryList, r as AUTO_SCROLL_ENABLED_STORAGE_KEY, rt as readStoredPinnedSessionKeys, s as HIDE_TOOL_BLOCKS_STORAGE_KEY, st as readStoredSessionDoneDesktopNotificationsEnabled, tt as readStoredDraftDirectory, u as PINNED_SESSIONS_STORAGE_KEY, ut as readStoredTheme, v as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, vt as themeFamilyLabel, w as THEME_FAMILIES, x as Spinner, y as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, yt as thinkingSummaryText } from "./routes-Qk9CE25v.mjs";
6
6
  import { i as useQuery, n as useIsMutating, o as useQueryClient, r as useIsFetching, t as useMutation } from "../_libs/tanstack__react-query.mjs";
7
7
  import { t as useHotkeys } from "../_libs/tanstack__react-hotkeys.mjs";
8
8
  import { a as matchesKeyboardEvent, i as batch, o as formatForDisplay, r as createStore } from "../_libs/@tanstack/hotkeys+[...].mjs";
@@ -22,7 +22,7 @@ import { t as remarkGfm } from "../_libs/remark-gfm.mjs";
22
22
  import { a as getBuiltInSpriteSheet, i as getBuiltInFileIconColor, n as FileTree, r as createFileTreeIconResolver, t as useFileTree } from "../_libs/@pierre/trees+[...].mjs";
23
23
  import { a as closestCenter, d as useSensors, f as CSS$1, i as PointerSensor, n as DragOverlay, t as DndContext, u as useSensor } from "../_libs/@dnd-kit/core+[...].mjs";
24
24
  import { a as verticalListSortingStrategy, i as useSortable, n as arrayMove, r as horizontalListSortingStrategy, t as SortableContext } from "../_libs/dnd-kit__sortable.mjs";
25
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-B_4MdyY2.js
25
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-C5zYkwvE.js
26
26
  var import_react = /* @__PURE__ */ __toESM(require_react());
27
27
  var import_jsx_runtime = require_jsx_runtime();
28
28
  var MOBILE_BREAKPOINT = 768;
@@ -2774,25 +2774,33 @@ function AppShellSessionsDialogController({ ref, openStateRef, ...props }) {
2774
2774
  ...props
2775
2775
  });
2776
2776
  }
2777
- var THEME_OPTIONS = [
2778
- "system",
2779
- "light",
2780
- "dark"
2781
- ];
2777
+ var THEME_OPTIONS = [...THEME_FAMILIES];
2778
+ var THEME_COLOR_MODE_OPTIONS = [...THEME_COLOR_MODES];
2782
2779
  function desktopNotificationPermissionLabel(permission) {
2783
2780
  if (permission === "unsupported") return "Desktop notifications are unavailable in this browser.";
2784
2781
  if (permission === "granted") return "Desktop notifications are enabled for this origin.";
2785
2782
  if (permission === "denied") return "Desktop notifications are blocked in this browser.";
2786
2783
  return "Desktop notifications will ask for browser permission when enabled.";
2787
2784
  }
2788
- function formatThemeMode(theme) {
2789
- return `${theme[0].toUpperCase()}${theme.slice(1)}`;
2790
- }
2791
2785
  function formatToggleValue(enabled) {
2792
2786
  return enabled ? "On" : "Off";
2793
2787
  }
2794
- function nextThemeMode(currentTheme) {
2795
- return THEME_OPTIONS[(THEME_OPTIONS.indexOf(currentTheme) + 1) % THEME_OPTIONS.length] ?? "system";
2788
+ function nextThemeColorMode(currentMode) {
2789
+ return THEME_COLOR_MODE_OPTIONS[(THEME_COLOR_MODE_OPTIONS.indexOf(currentMode) + 1) % THEME_COLOR_MODE_OPTIONS.length] ?? "auto";
2790
+ }
2791
+ function themeDescription(theme) {
2792
+ switch (theme) {
2793
+ case "default": return "Use Pico's default palette.";
2794
+ case "flexoki": return "Use Flexoki's warm paper and inky dark palettes.";
2795
+ default: return "Use this theme.";
2796
+ }
2797
+ }
2798
+ function themeKeywords(theme) {
2799
+ return [
2800
+ theme,
2801
+ themeFamilyLabel(theme),
2802
+ themeDescription(theme)
2803
+ ];
2796
2804
  }
2797
2805
  function settingsCommandKeywords(command) {
2798
2806
  return [
@@ -2807,9 +2815,13 @@ function settingsCommandFilter(value, search, keywords) {
2807
2815
  if (!query) return 1;
2808
2816
  return [value, ...keywords ?? []].join(" ").toLowerCase().includes(query) ? 1 : 0;
2809
2817
  }
2810
- function AppShellSettingsDialog({ open, onOpenChange, currentTheme, onThemeChange, hideThinkingBlocks, onHideThinkingBlocksChange, hideToolBlocks, onHideToolBlocksChange, centerMessages, onCenterMessagesChange, autoScrollEnabled, onAutoScrollEnabledChange, sessionDoneSoundEnabled, onSessionDoneSoundEnabledChange, sessionDoneDesktopNotificationsEnabled, onSessionDoneDesktopNotificationsEnabledChange, desktopNotificationPermission, onLoginProviders, onLogoutProviders }) {
2818
+ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentThemeColorMode, onThemeChange, onThemeColorModeChange, onThemePreviewChange, systemTheme, hideThinkingBlocks, onHideThinkingBlocksChange, hideToolBlocks, onHideToolBlocksChange, centerMessages, onCenterMessagesChange, autoScrollEnabled, onAutoScrollEnabledChange, sessionDoneSoundEnabled, onSessionDoneSoundEnabledChange, sessionDoneDesktopNotificationsEnabled, onSessionDoneDesktopNotificationsEnabledChange, desktopNotificationPermission, onLoginProviders, onLogoutProviders }) {
2811
2819
  const [query, setQuery] = import_react.useState("");
2820
+ const [themeQuery, setThemeQuery] = import_react.useState("");
2821
+ const [stage, setStage] = import_react.useState("browse");
2812
2822
  const [selectedCommandId, setSelectedCommandId] = import_react.useState("theme");
2823
+ const [selectedTheme, setSelectedTheme] = import_react.useState(currentTheme);
2824
+ const themePreviewInitialRef = import_react.useRef(currentTheme);
2813
2825
  const isMobile = useIsMobile();
2814
2826
  const desktopNotificationDescription = desktopNotificationPermissionLabel(desktopNotificationPermission);
2815
2827
  const settingGroups = [
@@ -2818,16 +2830,33 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, onThemeChang
2818
2830
  commands: [{
2819
2831
  id: "theme",
2820
2832
  title: "Theme",
2821
- description: "Cycle between system, light, and dark mode.",
2822
- valueLabel: formatThemeMode(currentTheme),
2833
+ description: "Choose between Default and Flexoki.",
2834
+ valueLabel: themeFamilyLabel(currentTheme),
2823
2835
  keywords: [
2824
2836
  "color",
2825
2837
  "mode",
2838
+ "default",
2839
+ "flexoki"
2840
+ ],
2841
+ onSelect: () => {
2842
+ themePreviewInitialRef.current = currentTheme;
2843
+ setSelectedTheme(currentTheme);
2844
+ setStage("theme");
2845
+ }
2846
+ }, {
2847
+ id: "theme-color-mode",
2848
+ title: "Light/dark mode",
2849
+ description: "Follow OS appearance, or force light or dark mode.",
2850
+ valueLabel: themeColorModeLabel(currentThemeColorMode, systemTheme),
2851
+ keywords: [
2852
+ "auto",
2826
2853
  "system",
2827
2854
  "light",
2828
- "dark"
2855
+ "dark",
2856
+ "mode",
2857
+ "color"
2829
2858
  ],
2830
- onSelect: () => onThemeChange(nextThemeMode(currentTheme))
2859
+ onSelect: () => onThemeColorModeChange(nextThemeColorMode(currentThemeColorMode))
2831
2860
  }]
2832
2861
  },
2833
2862
  {
@@ -2950,14 +2979,43 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, onThemeChang
2950
2979
  }
2951
2980
  ];
2952
2981
  import_react.useEffect(() => {
2953
- if (!open && query) setQuery("");
2954
- }, [open, query]);
2982
+ if (open) return;
2983
+ if (stage === "theme") onThemePreviewChange(themePreviewInitialRef.current);
2984
+ if (query) setQuery("");
2985
+ if (themeQuery) setThemeQuery("");
2986
+ setStage("browse");
2987
+ }, [
2988
+ onThemePreviewChange,
2989
+ open,
2990
+ query,
2991
+ stage,
2992
+ themeQuery
2993
+ ]);
2994
+ import_react.useEffect(() => {
2995
+ if (stage === "theme") setSelectedTheme(currentTheme);
2996
+ }, [currentTheme, stage]);
2955
2997
  const handleSelect = (command) => {
2956
2998
  Promise.resolve(command.onSelect()).catch((error) => {
2957
2999
  console.error(error);
2958
3000
  });
2959
3001
  };
2960
- const settingsCommandBody = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Command$1, {
3002
+ const handleThemePreview = (theme) => {
3003
+ if (!THEME_OPTIONS.includes(theme)) return;
3004
+ setSelectedTheme(theme);
3005
+ onThemePreviewChange(theme);
3006
+ };
3007
+ const handleThemeSelect = (theme) => {
3008
+ setSelectedTheme(theme);
3009
+ themePreviewInitialRef.current = theme;
3010
+ onThemeChange(theme);
3011
+ };
3012
+ const cancelThemePreview = () => {
3013
+ const initialTheme = themePreviewInitialRef.current;
3014
+ setSelectedTheme(initialTheme);
3015
+ onThemePreviewChange(initialTheme);
3016
+ setStage("browse");
3017
+ };
3018
+ const settingsBrowseBody = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Command$1, {
2961
3019
  shouldFilter: true,
2962
3020
  filter: settingsCommandFilter,
2963
3021
  loop: true,
@@ -2999,10 +3057,83 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, onThemeChang
2999
3057
  }),
3000
3058
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3001
3059
  className: "hidden border-t border-border/70 px-3 py-2 text-xs text-muted-foreground md:block",
3002
- children: "Use ↑/↓ to select, Enter to cycle or toggle, and Esc to close."
3060
+ children: "Use ↑/↓ to select, Enter to open or toggle, and Esc to close."
3003
3061
  })
3004
3062
  ]
3005
3063
  });
3064
+ const settingsThemeBody = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3065
+ className: "flex min-h-0 flex-1 flex-col",
3066
+ onKeyDown: (event) => {
3067
+ if (event.key !== "Escape") return;
3068
+ event.preventDefault();
3069
+ event.stopPropagation();
3070
+ cancelThemePreview();
3071
+ },
3072
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3073
+ className: "flex items-center gap-2 border-b border-border/70 px-3 py-2",
3074
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
3075
+ type: "button",
3076
+ variant: "ghost",
3077
+ size: "icon-sm",
3078
+ onClick: cancelThemePreview,
3079
+ "aria-label": "Back to settings",
3080
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowLeft, {})
3081
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3082
+ className: "min-w-0 flex-1",
3083
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3084
+ className: "truncate text-sm font-medium",
3085
+ children: "Choose theme"
3086
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3087
+ className: "truncate text-xs text-muted-foreground",
3088
+ children: ["Current: ", themeFamilyLabel(currentTheme)]
3089
+ })]
3090
+ })]
3091
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Command$1, {
3092
+ shouldFilter: true,
3093
+ loop: true,
3094
+ value: selectedTheme,
3095
+ onValueChange: (value) => handleThemePreview(value),
3096
+ className: "min-h-0 flex-1 rounded-none!",
3097
+ children: [
3098
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandInput, {
3099
+ autoFocus: !isMobile,
3100
+ value: themeQuery,
3101
+ onValueChange: setThemeQuery,
3102
+ placeholder: "Search themes",
3103
+ className: "text-base md:text-sm"
3104
+ }),
3105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CommandList, {
3106
+ className: "max-h-none min-h-0 flex-1 md:max-h-[min(70vh,28rem)]",
3107
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandEmpty, { children: "No themes found." }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandGroup, {
3108
+ heading: "Themes",
3109
+ children: THEME_OPTIONS.map((theme) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandItem, {
3110
+ value: theme,
3111
+ keywords: themeKeywords(theme),
3112
+ onMouseEnter: () => handleThemePreview(theme),
3113
+ onSelect: () => handleThemeSelect(theme),
3114
+ "data-checked": theme === currentTheme ? true : void 0,
3115
+ className: "items-start py-2",
3116
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3117
+ className: "flex min-w-0 flex-1 flex-col gap-0.5",
3118
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3119
+ className: "truncate font-medium",
3120
+ children: themeFamilyLabel(theme)
3121
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3122
+ className: "line-clamp-2 text-xs text-muted-foreground",
3123
+ children: themeDescription(theme)
3124
+ })]
3125
+ })
3126
+ }, theme))
3127
+ })]
3128
+ }),
3129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3130
+ className: "hidden border-t border-border/70 px-3 py-2 text-xs text-muted-foreground md:block",
3131
+ children: "Use ↑/↓ to select, Enter to choose, and Esc to go back."
3132
+ })
3133
+ ]
3134
+ })]
3135
+ });
3136
+ const settingsCommandBody = stage === "theme" ? settingsThemeBody : settingsBrowseBody;
3006
3137
  if (isMobile) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Drawer$1, {
3007
3138
  open,
3008
3139
  onOpenChange,
@@ -3019,7 +3150,7 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, onThemeChang
3019
3150
  open,
3020
3151
  onOpenChange,
3021
3152
  title: "Settings",
3022
- description: "Search settings. Press Enter on a setting to cycle or toggle it.",
3153
+ description: "Search settings. Press Enter on a setting to open or toggle it.",
3023
3154
  className: "sm:max-w-2xl",
3024
3155
  initialFocus: true,
3025
3156
  children: settingsCommandBody
@@ -7043,7 +7174,7 @@ var AppShellTreeDialogHost = import_react.memo(function AppShellTreeDialogHost({
7043
7174
  activeSessionStreaming: useSelector(sessionStore, (sessionState) => sessionState.streaming)
7044
7175
  });
7045
7176
  });
7046
- var AppShellSettingsDialogHost = import_react.memo(function AppShellSettingsDialogHost({ authDialogRef, currentTheme, displaySettingsStore, notificationStore, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onThemeChange, sessionStore, settingsDialogRef, settingsOpenRef }) {
7177
+ var AppShellSettingsDialogHost = import_react.memo(function AppShellSettingsDialogHost({ authDialogRef, currentTheme, currentThemeColorMode, displaySettingsStore, notificationStore, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onThemeChange, onThemeColorModeChange, onThemePreviewChange, sessionStore, settingsDialogRef, settingsOpenRef, systemTheme }) {
7047
7178
  const hideThinkingBlocks = useSelector(sessionStore, (sessionState) => sessionState.hideThinkingBlock);
7048
7179
  const { autoScrollEnabled, centerMessages, hideToolBlocks } = useSelector(displaySettingsStore);
7049
7180
  const { desktopNotificationPermission, sessionDoneDesktopNotificationsEnabled, sessionDoneSoundEnabled } = useSelector(notificationStore, (state) => ({
@@ -7059,7 +7190,11 @@ var AppShellSettingsDialogHost = import_react.memo(function AppShellSettingsDial
7059
7190
  ref: settingsDialogRef,
7060
7191
  openStateRef: settingsOpenRef,
7061
7192
  currentTheme,
7193
+ currentThemeColorMode,
7062
7194
  onThemeChange,
7195
+ onThemeColorModeChange,
7196
+ onThemePreviewChange,
7197
+ systemTheme,
7063
7198
  hideThinkingBlocks,
7064
7199
  onHideThinkingBlocksChange,
7065
7200
  hideToolBlocks,
@@ -7086,7 +7221,7 @@ var AppShellUiRequestDialogHost = import_react.memo(function AppShellUiRequestDi
7086
7221
  onAuthBack: () => authDialogRef.current?.open("login")
7087
7222
  });
7088
7223
  });
7089
- var AppShellFloatingControllers = import_react.memo(function AppShellFloatingControllers({ activeSessionId, addDirectoryDialogRef, addDirectoryOpenRef, addDirectoryPath, baseSidebarDirectories, commandPaletteCommandsRef, commandPaletteOpenRef, commandPaletteRef, currentSessionQueryScope, currentTheme, authDialogRef, authOpenRef, deleteDialogRef, deleteOpenRef, deleteSessions, deleteOldDirectorySessionsDialogRef, deleteOldDirectorySessionsOpenRef, notificationStore, forkDialogRef, forkOpenRef, gitCommitDialogRef, gitCommitOpenRef, displaySettingsStore, knownDirectories, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onSessionDialogSelect, onThemeChange, recentDirectoriesStore, renameDialogRef, renameOpenRef, renameSessionPath, sessionCwd, sessionsDialogDirectory, sessionsDialogRef, sessionsOpenRef, sessionStore, settingsDialogRef, settingsOpenRef, sidebarStore, treeDialogRef, treeOpenRef, uiRequestDialogRef, uiRequestOpenRef, viewerContextId }) {
7224
+ var AppShellFloatingControllers = import_react.memo(function AppShellFloatingControllers({ activeSessionId, addDirectoryDialogRef, addDirectoryOpenRef, addDirectoryPath, baseSidebarDirectories, commandPaletteCommandsRef, commandPaletteOpenRef, commandPaletteRef, currentSessionQueryScope, currentTheme, currentThemeColorMode, authDialogRef, authOpenRef, deleteDialogRef, deleteOpenRef, deleteSessions, deleteOldDirectorySessionsDialogRef, deleteOldDirectorySessionsOpenRef, notificationStore, forkDialogRef, forkOpenRef, gitCommitDialogRef, gitCommitOpenRef, displaySettingsStore, knownDirectories, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onSessionDialogSelect, onThemeChange, onThemeColorModeChange, onThemePreviewChange, recentDirectoriesStore, renameDialogRef, renameOpenRef, renameSessionPath, sessionCwd, sessionsDialogDirectory, sessionsDialogRef, sessionsOpenRef, sessionStore, settingsDialogRef, settingsOpenRef, sidebarStore, treeDialogRef, treeOpenRef, uiRequestDialogRef, uiRequestOpenRef, viewerContextId, systemTheme }) {
7090
7225
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
7091
7226
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppShellCommandPaletteHost, {
7092
7227
  commandPaletteCommandsRef,
@@ -7162,6 +7297,7 @@ var AppShellFloatingControllers = import_react.memo(function AppShellFloatingCon
7162
7297
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppShellSettingsDialogHost, {
7163
7298
  authDialogRef,
7164
7299
  currentTheme,
7300
+ currentThemeColorMode,
7165
7301
  displaySettingsStore,
7166
7302
  notificationStore,
7167
7303
  onAutoScrollEnabledChange,
@@ -7171,9 +7307,12 @@ var AppShellFloatingControllers = import_react.memo(function AppShellFloatingCon
7171
7307
  onSessionDoneDesktopNotificationsEnabledChange,
7172
7308
  onSessionDoneSoundEnabledChange,
7173
7309
  onThemeChange,
7310
+ onThemeColorModeChange,
7311
+ onThemePreviewChange,
7174
7312
  sessionStore,
7175
7313
  settingsDialogRef,
7176
- settingsOpenRef
7314
+ settingsOpenRef,
7315
+ systemTheme
7177
7316
  }),
7178
7317
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppShellUiRequestDialogHost, {
7179
7318
  activeSessionId,
@@ -18934,6 +19073,38 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
18934
19073
  submitPrompt
18935
19074
  };
18936
19075
  }
19076
+ function usePicoTheme() {
19077
+ const { setTheme, systemTheme } = z();
19078
+ const [themeFamily, setThemeFamilyState] = import_react.useState(() => readStoredTheme());
19079
+ const [colorMode, setColorModeState] = import_react.useState(() => readStoredThemeColorMode());
19080
+ const appliedTheme = appliedThemeClass(themeFamily, colorMode, systemTheme);
19081
+ import_react.useEffect(() => {
19082
+ setTheme(appliedTheme);
19083
+ safeLocalStorageSetItem(APPLIED_THEME_STORAGE_KEY, appliedTheme);
19084
+ }, [appliedTheme, setTheme]);
19085
+ const previewThemeFamily = (value) => {
19086
+ setThemeFamilyState(normalizeThemeFamily(value));
19087
+ };
19088
+ const setThemeFamily = (value) => {
19089
+ const nextTheme = normalizeThemeFamily(value);
19090
+ setThemeFamilyState(nextTheme);
19091
+ safeLocalStorageSetItem(THEME_STORAGE_KEY, nextTheme);
19092
+ };
19093
+ const setColorMode = (value) => {
19094
+ const nextMode = normalizeThemeColorMode(value);
19095
+ setColorModeState(nextMode);
19096
+ safeLocalStorageSetItem(THEME_COLOR_MODE_STORAGE_KEY, nextMode);
19097
+ };
19098
+ return {
19099
+ appliedTheme,
19100
+ colorMode,
19101
+ previewThemeFamily,
19102
+ setColorMode,
19103
+ setThemeFamily,
19104
+ systemTheme,
19105
+ themeFamily
19106
+ };
19107
+ }
18937
19108
  function sameThinkingLevelSessionTarget(target, state) {
18938
19109
  if (target.sessionKey || state.sessionKey) return target.sessionKey === state.sessionKey;
18939
19110
  if (target.sessionId || state.sessionId) return target.sessionId === state.sessionId;
@@ -20596,8 +20767,7 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
20596
20767
  conversationItemsStore.setItems(nextItems);
20597
20768
  setSessionState(nextState);
20598
20769
  }, [conversationItemsStore]);
20599
- const { setTheme, theme } = z();
20600
- const currentTheme = normalizeThemeMode(theme);
20770
+ const { colorMode: currentThemeColorMode, previewThemeFamily, setColorMode, setThemeFamily, systemTheme, themeFamily: currentTheme } = usePicoTheme();
20601
20771
  const { initialLoadingSessionId, loadingSessionId } = useSelector(appUiStore, (state) => ({
20602
20772
  initialLoadingSessionId: state.initialLoadingSessionId,
20603
20773
  loadingSessionId: state.loadingSessionId
@@ -21512,7 +21682,13 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
21512
21682
  }
21513
21683
  };
21514
21684
  const handleThemeChange = (value) => {
21515
- setTheme(value);
21685
+ setThemeFamily(value);
21686
+ };
21687
+ const handleThemePreviewChange = (value) => {
21688
+ previewThemeFamily(value);
21689
+ };
21690
+ const handleThemeColorModeChange = (value) => {
21691
+ setColorMode(value);
21516
21692
  };
21517
21693
  const composerSnapshot = {
21518
21694
  activeSessionId,
@@ -22158,6 +22334,7 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
22158
22334
  commandPaletteRef,
22159
22335
  currentSessionQueryScope,
22160
22336
  currentTheme,
22337
+ currentThemeColorMode,
22161
22338
  authDialogRef,
22162
22339
  authOpenRef,
22163
22340
  deleteDialogRef,
@@ -22182,6 +22359,9 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
22182
22359
  onSessionDoneSoundEnabledChange: handleSessionDoneSoundEnabledChange,
22183
22360
  onSessionDialogSelect: handleSelectSession,
22184
22361
  onThemeChange: handleThemeChange,
22362
+ onThemeColorModeChange: handleThemeColorModeChange,
22363
+ onThemePreviewChange: handleThemePreviewChange,
22364
+ systemTheme,
22185
22365
  recentDirectoriesStore,
22186
22366
  renameDialogRef,
22187
22367
  renameOpenRef,
@@ -5,7 +5,7 @@ import { n as clsx } from "../_libs/class-variance-authority+clsx.mjs";
5
5
  import { t as twMerge } from "../_libs/tailwind-merge.mjs";
6
6
  import { B as ArrowDown, I as ArrowUp, M as ChevronUp, O as Command, R as ArrowRight, V as ArrowBigUp, m as Option, z as ArrowLeft } from "../_libs/lucide-react.mjs";
7
7
  import { n as string, t as object } from "../_libs/zod.mjs";
8
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-Dmryr4Ep.js
8
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-Qk9CE25v.js
9
9
  var import_react = /* @__PURE__ */ __toESM(require_react());
10
10
  var import_jsx_runtime = require_jsx_runtime();
11
11
  function cn(...inputs) {
@@ -255,6 +255,20 @@ function Spinner({ className, "aria-label": ariaLabel = "Loading", ...props }) {
255
255
  });
256
256
  }
257
257
  var THEME_STORAGE_KEY = "pico-theme";
258
+ var THEME_COLOR_MODE_STORAGE_KEY = "pico-theme-color-mode";
259
+ var APPLIED_THEME_STORAGE_KEY = "pico-applied-theme";
260
+ var THEME_FAMILIES = ["default", "flexoki"];
261
+ var THEME_COLOR_MODES = [
262
+ "auto",
263
+ "light",
264
+ "dark"
265
+ ];
266
+ var APPLIED_THEME_CLASSES = [
267
+ "light",
268
+ "dark",
269
+ "flexoki-light",
270
+ "flexoki-dark"
271
+ ];
258
272
  var DRAFT_DIRECTORY_STORAGE_KEY = "pico-draft-directory";
259
273
  var SIDEBAR_DIRECTORIES_STORAGE_KEY = "pico-sidebar-directories";
260
274
  var COLLAPSED_DIRECTORIES_STORAGE_KEY = "pico-collapsed-directories";
@@ -412,8 +426,39 @@ function readStoredRecentDirectories() {
412
426
  return [];
413
427
  }
414
428
  }
415
- function normalizeThemeMode(value) {
416
- return value === "light" || value === "dark" || value === "system" ? value : "system";
429
+ function normalizeThemeFamily(value) {
430
+ return value === "flexoki" || value === "flexoki-light" || value === "flexoki-dark" ? "flexoki" : "default";
431
+ }
432
+ function normalizeThemeColorMode(value) {
433
+ if (value === "auto" || value === "system") return "auto";
434
+ if (value === "light" || value === "flexoki-light") return "light";
435
+ if (value === "dark" || value === "flexoki-dark") return "dark";
436
+ return "auto";
437
+ }
438
+ function resolvedThemeMode(mode, systemTheme) {
439
+ if (mode === "auto") return systemTheme === "dark" ? "dark" : "light";
440
+ return mode;
441
+ }
442
+ function appliedThemeClass(family, mode, systemTheme) {
443
+ const resolvedMode = resolvedThemeMode(mode, systemTheme);
444
+ if (family === "flexoki") return resolvedMode === "dark" ? "flexoki-dark" : "flexoki-light";
445
+ return resolvedMode;
446
+ }
447
+ function themeFamilyLabel(theme) {
448
+ return theme === "flexoki" ? "Flexoki" : "Default";
449
+ }
450
+ function themeColorModeLabel(mode, systemTheme) {
451
+ if (mode === "auto") {
452
+ if (!systemTheme) return "Auto";
453
+ return `Auto (${resolvedThemeMode(mode, systemTheme) === "light" ? "Light" : "Dark"})`;
454
+ }
455
+ return mode === "light" ? "Light" : "Dark";
456
+ }
457
+ function readStoredTheme() {
458
+ return normalizeThemeFamily((safeLocalStorageGetItem("pico-theme") ?? "default").trim());
459
+ }
460
+ function readStoredThemeColorMode() {
461
+ return normalizeThemeColorMode((safeLocalStorageGetItem("pico-theme-color-mode") ?? safeLocalStorageGetItem("pico-theme") ?? "auto").trim());
417
462
  }
418
463
  function readStoredHideToolBlocks() {
419
464
  return safeLocalStorageGetItem(HIDE_TOOL_BLOCKS_STORAGE_KEY) === "1";
@@ -1279,11 +1324,11 @@ function getSessionTitle(summary) {
1279
1324
  if (summary?.name?.trim()) return summary.name.trim();
1280
1325
  return "New session";
1281
1326
  }
1282
- var $$splitComponentImporter = () => import("./routes-B_4MdyY2.mjs");
1327
+ var $$splitComponentImporter = () => import("./routes-C5zYkwvE.mjs");
1283
1328
  var indexSearchSchema = object({ session: string().optional() });
1284
1329
  var Route = createFileRoute("/")({
1285
1330
  validateSearch: indexSearchSchema,
1286
1331
  component: lazyRouteComponent($$splitComponentImporter, "component")
1287
1332
  });
1288
1333
  //#endregion
1289
- export { readStoredRightSidebarOpen as $, createCompactionSummaryItem as A, normalizeSessionSelectionKeys as B, TooltipContent as C, assistantBlocksFromMessage as D, VIEWER_CONTEXT_STORAGE_KEY as E, extractToolText as F, readStoredAutoScrollEnabled as G, normalizeThemeMode as H, flattenTree as I, readStoredDraftDirectory as J, readStoredCenterMessages as K, getSessionTitle as L, createInitialSessionState as M, extractMessageImages as N, buildItemsFromSync as O, extractMessageText as P, readStoredRecentDirectories as Q, mergeAssistantBlocksForStreaming as R, Tooltip$1 as S, TooltipTrigger as T, previewUrlForImage as U, normalizeStoredDirectoryList as V, promptDraftKey as W, readStoredPinnedSessionKeys as X, readStoredHideToolBlocks as Y, readStoredPromptDraft as Z, SESSION_DONE_SOUND_ENABLED_STORAGE_KEY as _, HIDE_TOOL_BLOCKS_STORAGE_KEY as a, safeLocalStorageSetItem as at, THEME_STORAGE_KEY as b, PINNED_SESSIONS_STORAGE_KEY as c, thinkingSummaryText as ct, RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY as d, readStoredSessionDoneDesktopNotificationsEnabled as et, RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY as f, SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY as g, Route as h, DRAFT_DIRECTORY_STORAGE_KEY as i, safeLocalStorageGetItem as it, createContextId as j, cn as k, RECENT_DIRECTORIES_STORAGE_KEY as l, toolCategoryFromTool as lt, RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY as m, CENTER_MESSAGES_STORAGE_KEY as n, readStoredSidebarDirectories as nt, Kbd as o, sameContextUsage as ot, RIGHT_SIDEBAR_OPEN_STORAGE_KEY as p, readStoredCollapsedDirectories as q, COLLAPSED_DIRECTORIES_STORAGE_KEY as r, rememberStoredPromptDraft as rt, KeyboardShortcutContent as s, sessionListEntryKey as st, AUTO_SCROLL_ENABLED_STORAGE_KEY as t, readStoredSessionDoneSoundEnabled as tt, RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY as u, SIDEBAR_DIRECTORIES_STORAGE_KEY as v, TooltipProvider as w, TitleTooltip as x, Spinner as y, normalizePromptImage as z };
1334
+ export { readStoredCenterMessages as $, TooltipTrigger as A, extractMessageText as B, THEME_COLOR_MODE_STORAGE_KEY as C, Tooltip$1 as D, TitleTooltip as E, cn as F, normalizePromptImage as G, flattenTree as H, createCompactionSummaryItem as I, normalizeThemeColorMode as J, normalizeSessionSelectionKeys as K, createContextId as L, appliedThemeClass as M, assistantBlocksFromMessage as N, TooltipContent as O, buildItemsFromSync as P, readStoredAutoScrollEnabled as Q, createInitialSessionState as R, THEME_COLOR_MODES as S, THEME_STORAGE_KEY as T, getSessionTitle as U, extractToolText as V, mergeAssistantBlocksForStreaming as W, previewUrlForImage as X, normalizeThemeFamily as Y, promptDraftKey as Z, Route as _, themeColorModeLabel as _t, COLLAPSED_DIRECTORIES_STORAGE_KEY as a, readStoredRecentDirectories as at, SIDEBAR_DIRECTORIES_STORAGE_KEY as b, toolCategoryFromTool as bt, Kbd as c, readStoredSessionDoneSoundEnabled as ct, RECENT_DIRECTORIES_STORAGE_KEY as d, readStoredThemeColorMode as dt, readStoredCollapsedDirectories as et, RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY as f, rememberStoredPromptDraft as ft, RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY as g, sessionListEntryKey as gt, RIGHT_SIDEBAR_OPEN_STORAGE_KEY as h, sameContextUsage as ht, CENTER_MESSAGES_STORAGE_KEY as i, readStoredPromptDraft as it, VIEWER_CONTEXT_STORAGE_KEY as j, TooltipProvider as k, KeyboardShortcutContent as l, readStoredSidebarDirectories as lt, RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY as m, safeLocalStorageSetItem as mt, APPLIED_THEME_STORAGE_KEY as n, readStoredHideToolBlocks as nt, DRAFT_DIRECTORY_STORAGE_KEY as o, readStoredRightSidebarOpen as ot, RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY as p, safeLocalStorageGetItem as pt, normalizeStoredDirectoryList as q, AUTO_SCROLL_ENABLED_STORAGE_KEY as r, readStoredPinnedSessionKeys as rt, HIDE_TOOL_BLOCKS_STORAGE_KEY as s, readStoredSessionDoneDesktopNotificationsEnabled as st, APPLIED_THEME_CLASSES as t, readStoredDraftDirectory as tt, PINNED_SESSIONS_STORAGE_KEY as u, readStoredTheme as ut, SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY as v, themeFamilyLabel as vt, THEME_FAMILIES as w, Spinner as x, SESSION_DONE_SOUND_ENABLED_STORAGE_KEY as y, thinkingSummaryText as yt, extractMessageImages as z };
@@ -3813,7 +3813,7 @@ var defaultSerovalPlugins = [
3813
3813
  * the dev styles URL for route-scoped CSS collection.
3814
3814
  */
3815
3815
  async function getStartManifest(matchedRoutes) {
3816
- const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-D9Bp2MHo.mjs");
3816
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-Bp-gg9fI.mjs");
3817
3817
  const startManifest = tsrStartManifest();
3818
3818
  const rootRoute = startManifest.routes[rootRouteId] = startManifest.routes["__root__"] || {};
3819
3819
  rootRoute.assets = rootRoute.assets || [];
@@ -4799,7 +4799,7 @@ var baseManifestPromise;
4799
4799
  var cachedFinalManifestPromise;
4800
4800
  async function loadEntries() {
4801
4801
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
4802
- import("./router-BKbJyS60.mjs"),
4802
+ import("./router-Bw2oDzya.mjs"),
4803
4803
  import("./start-Captdpmb.mjs"),
4804
4804
  import("../__23tanstack-start-plugin-adapters-y_fshQDY.mjs")
4805
4805
  ]);
@@ -1,4 +1,4 @@
1
- //#region node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-D9Bp2MHo.js
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-Bp-gg9fI.js
2
2
  var tsrStartManifest = () => ({
3
3
  routes: {
4
4
  __root__: {
@@ -50,16 +50,16 @@ var tsrStartManifest = () => ({
50
50
  "/api/ui/$id"
51
51
  ],
52
52
  assets: void 0,
53
- preloads: ["/assets/index-Bwe_XQfD.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
53
+ preloads: ["/assets/index-BHnoJmIv.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
54
54
  },
55
55
  "/": {
56
56
  filePath: "/home/runner/work/pico/pico/src/routes/index.tsx",
57
57
  children: void 0,
58
58
  assets: void 0,
59
- preloads: ["/assets/routes-BN7pNQ_y.js"]
59
+ preloads: ["/assets/routes-BfJLj6KG.js"]
60
60
  }
61
61
  },
62
- clientEntry: "/assets/index-Bwe_XQfD.js"
62
+ clientEntry: "/assets/index-BHnoJmIv.js"
63
63
  });
64
64
  //#endregion
65
65
  export { tsrStartManifest };