@prismicio/editor-fields 0.1.0-rc.7 → 0.2.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/DocumentEditor.d.ts +2 -0
- package/dist/DocumentEditorConfig.d.ts +8 -0
- package/dist/GroupEditor.d.ts +1 -1
- package/dist/NestableWidgetSwitch.d.ts +3 -3
- package/dist/domain/Document.d.ts +1 -1
- package/dist/domain/Group.d.ts +2 -2
- package/dist/domain/NestableWidget.d.ts +11 -12
- package/dist/domain/Section.d.ts +1 -1
- package/dist/domain/StaticWidget.d.ts +3 -3
- package/dist/domain/Widget.d.ts +2 -3
- package/dist/domain/fields/ImageField/CroppedImage.d.ts +36 -0
- package/dist/domain/fields/ImageField/ExternalImage.d.ts +1 -1
- package/dist/domain/fields/ImageField/ImageField.d.ts +14 -2
- package/dist/domain/slices/LegacySlice.d.ts +0 -2
- package/dist/domain/slices/SharedSlice.d.ts +1 -1
- package/dist/domain/zones/NonRepeatableZone.d.ts +3 -3
- package/dist/domain/zones/RepeatableZone.d.ts +2 -2
- package/dist/domain/zones/SliceZone.d.ts +5 -8
- package/dist/domain/zones/StaticZone.d.ts +2 -1
- package/dist/fields/BooleanField.d.ts +1 -1
- package/dist/fields/DateField.d.ts +11 -0
- package/dist/fields/ImageField/CropperDialog.d.ts +21 -0
- package/dist/fields/ImageField/ImageField.d.ts +3 -3
- package/dist/fields/ImageField/MediaPicker/unsplashData.d.ts +2 -2
- package/dist/fields/KeyTextField.d.ts +1 -1
- package/dist/fields/LinkField/LinkField.d.ts +12 -0
- package/dist/fields/LinkField/LinkFieldActions.d.ts +7 -0
- package/dist/fields/LinkField/index.d.ts +1 -0
- package/dist/fields/NumberField.d.ts +1 -1
- package/dist/fields/RichTextField/RichTextField.d.ts +1 -1
- package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
- package/dist/fields/RichTextField/coreExtensions/Text.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/Link.d.ts +41 -2
- package/dist/fields/RichTextField/globalExtensions/TextDirection.d.ts +1 -1
- package/dist/fields/RichTextField/models/EditorExtension.d.ts +2 -2
- package/dist/fields/RichTextField/models/RichTextConfig.d.ts +1 -1
- package/dist/fields/RichTextField/models/Span.d.ts +1 -1
- package/dist/fields/SelectField.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +17059 -16192
- package/dist/index.umd.js +34 -34
- package/dist/slices/CompositeSliceEditor.d.ts +1 -1
- package/dist/slices/LegacySliceEditor.d.ts +3 -3
- package/dist/slices/SharedSliceEditor.d.ts +1 -1
- package/dist/zones/RepeatableZoneEditor.d.ts +1 -1
- package/dist/zones/SliceZoneEditor.d.ts +1 -1
- package/package.json +4 -4
- package/dist/domain/__tests__/Document.test.d.ts +0 -1
- package/dist/fields/NestableField.d.ts +0 -12
- package/dist/fields/RichTextField/MenuBar/MenuBar.d.ts +0 -9
- package/dist/fields/RichTextField/MenuBar/MenuItem.d.ts +0 -10
- package/dist/fields/RichTextField/MenuBar/index.d.ts +0 -2
- package/dist/fields/RichTextField/core-extensions/Document.d.ts +0 -3
- package/dist/fields/RichTextField/core-extensions/HardBreak.d.ts +0 -11
- package/dist/fields/RichTextField/core-extensions/ListItem.d.ts +0 -44
- package/dist/fields/RichTextField/core-extensions/Text.d.ts +0 -15
- package/dist/fields/RichTextField/core-extensions/index.d.ts +0 -95
- package/dist/fields/RichTextField/global-extensions/TextDirection.d.ts +0 -38
- package/dist/fields/RichTextField/global-extensions/index.d.ts +0 -3
- package/dist/fields/RichTextField/models/Block.d.ts +0 -5
- package/dist/fields/RichTextField/models/helpers/Arrays.d.ts +0 -1
- package/dist/fields/RichTextField/models/helpers/DOMParser.d.ts +0 -1
- package/dist/fields/RichTextField/models/helpers/Objects.d.ts +0 -3
- package/dist/fields/index.d.ts +0 -182
- package/dist/fields/nestable/BooleanField.d.ts +0 -12
- package/dist/fields/nestable/ColorField.d.ts +0 -11
- package/dist/fields/nestable/DateField.d.ts +0 -12
- package/dist/fields/nestable/Field.d.ts +0 -40
- package/dist/fields/nestable/GeoField.d.ts +0 -16
- package/dist/fields/nestable/ImageField/ImageEditor.d.ts +0 -11
- package/dist/fields/nestable/ImageField/ImageField.d.ts +0 -70
- package/dist/fields/nestable/ImageField/ImageSelector.d.ts +0 -5
- package/dist/fields/nestable/ImageField/config.d.ts +0 -1
- package/dist/fields/nestable/ImageField/models/EditImage.d.ts +0 -27
- package/dist/fields/nestable/ImageField/models/ExternalImage.d.ts +0 -32
- package/dist/fields/nestable/ImageField/models/providers/UnsplashProvider.d.ts +0 -6
- package/dist/fields/nestable/KeyTextField.d.ts +0 -12
- package/dist/fields/nestable/NumberField.d.ts +0 -14
- package/dist/fields/nestable/RangeField.d.ts +0 -14
- package/dist/fields/nestable/RichTextField/MenuBar/MenuBar.d.ts +0 -9
- package/dist/fields/nestable/RichTextField/MenuBar/MenuItem.d.ts +0 -10
- package/dist/fields/nestable/RichTextField/MenuBar/index.d.ts +0 -2
- package/dist/fields/nestable/RichTextField/RichTextField.d.ts +0 -21
- package/dist/fields/nestable/RichTextField/coreExtensions/Document.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/coreExtensions/HardBreak.d.ts +0 -12
- package/dist/fields/nestable/RichTextField/coreExtensions/ListItem.d.ts +0 -43
- package/dist/fields/nestable/RichTextField/coreExtensions/Text.d.ts +0 -15
- package/dist/fields/nestable/RichTextField/coreExtensions/index.d.ts +0 -8
- package/dist/fields/nestable/RichTextField/extensions/Bold.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/extensions/BulletList.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/extensions/CodeBlock.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/extensions/Embed/EmbedView.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/extensions/Embed/index.d.ts +0 -10
- package/dist/fields/nestable/RichTextField/extensions/Heading.d.ts +0 -18
- package/dist/fields/nestable/RichTextField/extensions/Italic.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/extensions/Link.d.ts +0 -4
- package/dist/fields/nestable/RichTextField/extensions/OrderedList.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/extensions/Paragraph.d.ts +0 -3
- package/dist/fields/nestable/RichTextField/extensions/index.d.ts +0 -14
- package/dist/fields/nestable/RichTextField/globalExtensions/TextDirection.d.ts +0 -39
- package/dist/fields/nestable/RichTextField/globalExtensions/index.d.ts +0 -1
- package/dist/fields/nestable/RichTextField/index.d.ts +0 -1
- package/dist/fields/nestable/RichTextField/models/EditorExtension.d.ts +0 -105
- package/dist/fields/nestable/RichTextField/models/RichTextConfig.d.ts +0 -10
- package/dist/fields/nestable/RichTextField/models/Span.d.ts +0 -12
- package/dist/fields/nestable/RichTextField/models/helpers/DOMParser.d.ts +0 -1
- package/dist/fields/nestable/RichTextField/models/helpers/NodeUtils.d.ts +0 -14
- package/dist/fields/nestable/RichTextField/models/helpers/index.d.ts +0 -2
- package/dist/fields/nestable/RichTextField/models/index.d.ts +0 -3
- package/dist/fields/nestable/SelectField.d.ts +0 -13
- package/dist/fields/nestable/SeparatorField.d.ts +0 -9
- package/dist/fields/nestable/TimestampField.d.ts +0 -12
- package/dist/fields/nestable/index.d.ts +0 -182
- package/dist/style.css +0 -1
- package/dist/utils/HttpClient.d.ts +0 -18
- package/dist/utils/useDebounceState.d.ts +0 -1
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { NestableField } from "../Field";
|
|
2
|
-
export declare const ImageField: NestableField<{
|
|
3
|
-
type: "Image";
|
|
4
|
-
} & {
|
|
5
|
-
fieldset?: string | null | undefined;
|
|
6
|
-
config?: {
|
|
7
|
-
label?: string | null | undefined;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
constraint?: {
|
|
10
|
-
width?: number | null;
|
|
11
|
-
height?: number | null;
|
|
12
|
-
};
|
|
13
|
-
thumbnails?: readonly ({
|
|
14
|
-
name: string;
|
|
15
|
-
} & {
|
|
16
|
-
width?: number | null;
|
|
17
|
-
height?: number | null;
|
|
18
|
-
})[];
|
|
19
|
-
};
|
|
20
|
-
}, {
|
|
21
|
-
origin: {
|
|
22
|
-
id: string;
|
|
23
|
-
url: string;
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
};
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
edit: {
|
|
30
|
-
zoom: number;
|
|
31
|
-
crop: {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
};
|
|
35
|
-
background: string;
|
|
36
|
-
};
|
|
37
|
-
} & {
|
|
38
|
-
url?: string;
|
|
39
|
-
credits?: string | null;
|
|
40
|
-
alt?: string | null;
|
|
41
|
-
provider?: string | null | undefined;
|
|
42
|
-
} & {
|
|
43
|
-
thumbnails?: {
|
|
44
|
-
[x: string]: {
|
|
45
|
-
origin: {
|
|
46
|
-
id: string;
|
|
47
|
-
url: string;
|
|
48
|
-
width: number;
|
|
49
|
-
height: number;
|
|
50
|
-
};
|
|
51
|
-
width: number;
|
|
52
|
-
height: number;
|
|
53
|
-
edit: {
|
|
54
|
-
zoom: number;
|
|
55
|
-
crop: {
|
|
56
|
-
x: number;
|
|
57
|
-
y: number;
|
|
58
|
-
};
|
|
59
|
-
background: string;
|
|
60
|
-
};
|
|
61
|
-
} & {
|
|
62
|
-
url?: string;
|
|
63
|
-
credits?: string | null;
|
|
64
|
-
alt?: string | null;
|
|
65
|
-
provider?: string | null | undefined;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
} & {
|
|
69
|
-
__TYPE__: "ImageContent";
|
|
70
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const UNSPLASH_ACCESS_KEY = "9jeGorNJiyHItxo_XyARQJyh6w2lLa2ULia67iYHQKE";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ImageContentO as ImageContent, ImageContentView } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
export interface EditImage {
|
|
3
|
-
id: string;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
url: string;
|
|
7
|
-
zoom: number;
|
|
8
|
-
crop: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
interface ImagePatch {
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
zoom: number;
|
|
17
|
-
crop: {
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare const EditImage: {
|
|
23
|
-
fromPrismicImageView(id: string, view: ImageContentView): EditImage;
|
|
24
|
-
fromPrismicImage(image: ImageContent): ReadonlyArray<EditImage>;
|
|
25
|
-
edit(image: EditImage, _update: ImagePatch): EditImage;
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ImageContentO as ImageContent, ImageContentView } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
export interface ExternalImage {
|
|
3
|
-
id: string;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
url: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const ExternalImage: {
|
|
9
|
-
asPrismicImageView(extImage: ExternalImage, viewConstraints?: {
|
|
10
|
-
width?: number | null;
|
|
11
|
-
height?: number | null;
|
|
12
|
-
} | undefined): ImageContentView;
|
|
13
|
-
asPrismicImage(extImage: ExternalImage, field?: ({
|
|
14
|
-
type: "Image";
|
|
15
|
-
} & {
|
|
16
|
-
fieldset?: string | null | undefined;
|
|
17
|
-
config?: {
|
|
18
|
-
label?: string | null | undefined;
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
constraint?: {
|
|
21
|
-
width?: number | null;
|
|
22
|
-
height?: number | null;
|
|
23
|
-
};
|
|
24
|
-
thumbnails?: readonly ({
|
|
25
|
-
name: string;
|
|
26
|
-
} & {
|
|
27
|
-
width?: number | null;
|
|
28
|
-
height?: number | null;
|
|
29
|
-
})[];
|
|
30
|
-
};
|
|
31
|
-
}) | undefined): ImageContent;
|
|
32
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FieldContent as StringContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
import { NestableField } from "./Field";
|
|
3
|
-
export declare const KeyTextField: NestableField<{
|
|
4
|
-
type: "Text";
|
|
5
|
-
} & {
|
|
6
|
-
fieldset?: string | null | undefined;
|
|
7
|
-
config?: {
|
|
8
|
-
label?: string | null | undefined;
|
|
9
|
-
useAsTitle?: boolean;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
};
|
|
12
|
-
}, StringContent>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FieldContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
import { NestableField } from "./Field";
|
|
3
|
-
export declare const NumberField: NestableField<{
|
|
4
|
-
type: "Number";
|
|
5
|
-
} & {
|
|
6
|
-
fieldset?: string | null | undefined;
|
|
7
|
-
config?: {
|
|
8
|
-
label?: string | null | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
min?: number;
|
|
11
|
-
max?: number;
|
|
12
|
-
step?: number;
|
|
13
|
-
};
|
|
14
|
-
}, FieldContent>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FieldContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
import { NestableField } from "./Field";
|
|
3
|
-
export declare const RangeField: NestableField<{
|
|
4
|
-
type: "Range";
|
|
5
|
-
} & {
|
|
6
|
-
fieldset?: string | null | undefined;
|
|
7
|
-
config?: {
|
|
8
|
-
label?: string | null | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
min?: number;
|
|
11
|
-
max?: number;
|
|
12
|
-
step?: number;
|
|
13
|
-
};
|
|
14
|
-
}, FieldContent>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./MenuBar.css";
|
|
2
|
-
import type { Editor } from "@tiptap/react";
|
|
3
|
-
import type { FC } from "react";
|
|
4
|
-
declare type MenuBarProps = Readonly<{
|
|
5
|
-
editor: Editor;
|
|
6
|
-
nodeTypes: ReadonlyArray<string>;
|
|
7
|
-
}>;
|
|
8
|
-
declare const MenuBar: FC<MenuBarProps>;
|
|
9
|
-
export default MenuBar;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./MenuItem.css";
|
|
2
|
-
import type { FC } from "react";
|
|
3
|
-
export declare type MenuItemProps = Readonly<{
|
|
4
|
-
action: () => boolean;
|
|
5
|
-
icon: string;
|
|
6
|
-
isActive?: () => boolean | undefined;
|
|
7
|
-
title: string;
|
|
8
|
-
}>;
|
|
9
|
-
declare const MenuItem: FC<MenuItemProps>;
|
|
10
|
-
export default MenuItem;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "./RichTextField.css";
|
|
2
|
-
import { StructuredTextContent as RichTextContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
3
|
-
import { NestableField } from "../Field";
|
|
4
|
-
export declare const RichTextField: NestableField<{
|
|
5
|
-
type: "StructuredText";
|
|
6
|
-
} & {
|
|
7
|
-
fieldset?: string | null | undefined;
|
|
8
|
-
config?: {
|
|
9
|
-
label?: string | null | undefined;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
useAsTitle?: boolean;
|
|
12
|
-
single?: string;
|
|
13
|
-
multi?: string;
|
|
14
|
-
imageConstraint?: {
|
|
15
|
-
width?: number | null;
|
|
16
|
-
height?: number | null;
|
|
17
|
-
};
|
|
18
|
-
labels?: readonly string[];
|
|
19
|
-
allowTargetBlank?: boolean;
|
|
20
|
-
};
|
|
21
|
-
}, RichTextContent>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
2
|
-
declare function splitTextToNodes(schema: Schema, text: string): (textToNode: (strText: string) => ProsemirrorNode) => Array<ProsemirrorNode>;
|
|
3
|
-
declare const EditorHardBreak: {
|
|
4
|
-
name: string;
|
|
5
|
-
component: import("@tiptap/core").Node<import("@tiptap/extension-hard-break").HardBreakOptions, any>;
|
|
6
|
-
converter: {
|
|
7
|
-
fromPrismic(schema: Schema): (text: string) => ProsemirrorNode | undefined;
|
|
8
|
-
toPrismic(node: ProsemirrorNode): string | undefined;
|
|
9
|
-
};
|
|
10
|
-
splitTextToNodes: typeof splitTextToNodes;
|
|
11
|
-
};
|
|
12
|
-
export default EditorHardBreak;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray";
|
|
2
|
-
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
|
|
5
|
-
converter: {
|
|
6
|
-
fromPrismic(schema: Schema<any, any>): (list: {
|
|
7
|
-
type: "paragraph" | "embed" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "rtl";
|
|
8
|
-
content: {
|
|
9
|
-
text: string;
|
|
10
|
-
} & {
|
|
11
|
-
spans?: ({
|
|
12
|
-
data?: unknown;
|
|
13
|
-
} & {
|
|
14
|
-
start: number;
|
|
15
|
-
end: number;
|
|
16
|
-
type: "paragraph" | "embed" | "list-item" | "o-list-item" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "rtl";
|
|
17
|
-
})[];
|
|
18
|
-
};
|
|
19
|
-
} & {
|
|
20
|
-
label?: string;
|
|
21
|
-
direction?: string;
|
|
22
|
-
}) => ProsemirrorNode<any> | undefined;
|
|
23
|
-
toPrismic(node: ProsemirrorNode<any>, nodeType: "list-item" | "o-list-item"): readonly ({
|
|
24
|
-
type: "paragraph" | "embed" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "rtl";
|
|
25
|
-
content: {
|
|
26
|
-
text: string;
|
|
27
|
-
} & {
|
|
28
|
-
spans?: ({
|
|
29
|
-
data?: unknown;
|
|
30
|
-
} & {
|
|
31
|
-
start: number;
|
|
32
|
-
end: number;
|
|
33
|
-
type: "paragraph" | "embed" | "list-item" | "o-list-item" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "rtl";
|
|
34
|
-
})[];
|
|
35
|
-
};
|
|
36
|
-
} & {
|
|
37
|
-
label?: string;
|
|
38
|
-
direction?: string;
|
|
39
|
-
})[];
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export default _default;
|
|
43
|
-
export declare function mergeLists(lists: ReadonlyNonEmptyArray<ProsemirrorNode>): ProsemirrorNode | undefined;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { TextBlock } from "@prismicio/types-internal/lib/documents/widgets/nestable/StructuredTextContent/Block";
|
|
3
|
-
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
4
|
-
import type { Direction } from "../globalExtensions/TextDirection";
|
|
5
|
-
declare const EditorText: {
|
|
6
|
-
name: string;
|
|
7
|
-
component: import("@tiptap/core").Node<any, any>;
|
|
8
|
-
converter: {
|
|
9
|
-
fromPrismic(schema: Schema): (extensionName: string, textBlock: TextBlock, preventHardbreaks?: boolean) => Array<ProsemirrorNode>;
|
|
10
|
-
toPrismic(node: ProsemirrorNode, nodeType: RichTextNodeType, attributes?: {
|
|
11
|
-
direction?: Direction;
|
|
12
|
-
} | undefined): TextBlock;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default EditorText;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type RichText, RichTextNodeType } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { Node } from "@tiptap/core";
|
|
3
|
-
import { default as Document } from "./Document";
|
|
4
|
-
import { default as HardBreak } from "./HardBreak";
|
|
5
|
-
import { default as ListItem } from "./ListItem";
|
|
6
|
-
import { default as Text } from "./Text";
|
|
7
|
-
export declare function CoreComponents(nodeTypes: ReadonlyArray<RichTextNodeType>, field: RichText): ReadonlyArray<Node>;
|
|
8
|
-
export { Document, HardBreak, ListItem, Text };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import { type Level as TTLevel } from "@tiptap/extension-heading";
|
|
3
|
-
import { type ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray";
|
|
4
|
-
import type { Node as ProsemirrorNode } from "prosemirror-model";
|
|
5
|
-
import { HeadingTextExtension } from "../models";
|
|
6
|
-
export declare type Level = TTLevel;
|
|
7
|
-
declare type HeadingName = {
|
|
8
|
-
fullName: RichTextNodeType;
|
|
9
|
-
level: Level;
|
|
10
|
-
};
|
|
11
|
-
export declare const HeadingName: {
|
|
12
|
-
byLevel(level: Level): RichTextNodeType;
|
|
13
|
-
default(level: Level): HeadingName;
|
|
14
|
-
fromPrismic(headingName: string, levels?: ReadonlyNonEmptyArray<Level>): HeadingName | undefined;
|
|
15
|
-
fromProsemirror(node: ProsemirrorNode, levels: ReadonlyNonEmptyArray<Level>): HeadingName | undefined;
|
|
16
|
-
};
|
|
17
|
-
declare const _default: (nodeTypes?: Set<RichTextNodeType> | undefined) => HeadingTextExtension | undefined;
|
|
18
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { WidgetExtension } from "../models";
|
|
3
|
-
import { default as Bold } from "./Bold";
|
|
4
|
-
import { default as BulletList } from "./BulletList";
|
|
5
|
-
import { default as CodeBlock } from "./CodeBlock";
|
|
6
|
-
import { default as Embed } from "./Embed";
|
|
7
|
-
import { default as Heading } from "./Heading";
|
|
8
|
-
import { default as Italic } from "./Italic";
|
|
9
|
-
import { default as OrderedList } from "./OrderedList";
|
|
10
|
-
import { default as Paragraph } from "./Paragraph";
|
|
11
|
-
export declare const DefaultExtension: import("../models").TextExtension;
|
|
12
|
-
export declare const MarkExtensions: import("../models").MarkExtension<unknown>[];
|
|
13
|
-
export declare const Extensions: (nodeTypes?: Set<RichTextNodeType> | undefined) => ReadonlyArray<WidgetExtension>;
|
|
14
|
-
export { Bold, BulletList, CodeBlock, Embed, Heading, Italic, OrderedList, Paragraph, };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { TextBlock } from "@prismicio/types-internal/lib/documents/widgets/nestable/StructuredTextContent/Block";
|
|
2
|
-
import { Extension } from "@tiptap/core";
|
|
3
|
-
import type { Node as ProsemirrorNode } from "prosemirror-model";
|
|
4
|
-
export declare enum Direction {
|
|
5
|
-
LeftToRight = "ltr",
|
|
6
|
-
RightToLeft = "rtl"
|
|
7
|
-
}
|
|
8
|
-
interface TextDirectionOptions {
|
|
9
|
-
supportedExtensionNames: ReadonlyArray<string>;
|
|
10
|
-
}
|
|
11
|
-
export declare const TEXT_DIRECTION_ATTR_NAME = "text-direction";
|
|
12
|
-
declare module "@tiptap/core" {
|
|
13
|
-
interface Commands<ReturnType> {
|
|
14
|
-
[TEXT_DIRECTION_ATTR_NAME]: {
|
|
15
|
-
setDirection: (direction: Direction) => ReturnType;
|
|
16
|
-
toggleDirection: (direction: Direction) => ReturnType;
|
|
17
|
-
/**
|
|
18
|
-
* Set the text direction attribute
|
|
19
|
-
*/
|
|
20
|
-
setRightToLeft: () => ReturnType;
|
|
21
|
-
/**
|
|
22
|
-
* Unset the text direction attribute
|
|
23
|
-
*/
|
|
24
|
-
setLeftToRight: () => ReturnType;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export declare const richTextNodeType: "rtl";
|
|
29
|
-
export declare const component: Extension<TextDirectionOptions, any>;
|
|
30
|
-
export declare const converter: {
|
|
31
|
-
parseNodeAttrsDirection(attributes: Partial<Record<string, unknown>>): Direction;
|
|
32
|
-
fromPrismic(textBlock: TextBlock): {
|
|
33
|
-
[TEXT_DIRECTION_ATTR_NAME]: Direction;
|
|
34
|
-
};
|
|
35
|
-
toPrismic(node: ProsemirrorNode): {
|
|
36
|
-
direction: Direction;
|
|
37
|
-
} | Record<string, never>;
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as TextDirection from "./TextDirection";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RichTextField } from "./RichTextField";
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { StructuredTextContent as RichTextContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
3
|
-
import type { EmbedBlock, ImageBlock, TextBlock } from "@prismicio/types-internal/lib/documents/widgets/nestable/StructuredTextContent/Block";
|
|
4
|
-
import type { Mark, Node } from "@tiptap/core";
|
|
5
|
-
import type { NonEmptyArray } from "fp-ts/NonEmptyArray";
|
|
6
|
-
import type { Mark as ProsemirrorMark, Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
7
|
-
import type { Level } from "../extensions/Heading";
|
|
8
|
-
export declare enum ExtensionType {
|
|
9
|
-
Document = "document",
|
|
10
|
-
Mark = "mark",
|
|
11
|
-
Node = "node"
|
|
12
|
-
}
|
|
13
|
-
export declare enum NodeType {
|
|
14
|
-
Text = "text",
|
|
15
|
-
Embed = "embed",
|
|
16
|
-
Image = "image"
|
|
17
|
-
}
|
|
18
|
-
export declare type Extension = WidgetExtension | DocumentExtension;
|
|
19
|
-
export declare type WidgetExtension = MarkExtension<unknown> | NodeExtension;
|
|
20
|
-
export declare class DocumentExtension {
|
|
21
|
-
readonly name: string;
|
|
22
|
-
readonly component: (multiLines: boolean) => Node;
|
|
23
|
-
readonly converter: (extensions: ReadonlyArray<NodeExtension>) => {
|
|
24
|
-
fromPrismic(schema: Schema, defaultTextConverter?: (block: TextBlock) => ProsemirrorNode | undefined): (elmt: RichTextContent) => ProsemirrorNode | undefined;
|
|
25
|
-
toPrismic(elmt: ProsemirrorNode): RichTextContent | undefined;
|
|
26
|
-
};
|
|
27
|
-
extType: ExtensionType.Document;
|
|
28
|
-
constructor(name: string, component: (multiLines: boolean) => Node, converter: (extensions: ReadonlyArray<NodeExtension>) => {
|
|
29
|
-
fromPrismic(schema: Schema, defaultTextConverter?: (block: TextBlock) => ProsemirrorNode | undefined): (elmt: RichTextContent) => ProsemirrorNode | undefined;
|
|
30
|
-
toPrismic(elmt: ProsemirrorNode): RichTextContent | undefined;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
export declare class MarkExtension<P> {
|
|
34
|
-
readonly richTextNodeTypes: NonEmptyArray<RichTextNodeType>;
|
|
35
|
-
readonly name: string;
|
|
36
|
-
readonly component: Mark;
|
|
37
|
-
readonly converter: {
|
|
38
|
-
fromPrismic(schema: Schema): (elmt: P) => ProsemirrorMark | undefined;
|
|
39
|
-
toPrismic(elmt: ProsemirrorMark): P | undefined;
|
|
40
|
-
};
|
|
41
|
-
extType: ExtensionType.Mark;
|
|
42
|
-
constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, component: Mark, converter: {
|
|
43
|
-
fromPrismic(schema: Schema): (elmt: P) => ProsemirrorMark | undefined;
|
|
44
|
-
toPrismic(elmt: ProsemirrorMark): P | undefined;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
export declare type NodeExtension = TextExtension | EmbedExtension | ImageExtension;
|
|
48
|
-
export declare class TextExtension {
|
|
49
|
-
readonly richTextNodeTypes: NonEmptyArray<RichTextNodeType>;
|
|
50
|
-
readonly name: string;
|
|
51
|
-
readonly component: Node;
|
|
52
|
-
readonly converter: {
|
|
53
|
-
fromPrismic(schema: Schema): (elmt: TextBlock) => ProsemirrorNode | undefined;
|
|
54
|
-
toPrismic(elmt: ProsemirrorNode): TextBlock | ReadonlyArray<TextBlock> | undefined;
|
|
55
|
-
};
|
|
56
|
-
extType: ExtensionType.Node;
|
|
57
|
-
nodeType: NodeType.Text;
|
|
58
|
-
constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, component: Node, converter: {
|
|
59
|
-
fromPrismic(schema: Schema): (elmt: TextBlock) => ProsemirrorNode | undefined;
|
|
60
|
-
toPrismic(elmt: ProsemirrorNode): TextBlock | ReadonlyArray<TextBlock> | undefined;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
export declare class EmbedExtension {
|
|
64
|
-
readonly richTextNodeTypes: NonEmptyArray<RichTextNodeType>;
|
|
65
|
-
readonly name: string;
|
|
66
|
-
readonly component: Node;
|
|
67
|
-
readonly converter: {
|
|
68
|
-
fromPrismic(schema: Schema): (elmt: EmbedBlock) => ProsemirrorNode | undefined;
|
|
69
|
-
toPrismic(elmt: ProsemirrorNode): EmbedBlock | undefined;
|
|
70
|
-
};
|
|
71
|
-
extType: ExtensionType;
|
|
72
|
-
nodeType: NodeType.Embed;
|
|
73
|
-
constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, component: Node, converter: {
|
|
74
|
-
fromPrismic(schema: Schema): (elmt: EmbedBlock) => ProsemirrorNode | undefined;
|
|
75
|
-
toPrismic(elmt: ProsemirrorNode): EmbedBlock | undefined;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
export declare class ImageExtension {
|
|
79
|
-
readonly richTextNodeTypes: NonEmptyArray<RichTextNodeType>;
|
|
80
|
-
readonly name: string;
|
|
81
|
-
readonly component: Node;
|
|
82
|
-
readonly converter: {
|
|
83
|
-
fromPrismic(schema: Schema): (elmt: ImageBlock) => ProsemirrorNode | undefined;
|
|
84
|
-
toPrismic(elmt: ProsemirrorNode): ImageBlock | undefined;
|
|
85
|
-
};
|
|
86
|
-
extType: ExtensionType.Node;
|
|
87
|
-
nodeType: NodeType.Image;
|
|
88
|
-
constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, component: Node, converter: {
|
|
89
|
-
fromPrismic(schema: Schema): (elmt: ImageBlock) => ProsemirrorNode | undefined;
|
|
90
|
-
toPrismic(elmt: ProsemirrorNode): ImageBlock | undefined;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
export declare class HeadingTextExtension extends TextExtension {
|
|
94
|
-
readonly levels: ReadonlyArray<Level>;
|
|
95
|
-
constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, Component: Node, levels: ReadonlyArray<Level>, Converter: {
|
|
96
|
-
fromPrismic(schema: Schema): (elmt: TextBlock) => ProsemirrorNode | undefined;
|
|
97
|
-
toPrismic(elmt: ProsemirrorNode): TextBlock | undefined;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
export declare class ListExtension extends TextExtension {
|
|
101
|
-
constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, Component: Node, Converter: {
|
|
102
|
-
fromPrismic(schema: Schema): (elmt: TextBlock) => ProsemirrorNode | undefined;
|
|
103
|
-
toPrismic(elmt: ProsemirrorNode): ReadonlyArray<TextBlock>;
|
|
104
|
-
});
|
|
105
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RichTextConfig } from "@prismicio/types-internal/lib/customtypes/widgets/nestable/RichText";
|
|
2
|
-
import type { TextBlock } from "@prismicio/types-internal/lib/documents/widgets/nestable/StructuredTextContent/Block";
|
|
3
|
-
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
4
|
-
import { type WidgetExtension } from "./EditorExtension";
|
|
5
|
-
declare type TextConverter = (text: TextBlock) => ProsemirrorNode | undefined;
|
|
6
|
-
export declare function composeExtensions(config: RichTextConfig | undefined): {
|
|
7
|
-
defaultTextConverter: ((schema: Schema<any, any>) => TextConverter) | undefined;
|
|
8
|
-
extensions: readonly WidgetExtension[];
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Span } from "@prismicio/types-internal/lib/documents/widgets/nestable/StructuredTextContent/Block";
|
|
2
|
-
export declare const SpanUtils: {
|
|
3
|
-
groupBy<K extends unknown>(spans: ReadonlyArray<Span>, f: (span: Span) => K): Map<K, readonly ({
|
|
4
|
-
data?: unknown;
|
|
5
|
-
} & {
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
type: "paragraph" | "embed" | "list-item" | "o-list-item" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "rtl";
|
|
9
|
-
})[]>;
|
|
10
|
-
sort(spans: ReadonlyArray<Span>): ReadonlyArray<Span>;
|
|
11
|
-
mergeOverlap(spans: ReadonlyArray<Span>): ReadonlyArray<Span>;
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getAttributes<T>(processor: (elmt: globalThis.Element) => T): (dom: string | globalThis.Node) => false | T;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Mark as ProsemirrorMark, Node as ProsemirrorNode } from "prosemirror-model";
|
|
2
|
-
export declare const NodeUtils: {
|
|
3
|
-
isHardBreak(node: ProsemirrorNode): boolean;
|
|
4
|
-
children: {
|
|
5
|
-
reduce<T>(node: ProsemirrorNode, f: (acc: T, child: ProsemirrorNode, index: number) => T, defaultValue: T): T;
|
|
6
|
-
map<T_1>(node: ProsemirrorNode, f: (child: ProsemirrorNode) => T_1): readonly T_1[];
|
|
7
|
-
filter(node: ProsemirrorNode, predicate: (child: ProsemirrorNode) => boolean): ReadonlyArray<ProsemirrorNode>;
|
|
8
|
-
};
|
|
9
|
-
marks: {
|
|
10
|
-
reduce<T_2>(node: ProsemirrorNode, f: (acc: T_2, child: ProsemirrorMark, index: number) => T_2, defaultValue: T_2): T_2;
|
|
11
|
-
map<T_3>(node: ProsemirrorNode, f: (mark: ProsemirrorMark) => T_3): readonly T_3[];
|
|
12
|
-
filter(node: ProsemirrorNode, predicate: (mark: ProsemirrorMark) => boolean): ReadonlyArray<ProsemirrorMark>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FieldContent as StringContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
import { NestableField } from "./Field";
|
|
3
|
-
export declare const SelectField: NestableField<{
|
|
4
|
-
type: "Select";
|
|
5
|
-
} & {
|
|
6
|
-
fieldset?: string | null | undefined;
|
|
7
|
-
config?: {
|
|
8
|
-
label?: string | null | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
default_value?: string;
|
|
11
|
-
options?: readonly string[];
|
|
12
|
-
};
|
|
13
|
-
}, StringContent>;
|