@prismicio/editor-fields 0.4.59-alpha.feat-track-onboarding-tutorial.0 → 0.4.59-alpha.xru-link-variant-link-style.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/dist/core/service/document.d.ts +132 -0
- package/dist/fields/LinkField/LinkField.d.ts +4 -3
- package/dist/fields/LinkField/LinkFieldActions.d.ts +3 -0
- package/dist/fields/LinkField/RepeatableLinkField/useRepeatableLinkField.d.ts +8 -1
- package/dist/fields/LinkField/WebLinks/WebLinkModal.d.ts +5 -2
- package/dist/fields/LinkField/useLinkField.d.ts +6 -1
- package/dist/index.cjs.js +46 -46
- package/dist/index.es.js +17666 -17514
- package/dist/slices/utils.d.ts +12 -0
- package/package.json +5 -5
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { FilledLinkContent, type LinkContent } from "@prismicio/types-internal/lib/content";
|
|
3
3
|
import type { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
4
4
|
import { type FieldSelectType } from "./LinkFieldActions";
|
|
5
|
-
type
|
|
5
|
+
type LinkFieldAppearance = "normal" | "compact" | "condensedButtons";
|
|
6
6
|
interface LinkFieldProps {
|
|
7
7
|
id?: string;
|
|
8
8
|
field: Link;
|
|
9
9
|
content: LinkContent | undefined;
|
|
10
10
|
onContentChange: (content: LinkContent | undefined) => void;
|
|
11
|
-
|
|
11
|
+
appearance?: LinkFieldAppearance;
|
|
12
|
+
backgroundColor?: "transparent" | "grey1";
|
|
12
13
|
}
|
|
13
14
|
export declare function LinkField(props: LinkFieldProps): JSX.Element;
|
|
14
15
|
interface GetFieldIconArgs {
|
|
@@ -18,7 +19,7 @@ interface GetFieldIconArgs {
|
|
|
18
19
|
export declare function getFieldIcon(args: GetFieldIconArgs): "image" | "description" | "link" | "notes" | "public";
|
|
19
20
|
interface FilledLinkFieldProps {
|
|
20
21
|
id?: string;
|
|
21
|
-
|
|
22
|
+
appearance?: LinkFieldAppearance;
|
|
22
23
|
field: Link & {
|
|
23
24
|
config?: {
|
|
24
25
|
allowText?: false;
|
|
@@ -12,6 +12,9 @@ interface Props {
|
|
|
12
12
|
condensedButtons?: boolean;
|
|
13
13
|
showNewTabButton?: boolean;
|
|
14
14
|
displayTextEnabled: boolean;
|
|
15
|
+
variants: string[];
|
|
16
|
+
variant?: string;
|
|
17
|
+
onVariantChange: (newVariant: string) => void;
|
|
15
18
|
}
|
|
16
19
|
export declare function LinkFieldActions(props: Props): JSX.Element;
|
|
17
20
|
export {};
|
|
@@ -26,6 +26,7 @@ export declare function useRepeatableLinkField(props: UseRepeatableLinkFieldProp
|
|
|
26
26
|
kind: "image";
|
|
27
27
|
}) & {
|
|
28
28
|
text?: string | undefined;
|
|
29
|
+
variant?: string | undefined;
|
|
29
30
|
})) | ({
|
|
30
31
|
__TYPE__: "FileLink";
|
|
31
32
|
} & ((({
|
|
@@ -40,6 +41,7 @@ export declare function useRepeatableLinkField(props: UseRepeatableLinkFieldProp
|
|
|
40
41
|
kind: "file";
|
|
41
42
|
}) & {
|
|
42
43
|
text?: string | undefined;
|
|
44
|
+
variant?: string | undefined;
|
|
43
45
|
})) | ({
|
|
44
46
|
__TYPE__: "DocumentLink";
|
|
45
47
|
} & (({
|
|
@@ -48,6 +50,7 @@ export declare function useRepeatableLinkField(props: UseRepeatableLinkFieldProp
|
|
|
48
50
|
kind: "document";
|
|
49
51
|
}) & {
|
|
50
52
|
text?: string | undefined;
|
|
53
|
+
variant?: string | undefined;
|
|
51
54
|
})) | ({
|
|
52
55
|
__TYPE__: "ExternalLink";
|
|
53
56
|
} & ((({
|
|
@@ -62,23 +65,27 @@ export declare function useRepeatableLinkField(props: UseRepeatableLinkFieldProp
|
|
|
62
65
|
kind: "web";
|
|
63
66
|
}) & {
|
|
64
67
|
text?: string | undefined;
|
|
68
|
+
variant?: string | undefined;
|
|
65
69
|
})) | ({
|
|
66
70
|
__TYPE__: "MediaLink";
|
|
67
71
|
} & {
|
|
68
72
|
kind: "media";
|
|
69
73
|
} & {
|
|
70
74
|
text?: string | undefined;
|
|
75
|
+
variant?: string | undefined;
|
|
71
76
|
}) | ({
|
|
72
77
|
__TYPE__: "AnyLink";
|
|
73
78
|
} & {
|
|
74
79
|
kind: "any";
|
|
75
80
|
} & {
|
|
76
81
|
text?: string | undefined;
|
|
82
|
+
variant?: string | undefined;
|
|
77
83
|
});
|
|
78
84
|
})[];
|
|
79
85
|
updateLink: (linkContent: LinkContent | undefined, index: number) => void;
|
|
86
|
+
updateLinks: (updatedLinks: LinkContent[]) => void;
|
|
87
|
+
addLink: (index: number) => void;
|
|
80
88
|
deleteLink: (index: number) => void;
|
|
81
89
|
moveLink: (direction: "up" | "down", index: number) => void;
|
|
82
|
-
addLink: (index: number) => void;
|
|
83
90
|
};
|
|
84
91
|
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export interface WebLinkOptions {
|
|
3
|
+
newTab: boolean;
|
|
4
|
+
}
|
|
2
5
|
interface WebLinkModalProps {
|
|
3
6
|
open: boolean;
|
|
4
|
-
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
5
8
|
url: string;
|
|
6
9
|
openInNewTab: boolean;
|
|
7
10
|
showNewTabButton: boolean;
|
|
8
|
-
onUpdate: (
|
|
11
|
+
onUpdate: (url: string, options: WebLinkOptions) => void;
|
|
9
12
|
}
|
|
10
13
|
export declare function WebLinkModal(props: WebLinkModalProps): JSX.Element;
|
|
11
14
|
export {};
|
|
@@ -14,7 +14,9 @@ export declare function useLinkField(params: useLinkFieldParams): {
|
|
|
14
14
|
selectType: "web" | "document" | "media" | "any" | undefined;
|
|
15
15
|
fieldValue: string;
|
|
16
16
|
onDisplayTextChange: (displayText: string) => void;
|
|
17
|
-
onValueChange: (value: string,
|
|
17
|
+
onValueChange: (value: string, options?: {
|
|
18
|
+
newTab: boolean;
|
|
19
|
+
}) => void;
|
|
18
20
|
onTypeChange: (newValue?: FieldSelectType) => void;
|
|
19
21
|
placeholder: string;
|
|
20
22
|
isTypeSelectEnabled: boolean;
|
|
@@ -25,6 +27,9 @@ export declare function useLinkField(params: useLinkFieldParams): {
|
|
|
25
27
|
onMediaSelected: (newMedia: MediaAssetOrExternalImage) => void;
|
|
26
28
|
displayTextEnabled: boolean;
|
|
27
29
|
displayText: string;
|
|
30
|
+
variants: string[];
|
|
31
|
+
variant: string | undefined;
|
|
32
|
+
onVariantChange: (newVariant: string) => void;
|
|
28
33
|
};
|
|
29
34
|
export declare function useDocumentTitle(id: string): string;
|
|
30
35
|
interface MapMediaToLinkContentArgs {
|