@portabletext/editor 1.18.3 → 1.18.4
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/lib/index.cjs +4 -10
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -2
- package/lib/index.d.ts +1 -2
- package/lib/index.js +4 -10
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/editor/define-schema.ts +1 -13
package/package.json
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import {Schema as SanitySchema} from '@sanity/schema'
|
|
2
|
-
import {
|
|
3
|
-
defineField,
|
|
4
|
-
defineType,
|
|
5
|
-
type BlockDecoratorDefinition,
|
|
6
|
-
type ObjectSchemaType,
|
|
7
|
-
} from '@sanity/types'
|
|
2
|
+
import {defineField, defineType, type ObjectSchemaType} from '@sanity/types'
|
|
8
3
|
import startCase from 'lodash.startcase'
|
|
9
4
|
import type {PortableTextMemberSchemaTypes} from '../types/editor'
|
|
10
5
|
import {createEditorSchema} from './create-editor-schema'
|
|
@@ -15,7 +10,6 @@ import {createEditorSchema} from './create-editor-schema'
|
|
|
15
10
|
export type BaseDefinition = {
|
|
16
11
|
name: string
|
|
17
12
|
title?: string
|
|
18
|
-
icon?: BlockDecoratorDefinition['icon']
|
|
19
13
|
}
|
|
20
14
|
|
|
21
15
|
/**
|
|
@@ -57,7 +51,6 @@ export function compileSchemaDefinition<
|
|
|
57
51
|
// fields to objects with the name `image`
|
|
58
52
|
name: blockObject.name === 'image' ? 'tmp-image' : blockObject.name,
|
|
59
53
|
title: blockObject.title,
|
|
60
|
-
icon: blockObject.icon,
|
|
61
54
|
fields: [],
|
|
62
55
|
}),
|
|
63
56
|
) ?? []
|
|
@@ -67,7 +60,6 @@ export function compileSchemaDefinition<
|
|
|
67
60
|
type: 'object',
|
|
68
61
|
name: inlineObject.name,
|
|
69
62
|
title: inlineObject.title,
|
|
70
|
-
icon: inlineObject.icon,
|
|
71
63
|
fields: [],
|
|
72
64
|
}),
|
|
73
65
|
) ?? []
|
|
@@ -86,27 +78,23 @@ export function compileSchemaDefinition<
|
|
|
86
78
|
definition?.decorators?.map((decorator) => ({
|
|
87
79
|
title: decorator.title ?? startCase(decorator.name),
|
|
88
80
|
value: decorator.name,
|
|
89
|
-
icon: decorator.icon,
|
|
90
81
|
})) ?? [],
|
|
91
82
|
annotations:
|
|
92
83
|
definition?.annotations?.map((annotation) => ({
|
|
93
84
|
name: annotation.name,
|
|
94
85
|
type: 'object',
|
|
95
86
|
title: annotation.title,
|
|
96
|
-
icon: annotation.icon,
|
|
97
87
|
})) ?? [],
|
|
98
88
|
},
|
|
99
89
|
lists:
|
|
100
90
|
definition?.lists?.map((list) => ({
|
|
101
91
|
value: list.name,
|
|
102
92
|
title: list.title ?? startCase(list.name),
|
|
103
|
-
icon: list.icon,
|
|
104
93
|
})) ?? [],
|
|
105
94
|
styles:
|
|
106
95
|
definition?.styles?.map((style) => ({
|
|
107
96
|
value: style.name,
|
|
108
97
|
title: style.title ?? startCase(style.name),
|
|
109
|
-
icon: style.icon,
|
|
110
98
|
})) ?? [],
|
|
111
99
|
},
|
|
112
100
|
],
|