@madebywild/sanity-richtext-field 3.1.0 → 3.1.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/blocks/media-grid-block.d.cts +4 -4
- package/dist/blocks/media-grid-block.d.ts +4 -4
- package/dist/blocks/media-only-block.d.cts +4 -4
- package/dist/blocks/media-only-block.d.ts +4 -4
- package/dist/blocks/media-slider-block.d.cts +4 -4
- package/dist/blocks/quote-block.d.cts +4 -4
- package/dist/blocks/quote-block.d.ts +4 -4
- package/dist/index.d.cts +2 -2
- package/dist/parts.d.cts +19 -19
- package/dist/parts.d.ts +16 -16
- package/dist/utils.d.cts +4 -4
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity64 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
import { FieldOptions } from "@madebywild/sanity-media-field";
|
|
4
4
|
type Options = Omit<Partial<ObjectDefinition>, "type"> & {
|
|
@@ -16,9 +16,9 @@ declare function createBlock({
|
|
|
16
16
|
}?: Options): {
|
|
17
17
|
type: "object";
|
|
18
18
|
name?: string | undefined;
|
|
19
|
-
} & Omit<
|
|
20
|
-
preview?:
|
|
19
|
+
} & Omit<sanity64.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
20
|
+
preview?: sanity64.PreviewConfig<{
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
}, Record<string, string>> | undefined;
|
|
23
|
-
} &
|
|
23
|
+
} & sanity64.WidenValidation & sanity64.WidenInitialValue;
|
|
24
24
|
export { createBlock };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity73 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
import { FieldOptions } from "@madebywild/sanity-media-field";
|
|
4
4
|
type Options = Omit<Partial<ObjectDefinition>, "type"> & {
|
|
@@ -16,9 +16,9 @@ declare function createBlock({
|
|
|
16
16
|
}?: Options): {
|
|
17
17
|
type: "object";
|
|
18
18
|
name?: string | undefined;
|
|
19
|
-
} & Omit<
|
|
20
|
-
preview?:
|
|
19
|
+
} & Omit<sanity73.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
20
|
+
preview?: sanity73.PreviewConfig<{
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
}, Record<string, string>> | undefined;
|
|
23
|
-
} &
|
|
23
|
+
} & sanity73.WidenValidation & sanity73.WidenInitialValue;
|
|
24
24
|
export { createBlock };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity72 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
import { FieldOptions } from "@madebywild/sanity-media-field";
|
|
4
4
|
type Options = Omit<Partial<ObjectDefinition>, "type"> & {
|
|
@@ -16,9 +16,9 @@ declare function createBlock({
|
|
|
16
16
|
}?: Options): {
|
|
17
17
|
type: "object";
|
|
18
18
|
name?: string | undefined;
|
|
19
|
-
} & Omit<
|
|
20
|
-
preview?:
|
|
19
|
+
} & Omit<sanity72.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
20
|
+
preview?: sanity72.PreviewConfig<{
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
}, Record<string, string>> | undefined;
|
|
23
|
-
} &
|
|
23
|
+
} & sanity72.WidenValidation & sanity72.WidenInitialValue;
|
|
24
24
|
export { createBlock };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity69 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
import { FieldOptions } from "@madebywild/sanity-media-field";
|
|
4
4
|
type Options = Omit<Partial<ObjectDefinition>, "type"> & {
|
|
@@ -16,9 +16,9 @@ declare function createBlock({
|
|
|
16
16
|
}?: Options): {
|
|
17
17
|
type: "object";
|
|
18
18
|
name?: string | undefined;
|
|
19
|
-
} & Omit<
|
|
20
|
-
preview?:
|
|
19
|
+
} & Omit<sanity69.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
20
|
+
preview?: sanity69.PreviewConfig<{
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
}, Record<string, string>> | undefined;
|
|
23
|
-
} &
|
|
23
|
+
} & sanity69.WidenValidation & sanity69.WidenInitialValue;
|
|
24
24
|
export { createBlock };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity68 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
import { FieldOptions } from "@madebywild/sanity-media-field";
|
|
4
4
|
type Options = Omit<Partial<ObjectDefinition>, "type"> & {
|
|
@@ -16,9 +16,9 @@ declare function createBlock({
|
|
|
16
16
|
}?: Options): {
|
|
17
17
|
type: "object";
|
|
18
18
|
name?: string | undefined;
|
|
19
|
-
} & Omit<
|
|
20
|
-
preview?:
|
|
19
|
+
} & Omit<sanity68.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
20
|
+
preview?: sanity68.PreviewConfig<{
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
}, Record<string, string>> | undefined;
|
|
23
|
-
} &
|
|
23
|
+
} & sanity68.WidenValidation & sanity68.WidenInitialValue;
|
|
24
24
|
export { createBlock };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity60 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
type Options = Omit<Partial<ObjectDefinition>, "type">;
|
|
4
4
|
/** @public */
|
|
@@ -9,9 +9,9 @@ declare function createBlock({
|
|
|
9
9
|
}?: Options): {
|
|
10
10
|
type: "object";
|
|
11
11
|
name?: string | undefined;
|
|
12
|
-
} & Omit<
|
|
13
|
-
preview?:
|
|
12
|
+
} & Omit<sanity60.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
13
|
+
preview?: sanity60.PreviewConfig<{
|
|
14
14
|
[x: string]: string;
|
|
15
15
|
}, Record<string, string>> | undefined;
|
|
16
|
-
} &
|
|
16
|
+
} & sanity60.WidenValidation & sanity60.WidenInitialValue;
|
|
17
17
|
export { createBlock };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity61 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
type Options = Omit<Partial<ObjectDefinition>, "type">;
|
|
4
4
|
/** @public */
|
|
@@ -9,9 +9,9 @@ declare function createBlock({
|
|
|
9
9
|
}?: Options): {
|
|
10
10
|
type: "object";
|
|
11
11
|
name?: string | undefined;
|
|
12
|
-
} & Omit<
|
|
13
|
-
preview?:
|
|
12
|
+
} & Omit<sanity61.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
13
|
+
preview?: sanity61.PreviewConfig<{
|
|
14
14
|
[x: string]: string;
|
|
15
15
|
}, Record<string, string>> | undefined;
|
|
16
|
-
} &
|
|
16
|
+
} & sanity61.WidenValidation & sanity61.WidenInitialValue;
|
|
17
17
|
export { createBlock };
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity76 from "sanity";
|
|
2
2
|
import { ArrayDefinition, ArrayOfType, ArrayOptions, BlockDecoratorDefinition, BlockListDefinition, BlockStyleDefinition } from "sanity";
|
|
3
3
|
/** @public */
|
|
4
4
|
declare const typeName: "wild.richtext";
|
|
@@ -86,5 +86,5 @@ declare module "sanity" {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
/** @public */
|
|
89
|
-
declare const wildSanityRichtextFieldPlugin:
|
|
89
|
+
declare const wildSanityRichtextFieldPlugin: sanity76.Plugin<PluginConfig>;
|
|
90
90
|
export { type FieldOptions, type PluginConfig, typeName, wildSanityRichtextFieldPlugin };
|
package/dist/parts.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity81 from "sanity";
|
|
2
2
|
import * as react22 from "react";
|
|
3
3
|
type ColorAnnotationOptions = {
|
|
4
4
|
renderValue?: (value: string | undefined, props: BlockAnnotationProps) => React.ReactNode;
|
|
@@ -10,19 +10,19 @@ declare function createAnnotations(options?: {
|
|
|
10
10
|
}): readonly [{
|
|
11
11
|
type: "wild.link";
|
|
12
12
|
name: "wild.richtext.annotation.link";
|
|
13
|
-
} &
|
|
14
|
-
preview?:
|
|
15
|
-
} &
|
|
13
|
+
} & sanity81.TypeAliasDefinition<"wild.link", "string" | "number" | "boolean" | "object" | "wild.richtext" | "wild.media" | "wild.quote" | "array" | "block" | "date" | "datetime" | "document" | "file" | "geopoint" | "image" | "reference" | "crossDatasetReference" | "globalDocumentReference" | "slug" | "text" | "url" | "email" | undefined> & {
|
|
14
|
+
preview?: sanity81.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
15
|
+
} & sanity81.FieldDefinitionBase & sanity81.WidenValidation & sanity81.WidenInitialValue, {
|
|
16
16
|
type: "object";
|
|
17
17
|
name: "wild.richtext.annotation.textColor";
|
|
18
|
-
} & Omit<
|
|
19
|
-
preview?:
|
|
20
|
-
} &
|
|
18
|
+
} & Omit<sanity81.ObjectDefinition, "preview"> & {
|
|
19
|
+
preview?: sanity81.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
20
|
+
} & sanity81.FieldDefinitionBase & sanity81.WidenValidation & sanity81.WidenInitialValue, {
|
|
21
21
|
type: "object";
|
|
22
22
|
name: "wild.richtext.annotation.highlightColor";
|
|
23
|
-
} & Omit<
|
|
24
|
-
preview?:
|
|
25
|
-
} &
|
|
23
|
+
} & Omit<sanity81.ObjectDefinition, "preview"> & {
|
|
24
|
+
preview?: sanity81.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
25
|
+
} & sanity81.FieldDefinitionBase & sanity81.WidenValidation & sanity81.WidenInitialValue];
|
|
26
26
|
/** @public */
|
|
27
27
|
declare function createDecorators(): readonly [{
|
|
28
28
|
readonly title: "Strong";
|
|
@@ -69,29 +69,29 @@ type IconSpanOptions = {
|
|
|
69
69
|
declare function createIconSpan(options?: IconSpanOptions): {
|
|
70
70
|
type: "object";
|
|
71
71
|
name?: "wild.richtext.span.icon" | undefined;
|
|
72
|
-
} & Omit<
|
|
73
|
-
preview?:
|
|
72
|
+
} & Omit<sanity81.ArrayOfEntry<sanity81.ObjectDefinition>, "preview"> & {
|
|
73
|
+
preview?: sanity81.PreviewConfig<{
|
|
74
74
|
icon: string;
|
|
75
75
|
}, Record<"icon", any>> | undefined;
|
|
76
|
-
} &
|
|
76
|
+
} & sanity81.WidenValidation & sanity81.WidenInitialValue;
|
|
77
77
|
/** @public */
|
|
78
78
|
declare function createSpans(options?: {
|
|
79
79
|
icon?: IconSpanOptions;
|
|
80
80
|
}): readonly [{
|
|
81
81
|
type: "object";
|
|
82
82
|
name?: "wild.richtext.span.icon" | undefined;
|
|
83
|
-
} & Omit<
|
|
84
|
-
preview?:
|
|
83
|
+
} & Omit<sanity81.ArrayOfEntry<sanity81.ObjectDefinition>, "preview"> & {
|
|
84
|
+
preview?: sanity81.PreviewConfig<{
|
|
85
85
|
icon: string;
|
|
86
86
|
}, Record<"icon", any>> | undefined;
|
|
87
|
-
} &
|
|
87
|
+
} & sanity81.WidenValidation & sanity81.WidenInitialValue, {
|
|
88
88
|
type: "object";
|
|
89
89
|
name?: "wild.richtext.span.media" | undefined;
|
|
90
|
-
} & Omit<
|
|
91
|
-
preview?:
|
|
90
|
+
} & Omit<sanity81.ArrayOfEntry<sanity81.ObjectDefinition>, "preview"> & {
|
|
91
|
+
preview?: sanity81.PreviewConfig<{
|
|
92
92
|
kind: string;
|
|
93
93
|
}, Record<"kind", any>> | undefined;
|
|
94
|
-
} &
|
|
94
|
+
} & sanity81.WidenValidation & sanity81.WidenInitialValue];
|
|
95
95
|
/** @public */
|
|
96
96
|
declare function createStyles(): readonly [{
|
|
97
97
|
readonly title: "Heading 2";
|
package/dist/parts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as sanity81 from "sanity";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react22 from "react";
|
|
3
3
|
type ColorAnnotationOptions = {
|
|
4
4
|
renderValue?: (value: string | undefined, props: BlockAnnotationProps) => React.ReactNode;
|
|
5
5
|
};
|
|
@@ -10,7 +10,7 @@ declare function createAnnotations(options?: {
|
|
|
10
10
|
}): readonly [{
|
|
11
11
|
type: "wild.link";
|
|
12
12
|
name: "wild.richtext.annotation.link";
|
|
13
|
-
} & sanity81.TypeAliasDefinition<"wild.link", "string" | "number" | "boolean" | "object" | "wild.richtext" | "wild.
|
|
13
|
+
} & sanity81.TypeAliasDefinition<"wild.link", "string" | "number" | "boolean" | "object" | "wild.richtext" | "wild.quote" | "wild.media" | "array" | "block" | "date" | "datetime" | "document" | "file" | "geopoint" | "image" | "reference" | "crossDatasetReference" | "globalDocumentReference" | "slug" | "text" | "url" | "email" | undefined> & {
|
|
14
14
|
preview?: sanity81.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
15
15
|
} & sanity81.FieldDefinitionBase & sanity81.WidenValidation & sanity81.WidenInitialValue, {
|
|
16
16
|
type: "object";
|
|
@@ -27,44 +27,44 @@ declare function createAnnotations(options?: {
|
|
|
27
27
|
declare function createDecorators(): readonly [{
|
|
28
28
|
readonly title: "Strong";
|
|
29
29
|
readonly value: "wild.richtext.decorator.strong";
|
|
30
|
-
readonly icon:
|
|
30
|
+
readonly icon: react22.ForwardRefExoticComponent<Omit<react22.SVGProps<SVGSVGElement>, "ref"> & react22.RefAttributes<SVGSVGElement>>;
|
|
31
31
|
readonly component: ({
|
|
32
32
|
children
|
|
33
|
-
}: BlockDecoratorProps) =>
|
|
33
|
+
}: BlockDecoratorProps) => react22.JSX.Element;
|
|
34
34
|
}, {
|
|
35
35
|
readonly title: "Emphasis";
|
|
36
36
|
readonly value: "wild.richtext.decorator.em";
|
|
37
|
-
readonly icon:
|
|
37
|
+
readonly icon: react22.ForwardRefExoticComponent<Omit<react22.SVGProps<SVGSVGElement>, "ref"> & react22.RefAttributes<SVGSVGElement>>;
|
|
38
38
|
readonly component: ({
|
|
39
39
|
children
|
|
40
|
-
}: BlockDecoratorProps) =>
|
|
40
|
+
}: BlockDecoratorProps) => react22.JSX.Element;
|
|
41
41
|
}, {
|
|
42
42
|
readonly title: "Code";
|
|
43
43
|
readonly value: "wild.richtext.decorator.code";
|
|
44
|
-
readonly icon:
|
|
44
|
+
readonly icon: react22.ForwardRefExoticComponent<Omit<react22.SVGProps<SVGSVGElement>, "ref"> & react22.RefAttributes<SVGSVGElement>>;
|
|
45
45
|
readonly component: ({
|
|
46
46
|
children
|
|
47
|
-
}: BlockDecoratorProps) =>
|
|
47
|
+
}: BlockDecoratorProps) => react22.JSX.Element;
|
|
48
48
|
}, {
|
|
49
49
|
readonly title: "Sup";
|
|
50
50
|
readonly value: "wild.richtext.decorator.sup";
|
|
51
|
-
readonly icon: () =>
|
|
51
|
+
readonly icon: () => react22.JSX.Element;
|
|
52
52
|
readonly component: ({
|
|
53
53
|
children
|
|
54
|
-
}: BlockDecoratorProps) =>
|
|
54
|
+
}: BlockDecoratorProps) => react22.JSX.Element;
|
|
55
55
|
}];
|
|
56
56
|
/** @public */
|
|
57
57
|
declare function createLists(): readonly [{
|
|
58
58
|
readonly title: "Bullet";
|
|
59
59
|
readonly value: "wild.richtext.list.bullet";
|
|
60
|
-
readonly icon:
|
|
60
|
+
readonly icon: react22.ForwardRefExoticComponent<Omit<react22.SVGProps<SVGSVGElement>, "ref"> & react22.RefAttributes<SVGSVGElement>>;
|
|
61
61
|
}, {
|
|
62
62
|
readonly title: "Number";
|
|
63
63
|
readonly value: "wild.richtext.list.number";
|
|
64
|
-
readonly icon:
|
|
64
|
+
readonly icon: react22.ForwardRefExoticComponent<Omit<react22.SVGProps<SVGSVGElement>, "ref"> & react22.RefAttributes<SVGSVGElement>>;
|
|
65
65
|
}];
|
|
66
66
|
type IconSpanOptions = {
|
|
67
|
-
renderValue?: (value?: string) =>
|
|
67
|
+
renderValue?: (value?: string) => react22.ReactNode;
|
|
68
68
|
};
|
|
69
69
|
declare function createIconSpan(options?: IconSpanOptions): {
|
|
70
70
|
type: "object";
|
|
@@ -98,18 +98,18 @@ declare function createStyles(): readonly [{
|
|
|
98
98
|
readonly value: "wild.richtext.style.h2";
|
|
99
99
|
readonly component: ({
|
|
100
100
|
children
|
|
101
|
-
}: BlockStyleProps) =>
|
|
101
|
+
}: BlockStyleProps) => react22.JSX.Element;
|
|
102
102
|
}, {
|
|
103
103
|
readonly title: "Heading 3";
|
|
104
104
|
readonly value: "wild.richtext.style.h3";
|
|
105
105
|
readonly component: ({
|
|
106
106
|
children
|
|
107
|
-
}: BlockStyleProps) =>
|
|
107
|
+
}: BlockStyleProps) => react22.JSX.Element;
|
|
108
108
|
}, {
|
|
109
109
|
readonly title: "Heading 4";
|
|
110
110
|
readonly value: "wild.richtext.style.h4";
|
|
111
111
|
readonly component: ({
|
|
112
112
|
children
|
|
113
|
-
}: BlockStyleProps) =>
|
|
113
|
+
}: BlockStyleProps) => react22.JSX.Element;
|
|
114
114
|
}];
|
|
115
115
|
export { createAnnotations, createDecorators, createIconSpan, createLists, createSpans, createStyles };
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as sanity77 from "sanity";
|
|
2
2
|
import { ObjectDefinition } from "sanity";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a schema definition for a new richtext block.
|
|
@@ -7,11 +7,11 @@ import { ObjectDefinition } from "sanity";
|
|
|
7
7
|
declare function createBlock(block: ObjectDefinition): {
|
|
8
8
|
type: "object";
|
|
9
9
|
name?: string | undefined;
|
|
10
|
-
} & Omit<
|
|
11
|
-
preview?:
|
|
10
|
+
} & Omit<sanity77.ArrayOfEntry<ObjectDefinition>, "preview"> & {
|
|
11
|
+
preview?: sanity77.PreviewConfig<{
|
|
12
12
|
[x: string]: string;
|
|
13
13
|
}, Record<string, string>> | undefined;
|
|
14
|
-
} &
|
|
14
|
+
} & sanity77.WidenValidation & sanity77.WidenInitialValue;
|
|
15
15
|
/**
|
|
16
16
|
* Reshapes the list kind of an array field.
|
|
17
17
|
*/
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@madebywild/sanity-richtext-field",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"browserslist": "extends @sanity/browserslist-config",
|
|
8
8
|
"exports": {
|
|
9
9
|
"./package.json": "./package.json",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"ts-deepmerge": "^7.0.3",
|
|
55
|
-
"@madebywild/sanity-
|
|
56
|
-
"@madebywild/sanity-
|
|
57
|
-
"@madebywild/sanity-
|
|
55
|
+
"@madebywild/sanity-media-field": "1.0.1",
|
|
56
|
+
"@madebywild/sanity-utils": "1.0.1",
|
|
57
|
+
"@madebywild/sanity-quote-field": "1.1.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@sanity/icons": "^3.7.4",
|