@lemonriver/core 0.3.0 → 0.5.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/README.md +14 -4
- package/dist/{build-Bqo69DWP.js → build-CS1goZxt.js} +1 -1
- package/dist/cli/bin.js +4 -4
- package/dist/{config-DJ5rkMMg.js → config-BpbcCbUv.js} +3835 -1532
- package/dist/{config-teo3kWz7.d.ts → config-CYNOR93W.d.ts} +1 -1
- package/dist/{dev-B2FJD5bJ.js → dev-BpYnfgLL.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-C93BOZL1.js → preview-HSzPPkSs.js} +1 -1
- package/dist/{types-DFK02XVv.d.ts → types-tdaXSyah.d.ts} +1 -0
- package/dist/{update-DsxZBtwv.js → update-CMRxtTc9.js} +18 -8
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/{zh-tw-DwTAZKa6.js → zh-tw-DcrDeKxr.js} +5 -0
- package/package.json +2 -2
- package/src/agent/prompt.ts +2 -0
- package/src/agent/types.ts +14 -2
- package/src/app/components/agent/agent-panel.tsx +19 -5
- package/src/app/components/agent/connect-view.tsx +1 -1
- package/src/app/components/agent/provider-logo.tsx +10 -1
- package/src/app/components/player.tsx +105 -23
- package/src/app/components/present/curtain.tsx +52 -0
- package/src/app/components/present/last-slide-hint.tsx +36 -0
- package/src/app/components/sidebar/sidebar-footer.tsx +6 -1
- package/src/app/components/thumbnail-rail.tsx +1 -0
- package/src/app/lemonriver/agent/lemon.tsx +16 -1
- package/src/app/lemonriver/agent/provider-marks.tsx +53 -0
- package/src/app/lemonriver/agent-prefs/prefs.test.ts +173 -0
- package/src/app/lemonriver/agent-prefs/prefs.ts +137 -0
- package/src/app/lemonriver/agent-prefs/use-prefs.ts +36 -0
- package/src/app/lemonriver/agent-providers/section.tsx +75 -0
- package/src/app/lemonriver/agent-providers/use-providers.ts +61 -0
- package/src/app/lemonriver/board/blocks/block-panel.tsx +666 -0
- package/src/app/lemonriver/board/blocks/cache.ts +28 -0
- package/src/app/lemonriver/board/blocks/change-list.tsx +189 -0
- package/src/app/lemonriver/board/blocks/classify.test.ts +204 -0
- package/src/app/lemonriver/board/blocks/classify.ts +125 -0
- package/src/app/lemonriver/board/blocks/snapshot.ts +86 -0
- package/src/app/lemonriver/board/board-canvas.tsx +627 -104
- package/src/app/lemonriver/board/board-page.tsx +1687 -91
- package/src/app/lemonriver/board/board.css +58 -7
- package/src/app/lemonriver/board/layout.test.ts +84 -0
- package/src/app/lemonriver/board/layout.ts +112 -11
- package/src/app/lemonriver/board/model/agent-tasks.test.ts +200 -0
- package/src/app/lemonriver/board/model/agent-tasks.ts +191 -0
- package/src/app/lemonriver/board/model/apply-prompt.test.ts +121 -0
- package/src/app/lemonriver/board/model/apply-prompt.ts +115 -0
- package/src/app/lemonriver/board/model/apply.ts +71 -0
- package/src/app/lemonriver/board/model/cards.test.ts +95 -2
- package/src/app/lemonriver/board/model/cards.ts +88 -20
- package/src/app/lemonriver/board/model/changes.test.ts +244 -0
- package/src/app/lemonriver/board/model/changes.ts +268 -0
- package/src/app/lemonriver/board/model/filter.test.ts +50 -0
- package/src/app/lemonriver/board/model/filter.ts +42 -0
- package/src/app/lemonriver/board/model/history.test.ts +71 -0
- package/src/app/lemonriver/board/model/history.ts +51 -0
- package/src/app/lemonriver/board/model/restructure.test.ts +205 -0
- package/src/app/lemonriver/board/model/restructure.ts +169 -0
- package/src/app/lemonriver/board/model/structure.test.ts +249 -0
- package/src/app/lemonriver/board/model/structure.ts +209 -0
- package/src/app/lemonriver/board/model/timing.test.ts +113 -0
- package/src/app/lemonriver/board/model/timing.ts +117 -0
- package/src/app/lemonriver/board/page-node.tsx +236 -55
- package/src/app/lemonriver/board/status-style.ts +25 -0
- package/src/app/lemonriver/board/use-board-apply.ts +206 -0
- package/src/app/lemonriver/board/use-board-cards.ts +108 -5
- package/src/app/lemonriver/board/use-board-changes.ts +108 -0
- package/src/app/lemonriver/board/use-board-columns.ts +37 -56
- package/src/app/lemonriver/board/use-board-comments.ts +36 -0
- package/src/app/lemonriver/board/use-board-restructures.ts +107 -0
- package/src/app/lemonriver/board/use-history.ts +86 -0
- package/src/app/lemonriver/board/use-page-order.ts +65 -38
- package/src/app/lemonriver/board/use-target-minutes.ts +47 -0
- package/src/app/lemonriver/board/views/block-readings.tsx +46 -0
- package/src/app/lemonriver/board/views/list-view.tsx +356 -0
- package/src/app/lemonriver/board/views/progress.tsx +32 -0
- package/src/app/lemonriver/board/views/timeline-view.tsx +341 -0
- package/src/app/lemonriver/brand/mascot.tsx +86 -0
- package/src/app/lemonriver/brand/mascots/design-done.png +0 -0
- package/src/app/lemonriver/brand/mascots/design-idle.png +0 -0
- package/src/app/lemonriver/brand/mascots/design-needs-you.png +0 -0
- package/src/app/lemonriver/brand/mascots/design-working.png +0 -0
- package/src/app/lemonriver/brand/mascots/outline-done.png +0 -0
- package/src/app/lemonriver/brand/mascots/outline-idle.png +0 -0
- package/src/app/lemonriver/brand/mascots/outline-needs-you.png +0 -0
- package/src/app/lemonriver/brand/mascots/outline-working.png +0 -0
- package/src/app/lemonriver/brand/mascots/research-done.png +0 -0
- package/src/app/lemonriver/brand/mascots/research-idle.png +0 -0
- package/src/app/lemonriver/brand/mascots/research-needs-you.png +0 -0
- package/src/app/lemonriver/brand/mascots/research-working.png +0 -0
- package/src/app/lemonriver/brand/mascots/review-done.png +0 -0
- package/src/app/lemonriver/brand/mascots/review-idle.png +0 -0
- package/src/app/lemonriver/brand/mascots/review-needs-you.png +0 -0
- package/src/app/lemonriver/brand/mascots/review-working.png +0 -0
- package/src/app/lemonriver/chrome/app-chrome.tsx +2 -0
- package/src/app/lemonriver/features.test.ts +5 -0
- package/src/app/lemonriver/features.ts +2 -1
- package/src/app/lemonriver/home/brief-card.tsx +8 -1
- package/src/app/lemonriver/home/home-page.tsx +11 -7
- package/src/app/lemonriver/onboarding/onboarding.tsx +182 -0
- package/src/app/lemonriver/outline/build-team.tsx +278 -0
- package/src/app/lemonriver/outline/describe-page.tsx +380 -0
- package/src/app/lemonriver/outline/files.test.ts +90 -0
- package/src/app/lemonriver/outline/files.ts +69 -0
- package/src/app/lemonriver/outline/model.test.ts +672 -0
- package/src/app/lemonriver/outline/model.ts +455 -0
- package/src/app/lemonriver/outline/outline-page.tsx +537 -0
- package/src/app/lemonriver/outline/pending-pages.tsx +39 -0
- package/src/app/lemonriver/outline/rule.ts +3 -0
- package/src/app/lemonriver/outline/steps.tsx +43 -0
- package/src/app/lemonriver/outline/use-build-driver.ts +258 -0
- package/src/app/lemonriver/routes.test.tsx +6 -6
- package/src/app/lemonriver/routes.tsx +28 -0
- package/src/app/lemonriver/settings/settings-page.tsx +214 -0
- package/src/app/lemonriver/slide-extensions.tsx +45 -26
- package/src/app/lemonriver/text/en.ts +320 -0
- package/src/app/lemonriver/text/es.ts +311 -0
- package/src/app/lemonriver/text/ja.ts +313 -0
- package/src/app/lemonriver/text/text.test.ts +33 -0
- package/src/app/lemonriver/text/types.ts +339 -0
- package/src/app/lemonriver/text/zh-cn.ts +307 -0
- package/src/app/lemonriver/text/zh-tw.ts +307 -0
- package/src/app/lemonriver/theme/app.css +12 -1
- package/src/app/lemonriver/theme/lemon-icon.tsx +6 -0
- package/src/app/lemonriver/theme/pages.test.ts +4 -0
- package/src/app/lemonriver/theme/pages.ts +11 -2
- package/src/app/lemonriver/theme/theme-menu.tsx +3 -2
- package/src/app/lemonriver/theme/use-theme.tsx +2 -2
- package/src/app/lemonriver/update/beta-badge.tsx +26 -0
- package/src/app/lemonriver/update/prompt.test.ts +84 -0
- package/src/app/lemonriver/update/prompt.ts +48 -0
- package/src/app/lemonriver/update/update-prompt.tsx +113 -0
- package/src/app/lib/agent/use-agent.ts +4 -3
- package/src/app/routes/home.tsx +13 -5
- package/src/app/routes/slide.tsx +71 -14
- package/src/locale/en.ts +1 -0
- package/src/locale/es.ts +1 -0
- package/src/locale/ja.ts +1 -0
- package/src/locale/types.ts +1 -0
- package/src/locale/zh-cn.ts +1 -0
- package/src/locale/zh-tw.ts +1 -0
- package/src/app/assets/open-slide.svg +0 -39
- package/src/app/favicon.ico +0 -0
- package/src/app/favicon.svg +0 -39
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { V as PKG_NAMES } from "./update-
|
|
1
|
+
import { V as PKG_NAMES } from "./update-CMRxtTc9.js";
|
|
2
2
|
import { a as printUrls, i as printShortcutsHint, n as formatError, o as shortcutsEnabled, r as printHeader, s as startupDuration, t as createCliLogger } from "./cli/bin.js";
|
|
3
|
-
import { n as DEV_SUPERVISED_ENV, t as createViteConfig } from "./config-
|
|
3
|
+
import { n as DEV_SUPERVISED_ENV, t as createViteConfig } from "./config-BpbcCbUv.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
import { fork } from "node:child_process";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as Plural, t as Locale } from "./types-
|
|
2
|
-
import { i as OpenSlideConfig, n as LemonRiverBuildConfig, r as LemonRiverConfig, t as LemonRiverAgentConfig } from "./config-
|
|
1
|
+
import { n as Plural, t as Locale } from "./types-tdaXSyah.js";
|
|
2
|
+
import { i as OpenSlideConfig, n as LemonRiverBuildConfig, r as LemonRiverConfig, t as LemonRiverAgentConfig } from "./config-CYNOR93W.js";
|
|
3
3
|
import { CSSProperties, ComponentType, HTMLAttributes, PropsWithChildren, ReactNode } from "react";
|
|
4
4
|
//#region src/app/components/image-placeholder.d.ts
|
|
5
5
|
type ImagePlaceholderProps = {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as en, i as es, n as zhCN, r as ja, t as zhTW } from "./zh-tw-
|
|
1
|
+
import { a as en, i as es, n as zhCN, r as ja, t as zhTW } from "./zh-tw-DcrDeKxr.js";
|
|
2
2
|
import { n as defaultDesign, r as designToCssVars, t as cssVarsToString } from "./design-Cpqx7SJs.js";
|
|
3
3
|
import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { toast } from "sonner";
|
package/dist/locale/index.d.ts
CHANGED
package/dist/locale/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as en, i as es, n as zhCN, r as ja, t as zhTW } from "../zh-tw-
|
|
1
|
+
import { a as en, i as es, n as zhCN, r as ja, t as zhTW } from "../zh-tw-DcrDeKxr.js";
|
|
2
2
|
//#region src/locale/format.ts
|
|
3
3
|
function format(template, vars) {
|
|
4
4
|
return template.replace(/\{(\w+)\}/g, (m, key) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as printUrls, i as printShortcutsHint, o as shortcutsEnabled, r as printHeader, s as startupDuration, t as createCliLogger } from "./cli/bin.js";
|
|
2
|
-
import { t as createViteConfig } from "./config-
|
|
2
|
+
import { t as createViteConfig } from "./config-BpbcCbUv.js";
|
|
3
3
|
import { mergeConfig, preview as preview$1 } from "vite";
|
|
4
4
|
//#region src/cli/preview.ts
|
|
5
5
|
async function preview(opts = {}) {
|
|
@@ -99,28 +99,37 @@ function declaredFrameworkSpecifier(userCwd) {
|
|
|
99
99
|
for (const name of PKG_NAMES) if (name in deps) return name;
|
|
100
100
|
return PKG_NAME;
|
|
101
101
|
}
|
|
102
|
-
function aliasTarget(value) {
|
|
103
|
-
if (
|
|
104
|
-
|
|
102
|
+
function aliasTarget(key, value) {
|
|
103
|
+
if (value.startsWith("npm:")) {
|
|
104
|
+
const rest = value.slice(4);
|
|
105
|
+
const at = rest.lastIndexOf("@");
|
|
106
|
+
return at > 0 ? rest.slice(0, at) : rest;
|
|
107
|
+
}
|
|
108
|
+
if (!value.startsWith("workspace:")) return null;
|
|
109
|
+
const rest = value.slice(10);
|
|
110
|
+
if (!rest.includes("@")) return null;
|
|
105
111
|
const at = rest.lastIndexOf("@");
|
|
106
|
-
|
|
112
|
+
const target = at > 0 ? rest.slice(0, at) : rest;
|
|
113
|
+
return target === key ? null : target;
|
|
107
114
|
}
|
|
108
115
|
function readFrameworkDependency(userCwd) {
|
|
109
116
|
const deps = readDeps(userCwd);
|
|
110
117
|
for (const name of PKG_NAMES) {
|
|
111
118
|
const value = deps[name];
|
|
112
119
|
if (value === void 0) continue;
|
|
113
|
-
const aliased = aliasTarget(value);
|
|
120
|
+
const aliased = aliasTarget(name, value);
|
|
114
121
|
return {
|
|
115
122
|
key: name,
|
|
116
123
|
pkg: aliased ?? name,
|
|
117
|
-
addTarget: aliased ? `${name}@npm:${aliased}@latest` : `${name}@latest
|
|
124
|
+
addTarget: aliased ? `${name}@npm:${aliased}@latest` : `${name}@latest`,
|
|
125
|
+
workspace: value.startsWith("workspace:")
|
|
118
126
|
};
|
|
119
127
|
}
|
|
120
128
|
return {
|
|
121
129
|
key: PKG_NAME,
|
|
122
130
|
pkg: PKG_NAME,
|
|
123
|
-
addTarget: `${PKG_NAME}@latest
|
|
131
|
+
addTarget: `${PKG_NAME}@latest`,
|
|
132
|
+
workspace: false
|
|
124
133
|
};
|
|
125
134
|
}
|
|
126
135
|
//#endregion
|
|
@@ -1063,7 +1072,8 @@ async function updatePackage(ctx) {
|
|
|
1063
1072
|
function registerUpdateRoutes(server, ctx) {
|
|
1064
1073
|
server.middlewares.use("/__update-check", async (req, res, next) => {
|
|
1065
1074
|
if ((req.method ?? "GET") !== "GET") return next();
|
|
1066
|
-
const
|
|
1075
|
+
const dependency = readFrameworkDependency(ctx.userCwd);
|
|
1076
|
+
const latest = dependency.workspace ? null : await fetchLatest(dependency.pkg, Date.now());
|
|
1067
1077
|
const result = {
|
|
1068
1078
|
current: ctx.coreVersion,
|
|
1069
1079
|
latest,
|
package/dist/vite/index.d.ts
CHANGED
package/dist/vite/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createViteConfig } from "../config-
|
|
1
|
+
import { t as createViteConfig } from "../config-BpbcCbUv.js";
|
|
2
2
|
export { createViteConfig };
|
|
@@ -168,6 +168,7 @@ const en = {
|
|
|
168
168
|
helpAria: "Keyboard shortcuts (?)",
|
|
169
169
|
exitAria: "Exit (Esc)",
|
|
170
170
|
elapsedTime: "Elapsed time",
|
|
171
|
+
lastSlideHint: "Last slide · Press Esc to exit",
|
|
171
172
|
helpEyebrow: "Present mode",
|
|
172
173
|
helpTitle: "Keyboard shortcuts",
|
|
173
174
|
shortcutNext: "Next slide",
|
|
@@ -796,6 +797,7 @@ const es = {
|
|
|
796
797
|
helpAria: "Atajos de teclado (?)",
|
|
797
798
|
exitAria: "Salir (Esc)",
|
|
798
799
|
elapsedTime: "Tiempo transcurrido",
|
|
800
|
+
lastSlideHint: "Última diapositiva · Pulsa Esc para salir",
|
|
799
801
|
helpEyebrow: "Modo presentación",
|
|
800
802
|
helpTitle: "Atajos de teclado",
|
|
801
803
|
shortcutNext: "Diapositiva siguiente",
|
|
@@ -1424,6 +1426,7 @@ const ja = {
|
|
|
1424
1426
|
helpAria: "キーボードショートカット (?)",
|
|
1425
1427
|
exitAria: "終了 (Esc)",
|
|
1426
1428
|
elapsedTime: "経過時間",
|
|
1429
|
+
lastSlideHint: "最後のスライドです · Esc で終了",
|
|
1427
1430
|
helpEyebrow: "発表モード",
|
|
1428
1431
|
helpTitle: "キーボードショートカット",
|
|
1429
1432
|
shortcutNext: "次のスライド",
|
|
@@ -2052,6 +2055,7 @@ const zhCN = {
|
|
|
2052
2055
|
helpAria: "键盘快捷键 (?)",
|
|
2053
2056
|
exitAria: "退出 (Esc)",
|
|
2054
2057
|
elapsedTime: "已用时",
|
|
2058
|
+
lastSlideHint: "已是最后一页 · 按 Esc 退出放映",
|
|
2055
2059
|
helpEyebrow: "演示模式",
|
|
2056
2060
|
helpTitle: "键盘快捷键",
|
|
2057
2061
|
shortcutNext: "下一张",
|
|
@@ -2680,6 +2684,7 @@ const zhTW = {
|
|
|
2680
2684
|
helpAria: "鍵盤快速鍵 (?)",
|
|
2681
2685
|
exitAria: "離開 (Esc)",
|
|
2682
2686
|
elapsedTime: "已耗時",
|
|
2687
|
+
lastSlideHint: "已是最後一頁 · 按 Esc 結束播放",
|
|
2683
2688
|
helpEyebrow: "簡報模式",
|
|
2684
2689
|
helpTitle: "鍵盤快速鍵",
|
|
2685
2690
|
shortcutNext: "下一張",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemonriver/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "The LemonRiver runtime: deck viewer, story board, present mode, agent panel and export.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
package/src/agent/prompt.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OUTLINE_RULE } from '../app/lemonriver/outline/rule.ts';
|
|
1
2
|
import { UNTITLED_SLIDE_ID_RE } from '../editing/placeholder-id.ts';
|
|
2
3
|
import { parseQuestions } from './provider.ts';
|
|
3
4
|
import type { AgentQuestion, AgentTurnContext } from './types.ts';
|
|
@@ -14,6 +15,7 @@ export function systemPromptAppend(askInstruction: string): string {
|
|
|
14
15
|
'The workspace is a LemonRiver project: decks live under slides/<id>/index.tsx and the dev server hot-reloads every edit, so the user sees changes immediately.',
|
|
15
16
|
'Use the project skills: create-slide to draft a new deck, apply-comments to resolve @slide-comment markers left by the inspector, create-theme for themes, and slide-authoring as the technical reference before writing a page.',
|
|
16
17
|
PAGE_BY_PAGE,
|
|
18
|
+
OUTLINE_RULE,
|
|
17
19
|
'Keep replies short and concrete: the panel is narrow. Prefer doing the work over describing it, and finish with a one-line summary of what changed.',
|
|
18
20
|
askInstruction,
|
|
19
21
|
].join(' ');
|
package/src/agent/types.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
export const AGENT_PROVIDER_IDS = ['claude', 'codex'] as const;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// Extra providers this release adds. They stay out of the panel until the user
|
|
4
|
+
// switches them on in Settings, so a default workspace behaves as before.
|
|
5
|
+
export const LEMONRIVER_PROVIDER_IDS = ['workbuddy', 'dumate'] as const;
|
|
6
|
+
|
|
7
|
+
export type AgentProviderId =
|
|
8
|
+
| (typeof AGENT_PROVIDER_IDS)[number]
|
|
9
|
+
| (typeof LEMONRIVER_PROVIDER_IDS)[number];
|
|
4
10
|
|
|
5
11
|
export const AGENT_EFFORTS = ['minimal', 'low', 'medium', 'high', 'xhigh', 'max'] as const;
|
|
6
12
|
|
|
7
13
|
export type AgentEffort = (typeof AGENT_EFFORTS)[number];
|
|
8
14
|
|
|
9
15
|
export function isAgentProviderId(value: unknown): value is AgentProviderId {
|
|
10
|
-
return
|
|
16
|
+
return (
|
|
17
|
+
typeof value === 'string' &&
|
|
18
|
+
((AGENT_PROVIDER_IDS as readonly string[]).includes(value) ||
|
|
19
|
+
(LEMONRIVER_PROVIDER_IDS as readonly string[]).includes(value))
|
|
20
|
+
);
|
|
11
21
|
}
|
|
12
22
|
|
|
13
23
|
export function isAgentEffort(value: unknown): value is AgentEffort {
|
|
@@ -19,6 +29,8 @@ export type AgentModelOption = {
|
|
|
19
29
|
id: string;
|
|
20
30
|
label: string;
|
|
21
31
|
efforts: AgentEffort[];
|
|
32
|
+
// The effort that option's client is set to, for the follow-the-client row.
|
|
33
|
+
clientEffort?: AgentEffort | null;
|
|
22
34
|
};
|
|
23
35
|
|
|
24
36
|
export type AgentProviderStatus = {
|
|
@@ -48,6 +48,8 @@ import type {
|
|
|
48
48
|
RespondPayload,
|
|
49
49
|
} from '../../../agent/types';
|
|
50
50
|
import { PanelLemon } from '../../lemonriver/agent/lemon';
|
|
51
|
+
import { BuildTeam } from '../../lemonriver/outline/build-team';
|
|
52
|
+
import { useLrText } from '../../lemonriver/text';
|
|
51
53
|
import { Composer, ContextChip } from './composer';
|
|
52
54
|
import { ConnectView } from './connect-view';
|
|
53
55
|
import { HistoryView } from './history-view';
|
|
@@ -289,6 +291,7 @@ export function AgentPanel({
|
|
|
289
291
|
</div>
|
|
290
292
|
</header>
|
|
291
293
|
|
|
294
|
+
{context.slideId && <BuildTeam slideId={context.slideId} />}
|
|
292
295
|
{loading ? (
|
|
293
296
|
<p className="px-4 py-5 text-[12px] text-muted-foreground">{t.agent.statusLoading}…</p>
|
|
294
297
|
) : showConnect ? (
|
|
@@ -355,8 +358,8 @@ export function AgentPanel({
|
|
|
355
358
|
);
|
|
356
359
|
}
|
|
357
360
|
|
|
358
|
-
function modelLabel(model: AgentModelOption
|
|
359
|
-
return model.
|
|
361
|
+
function modelLabel(model: AgentModelOption): string {
|
|
362
|
+
return model.label;
|
|
360
363
|
}
|
|
361
364
|
|
|
362
365
|
function ModelMenu({
|
|
@@ -377,6 +380,7 @@ function ModelMenu({
|
|
|
377
380
|
onManage: () => void;
|
|
378
381
|
}) {
|
|
379
382
|
const t = useLocale();
|
|
383
|
+
const lr = useLrText();
|
|
380
384
|
const [open, setOpen] = useState(false);
|
|
381
385
|
const providers = status?.enabled ? status.providers : [];
|
|
382
386
|
const [tab, setTab] = useState<AgentProviderId | null>(providerId);
|
|
@@ -403,7 +407,7 @@ function ModelMenu({
|
|
|
403
407
|
) : (
|
|
404
408
|
<span aria-hidden className="size-1.5 rounded-full bg-muted-foreground/50" />
|
|
405
409
|
)}
|
|
406
|
-
<span className="truncate">{model ? modelLabel(model
|
|
410
|
+
<span className="truncate">{model ? modelLabel(model) : t.agent.title}</span>
|
|
407
411
|
{effort && (
|
|
408
412
|
<span className="shrink-0 font-normal text-muted-foreground">
|
|
409
413
|
{t.agent.efforts[effort]}
|
|
@@ -463,10 +467,15 @@ function ModelMenu({
|
|
|
463
467
|
key={m.id}
|
|
464
468
|
type="button"
|
|
465
469
|
aria-pressed={checked}
|
|
470
|
+
title={
|
|
471
|
+
m.id === ''
|
|
472
|
+
? format(lr.agentModel.followClientHint, { provider: shown.name })
|
|
473
|
+
: undefined
|
|
474
|
+
}
|
|
466
475
|
onClick={() =>
|
|
467
476
|
setModelChoice(shown.id, {
|
|
468
477
|
model: m.id,
|
|
469
|
-
effort: modelChoices[shown.id]?.effort ?? null,
|
|
478
|
+
effort: m.id ? (modelChoices[shown.id]?.effort ?? null) : null,
|
|
470
479
|
})
|
|
471
480
|
}
|
|
472
481
|
className={cn(
|
|
@@ -474,7 +483,12 @@ function ModelMenu({
|
|
|
474
483
|
checked && 'font-medium',
|
|
475
484
|
)}
|
|
476
485
|
>
|
|
477
|
-
<span className="truncate">{modelLabel(m
|
|
486
|
+
<span className="truncate">{modelLabel(m)}</span>
|
|
487
|
+
{m.id === '' && (
|
|
488
|
+
<span className="ml-auto shrink-0 text-[11px] font-normal text-muted-foreground">
|
|
489
|
+
{lr.agentModel.followClient}
|
|
490
|
+
</span>
|
|
491
|
+
)}
|
|
478
492
|
{checked && <Check className="size-3.5 shrink-0" aria-hidden />}
|
|
479
493
|
</button>
|
|
480
494
|
);
|
|
@@ -13,7 +13,7 @@ import { cn } from '@/lib/utils';
|
|
|
13
13
|
import type { AgentProviderId, AgentProviderStatus } from '../../../agent/types';
|
|
14
14
|
import { ProviderLogo } from './provider-logo';
|
|
15
15
|
|
|
16
|
-
const CLI_INSTALL: Record<AgentProviderId, string
|
|
16
|
+
const CLI_INSTALL: Partial<Record<AgentProviderId, string>> = {
|
|
17
17
|
claude: 'npm install -g @anthropic-ai/claude-code',
|
|
18
18
|
codex: 'npm install -g @openai/codex',
|
|
19
19
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
2
|
import type { AgentProviderId } from '../../../agent/types';
|
|
3
|
+
import { ExtraProviderLogo } from '../../lemonriver/agent/provider-marks';
|
|
3
4
|
|
|
4
5
|
// Marks from svgl.app (claude-ai-icon, openai).
|
|
5
6
|
function ClaudeLogo(props: SVGProps<SVGSVGElement>) {
|
|
@@ -28,7 +29,15 @@ function OpenAILogo(props: SVGProps<SVGSVGElement>) {
|
|
|
28
29
|
|
|
29
30
|
export function ProviderLogo({
|
|
30
31
|
provider,
|
|
32
|
+
className,
|
|
31
33
|
...props
|
|
32
34
|
}: { provider: AgentProviderId } & SVGProps<SVGSVGElement>) {
|
|
33
|
-
|
|
35
|
+
if (provider !== 'claude' && provider !== 'codex') {
|
|
36
|
+
return <ExtraProviderLogo provider={provider} className={className} />;
|
|
37
|
+
}
|
|
38
|
+
return provider === 'claude' ? (
|
|
39
|
+
<ClaudeLogo className={className} {...props} />
|
|
40
|
+
) : (
|
|
41
|
+
<OpenAILogo className={className} {...props} />
|
|
42
|
+
);
|
|
34
43
|
}
|
|
@@ -12,9 +12,16 @@ import { usePrefersReducedMotion } from '../lib/use-prefers-reduced-motion';
|
|
|
12
12
|
import { OverviewGrid } from './overview-grid';
|
|
13
13
|
import { PresentBlackoutOverlay } from './present/blackout-overlay';
|
|
14
14
|
import { PresentControlBar } from './present/control-bar';
|
|
15
|
+
import {
|
|
16
|
+
afterPaint,
|
|
17
|
+
CURTAIN_FADE_MS,
|
|
18
|
+
PresentCurtain,
|
|
19
|
+
whenFullscreenSettled,
|
|
20
|
+
} from './present/curtain';
|
|
15
21
|
import { PresentHelpOverlay } from './present/help-overlay';
|
|
16
22
|
import { PresentJumpInput } from './present/jump-input';
|
|
17
23
|
import { PresentLaserPointer } from './present/laser-pointer';
|
|
24
|
+
import { PresentLastSlideHint } from './present/last-slide-hint';
|
|
18
25
|
import { PresentProgressBar } from './present/progress-bar';
|
|
19
26
|
import { useIdle } from './present/use-idle';
|
|
20
27
|
import { usePointerNearBottom } from './present/use-pointer-near-bottom';
|
|
@@ -48,6 +55,8 @@ type Props = {
|
|
|
48
55
|
* without entering fullscreen. Defaults to true for back-compat.
|
|
49
56
|
*/
|
|
50
57
|
fullscreen?: boolean;
|
|
58
|
+
/** Fade in from black on mount and fade to black before calling `onExit`. */
|
|
59
|
+
curtain?: boolean;
|
|
51
60
|
};
|
|
52
61
|
|
|
53
62
|
export function Player({
|
|
@@ -62,9 +71,13 @@ export function Player({
|
|
|
62
71
|
slideId,
|
|
63
72
|
onSwitchSlide,
|
|
64
73
|
fullscreen = true,
|
|
74
|
+
curtain = false,
|
|
65
75
|
}: Props) {
|
|
66
76
|
const isMobile = useIsMobile();
|
|
67
77
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
78
|
+
const fade = curtain && !prefersReducedMotion;
|
|
79
|
+
const [curtainOpaque, setCurtainOpaque] = useState(fade);
|
|
80
|
+
const exitingRef = useRef(false);
|
|
68
81
|
const rootRef = useRef<HTMLDivElement | null>(null);
|
|
69
82
|
// Mirrored as state so descendants portaling *into* the player subtree
|
|
70
83
|
// (tooltips, popovers — the body is outside the fullscreen tree) re-render
|
|
@@ -93,6 +106,28 @@ export function Player({
|
|
|
93
106
|
const canPrev = index > 0;
|
|
94
107
|
const canNext = index < pages.length - 1;
|
|
95
108
|
|
|
109
|
+
// Stepping past either end nudges the slide like a rubber band so the
|
|
110
|
+
// press visibly registered; past the last slide a hint says how to leave.
|
|
111
|
+
const nudgeRef = useRef<HTMLDivElement | null>(null);
|
|
112
|
+
const [lastSlideHintAt, setLastSlideHintAt] = useState(0);
|
|
113
|
+
const bumpEdge = useCallback(
|
|
114
|
+
(direction: 'start' | 'end') => {
|
|
115
|
+
if (!controls) return;
|
|
116
|
+
if (direction === 'end') setLastSlideHintAt(Date.now());
|
|
117
|
+
if (prefersReducedMotion) return;
|
|
118
|
+
const offset = direction === 'end' ? -14 : 14;
|
|
119
|
+
nudgeRef.current?.animate(
|
|
120
|
+
[
|
|
121
|
+
{ transform: 'translateX(0)' },
|
|
122
|
+
{ transform: `translateX(${offset}px)`, offset: 0.3 },
|
|
123
|
+
{ transform: 'translateX(0)' },
|
|
124
|
+
],
|
|
125
|
+
{ duration: 360, easing: 'cubic-bezier(0.2, 0.8, 0.3, 1)' },
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
[controls, prefersReducedMotion],
|
|
129
|
+
);
|
|
130
|
+
|
|
96
131
|
const stepControllerRef = useRef<StepController | null>(null);
|
|
97
132
|
const [entryDirection, setEntryDirection] = useState<EntryDirection>('jump');
|
|
98
133
|
const [stepAggregate, setStepAggregate] = useState<StepAggregate>({
|
|
@@ -116,14 +151,34 @@ export function Player({
|
|
|
116
151
|
[index, onIndexChange],
|
|
117
152
|
);
|
|
118
153
|
|
|
154
|
+
const exitTimerRef = useRef<number | null>(null);
|
|
155
|
+
useEffect(
|
|
156
|
+
() => () => {
|
|
157
|
+
if (exitTimerRef.current !== null) window.clearTimeout(exitTimerRef.current);
|
|
158
|
+
},
|
|
159
|
+
[],
|
|
160
|
+
);
|
|
161
|
+
const requestExit = useCallback(() => {
|
|
162
|
+
if (!fade) {
|
|
163
|
+
onExit();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (exitingRef.current) return;
|
|
167
|
+
exitingRef.current = true;
|
|
168
|
+
setCurtainOpaque(true);
|
|
169
|
+
exitTimerRef.current = window.setTimeout(onExit, CURTAIN_FADE_MS);
|
|
170
|
+
}, [fade, onExit]);
|
|
171
|
+
|
|
119
172
|
const goPrev = useCallback(() => {
|
|
120
173
|
if (stepControllerRef.current?.retreat()) return;
|
|
121
174
|
if (index > 0) handleIndexChange(index - 1);
|
|
122
|
-
|
|
175
|
+
else bumpEdge('start');
|
|
176
|
+
}, [index, handleIndexChange, bumpEdge]);
|
|
123
177
|
const goNext = useCallback(() => {
|
|
124
178
|
if (stepControllerRef.current?.advance()) return;
|
|
125
179
|
if (index < pages.length - 1) handleIndexChange(index + 1);
|
|
126
|
-
|
|
180
|
+
else bumpEdge('end');
|
|
181
|
+
}, [index, pages.length, handleIndexChange, bumpEdge]);
|
|
127
182
|
|
|
128
183
|
const overlayActive = controls && (overviewOpen || helpOpen);
|
|
129
184
|
const overlayActiveRef = useRef(overlayActive);
|
|
@@ -178,8 +233,8 @@ export function Player({
|
|
|
178
233
|
useClickPageNavigation({
|
|
179
234
|
ref: rootRef,
|
|
180
235
|
enabled: !overlayActive,
|
|
181
|
-
canPrev,
|
|
182
|
-
canNext,
|
|
236
|
+
canPrev: canPrev || controls,
|
|
237
|
+
canNext: canNext || controls,
|
|
183
238
|
onPrev: goPrev,
|
|
184
239
|
onNext: goNext,
|
|
185
240
|
onViewportClick: controls && isMobile ? handleMobileViewportClick : undefined,
|
|
@@ -216,11 +271,33 @@ export function Player({
|
|
|
216
271
|
useEffect(() => {
|
|
217
272
|
if (!allowExit) return;
|
|
218
273
|
const onFsChange = () => {
|
|
219
|
-
if (!document.fullscreenElement && !windowedRef.current)
|
|
274
|
+
if (!document.fullscreenElement && !windowedRef.current) requestExit();
|
|
220
275
|
};
|
|
221
276
|
document.addEventListener('fullscreenchange', onFsChange);
|
|
222
277
|
return () => document.removeEventListener('fullscreenchange', onFsChange);
|
|
223
|
-
}, [
|
|
278
|
+
}, [requestExit, allowExit]);
|
|
279
|
+
|
|
280
|
+
// Wait out the browser's own fullscreen animation before revealing the
|
|
281
|
+
// first slide, otherwise the fade plays while the screen is still resizing.
|
|
282
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: runs once on mount
|
|
283
|
+
useEffect(() => {
|
|
284
|
+
if (!fade) return;
|
|
285
|
+
let cancelPaint = () => {};
|
|
286
|
+
const reveal = () => {
|
|
287
|
+
cancelPaint = afterPaint(() => {
|
|
288
|
+
if (!exitingRef.current) setCurtainOpaque(false);
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
if (!fullscreen || document.fullscreenElement) {
|
|
292
|
+
reveal();
|
|
293
|
+
return () => cancelPaint();
|
|
294
|
+
}
|
|
295
|
+
const cancelWait = whenFullscreenSettled(reveal);
|
|
296
|
+
return () => {
|
|
297
|
+
cancelWait();
|
|
298
|
+
cancelPaint();
|
|
299
|
+
};
|
|
300
|
+
}, []);
|
|
224
301
|
|
|
225
302
|
const toggleFullscreen = useCallback(() => {
|
|
226
303
|
setWindowed((w) => !w);
|
|
@@ -296,7 +373,7 @@ export function Player({
|
|
|
296
373
|
setBlackout(null);
|
|
297
374
|
return;
|
|
298
375
|
}
|
|
299
|
-
if (allowExit)
|
|
376
|
+
if (allowExit) requestExit();
|
|
300
377
|
return;
|
|
301
378
|
}
|
|
302
379
|
|
|
@@ -364,7 +441,7 @@ export function Player({
|
|
|
364
441
|
helpOpen,
|
|
365
442
|
blackout,
|
|
366
443
|
allowExit,
|
|
367
|
-
|
|
444
|
+
requestExit,
|
|
368
445
|
goNext,
|
|
369
446
|
goPrev,
|
|
370
447
|
handleIndexChange,
|
|
@@ -403,26 +480,29 @@ export function Player({
|
|
|
403
480
|
controls && (hideCursor ? 'cursor-none' : 'cursor-default'),
|
|
404
481
|
)}
|
|
405
482
|
>
|
|
406
|
-
<
|
|
407
|
-
|
|
483
|
+
<div ref={nudgeRef} className="h-full w-full">
|
|
484
|
+
<SlideCanvas flat design={design}>
|
|
485
|
+
{/* Keyed per deck so a presenter-driven deck switch cuts instead of
|
|
408
486
|
animating a transition between two unrelated decks. */}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
487
|
+
<SlideTransitionLayer
|
|
488
|
+
key={slideId}
|
|
489
|
+
pages={pages}
|
|
490
|
+
index={index}
|
|
491
|
+
total={pages.length}
|
|
492
|
+
moduleTransition={transition}
|
|
493
|
+
disabled={prefersReducedMotion}
|
|
494
|
+
stepControllerRef={stepControllerRef}
|
|
495
|
+
entryDirection={entryDirection}
|
|
496
|
+
onStepAggregateChange={handleAggregateChange}
|
|
497
|
+
/>
|
|
498
|
+
</SlideCanvas>
|
|
499
|
+
</div>
|
|
421
500
|
|
|
422
501
|
{controls && (
|
|
423
502
|
<div data-osd-chrome style={{ display: 'contents' }}>
|
|
424
503
|
<PresentProgressBar index={index} total={pages.length} visible={chromeVisible} />
|
|
425
504
|
<PresentBlackoutOverlay mode={blackout} />
|
|
505
|
+
<PresentLastSlideHint shownAt={lastSlideHintAt} />
|
|
426
506
|
<PresentJumpInput pageCount={pages.length} onJump={handleIndexChange} />
|
|
427
507
|
<PresentLaserPointer enabled={laser} />
|
|
428
508
|
<PresentControlBar
|
|
@@ -444,7 +524,7 @@ export function Player({
|
|
|
444
524
|
onPresenter={() => slideId && openPresenterWindow(slideId)}
|
|
445
525
|
onToggleFullscreen={toggleFullscreen}
|
|
446
526
|
onHelp={() => setHelpOpen(true)}
|
|
447
|
-
onExit={
|
|
527
|
+
onExit={requestExit}
|
|
448
528
|
/>
|
|
449
529
|
<OverviewGrid
|
|
450
530
|
pages={pages}
|
|
@@ -460,6 +540,8 @@ export function Player({
|
|
|
460
540
|
<PresentHelpOverlay open={helpOpen} onOpenChange={setHelpOpen} container={rootEl} />
|
|
461
541
|
</div>
|
|
462
542
|
)}
|
|
543
|
+
|
|
544
|
+
{fade && <PresentCurtain opaque={curtainOpaque} className="absolute z-[100]" />}
|
|
463
545
|
</div>
|
|
464
546
|
);
|
|
465
547
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
|
|
3
|
+
export const CURTAIN_FADE_MS = 400;
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
opaque: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function PresentCurtain({ opaque, className }: Props) {
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
aria-hidden
|
|
14
|
+
className={cn(
|
|
15
|
+
'pointer-events-none inset-0 bg-black transition-opacity ease-in-out',
|
|
16
|
+
opaque ? 'opacity-100' : 'opacity-0',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
style={{ transitionDuration: `${CURTAIN_FADE_MS}ms` }}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Two frames so the opaque state is painted before the fade starts;
|
|
25
|
+
// a single rAF can land in the same style recalc and skip the transition.
|
|
26
|
+
export function afterPaint(cb: () => void): () => void {
|
|
27
|
+
let inner = 0;
|
|
28
|
+
const outer = requestAnimationFrame(() => {
|
|
29
|
+
inner = requestAnimationFrame(cb);
|
|
30
|
+
});
|
|
31
|
+
return () => {
|
|
32
|
+
cancelAnimationFrame(outer);
|
|
33
|
+
cancelAnimationFrame(inner);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function whenFullscreenSettled(cb: () => void, maxWaitMs = 800): () => void {
|
|
38
|
+
let fired = false;
|
|
39
|
+
const timer = window.setTimeout(done, maxWaitMs);
|
|
40
|
+
document.addEventListener('fullscreenchange', done);
|
|
41
|
+
function done() {
|
|
42
|
+
if (fired) return;
|
|
43
|
+
fired = true;
|
|
44
|
+
cleanup();
|
|
45
|
+
cb();
|
|
46
|
+
}
|
|
47
|
+
function cleanup() {
|
|
48
|
+
window.clearTimeout(timer);
|
|
49
|
+
document.removeEventListener('fullscreenchange', done);
|
|
50
|
+
}
|
|
51
|
+
return cleanup;
|
|
52
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { usePanelMount } from '@/components/panel/panel-shell';
|
|
3
|
+
import { useLocale } from '@/lib/use-locale';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
const VISIBLE_MS = 1800;
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
shownAt: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function PresentLastSlideHint({ shownAt }: Props) {
|
|
13
|
+
const t = useLocale();
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!shownAt) return;
|
|
17
|
+
setOpen(true);
|
|
18
|
+
const id = window.setTimeout(() => setOpen(false), VISIBLE_MS);
|
|
19
|
+
return () => window.clearTimeout(id);
|
|
20
|
+
}, [shownAt]);
|
|
21
|
+
const { mounted, animVisible } = usePanelMount(open);
|
|
22
|
+
if (!mounted) return null;
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
role="status"
|
|
26
|
+
className={cn(
|
|
27
|
+
'pointer-events-none absolute bottom-10 left-1/2 z-30 -translate-x-1/2 rounded-full bg-black/70 px-3.5 py-1.5 text-[12px] text-white/85 shadow-lg backdrop-blur-md motion-safe:transition-[opacity,translate]',
|
|
28
|
+
animVisible
|
|
29
|
+
? 'opacity-100 motion-safe:duration-200'
|
|
30
|
+
: 'translate-y-1 opacity-0 motion-safe:duration-200',
|
|
31
|
+
)}
|
|
32
|
+
>
|
|
33
|
+
{t.present.lastSlideHint}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|