@open-slide/core 1.14.0 → 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-Dx-qTg82.js → build-BsaslS8C.js} +1 -1
- package/dist/cli/bin.js +3 -3
- package/dist/{config-DvRA48y9.js → config-BOc3-oDV.js} +1 -1
- package/dist/{dev-BGXWqVUZ.js → dev-BU7OY0ai.js} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/{preview-CdQnIB39.js → preview-DbL7Wt77.js} +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +2 -2
- package/src/app/components/asset-view.tsx +29 -10
- 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 +2 -2
- 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.tsx +67 -63
- 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/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
|
@@ -173,16 +173,18 @@ export function FolderItem({
|
|
|
173
173
|
>
|
|
174
174
|
{row.kind === 'folder' && import.meta.env.DEV ? (
|
|
175
175
|
<Popover>
|
|
176
|
-
<PopoverTrigger
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
176
|
+
<PopoverTrigger
|
|
177
|
+
render={
|
|
178
|
+
<button
|
|
179
|
+
type="button"
|
|
180
|
+
className="flex size-5 shrink-0 items-center justify-center rounded transition-transform hover:scale-110"
|
|
181
|
+
aria-label={t.home.changeIcon}
|
|
182
|
+
onClick={(e) => e.stopPropagation()}
|
|
183
|
+
>
|
|
184
|
+
<FolderIconChip icon={icon} />
|
|
185
|
+
</button>
|
|
186
|
+
}
|
|
187
|
+
/>
|
|
186
188
|
<PopoverContent side="right" align="start" className="w-auto p-2">
|
|
187
189
|
<IconPicker value={row.folder.icon} onChange={(next) => row.onChangeIcon(next)} />
|
|
188
190
|
</PopoverContent>
|
|
@@ -233,19 +235,21 @@ export function FolderItem({
|
|
|
233
235
|
|
|
234
236
|
{row.kind === 'folder' && import.meta.env.DEV && (
|
|
235
237
|
<DropdownMenu>
|
|
236
|
-
<DropdownMenuTrigger
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
238
|
+
<DropdownMenuTrigger
|
|
239
|
+
render={
|
|
240
|
+
<button
|
|
241
|
+
type="button"
|
|
242
|
+
onClick={(e) => e.stopPropagation()}
|
|
243
|
+
className="absolute right-2 top-1/2 size-5 -translate-y-1/2 rounded opacity-0 transition-opacity hover:bg-foreground/10 group-hover:opacity-100 aria-expanded:opacity-100"
|
|
244
|
+
aria-label={t.home.folderActions}
|
|
245
|
+
>
|
|
246
|
+
<MoreHorizontal className="mx-auto size-3.5" />
|
|
247
|
+
</button>
|
|
248
|
+
}
|
|
249
|
+
/>
|
|
246
250
|
<DropdownMenuContent align="end" className="min-w-[140px]">
|
|
247
251
|
<DropdownMenuItem
|
|
248
|
-
|
|
252
|
+
onClick={() => {
|
|
249
253
|
setDraftName(row.folder.name);
|
|
250
254
|
setRenaming(true);
|
|
251
255
|
}}
|
|
@@ -253,7 +257,7 @@ export function FolderItem({
|
|
|
253
257
|
<Pencil />
|
|
254
258
|
{t.common.rename}
|
|
255
259
|
</DropdownMenuItem>
|
|
256
|
-
<DropdownMenuItem variant="destructive"
|
|
260
|
+
<DropdownMenuItem variant="destructive" onClick={() => row.onDelete()}>
|
|
257
261
|
<Trash2 />
|
|
258
262
|
{t.common.delete}
|
|
259
263
|
</DropdownMenuItem>
|
|
@@ -4,14 +4,14 @@ import type { FolderIcon } from '@/lib/sdk';
|
|
|
4
4
|
import { useLocale } from '@/lib/use-locale';
|
|
5
5
|
|
|
6
6
|
export const PRESET_COLORS = [
|
|
7
|
-
'#
|
|
8
|
-
'#
|
|
9
|
-
'#
|
|
10
|
-
'#
|
|
11
|
-
'#
|
|
12
|
-
'#
|
|
13
|
-
'#
|
|
14
|
-
'#
|
|
7
|
+
'#e5484d', // red
|
|
8
|
+
'#f76b15', // orange
|
|
9
|
+
'#ffb224', // amber
|
|
10
|
+
'#30a46c', // green
|
|
11
|
+
'#12a594', // teal
|
|
12
|
+
'#0091ff', // blue
|
|
13
|
+
'#6e56cf', // violet
|
|
14
|
+
'#60646c', // gray
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
export function IconPicker({
|
|
@@ -98,7 +98,7 @@ export function SidebarFooter() {
|
|
|
98
98
|
return (
|
|
99
99
|
<div className="px-4 py-3 text-[11px] text-muted-foreground/70 tabular-nums">
|
|
100
100
|
{update?.latest ? (
|
|
101
|
-
<TooltipProvider
|
|
101
|
+
<TooltipProvider delay={200}>
|
|
102
102
|
<Tooltip
|
|
103
103
|
open={open}
|
|
104
104
|
onOpenChange={(next) => {
|
|
@@ -106,7 +106,7 @@ export function SidebarFooter() {
|
|
|
106
106
|
setOpen(next);
|
|
107
107
|
}}
|
|
108
108
|
>
|
|
109
|
-
<TooltipTrigger
|
|
109
|
+
<TooltipTrigger render={versionRow} />
|
|
110
110
|
<TooltipContent
|
|
111
111
|
side="top"
|
|
112
112
|
align="start"
|
|
@@ -118,7 +118,7 @@ export function Sidebar({
|
|
|
118
118
|
const target = e.target as HTMLElement | null;
|
|
119
119
|
if (!target) return;
|
|
120
120
|
if (target.closest('[data-folder-create]')) return;
|
|
121
|
-
if (target.closest('[data-
|
|
121
|
+
if (target.closest('[data-slot="popover-content"]')) return;
|
|
122
122
|
commitCreate();
|
|
123
123
|
};
|
|
124
124
|
document.addEventListener('mousedown', onDown);
|
|
@@ -126,7 +126,7 @@ export function Sidebar({
|
|
|
126
126
|
}, [creating]);
|
|
127
127
|
|
|
128
128
|
return (
|
|
129
|
-
<aside className="
|
|
129
|
+
<aside className="relative flex h-full w-[16.5rem] shrink-0 flex-col border-r border-hairline bg-sidebar text-sidebar-foreground">
|
|
130
130
|
<div className="flex items-center justify-between px-4 pt-5 pb-4">
|
|
131
131
|
<h1 className="font-heading text-lg font-bold tracking-tight">{t.home.appTitle}</h1>
|
|
132
132
|
<div className="-mr-1.5 flex items-center">
|
|
@@ -150,13 +150,15 @@ export function Sidebar({
|
|
|
150
150
|
onSelect={() => onSelect(THEMES_ID)}
|
|
151
151
|
onDropSlide={() => {}}
|
|
152
152
|
/>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
{import.meta.env.DEV && (
|
|
154
|
+
<FolderItem
|
|
155
|
+
row={{ kind: 'assets' }}
|
|
156
|
+
count={assetsCount}
|
|
157
|
+
selected={selectedId === ASSETS_ID}
|
|
158
|
+
onSelect={() => onSelect(ASSETS_ID)}
|
|
159
|
+
onDropSlide={() => {}}
|
|
160
|
+
/>
|
|
161
|
+
)}
|
|
160
162
|
</div>
|
|
161
163
|
|
|
162
164
|
<div className="mt-5 flex items-center gap-2 px-4 pb-1.5">
|
|
@@ -247,15 +249,17 @@ export function Sidebar({
|
|
|
247
249
|
className="mt-1 flex items-center gap-2.5 rounded-[5px] border border-dashed border-foreground/30 bg-card px-2 py-[5px]"
|
|
248
250
|
>
|
|
249
251
|
<Popover open={iconOpen} onOpenChange={setIconOpen}>
|
|
250
|
-
<PopoverTrigger
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
252
|
+
<PopoverTrigger
|
|
253
|
+
render={
|
|
254
|
+
<button
|
|
255
|
+
type="button"
|
|
256
|
+
className="flex size-5 shrink-0 items-center justify-center rounded transition-transform hover:scale-110"
|
|
257
|
+
aria-label={t.home.pickIcon}
|
|
258
|
+
>
|
|
259
|
+
<FolderIconChip icon={newIcon} />
|
|
260
|
+
</button>
|
|
261
|
+
}
|
|
262
|
+
/>
|
|
259
263
|
<PopoverContent side="right" align="start" className="w-auto p-2">
|
|
260
264
|
<IconPicker value={newIcon} onChange={setNewIcon} />
|
|
261
265
|
</PopoverContent>
|
|
@@ -85,8 +85,8 @@ export function DesignPanel({ open, onClose }: DesignPanelProps) {
|
|
|
85
85
|
}
|
|
86
86
|
banner={
|
|
87
87
|
warning && (
|
|
88
|
-
<div className="flex gap-2 border-b border-hairline bg-
|
|
89
|
-
<span aria-hidden className="mt-0.5 size-1.5 shrink-0 rounded-full bg-
|
|
88
|
+
<div className="flex gap-2 border-b border-hairline bg-amber-500/10 px-3 py-2 text-[11px] leading-relaxed text-amber-800 dark:bg-amber-400/10 dark:text-amber-200">
|
|
89
|
+
<span aria-hidden className="mt-0.5 size-1.5 shrink-0 rounded-full bg-amber-500" />
|
|
90
90
|
<span>{warning}</span>
|
|
91
91
|
</div>
|
|
92
92
|
)
|
|
@@ -273,9 +273,13 @@ function FontField({
|
|
|
273
273
|
return (
|
|
274
274
|
<Field label={label}>
|
|
275
275
|
<Select
|
|
276
|
+
items={{
|
|
277
|
+
...Object.fromEntries(FONT_PRESETS.map((p) => [p.value, p.label])),
|
|
278
|
+
__custom__: tFont.stylePanel.fontPresetCustom,
|
|
279
|
+
}}
|
|
276
280
|
value={matched ? matched.value : '__custom__'}
|
|
277
281
|
onValueChange={(v) => {
|
|
278
|
-
if (v !== '__custom__') onChange(v);
|
|
282
|
+
if (typeof v === 'string' && v !== '__custom__') onChange(v);
|
|
279
283
|
}}
|
|
280
284
|
>
|
|
281
285
|
<SelectTrigger size="sm" className="h-8 flex-1 text-xs">
|
|
@@ -322,7 +326,7 @@ function SliderField({
|
|
|
322
326
|
max={max}
|
|
323
327
|
step={step}
|
|
324
328
|
value={[value]}
|
|
325
|
-
onValueChange={(
|
|
329
|
+
onValueChange={(next) => onChange((Array.isArray(next) ? next[0] : next) ?? value)}
|
|
326
330
|
className="flex-1"
|
|
327
331
|
/>
|
|
328
332
|
<NumberField
|
|
@@ -33,21 +33,21 @@ export function ThemeToggle() {
|
|
|
33
33
|
</DropdownMenuTrigger>
|
|
34
34
|
<DropdownMenuContent align="end" className="min-w-[140px]">
|
|
35
35
|
<DropdownMenuItem
|
|
36
|
-
|
|
36
|
+
onClick={() => setTheme('light')}
|
|
37
37
|
data-active={mounted && theme === 'light'}
|
|
38
38
|
>
|
|
39
39
|
<Sun />
|
|
40
40
|
{t.themeToggle.light}
|
|
41
41
|
</DropdownMenuItem>
|
|
42
42
|
<DropdownMenuItem
|
|
43
|
-
|
|
43
|
+
onClick={() => setTheme('dark')}
|
|
44
44
|
data-active={mounted && theme === 'dark'}
|
|
45
45
|
>
|
|
46
46
|
<Moon />
|
|
47
47
|
{t.themeToggle.dark}
|
|
48
48
|
</DropdownMenuItem>
|
|
49
49
|
<DropdownMenuItem
|
|
50
|
-
|
|
50
|
+
onClick={() => setTheme('system')}
|
|
51
51
|
data-active={mounted && theme === 'system'}
|
|
52
52
|
>
|
|
53
53
|
<Monitor />
|
|
@@ -102,7 +102,7 @@ export function ThemeDetail({ themeId, onBack }: { themeId: string; onBack: () =
|
|
|
102
102
|
{!theme.hasDemo ? (
|
|
103
103
|
<NoDemoLargeState />
|
|
104
104
|
) : !demo ? (
|
|
105
|
-
<div className="grid h-full w-full place-items-center text-[11px] tracking-[0.
|
|
105
|
+
<div className="grid h-full w-full place-items-center text-[11px] tracking-[0.08em] uppercase text-muted-foreground/60">
|
|
106
106
|
{t.common.loading}
|
|
107
107
|
</div>
|
|
108
108
|
) : Current ? (
|
|
@@ -236,7 +236,7 @@ function ThemeSlideCard({ id }: { id: string }) {
|
|
|
236
236
|
</SlideCanvas>
|
|
237
237
|
</div>
|
|
238
238
|
) : (
|
|
239
|
-
<div className="grid h-full w-full place-items-center text-[10px] tracking-[0.
|
|
239
|
+
<div className="grid h-full w-full place-items-center text-[10px] tracking-[0.08em] uppercase text-muted-foreground/60">
|
|
240
240
|
{t.common.loading}
|
|
241
241
|
</div>
|
|
242
242
|
)}
|
|
@@ -68,7 +68,7 @@ function ThemePreview({ theme }: { theme: Theme }) {
|
|
|
68
68
|
}
|
|
69
69
|
if (!demo) {
|
|
70
70
|
return (
|
|
71
|
-
<div className="grid h-full w-full place-items-center text-[10px] tracking-[0.
|
|
71
|
+
<div className="grid h-full w-full place-items-center text-[10px] tracking-[0.08em] uppercase text-muted-foreground/60">
|
|
72
72
|
{t.common.loading}
|
|
73
73
|
</div>
|
|
74
74
|
);
|
|
@@ -272,20 +272,22 @@ export function ThumbnailRail({
|
|
|
272
272
|
<span className="folio">{pages.length.toString().padStart(2, '0')}</span>
|
|
273
273
|
{onOverview && (
|
|
274
274
|
<Tooltip>
|
|
275
|
-
<TooltipTrigger
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
275
|
+
<TooltipTrigger
|
|
276
|
+
render={
|
|
277
|
+
<button
|
|
278
|
+
type="button"
|
|
279
|
+
onClick={onOverview}
|
|
280
|
+
aria-label={t.thumbnailRail.overviewAria}
|
|
281
|
+
className={cn(
|
|
282
|
+
'flex size-5 items-center justify-center rounded-[3px] text-muted-foreground/70 outline-none',
|
|
283
|
+
'motion-safe:transition-colors hover:bg-muted hover:text-foreground',
|
|
284
|
+
'focus-visible:ring-1 focus-visible:ring-brand',
|
|
285
|
+
)}
|
|
286
|
+
>
|
|
287
|
+
<Grid2x2 className="size-3.5" strokeWidth={1.75} />
|
|
288
|
+
</button>
|
|
289
|
+
}
|
|
290
|
+
/>
|
|
289
291
|
<TooltipContent side="bottom" sideOffset={6}>
|
|
290
292
|
{t.thumbnailRail.overviewAria}
|
|
291
293
|
</TooltipContent>
|
|
@@ -316,7 +318,7 @@ export function ThumbnailRail({
|
|
|
316
318
|
);
|
|
317
319
|
|
|
318
320
|
return (
|
|
319
|
-
<TooltipProvider
|
|
321
|
+
<TooltipProvider delay={200}>
|
|
320
322
|
<div className="relative h-full">
|
|
321
323
|
<ScrollArea className="h-full border-r border-hairline bg-sidebar [&_[data-slot=scroll-area-scrollbar]]:z-20">
|
|
322
324
|
{scrollAreaContents}
|
|
@@ -350,39 +352,41 @@ function CurrentThumbnailButton({
|
|
|
350
352
|
const Icon = direction === 'above' ? ChevronUp : ChevronDown;
|
|
351
353
|
return (
|
|
352
354
|
<Tooltip>
|
|
353
|
-
<TooltipTrigger
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
355
|
+
<TooltipTrigger
|
|
356
|
+
render={
|
|
357
|
+
<Button
|
|
358
|
+
type="button"
|
|
359
|
+
variant="outline"
|
|
360
|
+
size="icon-sm"
|
|
361
|
+
aria-label={label}
|
|
362
|
+
onClick={(event) => onActivate(event.detail === 0)}
|
|
363
|
+
onKeyDown={(event) => {
|
|
364
|
+
if (event.key === ' ') {
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
event.stopPropagation();
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (event.key !== 'Enter') return;
|
|
362
370
|
event.preventDefault();
|
|
363
371
|
event.stopPropagation();
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
>
|
|
383
|
-
<Icon className="size-3.5" strokeWidth={1.75} aria-hidden />
|
|
384
|
-
</Button>
|
|
385
|
-
</TooltipTrigger>
|
|
372
|
+
onActivate(true);
|
|
373
|
+
}}
|
|
374
|
+
onKeyUp={(event) => {
|
|
375
|
+
if (event.key !== ' ') return;
|
|
376
|
+
event.preventDefault();
|
|
377
|
+
event.stopPropagation();
|
|
378
|
+
onActivate(true);
|
|
379
|
+
}}
|
|
380
|
+
className={cn(
|
|
381
|
+
'pointer-events-auto absolute left-1/2 z-30 -translate-x-1/2 bg-card/95 shadow-floating backdrop-blur-sm',
|
|
382
|
+
'motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-150',
|
|
383
|
+
direction === 'above' ? 'top-10' : 'bottom-3',
|
|
384
|
+
)}
|
|
385
|
+
>
|
|
386
|
+
<Icon className="size-3.5" strokeWidth={1.75} aria-hidden />
|
|
387
|
+
</Button>
|
|
388
|
+
}
|
|
389
|
+
/>
|
|
386
390
|
<TooltipContent side={direction === 'above' ? 'bottom' : 'top'} sideOffset={6}>
|
|
387
391
|
{label}
|
|
388
392
|
</TooltipContent>
|
|
@@ -808,18 +812,20 @@ function ThumbContents({
|
|
|
808
812
|
function ThumbIndicator({ icon: Icon, label }: { icon: LucideIcon; label: string }) {
|
|
809
813
|
return (
|
|
810
814
|
<Tooltip>
|
|
811
|
-
<TooltipTrigger
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
815
|
+
<TooltipTrigger
|
|
816
|
+
render={
|
|
817
|
+
<span
|
|
818
|
+
role="img"
|
|
819
|
+
aria-label={label}
|
|
820
|
+
className={cn(
|
|
821
|
+
'flex size-3.5 items-center justify-center text-muted-foreground/55',
|
|
822
|
+
'motion-safe:transition-colors group-hover/thumb:text-muted-foreground/80',
|
|
823
|
+
)}
|
|
824
|
+
>
|
|
825
|
+
<Icon className="size-3" strokeWidth={2} />
|
|
826
|
+
</span>
|
|
827
|
+
}
|
|
828
|
+
/>
|
|
823
829
|
<TooltipContent side="right" sideOffset={6}>
|
|
824
830
|
{label}
|
|
825
831
|
</TooltipContent>
|
|
@@ -844,11 +850,9 @@ function ThumbContextMenu({
|
|
|
844
850
|
const canDelete = pageCount > 1;
|
|
845
851
|
return (
|
|
846
852
|
<ContextMenu>
|
|
847
|
-
<ContextMenuTrigger
|
|
848
|
-
{children}
|
|
849
|
-
</ContextMenuTrigger>
|
|
853
|
+
<ContextMenuTrigger aria-label={ariaLabel} render={children as React.ReactElement} />
|
|
850
854
|
<ContextMenuContent className="min-w-[180px]">
|
|
851
|
-
<ContextMenuItem
|
|
855
|
+
<ContextMenuItem onClick={() => actions.onDuplicate(index)}>
|
|
852
856
|
<Copy />
|
|
853
857
|
{t.thumbnailRail.duplicatePage}
|
|
854
858
|
</ContextMenuItem>
|
|
@@ -856,7 +860,7 @@ function ThumbContextMenu({
|
|
|
856
860
|
<ContextMenuItem
|
|
857
861
|
variant="destructive"
|
|
858
862
|
disabled={!canDelete}
|
|
859
|
-
|
|
863
|
+
onClick={() => {
|
|
860
864
|
if (canDelete) actions.onDelete(index);
|
|
861
865
|
}}
|
|
862
866
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import {
|
|
3
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
4
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
5
|
|
|
5
6
|
import { cn } from '@/lib/utils';
|
|
6
7
|
|
|
@@ -27,19 +28,21 @@ const badgeVariants = cva(
|
|
|
27
28
|
function Badge({
|
|
28
29
|
className,
|
|
29
30
|
variant = 'default',
|
|
30
|
-
|
|
31
|
+
render,
|
|
31
32
|
...props
|
|
32
|
-
}:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
}: useRender.ComponentProps<'span'> & VariantProps<typeof badgeVariants>) {
|
|
34
|
+
return useRender({
|
|
35
|
+
defaultTagName: 'span',
|
|
36
|
+
render,
|
|
37
|
+
props: mergeProps<'span'>(
|
|
38
|
+
{
|
|
39
|
+
'data-slot': 'badge',
|
|
40
|
+
'data-variant': variant,
|
|
41
|
+
className: cn(badgeVariants({ variant }), className),
|
|
42
|
+
} as React.ComponentPropsWithRef<'span'>,
|
|
43
|
+
props,
|
|
44
|
+
),
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
export { Badge, badgeVariants };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import {
|
|
3
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
4
4
|
|
|
5
5
|
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
@@ -39,7 +39,7 @@ const buttonVariants = cva(
|
|
|
39
39
|
'border border-border bg-card text-foreground',
|
|
40
40
|
'hover:bg-muted/60 hover:border-foreground/20',
|
|
41
41
|
'aria-expanded:bg-muted aria-expanded:border-foreground/25',
|
|
42
|
-
'data-
|
|
42
|
+
'data-pressed:bg-foreground data-pressed:text-background data-pressed:border-foreground',
|
|
43
43
|
].join(' '),
|
|
44
44
|
secondary:
|
|
45
45
|
'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary/90',
|
|
@@ -77,16 +77,10 @@ function Button({
|
|
|
77
77
|
className,
|
|
78
78
|
variant = 'default',
|
|
79
79
|
size = 'default',
|
|
80
|
-
asChild = false,
|
|
81
80
|
...props
|
|
82
|
-
}: React.ComponentProps<
|
|
83
|
-
VariantProps<typeof buttonVariants> & {
|
|
84
|
-
asChild?: boolean;
|
|
85
|
-
}) {
|
|
86
|
-
const Comp = asChild ? Slot.Root : 'button';
|
|
87
|
-
|
|
81
|
+
}: React.ComponentProps<typeof ButtonPrimitive> & VariantProps<typeof buttonVariants>) {
|
|
88
82
|
return (
|
|
89
|
-
<
|
|
83
|
+
<ButtonPrimitive
|
|
90
84
|
data-slot="button"
|
|
91
85
|
data-variant={variant}
|
|
92
86
|
data-size={size}
|