@open-slide/core 1.9.0 → 1.11.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.
@@ -36,6 +36,7 @@ import {
36
36
  DropdownMenuContent,
37
37
  DropdownMenuItem,
38
38
  DropdownMenuSeparator,
39
+ DropdownMenuShortcut,
39
40
  DropdownMenuTrigger,
40
41
  } from '@/components/ui/dropdown-menu';
41
42
  import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
@@ -236,21 +237,37 @@ export function Slide() {
236
237
  if (playMode) return;
237
238
  const onKey = (e: KeyboardEvent) => {
238
239
  if (e.target instanceof HTMLElement && e.target.matches('input, textarea')) return;
239
- if (e.key === 'ArrowRight' || e.key === 'ArrowDown' || e.key === 'PageDown') {
240
+ if (
241
+ e.key === 'ArrowRight' ||
242
+ e.key === 'ArrowDown' ||
243
+ e.key === ' ' ||
244
+ e.key === 'PageDown'
245
+ ) {
240
246
  e.preventDefault();
241
247
  goTo(index + 1);
242
- } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'PageUp') {
248
+ return;
249
+ }
250
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'PageUp') {
243
251
  e.preventDefault();
244
252
  goTo(index - 1);
245
- } else if (e.key === 'f' || e.key === 'F') {
253
+ return;
254
+ }
255
+ // Letter shortcuts only fire bare so browser combos (Cmd/Ctrl-P, ⌘F…) stay intact.
256
+ if (e.altKey || e.ctrlKey || e.metaKey) return;
257
+ if (e.key === 'f' || e.key === 'F') {
246
258
  setPlayMode('fullscreen');
259
+ } else if (e.key === 'Enter') {
260
+ setPlayMode('window');
261
+ } else if (e.key === 'p' || e.key === 'P') {
262
+ if (slideId) openPresenterWindow(slideId);
263
+ setPlayMode('window');
247
264
  } else if (import.meta.env.DEV && (e.key === 'd' || e.key === 'D')) {
248
265
  setDesignOpen((v) => !v);
249
266
  }
250
267
  };
251
268
  window.addEventListener('keydown', onKey);
252
269
  return () => window.removeEventListener('keydown', onKey);
253
- }, [index, goTo, playMode]);
270
+ }, [index, goTo, playMode, slideId]);
254
271
 
255
272
  if (error) {
256
273
  return (
@@ -606,10 +623,12 @@ export function Slide() {
606
623
  <DropdownMenuItem onSelect={() => setPlayMode('window')}>
607
624
  <Play />
608
625
  {t.slide.presentInWindow}
626
+ <DropdownMenuShortcut>↵</DropdownMenuShortcut>
609
627
  </DropdownMenuItem>
610
628
  <DropdownMenuItem onSelect={() => setPlayMode('fullscreen')}>
611
629
  <Maximize />
612
630
  {t.slide.presentFullscreen}
631
+ <DropdownMenuShortcut>F</DropdownMenuShortcut>
613
632
  </DropdownMenuItem>
614
633
  <DropdownMenuItem
615
634
  onSelect={() => {
@@ -619,6 +638,7 @@ export function Slide() {
619
638
  >
620
639
  <MonitorSpeaker />
621
640
  {t.slide.presentPresenter}
641
+ <DropdownMenuShortcut>P</DropdownMenuShortcut>
622
642
  </DropdownMenuItem>
623
643
  </DropdownMenuContent>
624
644
  </DropdownMenu>
@@ -642,6 +662,7 @@ export function Slide() {
642
662
  onSelect={goTo}
643
663
  onReorder={import.meta.env.DEV ? reorderPage : undefined}
644
664
  actions={thumbnailActions}
665
+ moduleTransition={slide.transition}
645
666
  />
646
667
  <main
647
668
  ref={slideViewportRef}
@@ -724,6 +745,7 @@ function ResizableRail(props: {
724
745
  onSelect: (i: number) => void;
725
746
  onReorder?: (from: number, to: number) => void;
726
747
  actions?: ThumbnailActions;
748
+ moduleTransition?: SlideModule['transition'];
727
749
  }) {
728
750
  const t = useLocale();
729
751
  const [width, setWidth] = useState<number>(readStoredRailWidth);
@@ -10,6 +10,7 @@ declare module 'virtual:open-slide/config' {
10
10
  import type { Locale } from '../locale/types';
11
11
 
12
12
  const config: {
13
+ base?: string;
13
14
  slidesDir?: string;
14
15
  port?: number;
15
16
  locale?: Locale;
package/src/locale/en.ts CHANGED
@@ -343,6 +343,8 @@ export const en: Locale = {
343
343
  toastDuplicateFailed: 'Could not duplicate page',
344
344
  toastDeleteFailed: 'Could not delete page',
345
345
  resizeRail: 'Resize thumbnail rail',
346
+ transitionIndicator: 'Has slide transition',
347
+ stepsIndicator: 'Has step-by-step reveals',
346
348
  },
347
349
 
348
350
  pdfToast: {
package/src/locale/ja.ts CHANGED
@@ -348,6 +348,8 @@ export const ja: Locale = {
348
348
  toastDuplicateFailed: 'ページを複製できませんでした',
349
349
  toastDeleteFailed: 'ページを削除できませんでした',
350
350
  resizeRail: 'サムネイル幅を調整',
351
+ transitionIndicator: 'スライドトランジションあり',
352
+ stepsIndicator: 'ステップ表示あり',
351
353
  },
352
354
 
353
355
  pdfToast: {
@@ -364,6 +364,8 @@ export type Locale = {
364
364
  toastDuplicateFailed: string;
365
365
  toastDeleteFailed: string;
366
366
  resizeRail: string;
367
+ transitionIndicator: string;
368
+ stepsIndicator: string;
367
369
  };
368
370
 
369
371
  pdfToast: {
@@ -341,6 +341,8 @@ export const zhCN: Locale = {
341
341
  toastDuplicateFailed: '无法复制页面',
342
342
  toastDeleteFailed: '无法删除页面',
343
343
  resizeRail: '调整缩略图栏宽度',
344
+ transitionIndicator: '有换页转场',
345
+ stepsIndicator: '有逐步揭示',
344
346
  },
345
347
 
346
348
  pdfToast: {
@@ -341,6 +341,8 @@ export const zhTW: Locale = {
341
341
  toastDuplicateFailed: '無法複製頁面',
342
342
  toastDeleteFailed: '無法刪除頁面',
343
343
  resizeRail: '調整縮圖欄寬度',
344
+ transitionIndicator: '有換頁轉場',
345
+ stepsIndicator: '有逐步揭示',
344
346
  },
345
347
 
346
348
  pdfToast: {