@lemonriver/core 0.1.1 → 0.2.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-f-fM2ZY4.js → build-Df_xwIpg.js} +1 -1
- package/dist/cli/bin.js +4 -4
- package/dist/{config-DO45GU3e.js → config-BjWCLoMQ.js} +2343 -363
- package/dist/{config-B6JaKJM4.d.ts → config-rMGCkz6i.d.ts} +6 -2
- package/dist/{dev-CqS2xpgE.js → dev-Ctsx9IeO.js} +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -3
- package/dist/locale/index.d.ts +5 -2
- package/dist/locale/index.js +2 -2
- package/dist/{preview-BihgMlEl.js → preview-CJgcqsPk.js} +1 -1
- package/dist/{types-BjW4glip.d.ts → types-8VUyA2bu.d.ts} +133 -5
- package/dist/{update-C_R0ycVC.js → update-BKOA3Z6o.js} +153 -21
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/{zh-tw-Ci0jK8eg.js → zh-tw-CeLrYwRE.js} +1178 -25
- package/package.json +13 -6
- package/skills/apply-comments/SKILL.md +10 -6
- package/skills/create-slide/SKILL.md +2 -0
- package/skills/current-slide/SKILL.md +1 -0
- package/skills/slide-authoring/SKILL.md +31 -1
- package/src/agent/prompt.ts +141 -0
- package/src/agent/provider.ts +123 -0
- package/src/agent/types.ts +151 -0
- package/src/app/app.tsx +2 -0
- package/src/app/assets/open-slide.svg +39 -0
- package/src/app/components/agent/agent-dock.tsx +35 -0
- package/src/app/components/agent/agent-markdown.tsx +45 -0
- package/src/app/components/agent/agent-panel.tsx +692 -0
- package/src/app/components/agent/agent-presence.tsx +74 -0
- package/src/app/components/agent/composer.tsx +120 -0
- package/src/app/components/agent/connect-view.tsx +184 -0
- package/src/app/components/agent/history-view.tsx +135 -0
- package/src/app/components/agent/provider-logo.tsx +34 -0
- package/src/app/components/agent/transcript.tsx +609 -0
- package/src/app/components/board/board-canvas.tsx +143 -12
- package/src/app/components/board/board.css +51 -0
- package/src/app/components/board/layout.test.ts +53 -1
- package/src/app/components/board/layout.ts +50 -2
- package/src/app/components/board/page-node.tsx +287 -13
- package/src/app/components/board/use-board-cards.ts +210 -0
- package/src/app/components/board/use-page-order.ts +17 -9
- package/src/app/components/command/slide-command-menu.tsx +10 -0
- package/src/app/components/icon-switcher-indicator.tsx +1 -1
- package/src/app/components/inspector/comment-layer.tsx +1011 -0
- package/src/app/components/inspector/image-crop-dialog.tsx +1 -5
- package/src/app/components/inspector/inspect-overlay.tsx +2 -39
- package/src/app/components/inspector/inspector-panel.tsx +10 -93
- package/src/app/components/inspector/inspector-provider.tsx +121 -47
- package/src/app/components/panel/editor-sidebar.tsx +85 -16
- package/src/app/components/panel/panel-shell.tsx +2 -2
- package/src/app/components/panel/resize-handle.tsx +129 -0
- package/src/app/components/player.tsx +0 -1
- package/src/app/components/preview-step-host.tsx +16 -0
- package/src/app/components/sidebar/sidebar.tsx +2 -2
- package/src/app/components/style-panel/style-panel.tsx +3 -2
- package/src/app/components/thumbnail-rail.tsx +76 -1
- package/src/app/favicon.ico +0 -0
- package/src/app/favicon.svg +39 -0
- package/src/app/index.html +2 -1
- package/src/app/lib/agent/use-agent.ts +543 -0
- package/src/app/lib/inspector/freeze-motion.ts +61 -0
- package/src/app/lib/inspector/use-comments.ts +32 -3
- package/src/app/lib/locale-store.ts +6 -1
- package/src/app/lib/print-ready.ts +9 -6
- package/src/app/lib/use-auto-grow.ts +15 -0
- package/src/app/lib/utils.ts +4 -0
- package/src/app/routes/board.tsx +48 -11
- package/src/app/routes/home.tsx +43 -7
- package/src/app/routes/presenter.tsx +1 -16
- package/src/app/routes/preview.tsx +169 -0
- package/src/app/routes/slide.tsx +221 -173
- package/src/app/styles.css +234 -80
- package/src/editing/placeholder-id.ts +1 -0
- package/src/locale/en.ts +127 -5
- package/src/locale/es.ts +692 -0
- package/src/locale/index.ts +1 -0
- package/src/locale/ja.ts +120 -6
- package/src/locale/types.ts +132 -5
- package/src/locale/zh-cn.ts +117 -5
- package/src/locale/zh-tw.ts +117 -5
- package/src/app/assets/open-slide.png +0 -0
- package/src/app/components/inspector/comment-widget.tsx +0 -119
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Sparkles } from 'lucide-react';
|
|
2
|
+
import { Button } from '@/components/ui/button';
|
|
3
|
+
import { useAgentDock, useAgentStatus } from '@/lib/agent/use-agent';
|
|
4
|
+
import { useLocale } from '@/lib/use-locale';
|
|
5
|
+
import { ProviderLogo } from './provider-logo';
|
|
6
|
+
|
|
7
|
+
export const AGENT_DOCK_W = 380;
|
|
8
|
+
|
|
9
|
+
export function AgentToggleButton() {
|
|
10
|
+
const t = useLocale();
|
|
11
|
+
const { open, toggle } = useAgentDock();
|
|
12
|
+
const { provider } = useAgentStatus();
|
|
13
|
+
if (import.meta.env.PROD) return null;
|
|
14
|
+
return (
|
|
15
|
+
<Button
|
|
16
|
+
size="sm"
|
|
17
|
+
variant={open ? 'default' : 'ghost'}
|
|
18
|
+
onClick={toggle}
|
|
19
|
+
aria-pressed={open}
|
|
20
|
+
aria-label={t.agent.openTitle}
|
|
21
|
+
title={t.agent.openTitle}
|
|
22
|
+
data-agent-ui
|
|
23
|
+
>
|
|
24
|
+
{provider ? (
|
|
25
|
+
<ProviderLogo provider={provider.id} className="size-3.5" />
|
|
26
|
+
) : (
|
|
27
|
+
<Sparkles className="size-3.5" />
|
|
28
|
+
)}
|
|
29
|
+
<span className="hidden lg:inline">{t.agent.open}</span>
|
|
30
|
+
<kbd className="ml-1 hidden rounded-[3px] bg-foreground/10 px-1 font-mono text-[9.5px] tracking-[0.04em] lg:inline">
|
|
31
|
+
A
|
|
32
|
+
</kbd>
|
|
33
|
+
</Button>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { NoteMarkdown } from '@/components/note-markdown';
|
|
3
|
+
|
|
4
|
+
type Segment = { type: 'text'; text: string } | { type: 'code'; code: string };
|
|
5
|
+
|
|
6
|
+
const FENCE = /^```[^\n]*\n([\s\S]*?)\n?```\s*$/m;
|
|
7
|
+
|
|
8
|
+
function splitFences(text: string): Segment[] {
|
|
9
|
+
const segments: Segment[] = [];
|
|
10
|
+
let rest = text;
|
|
11
|
+
while (rest) {
|
|
12
|
+
const m = FENCE.exec(rest);
|
|
13
|
+
if (!m) {
|
|
14
|
+
segments.push({ type: 'text', text: rest });
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
const before = rest.slice(0, m.index);
|
|
18
|
+
if (before.trim()) segments.push({ type: 'text', text: before });
|
|
19
|
+
segments.push({ type: 'code', code: m[1] });
|
|
20
|
+
rest = rest.slice(m.index + m[0].length);
|
|
21
|
+
}
|
|
22
|
+
return segments;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function AgentMarkdown({ text }: { text: string }) {
|
|
26
|
+
const segments = useMemo(() => splitFences(text), [text]);
|
|
27
|
+
return (
|
|
28
|
+
<div className="space-y-2 text-[12.5px] leading-[1.55] [&_ol]:my-1 [&_ul]:my-1">
|
|
29
|
+
{segments.map((segment, i) =>
|
|
30
|
+
segment.type === 'code' ? (
|
|
31
|
+
<pre
|
|
32
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: static parse output, never reordered
|
|
33
|
+
key={i}
|
|
34
|
+
className="overflow-x-auto rounded-[6px] border border-hairline bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-relaxed"
|
|
35
|
+
>
|
|
36
|
+
<code>{segment.code}</code>
|
|
37
|
+
</pre>
|
|
38
|
+
) : (
|
|
39
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: static parse output, never reordered
|
|
40
|
+
<NoteMarkdown key={i} text={segment.text} />
|
|
41
|
+
),
|
|
42
|
+
)}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|