@wordpress/block-library 9.25.0 → 9.26.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 (120) 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/embed/variations.js +0 -10
  7. package/build/embed/variations.js.map +1 -1
  8. package/build/form/edit.js +0 -1
  9. package/build/form/edit.js.map +1 -1
  10. package/build/form/index.js +3 -3
  11. package/build/form/index.js.map +1 -1
  12. package/build/form-input/index.js +2 -1
  13. package/build/form-input/index.js.map +1 -1
  14. package/build/form-submission-notification/index.js +2 -1
  15. package/build/form-submission-notification/index.js.map +1 -1
  16. package/build/form-submit-button/index.js +2 -1
  17. package/build/form-submit-button/index.js.map +1 -1
  18. package/build/image/image.js +1 -0
  19. package/build/image/image.js.map +1 -1
  20. package/build/image/view.js +0 -3
  21. package/build/image/view.js.map +1 -1
  22. package/build/navigation-link/edit.js +11 -0
  23. package/build/navigation-link/edit.js.map +1 -1
  24. package/build/post-author/edit.js +75 -18
  25. package/build/post-author/edit.js.map +1 -1
  26. package/build/post-navigation-link/edit.js +72 -33
  27. package/build/post-navigation-link/edit.js.map +1 -1
  28. package/build/site-logo/edit.js +53 -19
  29. package/build/site-logo/edit.js.map +1 -1
  30. package/build/social-link/edit.js +21 -5
  31. package/build/social-link/edit.js.map +1 -1
  32. package/build/social-link/edit.native.js +13 -5
  33. package/build/social-link/edit.native.js.map +1 -1
  34. package/build/social-link/social-list.js +17 -25
  35. package/build/social-link/social-list.js.map +1 -1
  36. package/build/social-links/edit.js +8 -5
  37. package/build/social-links/edit.js.map +1 -1
  38. package/build/video/tracks-editor.js +23 -9
  39. package/build/video/tracks-editor.js.map +1 -1
  40. package/build-module/avatar/edit.js +83 -38
  41. package/build-module/avatar/edit.js.map +1 -1
  42. package/build-module/avatar/user-control.js +33 -18
  43. package/build-module/avatar/user-control.js.map +1 -1
  44. package/build-module/embed/variations.js +0 -10
  45. package/build-module/embed/variations.js.map +1 -1
  46. package/build-module/form/edit.js +0 -1
  47. package/build-module/form/edit.js.map +1 -1
  48. package/build-module/form/index.js +3 -3
  49. package/build-module/form/index.js.map +1 -1
  50. package/build-module/form-input/index.js +2 -1
  51. package/build-module/form-input/index.js.map +1 -1
  52. package/build-module/form-submission-notification/index.js +2 -1
  53. package/build-module/form-submission-notification/index.js.map +1 -1
  54. package/build-module/form-submit-button/index.js +2 -1
  55. package/build-module/form-submit-button/index.js.map +1 -1
  56. package/build-module/image/image.js +1 -0
  57. package/build-module/image/image.js.map +1 -1
  58. package/build-module/image/view.js +0 -3
  59. package/build-module/image/view.js.map +1 -1
  60. package/build-module/navigation-link/edit.js +11 -0
  61. package/build-module/navigation-link/edit.js.map +1 -1
  62. package/build-module/post-author/edit.js +76 -19
  63. package/build-module/post-author/edit.js.map +1 -1
  64. package/build-module/post-navigation-link/edit.js +73 -34
  65. package/build-module/post-navigation-link/edit.js.map +1 -1
  66. package/build-module/site-logo/edit.js +54 -20
  67. package/build-module/site-logo/edit.js.map +1 -1
  68. package/build-module/social-link/edit.js +24 -8
  69. package/build-module/social-link/edit.js.map +1 -1
  70. package/build-module/social-link/edit.native.js +15 -6
  71. package/build-module/social-link/edit.native.js.map +1 -1
  72. package/build-module/social-link/social-list.js +16 -21
  73. package/build-module/social-link/social-list.js.map +1 -1
  74. package/build-module/social-links/edit.js +8 -5
  75. package/build-module/social-links/edit.js.map +1 -1
  76. package/build-module/video/tracks-editor.js +24 -10
  77. package/build-module/video/tracks-editor.js.map +1 -1
  78. package/build-style/calendar/style-rtl.css +7 -7
  79. package/build-style/calendar/style.css +7 -7
  80. package/build-style/comments-pagination/editor-rtl.css +0 -12
  81. package/build-style/comments-pagination/editor.css +0 -14
  82. package/build-style/comments-pagination/style-rtl.css +0 -7
  83. package/build-style/comments-pagination/style.css +0 -9
  84. package/build-style/editor-rtl.css +0 -17
  85. package/build-style/editor.css +0 -19
  86. package/build-style/navigation/style-rtl.css +4 -0
  87. package/build-style/navigation/style.css +4 -0
  88. package/build-style/style-rtl.css +11 -14
  89. package/build-style/style.css +11 -16
  90. package/package.json +35 -35
  91. package/src/avatar/edit.js +99 -51
  92. package/src/avatar/user-control.js +34 -29
  93. package/src/calendar/style.scss +10 -10
  94. package/src/comments-pagination/editor.scss +0 -15
  95. package/src/comments-pagination/style.scss +0 -8
  96. package/src/editor.scss +0 -1
  97. package/src/embed/variations.js +0 -8
  98. package/src/form/block.json +1 -2
  99. package/src/form/edit.js +0 -1
  100. package/src/form/index.js +1 -0
  101. package/src/form-input/index.js +1 -0
  102. package/src/form-submission-notification/index.js +1 -0
  103. package/src/form-submit-button/index.js +1 -0
  104. package/src/image/image.js +1 -0
  105. package/src/image/index.php +4 -1
  106. package/src/image/view.js +0 -3
  107. package/src/navigation/style.scss +8 -0
  108. package/src/navigation-link/edit.js +14 -1
  109. package/src/post-author/edit.js +91 -27
  110. package/src/post-navigation-link/edit.js +96 -51
  111. package/src/site-logo/edit.js +69 -26
  112. package/src/social-link/edit.js +18 -7
  113. package/src/social-link/edit.native.js +10 -4
  114. package/src/social-link/index.php +13 -0
  115. package/src/social-link/social-list.js +15 -20
  116. package/src/social-links/edit.js +6 -7
  117. package/src/video/tracks-editor.js +18 -6
  118. package/build-style/post-author/editor-rtl.css +0 -140
  119. package/build-style/post-author/editor.css +0 -140
  120. package/src/post-author/editor.scss +0 -7
@@ -417,26 +417,12 @@ html :where(.wp-block-column) {
417
417
  :where(.editor-styles-wrapper) .wp-block-comments-pagination {
418
418
  max-width: 100%;
419
419
  }
420
- :where(.editor-styles-wrapper) .wp-block-comments-pagination.block-editor-block-list__layout {
421
- margin: 0;
422
- }
423
420
 
424
421
  .wp-block-comments-pagination > .wp-block-comments-pagination-next,
425
422
  .wp-block-comments-pagination > .wp-block-comments-pagination-previous,
426
423
  .wp-block-comments-pagination > .wp-block-comments-pagination-numbers {
427
- margin-left: 0;
428
- margin-top: 0.5em;
429
- /*rtl:ignore*/
430
- margin-right: 0.5em;
431
- margin-bottom: 0.5em;
432
424
  font-size: inherit;
433
425
  }
434
- .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child,
435
- .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child,
436
- .wp-block-comments-pagination > .wp-block-comments-pagination-numbers:last-child {
437
- /*rtl:ignore*/
438
- margin-right: 0;
439
- }
440
426
 
441
427
  .wp-block-comments-pagination-numbers a {
442
428
  text-decoration: underline;
@@ -2171,11 +2157,6 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2171
2157
  opacity: 0;
2172
2158
  }
2173
2159
 
2174
- .wp-block-post-author__inspector-settings .components-base-control,
2175
- .wp-block-post-author__inspector-settings .components-base-control:last-child {
2176
- margin-bottom: 0;
2177
- }
2178
-
2179
2160
  .wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline {
2180
2161
  display: inline;
2181
2162
  }
@@ -344,6 +344,10 @@ button.wp-block-navigation-item__content {
344
344
  .wp-block-navigation-submenu__toggle {
345
345
  cursor: pointer;
346
346
  }
347
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] + .wp-block-navigation__submenu-icon > svg,
348
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] > svg {
349
+ transform: rotate(-180deg);
350
+ }
347
351
 
348
352
  .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle {
349
353
  padding-right: 0;
@@ -344,6 +344,10 @@ button.wp-block-navigation-item__content {
344
344
  .wp-block-navigation-submenu__toggle {
345
345
  cursor: pointer;
346
346
  }
347
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] + .wp-block-navigation__submenu-icon > svg,
348
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] > svg {
349
+ transform: rotate(180deg);
350
+ }
347
351
 
348
352
  .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle {
349
353
  padding-left: 0;
@@ -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;
@@ -2469,6 +2462,10 @@ button.wp-block-navigation-item__content {
2469
2462
  .wp-block-navigation-submenu__toggle {
2470
2463
  cursor: pointer;
2471
2464
  }
2465
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] + .wp-block-navigation__submenu-icon > svg,
2466
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] > svg {
2467
+ transform: rotate(-180deg);
2468
+ }
2472
2469
 
2473
2470
  .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle {
2474
2471
  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;
@@ -2501,6 +2492,10 @@ button.wp-block-navigation-item__content {
2501
2492
  .wp-block-navigation-submenu__toggle {
2502
2493
  cursor: pointer;
2503
2494
  }
2495
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] + .wp-block-navigation__submenu-icon > svg,
2496
+ .wp-block-navigation-submenu__toggle[aria-expanded=true] > svg {
2497
+ transform: rotate(180deg);
2498
+ }
2504
2499
 
2505
2500
  .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle {
2506
2501
  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.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.0",
45
+ "@wordpress/api-fetch": "^7.26.0",
46
+ "@wordpress/autop": "^4.26.0",
47
+ "@wordpress/blob": "^4.26.0",
48
+ "@wordpress/block-editor": "^14.21.0",
49
+ "@wordpress/blocks": "^14.15.0",
50
+ "@wordpress/components": "^29.12.0",
51
+ "@wordpress/compose": "^7.26.0",
52
+ "@wordpress/core-data": "^7.26.0",
53
+ "@wordpress/data": "^10.26.0",
54
+ "@wordpress/date": "^5.26.0",
55
+ "@wordpress/deprecated": "^4.26.0",
56
+ "@wordpress/dom": "^4.26.0",
57
+ "@wordpress/element": "^6.26.0",
58
+ "@wordpress/escape-html": "^3.26.0",
59
+ "@wordpress/hooks": "^4.26.0",
60
+ "@wordpress/html-entities": "^4.26.0",
61
+ "@wordpress/i18n": "^5.26.0",
62
+ "@wordpress/icons": "^10.26.0",
63
+ "@wordpress/interactivity": "^6.26.0",
64
+ "@wordpress/interactivity-router": "^2.26.0",
65
+ "@wordpress/keyboard-shortcuts": "^5.26.0",
66
+ "@wordpress/keycodes": "^4.26.0",
67
+ "@wordpress/notices": "^5.26.0",
68
+ "@wordpress/patterns": "^2.26.0",
69
+ "@wordpress/primitives": "^4.26.0",
70
+ "@wordpress/private-apis": "^1.26.0",
71
+ "@wordpress/reusable-blocks": "^5.26.0",
72
+ "@wordpress/rich-text": "^7.26.0",
73
+ "@wordpress/server-side-render": "^6.2.0",
74
+ "@wordpress/url": "^4.26.0",
75
+ "@wordpress/viewport": "^6.26.0",
76
+ "@wordpress/wordcount": "^4.26.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": "35e26942820d8237771af0c58e45b4303f0497f1"
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;
@@ -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;
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 } );