@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.
- package/build/icon/block.json +9 -1
- package/build/icon/components/custom-inserter/icon-grid.cjs +1 -1
- package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
- package/build/icon/components/custom-inserter/index.cjs +1 -1
- package/build/icon/components/custom-inserter/index.cjs.map +2 -2
- package/build/icon/edit.cjs +15 -7
- package/build/icon/edit.cjs.map +2 -2
- package/build/image/edit.cjs +1 -1
- package/build/image/edit.cjs.map +2 -2
- package/build/navigation-overlay-close/edit.cjs +2 -3
- package/build/navigation-overlay-close/edit.cjs.map +2 -2
- package/build/post-navigation-link/block.json +1 -3
- package/build/post-navigation-link/deprecated.cjs +100 -0
- package/build/post-navigation-link/deprecated.cjs.map +7 -0
- package/build/post-navigation-link/edit.cjs +2 -36
- package/build/post-navigation-link/edit.cjs.map +3 -3
- package/build/post-navigation-link/index.cjs +2 -0
- package/build/post-navigation-link/index.cjs.map +3 -3
- package/build/post-title/block.json +1 -3
- package/build/post-title/deprecated.cjs +82 -1
- package/build/post-title/deprecated.cjs.map +3 -3
- package/build/post-title/edit.cjs +10 -36
- package/build/post-title/edit.cjs.map +3 -3
- package/build/pullquote/deprecated.cjs +6 -6
- package/build/pullquote/deprecated.cjs.map +2 -2
- package/build/query/block.json +1 -2
- package/build/query-title/block.json +1 -3
- package/build/query-title/deprecated.cjs +70 -1
- package/build/query-title/deprecated.cjs.map +3 -3
- package/build/query-title/edit.cjs +17 -35
- package/build/query-title/edit.cjs.map +3 -3
- package/build/site-tagline/block.json +6 -4
- package/build/site-tagline/deprecated.cjs +66 -1
- package/build/site-tagline/deprecated.cjs.map +3 -3
- package/build/site-tagline/edit.cjs +14 -28
- package/build/site-tagline/edit.cjs.map +3 -3
- package/build/site-title/block.json +1 -3
- package/build/site-title/deprecated.cjs +79 -1
- package/build/site-title/deprecated.cjs.map +3 -3
- package/build/site-title/edit.cjs +14 -30
- package/build/site-title/edit.cjs.map +3 -3
- package/build/tabs-menu-item/block.json +1 -26
- package/build/tabs-menu-item/controls.cjs +2 -100
- package/build/tabs-menu-item/controls.cjs.map +3 -3
- package/build/tabs-menu-item/edit.cjs +6 -65
- package/build/tabs-menu-item/edit.cjs.map +2 -2
- package/build/tabs-menu-item/save.cjs +1 -15
- package/build/tabs-menu-item/save.cjs.map +2 -2
- package/build-module/icon/block.json +9 -1
- package/build-module/icon/components/custom-inserter/icon-grid.mjs +1 -1
- package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/index.mjs +1 -1
- package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
- package/build-module/icon/edit.mjs +15 -7
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/image/edit.mjs +1 -1
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/navigation-overlay-close/edit.mjs +2 -3
- package/build-module/navigation-overlay-close/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/block.json +1 -3
- package/build-module/post-navigation-link/deprecated.mjs +69 -0
- package/build-module/post-navigation-link/deprecated.mjs.map +7 -0
- package/build-module/post-navigation-link/edit.mjs +3 -30
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/index.mjs +2 -0
- package/build-module/post-navigation-link/index.mjs.map +2 -2
- package/build-module/post-title/block.json +1 -3
- package/build-module/post-title/deprecated.mjs +82 -1
- package/build-module/post-title/deprecated.mjs.map +2 -2
- package/build-module/post-title/edit.mjs +10 -27
- package/build-module/post-title/edit.mjs.map +2 -2
- package/build-module/pullquote/deprecated.mjs +6 -6
- package/build-module/pullquote/deprecated.mjs.map +2 -2
- package/build-module/query/block.json +1 -2
- package/build-module/query-title/block.json +1 -3
- package/build-module/query-title/deprecated.mjs +70 -1
- package/build-module/query-title/deprecated.mjs.map +2 -2
- package/build-module/query-title/edit.mjs +17 -36
- package/build-module/query-title/edit.mjs.map +2 -2
- package/build-module/site-tagline/block.json +6 -4
- package/build-module/site-tagline/deprecated.mjs +66 -1
- package/build-module/site-tagline/deprecated.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +14 -29
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/block.json +1 -3
- package/build-module/site-title/deprecated.mjs +79 -1
- package/build-module/site-title/deprecated.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +14 -31
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/tabs-menu-item/block.json +1 -26
- package/build-module/tabs-menu-item/controls.mjs +3 -104
- package/build-module/tabs-menu-item/controls.mjs.map +2 -2
- package/build-module/tabs-menu-item/edit.mjs +6 -66
- package/build-module/tabs-menu-item/edit.mjs.map +2 -2
- package/build-module/tabs-menu-item/save.mjs +1 -15
- package/build-module/tabs-menu-item/save.mjs.map +2 -2
- package/build-style/editor-rtl.css +0 -5
- package/build-style/editor.css +0 -5
- package/build-style/style-rtl.css +3 -12
- package/build-style/style.css +3 -12
- package/build-style/tabs-menu-item/editor-rtl.css +0 -5
- package/build-style/tabs-menu-item/editor.css +0 -5
- package/build-style/tabs-menu-item/style-rtl.css +3 -12
- package/build-style/tabs-menu-item/style.css +3 -12
- package/package.json +38 -38
- package/src/icon/block.json +9 -1
- package/src/icon/components/custom-inserter/icon-grid.js +1 -1
- package/src/icon/components/custom-inserter/index.js +1 -1
- package/src/icon/edit.js +20 -10
- package/src/icon/index.php +1 -3
- package/src/image/edit.js +1 -1
- package/src/image/index.php +1 -4
- package/src/navigation-overlay-close/edit.js +4 -3
- package/src/post-featured-image/index.php +2 -4
- package/src/post-navigation-link/block.json +1 -3
- package/src/post-navigation-link/deprecated.js +72 -0
- package/src/post-navigation-link/edit.js +2 -35
- package/src/post-navigation-link/index.js +2 -0
- package/src/post-title/block.json +1 -3
- package/src/post-title/deprecated.js +86 -1
- package/src/post-title/edit.js +2 -18
- package/src/pullquote/deprecated.js +3 -3
- package/src/query/block.json +1 -2
- package/src/query-title/block.json +1 -3
- package/src/query-title/deprecated.js +74 -1
- package/src/query-title/edit.js +11 -27
- package/src/site-tagline/block.json +6 -4
- package/src/site-tagline/deprecated.js +70 -1
- package/src/site-tagline/edit.js +9 -22
- package/src/site-title/block.json +1 -3
- package/src/site-title/deprecated.js +83 -1
- package/src/site-title/edit.js +9 -22
- package/src/tabs-menu-item/block.json +1 -26
- package/src/tabs-menu-item/controls.js +0 -108
- package/src/tabs-menu-item/edit.js +6 -79
- package/src/tabs-menu-item/editor.scss +0 -6
- package/src/tabs-menu-item/save.js +1 -26
- package/src/tabs-menu-item/style.scss +3 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.40.
|
|
3
|
+
"version": "9.40.2-next.v.202602241322.0+bce7cff88",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -94,42 +94,42 @@
|
|
|
94
94
|
"build-module/*/init.mjs"
|
|
95
95
|
],
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@wordpress/a11y": "^4.40.0",
|
|
98
|
-
"@wordpress/api-fetch": "^7.40.0",
|
|
99
|
-
"@wordpress/autop": "^4.40.0",
|
|
100
|
-
"@wordpress/base-styles": "^6.16.0",
|
|
101
|
-
"@wordpress/blob": "^4.40.0",
|
|
102
|
-
"@wordpress/block-editor": "^15.13.
|
|
103
|
-
"@wordpress/blocks": "^15.13.0",
|
|
104
|
-
"@wordpress/components": "^32.
|
|
105
|
-
"@wordpress/compose": "^7.40.0",
|
|
106
|
-
"@wordpress/core-data": "^7.40.
|
|
107
|
-
"@wordpress/data": "^10.40.0",
|
|
108
|
-
"@wordpress/date": "^5.40.0",
|
|
109
|
-
"@wordpress/deprecated": "^4.40.0",
|
|
110
|
-
"@wordpress/dom": "^4.40.0",
|
|
111
|
-
"@wordpress/element": "^6.40.0",
|
|
112
|
-
"@wordpress/escape-html": "^3.40.0",
|
|
113
|
-
"@wordpress/hooks": "^4.40.0",
|
|
114
|
-
"@wordpress/html-entities": "^4.40.0",
|
|
115
|
-
"@wordpress/i18n": "^6.13.0",
|
|
116
|
-
"@wordpress/icons": "^11.7.0",
|
|
117
|
-
"@wordpress/interactivity": "^6.40.0",
|
|
118
|
-
"@wordpress/interactivity-router": "^2.40.0",
|
|
119
|
-
"@wordpress/keyboard-shortcuts": "^5.40.0",
|
|
120
|
-
"@wordpress/keycodes": "^4.40.0",
|
|
121
|
-
"@wordpress/latex-to-mathml": "^1.8.0",
|
|
122
|
-
"@wordpress/notices": "^5.40.0",
|
|
123
|
-
"@wordpress/patterns": "^2.40.
|
|
124
|
-
"@wordpress/primitives": "^4.40.0",
|
|
125
|
-
"@wordpress/private-apis": "^1.40.0",
|
|
126
|
-
"@wordpress/reusable-blocks": "^5.40.
|
|
127
|
-
"@wordpress/rich-text": "^7.40.0",
|
|
128
|
-
"@wordpress/server-side-render": "^6.16.0",
|
|
129
|
-
"@wordpress/upload-media": "^0.25.
|
|
130
|
-
"@wordpress/url": "^4.40.0",
|
|
131
|
-
"@wordpress/viewport": "^6.40.0",
|
|
132
|
-
"@wordpress/wordcount": "^4.40.0",
|
|
97
|
+
"@wordpress/a11y": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
98
|
+
"@wordpress/api-fetch": "^7.40.1-next.v.202602241322.0+bce7cff88",
|
|
99
|
+
"@wordpress/autop": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
100
|
+
"@wordpress/base-styles": "^6.16.1-next.v.202602241322.0+bce7cff88",
|
|
101
|
+
"@wordpress/blob": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
102
|
+
"@wordpress/block-editor": "^15.13.2-next.v.202602241322.0+bce7cff88",
|
|
103
|
+
"@wordpress/blocks": "^15.13.1-next.v.202602241322.0+bce7cff88",
|
|
104
|
+
"@wordpress/components": "^32.3.1-next.v.202602241322.0+bce7cff88",
|
|
105
|
+
"@wordpress/compose": "^7.40.1-next.v.202602241322.0+bce7cff88",
|
|
106
|
+
"@wordpress/core-data": "^7.40.2-next.v.202602241322.0+bce7cff88",
|
|
107
|
+
"@wordpress/data": "^10.40.1-next.v.202602241322.0+bce7cff88",
|
|
108
|
+
"@wordpress/date": "^5.40.1-next.v.202602241322.0+bce7cff88",
|
|
109
|
+
"@wordpress/deprecated": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
110
|
+
"@wordpress/dom": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
111
|
+
"@wordpress/element": "^6.40.1-next.v.202602241322.0+bce7cff88",
|
|
112
|
+
"@wordpress/escape-html": "^3.40.1-next.v.202602241322.0+bce7cff88",
|
|
113
|
+
"@wordpress/hooks": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
114
|
+
"@wordpress/html-entities": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
115
|
+
"@wordpress/i18n": "^6.13.1-next.v.202602241322.0+bce7cff88",
|
|
116
|
+
"@wordpress/icons": "^11.7.1-next.v.202602241322.0+bce7cff88",
|
|
117
|
+
"@wordpress/interactivity": "^6.40.1-next.v.202602241322.0+bce7cff88",
|
|
118
|
+
"@wordpress/interactivity-router": "^2.40.1-next.v.202602241322.0+bce7cff88",
|
|
119
|
+
"@wordpress/keyboard-shortcuts": "^5.40.1-next.v.202602241322.0+bce7cff88",
|
|
120
|
+
"@wordpress/keycodes": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
121
|
+
"@wordpress/latex-to-mathml": "^1.8.1-next.v.202602241322.0+bce7cff88",
|
|
122
|
+
"@wordpress/notices": "^5.40.1-next.v.202602241322.0+bce7cff88",
|
|
123
|
+
"@wordpress/patterns": "^2.40.2-next.v.202602241322.0+bce7cff88",
|
|
124
|
+
"@wordpress/primitives": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
125
|
+
"@wordpress/private-apis": "^1.40.1-next.v.202602241322.0+bce7cff88",
|
|
126
|
+
"@wordpress/reusable-blocks": "^5.40.2-next.v.202602241322.0+bce7cff88",
|
|
127
|
+
"@wordpress/rich-text": "^7.40.1-next.v.202602241322.0+bce7cff88",
|
|
128
|
+
"@wordpress/server-side-render": "^6.16.1-next.v.202602241322.0+bce7cff88",
|
|
129
|
+
"@wordpress/upload-media": "^0.25.2-next.v.202602241322.0+bce7cff88",
|
|
130
|
+
"@wordpress/url": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
131
|
+
"@wordpress/viewport": "^6.40.1-next.v.202602241322.0+bce7cff88",
|
|
132
|
+
"@wordpress/wordcount": "^4.40.1-next.v.202602241322.0+bce7cff88",
|
|
133
133
|
"change-case": "^4.1.2",
|
|
134
134
|
"clsx": "^2.1.1",
|
|
135
135
|
"colord": "^2.7.0",
|
|
@@ -150,5 +150,5 @@
|
|
|
150
150
|
"publishConfig": {
|
|
151
151
|
"access": "public"
|
|
152
152
|
},
|
|
153
|
-
"gitHead": "
|
|
153
|
+
"gitHead": "943dde7f0b600ce238726c36284bc9f70ce0ffa4"
|
|
154
154
|
}
|
package/src/icon/block.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
4
4
|
"name": "core/icon",
|
|
5
5
|
"title": "Icon",
|
|
6
|
-
"__experimental": true,
|
|
7
6
|
"category": "media",
|
|
8
7
|
"description": "Insert an SVG icon.",
|
|
9
8
|
"keywords": [ "icon", "svg" ],
|
|
@@ -61,6 +60,15 @@
|
|
|
61
60
|
},
|
|
62
61
|
"selectors": {
|
|
63
62
|
"root": ".wp-block-icon",
|
|
63
|
+
"color": {
|
|
64
|
+
"root": ".wp-block-icon svg"
|
|
65
|
+
},
|
|
66
|
+
"border": {
|
|
67
|
+
"root": ".wp-block-icon svg"
|
|
68
|
+
},
|
|
69
|
+
"spacing": {
|
|
70
|
+
"padding": ".wp-block-icon svg"
|
|
71
|
+
},
|
|
64
72
|
"dimensions": {
|
|
65
73
|
"root": ".wp-block-icon svg",
|
|
66
74
|
"width": ".wp-block-icon svg"
|
|
@@ -12,7 +12,7 @@ import HtmlRenderer from '../../../utils/html-renderer';
|
|
|
12
12
|
export default function IconGrid( { icons, onChange, attributes } ) {
|
|
13
13
|
return (
|
|
14
14
|
<div className="wp-block-icon__inserter-grid">
|
|
15
|
-
{ icons
|
|
15
|
+
{ ! icons?.length ? (
|
|
16
16
|
<div className="wp-block-icon__inserter-grid-no-results">
|
|
17
17
|
<p>{ __( 'No results found.' ) }</p>
|
|
18
18
|
</div>
|
package/src/icon/edit.js
CHANGED
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
__experimentalGetSpacingClassesAndStyles as useSpacingProps,
|
|
26
26
|
getDimensionsClassesAndStyles as useDimensionsProps,
|
|
27
27
|
} from '@wordpress/block-editor';
|
|
28
|
-
import { useSelect } from '@wordpress/data';
|
|
29
|
-
import { store as coreDataStore } from '@wordpress/core-data';
|
|
30
28
|
import { useState } from '@wordpress/element';
|
|
31
29
|
import { SVG, Rect, Path } from '@wordpress/primitives';
|
|
30
|
+
import { useSelect } from '@wordpress/data';
|
|
31
|
+
import { store as coreDataStore } from '@wordpress/core-data';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Internal dependencies
|
|
@@ -36,7 +36,6 @@ import { SVG, Rect, Path } from '@wordpress/primitives';
|
|
|
36
36
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
37
37
|
import HtmlRenderer from '../utils/html-renderer';
|
|
38
38
|
import { CustomInserterModal } from './components';
|
|
39
|
-
import { unlock } from '../lock-unlock';
|
|
40
39
|
|
|
41
40
|
const IconPlaceholder = ( { className, style } ) => (
|
|
42
41
|
<SVG
|
|
@@ -70,14 +69,25 @@ export function Edit( { attributes, setAttributes } ) {
|
|
|
70
69
|
const borderProps = useBorderProps( attributes );
|
|
71
70
|
const dimensionsProps = useDimensionsProps( attributes );
|
|
72
71
|
|
|
73
|
-
const allIcons =
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
const { selectedIcon, allIcons = [] } = useSelect(
|
|
73
|
+
( select ) => {
|
|
74
|
+
const { getEntityRecord, getEntityRecords } =
|
|
75
|
+
select( coreDataStore );
|
|
76
|
+
return {
|
|
77
|
+
selectedIcon: icon
|
|
78
|
+
? getEntityRecord( 'root', 'icon', icon )
|
|
79
|
+
: null,
|
|
80
|
+
allIcons: isInserterOpen
|
|
81
|
+
? getEntityRecords( 'root', 'icon', {
|
|
82
|
+
per_page: -1,
|
|
83
|
+
} )
|
|
84
|
+
: undefined,
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
[ isInserterOpen, icon ]
|
|
88
|
+
);
|
|
76
89
|
|
|
77
|
-
const iconToDisplay =
|
|
78
|
-
allIcons?.length > 0
|
|
79
|
-
? allIcons?.find( ( { name } ) => name === icon )?.content
|
|
80
|
-
: '';
|
|
90
|
+
const iconToDisplay = selectedIcon?.content || '';
|
|
81
91
|
|
|
82
92
|
const blockControls = (
|
|
83
93
|
<>
|
package/src/icon/index.php
CHANGED
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @since 7.0.0
|
|
12
12
|
*
|
|
13
|
-
* @param array
|
|
14
|
-
* @param string $content The block content.
|
|
15
|
-
* @param WP_Block $block The block instance.
|
|
13
|
+
* @param array $attributes The block attributes.
|
|
16
14
|
*
|
|
17
15
|
* @return string Returns the Icon.
|
|
18
16
|
*/
|
package/src/image/edit.js
CHANGED
|
@@ -348,7 +348,7 @@ export function ImageEdit( {
|
|
|
348
348
|
|
|
349
349
|
const isSideloading = useSelect(
|
|
350
350
|
( select ) => {
|
|
351
|
-
if ( ! window.
|
|
351
|
+
if ( ! window.__clientSideMediaProcessing || ! id ) {
|
|
352
352
|
return false;
|
|
353
353
|
}
|
|
354
354
|
return select( uploadStore ).isUploadingById( id );
|
package/src/image/index.php
CHANGED
|
@@ -310,10 +310,7 @@ function block_core_image_render_lightbox( $block_content, $block, $block_instan
|
|
|
310
310
|
|
|
311
311
|
$body_content = preg_replace( '/<img[^>]+>/', $button, $body_content );
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
block_core_image_print_lightbox_overlay();
|
|
315
|
-
};
|
|
316
|
-
add_action( 'wp_footer', $overlay_callback );
|
|
313
|
+
add_action( 'wp_footer', 'block_core_image_print_lightbox_overlay' );
|
|
317
314
|
|
|
318
315
|
return $body_content;
|
|
319
316
|
}
|
|
@@ -28,6 +28,9 @@ export default function NavigationOverlayCloseEdit( {
|
|
|
28
28
|
const showIcon = displayMode === 'icon' || displayMode === 'both';
|
|
29
29
|
const showText = displayMode === 'text' || displayMode === 'both';
|
|
30
30
|
|
|
31
|
+
// Use translated default if text is empty
|
|
32
|
+
const displayText = text || __( 'Close' );
|
|
33
|
+
|
|
31
34
|
const blockProps = useBlockProps( {
|
|
32
35
|
className: 'wp-block-navigation-overlay-close',
|
|
33
36
|
} );
|
|
@@ -84,12 +87,10 @@ export default function NavigationOverlayCloseEdit( {
|
|
|
84
87
|
{ showText && (
|
|
85
88
|
<RichText
|
|
86
89
|
identifier="text"
|
|
87
|
-
value={
|
|
90
|
+
value={ displayText }
|
|
88
91
|
onChange={ ( value ) =>
|
|
89
92
|
setAttributes( { text: value } )
|
|
90
93
|
}
|
|
91
|
-
placeholder={ __( 'Close' ) }
|
|
92
|
-
withoutInteractiveFormatting
|
|
93
94
|
tagName="span"
|
|
94
95
|
className="wp-block-navigation-overlay-close__text"
|
|
95
96
|
allowedFormats={ [ 'core/bold', 'core/italic' ] }
|
|
@@ -166,10 +166,8 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// Apply overlay and gradient classes.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
$class_names[] = "has-background-dim-{$attributes['dimRatio']}";
|
|
172
|
-
}
|
|
169
|
+
$class_names[] = 'has-background-dim';
|
|
170
|
+
$class_names[] = "has-background-dim-{$attributes['dimRatio']}";
|
|
173
171
|
|
|
174
172
|
if ( $has_solid_overlay ) {
|
|
175
173
|
$class_names[] = "has-{$attributes['overlayColor']}-background-color";
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
"description": "Displays the next or previous post link that is adjacent to the current post.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"textAlign": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
10
|
"type": {
|
|
14
11
|
"type": "string",
|
|
15
12
|
"default": "next"
|
|
@@ -46,6 +43,7 @@
|
|
|
46
43
|
"typography": {
|
|
47
44
|
"fontSize": true,
|
|
48
45
|
"lineHeight": true,
|
|
46
|
+
"textAlign": true,
|
|
49
47
|
"__experimentalFontFamily": true,
|
|
50
48
|
"__experimentalFontWeight": true,
|
|
51
49
|
"__experimentalFontStyle": true,
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import migrateTextAlign from '../utils/migrate-text-align';
|
|
5
|
+
|
|
6
|
+
const v1 = {
|
|
7
|
+
attributes: {
|
|
8
|
+
textAlign: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
},
|
|
11
|
+
type: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: 'next',
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
role: 'content',
|
|
18
|
+
},
|
|
19
|
+
showTitle: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
linkLabel: {
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
arrow: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: 'none',
|
|
30
|
+
},
|
|
31
|
+
taxonomy: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: '',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
supports: {
|
|
37
|
+
anchor: true,
|
|
38
|
+
reusable: false,
|
|
39
|
+
html: false,
|
|
40
|
+
color: {
|
|
41
|
+
link: true,
|
|
42
|
+
},
|
|
43
|
+
typography: {
|
|
44
|
+
fontSize: true,
|
|
45
|
+
lineHeight: true,
|
|
46
|
+
__experimentalFontFamily: true,
|
|
47
|
+
__experimentalFontWeight: true,
|
|
48
|
+
__experimentalFontStyle: true,
|
|
49
|
+
__experimentalTextTransform: true,
|
|
50
|
+
__experimentalTextDecoration: true,
|
|
51
|
+
__experimentalLetterSpacing: true,
|
|
52
|
+
__experimentalDefaultControls: {
|
|
53
|
+
fontSize: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
interactivity: {
|
|
57
|
+
clientNavigation: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
migrate: migrateTextAlign,
|
|
61
|
+
isEligible( attributes ) {
|
|
62
|
+
return (
|
|
63
|
+
!! attributes.textAlign ||
|
|
64
|
+
!! attributes.className?.match(
|
|
65
|
+
/\bhas-text-align-(left|center|right)\b/
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
save: () => null,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default [ v1 ];
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -17,10 +12,7 @@ import {
|
|
|
17
12
|
import {
|
|
18
13
|
InspectorControls,
|
|
19
14
|
RichText,
|
|
20
|
-
BlockControls,
|
|
21
|
-
AlignmentToolbar,
|
|
22
15
|
useBlockProps,
|
|
23
|
-
useBlockEditingMode,
|
|
24
16
|
} from '@wordpress/block-editor';
|
|
25
17
|
import { __, _x } from '@wordpress/i18n';
|
|
26
18
|
import { useSelect } from '@wordpress/data';
|
|
@@ -33,19 +25,9 @@ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
|
33
25
|
|
|
34
26
|
export default function PostNavigationLinkEdit( {
|
|
35
27
|
context: { postType },
|
|
36
|
-
attributes: {
|
|
37
|
-
type,
|
|
38
|
-
label,
|
|
39
|
-
showTitle,
|
|
40
|
-
textAlign,
|
|
41
|
-
linkLabel,
|
|
42
|
-
arrow,
|
|
43
|
-
taxonomy,
|
|
44
|
-
},
|
|
28
|
+
attributes: { type, label, showTitle, linkLabel, arrow, taxonomy },
|
|
45
29
|
setAttributes,
|
|
46
30
|
} ) {
|
|
47
|
-
const blockEditingMode = useBlockEditingMode();
|
|
48
|
-
const showControls = blockEditingMode === 'default';
|
|
49
31
|
const isNext = type === 'next';
|
|
50
32
|
let placeholder = isNext ? __( 'Next' ) : __( 'Previous' );
|
|
51
33
|
|
|
@@ -66,12 +48,7 @@ export default function PostNavigationLinkEdit( {
|
|
|
66
48
|
}
|
|
67
49
|
|
|
68
50
|
const ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );
|
|
69
|
-
const blockProps = useBlockProps(
|
|
70
|
-
className: clsx( {
|
|
71
|
-
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
72
|
-
} ),
|
|
73
|
-
} );
|
|
74
|
-
|
|
51
|
+
const blockProps = useBlockProps();
|
|
75
52
|
const taxonomies = useSelect(
|
|
76
53
|
( select ) => {
|
|
77
54
|
const { getTaxonomies } = select( coreStore );
|
|
@@ -220,16 +197,6 @@ export default function PostNavigationLinkEdit( {
|
|
|
220
197
|
) }
|
|
221
198
|
/>
|
|
222
199
|
</InspectorControls>
|
|
223
|
-
{ showControls && (
|
|
224
|
-
<BlockControls>
|
|
225
|
-
<AlignmentToolbar
|
|
226
|
-
value={ textAlign }
|
|
227
|
-
onChange={ ( nextAlign ) => {
|
|
228
|
-
setAttributes( { textAlign: nextAlign } );
|
|
229
|
-
} }
|
|
230
|
-
/>
|
|
231
|
-
</BlockControls>
|
|
232
|
-
) }
|
|
233
200
|
<div { ...blockProps }>
|
|
234
201
|
{ ! isNext && displayArrow && (
|
|
235
202
|
<span
|
|
@@ -10,6 +10,7 @@ import initBlock from '../utils/init-block';
|
|
|
10
10
|
import metadata from './block.json';
|
|
11
11
|
import edit from './edit';
|
|
12
12
|
import variations from './variations';
|
|
13
|
+
import deprecated from './deprecated';
|
|
13
14
|
|
|
14
15
|
const { name } = metadata;
|
|
15
16
|
export { metadata, name };
|
|
@@ -17,6 +18,7 @@ export { metadata, name };
|
|
|
17
18
|
export const settings = {
|
|
18
19
|
edit,
|
|
19
20
|
variations,
|
|
21
|
+
deprecated,
|
|
20
22
|
example: {
|
|
21
23
|
attributes: {
|
|
22
24
|
label: __( 'Next post' ),
|
|
@@ -8,9 +8,6 @@
|
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"usesContext": [ "postId", "postType", "queryId" ],
|
|
10
10
|
"attributes": {
|
|
11
|
-
"textAlign": {
|
|
12
|
-
"type": "string"
|
|
13
|
-
},
|
|
14
11
|
"level": {
|
|
15
12
|
"type": "number",
|
|
16
13
|
"default": 2
|
|
@@ -58,6 +55,7 @@
|
|
|
58
55
|
"typography": {
|
|
59
56
|
"fontSize": true,
|
|
60
57
|
"lineHeight": true,
|
|
58
|
+
"textAlign": true,
|
|
61
59
|
"__experimentalFontFamily": true,
|
|
62
60
|
"__experimentalFontWeight": true,
|
|
63
61
|
"__experimentalFontStyle": true,
|
|
@@ -2,6 +2,91 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import migrateFontFamily from '../utils/migrate-font-family';
|
|
5
|
+
import migrateTextAlign from '../utils/migrate-text-align';
|
|
6
|
+
|
|
7
|
+
const v2 = {
|
|
8
|
+
attributes: {
|
|
9
|
+
textAlign: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
},
|
|
12
|
+
level: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
default: 2,
|
|
15
|
+
},
|
|
16
|
+
levelOptions: {
|
|
17
|
+
type: 'array',
|
|
18
|
+
},
|
|
19
|
+
isLink: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
rel: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
attribute: 'rel',
|
|
26
|
+
default: '',
|
|
27
|
+
},
|
|
28
|
+
linkTarget: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
default: '_self',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
supports: {
|
|
34
|
+
anchor: true,
|
|
35
|
+
align: [ 'wide', 'full' ],
|
|
36
|
+
html: false,
|
|
37
|
+
color: {
|
|
38
|
+
gradients: true,
|
|
39
|
+
link: true,
|
|
40
|
+
__experimentalDefaultControls: {
|
|
41
|
+
background: true,
|
|
42
|
+
text: true,
|
|
43
|
+
link: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
spacing: {
|
|
47
|
+
padding: true,
|
|
48
|
+
margin: true,
|
|
49
|
+
},
|
|
50
|
+
typography: {
|
|
51
|
+
fontSize: true,
|
|
52
|
+
lineHeight: true,
|
|
53
|
+
__experimentalFontFamily: true,
|
|
54
|
+
__experimentalTextTransform: true,
|
|
55
|
+
__experimentalTextDecoration: true,
|
|
56
|
+
__experimentalFontStyle: true,
|
|
57
|
+
__experimentalFontWeight: true,
|
|
58
|
+
__experimentalLetterSpacing: true,
|
|
59
|
+
__experimentalDefaultControls: {
|
|
60
|
+
fontSize: true,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
interactivity: {
|
|
64
|
+
clientNavigation: true,
|
|
65
|
+
},
|
|
66
|
+
__experimentalBorder: {
|
|
67
|
+
radius: true,
|
|
68
|
+
color: true,
|
|
69
|
+
width: true,
|
|
70
|
+
style: true,
|
|
71
|
+
__experimentalDefaultControls: {
|
|
72
|
+
radius: true,
|
|
73
|
+
color: true,
|
|
74
|
+
width: true,
|
|
75
|
+
style: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
migrate: migrateTextAlign,
|
|
80
|
+
isEligible( attributes ) {
|
|
81
|
+
return (
|
|
82
|
+
!! attributes.textAlign ||
|
|
83
|
+
!! attributes.className?.match(
|
|
84
|
+
/\bhas-text-align-(left|center|right)\b/
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
save: () => null,
|
|
89
|
+
};
|
|
5
90
|
|
|
6
91
|
const v1 = {
|
|
7
92
|
attributes: {
|
|
@@ -62,4 +147,4 @@ const v1 = {
|
|
|
62
147
|
*
|
|
63
148
|
* See block-deprecation.md
|
|
64
149
|
*/
|
|
65
|
-
export default [ v1 ];
|
|
150
|
+
export default [ v2, v1 ];
|
package/src/post-title/edit.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
4
|
import {
|
|
10
|
-
AlignmentControl,
|
|
11
5
|
BlockControls,
|
|
12
6
|
InspectorControls,
|
|
13
7
|
useBlockProps,
|
|
@@ -34,7 +28,7 @@ import { createInterpolateElement } from '@wordpress/element';
|
|
|
34
28
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
35
29
|
|
|
36
30
|
export default function PostTitleEdit( {
|
|
37
|
-
attributes: { level, levelOptions,
|
|
31
|
+
attributes: { level, levelOptions, isLink, rel, linkTarget },
|
|
38
32
|
setAttributes,
|
|
39
33
|
context: { postType, postId, queryId },
|
|
40
34
|
insertBlocksAfter,
|
|
@@ -72,11 +66,7 @@ export default function PostTitleEdit( {
|
|
|
72
66
|
const onSplitAtEnd = () => {
|
|
73
67
|
insertBlocksAfter( createBlock( getDefaultBlockName() ) );
|
|
74
68
|
};
|
|
75
|
-
const blockProps = useBlockProps(
|
|
76
|
-
className: clsx( {
|
|
77
|
-
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
78
|
-
} ),
|
|
79
|
-
} );
|
|
69
|
+
const blockProps = useBlockProps();
|
|
80
70
|
const blockEditingMode = useBlockEditingMode();
|
|
81
71
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
82
72
|
|
|
@@ -147,12 +137,6 @@ export default function PostTitleEdit( {
|
|
|
147
137
|
setAttributes( { level: newLevel } )
|
|
148
138
|
}
|
|
149
139
|
/>
|
|
150
|
-
<AlignmentControl
|
|
151
|
-
value={ textAlign }
|
|
152
|
-
onChange={ ( nextAlign ) => {
|
|
153
|
-
setAttributes( { textAlign: nextAlign } );
|
|
154
|
-
} }
|
|
155
|
-
/>
|
|
156
140
|
</BlockControls>
|
|
157
141
|
<InspectorControls>
|
|
158
142
|
<ToolsPanel
|
|
@@ -297,8 +297,8 @@ const v4 = {
|
|
|
297
297
|
backgroundColor: isSolidColorStyle ? mainColor : undefined,
|
|
298
298
|
borderColor: isSolidColorStyle ? undefined : mainColor,
|
|
299
299
|
textAlign: isSolidColorStyle ? 'left' : undefined,
|
|
300
|
-
style,
|
|
301
300
|
...attributes,
|
|
301
|
+
style,
|
|
302
302
|
};
|
|
303
303
|
},
|
|
304
304
|
};
|
|
@@ -454,8 +454,8 @@ const v3 = {
|
|
|
454
454
|
backgroundColor: isSolidColorStyle ? mainColor : undefined,
|
|
455
455
|
borderColor: isSolidColorStyle ? undefined : mainColor,
|
|
456
456
|
textAlign: isSolidColorStyle ? 'left' : undefined,
|
|
457
|
-
style,
|
|
458
457
|
...attributes,
|
|
458
|
+
style,
|
|
459
459
|
};
|
|
460
460
|
},
|
|
461
461
|
};
|
|
@@ -572,8 +572,8 @@ const v2 = {
|
|
|
572
572
|
backgroundColor: isSolidColorStyle ? mainColor : undefined,
|
|
573
573
|
borderColor: isSolidColorStyle ? undefined : mainColor,
|
|
574
574
|
textAlign: isSolidColorStyle ? 'left' : undefined,
|
|
575
|
-
style,
|
|
576
575
|
...attributes,
|
|
576
|
+
style,
|
|
577
577
|
};
|
|
578
578
|
},
|
|
579
579
|
};
|
package/src/query/block.json
CHANGED
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
"type": {
|
|
11
11
|
"type": "string"
|
|
12
12
|
},
|
|
13
|
-
"textAlign": {
|
|
14
|
-
"type": "string"
|
|
15
|
-
},
|
|
16
13
|
"level": {
|
|
17
14
|
"type": "number",
|
|
18
15
|
"default": 1
|
|
@@ -53,6 +50,7 @@
|
|
|
53
50
|
"typography": {
|
|
54
51
|
"fontSize": true,
|
|
55
52
|
"lineHeight": true,
|
|
53
|
+
"textAlign": true,
|
|
56
54
|
"__experimentalFontFamily": true,
|
|
57
55
|
"__experimentalFontStyle": true,
|
|
58
56
|
"__experimentalFontWeight": true,
|