Summary field remove 'inline image' and 'keyboard input' options (#38012)

* Summary field remove 'inline image' and 'keyboard input' options

* Add changelog file
This commit is contained in:
Maikel David Pérez Gómez 2023-04-28 10:51:22 -04:00 committed by GitHub
parent bf14b26846
commit f3959d0700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Summary field remove 'inline image' and 'keyboard input' options#37986

View File

@ -11,6 +11,21 @@
"align": { "align": {
"type": "string" "type": "string"
}, },
"allowedFormats": {
"type": "array",
"default": [
"core/bold",
"core/code",
"core/italic",
"core/link",
"core/strikethrough",
"core/underline",
"core/text-color",
"core/subscript",
"core/superscript",
"core/unknown"
]
},
"direction": { "direction": {
"type": "string", "type": "string",
"enum": [ "ltr", "rtl" ] "enum": [ "ltr", "rtl" ]

View File

@ -28,7 +28,7 @@ export function Edit( {
attributes, attributes,
setAttributes, setAttributes,
}: BlockEditProps< SummaryAttributes > ) { }: BlockEditProps< SummaryAttributes > ) {
const { align, direction, label } = attributes; const { align, allowedFormats, direction, label } = attributes;
const blockProps = useBlockProps( { const blockProps = useBlockProps( {
style: { direction }, style: { direction },
} ); } );
@ -83,6 +83,7 @@ export function Edit( {
[ `has-text-align-${ align }` ]: align, [ `has-text-align-${ align }` ]: align,
} ) } } ) }
dir={ direction } dir={ direction }
allowedFormats={ allowedFormats }
/> />
</BaseControl> </BaseControl>
</div> </div>

View File

@ -1,5 +1,6 @@
export type SummaryAttributes = { export type SummaryAttributes = {
align: 'left' | 'center' | 'right' | 'justify'; align: 'left' | 'center' | 'right' | 'justify';
allowedFormats?: string[];
direction: 'ltr' | 'rtl'; direction: 'ltr' | 'rtl';
label: string; label: string;
}; };