@firecms/media_manager 3.1.0-canary.1df3b2c
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/LICENSE +6 -0
- package/dist/MediaManagerProvider.d.ts +14 -0
- package/dist/components/MediaAssetCard.d.ts +13 -0
- package/dist/components/MediaAssetDetails.d.ts +11 -0
- package/dist/components/MediaLibraryCard.d.ts +8 -0
- package/dist/components/MediaLibraryView.d.ts +9 -0
- package/dist/components/MediaUploadDialog.d.ts +13 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +1280 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +1276 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/types/config.d.ts +87 -0
- package/dist/types/controller.d.ts +66 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/media_asset.d.ts +70 -0
- package/dist/useMediaManagerController.d.ts +18 -0
- package/dist/useMediaManagerPlugin.d.ts +23 -0
- package/package.json +58 -0
- package/src/MediaManagerProvider.tsx +34 -0
- package/src/components/MediaAssetCard.tsx +134 -0
- package/src/components/MediaAssetDetails.tsx +353 -0
- package/src/components/MediaLibraryCard.tsx +55 -0
- package/src/components/MediaLibraryView.tsx +194 -0
- package/src/components/MediaUploadDialog.tsx +264 -0
- package/src/components/index.ts +5 -0
- package/src/index.ts +10 -0
- package/src/types/config.ts +100 -0
- package/src/types/controller.ts +79 -0
- package/src/types/index.ts +3 -0
- package/src/types/media_asset.ts +84 -0
- package/src/useMediaManagerController.tsx +387 -0
- package/src/useMediaManagerPlugin.tsx +97 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Source code in this repository is variously licensed under the Business Source
|
|
2
|
+
License 1.1 (BSL), Apache version 2.0 and the MIT license. A copy of each
|
|
3
|
+
license can be found in each one of the packages under the folder packages
|
|
4
|
+
under a file called License. Source code in a given file is licensed under the
|
|
5
|
+
BSL and the copyright belongs to Firecms Authors unless otherwise noted at the
|
|
6
|
+
beginning of the file.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { MediaManagerController } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Hook to access the MediaManagerController from context.
|
|
5
|
+
* Must be used within a MediaManagerProvider.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMediaManager(): MediaManagerController;
|
|
8
|
+
export interface MediaManagerProviderProps {
|
|
9
|
+
controller: MediaManagerController;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Provider component that makes the MediaManagerController available to all children.
|
|
13
|
+
*/
|
|
14
|
+
export declare function MediaManagerProvider({ controller, children }: PropsWithChildren<MediaManagerProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MediaAsset } from "../types";
|
|
2
|
+
export interface MediaAssetCardProps {
|
|
3
|
+
asset: MediaAsset;
|
|
4
|
+
viewMode: "grid" | "list";
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
/** Preferred thumbnail size to display (e.g., "small", "medium") */
|
|
8
|
+
thumbnailSize?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Card component for displaying a media asset in the grid or list.
|
|
12
|
+
*/
|
|
13
|
+
export declare function MediaAssetCard({ asset, viewMode, onClick, selected, thumbnailSize }: MediaAssetCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MediaAsset } from "../types";
|
|
2
|
+
export interface MediaAssetDetailsProps {
|
|
3
|
+
asset: MediaAsset;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onUpdate: (assetId: string, data: Partial<MediaAsset>) => Promise<void>;
|
|
6
|
+
onDelete: (assetId: string) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Side panel component for viewing and editing media asset details.
|
|
10
|
+
*/
|
|
11
|
+
export declare function MediaAssetDetails({ asset, onClose, onUpdate, onDelete }: MediaAssetDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface MediaLibraryCardProps {
|
|
2
|
+
group?: string;
|
|
3
|
+
context?: unknown;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Card component displayed on the home page that links to the Media Library.
|
|
7
|
+
*/
|
|
8
|
+
export declare function MediaLibraryCard({ group }: MediaLibraryCardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface MediaLibraryViewProps {
|
|
2
|
+
maxFileSize?: number;
|
|
3
|
+
acceptedMimeTypes?: string[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Main view component for the Media Library.
|
|
7
|
+
* Displays a grid of assets with search, upload, and management capabilities.
|
|
8
|
+
*/
|
|
9
|
+
export declare function MediaLibraryView({ maxFileSize, acceptedMimeTypes }: MediaLibraryViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MediaUploadDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onUpload: (files: File[]) => Promise<void>;
|
|
5
|
+
maxFileSize?: number;
|
|
6
|
+
acceptedMimeTypes?: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Dialog component for uploading files to the media library.
|
|
10
|
+
* Supports drag-and-drop and file browser selection.
|
|
11
|
+
*/
|
|
12
|
+
export declare function MediaUploadDialog({ open, onClose, onUpload, maxFileSize, // 50MB default
|
|
13
|
+
acceptedMimeTypes }: MediaUploadDialogProps): import("react/jsx-runtime").JSX.Element;
|