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.
- package/CHANGELOG.md +21 -0
- package/dist/components/buttons/toolbar-actions.d.ts +1 -1
- package/dist/components/buttons/tooltip-icon-button.d.ts +1 -1
- package/dist/components/downloads/download-panel.d.ts +1 -1
- package/dist/components/drag/drag-preview.d.ts +24 -0
- package/dist/components/file-manager/announcer.d.ts +1 -1
- package/dist/components/file-manager/content/file-grid.d.ts +1 -1
- package/dist/components/file-manager/content/file-list.d.ts +1 -1
- package/dist/components/file-manager/content/folder-view.d.ts +1 -1
- package/dist/components/file-manager/content/item-icon.d.ts +1 -1
- package/dist/components/file-manager/content/search-results.d.ts +1 -1
- package/dist/components/file-manager/content/search-tabs.d.ts +1 -1
- package/dist/components/file-manager/content/trash-bar.d.ts +1 -1
- package/dist/components/file-manager/context-menu/context-menu.d.ts +1 -1
- package/dist/components/file-manager/dialogs/conflict-step.d.ts +1 -1
- package/dist/components/file-manager/dialogs/delete-dialog.d.ts +3 -2
- package/dist/components/file-manager/dialogs/image-viewer.d.ts +1 -1
- package/dist/components/file-manager/dialogs/name-dialog.d.ts +1 -1
- package/dist/components/file-manager/dialogs/paste-dialog.d.ts +1 -1
- package/dist/components/file-manager/dialogs/preview-dialog.d.ts +2 -2
- package/dist/components/file-manager/dialogs/restore-dialog.d.ts +1 -1
- package/dist/components/file-manager/dialogs/shortcuts-dialog.d.ts +1 -1
- package/dist/components/file-manager/dialogs/transfer-dialog.d.ts +2 -2
- package/dist/components/file-manager/dialogs/upload-dialog.d.ts +1 -1
- package/dist/components/file-manager/file-manager.d.ts +1 -1
- package/dist/components/file-manager/header-bar/header-bar.d.ts +1 -1
- package/dist/components/file-manager/header-bar/history-menu.d.ts +1 -1
- package/dist/components/file-manager/header-bar/path-bar.d.ts +1 -1
- package/dist/components/file-manager/header-bar/search-field.d.ts +1 -1
- package/dist/components/file-manager/header-bar/search-sections-menu.d.ts +1 -1
- package/dist/components/file-manager/header-bar/view-menu.d.ts +1 -1
- package/dist/components/file-manager/notice-bar.d.ts +1 -1
- package/dist/components/file-manager/properties-pane.d.ts +2 -2
- package/dist/components/file-manager/sidebar/location-item.d.ts +1 -1
- package/dist/components/file-manager/sidebar/main-menu.d.ts +1 -1
- package/dist/components/file-manager/sidebar/sidebar.d.ts +2 -2
- package/dist/components/icons/create-icon.d.ts +1 -1
- package/dist/components/icons/icon-provider.d.ts +1 -1
- package/dist/components/icons/icon-slot.d.ts +1 -1
- package/dist/components/icons/icon.d.ts +1 -1
- package/dist/components/media-manager/asset-delete.d.ts +20 -8
- package/dist/components/media-manager/asset-hold.d.ts +1 -1
- package/dist/components/media-manager/asset-option.d.ts +13 -2
- package/dist/components/media-manager/asset-trail.d.ts +1 -1
- package/dist/components/media-manager/choice-list.d.ts +1 -1
- package/dist/components/media-manager/choices-pane.d.ts +1 -1
- package/dist/components/media-manager/group-create.d.ts +1 -1
- package/dist/components/media-manager/group-path.d.ts +8 -2
- package/dist/components/media-manager/library-list.d.ts +4 -2
- package/dist/components/media-manager/media-asset.d.ts +19 -7
- package/dist/components/media-manager/media-edit-many.d.ts +33 -0
- package/dist/components/media-manager/media-fields.d.ts +1 -1
- package/dist/components/media-manager/media-filter-chips.d.ts +17 -0
- package/dist/components/media-manager/media-filters-dialog.d.ts +39 -0
- package/dist/components/media-manager/media-filters.d.ts +37 -0
- package/dist/components/media-manager/media-form.d.ts +3 -1
- package/dist/components/media-manager/media-frame.d.ts +7 -3
- package/dist/components/media-manager/media-grid.d.ts +34 -5
- package/dist/components/media-manager/media-group.d.ts +1 -1
- package/dist/components/media-manager/media-header.d.ts +20 -3
- package/dist/components/media-manager/media-manager.d.ts +33 -10
- package/dist/components/media-manager/media-move.d.ts +19 -11
- package/dist/components/media-manager/media-picker.d.ts +25 -7
- package/dist/components/media-manager/media-picture.d.ts +1 -1
- package/dist/components/media-manager/media-process.d.ts +1 -1
- package/dist/components/media-manager/media-row.d.ts +1 -1
- package/dist/components/media-manager/media-tile.d.ts +1 -1
- package/dist/components/media-manager/media-upload.d.ts +28 -6
- package/dist/components/media-manager/picker-frame.d.ts +6 -2
- package/dist/components/media-manager/selection-bar.d.ts +25 -0
- package/dist/components/media-manager/upload-tile.d.ts +5 -3
- package/dist/components/properties/properties-panel.d.ts +9 -3
- package/dist/components/properties/property-display.d.ts +1 -1
- package/dist/components/properties/property-editor.d.ts +1 -1
- package/dist/components/properties/property-input.d.ts +1 -1
- package/dist/components/transfers/transfer-panel.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/root-providers.d.ts +1 -1
- package/dist/components/uploads/upload-panel.d.ts +8 -2
- package/dist/contexts/cut-context.d.ts +1 -1
- package/dist/contexts/data-context.d.ts +3 -3
- package/dist/contexts/direction-context.d.ts +1 -1
- package/dist/contexts/drag-context.d.ts +1 -1
- package/dist/contexts/icon-context.d.ts +1 -1
- package/dist/contexts/locale-context.d.ts +1 -1
- package/dist/contexts/moving-context.d.ts +1 -1
- package/dist/hooks/use-asset-states.d.ts +1 -1
- package/dist/hooks/use-clipboard-follow.d.ts +2 -2
- package/dist/hooks/use-cut-ids.d.ts +1 -1
- package/dist/hooks/use-dev-checks.d.ts +16 -0
- package/dist/hooks/use-download-queue.d.ts +3 -3
- package/dist/hooks/use-dragged-ids.d.ts +1 -1
- package/dist/hooks/use-drop-target.d.ts +1 -1
- package/dist/hooks/use-entry-drag.d.ts +2 -2
- package/dist/hooks/use-files-drop.d.ts +7 -1
- package/dist/hooks/use-folder.d.ts +3 -3
- package/dist/hooks/use-icon-config.d.ts +1 -1
- package/dist/hooks/use-level-filters.d.ts +112 -0
- package/dist/hooks/use-level-search.d.ts +8 -6
- package/dist/hooks/use-locale.d.ts +3 -3
- package/dist/hooks/use-location-history.d.ts +1 -1
- package/dist/hooks/use-long-press.d.ts +1 -1
- package/dist/hooks/use-marquee.d.ts +1 -1
- package/dist/hooks/use-match-count.d.ts +5 -4
- package/dist/hooks/use-media-search.d.ts +22 -8
- package/dist/hooks/use-moving-ids.d.ts +2 -2
- package/dist/hooks/use-preview-contents.d.ts +1 -1
- package/dist/hooks/use-properties.d.ts +2 -2
- package/dist/hooks/use-scroll-measure.d.ts +1 -1
- package/dist/hooks/use-search.d.ts +6 -5
- package/dist/hooks/use-selection.d.ts +1 -1
- package/dist/hooks/use-text-direction.d.ts +1 -1
- package/dist/hooks/use-thumbnail.d.ts +1 -1
- package/dist/hooks/use-transfer-queue.d.ts +5 -5
- package/dist/hooks/use-tree-rows.d.ts +1 -1
- package/dist/hooks/use-tree-selection.d.ts +1 -1
- package/dist/hooks/use-upload-queue.d.ts +7 -5
- package/dist/hooks/use-virtual-lines.d.ts +1 -1
- package/dist/hooks/use-wheel-zoom.d.ts +1 -1
- package/dist/icon-sets/filled.d.ts +1 -1
- package/dist/icon-sets/outlined.d.ts +1 -1
- package/dist/icon-sets/rounded.d.ts +1 -1
- package/dist/icon-sets/sharp.d.ts +1 -1
- package/dist/icon-sets/two-tone.d.ts +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +4307 -1129
- package/dist/index.js.map +1 -1
- package/dist/locales/en-us.d.ts +1 -1
- package/dist/store/download-queue.d.ts +1 -1
- package/dist/store/folder-store.d.ts +1 -1
- package/dist/store/properties-cache.d.ts +9 -1
- package/dist/store/thumbnail-cache.d.ts +1 -1
- package/dist/store/transfer-across.d.ts +1 -1
- package/dist/store/transfer-queue.d.ts +2 -2
- package/dist/store/upload-queue.d.ts +28 -8
- package/dist/styles/classes.d.ts +30 -2
- package/dist/styles/layout.d.ts +2 -2
- package/dist/styles/media-layout.d.ts +1 -1
- package/dist/styles.css +1095 -367
- package/dist/styles.layer.css +1095 -367
- package/dist/types/action.d.ts +3 -3
- package/dist/types/adapter.d.ts +164 -11
- package/dist/types/api.d.ts +21 -9
- package/dist/types/clipboard.d.ts +2 -2
- package/dist/types/download.d.ts +1 -1
- package/dist/types/drag.d.ts +4 -4
- package/dist/types/folder.d.ts +1 -1
- package/dist/types/index.d.ts +27 -27
- package/dist/types/locale.d.ts +161 -4
- package/dist/types/main-menu.d.ts +1 -1
- package/dist/types/media.d.ts +127 -11
- package/dist/types/menu.d.ts +4 -4
- package/dist/types/navigation.d.ts +2 -2
- package/dist/types/preview.d.ts +1 -1
- package/dist/types/previewer.d.ts +1 -1
- package/dist/types/properties.d.ts +20 -2
- package/dist/types/property-definition.d.ts +58 -1
- package/dist/types/search.d.ts +2 -2
- package/dist/types/section.d.ts +2 -2
- package/dist/types/selection.d.ts +3 -3
- package/dist/types/slots.d.ts +12 -7
- package/dist/types/transfer.d.ts +2 -2
- package/dist/types/tree.d.ts +2 -2
- package/dist/types/undo.d.ts +3 -3
- package/dist/types/upload.d.ts +79 -3
- package/dist/types/view.d.ts +5 -5
- package/dist/utils/action-groups.d.ts +1 -1
- package/dist/utils/clipboard.d.ts +2 -2
- package/dist/utils/dom.d.ts +13 -0
- package/dist/utils/download.d.ts +1 -1
- package/dist/utils/field-errors.d.ts +1 -1
- package/dist/utils/files.d.ts +9 -5
- package/dist/utils/format.d.ts +1 -1
- package/dist/utils/groups.d.ts +1 -1
- package/dist/utils/hidden.d.ts +1 -1
- package/dist/utils/keyboard.d.ts +1 -1
- package/dist/utils/media.d.ts +82 -5
- package/dist/utils/menu-position.d.ts +1 -1
- package/dist/utils/names.d.ts +1 -1
- package/dist/utils/navigation.d.ts +1 -1
- package/dist/utils/path.d.ts +2 -2
- package/dist/utils/permissions.d.ts +2 -2
- package/dist/utils/preview.d.ts +1 -1
- package/dist/utils/property-value.d.ts +3 -1
- package/dist/utils/search.d.ts +1 -1
- package/dist/utils/sections.d.ts +1 -1
- package/dist/utils/selection.d.ts +1 -1
- package/dist/utils/shortcut.d.ts +1 -1
- package/dist/utils/slots.d.ts +2 -2
- package/dist/utils/sort.d.ts +1 -1
- package/dist/utils/transfer.d.ts +1 -1
- package/dist/utils/trash.d.ts +1 -1
- package/dist/utils/undo.d.ts +1 -1
- package/dist/utils/zoom.d.ts +2 -2
- package/docs/README.md +1 -1
- package/docs/adapter.md +66 -6
- package/docs/customizing.md +31 -2
- package/docs/getting-started.md +3 -1
- package/docs/media-manager.md +194 -7
- package/docs/search.md +2 -0
- package/docs/uploads-and-downloads.md +2 -1
- package/package.json +1 -1
- package/dist/components/file-manager/drag-preview.d.ts +0 -22
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PropertiesCache } from "../../store/properties-cache.js";
|
|
2
|
+
import type { FileAdapter, FileEntry, PropertyDefinitionGroup } from "../../types/index.js";
|
|
3
|
+
interface MediaEditManyProps {
|
|
4
|
+
/** What's changed, as it was when this opened: what's selected while browsing. */
|
|
5
|
+
entries: readonly FileEntry[];
|
|
6
|
+
/** The fields offered for all of them (`fieldsForMany`). */
|
|
7
|
+
groups: readonly PropertyDefinitionGroup[];
|
|
8
|
+
/** The library's adapter, its own or the media manager's. */
|
|
9
|
+
adapter: FileAdapter;
|
|
10
|
+
/** What's come of entries' properties already, so they aren't asked for again. */
|
|
11
|
+
propertiesCache: PropertiesCache;
|
|
12
|
+
backLabel: string;
|
|
13
|
+
/** Closes it, nothing asked of the backend. */
|
|
14
|
+
onCancel: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Told what was saved each time some was: all of what was asked, `done`, or what the backend
|
|
17
|
+
* reported saved before it refused the rest, which stays to try again.
|
|
18
|
+
*/
|
|
19
|
+
onSaved: (entries: FileEntry[], done: boolean) => void;
|
|
20
|
+
/** Left while the backend was being asked, which may have saved some of it by then. */
|
|
21
|
+
onLeft: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Edit fields…, for what's selected while browsing, in the library's place: the fields all of them
|
|
25
|
+
* offer, each left as each one has it until it's ticked, then set the same for all of them, a list's
|
|
26
|
+
* items added, taken out or put in place. What they hold now is said beside each, the same value,
|
|
27
|
+
* none, or mixed, once each has said, for up to `SUMMARIZED_AT_MOST` of them. Save goes to the adapter's
|
|
28
|
+
* `updateManyProperties`, or else to its `updateProperties`, one at a time, a few at once, a list's
|
|
29
|
+
* items read from `properties` first; it stays until that's answered, to say why when some are refused,
|
|
30
|
+
* naming those left, and then saves only those.
|
|
31
|
+
*/
|
|
32
|
+
declare const MediaEditMany: ({ entries, groups, adapter, propertiesCache, backLabel, onCancel, onSaved, onLeft, }: MediaEditManyProps) => import("react").JSX.Element;
|
|
33
|
+
export default MediaEditMany;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldErrors, FileAdapter, FileEntry, PropertyDefinitionGroup } from "../../types";
|
|
1
|
+
import type { FieldErrors, FileAdapter, FileEntry, PropertyDefinitionGroup } from "../../types/index.js";
|
|
2
2
|
export interface MediaFieldsProps<V = Record<string, unknown>> {
|
|
3
3
|
/** What to draw, made fresh from `values` each time if it likes, as it's only read to be drawn. */
|
|
4
4
|
groups: readonly PropertyDefinitionGroup[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MediaFilterChip } from "../../types/index.js";
|
|
2
|
+
interface MediaFilterChipsProps {
|
|
3
|
+
/** The filters set, as the form names them. */
|
|
4
|
+
chips: readonly MediaFilterChip[];
|
|
5
|
+
onRemove: (chip: MediaFilterChip) => void;
|
|
6
|
+
onClear: () => void;
|
|
7
|
+
/** Gives the focus to the header's Filters button, once no chip is left to take it. */
|
|
8
|
+
onEmptied: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The filters set, under the header, as chips (`MediaFilterForm.chips`), each a button removing its
|
|
12
|
+
* filter, then Clear all: a row sliding open as the first is set and shut as the last goes, still
|
|
13
|
+
* showing those that were while it does. A chip removed from the keyboard hands the focus to the one
|
|
14
|
+
* now in its place, or the one before, and the last, or Clear all, to the Filters button.
|
|
15
|
+
*/
|
|
16
|
+
declare const MediaFilterChips: ({ chips, onRemove, onClear, onEmptied }: MediaFilterChipsProps) => import("react").JSX.Element;
|
|
17
|
+
export default MediaFilterChips;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
import type { MediaFilterForm, MediaFilterFormParams } from "../../types/index.js";
|
|
3
|
+
type Filters = Readonly<Record<string, unknown>>;
|
|
4
|
+
interface MediaFiltersDialogProps {
|
|
5
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
|
+
/** Its id, which the header's Filters button controls. */
|
|
7
|
+
id: string;
|
|
8
|
+
form: MediaFilterForm;
|
|
9
|
+
/** What the form is drawn with as it's applied, whose `values` it starts from. */
|
|
10
|
+
params: MediaFilterFormParams;
|
|
11
|
+
/** Nothing set, which Clear all puts it back to. */
|
|
12
|
+
defaults: Filters;
|
|
13
|
+
/** How many are set of what it holds. */
|
|
14
|
+
countOf: (values: Filters) => number;
|
|
15
|
+
/** Whether what it holds can be applied: true, or false, or why not. */
|
|
16
|
+
readinessOf: (values: Filters) => boolean | string;
|
|
17
|
+
/** Whether it's going, drawn until it has gone, as nothing can reach it any more. */
|
|
18
|
+
leaving: boolean;
|
|
19
|
+
/** Apply: what it holds, in place of what the form held. */
|
|
20
|
+
onApply: (values: Filters) => void;
|
|
21
|
+
/** Cancel, Escape or a press around it: the filters as they were. */
|
|
22
|
+
onCancel: () => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A library's filters in a dialog over the whole component (`filtersVariant` `"dialog"`), for a form too
|
|
26
|
+
* big for the card, such as rules of a field, an operator and a value, or one whose half-finished
|
|
27
|
+
* changes shouldn't search: the app's filter form (`MediaSection.filterForm`), drawn as a component of
|
|
28
|
+
* its own as the other forms are, holding its own values from what's applied as it opens, until Apply
|
|
29
|
+
* puts them in place of those, held back while the form's `ready` says no, with why beside it. Clear all
|
|
30
|
+
* clears what it holds, not yet what's applied. Cancel, Escape or a press around it leaves the filters
|
|
31
|
+
* as they were; Escape in a field only leaves the field, as a second cancels what's been changed, and
|
|
32
|
+
* goes no further, so an app's dialog around it stays.
|
|
33
|
+
*
|
|
34
|
+
* Drawn inside the component rather than portaled out, as a picker in an app's own modal dialog would
|
|
35
|
+
* have its focus trapped away from a portal, so it covers the component, not the page: the frame puts
|
|
36
|
+
* the rest of itself out of reach (`inert`) while it shows, and Tab goes round inside it.
|
|
37
|
+
*/
|
|
38
|
+
declare const MediaFiltersDialog: ({ ref, id, form, params, defaults, countOf, readinessOf, leaving, onApply, onCancel, }: MediaFiltersDialogProps) => import("react").JSX.Element;
|
|
39
|
+
export default MediaFiltersDialog;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FocusEvent, Ref, RefObject } from "react";
|
|
2
|
+
import type { MediaFilterForm, MediaFilterFormParams } from "../../types/index.js";
|
|
3
|
+
interface MediaFiltersProps {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
/** Its id, which the header's Filters button controls. */
|
|
6
|
+
id: string;
|
|
7
|
+
form: MediaFilterForm;
|
|
8
|
+
params: MediaFilterFormParams;
|
|
9
|
+
/** How many filters are set, for Clear all. */
|
|
10
|
+
count: number;
|
|
11
|
+
/** Why what's set isn't applied yet: the form's reason, or false for none given; undefined while it is. */
|
|
12
|
+
heldBack: string | false | undefined;
|
|
13
|
+
/** Whether it's folding away, drawn until it has gone, as nothing can reach it any more. */
|
|
14
|
+
leaving: boolean;
|
|
15
|
+
/** The header's Filters button, which it drops from. */
|
|
16
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
17
|
+
onClear: () => void;
|
|
18
|
+
/** Escape: folds it away, the filters staying set, and gives the focus to the Filters button. */
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
/** The focus leaving it, which folds it away when it goes on to the rest of the library. */
|
|
21
|
+
onBlur: (event: FocusEvent<HTMLDivElement>) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A library's filters in a card dropping from the header's Filters button over the results, as a menu
|
|
25
|
+
* does, so the results stay where they are and change behind it as the filters do: the app's filter
|
|
26
|
+
* form (`MediaSection.filterForm`), drawn as a component of its own as the other forms are, and at its
|
|
27
|
+
* foot, why what's set isn't applied yet, while the form's `ready` holds it, and Clear all while any is
|
|
28
|
+
* set. What's changed applies as the search does, a moment after the last change, so there's nothing
|
|
29
|
+
* to submit, nor a button to fold it away: a press outside does, or Escape, going no further, so an
|
|
30
|
+
* app's dialog around it stays. A non-modal `dialog`, drawn inside the library rather than portaled
|
|
31
|
+
* out of it, so a picker in an app's modal dialog keeps the focus in reach.
|
|
32
|
+
*
|
|
33
|
+
* It sits in the library's panel, its end under the button's, measured from both, as the header's
|
|
34
|
+
* buttons come and go and the library is resized, and grows from under the button.
|
|
35
|
+
*/
|
|
36
|
+
declare const MediaFilters: ({ ref, id, form, params, count, heldBack, leaving, anchorRef, onClear, onClose, onBlur, }: MediaFiltersProps) => import("react").JSX.Element;
|
|
37
|
+
export default MediaFilters;
|
|
@@ -12,6 +12,8 @@ interface ChoiceMessagesProps {
|
|
|
12
12
|
interface FormFailureProps {
|
|
13
13
|
/** Why the backend refused what the form holds. */
|
|
14
14
|
message: string;
|
|
15
|
+
/** What's to be said of it beside the backend's message, on a line of its own, such as what was left. */
|
|
16
|
+
detail?: string;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* A form of the app's, drawn as a component of its own, so hooks in its `render` always belong to the
|
|
@@ -23,5 +25,5 @@ export declare const MediaFormBody: <P>({ form, params }: MediaFormBodyProps<P>)
|
|
|
23
25
|
/** A pick's own errors, above its form. */
|
|
24
26
|
export declare const ChoiceMessages: ({ messages }: ChoiceMessagesProps) => false | import("react").JSX.Element;
|
|
25
27
|
/** Why an upload's or a process form was refused, over it, brought into view as the form may be scrolled. */
|
|
26
|
-
export declare const FormFailure: ({ message }: FormFailureProps) => import("react").JSX.Element;
|
|
28
|
+
export declare const FormFailure: ({ message, detail }: FormFailureProps) => import("react").JSX.Element;
|
|
27
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode, Ref } from "react";
|
|
2
|
-
import type { PropertiesCache } from "../../store/properties-cache";
|
|
3
|
-
import type { FileAdapter, FileEntry, FilePreviewer, FieldErrors, MediaActionGroup, MediaAssetParams, MediaChoice, MediaLayouts, MediaLocation, MediaLocationChangeReason, MediaManagerApi, MediaManagerSlotProps, MediaManagerSlots, MediaPickForm, MediaSearch, MediaSection, MediaSectionGroup, MediaViewed, PropertyDefinitionGroup, PropertyErrorKeyParams } from "../../types";
|
|
2
|
+
import type { PropertiesCache } from "../../store/properties-cache.js";
|
|
3
|
+
import type { FileAdapter, FileEntry, FilePreviewer, FieldErrors, MediaActionGroup, MediaAssetParams, MediaChoice, MediaFiltersVariant, MediaLayouts, MediaLocation, MediaLocationChangeReason, MediaManagerApi, MediaManagerSlotProps, MediaManagerSlots, MediaPickForm, MediaSearch, MediaSection, MediaSectionGroup, MediaViewed, PropertyDefinitionGroup, PropertyErrorKeyParams } from "../../types/index.js";
|
|
4
4
|
export interface MediaFrameProps {
|
|
5
5
|
groups: readonly MediaSectionGroup[];
|
|
6
6
|
adapter: FileAdapter;
|
|
@@ -13,6 +13,10 @@ export interface MediaFrameProps {
|
|
|
13
13
|
selectGroups: boolean;
|
|
14
14
|
/** The app's actions in the header. */
|
|
15
15
|
actions: readonly MediaActionGroup[] | undefined;
|
|
16
|
+
/** Whether what's shown can't be dragged onto a group or a step of the path while browsing. */
|
|
17
|
+
disableDrag: boolean;
|
|
18
|
+
/** How a library's filters show, where its form doesn't say (`MediaFilterForm.variant`). */
|
|
19
|
+
filtersVariant: MediaFiltersVariant;
|
|
16
20
|
onChoose: ((choices: MediaChoice[]) => void) | undefined;
|
|
17
21
|
pickForm: ((asset: FileEntry, section: MediaSection) => MediaPickForm | null) | undefined;
|
|
18
22
|
/** What an asset shows as it's opened, where its library has no `properties` of its own. */
|
|
@@ -69,5 +73,5 @@ export interface MediaFrameProps {
|
|
|
69
73
|
slotProps: MediaManagerSlotProps;
|
|
70
74
|
}
|
|
71
75
|
/** Everything inside the media manager's root, below the contexts it provides. */
|
|
72
|
-
declare const MediaFrame: ({ groups, adapter, multiple, maxChoices, canSelect, selectGroups, actions, onChoose, pickForm, properties, previewers, renderAsset, renderGroup, groupHeader, layout: layoutProp, defaultLayout, onLayoutChange, location: locationProp, defaultLocation, onLocationChange, viewed: viewedProp, defaultViewed, onViewedChange, search: searchProp, defaultSearch, onSearchChange, uploadLimit, transferLimit, searchDelay, apiRef, value, defaultValue, onChange, errors, choiceErrorKey, propertiesCache, slots, slotProps, }: MediaFrameProps) => import("react").JSX.Element;
|
|
76
|
+
declare const MediaFrame: ({ groups, adapter, multiple, maxChoices, canSelect, selectGroups, actions, disableDrag, filtersVariant, onChoose, pickForm, properties, previewers, renderAsset, renderGroup, groupHeader, layout: layoutProp, defaultLayout, onLayoutChange, location: locationProp, defaultLocation, onLocationChange, viewed: viewedProp, defaultViewed, onViewedChange, search: searchProp, defaultSearch, onSearchChange, uploadLimit, transferLimit, searchDelay, apiRef, value, defaultValue, onChange, errors, choiceErrorKey, propertiesCache, slots, slotProps, }: MediaFrameProps) => import("react").JSX.Element;
|
|
73
77
|
export default MediaFrame;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type { ReactNode, Ref } from "react";
|
|
2
|
-
import type { AssetHold, FileAdapter, FileEntry,
|
|
1
|
+
import type { DragEvent, ReactNode, Ref } from "react";
|
|
2
|
+
import type { AssetHold, DropTarget, FileAdapter, FileEntry, FolderRef, HeldPress, MediaAssetDraw, MediaGridHandle, MediaKind, MediaLayout, MediaPickerSlotProps, MediaPickerSlots, MediaSection, UploadItem } from "../../types/index.js";
|
|
3
3
|
interface MediaGridProps {
|
|
4
4
|
/** The open level's assets and groups the search leaves, or what it found below, in the order shown. */
|
|
5
5
|
entries: readonly FileEntry[];
|
|
6
6
|
/** Where those from further down than the open level are, by their ids. */
|
|
7
7
|
trails?: ReadonlyMap<string, readonly FolderRef[]>;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Files being uploaded into the library, shown before its assets until they're listed, and folders
|
|
10
|
+
* being made its groups, until the group is.
|
|
11
|
+
*/
|
|
12
|
+
uploads: readonly UploadItem[];
|
|
10
13
|
/** The library's kind, whose tiles' shape they take, and its icon. */
|
|
11
14
|
kind: MediaKind;
|
|
12
15
|
/** How they're shown: as tiles, or as rows. */
|
|
@@ -34,6 +37,30 @@ interface MediaGridProps {
|
|
|
34
37
|
/** Whether as many as may be are selected (`maxChoices`), so there's no room for the others. */
|
|
35
38
|
full: boolean;
|
|
36
39
|
multiple: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether what's selected is for acting on in place, while the media manager is browsing, as a file
|
|
42
|
+
* manager's selection is: a click selects one alone, Ctrl or ⌘ adds or takes one out, Shift selects a
|
|
43
|
+
* range, a group by its check or those keys, as a click goes in; Space adds or takes out, Shift and
|
|
44
|
+
* the arrows extend, Ctrl+A selects them all, Escape clears, and Delete or Backspace asks to delete.
|
|
45
|
+
* Otherwise it's what's picked, by `multiple`.
|
|
46
|
+
*/
|
|
47
|
+
browsing?: boolean;
|
|
48
|
+
/** While browsing, a touch screen's selection mode, a long-press having started it: every tap adds or takes out. */
|
|
49
|
+
selecting?: boolean;
|
|
50
|
+
/** A long-press on an asset or group, by touch or pen, which a touch drag may go on from; none, none is taken. */
|
|
51
|
+
onLongPress?: (index: number, press: HeldPress) => void;
|
|
52
|
+
/** Whether what's shown can be dragged, to be dropped on a group or a step of the path. */
|
|
53
|
+
draggable?: boolean;
|
|
54
|
+
/** Starts a mouse drag from the asset or group pressed, by its index. */
|
|
55
|
+
onDragStart?: (index: number, event: DragEvent) => void;
|
|
56
|
+
/** The ids of what's being dragged, which fade. */
|
|
57
|
+
draggedIds?: ReadonlySet<string>;
|
|
58
|
+
/** A group as somewhere what's dragged could be dropped, by its index; without it, nothing in the grid takes drops. */
|
|
59
|
+
dropTargetOf?: (index: number) => DropTarget | undefined;
|
|
60
|
+
/** Delete on what's selected, while browsing. */
|
|
61
|
+
onDelete?: () => void;
|
|
62
|
+
/** Escape on what's selected, while browsing. */
|
|
63
|
+
onClearSelection?: () => void;
|
|
37
64
|
status: "loading" | "ready" | "error";
|
|
38
65
|
/** Whether the open level has anything at all, whatever the search leaves. */
|
|
39
66
|
hasMedia: boolean;
|
|
@@ -64,6 +91,8 @@ interface MediaGridProps {
|
|
|
64
91
|
group: FileEntry | null;
|
|
65
92
|
/** What's typed in the search field, for the app's `noResults`. */
|
|
66
93
|
query: string;
|
|
94
|
+
/** What the library's filters held as applied, while any is set, for the app's `noResults`. */
|
|
95
|
+
filters?: Readonly<Record<string, unknown>>;
|
|
67
96
|
/** Uploads into the level as its Upload button does, for the app's `empty`; missing where it takes no files. */
|
|
68
97
|
onUpload?: () => void;
|
|
69
98
|
/** The app's own states, drawn in their boxes in place of the media manager's (`slots`). */
|
|
@@ -81,5 +110,5 @@ interface MediaGridProps {
|
|
|
81
110
|
* wherever it is. So every asset is drawn as tall, and the frames focus one through `ref`'s `focusAt`
|
|
82
111
|
* rather than finding it in the page.
|
|
83
112
|
*/
|
|
84
|
-
declare const MediaGrid: ({ entries, trails, uploads, kind, layout, adapter, drawAsset, drawGroup, opensGroups, opensAssets, header, label, selectedIds, holds, works, groupChecks, full, multiple, status, hasMedia, busy, error, onRetry, onPress, onActivate, onEnterGroup, onLevelUp, onOpen, onSelectAll, ref, section, group, query, onUpload, slots, assetSlot, }: MediaGridProps) => import("react").JSX.Element;
|
|
113
|
+
declare const MediaGrid: ({ entries, trails, uploads, kind, layout, adapter, drawAsset, drawGroup, opensGroups, opensAssets, header, label, selectedIds, holds, works, groupChecks, full, multiple, browsing, selecting, onLongPress, draggable, onDragStart, draggedIds, dropTargetOf, onDelete, onClearSelection, status, hasMedia, busy, error, onRetry, onPress, onActivate, onEnterGroup, onLevelUp, onOpen, onSelectAll, ref, section, group, query, filters, onUpload, slots, assetSlot, }: MediaGridProps) => import("react").JSX.Element;
|
|
85
114
|
export default MediaGrid;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileAdapter, FileEntry, MediaGroupForm, MediaSection } from "../../types";
|
|
1
|
+
import type { FileAdapter, FileEntry, MediaGroupForm, MediaSection } from "../../types/index.js";
|
|
2
2
|
interface MediaGroupProps {
|
|
3
3
|
/** The group being edited, as it's listed now, or `null` for one being made. */
|
|
4
4
|
group: FileEntry | null;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Ref, RefObject } from "react";
|
|
2
|
-
import type { FileEntry, MediaLayout, MediaSection, SlotAttributes, ToolbarGroup } from "../../types";
|
|
2
|
+
import type { DropTarget, FileEntry, MediaLayout, MediaSection, SlotAttributes, ToolbarGroup } from "../../types/index.js";
|
|
3
3
|
interface MediaHeaderProps {
|
|
4
4
|
section: MediaSection | undefined;
|
|
5
5
|
/** The groups gone into from the library's root, to the one open; none at its root. */
|
|
6
6
|
trail: readonly FileEntry[];
|
|
7
7
|
/** Goes to the level with that many groups of the trail open. */
|
|
8
8
|
onGoToLevel: (depth: number) => void;
|
|
9
|
+
/** Where what's dragged would go, dropped on a step of the path, while the library is dragged in. */
|
|
10
|
+
pathDropTargetAt?: (depth: number) => DropTarget;
|
|
9
11
|
/** Opens the details of the group open; missing at the root, and while something's in the library's place. */
|
|
10
12
|
onGroupDetails: (() => void) | undefined;
|
|
11
13
|
groupDetailsRef: Ref<HTMLButtonElement>;
|
|
@@ -31,6 +33,15 @@ interface MediaHeaderProps {
|
|
|
31
33
|
onDismissSearch: () => void;
|
|
32
34
|
/** Down or Enter in the field, on to the assets. */
|
|
33
35
|
onFocusAssets: () => void;
|
|
36
|
+
/** Shows or folds away the library's filters; missing where it has none, and while the search can't be used. */
|
|
37
|
+
onToggleFilters?: () => void;
|
|
38
|
+
/** Whether their card shows. */
|
|
39
|
+
filtersOpen?: boolean;
|
|
40
|
+
/** How many filters are set, shown in a badge on their button. */
|
|
41
|
+
filterCount?: number;
|
|
42
|
+
/** The card's id, which their button controls. */
|
|
43
|
+
filtersId?: string;
|
|
44
|
+
filtersButtonRef?: Ref<HTMLButtonElement>;
|
|
34
45
|
/** The layout its button switches to, while the library offers another. */
|
|
35
46
|
otherLayout: MediaLayout | undefined;
|
|
36
47
|
onSwitchLayout: () => void;
|
|
@@ -49,15 +60,21 @@ interface MediaHeaderProps {
|
|
|
49
60
|
/** Picks files to upload into the level open; missing while it takes none. */
|
|
50
61
|
onUpload: (() => void) | undefined;
|
|
51
62
|
uploadRef: Ref<HTMLButtonElement>;
|
|
63
|
+
/**
|
|
64
|
+
* Picks a folder to make a group of at the level open; missing while it takes none, or the browser
|
|
65
|
+
* can't pick folders.
|
|
66
|
+
*/
|
|
67
|
+
onUploadFolder?: () => void;
|
|
52
68
|
/** The app's attributes for the header (`slotProps.header`). */
|
|
53
69
|
attributes?: SlotAttributes;
|
|
54
70
|
}
|
|
55
71
|
/**
|
|
56
72
|
* Above the library: the button opening the libraries where they don't dock, its name, or the path
|
|
57
73
|
* to the group open, each step of it going back there, or the search field in its place while
|
|
58
|
-
* searching, the button opening that, the
|
|
74
|
+
* searching, the button opening that, the library's filters' button, while it has any, the button
|
|
75
|
+
* switching its layout, while it offers another, the
|
|
59
76
|
* details of the group open, New group, while one can be made here, the app's actions, and Upload, while
|
|
60
77
|
* it takes files.
|
|
61
78
|
*/
|
|
62
|
-
declare const MediaHeader: ({ section, trail, onGoToLevel, onGroupDetails, groupDetailsRef, several, librariesOpen, librariesOpenerRef, onOpenLibraries, searchable, searching, query, searchInputRef, searchButtonRef, onQueryChange, onToggleSearch, onCloseSearch, onDismissSearch, onFocusAssets, otherLayout, onSwitchLayout, onNewGroup, newGroupLabel, creatingGroup, newGroupRef, actions, onUpload, uploadRef, attributes, }: MediaHeaderProps) => import("react").JSX.Element;
|
|
79
|
+
declare const MediaHeader: ({ section, trail, onGoToLevel, pathDropTargetAt, onGroupDetails, groupDetailsRef, several, librariesOpen, librariesOpenerRef, onOpenLibraries, searchable, searching, query, searchInputRef, searchButtonRef, onQueryChange, onToggleSearch, onCloseSearch, onDismissSearch, onFocusAssets, onToggleFilters, filtersOpen, filterCount, filtersId, filtersButtonRef, otherLayout, onSwitchLayout, onNewGroup, newGroupLabel, creatingGroup, newGroupRef, actions, onUpload, uploadRef, onUploadFolder, attributes, }: MediaHeaderProps) => import("react").JSX.Element;
|
|
63
80
|
export default MediaHeader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode, Ref } from "react";
|
|
2
|
-
import type { FieldErrors, FileAdapter, FileEntry, FilePreviewer, MediaActionGroup, MediaAssetParams, MediaChoice, MediaLayouts, MediaLocation, MediaLocationChangeReason, MediaManagerApi, MediaManagerLimits, MediaManagerLocaleText, MediaManagerSlotProps, MediaManagerSlots, MediaPickForm, MediaSearch, MediaSection, MediaSectionGroup, MediaViewed, PropertyDefinitionGroup, PropertyErrorKeyParams } from "../../types";
|
|
2
|
+
import type { FieldErrors, FileAdapter, FileEntry, FilePreviewer, MediaActionGroup, MediaAssetParams, MediaChoice, MediaFiltersVariant, MediaLayouts, MediaLocation, MediaLocationChangeReason, MediaManagerApi, MediaManagerLimits, MediaManagerLocaleText, MediaManagerSlotProps, MediaManagerSlots, MediaPickForm, MediaSearch, MediaSection, MediaSectionGroup, MediaViewed, PropertyDefinitionGroup, PropertyErrorKeyParams } from "../../types/index.js";
|
|
3
3
|
type RootAttributes = Omit<ComponentPropsWithoutRef<"div">, "children" | "defaultValue" | "onChange">;
|
|
4
4
|
interface BaseProps<V> extends RootAttributes {
|
|
5
5
|
/** Serves the libraries that don't bring their own adapter. */
|
|
@@ -7,7 +7,10 @@ interface BaseProps<V> extends RootAttributes {
|
|
|
7
7
|
/**
|
|
8
8
|
* Whether several assets can be selected and chosen at once, from any of the libraries, such as
|
|
9
9
|
* pictures and videos for a product's carousel: what's selected stays as another library is
|
|
10
|
-
* shown, listed in the selected column, in an order set there. One at a time when omitted.
|
|
10
|
+
* shown, listed in the selected column, in an order set there. One at a time when omitted. While
|
|
11
|
+
* the media manager is only browsed, several are always selected as in a file manager (a click one
|
|
12
|
+
* alone, Ctrl or ⌘ adding, Shift a range, Ctrl+A all), at the level open, to move, delete or drag
|
|
13
|
+
* together from the selection bar at the library's foot, whatever this says.
|
|
11
14
|
*/
|
|
12
15
|
multiple?: boolean;
|
|
13
16
|
/**
|
|
@@ -46,9 +49,26 @@ interface BaseProps<V> extends RootAttributes {
|
|
|
46
49
|
*/
|
|
47
50
|
selectGroups?: boolean;
|
|
48
51
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
+
* Turns dragging off. While the media manager is only browsed (none of `value`, `defaultValue`,
|
|
53
|
+
* `onChange` and `onChoose` given), what's selected, or the asset or group grabbed, is dragged onto a
|
|
54
|
+
* group, or a step of the path above, to move it there, through the adapter's `move`, by mouse, or on a
|
|
55
|
+
* touch screen by a long-press and moving on; a drag resting on a group goes into it. With this, nothing
|
|
56
|
+
* is dragged, and Move to… in the selection bar is the way to move several, as Move in an asset's view is
|
|
57
|
+
* for one. A long-press still starts selecting on a touch screen. False when omitted.
|
|
58
|
+
*/
|
|
59
|
+
disableDrag?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* How a library's filters (`MediaSection.filterForm`) show from the header's Filters button:
|
|
62
|
+
* `"card"`, dropping from it over the results, which change behind it as the filters do, or
|
|
63
|
+
* `"dialog"`, over the whole component, the rest of it out of reach, applying what's changed only
|
|
64
|
+
* with its Apply, for a form too big for the card or whose half-finished changes shouldn't search.
|
|
65
|
+
* A form's own `variant` comes first. Both are drawn inside the component. `"card"` when omitted.
|
|
66
|
+
*/
|
|
67
|
+
filtersVariant?: MediaFiltersVariant;
|
|
68
|
+
/**
|
|
69
|
+
* The app's own actions in the header, for what the component leaves to it, such as reordering a
|
|
70
|
+
* group. Those with an icon show as buttons, two at most and from the width the list of libraries
|
|
71
|
+
* docks at, and the rest in a "More actions" menu. Each is told the
|
|
52
72
|
* library, the group open, the asset shown, what's selected and whether it can be changed, and given
|
|
53
73
|
* `refresh()` to list again what it changed. `visible` and `disabled` are asked as any of those change,
|
|
54
74
|
* so keep them quick. None show while a step such as an upload's form is in the library's place.
|
|
@@ -158,14 +178,17 @@ interface BaseProps<V> extends RootAttributes {
|
|
|
158
178
|
/** Told what's shown in the library's place as it changes, with the groups it's in, or null. */
|
|
159
179
|
onViewedChange?: (viewed: MediaViewed | null) => void;
|
|
160
180
|
/**
|
|
161
|
-
* The search, for an app keeping it, null while it's closed
|
|
162
|
-
*
|
|
163
|
-
*
|
|
181
|
+
* The search, for an app keeping it, null while it's closed: what's typed and what the library's
|
|
182
|
+
* filters hold (`MediaSearch.filters`). Every change is asked for through `onSearchChange`: opening
|
|
183
|
+
* it, each key typed, each filter changed, and closing it, which going to another level or library
|
|
184
|
+
* does too, the filters with it. Its field shows while it's opened or something's typed: one with
|
|
185
|
+
* only filters runs the search without it, the chips under the header saying what's set, and
|
|
186
|
+
* closing the field then clears only what's typed. It's focused as it opens once it's passed back.
|
|
164
187
|
*/
|
|
165
188
|
search?: MediaSearch | null;
|
|
166
189
|
/** The search as it mounts, while `search` isn't passed: closed when omitted. */
|
|
167
190
|
defaultSearch?: MediaSearch;
|
|
168
|
-
/** Told the search as it opens, as what's typed changes, and as it closes, with null. */
|
|
191
|
+
/** Told the search as it opens, as what's typed or a filter changes, and as it closes, with null. */
|
|
169
192
|
onSearchChange?: (search: MediaSearch | null) => void;
|
|
170
193
|
/**
|
|
171
194
|
* How old, in ms, a library's or a group's listing may be before showing it lists it again. Listings
|
|
@@ -282,5 +305,5 @@ export type MediaManagerProps<V = Record<string, unknown>> = MultiSectionProps<V
|
|
|
282
305
|
* with `FileManager` (the adapter, the listing store, thumbnails, the properties panel, the upload
|
|
283
306
|
* queue and panel), not from the file manager itself.
|
|
284
307
|
*/
|
|
285
|
-
declare const MediaManager: <V>({ adapter, sections: groupsProp, section: singleSection, multiple, maxChoices, canSelect, selectGroups, actions, onChoose, pickForm, properties, previewers, renderAsset, renderGroup, groupHeader, slots, slotProps, layout, defaultLayout, onLayoutChange, location, defaultLocation, onLocationChange, viewed, defaultViewed, onViewedChange, search, defaultSearch, onSearchChange, relistAfter, limits, apiRef, value, defaultValue, onChange, errors, choiceErrorKey, localeText, locale, ref, className, ...rootAttributes }: MediaManagerProps<V>) => import("react").JSX.Element;
|
|
308
|
+
declare const MediaManager: <V>({ adapter, sections: groupsProp, section: singleSection, multiple, maxChoices, canSelect, selectGroups, disableDrag, filtersVariant, actions, onChoose, pickForm, properties, previewers, renderAsset, renderGroup, groupHeader, slots, slotProps, layout, defaultLayout, onLayoutChange, location, defaultLocation, onLocationChange, viewed, defaultViewed, onViewedChange, search, defaultSearch, onSearchChange, relistAfter, limits, apiRef, value, defaultValue, onChange, errors, choiceErrorKey, localeText, locale, ref, className, ...rootAttributes }: MediaManagerProps<V>) => import("react").JSX.Element;
|
|
286
309
|
export default MediaManager;
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import type { FileEntry, MediaSection } from "../../types";
|
|
1
|
+
import type { FileEntry, MediaSection } from "../../types/index.js";
|
|
2
2
|
interface MediaMoveProps {
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/** What's being moved: the asset or group shown, or what's selected. */
|
|
4
|
+
entries: readonly FileEntry[];
|
|
5
5
|
section: MediaSection;
|
|
6
|
-
/** The groups
|
|
6
|
+
/** The groups the way through starts from, from the library's root: where the one shown is, or the level open. */
|
|
7
7
|
from: readonly FileEntry[];
|
|
8
|
+
/**
|
|
9
|
+
* The levels they're in now, by their ids, the library's root by its own, so Move here is held back
|
|
10
|
+
* where every one of them is already; a search may have found them in several.
|
|
11
|
+
*/
|
|
12
|
+
sources: ReadonlySet<string>;
|
|
8
13
|
/** Those on their way somewhere already, which can't be gone into. */
|
|
9
14
|
movingIds: ReadonlySet<string>;
|
|
15
|
+
/** What going back from it is named: back to the asset shown, or to the library. */
|
|
16
|
+
backLabel: string;
|
|
10
17
|
onCancel: () => void;
|
|
11
|
-
/** Moves
|
|
18
|
+
/** Moves them into the level with these groups open. */
|
|
12
19
|
onMove: (to: readonly FileEntry[]) => void;
|
|
13
20
|
}
|
|
14
21
|
/**
|
|
15
|
-
* Where an asset or group goes, a step in the library's place: a level at a time through its
|
|
16
|
-
* groups, as they're only ever listed so, from where
|
|
17
|
-
* so nothing goes inside itself.
|
|
18
|
-
* here is held back where
|
|
19
|
-
* and
|
|
22
|
+
* Where an asset or group goes, or several, a step in the library's place: a level at a time through its
|
|
23
|
+
* library's groups, as they're only ever listed so, from where they are now, a group being moved never
|
|
24
|
+
* offered, so nothing goes inside itself. They stay in their library, as what a library holds is one
|
|
25
|
+
* kind. Move here is held back where they all are already, where the listing or the group says nothing
|
|
26
|
+
* can be written, and with a group among them, where the library's `createGroups` says none can be. The
|
|
27
|
+
* backend has the final say.
|
|
20
28
|
*/
|
|
21
|
-
declare const MediaMove: ({
|
|
29
|
+
declare const MediaMove: ({ entries, section, from, sources, movingIds, backLabel, onCancel, onMove }: MediaMoveProps) => import("react").JSX.Element;
|
|
22
30
|
export default MediaMove;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, Ref } from "react";
|
|
2
|
-
import type { FileAdapter, FileEntry, MediaChoice, MediaManagerLimits, MediaManagerLocaleText, MediaPickerValue, MediaPickForm, MediaPickerSlotProps, MediaPickerSlots, MediaSection } from "../../types";
|
|
2
|
+
import type { FileAdapter, FileEntry, MediaChoice, MediaFiltersVariant, MediaManagerLimits, MediaManagerLocaleText, MediaPickerValue, MediaPickForm, MediaPickerSlotProps, MediaPickerSlots, MediaSection } from "../../types/index.js";
|
|
3
3
|
type RootAttributes = Omit<ComponentPropsWithoutRef<"div">, "children" | "defaultValue" | "onChange">;
|
|
4
4
|
export interface MediaPickerProps<V = Record<string, unknown>> extends RootAttributes {
|
|
5
5
|
/** Serves the library, unless it brings its own adapter. */
|
|
@@ -7,8 +7,9 @@ export interface MediaPickerProps<V = Record<string, unknown>> extends RootAttri
|
|
|
7
7
|
/**
|
|
8
8
|
* The one library to pick from, the same object a `MediaManager` takes. Its `layouts`,
|
|
9
9
|
* `renderAsset`, `renderGroup`, `groupHeader`, `selectable`, `acceptUploads`, `uploadForm` and
|
|
10
|
-
* `pickForm` count here too
|
|
11
|
-
* place here and is left unread. Changing it, or its
|
|
10
|
+
* `pickForm` count here too, and with `allowCreateGroups`, `createGroups` and `groupForm`; what's
|
|
11
|
+
* for managing it, such as `processForm`, has no place here and is left unread. Changing it, or its
|
|
12
|
+
* adapter, starts the picker afresh.
|
|
12
13
|
*/
|
|
13
14
|
section: MediaSection;
|
|
14
15
|
/**
|
|
@@ -66,6 +67,23 @@ export interface MediaPickerProps<V = Record<string, unknown>> extends RootAttri
|
|
|
66
67
|
* goes.
|
|
67
68
|
*/
|
|
68
69
|
allowUpload?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether groups can be made here, for uploads that want a group of their own, by New group in the
|
|
72
|
+
* header: off by default, as `allowUpload` is. It's offered where the library's `createGroups` says
|
|
73
|
+
* one can be made in the level open, as in the media manager, asking the library's `groupForm`
|
|
74
|
+
* where the adapter has `createGroup`, or else only a name, where it has `createFolder`, and not in
|
|
75
|
+
* a `readOnly` library or a level that refuses writing. Once it's made, the picker goes into it, so
|
|
76
|
+
* what's uploaded next goes there.
|
|
77
|
+
*/
|
|
78
|
+
allowCreateGroups?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* How the library's filters (`MediaSection.filterForm`) show from the header's Filters button:
|
|
81
|
+
* `"card"`, dropping from it over the results, or `"dialog"`, over the whole picker, its foot
|
|
82
|
+
* included, applying what's changed only with its Apply, as `MediaManager`'s does. A form's own
|
|
83
|
+
* `variant` comes first. Both are drawn inside the picker, so one in an app's own modal dialog keeps
|
|
84
|
+
* the focus. `"card"` when omitted.
|
|
85
|
+
*/
|
|
86
|
+
filtersVariant?: MediaFiltersVariant;
|
|
69
87
|
/**
|
|
70
88
|
* The library's states drawn as the app's own components (`empty`, `noResults`, `error`,
|
|
71
89
|
* `loading`), each in the box the picker's own takes. Keep them outside the app's component, as
|
|
@@ -112,11 +130,11 @@ export interface MediaPickerProps<V = Record<string, unknown>> extends RootAttri
|
|
|
112
130
|
/**
|
|
113
131
|
* One library to find an asset in and choose it, for a field that points at an asset of another
|
|
114
132
|
* library, such as a series' teaser or a video's poster: its assets and groups, a search by name, and,
|
|
115
|
-
* when the app allows it, uploading what isn't there yet. It's a sibling of
|
|
116
|
-
* the same parts, with nothing for managing a library: no list of
|
|
117
|
-
*
|
|
133
|
+
* when the app allows it, uploading what isn't there yet and making a group for it. It's a sibling of
|
|
134
|
+
* `MediaManager` built from the same parts, with nothing else for managing a library: no list of
|
|
135
|
+
* libraries, no asset view, and nothing to delete or move, so none of that needs turning off. With `pickForm`, what's
|
|
118
136
|
* selected is listed beside the library, each with the app's form for this use of it. It has no dialog
|
|
119
137
|
* of its own, as a picker's place is the app's.
|
|
120
138
|
*/
|
|
121
|
-
declare const MediaPicker: <V>({ adapter, section, onChoose, pickForm, onCancel, multiple, maxChoices, canSelect, selectGroups, allowUpload, slots, slotProps, value, defaultValue, onChange, relistAfter, limits, localeText, locale, ref, className, ...rootAttributes }: MediaPickerProps<V>) => import("react").JSX.Element;
|
|
139
|
+
declare const MediaPicker: <V>({ adapter, section, onChoose, pickForm, onCancel, multiple, maxChoices, canSelect, selectGroups, allowUpload, allowCreateGroups, filtersVariant, slots, slotProps, value, defaultValue, onChange, relistAfter, limits, localeText, locale, ref, className, ...rootAttributes }: MediaPickerProps<V>) => import("react").JSX.Element;
|
|
122
140
|
export default MediaPicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, Ref } from "react";
|
|
2
|
-
import type { FileAdapter, FileEntry, ViewMode } from "../../types";
|
|
2
|
+
import type { FileAdapter, FileEntry, ViewMode } from "../../types/index.js";
|
|
3
3
|
export interface MediaPictureProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
4
4
|
/** The asset or group to show, as the adapter listed it. */
|
|
5
5
|
entry: FileEntry;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileAdapter, FileEntry, MediaProcessForm, MediaSection } from "../../types";
|
|
1
|
+
import type { FileAdapter, FileEntry, MediaProcessForm, MediaSection } from "../../types/index.js";
|
|
2
2
|
interface MediaProcessProps {
|
|
3
3
|
/** The asset as it's listed now, which the form follows. */
|
|
4
4
|
entry: FileEntry;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MediaAssetLookProps } from "../../types";
|
|
1
|
+
import type { MediaAssetLookProps } from "../../types/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* How the media manager draws an asset of a library shown as a list, for an app's `renderAsset` to
|
|
4
4
|
* change a little: `<MediaRow {...params} title={params.asset.meta?.title} />`. Its picture or icon,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MediaAssetLookProps } from "../../types";
|
|
1
|
+
import type { MediaAssetLookProps } from "../../types/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* How the media manager draws an asset of a library of tiles, for an app's `renderAsset` to change a
|
|
4
4
|
* little: `<MediaTile {...params} detail={params.asset.meta?.show} />`. Its picture or icon in the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileAdapter, MediaSection, MediaUploadCheck, MediaUploadForm } from "../../types";
|
|
1
|
+
import type { FileAdapter, FileEntry, FolderUpload, MediaSection, MediaUploadCheck, MediaUploadForm, UploadPartTarget } from "../../types/index.js";
|
|
2
2
|
interface MediaUploadProps {
|
|
3
3
|
section: MediaSection;
|
|
4
4
|
/** The name of the library or group they go into, as the title says and its back button goes to. */
|
|
@@ -7,18 +7,40 @@ interface MediaUploadProps {
|
|
|
7
7
|
adapter: FileAdapter;
|
|
8
8
|
/** What was given, as the check before sending sorted it. */
|
|
9
9
|
check: MediaUploadCheck;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* What the library asks of the files given: its upload form, for them, or nothing. With folders to
|
|
12
|
+
* make groups of, the step asks the library itself once they're read, of every file they hold too.
|
|
13
|
+
*/
|
|
11
14
|
form: MediaUploadForm | null;
|
|
15
|
+
/**
|
|
16
|
+
* The asset whose file the one given is to take the place of, from its view's Replace file, as it
|
|
17
|
+
* was asked for; undefined for an upload. Its way back goes to the asset.
|
|
18
|
+
*/
|
|
19
|
+
replacing?: FileEntry;
|
|
20
|
+
/**
|
|
21
|
+
* The asset and the part of it the files given go into, from a property's Upload in its view, with
|
|
22
|
+
* the types the part takes (`PropertyUpload.accept`); undefined for an upload. Its way back goes to
|
|
23
|
+
* the asset.
|
|
24
|
+
*/
|
|
25
|
+
intoPart?: UploadPartTarget & {
|
|
26
|
+
accept?: string;
|
|
27
|
+
};
|
|
12
28
|
onCancel: () => void;
|
|
13
|
-
/**
|
|
14
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Sends the files, with what the upload form holds, with no form nothing, and the folders to make
|
|
31
|
+
* groups of, as read, those that couldn't be or hold nothing the library takes left out.
|
|
32
|
+
*/
|
|
33
|
+
onUpload: (values: Readonly<Record<string, unknown>> | undefined, groups: FolderUpload[]) => void;
|
|
15
34
|
}
|
|
16
35
|
/**
|
|
17
36
|
* The step before files are uploaded into a library, in its place, as the asset view is: what's
|
|
18
37
|
* about to go, what's left out and why, and the library's upload form for them, with Cancel and
|
|
19
38
|
* Upload, held back while the form isn't ready and while its `validate` is answered, which refusing keeps
|
|
20
39
|
* this open, saying why; or, with nothing left to send, why, with Close. Shown only when there's
|
|
21
|
-
* something to ask or to say
|
|
40
|
+
* something to ask or to say, and always for folders, which it reads first, saying what groups they
|
|
41
|
+
* make, as the upload form is asked of every file they hold. Before a file is put in an asset's place
|
|
42
|
+
* (`replacing`), the same over the asset's view, with Replace; before files go into a part of an asset
|
|
43
|
+
* (`intoPart`), the same over its view, with the part's own form and the types it takes.
|
|
22
44
|
*/
|
|
23
|
-
declare const MediaUpload: ({ section, levelName, adapter, check, form, onCancel, onUpload }: MediaUploadProps) => import("react").JSX.Element;
|
|
45
|
+
declare const MediaUpload: ({ section, levelName, adapter, check, form, replacing, intoPart, onCancel, onUpload, }: MediaUploadProps) => import("react").JSX.Element;
|
|
24
46
|
export default MediaUpload;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileAdapter, FileEntry, MediaChoice, MediaPickerValue, MediaPickForm, MediaPickerSlotProps, MediaPickerSlots, MediaSection } from "../../types";
|
|
1
|
+
import type { FileAdapter, FileEntry, MediaChoice, MediaFiltersVariant, MediaPickerValue, MediaPickForm, MediaPickerSlotProps, MediaPickerSlots, MediaSection } from "../../types/index.js";
|
|
2
2
|
export interface PickerFrameProps {
|
|
3
3
|
section: MediaSection;
|
|
4
4
|
adapter: FileAdapter;
|
|
@@ -12,6 +12,10 @@ export interface PickerFrameProps {
|
|
|
12
12
|
/** Whether groups can be selected as well as assets. */
|
|
13
13
|
selectGroups: boolean;
|
|
14
14
|
allowUpload: boolean;
|
|
15
|
+
/** Whether New group is offered, where the library makes groups. */
|
|
16
|
+
allowCreateGroups: boolean;
|
|
17
|
+
/** How the library's filters show, where its form doesn't say (`MediaFilterForm.variant`). */
|
|
18
|
+
filtersVariant: MediaFiltersVariant;
|
|
15
19
|
value: readonly MediaPickerValue[] | undefined;
|
|
16
20
|
defaultValue: readonly MediaPickerValue[] | undefined;
|
|
17
21
|
onChange: ((choices: MediaChoice[]) => void) | undefined;
|
|
@@ -25,5 +29,5 @@ export interface PickerFrameProps {
|
|
|
25
29
|
slotProps: MediaPickerSlotProps;
|
|
26
30
|
}
|
|
27
31
|
/** Everything inside the picker's root, below the contexts it provides. */
|
|
28
|
-
declare const PickerFrame: ({ section, adapter, onChoose, pickForm, onCancel, multiple, maxChoices, canSelect, selectGroups, allowUpload, value, defaultValue, onChange, uploadLimit, searchDelay, slots, slotProps, }: PickerFrameProps) => import("react").JSX.Element;
|
|
32
|
+
declare const PickerFrame: ({ section, adapter, onChoose, pickForm, onCancel, multiple, maxChoices, canSelect, selectGroups, allowUpload, allowCreateGroups, filtersVariant, value, defaultValue, onChange, uploadLimit, searchDelay, slots, slotProps, }: PickerFrameProps) => import("react").JSX.Element;
|
|
29
33
|
export default PickerFrame;
|