@open-slide/core 1.19.1 → 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.
Files changed (86) hide show
  1. package/dist/{build-CaV_vhIw.js → build-CfAxF6Dm.js} +2 -5
  2. package/dist/cli/bin.d.ts +1 -1
  3. package/dist/cli/bin.js +139 -13
  4. package/dist/{config-CDHB8Oow.d.ts → config-AtA2Bqtn.d.ts} +4 -4
  5. package/dist/{config-GA6NMgs_.js → config-C_VI2EpT.js} +545 -776
  6. package/dist/{design-cpzS8aud.js → design-Cpqx7SJs.js} +1 -2
  7. package/dist/{dev-D57ui2yV.js → dev-BChELmc-.js} +4 -7
  8. package/dist/index.d.ts +7 -37
  9. package/dist/index.js +51 -54
  10. package/dist/locale/index.d.ts +2 -8
  11. package/dist/locale/index.js +13 -3
  12. package/dist/{preview-D40Zw_o0.js → preview-CcCQa268.js} +3 -7
  13. package/dist/{types-8HghULIe.d.ts → types-BzPSOxe-.d.ts} +5 -9
  14. package/dist/vite/index.d.ts +1 -4
  15. package/dist/vite/index.js +2 -4
  16. package/dist/{format-74A3B6zu.js → zh-tw-BxZ_pYqe.js} +13 -49
  17. package/package.json +12 -12
  18. package/skills/create-slide/SKILL.md +4 -1
  19. package/skills/slide-authoring/SKILL.md +25 -2
  20. package/src/app/app.tsx +1 -3
  21. package/src/app/assets/open-slide.png +0 -0
  22. package/src/app/components/asset-view.tsx +8 -16
  23. package/src/app/components/command/home-command-menu.tsx +6 -6
  24. package/src/app/components/export-progress-toast.tsx +80 -0
  25. package/src/app/components/history-provider.tsx +1 -5
  26. package/src/app/components/image-placeholder.tsx +4 -12
  27. package/src/app/components/inspector/asset-picker-dialog.tsx +6 -16
  28. package/src/app/components/inspector/image-crop-dialog.tsx +1 -4
  29. package/src/app/components/inspector/inline-text-editor.tsx +798 -0
  30. package/src/app/components/inspector/inspect-overlay.tsx +30 -72
  31. package/src/app/components/inspector/inspector-panel.tsx +17 -49
  32. package/src/app/components/inspector/inspector-provider.tsx +53 -36
  33. package/src/app/components/notes-drawer.tsx +2 -5
  34. package/src/app/components/overview-grid.tsx +5 -4
  35. package/src/app/components/panel/panel-shell.tsx +1 -3
  36. package/src/app/components/player.tsx +5 -6
  37. package/src/app/components/present/control-bar.tsx +4 -4
  38. package/src/app/components/present/jump-input.tsx +3 -2
  39. package/src/app/components/present/use-presenter-channel.ts +0 -1
  40. package/src/app/components/sidebar/folder-item.tsx +39 -16
  41. package/src/app/components/sidebar/sidebar-footer.tsx +7 -1
  42. package/src/app/components/sidebar/sidebar.tsx +91 -64
  43. package/src/app/components/slide-canvas.tsx +2 -6
  44. package/src/app/components/slide-transition-layer.tsx +48 -76
  45. package/src/app/components/style-panel/design-provider.tsx +1 -14
  46. package/src/app/components/style-panel/use-design.ts +1 -28
  47. package/src/app/components/themes/theme-detail.tsx +4 -4
  48. package/src/app/components/themes/themes-gallery.tsx +11 -6
  49. package/src/app/components/thumbnail-rail.tsx +7 -12
  50. package/src/app/lib/assets.ts +6 -7
  51. package/src/app/lib/dom.ts +42 -0
  52. package/src/app/lib/export-html.ts +10 -25
  53. package/src/app/lib/export-pdf.ts +11 -28
  54. package/src/app/lib/export-pptx.ts +6 -36
  55. package/src/app/lib/folders.ts +51 -46
  56. package/src/app/lib/inspector/inline-text.ts +31 -0
  57. package/src/app/lib/inspector/pick-target.ts +38 -0
  58. package/src/app/lib/inspector/use-comments.ts +1 -1
  59. package/src/app/lib/keys.ts +18 -0
  60. package/src/app/lib/last-home-location.ts +18 -0
  61. package/src/app/lib/print-ready.ts +2 -4
  62. package/src/app/lib/slides.ts +7 -4
  63. package/src/app/lib/text-diff.ts +19 -0
  64. package/src/app/lib/use-click-page-navigation.ts +2 -6
  65. package/src/app/lib/use-is-mobile.ts +2 -14
  66. package/src/app/lib/use-media-query.ts +20 -0
  67. package/src/app/lib/use-prefers-reduced-motion.ts +5 -13
  68. package/src/app/lib/use-slide-module.ts +1 -1
  69. package/src/app/lib/use-wheel-page-navigation.ts +1 -1
  70. package/src/app/lib/utils.test.ts +25 -1
  71. package/src/app/lib/utils.ts +8 -0
  72. package/src/app/routes/home-shell.tsx +71 -64
  73. package/src/app/routes/home.tsx +41 -52
  74. package/src/app/routes/presenter.tsx +10 -20
  75. package/src/app/routes/slide.tsx +84 -71
  76. package/src/app/routes/themes.tsx +7 -8
  77. package/src/app/styles.css +33 -44
  78. package/src/locale/en.ts +2 -7
  79. package/src/locale/ja.ts +2 -7
  80. package/src/locale/types.ts +2 -7
  81. package/src/locale/zh-cn.ts +2 -7
  82. package/src/locale/zh-tw.ts +2 -7
  83. package/dist/sync-BCJDRIqo.js +0 -139
  84. package/dist/sync-j9_QPovT.js +0 -3
  85. package/src/app/components/pdf-progress-toast.tsx +0 -36
  86. package/src/app/components/pptx-progress-toast.tsx +0 -36
@@ -15,16 +15,11 @@ const en = {
15
15
  loadFailed: "Load failed",
16
16
  failedToLoadSlide: "Failed to load slide",
17
17
  home: "Home",
18
- backToHome: "Back to home",
19
- preview: "Preview",
20
18
  add: "Add",
21
19
  done: "Done",
22
20
  tryAgain: "Try again",
23
21
  undo: "Undo",
24
22
  redo: "Redo",
25
- light: "Light",
26
- dark: "Dark",
27
- system: "System",
28
23
  selected: "Selected"
29
24
  },
30
25
  notFound: {
@@ -128,7 +123,6 @@ const en = {
128
123
  loadingAssetsEyebrow: "Loading assets",
129
124
  emptyEyebrow: "Empty",
130
125
  nothingToShow: "Nothing to show.",
131
- emptyHintPrefix: "",
132
126
  emptyHintMust: " must ",
133
127
  emptyHintSuffix: " a non-empty array of components."
134
128
  },
@@ -234,7 +228,6 @@ const en = {
234
228
  cropFitCover: "Fill",
235
229
  cropFitContain: "Fit",
236
230
  cropApply: "Apply",
237
- cropResetAria: "Reset crop",
238
231
  leaveComment: "Leave a comment",
239
232
  commentPlaceholder: "Describe a change for the agent…",
240
233
  commentShortcutHint: "⌘/ to focus · ⌘↵ to add",
@@ -252,7 +245,9 @@ const en = {
252
245
  commentsApplyHintPrefix: "Run ",
253
246
  commentsApplyHintSuffix: " in your agent to apply these.",
254
247
  commentDeleteAria: "Delete",
255
- saveFailed: "Couldn't save:"
248
+ saveFailed: "Couldn't save:",
249
+ decreaseFontSize: "Decrease font size",
250
+ increaseFontSize: "Increase font size"
256
251
  },
257
252
  stylePanel: {
258
253
  designTokens: "Design tokens",
@@ -462,7 +457,6 @@ const en = {
462
457
  collapsePromptAria: "Collapse prompt"
463
458
  }
464
459
  };
465
-
466
460
  //#endregion
467
461
  //#region src/locale/ja.ts
468
462
  const ja = {
@@ -481,16 +475,11 @@ const ja = {
481
475
  loadFailed: "読み込みに失敗",
482
476
  failedToLoadSlide: "スライドの読み込みに失敗しました",
483
477
  home: "ホーム",
484
- backToHome: "ホームへ戻る",
485
- preview: "プレビュー",
486
478
  add: "追加",
487
479
  done: "完了",
488
480
  tryAgain: "再試行",
489
481
  undo: "元に戻す",
490
482
  redo: "やり直す",
491
- light: "ライト",
492
- dark: "ダーク",
493
- system: "システム",
494
483
  selected: "選択中"
495
484
  },
496
485
  notFound: {
@@ -594,7 +583,6 @@ const ja = {
594
583
  loadingAssetsEyebrow: "アセットを読み込み中",
595
584
  emptyEyebrow: "空",
596
585
  nothingToShow: "表示する内容がありません。",
597
- emptyHintPrefix: "",
598
586
  emptyHintMust: " は ",
599
587
  emptyHintSuffix: " で空でないコンポーネント配列をエクスポートする必要があります。"
600
588
  },
@@ -696,7 +684,6 @@ const ja = {
696
684
  cropFitCover: "塗りつぶす",
697
685
  cropFitContain: "全体表示",
698
686
  cropApply: "適用",
699
- cropResetAria: "トリミングをリセット",
700
687
  agentWatching: "エージェント監視中",
701
688
  agentWatchingTooltip: "選択中の要素はエージェントにリアルタイムで同期されています。",
702
689
  agentNotWatching: "エージェント未接続",
@@ -718,7 +705,9 @@ const ja = {
718
705
  commentsApplyHintPrefix: "エージェントで ",
719
706
  commentsApplyHintSuffix: " を実行して適用してください。",
720
707
  commentDeleteAria: "削除",
721
- saveFailed: "保存に失敗しました:"
708
+ saveFailed: "保存に失敗しました:",
709
+ decreaseFontSize: "フォントサイズを縮小",
710
+ increaseFontSize: "フォントサイズを拡大"
722
711
  },
723
712
  stylePanel: {
724
713
  designTokens: "デザイントークン",
@@ -928,7 +917,6 @@ const ja = {
928
917
  collapsePromptAria: "プロンプトを折りたたむ"
929
918
  }
930
919
  };
931
-
932
920
  //#endregion
933
921
  //#region src/locale/zh-cn.ts
934
922
  const zhCN = {
@@ -947,16 +935,11 @@ const zhCN = {
947
935
  loadFailed: "加载失败",
948
936
  failedToLoadSlide: "无法加载幻灯片",
949
937
  home: "首页",
950
- backToHome: "返回首页",
951
- preview: "预览",
952
938
  add: "添加",
953
939
  done: "完成",
954
940
  tryAgain: "重试",
955
941
  undo: "撤销",
956
942
  redo: "重做",
957
- light: "浅色",
958
- dark: "深色",
959
- system: "系统",
960
943
  selected: "已选中"
961
944
  },
962
945
  notFound: {
@@ -1060,7 +1043,6 @@ const zhCN = {
1060
1043
  loadingAssetsEyebrow: "加载资源中",
1061
1044
  emptyEyebrow: "空白",
1062
1045
  nothingToShow: "没有可显示的内容。",
1063
- emptyHintPrefix: "",
1064
1046
  emptyHintMust: " 必须 ",
1065
1047
  emptyHintSuffix: " 一个非空的组件数组。"
1066
1048
  },
@@ -1162,7 +1144,6 @@ const zhCN = {
1162
1144
  cropFitCover: "填满",
1163
1145
  cropFitContain: "完整显示",
1164
1146
  cropApply: "应用",
1165
- cropResetAria: "重置裁剪",
1166
1147
  agentWatching: "Agent 正在关注",
1167
1148
  agentWatchingTooltip: "选取的元素会即时同步给 agent。",
1168
1149
  agentNotWatching: "Agent 没在关注",
@@ -1184,7 +1165,9 @@ const zhCN = {
1184
1165
  commentsApplyHintPrefix: "在你的代理中运行 ",
1185
1166
  commentsApplyHintSuffix: " 以应用这些更改。",
1186
1167
  commentDeleteAria: "删除",
1187
- saveFailed: "保存失败:"
1168
+ saveFailed: "保存失败:",
1169
+ decreaseFontSize: "缩小字号",
1170
+ increaseFontSize: "放大字号"
1188
1171
  },
1189
1172
  stylePanel: {
1190
1173
  designTokens: "设计样式",
@@ -1394,7 +1377,6 @@ const zhCN = {
1394
1377
  collapsePromptAria: "收起 prompt"
1395
1378
  }
1396
1379
  };
1397
-
1398
1380
  //#endregion
1399
1381
  //#region src/locale/zh-tw.ts
1400
1382
  const zhTW = {
@@ -1413,16 +1395,11 @@ const zhTW = {
1413
1395
  loadFailed: "載入失敗",
1414
1396
  failedToLoadSlide: "無法載入投影片",
1415
1397
  home: "首頁",
1416
- backToHome: "返回首頁",
1417
- preview: "預覽",
1418
1398
  add: "新增",
1419
1399
  done: "完成",
1420
1400
  tryAgain: "重試",
1421
1401
  undo: "復原",
1422
1402
  redo: "重做",
1423
- light: "淺色",
1424
- dark: "深色",
1425
- system: "系統",
1426
1403
  selected: "已選取"
1427
1404
  },
1428
1405
  notFound: {
@@ -1526,7 +1503,6 @@ const zhTW = {
1526
1503
  loadingAssetsEyebrow: "載入資源中",
1527
1504
  emptyEyebrow: "空白",
1528
1505
  nothingToShow: "沒有可顯示的內容。",
1529
- emptyHintPrefix: "",
1530
1506
  emptyHintMust: " 必須 ",
1531
1507
  emptyHintSuffix: " 一個非空的元件陣列。"
1532
1508
  },
@@ -1628,7 +1604,6 @@ const zhTW = {
1628
1604
  cropFitCover: "填滿",
1629
1605
  cropFitContain: "完整顯示",
1630
1606
  cropApply: "套用",
1631
- cropResetAria: "重設裁切",
1632
1607
  agentWatching: "Agent 正在關注",
1633
1608
  agentWatchingTooltip: "選取的元素會即時同步給 agent。",
1634
1609
  agentNotWatching: "Agent 沒在關注",
@@ -1650,7 +1625,9 @@ const zhTW = {
1650
1625
  commentsApplyHintPrefix: "在你的代理中執行 ",
1651
1626
  commentsApplyHintSuffix: " 以套用這些變更。",
1652
1627
  commentDeleteAria: "刪除",
1653
- saveFailed: "儲存失敗:"
1628
+ saveFailed: "儲存失敗:",
1629
+ decreaseFontSize: "縮小字級",
1630
+ increaseFontSize: "放大字級"
1654
1631
  },
1655
1632
  stylePanel: {
1656
1633
  designTokens: "設計樣式",
@@ -1860,18 +1837,5 @@ const zhTW = {
1860
1837
  collapsePromptAria: "收合 prompt"
1861
1838
  }
1862
1839
  };
1863
-
1864
- //#endregion
1865
- //#region src/locale/format.ts
1866
- function format(template, vars) {
1867
- return template.replace(/\{(\w+)\}/g, (m, key) => {
1868
- const v = vars[key];
1869
- return v === void 0 ? m : String(v);
1870
- });
1871
- }
1872
- function plural(count, forms) {
1873
- return count === 1 ? forms.one : forms.other;
1874
- }
1875
-
1876
1840
  //#endregion
1877
- export { en, format, ja, plural, zhCN, zhTW };
1841
+ export { en as i, zhCN as n, ja as r, zhTW as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-slide/core",
3
- "version": "1.19.1",
3
+ "version": "2.0.0-beta.0",
4
4
  "description": "Runtime and CLI for open-slide — write slides in slides/, we handle the rest.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -33,7 +33,7 @@
33
33
  "README.md"
34
34
  ],
35
35
  "engines": {
36
- "node": ">=18"
36
+ "node": "^20.19.0 || >=22.12.0"
37
37
  },
38
38
  "keywords": [
39
39
  "slides",
@@ -67,7 +67,7 @@
67
67
  "@dnd-kit/utilities": "^3.2.2",
68
68
  "@fontsource-variable/geist": "^5.2.8",
69
69
  "@tailwindcss/vite": "^4.3.3",
70
- "@vitejs/plugin-react": "^4.3.3",
70
+ "@vitejs/plugin-react": "^6.1.0",
71
71
  "chalk": "^6.0.0",
72
72
  "class-variance-authority": "^0.7.1",
73
73
  "clsx": "^2.1.1",
@@ -79,25 +79,25 @@
79
79
  "html-to-image": "^1.11.13",
80
80
  "lucide-react": "^1.25.0",
81
81
  "next-themes": "^0.4.6",
82
- "react": "^18.3.1",
83
- "react-dom": "^18.3.1",
82
+ "react": "^19.2.8",
83
+ "react-dom": "^19.2.8",
84
84
  "react-image-crop": "^11.0.10",
85
85
  "react-router-dom": "^7.18.1",
86
86
  "shadcn": "^4.12.0",
87
87
  "sonner": "^2.0.7",
88
88
  "tailwind-merge": "^3.5.0",
89
- "tailwindcss": "^4.2.2",
89
+ "tailwindcss": "^4.3.3",
90
90
  "tw-animate-css": "^1.4.0",
91
91
  "use-sync-external-store": "^1.6.0",
92
- "vite": "^5.4.10"
92
+ "vite": "^8.2.2"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@playwright/test": "~1.62.1",
96
- "@types/node": "^22.19.17",
97
- "@types/react": "^18.3.12",
98
- "@types/react-dom": "^18.3.1",
99
- "tsdown": "^0.9.9",
100
- "typescript": "^5.9.3"
96
+ "@types/node": "^26.2.0",
97
+ "@types/react": "^19.2.18",
98
+ "@types/react-dom": "^19.2.5",
99
+ "tsdown": "^0.22.14",
100
+ "typescript": "^7.0.2"
101
101
  },
102
102
  "scripts": {
103
103
  "build": "tsdown",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-slide
3
- description: Use this skill when the user wants to create, draft, author, or generate new slides / a presentation in this open-slide repo. Triggers on phrases like "make slides about X", "make a deck about X", "create a presentation", "draft slides for", "new slide", or when the user asks to add content under `slides/`. Do NOT use for editing the framework itself — only for authoring content inside `slides/<id>/`.
3
+ description: Use this skill when the user wants to create, draft, author, or generate new slides / a presentation in this open-slide repo. Triggers on phrases like "make slides about X", "make a deck about X", "create a presentation", "draft slides for", "new slide", "a deck with speaker notes / a script", or when the user asks to add content under `slides/`. Do NOT use for editing the framework itself — only for authoring content inside `slides/<id>/`.
4
4
  ---
5
5
 
6
6
  # Create a slide in open-slide
@@ -76,6 +76,8 @@ If the `frontend-design` skill is available, consult it for deeper aesthetic gui
76
76
 
77
77
  Read the **`slide-authoring`** skill before writing — it covers the file contract, canvas rules, type scale, spacing, and asset imports, and it includes a starter template you can copy. Don't duplicate that knowledge here; use it.
78
78
 
79
+ If the user asked for a speech script / speaker notes (in the initial request or at any point after), write it into the slide's `export const notes` array — the framework's built-in speaker-notes feature, shown in the presenter view. See **Speaker notes** in `slide-authoring` for the contract. Never deliver a script as a markdown or text file.
80
+
79
81
  ## Step 7 — Self-review
80
82
 
81
83
  Run the checklist in `slide-authoring` ("Self-review before finishing"). It covers structural correctness, layout discipline, and asset existence.
@@ -86,6 +88,7 @@ Tell the user:
86
88
 
87
89
  - The slide id and file path you created.
88
90
  - That the dev server will hot-reload — they can open `http://localhost:5173/s/<id>` (or refresh the home page).
91
+ - If you wrote speaker notes: that they live in the slide's `notes` export and show up in the viewer's notes drawer and the presenter view in present mode.
89
92
  - If dev isn't running: run the project's `dev` script from the project root with its package manager (`npm run dev`, `pnpm dev`, … — match the lockfile).
90
93
 
91
94
  Don't run the dev server yourself unless asked.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: slide-authoring
3
- description: Technical reference for writing or editing open-slide pages — file contract, 1920×1080 canvas, type scale, layout, palette/visual direction, assets, stepped reveals, page transitions, and morph transitions. Consult this whenever you are about to write or modify any file under `slides/<id>/`, including from inside the `create-slide` or `apply-comments` workflows, or for any ad-hoc slide edit. Triggers on phrases like "edit slide", "tweak this page", "fix the layout", "change the palette", "reveal one by one", "add a transition", "morph transition", "investigate the slide framework", "how do slides work here".
3
+ description: Technical reference for writing or editing open-slide pages — file contract, 1920×1080 canvas, type scale, layout, palette/visual direction, assets, speaker notes, stepped reveals, page transitions, and morph transitions. Consult this whenever you are about to write or modify any file under `slides/<id>/`, including from inside the `create-slide` or `apply-comments` workflows, or for any ad-hoc slide edit. Triggers on phrases like "edit slide", "tweak this page", "fix the layout", "change the palette", "reveal one by one", "add a transition", "morph transition", "write the speaker notes", "generate the script / talk track", "investigate the slide framework", "how do slides work here".
4
4
  ---
5
5
 
6
6
  # Authoring open-slide pages
@@ -34,7 +34,7 @@ Each framework primitive has a full reference file under `references/` in this s
34
34
  - Entry is `slides/<id>/index.tsx`. Images/videos/fonts go under `slides/<id>/assets/`.
35
35
  - Do **not** touch `package.json`, `open-slide.config.ts`, or other slides.
36
36
  - Do not add dependencies. Only `react`, `@open-slide/core`, and standard web APIs are available.
37
- - A slide is **one `index.tsx` plus `assets/`** — nothing else. Do not create sibling `.tsx`/`.ts` files (`Card.tsx`, `components/`, `helpers.ts`, etc.); helper components and constants go inside `index.tsx`. Do not create `README.md` or other prose files either.
37
+ - A slide is **one `index.tsx` plus `assets/`** — nothing else. Do not create sibling `.tsx`/`.ts` files (`Card.tsx`, `components/`, `helpers.ts`, etc.); helper components and constants go inside `index.tsx`. Do not create `README.md` or other prose files either — speaker notes / a talk script belong in the `notes` export (see **Speaker notes** below), not in a markdown file.
38
38
 
39
39
  ## File contract
40
40
 
@@ -58,6 +58,27 @@ export default [Cover, Body] satisfies Page[];
58
58
  - `meta.theme` (optional) marks the slide as built from a theme under `themes/`. The id must match a `<id>.md` basename. Surfaces a back-link chip on the slide card and lists the slide on `/themes/<id>`. Omit if the slide isn't derived from a registered theme.
59
59
  - `meta.createdAt` is an **ISO 8601 string literal** (e.g. `'2026-05-16T12:00:00Z'`) set once when the slide is scaffolded. The home page uses it for the default "newest first" sort. Always include it on new slides — **immediately before writing the file, run `node -e "console.log(new Date().toISOString())"` via Bash and paste the exact output** as the value. Don't type a timestamp from memory — you will get the date or time wrong. Must be a plain string literal (no `new Date(...)` or imports in the slide itself) — the framework reads it via a regex at build time, not by evaluating the module.
60
60
 
61
+ ## Speaker notes (`notes` export)
62
+
63
+ The framework has **built-in speaker notes**: an optional `notes` export in `index.tsx`, index-aligned with the default page array. The viewer shows them in the notes drawer and present mode shows them in the presenter view next to the timer.
64
+
65
+ **When the user asks for a speech script, talk track, or presenter notes — in any language — write it into this export, never into a markdown/text file.** A `script.md` or `notes.md` is invisible to the runtime; the `notes` export is the only place the presenter view reads.
66
+
67
+ ```tsx
68
+ export const notes: (string | undefined)[] = [
69
+ 'Open with the analyst quote, then introduce yourself.',
70
+ undefined,
71
+ `Walk through the three pillars, one beat each.
72
+ Pause for questions before moving on.`,
73
+ ];
74
+ ```
75
+
76
+ - One entry per page, same order as the `export default` array. `notes[0]` belongs to the first page.
77
+ - Entries are **plain text** — line breaks are preserved, markdown is not rendered. Use a template literal for multi-line notes, a normal string for one-liners.
78
+ - Use `undefined` for a page with no notes; trailing `undefined` entries can be dropped.
79
+ - When you add, remove, or reorder pages, re-align `notes` in the same edit — a shifted index silently attaches the wrong script to every page after it.
80
+ - Write notes as something to *say*, not a summary of what's on screen: openers, transitions, numbers to cite, timing cues.
81
+
61
82
  ## Editing an existing slide
62
83
 
63
84
  A finished slide commonly runs 1000–1800 lines. When you only need to touch one page, **don't read the whole file** — locate the page first, then read just that range:
@@ -331,6 +352,7 @@ This applies whenever the *visual element* repeats, not whenever the *data* does
331
352
  - [ ] If a page uses `<Steps>`/`<Step>`, every `<Step>` is a direct child of a `<Steps>`, and the page still reads as complete when jumped to via the overview grid (entering forward builds up; jumping in shows it fully revealed).
332
353
  - [ ] If a `SlideTransition` is declared, every page sits in one family — same duration band (140–280 ms), same easing pair, same out-then-in stagger, magnitude under 12 px / 3%. No six-different-vocabularies decks. When in doubt, omit transitions entirely. (Pages that opt into `morph` may exceed the band to match the morph — see `references/morph.md`.)
333
354
  - [ ] If a transition opts into `morph`: every morph `id` is unique per page and stable across the pair, morph geometry is pixel-constant (never measured after mount), no `transform` sits on the morph node, and entrance animations are gated behind `useIsActivePage()`.
355
+ - [ ] If the user asked for a speech script / speaker notes, it lives in `export const notes` (index-aligned with the page array) — not in a markdown or text file.
334
356
  - [ ] Nothing outside `slides/<id>/` was edited.
335
357
 
336
358
  ## Anti-patterns
@@ -346,5 +368,6 @@ This applies whenever the *visual element* repeats, not whenever the *data* does
346
368
  - ❌ Installing packages. Only `react`, `@open-slide/core`, and standard web APIs are available.
347
369
  - ❌ Writing CSS to a shared file. Inline styles or scoped classnames only.
348
370
  - ❌ Creating `README.md` or other prose files inside the slide folder.
371
+ - ❌ Delivering a speech script as a markdown or text file. The runtime only surfaces the `notes` export — anything else never reaches the presenter view.
349
372
  - ❌ Editing `package.json`, `open-slide.config.ts`, or other slides.
350
373
  - ❌ Using a primitive without reading its reference file — each `references/*.md` carries the primitive's own anti-pattern list (placeholder misuse, transition vocabulary, `<Step>` nesting, morph geometry).
package/src/app/app.tsx CHANGED
@@ -17,15 +17,13 @@ export function App() {
17
17
  opens, moving along a toolbar shows the rest instantly. */}
18
18
  <TooltipProvider delay={200}>
19
19
  <Routes>
20
- {config.build.showSlideBrowser ? (
20
+ {config.build.showSlideBrowser && (
21
21
  <Route element={<HomeShell />}>
22
22
  <Route path="/" element={<Home />} />
23
23
  <Route path="/themes" element={<ThemesGalleryPage />} />
24
24
  <Route path="/themes/:themeId" element={<ThemeDetailPage />} />
25
25
  <Route path="/assets" element={<AssetsPage />} />
26
26
  </Route>
27
- ) : (
28
- <Route path="/" element={<NotFound />} />
29
27
  )}
30
28
  <Route path="/s/:slideId" element={<Slide />} />
31
29
  <Route path="/s/:slideId/presenter" element={<Presenter />} />
Binary file
@@ -60,6 +60,7 @@ import {
60
60
  type AssetEntry,
61
61
  type AssetUsage,
62
62
  fetchSvgAsFile,
63
+ GLOBAL_ASSET_SCOPE,
63
64
  listAssetUsages,
64
65
  renamedCopy,
65
66
  revertAssetUsage,
@@ -67,15 +68,15 @@ import {
67
68
  searchSvgl,
68
69
  useAssets,
69
70
  } from '@/lib/assets';
71
+ import { dragHasFiles } from '@/lib/dom';
70
72
  import { format, useLocale } from '@/lib/use-locale';
71
- import { cn } from '@/lib/utils';
73
+ import { cn, pad2 } from '@/lib/utils';
72
74
 
73
75
  type Props = { slideId: string | null };
74
76
 
75
77
  type Scope = 'slide' | 'global';
76
78
  type ViewMode = 'grid' | 'list';
77
79
 
78
- const GLOBAL_SLIDE_ID = '@global';
79
80
  const VIEW_MODE_STORAGE_KEY = 'open-slide:asset-view-mode';
80
81
  const SORT_STORAGE_KEY = 'open-slide:asset-sort-v1';
81
82
  const GRID_COLUMNS_STORAGE_KEY = 'open-slide:asset-grid-columns-v1';
@@ -164,7 +165,7 @@ type ConflictState = {
164
165
  export function AssetView({ slideId }: Props) {
165
166
  const lockedToGlobal = slideId === null;
166
167
  const [scope, setScope] = useState<Scope>(lockedToGlobal ? 'global' : 'slide');
167
- const effectiveSlideId = scope === 'global' || slideId === null ? GLOBAL_SLIDE_ID : slideId;
168
+ const effectiveSlideId = scope === 'global' || slideId === null ? GLOBAL_ASSET_SCOPE : slideId;
168
169
  const { assets, loading, available, upload, rename, remove } = useAssets(effectiveSlideId);
169
170
  const [dragActive, setDragActive] = useState(false);
170
171
  const [conflict, setConflict] = useState<ConflictState | null>(null);
@@ -296,13 +297,13 @@ export function AssetView({ slideId }: Props) {
296
297
  aria-label={t.asset.sectionAria}
297
298
  className={cn('relative flex h-full flex-col bg-background')}
298
299
  onDragEnter={(e) => {
299
- if (!hasFiles(e)) return;
300
+ if (!dragHasFiles(e)) return;
300
301
  e.preventDefault();
301
302
  dragDepth.current += 1;
302
303
  setDragActive(true);
303
304
  }}
304
305
  onDragOver={(e) => {
305
- if (!hasFiles(e)) return;
306
+ if (!dragHasFiles(e)) return;
306
307
  e.preventDefault();
307
308
  e.dataTransfer.dropEffect = 'copy';
308
309
  }}
@@ -311,7 +312,7 @@ export function AssetView({ slideId }: Props) {
311
312
  if (dragDepth.current === 0) setDragActive(false);
312
313
  }}
313
314
  onDrop={(e) => {
314
- if (!hasFiles(e)) return;
315
+ if (!dragHasFiles(e)) return;
315
316
  e.preventDefault();
316
317
  dragDepth.current = 0;
317
318
  setDragActive(false);
@@ -341,7 +342,7 @@ export function AssetView({ slideId }: Props) {
341
342
  <span className="mx-2 opacity-50">·</span>
342
343
  <span className="folio">
343
344
  {format(assets.length === 1 ? t.asset.fileCount.one : t.asset.fileCount.other, {
344
- count: assets.length.toString().padStart(2, '0'),
345
+ count: pad2(assets.length),
345
346
  })}
346
347
  </span>
347
348
  </>
@@ -715,15 +716,6 @@ function GridColumnsControl({
715
716
  );
716
717
  }
717
718
 
718
- function hasFiles(e: React.DragEvent): boolean {
719
- const types = e.dataTransfer?.types;
720
- if (!types) return false;
721
- for (let i = 0; i < types.length; i++) {
722
- if (types[i] === 'Files') return true;
723
- }
724
- return false;
725
- }
726
-
727
719
  function AssetSortControl({
728
720
  sort,
729
721
  onKeyChange,
@@ -1,11 +1,11 @@
1
- import { Image as ImageIcon, Palette, Presentation } from 'lucide-react';
1
+ import { Presentation } from 'lucide-react';
2
2
  import { useMemo } from 'react';
3
3
  import { useNavigate } from 'react-router-dom';
4
4
  import { useLocale } from '@/lib/use-locale';
5
5
  import { useSlideTitles } from '@/lib/use-slide-titles';
6
6
  import type { Folder } from '../../lib/sdk';
7
7
  import { slideIds } from '../../lib/slides';
8
- import { FolderIconChip } from '../sidebar/folder-item';
8
+ import { FolderIconChip, SystemViewIcon } from '../sidebar/folder-item';
9
9
  import { ALL_SLIDES_ID, ASSETS_ID, DRAFT_ID, THEMES_ID } from '../sidebar/sidebar';
10
10
  import { type CommandGroupSpec, CommandMenu, type CommandSpec } from './command-menu';
11
11
 
@@ -39,14 +39,14 @@ export function HomeCommandMenu({
39
39
  {
40
40
  id: `view-${ALL_SLIDES_ID}`,
41
41
  label: t.home.slides,
42
- icon: <FolderIconChip icon={{ type: 'emoji', value: '🎞️' }} />,
42
+ icon: <SystemViewIcon kind="all" />,
43
43
  keywords: ['all', 'slides'],
44
44
  run: () => onSelectView(ALL_SLIDES_ID),
45
45
  },
46
46
  {
47
47
  id: `view-${DRAFT_ID}`,
48
48
  label: t.home.draft,
49
- icon: <FolderIconChip icon={{ type: 'emoji', value: '📝' }} />,
49
+ icon: <SystemViewIcon kind="draft" />,
50
50
  keywords: ['draft', 'unsorted'],
51
51
  run: () => onSelectView(DRAFT_ID),
52
52
  },
@@ -63,7 +63,7 @@ export function HomeCommandMenu({
63
63
  {
64
64
  id: `view-${THEMES_ID}`,
65
65
  label: t.home.themes,
66
- icon: <Palette />,
66
+ icon: <SystemViewIcon kind="themes" />,
67
67
  keywords: ['themes', 'design'],
68
68
  run: () => onSelectView(THEMES_ID),
69
69
  },
@@ -72,7 +72,7 @@ export function HomeCommandMenu({
72
72
  navigation.push({
73
73
  id: `view-${ASSETS_ID}`,
74
74
  label: t.home.assets,
75
- icon: <ImageIcon />,
75
+ icon: <SystemViewIcon kind="assets" />,
76
76
  keywords: ['assets', 'images', 'files'],
77
77
  run: () => onSelectView(ASSETS_ID),
78
78
  });
@@ -0,0 +1,80 @@
1
+ import { Check, Loader2 } from 'lucide-react';
2
+ import { format, useLocale } from '@/lib/use-locale';
3
+ import { pad2 } from '@/lib/utils';
4
+ import type { PdfExportProgress } from '../lib/export-pdf';
5
+ import type { PptxExportProgress } from '../lib/export-pptx';
6
+ import { Progress } from './ui/progress';
7
+
8
+ function ExportProgressToast({
9
+ title,
10
+ text,
11
+ done,
12
+ percent,
13
+ }: {
14
+ title: string;
15
+ text: string;
16
+ done: boolean;
17
+ percent: number;
18
+ }) {
19
+ return (
20
+ <div className="flex w-80 items-start gap-3 rounded-[8px] border border-border bg-popover px-3.5 py-3 text-popover-foreground shadow-floating">
21
+ {done ? (
22
+ <Check className="mt-0.5 size-3.5 shrink-0 text-[oklch(0.55_0.13_165)]" strokeWidth={2.5} />
23
+ ) : (
24
+ <Loader2 className="mt-0.5 size-3.5 shrink-0 animate-spin text-brand motion-reduce:animate-none" />
25
+ )}
26
+ <div className="min-w-0 flex-1">
27
+ <p className="font-heading text-[12.5px] font-semibold tracking-tight">{title}</p>
28
+ <p className="nums truncate font-mono text-[10.5px] tracking-[0.04em] text-muted-foreground">
29
+ {text}
30
+ </p>
31
+ <Progress value={Math.round(percent)} className="mt-2 h-[3px]" />
32
+ </div>
33
+ </div>
34
+ );
35
+ }
36
+
37
+ function pageCounts(progress: { current: number; total: number }) {
38
+ return {
39
+ current: pad2(progress.current),
40
+ total: pad2(progress.total),
41
+ };
42
+ }
43
+
44
+ export function PdfProgressToast({ progress }: { progress: PdfExportProgress }) {
45
+ const t = useLocale();
46
+ const text =
47
+ progress.phase === 'processing'
48
+ ? format(t.pdfToast.processing, pageCounts(progress))
49
+ : progress.phase === 'printing'
50
+ ? t.pdfToast.printing
51
+ : t.pdfToast.done;
52
+
53
+ return (
54
+ <ExportProgressToast
55
+ title={t.pdfToast.title}
56
+ text={text}
57
+ done={progress.phase === 'done'}
58
+ percent={progress.percent}
59
+ />
60
+ );
61
+ }
62
+
63
+ export function PptxProgressToast({ progress }: { progress: PptxExportProgress }) {
64
+ const t = useLocale();
65
+ const text =
66
+ progress.phase === 'processing'
67
+ ? format(t.pptxToast.processing, pageCounts(progress))
68
+ : progress.phase === 'generating'
69
+ ? t.pptxToast.generating
70
+ : t.pptxToast.done;
71
+
72
+ return (
73
+ <ExportProgressToast
74
+ title={t.pptxToast.title}
75
+ text={text}
76
+ done={progress.phase === 'done'}
77
+ percent={progress.percent}
78
+ />
79
+ );
80
+ }
@@ -22,7 +22,6 @@ type HistoryCtx = {
22
22
  undo: () => void;
23
23
  redo: () => void;
24
24
  clear: () => void;
25
- isSuppressed: () => boolean;
26
25
  };
27
26
 
28
27
  const COALESCE_WINDOW_MS = 500;
@@ -101,8 +100,6 @@ export function HistoryProvider({ children }: { children: ReactNode }) {
101
100
  setFuture([]);
102
101
  }, []);
103
102
 
104
- const isSuppressed = useCallback(() => suppressedRef.current, []);
105
-
106
103
  const value = useMemo<HistoryCtx>(
107
104
  () => ({
108
105
  canUndo: past.length > 0,
@@ -111,9 +108,8 @@ export function HistoryProvider({ children }: { children: ReactNode }) {
111
108
  undo,
112
109
  redo,
113
110
  clear,
114
- isSuppressed,
115
111
  }),
116
- [past.length, future.length, record, undo, redo, clear, isSuppressed],
112
+ [past.length, future.length, record, undo, redo, clear],
117
113
  );
118
114
 
119
115
  return <Ctx.Provider value={value}>{children}</Ctx.Provider>;
@@ -2,6 +2,7 @@ import { type CSSProperties, type HTMLAttributes, useRef, useState } from 'react
2
2
  import { toast } from 'sonner';
3
3
  import { uploadWithAutoRename } from '@/lib/assets';
4
4
  import { useLocale } from '@/lib/use-locale';
5
+ import { dragHasFiles } from '../lib/dom';
5
6
 
6
7
  export type ImagePlaceholderProps = {
7
8
  hint: string;
@@ -28,13 +29,13 @@ export function ImagePlaceholder({
28
29
  const dndProps = import.meta.env.DEV
29
30
  ? {
30
31
  onDragEnter: (e: React.DragEvent<HTMLDivElement>) => {
31
- if (uploading || !hasImageFile(e)) return;
32
+ if (uploading || !dragHasFiles(e)) return;
32
33
  e.preventDefault();
33
34
  dragDepth.current += 1;
34
35
  setDragActive(true);
35
36
  },
36
37
  onDragOver: (e: React.DragEvent<HTMLDivElement>) => {
37
- if (uploading || !hasImageFile(e)) return;
38
+ if (uploading || !dragHasFiles(e)) return;
38
39
  e.preventDefault();
39
40
  e.dataTransfer.dropEffect = 'copy';
40
41
  },
@@ -43,7 +44,7 @@ export function ImagePlaceholder({
43
44
  if (dragDepth.current === 0) setDragActive(false);
44
45
  },
45
46
  onDrop: (e: React.DragEvent<HTMLDivElement>) => {
46
- if (uploading || !hasImageFile(e)) return;
47
+ if (uploading || !dragHasFiles(e)) return;
47
48
  e.preventDefault();
48
49
  dragDepth.current = 0;
49
50
  setDragActive(false);
@@ -186,15 +187,6 @@ function DropOverlay({ label }: { label: string }) {
186
187
  );
187
188
  }
188
189
 
189
- function hasImageFile(e: React.DragEvent): boolean {
190
- const types = e.dataTransfer?.types;
191
- if (!types) return false;
192
- for (let i = 0; i < types.length; i++) {
193
- if (types[i] === 'Files') return true;
194
- }
195
- return false;
196
- }
197
-
198
190
  function pickImageFile(files: FileList): File | null {
199
191
  for (let i = 0; i < files.length; i++) {
200
192
  const f = files[i];