@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.
- package/dist/{build-CaV_vhIw.js → build-CfAxF6Dm.js} +2 -5
- package/dist/cli/bin.d.ts +1 -1
- package/dist/cli/bin.js +139 -13
- package/dist/{config-CDHB8Oow.d.ts → config-AtA2Bqtn.d.ts} +4 -4
- package/dist/{config-GA6NMgs_.js → config-C_VI2EpT.js} +545 -776
- package/dist/{design-cpzS8aud.js → design-Cpqx7SJs.js} +1 -2
- package/dist/{dev-D57ui2yV.js → dev-BChELmc-.js} +4 -7
- package/dist/index.d.ts +7 -37
- package/dist/index.js +51 -54
- package/dist/locale/index.d.ts +2 -8
- package/dist/locale/index.js +13 -3
- package/dist/{preview-D40Zw_o0.js → preview-CcCQa268.js} +3 -7
- package/dist/{types-8HghULIe.d.ts → types-BzPSOxe-.d.ts} +5 -9
- package/dist/vite/index.d.ts +1 -4
- package/dist/vite/index.js +2 -4
- package/dist/{format-74A3B6zu.js → zh-tw-BxZ_pYqe.js} +13 -49
- package/package.json +12 -12
- package/skills/create-slide/SKILL.md +4 -1
- package/skills/slide-authoring/SKILL.md +25 -2
- package/src/app/app.tsx +1 -3
- package/src/app/assets/open-slide.png +0 -0
- package/src/app/components/asset-view.tsx +8 -16
- package/src/app/components/command/home-command-menu.tsx +6 -6
- package/src/app/components/export-progress-toast.tsx +80 -0
- package/src/app/components/history-provider.tsx +1 -5
- package/src/app/components/image-placeholder.tsx +4 -12
- package/src/app/components/inspector/asset-picker-dialog.tsx +6 -16
- package/src/app/components/inspector/image-crop-dialog.tsx +1 -4
- package/src/app/components/inspector/inline-text-editor.tsx +798 -0
- package/src/app/components/inspector/inspect-overlay.tsx +30 -72
- package/src/app/components/inspector/inspector-panel.tsx +17 -49
- package/src/app/components/inspector/inspector-provider.tsx +53 -36
- package/src/app/components/notes-drawer.tsx +2 -5
- package/src/app/components/overview-grid.tsx +5 -4
- package/src/app/components/panel/panel-shell.tsx +1 -3
- package/src/app/components/player.tsx +5 -6
- package/src/app/components/present/control-bar.tsx +4 -4
- package/src/app/components/present/jump-input.tsx +3 -2
- package/src/app/components/present/use-presenter-channel.ts +0 -1
- package/src/app/components/sidebar/folder-item.tsx +39 -16
- package/src/app/components/sidebar/sidebar-footer.tsx +7 -1
- package/src/app/components/sidebar/sidebar.tsx +91 -64
- package/src/app/components/slide-canvas.tsx +2 -6
- package/src/app/components/slide-transition-layer.tsx +48 -76
- package/src/app/components/style-panel/design-provider.tsx +1 -14
- package/src/app/components/style-panel/use-design.ts +1 -28
- package/src/app/components/themes/theme-detail.tsx +4 -4
- package/src/app/components/themes/themes-gallery.tsx +11 -6
- package/src/app/components/thumbnail-rail.tsx +7 -12
- package/src/app/lib/assets.ts +6 -7
- package/src/app/lib/dom.ts +42 -0
- package/src/app/lib/export-html.ts +10 -25
- package/src/app/lib/export-pdf.ts +11 -28
- package/src/app/lib/export-pptx.ts +6 -36
- package/src/app/lib/folders.ts +51 -46
- package/src/app/lib/inspector/inline-text.ts +31 -0
- package/src/app/lib/inspector/pick-target.ts +38 -0
- package/src/app/lib/inspector/use-comments.ts +1 -1
- package/src/app/lib/keys.ts +18 -0
- package/src/app/lib/last-home-location.ts +18 -0
- package/src/app/lib/print-ready.ts +2 -4
- package/src/app/lib/slides.ts +7 -4
- package/src/app/lib/text-diff.ts +19 -0
- package/src/app/lib/use-click-page-navigation.ts +2 -6
- package/src/app/lib/use-is-mobile.ts +2 -14
- package/src/app/lib/use-media-query.ts +20 -0
- package/src/app/lib/use-prefers-reduced-motion.ts +5 -13
- package/src/app/lib/use-slide-module.ts +1 -1
- package/src/app/lib/use-wheel-page-navigation.ts +1 -1
- package/src/app/lib/utils.test.ts +25 -1
- package/src/app/lib/utils.ts +8 -0
- package/src/app/routes/home-shell.tsx +71 -64
- package/src/app/routes/home.tsx +41 -52
- package/src/app/routes/presenter.tsx +10 -20
- package/src/app/routes/slide.tsx +84 -71
- package/src/app/routes/themes.tsx +7 -8
- package/src/app/styles.css +33 -44
- package/src/locale/en.ts +2 -7
- package/src/locale/ja.ts +2 -7
- package/src/locale/types.ts +2 -7
- package/src/locale/zh-cn.ts +2 -7
- package/src/locale/zh-tw.ts +2 -7
- package/dist/sync-BCJDRIqo.js +0 -139
- package/dist/sync-j9_QPovT.js +0 -3
- package/src/app/components/pdf-progress-toast.tsx +0 -36
- package/src/app/components/pptx-progress-toast.tsx +0 -36
package/src/app/styles.css
CHANGED
|
@@ -13,19 +13,8 @@
|
|
|
13
13
|
serif;
|
|
14
14
|
--font-mono: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo", "Cascadia Code", monospace;
|
|
15
15
|
|
|
16
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
17
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
18
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
19
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
20
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
21
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
22
16
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
23
17
|
--color-sidebar: var(--sidebar);
|
|
24
|
-
--color-chart-5: var(--chart-5);
|
|
25
|
-
--color-chart-4: var(--chart-4);
|
|
26
|
-
--color-chart-3: var(--chart-3);
|
|
27
|
-
--color-chart-2: var(--chart-2);
|
|
28
|
-
--color-chart-1: var(--chart-1);
|
|
29
18
|
--color-ring: var(--ring);
|
|
30
19
|
--color-input: var(--input);
|
|
31
20
|
--color-border: var(--border);
|
|
@@ -108,29 +97,21 @@
|
|
|
108
97
|
--brand-foreground: oklch(0.985 0 0);
|
|
109
98
|
--brand-soft: oklch(0.6 0.2 25 / 0.1);
|
|
110
99
|
|
|
111
|
-
--chart-1: oklch(0.6 0.2 25);
|
|
112
|
-
--chart-2: oklch(0.55 0.16 250);
|
|
113
|
-
--chart-3: oklch(0.55 0.15 285);
|
|
114
|
-
--chart-4: oklch(0.6 0.13 160);
|
|
115
|
-
--chart-5: oklch(0.5 0 0);
|
|
116
|
-
|
|
117
100
|
/* Tight, considered radius — drops the trendy 10px squish for 6px crisp. */
|
|
118
101
|
--radius: 0.375rem;
|
|
119
102
|
|
|
120
|
-
--sidebar
|
|
103
|
+
/* Chrome ground — matches --canvas so sidebar, rails, and panels sit on
|
|
104
|
+
one continuous surface; content floats above it as elevated cards. */
|
|
105
|
+
--sidebar: oklch(0.975 0 0);
|
|
121
106
|
--sidebar-foreground: oklch(0.185 0 0);
|
|
122
|
-
--sidebar-primary: oklch(0.185 0 0);
|
|
123
|
-
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
124
|
-
--sidebar-accent: oklch(0.94 0 0);
|
|
125
|
-
--sidebar-accent-foreground: oklch(0.185 0 0);
|
|
126
|
-
--sidebar-border: oklch(0.905 0 0);
|
|
127
|
-
--sidebar-ring: oklch(0.6 0.2 25);
|
|
128
107
|
}
|
|
129
108
|
|
|
130
109
|
.dark {
|
|
131
|
-
--
|
|
110
|
+
/* Lifted well above the near-black chrome ground (--sidebar 0.1) so the
|
|
111
|
+
elevated content cards read at a glance on dim displays. */
|
|
112
|
+
--background: oklch(0.175 0 0);
|
|
132
113
|
--foreground: oklch(0.93 0 0);
|
|
133
|
-
--canvas: oklch(0.
|
|
114
|
+
--canvas: oklch(0.1 0 0);
|
|
134
115
|
|
|
135
116
|
--card: oklch(0.19 0 0);
|
|
136
117
|
--card-foreground: oklch(0.93 0 0);
|
|
@@ -156,20 +137,8 @@
|
|
|
156
137
|
--brand-foreground: oklch(0.985 0 0);
|
|
157
138
|
--brand-soft: oklch(0.63 0.2 25 / 0.16);
|
|
158
139
|
|
|
159
|
-
--
|
|
160
|
-
--chart-2: oklch(0.65 0.15 250);
|
|
161
|
-
--chart-3: oklch(0.65 0.14 285);
|
|
162
|
-
--chart-4: oklch(0.7 0.13 160);
|
|
163
|
-
--chart-5: oklch(0.65 0 0);
|
|
164
|
-
|
|
165
|
-
--sidebar: oklch(0.17 0 0);
|
|
140
|
+
--sidebar: oklch(0.1 0 0);
|
|
166
141
|
--sidebar-foreground: oklch(0.93 0 0);
|
|
167
|
-
--sidebar-primary: oklch(0.925 0 0);
|
|
168
|
-
--sidebar-primary-foreground: oklch(0.17 0 0);
|
|
169
|
-
--sidebar-accent: oklch(0.26 0 0);
|
|
170
|
-
--sidebar-accent-foreground: oklch(0.93 0 0);
|
|
171
|
-
--sidebar-border: oklch(1 0 0 / 0.1);
|
|
172
|
-
--sidebar-ring: oklch(0.63 0.19 25);
|
|
173
142
|
}
|
|
174
143
|
|
|
175
144
|
/* Tabular numerics — pages, counts, hex values, slider readouts.
|
|
@@ -221,17 +190,37 @@
|
|
|
221
190
|
letter-spacing: 0.08em;
|
|
222
191
|
}
|
|
223
192
|
|
|
224
|
-
/* Hairline divider — 0.5px on retina, snaps to 1px elsewhere. */
|
|
225
|
-
.hairline {
|
|
226
|
-
background: var(--hairline);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
193
|
/* Numeric folio-style page count. */
|
|
230
194
|
.folio {
|
|
231
195
|
@apply nums font-mono text-[10.5px] tracking-[0.08em] text-muted-foreground;
|
|
232
196
|
}
|
|
233
197
|
}
|
|
234
198
|
|
|
199
|
+
/*
|
|
200
|
+
* Grid entrance — a quiet rise used by card grids. Pair with a small
|
|
201
|
+
* per-item animation-delay for a capped stagger.
|
|
202
|
+
*/
|
|
203
|
+
@keyframes osd-rise-in {
|
|
204
|
+
from {
|
|
205
|
+
opacity: 0;
|
|
206
|
+
transform: translateY(4px);
|
|
207
|
+
}
|
|
208
|
+
to {
|
|
209
|
+
opacity: 1;
|
|
210
|
+
transform: none;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.rise-in {
|
|
215
|
+
animation: osd-rise-in 350ms var(--ease-swift) both;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@media (prefers-reduced-motion: reduce) {
|
|
219
|
+
.rise-in {
|
|
220
|
+
animation: none;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
235
224
|
/*
|
|
236
225
|
* Comment input cue — kept from the original design but retoned to match
|
|
237
226
|
* the new palette (warm vermillion + amber instead of the AI-classic
|
package/src/locale/en.ts
CHANGED
|
@@ -17,16 +17,11 @@ export const en: Locale = {
|
|
|
17
17
|
loadFailed: 'Load failed',
|
|
18
18
|
failedToLoadSlide: 'Failed to load slide',
|
|
19
19
|
home: 'Home',
|
|
20
|
-
backToHome: 'Back to home',
|
|
21
|
-
preview: 'Preview',
|
|
22
20
|
add: 'Add',
|
|
23
21
|
done: 'Done',
|
|
24
22
|
tryAgain: 'Try again',
|
|
25
23
|
undo: 'Undo',
|
|
26
24
|
redo: 'Redo',
|
|
27
|
-
light: 'Light',
|
|
28
|
-
dark: 'Dark',
|
|
29
|
-
system: 'System',
|
|
30
25
|
selected: 'Selected',
|
|
31
26
|
},
|
|
32
27
|
|
|
@@ -137,7 +132,6 @@ export const en: Locale = {
|
|
|
137
132
|
loadingAssetsEyebrow: 'Loading assets',
|
|
138
133
|
emptyEyebrow: 'Empty',
|
|
139
134
|
nothingToShow: 'Nothing to show.',
|
|
140
|
-
emptyHintPrefix: '',
|
|
141
135
|
emptyHintMust: ' must ',
|
|
142
136
|
emptyHintSuffix: ' a non-empty array of components.',
|
|
143
137
|
},
|
|
@@ -247,7 +241,6 @@ export const en: Locale = {
|
|
|
247
241
|
cropFitCover: 'Fill',
|
|
248
242
|
cropFitContain: 'Fit',
|
|
249
243
|
cropApply: 'Apply',
|
|
250
|
-
cropResetAria: 'Reset crop',
|
|
251
244
|
leaveComment: 'Leave a comment',
|
|
252
245
|
commentPlaceholder: 'Describe a change for the agent…',
|
|
253
246
|
commentShortcutHint: '⌘/ to focus · ⌘↵ to add',
|
|
@@ -266,6 +259,8 @@ export const en: Locale = {
|
|
|
266
259
|
commentsApplyHintSuffix: ' in your agent to apply these.',
|
|
267
260
|
commentDeleteAria: 'Delete',
|
|
268
261
|
saveFailed: "Couldn't save:",
|
|
262
|
+
decreaseFontSize: 'Decrease font size',
|
|
263
|
+
increaseFontSize: 'Increase font size',
|
|
269
264
|
},
|
|
270
265
|
|
|
271
266
|
stylePanel: {
|
package/src/locale/ja.ts
CHANGED
|
@@ -17,16 +17,11 @@ export const ja: 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
|
|
|
@@ -137,7 +132,6 @@ export const ja: Locale = {
|
|
|
137
132
|
loadingAssetsEyebrow: 'アセットを読み込み中',
|
|
138
133
|
emptyEyebrow: '空',
|
|
139
134
|
nothingToShow: '表示する内容がありません。',
|
|
140
|
-
emptyHintPrefix: '',
|
|
141
135
|
emptyHintMust: ' は ',
|
|
142
136
|
emptyHintSuffix: ' で空でないコンポーネント配列をエクスポートする必要があります。',
|
|
143
137
|
},
|
|
@@ -243,7 +237,6 @@ export const ja: Locale = {
|
|
|
243
237
|
cropFitCover: '塗りつぶす',
|
|
244
238
|
cropFitContain: '全体表示',
|
|
245
239
|
cropApply: '適用',
|
|
246
|
-
cropResetAria: 'トリミングをリセット',
|
|
247
240
|
agentWatching: 'エージェント監視中',
|
|
248
241
|
agentWatchingTooltip: '選択中の要素はエージェントにリアルタイムで同期されています。',
|
|
249
242
|
agentNotWatching: 'エージェント未接続',
|
|
@@ -268,6 +261,8 @@ export const ja: Locale = {
|
|
|
268
261
|
commentsApplyHintSuffix: ' を実行して適用してください。',
|
|
269
262
|
commentDeleteAria: '削除',
|
|
270
263
|
saveFailed: '保存に失敗しました:',
|
|
264
|
+
decreaseFontSize: 'フォントサイズを縮小',
|
|
265
|
+
increaseFontSize: 'フォントサイズを拡大',
|
|
271
266
|
},
|
|
272
267
|
|
|
273
268
|
stylePanel: {
|
package/src/locale/types.ts
CHANGED
|
@@ -17,16 +17,11 @@ export type Locale = {
|
|
|
17
17
|
loadFailed: string;
|
|
18
18
|
failedToLoadSlide: string;
|
|
19
19
|
home: string;
|
|
20
|
-
backToHome: string;
|
|
21
|
-
preview: string;
|
|
22
20
|
add: string;
|
|
23
21
|
done: string;
|
|
24
22
|
tryAgain: string;
|
|
25
23
|
undo: string;
|
|
26
24
|
redo: string;
|
|
27
|
-
light: string;
|
|
28
|
-
dark: string;
|
|
29
|
-
system: string;
|
|
30
25
|
selected: string;
|
|
31
26
|
};
|
|
32
27
|
|
|
@@ -137,7 +132,6 @@ export type Locale = {
|
|
|
137
132
|
loadingAssetsEyebrow: string;
|
|
138
133
|
emptyEyebrow: string;
|
|
139
134
|
nothingToShow: string;
|
|
140
|
-
emptyHintPrefix: string;
|
|
141
135
|
emptyHintMust: string;
|
|
142
136
|
emptyHintSuffix: string;
|
|
143
137
|
};
|
|
@@ -249,7 +243,6 @@ export type Locale = {
|
|
|
249
243
|
cropFitCover: string;
|
|
250
244
|
cropFitContain: string;
|
|
251
245
|
cropApply: string;
|
|
252
|
-
cropResetAria: string;
|
|
253
246
|
leaveComment: string;
|
|
254
247
|
commentPlaceholder: string;
|
|
255
248
|
commentShortcutHint: string;
|
|
@@ -266,6 +259,8 @@ export type Locale = {
|
|
|
266
259
|
commentDeleteAria: string;
|
|
267
260
|
/** Prefix for the toast shown when one or more buffered edits fail to write to disk. */
|
|
268
261
|
saveFailed: string;
|
|
262
|
+
decreaseFontSize: string;
|
|
263
|
+
increaseFontSize: string;
|
|
269
264
|
};
|
|
270
265
|
|
|
271
266
|
stylePanel: {
|
package/src/locale/zh-cn.ts
CHANGED
|
@@ -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: {
|
package/src/locale/zh-tw.ts
CHANGED
|
@@ -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: {
|
package/dist/sync-BCJDRIqo.js
DELETED
|
@@ -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 };
|
package/dist/sync-j9_QPovT.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Check, 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
|
-
{progress.phase === 'done' ? (
|
|
21
|
-
<Check className="mt-0.5 size-3.5 shrink-0 text-[oklch(0.55_0.13_165)]" strokeWidth={2.5} />
|
|
22
|
-
) : (
|
|
23
|
-
<Loader2 className="mt-0.5 size-3.5 shrink-0 animate-spin text-brand motion-reduce:animate-none" />
|
|
24
|
-
)}
|
|
25
|
-
<div className="min-w-0 flex-1">
|
|
26
|
-
<p className="font-heading text-[12.5px] font-semibold tracking-tight">
|
|
27
|
-
{t.pdfToast.title}
|
|
28
|
-
</p>
|
|
29
|
-
<p className="nums truncate font-mono text-[10.5px] tracking-[0.04em] text-muted-foreground">
|
|
30
|
-
{text}
|
|
31
|
-
</p>
|
|
32
|
-
<Progress value={Math.round(progress.percent)} className="mt-2 h-[3px]" />
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Check, 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
|
-
{progress.phase === 'done' ? (
|
|
21
|
-
<Check className="mt-0.5 size-3.5 shrink-0 text-[oklch(0.55_0.13_165)]" strokeWidth={2.5} />
|
|
22
|
-
) : (
|
|
23
|
-
<Loader2 className="mt-0.5 size-3.5 shrink-0 animate-spin text-brand motion-reduce:animate-none" />
|
|
24
|
-
)}
|
|
25
|
-
<div className="min-w-0 flex-1">
|
|
26
|
-
<p className="font-heading text-[12.5px] font-semibold tracking-tight">
|
|
27
|
-
{t.pptxToast.title}
|
|
28
|
-
</p>
|
|
29
|
-
<p className="nums truncate font-mono text-[10.5px] tracking-[0.04em] text-muted-foreground">
|
|
30
|
-
{text}
|
|
31
|
-
</p>
|
|
32
|
-
<Progress value={Math.round(progress.percent)} className="mt-2 h-[3px]" />
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
}
|