@wordpress/block-library 9.24.0 → 9.26.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 +4 -0
- package/build/avatar/edit.js +84 -39
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/user-control.js +32 -17
- package/build/avatar/user-control.js.map +1 -1
- package/build/button/edit.js +29 -17
- package/build/button/edit.js.map +1 -1
- package/build/columns/edit.js +18 -22
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-name/edit.js +41 -12
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-date/edit.js +41 -12
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +27 -7
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -3
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-pagination/edit.js +23 -9
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-title/edit.js +41 -12
- package/build/comments-title/edit.js.map +1 -1
- package/build/details/edit.js +27 -3
- package/build/details/edit.js.map +1 -1
- package/build/embed/edit.js +2 -4
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-controls.js +41 -22
- package/build/embed/embed-controls.js.map +1 -1
- package/build/embed/variations.js +0 -10
- package/build/embed/variations.js.map +1 -1
- package/build/file/inspector.js +73 -30
- package/build/file/inspector.js.map +1 -1
- package/build/form/edit.js +67 -38
- package/build/form/edit.js.map +1 -1
- package/build/form/index.js +3 -3
- package/build/form/index.js.map +1 -1
- package/build/form-input/edit.js +47 -18
- package/build/form-input/edit.js.map +1 -1
- package/build/form-input/index.js +2 -1
- package/build/form-input/index.js.map +1 -1
- package/build/form-submission-notification/index.js +2 -1
- package/build/form-submission-notification/index.js.map +1 -1
- package/build/form-submit-button/index.js +2 -1
- package/build/form-submit-button/index.js.map +1 -1
- package/build/image/image.js +1 -0
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +0 -3
- package/build/image/view.js.map +1 -1
- package/build/latest-posts/edit.js +154 -82
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +131 -52
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/navigation/edit/index.js +93 -51
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +43 -27
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation-link/edit.js +11 -0
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +3 -0
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/transforms.js +2 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +1 -0
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/index.js +3 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-author/edit.js +75 -18
- package/build/post-author/edit.js.map +1 -1
- package/build/post-comments-count/index.js +3 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-count/transforms.js +26 -0
- package/build/post-comments-count/transforms.js.map +1 -0
- package/build/post-comments-link/index.js +3 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-comments-link/transforms.js +26 -0
- package/build/post-comments-link/transforms.js.map +1 -0
- package/build/post-navigation-link/edit.js +72 -33
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-title/edit.js +56 -18
- package/build/post-title/edit.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +1 -1
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/rss/edit.js +120 -46
- package/build/rss/edit.js.map +1 -1
- package/build/separator/edit.js +52 -20
- package/build/separator/edit.js.map +1 -1
- package/build/shortcode/index.js +2 -1
- package/build/shortcode/index.js.map +1 -1
- package/build/site-logo/edit.js +53 -19
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-link/edit.js +21 -5
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/edit.native.js +13 -5
- package/build/social-link/edit.native.js.map +1 -1
- package/build/social-link/social-list.js +17 -25
- package/build/social-link/social-list.js.map +1 -1
- package/build/social-link/variations.js +53 -48
- package/build/social-link/variations.js.map +1 -1
- package/build/social-links/edit.js +38 -45
- package/build/social-links/edit.js.map +1 -1
- package/build/video/tracks-editor.js +63 -21
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/avatar/edit.js +83 -38
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +33 -18
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/button/edit.js +30 -18
- package/build-module/button/edit.js.map +1 -1
- package/build-module/columns/edit.js +18 -22
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-name/edit.js +42 -13
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-date/edit.js +42 -13
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +28 -8
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -3
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-pagination/edit.js +24 -10
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +42 -13
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/details/edit.js +29 -5
- package/build-module/details/edit.js.map +1 -1
- package/build-module/embed/edit.js +2 -4
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/embed-controls.js +42 -23
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/embed/variations.js +0 -10
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/inspector.js +74 -31
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/form/edit.js +68 -39
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form/index.js +3 -3
- package/build-module/form/index.js.map +1 -1
- package/build-module/form-input/edit.js +48 -19
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/form-input/index.js +2 -1
- package/build-module/form-input/index.js.map +1 -1
- package/build-module/form-submission-notification/index.js +2 -1
- package/build-module/form-submission-notification/index.js.map +1 -1
- package/build-module/form-submit-button/index.js +2 -1
- package/build-module/form-submit-button/index.js.map +1 -1
- package/build-module/image/image.js +1 -0
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +0 -3
- package/build-module/image/view.js.map +1 -1
- package/build-module/latest-posts/edit.js +155 -83
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +132 -53
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/navigation/edit/index.js +94 -52
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation-link/edit.js +11 -0
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +3 -0
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/transforms.js +2 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +1 -0
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/index.js +3 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-author/edit.js +76 -19
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +3 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-count/transforms.js +19 -0
- package/build-module/post-comments-count/transforms.js.map +1 -0
- package/build-module/post-comments-link/index.js +3 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-comments-link/transforms.js +19 -0
- package/build-module/post-comments-link/transforms.js.map +1 -0
- package/build-module/post-navigation-link/edit.js +73 -34
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-title/edit.js +57 -19
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/rss/edit.js +121 -47
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/separator/edit.js +54 -22
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/shortcode/index.js +2 -1
- package/build-module/shortcode/index.js.map +1 -1
- package/build-module/site-logo/edit.js +54 -20
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-link/edit.js +24 -8
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +15 -6
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/social-link/social-list.js +16 -21
- package/build-module/social-link/social-list.js.map +1 -1
- package/build-module/social-link/variations.js +53 -48
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/social-links/edit.js +40 -47
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +65 -23
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/calendar/style-rtl.css +7 -7
- package/build-style/calendar/style.css +7 -7
- package/build-style/comments-pagination/editor-rtl.css +0 -12
- package/build-style/comments-pagination/editor.css +0 -14
- package/build-style/comments-pagination/style-rtl.css +0 -7
- package/build-style/comments-pagination/style.css +0 -9
- package/build-style/editor-rtl.css +9 -21
- package/build-style/editor.css +9 -23
- package/build-style/gallery/style-rtl.css +1 -0
- package/build-style/gallery/style.css +1 -0
- package/build-style/navigation/editor-rtl.css +8 -3
- package/build-style/navigation/editor.css +8 -3
- package/build-style/navigation/style-rtl.css +4 -0
- package/build-style/navigation/style.css +4 -0
- package/build-style/pullquote/editor-rtl.css +1 -1
- package/build-style/pullquote/editor.css +1 -1
- package/build-style/pullquote/style-rtl.css +2 -3
- package/build-style/pullquote/style.css +2 -3
- package/build-style/pullquote/theme-rtl.css +2 -2
- package/build-style/pullquote/theme.css +2 -2
- package/build-style/style-rtl.css +14 -17
- package/build-style/style.css +14 -19
- package/build-style/theme-rtl.css +2 -2
- package/build-style/theme.css +2 -2
- package/package.json +35 -35
- package/src/avatar/edit.js +99 -51
- package/src/avatar/user-control.js +34 -29
- package/src/button/edit.js +44 -29
- package/src/calendar/style.scss +10 -10
- package/src/columns/edit.js +20 -31
- package/src/comment-author-name/edit.js +54 -13
- package/src/comment-date/edit.js +50 -15
- package/src/comment-edit-link/edit.js +39 -11
- package/src/comments/edit/comments-inspector-controls.js +0 -2
- package/src/comments-pagination/edit.js +29 -9
- package/src/comments-pagination/editor.scss +0 -15
- package/src/comments-pagination/style.scss +0 -8
- package/src/comments-title/edit.js +53 -15
- package/src/details/edit.js +36 -4
- package/src/editor.scss +0 -1
- package/src/embed/edit.js +3 -5
- package/src/embed/embed-controls.js +55 -33
- package/src/embed/variations.js +0 -8
- package/src/file/inspector.js +99 -45
- package/src/form/block.json +1 -2
- package/src/form/edit.js +91 -47
- package/src/form/index.js +1 -0
- package/src/form-input/edit.js +56 -18
- package/src/form-input/index.js +1 -0
- package/src/form-submission-notification/index.js +1 -0
- package/src/form-submit-button/index.js +1 -0
- package/src/gallery/style.scss +1 -0
- package/src/image/image.js +1 -0
- package/src/image/index.php +4 -1
- package/src/image/view.js +0 -3
- package/src/latest-posts/edit.js +206 -98
- package/src/list/ordered-list-settings.js +172 -62
- package/src/navigation/edit/index.js +127 -64
- package/src/navigation/edit/overlay-menu-preview.js +43 -26
- package/src/navigation/editor.scss +8 -4
- package/src/navigation/style.scss +8 -0
- package/src/navigation-link/block.json +3 -0
- package/src/navigation-link/edit.js +14 -1
- package/src/navigation-link/index.php +4 -0
- package/src/navigation-link/transforms.js +2 -1
- package/src/navigation-link/update-attributes.js +1 -0
- package/src/navigation-submenu/block.json +3 -0
- package/src/navigation-submenu/index.php +4 -0
- package/src/post-author/edit.js +91 -27
- package/src/post-comments-count/index.js +2 -0
- package/src/post-comments-count/transforms.js +20 -0
- package/src/post-comments-link/index.js +2 -0
- package/src/post-comments-link/transforms.js +20 -0
- package/src/post-navigation-link/edit.js +96 -51
- package/src/post-title/edit.js +76 -24
- package/src/pullquote/editor.scss +1 -1
- package/src/pullquote/style.scss +2 -3
- package/src/pullquote/theme.scss +2 -2
- package/src/query/edit/enhanced-pagination-modal.js +1 -5
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
- package/src/rss/edit.js +141 -55
- package/src/separator/edit.js +66 -21
- package/src/shortcode/block.json +2 -1
- package/src/site-logo/edit.js +69 -26
- package/src/site-title/index.php +1 -1
- package/src/social-link/edit.js +18 -7
- package/src/social-link/edit.native.js +10 -4
- package/src/social-link/index.php +62 -49
- package/src/social-link/social-list.js +15 -20
- package/src/social-link/variations.js +53 -48
- package/src/social-links/edit.js +38 -60
- package/src/video/tracks-editor.js +75 -22
- package/build-style/post-author/editor-rtl.css +0 -140
- package/build-style/post-author/editor.css +0 -140
- package/src/post-author/editor.scss +0 -7
|
@@ -3,67 +3,146 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { InspectorControls } from '@wordpress/block-editor';
|
|
6
|
-
import { TextControl, PanelBody, ToggleControl, SelectControl } from '@wordpress/components';
|
|
6
|
+
import { TextControl, PanelBody, ToggleControl, SelectControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
|
|
7
|
+
import { Platform } from '@wordpress/element';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
7
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const LIST_STYLE_OPTIONS = [{
|
|
15
|
+
label: __('Numbers'),
|
|
16
|
+
value: 'decimal'
|
|
17
|
+
}, {
|
|
18
|
+
label: __('Uppercase letters'),
|
|
19
|
+
value: 'upper-alpha'
|
|
20
|
+
}, {
|
|
21
|
+
label: __('Lowercase letters'),
|
|
22
|
+
value: 'lower-alpha'
|
|
23
|
+
}, {
|
|
24
|
+
label: __('Uppercase Roman numerals'),
|
|
25
|
+
value: 'upper-roman'
|
|
26
|
+
}, {
|
|
27
|
+
label: __('Lowercase Roman numerals'),
|
|
28
|
+
value: 'lower-roman'
|
|
29
|
+
}];
|
|
8
30
|
const OrderedListSettings = ({
|
|
9
31
|
setAttributes,
|
|
10
32
|
reversed,
|
|
11
33
|
start,
|
|
12
34
|
type
|
|
13
|
-
}) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
label: __('
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
label: __('
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
}) => {
|
|
36
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
37
|
+
return /*#__PURE__*/_jsx(InspectorControls, {
|
|
38
|
+
children: Platform.isNative ? /*#__PURE__*/_jsxs(PanelBody, {
|
|
39
|
+
title: __('Settings'),
|
|
40
|
+
children: [/*#__PURE__*/_jsx(SelectControl, {
|
|
41
|
+
__next40pxDefaultSize: true,
|
|
42
|
+
__nextHasNoMarginBottom: true,
|
|
43
|
+
label: __('List style'),
|
|
44
|
+
options: LIST_STYLE_OPTIONS,
|
|
45
|
+
value: type,
|
|
46
|
+
onChange: newValue => setAttributes({
|
|
47
|
+
type: newValue
|
|
48
|
+
})
|
|
49
|
+
}), /*#__PURE__*/_jsx(TextControl, {
|
|
50
|
+
__next40pxDefaultSize: true,
|
|
51
|
+
__nextHasNoMarginBottom: true,
|
|
52
|
+
label: __('Start value'),
|
|
53
|
+
type: "number",
|
|
54
|
+
onChange: value => {
|
|
55
|
+
const int = parseInt(value, 10);
|
|
56
|
+
setAttributes({
|
|
57
|
+
// It should be possible to unset the value,
|
|
58
|
+
// e.g. with an empty string.
|
|
59
|
+
start: isNaN(int) ? undefined : int
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
value: Number.isInteger(start) ? start.toString(10) : '',
|
|
63
|
+
step: "1"
|
|
64
|
+
}), /*#__PURE__*/_jsx(ToggleControl, {
|
|
65
|
+
__nextHasNoMarginBottom: true,
|
|
66
|
+
label: __('Reverse order'),
|
|
67
|
+
checked: reversed || false,
|
|
68
|
+
onChange: value => {
|
|
69
|
+
setAttributes({
|
|
70
|
+
// Unset the attribute if not reversed.
|
|
71
|
+
reversed: value || undefined
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
})]
|
|
75
|
+
}) : /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
76
|
+
label: __('Settings'),
|
|
77
|
+
resetAll: () => {
|
|
47
78
|
setAttributes({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
79
|
+
type: undefined,
|
|
80
|
+
start: undefined,
|
|
81
|
+
reversed: undefined
|
|
51
82
|
});
|
|
52
83
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
84
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
85
|
+
children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
86
|
+
label: __('List style'),
|
|
87
|
+
isShownByDefault: true,
|
|
88
|
+
hasValue: () => !!type,
|
|
89
|
+
onDeselect: () => setAttributes({
|
|
90
|
+
type: undefined
|
|
91
|
+
}),
|
|
92
|
+
children: /*#__PURE__*/_jsx(SelectControl, {
|
|
93
|
+
__next40pxDefaultSize: true,
|
|
94
|
+
__nextHasNoMarginBottom: true,
|
|
95
|
+
label: __('List style'),
|
|
96
|
+
options: LIST_STYLE_OPTIONS,
|
|
97
|
+
value: type || 'decimal',
|
|
98
|
+
onChange: newValue => setAttributes({
|
|
99
|
+
type: newValue
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
103
|
+
label: __('Start value'),
|
|
104
|
+
isShownByDefault: true,
|
|
105
|
+
hasValue: () => !!start,
|
|
106
|
+
onDeselect: () => setAttributes({
|
|
107
|
+
start: undefined
|
|
108
|
+
}),
|
|
109
|
+
children: /*#__PURE__*/_jsx(TextControl, {
|
|
110
|
+
__next40pxDefaultSize: true,
|
|
111
|
+
__nextHasNoMarginBottom: true,
|
|
112
|
+
label: __('Start value'),
|
|
113
|
+
type: "number",
|
|
114
|
+
onChange: value => {
|
|
115
|
+
const int = parseInt(value, 10);
|
|
116
|
+
setAttributes({
|
|
117
|
+
// It should be possible to unset the value,
|
|
118
|
+
// e.g. with an empty string.
|
|
119
|
+
start: isNaN(int) ? undefined : int
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
value: Number.isInteger(start) ? start.toString(10) : '',
|
|
123
|
+
step: "1"
|
|
124
|
+
})
|
|
125
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
126
|
+
label: __('Reverse order'),
|
|
127
|
+
isShownByDefault: true,
|
|
128
|
+
hasValue: () => !!reversed,
|
|
129
|
+
onDeselect: () => setAttributes({
|
|
130
|
+
reversed: undefined
|
|
131
|
+
}),
|
|
132
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
133
|
+
__nextHasNoMarginBottom: true,
|
|
134
|
+
label: __('Reverse order'),
|
|
135
|
+
checked: reversed || false,
|
|
136
|
+
onChange: value => {
|
|
137
|
+
setAttributes({
|
|
138
|
+
// Unset the attribute if not reversed.
|
|
139
|
+
reversed: value || undefined
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
})]
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
};
|
|
68
147
|
export default OrderedListSettings;
|
|
69
148
|
//# sourceMappingURL=ordered-list-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","InspectorControls","TextControl","PanelBody","ToggleControl","SelectControl","jsx","_jsx","jsxs","_jsxs","OrderedListSettings","setAttributes","reversed","start","type","
|
|
1
|
+
{"version":3,"names":["__","InspectorControls","TextControl","PanelBody","ToggleControl","SelectControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","Platform","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","LIST_STYLE_OPTIONS","label","value","OrderedListSettings","setAttributes","reversed","start","type","dropdownMenuProps","children","isNative","title","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","newValue","int","parseInt","isNaN","undefined","Number","isInteger","toString","step","checked","resetAll","isShownByDefault","hasValue","onDeselect"],"sources":["@wordpress/block-library/src/list/ordered-list-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport {\n\tTextControl,\n\tPanelBody,\n\tToggleControl,\n\tSelectControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst LIST_STYLE_OPTIONS = [\n\t{\n\t\tlabel: __( 'Numbers' ),\n\t\tvalue: 'decimal',\n\t},\n\t{\n\t\tlabel: __( 'Uppercase letters' ),\n\t\tvalue: 'upper-alpha',\n\t},\n\t{\n\t\tlabel: __( 'Lowercase letters' ),\n\t\tvalue: 'lower-alpha',\n\t},\n\t{\n\t\tlabel: __( 'Uppercase Roman numerals' ),\n\t\tvalue: 'upper-roman',\n\t},\n\t{\n\t\tlabel: __( 'Lowercase Roman numerals' ),\n\t\tvalue: 'lower-roman',\n\t},\n];\n\nconst OrderedListSettings = ( { setAttributes, reversed, start, type } ) => {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t{ Platform.isNative ? (\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'List style' ) }\n\t\t\t\t\t\toptions={ LIST_STYLE_OPTIONS }\n\t\t\t\t\t\tvalue={ type }\n\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\tsetAttributes( { type: newValue } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Start value' ) }\n\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tconst int = parseInt( value, 10 );\n\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t// It should be possible to unset the value,\n\t\t\t\t\t\t\t\t// e.g. with an empty string.\n\t\t\t\t\t\t\t\tstart: isNaN( int ) ? undefined : int,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tNumber.isInteger( start )\n\t\t\t\t\t\t\t\t? start.toString( 10 )\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Reverse order' ) }\n\t\t\t\t\t\tchecked={ reversed || false }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t// Unset the attribute if not reversed.\n\t\t\t\t\t\t\t\treversed: value || undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) : (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttype: undefined,\n\t\t\t\t\t\t\tstart: undefined,\n\t\t\t\t\t\t\treversed: undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'List style' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! type }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\ttype: undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'List style' ) }\n\t\t\t\t\t\t\toptions={ LIST_STYLE_OPTIONS }\n\t\t\t\t\t\t\tvalue={ type || 'decimal' }\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { type: newValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Start value' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! start }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tstart: undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Start value' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tconst int = parseInt( value, 10 );\n\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t// It should be possible to unset the value,\n\t\t\t\t\t\t\t\t\t// e.g. with an empty string.\n\t\t\t\t\t\t\t\t\tstart: isNaN( int ) ? undefined : int,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tNumber.isInteger( start )\n\t\t\t\t\t\t\t\t\t? start.toString( 10 )\n\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Reverse order' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! reversed }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\treversed: undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Reverse order' ) }\n\t\t\t\t\t\t\tchecked={ reversed || false }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t// Unset the attribute if not reversed.\n\t\t\t\t\t\t\t\t\treversed: value || undefined,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t) }\n\t\t</InspectorControls>\n\t);\n};\n\nexport default OrderedListSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SACCC,WAAW,EACXC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,kBAAkB,GAAG,CAC1B;EACCC,KAAK,EAAEjB,EAAE,CAAE,SAAU,CAAC;EACtBkB,KAAK,EAAE;AACR,CAAC,EACD;EACCD,KAAK,EAAEjB,EAAE,CAAE,mBAAoB,CAAC;EAChCkB,KAAK,EAAE;AACR,CAAC,EACD;EACCD,KAAK,EAAEjB,EAAE,CAAE,mBAAoB,CAAC;EAChCkB,KAAK,EAAE;AACR,CAAC,EACD;EACCD,KAAK,EAAEjB,EAAE,CAAE,0BAA2B,CAAC;EACvCkB,KAAK,EAAE;A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
|
10
10
|
import { InspectorControls, useBlockProps, RecursionProvider, useHasRecursion, store as blockEditorStore, withColors, ContrastChecker, getColorClassName, Warning, __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients, useBlockEditingMode } from '@wordpress/block-editor';
|
|
11
11
|
import { EntityProvider, store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
13
|
-
import {
|
|
13
|
+
import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, __experimentalVStack as VStack, ToggleControl, Button, Spinner, Notice } from '@wordpress/components';
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
15
15
|
import { speak } from '@wordpress/a11y';
|
|
16
16
|
import { close, Icon } from '@wordpress/icons';
|
|
@@ -40,6 +40,7 @@ import DeletedNavigationWarning from './deleted-navigation-warning';
|
|
|
40
40
|
import AccessibleDescription from './accessible-description';
|
|
41
41
|
import AccessibleMenuDescription from './accessible-menu-description';
|
|
42
42
|
import { unlock } from '../../lock-unlock';
|
|
43
|
+
import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
|
|
43
44
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
44
45
|
function ColorTools({
|
|
45
46
|
textColor,
|
|
@@ -377,10 +378,21 @@ function Navigation({
|
|
|
377
378
|
isFirstRender.current = false;
|
|
378
379
|
}, [submenuAccessibilityNotice]);
|
|
379
380
|
const overlayMenuPreviewId = useInstanceId(OverlayMenuPreview, `overlay-menu-preview`);
|
|
381
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
380
382
|
const stylingInspectorControls = /*#__PURE__*/_jsxs(_Fragment, {
|
|
381
383
|
children: [/*#__PURE__*/_jsx(InspectorControls, {
|
|
382
|
-
children: hasSubmenuIndicatorSetting && /*#__PURE__*/_jsxs(
|
|
383
|
-
|
|
384
|
+
children: hasSubmenuIndicatorSetting && /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
385
|
+
label: __('Display'),
|
|
386
|
+
resetAll: () => {
|
|
387
|
+
setAttributes({
|
|
388
|
+
showSubmenuIcon: true,
|
|
389
|
+
openSubmenusOnClick: false,
|
|
390
|
+
overlayMenu: 'mobile',
|
|
391
|
+
hasIcon: true,
|
|
392
|
+
icon: 'handle'
|
|
393
|
+
});
|
|
394
|
+
},
|
|
395
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
384
396
|
children: [isResponsive && /*#__PURE__*/_jsxs(_Fragment, {
|
|
385
397
|
children: [/*#__PURE__*/_jsxs(Button, {
|
|
386
398
|
__next40pxDefaultSize: true,
|
|
@@ -404,68 +416,98 @@ function Navigation({
|
|
|
404
416
|
children: __('Close')
|
|
405
417
|
})]
|
|
406
418
|
})]
|
|
407
|
-
}), /*#__PURE__*/_jsx(
|
|
419
|
+
}), overlayMenuPreview && /*#__PURE__*/_jsx(VStack, {
|
|
408
420
|
id: overlayMenuPreviewId,
|
|
409
|
-
|
|
421
|
+
spacing: 4,
|
|
422
|
+
style: {
|
|
423
|
+
gridColumn: 'span 2'
|
|
424
|
+
},
|
|
425
|
+
children: /*#__PURE__*/_jsx(OverlayMenuPreview, {
|
|
410
426
|
setAttributes: setAttributes,
|
|
411
427
|
hasIcon: hasIcon,
|
|
412
428
|
icon: icon,
|
|
413
429
|
hidden: !overlayMenuPreview
|
|
414
430
|
})
|
|
415
431
|
})]
|
|
416
|
-
}), /*#__PURE__*/
|
|
417
|
-
|
|
418
|
-
__nextHasNoMarginBottom: true,
|
|
432
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
433
|
+
hasValue: () => overlayMenu !== 'mobile',
|
|
419
434
|
label: __('Overlay Menu'),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
help: __('Collapses the navigation options in a menu icon opening an overlay.'),
|
|
423
|
-
onChange: value => setAttributes({
|
|
424
|
-
overlayMenu: value
|
|
435
|
+
onDeselect: () => setAttributes({
|
|
436
|
+
overlayMenu: 'mobile'
|
|
425
437
|
}),
|
|
426
|
-
|
|
427
|
-
children:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
438
|
+
isShownByDefault: true,
|
|
439
|
+
children: /*#__PURE__*/_jsxs(ToggleGroupControl, {
|
|
440
|
+
__next40pxDefaultSize: true,
|
|
441
|
+
__nextHasNoMarginBottom: true,
|
|
442
|
+
label: __('Overlay Menu'),
|
|
443
|
+
"aria-label": __('Configure overlay menu'),
|
|
444
|
+
value: overlayMenu,
|
|
445
|
+
help: __('Collapses the navigation options in a menu icon opening an overlay.'),
|
|
446
|
+
onChange: value => setAttributes({
|
|
447
|
+
overlayMenu: value
|
|
448
|
+
}),
|
|
449
|
+
isBlock: true,
|
|
450
|
+
children: [/*#__PURE__*/_jsx(ToggleGroupControlOption, {
|
|
451
|
+
value: "never",
|
|
452
|
+
label: __('Off')
|
|
453
|
+
}), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
|
|
454
|
+
value: "mobile",
|
|
455
|
+
label: __('Mobile')
|
|
456
|
+
}), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
|
|
457
|
+
value: "always",
|
|
458
|
+
label: __('Always')
|
|
459
|
+
})]
|
|
460
|
+
})
|
|
437
461
|
}), hasSubmenus && /*#__PURE__*/_jsxs(_Fragment, {
|
|
438
462
|
children: [/*#__PURE__*/_jsx("h3", {
|
|
463
|
+
className: "wp-block-navigation__submenu-header",
|
|
439
464
|
children: __('Submenus')
|
|
440
|
-
}), /*#__PURE__*/_jsx(
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
465
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
466
|
+
hasValue: () => openSubmenusOnClick,
|
|
467
|
+
label: __('Open on click'),
|
|
468
|
+
onDeselect: () => setAttributes({
|
|
469
|
+
openSubmenusOnClick: false,
|
|
470
|
+
showSubmenuIcon: true
|
|
471
|
+
}),
|
|
472
|
+
isShownByDefault: true,
|
|
473
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
474
|
+
__nextHasNoMarginBottom: true,
|
|
475
|
+
checked: openSubmenusOnClick,
|
|
476
|
+
onChange: value => {
|
|
477
|
+
setAttributes({
|
|
478
|
+
openSubmenusOnClick: value,
|
|
479
|
+
...(value && {
|
|
480
|
+
showSubmenuIcon: true
|
|
481
|
+
}) // Make sure arrows are shown when we toggle this on.
|
|
482
|
+
});
|
|
483
|
+
},
|
|
484
|
+
label: __('Open on click')
|
|
485
|
+
})
|
|
486
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
487
|
+
hasValue: () => !showSubmenuIcon,
|
|
488
|
+
label: __('Show arrow'),
|
|
489
|
+
onDeselect: () => setAttributes({
|
|
490
|
+
showSubmenuIcon: true
|
|
491
|
+
}),
|
|
492
|
+
isDisabled: attributes.openSubmenusOnClick,
|
|
493
|
+
isShownByDefault: true,
|
|
494
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
495
|
+
__nextHasNoMarginBottom: true,
|
|
496
|
+
checked: showSubmenuIcon,
|
|
497
|
+
onChange: value => {
|
|
498
|
+
setAttributes({
|
|
499
|
+
showSubmenuIcon: value
|
|
500
|
+
});
|
|
501
|
+
},
|
|
502
|
+
disabled: attributes.openSubmenusOnClick,
|
|
503
|
+
label: __('Show arrow')
|
|
468
504
|
})
|
|
505
|
+
}), submenuAccessibilityNotice && /*#__PURE__*/_jsx(Notice, {
|
|
506
|
+
spokenMessage: null,
|
|
507
|
+
status: "warning",
|
|
508
|
+
isDismissible: false,
|
|
509
|
+
className: "wp-block-navigation__submenu-accessibility-notice",
|
|
510
|
+
children: submenuAccessibilityNotice
|
|
469
511
|
})]
|
|
470
512
|
})]
|
|
471
513
|
})
|