@widgetic/file-browser 0.5.35 → 0.5.36
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/README.md +1 -0
- package/dist/components/FolderTree.svelte +46 -97
- package/dist/components/FolderTree.svelte.d.ts +7 -7
- package/dist/components/core/Dropzone.svelte +127 -0
- package/dist/components/core/Dropzone.svelte.d.ts +15 -0
- package/dist/components/core/FileBrowser.css +11 -79
- package/dist/components/core/FileBrowser.svelte +277 -150
- package/dist/components/core/FileBrowser.svelte.d.ts +0 -1
- package/dist/components/core/FileUploader.svelte +204 -418
- package/dist/components/core/FileUploader.svelte.d.ts +1 -0
- package/dist/components/core/Header.svelte +51 -68
- package/dist/components/core/Header.svelte.d.ts +1 -0
- package/dist/components/core/RecentFiles.svelte +135 -562
- package/dist/components/core/RecentFiles.svelte.d.ts +2 -4
- package/dist/components/core/UploadPanel.svelte +169 -0
- package/dist/components/core/UploadPanel.svelte.d.ts +40 -0
- package/dist/components/core/UploadRow.svelte +90 -0
- package/dist/components/core/UploadRow.svelte.d.ts +21 -0
- package/dist/components/core/UploadStatus.svelte +34 -128
- package/dist/components/core/UploadStatus.svelte.d.ts +0 -1
- package/dist/components/core/UploadStatusList.svelte +61 -77
- package/dist/components/items/FileItem.svelte +190 -532
- package/dist/components/items/FileItem.svelte.d.ts +1 -1
- package/dist/components/items/FolderItem.svelte +46 -36
- package/dist/components/items/FolderItem.svelte.d.ts +1 -1
- package/dist/components/modals/MoveDialog.svelte +142 -281
- package/dist/components/modals/NewFolderButton.svelte +13 -14
- package/dist/components/modals/SearchModal.svelte +112 -264
- package/dist/components/modals/SearchModal.svelte.d.ts +0 -1
- package/dist/components/modals/SelectedFilesModal.svelte +91 -167
- package/dist/components/previews/AudioPlayer.svelte +75 -58
- package/dist/components/previews/ErrorPreview.svelte +9 -6
- package/dist/components/previews/FilePreview.svelte +173 -53
- package/dist/components/previews/FontPreview.svelte +37 -54
- package/dist/components/previews/ImagePreview.svelte +9 -2
- package/dist/components/previews/ImagePreview.svelte.d.ts +1 -0
- package/dist/components/previews/PreviewHeaderBar.svelte +70 -0
- package/dist/components/previews/PreviewHeaderBar.svelte.d.ts +32 -0
- package/dist/components/previews/TextPreview.svelte +32 -40
- package/dist/components/previews/VideoPlayer.svelte +124 -149
- package/dist/components/previews/WaveformVisualizer.svelte +42 -222
- package/dist/components/previews/WaveformVisualizer.svelte.d.ts +1 -1
- package/dist/components/ui/ControlToolbar.svelte +113 -288
- package/dist/components/ui/ControlToolbar.svelte.d.ts +2 -3
- package/dist/components/ui/DragSelect.svelte +41 -248
- package/dist/components/ui/DropdownMenu.svelte +56 -55
- package/dist/components/ui/DropdownMenu.svelte.d.ts +1 -1
- package/dist/components/ui/FileIcon.svelte +168 -51
- package/dist/components/ui/FileIcon.svelte.d.ts +13 -20
- package/dist/components/ui/FileMetadata.svelte +20 -9
- package/dist/components/ui/LoadingSkeleton.svelte +5 -20
- package/dist/components/ui/SearchResults.svelte +50 -26
- package/dist/components/ui/SearchResults.svelte.d.ts +4 -0
- package/dist/components/ui/SelectedBadge.svelte +25 -0
- package/dist/components/ui/SelectedBadge.svelte.d.ts +9 -0
- package/dist/components/ui/TileSkeleton.svelte +15 -0
- package/dist/components/ui/TileSkeleton.svelte.d.ts +18 -0
- package/dist/components/ui/VirtualList.svelte +3 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/i18n/messages.d.ts +38 -25
- package/dist/i18n/messages.js +39 -26
- package/dist/stores/fileStore.d.ts +2 -2
- package/dist/stores/navigationStore.d.ts +1 -1
- package/dist/stores/persistentSelectStore.d.ts +1 -1
- package/dist/utils/gridLayout.d.ts +2 -0
- package/dist/utils/gridLayout.js +10 -0
- package/package.json +3 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* SelectedBadge: the "selected" mark of the Figma File Tile and Recent Card (State=Selected):
|
|
4
|
+
* a 20px circle in the primary color with a 12px check.
|
|
5
|
+
* It is a picture for screen readers (its label), not a control: the tile it sits on is what the person clicks.
|
|
6
|
+
*/
|
|
7
|
+
import { IconCheck } from '@widgetic/design-system/icons';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
/** Accessible name of the badge, for example "Selected" */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Extra classes for the placement of the badge (for example "self-center") */
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { label, class: className = '' }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<span
|
|
20
|
+
role="img"
|
|
21
|
+
aria-label={label}
|
|
22
|
+
class="selected-badge flex size-5 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground {className}"
|
|
23
|
+
>
|
|
24
|
+
<IconCheck class="size-3 stroke-[2]" aria-hidden="true" />
|
|
25
|
+
</span>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Accessible name of the badge, for example "Selected" */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Extra classes for the placement of the badge (for example "self-center") */
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const SelectedBadge: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type SelectedBadge = ReturnType<typeof SelectedBadge>;
|
|
9
|
+
export default SelectedBadge;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Figma: Tile Skeleton (270:989, page File Browser)
|
|
3
|
+
import LoadingSkeleton from './LoadingSkeleton.svelte';
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div
|
|
7
|
+
class="flex h-16 w-full items-center gap-3 rounded-xl border border-border bg-background p-2"
|
|
8
|
+
aria-hidden="true"
|
|
9
|
+
>
|
|
10
|
+
<LoadingSkeleton width="48px" height="48px" className="shrink-0 rounded-lg" />
|
|
11
|
+
<div class="flex min-w-0 flex-1 flex-col gap-2">
|
|
12
|
+
<LoadingSkeleton width="132px" height="12px" className="rounded-lg" />
|
|
13
|
+
<LoadingSkeleton width="72px" height="10px" className="rounded-lg" />
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TileSkeleton: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type TileSkeleton = InstanceType<typeof TileSkeleton>;
|
|
18
|
+
export default TileSkeleton;
|
|
@@ -92,6 +92,8 @@
|
|
|
92
92
|
style="height: {totalHeight}px; {style}"
|
|
93
93
|
bind:this={listElement}
|
|
94
94
|
>
|
|
95
|
+
<!-- align-content: start keeps every row at its own height: with only the visible rows rendered, the rows of a
|
|
96
|
+
grid that is as tall as the whole list would otherwise stretch to fill it. -->
|
|
95
97
|
<div
|
|
96
98
|
class="grid w-full"
|
|
97
99
|
style="
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
top: {Math.floor(startIndex / columns) * (itemHeight + gap)}px;
|
|
101
103
|
grid-template-columns: repeat({columns}, minmax(0, 1fr));
|
|
102
104
|
gap: {gap}px;
|
|
105
|
+
align-content: start;
|
|
103
106
|
"
|
|
104
107
|
>
|
|
105
108
|
{#each visibleItems as item, i (item.id || `${item.type || 'item'}-${startIndex + i}`)}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as DropdownMenu } from './DropdownMenu.svelte';
|
|
2
2
|
export { default as FileIcon } from './FileIcon.svelte';
|
|
3
|
+
export { default as SelectedBadge } from './SelectedBadge.svelte';
|
|
3
4
|
export { default as FileMetadata } from './FileMetadata.svelte';
|
|
4
5
|
export { default as SearchResults } from './SearchResults.svelte';
|
|
5
6
|
export { default as LoadingSkeleton } from './LoadingSkeleton.svelte';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as DropdownMenu } from './DropdownMenu.svelte';
|
|
2
2
|
export { default as FileIcon } from './FileIcon.svelte';
|
|
3
|
+
export { default as SelectedBadge } from './SelectedBadge.svelte';
|
|
3
4
|
export { default as FileMetadata } from './FileMetadata.svelte';
|
|
4
5
|
export { default as SearchResults } from './SearchResults.svelte';
|
|
5
6
|
export { default as LoadingSkeleton } from './LoadingSkeleton.svelte';
|
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const FILE_BROWSER_MESSAGES: {
|
|
13
13
|
readonly 'action.cancel': "Cancel";
|
|
14
|
-
readonly 'action.confirm': "Confirm";
|
|
15
14
|
readonly 'action.create': "Create";
|
|
16
15
|
readonly 'action.delete': "Delete";
|
|
17
16
|
readonly 'action.done': "Done";
|
|
@@ -37,7 +36,7 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
37
36
|
readonly 'toast.regionLabel': "Notifications";
|
|
38
37
|
/** What a screen reader hears for the button that closes a pop-up. */
|
|
39
38
|
readonly 'toast.closeLabel': "Close notification";
|
|
40
|
-
readonly 'search.placeholder': "Search
|
|
39
|
+
readonly 'search.placeholder': "Search…";
|
|
41
40
|
readonly 'filter.by': "Filter by {type}";
|
|
42
41
|
readonly 'filterName.all': "All";
|
|
43
42
|
readonly 'filterName.image': "Image";
|
|
@@ -65,9 +64,9 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
65
64
|
readonly 'breadcrumbs.root': "Files";
|
|
66
65
|
/** What a screen reader says for the path above the files. */
|
|
67
66
|
readonly 'breadcrumbs.label': "breadcrumb";
|
|
68
|
-
readonly 'empty.library': "No files yet
|
|
69
|
-
readonly 'empty.libraryFiltered': "No files of this type
|
|
70
|
-
readonly 'empty.folder': "No files in this folder
|
|
67
|
+
readonly 'empty.library': "No files yet";
|
|
68
|
+
readonly 'empty.libraryFiltered': "No files of this type";
|
|
69
|
+
readonly 'empty.folder': "No files in this folder";
|
|
71
70
|
readonly 'library.partialNotice': "Some files could not be loaded.";
|
|
72
71
|
readonly 'library.truncatedNotice': "Only the newest files are shown.";
|
|
73
72
|
readonly 'library.notSetUp': "The media library is not set up correctly.";
|
|
@@ -108,14 +107,19 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
108
107
|
readonly 'fileTypes.addAll': "Add images ({images}), audio ({audio}), video ({video}), documents ({documents}), fonts ({fonts}) or vector graphics ({svg}).";
|
|
109
108
|
readonly 'fileTypes.fontNaming': "Font naming convention:\nFontFamily-Weight.extension\n\nExample:\nGeistMono-Black.ttf";
|
|
110
109
|
/** {types} is the kinds of file taken: the words of "fileKind.*" joined with "list.separator" ("image, video"). */
|
|
111
|
-
readonly 'upload.uploading': "Uploading
|
|
110
|
+
readonly 'upload.uploading': "Uploading…";
|
|
112
111
|
readonly 'upload.foldersNotAllowed': "Folders cannot be uploaded";
|
|
113
112
|
readonly 'upload.invalidType': "Invalid file type. Please use {types} files only.";
|
|
114
113
|
readonly 'upload.dropActive': "Drop to upload {types} files";
|
|
114
|
+
/** The four sentences of the dropzone when every kind of file is taken: they do not name a kind (Figma "Upload files"). */
|
|
115
|
+
readonly 'upload.dropActiveAny': "Drop to upload files";
|
|
115
116
|
readonly 'upload.button': "Upload {types} files";
|
|
117
|
+
readonly 'upload.buttonAny': "Upload files";
|
|
116
118
|
readonly 'upload.dragHint': "or drag and drop {types} files here";
|
|
119
|
+
readonly 'upload.dragHintAny': "or drag and drop files here";
|
|
117
120
|
/** On a small screen the sentence is one link. The words of "upload.chooseOrDropLink" inside it are underlined. */
|
|
118
121
|
readonly 'upload.chooseOrDrop': "Upload or drop {types} files here";
|
|
122
|
+
readonly 'upload.chooseOrDropAny': "Upload or drop files here";
|
|
119
123
|
readonly 'upload.chooseOrDropLink': "Upload";
|
|
120
124
|
readonly 'upload.panelTitle': "File Upload Progress";
|
|
121
125
|
readonly 'upload.progress': "{total, plural, other {{done}/# files uploaded}}";
|
|
@@ -124,7 +128,6 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
124
128
|
readonly 'upload.collapsePanel': "Collapse panel";
|
|
125
129
|
readonly 'upload.expandUploader': "Expand uploader";
|
|
126
130
|
readonly 'upload.collapseUploader': "Collapse uploader";
|
|
127
|
-
readonly 'upload.closeUploader': "Close uploader";
|
|
128
131
|
readonly 'upload.cancel': "Cancel upload";
|
|
129
132
|
readonly 'upload.retry': "Retry upload";
|
|
130
133
|
readonly 'upload.retryFailed': "Retry failed uploads?";
|
|
@@ -134,7 +137,7 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
134
137
|
readonly 'upload.unknownError': "Unknown error";
|
|
135
138
|
readonly 'upload.skippedOne': "Skipped duplicate file: {name}";
|
|
136
139
|
readonly 'upload.skippedMany': "{count, plural, one {Skipped # duplicate file} other {Skipped # duplicate files}}";
|
|
137
|
-
readonly 'upload.time.calculating': "calculating
|
|
140
|
+
readonly 'upload.time.calculating': "calculating…";
|
|
138
141
|
readonly 'upload.time.lessThanSecond': "less than a second";
|
|
139
142
|
readonly 'upload.time.seconds': "{count, plural, one {# second} other {# seconds}}";
|
|
140
143
|
readonly 'upload.time.minutes': "{count, plural, one {# minute} other {# minutes}}";
|
|
@@ -145,21 +148,25 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
145
148
|
readonly 'upload.uploadingProgress': "{total, plural, other {Uploading {done}/# files}}";
|
|
146
149
|
readonly 'upload.filesTotal': "{count, plural, one {# file} other {# files}}";
|
|
147
150
|
readonly 'upload.completeCount': "{done}/{total} complete";
|
|
151
|
+
readonly 'upload.failed': "Upload failed";
|
|
152
|
+
readonly 'upload.rowMeta': "{size} · {detail}";
|
|
148
153
|
readonly 'dialog.delete.folderTitle': "Delete folder";
|
|
149
154
|
readonly 'dialog.delete.itemsTitle': "Delete items";
|
|
150
155
|
readonly 'dialog.delete.fileTitle': "Delete file";
|
|
151
156
|
readonly 'dialog.delete.folderMessage': "Delete '{name}' and all content inside?";
|
|
152
157
|
readonly 'dialog.delete.itemsMessage': "{count, plural, one {Are you sure you want to delete # item?} other {Are you sure you want to delete # items?}}";
|
|
153
158
|
readonly 'dialog.delete.fileMessage': "Delete '{name}'?";
|
|
154
|
-
readonly 'dialog.newFolder.
|
|
159
|
+
readonly 'dialog.newFolder.title': "New folder";
|
|
160
|
+
readonly 'dialog.newFolder.placeholder': "folder name…";
|
|
155
161
|
readonly 'dialog.newFolder.invalidTitle': "Invalid folder name";
|
|
156
162
|
readonly 'dialog.newFolder.required': "Folder name is required";
|
|
157
163
|
readonly 'dialog.newFolder.invalidCharacters': "Folder name can only contain letters, numbers, and spaces";
|
|
158
164
|
/** {max} is put in by the dialog: it knows its own limit. */
|
|
159
165
|
readonly 'dialog.newFolder.tooLong': "Folder name cannot exceed {max} characters";
|
|
160
166
|
/** The hint in the empty name field of the rename window, for a file and for a folder. */
|
|
161
|
-
readonly 'dialog.rename.
|
|
162
|
-
readonly 'dialog.rename.
|
|
167
|
+
readonly 'dialog.rename.title': "Rename";
|
|
168
|
+
readonly 'dialog.rename.filePlaceholder': "file name…";
|
|
169
|
+
readonly 'dialog.rename.folderPlaceholder': "folder name…";
|
|
163
170
|
readonly 'dialog.rename.invalidTitle': "Invalid name";
|
|
164
171
|
readonly 'dialog.rename.enterName': "Please enter a name";
|
|
165
172
|
readonly 'dialog.rename.enterDifferentName': "Please enter a different name";
|
|
@@ -169,14 +176,14 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
169
176
|
readonly 'dialog.rename.tooLong': "Name must be {max} characters or less";
|
|
170
177
|
/** What a screen reader says for the X that closes a window. */
|
|
171
178
|
readonly 'dialog.close': "Close modal";
|
|
172
|
-
readonly 'toast.rename.started': "Renaming \"{name}\"
|
|
179
|
+
readonly 'toast.rename.started': "Renaming \"{name}\"…";
|
|
173
180
|
readonly 'toast.rename.done': "Item renamed";
|
|
174
181
|
readonly 'toast.rename.doneDetail': "Successfully renamed \"{oldName}\" to \"{newName}\"";
|
|
175
182
|
readonly 'toast.rename.failed': "Rename failed";
|
|
176
183
|
readonly 'toast.rename.noChange': "No changes were made";
|
|
177
184
|
readonly 'toast.rename.noItem': "No valid item selected";
|
|
178
185
|
readonly 'toast.rename.unknownError': "An unknown error occurred";
|
|
179
|
-
readonly 'toast.delete.started': "{count, plural, one {Deleting \"{name}\"
|
|
186
|
+
readonly 'toast.delete.started': "{count, plural, one {Deleting \"{name}\"…} other {Deleting # items…}}";
|
|
180
187
|
readonly 'toast.delete.doneFolder': "Deleted folder \"{name}\"";
|
|
181
188
|
readonly 'toast.delete.doneFile': "Deleted \"{name}\"";
|
|
182
189
|
readonly 'toast.delete.doneMany': "{count, plural, one {Deleted # item} other {Deleted # items}}";
|
|
@@ -202,29 +209,27 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
202
209
|
readonly 'folder.empty': "Empty";
|
|
203
210
|
readonly 'folder.itemCount': "{count, plural, one {# item} other {# items}}";
|
|
204
211
|
readonly 'item.previewLabel': "Preview {name}";
|
|
205
|
-
readonly 'item.audioFile': "Audio file";
|
|
206
|
-
readonly 'item.documentFile': "Document file";
|
|
207
212
|
readonly 'item.deleteMissing': "Delete missing file";
|
|
208
213
|
readonly 'item.folder': "Folder";
|
|
209
|
-
readonly 'recent.title': "Recent
|
|
210
|
-
readonly 'recent.empty': "No recent files
|
|
211
|
-
readonly 'newFolder.alt': "New Folder";
|
|
214
|
+
readonly 'recent.title': "Recent files";
|
|
215
|
+
readonly 'recent.empty': "No recent files yet";
|
|
212
216
|
readonly 'newFolder.label': "New folder";
|
|
213
217
|
readonly 'search.noResults': "No results found";
|
|
214
218
|
readonly 'menu.open': "Open menu";
|
|
215
219
|
readonly 'menu.moreOptions': "More options";
|
|
216
|
-
readonly 'toolbar.more': "+{count} more";
|
|
217
220
|
readonly 'toolbar.moveMany': "{count, plural, one {Move # file} other {Move # files}}";
|
|
218
221
|
readonly 'toolbar.deleteMany': "{count, plural, one {Delete # file} other {Delete # files}}";
|
|
219
222
|
readonly 'selectedFiles.title': "Selected files";
|
|
220
223
|
readonly 'selectedFiles.empty': "No files selected";
|
|
221
224
|
readonly 'selectedFiles.count': "{count, plural, one {# file selected} other {# files selected}}";
|
|
222
225
|
readonly 'selectedFiles.confirmMany': "{count, plural, one {Use # file} other {Use # files}}";
|
|
223
|
-
readonly '
|
|
226
|
+
readonly 'selectedFiles.remove': "Remove from selection";
|
|
227
|
+
readonly 'searchModal.placeholder': "Search files and folders…";
|
|
224
228
|
readonly 'searchModal.jumpToFolder': "Jump to folder";
|
|
225
229
|
readonly 'searchModal.empty': "No files found";
|
|
230
|
+
readonly 'searchModal.clearQuery': "Clear search";
|
|
226
231
|
/** {name} is the file or folder, cut at 30 characters. */
|
|
227
|
-
readonly 'moveDialog.titleOne': "Move
|
|
232
|
+
readonly 'moveDialog.titleOne': "Move “{name}”";
|
|
228
233
|
readonly 'moveDialog.titleMany': "{count, plural, one {Move # item} other {Move # items}}";
|
|
229
234
|
/** The name of the top of the library in the folder list of the move window. */
|
|
230
235
|
readonly 'moveDialog.rootName': "Files";
|
|
@@ -250,22 +255,25 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
250
255
|
readonly 'preview.audioUnsupported': "Your browser does not support the audio element.";
|
|
251
256
|
readonly 'preview.videoFailed': "Video failed to load";
|
|
252
257
|
readonly 'preview.videoUnsupported': "Your browser does not support the video tag.";
|
|
253
|
-
readonly 'preview.
|
|
258
|
+
readonly 'preview.videoProgress': "Video progress";
|
|
254
259
|
readonly 'preview.fileNotFound': "File not found";
|
|
255
|
-
readonly 'preview.loading': "Loading
|
|
260
|
+
readonly 'preview.loading': "Loading…";
|
|
256
261
|
readonly 'preview.textFailed': "Failed to load text file";
|
|
257
262
|
/** {reason} is what the server said ("Not Found"). */
|
|
258
263
|
readonly 'preview.textFailedReason': "Failed to load text file: {reason}";
|
|
259
264
|
readonly 'preview.unavailable': "Preview not available for this file type.";
|
|
260
|
-
readonly 'preview.pdfLoading': "Loading PDF
|
|
265
|
+
readonly 'preview.pdfLoading': "Loading PDF…";
|
|
261
266
|
readonly 'preview.pdfFailed': "Failed to load PDF";
|
|
262
267
|
/** {page} and {total} are put in by the PDF viewer ({total} is "?" until the number of pages is known). */
|
|
263
268
|
readonly 'preview.pdfPage': "Page {page} of {total}";
|
|
264
269
|
readonly 'preview.pdfPreviousPage': "Previous page";
|
|
265
270
|
readonly 'preview.pdfNextPage': "Next page";
|
|
271
|
+
readonly 'preview.metaSeparator': " · ";
|
|
272
|
+
readonly 'preview.previousFile': "Previous file";
|
|
273
|
+
readonly 'preview.nextFile': "Next file";
|
|
274
|
+
readonly 'preview.dimensions': "{width} × {height}";
|
|
266
275
|
/** The sentence a font is shown in. Use a sentence that shows the letters of your language. */
|
|
267
276
|
readonly 'fontPreview.sample': "The quick brown fox jumps over the lazy dog";
|
|
268
|
-
readonly 'fontPreview.sampleShort': "The quick fox";
|
|
269
277
|
readonly 'metadata.title': "File Information";
|
|
270
278
|
readonly 'metadata.name': "Name:";
|
|
271
279
|
readonly 'metadata.type': "Type:";
|
|
@@ -282,3 +290,8 @@ export declare const FILE_BROWSER_MESSAGES: {
|
|
|
282
290
|
};
|
|
283
291
|
/** The name of one message. */
|
|
284
292
|
export type FileBrowserMessageKey = keyof typeof FILE_BROWSER_MESSAGES;
|
|
293
|
+
/** Catalog keys referenced from Svelte without string literals in templates (i18n audit). */
|
|
294
|
+
export declare const UPLOAD_ERROR_KEYS: {
|
|
295
|
+
readonly libraryFailed: "libraryError.uploadFailed";
|
|
296
|
+
readonly network: "upload.networkError";
|
|
297
|
+
};
|
package/dist/i18n/messages.js
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
export const FILE_BROWSER_MESSAGES = {
|
|
13
13
|
// ===== Words that appear in several places =====
|
|
14
14
|
'action.cancel': 'Cancel',
|
|
15
|
-
'action.confirm': 'Confirm',
|
|
16
15
|
'action.create': 'Create',
|
|
17
16
|
'action.delete': 'Delete',
|
|
18
17
|
'action.done': 'Done',
|
|
@@ -39,7 +38,7 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
39
38
|
/** What a screen reader hears for the button that closes a pop-up. */
|
|
40
39
|
'toast.closeLabel': 'Close notification',
|
|
41
40
|
// ===== The bar above the files =====
|
|
42
|
-
'search.placeholder': 'Search
|
|
41
|
+
'search.placeholder': 'Search…',
|
|
43
42
|
'filter.by': 'Filter by {type}',
|
|
44
43
|
'filterName.all': 'All',
|
|
45
44
|
'filterName.image': 'Image',
|
|
@@ -68,9 +67,9 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
68
67
|
/** What a screen reader says for the path above the files. */
|
|
69
68
|
'breadcrumbs.label': 'breadcrumb',
|
|
70
69
|
// ===== What the list says when there is nothing to show =====
|
|
71
|
-
'empty.library': 'No files yet
|
|
72
|
-
'empty.libraryFiltered': 'No files of this type
|
|
73
|
-
'empty.folder': 'No files in this folder
|
|
70
|
+
'empty.library': 'No files yet',
|
|
71
|
+
'empty.libraryFiltered': 'No files of this type',
|
|
72
|
+
'empty.folder': 'No files in this folder',
|
|
74
73
|
// ===== The page's own media library =====
|
|
75
74
|
'library.partialNotice': 'Some files could not be loaded.',
|
|
76
75
|
'library.truncatedNotice': 'Only the newest files are shown.',
|
|
@@ -115,14 +114,19 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
115
114
|
'fileTypes.fontNaming': 'Font naming convention:\nFontFamily-Weight.extension\n\nExample:\nGeistMono-Black.ttf',
|
|
116
115
|
// ===== Uploading =====
|
|
117
116
|
/** {types} is the kinds of file taken: the words of "fileKind.*" joined with "list.separator" ("image, video"). */
|
|
118
|
-
'upload.uploading': 'Uploading
|
|
117
|
+
'upload.uploading': 'Uploading…',
|
|
119
118
|
'upload.foldersNotAllowed': 'Folders cannot be uploaded',
|
|
120
119
|
'upload.invalidType': 'Invalid file type. Please use {types} files only.',
|
|
121
120
|
'upload.dropActive': 'Drop to upload {types} files',
|
|
121
|
+
/** The four sentences of the dropzone when every kind of file is taken: they do not name a kind (Figma "Upload files"). */
|
|
122
|
+
'upload.dropActiveAny': 'Drop to upload files',
|
|
122
123
|
'upload.button': 'Upload {types} files',
|
|
124
|
+
'upload.buttonAny': 'Upload files',
|
|
123
125
|
'upload.dragHint': 'or drag and drop {types} files here',
|
|
126
|
+
'upload.dragHintAny': 'or drag and drop files here',
|
|
124
127
|
/** On a small screen the sentence is one link. The words of "upload.chooseOrDropLink" inside it are underlined. */
|
|
125
128
|
'upload.chooseOrDrop': 'Upload or drop {types} files here',
|
|
129
|
+
'upload.chooseOrDropAny': 'Upload or drop files here',
|
|
126
130
|
'upload.chooseOrDropLink': 'Upload',
|
|
127
131
|
'upload.panelTitle': 'File Upload Progress',
|
|
128
132
|
'upload.progress': '{total, plural, other {{done}/# files uploaded}}',
|
|
@@ -131,7 +135,6 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
131
135
|
'upload.collapsePanel': 'Collapse panel',
|
|
132
136
|
'upload.expandUploader': 'Expand uploader',
|
|
133
137
|
'upload.collapseUploader': 'Collapse uploader',
|
|
134
|
-
'upload.closeUploader': 'Close uploader',
|
|
135
138
|
'upload.cancel': 'Cancel upload',
|
|
136
139
|
'upload.retry': 'Retry upload',
|
|
137
140
|
'upload.retryFailed': 'Retry failed uploads?',
|
|
@@ -141,7 +144,7 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
141
144
|
'upload.unknownError': 'Unknown error',
|
|
142
145
|
'upload.skippedOne': 'Skipped duplicate file: {name}',
|
|
143
146
|
'upload.skippedMany': '{count, plural, one {Skipped # duplicate file} other {Skipped # duplicate files}}',
|
|
144
|
-
'upload.time.calculating': 'calculating
|
|
147
|
+
'upload.time.calculating': 'calculating…',
|
|
145
148
|
'upload.time.lessThanSecond': 'less than a second',
|
|
146
149
|
'upload.time.seconds': '{count, plural, one {# second} other {# seconds}}',
|
|
147
150
|
'upload.time.minutes': '{count, plural, one {# minute} other {# minutes}}',
|
|
@@ -152,6 +155,8 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
152
155
|
'upload.uploadingProgress': '{total, plural, other {Uploading {done}/# files}}',
|
|
153
156
|
'upload.filesTotal': '{count, plural, one {# file} other {# files}}',
|
|
154
157
|
'upload.completeCount': '{done}/{total} complete',
|
|
158
|
+
'upload.failed': 'Upload failed',
|
|
159
|
+
'upload.rowMeta': '{size} · {detail}',
|
|
155
160
|
// ===== Asking before a change =====
|
|
156
161
|
'dialog.delete.folderTitle': 'Delete folder',
|
|
157
162
|
'dialog.delete.itemsTitle': 'Delete items',
|
|
@@ -159,15 +164,17 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
159
164
|
'dialog.delete.folderMessage': "Delete '{name}' and all content inside?",
|
|
160
165
|
'dialog.delete.itemsMessage': '{count, plural, one {Are you sure you want to delete # item?} other {Are you sure you want to delete # items?}}',
|
|
161
166
|
'dialog.delete.fileMessage': "Delete '{name}'?",
|
|
162
|
-
'dialog.newFolder.
|
|
167
|
+
'dialog.newFolder.title': 'New folder',
|
|
168
|
+
'dialog.newFolder.placeholder': 'folder name…',
|
|
163
169
|
'dialog.newFolder.invalidTitle': 'Invalid folder name',
|
|
164
170
|
'dialog.newFolder.required': 'Folder name is required',
|
|
165
171
|
'dialog.newFolder.invalidCharacters': 'Folder name can only contain letters, numbers, and spaces',
|
|
166
172
|
/** {max} is put in by the dialog: it knows its own limit. */
|
|
167
173
|
'dialog.newFolder.tooLong': 'Folder name cannot exceed {max} characters',
|
|
168
174
|
/** The hint in the empty name field of the rename window, for a file and for a folder. */
|
|
169
|
-
'dialog.rename.
|
|
170
|
-
'dialog.rename.
|
|
175
|
+
'dialog.rename.title': 'Rename',
|
|
176
|
+
'dialog.rename.filePlaceholder': 'file name…',
|
|
177
|
+
'dialog.rename.folderPlaceholder': 'folder name…',
|
|
171
178
|
'dialog.rename.invalidTitle': 'Invalid name',
|
|
172
179
|
'dialog.rename.enterName': 'Please enter a name',
|
|
173
180
|
'dialog.rename.enterDifferentName': 'Please enter a different name',
|
|
@@ -178,14 +185,14 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
178
185
|
/** What a screen reader says for the X that closes a window. */
|
|
179
186
|
'dialog.close': 'Close modal',
|
|
180
187
|
// ===== Messages that pop up after an action =====
|
|
181
|
-
'toast.rename.started': 'Renaming "{name}"
|
|
188
|
+
'toast.rename.started': 'Renaming "{name}"…',
|
|
182
189
|
'toast.rename.done': 'Item renamed',
|
|
183
190
|
'toast.rename.doneDetail': 'Successfully renamed "{oldName}" to "{newName}"',
|
|
184
191
|
'toast.rename.failed': 'Rename failed',
|
|
185
192
|
'toast.rename.noChange': 'No changes were made',
|
|
186
193
|
'toast.rename.noItem': 'No valid item selected',
|
|
187
194
|
'toast.rename.unknownError': 'An unknown error occurred',
|
|
188
|
-
'toast.delete.started': '{count, plural, one {Deleting "{name}"
|
|
195
|
+
'toast.delete.started': '{count, plural, one {Deleting "{name}"…} other {Deleting # items…}}',
|
|
189
196
|
'toast.delete.doneFolder': 'Deleted folder "{name}"',
|
|
190
197
|
'toast.delete.doneFile': 'Deleted "{name}"',
|
|
191
198
|
'toast.delete.doneMany': '{count, plural, one {Deleted # item} other {Deleted # items}}',
|
|
@@ -212,32 +219,30 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
212
219
|
'folder.empty': 'Empty',
|
|
213
220
|
'folder.itemCount': '{count, plural, one {# item} other {# items}}',
|
|
214
221
|
'item.previewLabel': 'Preview {name}',
|
|
215
|
-
'item.audioFile': 'Audio file',
|
|
216
|
-
'item.documentFile': 'Document file',
|
|
217
222
|
'item.deleteMissing': 'Delete missing file',
|
|
218
223
|
'item.folder': 'Folder',
|
|
219
|
-
'recent.title': 'Recent
|
|
220
|
-
'recent.empty': 'No recent files
|
|
221
|
-
'newFolder.alt': 'New Folder',
|
|
224
|
+
'recent.title': 'Recent files',
|
|
225
|
+
'recent.empty': 'No recent files yet',
|
|
222
226
|
'newFolder.label': 'New folder',
|
|
223
227
|
'search.noResults': 'No results found',
|
|
224
228
|
'menu.open': 'Open menu',
|
|
225
229
|
'menu.moreOptions': 'More options',
|
|
226
230
|
// ===== The bar over a selection, and the list of selected files =====
|
|
227
|
-
'toolbar.more': '+{count} more',
|
|
228
231
|
'toolbar.moveMany': '{count, plural, one {Move # file} other {Move # files}}',
|
|
229
232
|
'toolbar.deleteMany': '{count, plural, one {Delete # file} other {Delete # files}}',
|
|
230
233
|
'selectedFiles.title': 'Selected files',
|
|
231
234
|
'selectedFiles.empty': 'No files selected',
|
|
232
235
|
'selectedFiles.count': '{count, plural, one {# file selected} other {# files selected}}',
|
|
233
236
|
'selectedFiles.confirmMany': '{count, plural, one {Use # file} other {Use # files}}',
|
|
237
|
+
'selectedFiles.remove': 'Remove from selection',
|
|
234
238
|
// ===== Search window =====
|
|
235
|
-
'searchModal.placeholder': 'Search files and folders
|
|
239
|
+
'searchModal.placeholder': 'Search files and folders…',
|
|
236
240
|
'searchModal.jumpToFolder': 'Jump to folder',
|
|
237
241
|
'searchModal.empty': 'No files found',
|
|
242
|
+
'searchModal.clearQuery': 'Clear search',
|
|
238
243
|
// ===== Moving files =====
|
|
239
244
|
/** {name} is the file or folder, cut at 30 characters. */
|
|
240
|
-
'moveDialog.titleOne': 'Move
|
|
245
|
+
'moveDialog.titleOne': 'Move “{name}”',
|
|
241
246
|
'moveDialog.titleMany': '{count, plural, one {Move # item} other {Move # items}}',
|
|
242
247
|
/** The name of the top of the library in the folder list of the move window. */
|
|
243
248
|
'moveDialog.rootName': 'Files',
|
|
@@ -264,22 +269,25 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
264
269
|
'preview.audioUnsupported': 'Your browser does not support the audio element.',
|
|
265
270
|
'preview.videoFailed': 'Video failed to load',
|
|
266
271
|
'preview.videoUnsupported': 'Your browser does not support the video tag.',
|
|
267
|
-
'preview.
|
|
272
|
+
'preview.videoProgress': 'Video progress',
|
|
268
273
|
'preview.fileNotFound': 'File not found',
|
|
269
|
-
'preview.loading': 'Loading
|
|
274
|
+
'preview.loading': 'Loading…',
|
|
270
275
|
'preview.textFailed': 'Failed to load text file',
|
|
271
276
|
/** {reason} is what the server said ("Not Found"). */
|
|
272
277
|
'preview.textFailedReason': 'Failed to load text file: {reason}',
|
|
273
278
|
'preview.unavailable': 'Preview not available for this file type.',
|
|
274
|
-
'preview.pdfLoading': 'Loading PDF
|
|
279
|
+
'preview.pdfLoading': 'Loading PDF…',
|
|
275
280
|
'preview.pdfFailed': 'Failed to load PDF',
|
|
276
281
|
/** {page} and {total} are put in by the PDF viewer ({total} is "?" until the number of pages is known). */
|
|
277
282
|
'preview.pdfPage': 'Page {page} of {total}',
|
|
278
283
|
'preview.pdfPreviousPage': 'Previous page',
|
|
279
284
|
'preview.pdfNextPage': 'Next page',
|
|
285
|
+
'preview.metaSeparator': ' · ',
|
|
286
|
+
'preview.previousFile': 'Previous file',
|
|
287
|
+
'preview.nextFile': 'Next file',
|
|
288
|
+
'preview.dimensions': '{width} × {height}',
|
|
280
289
|
/** The sentence a font is shown in. Use a sentence that shows the letters of your language. */
|
|
281
290
|
'fontPreview.sample': 'The quick brown fox jumps over the lazy dog',
|
|
282
|
-
'fontPreview.sampleShort': 'The quick fox',
|
|
283
291
|
'metadata.title': 'File Information',
|
|
284
292
|
'metadata.name': 'Name:',
|
|
285
293
|
'metadata.type': 'Type:',
|
|
@@ -293,5 +301,10 @@ export const FILE_BROWSER_MESSAGES = {
|
|
|
293
301
|
'date.weeksAgo': '{count, plural, one {# week ago} other {# weeks ago}}',
|
|
294
302
|
'date.aboutAMonthAgo': 'About a month ago',
|
|
295
303
|
'date.severalMonthsAgo': 'Several months ago',
|
|
296
|
-
'date.overAYearAgo': 'Over a year ago'
|
|
304
|
+
'date.overAYearAgo': 'Over a year ago',
|
|
305
|
+
};
|
|
306
|
+
/** Catalog keys referenced from Svelte without string literals in templates (i18n audit). */
|
|
307
|
+
export const UPLOAD_ERROR_KEYS = {
|
|
308
|
+
libraryFailed: 'libraryError.uploadFailed',
|
|
309
|
+
network: 'upload.networkError'
|
|
297
310
|
};
|
|
@@ -5,7 +5,7 @@ export declare const fileStore: {
|
|
|
5
5
|
update: (this: void, updater: import("svelte/store").Updater<FileSystemRoot>) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare const currentFolder: import("svelte/store").Writable<string[]>;
|
|
8
|
-
export declare const sortCriteria: import("svelte/store").Writable<"name" | "
|
|
8
|
+
export declare const sortCriteria: import("svelte/store").Writable<"name" | "date" | "size">;
|
|
9
9
|
export declare const sortDirection: import("svelte/store").Writable<"desc" | "asc">;
|
|
10
10
|
export declare const selectedFiles: import("svelte/store").Writable<FileSystemItem[]>;
|
|
11
11
|
export declare const fileFilter: import("svelte/store").Writable<string[]>;
|
|
@@ -13,7 +13,7 @@ export declare const fileFilter: import("svelte/store").Writable<string[]>;
|
|
|
13
13
|
* Derived store that automatically sorts files based on criteria
|
|
14
14
|
* Maintains folder priority (folders always appear before files)
|
|
15
15
|
*/
|
|
16
|
-
export declare const sortedFiles: import("svelte/store").Readable<
|
|
16
|
+
export declare const sortedFiles: import("svelte/store").Readable<any>;
|
|
17
17
|
/**
|
|
18
18
|
* Initializes or updates the file store with new data
|
|
19
19
|
* Includes validation and error handling
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { currentFolder } from './fileStore';
|
|
2
|
-
export declare const currentPathNames: import("svelte/store").Readable<
|
|
2
|
+
export declare const currentPathNames: import("svelte/store").Readable<any>;
|
|
3
3
|
export { currentFolder };
|
|
4
4
|
export declare const navigationActions: import("svelte/store").Writable<{
|
|
5
5
|
navigateToPath: (path: string[]) => void;
|
|
@@ -24,5 +24,5 @@ export declare const persistentSelectStore: {
|
|
|
24
24
|
update(this: void, updater: import("svelte/store").Updater<StoredSelections>): void;
|
|
25
25
|
subscribe(this: void, run: import("svelte/store").Subscriber<StoredSelections>, invalidate?: () => void): import("svelte/store").Unsubscriber;
|
|
26
26
|
};
|
|
27
|
-
export declare const validSelections: import("svelte/store").Readable<(filterType: FileFilterType, files: FileSystemItem[]) =>
|
|
27
|
+
export declare const validSelections: import("svelte/store").Readable<(filterType: FileFilterType, files: FileSystemItem[]) => any[]>;
|
|
28
28
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widgetic/file-browser",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.36",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@tailwindcss/postcss": "^4.3.0",
|
|
98
98
|
"@types/node": "^22.13.4",
|
|
99
99
|
"@widgetic/cache-layer": "^0.1.1",
|
|
100
|
-
"@widgetic/design-system": "^0.5.
|
|
100
|
+
"@widgetic/design-system": "^0.5.23",
|
|
101
101
|
"@widgetic/dev-tools": "^0.3.0",
|
|
102
102
|
"concurrently": "^9.1.2",
|
|
103
103
|
"eslint": "^9.0.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"@sveltejs/kit": "^2.20.7",
|
|
120
120
|
"@widgetic/cache-layer": "^0.1.1",
|
|
121
|
-
"@widgetic/design-system": ">=0.
|
|
121
|
+
"@widgetic/design-system": ">=0.5.23",
|
|
122
122
|
"pdfjs-dist": "^4.10.38",
|
|
123
123
|
"svelte": "^5.0.0"
|
|
124
124
|
},
|
|
@@ -128,7 +128,6 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@tabler/icons-svelte": "^3.24.0",
|
|
132
131
|
"date-fns": "^4.1.0",
|
|
133
132
|
"tus-js-client": "^4.2.3"
|
|
134
133
|
},
|