@lemonriver/core 0.3.0 → 0.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-Bqo69DWP.js → build-Nl7EeJ6x.js} +1 -1
- package/dist/cli/bin.js +3 -3
- package/dist/{config-teo3kWz7.d.ts → config-CYNOR93W.d.ts} +1 -1
- package/dist/{config-DJ5rkMMg.js → config-CpC0nM3r.js} +697 -2
- package/dist/{dev-B2FJD5bJ.js → dev-BB3THd5I.js} +1 -1
- 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-BGjgTg7H.js} +1 -1
- package/dist/{types-DFK02XVv.d.ts → types-tdaXSyah.d.ts} +1 -0
- 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 +1 -1
- package/src/agent/prompt.ts +2 -0
- package/src/app/components/agent/agent-panel.tsx +2 -0
- 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-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/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 +633 -0
- package/src/app/lemonriver/outline/model.ts +443 -0
- package/src/app/lemonriver/outline/outline-page.tsx +504 -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 +211 -0
- package/src/app/lemonriver/slide-extensions.tsx +31 -24
- package/src/app/lemonriver/text/en.ts +149 -0
- package/src/app/lemonriver/text/es.ts +148 -0
- package/src/app/lemonriver/text/ja.ts +150 -0
- package/src/app/lemonriver/text/text.test.ts +33 -0
- package/src/app/lemonriver/text/types.ts +169 -0
- package/src/app/lemonriver/text/zh-cn.ts +146 -0
- package/src/app/lemonriver/text/zh-tw.ts +146 -0
- package/src/app/lemonriver/theme/app.css +12 -1
- package/src/app/lemonriver/theme/pages.test.ts +4 -0
- package/src/app/lemonriver/theme/pages.ts +11 -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/routes/home.tsx +13 -5
- package/src/app/routes/slide.tsx +70 -13
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { V as PKG_NAMES } from "./update-DsxZBtwv.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-CpC0nM3r.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-CpC0nM3r.js";
|
|
3
3
|
import { mergeConfig, preview as preview$1 } from "vite";
|
|
4
4
|
//#region src/cli/preview.ts
|
|
5
5
|
async function preview(opts = {}) {
|
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-CpC0nM3r.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
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(' ');
|
|
@@ -48,6 +48,7 @@ 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';
|
|
51
52
|
import { Composer, ContextChip } from './composer';
|
|
52
53
|
import { ConnectView } from './connect-view';
|
|
53
54
|
import { HistoryView } from './history-view';
|
|
@@ -289,6 +290,7 @@ export function AgentPanel({
|
|
|
289
290
|
</div>
|
|
290
291
|
</header>
|
|
291
292
|
|
|
293
|
+
{context.slideId && <BuildTeam slideId={context.slideId} />}
|
|
292
294
|
{loading ? (
|
|
293
295
|
<p className="px-4 py-5 text-[12px] text-muted-foreground">{t.agent.statusLoading}…</p>
|
|
294
296
|
) : showConnect ? (
|
|
@@ -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
|
+
}
|
|
@@ -8,6 +8,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/comp
|
|
|
8
8
|
import { format, useLocale } from '@/lib/use-locale';
|
|
9
9
|
import { useRestartServer } from '@/lib/use-restart-server';
|
|
10
10
|
import { ThemeToggle } from '../../lemonriver/theme/theme-menu';
|
|
11
|
+
import { BetaBadge } from '../../lemonriver/update/beta-badge';
|
|
11
12
|
|
|
12
13
|
type UpdateCheck = { current: string; latest: string | null; outdated: boolean };
|
|
13
14
|
type UpdateStatus = 'idle' | 'running' | 'done' | 'error';
|
|
@@ -64,9 +65,13 @@ export function SidebarFooter() {
|
|
|
64
65
|
>
|
|
65
66
|
<span className="size-1.5 rounded-full bg-brand" aria-hidden />
|
|
66
67
|
{label}
|
|
68
|
+
<BetaBadge />
|
|
67
69
|
</button>
|
|
68
70
|
) : (
|
|
69
|
-
<span className="inline-flex cursor-default items-center gap-1.5">
|
|
71
|
+
<span className="inline-flex cursor-default items-center gap-1.5">
|
|
72
|
+
{label}
|
|
73
|
+
<BetaBadge />
|
|
74
|
+
</span>
|
|
70
75
|
);
|
|
71
76
|
|
|
72
77
|
return (
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { AgentActivity } from '@/lib/agent/use-agent';
|
|
3
|
-
import { Mascot, type MascotState } from '../brand/mascot';
|
|
3
|
+
import { HelperMascot, type HelperRole, Mascot, type MascotState } from '../brand/mascot';
|
|
4
|
+
import { useBuildOutline } from '../outline/use-build-driver';
|
|
4
5
|
import { useLrText } from '../text';
|
|
5
6
|
|
|
7
|
+
const REVIEW_ROLE: HelperRole = 'review';
|
|
8
|
+
|
|
6
9
|
const PHASE_STATE: Record<AgentActivity['phase'], MascotState> = {
|
|
7
10
|
thinking: 'thinking',
|
|
8
11
|
tool: 'working',
|
|
@@ -40,6 +43,18 @@ export function ResultLemon({ aborted }: { aborted: boolean }) {
|
|
|
40
43
|
/** The header of a question the agent asks: the design package's confirmation card. */
|
|
41
44
|
export function ConfirmWho() {
|
|
42
45
|
const lr = useLrText();
|
|
46
|
+
const outline = useBuildOutline();
|
|
47
|
+
if (outline?.state === 'building' && outline.stage === 'review') {
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
data-lr-confirm-who="review"
|
|
51
|
+
className="mb-2 flex items-center gap-2 px-1.5 text-[12.5px] font-semibold"
|
|
52
|
+
>
|
|
53
|
+
<HelperMascot role={REVIEW_ROLE} state="needs-you" size={36} />
|
|
54
|
+
{lr.feedback.confirmReview}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
43
58
|
return (
|
|
44
59
|
<div className="mb-2 flex items-center gap-2 px-1.5 text-[12.5px] font-semibold">
|
|
45
60
|
<Mascot state="needs-you" size={36} />
|