diff --git a/packages/block-library/src/list/ordered-list-settings.js b/packages/block-library/src/list/ordered-list-settings.js index 7fd51a5c7e576..60e7e33d0ad51 100644 --- a/packages/block-library/src/list/ordered-list-settings.js +++ b/packages/block-library/src/list/ordered-list-settings.js @@ -3,9 +3,14 @@ */ import { __ } from '@wordpress/i18n'; import { InspectorControls } from '@wordpress/block-editor'; -import { TextControl, PanelBody, ToggleControl } from '@wordpress/components'; +import { + TextControl, + PanelBody, + ToggleControl, + SelectControl, +} from '@wordpress/components'; -const OrderedListSettings = ( { setAttributes, reversed, start } ) => ( +const OrderedListSettings = ( { setAttributes, reversed, start, type } ) => ( ( value={ Number.isInteger( start ) ? start.toString( 10 ) : '' } step="1" /> + setAttributes( { type: newValue } ) } + /> +
    + +
  1. Item 1
  2. + +
+ diff --git a/test/integration/fixtures/blocks/core__list__ol-with-type.json b/test/integration/fixtures/blocks/core__list__ol-with-type.json new file mode 100644 index 0000000000000..a15b1546b0ed4 --- /dev/null +++ b/test/integration/fixtures/blocks/core__list__ol-with-type.json @@ -0,0 +1,21 @@ +[ + { + "name": "core/list", + "isValid": true, + "attributes": { + "ordered": true, + "values": "", + "type": "A" + }, + "innerBlocks": [ + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "Item 1" + }, + "innerBlocks": [] + } + ] + } +] diff --git a/test/integration/fixtures/blocks/core__list__ol-with-type.parsed.json b/test/integration/fixtures/blocks/core__list__ol-with-type.parsed.json new file mode 100644 index 0000000000000..7ddda9e08da5a --- /dev/null +++ b/test/integration/fixtures/blocks/core__list__ol-with-type.parsed.json @@ -0,0 +1,20 @@ +[ + { + "blockName": "core/list", + "attrs": { + "ordered": true, + "type": "A" + }, + "innerBlocks": [ + { + "blockName": "core/list-item", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\t
  • Item 1
  • \n\t", + "innerContent": [ "\n\t
  • Item 1
  • \n\t" ] + } + ], + "innerHTML": "\n
      \n\t\n
    \n", + "innerContent": [ "\n
      \n\t", null, "\n
    \n" ] + } +] diff --git a/test/integration/fixtures/blocks/core__list__ol-with-type.serialized.html b/test/integration/fixtures/blocks/core__list__ol-with-type.serialized.html new file mode 100644 index 0000000000000..a785d55d92bce --- /dev/null +++ b/test/integration/fixtures/blocks/core__list__ol-with-type.serialized.html @@ -0,0 +1,5 @@ + +
      +
    1. Item 1
    2. +
    +