filecove 0.0.0-stage → 0.2.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +65 -2
- package/THIRD_PARTY_NOTICES.md +63 -0
- package/dist/components/buttons/toolbar-actions.d.ts +28 -0
- package/dist/components/buttons/tooltip-icon-button.d.ts +14 -0
- package/dist/components/downloads/download-panel.d.ts +23 -0
- package/dist/components/drag/drag-preview.d.ts +24 -0
- package/dist/components/file-manager/announcer.d.ts +14 -0
- package/dist/components/file-manager/content/file-grid.d.ts +8 -0
- package/dist/components/file-manager/content/file-list.d.ts +9 -0
- package/dist/components/file-manager/content/folder-view.d.ts +83 -0
- package/dist/components/file-manager/content/item-icon.d.ts +16 -0
- package/dist/components/file-manager/content/no-sections.d.ts +11 -0
- package/dist/components/file-manager/content/search-results.d.ts +40 -0
- package/dist/components/file-manager/content/search-tabs.d.ts +29 -0
- package/dist/components/file-manager/content/trash-bar.d.ts +13 -0
- package/dist/components/file-manager/context-menu/context-menu.d.ts +20 -0
- package/dist/components/file-manager/dialogs/conflict-step.d.ts +28 -0
- package/dist/components/file-manager/dialogs/delete-dialog.d.ts +49 -0
- package/dist/components/file-manager/dialogs/image-viewer.d.ts +42 -0
- package/dist/components/file-manager/dialogs/name-dialog.d.ts +41 -0
- package/dist/components/file-manager/dialogs/paste-dialog.d.ts +39 -0
- package/dist/components/file-manager/dialogs/preview-dialog.d.ts +75 -0
- package/dist/components/file-manager/dialogs/restore-dialog.d.ts +41 -0
- package/dist/components/file-manager/dialogs/shortcuts-dialog.d.ts +36 -0
- package/dist/components/file-manager/dialogs/transfer-dialog.d.ts +71 -0
- package/dist/components/file-manager/dialogs/upload-dialog.d.ts +34 -0
- package/dist/components/file-manager/file-manager.d.ts +320 -0
- package/dist/components/file-manager/find-layer.d.ts +29 -0
- package/dist/components/file-manager/header-bar/header-bar.d.ts +65 -0
- package/dist/components/file-manager/header-bar/history-menu.d.ts +18 -0
- package/dist/components/file-manager/header-bar/path-bar.d.ts +19 -0
- package/dist/components/file-manager/header-bar/path-field.d.ts +23 -0
- package/dist/components/file-manager/header-bar/search-field.d.ts +27 -0
- package/dist/components/file-manager/header-bar/search-sections-menu.d.ts +25 -0
- package/dist/components/file-manager/header-bar/view-menu.d.ts +39 -0
- package/dist/components/file-manager/notice-bar.d.ts +36 -0
- package/dist/components/file-manager/properties-pane.d.ts +53 -0
- package/dist/components/file-manager/resize-edge.d.ts +39 -0
- package/dist/components/file-manager/selection-bar.d.ts +15 -0
- package/dist/components/file-manager/sidebar/location-item.d.ts +36 -0
- package/dist/components/file-manager/sidebar/main-menu.d.ts +23 -0
- package/dist/components/file-manager/sidebar/sidebar.d.ts +80 -0
- package/dist/components/icons/check-badge.d.ts +3 -0
- package/dist/components/icons/create-icon.d.ts +20 -0
- package/dist/components/icons/file-icon.d.ts +19 -0
- package/dist/components/icons/icon-provider.d.ts +21 -0
- package/dist/components/icons/icon-slot.d.ts +6 -0
- package/dist/components/icons/icon.d.ts +19 -0
- package/dist/components/icons/locked-icon.d.ts +9 -0
- package/dist/components/media-manager/asset-delete.d.ts +29 -0
- package/dist/components/media-manager/asset-hold.d.ts +32 -0
- package/dist/components/media-manager/asset-option.d.ts +74 -0
- package/dist/components/media-manager/asset-trail.d.ts +13 -0
- package/dist/components/media-manager/choice-list.d.ts +29 -0
- package/dist/components/media-manager/choices-pane.d.ts +50 -0
- package/dist/components/media-manager/choose-bar.d.ts +26 -0
- package/dist/components/media-manager/drop-zone.d.ts +7 -0
- package/dist/components/media-manager/group-check.d.ts +13 -0
- package/dist/components/media-manager/group-create.d.ts +20 -0
- package/dist/components/media-manager/group-path.d.ts +24 -0
- package/dist/components/media-manager/library-list.d.ts +23 -0
- package/dist/components/media-manager/media-asset.d.ts +65 -0
- package/dist/components/media-manager/media-edit-many.d.ts +33 -0
- package/dist/components/media-manager/media-fields.d.ts +31 -0
- package/dist/components/media-manager/media-filter-chips.d.ts +17 -0
- package/dist/components/media-manager/media-filters-dialog.d.ts +39 -0
- package/dist/components/media-manager/media-filters.d.ts +37 -0
- package/dist/components/media-manager/media-form.d.ts +29 -0
- package/dist/components/media-manager/media-frame.d.ts +77 -0
- package/dist/components/media-manager/media-grid.d.ts +114 -0
- package/dist/components/media-manager/media-group.d.ts +29 -0
- package/dist/components/media-manager/media-header.d.ts +80 -0
- package/dist/components/media-manager/media-manager.d.ts +309 -0
- package/dist/components/media-manager/media-move.d.ts +30 -0
- package/dist/components/media-manager/media-picker.d.ts +140 -0
- package/dist/components/media-manager/media-picture.d.ts +26 -0
- package/dist/components/media-manager/media-process.d.ts +26 -0
- package/dist/components/media-manager/media-row.d.ts +13 -0
- package/dist/components/media-manager/media-step.d.ts +33 -0
- package/dist/components/media-manager/media-tile.d.ts +15 -0
- package/dist/components/media-manager/media-upload.d.ts +46 -0
- package/dist/components/media-manager/open-button.d.ts +15 -0
- package/dist/components/media-manager/picker-frame.d.ts +33 -0
- package/dist/components/media-manager/selection-bar.d.ts +25 -0
- package/dist/components/media-manager/upload-tile.d.ts +17 -0
- package/dist/components/properties/properties-panel.d.ts +53 -0
- package/dist/components/properties/property-display.d.ts +15 -0
- package/dist/components/properties/property-editor.d.ts +26 -0
- package/dist/components/properties/property-input.d.ts +36 -0
- package/dist/components/transfers/transfer-panel.d.ts +25 -0
- package/dist/components/ui/backdrop.d.ts +7 -0
- package/dist/components/ui/button-base.d.ts +7 -0
- package/dist/components/ui/button.d.ts +18 -0
- package/dist/components/ui/checkbox.d.ts +24 -0
- package/dist/components/ui/chip.d.ts +18 -0
- package/dist/components/ui/circular-progress.d.ts +14 -0
- package/dist/components/ui/collapse.d.ts +9 -0
- package/dist/components/ui/dialog.d.ts +40 -0
- package/dist/components/ui/divider.d.ts +4 -0
- package/dist/components/ui/icon-button.d.ts +12 -0
- package/dist/components/ui/linear-progress.d.ts +13 -0
- package/dist/components/ui/link.d.ts +4 -0
- package/dist/components/ui/menu.d.ts +77 -0
- package/dist/components/ui/root-providers.d.ts +16 -0
- package/dist/components/ui/text-field.d.ts +38 -0
- package/dist/components/ui/text.d.ts +21 -0
- package/dist/components/ui/tooltip.d.ts +24 -0
- package/dist/components/uploads/upload-panel.d.ts +31 -0
- package/dist/contexts/asset-look-context.d.ts +1 -0
- package/dist/contexts/cut-context.d.ts +6 -0
- package/dist/contexts/data-context.d.ts +12 -0
- package/dist/contexts/direction-context.d.ts +2 -0
- package/dist/contexts/drag-context.d.ts +36 -0
- package/dist/contexts/icon-context.d.ts +10 -0
- package/dist/contexts/locale-context.d.ts +2 -0
- package/dist/contexts/moving-context.d.ts +7 -0
- package/dist/create-icon-D2vnnBQX.js +40 -0
- package/dist/create-icon-D2vnnBQX.js.map +1 -0
- package/dist/hooks/use-announcer.d.ts +20 -0
- package/dist/hooks/use-asset-look.d.ts +6 -0
- package/dist/hooks/use-asset-states.d.ts +12 -0
- package/dist/hooks/use-chosen-column.d.ts +16 -0
- package/dist/hooks/use-clipboard-follow.d.ts +12 -0
- package/dist/hooks/use-controlled.d.ts +18 -0
- package/dist/hooks/use-cut-ids.d.ts +3 -0
- package/dist/hooks/use-dev-checks.d.ts +16 -0
- package/dist/hooks/use-download-queue.d.ts +19 -0
- package/dist/hooks/use-dragged-ids.d.ts +3 -0
- package/dist/hooks/use-drop-target.d.ts +48 -0
- package/dist/hooks/use-entry-drag.d.ts +46 -0
- package/dist/hooks/use-files-drop.d.ts +20 -0
- package/dist/hooks/use-folder.d.ts +14 -0
- package/dist/hooks/use-fork-ref.d.ts +6 -0
- package/dist/hooks/use-form-send.d.ts +12 -0
- package/dist/hooks/use-found.d.ts +10 -0
- package/dist/hooks/use-icon-config.d.ts +2 -0
- package/dist/hooks/use-level-filters.d.ts +112 -0
- package/dist/hooks/use-level-search.d.ts +21 -0
- package/dist/hooks/use-locale.d.ts +10 -0
- package/dist/hooks/use-location-history.d.ts +42 -0
- package/dist/hooks/use-long-press.d.ts +25 -0
- package/dist/hooks/use-marquee.d.ts +35 -0
- package/dist/hooks/use-match-count.d.ts +8 -0
- package/dist/hooks/use-media-search.d.ts +44 -0
- package/dist/hooks/use-moving-ids.d.ts +3 -0
- package/dist/hooks/use-picks.d.ts +39 -0
- package/dist/hooks/use-preview-contents.d.ts +33 -0
- package/dist/hooks/use-properties.d.ts +25 -0
- package/dist/hooks/use-scroll-measure.d.ts +34 -0
- package/dist/hooks/use-search.d.ts +12 -0
- package/dist/hooks/use-selection.d.ts +29 -0
- package/dist/hooks/use-setting.d.ts +21 -0
- package/dist/hooks/use-stable-set.d.ts +6 -0
- package/dist/hooks/use-swipe.d.ts +41 -0
- package/dist/hooks/use-text-direction.d.ts +8 -0
- package/dist/hooks/use-thumbnail.d.ts +8 -0
- package/dist/hooks/use-transfer-queue.d.ts +22 -0
- package/dist/hooks/use-tree-rows.d.ts +9 -0
- package/dist/hooks/use-tree-selection.d.ts +19 -0
- package/dist/hooks/use-type-ahead.d.ts +9 -0
- package/dist/hooks/use-type-icons.d.ts +10 -0
- package/dist/hooks/use-upload-queue.d.ts +24 -0
- package/dist/hooks/use-virtual-lines.d.ts +27 -0
- package/dist/hooks/use-virtual-rows.d.ts +31 -0
- package/dist/hooks/use-wheel-zoom.d.ts +10 -0
- package/dist/icon-sets/filled.d.ts +6 -0
- package/dist/icon-sets/filled.js +76 -0
- package/dist/icon-sets/filled.js.map +1 -0
- package/dist/icon-sets/outlined.d.ts +6 -0
- package/dist/icon-sets/outlined.js +73 -0
- package/dist/icon-sets/outlined.js.map +1 -0
- package/dist/icon-sets/rounded.d.ts +6 -0
- package/dist/icon-sets/rounded.js +73 -0
- package/dist/icon-sets/rounded.js.map +1 -0
- package/dist/icon-sets/sharp.d.ts +6 -0
- package/dist/icon-sets/sharp.js +73 -0
- package/dist/icon-sets/sharp.js.map +1 -0
- package/dist/icon-sets/two-tone.d.ts +6 -0
- package/dist/icon-sets/two-tone.js +188 -0
- package/dist/icon-sets/two-tone.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +32651 -0
- package/dist/index.js.map +1 -0
- package/dist/locales/en-us.d.ts +7 -0
- package/dist/store/download-queue.d.ts +37 -0
- package/dist/store/folder-store.d.ts +79 -0
- package/dist/store/keyboard-layout.d.ts +11 -0
- package/dist/store/properties-cache.d.ts +73 -0
- package/dist/store/thumbnail-cache.d.ts +30 -0
- package/dist/store/transfer-across.d.ts +24 -0
- package/dist/store/transfer-queue.d.ts +59 -0
- package/dist/store/upload-queue.d.ts +83 -0
- package/dist/styles/arrived.d.ts +6 -0
- package/dist/styles/classes.d.ts +212 -0
- package/dist/styles/layout.d.ts +55 -0
- package/dist/styles/media-layout.d.ts +36 -0
- package/dist/styles/order.d.ts +1 -0
- package/dist/styles.css +7632 -0
- package/dist/styles.layer.css +7634 -0
- package/dist/types/action.d.ts +296 -0
- package/dist/types/adapter.d.ts +922 -0
- package/dist/types/api.d.ts +192 -0
- package/dist/types/clipboard.d.ts +45 -0
- package/dist/types/download.d.ts +41 -0
- package/dist/types/drag.d.ts +57 -0
- package/dist/types/folder.d.ts +47 -0
- package/dist/types/icon.d.ts +20 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/limits.d.ts +49 -0
- package/dist/types/locale.d.ts +1132 -0
- package/dist/types/main-menu.d.ts +20 -0
- package/dist/types/media.d.ts +631 -0
- package/dist/types/menu.d.ts +82 -0
- package/dist/types/navigation.d.ts +88 -0
- package/dist/types/preview.d.ts +54 -0
- package/dist/types/previewer.d.ts +67 -0
- package/dist/types/properties.d.ts +111 -0
- package/dist/types/property-definition.d.ts +286 -0
- package/dist/types/search.d.ts +46 -0
- package/dist/types/section.d.ts +98 -0
- package/dist/types/selection.d.ts +52 -0
- package/dist/types/slots.d.ts +218 -0
- package/dist/types/transfer.d.ts +68 -0
- package/dist/types/tree.d.ts +97 -0
- package/dist/types/undo.d.ts +133 -0
- package/dist/types/upload.d.ts +189 -0
- package/dist/types/view.d.ts +192 -0
- package/dist/utils/action-groups.d.ts +17 -0
- package/dist/utils/bidi.d.ts +15 -0
- package/dist/utils/clipboard.d.ts +30 -0
- package/dist/utils/cx.d.ts +2 -0
- package/dist/utils/dom.d.ts +36 -0
- package/dist/utils/download.d.ts +30 -0
- package/dist/utils/field-errors.d.ts +26 -0
- package/dist/utils/files.d.ts +48 -0
- package/dist/utils/format.d.ts +10 -0
- package/dist/utils/groups.d.ts +29 -0
- package/dist/utils/hidden.d.ts +3 -0
- package/dist/utils/keyboard.d.ts +21 -0
- package/dist/utils/limits.d.ts +7 -0
- package/dist/utils/media.d.ts +146 -0
- package/dist/utils/menu-position.d.ts +13 -0
- package/dist/utils/names.d.ts +21 -0
- package/dist/utils/navigation.d.ts +28 -0
- package/dist/utils/path.d.ts +33 -0
- package/dist/utils/permissions.d.ts +56 -0
- package/dist/utils/preview.d.ts +27 -0
- package/dist/utils/property-value.d.ts +41 -0
- package/dist/utils/resize.d.ts +2 -0
- package/dist/utils/search.d.ts +24 -0
- package/dist/utils/sections.d.ts +11 -0
- package/dist/utils/selection.d.ts +30 -0
- package/dist/utils/sets.d.ts +2 -0
- package/dist/utils/shortcut.d.ts +74 -0
- package/dist/utils/slots.d.ts +15 -0
- package/dist/utils/sort.d.ts +47 -0
- package/dist/utils/transfer.d.ts +48 -0
- package/dist/utils/trash.d.ts +25 -0
- package/dist/utils/undo.d.ts +63 -0
- package/dist/utils/zoom.d.ts +14 -0
- package/docs/README.md +55 -0
- package/docs/actions.md +301 -0
- package/docs/adapter.md +229 -0
- package/docs/copy-move-trash-undo.md +97 -0
- package/docs/customizing.md +247 -0
- package/docs/getting-started.md +168 -0
- package/docs/locale-and-rtl.md +58 -0
- package/docs/media-manager.md +498 -0
- package/docs/previewing.md +124 -0
- package/docs/properties.md +125 -0
- package/docs/recipes/in-memory-adapter.md +149 -0
- package/docs/recipes/rest-adapter.md +225 -0
- package/docs/recipes/s3-adapter.md +137 -0
- package/docs/search.md +73 -0
- package/docs/sections.md +119 -0
- package/docs/state-and-api.md +190 -0
- package/docs/uploads-and-downloads.md +144 -0
- package/package.json +90 -4
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EntryGroup, FileAdapter } from "../../../types/index.js";
|
|
2
|
+
/** Entries of one folder to delete, with the adapter serving its section. */
|
|
3
|
+
export interface DeleteGroup extends EntryGroup {
|
|
4
|
+
/** The section's adapter, already known to support deleting. */
|
|
5
|
+
adapter: FileAdapter;
|
|
6
|
+
}
|
|
7
|
+
export interface DeleteRequest {
|
|
8
|
+
/** The entries by the folder they're in: one, or several for a search's results, of one section or more. */
|
|
9
|
+
groups: DeleteGroup[];
|
|
10
|
+
/** Set when they're the copies a copy made, which undoing it deletes, as the dialog then says. */
|
|
11
|
+
undoesCopy?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Set to empty the trash, its root being the one group's folder: what it lists is read afresh
|
|
14
|
+
* as the user confirms, and deleted, whatever `entries` held when the dialog opened.
|
|
15
|
+
*/
|
|
16
|
+
emptiesTrash?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface DeleteDialogState {
|
|
19
|
+
/** False while the dialog plays its closing transition; the rest is kept so it doesn't empty mid-fade. */
|
|
20
|
+
open: boolean;
|
|
21
|
+
/** Counts requests, so each one starts afresh. */
|
|
22
|
+
id: number;
|
|
23
|
+
request: DeleteRequest;
|
|
24
|
+
}
|
|
25
|
+
interface DeleteDialogProps {
|
|
26
|
+
open: boolean;
|
|
27
|
+
request: DeleteRequest;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Called whenever the adapter may have changed folders, done, failed or cancelled, with their
|
|
31
|
+
* ids, to list them again wherever they're shown.
|
|
32
|
+
*/
|
|
33
|
+
onChanged: (adapter: FileAdapter, folderIds: string[]) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Called once the adapter has deleted the entries, or as the dialog closes when it had deleted
|
|
36
|
+
* some folders' before failing, with only those.
|
|
37
|
+
*/
|
|
38
|
+
onDone: (request: DeleteRequest) => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Asks to confirm deleting entries, then has the adapter delete them, a folder's at a time, as it
|
|
42
|
+
* takes entries sharing a folder, each through its own section's adapter. Deleting can't be undone,
|
|
43
|
+
* so nothing is deleted without asking, not even the copies undoing a copy deletes, nor what's in
|
|
44
|
+
* the trash as it's emptied. Anything the adapter rejects with is shown in the dialog, which stays
|
|
45
|
+
* open to try again, with only the entries not yet deleted: the folders' not reached, and of the one it
|
|
46
|
+
* stopped at, those the adapter didn't report gone (`DeleteOptions.onEntryDone`).
|
|
47
|
+
*/
|
|
48
|
+
declare const DeleteDialog: ({ open, request, onClose, onChanged, onDone }: DeleteDialogProps) => import("react").JSX.Element;
|
|
49
|
+
export default DeleteDialog;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { KeyboardEvent, Ref } from "react";
|
|
2
|
+
import type { Room } from "../../../hooks/use-swipe.js";
|
|
3
|
+
/** What the preview hands the image it shows. */
|
|
4
|
+
export interface ImageViewerHandle {
|
|
5
|
+
/** Takes a key pressed anywhere in the preview, and says whether it did anything with it. */
|
|
6
|
+
keyDown: (event: KeyboardEvent) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* How far the zoomed image pans with a finger moving left and right before a swipe takes over
|
|
9
|
+
* the rest of the way, to step to another file; null while it fits the view.
|
|
10
|
+
*/
|
|
11
|
+
room: () => Room | null;
|
|
12
|
+
}
|
|
13
|
+
interface ImageViewerProps {
|
|
14
|
+
ref?: Ref<ImageViewerHandle>;
|
|
15
|
+
src: string;
|
|
16
|
+
alt: string;
|
|
17
|
+
/** A small picture of it, the grid's thumbnail, shown in its place until it has loaded. */
|
|
18
|
+
placeholder?: string | null;
|
|
19
|
+
/** Its own size, when the listing says (`FileEntry.media`), so the placeholder takes its place exactly. */
|
|
20
|
+
expected?: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
/** Called with the image's own size once it has loaded. */
|
|
25
|
+
onLoad: (width: number, height: number) => void;
|
|
26
|
+
onError: () => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An image in the preview, which zooms, pans and turns: Ctrl+wheel or a touchpad pinch zooms at the
|
|
30
|
+
* pointer (Safari's gesture events too), a pinch on a touch screen between the fingers, and a double
|
|
31
|
+
* click or double tap toggles between fitting the view and a closer look. Zoomed in, it pans by
|
|
32
|
+
* dragging, gliding on after a flick on touch, with the wheel and with the arrow keys. The buttons in
|
|
33
|
+
* the corner zoom around the view's centre, as do +, -, 0 (fit) and 1 (the image's own size), and
|
|
34
|
+
* turn it a quarter, as do R and Shift+R, which the preview hands over through `ref`. Steps by a
|
|
35
|
+
* button or a key are animated, unless motion is reduced. Fitted, a swipe is left to the preview, to
|
|
36
|
+
* step to another file; zoomed, it takes over once the image has panned to its edge.
|
|
37
|
+
*
|
|
38
|
+
* Unzoomed and unturned, the image is laid out to fit by CSS alone, so it follows the view's size
|
|
39
|
+
* without waiting on a measure; otherwise it's placed from its own size and the view's.
|
|
40
|
+
*/
|
|
41
|
+
declare const ImageViewer: ({ ref, src, alt, placeholder, expected, onLoad, onError }: ImageViewerProps) => import("react").JSX.Element;
|
|
42
|
+
export default ImageViewer;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FileAdapter, FileEntry, FolderRef, Section } from "../../../types/index.js";
|
|
2
|
+
interface RequestBase {
|
|
3
|
+
section: Section;
|
|
4
|
+
/** The section's adapter, already known to support the request. */
|
|
5
|
+
adapter: FileAdapter;
|
|
6
|
+
/** Trail to the folder the entry is created or renamed in. */
|
|
7
|
+
trail: FolderRef[];
|
|
8
|
+
}
|
|
9
|
+
/** What the dialog asks a name for: a new folder, or an existing entry. */
|
|
10
|
+
export type NameRequest = (RequestBase & {
|
|
11
|
+
kind: "create";
|
|
12
|
+
}) | (RequestBase & {
|
|
13
|
+
kind: "rename";
|
|
14
|
+
entry: FileEntry;
|
|
15
|
+
});
|
|
16
|
+
export interface NameDialogState {
|
|
17
|
+
/** False while the dialog plays its closing transition; the rest is kept so it doesn't empty mid-fade. */
|
|
18
|
+
open: boolean;
|
|
19
|
+
/** Counts requests, so each one starts with a fresh form. */
|
|
20
|
+
id: number;
|
|
21
|
+
request: NameRequest;
|
|
22
|
+
}
|
|
23
|
+
interface NameDialogProps {
|
|
24
|
+
open: boolean;
|
|
25
|
+
request: NameRequest;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Called whenever the adapter may have changed folders, done, failed or cancelled, with their
|
|
29
|
+
* ids, to list them again wherever they're shown.
|
|
30
|
+
*/
|
|
31
|
+
onChanged: (adapter: FileAdapter, folderIds: string[]) => void;
|
|
32
|
+
/** Called with the entry as the adapter returned it, once created or renamed. */
|
|
33
|
+
onDone: (request: NameRequest, entry: FileEntry) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Asks for the name of a new folder, or a new name for an entry, then has the adapter make the
|
|
37
|
+
* change. Names are checked as they are typed against the folder's cached listing, and anything
|
|
38
|
+
* the adapter rejects is shown under the field, with the name kept.
|
|
39
|
+
*/
|
|
40
|
+
declare const NameDialog: ({ open, request, onClose, onChanged, onDone }: NameDialogProps) => import("react").JSX.Element;
|
|
41
|
+
export default NameDialog;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Clipboard, ConflictPolicy, FileEntry, FolderRef, Section } from "../../../types/index.js";
|
|
2
|
+
export interface PasteRequest {
|
|
3
|
+
/** What is pasted, as it was when the paste began: the clipboard, or entries dropped onto a folder. */
|
|
4
|
+
clipboard: Clipboard;
|
|
5
|
+
/** The section of the folder pasted into. */
|
|
6
|
+
section: Section;
|
|
7
|
+
/** Trail to the folder pasted into. */
|
|
8
|
+
trail: FolderRef[];
|
|
9
|
+
/** The failed copy or move this tries again, by its id in the transfer queue, which goes as this one starts. */
|
|
10
|
+
retrying?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface PasteDialogState {
|
|
13
|
+
/** False once the paste has started, or while the dialog plays its closing transition. */
|
|
14
|
+
open: boolean;
|
|
15
|
+
/** Counts pastes, so each one starts afresh. */
|
|
16
|
+
id: number;
|
|
17
|
+
request: PasteRequest;
|
|
18
|
+
}
|
|
19
|
+
interface PasteDialogProps {
|
|
20
|
+
open: boolean;
|
|
21
|
+
request: PasteRequest;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Called once there's nothing left to ask, with the choice that settles names the folder
|
|
25
|
+
* already has, the entries to skip, which clash, and after a "replace", the ids of the folders
|
|
26
|
+
* entries are merged into, which may change all the way down. The adapter then moves or copies
|
|
27
|
+
* them in the background.
|
|
28
|
+
*/
|
|
29
|
+
onStart: (request: PasteRequest, conflict: ConflictPolicy, skipped: FileEntry[], mergedIds: string[]) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Pastes what was cut or copied, or dropped onto a folder: once the folder's names are checked, the
|
|
33
|
+
* adapter moves or copies it in the background, shown in the transfer panel. Most pastes need
|
|
34
|
+
* nothing from the user, so the check runs unseen and the dialog only shows to ask about names the
|
|
35
|
+
* folder already has, or that entries from several folders share: replace or merge, keep both, or
|
|
36
|
+
* skip.
|
|
37
|
+
*/
|
|
38
|
+
declare const PasteDialog: ({ open, request, onClose, onStart }: PasteDialogProps) => import("react").JSX.Element;
|
|
39
|
+
export default PasteDialog;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Announcement } from "../../../hooks/use-announcer.js";
|
|
2
|
+
import type { FileAdapter, FileEntry, FilePreviewer, FolderRef, Section, ToolbarGroup } from "../../../types/index.js";
|
|
3
|
+
/** A file the preview steps through, with where it is. */
|
|
4
|
+
export interface PreviewFile {
|
|
5
|
+
entry: FileEntry;
|
|
6
|
+
section: Section;
|
|
7
|
+
/** The section's adapter. */
|
|
8
|
+
adapter: FileAdapter;
|
|
9
|
+
/** Trail to the folder the file is in. */
|
|
10
|
+
trail: FolderRef[];
|
|
11
|
+
}
|
|
12
|
+
export interface PreviewRequest {
|
|
13
|
+
/**
|
|
14
|
+
* The files to step through, in order: those of one folder, or for a search's results, of
|
|
15
|
+
* several, of one section or more.
|
|
16
|
+
*/
|
|
17
|
+
files: PreviewFile[];
|
|
18
|
+
/** Where in `files` to start. */
|
|
19
|
+
index: number;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the content's selection follows the file shown, as it does when a single file steps
|
|
22
|
+
* through its folder.
|
|
23
|
+
*/
|
|
24
|
+
follow: boolean;
|
|
25
|
+
/** The files are results of a search everywhere, whose folder isn't the open one. */
|
|
26
|
+
inResults?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface PreviewDialogState {
|
|
29
|
+
/** False while the dialog plays its closing transition; the rest is kept so it doesn't empty mid-fade. */
|
|
30
|
+
open: boolean;
|
|
31
|
+
/** Counts requests, so each one starts afresh. */
|
|
32
|
+
id: number;
|
|
33
|
+
request: PreviewRequest;
|
|
34
|
+
/** Whether it was opened from the content, which takes the focus back once it has closed. */
|
|
35
|
+
fromContent: boolean;
|
|
36
|
+
/** Whether it closed for something else that takes the focus, such as the properties. */
|
|
37
|
+
handedOff?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface PreviewDialogProps {
|
|
40
|
+
open: boolean;
|
|
41
|
+
request: PreviewRequest;
|
|
42
|
+
/** Leaves the focus to `onClosed` rather than handing it back to what had it. */
|
|
43
|
+
disableRestoreFocus: boolean;
|
|
44
|
+
/** The app's own previewers, tried before the file manager's previews. */
|
|
45
|
+
previewers: readonly FilePreviewer[];
|
|
46
|
+
/** The app's actions for the header (`previewActions`), bound to the file shown. */
|
|
47
|
+
actionsFor: (request: PreviewRequest, file: PreviewFile) => ToolbarGroup[];
|
|
48
|
+
/**
|
|
49
|
+
* What the file manager tells screen readers while the preview is open, said from inside it,
|
|
50
|
+
* since the modal hides the rest of the page from them.
|
|
51
|
+
*/
|
|
52
|
+
announcement: Announcement | null;
|
|
53
|
+
onClose: () => void;
|
|
54
|
+
/** Called once the dialog has faded out. */
|
|
55
|
+
onClosed: () => void;
|
|
56
|
+
/** Called as the dialog steps to another file, or shows another as the one shown goes. */
|
|
57
|
+
onStep: (request: PreviewRequest, file: PreviewFile) => void;
|
|
58
|
+
/** Called to save the file shown, from the header's Download button. */
|
|
59
|
+
onDownload: (file: PreviewFile) => void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Shows files one at a time, as GNOME's and macOS's previewers do: images, videos, audio and PDFs
|
|
63
|
+
* as the browser shows them, the start of text files, a font's specimen, the app's own previewers
|
|
64
|
+
* for the kinds they take, and an icon or the thumbnail with the file's details for the rest. The
|
|
65
|
+
* arrows, Home and End, the buttons, or a swipe on touch step through the files it was given, F
|
|
66
|
+
* fills the screen with it, and Space or Escape closes it. The header has the app's actions for the
|
|
67
|
+
* file shown, Download and Full screen.
|
|
68
|
+
*
|
|
69
|
+
* The adapter's `content` says where each file's contents are. A URL is used as it is; a `Blob` is
|
|
70
|
+
* shown through an object URL. The next file loads once the one shown has, so stepping on shows
|
|
71
|
+
* it at once (see `usePreviewContents`). The files follow their folder's listing, so one renamed or
|
|
72
|
+
* deleted meanwhile shows as it is, or makes way for the next.
|
|
73
|
+
*/
|
|
74
|
+
declare const PreviewDialog: ({ open, request, disableRestoreFocus, previewers, actionsFor, announcement, onClose, onClosed, onStep, onDownload, }: PreviewDialogProps) => import("react").JSX.Element;
|
|
75
|
+
export default PreviewDialog;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ConflictPolicy, FileAdapter, FileEntry, Section, UndoFolder } from "../../../types/index.js";
|
|
2
|
+
export interface RestoreRequest {
|
|
3
|
+
/** The trash the entries are in, right in its root. */
|
|
4
|
+
section: Section;
|
|
5
|
+
/** The trash's adapter, already known to restore. */
|
|
6
|
+
adapter: FileAdapter;
|
|
7
|
+
/** The entries, each with its `trashed`. */
|
|
8
|
+
entries: FileEntry[];
|
|
9
|
+
/**
|
|
10
|
+
* The folder each of `entries` goes back to, by index, as a folder of a section, or null when
|
|
11
|
+
* no section shows it, whose names can't be checked.
|
|
12
|
+
*/
|
|
13
|
+
origins: (UndoFolder | null)[];
|
|
14
|
+
}
|
|
15
|
+
export interface RestoreDialogState {
|
|
16
|
+
/** False once the restore has started, or while the dialog plays its closing transition. */
|
|
17
|
+
open: boolean;
|
|
18
|
+
/** Counts restores, so each one starts afresh. */
|
|
19
|
+
id: number;
|
|
20
|
+
request: RestoreRequest;
|
|
21
|
+
}
|
|
22
|
+
interface RestoreDialogProps {
|
|
23
|
+
open: boolean;
|
|
24
|
+
request: RestoreRequest;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Called once there's nothing left to ask, with the choice that settles names the folders
|
|
28
|
+
* already have, the entries to skip, which clash, and after a "replace", the ids of the folders
|
|
29
|
+
* entries are merged into, which may change all the way down. The adapter then restores them.
|
|
30
|
+
*/
|
|
31
|
+
onStart: (request: RestoreRequest, conflict: ConflictPolicy, skipped: FileEntry[], mergedIds: string[]) => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Restores entries from the trash to the folders they were moved there from. Once those folders'
|
|
35
|
+
* names are checked, the adapter puts them back. Most restores need nothing from the user, so the
|
|
36
|
+
* check runs unseen and the dialog only shows to ask about names a folder has now, or that entries
|
|
37
|
+
* going back to one folder share, as a paste does: replace or merge, keep both, or skip. A folder no
|
|
38
|
+
* section shows, or that can't be listed, as it's gone, is left to the adapter.
|
|
39
|
+
*/
|
|
40
|
+
declare const RestoreDialog: ({ open, request, onClose, onStart }: RestoreDialogProps) => import("react").JSX.Element;
|
|
41
|
+
export default RestoreDialog;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ActionGroup, MainMenuGroup } from "../../../types/index.js";
|
|
2
|
+
interface ShortcutsDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
actions: ActionGroup[];
|
|
5
|
+
/** The app's actions in the header bar, whose shortcuts work anywhere, as the main menu's do. */
|
|
6
|
+
headerActions: ActionGroup[];
|
|
7
|
+
/** The app's actions in the preview's header, whose shortcuts work there, after its own keys. */
|
|
8
|
+
previewActions: ActionGroup[];
|
|
9
|
+
/** The app's actions in the properties panel's header, whose shortcuts work in the panel. */
|
|
10
|
+
propertiesActions: ActionGroup[];
|
|
11
|
+
mainMenu: MainMenuGroup[];
|
|
12
|
+
/** Whether any section's adapter has `search`, without which there's no search everywhere. */
|
|
13
|
+
canSearchEverywhere: boolean;
|
|
14
|
+
/** Whether a search everywhere can cover more than one section, which gives the field its sections menu. */
|
|
15
|
+
choosesSections: boolean;
|
|
16
|
+
/** Whether any section's adapter has `content`, without which nothing is previewed. */
|
|
17
|
+
canPreview: boolean;
|
|
18
|
+
/** Whether any section takes uploads, without which nothing pasted is uploaded. */
|
|
19
|
+
canUpload: boolean;
|
|
20
|
+
/** Whether any section's adapter has `updateProperties`, without which no property is edited. */
|
|
21
|
+
canEditProperties: boolean;
|
|
22
|
+
/** Whether anything the file manager does can be undone, without which there's no Undo and Redo. */
|
|
23
|
+
canUndo: boolean;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
/** Called once it has faded out, to give the focus back. */
|
|
26
|
+
onClosed: () => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The window listing the keys, opened with Ctrl+?, the main menu's "Keyboard shortcuts" or
|
|
30
|
+
* `FileManagerApi.showShortcuts`: the file manager's own, by where they work, and then the
|
|
31
|
+
* consumer's actions and main menu items that have a shortcut. A key one of those binds is left
|
|
32
|
+
* out of the file manager's own where the consumer's come first, so each key is listed once for
|
|
33
|
+
* what it does. Search everywhere and the preview's keys are only listed when an adapter offers them.
|
|
34
|
+
*/
|
|
35
|
+
declare const ShortcutsDialog: ({ open, actions, headerActions, previewActions, propertiesActions, mainMenu, canSearchEverywhere, choosesSections, canPreview, canUpload, canEditProperties, canUndo, onClose, onClosed, }: ShortcutsDialogProps) => import("react").JSX.Element;
|
|
36
|
+
export default ShortcutsDialog;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ClipboardPart, ConflictPolicy, FileAdapter, FileEntry, FileManagerLocation, FolderRef, Section } from "../../../types/index.js";
|
|
2
|
+
import type { NameRequest } from "./name-dialog.js";
|
|
3
|
+
export interface TransferRequest {
|
|
4
|
+
kind: "copy" | "move";
|
|
5
|
+
/** The section the picker starts in. */
|
|
6
|
+
section: Section;
|
|
7
|
+
/** Trail to the folder the picker starts in: the entries', or the nearest holding them all. */
|
|
8
|
+
trail: FolderRef[];
|
|
9
|
+
/**
|
|
10
|
+
* The entries by the folder they're in, each with the adapter serving it: one, or several for a
|
|
11
|
+
* search's results, of one section or more.
|
|
12
|
+
*/
|
|
13
|
+
groups: ClipboardPart[];
|
|
14
|
+
/**
|
|
15
|
+
* Sections the entries can go into, of their own adapter or another, which copies them across,
|
|
16
|
+
* that take entries from each of theirs, `section` among them.
|
|
17
|
+
*/
|
|
18
|
+
destinations: Section[];
|
|
19
|
+
}
|
|
20
|
+
export interface TransferDialogState {
|
|
21
|
+
/** False while the dialog plays its closing transition; the rest is kept so it doesn't empty mid-fade. */
|
|
22
|
+
open: boolean;
|
|
23
|
+
/** Counts requests, so each one starts afresh. */
|
|
24
|
+
id: number;
|
|
25
|
+
request: TransferRequest;
|
|
26
|
+
}
|
|
27
|
+
interface TransferDialogProps {
|
|
28
|
+
open: boolean;
|
|
29
|
+
request: TransferRequest;
|
|
30
|
+
/** Whether hidden folders are listed with the rest. */
|
|
31
|
+
showHidden: boolean;
|
|
32
|
+
onClose: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Called whenever the picker's New folder button may have changed folders, with their ids, to
|
|
35
|
+
* list them again wherever they're shown.
|
|
36
|
+
*/
|
|
37
|
+
onChanged: (adapter: FileAdapter, folderIds: string[]) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Called once a destination is chosen and there's nothing left to ask, with the choice that
|
|
40
|
+
* settles names it already has, the entries to skip, which clash, and after a "replace", the
|
|
41
|
+
* ids of the folders entries are merged into, which may change all the way down. The adapter
|
|
42
|
+
* then copies or moves them in the background.
|
|
43
|
+
*/
|
|
44
|
+
onStart: (request: TransferRequest, destination: FileManagerLocation, conflict: ConflictPolicy, skipped: FileEntry[], mergedIds: string[]) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Called with a folder made with the picker's New folder button, as the adapter returned it,
|
|
47
|
+
* and what made it: its section, adapter and the trail to the folder it was made in.
|
|
48
|
+
*/
|
|
49
|
+
onFolderCreated: (request: NameRequest, entry: FileEntry) => void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Asks where to copy or move entries, then has the adapter do it. It browses folders only, across
|
|
53
|
+
* the sections that can take them, served by their adapter or another, which they're copied into
|
|
54
|
+
* across, starting in the entries' own folder, or for a search's results from several, the nearest
|
|
55
|
+
* holding them all. The entries themselves can't be opened, so a folder can never go into itself,
|
|
56
|
+
* and a folder that can't change (`folderWritable`) can be gone through but not chosen. Names the
|
|
57
|
+
* destination already has are settled in a second step: replace or merge, keep both, or skip. Then
|
|
58
|
+
* it closes, and the copy or move runs in the background, shown in the transfer panel.
|
|
59
|
+
*
|
|
60
|
+
* The list of folders is one stop in the tab order, focused once the dialog has faded in. The
|
|
61
|
+
* arrows, Home, End, PageUp and PageDown move between the rows that can be opened, and typing
|
|
62
|
+
* finds one by name; Enter or Space opens the focused folder, and Backspace or Alt+Up goes up, as
|
|
63
|
+
* the Back button does. Opening a folder or going up from the list keeps the focus in it, on the
|
|
64
|
+
* first row, or going up on the folder left through. Only the rows in or near view are rendered,
|
|
65
|
+
* and the focused one, so a folder of thousands of folders opens as fast as a small one.
|
|
66
|
+
*
|
|
67
|
+
* When the adapter can create folders, the New folder button asks for a name over the picker, and
|
|
68
|
+
* the new folder is opened, as the destination it was made to be. Going back up lands on it.
|
|
69
|
+
*/
|
|
70
|
+
declare const TransferDialog: ({ open, request, showHidden, onClose, onChanged, onStart, onFolderCreated, }: TransferDialogProps) => import("react").JSX.Element;
|
|
71
|
+
export default TransferDialog;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ConflictPolicy, DroppedFiles, FileAdapter, FolderRef, FolderUpload, Section } from "../../../types/index.js";
|
|
2
|
+
export interface UploadRequest {
|
|
3
|
+
/** The section of the folder uploaded into. */
|
|
4
|
+
section: Section;
|
|
5
|
+
/** The section's adapter, already known to take uploads. */
|
|
6
|
+
adapter: FileAdapter;
|
|
7
|
+
/** Trail to the folder uploaded into. */
|
|
8
|
+
trail: FolderRef[];
|
|
9
|
+
dropped: DroppedFiles;
|
|
10
|
+
}
|
|
11
|
+
export interface UploadDialogState {
|
|
12
|
+
/** False once the files are queued, or while the dialog plays its closing transition. */
|
|
13
|
+
open: boolean;
|
|
14
|
+
/** Counts requests, so each one starts afresh. */
|
|
15
|
+
id: number;
|
|
16
|
+
request: UploadRequest;
|
|
17
|
+
}
|
|
18
|
+
interface UploadDialogProps {
|
|
19
|
+
open: boolean;
|
|
20
|
+
request: UploadRequest;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
/** Called once nothing is left to ask, with the files and folders to upload and how to settle clashes. */
|
|
23
|
+
onUpload: (request: UploadRequest, files: File[], folders: FolderUpload[], conflict: ConflictPolicy) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Checks files and folders about to be uploaded into a folder before they're queued. Most uploads
|
|
27
|
+
* need nothing from the user, so this runs unseen, and the dialog only shows to ask about names the
|
|
28
|
+
* folder already has (replace or merge, keep both, or skip), or to say that folders, where the
|
|
29
|
+
* adapter can't make any, files of types the section doesn't take (`acceptUploads`), or names the
|
|
30
|
+
* backend refuses (`checkName`), were left out. What's inside the folders is only read once they're
|
|
31
|
+
* queued.
|
|
32
|
+
*/
|
|
33
|
+
declare const UploadDialog: ({ open, request, onClose, onUpload }: UploadDialogProps) => import("react").JSX.Element;
|
|
34
|
+
export default UploadDialog;
|