@wordpress/block-library 9.36.0 → 9.36.1-next.6deb34194.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 (175) hide show
  1. package/build/audio/index.js +1 -1
  2. package/build/audio/index.js.map +2 -2
  3. package/build/avatar/edit.js +13 -38
  4. package/build/avatar/edit.js.map +2 -2
  5. package/build/breadcrumbs/block.json +3 -2
  6. package/build/breadcrumbs/edit.js +18 -18
  7. package/build/breadcrumbs/edit.js.map +2 -2
  8. package/build/button/index.js +1 -1
  9. package/build/button/index.js.map +2 -2
  10. package/build/code/index.js +1 -1
  11. package/build/code/index.js.map +2 -2
  12. package/build/comments-pagination-numbers/block.json +7 -0
  13. package/build/cover/index.js +2 -2
  14. package/build/cover/index.js.map +2 -2
  15. package/build/details/index.js +1 -1
  16. package/build/details/index.js.map +2 -2
  17. package/build/file/index.js +1 -1
  18. package/build/file/index.js.map +2 -2
  19. package/build/gallery/edit.js +1 -1
  20. package/build/gallery/edit.js.map +2 -2
  21. package/build/gallery/transforms.js +7 -3
  22. package/build/gallery/transforms.js.map +2 -2
  23. package/build/heading/index.js +1 -1
  24. package/build/heading/index.js.map +2 -2
  25. package/build/html/modal.js +18 -7
  26. package/build/html/modal.js.map +2 -2
  27. package/build/image/index.js +1 -1
  28. package/build/image/index.js.map +2 -2
  29. package/build/index.js +9 -3
  30. package/build/index.js.map +2 -2
  31. package/build/list-item/index.js +1 -1
  32. package/build/list-item/index.js.map +2 -2
  33. package/build/math/edit.js +14 -2
  34. package/build/math/edit.js.map +2 -2
  35. package/build/media-text/index.js +1 -1
  36. package/build/media-text/index.js.map +2 -2
  37. package/build/more/index.js +1 -1
  38. package/build/more/index.js.map +2 -2
  39. package/build/navigation-link/index.js +1 -1
  40. package/build/navigation-link/index.js.map +2 -2
  41. package/build/navigation-submenu/index.js +1 -1
  42. package/build/navigation-submenu/index.js.map +2 -2
  43. package/build/page-list-item/edit.js +4 -3
  44. package/build/page-list-item/edit.js.map +2 -2
  45. package/build/paragraph/index.js +1 -1
  46. package/build/paragraph/index.js.map +2 -2
  47. package/build/post-title/edit.js +6 -4
  48. package/build/post-title/edit.js.map +2 -2
  49. package/build/preformatted/index.js +1 -1
  50. package/build/preformatted/index.js.map +2 -2
  51. package/build/pullquote/index.js +1 -1
  52. package/build/pullquote/index.js.map +2 -2
  53. package/build/search/index.js +1 -1
  54. package/build/search/index.js.map +2 -2
  55. package/build/social-link/index.js +1 -1
  56. package/build/social-link/index.js.map +2 -2
  57. package/build/template-part/edit/utils/get-template-part-icon.js +9 -4
  58. package/build/template-part/edit/utils/get-template-part-icon.js.map +3 -3
  59. package/build/verse/index.js +1 -1
  60. package/build/verse/index.js.map +2 -2
  61. package/build/video/index.js +1 -1
  62. package/build/video/index.js.map +2 -2
  63. package/build-module/audio/index.js +1 -1
  64. package/build-module/audio/index.js.map +2 -2
  65. package/build-module/avatar/edit.js +13 -38
  66. package/build-module/avatar/edit.js.map +2 -2
  67. package/build-module/breadcrumbs/block.json +3 -2
  68. package/build-module/breadcrumbs/edit.js +18 -18
  69. package/build-module/breadcrumbs/edit.js.map +2 -2
  70. package/build-module/button/index.js +1 -1
  71. package/build-module/button/index.js.map +2 -2
  72. package/build-module/code/index.js +1 -1
  73. package/build-module/code/index.js.map +2 -2
  74. package/build-module/comments-pagination-numbers/block.json +7 -0
  75. package/build-module/cover/index.js +2 -2
  76. package/build-module/cover/index.js.map +2 -2
  77. package/build-module/details/index.js +1 -1
  78. package/build-module/details/index.js.map +2 -2
  79. package/build-module/file/index.js +1 -1
  80. package/build-module/file/index.js.map +2 -2
  81. package/build-module/gallery/edit.js +1 -1
  82. package/build-module/gallery/edit.js.map +2 -2
  83. package/build-module/gallery/transforms.js +7 -3
  84. package/build-module/gallery/transforms.js.map +2 -2
  85. package/build-module/heading/index.js +1 -1
  86. package/build-module/heading/index.js.map +2 -2
  87. package/build-module/html/modal.js +19 -7
  88. package/build-module/html/modal.js.map +2 -2
  89. package/build-module/image/index.js +1 -1
  90. package/build-module/image/index.js.map +2 -2
  91. package/build-module/index.js +9 -3
  92. package/build-module/index.js.map +2 -2
  93. package/build-module/list-item/index.js +1 -1
  94. package/build-module/list-item/index.js.map +2 -2
  95. package/build-module/math/edit.js +15 -3
  96. package/build-module/math/edit.js.map +2 -2
  97. package/build-module/media-text/index.js +1 -1
  98. package/build-module/media-text/index.js.map +2 -2
  99. package/build-module/more/index.js +1 -1
  100. package/build-module/more/index.js.map +2 -2
  101. package/build-module/navigation-link/index.js +1 -1
  102. package/build-module/navigation-link/index.js.map +2 -2
  103. package/build-module/navigation-submenu/index.js +1 -1
  104. package/build-module/navigation-submenu/index.js.map +2 -2
  105. package/build-module/page-list-item/edit.js +4 -3
  106. package/build-module/page-list-item/edit.js.map +2 -2
  107. package/build-module/paragraph/index.js +1 -1
  108. package/build-module/paragraph/index.js.map +2 -2
  109. package/build-module/post-title/edit.js +6 -4
  110. package/build-module/post-title/edit.js.map +2 -2
  111. package/build-module/preformatted/index.js +1 -1
  112. package/build-module/preformatted/index.js.map +2 -2
  113. package/build-module/pullquote/index.js +1 -1
  114. package/build-module/pullquote/index.js.map +2 -2
  115. package/build-module/search/index.js +1 -1
  116. package/build-module/search/index.js.map +2 -2
  117. package/build-module/social-link/index.js +1 -1
  118. package/build-module/social-link/index.js.map +2 -2
  119. package/build-module/template-part/edit/utils/get-template-part-icon.js +10 -4
  120. package/build-module/template-part/edit/utils/get-template-part-icon.js.map +2 -2
  121. package/build-module/verse/index.js +1 -1
  122. package/build-module/verse/index.js.map +2 -2
  123. package/build-module/video/index.js +1 -1
  124. package/build-module/video/index.js.map +2 -2
  125. package/build-style/accordion-heading/style-rtl.css +2 -18
  126. package/build-style/accordion-heading/style.css +2 -18
  127. package/build-style/classic-rtl.css +24 -0
  128. package/build-style/classic.css +24 -0
  129. package/build-style/common-rtl.css +4 -4
  130. package/build-style/common.css +4 -0
  131. package/build-style/style-rtl.css +8 -22
  132. package/build-style/style.css +8 -18
  133. package/build-style/verse/style-rtl.css +2 -0
  134. package/build-style/verse/style.css +2 -0
  135. package/package.json +40 -38
  136. package/src/accordion-heading/style.scss +2 -30
  137. package/src/audio/index.js +1 -1
  138. package/src/avatar/edit.js +68 -83
  139. package/src/breadcrumbs/block.json +3 -2
  140. package/src/breadcrumbs/edit.js +18 -18
  141. package/src/breadcrumbs/index.php +38 -17
  142. package/src/button/index.js +1 -1
  143. package/src/classic.scss +38 -0
  144. package/src/code/index.js +1 -1
  145. package/src/comments-pagination-numbers/block.json +7 -0
  146. package/src/common.scss +4 -0
  147. package/src/cover/index.js +2 -2
  148. package/src/details/index.js +1 -1
  149. package/src/file/index.js +1 -1
  150. package/src/gallery/edit.js +4 -1
  151. package/src/gallery/transforms.js +6 -2
  152. package/src/heading/index.js +1 -1
  153. package/src/html/modal.js +39 -20
  154. package/src/image/index.js +1 -1
  155. package/src/index.js +9 -3
  156. package/src/list-item/index.js +1 -1
  157. package/src/math/edit.js +15 -3
  158. package/src/media-text/index.js +1 -1
  159. package/src/more/index.js +1 -1
  160. package/src/navigation-link/index.js +1 -1
  161. package/src/navigation-submenu/index.js +1 -1
  162. package/src/page-list/index.php +3 -4
  163. package/src/page-list-item/edit.js +4 -3
  164. package/src/paragraph/index.js +1 -1
  165. package/src/post-title/edit.js +8 -4
  166. package/src/post-title/index.php +1 -1
  167. package/src/preformatted/index.js +1 -1
  168. package/src/pullquote/index.js +1 -1
  169. package/src/search/index.js +1 -1
  170. package/src/social-link/index.js +1 -1
  171. package/src/template-part/edit/utils/get-template-part-icon.js +23 -4
  172. package/src/verse/index.js +1 -1
  173. package/src/verse/style.scss +4 -0
  174. package/src/video/index.js +1 -1
  175. package/tsconfig.tsbuildinfo +1 -1
@@ -18,10 +18,6 @@
18
18
  }
19
19
  }
20
20
 
21
- .wp-block-accordion-heading {
22
- margin: 0;
23
- }
24
-
25
21
  .wp-block-accordion-heading__toggle {
26
22
  font-family: inherit;
27
23
  font-size: inherit;
@@ -32,7 +28,9 @@
32
28
  text-decoration: inherit;
33
29
  word-spacing: inherit;
34
30
  font-style: inherit;
31
+ background: none;
35
32
  border: none;
33
+ color: inherit;
36
34
  padding: var(--wp--preset--spacing--20, 1em) 0;
37
35
  cursor: pointer;
38
36
  overflow: hidden;
@@ -40,24 +38,10 @@
40
38
  align-items: center;
41
39
  text-align: inherit;
42
40
  width: 100%;
43
- background-color: inherit !important;
44
- color: inherit !important;
45
41
  }
46
42
  .wp-block-accordion-heading__toggle:not(:focus-visible) {
47
43
  outline: none;
48
44
  }
49
- .wp-block-accordion-heading__toggle:hover, .wp-block-accordion-heading__toggle:focus {
50
- text-decoration: none;
51
- background-color: inherit !important;
52
- box-shadow: none;
53
- color: inherit;
54
- border: none;
55
- padding: var(--wp--preset--spacing--20, 1em) 0;
56
- }
57
- .wp-block-accordion-heading__toggle:focus-visible {
58
- outline: auto;
59
- outline-offset: 0;
60
- }
61
45
  .wp-block-accordion-heading__toggle:hover .wp-block-accordion-heading__toggle-title {
62
46
  text-decoration: underline;
63
47
  }
@@ -4563,6 +4547,8 @@ ul.wp-block-rss.is-grid li {
4563
4547
  pre.wp-block-verse {
4564
4548
  overflow: auto;
4565
4549
  white-space: pre-wrap;
4550
+ min-width: 1em;
4551
+ word-break: break-word;
4566
4552
  }
4567
4553
 
4568
4554
  :where(pre.wp-block-verse) {
@@ -4784,6 +4770,7 @@ html :where([style*=border-top-color]) {
4784
4770
  }
4785
4771
 
4786
4772
  html :where([style*=border-right-color]) {
4773
+ /*rtl:ignore*/
4787
4774
  border-right-style: solid;
4788
4775
  }
4789
4776
 
@@ -4792,6 +4779,7 @@ html :where([style*=border-bottom-color]) {
4792
4779
  }
4793
4780
 
4794
4781
  html :where([style*=border-left-color]) {
4782
+ /*rtl:ignore*/
4795
4783
  border-left-style: solid;
4796
4784
  }
4797
4785
 
@@ -4804,6 +4792,7 @@ html :where([style*=border-top-width]) {
4804
4792
  }
4805
4793
 
4806
4794
  html :where([style*=border-right-width]) {
4795
+ /*rtl:ignore*/
4807
4796
  border-right-style: solid;
4808
4797
  }
4809
4798
 
@@ -4812,6 +4801,7 @@ html :where([style*=border-bottom-width]) {
4812
4801
  }
4813
4802
 
4814
4803
  html :where([style*=border-left-width]) {
4804
+ /*rtl:ignore*/
4815
4805
  border-left-style: solid;
4816
4806
  }
4817
4807
 
@@ -1,6 +1,8 @@
1
1
  pre.wp-block-verse {
2
2
  overflow: auto;
3
3
  white-space: pre-wrap;
4
+ min-width: 1em;
5
+ word-break: break-word;
4
6
  }
5
7
 
6
8
  :where(pre.wp-block-verse) {
@@ -1,6 +1,8 @@
1
1
  pre.wp-block-verse {
2
2
  overflow: auto;
3
3
  white-space: pre-wrap;
4
+ min-width: 1em;
5
+ word-break: break-word;
4
6
  }
5
7
 
6
8
  :where(pre.wp-block-verse) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.36.0",
3
+ "version": "9.36.1-next.6deb34194.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -79,44 +79,46 @@
79
79
  "sideEffects": [
80
80
  "build-style/**",
81
81
  "src/**/*.scss",
82
- "{src,build,build-module}/*/init.js"
82
+ "src/*/init.js",
83
+ "build/*/init.js",
84
+ "build-module/*/init.js"
83
85
  ],
84
86
  "dependencies": {
85
- "@wordpress/a11y": "^4.36.0",
86
- "@wordpress/api-fetch": "^7.36.0",
87
- "@wordpress/autop": "^4.36.0",
88
- "@wordpress/base-styles": "^6.12.0",
89
- "@wordpress/blob": "^4.36.0",
90
- "@wordpress/block-editor": "^15.9.0",
91
- "@wordpress/blocks": "^15.9.0",
92
- "@wordpress/components": "^30.9.0",
93
- "@wordpress/compose": "^7.36.0",
94
- "@wordpress/core-data": "^7.36.0",
95
- "@wordpress/data": "^10.36.0",
96
- "@wordpress/date": "^5.36.0",
97
- "@wordpress/deprecated": "^4.36.0",
98
- "@wordpress/dom": "^4.36.0",
99
- "@wordpress/element": "^6.36.0",
100
- "@wordpress/escape-html": "^3.36.0",
101
- "@wordpress/hooks": "^4.36.0",
102
- "@wordpress/html-entities": "^4.36.0",
103
- "@wordpress/i18n": "^6.9.0",
104
- "@wordpress/icons": "^11.3.0",
105
- "@wordpress/interactivity": "^6.36.0",
106
- "@wordpress/interactivity-router": "^2.36.0",
107
- "@wordpress/keyboard-shortcuts": "^5.36.0",
108
- "@wordpress/keycodes": "^4.36.0",
109
- "@wordpress/latex-to-mathml": "^1.4.0",
110
- "@wordpress/notices": "^5.36.0",
111
- "@wordpress/patterns": "^2.36.0",
112
- "@wordpress/primitives": "^4.36.0",
113
- "@wordpress/private-apis": "^1.36.0",
114
- "@wordpress/reusable-blocks": "^5.36.0",
115
- "@wordpress/rich-text": "^7.36.0",
116
- "@wordpress/server-side-render": "^6.12.0",
117
- "@wordpress/url": "^4.36.0",
118
- "@wordpress/viewport": "^6.36.0",
119
- "@wordpress/wordcount": "^4.36.0",
87
+ "@wordpress/a11y": "^4.36.1-next.6deb34194.0",
88
+ "@wordpress/api-fetch": "^7.36.1-next.6deb34194.0",
89
+ "@wordpress/autop": "^4.36.1-next.6deb34194.0",
90
+ "@wordpress/base-styles": "^6.12.1-next.6deb34194.0",
91
+ "@wordpress/blob": "^4.36.1-next.6deb34194.0",
92
+ "@wordpress/block-editor": "^15.9.1-next.6deb34194.0",
93
+ "@wordpress/blocks": "^15.9.1-next.6deb34194.0",
94
+ "@wordpress/components": "^31.0.1-next.6deb34194.0",
95
+ "@wordpress/compose": "^7.36.1-next.6deb34194.0",
96
+ "@wordpress/core-data": "^7.36.1-next.6deb34194.0",
97
+ "@wordpress/data": "^10.36.1-next.6deb34194.0",
98
+ "@wordpress/date": "^5.36.1-next.6deb34194.0",
99
+ "@wordpress/deprecated": "^4.36.1-next.6deb34194.0",
100
+ "@wordpress/dom": "^4.36.1-next.6deb34194.0",
101
+ "@wordpress/element": "^6.36.1-next.6deb34194.0",
102
+ "@wordpress/escape-html": "^3.36.1-next.6deb34194.0",
103
+ "@wordpress/hooks": "^4.36.1-next.6deb34194.0",
104
+ "@wordpress/html-entities": "^4.36.1-next.6deb34194.0",
105
+ "@wordpress/i18n": "^6.9.1-next.6deb34194.0",
106
+ "@wordpress/icons": "^11.3.1-next.6deb34194.0",
107
+ "@wordpress/interactivity": "^6.36.1-next.6deb34194.0",
108
+ "@wordpress/interactivity-router": "^2.36.1-next.6deb34194.0",
109
+ "@wordpress/keyboard-shortcuts": "^5.36.1-next.6deb34194.0",
110
+ "@wordpress/keycodes": "^4.36.1-next.6deb34194.0",
111
+ "@wordpress/latex-to-mathml": "^1.4.1-next.6deb34194.0",
112
+ "@wordpress/notices": "^5.36.1-next.6deb34194.0",
113
+ "@wordpress/patterns": "^2.36.1-next.6deb34194.0",
114
+ "@wordpress/primitives": "^4.36.1-next.6deb34194.0",
115
+ "@wordpress/private-apis": "^1.36.1-next.6deb34194.0",
116
+ "@wordpress/reusable-blocks": "^5.36.1-next.6deb34194.0",
117
+ "@wordpress/rich-text": "^7.36.1-next.6deb34194.0",
118
+ "@wordpress/server-side-render": "^6.12.1-next.6deb34194.0",
119
+ "@wordpress/url": "^4.36.1-next.6deb34194.0",
120
+ "@wordpress/viewport": "^6.36.1-next.6deb34194.0",
121
+ "@wordpress/wordcount": "^4.36.1-next.6deb34194.0",
120
122
  "change-case": "^4.1.2",
121
123
  "clsx": "^2.1.1",
122
124
  "colord": "^2.7.0",
@@ -134,5 +136,5 @@
134
136
  "publishConfig": {
135
137
  "access": "public"
136
138
  },
137
- "gitHead": "b35cf1a2dce04665e99fd6b9c2891c0b336361b9"
139
+ "gitHead": "457096e9e9b3896d2d4fe54fc19d7fb571ee9a44"
138
140
  }
@@ -1,9 +1,3 @@
1
- .wp-block-accordion-heading {
2
- // Some classic themes apply default margins to heading elements,
3
- // so those styles need to be reset.
4
- margin: 0;
5
- }
6
-
7
1
  .wp-block-accordion-heading__toggle {
8
2
  font-family: inherit;
9
3
  font-size: inherit;
@@ -14,7 +8,9 @@
14
8
  text-decoration: inherit;
15
9
  word-spacing: inherit;
16
10
  font-style: inherit;
11
+ background: none;
17
12
  border: none;
13
+ color: inherit;
18
14
  padding: var(--wp--preset--spacing--20, 1em) 0;
19
15
  cursor: pointer;
20
16
  overflow: hidden;
@@ -23,34 +19,10 @@
23
19
  text-align: inherit;
24
20
  width: 100%;
25
21
 
26
- // Some themes may apply colors to button elements with a particularly
27
- // high CSS specificity. Since it's impossible to predict this specificity,
28
- // we reset the colors using `!important`.
29
- background-color: inherit !important;
30
- color: inherit !important;
31
-
32
22
  &:not(:focus-visible) {
33
23
  outline: none;
34
24
  }
35
25
 
36
- &:hover,
37
- &:focus {
38
- // Some themes may apply styles when a button element is hovered
39
- // over or focused. This is not intended for accordion toggle
40
- // buttons, so we reset it here.
41
- text-decoration: none;
42
- background-color: inherit !important;
43
- box-shadow: none;
44
- color: inherit;
45
- border: none;
46
- padding: var(--wp--preset--spacing--20, 1em) 0;
47
- }
48
-
49
- &:focus-visible {
50
- outline: auto;
51
- outline-offset: 0;
52
- }
53
-
54
26
  &:hover .wp-block-accordion-heading__toggle-title {
55
27
  text-decoration: underline;
56
28
  }
@@ -36,7 +36,7 @@ export const settings = {
36
36
  save,
37
37
  };
38
38
 
39
- if ( window.__experimentalContentOnlyPatternInsertion ) {
39
+ if ( window.__experimentalContentOnlyInspectorFields ) {
40
40
  settings[ fieldsKey ] = [
41
41
  {
42
42
  id: 'audio',
@@ -130,6 +130,19 @@ const AvatarInspectorControls = ( {
130
130
  );
131
131
  };
132
132
 
133
+ const AvatarLinkWrapper = ( { children, isLink } ) =>
134
+ isLink ? (
135
+ <a
136
+ href="#avatar-pseudo-link"
137
+ className="wp-block-avatar__link"
138
+ onClick={ ( event ) => event.preventDefault() }
139
+ >
140
+ { children }
141
+ </a>
142
+ ) : (
143
+ children
144
+ );
145
+
133
146
  const ResizableAvatar = ( {
134
147
  setAttributes,
135
148
  attributes,
@@ -146,43 +159,46 @@ const ResizableAvatar = ( {
146
159
  );
147
160
  return (
148
161
  <div { ...blockProps }>
149
- <ResizableBox
150
- size={ {
151
- width: attributes.size,
152
- height: attributes.size,
153
- } }
154
- showHandle={ isSelected }
155
- onResizeStop={ ( event, direction, elt, delta ) => {
156
- setAttributes( {
157
- size: parseInt(
158
- attributes.size + ( delta.height || delta.width ),
159
- 10
160
- ),
161
- } );
162
- } }
163
- lockAspectRatio
164
- enable={ {
165
- top: false,
166
- right: ! isRTL(),
167
- bottom: true,
168
- left: isRTL(),
169
- } }
170
- minWidth={ avatar.minSize }
171
- maxWidth={ avatar.maxSize }
172
- >
173
- <img
174
- src={ doubledSizedSrc }
175
- alt={ avatar.alt }
176
- className={ clsx(
177
- 'avatar',
178
- 'avatar-' + attributes.size,
179
- 'photo',
180
- 'wp-block-avatar__image',
181
- borderProps.className
182
- ) }
183
- style={ borderProps.style }
184
- />
185
- </ResizableBox>
162
+ <AvatarLinkWrapper isLink={ attributes.isLink }>
163
+ <ResizableBox
164
+ size={ {
165
+ width: attributes.size,
166
+ height: attributes.size,
167
+ } }
168
+ showHandle={ isSelected }
169
+ onResizeStop={ ( event, direction, elt, delta ) => {
170
+ setAttributes( {
171
+ size: parseInt(
172
+ attributes.size +
173
+ ( delta.height || delta.width ),
174
+ 10
175
+ ),
176
+ } );
177
+ } }
178
+ lockAspectRatio
179
+ enable={ {
180
+ top: false,
181
+ right: ! isRTL(),
182
+ bottom: true,
183
+ left: isRTL(),
184
+ } }
185
+ minWidth={ avatar.minSize }
186
+ maxWidth={ avatar.maxSize }
187
+ >
188
+ <img
189
+ src={ doubledSizedSrc }
190
+ alt={ avatar.alt }
191
+ className={ clsx(
192
+ 'avatar',
193
+ 'avatar-' + attributes.size,
194
+ 'photo',
195
+ 'wp-block-avatar__image',
196
+ borderProps.className
197
+ ) }
198
+ style={ borderProps.style }
199
+ />
200
+ </ResizableBox>
201
+ </AvatarLinkWrapper>
186
202
  </div>
187
203
  );
188
204
  };
@@ -198,29 +214,13 @@ const CommentEdit = ( { attributes, context, setAttributes, isSelected } ) => {
198
214
  attributes={ attributes }
199
215
  selectUser={ false }
200
216
  />
201
- { attributes.isLink ? (
202
- <a
203
- href="#avatar-pseudo-link"
204
- className="wp-block-avatar__link"
205
- onClick={ ( event ) => event.preventDefault() }
206
- >
207
- <ResizableAvatar
208
- attributes={ attributes }
209
- avatar={ avatar }
210
- blockProps={ blockProps }
211
- isSelected={ isSelected }
212
- setAttributes={ setAttributes }
213
- />
214
- </a>
215
- ) : (
216
- <ResizableAvatar
217
- attributes={ attributes }
218
- avatar={ avatar }
219
- blockProps={ blockProps }
220
- isSelected={ isSelected }
221
- setAttributes={ setAttributes }
222
- />
223
- ) }
217
+ <ResizableAvatar
218
+ attributes={ attributes }
219
+ avatar={ avatar }
220
+ blockProps={ blockProps }
221
+ isSelected={ isSelected }
222
+ setAttributes={ setAttributes }
223
+ />
224
224
  </>
225
225
  );
226
226
  };
@@ -241,29 +241,14 @@ const UserEdit = ( { attributes, context, setAttributes, isSelected } ) => {
241
241
  avatar={ avatar }
242
242
  setAttributes={ setAttributes }
243
243
  />
244
- { attributes.isLink ? (
245
- <a
246
- href="#avatar-pseudo-link"
247
- className="wp-block-avatar__link"
248
- onClick={ ( event ) => event.preventDefault() }
249
- >
250
- <ResizableAvatar
251
- attributes={ attributes }
252
- avatar={ avatar }
253
- blockProps={ blockProps }
254
- isSelected={ isSelected }
255
- setAttributes={ setAttributes }
256
- />
257
- </a>
258
- ) : (
259
- <ResizableAvatar
260
- attributes={ attributes }
261
- avatar={ avatar }
262
- blockProps={ blockProps }
263
- isSelected={ isSelected }
264
- setAttributes={ setAttributes }
265
- />
266
- ) }
244
+
245
+ <ResizableAvatar
246
+ attributes={ attributes }
247
+ avatar={ avatar }
248
+ blockProps={ blockProps }
249
+ isSelected={ isSelected }
250
+ setAttributes={ setAttributes }
251
+ />
267
252
  </>
268
253
  );
269
254
  };
@@ -16,11 +16,11 @@
16
16
  "type": "string",
17
17
  "default": "/"
18
18
  },
19
- "showHomeLink": {
19
+ "showHomeItem": {
20
20
  "type": "boolean",
21
21
  "default": true
22
22
  },
23
- "showLastItem": {
23
+ "showCurrentItem": {
24
24
  "type": "boolean",
25
25
  "default": true
26
26
  },
@@ -32,6 +32,7 @@
32
32
  "usesContext": [ "postId", "postType", "templateSlug" ],
33
33
  "supports": {
34
34
  "html": false,
35
+ "align": [ "wide", "full" ],
35
36
  "spacing": {
36
37
  "margin": true,
37
38
  "padding": true
@@ -30,8 +30,8 @@ export default function BreadcrumbEdit( {
30
30
  } ) {
31
31
  const {
32
32
  separator,
33
- showHomeLink,
34
- showLastItem,
33
+ showHomeItem,
34
+ showCurrentItem,
35
35
  prefersTaxonomy,
36
36
  showOnHomePage,
37
37
  } = attributes;
@@ -143,7 +143,7 @@ export default function BreadcrumbEdit( {
143
143
  ( _showTerms && ! hasTermsAssigned );
144
144
  if ( showPlaceholder ) {
145
145
  const placeholderItems = [];
146
- if ( showHomeLink ) {
146
+ if ( showHomeItem ) {
147
147
  placeholderItems.push( __( 'Home' ) );
148
148
  }
149
149
  if ( templateSlug && ! postId ) {
@@ -168,7 +168,7 @@ export default function BreadcrumbEdit( {
168
168
  </a>
169
169
  </li>
170
170
  ) ) }
171
- { showLastItem && (
171
+ { showCurrentItem && (
172
172
  <li>
173
173
  <span aria-current="page">{ __( 'Current' ) }</span>
174
174
  </li>
@@ -185,48 +185,48 @@ export default function BreadcrumbEdit( {
185
185
  resetAll={ () => {
186
186
  setAttributes( {
187
187
  separator: separatorDefaultValue,
188
- showHomeLink: true,
189
- showLastItem: true,
188
+ showHomeItem: true,
189
+ showCurrentItem: true,
190
190
  } );
191
191
  } }
192
192
  dropdownMenuProps={ dropdownMenuProps }
193
193
  >
194
194
  <ToolsPanelItem
195
- label={ __( 'Show home link' ) }
195
+ label={ __( 'Show home breadcrumb' ) }
196
196
  isShownByDefault
197
- hasValue={ () => ! showHomeLink }
197
+ hasValue={ () => ! showHomeItem }
198
198
  onDeselect={ () =>
199
199
  setAttributes( {
200
- showHomeLink: true,
200
+ showHomeItem: true,
201
201
  } )
202
202
  }
203
203
  >
204
204
  <ToggleControl
205
205
  __nextHasNoMarginBottom
206
- label={ __( 'Show home link' ) }
206
+ label={ __( 'Show home breadcrumb' ) }
207
207
  onChange={ ( value ) =>
208
- setAttributes( { showHomeLink: value } )
208
+ setAttributes( { showHomeItem: value } )
209
209
  }
210
- checked={ showHomeLink }
210
+ checked={ showHomeItem }
211
211
  />
212
212
  </ToolsPanelItem>
213
213
  <ToolsPanelItem
214
- label={ __( 'Show last item' ) }
214
+ label={ __( 'Show current breadcrumb' ) }
215
215
  isShownByDefault
216
- hasValue={ () => ! showLastItem }
216
+ hasValue={ () => ! showCurrentItem }
217
217
  onDeselect={ () =>
218
218
  setAttributes( {
219
- showLastItem: true,
219
+ showCurrentItem: true,
220
220
  } )
221
221
  }
222
222
  >
223
223
  <ToggleControl
224
224
  __nextHasNoMarginBottom
225
- label={ __( 'Show last item' ) }
225
+ label={ __( 'Show current breadcrumb' ) }
226
226
  onChange={ ( value ) =>
227
- setAttributes( { showLastItem: value } )
227
+ setAttributes( { showCurrentItem: value } )
228
228
  }
229
- checked={ showLastItem }
229
+ checked={ showCurrentItem }
230
230
  />
231
231
  </ToolsPanelItem>
232
232
  <ToolsPanelItem
@@ -17,15 +17,20 @@
17
17
  * @return string Returns the post breadcrumb for hierarchical post types.
18
18
  */
19
19
  function render_block_core_breadcrumbs( $attributes, $content, $block ) {
20
- $is_home_or_front_page = is_home() || is_front_page();
21
- if ( ! $attributes['showOnHomePage'] && $is_home_or_front_page ) {
20
+ $is_front_page = is_front_page();
21
+
22
+ if ( ! $attributes['showOnHomePage'] && $is_front_page ) {
22
23
  return '';
23
24
  }
24
25
 
26
+ $is_home = is_home();
27
+ $page_for_posts = get_option( 'page_for_posts' );
25
28
  $breadcrumb_items = array();
26
29
 
27
- if ( $attributes['showHomeLink'] ) {
28
- if ( ! $is_home_or_front_page ) {
30
+ if ( $attributes['showHomeItem'] ) {
31
+ // We make `home` a link if not on front page, or if front page
32
+ // is set to a custom page and is paged.
33
+ if ( ! $is_front_page || ( 'page' === get_option( 'show_on_front' ) && (int) get_query_var( 'page' ) > 1 ) ) {
29
34
  $breadcrumb_items[] = array(
30
35
  'label' => __( 'Home' ),
31
36
  'url' => home_url( '/' ),
@@ -35,12 +40,22 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
35
40
  }
36
41
  }
37
42
 
38
- // Handle home and front page.
39
- if ( $is_home_or_front_page ) {
40
- // This check is explicitly nested in order not to execute the `else` branch.
43
+ // Handle home.
44
+ if ( $is_home ) {
45
+ // These checks are explicitly nested in order not to execute the `else` branch.
46
+ if ( $page_for_posts ) {
47
+ $breadcrumb_items[] = block_core_breadcrumbs_create_item( block_core_breadcrumbs_get_post_title( $page_for_posts ), block_core_breadcrumbs_is_paged() );
48
+ }
41
49
  if ( block_core_breadcrumbs_is_paged() ) {
42
50
  $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item();
43
51
  }
52
+ } elseif ( $is_front_page ) {
53
+ // Handle front page.
54
+ // This check is explicitly nested in order not to execute the `else` branch.
55
+ // If front page is set to custom page and is paged, add the page number.
56
+ if ( (int) get_query_var( 'page' ) > 1 ) {
57
+ $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( 'page' );
58
+ }
44
59
  } elseif ( is_search() ) {
45
60
  // Handle search results.
46
61
  $is_paged = block_core_breadcrumbs_is_paged();
@@ -105,11 +120,8 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
105
120
  $archive_link = get_post_type_archive_link( $post_type );
106
121
  if ( $archive_link && untrailingslashit( home_url() ) !== untrailingslashit( $archive_link ) ) {
107
122
  $label = $post_type_object->labels->archives;
108
- if ( 'post' === $post_type ) {
109
- $page_for_posts = get_option( 'page_for_posts' );
110
- if ( $page_for_posts ) {
111
- $label = block_core_breadcrumbs_get_post_title( $page_for_posts );
112
- }
123
+ if ( 'post' === $post_type && $page_for_posts ) {
124
+ $label = block_core_breadcrumbs_get_post_title( $page_for_posts );
113
125
  }
114
126
  $breadcrumb_items[] = array(
115
127
  'label' => $label,
@@ -124,7 +136,7 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
124
136
  }
125
137
 
126
138
  // Add post title: linked when viewing a paginated page, plain text otherwise.
127
- $is_paged = (int) get_query_var( 'page' ) > 1;
139
+ $is_paged = (int) get_query_var( 'page' ) > 1 || (int) get_query_var( 'cpage' ) > 1;
128
140
  $title = block_core_breadcrumbs_get_post_title( $post );
129
141
 
130
142
  if ( $is_paged ) {
@@ -133,8 +145,7 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
133
145
  'url' => get_permalink( $post ),
134
146
  'allow_html' => true,
135
147
  );
136
-
137
- $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( 'page' );
148
+ $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( (int) get_query_var( 'cpage' ) > 1 ? 'cpage' : 'page' );
138
149
  } else {
139
150
  $breadcrumb_items[] = array(
140
151
  'label' => $title,
@@ -143,8 +154,8 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
143
154
  }
144
155
  }
145
156
 
146
- // Remove last item if disabled.
147
- if ( ! $attributes['showLastItem'] && ! empty( $breadcrumb_items ) ) {
157
+ // Remove current item if disabled.
158
+ if ( ! $attributes['showCurrentItem'] && ! empty( $breadcrumb_items ) ) {
148
159
  array_pop( $breadcrumb_items );
149
160
  }
150
161
 
@@ -202,6 +213,16 @@ function block_core_breadcrumbs_is_paged() {
202
213
  function block_core_breadcrumbs_create_page_number_item( $query_var = 'paged' ) {
203
214
  $paged = (int) get_query_var( $query_var );
204
215
 
216
+ if ( 'cpage' === $query_var ) {
217
+ return array(
218
+ 'label' => sprintf(
219
+ /* translators: %s: comment page number */
220
+ __( 'Comments Page %s' ),
221
+ number_format_i18n( $paged )
222
+ ),
223
+ );
224
+ }
225
+
205
226
  return array(
206
227
  'label' => sprintf(
207
228
  /* translators: %s: page number */
@@ -38,7 +38,7 @@ export const settings = {
38
38
  } ),
39
39
  };
40
40
 
41
- if ( window.__experimentalContentOnlyPatternInsertion ) {
41
+ if ( window.__experimentalContentOnlyInspectorFields ) {
42
42
  settings[ fieldsKey ] = [
43
43
  {
44
44
  id: 'text',