@prismicio/editor-fields 0.2.0 → 0.3.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 +6 -6
- package/dist/GroupEditor.d.ts +2 -1
- package/dist/NestableWidgetSwitch.d.ts +1 -1
- package/dist/SectionEditor.d.ts +5 -5
- package/dist/fields/BooleanField.d.ts +1 -1
- package/dist/fields/DateField.d.ts +4 -4
- package/dist/{domain/fields/ImageField/CroppedImage.d.ts → fields/ImageField/CroppedDialog/croppedImage.d.ts} +3 -3
- package/dist/fields/ImageField/{CropperDialog.d.ts → CroppedDialog/index.d.ts} +3 -3
- package/dist/{domain/fields/ImageField/ExternalImage.d.ts → fields/ImageField/MediaPicker/externalImage.d.ts} +1 -2
- package/dist/fields/ImageField/MediaPicker/index.d.ts +8 -1
- package/dist/{domain/fields/ImageField/ImageField.d.ts → fields/ImageField/imageField.d.ts} +1 -2
- package/dist/fields/ImageField/index.d.ts +12 -1
- package/dist/fields/KeyTextField.d.ts +5 -5
- package/dist/fields/LinkField/index.d.ts +12 -1
- 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/Placeholder.d.ts +1 -1
- package/dist/fields/RichTextField/coreExtensions/Text.d.ts +1 -1
- package/dist/fields/RichTextField/coreExtensions/index.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/Heading.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/Link.d.ts +3 -2
- package/dist/fields/RichTextField/extensions/index.d.ts +1 -1
- package/dist/fields/RichTextField/globalExtensions/TextDirection.d.ts +1 -1
- package/dist/fields/RichTextField/models/EditorExtension.d.ts +2 -3
- package/dist/fields/RichTextField/models/MenuItems.d.ts +1 -1
- 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/fields/utils.d.ts +6 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +30784 -28598
- package/dist/index.umd.js +39 -39
- package/dist/slices/CompositeSliceEditor.d.ts +3 -3
- package/dist/slices/LegacySliceEditor.d.ts +4 -4
- package/dist/slices/SharedSliceEditor.d.ts +1 -1
- package/dist/zones/NonRepeatableZoneEditor.d.ts +6 -4
- package/dist/zones/RepeatableZoneEditor.d.ts +4 -4
- package/dist/zones/SliceZoneEditor.d.ts +5 -5
- package/dist/zones/StaticZone.d.ts +4 -0
- package/dist/zones/StaticZoneEditor.d.ts +3 -3
- package/package.json +26 -29
- package/dist/domain/Document.d.ts +0 -8
- package/dist/domain/Field.d.ts +0 -6
- package/dist/domain/Group.d.ts +0 -7
- package/dist/domain/NestableWidget.d.ts +0 -11
- package/dist/domain/Section.d.ts +0 -10
- package/dist/domain/SharedSlices.d.ts +0 -3
- package/dist/domain/StaticWidget.d.ts +0 -7
- package/dist/domain/Widget.d.ts +0 -9
- package/dist/domain/slices/CompositeSlice.d.ts +0 -6
- package/dist/domain/slices/LegacySlice.d.ts +0 -2
- package/dist/domain/slices/SharedSlice.d.ts +0 -9
- package/dist/domain/zones/NonRepeatableZone.d.ts +0 -5
- package/dist/domain/zones/RepeatableZone.d.ts +0 -6
- package/dist/domain/zones/SliceZone.d.ts +0 -5
- package/dist/domain/zones/StaticZone.d.ts +0 -6
- package/dist/fields/ImageField/ImageField.d.ts +0 -12
- package/dist/fields/ImageField/MediaPicker/MediaPicker.d.ts +0 -8
- package/dist/fields/LinkField/LinkField.d.ts +0 -12
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CompositeSliceContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { CompositeSlice } from "@prismicio/types-internal/lib/customtypes
|
|
2
|
+
import type { CompositeSlice } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type CompositeSliceEditorProps = Readonly<{
|
|
5
|
+
id: string;
|
|
6
|
+
readOnly: boolean;
|
|
5
7
|
compositeSlice: CompositeSlice;
|
|
6
8
|
content: CompositeSliceContent;
|
|
7
|
-
id: string;
|
|
8
9
|
onContentChange: (content: CompositeSliceContent) => void;
|
|
9
|
-
readOnly: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const CompositeSliceEditor: FC<CompositeSliceEditorProps>;
|
|
12
12
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { LegacySlice } from "@prismicio/types-internal/lib/customtypes
|
|
1
|
+
import { type SimpleSliceContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { LegacySlice } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type LegacySliceEditorProps = Readonly<{
|
|
5
|
-
content: SimpleSliceContent
|
|
5
|
+
content: SimpleSliceContent;
|
|
6
6
|
id: string;
|
|
7
7
|
legacySlice: LegacySlice;
|
|
8
|
-
onContentChange: (content: SimpleSliceContent
|
|
8
|
+
onContentChange: (content: SimpleSliceContent) => void;
|
|
9
9
|
readOnly: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const LegacySliceEditor: FC<LegacySliceEditorProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SharedSliceContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { SharedSlice } from "@prismicio/types-internal/lib/customtypes
|
|
2
|
+
import type { SharedSlice } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import { type FC } from "react";
|
|
4
4
|
declare type SharedSliceEditorProps = Readonly<{
|
|
5
5
|
content: SharedSliceContent;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { type NestableContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes";
|
|
1
3
|
import { type FC } from "react";
|
|
2
|
-
|
|
4
|
+
declare type NonRepeatableZoneContent = Readonly<Record<string, NestableContent>>;
|
|
3
5
|
declare type NonRepeatableZoneEditorProps = Readonly<{
|
|
4
|
-
content: NonRepeatableZoneContent;
|
|
5
6
|
id: string;
|
|
6
|
-
nonRepeatableZone: NonRepeatableZone;
|
|
7
|
-
onContentChange: (content: NonRepeatableZoneContent) => void;
|
|
8
7
|
readOnly: boolean;
|
|
8
|
+
nonRepeatableZone: Readonly<Record<string, NestableWidget>>;
|
|
9
|
+
content: NonRepeatableZoneContent;
|
|
10
|
+
onContentChange: (content: NonRepeatableZoneContent) => void;
|
|
9
11
|
}>;
|
|
10
12
|
export declare const NonRepeatableZoneEditor: FC<NonRepeatableZoneEditorProps>;
|
|
11
13
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type GroupItemContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes";
|
|
2
3
|
import { type FC } from "react";
|
|
3
|
-
import { type RepeatableZone } from "../domain/zones/RepeatableZone";
|
|
4
4
|
declare type RepeatableZoneEditorProps = Readonly<{
|
|
5
5
|
id: string;
|
|
6
|
+
readOnly: boolean;
|
|
6
7
|
title?: string;
|
|
8
|
+
repeatableZone: Readonly<Record<string, NestableWidget>>;
|
|
7
9
|
content: GroupItemContent[] | undefined;
|
|
8
10
|
onContentChange: (content: GroupItemContent[]) => void;
|
|
9
|
-
readOnly: boolean;
|
|
10
|
-
repeatableZone: RepeatableZone;
|
|
11
11
|
}>;
|
|
12
12
|
export declare const RepeatableZoneEditor: FC<RepeatableZoneEditorProps>;
|
|
13
13
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { StaticSlices
|
|
1
|
+
import { SlicesContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { StaticSlices } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
declare type SliceZoneEditorProps = Readonly<{
|
|
5
|
-
content: SliceZoneContent | undefined;
|
|
6
5
|
id: string;
|
|
7
|
-
onContentChange: (content: SliceZoneContent) => void;
|
|
8
6
|
readOnly: boolean;
|
|
9
|
-
sliceZone:
|
|
7
|
+
sliceZone: StaticSlices;
|
|
8
|
+
content: SlicesContent | undefined;
|
|
9
|
+
onContentChange: (content: SlicesContent) => void;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const SliceZoneEditor: FC<SliceZoneEditorProps>;
|
|
12
12
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GroupContent, NestableContent, UIDContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Group, NestableWidget, UID } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
export declare type StaticZone = Readonly<Record<string, UID | Group | NestableWidget>>;
|
|
4
|
+
export declare type StaticZoneContent = Readonly<Record<string, UIDContent | GroupContent | NestableContent>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type FC } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { StaticZone, StaticZoneContent } from "./StaticZone";
|
|
3
3
|
declare type StaticZoneEditorProps = Readonly<{
|
|
4
|
-
content: StaticZoneContent;
|
|
5
4
|
id: string;
|
|
6
|
-
onContentChange: (content: StaticZoneContent) => void;
|
|
7
5
|
readOnly: boolean;
|
|
8
6
|
staticZone: StaticZone;
|
|
7
|
+
content: StaticZoneContent;
|
|
8
|
+
onContentChange: (content: StaticZoneContent) => void;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const StaticZoneEditor: FC<StaticZoneEditorProps>;
|
|
11
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,51 +1,49 @@
|
|
|
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.3.0",
|
|
5
5
|
"@prismicio/richtext": "2.1.1",
|
|
6
|
-
"@prismicio/types-internal": "
|
|
7
|
-
"@tiptap/core": "2.0.0-beta.
|
|
8
|
-
"@tiptap/extension-bold": "2.0.0-beta.
|
|
9
|
-
"@tiptap/extension-bullet-list": "2.0.0-beta.
|
|
10
|
-
"@tiptap/extension-code-block": "2.0.0-beta.
|
|
11
|
-
"@tiptap/extension-document": "2.0.0-beta.
|
|
12
|
-
"@tiptap/extension-hard-break": "2.0.0-beta.
|
|
13
|
-
"@tiptap/extension-heading": "2.0.0-beta.
|
|
14
|
-
"@tiptap/extension-italic": "2.0.0-beta.
|
|
15
|
-
"@tiptap/extension-link": "2.0.0-beta.
|
|
16
|
-
"@tiptap/extension-list-item": "2.0.0-beta.
|
|
17
|
-
"@tiptap/extension-ordered-list": "2.0.0-beta.
|
|
18
|
-
"@tiptap/extension-paragraph": "2.0.0-beta.
|
|
19
|
-
"@tiptap/extension-placeholder": "2.0.0-beta.
|
|
20
|
-
"@tiptap/extension-text": "2.0.0-beta.
|
|
21
|
-
"@tiptap/
|
|
22
|
-
"@tiptap/
|
|
6
|
+
"@prismicio/types-internal": "2.0.0-alpha.7",
|
|
7
|
+
"@tiptap/core": "2.0.0-beta.217",
|
|
8
|
+
"@tiptap/extension-bold": "2.0.0-beta.217",
|
|
9
|
+
"@tiptap/extension-bullet-list": "2.0.0-beta.217",
|
|
10
|
+
"@tiptap/extension-code-block": "2.0.0-beta.217",
|
|
11
|
+
"@tiptap/extension-document": "2.0.0-beta.217",
|
|
12
|
+
"@tiptap/extension-hard-break": "2.0.0-beta.217",
|
|
13
|
+
"@tiptap/extension-heading": "2.0.0-beta.217",
|
|
14
|
+
"@tiptap/extension-italic": "2.0.0-beta.217",
|
|
15
|
+
"@tiptap/extension-link": "2.0.0-beta.217",
|
|
16
|
+
"@tiptap/extension-list-item": "2.0.0-beta.217",
|
|
17
|
+
"@tiptap/extension-ordered-list": "2.0.0-beta.217",
|
|
18
|
+
"@tiptap/extension-paragraph": "2.0.0-beta.217",
|
|
19
|
+
"@tiptap/extension-placeholder": "2.0.0-beta.217",
|
|
20
|
+
"@tiptap/extension-text": "2.0.0-beta.217",
|
|
21
|
+
"@tiptap/pm": "2.0.0-beta.217",
|
|
22
|
+
"@tiptap/react": "2.0.0-beta.217",
|
|
23
|
+
"@tiptap/suggestion": "2.0.0-beta.217",
|
|
23
24
|
"clsx": "1.2.1",
|
|
24
25
|
"fp-ts": "2.12.3",
|
|
25
26
|
"io-ts": "2.2.18",
|
|
26
27
|
"io-ts-types": "0.5.16",
|
|
27
28
|
"monocle-ts": "",
|
|
28
29
|
"newtype-ts": "",
|
|
29
|
-
"prosemirror-model": "1.
|
|
30
|
+
"prosemirror-model": "1.19.0",
|
|
30
31
|
"tslib": "2.4.0",
|
|
31
32
|
"zod": "3.19.1"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@types/react": "18.0.18",
|
|
35
|
-
"@vitejs/plugin-react": "
|
|
36
|
-
"@vitest/coverage-c8": "0.23.4",
|
|
36
|
+
"@vitejs/plugin-react-swc": "3.1.0",
|
|
37
37
|
"eslint": "8.23.0",
|
|
38
38
|
"eslint-config-prettier": "8.5.0",
|
|
39
|
-
"eslint-plugin-jest-dom": "4.0.2",
|
|
40
39
|
"eslint-plugin-jsx-a11y": "6.6.1",
|
|
41
40
|
"eslint-plugin-react": "7.31.7",
|
|
42
41
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
43
|
-
"eslint-plugin-testing-library": "5.6.2",
|
|
44
42
|
"happy-dom": "6.0.4",
|
|
45
43
|
"react": "18.2.0",
|
|
46
44
|
"typescript": "4.8.2",
|
|
47
|
-
"vite": "
|
|
48
|
-
"vitest": "0.
|
|
45
|
+
"vite": "4.0.4",
|
|
46
|
+
"vitest": "0.28.5"
|
|
49
47
|
},
|
|
50
48
|
"exports": {
|
|
51
49
|
".": {
|
|
@@ -63,7 +61,7 @@
|
|
|
63
61
|
"module": "./dist/index.es.js",
|
|
64
62
|
"name": "@prismicio/editor-fields",
|
|
65
63
|
"peerDependencies": {
|
|
66
|
-
"@prismicio/editor-ui": "0.
|
|
64
|
+
"@prismicio/editor-ui": "0.3.0",
|
|
67
65
|
"react": "18",
|
|
68
66
|
"react-dom": "18"
|
|
69
67
|
},
|
|
@@ -75,11 +73,10 @@
|
|
|
75
73
|
"scripts": {
|
|
76
74
|
"prepack": "$npm_execpath run vite-build",
|
|
77
75
|
"vite-build": "vite build && tsc --build tsconfig-dist.json",
|
|
78
|
-
"vitest": "vitest"
|
|
79
|
-
"vitest-coverage": "vitest run --coverage"
|
|
76
|
+
"vitest": "vitest"
|
|
80
77
|
},
|
|
81
78
|
"sideEffects": false,
|
|
82
79
|
"stableVersion": "0.0.0",
|
|
83
80
|
"types": "./dist/index.d.ts",
|
|
84
|
-
"version": "0.
|
|
81
|
+
"version": "0.3.0"
|
|
85
82
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { WidgetContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { StaticCustomType as CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
import type { StaticSection as Section } from "@prismicio/types-internal/lib/customtypes/Section";
|
|
4
|
-
import type { SectionContent } from "./Section";
|
|
5
|
-
export declare type DocumentContent = Readonly<Partial<Record<string, WidgetContent>>>;
|
|
6
|
-
export declare function isEmptyCustomType(customType: CustomType): boolean;
|
|
7
|
-
export declare function getSection(customType: CustomType, sectionName: string): Section;
|
|
8
|
-
export declare function getSectionContent(section: Section, documentContent: DocumentContent): SectionContent;
|
package/dist/domain/Field.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { BooleanField as BooleanT, NestableWidget, Separator } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
declare type Field = Exclude<NestableWidget, Separator>;
|
|
3
|
-
export declare function getFieldLabel(field: Field | Separator): string;
|
|
4
|
-
export declare function getFieldPlaceholder(field: Exclude<Field, BooleanT>): string;
|
|
5
|
-
export declare function getFieldPlaceholder(field: BooleanT, value: boolean): string;
|
|
6
|
-
export {};
|
package/dist/domain/Group.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GroupContent, GroupItemContent, NestableContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { Group } from "@prismicio/types-internal/lib/customtypes/widgets";
|
|
3
|
-
import type { RepeatableZone } from "./zones/RepeatableZone";
|
|
4
|
-
export declare function getGroupLabel(group: Group): string;
|
|
5
|
-
export declare function getRepeatableZone(group: Group): RepeatableZone;
|
|
6
|
-
export declare function updateRepeatableZoneContent(groupContent: GroupContent | undefined, repeatableZoneContent: GroupItemContent[]): GroupContent;
|
|
7
|
-
export declare const createGroupItemContent: (value?: [string, NestableContent][]) => GroupItemContent;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type WidgetContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { StaticSection as Section } from "@prismicio/types-internal/lib/customtypes/Section";
|
|
3
|
-
import type { StaticSlices as SliceZone } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
4
|
-
import type { StaticZone, StaticZoneContent } from "./zones/StaticZone";
|
|
5
|
-
export declare type SectionContent = Readonly<Partial<Record<string, WidgetContent>>>;
|
|
6
|
-
export declare type PartitionedSection = readonly [StaticZone, SliceZones];
|
|
7
|
-
declare type SliceZones = readonly (readonly [string, SliceZone])[];
|
|
8
|
-
export declare function getPartitionedSection(section: Section): PartitionedSection;
|
|
9
|
-
export declare function getStaticZoneContent(staticZone: StaticZone, sectionContent: SectionContent): StaticZoneContent;
|
|
10
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { SharedSlice } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
2
|
-
export declare type SharedSlices = Readonly<Partial<Record<string, SharedSlice>>>;
|
|
3
|
-
export declare function compactSharedSlices(sharedSlices: SharedSlices): Map<string, SharedSlice>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type GroupContent, type NestableContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { StaticSlices as SliceZone } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
3
|
-
import type { StaticWidget as Widget } from "@prismicio/types-internal/lib/customtypes/widgets/Widget";
|
|
4
|
-
import type { StaticWidgetContent } from "./zones/StaticZone";
|
|
5
|
-
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 NestableContent;
|
package/dist/domain/Widget.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type SlicesContent, type WidgetContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { StaticSlices as SliceZone } from "@prismicio/types-internal/lib/customtypes/widgets/slices/Slices";
|
|
3
|
-
import type { StaticWidget as Widget } from "@prismicio/types-internal/lib/customtypes/widgets/Widget";
|
|
4
|
-
import type { Refinement } from "fp-ts/Refinement";
|
|
5
|
-
export declare function isSliceZone(widget: Widget): widget is SliceZone;
|
|
6
|
-
export declare function isSliceZoneContent(widgetContent: WidgetContent): widgetContent is SlicesContent;
|
|
7
|
-
export declare type Widgets<T> = T extends Record<string, infer V> ? readonly (readonly [string, NonNullable<V>])[] : never;
|
|
8
|
-
export declare function getWidgets<V extends Widget>(record: Readonly<Partial<Record<string, V>>>): Widgets<Readonly<Partial<Record<string, V>>>>;
|
|
9
|
-
export declare function refineWidgetContent<A extends WidgetContent, B extends A>(widgetContent: A | undefined, refinement: Refinement<A, B>): B | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CompositeSlice } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
2
|
-
import type { NonRepeatableZone } from "../zones/NonRepeatableZone";
|
|
3
|
-
import type { RepeatableZone } from "../zones/RepeatableZone";
|
|
4
|
-
export declare function getCompositeSliceLegend(compositeSlice: CompositeSlice): string;
|
|
5
|
-
export declare function getNonRepeatableZone(compositeSlice: CompositeSlice): NonRepeatableZone;
|
|
6
|
-
export declare function getRepeatableZone(compositeSlice: CompositeSlice): RepeatableZone;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SharedSliceContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { SharedSlice, Variation } from "@prismicio/types-internal/lib/customtypes/widgets/slices";
|
|
3
|
-
import type { NonRepeatableZone } from "../zones/NonRepeatableZone";
|
|
4
|
-
import type { RepeatableZone } from "../zones/RepeatableZone";
|
|
5
|
-
export declare function defaultSharedSliceContent(variationId: string): SharedSliceContent;
|
|
6
|
-
export declare function getVariation(sharedSlice: SharedSlice, variationId: string): Variation | undefined;
|
|
7
|
-
export declare function getSharedSliceLegend(sharedSlice: SharedSlice, variation: Variation): readonly [sharedSliceName: string, variationName: string];
|
|
8
|
-
export declare function getNonRepeatableZone(variation: Variation): NonRepeatableZone;
|
|
9
|
-
export declare function getRepeatableZone(variation: Variation): RepeatableZone;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { NestableContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
3
|
-
export declare type NonRepeatableZone = Readonly<Partial<Record<string, NestableWidget>>>;
|
|
4
|
-
export declare type NonRepeatableZoneContent = Readonly<Record<string, NestableContent>>;
|
|
5
|
-
export declare function updateNonRepeatableWidgetContent(nonRepeatableZoneContent: NonRepeatableZoneContent, nonRepeatableWidgetId: string, nonRepeatableWidgetContent: NestableContent | undefined): NonRepeatableZoneContent;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { GroupItemContent, NestableContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
3
|
-
export declare type RepeatableZone = Readonly<Partial<Record<string, NestableWidget>>>;
|
|
4
|
-
export declare function defaultRepeatableZoneContentIfUndefined(repeatableZoneContent: GroupItemContent[] | undefined): GroupItemContent[];
|
|
5
|
-
export declare function updateRepeatableZone(repeatableZoneContent: GroupItemContent[], updatedItemWithIndex: [number, GroupItemContent | undefined]): GroupItemContent[];
|
|
6
|
-
export declare function updateRepeatableZoneItem(repeatableItemContent: GroupItemContent, updatedWidgetWithId: [string, NestableContent | undefined]): GroupItemContent;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CompositeSliceContent, SharedSliceContent, SimpleSliceContent, SliceContentItem, SlicesContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
export declare function isSharedSliceContent(sliceContent: SliceContentItem["widget"]): sliceContent is SharedSliceContent;
|
|
3
|
-
export declare function isCompositeSliceContent(sliceContent: SliceContentItem["widget"]): sliceContent is CompositeSliceContent;
|
|
4
|
-
export declare function isLegacySliceContent(sliceContent: SliceContentItem["widget"]): sliceContent is SimpleSliceContent;
|
|
5
|
-
export declare function updateSliceContent(sliceZoneContent: SlicesContent, sliceZoneItemContentIndex: number, sliceContent: SharedSliceContent | CompositeSliceContent | SimpleSliceContent | undefined): SlicesContent;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { GroupContent, NestableContent, UIDContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { StaticWidget } from "../StaticWidget";
|
|
3
|
-
export declare type StaticWidgetContent = UIDContent | GroupContent | NestableContent;
|
|
4
|
-
export declare type StaticZone = Readonly<Partial<Record<string, StaticWidget>>>;
|
|
5
|
-
export declare type StaticZoneContent = Readonly<Partial<Record<string, StaticWidgetContent>>>;
|
|
6
|
-
export declare function getStaticZoneLegend(): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import type { Image } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
3
|
-
import { type FC } from "react";
|
|
4
|
-
interface ImageFieldProps {
|
|
5
|
-
content: ImageContent | undefined;
|
|
6
|
-
field: Image;
|
|
7
|
-
id: string;
|
|
8
|
-
onContentChange: (content: ImageContent | undefined) => void;
|
|
9
|
-
readOnly: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const ImageField: FC<ImageFieldProps>;
|
|
12
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
import type { ExternalImage } from "../../../domain/fields/ImageField/ExternalImage";
|
|
3
|
-
interface MediaPickerProps {
|
|
4
|
-
trigger: ReactNode;
|
|
5
|
-
onMediaSelected?: (media: ExternalImage) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const MediaPicker: FC<MediaPickerProps>;
|
|
8
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
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 {};
|