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,53 @@
1
+ import type { Ref } from "react";
2
+ import type { PropertiesCache } from "../../store/properties-cache.js";
3
+ import type { ActionContext, ActionGroup, FileAdapter, MenuRequest, PropertiesSubject, Section, SlotAttributes, TrashInfo } from "../../types/index.js";
4
+ interface PropertiesPaneProps {
5
+ ref?: Ref<HTMLDivElement>;
6
+ subject: PropertiesSubject;
7
+ /** Whether the docked panel shows; has no effect while there's no room to dock it. */
8
+ shown: boolean;
9
+ /** Whether the overlay shows while there's no room to dock; has no effect once it docks. */
10
+ open: boolean;
11
+ /** The docked panel's width, in px, which it's narrower than while the content needs the room. */
12
+ width: number;
13
+ /** The width a double click on the docked panel's edge puts back. */
14
+ defaultWidth: number;
15
+ /** The user resized the docked panel, by its edge, to `width`. */
16
+ onWidthChange: (width: number) => void;
17
+ /** The file manager's count of its changes, which counts what's in folders again. */
18
+ changes: number;
19
+ showHidden: boolean;
20
+ cache: PropertiesCache;
21
+ /** Takes the focus, for one render, e.g. as the context menu's Properties opens it. */
22
+ takeFocus: boolean;
23
+ /** The app's actions for the panel's header (`propertiesActions`). */
24
+ actions: ActionGroup[];
25
+ /**
26
+ * What the context menu's actions get, for the panel's Rename, "Open item location" and "Open
27
+ * original location", and the header's actions.
28
+ */
29
+ contextFor: (request: MenuRequest) => ActionContext;
30
+ /** Where an entry in `trash`'s root was moved there from, written out. */
31
+ locateTrashed: (trash: Section, info: TrashInfo) => string;
32
+ /** Lists folders again, in every section the adapter serves, once an entry's properties are saved. */
33
+ relist: (adapter: FileAdapter, folderIds: string[]) => void;
34
+ /** The panel's close button. */
35
+ onClose: () => void;
36
+ /** Escape in the panel. */
37
+ onEscape: () => void;
38
+ /** The focus left the overlay, for `to`. */
39
+ onFocusOut: (to: Node) => void;
40
+ /** It docked, or no longer does, as the space it's in changed size. */
41
+ onDockedChange: (docked: boolean) => void;
42
+ /** The app's attributes for the panel (`slotProps.properties`). */
43
+ attributes?: SlotAttributes;
44
+ }
45
+ /**
46
+ * The properties panel in the file manager: docked beside the content where there's room, and an
47
+ * overlay over it where there isn't, as the sidebar is on the other side. It shows the entries or the
48
+ * folder the file manager says, as they're listed now, so a change made meanwhile shows, and hands
49
+ * the panel the file manager's Rename and "Open item location". The panel is only there while it
50
+ * shows, so nothing is asked of the adapter while it's hidden.
51
+ */
52
+ declare const PropertiesPane: ({ ref, subject, shown, open, width, defaultWidth, onWidthChange, changes, showHidden, cache, takeFocus, actions, contextFor, locateTrashed, relist, onClose, onEscape, onFocusOut, onDockedChange, attributes, }: PropertiesPaneProps) => import("react").JSX.Element;
53
+ export default PropertiesPane;
@@ -0,0 +1,39 @@
1
+ import type { RefObject } from "react";
2
+ interface ResizeEdgeProps {
3
+ /**
4
+ * The docked panel it resizes. While the edge is dragged the panel's width is set on it
5
+ * through `cssVar`, without rendering, and its width as shown is what screen readers are told.
6
+ */
7
+ target: RefObject<HTMLElement | null>;
8
+ /** Names the edge for screen readers. */
9
+ label: string;
10
+ /** The id of the panel. */
11
+ controls: string;
12
+ /** Which side of the panel the edge is on, the start or the end, as the panel's text runs. */
13
+ placement: "start" | "end";
14
+ /** The width asked for, in px, within `min` and `max`. */
15
+ width: number;
16
+ /** The width a double click puts back. */
17
+ defaultWidth: number;
18
+ min: number;
19
+ max: number;
20
+ /** How far an arrow key moves the edge, in px. */
21
+ step: number;
22
+ /** The custom property on the panel that its width is read from, such as `--sidebar-width`. */
23
+ cssVar: string;
24
+ /**
25
+ * How wide the panel can be made now, in px: what the room around it leaves it beside the
26
+ * least the content keeps. Asked as a drag or a key needs it, and as the layout changes.
27
+ */
28
+ widest: () => number;
29
+ /** The user resized the panel to `width`: as a drag ends, with a key, or with a double click. */
30
+ onChange: (width: number) => void;
31
+ }
32
+ /**
33
+ * The edge that resizes a docked panel, the sidebar's or the properties': dragged with a mouse, a
34
+ * pen or a finger, or moved with the arrow keys, Home and End, as a window splitter is, and put
35
+ * back with a double click. A drag moves the panel without rendering and asks for the width once,
36
+ * as it ends. It never takes the room the content needs, or the other panel's (`widest`).
37
+ */
38
+ declare const ResizeEdge: ({ target, label, controls, placement, width, defaultWidth, min, max, step, cssVar, widest, onChange, }: ResizeEdgeProps) => import("react").JSX.Element;
39
+ export default ResizeEdge;
@@ -0,0 +1,15 @@
1
+ interface SelectionBarProps {
2
+ /** How many entries are selected. */
3
+ count: number;
4
+ /** How many entries the folder has. */
5
+ total: number;
6
+ hasActions: boolean;
7
+ onClose: () => void;
8
+ onSelectAll: () => void;
9
+ onSelectNone: () => void;
10
+ /** Opens the action menu for the selection, below the given button. */
11
+ onMenu: (button: HTMLElement) => void;
12
+ }
13
+ /** The touch selection mode's bar: leave the mode, the count, select all or none, and the action menu. */
14
+ declare const SelectionBar: ({ count, total, hasActions, onClose, onSelectAll, onSelectNone, onMenu }: SelectionBarProps) => import("react").JSX.Element;
15
+ export default SelectionBar;
@@ -0,0 +1,36 @@
1
+ import type { FileManagerLocation, OpenMenu, PasteFiles, RunShortcut, SelectModifiers, StatusRow, TreeGuide, TreeItemRow, TreeSelection, TreeTarget } from "../../../types/index.js";
2
+ /**
3
+ * Props every row of the tree gets unchanged. The tree's selection is its own: selecting here
4
+ * never touches what is selected in the content, and a menu opened here acts on the tree's
5
+ * selection only.
6
+ */
7
+ interface TreeProps {
8
+ /** `folderKey` of the open folder. */
9
+ openKey: string | null;
10
+ /** The tree's selection; null while the open folder alone counts as selected. */
11
+ selection: TreeSelection | null;
12
+ /** `folderKey` of the row the browser's find in page last came to, highlighted for a moment. */
13
+ foundKey: string | null;
14
+ /** Starts the touch selection mode with the folder selected, from the menu a long-press opened. */
15
+ onStartSelecting: (target: TreeTarget) => void;
16
+ onToggle: (key: string) => void;
17
+ /** Expands the folder or section with that `folderKey`, without collapsing it if it's expanded. */
18
+ onExpand: (key: string) => void;
19
+ onNavigate: (place: FileManagerLocation) => void;
20
+ onSelectFolder: (target: TreeTarget, modifiers?: SelectModifiers) => void;
21
+ onSelectSection: (key: string) => void;
22
+ onOpenMenu: OpenMenu;
23
+ onShortcut: RunShortcut;
24
+ onPasteFiles: PasteFiles;
25
+ }
26
+ interface TreeRowItemProps extends TreeProps {
27
+ row: TreeItemRow | StatusRow;
28
+ }
29
+ interface GuideLineProps {
30
+ guide: TreeGuide;
31
+ }
32
+ /** The guide line along the folders below an expanded row. */
33
+ export declare const GuideLine: ({ guide }: GuideLineProps) => import("react").JSX.Element;
34
+ /** One of the tree's list items: a section, a folder, a folder that couldn't be listed, or a status. */
35
+ declare const TreeRowItem: ({ row, ...tree }: TreeRowItemProps) => import("react").JSX.Element;
36
+ export default TreeRowItem;
@@ -0,0 +1,23 @@
1
+ import type { MainMenuGroup, UndoChange } from "../../../types/index.js";
2
+ /** The menu's Undo and Redo, named by the change each undoes or redoes, or null with none to. */
3
+ export interface UndoItems {
4
+ undo: UndoChange | null;
5
+ redo: UndoChange | null;
6
+ onUndo: () => void;
7
+ onRedo: () => void;
8
+ }
9
+ interface MainMenuProps {
10
+ /** The consumer's items, shown between the file manager's Undo and Redo and its "Keyboard shortcuts". */
11
+ groups: MainMenuGroup[];
12
+ /** Undo and Redo, at the top; missing when nothing the file manager does can be undone. */
13
+ undo?: UndoItems;
14
+ /** Opens the keyboard shortcuts, which give the focus back to `opener` as they close. */
15
+ onShowShortcuts: (opener: HTMLElement | null) => void;
16
+ }
17
+ /**
18
+ * The sidebar's main menu: Undo and Redo, as in GNOME Files, the consumer's items, for what belongs
19
+ * to the app (preferences, help, about), then "Keyboard shortcuts". Picking an item closes the menu
20
+ * first.
21
+ */
22
+ declare const MainMenu: ({ groups, undo, onShowShortcuts }: MainMenuProps) => import("react").JSX.Element;
23
+ export default MainMenu;
@@ -0,0 +1,80 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ import type { FileManagerLocation, MainMenuGroup, OpenMenu, PasteFiles, RunShortcut, SearchScope, Section, SectionGroup, SlotAttributes, TreeReveal } from "../../../types/index.js";
3
+ import type { UndoItems } from "./main-menu.js";
4
+ interface SidebarProps {
5
+ ref?: Ref<HTMLDivElement>;
6
+ title: string;
7
+ groups: SectionGroup[];
8
+ /** The file manager's only section, whose folders then fill the sidebar in place of `groups`. */
9
+ single?: Section;
10
+ expanded: ReadonlySet<string>;
11
+ /** Whether hidden folders are listed with the rest. */
12
+ showHidden: boolean;
13
+ /** `folderKey` of the open folder. */
14
+ openKey: string | null;
15
+ /** A folder just created, to scroll the tree to once its row is there. */
16
+ reveal: TreeReveal | null;
17
+ /** Whether the overlay is showing while the sidebar is collapsed; has no effect once it docks. */
18
+ open: boolean;
19
+ /** Whether the docked sidebar is hidden; has no effect while it's collapsed. */
20
+ hidden: boolean;
21
+ /**
22
+ * Whether the hidden docked sidebar shows over the content for a drag, as the overlay does
23
+ * while it's collapsed, leaving it hidden once the drag ends.
24
+ */
25
+ peek: boolean;
26
+ /** The docked sidebar's width, in px, which it's narrower than while the content needs the room. */
27
+ width: number;
28
+ /** The width a double click on the docked sidebar's edge puts back. */
29
+ defaultWidth: number;
30
+ /** How wide the docked sidebar can be made now, in px, beside the content and the docked properties. */
31
+ widest: () => number;
32
+ /** The user resized the docked sidebar, by its edge, to `width`. */
33
+ onWidthChange: (width: number) => void;
34
+ /** What the open search searches, or null; the magnifier at the top is for searching everywhere. */
35
+ searchScope: SearchScope | null;
36
+ /** Whether any section can be searched everywhere, without which the magnifier isn't there. */
37
+ canSearchEverywhere: boolean;
38
+ /** Opens a search everywhere, switches to it, or closes it when it's the one open. */
39
+ onSearchEverywhere: () => void;
40
+ /** The consumer's main menu items, above the file manager's own. */
41
+ mainMenu: MainMenuGroup[];
42
+ /** The main menu's Undo and Redo; missing when nothing the file manager does can be undone. */
43
+ undoItems?: UndoItems;
44
+ /** Opens the keyboard shortcuts from the main menu, giving the focus back to `opener` after. */
45
+ onShowShortcuts: (opener: HTMLElement | null) => void;
46
+ onToggle: (key: string) => void;
47
+ /** Called once `reveal` has been scrolled to, or given up on. */
48
+ onRevealed: () => void;
49
+ /** Expands a collapsed folder or section that a drag rests on. */
50
+ onExpand: (key: string) => void;
51
+ onNavigate: (place: FileManagerLocation) => void;
52
+ /** Whether the consumer has any actions, without which the selection bar has no menu. */
53
+ hasActions: boolean;
54
+ onOpenMenu: OpenMenu;
55
+ onShortcut: RunShortcut;
56
+ onPasteFiles: PasteFiles;
57
+ onClose: () => void;
58
+ /** The app's attributes for the sidebar (`slotProps.sidebar`). */
59
+ attributes?: SlotAttributes;
60
+ /** The app's own part under the tree (`slots.sidebarFooter`), drawn already. */
61
+ footer?: ReactNode;
62
+ }
63
+ /**
64
+ * The sidebar: the file manager's title and a tree of its sections and their folders, or of a
65
+ * single section's folders. The tree is flattened into the rows it shows (`useTreeRows`), and
66
+ * only those in or near view are rendered (`useVirtualRows`), so a folder of thousands of folders
67
+ * expands as fast as a small one.
68
+ *
69
+ * The tree is one stop in the tab order. Tabbed to, it hands the focus to the row that had it
70
+ * last, or else the open folder's, or the first; while a row has it, the tree steps out of the
71
+ * tab order so Shift+Tab leaves it. Up, Down, Home and End move between the rows shown, Right
72
+ * goes into an expanded row and Left out to the row above, and typing finds a row by its name.
73
+ * These go by the rows rather than the page, which only holds some of them. The rows take the
74
+ * keys that act on them (`TreeItem` in `location-item.tsx`).
75
+ *
76
+ * As an overlay, it takes the focus as it opens, closes on Escape, and closes when the focus
77
+ * moves on to the file manager behind it.
78
+ */
79
+ declare const Sidebar: ({ ref, title, groups, single, expanded, showHidden, openKey, reveal, open, hidden, peek, width, defaultWidth, widest, onWidthChange, searchScope, canSearchEverywhere, onToggle, onRevealed, onExpand, onNavigate, hasActions, onOpenMenu, onShortcut, onPasteFiles, onClose, onSearchEverywhere, mainMenu, undoItems, onShowShortcuts, attributes, footer, }: SidebarProps) => import("react").JSX.Element;
80
+ export default Sidebar;
@@ -0,0 +1,3 @@
1
+ /** The check badge of touch selection mode, drawn only; the item says it's selected itself. */
2
+ declare const CheckBadge: () => import("react").JSX.Element;
3
+ export default CheckBadge;
@@ -0,0 +1,20 @@
1
+ import type { IconComponent } from "../../types/index.js";
2
+ /**
3
+ * One shape of an icon on its 24 by 24 grid: a path's `d` alone, or a path or a circle (its centre
4
+ * and radius) with what else it's drawn with, the fainter tone of a two-tone icon or holes cut by
5
+ * the even-odd rule.
6
+ */
7
+ export type IconShape = string | {
8
+ d: string;
9
+ opacity?: number;
10
+ evenOdd?: boolean;
11
+ } | {
12
+ circle: readonly [x: number, y: number, radius: number];
13
+ opacity?: number;
14
+ evenOdd?: boolean;
15
+ };
16
+ /**
17
+ * An icon of the built-in sets, from its shapes. It draws only: `Icon` sizes and mirrors it through
18
+ * the class it passes, as it does a consumer's own.
19
+ */
20
+ export declare const createIcon: (...shapes: IconShape[]) => IconComponent;
@@ -0,0 +1,19 @@
1
+ import type { SVGProps } from "react";
2
+ interface TypeIconProps extends Omit<SVGProps<SVGSVGElement>, "ref" | "name" | "fontSize"> {
3
+ /** Width and height in one go; `width` / `height` still win when given. */
4
+ size?: number | string;
5
+ }
6
+ interface FileTypeIconProps extends TypeIconProps {
7
+ /** Full file name including extension, e.g. `report.pdf` or `vite.config.ts`. */
8
+ fileName: string;
9
+ }
10
+ interface FolderTypeIconProps extends TypeIconProps {
11
+ folderName: string;
12
+ /** Render the opened-folder glyph instead of the name-based one. */
13
+ open?: boolean;
14
+ }
15
+ /** Colored icon chosen from a file's name and extension; unknown files get a neutral default. */
16
+ export declare const FileTypeIcon: ({ fileName, size, ...props }: FileTypeIconProps) => import("react").JSX.Element;
17
+ /** Colored icon chosen from a folder's name; unknown folders get a neutral default. */
18
+ export declare const FolderTypeIcon: ({ folderName, open, size, ...props }: FolderTypeIconProps) => import("react").JSX.Element;
19
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { PropsWithChildren } from "react";
2
+ import type { IconOverrides, IconSet } from "../../types/index.js";
3
+ interface IconProviderProps extends PropsWithChildren {
4
+ /**
5
+ * The icons for everything below: a Material style imported from the package's `icons/<style>`
6
+ * (`filledIcons`, `outlinedIcons`, `roundedIcons`, `sharpIcons`, `twoToneIcons`), or a set of the
7
+ * app's own. Inherits from a parent provider when omitted, and is Outlined with none.
8
+ */
9
+ icons?: IconSet;
10
+ /** Per-icon replacements, merged over any parent provider's overrides. */
11
+ overrides?: IconOverrides;
12
+ /**
13
+ * Coloured file and folder icons chosen by name (a PDF's, a `src` folder's), from
14
+ * `@react-symbols/icons`, which is loaded on its own once the component mounts, the set's plain
15
+ * file and folder icons standing in until it has. `false` keeps the plain ones and never loads
16
+ * it. Inherits from a parent provider when omitted, and is `true` with none.
17
+ */
18
+ typeIcons?: boolean;
19
+ }
20
+ declare const IconProvider: ({ icons, overrides, typeIcons, children }: IconProviderProps) => import("react").JSX.Element;
21
+ export default IconProvider;
@@ -0,0 +1,6 @@
1
+ import type { IconSource } from "../../types/index.js";
2
+ interface IconSlotProps {
3
+ icon: IconSource;
4
+ }
5
+ declare const IconSlot: ({ icon }: IconSlotProps) => import("react").JSX.Element;
6
+ export default IconSlot;
@@ -0,0 +1,19 @@
1
+ import type { SVGProps } from "react";
2
+ import type { IconName } from "../../types/index.js";
3
+ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, "name" | "fontSize"> {
4
+ name: IconName;
5
+ /** `medium` is 1.5rem, `small` 1.25rem, and `inherit` the size of the text around it. */
6
+ fontSize?: "small" | "medium" | "inherit";
7
+ /**
8
+ * Names the icon for screen readers, and shows as its tooltip, for one that says something by
9
+ * itself. Without it an icon is drawn only, and what it's in says what it means.
10
+ */
11
+ label?: string;
12
+ }
13
+ /**
14
+ * An icon by its name, from `IconProvider`'s set or the consumer's override of it. Its size and its
15
+ * mirroring are classes, the icon's own `className` after them so it can still override them, so a
16
+ * consumer's icon needs to take no more than an `svg`'s own props.
17
+ */
18
+ declare const Icon: ({ name, fontSize, label, className, ...props }: IconProps) => import("react").JSX.Element;
19
+ export default Icon;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ interface LockedIconProps {
3
+ /** Whether to show the lock; without it, the icon shows as it is. */
4
+ locked: boolean;
5
+ children: ReactNode;
6
+ }
7
+ /** An icon with a lock at its corner, for a folder nothing can be put in (`lockedFolder`). */
8
+ declare const LockedIcon: ({ locked, children }: LockedIconProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
9
+ export default LockedIcon;
@@ -0,0 +1,29 @@
1
+ import type { FileAdapter, FileEntry } from "../../types/index.js";
2
+ interface AssetDeleteProps {
3
+ /**
4
+ * What's deleted, one folder's entries after another, as the adapter takes entries sharing one: the
5
+ * asset or group shown, or what's selected, which a search may have found in several groups.
6
+ */
7
+ groups: readonly (readonly FileEntry[])[];
8
+ adapter: FileAdapter;
9
+ /** Where it is: under the asset view's header, or at the library's foot, in the selection bar's place. */
10
+ placement?: "top" | "bottom";
11
+ /** Closes it, asking nothing of the backend, or stopping what was asked. */
12
+ onCancel: () => void;
13
+ /**
14
+ * Told what went each time some did: everything asked, `done`, or what the adapter reported gone
15
+ * before it refused the rest (`DeleteOptions.onEntryDone`), which stays to try again.
16
+ */
17
+ onDeleted: (entries: FileEntry[], done: boolean) => void;
18
+ /** Left while the backend was being asked, which may have deleted some of it by then. */
19
+ onLeft: () => void;
20
+ }
21
+ /**
22
+ * Asks before deleting the asset or group shown, or what's selected, in the view or the library rather
23
+ * than in a dialog of its own, as a picker is often in the app's own dialog already. Cancel takes the
24
+ * focus as it opens, as deleting can't be undone, and Escape cancels. It stays until the adapter's
25
+ * `delete` answers, to say why when it's refused, naming those left when some went first, and then asks
26
+ * about only those.
27
+ */
28
+ declare const AssetDelete: ({ groups, adapter, placement, onCancel, onDeleted, onLeft }: AssetDeleteProps) => import("react").JSX.Element;
29
+ export default AssetDelete;
@@ -0,0 +1,32 @@
1
+ import type { AssetHold } from "../../types/index.js";
2
+ /**
3
+ * Where a bar is drawn: along a tile's picture's foot, under a row's name, or along the foot of the
4
+ * asset view's notice; the frame and the notice are positioned.
5
+ */
6
+ type BarPlace = "frame" | "row" | "view";
7
+ interface HoldLineProps {
8
+ hold: AssetHold;
9
+ id?: string;
10
+ }
11
+ interface HoldBarProps {
12
+ hold: AssetHold;
13
+ place: BarPlace;
14
+ }
15
+ /**
16
+ * Why an asset can't be chosen now, in one line: what its backend is doing and how far along, that
17
+ * it failed, with why for screen readers and as its tooltip, or why its library refuses it.
18
+ */
19
+ export declare const HoldLine: ({ hold, id }: HoldLineProps) => import("react").JSX.Element;
20
+ /**
21
+ * How far along an asset's processing is, filling as its backend says, or moving while it doesn't
22
+ * say; drawn only, as its line says it. Nothing while it isn't being processed.
23
+ */
24
+ export declare const HoldBar: ({ hold, place }: HoldBarProps) => import("react").JSX.Element | null;
25
+ /**
26
+ * Why an asset the app drew entirely itself can't be chosen now, under what it drew, with its bar, or
27
+ * the same room empty while it can be, so every asset of the grid is laid out as tall.
28
+ */
29
+ export declare const HoldSlot: ({ hold }: {
30
+ hold: AssetHold | undefined;
31
+ }) => import("react").JSX.Element;
32
+ export {};
@@ -0,0 +1,74 @@
1
+ import type { KeyboardEvent, MouseEvent } from "react";
2
+ import type { AssetHold, FileAdapter, FileEntry, FolderRef, MediaAssetDraw, MediaKind, MediaLayout, MediaPickerSlotProps, MediaSection } from "../../types/index.js";
3
+ interface AssetOptionProps {
4
+ entry: FileEntry;
5
+ kind: MediaKind;
6
+ /** What it's shown as: a tile of the kind's shape, or a row. */
7
+ layout: MediaLayout;
8
+ adapter: FileAdapter;
9
+ /** Where the entry is shown, from 0. */
10
+ index: number;
11
+ /** How many the grid shows, for screen readers, as only those in or near view are rendered. */
12
+ count: number;
13
+ /** Where its line is, in px from the listbox's top. */
14
+ top: number;
15
+ /** Its column in the line, from 0; always 0 in a list of rows. */
16
+ column: number;
17
+ selected: boolean;
18
+ /** Why it can't be chosen now: it isn't selected then, but is opened. */
19
+ hold: AssetHold | undefined;
20
+ /** The backend's work on it while it can be chosen all the same, shown the same way, unfaded. */
21
+ work: AssetHold | undefined;
22
+ /** Where it is below the level searched, as a search's result from further down. */
23
+ trail: readonly FolderRef[] | undefined;
24
+ /** Whether there's no room for it among those selected (`maxChoices`): dimmed, with nothing said on it. */
25
+ limited: boolean;
26
+ /** Whether it's a group that can be selected, which has a check of its own to do it by. */
27
+ checkable: boolean;
28
+ /**
29
+ * Whether what's selected is for acting on in place, while the media manager is browsing, where one
30
+ * that can't be chosen now can still be selected, moved and deleted, so it's never disabled.
31
+ */
32
+ browsing: boolean;
33
+ /** Whether it can be dragged, to be dropped on a group or a step of the path. */
34
+ draggable: boolean;
35
+ /** Whether it's among what's being dragged, which fades. */
36
+ dragged: boolean;
37
+ /** Whether letting go of what's dragged now would drop it into this group. */
38
+ dropTarget: boolean;
39
+ /** Whether it has the grid's Tab stop. */
40
+ focused: boolean;
41
+ /** What the app draws it with, the library's `renderAsset` or the media manager's. */
42
+ draw: MediaAssetDraw | undefined;
43
+ /** What the app draws it with when it's a group, the library's `renderGroup` or the media manager's. */
44
+ drawGroup: MediaAssetDraw | undefined;
45
+ /** Whether a group has details to open, which puts the Open button on it. */
46
+ opensGroups: boolean;
47
+ /** Whether an asset has a view to open, which puts the Open button on it. */
48
+ opensAssets: boolean;
49
+ onPress: (index: number, event: MouseEvent) => void;
50
+ /** A group's own check. */
51
+ onCheck: (index: number, event: MouseEvent) => void;
52
+ /** A double click, which chooses it, or opens it while nothing is chosen. */
53
+ onActivate: (index: number) => void;
54
+ /** Its button opening it in the library's place. */
55
+ onOpen: (index: number) => void;
56
+ onFocus: (index: number) => void;
57
+ onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
58
+ /** Its library, which the app's attributes for it are handed. */
59
+ section: MediaSection;
60
+ /** The app's attributes for each asset (`slotProps.asset`). */
61
+ assetSlot: MediaPickerSlotProps["asset"];
62
+ }
63
+ /**
64
+ * One asset in the grid, or a group, as a tile or a row: what makes it one to select or to go into,
65
+ * whoever draws it. The `option` with its keys, clicks and marks, the check and the Open button. Inside it,
66
+ * the media manager's own look (`MediaTile`, `MediaRow`), or what the app's `renderAsset` returns.
67
+ * An app may use the same looks there. When it has drawn something else entirely, this says why the
68
+ * asset can't be chosen, and where a search found it, under it, fades it as those do, and names it, what the app drew being read
69
+ * as its description, so no asset is left unnamed or held without a word; the room those take is kept
70
+ * under every asset drawn so while any in the grid needs it, so all are as tall. Absolutely placed at
71
+ * its line and column, as only the assets in or near view are rendered (see `MediaGrid`).
72
+ */
73
+ declare const AssetOption: import("react").MemoExoticComponent<({ entry, kind, layout, adapter, index, count, top, column, selected, hold, work, trail, limited, checkable, browsing, draggable, dragged, dropTarget, focused, draw, drawGroup, opensGroups, opensAssets, onPress, onCheck, onActivate, onOpen, onFocus, onKeyDown, section, assetSlot, }: AssetOptionProps) => import("react").JSX.Element>;
74
+ export default AssetOption;
@@ -0,0 +1,13 @@
1
+ import type { FolderRef } from "../../types/index.js";
2
+ interface AssetTrailProps {
3
+ /** The groups between the level searched and what's found, outermost first. */
4
+ trail: readonly FolderRef[];
5
+ }
6
+ /** Where a search's result is below the level searched, one line under what else its look says. */
7
+ declare const AssetTrail: ({ trail }: AssetTrailProps) => import("react").JSX.Element;
8
+ export default AssetTrail;
9
+ /**
10
+ * The room a trail takes, empty, under what an asset found right in the level searched shows, while
11
+ * the grid shows results from further down too, as every asset in it is laid out as tall.
12
+ */
13
+ export declare const TrailRoom: () => import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import type { AssetHold, FileAdapter, MediaChoice } from "../../types/index.js";
2
+ interface ChoiceListProps {
3
+ /** What's selected, in every library, in the order it's handed over in. */
4
+ choices: readonly MediaChoice[];
5
+ /** Serves the libraries that don't bring their own adapter, for the thumbnails. */
6
+ adapter: FileAdapter;
7
+ /** Whether the app has details for each pick, which a row's button, a click and Enter open. */
8
+ hasDetails: boolean;
9
+ /** The one whose details were open, to take the focus back as they close. */
10
+ returnFocusTo: string | null;
11
+ onRemove: (choice: MediaChoice) => void;
12
+ /** Moves the one at `from` to `to`, the others making room. */
13
+ onMove: (from: number, to: number) => void;
14
+ onOpenDetails: (choice: MediaChoice) => void;
15
+ /** How much of a pick the app's `errors` have to fix: its fields with one, and its own as one more. */
16
+ problemsOf: ((choice: MediaChoice) => number) | undefined;
17
+ /** Why a pick can't be chosen now, which holds Choose back. */
18
+ holdOf: (choice: MediaChoice) => AssetHold | undefined;
19
+ }
20
+ export declare const choiceKey: ({ asset, section }: MediaChoice) => string;
21
+ /**
22
+ * The list of what's selected, in every library, in the order it's handed over in. Each is
23
+ * dragged to another place, by the mouse or, held a moment, a finger, or picked up from the
24
+ * keyboard with Space, moved with the arrow keys, and put down again, or put back with Escape. One
25
+ * Tab stop, the arrow keys going from one to the next, Enter opening one's details and Delete
26
+ * taking one out.
27
+ */
28
+ declare const ChoiceList: ({ choices, adapter, hasDetails, returnFocusTo, onRemove, onMove, onOpenDetails, problemsOf, holdOf, }: ChoiceListProps) => import("react").JSX.Element;
29
+ export default ChoiceList;
@@ -0,0 +1,50 @@
1
+ import type { ReactNode } from "react";
2
+ import type { AssetHold, FileAdapter, MediaChoice, SlotAttributes } from "../../types/index.js";
3
+ interface ChoicesPaneProps {
4
+ /** What's selected, in every library, in the order it's handed over in. */
5
+ choices: readonly MediaChoice[];
6
+ /** Serves the libraries that don't bring their own adapter, for the thumbnails. */
7
+ adapter: FileAdapter;
8
+ /**
9
+ * Whether several can be chosen, listed to put in order; one at a time, the one selected shows
10
+ * straight away with its details, as there's nothing to order.
11
+ */
12
+ multiple: boolean;
13
+ /**
14
+ * One pick's own errors and the app's form for it, for this use of it, drawn with what it holds,
15
+ * by its place among those selected now; none without either.
16
+ */
17
+ renderDetails: ((choice: MediaChoice, index: number) => ReactNode) | undefined;
18
+ /** How much of a pick the app's `errors` have to fix, for its row; none without them. */
19
+ problemsOf: ((choice: MediaChoice) => number) | undefined;
20
+ /** Why a pick can't be chosen now, for its row and its details. */
21
+ holdOf: (choice: MediaChoice) => AssetHold | undefined;
22
+ /** What holds Choose back, said beside it, while picks can't be chosen; nothing otherwise. */
23
+ held: string | undefined;
24
+ /** What the count beside its title shows; nothing one at a time, or with none and no limit. */
25
+ badge: string | undefined;
26
+ /** How many are selected, in words, for screen readers. */
27
+ selectedText: string | undefined;
28
+ /** That as many as may be are selected, said under its header. */
29
+ note: string | undefined;
30
+ onRemove: (choice: MediaChoice) => void;
31
+ onMove: (from: number, to: number) => void;
32
+ onClear: () => void;
33
+ /** Choose at its foot, while finishing is the app's to take; without it, the app takes the picks as they change. */
34
+ onChoose: (() => void) | undefined;
35
+ /** Opens the asset itself in its library, in the library's place; none where there's no asset view. */
36
+ onShowInLibrary: ((choice: MediaChoice) => void) | undefined;
37
+ /** Closes the column where it's an overlay over the library. */
38
+ onClose: () => void;
39
+ /** The app's attributes for the column (`slotProps.chosen`). */
40
+ attributes?: SlotAttributes;
41
+ }
42
+ /**
43
+ * The column of what's selected, in every library, while the app takes a choice: the list to put
44
+ * in order, each pick's details, the app's own fields for this use of it, and Choose; one at a
45
+ * time, the one selected with its details, and no list. Docked at
46
+ * the media manager's end side where there's room, and an overlay over the library where there
47
+ * isn't.
48
+ */
49
+ declare const ChoicesPane: ({ choices, adapter, multiple, renderDetails, problemsOf, holdOf, held, badge, selectedText, note, onRemove, onMove, onClear, onChoose, onShowInLibrary, onClose, attributes, }: ChoicesPaneProps) => import("react").JSX.Element;
50
+ export default ChoicesPane;
@@ -0,0 +1,26 @@
1
+ import type { Ref } from "react";
2
+ interface ChooseBarProps {
3
+ /** How many are selected, in every library. */
4
+ count: number;
5
+ /** How many are selected, in words, for its button; "Selected" with none and no limit to say. */
6
+ selectedText: string | undefined;
7
+ /** That as many as may be are selected, said beside Choose while nothing holds it back. */
8
+ note: string | undefined;
9
+ /** What holds Choose back, said beside it, while picks can't be chosen; nothing otherwise. */
10
+ held: string | undefined;
11
+ /** Whether the selected column is open over the library. */
12
+ chosenOpen: boolean;
13
+ /** Whether there's a column to open: not one at a time with nothing selected. */
14
+ showOpener: boolean;
15
+ /** The button opening the selected column, which takes the focus back as it closes. */
16
+ openerRef: Ref<HTMLButtonElement>;
17
+ onOpenChosen: () => void;
18
+ /** Choose, while finishing is the app's to take; without it, the app takes the picks as they change. */
19
+ onChoose: (() => void) | undefined;
20
+ }
21
+ /**
22
+ * Under the library, where there's no room to dock the selected column: a button opening it over
23
+ * the library, with how many are selected, and Choose.
24
+ */
25
+ declare const ChooseBar: ({ count, selectedText, note, held, chosenOpen, showOpener, openerRef, onOpenChosen, onChoose, }: ChooseBarProps) => import("react").JSX.Element | null;
26
+ export default ChooseBar;
@@ -0,0 +1,7 @@
1
+ interface DropZoneProps {
2
+ /** What a drop does. */
3
+ label: string;
4
+ }
5
+ /** Over a library while files dragged over it can be dropped there. */
6
+ declare const DropZone: ({ label }: DropZoneProps) => import("react").JSX.Element;
7
+ export default DropZone;