@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.
Files changed (100) 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 +18 -15
  21. package/src/app/assets/open-slide.png +0 -0
  22. package/src/app/components/asset-view.tsx +46 -39
  23. package/src/app/components/command/command-menu.tsx +5 -1
  24. package/src/app/components/command/command.tsx +4 -2
  25. package/src/app/components/command/home-command-menu.tsx +6 -6
  26. package/src/app/components/export-progress-toast.tsx +80 -0
  27. package/src/app/components/history-provider.tsx +1 -5
  28. package/src/app/components/icon-tooltip.tsx +24 -15
  29. package/src/app/components/image-placeholder.tsx +4 -12
  30. package/src/app/components/inspector/asset-picker-dialog.tsx +24 -32
  31. package/src/app/components/inspector/comment-widget.tsx +33 -7
  32. package/src/app/components/inspector/image-crop-dialog.tsx +9 -6
  33. package/src/app/components/inspector/inline-text-editor.tsx +798 -0
  34. package/src/app/components/inspector/inspect-overlay.tsx +35 -76
  35. package/src/app/components/inspector/inspector-panel.tsx +31 -53
  36. package/src/app/components/inspector/inspector-provider.tsx +53 -36
  37. package/src/app/components/language-toggle.tsx +2 -3
  38. package/src/app/components/notes-drawer.tsx +4 -7
  39. package/src/app/components/overview-grid.tsx +15 -8
  40. package/src/app/components/panel/panel-shell.tsx +1 -3
  41. package/src/app/components/panel/save-card.tsx +12 -3
  42. package/src/app/components/player.tsx +5 -6
  43. package/src/app/components/present/blackout-overlay.tsx +16 -3
  44. package/src/app/components/present/control-bar.tsx +21 -13
  45. package/src/app/components/present/jump-input.tsx +27 -5
  46. package/src/app/components/present/laser-pointer.tsx +34 -11
  47. package/src/app/components/present/progress-bar.tsx +1 -1
  48. package/src/app/components/present/use-presenter-channel.ts +0 -1
  49. package/src/app/components/present/use-touch-swipe.ts +9 -2
  50. package/src/app/components/sidebar/folder-item.tsx +48 -21
  51. package/src/app/components/sidebar/icon-picker.tsx +1 -1
  52. package/src/app/components/sidebar/sidebar-footer.tsx +20 -7
  53. package/src/app/components/sidebar/sidebar.tsx +91 -64
  54. package/src/app/components/slide-canvas.tsx +2 -6
  55. package/src/app/components/slide-transition-layer.tsx +48 -76
  56. package/src/app/components/style-panel/design-provider.tsx +1 -14
  57. package/src/app/components/style-panel/style-panel.tsx +16 -12
  58. package/src/app/components/style-panel/use-design.ts +1 -28
  59. package/src/app/components/theme-toggle.tsx +4 -5
  60. package/src/app/components/themes/theme-detail.tsx +11 -8
  61. package/src/app/components/themes/themes-gallery.tsx +13 -8
  62. package/src/app/components/thumbnail-rail.tsx +14 -15
  63. package/src/app/index.html +21 -0
  64. package/src/app/lib/assets.ts +6 -7
  65. package/src/app/lib/dom.ts +42 -0
  66. package/src/app/lib/export-html.ts +10 -25
  67. package/src/app/lib/export-pdf.ts +11 -28
  68. package/src/app/lib/export-pptx.ts +6 -36
  69. package/src/app/lib/folders.ts +51 -46
  70. package/src/app/lib/inspector/inline-text.ts +31 -0
  71. package/src/app/lib/inspector/pick-target.ts +38 -0
  72. package/src/app/lib/inspector/use-comments.ts +1 -1
  73. package/src/app/lib/keys.ts +18 -0
  74. package/src/app/lib/last-home-location.ts +18 -0
  75. package/src/app/lib/print-ready.ts +2 -4
  76. package/src/app/lib/slides.ts +7 -4
  77. package/src/app/lib/text-diff.ts +19 -0
  78. package/src/app/lib/use-click-page-navigation.ts +2 -6
  79. package/src/app/lib/use-is-mobile.ts +2 -14
  80. package/src/app/lib/use-media-query.ts +20 -0
  81. package/src/app/lib/use-prefers-reduced-motion.ts +5 -13
  82. package/src/app/lib/use-slide-module.ts +1 -1
  83. package/src/app/lib/use-wheel-page-navigation.ts +1 -1
  84. package/src/app/lib/utils.test.ts +25 -1
  85. package/src/app/lib/utils.ts +8 -0
  86. package/src/app/routes/home-shell.tsx +71 -64
  87. package/src/app/routes/home.tsx +50 -58
  88. package/src/app/routes/presenter.tsx +14 -23
  89. package/src/app/routes/slide.tsx +90 -77
  90. package/src/app/routes/themes.tsx +7 -8
  91. package/src/app/styles.css +40 -44
  92. package/src/locale/en.ts +2 -7
  93. package/src/locale/ja.ts +2 -7
  94. package/src/locale/types.ts +2 -7
  95. package/src/locale/zh-cn.ts +2 -7
  96. package/src/locale/zh-tw.ts +2 -7
  97. package/dist/sync-BCJDRIqo.js +0 -139
  98. package/dist/sync-j9_QPovT.js +0 -3
  99. package/src/app/components/pdf-progress-toast.tsx +0 -32
  100. package/src/app/components/pptx-progress-toast.tsx +0 -32
@@ -17,16 +17,11 @@ export const zhCN: 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
 
@@ -135,7 +130,6 @@ export const zhCN: Locale = {
135
130
  loadingAssetsEyebrow: '加载资源中',
136
131
  emptyEyebrow: '空白',
137
132
  nothingToShow: '没有可显示的内容。',
138
- emptyHintPrefix: '',
139
133
  emptyHintMust: ' 必须 ',
140
134
  emptyHintSuffix: ' 一个非空的组件数组。',
141
135
  },
@@ -240,7 +234,6 @@ export const zhCN: Locale = {
240
234
  cropFitCover: '填满',
241
235
  cropFitContain: '完整显示',
242
236
  cropApply: '应用',
243
- cropResetAria: '重置裁剪',
244
237
  agentWatching: 'Agent 正在关注',
245
238
  agentWatchingTooltip: '选取的元素会即时同步给 agent。',
246
239
  agentNotWatching: 'Agent 没在关注',
@@ -264,6 +257,8 @@ export const zhCN: Locale = {
264
257
  commentsApplyHintSuffix: ' 以应用这些更改。',
265
258
  commentDeleteAria: '删除',
266
259
  saveFailed: '保存失败:',
260
+ decreaseFontSize: '缩小字号',
261
+ increaseFontSize: '放大字号',
267
262
  },
268
263
 
269
264
  stylePanel: {
@@ -17,16 +17,11 @@ export const zhTW: 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
 
@@ -135,7 +130,6 @@ export const zhTW: Locale = {
135
130
  loadingAssetsEyebrow: '載入資源中',
136
131
  emptyEyebrow: '空白',
137
132
  nothingToShow: '沒有可顯示的內容。',
138
- emptyHintPrefix: '',
139
133
  emptyHintMust: ' 必須 ',
140
134
  emptyHintSuffix: ' 一個非空的元件陣列。',
141
135
  },
@@ -240,7 +234,6 @@ export const zhTW: Locale = {
240
234
  cropFitCover: '填滿',
241
235
  cropFitContain: '完整顯示',
242
236
  cropApply: '套用',
243
- cropResetAria: '重設裁切',
244
237
  agentWatching: 'Agent 正在關注',
245
238
  agentWatchingTooltip: '選取的元素會即時同步給 agent。',
246
239
  agentNotWatching: 'Agent 沒在關注',
@@ -264,6 +257,8 @@ export const zhTW: Locale = {
264
257
  commentsApplyHintSuffix: ' 以套用這些變更。',
265
258
  commentDeleteAria: '刪除',
266
259
  saveFailed: '儲存失敗:',
260
+ decreaseFontSize: '縮小字級',
261
+ increaseFontSize: '放大字級',
267
262
  },
268
263
 
269
264
  stylePanel: {
@@ -1,139 +0,0 @@
1
- import chalk from "chalk";
2
- import { cp, lstat, mkdir, readFile, readdir, readlink, rm, symlink } from "node:fs/promises";
3
- import path from "node:path";
4
- import { createHash } from "node:crypto";
5
- import { existsSync } from "node:fs";
6
-
7
- //#region src/cli/sync.ts
8
- async function detectSkillsDrift(skillsDir) {
9
- if (!existsSync(skillsDir)) return [];
10
- const cwd = process.cwd();
11
- const agentsSkillsDir = path.join(cwd, ".agents", "skills");
12
- const skillNames = (await readdir(skillsDir, { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name).sort();
13
- const results = [];
14
- for (const name of skillNames) {
15
- const src = path.join(skillsDir, name);
16
- const dst = path.join(agentsSkillsDir, name);
17
- const srcHash = await hashDir(src);
18
- const dstHash = existsSync(dst) ? await hashDir(dst) : null;
19
- let status;
20
- if (dstHash === null) status = "added";
21
- else if (dstHash !== srcHash) status = "updated";
22
- else status = "unchanged";
23
- results.push({
24
- name,
25
- status
26
- });
27
- }
28
- return results;
29
- }
30
- async function syncSkills(skillsDir, opts = {}) {
31
- const { dryRun = false } = opts;
32
- if (!existsSync(skillsDir)) throw new Error(`Built-in skills directory missing at ${skillsDir}. The @open-slide/core package may be corrupt — try reinstalling.`);
33
- const cwd = process.cwd();
34
- const agentsSkillsDir = path.join(cwd, ".agents", "skills");
35
- const claudeSkillsDir = path.join(cwd, ".claude", "skills");
36
- const results = await detectSkillsDrift(skillsDir);
37
- if (results.length === 0) {
38
- process.stdout.write(chalk.yellow("No skills found to sync.\n"));
39
- return;
40
- }
41
- for (const { name, status } of results) {
42
- const src = path.join(skillsDir, name);
43
- const dst = path.join(agentsSkillsDir, name);
44
- if (dryRun) continue;
45
- if (status === "unchanged") {
46
- await ensureClaudeSymlink(claudeSkillsDir, name);
47
- continue;
48
- }
49
- await mkdir(path.dirname(dst), { recursive: true });
50
- if (existsSync(dst)) await rm(dst, {
51
- recursive: true,
52
- force: true
53
- });
54
- await cp(src, dst, { recursive: true });
55
- await ensureClaudeSymlink(claudeSkillsDir, name);
56
- }
57
- printSummary(results, dryRun);
58
- }
59
- async function ensureClaudeSymlink(claudeSkillsDir, name) {
60
- await mkdir(claudeSkillsDir, { recursive: true });
61
- const linkPath = path.join(claudeSkillsDir, name);
62
- const target = path.join("..", "..", ".agents", "skills", name);
63
- if (existsSync(linkPath)) try {
64
- const stat = await lstat(linkPath);
65
- if (stat.isSymbolicLink()) {
66
- const current = await readlink(linkPath);
67
- if (current === target) return;
68
- }
69
- await rm(linkPath, {
70
- recursive: true,
71
- force: true
72
- });
73
- } catch {
74
- await rm(linkPath, {
75
- recursive: true,
76
- force: true
77
- });
78
- }
79
- try {
80
- await symlink(target, linkPath, "dir");
81
- } catch (err) {
82
- const code = err.code;
83
- if (code === "EPERM" || code === "EEXIST") {
84
- const absoluteTarget = path.resolve(claudeSkillsDir, target);
85
- await cp(absoluteTarget, linkPath, { recursive: true });
86
- } else throw err;
87
- }
88
- }
89
- async function hashDir(dir) {
90
- const hash = createHash("sha256");
91
- const files = await collectFiles(dir);
92
- files.sort();
93
- for (const rel of files) {
94
- const abs = path.join(dir, rel);
95
- const data = await readFile(abs);
96
- hash.update(rel);
97
- hash.update("\0");
98
- hash.update(data);
99
- hash.update("\0");
100
- }
101
- return hash.digest("hex");
102
- }
103
- async function collectFiles(dir, prefix = "") {
104
- const out = [];
105
- const entries = await readdir(dir, { withFileTypes: true });
106
- for (const entry of entries) {
107
- const rel = prefix ? path.join(prefix, entry.name) : entry.name;
108
- if (entry.isDirectory()) out.push(...await collectFiles(path.join(dir, entry.name), rel));
109
- else if (entry.isFile()) out.push(rel);
110
- }
111
- return out;
112
- }
113
- function printSummary(results, dryRun) {
114
- const symbols = {
115
- added: chalk.green("+"),
116
- updated: chalk.yellow("~"),
117
- unchanged: chalk.dim("=")
118
- };
119
- const labels = {
120
- added: chalk.green("added"),
121
- updated: chalk.yellow("updated"),
122
- unchanged: chalk.dim("unchanged")
123
- };
124
- const header = dryRun ? chalk.bold("Dry run — no files written:") : chalk.bold("Synced built-in skills:");
125
- process.stdout.write(`${header}\n`);
126
- for (const { name, status } of results) process.stdout.write(` ${symbols[status]} ${name} ${chalk.dim(`(${labels[status]})`)}\n`);
127
- const counts = results.reduce((acc, { status }) => {
128
- acc[status] += 1;
129
- return acc;
130
- }, {
131
- added: 0,
132
- updated: 0,
133
- unchanged: 0
134
- });
135
- process.stdout.write(chalk.dim(`\n${counts.added} added, ${counts.updated} updated, ${counts.unchanged} unchanged.\n`));
136
- }
137
-
138
- //#endregion
139
- export { detectSkillsDrift, syncSkills };
@@ -1,3 +0,0 @@
1
- import { detectSkillsDrift, syncSkills } from "./sync-BCJDRIqo.js";
2
-
3
- export { syncSkills };
@@ -1,32 +0,0 @@
1
- import { Loader2 } from 'lucide-react';
2
- import { format, useLocale } from '@/lib/use-locale';
3
- import type { PdfExportProgress } from '../lib/export-pdf';
4
- import { Progress } from './ui/progress';
5
-
6
- export function PdfProgressToast({ progress }: { progress: PdfExportProgress }) {
7
- const t = useLocale();
8
- const text =
9
- progress.phase === 'processing'
10
- ? format(t.pdfToast.processing, {
11
- current: progress.current.toString().padStart(2, '0'),
12
- total: progress.total.toString().padStart(2, '0'),
13
- })
14
- : progress.phase === 'printing'
15
- ? t.pdfToast.printing
16
- : t.pdfToast.done;
17
-
18
- return (
19
- <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">
20
- <Loader2 className="mt-0.5 size-3.5 shrink-0 animate-spin text-brand" />
21
- <div className="min-w-0 flex-1">
22
- <p className="font-heading text-[12.5px] font-semibold tracking-tight">
23
- {t.pdfToast.title}
24
- </p>
25
- <p className="truncate font-mono text-[10.5px] tracking-[0.04em] text-muted-foreground">
26
- {text}
27
- </p>
28
- <Progress value={Math.round(progress.percent)} className="mt-2 h-[3px]" />
29
- </div>
30
- </div>
31
- );
32
- }
@@ -1,32 +0,0 @@
1
- import { Loader2 } from 'lucide-react';
2
- import { format, useLocale } from '@/lib/use-locale';
3
- import type { PptxExportProgress } from '../lib/export-pptx';
4
- import { Progress } from './ui/progress';
5
-
6
- export function PptxProgressToast({ progress }: { progress: PptxExportProgress }) {
7
- const t = useLocale();
8
- const text =
9
- progress.phase === 'processing'
10
- ? format(t.pptxToast.processing, {
11
- current: progress.current.toString().padStart(2, '0'),
12
- total: progress.total.toString().padStart(2, '0'),
13
- })
14
- : progress.phase === 'generating'
15
- ? t.pptxToast.generating
16
- : t.pptxToast.done;
17
-
18
- return (
19
- <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">
20
- <Loader2 className="mt-0.5 size-3.5 shrink-0 animate-spin text-brand" />
21
- <div className="min-w-0 flex-1">
22
- <p className="font-heading text-[12.5px] font-semibold tracking-tight">
23
- {t.pptxToast.title}
24
- </p>
25
- <p className="truncate font-mono text-[10.5px] tracking-[0.04em] text-muted-foreground">
26
- {text}
27
- </p>
28
- <Progress value={Math.round(progress.percent)} className="mt-2 h-[3px]" />
29
- </div>
30
- </div>
31
- );
32
- }