@wordpress/block-library 9.7.0 → 9.7.1-next.1f6eadc42.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 (256) hide show
  1. package/build/archives/edit.js +1 -1
  2. package/build/archives/edit.js.map +1 -1
  3. package/build/block/edit.js +2 -3
  4. package/build/block/edit.js.map +1 -1
  5. package/build/buttons/index.js +1 -1
  6. package/build/comments/edit/comments-legacy.js +2 -4
  7. package/build/comments/edit/comments-legacy.js.map +1 -1
  8. package/build/cover/deprecated.js +1 -1
  9. package/build/cover/deprecated.js.map +1 -1
  10. package/build/cover/edit/index.js +4 -2
  11. package/build/cover/edit/index.js.map +1 -1
  12. package/build/embed/edit.js +5 -11
  13. package/build/embed/edit.js.map +1 -1
  14. package/build/embed/embed-placeholder.js +4 -8
  15. package/build/embed/embed-placeholder.js.map +1 -1
  16. package/build/embed/embed-preview.js +16 -4
  17. package/build/embed/embed-preview.js.map +1 -1
  18. package/build/file/transforms.js +18 -4
  19. package/build/file/transforms.js.map +1 -1
  20. package/build/form-input/deprecated.js +113 -1
  21. package/build/form-input/deprecated.js.map +1 -1
  22. package/build/form-input/edit.js +16 -12
  23. package/build/form-input/edit.js.map +1 -1
  24. package/build/form-input/save.js +9 -1
  25. package/build/form-input/save.js.map +1 -1
  26. package/build/freeform/modal.js +6 -12
  27. package/build/freeform/modal.js.map +1 -1
  28. package/build/image/edit.js +55 -15
  29. package/build/image/edit.js.map +1 -1
  30. package/build/image/image.js +23 -20
  31. package/build/image/image.js.map +1 -1
  32. package/build/image/transforms.js +0 -13
  33. package/build/image/transforms.js.map +1 -1
  34. package/build/image/use-max-width-observer.js +35 -0
  35. package/build/image/use-max-width-observer.js.map +1 -0
  36. package/build/image/utils.js +11 -0
  37. package/build/image/utils.js.map +1 -1
  38. package/build/latest-posts/edit.js +1 -1
  39. package/build/latest-posts/edit.js.map +1 -1
  40. package/build/missing/edit.js +2 -4
  41. package/build/missing/edit.js.map +1 -1
  42. package/build/navigation/edit/deleted-navigation-warning.js +14 -10
  43. package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
  44. package/build/navigation/edit/index.js +2 -4
  45. package/build/navigation/edit/index.js.map +1 -1
  46. package/build/navigation/edit/menu-inspector-controls.js +2 -1
  47. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  48. package/build/navigation/edit/navigation-menu-delete-control.js +2 -4
  49. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  50. package/build/navigation/edit/placeholder/index.js +2 -4
  51. package/build/navigation/edit/placeholder/index.js.map +1 -1
  52. package/build/navigation/edit/responsive-wrapper.js +4 -8
  53. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  54. package/build/navigation-link/link-ui.js +2 -4
  55. package/build/navigation-link/link-ui.js.map +1 -1
  56. package/build/page-list/convert-to-links-modal.js +4 -8
  57. package/build/page-list/convert-to-links-modal.js.map +1 -1
  58. package/build/page-list/edit.js +2 -4
  59. package/build/page-list/edit.js.map +1 -1
  60. package/build/post-comments-form/form.js +2 -4
  61. package/build/post-comments-form/form.js.map +1 -1
  62. package/build/post-featured-image/edit.js +2 -4
  63. package/build/post-featured-image/edit.js.map +1 -1
  64. package/build/post-title/index.js +4 -1
  65. package/build/post-title/index.js.map +1 -1
  66. package/build/query/edit/enhanced-pagination-modal.js +4 -6
  67. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  68. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -3
  69. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  70. package/build/query/edit/inspector-controls/index.js +2 -10
  71. package/build/query/edit/inspector-controls/index.js.map +1 -1
  72. package/build/query/edit/query-content.js +9 -3
  73. package/build/query/edit/query-content.js.map +1 -1
  74. package/build/query/edit/query-placeholder.js +4 -8
  75. package/build/query/edit/query-placeholder.js.map +1 -1
  76. package/build/site-logo/edit.js +4 -8
  77. package/build/site-logo/edit.js.map +1 -1
  78. package/build/site-title/index.js +4 -1
  79. package/build/site-title/index.js.map +1 -1
  80. package/build/social-link/edit.js +1 -1
  81. package/build/social-link/edit.js.map +1 -1
  82. package/build/template-part/edit/inner-blocks.js +10 -1
  83. package/build/template-part/edit/inner-blocks.js.map +1 -1
  84. package/build/template-part/edit/placeholder.js +4 -8
  85. package/build/template-part/edit/placeholder.js.map +1 -1
  86. package/build/video/edit.js +4 -8
  87. package/build/video/edit.js.map +1 -1
  88. package/build/video/tracks-editor.js +6 -12
  89. package/build/video/tracks-editor.js.map +1 -1
  90. package/build-module/archives/edit.js +1 -1
  91. package/build-module/archives/edit.js.map +1 -1
  92. package/build-module/block/edit.js +2 -3
  93. package/build-module/block/edit.js.map +1 -1
  94. package/build-module/buttons/index.js +1 -1
  95. package/build-module/comments/edit/comments-legacy.js +2 -4
  96. package/build-module/comments/edit/comments-legacy.js.map +1 -1
  97. package/build-module/cover/deprecated.js +1 -1
  98. package/build-module/cover/deprecated.js.map +1 -1
  99. package/build-module/cover/edit/index.js +4 -2
  100. package/build-module/cover/edit/index.js.map +1 -1
  101. package/build-module/embed/edit.js +6 -12
  102. package/build-module/embed/edit.js.map +1 -1
  103. package/build-module/embed/embed-placeholder.js +4 -8
  104. package/build-module/embed/embed-placeholder.js.map +1 -1
  105. package/build-module/embed/embed-preview.js +16 -4
  106. package/build-module/embed/embed-preview.js.map +1 -1
  107. package/build-module/file/transforms.js +18 -4
  108. package/build-module/file/transforms.js.map +1 -1
  109. package/build-module/form-input/deprecated.js +114 -2
  110. package/build-module/form-input/deprecated.js.map +1 -1
  111. package/build-module/form-input/edit.js +16 -12
  112. package/build-module/form-input/edit.js.map +1 -1
  113. package/build-module/form-input/save.js +9 -1
  114. package/build-module/form-input/save.js.map +1 -1
  115. package/build-module/freeform/modal.js +6 -12
  116. package/build-module/freeform/modal.js.map +1 -1
  117. package/build-module/image/edit.js +58 -18
  118. package/build-module/image/edit.js.map +1 -1
  119. package/build-module/image/image.js +23 -20
  120. package/build-module/image/image.js.map +1 -1
  121. package/build-module/image/transforms.js +0 -13
  122. package/build-module/image/transforms.js.map +1 -1
  123. package/build-module/image/use-max-width-observer.js +29 -0
  124. package/build-module/image/use-max-width-observer.js.map +1 -0
  125. package/build-module/image/utils.js +11 -1
  126. package/build-module/image/utils.js.map +1 -1
  127. package/build-module/latest-posts/edit.js +1 -1
  128. package/build-module/latest-posts/edit.js.map +1 -1
  129. package/build-module/missing/edit.js +2 -4
  130. package/build-module/missing/edit.js.map +1 -1
  131. package/build-module/navigation/edit/deleted-navigation-warning.js +15 -11
  132. package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
  133. package/build-module/navigation/edit/index.js +2 -4
  134. package/build-module/navigation/edit/index.js.map +1 -1
  135. package/build-module/navigation/edit/menu-inspector-controls.js +2 -1
  136. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  137. package/build-module/navigation/edit/navigation-menu-delete-control.js +2 -4
  138. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  139. package/build-module/navigation/edit/placeholder/index.js +2 -4
  140. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  141. package/build-module/navigation/edit/responsive-wrapper.js +4 -8
  142. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  143. package/build-module/navigation-link/link-ui.js +2 -4
  144. package/build-module/navigation-link/link-ui.js.map +1 -1
  145. package/build-module/page-list/convert-to-links-modal.js +4 -8
  146. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  147. package/build-module/page-list/edit.js +2 -4
  148. package/build-module/page-list/edit.js.map +1 -1
  149. package/build-module/post-comments-form/form.js +2 -4
  150. package/build-module/post-comments-form/form.js.map +1 -1
  151. package/build-module/post-featured-image/edit.js +2 -4
  152. package/build-module/post-featured-image/edit.js.map +1 -1
  153. package/build-module/post-title/index.js +4 -1
  154. package/build-module/post-title/index.js.map +1 -1
  155. package/build-module/query/edit/enhanced-pagination-modal.js +4 -6
  156. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  157. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -3
  158. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  159. package/build-module/query/edit/inspector-controls/index.js +2 -10
  160. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  161. package/build-module/query/edit/query-content.js +10 -4
  162. package/build-module/query/edit/query-content.js.map +1 -1
  163. package/build-module/query/edit/query-placeholder.js +4 -8
  164. package/build-module/query/edit/query-placeholder.js.map +1 -1
  165. package/build-module/site-logo/edit.js +4 -8
  166. package/build-module/site-logo/edit.js.map +1 -1
  167. package/build-module/site-title/index.js +4 -1
  168. package/build-module/site-title/index.js.map +1 -1
  169. package/build-module/social-link/edit.js +1 -1
  170. package/build-module/social-link/edit.js.map +1 -1
  171. package/build-module/template-part/edit/inner-blocks.js +10 -1
  172. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  173. package/build-module/template-part/edit/placeholder.js +4 -8
  174. package/build-module/template-part/edit/placeholder.js.map +1 -1
  175. package/build-module/video/edit.js +4 -8
  176. package/build-module/video/edit.js.map +1 -1
  177. package/build-module/video/tracks-editor.js +6 -12
  178. package/build-module/video/tracks-editor.js.map +1 -1
  179. package/build-style/buttons/editor-rtl.css +2 -2
  180. package/build-style/buttons/editor.css +2 -2
  181. package/build-style/buttons/style-rtl.css +2 -2
  182. package/build-style/buttons/style.css +2 -2
  183. package/build-style/common-rtl.css +2 -2
  184. package/build-style/common.css +2 -2
  185. package/build-style/editor-rtl.css +11 -31
  186. package/build-style/editor.css +11 -31
  187. package/build-style/form-input/style-rtl.css +7 -8
  188. package/build-style/form-input/style.css +7 -8
  189. package/build-style/image/editor-rtl.css +6 -26
  190. package/build-style/image/editor.css +6 -26
  191. package/build-style/navigation/editor-rtl.css +1 -1
  192. package/build-style/navigation/editor.css +1 -1
  193. package/build-style/post-title/style-rtl.css +21 -0
  194. package/build-style/post-title/style.css +21 -0
  195. package/build-style/site-title/style-rtl.css +21 -0
  196. package/build-style/site-title/style.css +21 -0
  197. package/build-style/style-rtl.css +53 -12
  198. package/build-style/style.css +53 -12
  199. package/package.json +42 -35
  200. package/src/archives/edit.js +1 -1
  201. package/src/block/edit.js +3 -7
  202. package/src/buttons/block.json +1 -1
  203. package/src/buttons/editor.scss +2 -2
  204. package/src/buttons/style.scss +2 -2
  205. package/src/comments/edit/comments-legacy.js +1 -2
  206. package/src/cover/deprecated.js +3 -2
  207. package/src/cover/edit/index.js +5 -1
  208. package/src/embed/edit.js +0 -7
  209. package/src/embed/embed-placeholder.js +2 -4
  210. package/src/embed/embed-preview.js +22 -2
  211. package/src/file/index.php +1 -1
  212. package/src/file/transforms.js +26 -6
  213. package/src/form-input/deprecated.js +114 -1
  214. package/src/form-input/edit.js +17 -11
  215. package/src/form-input/save.js +13 -3
  216. package/src/form-input/style.scss +9 -8
  217. package/src/freeform/modal.js +3 -6
  218. package/src/image/edit.js +91 -20
  219. package/src/image/editor.scss +7 -38
  220. package/src/image/image.js +31 -20
  221. package/src/image/index.php +1 -1
  222. package/src/image/transforms.js +0 -23
  223. package/src/image/use-max-width-observer.js +32 -0
  224. package/src/image/utils.js +13 -1
  225. package/src/latest-posts/edit.js +1 -1
  226. package/src/missing/edit.js +1 -2
  227. package/src/navigation/edit/deleted-navigation-warning.js +23 -20
  228. package/src/navigation/edit/index.js +1 -2
  229. package/src/navigation/edit/menu-inspector-controls.js +3 -1
  230. package/src/navigation/edit/navigation-menu-delete-control.js +1 -2
  231. package/src/navigation/edit/placeholder/index.js +1 -2
  232. package/src/navigation/edit/responsive-wrapper.js +2 -4
  233. package/src/navigation/editor.scss +5 -1
  234. package/src/navigation/index.php +1 -1
  235. package/src/navigation-link/link-ui.js +1 -2
  236. package/src/page-list/convert-to-links-modal.js +2 -4
  237. package/src/page-list/edit.js +1 -2
  238. package/src/post-comments-form/form.js +1 -2
  239. package/src/post-featured-image/edit.js +1 -2
  240. package/src/post-title/block.json +4 -1
  241. package/src/post-title/style.scss +24 -0
  242. package/src/query/edit/enhanced-pagination-modal.js +3 -4
  243. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -3
  244. package/src/query/edit/inspector-controls/index.js +2 -9
  245. package/src/query/edit/query-content.js +7 -0
  246. package/src/query/edit/query-placeholder.js +2 -4
  247. package/src/query/index.php +1 -1
  248. package/src/search/index.php +1 -1
  249. package/src/site-logo/edit.js +2 -4
  250. package/src/site-title/block.json +4 -1
  251. package/src/site-title/style.scss +24 -0
  252. package/src/social-link/edit.js +1 -1
  253. package/src/template-part/edit/inner-blocks.js +20 -1
  254. package/src/template-part/edit/placeholder.js +2 -4
  255. package/src/video/edit.js +2 -4
  256. package/src/video/tracks-editor.js +3 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.7.0",
3
+ "version": "9.7.1-next.1f6eadc42.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,41 +30,48 @@
30
30
  "src/**/*.scss",
31
31
  "{src,build,build-module}/*/init.js"
32
32
  ],
33
+ "wpScriptModuleExports": {
34
+ "./file/view": "./build-module/file/view.js",
35
+ "./image/view": "./build-module/image/view.js",
36
+ "./navigation/view": "./build-module/navigation/view.js",
37
+ "./query/view": "./build-module/query/view.js",
38
+ "./search/view": "./build-module/search/view.js"
39
+ },
33
40
  "dependencies": {
34
41
  "@babel/runtime": "^7.16.0",
35
- "@wordpress/a11y": "^4.7.0",
36
- "@wordpress/api-fetch": "^7.7.0",
37
- "@wordpress/autop": "^4.7.0",
38
- "@wordpress/blob": "^4.7.0",
39
- "@wordpress/block-editor": "^14.2.0",
40
- "@wordpress/blocks": "^13.7.0",
41
- "@wordpress/components": "^28.7.0",
42
- "@wordpress/compose": "^7.7.0",
43
- "@wordpress/core-data": "^7.7.0",
44
- "@wordpress/data": "^10.7.0",
45
- "@wordpress/date": "^5.7.0",
46
- "@wordpress/deprecated": "^4.7.0",
47
- "@wordpress/dom": "^4.7.0",
48
- "@wordpress/element": "^6.7.0",
49
- "@wordpress/escape-html": "^3.7.0",
50
- "@wordpress/hooks": "^4.7.0",
51
- "@wordpress/html-entities": "^4.7.0",
52
- "@wordpress/i18n": "^5.7.0",
53
- "@wordpress/icons": "^10.7.0",
54
- "@wordpress/interactivity": "^6.7.0",
55
- "@wordpress/interactivity-router": "^2.7.0",
56
- "@wordpress/keyboard-shortcuts": "^5.7.0",
57
- "@wordpress/keycodes": "^4.7.0",
58
- "@wordpress/notices": "^5.7.0",
59
- "@wordpress/patterns": "^2.7.0",
60
- "@wordpress/primitives": "^4.7.0",
61
- "@wordpress/private-apis": "^1.7.0",
62
- "@wordpress/reusable-blocks": "^5.7.0",
63
- "@wordpress/rich-text": "^7.7.0",
64
- "@wordpress/server-side-render": "^5.7.0",
65
- "@wordpress/url": "^4.7.0",
66
- "@wordpress/viewport": "^6.7.0",
67
- "@wordpress/wordcount": "^4.7.0",
42
+ "@wordpress/a11y": "^4.7.1-next.1f6eadc42.0",
43
+ "@wordpress/api-fetch": "^7.7.1-next.1f6eadc42.0",
44
+ "@wordpress/autop": "^4.7.1-next.1f6eadc42.0",
45
+ "@wordpress/blob": "^4.7.1-next.1f6eadc42.0",
46
+ "@wordpress/block-editor": "^14.2.1-next.1f6eadc42.0",
47
+ "@wordpress/blocks": "^13.7.1-next.1f6eadc42.0",
48
+ "@wordpress/components": "^28.8.1-next.1f6eadc42.0",
49
+ "@wordpress/compose": "^7.8.1-next.1f6eadc42.0",
50
+ "@wordpress/core-data": "^7.7.1-next.1f6eadc42.0",
51
+ "@wordpress/data": "^10.7.1-next.1f6eadc42.0",
52
+ "@wordpress/date": "^5.7.1-next.1f6eadc42.0",
53
+ "@wordpress/deprecated": "^4.7.1-next.1f6eadc42.0",
54
+ "@wordpress/dom": "^4.7.1-next.1f6eadc42.0",
55
+ "@wordpress/element": "^6.7.1-next.1f6eadc42.0",
56
+ "@wordpress/escape-html": "^3.7.1-next.1f6eadc42.0",
57
+ "@wordpress/hooks": "^4.7.1-next.1f6eadc42.0",
58
+ "@wordpress/html-entities": "^4.7.1-next.1f6eadc42.0",
59
+ "@wordpress/i18n": "^5.7.1-next.1f6eadc42.0",
60
+ "@wordpress/icons": "^10.7.1-next.1f6eadc42.0",
61
+ "@wordpress/interactivity": "^6.7.2-next.1f6eadc42.0",
62
+ "@wordpress/interactivity-router": "^2.7.1-next.1f6eadc42.0",
63
+ "@wordpress/keyboard-shortcuts": "^5.7.1-next.1f6eadc42.0",
64
+ "@wordpress/keycodes": "^4.7.1-next.1f6eadc42.0",
65
+ "@wordpress/notices": "^5.7.1-next.1f6eadc42.0",
66
+ "@wordpress/patterns": "^2.7.1-next.1f6eadc42.0",
67
+ "@wordpress/primitives": "^4.7.1-next.1f6eadc42.0",
68
+ "@wordpress/private-apis": "^1.7.1-next.1f6eadc42.0",
69
+ "@wordpress/reusable-blocks": "^5.7.1-next.1f6eadc42.0",
70
+ "@wordpress/rich-text": "^7.7.1-next.1f6eadc42.0",
71
+ "@wordpress/server-side-render": "^5.7.1-next.1f6eadc42.0",
72
+ "@wordpress/url": "^4.7.1-next.1f6eadc42.0",
73
+ "@wordpress/viewport": "^6.7.1-next.1f6eadc42.0",
74
+ "@wordpress/wordcount": "^4.7.1-next.1f6eadc42.0",
68
75
  "change-case": "^4.1.2",
69
76
  "clsx": "^2.1.1",
70
77
  "colord": "^2.7.0",
@@ -82,5 +89,5 @@
82
89
  "publishConfig": {
83
90
  "access": "public"
84
91
  },
85
- "gitHead": "c90d920de07c53dff82c5914635b56fafa503b7f"
92
+ "gitHead": "960a22b909c9fdbc90e7435b7ba8947b9218837a"
86
93
  }
@@ -53,7 +53,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
53
53
  <SelectControl
54
54
  __next40pxDefaultSize
55
55
  __nextHasNoMarginBottom
56
- label={ __( 'Group by:' ) }
56
+ label={ __( 'Group by' ) }
57
57
  options={ [
58
58
  { label: __( 'Year' ), value: 'yearly' },
59
59
  { label: __( 'Month' ), value: 'monthly' },
package/src/block/edit.js CHANGED
@@ -194,19 +194,15 @@ function ReusableBlockEdit( {
194
194
  hasPatternOverridesSource,
195
195
  } = useSelect(
196
196
  ( select ) => {
197
- const {
198
- getBlocks,
199
- getSettings,
200
- getBlockEditingMode: _getBlockEditingMode,
201
- } = select( blockEditorStore );
197
+ const { getBlocks, getSettings, getBlockEditingMode } =
198
+ select( blockEditorStore );
202
199
  const { getBlockBindingsSource } = unlock( select( blocksStore ) );
203
200
  // For editing link to the site editor if the theme and user permissions support it.
204
201
  return {
205
202
  innerBlocks: getBlocks( patternClientId ),
206
- getBlockEditingMode: _getBlockEditingMode,
207
203
  onNavigateToEntityRecord:
208
204
  getSettings().onNavigateToEntityRecord,
209
- editingMode: _getBlockEditingMode( patternClientId ),
205
+ editingMode: getBlockEditingMode( patternClientId ),
210
206
  hasPatternOverridesSource: !! getBlockBindingsSource(
211
207
  'core/pattern-overrides'
212
208
  ),
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "spacing": {
24
- "blockGap": true,
24
+ "blockGap": [ "horizontal", "vertical" ],
25
25
  "padding": true,
26
26
  "margin": [ "top", "bottom" ],
27
27
  "__experimentalDefaultControls": {
@@ -33,14 +33,14 @@ $blocks-block__margin: 0.5em;
33
33
  //
34
34
  // This back compat rule is ignored if the user decides to use the
35
35
  // newer justification options on the button block, hence the :not.
36
- /* stylelint-disable indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
36
+ /* stylelint-disable @stylistic/indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
37
37
  &:not(
38
38
  .is-content-justification-space-between,
39
39
  .is-content-justification-right,
40
40
  .is-content-justification-left,
41
41
  .is-content-justification-center
42
42
  ) .wp-block[data-align="center"] {
43
- /* stylelint-enable indentation */
43
+ /* stylelint-enable @stylistic/indentation */
44
44
  margin-left: auto;
45
45
  margin-right: auto;
46
46
  margin-top: 0;
@@ -55,14 +55,14 @@ $blocks-block__margin: 0.5em;
55
55
  //
56
56
  // This back compat rule is ignored if the user decides to use the
57
57
  // newer justification options on the button block, hence the :not.
58
- /* stylelint-disable indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
58
+ /* stylelint-disable @stylistic/indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
59
59
  &:not(
60
60
  .is-content-justification-space-between,
61
61
  .is-content-justification-right,
62
62
  .is-content-justification-left,
63
63
  .is-content-justification-center
64
64
  ) .wp-block-button.aligncenter {
65
- /* stylelint-enable indentation */
65
+ /* stylelint-enable @stylistic/indentation */
66
66
  margin-left: auto;
67
67
  margin-right: auto;
68
68
  width: 100%;
@@ -29,8 +29,7 @@ export default function CommentsLegacy( {
29
29
 
30
30
  const actions = [
31
31
  <Button
32
- // TODO: Switch to `true` (40px size) if possible
33
- __next40pxDefaultSize={ false }
32
+ __next40pxDefaultSize
34
33
  key="convert"
35
34
  onClick={ () => void setAttributes( { legacy: false } ) }
36
35
  variant="primary"
@@ -400,8 +400,9 @@ const v12 = {
400
400
  supports: v12BlockSupports,
401
401
  isEligible( attributes ) {
402
402
  return (
403
- attributes.customOverlayColor !== undefined ||
404
- attributes.overlayColor !== undefined
403
+ ( attributes.customOverlayColor !== undefined ||
404
+ attributes.overlayColor !== undefined ) &&
405
+ attributes.isUserOverlayColor === undefined
405
406
  );
406
407
  },
407
408
  migrate( attributes ) {
@@ -143,7 +143,10 @@ function CoverEdit( {
143
143
  averageBackgroundColor
144
144
  );
145
145
  __unstableMarkNextChangeAsNotPersistent();
146
- setAttributes( { isDark: newIsDark } );
146
+ setAttributes( {
147
+ isDark: newIsDark,
148
+ isUserOverlayColor: isUserOverlayColor || false,
149
+ } );
147
150
  } )();
148
151
  // Disable reason: Update the block only when the featured image changes.
149
152
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -201,6 +204,7 @@ function CoverEdit( {
201
204
  useFeaturedImage: undefined,
202
205
  dimRatio: newDimRatio,
203
206
  isDark: newIsDark,
207
+ isUserOverlayColor: isUserOverlayColor || false,
204
208
  } );
205
209
  };
206
210
 
package/src/embed/edit.js CHANGED
@@ -14,7 +14,6 @@ import { embedContentIcon } from './icons';
14
14
  import EmbedLoading from './embed-loading';
15
15
  import EmbedPlaceholder from './embed-placeholder';
16
16
  import EmbedPreview from './embed-preview';
17
- import { Caption } from '../utils/caption';
18
17
 
19
18
  /**
20
19
  * External dependencies
@@ -277,14 +276,8 @@ const EmbedEdit = ( props ) => {
277
276
  icon={ icon }
278
277
  label={ label }
279
278
  insertBlocksAfter={ insertBlocksAfter }
280
- />
281
- <Caption
282
279
  attributes={ attributes }
283
280
  setAttributes={ setAttributes }
284
- isSelected={ isSelected }
285
- insertBlocksAfter={ insertBlocksAfter }
286
- label={ __( 'Embed caption text' ) }
287
- showToolbarButton={ isSelected }
288
281
  />
289
282
  </View>
290
283
  </>
@@ -66,16 +66,14 @@ const EmbedPlaceholder = ( {
66
66
  justify="flex-start"
67
67
  >
68
68
  <Button
69
- // TODO: Switch to `true` (40px size) if possible
70
- __next40pxDefaultSize={ false }
69
+ __next40pxDefaultSize
71
70
  variant="secondary"
72
71
  onClick={ tryAgain }
73
72
  >
74
73
  { _x( 'Try again', 'button label' ) }
75
74
  </Button>{ ' ' }
76
75
  <Button
77
- // TODO: Switch to `true` (40px size) if possible
78
- __next40pxDefaultSize={ false }
76
+ __next40pxDefaultSize
79
77
  variant="secondary"
80
78
  onClick={ fallback }
81
79
  >
@@ -21,6 +21,7 @@ import { getAuthority } from '@wordpress/url';
21
21
  * Internal dependencies
22
22
  */
23
23
  import WpEmbedPreview from './wp-embed-preview';
24
+ import { Caption } from '../utils/caption';
24
25
 
25
26
  class EmbedPreview extends Component {
26
27
  constructor() {
@@ -52,8 +53,19 @@ class EmbedPreview extends Component {
52
53
  }
53
54
 
54
55
  render() {
55
- const { preview, previewable, url, type, className, icon, label } =
56
- this.props;
56
+ const {
57
+ preview,
58
+ previewable,
59
+ url,
60
+ type,
61
+ className,
62
+ icon,
63
+ label,
64
+ insertBlocksAfter,
65
+ attributes,
66
+ setAttributes,
67
+ isSelected,
68
+ } = this.props;
57
69
  const { scripts } = preview;
58
70
  const { interactive } = this.state;
59
71
 
@@ -123,6 +135,14 @@ class EmbedPreview extends Component {
123
135
  </p>
124
136
  </Placeholder>
125
137
  ) }
138
+ <Caption
139
+ attributes={ attributes }
140
+ setAttributes={ setAttributes }
141
+ isSelected={ isSelected }
142
+ insertBlocksAfter={ insertBlocksAfter }
143
+ label={ __( 'Embed caption text' ) }
144
+ showToolbarButton={ isSelected }
145
+ />
126
146
  </figure>
127
147
  );
128
148
  }
@@ -21,7 +21,7 @@ function render_block_core_file( $attributes, $content ) {
21
21
  if ( ! empty( $attributes['displayPreview'] ) ) {
22
22
  $suffix = wp_scripts_get_suffix();
23
23
  if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
24
- $module_url = gutenberg_url( '/build/interactivity/file.min.js' );
24
+ $module_url = gutenberg_url( '/build-module/block-library/file/view.min.js' );
25
25
  }
26
26
 
27
27
  wp_register_script_module(
@@ -24,12 +24,32 @@ const transforms = {
24
24
  const blobURL = createBlobURL( file );
25
25
 
26
26
  // File will be uploaded in componentDidMount()
27
- blocks.push(
28
- createBlock( 'core/file', {
29
- blob: blobURL,
30
- fileName: file.name,
31
- } )
32
- );
27
+ if ( file.type.startsWith( 'video/' ) ) {
28
+ blocks.push(
29
+ createBlock( 'core/video', {
30
+ blob: createBlobURL( file ),
31
+ } )
32
+ );
33
+ } else if ( file.type.startsWith( 'image/' ) ) {
34
+ blocks.push(
35
+ createBlock( 'core/image', {
36
+ blob: createBlobURL( file ),
37
+ } )
38
+ );
39
+ } else if ( file.type.startsWith( 'audio/' ) ) {
40
+ blocks.push(
41
+ createBlock( 'core/audio', {
42
+ blob: createBlobURL( file ),
43
+ } )
44
+ );
45
+ } else {
46
+ blocks.push(
47
+ createBlock( 'core/file', {
48
+ blob: blobURL,
49
+ fileName: file.name,
50
+ } )
51
+ );
52
+ }
33
53
  } );
34
54
 
35
55
  return blocks;
@@ -9,6 +9,7 @@ import removeAccents from 'remove-accents';
9
9
  */
10
10
  import {
11
11
  RichText,
12
+ useBlockProps,
12
13
  __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
13
14
  __experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
14
15
  } from '@wordpress/block-editor';
@@ -26,6 +27,118 @@ const getNameFromLabelV1 = ( content ) => {
26
27
  );
27
28
  };
28
29
 
30
+ const v2 = {
31
+ attributes: {
32
+ type: {
33
+ type: 'string',
34
+ default: 'text',
35
+ },
36
+ name: {
37
+ type: 'string',
38
+ },
39
+ label: {
40
+ type: 'string',
41
+ default: 'Label',
42
+ selector: '.wp-block-form-input__label-content',
43
+ source: 'html',
44
+ __experimentalRole: 'content',
45
+ },
46
+ inlineLabel: {
47
+ type: 'boolean',
48
+ default: false,
49
+ },
50
+ required: {
51
+ type: 'boolean',
52
+ default: false,
53
+ selector: '.wp-block-form-input__input',
54
+ source: 'attribute',
55
+ attribute: 'required',
56
+ },
57
+ placeholder: {
58
+ type: 'string',
59
+ selector: '.wp-block-form-input__input',
60
+ source: 'attribute',
61
+ attribute: 'placeholder',
62
+ __experimentalRole: 'content',
63
+ },
64
+ value: {
65
+ type: 'string',
66
+ default: '',
67
+ selector: 'input',
68
+ source: 'attribute',
69
+ attribute: 'value',
70
+ },
71
+ visibilityPermissions: {
72
+ type: 'string',
73
+ default: 'all',
74
+ },
75
+ },
76
+ supports: {
77
+ anchor: true,
78
+ reusable: false,
79
+ spacing: {
80
+ margin: [ 'top', 'bottom' ],
81
+ },
82
+ __experimentalBorder: {
83
+ radius: true,
84
+ __experimentalSkipSerialization: true,
85
+ __experimentalDefaultControls: {
86
+ radius: true,
87
+ },
88
+ },
89
+ },
90
+ save( { attributes } ) {
91
+ const { type, name, label, inlineLabel, required, placeholder, value } =
92
+ attributes;
93
+
94
+ const borderProps = getBorderClassesAndStyles( attributes );
95
+ const colorProps = getColorClassesAndStyles( attributes );
96
+
97
+ const inputStyle = {
98
+ ...borderProps.style,
99
+ ...colorProps.style,
100
+ };
101
+
102
+ const inputClasses = clsx(
103
+ 'wp-block-form-input__input',
104
+ colorProps.className,
105
+ borderProps.className
106
+ );
107
+ const TagName = type === 'textarea' ? 'textarea' : 'input';
108
+
109
+ const blockProps = useBlockProps.save();
110
+
111
+ if ( 'hidden' === type ) {
112
+ return <input type={ type } name={ name } value={ value } />;
113
+ }
114
+
115
+ return (
116
+ <div { ...blockProps }>
117
+ { /* eslint-disable jsx-a11y/label-has-associated-control */ }
118
+ <label
119
+ className={ clsx( 'wp-block-form-input__label', {
120
+ 'is-label-inline': inlineLabel,
121
+ } ) }
122
+ >
123
+ <span className="wp-block-form-input__label-content">
124
+ <RichText.Content value={ label } />
125
+ </span>
126
+ <TagName
127
+ className={ inputClasses }
128
+ type={ 'textarea' === type ? undefined : type }
129
+ name={ name || getNameFromLabelV1( label ) }
130
+ required={ required }
131
+ aria-required={ required }
132
+ placeholder={ placeholder || undefined }
133
+ style={ inputStyle }
134
+ />
135
+ </label>
136
+ { /* eslint-enable jsx-a11y/label-has-associated-control */ }
137
+ </div>
138
+ );
139
+ },
140
+ };
141
+
29
142
  // Version without wrapper div in saved markup
30
143
  // See: https://github.com/WordPress/gutenberg/pull/56507
31
144
  const v1 = {
@@ -137,6 +250,6 @@ const v1 = {
137
250
  },
138
251
  };
139
252
 
140
- const deprecated = [ v1 ];
253
+ const deprecated = [ v2, v1 ];
141
254
 
142
255
  export default deprecated;
@@ -31,6 +31,9 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
31
31
  ref.current.focus();
32
32
  }
33
33
 
34
+ // Note: radio inputs aren't implemented yet.
35
+ const isCheckboxOrRadio = type === 'checkbox' || type === 'radio';
36
+
34
37
  const controls = (
35
38
  <>
36
39
  { 'hidden' !== type && (
@@ -81,6 +84,18 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
81
84
  </>
82
85
  );
83
86
 
87
+ const content = (
88
+ <RichText
89
+ tagName="span"
90
+ className="wp-block-form-input__label-content"
91
+ value={ label }
92
+ onChange={ ( newLabel ) => setAttributes( { label: newLabel } ) }
93
+ aria-label={ label ? __( 'Label' ) : __( 'Empty label' ) }
94
+ data-empty={ ! label }
95
+ placeholder={ __( 'Type the label for this input' ) }
96
+ />
97
+ );
98
+
84
99
  if ( 'hidden' === type ) {
85
100
  return (
86
101
  <>
@@ -111,17 +126,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
111
126
  'is-label-inline': inlineLabel || 'checkbox' === type,
112
127
  } ) }
113
128
  >
114
- <RichText
115
- tagName="span"
116
- className="wp-block-form-input__label-content"
117
- value={ label }
118
- onChange={ ( newLabel ) =>
119
- setAttributes( { label: newLabel } )
120
- }
121
- aria-label={ label ? __( 'Label' ) : __( 'Empty label' ) }
122
- data-empty={ label ? false : true }
123
- placeholder={ __( 'Type the label for this input' ) }
124
- />
129
+ { ! isCheckboxOrRadio && content }
125
130
  <TagName
126
131
  type={ 'textarea' === type ? undefined : type }
127
132
  className={ clsx(
@@ -147,6 +152,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
147
152
  ...colorProps.style,
148
153
  } }
149
154
  />
155
+ { isCheckboxOrRadio && content }
150
156
  </span>
151
157
  </div>
152
158
  );
@@ -55,6 +55,9 @@ export default function save( { attributes } ) {
55
55
 
56
56
  const blockProps = useBlockProps.save();
57
57
 
58
+ // Note: radio inputs aren't implemented yet.
59
+ const isCheckboxOrRadio = type === 'checkbox' || type === 'radio';
60
+
58
61
  if ( 'hidden' === type ) {
59
62
  return <input type={ type } name={ name } value={ value } />;
60
63
  }
@@ -67,9 +70,11 @@ export default function save( { attributes } ) {
67
70
  'is-label-inline': inlineLabel,
68
71
  } ) }
69
72
  >
70
- <span className="wp-block-form-input__label-content">
71
- <RichText.Content value={ label } />
72
- </span>
73
+ { ! isCheckboxOrRadio && (
74
+ <span className="wp-block-form-input__label-content">
75
+ <RichText.Content value={ label } />
76
+ </span>
77
+ ) }
73
78
  <TagName
74
79
  className={ inputClasses }
75
80
  type={ 'textarea' === type ? undefined : type }
@@ -79,6 +84,11 @@ export default function save( { attributes } ) {
79
84
  placeholder={ placeholder || undefined }
80
85
  style={ inputStyle }
81
86
  />
87
+ { isCheckboxOrRadio && (
88
+ <span className="wp-block-form-input__label-content">
89
+ <RichText.Content value={ label } />
90
+ </span>
91
+ ) }
82
92
  </label>
83
93
  { /* eslint-enable jsx-a11y/label-has-associated-control */ }
84
94
  </div>
@@ -15,16 +15,17 @@
15
15
  }
16
16
  }
17
17
 
18
- /*
19
- Small tweak to left-align the checkbox.
20
- Even though `:has` is not currently supported in Firefox, this is a small tweak
21
- and does not affect the functionality of the block or the user's experience.
22
- There will be a minor inconsistency between browsers. However, it's more important to provide
23
- a better experience for 80+% of users, until Firefox catches up and supports `:has`.
24
- */
25
18
  &:has(input[type="checkbox"]) {
19
+ flex-direction: row;
26
20
  width: fit-content;
27
- /* stylelint-disable-next-line declaration-property-value-allowed-list -- This should be refactored to not use the row-reverse value. */
21
+
22
+ .wp-block-form-input__label-content {
23
+ margin: 0;
24
+ }
25
+ }
26
+
27
+ &:has(.wp-block-form-input__label-content + input[type="checkbox"]) {
28
+ /* stylelint-disable-next-line declaration-property-value-allowed-list -- This style is required for old markup. */
28
29
  flex-direction: row-reverse;
29
30
  }
30
31
  }
@@ -25,8 +25,7 @@ function ModalAuxiliaryActions( { onClick, isModalFullScreen } ) {
25
25
 
26
26
  return (
27
27
  <Button
28
- // TODO: Switch to `true` (40px size) if possible
29
- __next40pxDefaultSize={ false }
28
+ size="small"
30
29
  onClick={ onClick }
31
30
  icon={ fullscreen }
32
31
  isPressed={ isModalFullScreen }
@@ -123,8 +122,7 @@ export default function ModalEdit( props ) {
123
122
  >
124
123
  <FlexItem>
125
124
  <Button
126
- // TODO: Switch to `true` (40px size) if possible
127
- __next40pxDefaultSize={ false }
125
+ __next40pxDefaultSize
128
126
  variant="tertiary"
129
127
  onClick={ onClose }
130
128
  >
@@ -133,8 +131,7 @@ export default function ModalEdit( props ) {
133
131
  </FlexItem>
134
132
  <FlexItem>
135
133
  <Button
136
- // TODO: Switch to `true` (40px size) if possible
137
- __next40pxDefaultSize={ false }
134
+ __next40pxDefaultSize
138
135
  variant="primary"
139
136
  onClick={ () => {
140
137
  setAttributes( {