@prismicio/editor-fields 0.4.26 → 0.4.27
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/EditorConfig.d.ts +7 -3
- package/dist/SlicePrimaryWidgetSwitch.d.ts +12 -0
- package/dist/core/imageUtils.d.ts +1 -1
- package/dist/core/service/document.d.ts +38 -0
- package/dist/index.cjs.js +30 -30
- package/dist/index.es.js +15457 -15276
- package/dist/zones/RepeatableZoneEditor.d.ts +8 -3
- package/dist/zones/SlicePrimaryZoneEditor.d.ts +13 -0
- package/package.json +4 -4
package/dist/EditorConfig.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type EditorConfig = {
|
|
|
6
6
|
authStrategy: AuthStrategy;
|
|
7
7
|
baseUrl: URL;
|
|
8
8
|
} & OptionalConfigs;
|
|
9
|
-
type OptionalConfigs = SearchDocuments & MediaLibrary & UIDField & Analytics & IntegrationFields;
|
|
9
|
+
type OptionalConfigs = SearchDocuments & MediaLibrary & UIDField & Analytics & ErrorTracking & IntegrationFields;
|
|
10
10
|
type MediaLibrary = {
|
|
11
11
|
mediaLibrary?: never;
|
|
12
12
|
} | {
|
|
@@ -44,7 +44,7 @@ type IntegrationFields = {
|
|
|
44
44
|
repository: string;
|
|
45
45
|
};
|
|
46
46
|
interface OnAnalyticsEvent {
|
|
47
|
-
(event: "Media Library Search",
|
|
47
|
+
(event: "Media Library Search", args: {
|
|
48
48
|
useOpenSearch: "1" | "0";
|
|
49
49
|
assetType: MediaAssetType;
|
|
50
50
|
mode: "browse" | "select";
|
|
@@ -53,7 +53,7 @@ interface OnAnalyticsEvent {
|
|
|
53
53
|
numberOfResults: string;
|
|
54
54
|
timeToGetResults: string;
|
|
55
55
|
}): void;
|
|
56
|
-
(event: "Media Added To Page",
|
|
56
|
+
(event: "Media Added To Page", args: {
|
|
57
57
|
useOpenSearch: "1" | "0";
|
|
58
58
|
assetType: MediaAssetType;
|
|
59
59
|
searchQuery: string;
|
|
@@ -68,6 +68,10 @@ interface OnAnalyticsEvent {
|
|
|
68
68
|
interface Analytics {
|
|
69
69
|
onAnalyticsEvent?: OnAnalyticsEvent;
|
|
70
70
|
}
|
|
71
|
+
interface ErrorTracking {
|
|
72
|
+
/** Asks the editor to track this Error in its Error monitoring solution. */
|
|
73
|
+
onTrackError?: (error: Error) => void;
|
|
74
|
+
}
|
|
71
75
|
export type AuthStrategy = "cookie" | "token";
|
|
72
76
|
export declare const EditorConfigContext: import("react").Context<EditorConfig | undefined>;
|
|
73
77
|
export declare function useEditorConfig(): EditorConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type SlicePrimaryContent } from "@prismicio/types-internal/lib/content";
|
|
3
|
+
import type { SlicePrimaryWidget } from "@prismicio/types-internal/lib/customtypes";
|
|
4
|
+
interface Props {
|
|
5
|
+
content: SlicePrimaryContent | undefined;
|
|
6
|
+
id: string;
|
|
7
|
+
slicePrimaryWidget: SlicePrimaryWidget;
|
|
8
|
+
onContentChange: (content: SlicePrimaryContent | undefined) => void;
|
|
9
|
+
readOnly: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function SlicePrimaryWidgetSwitch(props: Props): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -37,7 +37,7 @@ export declare function buildImageUrl(originUrl: string, rect: {
|
|
|
37
37
|
export declare function getPreviewImage(fromUrl: string): string;
|
|
38
38
|
export declare function getSearchTileImage(fromUrl: string): string;
|
|
39
39
|
export declare function getCarouselItemSource(view: ImageContentView | undefined): string | undefined;
|
|
40
|
-
export declare function replaceImage(field: Image, extImage: MediaAssetOrExternalImage): ImageContent;
|
|
40
|
+
export declare function replaceImage(thumbnailName: string, field: Image, content: ImageContent | undefined, extImage: MediaAssetOrExternalImage): ImageContent;
|
|
41
41
|
export declare function isMediaAsset(image: MediaAssetOrExternalImage): image is MediaAsset;
|
|
42
42
|
export declare function createContentView(image: MediaAssetOrExternalImage, constraints?: ImageConstraint): ImageContentView;
|
|
43
43
|
export declare function fitImage(extImage: {
|
|
@@ -498,4 +498,42 @@ export declare function createSearchParams<T extends string>(params: {
|
|
|
498
498
|
values: string[];
|
|
499
499
|
}[]): [string, string][];
|
|
500
500
|
export declare function getDocumentByDocumentId(baseUrl: URL, authStrategy: AuthStrategy, id: string): Promise<DocumentMeta>;
|
|
501
|
+
export declare function getDocumentsByReleaseId(baseUrl: URL, authStrategy: AuthStrategy, releaseId: string, limit?: number): Promise<{
|
|
502
|
+
total: number;
|
|
503
|
+
results: {
|
|
504
|
+
id: string;
|
|
505
|
+
title: string;
|
|
506
|
+
custom_type_id: string;
|
|
507
|
+
group_lang_id: string;
|
|
508
|
+
language: {
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
is_master?: boolean | undefined;
|
|
512
|
+
};
|
|
513
|
+
versions: (({
|
|
514
|
+
status: "unclassified";
|
|
515
|
+
} | {
|
|
516
|
+
status: "published";
|
|
517
|
+
} | {
|
|
518
|
+
status: "release";
|
|
519
|
+
release_id: string;
|
|
520
|
+
} | {
|
|
521
|
+
status: "archived";
|
|
522
|
+
}) & {
|
|
523
|
+
version_id: string;
|
|
524
|
+
tags: string[];
|
|
525
|
+
custom_type_label: string;
|
|
526
|
+
last_modified_date: Date;
|
|
527
|
+
author: {
|
|
528
|
+
first_name?: string | undefined;
|
|
529
|
+
last_name?: string | undefined;
|
|
530
|
+
email?: string | undefined;
|
|
531
|
+
};
|
|
532
|
+
preview_summary?: string | undefined;
|
|
533
|
+
preview_image?: string | undefined;
|
|
534
|
+
uid?: string | undefined;
|
|
535
|
+
})[];
|
|
536
|
+
}[];
|
|
537
|
+
cursor?: string | undefined;
|
|
538
|
+
}>;
|
|
501
539
|
export {};
|