@wordpress/block-library 9.14.0 → 9.15.1
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/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/build/archives/edit.js +83 -36
- package/build/archives/edit.js.map +1 -1
- package/build/button/deprecated.js +182 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +47 -25
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +8 -2
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +8 -5
- package/build/button/save.js.map +1 -1
- package/build/column/edit.js +33 -13
- package/build/column/edit.js.map +1 -1
- package/build/columns/edit.js +50 -27
- package/build/columns/edit.js.map +1 -1
- package/build/comments/index.js +1 -0
- package/build/comments/index.js.map +1 -1
- package/build/cover/edit/index.js +9 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit.native.js +1 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/details/edit.js +29 -7
- package/build/details/edit.js.map +1 -1
- package/build/image/transforms.js +1 -0
- package/build/image/transforms.js.map +1 -1
- package/build/latest-posts/deprecated.js +12 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +12 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/loginout/edit.js +42 -13
- package/build/loginout/edit.js.map +1 -1
- package/build/media-text/edit.js +59 -31
- package/build/media-text/edit.js.map +1 -1
- package/build/more/edit.js +28 -7
- package/build/more/edit.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +5 -3
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation-link/edit.js +95 -55
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +105 -53
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +44 -25
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +14 -4
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-author/edit.js +15 -3
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +4 -2
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-name/edit.js +11 -5
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-author-name/index.js +4 -2
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments-form/index.js +6 -1
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +8 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-date/edit.js +58 -18
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +2 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +42 -18
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +17 -19
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +45 -11
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +6 -3
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +11 -7
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-navigation-link/variations.js +2 -2
- package/build/post-navigation-link/variations.js.map +1 -1
- package/build/post-template/index.js +11 -1
- package/build/post-template/index.js.map +1 -1
- package/build/post-title/index.js +6 -3
- package/build/post-title/index.js.map +1 -1
- package/build/query-no-results/index.js +10 -9
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination/edit.js +47 -17
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/query-pagination-label-control.js +1 -1
- package/build/query-pagination/query-pagination-label-control.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +33 -15
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-total/edit.js +8 -10
- package/build/query-total/edit.js.map +1 -1
- package/build/query-total/index.js +8 -1
- package/build/query-total/index.js.map +1 -1
- package/build/read-more/index.js +7 -1
- package/build/read-more/index.js.map +1 -1
- package/build/site-logo/index.js +4 -2
- package/build/site-logo/index.js.map +1 -1
- package/build/site-title/edit.js +41 -12
- package/build/site-title/edit.js.map +1 -1
- package/build/site-title/index.js +4 -2
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +19 -3
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.js +41 -12
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/controls.js +34 -12
- package/build/spacer/controls.js.map +1 -1
- package/build/table/edit.js +48 -15
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +4 -1
- package/build/table/index.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +24 -23
- package/build/table-of-contents/index.js.map +1 -1
- package/build/tag-cloud/edit.js +56 -11
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/video/edit-common-settings.js +90 -30
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +20 -49
- package/build/video/edit.js.map +1 -1
- package/build/video/poster-image.js +81 -0
- package/build/video/poster-image.js.map +1 -0
- package/build/video/tracks-editor.js +1 -1
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/edit.js +84 -37
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/button/deprecated.js +183 -2
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +50 -28
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +8 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +9 -6
- package/build-module/button/save.js.map +1 -1
- package/build-module/column/edit.js +34 -14
- package/build-module/column/edit.js.map +1 -1
- package/build-module/columns/edit.js +52 -29
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comments/index.js +1 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/cover/edit/index.js +9 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit.native.js +2 -2
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/details/edit.js +30 -8
- package/build-module/details/edit.js.map +1 -1
- package/build-module/image/transforms.js +1 -0
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +12 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +12 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/loginout/edit.js +42 -14
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/edit.js +59 -31
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/more/edit.js +28 -8
- package/build-module/more/edit.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +5 -3
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation-link/edit.js +96 -56
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +106 -54
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +45 -26
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +15 -6
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-author/edit.js +16 -4
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +4 -2
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-name/edit.js +12 -6
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +4 -2
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +6 -1
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +8 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-date/edit.js +59 -19
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +2 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +44 -20
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +18 -20
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +47 -13
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +6 -3
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +12 -7
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-navigation-link/variations.js +2 -2
- package/build-module/post-navigation-link/variations.js.map +1 -1
- package/build-module/post-template/index.js +11 -1
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-title/index.js +6 -3
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query-no-results/index.js +10 -9
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +49 -19
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +34 -16
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-total/edit.js +8 -10
- package/build-module/query-total/edit.js.map +1 -1
- package/build-module/query-total/index.js +8 -1
- package/build-module/query-total/index.js.map +1 -1
- package/build-module/read-more/index.js +7 -1
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/site-logo/index.js +4 -2
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-title/edit.js +42 -13
- package/build-module/site-title/edit.js.map +1 -1
- package/build-module/site-title/index.js +4 -2
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +20 -4
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.js +42 -13
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/controls.js +35 -13
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/edit.js +49 -16
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +4 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +26 -25
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/tag-cloud/edit.js +57 -12
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/video/edit-common-settings.js +91 -31
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +24 -53
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/poster-image.js +74 -0
- package/build-module/video/poster-image.js.map +1 -0
- package/build-module/video/tracks-editor.js +1 -1
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/comment-template/style-rtl.css +0 -1
- package/build-style/comment-template/style.css +0 -1
- package/build-style/editor-rtl.css +4 -19
- package/build-style/editor.css +4 -19
- package/build-style/form-input/style-rtl.css +0 -2
- package/build-style/form-input/style.css +0 -2
- package/build-style/freeform/editor-rtl.css +4 -8
- package/build-style/freeform/editor.css +4 -8
- package/build-style/{post-template/editor.css → post-comments-link/style-rtl.css} +2 -4
- package/build-style/{post-template/editor-rtl.css → post-comments-link/style.css} +2 -4
- package/build-style/post-template/style-rtl.css +1 -0
- package/build-style/post-template/style.css +1 -0
- package/build-style/query-total/style-rtl.css +103 -0
- package/build-style/query-total/style.css +103 -0
- package/build-style/read-more/style-rtl.css +0 -1
- package/build-style/read-more/style.css +0 -1
- package/build-style/style-rtl.css +9 -4
- package/build-style/style.css +9 -4
- package/build-style/tag-cloud/editor-rtl.css +0 -5
- package/build-style/tag-cloud/editor.css +0 -5
- package/package.json +35 -35
- package/src/archives/edit.js +94 -36
- package/src/audio/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/block/index.php +20 -0
- package/src/button/block.json +17 -2
- package/src/button/deprecated.js +189 -0
- package/src/button/edit.js +60 -31
- package/src/button/save.js +6 -1
- package/src/column/edit.js +34 -13
- package/src/columns/edit.js +71 -40
- package/src/comments/index.js +1 -0
- package/src/cover/edit/index.js +12 -5
- package/src/cover/edit.native.js +5 -2
- package/src/cover/test/edit.js +5 -7
- package/src/details/edit.js +40 -11
- package/src/editor.scss +0 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/image/transforms.js +1 -0
- package/src/latest-posts/block.json +12 -0
- package/src/loginout/edit.js +56 -20
- package/src/media-text/edit.js +57 -28
- package/src/more/edit.js +39 -12
- package/src/navigation/edit/navigation-menu-selector.js +9 -2
- package/src/navigation/index.php +2 -2
- package/src/navigation-link/edit.js +101 -61
- package/src/navigation-link/index.php +16 -1
- package/src/navigation-submenu/edit.js +113 -57
- package/src/page-list/edit.js +52 -31
- package/src/paragraph/edit.js +18 -4
- package/src/post-author/block.json +4 -2
- package/src/post-author/edit.js +17 -3
- package/src/post-author/index.php +4 -0
- package/src/post-author-name/block.json +4 -2
- package/src/post-author-name/edit.js +17 -4
- package/src/post-author-name/index.php +4 -0
- package/src/post-comments-form/block.json +6 -1
- package/src/post-comments-link/block.json +8 -1
- package/src/post-comments-link/style.scss +4 -0
- package/src/post-content/index.php +23 -0
- package/src/post-date/block.json +2 -1
- package/src/post-date/edit.js +79 -25
- package/src/post-excerpt/edit.js +59 -22
- package/src/post-featured-image/block.json +6 -3
- package/src/post-featured-image/dimension-controls.js +18 -21
- package/src/post-featured-image/edit.js +67 -10
- package/src/post-navigation-link/block.json +0 -6
- package/src/post-navigation-link/index.js +11 -0
- package/src/post-navigation-link/variations.js +2 -2
- package/src/post-template/block.json +11 -1
- package/src/post-template/style.scss +2 -0
- package/src/post-title/block.json +6 -3
- package/src/query-no-results/block.json +0 -10
- package/src/query-no-results/index.js +11 -0
- package/src/query-pagination/edit.js +57 -15
- package/src/query-pagination/query-pagination-label-control.js +1 -3
- package/src/query-pagination-numbers/edit.js +41 -19
- package/src/query-pagination-previous/index.php +21 -14
- package/src/query-total/block.json +8 -1
- package/src/query-total/edit.js +11 -13
- package/src/query-total/index.php +9 -13
- package/src/query-total/style.scss +4 -0
- package/src/read-more/index.js +6 -0
- package/src/site-logo/block.json +4 -2
- package/src/site-title/block.json +4 -2
- package/src/site-title/edit.js +52 -15
- package/src/social-link/edit.js +21 -6
- package/src/social-links/edit.js +52 -15
- package/src/spacer/controls.js +42 -15
- package/src/style.scss +2 -0
- package/src/table/block.json +4 -1
- package/src/table/edit.js +58 -20
- package/src/table-of-contents/block.json +0 -52
- package/src/table-of-contents/edit.js +1 -1
- package/src/table-of-contents/index.js +53 -0
- package/src/tag-cloud/edit.js +60 -8
- package/src/tag-cloud/editor.scss +0 -8
- package/src/video/edit-common-settings.js +97 -39
- package/src/video/edit.js +29 -75
- package/src/video/poster-image.js +86 -0
- package/src/video/tracks-editor.js +1 -1
- package/tsconfig.json +0 -2
- package/src/post-template/editor.scss +0 -7
package/src/site-logo/block.json
CHANGED
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
},
|
|
13
13
|
"isLink": {
|
|
14
14
|
"type": "boolean",
|
|
15
|
-
"default": true
|
|
15
|
+
"default": true,
|
|
16
|
+
"role": "content"
|
|
16
17
|
},
|
|
17
18
|
"linkTarget": {
|
|
18
19
|
"type": "string",
|
|
19
|
-
"default": "_self"
|
|
20
|
+
"default": "_self",
|
|
21
|
+
"role": "content"
|
|
20
22
|
},
|
|
21
23
|
"shouldSyncIcon": {
|
|
22
24
|
"type": "boolean"
|
|
@@ -20,11 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"isLink": {
|
|
22
22
|
"type": "boolean",
|
|
23
|
-
"default": true
|
|
23
|
+
"default": true,
|
|
24
|
+
"role": "content"
|
|
24
25
|
},
|
|
25
26
|
"linkTarget": {
|
|
26
27
|
"type": "string",
|
|
27
|
-
"default": "_self"
|
|
28
|
+
"default": "_self",
|
|
29
|
+
"role": "content"
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
"example": {
|
package/src/site-title/edit.js
CHANGED
|
@@ -17,10 +17,19 @@ import {
|
|
|
17
17
|
useBlockProps,
|
|
18
18
|
HeadingLevelDropdown,
|
|
19
19
|
} from '@wordpress/block-editor';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
ToggleControl,
|
|
22
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
23
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
24
|
+
} from '@wordpress/components';
|
|
21
25
|
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
22
26
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
23
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
32
|
+
|
|
24
33
|
export default function SiteTitleEdit( {
|
|
25
34
|
attributes,
|
|
26
35
|
setAttributes,
|
|
@@ -43,6 +52,7 @@ export default function SiteTitleEdit( {
|
|
|
43
52
|
};
|
|
44
53
|
}, [] );
|
|
45
54
|
const { editEntityRecord } = useDispatch( coreStore );
|
|
55
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
46
56
|
|
|
47
57
|
function setTitle( newTitle ) {
|
|
48
58
|
editEntityRecord( 'root', 'site', undefined, {
|
|
@@ -109,26 +119,53 @@ export default function SiteTitleEdit( {
|
|
|
109
119
|
/>
|
|
110
120
|
</BlockControls>
|
|
111
121
|
<InspectorControls>
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
<ToolsPanel
|
|
123
|
+
label={ __( 'Settings' ) }
|
|
124
|
+
resetAll={ () => {
|
|
125
|
+
setAttributes( {
|
|
126
|
+
isLink: true,
|
|
127
|
+
linkTarget: '_self',
|
|
128
|
+
} );
|
|
129
|
+
} }
|
|
130
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
131
|
+
>
|
|
132
|
+
<ToolsPanelItem
|
|
133
|
+
hasValue={ () => ! isLink }
|
|
115
134
|
label={ __( 'Make title link to home' ) }
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
{ isLink && (
|
|
135
|
+
onDeselect={ () => setAttributes( { isLink: true } ) }
|
|
136
|
+
isShownByDefault
|
|
137
|
+
>
|
|
120
138
|
<ToggleControl
|
|
121
139
|
__nextHasNoMarginBottom
|
|
122
|
-
label={ __( '
|
|
123
|
-
onChange={ (
|
|
124
|
-
setAttributes( {
|
|
125
|
-
linkTarget: value ? '_blank' : '_self',
|
|
126
|
-
} )
|
|
140
|
+
label={ __( 'Make title link to home' ) }
|
|
141
|
+
onChange={ () =>
|
|
142
|
+
setAttributes( { isLink: ! isLink } )
|
|
127
143
|
}
|
|
128
|
-
checked={
|
|
144
|
+
checked={ isLink }
|
|
129
145
|
/>
|
|
146
|
+
</ToolsPanelItem>
|
|
147
|
+
{ isLink && (
|
|
148
|
+
<ToolsPanelItem
|
|
149
|
+
hasValue={ () => linkTarget !== '_self' }
|
|
150
|
+
label={ __( 'Open in new tab' ) }
|
|
151
|
+
onDeselect={ () =>
|
|
152
|
+
setAttributes( { linkTarget: '_self' } )
|
|
153
|
+
}
|
|
154
|
+
isShownByDefault
|
|
155
|
+
>
|
|
156
|
+
<ToggleControl
|
|
157
|
+
__nextHasNoMarginBottom
|
|
158
|
+
label={ __( 'Open in new tab' ) }
|
|
159
|
+
onChange={ ( value ) =>
|
|
160
|
+
setAttributes( {
|
|
161
|
+
linkTarget: value ? '_blank' : '_self',
|
|
162
|
+
} )
|
|
163
|
+
}
|
|
164
|
+
checked={ linkTarget === '_blank' }
|
|
165
|
+
/>
|
|
166
|
+
</ToolsPanelItem>
|
|
130
167
|
) }
|
|
131
|
-
</
|
|
168
|
+
</ToolsPanel>
|
|
132
169
|
</InspectorControls>
|
|
133
170
|
{ siteTitleContent }
|
|
134
171
|
</>
|
package/src/social-link/edit.js
CHANGED
|
@@ -22,10 +22,10 @@ import { useState, useRef } from '@wordpress/element';
|
|
|
22
22
|
import {
|
|
23
23
|
Button,
|
|
24
24
|
Dropdown,
|
|
25
|
-
PanelBody,
|
|
26
|
-
PanelRow,
|
|
27
25
|
TextControl,
|
|
28
26
|
ToolbarButton,
|
|
27
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
28
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
29
29
|
__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,
|
|
30
30
|
} from '@wordpress/components';
|
|
31
31
|
import { useMergeRefs } from '@wordpress/compose';
|
|
@@ -36,6 +36,7 @@ import { keyboardReturn } from '@wordpress/icons';
|
|
|
36
36
|
* Internal dependencies
|
|
37
37
|
*/
|
|
38
38
|
import { getIconBySite, getNameBySite } from './social-list';
|
|
39
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
39
40
|
|
|
40
41
|
const SocialLinkURLPopover = ( {
|
|
41
42
|
url,
|
|
@@ -109,6 +110,7 @@ const SocialLinkEdit = ( {
|
|
|
109
110
|
clientId,
|
|
110
111
|
} ) => {
|
|
111
112
|
const { url, service, label = '', rel } = attributes;
|
|
113
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
112
114
|
const {
|
|
113
115
|
showLabels,
|
|
114
116
|
iconColor,
|
|
@@ -195,8 +197,21 @@ const SocialLinkEdit = ( {
|
|
|
195
197
|
</BlockControls>
|
|
196
198
|
) }
|
|
197
199
|
<InspectorControls>
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
+
<ToolsPanel
|
|
201
|
+
label={ __( 'Settings' ) }
|
|
202
|
+
resetAll={ () => {
|
|
203
|
+
setAttributes( { label: undefined } );
|
|
204
|
+
} }
|
|
205
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
206
|
+
>
|
|
207
|
+
<ToolsPanelItem
|
|
208
|
+
isShownByDefault
|
|
209
|
+
label={ __( 'Text' ) }
|
|
210
|
+
hasValue={ () => !! label }
|
|
211
|
+
onDeselect={ () => {
|
|
212
|
+
setAttributes( { label: undefined } );
|
|
213
|
+
} }
|
|
214
|
+
>
|
|
200
215
|
<TextControl
|
|
201
216
|
__next40pxDefaultSize
|
|
202
217
|
__nextHasNoMarginBottom
|
|
@@ -210,8 +225,8 @@ const SocialLinkEdit = ( {
|
|
|
210
225
|
}
|
|
211
226
|
placeholder={ socialLinkName }
|
|
212
227
|
/>
|
|
213
|
-
</
|
|
214
|
-
</
|
|
228
|
+
</ToolsPanelItem>
|
|
229
|
+
</ToolsPanel>
|
|
215
230
|
</InspectorControls>
|
|
216
231
|
<InspectorControls group="advanced">
|
|
217
232
|
<TextControl
|
package/src/social-links/edit.js
CHANGED
|
@@ -22,14 +22,20 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
MenuGroup,
|
|
24
24
|
MenuItem,
|
|
25
|
-
PanelBody,
|
|
26
25
|
ToggleControl,
|
|
27
26
|
ToolbarDropdownMenu,
|
|
27
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
28
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
28
29
|
} from '@wordpress/components';
|
|
29
30
|
import { __ } from '@wordpress/i18n';
|
|
30
31
|
import { check } from '@wordpress/icons';
|
|
31
32
|
import { useSelect } from '@wordpress/data';
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Internal dependencies
|
|
36
|
+
*/
|
|
37
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
38
|
+
|
|
33
39
|
const sizeOptions = [
|
|
34
40
|
{ name: __( 'Small' ), value: 'has-small-icon-size' },
|
|
35
41
|
{ name: __( 'Normal' ), value: 'has-normal-icon-size' },
|
|
@@ -68,6 +74,8 @@ export function SocialLinksEdit( props ) {
|
|
|
68
74
|
|
|
69
75
|
const logosOnly = attributes.className?.includes( 'is-style-logos-only' );
|
|
70
76
|
|
|
77
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
78
|
+
|
|
71
79
|
// Remove icon background color when logos only style is selected or
|
|
72
80
|
// restore it when any other style is selected.
|
|
73
81
|
const backgroundBackupRef = useRef( {} );
|
|
@@ -198,24 +206,53 @@ export function SocialLinksEdit( props ) {
|
|
|
198
206
|
</ToolbarDropdownMenu>
|
|
199
207
|
</BlockControls>
|
|
200
208
|
<InspectorControls>
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
209
|
+
<ToolsPanel
|
|
210
|
+
label={ __( 'Settings' ) }
|
|
211
|
+
resetAll={ () => {
|
|
212
|
+
setAttributes( {
|
|
213
|
+
openInNewTab: false,
|
|
214
|
+
showLabels: false,
|
|
215
|
+
} );
|
|
216
|
+
} }
|
|
217
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
218
|
+
>
|
|
219
|
+
<ToolsPanelItem
|
|
220
|
+
isShownByDefault
|
|
204
221
|
label={ __( 'Open links in new tab' ) }
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
setAttributes( { openInNewTab:
|
|
222
|
+
hasValue={ () => !! openInNewTab }
|
|
223
|
+
onDeselect={ () =>
|
|
224
|
+
setAttributes( { openInNewTab: false } )
|
|
208
225
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
226
|
+
>
|
|
227
|
+
<ToggleControl
|
|
228
|
+
__nextHasNoMarginBottom
|
|
229
|
+
label={ __( 'Open links in new tab' ) }
|
|
230
|
+
checked={ openInNewTab }
|
|
231
|
+
onChange={ () =>
|
|
232
|
+
setAttributes( {
|
|
233
|
+
openInNewTab: ! openInNewTab,
|
|
234
|
+
} )
|
|
235
|
+
}
|
|
236
|
+
/>
|
|
237
|
+
</ToolsPanelItem>
|
|
238
|
+
<ToolsPanelItem
|
|
239
|
+
isShownByDefault
|
|
212
240
|
label={ __( 'Show text' ) }
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
setAttributes( { showLabels:
|
|
241
|
+
hasValue={ () => !! showLabels }
|
|
242
|
+
onDeselect={ () =>
|
|
243
|
+
setAttributes( { showLabels: false } )
|
|
216
244
|
}
|
|
217
|
-
|
|
218
|
-
|
|
245
|
+
>
|
|
246
|
+
<ToggleControl
|
|
247
|
+
__nextHasNoMarginBottom
|
|
248
|
+
label={ __( 'Show text' ) }
|
|
249
|
+
checked={ showLabels }
|
|
250
|
+
onChange={ () =>
|
|
251
|
+
setAttributes( { showLabels: ! showLabels } )
|
|
252
|
+
}
|
|
253
|
+
/>
|
|
254
|
+
</ToolsPanelItem>
|
|
255
|
+
</ToolsPanel>
|
|
219
256
|
</InspectorControls>
|
|
220
257
|
{ colorGradientSettings.hasColorsOrGradients && (
|
|
221
258
|
<InspectorControls group="color">
|
package/src/spacer/controls.js
CHANGED
|
@@ -10,10 +10,11 @@ import {
|
|
|
10
10
|
privateApis as blockEditorPrivateApis,
|
|
11
11
|
} from '@wordpress/block-editor';
|
|
12
12
|
import {
|
|
13
|
-
PanelBody,
|
|
14
13
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
15
14
|
__experimentalUnitControl as UnitControl,
|
|
16
15
|
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
16
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
17
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
17
18
|
} from '@wordpress/components';
|
|
18
19
|
import { useInstanceId } from '@wordpress/compose';
|
|
19
20
|
import { View } from '@wordpress/primitives';
|
|
@@ -94,28 +95,54 @@ export default function SpacerControls( {
|
|
|
94
95
|
} ) {
|
|
95
96
|
return (
|
|
96
97
|
<InspectorControls>
|
|
97
|
-
<
|
|
98
|
+
<ToolsPanel
|
|
99
|
+
label={ __( 'Settings' ) }
|
|
100
|
+
resetAll={ () => {
|
|
101
|
+
setAttributes( {
|
|
102
|
+
width: undefined,
|
|
103
|
+
height: '100px',
|
|
104
|
+
} );
|
|
105
|
+
} }
|
|
106
|
+
>
|
|
98
107
|
{ orientation === 'horizontal' && (
|
|
99
|
-
<
|
|
108
|
+
<ToolsPanelItem
|
|
100
109
|
label={ __( 'Width' ) }
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
isShownByDefault
|
|
111
|
+
hasValue={ () => width !== undefined }
|
|
112
|
+
onDeselect={ () =>
|
|
113
|
+
setAttributes( { width: undefined } )
|
|
104
114
|
}
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
>
|
|
116
|
+
<DimensionInput
|
|
117
|
+
label={ __( 'Width' ) }
|
|
118
|
+
value={ width }
|
|
119
|
+
onChange={ ( nextWidth ) =>
|
|
120
|
+
setAttributes( { width: nextWidth } )
|
|
121
|
+
}
|
|
122
|
+
isResizing={ isResizing }
|
|
123
|
+
/>
|
|
124
|
+
</ToolsPanelItem>
|
|
107
125
|
) }
|
|
108
126
|
{ orientation !== 'horizontal' && (
|
|
109
|
-
<
|
|
127
|
+
<ToolsPanelItem
|
|
110
128
|
label={ __( 'Height' ) }
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
129
|
+
isShownByDefault
|
|
130
|
+
hasValue={ () => height !== '100px' }
|
|
131
|
+
onDeselect={ () =>
|
|
132
|
+
setAttributes( { height: '100px' } )
|
|
114
133
|
}
|
|
115
|
-
|
|
116
|
-
|
|
134
|
+
>
|
|
135
|
+
<DimensionInput
|
|
136
|
+
label={ __( 'Height' ) }
|
|
137
|
+
value={ height }
|
|
138
|
+
onChange={ ( nextHeight ) =>
|
|
139
|
+
setAttributes( { height: nextHeight } )
|
|
140
|
+
}
|
|
141
|
+
isResizing={ isResizing }
|
|
142
|
+
/>
|
|
143
|
+
</ToolsPanelItem>
|
|
117
144
|
) }
|
|
118
|
-
</
|
|
145
|
+
</ToolsPanel>
|
|
119
146
|
</InspectorControls>
|
|
120
147
|
);
|
|
121
148
|
}
|
package/src/style.scss
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
@import "./post-author-biography/style.scss";
|
|
38
38
|
@import "./post-comments-form/style.scss";
|
|
39
39
|
@import "./post-content/style.scss";
|
|
40
|
+
@import "./post-comments-link/style.scss";
|
|
40
41
|
@import "./post-date/style.scss";
|
|
41
42
|
@import "./post-excerpt/style.scss";
|
|
42
43
|
@import "./post-featured-image/style.scss";
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
@import "./post-template/style.scss";
|
|
51
52
|
@import "./query-pagination/style.scss";
|
|
52
53
|
@import "./query-title/style.scss";
|
|
54
|
+
@import "./query-total/style.scss";
|
|
53
55
|
@import "./quote/style.scss";
|
|
54
56
|
@import "./read-more/style.scss";
|
|
55
57
|
@import "./rss/style.scss";
|
package/src/table/block.json
CHANGED
|
@@ -195,11 +195,14 @@
|
|
|
195
195
|
"width": true
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
|
-
"__experimentalSelector": ".wp-block-table > table",
|
|
199
198
|
"interactivity": {
|
|
200
199
|
"clientNavigation": true
|
|
201
200
|
}
|
|
202
201
|
},
|
|
202
|
+
"selectors": {
|
|
203
|
+
"root": ".wp-block-table > table",
|
|
204
|
+
"spacing": ".wp-block-table"
|
|
205
|
+
},
|
|
203
206
|
"styles": [
|
|
204
207
|
{
|
|
205
208
|
"name": "regular",
|
package/src/table/edit.js
CHANGED
|
@@ -20,12 +20,13 @@ import {
|
|
|
20
20
|
import { __ } from '@wordpress/i18n';
|
|
21
21
|
import {
|
|
22
22
|
Button,
|
|
23
|
-
PanelBody,
|
|
24
23
|
Placeholder,
|
|
25
24
|
TextControl,
|
|
26
25
|
ToggleControl,
|
|
27
26
|
ToolbarDropdownMenu,
|
|
28
27
|
__experimentalHasSplitBorders as hasSplitBorders,
|
|
28
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
29
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
29
30
|
} from '@wordpress/components';
|
|
30
31
|
import {
|
|
31
32
|
alignLeft,
|
|
@@ -56,6 +57,7 @@ import {
|
|
|
56
57
|
isEmptyTableSection,
|
|
57
58
|
} from './state';
|
|
58
59
|
import { Caption } from '../utils/caption';
|
|
60
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
59
61
|
|
|
60
62
|
const ALIGNMENT_CONTROLS = [
|
|
61
63
|
{
|
|
@@ -108,6 +110,8 @@ function TableEdit( {
|
|
|
108
110
|
const tableRef = useRef();
|
|
109
111
|
const [ hasTableCreated, setHasTableCreated ] = useState( false );
|
|
110
112
|
|
|
113
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
114
|
+
|
|
111
115
|
/**
|
|
112
116
|
* Updates the initial column count used for table creation.
|
|
113
117
|
*
|
|
@@ -473,33 +477,67 @@ function TableEdit( {
|
|
|
473
477
|
</>
|
|
474
478
|
) }
|
|
475
479
|
<InspectorControls>
|
|
476
|
-
<
|
|
477
|
-
|
|
478
|
-
|
|
480
|
+
<ToolsPanel
|
|
481
|
+
label={ __( 'Settings' ) }
|
|
482
|
+
resetAll={ () => {
|
|
483
|
+
setAttributes( {
|
|
484
|
+
hasFixedLayout: true,
|
|
485
|
+
head: [],
|
|
486
|
+
foot: [],
|
|
487
|
+
} );
|
|
488
|
+
} }
|
|
489
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
479
490
|
>
|
|
480
|
-
<
|
|
481
|
-
|
|
491
|
+
<ToolsPanelItem
|
|
492
|
+
hasValue={ () => hasFixedLayout !== true }
|
|
482
493
|
label={ __( 'Fixed width table cells' ) }
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
494
|
+
onDeselect={ () =>
|
|
495
|
+
setAttributes( { hasFixedLayout: true } )
|
|
496
|
+
}
|
|
497
|
+
isShownByDefault
|
|
498
|
+
>
|
|
499
|
+
<ToggleControl
|
|
500
|
+
__nextHasNoMarginBottom
|
|
501
|
+
label={ __( 'Fixed width table cells' ) }
|
|
502
|
+
checked={ !! hasFixedLayout }
|
|
503
|
+
onChange={ onChangeFixedLayout }
|
|
504
|
+
/>
|
|
505
|
+
</ToolsPanelItem>
|
|
486
506
|
{ ! isEmpty && (
|
|
487
507
|
<>
|
|
488
|
-
<
|
|
489
|
-
|
|
508
|
+
<ToolsPanelItem
|
|
509
|
+
hasValue={ () => head && head.length }
|
|
490
510
|
label={ __( 'Header section' ) }
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
511
|
+
onDeselect={ () =>
|
|
512
|
+
setAttributes( { head: [] } )
|
|
513
|
+
}
|
|
514
|
+
isShownByDefault
|
|
515
|
+
>
|
|
516
|
+
<ToggleControl
|
|
517
|
+
__nextHasNoMarginBottom
|
|
518
|
+
label={ __( 'Header section' ) }
|
|
519
|
+
checked={ !! ( head && head.length ) }
|
|
520
|
+
onChange={ onToggleHeaderSection }
|
|
521
|
+
/>
|
|
522
|
+
</ToolsPanelItem>
|
|
523
|
+
<ToolsPanelItem
|
|
524
|
+
hasValue={ () => foot && foot.length }
|
|
496
525
|
label={ __( 'Footer section' ) }
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
526
|
+
onDeselect={ () =>
|
|
527
|
+
setAttributes( { foot: [] } )
|
|
528
|
+
}
|
|
529
|
+
isShownByDefault
|
|
530
|
+
>
|
|
531
|
+
<ToggleControl
|
|
532
|
+
__nextHasNoMarginBottom
|
|
533
|
+
label={ __( 'Footer section' ) }
|
|
534
|
+
checked={ !! ( foot && foot.length ) }
|
|
535
|
+
onChange={ onToggleFooterSection }
|
|
536
|
+
/>
|
|
537
|
+
</ToolsPanelItem>
|
|
500
538
|
</>
|
|
501
539
|
) }
|
|
502
|
-
</
|
|
540
|
+
</ToolsPanel>
|
|
503
541
|
</InspectorControls>
|
|
504
542
|
{ ! isEmpty && (
|
|
505
543
|
<table
|
|
@@ -62,57 +62,5 @@
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
-
"example": {
|
|
66
|
-
"innerBlocks": [
|
|
67
|
-
{
|
|
68
|
-
"name": "core/heading",
|
|
69
|
-
"attributes": {
|
|
70
|
-
"level": 2,
|
|
71
|
-
"content": "Heading"
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"name": "core/heading",
|
|
76
|
-
"attributes": {
|
|
77
|
-
"level": 3,
|
|
78
|
-
"content": "Subheading"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"name": "core/heading",
|
|
83
|
-
"attributes": {
|
|
84
|
-
"level": 2,
|
|
85
|
-
"content": "Heading"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"name": "core/heading",
|
|
90
|
-
"attributes": {
|
|
91
|
-
"level": 3,
|
|
92
|
-
"content": "Subheading"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
"attributes": {
|
|
97
|
-
"headings": [
|
|
98
|
-
{
|
|
99
|
-
"content": "Heading",
|
|
100
|
-
"level": 2
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"content": "Subheading",
|
|
104
|
-
"level": 3
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"content": "Heading",
|
|
108
|
-
"level": 2
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"content": "Subheading",
|
|
112
|
-
"level": 3
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
65
|
"style": "wp-block-table-of-contents"
|
|
118
66
|
}
|
|
@@ -122,7 +122,7 @@ export default function TableOfContentsEdit( {
|
|
|
122
122
|
'Only including headings from the current page (if the post is paginated).'
|
|
123
123
|
)
|
|
124
124
|
: __(
|
|
125
|
-
'
|
|
125
|
+
'Include headings from all pages (if the post is paginated).'
|
|
126
126
|
)
|
|
127
127
|
}
|
|
128
128
|
/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
4
5
|
import { tableOfContents as icon } from '@wordpress/icons';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -19,6 +20,58 @@ export const settings = {
|
|
|
19
20
|
icon,
|
|
20
21
|
edit,
|
|
21
22
|
save,
|
|
23
|
+
example: {
|
|
24
|
+
innerBlocks: [
|
|
25
|
+
{
|
|
26
|
+
name: 'core/heading',
|
|
27
|
+
attributes: {
|
|
28
|
+
level: 2,
|
|
29
|
+
content: __( 'Heading' ),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'core/heading',
|
|
34
|
+
attributes: {
|
|
35
|
+
level: 3,
|
|
36
|
+
content: __( 'Subheading' ),
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'core/heading',
|
|
41
|
+
attributes: {
|
|
42
|
+
level: 2,
|
|
43
|
+
content: __( 'Heading' ),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'core/heading',
|
|
48
|
+
attributes: {
|
|
49
|
+
level: 3,
|
|
50
|
+
content: __( 'Subheading' ),
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
attributes: {
|
|
55
|
+
headings: [
|
|
56
|
+
{
|
|
57
|
+
content: __( 'Heading' ),
|
|
58
|
+
level: 2,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
content: __( 'Subheading' ),
|
|
62
|
+
level: 3,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
content: __( 'Heading' ),
|
|
66
|
+
level: 2,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
content: __( 'Subheading' ),
|
|
70
|
+
level: 3,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
22
75
|
};
|
|
23
76
|
|
|
24
77
|
export const init = () => initBlock( { name, metadata, settings } );
|