@wordpress/block-library 9.25.0 → 9.26.1-next.719a03cbe.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 (179) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/avatar/edit.js +84 -39
  3. package/build/avatar/edit.js.map +1 -1
  4. package/build/avatar/user-control.js +32 -17
  5. package/build/avatar/user-control.js.map +1 -1
  6. package/build/button/edit.js +1 -1
  7. package/build/button/edit.js.map +1 -1
  8. package/build/cover/edit/inspector-controls.js +2 -2
  9. package/build/cover/edit/inspector-controls.js.map +1 -1
  10. package/build/details/index.js +1 -1
  11. package/build/details/index.js.map +1 -1
  12. package/build/embed/variations.js +0 -10
  13. package/build/embed/variations.js.map +1 -1
  14. package/build/form/edit.js +0 -1
  15. package/build/form/edit.js.map +1 -1
  16. package/build/form/index.js +3 -3
  17. package/build/form/index.js.map +1 -1
  18. package/build/form-input/index.js +2 -1
  19. package/build/form-input/index.js.map +1 -1
  20. package/build/form-submission-notification/index.js +2 -1
  21. package/build/form-submission-notification/index.js.map +1 -1
  22. package/build/form-submit-button/index.js +2 -1
  23. package/build/form-submit-button/index.js.map +1 -1
  24. package/build/gallery/constants.js +2 -1
  25. package/build/gallery/constants.js.map +1 -1
  26. package/build/gallery/edit.js +93 -15
  27. package/build/gallery/edit.js.map +1 -1
  28. package/build/image/edit.js +6 -0
  29. package/build/image/edit.js.map +1 -1
  30. package/build/image/image.js +1 -0
  31. package/build/image/image.js.map +1 -1
  32. package/build/image/view.js +0 -3
  33. package/build/image/view.js.map +1 -1
  34. package/build/list/index.js +0 -1
  35. package/build/list/index.js.map +1 -1
  36. package/build/more/edit.native.js +17 -32
  37. package/build/more/edit.native.js.map +1 -1
  38. package/build/navigation-link/edit.js +28 -1
  39. package/build/navigation-link/edit.js.map +1 -1
  40. package/build/post-author/edit.js +152 -52
  41. package/build/post-author/edit.js.map +1 -1
  42. package/build/post-comments-form/form.js +1 -1
  43. package/build/post-comments-form/form.js.map +1 -1
  44. package/build/post-featured-image/edit.js +2 -1
  45. package/build/post-featured-image/edit.js.map +1 -1
  46. package/build/post-navigation-link/edit.js +72 -33
  47. package/build/post-navigation-link/edit.js.map +1 -1
  48. package/build/search/edit.js +1 -1
  49. package/build/search/edit.js.map +1 -1
  50. package/build/site-logo/edit.js +69 -24
  51. package/build/site-logo/edit.js.map +1 -1
  52. package/build/social-link/edit.js +21 -5
  53. package/build/social-link/edit.js.map +1 -1
  54. package/build/social-link/edit.native.js +13 -5
  55. package/build/social-link/edit.native.js.map +1 -1
  56. package/build/social-link/social-list.js +17 -25
  57. package/build/social-link/social-list.js.map +1 -1
  58. package/build/social-links/edit.js +8 -5
  59. package/build/social-links/edit.js.map +1 -1
  60. package/build/video/tracks-editor.js +23 -9
  61. package/build/video/tracks-editor.js.map +1 -1
  62. package/build-module/avatar/edit.js +83 -38
  63. package/build-module/avatar/edit.js.map +1 -1
  64. package/build-module/avatar/user-control.js +33 -18
  65. package/build-module/avatar/user-control.js.map +1 -1
  66. package/build-module/button/edit.js +1 -1
  67. package/build-module/button/edit.js.map +1 -1
  68. package/build-module/cover/edit/inspector-controls.js +2 -2
  69. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  70. package/build-module/details/index.js +1 -1
  71. package/build-module/details/index.js.map +1 -1
  72. package/build-module/embed/variations.js +0 -10
  73. package/build-module/embed/variations.js.map +1 -1
  74. package/build-module/form/edit.js +0 -1
  75. package/build-module/form/edit.js.map +1 -1
  76. package/build-module/form/index.js +3 -3
  77. package/build-module/form/index.js.map +1 -1
  78. package/build-module/form-input/index.js +2 -1
  79. package/build-module/form-input/index.js.map +1 -1
  80. package/build-module/form-submission-notification/index.js +2 -1
  81. package/build-module/form-submission-notification/index.js.map +1 -1
  82. package/build-module/form-submit-button/index.js +2 -1
  83. package/build-module/form-submit-button/index.js.map +1 -1
  84. package/build-module/gallery/constants.js +1 -0
  85. package/build-module/gallery/constants.js.map +1 -1
  86. package/build-module/gallery/edit.js +95 -17
  87. package/build-module/gallery/edit.js.map +1 -1
  88. package/build-module/image/edit.js +6 -0
  89. package/build-module/image/edit.js.map +1 -1
  90. package/build-module/image/image.js +1 -0
  91. package/build-module/image/image.js.map +1 -1
  92. package/build-module/image/view.js +0 -3
  93. package/build-module/image/view.js.map +1 -1
  94. package/build-module/list/index.js +0 -1
  95. package/build-module/list/index.js.map +1 -1
  96. package/build-module/more/edit.native.js +16 -30
  97. package/build-module/more/edit.native.js.map +1 -1
  98. package/build-module/navigation-link/edit.js +29 -2
  99. package/build-module/navigation-link/edit.js.map +1 -1
  100. package/build-module/post-author/edit.js +153 -53
  101. package/build-module/post-author/edit.js.map +1 -1
  102. package/build-module/post-comments-form/form.js +1 -1
  103. package/build-module/post-comments-form/form.js.map +1 -1
  104. package/build-module/post-featured-image/edit.js +2 -1
  105. package/build-module/post-featured-image/edit.js.map +1 -1
  106. package/build-module/post-navigation-link/edit.js +73 -34
  107. package/build-module/post-navigation-link/edit.js.map +1 -1
  108. package/build-module/search/edit.js +1 -1
  109. package/build-module/search/edit.js.map +1 -1
  110. package/build-module/site-logo/edit.js +70 -25
  111. package/build-module/site-logo/edit.js.map +1 -1
  112. package/build-module/social-link/edit.js +24 -8
  113. package/build-module/social-link/edit.js.map +1 -1
  114. package/build-module/social-link/edit.native.js +15 -6
  115. package/build-module/social-link/edit.native.js.map +1 -1
  116. package/build-module/social-link/social-list.js +16 -21
  117. package/build-module/social-link/social-list.js.map +1 -1
  118. package/build-module/social-links/edit.js +8 -5
  119. package/build-module/social-links/edit.js.map +1 -1
  120. package/build-module/video/tracks-editor.js +24 -10
  121. package/build-module/video/tracks-editor.js.map +1 -1
  122. package/build-style/calendar/style-rtl.css +7 -7
  123. package/build-style/calendar/style.css +7 -7
  124. package/build-style/comments-pagination/editor-rtl.css +0 -12
  125. package/build-style/comments-pagination/editor.css +0 -14
  126. package/build-style/comments-pagination/style-rtl.css +0 -7
  127. package/build-style/comments-pagination/style.css +0 -9
  128. package/build-style/editor-rtl.css +0 -30
  129. package/build-style/editor.css +0 -32
  130. package/build-style/gallery/editor-rtl.css +0 -13
  131. package/build-style/gallery/editor.css +0 -13
  132. package/build-style/navigation/style-rtl.css +5 -0
  133. package/build-style/navigation/style.css +5 -0
  134. package/build-style/style-rtl.css +12 -14
  135. package/build-style/style.css +12 -16
  136. package/package.json +35 -35
  137. package/src/avatar/edit.js +99 -51
  138. package/src/avatar/user-control.js +34 -29
  139. package/src/button/edit.js +1 -1
  140. package/src/calendar/style.scss +10 -10
  141. package/src/comments-pagination/editor.scss +0 -15
  142. package/src/comments-pagination/style.scss +0 -8
  143. package/src/cover/edit/inspector-controls.js +1 -1
  144. package/src/details/index.js +1 -1
  145. package/src/editor.scss +0 -1
  146. package/src/embed/variations.js +0 -8
  147. package/src/form/block.json +1 -2
  148. package/src/form/edit.js +0 -1
  149. package/src/form/index.js +1 -0
  150. package/src/form-input/index.js +1 -0
  151. package/src/form-submission-notification/index.js +1 -0
  152. package/src/form-submit-button/index.js +1 -0
  153. package/src/gallery/constants.js +1 -0
  154. package/src/gallery/edit.js +182 -68
  155. package/src/gallery/editor.scss +0 -17
  156. package/src/image/edit.js +12 -0
  157. package/src/image/image.js +1 -0
  158. package/src/image/index.php +4 -1
  159. package/src/image/view.js +0 -3
  160. package/src/list/block.json +0 -1
  161. package/src/more/edit.native.js +19 -33
  162. package/src/navigation/style.scss +9 -0
  163. package/src/navigation-link/edit.js +32 -2
  164. package/src/post-author/edit.js +178 -63
  165. package/src/post-comments-form/form.js +1 -1
  166. package/src/post-featured-image/edit.js +1 -0
  167. package/src/post-navigation-link/edit.js +96 -51
  168. package/src/rss/index.php +2 -1
  169. package/src/search/edit.js +1 -1
  170. package/src/site-logo/edit.js +90 -35
  171. package/src/social-link/edit.js +18 -7
  172. package/src/social-link/edit.native.js +10 -4
  173. package/src/social-link/index.php +13 -0
  174. package/src/social-link/social-list.js +15 -20
  175. package/src/social-links/edit.js +6 -7
  176. package/src/video/tracks-editor.js +18 -6
  177. package/build-style/post-author/editor-rtl.css +0 -140
  178. package/build-style/post-author/editor.css +0 -140
  179. package/src/post-author/editor.scss +0 -7
@@ -331,19 +331,19 @@
331
331
  width: 100%;
332
332
  border-collapse: collapse;
333
333
  }
334
- .wp-block-calendar table:where(:not(.has-text-color)) {
335
- color: #40464d;
336
- }
337
- .wp-block-calendar table:where(:not(.has-text-color)) th,
338
- .wp-block-calendar table:where(:not(.has-text-color)) td {
339
- border-color: #ddd;
340
- }
341
334
  .wp-block-calendar table.has-background th {
342
335
  background-color: inherit;
343
336
  }
344
337
  .wp-block-calendar table.has-text-color th {
345
338
  color: inherit;
346
339
  }
340
+ .wp-block-calendar :where(table:not(.has-text-color)) {
341
+ color: #40464d;
342
+ }
343
+ .wp-block-calendar :where(table:not(.has-text-color)) th,
344
+ .wp-block-calendar :where(table:not(.has-text-color)) td {
345
+ border-color: #ddd;
346
+ }
347
347
 
348
348
  :where(.wp-block-calendar table:not(.has-background) th) {
349
349
  background: #ddd;
@@ -580,15 +580,8 @@
580
580
  .wp-block-comments-pagination > .wp-block-comments-pagination-next,
581
581
  .wp-block-comments-pagination > .wp-block-comments-pagination-previous,
582
582
  .wp-block-comments-pagination > .wp-block-comments-pagination-numbers {
583
- margin-right: 0.5em;
584
- margin-bottom: 0.5em;
585
583
  font-size: inherit;
586
584
  }
587
- .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child,
588
- .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child,
589
- .wp-block-comments-pagination > .wp-block-comments-pagination-numbers:last-child {
590
- margin-right: 0;
591
- }
592
585
  .wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow {
593
586
  margin-left: 1ch;
594
587
  display: inline-block;
@@ -2289,6 +2282,7 @@ ul {
2289
2282
  }
2290
2283
  .wp-block-navigation .wp-block-navigation-item__content {
2291
2284
  display: block;
2285
+ z-index: 1;
2292
2286
  }
2293
2287
  .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
2294
2288
  color: inherit;
@@ -2469,6 +2463,10 @@ button.wp-block-navigation-item__content {
2469
2463
  .wp-block-navigation-submenu__toggle {
2470
2464
  cursor: pointer;
2471
2465
  }
2466
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] + .wp-block-navigation__submenu-icon > svg,
2467
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] > svg {
2468
+ transform: rotate(-180deg);
2469
+ }
2472
2470
 
2473
2471
  .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle {
2474
2472
  padding-right: 0;
@@ -332,19 +332,19 @@
332
332
  width: 100%;
333
333
  border-collapse: collapse;
334
334
  }
335
- .wp-block-calendar table:where(:not(.has-text-color)) {
336
- color: #40464d;
337
- }
338
- .wp-block-calendar table:where(:not(.has-text-color)) th,
339
- .wp-block-calendar table:where(:not(.has-text-color)) td {
340
- border-color: #ddd;
341
- }
342
335
  .wp-block-calendar table.has-background th {
343
336
  background-color: inherit;
344
337
  }
345
338
  .wp-block-calendar table.has-text-color th {
346
339
  color: inherit;
347
340
  }
341
+ .wp-block-calendar :where(table:not(.has-text-color)) {
342
+ color: #40464d;
343
+ }
344
+ .wp-block-calendar :where(table:not(.has-text-color)) th,
345
+ .wp-block-calendar :where(table:not(.has-text-color)) td {
346
+ border-color: #ddd;
347
+ }
348
348
 
349
349
  :where(.wp-block-calendar table:not(.has-background) th) {
350
350
  background: #ddd;
@@ -585,17 +585,8 @@
585
585
  .wp-block-comments-pagination > .wp-block-comments-pagination-next,
586
586
  .wp-block-comments-pagination > .wp-block-comments-pagination-previous,
587
587
  .wp-block-comments-pagination > .wp-block-comments-pagination-numbers {
588
- /*rtl:ignore*/
589
- margin-right: 0.5em;
590
- margin-bottom: 0.5em;
591
588
  font-size: inherit;
592
589
  }
593
- .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child,
594
- .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child,
595
- .wp-block-comments-pagination > .wp-block-comments-pagination-numbers:last-child {
596
- /*rtl:ignore*/
597
- margin-right: 0;
598
- }
599
590
  .wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow {
600
591
  margin-right: 1ch;
601
592
  display: inline-block;
@@ -2321,6 +2312,7 @@ ul {
2321
2312
  }
2322
2313
  .wp-block-navigation .wp-block-navigation-item__content {
2323
2314
  display: block;
2315
+ z-index: 1;
2324
2316
  }
2325
2317
  .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
2326
2318
  color: inherit;
@@ -2501,6 +2493,10 @@ button.wp-block-navigation-item__content {
2501
2493
  .wp-block-navigation-submenu__toggle {
2502
2494
  cursor: pointer;
2503
2495
  }
2496
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] + .wp-block-navigation__submenu-icon > svg,
2497
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] > svg {
2498
+ transform: rotate(180deg);
2499
+ }
2504
2500
 
2505
2501
  .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle {
2506
2502
  padding-left: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.25.0",
3
+ "version": "9.26.1-next.719a03cbe.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,39 +41,39 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@babel/runtime": "7.25.7",
44
- "@wordpress/a11y": "^4.25.0",
45
- "@wordpress/api-fetch": "^7.25.0",
46
- "@wordpress/autop": "^4.25.0",
47
- "@wordpress/blob": "^4.25.0",
48
- "@wordpress/block-editor": "^14.20.0",
49
- "@wordpress/blocks": "^14.14.0",
50
- "@wordpress/components": "^29.11.0",
51
- "@wordpress/compose": "^7.25.0",
52
- "@wordpress/core-data": "^7.25.0",
53
- "@wordpress/data": "^10.25.0",
54
- "@wordpress/date": "^5.25.0",
55
- "@wordpress/deprecated": "^4.25.0",
56
- "@wordpress/dom": "^4.25.0",
57
- "@wordpress/element": "^6.25.0",
58
- "@wordpress/escape-html": "^3.25.0",
59
- "@wordpress/hooks": "^4.25.0",
60
- "@wordpress/html-entities": "^4.25.0",
61
- "@wordpress/i18n": "^5.25.0",
62
- "@wordpress/icons": "^10.25.0",
63
- "@wordpress/interactivity": "^6.25.0",
64
- "@wordpress/interactivity-router": "^2.25.0",
65
- "@wordpress/keyboard-shortcuts": "^5.25.0",
66
- "@wordpress/keycodes": "^4.25.0",
67
- "@wordpress/notices": "^5.25.0",
68
- "@wordpress/patterns": "^2.25.0",
69
- "@wordpress/primitives": "^4.25.0",
70
- "@wordpress/private-apis": "^1.25.0",
71
- "@wordpress/reusable-blocks": "^5.25.0",
72
- "@wordpress/rich-text": "^7.25.0",
73
- "@wordpress/server-side-render": "^6.1.0",
74
- "@wordpress/url": "^4.25.0",
75
- "@wordpress/viewport": "^6.25.0",
76
- "@wordpress/wordcount": "^4.25.0",
44
+ "@wordpress/a11y": "^4.26.1-next.719a03cbe.0",
45
+ "@wordpress/api-fetch": "^7.26.1-next.719a03cbe.0",
46
+ "@wordpress/autop": "^4.26.1-next.719a03cbe.0",
47
+ "@wordpress/blob": "^4.26.1-next.719a03cbe.0",
48
+ "@wordpress/block-editor": "^14.21.1-next.719a03cbe.0",
49
+ "@wordpress/blocks": "^14.15.1-next.719a03cbe.0",
50
+ "@wordpress/components": "^29.13.1-next.719a03cbe.0",
51
+ "@wordpress/compose": "^7.26.1-next.719a03cbe.0",
52
+ "@wordpress/core-data": "^7.26.1-next.719a03cbe.0",
53
+ "@wordpress/data": "^10.26.1-next.719a03cbe.0",
54
+ "@wordpress/date": "^5.26.1-next.719a03cbe.0",
55
+ "@wordpress/deprecated": "^4.26.1-next.719a03cbe.0",
56
+ "@wordpress/dom": "^4.26.1-next.719a03cbe.0",
57
+ "@wordpress/element": "^6.26.1-next.719a03cbe.0",
58
+ "@wordpress/escape-html": "^3.26.1-next.719a03cbe.0",
59
+ "@wordpress/hooks": "^4.26.1-next.719a03cbe.0",
60
+ "@wordpress/html-entities": "^4.26.1-next.719a03cbe.0",
61
+ "@wordpress/i18n": "^6.0.1-next.719a03cbe.0",
62
+ "@wordpress/icons": "^10.26.2-next.719a03cbe.0",
63
+ "@wordpress/interactivity": "^6.26.1-next.719a03cbe.0",
64
+ "@wordpress/interactivity-router": "^2.26.1-next.719a03cbe.0",
65
+ "@wordpress/keyboard-shortcuts": "^5.26.1-next.719a03cbe.0",
66
+ "@wordpress/keycodes": "^4.26.1-next.719a03cbe.0",
67
+ "@wordpress/notices": "^5.26.1-next.719a03cbe.0",
68
+ "@wordpress/patterns": "^2.26.1-next.719a03cbe.0",
69
+ "@wordpress/primitives": "^4.26.1-next.719a03cbe.0",
70
+ "@wordpress/private-apis": "^1.26.1-next.719a03cbe.0",
71
+ "@wordpress/reusable-blocks": "^5.26.1-next.719a03cbe.0",
72
+ "@wordpress/rich-text": "^7.26.1-next.719a03cbe.0",
73
+ "@wordpress/server-side-render": "^6.2.1-next.719a03cbe.0",
74
+ "@wordpress/url": "^4.26.1-next.719a03cbe.0",
75
+ "@wordpress/viewport": "^6.26.1-next.719a03cbe.0",
76
+ "@wordpress/wordcount": "^4.26.1-next.719a03cbe.0",
77
77
  "change-case": "^4.1.2",
78
78
  "clsx": "^2.1.1",
79
79
  "colord": "^2.7.0",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "d1acd76ffff33ab01f0a948d2f51e5e45c95158d"
94
+ "gitHead": "5e146e949c2765411a8310bcc2641a88d036a6d9"
95
95
  }
@@ -12,10 +12,11 @@ import {
12
12
  __experimentalUseBorderProps as useBorderProps,
13
13
  } from '@wordpress/block-editor';
14
14
  import {
15
- PanelBody,
16
15
  RangeControl,
17
16
  ResizableBox,
18
17
  ToggleControl,
18
+ __experimentalToolsPanel as ToolsPanel,
19
+ __experimentalToolsPanelItem as ToolsPanelItem,
19
20
  } from '@wordpress/components';
20
21
  import { __, isRTL } from '@wordpress/i18n';
21
22
  import { addQueryArgs, removeQueryArgs } from '@wordpress/url';
@@ -23,7 +24,8 @@ import { addQueryArgs, removeQueryArgs } from '@wordpress/url';
23
24
  /**
24
25
  * Internal dependencies
25
26
  */
26
- import { useUserAvatar, useCommentAvatar } from './hooks';
27
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
28
+ import { useCommentAvatar, useUserAvatar } from './hooks';
27
29
  import UserControl from './user-control';
28
30
 
29
31
  const AvatarInspectorControls = ( {
@@ -31,56 +33,102 @@ const AvatarInspectorControls = ( {
31
33
  avatar,
32
34
  attributes,
33
35
  selectUser,
34
- } ) => (
35
- <InspectorControls>
36
- <PanelBody title={ __( 'Settings' ) }>
37
- <RangeControl
38
- __nextHasNoMarginBottom
39
- __next40pxDefaultSize
40
- label={ __( 'Image size' ) }
41
- onChange={ ( newSize ) =>
36
+ } ) => {
37
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
38
+ return (
39
+ <InspectorControls>
40
+ <ToolsPanel
41
+ label={ __( 'Settings' ) }
42
+ resetAll={ () => {
42
43
  setAttributes( {
43
- size: newSize,
44
- } )
45
- }
46
- min={ avatar.minSize }
47
- max={ avatar.maxSize }
48
- initialPosition={ attributes?.size }
49
- value={ attributes?.size }
50
- />
51
- <ToggleControl
52
- __nextHasNoMarginBottom
53
- label={ __( 'Link to user profile' ) }
54
- onChange={ () =>
55
- setAttributes( { isLink: ! attributes.isLink } )
56
- }
57
- checked={ attributes.isLink }
58
- />
59
- { attributes.isLink && (
60
- <ToggleControl
61
- __nextHasNoMarginBottom
62
- label={ __( 'Open in new tab' ) }
63
- onChange={ ( value ) =>
64
- setAttributes( {
65
- linkTarget: value ? '_blank' : '_self',
66
- } )
67
- }
68
- checked={ attributes.linkTarget === '_blank' }
69
- />
70
- ) }
71
- { selectUser && (
72
- <UserControl
73
- value={ attributes?.userId }
74
- onChange={ ( value ) => {
75
- setAttributes( {
76
- userId: value,
77
- } );
78
- } }
79
- />
80
- ) }
81
- </PanelBody>
82
- </InspectorControls>
83
- );
44
+ size: 96,
45
+ isLink: false,
46
+ linkTarget: '_self',
47
+ userId: undefined,
48
+ } );
49
+ } }
50
+ dropdownMenuProps={ dropdownMenuProps }
51
+ >
52
+ <ToolsPanelItem
53
+ label={ __( 'Image size' ) }
54
+ isShownByDefault
55
+ hasValue={ () => attributes?.size !== 96 }
56
+ onDeselect={ () => setAttributes( { size: 96 } ) }
57
+ >
58
+ <RangeControl
59
+ __nextHasNoMarginBottom
60
+ __next40pxDefaultSize
61
+ label={ __( 'Image size' ) }
62
+ onChange={ ( newSize ) =>
63
+ setAttributes( {
64
+ size: newSize,
65
+ } )
66
+ }
67
+ min={ avatar.minSize }
68
+ max={ avatar.maxSize }
69
+ initialPosition={ attributes?.size }
70
+ value={ attributes?.size }
71
+ />
72
+ </ToolsPanelItem>
73
+ <ToolsPanelItem
74
+ label={ __( 'Link to user profile' ) }
75
+ isShownByDefault
76
+ hasValue={ () => attributes?.isLink }
77
+ onDeselect={ () => setAttributes( { isLink: false } ) }
78
+ >
79
+ <ToggleControl
80
+ __nextHasNoMarginBottom
81
+ label={ __( 'Link to user profile' ) }
82
+ onChange={ () =>
83
+ setAttributes( { isLink: ! attributes.isLink } )
84
+ }
85
+ checked={ attributes.isLink }
86
+ />
87
+ </ToolsPanelItem>
88
+ { attributes.isLink && (
89
+ <ToolsPanelItem
90
+ label={ __( 'Open in new tab' ) }
91
+ isShownByDefault
92
+ hasValue={ () => attributes?.linkTarget !== '_self' }
93
+ onDeselect={ () =>
94
+ setAttributes( { linkTarget: '_self' } )
95
+ }
96
+ >
97
+ <ToggleControl
98
+ __nextHasNoMarginBottom
99
+ label={ __( 'Open in new tab' ) }
100
+ onChange={ ( value ) =>
101
+ setAttributes( {
102
+ linkTarget: value ? '_blank' : '_self',
103
+ } )
104
+ }
105
+ checked={ attributes.linkTarget === '_blank' }
106
+ />
107
+ </ToolsPanelItem>
108
+ ) }
109
+ { selectUser && (
110
+ <ToolsPanelItem
111
+ label={ __( 'User' ) }
112
+ isShownByDefault
113
+ hasValue={ () => !! attributes?.userId }
114
+ onDeselect={ () =>
115
+ setAttributes( { userId: undefined } )
116
+ }
117
+ >
118
+ <UserControl
119
+ value={ attributes?.userId }
120
+ onChange={ ( value ) => {
121
+ setAttributes( {
122
+ userId: value,
123
+ } );
124
+ } }
125
+ />
126
+ </ToolsPanelItem>
127
+ ) }
128
+ </ToolsPanel>
129
+ </InspectorControls>
130
+ );
131
+ };
84
132
 
85
133
  const ResizableAvatar = ( {
86
134
  setAttributes,
@@ -5,31 +5,45 @@ import { __ } from '@wordpress/i18n';
5
5
  import { ComboboxControl } from '@wordpress/components';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
- import { useState } from '@wordpress/element';
8
+ import { useMemo, useState } from '@wordpress/element';
9
+ import { debounce } from '@wordpress/compose';
10
+ import { decodeEntities } from '@wordpress/html-entities';
9
11
 
10
12
  const AUTHORS_QUERY = {
11
13
  who: 'authors',
12
- per_page: -1,
14
+ per_page: 100,
13
15
  _fields: 'id,name',
14
16
  context: 'view',
15
17
  };
16
18
 
17
- function UserControl( { value, onChange } ) {
18
- const [ filteredAuthorsList, setFilteredAuthorsList ] = useState();
19
- const authorsList = useSelect( ( select ) => {
20
- const { getUsers } = select( coreStore );
21
- return getUsers( AUTHORS_QUERY );
22
- }, [] );
23
- if ( ! authorsList ) {
24
- return null;
25
- }
19
+ export default function UserControl( { value, onChange } ) {
20
+ const [ filterValue, setFilterValue ] = useState( '' );
21
+ const { authors, isLoading } = useSelect(
22
+ ( select ) => {
23
+ const { getUsers, isResolving } = select( coreStore );
26
24
 
27
- const options = authorsList.map( ( author ) => {
28
- return {
29
- label: author.name,
30
- value: author.id,
31
- };
32
- } );
25
+ const query = { ...AUTHORS_QUERY };
26
+ if ( filterValue ) {
27
+ query.search = filterValue;
28
+ query.search_columns = [ 'name' ];
29
+ }
30
+
31
+ return {
32
+ authors: getUsers( query ),
33
+ isLoading: isResolving( 'getUsers', [ query ] ),
34
+ };
35
+ },
36
+ [ filterValue ]
37
+ );
38
+
39
+ const options = useMemo( () => {
40
+ return ( authors ?? [] ).map( ( author ) => {
41
+ return {
42
+ value: author.id,
43
+ label: decodeEntities( author.name ),
44
+ };
45
+ } );
46
+ }, [ authors ] );
33
47
 
34
48
  return (
35
49
  <ComboboxControl
@@ -41,18 +55,9 @@ function UserControl( { value, onChange } ) {
41
55
  ) }
42
56
  value={ value }
43
57
  onChange={ onChange }
44
- options={ filteredAuthorsList || options }
45
- onFilterValueChange={ ( inputValue ) =>
46
- setFilteredAuthorsList(
47
- options.filter( ( option ) =>
48
- option.label
49
- .toLowerCase()
50
- .startsWith( inputValue.toLowerCase() )
51
- )
52
- )
53
- }
58
+ options={ options }
59
+ onFilterValueChange={ debounce( setFilterValue, 300 ) }
60
+ isLoading={ isLoading }
54
61
  />
55
62
  );
56
63
  }
57
-
58
- export default UserControl;
@@ -159,7 +159,7 @@ function WidthPanel( { selectedWidth, setAttributes } ) {
159
159
  key={ widthValue }
160
160
  value={ widthValue }
161
161
  label={ sprintf(
162
- /* translators: Percentage value. */
162
+ /* translators: %d: Percentage value. */
163
163
  __( '%d%%' ),
164
164
  widthValue
165
165
  ) }
@@ -19,16 +19,6 @@
19
19
  width: 100%;
20
20
  border-collapse: collapse;
21
21
 
22
- &:where(:not(.has-text-color)) {
23
- color: #40464d;
24
-
25
- // Keep the hard-coded border color for backward compatibility.
26
- th,
27
- td {
28
- border-color: $gray-300;
29
- }
30
- }
31
-
32
22
  &.has-background th {
33
23
  background-color: inherit;
34
24
  }
@@ -37,6 +27,16 @@
37
27
  color: inherit;
38
28
  }
39
29
  }
30
+
31
+ :where(table:not(.has-text-color)) {
32
+ color: #40464d;
33
+
34
+ // Keep the hard-coded border color for backward compatibility.
35
+ th,
36
+ td {
37
+ border-color: $gray-300;
38
+ }
39
+ }
40
40
  }
41
41
 
42
42
  // Keep the hard-coded header background color for backward compatibility.
@@ -8,9 +8,6 @@ $pagination-margin: 0.5em;
8
8
  :where(.editor-styles-wrapper) {
9
9
  .wp-block-comments-pagination {
10
10
  max-width: 100%;
11
- &.block-editor-block-list__layout {
12
- margin: 0;
13
- }
14
11
  }
15
12
  }
16
13
 
@@ -18,18 +15,6 @@ $pagination-margin: 0.5em;
18
15
  > .wp-block-comments-pagination-next,
19
16
  > .wp-block-comments-pagination-previous,
20
17
  > .wp-block-comments-pagination-numbers {
21
- // Override editor auto block margins.
22
- margin-left: 0;
23
- margin-top: $pagination-margin;
24
-
25
- /*rtl:ignore*/
26
- margin-right: $pagination-margin;
27
- margin-bottom: $pagination-margin;
28
-
29
18
  font-size: inherit;
30
- &:last-child {
31
- /*rtl:ignore*/
32
- margin-right: 0;
33
- }
34
19
  }
35
20
  }
@@ -4,15 +4,7 @@ $pagination-margin: 0.5em;
4
4
  > .wp-block-comments-pagination-next,
5
5
  > .wp-block-comments-pagination-previous,
6
6
  > .wp-block-comments-pagination-numbers {
7
- /*rtl:ignore*/
8
- margin-right: $pagination-margin;
9
- margin-bottom: $pagination-margin;
10
-
11
7
  font-size: inherit;
12
- &:last-child {
13
- /*rtl:ignore*/
14
- margin-right: 0;
15
- }
16
8
  }
17
9
  .wp-block-comments-pagination-previous-arrow {
18
10
  margin-right: 1ch;
@@ -198,8 +198,8 @@ export default function CoverInspectorControls( {
198
198
  focalPoint: undefined,
199
199
  isRepeated: false,
200
200
  alt: '',
201
- sizeSlug: undefined,
202
201
  } );
202
+ updateImage( DEFAULT_MEDIA_SIZE_SLUG );
203
203
  } }
204
204
  dropdownMenuProps={ dropdownMenuProps }
205
205
  >
@@ -50,7 +50,7 @@ export const settings = {
50
50
  return ! hasSummary
51
51
  ? __( 'Details. Empty.' )
52
52
  : sprintf(
53
- /* translators: accessibility text; summary title. */
53
+ /* translators: %s: accessibility text; summary title. */
54
54
  __( 'Details. %s' ),
55
55
  summary
56
56
  );
package/src/editor.scss CHANGED
@@ -31,7 +31,6 @@
31
31
  @import "./nextpage/editor.scss";
32
32
  @import "./page-list/editor.scss";
33
33
  @import "./paragraph/editor.scss";
34
- @import "./post-author/editor.scss";
35
34
  @import "./post-excerpt/editor.scss";
36
35
  @import "./pullquote/editor.scss";
37
36
  @import "./rss/editor.scss";
@@ -251,14 +251,6 @@ const variations = [
251
251
  patterns: [ /^https?:\/\/(www\.)?reverbnation\.com\/.+/i ],
252
252
  attributes: { providerNameSlug: 'reverbnation', responsive: true },
253
253
  },
254
- {
255
- name: 'screencast',
256
- title: getTitle( 'Screencast' ),
257
- icon: embedVideoIcon,
258
- description: __( 'Embed Screencast content.' ),
259
- patterns: [ /^https?:\/\/(www\.)?screencast\.com\/.+/i ],
260
- attributes: { providerNameSlug: 'screencast', responsive: true },
261
- },
262
254
  {
263
255
  name: 'scribd',
264
256
  title: getTitle( 'Scribd' ),
@@ -62,7 +62,6 @@
62
62
  "__experimentalDefaultControls": {
63
63
  "fontSize": true
64
64
  }
65
- },
66
- "__experimentalSelector": "form"
65
+ }
67
66
  }
68
67
  }
package/src/form/edit.js CHANGED
@@ -211,7 +211,6 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
211
211
  ) }
212
212
  <form
213
213
  { ...innerBlocksProps }
214
- className="wp-block-form"
215
214
  encType={ submissionMethod === 'email' ? 'text/plain' : null }
216
215
  />
217
216
  </>
package/src/form/index.js CHANGED
@@ -20,6 +20,7 @@ export const settings = {
20
20
  edit,
21
21
  save,
22
22
  variations,
23
+ example: {},
23
24
  };
24
25
 
25
26
  export const init = () => {
@@ -17,6 +17,7 @@ export const settings = {
17
17
  edit,
18
18
  save,
19
19
  variations,
20
+ example: {},
20
21
  };
21
22
 
22
23
  export const init = () => initBlock( { name, metadata, settings } );
@@ -21,6 +21,7 @@ export const settings = {
21
21
  edit,
22
22
  save,
23
23
  variations,
24
+ example: {},
24
25
  };
25
26
 
26
27
  export const init = () => initBlock( { name, metadata, settings } );
@@ -13,6 +13,7 @@ export { metadata, name };
13
13
  export const settings = {
14
14
  edit,
15
15
  save,
16
+ example: {},
16
17
  };
17
18
 
18
19
  export const init = () => initBlock( { name, metadata, settings } );
@@ -4,3 +4,4 @@ export const LINK_DESTINATION_LIGHTBOX = 'lightbox';
4
4
  export const LINK_DESTINATION_ATTACHMENT = 'attachment';
5
5
  export const LINK_DESTINATION_MEDIA_WP_CORE = 'file';
6
6
  export const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post';
7
+ export const DEFAULT_MEDIA_SIZE_SLUG = 'large';