@open-slide/core 1.19.0 → 1.19.1

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.
Files changed (40) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/package.json +1 -1
  3. package/src/app/app.tsx +20 -15
  4. package/src/app/components/asset-view.tsx +38 -23
  5. package/src/app/components/command/command-menu.tsx +5 -1
  6. package/src/app/components/command/command.tsx +4 -2
  7. package/src/app/components/icon-tooltip.tsx +24 -15
  8. package/src/app/components/inspector/asset-picker-dialog.tsx +18 -16
  9. package/src/app/components/inspector/comment-widget.tsx +33 -7
  10. package/src/app/components/inspector/image-crop-dialog.tsx +8 -2
  11. package/src/app/components/inspector/inspect-overlay.tsx +5 -4
  12. package/src/app/components/inspector/inspector-panel.tsx +15 -5
  13. package/src/app/components/language-toggle.tsx +2 -3
  14. package/src/app/components/notes-drawer.tsx +3 -3
  15. package/src/app/components/overview-grid.tsx +10 -4
  16. package/src/app/components/panel/panel-shell.tsx +1 -1
  17. package/src/app/components/panel/save-card.tsx +12 -3
  18. package/src/app/components/pdf-progress-toast.tsx +7 -3
  19. package/src/app/components/pptx-progress-toast.tsx +7 -3
  20. package/src/app/components/present/blackout-overlay.tsx +16 -3
  21. package/src/app/components/present/control-bar.tsx +17 -9
  22. package/src/app/components/present/jump-input.tsx +24 -3
  23. package/src/app/components/present/laser-pointer.tsx +34 -11
  24. package/src/app/components/present/progress-bar.tsx +1 -1
  25. package/src/app/components/present/use-touch-swipe.ts +9 -2
  26. package/src/app/components/sidebar/folder-item.tsx +9 -5
  27. package/src/app/components/sidebar/icon-picker.tsx +1 -1
  28. package/src/app/components/sidebar/sidebar-footer.tsx +13 -6
  29. package/src/app/components/sidebar/sidebar.tsx +2 -2
  30. package/src/app/components/style-panel/style-panel.tsx +16 -12
  31. package/src/app/components/theme-toggle.tsx +4 -5
  32. package/src/app/components/themes/theme-detail.tsx +8 -5
  33. package/src/app/components/themes/themes-gallery.tsx +3 -3
  34. package/src/app/components/thumbnail-rail.tsx +7 -3
  35. package/src/app/index.html +21 -0
  36. package/src/app/routes/home-shell.tsx +1 -1
  37. package/src/app/routes/home.tsx +10 -7
  38. package/src/app/routes/presenter.tsx +4 -3
  39. package/src/app/routes/slide.tsx +6 -6
  40. package/src/app/styles.css +7 -0
@@ -121,7 +121,7 @@ export function ThemeDetail({ themeId, onBack }: { themeId: string; onBack: () =
121
121
  aria-label={t.themes.prevPageAria}
122
122
  disabled={pageIndex === 0}
123
123
  onClick={() => setPageIndex((i) => Math.max(0, i - 1))}
124
- className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground transition-colors hover:bg-muted disabled:opacity-40"
124
+ className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground outline-none transition-[background-color,opacity,scale] duration-100 hover:bg-muted active:scale-95 focus-visible:ring-2 focus-visible:ring-ring/30 disabled:opacity-40"
125
125
  >
126
126
  <ChevronLeft className="size-4" />
127
127
  </button>
@@ -133,7 +133,7 @@ export function ThemeDetail({ themeId, onBack }: { themeId: string; onBack: () =
133
133
  aria-label={t.themes.nextPageAria}
134
134
  disabled={pageIndex === totalPages - 1}
135
135
  onClick={() => setPageIndex((i) => Math.min(totalPages - 1, i + 1))}
136
- className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground transition-colors hover:bg-muted disabled:opacity-40"
136
+ className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground outline-none transition-[background-color,opacity,scale] duration-100 hover:bg-muted active:scale-95 focus-visible:ring-2 focus-visible:ring-ring/30 disabled:opacity-40"
137
137
  >
138
138
  <ChevronRight className="size-4" />
139
139
  </button>
@@ -225,10 +225,13 @@ function ThemeSlideCard({ id }: { id: string }) {
225
225
  const displayTitle = slide?.meta?.title ?? id;
226
226
 
227
227
  return (
228
- <Link to={`/s/${id}`} className="group block focus-visible:outline-none">
229
- <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color] motion-safe:duration-200">
228
+ <Link
229
+ to={`/s/${id}`}
230
+ className="group block rounded-[6px] outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
231
+ >
232
+ <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 group-active:scale-[0.99] motion-safe:transition-[box-shadow,--tw-ring-color,scale] motion-safe:duration-200">
230
233
  {FirstPage ? (
231
- <div className="h-full w-full motion-safe:transition-transform motion-safe:duration-300 motion-safe:group-hover:scale-[1.03]">
234
+ <div className="h-full w-full ease-swift motion-safe:transition-transform motion-safe:duration-200 motion-safe:group-hover:scale-[1.03]">
232
235
  <SlideCanvas flat freezeMotion design={slide?.design}>
233
236
  <SlidePageProvider index={0} total={slide?.default.length ?? 1}>
234
237
  <FirstPage />
@@ -40,9 +40,9 @@ function ThemeCard({
40
40
  type="button"
41
41
  onClick={onOpen}
42
42
  aria-label={ariaLabel}
43
- className="group block w-full text-left focus-visible:outline-none"
43
+ className="group block w-full rounded-[6px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
44
44
  >
45
- <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color] motion-safe:duration-200">
45
+ <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 group-active:scale-[0.99] motion-safe:transition-[box-shadow,--tw-ring-color,scale] motion-safe:duration-200">
46
46
  <ThemePreview theme={theme} />
47
47
  </div>
48
48
  <div className="mt-3">
@@ -77,7 +77,7 @@ function ThemePreview({ theme }: { theme: Theme }) {
77
77
  if (!FirstPage) return <NoDemoState />;
78
78
 
79
79
  return (
80
- <div className="h-full w-full motion-safe:transition-transform motion-safe:duration-300 motion-safe:group-hover:scale-[1.03]">
80
+ <div className="h-full w-full ease-swift motion-safe:transition-transform motion-safe:duration-200 motion-safe:group-hover:scale-[1.03]">
81
81
  <SlideCanvas flat freezeMotion design={demo.design}>
82
82
  <SlidePageProvider index={0} total={demo.default.length}>
83
83
  <FirstPage />
@@ -396,8 +396,8 @@ function CurrentThumbnailButton({
396
396
 
397
397
  function thumbButtonClass(active: boolean): string {
398
398
  return cn(
399
- 'group/thumb flex w-full items-start gap-2.5 rounded-[6px] p-1.5 text-left outline-none motion-safe:transition-colors',
400
- 'hover:bg-muted/60',
399
+ 'group/thumb flex w-full items-start gap-2.5 rounded-[6px] p-1.5 text-left outline-none motion-safe:transition-[background-color,scale] motion-safe:duration-100',
400
+ 'hover:bg-muted/60 active:scale-[0.985]',
401
401
  'focus-visible:ring-1 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-sidebar',
402
402
  active && 'bg-muted',
403
403
  );
@@ -499,7 +499,10 @@ function HorizontalVirtualThumbList({
499
499
  onClick={() => onSelect(i)}
500
500
  aria-label={format(t.thumbnailRail.goToPageAria, { n: i + 1 })}
501
501
  aria-current={active ? 'page' : undefined}
502
- className={cn('group/thumb relative flex shrink-0 flex-col items-center gap-1.5')}
502
+ className={cn(
503
+ 'group/thumb relative flex shrink-0 flex-col items-center gap-1.5 rounded-[6px] outline-none motion-safe:transition-[scale] motion-safe:duration-100 active:scale-[0.985]',
504
+ 'focus-visible:ring-1 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-sidebar',
505
+ )}
503
506
  >
504
507
  <span
505
508
  className={cn(
@@ -939,6 +942,7 @@ function SortableThumb({
939
942
  >) {
940
943
  const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
941
944
  id: index + 1,
945
+ transition: { duration: 180, easing: 'var(--ease-swift)' },
942
946
  });
943
947
 
944
948
  const setRef = (node: HTMLButtonElement | null) => {
@@ -5,6 +5,27 @@
5
5
  <link rel="icon" href="./favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>open-slide</title>
8
+ <style>
9
+ html {
10
+ background-color: oklch(0.99 0 0);
11
+ }
12
+ html.dark {
13
+ background-color: oklch(0.145 0 0);
14
+ }
15
+ </style>
16
+ <script>
17
+ // Apply the stored theme before first paint; next-themes only runs
18
+ // after the bundle loads, which flashes white for dark-mode users.
19
+ let stored = null;
20
+ try {
21
+ stored = localStorage.getItem('theme');
22
+ } catch (_) {}
23
+ const dark =
24
+ stored === 'dark' ||
25
+ (stored !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches);
26
+ document.documentElement.classList.toggle('dark', dark);
27
+ document.documentElement.style.colorScheme = dark ? 'dark' : 'light';
28
+ </script>
8
29
  </head>
9
30
  <body>
10
31
  <div id="root"></div>
@@ -189,7 +189,7 @@ export function HomeShell() {
189
189
  <button
190
190
  type="button"
191
191
  aria-label={t.home.menu}
192
- className="flex size-8 items-center justify-center rounded-[6px] text-muted-foreground hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground"
192
+ className="flex size-8 items-center justify-center rounded-[6px] text-muted-foreground outline-none transition-[background-color,color,scale] duration-100 hover:bg-muted hover:text-foreground active:scale-95 focus-visible:ring-2 focus-visible:ring-ring/30 aria-expanded:bg-muted aria-expanded:text-foreground"
193
193
  >
194
194
  <Menu className="size-4" />
195
195
  </button>
@@ -266,7 +266,7 @@ function SearchInput({ value, onChange }: { value: string; onChange: (value: str
266
266
  type="button"
267
267
  onClick={() => onChange('')}
268
268
  aria-label={t.home.clearSearch}
269
- className="absolute right-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-[4px] text-muted-foreground hover:bg-muted hover:text-foreground"
269
+ className="absolute right-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-[4px] text-muted-foreground outline-none transition-[background-color,color,scale] duration-100 hover:bg-muted hover:text-foreground active:scale-90 focus-visible:ring-2 focus-visible:ring-ring/30"
270
270
  >
271
271
  <X className="size-3" />
272
272
  </button>
@@ -296,7 +296,7 @@ function SortControl({ value, onChange }: { value: SortKey; onChange: (next: Sor
296
296
  <button
297
297
  type="button"
298
298
  aria-label={`${t.home.sortLabel}: ${labels[value]}`}
299
- className="flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-[6px] border border-border bg-background pl-2 pr-1.5 text-[12.5px] font-medium text-foreground outline-none hover:bg-muted focus-visible:border-foreground/40 focus-visible:ring-2 focus-visible:ring-ring/30"
299
+ className="flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-[6px] border border-border bg-background pl-2 pr-1.5 text-[12.5px] font-medium text-foreground outline-none transition-[background-color,translate] duration-100 hover:bg-muted active:translate-y-px focus-visible:border-foreground/40 focus-visible:ring-2 focus-visible:ring-ring/30"
300
300
  >
301
301
  <FieldIcon k={value} className="size-3.5 text-muted-foreground" />
302
302
  <span>{labels[value]}</span>
@@ -510,11 +510,14 @@ function SlideCard({
510
510
  onDragEnd={() => setDragging(false)}
511
511
  className={cn('group relative motion-safe:transition-opacity', dragging && 'opacity-40')}
512
512
  >
513
- <Link to={`/s/${id}`} className="block focus-visible:outline-none">
513
+ <Link
514
+ to={`/s/${id}`}
515
+ className="block rounded-[6px] outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
516
+ >
514
517
  {/* Slide thumb — tight border, grey baseboard, no shadcn rounded-xl */}
515
- <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color] motion-safe:duration-200">
518
+ <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color,scale] motion-safe:duration-200 group-active:scale-[0.99]">
516
519
  {FirstPage ? (
517
- <div className="h-full w-full motion-safe:transition-transform motion-safe:duration-300 motion-safe:group-hover:scale-[1.03]">
520
+ <div className="h-full w-full ease-swift motion-safe:transition-transform motion-safe:duration-200 motion-safe:group-hover:scale-[1.03]">
518
521
  <SlideCanvas flat freezeMotion design={slide?.design}>
519
522
  <SlidePageProvider index={0} total={slide?.default.length ?? 1}>
520
523
  <FirstPage />
@@ -556,7 +559,7 @@ function SlideCard({
556
559
  e.stopPropagation();
557
560
  e.preventDefault();
558
561
  }}
559
- className="flex size-7 items-center justify-center rounded-[5px] bg-card/90 text-foreground shadow-edge ring-1 ring-border opacity-0 backdrop-blur hover:bg-card group-hover:opacity-100 aria-expanded:opacity-100 motion-safe:transition-opacity"
562
+ className="flex size-7 items-center justify-center rounded-[5px] bg-card/90 text-foreground shadow-edge ring-1 ring-border opacity-0 outline-none backdrop-blur hover:bg-card group-hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-ring/40 aria-expanded:opacity-100 motion-safe:transition-opacity motion-safe:duration-150"
560
563
  aria-label={tCard.home.slideActions}
561
564
  >
562
565
  <MoreHorizontal className="size-3.5" />
@@ -794,7 +797,7 @@ function FolderOption({
794
797
  type="button"
795
798
  onClick={onClick}
796
799
  className={cn(
797
- 'flex w-full items-center gap-2 border-b border-hairline px-3 py-2 text-left text-[13px] transition-colors last:border-b-0',
800
+ 'flex w-full items-center gap-2 border-b border-hairline px-3 py-2 text-left text-[13px] outline-none transition-colors duration-100 last:border-b-0 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-brand active:bg-muted',
798
801
  active ? 'bg-muted text-foreground' : 'hover:bg-muted/60',
799
802
  )}
800
803
  >
@@ -232,6 +232,7 @@ export function Presenter() {
232
232
  aria-hidden
233
233
  className={cn(
234
234
  'pointer-events-none absolute inset-0 grid place-items-center text-[11px] tracking-[0.08em] uppercase',
235
+ 'motion-safe:animate-in motion-safe:fade-in-0 motion-safe:duration-150',
235
236
  blackout === 'black' ? 'bg-black text-white/35' : 'bg-white text-black/35',
236
237
  )}
237
238
  >
@@ -456,7 +457,7 @@ function DeckSwitcher({
456
457
  onClick={() => select(id)}
457
458
  onMouseMove={() => setActiveIndex(i)}
458
459
  className={cn(
459
- 'flex w-full items-center gap-3 rounded-[6px] p-2 text-left',
460
+ 'flex w-full items-center gap-3 rounded-[6px] p-2 text-left outline-none transition-[background-color,scale] duration-100 active:scale-[0.99] focus-visible:ring-1 focus-visible:ring-ring/40',
460
461
  i === active && 'bg-muted',
461
462
  )}
462
463
  >
@@ -478,7 +479,7 @@ function DeckSwitcher({
478
479
  <div className="truncate text-[13px] font-medium text-foreground">
479
480
  {mod?.meta?.title ?? id}
480
481
  </div>
481
- <div className="mt-0.5 truncate font-mono text-[10.5px] text-muted-foreground">
482
+ <div className="mt-0.5 truncate font-mono text-[10.5px] tabular-nums text-muted-foreground">
482
483
  {id}
483
484
  {mod && ` · ${mod.default.length.toString().padStart(2, '0')}`}
484
485
  </div>
@@ -647,7 +648,7 @@ function PresenterJumpControl({
647
648
  placeholder={(current + 1).toString()}
648
649
  className="h-8 w-20 rounded-[5px] border border-border bg-card px-2 font-mono text-[12px] tabular-nums outline-none focus-visible:border-foreground/30"
649
650
  />
650
- <span className="font-mono text-[11px] text-muted-foreground">/ {total}</span>
651
+ <span className="font-mono text-[11px] tabular-nums text-muted-foreground">/ {total}</span>
651
652
  </form>
652
653
  );
653
654
  }
@@ -678,7 +678,7 @@ export function Slide() {
678
678
  )}
679
679
  >
680
680
  {exporting ? (
681
- <Loader2 className="size-4 animate-spin" />
681
+ <Loader2 className="size-4 animate-spin motion-reduce:animate-none" />
682
682
  ) : (
683
683
  <Download className="size-4" />
684
684
  )}
@@ -701,7 +701,7 @@ export function Slide() {
701
701
  )}
702
702
  >
703
703
  {exporting ? (
704
- <Loader2 className="size-4 animate-spin" />
704
+ <Loader2 className="size-4 animate-spin motion-reduce:animate-none" />
705
705
  ) : (
706
706
  <MoreHorizontal className="size-4" />
707
707
  )}
@@ -1008,7 +1008,7 @@ function ResizableRail(props: {
1008
1008
  <span
1009
1009
  aria-hidden
1010
1010
  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',
1011
+ '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
1012
  'group-hover/resize:opacity-100 group-focus-visible/resize:opacity-100',
1013
1013
  resizing && 'opacity-100',
1014
1014
  )}
@@ -1028,12 +1028,12 @@ function AgentConnectedBadge() {
1028
1028
  render={
1029
1029
  <button
1030
1030
  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"
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 transition-colors duration-150 hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/30"
1032
1032
  >
1033
1033
  <span aria-hidden className="relative flex size-1.5 items-center justify-center">
1034
1034
  {connected ? (
1035
1035
  <>
1036
- <span className="absolute inline-flex size-full animate-ping rounded-full bg-emerald-500 opacity-60" />
1036
+ <span className="absolute inline-flex size-full rounded-full bg-emerald-500 opacity-60 motion-safe:animate-ping" />
1037
1037
  <span className="relative inline-flex size-1.5 rounded-full bg-emerald-500" />
1038
1038
  </>
1039
1039
  ) : (
@@ -1215,7 +1215,7 @@ function InlineTitleEditor({
1215
1215
  onClick={() => setEditing(true)}
1216
1216
  aria-label={t.slide.renameSlide}
1217
1217
  className={cn(
1218
- 'min-w-0 max-w-full cursor-text rounded-[5px] border border-transparent px-2 py-0.5 transition-colors',
1218
+ 'min-w-0 max-w-full cursor-text rounded-[5px] border border-transparent px-2 py-0.5 transition-colors duration-100',
1219
1219
  'hover:border-foreground/30 hover:bg-card focus-visible:border-foreground/30 focus-visible:bg-card focus-visible:outline-none',
1220
1220
  )}
1221
1221
  >
@@ -58,6 +58,10 @@
58
58
  --radius-3xl: calc(var(--radius) * 2.2);
59
59
  --radius-4xl: calc(var(--radius) * 2.6);
60
60
 
61
+ /* House motion curve — one strong ease-out for every chrome entrance,
62
+ instead of per-file cubic-bezier literals. */
63
+ --ease-swift: cubic-bezier(0.22, 1, 0.36, 1);
64
+
61
65
  --shadow-edge: 0 0 0 0.5px oklch(0 0 0 / 0.06), 0 1px 0 oklch(0 0 0 / 0.025);
62
66
  --shadow-floating:
63
67
  0 0 0 0.5px oklch(0 0 0 / 0.08), 0 1px 1px oklch(0 0 0 / 0.04),
@@ -68,6 +72,9 @@
68
72
  }
69
73
 
70
74
  :root {
75
+ /* Runtime copy of the @theme token for inline style/JS consumers. */
76
+ --ease-swift: cubic-bezier(0.22, 1, 0.36, 1);
77
+
71
78
  /* Pure neutral ramp — zero chroma, flat surfaces, hairline borders.
72
79
  Near-white background with white cards floating on a slightly
73
80
  recessed canvas. */