@open-slide/core 1.19.0 → 2.0.0-beta.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-CaV_vhIw.js → build-CfAxF6Dm.js} +2 -5
- package/dist/cli/bin.d.ts +1 -1
- package/dist/cli/bin.js +139 -13
- package/dist/{config-CDHB8Oow.d.ts → config-AtA2Bqtn.d.ts} +4 -4
- package/dist/{config-GA6NMgs_.js → config-C_VI2EpT.js} +545 -776
- package/dist/{design-cpzS8aud.js → design-Cpqx7SJs.js} +1 -2
- package/dist/{dev-D57ui2yV.js → dev-BChELmc-.js} +4 -7
- package/dist/index.d.ts +7 -37
- package/dist/index.js +51 -54
- package/dist/locale/index.d.ts +2 -8
- package/dist/locale/index.js +13 -3
- package/dist/{preview-D40Zw_o0.js → preview-CcCQa268.js} +3 -7
- package/dist/{types-8HghULIe.d.ts → types-BzPSOxe-.d.ts} +5 -9
- package/dist/vite/index.d.ts +1 -4
- package/dist/vite/index.js +2 -4
- package/dist/{format-74A3B6zu.js → zh-tw-BxZ_pYqe.js} +13 -49
- package/package.json +12 -12
- package/skills/create-slide/SKILL.md +4 -1
- package/skills/slide-authoring/SKILL.md +25 -2
- package/src/app/app.tsx +18 -15
- package/src/app/assets/open-slide.png +0 -0
- package/src/app/components/asset-view.tsx +46 -39
- package/src/app/components/command/command-menu.tsx +5 -1
- package/src/app/components/command/command.tsx +4 -2
- package/src/app/components/command/home-command-menu.tsx +6 -6
- package/src/app/components/export-progress-toast.tsx +80 -0
- package/src/app/components/history-provider.tsx +1 -5
- package/src/app/components/icon-tooltip.tsx +24 -15
- package/src/app/components/image-placeholder.tsx +4 -12
- package/src/app/components/inspector/asset-picker-dialog.tsx +24 -32
- package/src/app/components/inspector/comment-widget.tsx +33 -7
- package/src/app/components/inspector/image-crop-dialog.tsx +9 -6
- package/src/app/components/inspector/inline-text-editor.tsx +798 -0
- package/src/app/components/inspector/inspect-overlay.tsx +35 -76
- package/src/app/components/inspector/inspector-panel.tsx +31 -53
- package/src/app/components/inspector/inspector-provider.tsx +53 -36
- package/src/app/components/language-toggle.tsx +2 -3
- package/src/app/components/notes-drawer.tsx +4 -7
- package/src/app/components/overview-grid.tsx +15 -8
- package/src/app/components/panel/panel-shell.tsx +1 -3
- package/src/app/components/panel/save-card.tsx +12 -3
- package/src/app/components/player.tsx +5 -6
- package/src/app/components/present/blackout-overlay.tsx +16 -3
- package/src/app/components/present/control-bar.tsx +21 -13
- package/src/app/components/present/jump-input.tsx +27 -5
- package/src/app/components/present/laser-pointer.tsx +34 -11
- package/src/app/components/present/progress-bar.tsx +1 -1
- package/src/app/components/present/use-presenter-channel.ts +0 -1
- package/src/app/components/present/use-touch-swipe.ts +9 -2
- package/src/app/components/sidebar/folder-item.tsx +48 -21
- package/src/app/components/sidebar/icon-picker.tsx +1 -1
- package/src/app/components/sidebar/sidebar-footer.tsx +20 -7
- package/src/app/components/sidebar/sidebar.tsx +91 -64
- package/src/app/components/slide-canvas.tsx +2 -6
- package/src/app/components/slide-transition-layer.tsx +48 -76
- package/src/app/components/style-panel/design-provider.tsx +1 -14
- package/src/app/components/style-panel/style-panel.tsx +16 -12
- package/src/app/components/style-panel/use-design.ts +1 -28
- package/src/app/components/theme-toggle.tsx +4 -5
- package/src/app/components/themes/theme-detail.tsx +11 -8
- package/src/app/components/themes/themes-gallery.tsx +13 -8
- package/src/app/components/thumbnail-rail.tsx +14 -15
- package/src/app/index.html +21 -0
- package/src/app/lib/assets.ts +6 -7
- package/src/app/lib/dom.ts +42 -0
- package/src/app/lib/export-html.ts +10 -25
- package/src/app/lib/export-pdf.ts +11 -28
- package/src/app/lib/export-pptx.ts +6 -36
- package/src/app/lib/folders.ts +51 -46
- package/src/app/lib/inspector/inline-text.ts +31 -0
- package/src/app/lib/inspector/pick-target.ts +38 -0
- package/src/app/lib/inspector/use-comments.ts +1 -1
- package/src/app/lib/keys.ts +18 -0
- package/src/app/lib/last-home-location.ts +18 -0
- package/src/app/lib/print-ready.ts +2 -4
- package/src/app/lib/slides.ts +7 -4
- package/src/app/lib/text-diff.ts +19 -0
- package/src/app/lib/use-click-page-navigation.ts +2 -6
- package/src/app/lib/use-is-mobile.ts +2 -14
- package/src/app/lib/use-media-query.ts +20 -0
- package/src/app/lib/use-prefers-reduced-motion.ts +5 -13
- package/src/app/lib/use-slide-module.ts +1 -1
- package/src/app/lib/use-wheel-page-navigation.ts +1 -1
- package/src/app/lib/utils.test.ts +25 -1
- package/src/app/lib/utils.ts +8 -0
- package/src/app/routes/home-shell.tsx +71 -64
- package/src/app/routes/home.tsx +50 -58
- package/src/app/routes/presenter.tsx +14 -23
- package/src/app/routes/slide.tsx +90 -77
- package/src/app/routes/themes.tsx +7 -8
- package/src/app/styles.css +40 -44
- package/src/locale/en.ts +2 -7
- package/src/locale/ja.ts +2 -7
- package/src/locale/types.ts +2 -7
- package/src/locale/zh-cn.ts +2 -7
- package/src/locale/zh-tw.ts +2 -7
- package/dist/sync-BCJDRIqo.js +0 -139
- package/dist/sync-j9_QPovT.js +0 -3
- package/src/app/components/pdf-progress-toast.tsx +0 -32
- package/src/app/components/pptx-progress-toast.tsx +0 -32
package/src/app/routes/slide.tsx
CHANGED
|
@@ -16,12 +16,21 @@ import {
|
|
|
16
16
|
Presentation,
|
|
17
17
|
Terminal,
|
|
18
18
|
} from 'lucide-react';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
type ReactElement,
|
|
21
|
+
type RefObject,
|
|
22
|
+
useCallback,
|
|
23
|
+
useEffect,
|
|
24
|
+
useMemo,
|
|
25
|
+
useRef,
|
|
26
|
+
useState,
|
|
27
|
+
} from 'react';
|
|
20
28
|
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
|
21
29
|
import { toast } from 'sonner';
|
|
22
30
|
import { AssetView } from '@/components/asset-view';
|
|
23
31
|
import { HistoryProvider } from '@/components/history-provider';
|
|
24
32
|
import { CommentWidget } from '@/components/inspector/comment-widget';
|
|
33
|
+
import { InlineEditLayer } from '@/components/inspector/inline-text-editor';
|
|
25
34
|
import { InspectOverlay } from '@/components/inspector/inspect-overlay';
|
|
26
35
|
import { InspectorPanel } from '@/components/inspector/inspector-panel';
|
|
27
36
|
import {
|
|
@@ -44,6 +53,8 @@ import {
|
|
|
44
53
|
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|
45
54
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
46
55
|
import { useFolders } from '@/lib/folders';
|
|
56
|
+
import { hasModifier, isBackwardKey, isForwardKey, isTypingTarget } from '@/lib/keys';
|
|
57
|
+
import { readLastHomeLocation } from '@/lib/last-home-location';
|
|
47
58
|
import { useAgentSocketConnected } from '@/lib/use-agent-socket';
|
|
48
59
|
import { useClickPageNavigation } from '@/lib/use-click-page-navigation';
|
|
49
60
|
import { useIsMobile } from '@/lib/use-is-mobile';
|
|
@@ -51,18 +62,17 @@ import { format, useLocale } from '@/lib/use-locale';
|
|
|
51
62
|
import { useWheelPageNavigation } from '@/lib/use-wheel-page-navigation';
|
|
52
63
|
import { cn } from '@/lib/utils';
|
|
53
64
|
import { SlideCommandMenu } from '../components/command/slide-command-menu';
|
|
65
|
+
import { PdfProgressToast, PptxProgressToast } from '../components/export-progress-toast';
|
|
54
66
|
import { NotesDrawer } from '../components/notes-drawer';
|
|
55
67
|
import { OverviewGrid } from '../components/overview-grid';
|
|
56
|
-
import { PdfProgressToast } from '../components/pdf-progress-toast';
|
|
57
68
|
import { openPresenterWindow, Player } from '../components/player';
|
|
58
|
-
import { PptxProgressToast } from '../components/pptx-progress-toast';
|
|
59
69
|
import { SlideCanvas } from '../components/slide-canvas';
|
|
60
70
|
import { isDeckWarmed, markDeckWarmed, SlidePreloadLayer } from '../components/slide-preload-layer';
|
|
61
71
|
import { SlideTransitionLayer } from '../components/slide-transition-layer';
|
|
62
72
|
import { type ThumbnailActions, ThumbnailRail } from '../components/thumbnail-rail';
|
|
63
73
|
import { exportSlideAsHtml } from '../lib/export-html';
|
|
64
|
-
import { exportSlideAsPdf, isSafari } from '../lib/export-pdf';
|
|
65
|
-
import { exportSlideAsImagePptx } from '../lib/export-pptx';
|
|
74
|
+
import { exportSlideAsPdf, isSafari, type PdfExportProgress } from '../lib/export-pdf';
|
|
75
|
+
import { exportSlideAsImagePptx, type PptxExportProgress } from '../lib/export-pptx';
|
|
66
76
|
import { remapNotesSessionCacheAfterReorder } from '../lib/inspector/use-notes';
|
|
67
77
|
import type { SlideModule } from '../lib/sdk';
|
|
68
78
|
import { usePrefersReducedMotion } from '../lib/use-prefers-reduced-motion';
|
|
@@ -76,6 +86,16 @@ export function Slide() {
|
|
|
76
86
|
const { slideId = '' } = useParams();
|
|
77
87
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
78
88
|
const navigate = useNavigate();
|
|
89
|
+
// react-router records its entry index in history.state; going back is only
|
|
90
|
+
// safe when we actually pushed an entry, otherwise land on the last home view.
|
|
91
|
+
const goBack = useCallback(() => {
|
|
92
|
+
const idx = (window.history.state as { idx?: number } | null)?.idx ?? 0;
|
|
93
|
+
if (idx > 0) {
|
|
94
|
+
navigate(-1);
|
|
95
|
+
} else {
|
|
96
|
+
navigate(readLastHomeLocation(), { replace: true });
|
|
97
|
+
}
|
|
98
|
+
}, [navigate]);
|
|
79
99
|
const { slide, error } = useSlideModule(slideId);
|
|
80
100
|
const [playMode, setPlayMode] = useState<'window' | 'fullscreen' | null>(null);
|
|
81
101
|
// Last deck the Player showed. During a presenter-driven deck switch the
|
|
@@ -272,9 +292,9 @@ export function Slide() {
|
|
|
272
292
|
// page-nav handler too would race it and skip <Steps> reveals, so bail out.
|
|
273
293
|
if (playMode || !showSlideUi) return;
|
|
274
294
|
const onKey = (e: KeyboardEvent) => {
|
|
275
|
-
if (e.target
|
|
295
|
+
if (isTypingTarget(e.target)) return;
|
|
276
296
|
// Letter shortcuts only fire bare so browser combos (Cmd/Ctrl-P, ⌘F…) stay intact.
|
|
277
|
-
if (e
|
|
297
|
+
if (hasModifier(e)) return;
|
|
278
298
|
// Toggle overview from either state — the overview's own capture-phase
|
|
279
299
|
// handler doesn't consume O, so this stays consistent open ↔ closed.
|
|
280
300
|
if (e.key === 'o' || e.key === 'O') {
|
|
@@ -285,17 +305,12 @@ export function Slide() {
|
|
|
285
305
|
// Once overview owns focus, swallow everything else here — its
|
|
286
306
|
// capture-phase listener drives the focused thumbnail.
|
|
287
307
|
if (overviewOpen) return;
|
|
288
|
-
if (
|
|
289
|
-
e.key === 'ArrowRight' ||
|
|
290
|
-
e.key === 'ArrowDown' ||
|
|
291
|
-
e.key === ' ' ||
|
|
292
|
-
e.key === 'PageDown'
|
|
293
|
-
) {
|
|
308
|
+
if (isForwardKey(e)) {
|
|
294
309
|
e.preventDefault();
|
|
295
310
|
goTo(index + 1);
|
|
296
311
|
return;
|
|
297
312
|
}
|
|
298
|
-
if (e
|
|
313
|
+
if (isBackwardKey(e)) {
|
|
299
314
|
e.preventDefault();
|
|
300
315
|
goTo(index - 1);
|
|
301
316
|
return;
|
|
@@ -487,58 +502,56 @@ export function Slide() {
|
|
|
487
502
|
}
|
|
488
503
|
};
|
|
489
504
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
505
|
+
// One toast id drives the whole export: the same id is re-rendered on every
|
|
506
|
+
// progress tick, swapped for the error toast on failure, then dismissed.
|
|
507
|
+
const runProgressExport = async <P,>(opts: {
|
|
508
|
+
kind: string;
|
|
509
|
+
initial: P;
|
|
510
|
+
failedMessage: string;
|
|
511
|
+
renderToast: (progress: P) => ReactElement;
|
|
512
|
+
run: (onProgress: (progress: P) => void) => Promise<void>;
|
|
513
|
+
}) => {
|
|
496
514
|
setExporting(true);
|
|
497
|
-
const toastId =
|
|
498
|
-
|
|
499
|
-
() => (
|
|
500
|
-
|
|
501
|
-
progress={{ phase: 'processing', current: 0, total: pages.length, percent: 0 }}
|
|
502
|
-
/>
|
|
503
|
-
),
|
|
504
|
-
{ id: toastId, duration: Infinity },
|
|
505
|
-
);
|
|
515
|
+
const toastId = `${opts.kind}-export-${slideId}`;
|
|
516
|
+
const show = (progress: P) =>
|
|
517
|
+
toast.custom(() => opts.renderToast(progress), { id: toastId, duration: Infinity });
|
|
518
|
+
show(opts.initial);
|
|
506
519
|
try {
|
|
507
|
-
await
|
|
508
|
-
|
|
509
|
-
});
|
|
520
|
+
await opts.run(show);
|
|
521
|
+
toast.dismiss(toastId);
|
|
510
522
|
} catch (err) {
|
|
511
|
-
console.error(
|
|
512
|
-
toast
|
|
523
|
+
console.error(`[open-slide] ${opts.kind} export failed`, err);
|
|
524
|
+
// Reuses the progress toast's id, so it must outlive this handler.
|
|
525
|
+
toast.error(opts.failedMessage, { id: toastId, duration: 4000 });
|
|
513
526
|
} finally {
|
|
514
527
|
setExporting(false);
|
|
515
|
-
toast.dismiss(toastId);
|
|
516
528
|
}
|
|
517
529
|
};
|
|
518
530
|
|
|
519
|
-
const
|
|
531
|
+
const exportPdf = async () => {
|
|
520
532
|
if (!slide || exporting) return;
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
() => (
|
|
525
|
-
<PptxProgressToast
|
|
526
|
-
progress={{ phase: 'processing', current: 0, total: pages.length, percent: 0 }}
|
|
527
|
-
/>
|
|
528
|
-
),
|
|
529
|
-
{ id: toastId, duration: Infinity },
|
|
530
|
-
);
|
|
531
|
-
try {
|
|
532
|
-
await exportSlideAsImagePptx(slide, slideId, (p) => {
|
|
533
|
-
toast.custom(() => <PptxProgressToast progress={p} />, { id: toastId, duration: Infinity });
|
|
534
|
-
});
|
|
535
|
-
} catch (err) {
|
|
536
|
-
console.error('[open-slide] image pptx export failed', err);
|
|
537
|
-
toast.error(t.slide.imagePptxExportFailed, { id: toastId, duration: 4000 });
|
|
538
|
-
} finally {
|
|
539
|
-
setExporting(false);
|
|
540
|
-
toast.dismiss(toastId);
|
|
533
|
+
if (isSafari()) {
|
|
534
|
+
toast.error(t.slide.pdfExportSafariUnsupported, { duration: 5000 });
|
|
535
|
+
return;
|
|
541
536
|
}
|
|
537
|
+
await runProgressExport<PdfExportProgress>({
|
|
538
|
+
kind: 'pdf',
|
|
539
|
+
initial: { phase: 'processing', current: 0, total: pages.length, percent: 0 },
|
|
540
|
+
failedMessage: t.slide.pdfExportFailed,
|
|
541
|
+
renderToast: (progress) => <PdfProgressToast progress={progress} />,
|
|
542
|
+
run: (onProgress) => exportSlideAsPdf(slide, slideId, onProgress),
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
const exportImagePptx = async () => {
|
|
547
|
+
if (!slide || exporting) return;
|
|
548
|
+
await runProgressExport<PptxExportProgress>({
|
|
549
|
+
kind: 'pptx',
|
|
550
|
+
initial: { phase: 'processing', current: 0, total: pages.length, percent: 0 },
|
|
551
|
+
failedMessage: t.slide.imagePptxExportFailed,
|
|
552
|
+
renderToast: (progress) => <PptxProgressToast progress={progress} />,
|
|
553
|
+
run: (onProgress) => exportSlideAsImagePptx(slide, slideId, onProgress),
|
|
554
|
+
});
|
|
542
555
|
};
|
|
543
556
|
|
|
544
557
|
const exportMenuItems = (
|
|
@@ -589,19 +602,20 @@ export function Slide() {
|
|
|
589
602
|
<HistoryProvider>
|
|
590
603
|
<InspectorProvider slideId={slideId} pageIndex={index}>
|
|
591
604
|
<SelectionReporter />
|
|
592
|
-
<div className="flex h-dvh flex-col overflow-hidden bg-
|
|
593
|
-
{/*
|
|
594
|
-
<header className="relative flex h-12 shrink-0 items-center gap-2
|
|
605
|
+
<div className="flex h-dvh flex-col overflow-hidden bg-sidebar text-foreground">
|
|
606
|
+
{/* Toolbar sits directly on the chrome ground — three zones, mono-folio center */}
|
|
607
|
+
<header className="relative flex h-12 shrink-0 items-center gap-2 px-2 md:px-3">
|
|
595
608
|
<div className="flex flex-1 items-center gap-1.5 md:flex-none md:gap-2">
|
|
596
609
|
{showSlideBrowser && (
|
|
597
|
-
<
|
|
598
|
-
|
|
610
|
+
<button
|
|
611
|
+
type="button"
|
|
612
|
+
onClick={goBack}
|
|
599
613
|
aria-label={t.slide.backToHome}
|
|
600
614
|
title={t.slide.home}
|
|
601
615
|
className={buttonVariants({ variant: 'ghost', size: 'icon-sm' })}
|
|
602
616
|
>
|
|
603
617
|
<ChevronLeft className="size-4" />
|
|
604
|
-
</
|
|
618
|
+
</button>
|
|
605
619
|
)}
|
|
606
620
|
<span aria-hidden className="mx-0.5 hidden h-5 w-px bg-hairline md:block" />
|
|
607
621
|
{import.meta.env.DEV && (
|
|
@@ -678,7 +692,7 @@ export function Slide() {
|
|
|
678
692
|
)}
|
|
679
693
|
>
|
|
680
694
|
{exporting ? (
|
|
681
|
-
<Loader2 className="size-4 animate-spin" />
|
|
695
|
+
<Loader2 className="size-4 animate-spin motion-reduce:animate-none" />
|
|
682
696
|
) : (
|
|
683
697
|
<Download className="size-4" />
|
|
684
698
|
)}
|
|
@@ -701,7 +715,7 @@ export function Slide() {
|
|
|
701
715
|
)}
|
|
702
716
|
>
|
|
703
717
|
{exporting ? (
|
|
704
|
-
<Loader2 className="size-4 animate-spin" />
|
|
718
|
+
<Loader2 className="size-4 animate-spin motion-reduce:animate-none" />
|
|
705
719
|
) : (
|
|
706
720
|
<MoreHorizontal className="size-4" />
|
|
707
721
|
)}
|
|
@@ -735,9 +749,6 @@ export function Slide() {
|
|
|
735
749
|
>
|
|
736
750
|
<Play className="size-3.5 fill-current" />
|
|
737
751
|
<span className="hidden md:inline">{t.slide.present}</span>
|
|
738
|
-
<kbd className="ml-1 hidden rounded-[3px] bg-brand-foreground/15 px-1 font-mono text-[9.5px] tracking-[0.04em] md:inline">
|
|
739
|
-
F
|
|
740
|
-
</kbd>
|
|
741
752
|
</Button>
|
|
742
753
|
<DropdownMenu>
|
|
743
754
|
<DropdownMenuTrigger
|
|
@@ -780,7 +791,7 @@ export function Slide() {
|
|
|
780
791
|
</header>
|
|
781
792
|
|
|
782
793
|
{view === 'assets' ? (
|
|
783
|
-
<div className="min-h-0 flex-1">
|
|
794
|
+
<div className="min-h-0 flex-1 overflow-hidden md:mx-2 md:mb-2 md:rounded-[10px] md:bg-background md:shadow-edge md:ring-1 md:ring-foreground/[0.06]">
|
|
784
795
|
<AssetView slideId={slideId} />
|
|
785
796
|
</div>
|
|
786
797
|
) : (
|
|
@@ -801,7 +812,7 @@ export function Slide() {
|
|
|
801
812
|
ref={slideViewportRef}
|
|
802
813
|
data-inspector-root
|
|
803
814
|
data-slide-id={slideId}
|
|
804
|
-
className="relative min-h-0 min-w-0 flex-1 bg-
|
|
815
|
+
className="relative min-h-0 min-w-0 flex-1 bg-background p-2 md:mx-2 md:mb-2 md:rounded-[10px] md:p-10 md:shadow-edge md:ring-1 md:ring-foreground/[0.06]"
|
|
805
816
|
>
|
|
806
817
|
<SlideViewportNavigation
|
|
807
818
|
targetRef={slideViewportRef}
|
|
@@ -820,6 +831,7 @@ export function Slide() {
|
|
|
820
831
|
/>
|
|
821
832
|
</SlideCanvas>
|
|
822
833
|
<InspectOverlay />
|
|
834
|
+
<InlineEditLayer />
|
|
823
835
|
<SaveBar />
|
|
824
836
|
{import.meta.env.DEV && <CommentWidget />}
|
|
825
837
|
</main>
|
|
@@ -1008,7 +1020,7 @@ function ResizableRail(props: {
|
|
|
1008
1020
|
<span
|
|
1009
1021
|
aria-hidden
|
|
1010
1022
|
className={cn(
|
|
1011
|
-
'pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-brand opacity-0 transition-opacity',
|
|
1023
|
+
'pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-brand opacity-0 transition-opacity duration-150',
|
|
1012
1024
|
'group-hover/resize:opacity-100 group-focus-visible/resize:opacity-100',
|
|
1013
1025
|
resizing && 'opacity-100',
|
|
1014
1026
|
)}
|
|
@@ -1028,12 +1040,12 @@ function AgentConnectedBadge() {
|
|
|
1028
1040
|
render={
|
|
1029
1041
|
<button
|
|
1030
1042
|
type="button"
|
|
1031
|
-
className="ml-1 flex shrink-0 cursor-help items-center gap-1.5 rounded-[3px] border border-hairline bg-card px-1.5 py-0.5 text-[10.5px] text-foreground/85 outline-none focus-visible:ring-2 focus-visible:ring-ring/30"
|
|
1043
|
+
className="ml-1 flex shrink-0 cursor-help items-center gap-1.5 rounded-[3px] border border-hairline bg-card px-1.5 py-0.5 text-[10.5px] text-foreground/85 outline-none transition-colors duration-150 hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/30"
|
|
1032
1044
|
>
|
|
1033
1045
|
<span aria-hidden className="relative flex size-1.5 items-center justify-center">
|
|
1034
1046
|
{connected ? (
|
|
1035
1047
|
<>
|
|
1036
|
-
<span className="absolute inline-flex size-full
|
|
1048
|
+
<span className="absolute inline-flex size-full rounded-full bg-emerald-500 opacity-60 motion-safe:animate-ping" />
|
|
1037
1049
|
<span className="relative inline-flex size-1.5 rounded-full bg-emerald-500" />
|
|
1038
1050
|
</>
|
|
1039
1051
|
) : (
|
|
@@ -1080,18 +1092,19 @@ function SlideViewportNavigation({
|
|
|
1080
1092
|
canPrev,
|
|
1081
1093
|
canNext,
|
|
1082
1094
|
}: {
|
|
1083
|
-
targetRef: RefObject<HTMLElement>;
|
|
1095
|
+
targetRef: RefObject<HTMLElement | null>;
|
|
1084
1096
|
onPrev: () => void;
|
|
1085
1097
|
onNext: () => void;
|
|
1086
1098
|
canPrev: boolean;
|
|
1087
1099
|
canNext: boolean;
|
|
1088
1100
|
}) {
|
|
1089
|
-
const { active } = useInspector();
|
|
1101
|
+
const { active, inlineEdit } = useInspector();
|
|
1090
1102
|
const isMobile = useIsMobile();
|
|
1103
|
+
const editing = !!inlineEdit;
|
|
1091
1104
|
|
|
1092
1105
|
useWheelPageNavigation({
|
|
1093
1106
|
ref: targetRef,
|
|
1094
|
-
enabled: !active,
|
|
1107
|
+
enabled: !active && !editing,
|
|
1095
1108
|
canPrev,
|
|
1096
1109
|
canNext,
|
|
1097
1110
|
onPrev,
|
|
@@ -1103,7 +1116,7 @@ function SlideViewportNavigation({
|
|
|
1103
1116
|
// zones). Interactive slide content keeps its tap via the hook's passthrough.
|
|
1104
1117
|
useClickPageNavigation({
|
|
1105
1118
|
ref: targetRef,
|
|
1106
|
-
enabled: isMobile && !active,
|
|
1119
|
+
enabled: isMobile && !active && !editing,
|
|
1107
1120
|
edgeRatio: 0.18,
|
|
1108
1121
|
canPrev,
|
|
1109
1122
|
canNext,
|
|
@@ -1215,7 +1228,7 @@ function InlineTitleEditor({
|
|
|
1215
1228
|
onClick={() => setEditing(true)}
|
|
1216
1229
|
aria-label={t.slide.renameSlide}
|
|
1217
1230
|
className={cn(
|
|
1218
|
-
'min-w-0 max-w-full cursor-text rounded-[5px] border border-transparent px-2 py-0.5 transition-colors',
|
|
1231
|
+
'min-w-0 max-w-full cursor-text rounded-[5px] border border-transparent px-2 py-0.5 transition-colors duration-100',
|
|
1219
1232
|
'hover:border-foreground/30 hover:bg-card focus-visible:border-foreground/30 focus-visible:bg-card focus-visible:outline-none',
|
|
1220
1233
|
)}
|
|
1221
1234
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useNavigate, useParams } from 'react-router-dom';
|
|
2
2
|
import { useLocale } from '@/lib/use-locale';
|
|
3
|
-
import {
|
|
3
|
+
import { pad2 } from '@/lib/utils';
|
|
4
|
+
import { SystemViewIcon } from '../components/sidebar/folder-item';
|
|
4
5
|
import { ThemeDetail } from '../components/themes/theme-detail';
|
|
5
6
|
import { ThemesGallery } from '../components/themes/themes-gallery';
|
|
6
7
|
import { themes as themeRegistry } from '../lib/themes';
|
|
@@ -10,15 +11,13 @@ export function ThemesGalleryPage() {
|
|
|
10
11
|
const t = useLocale();
|
|
11
12
|
return (
|
|
12
13
|
<>
|
|
13
|
-
<header className="mb-
|
|
14
|
-
<div className="flex flex-wrap items-center gap-
|
|
15
|
-
<
|
|
16
|
-
<h1 className="font-heading text-[
|
|
14
|
+
<header className="mb-6 md:mb-8">
|
|
15
|
+
<div className="flex flex-wrap items-center gap-2.5">
|
|
16
|
+
<SystemViewIcon kind="themes" className="text-muted-foreground" />
|
|
17
|
+
<h1 className="font-heading text-[19px] font-semibold leading-none tracking-[-0.015em] md:text-[21px]">
|
|
17
18
|
{t.themes.title}
|
|
18
19
|
</h1>
|
|
19
|
-
<span className="folio ml-
|
|
20
|
-
{themeRegistry.length.toString().padStart(2, '0')}
|
|
21
|
-
</span>
|
|
20
|
+
<span className="folio ml-0.5">{pad2(themeRegistry.length)}</span>
|
|
22
21
|
</div>
|
|
23
22
|
</header>
|
|
24
23
|
<ThemesGallery onOpen={(id) => navigate(`/themes/${encodeURIComponent(id)}`)} />
|
package/src/app/styles.css
CHANGED
|
@@ -13,19 +13,8 @@
|
|
|
13
13
|
serif;
|
|
14
14
|
--font-mono: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo", "Cascadia Code", monospace;
|
|
15
15
|
|
|
16
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
17
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
18
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
19
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
20
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
21
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
22
16
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
23
17
|
--color-sidebar: var(--sidebar);
|
|
24
|
-
--color-chart-5: var(--chart-5);
|
|
25
|
-
--color-chart-4: var(--chart-4);
|
|
26
|
-
--color-chart-3: var(--chart-3);
|
|
27
|
-
--color-chart-2: var(--chart-2);
|
|
28
|
-
--color-chart-1: var(--chart-1);
|
|
29
18
|
--color-ring: var(--ring);
|
|
30
19
|
--color-input: var(--input);
|
|
31
20
|
--color-border: var(--border);
|
|
@@ -58,6 +47,10 @@
|
|
|
58
47
|
--radius-3xl: calc(var(--radius) * 2.2);
|
|
59
48
|
--radius-4xl: calc(var(--radius) * 2.6);
|
|
60
49
|
|
|
50
|
+
/* House motion curve — one strong ease-out for every chrome entrance,
|
|
51
|
+
instead of per-file cubic-bezier literals. */
|
|
52
|
+
--ease-swift: cubic-bezier(0.22, 1, 0.36, 1);
|
|
53
|
+
|
|
61
54
|
--shadow-edge: 0 0 0 0.5px oklch(0 0 0 / 0.06), 0 1px 0 oklch(0 0 0 / 0.025);
|
|
62
55
|
--shadow-floating:
|
|
63
56
|
0 0 0 0.5px oklch(0 0 0 / 0.08), 0 1px 1px oklch(0 0 0 / 0.04),
|
|
@@ -68,6 +61,9 @@
|
|
|
68
61
|
}
|
|
69
62
|
|
|
70
63
|
:root {
|
|
64
|
+
/* Runtime copy of the @theme token for inline style/JS consumers. */
|
|
65
|
+
--ease-swift: cubic-bezier(0.22, 1, 0.36, 1);
|
|
66
|
+
|
|
71
67
|
/* Pure neutral ramp — zero chroma, flat surfaces, hairline borders.
|
|
72
68
|
Near-white background with white cards floating on a slightly
|
|
73
69
|
recessed canvas. */
|
|
@@ -101,29 +97,21 @@
|
|
|
101
97
|
--brand-foreground: oklch(0.985 0 0);
|
|
102
98
|
--brand-soft: oklch(0.6 0.2 25 / 0.1);
|
|
103
99
|
|
|
104
|
-
--chart-1: oklch(0.6 0.2 25);
|
|
105
|
-
--chart-2: oklch(0.55 0.16 250);
|
|
106
|
-
--chart-3: oklch(0.55 0.15 285);
|
|
107
|
-
--chart-4: oklch(0.6 0.13 160);
|
|
108
|
-
--chart-5: oklch(0.5 0 0);
|
|
109
|
-
|
|
110
100
|
/* Tight, considered radius — drops the trendy 10px squish for 6px crisp. */
|
|
111
101
|
--radius: 0.375rem;
|
|
112
102
|
|
|
113
|
-
--sidebar
|
|
103
|
+
/* Chrome ground — matches --canvas so sidebar, rails, and panels sit on
|
|
104
|
+
one continuous surface; content floats above it as elevated cards. */
|
|
105
|
+
--sidebar: oklch(0.975 0 0);
|
|
114
106
|
--sidebar-foreground: oklch(0.185 0 0);
|
|
115
|
-
--sidebar-primary: oklch(0.185 0 0);
|
|
116
|
-
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
117
|
-
--sidebar-accent: oklch(0.94 0 0);
|
|
118
|
-
--sidebar-accent-foreground: oklch(0.185 0 0);
|
|
119
|
-
--sidebar-border: oklch(0.905 0 0);
|
|
120
|
-
--sidebar-ring: oklch(0.6 0.2 25);
|
|
121
107
|
}
|
|
122
108
|
|
|
123
109
|
.dark {
|
|
124
|
-
--
|
|
110
|
+
/* Lifted well above the near-black chrome ground (--sidebar 0.1) so the
|
|
111
|
+
elevated content cards read at a glance on dim displays. */
|
|
112
|
+
--background: oklch(0.175 0 0);
|
|
125
113
|
--foreground: oklch(0.93 0 0);
|
|
126
|
-
--canvas: oklch(0.
|
|
114
|
+
--canvas: oklch(0.1 0 0);
|
|
127
115
|
|
|
128
116
|
--card: oklch(0.19 0 0);
|
|
129
117
|
--card-foreground: oklch(0.93 0 0);
|
|
@@ -149,20 +137,8 @@
|
|
|
149
137
|
--brand-foreground: oklch(0.985 0 0);
|
|
150
138
|
--brand-soft: oklch(0.63 0.2 25 / 0.16);
|
|
151
139
|
|
|
152
|
-
--
|
|
153
|
-
--chart-2: oklch(0.65 0.15 250);
|
|
154
|
-
--chart-3: oklch(0.65 0.14 285);
|
|
155
|
-
--chart-4: oklch(0.7 0.13 160);
|
|
156
|
-
--chart-5: oklch(0.65 0 0);
|
|
157
|
-
|
|
158
|
-
--sidebar: oklch(0.17 0 0);
|
|
140
|
+
--sidebar: oklch(0.1 0 0);
|
|
159
141
|
--sidebar-foreground: oklch(0.93 0 0);
|
|
160
|
-
--sidebar-primary: oklch(0.925 0 0);
|
|
161
|
-
--sidebar-primary-foreground: oklch(0.17 0 0);
|
|
162
|
-
--sidebar-accent: oklch(0.26 0 0);
|
|
163
|
-
--sidebar-accent-foreground: oklch(0.93 0 0);
|
|
164
|
-
--sidebar-border: oklch(1 0 0 / 0.1);
|
|
165
|
-
--sidebar-ring: oklch(0.63 0.19 25);
|
|
166
142
|
}
|
|
167
143
|
|
|
168
144
|
/* Tabular numerics — pages, counts, hex values, slider readouts.
|
|
@@ -214,17 +190,37 @@
|
|
|
214
190
|
letter-spacing: 0.08em;
|
|
215
191
|
}
|
|
216
192
|
|
|
217
|
-
/* Hairline divider — 0.5px on retina, snaps to 1px elsewhere. */
|
|
218
|
-
.hairline {
|
|
219
|
-
background: var(--hairline);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
193
|
/* Numeric folio-style page count. */
|
|
223
194
|
.folio {
|
|
224
195
|
@apply nums font-mono text-[10.5px] tracking-[0.08em] text-muted-foreground;
|
|
225
196
|
}
|
|
226
197
|
}
|
|
227
198
|
|
|
199
|
+
/*
|
|
200
|
+
* Grid entrance — a quiet rise used by card grids. Pair with a small
|
|
201
|
+
* per-item animation-delay for a capped stagger.
|
|
202
|
+
*/
|
|
203
|
+
@keyframes osd-rise-in {
|
|
204
|
+
from {
|
|
205
|
+
opacity: 0;
|
|
206
|
+
transform: translateY(4px);
|
|
207
|
+
}
|
|
208
|
+
to {
|
|
209
|
+
opacity: 1;
|
|
210
|
+
transform: none;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.rise-in {
|
|
215
|
+
animation: osd-rise-in 350ms var(--ease-swift) both;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@media (prefers-reduced-motion: reduce) {
|
|
219
|
+
.rise-in {
|
|
220
|
+
animation: none;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
228
224
|
/*
|
|
229
225
|
* Comment input cue — kept from the original design but retoned to match
|
|
230
226
|
* the new palette (warm vermillion + amber instead of the AI-classic
|
package/src/locale/en.ts
CHANGED
|
@@ -17,16 +17,11 @@ export const en: Locale = {
|
|
|
17
17
|
loadFailed: 'Load failed',
|
|
18
18
|
failedToLoadSlide: 'Failed to load slide',
|
|
19
19
|
home: 'Home',
|
|
20
|
-
backToHome: 'Back to home',
|
|
21
|
-
preview: 'Preview',
|
|
22
20
|
add: 'Add',
|
|
23
21
|
done: 'Done',
|
|
24
22
|
tryAgain: 'Try again',
|
|
25
23
|
undo: 'Undo',
|
|
26
24
|
redo: 'Redo',
|
|
27
|
-
light: 'Light',
|
|
28
|
-
dark: 'Dark',
|
|
29
|
-
system: 'System',
|
|
30
25
|
selected: 'Selected',
|
|
31
26
|
},
|
|
32
27
|
|
|
@@ -137,7 +132,6 @@ export const en: Locale = {
|
|
|
137
132
|
loadingAssetsEyebrow: 'Loading assets',
|
|
138
133
|
emptyEyebrow: 'Empty',
|
|
139
134
|
nothingToShow: 'Nothing to show.',
|
|
140
|
-
emptyHintPrefix: '',
|
|
141
135
|
emptyHintMust: ' must ',
|
|
142
136
|
emptyHintSuffix: ' a non-empty array of components.',
|
|
143
137
|
},
|
|
@@ -247,7 +241,6 @@ export const en: Locale = {
|
|
|
247
241
|
cropFitCover: 'Fill',
|
|
248
242
|
cropFitContain: 'Fit',
|
|
249
243
|
cropApply: 'Apply',
|
|
250
|
-
cropResetAria: 'Reset crop',
|
|
251
244
|
leaveComment: 'Leave a comment',
|
|
252
245
|
commentPlaceholder: 'Describe a change for the agent…',
|
|
253
246
|
commentShortcutHint: '⌘/ to focus · ⌘↵ to add',
|
|
@@ -266,6 +259,8 @@ export const en: Locale = {
|
|
|
266
259
|
commentsApplyHintSuffix: ' in your agent to apply these.',
|
|
267
260
|
commentDeleteAria: 'Delete',
|
|
268
261
|
saveFailed: "Couldn't save:",
|
|
262
|
+
decreaseFontSize: 'Decrease font size',
|
|
263
|
+
increaseFontSize: 'Increase font size',
|
|
269
264
|
},
|
|
270
265
|
|
|
271
266
|
stylePanel: {
|
package/src/locale/ja.ts
CHANGED
|
@@ -17,16 +17,11 @@ export const ja: Locale = {
|
|
|
17
17
|
loadFailed: '読み込みに失敗',
|
|
18
18
|
failedToLoadSlide: 'スライドの読み込みに失敗しました',
|
|
19
19
|
home: 'ホーム',
|
|
20
|
-
backToHome: 'ホームへ戻る',
|
|
21
|
-
preview: 'プレビュー',
|
|
22
20
|
add: '追加',
|
|
23
21
|
done: '完了',
|
|
24
22
|
tryAgain: '再試行',
|
|
25
23
|
undo: '元に戻す',
|
|
26
24
|
redo: 'やり直す',
|
|
27
|
-
light: 'ライト',
|
|
28
|
-
dark: 'ダーク',
|
|
29
|
-
system: 'システム',
|
|
30
25
|
selected: '選択中',
|
|
31
26
|
},
|
|
32
27
|
|
|
@@ -137,7 +132,6 @@ export const ja: Locale = {
|
|
|
137
132
|
loadingAssetsEyebrow: 'アセットを読み込み中',
|
|
138
133
|
emptyEyebrow: '空',
|
|
139
134
|
nothingToShow: '表示する内容がありません。',
|
|
140
|
-
emptyHintPrefix: '',
|
|
141
135
|
emptyHintMust: ' は ',
|
|
142
136
|
emptyHintSuffix: ' で空でないコンポーネント配列をエクスポートする必要があります。',
|
|
143
137
|
},
|
|
@@ -243,7 +237,6 @@ export const ja: Locale = {
|
|
|
243
237
|
cropFitCover: '塗りつぶす',
|
|
244
238
|
cropFitContain: '全体表示',
|
|
245
239
|
cropApply: '適用',
|
|
246
|
-
cropResetAria: 'トリミングをリセット',
|
|
247
240
|
agentWatching: 'エージェント監視中',
|
|
248
241
|
agentWatchingTooltip: '選択中の要素はエージェントにリアルタイムで同期されています。',
|
|
249
242
|
agentNotWatching: 'エージェント未接続',
|
|
@@ -268,6 +261,8 @@ export const ja: Locale = {
|
|
|
268
261
|
commentsApplyHintSuffix: ' を実行して適用してください。',
|
|
269
262
|
commentDeleteAria: '削除',
|
|
270
263
|
saveFailed: '保存に失敗しました:',
|
|
264
|
+
decreaseFontSize: 'フォントサイズを縮小',
|
|
265
|
+
increaseFontSize: 'フォントサイズを拡大',
|
|
271
266
|
},
|
|
272
267
|
|
|
273
268
|
stylePanel: {
|
package/src/locale/types.ts
CHANGED
|
@@ -17,16 +17,11 @@ export type Locale = {
|
|
|
17
17
|
loadFailed: string;
|
|
18
18
|
failedToLoadSlide: string;
|
|
19
19
|
home: string;
|
|
20
|
-
backToHome: string;
|
|
21
|
-
preview: string;
|
|
22
20
|
add: string;
|
|
23
21
|
done: string;
|
|
24
22
|
tryAgain: string;
|
|
25
23
|
undo: string;
|
|
26
24
|
redo: string;
|
|
27
|
-
light: string;
|
|
28
|
-
dark: string;
|
|
29
|
-
system: string;
|
|
30
25
|
selected: string;
|
|
31
26
|
};
|
|
32
27
|
|
|
@@ -137,7 +132,6 @@ export type Locale = {
|
|
|
137
132
|
loadingAssetsEyebrow: string;
|
|
138
133
|
emptyEyebrow: string;
|
|
139
134
|
nothingToShow: string;
|
|
140
|
-
emptyHintPrefix: string;
|
|
141
135
|
emptyHintMust: string;
|
|
142
136
|
emptyHintSuffix: string;
|
|
143
137
|
};
|
|
@@ -249,7 +243,6 @@ export type Locale = {
|
|
|
249
243
|
cropFitCover: string;
|
|
250
244
|
cropFitContain: string;
|
|
251
245
|
cropApply: string;
|
|
252
|
-
cropResetAria: string;
|
|
253
246
|
leaveComment: string;
|
|
254
247
|
commentPlaceholder: string;
|
|
255
248
|
commentShortcutHint: string;
|
|
@@ -266,6 +259,8 @@ export type Locale = {
|
|
|
266
259
|
commentDeleteAria: string;
|
|
267
260
|
/** Prefix for the toast shown when one or more buffered edits fail to write to disk. */
|
|
268
261
|
saveFailed: string;
|
|
262
|
+
decreaseFontSize: string;
|
|
263
|
+
increaseFontSize: string;
|
|
269
264
|
};
|
|
270
265
|
|
|
271
266
|
stylePanel: {
|