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,112 @@
1
+ import type { FocusEvent, RefObject } from "react";
2
+ import type { FileAdapter, FileEntry, MediaFilterChip, MediaFilterForm, MediaFilterFormParams, MediaSection } from "../types/index.js";
3
+ type Filters = Readonly<Record<string, unknown>>;
4
+ interface LevelFiltersOptions {
5
+ section: MediaSection | undefined;
6
+ adapter: FileAdapter;
7
+ /** The group open, `null` at the library's root. */
8
+ group: FileEntry | null;
9
+ /** What the search holds of them, as the user set them; the form's defaults while undefined. */
10
+ values: Filters | undefined;
11
+ /** Changes what the search holds of them, from what it holds now, opening the search if it's closed. */
12
+ setValues: (update: (current: Filters | undefined) => Filters | undefined) => void;
13
+ }
14
+ /**
15
+ * A media library's filters at the level open, the media manager's and the picker's: its filter form
16
+ * (`MediaSection.filterForm`), only where the adapter has `search`, which applies them; what it holds,
17
+ * kept in the search (`MediaSearch.filters`), its defaults while nothing's set; and what's applied,
18
+ * which is what it holds while its `ready` says so, and what was applied before meanwhile, so a range
19
+ * with one end typed doesn't search for half of it. `filters` goes to the adapter's `search`, and
20
+ * `filtered`, whether any is applied, searches with nothing typed; `key` is what's applied as text,
21
+ * empty while nothing is, for saying a new count of what was found.
22
+ */
23
+ export declare const useLevelFilters: ({ section, adapter, group, values, setValues }: LevelFiltersOptions) => {
24
+ /** The form at the level open, or null where there's none, or no `search` to apply it. */
25
+ form: MediaFilterForm | null;
26
+ /** What it's drawn with. */
27
+ params: MediaFilterFormParams<Record<string, unknown>> | null;
28
+ /** How many are set, as the form holds them now. */
29
+ count: number;
30
+ /** Nothing set, as the form's `defaults` say it. */
31
+ defaults: Readonly<Record<string, unknown>>;
32
+ /** How many a form holding these would have set, for the dialog's own values. */
33
+ countOf: (of: Filters) => number;
34
+ /** Whether a form holding these can apply them, as its `ready` says, for the dialog's own values. */
35
+ readinessOf: (of: Filters) => string | boolean;
36
+ /** Those set, as the form names them, none where it names none (`MediaFilterForm.chips`). */
37
+ chips: readonly MediaFilterChip<Record<string, unknown>>[];
38
+ /** Whether the form names those set, for the row of chips. */
39
+ names: boolean;
40
+ /** Why what's held isn't applied yet: the form's reason, or false for none given; undefined while it is. */
41
+ heldBack: string | false | undefined;
42
+ /** What goes to the adapter's `search`, while there's a form. */
43
+ filters: Readonly<Record<string, unknown>> | undefined;
44
+ /** Whether any filter is applied, which searches with nothing typed. */
45
+ filtered: boolean;
46
+ /** What's applied as text, empty while nothing is. */
47
+ key: string;
48
+ /** Puts every filter back to its defaults. */
49
+ clear: () => void;
50
+ /** Puts these in place of what the form holds, as the dialog's Apply does. */
51
+ replace: (next: Filters) => void;
52
+ /** Takes one filter away, as its chip says. */
53
+ removeChip: (chip: MediaFilterChip) => void;
54
+ };
55
+ interface FiltersPanelOptions {
56
+ /** The level's filters, as `useLevelFilters` has them. */
57
+ filters: ReturnType<typeof useLevelFilters>;
58
+ /** The level open, which the card is drawn for, and goes with. */
59
+ levelKey: string;
60
+ /** What's typed in the search. */
61
+ query: string;
62
+ /** Whether the search field shows, which folding them away leaves open. */
63
+ fieldOpen: boolean;
64
+ /**
65
+ * Whether they show in a dialog over the frame, the rest of it out of reach, what's changed
66
+ * applying only with its Apply, rather than in a card over the results.
67
+ */
68
+ modal: boolean;
69
+ /** The frame, a press anywhere else in which folds the card away. */
70
+ frameRef: RefObject<HTMLElement | null>;
71
+ /** Closes the search, filters and all, the focus left where it is. */
72
+ stopSearching: () => void;
73
+ }
74
+ /**
75
+ * The card of a library's filters, dropping from the header's Filters button over the results, the
76
+ * media manager's and the picker's: shown at the level it was opened at, the search's field left as
77
+ * it was, as the chips under the header say what narrows the results, and the field showing behind
78
+ * the card would only fold it away as it's pressed. What's changed in it opens the search for it
79
+ * (`setFilters`), without the field. The button shows the card and puts the focus in its first field.
80
+ * Pressed again, or Escape in the card, folds it away, the focus going back to the button; a press
81
+ * anywhere else in the frame, or the focus moving there, folds it away too, leaving the focus where
82
+ * it went, as a menu does, while what portals out of the frame, an app's own popup in its form or its
83
+ * dialog, keeps it. Folded away with nothing set, nothing typed and the field closed, the search ends
84
+ * with it, as what's left of it is nothing. Clear all in the card puts the focus back in its first
85
+ * field. Folding away, the card stays drawn for its animation (`leaving`).
86
+ *
87
+ * With `modal`, the same opens a dialog over the frame instead, the rest of the frame inert meanwhile,
88
+ * so nothing outside it folds it away. It holds what's changed in it until its Apply (`apply`), which
89
+ * puts it in place of what the form held, opening the search for them if any is set, without the
90
+ * field; Cancel, Escape or a press around it (`close`) leaves the filters as they were. Both give the
91
+ * focus back to the Filters button once the frame isn't inert. Each opening is a `session` of its own,
92
+ * so what was changed and cancelled isn't there the next time.
93
+ */
94
+ export declare const useFiltersPanel: ({ filters, levelKey, query, fieldOpen, modal, frameRef, stopSearching, }: FiltersPanelOptions) => {
95
+ open: boolean;
96
+ /** Whether the card is drawn: while it shows, and while it folds away. */
97
+ drawn: boolean;
98
+ leaving: boolean;
99
+ /** Whether the dialog shows, which puts the rest of the frame out of reach. */
100
+ covers: boolean;
101
+ /** This opening, as the dialog's key, so each starts from what's applied. */
102
+ session: number;
103
+ id: string;
104
+ panelRef: RefObject<HTMLDivElement | null>;
105
+ buttonRef: RefObject<HTMLButtonElement | null>;
106
+ toggle: () => void;
107
+ close: () => void;
108
+ apply: (values: Readonly<Record<string, unknown>>) => void;
109
+ clear: () => void;
110
+ handleBlur: (event: FocusEvent<HTMLDivElement>) => void;
111
+ };
112
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { FileAdapter, FolderRef, MediaSection, SearchHit } from "../types/index.js";
2
+ /**
3
+ * A media library's search through its adapter's `search`, the media manager's and the picker's: the
4
+ * open level and everything below it, what's typed trimmed, a moment after the typing stops, and again
5
+ * as `changes` does, `delay` ms after it stops (the default when undefined), with what the library's
6
+ * filters hold as they're applied (`filters`), which ask with nothing typed while any is set
7
+ * (`filtered`). `on` is false without an adapter's `search`, or with nothing typed and no filter set,
8
+ * when the level is only filtered by name as it's listed. The matches are in the backend's order, so
9
+ * one coming on a later page doesn't move those before it, and `trails` has the groups between the
10
+ * level and each that's below it, by its id.
11
+ */
12
+ export declare const useLevelSearch: (section: MediaSection | undefined, adapter: FileAdapter, levelId: string, query: string, changes: number, delay?: number, filters?: Readonly<Record<string, unknown>>, filtered?: boolean) => {
13
+ on: boolean;
14
+ /** How it stands while it's on, as the grid goes by it; the bar shows over any found so far. */
15
+ status: "ready" | "error" | "loading";
16
+ searching: boolean;
17
+ error: unknown;
18
+ hits: SearchHit[];
19
+ trails: ReadonlyMap<string, readonly FolderRef[]>;
20
+ retry: () => void;
21
+ };
@@ -0,0 +1,10 @@
1
+ import type { LocaleText } from "../types/index.js";
2
+ type GivenText = Partial<LocaleText> | undefined;
3
+ /** The text and formats to show, from `LocaleContext`. */
4
+ export declare const useLocale: () => import("../types/index.js").Locale;
5
+ /**
6
+ * The locale `FileManager` and `MediaManager` provide, made afresh only when a text or `locale`
7
+ * changes, since every row rendered reads it and renders again with a new one.
8
+ */
9
+ export declare const useLocaleValue: (localeText: GivenText, locale: string | undefined) => import("../types/index.js").Locale;
10
+ export {};
@@ -0,0 +1,42 @@
1
+ import type { FileManagerLocation, LocationChangeReason } from "../types/index.js";
2
+ interface LocationHistoryOptions {
3
+ /** The consumer's location, when they control it, which they then change through `onChange`. */
4
+ location: FileManagerLocation | undefined;
5
+ /** Where the history starts when they don't. */
6
+ initial: () => FileManagerLocation;
7
+ /** Told every change of the current place, with why it changed. */
8
+ onChange?: (location: FileManagerLocation, reason: LocationChangeReason) => void;
9
+ }
10
+ /**
11
+ * Rewrites a place of the history, `current` saying whether it's the current one, or drops it by
12
+ * returning null. The current place can't be dropped, so null keeps it: return where it goes instead.
13
+ */
14
+ export type ReviseLocation = (place: FileManagerLocation, current: boolean) => FileManagerLocation | null;
15
+ /**
16
+ * The current place, with browser-style back and forward history, which the consumer may control.
17
+ *
18
+ * Uncontrolled, every change is made here and then told to `onChange`. Controlled, the current place
19
+ * is the consumer's `location`: a change is only asked of them through `onChange`, and made once
20
+ * they pass its place, so one they don't take never happens. The back and forward history stays
21
+ * here either way. A location they pass of their own is taken in by `passedOn`.
22
+ */
23
+ export declare const useLocationHistory: ({ location, initial, onChange }: LocationHistoryOptions) => {
24
+ place: FileManagerLocation;
25
+ /** Why the current place last changed. */
26
+ reason: LocationChangeReason | null;
27
+ /** Where `back` goes, if anywhere. */
28
+ previous: FileManagerLocation | undefined;
29
+ /** Where `forward` goes, if anywhere. */
30
+ next: FileManagerLocation | undefined;
31
+ /** Every place visited, oldest first, and which of them is the current one, for the history lists. */
32
+ places: FileManagerLocation[];
33
+ index: number;
34
+ canGoBack: boolean;
35
+ canGoForward: boolean;
36
+ navigate: (place: FileManagerLocation) => void;
37
+ back: () => void;
38
+ forward: () => void;
39
+ go: (by: number) => void;
40
+ revise: (update: ReviseLocation) => void;
41
+ };
42
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { MouseEvent, PointerEvent as ReactPointerEvent } from "react";
2
+ import type { HeldPress } from "../types/index.js";
3
+ interface LongPressOptions {
4
+ /**
5
+ * Called when an item has been held long enough, with where the press is, which a touch drag
6
+ * can go on from (`DragContext`'s `touch`).
7
+ */
8
+ onLongPress: (id: string, press: HeldPress) => void;
9
+ /** The item a press is on; by default an entry, found by its `data-entry-id`. */
10
+ itemAt?: (target: Element) => string | undefined;
11
+ /** Whether a press on a button counts, for items that are buttons; presses on controls stay taps otherwise. */
12
+ onButtons?: boolean;
13
+ }
14
+ /**
15
+ * Long-press on the entries of a surface, or on the items `itemAt` finds, for touch and pen. It
16
+ * runs on its own timer rather than on `contextmenu`, which iOS Safari never fires for a
17
+ * long-press. A press that moves or turns into a scroll (the browser sends `pointercancel`) is
18
+ * dropped, and the click that follows a long-press is swallowed so it doesn't act on the item a
19
+ * second time.
20
+ */
21
+ export declare const useLongPress: ({ onLongPress, itemAt, onButtons }: LongPressOptions) => {
22
+ onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;
23
+ onClickCapture: (event: MouseEvent) => void;
24
+ };
25
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { MouseEvent, PointerEvent as ReactPointerEvent } from "react";
2
+ import type { SelectModifiers } from "../types/index.js";
3
+ interface Box {
4
+ left: number;
5
+ top: number;
6
+ right: number;
7
+ bottom: number;
8
+ }
9
+ interface MarqueeOptions {
10
+ enabled: boolean;
11
+ /** The ids of the entries a box in viewport coordinates touches, in display order. */
12
+ entriesIn: (box: Box) => string[];
13
+ /**
14
+ * How far the entries are moved up the surface, in px, beyond what scrolling it does: a list
15
+ * too tall for the browser to lay out moves them as it scrolls (`useVirtualLines`' `drift`).
16
+ */
17
+ drift?: () => number;
18
+ /** Called once a press has moved far enough to become a marquee. */
19
+ onStart: () => void;
20
+ /** Called whenever the entries under the marquee change, with their ids in display order. */
21
+ onChange: (ids: string[], modifiers: SelectModifiers) => void;
22
+ }
23
+ /**
24
+ * Rubber-band selection over a surface of entries, which `entriesIn` finds by where the view lays
25
+ * them out rather than in the page, since a virtualized view only renders some of them. The
26
+ * rectangle is drawn by moving `marqueeRef`'s element directly, so dragging doesn't re-render the
27
+ * view; only a change in the covered entries reaches `onChange`. Mouse only: on touch, a drag scrolls.
28
+ */
29
+ export declare const useMarquee: ({ enabled, entriesIn, drift, onStart, onChange }: MarqueeOptions) => {
30
+ surfaceRef: import("react").RefObject<HTMLDivElement | null>;
31
+ marqueeRef: import("react").RefObject<HTMLDivElement | null>;
32
+ onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;
33
+ onClickCapture: (event: MouseEvent) => void;
34
+ };
35
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Says how many a media library's search found, as the file manager's folder search does, through
3
+ * `announce`: once what's typed has been answered (`count` set), and again for each new query or set of
4
+ * filters (`filterKey`, empty while none is set), not as a search asked again after a change finds more
5
+ * or fewer, which would cut off what that change said. Closing the search, or typing nothing with no
6
+ * filter set, forgets it, so the same query searched again is said again.
7
+ */
8
+ export declare const useMatchCount: (query: string, count: number | null, announce: (message: string) => void, textOf: (count: number) => string, filterKey?: string) => void;
@@ -0,0 +1,44 @@
1
+ import type { MediaSearch } from "../types/index.js";
2
+ interface MediaSearchOptions {
3
+ /** Names the component in the warnings about switching between controlled and not. */
4
+ component: string;
5
+ /** The app's search, when it keeps it: null while closed. */
6
+ value?: MediaSearch | null;
7
+ /** Where it starts, while the app doesn't keep it. */
8
+ defaultValue?: MediaSearch | null;
9
+ /** Told the search as it opens, as what's typed changes, and as it closes. */
10
+ onChange?: (search: MediaSearch | null) => void;
11
+ }
12
+ type Filters = Readonly<Record<string, unknown>>;
13
+ /**
14
+ * The search of a media library's header, the media manager's and the picker's: open or not, what's
15
+ * typed and what the library's filters hold, as one value the app may keep (`MediaSearch`, null while
16
+ * closed), and giving the focus to it and back, as the file manager's search does. Opening it focuses
17
+ * the field, or, open already, selects what's typed; closing it with the focus in the field gives the
18
+ * focus back to what had it, or else to the search button. A change the app keeps is only asked for,
19
+ * and the field is focused once it shows.
20
+ *
21
+ * The field shows while it's been opened (its button, Ctrl+F, the app) or holds what's typed
22
+ * (`fieldOpen`), not for the filters alone: what their card or dialog sets is part of the search, so
23
+ * the search runs, but the chips under the header say what narrows it, and the field showing behind
24
+ * the card would only fold it away as it's pressed. Closing the field, or leaving it with nothing
25
+ * typed, ends the search while no filter is set, and with some, clears only what's typed
26
+ * (`keepFilters`), the filters staying with their chips.
27
+ */
28
+ export declare const useMediaSearch: ({ component, value, defaultValue, onChange }: MediaSearchOptions) => {
29
+ search: MediaSearch | null;
30
+ query: string;
31
+ setQuery: (typed: string) => void;
32
+ filters: Readonly<Record<string, unknown>> | undefined;
33
+ setFilters: (update: (current: Filters | undefined) => Filters | undefined) => void;
34
+ searching: boolean;
35
+ /** Whether the field shows in the header, in place of the name. */
36
+ fieldOpen: boolean;
37
+ searchInputRef: import("react").RefObject<HTMLInputElement | null>;
38
+ searchButtonRef: import("react").RefObject<HTMLButtonElement | null>;
39
+ openSearch: (typed?: string, given?: Filters) => void;
40
+ stopSearching: () => void;
41
+ closeSearch: (keepFilters?: boolean) => void;
42
+ dismissSearch: (keepFilters?: boolean) => void;
43
+ };
44
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Section } from "../types/index.js";
2
+ /** Ids of the entries held that a section could be showing, those its adapter serves, with what holds each. */
3
+ export declare const useMovingIds: (section: Section) => import("../types/index.js").MovingKinds;
@@ -0,0 +1,39 @@
1
+ import type { SetStateAction } from "react";
2
+ /** What's selected, in the order set, and where a Shift-click's range starts, which is never the app's. */
3
+ export interface PicksState<P, A> {
4
+ items: readonly P[];
5
+ anchor: A | null;
6
+ }
7
+ interface PicksOptions<P, T, G> {
8
+ /** Names the component in the warning about switching between controlled and not. */
9
+ component: string;
10
+ /** What's selected, when the app keeps it. */
11
+ value: readonly G[] | undefined;
12
+ /** What's selected as it mounts, while the app doesn't. */
13
+ defaultValue: readonly G[] | undefined;
14
+ /** Told what's selected, as it changes. */
15
+ onChange: ((value: T[]) => void) | undefined;
16
+ /** The picks the app's list means, with `known`, those it was last told of and those kept, for what it can't say. */
17
+ given: (list: readonly G[], known: readonly P[]) => P[];
18
+ /** The list the app is told of, for picks. */
19
+ told: (items: readonly P[]) => T[];
20
+ /** Whether two picks are one to the app: a new listing's entry for an asset isn't a change. */
21
+ sameItem: (a: P, b: P) => boolean;
22
+ keyOf: (item: P) => string;
23
+ }
24
+ /**
25
+ * What's selected in a media manager or a picker, which the app may keep, as a controlled prop is: `value` while it's passed, or else kept here, starting at `defaultValue`. Its picks hold more
26
+ * than the app's list says (where each was picked, what's been listed of it since), so while the app
27
+ * keeps it they're made from its list as it changes.
28
+ *
29
+ * Every change goes through the setter returned, and only one the app would see is told. While
30
+ * the app keeps the list, such a change is only asked for, the rest being made at once. Two changes
31
+ * in one event build on each other, the second seeing the first until the next render says what came of it.
32
+ * What the app gives (`G`) may ask less of it than what it's told of (`T`).
33
+ */
34
+ export declare const usePicks: <P, A, T, G = T>({ component, value, defaultValue, onChange, given, told, sameItem, keyOf, }: PicksOptions<P, T, G>) => {
35
+ picks: PicksState<P, A>;
36
+ setPicks: (next: SetStateAction<PicksState<P, A>>) => void;
37
+ dropGone: (goneKeys: readonly string[]) => void;
38
+ };
39
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { FileAdapter, FileEntry, PreviewContent, PreviewPlan } from "../types/index.js";
2
+ interface PreviewContentsOptions {
3
+ /** The adapter serving a file, as the files may come from several sections. */
4
+ adapterOf: (entry: FileEntry) => FileAdapter;
5
+ entries: FileEntry[];
6
+ /** The file shown, in `entries`. */
7
+ index: number;
8
+ /** Which way from it the file to load ahead lies, the way the last step went; null for none. */
9
+ ahead: 1 | -1 | null;
10
+ /**
11
+ * Whether the browser is still loading the file shown from its URL, as it does a picture or a
12
+ * video. The file ahead waits for it, so the two don't share the bandwidth.
13
+ */
14
+ pending: boolean;
15
+ /** How a file is shown, and so what's loaded for it. */
16
+ planOf: (entry: FileEntry) => PreviewPlan;
17
+ }
18
+ /**
19
+ * What the preview has loaded to show `entries[index]`, through its adapter's `content`, and the
20
+ * file one step further on, loaded ahead once the file shown has come, so stepping on shows it at
21
+ * once. What was loaded is kept for the files one step either side of the one shown, so stepping
22
+ * back is as quick, and dropped for the rest: their loads are aborted, their object URLs revoked
23
+ * and their fonts taken off the page, so coming back to one loads it afresh. Files the preview can
24
+ * only describe, and those a previewer of the app's own shows without loading, aren't fetched.
25
+ */
26
+ export declare const usePreviewContents: ({ adapterOf, entries, index, ahead, pending, planOf }: PreviewContentsOptions) => {
27
+ content: PreviewContent | null;
28
+ attempt: number;
29
+ fail: (failed: FileEntry, error: unknown) => void;
30
+ retry: (again: FileEntry) => void;
31
+ more: (read: FileEntry, limit: number) => void;
32
+ };
33
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { PropertiesCache } from "../store/properties-cache.js";
2
+ import type { EntryProperties, EntryTotals, PropertiesItem, Requested } from "../types/index.js";
3
+ interface UsePropertiesOptions {
4
+ cache: PropertiesCache;
5
+ /**
6
+ * The host's count of its changes, which counts what's in folders again once it has stopped
7
+ * going up for a moment, keeping the totals counted before meanwhile.
8
+ */
9
+ changes: number;
10
+ showHidden: boolean;
11
+ /** Whether what's in folders is wanted, which a host showing no totals doesn't ask the backend for. */
12
+ measures?: boolean;
13
+ }
14
+ /**
15
+ * What the adapters add to what the items' listings say: one item's properties, when its adapter
16
+ * has `properties`, and what's in the items' folders, when every one of their adapters has
17
+ * `measure`, both kept in `cache`. Undefined for what isn't asked for.
18
+ */
19
+ export declare const useProperties: (items: readonly PropertiesItem[], { cache, changes, showHidden, measures }: UsePropertiesOptions) => {
20
+ details: Requested<EntryProperties> | undefined;
21
+ totals: Requested<EntryTotals> | undefined;
22
+ retryDetails: () => void;
23
+ retryTotals: () => void;
24
+ };
25
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { ScrollTarget, ScrollView } from "../types/index.js";
2
+ /**
3
+ * The tallest a list is laid out, in px. Browsers cap an element's height (Firefox at about 17.9
4
+ * million px, Chrome and Safari at about 33.5 million) and place things less precisely long
5
+ * before, so a list that would be taller is laid out this tall and squeezed into it (`Squeeze`).
6
+ */
7
+ export declare const MAX_LIST_HEIGHT = 6000000;
8
+ /** How tall a list of `height` px is laid out, in px. */
9
+ export declare const laidHeight: (height: number) => number;
10
+ /**
11
+ * Measures a list against the panel it scrolls in, for rendering only what's in or near view:
12
+ * after every render, as the panel scrolls, and as either resizes. The measure is state, which
13
+ * renders again only when `same` says it changed, and a scroll or resize that changes it renders
14
+ * at once, so what scrolls in is there in the frame that shows it.
15
+ *
16
+ * `measure` is handed a `ScrollView` of the panel, whose `place` lays the list out for its whole
17
+ * height, squeezing it into `MAX_LIST_HEIGHT` when it's taller, and says what of it the panel
18
+ * shows, in px of the whole list. Items are rendered at their place in the whole list less
19
+ * `offset`, and the list takes `laidHeight` of its height.
20
+ *
21
+ * `ref` goes on the list. `target` holds it and its panel, to be read outside rendering, and
22
+ * `settled` says whether the latest render matched the measure, as it doesn't when the list has
23
+ * just mounted. `show` scrolls to a part of the list, and `drift` says how far the items shown
24
+ * are moved up it.
25
+ */
26
+ export declare const useScrollMeasure: <T>(measure: (view: ScrollView) => T, initial: T, same: (a: T, b: T) => boolean) => {
27
+ ref: (list: HTMLElement | null) => void;
28
+ target: import("react").RefObject<ScrollTarget | null>;
29
+ measured: T;
30
+ offset: number;
31
+ settled: () => boolean;
32
+ show: (top: number, bottom: number, element?: HTMLElement | null) => void;
33
+ drift: () => number;
34
+ };
@@ -0,0 +1,12 @@
1
+ import type { SearchTarget, SectionSearch } from "../types/index.js";
2
+ /**
3
+ * Searches every target's section for `query`, with its adapter's `search`, `delay` ms after the
4
+ * typing stops, and again whenever `showHidden`, `version` or what `filters` hold changes, page after
5
+ * page until the last. Each section is searched on its own, so one that's slow or fails holds up none
6
+ * of the others. A section searched again keeps showing what it found before until its first page
7
+ * comes. `filters`, a media library's, go to the adapter as they are; the file manager has none.
8
+ */
9
+ export declare const useSearch: (targets: readonly SearchTarget[], query: string, showHidden: boolean, version: number, delay?: number, filters?: Readonly<Record<string, unknown>>) => {
10
+ searches: ReadonlyMap<string, SectionSearch>;
11
+ retry: (sectionIds: readonly string[]) => void;
12
+ };
@@ -0,0 +1,29 @@
1
+ import type { EntrySelection, FileEntry, SelectModifiers } from "../types/index.js";
2
+ interface SelectionOptions {
3
+ /** The selected ids, while the consumer controls them; the hook keeps its own otherwise. */
4
+ ids?: ReadonlySet<string>;
5
+ /** The ids the hook's own selection starts with. */
6
+ initialIds?: readonly string[];
7
+ /**
8
+ * Told every change made through the hook as it's made, with the entries it selects. It's how a
9
+ * controlled selection changes, since the hook then doesn't change the ids itself.
10
+ */
11
+ onChange?: (ids: ReadonlySet<string>, selected: FileEntry[]) => void;
12
+ }
13
+ /**
14
+ * The selection among a folder's entries, which `entries` must list in display order for Shift
15
+ * ranges. Controlled through `ids`, only the anchor is kept here.
16
+ */
17
+ export declare const useSelection: (entries: FileEntry[] | undefined, { ids, initialIds, onChange }?: SelectionOptions) => {
18
+ selection: EntrySelection;
19
+ selectedIds: ReadonlySet<string>;
20
+ selected: FileEntry[];
21
+ /** The ids last set through the hook, which a controlled selection follows once the consumer takes them. */
22
+ requestedIds: ReadonlySet<string>;
23
+ select: (id: string, modifiers?: SelectModifiers, fallbackAnchor?: string) => void;
24
+ replace: (next: EntrySelection) => void;
25
+ selectAll: () => void;
26
+ clear: () => void;
27
+ retain: (listed: ReadonlySet<string>) => void;
28
+ };
29
+ export {};
@@ -0,0 +1,21 @@
1
+ interface SettingOptions<T> {
2
+ /** Names the setting in the warnings about switching between controlled and not. */
3
+ name: string;
4
+ /** Names the component in those warnings; `FileManager` when omitted. */
5
+ component?: string;
6
+ /** The consumer's value, when they control it. */
7
+ value: T | undefined;
8
+ defaultValue: T;
9
+ onChange?: (value: T) => void;
10
+ /** Whether two values are the same setting; `Object.is` when omitted. */
11
+ equal?: (a: T, b: T) => boolean;
12
+ }
13
+ /**
14
+ * A setting of the file manager the consumer may control, as a controlled prop is: `value`
15
+ * while they pass it, or else one kept here, starting at `defaultValue`. Setting it tells them
16
+ * through `onChange` either way, and changes it here only when they don't pass `value`. Setting
17
+ * it to what it is does nothing. It's set to a value, or with a function of the value as of the
18
+ * latest render.
19
+ */
20
+ export declare const useSetting: <T>({ name, component, value, defaultValue, onChange, equal, }: SettingOptions<T>) => readonly [T, (next: T | ((value: T) => T)) => void];
21
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `values` as a set that stays the same object for as long as it holds the same values, so a
3
+ * consumer passing a new array of them each render doesn't count as a change. Undefined while
4
+ * `values` is.
5
+ */
6
+ export declare const useStableSet: (values: Iterable<string> | undefined) => ReadonlySet<string> | undefined;
@@ -0,0 +1,41 @@
1
+ import type { PointerEvent, RefObject } from "react";
2
+ /** How far, in px, something panned by the finger can still go with the finger moving left and right. */
3
+ export interface Room {
4
+ left: number;
5
+ right: number;
6
+ }
7
+ interface SwipeOptions {
8
+ /** The element that follows the finger, inside the one the handlers go on. */
9
+ ref: RefObject<HTMLElement | null>;
10
+ /** Whether there's anything `direction` way: 1 on, -1 back. */
11
+ canStep: (direction: 1 | -1) => boolean;
12
+ onStep: (direction: 1 | -1) => void;
13
+ /**
14
+ * How far what's under the finger pans with it, as a zoomed image does, before the swipe takes
15
+ * over the rest of the finger's way; null while nothing pans.
16
+ */
17
+ room?: () => Room | null;
18
+ }
19
+ /**
20
+ * Swiping sideways on touch to step through what's shown one at a time. The content follows the
21
+ * finger, and once the swipe has crossed a quarter of the width, or was flicked, it steps (towards
22
+ * the end when swiping towards the start: left in LTR) and the content stepped to slides in.
23
+ * Otherwise it springs back, as it does from a side with nothing more, which it follows only part
24
+ * of the way. A scroll (`pointercancel`) cancels it, and so does a second finger, leaving the pinch
25
+ * to what's under it. What pans with the finger, a zoomed image, does so up to its edge, and the
26
+ * swipe takes the rest of the way from there, as a photo viewer's does.
27
+ *
28
+ * `slide` slides the content in the same way for a step made otherwise, by a button or a key.
29
+ *
30
+ * The handlers go on an element whose `touch-action` leaves sideways moves to the page (`pan-y`).
31
+ */
32
+ export declare const useSwipe: (options: SwipeOptions) => {
33
+ handlers: {
34
+ onPointerDownCapture: (event: PointerEvent<HTMLElement>) => void;
35
+ onPointerMove: (event: PointerEvent<HTMLElement>) => void;
36
+ onPointerUp: (event: PointerEvent<HTMLElement>) => void;
37
+ onPointerCancel: (event: PointerEvent<HTMLElement>) => void;
38
+ };
39
+ slide: (direction: 1 | -1) => void;
40
+ };
41
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { RefObject } from "react";
2
+ import type { TextDirection } from "../types/index.js";
3
+ /**
4
+ * Which way the text runs where `ref`'s element is, as a `dir` on it or above it sets it: read once
5
+ * the element is in the page, before it's painted, and again whenever any `dir` in the page changes,
6
+ * as it does when an app switches language.
7
+ */
8
+ export declare const useTextDirection: (ref: RefObject<HTMLElement | null>) => TextDirection;
@@ -0,0 +1,8 @@
1
+ import type { FileAdapter, FileEntry, ViewMode } from "../types/index.js";
2
+ /**
3
+ * The URL of a file's thumbnail for a view, `rem` square, once the adapter has given one and it
4
+ * has loaded; null until then, and for folders, unless they're asked for too (`folders`, the media
5
+ * manager's groups), files with none, or an adapter without `thumbnail`. It's asked for while the
6
+ * component is mounted, so only the entries rendered, those in or near view, ask for theirs.
7
+ */
8
+ export declare const useThumbnail: (entry: FileEntry, adapter: FileAdapter | undefined, view: ViewMode | undefined, rem: number, folders?: boolean) => string | null;
@@ -0,0 +1,22 @@
1
+ import type { AcrossText } from "../store/transfer-across.js";
2
+ import type { TransferEnded } from "../store/transfer-queue.js";
3
+ /**
4
+ * A copy and move queue for as long as the component using it is mounted; unmounting cancels
5
+ * whatever is still under way. `onEnded` is told as each copy or move ends (see
6
+ * `createTransferQueue`), and `text` words a copy between adapters; both may change from render to
7
+ * render.
8
+ */
9
+ export declare const useTransferQueue: (onEnded: TransferEnded, text: AcrossText) => {
10
+ queue: {
11
+ getItems: () => import("../types/index.js").TransferItem[];
12
+ subscribe: (listener: () => void) => () => void;
13
+ add(kind: import("../types/index.js").TransferKind, adapter: import("../index.js").FileAdapter, targetAdapter: import("../index.js").FileAdapter, entries: import("../index.js").FileEntry[], source: import("../index.js").FolderRef, target: import("../index.js").FolderRef, conflict: import("../index.js").ConflictPolicy, after?: number): number;
14
+ cancel(id: number): void;
15
+ cancelAll(): void;
16
+ forget(id: number): void;
17
+ setMaxActive(count?: number): void;
18
+ clear(): void;
19
+ abortAll(): void;
20
+ };
21
+ items: import("../types/index.js").TransferItem[];
22
+ };
@@ -0,0 +1,9 @@
1
+ import type { FlatTree, Section, SectionGroup } from "../types/index.js";
2
+ /**
3
+ * The sidebar tree as a flat list of the rows it shows: the sections of `groups` with the folders
4
+ * below the expanded ones, or `single`'s folders. Reading every listing it shows from the store,
5
+ * it's flattened again whenever any listing changes. A folder is listed once the tree comes to
6
+ * show its folders, as it's expanded or one above it is, and listed again in the background then
7
+ * once its listing is `relistAfter` old. Hidden folders are left out unless `showHidden`.
8
+ */
9
+ export declare const useTreeRows: (groups: SectionGroup[], single: Section | null, expanded: ReadonlySet<string>, showHidden: boolean) => FlatTree;
@@ -0,0 +1,19 @@
1
+ import type { SelectModifiers, TreeSelection, TreeTarget } from "../types/index.js";
2
+ /**
3
+ * The sidebar tree's selection, kept apart from the content's. While nothing has been Ctrl-,
4
+ * Shift- or right-clicked, `selection` is null and the open folder alone counts as selected;
5
+ * opening another folder returns to that.
6
+ *
7
+ * On touch, the "Select" of a folder's menu (`ActionContext.select`) starts the selection mode
8
+ * (`selecting`), in which every tap toggles a folder. It ends with the selection: as a folder
9
+ * opens, a section's menu opens, or `reset`.
10
+ */
11
+ export declare const useTreeSelection: (openKey: string | null) => {
12
+ selection: TreeSelection | null;
13
+ selecting: boolean;
14
+ select: (target: TreeTarget, modifiers?: SelectModifiers) => void;
15
+ startSelecting: (target: TreeTarget) => void;
16
+ selectKeys: (keys: string[]) => void;
17
+ selectSection: (key: string) => void;
18
+ reset: () => void;
19
+ };