@wordpress/block-library 9.1.0 → 9.3.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 +21 -17
- package/build/audio/edit.js +20 -8
- package/build/audio/edit.js.map +1 -1
- package/build/audio/index.js +4 -0
- package/build/audio/index.js.map +1 -1
- package/build/audio/transforms.js +1 -1
- package/build/audio/transforms.js.map +1 -1
- package/build/block/edit.js +0 -1
- package/build/block/edit.js.map +1 -1
- package/build/block/index.js +5 -1
- package/build/block/index.js.map +1 -1
- package/build/button/index.js +1 -0
- package/build/button/index.js.map +1 -1
- package/build/embed/embed-preview.js +4 -4
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/edit.js +14 -6
- package/build/file/edit.js.map +1 -1
- package/build/file/index.js +4 -0
- package/build/file/index.js.map +1 -1
- package/build/file/transforms.js +2 -3
- package/build/file/transforms.js.map +1 -1
- package/build/gallery/deprecated.js +6 -54
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +9 -8
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +2 -2
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/save.js +0 -11
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared.js +0 -27
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +29 -80
- package/build/gallery/transforms.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +5 -0
- package/build/group/placeholder.js.map +1 -1
- package/build/image/edit.js +13 -21
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +33 -19
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +4 -0
- package/build/image/index.js.map +1 -1
- package/build/image/transforms.js +1 -1
- package/build/image/transforms.js.map +1 -1
- package/build/list-item/edit.js +1 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +8 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/index.js +11 -1
- package/build/list-item/index.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/loginout/index.js +3 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/edit.js +3 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +3 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/index.js +3 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-title/index.js +3 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +3 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-toolbar.js +54 -61
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/index.js +34 -0
- package/build/query/index.js.map +1 -1
- package/build/quote/edit.js +1 -0
- package/build/quote/edit.js.map +1 -1
- package/build/site-tagline/index.js +1 -0
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +1 -0
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +9 -3
- package/build/social-link/edit.js.map +1 -1
- package/build/table/edit.js +8 -17
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/index.js +1 -1
- package/build/template-part/edit/title-modal.js +1 -1
- package/build/template-part/edit/title-modal.js.map +1 -1
- package/build/utils/caption.js +2 -1
- package/build/utils/caption.js.map +1 -1
- package/build/utils/hooks.js +12 -0
- package/build/utils/hooks.js.map +1 -1
- package/build/verse/index.js +1 -0
- package/build/verse/index.js.map +1 -1
- package/build/video/deprecated.js +4 -0
- package/build/video/deprecated.js.map +1 -1
- package/build/video/edit.js +17 -7
- package/build/video/edit.js.map +1 -1
- package/build/video/index.js +4 -0
- package/build/video/index.js.map +1 -1
- package/build/video/transforms.js +1 -1
- package/build/video/transforms.js.map +1 -1
- package/build-module/audio/edit.js +20 -8
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/index.js +4 -0
- package/build-module/audio/index.js.map +1 -1
- package/build-module/audio/transforms.js +1 -1
- package/build-module/audio/transforms.js.map +1 -1
- package/build-module/block/edit.js +0 -1
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/index.js +5 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/button/index.js +1 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/embed/embed-preview.js +4 -4
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/edit.js +15 -7
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/index.js +4 -0
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/transforms.js +2 -3
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/gallery/deprecated.js +6 -54
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +10 -9
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +1 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/save.js +0 -11
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared.js +0 -25
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +29 -80
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +5 -0
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/image/edit.js +12 -20
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +28 -14
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +4 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/transforms.js +1 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +1 -1
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +8 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/index.js +11 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/loginout/index.js +3 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/edit.js +3 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/convert-to-links-modal.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/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +4 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +3 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-title/index.js +3 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +3 -2
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +55 -62
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/index.js +34 -0
- package/build-module/query/index.js.map +1 -1
- package/build-module/quote/edit.js +1 -0
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -0
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +1 -0
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +9 -3
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/table/edit.js +9 -18
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +1 -1
- package/build-module/template-part/edit/title-modal.js +1 -1
- package/build-module/template-part/edit/title-modal.js.map +1 -1
- package/build-module/utils/caption.js +2 -1
- package/build-module/utils/caption.js.map +1 -1
- package/build-module/utils/hooks.js +11 -0
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/verse/index.js +1 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/deprecated.js +4 -0
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/edit.js +18 -8
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/index.js +4 -0
- package/build-module/video/index.js.map +1 -1
- package/build-module/video/transforms.js +1 -1
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/audio/style-rtl.css +1 -1
- package/build-style/audio/style.css +1 -1
- package/build-style/audio/theme-rtl.css +2 -2
- package/build-style/audio/theme.css +2 -2
- package/build-style/common-rtl.css +1 -3
- package/build-style/common.css +1 -3
- package/build-style/editor-rtl.css +3 -12
- package/build-style/editor.css +3 -12
- package/build-style/embed/style-rtl.css +1 -1
- package/build-style/embed/style.css +1 -1
- package/build-style/embed/theme-rtl.css +2 -2
- package/build-style/embed/theme.css +2 -2
- package/build-style/image/editor-rtl.css +0 -12
- package/build-style/image/editor.css +0 -12
- package/build-style/image/style-rtl.css +7 -1
- package/build-style/image/style.css +7 -1
- package/build-style/media-text/style-rtl.css +4 -0
- package/build-style/media-text/style.css +4 -0
- package/build-style/navigation/style-rtl.css +1 -0
- package/build-style/navigation/style.css +1 -0
- package/build-style/post-comments-form/style-rtl.css +11 -10
- package/build-style/post-comments-form/style.css +11 -10
- package/build-style/query/editor-rtl.css +3 -0
- package/build-style/query/editor.css +3 -0
- package/build-style/reset-rtl.css +1 -5
- package/build-style/reset.css +1 -5
- package/build-style/search/style-rtl.css +1 -2
- package/build-style/search/style.css +1 -2
- package/build-style/social-links/style-rtl.css +91 -91
- package/build-style/social-links/style.css +91 -91
- package/build-style/style-rtl.css +119 -110
- package/build-style/style.css +119 -110
- package/build-style/table/theme-rtl.css +2 -2
- package/build-style/table/theme.css +2 -2
- package/build-style/theme-rtl.css +8 -8
- package/build-style/theme.css +8 -8
- package/build-style/video/style-rtl.css +1 -1
- package/build-style/video/style.css +1 -1
- package/build-style/video/theme-rtl.css +2 -2
- package/build-style/video/theme.css +2 -2
- package/package.json +35 -35
- package/src/audio/block.json +4 -0
- package/src/audio/edit.js +19 -7
- package/src/audio/style.scss +1 -1
- package/src/audio/theme.scss +1 -1
- package/src/audio/transforms.js +1 -1
- package/src/block/block.json +5 -1
- package/src/block/edit.js +0 -1
- package/src/button/block.json +1 -0
- package/src/button/index.php +14 -1
- package/src/embed/embed-preview.js +4 -6
- package/src/embed/style.scss +1 -1
- package/src/embed/theme.scss +1 -1
- package/src/file/block.json +4 -0
- package/src/file/edit.js +19 -6
- package/src/file/transforms.js +1 -2
- package/src/gallery/deprecated.js +6 -55
- package/src/gallery/edit.js +13 -10
- package/src/gallery/gallery-styles.native.scss +0 -2
- package/src/gallery/index.js +1 -1
- package/src/gallery/save.js +0 -10
- package/src/gallery/shared.js +0 -28
- package/src/gallery/transforms.js +56 -99
- package/src/group/block.json +1 -0
- package/src/group/placeholder.js +7 -0
- package/src/image/block.json +4 -0
- package/src/image/edit.js +10 -19
- package/src/image/editor.scss +0 -13
- package/src/image/image.js +45 -16
- package/src/image/index.php +26 -5
- package/src/image/style.scss +11 -1
- package/src/image/transforms.js +1 -1
- package/src/list-item/block.json +11 -1
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-merge.js +19 -5
- package/src/lock-unlock.js +1 -1
- package/src/loginout/block.json +3 -0
- package/src/media-text/edit.js +3 -2
- package/src/media-text/index.php +68 -18
- package/src/media-text/style.scss +4 -0
- package/src/navigation/index.php +5 -3
- package/src/navigation/style.scss +1 -0
- package/src/navigation-submenu/edit.js +1 -1
- package/src/page-list/convert-to-links-modal.js +1 -1
- package/src/page-list/edit.js +1 -1
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +30 -0
- package/src/paragraph/test/edit.native.js +99 -0
- package/src/post-comments-form/style.scss +15 -12
- package/src/post-content/block.json +3 -0
- package/src/post-date/edit.js +5 -1
- package/src/post-date/index.php +9 -3
- package/src/post-excerpt/block.json +3 -0
- package/src/post-title/block.json +3 -0
- package/src/query/edit/inspector-controls/index.js +3 -2
- package/src/query/edit/query-toolbar.js +60 -72
- package/src/query/editor.scss +4 -0
- package/src/query/index.js +40 -0
- package/src/quote/edit.js +1 -0
- package/src/reset.scss +11 -12
- package/src/site-tagline/block.json +1 -0
- package/src/site-title/block.json +1 -0
- package/src/social-link/edit.js +9 -3
- package/src/social-links/style.scss +2 -2
- package/src/table/edit.js +11 -24
- package/src/table/theme.scss +1 -1
- package/src/table-of-contents/block.json +1 -1
- package/src/template-part/edit/title-modal.js +1 -1
- package/src/template-part/index.php +1 -1
- package/src/utils/caption.js +5 -1
- package/src/utils/hooks.js +14 -1
- package/src/verse/block.json +1 -0
- package/src/video/block.json +4 -0
- package/src/video/edit.js +23 -8
- package/src/video/style.scss +1 -1
- package/src/video/theme.scss +1 -1
- package/src/video/transforms.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/gallery/edit-wrapper.js +0 -37
- package/build/gallery/edit-wrapper.js.map +0 -1
- package/build/gallery/v1/constants.js +0 -10
- package/build/gallery/v1/constants.js.map +0 -1
- package/build/gallery/v1/edit.js +0 -399
- package/build/gallery/v1/edit.js.map +0 -1
- package/build/gallery/v1/gallery-button.native.js +0 -55
- package/build/gallery/v1/gallery-button.native.js.map +0 -1
- package/build/gallery/v1/gallery-image.js +0 -285
- package/build/gallery/v1/gallery-image.js.map +0 -1
- package/build/gallery/v1/gallery-image.native.js +0 -297
- package/build/gallery/v1/gallery-image.native.js.map +0 -1
- package/build/gallery/v1/gallery.js +0 -112
- package/build/gallery/v1/gallery.js.map +0 -1
- package/build/gallery/v1/gallery.native.js +0 -139
- package/build/gallery/v1/gallery.native.js.map +0 -1
- package/build/gallery/v1/save.js +0 -81
- package/build/gallery/v1/save.js.map +0 -1
- package/build/gallery/v1/shared.js +0 -17
- package/build/gallery/v1/shared.js.map +0 -1
- package/build/gallery/v1/tiles.native.js +0 -83
- package/build/gallery/v1/tiles.native.js.map +0 -1
- package/build/utils/constants.js +0 -15
- package/build/utils/constants.js.map +0 -1
- package/build-module/gallery/edit-wrapper.js +0 -31
- package/build-module/gallery/edit-wrapper.js.map +0 -1
- package/build-module/gallery/v1/constants.js +0 -4
- package/build-module/gallery/v1/constants.js.map +0 -1
- package/build-module/gallery/v1/edit.js +0 -393
- package/build-module/gallery/v1/edit.js.map +0 -1
- package/build-module/gallery/v1/gallery-button.native.js +0 -46
- package/build-module/gallery/v1/gallery-button.native.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.js +0 -279
- package/build-module/gallery/v1/gallery-image.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.native.js +0 -291
- package/build-module/gallery/v1/gallery-image.native.js.map +0 -1
- package/build-module/gallery/v1/gallery.js +0 -104
- package/build-module/gallery/v1/gallery.js.map +0 -1
- package/build-module/gallery/v1/gallery.native.js +0 -131
- package/build-module/gallery/v1/gallery.native.js.map +0 -1
- package/build-module/gallery/v1/save.js +0 -74
- package/build-module/gallery/v1/save.js.map +0 -1
- package/build-module/gallery/v1/shared.js +0 -10
- package/build-module/gallery/v1/shared.js.map +0 -1
- package/build-module/gallery/v1/tiles.native.js +0 -75
- package/build-module/gallery/v1/tiles.native.js.map +0 -1
- package/build-module/utils/constants.js +0 -9
- package/build-module/utils/constants.js.map +0 -1
- package/src/gallery/edit-wrapper.js +0 -27
- package/src/gallery/v1/constants.js +0 -3
- package/src/gallery/v1/edit.js +0 -450
- package/src/gallery/v1/gallery-button.native.js +0 -47
- package/src/gallery/v1/gallery-image-style.native.scss +0 -109
- package/src/gallery/v1/gallery-image.js +0 -293
- package/src/gallery/v1/gallery-image.native.js +0 -348
- package/src/gallery/v1/gallery-styles.native.scss +0 -8
- package/src/gallery/v1/gallery.js +0 -125
- package/src/gallery/v1/gallery.native.js +0 -162
- package/src/gallery/v1/save.js +0 -98
- package/src/gallery/v1/shared.js +0 -19
- package/src/gallery/v1/tiles-styles.native.scss +0 -11
- package/src/gallery/v1/tiles.native.js +0 -79
- package/src/utils/constants.js +0 -8
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
ToolbarGroup,
|
|
6
6
|
Dropdown,
|
|
7
7
|
ToolbarButton,
|
|
8
|
-
BaseControl,
|
|
9
8
|
__experimentalNumberControl as NumberControl,
|
|
10
9
|
} from '@wordpress/components';
|
|
11
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
12
10
|
import { __ } from '@wordpress/i18n';
|
|
13
11
|
import { settings } from '@wordpress/icons';
|
|
14
12
|
|
|
@@ -25,10 +23,6 @@ export default function QueryToolbar( {
|
|
|
25
23
|
clientId,
|
|
26
24
|
} ) {
|
|
27
25
|
const hasPatterns = !! usePatterns( clientId, name ).length;
|
|
28
|
-
const maxPageInputId = useInstanceId(
|
|
29
|
-
QueryToolbar,
|
|
30
|
-
'blocks-query-pagination-max-page-input'
|
|
31
|
-
);
|
|
32
26
|
|
|
33
27
|
return (
|
|
34
28
|
<>
|
|
@@ -45,75 +39,69 @@ export default function QueryToolbar( {
|
|
|
45
39
|
) }
|
|
46
40
|
renderContent={ () => (
|
|
47
41
|
<>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
42
|
+
<NumberControl
|
|
43
|
+
__unstableInputWidth="60px"
|
|
44
|
+
className="block-library-query-toolbar__popover-number-control"
|
|
45
|
+
label={ __( 'Items per Page' ) }
|
|
46
|
+
labelPosition="edge"
|
|
47
|
+
min={ 1 }
|
|
48
|
+
max={ 100 }
|
|
49
|
+
onChange={ ( value ) => {
|
|
50
|
+
if (
|
|
51
|
+
isNaN( value ) ||
|
|
52
|
+
value < 1 ||
|
|
53
|
+
value > 100
|
|
54
|
+
) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setQuery( {
|
|
58
|
+
perPage: value,
|
|
59
|
+
} );
|
|
60
|
+
} }
|
|
61
|
+
step="1"
|
|
62
|
+
value={ query.perPage }
|
|
63
|
+
isDragEnabled={ false }
|
|
64
|
+
/>
|
|
65
|
+
<NumberControl
|
|
66
|
+
__unstableInputWidth="60px"
|
|
67
|
+
className="block-library-query-toolbar__popover-number-control"
|
|
68
|
+
label={ __( 'Offset' ) }
|
|
69
|
+
labelPosition="edge"
|
|
70
|
+
min={ 0 }
|
|
71
|
+
max={ 100 }
|
|
72
|
+
onChange={ ( value ) => {
|
|
73
|
+
if (
|
|
74
|
+
isNaN( value ) ||
|
|
75
|
+
value < 0 ||
|
|
76
|
+
value > 100
|
|
77
|
+
) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
setQuery( { offset: value } );
|
|
81
|
+
} }
|
|
82
|
+
step="1"
|
|
83
|
+
value={ query.offset }
|
|
84
|
+
isDragEnabled={ false }
|
|
85
|
+
/>
|
|
86
|
+
<NumberControl
|
|
87
|
+
__unstableInputWidth="60px"
|
|
88
|
+
className="block-library-query-toolbar__popover-number-control"
|
|
89
|
+
label={ __( 'Max pages to show' ) }
|
|
90
|
+
labelPosition="edge"
|
|
91
|
+
min={ 0 }
|
|
92
|
+
onChange={ ( value ) => {
|
|
93
|
+
if ( isNaN( value ) || value < 0 ) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
setQuery( { pages: value } );
|
|
97
|
+
} }
|
|
98
|
+
step="1"
|
|
99
|
+
value={ query.pages }
|
|
100
|
+
isDragEnabled={ false }
|
|
96
101
|
help={ __(
|
|
97
102
|
'Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).'
|
|
98
103
|
) }
|
|
99
|
-
|
|
100
|
-
<NumberControl
|
|
101
|
-
id={ maxPageInputId }
|
|
102
|
-
__unstableInputWidth="60px"
|
|
103
|
-
label={ __( 'Max page to show' ) }
|
|
104
|
-
labelPosition="edge"
|
|
105
|
-
min={ 0 }
|
|
106
|
-
onChange={ ( value ) => {
|
|
107
|
-
if ( isNaN( value ) || value < 0 ) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
setQuery( { pages: value } );
|
|
111
|
-
} }
|
|
112
|
-
step="1"
|
|
113
|
-
value={ query.pages }
|
|
114
|
-
isDragEnabled={ false }
|
|
115
|
-
/>
|
|
116
|
-
</BaseControl>
|
|
104
|
+
/>
|
|
117
105
|
</>
|
|
118
106
|
) }
|
|
119
107
|
/>
|
package/src/query/editor.scss
CHANGED
package/src/query/index.js
CHANGED
|
@@ -19,6 +19,46 @@ export { metadata, name };
|
|
|
19
19
|
export const settings = {
|
|
20
20
|
icon,
|
|
21
21
|
edit,
|
|
22
|
+
example: {
|
|
23
|
+
viewportWidth: 650,
|
|
24
|
+
attributes: {
|
|
25
|
+
namespace: 'core/posts-list',
|
|
26
|
+
query: {
|
|
27
|
+
perPage: 4,
|
|
28
|
+
pages: 1,
|
|
29
|
+
offset: 0,
|
|
30
|
+
postType: 'post',
|
|
31
|
+
order: 'desc',
|
|
32
|
+
orderBy: 'date',
|
|
33
|
+
author: '',
|
|
34
|
+
search: '',
|
|
35
|
+
sticky: 'exclude',
|
|
36
|
+
inherit: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
innerBlocks: [
|
|
40
|
+
{
|
|
41
|
+
name: 'core/post-template',
|
|
42
|
+
attributes: {
|
|
43
|
+
layout: {
|
|
44
|
+
type: 'grid',
|
|
45
|
+
columnCount: 2,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
innerBlocks: [
|
|
49
|
+
{
|
|
50
|
+
name: 'core/post-title',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'core/post-date',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'core/post-excerpt',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
22
62
|
save,
|
|
23
63
|
variations,
|
|
24
64
|
deprecated,
|
package/src/quote/edit.js
CHANGED
|
@@ -121,6 +121,7 @@ export default function QuoteEdit( {
|
|
|
121
121
|
}
|
|
122
122
|
addLabel={ __( 'Add citation' ) }
|
|
123
123
|
removeLabel={ __( 'Remove citation' ) }
|
|
124
|
+
excludeElementClassName
|
|
124
125
|
className="wp-block-quote__citation"
|
|
125
126
|
insertBlocksAfter={ insertBlocksAfter }
|
|
126
127
|
{ ...( ! isWebPlatform ? { textAlign } : {} ) }
|
package/src/reset.scss
CHANGED
|
@@ -8,19 +8,18 @@
|
|
|
8
8
|
// We use :where to keep specificity minimal.
|
|
9
9
|
// https://css-tricks.com/almanac/selectors/w/where/
|
|
10
10
|
:where(.editor-styles-wrapper) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
line-height: initial;
|
|
18
|
-
color: initial;
|
|
11
|
+
// The following styles revert to the browser defaults overriding the WPAdmin styles.
|
|
12
|
+
html & {
|
|
13
|
+
font-family: serif; // unfortunately initial doesn't work for font-family.
|
|
14
|
+
font-size: initial;
|
|
15
|
+
line-height: initial;
|
|
16
|
+
color: initial;
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
// Many themes with white backgrounds load editor styles but fail to also provide
|
|
19
|
+
// an explicit white background color, assuming a white editing canvas.
|
|
20
|
+
// So to match browser defaults, we provide a white default here as well.
|
|
21
|
+
background: #fff;
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
.wp-align-wrapper {
|
|
26
25
|
max-width: $content-width;
|
package/src/social-link/edit.js
CHANGED
|
@@ -42,13 +42,18 @@ const SocialLinkURLPopover = ( {
|
|
|
42
42
|
return (
|
|
43
43
|
<URLPopover
|
|
44
44
|
anchor={ popoverAnchor }
|
|
45
|
-
|
|
45
|
+
aria-label={ __( 'Edit social link' ) }
|
|
46
|
+
onClose={ () => {
|
|
47
|
+
setPopover( false );
|
|
48
|
+
popoverAnchor?.focus();
|
|
49
|
+
} }
|
|
46
50
|
>
|
|
47
51
|
<form
|
|
48
52
|
className="block-editor-url-popover__link-editor"
|
|
49
53
|
onSubmit={ ( event ) => {
|
|
50
54
|
event.preventDefault();
|
|
51
55
|
setPopover( false );
|
|
56
|
+
popoverAnchor?.focus();
|
|
52
57
|
} }
|
|
53
58
|
>
|
|
54
59
|
<div className="block-editor-url-input">
|
|
@@ -136,9 +141,9 @@ const SocialLinkEdit = ( {
|
|
|
136
141
|
<PanelRow>
|
|
137
142
|
<TextControl
|
|
138
143
|
__nextHasNoMarginBottom
|
|
139
|
-
label={ __( '
|
|
144
|
+
label={ __( 'Text' ) }
|
|
140
145
|
help={ __(
|
|
141
|
-
'The
|
|
146
|
+
'The text is visible when enabled from the parent Social Icons block.'
|
|
142
147
|
) }
|
|
143
148
|
value={ label }
|
|
144
149
|
onChange={ ( value ) =>
|
|
@@ -162,6 +167,7 @@ const SocialLinkEdit = ( {
|
|
|
162
167
|
className="wp-block-social-link-anchor"
|
|
163
168
|
ref={ setPopoverAnchor }
|
|
164
169
|
onClick={ () => setPopover( true ) }
|
|
170
|
+
aria-haspopup="dialog"
|
|
165
171
|
>
|
|
166
172
|
<IconComponent />
|
|
167
173
|
<span
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// Provide colors for a range of icons.
|
|
110
|
-
.wp-block-social-links:not(.is-style-logos-only) {
|
|
110
|
+
:where(.wp-block-social-links:not(.is-style-logos-only)) {
|
|
111
111
|
// Generic items such as mail, feed, etc.
|
|
112
112
|
@import "../social-link/socials-with-bg.scss";
|
|
113
113
|
}
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
// The specificity for this selector has not been reduced to 0-1-0 as per
|
|
117
117
|
// global styles variation selectors as the lack of background should be
|
|
118
118
|
// enforced for this block style.
|
|
119
|
-
.wp-block-social-links.is-style-logos-only {
|
|
119
|
+
:where(.wp-block-social-links.is-style-logos-only) {
|
|
120
120
|
.wp-social-link {
|
|
121
121
|
background: none;
|
|
122
122
|
|
package/src/table/edit.js
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
useBlockProps,
|
|
17
17
|
__experimentalUseColorProps as useColorProps,
|
|
18
18
|
__experimentalUseBorderProps as useBorderProps,
|
|
19
|
-
__experimentalGetElementClassName,
|
|
20
19
|
} from '@wordpress/block-editor';
|
|
21
20
|
import { __ } from '@wordpress/i18n';
|
|
22
21
|
import {
|
|
@@ -41,7 +40,6 @@ import {
|
|
|
41
40
|
tableRowDelete,
|
|
42
41
|
table,
|
|
43
42
|
} from '@wordpress/icons';
|
|
44
|
-
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
45
43
|
|
|
46
44
|
/**
|
|
47
45
|
* Internal dependencies
|
|
@@ -57,6 +55,7 @@ import {
|
|
|
57
55
|
toggleSection,
|
|
58
56
|
isEmptyTableSection,
|
|
59
57
|
} from './state';
|
|
58
|
+
import { Caption } from '../utils/caption';
|
|
60
59
|
|
|
61
60
|
const ALIGNMENT_CONTROLS = [
|
|
62
61
|
{
|
|
@@ -98,7 +97,7 @@ function TableEdit( {
|
|
|
98
97
|
insertBlocksAfter,
|
|
99
98
|
isSelected,
|
|
100
99
|
} ) {
|
|
101
|
-
const { hasFixedLayout,
|
|
100
|
+
const { hasFixedLayout, head, foot } = attributes;
|
|
102
101
|
const [ initialRowCount, setInitialRowCount ] = useState( 2 );
|
|
103
102
|
const [ initialColumnCount, setInitialColumnCount ] = useState( 2 );
|
|
104
103
|
const [ selectedCell, setSelectedCell ] = useState();
|
|
@@ -523,27 +522,7 @@ function TableEdit( {
|
|
|
523
522
|
{ renderedSections }
|
|
524
523
|
</table>
|
|
525
524
|
) }
|
|
526
|
-
{
|
|
527
|
-
<RichText
|
|
528
|
-
identifier="caption"
|
|
529
|
-
tagName="figcaption"
|
|
530
|
-
className={ __experimentalGetElementClassName( 'caption' ) }
|
|
531
|
-
aria-label={ __( 'Table caption text' ) }
|
|
532
|
-
placeholder={ __( 'Add caption' ) }
|
|
533
|
-
value={ caption }
|
|
534
|
-
onChange={ ( value ) =>
|
|
535
|
-
setAttributes( { caption: value } )
|
|
536
|
-
}
|
|
537
|
-
// Deselect the selected table cell when the caption is focused.
|
|
538
|
-
onFocus={ () => setSelectedCell() }
|
|
539
|
-
__unstableOnSplitAtEnd={ () =>
|
|
540
|
-
insertBlocksAfter(
|
|
541
|
-
createBlock( getDefaultBlockName() )
|
|
542
|
-
)
|
|
543
|
-
}
|
|
544
|
-
/>
|
|
545
|
-
) }
|
|
546
|
-
{ isEmpty && (
|
|
525
|
+
{ isEmpty ? (
|
|
547
526
|
<Placeholder
|
|
548
527
|
label={ __( 'Table' ) }
|
|
549
528
|
icon={ <BlockIcon icon={ icon } showColors /> }
|
|
@@ -582,6 +561,14 @@ function TableEdit( {
|
|
|
582
561
|
</Button>
|
|
583
562
|
</form>
|
|
584
563
|
</Placeholder>
|
|
564
|
+
) : (
|
|
565
|
+
<Caption
|
|
566
|
+
attributes={ attributes }
|
|
567
|
+
setAttributes={ setAttributes }
|
|
568
|
+
isSelected={ isSelected }
|
|
569
|
+
insertBlocksAfter={ insertBlocksAfter }
|
|
570
|
+
label={ __( 'Table caption text' ) }
|
|
571
|
+
/>
|
|
585
572
|
) }
|
|
586
573
|
</figure>
|
|
587
574
|
);
|
package/src/table/theme.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"__experimental": true,
|
|
5
5
|
"name": "core/table-of-contents",
|
|
6
6
|
"title": "Table of Contents",
|
|
7
|
-
"category": "
|
|
7
|
+
"category": "design",
|
|
8
8
|
"description": "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.",
|
|
9
9
|
"keywords": [ "document outline", "summary" ],
|
|
10
10
|
"textdomain": "default",
|
|
@@ -161,7 +161,7 @@ function render_block_core_template_part( $attributes ) {
|
|
|
161
161
|
global $wp_embed;
|
|
162
162
|
$content = $wp_embed->autoembed( $content );
|
|
163
163
|
|
|
164
|
-
if ( empty( $attributes['tagName'] ) ) {
|
|
164
|
+
if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) {
|
|
165
165
|
$area_tag = 'div';
|
|
166
166
|
if ( $area_definition && isset( $area_definition['area_tag'] ) ) {
|
|
167
167
|
$area_tag = $area_definition['area_tag'];
|
package/src/utils/caption.js
CHANGED
|
@@ -32,6 +32,7 @@ export function Caption( {
|
|
|
32
32
|
placeholder = __( 'Add caption' ),
|
|
33
33
|
label = __( 'Caption text' ),
|
|
34
34
|
showToolbarButton = true,
|
|
35
|
+
excludeElementClassName,
|
|
35
36
|
className,
|
|
36
37
|
readOnly,
|
|
37
38
|
tagName = 'figcaption',
|
|
@@ -70,6 +71,7 @@ export function Caption( {
|
|
|
70
71
|
},
|
|
71
72
|
[ isCaptionEmpty ]
|
|
72
73
|
);
|
|
74
|
+
|
|
73
75
|
return (
|
|
74
76
|
<>
|
|
75
77
|
{ showToolbarButton && (
|
|
@@ -96,7 +98,9 @@ export function Caption( {
|
|
|
96
98
|
tagName={ tagName }
|
|
97
99
|
className={ clsx(
|
|
98
100
|
className,
|
|
99
|
-
|
|
101
|
+
excludeElementClassName
|
|
102
|
+
? ''
|
|
103
|
+
: __experimentalGetElementClassName( 'caption' )
|
|
100
104
|
) }
|
|
101
105
|
ref={ ref }
|
|
102
106
|
aria-label={ label }
|
package/src/utils/hooks.js
CHANGED
|
@@ -6,6 +6,7 @@ import { useLayoutEffect, useEffect, useRef } from '@wordpress/element';
|
|
|
6
6
|
import { getBlobByURL, isBlobURL, revokeBlobURL } from '@wordpress/blob';
|
|
7
7
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
8
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Returns whether the current user can edit the given entity.
|
|
@@ -46,7 +47,6 @@ export function useUploadMediaFromBlobURL( args = {} ) {
|
|
|
46
47
|
if ( hasUploadStarted.current ) {
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
|
-
|
|
50
50
|
if (
|
|
51
51
|
! latestArgs.current.url ||
|
|
52
52
|
! isBlobURL( latestArgs.current.url )
|
|
@@ -84,3 +84,16 @@ export function useUploadMediaFromBlobURL( args = {} ) {
|
|
|
84
84
|
} );
|
|
85
85
|
}, [ getSettings ] );
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
export function useToolsPanelDropdownMenuProps() {
|
|
89
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
90
|
+
return ! isMobile
|
|
91
|
+
? {
|
|
92
|
+
popoverProps: {
|
|
93
|
+
placement: 'left-start',
|
|
94
|
+
// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)
|
|
95
|
+
offset: 259,
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
: {};
|
|
99
|
+
}
|
package/src/verse/block.json
CHANGED
package/src/video/block.json
CHANGED
package/src/video/edit.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
MediaReplaceFlow,
|
|
26
26
|
useBlockProps,
|
|
27
27
|
} from '@wordpress/block-editor';
|
|
28
|
-
import { useRef, useEffect } from '@wordpress/element';
|
|
28
|
+
import { useRef, useEffect, useState } from '@wordpress/element';
|
|
29
29
|
import { __, sprintf } from '@wordpress/i18n';
|
|
30
30
|
import { useInstanceId } from '@wordpress/compose';
|
|
31
31
|
import { useDispatch } from '@wordpress/data';
|
|
@@ -74,10 +74,10 @@ function VideoEdit( {
|
|
|
74
74
|
const videoPlayer = useRef();
|
|
75
75
|
const posterImageButton = useRef();
|
|
76
76
|
const { id, controls, poster, src, tracks } = attributes;
|
|
77
|
-
const
|
|
77
|
+
const [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );
|
|
78
78
|
|
|
79
79
|
useUploadMediaFromBlobURL( {
|
|
80
|
-
url:
|
|
80
|
+
url: temporaryURL,
|
|
81
81
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
82
82
|
onChange: onSelectVideo,
|
|
83
83
|
onError: onUploadError,
|
|
@@ -100,19 +100,28 @@ function VideoEdit( {
|
|
|
100
100
|
id: undefined,
|
|
101
101
|
poster: undefined,
|
|
102
102
|
caption: undefined,
|
|
103
|
+
blob: undefined,
|
|
103
104
|
} );
|
|
105
|
+
setTemporaryURL();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if ( isBlobURL( media.url ) ) {
|
|
110
|
+
setTemporaryURL( media.url );
|
|
104
111
|
return;
|
|
105
112
|
}
|
|
106
113
|
|
|
107
114
|
// Sets the block's attribute and updates the edit component from the
|
|
108
115
|
// selected media.
|
|
109
116
|
setAttributes( {
|
|
117
|
+
blob: undefined,
|
|
110
118
|
src: media.url,
|
|
111
119
|
id: media.id,
|
|
112
120
|
poster:
|
|
113
121
|
media.image?.src !== media.icon ? media.image?.src : undefined,
|
|
114
122
|
caption: media.caption,
|
|
115
123
|
} );
|
|
124
|
+
setTemporaryURL();
|
|
116
125
|
}
|
|
117
126
|
|
|
118
127
|
function onSelectURL( newSrc ) {
|
|
@@ -125,7 +134,13 @@ function VideoEdit( {
|
|
|
125
134
|
onReplace( embedBlock );
|
|
126
135
|
return;
|
|
127
136
|
}
|
|
128
|
-
setAttributes( {
|
|
137
|
+
setAttributes( {
|
|
138
|
+
blob: undefined,
|
|
139
|
+
src: newSrc,
|
|
140
|
+
id: undefined,
|
|
141
|
+
poster: undefined,
|
|
142
|
+
} );
|
|
143
|
+
setTemporaryURL();
|
|
129
144
|
}
|
|
130
145
|
}
|
|
131
146
|
|
|
@@ -135,14 +150,14 @@ function VideoEdit( {
|
|
|
135
150
|
}
|
|
136
151
|
|
|
137
152
|
const classes = clsx( className, {
|
|
138
|
-
'is-transient':
|
|
153
|
+
'is-transient': !! temporaryURL,
|
|
139
154
|
} );
|
|
140
155
|
|
|
141
156
|
const blockProps = useBlockProps( {
|
|
142
157
|
className: classes,
|
|
143
158
|
} );
|
|
144
159
|
|
|
145
|
-
if ( ! src ) {
|
|
160
|
+
if ( ! src && ! temporaryURL ) {
|
|
146
161
|
return (
|
|
147
162
|
<div { ...blockProps }>
|
|
148
163
|
<MediaPlaceholder
|
|
@@ -264,13 +279,13 @@ function VideoEdit( {
|
|
|
264
279
|
<video
|
|
265
280
|
controls={ controls }
|
|
266
281
|
poster={ poster }
|
|
267
|
-
src={ src }
|
|
282
|
+
src={ src || temporaryURL }
|
|
268
283
|
ref={ videoPlayer }
|
|
269
284
|
>
|
|
270
285
|
<Tracks tracks={ tracks } />
|
|
271
286
|
</video>
|
|
272
287
|
</Disabled>
|
|
273
|
-
{
|
|
288
|
+
{ !! temporaryURL && <Spinner /> }
|
|
274
289
|
<Caption
|
|
275
290
|
attributes={ attributes }
|
|
276
291
|
setAttributes={ setAttributes }
|
package/src/video/style.scss
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// Supply caption styles to videos, even if the theme hasn't opted in.
|
|
20
20
|
// Reason being: the new markup, <figcaptions>, are not likely to be styled in the majority of existing themes,
|
|
21
21
|
// so we supply the styles so as to not appear broken or unstyled in those themes.
|
|
22
|
-
figcaption {
|
|
22
|
+
:where(figcaption) {
|
|
23
23
|
@include caption-style();
|
|
24
24
|
}
|
|
25
25
|
}
|
package/src/video/theme.scss
CHANGED
package/src/video/transforms.js
CHANGED