filecove 0.0.0-stage → 0.1.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.
Files changed (273) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -0
  3. package/README.md +65 -2
  4. package/THIRD_PARTY_NOTICES.md +63 -0
  5. package/dist/components/buttons/toolbar-actions.d.ts +28 -0
  6. package/dist/components/buttons/tooltip-icon-button.d.ts +14 -0
  7. package/dist/components/downloads/download-panel.d.ts +23 -0
  8. package/dist/components/file-manager/announcer.d.ts +14 -0
  9. package/dist/components/file-manager/content/file-grid.d.ts +8 -0
  10. package/dist/components/file-manager/content/file-list.d.ts +9 -0
  11. package/dist/components/file-manager/content/folder-view.d.ts +83 -0
  12. package/dist/components/file-manager/content/item-icon.d.ts +16 -0
  13. package/dist/components/file-manager/content/no-sections.d.ts +11 -0
  14. package/dist/components/file-manager/content/search-results.d.ts +40 -0
  15. package/dist/components/file-manager/content/search-tabs.d.ts +29 -0
  16. package/dist/components/file-manager/content/trash-bar.d.ts +13 -0
  17. package/dist/components/file-manager/context-menu/context-menu.d.ts +20 -0
  18. package/dist/components/file-manager/dialogs/conflict-step.d.ts +28 -0
  19. package/dist/components/file-manager/dialogs/delete-dialog.d.ts +48 -0
  20. package/dist/components/file-manager/dialogs/image-viewer.d.ts +42 -0
  21. package/dist/components/file-manager/dialogs/name-dialog.d.ts +41 -0
  22. package/dist/components/file-manager/dialogs/paste-dialog.d.ts +39 -0
  23. package/dist/components/file-manager/dialogs/preview-dialog.d.ts +75 -0
  24. package/dist/components/file-manager/dialogs/restore-dialog.d.ts +41 -0
  25. package/dist/components/file-manager/dialogs/shortcuts-dialog.d.ts +36 -0
  26. package/dist/components/file-manager/dialogs/transfer-dialog.d.ts +71 -0
  27. package/dist/components/file-manager/dialogs/upload-dialog.d.ts +34 -0
  28. package/dist/components/file-manager/drag-preview.d.ts +22 -0
  29. package/dist/components/file-manager/file-manager.d.ts +320 -0
  30. package/dist/components/file-manager/find-layer.d.ts +29 -0
  31. package/dist/components/file-manager/header-bar/header-bar.d.ts +65 -0
  32. package/dist/components/file-manager/header-bar/history-menu.d.ts +18 -0
  33. package/dist/components/file-manager/header-bar/path-bar.d.ts +19 -0
  34. package/dist/components/file-manager/header-bar/path-field.d.ts +23 -0
  35. package/dist/components/file-manager/header-bar/search-field.d.ts +27 -0
  36. package/dist/components/file-manager/header-bar/search-sections-menu.d.ts +25 -0
  37. package/dist/components/file-manager/header-bar/view-menu.d.ts +39 -0
  38. package/dist/components/file-manager/notice-bar.d.ts +36 -0
  39. package/dist/components/file-manager/properties-pane.d.ts +53 -0
  40. package/dist/components/file-manager/resize-edge.d.ts +39 -0
  41. package/dist/components/file-manager/selection-bar.d.ts +15 -0
  42. package/dist/components/file-manager/sidebar/location-item.d.ts +36 -0
  43. package/dist/components/file-manager/sidebar/main-menu.d.ts +23 -0
  44. package/dist/components/file-manager/sidebar/sidebar.d.ts +80 -0
  45. package/dist/components/icons/check-badge.d.ts +3 -0
  46. package/dist/components/icons/create-icon.d.ts +20 -0
  47. package/dist/components/icons/file-icon.d.ts +19 -0
  48. package/dist/components/icons/icon-provider.d.ts +21 -0
  49. package/dist/components/icons/icon-slot.d.ts +6 -0
  50. package/dist/components/icons/icon.d.ts +19 -0
  51. package/dist/components/icons/locked-icon.d.ts +9 -0
  52. package/dist/components/media-manager/asset-delete.d.ts +17 -0
  53. package/dist/components/media-manager/asset-hold.d.ts +32 -0
  54. package/dist/components/media-manager/asset-option.d.ts +63 -0
  55. package/dist/components/media-manager/asset-trail.d.ts +13 -0
  56. package/dist/components/media-manager/choice-list.d.ts +29 -0
  57. package/dist/components/media-manager/choices-pane.d.ts +50 -0
  58. package/dist/components/media-manager/choose-bar.d.ts +26 -0
  59. package/dist/components/media-manager/drop-zone.d.ts +7 -0
  60. package/dist/components/media-manager/group-check.d.ts +13 -0
  61. package/dist/components/media-manager/group-create.d.ts +20 -0
  62. package/dist/components/media-manager/group-path.d.ts +18 -0
  63. package/dist/components/media-manager/library-list.d.ts +21 -0
  64. package/dist/components/media-manager/media-asset.d.ts +53 -0
  65. package/dist/components/media-manager/media-fields.d.ts +31 -0
  66. package/dist/components/media-manager/media-form.d.ts +27 -0
  67. package/dist/components/media-manager/media-frame.d.ts +73 -0
  68. package/dist/components/media-manager/media-grid.d.ts +85 -0
  69. package/dist/components/media-manager/media-group.d.ts +29 -0
  70. package/dist/components/media-manager/media-header.d.ts +63 -0
  71. package/dist/components/media-manager/media-manager.d.ts +286 -0
  72. package/dist/components/media-manager/media-move.d.ts +22 -0
  73. package/dist/components/media-manager/media-picker.d.ts +122 -0
  74. package/dist/components/media-manager/media-picture.d.ts +26 -0
  75. package/dist/components/media-manager/media-process.d.ts +26 -0
  76. package/dist/components/media-manager/media-row.d.ts +13 -0
  77. package/dist/components/media-manager/media-step.d.ts +33 -0
  78. package/dist/components/media-manager/media-tile.d.ts +15 -0
  79. package/dist/components/media-manager/media-upload.d.ts +24 -0
  80. package/dist/components/media-manager/open-button.d.ts +15 -0
  81. package/dist/components/media-manager/picker-frame.d.ts +29 -0
  82. package/dist/components/media-manager/upload-tile.d.ts +15 -0
  83. package/dist/components/properties/properties-panel.d.ts +47 -0
  84. package/dist/components/properties/property-display.d.ts +15 -0
  85. package/dist/components/properties/property-editor.d.ts +26 -0
  86. package/dist/components/properties/property-input.d.ts +36 -0
  87. package/dist/components/transfers/transfer-panel.d.ts +25 -0
  88. package/dist/components/ui/backdrop.d.ts +7 -0
  89. package/dist/components/ui/button-base.d.ts +7 -0
  90. package/dist/components/ui/button.d.ts +18 -0
  91. package/dist/components/ui/checkbox.d.ts +24 -0
  92. package/dist/components/ui/chip.d.ts +18 -0
  93. package/dist/components/ui/circular-progress.d.ts +14 -0
  94. package/dist/components/ui/collapse.d.ts +9 -0
  95. package/dist/components/ui/dialog.d.ts +40 -0
  96. package/dist/components/ui/divider.d.ts +4 -0
  97. package/dist/components/ui/icon-button.d.ts +12 -0
  98. package/dist/components/ui/linear-progress.d.ts +13 -0
  99. package/dist/components/ui/link.d.ts +4 -0
  100. package/dist/components/ui/menu.d.ts +77 -0
  101. package/dist/components/ui/root-providers.d.ts +16 -0
  102. package/dist/components/ui/text-field.d.ts +38 -0
  103. package/dist/components/ui/text.d.ts +21 -0
  104. package/dist/components/ui/tooltip.d.ts +24 -0
  105. package/dist/components/uploads/upload-panel.d.ts +25 -0
  106. package/dist/contexts/asset-look-context.d.ts +1 -0
  107. package/dist/contexts/cut-context.d.ts +6 -0
  108. package/dist/contexts/data-context.d.ts +12 -0
  109. package/dist/contexts/direction-context.d.ts +2 -0
  110. package/dist/contexts/drag-context.d.ts +36 -0
  111. package/dist/contexts/icon-context.d.ts +10 -0
  112. package/dist/contexts/locale-context.d.ts +2 -0
  113. package/dist/contexts/moving-context.d.ts +7 -0
  114. package/dist/create-icon-D2vnnBQX.js +40 -0
  115. package/dist/create-icon-D2vnnBQX.js.map +1 -0
  116. package/dist/hooks/use-announcer.d.ts +20 -0
  117. package/dist/hooks/use-asset-look.d.ts +6 -0
  118. package/dist/hooks/use-asset-states.d.ts +12 -0
  119. package/dist/hooks/use-chosen-column.d.ts +16 -0
  120. package/dist/hooks/use-clipboard-follow.d.ts +12 -0
  121. package/dist/hooks/use-controlled.d.ts +18 -0
  122. package/dist/hooks/use-cut-ids.d.ts +3 -0
  123. package/dist/hooks/use-download-queue.d.ts +19 -0
  124. package/dist/hooks/use-dragged-ids.d.ts +3 -0
  125. package/dist/hooks/use-drop-target.d.ts +48 -0
  126. package/dist/hooks/use-entry-drag.d.ts +46 -0
  127. package/dist/hooks/use-files-drop.d.ts +14 -0
  128. package/dist/hooks/use-folder.d.ts +14 -0
  129. package/dist/hooks/use-fork-ref.d.ts +6 -0
  130. package/dist/hooks/use-form-send.d.ts +12 -0
  131. package/dist/hooks/use-found.d.ts +10 -0
  132. package/dist/hooks/use-icon-config.d.ts +2 -0
  133. package/dist/hooks/use-level-search.d.ts +19 -0
  134. package/dist/hooks/use-locale.d.ts +10 -0
  135. package/dist/hooks/use-location-history.d.ts +42 -0
  136. package/dist/hooks/use-long-press.d.ts +25 -0
  137. package/dist/hooks/use-marquee.d.ts +35 -0
  138. package/dist/hooks/use-match-count.d.ts +7 -0
  139. package/dist/hooks/use-media-search.d.ts +30 -0
  140. package/dist/hooks/use-moving-ids.d.ts +3 -0
  141. package/dist/hooks/use-picks.d.ts +39 -0
  142. package/dist/hooks/use-preview-contents.d.ts +33 -0
  143. package/dist/hooks/use-properties.d.ts +25 -0
  144. package/dist/hooks/use-scroll-measure.d.ts +34 -0
  145. package/dist/hooks/use-search.d.ts +11 -0
  146. package/dist/hooks/use-selection.d.ts +29 -0
  147. package/dist/hooks/use-setting.d.ts +21 -0
  148. package/dist/hooks/use-stable-set.d.ts +6 -0
  149. package/dist/hooks/use-swipe.d.ts +41 -0
  150. package/dist/hooks/use-text-direction.d.ts +8 -0
  151. package/dist/hooks/use-thumbnail.d.ts +8 -0
  152. package/dist/hooks/use-transfer-queue.d.ts +22 -0
  153. package/dist/hooks/use-tree-rows.d.ts +9 -0
  154. package/dist/hooks/use-tree-selection.d.ts +19 -0
  155. package/dist/hooks/use-type-ahead.d.ts +9 -0
  156. package/dist/hooks/use-type-icons.d.ts +10 -0
  157. package/dist/hooks/use-upload-queue.d.ts +22 -0
  158. package/dist/hooks/use-virtual-lines.d.ts +27 -0
  159. package/dist/hooks/use-virtual-rows.d.ts +31 -0
  160. package/dist/hooks/use-wheel-zoom.d.ts +10 -0
  161. package/dist/icon-sets/filled.d.ts +6 -0
  162. package/dist/icon-sets/filled.js +76 -0
  163. package/dist/icon-sets/filled.js.map +1 -0
  164. package/dist/icon-sets/outlined.d.ts +6 -0
  165. package/dist/icon-sets/outlined.js +73 -0
  166. package/dist/icon-sets/outlined.js.map +1 -0
  167. package/dist/icon-sets/rounded.d.ts +6 -0
  168. package/dist/icon-sets/rounded.js +73 -0
  169. package/dist/icon-sets/rounded.js.map +1 -0
  170. package/dist/icon-sets/sharp.d.ts +6 -0
  171. package/dist/icon-sets/sharp.js +73 -0
  172. package/dist/icon-sets/sharp.js.map +1 -0
  173. package/dist/icon-sets/two-tone.d.ts +6 -0
  174. package/dist/icon-sets/two-tone.js +188 -0
  175. package/dist/icon-sets/two-tone.js.map +1 -0
  176. package/dist/index.d.ts +18 -0
  177. package/dist/index.js +29473 -0
  178. package/dist/index.js.map +1 -0
  179. package/dist/locales/en-us.d.ts +7 -0
  180. package/dist/store/download-queue.d.ts +37 -0
  181. package/dist/store/folder-store.d.ts +79 -0
  182. package/dist/store/keyboard-layout.d.ts +11 -0
  183. package/dist/store/properties-cache.d.ts +65 -0
  184. package/dist/store/thumbnail-cache.d.ts +30 -0
  185. package/dist/store/transfer-across.d.ts +24 -0
  186. package/dist/store/transfer-queue.d.ts +59 -0
  187. package/dist/store/upload-queue.d.ts +63 -0
  188. package/dist/styles/arrived.d.ts +6 -0
  189. package/dist/styles/classes.d.ts +184 -0
  190. package/dist/styles/layout.d.ts +55 -0
  191. package/dist/styles/media-layout.d.ts +36 -0
  192. package/dist/styles/order.d.ts +1 -0
  193. package/dist/styles.css +6904 -0
  194. package/dist/styles.layer.css +6906 -0
  195. package/dist/types/action.d.ts +296 -0
  196. package/dist/types/adapter.d.ts +769 -0
  197. package/dist/types/api.d.ts +180 -0
  198. package/dist/types/clipboard.d.ts +45 -0
  199. package/dist/types/download.d.ts +41 -0
  200. package/dist/types/drag.d.ts +57 -0
  201. package/dist/types/folder.d.ts +47 -0
  202. package/dist/types/icon.d.ts +20 -0
  203. package/dist/types/index.d.ts +27 -0
  204. package/dist/types/limits.d.ts +49 -0
  205. package/dist/types/locale.d.ts +975 -0
  206. package/dist/types/main-menu.d.ts +20 -0
  207. package/dist/types/media.d.ts +515 -0
  208. package/dist/types/menu.d.ts +82 -0
  209. package/dist/types/navigation.d.ts +88 -0
  210. package/dist/types/preview.d.ts +54 -0
  211. package/dist/types/previewer.d.ts +67 -0
  212. package/dist/types/properties.d.ts +93 -0
  213. package/dist/types/property-definition.d.ts +229 -0
  214. package/dist/types/search.d.ts +46 -0
  215. package/dist/types/section.d.ts +98 -0
  216. package/dist/types/selection.d.ts +52 -0
  217. package/dist/types/slots.d.ts +213 -0
  218. package/dist/types/transfer.d.ts +68 -0
  219. package/dist/types/tree.d.ts +97 -0
  220. package/dist/types/undo.d.ts +133 -0
  221. package/dist/types/upload.d.ts +113 -0
  222. package/dist/types/view.d.ts +192 -0
  223. package/dist/utils/action-groups.d.ts +17 -0
  224. package/dist/utils/bidi.d.ts +15 -0
  225. package/dist/utils/clipboard.d.ts +30 -0
  226. package/dist/utils/cx.d.ts +2 -0
  227. package/dist/utils/dom.d.ts +23 -0
  228. package/dist/utils/download.d.ts +30 -0
  229. package/dist/utils/field-errors.d.ts +26 -0
  230. package/dist/utils/files.d.ts +44 -0
  231. package/dist/utils/format.d.ts +10 -0
  232. package/dist/utils/groups.d.ts +29 -0
  233. package/dist/utils/hidden.d.ts +3 -0
  234. package/dist/utils/keyboard.d.ts +21 -0
  235. package/dist/utils/limits.d.ts +7 -0
  236. package/dist/utils/media.d.ts +69 -0
  237. package/dist/utils/menu-position.d.ts +13 -0
  238. package/dist/utils/names.d.ts +21 -0
  239. package/dist/utils/navigation.d.ts +28 -0
  240. package/dist/utils/path.d.ts +33 -0
  241. package/dist/utils/permissions.d.ts +56 -0
  242. package/dist/utils/preview.d.ts +27 -0
  243. package/dist/utils/property-value.d.ts +39 -0
  244. package/dist/utils/resize.d.ts +2 -0
  245. package/dist/utils/search.d.ts +24 -0
  246. package/dist/utils/sections.d.ts +11 -0
  247. package/dist/utils/selection.d.ts +30 -0
  248. package/dist/utils/sets.d.ts +2 -0
  249. package/dist/utils/shortcut.d.ts +74 -0
  250. package/dist/utils/slots.d.ts +15 -0
  251. package/dist/utils/sort.d.ts +47 -0
  252. package/dist/utils/transfer.d.ts +48 -0
  253. package/dist/utils/trash.d.ts +25 -0
  254. package/dist/utils/undo.d.ts +63 -0
  255. package/dist/utils/zoom.d.ts +14 -0
  256. package/docs/README.md +55 -0
  257. package/docs/actions.md +301 -0
  258. package/docs/adapter.md +169 -0
  259. package/docs/copy-move-trash-undo.md +97 -0
  260. package/docs/customizing.md +218 -0
  261. package/docs/getting-started.md +166 -0
  262. package/docs/locale-and-rtl.md +58 -0
  263. package/docs/media-manager.md +311 -0
  264. package/docs/previewing.md +124 -0
  265. package/docs/properties.md +125 -0
  266. package/docs/recipes/in-memory-adapter.md +149 -0
  267. package/docs/recipes/rest-adapter.md +225 -0
  268. package/docs/recipes/s3-adapter.md +137 -0
  269. package/docs/search.md +71 -0
  270. package/docs/sections.md +119 -0
  271. package/docs/state-and-api.md +190 -0
  272. package/docs/uploads-and-downloads.md +143 -0
  273. package/package.json +90 -4
@@ -0,0 +1,41 @@
1
+ import type { FileAdapter, FileEntry, FolderRef, Section } from "../../../types";
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";
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";
2
+ import type { FileAdapter, FileEntry, FilePreviewer, FolderRef, Section, ToolbarGroup } from "../../../types";
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";
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";
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";
2
+ import type { NameRequest } from "./name-dialog";
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";
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;
@@ -0,0 +1,22 @@
1
+ import type { Ref } from "react";
2
+ import type { DropEffect, FileEntry } from "../../types";
3
+ interface DragPreviewProps {
4
+ ref: Ref<HTMLDivElement>;
5
+ /** The entry the drag started from. */
6
+ entry: FileEntry;
7
+ /** How many entries are dragged, that one included. */
8
+ count: number;
9
+ /**
10
+ * A touch drag's, which follows the finger (`useEntryDrag` places it) and shows what letting
11
+ * go would do, where a mouse drag has the cursor say it.
12
+ */
13
+ touch?: boolean;
14
+ effect?: DropEffect;
15
+ }
16
+ /**
17
+ * The drag image: the grabbed entry's icon and name on a card, stacked on a card for each other
18
+ * entry up to `MAX_LAYERS`, with a count of them all when others go along, and for a touch drag a
19
+ * "+" where letting go would copy.
20
+ */
21
+ declare const DragPreview: ({ ref, entry, count, touch, effect }: DragPreviewProps) => import("react").JSX.Element;
22
+ export default DragPreview;