@wordpress/block-library 8.26.0 → 8.27.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 (254) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/avatar/edit.js +2 -2
  3. package/build/avatar/edit.js.map +1 -1
  4. package/build/block/edit.js +76 -13
  5. package/build/block/edit.js.map +1 -1
  6. package/build/block/{v1/edit.native.js → edit.native.js} +4 -4
  7. package/build/block/edit.native.js.map +1 -0
  8. package/build/block/index.js +5 -3
  9. package/build/block/index.js.map +1 -1
  10. package/build/button/edit.js +24 -6
  11. package/build/button/edit.js.map +1 -1
  12. package/build/button/index.js +1 -0
  13. package/build/button/index.js.map +1 -1
  14. package/build/button/save.js +3 -1
  15. package/build/button/save.js.map +1 -1
  16. package/build/cover/edit.native.js +1 -0
  17. package/build/cover/edit.native.js.map +1 -1
  18. package/build/embed/edit.js +3 -2
  19. package/build/embed/edit.js.map +1 -1
  20. package/build/file/index.js +0 -1
  21. package/build/file/index.js.map +1 -1
  22. package/build/footnotes/edit.js +2 -1
  23. package/build/footnotes/edit.js.map +1 -1
  24. package/build/footnotes/format.js +17 -19
  25. package/build/footnotes/format.js.map +1 -1
  26. package/build/heading/edit.js +2 -1
  27. package/build/heading/edit.js.map +1 -1
  28. package/build/heading/edit.native.js +141 -0
  29. package/build/heading/edit.native.js.map +1 -0
  30. package/build/heading/index.js +1 -0
  31. package/build/heading/index.js.map +1 -1
  32. package/build/image/edit.js +8 -4
  33. package/build/image/edit.js.map +1 -1
  34. package/build/image/image.js +33 -7
  35. package/build/image/image.js.map +1 -1
  36. package/build/image/index.js +6 -3
  37. package/build/image/index.js.map +1 -1
  38. package/build/more/index.js +4 -0
  39. package/build/more/index.js.map +1 -1
  40. package/build/navigation/edit/index.js +2 -2
  41. package/build/navigation/edit/index.js.map +1 -1
  42. package/build/navigation/index.js +0 -1
  43. package/build/navigation/index.js.map +1 -1
  44. package/build/paragraph/edit.js +2 -1
  45. package/build/paragraph/edit.js.map +1 -1
  46. package/build/paragraph/index.js +1 -2
  47. package/build/paragraph/index.js.map +1 -1
  48. package/build/paragraph/transforms.js +1 -2
  49. package/build/paragraph/transforms.js.map +1 -1
  50. package/build/post-content/edit.js +2 -2
  51. package/build/post-content/edit.js.map +1 -1
  52. package/build/post-date/edit.js +1 -1
  53. package/build/post-date/edit.js.map +1 -1
  54. package/build/post-navigation-link/edit.js +43 -2
  55. package/build/post-navigation-link/edit.js.map +1 -1
  56. package/build/post-navigation-link/index.js +8 -0
  57. package/build/post-navigation-link/index.js.map +1 -1
  58. package/build/pullquote/index.js +4 -0
  59. package/build/pullquote/index.js.map +1 -1
  60. package/build/query/edit/inspector-controls/index.js +3 -3
  61. package/build/query/edit/inspector-controls/index.js.map +1 -1
  62. package/build/query/edit/query-content.js +2 -2
  63. package/build/query/edit/query-content.js.map +1 -1
  64. package/build/query/edit/query-placeholder.js +6 -7
  65. package/build/query/edit/query-placeholder.js.map +1 -1
  66. package/build/query/index.js +1 -2
  67. package/build/query/index.js.map +1 -1
  68. package/build/query/variations.js +8 -1
  69. package/build/query/variations.js.map +1 -1
  70. package/build/query/view.js +31 -12
  71. package/build/query/view.js.map +1 -1
  72. package/build/search/index.js +0 -1
  73. package/build/search/index.js.map +1 -1
  74. package/build/table-of-contents/hooks.js +2 -2
  75. package/build/table-of-contents/hooks.js.map +1 -1
  76. package/build/template-part/edit/advanced-controls.js +1 -4
  77. package/build/template-part/edit/advanced-controls.js.map +1 -1
  78. package/build/template-part/edit/index.js +39 -17
  79. package/build/template-part/edit/index.js.map +1 -1
  80. package/build/video/edit.native.js +7 -2
  81. package/build/video/edit.native.js.map +1 -1
  82. package/build/video/transforms.js +17 -0
  83. package/build/video/transforms.js.map +1 -1
  84. package/build-module/avatar/edit.js +2 -2
  85. package/build-module/avatar/edit.js.map +1 -1
  86. package/build-module/block/edit.js +76 -13
  87. package/build-module/block/edit.js.map +1 -1
  88. package/build-module/block/{v1/edit.native.js → edit.native.js} +3 -3
  89. package/build-module/block/edit.native.js.map +1 -0
  90. package/build-module/block/index.js +5 -3
  91. package/build-module/block/index.js.map +1 -1
  92. package/build-module/button/edit.js +25 -7
  93. package/build-module/button/edit.js.map +1 -1
  94. package/build-module/button/index.js +1 -0
  95. package/build-module/button/index.js.map +1 -1
  96. package/build-module/button/save.js +4 -2
  97. package/build-module/button/save.js.map +1 -1
  98. package/build-module/cover/edit.native.js +1 -0
  99. package/build-module/cover/edit.native.js.map +1 -1
  100. package/build-module/embed/edit.js +3 -2
  101. package/build-module/embed/edit.js.map +1 -1
  102. package/build-module/file/index.js +0 -1
  103. package/build-module/file/index.js.map +1 -1
  104. package/build-module/footnotes/edit.js +2 -1
  105. package/build-module/footnotes/edit.js.map +1 -1
  106. package/build-module/footnotes/format.js +17 -19
  107. package/build-module/footnotes/format.js.map +1 -1
  108. package/build-module/heading/edit.js +3 -2
  109. package/build-module/heading/edit.js.map +1 -1
  110. package/build-module/heading/edit.native.js +132 -0
  111. package/build-module/heading/edit.native.js.map +1 -0
  112. package/build-module/heading/index.js +1 -0
  113. package/build-module/heading/index.js.map +1 -1
  114. package/build-module/image/edit.js +9 -5
  115. package/build-module/image/edit.js.map +1 -1
  116. package/build-module/image/image.js +33 -7
  117. package/build-module/image/image.js.map +1 -1
  118. package/build-module/image/index.js +6 -3
  119. package/build-module/image/index.js.map +1 -1
  120. package/build-module/more/index.js +4 -0
  121. package/build-module/more/index.js.map +1 -1
  122. package/build-module/navigation/edit/index.js +1 -1
  123. package/build-module/navigation/edit/index.js.map +1 -1
  124. package/build-module/navigation/index.js +0 -1
  125. package/build-module/navigation/index.js.map +1 -1
  126. package/build-module/paragraph/edit.js +3 -2
  127. package/build-module/paragraph/edit.js.map +1 -1
  128. package/build-module/paragraph/index.js +1 -2
  129. package/build-module/paragraph/index.js.map +1 -1
  130. package/build-module/paragraph/transforms.js +1 -2
  131. package/build-module/paragraph/transforms.js.map +1 -1
  132. package/build-module/post-content/edit.js +1 -1
  133. package/build-module/post-content/edit.js.map +1 -1
  134. package/build-module/post-date/edit.js +1 -1
  135. package/build-module/post-date/edit.js.map +1 -1
  136. package/build-module/post-navigation-link/edit.js +44 -3
  137. package/build-module/post-navigation-link/edit.js.map +1 -1
  138. package/build-module/post-navigation-link/index.js +8 -0
  139. package/build-module/post-navigation-link/index.js.map +1 -1
  140. package/build-module/pullquote/index.js +4 -0
  141. package/build-module/pullquote/index.js.map +1 -1
  142. package/build-module/query/edit/inspector-controls/index.js +4 -4
  143. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  144. package/build-module/query/edit/query-content.js +2 -2
  145. package/build-module/query/edit/query-content.js.map +1 -1
  146. package/build-module/query/edit/query-placeholder.js +7 -8
  147. package/build-module/query/edit/query-placeholder.js.map +1 -1
  148. package/build-module/query/index.js +1 -2
  149. package/build-module/query/index.js.map +1 -1
  150. package/build-module/query/variations.js +8 -1
  151. package/build-module/query/variations.js.map +1 -1
  152. package/build-module/query/view.js +30 -9
  153. package/build-module/query/view.js.map +1 -1
  154. package/build-module/search/index.js +0 -1
  155. package/build-module/search/index.js.map +1 -1
  156. package/build-module/table-of-contents/hooks.js +2 -2
  157. package/build-module/table-of-contents/hooks.js.map +1 -1
  158. package/build-module/template-part/edit/advanced-controls.js +1 -4
  159. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  160. package/build-module/template-part/edit/index.js +38 -16
  161. package/build-module/template-part/edit/index.js.map +1 -1
  162. package/build-module/video/edit.native.js +7 -2
  163. package/build-module/video/edit.native.js.map +1 -1
  164. package/build-module/video/transforms.js +17 -0
  165. package/build-module/video/transforms.js.map +1 -1
  166. package/build-style/common-rtl.css +4 -2
  167. package/build-style/common.css +4 -2
  168. package/build-style/cover/style-rtl.css +1 -2
  169. package/build-style/cover/style.css +1 -2
  170. package/build-style/editor-rtl.css +6 -4
  171. package/build-style/editor.css +6 -4
  172. package/build-style/gallery/style-rtl.css +2 -4
  173. package/build-style/gallery/style.css +2 -4
  174. package/build-style/image/editor-rtl.css +6 -0
  175. package/build-style/image/editor.css +6 -0
  176. package/build-style/page-list/editor-rtl.css +0 -4
  177. package/build-style/page-list/editor.css +0 -4
  178. package/build-style/pullquote/style-rtl.css +10 -1
  179. package/build-style/pullquote/style.css +10 -1
  180. package/build-style/search/style-rtl.css +2 -1
  181. package/build-style/search/style.css +2 -1
  182. package/build-style/style-rtl.css +19 -11
  183. package/build-style/style.css +19 -11
  184. package/build-style/video/style-rtl.css +1 -2
  185. package/build-style/video/style.css +1 -2
  186. package/package.json +34 -32
  187. package/src/avatar/edit.js +16 -18
  188. package/src/block/block.json +3 -0
  189. package/src/block/edit.js +102 -20
  190. package/src/block/{v1/edit.native.js → edit.native.js} +4 -4
  191. package/src/block/index.js +2 -3
  192. package/src/block/index.php +3 -31
  193. package/src/button/block.json +1 -0
  194. package/src/button/edit.js +76 -43
  195. package/src/button/save.js +3 -0
  196. package/src/buttons/test/__snapshots__/edit.native.js.snap +6 -0
  197. package/src/buttons/test/edit.native.js +49 -0
  198. package/src/cover/edit.native.js +1 -0
  199. package/src/embed/edit.js +3 -2
  200. package/src/file/block.json +0 -1
  201. package/src/file/index.php +11 -57
  202. package/src/footnotes/edit.js +2 -1
  203. package/src/footnotes/format.js +34 -31
  204. package/src/footnotes/index.php +20 -11
  205. package/src/gallery/index.php +0 -3
  206. package/src/heading/block.json +1 -0
  207. package/src/heading/edit.js +18 -14
  208. package/src/heading/edit.native.js +144 -0
  209. package/src/image/block.json +7 -3
  210. package/src/image/edit.js +19 -6
  211. package/src/image/editor.scss +6 -1
  212. package/src/image/image.js +101 -42
  213. package/src/image/index.js +6 -0
  214. package/src/image/index.php +14 -51
  215. package/src/more/index.js +6 -0
  216. package/src/navigation/block.json +0 -1
  217. package/src/navigation/edit/index.js +2 -2
  218. package/src/navigation/index.php +777 -28
  219. package/src/navigation-link/index.php +78 -16
  220. package/src/page-list/editor.scss +0 -4
  221. package/src/paragraph/block.json +1 -2
  222. package/src/paragraph/edit.js +23 -19
  223. package/src/post-content/edit.js +2 -2
  224. package/src/post-date/edit.js +38 -33
  225. package/src/post-navigation-link/block.json +8 -0
  226. package/src/post-navigation-link/edit.js +63 -1
  227. package/src/post-navigation-link/index.php +17 -3
  228. package/src/post-terms/index.php +13 -4
  229. package/src/pullquote/block.json +4 -0
  230. package/src/pullquote/style.scss +13 -1
  231. package/src/query/block.json +1 -2
  232. package/src/query/edit/inspector-controls/index.js +137 -146
  233. package/src/query/edit/query-content.js +9 -7
  234. package/src/query/edit/query-placeholder.js +11 -11
  235. package/src/query/index.php +33 -71
  236. package/src/query/variations.js +4 -0
  237. package/src/query/view.js +24 -19
  238. package/src/search/block.json +0 -1
  239. package/src/search/index.php +18 -36
  240. package/src/table-of-contents/hooks.js +2 -2
  241. package/src/template-part/edit/advanced-controls.js +2 -3
  242. package/src/template-part/edit/index.js +77 -50
  243. package/src/template-part/index.php +2 -2
  244. package/src/video/edit.native.js +5 -2
  245. package/src/video/test/edit.native.js +38 -0
  246. package/src/video/transforms.js +32 -0
  247. package/tsconfig.json +1 -0
  248. package/build/block/v1/edit.js +0 -116
  249. package/build/block/v1/edit.js.map +0 -1
  250. package/build/block/v1/edit.native.js.map +0 -1
  251. package/build-module/block/v1/edit.js +0 -108
  252. package/build-module/block/v1/edit.js.map +0 -1
  253. package/build-module/block/v1/edit.native.js.map +0 -1
  254. package/src/block/v1/edit.js +0 -163
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * @return string The search block markup.
18
18
  */
19
- function render_block_core_search( $attributes, $content, $block ) {
19
+ function render_block_core_search( $attributes ) {
20
20
  // Older versions of the Search block defaulted the label and buttonText
21
21
  // attributes to `__( 'Search' )` meaning that many posts contain `<!--
22
22
  // wp:search /-->`. Support these by defaulting an undefined label and
@@ -77,39 +77,19 @@ function render_block_core_search( $attributes, $content, $block ) {
77
77
  $input->set_attribute( 'value', get_search_query() );
78
78
  $input->set_attribute( 'placeholder', $attributes['placeholder'] );
79
79
 
80
+ // If it's interactive, enqueue the script module and add the directives.
80
81
  $is_expandable_searchfield = 'button-only' === $button_position;
81
82
  if ( $is_expandable_searchfield ) {
83
+ wp_enqueue_script_module( '@wordpress/block-library/search-block' );
84
+
82
85
  $input->set_attribute( 'data-wp-bind--aria-hidden', '!context.isSearchInputVisible' );
83
86
  $input->set_attribute( 'data-wp-bind--tabindex', 'state.tabindex' );
84
- // Adding these attributes manually is needed until the Interactivity API SSR logic is added to core.
87
+
88
+ // Adding these attributes manually is needed until the Interactivity API
89
+ // SSR logic is added to core.
85
90
  $input->set_attribute( 'aria-hidden', 'true' );
86
91
  $input->set_attribute( 'tabindex', '-1' );
87
92
  }
88
-
89
- $is_gutenberg_plugin = defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN;
90
- $script_handles = $block->block_type->view_script_handles;
91
- $view_js_file = 'wp-block-search-view';
92
-
93
- if ( $is_gutenberg_plugin ) {
94
- if ( $is_expandable_searchfield ) {
95
- gutenberg_enqueue_module( '@wordpress/block-library/search-block' );
96
- }
97
- // Remove the view script because we are using the module.
98
- $block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
99
- } else {
100
- // If the script already exists, there is no point in removing it from viewScript.
101
- if ( ! wp_script_is( $view_js_file ) ) {
102
-
103
- // If the script is not needed, and it is still in the `view_script_handles`, remove it.
104
- if ( ! $is_expandable_searchfield && in_array( $view_js_file, $script_handles, true ) ) {
105
- $block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
106
- }
107
- // If the script is needed, but it was previously removed, add it again.
108
- if ( $is_expandable_searchfield && ! in_array( $view_js_file, $script_handles, true ) ) {
109
- $block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
110
- }
111
- }
112
- }
113
93
  }
114
94
 
115
95
  if ( count( $query_params ) > 0 ) {
@@ -159,7 +139,9 @@ function render_block_core_search( $attributes, $content, $block ) {
159
139
  $button->set_attribute( 'data-wp-bind--aria-expanded', 'context.isSearchInputVisible' );
160
140
  $button->set_attribute( 'data-wp-bind--type', 'state.type' );
161
141
  $button->set_attribute( 'data-wp-on--click', 'actions.openSearchInput' );
162
- // Adding these attributes manually is needed until the Interactivity API SSR logic is added to core.
142
+
143
+ // Adding these attributes manually is needed until the Interactivity
144
+ // API SSR logic is added to core.
163
145
  $button->set_attribute( 'aria-label', __( 'Expand search field' ) );
164
146
  $button->set_attribute( 'aria-controls', 'wp-block-search__input-' . $input_id );
165
147
  $button->set_attribute( 'aria-expanded', 'false' );
@@ -181,6 +163,8 @@ function render_block_core_search( $attributes, $content, $block ) {
181
163
  array( 'class' => $classnames )
182
164
  );
183
165
  $form_directives = '';
166
+
167
+ // If it's interactive, add the directives.
184
168
  if ( $is_expandable_searchfield ) {
185
169
  $aria_label_expanded = __( 'Submit Search' );
186
170
  $aria_label_collapsed = __( 'Expand search field' );
@@ -213,14 +197,12 @@ function register_block_core_search() {
213
197
  )
214
198
  );
215
199
 
216
- if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
217
- gutenberg_register_module(
218
- '@wordpress/block-library/search-block',
219
- gutenberg_url( '/build/interactivity/search.min.js' ),
220
- array( '@wordpress/interactivity' ),
221
- defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
222
- );
223
- }
200
+ wp_register_script_module(
201
+ '@wordpress/block-library/search-block',
202
+ gutenberg_url( '/build/interactivity/search.min.js' ),
203
+ array( '@wordpress/interactivity' ),
204
+ defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
205
+ );
224
206
  }
225
207
  add_action( 'init', 'register_block_core_search' );
226
208
 
@@ -17,7 +17,7 @@ function getLatestHeadings( select, clientId ) {
17
17
  getBlockAttributes,
18
18
  getBlockName,
19
19
  getClientIdsWithDescendants,
20
- __experimentalGetGlobalBlocksByName: getGlobalBlocksByName,
20
+ getBlocksByName,
21
21
  } = select( blockEditorStore );
22
22
 
23
23
  // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
@@ -28,7 +28,7 @@ function getLatestHeadings( select, clientId ) {
28
28
  // eslint-disable-next-line @wordpress/data-no-store-string-literals
29
29
  const permalink = select( 'core/editor' ).getPermalink() ?? null;
30
30
 
31
- const isPaginated = getGlobalBlocksByName( 'core/nextpage' ).length !== 0;
31
+ const isPaginated = getBlocksByName( 'core/nextpage' ).length !== 0;
32
32
  const { onlyIncludeCurrentPage } = getBlockAttributes( clientId ) ?? {};
33
33
 
34
34
  // Get the client ids of all blocks in the editor.
@@ -4,7 +4,6 @@
4
4
  import { useEntityProp } from '@wordpress/core-data';
5
5
  import { SelectControl, TextControl } from '@wordpress/components';
6
6
  import { sprintf, __ } from '@wordpress/i18n';
7
- import { InspectorControls } from '@wordpress/block-editor';
8
7
  import { useSelect } from '@wordpress/data';
9
8
 
10
9
  /**
@@ -70,7 +69,7 @@ export function TemplatePartAdvancedControls( {
70
69
  } ) );
71
70
 
72
71
  return (
73
- <InspectorControls group="advanced">
72
+ <>
74
73
  { isEntityAvailable && (
75
74
  <>
76
75
  <TextControl
@@ -124,6 +123,6 @@ export function TemplatePartAdvancedControls( {
124
123
  setAttributes={ setAttributes }
125
124
  />
126
125
  ) }
127
- </InspectorControls>
126
+ </>
128
127
  );
129
128
  }
@@ -7,8 +7,9 @@ import {
7
7
  useBlockProps,
8
8
  Warning,
9
9
  store as blockEditorStore,
10
- __experimentalRecursionProvider as RecursionProvider,
11
- __experimentalUseHasRecursion as useHasRecursion,
10
+ RecursionProvider,
11
+ useHasRecursion,
12
+ InspectorControls,
12
13
  } from '@wordpress/block-editor';
13
14
  import { Spinner, Modal, MenuItem } from '@wordpress/components';
14
15
  import { __, sprintf } from '@wordpress/i18n';
@@ -29,6 +30,43 @@ import {
29
30
  useTemplatePartArea,
30
31
  } from './utils/hooks';
31
32
 
33
+ function ReplaceButton( {
34
+ isEntityAvailable,
35
+ area,
36
+ clientId,
37
+ templatePartId,
38
+ isTemplatePartSelectionOpen,
39
+ setIsTemplatePartSelectionOpen,
40
+ } ) {
41
+ const { templateParts } = useAlternativeTemplateParts(
42
+ area,
43
+ templatePartId
44
+ );
45
+ const blockPatterns = useAlternativeBlockPatterns( area, clientId );
46
+
47
+ const hasReplacements = !! templateParts.length || !! blockPatterns.length;
48
+ const canReplace =
49
+ isEntityAvailable &&
50
+ hasReplacements &&
51
+ ( area === 'header' || area === 'footer' );
52
+
53
+ if ( ! canReplace ) {
54
+ return null;
55
+ }
56
+
57
+ return (
58
+ <MenuItem
59
+ onClick={ () => {
60
+ setIsTemplatePartSelectionOpen( true );
61
+ } }
62
+ aria-expanded={ isTemplatePartSelectionOpen }
63
+ aria-haspopup="dialog"
64
+ >
65
+ { __( 'Replace' ) }
66
+ </MenuItem>
67
+ );
68
+ }
69
+
32
70
  export default function TemplatePartEdit( {
33
71
  attributes,
34
72
  setAttributes,
@@ -81,23 +119,13 @@ export default function TemplatePartEdit( {
81
119
  },
82
120
  [ templatePartId, attributes.area, clientId ]
83
121
  );
84
- const { templateParts } = useAlternativeTemplateParts(
85
- area,
86
- templatePartId
87
- );
88
- const blockPatterns = useAlternativeBlockPatterns( area, clientId );
89
- const hasReplacements = !! templateParts.length || !! blockPatterns.length;
122
+
90
123
  const areaObject = useTemplatePartArea( area );
91
124
  const blockProps = useBlockProps();
92
125
  const isPlaceholder = ! slug;
93
126
  const isEntityAvailable = ! isPlaceholder && ! isMissing && isResolved;
94
127
  const TagName = tagName || areaObject.tagName;
95
128
 
96
- const canReplace =
97
- isEntityAvailable &&
98
- hasReplacements &&
99
- ( area === 'header' || area === 'footer' );
100
-
101
129
  // We don't want to render a missing state if we have any inner blocks.
102
130
  // A new template part is automatically created if we have any inner blocks but no entity.
103
131
  if (
@@ -132,14 +160,16 @@ export default function TemplatePartEdit( {
132
160
  return (
133
161
  <>
134
162
  <RecursionProvider uniqueId={ templatePartId }>
135
- <TemplatePartAdvancedControls
136
- tagName={ tagName }
137
- setAttributes={ setAttributes }
138
- isEntityAvailable={ isEntityAvailable }
139
- templatePartId={ templatePartId }
140
- defaultWrapper={ areaObject.tagName }
141
- hasInnerBlocks={ innerBlocks.length > 0 }
142
- />
163
+ <InspectorControls group="advanced">
164
+ <TemplatePartAdvancedControls
165
+ tagName={ tagName }
166
+ setAttributes={ setAttributes }
167
+ isEntityAvailable={ isEntityAvailable }
168
+ templatePartId={ templatePartId }
169
+ defaultWrapper={ areaObject.tagName }
170
+ hasInnerBlocks={ innerBlocks.length > 0 }
171
+ />
172
+ </InspectorControls>
143
173
  { isPlaceholder && (
144
174
  <TagName { ...blockProps }>
145
175
  <TemplatePartPlaceholder
@@ -153,36 +183,33 @@ export default function TemplatePartEdit( {
153
183
  />
154
184
  </TagName>
155
185
  ) }
156
- { canReplace && (
157
- <BlockSettingsMenuControls>
158
- { ( { selectedClientIds } ) => {
159
- // Only enable for single selection that matches the current block.
160
- // Ensures menu item doesn't render multiple times.
161
- if (
162
- ! (
163
- selectedClientIds.length === 1 &&
164
- clientId === selectedClientIds[ 0 ]
165
- )
166
- ) {
167
- return null;
168
- }
186
+ <BlockSettingsMenuControls>
187
+ { ( { selectedClientIds } ) => {
188
+ // Only enable for single selection that matches the current block.
189
+ // Ensures menu item doesn't render multiple times.
190
+ if (
191
+ ! (
192
+ selectedClientIds.length === 1 &&
193
+ clientId === selectedClientIds[ 0 ]
194
+ )
195
+ ) {
196
+ return null;
197
+ }
169
198
 
170
- return (
171
- <MenuItem
172
- onClick={ () => {
173
- setIsTemplatePartSelectionOpen( true );
174
- } }
175
- aria-expanded={
176
- isTemplatePartSelectionOpen
177
- }
178
- aria-haspopup="dialog"
179
- >
180
- { __( 'Replace' ) }
181
- </MenuItem>
182
- );
183
- } }
184
- </BlockSettingsMenuControls>
185
- ) }
199
+ return (
200
+ <ReplaceButton
201
+ { ...{
202
+ isEntityAvailable,
203
+ area,
204
+ clientId,
205
+ templatePartId,
206
+ isTemplatePartSelectionOpen,
207
+ setIsTemplatePartSelectionOpen,
208
+ } }
209
+ />
210
+ );
211
+ } }
212
+ </BlockSettingsMenuControls>
186
213
  { isEntityAvailable && (
187
214
  <TemplatePartInnerBlocks
188
215
  tagName={ TagName }
@@ -281,8 +281,8 @@ function register_block_core_template_part() {
281
281
  register_block_type_from_metadata(
282
282
  __DIR__ . '/template-part',
283
283
  array(
284
- 'render_callback' => 'render_block_core_template_part',
285
- 'variations' => build_template_part_block_variations(),
284
+ 'render_callback' => 'render_block_core_template_part',
285
+ 'variation_callback' => 'build_template_part_block_variations',
286
286
  )
287
287
  );
288
288
  }
@@ -212,7 +212,7 @@ class VideoEdit extends Component {
212
212
  render() {
213
213
  const { setAttributes, attributes, isSelected, wasBlockJustInserted } =
214
214
  this.props;
215
- const { id, src } = attributes;
215
+ const { id, src, guid } = attributes;
216
216
  const { videoContainerHeight } = this.state;
217
217
 
218
218
  const toolbarEditButton = (
@@ -236,7 +236,10 @@ class VideoEdit extends Component {
236
236
  ></MediaUpload>
237
237
  );
238
238
 
239
- if ( ! src ) {
239
+ // NOTE: `guid` is not part of the block's attribute definition. This case
240
+ // handled here is a temporary fix until a we find a better approach.
241
+ const isSourcePresent = src || ( guid && id );
242
+ if ( ! isSourcePresent ) {
240
243
  return (
241
244
  <View style={ { flex: 1 } }>
242
245
  <MediaPlaceholder
@@ -26,4 +26,42 @@ describe( 'Video block', () => {
26
26
 
27
27
  expect( screen.getByText( 'Invalid URL.' ) ).toBeVisible();
28
28
  } );
29
+
30
+ it( 'should render empty state when source is not present', async () => {
31
+ await initializeEditor( {
32
+ initialHtml: `
33
+ <!-- wp:video -->
34
+ <figure class="wp-block-video"></figure>
35
+ <!-- /wp:video -->
36
+ `,
37
+ } );
38
+ const addVideoButton = screen.queryByText( 'Add video' );
39
+ expect( addVideoButton ).toBeVisible();
40
+ } );
41
+
42
+ it( 'should not render empty state when video source is present', async () => {
43
+ await initializeEditor( {
44
+ initialHtml: `
45
+ <!-- wp:video {"id":1234} -->
46
+ <figure class="wp-block-video"><video controls src="https://VIDEO_URL.mp4"></video></figure>
47
+ <!-- /wp:video -->
48
+ `,
49
+ } );
50
+ const addVideoButton = screen.queryByText( 'Add video' );
51
+ expect( addVideoButton ).toBeNull();
52
+ } );
53
+
54
+ it( `should not render empty state when 'guid' and 'id' attributes are present`, async () => {
55
+ await initializeEditor( {
56
+ initialHtml: `
57
+ <!-- wp:video {"guid":"ABCD1234","id":1234 -->
58
+ <figure class="wp-block-video wp-block-embed is-type-video is-provider-videopress"><div class="wp-block-embed__wrapper">
59
+ https://videopress.com/<VIDEO_ID>
60
+ </div></figure>
61
+ <!-- /wp:video -->
62
+ `,
63
+ } );
64
+ const addVideoButton = screen.queryByText( 'Add video' );
65
+ expect( addVideoButton ).toBeNull();
66
+ } );
29
67
  } );
@@ -63,6 +63,38 @@ const transforms = {
63
63
  },
64
64
  },
65
65
  },
66
+ {
67
+ type: 'raw',
68
+ isMatch: ( node ) =>
69
+ node.nodeName === 'P' &&
70
+ node.children.length === 1 &&
71
+ node.firstChild.nodeName === 'VIDEO',
72
+ transform: ( node ) => {
73
+ const videoElement = node.firstChild;
74
+ const attributes = {
75
+ autoplay: videoElement.hasAttribute( 'autoplay' )
76
+ ? true
77
+ : undefined,
78
+ controls: videoElement.hasAttribute( 'controls' )
79
+ ? undefined
80
+ : false,
81
+ loop: videoElement.hasAttribute( 'loop' )
82
+ ? true
83
+ : undefined,
84
+ muted: videoElement.hasAttribute( 'muted' )
85
+ ? true
86
+ : undefined,
87
+ preload:
88
+ videoElement.getAttribute( 'preload' ) || undefined,
89
+ playsInline: videoElement.hasAttribute( 'playsinline' )
90
+ ? true
91
+ : undefined,
92
+ poster: videoElement.getAttribute( 'poster' ) || undefined,
93
+ src: videoElement.getAttribute( 'src' ) || undefined,
94
+ };
95
+ return createBlock( 'core/video', attributes );
96
+ },
97
+ },
66
98
  ],
67
99
  };
68
100
 
package/tsconfig.json CHANGED
@@ -27,6 +27,7 @@
27
27
  { "path": "../i18n" },
28
28
  { "path": "../icons" },
29
29
  { "path": "../interactivity" },
30
+ { "path": "../interactivity-router" },
30
31
  { "path": "../notices" },
31
32
  { "path": "../keycodes" },
32
33
  { "path": "../primitives" },
@@ -1,116 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = ReusableBlockEdit;
8
- var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
- var _coreData = require("@wordpress/core-data");
11
- var _components = require("@wordpress/components");
12
- var _i18n = require("@wordpress/i18n");
13
- var _blockEditor = require("@wordpress/block-editor");
14
- var _element = require("@wordpress/element");
15
- var _lockUnlock = require("../../lock-unlock");
16
- /**
17
- * External dependencies
18
- */
19
-
20
- /**
21
- * WordPress dependencies
22
- */
23
-
24
- /**
25
- * Internal dependencies
26
- */
27
-
28
- const {
29
- useLayoutClasses
30
- } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
31
- const fullAlignments = ['full', 'wide', 'left', 'right'];
32
- const useInferredLayout = (blocks, parentLayout) => {
33
- const initialInferredAlignmentRef = (0, _element.useRef)();
34
- return (0, _element.useMemo)(() => {
35
- // Exit early if the pattern's blocks haven't loaded yet.
36
- if (!blocks?.length) {
37
- return {};
38
- }
39
- let alignment = initialInferredAlignmentRef.current;
40
-
41
- // Only track the initial alignment so that temporarily removed
42
- // alignments can be reapplied.
43
- if (alignment === undefined) {
44
- const isConstrained = parentLayout?.type === 'constrained';
45
- const hasFullAlignment = blocks.some(block => fullAlignments.includes(block.attributes.align));
46
- alignment = isConstrained && hasFullAlignment ? 'full' : null;
47
- initialInferredAlignmentRef.current = alignment;
48
- }
49
- const layout = alignment ? parentLayout : undefined;
50
- return {
51
- alignment,
52
- layout
53
- };
54
- }, [blocks, parentLayout]);
55
- };
56
- function ReusableBlockEdit({
57
- name,
58
- attributes: {
59
- ref
60
- },
61
- __unstableParentLayout: parentLayout
62
- }) {
63
- const hasAlreadyRendered = (0, _blockEditor.__experimentalUseHasRecursion)(ref);
64
- const {
65
- record,
66
- hasResolved
67
- } = (0, _coreData.useEntityRecord)('postType', 'wp_block', ref);
68
- const isMissing = hasResolved && !record;
69
- const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)('postType', 'wp_block', {
70
- id: ref
71
- });
72
- const [title, setTitle] = (0, _coreData.useEntityProp)('postType', 'wp_block', 'title', ref);
73
- const {
74
- alignment,
75
- layout
76
- } = useInferredLayout(blocks, parentLayout);
77
- const layoutClasses = useLayoutClasses({
78
- layout
79
- }, name);
80
- const blockProps = (0, _blockEditor.useBlockProps)({
81
- className: (0, _classnames.default)('block-library-block__reusable-block-container', layout && layoutClasses, {
82
- [`align${alignment}`]: alignment
83
- })
84
- });
85
- const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
86
- value: blocks,
87
- layout,
88
- onInput,
89
- onChange,
90
- renderAppender: blocks?.length ? undefined : _blockEditor.InnerBlocks.ButtonBlockAppender
91
- });
92
- let children = null;
93
- if (hasAlreadyRendered) {
94
- children = (0, _react.createElement)(_blockEditor.Warning, null, (0, _i18n.__)('Block cannot be rendered inside itself.'));
95
- }
96
- if (isMissing) {
97
- children = (0, _react.createElement)(_blockEditor.Warning, null, (0, _i18n.__)('Block has been deleted or is unavailable.'));
98
- }
99
- if (!hasResolved) {
100
- children = (0, _react.createElement)(_components.Placeholder, null, (0, _react.createElement)(_components.Spinner, null));
101
- }
102
- return (0, _react.createElement)(_blockEditor.__experimentalRecursionProvider, {
103
- uniqueId: ref
104
- }, (0, _react.createElement)(_blockEditor.InspectorControls, null, (0, _react.createElement)(_components.PanelBody, null, (0, _react.createElement)(_components.TextControl, {
105
- label: (0, _i18n.__)('Name'),
106
- value: title,
107
- onChange: setTitle,
108
- __nextHasNoMarginBottom: true,
109
- __next40pxDefaultSize: true
110
- }))), children === null ? (0, _react.createElement)("div", {
111
- ...innerBlocksProps
112
- }) : (0, _react.createElement)("div", {
113
- ...blockProps
114
- }, children));
115
- }
116
- //# sourceMappingURL=edit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_coreData","_components","_i18n","_blockEditor","_element","_lockUnlock","useLayoutClasses","unlock","blockEditorPrivateApis","fullAlignments","useInferredLayout","blocks","parentLayout","initialInferredAlignmentRef","useRef","useMemo","length","alignment","current","undefined","isConstrained","type","hasFullAlignment","some","block","includes","attributes","align","layout","ReusableBlockEdit","name","ref","__unstableParentLayout","hasAlreadyRendered","useHasRecursion","record","hasResolved","useEntityRecord","isMissing","onInput","onChange","useEntityBlockEditor","id","title","setTitle","useEntityProp","layoutClasses","blockProps","useBlockProps","className","classnames","innerBlocksProps","useInnerBlocksProps","value","renderAppender","InnerBlocks","ButtonBlockAppender","children","_react","createElement","Warning","__","Placeholder","Spinner","__experimentalRecursionProvider","uniqueId","InspectorControls","PanelBody","TextControl","label","__nextHasNoMarginBottom","__next40pxDefaultSize"],"sources":["@wordpress/block-library/src/block/v1/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseEntityBlockEditor,\n\tuseEntityProp,\n\tuseEntityRecord,\n} from '@wordpress/core-data';\nimport {\n\tPlaceholder,\n\tSpinner,\n\tTextControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseInnerBlocksProps,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentalUseHasRecursion as useHasRecursion,\n\tInnerBlocks,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLayoutClasses } = unlock( blockEditorPrivateApis );\nconst fullAlignments = [ 'full', 'wide', 'left', 'right' ];\n\nconst useInferredLayout = ( blocks, parentLayout ) => {\n\tconst initialInferredAlignmentRef = useRef();\n\n\treturn useMemo( () => {\n\t\t// Exit early if the pattern's blocks haven't loaded yet.\n\t\tif ( ! blocks?.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet alignment = initialInferredAlignmentRef.current;\n\n\t\t// Only track the initial alignment so that temporarily removed\n\t\t// alignments can be reapplied.\n\t\tif ( alignment === undefined ) {\n\t\t\tconst isConstrained = parentLayout?.type === 'constrained';\n\t\t\tconst hasFullAlignment = blocks.some( ( block ) =>\n\t\t\t\tfullAlignments.includes( block.attributes.align )\n\t\t\t);\n\n\t\t\talignment = isConstrained && hasFullAlignment ? 'full' : null;\n\t\t\tinitialInferredAlignmentRef.current = alignment;\n\t\t}\n\n\t\tconst layout = alignment ? parentLayout : undefined;\n\n\t\treturn { alignment, layout };\n\t}, [ blocks, parentLayout ] );\n};\n\nexport default function ReusableBlockEdit( {\n\tname,\n\tattributes: { ref },\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst hasAlreadyRendered = useHasRecursion( ref );\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_block',\n\t\tref\n\t);\n\tconst isMissing = hasResolved && ! record;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_block',\n\t\t{ id: ref }\n\t);\n\n\tconst [ title, setTitle ] = useEntityProp(\n\t\t'postType',\n\t\t'wp_block',\n\t\t'title',\n\t\tref\n\t);\n\n\tconst { alignment, layout } = useInferredLayout( blocks, parentLayout );\n\tconst layoutClasses = useLayoutClasses( { layout }, name );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames(\n\t\t\t'block-library-block__reusable-block-container',\n\t\t\tlayout && layoutClasses,\n\t\t\t{ [ `align${ alignment }` ]: alignment }\n\t\t),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tvalue: blocks,\n\t\tlayout,\n\t\tonInput,\n\t\tonChange,\n\t\trenderAppender: blocks?.length\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tlet children = null;\n\n\tif ( hasAlreadyRendered ) {\n\t\tchildren = (\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n\n\tif ( isMissing ) {\n\t\tchildren = (\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block has been deleted or is unavailable.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n\n\tif ( ! hasResolved ) {\n\t\tchildren = (\n\t\t\t<Placeholder>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ ref }>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ children === null ? (\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t) : (\n\t\t\t\t<div { ...blockProps }>{ children }</div>\n\t\t\t) }\n\t\t</RecursionProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAUA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;;AAGA,MAAM;EAAEO;AAAiB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;A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W,EAAG;IACpBqB,QAAQ,GACP,IAAAC,MAAA,CAAAC,aAAA,EAAC1D,WAAA,CAAA6D,WAAW,QACX,IAAAJ,MAAA,CAAAC,aAAA,EAAC1D,WAAA,CAAA8D,OAAO,MAAE,CACE,CACb;EACF;EAEA,OACC,IAAAL,MAAA,CAAAC,aAAA,EAACxD,YAAA,CAAA6D,+BAAiB;IAACC,QAAQ,EAAGlC;EAAK,GAClC,IAAA2B,MAAA,CAAAC,aAAA,EAACxD,YAAA,CAAA+D,iBAAiB,QACjB,IAAAR,MAAA,CAAAC,aAAA,EAAC1D,WAAA,CAAAkE,SAAS,QACT,IAAAT,MAAA,CAAAC,aAAA,EAAC1D,WAAA,CAAAmE,WAAW;IACXC,KAAK,EAAG,IAAAR,QAAE,EAAE,MAAO,CAAG;IACtBR,KAAK,EAAGV,KAAO;IACfH,QAAQ,EAAGI,QAAU;IACrB0B,uBAAuB;IACvBC,qBAAqB;EAAA,CACrB,CACS,CACO,CAAC,EAClBd,QAAQ,KAAK,IAAI,GAClB,IAAAC,MAAA,CAAAC,aAAA;IAAA,GAAUR;EAAgB,CAAI,CAAC,GAE/B,IAAAO,MAAA,CAAAC,aAAA;IAAA,GAAUZ;EAAU,GAAKU,QAAe,CAEvB,CAAC;AAEtB"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_element","_coreData","_components","_data","_i18n","_blockEditor","_compose","_icons","_reusableBlocks","_editor","_notices","_editor2","_interopRequireDefault","_editTitle","ReusableBlockEdit","attributes","ref","clientId","isSelected","hasAlreadyRendered","useHasRecursion","showHelp","setShowHelp","useState","infoTextStyle","usePreferredColorSchemeStyle","styles","infoText","infoTextDark","infoTitleStyle","infoTitle","infoTitleDark","infoSheetIconStyle","infoSheetIcon","infoSheetIconDark","infoDescriptionStyle","infoDescription","infoDescriptionDark","actionButtonStyle","actionButton","actionButtonDark","spinnerStyle","spinner","spinnerDark","hasResolved","isEditing","isMissing","useSelect","select","persistedBlock","coreStore","getEntityRecord","hasResolvedBlock","hasFinishedResolution","getBlockCount","blockEditorStore","reusableBlocksStore","__experimentalIsEditingReusableBlock","innerBlockCount","hostAppNamespace","editorStore","getEditorSettings","createSuccessNotice","useDispatch","noticesStore","__experimentalConvertBlockToStatic","convertBlockToStatic","clearSelectedBlock","blocks","onInput","onChange","useEntityBlockEditor","id","title","useEntityProp","openSheet","closeSheet","onConvertToRegularBlocks","useCallback","successNotice","__","sprintf","setImmediate","renderSheet","Platform","OS","_react","createElement","BottomSheet","isVisible","hideHeader","onClose","View","style","infoContainer","Icon","icon","help","color","size","Text","TextControl","label","separatorType","onPress","labelStyle","Warning","message","ActivityIndicator","animating","element","InnerBlocks","value","Disabled","__experimentalRecursionProvider","uniqueId","TouchableWithoutFeedback","disabled","accessibilityLabel","accessibilityRole","accessibilityHint","default"],"sources":["@wordpress/block-library/src/block/v1/edit.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tActivityIndicator,\n\tPlatform,\n\tText,\n\tTouchableWithoutFeedback,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useCallback } from '@wordpress/element';\nimport {\n\tuseEntityBlockEditor,\n\tuseEntityProp,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBottomSheet,\n\tIcon,\n\tDisabled,\n\tTextControl,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentalUseHasRecursion as useHasRecursion,\n\tInnerBlocks,\n\tWarning,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { help } from '@wordpress/icons';\nimport { store as reusableBlocksStore } from '@wordpress/reusable-blocks';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport styles from '../editor.scss';\nimport EditTitle from '../edit-title';\n\nexport default function ReusableBlockEdit( {\n\tattributes: { ref },\n\tclientId,\n\tisSelected,\n} ) {\n\tconst hasAlreadyRendered = useHasRecursion( ref );\n\n\tconst [ showHelp, setShowHelp ] = useState( false );\n\tconst infoTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.infoText,\n\t\tstyles.infoTextDark\n\t);\n\tconst infoTitleStyle = usePreferredColorSchemeStyle(\n\t\tstyles.infoTitle,\n\t\tstyles.infoTitleDark\n\t);\n\tconst infoSheetIconStyle = usePreferredColorSchemeStyle(\n\t\tstyles.infoSheetIcon,\n\t\tstyles.infoSheetIconDark\n\t);\n\tconst infoDescriptionStyle = usePreferredColorSchemeStyle(\n\t\tstyles.infoDescription,\n\t\tstyles.infoDescriptionDark\n\t);\n\tconst actionButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.actionButton,\n\t\tstyles.actionButtonDark\n\t);\n\tconst spinnerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.spinner,\n\t\tstyles.spinnerDark\n\t);\n\n\tconst { hasResolved, isEditing, isMissing } = useSelect(\n\t\t( select ) => {\n\t\t\tconst persistedBlock = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_block',\n\t\t\t\tref\n\t\t\t);\n\t\t\tconst hasResolvedBlock = select( coreStore ).hasFinishedResolution(\n\t\t\t\t'getEntityRecord',\n\t\t\t\t[ 'postType', 'wp_block', ref ]\n\t\t\t);\n\n\t\t\tconst { getBlockCount } = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\thasResolved: hasResolvedBlock,\n\t\t\t\tisEditing:\n\t\t\t\t\tselect(\n\t\t\t\t\t\treusableBlocksStore\n\t\t\t\t\t).__experimentalIsEditingReusableBlock( clientId ),\n\t\t\t\tisMissing: hasResolvedBlock && ! persistedBlock,\n\t\t\t\tinnerBlockCount: getBlockCount( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ ref, clientId ]\n\t);\n\tconst hostAppNamespace = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().hostAppNamespace,\n\t\t[]\n\t);\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { __experimentalConvertBlockToStatic: convertBlockToStatic } =\n\t\tuseDispatch( reusableBlocksStore );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_block',\n\t\t{ id: ref }\n\t);\n\n\tconst [ title ] = useEntityProp( 'postType', 'wp_block', 'title', ref );\n\n\tfunction openSheet() {\n\t\tsetShowHelp( true );\n\t}\n\n\tfunction closeSheet() {\n\t\tsetShowHelp( false );\n\t}\n\n\tconst onConvertToRegularBlocks = useCallback( () => {\n\t\t/* translators: %s: name of the synced block */\n\t\tconst successNotice = __( '%s detached' );\n\t\tcreateSuccessNotice( sprintf( successNotice, title ) );\n\n\t\tclearSelectedBlock();\n\t\t// Convert action is executed at the end of the current JavaScript execution block\n\t\t// to prevent issues related to undo/redo actions.\n\t\tsetImmediate( () => convertBlockToStatic( clientId ) );\n\t}, [ title, clientId ] );\n\n\tfunction renderSheet() {\n\t\tconst infoTitle =\n\t\t\tPlatform.OS === 'android'\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: name of the host app (e.g. WordPress) */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Editing synced patterns is not yet supported on %s for Android'\n\t\t\t\t\t\t),\n\t\t\t\t\t\thostAppNamespace\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: name of the host app (e.g. WordPress) */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Editing synced patterns is not yet supported on %s for iOS'\n\t\t\t\t\t\t),\n\t\t\t\t\t\thostAppNamespace\n\t\t\t\t );\n\n\t\treturn (\n\t\t\t<BottomSheet\n\t\t\t\tisVisible={ showHelp }\n\t\t\t\thideHeader\n\t\t\t\tonClose={ closeSheet }\n\t\t\t>\n\t\t\t\t<View style={ styles.infoContainer }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ help }\n\t\t\t\t\t\tcolor={ infoSheetIconStyle.color }\n\t\t\t\t\t\tsize={ styles.infoSheetIcon.size }\n\t\t\t\t\t/>\n\t\t\t\t\t<Text style={ [ infoTextStyle, infoTitleStyle ] }>\n\t\t\t\t\t\t{ infoTitle }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Text style={ [ infoTextStyle, infoDescriptionStyle ] }>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Alternatively, you can detach and edit this block separately by tapping “Detach”.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Detach' ) }\n\t\t\t\t\t\tseparatorType=\"topFullWidth\"\n\t\t\t\t\t\tonPress={ onConvertToRegularBlocks }\n\t\t\t\t\t\tlabelStyle={ actionButtonStyle }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</BottomSheet>\n\t\t);\n\t}\n\n\tif ( hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<Warning\n\t\t\t\tmessage={ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isMissing ) {\n\t\treturn (\n\t\t\t<Warning\n\t\t\t\tmessage={ __( 'Block has been deleted or is unavailable.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! hasResolved ) {\n\t\treturn (\n\t\t\t<View style={ spinnerStyle }>\n\t\t\t\t<ActivityIndicator animating />\n\t\t\t</View>\n\t\t);\n\t}\n\n\tlet element = (\n\t\t<InnerBlocks\n\t\t\tvalue={ blocks }\n\t\t\tonChange={ onChange }\n\t\t\tonInput={ onInput }\n\t\t/>\n\t);\n\n\tif ( ! isEditing ) {\n\t\telement = <Disabled>{ element }</Disabled>;\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ ref }>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\taccessibilityLabel={ __( 'Help button' ) }\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityHint={ __( 'Tap here to show help' ) }\n\t\t\t\tonPress={ openSheet }\n\t\t\t>\n\t\t\t\t<View>\n\t\t\t\t\t{ isSelected && <EditTitle title={ title } /> }\n\t\t\t\t\t{ element }\n\t\t\t\t\t{ renderSheet() }\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</RecursionProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAWA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAOA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAKA,IAAAY,QAAA,GAAAC,sBAAA,CAAAb,OAAA;AACA,IAAAc,UAAA,GAAAD,sBAAA,CAAAb,OAAA;AA7CA;AACA;AACA;;AASA;AACA;AACA;;AA4BA;AACA;AACA;;AAIe,SAASe,iBAAiBA,CAAE;EAC1CC,UAAU,EAAE;IAAEC;EAAI,CAAC;EACnBC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAMC,kBAAkB,GAAG,IAAAC,0CAAe,EAAEJ,GAAI,CAAC;EAEjD,MAAM,CAAEK,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACnD,MAAMC,aAAa,GAAG,IAAAC,qCAA4B,EACjDC,gBAAM,C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