@open-slide/core 1.13.6 → 1.15.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-OAZ8maw5.js → build-BsaslS8C.js} +1 -1
- package/dist/cli/bin.js +3 -3
- package/dist/{config-CU_NISD6.js → config-BOc3-oDV.js} +38 -3
- package/dist/{config-CvzwK0tq.d.ts → config-CE2sKgqH.d.ts} +1 -1
- package/dist/dev-BU7OY0ai.js +94 -0
- package/dist/{format-CXtO6ORA.js → format-afijk371.js} +140 -8
- package/dist/index.d.ts +7 -7
- package/dist/index.js +4 -2
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/{preview-DZLZ3L9v.js → preview-DbL7Wt77.js} +1 -1
- package/dist/{types-DucrShh9.d.ts → types-GA4ekcYB.d.ts} +37 -0
- package/dist/vite/index.d.ts +2 -2
- package/dist/vite/index.js +1 -1
- package/package.json +2 -2
- package/src/app/components/asset-view.tsx +762 -63
- package/src/app/components/inspector/image-crop-dialog.tsx +3 -3
- package/src/app/components/inspector/inspect-overlay.tsx +44 -32
- package/src/app/components/inspector/inspector-panel.tsx +31 -26
- package/src/app/components/language-toggle.tsx +1 -1
- package/src/app/components/overview-grid.tsx +14 -12
- package/src/app/components/present/control-bar.tsx +24 -21
- package/src/app/components/present/progress-bar.tsx +1 -1
- package/src/app/components/sidebar/folder-item.tsx +26 -22
- package/src/app/components/sidebar/icon-picker.tsx +8 -8
- package/src/app/components/sidebar/sidebar-footer.tsx +100 -31
- package/src/app/components/sidebar/sidebar.tsx +22 -18
- package/src/app/components/style-panel/style-panel.tsx +8 -4
- package/src/app/components/theme-toggle.tsx +3 -3
- package/src/app/components/themes/theme-detail.tsx +2 -2
- package/src/app/components/themes/themes-gallery.tsx +1 -1
- package/src/app/components/thumbnail-rail-scroll.test.ts +60 -0
- package/src/app/components/thumbnail-rail-scroll.ts +33 -0
- package/src/app/components/thumbnail-rail.tsx +235 -66
- package/src/app/components/ui/badge.tsx +16 -13
- package/src/app/components/ui/button.tsx +4 -10
- package/src/app/components/ui/context-menu.tsx +46 -36
- package/src/app/components/ui/dialog.tsx +11 -13
- package/src/app/components/ui/dropdown-menu.tsx +59 -37
- package/src/app/components/ui/label.tsx +2 -5
- package/src/app/components/ui/popover.tsx +25 -18
- package/src/app/components/ui/progress.tsx +8 -6
- package/src/app/components/ui/scroll-area.tsx +5 -5
- package/src/app/components/ui/select.tsx +40 -41
- package/src/app/components/ui/separator.tsx +3 -5
- package/src/app/components/ui/slider.tsx +25 -18
- package/src/app/components/ui/tabs.tsx +8 -8
- package/src/app/components/ui/toggle-group.tsx +8 -7
- package/src/app/components/ui/toggle.tsx +5 -5
- package/src/app/components/ui/tooltip.tsx +39 -22
- package/src/app/lib/asset-filter.test.ts +176 -0
- package/src/app/lib/asset-filter.ts +80 -0
- package/src/app/lib/assets.ts +19 -4
- package/src/app/routes/home-shell.tsx +24 -20
- package/src/app/routes/home.tsx +48 -42
- package/src/app/routes/presenter.tsx +1 -1
- package/src/app/routes/slide.tsx +54 -47
- package/src/app/styles.css +86 -110
- package/src/locale/en.ts +34 -1
- package/src/locale/ja.ts +34 -2
- package/src/locale/types.ts +37 -0
- package/src/locale/zh-cn.ts +34 -1
- package/src/locale/zh-tw.ts +34 -1
- package/dist/dev-C78J1TLR.js +0 -20
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { AssetEntry } from './assets';
|
|
2
|
+
|
|
3
|
+
export type AssetUsageFilter = 'all' | 'used' | 'unused';
|
|
4
|
+
export type AssetTypeFilter = 'all' | 'image' | 'font' | 'video' | 'other';
|
|
5
|
+
export type AssetSortKey = 'name' | 'modified' | 'size' | 'type';
|
|
6
|
+
export type AssetSortDirection = 'asc' | 'desc';
|
|
7
|
+
|
|
8
|
+
export type AssetFilterOptions = {
|
|
9
|
+
usage: AssetUsageFilter;
|
|
10
|
+
type: AssetTypeFilter;
|
|
11
|
+
search: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type AssetSortOptions = {
|
|
15
|
+
key: AssetSortKey;
|
|
16
|
+
direction: AssetSortDirection;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type SpecificAssetType = Exclude<AssetTypeFilter, 'all'>;
|
|
20
|
+
|
|
21
|
+
function assetType(mime: string): SpecificAssetType {
|
|
22
|
+
const normalizedMime = mime.toLowerCase();
|
|
23
|
+
if (normalizedMime.startsWith('image/')) return 'image';
|
|
24
|
+
if (normalizedMime.startsWith('font/')) return 'font';
|
|
25
|
+
if (normalizedMime.startsWith('video/')) return 'video';
|
|
26
|
+
return 'other';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function filterAssets(
|
|
30
|
+
assets: readonly AssetEntry[],
|
|
31
|
+
{ usage, type, search }: AssetFilterOptions,
|
|
32
|
+
): AssetEntry[] {
|
|
33
|
+
const query = search.trim().toLowerCase();
|
|
34
|
+
const filtered: AssetEntry[] = [];
|
|
35
|
+
|
|
36
|
+
for (const asset of assets) {
|
|
37
|
+
if (usage === 'used' && asset.unused) continue;
|
|
38
|
+
if (usage === 'unused' && !asset.unused) continue;
|
|
39
|
+
if (type !== 'all' && assetType(asset.mime) !== type) continue;
|
|
40
|
+
if (query && !asset.name.toLowerCase().includes(query)) continue;
|
|
41
|
+
filtered.push(asset);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return filtered;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const nameCollator = new Intl.Collator(undefined, {
|
|
48
|
+
numeric: true,
|
|
49
|
+
sensitivity: 'base',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
function compareNames(left: AssetEntry, right: AssetEntry): number {
|
|
53
|
+
return nameCollator.compare(left.name, right.name);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function comparePrimary(left: AssetEntry, right: AssetEntry, key: AssetSortKey): number {
|
|
57
|
+
switch (key) {
|
|
58
|
+
case 'name':
|
|
59
|
+
return compareNames(left, right);
|
|
60
|
+
case 'modified':
|
|
61
|
+
return left.mtime - right.mtime;
|
|
62
|
+
case 'size':
|
|
63
|
+
return left.size - right.size;
|
|
64
|
+
case 'type':
|
|
65
|
+
return left.mime.toLowerCase().localeCompare(right.mime.toLowerCase());
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function sortAssets(
|
|
70
|
+
assets: readonly AssetEntry[],
|
|
71
|
+
{ key, direction }: AssetSortOptions,
|
|
72
|
+
): AssetEntry[] {
|
|
73
|
+
return [...assets].sort((left, right) => {
|
|
74
|
+
const primaryComparison = comparePrimary(left, right, key);
|
|
75
|
+
if (primaryComparison !== 0) {
|
|
76
|
+
return direction === 'asc' ? primaryComparison : -primaryComparison;
|
|
77
|
+
}
|
|
78
|
+
return compareNames(left, right);
|
|
79
|
+
});
|
|
80
|
+
}
|
package/src/app/lib/assets.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
export type AssetEntry = {
|
|
4
4
|
name: string;
|
|
5
5
|
size: number;
|
|
6
|
+
createdAt: number;
|
|
6
7
|
mtime: number;
|
|
7
8
|
mime: string;
|
|
8
9
|
url: string;
|
|
@@ -85,10 +86,12 @@ export async function uploadWithAutoRename(
|
|
|
85
86
|
}
|
|
86
87
|
if (!res.ok) return { ok: false, status: res.status, entry: null };
|
|
87
88
|
const body = (await res.json().catch(() => null)) as Partial<AssetEntry> | null;
|
|
89
|
+
const now = Date.now();
|
|
88
90
|
const entry: AssetEntry = {
|
|
89
91
|
name: body?.name ?? uploaded.name,
|
|
90
92
|
size: body?.size ?? uploaded.size,
|
|
91
|
-
|
|
93
|
+
createdAt: body?.createdAt ?? now,
|
|
94
|
+
mtime: body?.mtime ?? now,
|
|
92
95
|
mime: body?.mime ?? uploaded.type ?? 'application/octet-stream',
|
|
93
96
|
url: body?.url ?? `/__assets/${slideId}/${encodeURIComponent(uploaded.name)}`,
|
|
94
97
|
unused: body?.unused ?? false,
|
|
@@ -197,14 +200,26 @@ export function useAssets(slideId: string): UseAssetsResult {
|
|
|
197
200
|
|
|
198
201
|
useEffect(() => {
|
|
199
202
|
if (!available || !import.meta.hot) return;
|
|
200
|
-
const
|
|
203
|
+
const assetHandler = (data: { slideId?: string } | undefined) => {
|
|
201
204
|
if (!data || data.slideId === slideId) {
|
|
202
205
|
refresh().catch(() => {});
|
|
203
206
|
}
|
|
204
207
|
};
|
|
205
|
-
|
|
208
|
+
const slideHandler = (data: { slideId?: unknown; slideIds?: unknown } | undefined) => {
|
|
209
|
+
const changedIds = Array.isArray(data?.slideIds)
|
|
210
|
+
? data.slideIds
|
|
211
|
+
: typeof data?.slideId === 'string'
|
|
212
|
+
? [data.slideId]
|
|
213
|
+
: [];
|
|
214
|
+
if (slideId === '@global' ? changedIds.length > 0 : changedIds.includes(slideId)) {
|
|
215
|
+
refresh().catch(() => {});
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
import.meta.hot.on('open-slide:assets-changed', assetHandler);
|
|
219
|
+
import.meta.hot.on('open-slide:slide-changed', slideHandler);
|
|
206
220
|
return () => {
|
|
207
|
-
import.meta.hot?.off('open-slide:assets-changed',
|
|
221
|
+
import.meta.hot?.off('open-slide:assets-changed', assetHandler);
|
|
222
|
+
import.meta.hot?.off('open-slide:slide-changed', slideHandler);
|
|
208
223
|
};
|
|
209
224
|
}, [slideId, refresh]);
|
|
210
225
|
|
|
@@ -170,25 +170,27 @@ export function HomeShell() {
|
|
|
170
170
|
/>
|
|
171
171
|
</div>
|
|
172
172
|
|
|
173
|
-
<div className="
|
|
173
|
+
<div className="relative flex min-w-0 flex-1 flex-col overflow-y-auto bg-canvas">
|
|
174
174
|
<div className="flex items-center justify-between border-b border-hairline bg-sidebar px-4 py-3 md:hidden">
|
|
175
175
|
<h1 className="font-heading text-lg font-bold tracking-tight">{t.home.appTitle}</h1>
|
|
176
176
|
<div className="-mr-1.5 flex items-center gap-0.5">
|
|
177
177
|
<LanguageToggle />
|
|
178
178
|
<ThemeToggle />
|
|
179
179
|
<DropdownMenu>
|
|
180
|
-
<DropdownMenuTrigger
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
180
|
+
<DropdownMenuTrigger
|
|
181
|
+
render={
|
|
182
|
+
<button
|
|
183
|
+
type="button"
|
|
184
|
+
aria-label={t.home.menu}
|
|
185
|
+
className="flex size-8 items-center justify-center rounded-[6px] text-muted-foreground hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground"
|
|
186
|
+
>
|
|
187
|
+
<Menu className="size-4" />
|
|
188
|
+
</button>
|
|
189
|
+
}
|
|
190
|
+
/>
|
|
189
191
|
<DropdownMenuContent align="end" className="min-w-[200px]">
|
|
190
192
|
<DropdownMenuItem
|
|
191
|
-
|
|
193
|
+
onClick={() => selectFolder(ALL_SLIDES_ID)}
|
|
192
194
|
className={cn(
|
|
193
195
|
selectedId !== THEMES_ID &&
|
|
194
196
|
selectedId !== ASSETS_ID &&
|
|
@@ -200,21 +202,23 @@ export function HomeShell() {
|
|
|
200
202
|
<span className="folio">{slideIds.length.toString().padStart(2, '0')}</span>
|
|
201
203
|
</DropdownMenuItem>
|
|
202
204
|
<DropdownMenuItem
|
|
203
|
-
|
|
205
|
+
onClick={() => selectFolder(THEMES_ID)}
|
|
204
206
|
className={cn(selectedId === THEMES_ID && 'bg-muted text-foreground')}
|
|
205
207
|
>
|
|
206
208
|
<FolderIconChip icon={{ type: 'emoji', value: '🎨' }} />
|
|
207
209
|
<span className="flex-1 truncate">{t.home.themes}</span>
|
|
208
210
|
<span className="folio">{themeRegistry.length.toString().padStart(2, '0')}</span>
|
|
209
211
|
</DropdownMenuItem>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
{import.meta.env.DEV && (
|
|
213
|
+
<DropdownMenuItem
|
|
214
|
+
onClick={() => selectFolder(ASSETS_ID)}
|
|
215
|
+
className={cn(selectedId === ASSETS_ID && 'bg-muted text-foreground')}
|
|
216
|
+
>
|
|
217
|
+
<FolderIconChip icon={{ type: 'emoji', value: '🗂️' }} />
|
|
218
|
+
<span className="flex-1 truncate">{t.home.assets}</span>
|
|
219
|
+
<span className="folio">{globalAssets.length.toString().padStart(2, '0')}</span>
|
|
220
|
+
</DropdownMenuItem>
|
|
221
|
+
)}
|
|
218
222
|
</DropdownMenuContent>
|
|
219
223
|
</DropdownMenu>
|
|
220
224
|
</div>
|
package/src/app/routes/home.tsx
CHANGED
|
@@ -143,18 +143,20 @@ export function Home() {
|
|
|
143
143
|
{title}
|
|
144
144
|
</h1>
|
|
145
145
|
<DropdownMenu>
|
|
146
|
-
<DropdownMenuTrigger
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
<DropdownMenuTrigger
|
|
147
|
+
render={
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
aria-label={t.home.folders}
|
|
151
|
+
className="flex size-7 items-center justify-center rounded-[6px] border border-border bg-card text-muted-foreground hover:text-foreground aria-expanded:border-foreground/40 aria-expanded:text-foreground md:hidden"
|
|
152
|
+
>
|
|
153
|
+
<ChevronDown className="size-4" />
|
|
154
|
+
</button>
|
|
155
|
+
}
|
|
156
|
+
/>
|
|
155
157
|
<DropdownMenuContent align="start" className="min-w-[200px]">
|
|
156
158
|
<DropdownMenuItem
|
|
157
|
-
|
|
159
|
+
onClick={() => selectFolder(ALL_SLIDES_ID)}
|
|
158
160
|
className={cn(isAll && 'bg-muted text-foreground')}
|
|
159
161
|
>
|
|
160
162
|
<FolderIconChip icon={{ type: 'emoji', value: '🎞️' }} />
|
|
@@ -162,7 +164,7 @@ export function Home() {
|
|
|
162
164
|
<span className="folio">{slideIds.length.toString().padStart(2, '0')}</span>
|
|
163
165
|
</DropdownMenuItem>
|
|
164
166
|
<DropdownMenuItem
|
|
165
|
-
|
|
167
|
+
onClick={() => selectFolder(DRAFT_ID)}
|
|
166
168
|
className={cn(isDraft && 'bg-muted text-foreground')}
|
|
167
169
|
>
|
|
168
170
|
<FolderIconChip icon={{ type: 'emoji', value: '📝' }} />
|
|
@@ -172,7 +174,7 @@ export function Home() {
|
|
|
172
174
|
{manifest.folders.map((f) => (
|
|
173
175
|
<DropdownMenuItem
|
|
174
176
|
key={f.id}
|
|
175
|
-
|
|
177
|
+
onClick={() => selectFolder(f.id)}
|
|
176
178
|
className={cn(selectedId === f.id && 'bg-muted text-foreground')}
|
|
177
179
|
>
|
|
178
180
|
<FolderIconChip icon={f.icon} />
|
|
@@ -289,24 +291,26 @@ function SortControl({ value, onChange }: { value: SortKey; onChange: (next: Sor
|
|
|
289
291
|
);
|
|
290
292
|
return (
|
|
291
293
|
<DropdownMenu>
|
|
292
|
-
<DropdownMenuTrigger
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
294
|
+
<DropdownMenuTrigger
|
|
295
|
+
render={
|
|
296
|
+
<button
|
|
297
|
+
type="button"
|
|
298
|
+
aria-label={`${t.home.sortLabel}: ${labels[value]}`}
|
|
299
|
+
className="flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-[6px] border border-border bg-background pl-2 pr-1.5 text-[12.5px] font-medium text-foreground outline-none hover:bg-muted focus-visible:border-foreground/40 focus-visible:ring-2 focus-visible:ring-ring/30"
|
|
300
|
+
>
|
|
301
|
+
<FieldIcon k={value} className="size-3.5 text-muted-foreground" />
|
|
302
|
+
<span>{labels[value]}</span>
|
|
303
|
+
<ChevronDown className="size-3 text-muted-foreground" aria-hidden />
|
|
304
|
+
</button>
|
|
305
|
+
}
|
|
306
|
+
/>
|
|
303
307
|
<DropdownMenuContent align="end" className="min-w-[180px]">
|
|
304
308
|
{SORT_KEYS.map((key) => {
|
|
305
309
|
const active = value === key;
|
|
306
310
|
return (
|
|
307
311
|
<DropdownMenuItem
|
|
308
312
|
key={key}
|
|
309
|
-
|
|
313
|
+
onClick={() => onChange(key)}
|
|
310
314
|
className={cn(active && 'bg-muted text-foreground')}
|
|
311
315
|
>
|
|
312
316
|
<FieldIcon k={key} className="size-3.5 text-muted-foreground" />
|
|
@@ -518,7 +522,7 @@ function SlideCard({
|
|
|
518
522
|
</SlideCanvas>
|
|
519
523
|
</div>
|
|
520
524
|
) : (
|
|
521
|
-
<div className="grid h-full w-full place-items-center text-[10px] tracking-[0.
|
|
525
|
+
<div className="grid h-full w-full place-items-center text-[10px] tracking-[0.08em] uppercase text-muted-foreground/60">
|
|
522
526
|
{tCard.common.loading}
|
|
523
527
|
</div>
|
|
524
528
|
)}
|
|
@@ -544,33 +548,35 @@ function SlideCard({
|
|
|
544
548
|
{import.meta.env.DEV && (
|
|
545
549
|
<div className="absolute right-2 top-2">
|
|
546
550
|
<DropdownMenu>
|
|
547
|
-
<DropdownMenuTrigger
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
e
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
551
|
+
<DropdownMenuTrigger
|
|
552
|
+
render={
|
|
553
|
+
<button
|
|
554
|
+
type="button"
|
|
555
|
+
onClick={(e) => {
|
|
556
|
+
e.stopPropagation();
|
|
557
|
+
e.preventDefault();
|
|
558
|
+
}}
|
|
559
|
+
className="flex size-7 items-center justify-center rounded-[5px] bg-card/90 text-foreground shadow-edge ring-1 ring-border opacity-0 backdrop-blur hover:bg-card group-hover:opacity-100 aria-expanded:opacity-100 motion-safe:transition-opacity"
|
|
560
|
+
aria-label={tCard.home.slideActions}
|
|
561
|
+
>
|
|
562
|
+
<MoreHorizontal className="size-3.5" />
|
|
563
|
+
</button>
|
|
564
|
+
}
|
|
565
|
+
/>
|
|
560
566
|
<DropdownMenuContent align="end" className="min-w-[160px]">
|
|
561
|
-
<DropdownMenuItem
|
|
567
|
+
<DropdownMenuItem onClick={() => setDialog('rename')}>
|
|
562
568
|
<Pencil />
|
|
563
569
|
{tCard.common.rename}
|
|
564
570
|
</DropdownMenuItem>
|
|
565
|
-
<DropdownMenuItem
|
|
571
|
+
<DropdownMenuItem onClick={() => onDuplicate()}>
|
|
566
572
|
<Copy />
|
|
567
573
|
{tCard.home.duplicate}
|
|
568
574
|
</DropdownMenuItem>
|
|
569
|
-
<DropdownMenuItem
|
|
575
|
+
<DropdownMenuItem onClick={() => setDialog('move')}>
|
|
570
576
|
<FolderInput />
|
|
571
577
|
{tCard.home.moveToFolder}
|
|
572
578
|
</DropdownMenuItem>
|
|
573
|
-
<DropdownMenuItem variant="destructive"
|
|
579
|
+
<DropdownMenuItem variant="destructive" onClick={() => setDialog('delete')}>
|
|
574
580
|
<Trash2 />
|
|
575
581
|
{tCard.common.delete}
|
|
576
582
|
</DropdownMenuItem>
|
|
@@ -187,7 +187,7 @@ export function Presenter() {
|
|
|
187
187
|
<div
|
|
188
188
|
aria-hidden
|
|
189
189
|
className={cn(
|
|
190
|
-
'pointer-events-none absolute inset-0 grid place-items-center text-[11px] tracking-[0.
|
|
190
|
+
'pointer-events-none absolute inset-0 grid place-items-center text-[11px] tracking-[0.08em] uppercase',
|
|
191
191
|
blackout === 'black' ? 'bg-black text-white/35' : 'bg-white text-black/35',
|
|
192
192
|
)}
|
|
193
193
|
>
|
package/src/app/routes/slide.tsx
CHANGED
|
@@ -497,35 +497,37 @@ export function Slide() {
|
|
|
497
497
|
|
|
498
498
|
const exportMenuItems = (
|
|
499
499
|
<>
|
|
500
|
-
<DropdownMenuItem disabled={exporting}
|
|
500
|
+
<DropdownMenuItem disabled={exporting} onClick={exportHtml}>
|
|
501
501
|
<FileCode2 />
|
|
502
502
|
{t.slide.exportAsHtml}
|
|
503
503
|
</DropdownMenuItem>
|
|
504
|
-
<DropdownMenuItem disabled={exporting}
|
|
504
|
+
<DropdownMenuItem disabled={exporting} onClick={exportPdf}>
|
|
505
505
|
<FileText />
|
|
506
506
|
{t.slide.exportAsPdf}
|
|
507
507
|
</DropdownMenuItem>
|
|
508
508
|
<DropdownMenuSeparator />
|
|
509
|
-
<DropdownMenuItem disabled={exporting}
|
|
509
|
+
<DropdownMenuItem disabled={exporting} onClick={exportImagePptx}>
|
|
510
510
|
<FileImage />
|
|
511
511
|
{t.slide.exportAsImagePptx}
|
|
512
512
|
</DropdownMenuItem>
|
|
513
|
-
<TooltipProvider
|
|
513
|
+
<TooltipProvider delay={200}>
|
|
514
514
|
<Tooltip>
|
|
515
|
-
<TooltipTrigger
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
<
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
515
|
+
<TooltipTrigger
|
|
516
|
+
render={
|
|
517
|
+
<div
|
|
518
|
+
aria-disabled
|
|
519
|
+
className="relative flex cursor-help items-center justify-between gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] opacity-45 select-none [&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:opacity-80"
|
|
520
|
+
>
|
|
521
|
+
<span className="flex items-center gap-2">
|
|
522
|
+
<Presentation />
|
|
523
|
+
{t.slide.exportAsPptx}
|
|
524
|
+
</span>
|
|
525
|
+
<span className="rounded-[3px] bg-muted px-1.5 py-0.5 font-mono text-[9.5px] tracking-[0.04em] text-muted-foreground">
|
|
526
|
+
{t.slide.comingSoon}
|
|
527
|
+
</span>
|
|
528
|
+
</div>
|
|
529
|
+
}
|
|
530
|
+
/>
|
|
529
531
|
<TooltipContent
|
|
530
532
|
side="left"
|
|
531
533
|
className="w-max max-w-[min(520px,calc(100vw-2rem))] text-center leading-relaxed"
|
|
@@ -546,11 +548,14 @@ export function Slide() {
|
|
|
546
548
|
<header className="relative flex h-12 shrink-0 items-center gap-2 border-b border-hairline bg-sidebar/85 px-2 backdrop-blur-md md:px-3">
|
|
547
549
|
<div className="flex flex-1 items-center gap-1.5 md:flex-none md:gap-2">
|
|
548
550
|
{showSlideBrowser && (
|
|
549
|
-
<
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
551
|
+
<Link
|
|
552
|
+
to="/"
|
|
553
|
+
aria-label={t.slide.backToHome}
|
|
554
|
+
title={t.slide.home}
|
|
555
|
+
className={buttonVariants({ variant: 'ghost', size: 'icon-sm' })}
|
|
556
|
+
>
|
|
557
|
+
<ChevronLeft className="size-4" />
|
|
558
|
+
</Link>
|
|
554
559
|
)}
|
|
555
560
|
<span aria-hidden className="mx-0.5 hidden h-5 w-px bg-hairline md:block" />
|
|
556
561
|
{import.meta.env.DEV && (
|
|
@@ -656,7 +661,7 @@ export function Slide() {
|
|
|
656
661
|
)}
|
|
657
662
|
</DropdownMenuTrigger>
|
|
658
663
|
<DropdownMenuContent align="end" className="min-w-[200px]">
|
|
659
|
-
<DropdownMenuItem
|
|
664
|
+
<DropdownMenuItem onClick={copyLink}>
|
|
660
665
|
<Link2 />
|
|
661
666
|
{t.slide.copyLink}
|
|
662
667
|
</DropdownMenuItem>
|
|
@@ -697,18 +702,18 @@ export function Slide() {
|
|
|
697
702
|
<ChevronDown className="size-3.5" />
|
|
698
703
|
</DropdownMenuTrigger>
|
|
699
704
|
<DropdownMenuContent align="end" className="min-w-[200px]">
|
|
700
|
-
<DropdownMenuItem
|
|
705
|
+
<DropdownMenuItem onClick={() => setPlayMode('window')}>
|
|
701
706
|
<Play />
|
|
702
707
|
{t.slide.presentInWindow}
|
|
703
708
|
<DropdownMenuShortcut>↵</DropdownMenuShortcut>
|
|
704
709
|
</DropdownMenuItem>
|
|
705
|
-
<DropdownMenuItem
|
|
710
|
+
<DropdownMenuItem onClick={() => setPlayMode('fullscreen')}>
|
|
706
711
|
<Maximize />
|
|
707
712
|
{t.slide.presentFullscreen}
|
|
708
713
|
<DropdownMenuShortcut>F</DropdownMenuShortcut>
|
|
709
714
|
</DropdownMenuItem>
|
|
710
715
|
<DropdownMenuItem
|
|
711
|
-
|
|
716
|
+
onClick={() => {
|
|
712
717
|
if (slideId) openPresenterWindow(slideId);
|
|
713
718
|
setPlayMode('window');
|
|
714
719
|
}}
|
|
@@ -746,7 +751,7 @@ export function Slide() {
|
|
|
746
751
|
ref={slideViewportRef}
|
|
747
752
|
data-inspector-root
|
|
748
753
|
data-slide-id={slideId}
|
|
749
|
-
className="
|
|
754
|
+
className="relative min-h-0 min-w-0 flex-1 bg-canvas p-2 md:p-10"
|
|
750
755
|
>
|
|
751
756
|
<SlideViewportNavigation
|
|
752
757
|
targetRef={slideViewportRef}
|
|
@@ -942,26 +947,28 @@ function AgentConnectedBadge() {
|
|
|
942
947
|
const t = useLocale();
|
|
943
948
|
const connected = useAgentSocketConnected();
|
|
944
949
|
return (
|
|
945
|
-
<TooltipProvider
|
|
950
|
+
<TooltipProvider delay={200}>
|
|
946
951
|
<Tooltip>
|
|
947
|
-
<TooltipTrigger
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
952
|
+
<TooltipTrigger
|
|
953
|
+
render={
|
|
954
|
+
<button
|
|
955
|
+
type="button"
|
|
956
|
+
className="ml-1 flex shrink-0 cursor-help items-center gap-1.5 rounded-[3px] border border-hairline bg-card px-1.5 py-0.5 text-[10.5px] text-foreground/85 outline-none focus-visible:ring-2 focus-visible:ring-ring/30"
|
|
957
|
+
>
|
|
958
|
+
<span aria-hidden className="relative flex size-1.5 items-center justify-center">
|
|
959
|
+
{connected ? (
|
|
960
|
+
<>
|
|
961
|
+
<span className="absolute inline-flex size-full animate-ping rounded-full bg-emerald-500 opacity-60" />
|
|
962
|
+
<span className="relative inline-flex size-1.5 rounded-full bg-emerald-500" />
|
|
963
|
+
</>
|
|
964
|
+
) : (
|
|
965
|
+
<span className="relative inline-flex size-1.5 rounded-full bg-rose-500" />
|
|
966
|
+
)}
|
|
967
|
+
</span>
|
|
968
|
+
{connected ? t.slide.agentConnected : t.slide.agentDisconnected}
|
|
969
|
+
</button>
|
|
970
|
+
}
|
|
971
|
+
/>
|
|
965
972
|
<TooltipContent
|
|
966
973
|
side="bottom"
|
|
967
974
|
align="start"
|