@prismicio/editor-fields 0.4.60 → 0.4.61

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.
@@ -1,5 +1,5 @@
1
+ /// <reference types="react" />
1
2
  import { type MediaAssetType } from "@prismicio/editor-ui";
2
- import { type RefObject } from "react";
3
3
  interface MediaLibraryProps {
4
4
  /**
5
5
  * The type of media to limit the media library to.
@@ -8,9 +8,10 @@ interface MediaLibraryProps {
8
8
  */
9
9
  assetType?: MediaAssetType;
10
10
  /**
11
- * A ref to render the actions container outside the media library.
11
+ * A container in which the actions (search bar & upload button) are rendered.
12
+ * If not provided, the actions will be rendered inside the media library.
12
13
  */
13
- actionContainerRef?: RefObject<HTMLDivElement>;
14
+ actionContainer?: Element | null;
14
15
  onSelectedChange?: (ids: Set<string>) => void;
15
16
  }
16
17
  export declare function MediaLibrary(props: MediaLibraryProps): JSX.Element;
@@ -1,8 +1,8 @@
1
- import { type ReactNode, type RefObject } from "react";
1
+ import { type ReactNode } from "react";
2
2
  export declare function MediaLibraryActions(): JSX.Element;
3
3
  interface MediaLibraryActionsContainerProps {
4
4
  children: ReactNode;
5
- actionContainerRef: RefObject<HTMLDivElement> | undefined;
5
+ actionContainer?: Element | null;
6
6
  }
7
7
  export declare function MediaLibraryActionsContainer(props: MediaLibraryActionsContainerProps): JSX.Element;
8
8
  export {};
@@ -1,5 +1,5 @@
1
1
  import { type MediaAssetType } from "@prismicio/editor-ui";
2
- import { type PropsWithChildren, type RefObject } from "react";
2
+ import { type PropsWithChildren } from "react";
3
3
  import { type MediaAsset, type MediaLibraryFilters } from "../hooks/mediaLibraryData";
4
4
  import { type UploadFile } from "../hooks/useMediaLibraryUpload";
5
5
  interface MediaLibraryContextValue {
@@ -12,9 +12,10 @@ interface MediaLibraryContextValue {
12
12
  /** Update a media asset in the cache. */
13
13
  updateMedia: (id: string, update: Partial<MediaAsset>) => void;
14
14
  /**
15
- * A ref to render the actions container outside the media library.
15
+ * A container in which the actions (search bar & upload button) are rendered.
16
+ * If not provided, the actions will be rendered inside the media library.
16
17
  */
17
- actionContainerRef?: RefObject<HTMLDivElement>;
18
+ actionContainer?: Element | null;
18
19
  onFilesUpload: (files: File[]) => void;
19
20
  isUploading: boolean;
20
21
  uploadingFiles: UploadFile[];
@@ -49,9 +50,10 @@ interface MediaLibraryProviderProps extends PropsWithChildren {
49
50
  */
50
51
  assetType?: MediaAssetType;
51
52
  /**
52
- * A ref to render the actions container outside the media library.
53
+ * A container in which the actions (search bar & upload button) are rendered.
54
+ * If not provided, the actions will be rendered inside the media library.
53
55
  */
54
- actionContainerRef?: RefObject<HTMLDivElement>;
56
+ actionContainer?: Element | null;
55
57
  onSelectedChange?: (ids: Set<string>) => void;
56
58
  }
57
59
  export declare function MediaLibraryProvider(props: MediaLibraryProviderProps): JSX.Element;
@@ -1,6 +1,6 @@
1
- import { type RefObject } from "react";
1
+ /// <reference types="react" />
2
2
  interface MediaLibrarySkeletonProps {
3
- actionContainerRef?: RefObject<HTMLDivElement>;
3
+ actionContainer?: Element | null;
4
4
  }
5
5
  export declare function MediaLibrarySkeleton(props: MediaLibrarySkeletonProps): JSX.Element;
6
6
  export declare function MediaCardSkeleton(): JSX.Element;