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
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ filecove follows [semantic versioning](https://semver.org). Below 1.0, a minor version (0.2.0) may change the API; a patch (0.1.1) never does.
4
+
5
+ ## 0.1.0 (2026-11-12)
6
+
7
+ The first release.
8
+
9
+ - `FileManager`: a file manager over any backend, through an adapter whose optional members switch features on: sections, list and grid views, sorting and zoom, the folder search and search everywhere, drag and drop, copy and move in the background (between backends too), uploads of files and folders, downloads, a preview with previewers of your own, a properties panel with editable fields, a trash, undo and redo, permissions, keyboard navigation, screen reader support and right to left.
10
+ - `MediaManager`: libraries of pictures, videos, audio and documents, with groups, picking with forms of your own, uploads, processing and the backend's errors per pick.
11
+ - `MediaPicker`, `MediaPicture`, `MediaTile`, `MediaRow`, `MediaFields` and `PropertyDefinition`s for fields and properties of your own.
12
+ - Theming with `--fm-*` custom properties, two stylesheets (`styles.css`, `styles.layer.css`), stable class names (`fmClasses`), `slots`, `slotProps` and `headerActions`.
13
+ - Material icons in five styles (`filecove/icons/<style>`), and `IconProvider`.
14
+ - English text (`enUS`), replaceable through `localeText`.
15
+ - Documentation in `docs/`, shipped in the package.
16
+
17
+ Known limits: type declarations need TypeScript's `moduleResolution: "bundler"`; browsers from Chrome 123, Safari 17.5 and Firefox 120.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KC3NZO
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,66 @@
1
- # Temporary Holding Version
1
+ # filecove
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A file manager for React apps, and a media manager built on the same parts. It runs in the browser and works with any backend: you write an **adapter**, a few async functions that list folders and, optionally, rename, upload, delete and so on, and filecove does the rest.
4
+
5
+ - **`FileManager`**: a sidebar of your roots, list and grid views, search, drag and drop, uploads and downloads in the background, a preview, a properties panel, a trash, undo and redo, keyboard navigation, screen reader support and right to left.
6
+ - **`MediaManager`**: libraries of pictures, videos, audio and documents to look through and pick from, with groups, your own forms and fields, uploads and processing.
7
+ - **`MediaPicker`**: one library to find or upload an asset in, for a field pointing at one.
8
+
9
+ React 19, no styling runtime, themed with CSS custom properties. MIT licensed.
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ npm install filecove
15
+ ```
16
+
17
+ ## Use
18
+
19
+ ```tsx
20
+ import { FileManager } from "filecove";
21
+ import type { FileAdapter, SectionGroup } from "filecove";
22
+ import "filecove/styles.css";
23
+
24
+ const adapter: FileAdapter = {
25
+ async list(folderId, { signal }) {
26
+ const response = await fetch(`/api/folders/${encodeURIComponent(folderId)}/entries`, { signal });
27
+ const body = await response.json();
28
+ return {
29
+ entries: body.entries.map((entry: any) => ({
30
+ id: entry.id,
31
+ name: entry.name,
32
+ kind: entry.type,
33
+ size: entry.size,
34
+ modifiedAt: entry.updated_at ? new Date(entry.updated_at) : undefined,
35
+ })),
36
+ };
37
+ },
38
+ };
39
+
40
+ const sections: SectionGroup[] = [
41
+ { id: "places", sections: [{ id: "home", label: "My files", icon: "home", rootId: "root" }] },
42
+ ];
43
+
44
+ export function Files() {
45
+ return (
46
+ <div style={{ height: "100vh" }}>
47
+ <FileManager adapter={adapter} sections={sections} />
48
+ </div>
49
+ );
50
+ }
51
+ ```
52
+
53
+ Each feature switches on as the adapter grows a matching method: `rename`, `upload`, `delete`, `content` for the preview, `search`, and so on. The context menu is yours to fill with `actions`.
54
+
55
+ ## Documentation
56
+
57
+ The docs are in [`docs/`](docs/README.md), and ship with the package at `node_modules/filecove/docs/`:
58
+
59
+ - [Getting started](docs/getting-started.md)
60
+ - [The adapter](docs/adapter.md)
61
+ - [Actions](docs/actions.md), with a complete set to copy
62
+ - [Recipes](docs/README.md#recipes): adapters over a REST API, S3, and memory
63
+
64
+ ## License
65
+
66
+ MIT. The Material Icons' shapes are under the Apache License 2.0; see `THIRD_PARTY_NOTICES.md`.
@@ -0,0 +1,63 @@
1
+ # Third-party notices
2
+
3
+ ## Material Icons
4
+
5
+ The icon shapes in `src/icon-sets/` (`filled.ts`, `outlined.ts`, `rounded.ts`, `sharp.ts` and `two-tone.ts`) are copied from Material Icons by Google, https://github.com/google/material-design-icons, unchanged, and drawn as SVG by this package's own code. Material Icons are licensed under the Apache License, Version 2.0, whose text follows.
6
+
7
+ ---
8
+
9
+ Apache License
10
+
11
+ Version 2.0, January 2004
12
+
13
+ http://www.apache.org/licenses/
14
+
15
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
16
+
17
+ 1. Definitions.
18
+
19
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
20
+
21
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
22
+
23
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
30
+
31
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
32
+
33
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
34
+
35
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
36
+
37
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
38
+
39
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
40
+
41
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
42
+
43
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
44
+
45
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
46
+
47
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
48
+
49
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
50
+
51
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
52
+
53
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
54
+
55
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
56
+
57
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
58
+
59
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
60
+
61
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
62
+
63
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,28 @@
1
+ import type { ToolbarGroup } from "../../types";
2
+ interface ToolbarActionsProps {
3
+ groups: readonly ToolbarGroup[];
4
+ /** Names the button holding the actions that don't show as buttons. */
5
+ moreLabel: string;
6
+ /**
7
+ * How many of the actions with an icon show as buttons, at most, besides those the header
8
+ * `keep`s as buttons; the rest go in "More actions".
9
+ */
10
+ inline: number;
11
+ /**
12
+ * Whether the header it's in hides the buttons where it's narrow, every action going in "More
13
+ * actions" there. The header says where, by two custom properties its own stylesheet sets:
14
+ * `--toolbar-buttons: none` with `--toolbar-more: inline-flex` where it's narrow, and
15
+ * `--toolbar-buttons: flex` with `--toolbar-more: none` where it has the room. Without it,
16
+ * the actions always show as buttons.
17
+ */
18
+ collapses?: boolean;
19
+ size?: "small" | "medium";
20
+ }
21
+ /**
22
+ * The app's actions in a header, the file manager's, the preview's, the properties panel's or the media manager's: those with an icon as icon
23
+ * buttons, as many as `inline` says and the header has room for, and the rest in a "More actions"
24
+ * menu, built as the context menu is. Each action runs on what the header shows, already bound. It
25
+ * knows nothing of the file manager, so the media manager's panels can use it too.
26
+ */
27
+ declare const ToolbarActions: ({ groups, moreLabel, inline, collapses, size }: ToolbarActionsProps) => import("react").JSX.Element | null;
28
+ export default ToolbarActions;
@@ -0,0 +1,14 @@
1
+ import type { IconButtonProps } from "../ui/icon-button";
2
+ interface TooltipIconButtonProps extends Omit<IconButtonProps, "aria-label" | "title"> {
3
+ /** Names the button for screen readers and shows as its tooltip. */
4
+ label: string;
5
+ }
6
+ /**
7
+ * An icon-only button, named by `label` for screen readers and showing it as a tooltip with an arrow
8
+ * on hover or keyboard focus, after a desktop-like half second, and at once while moving along a
9
+ * row of them, at least 8px from the viewport's edges.
10
+ * The tooltip portals to `<body>`, so it takes the file manager's direction (`DirectionContext`).
11
+ * A disabled button shows none.
12
+ */
13
+ declare const TooltipIconButton: ({ label, ...props }: TooltipIconButtonProps) => import("react").JSX.Element;
14
+ export default TooltipIconButton;
@@ -0,0 +1,23 @@
1
+ import type { DownloadItem } from "../../types";
2
+ interface DownloadPanelProps {
3
+ /** The downloads to show, in the order asked for. */
4
+ items: DownloadItem[];
5
+ onCancel: (id: number) => void;
6
+ onRetry: (id: number) => void;
7
+ /** Starts a ready download, from the click on its button. */
8
+ onSave: (id: number) => void;
9
+ /** Cancels every download waiting or being prepared. */
10
+ onCancelAll: () => void;
11
+ /** Forgets every failed and ready download. */
12
+ onClear: () => void;
13
+ }
14
+ /**
15
+ * Downloads that have taken a moment, or need the user: a summary that can fold the list away, and
16
+ * a row per download with what it's at, to cancel it, try it again, or start it when the browser
17
+ * wouldn't on its own. A download leaves once the browser has the file, and the browser's own
18
+ * downloads show it from there. It knows nothing of where it's shown, so it can sit under any
19
+ * view of files. The close button cancels whatever is still being prepared, and once nothing is,
20
+ * forgets the rest.
21
+ */
22
+ declare const DownloadPanel: ({ items, onCancel, onRetry, onSave, onCancelAll, onClear }: DownloadPanelProps) => import("react").JSX.Element;
23
+ export default DownloadPanel;
@@ -0,0 +1,14 @@
1
+ import type { Announcement } from "../../hooks/use-announcer";
2
+ interface AnnouncerProps {
3
+ announcement: Announcement | null;
4
+ }
5
+ /**
6
+ * The file manager's polite live region, for what finishes with nothing else spoken about it.
7
+ *
8
+ * A modal dialog hides the rest of the page from screen readers (`aria-hidden` on `<body>`'s other
9
+ * children) until it has faded out, and a live region in a hidden part goes unheard, so a message
10
+ * the dialog's action ends with waits until the region is no longer hidden. Each message goes in a
11
+ * node of its own, so the same message twice is a change too.
12
+ */
13
+ declare const Announcer: ({ announcement }: AnnouncerProps) => import("react").JSX.Element;
14
+ export default Announcer;
@@ -0,0 +1,8 @@
1
+ import type { FileViewProps } from "../../../types";
2
+ /**
3
+ * The entries as tiles, a listbox with one option per entry, of which only those in or near view
4
+ * are rendered (`lines`), as many to a line as fit. The arrow keys move through them in two
5
+ * directions. Only the focused tile is in the tab order.
6
+ */
7
+ declare const FileGrid: ({ entries, origins, lines, zoom, label, focusId, selectedIds, cutIds, movingIds, arrivedIds, foundId, adapter, draggable, draggedIds, dropTargetId, onSelect, onOpen, onMenu, entrySlot, }: FileViewProps) => import("react").JSX.Element;
8
+ export default FileGrid;
@@ -0,0 +1,9 @@
1
+ import type { FileViewProps } from "../../../types";
2
+ /**
3
+ * The entries as rows, a listbox with one option per entry, of which only those in or near view
4
+ * are rendered (`lines`), one to a line. Only the focused row is in the tab order; the folder view
5
+ * moves the focus between rows with the arrow keys. The menu buttons are for pointers alone, since
6
+ * the Menu key or Shift+F10 opens the same menu from the focused row.
7
+ */
8
+ declare const FileList: ({ entries, origins, trash, lines, zoom, label, focusId, selectedIds, cutIds, movingIds, arrivedIds, foundId, adapter, draggable, draggedIds, dropTargetId, hasActions, sort, onSelect, onOpen, onMenu, onSortChange, entrySlot, }: FileViewProps) => import("react").JSX.Element;
9
+ export default FileList;
@@ -0,0 +1,83 @@
1
+ import type { ActionContext, Arrival, FileEntry, FileManagerLocation, FileManagerSlotProps, FileManagerSlots, FolderRef, MenuRequest, OpenMenu, PasteFiles, RunShortcut, Section, SortOrder, TrashInfo, ViewMode } from "../../../types";
2
+ interface FolderViewProps {
3
+ section: Section;
4
+ trail: FolderRef[];
5
+ view: ViewMode;
6
+ /** How far the view is zoomed, in steps from the size it starts at. */
7
+ zoom: number;
8
+ sort: SortOrder;
9
+ /** Whether hidden entries are listed with the rest. */
10
+ showHidden: boolean;
11
+ /**
12
+ * What a folder search has typed: only entries whose names hold every word of it are listed,
13
+ * and all of them while it's empty.
14
+ */
15
+ query: string;
16
+ hasActions: boolean;
17
+ /** Touch selection mode: taps toggle entries, and the selection bar shows. */
18
+ selecting: boolean;
19
+ /** Something is being pasted into the folder, so the progress bar shows. */
20
+ busy: boolean;
21
+ /**
22
+ * Takes the focus, or as soon as there is something to focus once the folder is listed. Set
23
+ * for one render, e.g. as the folder opens from a key press in the one before, whose view went
24
+ * away with the focus in it.
25
+ */
26
+ takeFocus: boolean;
27
+ /** An entry to select and scroll to once the listing has it, e.g. a folder just created. */
28
+ revealId?: string;
29
+ /** Selected along with `revealId`, those shown, as entries restored with it are. */
30
+ revealWith?: readonly string[];
31
+ /**
32
+ * What uploads just put in folders, highlighted for a moment once this folder shows them, and
33
+ * those asked for with "Show in folder" scrolled to as well.
34
+ */
35
+ arrivals: readonly Arrival[];
36
+ /** The selected ids, while the consumer controls them; the view keeps its own otherwise. */
37
+ selectedIds?: ReadonlySet<string>;
38
+ /** The ids the view's own selection starts with. */
39
+ defaultSelectedIds?: readonly string[];
40
+ /**
41
+ * Told the selection as it changes, with the selected entries listed, whether by the user, by
42
+ * the listing changing under it, or by the folder opening with it.
43
+ */
44
+ onSelectionChange: (ids: ReadonlySet<string>, entries: FileEntry[], location: FileManagerLocation) => void;
45
+ onSelectingChange: (selecting: boolean) => void;
46
+ onSortChange: (sort: SortOrder) => void;
47
+ onNavigate: (place: FileManagerLocation) => void;
48
+ /** Opens a file as the file manager says. Returns false when nothing can open it. */
49
+ onOpenFile: (request: MenuRequest) => boolean;
50
+ onOpenMenu: OpenMenu;
51
+ onShortcut: RunShortcut;
52
+ /** Uploads files pasted from the system clipboard into the folder. */
53
+ onPasteFiles: PasteFiles;
54
+ /**
55
+ * Called once `revealId` has been selected, saying whether it takes the focus, or given up on,
56
+ * with `false`.
57
+ */
58
+ onRevealed: (focused: boolean) => void;
59
+ /** Called while `revealId` is listed but left out by `query`, so ending the search shows it. */
60
+ onRevealUnmatched: () => void;
61
+ /** Told the `key`s of the arrivals highlighted, which are done with. */
62
+ onArrived: (keys: number[]) => void;
63
+ /**
64
+ * In the trash's root (`Section.trash`): where an entry was moved there from, written out for
65
+ * the location column.
66
+ */
67
+ trashLocation?: (info: TrashInfo) => string;
68
+ /** The app's own states, drawn in their boxes in place of the file manager's (`slots`). */
69
+ slots: FileManagerSlots;
70
+ /** The app's attributes for each row and tile (`slotProps.entry`). */
71
+ entrySlot: FileManagerSlotProps["entry"];
72
+ /** What the context menu's actions get for a folder, as `FileManagerApi.actionContext` returns it. */
73
+ folderContext: (entries?: readonly FileEntry[], location?: FileManagerLocation) => ActionContext | null;
74
+ }
75
+ /**
76
+ * The open folder's contents. It owns the selection, so the selection starts empty in every
77
+ * folder (the file manager remounts this per folder) and is never shared with the sidebar.
78
+ *
79
+ * On touch there are no modifier keys, so a long-press (or the header's Select button) starts a
80
+ * selection mode in which taps toggle entries. Outside it, a tap opens a folder or a file.
81
+ */
82
+ declare const FolderView: ({ section, trail, view, zoom, sort, showHidden, query, hasActions, selecting, busy, takeFocus, revealId, revealWith, arrivals, selectedIds: controlledIds, defaultSelectedIds, onSelectionChange, onSelectingChange, onSortChange, onNavigate, onOpenFile, onOpenMenu, onShortcut, onPasteFiles, onRevealed, onRevealUnmatched, onArrived, trashLocation, slots, entrySlot, folderContext, }: FolderViewProps) => import("react").JSX.Element;
83
+ export default FolderView;
@@ -0,0 +1,16 @@
1
+ import type { FileAdapter, FileEntry, ViewMode } from "../../../types";
2
+ interface ItemIconProps {
3
+ entry: FileEntry;
4
+ /** The icon's width and height, in rem. */
5
+ size: number;
6
+ /** The entry's adapter, which may give the file a thumbnail. */
7
+ adapter?: FileAdapter;
8
+ /** The view the entry is shown in, which its thumbnail is asked for; without it, the icon always shows. */
9
+ view?: ViewMode;
10
+ }
11
+ /**
12
+ * An entry's type icon, or its file's thumbnail once one has loaded, with the check badge of touch
13
+ * selection, and a lock on a folder nothing can be put in.
14
+ */
15
+ declare const ItemIcon: ({ entry, size, adapter, view }: ItemIconProps) => import("react").JSX.Element;
16
+ export default ItemIcon;
@@ -0,0 +1,11 @@
1
+ import type { ComponentType } from "react";
2
+ interface NoSectionsProps {
3
+ /** The app's own, drawn in the state's box in place of the file manager's (`slots.noSections`). */
4
+ slot?: ComponentType;
5
+ }
6
+ /**
7
+ * The content while the file manager has no section to show, as while an app is still getting its
8
+ * sections, in place of an empty panel.
9
+ */
10
+ declare const NoSections: ({ slot: Slot }: NoSectionsProps) => import("react").JSX.Element;
11
+ export default NoSections;
@@ -0,0 +1,40 @@
1
+ import type { FileManagerLocation, FileManagerSlotProps, FileManagerSlots, MenuRequest, OpenMenu, RunShortcut, SearchHit, SearchTarget, SortOrder, ViewMode } from "../../../types";
2
+ interface SearchResultsProps {
3
+ /** The sections searched, with their adapters, in the sidebar's order. */
4
+ targets: readonly SearchTarget[];
5
+ /** What's typed, trimmed; never empty. */
6
+ query: string;
7
+ /** Changes whenever the file manager changes something, which searches again. */
8
+ version: number;
9
+ /** How long the typing has to stop for before the sections are searched, in ms; `useSearch`'s when omitted. */
10
+ delay?: number;
11
+ view: ViewMode;
12
+ /** How far the view is zoomed, in steps from the size it starts at. */
13
+ zoom: number;
14
+ sort: SortOrder;
15
+ showHidden: boolean;
16
+ hasActions: boolean;
17
+ /** Takes the focus, or as soon as there's something to focus, as `FolderView`'s does. */
18
+ takeFocus: boolean;
19
+ onSortChange: (sort: SortOrder) => void;
20
+ onNavigate: (place: FileManagerLocation) => void;
21
+ /** Opens a file as the file manager says. Returns false when nothing can open it. */
22
+ onOpenFile: (request: MenuRequest) => boolean;
23
+ onOpenMenu: OpenMenu;
24
+ onShortcut: RunShortcut;
25
+ /** Told the selected results as they change, which the properties show. */
26
+ onSelectionChange: (hits: SearchHit[]) => void;
27
+ /** The app's own states, drawn in their boxes in place of the file manager's (`slots`). */
28
+ slots: FileManagerSlots;
29
+ /** The app's attributes for each result's row and tile (`slotProps.entry`). */
30
+ entrySlot: FileManagerSlotProps["entry"];
31
+ }
32
+ /**
33
+ * A search everywhere's results, in the content panel in place of the open folder: every section's
34
+ * together, sorted as a folder is, with where each is in a Location column, and, with several
35
+ * sections searched, a tab for each above them. Results are selected as entries are, and acted on
36
+ * together, by the folder each is in when they're in several (`MenuRequest.groups`), of one
37
+ * section or more.
38
+ */
39
+ declare const SearchResults: ({ targets, query, version, delay, view, zoom, sort, showHidden, hasActions, takeFocus, onSortChange, onNavigate, onOpenFile, onOpenMenu, onShortcut, onSelectionChange, slots, entrySlot, }: SearchResultsProps) => import("react").JSX.Element;
40
+ export default SearchResults;
@@ -0,0 +1,29 @@
1
+ import type { SectionSearch } from "../../../types";
2
+ /** One tab: every section's results (`id` null) or one section's. */
3
+ export interface ResultTab {
4
+ id: string | null;
5
+ label: string;
6
+ /** How the search of what the tab shows stands, and how many it has found. */
7
+ status: SectionSearch["status"];
8
+ count: number;
9
+ }
10
+ interface SearchTabsProps {
11
+ tabs: ResultTab[];
12
+ /** The open tab's id. */
13
+ value: string | null;
14
+ /** Each tab's element id is this, then its place. */
15
+ idPrefix: string;
16
+ /** The id of the panel the tabs show results in. */
17
+ panelId: string;
18
+ onChange: (id: string | null) => void;
19
+ }
20
+ /** The id of the tab at `index`, which names the panel while it's open. */
21
+ export declare const tabId: (idPrefix: string, index: number) => string;
22
+ /**
23
+ * The tabs of a search everywhere's results: every section's, then each section's on its own. They
24
+ * only choose which results show, not which sections are searched, which the search field's
25
+ * sections menu does. One tab stop: Left and Right, Home and End move between the tabs and open
26
+ * them as they go, as a tablist does.
27
+ */
28
+ declare const SearchTabs: ({ tabs, value, idPrefix, panelId, onChange }: SearchTabsProps) => import("react").JSX.Element;
29
+ export default SearchTabs;
@@ -0,0 +1,13 @@
1
+ import type { Section } from "../../../types";
2
+ interface TrashBarProps {
3
+ /** The trash, whose root is open. */
4
+ section: Section;
5
+ /** Asks to confirm emptying the trash; missing when its adapter can't delete. */
6
+ onEmpty?: () => void;
7
+ }
8
+ /**
9
+ * Says what the trash is for, with its own button emptying it, disabled while its listing is empty,
10
+ * hidden entries counting, as they go with it.
11
+ */
12
+ declare const TrashBar: ({ section, onEmpty }: TrashBarProps) => import("react").JSX.Element;
13
+ export default TrashBar;
@@ -0,0 +1,20 @@
1
+ import type { ActionContext, ActionGroup, MenuPosition } from "../../../types";
2
+ export interface MenuState {
3
+ /** False while the menu plays its closing transition; the rest is kept so it doesn't empty mid-fade. */
4
+ open: boolean;
5
+ position: MenuPosition;
6
+ context: ActionContext;
7
+ /** Already narrowed to what applies to `context`. */
8
+ groups: ActionGroup[];
9
+ }
10
+ interface ContextMenuProps {
11
+ menu: MenuState | null;
12
+ onClose: () => void;
13
+ }
14
+ /**
15
+ * The menu of the actions that apply to what was right-clicked, at the point it was opened at. It
16
+ * opens leftwards from its point when the part it was opened in runs right to left
17
+ * (`MenuPosition.rtl`). A right-click outside it closes it, as `Menu` does for every menu.
18
+ */
19
+ declare const ContextMenu: ({ menu, onClose }: ContextMenuProps) => import("react").JSX.Element;
20
+ export default ContextMenu;
@@ -0,0 +1,28 @@
1
+ import type { Clash, ConflictPolicy } from "../../../types";
2
+ interface ConflictMessageProps {
3
+ clashes: Clash[];
4
+ /**
5
+ * The folder the names clash in, or null when they're in several, as a restore's may be, the
6
+ * entries going back to the folders they came from.
7
+ */
8
+ folderName: string | null;
9
+ }
10
+ interface ConflictChoicesProps {
11
+ clashes: Clash[];
12
+ /** The choice being carried out, which shows a spinner; every choice is disabled meanwhile. */
13
+ pending: ConflictPolicy | null;
14
+ onChoose: (conflict: ConflictPolicy) => void;
15
+ }
16
+ /**
17
+ * Says which names a copy, move, upload or restore clashes with, the folder's or each other's, as
18
+ * entries from several folders may share names, and what each choice does to them.
19
+ */
20
+ export declare const ConflictMessage: ({ clashes, folderName }: ConflictMessageProps) => import("react").JSX.Element;
21
+ /**
22
+ * Skip, Replace and Keep both, in that order, with Keep both, which loses nothing, as the main
23
+ * action. Replace reads Merge when it would only merge folders, and is left out when it would do
24
+ * nothing but keep both, as every name clashes with one of the other kind or one that can't be
25
+ * changed.
26
+ */
27
+ export declare const ConflictChoices: ({ clashes, pending, onChoose }: ConflictChoicesProps) => import("react").JSX.Element;
28
+ export {};
@@ -0,0 +1,48 @@
1
+ import type { EntryGroup, FileAdapter } from "../../../types";
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 folders' entries not yet deleted.
46
+ */
47
+ declare const DeleteDialog: ({ open, request, onClose, onChanged, onDone }: DeleteDialogProps) => import("react").JSX.Element;
48
+ export default DeleteDialog;
@@ -0,0 +1,42 @@
1
+ import type { KeyboardEvent, Ref } from "react";
2
+ import type { Room } from "../../../hooks/use-swipe";
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;