@wordpress/block-library 7.4.0 → 7.5.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 (269) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/audio/edit.js +3 -15
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/button/edit.native.js +7 -3
  5. package/build/button/edit.native.js.map +1 -1
  6. package/build/comment-template/edit.js +1 -3
  7. package/build/comment-template/edit.js.map +1 -1
  8. package/build/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  9. package/{build-module/comments-query-loop → build/comments}/edit/comments-inspector-controls.js.map +1 -1
  10. package/build/{comments-query-loop → comments}/edit.js +3 -3
  11. package/build/comments/edit.js.map +1 -0
  12. package/build/{comments-query-loop → comments}/index.js +1 -1
  13. package/build/comments/index.js.map +1 -0
  14. package/build/{comments-query-loop → comments}/save.js +2 -2
  15. package/build/comments/save.js.map +1 -0
  16. package/build/comments-title/edit.js +7 -5
  17. package/build/comments-title/edit.js.map +1 -1
  18. package/build/cover/edit.js +4 -71
  19. package/build/cover/edit.js.map +1 -1
  20. package/build/cover/edit.native.js +36 -15
  21. package/build/cover/edit.native.js.map +1 -1
  22. package/build/cover/transforms.js +77 -6
  23. package/build/cover/transforms.js.map +1 -1
  24. package/build/cover/use-cover-is-dark.js +81 -0
  25. package/build/cover/use-cover-is-dark.js.map +1 -0
  26. package/build/cover/use-cover-is-dark.native.js +60 -0
  27. package/build/cover/use-cover-is-dark.native.js.map +1 -0
  28. package/build/group/index.js +1 -0
  29. package/build/group/index.js.map +1 -1
  30. package/build/heading/transforms.js +8 -4
  31. package/build/heading/transforms.js.map +1 -1
  32. package/build/index.js +4 -6
  33. package/build/index.js.map +1 -1
  34. package/build/latest-posts/edit.native.js +49 -0
  35. package/build/latest-posts/edit.native.js.map +1 -1
  36. package/build/navigation/edit/index.js +5 -28
  37. package/build/navigation/edit/index.js.map +1 -1
  38. package/build/navigation/edit/inner-blocks.js +5 -7
  39. package/build/navigation/edit/inner-blocks.js.map +1 -1
  40. package/build/navigation/index.js +0 -1
  41. package/build/navigation/index.js.map +1 -1
  42. package/build/navigation/view-modal.js +25 -0
  43. package/build/navigation/view-modal.js.map +1 -1
  44. package/build/navigation-link/edit.js +29 -30
  45. package/build/navigation-link/edit.js.map +1 -1
  46. package/build/navigation-submenu/edit.js +14 -14
  47. package/build/navigation-submenu/edit.js.map +1 -1
  48. package/build/paragraph/edit.js +10 -0
  49. package/build/paragraph/edit.js.map +1 -1
  50. package/build/paragraph/use-enter.js +94 -0
  51. package/build/paragraph/use-enter.js.map +1 -0
  52. package/build/post-comment/index.js +1 -1
  53. package/build/post-comments/edit.js +120 -35
  54. package/build/post-comments/edit.js.map +1 -1
  55. package/build/post-comments/index.js +3 -2
  56. package/build/post-comments/index.js.map +1 -1
  57. package/build/post-comments-form/edit.js +38 -4
  58. package/build/post-comments-form/edit.js.map +1 -1
  59. package/build/post-comments-form/form.js +48 -0
  60. package/build/post-comments-form/form.js.map +1 -0
  61. package/build/post-comments-form/index.js +1 -0
  62. package/build/post-comments-form/index.js.map +1 -1
  63. package/build/post-content/edit.js +1 -1
  64. package/build/post-content/edit.js.map +1 -1
  65. package/build/post-excerpt/edit.js +1 -1
  66. package/build/post-excerpt/edit.js.map +1 -1
  67. package/build/post-terms/edit.js +25 -3
  68. package/build/post-terms/edit.js.map +1 -1
  69. package/build/post-terms/index.js +8 -0
  70. package/build/post-terms/index.js.map +1 -1
  71. package/build/query-no-results/edit.js +1 -1
  72. package/build/query-no-results/edit.js.map +1 -1
  73. package/build/quote/index.js +1 -0
  74. package/build/quote/index.js.map +1 -1
  75. package/build/separator/index.js +3 -0
  76. package/build/separator/index.js.map +1 -1
  77. package/build/video/edit.js +3 -7
  78. package/build/video/edit.js.map +1 -1
  79. package/build-module/audio/edit.js +3 -15
  80. package/build-module/audio/edit.js.map +1 -1
  81. package/build-module/button/edit.native.js +7 -3
  82. package/build-module/button/edit.native.js.map +1 -1
  83. package/build-module/comment-template/edit.js +1 -3
  84. package/build-module/comment-template/edit.js.map +1 -1
  85. package/build-module/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  86. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -0
  87. package/build-module/{comments-query-loop → comments}/edit.js +2 -2
  88. package/build-module/comments/edit.js.map +1 -0
  89. package/build-module/{comments-query-loop → comments}/index.js +1 -1
  90. package/build-module/comments/index.js.map +1 -0
  91. package/build-module/{comments-query-loop → comments}/save.js +1 -1
  92. package/build-module/comments/save.js.map +1 -0
  93. package/build-module/comments-title/edit.js +7 -5
  94. package/build-module/comments-title/edit.js.map +1 -1
  95. package/build-module/cover/edit.js +4 -71
  96. package/build-module/cover/edit.js.map +1 -1
  97. package/build-module/cover/edit.native.js +35 -16
  98. package/build-module/cover/edit.native.js.map +1 -1
  99. package/build-module/cover/transforms.js +74 -6
  100. package/build-module/cover/transforms.js.map +1 -1
  101. package/build-module/cover/use-cover-is-dark.js +70 -0
  102. package/build-module/cover/use-cover-is-dark.js.map +1 -0
  103. package/build-module/cover/use-cover-is-dark.native.js +51 -0
  104. package/build-module/cover/use-cover-is-dark.native.js.map +1 -0
  105. package/build-module/group/index.js +1 -0
  106. package/build-module/group/index.js.map +1 -1
  107. package/build-module/heading/transforms.js +8 -4
  108. package/build-module/heading/transforms.js.map +1 -1
  109. package/build-module/index.js +3 -4
  110. package/build-module/index.js.map +1 -1
  111. package/build-module/latest-posts/edit.native.js +51 -2
  112. package/build-module/latest-posts/edit.native.js.map +1 -1
  113. package/build-module/navigation/edit/index.js +6 -28
  114. package/build-module/navigation/edit/index.js.map +1 -1
  115. package/build-module/navigation/edit/inner-blocks.js +5 -7
  116. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  117. package/build-module/navigation/index.js +0 -1
  118. package/build-module/navigation/index.js.map +1 -1
  119. package/build-module/navigation/view-modal.js +24 -0
  120. package/build-module/navigation/view-modal.js.map +1 -1
  121. package/build-module/navigation-link/edit.js +29 -30
  122. package/build-module/navigation-link/edit.js.map +1 -1
  123. package/build-module/navigation-submenu/edit.js +14 -14
  124. package/build-module/navigation-submenu/edit.js.map +1 -1
  125. package/build-module/paragraph/edit.js +9 -0
  126. package/build-module/paragraph/edit.js.map +1 -1
  127. package/build-module/paragraph/use-enter.js +81 -0
  128. package/build-module/paragraph/use-enter.js.map +1 -0
  129. package/build-module/post-comment/index.js +1 -1
  130. package/build-module/post-comments/edit.js +120 -37
  131. package/build-module/post-comments/edit.js.map +1 -1
  132. package/build-module/post-comments/index.js +3 -2
  133. package/build-module/post-comments/index.js.map +1 -1
  134. package/build-module/post-comments-form/edit.js +38 -6
  135. package/build-module/post-comments-form/edit.js.map +1 -1
  136. package/build-module/post-comments-form/form.js +39 -0
  137. package/build-module/post-comments-form/form.js.map +1 -0
  138. package/build-module/post-comments-form/index.js +1 -0
  139. package/build-module/post-comments-form/index.js.map +1 -1
  140. package/build-module/post-content/edit.js +1 -1
  141. package/build-module/post-content/edit.js.map +1 -1
  142. package/build-module/post-excerpt/edit.js +1 -1
  143. package/build-module/post-excerpt/edit.js.map +1 -1
  144. package/build-module/post-terms/edit.js +26 -4
  145. package/build-module/post-terms/edit.js.map +1 -1
  146. package/build-module/post-terms/index.js +8 -0
  147. package/build-module/post-terms/index.js.map +1 -1
  148. package/build-module/query-no-results/edit.js +1 -1
  149. package/build-module/query-no-results/edit.js.map +1 -1
  150. package/build-module/quote/index.js +1 -0
  151. package/build-module/quote/index.js.map +1 -1
  152. package/build-module/separator/index.js +3 -0
  153. package/build-module/separator/index.js.map +1 -1
  154. package/build-module/video/edit.js +3 -7
  155. package/build-module/video/edit.js.map +1 -1
  156. package/build-style/comment-content/style-rtl.css +81 -0
  157. package/build-style/comment-content/style.css +81 -0
  158. package/build-style/{comments-query-loop → comments}/editor-rtl.css +0 -0
  159. package/build-style/{comments-query-loop → comments}/editor.css +0 -0
  160. package/build-style/cover/style-rtl.css +1 -5
  161. package/build-style/cover/style.css +1 -5
  162. package/build-style/editor-rtl.css +12 -4
  163. package/build-style/editor.css +12 -4
  164. package/build-style/latest-posts/style-rtl.css +2 -0
  165. package/build-style/latest-posts/style.css +4 -0
  166. package/build-style/navigation/style-rtl.css +3 -0
  167. package/build-style/navigation/style.css +3 -0
  168. package/build-style/post-comments/editor-rtl.css +79 -0
  169. package/build-style/post-comments/editor.css +79 -0
  170. package/build-style/post-comments/style-rtl.css +6 -4
  171. package/build-style/post-comments/style.css +6 -4
  172. package/build-style/post-comments-form/editor-rtl.css +79 -0
  173. package/build-style/post-comments-form/editor.css +79 -0
  174. package/build-style/style-rtl.css +12 -9
  175. package/build-style/style.css +14 -9
  176. package/package.json +28 -28
  177. package/src/audio/edit.js +2 -7
  178. package/src/button/edit.native.js +6 -3
  179. package/src/comment-author-name/index.php +7 -5
  180. package/src/comment-content/index.php +25 -3
  181. package/src/comment-content/style.scss +5 -0
  182. package/src/comment-edit-link/index.php +1 -4
  183. package/src/comment-reply-link/index.php +1 -4
  184. package/src/comment-template/edit.js +1 -5
  185. package/src/comment-template/index.php +4 -0
  186. package/src/{comments-query-loop → comments}/block.json +1 -1
  187. package/src/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  188. package/src/{comments-query-loop → comments}/edit.js +2 -1
  189. package/src/{comments-query-loop → comments}/editor.scss +0 -0
  190. package/src/{comments-query-loop → comments}/index.js +0 -0
  191. package/src/{comments-query-loop → comments}/save.js +1 -3
  192. package/src/comments-pagination/index.php +4 -0
  193. package/src/comments-title/edit.js +20 -4
  194. package/src/comments-title/index.php +18 -7
  195. package/src/cover/edit.js +2 -67
  196. package/src/cover/edit.native.js +40 -13
  197. package/src/cover/index.php +1 -1
  198. package/src/cover/style.native.scss +4 -0
  199. package/src/cover/style.scss +1 -5
  200. package/src/cover/test/__snapshots__/edit.native.js.snap +6 -6
  201. package/src/cover/test/transforms.js +301 -0
  202. package/src/cover/transforms.js +112 -7
  203. package/src/cover/use-cover-is-dark.js +71 -0
  204. package/src/cover/use-cover-is-dark.native.js +51 -0
  205. package/src/editor.scss +3 -1
  206. package/src/group/block.json +1 -0
  207. package/src/heading/transforms.js +4 -3
  208. package/src/index.js +3 -6
  209. package/src/latest-posts/edit.native.js +56 -1
  210. package/src/latest-posts/style.scss +4 -0
  211. package/src/navigation/block.json +0 -1
  212. package/src/navigation/edit/index.js +6 -36
  213. package/src/navigation/edit/inner-blocks.js +5 -7
  214. package/src/navigation/style.scss +3 -0
  215. package/src/navigation/view-modal.js +32 -0
  216. package/src/navigation-link/edit.js +40 -43
  217. package/src/navigation-submenu/edit.js +13 -17
  218. package/src/paragraph/edit.js +6 -0
  219. package/src/paragraph/use-enter.js +103 -0
  220. package/src/post-author/index.php +1 -1
  221. package/src/post-comment/block.json +1 -1
  222. package/src/post-comments/block.json +3 -2
  223. package/src/post-comments/edit.js +174 -44
  224. package/src/post-comments/editor.scss +3 -0
  225. package/src/post-comments/index.php +2 -0
  226. package/src/post-comments/style.scss +6 -7
  227. package/src/post-comments-form/block.json +1 -0
  228. package/src/post-comments-form/edit.js +52 -23
  229. package/src/post-comments-form/editor.scss +3 -0
  230. package/src/post-comments-form/form.js +43 -0
  231. package/src/post-comments-form/index.php +9 -2
  232. package/src/post-content/edit.js +15 -1
  233. package/src/post-excerpt/edit.js +14 -1
  234. package/src/post-terms/block.json +8 -0
  235. package/src/post-terms/edit.js +28 -1
  236. package/src/post-terms/index.php +12 -2
  237. package/src/query-no-results/edit.js +1 -1
  238. package/src/quote/block.json +1 -0
  239. package/src/separator/block.json +3 -0
  240. package/src/video/edit.js +3 -4
  241. package/build/comments-query-loop/edit/comments-inspector-controls.js.map +0 -1
  242. package/build/comments-query-loop/edit.js.map +0 -1
  243. package/build/comments-query-loop/index.js.map +0 -1
  244. package/build/comments-query-loop/save.js.map +0 -1
  245. package/build/navigation-area/edit.js +0 -110
  246. package/build/navigation-area/edit.js.map +0 -1
  247. package/build/navigation-area/index.js +0 -62
  248. package/build/navigation-area/index.js.map +0 -1
  249. package/build/navigation-area/inner-blocks.js +0 -34
  250. package/build/navigation-area/inner-blocks.js.map +0 -1
  251. package/build/navigation-area/save.js +0 -18
  252. package/build/navigation-area/save.js.map +0 -1
  253. package/build-module/comments-query-loop/edit.js.map +0 -1
  254. package/build-module/comments-query-loop/index.js.map +0 -1
  255. package/build-module/comments-query-loop/save.js.map +0 -1
  256. package/build-module/navigation-area/edit.js +0 -94
  257. package/build-module/navigation-area/edit.js.map +0 -1
  258. package/build-module/navigation-area/index.js +0 -48
  259. package/build-module/navigation-area/index.js.map +0 -1
  260. package/build-module/navigation-area/inner-blocks.js +0 -26
  261. package/build-module/navigation-area/inner-blocks.js.map +0 -1
  262. package/build-module/navigation-area/save.js +0 -10
  263. package/build-module/navigation-area/save.js.map +0 -1
  264. package/src/navigation-area/block.json +0 -23
  265. package/src/navigation-area/edit.js +0 -111
  266. package/src/navigation-area/index.js +0 -26
  267. package/src/navigation-area/index.php +0 -22
  268. package/src/navigation-area/inner-blocks.js +0 -24
  269. package/src/navigation-area/save.js +0 -8
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -9,6 +11,8 @@ var _blocks = require("@wordpress/blocks");
9
11
 
10
12
  var _shared = require("./shared");
11
13
 
14
+ var _cleanEmptyObject = _interopRequireDefault(require("../utils/clean-empty-object"));
15
+
12
16
  /**
13
17
  * WordPress dependencies
14
18
  */
@@ -78,7 +82,7 @@ const transforms = {
78
82
  type: 'block',
79
83
  blocks: ['core/group'],
80
84
  transform: (attributes, innerBlocks) => {
81
- var _style$color2, _style$color3, _style$color4, _style$color5, _attributes$style;
85
+ var _innerBlocks$, _style$color2, _style$color3, _style$color4, _style$color5;
82
86
 
83
87
  const {
84
88
  align,
@@ -86,10 +90,16 @@ const transforms = {
86
90
  backgroundColor,
87
91
  gradient,
88
92
  style
89
- } = attributes; // If no background or gradient color is provided, default to 50% opacity.
93
+ } = attributes; // If the Group block being transformed has a Cover block as its
94
+ // only child return that Cover block.
95
+
96
+ if ((innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.length) === 1 && ((_innerBlocks$ = innerBlocks[0]) === null || _innerBlocks$ === void 0 ? void 0 : _innerBlocks$.name) === 'core/cover') {
97
+ return (0, _blocks.createBlock)('core/cover', innerBlocks[0].attributes, innerBlocks[0].innerBlocks);
98
+ } // If no background or gradient color is provided, default to 50% opacity.
90
99
  // This matches the styling of a Cover block with a background image,
91
100
  // in the state where a background image has been removed.
92
101
 
102
+
93
103
  const dimRatio = backgroundColor || gradient || style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background || style !== null && style !== void 0 && (_style$color3 = style.color) !== null && _style$color3 !== void 0 && _style$color3.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block.
94
104
 
95
105
  const parentAttributes = {
@@ -104,12 +114,12 @@ const transforms = {
104
114
  const attributesWithoutBackgroundColors = { ...attributes,
105
115
  backgroundColor: undefined,
106
116
  gradient: undefined,
107
- style: { ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
108
- color: { ...(attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.color),
117
+ style: (0, _cleanEmptyObject.default)({ ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
118
+ color: style !== null && style !== void 0 && style.color ? { ...(style === null || style === void 0 ? void 0 : style.color),
109
119
  background: undefined,
110
120
  gradient: undefined
111
- }
112
- }
121
+ } : undefined
122
+ })
113
123
  }; // Preserve the block by nesting it within the Cover block,
114
124
  // instead of converting the Group block directly to the Cover block.
115
125
 
@@ -200,6 +210,67 @@ const transforms = {
200
210
  anchor
201
211
  });
202
212
  }
213
+ }, {
214
+ type: 'block',
215
+ blocks: ['core/group'],
216
+ isMatch: _ref7 => {
217
+ let {
218
+ url
219
+ } = _ref7;
220
+
221
+ // If the Cover block uses background media, skip this transform,
222
+ // and instead use the Group block's default transform.
223
+ if (url) {
224
+ return false;
225
+ }
226
+
227
+ return true;
228
+ },
229
+ transform: (attributes, innerBlocks) => {
230
+ var _attributes$style, _attributes$style2, _innerBlocks$2;
231
+
232
+ // Convert Cover overlay colors to comparable Group background colors.
233
+ const transformedColorAttributes = {
234
+ backgroundColor: attributes === null || attributes === void 0 ? void 0 : attributes.overlayColor,
235
+ gradient: attributes === null || attributes === void 0 ? void 0 : attributes.gradient,
236
+ style: (0, _cleanEmptyObject.default)({ ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
237
+ color: attributes !== null && attributes !== void 0 && attributes.customOverlayColor || attributes !== null && attributes !== void 0 && attributes.customGradient || attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && _attributes$style.color ? {
238
+ background: attributes === null || attributes === void 0 ? void 0 : attributes.customOverlayColor,
239
+ gradient: attributes === null || attributes === void 0 ? void 0 : attributes.customGradient,
240
+ ...(attributes === null || attributes === void 0 ? void 0 : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : _attributes$style2.color)
241
+ } : undefined
242
+ })
243
+ }; // If the Cover block contains only a single Group block as a direct child,
244
+ // then attempt to merge the Cover's background colors with the child Group block,
245
+ // and remove the Cover block as the wrapper.
246
+
247
+ if ((innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.length) === 1 && ((_innerBlocks$2 = innerBlocks[0]) === null || _innerBlocks$2 === void 0 ? void 0 : _innerBlocks$2.name) === 'core/group') {
248
+ var _groupAttributes$styl, _groupAttributes$styl2, _groupAttributes$styl3, _groupAttributes$styl4, _transformedColorAttr, _groupAttributes$styl5, _transformedColorAttr2, _groupAttributes$styl6, _innerBlocks$4;
249
+
250
+ const groupAttributes = (0, _cleanEmptyObject.default)(innerBlocks[0].attributes || {}); // If the Group block contains any kind of background color or gradient,
251
+ // skip merging Cover background colors, and preserve the Group block's colors.
252
+
253
+ if (groupAttributes !== null && groupAttributes !== void 0 && groupAttributes.backgroundColor || groupAttributes !== null && groupAttributes !== void 0 && groupAttributes.gradient || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl = groupAttributes.style) !== null && _groupAttributes$styl !== void 0 && (_groupAttributes$styl2 = _groupAttributes$styl.color) !== null && _groupAttributes$styl2 !== void 0 && _groupAttributes$styl2.background || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl3 = groupAttributes.style) !== null && _groupAttributes$styl3 !== void 0 && (_groupAttributes$styl4 = _groupAttributes$styl3.color) !== null && _groupAttributes$styl4 !== void 0 && _groupAttributes$styl4.gradient) {
254
+ var _innerBlocks$3;
255
+
256
+ return (0, _blocks.createBlock)('core/group', groupAttributes, (_innerBlocks$3 = innerBlocks[0]) === null || _innerBlocks$3 === void 0 ? void 0 : _innerBlocks$3.innerBlocks);
257
+ }
258
+
259
+ return (0, _blocks.createBlock)('core/group', { ...transformedColorAttributes,
260
+ ...groupAttributes,
261
+ style: (0, _cleanEmptyObject.default)({ ...(groupAttributes === null || groupAttributes === void 0 ? void 0 : groupAttributes.style),
262
+ color: transformedColorAttributes !== null && transformedColorAttributes !== void 0 && (_transformedColorAttr = transformedColorAttributes.style) !== null && _transformedColorAttr !== void 0 && _transformedColorAttr.color || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl5 = groupAttributes.style) !== null && _groupAttributes$styl5 !== void 0 && _groupAttributes$styl5.color ? { ...(transformedColorAttributes === null || transformedColorAttributes === void 0 ? void 0 : (_transformedColorAttr2 = transformedColorAttributes.style) === null || _transformedColorAttr2 === void 0 ? void 0 : _transformedColorAttr2.color),
263
+ ...(groupAttributes === null || groupAttributes === void 0 ? void 0 : (_groupAttributes$styl6 = groupAttributes.style) === null || _groupAttributes$styl6 === void 0 ? void 0 : _groupAttributes$styl6.color)
264
+ } : undefined
265
+ })
266
+ }, (_innerBlocks$4 = innerBlocks[0]) === null || _innerBlocks$4 === void 0 ? void 0 : _innerBlocks$4.innerBlocks);
267
+ } // In all other cases, transform the Cover block directly to a Group block.
268
+
269
+
270
+ return (0, _blocks.createBlock)('core/group', { ...attributes,
271
+ ...transformedColorAttributes
272
+ }, innerBlocks);
273
+ }
203
274
  }]
204
275
  };
205
276
  var _default = transforms;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/cover/transforms.js"],"names":["transforms","from","type","blocks","transform","caption","url","alt","align","id","anchor","style","dimRatio","color","duotone","content","fontSize","src","backgroundType","VIDEO_BACKGROUND_TYPE","attributes","innerBlocks","backgroundColor","gradient","background","undefined","parentAttributes","overlayColor","customOverlayColor","customGradient","attributesWithoutBackgroundColors","to","isMatch","IMAGE_BACKGROUND_TYPE","title"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,YAAF,CAFT;AAGCC,IAAAA,SAAS,EAAE;AAAA;;AAAA,UAAE;AAAEC,QAAAA,OAAF;AAAWC,QAAAA,GAAX;AAAgBC,QAAAA,GAAhB;AAAqBC,QAAAA,KAArB;AAA4BC,QAAAA,EAA5B;AAAgCC,QAAAA,MAAhC;AAAwCC,QAAAA;AAAxC,OAAF;AAAA,aACV,yBACC,YADD,EAEC;AACCC,QAAAA,QAAQ,EAAE,EADX;AAECN,QAAAA,GAFD;AAGCC,QAAAA,GAHD;AAICC,QAAAA,KAJD;AAKCC,QAAAA,EALD;AAMCC,QAAAA,MAND;AAOCC,QAAAA,KAAK,EAAE;AACNE,UAAAA,KAAK,EAAE;AACNC,YAAAA,OAAO,EAAEH,KAAF,aAAEA,KAAF,uCAAEA,KAAK,CAAEE,KAAT,iDAAE,aAAcC;AADjB;AADD;AAPR,OAFD,EAeC,CACC,yBAAa,gBAAb,EAA+B;AAC9BC,QAAAA,OAAO,EA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E;AAAE8B,QAAAA,KAAF;AAAS5B,QAAAA,GAAT;AAAcE,QAAAA,KAAd;AAAqBC,QAAAA,EAArB;AAAyBC,QAAAA;AAAzB,OAAF;AAAA,aACV,yBAAa,YAAb,EAA2B;AAC1BL,QAAAA,OAAO,EAAE6B,KADiB;AAE1BjB,QAAAA,GAAG,EAAEX,GAFqB;AAG1BG,QAAAA,EAH0B;AAI1BD,QAAAA,KAJ0B;AAK1BE,QAAAA;AAL0B,OAA3B,CADU;AAAA;AAvBZ,GAvCG;AAjHc,CAAnB;eA2LeV,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { IMAGE_BACKGROUND_TYPE, VIDEO_BACKGROUND_TYPE } from './shared';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/image' ],\n\t\t\ttransform: ( { caption, url, alt, align, id, anchor, style } ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\t{\n\t\t\t\t\t\tdimRatio: 50,\n\t\t\t\t\t\turl,\n\t\t\t\t\t\talt,\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\tduotone: style?.color?.duotone,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\tcontent: caption,\n\t\t\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/video' ],\n\t\t\ttransform: ( { caption, src, align, id, anchor } ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\t{\n\t\t\t\t\t\tdimRatio: 50,\n\t\t\t\t\t\turl: src,\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tbackgroundType: VIDEO_BACKGROUND_TYPE,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\tcontent: caption,\n\t\t\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\ttransform: ( attributes, innerBlocks ) => {\n\t\t\t\tconst {\n\t\t\t\t\talign,\n\t\t\t\t\tanchor,\n\t\t\t\t\tbackgroundColor,\n\t\t\t\t\tgradient,\n\t\t\t\t\tstyle,\n\t\t\t\t} = attributes;\n\n\t\t\t\t// If no background or gradient color is provided, default to 50% opacity.\n\t\t\t\t// This matches the styling of a Cover block with a background image,\n\t\t\t\t// in the state where a background image has been removed.\n\t\t\t\tconst dimRatio =\n\t\t\t\t\tbackgroundColor ||\n\t\t\t\t\tgradient ||\n\t\t\t\t\tstyle?.color?.background ||\n\t\t\t\t\tstyle?.color?.gradient\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: 50;\n\n\t\t\t\t// Move the background or gradient color to the parent Cover block.\n\t\t\t\tconst parentAttributes = {\n\t\t\t\t\talign,\n\t\t\t\t\tanchor,\n\t\t\t\t\tdimRatio,\n\t\t\t\t\toverlayColor: backgroundColor,\n\t\t\t\t\tcustomOverlayColor: style?.color?.background,\n\t\t\t\t\tgradient,\n\t\t\t\t\tcustomGradient: style?.color?.gradient,\n\t\t\t\t};\n\n\t\t\t\tconst attributesWithoutBackgroundColors = {\n\t\t\t\t\t...attributes,\n\t\t\t\t\tbackgroundColor: undefined,\n\t\t\t\t\tgradient: undefined,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...attributes?.style,\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...attributes?.style?.color,\n\t\t\t\t\t\t\tbackground: undefined,\n\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\t// Preserve the block by nesting it within the Cover block,\n\t\t\t\t// instead of converting the Group block directly to the Cover block.\n\t\t\t\treturn createBlock( 'core/cover', parentAttributes, [\n\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\tattributesWithoutBackgroundColors,\n\t\t\t\t\t\tinnerBlocks\n\t\t\t\t\t),\n\t\t\t\t] );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/image' ],\n\t\t\tisMatch: ( {\n\t\t\t\tbackgroundType,\n\t\t\t\turl,\n\t\t\t\toverlayColor,\n\t\t\t\tcustomOverlayColor,\n\t\t\t\tgradient,\n\t\t\t\tcustomGradient,\n\t\t\t} ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\t// If a url exists the transform could happen if that URL represents an image background.\n\t\t\t\t\treturn backgroundType === IMAGE_BACKGROUND_TYPE;\n\t\t\t\t}\n\t\t\t\t// If a url is not set the transform could happen if the cover has no background color or gradient;\n\t\t\t\treturn (\n\t\t\t\t\t! overlayColor &&\n\t\t\t\t\t! customOverlayColor &&\n\t\t\t\t\t! gradient &&\n\t\t\t\t\t! customGradient\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: ( { title, url, alt, align, id, anchor, style } ) =>\n\t\t\t\tcreateBlock( 'core/image', {\n\t\t\t\t\tcaption: title,\n\t\t\t\t\turl,\n\t\t\t\t\talt,\n\t\t\t\t\talign,\n\t\t\t\t\tid,\n\t\t\t\t\tanchor,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\tduotone: style?.color?.duotone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/video' ],\n\t\t\tisMatch: ( {\n\t\t\t\tbackgroundType,\n\t\t\t\turl,\n\t\t\t\toverlayColor,\n\t\t\t\tcustomOverlayColor,\n\t\t\t\tgradient,\n\t\t\t\tcustomGradient,\n\t\t\t} ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\t// If a url exists the transform could happen if that URL represents a video background.\n\t\t\t\t\treturn backgroundType === VIDEO_BACKGROUND_TYPE;\n\t\t\t\t}\n\t\t\t\t// If a url is not set the transform could happen if the cover has no background color or gradient;\n\t\t\t\treturn (\n\t\t\t\t\t! overlayColor &&\n\t\t\t\t\t! customOverlayColor &&\n\t\t\t\t\t! gradient &&\n\t\t\t\t\t! customGradient\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: ( { title, url, align, id, anchor } ) =>\n\t\t\t\tcreateBlock( 'core/video', {\n\t\t\t\t\tcaption: title,\n\t\t\t\t\tsrc: url,\n\t\t\t\t\tid,\n\t\t\t\t\talign,\n\t\t\t\t\tanchor,\n\t\t\t\t} ),\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/cover/transforms.js"],"names":["transforms","from","type","blocks","transform","caption","url","alt","align","id","anchor","style","dimRatio","color","duotone","content","fontSize","src","backgroundType","VIDEO_BACKGROUND_TYPE","attributes","innerBlocks","backgroundColor","gradient","length","name","background","undefined","parentAttributes","overlayColor","customOverlayColor","customGradient","attributesWithoutBackgroundColors","to","isMatch","IMAGE_BACKGROUND_TYPE","title","transformedColorAttributes","groupAttributes"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CAC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,eAAH,aAAGA,eAAH,iDAAGA,eAAe,CAAE3B,KAApB,2DAAG,uBACAE,KADH;AAHA,aAFH,GAQGc;AAXoB,WAAlB;AAHR,SAFM,oBAmBNN,WAAW,CAAE,CAAF,CAnBL,mDAmBN,eAAkBA,WAnBZ,CAAP;AAqBA,OApEwC,CAsEzC;;;AACA,aAAO,yBACN,YADM,EAEN,EAAE,GAAGD,UAAL;AAAiB,WAAGiB;AAApB,OAFM,EAGNhB,WAHM,CAAP;AAKA;AAvFF,GAvEG;AAhIc,CAAnB;eAmSerB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { IMAGE_BACKGROUND_TYPE, VIDEO_BACKGROUND_TYPE } from './shared';\nimport cleanEmptyObject from '../utils/clean-empty-object';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/image' ],\n\t\t\ttransform: ( { caption, url, alt, align, id, anchor, style } ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\t{\n\t\t\t\t\t\tdimRatio: 50,\n\t\t\t\t\t\turl,\n\t\t\t\t\t\talt,\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\tduotone: style?.color?.duotone,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\tcontent: caption,\n\t\t\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/video' ],\n\t\t\ttransform: ( { caption, src, align, id, anchor } ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\t{\n\t\t\t\t\t\tdimRatio: 50,\n\t\t\t\t\t\turl: src,\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tbackgroundType: VIDEO_BACKGROUND_TYPE,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\tcontent: caption,\n\t\t\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\ttransform: ( attributes, innerBlocks ) => {\n\t\t\t\tconst {\n\t\t\t\t\talign,\n\t\t\t\t\tanchor,\n\t\t\t\t\tbackgroundColor,\n\t\t\t\t\tgradient,\n\t\t\t\t\tstyle,\n\t\t\t\t} = attributes;\n\n\t\t\t\t// If the Group block being transformed has a Cover block as its\n\t\t\t\t// only child return that Cover block.\n\t\t\t\tif (\n\t\t\t\t\tinnerBlocks?.length === 1 &&\n\t\t\t\t\tinnerBlocks[ 0 ]?.name === 'core/cover'\n\t\t\t\t) {\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/cover',\n\t\t\t\t\t\tinnerBlocks[ 0 ].attributes,\n\t\t\t\t\t\tinnerBlocks[ 0 ].innerBlocks\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// If no background or gradient color is provided, default to 50% opacity.\n\t\t\t\t// This matches the styling of a Cover block with a background image,\n\t\t\t\t// in the state where a background image has been removed.\n\t\t\t\tconst dimRatio =\n\t\t\t\t\tbackgroundColor ||\n\t\t\t\t\tgradient ||\n\t\t\t\t\tstyle?.color?.background ||\n\t\t\t\t\tstyle?.color?.gradient\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: 50;\n\n\t\t\t\t// Move the background or gradient color to the parent Cover block.\n\t\t\t\tconst parentAttributes = {\n\t\t\t\t\talign,\n\t\t\t\t\tanchor,\n\t\t\t\t\tdimRatio,\n\t\t\t\t\toverlayColor: backgroundColor,\n\t\t\t\t\tcustomOverlayColor: style?.color?.background,\n\t\t\t\t\tgradient,\n\t\t\t\t\tcustomGradient: style?.color?.gradient,\n\t\t\t\t};\n\n\t\t\t\tconst attributesWithoutBackgroundColors = {\n\t\t\t\t\t...attributes,\n\t\t\t\t\tbackgroundColor: undefined,\n\t\t\t\t\tgradient: undefined,\n\t\t\t\t\tstyle: cleanEmptyObject( {\n\t\t\t\t\t\t...attributes?.style,\n\t\t\t\t\t\tcolor: style?.color\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\t\tbackground: undefined,\n\t\t\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t} ),\n\t\t\t\t};\n\n\t\t\t\t// Preserve the block by nesting it within the Cover block,\n\t\t\t\t// instead of converting the Group block directly to the Cover block.\n\t\t\t\treturn createBlock( 'core/cover', parentAttributes, [\n\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\tattributesWithoutBackgroundColors,\n\t\t\t\t\t\tinnerBlocks\n\t\t\t\t\t),\n\t\t\t\t] );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/image' ],\n\t\t\tisMatch: ( {\n\t\t\t\tbackgroundType,\n\t\t\t\turl,\n\t\t\t\toverlayColor,\n\t\t\t\tcustomOverlayColor,\n\t\t\t\tgradient,\n\t\t\t\tcustomGradient,\n\t\t\t} ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\t// If a url exists the transform could happen if that URL represents an image background.\n\t\t\t\t\treturn backgroundType === IMAGE_BACKGROUND_TYPE;\n\t\t\t\t}\n\t\t\t\t// If a url is not set the transform could happen if the cover has no background color or gradient;\n\t\t\t\treturn (\n\t\t\t\t\t! overlayColor &&\n\t\t\t\t\t! customOverlayColor &&\n\t\t\t\t\t! gradient &&\n\t\t\t\t\t! customGradient\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: ( { title, url, alt, align, id, anchor, style } ) =>\n\t\t\t\tcreateBlock( 'core/image', {\n\t\t\t\t\tcaption: title,\n\t\t\t\t\turl,\n\t\t\t\t\talt,\n\t\t\t\t\talign,\n\t\t\t\t\tid,\n\t\t\t\t\tanchor,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\tduotone: style?.color?.duotone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/video' ],\n\t\t\tisMatch: ( {\n\t\t\t\tbackgroundType,\n\t\t\t\turl,\n\t\t\t\toverlayColor,\n\t\t\t\tcustomOverlayColor,\n\t\t\t\tgradient,\n\t\t\t\tcustomGradient,\n\t\t\t} ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\t// If a url exists the transform could happen if that URL represents a video background.\n\t\t\t\t\treturn backgroundType === VIDEO_BACKGROUND_TYPE;\n\t\t\t\t}\n\t\t\t\t// If a url is not set the transform could happen if the cover has no background color or gradient;\n\t\t\t\treturn (\n\t\t\t\t\t! overlayColor &&\n\t\t\t\t\t! customOverlayColor &&\n\t\t\t\t\t! gradient &&\n\t\t\t\t\t! customGradient\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: ( { title, url, align, id, anchor } ) =>\n\t\t\t\tcreateBlock( 'core/video', {\n\t\t\t\t\tcaption: title,\n\t\t\t\t\tsrc: url,\n\t\t\t\t\tid,\n\t\t\t\t\talign,\n\t\t\t\t\tanchor,\n\t\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\tisMatch: ( { url } ) => {\n\t\t\t\t// If the Cover block uses background media, skip this transform,\n\t\t\t\t// and instead use the Group block's default transform.\n\t\t\t\tif ( url ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\ttransform: ( attributes, innerBlocks ) => {\n\t\t\t\t// Convert Cover overlay colors to comparable Group background colors.\n\t\t\t\tconst transformedColorAttributes = {\n\t\t\t\t\tbackgroundColor: attributes?.overlayColor,\n\t\t\t\t\tgradient: attributes?.gradient,\n\t\t\t\t\tstyle: cleanEmptyObject( {\n\t\t\t\t\t\t...attributes?.style,\n\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\tattributes?.customOverlayColor ||\n\t\t\t\t\t\t\tattributes?.customGradient ||\n\t\t\t\t\t\t\tattributes?.style?.color\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\tattributes?.customOverlayColor,\n\t\t\t\t\t\t\t\t\t\tgradient: attributes?.customGradient,\n\t\t\t\t\t\t\t\t\t\t...attributes?.style?.color,\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t} ),\n\t\t\t\t};\n\n\t\t\t\t// If the Cover block contains only a single Group block as a direct child,\n\t\t\t\t// then attempt to merge the Cover's background colors with the child Group block,\n\t\t\t\t// and remove the Cover block as the wrapper.\n\t\t\t\tif (\n\t\t\t\t\tinnerBlocks?.length === 1 &&\n\t\t\t\t\tinnerBlocks[ 0 ]?.name === 'core/group'\n\t\t\t\t) {\n\t\t\t\t\tconst groupAttributes = cleanEmptyObject(\n\t\t\t\t\t\tinnerBlocks[ 0 ].attributes || {}\n\t\t\t\t\t);\n\n\t\t\t\t\t// If the Group block contains any kind of background color or gradient,\n\t\t\t\t\t// skip merging Cover background colors, and preserve the Group block's colors.\n\t\t\t\t\tif (\n\t\t\t\t\t\tgroupAttributes?.backgroundColor ||\n\t\t\t\t\t\tgroupAttributes?.gradient ||\n\t\t\t\t\t\tgroupAttributes?.style?.color?.background ||\n\t\t\t\t\t\tgroupAttributes?.style?.color?.gradient\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t\tgroupAttributes,\n\t\t\t\t\t\t\tinnerBlocks[ 0 ]?.innerBlocks\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...transformedColorAttributes,\n\t\t\t\t\t\t\t...groupAttributes,\n\t\t\t\t\t\t\tstyle: cleanEmptyObject( {\n\t\t\t\t\t\t\t\t...groupAttributes?.style,\n\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\ttransformedColorAttributes?.style?.color ||\n\t\t\t\t\t\t\t\t\tgroupAttributes?.style?.color\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t...transformedColorAttributes\n\t\t\t\t\t\t\t\t\t\t\t\t\t?.style?.color,\n\t\t\t\t\t\t\t\t\t\t\t\t...groupAttributes?.style\n\t\t\t\t\t\t\t\t\t\t\t\t\t?.color,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinnerBlocks[ 0 ]?.innerBlocks\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// In all other cases, transform the Cover block directly to a Group block.\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{ ...attributes, ...transformedColorAttributes },\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = useCoverIsDark;
9
+
10
+ var _fastAverageColor = _interopRequireDefault(require("fast-average-color"));
11
+
12
+ var _colord = require("colord");
13
+
14
+ var _element = require("@wordpress/element");
15
+
16
+ /**
17
+ * External dependencies
18
+ */
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+ function retrieveFastAverageColor() {
24
+ if (!retrieveFastAverageColor.fastAverageColor) {
25
+ retrieveFastAverageColor.fastAverageColor = new _fastAverageColor.default();
26
+ }
27
+
28
+ return retrieveFastAverageColor.fastAverageColor;
29
+ }
30
+ /**
31
+ * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
32
+ * background is dark or not.
33
+ *
34
+ * @param {?string} url Url of the media background.
35
+ * @param {?number} dimRatio Transparency of the overlay color. If an image and
36
+ * color are set, dimRatio is used to decide what is used
37
+ * for background darkness checking purposes.
38
+ * @param {?string} overlayColor String containing the overlay color value if one exists.
39
+ * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a
40
+ * dom element that renders that media.
41
+ *
42
+ * @return {boolean} True if the cover background is considered "dark" and false otherwise.
43
+ */
44
+
45
+
46
+ function useCoverIsDark(url) {
47
+ let dimRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
48
+ let overlayColor = arguments.length > 2 ? arguments[2] : undefined;
49
+ let elementRef = arguments.length > 3 ? arguments[3] : undefined;
50
+ const [isDark, setIsDark] = (0, _element.useState)(false);
51
+ (0, _element.useEffect)(() => {
52
+ // If opacity is lower than 50 the dominant color is the image or video color,
53
+ // so use that color for the dark mode computation.
54
+ if (url && dimRatio <= 50 && elementRef.current) {
55
+ retrieveFastAverageColor().getColorAsync(elementRef.current, color => {
56
+ setIsDark(color.isDark);
57
+ });
58
+ }
59
+ }, [url, url && dimRatio <= 50 && elementRef.current, setIsDark]);
60
+ (0, _element.useEffect)(() => {
61
+ // If opacity is greater than 50 the dominant color is the overlay color,
62
+ // so use that color for the dark mode computation.
63
+ if (dimRatio > 50 || !url) {
64
+ if (!overlayColor) {
65
+ // If no overlay color exists the overlay color is black (isDark )
66
+ setIsDark(true);
67
+ return;
68
+ }
69
+
70
+ setIsDark((0, _colord.colord)(overlayColor).isDark());
71
+ }
72
+ }, [overlayColor, dimRatio > 50 || !url, setIsDark]);
73
+ (0, _element.useEffect)(() => {
74
+ if (!url && !overlayColor) {
75
+ // Reset isDark.
76
+ setIsDark(false);
77
+ }
78
+ }, [!url && !overlayColor, setIsDark]);
79
+ return isDark;
80
+ }
81
+ //# sourceMappingURL=use-cover-is-dark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/cover/use-cover-is-dark.js"],"names":["retrieveFastAverageColor","fastAverageColor","FastAverageColor","useCoverIsDark","url","dimRatio","overlayColor","elementRef","isDark","setIsDark","current","getColorAsync","color"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,wBAAT,GAAoC;AACnC,MAAK,CAAEA,wBAAwB,CAACC,gBAAhC,EAAmD;AAClDD,IAAAA,wBAAwB,CAACC,gBAAzB,GAA4C,IAAIC,yBAAJ,EAA5C;AACA;;AACD,SAAOF,wBAAwB,CAACC,gBAAhC;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACe,SAASE,cAAT,CACdC,GADc,EAKb;AAAA,MAHDC,QAGC,uEAHU,EAGV;AAAA,MAFDC,YAEC;AAAA,MADDC,UACC;AACD,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,KAAV,CAA9B;AACA,0BAAW,MAAM;AAChB;AACA;AACA,QAAKL,GAAG,IAAIC,QAAQ,IAAI,EAAnB,IAAyBE,UAAU,CAACG,OAAzC,EAAmD;AAClDV,MAAAA,wBAAwB,GAAGW,aAA3B,CACCJ,UAAU,CAACG,OADZ,EAEGE,KAAF,IAAa;AACZH,QAAAA,SAAS,CAAEG,KAAK,CAACJ,MAAR,CAAT;AACA,OAJF;AAMA;AACD,GAXD,EAWG,CAAEJ,GAAF,EAAOA,GAAG,IAAIC,QAAQ,IAAI,EAAnB,IAAyBE,UAAU,CAACG,OAA3C,EAAoDD,SAApD,CAXH;AAYA,0BAAW,MAAM;AAChB;AACA;AACA,QAAKJ,QAAQ,GAAG,EAAX,IAAiB,CAAED,GAAxB,EAA8B;AAC7B,UAAK,CAAEE,YAAP,EAAsB;AACrB;AACAG,QAAAA,SAAS,CAAE,IAAF,CAAT;AACA;AACA;;AACDA,MAAAA,SAAS,CAAE,oBAAQH,YAAR,EAAuBE,MAAvB,EAAF,CAAT;AACA;AACD,GAXD,EAWG,CAAEF,YAAF,EAAgBD,QAAQ,GAAG,EAAX,IAAiB,CAAED,GAAnC,EAAwCK,SAAxC,CAXH;AAYA,0BAAW,MAAM;AAChB,QAAK,CAAEL,GAAF,IAAS,CAAEE,YAAhB,EAA+B;AAC9B;AACAG,MAAAA,SAAS,CAAE,KAAF,CAAT;AACA;AACD,GALD,EAKG,CAAE,CAAEL,GAAF,IAAS,CAAEE,YAAb,EAA2BG,SAA3B,CALH;AAMA,SAAOD,MAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport FastAverageColor from 'fast-average-color';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\n\nfunction retrieveFastAverageColor() {\n\tif ( ! retrieveFastAverageColor.fastAverageColor ) {\n\t\tretrieveFastAverageColor.fastAverageColor = new FastAverageColor();\n\t}\n\treturn retrieveFastAverageColor.fastAverageColor;\n}\n\n/**\n * useCoverIsDark is a hook that returns a boolean variable specifying if the cover\n * background is dark or not.\n *\n * @param {?string} url Url of the media background.\n * @param {?number} dimRatio Transparency of the overlay color. If an image and\n * color are set, dimRatio is used to decide what is used\n * for background darkness checking purposes.\n * @param {?string} overlayColor String containing the overlay color value if one exists.\n * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a\n * dom element that renders that media.\n *\n * @return {boolean} True if the cover background is considered \"dark\" and false otherwise.\n */\nexport default function useCoverIsDark(\n\turl,\n\tdimRatio = 50,\n\toverlayColor,\n\telementRef\n) {\n\tconst [ isDark, setIsDark ] = useState( false );\n\tuseEffect( () => {\n\t\t// If opacity is lower than 50 the dominant color is the image or video color,\n\t\t// so use that color for the dark mode computation.\n\t\tif ( url && dimRatio <= 50 && elementRef.current ) {\n\t\t\tretrieveFastAverageColor().getColorAsync(\n\t\t\t\telementRef.current,\n\t\t\t\t( color ) => {\n\t\t\t\t\tsetIsDark( color.isDark );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}, [ url, url && dimRatio <= 50 && elementRef.current, setIsDark ] );\n\tuseEffect( () => {\n\t\t// If opacity is greater than 50 the dominant color is the overlay color,\n\t\t// so use that color for the dark mode computation.\n\t\tif ( dimRatio > 50 || ! url ) {\n\t\t\tif ( ! overlayColor ) {\n\t\t\t\t// If no overlay color exists the overlay color is black (isDark )\n\t\t\t\tsetIsDark( true );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsDark( colord( overlayColor ).isDark() );\n\t\t}\n\t}, [ overlayColor, dimRatio > 50 || ! url, setIsDark ] );\n\tuseEffect( () => {\n\t\tif ( ! url && ! overlayColor ) {\n\t\t\t// Reset isDark.\n\t\t\tsetIsDark( false );\n\t\t}\n\t}, [ ! url && ! overlayColor, setIsDark ] );\n\treturn isDark;\n}\n"]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = useCoverIsDark;
7
+
8
+ var _colord = require("colord");
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ /**
13
+ * External dependencies
14
+ */
15
+
16
+ /**
17
+ * WordPress dependencies
18
+ */
19
+
20
+ /**
21
+ * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
22
+ * background is dark or not.
23
+ *
24
+ * @param {?boolean} initialValue Initial value.
25
+ * @param {?string} url Url of the media background.
26
+ * @param {?number} dimRatio Transparency of the overlay color. If an image and
27
+ * color are set, dimRatio is used to decide what is used
28
+ * for background darkness checking purposes.
29
+ * @param {?string} overlayColor String containing the overlay color value if one exists.
30
+ *
31
+ * @return {boolean} True if the cover background is considered "dark" and false otherwise.
32
+ */
33
+ function useCoverIsDark() {
34
+ let initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
35
+ let url = arguments.length > 1 ? arguments[1] : undefined;
36
+ let dimRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 50;
37
+ let overlayColor = arguments.length > 3 ? arguments[3] : undefined;
38
+ const [isDark, setIsDark] = (0, _element.useState)(initialValue);
39
+ (0, _element.useEffect)(() => {
40
+ // If opacity is greater than 50 the dominant color is the overlay color,
41
+ // so use that color for the dark mode computation.
42
+ if (dimRatio > 50 || !url) {
43
+ if (!overlayColor) {
44
+ // If no overlay color exists the overlay color is black (isDark )
45
+ setIsDark(true);
46
+ return;
47
+ }
48
+
49
+ setIsDark((0, _colord.colord)(overlayColor).isDark());
50
+ }
51
+ }, [overlayColor, dimRatio > 50 || !url, setIsDark]);
52
+ (0, _element.useEffect)(() => {
53
+ if (!url && !overlayColor) {
54
+ // Reset isDark.
55
+ setIsDark(false);
56
+ }
57
+ }, [!url && !overlayColor, setIsDark]);
58
+ return isDark;
59
+ }
60
+ //# sourceMappingURL=use-cover-is-dark.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/cover/use-cover-is-dark.native.js"],"names":["useCoverIsDark","initialValue","url","dimRatio","overlayColor","isDark","setIsDark"],"mappings":";;;;;;;AAIA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,GAKb;AAAA,MAJDC,YAIC,uEAJc,KAId;AAAA,MAHDC,GAGC;AAAA,MAFDC,QAEC,uEAFU,EAEV;AAAA,MADDC,YACC;AACD,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAUL,YAAV,CAA9B;AACA,0BAAW,MAAM;AAChB;AACA;AACA,QAAKE,QAAQ,GAAG,EAAX,IAAiB,CAAED,GAAxB,EAA8B;AAC7B,UAAK,CAAEE,YAAP,EAAsB;AACrB;AACAE,QAAAA,SAAS,CAAE,IAAF,CAAT;AACA;AACA;;AACDA,MAAAA,SAAS,CAAE,oBAAQF,YAAR,EAAuBC,MAAvB,EAAF,CAAT;AACA;AACD,GAXD,EAWG,CAAED,YAAF,EAAgBD,QAAQ,GAAG,EAAX,IAAiB,CAAED,GAAnC,EAAwCI,SAAxC,CAXH;AAYA,0BAAW,MAAM;AAChB,QAAK,CAAEJ,GAAF,IAAS,CAAEE,YAAhB,EAA+B;AAC9B;AACAE,MAAAA,SAAS,CAAE,KAAF,CAAT;AACA;AACD,GALD,EAKG,CAAE,CAAEJ,GAAF,IAAS,CAAEE,YAAb,EAA2BE,SAA3B,CALH;AAMA,SAAOD,MAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\n\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * useCoverIsDark is a hook that returns a boolean variable specifying if the cover\n * background is dark or not.\n *\n * @param {?boolean} initialValue Initial value.\n * @param {?string} url Url of the media background.\n * @param {?number} dimRatio Transparency of the overlay color. If an image and\n * color are set, dimRatio is used to decide what is used\n * for background darkness checking purposes.\n * @param {?string} overlayColor String containing the overlay color value if one exists.\n *\n * @return {boolean} True if the cover background is considered \"dark\" and false otherwise.\n */\nexport default function useCoverIsDark(\n\tinitialValue = false,\n\turl,\n\tdimRatio = 50,\n\toverlayColor\n) {\n\tconst [ isDark, setIsDark ] = useState( initialValue );\n\tuseEffect( () => {\n\t\t// If opacity is greater than 50 the dominant color is the overlay color,\n\t\t// so use that color for the dark mode computation.\n\t\tif ( dimRatio > 50 || ! url ) {\n\t\t\tif ( ! overlayColor ) {\n\t\t\t\t// If no overlay color exists the overlay color is black (isDark )\n\t\t\t\tsetIsDark( true );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsDark( colord( overlayColor ).isDark() );\n\t\t}\n\t}, [ overlayColor, dimRatio > 50 || ! url, setIsDark ] );\n\tuseEffect( () => {\n\t\tif ( ! url && ! overlayColor ) {\n\t\t\t// Reset isDark.\n\t\t\tsetIsDark( false );\n\t\t}\n\t}, [ ! url && ! overlayColor, setIsDark ] );\n\treturn isDark;\n}\n"]}
@@ -48,6 +48,7 @@ const metadata = {
48
48
  }
49
49
  },
50
50
  supports: {
51
+ __experimentalSettings: true,
51
52
  align: ["wide", "full"],
52
53
  anchor: true,
53
54
  html: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["name","metadata","settings","icon","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","edit","save","deprecated","variations"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,KAAK,EAAE;AACNC,QAAAA,KAAK,EAAE;AACNC,UAAAA,IAAI,EAAE,SADA;AAENC,UAAAA,UAAU,EAAE;AAFN;AADD;AADI,KADJ;AASRC,IAAAA,WAAW,EAAE,CACZ;AACCV,MAAAA,IAAI,EAAE,gBADP;AAECK,MAA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EuB;AAkEvBC,EAAAA,UAAU,EAAVA;AAlEuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { group as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tstyle: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: '#000000',\n\t\t\t\t\tbackground: '#ffffff',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#cf2e2e',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'One.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#ff6900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Two.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#fcb900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Three.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#00d084',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Four.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#0693e3',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Five.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#9b51e0',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Six.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["name","metadata","settings","icon","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","edit","save","deprecated","variations"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,KAAK,EAAE;AACNC,QAAAA,KAAK,EAAE;AACNC,UAAAA,IAAI,EAAE,SADA;AAENC,UAAAA,UAAU,EAAE;AAFN;AADD;AADI,KADJ;AASRC,IAAAA,WAAW,EAAE,CACZ;AACCV,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXM,QAAAA,eAAe,EAAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,MAAJ;AAHE;AAFb,KADY,EASZ;AACCb,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXM,QAAAA,eAAe,EAAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,MAAJ;AAHE;AAFb,KATY,EAiBZ;AACCb,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXM,QAAAA,eAAe,EAAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,QAAJ;AAHE;AAFb,KAjBY,EAyBZ;AACCb,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXM,QAAAA,eAAe,EAAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,OAAJ;AAHE;AAFb,KAzBY,EAiCZ;AACCb,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXM,QAAAA,eAAe,EAAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,OAAJ;AAHE;AAFb,KAjCY,EAyCZ;AACCb,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXM,QAAAA,eAAe,EAAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,MAAJ;AAHE;AAFb,KAzCY;AATL,GAFc;AA8DvBC,EAAAA,UAAU,EAAVA,mBA9DuB;AA+DvBC,EAAAA,IAAI,EAAJA,aA/DuB;AAgEvBC,EAAAA,IAAI,EAAJA,aAhEuB;AAiEvBC,EAAAA,UAAU,EAAVA,mBAjEuB;AAkEvBC,EAAAA,UAAU,EAAVA;AAlEuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { group as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tstyle: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: '#000000',\n\t\t\t\t\tbackground: '#ffffff',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#cf2e2e',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'One.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#ff6900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Two.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#fcb900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Three.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#00d084',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Four.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#0693e3',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Five.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#9b51e0',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Six.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n};\n"]}
@@ -88,11 +88,13 @@ const transforms = {
88
88
  transform: attributes => attributes.map(_ref => {
89
89
  let {
90
90
  content,
91
- anchor
91
+ anchor,
92
+ align: textAlign
92
93
  } = _ref;
93
94
  return (0, _blocks.createBlock)(name, {
94
95
  content,
95
- anchor
96
+ anchor,
97
+ textAlign
96
98
  });
97
99
  })
98
100
  }, {
@@ -160,10 +162,12 @@ const transforms = {
160
162
  blocks: ['core/paragraph'],
161
163
  transform: attributes => attributes.map(_ref3 => {
162
164
  let {
163
- content
165
+ content,
166
+ textAlign: align
164
167
  } = _ref3;
165
168
  return (0, _blocks.createBlock)('core/paragraph', {
166
- content
169
+ content,
170
+ align
167
171
  });
168
172
  })
169
173
  }]
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/heading/transforms.js"],"names":["transforms","from","type","isMultiBlock","blocks","transform","attributes","map","content","anchor","name","selector","schema","phrasingContentSchema","isPaste","children","h1","h2","h3","h4","h5","h6","node","outerHTML","textAlign","style","level","nodeName","align","prefix","Array","join","regExp","RegExp","to"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,YAAY,EAAE,IAFf;AAGCC,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAHT;AAICC,IAAAA,SAAS,EAAIC,UAAF,IACVA,UAAU,CAACC,GAAX,CAAgB;AAAA,UAAE;AAAEC,QAAAA,OAAF;AAAWC,QAAAA;AAAX,OAAF;AAAA,aACf,yBAAaC,IAAb,EAAmB;AAClBF,QAAAA,OADkB;AAElBC,QAAAA;AAFkB,OAAnB,CADe;AAAA,KAAhB;AALF,GADK,EAaL;AACCP,IAAAA,IAAI,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,IAAnB,CAAyB,GAAzB,CAFmC;;AAG3C1B,IAAAA,SAAS,CAAEG,OAAF,EAAY;AACpB,aAAO,yBAAaE,IAAb,EAAmB;AACzBgB,QAAAA,KADyB;AAEzBlB,QAAAA;AAFyB,OAAnB,CAAP;AAIA;;AAR0C,GAAf,CAA1B,CA/CE,EAyDL,GAAG,CAAE,CAAF,EAAK,CAAL,EAAQ,CAAR,EAAW,CAAX,EAAc,CAAd,EAAiB,CAAjB,EAAqBD,GAArB,CAA4BmB,KAAF,KAAe;AAC3CxB,IAAAA,IAAI,EAAE,OADqC;AAE3C8B,IAAAA,MAAM,EAAE,IAAIC,MAAJ,CAAa,UAAUP,KAAO,GAA9B,CAFmC;;AAG3CrB,IAAAA,SAAS,CAAEG,OAAF,EAAY;AACpB,aAAO,yBAAaE,IAAb,EAAmB;AACzBgB,QAAAA,KADyB;AAEzBlB,QAAAA;AAFyB,OAAnB,CAAP;AAIA;;AAR0C,GAAf,CAA1B,CAzDE,CADY;AAqElB0B,EAAAA,EAAE,EAAE,CACH;AACChC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,YAAY,EAAE,IAFf;AAGCC,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAHT;AAICC,IAAAA,SAAS,EAAIC,UAAF,IACVA,UAAU,CAACC,GAAX,CAAgB;AAAA,UAAE;AAAEC,QAAAA;AAAF,OAAF;AAAA,aACf,yBAAa,gBAAb,EAA+B;AAAEA,QAAAA;AAAF,OAA/B,CADe;AAAA,KAAhB;AALF,GADG;AArEc,CAAnB;eAkFeR,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getLevelFromHeadingNodeName } from './shared';\nimport { name } from './block.json';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( attributes ) =>\n\t\t\t\tattributes.map( ( { content, anchor } ) =>\n\t\t\t\t\tcreateBlock( name, {\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t} )\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'h1,h2,h3,h4,h5,h6',\n\t\t\tschema: ( { phrasingContentSchema, isPaste } ) => {\n\t\t\t\tconst schema = {\n\t\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\t\tattributes: isPaste ? [] : [ 'style', 'id' ],\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\th1: schema,\n\t\t\t\t\th2: schema,\n\t\t\t\t\th3: schema,\n\t\t\t\t\th4: schema,\n\t\t\t\t\th5: schema,\n\t\t\t\t\th6: schema,\n\t\t\t\t};\n\t\t\t},\n\t\t\ttransform( node ) {\n\t\t\t\tconst attributes = getBlockAttributes( name, node.outerHTML );\n\t\t\t\tconst { textAlign } = node.style || {};\n\n\t\t\t\tattributes.level = getLevelFromHeadingNodeName( node.nodeName );\n\n\t\t\t\tif (\n\t\t\t\t\ttextAlign === 'left' ||\n\t\t\t\t\ttextAlign === 'center' ||\n\t\t\t\t\ttextAlign === 'right'\n\t\t\t\t) {\n\t\t\t\t\tattributes.align = textAlign;\n\t\t\t\t}\n\n\t\t\t\treturn createBlock( name, attributes );\n\t\t\t},\n\t\t},\n\t\t...[ 1, 2, 3, 4, 5, 6 ].map( ( level ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix: Array( level + 1 ).join( '#' ),\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( name, {\n\t\t\t\t\tlevel,\n\t\t\t\t\tcontent,\n\t\t\t\t} );\n\t\t\t},\n\t\t} ) ),\n\t\t...[ 1, 2, 3, 4, 5, 6 ].map( ( level ) => ( {\n\t\t\ttype: 'enter',\n\t\t\tregExp: new RegExp( `^/(h|H)${ level }$` ),\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( name, {\n\t\t\t\t\tlevel,\n\t\t\t\t\tcontent,\n\t\t\t\t} );\n\t\t\t},\n\t\t} ) ),\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( attributes ) =>\n\t\t\t\tattributes.map( ( { content } ) =>\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content } )\n\t\t\t\t),\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/heading/transforms.js"],"names":["transforms","from","type","isMultiBlock","blocks","transform","attributes","map","content","anchor","align","textAlign","name","selector","schema","phrasingContentSchema","isPaste","children","h1","h2","h3","h4","h5","h6","node","outerHTML","style","level","nodeName","prefix","Array","join","regExp","RegExp","to"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,YAAY,EAAE,IAFf;AAGCC,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAHT;AAICC,IAAAA,SAAS,EAAIC,UAAF,IACVA,UAAU,CAACC,GAAX,CAAgB;AAAA,UAAE;AAAEC,QAAAA,OAAF;AAAWC,QAAAA,MAAX;AAAmBC,QAAAA,KAAK,EAAEC;AAA1B,OAAF;AAAA,aACf,yBAAaC,IAAb,EAAmB;AAClBJ,QAAAA,OADkB;AAElBC,QAAAA,MAFkB;AAGlBE,QAAAA;AAHkB,OAAnB,CADe;AAAA,KAAhB;AALF,GADK,EAcL;AACCT,IAAAA,IAAI,EAAE,KADP;AAECW,IAAAA,QAAQ,EAAE,mBAFX;AAGCC,IAAAA,MAAM,EAAE,SAA0C;AAAA,UAAxC;AAA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AmB;AACzBe,QAAAA,KADyB;AAEzBnB,QAAAA;AAFyB,OAAnB,CAAP;AAIA;;AAR0C,GAAf,CAA1B,CAhDE,EA0DL,GAAG,CAAE,CAAF,EAAK,CAAL,EAAQ,CAAR,EAAW,CAAX,EAAc,CAAd,EAAiB,CAAjB,EAAqBD,GAArB,CAA4BoB,KAAF,KAAe;AAC3CzB,IAAAA,IAAI,EAAE,OADqC;AAE3C8B,IAAAA,MAAM,EAAE,IAAIC,MAAJ,CAAa,UAAUN,KAAO,GAA9B,CAFmC;;AAG3CtB,IAAAA,SAAS,CAAEG,OAAF,EAAY;AACpB,aAAO,yBAAaI,IAAb,EAAmB;AACzBe,QAAAA,KADyB;AAEzBnB,QAAAA;AAFyB,OAAnB,CAAP;AAIA;;AAR0C,GAAf,CAA1B,CA1DE,CADY;AAsElB0B,EAAAA,EAAE,EAAE,CACH;AACChC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,YAAY,EAAE,IAFf;AAGCC,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAHT;AAICC,IAAAA,SAAS,EAAIC,UAAF,IACVA,UAAU,CAACC,GAAX,CAAgB;AAAA,UAAE;AAAEC,QAAAA,OAAF;AAAWG,QAAAA,SAAS,EAAED;AAAtB,OAAF;AAAA,aACf,yBAAa,gBAAb,EAA+B;AAAEF,QAAAA,OAAF;AAAWE,QAAAA;AAAX,OAA/B,CADe;AAAA,KAAhB;AALF,GADG;AAtEc,CAAnB;eAmFeV,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getLevelFromHeadingNodeName } from './shared';\nimport { name } from './block.json';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( attributes ) =>\n\t\t\t\tattributes.map( ( { content, anchor, align: textAlign } ) =>\n\t\t\t\t\tcreateBlock( name, {\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\ttextAlign,\n\t\t\t\t\t} )\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'h1,h2,h3,h4,h5,h6',\n\t\t\tschema: ( { phrasingContentSchema, isPaste } ) => {\n\t\t\t\tconst schema = {\n\t\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\t\tattributes: isPaste ? [] : [ 'style', 'id' ],\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\th1: schema,\n\t\t\t\t\th2: schema,\n\t\t\t\t\th3: schema,\n\t\t\t\t\th4: schema,\n\t\t\t\t\th5: schema,\n\t\t\t\t\th6: schema,\n\t\t\t\t};\n\t\t\t},\n\t\t\ttransform( node ) {\n\t\t\t\tconst attributes = getBlockAttributes( name, node.outerHTML );\n\t\t\t\tconst { textAlign } = node.style || {};\n\n\t\t\t\tattributes.level = getLevelFromHeadingNodeName( node.nodeName );\n\n\t\t\t\tif (\n\t\t\t\t\ttextAlign === 'left' ||\n\t\t\t\t\ttextAlign === 'center' ||\n\t\t\t\t\ttextAlign === 'right'\n\t\t\t\t) {\n\t\t\t\t\tattributes.align = textAlign;\n\t\t\t\t}\n\n\t\t\t\treturn createBlock( name, attributes );\n\t\t\t},\n\t\t},\n\t\t...[ 1, 2, 3, 4, 5, 6 ].map( ( level ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix: Array( level + 1 ).join( '#' ),\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( name, {\n\t\t\t\t\tlevel,\n\t\t\t\t\tcontent,\n\t\t\t\t} );\n\t\t\t},\n\t\t} ) ),\n\t\t...[ 1, 2, 3, 4, 5, 6 ].map( ( level ) => ( {\n\t\t\ttype: 'enter',\n\t\t\tregExp: new RegExp( `^/(h|H)${ level }$` ),\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( name, {\n\t\t\t\t\tlevel,\n\t\t\t\t\tcontent,\n\t\t\t\t} );\n\t\t\t},\n\t\t} ) ),\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( attributes ) =>\n\t\t\t\tattributes.map( ( { content, textAlign: align } ) =>\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content, align } )\n\t\t\t\t),\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
package/build/index.js CHANGED
@@ -29,6 +29,8 @@ var column = _interopRequireWildcard(require("./column"));
29
29
 
30
30
  var columns = _interopRequireWildcard(require("./columns"));
31
31
 
32
+ var comments = _interopRequireWildcard(require("./comments"));
33
+
32
34
  var commentAuthorAvatar = _interopRequireWildcard(require("./comment-author-avatar"));
33
35
 
34
36
  var commentAuthorName = _interopRequireWildcard(require("./comment-author-name"));
@@ -45,8 +47,6 @@ var commentTemplate = _interopRequireWildcard(require("./comment-template"));
45
47
 
46
48
  var commentsPaginationPrevious = _interopRequireWildcard(require("./comments-pagination-previous"));
47
49
 
48
- var commentsQueryLoop = _interopRequireWildcard(require("./comments-query-loop"));
49
-
50
50
  var commentsPagination = _interopRequireWildcard(require("./comments-pagination"));
51
51
 
52
52
  var commentsPaginationNext = _interopRequireWildcard(require("./comments-pagination-next"));
@@ -91,8 +91,6 @@ var more = _interopRequireWildcard(require("./more"));
91
91
 
92
92
  var navigation = _interopRequireWildcard(require("./navigation"));
93
93
 
94
- var navigationArea = _interopRequireWildcard(require("./navigation-area"));
95
-
96
94
  var navigationLink = _interopRequireWildcard(require("./navigation-link"));
97
95
 
98
96
  var navigationSubmenu = _interopRequireWildcard(require("./navigation-submenu"));
@@ -246,7 +244,7 @@ paragraph, image, heading, gallery, list, quote, // Register all remaining core
246
244
  archives, audio, button, buttons, calendar, categories, window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.
247
245
  code, column, columns, cover, embed, file, group, html, latestComments, latestPosts, mediaText, missing, more, nextpage, pageList, pattern, preformatted, pullquote, reusableBlock, rss, search, separator, shortcode, socialLink, socialLinks, spacer, table, // tableOfContents,
248
246
  tagCloud, textColumns, verse, video, // theme blocks
249
- navigation, navigationLink, navigationSubmenu, siteLogo, siteTitle, siteTagline, query, templatePart, avatar, postTitle, postExcerpt, postFeaturedImage, postContent, postAuthor, postDate, postTerms, postNavigationLink, postTemplate, queryPagination, queryPaginationNext, queryPaginationNumbers, queryPaginationPrevious, queryNoResults, readMore, commentAuthorName, commentContent, commentDate, commentEditLink, commentReplyLink, commentTemplate, commentsTitle, commentsQueryLoop, commentsPagination, commentsPaginationNext, commentsPaginationNumbers, commentsPaginationPrevious, postComments, homeLink, logInOut, termDescription, queryTitle, postAuthorBiography];
247
+ navigation, navigationLink, navigationSubmenu, siteLogo, siteTitle, siteTagline, query, templatePart, avatar, postTitle, postExcerpt, postFeaturedImage, postContent, postAuthor, postDate, postTerms, postNavigationLink, postTemplate, queryPagination, queryPaginationNext, queryPaginationNumbers, queryPaginationPrevious, queryNoResults, readMore, comments, commentAuthorName, commentContent, commentDate, commentEditLink, commentReplyLink, commentTemplate, commentsTitle, commentsPagination, commentsPaginationNext, commentsPaginationNumbers, commentsPaginationPrevious, postComments, postCommentsForm, homeLink, logInOut, termDescription, queryTitle, postAuthorBiography];
250
248
  /**
251
249
  * Function to register core blocks provided by the block editor.
252
250
  *
@@ -296,7 +294,7 @@ const __experimentalRegisterExperimentalCoreBlocks = process.env.IS_GUTENBERG_PL
296
294
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
297
295
  [// Experimental blocks.
298
296
  postAuthorName, ...(window.__experimentalEnableListBlockV2 ? [listItem] : []), // Full Site Editing blocks.
299
- ...(enableFSEBlocks ? [commentAuthorAvatar, navigationArea, postComment, postCommentsCount, postCommentsForm, postCommentsLink] : [])].forEach(registerBlock);
297
+ ...(enableFSEBlocks ? [commentAuthorAvatar, postComment, postCommentsCount, postCommentsLink] : [])].forEach(registerBlock);
300
298
  } : undefined;
301
299
 
302
300
  exports.__experimentalRegisterExperimentalCoreBlocks = __experimentalRegisterExperimentalCoreBlocks;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","paragraph","image","heading","gallery","list","quote","archives","audio","button","buttons","calendar","categories","window","wp","oldEditor","classic","code","column","columns","cover","embed","file","group","html","latestComments","latestPosts","mediaText","missing","more","nextpage","pageList","pattern","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","socialLink","socialLinks","spacer","table","tagCloud","textColumns","verse","video","navigation","navigationLink","navigationSubmenu","siteLogo","siteTitle","siteTagline","query","templatePart","avatar","postTitle","postExcerpt","postFeaturedImage","postContent","postAuthor","postDate","postTerms","postNavigationLink","postTemplate","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryNoResults","readMore","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsTitle","commentsQueryLoop","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsPaginationPrevious","postComments","homeLink","logInOut","termDescription","queryTitle","postAuthorBiography","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","postAuthorName","__experimentalEnableListBlockV2","listItem","commentAuthorAvatar","navigationArea","postComment","postCommentsCount","postCommentsForm","postCommentsLink","undefined"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAC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AACC,OAAP,CAAgBjG,aAAhB;AAEA,mCAAqBM,SAAS,CAACF,IAA/B;;AACA,MAAKc,MAAM,CAACC,EAAP,IAAaD,MAAM,CAACC,EAAP,CAAUC,SAA5B,EAAwC;AACvC,+CAA+BC,OAAO,CAACjB,IAAvC;AACA;;AACD,8CAAgC6B,OAAO,CAAC7B,IAAxC;AACA,oCAAsBwB,KAAK,CAACxB,IAA5B;AACA,CAXM;AAaP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM8F,4CAA4C,GAAGC,OAAO,CAACC,GAAR,CAC1DC,mBAD0D,GAEzD,YAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B,uEAAR,EAAQ;AAChC,GACC;AACAC,EAAAA,cAFD,EAGC,IAAKrF,MAAM,CAACsF,+BAAP,GACF,CAAEC,QAAF,CADE,GAEF,EAFH,CAHD,EAOC;AACA,MAAKH,eAAe,GACjB,CACAI,mBADA,EAEAC,cAFA,EAGAC,WAHA,EAIAC,iBAJA,EAKAC,gBALA,EAMAC,gBANA,CADiB,GASjB,EATH,CARD,EAkBEd,OAlBF,CAkBWjG,aAlBX;AAmBC,CAtBwD,GAuBzDgH,SAvBI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsQueryLoop from './comments-query-loop';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationArea from './navigation-area';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tavatar,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tqueryNoResults,\n\treadMore,\n\tcommentAuthorName,\n\tcommentContent,\n\tcommentDate,\n\tcommentEditLink,\n\tcommentReplyLink,\n\tcommentTemplate,\n\tcommentsTitle,\n\tcommentsQueryLoop,\n\tcommentsPagination,\n\tcommentsPaginationNext,\n\tcommentsPaginationNumbers,\n\tcommentsPaginationPrevious,\n\n\tpostComments,\n\thomeLink,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorBiography,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t[\n\t\t\t\t// Experimental blocks.\n\t\t\t\tpostAuthorName,\n\t\t\t\t...( window.__experimentalEnableListBlockV2\n\t\t\t\t\t? [ listItem ]\n\t\t\t\t\t: [] ),\n\n\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\tnavigationArea,\n\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\tpostCommentsForm,\n\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t ]\n\t\t\t\t\t: [] ),\n\t\t\t].forEach( registerBlock );\n\t }\n\t: undefined;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","paragraph","image","heading","gallery","list","quote","archives","audio","button","buttons","calendar","categories","window","wp","oldEditor","classic","code","column","columns","cover","embed","file","group","html","latestComments","latestPosts","mediaText","missing","more","nextpage","pageList","pattern","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","socialLink","socialLinks","spacer","table","tagCloud","textColumns","verse","video","navigation","navigationLink","navigationSubmenu","siteLogo","siteTitle","siteTagline","query","templatePart","avatar","postTitle","postExcerpt","postFeaturedImage","postContent","postAuthor","postDate","postTerms","postNavigationLink","postTemplate","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryNoResults","readMore","comments","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsTitle","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsPaginationPrevious","postComments","postCommentsForm","homeLink","logInOut","termDescription","queryTitle","postAuthorBiography","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","postAuthorName","__experimentalEnableListBlockV2","listItem","commentAuthorAvatar","postComment","postCommentsCount","postCommentsLink","undefined"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AA1GA;AACA;AACA;;AASA;AACA;AACA;;AA+FA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,aAAa,GAAKC,KAAF,IAAa;AAClC,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AACD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BH,KAArC;AACA,iCAAmB;AAAEG,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAnB,EAA0CC,QAA1C;AACA,CAND;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,2BAA2B,GAAG,MAAM,CAChD;AACA;AACAC,SAHgD,EAIhDC,KAJgD,EAKhDC,OALgD,EAMhDC,OANgD,EAOhDC,IAPgD,EAQhDC,KARgD,EAUhD;AACAC,QAXgD,EAYhDC,KAZgD,EAah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aultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as comments from './comments';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tavatar,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tqueryNoResults,\n\treadMore,\n\tcomments,\n\tcommentAuthorName,\n\tcommentContent,\n\tcommentDate,\n\tcommentEditLink,\n\tcommentReplyLink,\n\tcommentTemplate,\n\tcommentsTitle,\n\tcommentsPagination,\n\tcommentsPaginationNext,\n\tcommentsPaginationNumbers,\n\tcommentsPaginationPrevious,\n\tpostComments,\n\tpostCommentsForm,\n\thomeLink,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorBiography,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t[\n\t\t\t\t// Experimental blocks.\n\t\t\t\tpostAuthorName,\n\t\t\t\t...( window.__experimentalEnableListBlockV2\n\t\t\t\t\t? [ listItem ]\n\t\t\t\t\t: [] ),\n\n\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t ]\n\t\t\t\t\t: [] ),\n\t\t\t].forEach( registerBlock );\n\t }\n\t: undefined;\n"]}