filecove 0.1.0 → 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 (203) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/buttons/toolbar-actions.d.ts +1 -1
  3. package/dist/components/buttons/tooltip-icon-button.d.ts +1 -1
  4. package/dist/components/downloads/download-panel.d.ts +1 -1
  5. package/dist/components/drag/drag-preview.d.ts +24 -0
  6. package/dist/components/file-manager/announcer.d.ts +1 -1
  7. package/dist/components/file-manager/content/file-grid.d.ts +1 -1
  8. package/dist/components/file-manager/content/file-list.d.ts +1 -1
  9. package/dist/components/file-manager/content/folder-view.d.ts +1 -1
  10. package/dist/components/file-manager/content/item-icon.d.ts +1 -1
  11. package/dist/components/file-manager/content/search-results.d.ts +1 -1
  12. package/dist/components/file-manager/content/search-tabs.d.ts +1 -1
  13. package/dist/components/file-manager/content/trash-bar.d.ts +1 -1
  14. package/dist/components/file-manager/context-menu/context-menu.d.ts +1 -1
  15. package/dist/components/file-manager/dialogs/conflict-step.d.ts +1 -1
  16. package/dist/components/file-manager/dialogs/delete-dialog.d.ts +3 -2
  17. package/dist/components/file-manager/dialogs/image-viewer.d.ts +1 -1
  18. package/dist/components/file-manager/dialogs/name-dialog.d.ts +1 -1
  19. package/dist/components/file-manager/dialogs/paste-dialog.d.ts +1 -1
  20. package/dist/components/file-manager/dialogs/preview-dialog.d.ts +2 -2
  21. package/dist/components/file-manager/dialogs/restore-dialog.d.ts +1 -1
  22. package/dist/components/file-manager/dialogs/shortcuts-dialog.d.ts +1 -1
  23. package/dist/components/file-manager/dialogs/transfer-dialog.d.ts +2 -2
  24. package/dist/components/file-manager/dialogs/upload-dialog.d.ts +1 -1
  25. package/dist/components/file-manager/file-manager.d.ts +1 -1
  26. package/dist/components/file-manager/header-bar/header-bar.d.ts +1 -1
  27. package/dist/components/file-manager/header-bar/history-menu.d.ts +1 -1
  28. package/dist/components/file-manager/header-bar/path-bar.d.ts +1 -1
  29. package/dist/components/file-manager/header-bar/search-field.d.ts +1 -1
  30. package/dist/components/file-manager/header-bar/search-sections-menu.d.ts +1 -1
  31. package/dist/components/file-manager/header-bar/view-menu.d.ts +1 -1
  32. package/dist/components/file-manager/notice-bar.d.ts +1 -1
  33. package/dist/components/file-manager/properties-pane.d.ts +2 -2
  34. package/dist/components/file-manager/sidebar/location-item.d.ts +1 -1
  35. package/dist/components/file-manager/sidebar/main-menu.d.ts +1 -1
  36. package/dist/components/file-manager/sidebar/sidebar.d.ts +2 -2
  37. package/dist/components/icons/create-icon.d.ts +1 -1
  38. package/dist/components/icons/icon-provider.d.ts +1 -1
  39. package/dist/components/icons/icon-slot.d.ts +1 -1
  40. package/dist/components/icons/icon.d.ts +1 -1
  41. package/dist/components/media-manager/asset-delete.d.ts +20 -8
  42. package/dist/components/media-manager/asset-hold.d.ts +1 -1
  43. package/dist/components/media-manager/asset-option.d.ts +13 -2
  44. package/dist/components/media-manager/asset-trail.d.ts +1 -1
  45. package/dist/components/media-manager/choice-list.d.ts +1 -1
  46. package/dist/components/media-manager/choices-pane.d.ts +1 -1
  47. package/dist/components/media-manager/group-create.d.ts +1 -1
  48. package/dist/components/media-manager/group-path.d.ts +8 -2
  49. package/dist/components/media-manager/library-list.d.ts +4 -2
  50. package/dist/components/media-manager/media-asset.d.ts +19 -7
  51. package/dist/components/media-manager/media-edit-many.d.ts +33 -0
  52. package/dist/components/media-manager/media-fields.d.ts +1 -1
  53. package/dist/components/media-manager/media-filter-chips.d.ts +17 -0
  54. package/dist/components/media-manager/media-filters-dialog.d.ts +39 -0
  55. package/dist/components/media-manager/media-filters.d.ts +37 -0
  56. package/dist/components/media-manager/media-form.d.ts +3 -1
  57. package/dist/components/media-manager/media-frame.d.ts +7 -3
  58. package/dist/components/media-manager/media-grid.d.ts +34 -5
  59. package/dist/components/media-manager/media-group.d.ts +1 -1
  60. package/dist/components/media-manager/media-header.d.ts +20 -3
  61. package/dist/components/media-manager/media-manager.d.ts +33 -10
  62. package/dist/components/media-manager/media-move.d.ts +19 -11
  63. package/dist/components/media-manager/media-picker.d.ts +25 -7
  64. package/dist/components/media-manager/media-picture.d.ts +1 -1
  65. package/dist/components/media-manager/media-process.d.ts +1 -1
  66. package/dist/components/media-manager/media-row.d.ts +1 -1
  67. package/dist/components/media-manager/media-tile.d.ts +1 -1
  68. package/dist/components/media-manager/media-upload.d.ts +28 -6
  69. package/dist/components/media-manager/picker-frame.d.ts +6 -2
  70. package/dist/components/media-manager/selection-bar.d.ts +25 -0
  71. package/dist/components/media-manager/upload-tile.d.ts +5 -3
  72. package/dist/components/properties/properties-panel.d.ts +9 -3
  73. package/dist/components/properties/property-display.d.ts +1 -1
  74. package/dist/components/properties/property-editor.d.ts +1 -1
  75. package/dist/components/properties/property-input.d.ts +1 -1
  76. package/dist/components/transfers/transfer-panel.d.ts +1 -1
  77. package/dist/components/ui/dialog.d.ts +1 -1
  78. package/dist/components/ui/root-providers.d.ts +1 -1
  79. package/dist/components/uploads/upload-panel.d.ts +8 -2
  80. package/dist/contexts/cut-context.d.ts +1 -1
  81. package/dist/contexts/data-context.d.ts +3 -3
  82. package/dist/contexts/direction-context.d.ts +1 -1
  83. package/dist/contexts/drag-context.d.ts +1 -1
  84. package/dist/contexts/icon-context.d.ts +1 -1
  85. package/dist/contexts/locale-context.d.ts +1 -1
  86. package/dist/contexts/moving-context.d.ts +1 -1
  87. package/dist/hooks/use-asset-states.d.ts +1 -1
  88. package/dist/hooks/use-clipboard-follow.d.ts +2 -2
  89. package/dist/hooks/use-cut-ids.d.ts +1 -1
  90. package/dist/hooks/use-dev-checks.d.ts +16 -0
  91. package/dist/hooks/use-download-queue.d.ts +3 -3
  92. package/dist/hooks/use-dragged-ids.d.ts +1 -1
  93. package/dist/hooks/use-drop-target.d.ts +1 -1
  94. package/dist/hooks/use-entry-drag.d.ts +2 -2
  95. package/dist/hooks/use-files-drop.d.ts +7 -1
  96. package/dist/hooks/use-folder.d.ts +3 -3
  97. package/dist/hooks/use-icon-config.d.ts +1 -1
  98. package/dist/hooks/use-level-filters.d.ts +112 -0
  99. package/dist/hooks/use-level-search.d.ts +8 -6
  100. package/dist/hooks/use-locale.d.ts +3 -3
  101. package/dist/hooks/use-location-history.d.ts +1 -1
  102. package/dist/hooks/use-long-press.d.ts +1 -1
  103. package/dist/hooks/use-marquee.d.ts +1 -1
  104. package/dist/hooks/use-match-count.d.ts +5 -4
  105. package/dist/hooks/use-media-search.d.ts +22 -8
  106. package/dist/hooks/use-moving-ids.d.ts +2 -2
  107. package/dist/hooks/use-preview-contents.d.ts +1 -1
  108. package/dist/hooks/use-properties.d.ts +2 -2
  109. package/dist/hooks/use-scroll-measure.d.ts +1 -1
  110. package/dist/hooks/use-search.d.ts +6 -5
  111. package/dist/hooks/use-selection.d.ts +1 -1
  112. package/dist/hooks/use-text-direction.d.ts +1 -1
  113. package/dist/hooks/use-thumbnail.d.ts +1 -1
  114. package/dist/hooks/use-transfer-queue.d.ts +5 -5
  115. package/dist/hooks/use-tree-rows.d.ts +1 -1
  116. package/dist/hooks/use-tree-selection.d.ts +1 -1
  117. package/dist/hooks/use-upload-queue.d.ts +7 -5
  118. package/dist/hooks/use-virtual-lines.d.ts +1 -1
  119. package/dist/hooks/use-wheel-zoom.d.ts +1 -1
  120. package/dist/icon-sets/filled.d.ts +1 -1
  121. package/dist/icon-sets/outlined.d.ts +1 -1
  122. package/dist/icon-sets/rounded.d.ts +1 -1
  123. package/dist/icon-sets/sharp.d.ts +1 -1
  124. package/dist/icon-sets/two-tone.d.ts +1 -1
  125. package/dist/index.d.ts +18 -18
  126. package/dist/index.js +4307 -1129
  127. package/dist/index.js.map +1 -1
  128. package/dist/locales/en-us.d.ts +1 -1
  129. package/dist/store/download-queue.d.ts +1 -1
  130. package/dist/store/folder-store.d.ts +1 -1
  131. package/dist/store/properties-cache.d.ts +9 -1
  132. package/dist/store/thumbnail-cache.d.ts +1 -1
  133. package/dist/store/transfer-across.d.ts +1 -1
  134. package/dist/store/transfer-queue.d.ts +2 -2
  135. package/dist/store/upload-queue.d.ts +28 -8
  136. package/dist/styles/classes.d.ts +30 -2
  137. package/dist/styles/layout.d.ts +2 -2
  138. package/dist/styles/media-layout.d.ts +1 -1
  139. package/dist/styles.css +1095 -367
  140. package/dist/styles.layer.css +1095 -367
  141. package/dist/types/action.d.ts +3 -3
  142. package/dist/types/adapter.d.ts +164 -11
  143. package/dist/types/api.d.ts +21 -9
  144. package/dist/types/clipboard.d.ts +2 -2
  145. package/dist/types/download.d.ts +1 -1
  146. package/dist/types/drag.d.ts +4 -4
  147. package/dist/types/folder.d.ts +1 -1
  148. package/dist/types/index.d.ts +27 -27
  149. package/dist/types/locale.d.ts +161 -4
  150. package/dist/types/main-menu.d.ts +1 -1
  151. package/dist/types/media.d.ts +127 -11
  152. package/dist/types/menu.d.ts +4 -4
  153. package/dist/types/navigation.d.ts +2 -2
  154. package/dist/types/preview.d.ts +1 -1
  155. package/dist/types/previewer.d.ts +1 -1
  156. package/dist/types/properties.d.ts +20 -2
  157. package/dist/types/property-definition.d.ts +58 -1
  158. package/dist/types/search.d.ts +2 -2
  159. package/dist/types/section.d.ts +2 -2
  160. package/dist/types/selection.d.ts +3 -3
  161. package/dist/types/slots.d.ts +12 -7
  162. package/dist/types/transfer.d.ts +2 -2
  163. package/dist/types/tree.d.ts +2 -2
  164. package/dist/types/undo.d.ts +3 -3
  165. package/dist/types/upload.d.ts +79 -3
  166. package/dist/types/view.d.ts +5 -5
  167. package/dist/utils/action-groups.d.ts +1 -1
  168. package/dist/utils/clipboard.d.ts +2 -2
  169. package/dist/utils/dom.d.ts +13 -0
  170. package/dist/utils/download.d.ts +1 -1
  171. package/dist/utils/field-errors.d.ts +1 -1
  172. package/dist/utils/files.d.ts +9 -5
  173. package/dist/utils/format.d.ts +1 -1
  174. package/dist/utils/groups.d.ts +1 -1
  175. package/dist/utils/hidden.d.ts +1 -1
  176. package/dist/utils/keyboard.d.ts +1 -1
  177. package/dist/utils/media.d.ts +82 -5
  178. package/dist/utils/menu-position.d.ts +1 -1
  179. package/dist/utils/names.d.ts +1 -1
  180. package/dist/utils/navigation.d.ts +1 -1
  181. package/dist/utils/path.d.ts +2 -2
  182. package/dist/utils/permissions.d.ts +2 -2
  183. package/dist/utils/preview.d.ts +1 -1
  184. package/dist/utils/property-value.d.ts +3 -1
  185. package/dist/utils/search.d.ts +1 -1
  186. package/dist/utils/sections.d.ts +1 -1
  187. package/dist/utils/selection.d.ts +1 -1
  188. package/dist/utils/shortcut.d.ts +1 -1
  189. package/dist/utils/slots.d.ts +2 -2
  190. package/dist/utils/sort.d.ts +1 -1
  191. package/dist/utils/transfer.d.ts +1 -1
  192. package/dist/utils/trash.d.ts +1 -1
  193. package/dist/utils/undo.d.ts +1 -1
  194. package/dist/utils/zoom.d.ts +2 -2
  195. package/docs/README.md +1 -1
  196. package/docs/adapter.md +66 -6
  197. package/docs/customizing.md +31 -2
  198. package/docs/getting-started.md +3 -1
  199. package/docs/media-manager.md +194 -7
  200. package/docs/search.md +2 -0
  201. package/docs/uploads-and-downloads.md +2 -1
  202. package/package.json +1 -1
  203. package/dist/components/file-manager/drag-preview.d.ts +0 -22
@@ -0,0 +1,25 @@
1
+ import type { Ref } from "react";
2
+ interface SelectionBarProps {
3
+ /** How many of those shown are selected. */
4
+ count: number;
5
+ onClear: () => void;
6
+ /** Selects everything shown; missing once it is. */
7
+ onSelectAll: (() => void) | undefined;
8
+ /** Opens Edit fields for them; missing while they share no field that can be changed. */
9
+ onEditFields: (() => void) | undefined;
10
+ /** Asks where they go; missing while they can't all be moved. */
11
+ onMove: (() => void) | undefined;
12
+ /** Asks before deleting them; missing while they can't all be deleted. */
13
+ onDelete: (() => void) | undefined;
14
+ /** The buttons the focus goes back to as what they opened closes. */
15
+ editRef: Ref<HTMLButtonElement>;
16
+ moveRef: Ref<HTMLButtonElement>;
17
+ deleteRef: Ref<HTMLButtonElement>;
18
+ }
19
+ /**
20
+ * At the library's foot while the media manager is browsing and something shown is selected, as a web
21
+ * drive's selection toolbar is: Clear selection, how many, Select all, Edit fields…, Move to… and
22
+ * Delete, each as it can be done. Not while it takes picks, whose selected column and choose bar are what's selected for.
23
+ */
24
+ declare const SelectionBar: ({ count, onClear, onSelectAll, onEditFields, onMove, onDelete, editRef, moveRef, deleteRef, }: SelectionBarProps) => import("react").JSX.Element;
25
+ export default SelectionBar;
@@ -1,6 +1,7 @@
1
- import type { FileUploadItem, MediaKind, MediaLayout } from "../../types";
1
+ import type { MediaKind, MediaLayout, UploadItem } from "../../types/index.js";
2
2
  interface UploadTileProps {
3
- item: FileUploadItem;
3
+ /** A file being uploaded, or a folder being made a group, until the group is listed. */
4
+ item: UploadItem;
4
5
  /** The library's kind, whose tiles' shape it takes. */
5
6
  kind: MediaKind;
6
7
  /** How the library shows its assets: as tiles, or as rows. */
@@ -9,7 +10,8 @@ interface UploadTileProps {
9
10
  /**
10
11
  * A file being uploaded into the open library, shown before its assets as they are, as a tile of the
11
12
  * library's shape or a row: the picture itself when it's one, else its icon, faded, with how far
12
- * it's got. It's no asset yet, so it can't be selected or opened; the upload panel cancels it.
13
+ * it's got; or a folder being made a group, by a folder's icon, until the group is listed. It's no
14
+ * asset yet, so it can't be selected or opened; the upload panel cancels it.
13
15
  */
14
16
  declare const UploadTile: ({ item, kind, layout }: UploadTileProps) => import("react").JSX.Element;
15
17
  export default UploadTile;
@@ -1,5 +1,5 @@
1
- import type { PropertiesCache } from "../../store/properties-cache";
2
- import type { PropertiesItem, PropertyDefinitionGroup, SlotAttributes, ToolbarGroup } from "../../types";
1
+ import type { PropertiesCache } from "../../store/properties-cache.js";
2
+ import type { PartUploads, PropertiesItem, PropertyDefinitionGroup, SlotAttributes, ToolbarGroup } from "../../types/index.js";
3
3
  interface PropertiesPanelProps {
4
4
  /** What it shows: one entry, several, or none, which asks for something to be selected. */
5
5
  items: readonly PropertiesItem[];
@@ -30,6 +30,12 @@ interface PropertiesPanelProps {
30
30
  * functions say. Without them, the backend's groups show as the adapter describes them.
31
31
  */
32
32
  definitions?: readonly PropertyDefinitionGroup[];
33
+ /**
34
+ * Uploading into the parts of the one entry it shows, for the definitions that say they take files
35
+ * (`PropertyDefinition.upload`): their Upload buttons, and the files being sent listed under them.
36
+ * The media manager's asset view hands it over for an asset whose library can take them.
37
+ */
38
+ parts?: PartUploads;
33
39
  /** Closes the panel, from its header's ✕; not shown while `embedded`. */
34
40
  onClose?: () => void;
35
41
  /** The host app's attributes for the panel (the file manager's `slotProps.properties`). */
@@ -43,5 +49,5 @@ interface PropertiesPanelProps {
43
49
  * are changed in place and saved (`updateProperties`). It knows nothing of where it's shown, so it
44
50
  * can sit beside any view of files, and has its own live region, saying what was copied or saved.
45
51
  */
46
- declare const PropertiesPanel: ({ items, changes, showHidden, cache: given, takeFocus, actions, embedded, ownRows, definitions, onClose, attributes, }: PropertiesPanelProps) => import("react").JSX.Element;
52
+ declare const PropertiesPanel: ({ items, changes, showHidden, cache: given, takeFocus, actions, embedded, ownRows, definitions, parts, onClose, attributes, }: PropertiesPanelProps) => import("react").JSX.Element;
47
53
  export default PropertiesPanel;
@@ -1,4 +1,4 @@
1
- import type { PropertyDefinition } from "../../types";
1
+ import type { PropertyDefinition } from "../../types/index.js";
2
2
  export interface PropertyDisplayProps {
3
3
  definition: PropertyDefinition;
4
4
  value: unknown;
@@ -1,4 +1,4 @@
1
- import type { FileAdapter, FileEntry, PropertyDefinition, PropertySave } from "../../types";
1
+ import type { FileAdapter, FileEntry, PropertyDefinition, PropertySave } from "../../types/index.js";
2
2
  interface PropertyEditorProps {
3
3
  definition: PropertyDefinition;
4
4
  /** The property's value, which editing starts from unless a save of it failed. */
@@ -1,5 +1,5 @@
1
1
  import type { Ref } from "react";
2
- import type { PropertyDefinition } from "../../types";
2
+ import type { PropertyDefinition } from "../../types/index.js";
3
3
  /** What an editor asks of its input as it saves: the value, with anything typed but not added yet. */
4
4
  export interface PropertyInputHandle {
5
5
  flush: () => unknown;
@@ -1,4 +1,4 @@
1
- import type { TransferItem } from "../../types";
1
+ import type { TransferItem } from "../../types/index.js";
2
2
  interface TransferPanelProps {
3
3
  /** The copies and moves to show, in the order asked for. */
4
4
  items: TransferItem[];
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps, KeyboardEventHandler, ReactNode } from "react";
2
2
  import { Dialog as BaseDialog } from "@base-ui/react/dialog";
3
- import type { TextDirection } from "../../types";
3
+ import type { TextDirection } from "../../types/index.js";
4
4
  /** What closed a dialog: Escape, a press on the backdrop, or something else the dialog holds. */
5
5
  export type DialogCloseReason = "escapeKeyDown" | "backdropClick" | "other";
6
6
  interface DialogProps {
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import type { TextDirection } from "../../types";
2
+ import type { TextDirection } from "../../types/index.js";
3
3
  interface RootProvidersProps {
4
4
  /** The root's direction, read from the page, or undefined before it's known. */
5
5
  direction: TextDirection | undefined;
@@ -1,4 +1,4 @@
1
- import type { UploadItem } from "../../types";
1
+ import type { FileUploadItem, UploadItem } from "../../types/index.js";
2
2
  interface UploadPanelProps {
3
3
  items: UploadItem[];
4
4
  onCancel: (id: number) => void;
@@ -9,6 +9,12 @@ interface UploadPanelProps {
9
9
  */
10
10
  onShow?: (item: UploadItem) => void;
11
11
  canShow?: (item: UploadItem) => boolean;
12
+ /**
13
+ * Where a finished file is, as the host words it, when its adapter said it isn't in the folder it
14
+ * went into (`FileUploadItem.trail`), such as a media library's groups from its root; the last
15
+ * of the trail's folders, or nothing for an empty trail, without it.
16
+ */
17
+ placeOf?: (item: FileUploadItem) => string | undefined;
12
18
  /** Cancels every upload waiting or under way. */
13
19
  onCancelAll: () => void;
14
20
  /** Forgets every upload that has ended. */
@@ -21,5 +27,5 @@ interface UploadPanelProps {
21
27
  * button cancels whatever is still uploading, which stays listed to try again, and once nothing
22
28
  * is, forgets the list.
23
29
  */
24
- declare const UploadPanel: ({ items, onCancel, onRetry, onShow, canShow, onCancelAll, onClear }: UploadPanelProps) => import("react").JSX.Element;
30
+ declare const UploadPanel: ({ items, onCancel, onRetry, onShow, canShow, placeOf, onCancelAll, onClear, }: UploadPanelProps) => import("react").JSX.Element;
25
31
  export default UploadPanel;
@@ -1,4 +1,4 @@
1
- import type { AdapterIds } from "../types";
1
+ import type { AdapterIds } from "../types/index.js";
2
2
  /**
3
3
  * The entries cut to the clipboard, by the adapter they came from, as their ids mean nothing to
4
4
  * another, so every view showing them can mark them as cut. Null when none are.
@@ -1,6 +1,6 @@
1
- import type { FolderStore } from "../store/folder-store";
2
- import type { ThumbnailCache } from "../store/thumbnail-cache";
3
- import type { FileAdapter } from "../types";
1
+ import type { FolderStore } from "../store/folder-store.js";
2
+ import type { ThumbnailCache } from "../store/thumbnail-cache.js";
3
+ import type { FileAdapter } from "../types/index.js";
4
4
  export interface DataContextValue {
5
5
  store: FolderStore;
6
6
  /** Used by sections that don't bring their own adapter. */
@@ -1,2 +1,2 @@
1
- import type { TextDirection } from "../types";
1
+ import type { TextDirection } from "../types/index.js";
2
2
  export declare const DirectionContext: import("react").Context<TextDirection | undefined>;
@@ -1,5 +1,5 @@
1
1
  import type { DragEvent } from "react";
2
- import type { AdapterIds, DragSource, Drop, DroppedFiles, DropKeys, DropTarget, HeldPress } from "../types";
2
+ import type { AdapterIds, DragSource, Drop, DroppedFiles, DropKeys, DropTarget, HeldPress } from "../types/index.js";
3
3
  export interface DragContextValue {
4
4
  /**
5
5
  * The dragged entries' ids, by the adapter serving them, so every view listing them can fade
@@ -1,4 +1,4 @@
1
- import type { IconOverrides, IconSet } from "../types";
1
+ import type { IconOverrides, IconSet } from "../types/index.js";
2
2
  export interface IconConfig {
3
3
  /** The set the icons are drawn from: Outlined unless `IconProvider` gives another. */
4
4
  icons: IconSet;
@@ -1,2 +1,2 @@
1
- import type { Locale } from "../types";
1
+ import type { Locale } from "../types/index.js";
2
2
  export declare const LocaleContext: import("react").Context<Locale>;
@@ -1,4 +1,4 @@
1
- import type { MovingIds } from "../types";
1
+ import type { MovingIds } from "../types/index.js";
2
2
  /**
3
3
  * The entries the moves under way are moving, waiting or running, and those going to the trash or
4
4
  * coming back from it, by adapter, each with what holds it, so every view showing them can mark
@@ -1,4 +1,4 @@
1
- import type { AssetStates, FileAdapter, FollowedAssets } from "../types";
1
+ import type { AssetStates, FileAdapter, FollowedAssets } from "../types/index.js";
2
2
  /**
3
3
  * How assets being processed stand, as their backends last said, for those listed as being
4
4
  * processed (`candidates`, through the adapter serving each): followed until each is ready or
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch, SetStateAction } from "react";
2
- import type { FolderStore } from "../store/folder-store";
3
- import type { Clipboard } from "../types";
2
+ import type { FolderStore } from "../store/folder-store.js";
3
+ import type { Clipboard } from "../types/index.js";
4
4
  /**
5
5
  * Looks for the clipboard's entries again while a part of it has a `lookup`, after a change that
6
6
  * may have left their ids naming nothing, or others: by the names a rename leaves as they were,
@@ -1,3 +1,3 @@
1
- import type { Section } from "../types";
1
+ import type { Section } from "../types/index.js";
2
2
  /** Ids of the cut entries a section could be showing: those that came from its adapter. */
3
3
  export declare const useCutIds: (section: Section) => ReadonlySet<string>;
@@ -0,0 +1,16 @@
1
+ import type { RefObject } from "react";
2
+ /**
3
+ * In development, warns about props an app makes again each render that the component treats as
4
+ * new, keyed by the name the warning gives them: an `adapter` (whose listings are dropped and listed
5
+ * again) and a slot's component (which React mounts afresh). `watched` is only called in development.
6
+ * A prop made again twice warns, once, so an app switching on purpose, to another backend made by the
7
+ * same function, isn't warned on its first switch.
8
+ */
9
+ export declare const useRecreatedWarning: (name: string, watched: () => Record<string, unknown>) => void;
10
+ /**
11
+ * In development, once the page has loaded and the root is shown, warns when the component's
12
+ * stylesheet isn't in the page (no `filecove/styles.css` or `styles.layer.css` imported), or when
13
+ * nothing gives the root a height, so it's as tall as its content: its parent has no height of its
14
+ * own for the root's `height: 100%`, and lists that should scroll inside it grow with their entries.
15
+ */
16
+ export declare const useRootChecks: (rootRef: RefObject<HTMLElement | null>, name: string) => void;
@@ -4,9 +4,9 @@
4
4
  */
5
5
  export declare const useDownloadQueue: () => {
6
6
  queue: {
7
- getItems: () => import("../types").DownloadItem[];
7
+ getItems: () => import("../types/index.js").DownloadItem[];
8
8
  subscribe: (listener: () => void) => () => void;
9
- add(adapter: import("..").FileAdapter, entries: import("..").FileEntry[], folderName: string, showHidden: boolean, groups?: import("..").EntriesInFolder[]): void;
9
+ add(adapter: import("../index.js").FileAdapter, entries: import("../index.js").FileEntry[], folderName: string, showHidden: boolean, groups?: import("../index.js").EntriesInFolder[]): void;
10
10
  cancel(id: number): void;
11
11
  cancelAll(): void;
12
12
  retry(id: number): void;
@@ -15,5 +15,5 @@ export declare const useDownloadQueue: () => {
15
15
  clear(): void;
16
16
  abortAll(): void;
17
17
  };
18
- items: import("../types").DownloadItem[];
18
+ items: import("../types/index.js").DownloadItem[];
19
19
  };
@@ -1,3 +1,3 @@
1
- import type { Section } from "../types";
1
+ import type { Section } from "../types/index.js";
2
2
  /** Ids of the dragged entries a section could be showing: those that came from its adapter. */
3
3
  export declare const useDraggedIds: (section: Section) => ReadonlySet<string>;
@@ -1,5 +1,5 @@
1
1
  import type { DragEvent } from "react";
2
- import type { DropTarget } from "../types";
2
+ import type { DropTarget } from "../types/index.js";
3
3
  interface DropTargetOptions {
4
4
  /**
5
5
  * The folders a drop where `event` happened could go into, the likeliest first; the first
@@ -1,6 +1,6 @@
1
1
  import type { PointerEvent, RefObject } from "react";
2
- import type { DragContextValue } from "../contexts/drag-context";
3
- import type { DraggedEntries, DropEffect, DropInto, FileAdapter, FileEntry } from "../types";
2
+ import type { DragContextValue } from "../contexts/drag-context.js";
3
+ import type { DraggedEntries, DropEffect, DropInto, FileAdapter, FileEntry } from "../types/index.js";
4
4
  /**
5
5
  * What the drag image shows: the entry the drag started from, and how many entries go along. A
6
6
  * touch drag's follows the finger, showing what letting go would do.
@@ -1,5 +1,5 @@
1
1
  import type { ClipboardEvent, DragEvent } from "react";
2
- import type { DroppedFiles } from "../types";
2
+ import type { DroppedFiles } from "../types/index.js";
3
3
  /**
4
4
  * Files dragged over a media library, dropped on it or pasted in it: the handlers for its panel, and
5
5
  * whether any are over it now. `takes` says whether it can have them at the moment, `patterns` of
@@ -12,3 +12,9 @@ export declare const useFilesDrop: (takes: boolean, patterns: readonly string[]
12
12
  takeDrop: (event: DragEvent<HTMLElement>) => void;
13
13
  pasteFiles: (event: ClipboardEvent<HTMLElement>) => void;
14
14
  };
15
+ /**
16
+ * Whether the browser's file picker can pick a folder, for the header's "Upload a folder": false while
17
+ * rendered on a server, and in the render hydrating it, so the button comes in after it, as the page
18
+ * can't be asked before.
19
+ */
20
+ export declare const usePicksFolders: () => boolean;
@@ -1,6 +1,6 @@
1
- import type { Section } from "../types";
1
+ import type { Section } from "../types/index.js";
2
2
  /** The folder store and the adapter of the file manager or the media manager, from `DataContext`. */
3
- export declare const useData: () => import("../contexts/data-context").DataContextValue;
3
+ export declare const useData: () => import("../contexts/data-context.js").DataContextValue;
4
4
  /**
5
5
  * A folder's listing. It is requested the first time `enabled` is true, then served from the store,
6
6
  * which keeps it while it's shown. Opened (`open`), as the content and the picker open folders, a
@@ -9,6 +9,6 @@ export declare const useData: () => import("../contexts/data-context").DataConte
9
9
  * another folder's, is listed afresh.
10
10
  */
11
11
  export declare const useFolder: (section: Section, folderId: string, enabled: boolean, open?: boolean) => {
12
- state: import("../types").FolderState | undefined;
12
+ state: import("../types/index.js").FolderState | undefined;
13
13
  reload: () => void;
14
14
  };
@@ -1,2 +1,2 @@
1
- import type { IconConfig } from "../contexts/icon-context";
1
+ import type { IconConfig } from "../contexts/icon-context.js";
2
2
  export declare const useIconConfig: () => IconConfig;
@@ -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 {};
@@ -1,13 +1,15 @@
1
- import type { FileAdapter, FolderRef, MediaSection, SearchHit } from "../types";
1
+ import type { FileAdapter, FolderRef, MediaSection, SearchHit } from "../types/index.js";
2
2
  /**
3
3
  * A media library's search through its adapter's `search`, the media manager's and the picker's: the
4
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). `on` is false without an
6
- * adapter's `search` or with nothing typed, when the level is only filtered by name as it's listed. The matches are in the backend's order, so one coming on a
7
- * later page doesn't move those before it, and `trails` has the groups between the level and each that's
8
- * below it, by its id.
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.
9
11
  */
10
- export declare const useLevelSearch: (section: MediaSection | undefined, adapter: FileAdapter, levelId: string, query: string, changes: number, delay?: number) => {
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) => {
11
13
  on: boolean;
12
14
  /** How it stands while it's on, as the grid goes by it; the bar shows over any found so far. */
13
15
  status: "ready" | "error" | "loading";
@@ -1,10 +1,10 @@
1
- import type { LocaleText } from "../types";
1
+ import type { LocaleText } from "../types/index.js";
2
2
  type GivenText = Partial<LocaleText> | undefined;
3
3
  /** The text and formats to show, from `LocaleContext`. */
4
- export declare const useLocale: () => import("../types").Locale;
4
+ export declare const useLocale: () => import("../types/index.js").Locale;
5
5
  /**
6
6
  * The locale `FileManager` and `MediaManager` provide, made afresh only when a text or `locale`
7
7
  * changes, since every row rendered reads it and renders again with a new one.
8
8
  */
9
- export declare const useLocaleValue: (localeText: GivenText, locale: string | undefined) => import("../types").Locale;
9
+ export declare const useLocaleValue: (localeText: GivenText, locale: string | undefined) => import("../types/index.js").Locale;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- import type { FileManagerLocation, LocationChangeReason } from "../types";
1
+ import type { FileManagerLocation, LocationChangeReason } from "../types/index.js";
2
2
  interface LocationHistoryOptions {
3
3
  /** The consumer's location, when they control it, which they then change through `onChange`. */
4
4
  location: FileManagerLocation | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { MouseEvent, PointerEvent as ReactPointerEvent } from "react";
2
- import type { HeldPress } from "../types";
2
+ import type { HeldPress } from "../types/index.js";
3
3
  interface LongPressOptions {
4
4
  /**
5
5
  * Called when an item has been held long enough, with where the press is, which a touch drag
@@ -1,5 +1,5 @@
1
1
  import type { MouseEvent, PointerEvent as ReactPointerEvent } from "react";
2
- import type { SelectModifiers } from "../types";
2
+ import type { SelectModifiers } from "../types/index.js";
3
3
  interface Box {
4
4
  left: number;
5
5
  top: number;
@@ -1,7 +1,8 @@
1
1
  /**
2
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, not as a
4
- * search asked again after a change finds more or fewer, which would cut off what that change said.
5
- * Closing the search, or typing nothing, forgets it, so the same query searched again is said again.
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.
6
7
  */
7
- export declare const useMatchCount: (query: string, count: number | null, announce: (message: string) => void, textOf: (count: number) => string) => void;
8
+ export declare const useMatchCount: (query: string, count: number | null, announce: (message: string) => void, textOf: (count: number) => string, filterKey?: string) => void;
@@ -1,4 +1,4 @@
1
- import type { MediaSearch } from "../types";
1
+ import type { MediaSearch } from "../types/index.js";
2
2
  interface MediaSearchOptions {
3
3
  /** Names the component in the warnings about switching between controlled and not. */
4
4
  component: string;
@@ -9,22 +9,36 @@ interface MediaSearchOptions {
9
9
  /** Told the search as it opens, as what's typed changes, and as it closes. */
10
10
  onChange?: (search: MediaSearch | null) => void;
11
11
  }
12
+ type Filters = Readonly<Record<string, unknown>>;
12
13
  /**
13
- * The search of a media library's header, the media manager's and the picker's: open or not, and what's
14
- * typed, as one value the app may keep (`MediaSearch`, null while closed), and giving the focus to it and
15
- * back, as the file manager's search does. Opening it focuses the field, or, open already, selects what's
16
- * typed; closing it with the focus in the field gives the focus back to what had it, or else to the
17
- * search button. A change the app keeps is only asked for, and the field is focused once it shows.
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.
18
27
  */
19
28
  export declare const useMediaSearch: ({ component, value, defaultValue, onChange }: MediaSearchOptions) => {
20
29
  search: MediaSearch | null;
21
30
  query: string;
22
31
  setQuery: (typed: string) => void;
32
+ filters: Readonly<Record<string, unknown>> | undefined;
33
+ setFilters: (update: (current: Filters | undefined) => Filters | undefined) => void;
23
34
  searching: boolean;
35
+ /** Whether the field shows in the header, in place of the name. */
36
+ fieldOpen: boolean;
24
37
  searchInputRef: import("react").RefObject<HTMLInputElement | null>;
25
38
  searchButtonRef: import("react").RefObject<HTMLButtonElement | null>;
26
- openSearch: (typed?: string) => void;
39
+ openSearch: (typed?: string, given?: Filters) => void;
27
40
  stopSearching: () => void;
28
- closeSearch: () => void;
41
+ closeSearch: (keepFilters?: boolean) => void;
42
+ dismissSearch: (keepFilters?: boolean) => void;
29
43
  };
30
44
  export {};
@@ -1,3 +1,3 @@
1
- import type { Section } from "../types";
1
+ import type { Section } from "../types/index.js";
2
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").MovingKinds;
3
+ export declare const useMovingIds: (section: Section) => import("../types/index.js").MovingKinds;
@@ -1,4 +1,4 @@
1
- import type { FileAdapter, FileEntry, PreviewContent, PreviewPlan } from "../types";
1
+ import type { FileAdapter, FileEntry, PreviewContent, PreviewPlan } from "../types/index.js";
2
2
  interface PreviewContentsOptions {
3
3
  /** The adapter serving a file, as the files may come from several sections. */
4
4
  adapterOf: (entry: FileEntry) => FileAdapter;
@@ -1,5 +1,5 @@
1
- import type { PropertiesCache } from "../store/properties-cache";
2
- import type { EntryProperties, EntryTotals, PropertiesItem, Requested } from "../types";
1
+ import type { PropertiesCache } from "../store/properties-cache.js";
2
+ import type { EntryProperties, EntryTotals, PropertiesItem, Requested } from "../types/index.js";
3
3
  interface UsePropertiesOptions {
4
4
  cache: PropertiesCache;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import type { ScrollTarget, ScrollView } from "../types";
1
+ import type { ScrollTarget, ScrollView } from "../types/index.js";
2
2
  /**
3
3
  * The tallest a list is laid out, in px. Browsers cap an element's height (Firefox at about 17.9
4
4
  * million px, Chrome and Safari at about 33.5 million) and place things less precisely long