@wordpress/block-library 9.11.0 → 9.12.1-next.082ed6819.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 (272) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/block-keyboard-shortcuts/index.js +7 -7
  3. package/build/block-keyboard-shortcuts/index.js.map +1 -1
  4. package/build/button/index.js +1 -1
  5. package/build/button/index.js.map +1 -1
  6. package/build/cover/deprecated.js +140 -4
  7. package/build/cover/deprecated.js.map +1 -1
  8. package/build/cover/edit/block-controls.js +1 -1
  9. package/build/cover/edit/block-controls.js.map +1 -1
  10. package/build/cover/edit/cover-placeholder.js +1 -2
  11. package/build/cover/edit/cover-placeholder.js.map +1 -1
  12. package/build/cover/edit/index.js +23 -23
  13. package/build/cover/edit/index.js.map +1 -1
  14. package/build/cover/index.js +10 -10
  15. package/build/cover/index.js.map +1 -1
  16. package/build/cover/save.js +13 -13
  17. package/build/cover/save.js.map +1 -1
  18. package/build/cover/shared.js +6 -7
  19. package/build/cover/shared.js.map +1 -1
  20. package/build/details/index.js +20 -0
  21. package/build/details/index.js.map +1 -1
  22. package/build/file/edit.js +8 -4
  23. package/build/file/edit.js.map +1 -1
  24. package/build/freeform/modal.js +1 -1
  25. package/build/freeform/modal.js.map +1 -1
  26. package/build/gallery/edit.js +1 -1
  27. package/build/gallery/edit.js.map +1 -1
  28. package/build/heading/index.js +1 -7
  29. package/build/heading/index.js.map +1 -1
  30. package/build/home-link/edit.js +20 -36
  31. package/build/home-link/edit.js.map +1 -1
  32. package/build/image/edit.js +1 -1
  33. package/build/image/edit.js.map +1 -1
  34. package/build/image/image.js +144 -78
  35. package/build/image/image.js.map +1 -1
  36. package/build/image/index.js +1 -1
  37. package/build/latest-posts/edit.js +0 -1
  38. package/build/latest-posts/edit.js.map +1 -1
  39. package/build/lock-unlock.js.map +1 -1
  40. package/build/navigation/edit/index.js +2 -23
  41. package/build/navigation/edit/index.js.map +1 -1
  42. package/build/navigation/use-template-part-area-label.js +6 -8
  43. package/build/navigation/use-template-part-area-label.js.map +1 -1
  44. package/build/page-list/index.js +14 -0
  45. package/build/page-list/index.js.map +1 -1
  46. package/build/paragraph/edit.js +26 -25
  47. package/build/paragraph/edit.js.map +1 -1
  48. package/build/post-content/index.js +13 -0
  49. package/build/post-content/index.js.map +1 -1
  50. package/build/post-template/edit.js +11 -0
  51. package/build/post-template/edit.js.map +1 -1
  52. package/build/post-template/index.js +1 -1
  53. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
  54. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  55. package/build/query/edit/inspector-controls/index.js +3 -13
  56. package/build/query/edit/inspector-controls/index.js.map +1 -1
  57. package/build/query/edit/pattern-selection-modal.js +0 -3
  58. package/build/query/edit/pattern-selection-modal.js.map +1 -1
  59. package/build/query/edit/query-content.js +10 -12
  60. package/build/query/edit/query-content.js.map +1 -1
  61. package/build/query/index.js +1 -1
  62. package/build/query/utils.js +38 -9
  63. package/build/query/utils.js.map +1 -1
  64. package/build/social-link/edit.js +22 -9
  65. package/build/social-link/edit.js.map +1 -1
  66. package/build/template-part/edit/advanced-controls.js +2 -7
  67. package/build/template-part/edit/advanced-controls.js.map +1 -1
  68. package/build/template-part/edit/index.js +1 -4
  69. package/build/template-part/edit/index.js.map +1 -1
  70. package/build/template-part/edit/selection-modal.js +0 -3
  71. package/build/template-part/edit/selection-modal.js.map +1 -1
  72. package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
  73. package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
  74. package/build/template-part/edit/utils/hooks.js +1 -6
  75. package/build/template-part/edit/utils/hooks.js.map +1 -1
  76. package/build/template-part/variations.js +6 -12
  77. package/build/template-part/variations.js.map +1 -1
  78. package/build/video/edit.js +1 -1
  79. package/build/video/edit.js.map +1 -1
  80. package/build/video/tracks-editor.js +135 -123
  81. package/build/video/tracks-editor.js.map +1 -1
  82. package/build-module/block-keyboard-shortcuts/index.js +7 -7
  83. package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
  84. package/build-module/button/index.js +1 -1
  85. package/build-module/button/index.js.map +1 -1
  86. package/build-module/cover/deprecated.js +140 -4
  87. package/build-module/cover/deprecated.js.map +1 -1
  88. package/build-module/cover/edit/block-controls.js +1 -1
  89. package/build-module/cover/edit/block-controls.js.map +1 -1
  90. package/build-module/cover/edit/cover-placeholder.js +1 -2
  91. package/build-module/cover/edit/cover-placeholder.js.map +1 -1
  92. package/build-module/cover/edit/index.js +23 -23
  93. package/build-module/cover/edit/index.js.map +1 -1
  94. package/build-module/cover/index.js +10 -10
  95. package/build-module/cover/index.js.map +1 -1
  96. package/build-module/cover/save.js +13 -13
  97. package/build-module/cover/save.js.map +1 -1
  98. package/build-module/cover/shared.js +6 -7
  99. package/build-module/cover/shared.js.map +1 -1
  100. package/build-module/details/index.js +21 -1
  101. package/build-module/details/index.js.map +1 -1
  102. package/build-module/file/edit.js +8 -4
  103. package/build-module/file/edit.js.map +1 -1
  104. package/build-module/freeform/modal.js +1 -1
  105. package/build-module/freeform/modal.js.map +1 -1
  106. package/build-module/gallery/edit.js +1 -1
  107. package/build-module/gallery/edit.js.map +1 -1
  108. package/build-module/heading/index.js +1 -7
  109. package/build-module/heading/index.js.map +1 -1
  110. package/build-module/home-link/edit.js +23 -39
  111. package/build-module/home-link/edit.js.map +1 -1
  112. package/build-module/image/edit.js +1 -1
  113. package/build-module/image/edit.js.map +1 -1
  114. package/build-module/image/image.js +149 -83
  115. package/build-module/image/image.js.map +1 -1
  116. package/build-module/image/index.js +1 -1
  117. package/build-module/latest-posts/edit.js +0 -1
  118. package/build-module/latest-posts/edit.js.map +1 -1
  119. package/build-module/lock-unlock.js.map +1 -1
  120. package/build-module/navigation/edit/index.js +2 -23
  121. package/build-module/navigation/edit/index.js.map +1 -1
  122. package/build-module/navigation/use-template-part-area-label.js +6 -8
  123. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  124. package/build-module/page-list/index.js +14 -0
  125. package/build-module/page-list/index.js.map +1 -1
  126. package/build-module/paragraph/edit.js +26 -25
  127. package/build-module/paragraph/edit.js.map +1 -1
  128. package/build-module/post-content/index.js +13 -0
  129. package/build-module/post-content/index.js.map +1 -1
  130. package/build-module/post-template/edit.js +11 -0
  131. package/build-module/post-template/edit.js.map +1 -1
  132. package/build-module/post-template/index.js +1 -1
  133. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
  134. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  135. package/build-module/query/edit/inspector-controls/index.js +3 -13
  136. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  137. package/build-module/query/edit/pattern-selection-modal.js +0 -3
  138. package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
  139. package/build-module/query/edit/query-content.js +10 -12
  140. package/build-module/query/edit/query-content.js.map +1 -1
  141. package/build-module/query/index.js +1 -1
  142. package/build-module/query/utils.js +35 -8
  143. package/build-module/query/utils.js.map +1 -1
  144. package/build-module/social-link/edit.js +24 -11
  145. package/build-module/social-link/edit.js.map +1 -1
  146. package/build-module/template-part/edit/advanced-controls.js +3 -8
  147. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  148. package/build-module/template-part/edit/index.js +1 -4
  149. package/build-module/template-part/edit/index.js.map +1 -1
  150. package/build-module/template-part/edit/selection-modal.js +0 -3
  151. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  152. package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
  153. package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
  154. package/build-module/template-part/edit/utils/hooks.js +1 -6
  155. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  156. package/build-module/template-part/variations.js +5 -11
  157. package/build-module/template-part/variations.js.map +1 -1
  158. package/build-module/video/edit.js +1 -1
  159. package/build-module/video/edit.js.map +1 -1
  160. package/build-module/video/tracks-editor.js +136 -124
  161. package/build-module/video/tracks-editor.js.map +1 -1
  162. package/build-style/cover/editor-rtl.css +3 -5
  163. package/build-style/cover/editor.css +3 -5
  164. package/build-style/cover/style-rtl.css +19 -15
  165. package/build-style/cover/style.css +19 -15
  166. package/build-style/editor-rtl.css +19 -30
  167. package/build-style/editor.css +19 -30
  168. package/build-style/group/editor-rtl.css +0 -10
  169. package/build-style/group/editor.css +0 -10
  170. package/build-style/image/editor-rtl.css +4 -0
  171. package/build-style/image/editor.css +4 -0
  172. package/build-style/image/style-rtl.css +0 -2
  173. package/build-style/image/style.css +0 -2
  174. package/build-style/latest-posts/editor-rtl.css +0 -7
  175. package/build-style/latest-posts/editor.css +0 -7
  176. package/build-style/media-text/style-rtl.css +1 -1
  177. package/build-style/media-text/style.css +1 -1
  178. package/build-style/navigation/style-rtl.css +1 -1
  179. package/build-style/navigation/style.css +1 -1
  180. package/build-style/page-list/style-rtl.css +4 -0
  181. package/build-style/page-list/style.css +4 -0
  182. package/build-style/query/editor-rtl.css +0 -4
  183. package/build-style/query/editor.css +0 -4
  184. package/build-style/search/style-rtl.css +3 -3
  185. package/build-style/search/style.css +3 -3
  186. package/build-style/social-link/editor-rtl.css +4 -4
  187. package/build-style/social-link/editor.css +4 -4
  188. package/build-style/style-rtl.css +28 -22
  189. package/build-style/style.css +28 -22
  190. package/build-style/video/editor-rtl.css +8 -0
  191. package/build-style/video/editor.css +8 -0
  192. package/build-types/lock-unlock.d.ts +2 -0
  193. package/build-types/lock-unlock.d.ts.map +1 -0
  194. package/package.json +39 -39
  195. package/src/block-keyboard-shortcuts/index.js +25 -11
  196. package/src/button/index.js +1 -1
  197. package/src/comments/block.json +3 -9
  198. package/src/cover/deprecated.js +182 -4
  199. package/src/cover/edit/block-controls.js +1 -1
  200. package/src/cover/edit/cover-placeholder.js +0 -3
  201. package/src/cover/edit/index.js +42 -27
  202. package/src/cover/editor.scss +4 -5
  203. package/src/cover/index.js +8 -8
  204. package/src/cover/save.js +27 -20
  205. package/src/cover/shared.js +10 -10
  206. package/src/cover/style.scss +40 -16
  207. package/src/cover/test/__snapshots__/edit.native.js.snap +9 -9
  208. package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
  209. package/src/cover/test/edit.js +2 -2
  210. package/src/cover/test/edit.native.js +4 -4
  211. package/src/cover/test/transforms.native.js +4 -4
  212. package/src/details/block.json +1 -0
  213. package/src/details/index.js +23 -1
  214. package/src/file/edit.js +9 -3
  215. package/src/freeform/modal.js +1 -1
  216. package/src/gallery/edit.js +1 -1
  217. package/src/group/editor.scss +0 -12
  218. package/src/heading/block.json +1 -7
  219. package/src/home-link/edit.js +27 -45
  220. package/src/home-link/index.php +0 -3
  221. package/src/image/block.json +1 -1
  222. package/src/image/edit.js +1 -1
  223. package/src/image/editor.scss +4 -0
  224. package/src/image/image.js +200 -109
  225. package/src/image/style.scss +0 -1
  226. package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
  227. package/src/latest-posts/edit.js +0 -1
  228. package/src/latest-posts/editor.scss +0 -11
  229. package/src/media-text/style.scss +1 -1
  230. package/src/media-text/test/__snapshots__/transforms.native.js.snap +2 -2
  231. package/src/navigation/edit/index.js +3 -30
  232. package/src/navigation/index.php +5 -151
  233. package/src/navigation/style.scss +1 -1
  234. package/src/navigation/use-template-part-area-label.js +10 -10
  235. package/src/page-list/block.json +14 -0
  236. package/src/page-list/style.scss +4 -0
  237. package/src/paragraph/edit.js +20 -17
  238. package/src/pattern/index.php +0 -7
  239. package/src/post-content/block.json +14 -1
  240. package/src/post-template/block.json +2 -1
  241. package/src/post-template/edit.js +19 -0
  242. package/src/query/block.json +1 -1
  243. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
  244. package/src/query/edit/inspector-controls/index.js +2 -12
  245. package/src/query/edit/pattern-selection-modal.js +0 -3
  246. package/src/query/edit/query-content.js +9 -17
  247. package/src/query/editor.scss +0 -4
  248. package/src/query/index.php +1 -1
  249. package/src/query/test/utils.js +59 -1
  250. package/src/query/utils.js +43 -15
  251. package/src/rss/index.php +11 -8
  252. package/src/search/index.php +2 -2
  253. package/src/search/style.scss +3 -5
  254. package/src/social-link/edit.js +47 -19
  255. package/src/social-link/editor.scss +6 -7
  256. package/src/template-part/edit/advanced-controls.js +13 -13
  257. package/src/template-part/edit/index.js +1 -4
  258. package/src/template-part/edit/selection-modal.js +0 -3
  259. package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
  260. package/src/template-part/edit/utils/hooks.js +2 -7
  261. package/src/template-part/variations.js +4 -16
  262. package/src/video/edit.js +1 -1
  263. package/src/video/editor.scss +9 -0
  264. package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
  265. package/src/video/tracks-editor.js +157 -141
  266. package/tsconfig.tsbuildinfo +1 -1
  267. package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
  268. package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
  269. package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
  270. package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
  271. package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
  272. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 9.12.0 (2024-11-16)
6
+
5
7
  ## 9.11.0 (2024-10-30)
6
8
 
7
9
  ## 9.10.0 (2024-10-16)
@@ -81,14 +81,14 @@ function BlockKeyboardShortcuts() {
81
81
  }
82
82
  });
83
83
  });
84
- }, []);
84
+ }, [registerShortcut]);
85
85
  (0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-heading-to-paragraph', event => handleTransformHeadingAndParagraph(event, 0));
86
- [1, 2, 3, 4, 5, 6].forEach(level => {
87
- //the loop is based off on a constant therefore
88
- //the hook will execute the same way every time
89
- //eslint-disable-next-line react-hooks/rules-of-hooks
90
- (0, _keyboardShortcuts.useShortcut)(`core/block-editor/transform-paragraph-to-heading-${level}`, event => handleTransformHeadingAndParagraph(event, level));
91
- });
86
+ (0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-1', event => handleTransformHeadingAndParagraph(event, 1));
87
+ (0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-2', event => handleTransformHeadingAndParagraph(event, 2));
88
+ (0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-3', event => handleTransformHeadingAndParagraph(event, 3));
89
+ (0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-4', event => handleTransformHeadingAndParagraph(event, 4));
90
+ (0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-5', event => handleTransformHeadingAndParagraph(event, 5));
91
+ (0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-6', event => handleTransformHeadingAndParagraph(event, 6));
92
92
  return null;
93
93
  }
94
94
  var _default = exports.default = BlockKeyboardShortcuts;
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_blocks","_blockEditor","BlockKeyboardShortcuts","registerShortcut","useDispatch","keyboardShortcutsStore","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","useSelect","handleTransformHeadingAndParagraph","event","level","preventDefault","currentClientId","blockName","isParagraph","isHeading","destinationBlockName","attributes","textAlign","destinationTextAlign","createBlock","content","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","forEach","useShortcut","_default","exports","default"],"sources":["@wordpress/block-library/src/block-keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockKeyboardShortcuts() {\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTransformHeadingAndParagraph = ( event, level ) => {\n\t\tevent.preventDefault();\n\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tconst isParagraph = blockName === 'core/paragraph';\n\t\tconst isHeading = blockName === 'core/heading';\n\n\t\tif ( ! isParagraph && ! isHeading ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\n\t\t// Avoid unnecessary block transform when attempting to transform to\n\t\t// the same block type and/or same level.\n\t\tif (\n\t\t\t( isParagraph && level === 0 ) ||\n\t\t\t( isHeading && attributes.level === level )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/block-editor/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: '0',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: '7',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/block-editor/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [] );\n\n\tuseShortcut(\n\t\t'core/block-editor/transform-heading-to-paragraph',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/block-editor/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTransformHeadingAndParagraph( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default BlockKeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAWA,SAASM,sBAAsBA,CAAA,EAAG;EACjC,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,wBAAuB,CAAC;EAClE,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAF,iBAAW,EAAEG,kBAAiB,CAAC;EACzD,MAAM;IAAEC,YAAY;IAAEC,wBAAwB;IAAEC;EAAmB,CAAC,GACnE,IAAAC,eAAS,EAAEJ,kBAAiB,C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,QAAQ;QAClBC,SAAS,EAAE;MACZ,CAAC;MACDC,OAAO,EAAE,CACR;QACCF,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ,CAAC;IAEH,CAAE,CAAC;IAEH,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACE,OAAO,CAAIrB,KAAK,IAAM;MAC1CX,gBAAgB,CAAE;QACjBwB,IAAI,EAAE,oDAAqDb,KAAK,EAAG;QACnEc,QAAQ,EAAE,eAAe;QACzBC,WAAW,EAAE,IAAAC,QAAE,EAAE,iCAAkC,CAAC;QACpDC,cAAc,EAAE;UACfC,QAAQ,EAAE,QAAQ;UAClBC,SAAS,EAAE,GAAInB,KAAK;QACrB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAsB,8BAAW,EACV,kDAAkD,EAChDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EAED,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACsB,OAAO,CAAIrB,KAAK,IAAM;IAC1C;IACA;IACA;IACA,IAAAsB,8BAAW,EACV,oDAAqDtB,KAAK,EAAG,EAC3DD,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAEC,KAAM,CAC/D,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrC,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_blocks","_blockEditor","BlockKeyboardShortcuts","registerShortcut","useDispatch","keyboardShortcutsStore","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","useSelect","handleTransformHeadingAndParagraph","event","level","preventDefault","currentClientId","blockName","isParagraph","isHeading","destinationBlockName","attributes","textAlign","destinationTextAlign","createBlock","content","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","forEach","useShortcut","_default","exports","default"],"sources":["@wordpress/block-library/src/block-keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockKeyboardShortcuts() {\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTransformHeadingAndParagraph = ( event, level ) => {\n\t\tevent.preventDefault();\n\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tconst isParagraph = blockName === 'core/paragraph';\n\t\tconst isHeading = blockName === 'core/heading';\n\n\t\tif ( ! isParagraph && ! isHeading ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\n\t\t// Avoid unnecessary block transform when attempting to transform to\n\t\t// the same block type and/or same level.\n\t\tif (\n\t\t\t( isParagraph && level === 0 ) ||\n\t\t\t( isHeading && attributes.level === level )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/block-editor/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: '0',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: '7',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/block-editor/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\tuseShortcut(\n\t\t'core/block-editor/transform-heading-to-paragraph',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 0 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-1',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 1 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-2',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 2 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-3',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 3 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-4',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 4 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-5',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 5 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-6',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 6 )\n\t);\n\n\treturn null;\n}\n\nexport default BlockKeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAWA,SAASM,sBAAsBA,CAAA,EAAG;EACjC,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,wBAAuB,CAAC;EAClE,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAF,iBAAW,EAAEG,kBAAiB,CAAC;EACzD,MAAM;IAAEC,YAAY;IAAEC,wBAAwB;IAAEC;EAAmB,CAAC,GACnE,IAAAC,eAAS,EAAEJ,kBAAiB,CAAC;EAE9B,MAAMK,kCAAkC,GAAGA,CAAEC,KAAK,EAAEC,KAAK,KAAM;IAC9DD,KAAK,CAACE,cAAc,CAAC,CAAC;IAEtB,MAAMC,eAAe,GAAGP,wBAAwB,CAAC,CAAC;IAClD,IAAKO,eAAe,KAAK,IAAI,EAAG;MAC/B;IACD;IAEA,MAAMC,SAAS,GAAGT,YAAY,CAAEQ,eAAgB,CAAC;IACjD,MAAME,WAAW,GAAGD,SAAS,KAAK,gBAAgB;IAClD,MAAME,SAAS,GAAGF,SAAS,KAAK,cAAc;IAE9C,IAAK,CAAEC,WAAW,IAAI,CAAEC,SAAS,EAAG;MACnC;IACD;IAEA,MAAMC,oBAAoB,GACzBN,KAAK,KAAK,CAAC,GAAG,gB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GAAInB,KAAK;QACrB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEX,gBAAgB,CAAG,CAAC;EAEzB,IAAAiC,8BAAW,EACV,kDAAkD,EAChDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EAED,OAAO,IAAI;AACZ;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrC,sBAAsB","ignoreList":[]}
@@ -166,7 +166,7 @@ const settings = exports.settings = {
166
166
  example: {
167
167
  attributes: {
168
168
  className: 'is-style-fill',
169
- text: (0, _i18n.__)('Call to Action')
169
+ text: (0, _i18n.__)('Call to action')
170
170
  }
171
171
  },
172
172
  edit: _edit.default,
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to Action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,K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;QAAAe,OAAA;MAAA;IAAA;IAAAC,oBAAA;MAAAnB,KAAA;MAAAoB,MAAA;MAAAC,KAAA;MAAA3B,KAAA;MAAAO,+BAAA;MAAAE,6BAAA;QAAAH,KAAA;QAAAoB,MAAA;QAAAC,KAAA;QAAA3B,KAAA;MAAA;IAAA;IAAA4B,sBAAA;IAAAC,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAC,MAAA;IAAAtD,IAAA;IAAAuD,KAAA;IAAAC,SAAA;EAAA;IAAAxD,IAAA;IAAAuD,KAAA;EAAA;EAAAE,WAAA;EAAAP,KAAA;AAAA;AASA,MAAM;EAAElD;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAInB,MAAM0D,QAAQ,GAAA7D,OAAA,CAAA6D,QAAA,GAAG;EACvBC,IAAI,EAAJA,aAAI;EACJC,OAAO,EAAE;IACRrD,UAAU,EAAE;MACXsD,SAAS,EAAE,eAAe;MAC1B7C,IAAI,EAAE,IAAA8C,QAAE,EAAE,gBAAiB;IAC5B;EACD,CAAC;EACDC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,KAAK,EAAEA,CAAEC,CAAC,EAAE;IAAEnD,IAAI,GAAG;EAAG,CAAC,MAAQ;IAChC,GAAGmD,CAAC;IACJnD,IAAI,EAAE,CAAEmD,CAAC,CAACnD,IAAI,IAAI,EAAE,IAAKA;EAC1B,CAAC;AACF,CAAC;AAEM,MAAMoD,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAErE,IAAI;EAAEJ,QAAQ;EAAE8D;AAAS,CAAE,CAAC;AAAC7D,OAAA,CAAAuE,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IA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toV13BlockAttributes = {
157
157
  ...v8ToV11BlockAttributes,
158
158
  useFeaturedImage: {
159
159
  type: 'boolean',
@@ -164,6 +164,19 @@ const v12BlockAttributes = {
164
164
  default: 'div'
165
165
  }
166
166
  };
167
+ const v14BlockAttributes = {
168
+ ...v12toV13BlockAttributes,
169
+ isUserOverlayColor: {
170
+ type: 'boolean'
171
+ },
172
+ sizeSlug: {
173
+ type: 'string'
174
+ },
175
+ alt: {
176
+ type: 'string',
177
+ default: ''
178
+ }
179
+ };
167
180
  const v7toV11BlockSupports = {
168
181
  anchor: true,
169
182
  align: true,
@@ -228,10 +241,133 @@ const v12BlockSupports = {
228
241
  allowJustification: false
229
242
  }
230
243
  };
244
+ const v14BlockSupports = {
245
+ ...v12BlockSupports,
246
+ shadow: true,
247
+ dimensions: {
248
+ aspectRatio: true
249
+ },
250
+ interactivity: {
251
+ clientNavigation: true
252
+ }
253
+ };
254
+
255
+ // Deprecation for blocks that have z-index.
256
+ const v14 = {
257
+ attributes: v14BlockAttributes,
258
+ supports: v14BlockSupports,
259
+ save({
260
+ attributes
261
+ }) {
262
+ const {
263
+ backgroundType,
264
+ gradient,
265
+ contentPosition,
266
+ customGradient,
267
+ customOverlayColor,
268
+ dimRatio,
269
+ focalPoint,
270
+ useFeaturedImage,
271
+ hasParallax,
272
+ isDark,
273
+ isRepeated,
274
+ overlayColor,
275
+ url,
276
+ alt,
277
+ id,
278
+ minHeight: minHeightProp,
279
+ minHeightUnit,
280
+ tagName: Tag,
281
+ sizeSlug
282
+ } = attributes;
283
+ const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
284
+ const gradientClass = (0, _blockEditor.__experimentalGetGradientClass)(gradient);
285
+ const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
286
+ const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
287
+ const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
288
+ const isImgElement = !(hasParallax || isRepeated);
289
+ const style = {
290
+ minHeight: minHeight || undefined
291
+ };
292
+ const bgStyle = {
293
+ backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
294
+ background: customGradient ? customGradient : undefined
295
+ };
296
+ const objectPosition =
297
+ // prettier-ignore
298
+ focalPoint && isImgElement ? (0, _shared.mediaPosition)(focalPoint) : undefined;
299
+ const backgroundImage = url ? `url(${url})` : undefined;
300
+ const backgroundPosition = (0, _shared.mediaPosition)(focalPoint);
301
+ const classes = (0, _clsx.default)({
302
+ 'is-light': !isDark,
303
+ 'has-parallax': hasParallax,
304
+ 'is-repeated': isRepeated,
305
+ 'has-custom-content-position': !(0, _shared.isContentPositionCenter)(contentPosition)
306
+ }, (0, _shared.getPositionClassName)(contentPosition));
307
+ const imgClasses = (0, _clsx.default)('wp-block-cover__image-background', id ? `wp-image-${id}` : null, {
308
+ [`size-${sizeSlug}`]: sizeSlug,
309
+ 'has-parallax': hasParallax,
310
+ 'is-repeated': isRepeated
311
+ });
312
+ const gradientValue = gradient || customGradient;
313
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tag, {
314
+ ..._blockEditor.useBlockProps.save({
315
+ className: classes,
316
+ style
317
+ }),
318
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
319
+ "aria-hidden": "true",
320
+ className: (0, _clsx.default)('wp-block-cover__background', overlayColorClass, (0, _shared.dimRatioToClass)(dimRatio), {
321
+ 'has-background-dim': dimRatio !== undefined,
322
+ // For backwards compatibility. Former versions of the Cover Block applied
323
+ // `.wp-block-cover__gradient-background` in the presence of
324
+ // media, a gradient and a dim.
325
+ 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
326
+ 'has-background-gradient': gradientValue,
327
+ [gradientClass]: gradientClass
328
+ }),
329
+ style: bgStyle
330
+ }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
331
+ className: imgClasses,
332
+ alt: alt,
333
+ src: url,
334
+ style: {
335
+ objectPosition
336
+ },
337
+ "data-object-fit": "cover",
338
+ "data-object-position": objectPosition
339
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
340
+ role: alt ? 'img' : undefined,
341
+ "aria-label": alt ? alt : undefined,
342
+ className: imgClasses,
343
+ style: {
344
+ backgroundPosition,
345
+ backgroundImage
346
+ }
347
+ })), isVideoBackground && url && /*#__PURE__*/(0, _jsxRuntime.jsx)("video", {
348
+ className: (0, _clsx.default)('wp-block-cover__video-background', 'intrinsic-ignore'),
349
+ autoPlay: true,
350
+ muted: true,
351
+ loop: true,
352
+ playsInline: true,
353
+ src: url,
354
+ style: {
355
+ objectPosition
356
+ },
357
+ "data-object-fit": "cover",
358
+ "data-object-position": objectPosition
359
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
360
+ ..._blockEditor.useInnerBlocksProps.save({
361
+ className: 'wp-block-cover__inner-container'
362
+ })
363
+ })]
364
+ });
365
+ }
366
+ };
231
367
 
232
368
  // Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated.
233
369
  const v13 = {
234
- attributes: v12BlockAttributes,
370
+ attributes: v12toV13BlockAttributes,
235
371
  supports: v12BlockSupports,
236
372
  save({
237
373
  attributes
@@ -341,7 +477,7 @@ const v13 = {
341
477
 
342
478
  // Deprecation for blocks to prevent auto overlay color from overriding previously set values.
343
479
  const v12 = {
344
- attributes: v12BlockAttributes,
480
+ attributes: v12toV13BlockAttributes,
345
481
  supports: v12BlockSupports,
346
482
  isEligible(attributes) {
347
483
  return (attributes.customOverlayColor !== undefined || attributes.overlayColor !== undefined) && attributes.isUserOverlayColor === undefined;
@@ -1430,5 +1566,5 @@ const v1 = {
1430
1566
  })]];
1431
1567
  }
1432
1568
  };
1433
- var _default = exports.default = [v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1];
1569
+ var _default = exports.default = [v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1];
1434
1570
  //# sourceMappingURL=deprecated.js.map