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.
Files changed (280) hide show
  1. package/CHANGELOG.md +38 -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/drag/drag-preview.d.ts +24 -0
  9. package/dist/components/file-manager/announcer.d.ts +14 -0
  10. package/dist/components/file-manager/content/file-grid.d.ts +8 -0
  11. package/dist/components/file-manager/content/file-list.d.ts +9 -0
  12. package/dist/components/file-manager/content/folder-view.d.ts +83 -0
  13. package/dist/components/file-manager/content/item-icon.d.ts +16 -0
  14. package/dist/components/file-manager/content/no-sections.d.ts +11 -0
  15. package/dist/components/file-manager/content/search-results.d.ts +40 -0
  16. package/dist/components/file-manager/content/search-tabs.d.ts +29 -0
  17. package/dist/components/file-manager/content/trash-bar.d.ts +13 -0
  18. package/dist/components/file-manager/context-menu/context-menu.d.ts +20 -0
  19. package/dist/components/file-manager/dialogs/conflict-step.d.ts +28 -0
  20. package/dist/components/file-manager/dialogs/delete-dialog.d.ts +49 -0
  21. package/dist/components/file-manager/dialogs/image-viewer.d.ts +42 -0
  22. package/dist/components/file-manager/dialogs/name-dialog.d.ts +41 -0
  23. package/dist/components/file-manager/dialogs/paste-dialog.d.ts +39 -0
  24. package/dist/components/file-manager/dialogs/preview-dialog.d.ts +75 -0
  25. package/dist/components/file-manager/dialogs/restore-dialog.d.ts +41 -0
  26. package/dist/components/file-manager/dialogs/shortcuts-dialog.d.ts +36 -0
  27. package/dist/components/file-manager/dialogs/transfer-dialog.d.ts +71 -0
  28. package/dist/components/file-manager/dialogs/upload-dialog.d.ts +34 -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 +29 -0
  53. package/dist/components/media-manager/asset-hold.d.ts +32 -0
  54. package/dist/components/media-manager/asset-option.d.ts +74 -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 +24 -0
  63. package/dist/components/media-manager/library-list.d.ts +23 -0
  64. package/dist/components/media-manager/media-asset.d.ts +65 -0
  65. package/dist/components/media-manager/media-edit-many.d.ts +33 -0
  66. package/dist/components/media-manager/media-fields.d.ts +31 -0
  67. package/dist/components/media-manager/media-filter-chips.d.ts +17 -0
  68. package/dist/components/media-manager/media-filters-dialog.d.ts +39 -0
  69. package/dist/components/media-manager/media-filters.d.ts +37 -0
  70. package/dist/components/media-manager/media-form.d.ts +29 -0
  71. package/dist/components/media-manager/media-frame.d.ts +77 -0
  72. package/dist/components/media-manager/media-grid.d.ts +114 -0
  73. package/dist/components/media-manager/media-group.d.ts +29 -0
  74. package/dist/components/media-manager/media-header.d.ts +80 -0
  75. package/dist/components/media-manager/media-manager.d.ts +309 -0
  76. package/dist/components/media-manager/media-move.d.ts +30 -0
  77. package/dist/components/media-manager/media-picker.d.ts +140 -0
  78. package/dist/components/media-manager/media-picture.d.ts +26 -0
  79. package/dist/components/media-manager/media-process.d.ts +26 -0
  80. package/dist/components/media-manager/media-row.d.ts +13 -0
  81. package/dist/components/media-manager/media-step.d.ts +33 -0
  82. package/dist/components/media-manager/media-tile.d.ts +15 -0
  83. package/dist/components/media-manager/media-upload.d.ts +46 -0
  84. package/dist/components/media-manager/open-button.d.ts +15 -0
  85. package/dist/components/media-manager/picker-frame.d.ts +33 -0
  86. package/dist/components/media-manager/selection-bar.d.ts +25 -0
  87. package/dist/components/media-manager/upload-tile.d.ts +17 -0
  88. package/dist/components/properties/properties-panel.d.ts +53 -0
  89. package/dist/components/properties/property-display.d.ts +15 -0
  90. package/dist/components/properties/property-editor.d.ts +26 -0
  91. package/dist/components/properties/property-input.d.ts +36 -0
  92. package/dist/components/transfers/transfer-panel.d.ts +25 -0
  93. package/dist/components/ui/backdrop.d.ts +7 -0
  94. package/dist/components/ui/button-base.d.ts +7 -0
  95. package/dist/components/ui/button.d.ts +18 -0
  96. package/dist/components/ui/checkbox.d.ts +24 -0
  97. package/dist/components/ui/chip.d.ts +18 -0
  98. package/dist/components/ui/circular-progress.d.ts +14 -0
  99. package/dist/components/ui/collapse.d.ts +9 -0
  100. package/dist/components/ui/dialog.d.ts +40 -0
  101. package/dist/components/ui/divider.d.ts +4 -0
  102. package/dist/components/ui/icon-button.d.ts +12 -0
  103. package/dist/components/ui/linear-progress.d.ts +13 -0
  104. package/dist/components/ui/link.d.ts +4 -0
  105. package/dist/components/ui/menu.d.ts +77 -0
  106. package/dist/components/ui/root-providers.d.ts +16 -0
  107. package/dist/components/ui/text-field.d.ts +38 -0
  108. package/dist/components/ui/text.d.ts +21 -0
  109. package/dist/components/ui/tooltip.d.ts +24 -0
  110. package/dist/components/uploads/upload-panel.d.ts +31 -0
  111. package/dist/contexts/asset-look-context.d.ts +1 -0
  112. package/dist/contexts/cut-context.d.ts +6 -0
  113. package/dist/contexts/data-context.d.ts +12 -0
  114. package/dist/contexts/direction-context.d.ts +2 -0
  115. package/dist/contexts/drag-context.d.ts +36 -0
  116. package/dist/contexts/icon-context.d.ts +10 -0
  117. package/dist/contexts/locale-context.d.ts +2 -0
  118. package/dist/contexts/moving-context.d.ts +7 -0
  119. package/dist/create-icon-D2vnnBQX.js +40 -0
  120. package/dist/create-icon-D2vnnBQX.js.map +1 -0
  121. package/dist/hooks/use-announcer.d.ts +20 -0
  122. package/dist/hooks/use-asset-look.d.ts +6 -0
  123. package/dist/hooks/use-asset-states.d.ts +12 -0
  124. package/dist/hooks/use-chosen-column.d.ts +16 -0
  125. package/dist/hooks/use-clipboard-follow.d.ts +12 -0
  126. package/dist/hooks/use-controlled.d.ts +18 -0
  127. package/dist/hooks/use-cut-ids.d.ts +3 -0
  128. package/dist/hooks/use-dev-checks.d.ts +16 -0
  129. package/dist/hooks/use-download-queue.d.ts +19 -0
  130. package/dist/hooks/use-dragged-ids.d.ts +3 -0
  131. package/dist/hooks/use-drop-target.d.ts +48 -0
  132. package/dist/hooks/use-entry-drag.d.ts +46 -0
  133. package/dist/hooks/use-files-drop.d.ts +20 -0
  134. package/dist/hooks/use-folder.d.ts +14 -0
  135. package/dist/hooks/use-fork-ref.d.ts +6 -0
  136. package/dist/hooks/use-form-send.d.ts +12 -0
  137. package/dist/hooks/use-found.d.ts +10 -0
  138. package/dist/hooks/use-icon-config.d.ts +2 -0
  139. package/dist/hooks/use-level-filters.d.ts +112 -0
  140. package/dist/hooks/use-level-search.d.ts +21 -0
  141. package/dist/hooks/use-locale.d.ts +10 -0
  142. package/dist/hooks/use-location-history.d.ts +42 -0
  143. package/dist/hooks/use-long-press.d.ts +25 -0
  144. package/dist/hooks/use-marquee.d.ts +35 -0
  145. package/dist/hooks/use-match-count.d.ts +8 -0
  146. package/dist/hooks/use-media-search.d.ts +44 -0
  147. package/dist/hooks/use-moving-ids.d.ts +3 -0
  148. package/dist/hooks/use-picks.d.ts +39 -0
  149. package/dist/hooks/use-preview-contents.d.ts +33 -0
  150. package/dist/hooks/use-properties.d.ts +25 -0
  151. package/dist/hooks/use-scroll-measure.d.ts +34 -0
  152. package/dist/hooks/use-search.d.ts +12 -0
  153. package/dist/hooks/use-selection.d.ts +29 -0
  154. package/dist/hooks/use-setting.d.ts +21 -0
  155. package/dist/hooks/use-stable-set.d.ts +6 -0
  156. package/dist/hooks/use-swipe.d.ts +41 -0
  157. package/dist/hooks/use-text-direction.d.ts +8 -0
  158. package/dist/hooks/use-thumbnail.d.ts +8 -0
  159. package/dist/hooks/use-transfer-queue.d.ts +22 -0
  160. package/dist/hooks/use-tree-rows.d.ts +9 -0
  161. package/dist/hooks/use-tree-selection.d.ts +19 -0
  162. package/dist/hooks/use-type-ahead.d.ts +9 -0
  163. package/dist/hooks/use-type-icons.d.ts +10 -0
  164. package/dist/hooks/use-upload-queue.d.ts +24 -0
  165. package/dist/hooks/use-virtual-lines.d.ts +27 -0
  166. package/dist/hooks/use-virtual-rows.d.ts +31 -0
  167. package/dist/hooks/use-wheel-zoom.d.ts +10 -0
  168. package/dist/icon-sets/filled.d.ts +6 -0
  169. package/dist/icon-sets/filled.js +76 -0
  170. package/dist/icon-sets/filled.js.map +1 -0
  171. package/dist/icon-sets/outlined.d.ts +6 -0
  172. package/dist/icon-sets/outlined.js +73 -0
  173. package/dist/icon-sets/outlined.js.map +1 -0
  174. package/dist/icon-sets/rounded.d.ts +6 -0
  175. package/dist/icon-sets/rounded.js +73 -0
  176. package/dist/icon-sets/rounded.js.map +1 -0
  177. package/dist/icon-sets/sharp.d.ts +6 -0
  178. package/dist/icon-sets/sharp.js +73 -0
  179. package/dist/icon-sets/sharp.js.map +1 -0
  180. package/dist/icon-sets/two-tone.d.ts +6 -0
  181. package/dist/icon-sets/two-tone.js +188 -0
  182. package/dist/icon-sets/two-tone.js.map +1 -0
  183. package/dist/index.d.ts +18 -0
  184. package/dist/index.js +32651 -0
  185. package/dist/index.js.map +1 -0
  186. package/dist/locales/en-us.d.ts +7 -0
  187. package/dist/store/download-queue.d.ts +37 -0
  188. package/dist/store/folder-store.d.ts +79 -0
  189. package/dist/store/keyboard-layout.d.ts +11 -0
  190. package/dist/store/properties-cache.d.ts +73 -0
  191. package/dist/store/thumbnail-cache.d.ts +30 -0
  192. package/dist/store/transfer-across.d.ts +24 -0
  193. package/dist/store/transfer-queue.d.ts +59 -0
  194. package/dist/store/upload-queue.d.ts +83 -0
  195. package/dist/styles/arrived.d.ts +6 -0
  196. package/dist/styles/classes.d.ts +212 -0
  197. package/dist/styles/layout.d.ts +55 -0
  198. package/dist/styles/media-layout.d.ts +36 -0
  199. package/dist/styles/order.d.ts +1 -0
  200. package/dist/styles.css +7632 -0
  201. package/dist/styles.layer.css +7634 -0
  202. package/dist/types/action.d.ts +296 -0
  203. package/dist/types/adapter.d.ts +922 -0
  204. package/dist/types/api.d.ts +192 -0
  205. package/dist/types/clipboard.d.ts +45 -0
  206. package/dist/types/download.d.ts +41 -0
  207. package/dist/types/drag.d.ts +57 -0
  208. package/dist/types/folder.d.ts +47 -0
  209. package/dist/types/icon.d.ts +20 -0
  210. package/dist/types/index.d.ts +27 -0
  211. package/dist/types/limits.d.ts +49 -0
  212. package/dist/types/locale.d.ts +1132 -0
  213. package/dist/types/main-menu.d.ts +20 -0
  214. package/dist/types/media.d.ts +631 -0
  215. package/dist/types/menu.d.ts +82 -0
  216. package/dist/types/navigation.d.ts +88 -0
  217. package/dist/types/preview.d.ts +54 -0
  218. package/dist/types/previewer.d.ts +67 -0
  219. package/dist/types/properties.d.ts +111 -0
  220. package/dist/types/property-definition.d.ts +286 -0
  221. package/dist/types/search.d.ts +46 -0
  222. package/dist/types/section.d.ts +98 -0
  223. package/dist/types/selection.d.ts +52 -0
  224. package/dist/types/slots.d.ts +218 -0
  225. package/dist/types/transfer.d.ts +68 -0
  226. package/dist/types/tree.d.ts +97 -0
  227. package/dist/types/undo.d.ts +133 -0
  228. package/dist/types/upload.d.ts +189 -0
  229. package/dist/types/view.d.ts +192 -0
  230. package/dist/utils/action-groups.d.ts +17 -0
  231. package/dist/utils/bidi.d.ts +15 -0
  232. package/dist/utils/clipboard.d.ts +30 -0
  233. package/dist/utils/cx.d.ts +2 -0
  234. package/dist/utils/dom.d.ts +36 -0
  235. package/dist/utils/download.d.ts +30 -0
  236. package/dist/utils/field-errors.d.ts +26 -0
  237. package/dist/utils/files.d.ts +48 -0
  238. package/dist/utils/format.d.ts +10 -0
  239. package/dist/utils/groups.d.ts +29 -0
  240. package/dist/utils/hidden.d.ts +3 -0
  241. package/dist/utils/keyboard.d.ts +21 -0
  242. package/dist/utils/limits.d.ts +7 -0
  243. package/dist/utils/media.d.ts +146 -0
  244. package/dist/utils/menu-position.d.ts +13 -0
  245. package/dist/utils/names.d.ts +21 -0
  246. package/dist/utils/navigation.d.ts +28 -0
  247. package/dist/utils/path.d.ts +33 -0
  248. package/dist/utils/permissions.d.ts +56 -0
  249. package/dist/utils/preview.d.ts +27 -0
  250. package/dist/utils/property-value.d.ts +41 -0
  251. package/dist/utils/resize.d.ts +2 -0
  252. package/dist/utils/search.d.ts +24 -0
  253. package/dist/utils/sections.d.ts +11 -0
  254. package/dist/utils/selection.d.ts +30 -0
  255. package/dist/utils/sets.d.ts +2 -0
  256. package/dist/utils/shortcut.d.ts +74 -0
  257. package/dist/utils/slots.d.ts +15 -0
  258. package/dist/utils/sort.d.ts +47 -0
  259. package/dist/utils/transfer.d.ts +48 -0
  260. package/dist/utils/trash.d.ts +25 -0
  261. package/dist/utils/undo.d.ts +63 -0
  262. package/dist/utils/zoom.d.ts +14 -0
  263. package/docs/README.md +55 -0
  264. package/docs/actions.md +301 -0
  265. package/docs/adapter.md +229 -0
  266. package/docs/copy-move-trash-undo.md +97 -0
  267. package/docs/customizing.md +247 -0
  268. package/docs/getting-started.md +168 -0
  269. package/docs/locale-and-rtl.md +58 -0
  270. package/docs/media-manager.md +498 -0
  271. package/docs/previewing.md +124 -0
  272. package/docs/properties.md +125 -0
  273. package/docs/recipes/in-memory-adapter.md +149 -0
  274. package/docs/recipes/rest-adapter.md +225 -0
  275. package/docs/recipes/s3-adapter.md +137 -0
  276. package/docs/search.md +73 -0
  277. package/docs/sections.md +119 -0
  278. package/docs/state-and-api.md +190 -0
  279. package/docs/uploads-and-downloads.md +144 -0
  280. package/package.json +90 -4
@@ -0,0 +1,320 @@
1
+ import type { ComponentPropsWithoutRef, Ref } from "react";
2
+ import type { ActionContext, ActionGroup, FileAdapter, FileEntry, FileManagerApi, FileManagerLimits, FileManagerLocaleText, FileManagerLocation, FileManagerSearch, FileManagerSlotProps, FileManagerSlots, FilePreviewer, LocationChangeReason, MainMenuGroup, Section, SectionFolder, SectionGroup, SelectionDetails, SortOrder, ViewMode, ViewZoom } from "../../types/index.js";
3
+ type RootAttributes = Omit<ComponentPropsWithoutRef<"div">, "title" | "children">;
4
+ interface BaseProps extends RootAttributes {
5
+ /** Backend for every section that doesn't bring its own. */
6
+ adapter: FileAdapter;
7
+ /** Context menu actions, in groups. */
8
+ actions?: ActionGroup[];
9
+ /**
10
+ * Actions in the preview's header, in groups, for the file it shows: as an `ActionContext` for
11
+ * that one file, in its folder, with `closePreview` for an action taking the user elsewhere,
12
+ * such as an editor of the app's own. Those with an icon show as buttons, four at most, while
13
+ * the header has room, and the rest in its "More actions" menu, as do all of them on a narrow
14
+ * screen. A `shortcut` works while the preview is open, after its own keys. The same action
15
+ * objects can be in `actions` too. Opening a dialog from one, to rename or delete the file,
16
+ * opens it over the preview, which follows what it did.
17
+ */
18
+ previewActions?: ActionGroup[];
19
+ /**
20
+ * Actions in the properties panel's header, in groups, for what it shows: its entries, as in
21
+ * the context menu, or with none, the folder it shows (`target` "folder"). Shown as the
22
+ * preview's are, two as buttons at most. None show for a search's results from several folders.
23
+ * A `shortcut` works while the focus is in the panel.
24
+ */
25
+ propertiesActions?: ActionGroup[];
26
+ /**
27
+ * Previewers of the app's own, for the kinds of files the preview doesn't show by itself, or
28
+ * shows otherwise: highlighted code, rendered Markdown, office documents, what's in an archive,
29
+ * formats the browser can't draw. Each says which files it takes, and is asked in order before
30
+ * the file manager's own previews. The file manager builds none in, so an app only carries the
31
+ * libraries it chooses.
32
+ */
33
+ previewers?: FilePreviewer[];
34
+ /**
35
+ * The sidebar's main menu, in groups, for what belongs to the app rather than to entries, such
36
+ * as preferences, help or about. The file manager adds "Keyboard shortcuts" after them. An
37
+ * item's `shortcut` works anywhere in the file manager, and shows in the keyboard shortcuts
38
+ * window with the actions' shortcuts.
39
+ */
40
+ mainMenu?: MainMenuGroup[];
41
+ /** Shown at the top of the sidebar; `localeText.sidebarTitle`, "Files" in English, when omitted. */
42
+ title?: string;
43
+ /**
44
+ * Actions in the header bar, in groups, for the content's selection, or with nothing selected,
45
+ * the open folder itself (`target` "folder"), as an `ActionContext`, as the context menu's
46
+ * actions get it: so an Upload or New folder button shows by `visible: (context) =>
47
+ * context.target === "folder"`, and a Share button only for a selection. Those with an icon show
48
+ * as buttons, two at most, before the view's own buttons, while the file manager is 900px wide or
49
+ * more, and the rest in a "More actions" menu, as do all of them below that. A search
50
+ * everywhere's results show them for their selection, and none with nothing selected, as they
51
+ * have no folder of their own. A `shortcut` works anywhere in the file manager outside a field,
52
+ * after the content's and the tree's own shortcuts, as a main menu item's does, and shows in the
53
+ * keyboard shortcuts window. The same action objects can be in `actions` too.
54
+ */
55
+ headerActions?: ActionGroup[];
56
+ /**
57
+ * Parts of the app's own, drawn in place of the file manager's or where it keeps room for them:
58
+ * the content's states (`empty`, `noResults`, `error`, `loading`, `noSections`) and a
59
+ * `sidebarFooter`. Each is a component; keep them outside the app's own component, as one made
60
+ * while rendering starts over every time. See `FileManagerSlots`.
61
+ */
62
+ slots?: FileManagerSlots;
63
+ /**
64
+ * Attributes for the file manager's parts, `sidebar`, `header`, `content`, `properties`, and
65
+ * `entry`, each row and tile, or a function giving each its own: utility classes, `data-*` for
66
+ * tests, handlers. What a part sets itself stays its own (see `SlotAttributes`). Keep the object
67
+ * outside the app's component, or memoized: a new `entry` draws every row and tile again.
68
+ */
69
+ slotProps?: FileManagerSlotProps;
70
+ /**
71
+ * How old, in ms, a folder's listing may be before opening the folder lists it again. Listings
72
+ * are saved, so a folder opened again, in the content, the sidebar tree or the "Move to…" and
73
+ * "Copy to…" picker, shows at once, and is listed again in the background meanwhile, so what
74
+ * changed elsewhere, by another user or in another tab, shows without a refresh. A listing that
75
+ * comes back as it was changes nothing on screen. 0, the default, lists a folder again every
76
+ * time it opens; `Infinity` never does, for a backend where listing costs, leaving changes made
77
+ * elsewhere to `apiRef.refresh`. Changes made through the file manager show either way.
78
+ */
79
+ relistAfter?: number;
80
+ /**
81
+ * How much the file manager does at once and keeps, for a backend that takes more, or less,
82
+ * than the defaults: uploads, downloads, copies and moves, and thumbnails asked for at once,
83
+ * thumbnails and listings kept while nothing shows them, and how long the typing stops before
84
+ * a search everywhere. Each is left to its default when omitted, and a change takes effect at
85
+ * once: more at once starts what's waiting, less lets what's under way finish, and fewer kept
86
+ * drops what's beyond them.
87
+ */
88
+ limits?: FileManagerLimits;
89
+ /**
90
+ * Where the file manager is, for a consumer that keeps it, e.g. in the URL. Every change, the
91
+ * user's and the file manager's own, is asked for through `onLocationChange`. A location in a
92
+ * section the file manager doesn't have shows the first section's root, which is asked for as
93
+ * "replace". The back and forward history stays the file manager's: a location that's where
94
+ * back or forward leads counts as going there, so the two keep in step with a browser's whose
95
+ * buttons set it.
96
+ */
97
+ location?: FileManagerLocation;
98
+ /**
99
+ * Where the file manager opens, when it keeps the location itself; the first section's root when
100
+ * omitted. One in a section it doesn't have opens that root too, told as "replace".
101
+ */
102
+ defaultLocation?: FileManagerLocation;
103
+ /**
104
+ * Told every change of the location as it's made, or asked for with `location`, with why: the
105
+ * user went somewhere, back or forward, or the place was rewritten in place, as when the folder
106
+ * it was in was renamed or deleted, which a URL kept in step replaces rather than pushes.
107
+ */
108
+ onLocationChange?: (location: FileManagerLocation, reason: LocationChangeReason) => void;
109
+ /** The content's view, for a consumer that keeps it, e.g. across reloads. */
110
+ view?: ViewMode;
111
+ /** The view at first, when the file manager keeps it; "list" when omitted. */
112
+ defaultView?: ViewMode;
113
+ /** Told the view the user switches to, with the header's button. */
114
+ onViewChange?: (view: ViewMode) => void;
115
+ /**
116
+ * How far the list and the grid are each zoomed, in steps from the size they start at, for a
117
+ * consumer that keeps it. Zooming in makes icons, thumbnails and rows or tiles larger, and the
118
+ * text stays as it is.
119
+ */
120
+ zoom?: ViewZoom;
121
+ /** The zoom at first, when the file manager keeps it; both views at their start (0) when omitted. */
122
+ defaultZoom?: ViewZoom;
123
+ /**
124
+ * Told the zoom the user picks, with Ctrl+plus, Ctrl+minus and Ctrl+0 (⌘ on macOS) or Ctrl+wheel
125
+ * in the content, which then zoom it rather than the page, or with the view options menu.
126
+ */
127
+ onZoomChange?: (zoom: ViewZoom) => void;
128
+ /**
129
+ * The content's order, for a consumer that keeps it. Kept across folders. The sidebar tree and
130
+ * the "Move to…" and "Copy to…" picker always go by name.
131
+ */
132
+ sort?: SortOrder;
133
+ /**
134
+ * The order at first, when the file manager keeps it; relevance when omitted, which orders a
135
+ * search everywhere's results by how well their names answer what's typed and folders by name,
136
+ * A to Z.
137
+ */
138
+ defaultSort?: SortOrder;
139
+ /** Told the order the user picks, in the view options menu or the list's column headers. */
140
+ onSortChange?: (sort: SortOrder) => void;
141
+ /**
142
+ * Whether hidden entries show, in the content, the sidebar tree and the picker, for a consumer
143
+ * that keeps it. What's hidden is `FileEntry.hidden`, or else a name starting with a dot.
144
+ */
145
+ showHidden?: boolean;
146
+ /** Whether hidden entries show at first, when the file manager keeps it; false when omitted. */
147
+ defaultShowHidden?: boolean;
148
+ /** Told when the user shows or hides hidden entries, with Ctrl+H or the view options menu. */
149
+ onShowHiddenChange?: (showHidden: boolean) => void;
150
+ /**
151
+ * Whether the sidebar is hidden while there's room to dock it, for a consumer that keeps it.
152
+ * Narrower, it's an overlay the header's button opens either way.
153
+ */
154
+ sidebarHidden?: boolean;
155
+ /** Whether the docked sidebar is hidden at first, when the file manager keeps it; false when omitted. */
156
+ defaultSidebarHidden?: boolean;
157
+ /**
158
+ * Told when the user hides or shows the docked sidebar, with F9, the view options menu or, while
159
+ * it's hidden, the header's "Show sidebar" button.
160
+ */
161
+ onSidebarHiddenChange?: (sidebarHidden: boolean) => void;
162
+ /**
163
+ * How wide the docked sidebar is, in px, for a consumer that keeps it, from 200 to 360. It's
164
+ * narrower while the content beside it needs the room, and the overlay shown where there's no
165
+ * room to dock it isn't resized.
166
+ */
167
+ sidebarWidth?: number;
168
+ /** How wide the docked sidebar is at first, when the file manager keeps it; 248 when omitted. */
169
+ defaultSidebarWidth?: number;
170
+ /**
171
+ * Told when the user resizes the docked sidebar by its edge: as a drag of it ends, a step at a
172
+ * time with the arrow keys on it, with Home and End, or put back to `defaultSidebarWidth` (or
173
+ * 248) with a double click.
174
+ */
175
+ onSidebarWidthChange?: (sidebarWidth: number) => void;
176
+ /**
177
+ * Whether the properties panel shows beside the content while there's room to dock it, for a
178
+ * consumer that keeps it. It shows the content's selection, or the open folder while nothing is
179
+ * selected, and follows the selection. Narrower, it opens over the content instead, with
180
+ * Alt+Enter, the view options menu or `ActionContext.properties`, and closes as the user moves on.
181
+ */
182
+ propertiesOpen?: boolean;
183
+ /** Whether the docked properties show at first, when the file manager keeps it; false when omitted. */
184
+ defaultPropertiesOpen?: boolean;
185
+ /**
186
+ * Told when the user shows or hides the docked properties, with Alt+Enter, the view options menu,
187
+ * the panel's close button or `ActionContext.properties`.
188
+ */
189
+ onPropertiesOpenChange?: (propertiesOpen: boolean) => void;
190
+ /**
191
+ * How wide the docked properties panel is, in px, for a consumer that keeps it, from 240 to 480.
192
+ * It's narrower while the content beside it needs the room, and the overlay shown where there's
193
+ * no room to dock isn't resized.
194
+ */
195
+ propertiesWidth?: number;
196
+ /** How wide the docked properties are at first, when the file manager keeps it; 300 when omitted. */
197
+ defaultPropertiesWidth?: number;
198
+ /**
199
+ * Told when the user resizes the docked properties by their edge: as a drag of it ends, a step at
200
+ * a time with the arrow keys on it, with Home and End, or put back to `defaultPropertiesWidth` (or
201
+ * 300) with a double click.
202
+ */
203
+ onPropertiesWidthChange?: (propertiesWidth: number) => void;
204
+ /**
205
+ * Folders expanded in the sidebar tree, for a consumer that keeps them, e.g. across reloads. A
206
+ * section's own row is its root folder. Only the chevrons, Right and Left on a row, and a drag
207
+ * resting on a collapsed row change them, never going somewhere. A folder the tree doesn't show,
208
+ * below a collapsed one or in a section that's gone, stays as it is, to show expanded again.
209
+ */
210
+ expandedFolders?: readonly SectionFolder[];
211
+ /**
212
+ * Folders expanded at first, when the file manager keeps them; when omitted, the section the
213
+ * file manager opens in, if it shows its folders.
214
+ */
215
+ defaultExpandedFolders?: readonly SectionFolder[];
216
+ /** Told the folders expanded as the user expands or collapses one. */
217
+ onExpandedFoldersChange?: (folders: SectionFolder[]) => void;
218
+ /**
219
+ * The search field, for a consumer that keeps it: what it searches and what's typed, or null
220
+ * while it's closed. Every change the user makes is asked for through `onSearchChange`: opening
221
+ * it, typing, switching between the open folder and every section, and closing it. Opening any
222
+ * other folder ends the search, which is asked for as null, however the folder is opened,
223
+ * including by a `location` the consumer changes. A `"everywhere"` scope with no section whose
224
+ * adapter has `search` searches the open folder.
225
+ */
226
+ search?: FileManagerSearch | null;
227
+ /** The search at first, when the file manager keeps it; null (closed) when omitted. */
228
+ defaultSearch?: FileManagerSearch | null;
229
+ /** Told every change of the search as it's made, or asked for with `search`; null when it closes. */
230
+ onSearchChange?: (search: FileManagerSearch | null) => void;
231
+ /**
232
+ * Ids of the sections a search everywhere leaves out (the sections menu's unchecked ones), for a
233
+ * consumer that keeps them. Ids of sections that are gone or can't be searched don't count, and
234
+ * leaving out every section counts as leaving out none. A section added later is searched.
235
+ */
236
+ searchExcludedSections?: readonly string[];
237
+ /** The sections left out at first, when the file manager keeps them; none when omitted. */
238
+ defaultSearchExcludedSections?: readonly string[];
239
+ /** Told the sections left out as the user checks or unchecks one in the sections menu. */
240
+ onSearchExcludedSectionsChange?: (sectionIds: string[]) => void;
241
+ /**
242
+ * Ids of the entries selected in the open folder's content, for a consumer that keeps them.
243
+ * Every folder opens with nothing selected: going somewhere from inside the file manager asks
244
+ * for an empty selection, while a `location` changed by the consumer leaves the selection to them,
245
+ * so they can open a folder with an entry selected. Ids the folder doesn't list drop out once all
246
+ * of it has come. Ids set other than through `onSelectionChange` are revealed: the first of their
247
+ * entries is scrolled to, and takes the content's focus, or its Tab stop when the focus is
248
+ * elsewhere. The sidebar tree's selection is its own.
249
+ */
250
+ selectedIds?: readonly string[];
251
+ /**
252
+ * Ids selected in the folder the file manager opens in, when it keeps the selection, revealed as
253
+ * `selectedIds` are, e.g. to show a file in its folder.
254
+ */
255
+ defaultSelectedIds?: readonly string[];
256
+ /**
257
+ * Told the content's selection as it changes: the ids, to pass back as `selectedIds`, and the
258
+ * selected entries listed, which is what to act on. It also changes as the folder's listing
259
+ * does, e.g. a selected entry deleted elsewhere, and empties as another folder opens.
260
+ */
261
+ onSelectionChange?: (ids: string[], details: SelectionDetails) => void;
262
+ /**
263
+ * What opening a file does, by double-clicking, tapping or pressing Enter on it, or with
264
+ * `ActionContext.open`, e.g. opening it in an editor of the consumer's. Return false to leave a
265
+ * file to the preview, e.g. one of a type there's no editor for. Without it, a file opens in the
266
+ * preview, when the adapter has `content` or a previewer reading nothing takes it, and
267
+ * `ActionContext.open` is missing for files, since it would only do what `preview` does. From
268
+ * the preview's header, `open` closes the preview unless this returns false.
269
+ */
270
+ onOpenFile?: (entry: FileEntry, context: ActionContext) => boolean | void;
271
+ /**
272
+ * The component's own text, for another language or other wording. Keys left out stay in
273
+ * English, as `enUS` has them. A new object with the same texts is fine, but functions written
274
+ * inline are new each render and make every row render again, so keep those outside the
275
+ * component or memoize the object.
276
+ */
277
+ localeText?: Partial<FileManagerLocaleText>;
278
+ /**
279
+ * The BCP 47 language tag, such as "de" or "fa-IR", that numbers, sizes and dates are written
280
+ * in and names are sorted and matched by. The browser's language when omitted. It changes no
281
+ * text: that's `localeText`.
282
+ */
283
+ locale?: string;
284
+ /**
285
+ * Takes the `FileManagerApi`, for going somewhere, listing folders again, showing an entry in
286
+ * its folder, downloading, running the context menu's operations, searching or moving the focus
287
+ * in, from outside.
288
+ */
289
+ apiRef?: Ref<FileManagerApi>;
290
+ /** The root element, which fills the box it's placed in. */
291
+ ref?: Ref<HTMLDivElement>;
292
+ /**
293
+ * Styles the root element, over its own, e.g. to size it. It fills its container by default,
294
+ * and lays itself out by its own width (container queries), not the viewport's.
295
+ */
296
+ className?: string;
297
+ }
298
+ interface MultiSectionProps extends BaseProps {
299
+ /** Sidebar sections, in groups. Each section is an independent root. */
300
+ sections: SectionGroup[];
301
+ section?: never;
302
+ }
303
+ interface SingleSectionProps extends BaseProps {
304
+ /**
305
+ * The one root to browse. The sidebar shows its folders as the tree itself, with no section
306
+ * row above them, unless the section sets `showFolders: false`.
307
+ */
308
+ section: Section;
309
+ sections?: never;
310
+ }
311
+ /**
312
+ * Either `sections`, for a sidebar of independent roots, or a single `section`. Both may change
313
+ * after mounting: a section that goes takes its places out of the history, the open one going to
314
+ * the first section's root, and one rooted elsewhere or served by another adapter goes back to its
315
+ * root, its listings dropped when the adapter changed. So does every section served by the
316
+ * file manager's `adapter`, when that changes.
317
+ */
318
+ export type FileManagerProps = MultiSectionProps | SingleSectionProps;
319
+ declare const FileManager: ({ adapter, sections: groups, section: singleSection, actions, previewActions, propertiesActions, previewers, mainMenu, title, headerActions, slots, slotProps, relistAfter, limits, location: locationProp, defaultLocation, onLocationChange, view: viewProp, defaultView, onViewChange, zoom: zoomProp, defaultZoom, onZoomChange, sort: sortProp, defaultSort, onSortChange, showHidden: showHiddenProp, defaultShowHidden, onShowHiddenChange, sidebarHidden: sidebarHiddenProp, defaultSidebarHidden, onSidebarHiddenChange, sidebarWidth: sidebarWidthProp, defaultSidebarWidth, onSidebarWidthChange, propertiesOpen: propertiesOpenProp, defaultPropertiesOpen, onPropertiesOpenChange, propertiesWidth: propertiesWidthProp, defaultPropertiesWidth, onPropertiesWidthChange, expandedFolders: expandedFoldersProp, defaultExpandedFolders, onExpandedFoldersChange, search: searchProp, defaultSearch, onSearchChange, searchExcludedSections: searchExcludedProp, defaultSearchExcludedSections, onSearchExcludedSectionsChange, selectedIds: selectedIdsProp, defaultSelectedIds, onSelectionChange, onOpenFile, localeText, locale, apiRef, ref, className, onKeyDown, onDragEnter, onDragOver, onDragLeave, onDrop, onDragEnd, onPointerDownCapture, ...rootAttributes }: FileManagerProps) => import("react").JSX.Element;
320
+ export default FileManager;
@@ -0,0 +1,29 @@
1
+ interface FindLayerProps {
2
+ /** The names to find, by the index of the row each is for: a folder's entries, the tree's rows. */
3
+ names: readonly string[];
4
+ /** Called with the index of the name the browser's find in page has come to. */
5
+ onFound: (index: number) => void;
6
+ }
7
+ interface DrawnNameProps {
8
+ name: string;
9
+ }
10
+ /**
11
+ * Every row's name, for the browser's find in page, when the view renders only the rows in or near
12
+ * view (see `virtualization.md`). The names are `hidden="until-found"`, which the browser's find
13
+ * looks in, telling the page what it came to (`beforematch`) before it shows it: the layer hides
14
+ * it again, so the next is found the same way, and hands the view its index, for the view to
15
+ * scroll to the row, give it the Tab stop, and highlight it for a moment, as the browser's own
16
+ * highlight is in the layer, where it doesn't show. The rows draw their names with `DrawnName`, so
17
+ * each is found once, in the rows' order.
18
+ *
19
+ * The layer is built outside React, as React writes `hidden` as true or false only, in goes of a
20
+ * few ms so a folder of thousands doesn't hold the page up, and only blocks whose names changed
21
+ * are built again. It's hidden from screen readers, which hear the rows.
22
+ */
23
+ declare const FindLayer: ({ names, onFound }: FindLayerProps) => import("react").JSX.Element | null;
24
+ /**
25
+ * A row's name, drawn rather than written where the browser finds names in a `FindLayer`, so it
26
+ * isn't found twice; screen readers still read it. Written in a `<bdi>` elsewhere.
27
+ */
28
+ export declare const DrawnName: ({ name }: DrawnNameProps) => import("react").JSX.Element;
29
+ export default FindLayer;
@@ -0,0 +1,65 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ import type { HistoryStop, SearchScope, SlotAttributes, SortOrder, ToolbarGroup, ViewMode, ViewZoom, ZoomStep } from "../../../types/index.js";
3
+ type HistoryDirection = "back" | "forward";
4
+ interface HeaderBarProps {
5
+ /** Centre slot, the path bar, or the search field while searching. */
6
+ pathBar: ReactNode;
7
+ canGoBack: boolean;
8
+ canGoForward: boolean;
9
+ /** Whether a folder is open, which the folder search and selection mode need. */
10
+ hasFolder: boolean;
11
+ view: ViewMode;
12
+ zoom: ViewZoom;
13
+ sort: SortOrder;
14
+ /** Whether a search everywhere's results show, which the view menu can order by relevance. */
15
+ resultsShown: boolean;
16
+ /** Whether the trash's root shows, whose date the view menu names by when entries were moved there. */
17
+ trashShown: boolean;
18
+ showHidden: boolean;
19
+ /** Whether touch selection mode is on. */
20
+ selecting: boolean;
21
+ /** What the search field in the path bar's place searches, or null while it isn't there. */
22
+ searchScope: SearchScope | null;
23
+ /** Whether any section can be searched everywhere, without which its button isn't there. */
24
+ canSearchEverywhere: boolean;
25
+ /** Whether the docked sidebar is hidden. */
26
+ sidebarHidden: boolean;
27
+ /** Whether the sidebar docks at the moment, rather than collapsing, as container queries decide. */
28
+ sidebarDocked: () => boolean;
29
+ /** Whether the docked properties show. */
30
+ propertiesOpen: boolean;
31
+ /** Whether the properties dock at the moment, rather than opening over the content. */
32
+ propertiesDocked: () => boolean;
33
+ onBack: () => void;
34
+ onForward: () => void;
35
+ /** The places back or forward lead to, nearest first, read as their list opens. */
36
+ historyStops: (direction: HistoryDirection) => HistoryStop[];
37
+ /** Goes `by` places through the history (negative is back), from its list. */
38
+ onGoInHistory: (by: number) => void;
39
+ onToggleView: () => void;
40
+ /** Zooms the view shown a step in or out, or back to its start. */
41
+ onZoom: (step: ZoomStep) => void;
42
+ onSortChange: (sort: SortOrder) => void;
43
+ onToggleHidden: () => void;
44
+ onToggleSelecting: () => void;
45
+ /** Opens a search with this scope, switches to it, or closes it when it's the open one. */
46
+ onSearch: (scope: SearchScope) => void;
47
+ /** Opens the collapsed sidebar, or shows the hidden docked one. */
48
+ onShowSidebar: () => void;
49
+ /** Opens the sidebar for a drag that rests on the button that shows it, until the drag ends. */
50
+ onDragShowSidebar: () => void;
51
+ /** Hides or shows the docked sidebar. */
52
+ onToggleSidebar: () => void;
53
+ /** Shows or hides the docked properties. */
54
+ onToggleProperties: () => void;
55
+ /** Opens the properties over the content, giving the focus back to `opener` as they close. */
56
+ onOpenProperties: (opener: HTMLElement | null) => void;
57
+ /** The button that shows the sidebar, which takes the focus back when the overlay closes. */
58
+ sidebarButtonRef?: Ref<HTMLButtonElement>;
59
+ /** The app's `headerActions`, bound to the content's selection or the open folder. */
60
+ actions: readonly ToolbarGroup[];
61
+ /** The app's attributes for the header (`slotProps.header`). */
62
+ attributes?: SlotAttributes;
63
+ }
64
+ declare const HeaderBar: ({ pathBar, canGoBack, canGoForward, hasFolder, view, zoom, sort, resultsShown, trashShown, showHidden, selecting, searchScope, canSearchEverywhere, sidebarHidden, sidebarDocked, propertiesOpen, propertiesDocked, onBack, onForward, historyStops, onGoInHistory, onToggleView, onZoom, onSortChange, onToggleHidden, onToggleSelecting, onSearch, onShowSidebar, onDragShowSidebar, onToggleSidebar, onToggleProperties, onOpenProperties, sidebarButtonRef, actions, attributes, }: HeaderBarProps) => import("react").JSX.Element;
65
+ export default HeaderBar;
@@ -0,0 +1,18 @@
1
+ import type { HistoryStop } from "../../../types/index.js";
2
+ interface HistoryMenuProps {
3
+ open: boolean;
4
+ /** The back or forward button the list hangs from, kept while the menu fades out. */
5
+ anchor: HTMLElement;
6
+ /** Names the list for screen readers. */
7
+ label: string;
8
+ /** The places the button leads to, nearest first. */
9
+ stops: HistoryStop[];
10
+ onPick: (by: number) => void;
11
+ onClose: () => void;
12
+ }
13
+ /**
14
+ * The places back or forward lead to, nearest first, opened by right-clicking or long-pressing the
15
+ * button, as GNOME Files shows them. Picking one goes straight there.
16
+ */
17
+ declare const HistoryMenu: ({ open, anchor, label, stops, onPick, onClose }: HistoryMenuProps) => import("react").JSX.Element;
18
+ export default HistoryMenu;
@@ -0,0 +1,19 @@
1
+ import type { FileManagerLocation, FolderRef, OpenMenu, Section } from "../../../types/index.js";
2
+ interface PathBarProps {
3
+ section: Section;
4
+ trail: FolderRef[];
5
+ hasActions: boolean;
6
+ onNavigate: (place: FileManagerLocation) => void;
7
+ onOpenMenu: OpenMenu;
8
+ /**
9
+ * Types a path in the bar's place, from a press on its empty space or the touch screens' button.
10
+ * Without it, the bar has neither, as in the transfer picker.
11
+ */
12
+ onEdit?: () => void;
13
+ }
14
+ /**
15
+ * The section's name first, then the folders opened below its root. Its empty space, Ctrl+L and, on
16
+ * touch screens, a button edit the path.
17
+ */
18
+ declare const PathBar: ({ section, trail, hasActions, onNavigate, onOpenMenu, onEdit }: PathBarProps) => import("react").JSX.Element;
19
+ export default PathBar;
@@ -0,0 +1,23 @@
1
+ import type { RefObject } from "react";
2
+ interface PathFieldProps {
3
+ /** The path it starts with, the open folder's. */
4
+ initial: string;
5
+ inputRef: RefObject<HTMLInputElement | null>;
6
+ /**
7
+ * Goes where a typed path leads. Resolves with why it can't, or null once it has gone, which
8
+ * ends the field. The signal aborts when the field goes first.
9
+ */
10
+ onGo: (typed: string, signal: AbortSignal) => Promise<string | null>;
11
+ /** Escape, or ✕, which give the focus back. */
12
+ onClose: () => void;
13
+ /** The focus going elsewhere, where it stays. */
14
+ onDismiss: () => void;
15
+ }
16
+ /**
17
+ * The path field, shown in the path bar's place to type a path in and go there. It starts with the
18
+ * open folder's path selected, and Enter looks for where the path leads, shown by a spinner while
19
+ * the adapters' listings are asked, then closes the field once there, or says why it can't under the
20
+ * field, keeping what's typed to put right. It goes when the focus leaves it.
21
+ */
22
+ declare const PathField: ({ initial, inputRef, onGo, onClose, onDismiss }: PathFieldProps) => import("react").JSX.Element;
23
+ export default PathField;
@@ -0,0 +1,27 @@
1
+ import type { RefObject } from "react";
2
+ import type { SearchScope, SectionGroup } from "../../../types/index.js";
3
+ interface SearchFieldProps {
4
+ scope: SearchScope;
5
+ query: string;
6
+ /** The name of the open folder, which a folder search covers. */
7
+ folderName: string;
8
+ /** Every section, which a search everywhere covers but for those `excluded`. */
9
+ groups: SectionGroup[];
10
+ /** Ids of the sections a search everywhere leaves out; never all of them. */
11
+ excluded: ReadonlySet<string>;
12
+ inputRef: RefObject<HTMLInputElement | null>;
13
+ onQueryChange: (query: string) => void;
14
+ onExcludedChange: (excluded: ReadonlySet<string>) => void;
15
+ /** Escape, or ✕ with nothing typed, which give the focus back. */
16
+ onClose: () => void;
17
+ /** The focus going elsewhere with nothing typed, where it stays. */
18
+ onDismiss: () => void;
19
+ /** Down or Enter, on to the content. */
20
+ onFocusContent: () => void;
21
+ }
22
+ /**
23
+ * The search field, shown in the path bar's place while searching, the open folder or every
24
+ * section checked in its sections menu.
25
+ */
26
+ declare const SearchField: ({ scope, query, folderName, groups, excluded, inputRef, onQueryChange, onExcludedChange, onClose, onDismiss, onFocusContent, }: SearchFieldProps) => import("react").JSX.Element;
27
+ export default SearchField;
@@ -0,0 +1,25 @@
1
+ import type { RefObject } from "react";
2
+ import type { SectionGroup } from "../../../types/index.js";
3
+ interface SearchSectionsMenuProps {
4
+ groups: SectionGroup[];
5
+ /** Ids of the sections left out of the search; never all of them. */
6
+ excluded: ReadonlySet<string>;
7
+ /** The open menu's button, and which way its text runs, read as it opened. */
8
+ menu: SectionsMenu | null;
9
+ buttonRef: RefObject<HTMLButtonElement | null>;
10
+ onOpen: () => void;
11
+ onClose: () => void;
12
+ onExcludedChange: (excluded: ReadonlySet<string>) => void;
13
+ }
14
+ export interface SectionsMenu {
15
+ anchor: HTMLElement;
16
+ rtl: boolean;
17
+ }
18
+ /**
19
+ * The search field's button for which sections a search everywhere covers, and its menu, which
20
+ * stays open while sections are checked, so several can change in one go. One section always
21
+ * stays checked. Pressing the button keeps the focus in the field until the menu takes it, and
22
+ * the menu gives it back there.
23
+ */
24
+ declare const SearchSectionsMenu: ({ groups, excluded, menu, buttonRef, onOpen, onClose, onExcludedChange, }: SearchSectionsMenuProps) => import("react").JSX.Element;
25
+ export default SearchSectionsMenu;
@@ -0,0 +1,39 @@
1
+ import type { SortOrder, ViewMode, ViewZoom, ZoomStep } from "../../../types/index.js";
2
+ interface ViewMenuProps {
3
+ /** The view shown, which the zoom items zoom. */
4
+ view: ViewMode;
5
+ zoom: ViewZoom;
6
+ sort: SortOrder;
7
+ /** Whether a search everywhere's results show, which can be ordered by relevance. */
8
+ resultsShown: boolean;
9
+ /**
10
+ * Whether the trash's root shows, whose date goes by when its entries were moved there, and
11
+ * which can be ordered by where they came from.
12
+ */
13
+ trashShown: boolean;
14
+ showHidden: boolean;
15
+ /** Whether the docked sidebar is hidden. */
16
+ sidebarHidden: boolean;
17
+ /** Whether the sidebar docks at the moment, read as the menu opens. */
18
+ sidebarDocked: () => boolean;
19
+ /** Whether the docked properties show. */
20
+ propertiesOpen: boolean;
21
+ /** Whether the properties dock at the moment, read as the menu opens. */
22
+ propertiesDocked: () => boolean;
23
+ /** Zooms the view shown a step in or out, or back to its start. */
24
+ onZoom: (step: ZoomStep) => void;
25
+ onSortChange: (sort: SortOrder) => void;
26
+ onToggleHidden: () => void;
27
+ onToggleSidebar: () => void;
28
+ onToggleProperties: () => void;
29
+ /** Opens the properties over the content, giving the focus back to `opener` as they close. */
30
+ onOpenProperties: (opener: HTMLElement | null) => void;
31
+ }
32
+ /**
33
+ * The header's view options: how the content is sorted, whether hidden files show, while the
34
+ * sidebar docks, whether it shows, whether the properties show, docked, or else opening them over
35
+ * the content, and zooming the view shown. It stays open while options change, so the key and the
36
+ * direction can both be picked in one go, and the view zoomed by several steps.
37
+ */
38
+ declare const ViewMenu: ({ view, zoom, sort, resultsShown, trashShown, showHidden, sidebarHidden, sidebarDocked, propertiesOpen, propertiesDocked, onZoom, onSortChange, onToggleHidden, onToggleSidebar, onToggleProperties, onOpenProperties, }: ViewMenuProps) => import("react").JSX.Element;
39
+ export default ViewMenu;
@@ -0,0 +1,36 @@
1
+ import type { PlaceName } from "../../types/index.js";
2
+ /** What the notice under the content says. */
3
+ export interface Notice {
4
+ /** Counts notices, so each one shows for its whole time, even with the same text. */
5
+ id: number;
6
+ message: string;
7
+ /** Under the message, such as why an undo did nothing. */
8
+ detail?: string;
9
+ }
10
+ interface NoticeBarProps {
11
+ /** What to say, or null for nothing. */
12
+ notice: Notice | null;
13
+ /** The label of its button (Undo, Redo, Try again), when it has one. */
14
+ actionLabel?: string;
15
+ onAction: () => void;
16
+ /** The label of a button before that one, showing where a change put something (Show), when it has one. */
17
+ showLabel?: string;
18
+ /** The folders it shows, when there are several, which it lists to choose from. */
19
+ showPlaces?: PlaceName[];
20
+ /** Shows the folder at `index` of `showPlaces`, or the one there is. */
21
+ onShow: (index: number) => void;
22
+ onClose: () => void;
23
+ /** Whether it sits above the touch selection bar, which has the panel's bottom. */
24
+ raised: boolean;
25
+ /** Called as it goes with the focus in it, for the content to take it. */
26
+ onFocusLost: () => void;
27
+ }
28
+ /**
29
+ * A notice over the bottom of the content, as a snackbar is: what a change did, with Undo, and Show
30
+ * for what a restore put back, listing the folders it went back to when there are several, or why
31
+ * an undo did nothing. It goes after `SHOW_FOR`, which waits while the pointer is over it, the focus
32
+ * in it or its list open, or with its ✕ or Escape. Screen readers hear its message from the file
33
+ * manager's live region, so it isn't one itself.
34
+ */
35
+ declare const NoticeBar: ({ notice, actionLabel, onAction, showLabel, showPlaces, onShow, onClose, raised, onFocusLost, }: NoticeBarProps) => import("react").JSX.Element | null;
36
+ export default NoticeBar;