@wordpress/block-library 7.14.3 → 7.14.5

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 (94) hide show
  1. package/build/comment-template/edit.js +40 -32
  2. package/build/comment-template/edit.js.map +1 -1
  3. package/build/comments-title/edit.js +18 -1
  4. package/build/comments-title/edit.js.map +1 -1
  5. package/build/group/edit.js +1 -1
  6. package/build/group/edit.js.map +1 -1
  7. package/build/list/transforms.js +9 -1
  8. package/build/list/transforms.js.map +1 -1
  9. package/build/list-item/edit.js +3 -2
  10. package/build/list-item/edit.js.map +1 -1
  11. package/build/list-item/hooks/use-merge.js +5 -21
  12. package/build/list-item/hooks/use-merge.js.map +1 -1
  13. package/build/navigation/edit/index.js +12 -12
  14. package/build/navigation/edit/index.js.map +1 -1
  15. package/build/navigation/index.js +0 -1
  16. package/build/navigation/index.js.map +1 -1
  17. package/build/page-list/index.js +1 -5
  18. package/build/page-list/index.js.map +1 -1
  19. package/build/post-content/edit.js +6 -1
  20. package/build/post-content/edit.js.map +1 -1
  21. package/build/post-featured-image/index.js +1 -1
  22. package/build/post-featured-image/overlay.js +2 -2
  23. package/build/post-featured-image/overlay.js.map +1 -1
  24. package/build/query/edit/inspector-controls/index.js +1 -1
  25. package/build/query/edit/inspector-controls/index.js.map +1 -1
  26. package/build/query/utils.js +1 -1
  27. package/build/query/utils.js.map +1 -1
  28. package/build/quote/index.js +0 -1
  29. package/build/quote/index.js.map +1 -1
  30. package/build/template-part/index.js +2 -2
  31. package/build/template-part/index.js.map +1 -1
  32. package/build-module/comment-template/edit.js +38 -30
  33. package/build-module/comment-template/edit.js.map +1 -1
  34. package/build-module/comments-title/edit.js +18 -2
  35. package/build-module/comments-title/edit.js.map +1 -1
  36. package/build-module/group/edit.js +1 -1
  37. package/build-module/group/edit.js.map +1 -1
  38. package/build-module/list/transforms.js +9 -1
  39. package/build-module/list/transforms.js.map +1 -1
  40. package/build-module/list-item/edit.js +3 -2
  41. package/build-module/list-item/edit.js.map +1 -1
  42. package/build-module/list-item/hooks/use-merge.js +5 -20
  43. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  44. package/build-module/navigation/edit/index.js +12 -12
  45. package/build-module/navigation/edit/index.js.map +1 -1
  46. package/build-module/navigation/index.js +0 -1
  47. package/build-module/navigation/index.js.map +1 -1
  48. package/build-module/page-list/index.js +1 -5
  49. package/build-module/page-list/index.js.map +1 -1
  50. package/build-module/post-content/edit.js +6 -1
  51. package/build-module/post-content/edit.js.map +1 -1
  52. package/build-module/post-featured-image/index.js +1 -1
  53. package/build-module/post-featured-image/overlay.js +2 -2
  54. package/build-module/post-featured-image/overlay.js.map +1 -1
  55. package/build-module/query/edit/inspector-controls/index.js +1 -1
  56. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  57. package/build-module/query/utils.js +1 -1
  58. package/build-module/query/utils.js.map +1 -1
  59. package/build-module/quote/index.js +0 -1
  60. package/build-module/quote/index.js.map +1 -1
  61. package/build-module/template-part/index.js +2 -2
  62. package/build-module/template-part/index.js.map +1 -1
  63. package/build-style/code/style-rtl.css +3 -0
  64. package/build-style/code/style.css +3 -0
  65. package/build-style/editor-rtl.css +39 -29
  66. package/build-style/editor.css +39 -29
  67. package/build-style/post-featured-image/editor-rtl.css +39 -29
  68. package/build-style/post-featured-image/editor.css +39 -29
  69. package/build-style/style-rtl.css +3 -0
  70. package/build-style/style.css +3 -0
  71. package/package.json +12 -12
  72. package/src/code/style.scss +12 -7
  73. package/src/comment-author-name/index.php +1 -1
  74. package/src/comment-template/edit.js +47 -34
  75. package/src/comments-title/edit.js +24 -1
  76. package/src/group/edit.js +1 -1
  77. package/src/list/transforms.js +11 -0
  78. package/src/list-item/edit.js +2 -1
  79. package/src/list-item/hooks/use-merge.js +4 -23
  80. package/src/navigation/block.json +0 -1
  81. package/src/navigation/edit/index.js +12 -10
  82. package/src/navigation/index.php +0 -3
  83. package/src/page-list/block.json +1 -5
  84. package/src/page-list/index.php +0 -5
  85. package/src/post-content/edit.js +3 -1
  86. package/src/post-featured-image/block.json +1 -1
  87. package/src/post-featured-image/editor.scss +79 -72
  88. package/src/post-featured-image/index.php +18 -24
  89. package/src/post-featured-image/overlay.js +17 -14
  90. package/src/query/edit/inspector-controls/index.js +1 -4
  91. package/src/query/utils.js +1 -1
  92. package/src/quote/block.json +0 -1
  93. package/src/template-part/index.js +2 -2
  94. package/src/template-part/index.php +4 -0
@@ -79,19 +79,19 @@
79
79
  -webkit-backdrop-filter: none;
80
80
  backdrop-filter: none;
81
81
  }
82
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
83
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder {
82
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
83
+ .wp-block-post-featured-image .components-placeholder {
84
84
  justify-content: center;
85
85
  align-items: center;
86
86
  padding: 0;
87
87
  min-height: 200px;
88
88
  }
89
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
90
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-form-file-upload {
89
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
90
+ .wp-block-post-featured-image .components-placeholder .components-form-file-upload {
91
91
  display: none;
92
92
  }
93
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button.components-button,
94
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-button.components-button {
93
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button,
94
+ .wp-block-post-featured-image .components-placeholder .components-button {
95
95
  padding: 0;
96
96
  display: flex;
97
97
  justify-content: center;
@@ -105,51 +105,61 @@
105
105
  border-style: solid;
106
106
  color: #fff;
107
107
  }
108
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button.components-button > svg,
109
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-button.components-button > svg {
108
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button > svg,
109
+ .wp-block-post-featured-image .components-placeholder .components-button > svg {
110
110
  color: inherit;
111
111
  }
112
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
113
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where(.has-border-color) {
112
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
113
+ .wp-block-post-featured-image .components-placeholder:where(.has-border-color),
114
+ .wp-block-post-featured-image img:where(.has-border-color) {
114
115
  border-style: solid;
115
116
  }
116
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
117
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]) {
117
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
118
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]),
119
+ .wp-block-post-featured-image img:where([style*="border-top-color"]) {
118
120
  border-top-style: solid;
119
121
  }
120
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
121
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]) {
122
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
123
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]),
124
+ .wp-block-post-featured-image img:where([style*="border-right-color"]) {
122
125
  border-left-style: solid;
123
126
  }
124
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
125
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]) {
127
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
128
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]),
129
+ .wp-block-post-featured-image img:where([style*="border-bottom-color"]) {
126
130
  border-bottom-style: solid;
127
131
  }
128
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
129
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]) {
132
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
133
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]),
134
+ .wp-block-post-featured-image img:where([style*="border-left-color"]) {
130
135
  border-right-style: solid;
131
136
  }
132
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
133
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-width"]) {
137
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
138
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-width"]),
139
+ .wp-block-post-featured-image img:where([style*="border-width"]) {
134
140
  border-style: solid;
135
141
  }
136
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
137
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]) {
142
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
143
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]),
144
+ .wp-block-post-featured-image img:where([style*="border-top-width"]) {
138
145
  border-top-style: solid;
139
146
  }
140
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
141
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]) {
147
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
148
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]),
149
+ .wp-block-post-featured-image img:where([style*="border-right-width"]) {
142
150
  border-left-style: solid;
143
151
  }
144
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
145
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]) {
152
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
153
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]),
154
+ .wp-block-post-featured-image img:where([style*="border-bottom-width"]) {
146
155
  border-bottom-style: solid;
147
156
  }
148
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
149
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]) {
157
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
158
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]),
159
+ .wp-block-post-featured-image img:where([style*="border-left-width"]) {
150
160
  border-right-style: solid;
151
161
  }
152
- .wp-block-post-featured-image.wp-block-post-featured-image[style*=height] .components-placeholder {
162
+ .wp-block-post-featured-image[style*=height] .components-placeholder {
153
163
  min-height: 48px;
154
164
  min-width: 48px;
155
165
  height: 100%;
@@ -79,19 +79,19 @@
79
79
  -webkit-backdrop-filter: none;
80
80
  backdrop-filter: none;
81
81
  }
82
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
83
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder {
82
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
83
+ .wp-block-post-featured-image .components-placeholder {
84
84
  justify-content: center;
85
85
  align-items: center;
86
86
  padding: 0;
87
87
  min-height: 200px;
88
88
  }
89
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
90
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-form-file-upload {
89
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
90
+ .wp-block-post-featured-image .components-placeholder .components-form-file-upload {
91
91
  display: none;
92
92
  }
93
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button.components-button,
94
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-button.components-button {
93
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button,
94
+ .wp-block-post-featured-image .components-placeholder .components-button {
95
95
  padding: 0;
96
96
  display: flex;
97
97
  justify-content: center;
@@ -105,51 +105,61 @@
105
105
  border-style: solid;
106
106
  color: #fff;
107
107
  }
108
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button.components-button > svg,
109
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-button.components-button > svg {
108
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button > svg,
109
+ .wp-block-post-featured-image .components-placeholder .components-button > svg {
110
110
  color: inherit;
111
111
  }
112
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
113
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where(.has-border-color) {
112
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
113
+ .wp-block-post-featured-image .components-placeholder:where(.has-border-color),
114
+ .wp-block-post-featured-image img:where(.has-border-color) {
114
115
  border-style: solid;
115
116
  }
116
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
117
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]) {
117
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
118
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]),
119
+ .wp-block-post-featured-image img:where([style*="border-top-color"]) {
118
120
  border-top-style: solid;
119
121
  }
120
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
121
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]) {
122
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
123
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]),
124
+ .wp-block-post-featured-image img:where([style*="border-right-color"]) {
122
125
  border-right-style: solid;
123
126
  }
124
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
125
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]) {
127
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
128
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]),
129
+ .wp-block-post-featured-image img:where([style*="border-bottom-color"]) {
126
130
  border-bottom-style: solid;
127
131
  }
128
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
129
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]) {
132
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
133
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]),
134
+ .wp-block-post-featured-image img:where([style*="border-left-color"]) {
130
135
  border-left-style: solid;
131
136
  }
132
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
133
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-width"]) {
137
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
138
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-width"]),
139
+ .wp-block-post-featured-image img:where([style*="border-width"]) {
134
140
  border-style: solid;
135
141
  }
136
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
137
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]) {
142
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
143
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]),
144
+ .wp-block-post-featured-image img:where([style*="border-top-width"]) {
138
145
  border-top-style: solid;
139
146
  }
140
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
141
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]) {
147
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
148
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]),
149
+ .wp-block-post-featured-image img:where([style*="border-right-width"]) {
142
150
  border-right-style: solid;
143
151
  }
144
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
145
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]) {
152
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
153
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]),
154
+ .wp-block-post-featured-image img:where([style*="border-bottom-width"]) {
146
155
  border-bottom-style: solid;
147
156
  }
148
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
149
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]) {
157
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
158
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]),
159
+ .wp-block-post-featured-image img:where([style*="border-left-width"]) {
150
160
  border-left-style: solid;
151
161
  }
152
- .wp-block-post-featured-image.wp-block-post-featured-image[style*=height] .components-placeholder {
162
+ .wp-block-post-featured-image[style*=height] .components-placeholder {
153
163
  min-height: 48px;
154
164
  min-width: 48px;
155
165
  height: 100%;
@@ -277,6 +277,9 @@
277
277
  margin-left: 2em;
278
278
  }
279
279
 
280
+ .wp-block-code {
281
+ box-sizing: border-box;
282
+ }
280
283
  .wp-block-code code {
281
284
  display: block;
282
285
  font-family: inherit;
@@ -280,6 +280,9 @@
280
280
  margin-left: 2em;
281
281
  }
282
282
 
283
+ .wp-block-code {
284
+ box-sizing: border-box;
285
+ }
283
286
  .wp-block-code code {
284
287
  display: block;
285
288
  font-family: inherit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.14.3",
3
+ "version": "7.14.5",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -35,12 +35,12 @@
35
35
  "@wordpress/api-fetch": "^6.14.1",
36
36
  "@wordpress/autop": "^3.17.1",
37
37
  "@wordpress/blob": "^3.17.1",
38
- "@wordpress/block-editor": "^10.0.3",
39
- "@wordpress/blocks": "^11.16.3",
40
- "@wordpress/components": "^21.0.3",
38
+ "@wordpress/block-editor": "^10.0.5",
39
+ "@wordpress/blocks": "^11.16.4",
40
+ "@wordpress/components": "^21.0.4",
41
41
  "@wordpress/compose": "^5.15.2",
42
- "@wordpress/core-data": "^5.0.3",
43
- "@wordpress/data": "^7.1.2",
42
+ "@wordpress/core-data": "^5.0.4",
43
+ "@wordpress/data": "^7.1.3",
44
44
  "@wordpress/date": "^4.17.1",
45
45
  "@wordpress/deprecated": "^3.17.1",
46
46
  "@wordpress/dom": "^3.17.2",
@@ -50,13 +50,13 @@
50
50
  "@wordpress/i18n": "^4.17.1",
51
51
  "@wordpress/icons": "^9.8.1",
52
52
  "@wordpress/keycodes": "^3.17.1",
53
- "@wordpress/notices": "^3.17.2",
53
+ "@wordpress/notices": "^3.17.3",
54
54
  "@wordpress/primitives": "^3.15.1",
55
- "@wordpress/reusable-blocks": "^3.15.3",
56
- "@wordpress/rich-text": "^5.15.2",
57
- "@wordpress/server-side-render": "^3.15.3",
55
+ "@wordpress/reusable-blocks": "^3.15.5",
56
+ "@wordpress/rich-text": "^5.15.3",
57
+ "@wordpress/server-side-render": "^3.15.4",
58
58
  "@wordpress/url": "^3.18.1",
59
- "@wordpress/viewport": "^4.15.2",
59
+ "@wordpress/viewport": "^4.15.3",
60
60
  "change-case": "^4.1.2",
61
61
  "classnames": "^2.3.1",
62
62
  "colord": "^2.7.0",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "54a676dba557a76062d3bf91bfe8a3e3ea12d254"
76
+ "gitHead": "06334a7bd943f2345f15b8d2f427721d6878e6c1"
77
77
  }
@@ -1,8 +1,13 @@
1
- // Provide a minimum of overflow handling and ensure the code markup inherits
2
- // the font-family set on pre.
3
- .wp-block-code code {
4
- display: block;
5
- font-family: inherit;
6
- overflow-wrap: break-word;
7
- white-space: pre-wrap;
1
+ .wp-block-code {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+
5
+ // Provide a minimum of overflow handling and ensure the code markup inherits
6
+ // the font-family set on pre.
7
+ code {
8
+ display: block;
9
+ font-family: inherit;
10
+ overflow-wrap: break-word;
11
+ white-space: pre-wrap;
12
+ }
8
13
  }
@@ -34,7 +34,7 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
34
34
  $comment_author = get_comment_author( $comment );
35
35
  $link = get_comment_author_url( $comment );
36
36
 
37
- if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
37
+ if ( ! empty( $link ) && ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
38
38
  $comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
39
39
  }
40
40
  if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
@@ -37,6 +37,7 @@ const TEMPLATE = [
37
37
  *
38
38
  * @param {Object} settings Discussion Settings.
39
39
  * @param {number} [settings.perPage] - Comments per page setting or block attribute.
40
+ * @param {boolean} [settings.pageComments] - Enable break comments into pages setting.
40
41
  * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
41
42
  * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
42
43
  *
@@ -45,42 +46,53 @@ const TEMPLATE = [
45
46
  */
46
47
  const getCommentsPlaceholder = ( {
47
48
  perPage,
49
+ pageComments,
48
50
  threadComments,
49
51
  threadCommentsDepth,
50
52
  } ) => {
51
- // In case that `threadCommentsDepth` is falsy, we default to a somewhat
52
- // arbitrary value of 3.
53
- // In case that the value is set but larger than 3 we truncate it to 3.
54
- const commentsDepth = Math.min( threadCommentsDepth || 3, 3 );
53
+ // Limit commentsDepth to 3
54
+ const commentsDepth = ! threadComments
55
+ ? 1
56
+ : Math.min( threadCommentsDepth, 3 );
55
57
 
56
- // We set a limit in order not to overload the editor of empty comments.
57
- const defaultCommentsToShow =
58
- perPage <= commentsDepth ? perPage : commentsDepth;
59
- if ( ! threadComments || defaultCommentsToShow === 1 ) {
60
- // If displaying threaded comments is disabled, we only show one comment
61
- // A commentId is negative in order to avoid conflicts with the actual comments.
62
- return [ { commentId: -1, children: [] } ];
63
- } else if ( defaultCommentsToShow === 2 ) {
64
- return [
65
- {
66
- commentId: -1,
67
- children: [ { commentId: -2, children: [] } ],
68
- },
69
- ];
70
- }
58
+ const buildChildrenComment = ( commentsLevel ) => {
59
+ // Render children comments until commentsDepth is reached
60
+ if ( commentsLevel < commentsDepth ) {
61
+ const nextLevel = commentsLevel + 1;
71
62
 
72
- // In case that the value is set but larger than 3 we truncate it to 3.
73
- return [
74
- {
75
- commentId: -1,
76
- children: [
63
+ return [
77
64
  {
78
- commentId: -2,
79
- children: [ { commentId: -3, children: [] } ],
65
+ commentId: -( commentsLevel + 3 ),
66
+ children: buildChildrenComment( nextLevel ),
80
67
  },
81
- ],
82
- },
68
+ ];
69
+ }
70
+ return [];
71
+ };
72
+
73
+ // Add the first comment and its children
74
+ const placeholderComments = [
75
+ { commentId: -1, children: buildChildrenComment( 1 ) },
83
76
  ];
77
+
78
+ // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max
79
+ if ( ( ! pageComments || perPage >= 2 ) && commentsDepth < 3 ) {
80
+ placeholderComments.push( {
81
+ commentId: -2,
82
+ children: [],
83
+ } );
84
+ }
85
+
86
+ // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments
87
+ if ( ( ! pageComments || perPage >= 3 ) && commentsDepth < 2 ) {
88
+ placeholderComments.push( {
89
+ commentId: -3,
90
+ children: [],
91
+ } );
92
+ }
93
+
94
+ // In case that the value is set but larger than 3 we truncate it to 3.
95
+ return placeholderComments;
84
96
  };
85
97
 
86
98
  /**
@@ -114,12 +126,11 @@ function CommentTemplateInnerBlocks( {
114
126
  : null }
115
127
 
116
128
  { /* To avoid flicker when switching active block contexts, a preview
117
- is ALWAYS rendered and the preview for the active block is hidden.
118
- This ensures that when switching the active block, the component is not
119
- mounted again but rather it only toggles the `isHidden` prop.
120
-
121
- The same strategy is used for preventing the flicker in the Post Template
122
- block. */ }
129
+ is ALWAYS rendered and the preview for the active block is hidden.
130
+ This ensures that when switching the active block, the component is not
131
+ mounted again but rather it only toggles the `isHidden` prop.
132
+ The same strategy is used for preventing the flicker in the Post Template
133
+ block. */ }
123
134
  <MemoizedCommentTemplatePreview
124
135
  blocks={ blocks }
125
136
  commentId={ comment.commentId }
@@ -239,6 +250,7 @@ export default function CommentTemplateEdit( {
239
250
  threadCommentsDepth,
240
251
  threadComments,
241
252
  commentsPerPage,
253
+ pageComments,
242
254
  } = useSelect( ( select ) => {
243
255
  const { getSettings } = select( blockEditorStore );
244
256
  return getSettings().__experimentalDiscussionSettings;
@@ -282,6 +294,7 @@ export default function CommentTemplateEdit( {
282
294
  if ( ! postId ) {
283
295
  commentTree = getCommentsPlaceholder( {
284
296
  perPage: commentsPerPage,
297
+ pageComments,
285
298
  threadComments,
286
299
  threadCommentsDepth,
287
300
  } );
@@ -11,11 +11,13 @@ import {
11
11
  BlockControls,
12
12
  useBlockProps,
13
13
  InspectorControls,
14
+ store as blockEditorStore,
14
15
  } from '@wordpress/block-editor';
15
16
  import { __, _n, sprintf } from '@wordpress/i18n';
16
17
  import { useEntityProp } from '@wordpress/core-data';
17
18
  import { PanelBody, ToggleControl } from '@wordpress/components';
18
19
  import { useState, useEffect } from '@wordpress/element';
20
+ import { useSelect } from '@wordpress/data';
19
21
  import apiFetch from '@wordpress/api-fetch';
20
22
  import { addQueryArgs } from '@wordpress/url';
21
23
 
@@ -39,9 +41,30 @@ export default function Edit( {
39
41
  } ),
40
42
  } );
41
43
 
44
+ const {
45
+ threadCommentsDepth,
46
+ threadComments,
47
+ commentsPerPage,
48
+ pageComments,
49
+ } = useSelect( ( select ) => {
50
+ const { getSettings } = select( blockEditorStore );
51
+ return getSettings().__experimentalDiscussionSettings;
52
+ } );
53
+
42
54
  useEffect( () => {
43
55
  if ( isSiteEditor ) {
44
- setCommentsCount( 3 );
56
+ // Match the number of comments that will be shown in the comment-template/edit.js placeholder
57
+
58
+ const nestedCommentsNumber = threadComments
59
+ ? Math.min( threadCommentsDepth, 3 ) - 1
60
+ : 0;
61
+ const topLevelCommentsNumber = pageComments ? commentsPerPage : 3;
62
+
63
+ const commentsNumber =
64
+ parseInt( nestedCommentsNumber ) +
65
+ parseInt( topLevelCommentsNumber );
66
+
67
+ setCommentsCount( Math.min( commentsNumber, 3 ) );
45
68
  return;
46
69
  }
47
70
  const currentPostId = postId;
package/src/group/edit.js CHANGED
@@ -53,7 +53,7 @@ function GroupEdit( { attributes, setAttributes, clientId } ) {
53
53
  ? { ...defaultLayout, ...layout, type: 'default' }
54
54
  : { ...defaultLayout, ...layout };
55
55
  const { type = 'default' } = usedLayout;
56
- const layoutSupportEnabled = themeSupportsLayout || type !== 'default';
56
+ const layoutSupportEnabled = themeSupportsLayout || type === 'flex';
57
57
 
58
58
  const blockProps = useBlockProps();
59
59
 
@@ -114,6 +114,17 @@ const transforms = {
114
114
  );
115
115
  },
116
116
  } ) ),
117
+ {
118
+ type: 'block',
119
+ blocks: [ '*' ],
120
+ transform: ( _attributes, childBlocks ) => {
121
+ return getListContentFlat( childBlocks ).map( ( content ) =>
122
+ createBlock( 'core/paragraph', {
123
+ content,
124
+ } )
125
+ );
126
+ },
127
+ },
117
128
  ],
118
129
  };
119
130
 
@@ -60,6 +60,7 @@ export default function ListItemEdit( {
60
60
  setAttributes,
61
61
  onReplace,
62
62
  clientId,
63
+ mergeBlocks,
63
64
  } ) {
64
65
  const { placeholder, content } = attributes;
65
66
  const blockProps = useBlockProps( { ref: useCopy( clientId ) } );
@@ -69,7 +70,7 @@ export default function ListItemEdit( {
69
70
  const useEnterRef = useEnter( { content, clientId } );
70
71
  const useSpaceRef = useSpace( clientId );
71
72
  const onSplit = useSplit( clientId );
72
- const onMerge = useMerge( clientId );
73
+ const onMerge = useMerge( clientId, mergeBlocks );
73
74
  return (
74
75
  <>
75
76
  <li { ...innerBlocksProps }>
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import { useRegistry, useDispatch, useSelect } from '@wordpress/data';
5
5
  import { store as blockEditorStore } from '@wordpress/block-editor';
6
- import { getDefaultBlockName, switchToBlockType } from '@wordpress/blocks';
7
6
 
8
7
  /**
9
8
  * Internal dependencies
@@ -12,7 +11,7 @@ import useOutdentListItem from './use-outdent-list-item';
12
11
 
13
12
  import { name as listItemName } from '../block.json';
14
13
 
15
- export default function useMerge( clientId ) {
14
+ export default function useMerge( clientId, onMerge ) {
16
15
  const registry = useRegistry();
17
16
  const {
18
17
  getPreviousBlockClientId,
@@ -20,9 +19,8 @@ export default function useMerge( clientId ) {
20
19
  getBlockOrder,
21
20
  getBlockRootClientId,
22
21
  getBlockName,
23
- getBlock,
24
22
  } = useSelect( blockEditorStore );
25
- const { mergeBlocks, moveBlocksToPosition, replaceBlock, selectBlock } =
23
+ const { mergeBlocks, moveBlocksToPosition } =
26
24
  useDispatch( blockEditorStore );
27
25
  const [ , outdentListItem ] = useOutdentListItem( clientId );
28
26
 
@@ -79,29 +77,12 @@ export default function useMerge( clientId ) {
79
77
  return getBlockOrder( order[ 0 ] )[ 0 ];
80
78
  }
81
79
 
82
- function switchToDefaultBlockType( forward ) {
83
- const rootClientId = getBlockRootClientId( clientId );
84
- const replacement = switchToBlockType(
85
- getBlock( rootClientId ),
86
- getDefaultBlockName()
87
- );
88
- const indexToSelect = forward ? replacement.length - 1 : 0;
89
- const initialPosition = forward ? -1 : 0;
90
- registry.batch( () => {
91
- replaceBlock( rootClientId, replacement );
92
- selectBlock(
93
- replacement[ indexToSelect ].clientId,
94
- initialPosition
95
- );
96
- } );
97
- }
98
-
99
80
  return ( forward ) => {
100
81
  if ( forward ) {
101
82
  const nextBlockClientId = getNextId( clientId );
102
83
 
103
84
  if ( ! nextBlockClientId ) {
104
- switchToDefaultBlockType( forward );
85
+ onMerge( forward );
105
86
  return;
106
87
  }
107
88
 
@@ -134,7 +115,7 @@ export default function useMerge( clientId ) {
134
115
  mergeBlocks( trailingId, clientId );
135
116
  } );
136
117
  } else {
137
- switchToDefaultBlockType( forward );
118
+ onMerge( forward );
138
119
  }
139
120
  }
140
121
  };
@@ -88,7 +88,6 @@
88
88
  },
89
89
  "supports": {
90
90
  "align": [ "wide", "full" ],
91
- "anchor": true,
92
91
  "html": false,
93
92
  "inserter": true,
94
93
  "typography": {