-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks } from '@wordpress/block-editor'; | ||
|
||
export const ListItem = () => ( | ||
<li> | ||
<InnerBlocks /> | ||
</li> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { list as icon } from '@wordpress/icons'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { ListItem as edit } from './edit'; | ||
import { save } from './save'; | ||
|
||
export const name = 'core/list-item'; | ||
|
||
export const settings = { | ||
apiVersion: 2, | ||
category: 'text', | ||
description: 'Individual list item in a list', | ||
edit, | ||
icon, | ||
name: 'core/list-item', | ||
parent: [ 'core/list' ], | ||
title: 'List Item', | ||
save, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks } from '@wordpress/block-editor'; | ||
|
||
export const save = () => ( | ||
<li> | ||
<InnerBlocks.Content /> | ||
</li> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { RichText, useBlockProps } from '@wordpress/block-editor'; | ||
import { InnerBlocks, RichText, useBlockProps } from '@wordpress/block-editor'; | ||
|
||
export default function save( { attributes } ) { | ||
const { ordered, values, type, reversed, start } = attributes; | ||
const TagName = ordered ? 'ol' : 'ul'; | ||
|
||
return ( | ||
<TagName { ...useBlockProps.save( { type, reversed, start } ) }> | ||
<RichText.Content value={ values } multiline="li" /> | ||
{ /*<RichText.Content value={ values } multiline="li" />*/ } | ||
<InnerBlocks.Content /> | ||
</TagName> | ||
); | ||
} |