@wordpress/block-library 7.11.0 → 7.12.0

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.
Files changed (261) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/archives/edit.js +7 -0
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/archives/index.js +4 -0
  5. package/build/archives/index.js.map +1 -1
  6. package/build/block/edit.js +4 -2
  7. package/build/block/edit.js.map +1 -1
  8. package/build/block/edit.native.js +4 -2
  9. package/build/block/edit.native.js.map +1 -1
  10. package/build/calendar/edit.js +12 -5
  11. package/build/calendar/edit.js.map +1 -1
  12. package/build/columns/edit.native.js +2 -1
  13. package/build/columns/edit.native.js.map +1 -1
  14. package/build/cover/edit/resizable-cover.js +6 -0
  15. package/build/cover/edit/resizable-cover.js.map +1 -1
  16. package/build/group/transforms.js +5 -0
  17. package/build/group/transforms.js.map +1 -1
  18. package/build/index.native.js +17 -4
  19. package/build/index.native.js.map +1 -1
  20. package/build/list/index.js +6 -0
  21. package/build/list/index.js.map +1 -1
  22. package/build/list/v2/edit.js +16 -5
  23. package/build/list/v2/edit.js.map +1 -1
  24. package/build/list/v2/tag-name.js +31 -0
  25. package/build/list/v2/tag-name.js.map +1 -0
  26. package/build/list/v2/tag-name.native.js +32 -0
  27. package/build/list/v2/tag-name.native.js.map +1 -0
  28. package/build/list/v2/transforms.js +1 -11
  29. package/build/list/v2/transforms.js.map +1 -1
  30. package/build/list-item/edit.js +1 -0
  31. package/build/list-item/edit.js.map +1 -1
  32. package/build/list-item/edit.native.js +158 -0
  33. package/build/list-item/edit.native.js.map +1 -0
  34. package/build/list-item/icons.native.js +53 -0
  35. package/build/list-item/icons.native.js.map +1 -0
  36. package/build/list-item/list-style-type.native.js +136 -0
  37. package/build/list-item/list-style-type.native.js.map +1 -0
  38. package/build/media-text/deprecated.js +188 -66
  39. package/build/media-text/deprecated.js.map +1 -1
  40. package/build/media-text/edit.js +2 -1
  41. package/build/media-text/edit.js.map +1 -1
  42. package/build/media-text/media-container.js +1 -1
  43. package/build/media-text/media-container.js.map +1 -1
  44. package/build/navigation/edit/index.js +68 -123
  45. package/build/navigation/edit/index.js.map +1 -1
  46. package/build/navigation/edit/navigation-menu-selector.js +11 -14
  47. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  48. package/build/navigation/edit/placeholder/index.js +4 -2
  49. package/build/navigation/edit/placeholder/index.js.map +1 -1
  50. package/build/navigation/edit/responsive-wrapper.js +13 -3
  51. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  52. package/build/navigation/edit/use-create-navigation-menu.js +5 -1
  53. package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
  54. package/build/navigation/edit/use-inner-blocks.js +43 -0
  55. package/build/navigation/edit/use-inner-blocks.js.map +1 -0
  56. package/build/navigation/edit/utils.js +28 -0
  57. package/build/navigation/edit/utils.js.map +1 -0
  58. package/build/navigation/use-navigation-menu.js +7 -3
  59. package/build/navigation/use-navigation-menu.js.map +1 -1
  60. package/build/post-author/edit.js +5 -2
  61. package/build/post-author/edit.js.map +1 -1
  62. package/build/post-author-biography/edit.js +7 -1
  63. package/build/post-author-biography/edit.js.map +1 -1
  64. package/build/post-content/edit.js +4 -2
  65. package/build/post-content/edit.js.map +1 -1
  66. package/build/post-featured-image/edit.js +16 -2
  67. package/build/post-featured-image/edit.js.map +1 -1
  68. package/build/post-featured-image/index.js +9 -0
  69. package/build/post-featured-image/index.js.map +1 -1
  70. package/build/query/edit/inspector-controls/index.js +42 -9
  71. package/build/query/edit/inspector-controls/index.js.map +1 -1
  72. package/build/query/edit/inspector-controls/taxonomy-controls.js +21 -14
  73. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  74. package/build/query-title/edit.js +20 -7
  75. package/build/query-title/edit.js.map +1 -1
  76. package/build/query-title/index.js +4 -0
  77. package/build/query-title/index.js.map +1 -1
  78. package/build/query-title/variations.js +10 -0
  79. package/build/query-title/variations.js.map +1 -1
  80. package/build/quote/transforms.js +2 -2
  81. package/build/quote/transforms.js.map +1 -1
  82. package/build/separator/edit.js +1 -1
  83. package/build/separator/edit.js.map +1 -1
  84. package/build/social-links/edit.js +1 -0
  85. package/build/social-links/edit.js.map +1 -1
  86. package/build/template-part/edit/index.js +4 -2
  87. package/build/template-part/edit/index.js.map +1 -1
  88. package/build-module/archives/edit.js +7 -0
  89. package/build-module/archives/edit.js.map +1 -1
  90. package/build-module/archives/index.js +4 -0
  91. package/build-module/archives/index.js.map +1 -1
  92. package/build-module/block/edit.js +5 -3
  93. package/build-module/block/edit.js.map +1 -1
  94. package/build-module/block/edit.native.js +5 -3
  95. package/build-module/block/edit.native.js.map +1 -1
  96. package/build-module/calendar/edit.js +12 -4
  97. package/build-module/calendar/edit.js.map +1 -1
  98. package/build-module/columns/edit.native.js +3 -2
  99. package/build-module/columns/edit.native.js.map +1 -1
  100. package/build-module/cover/edit/resizable-cover.js +6 -0
  101. package/build-module/cover/edit/resizable-cover.js.map +1 -1
  102. package/build-module/group/transforms.js +5 -0
  103. package/build-module/group/transforms.js.map +1 -1
  104. package/build-module/index.native.js +16 -4
  105. package/build-module/index.native.js.map +1 -1
  106. package/build-module/list/index.js +1 -1
  107. package/build-module/list/index.js.map +1 -1
  108. package/build-module/list/v2/edit.js +15 -5
  109. package/build-module/list/v2/edit.js.map +1 -1
  110. package/build-module/list/v2/tag-name.js +21 -0
  111. package/build-module/list/v2/tag-name.js.map +1 -0
  112. package/build-module/list/v2/tag-name.native.js +21 -0
  113. package/build-module/list/v2/tag-name.native.js.map +1 -0
  114. package/build-module/list/v2/transforms.js +1 -10
  115. package/build-module/list/v2/transforms.js.map +1 -1
  116. package/build-module/list-item/edit.js +1 -3
  117. package/build-module/list-item/edit.js.map +1 -1
  118. package/build-module/list-item/edit.native.js +141 -0
  119. package/build-module/list-item/edit.native.js.map +1 -0
  120. package/build-module/list-item/icons.native.js +37 -0
  121. package/build-module/list-item/icons.native.js.map +1 -0
  122. package/build-module/list-item/list-style-type.native.js +124 -0
  123. package/build-module/list-item/list-style-type.native.js.map +1 -0
  124. package/build-module/media-text/deprecated.js +189 -65
  125. package/build-module/media-text/deprecated.js.map +1 -1
  126. package/build-module/media-text/edit.js +2 -1
  127. package/build-module/media-text/edit.js.map +1 -1
  128. package/build-module/media-text/media-container.js +1 -1
  129. package/build-module/media-text/media-container.js.map +1 -1
  130. package/build-module/navigation/edit/index.js +66 -122
  131. package/build-module/navigation/edit/index.js.map +1 -1
  132. package/build-module/navigation/edit/navigation-menu-selector.js +12 -15
  133. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  134. package/build-module/navigation/edit/placeholder/index.js +4 -2
  135. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  136. package/build-module/navigation/edit/responsive-wrapper.js +12 -3
  137. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  138. package/build-module/navigation/edit/use-create-navigation-menu.js +5 -1
  139. package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
  140. package/build-module/navigation/edit/use-inner-blocks.js +33 -0
  141. package/build-module/navigation/edit/use-inner-blocks.js.map +1 -0
  142. package/build-module/navigation/edit/utils.js +21 -0
  143. package/build-module/navigation/edit/utils.js.map +1 -0
  144. package/build-module/navigation/use-navigation-menu.js +7 -3
  145. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  146. package/build-module/post-author/edit.js +5 -2
  147. package/build-module/post-author/edit.js.map +1 -1
  148. package/build-module/post-author-biography/edit.js +6 -1
  149. package/build-module/post-author-biography/edit.js.map +1 -1
  150. package/build-module/post-content/edit.js +5 -3
  151. package/build-module/post-content/edit.js.map +1 -1
  152. package/build-module/post-featured-image/edit.js +17 -3
  153. package/build-module/post-featured-image/edit.js.map +1 -1
  154. package/build-module/post-featured-image/index.js +9 -0
  155. package/build-module/post-featured-image/index.js.map +1 -1
  156. package/build-module/query/edit/inspector-controls/index.js +42 -9
  157. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  158. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +16 -12
  159. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  160. package/build-module/query-title/edit.js +20 -8
  161. package/build-module/query-title/edit.js.map +1 -1
  162. package/build-module/query-title/index.js +4 -0
  163. package/build-module/query-title/index.js.map +1 -1
  164. package/build-module/query-title/variations.js +10 -0
  165. package/build-module/query-title/variations.js.map +1 -1
  166. package/build-module/quote/transforms.js +3 -3
  167. package/build-module/quote/transforms.js.map +1 -1
  168. package/build-module/separator/edit.js +1 -1
  169. package/build-module/separator/edit.js.map +1 -1
  170. package/build-module/social-links/edit.js +1 -0
  171. package/build-module/social-links/edit.js.map +1 -1
  172. package/build-module/template-part/edit/index.js +5 -3
  173. package/build-module/template-part/edit/index.js.map +1 -1
  174. package/build-style/editor-rtl.css +10 -0
  175. package/build-style/editor.css +10 -0
  176. package/build-style/latest-posts/editor-rtl.css +3 -0
  177. package/build-style/latest-posts/editor.css +3 -0
  178. package/build-style/navigation/style-rtl.css +17 -19
  179. package/build-style/navigation/style.css +17 -19
  180. package/build-style/query/editor-rtl.css +7 -0
  181. package/build-style/query/editor.css +7 -0
  182. package/build-style/query-pagination/style-rtl.css +6 -0
  183. package/build-style/query-pagination/style.css +6 -0
  184. package/build-style/search/style-rtl.css +2 -0
  185. package/build-style/search/style.css +2 -0
  186. package/build-style/style-rtl.css +26 -19
  187. package/build-style/style.css +26 -19
  188. package/build-style/tag-cloud/style-rtl.css +1 -0
  189. package/build-style/tag-cloud/style.css +1 -0
  190. package/package.json +28 -29
  191. package/src/archives/block.json +4 -0
  192. package/src/archives/edit.js +12 -1
  193. package/src/archives/index.php +5 -3
  194. package/src/audio/test/__snapshots__/edit.native.js.snap +16 -2
  195. package/src/block/edit.js +4 -4
  196. package/src/block/edit.native.js +4 -4
  197. package/src/calendar/edit.js +11 -4
  198. package/src/columns/edit.native.js +4 -2
  199. package/src/cover/edit/resizable-cover.js +6 -0
  200. package/src/cover/index.php +2 -2
  201. package/src/file/test/__snapshots__/edit.native.js.snap +32 -4
  202. package/src/group/transforms.js +7 -0
  203. package/src/home-link/index.php +8 -17
  204. package/src/image/test/edit.native.js +6 -10
  205. package/src/index.native.js +15 -2
  206. package/src/latest-posts/editor.scss +5 -0
  207. package/src/list/index.js +1 -1
  208. package/src/list/test/__snapshots__/edit.native.js.snap +133 -0
  209. package/src/list/test/edit.native.js +511 -7
  210. package/src/list/v2/edit.js +12 -4
  211. package/src/list/v2/tag-name.js +13 -0
  212. package/src/list/v2/tag-name.native.js +12 -0
  213. package/src/list/v2/transforms.js +1 -9
  214. package/src/list-item/edit.js +1 -1
  215. package/src/list-item/edit.native.js +148 -0
  216. package/src/list-item/icons.native.js +34 -0
  217. package/src/list-item/list-style-type.native.js +139 -0
  218. package/src/list-item/style.native.scss +45 -0
  219. package/src/media-text/deprecated.js +561 -415
  220. package/src/media-text/edit.js +1 -0
  221. package/src/media-text/media-container.js +3 -1
  222. package/src/media-text/test/media-container.js +24 -0
  223. package/src/navigation/edit/index.js +83 -164
  224. package/src/navigation/edit/navigation-menu-selector.js +12 -26
  225. package/src/navigation/edit/placeholder/index.js +4 -2
  226. package/src/navigation/edit/responsive-wrapper.js +24 -3
  227. package/src/navigation/edit/use-create-navigation-menu.js +4 -0
  228. package/src/navigation/edit/use-inner-blocks.js +39 -0
  229. package/src/navigation/edit/utils.js +30 -0
  230. package/src/navigation/index.php +6 -0
  231. package/src/navigation/style.scss +12 -22
  232. package/src/navigation/use-navigation-menu.js +9 -5
  233. package/src/navigation-link/index.php +1 -1
  234. package/src/navigation-submenu/index.php +1 -1
  235. package/src/page-list/index.php +4 -4
  236. package/src/post-author/edit.js +6 -3
  237. package/src/post-author-biography/edit.js +4 -1
  238. package/src/post-content/edit.js +4 -4
  239. package/src/post-featured-image/block.json +9 -0
  240. package/src/post-featured-image/edit.js +23 -1
  241. package/src/post-featured-image/index.php +3 -1
  242. package/src/post-title/index.php +2 -1
  243. package/src/preformatted/test/__snapshots__/edit.native.js.snap +16 -2
  244. package/src/query/edit/inspector-controls/index.js +129 -65
  245. package/src/query/edit/inspector-controls/taxonomy-controls.js +17 -10
  246. package/src/query/editor.scss +9 -0
  247. package/src/query-pagination/style.scss +14 -0
  248. package/src/query-title/block.json +4 -0
  249. package/src/query-title/edit.js +33 -6
  250. package/src/query-title/index.php +17 -1
  251. package/src/query-title/variations.js +13 -0
  252. package/src/quote/transforms.js +3 -7
  253. package/src/search/style.scss +2 -0
  254. package/src/search/test/__snapshots__/edit.native.js.snap +56 -7
  255. package/src/separator/edit.js +1 -1
  256. package/src/separator/test/edit.js +5 -3
  257. package/src/site-title/index.php +8 -9
  258. package/src/social-link/index.php +1 -1
  259. package/src/social-links/edit.js +1 -0
  260. package/src/tag-cloud/style.scss +1 -0
  261. package/src/template-part/edit/index.js +4 -4
@@ -0,0 +1,148 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { View } from 'react-native';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import {
10
+ RichText,
11
+ useBlockProps,
12
+ useInnerBlocksProps,
13
+ BlockControls,
14
+ store as blockEditorStore,
15
+ } from '@wordpress/block-editor';
16
+ import { __ } from '@wordpress/i18n';
17
+ import { useSelect } from '@wordpress/data';
18
+ import { useState, useCallback } from '@wordpress/element';
19
+
20
+ /**
21
+ * Internal dependencies
22
+ */
23
+ import { useSplit, useMerge } from './hooks';
24
+ import { convertToListItems } from './utils';
25
+ import { IndentUI } from './edit.js';
26
+ import styles from './style.scss';
27
+ import ListStyleType from './list-style-type';
28
+
29
+ export default function ListItemEdit( {
30
+ attributes,
31
+ setAttributes,
32
+ onReplace,
33
+ clientId,
34
+ style,
35
+ } ) {
36
+ const [ contentWidth, setContentWidth ] = useState();
37
+ const { placeholder, content } = attributes;
38
+ const {
39
+ blockIndex,
40
+ hasInnerBlocks,
41
+ indentationLevel,
42
+ numberOfListItems,
43
+ ordered,
44
+ reversed,
45
+ start,
46
+ } = useSelect(
47
+ ( select ) => {
48
+ const {
49
+ getBlockAttributes,
50
+ getBlockCount,
51
+ getBlockIndex,
52
+ getBlockParentsByBlockName,
53
+ getBlockRootClientId,
54
+ } = select( blockEditorStore );
55
+ const currentIdentationLevel = getBlockParentsByBlockName(
56
+ clientId,
57
+ 'core/list-item',
58
+ true
59
+ ).length;
60
+ const currentBlockIndex = getBlockIndex( clientId );
61
+ const blockWithInnerBlocks = getBlockCount( clientId ) > 0;
62
+ const rootClientId = getBlockRootClientId( clientId );
63
+ const blockAttributes = getBlockAttributes( rootClientId );
64
+ const totalListItems = getBlockCount( rootClientId );
65
+ const {
66
+ ordered: isOrdered,
67
+ reversed: isReversed,
68
+ start: startValue,
69
+ } = blockAttributes || {};
70
+
71
+ return {
72
+ blockIndex: currentBlockIndex,
73
+ hasInnerBlocks: blockWithInnerBlocks,
74
+ indentationLevel: currentIdentationLevel,
75
+ numberOfListItems: totalListItems,
76
+ ordered: isOrdered,
77
+ reversed: isReversed,
78
+ start: startValue,
79
+ };
80
+ },
81
+ [ clientId ]
82
+ );
83
+
84
+ const blockProps = useBlockProps( {
85
+ ...( hasInnerBlocks && styles[ 'wp-block-list-item__nested-blocks' ] ),
86
+ } );
87
+ const innerBlocksProps = useInnerBlocksProps( blockProps, {
88
+ allowedBlocks: [ 'core/list' ],
89
+ renderAppender: false,
90
+ } );
91
+
92
+ const onSplit = useSplit( clientId );
93
+ const onMerge = useMerge( clientId );
94
+ const onLayout = useCallback( ( { nativeEvent } ) => {
95
+ setContentWidth( ( prevState ) => {
96
+ const { width } = nativeEvent.layout;
97
+
98
+ if ( ! prevState || prevState.width !== width ) {
99
+ return Math.floor( width );
100
+ }
101
+ return prevState;
102
+ } );
103
+ }, [] );
104
+
105
+ return (
106
+ <View style={ styles[ 'wp-block-list-item__list-item-parent' ] }>
107
+ <View style={ styles[ 'wp-block-list-item__list-item' ] }>
108
+ <View style={ styles[ 'wp-block-list-item__list-item-icon' ] }>
109
+ <ListStyleType
110
+ blockIndex={ blockIndex }
111
+ indentationLevel={ indentationLevel }
112
+ numberOfListItems={ numberOfListItems }
113
+ ordered={ ordered }
114
+ reversed={ reversed }
115
+ start={ start }
116
+ style={ style }
117
+ />
118
+ </View>
119
+ <View
120
+ style={ styles[ 'wp-block-list-item__list-item-content' ] }
121
+ onLayout={ onLayout }
122
+ >
123
+ <RichText
124
+ identifier="content"
125
+ tagName="p"
126
+ onChange={ ( nextContent ) =>
127
+ setAttributes( { content: nextContent } )
128
+ }
129
+ value={ content }
130
+ placeholder={ placeholder || __( 'List' ) }
131
+ onSplit={ onSplit }
132
+ onMerge={ onMerge }
133
+ onReplace={ ( blocks, ...args ) => {
134
+ onReplace( convertToListItems( blocks ), ...args );
135
+ } }
136
+ style={ style }
137
+ deleteEnter={ true }
138
+ containerWidth={ contentWidth }
139
+ />
140
+ </View>
141
+ </View>
142
+ <View { ...innerBlocksProps }></View>
143
+ <BlockControls group="block">
144
+ <IndentUI clientId={ clientId } />
145
+ </BlockControls>
146
+ </View>
147
+ );
148
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { SVG, Rect } from '@wordpress/components';
5
+
6
+ export const circle = ( size, color ) => (
7
+ <SVG fill="none" xmlns="http://www.w3.org/2000/svg">
8
+ <Rect width={ size } height={ size } rx={ size / 2 } fill={ color } />
9
+ </SVG>
10
+ );
11
+
12
+ export const circleOutline = ( size, color ) => (
13
+ <SVG
14
+ width={ size }
15
+ height={ size }
16
+ fill="none"
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ >
19
+ <Rect
20
+ x="0.5"
21
+ y="0.5"
22
+ width={ size - 1 }
23
+ height={ size - 1 }
24
+ rx={ size / 2 }
25
+ stroke={ color }
26
+ />
27
+ </SVG>
28
+ );
29
+
30
+ export const square = ( size, color ) => (
31
+ <SVG fill="none" xmlns="http://www.w3.org/2000/svg">
32
+ <Rect width={ size } height={ size } fill={ color } />
33
+ </SVG>
34
+ );
@@ -0,0 +1,139 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { View, Text } from 'react-native';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { Icon } from '@wordpress/components';
10
+ import { Platform } from '@wordpress/element';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import styles from './style.scss';
16
+ import { circle, circleOutline, square } from './icons';
17
+
18
+ const DEFAULT_ICON_SIZE = 6;
19
+
20
+ function getListNumberIndex( start, blockIndex, reversed, numberOfListItems ) {
21
+ if ( start ) {
22
+ return reversed
23
+ ? numberOfListItems - 1 + start - blockIndex
24
+ : start + blockIndex;
25
+ }
26
+
27
+ if ( reversed ) {
28
+ return numberOfListItems - blockIndex;
29
+ }
30
+
31
+ return blockIndex + 1;
32
+ }
33
+
34
+ function OrderedList( {
35
+ blockIndex,
36
+ color,
37
+ fontSize,
38
+ numberOfListItems,
39
+ reversed,
40
+ start,
41
+ style,
42
+ } ) {
43
+ const orderedStyles = [
44
+ styles[ 'wp-block-list-item__list-item-container--ordered' ],
45
+ Platform.isIOS &&
46
+ styles[ 'wp-block-list-item__list-item-ordered--default' ],
47
+ Platform.isIOS &&
48
+ style?.fontSize &&
49
+ styles[ 'wp-block-list-item__list-item-ordered--custom' ],
50
+ ];
51
+ const numberStyle = [ { fontSize, color } ];
52
+
53
+ const currentIndex = getListNumberIndex(
54
+ start,
55
+ blockIndex,
56
+ reversed,
57
+ numberOfListItems
58
+ );
59
+
60
+ return (
61
+ <View style={ orderedStyles }>
62
+ <Text style={ numberStyle }>{ currentIndex }.</Text>
63
+ </View>
64
+ );
65
+ }
66
+
67
+ function IconList( { fontSize, color, defaultFontSize, indentationLevel } ) {
68
+ const iconSize = parseInt(
69
+ ( fontSize * DEFAULT_ICON_SIZE ) / defaultFontSize,
70
+ 10
71
+ );
72
+
73
+ let listIcon = circle( iconSize, color );
74
+ if ( indentationLevel === 1 ) {
75
+ listIcon = circleOutline( iconSize, color );
76
+ } else if ( indentationLevel > 1 ) {
77
+ listIcon = square( iconSize, color );
78
+ }
79
+
80
+ const listStyles = [
81
+ styles[ 'wp-block-list-item__list-item-container' ],
82
+ { marginTop: fontSize / 2 },
83
+ ];
84
+
85
+ return (
86
+ <View style={ listStyles }>
87
+ <Icon icon={ listIcon } size={ iconSize } />
88
+ </View>
89
+ );
90
+ }
91
+
92
+ export default function ListStyleType( {
93
+ blockIndex,
94
+ indentationLevel,
95
+ numberOfListItems,
96
+ ordered,
97
+ reversed,
98
+ start,
99
+ style,
100
+ } ) {
101
+ let defaultFontSize =
102
+ styles[ 'wp-block-list-item__list-item--default' ].fontSize;
103
+
104
+ if ( style?.baseColors?.typography?.fontSize ) {
105
+ defaultFontSize = parseInt( style.baseColors.typography.fontSize, 10 );
106
+ }
107
+
108
+ const fontSize = parseInt(
109
+ style?.fontSize ? style.fontSize : defaultFontSize,
110
+ 10
111
+ );
112
+ const defaultColor = style?.baseColors?.color?.text
113
+ ? style.baseColors.color.text
114
+ : styles[ 'wp-block-list-item__list-item--default' ].color;
115
+ const color = style?.color ? style.color : defaultColor;
116
+
117
+ if ( ordered ) {
118
+ return (
119
+ <OrderedList
120
+ blockIndex={ blockIndex }
121
+ color={ color }
122
+ fontSize={ fontSize }
123
+ numberOfListItems={ numberOfListItems }
124
+ reversed={ reversed }
125
+ start={ start }
126
+ style={ style }
127
+ />
128
+ );
129
+ }
130
+
131
+ return (
132
+ <IconList
133
+ color={ color }
134
+ defaultFontSize={ defaultFontSize }
135
+ fontSize={ fontSize }
136
+ indentationLevel={ indentationLevel }
137
+ />
138
+ );
139
+ }
@@ -0,0 +1,45 @@
1
+ .wp-block-list-item__list-item-parent {
2
+ margin-left: $solid-border-space;
3
+ margin-right: $solid-border-space;
4
+ }
5
+
6
+ .wp-block-list-item__nested-blocks {
7
+ margin-top: 14;
8
+ }
9
+
10
+ .wp-block-list-item__list-item {
11
+ flex: 1;
12
+ flex-direction: row;
13
+ }
14
+
15
+ .wp-block-list-item__list-item-icon {
16
+ align-items: center;
17
+ flex-grow: 0;
18
+ }
19
+
20
+ .wp-block-list-item__list-item-content {
21
+ flex-grow: 1;
22
+ flex-shrink: 1;
23
+ background-color: transparent;
24
+ }
25
+
26
+ .wp-block-list-item__list-item--default {
27
+ color: $black;
28
+ font-size: $editor-font-size;
29
+ }
30
+
31
+ .wp-block-list-item__list-item-ordered--default {
32
+ margin-top: 2;
33
+ }
34
+
35
+ .wp-block-list-item__list-item-ordered--custom {
36
+ margin-top: 3;
37
+ }
38
+
39
+ .wp-block-list-item__list-item-container--ordered {
40
+ margin-right: 3;
41
+ }
42
+
43
+ .wp-block-list-item__list-item-container {
44
+ margin-right: 8;
45
+ }