@lemonriver/core 0.2.0 → 0.3.0
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/{build-Df_xwIpg.js → build-Bqo69DWP.js} +1 -1
- package/dist/cli/bin.js +4 -4
- package/dist/{config-BjWCLoMQ.js → config-DJ5rkMMg.js} +1594 -974
- package/dist/{config-rMGCkz6i.d.ts → config-teo3kWz7.d.ts} +1 -1
- package/dist/{dev-Ctsx9IeO.js → dev-B2FJD5bJ.js} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/{preview-CJgcqsPk.js → preview-C93BOZL1.js} +1 -1
- package/dist/{types-8VUyA2bu.d.ts → types-DFK02XVv.d.ts} +0 -35
- package/dist/{update-BKOA3Z6o.js → update-DsxZBtwv.js} +2 -70
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/{zh-tw-CeLrYwRE.js → zh-tw-DwTAZKa6.js} +6 -172
- package/package.json +1 -1
- package/src/app/app.tsx +5 -18
- package/src/app/components/agent/agent-panel.tsx +3 -0
- package/src/app/components/agent/agent-presence.tsx +2 -2
- package/src/app/components/agent/history-view.tsx +3 -2
- package/src/app/components/agent/transcript.tsx +15 -4
- package/src/app/components/asset-view.tsx +6 -6
- package/src/app/components/command/command-menu.tsx +2 -1
- package/src/app/components/inspector/asset-picker-dialog.tsx +7 -5
- package/src/app/components/inspector/comment-layer.tsx +2 -1
- package/src/app/components/inspector/inspector-panel.tsx +2 -2
- package/src/app/components/sidebar/sidebar-footer.tsx +1 -1
- package/src/app/components/sidebar/sidebar.tsx +3 -2
- package/src/app/components/themes/theme-detail.tsx +4 -2
- package/src/app/components/thumbnail-rail.tsx +1 -28
- package/src/app/index.html +2 -2
- package/src/app/lemonriver/agent/lemon.tsx +64 -0
- package/src/app/{components → lemonriver}/board/board-canvas.tsx +17 -17
- package/src/app/{routes/board.tsx → lemonriver/board/board-page.tsx} +16 -15
- package/src/app/{components → lemonriver}/board/layout.ts +1 -1
- package/src/app/lemonriver/board/model/cards.test.ts +239 -0
- package/src/app/lemonriver/board/model/cards.ts +234 -0
- package/src/app/lemonriver/board/model/structure.test.ts +101 -0
- package/src/app/lemonriver/board/model/structure.ts +82 -0
- package/src/app/{components → lemonriver}/board/page-node.tsx +34 -31
- package/src/app/{components → lemonriver}/board/use-board-cards.ts +6 -6
- package/src/app/{components → lemonriver}/board/use-board-columns.ts +7 -7
- package/src/app/{components → lemonriver}/board/use-page-order.ts +10 -6
- package/src/app/lemonriver/brand/app-icon.svg +44 -0
- package/src/app/lemonriver/brand/apple-touch-icon.png +0 -0
- package/src/app/lemonriver/brand/favicon-32.png +0 -0
- package/src/app/lemonriver/brand/mascot.tsx +59 -0
- package/src/app/lemonriver/brand/mascots/lemon-done.png +0 -0
- package/src/app/lemonriver/brand/mascots/lemon-idle.png +0 -0
- package/src/app/lemonriver/brand/mascots/lemon-needs-you.png +0 -0
- package/src/app/lemonriver/brand/mascots/lemon-thinking.png +0 -0
- package/src/app/lemonriver/brand/mascots/lemon-working.png +0 -0
- package/src/app/lemonriver/chrome/app-chrome.tsx +99 -0
- package/src/app/lemonriver/chrome/nav-row.tsx +34 -0
- package/src/app/lemonriver/chrome/not-found.tsx +34 -0
- package/src/app/lemonriver/chrome/sidebar-extras.tsx +57 -0
- package/src/app/lemonriver/chrome/use-slot.ts +23 -0
- package/src/app/lemonriver/features.test.ts +29 -0
- package/src/app/lemonriver/features.ts +26 -0
- package/src/app/lemonriver/feedback/export.ts +7 -0
- package/src/app/lemonriver/feedback/lemon-empty.tsx +54 -0
- package/src/app/lemonriver/feedback/offline-banner.tsx +41 -0
- package/src/app/lemonriver/feedback/pending-toast.test.ts +44 -0
- package/src/app/lemonriver/feedback/pending-toast.ts +39 -0
- package/src/app/lemonriver/feedback/toaster.tsx +34 -0
- package/src/app/lemonriver/feedback/upload.test.ts +26 -0
- package/src/app/lemonriver/feedback/upload.ts +19 -0
- package/src/app/lemonriver/home/brief-card.tsx +63 -0
- package/src/app/lemonriver/home/brief.test.ts +38 -0
- package/src/app/lemonriver/home/brief.ts +34 -0
- package/src/app/lemonriver/home/controls.tsx +93 -0
- package/src/app/lemonriver/home/deck-card.tsx +183 -0
- package/src/app/lemonriver/home/dialogs.tsx +292 -0
- package/src/app/lemonriver/home/home-page.tsx +335 -0
- package/src/app/lemonriver/home/sorting.test.ts +24 -0
- package/src/app/lemonriver/home/sorting.ts +59 -0
- package/src/app/lemonriver/home/time.test.ts +33 -0
- package/src/app/lemonriver/home/time.ts +33 -0
- package/src/app/lemonriver/home/use-deck-times.ts +27 -0
- package/src/app/lemonriver/home/use-delayed.ts +15 -0
- package/src/app/lemonriver/routes.test.tsx +37 -0
- package/src/app/lemonriver/routes.tsx +38 -0
- package/src/app/lemonriver/settings/settings-page.tsx +103 -0
- package/src/app/lemonriver/slide-extensions.tsx +73 -0
- package/src/app/lemonriver/text/all.ts +19 -0
- package/src/app/lemonriver/text/en.ts +106 -0
- package/src/app/lemonriver/text/es.ts +108 -0
- package/src/app/lemonriver/text/index.ts +9 -0
- package/src/app/lemonriver/text/ja.ts +106 -0
- package/src/app/lemonriver/text/text.test.ts +57 -0
- package/src/app/lemonriver/text/types.ts +111 -0
- package/src/app/lemonriver/text/zh-cn.ts +101 -0
- package/src/app/lemonriver/text/zh-tw.ts +101 -0
- package/src/app/lemonriver/theme/app.css +288 -0
- package/src/app/lemonriver/theme/controls.css +463 -0
- package/src/app/lemonriver/theme/index.css +3 -0
- package/src/app/lemonriver/theme/motion.ts +52 -0
- package/src/app/lemonriver/theme/pages.test.ts +66 -0
- package/src/app/lemonriver/theme/pages.ts +56 -0
- package/src/app/lemonriver/theme/theme-menu.tsx +64 -0
- package/src/app/lemonriver/theme/themes.test.ts +18 -0
- package/src/app/lemonriver/theme/themes.ts +16 -0
- package/src/app/lemonriver/theme/tokens.css +226 -0
- package/src/app/lemonriver/theme/use-theme.tsx +49 -0
- package/src/app/lemonriver/trash/api.test.ts +19 -0
- package/src/app/lemonriver/trash/api.ts +77 -0
- package/src/app/lemonriver/trash/trash-page.tsx +131 -0
- package/src/app/lib/pptx/raster.ts +1 -1
- package/src/app/main.tsx +8 -1
- package/src/app/routes/home-shell.tsx +4 -2
- package/src/app/routes/slide.tsx +12 -16
- package/src/app/styles.css +1 -0
- package/src/locale/en.ts +0 -35
- package/src/locale/es.ts +0 -34
- package/src/locale/ja.ts +0 -34
- package/src/locale/types.ts +0 -36
- package/src/locale/zh-cn.ts +3 -37
- package/src/locale/zh-tw.ts +3 -37
- /package/src/app/{components → lemonriver}/board/board.css +0 -0
- /package/src/app/{components → lemonriver}/board/layout.test.ts +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Check, Languages, Loader2, Monitor, Moon, RotateCw, Search, Sun } from 'lucide-react';
|
|
2
|
-
import { useTheme } from 'next-themes';
|
|
3
2
|
import { type ReactNode, useEffect, useMemo, useState } from 'react';
|
|
4
3
|
import { IconTooltip } from '@/components/icon-tooltip';
|
|
5
4
|
import { buttonVariants } from '@/components/ui/button';
|
|
@@ -8,6 +7,7 @@ import { IS_APPLE } from '@/lib/keys';
|
|
|
8
7
|
import { LOCALE_OPTIONS, setLocale } from '@/lib/locale-store';
|
|
9
8
|
import { format, useLocale } from '@/lib/use-locale';
|
|
10
9
|
import { useRestartServer } from '@/lib/use-restart-server';
|
|
10
|
+
import { lemonRiverAppearanceCommands, useTheme } from '../../lemonriver/theme/use-theme';
|
|
11
11
|
import {
|
|
12
12
|
Command,
|
|
13
13
|
CommandDialog,
|
|
@@ -193,6 +193,7 @@ function useSharedCommandGroups(): CommandGroupSpec[] {
|
|
|
193
193
|
active: theme === 'system',
|
|
194
194
|
run: () => setTheme('system'),
|
|
195
195
|
},
|
|
196
|
+
...lemonRiverAppearanceCommands(t, theme, setTheme),
|
|
196
197
|
...LOCALE_OPTIONS.map((option) => ({
|
|
197
198
|
id: `locale-${option.id}`,
|
|
198
199
|
label: format(t.commandMenu.languageItem, { name: option.label }),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ArrowDownToLine, Loader2, Upload } from 'lucide-react';
|
|
2
2
|
import { useCallback, useId, useRef, useState } from 'react';
|
|
3
|
-
import { toast } from 'sonner';
|
|
4
3
|
import {
|
|
5
4
|
Dialog,
|
|
6
5
|
DialogContent,
|
|
@@ -11,8 +10,10 @@ import {
|
|
|
11
10
|
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|
12
11
|
import { type AssetEntry, GLOBAL_ASSET_SCOPE, uploadWithAutoRename, useAssets } from '@/lib/assets';
|
|
13
12
|
import { dragHasFiles } from '@/lib/dom';
|
|
14
|
-
import {
|
|
13
|
+
import { useLocale } from '@/lib/use-locale';
|
|
15
14
|
import { cn } from '@/lib/utils';
|
|
15
|
+
import { EmptyLemon } from '../../lemonriver/agent/lemon';
|
|
16
|
+
import { toastUploadFailed } from '../../lemonriver/feedback/upload';
|
|
16
17
|
|
|
17
18
|
export type PickerScope = 'slide' | 'global';
|
|
18
19
|
|
|
@@ -44,7 +45,7 @@ export function AssetPickerDialog({
|
|
|
44
45
|
try {
|
|
45
46
|
const { ok, status, entry } = await uploadWithAutoRename(effectiveSlideId, file);
|
|
46
47
|
if (!ok || !entry) {
|
|
47
|
-
|
|
48
|
+
toastUploadFailed(t, status);
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
await refresh().catch(() => {});
|
|
@@ -132,9 +133,10 @@ export function AssetPickerDialog({
|
|
|
132
133
|
{t.inspector.pickerLoading}
|
|
133
134
|
</p>
|
|
134
135
|
) : images.length === 0 ? (
|
|
135
|
-
<
|
|
136
|
+
<div className="flex flex-col items-center gap-2 px-1 py-6 text-center text-xs text-muted-foreground">
|
|
137
|
+
<EmptyLemon />
|
|
136
138
|
{t.inspector.pickerEmpty}
|
|
137
|
-
</
|
|
139
|
+
</div>
|
|
138
140
|
) : (
|
|
139
141
|
<div className="grid grid-cols-[repeat(auto-fill,minmax(120px,1fr))] gap-3">
|
|
140
142
|
{images.map((asset) => (
|
|
@@ -26,6 +26,7 @@ import { IS_APPLE, isTypingTarget } from '@/lib/keys';
|
|
|
26
26
|
import { format, plural, useLocale } from '@/lib/use-locale';
|
|
27
27
|
import { cn } from '@/lib/utils';
|
|
28
28
|
import { applyCommentsPrompt } from '../../../agent/prompt';
|
|
29
|
+
import { HintLemon } from '../../lemonriver/agent/lemon';
|
|
29
30
|
import { type SelectedTarget, useInspector } from './inspector-provider';
|
|
30
31
|
|
|
31
32
|
type ScreenRect = { left: number; top: number; width: number; height: number };
|
|
@@ -497,7 +498,7 @@ export function CommentLayer() {
|
|
|
497
498
|
{error ? (
|
|
498
499
|
error
|
|
499
500
|
) : count === 0 ? (
|
|
500
|
-
t.inspector.commentEmptyHint
|
|
501
|
+
<HintLemon>{t.inspector.commentEmptyHint}</HintLemon>
|
|
501
502
|
) : agent.connected ? (
|
|
502
503
|
<>
|
|
503
504
|
<CommentCountLabel count={count} />
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
Crop,
|
|
9
9
|
ImageIcon,
|
|
10
10
|
Italic,
|
|
11
|
-
MousePointer2,
|
|
12
11
|
Move,
|
|
13
12
|
MoveHorizontal,
|
|
14
13
|
Paintbrush,
|
|
@@ -48,6 +47,7 @@ import { useAgentSocketConnected } from '@/lib/use-agent-socket';
|
|
|
48
47
|
import { format, useLocale } from '@/lib/use-locale';
|
|
49
48
|
import { round2 } from '@/lib/utils';
|
|
50
49
|
import type { Locale } from '../../../locale/types';
|
|
50
|
+
import { EmptyLemon } from '../../lemonriver/agent/lemon';
|
|
51
51
|
import { ArrangePanel } from './arrange-panel';
|
|
52
52
|
import { AssetPickerDialog } from './asset-picker-dialog';
|
|
53
53
|
import { type SelectedTarget, useInspector } from './inspector-provider';
|
|
@@ -428,7 +428,7 @@ export function InspectorPanel({
|
|
|
428
428
|
</>
|
|
429
429
|
) : (
|
|
430
430
|
<div className="flex flex-col items-center gap-3 px-7 py-16 text-center">
|
|
431
|
-
<
|
|
431
|
+
<EmptyLemon />
|
|
432
432
|
<div className="flex flex-col gap-1.5">
|
|
433
433
|
<h2 className="text-[13px] font-medium">{t.inspector.emptySelectionTitle}</h2>
|
|
434
434
|
<p className="text-[12px] leading-relaxed text-muted-foreground">
|
|
@@ -3,11 +3,11 @@ import { Loader2, RefreshCw, RotateCw } from 'lucide-react';
|
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { toast } from 'sonner';
|
|
5
5
|
import { LanguageToggle } from '@/components/language-toggle';
|
|
6
|
-
import { ThemeToggle } from '@/components/theme-toggle';
|
|
7
6
|
import { Button } from '@/components/ui/button';
|
|
8
7
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
9
8
|
import { format, useLocale } from '@/lib/use-locale';
|
|
10
9
|
import { useRestartServer } from '@/lib/use-restart-server';
|
|
10
|
+
import { ThemeToggle } from '../../lemonriver/theme/theme-menu';
|
|
11
11
|
|
|
12
12
|
type UpdateCheck = { current: string; latest: string | null; outdated: boolean };
|
|
13
13
|
type UpdateStatus = 'idle' | 'running' | 'done' | 'error';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Plus, Search } from 'lucide-react';
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { toast } from 'sonner';
|
|
4
|
-
import logo from '@/assets/open-slide.svg';
|
|
5
4
|
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
|
6
5
|
import type { Folder, FolderIcon } from '@/lib/sdk';
|
|
7
6
|
import { format, useLocale } from '@/lib/use-locale';
|
|
8
7
|
import { cn } from '@/lib/utils';
|
|
8
|
+
import logo from '../../lemonriver/brand/app-icon.svg';
|
|
9
9
|
import { COMMAND_MENU_SHORTCUT } from '../command/command-menu';
|
|
10
10
|
import { FolderIconChip, FolderItem } from './folder-item';
|
|
11
11
|
import { IconPicker, PRESET_COLORS } from './icon-picker';
|
|
@@ -142,7 +142,7 @@ export function Sidebar({
|
|
|
142
142
|
</h1>
|
|
143
143
|
</div>
|
|
144
144
|
|
|
145
|
-
<div className="px-2 pb-3">
|
|
145
|
+
<div className="px-2 pb-3" data-lr-sidebar-top>
|
|
146
146
|
<button
|
|
147
147
|
type="button"
|
|
148
148
|
onClick={onOpenCommandMenu}
|
|
@@ -187,6 +187,7 @@ export function Sidebar({
|
|
|
187
187
|
onDropSlide={() => {}}
|
|
188
188
|
/>
|
|
189
189
|
)}
|
|
190
|
+
<div data-lr-sidebar-nav className="contents" />
|
|
190
191
|
</div>
|
|
191
192
|
|
|
192
193
|
<div className="mt-5 flex h-6 items-center justify-between pr-2.5 pl-4 pb-0.5">
|
|
@@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
|
|
|
4
4
|
import { Button } from '@/components/ui/button';
|
|
5
5
|
import { format, useLocale } from '@/lib/use-locale';
|
|
6
6
|
import { cn, pad2 } from '@/lib/utils';
|
|
7
|
+
import { EmptyLemon } from '../../lemonriver/agent/lemon';
|
|
7
8
|
import { SlidePageProvider } from '../../lib/page-context';
|
|
8
9
|
import type { SlideModule } from '../../lib/sdk';
|
|
9
10
|
import { loadSlide, slidesByTheme } from '../../lib/slides';
|
|
@@ -187,9 +188,10 @@ export function ThemeDetail({ themeId, onBack }: { themeId: string; onBack: () =
|
|
|
187
188
|
) : null}
|
|
188
189
|
</div>
|
|
189
190
|
{usedBySlideIds.length === 0 ? (
|
|
190
|
-
<
|
|
191
|
+
<div className="flex flex-col items-start gap-2 text-[12.5px] leading-relaxed text-muted-foreground">
|
|
192
|
+
<EmptyLemon />
|
|
191
193
|
{t.themes.usedByEmpty}
|
|
192
|
-
</
|
|
194
|
+
</div>
|
|
193
195
|
) : (
|
|
194
196
|
<ul className="flex flex-col gap-5">
|
|
195
197
|
{usedBySlideIds.map((id) => (
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
type LucideIcon,
|
|
25
25
|
Sparkles,
|
|
26
26
|
Trash2,
|
|
27
|
-
Workflow,
|
|
28
27
|
} from 'lucide-react';
|
|
29
28
|
import { Fragment, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
30
29
|
import { useOptionalInspector } from '@/components/inspector/inspector-provider';
|
|
@@ -74,8 +73,6 @@ type Props = {
|
|
|
74
73
|
moduleTransition?: SlideTransition;
|
|
75
74
|
/** When provided, the vertical rail header renders a button that opens the overview grid. */
|
|
76
75
|
onOverview?: () => void;
|
|
77
|
-
/** When provided, the vertical rail header renders a button that opens the story board. */
|
|
78
|
-
onBoard?: () => void;
|
|
79
76
|
};
|
|
80
77
|
|
|
81
78
|
// Per-page pending comment counts, shown on the rail only while the
|
|
@@ -132,7 +129,6 @@ export function ThumbnailRail({
|
|
|
132
129
|
width,
|
|
133
130
|
moduleTransition,
|
|
134
131
|
onOverview,
|
|
135
|
-
onBoard,
|
|
136
132
|
}: Props) {
|
|
137
133
|
const activeRef = useRef<HTMLButtonElement | null>(null);
|
|
138
134
|
const virtualListRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -335,7 +331,7 @@ export function ThumbnailRail({
|
|
|
335
331
|
<div className="-mx-3 sticky top-0 z-10 bg-sidebar px-4 pt-3 pb-1">
|
|
336
332
|
<div className="flex items-center justify-between gap-2">
|
|
337
333
|
<span className="eyebrow">{t.thumbnailRail.pages}</span>
|
|
338
|
-
<div className="flex items-center gap-1.5">
|
|
334
|
+
<div className="flex items-center gap-1.5" data-lr-rail-actions="">
|
|
339
335
|
<span className="folio">{pad2(pages.length)}</span>
|
|
340
336
|
{onOverview && (
|
|
341
337
|
<Tooltip>
|
|
@@ -360,29 +356,6 @@ export function ThumbnailRail({
|
|
|
360
356
|
</TooltipContent>
|
|
361
357
|
</Tooltip>
|
|
362
358
|
)}
|
|
363
|
-
{onBoard && (
|
|
364
|
-
<Tooltip>
|
|
365
|
-
<TooltipTrigger
|
|
366
|
-
render={
|
|
367
|
-
<button
|
|
368
|
-
type="button"
|
|
369
|
-
onClick={onBoard}
|
|
370
|
-
aria-label={t.board.openBoard}
|
|
371
|
-
className={cn(
|
|
372
|
-
'flex size-5 items-center justify-center rounded-[3px] text-muted-foreground/70 outline-none',
|
|
373
|
-
'motion-safe:transition-colors hover:bg-muted hover:text-foreground',
|
|
374
|
-
'focus-visible:ring-1 focus-visible:ring-brand',
|
|
375
|
-
)}
|
|
376
|
-
>
|
|
377
|
-
<Workflow className="size-3.5" strokeWidth={1.75} />
|
|
378
|
-
</button>
|
|
379
|
-
}
|
|
380
|
-
/>
|
|
381
|
-
<TooltipContent side="bottom" sideOffset={6}>
|
|
382
|
-
{t.board.openBoard}
|
|
383
|
-
</TooltipContent>
|
|
384
|
-
</Tooltip>
|
|
385
|
-
)}
|
|
386
359
|
</div>
|
|
387
360
|
</div>
|
|
388
361
|
</div>
|
package/src/app/index.html
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="./favicon.
|
|
6
|
-
<link rel="icon" href="./
|
|
5
|
+
<link rel="icon" href="./lemonriver/brand/favicon-32.png" sizes="32x32" type="image/png" />
|
|
6
|
+
<link rel="icon" href="./lemonriver/brand/app-icon.svg" type="image/svg+xml" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>LemonRiver</title>
|
|
9
9
|
<style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AgentActivity } from '@/lib/agent/use-agent';
|
|
3
|
+
import { Mascot, type MascotState } from '../brand/mascot';
|
|
4
|
+
import { useLrText } from '../text';
|
|
5
|
+
|
|
6
|
+
const PHASE_STATE: Record<AgentActivity['phase'], MascotState> = {
|
|
7
|
+
thinking: 'thinking',
|
|
8
|
+
tool: 'working',
|
|
9
|
+
waiting: 'needs-you',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Lemon in the presence pill above the canvas: thinking, working, or waiting for you. */
|
|
13
|
+
export function PresenceLemon({ phase }: { phase: AgentActivity['phase'] }) {
|
|
14
|
+
return <Mascot state={PHASE_STATE[phase]} size={20} className="-my-1 -ml-1" />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Lemon at the top of an idle agent panel. */
|
|
18
|
+
export function PanelLemon() {
|
|
19
|
+
return <Mascot state="idle" size={56} float className="mb-2" />;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function WorkingLemon() {
|
|
23
|
+
return <Mascot state="working" size={20} className="-my-1 mr-1 inline-block align-middle" />;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function ErrorLemon() {
|
|
27
|
+
return <Mascot state="needs-you" size={20} className="-my-1 mr-0.5 inline-block align-middle" />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function ResultLemon({ aborted }: { aborted: boolean }) {
|
|
31
|
+
return (
|
|
32
|
+
<Mascot
|
|
33
|
+
state={aborted ? 'idle' : 'done'}
|
|
34
|
+
size={18}
|
|
35
|
+
className="-my-1 mr-1 inline-block align-middle"
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The header of a question the agent asks: the design package's confirmation card. */
|
|
41
|
+
export function ConfirmWho() {
|
|
42
|
+
const lr = useLrText();
|
|
43
|
+
return (
|
|
44
|
+
<div className="mb-2 flex items-center gap-2 px-1.5 text-[12.5px] font-semibold">
|
|
45
|
+
<Mascot state="needs-you" size={36} />
|
|
46
|
+
{lr.feedback.confirmWho}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Lemon beside an empty state in the editor's compact panels. */
|
|
52
|
+
export function EmptyLemon({ size = 56 }: { size?: number }) {
|
|
53
|
+
return <Mascot state="idle" size={size} float />;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The comment-mode hint pill, with Lemon in front. */
|
|
57
|
+
export function HintLemon({ children }: { children: ReactNode }) {
|
|
58
|
+
return (
|
|
59
|
+
<span className="inline-flex items-center gap-1.5">
|
|
60
|
+
<Mascot state="idle" size={16} className="-my-1" />
|
|
61
|
+
{children}
|
|
62
|
+
</span>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -25,12 +25,10 @@ import {
|
|
|
25
25
|
import { Link2, Link2Off, Maximize2, Minus, Plus, X } from 'lucide-react';
|
|
26
26
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
27
27
|
import { Button } from '@/components/ui/button';
|
|
28
|
-
import { useLocale } from '@/lib/use-locale';
|
|
29
28
|
import { cn, pad2 } from '@/lib/utils';
|
|
30
|
-
import type { BoardCard, CardPatch } from '../../../files/board-cards';
|
|
31
|
-
import { type BoardColumn, columnsAfterMove } from '../../../files/board-structure';
|
|
32
29
|
import type { DesignSystem } from '../../lib/design';
|
|
33
30
|
import type { Page } from '../../lib/sdk';
|
|
31
|
+
import { useLrText } from '../text';
|
|
34
32
|
import {
|
|
35
33
|
type BoardLayout,
|
|
36
34
|
type Box,
|
|
@@ -43,6 +41,8 @@ import {
|
|
|
43
41
|
orderAfterMove,
|
|
44
42
|
slotAtPoint,
|
|
45
43
|
} from './layout';
|
|
44
|
+
import type { BoardCard, CardPatch } from './model/cards';
|
|
45
|
+
import { type BoardColumn, columnsAfterMove } from './model/structure';
|
|
46
46
|
import { PageNode, type PageNodeData } from './page-node';
|
|
47
47
|
import '@xyflow/react/dist/base.css';
|
|
48
48
|
import './board.css';
|
|
@@ -81,7 +81,7 @@ type ColumnLabelData = {
|
|
|
81
81
|
|
|
82
82
|
function ColumnLabel({ data }: NodeProps) {
|
|
83
83
|
const { title, count, index, onRename, onAddPage } = data as unknown as ColumnLabelData;
|
|
84
|
-
const
|
|
84
|
+
const lr = useLrText();
|
|
85
85
|
const [editing, setEditing] = useState(false);
|
|
86
86
|
|
|
87
87
|
return (
|
|
@@ -94,8 +94,8 @@ function ColumnLabel({ data }: NodeProps) {
|
|
|
94
94
|
// biome-ignore lint/a11y/noAutofocus: the field only exists once the title is clicked
|
|
95
95
|
autoFocus
|
|
96
96
|
defaultValue={title}
|
|
97
|
-
aria-label={
|
|
98
|
-
placeholder={
|
|
97
|
+
aria-label={lr.board.renameColumn}
|
|
98
|
+
placeholder={lr.board.columnTitlePlaceholder}
|
|
99
99
|
onKeyDown={(e) => {
|
|
100
100
|
e.stopPropagation();
|
|
101
101
|
if (e.key === 'Enter') e.currentTarget.blur();
|
|
@@ -115,7 +115,7 @@ function ColumnLabel({ data }: NodeProps) {
|
|
|
115
115
|
<button
|
|
116
116
|
type="button"
|
|
117
117
|
onClick={() => setEditing(true)}
|
|
118
|
-
aria-label={
|
|
118
|
+
aria-label={lr.board.renameColumn}
|
|
119
119
|
className="eyebrow min-w-0 truncate rounded-[4px] px-1.5 py-1 text-left motion-safe:transition-colors hover:bg-muted/60"
|
|
120
120
|
>
|
|
121
121
|
{title}
|
|
@@ -125,7 +125,7 @@ function ColumnLabel({ data }: NodeProps) {
|
|
|
125
125
|
<button
|
|
126
126
|
type="button"
|
|
127
127
|
onClick={() => onAddPage(index)}
|
|
128
|
-
aria-label={
|
|
128
|
+
aria-label={lr.board.addPage}
|
|
129
129
|
className={cn(
|
|
130
130
|
'ml-auto flex size-6 items-center justify-center rounded-[4px] text-muted-foreground/60',
|
|
131
131
|
'motion-safe:transition-colors hover:bg-muted hover:text-foreground',
|
|
@@ -167,7 +167,7 @@ function boxOf(node: InternalNode | undefined): Box | null {
|
|
|
167
167
|
* never be read as the deck's order, and it follows the cards as they move.
|
|
168
168
|
*/
|
|
169
169
|
function LinkEdge({ id, source, target, data }: EdgeProps) {
|
|
170
|
-
const
|
|
170
|
+
const lr = useLrText();
|
|
171
171
|
const { a, b, onUnlink } = data as unknown as LinkEdgeData;
|
|
172
172
|
const from = boxOf(useInternalNode(source));
|
|
173
173
|
const to = boxOf(useInternalNode(target));
|
|
@@ -180,8 +180,8 @@ function LinkEdge({ id, source, target, data }: EdgeProps) {
|
|
|
180
180
|
<EdgeLabelRenderer>
|
|
181
181
|
<button
|
|
182
182
|
type="button"
|
|
183
|
-
aria-label={
|
|
184
|
-
title={
|
|
183
|
+
aria-label={lr.board.removeLink}
|
|
184
|
+
title={lr.board.removeLink}
|
|
185
185
|
onClick={() => onUnlink(a, b)}
|
|
186
186
|
className="osd-board-link-remove nodrag nopan"
|
|
187
187
|
style={{ transform: `translate(-50%, -50%) translate(${curve.x}px, ${curve.y}px)` }}
|
|
@@ -323,7 +323,7 @@ function BoardFlow({
|
|
|
323
323
|
onUnlink,
|
|
324
324
|
onToggleLinks,
|
|
325
325
|
}: Props) {
|
|
326
|
-
const
|
|
326
|
+
const lr = useLrText();
|
|
327
327
|
const { fitView, zoomIn, zoomOut, screenToFlowPosition } = useReactFlow();
|
|
328
328
|
|
|
329
329
|
const layout = useMemo(() => layoutBoard(columns), [columns]);
|
|
@@ -530,7 +530,7 @@ function BoardFlow({
|
|
|
530
530
|
<Button
|
|
531
531
|
variant="outline"
|
|
532
532
|
size="icon-sm"
|
|
533
|
-
aria-label={
|
|
533
|
+
aria-label={lr.board.zoomOut}
|
|
534
534
|
onClick={() => zoomOut()}
|
|
535
535
|
>
|
|
536
536
|
<Minus />
|
|
@@ -538,20 +538,20 @@ function BoardFlow({
|
|
|
538
538
|
<Button
|
|
539
539
|
variant="outline"
|
|
540
540
|
size="icon-sm"
|
|
541
|
-
aria-label={
|
|
541
|
+
aria-label={lr.board.zoomIn}
|
|
542
542
|
onClick={() => zoomIn()}
|
|
543
543
|
>
|
|
544
544
|
<Plus />
|
|
545
545
|
</Button>
|
|
546
|
-
<Button variant="outline" size="icon-sm" aria-label={
|
|
546
|
+
<Button variant="outline" size="icon-sm" aria-label={lr.board.fitView} onClick={fitAll}>
|
|
547
547
|
<Maximize2 />
|
|
548
548
|
</Button>
|
|
549
549
|
<Button
|
|
550
550
|
variant="outline"
|
|
551
551
|
size="icon-sm"
|
|
552
|
-
aria-label={showLinks ?
|
|
552
|
+
aria-label={showLinks ? lr.board.hideLinks : lr.board.showLinks}
|
|
553
553
|
aria-pressed={showLinks}
|
|
554
|
-
title={showLinks ?
|
|
554
|
+
title={showLinks ? lr.board.hideLinks : lr.board.showLinks}
|
|
555
555
|
onClick={onToggleLinks}
|
|
556
556
|
>
|
|
557
557
|
{showLinks ? <Link2 /> : <Link2Off />}
|
|
@@ -3,16 +3,17 @@ import { lazy, Suspense, useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { useNavigate, useParams } from 'react-router-dom';
|
|
4
4
|
import { Button } from '@/components/ui/button';
|
|
5
5
|
import { useDocumentTitle } from '@/lib/use-document-title';
|
|
6
|
-
import { format
|
|
6
|
+
import { format } from '@/lib/use-locale';
|
|
7
7
|
import { pad2 } from '@/lib/utils';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
8
|
+
import type { Page } from '../../lib/sdk';
|
|
9
|
+
import { useSlideModule } from '../../lib/use-slide-module';
|
|
10
|
+
import { useLrText } from '../text';
|
|
11
|
+
import { columnStarts } from './model/structure';
|
|
12
|
+
import { useBoardCards } from './use-board-cards';
|
|
13
|
+
import { useBoardColumns } from './use-board-columns';
|
|
14
|
+
import { usePageOrder } from './use-page-order';
|
|
14
15
|
|
|
15
|
-
const BoardCanvas = lazy(() => import('
|
|
16
|
+
const BoardCanvas = lazy(() => import('./board-canvas'));
|
|
16
17
|
|
|
17
18
|
// A fresh [] on every render would restart the page-order state in a loop while
|
|
18
19
|
// the deck module is still loading.
|
|
@@ -36,15 +37,15 @@ export function Board() {
|
|
|
36
37
|
const { slideId = '' } = useParams();
|
|
37
38
|
const navigate = useNavigate();
|
|
38
39
|
const { slide, error } = useSlideModule(slideId);
|
|
39
|
-
const
|
|
40
|
+
const lr = useLrText();
|
|
40
41
|
useDocumentTitle(slide?.meta?.title);
|
|
41
42
|
|
|
42
43
|
const modulePages = slide?.default ?? NO_PAGES;
|
|
43
44
|
const { pages, reorder, duplicate, insert, remove } = usePageOrder(slideId, modulePages);
|
|
44
45
|
|
|
45
46
|
const columnTitle = useCallback(
|
|
46
|
-
(n: number) => format(
|
|
47
|
-
[
|
|
47
|
+
(n: number) => format(lr.board.columnFallback, { n }),
|
|
48
|
+
[lr.board.columnFallback],
|
|
48
49
|
);
|
|
49
50
|
const { columns, moveBetweenColumns, resizeColumnAt, growColumn, renameColumn } = useBoardColumns(
|
|
50
51
|
slideId,
|
|
@@ -123,18 +124,18 @@ export function Board() {
|
|
|
123
124
|
<Button
|
|
124
125
|
variant="ghost"
|
|
125
126
|
size="icon-sm"
|
|
126
|
-
aria-label={
|
|
127
|
+
aria-label={lr.board.backToDeck}
|
|
127
128
|
onClick={() => navigate(`/s/${encodeURIComponent(slideId)}`)}
|
|
128
129
|
>
|
|
129
130
|
<ChevronLeft />
|
|
130
131
|
</Button>
|
|
131
|
-
<span className="eyebrow">{
|
|
132
|
+
<span className="eyebrow">{lr.board.title}</span>
|
|
132
133
|
<span className="truncate text-[13px] text-muted-foreground">
|
|
133
134
|
{slide?.meta?.title ?? slideId}
|
|
134
135
|
</span>
|
|
135
136
|
<span className="folio ml-auto">{pad2(pages.length)}</span>
|
|
136
137
|
<span className="hidden text-[11.5px] text-muted-foreground/70 sm:inline">
|
|
137
|
-
{
|
|
138
|
+
{lr.board.hint}
|
|
138
139
|
</span>
|
|
139
140
|
</header>
|
|
140
141
|
<div className="relative min-h-0 flex-1">
|
|
@@ -144,7 +145,7 @@ export function Board() {
|
|
|
144
145
|
</p>
|
|
145
146
|
) : pages.length === 0 || !columns ? (
|
|
146
147
|
<p className="grid h-full place-items-center text-[13px] text-muted-foreground">
|
|
147
|
-
{
|
|
148
|
+
{lr.board.loading}
|
|
148
149
|
</p>
|
|
149
150
|
) : (
|
|
150
151
|
<Suspense fallback={null}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BoardColumn } from '../../../files/board-structure';
|
|
2
1
|
import type { Page } from '../../lib/sdk';
|
|
3
2
|
import { CANVAS_HEIGHT, CANVAS_WIDTH } from '../../lib/sdk';
|
|
3
|
+
import type { BoardColumn } from './model/structure';
|
|
4
4
|
|
|
5
5
|
/** 1/4 of the authoring canvas, so a preview scales by exactly 0.25. */
|
|
6
6
|
export const CARD_W = 480;
|