@wordpress/block-library 9.16.0 → 9.17.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/CHANGELOG.md +2 -0
- package/build/archives/edit.js +2 -2
- package/build/archives/edit.js.map +1 -1
- package/build/categories/edit.js +115 -37
- package/build/categories/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +6 -5
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-pagination/index.js +5 -0
- package/build/comments-pagination/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -9
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/edit.js +16 -2
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +9 -0
- package/build/details/index.js.map +1 -1
- package/build/details/save.js +2 -0
- package/build/details/save.js.map +1 -1
- package/build/embed/transforms.js +5 -2
- package/build/embed/transforms.js.map +1 -1
- package/build/form/variations.js +1 -1
- package/build/form/variations.js.map +1 -1
- package/build/group/edit.js +2 -9
- package/build/group/edit.js.map +1 -1
- package/build/home-link/edit.js +1 -2
- package/build/home-link/edit.js.map +1 -1
- package/build/latest-comments/edit.js +73 -26
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/constants.js +2 -1
- package/build/latest-posts/constants.js.map +1 -1
- package/build/latest-posts/edit.js +91 -38
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list-item/index.js +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build/navigation-link/edit.js +14 -19
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +7 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +4 -14
- package/build/paragraph/edit.js.map +1 -1
- package/build/pattern/index.js +1 -1
- package/build/post-content/index.js +1 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +0 -6
- package/build/post-featured-image/edit.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-terms/edit.js +1 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +1 -1
- package/build/query/edit/query-content.js +2 -6
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query-no-results/index.js +1 -1
- package/build/query-pagination-numbers/edit.js +1 -1
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/edit.js +1 -0
- package/build/query-title/edit.js.map +1 -1
- package/build/read-more/edit.js +25 -7
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +67 -49
- package/build/search/edit.js.map +1 -1
- package/build/separator/edit.js +2 -4
- package/build/separator/edit.js.map +1 -1
- package/build/spacer/controls.js +13 -9
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/edit.js +23 -21
- package/build/spacer/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -9
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/utils/messages.js +22 -0
- package/build/utils/messages.js.map +1 -0
- package/build/video/edit-common-settings.js +1 -1
- package/build/video/edit-common-settings.js.map +1 -1
- package/build-module/archives/edit.js +2 -2
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/categories/edit.js +116 -38
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +5 -4
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-pagination/index.js +5 -0
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -8
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/edit.js +17 -3
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +9 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/details/save.js +2 -0
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/transforms.js +5 -2
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/form/variations.js +1 -1
- package/build-module/form/variations.js.map +1 -1
- package/build-module/group/edit.js +1 -8
- package/build-module/group/edit.js.map +1 -1
- package/build-module/home-link/edit.js +1 -2
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/latest-comments/edit.js +74 -27
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/constants.js +1 -0
- package/build-module/latest-posts/constants.js.map +1 -1
- package/build-module/latest-posts/edit.js +93 -40
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list-item/index.js +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build-module/navigation-link/edit.js +15 -20
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +7 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +5 -15
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/pattern/index.js +1 -1
- package/build-module/post-content/index.js +1 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +1 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +0 -6
- package/build-module/post-featured-image/edit.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-terms/edit.js +1 -0
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +1 -1
- package/build-module/query/edit/query-content.js +1 -5
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query-no-results/index.js +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -1
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/edit.js +1 -0
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/read-more/edit.js +26 -8
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +68 -50
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/edit.js +1 -3
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/spacer/controls.js +13 -9
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/edit.js +24 -22
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/utils/messages.js +15 -0
- package/build-module/utils/messages.js.map +1 -0
- package/build-module/video/edit-common-settings.js +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-style/editor-rtl.css +8 -45
- package/build-style/editor.css +8 -45
- package/build-style/gallery/editor-rtl.css +0 -44
- package/build-style/gallery/editor.css +0 -44
- package/build-style/navigation-link/editor-rtl.css +3 -0
- package/build-style/navigation-link/editor.css +3 -0
- package/build-style/paragraph/editor-rtl.css +4 -0
- package/build-style/paragraph/editor.css +4 -0
- package/build-style/post-featured-image/editor-rtl.css +1 -1
- package/build-style/post-featured-image/editor.css +1 -1
- package/package.json +35 -35
- package/src/archives/edit.js +2 -2
- package/src/categories/edit.js +133 -45
- package/src/comments/edit/comments-inspector-controls.js +5 -8
- package/src/comments-pagination/block.json +5 -0
- package/src/cover/edit/inspector-controls.js +1 -21
- package/src/details/block.json +9 -0
- package/src/details/edit.js +18 -2
- package/src/details/save.js +6 -2
- package/src/embed/transforms.js +3 -1
- package/src/form/variations.js +1 -1
- package/src/gallery/editor.scss +0 -56
- package/src/group/edit.js +1 -20
- package/src/home-link/edit.js +0 -6
- package/src/latest-comments/edit.js +93 -33
- package/src/latest-posts/constants.js +1 -0
- package/src/latest-posts/edit.js +119 -44
- package/src/list/test/edit.native.js +9 -9
- package/src/list-item/block.json +1 -1
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/src/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/src/navigation-link/edit.js +25 -29
- package/src/navigation-link/editor.scss +27 -18
- package/src/navigation-submenu/index.js +7 -0
- package/src/navigation-submenu/index.php +21 -4
- package/src/page-list/edit.js +52 -50
- package/src/paragraph/edit.js +3 -18
- package/src/paragraph/editor.scss +7 -0
- package/src/pattern/block.json +1 -1
- package/src/post-content/block.json +1 -0
- package/src/post-date/edit.js +1 -3
- package/src/post-featured-image/edit.js +2 -15
- package/src/post-featured-image/editor.scss +2 -2
- package/src/post-navigation-link/variations.js +2 -2
- package/src/post-terms/edit.js +1 -0
- package/src/post-time-to-read/block.json +1 -1
- package/src/query/edit/query-content.js +1 -11
- package/src/query-no-results/block.json +1 -1
- package/src/query-pagination-numbers/edit.js +1 -1
- package/src/query-title/edit.js +1 -0
- package/src/read-more/edit.js +35 -11
- package/src/search/edit.js +99 -74
- package/src/separator/edit.js +1 -6
- package/src/spacer/controls.js +10 -9
- package/src/spacer/edit.js +25 -23
- package/src/template-part/edit/advanced-controls.js +1 -21
- package/src/utils/messages.js +31 -0
- package/src/video/edit-common-settings.js +1 -1
|
@@ -163,6 +163,9 @@
|
|
|
163
163
|
background-repeat: repeat-x;
|
|
164
164
|
padding-bottom: 0.1em;
|
|
165
165
|
}
|
|
166
|
+
.wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text.is-invalid span, .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text.is-draft span {
|
|
167
|
+
--wp-underline-color: var(--wp--preset--color--vivid-red);
|
|
168
|
+
}
|
|
166
169
|
.wp-block-navigation-link__placeholder.wp-block-navigation-item__content {
|
|
167
170
|
cursor: pointer;
|
|
168
171
|
}
|
|
@@ -113,4 +113,8 @@
|
|
|
113
113
|
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-right[style*="writing-mode: vertical-rl"],
|
|
114
114
|
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
|
|
115
115
|
rotate: 180deg;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.is-zoomed-out .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] {
|
|
119
|
+
opacity: 0;
|
|
116
120
|
}
|
|
@@ -113,4 +113,8 @@
|
|
|
113
113
|
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-right[style*="writing-mode: vertical-rl"],
|
|
114
114
|
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
|
|
115
115
|
rotate: 180deg;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.is-zoomed-out .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] {
|
|
119
|
+
opacity: 0;
|
|
116
120
|
}
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
width: 100%;
|
|
193
193
|
}
|
|
194
194
|
.wp-block-post-featured-image > a {
|
|
195
|
-
|
|
195
|
+
pointer-events: none;
|
|
196
196
|
}
|
|
197
197
|
.wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-button,
|
|
198
198
|
.wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-placeholder__instructions,
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
width: 100%;
|
|
193
193
|
}
|
|
194
194
|
.wp-block-post-featured-image > a {
|
|
195
|
-
|
|
195
|
+
pointer-events: none;
|
|
196
196
|
}
|
|
197
197
|
.wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-button,
|
|
198
198
|
.wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-placeholder__instructions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.17.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -41,39 +41,39 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/runtime": "7.25.7",
|
|
44
|
-
"@wordpress/a11y": "^4.
|
|
45
|
-
"@wordpress/api-fetch": "^7.
|
|
46
|
-
"@wordpress/autop": "^4.
|
|
47
|
-
"@wordpress/blob": "^4.
|
|
48
|
-
"@wordpress/block-editor": "^14.
|
|
49
|
-
"@wordpress/blocks": "^14.
|
|
50
|
-
"@wordpress/components": "^29.
|
|
51
|
-
"@wordpress/compose": "^7.
|
|
52
|
-
"@wordpress/core-data": "^7.
|
|
53
|
-
"@wordpress/data": "^10.
|
|
54
|
-
"@wordpress/date": "^5.
|
|
55
|
-
"@wordpress/deprecated": "^4.
|
|
56
|
-
"@wordpress/dom": "^4.
|
|
57
|
-
"@wordpress/element": "^6.
|
|
58
|
-
"@wordpress/escape-html": "^3.
|
|
59
|
-
"@wordpress/hooks": "^4.
|
|
60
|
-
"@wordpress/html-entities": "^4.
|
|
61
|
-
"@wordpress/i18n": "^5.
|
|
62
|
-
"@wordpress/icons": "^10.
|
|
63
|
-
"@wordpress/interactivity": "^6.
|
|
64
|
-
"@wordpress/interactivity-router": "^2.
|
|
65
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
66
|
-
"@wordpress/keycodes": "^4.
|
|
67
|
-
"@wordpress/notices": "^5.
|
|
68
|
-
"@wordpress/patterns": "^2.
|
|
69
|
-
"@wordpress/primitives": "^4.
|
|
70
|
-
"@wordpress/private-apis": "^1.
|
|
71
|
-
"@wordpress/reusable-blocks": "^5.
|
|
72
|
-
"@wordpress/rich-text": "^7.
|
|
73
|
-
"@wordpress/server-side-render": "^5.
|
|
74
|
-
"@wordpress/url": "^4.
|
|
75
|
-
"@wordpress/viewport": "^6.
|
|
76
|
-
"@wordpress/wordcount": "^4.
|
|
44
|
+
"@wordpress/a11y": "^4.17.0",
|
|
45
|
+
"@wordpress/api-fetch": "^7.17.0",
|
|
46
|
+
"@wordpress/autop": "^4.17.0",
|
|
47
|
+
"@wordpress/blob": "^4.17.0",
|
|
48
|
+
"@wordpress/block-editor": "^14.12.0",
|
|
49
|
+
"@wordpress/blocks": "^14.6.0",
|
|
50
|
+
"@wordpress/components": "^29.3.0",
|
|
51
|
+
"@wordpress/compose": "^7.17.0",
|
|
52
|
+
"@wordpress/core-data": "^7.17.0",
|
|
53
|
+
"@wordpress/data": "^10.17.0",
|
|
54
|
+
"@wordpress/date": "^5.17.0",
|
|
55
|
+
"@wordpress/deprecated": "^4.17.0",
|
|
56
|
+
"@wordpress/dom": "^4.17.0",
|
|
57
|
+
"@wordpress/element": "^6.17.0",
|
|
58
|
+
"@wordpress/escape-html": "^3.17.0",
|
|
59
|
+
"@wordpress/hooks": "^4.17.0",
|
|
60
|
+
"@wordpress/html-entities": "^4.17.0",
|
|
61
|
+
"@wordpress/i18n": "^5.17.0",
|
|
62
|
+
"@wordpress/icons": "^10.17.0",
|
|
63
|
+
"@wordpress/interactivity": "^6.17.0",
|
|
64
|
+
"@wordpress/interactivity-router": "^2.17.0",
|
|
65
|
+
"@wordpress/keyboard-shortcuts": "^5.17.0",
|
|
66
|
+
"@wordpress/keycodes": "^4.17.0",
|
|
67
|
+
"@wordpress/notices": "^5.17.0",
|
|
68
|
+
"@wordpress/patterns": "^2.17.0",
|
|
69
|
+
"@wordpress/primitives": "^4.17.0",
|
|
70
|
+
"@wordpress/private-apis": "^1.17.0",
|
|
71
|
+
"@wordpress/reusable-blocks": "^5.17.0",
|
|
72
|
+
"@wordpress/rich-text": "^7.17.0",
|
|
73
|
+
"@wordpress/server-side-render": "^5.17.0",
|
|
74
|
+
"@wordpress/url": "^4.17.0",
|
|
75
|
+
"@wordpress/viewport": "^6.17.0",
|
|
76
|
+
"@wordpress/wordcount": "^4.17.0",
|
|
77
77
|
"change-case": "^4.1.2",
|
|
78
78
|
"clsx": "^2.1.1",
|
|
79
79
|
"colord": "^2.7.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "68a831c3178197fe87db284d4b94e5743bfb6b6c"
|
|
95
95
|
}
|
package/src/archives/edit.js
CHANGED
|
@@ -61,7 +61,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
|
|
|
61
61
|
<ToolsPanelItem
|
|
62
62
|
label={ __( 'Show label' ) }
|
|
63
63
|
isShownByDefault
|
|
64
|
-
hasValue={ () => showLabel }
|
|
64
|
+
hasValue={ () => ! showLabel }
|
|
65
65
|
onDeselect={ () =>
|
|
66
66
|
setAttributes( { showLabel: false } )
|
|
67
67
|
}
|
|
@@ -102,7 +102,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
|
|
|
102
102
|
<ToolsPanelItem
|
|
103
103
|
label={ __( 'Group by' ) }
|
|
104
104
|
isShownByDefault
|
|
105
|
-
hasValue={ () =>
|
|
105
|
+
hasValue={ () => type !== 'monthly' }
|
|
106
106
|
onDeselect={ () =>
|
|
107
107
|
setAttributes( { type: 'monthly' } )
|
|
108
108
|
}
|
package/src/categories/edit.js
CHANGED
|
@@ -7,12 +7,13 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
-
PanelBody,
|
|
11
10
|
Placeholder,
|
|
12
11
|
SelectControl,
|
|
13
12
|
Spinner,
|
|
14
13
|
ToggleControl,
|
|
15
14
|
VisuallyHidden,
|
|
15
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
16
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
16
17
|
} from '@wordpress/components';
|
|
17
18
|
import { useInstanceId } from '@wordpress/compose';
|
|
18
19
|
import {
|
|
@@ -25,6 +26,11 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
25
26
|
import { pin } from '@wordpress/icons';
|
|
26
27
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
27
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Internal dependencies
|
|
31
|
+
*/
|
|
32
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
33
|
+
|
|
28
34
|
export default function CategoriesEdit( {
|
|
29
35
|
attributes: {
|
|
30
36
|
displayAsDropdown,
|
|
@@ -180,72 +186,154 @@ export default function CategoriesEdit( {
|
|
|
180
186
|
const blockProps = useBlockProps( {
|
|
181
187
|
className: classes,
|
|
182
188
|
} );
|
|
189
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
183
190
|
|
|
184
191
|
return (
|
|
185
192
|
<TagName { ...blockProps }>
|
|
186
193
|
<InspectorControls>
|
|
187
|
-
<
|
|
194
|
+
<ToolsPanel
|
|
195
|
+
label={ __( 'Settings' ) }
|
|
196
|
+
resetAll={ () => {
|
|
197
|
+
setAttributes( {
|
|
198
|
+
taxonomy: 'category',
|
|
199
|
+
displayAsDropdown: false,
|
|
200
|
+
showHierarchy: false,
|
|
201
|
+
showPostCounts: false,
|
|
202
|
+
showOnlyTopLevel: false,
|
|
203
|
+
showEmpty: false,
|
|
204
|
+
showLabel: true,
|
|
205
|
+
} );
|
|
206
|
+
} }
|
|
207
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
208
|
+
>
|
|
188
209
|
{ Array.isArray( taxonomies ) && (
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
210
|
+
<ToolsPanelItem
|
|
211
|
+
hasValue={ () => {
|
|
212
|
+
return taxonomySlug !== 'category';
|
|
213
|
+
} }
|
|
192
214
|
label={ __( 'Taxonomy' ) }
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
215
|
+
onDeselect={ () => {
|
|
216
|
+
setAttributes( { taxonomy: 'category' } );
|
|
217
|
+
} }
|
|
218
|
+
isShownByDefault
|
|
219
|
+
>
|
|
220
|
+
<SelectControl
|
|
221
|
+
__nextHasNoMarginBottom
|
|
222
|
+
__next40pxDefaultSize
|
|
223
|
+
label={ __( 'Taxonomy' ) }
|
|
224
|
+
options={ taxonomies.map( ( t ) => ( {
|
|
225
|
+
label: t.name,
|
|
226
|
+
value: t.slug,
|
|
227
|
+
} ) ) }
|
|
228
|
+
value={ taxonomySlug }
|
|
229
|
+
onChange={ ( selectedTaxonomy ) =>
|
|
230
|
+
setAttributes( {
|
|
231
|
+
taxonomy: selectedTaxonomy,
|
|
232
|
+
} )
|
|
233
|
+
}
|
|
234
|
+
/>
|
|
235
|
+
</ToolsPanelItem>
|
|
204
236
|
) }
|
|
205
|
-
<
|
|
206
|
-
|
|
237
|
+
<ToolsPanelItem
|
|
238
|
+
hasValue={ () => !! displayAsDropdown }
|
|
207
239
|
label={ __( 'Display as dropdown' ) }
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
240
|
+
onDeselect={ () =>
|
|
241
|
+
setAttributes( { displayAsDropdown: false } )
|
|
242
|
+
}
|
|
243
|
+
isShownByDefault
|
|
244
|
+
>
|
|
212
245
|
<ToggleControl
|
|
213
246
|
__nextHasNoMarginBottom
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
onChange={ toggleAttribute( 'showLabel' ) }
|
|
247
|
+
label={ __( 'Display as dropdown' ) }
|
|
248
|
+
checked={ displayAsDropdown }
|
|
249
|
+
onChange={ toggleAttribute( 'displayAsDropdown' ) }
|
|
218
250
|
/>
|
|
251
|
+
</ToolsPanelItem>
|
|
252
|
+
{ displayAsDropdown && (
|
|
253
|
+
<ToolsPanelItem
|
|
254
|
+
hasValue={ () => ! showLabel }
|
|
255
|
+
label={ __( 'Show label' ) }
|
|
256
|
+
onDeselect={ () =>
|
|
257
|
+
setAttributes( { showLabel: true } )
|
|
258
|
+
}
|
|
259
|
+
isShownByDefault
|
|
260
|
+
>
|
|
261
|
+
<ToggleControl
|
|
262
|
+
__nextHasNoMarginBottom
|
|
263
|
+
className="wp-block-categories__indentation"
|
|
264
|
+
label={ __( 'Show label' ) }
|
|
265
|
+
checked={ showLabel }
|
|
266
|
+
onChange={ toggleAttribute( 'showLabel' ) }
|
|
267
|
+
/>
|
|
268
|
+
</ToolsPanelItem>
|
|
219
269
|
) }
|
|
220
|
-
<
|
|
221
|
-
|
|
270
|
+
<ToolsPanelItem
|
|
271
|
+
hasValue={ () => !! showPostCounts }
|
|
222
272
|
label={ __( 'Show post counts' ) }
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
273
|
+
onDeselect={ () =>
|
|
274
|
+
setAttributes( { showPostCounts: false } )
|
|
275
|
+
}
|
|
276
|
+
isShownByDefault
|
|
277
|
+
>
|
|
227
278
|
<ToggleControl
|
|
228
279
|
__nextHasNoMarginBottom
|
|
229
|
-
label={ __( 'Show
|
|
230
|
-
checked={
|
|
231
|
-
onChange={ toggleAttribute( '
|
|
280
|
+
label={ __( 'Show post counts' ) }
|
|
281
|
+
checked={ showPostCounts }
|
|
282
|
+
onChange={ toggleAttribute( 'showPostCounts' ) }
|
|
232
283
|
/>
|
|
284
|
+
</ToolsPanelItem>
|
|
285
|
+
{ isHierarchicalTaxonomy && (
|
|
286
|
+
<ToolsPanelItem
|
|
287
|
+
hasValue={ () => !! showOnlyTopLevel }
|
|
288
|
+
label={ __( 'Show only top level terms' ) }
|
|
289
|
+
onDeselect={ () =>
|
|
290
|
+
setAttributes( { showOnlyTopLevel: false } )
|
|
291
|
+
}
|
|
292
|
+
isShownByDefault
|
|
293
|
+
>
|
|
294
|
+
<ToggleControl
|
|
295
|
+
__nextHasNoMarginBottom
|
|
296
|
+
label={ __( 'Show only top level terms' ) }
|
|
297
|
+
checked={ showOnlyTopLevel }
|
|
298
|
+
onChange={ toggleAttribute(
|
|
299
|
+
'showOnlyTopLevel'
|
|
300
|
+
) }
|
|
301
|
+
/>
|
|
302
|
+
</ToolsPanelItem>
|
|
233
303
|
) }
|
|
234
|
-
<
|
|
235
|
-
|
|
304
|
+
<ToolsPanelItem
|
|
305
|
+
hasValue={ () => !! showEmpty }
|
|
236
306
|
label={ __( 'Show empty terms' ) }
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
307
|
+
onDeselect={ () =>
|
|
308
|
+
setAttributes( { showEmpty: false } )
|
|
309
|
+
}
|
|
310
|
+
isShownByDefault
|
|
311
|
+
>
|
|
241
312
|
<ToggleControl
|
|
242
313
|
__nextHasNoMarginBottom
|
|
243
|
-
label={ __( 'Show
|
|
244
|
-
checked={
|
|
245
|
-
onChange={ toggleAttribute( '
|
|
314
|
+
label={ __( 'Show empty terms' ) }
|
|
315
|
+
checked={ showEmpty }
|
|
316
|
+
onChange={ toggleAttribute( 'showEmpty' ) }
|
|
246
317
|
/>
|
|
318
|
+
</ToolsPanelItem>
|
|
319
|
+
{ isHierarchicalTaxonomy && ! showOnlyTopLevel && (
|
|
320
|
+
<ToolsPanelItem
|
|
321
|
+
hasValue={ () => !! showHierarchy }
|
|
322
|
+
label={ __( 'Show hierarchy' ) }
|
|
323
|
+
onDeselect={ () =>
|
|
324
|
+
setAttributes( { showHierarchy: false } )
|
|
325
|
+
}
|
|
326
|
+
isShownByDefault
|
|
327
|
+
>
|
|
328
|
+
<ToggleControl
|
|
329
|
+
__nextHasNoMarginBottom
|
|
330
|
+
label={ __( 'Show hierarchy' ) }
|
|
331
|
+
checked={ showHierarchy }
|
|
332
|
+
onChange={ toggleAttribute( 'showHierarchy' ) }
|
|
333
|
+
/>
|
|
334
|
+
</ToolsPanelItem>
|
|
247
335
|
) }
|
|
248
|
-
</
|
|
336
|
+
</ToolsPanel>
|
|
249
337
|
</InspectorControls>
|
|
250
338
|
{ isResolving && (
|
|
251
339
|
<Placeholder icon={ pin } label={ __( 'Terms' ) }>
|
|
@@ -5,18 +5,15 @@ import { SelectControl } from '@wordpress/components';
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { InspectorControls } from '@wordpress/block-editor';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { htmlElementMessages } from '../../utils/messages';
|
|
12
|
+
|
|
8
13
|
export default function CommentsInspectorControls( {
|
|
9
14
|
attributes: { tagName },
|
|
10
15
|
setAttributes,
|
|
11
16
|
} ) {
|
|
12
|
-
const htmlElementMessages = {
|
|
13
|
-
section: __(
|
|
14
|
-
"The <section> element should represent a standalone portion of the document that can't be better represented by another element."
|
|
15
|
-
),
|
|
16
|
-
aside: __(
|
|
17
|
-
"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
|
|
18
|
-
),
|
|
19
|
-
};
|
|
20
17
|
return (
|
|
21
18
|
<InspectorControls>
|
|
22
19
|
<InspectorControls group="advanced">
|
|
@@ -36,6 +36,7 @@ import { COVER_MIN_HEIGHT, mediaPosition } from '../shared';
|
|
|
36
36
|
import { unlock } from '../../lock-unlock';
|
|
37
37
|
import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
|
|
38
38
|
import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
|
|
39
|
+
import { htmlElementMessages } from '../../utils/messages';
|
|
39
40
|
|
|
40
41
|
const { cleanEmptyObject, ResolutionTool } = unlock( blockEditorPrivateApis );
|
|
41
42
|
|
|
@@ -183,27 +184,6 @@ export default function CoverInspectorControls( {
|
|
|
183
184
|
|
|
184
185
|
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
|
185
186
|
|
|
186
|
-
const htmlElementMessages = {
|
|
187
|
-
header: __(
|
|
188
|
-
'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
|
|
189
|
-
),
|
|
190
|
-
main: __(
|
|
191
|
-
'The <main> element should be used for the primary content of your document only.'
|
|
192
|
-
),
|
|
193
|
-
section: __(
|
|
194
|
-
"The <section> element should represent a standalone portion of the document that can't be better represented by another element."
|
|
195
|
-
),
|
|
196
|
-
article: __(
|
|
197
|
-
'The <article> element should represent a self-contained, syndicatable portion of the document.'
|
|
198
|
-
),
|
|
199
|
-
aside: __(
|
|
200
|
-
"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
|
|
201
|
-
),
|
|
202
|
-
footer: __(
|
|
203
|
-
'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'
|
|
204
|
-
),
|
|
205
|
-
};
|
|
206
|
-
|
|
207
187
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
208
188
|
|
|
209
189
|
return (
|
package/src/details/block.json
CHANGED
|
@@ -17,8 +17,17 @@
|
|
|
17
17
|
"source": "rich-text",
|
|
18
18
|
"selector": "summary"
|
|
19
19
|
},
|
|
20
|
+
"name": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"source": "attribute",
|
|
23
|
+
"attribute": "name",
|
|
24
|
+
"selector": ".wp-block-details"
|
|
25
|
+
},
|
|
20
26
|
"allowedBlocks": {
|
|
21
27
|
"type": "array"
|
|
28
|
+
},
|
|
29
|
+
"placeholder": {
|
|
30
|
+
"type": "string"
|
|
22
31
|
}
|
|
23
32
|
},
|
|
24
33
|
"supports": {
|
package/src/details/edit.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
InspectorControls,
|
|
9
9
|
} from '@wordpress/block-editor';
|
|
10
10
|
import {
|
|
11
|
+
TextControl,
|
|
11
12
|
ToggleControl,
|
|
12
13
|
__experimentalToolsPanel as ToolsPanel,
|
|
13
14
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
@@ -30,7 +31,8 @@ const TEMPLATE = [
|
|
|
30
31
|
];
|
|
31
32
|
|
|
32
33
|
function DetailsEdit( { attributes, setAttributes } ) {
|
|
33
|
-
const { showContent, summary, allowedBlocks } =
|
|
34
|
+
const { name, showContent, summary, allowedBlocks, placeholder } =
|
|
35
|
+
attributes;
|
|
34
36
|
const blockProps = useBlockProps();
|
|
35
37
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
36
38
|
template: TEMPLATE,
|
|
@@ -75,6 +77,20 @@ function DetailsEdit( { attributes, setAttributes } ) {
|
|
|
75
77
|
</ToolsPanelItem>
|
|
76
78
|
</ToolsPanel>
|
|
77
79
|
</InspectorControls>
|
|
80
|
+
<InspectorControls group="advanced">
|
|
81
|
+
<TextControl
|
|
82
|
+
__next40pxDefaultSize
|
|
83
|
+
__nextHasNoMarginBottom
|
|
84
|
+
label={ __( 'Name attribute' ) }
|
|
85
|
+
value={ name || '' }
|
|
86
|
+
onChange={ ( newName ) =>
|
|
87
|
+
setAttributes( { name: newName } )
|
|
88
|
+
}
|
|
89
|
+
help={ __(
|
|
90
|
+
'Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.'
|
|
91
|
+
) }
|
|
92
|
+
/>
|
|
93
|
+
</InspectorControls>
|
|
78
94
|
<details { ...innerBlocksProps } open={ isOpen }>
|
|
79
95
|
<summary
|
|
80
96
|
onClick={ ( event ) => {
|
|
@@ -85,7 +101,7 @@ function DetailsEdit( { attributes, setAttributes } ) {
|
|
|
85
101
|
<RichText
|
|
86
102
|
identifier="summary"
|
|
87
103
|
aria-label={ __( 'Write summary' ) }
|
|
88
|
-
placeholder={ __( 'Write summary…' ) }
|
|
104
|
+
placeholder={ placeholder || __( 'Write summary…' ) }
|
|
89
105
|
allowedFormats={ [] }
|
|
90
106
|
withoutInteractiveFormatting
|
|
91
107
|
value={ summary }
|
package/src/details/save.js
CHANGED
|
@@ -4,12 +4,16 @@
|
|
|
4
4
|
import { RichText, useBlockProps, InnerBlocks } from '@wordpress/block-editor';
|
|
5
5
|
|
|
6
6
|
export default function save( { attributes } ) {
|
|
7
|
-
const { showContent } = attributes;
|
|
7
|
+
const { name, showContent } = attributes;
|
|
8
8
|
const summary = attributes.summary ? attributes.summary : 'Details';
|
|
9
9
|
const blockProps = useBlockProps.save();
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
|
-
<details
|
|
12
|
+
<details
|
|
13
|
+
{ ...blockProps }
|
|
14
|
+
name={ name || undefined }
|
|
15
|
+
open={ showContent }
|
|
16
|
+
>
|
|
13
17
|
<summary>
|
|
14
18
|
<RichText.Content value={ summary } />
|
|
15
19
|
</summary>
|
package/src/embed/transforms.js
CHANGED
|
@@ -7,6 +7,7 @@ import { createBlock } from '@wordpress/blocks';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import metadata from './block.json';
|
|
10
|
+
import { removeAspectRatioClasses } from './util';
|
|
10
11
|
|
|
11
12
|
const { name: EMBED_BLOCK } = metadata;
|
|
12
13
|
|
|
@@ -33,13 +34,14 @@ const transforms = {
|
|
|
33
34
|
type: 'block',
|
|
34
35
|
blocks: [ 'core/paragraph' ],
|
|
35
36
|
isMatch: ( { url } ) => !! url,
|
|
36
|
-
transform: ( { url, caption } ) => {
|
|
37
|
+
transform: ( { url, caption, className } ) => {
|
|
37
38
|
let value = `<a href="${ url }">${ url }</a>`;
|
|
38
39
|
if ( caption?.trim() ) {
|
|
39
40
|
value += `<br />${ caption }`;
|
|
40
41
|
}
|
|
41
42
|
return createBlock( 'core/paragraph', {
|
|
42
43
|
content: value,
|
|
44
|
+
className: removeAspectRatioClasses( className ),
|
|
43
45
|
} );
|
|
44
46
|
},
|
|
45
47
|
},
|
package/src/form/variations.js
CHANGED
|
@@ -61,7 +61,7 @@ const variations = [
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
name: 'wp-privacy-form',
|
|
64
|
-
title: __( 'Experimental
|
|
64
|
+
title: __( 'Experimental Privacy Request Form' ),
|
|
65
65
|
keywords: [ 'GDPR' ],
|
|
66
66
|
description: __( 'A form to request data exports and/or deletion.' ),
|
|
67
67
|
attributes: {
|
package/src/gallery/editor.scss
CHANGED
|
@@ -117,10 +117,6 @@
|
|
|
117
117
|
opacity: 0.3;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
.is-selected .block-library-gallery-item__inline-menu {
|
|
121
|
-
display: inline-flex;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
120
|
.block-editor-media-placeholder {
|
|
125
121
|
margin: 0;
|
|
126
122
|
height: 100%;
|
|
@@ -131,58 +127,6 @@
|
|
|
131
127
|
}
|
|
132
128
|
}
|
|
133
129
|
|
|
134
|
-
.block-library-gallery-item__inline-menu {
|
|
135
|
-
display: none;
|
|
136
|
-
position: absolute;
|
|
137
|
-
top: -2px;
|
|
138
|
-
margin: $grid-unit-10;
|
|
139
|
-
z-index: z-index(".block-library-gallery-item__inline-menu");
|
|
140
|
-
border-radius: $radius-small;
|
|
141
|
-
background: $white;
|
|
142
|
-
border: $border-width solid $gray-900;
|
|
143
|
-
|
|
144
|
-
@media not (prefers-reduced-motion) {
|
|
145
|
-
transition: box-shadow 0.2s ease-out;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&:hover {
|
|
149
|
-
box-shadow: $elevation-x-small;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
@include break-small() {
|
|
153
|
-
// Use smaller buttons to fit when there are many columns.
|
|
154
|
-
.columns-7 &,
|
|
155
|
-
.columns-8 & {
|
|
156
|
-
padding: $grid-unit-05 * 0.5;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.components-button.has-icon {
|
|
161
|
-
&:not(:focus) {
|
|
162
|
-
border: none;
|
|
163
|
-
box-shadow: none;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
@include break-small() {
|
|
167
|
-
// Use smaller buttons to fit when there are many columns.
|
|
168
|
-
.columns-7 &,
|
|
169
|
-
.columns-8 & {
|
|
170
|
-
padding: 0;
|
|
171
|
-
width: inherit;
|
|
172
|
-
height: inherit;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
&.is-left {
|
|
178
|
-
left: -2px;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
&.is-right {
|
|
182
|
-
right: -2px;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
130
|
.wp-block-gallery ul.blocks-gallery-grid {
|
|
187
131
|
padding: 0;
|
|
188
132
|
// Some themes give all <ul> default margin instead of padding.
|