@widgetic/file-browser 0.5.24 → 0.5.26
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 +279 -0
- package/dist/components/FolderTree.svelte +16 -9
- package/dist/components/FolderTree.svelte.d.ts +2 -6
- package/dist/components/core/FileBrowser.svelte +529 -127
- package/dist/components/core/FileBrowser.svelte.d.ts +40 -1
- package/dist/components/core/FileUploader.svelte +130 -57
- package/dist/components/core/Header.svelte +13 -2
- package/dist/components/core/Header.svelte.d.ts +1 -0
- package/dist/components/core/RecentFiles.svelte +41 -29
- package/dist/components/core/UploadStatus.svelte +14 -7
- package/dist/components/core/UploadStatusList.svelte +13 -21
- package/dist/components/items/FileItem.svelte +28 -15
- package/dist/components/items/FolderItem.svelte +13 -6
- package/dist/components/modals/MoveDialog.svelte +49 -38
- package/dist/components/modals/NewFolderButton.svelte +5 -2
- package/dist/components/modals/SearchModal.svelte +25 -26
- package/dist/components/modals/SearchModal.svelte.d.ts +1 -1
- package/dist/components/modals/SelectedFilesModal.svelte +23 -14
- package/dist/components/modals/SelectedFilesModal.svelte.d.ts +1 -1
- package/dist/components/previews/AudioPlayer.svelte +5 -2
- package/dist/components/previews/ErrorPreview.svelte +7 -4
- package/dist/components/previews/ErrorPreview.svelte.d.ts +1 -1
- package/dist/components/previews/FilePreview.svelte +25 -9
- package/dist/components/previews/FontPreview.svelte +18 -9
- package/dist/components/previews/FontPreview.svelte.d.ts +1 -1
- package/dist/components/previews/TextPreview.svelte +12 -5
- package/dist/components/previews/VideoPlayer.svelte +11 -7
- package/dist/components/ui/ControlToolbar.svelte +50 -28
- package/dist/components/ui/ControlToolbar.svelte.d.ts +1 -1
- package/dist/components/ui/DragSelect.svelte +3 -2
- package/dist/components/ui/DropdownMenu.svelte +35 -14
- package/dist/components/ui/FileIcon.svelte +8 -5
- package/dist/components/ui/FileIcon.svelte.d.ts +1 -0
- package/dist/components/ui/FileMetadata.svelte +16 -15
- package/dist/components/ui/SearchResults.svelte +9 -2
- package/dist/i18n/context.d.ts +28 -0
- package/dist/i18n/context.js +17 -0
- package/dist/i18n/errors.d.ts +11 -0
- package/dist/i18n/errors.js +19 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/i18n/index.js +18 -0
- package/dist/i18n/messages.d.ts +281 -0
- package/dist/i18n/messages.js +294 -0
- package/dist/i18n/text.d.ts +19 -0
- package/dist/i18n/text.js +35 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/mediaLibrary/capabilities.d.ts +22 -0
- package/dist/mediaLibrary/capabilities.js +42 -0
- package/dist/mediaLibrary/context.d.ts +17 -0
- package/dist/mediaLibrary/context.js +16 -0
- package/dist/mediaLibrary/errors.d.ts +42 -0
- package/dist/mediaLibrary/errors.js +114 -0
- package/dist/mediaLibrary/index.d.ts +10 -0
- package/dist/mediaLibrary/index.js +9 -0
- package/dist/mediaLibrary/normalize.d.ts +39 -0
- package/dist/mediaLibrary/normalize.js +139 -0
- package/dist/mediaLibrary/paging.d.ts +37 -0
- package/dist/mediaLibrary/paging.js +62 -0
- package/dist/mediaLibrary/resolve.d.ts +39 -0
- package/dist/mediaLibrary/resolve.js +137 -0
- package/dist/mediaLibrary/treeOps.d.ts +24 -0
- package/dist/mediaLibrary/treeOps.js +67 -0
- package/dist/mediaLibrary/types.d.ts +126 -0
- package/dist/mediaLibrary/types.js +11 -0
- package/dist/mediaLibrary/urls.d.ts +30 -0
- package/dist/mediaLibrary/urls.js +59 -0
- package/dist/mediaLibrary/widgetic.d.ts +39 -0
- package/dist/mediaLibrary/widgetic.js +89 -0
- package/dist/stores/fileStore.d.ts +2 -2
- package/dist/stores/folderCountStore.js +2 -2
- package/dist/stores/navigationStore.d.ts +1 -1
- package/dist/stores/persistentSelectStore.d.ts +11 -1
- package/dist/stores/persistentSelectStore.js +26 -0
- package/dist/utils/dateUtils.d.ts +11 -2
- package/dist/utils/dateUtils.js +20 -15
- package/dist/utils/fileKinds.d.ts +44 -0
- package/dist/utils/fileKinds.js +96 -0
- package/dist/utils/fileNames.d.ts +7 -0
- package/dist/utils/fileNames.js +19 -0
- package/dist/utils/fileOperations.js +2 -11
- package/dist/utils/fileTypes.d.ts +11 -2
- package/dist/utils/fileTypes.js +26 -14
- package/dist/utils/fileUtils.d.ts +8 -1
- package/dist/utils/fileUtils.js +22 -7
- package/dist/utils/folderUtils.js +3 -2
- package/dist/utils/previewKeys.d.ts +12 -0
- package/dist/utils/previewKeys.js +14 -0
- package/dist/utils/safeText.d.ts +29 -0
- package/dist/utils/safeText.js +66 -0
- package/dist/utils/userUploadsStorage.d.ts +4 -1
- package/dist/utils/userUploadsStorage.js +5 -2
- package/dist/utils/widgeticTusUpload.d.ts +10 -0
- package/dist/utils/widgeticTusUpload.js +61 -3
- package/dist/utils/widgeticUpload.d.ts +3 -0
- package/dist/utils/widgeticUpload.js +7 -2
- package/package.json +5 -2
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
-
import {
|
|
3
|
+
import { getFileIcon } from '../../utils/fileUtils';
|
|
4
|
+
import { getFileTypeOf } from '../../utils/fileKinds';
|
|
5
|
+
import { toCssUrlLiteral, toSafeFontFamilyName } from '../../utils/safeText';
|
|
4
6
|
|
|
5
|
-
export let file: { url?: string; name: string; thumbnail?: string };
|
|
7
|
+
export let file: { url?: string; name: string; thumbnail?: string; mimeType?: string };
|
|
6
8
|
export let size: 'sm' | 'md' | 'lg' = 'md';
|
|
7
9
|
|
|
8
10
|
let hasError = false;
|
|
9
11
|
let fontLoaded = false;
|
|
10
12
|
let fontFace: FontFace;
|
|
11
13
|
|
|
12
|
-
$: fileType =
|
|
14
|
+
$: fileType = getFileTypeOf(file);
|
|
13
15
|
$: isFont = fileType === 'font';
|
|
14
16
|
$: isSvg = fileType === 'svg';
|
|
15
|
-
|
|
17
|
+
// The name a font is registered and styled under; safe to put inside CSS (see safeText.ts).
|
|
18
|
+
$: fontName = toSafeFontFamilyName(file.name);
|
|
16
19
|
|
|
17
20
|
$: sizeClasses = {
|
|
18
21
|
sm: 'w-8 h-7',
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
onMount(async () => {
|
|
24
27
|
if (isFont && file.url) {
|
|
25
28
|
try {
|
|
26
|
-
fontFace = new FontFace(fontName,
|
|
29
|
+
fontFace = new FontFace(fontName, toCssUrlLiteral(file.url));
|
|
27
30
|
await fontFace.load();
|
|
28
31
|
document.fonts.add(fontFace);
|
|
29
32
|
fontLoaded = true;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FileSystemItem } from '../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { getFileTypeOf } from '../../utils/fileKinds';
|
|
4
|
+
import { formatFileSize } from '../../utils/fileUtils';
|
|
5
|
+
import { useI18n } from '../../i18n';
|
|
6
|
+
import { dirForUserText, useTextDirection } from '@widgetic/design-system/components/textDirection';
|
|
7
|
+
import { kindWord } from '../../i18n/text';
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
const { t, locale } = useI18n();
|
|
10
|
+
// The reading direction of the screen: a name a visitor wrote keeps a direction of its own on a right to left screen.
|
|
11
|
+
const textDirection = useTextDirection();
|
|
12
|
+
$: nameDirection = dirForUserText($textDirection);
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
if (bytes === 0) return '0 Bytes';
|
|
9
|
-
const k = 1024;
|
|
10
|
-
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
11
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
12
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
|
13
|
-
}
|
|
14
|
+
export let file: FileSystemItem;
|
|
14
15
|
|
|
15
|
-
$: fileType =
|
|
16
|
+
$: fileType = getFileTypeOf(file);
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
19
|
<div class="bg-gray-100 p-4 rounded-large widgetic-radius widgetic-colors">
|
|
19
|
-
<h3 class="text-lg subtext mb-2">
|
|
20
|
+
<h3 class="text-lg subtext mb-2">{$t('metadata.title')}</h3>
|
|
20
21
|
<ul class="space-y-2">
|
|
21
|
-
<li><strong>
|
|
22
|
-
<li><strong>
|
|
23
|
-
<li><strong>
|
|
24
|
-
<li><strong>
|
|
22
|
+
<li><strong>{$t('metadata.name')}</strong> <span dir={nameDirection}>{file.name}</span></li>
|
|
23
|
+
<li><strong>{$t('metadata.type')}</strong> {kindWord(fileType, $t)}</li>
|
|
24
|
+
<li><strong>{$t('metadata.size')}</strong> {file.size ? formatFileSize(file.size, $t, $locale) : $t('metadata.notAvailable')}</li>
|
|
25
|
+
<li><strong>{$t('metadata.modified')}</strong> {file.modified ? new Date(file.modified).toLocaleString($locale) : $t('metadata.notAvailable')}</li>
|
|
25
26
|
</ul>
|
|
26
27
|
</div>
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
import type { FileSystemItem, FolderItemWithCount } from '../../types';
|
|
3
3
|
import { FileIcon } from './';
|
|
4
4
|
import { FolderItem } from '../items';
|
|
5
|
+
import { useI18n } from '../../i18n';
|
|
6
|
+
import { dirForUserText, useTextDirection } from '@widgetic/design-system/components/textDirection';
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
// The reading direction of the screen: a name a visitor wrote keeps a direction of its own on a right to left screen.
|
|
10
|
+
const textDirection = useTextDirection();
|
|
11
|
+
$: nameDirection = dirForUserText($textDirection);
|
|
5
12
|
|
|
6
13
|
// Props
|
|
7
14
|
export let results: FileSystemItem[];
|
|
@@ -21,7 +28,7 @@
|
|
|
21
28
|
<!-- Display search results, showing either files or folders -->
|
|
22
29
|
<div class="space-y-2">
|
|
23
30
|
{#if results.length === 0}
|
|
24
|
-
<p class="text-center text-gray-600">
|
|
31
|
+
<p class="text-center text-gray-600">{$t('search.noResults')}</p>
|
|
25
32
|
{:else}
|
|
26
33
|
{#each results as item (item.name)}
|
|
27
34
|
{#if item.type === 'folder'}
|
|
@@ -29,7 +36,7 @@
|
|
|
29
36
|
{:else}
|
|
30
37
|
<div class="flex items-center p-2 hover:bg-[hsl(var(--grey3))] rounded-large widgetic-radius widgetic-colors">
|
|
31
38
|
<FileIcon file={item} size="md" />
|
|
32
|
-
<span class="
|
|
39
|
+
<span dir={nameDirection} class="ms-2">{item.name}</span>
|
|
33
40
|
</div>
|
|
34
41
|
{/if}
|
|
35
42
|
{/each}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type I18nContext as KitI18nContext, type I18nHandle as KitI18nHandle, type I18nSettings as KitI18nSettings, type Translate as KitTranslate } from '@widgetic/design-system/i18n';
|
|
2
|
+
import { type FileBrowserMessageKey } from './messages';
|
|
3
|
+
/**
|
|
4
|
+
* The words of the File Browser are made by the design system's i18n kit (`@widgetic/design-system/i18n`), the same
|
|
5
|
+
* translator and context every Widgetic package uses; this file gives it the File Browser's catalog and name.
|
|
6
|
+
*/
|
|
7
|
+
/** The function a screen calls to get its words: `t('upload.clear')`, `t('toast.deleted', { name })`. */
|
|
8
|
+
export type Translate = KitTranslate<FileBrowserMessageKey>;
|
|
9
|
+
/**
|
|
10
|
+
* What the File Browser's parts need to speak the page's language, shared with them through Svelte's component
|
|
11
|
+
* context (the way the media library is, see `mediaLibrary/context.ts`).
|
|
12
|
+
*
|
|
13
|
+
* Both are stores, so a screen that is already open changes its words when the page calls `setLanguage()`.
|
|
14
|
+
*/
|
|
15
|
+
export type I18nContext = KitI18nContext<FileBrowserMessageKey>;
|
|
16
|
+
/** What the page chose. Both are optional; a missing language is English. */
|
|
17
|
+
export type I18nSettings = KitI18nSettings;
|
|
18
|
+
/** What {@link provideI18n} gives back to the component that called it. */
|
|
19
|
+
export type I18nHandle = KitI18nHandle<FileBrowserMessageKey>;
|
|
20
|
+
/** The English `t`, for code that has no component around it (a helper called without a translator). */
|
|
21
|
+
export declare const translateEnglish: Translate;
|
|
22
|
+
/**
|
|
23
|
+
* Called by the File Browser while it is created, so everything inside it speaks the page's language.
|
|
24
|
+
* The context belongs to one File Browser, so two File Browsers on a page can speak two languages.
|
|
25
|
+
*/
|
|
26
|
+
export declare function provideI18n(initial: I18nSettings): I18nHandle;
|
|
27
|
+
/** Called by a part of the File Browser while it is created. Never throws; outside a File Browser it speaks English. */
|
|
28
|
+
export declare function useI18n(): I18nContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createI18n } from '@widgetic/design-system/i18n';
|
|
2
|
+
import { FILE_BROWSER_MESSAGES } from './messages';
|
|
3
|
+
/** The File Browser's words. Problems with the page's messages are said in the console as `[FileBrowser] …`. */
|
|
4
|
+
const fileBrowserI18n = createI18n({ catalog: FILE_BROWSER_MESSAGES, label: 'FileBrowser' });
|
|
5
|
+
/** The English `t`, for code that has no component around it (a helper called without a translator). */
|
|
6
|
+
export const translateEnglish = fileBrowserI18n.translateEnglish;
|
|
7
|
+
/**
|
|
8
|
+
* Called by the File Browser while it is created, so everything inside it speaks the page's language.
|
|
9
|
+
* The context belongs to one File Browser, so two File Browsers on a page can speak two languages.
|
|
10
|
+
*/
|
|
11
|
+
export function provideI18n(initial) {
|
|
12
|
+
return fileBrowserI18n.provideI18n(initial);
|
|
13
|
+
}
|
|
14
|
+
/** Called by a part of the File Browser while it is created. Never throws; outside a File Browser it speaks English. */
|
|
15
|
+
export function useI18n() {
|
|
16
|
+
return fileBrowserI18n.useI18n();
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Translate } from './context';
|
|
2
|
+
import type { FileBrowserMessageKey } from './messages';
|
|
3
|
+
/**
|
|
4
|
+
* The sentence a visitor reads for a failure.
|
|
5
|
+
*
|
|
6
|
+
* - A media library's own words are shown as they are (the library knows its reasons: "File too large").
|
|
7
|
+
* - The File Browser's own sentence for a library failure is shown in the visitor's language (`messageKey`).
|
|
8
|
+
* - Any other error keeps its message, as it always has.
|
|
9
|
+
* - With nothing to say, `fallbackKey`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function messageForVisitor(error: unknown, t: Translate, fallbackKey?: FileBrowserMessageKey): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MediaLibraryError } from '../mediaLibrary/errors';
|
|
2
|
+
/**
|
|
3
|
+
* The sentence a visitor reads for a failure.
|
|
4
|
+
*
|
|
5
|
+
* - A media library's own words are shown as they are (the library knows its reasons: "File too large").
|
|
6
|
+
* - The File Browser's own sentence for a library failure is shown in the visitor's language (`messageKey`).
|
|
7
|
+
* - Any other error keeps its message, as it always has.
|
|
8
|
+
* - With nothing to say, `fallbackKey`.
|
|
9
|
+
*/
|
|
10
|
+
export function messageForVisitor(error, t, fallbackKey = 'toast.unknownError') {
|
|
11
|
+
if (error instanceof MediaLibraryError) {
|
|
12
|
+
if (error.messageKey !== undefined)
|
|
13
|
+
return t(error.messageKey, error.messageValues);
|
|
14
|
+
return error.message || t(fallbackKey);
|
|
15
|
+
}
|
|
16
|
+
if (error instanceof Error && error.message)
|
|
17
|
+
return error.message;
|
|
18
|
+
return t(fallbackKey);
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words of the File Browser in the page's language: the English catalog, the translator that fills it in (the
|
|
3
|
+
* design system's, `@widgetic/design-system/i18n`) and the Svelte context the screens use.
|
|
4
|
+
*/
|
|
5
|
+
import { type MessageOverrides, type MessageProblem } from '@widgetic/design-system/i18n';
|
|
6
|
+
export { FILE_BROWSER_MESSAGES, type FileBrowserMessageKey } from './messages';
|
|
7
|
+
export { createTranslator, describeMessageProblem, findMessageProblems, type MessageOverrides, type MessageProblem, type MessageValue, type MessageValues, type Translator, type TranslatorOptions } from '@widgetic/design-system/i18n';
|
|
8
|
+
export { provideI18n, translateEnglish, useI18n, type I18nContext, type I18nHandle, type I18nSettings, type Translate } from './context';
|
|
9
|
+
export { messageForVisitor } from './errors';
|
|
10
|
+
/**
|
|
11
|
+
* Checks a page's `messages` against the File Browser's catalog without showing anything: a key that does not exist
|
|
12
|
+
* (with the nearest real one), a value that is not text, a template that does not parse, or one that asks for a value
|
|
13
|
+
* the message is never given. An empty list means every message will be used. For a test or a build step of the page.
|
|
14
|
+
*/
|
|
15
|
+
export declare function checkFileBrowserMessages(messages: MessageOverrides): MessageProblem[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words of the File Browser in the page's language: the English catalog, the translator that fills it in (the
|
|
3
|
+
* design system's, `@widgetic/design-system/i18n`) and the Svelte context the screens use.
|
|
4
|
+
*/
|
|
5
|
+
import { findMessageProblems } from '@widgetic/design-system/i18n';
|
|
6
|
+
import { FILE_BROWSER_MESSAGES } from './messages';
|
|
7
|
+
export { FILE_BROWSER_MESSAGES } from './messages';
|
|
8
|
+
export { createTranslator, describeMessageProblem, findMessageProblems } from '@widgetic/design-system/i18n';
|
|
9
|
+
export { provideI18n, translateEnglish, useI18n } from './context';
|
|
10
|
+
export { messageForVisitor } from './errors';
|
|
11
|
+
/**
|
|
12
|
+
* Checks a page's `messages` against the File Browser's catalog without showing anything: a key that does not exist
|
|
13
|
+
* (with the nearest real one), a value that is not text, a template that does not parse, or one that asks for a value
|
|
14
|
+
* the message is never given. An empty list means every message will be used. For a test or a build step of the page.
|
|
15
|
+
*/
|
|
16
|
+
export function checkFileBrowserMessages(messages) {
|
|
17
|
+
return findMessageProblems(FILE_BROWSER_MESSAGES, messages);
|
|
18
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word the File Browser shows, in English: the one place to read them, and the keys a page can replace with the
|
|
3
|
+
* `messages` option (or `setLanguage()` of the module).
|
|
4
|
+
*
|
|
5
|
+
* A message is plain text. `{name}` is a value the File Browser puts in; `{count, plural, one {# file} other {# files}}`
|
|
6
|
+
* picks the form that fits a number in the page's language. `\{`, `\}`, `\#` and `\\` write those characters
|
|
7
|
+
* themselves. See `translator.ts` for the whole format.
|
|
8
|
+
*
|
|
9
|
+
* Keys are grouped by where the words appear. A key that is left out of a page's `messages` keeps the English text
|
|
10
|
+
* below, so a language can be added a screen at a time.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FILE_BROWSER_MESSAGES: {
|
|
13
|
+
readonly 'action.cancel': "Cancel";
|
|
14
|
+
readonly 'action.confirm': "Confirm";
|
|
15
|
+
readonly 'action.create': "Create";
|
|
16
|
+
readonly 'action.delete': "Delete";
|
|
17
|
+
readonly 'action.done': "Done";
|
|
18
|
+
readonly 'action.download': "Download";
|
|
19
|
+
readonly 'action.move': "Move";
|
|
20
|
+
readonly 'action.rename': "Rename";
|
|
21
|
+
readonly 'action.tryAgain': "Try again";
|
|
22
|
+
readonly 'action.preview': "Preview";
|
|
23
|
+
readonly 'action.play': "Play";
|
|
24
|
+
readonly 'action.pause': "Pause";
|
|
25
|
+
readonly 'action.mute': "Mute";
|
|
26
|
+
readonly 'action.unmute': "Unmute";
|
|
27
|
+
readonly 'action.select': "Select";
|
|
28
|
+
readonly 'action.selected': "Selected";
|
|
29
|
+
readonly 'action.clearItems': "Clear items";
|
|
30
|
+
/** The button that hands the picked files to the page. The module shows "Select" here. */
|
|
31
|
+
readonly 'action.addToEditor': "Add to Editor";
|
|
32
|
+
/** Put between names in a list of names ("a.png, b.png"). */
|
|
33
|
+
readonly 'list.separator': ", ";
|
|
34
|
+
readonly 'toast.inBackground': "This will happen in the background";
|
|
35
|
+
readonly 'toast.unknownError': "Unknown error occurred";
|
|
36
|
+
/** What a screen reader hears for the region that holds the pop-ups. The library adds the key that moves focus to it. */
|
|
37
|
+
readonly 'toast.regionLabel': "Notifications";
|
|
38
|
+
/** What a screen reader hears for the button that closes a pop-up. */
|
|
39
|
+
readonly 'toast.closeLabel': "Close notification";
|
|
40
|
+
readonly 'search.placeholder': "Search...";
|
|
41
|
+
readonly 'filter.by': "Filter by {type}";
|
|
42
|
+
readonly 'filterName.all': "All";
|
|
43
|
+
readonly 'filterName.image': "Image";
|
|
44
|
+
readonly 'filterName.audio': "Audio";
|
|
45
|
+
readonly 'filterName.video': "Video";
|
|
46
|
+
readonly 'filterName.document': "Document";
|
|
47
|
+
readonly 'filterName.font': "Font";
|
|
48
|
+
readonly 'filterName.svg': "SVG";
|
|
49
|
+
readonly 'filterOption.all': "All";
|
|
50
|
+
readonly 'filterOption.image': "Images";
|
|
51
|
+
readonly 'filterOption.video': "Videos";
|
|
52
|
+
readonly 'filterOption.document': "Documents";
|
|
53
|
+
readonly 'filterOption.audio': "Audio";
|
|
54
|
+
readonly 'filterOption.font': "Fonts";
|
|
55
|
+
readonly 'filterOption.svg': "SVG";
|
|
56
|
+
readonly 'sort.name': "Name";
|
|
57
|
+
readonly 'sort.date': "Date";
|
|
58
|
+
readonly 'sort.size': "Size";
|
|
59
|
+
readonly 'breadcrumbs.back': "Back";
|
|
60
|
+
readonly 'breadcrumbs.forward': "Forward";
|
|
61
|
+
/** The first step of the path above the files. */
|
|
62
|
+
readonly 'breadcrumbs.root': "File browser";
|
|
63
|
+
/** What a screen reader says for the path above the files. */
|
|
64
|
+
readonly 'breadcrumbs.label': "breadcrumb";
|
|
65
|
+
readonly 'empty.library': "No files yet!";
|
|
66
|
+
readonly 'empty.libraryFiltered': "No files of this type!";
|
|
67
|
+
readonly 'empty.folder': "No files in this folder!";
|
|
68
|
+
readonly 'library.partialNotice': "Some files could not be loaded.";
|
|
69
|
+
readonly 'library.truncatedNotice': "Only the newest files are shown.";
|
|
70
|
+
readonly 'library.notSetUp': "The media library is not set up correctly.";
|
|
71
|
+
/** The name of the folder that holds the files, when the page's library does not name itself. */
|
|
72
|
+
readonly 'library.defaultLabel': "My uploads";
|
|
73
|
+
/** Why a call to the library failed, when the library gave no reason of its own. */
|
|
74
|
+
readonly 'libraryError.loadFailed': "Could not load the files";
|
|
75
|
+
readonly 'libraryError.uploadFailed': "The upload failed";
|
|
76
|
+
readonly 'libraryError.renameFailed': "Could not rename the file";
|
|
77
|
+
readonly 'libraryError.deleteFailed': "Could not delete the file";
|
|
78
|
+
readonly 'libraryError.unreachable': "Could not reach the media library";
|
|
79
|
+
readonly 'libraryError.timeout': "The media library did not answer in time";
|
|
80
|
+
readonly 'libraryError.renameNotAllowed': "This media library does not allow renaming files";
|
|
81
|
+
readonly 'libraryError.deleteNotAllowed': "This media library does not allow deleting files";
|
|
82
|
+
readonly 'libraryError.fileGone': "The file is no longer in the list";
|
|
83
|
+
readonly 'libraryError.repeatedPage': "The media library keeps returning the same files, so the rest was not loaded";
|
|
84
|
+
readonly 'libraryError.accessToken': "Could not get an access token from the page";
|
|
85
|
+
readonly 'libraryError.accessTokenRenew': "Could not get a fresh access token from the page";
|
|
86
|
+
readonly 'libraryError.fileTooLarge': "Files over {limit} MB cannot be uploaded here yet";
|
|
87
|
+
readonly 'libraryError.uploadNotAllowed': "This media library does not accept uploads";
|
|
88
|
+
readonly 'size.bytes': "{size} Bytes";
|
|
89
|
+
readonly 'size.kb': "{size} KB";
|
|
90
|
+
readonly 'size.mb': "{size} MB";
|
|
91
|
+
readonly 'size.gb': "{size} GB";
|
|
92
|
+
readonly 'size.tb': "{size} TB";
|
|
93
|
+
readonly 'fileKind.any': "any";
|
|
94
|
+
readonly 'fileKind.image': "image";
|
|
95
|
+
readonly 'fileKind.video': "video";
|
|
96
|
+
readonly 'fileKind.audio': "audio";
|
|
97
|
+
readonly 'fileKind.document': "document";
|
|
98
|
+
readonly 'fileKind.font': "font";
|
|
99
|
+
readonly 'fileKind.svg': "SVG";
|
|
100
|
+
/** {types} is a list of extensions (".jpg, .png"). */
|
|
101
|
+
readonly 'fileTypes.allowed': "Allowed types: {types}";
|
|
102
|
+
readonly 'fileTypes.allowedSvg': "Allowed types: SVG files (.svg)";
|
|
103
|
+
readonly 'fileTypes.allowedDocument': "Allowed types: document files ({types})";
|
|
104
|
+
/** One sentence listing every kind with its extensions (each a list joined with "list.separator"). */
|
|
105
|
+
readonly 'fileTypes.addAll': "Add images ({images}), audio ({audio}), video ({video}), documents ({documents}), fonts ({fonts}) or vector graphics ({svg}).";
|
|
106
|
+
readonly 'fileTypes.fontNaming': "Font naming convention:\nFontFamily-Weight.extension\n\nExample:\nGeistMono-Black.ttf";
|
|
107
|
+
/** {types} is the kinds of file taken: the words of "fileKind.*" joined with "list.separator" ("image, video"). */
|
|
108
|
+
readonly 'upload.uploading': "Uploading...";
|
|
109
|
+
readonly 'upload.foldersNotAllowed': "Folders cannot be uploaded";
|
|
110
|
+
readonly 'upload.invalidType': "Invalid file type. Please use {types} files only.";
|
|
111
|
+
readonly 'upload.dropActive': "Drop to upload {types} files";
|
|
112
|
+
readonly 'upload.button': "Upload {types} files";
|
|
113
|
+
readonly 'upload.dragHint': "or drag and drop {types} files here";
|
|
114
|
+
/** On a small screen the sentence is one link. The words of "upload.chooseOrDropLink" inside it are underlined. */
|
|
115
|
+
readonly 'upload.chooseOrDrop': "Upload or drop {types} files here";
|
|
116
|
+
readonly 'upload.chooseOrDropLink': "Upload";
|
|
117
|
+
readonly 'upload.panelTitle': "File Upload Progress";
|
|
118
|
+
readonly 'upload.progress': "{total, plural, other {{done}/# files uploaded}}";
|
|
119
|
+
readonly 'upload.failedCount': "{count} failed";
|
|
120
|
+
readonly 'upload.expandPanel': "Expand panel";
|
|
121
|
+
readonly 'upload.collapsePanel': "Collapse panel";
|
|
122
|
+
readonly 'upload.expandUploader': "Expand uploader";
|
|
123
|
+
readonly 'upload.collapseUploader': "Collapse uploader";
|
|
124
|
+
readonly 'upload.closeUploader': "Close uploader";
|
|
125
|
+
readonly 'upload.cancel': "Cancel upload";
|
|
126
|
+
readonly 'upload.retry': "Retry upload";
|
|
127
|
+
readonly 'upload.retryFailed': "Retry failed uploads?";
|
|
128
|
+
readonly 'upload.clearCompleted': "Clear completed uploads";
|
|
129
|
+
readonly 'upload.completedAlt': "Completed";
|
|
130
|
+
readonly 'upload.networkError': "Network error";
|
|
131
|
+
readonly 'upload.unknownError': "Unknown error";
|
|
132
|
+
readonly 'upload.skippedOne': "Skipped duplicate file: {name}";
|
|
133
|
+
readonly 'upload.skippedMany': "{count, plural, one {Skipped # duplicate file} other {Skipped # duplicate files}}";
|
|
134
|
+
readonly 'upload.time.calculating': "calculating...";
|
|
135
|
+
readonly 'upload.time.lessThanSecond': "less than a second";
|
|
136
|
+
readonly 'upload.time.seconds': "{count, plural, one {# second} other {# seconds}}";
|
|
137
|
+
readonly 'upload.time.minutes': "{count, plural, one {# minute} other {# minutes}}";
|
|
138
|
+
/** {time} is a time from "upload.time.*" ("5 seconds"). */
|
|
139
|
+
readonly 'upload.timeLeft': "{time} left";
|
|
140
|
+
readonly 'upload.complete': "Upload complete.";
|
|
141
|
+
readonly 'upload.removeFile': "Remove file";
|
|
142
|
+
readonly 'upload.uploadingProgress': "{total, plural, other {Uploading {done}/# files}}";
|
|
143
|
+
readonly 'upload.filesTotal': "{count, plural, one {# file} other {# files}}";
|
|
144
|
+
readonly 'upload.completeCount': "{done}/{total} complete";
|
|
145
|
+
readonly 'dialog.delete.folderTitle': "Delete folder";
|
|
146
|
+
readonly 'dialog.delete.itemsTitle': "Delete items";
|
|
147
|
+
readonly 'dialog.delete.fileTitle': "Delete file";
|
|
148
|
+
readonly 'dialog.delete.folderMessage': "Delete '{name}' and all content inside?";
|
|
149
|
+
readonly 'dialog.delete.itemsMessage': "{count, plural, one {Are you sure you want to delete # item?} other {Are you sure you want to delete # items?}}";
|
|
150
|
+
readonly 'dialog.delete.fileMessage': "Delete '{name}'?";
|
|
151
|
+
readonly 'dialog.newFolder.placeholder': "folder name...";
|
|
152
|
+
readonly 'dialog.newFolder.invalidTitle': "Invalid folder name";
|
|
153
|
+
readonly 'dialog.newFolder.required': "Folder name is required";
|
|
154
|
+
readonly 'dialog.newFolder.invalidCharacters': "Folder name can only contain letters, numbers, and spaces";
|
|
155
|
+
/** {max} is put in by the dialog: it knows its own limit. */
|
|
156
|
+
readonly 'dialog.newFolder.tooLong': "Folder name cannot exceed {max} characters";
|
|
157
|
+
/** The hint in the empty name field of the rename window, for a file and for a folder. */
|
|
158
|
+
readonly 'dialog.rename.filePlaceholder': "file name...";
|
|
159
|
+
readonly 'dialog.rename.folderPlaceholder': "folder name...";
|
|
160
|
+
readonly 'dialog.rename.invalidTitle': "Invalid name";
|
|
161
|
+
readonly 'dialog.rename.enterName': "Please enter a name";
|
|
162
|
+
readonly 'dialog.rename.enterDifferentName': "Please enter a different name";
|
|
163
|
+
readonly 'dialog.rename.enterValidName': "Please enter a valid name";
|
|
164
|
+
readonly 'dialog.rename.tooShort': "Name must be at least 1 character long";
|
|
165
|
+
/** {max} is put in by the dialog: it knows its own limit. */
|
|
166
|
+
readonly 'dialog.rename.tooLong': "Name must be {max} characters or less";
|
|
167
|
+
/** What a screen reader says for the X that closes a window. */
|
|
168
|
+
readonly 'dialog.close': "Close modal";
|
|
169
|
+
readonly 'toast.rename.started': "Renaming \"{name}\"...";
|
|
170
|
+
readonly 'toast.rename.done': "Item renamed";
|
|
171
|
+
readonly 'toast.rename.doneDetail': "Successfully renamed \"{oldName}\" to \"{newName}\"";
|
|
172
|
+
readonly 'toast.rename.failed': "Rename failed";
|
|
173
|
+
readonly 'toast.rename.noChange': "No changes were made";
|
|
174
|
+
readonly 'toast.rename.noItem': "No valid item selected";
|
|
175
|
+
readonly 'toast.rename.unknownError': "An unknown error occurred";
|
|
176
|
+
readonly 'toast.delete.started': "{count, plural, one {Deleting \"{name}\"...} other {Deleting # items...}}";
|
|
177
|
+
readonly 'toast.delete.doneFolder': "Deleted folder \"{name}\"";
|
|
178
|
+
readonly 'toast.delete.doneFile': "Deleted \"{name}\"";
|
|
179
|
+
readonly 'toast.delete.doneMany': "{count, plural, one {Deleted # item} other {Deleted # items}}";
|
|
180
|
+
readonly 'toast.delete.doneFolderDetail': "Folder and its contents were deleted successfully";
|
|
181
|
+
readonly 'toast.delete.doneFileDetail': "Item was deleted successfully";
|
|
182
|
+
readonly 'toast.delete.doneManyDetail': "{count, plural, one {# item was deleted successfully} other {# items were deleted successfully}}";
|
|
183
|
+
readonly 'toast.delete.doneNames': "Deleted: {names}";
|
|
184
|
+
readonly 'toast.delete.failedOne': "Failed to delete \"{name}\"";
|
|
185
|
+
readonly 'toast.delete.failedMany': "{count, plural, one {Failed to delete # item} other {Failed to delete # items}}";
|
|
186
|
+
readonly 'toast.delete.failedNames': "Failed to delete: {names}";
|
|
187
|
+
readonly 'toast.delete.failedSome': "Some items could not be deleted";
|
|
188
|
+
readonly 'toast.delete.failedAll': "Failed to delete items";
|
|
189
|
+
readonly 'toast.folder.created': "Folder created";
|
|
190
|
+
readonly 'toast.folder.createdDetail': "Created folder \"{name}\"";
|
|
191
|
+
readonly 'toast.folder.failed': "Failed to create folder";
|
|
192
|
+
readonly 'toast.navigation.failed': "Navigation failed";
|
|
193
|
+
readonly 'toast.navigation.noFolder': "Could not find the target folder location";
|
|
194
|
+
readonly 'toast.navigation.error': "An error occurred while navigating to the target folder";
|
|
195
|
+
readonly 'toast.filesAdded': "Files added";
|
|
196
|
+
readonly 'toast.filesAddedDetail': "{count, plural, one {Added # file to the editor} other {Added # files to the editor}}";
|
|
197
|
+
readonly 'folder.currentLocation': "current location";
|
|
198
|
+
readonly 'folder.open': "Open folder {name}";
|
|
199
|
+
readonly 'folder.empty': "Empty";
|
|
200
|
+
readonly 'folder.itemCount': "{count, plural, one {# item} other {# items}}";
|
|
201
|
+
readonly 'item.previewLabel': "Preview {name}";
|
|
202
|
+
readonly 'item.audioFile': "Audio file";
|
|
203
|
+
readonly 'item.documentFile': "Document file";
|
|
204
|
+
readonly 'item.deleteMissing': "Delete missing file";
|
|
205
|
+
readonly 'item.folder': "Folder";
|
|
206
|
+
readonly 'recent.title': "Recent Files";
|
|
207
|
+
readonly 'recent.empty': "No recent files available!";
|
|
208
|
+
readonly 'newFolder.alt': "New Folder";
|
|
209
|
+
readonly 'newFolder.label': "New folder";
|
|
210
|
+
readonly 'search.noResults': "No results found";
|
|
211
|
+
readonly 'menu.open': "Open menu";
|
|
212
|
+
readonly 'menu.moreOptions': "More options";
|
|
213
|
+
readonly 'toolbar.more': "+{count} more";
|
|
214
|
+
readonly 'toolbar.moveMany': "{count, plural, one {Move # file} other {Move # files}}";
|
|
215
|
+
readonly 'toolbar.deleteMany': "{count, plural, one {Delete # file} other {Delete # files}}";
|
|
216
|
+
readonly 'selectedFiles.title': "Selected files";
|
|
217
|
+
readonly 'selectedFiles.empty': "No files selected";
|
|
218
|
+
readonly 'selectedFiles.count': "{count, plural, one {# file selected} other {# files selected}}";
|
|
219
|
+
readonly 'selectedFiles.confirmMany': "{count, plural, one {Use # file} other {Use # files}}";
|
|
220
|
+
readonly 'searchModal.placeholder': "Search files and folders...";
|
|
221
|
+
readonly 'searchModal.jumpToFolder': "Jump to folder";
|
|
222
|
+
readonly 'searchModal.empty': "No files found";
|
|
223
|
+
/** {name} is the file or folder, cut at 30 characters. */
|
|
224
|
+
readonly 'moveDialog.titleOne': "Move \"{name}\"";
|
|
225
|
+
readonly 'moveDialog.titleMany': "{count, plural, one {Move # item} other {Move # items}}";
|
|
226
|
+
/** The name of the top of the library in the folder list of the move window. */
|
|
227
|
+
readonly 'moveDialog.rootName': "File browser";
|
|
228
|
+
readonly 'moveDialog.movingTo': "Moving to {name}";
|
|
229
|
+
readonly 'moveDialog.confirmFolder': "Move folder";
|
|
230
|
+
readonly 'moveDialog.confirmItem': "Move to folder";
|
|
231
|
+
readonly 'moveDialog.confirmMany': "{count, plural, one {Move # item} other {Move # items}}";
|
|
232
|
+
readonly 'moveDialog.failedFolder': "Failed to move folder";
|
|
233
|
+
readonly 'moveDialog.failedItems': "Failed to move items";
|
|
234
|
+
readonly 'moveDialog.noTarget': "No target folder selected";
|
|
235
|
+
readonly 'moveDialog.noItems': "No items selected to move";
|
|
236
|
+
readonly 'moveDialog.pickDestination': "Please select a destination folder";
|
|
237
|
+
readonly 'moveDialog.noneMoved': "No items were moved successfully";
|
|
238
|
+
readonly 'moveDialog.partialTitle': "Some items moved";
|
|
239
|
+
/** {moved} of {total}. */
|
|
240
|
+
readonly 'moveDialog.partialDetail': "{total, plural, other {Moved {moved} out of # items}}";
|
|
241
|
+
readonly 'moveDialog.doneFolder': "Folder moved";
|
|
242
|
+
readonly 'moveDialog.doneOne': "Item moved";
|
|
243
|
+
readonly 'moveDialog.doneMany': "Items moved";
|
|
244
|
+
readonly 'moveDialog.doneFolderDetail': "Moved folder \"{name}\" successfully";
|
|
245
|
+
readonly 'moveDialog.doneItemsDetail': "{count, plural, one {Moved # item successfully} other {Moved # items successfully}}";
|
|
246
|
+
readonly 'preview.audioFailed': "Audio failed to load";
|
|
247
|
+
readonly 'preview.audioUnsupported': "Your browser does not support the audio element.";
|
|
248
|
+
readonly 'preview.videoFailed': "Video failed to load";
|
|
249
|
+
readonly 'preview.videoUnsupported': "Your browser does not support the video tag.";
|
|
250
|
+
readonly 'preview.errorAlt': "Error";
|
|
251
|
+
readonly 'preview.fileNotFound': "File not found";
|
|
252
|
+
readonly 'preview.loading': "Loading...";
|
|
253
|
+
readonly 'preview.textFailed': "Failed to load text file";
|
|
254
|
+
/** {reason} is what the server said ("Not Found"). */
|
|
255
|
+
readonly 'preview.textFailedReason': "Failed to load text file: {reason}";
|
|
256
|
+
readonly 'preview.unavailable': "Preview not available for this file type.";
|
|
257
|
+
readonly 'preview.pdfLoading': "Loading PDF...";
|
|
258
|
+
readonly 'preview.pdfFailed': "Failed to load PDF";
|
|
259
|
+
/** {page} and {total} are put in by the PDF viewer ({total} is "?" until the number of pages is known). */
|
|
260
|
+
readonly 'preview.pdfPage': "Page {page} of {total}";
|
|
261
|
+
readonly 'preview.pdfPreviousPage': "Previous page";
|
|
262
|
+
readonly 'preview.pdfNextPage': "Next page";
|
|
263
|
+
/** The sentence a font is shown in. Use a sentence that shows the letters of your language. */
|
|
264
|
+
readonly 'fontPreview.sample': "The quick brown fox jumps over the lazy dog";
|
|
265
|
+
readonly 'fontPreview.sampleShort': "The quick fox";
|
|
266
|
+
readonly 'metadata.title': "File Information";
|
|
267
|
+
readonly 'metadata.name': "Name:";
|
|
268
|
+
readonly 'metadata.type': "Type:";
|
|
269
|
+
readonly 'metadata.size': "Size:";
|
|
270
|
+
readonly 'metadata.modified': "Last Modified:";
|
|
271
|
+
readonly 'metadata.notAvailable': "N/A";
|
|
272
|
+
readonly 'date.fewSecondsAgo': "A few seconds ago";
|
|
273
|
+
readonly 'date.hoursAgo': "{count, plural, one {# hour ago} other {# hours ago}}";
|
|
274
|
+
readonly 'date.daysAgo': "{count, plural, one {# day ago} other {# days ago}}";
|
|
275
|
+
readonly 'date.weeksAgo': "{count, plural, one {# week ago} other {# weeks ago}}";
|
|
276
|
+
readonly 'date.aboutAMonthAgo': "About a month ago";
|
|
277
|
+
readonly 'date.severalMonthsAgo': "Several months ago";
|
|
278
|
+
readonly 'date.overAYearAgo': "Over a year ago";
|
|
279
|
+
};
|
|
280
|
+
/** The name of one message. */
|
|
281
|
+
export type FileBrowserMessageKey = keyof typeof FILE_BROWSER_MESSAGES;
|