@prismicio/editor-fields 0.1.0 → 0.2.1
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 +2 -2
- package/dist/NestableWidgetSwitch.d.ts +3 -3
- package/dist/domain/Document.d.ts +1 -1
- package/dist/domain/Field.d.ts +3 -3
- package/dist/domain/Group.d.ts +3 -3
- package/dist/domain/NestableWidget.d.ts +11 -12
- package/dist/domain/Section.d.ts +1 -1
- package/dist/domain/StaticWidget.d.ts +0 -4
- package/dist/domain/Widget.d.ts +1 -3
- package/dist/domain/fields/ImageField/CroppedImage.d.ts +2 -2
- package/dist/domain/fields/ImageField/ExternalImage.d.ts +1 -1
- package/dist/domain/fields/ImageField/ImageField.d.ts +1 -1
- 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 +2 -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 +1 -1
- package/dist/fields/ImageField/ImageField.d.ts +3 -3
- package/dist/fields/KeyTextField.d.ts +5 -5
- 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 +2 -2
- 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 +2 -2
- package/dist/fields/RichTextField/extensions/Link.d.ts +42 -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 +2 -2
- package/dist/fields/SelectField.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +30500 -27697
- package/dist/index.umd.js +39 -39
- package/dist/slices/CompositeSliceEditor.d.ts +1 -1
- package/dist/slices/LegacySliceEditor.d.ts +4 -4
- 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 +26 -29
package/dist/DocumentEditor.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CustomType as DynamicCustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
2
2
|
import { type FC } from "react";
|
|
3
|
+
import { DocumentEditorConfig } from "./DocumentEditorConfig";
|
|
3
4
|
import { type DocumentContent } from "./domain/Document";
|
|
4
5
|
import { type SharedSlices } from "./domain/SharedSlices";
|
|
5
6
|
declare type DocumentEditorProps = Readonly<{
|
|
@@ -9,6 +10,7 @@ declare type DocumentEditorProps = Readonly<{
|
|
|
9
10
|
readOnly?: boolean;
|
|
10
11
|
sectionName: string | undefined;
|
|
11
12
|
sharedSlices: SharedSlices;
|
|
13
|
+
config?: DocumentEditorConfig;
|
|
12
14
|
}>;
|
|
13
15
|
export declare const DocumentEditor: FC<DocumentEditorProps>;
|
|
14
16
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface DocumentEditorConfig {
|
|
2
|
+
unsplash: {
|
|
3
|
+
url: string;
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
export declare const defaultEditorConfig: DocumentEditorConfig;
|
|
7
|
+
export declare const EditorConfigContext: import("react").Context<DocumentEditorConfig>;
|
|
8
|
+
export declare function useEditorConfig(): DocumentEditorConfig;
|
package/dist/GroupEditor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { GroupContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Group } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type GroupEditorProps = Readonly<{
|
|
5
5
|
content: GroupContent | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { NestableContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
3
|
import type { FC } from "react";
|
|
3
|
-
import { type NestableWidgetContent } from "./domain/NestableWidget";
|
|
4
4
|
declare type NestableWidgetSwitchProps = Readonly<{
|
|
5
|
-
content:
|
|
5
|
+
content: NestableContent | undefined;
|
|
6
6
|
id: string;
|
|
7
7
|
nestableWidget: NestableWidget;
|
|
8
|
-
onContentChange: (content:
|
|
8
|
+
onContentChange: (content: NestableContent | undefined) => void;
|
|
9
9
|
readOnly: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const NestableWidgetSwitch: FC<NestableWidgetSwitchProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { WidgetContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { StaticCustomType as CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
2
3
|
import type { StaticSection as Section } from "@prismicio/types-internal/lib/customtypes/Section";
|
|
3
|
-
import type { WidgetContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
4
4
|
import type { SectionContent } from "./Section";
|
|
5
5
|
export declare type DocumentContent = Readonly<Partial<Record<string, WidgetContent>>>;
|
|
6
6
|
export declare function isEmptyCustomType(customType: CustomType): boolean;
|
package/dist/domain/Field.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BooleanField
|
|
1
|
+
import type { BooleanField, NestableWidget, Separator } from "@prismicio/types-internal/lib/customtypes";
|
|
2
2
|
declare type Field = Exclude<NestableWidget, Separator>;
|
|
3
3
|
export declare function getFieldLabel(field: Field | Separator): string;
|
|
4
|
-
export declare function getFieldPlaceholder(field: Exclude<Field,
|
|
5
|
-
export declare function getFieldPlaceholder(field:
|
|
4
|
+
export declare function getFieldPlaceholder(field: Exclude<Field, BooleanField>): string;
|
|
5
|
+
export declare function getFieldPlaceholder(field: BooleanField, value: boolean): string;
|
|
6
6
|
export {};
|
package/dist/domain/Group.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { GroupContent, GroupItemContent, NestableContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Group } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { RepeatableZone } from "./zones/RepeatableZone";
|
|
4
4
|
export declare function getGroupLabel(group: Group): string;
|
|
5
5
|
export declare function getRepeatableZone(group: Group): RepeatableZone;
|
|
6
6
|
export declare function updateRepeatableZoneContent(groupContent: GroupContent | undefined, repeatableZoneContent: GroupItemContent[]): GroupContent;
|
|
7
|
-
export declare const createGroupItemContent: (value?: [string,
|
|
7
|
+
export declare const createGroupItemContent: (value?: [string, NestableContent][]) => GroupItemContent;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export declare
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function isTimestampContent(nestableWidgetContent: NestableWidgetContent): nestableWidgetContent is StringContent;
|
|
1
|
+
import type { FieldContent, GeoPointContent, ImageContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import { type NestableContent } from "@prismicio/types-internal/lib/content";
|
|
3
|
+
export declare function isColorContent(nestableWidgetContent: NestableContent): nestableWidgetContent is FieldContent;
|
|
4
|
+
export declare function isDateContent(nestableWidgetContent: NestableContent): nestableWidgetContent is FieldContent;
|
|
5
|
+
export declare function isGeoPointContent(nestableWidgetContent: NestableContent): nestableWidgetContent is GeoPointContent;
|
|
6
|
+
export declare function isImageContent(nestableWidgetContent: NestableContent): nestableWidgetContent is ImageContent;
|
|
7
|
+
export declare function isKeyTextContent(nestableWidgetContent: NestableContent): nestableWidgetContent is FieldContent;
|
|
8
|
+
export declare function isNumberContent(nestableWidgetContent: NestableContent): nestableWidgetContent is FieldContent;
|
|
9
|
+
export declare function isRangeContent(nestableWidgetContent: NestableContent): nestableWidgetContent is FieldContent;
|
|
10
|
+
export declare function isSelectContent(nestableWidgetContent: NestableContent): nestableWidgetContent is FieldContent;
|
|
11
|
+
export declare function isTimestampContent(nestableWidgetContent: NestableContent): nestableWidgetContent is FieldContent;
|
package/dist/domain/Section.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type WidgetContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { StaticSection as Section } from "@prismicio/types-internal/lib/customtypes/Section";
|
|
2
3
|
import type { StaticSlices as SliceZone } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
3
|
-
import { type WidgetContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
4
4
|
import type { StaticZone, StaticZoneContent } from "./zones/StaticZone";
|
|
5
5
|
export declare type SectionContent = Readonly<Partial<Record<string, WidgetContent>>>;
|
|
6
6
|
export declare type PartitionedSection = readonly [StaticZone, SliceZones];
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { StaticSlices as SliceZone } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
2
2
|
import type { StaticWidget as Widget } from "@prismicio/types-internal/lib/customtypes/widgets/Widget";
|
|
3
|
-
import { type GroupContent, type StaticWidgetContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
4
|
-
import type { NestableWidgetContent } from "./NestableWidget";
|
|
5
3
|
export declare type StaticWidget = Exclude<Widget, SliceZone>;
|
|
6
|
-
export declare function isGroupContent(staticWidgetContent: StaticWidgetContent): staticWidgetContent is GroupContent;
|
|
7
|
-
export declare function isNestableWidgetContent(staticWidgetContent: StaticWidgetContent): staticWidgetContent is NestableWidgetContent;
|
package/dist/domain/Widget.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import type { WidgetContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { StaticSlices as SliceZone } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
2
3
|
import type { StaticWidget as Widget } from "@prismicio/types-internal/lib/customtypes/widgets/Widget";
|
|
3
|
-
import { type WidgetContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
4
|
-
import type { SlicesContent as SliceZoneContent } from "@prismicio/types-internal/lib/documents/widgets/slices";
|
|
5
4
|
import type { Refinement } from "fp-ts/Refinement";
|
|
6
5
|
export declare function isSliceZone(widget: Widget): widget is SliceZone;
|
|
7
|
-
export declare function isSliceZoneContent(widgetContent: WidgetContent): widgetContent is SliceZoneContent;
|
|
8
6
|
export declare type Widgets<T> = T extends Record<string, infer V> ? readonly (readonly [string, NonNullable<V>])[] : never;
|
|
9
7
|
export declare function getWidgets<V extends Widget>(record: Readonly<Partial<Record<string, V>>>): Widgets<Readonly<Partial<Record<string, V>>>>;
|
|
10
8
|
export declare function refineWidgetContent<A extends WidgetContent, B extends A>(widgetContent: A | undefined, refinement: Refinement<A, B>): B | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ImageContent, ImageContentView } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Image } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import { type Thumbnail } from "./ImageField";
|
|
4
4
|
export interface Point {
|
|
5
5
|
x: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { Image } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
3
|
import type { ImageConstraint } from "@prismicio/types-internal/lib/customtypes/widgets/shared";
|
|
3
|
-
import type { ImageContentO as ImageContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
4
4
|
export interface ExternalImage {
|
|
5
5
|
id: string;
|
|
6
6
|
url: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ImageContent, ImageContentView } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { Image } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
3
|
import type { ImageConstraint } from "@prismicio/types-internal/lib/customtypes/widgets/shared";
|
|
3
|
-
import type { ImageContentO as ImageContent, ImageContentView } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
4
4
|
export declare type Thumbnail = Readonly<ImageConstraint & {
|
|
5
5
|
name: string;
|
|
6
6
|
}>;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import type { LegacySlice } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
2
|
-
import type { NonEmptyStaticWidgetContent, UIDContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
3
|
-
export declare type LegacySliceContent = Exclude<NonEmptyStaticWidgetContent, UIDContent>;
|
|
4
2
|
export declare function getLegacySliceLegend(legacySlice: LegacySlice): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { SharedSliceContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { SharedSlice, Variation } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
2
|
-
import type { SharedSliceContent } from "@prismicio/types-internal/lib/documents/widgets/slices";
|
|
3
3
|
import type { NonRepeatableZone } from "../zones/NonRepeatableZone";
|
|
4
4
|
import type { RepeatableZone } from "../zones/RepeatableZone";
|
|
5
5
|
export declare function defaultSharedSliceContent(variationId: string): SharedSliceContent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { NestableContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { SimpleWidgetContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
3
3
|
export declare type NonRepeatableZone = Readonly<Partial<Record<string, NestableWidget>>>;
|
|
4
|
-
export declare type NonRepeatableZoneContent = Readonly<Record<string,
|
|
5
|
-
export declare function updateNonRepeatableWidgetContent(nonRepeatableZoneContent: NonRepeatableZoneContent, nonRepeatableWidgetId: string, nonRepeatableWidgetContent:
|
|
4
|
+
export declare type NonRepeatableZoneContent = Readonly<Record<string, NestableContent>>;
|
|
5
|
+
export declare function updateNonRepeatableWidgetContent(nonRepeatableZoneContent: NonRepeatableZoneContent, nonRepeatableWidgetId: string, nonRepeatableWidgetContent: NestableContent | undefined): NonRepeatableZoneContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { GroupItemContent, NestableContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { GroupItemContent, SimpleWidgetContent } from "@prismicio/types-internal/lib/documents/widgets";
|
|
3
3
|
export declare type RepeatableZone = Readonly<Partial<Record<string, NestableWidget>>>;
|
|
4
4
|
export declare function defaultRepeatableZoneContentIfUndefined(repeatableZoneContent: GroupItemContent[] | undefined): GroupItemContent[];
|
|
5
5
|
export declare function updateRepeatableZone(repeatableZoneContent: GroupItemContent[], updatedItemWithIndex: [number, GroupItemContent | undefined]): GroupItemContent[];
|
|
6
|
-
export declare function updateRepeatableZoneItem(repeatableItemContent: GroupItemContent, updatedWidgetWithId: [string,
|
|
6
|
+
export declare function updateRepeatableZoneItem(repeatableItemContent: GroupItemContent, updatedWidgetWithId: [string, NestableContent | undefined]): GroupItemContent;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import type { LegacySliceContent } from "../slices/LegacySlice";
|
|
4
|
-
export declare function isSharedSliceContent(sliceContent: SliceContent): sliceContent is SharedSliceContent;
|
|
5
|
-
export declare function isCompositeSliceContent(sliceContent: SliceContent): sliceContent is CompositeSliceContent;
|
|
6
|
-
export declare function isLegacySliceContent(sliceContent: SliceContent): sliceContent is LegacySliceContent;
|
|
7
|
-
export declare function isEmptyContent(sliceContent: SliceContent): sliceContent is EmptyContent;
|
|
8
|
-
export declare function updateSliceContent(sliceZoneContent: SliceZoneContent, sliceZoneItemContentIndex: number, sliceContent: SliceContent | undefined): SliceZoneContent;
|
|
1
|
+
import type { CompositeSliceContent, SharedSliceContent, SimpleSliceContent, SlicesContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
export declare function updateSliceContent(sliceZoneContent: SlicesContent, sliceZoneItemContentIndex: number, sliceContent: SharedSliceContent | CompositeSliceContent | SimpleSliceContent | undefined): SlicesContent;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GroupContent, NestableContent, UIDContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { StaticWidget } from "../StaticWidget";
|
|
3
|
+
export declare type StaticWidgetContent = UIDContent | GroupContent | NestableContent;
|
|
3
4
|
export declare type StaticZone = Readonly<Partial<Record<string, StaticWidget>>>;
|
|
4
5
|
export declare type StaticZoneContent = Readonly<Partial<Record<string, StaticWidgetContent>>>;
|
|
5
6
|
export declare function getStaticZoneLegend(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { BooleanContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { BooleanField as BooleanT } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { BooleanContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type BooleanFieldProps = Readonly<{
|
|
5
5
|
content: BooleanContent | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DateContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Date as DateT } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
declare type Props = Readonly<{
|
|
4
|
+
content?: DateContent;
|
|
5
|
+
field: DateT;
|
|
6
|
+
id: string;
|
|
7
|
+
onContentChange: (content?: DateContent) => void;
|
|
8
|
+
readOnly: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const DateField: ({ content, field, id, onContentChange, readOnly }: Props) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ImageContentView } from "@prismicio/types-internal/lib/
|
|
1
|
+
import type { ImageContentView } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { type CroppedImage } from "../../domain/fields/ImageField/CroppedImage";
|
|
4
4
|
import type { getImageLabel, Thumbnail } from "../../domain/fields/ImageField/ImageField";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
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
3
|
import { type FC } from "react";
|
|
4
|
-
|
|
4
|
+
interface ImageFieldProps {
|
|
5
5
|
content: ImageContent | undefined;
|
|
6
6
|
field: Image;
|
|
7
7
|
id: string;
|
|
8
8
|
onContentChange: (content: ImageContent | undefined) => void;
|
|
9
9
|
readOnly: boolean;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
export declare const ImageField: FC<ImageFieldProps>;
|
|
12
12
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { TextContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Text } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type KeyTextFieldProps = Readonly<{
|
|
5
|
-
content:
|
|
6
|
-
field:
|
|
5
|
+
content: TextContent | undefined;
|
|
6
|
+
field: Text;
|
|
7
7
|
id: string;
|
|
8
|
-
onContentChange: (content:
|
|
8
|
+
onContentChange: (content: TextContent | undefined) => void;
|
|
9
9
|
readOnly: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const KeyTextField: FC<KeyTextFieldProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LinkContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Link } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
declare type LinkFieldProps = Readonly<{
|
|
5
|
+
content: LinkContent | undefined;
|
|
6
|
+
field: Link;
|
|
7
|
+
id: string;
|
|
8
|
+
readOnly: boolean;
|
|
9
|
+
onContentChange: (content: LinkContent | undefined) => void;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const LinkField: FC<LinkFieldProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LinkField } from "./LinkField";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { NumberContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Number as NumberT } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type NumberFieldProps = Readonly<{
|
|
5
5
|
content: NumberContent | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { RichTextContent } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
import type { RichText } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import type { StructuredTextContent as RichTextContent } from "@prismicio/types-internal/lib/documents/widgets/nestable";
|
|
3
3
|
import { type FC } from "react";
|
|
4
4
|
declare type RichTextFieldProps = Readonly<{
|
|
5
5
|
content: RichTextContent | undefined;
|
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
|
|
5
5
|
converter: {
|
|
6
6
|
fromPrismic(schema: Schema<any, any>): (list: {
|
|
7
|
-
type: "
|
|
7
|
+
type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
|
|
8
8
|
content: {
|
|
9
9
|
text: string;
|
|
10
10
|
} & {
|
|
@@ -13,7 +13,7 @@ declare const _default: {
|
|
|
13
13
|
} & {
|
|
14
14
|
start: number;
|
|
15
15
|
end: number;
|
|
16
|
-
type: "label" | "
|
|
16
|
+
type: "label" | "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
|
|
17
17
|
})[] | undefined;
|
|
18
18
|
};
|
|
19
19
|
} & {
|
|
@@ -21,7 +21,7 @@ declare const _default: {
|
|
|
21
21
|
direction?: string | undefined;
|
|
22
22
|
}) => ProsemirrorNode | undefined;
|
|
23
23
|
toPrismic(node: ProsemirrorNode, nodeType: "list-item" | "o-list-item"): readonly ({
|
|
24
|
-
type: "
|
|
24
|
+
type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
|
|
25
25
|
content: {
|
|
26
26
|
text: string;
|
|
27
27
|
} & {
|
|
@@ -30,7 +30,7 @@ declare const _default: {
|
|
|
30
30
|
} & {
|
|
31
31
|
start: number;
|
|
32
32
|
end: number;
|
|
33
|
-
type: "label" | "
|
|
33
|
+
type: "label" | "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
|
|
34
34
|
})[] | undefined;
|
|
35
35
|
};
|
|
36
36
|
} & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { TextBlock } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
4
4
|
import type { Direction } from "../globalExtensions/TextDirection";
|
|
5
5
|
declare const EditorText: {
|
|
@@ -1,4 +1,44 @@
|
|
|
1
|
-
import { LinkContent } from "@prismicio/types-internal/lib/documents/widgets/nestable/Link";
|
|
2
1
|
import { MarkExtension } from "../models";
|
|
3
|
-
declare const EditorLink: MarkExtension<
|
|
2
|
+
declare const EditorLink: MarkExtension<{
|
|
3
|
+
__TYPE__: "LinkContent";
|
|
4
|
+
value: ({
|
|
5
|
+
__TYPE__: "ImageLink";
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
url: string;
|
|
9
|
+
height: string;
|
|
10
|
+
width: string;
|
|
11
|
+
size: string;
|
|
12
|
+
name: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
} & {
|
|
15
|
+
date?: string | null | undefined;
|
|
16
|
+
}) | ({
|
|
17
|
+
id: string;
|
|
18
|
+
url: string;
|
|
19
|
+
name: string;
|
|
20
|
+
kind: string;
|
|
21
|
+
} & {
|
|
22
|
+
date?: string | null | undefined;
|
|
23
|
+
size?: string | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
__TYPE__: "FileLink";
|
|
26
|
+
} & {
|
|
27
|
+
size?: string | undefined;
|
|
28
|
+
}) | ({
|
|
29
|
+
__TYPE__: "DocumentLink";
|
|
30
|
+
} & {
|
|
31
|
+
id: string;
|
|
32
|
+
}) | ({
|
|
33
|
+
__TYPE__: "ExternalLink";
|
|
34
|
+
} & {
|
|
35
|
+
url: string;
|
|
36
|
+
} & {
|
|
37
|
+
kind?: "web" | undefined;
|
|
38
|
+
target?: string | null | undefined;
|
|
39
|
+
preview?: {
|
|
40
|
+
title?: string | undefined;
|
|
41
|
+
} | null | undefined;
|
|
42
|
+
});
|
|
43
|
+
}>;
|
|
4
44
|
export default EditorLink;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TextBlock } from "@prismicio/types-internal/lib/
|
|
1
|
+
import type { TextBlock } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import { Extension } from "@tiptap/core";
|
|
3
3
|
import type { Node as ProsemirrorNode } from "prosemirror-model";
|
|
4
4
|
export declare enum Direction {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { RichTextContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { EmbedBlock, ImageBlock, TextBlock } from "@prismicio/types-internal/lib/content";
|
|
1
3
|
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
4
|
import type { Mark, Node } from "@tiptap/core";
|
|
5
5
|
import type { NonEmptyArray } from "fp-ts/NonEmptyArray";
|
|
6
6
|
import type { ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { TextBlock } from "@prismicio/types-internal/lib/content";
|
|
1
2
|
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
3
|
import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
|
|
4
4
|
import { type WidgetExtension } from "./EditorExtension";
|
|
5
5
|
declare type TextConverter = (text: TextBlock) => ProsemirrorNode | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Span } from "@prismicio/types-internal/lib/
|
|
1
|
+
import type { Span } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
export declare const SpanUtils: {
|
|
3
3
|
groupBy<K extends unknown>(spans: readonly Span[], f: (span: Span) => K): Map<K, readonly ({
|
|
4
4
|
data?: unknown;
|
|
5
5
|
} & {
|
|
6
6
|
start: number;
|
|
7
7
|
end: number;
|
|
8
|
-
type: "label" | "
|
|
8
|
+
type: "label" | "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
|
|
9
9
|
})[]>;
|
|
10
10
|
sort(spans: readonly Span[]): readonly Span[];
|
|
11
11
|
mergeOverlap(spans: readonly Span[]): readonly Span[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { SelectContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Select as SelectT } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type SelectFieldProps = Readonly<{
|
|
5
5
|
content: SelectContent | undefined;
|
package/dist/index.d.ts
CHANGED