@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,5 +1,5 @@
|
|
|
1
|
+
import type { CompositeSliceContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { CompositeSlice } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
2
|
-
import type { CompositeSliceContent } from "@prismicio/types-internal/lib/documents/widgets/slices";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type CompositeSliceEditorProps = Readonly<{
|
|
5
5
|
compositeSlice: CompositeSlice;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import type { SimpleSliceContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { LegacySlice } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
2
3
|
import type { FC } from "react";
|
|
3
|
-
import { type LegacySliceContent } from "../domain/slices/LegacySlice";
|
|
4
4
|
declare type LegacySliceEditorProps = Readonly<{
|
|
5
|
-
content:
|
|
5
|
+
content: SimpleSliceContent | undefined;
|
|
6
6
|
id: string;
|
|
7
7
|
legacySlice: LegacySlice;
|
|
8
|
-
onContentChange: (content:
|
|
8
|
+
onContentChange: (content: SimpleSliceContent | undefined) => void;
|
|
9
9
|
readOnly: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const LegacySliceEditor: FC<LegacySliceEditorProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { SharedSliceContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { SharedSlice } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
2
|
-
import type { SharedSliceContent } from "@prismicio/types-internal/lib/documents/widgets/slices";
|
|
3
3
|
import { type FC } from "react";
|
|
4
4
|
declare type SharedSliceEditorProps = Readonly<{
|
|
5
5
|
content: SharedSliceContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GroupItemContent } from "@prismicio/types-internal/lib/
|
|
1
|
+
import type { GroupItemContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import { type FC } from "react";
|
|
3
3
|
import { type RepeatableZone } from "../domain/zones/RepeatableZone";
|
|
4
4
|
declare type RepeatableZoneEditorProps = Readonly<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { SlicesContent as SliceZoneContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { StaticSlices as SliceZone } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
2
|
-
import type { SlicesContent as SliceZoneContent } from "@prismicio/types-internal/lib/documents/widgets/slices";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type SliceZoneEditorProps = Readonly<{
|
|
5
5
|
content: SliceZoneContent | undefined;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@floating-ui/react-dom-interactions": "0.9.3",
|
|
4
|
-
"@prismicio/editor-support": "0.
|
|
4
|
+
"@prismicio/editor-support": "0.2.0",
|
|
5
5
|
"@prismicio/richtext": "2.1.1",
|
|
6
|
-
"@prismicio/types-internal": "1.
|
|
6
|
+
"@prismicio/types-internal": "1.5.1",
|
|
7
7
|
"@tiptap/core": "2.0.0-beta.183",
|
|
8
8
|
"@tiptap/extension-bold": "2.0.0-beta.28",
|
|
9
9
|
"@tiptap/extension-bullet-list": "2.0.0-beta.29",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"module": "./dist/index.es.js",
|
|
64
64
|
"name": "@prismicio/editor-fields",
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@prismicio/editor-ui": "0.
|
|
66
|
+
"@prismicio/editor-ui": "0.2.0",
|
|
67
67
|
"react": "18",
|
|
68
68
|
"react-dom": "18"
|
|
69
69
|
},
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"sideEffects": false,
|
|
82
82
|
"stableVersion": "0.0.0",
|
|
83
83
|
"types": "./dist/index.d.ts",
|
|
84
|
-
"version": "0.
|
|
84
|
+
"version": "0.2.0"
|
|
85
85
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { FC } from "react";
|
|
3
|
-
import type { NestableWidgetContent } from "../domain/NestableWidget";
|
|
4
|
-
declare type NestableFieldProps = Readonly<{
|
|
5
|
-
content: NestableWidgetContent | undefined;
|
|
6
|
-
id: string;
|
|
7
|
-
nestableWidget: NestableWidget;
|
|
8
|
-
onContentChange: (content: NestableWidgetContent | undefined) => void;
|
|
9
|
-
readOnly: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const NestableField: FC<NestableFieldProps>;
|
|
12
|
-
export {};
|
|
@@ -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
|
-
extensions: 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;
|
|
7
|
-
title: string;
|
|
8
|
-
}>;
|
|
9
|
-
declare const MenuItem: FC<MenuItemProps>;
|
|
10
|
-
export default MenuItem;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
2
|
-
export declare const HARD_BREAK_STR = "\n";
|
|
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
|
-
};
|
|
11
|
-
export default EditorHardBreak;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { ReadonlyNonEmptyArray } from "fp-ts/lib/ReadonlyNonEmptyArray";
|
|
3
|
-
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
4
|
-
declare const _default: {
|
|
5
|
-
Component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
|
|
6
|
-
Converter: {
|
|
7
|
-
fromPrismic(schema: Schema<any, any>): (list: {
|
|
8
|
-
type: RichTextNodeType;
|
|
9
|
-
content: {
|
|
10
|
-
text: string;
|
|
11
|
-
} & {
|
|
12
|
-
spans?: ({
|
|
13
|
-
data?: unknown;
|
|
14
|
-
} & {
|
|
15
|
-
start: number;
|
|
16
|
-
end: number;
|
|
17
|
-
type: RichTextNodeType;
|
|
18
|
-
})[];
|
|
19
|
-
};
|
|
20
|
-
} & {
|
|
21
|
-
label?: string;
|
|
22
|
-
direction?: string;
|
|
23
|
-
}) => ProsemirrorNode<any> | undefined;
|
|
24
|
-
toPrismic(node: ProsemirrorNode<any>, nodeType: RichTextNodeType.list | RichTextNodeType.orderedList): readonly ({
|
|
25
|
-
type: RichTextNodeType;
|
|
26
|
-
content: {
|
|
27
|
-
text: string;
|
|
28
|
-
} & {
|
|
29
|
-
spans?: ({
|
|
30
|
-
data?: unknown;
|
|
31
|
-
} & {
|
|
32
|
-
start: number;
|
|
33
|
-
end: number;
|
|
34
|
-
type: RichTextNodeType;
|
|
35
|
-
})[];
|
|
36
|
-
};
|
|
37
|
-
} & {
|
|
38
|
-
label?: string;
|
|
39
|
-
direction?: string;
|
|
40
|
-
})[];
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export default _default;
|
|
44
|
-
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 "../global-extensions/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,95 +0,0 @@
|
|
|
1
|
-
import D from "./Document";
|
|
2
|
-
import HB from "./HardBreak";
|
|
3
|
-
import LI from "./ListItem";
|
|
4
|
-
import T from "./Text";
|
|
5
|
-
export declare const Document: import("../models").DocumentExtension;
|
|
6
|
-
export declare const HardBreak: {
|
|
7
|
-
name: string;
|
|
8
|
-
Component: import("@tiptap/core").Node<import("@tiptap/extension-hard-break").HardBreakOptions, any>;
|
|
9
|
-
Converter: {
|
|
10
|
-
fromPrismic(schema: import("prosemirror-model").Schema<any, any>): (text: string) => import("prosemirror-model").Node<any> | undefined;
|
|
11
|
-
toPrismic(node: import("prosemirror-model").Node<any>): string | undefined;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export declare const Text: {
|
|
15
|
-
name: string;
|
|
16
|
-
Component: import("@tiptap/core").Node<any, any>;
|
|
17
|
-
Converter: {
|
|
18
|
-
fromPrismic(schema: import("prosemirror-model").Schema<any, any>): (extensionName: string, textBlock: {
|
|
19
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
20
|
-
content: {
|
|
21
|
-
text: string;
|
|
22
|
-
} & {
|
|
23
|
-
spans?: ({
|
|
24
|
-
data?: unknown;
|
|
25
|
-
} & {
|
|
26
|
-
start: number;
|
|
27
|
-
end: number;
|
|
28
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
29
|
-
})[];
|
|
30
|
-
};
|
|
31
|
-
} & {
|
|
32
|
-
label?: string;
|
|
33
|
-
direction?: string;
|
|
34
|
-
}, preventHardbreaks?: boolean) => import("prosemirror-model").Node<any>[];
|
|
35
|
-
toPrismic(node: import("prosemirror-model").Node<any>, nodeType: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType, attributes?: {
|
|
36
|
-
direction?: import("../global-extensions/TextDirection").Direction;
|
|
37
|
-
} | undefined): {
|
|
38
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
39
|
-
content: {
|
|
40
|
-
text: string;
|
|
41
|
-
} & {
|
|
42
|
-
spans?: ({
|
|
43
|
-
data?: unknown;
|
|
44
|
-
} & {
|
|
45
|
-
start: number;
|
|
46
|
-
end: number;
|
|
47
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
48
|
-
})[];
|
|
49
|
-
};
|
|
50
|
-
} & {
|
|
51
|
-
label?: string;
|
|
52
|
-
direction?: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export declare const ListItem: {
|
|
57
|
-
Component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
|
|
58
|
-
Converter: {
|
|
59
|
-
fromPrismic(schema: import("prosemirror-model").Schema<any, any>): (list: {
|
|
60
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
61
|
-
content: {
|
|
62
|
-
text: string;
|
|
63
|
-
} & {
|
|
64
|
-
spans?: ({
|
|
65
|
-
data?: unknown;
|
|
66
|
-
} & {
|
|
67
|
-
start: number;
|
|
68
|
-
end: number;
|
|
69
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
70
|
-
})[];
|
|
71
|
-
};
|
|
72
|
-
} & {
|
|
73
|
-
label?: string;
|
|
74
|
-
direction?: string;
|
|
75
|
-
}) => import("prosemirror-model").Node<any> | undefined;
|
|
76
|
-
toPrismic(node: import("prosemirror-model").Node<any>, nodeType: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType.list | import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType.orderedList): readonly ({
|
|
77
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
78
|
-
content: {
|
|
79
|
-
text: string;
|
|
80
|
-
} & {
|
|
81
|
-
spans?: ({
|
|
82
|
-
data?: unknown;
|
|
83
|
-
} & {
|
|
84
|
-
start: number;
|
|
85
|
-
end: number;
|
|
86
|
-
type: import("@prismicio/types-internal/lib/customtypes/widgets/nestable").RichTextNodeType;
|
|
87
|
-
})[];
|
|
88
|
-
};
|
|
89
|
-
} & {
|
|
90
|
-
label?: string;
|
|
91
|
-
direction?: string;
|
|
92
|
-
})[];
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
export declare type CoreExtension = typeof D | typeof HB | typeof T | typeof LI;
|
|
@@ -1,38 +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
|
-
export 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 name = "textDirection";
|
|
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
|
-
};
|
|
@@ -1,5 +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
|
-
export declare type TextBlockWithNodeType = TextBlock & {
|
|
4
|
-
type: RichTextNodeType;
|
|
5
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function filterTyped<I, O>(array: Array<I>, transformOrFilter: (elmt: I) => O | undefined): Array<O>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getAttributes<T>(processor: (elmt: globalThis.Element) => T): (dom: string | globalThis.Node) => false | T;
|
package/dist/fields/index.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
export declare const fields: (import("./nestable/Field").NestableField<{
|
|
2
|
-
type: "StructuredText";
|
|
3
|
-
} & {
|
|
4
|
-
fieldset?: string | null | undefined;
|
|
5
|
-
config?: {
|
|
6
|
-
label?: string | null | undefined;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
useAsTitle?: boolean;
|
|
9
|
-
single?: string;
|
|
10
|
-
multi?: string;
|
|
11
|
-
imageConstraint?: {
|
|
12
|
-
width?: number | null;
|
|
13
|
-
height?: number | null;
|
|
14
|
-
};
|
|
15
|
-
labels?: readonly string[];
|
|
16
|
-
allowTargetBlank?: boolean;
|
|
17
|
-
};
|
|
18
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable").StructuredTextContent> | import("./nestable/Field").NestableField<{
|
|
19
|
-
type: "Text";
|
|
20
|
-
} & {
|
|
21
|
-
fieldset?: string | null | undefined;
|
|
22
|
-
config?: {
|
|
23
|
-
label?: string | null | undefined;
|
|
24
|
-
useAsTitle?: boolean;
|
|
25
|
-
placeholder?: string;
|
|
26
|
-
};
|
|
27
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/FieldContent").default> | import("./nestable/Field").NestableField<{
|
|
28
|
-
type: "Select";
|
|
29
|
-
} & {
|
|
30
|
-
fieldset?: string | null | undefined;
|
|
31
|
-
config?: {
|
|
32
|
-
label?: string | null | undefined;
|
|
33
|
-
placeholder?: string;
|
|
34
|
-
default_value?: string;
|
|
35
|
-
options?: readonly string[];
|
|
36
|
-
};
|
|
37
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/FieldContent").default> | import("./nestable/Field").NestableField<{
|
|
38
|
-
type: "Boolean";
|
|
39
|
-
} & {
|
|
40
|
-
config?: {
|
|
41
|
-
label?: string | null | undefined;
|
|
42
|
-
default_value?: boolean;
|
|
43
|
-
placeholder_true?: string;
|
|
44
|
-
placeholder_false?: string;
|
|
45
|
-
};
|
|
46
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/BooleanContent").default> | import("./nestable/Field").NestableField<{
|
|
47
|
-
type: "Number";
|
|
48
|
-
} & {
|
|
49
|
-
fieldset?: string | null | undefined;
|
|
50
|
-
config?: {
|
|
51
|
-
label?: string | null | undefined;
|
|
52
|
-
placeholder?: string;
|
|
53
|
-
min?: number;
|
|
54
|
-
max?: number;
|
|
55
|
-
step?: number;
|
|
56
|
-
};
|
|
57
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/FieldContent").default> | import("./nestable/Field").NestableField<{
|
|
58
|
-
type: "Range";
|
|
59
|
-
} & {
|
|
60
|
-
fieldset?: string | null | undefined;
|
|
61
|
-
config?: {
|
|
62
|
-
label?: string | null | undefined;
|
|
63
|
-
placeholder?: string;
|
|
64
|
-
min?: number;
|
|
65
|
-
max?: number;
|
|
66
|
-
step?: number;
|
|
67
|
-
};
|
|
68
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/FieldContent").default> | import("./nestable/Field").NestableField<{
|
|
69
|
-
type: "Separator";
|
|
70
|
-
} & {
|
|
71
|
-
config?: {
|
|
72
|
-
label?: string | null | undefined;
|
|
73
|
-
};
|
|
74
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable").SeparatorContent> | import("./nestable/Field").NestableField<{
|
|
75
|
-
type: "Date";
|
|
76
|
-
} & {
|
|
77
|
-
fieldset?: string | null | undefined;
|
|
78
|
-
config?: {
|
|
79
|
-
label?: string | null | undefined;
|
|
80
|
-
placeholder?: string;
|
|
81
|
-
default?: string;
|
|
82
|
-
};
|
|
83
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/FieldContent").default> | import("./nestable/Field").NestableField<{
|
|
84
|
-
type: "Timestamp";
|
|
85
|
-
} & {
|
|
86
|
-
fieldset?: string | null | undefined;
|
|
87
|
-
config?: {
|
|
88
|
-
label?: string | null | undefined;
|
|
89
|
-
placeholder?: string;
|
|
90
|
-
default?: string;
|
|
91
|
-
};
|
|
92
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/FieldContent").default> | import("./nestable/Field").NestableField<{
|
|
93
|
-
type: "Color";
|
|
94
|
-
} & {
|
|
95
|
-
fieldset?: string | null | undefined;
|
|
96
|
-
config?: {
|
|
97
|
-
label?: string | null | undefined;
|
|
98
|
-
placeholder?: string;
|
|
99
|
-
};
|
|
100
|
-
}, import("@prismicio/types-internal/lib/documents/widgets/nestable/FieldContent").default> | import("./nestable/Field").NestableField<{
|
|
101
|
-
type: "GeoPoint";
|
|
102
|
-
} & {
|
|
103
|
-
fieldset?: string | null | undefined;
|
|
104
|
-
config?: {
|
|
105
|
-
label?: string | null | undefined;
|
|
106
|
-
};
|
|
107
|
-
}, {
|
|
108
|
-
position: {
|
|
109
|
-
lat: number;
|
|
110
|
-
lng: number;
|
|
111
|
-
};
|
|
112
|
-
} & {
|
|
113
|
-
__TYPE__: "GeoPointContent";
|
|
114
|
-
}> | import("./nestable/Field").NestableField<{
|
|
115
|
-
type: "Image";
|
|
116
|
-
} & {
|
|
117
|
-
fieldset?: string | null | undefined;
|
|
118
|
-
config?: {
|
|
119
|
-
label?: string | null | undefined;
|
|
120
|
-
placeholder?: string;
|
|
121
|
-
constraint?: {
|
|
122
|
-
width?: number | null;
|
|
123
|
-
height?: number | null;
|
|
124
|
-
};
|
|
125
|
-
thumbnails?: readonly ({
|
|
126
|
-
name: string;
|
|
127
|
-
} & {
|
|
128
|
-
width?: number | null;
|
|
129
|
-
height?: number | null;
|
|
130
|
-
})[];
|
|
131
|
-
};
|
|
132
|
-
}, {
|
|
133
|
-
origin: {
|
|
134
|
-
id: string;
|
|
135
|
-
url: string;
|
|
136
|
-
width: number;
|
|
137
|
-
height: number;
|
|
138
|
-
};
|
|
139
|
-
width: number;
|
|
140
|
-
height: number;
|
|
141
|
-
edit: {
|
|
142
|
-
zoom: number;
|
|
143
|
-
crop: {
|
|
144
|
-
x: number;
|
|
145
|
-
y: number;
|
|
146
|
-
};
|
|
147
|
-
background: string;
|
|
148
|
-
};
|
|
149
|
-
} & {
|
|
150
|
-
url?: string;
|
|
151
|
-
credits?: string | null;
|
|
152
|
-
alt?: string | null;
|
|
153
|
-
provider?: string | null | undefined;
|
|
154
|
-
} & {
|
|
155
|
-
thumbnails?: {
|
|
156
|
-
[x: string]: {
|
|
157
|
-
origin: {
|
|
158
|
-
id: string;
|
|
159
|
-
url: string;
|
|
160
|
-
width: number;
|
|
161
|
-
height: number;
|
|
162
|
-
};
|
|
163
|
-
width: number;
|
|
164
|
-
height: number;
|
|
165
|
-
edit: {
|
|
166
|
-
zoom: number;
|
|
167
|
-
crop: {
|
|
168
|
-
x: number;
|
|
169
|
-
y: number;
|
|
170
|
-
};
|
|
171
|
-
background: string;
|
|
172
|
-
};
|
|
173
|
-
} & {
|
|
174
|
-
url?: string;
|
|
175
|
-
credits?: string | null;
|
|
176
|
-
alt?: string | null;
|
|
177
|
-
provider?: string | null | undefined;
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
} & {
|
|
181
|
-
__TYPE__: "ImageContent";
|
|
182
|
-
}>)[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BooleanContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
import { NestableField } from "./Field";
|
|
3
|
-
export declare const BooleanField: NestableField<{
|
|
4
|
-
type: "Boolean";
|
|
5
|
-
} & {
|
|
6
|
-
config?: {
|
|
7
|
-
label?: string | null | undefined;
|
|
8
|
-
default_value?: boolean;
|
|
9
|
-
placeholder_true?: string;
|
|
10
|
-
placeholder_false?: string;
|
|
11
|
-
};
|
|
12
|
-
}, BooleanContent>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { FieldContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
import { NestableField } from "./Field";
|
|
3
|
-
export declare const ColorField: NestableField<{
|
|
4
|
-
type: "Color";
|
|
5
|
-
} & {
|
|
6
|
-
fieldset?: string | null | undefined;
|
|
7
|
-
config?: {
|
|
8
|
-
label?: string | null | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
};
|
|
11
|
-
}, FieldContent>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FieldContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
2
|
-
import { NestableField } from "./Field";
|
|
3
|
-
export declare const DateField: NestableField<{
|
|
4
|
-
type: "Date";
|
|
5
|
-
} & {
|
|
6
|
-
fieldset?: string | null | undefined;
|
|
7
|
-
config?: {
|
|
8
|
-
label?: string | null | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
default?: string;
|
|
11
|
-
};
|
|
12
|
-
}, FieldContent>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Group, UID, WidgetTypes as FieldType } from "@prismicio/types-internal/lib/customtypes/widgets";
|
|
2
|
-
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
3
|
-
import type { StaticSlices } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
4
|
-
import type { GroupContent, UIDContent, WidgetContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
5
|
-
import type { SlicesContent } from "@prismicio/types-internal/lib/documents/widgets/slices";
|
|
6
|
-
import type { Refinement } from "fp-ts/Refinement";
|
|
7
|
-
import type { FC } from "react";
|
|
8
|
-
import type { NestableWidgetContent } from "../../domain/NestableWidget";
|
|
9
|
-
export declare type NestableFieldType = Exclude<FieldType, typeof FieldType.UID | typeof FieldType.Slices | typeof FieldType.LegacySlices | typeof FieldType.Group>;
|
|
10
|
-
export declare type RootFieldType = UID | StaticSlices | Group;
|
|
11
|
-
export declare type RootContentType = UIDContent | SlicesContent | GroupContent;
|
|
12
|
-
export declare type PropsFieldComponentType<C extends WidgetContent> = Readonly<{
|
|
13
|
-
id: string;
|
|
14
|
-
onContentChange: (content: C | undefined) => void;
|
|
15
|
-
readOnly: boolean;
|
|
16
|
-
}>;
|
|
17
|
-
export declare type ComponentType<F extends RootFieldType | NestableWidget, C extends WidgetContent> = Readonly<{
|
|
18
|
-
field: F;
|
|
19
|
-
content: C | undefined;
|
|
20
|
-
}> & PropsFieldComponentType<C>;
|
|
21
|
-
export declare enum FieldKind {
|
|
22
|
-
Nestable = "nestable",
|
|
23
|
-
Root = "root"
|
|
24
|
-
}
|
|
25
|
-
export declare class RootField<F extends RootFieldType, C extends RootContentType> {
|
|
26
|
-
readonly type: RootFieldType;
|
|
27
|
-
readonly contentTypeGuard: Refinement<RootContentType, C>;
|
|
28
|
-
readonly component: FC<ComponentType<F, C>>;
|
|
29
|
-
fieldKind: FieldKind.Root;
|
|
30
|
-
constructor(type: RootFieldType, contentTypeGuard: Refinement<RootContentType, C>, component: FC<ComponentType<F, C>>);
|
|
31
|
-
}
|
|
32
|
-
export declare class NestableField<F extends NestableWidget, C extends NestableWidgetContent> {
|
|
33
|
-
readonly type: NestableFieldType;
|
|
34
|
-
readonly fieldTypeGuard: Refinement<NestableWidget, F>;
|
|
35
|
-
readonly contentTypeGuard: Refinement<NestableWidgetContent, C>;
|
|
36
|
-
readonly Component: FC<ComponentType<F, C>>;
|
|
37
|
-
fieldKind: FieldKind.Nestable;
|
|
38
|
-
render: (field: NestableWidget, content: NestableWidgetContent | undefined, props: PropsFieldComponentType<C>) => JSX.Element | null;
|
|
39
|
-
constructor(type: NestableFieldType, fieldTypeGuard: Refinement<NestableWidget, F>, contentTypeGuard: Refinement<NestableWidgetContent, C>, Component: FC<ComponentType<F, C>>);
|
|
40
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NestableField } from "./Field";
|
|
2
|
-
export declare const GeoPointField: NestableField<{
|
|
3
|
-
type: "GeoPoint";
|
|
4
|
-
} & {
|
|
5
|
-
fieldset?: string | null | undefined;
|
|
6
|
-
config?: {
|
|
7
|
-
label?: string | null | undefined;
|
|
8
|
-
};
|
|
9
|
-
}, {
|
|
10
|
-
position: {
|
|
11
|
-
lat: number;
|
|
12
|
-
lng: number;
|
|
13
|
-
};
|
|
14
|
-
} & {
|
|
15
|
-
__TYPE__: "GeoPointContent";
|
|
16
|
-
}>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Image } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { ImageContentO as ImageContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
3
|
-
import type { FC } from "react";
|
|
4
|
-
declare type ImageEditorProps = Readonly<{
|
|
5
|
-
field: Image;
|
|
6
|
-
content: ImageContent;
|
|
7
|
-
activeView: string;
|
|
8
|
-
onChange: (edited: ImageContent) => void;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const ImageEditor: FC<ImageEditorProps>;
|
|
11
|
-
export {};
|