@prismicio/editor-fields 0.4.57 → 0.4.58-alpha.repeatable-link-base.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/EditorConfig.d.ts +2 -0
- package/dist/FieldContext.d.ts +5 -0
- package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +62 -62
- package/dist/core/MediaLibrary/hooks/tagData.d.ts +3 -3
- package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +6 -6
- package/dist/core/service/customType.d.ts +13 -0
- package/dist/core/service/document.d.ts +1669 -418
- package/dist/core/service/documentSearch.d.ts +214 -0
- package/dist/core/service/index.d.ts +2 -0
- package/dist/core/service/repository.d.ts +29 -21
- package/dist/core/service/teamSpace.d.ts +48 -0
- package/dist/core/service/user.d.ts +112 -6
- package/dist/fields/IntegrationField/integrationData.d.ts +5 -5
- package/dist/fields/LinkField/Documents/DocumentCard.d.ts +1 -1
- package/dist/fields/LinkField/Documents/documentsData.d.ts +73 -44
- package/dist/fields/LinkField/LinkField.d.ts +4 -3
- package/dist/fields/LinkField/LinkOrRepeatableLinkField.d.ts +12 -0
- package/dist/fields/LinkField/RepeatableLinkField/RepeatableLinkField.d.ts +11 -0
- package/dist/fields/LinkField/RepeatableLinkField/RepeatableLinkFieldActions.d.ts +11 -0
- package/dist/fields/LinkField/RepeatableLinkField/index.d.ts +1 -0
- package/dist/fields/LinkField/RepeatableLinkField/useRepeatableLinkField.d.ts +84 -0
- package/dist/fields/LinkField/index.d.ts +1 -0
- package/dist/fields/LinkField/useLinkField.d.ts +6 -3
- package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +6 -6
- package/dist/fields/RichTextField/extensions/Embed/EmbedView.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/Image/ImageView.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/Link/LinkModel.d.ts +2 -2
- package/dist/index.cjs.js +37 -39
- package/dist/index.es.js +25902 -22602
- package/dist/slices/utils.d.ts +101 -27
- package/package.json +25 -24
- package/dist/fields/LinkField/RepeatableLinkField.d.ts +0 -12
- package/dist/fields/RichTextField/extensions/Image/ImageLinkControl.d.ts +0 -9
|
@@ -5,17 +5,60 @@ export declare function useDocuments(params: {
|
|
|
5
5
|
typesFilter: Set<FilterOption>;
|
|
6
6
|
localesFilter: Set<FilterOption>;
|
|
7
7
|
}): {
|
|
8
|
-
documents: {
|
|
8
|
+
documents: ({
|
|
9
|
+
versions: ((({
|
|
10
|
+
status: "unclassified";
|
|
11
|
+
} | {
|
|
12
|
+
status: "published";
|
|
13
|
+
} | {
|
|
14
|
+
status: "release";
|
|
15
|
+
release_id: string;
|
|
16
|
+
} | {
|
|
17
|
+
status: "archived";
|
|
18
|
+
}) & {
|
|
19
|
+
tags: string[];
|
|
20
|
+
author: {
|
|
21
|
+
first_name?: string | undefined;
|
|
22
|
+
last_name?: string | undefined;
|
|
23
|
+
email?: string | undefined;
|
|
24
|
+
uploadedAvatar?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
version_id: string;
|
|
27
|
+
last_modified_date: Date;
|
|
28
|
+
custom_type_label: string;
|
|
29
|
+
preview_image?: string | undefined;
|
|
30
|
+
uid?: string | undefined;
|
|
31
|
+
preview_summary?: string | undefined;
|
|
32
|
+
}) | (({
|
|
33
|
+
status: "unclassified";
|
|
34
|
+
} | {
|
|
35
|
+
status: "published";
|
|
36
|
+
} | {
|
|
37
|
+
status: "release";
|
|
38
|
+
release_id: string;
|
|
39
|
+
} | {
|
|
40
|
+
status: "archived";
|
|
41
|
+
}) & {
|
|
42
|
+
tags: string[];
|
|
43
|
+
version_id: string;
|
|
44
|
+
last_modified_date: Date;
|
|
45
|
+
summary?: string | undefined;
|
|
46
|
+
preview_image?: string | undefined;
|
|
47
|
+
uid?: string | undefined;
|
|
48
|
+
custom_type_id?: string | undefined;
|
|
49
|
+
author_ids?: string[] | undefined;
|
|
50
|
+
}))[];
|
|
9
51
|
id: string;
|
|
10
52
|
title: string;
|
|
11
53
|
language: {
|
|
54
|
+
isMaster?: boolean | undefined;
|
|
12
55
|
id: string;
|
|
13
|
-
|
|
14
|
-
is_master?: boolean | undefined;
|
|
56
|
+
label: string;
|
|
15
57
|
};
|
|
16
58
|
custom_type_id: string;
|
|
17
59
|
group_lang_id: string;
|
|
18
|
-
|
|
60
|
+
} | {
|
|
61
|
+
versions: ((({
|
|
19
62
|
status: "unclassified";
|
|
20
63
|
} | {
|
|
21
64
|
status: "published";
|
|
@@ -33,48 +76,34 @@ export declare function useDocuments(params: {
|
|
|
33
76
|
uploadedAvatar?: string | undefined;
|
|
34
77
|
};
|
|
35
78
|
version_id: string;
|
|
36
|
-
custom_type_label: string;
|
|
37
79
|
last_modified_date: Date;
|
|
80
|
+
custom_type_label: string;
|
|
81
|
+
preview_image?: string | undefined;
|
|
82
|
+
uid?: string | undefined;
|
|
38
83
|
preview_summary?: string | undefined;
|
|
84
|
+
}) | (({
|
|
85
|
+
status: "unclassified";
|
|
86
|
+
} | {
|
|
87
|
+
status: "published";
|
|
88
|
+
} | {
|
|
89
|
+
status: "release";
|
|
90
|
+
release_id: string;
|
|
91
|
+
} | {
|
|
92
|
+
status: "archived";
|
|
93
|
+
}) & {
|
|
94
|
+
tags: string[];
|
|
95
|
+
version_id: string;
|
|
96
|
+
last_modified_date: Date;
|
|
97
|
+
summary?: string | undefined;
|
|
39
98
|
preview_image?: string | undefined;
|
|
40
99
|
uid?: string | undefined;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
status: "release";
|
|
51
|
-
release_id: string;
|
|
52
|
-
} | {
|
|
53
|
-
status: "archived";
|
|
54
|
-
}) & {
|
|
55
|
-
tags: string[];
|
|
56
|
-
author: {
|
|
57
|
-
first_name?: string | undefined;
|
|
58
|
-
last_name?: string | undefined;
|
|
59
|
-
email?: string | undefined;
|
|
60
|
-
uploadedAvatar?: string | undefined;
|
|
61
|
-
};
|
|
62
|
-
version_id: string;
|
|
63
|
-
custom_type_label: string;
|
|
64
|
-
last_modified_date: Date;
|
|
65
|
-
preview_summary?: string | undefined;
|
|
66
|
-
preview_image?: string | undefined;
|
|
67
|
-
uid?: string | undefined;
|
|
68
|
-
})[];
|
|
69
|
-
id: string;
|
|
70
|
-
title: string;
|
|
71
|
-
language: {
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
is_master?: boolean | undefined;
|
|
75
|
-
};
|
|
76
|
-
custom_type_id: string;
|
|
77
|
-
group_lang_id: string;
|
|
78
|
-
}[];
|
|
79
|
-
};
|
|
100
|
+
custom_type_id?: string | undefined;
|
|
101
|
+
author_ids?: string[] | undefined;
|
|
102
|
+
}))[];
|
|
103
|
+
id: string;
|
|
104
|
+
title: string;
|
|
105
|
+
custom_type_id: string;
|
|
106
|
+
group_lang_id: string;
|
|
107
|
+
locale_id?: string | undefined;
|
|
108
|
+
})[];
|
|
80
109
|
};
|
|
@@ -2,22 +2,23 @@
|
|
|
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 LinkFieldVariant = "normal" | "compact" | "condensedButtons";
|
|
5
6
|
interface LinkFieldProps {
|
|
6
7
|
id?: string;
|
|
7
8
|
field: Link;
|
|
8
9
|
content: LinkContent | undefined;
|
|
9
|
-
condensedButtons?: boolean;
|
|
10
10
|
onContentChange: (content: LinkContent | undefined) => void;
|
|
11
|
+
variant?: LinkFieldVariant;
|
|
11
12
|
}
|
|
12
13
|
export declare function LinkField(props: LinkFieldProps): JSX.Element;
|
|
13
14
|
interface GetFieldIconArgs {
|
|
14
15
|
selectType?: FieldSelectType;
|
|
15
16
|
displayTextEnabled?: boolean;
|
|
16
17
|
}
|
|
17
|
-
export declare function getFieldIcon(args: GetFieldIconArgs): "
|
|
18
|
+
export declare function getFieldIcon(args: GetFieldIconArgs): "image" | "description" | "link" | "notes" | "public";
|
|
18
19
|
interface FilledLinkFieldProps {
|
|
19
20
|
id?: string;
|
|
20
|
-
|
|
21
|
+
variant?: LinkFieldVariant;
|
|
21
22
|
field: Link & {
|
|
22
23
|
config?: {
|
|
23
24
|
allowText?: false;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type NestableContent } from "@prismicio/types-internal/lib/content";
|
|
3
|
+
import type { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
4
|
+
interface LinkOrRepeatableLinkFieldProps {
|
|
5
|
+
content: NestableContent | undefined;
|
|
6
|
+
id: string;
|
|
7
|
+
field: Link;
|
|
8
|
+
onContentChange: (content: NestableContent | undefined) => void;
|
|
9
|
+
readOnly: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function LinkOrRepeatableLinkField(props: LinkOrRepeatableLinkFieldProps): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RepeatableContent } from "@prismicio/types-internal/lib/content";
|
|
3
|
+
import { type Link } from "@prismicio/types-internal/lib/customtypes";
|
|
4
|
+
interface RepeatableLinkFieldProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
field: Link;
|
|
7
|
+
content: RepeatableContent | undefined;
|
|
8
|
+
onContentChange: (content: RepeatableContent) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function RepeatableLinkField(props: RepeatableLinkFieldProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RepeatableLinkFieldActionsProps {
|
|
3
|
+
onDelete: () => void;
|
|
4
|
+
onMoveUp: () => void;
|
|
5
|
+
onMoveDown: () => void;
|
|
6
|
+
isDeleteEnabled: boolean;
|
|
7
|
+
isMoveUpEnabled: boolean;
|
|
8
|
+
isMoveDownEnabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function RepeatableLinkFieldActions(props: RepeatableLinkFieldActionsProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RepeatableLinkField } from "./RepeatableLinkField";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type LinkContent, type RepeatableContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import { type Link } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
interface UseRepeatableLinkFieldProps {
|
|
4
|
+
field: Link;
|
|
5
|
+
content: RepeatableContent | undefined;
|
|
6
|
+
onContentChange: (content: RepeatableContent) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useRepeatableLinkField(props: UseRepeatableLinkFieldProps): {
|
|
9
|
+
links: ({
|
|
10
|
+
key: string;
|
|
11
|
+
} & {
|
|
12
|
+
__TYPE__: "LinkContent";
|
|
13
|
+
value: ({
|
|
14
|
+
__TYPE__: "ImageLink";
|
|
15
|
+
} & ((({
|
|
16
|
+
kind: "image";
|
|
17
|
+
id: string;
|
|
18
|
+
url: string;
|
|
19
|
+
height: string;
|
|
20
|
+
width: string;
|
|
21
|
+
size: string;
|
|
22
|
+
name: string;
|
|
23
|
+
} & {
|
|
24
|
+
date?: string | null | undefined;
|
|
25
|
+
}) | {
|
|
26
|
+
kind: "image";
|
|
27
|
+
}) & {
|
|
28
|
+
text?: string | undefined;
|
|
29
|
+
})) | ({
|
|
30
|
+
__TYPE__: "FileLink";
|
|
31
|
+
} & ((({
|
|
32
|
+
kind: "file";
|
|
33
|
+
id: string;
|
|
34
|
+
url: string;
|
|
35
|
+
name: string;
|
|
36
|
+
size: string;
|
|
37
|
+
} & {
|
|
38
|
+
date?: string | null | undefined;
|
|
39
|
+
}) | {
|
|
40
|
+
kind: "file";
|
|
41
|
+
}) & {
|
|
42
|
+
text?: string | undefined;
|
|
43
|
+
})) | ({
|
|
44
|
+
__TYPE__: "DocumentLink";
|
|
45
|
+
} & (({
|
|
46
|
+
id: string;
|
|
47
|
+
} | {
|
|
48
|
+
kind: "document";
|
|
49
|
+
}) & {
|
|
50
|
+
text?: string | undefined;
|
|
51
|
+
})) | ({
|
|
52
|
+
__TYPE__: "ExternalLink";
|
|
53
|
+
} & ((({
|
|
54
|
+
url: string;
|
|
55
|
+
} & {
|
|
56
|
+
kind?: "web" | undefined;
|
|
57
|
+
target?: string | null | undefined;
|
|
58
|
+
preview?: {
|
|
59
|
+
title?: string | undefined;
|
|
60
|
+
} | null | undefined;
|
|
61
|
+
}) | {
|
|
62
|
+
kind: "web";
|
|
63
|
+
}) & {
|
|
64
|
+
text?: string | undefined;
|
|
65
|
+
})) | ({
|
|
66
|
+
__TYPE__: "MediaLink";
|
|
67
|
+
} & {
|
|
68
|
+
kind: "media";
|
|
69
|
+
} & {
|
|
70
|
+
text?: string | undefined;
|
|
71
|
+
}) | ({
|
|
72
|
+
__TYPE__: "AnyLink";
|
|
73
|
+
} & {
|
|
74
|
+
kind: "any";
|
|
75
|
+
} & {
|
|
76
|
+
text?: string | undefined;
|
|
77
|
+
});
|
|
78
|
+
})[];
|
|
79
|
+
updateLink: (linkContent: LinkContent | undefined, index: number) => void;
|
|
80
|
+
addNewLink: () => void;
|
|
81
|
+
deleteLink: (index: number) => void;
|
|
82
|
+
moveLink: (direction: "up" | "down", index: number) => void;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
@@ -2,4 +2,5 @@ export { LinkDescriptionCard } from "./LinkDescriptionCard";
|
|
|
2
2
|
export { FilledLinkField, LinkField } from "./LinkField";
|
|
3
3
|
export { LinkFieldActions } from "./LinkFieldActions";
|
|
4
4
|
export { LinkImageCard } from "./LinkImageCard";
|
|
5
|
+
export { RepeatableLinkField } from "./RepeatableLinkField";
|
|
5
6
|
export { mapMediaToLinkContent } from "./useLinkField";
|
|
@@ -10,7 +10,7 @@ interface useLinkFieldParams {
|
|
|
10
10
|
onContentChange: (content: LinkContent | undefined) => void;
|
|
11
11
|
}
|
|
12
12
|
export declare function useLinkField(params: useLinkFieldParams): {
|
|
13
|
-
contentType: "
|
|
13
|
+
contentType: "DocumentLink" | "ImageLink" | "FileLink" | "ExternalLink" | "MediaLink" | "AnyLink" | undefined;
|
|
14
14
|
selectType: "document" | "web" | "media" | "any" | undefined;
|
|
15
15
|
fieldValue: string;
|
|
16
16
|
onDisplayTextChange: (displayText: string) => void;
|
|
@@ -32,12 +32,13 @@ interface MapMediaToLinkContentArgs {
|
|
|
32
32
|
}
|
|
33
33
|
export declare function mapMediaToLinkContent(args: MapMediaToLinkContentArgs): {
|
|
34
34
|
__TYPE__: "LinkContent";
|
|
35
|
+
key: `${string}-${string}-${string}-${string}-${string}`;
|
|
35
36
|
value: {
|
|
36
37
|
__TYPE__: "ImageLink";
|
|
37
38
|
id: string;
|
|
38
39
|
name: string;
|
|
39
40
|
url: string;
|
|
40
|
-
kind:
|
|
41
|
+
kind: "image";
|
|
41
42
|
size: string;
|
|
42
43
|
height: string;
|
|
43
44
|
width: string;
|
|
@@ -45,11 +46,12 @@ export declare function mapMediaToLinkContent(args: MapMediaToLinkContentArgs):
|
|
|
45
46
|
};
|
|
46
47
|
} | {
|
|
47
48
|
__TYPE__: "LinkContent";
|
|
49
|
+
key: `${string}-${string}-${string}-${string}-${string}`;
|
|
48
50
|
value: {
|
|
49
51
|
__TYPE__: "FileLink";
|
|
50
52
|
id: string;
|
|
51
53
|
name: string;
|
|
52
|
-
kind:
|
|
54
|
+
kind: "file";
|
|
53
55
|
url: string;
|
|
54
56
|
size: string;
|
|
55
57
|
date: string;
|
|
@@ -58,6 +60,7 @@ export declare function mapMediaToLinkContent(args: MapMediaToLinkContentArgs):
|
|
|
58
60
|
};
|
|
59
61
|
} | {
|
|
60
62
|
__TYPE__: "LinkContent";
|
|
63
|
+
key: `${string}-${string}-${string}-${string}-${string}`;
|
|
61
64
|
value: {
|
|
62
65
|
__TYPE__: "ImageLink";
|
|
63
66
|
id: string;
|
|
@@ -3,7 +3,7 @@ declare const _default: {
|
|
|
3
3
|
component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
|
|
4
4
|
converter: {
|
|
5
5
|
fromPrismic(schema: Schema<any, any>): (list: {
|
|
6
|
-
type: "em" | "embed" | "strong" | "
|
|
6
|
+
type: "image" | "em" | "embed" | "strong" | "list-item" | "paragraph" | "rtl" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "o-list-item";
|
|
7
7
|
content: {
|
|
8
8
|
text: string;
|
|
9
9
|
} & {
|
|
@@ -11,7 +11,7 @@ declare const _default: {
|
|
|
11
11
|
data: ({
|
|
12
12
|
__TYPE__: "ImageLink";
|
|
13
13
|
} & {
|
|
14
|
-
kind:
|
|
14
|
+
kind: "image";
|
|
15
15
|
id: string;
|
|
16
16
|
url: string;
|
|
17
17
|
height: string;
|
|
@@ -23,7 +23,7 @@ declare const _default: {
|
|
|
23
23
|
}) | ({
|
|
24
24
|
__TYPE__: "FileLink";
|
|
25
25
|
} & {
|
|
26
|
-
kind:
|
|
26
|
+
kind: "file";
|
|
27
27
|
id: string;
|
|
28
28
|
url: string;
|
|
29
29
|
name: string;
|
|
@@ -64,7 +64,7 @@ declare const _default: {
|
|
|
64
64
|
direction?: string | undefined;
|
|
65
65
|
}) => ProsemirrorNode | undefined;
|
|
66
66
|
toPrismic(node: ProsemirrorNode, nodeType: "list-item" | "o-list-item"): readonly ({
|
|
67
|
-
type: "em" | "embed" | "strong" | "
|
|
67
|
+
type: "image" | "em" | "embed" | "strong" | "list-item" | "paragraph" | "rtl" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "o-list-item";
|
|
68
68
|
content: {
|
|
69
69
|
text: string;
|
|
70
70
|
} & {
|
|
@@ -72,7 +72,7 @@ declare const _default: {
|
|
|
72
72
|
data: ({
|
|
73
73
|
__TYPE__: "ImageLink";
|
|
74
74
|
} & {
|
|
75
|
-
kind:
|
|
75
|
+
kind: "image";
|
|
76
76
|
id: string;
|
|
77
77
|
url: string;
|
|
78
78
|
height: string;
|
|
@@ -84,7 +84,7 @@ declare const _default: {
|
|
|
84
84
|
}) | ({
|
|
85
85
|
__TYPE__: "FileLink";
|
|
86
86
|
} & {
|
|
87
|
-
kind:
|
|
87
|
+
kind: "file";
|
|
88
88
|
id: string;
|
|
89
89
|
url: string;
|
|
90
90
|
name: string;
|
|
@@ -4,7 +4,7 @@ import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
|
|
4
4
|
import { type NodeViewProps } from "@tiptap/react";
|
|
5
5
|
interface EmbedNode extends ProseMirrorNode {
|
|
6
6
|
attrs: {
|
|
7
|
-
content
|
|
7
|
+
content?: EmbedContent;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
export interface EmbedViewProps extends NodeViewProps {
|
|
@@ -8,7 +8,7 @@ export interface ImageViewProps extends NodeViewProps {
|
|
|
8
8
|
export declare function ImageView(props: ImageViewProps): JSX.Element;
|
|
9
9
|
interface ImageNode extends ProseMirrorNode {
|
|
10
10
|
attrs: {
|
|
11
|
-
content
|
|
11
|
+
content?: ImageBlockData;
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
export declare const nodeWrapperClassName = "imageViewNodeWrapper";
|
|
@@ -31,7 +31,7 @@ export interface ImageLinkData {
|
|
|
31
31
|
width: string;
|
|
32
32
|
size: string;
|
|
33
33
|
name: string;
|
|
34
|
-
kind:
|
|
34
|
+
kind: "image";
|
|
35
35
|
date?: string | null | undefined;
|
|
36
36
|
}
|
|
37
37
|
export interface FileLinkData {
|
|
@@ -39,7 +39,7 @@ export interface FileLinkData {
|
|
|
39
39
|
id: string;
|
|
40
40
|
url: string;
|
|
41
41
|
name: string;
|
|
42
|
-
kind:
|
|
42
|
+
kind: "file";
|
|
43
43
|
size: string;
|
|
44
44
|
date?: string | null | undefined;
|
|
45
45
|
}
|