@wordpress/block-library 9.0.5 → 9.0.7

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.
@@ -132,10 +132,7 @@
132
132
  .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active {
133
133
  text-decoration: line-through;
134
134
  }
135
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a {
136
- text-decoration: none;
137
- }
138
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:focus, .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:active {
135
+ .wp-block-navigation :where(a), .wp-block-navigation :where(a:focus), .wp-block-navigation :where(a:active) {
139
136
  text-decoration: none;
140
137
  }
141
138
  .wp-block-navigation .wp-block-navigation__submenu-icon {
@@ -132,10 +132,7 @@
132
132
  .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active {
133
133
  text-decoration: line-through;
134
134
  }
135
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a {
136
- text-decoration: none;
137
- }
138
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:focus, .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:active {
135
+ .wp-block-navigation :where(a), .wp-block-navigation :where(a:focus), .wp-block-navigation :where(a:active) {
139
136
  text-decoration: none;
140
137
  }
141
138
  .wp-block-navigation .wp-block-navigation__submenu-icon {
@@ -86,6 +86,17 @@
86
86
  /**
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
+ :where(.wp-block-post-comments-form) textarea,
90
+ :where(.wp-block-post-comments-form) input:not([type=submit]) {
91
+ border: 1px solid #949494;
92
+ font-size: 1em;
93
+ font-family: inherit;
94
+ }
95
+ :where(.wp-block-post-comments-form) textarea,
96
+ :where(.wp-block-post-comments-form) input:where(:not([type="submit"]):not([type="checkbox"])) {
97
+ padding: calc(0.667em + 2px);
98
+ }
99
+
89
100
  .wp-block-post-comments-form {
90
101
  box-sizing: border-box;
91
102
  }
@@ -114,16 +125,6 @@
114
125
  text-align: center;
115
126
  overflow-wrap: break-word;
116
127
  }
117
- .wp-block-post-comments-form textarea,
118
- .wp-block-post-comments-form input:not([type=submit]) {
119
- border: 1px solid #949494;
120
- font-size: 1em;
121
- font-family: inherit;
122
- }
123
- .wp-block-post-comments-form textarea,
124
- .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
125
- padding: calc(0.667em + 2px);
126
- }
127
128
  .wp-block-post-comments-form .comment-form textarea,
128
129
  .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]) {
129
130
  display: block;
@@ -86,6 +86,17 @@
86
86
  /**
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
+ :where(.wp-block-post-comments-form) textarea,
90
+ :where(.wp-block-post-comments-form) input:not([type=submit]) {
91
+ border: 1px solid #949494;
92
+ font-size: 1em;
93
+ font-family: inherit;
94
+ }
95
+ :where(.wp-block-post-comments-form) textarea,
96
+ :where(.wp-block-post-comments-form) input:where(:not([type="submit"]):not([type="checkbox"])) {
97
+ padding: calc(0.667em + 2px);
98
+ }
99
+
89
100
  .wp-block-post-comments-form {
90
101
  box-sizing: border-box;
91
102
  }
@@ -114,16 +125,6 @@
114
125
  text-align: center;
115
126
  overflow-wrap: break-word;
116
127
  }
117
- .wp-block-post-comments-form textarea,
118
- .wp-block-post-comments-form input:not([type=submit]) {
119
- border: 1px solid #949494;
120
- font-size: 1em;
121
- font-family: inherit;
122
- }
123
- .wp-block-post-comments-form textarea,
124
- .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
125
- padding: calc(0.667em + 2px);
126
- }
127
128
  .wp-block-post-comments-form .comment-form textarea,
128
129
  .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]) {
129
130
  display: block;
@@ -2123,10 +2123,7 @@ ul {
2123
2123
  .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active {
2124
2124
  text-decoration: line-through;
2125
2125
  }
2126
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a {
2127
- text-decoration: none;
2128
- }
2129
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:focus, .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:active {
2126
+ .wp-block-navigation :where(a), .wp-block-navigation :where(a:focus), .wp-block-navigation :where(a:active) {
2130
2127
  text-decoration: none;
2131
2128
  }
2132
2129
  .wp-block-navigation .wp-block-navigation__submenu-icon {
@@ -2712,6 +2709,17 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2712
2709
  margin: 0;
2713
2710
  }
2714
2711
 
2712
+ :where(.wp-block-post-comments-form) textarea,
2713
+ :where(.wp-block-post-comments-form) input:not([type=submit]) {
2714
+ border: 1px solid #949494;
2715
+ font-size: 1em;
2716
+ font-family: inherit;
2717
+ }
2718
+ :where(.wp-block-post-comments-form) textarea,
2719
+ :where(.wp-block-post-comments-form) input:where(:not([type="submit"]):not([type="checkbox"])) {
2720
+ padding: calc(0.667em + 2px);
2721
+ }
2722
+
2715
2723
  .wp-block-post-comments-form {
2716
2724
  box-sizing: border-box;
2717
2725
  }
@@ -2740,16 +2748,6 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2740
2748
  text-align: center;
2741
2749
  overflow-wrap: break-word;
2742
2750
  }
2743
- .wp-block-post-comments-form textarea,
2744
- .wp-block-post-comments-form input:not([type=submit]) {
2745
- border: 1px solid #949494;
2746
- font-size: 1em;
2747
- font-family: inherit;
2748
- }
2749
- .wp-block-post-comments-form textarea,
2750
- .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
2751
- padding: calc(0.667em + 2px);
2752
- }
2753
2751
  .wp-block-post-comments-form .comment-form textarea,
2754
2752
  .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]) {
2755
2753
  display: block;
@@ -2153,10 +2153,7 @@ ul {
2153
2153
  .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active {
2154
2154
  text-decoration: line-through;
2155
2155
  }
2156
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a {
2157
- text-decoration: none;
2158
- }
2159
- .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:focus, .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:active {
2156
+ .wp-block-navigation :where(a), .wp-block-navigation :where(a:focus), .wp-block-navigation :where(a:active) {
2160
2157
  text-decoration: none;
2161
2158
  }
2162
2159
  .wp-block-navigation .wp-block-navigation__submenu-icon {
@@ -2742,6 +2739,17 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2742
2739
  margin: 0;
2743
2740
  }
2744
2741
 
2742
+ :where(.wp-block-post-comments-form) textarea,
2743
+ :where(.wp-block-post-comments-form) input:not([type=submit]) {
2744
+ border: 1px solid #949494;
2745
+ font-size: 1em;
2746
+ font-family: inherit;
2747
+ }
2748
+ :where(.wp-block-post-comments-form) textarea,
2749
+ :where(.wp-block-post-comments-form) input:where(:not([type="submit"]):not([type="checkbox"])) {
2750
+ padding: calc(0.667em + 2px);
2751
+ }
2752
+
2745
2753
  .wp-block-post-comments-form {
2746
2754
  box-sizing: border-box;
2747
2755
  }
@@ -2770,16 +2778,6 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2770
2778
  text-align: center;
2771
2779
  overflow-wrap: break-word;
2772
2780
  }
2773
- .wp-block-post-comments-form textarea,
2774
- .wp-block-post-comments-form input:not([type=submit]) {
2775
- border: 1px solid #949494;
2776
- font-size: 1em;
2777
- font-family: inherit;
2778
- }
2779
- .wp-block-post-comments-form textarea,
2780
- .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
2781
- padding: calc(0.667em + 2px);
2782
- }
2783
2781
  .wp-block-post-comments-form .comment-form textarea,
2784
2782
  .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]) {
2785
2783
  display: block;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.0.5",
3
+ "version": "9.0.7",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -36,11 +36,11 @@
36
36
  "@wordpress/api-fetch": "^7.0.1",
37
37
  "@wordpress/autop": "^4.0.1",
38
38
  "@wordpress/blob": "^4.0.1",
39
- "@wordpress/block-editor": "^13.0.4",
39
+ "@wordpress/block-editor": "^13.0.6",
40
40
  "@wordpress/blocks": "^13.0.3",
41
41
  "@wordpress/components": "^28.0.3",
42
42
  "@wordpress/compose": "^7.0.1",
43
- "@wordpress/core-data": "^7.0.4",
43
+ "@wordpress/core-data": "^7.0.6",
44
44
  "@wordpress/data": "^10.0.2",
45
45
  "@wordpress/date": "^5.0.1",
46
46
  "@wordpress/deprecated": "^4.0.1",
@@ -56,10 +56,10 @@
56
56
  "@wordpress/keyboard-shortcuts": "^5.0.2",
57
57
  "@wordpress/keycodes": "^4.0.1",
58
58
  "@wordpress/notices": "^5.0.2",
59
- "@wordpress/patterns": "^2.0.4",
59
+ "@wordpress/patterns": "^2.0.6",
60
60
  "@wordpress/primitives": "^4.0.1",
61
61
  "@wordpress/private-apis": "^1.0.2",
62
- "@wordpress/reusable-blocks": "^5.0.4",
62
+ "@wordpress/reusable-blocks": "^5.0.6",
63
63
  "@wordpress/rich-text": "^7.0.2",
64
64
  "@wordpress/server-side-render": "^5.0.3",
65
65
  "@wordpress/url": "^4.0.1",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "85486692a3e48b7d863226cf895a21d787434921"
85
+ "gitHead": "5c1d6bb774e6f78f0bbd4cdc85c4a7087da2f8a0"
86
86
  }
@@ -28,12 +28,33 @@ function render_block_core_image( $attributes, $content, $block ) {
28
28
  return '';
29
29
  }
30
30
 
31
+ $has_id_binding = isset( $attributes['metadata']['bindings']['id'] ) && isset( $attributes['id'] );
32
+
33
+ // Ensure the `wp-image-id` classname on the image block supports block bindings.
34
+ if ( $has_id_binding ) {
35
+ // If there's a mismatch with the 'wp-image-' class and the actual id, the id was
36
+ // probably overridden by block bindings. Update it to the correct value.
37
+ // See https://github.com/WordPress/gutenberg/issues/62886 for why this is needed.
38
+ $id = $attributes['id'];
39
+ $image_classnames = $p->get_attribute( 'class' );
40
+ $class_with_binding_value = "wp-image-$id";
41
+ if ( is_string( $image_classnames ) && ! str_contains( $image_classnames, $class_with_binding_value ) ) {
42
+ $image_classnames = preg_replace( '/wp-image-(\d+)/', $class_with_binding_value, $image_classnames );
43
+ $p->set_attribute( 'class', $image_classnames );
44
+ }
45
+ }
46
+
47
+ // For backwards compatibility, the data-id html attribute is only set for
48
+ // image blocks nested in a gallery. Detect if the image is in a gallery by
49
+ // checking the data-id attribute.
50
+ // See the `block_core_gallery_data_id_backcompatibility` function.
31
51
  if ( isset( $attributes['data-id'] ) ) {
32
- // Adds the data-id="$id" attribute to the img element to provide backwards
33
- // compatibility for the Gallery Block, which now wraps Image Blocks within
34
- // innerBlocks. The data-id attribute is added in a core/gallery
35
- // `render_block_data` hook.
36
- $p->set_attribute( 'data-id', $attributes['data-id'] );
52
+ // If there's a binding for the `id`, the `id` attribute is used for the
53
+ // value, since `data-id` does not support block bindings.
54
+ // Else the `data-id` is used for backwards compatibility, since
55
+ // third parties may be filtering its value.
56
+ $data_id = $has_id_binding ? $attributes['id'] : $attributes['data-id'];
57
+ $p->set_attribute( 'data-id', $data_id );
37
58
  }
38
59
 
39
60
  $link_destination = isset( $attributes['linkDestination'] ) ? $attributes['linkDestination'] : 'none';
@@ -76,15 +76,10 @@ $navigation-icon-size: 24px;
76
76
  }
77
77
  }
78
78
 
79
- &:where(:not([class*="has-text-decoration"])) {
80
- a {
81
- text-decoration: none;
82
-
83
- &:focus,
84
- &:active {
85
- text-decoration: none;
86
- }
87
- }
79
+ & :where(a),
80
+ & :where(a:focus),
81
+ & :where(a:active) {
82
+ text-decoration: none;
88
83
  }
89
84
 
90
85
  // Submenu indicator.
@@ -1,3 +1,18 @@
1
+ // Allow these default styles to be overridden by global styles.
2
+ :where(.wp-block-post-comments-form) {
3
+ textarea,
4
+ input:not([type="submit"]) {
5
+ border: 1px solid $gray-600;
6
+ font-size: 1em;
7
+ font-family: inherit;
8
+ }
9
+
10
+ textarea,
11
+ input:where(:not([type="submit"]):not([type="checkbox"])) {
12
+ padding: calc(0.667em + 2px); // The extra 2px is added to match outline buttons.
13
+ }
14
+ }
15
+
1
16
  .wp-block-post-comments-form {
2
17
  // This block has customizable padding, border-box makes that more predictable.
3
18
  box-sizing: border-box;
@@ -31,18 +46,6 @@
31
46
  overflow-wrap: break-word;
32
47
  }
33
48
 
34
- textarea,
35
- input:not([type="submit"]) {
36
- border: 1px solid $gray-600;
37
- font-size: 1em;
38
- font-family: inherit;
39
- }
40
-
41
- textarea,
42
- input:not([type="submit"]):not([type="checkbox"]) {
43
- padding: calc(0.667em + 2px); // The extra 2px is added to match outline buttons.
44
- }
45
-
46
49
  .comment-form {
47
50
  textarea,
48
51
  // Make sure to not set display block on hidden input fields, to prevent