@open-slide/core 1.15.2 → 1.16.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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/{build-CTCrO_M-.js → build-DaL4Gjn-.js} +1 -1
  3. package/dist/cli/bin.js +3 -3
  4. package/dist/{config-HXg3KTTo.js → config-CCHio3pk.js} +39 -11
  5. package/dist/{config-CE2sKgqH.d.ts → config-DIvIP8vY.d.ts} +1 -1
  6. package/dist/{dev-2FgsKkoD.js → dev-DLRQoCkT.js} +1 -1
  7. package/dist/{format-afijk371.js → format-CxmsgcBh.js} +8 -0
  8. package/dist/index.d.ts +15 -14
  9. package/dist/index.js +9 -6
  10. package/dist/locale/index.d.ts +1 -1
  11. package/dist/locale/index.js +1 -1
  12. package/dist/{preview-Bdzz3PTc.js → preview-D3qVGc0S.js} +1 -1
  13. package/dist/{types-GA4ekcYB.d.ts → types-Di7nvL8V.d.ts} +2 -0
  14. package/dist/vite/index.d.ts +2 -2
  15. package/dist/vite/index.js +1 -1
  16. package/package.json +3 -3
  17. package/skills/apply-comments/SKILL.md +7 -8
  18. package/skills/create-slide/SKILL.md +9 -9
  19. package/skills/create-theme/SKILL.md +8 -5
  20. package/skills/current-slide/SKILL.md +1 -1
  21. package/skills/slide-authoring/SKILL.md +40 -315
  22. package/skills/slide-authoring/references/assets.md +52 -0
  23. package/skills/slide-authoring/references/design-system.md +48 -0
  24. package/skills/slide-authoring/references/morph.md +67 -0
  25. package/skills/slide-authoring/references/page-numbers.md +16 -0
  26. package/skills/slide-authoring/references/steps.md +43 -0
  27. package/skills/slide-authoring/references/transitions.md +175 -0
  28. package/skills/slide-authoring/references/webfonts.md +20 -0
  29. package/src/app/components/{shared-element.tsx → morph-element.tsx} +8 -13
  30. package/src/app/components/slide-transition-layer.tsx +61 -57
  31. package/src/app/lib/step-context.tsx +9 -1
  32. package/src/app/lib/transition.ts +2 -2
  33. package/src/app/routes/presenter.tsx +75 -17
  34. package/src/locale/en.ts +2 -0
  35. package/src/locale/ja.ts +2 -0
  36. package/src/locale/types.ts +2 -0
  37. package/src/locale/zh-cn.ts +2 -0
  38. package/src/locale/zh-tw.ts +2 -0
@@ -12,10 +12,10 @@ export type SlideTransition = {
12
12
  easing?: string;
13
13
  enter?: TransitionPhase;
14
14
  exit?: TransitionPhase;
15
- sharedElements?: boolean | SharedElementTransition;
15
+ morph?: boolean | MorphTransition;
16
16
  };
17
17
 
18
- export type SharedElementTransition = {
18
+ export type MorphTransition = {
19
19
  duration?: number;
20
20
  easing?: string;
21
21
  delay?: number;
@@ -1,4 +1,12 @@
1
- import { ChevronLeft, ChevronRight, RotateCcw, Square, Sun } from 'lucide-react';
1
+ import {
2
+ AArrowDown,
3
+ AArrowUp,
4
+ ChevronLeft,
5
+ ChevronRight,
6
+ RotateCcw,
7
+ Square,
8
+ Sun,
9
+ } from 'lucide-react';
2
10
  import { type ReactNode, useCallback, useEffect, useRef, useState } from 'react';
3
11
  import { useParams } from 'react-router-dom';
4
12
  import { Button } from '@/components/ui/button';
@@ -221,22 +229,7 @@ export function Presenter() {
221
229
  </div>
222
230
  </div>
223
231
 
224
- <div className="flex min-h-0 flex-1 flex-col gap-2">
225
- <SectionLabel>{t.presenter.speakerNotes}</SectionLabel>
226
- <div className="min-h-0 flex-1 overflow-y-auto rounded-[6px] border border-border bg-card p-3 text-[13.5px] leading-relaxed whitespace-pre-wrap text-card-foreground">
227
- {note?.trim() ? (
228
- note
229
- ) : (
230
- <span className="text-muted-foreground">
231
- {t.presenter.noNotesPrefix}
232
- <code className="rounded-[3px] bg-muted px-1 py-0.5 font-mono text-[12px]">
233
- export const notes = […]
234
- </code>
235
- {t.presenter.noNotesSuffix}
236
- </span>
237
- )}
238
- </div>
239
- </div>
232
+ <SpeakerNotes note={note} />
240
233
 
241
234
  <PresenterJumpControl total={total} current={index} onJump={goTo} />
242
235
  </aside>
@@ -350,6 +343,71 @@ function PresenterBottomBar({
350
343
  );
351
344
  }
352
345
 
346
+ const NOTES_FONT_SIZES = [11, 12, 13.5, 15, 17, 20, 24, 28];
347
+ const NOTES_FONT_SIZE_DEFAULT_INDEX = 2;
348
+ const NOTES_FONT_SIZE_STORAGE_KEY = 'open-slide:presenter-notes-font-size';
349
+
350
+ function SpeakerNotes({ note }: { note: string | undefined }) {
351
+ const t = useLocale();
352
+ const [sizeIndex, setSizeIndex] = useState(() => {
353
+ if (typeof window === 'undefined') return NOTES_FONT_SIZE_DEFAULT_INDEX;
354
+ const stored = Number(window.localStorage.getItem(NOTES_FONT_SIZE_STORAGE_KEY));
355
+ return NOTES_FONT_SIZES.includes(stored)
356
+ ? NOTES_FONT_SIZES.indexOf(stored)
357
+ : NOTES_FONT_SIZE_DEFAULT_INDEX;
358
+ });
359
+
360
+ useEffect(() => {
361
+ window.localStorage.setItem(NOTES_FONT_SIZE_STORAGE_KEY, String(NOTES_FONT_SIZES[sizeIndex]));
362
+ }, [sizeIndex]);
363
+
364
+ return (
365
+ <div className="flex min-h-0 flex-1 flex-col gap-2">
366
+ <div className="flex items-center justify-between">
367
+ <SectionLabel>{t.presenter.speakerNotes}</SectionLabel>
368
+ <div className="flex items-center gap-1">
369
+ <Button
370
+ variant="ghost"
371
+ size="icon-xs"
372
+ onClick={() => setSizeIndex((i) => Math.max(0, i - 1))}
373
+ disabled={sizeIndex === 0}
374
+ title={t.presenter.notesTextSmaller}
375
+ aria-label={t.presenter.notesTextSmaller}
376
+ >
377
+ <AArrowDown className="size-4" />
378
+ </Button>
379
+ <Button
380
+ variant="ghost"
381
+ size="icon-xs"
382
+ onClick={() => setSizeIndex((i) => Math.min(NOTES_FONT_SIZES.length - 1, i + 1))}
383
+ disabled={sizeIndex === NOTES_FONT_SIZES.length - 1}
384
+ title={t.presenter.notesTextLarger}
385
+ aria-label={t.presenter.notesTextLarger}
386
+ >
387
+ <AArrowUp className="size-4" />
388
+ </Button>
389
+ </div>
390
+ </div>
391
+ <div
392
+ className="min-h-0 flex-1 overflow-y-auto rounded-[6px] border border-border bg-card p-3 leading-relaxed whitespace-pre-wrap text-card-foreground"
393
+ style={{ fontSize: NOTES_FONT_SIZES[sizeIndex] }}
394
+ >
395
+ {note?.trim() ? (
396
+ note
397
+ ) : (
398
+ <span className="text-muted-foreground">
399
+ {t.presenter.noNotesPrefix}
400
+ <code className="rounded-[3px] bg-muted px-1 py-0.5 font-mono text-[0.9em]">
401
+ export const notes = […]
402
+ </code>
403
+ {t.presenter.noNotesSuffix}
404
+ </span>
405
+ )}
406
+ </div>
407
+ </div>
408
+ );
409
+ }
410
+
353
411
  function PresenterJumpControl({
354
412
  total,
355
413
  current,
package/src/locale/en.ts CHANGED
@@ -150,6 +150,8 @@ export const en: Locale = {
150
150
  lastSlide: 'Last slide',
151
151
  endOfDeck: 'End of deck',
152
152
  speakerNotes: 'Speaker notes',
153
+ notesTextSmaller: 'Make notes text smaller',
154
+ notesTextLarger: 'Make notes text larger',
153
155
  noNotesPrefix: 'No speaker notes for this slide. Add ',
154
156
  noNotesSuffix: ' to your slide module to see notes here.',
155
157
  blackScreen: 'Black screen',
package/src/locale/ja.ts CHANGED
@@ -150,6 +150,8 @@ export const ja: Locale = {
150
150
  lastSlide: '最後のスライド',
151
151
  endOfDeck: 'デッキの終わり',
152
152
  speakerNotes: '発表者ノート',
153
+ notesTextSmaller: 'ノートの文字を小さく',
154
+ notesTextLarger: 'ノートの文字を大きく',
153
155
  noNotesPrefix: 'このスライドには発表者ノートがありません。スライドモジュールに ',
154
156
  noNotesSuffix: ' を追加するとここに表示されます。',
155
157
  blackScreen: '黒い画面',
@@ -150,6 +150,8 @@ export type Locale = {
150
150
  lastSlide: string;
151
151
  endOfDeck: string;
152
152
  speakerNotes: string;
153
+ notesTextSmaller: string;
154
+ notesTextLarger: string;
153
155
  noNotesPrefix: string;
154
156
  noNotesSuffix: string;
155
157
  blackScreen: string;
@@ -148,6 +148,8 @@ export const zhCN: Locale = {
148
148
  lastSlide: '最后一张',
149
149
  endOfDeck: '演示结束',
150
150
  speakerNotes: '演讲备注',
151
+ notesTextSmaller: '缩小备注文字',
152
+ notesTextLarger: '放大备注文字',
151
153
  noNotesPrefix: '该幻灯片没有演讲备注。在你的幻灯片模块中添加 ',
152
154
  noNotesSuffix: ' 即可在此查看备注。',
153
155
  blackScreen: '黑屏',
@@ -148,6 +148,8 @@ export const zhTW: Locale = {
148
148
  lastSlide: '最後一張',
149
149
  endOfDeck: '簡報結束',
150
150
  speakerNotes: '演講備忘',
151
+ notesTextSmaller: '縮小備忘文字',
152
+ notesTextLarger: '放大備忘文字',
151
153
  noNotesPrefix: '此投影片沒有演講備忘。在你的投影片模組中加入 ',
152
154
  noNotesSuffix: ' 即可在此查看備忘。',
153
155
  blackScreen: '黑屏',