@prismicio/editor-fields 0.4.15 → 0.4.17
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/dist/core/MediaLibrary/MediaLibrary.d.ts +10 -0
- package/dist/core/MediaLibrary/components/FetchingMediaToast.d.ts +1 -0
- package/dist/core/MediaLibrary/components/LoadingToast.d.ts +5 -0
- package/dist/core/MediaLibrary/components/MediaCard.d.ts +9 -0
- package/dist/core/MediaLibrary/components/MediaLibraryContext.d.ts +17 -0
- package/dist/core/MediaLibrary/components/MediaList.d.ts +1 -0
- package/dist/core/MediaLibrary/index.d.ts +1 -0
- package/dist/fields/ImageField/MediaDialog/MediaDialog.d.ts +6 -0
- package/dist/fields/ImageField/MediaDialog/index.d.ts +1 -0
- package/dist/fields/ImageField/MediaDialog/useNewMediaLibrary.d.ts +10 -0
- package/dist/fields/LinkField/Documents/documentsData.d.ts +16 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +28448 -28207
- package/package.json +4 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MediaAssetType } from "../../fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData";
|
|
2
|
+
interface MediaLibraryProps {
|
|
3
|
+
/**
|
|
4
|
+
* The type of media to fetch from the media library.
|
|
5
|
+
* @default all
|
|
6
|
+
*/
|
|
7
|
+
assetType?: MediaAssetType;
|
|
8
|
+
}
|
|
9
|
+
export declare function MediaLibrary(props: MediaLibraryProps): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FetchingMediaToast(): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MediaAsset } from "../../../fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData";
|
|
2
|
+
interface MediaLibraryCardProps extends MediaAsset {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Temporary Media Item Card component.
|
|
6
|
+
* This will be improved in [PBD-980](https://linear.app/prismic/issue/PBD-980/show-media-item-with-info)
|
|
7
|
+
*/
|
|
8
|
+
export declare function MediaCard(props: MediaLibraryCardProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
import { type MediaAsset, type MediaAssetType } from "../../../fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData";
|
|
3
|
+
interface MediaLibraryContextValue {
|
|
4
|
+
onScrollToBottom: () => void;
|
|
5
|
+
isFetchingMedia: boolean;
|
|
6
|
+
media: MediaAsset[];
|
|
7
|
+
}
|
|
8
|
+
interface MediaLibraryProviderProps extends PropsWithChildren {
|
|
9
|
+
/**
|
|
10
|
+
* The type of media to fetch from the media library.
|
|
11
|
+
* @default all
|
|
12
|
+
*/
|
|
13
|
+
assetType?: MediaAssetType;
|
|
14
|
+
}
|
|
15
|
+
export declare function MediaLibraryProvider(props: MediaLibraryProviderProps): JSX.Element;
|
|
16
|
+
export declare function useMediaLibrary(): MediaLibraryContextValue;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MediaList(): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MediaLibrary } from "./MediaLibrary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MediaDialog } from "./MediaDialog";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The new media library is actively being developed and should only be available for developers.
|
|
3
|
+
* To keep the previous implementation active for all others that are not actively developing it.
|
|
4
|
+
* An active action is required to activate features related to the new media library.
|
|
5
|
+
*
|
|
6
|
+
* Activate new media library features by adding the `mediaLib` query parameter to the current URL.
|
|
7
|
+
*
|
|
8
|
+
* TODO: Remove this once the new media library is released.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useNewMediaLibrary(): boolean;
|
|
@@ -7,8 +7,14 @@ export declare function useDocuments(params: {
|
|
|
7
7
|
}): {
|
|
8
8
|
documents: {
|
|
9
9
|
id: string;
|
|
10
|
-
custom_type_id: string;
|
|
11
10
|
title: string;
|
|
11
|
+
custom_type_id: string;
|
|
12
|
+
group_lang_id: string;
|
|
13
|
+
language: {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
is_master?: boolean | undefined;
|
|
17
|
+
};
|
|
12
18
|
versions: (({
|
|
13
19
|
status: "unclassified";
|
|
14
20
|
} | {
|
|
@@ -26,20 +32,25 @@ export declare function useDocuments(params: {
|
|
|
26
32
|
author: {
|
|
27
33
|
first_name?: string | undefined;
|
|
28
34
|
last_name?: string | undefined;
|
|
35
|
+
email?: string | undefined;
|
|
29
36
|
};
|
|
30
37
|
preview_summary?: string | undefined;
|
|
31
38
|
preview_image?: string | undefined;
|
|
32
39
|
})[];
|
|
33
|
-
locale: string;
|
|
34
|
-
group_lang_id: string;
|
|
35
40
|
}[];
|
|
36
41
|
onHasReachedBottom: () => void;
|
|
37
42
|
response: {
|
|
38
43
|
total: number;
|
|
39
44
|
results: {
|
|
40
45
|
id: string;
|
|
41
|
-
custom_type_id: string;
|
|
42
46
|
title: string;
|
|
47
|
+
custom_type_id: string;
|
|
48
|
+
group_lang_id: string;
|
|
49
|
+
language: {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
is_master?: boolean | undefined;
|
|
53
|
+
};
|
|
43
54
|
versions: (({
|
|
44
55
|
status: "unclassified";
|
|
45
56
|
} | {
|
|
@@ -57,12 +68,11 @@ export declare function useDocuments(params: {
|
|
|
57
68
|
author: {
|
|
58
69
|
first_name?: string | undefined;
|
|
59
70
|
last_name?: string | undefined;
|
|
71
|
+
email?: string | undefined;
|
|
60
72
|
};
|
|
61
73
|
preview_summary?: string | undefined;
|
|
62
74
|
preview_image?: string | undefined;
|
|
63
75
|
})[];
|
|
64
|
-
locale: string;
|
|
65
|
-
group_lang_id: string;
|
|
66
76
|
}[];
|
|
67
77
|
cursor?: string | undefined;
|
|
68
78
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
export { MediaLibrary } from "./core/MediaLibrary";
|
|
1
2
|
export { DocumentEditor } from "./DocumentEditor";
|
|
2
|
-
export { type EditorConfig, suppressConfigErrors, throwConfigError } from "./EditorConfig";
|
|
3
|
+
export { type EditorConfig, EditorConfigContext, suppressConfigErrors, throwConfigError } from "./EditorConfig";
|
|
3
4
|
export { getSelectionDOMId, type Selection, type SelectionArea, SelectionContext, useSelection } from "./Selection";
|
|
4
5
|
export { defaultImageContentWidget } from "./slices/defaults";
|
|
5
6
|
export { SharedSliceEditor } from "./slices/SharedSliceEditor";
|