@open-slide/core 1.13.5 → 1.14.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-Dx-qTg82.js} +1 -1
- package/dist/cli/bin.js +3 -3
- package/dist/{config-CvzwK0tq.d.ts → config-CE2sKgqH.d.ts} +1 -1
- package/dist/{config-CU_NISD6.js → config-DvRA48y9.js} +37 -2
- package/dist/dev-BGXWqVUZ.js +94 -0
- package/dist/{format-CXtO6ORA.js → format-afijk371.js} +140 -8
- package/dist/index.d.ts +8 -8
- 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-CdQnIB39.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 +4 -4
- package/src/app/components/asset-view.tsx +743 -63
- package/src/app/components/sidebar/sidebar-footer.tsx +98 -29
- 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 +200 -35
- 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/slide.tsx +5 -1
- 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,176 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { filterAssets, sortAssets } from './asset-filter.ts';
|
|
3
|
+
import type { AssetEntry } from './assets.ts';
|
|
4
|
+
|
|
5
|
+
const assets: AssetEntry[] = [
|
|
6
|
+
{
|
|
7
|
+
name: 'Brand Hero.PNG',
|
|
8
|
+
size: 100,
|
|
9
|
+
createdAt: 1,
|
|
10
|
+
mtime: 1,
|
|
11
|
+
mime: 'image/png',
|
|
12
|
+
url: '/brand-hero.png',
|
|
13
|
+
unused: false,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'draft-hero.svg',
|
|
17
|
+
size: 200,
|
|
18
|
+
createdAt: 2,
|
|
19
|
+
mtime: 2,
|
|
20
|
+
mime: 'IMAGE/SVG+XML',
|
|
21
|
+
url: '/draft-hero.svg',
|
|
22
|
+
unused: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'display.woff2',
|
|
26
|
+
size: 300,
|
|
27
|
+
createdAt: 3,
|
|
28
|
+
mtime: 3,
|
|
29
|
+
mime: 'font/woff2',
|
|
30
|
+
url: '/display.woff2',
|
|
31
|
+
unused: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'intro.webm',
|
|
35
|
+
size: 400,
|
|
36
|
+
createdAt: 4,
|
|
37
|
+
mtime: 4,
|
|
38
|
+
mime: 'video/webm',
|
|
39
|
+
url: '/intro.webm',
|
|
40
|
+
unused: false,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'metadata.json',
|
|
44
|
+
size: 500,
|
|
45
|
+
createdAt: 5,
|
|
46
|
+
mtime: 5,
|
|
47
|
+
mime: 'application/json',
|
|
48
|
+
url: '/metadata.json',
|
|
49
|
+
unused: false,
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const names = (entries: AssetEntry[]) => entries.map((asset) => asset.name);
|
|
54
|
+
|
|
55
|
+
describe('filterAssets', () => {
|
|
56
|
+
it('filters assets by usage', () => {
|
|
57
|
+
expect(names(filterAssets(assets, { usage: 'used', type: 'all', search: '' }))).toEqual([
|
|
58
|
+
'Brand Hero.PNG',
|
|
59
|
+
'intro.webm',
|
|
60
|
+
'metadata.json',
|
|
61
|
+
]);
|
|
62
|
+
expect(names(filterAssets(assets, { usage: 'unused', type: 'all', search: '' }))).toEqual([
|
|
63
|
+
'draft-hero.svg',
|
|
64
|
+
'display.woff2',
|
|
65
|
+
]);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it.each([
|
|
69
|
+
['image', ['Brand Hero.PNG', 'draft-hero.svg']],
|
|
70
|
+
['font', ['display.woff2']],
|
|
71
|
+
['video', ['intro.webm']],
|
|
72
|
+
['other', ['metadata.json']],
|
|
73
|
+
] as const)('filters %s MIME types', (type, expected) => {
|
|
74
|
+
expect(names(filterAssets(assets, { usage: 'all', type, search: '' }))).toEqual(expected);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('matches trimmed filename searches case-insensitively', () => {
|
|
78
|
+
expect(names(filterAssets(assets, { usage: 'all', type: 'all', search: ' HERO ' }))).toEqual([
|
|
79
|
+
'Brand Hero.PNG',
|
|
80
|
+
'draft-hero.svg',
|
|
81
|
+
]);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('applies usage, type, and search filters together', () => {
|
|
85
|
+
expect(
|
|
86
|
+
names(filterAssets(assets, { usage: 'unused', type: 'image', search: 'DRAFT' })),
|
|
87
|
+
).toEqual(['draft-hero.svg']);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('returns all assets when every filter is inactive', () => {
|
|
91
|
+
expect(filterAssets(assets, { usage: 'all', type: 'all', search: ' ' })).toEqual(assets);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('sortAssets', () => {
|
|
96
|
+
const sortableAssets: AssetEntry[] = [
|
|
97
|
+
{
|
|
98
|
+
name: 'image-10.png',
|
|
99
|
+
size: 300,
|
|
100
|
+
createdAt: 1,
|
|
101
|
+
mtime: 200,
|
|
102
|
+
mime: 'image/png',
|
|
103
|
+
url: '/image-10.png',
|
|
104
|
+
unused: false,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'Image-2.svg',
|
|
108
|
+
size: 100,
|
|
109
|
+
createdAt: 2,
|
|
110
|
+
mtime: 300,
|
|
111
|
+
mime: 'IMAGE/SVG+XML',
|
|
112
|
+
url: '/image-2.svg',
|
|
113
|
+
unused: false,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'clip.webm',
|
|
117
|
+
size: 200,
|
|
118
|
+
createdAt: 3,
|
|
119
|
+
mtime: 100,
|
|
120
|
+
mime: 'video/webm',
|
|
121
|
+
url: '/clip.webm',
|
|
122
|
+
unused: false,
|
|
123
|
+
},
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
it.each([
|
|
127
|
+
['name', 'asc', ['clip.webm', 'Image-2.svg', 'image-10.png']],
|
|
128
|
+
['name', 'desc', ['image-10.png', 'Image-2.svg', 'clip.webm']],
|
|
129
|
+
['modified', 'asc', ['clip.webm', 'image-10.png', 'Image-2.svg']],
|
|
130
|
+
['modified', 'desc', ['Image-2.svg', 'image-10.png', 'clip.webm']],
|
|
131
|
+
['size', 'asc', ['Image-2.svg', 'clip.webm', 'image-10.png']],
|
|
132
|
+
['size', 'desc', ['image-10.png', 'clip.webm', 'Image-2.svg']],
|
|
133
|
+
['type', 'asc', ['image-10.png', 'Image-2.svg', 'clip.webm']],
|
|
134
|
+
['type', 'desc', ['clip.webm', 'Image-2.svg', 'image-10.png']],
|
|
135
|
+
] as const)('sorts by %s %s', (key, direction, expected) => {
|
|
136
|
+
expect(names(sortAssets(sortableAssets, { key, direction }))).toEqual(expected);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('sorts names naturally and case-insensitively', () => {
|
|
140
|
+
const naturalNames = [
|
|
141
|
+
{ ...sortableAssets[0], name: 'Slide 11.png' },
|
|
142
|
+
{ ...sortableAssets[0], name: 'slide 2.png' },
|
|
143
|
+
{ ...sortableAssets[0], name: 'SLIDE 1.png' },
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
expect(names(sortAssets(naturalNames, { key: 'name', direction: 'asc' }))).toEqual([
|
|
147
|
+
'SLIDE 1.png',
|
|
148
|
+
'slide 2.png',
|
|
149
|
+
'Slide 11.png',
|
|
150
|
+
]);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('breaks primary-value ties by name ascending for both directions', () => {
|
|
154
|
+
const tiedAssets = [
|
|
155
|
+
{ ...sortableAssets[0], name: 'zebra.png', size: 100 },
|
|
156
|
+
{ ...sortableAssets[1], name: 'alpha.svg', size: 100 },
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
expect(names(sortAssets(tiedAssets, { key: 'size', direction: 'asc' }))).toEqual([
|
|
160
|
+
'alpha.svg',
|
|
161
|
+
'zebra.png',
|
|
162
|
+
]);
|
|
163
|
+
expect(names(sortAssets(tiedAssets, { key: 'size', direction: 'desc' }))).toEqual([
|
|
164
|
+
'alpha.svg',
|
|
165
|
+
'zebra.png',
|
|
166
|
+
]);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('does not mutate the input', () => {
|
|
170
|
+
const originalOrder = [...sortableAssets];
|
|
171
|
+
const sorted = sortAssets(sortableAssets, { key: 'name', direction: 'asc' });
|
|
172
|
+
|
|
173
|
+
expect(sortableAssets).toEqual(originalOrder);
|
|
174
|
+
expect(sorted).not.toBe(sortableAssets);
|
|
175
|
+
});
|
|
176
|
+
});
|
|
@@ -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
|
|
package/src/app/routes/slide.tsx
CHANGED
|
@@ -244,7 +244,10 @@ export function Slide() {
|
|
|
244
244
|
);
|
|
245
245
|
|
|
246
246
|
useEffect(() => {
|
|
247
|
-
|
|
247
|
+
// When showSlideUi is false the read-only <Player> is rendered and owns
|
|
248
|
+
// keyboard navigation (including step-aware advance/retreat). Attaching this
|
|
249
|
+
// page-nav handler too would race it and skip <Steps> reveals, so bail out.
|
|
250
|
+
if (playMode || !showSlideUi) return;
|
|
248
251
|
const onKey = (e: KeyboardEvent) => {
|
|
249
252
|
if (e.target instanceof HTMLElement && e.target.matches('input, textarea')) return;
|
|
250
253
|
// Letter shortcuts only fire bare so browser combos (Cmd/Ctrl-P, ⌘F…) stay intact.
|
|
@@ -386,6 +389,7 @@ export function Slide() {
|
|
|
386
389
|
<Player
|
|
387
390
|
pages={pages}
|
|
388
391
|
design={slide.design}
|
|
392
|
+
transition={slide.transition}
|
|
389
393
|
index={index}
|
|
390
394
|
onIndexChange={goTo}
|
|
391
395
|
onExit={() => {}}
|
package/src/locale/en.ts
CHANGED
|
@@ -46,11 +46,14 @@ export const en: Locale = {
|
|
|
46
46
|
menu: 'Menu',
|
|
47
47
|
newFolder: 'New folder',
|
|
48
48
|
folderName: 'Folder name',
|
|
49
|
-
updateAvailable: 'open-slide {version} is available
|
|
49
|
+
updateAvailable: 'open-slide {version} is available',
|
|
50
50
|
updatePackage: 'Update',
|
|
51
51
|
updatingPackage: 'Updating',
|
|
52
52
|
updatePackageDone: 'Updated. Restart the dev server to use the new version.',
|
|
53
53
|
updatePackageFailed: 'Update failed. Check the dev server output.',
|
|
54
|
+
restartServer: 'Restart dev server',
|
|
55
|
+
restartingServer: 'Restarting',
|
|
56
|
+
restartServerFailed: 'Restart failed. Restart the dev server manually.',
|
|
54
57
|
changeIcon: 'Change icon',
|
|
55
58
|
iconEmojiTab: 'Emoji',
|
|
56
59
|
iconColorTab: 'Color',
|
|
@@ -290,7 +293,35 @@ export const en: Locale = {
|
|
|
290
293
|
scopeSlide: 'This slide',
|
|
291
294
|
scopeGlobal: 'Global',
|
|
292
295
|
fileCount: { one: '{count} file', other: '{count} files' },
|
|
296
|
+
createdAt: 'Created',
|
|
297
|
+
modifiedAt: 'Modified',
|
|
298
|
+
nameColumn: 'Name',
|
|
299
|
+
typeColumn: 'Type',
|
|
300
|
+
sizeColumn: 'Size',
|
|
301
|
+
statusColumn: 'Status',
|
|
302
|
+
sortAria: 'Sort assets',
|
|
303
|
+
sortByColumn: 'Sort by {column}',
|
|
304
|
+
sortAscending: 'Ascending',
|
|
305
|
+
sortDescending: 'Descending',
|
|
306
|
+
assetSearchPlaceholder: 'Search assets…',
|
|
307
|
+
clearAssetSearch: 'Clear asset search',
|
|
308
|
+
usageFilterAria: 'Filter by usage',
|
|
309
|
+
usageAll: 'All usage',
|
|
310
|
+
usageUsed: 'Used',
|
|
293
311
|
usageUnused: 'Unused',
|
|
312
|
+
typeFilterAria: 'Filter by file type',
|
|
313
|
+
typeAll: 'All types',
|
|
314
|
+
typeImage: 'Images',
|
|
315
|
+
typeFont: 'Fonts',
|
|
316
|
+
typeVideo: 'Videos',
|
|
317
|
+
typeOther: 'Other',
|
|
318
|
+
gridViewAria: 'Grid view',
|
|
319
|
+
listViewAria: 'List view',
|
|
320
|
+
gridColumnsAria: 'Grid columns',
|
|
321
|
+
gridColumnsValue: '{count} columns',
|
|
322
|
+
noMatchingAssets: 'No matching assets',
|
|
323
|
+
noMatchingAssetsHint: 'Try adjusting your search or filters.',
|
|
324
|
+
clearFilters: 'Clear filters',
|
|
294
325
|
searchLogos: 'Search logos',
|
|
295
326
|
upload: 'Upload',
|
|
296
327
|
dropToUpload: 'Drop to upload',
|
|
@@ -355,6 +386,8 @@ export const en: Locale = {
|
|
|
355
386
|
transitionIndicator: 'Has slide transition',
|
|
356
387
|
stepsIndicator: 'Has step-by-step reveals',
|
|
357
388
|
overviewAria: 'Slide overview (O)',
|
|
389
|
+
scrollUpToCurrentPage: 'Scroll up to current page {n}',
|
|
390
|
+
scrollDownToCurrentPage: 'Scroll down to current page {n}',
|
|
358
391
|
},
|
|
359
392
|
|
|
360
393
|
pdfToast: {
|
package/src/locale/ja.ts
CHANGED
|
@@ -46,12 +46,14 @@ export const ja: Locale = {
|
|
|
46
46
|
menu: 'メニュー',
|
|
47
47
|
newFolder: '新規フォルダ',
|
|
48
48
|
folderName: 'フォルダ名',
|
|
49
|
-
updateAvailable:
|
|
50
|
-
'open-slide {version} が利用可能です — パッケージを更新して最新版を入手してください。',
|
|
49
|
+
updateAvailable: 'open-slide {version} が利用可能です',
|
|
51
50
|
updatePackage: '更新',
|
|
52
51
|
updatingPackage: '更新中',
|
|
53
52
|
updatePackageDone: '更新しました。新しいバージョンを使うには dev server を再起動してください。',
|
|
54
53
|
updatePackageFailed: '更新に失敗しました。dev server の出力を確認してください。',
|
|
54
|
+
restartServer: 'dev server を再起動',
|
|
55
|
+
restartingServer: '再起動中',
|
|
56
|
+
restartServerFailed: '再起動に失敗しました。dev server を手動で再起動してください。',
|
|
55
57
|
changeIcon: 'アイコンを変更',
|
|
56
58
|
iconEmojiTab: '絵文字',
|
|
57
59
|
iconColorTab: 'カラー',
|
|
@@ -293,7 +295,35 @@ export const ja: Locale = {
|
|
|
293
295
|
scopeSlide: 'このスライド',
|
|
294
296
|
scopeGlobal: 'グローバル',
|
|
295
297
|
fileCount: { one: 'ファイル {count} 件', other: 'ファイル {count} 件' },
|
|
298
|
+
createdAt: '作成日時',
|
|
299
|
+
modifiedAt: '更新日時',
|
|
300
|
+
nameColumn: '名前',
|
|
301
|
+
typeColumn: '種類',
|
|
302
|
+
sizeColumn: 'サイズ',
|
|
303
|
+
statusColumn: '状態',
|
|
304
|
+
sortAria: 'アセットを並べ替え',
|
|
305
|
+
sortByColumn: '{column}で並べ替え',
|
|
306
|
+
sortAscending: '昇順',
|
|
307
|
+
sortDescending: '降順',
|
|
308
|
+
assetSearchPlaceholder: 'アセットを検索…',
|
|
309
|
+
clearAssetSearch: 'アセット検索をクリア',
|
|
310
|
+
usageFilterAria: '使用状況で絞り込む',
|
|
311
|
+
usageAll: 'すべての使用状況',
|
|
312
|
+
usageUsed: '使用中',
|
|
296
313
|
usageUnused: '未使用',
|
|
314
|
+
typeFilterAria: 'ファイル形式で絞り込む',
|
|
315
|
+
typeAll: 'すべての形式',
|
|
316
|
+
typeImage: '画像',
|
|
317
|
+
typeFont: 'フォント',
|
|
318
|
+
typeVideo: '動画',
|
|
319
|
+
typeOther: 'その他',
|
|
320
|
+
gridViewAria: 'グリッド表示',
|
|
321
|
+
listViewAria: 'リスト表示',
|
|
322
|
+
gridColumnsAria: 'グリッドの列数',
|
|
323
|
+
gridColumnsValue: '{count} 列',
|
|
324
|
+
noMatchingAssets: '一致するアセットがありません',
|
|
325
|
+
noMatchingAssetsHint: '検索条件またはフィルターを調整してください。',
|
|
326
|
+
clearFilters: 'フィルターをクリア',
|
|
297
327
|
searchLogos: 'ロゴを検索',
|
|
298
328
|
upload: 'アップロード',
|
|
299
329
|
dropToUpload: 'ドロップでアップロード',
|
|
@@ -360,6 +390,8 @@ export const ja: Locale = {
|
|
|
360
390
|
transitionIndicator: 'スライドトランジションあり',
|
|
361
391
|
stepsIndicator: 'ステップ表示あり',
|
|
362
392
|
overviewAria: 'スライド一覧 (O)',
|
|
393
|
+
scrollUpToCurrentPage: '上にスクロールして現在のページ {n} へ移動',
|
|
394
|
+
scrollDownToCurrentPage: '下にスクロールして現在のページ {n} へ移動',
|
|
363
395
|
},
|
|
364
396
|
|
|
365
397
|
pdfToast: {
|
package/src/locale/types.ts
CHANGED
|
@@ -51,6 +51,9 @@ export type Locale = {
|
|
|
51
51
|
updatingPackage: string;
|
|
52
52
|
updatePackageDone: string;
|
|
53
53
|
updatePackageFailed: string;
|
|
54
|
+
restartServer: string;
|
|
55
|
+
restartingServer: string;
|
|
56
|
+
restartServerFailed: string;
|
|
54
57
|
changeIcon: string;
|
|
55
58
|
iconEmojiTab: string;
|
|
56
59
|
iconColorTab: string;
|
|
@@ -291,7 +294,37 @@ export type Locale = {
|
|
|
291
294
|
scopeGlobal: string;
|
|
292
295
|
/** templates: "{count} file" / "{count} files" */
|
|
293
296
|
fileCount: Plural;
|
|
297
|
+
createdAt: string;
|
|
298
|
+
modifiedAt: string;
|
|
299
|
+
nameColumn: string;
|
|
300
|
+
typeColumn: string;
|
|
301
|
+
sizeColumn: string;
|
|
302
|
+
statusColumn: string;
|
|
303
|
+
sortAria: string;
|
|
304
|
+
/** template: "Sort by {column}" */
|
|
305
|
+
sortByColumn: string;
|
|
306
|
+
sortAscending: string;
|
|
307
|
+
sortDescending: string;
|
|
308
|
+
assetSearchPlaceholder: string;
|
|
309
|
+
clearAssetSearch: string;
|
|
310
|
+
usageFilterAria: string;
|
|
311
|
+
usageAll: string;
|
|
312
|
+
usageUsed: string;
|
|
294
313
|
usageUnused: string;
|
|
314
|
+
typeFilterAria: string;
|
|
315
|
+
typeAll: string;
|
|
316
|
+
typeImage: string;
|
|
317
|
+
typeFont: string;
|
|
318
|
+
typeVideo: string;
|
|
319
|
+
typeOther: string;
|
|
320
|
+
gridViewAria: string;
|
|
321
|
+
listViewAria: string;
|
|
322
|
+
gridColumnsAria: string;
|
|
323
|
+
/** template: "{count} columns" */
|
|
324
|
+
gridColumnsValue: string;
|
|
325
|
+
noMatchingAssets: string;
|
|
326
|
+
noMatchingAssetsHint: string;
|
|
327
|
+
clearFilters: string;
|
|
295
328
|
searchLogos: string;
|
|
296
329
|
upload: string;
|
|
297
330
|
dropToUpload: string;
|
|
@@ -376,6 +409,10 @@ export type Locale = {
|
|
|
376
409
|
transitionIndicator: string;
|
|
377
410
|
stepsIndicator: string;
|
|
378
411
|
overviewAria: string;
|
|
412
|
+
/** template: "Scroll up to current page {n}" */
|
|
413
|
+
scrollUpToCurrentPage: string;
|
|
414
|
+
/** template: "Scroll down to current page {n}" */
|
|
415
|
+
scrollDownToCurrentPage: string;
|
|
379
416
|
};
|
|
380
417
|
|
|
381
418
|
pdfToast: {
|
package/src/locale/zh-cn.ts
CHANGED
|
@@ -46,11 +46,14 @@ export const zhCN: Locale = {
|
|
|
46
46
|
menu: '菜单',
|
|
47
47
|
newFolder: '新建文件夹',
|
|
48
48
|
folderName: '文件夹名称',
|
|
49
|
-
updateAvailable: 'open-slide {version}
|
|
49
|
+
updateAvailable: 'open-slide {version} 已发布',
|
|
50
50
|
updatePackage: '更新',
|
|
51
51
|
updatingPackage: '更新中',
|
|
52
52
|
updatePackageDone: '已更新。请重启 dev server 以使用新版本。',
|
|
53
53
|
updatePackageFailed: '更新失败,请查看 dev server 输出。',
|
|
54
|
+
restartServer: '重启 dev server',
|
|
55
|
+
restartingServer: '重启中',
|
|
56
|
+
restartServerFailed: '重启失败,请手动重启 dev server。',
|
|
54
57
|
changeIcon: '更换图标',
|
|
55
58
|
iconEmojiTab: 'Emoji',
|
|
56
59
|
iconColorTab: '颜色',
|
|
@@ -288,7 +291,35 @@ export const zhCN: Locale = {
|
|
|
288
291
|
scopeSlide: '当前幻灯片',
|
|
289
292
|
scopeGlobal: '全局',
|
|
290
293
|
fileCount: { one: '{count} 个文件', other: '{count} 个文件' },
|
|
294
|
+
createdAt: '创建时间',
|
|
295
|
+
modifiedAt: '修改时间',
|
|
296
|
+
nameColumn: '名称',
|
|
297
|
+
typeColumn: '类型',
|
|
298
|
+
sizeColumn: '大小',
|
|
299
|
+
statusColumn: '状态',
|
|
300
|
+
sortAria: '素材排序',
|
|
301
|
+
sortByColumn: '按{column}排序',
|
|
302
|
+
sortAscending: '升序',
|
|
303
|
+
sortDescending: '降序',
|
|
304
|
+
assetSearchPlaceholder: '搜索素材…',
|
|
305
|
+
clearAssetSearch: '清除素材搜索',
|
|
306
|
+
usageFilterAria: '按使用状态筛选',
|
|
307
|
+
usageAll: '所有状态',
|
|
308
|
+
usageUsed: '使用中',
|
|
291
309
|
usageUnused: '未使用',
|
|
310
|
+
typeFilterAria: '按文件类型筛选',
|
|
311
|
+
typeAll: '所有类型',
|
|
312
|
+
typeImage: '图片',
|
|
313
|
+
typeFont: '字体',
|
|
314
|
+
typeVideo: '视频',
|
|
315
|
+
typeOther: '其他',
|
|
316
|
+
gridViewAria: '网格视图',
|
|
317
|
+
listViewAria: '列表视图',
|
|
318
|
+
gridColumnsAria: '网格列数',
|
|
319
|
+
gridColumnsValue: '{count} 列',
|
|
320
|
+
noMatchingAssets: '找不到匹配的素材',
|
|
321
|
+
noMatchingAssetsHint: '请调整搜索或筛选条件。',
|
|
322
|
+
clearFilters: '清除筛选',
|
|
292
323
|
searchLogos: '搜索 Logo',
|
|
293
324
|
upload: '上传',
|
|
294
325
|
dropToUpload: '拖入即可上传',
|
|
@@ -353,6 +384,8 @@ export const zhCN: Locale = {
|
|
|
353
384
|
transitionIndicator: '有换页转场',
|
|
354
385
|
stepsIndicator: '有逐步揭示',
|
|
355
386
|
overviewAria: '幻灯片总览 (O)',
|
|
387
|
+
scrollUpToCurrentPage: '向上滚动至当前第 {n} 页',
|
|
388
|
+
scrollDownToCurrentPage: '向下滚动至当前第 {n} 页',
|
|
356
389
|
},
|
|
357
390
|
|
|
358
391
|
pdfToast: {
|
package/src/locale/zh-tw.ts
CHANGED
|
@@ -46,11 +46,14 @@ export const zhTW: Locale = {
|
|
|
46
46
|
menu: '選單',
|
|
47
47
|
newFolder: '新增資料夾',
|
|
48
48
|
folderName: '資料夾名稱',
|
|
49
|
-
updateAvailable: 'open-slide {version}
|
|
49
|
+
updateAvailable: 'open-slide {version} 已發布',
|
|
50
50
|
updatePackage: '更新',
|
|
51
51
|
updatingPackage: '更新中',
|
|
52
52
|
updatePackageDone: '已更新。請重新啟動 dev server 以使用新版本。',
|
|
53
53
|
updatePackageFailed: '更新失敗,請查看 dev server 輸出。',
|
|
54
|
+
restartServer: '重新啟動 dev server',
|
|
55
|
+
restartingServer: '重新啟動中',
|
|
56
|
+
restartServerFailed: '重新啟動失敗,請手動重新啟動 dev server。',
|
|
54
57
|
changeIcon: '變更圖示',
|
|
55
58
|
iconEmojiTab: 'Emoji',
|
|
56
59
|
iconColorTab: '顏色',
|
|
@@ -288,7 +291,35 @@ export const zhTW: Locale = {
|
|
|
288
291
|
scopeSlide: '此投影片',
|
|
289
292
|
scopeGlobal: '全域',
|
|
290
293
|
fileCount: { one: '{count} 個檔案', other: '{count} 個檔案' },
|
|
294
|
+
createdAt: '建立時間',
|
|
295
|
+
modifiedAt: '修改時間',
|
|
296
|
+
nameColumn: '名稱',
|
|
297
|
+
typeColumn: '類型',
|
|
298
|
+
sizeColumn: '大小',
|
|
299
|
+
statusColumn: '狀態',
|
|
300
|
+
sortAria: '素材排序',
|
|
301
|
+
sortByColumn: '依{column}排序',
|
|
302
|
+
sortAscending: '升冪',
|
|
303
|
+
sortDescending: '降冪',
|
|
304
|
+
assetSearchPlaceholder: '搜尋素材…',
|
|
305
|
+
clearAssetSearch: '清除素材搜尋',
|
|
306
|
+
usageFilterAria: '依使用狀態篩選',
|
|
307
|
+
usageAll: '所有狀態',
|
|
308
|
+
usageUsed: '使用中',
|
|
291
309
|
usageUnused: '未使用',
|
|
310
|
+
typeFilterAria: '依檔案類型篩選',
|
|
311
|
+
typeAll: '所有類型',
|
|
312
|
+
typeImage: '圖片',
|
|
313
|
+
typeFont: '字型',
|
|
314
|
+
typeVideo: '影片',
|
|
315
|
+
typeOther: '其他',
|
|
316
|
+
gridViewAria: '格狀檢視',
|
|
317
|
+
listViewAria: '列表檢視',
|
|
318
|
+
gridColumnsAria: '網格欄數',
|
|
319
|
+
gridColumnsValue: '{count} 欄',
|
|
320
|
+
noMatchingAssets: '找不到相符的素材',
|
|
321
|
+
noMatchingAssetsHint: '請調整搜尋或篩選條件。',
|
|
322
|
+
clearFilters: '清除篩選',
|
|
292
323
|
searchLogos: '搜尋 Logo',
|
|
293
324
|
upload: '上傳',
|
|
294
325
|
dropToUpload: '拖入即可上傳',
|
|
@@ -353,6 +384,8 @@ export const zhTW: Locale = {
|
|
|
353
384
|
transitionIndicator: '有換頁轉場',
|
|
354
385
|
stepsIndicator: '有逐步揭示',
|
|
355
386
|
overviewAria: '投影片總覽 (O)',
|
|
387
|
+
scrollUpToCurrentPage: '向上捲動至目前的第 {n} 頁',
|
|
388
|
+
scrollDownToCurrentPage: '向下捲動至目前的第 {n} 頁',
|
|
356
389
|
},
|
|
357
390
|
|
|
358
391
|
pdfToast: {
|
package/dist/dev-C78J1TLR.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "./design-cpzS8aud.js";
|
|
2
|
-
import { createViteConfig } from "./config-CU_NISD6.js";
|
|
3
|
-
import { createServer, mergeConfig } from "vite";
|
|
4
|
-
|
|
5
|
-
//#region src/cli/dev.ts
|
|
6
|
-
async function dev(opts = {}) {
|
|
7
|
-
const base = await createViteConfig({ userCwd: process.cwd() });
|
|
8
|
-
const config = mergeConfig(base, { server: {
|
|
9
|
-
...opts.port !== void 0 ? { port: opts.port } : {},
|
|
10
|
-
...opts.host !== void 0 ? { host: opts.host } : {},
|
|
11
|
-
...opts.open !== void 0 ? { open: opts.open } : {}
|
|
12
|
-
} });
|
|
13
|
-
const server = await createServer(config);
|
|
14
|
-
await server.listen();
|
|
15
|
-
server.printUrls();
|
|
16
|
-
server.bindCLIShortcuts({ print: true });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { dev };
|