@wordpress/block-library 9.40.1 → 9.40.2-next.v.202602241322.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 (138) hide show
  1. package/build/icon/block.json +9 -1
  2. package/build/icon/components/custom-inserter/icon-grid.cjs +1 -1
  3. package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
  4. package/build/icon/components/custom-inserter/index.cjs +1 -1
  5. package/build/icon/components/custom-inserter/index.cjs.map +2 -2
  6. package/build/icon/edit.cjs +15 -7
  7. package/build/icon/edit.cjs.map +2 -2
  8. package/build/image/edit.cjs +1 -1
  9. package/build/image/edit.cjs.map +2 -2
  10. package/build/navigation-overlay-close/edit.cjs +2 -3
  11. package/build/navigation-overlay-close/edit.cjs.map +2 -2
  12. package/build/post-navigation-link/block.json +1 -3
  13. package/build/post-navigation-link/deprecated.cjs +100 -0
  14. package/build/post-navigation-link/deprecated.cjs.map +7 -0
  15. package/build/post-navigation-link/edit.cjs +2 -36
  16. package/build/post-navigation-link/edit.cjs.map +3 -3
  17. package/build/post-navigation-link/index.cjs +2 -0
  18. package/build/post-navigation-link/index.cjs.map +3 -3
  19. package/build/post-title/block.json +1 -3
  20. package/build/post-title/deprecated.cjs +82 -1
  21. package/build/post-title/deprecated.cjs.map +3 -3
  22. package/build/post-title/edit.cjs +10 -36
  23. package/build/post-title/edit.cjs.map +3 -3
  24. package/build/pullquote/deprecated.cjs +6 -6
  25. package/build/pullquote/deprecated.cjs.map +2 -2
  26. package/build/query/block.json +1 -2
  27. package/build/query-title/block.json +1 -3
  28. package/build/query-title/deprecated.cjs +70 -1
  29. package/build/query-title/deprecated.cjs.map +3 -3
  30. package/build/query-title/edit.cjs +17 -35
  31. package/build/query-title/edit.cjs.map +3 -3
  32. package/build/site-tagline/block.json +6 -4
  33. package/build/site-tagline/deprecated.cjs +66 -1
  34. package/build/site-tagline/deprecated.cjs.map +3 -3
  35. package/build/site-tagline/edit.cjs +14 -28
  36. package/build/site-tagline/edit.cjs.map +3 -3
  37. package/build/site-title/block.json +1 -3
  38. package/build/site-title/deprecated.cjs +79 -1
  39. package/build/site-title/deprecated.cjs.map +3 -3
  40. package/build/site-title/edit.cjs +14 -30
  41. package/build/site-title/edit.cjs.map +3 -3
  42. package/build/tabs-menu-item/block.json +1 -26
  43. package/build/tabs-menu-item/controls.cjs +2 -100
  44. package/build/tabs-menu-item/controls.cjs.map +3 -3
  45. package/build/tabs-menu-item/edit.cjs +6 -65
  46. package/build/tabs-menu-item/edit.cjs.map +2 -2
  47. package/build/tabs-menu-item/save.cjs +1 -15
  48. package/build/tabs-menu-item/save.cjs.map +2 -2
  49. package/build-module/icon/block.json +9 -1
  50. package/build-module/icon/components/custom-inserter/icon-grid.mjs +1 -1
  51. package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
  52. package/build-module/icon/components/custom-inserter/index.mjs +1 -1
  53. package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
  54. package/build-module/icon/edit.mjs +15 -7
  55. package/build-module/icon/edit.mjs.map +2 -2
  56. package/build-module/image/edit.mjs +1 -1
  57. package/build-module/image/edit.mjs.map +2 -2
  58. package/build-module/navigation-overlay-close/edit.mjs +2 -3
  59. package/build-module/navigation-overlay-close/edit.mjs.map +2 -2
  60. package/build-module/post-navigation-link/block.json +1 -3
  61. package/build-module/post-navigation-link/deprecated.mjs +69 -0
  62. package/build-module/post-navigation-link/deprecated.mjs.map +7 -0
  63. package/build-module/post-navigation-link/edit.mjs +3 -30
  64. package/build-module/post-navigation-link/edit.mjs.map +2 -2
  65. package/build-module/post-navigation-link/index.mjs +2 -0
  66. package/build-module/post-navigation-link/index.mjs.map +2 -2
  67. package/build-module/post-title/block.json +1 -3
  68. package/build-module/post-title/deprecated.mjs +82 -1
  69. package/build-module/post-title/deprecated.mjs.map +2 -2
  70. package/build-module/post-title/edit.mjs +10 -27
  71. package/build-module/post-title/edit.mjs.map +2 -2
  72. package/build-module/pullquote/deprecated.mjs +6 -6
  73. package/build-module/pullquote/deprecated.mjs.map +2 -2
  74. package/build-module/query/block.json +1 -2
  75. package/build-module/query-title/block.json +1 -3
  76. package/build-module/query-title/deprecated.mjs +70 -1
  77. package/build-module/query-title/deprecated.mjs.map +2 -2
  78. package/build-module/query-title/edit.mjs +17 -36
  79. package/build-module/query-title/edit.mjs.map +2 -2
  80. package/build-module/site-tagline/block.json +6 -4
  81. package/build-module/site-tagline/deprecated.mjs +66 -1
  82. package/build-module/site-tagline/deprecated.mjs.map +2 -2
  83. package/build-module/site-tagline/edit.mjs +14 -29
  84. package/build-module/site-tagline/edit.mjs.map +2 -2
  85. package/build-module/site-title/block.json +1 -3
  86. package/build-module/site-title/deprecated.mjs +79 -1
  87. package/build-module/site-title/deprecated.mjs.map +2 -2
  88. package/build-module/site-title/edit.mjs +14 -31
  89. package/build-module/site-title/edit.mjs.map +2 -2
  90. package/build-module/tabs-menu-item/block.json +1 -26
  91. package/build-module/tabs-menu-item/controls.mjs +3 -104
  92. package/build-module/tabs-menu-item/controls.mjs.map +2 -2
  93. package/build-module/tabs-menu-item/edit.mjs +6 -66
  94. package/build-module/tabs-menu-item/edit.mjs.map +2 -2
  95. package/build-module/tabs-menu-item/save.mjs +1 -15
  96. package/build-module/tabs-menu-item/save.mjs.map +2 -2
  97. package/build-style/editor-rtl.css +0 -5
  98. package/build-style/editor.css +0 -5
  99. package/build-style/style-rtl.css +3 -12
  100. package/build-style/style.css +3 -12
  101. package/build-style/tabs-menu-item/editor-rtl.css +0 -5
  102. package/build-style/tabs-menu-item/editor.css +0 -5
  103. package/build-style/tabs-menu-item/style-rtl.css +3 -12
  104. package/build-style/tabs-menu-item/style.css +3 -12
  105. package/package.json +38 -38
  106. package/src/icon/block.json +9 -1
  107. package/src/icon/components/custom-inserter/icon-grid.js +1 -1
  108. package/src/icon/components/custom-inserter/index.js +1 -1
  109. package/src/icon/edit.js +20 -10
  110. package/src/icon/index.php +1 -3
  111. package/src/image/edit.js +1 -1
  112. package/src/image/index.php +1 -4
  113. package/src/navigation-overlay-close/edit.js +4 -3
  114. package/src/post-featured-image/index.php +2 -4
  115. package/src/post-navigation-link/block.json +1 -3
  116. package/src/post-navigation-link/deprecated.js +72 -0
  117. package/src/post-navigation-link/edit.js +2 -35
  118. package/src/post-navigation-link/index.js +2 -0
  119. package/src/post-title/block.json +1 -3
  120. package/src/post-title/deprecated.js +86 -1
  121. package/src/post-title/edit.js +2 -18
  122. package/src/pullquote/deprecated.js +3 -3
  123. package/src/query/block.json +1 -2
  124. package/src/query-title/block.json +1 -3
  125. package/src/query-title/deprecated.js +74 -1
  126. package/src/query-title/edit.js +11 -27
  127. package/src/site-tagline/block.json +6 -4
  128. package/src/site-tagline/deprecated.js +70 -1
  129. package/src/site-tagline/edit.js +9 -22
  130. package/src/site-title/block.json +1 -3
  131. package/src/site-title/deprecated.js +83 -1
  132. package/src/site-title/edit.js +9 -22
  133. package/src/tabs-menu-item/block.json +1 -26
  134. package/src/tabs-menu-item/controls.js +0 -108
  135. package/src/tabs-menu-item/edit.js +6 -79
  136. package/src/tabs-menu-item/editor.scss +0 -6
  137. package/src/tabs-menu-item/save.js +1 -26
  138. package/src/tabs-menu-item/style.scss +3 -14
@@ -9,7 +9,6 @@ import clsx from 'clsx';
9
9
  import { __, sprintf } from '@wordpress/i18n';
10
10
  import {
11
11
  useBlockProps,
12
- withColors,
13
12
  store as blockEditorStore,
14
13
  RichText,
15
14
  } from '@wordpress/block-editor';
@@ -22,19 +21,9 @@ import { useCallback, useMemo } from '@wordpress/element';
22
21
  import slugFromLabel from '../tab/slug-from-label';
23
22
  import Controls from './controls';
24
23
 
25
- function Edit( {
26
- attributes,
27
- setAttributes,
24
+ export default function Edit( {
28
25
  context,
29
26
  clientId,
30
- activeBackgroundColor,
31
- setActiveBackgroundColor,
32
- activeTextColor,
33
- setActiveTextColor,
34
- hoverBackgroundColor,
35
- setHoverBackgroundColor,
36
- hoverTextColor,
37
- setHoverTextColor,
38
27
  __unstableLayoutClassNames: layoutClassNames,
39
28
  } ) {
40
29
  // Context from tabs-menu (per-item context via BlockContextProvider)
@@ -138,47 +127,6 @@ function Edit( {
138
127
  ]
139
128
  );
140
129
 
141
- // Build CSS custom properties for active/hover color states
142
- const customColorStyles = useMemo( () => {
143
- const styles = {};
144
-
145
- // Active/hover colors from custom attributes
146
- const activeBg =
147
- activeBackgroundColor?.color ||
148
- attributes.customActiveBackgroundColor;
149
- const activeText =
150
- activeTextColor?.color || attributes.customActiveTextColor;
151
- const hoverBg =
152
- hoverBackgroundColor?.color ||
153
- attributes.customHoverBackgroundColor;
154
- const hoverText =
155
- hoverTextColor?.color || attributes.customHoverTextColor;
156
-
157
- if ( activeBg ) {
158
- styles[ '--custom-tab-active-color' ] = activeBg;
159
- }
160
- if ( activeText ) {
161
- styles[ '--custom-tab-active-text-color' ] = activeText;
162
- }
163
- if ( hoverBg ) {
164
- styles[ '--custom-tab-hover-color' ] = hoverBg;
165
- }
166
- if ( hoverText ) {
167
- styles[ '--custom-tab-hover-text-color' ] = hoverText;
168
- }
169
-
170
- return styles;
171
- }, [
172
- activeBackgroundColor?.color,
173
- attributes.customActiveBackgroundColor,
174
- activeTextColor?.color,
175
- attributes.customActiveTextColor,
176
- hoverBackgroundColor?.color,
177
- attributes.customHoverBackgroundColor,
178
- hoverTextColor?.color,
179
- attributes.customHoverTextColor,
180
- ] );
181
-
182
130
  const tabPanelId = tabId || `tab-${ tabIndex }`;
183
131
  const tabLabelId = `${ tabPanelId }--tab`;
184
132
 
@@ -188,7 +136,6 @@ function Edit( {
188
136
  'is-active': isActiveTab,
189
137
  'is-selected': isSelectedTab,
190
138
  } ),
191
- style: customColorStyles,
192
139
  'aria-controls': tabPanelId,
193
140
  'aria-selected': isActiveTab,
194
141
  id: tabLabelId,
@@ -200,24 +147,11 @@ function Edit( {
200
147
  return (
201
148
  <>
202
149
  <Controls
203
- { ...{
204
- attributes,
205
- setAttributes,
206
- clientId,
207
- tabsClientId,
208
- tabClientId,
209
- tabIndex,
210
- tabsCount: tabsList.length,
211
- tabsMenuClientId,
212
- activeBackgroundColor,
213
- setActiveBackgroundColor,
214
- activeTextColor,
215
- setActiveTextColor,
216
- hoverBackgroundColor,
217
- setHoverBackgroundColor,
218
- hoverTextColor,
219
- setHoverTextColor,
220
- } }
150
+ tabsClientId={ tabsClientId }
151
+ tabClientId={ tabClientId }
152
+ tabIndex={ tabIndex }
153
+ tabsCount={ tabsList.length }
154
+ tabsMenuClientId={ tabsMenuClientId }
221
155
  />
222
156
  <div { ...blockProps }>
223
157
  <RichText
@@ -235,10 +169,3 @@ function Edit( {
235
169
  </>
236
170
  );
237
171
  }
238
-
239
- export default withColors(
240
- 'activeBackgroundColor',
241
- 'activeTextColor',
242
- 'hoverBackgroundColor',
243
- 'hoverTextColor'
244
- )( Edit );
@@ -1,6 +1,5 @@
1
1
  .wp-block-tabs-menu-item {
2
2
  &.is-selected {
3
- outline: 2px solid var(--wp-admin-theme-color, #007cba);
4
3
  outline-offset: 2px;
5
4
  }
6
5
  }
@@ -12,9 +11,4 @@
12
11
  .wp-block-tabs-menu-item {
13
12
  flex-basis: 100% !important;
14
13
  }
15
-
16
- &:hover > .wp-block-tabs-menu-item {
17
- background-color: var(--custom-tab-hover-color, #eaeaea) !important;
18
- color: var(--custom-tab-hover-text-color, #000) !important;
19
- }
20
14
  }
@@ -3,34 +3,9 @@
3
3
  */
4
4
  import { useBlockProps } from '@wordpress/block-editor';
5
5
 
6
- export default function save( { attributes } ) {
7
- // Build CSS custom properties for active/hover colors
8
- const customColorStyles = {};
9
-
10
- // Active/hover colors from custom attributes
11
- if ( attributes.customActiveBackgroundColor ) {
12
- customColorStyles[ '--custom-tab-active-color' ] =
13
- attributes.customActiveBackgroundColor;
14
- }
15
- if ( attributes.customActiveTextColor ) {
16
- customColorStyles[ '--custom-tab-active-text-color' ] =
17
- attributes.customActiveTextColor;
18
- }
19
- if ( attributes.customHoverBackgroundColor ) {
20
- customColorStyles[ '--custom-tab-hover-color' ] =
21
- attributes.customHoverBackgroundColor;
22
- }
23
- if ( attributes.customHoverTextColor ) {
24
- customColorStyles[ '--custom-tab-hover-text-color' ] =
25
- attributes.customHoverTextColor;
26
- }
27
-
28
- // useBlockProps.save includes all core style engine classes and styles
29
- // The button content is replaced by PHP during rendering, so we output
30
- // an empty button as a template.
6
+ export default function save() {
31
7
  const blockProps = useBlockProps.save( {
32
8
  className: 'wp-block-tabs-menu-item__template',
33
- style: customColorStyles,
34
9
  type: 'button',
35
10
  role: 'tab',
36
11
  } );
@@ -15,8 +15,7 @@
15
15
  -webkit-appearance: none;
16
16
 
17
17
  margin: 0;
18
- padding-block: var(--tab-padding-block, var(--wp--preset--spacing--20, 0.5em));
19
- padding-inline: var(--tab-padding-inline, var(--wp--preset--spacing--30, 1em));
18
+ padding: var(--wp--preset--spacing--20, 0.5em) var(--wp--preset--spacing--30, 1em);
20
19
 
21
20
  // Inherit typography from parent
22
21
  font-size: inherit;
@@ -27,23 +26,13 @@
27
26
  text-transform: inherit;
28
27
  text-align: inherit;
29
28
 
30
- &:focus {
31
- outline: none;
32
- }
33
-
34
29
  &:focus-visible {
35
- outline: 2px solid var(--tab-border-color-active, #000);
36
30
  outline-offset: 2px;
37
31
  }
38
32
 
39
- &:hover {
40
- background-color: var(--custom-tab-hover-color, #eaeaea) !important;
41
- color: var(--custom-tab-hover-text-color, #000) !important;
42
- }
43
-
44
33
  &[aria-selected="true"],
45
34
  &.is-active {
46
- background-color: var(--custom-tab-active-color, #000) !important;
47
- color: var(--custom-tab-active-text-color, #fff) !important;
35
+ background-color: #000;
36
+ color: #fff;
48
37
  }
49
38
  }