@lemonriver/core 1.2.0 → 1.4.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-CSkdswfd.js → build-Cv0nNc4G.js} +1 -1
- package/dist/cli/bin.js +5 -5
- package/dist/{config-C5-myPY6.js → config-Di9kipre.js} +2773 -714
- package/dist/{config-CYNOR93W.d.ts → config-f1SqAhtR.d.ts} +1 -1
- package/dist/{dev-DHtYH8sw.js → dev-Az1UzCQp.js} +11 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -2
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/{mcp-B2UeO1un.js → mcp-CW7H6oUg.js} +1 -1
- package/dist/{preview-C1B6-umF.js → preview-DtSq5uN1.js} +1 -1
- package/dist/{types-tdaXSyah.d.ts → types-C4VfD89E.d.ts} +12 -0
- package/dist/{update-DzL8fpcI.js → update-DVe2kQA7.js} +86 -13
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/{zh-tw-BhYyMx0-.js → zh-tw-BX3oQAc2.js} +110 -0
- package/package.json +5 -6
- package/release-notes.json +34 -0
- package/src/agent/types.ts +9 -2
- package/src/app/app.tsx +2 -0
- package/src/app/components/agent/agent-panel.tsx +12 -3
- package/src/app/components/agent/agent-presence.tsx +1 -1
- package/src/app/components/command/home-command-menu.tsx +4 -1
- package/src/app/components/command/slide-command-menu.tsx +4 -1
- package/src/app/components/export-progress-toast.tsx +3 -1
- package/src/app/components/inspector/asset-picker-dialog.tsx +1 -1
- package/src/app/components/inspector/comment-layer.tsx +3 -3
- package/src/app/components/inspector/inline-text-editor.tsx +1 -12
- package/src/app/components/inspector/inspect-overlay.tsx +9 -1
- package/src/app/components/inspector/inspector-panel.tsx +7 -23
- package/src/app/components/inspector/inspector-provider.tsx +177 -36
- package/src/app/components/inspector/page-panel.tsx +270 -0
- package/src/app/components/language-toggle.tsx +13 -11
- package/src/app/components/overview-grid.tsx +3 -3
- package/src/app/components/panel/editor-sidebar.tsx +43 -8
- package/src/app/components/panel/panel-shell.tsx +9 -5
- package/src/app/components/panel/save-card.tsx +1 -1
- package/src/app/components/player.tsx +6 -1
- package/src/app/components/sidebar/folder-item.tsx +4 -1
- package/src/app/components/sidebar/sidebar.tsx +11 -8
- package/src/app/components/slide-canvas.tsx +1 -1
- package/src/app/components/style-panel/design-provider.tsx +48 -11
- package/src/app/components/style-panel/use-design.ts +6 -1
- package/src/app/components/theme-toggle.tsx +16 -22
- package/src/app/components/thumbnail-rail.tsx +69 -50
- package/src/app/components/ui/context-menu.tsx +9 -10
- package/src/app/components/ui/dialog.tsx +2 -4
- package/src/app/components/ui/dropdown-menu.tsx +9 -10
- package/src/app/components/ui/popover.tsx +1 -1
- package/src/app/components/ui/select.tsx +2 -2
- package/src/app/components/ui/sonner.tsx +2 -2
- package/src/app/index.html +7 -0
- package/src/app/lemonriver/agent-cli/model.ts +22 -0
- package/src/app/lemonriver/agent-install/model.ts +46 -0
- package/src/app/lemonriver/agent-install/section.tsx +178 -0
- package/src/app/lemonriver/agent-install/use-install.ts +51 -0
- package/src/app/lemonriver/agent-providers/section.tsx +385 -44
- package/src/app/lemonriver/agent-providers/use-providers.ts +50 -3
- package/src/app/lemonriver/backup/places.ts +22 -12
- package/src/app/lemonriver/chrome/sidebar-extras.tsx +1 -1
- package/src/app/lemonriver/feedback/dialog.tsx +1 -2
- package/src/app/lemonriver/feedback/model.ts +0 -5
- package/src/app/lemonriver/guide/clipboard.ts +19 -0
- package/src/app/lemonriver/guide/create-board.tsx +150 -0
- package/src/app/lemonriver/guide/install-board.tsx +208 -0
- package/src/app/lemonriver/guide/more-agents-page.tsx +89 -0
- package/src/app/lemonriver/guide/more-agents.ts +137 -0
- package/src/app/lemonriver/guide/quick-board.tsx +57 -0
- package/src/app/lemonriver/guide/start-board.tsx +38 -0
- package/src/app/lemonriver/guide/start-card.tsx +105 -0
- package/src/app/lemonriver/guide/start.ts +174 -0
- package/src/app/lemonriver/guide/state.ts +5 -21
- package/src/app/lemonriver/help/help-page.tsx +24 -6
- package/src/app/lemonriver/help/model.ts +1 -0
- package/src/app/lemonriver/home/home-page.tsx +12 -6
- package/src/app/lemonriver/home/sorting.ts +45 -0
- package/src/app/lemonriver/home/use-deck-times.ts +1 -2
- package/src/app/lemonriver/i18n/system-locale.ts +39 -0
- package/src/app/lemonriver/present/dual-screen.ts +154 -0
- package/src/app/lemonriver/present/presenter-blocked-hint.tsx +28 -0
- package/src/app/lemonriver/present/wake-lock.ts +74 -0
- package/src/app/lemonriver/routes.tsx +2 -0
- package/src/app/lemonriver/settings/backup-section.tsx +3 -2
- package/src/app/lemonriver/settings/settings-page.tsx +5 -6
- package/src/app/lemonriver/settings/workspace-card.tsx +2 -1
- package/src/app/lemonriver/share/share-dialog.tsx +2 -1
- package/src/app/lemonriver/text/en.ts +594 -452
- package/src/app/lemonriver/text/es.ts +404 -270
- package/src/app/lemonriver/text/ja.ts +405 -273
- package/src/app/lemonriver/text/platform.ts +7 -0
- package/src/app/lemonriver/text/types.ts +122 -1
- package/src/app/lemonriver/text/zh-cn.ts +645 -507
- package/src/app/lemonriver/text/zh-tw.ts +681 -544
- package/src/app/lemonriver/theme/app.css +9 -0
- package/src/app/lemonriver/theme/controls.css +5 -2
- package/src/app/lemonriver/theme/index.css +9 -0
- package/src/app/lemonriver/theme/pages.ts +2 -0
- package/src/app/lemonriver/theme/theme-menu.tsx +10 -11
- package/src/app/lemonriver/update/restart-wait.ts +45 -0
- package/src/app/lemonriver/update/update-prompt.tsx +9 -0
- package/src/app/lib/agent/use-agent.ts +117 -30
- package/src/app/lib/desktop-host.ts +31 -0
- package/src/app/lib/desktop-routes.ts +22 -0
- package/src/app/lib/desktop.ts +106 -0
- package/src/app/lib/export-pdf.ts +15 -7
- package/src/app/lib/inspector/color.ts +51 -0
- package/src/app/lib/inspector/fiber.ts +6 -0
- package/src/app/lib/inspector/use-editor.ts +2 -1
- package/src/app/lib/inspector/use-notes.ts +331 -57
- package/src/app/lib/inspector/use-visual-editor.ts +9 -1
- package/src/app/lib/locale-store.ts +6 -1
- package/src/app/lib/transition.ts +43 -0
- package/src/app/lib/unsaved.ts +155 -0
- package/src/app/routes/home.tsx +1 -1
- package/src/app/routes/presenter.tsx +2 -0
- package/src/app/routes/slide.tsx +130 -74
- package/src/app/styles.css +39 -1
- package/src/locale/en.ts +19 -0
- package/src/locale/es.ts +19 -0
- package/src/locale/ja.ts +19 -0
- package/src/locale/types.ts +12 -0
- package/src/locale/zh-cn.ts +19 -0
- package/src/locale/zh-tw.ts +19 -0
- package/src/app/lemonriver/guide/guide-prompt.tsx +0 -89
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { toast } from 'sonner';
|
|
3
|
+
import { Button } from '@/components/ui/button';
|
|
4
|
+
import {
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogFooter,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
} from '@/components/ui/dialog';
|
|
12
|
+
import { format, useLocale } from '@/lib/use-locale';
|
|
13
|
+
import { useLrText } from '../text';
|
|
14
|
+
import { type AgentAppId, type AppStatus, agentAppName } from './model';
|
|
15
|
+
import { useAgentInstall } from './use-install';
|
|
16
|
+
|
|
17
|
+
type Pending = { row: AppStatus; action: 'install' | 'uninstall' };
|
|
18
|
+
|
|
19
|
+
export function AgentInstallSection() {
|
|
20
|
+
const lr = useLrText().agentInstall;
|
|
21
|
+
const localeId = useLocale().id;
|
|
22
|
+
const { catalog, working, act } = useAgentInstall();
|
|
23
|
+
const [pending, setPending] = useState<Pending | null>(null);
|
|
24
|
+
if (!catalog) return null;
|
|
25
|
+
|
|
26
|
+
const appName = (id: AgentAppId): string => agentAppName(id, localeId);
|
|
27
|
+
|
|
28
|
+
const stateText = (row: AppStatus): string => {
|
|
29
|
+
if (row.state === 'no-app') return lr.state.noApp;
|
|
30
|
+
if (row.state === 'available') return lr.state.available;
|
|
31
|
+
if (row.state === 'outdated') return lr.state.outdated;
|
|
32
|
+
if (row.state === 'broken') return lr.state.broken;
|
|
33
|
+
return lr.state.installed;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const run = async (row: AppStatus, action: 'install' | 'uninstall') => {
|
|
37
|
+
setPending(null);
|
|
38
|
+
const result = await act(row.id, action);
|
|
39
|
+
if (result.ok) return;
|
|
40
|
+
const name = appName(row.id);
|
|
41
|
+
toast.error(
|
|
42
|
+
action === 'install'
|
|
43
|
+
? format(lr.installFailed, { name, error: result.error })
|
|
44
|
+
: format(lr.uninstallFailed, { name, error: result.error }),
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const installed = (row: AppStatus): boolean =>
|
|
49
|
+
row.state === 'installed' || row.state === 'outdated' || row.state === 'broken';
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<section
|
|
53
|
+
data-lr-agent-install
|
|
54
|
+
className="mt-5 rounded-[16px] border border-border bg-card px-6 py-5 shadow-[var(--lr-shadow-1)]"
|
|
55
|
+
>
|
|
56
|
+
<h2 className="text-[16px] font-semibold">{lr.title}</h2>
|
|
57
|
+
<p className="mt-1 mb-2 text-[14px] text-muted-foreground">{lr.hint}</p>
|
|
58
|
+
|
|
59
|
+
<ul className="divide-y divide-border border-t border-border">
|
|
60
|
+
{catalog.apps.map((row) => (
|
|
61
|
+
<li
|
|
62
|
+
key={row.id}
|
|
63
|
+
data-lr-agent-install-row={row.id}
|
|
64
|
+
className="flex items-center gap-3 py-3"
|
|
65
|
+
>
|
|
66
|
+
<div className="min-w-0 flex-1">
|
|
67
|
+
<p className="text-[14px] font-semibold">{appName(row.id)}</p>
|
|
68
|
+
<p data-lr-agent-install-state={row.id} className="text-[12px] text-muted-foreground">
|
|
69
|
+
{stateText(row)}
|
|
70
|
+
{row.installedVersion
|
|
71
|
+
? ` · ${format(lr.version, { version: row.installedVersion })}`
|
|
72
|
+
: ''}
|
|
73
|
+
</p>
|
|
74
|
+
{row.state === 'broken' && row.checkError && (
|
|
75
|
+
<p data-lr-agent-install-check={row.id} className="text-[12px] text-destructive">
|
|
76
|
+
{format(lr.checkFailedDetail, { error: row.checkError })}
|
|
77
|
+
</p>
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
81
|
+
{row.state === 'available' && (
|
|
82
|
+
<Button
|
|
83
|
+
type="button"
|
|
84
|
+
size="sm"
|
|
85
|
+
data-lr-agent-install-button={`${row.id}:install`}
|
|
86
|
+
disabled={working === row.id}
|
|
87
|
+
onClick={() => setPending({ row, action: 'install' })}
|
|
88
|
+
>
|
|
89
|
+
{working === row.id ? lr.working : lr.install}
|
|
90
|
+
</Button>
|
|
91
|
+
)}
|
|
92
|
+
{row.state === 'outdated' && (
|
|
93
|
+
<Button
|
|
94
|
+
type="button"
|
|
95
|
+
size="sm"
|
|
96
|
+
data-lr-agent-install-button={`${row.id}:install`}
|
|
97
|
+
disabled={working === row.id}
|
|
98
|
+
onClick={() => setPending({ row, action: 'install' })}
|
|
99
|
+
>
|
|
100
|
+
{working === row.id ? lr.working : lr.update}
|
|
101
|
+
</Button>
|
|
102
|
+
)}
|
|
103
|
+
{installed(row) && (
|
|
104
|
+
<Button
|
|
105
|
+
type="button"
|
|
106
|
+
size="sm"
|
|
107
|
+
variant="outline"
|
|
108
|
+
data-lr-agent-install-button={`${row.id}:check`}
|
|
109
|
+
disabled={working === row.id}
|
|
110
|
+
onClick={() => void act(row.id, 'check')}
|
|
111
|
+
>
|
|
112
|
+
{lr.check}
|
|
113
|
+
</Button>
|
|
114
|
+
)}
|
|
115
|
+
{installed(row) && (
|
|
116
|
+
<Button
|
|
117
|
+
type="button"
|
|
118
|
+
size="sm"
|
|
119
|
+
variant="ghost"
|
|
120
|
+
data-lr-agent-install-button={`${row.id}:uninstall`}
|
|
121
|
+
disabled={working === row.id}
|
|
122
|
+
onClick={() => setPending({ row, action: 'uninstall' })}
|
|
123
|
+
>
|
|
124
|
+
{lr.uninstall}
|
|
125
|
+
</Button>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
</li>
|
|
129
|
+
))}
|
|
130
|
+
</ul>
|
|
131
|
+
|
|
132
|
+
<Dialog open={pending !== null} onOpenChange={(open) => !open && setPending(null)}>
|
|
133
|
+
<DialogContent data-lr-agent-install-confirm>
|
|
134
|
+
{pending && (
|
|
135
|
+
<>
|
|
136
|
+
<DialogHeader>
|
|
137
|
+
<DialogTitle>
|
|
138
|
+
{pending.action === 'install'
|
|
139
|
+
? format(lr.confirmTitle, { name: appName(pending.row.id) })
|
|
140
|
+
: format(lr.confirmUninstallTitle, { name: appName(pending.row.id) })}
|
|
141
|
+
</DialogTitle>
|
|
142
|
+
<DialogDescription>
|
|
143
|
+
{pending.action === 'install' ? lr.confirmBackup : lr.confirmUninstallBody}
|
|
144
|
+
</DialogDescription>
|
|
145
|
+
</DialogHeader>
|
|
146
|
+
{pending.action === 'install' && pending.row.target && (
|
|
147
|
+
<p
|
|
148
|
+
data-lr-agent-install-target
|
|
149
|
+
className="break-all rounded-[10px] bg-muted px-3 py-2 text-[12px] text-muted-foreground"
|
|
150
|
+
>
|
|
151
|
+
{format(lr.confirmTarget, { path: pending.row.target })}
|
|
152
|
+
</p>
|
|
153
|
+
)}
|
|
154
|
+
<DialogFooter>
|
|
155
|
+
<Button
|
|
156
|
+
type="button"
|
|
157
|
+
variant="ghost"
|
|
158
|
+
data-lr-agent-install-cancel
|
|
159
|
+
onClick={() => setPending(null)}
|
|
160
|
+
>
|
|
161
|
+
{lr.cancel}
|
|
162
|
+
</Button>
|
|
163
|
+
<Button
|
|
164
|
+
type="button"
|
|
165
|
+
data-lr-agent-install-go
|
|
166
|
+
disabled={working === pending.row.id}
|
|
167
|
+
onClick={() => void run(pending.row, pending.action)}
|
|
168
|
+
>
|
|
169
|
+
{pending.action === 'install' ? lr.confirmInstall : lr.uninstall}
|
|
170
|
+
</Button>
|
|
171
|
+
</DialogFooter>
|
|
172
|
+
</>
|
|
173
|
+
)}
|
|
174
|
+
</DialogContent>
|
|
175
|
+
</Dialog>
|
|
176
|
+
</section>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import type { AgentAppId, AppStatus, InstallAction, InstallCatalog } from './model';
|
|
3
|
+
|
|
4
|
+
export function useAgentInstall() {
|
|
5
|
+
const [catalog, setCatalog] = useState<InstallCatalog | null>(null);
|
|
6
|
+
const [working, setWorking] = useState<AgentAppId | null>(null);
|
|
7
|
+
|
|
8
|
+
const load = useCallback(async () => {
|
|
9
|
+
try {
|
|
10
|
+
const res = await fetch('/__lr/agent-plugins');
|
|
11
|
+
if (!res.ok) return;
|
|
12
|
+
setCatalog((await res.json()) as InstallCatalog);
|
|
13
|
+
} catch {}
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
void load();
|
|
18
|
+
}, [load]);
|
|
19
|
+
|
|
20
|
+
const act = useCallback(
|
|
21
|
+
async (
|
|
22
|
+
id: AgentAppId,
|
|
23
|
+
action: InstallAction,
|
|
24
|
+
): Promise<{ ok: true } | { ok: false; error: string }> => {
|
|
25
|
+
setWorking(id);
|
|
26
|
+
try {
|
|
27
|
+
const res = await fetch('/__lr/agent-plugins', {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
headers: { 'content-type': 'application/json' },
|
|
30
|
+
body: JSON.stringify({ app: id, action }),
|
|
31
|
+
});
|
|
32
|
+
const data = (await res.json().catch(() => ({}))) as { error?: string; app?: AppStatus };
|
|
33
|
+
if (!res.ok || !data.app) return { ok: false, error: data.error ?? `HTTP ${res.status}` };
|
|
34
|
+
const updated = data.app;
|
|
35
|
+
setCatalog((current) =>
|
|
36
|
+
current
|
|
37
|
+
? { ...current, apps: current.apps.map((row) => (row.id === id ? updated : row)) }
|
|
38
|
+
: current,
|
|
39
|
+
);
|
|
40
|
+
return { ok: true };
|
|
41
|
+
} catch (err) {
|
|
42
|
+
return { ok: false, error: err instanceof Error ? err.message : 'failed' };
|
|
43
|
+
} finally {
|
|
44
|
+
setWorking(null);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
[],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return { catalog, working, act, reload: load };
|
|
51
|
+
}
|