@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
|
@@ -10,7 +10,12 @@ import { __, _x } from '@wordpress/i18n';
|
|
|
10
10
|
import { useSelect } from '@wordpress/data';
|
|
11
11
|
import { AlignmentControl, BlockControls, InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
12
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
-
import {
|
|
13
|
+
import { ToggleControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* Renders the `core/comment-author-name` block on the editor.
|
|
@@ -38,6 +43,7 @@ export default function Edit({
|
|
|
38
43
|
},
|
|
39
44
|
setAttributes
|
|
40
45
|
}) {
|
|
46
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
41
47
|
const blockProps = useBlockProps({
|
|
42
48
|
className: clsx({
|
|
43
49
|
[`has-text-align-${textAlign}`]: textAlign
|
|
@@ -67,22 +73,45 @@ export default function Edit({
|
|
|
67
73
|
})
|
|
68
74
|
});
|
|
69
75
|
const inspectorControls = /*#__PURE__*/_jsx(InspectorControls, {
|
|
70
|
-
children: /*#__PURE__*/_jsxs(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
children: /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
77
|
+
label: __('Settings'),
|
|
78
|
+
resetAll: () => {
|
|
79
|
+
setAttributes({
|
|
80
|
+
isLink: true,
|
|
81
|
+
linkTarget: '_self'
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
85
|
+
children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
74
86
|
label: __('Link to authors URL'),
|
|
75
|
-
|
|
76
|
-
|
|
87
|
+
isShownByDefault: true,
|
|
88
|
+
hasValue: () => !isLink,
|
|
89
|
+
onDeselect: () => setAttributes({
|
|
90
|
+
isLink: true
|
|
77
91
|
}),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
92
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
93
|
+
__nextHasNoMarginBottom: true,
|
|
94
|
+
label: __('Link to authors URL'),
|
|
95
|
+
onChange: () => setAttributes({
|
|
96
|
+
isLink: !isLink
|
|
97
|
+
}),
|
|
98
|
+
checked: isLink
|
|
99
|
+
})
|
|
100
|
+
}), isLink && /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
81
101
|
label: __('Open in new tab'),
|
|
82
|
-
|
|
83
|
-
|
|
102
|
+
isShownByDefault: true,
|
|
103
|
+
hasValue: () => linkTarget !== '_self',
|
|
104
|
+
onDeselect: () => setAttributes({
|
|
105
|
+
linkTarget: '_self'
|
|
84
106
|
}),
|
|
85
|
-
|
|
107
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
108
|
+
__nextHasNoMarginBottom: true,
|
|
109
|
+
label: __('Open in new tab'),
|
|
110
|
+
onChange: value => setAttributes({
|
|
111
|
+
linkTarget: value ? '_blank' : '_self'
|
|
112
|
+
}),
|
|
113
|
+
checked: linkTarget === '_blank'
|
|
114
|
+
})
|
|
86
115
|
})]
|
|
87
116
|
})
|
|
88
117
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__","_x","useSelect","AlignmentControl","BlockControls","InspectorControls","useBlockProps","store","coreStore","
|
|
1
|
+
{"version":3,"names":["clsx","__","_x","useSelect","AlignmentControl","BlockControls","InspectorControls","useBlockProps","store","coreStore","ToggleControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","isLink","linkTarget","textAlign","context","commentId","setAttributes","dropdownMenuProps","blockProps","className","displayName","select","getEntityRecord","comment","authorName","author_name","_user$name","user","author","name","blockControls","group","children","value","onChange","newAlign","inspectorControls","label","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","checked","displayAuthor","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/comment-author-name/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n/**\n * Renders the `core/comment-author-name` block on the editor.\n *\n * @param {Object} props React props.\n * @param {Object} props.setAttributes Callback for updating block attributes.\n * @param {Object} props.attributes Block attributes.\n * @param {string} props.attributes.isLink Whether the author name should be linked.\n * @param {string} props.attributes.linkTarget Target of the link.\n * @param {string} props.attributes.textAlign Text alignment.\n * @param {Object} props.context Inherited context.\n * @param {string} props.context.commentId The comment ID.\n *\n * @return {JSX.Element} React element.\n */\nexport default function Edit( {\n\tattributes: { isLink, linkTarget, textAlign },\n\tcontext: { commentId },\n\tsetAttributes,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\tlet displayName = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\n\t\t\tconst comment = getEntityRecord( 'root', 'comment', commentId );\n\t\t\tconst authorName = comment?.author_name; // eslint-disable-line camelcase\n\n\t\t\tif ( comment && ! authorName ) {\n\t\t\t\tconst user = getEntityRecord( 'root', 'user', comment.author );\n\t\t\t\treturn user?.name ?? __( 'Anonymous' );\n\t\t\t}\n\t\t\treturn authorName ?? '';\n\t\t},\n\t\t[ commentId ]\n\t);\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tisLink: true,\n\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Link to authors URL' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => ! isLink }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisLink: true,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\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={ __( 'Link to authors URL' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t{ isLink && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => linkTarget !== '_self' }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tlinkTarget: '_self',\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={ __( 'Open in new tab' ) }\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\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\tif ( ! commentId || ! displayName ) {\n\t\tdisplayName = _x( 'Comment Author', 'block title' );\n\t}\n\n\tconst displayAuthor = isLink ? (\n\t\t<a\n\t\t\thref=\"#comment-author-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t>\n\t\t\t{ displayName }\n\t\t</a>\n\t) : (\n\t\tdisplayName\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t{ blockControls }\n\t\t\t<div { ...blockProps }>{ displayAuthor }</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,EACjBC,aAAa,QACP,yBAAyB;AAChC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,aAAa,EACbC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;;AAE9B;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAbA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAcA,eAAe,SAASC,IAAIA,CAAE;EAC7BC,UAAU,EAAE;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAU,CAAC;EAC7CC,OAAO,EAAE;IAAEC;EAAU,CAAC;EACtBC;AACD,CAAC,EAAG;EACH,MAAMC,iBAAiB,GAAGf,8BAA8B,CAAC,CAAC;EAC1D,MAAMgB,UAAU,GAAGxB,aAAa,CAAE;IACjCyB,SAAS,EAAEhC,IAAI,CAAE;MAChB,CAAE,kBAAmB0B,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KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;IAAAhB,QAAA,EAE7CZ;EAAW,CACX,CAAC,GAEJA,WACA;EACD,oBACCd,KAAA,CAAAE,SAAA;IAAAwB,QAAA,GACGI,iBAAiB,EACjBN,aAAa,eACf1B,IAAA;MAAA,GAAUc,UAAU;MAAAc,QAAA,EAAKY;IAAa,CAAO,CAAC;EAAA,CAC7C,CAAC;AAEL","ignoreList":[]}
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
import { useEntityProp } from '@wordpress/core-data';
|
|
5
5
|
import { dateI18n, humanTimeDiff, getSettings as getDateSettings } from '@wordpress/date';
|
|
6
6
|
import { InspectorControls, useBlockProps, __experimentalDateFormatPicker as DateFormatPicker } from '@wordpress/block-editor';
|
|
7
|
-
import {
|
|
7
|
+
import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, ToggleControl } from '@wordpress/components';
|
|
8
8
|
import { __, _x } from '@wordpress/i18n';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
14
|
+
|
|
10
15
|
/**
|
|
11
16
|
* Renders the `core/comment-date` block on the editor.
|
|
12
17
|
*
|
|
@@ -32,24 +37,48 @@ export default function Edit({
|
|
|
32
37
|
setAttributes
|
|
33
38
|
}) {
|
|
34
39
|
const blockProps = useBlockProps();
|
|
40
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
35
41
|
let [date] = useEntityProp('root', 'comment', 'date', commentId);
|
|
36
42
|
const [siteFormat = getDateSettings().formats.date] = useEntityProp('root', 'site', 'date_format');
|
|
37
43
|
const inspectorControls = /*#__PURE__*/_jsx(InspectorControls, {
|
|
38
|
-
children: /*#__PURE__*/_jsxs(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
children: /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
45
|
+
label: __('Settings'),
|
|
46
|
+
resetAll: () => {
|
|
47
|
+
setAttributes({
|
|
48
|
+
format: undefined,
|
|
49
|
+
isLink: true
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
53
|
+
children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
54
|
+
label: __('Date format'),
|
|
55
|
+
hasValue: () => format !== undefined,
|
|
56
|
+
onDeselect: () => setAttributes({
|
|
57
|
+
format: undefined
|
|
58
|
+
}),
|
|
59
|
+
isShownByDefault: true,
|
|
60
|
+
children: /*#__PURE__*/_jsx(DateFormatPicker, {
|
|
61
|
+
format: format,
|
|
62
|
+
defaultFormat: siteFormat,
|
|
63
|
+
onChange: nextFormat => setAttributes({
|
|
64
|
+
format: nextFormat
|
|
65
|
+
})
|
|
45
66
|
})
|
|
46
|
-
}), /*#__PURE__*/_jsx(
|
|
47
|
-
__nextHasNoMarginBottom: true,
|
|
67
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
48
68
|
label: __('Link to comment'),
|
|
49
|
-
|
|
50
|
-
|
|
69
|
+
hasValue: () => !isLink,
|
|
70
|
+
onDeselect: () => setAttributes({
|
|
71
|
+
isLink: true
|
|
51
72
|
}),
|
|
52
|
-
|
|
73
|
+
isShownByDefault: true,
|
|
74
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
75
|
+
__nextHasNoMarginBottom: true,
|
|
76
|
+
label: __('Link to comment'),
|
|
77
|
+
onChange: () => setAttributes({
|
|
78
|
+
isLink: !isLink
|
|
79
|
+
}),
|
|
80
|
+
checked: isLink
|
|
81
|
+
})
|
|
53
82
|
})]
|
|
54
83
|
})
|
|
55
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEntityProp","dateI18n","humanTimeDiff","getSettings","getDateSettings","InspectorControls","useBlockProps","__experimentalDateFormatPicker","DateFormatPicker","
|
|
1
|
+
{"version":3,"names":["useEntityProp","dateI18n","humanTimeDiff","getSettings","getDateSettings","InspectorControls","useBlockProps","__experimentalDateFormatPicker","DateFormatPicker","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","ToggleControl","__","_x","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","format","isLink","context","commentId","setAttributes","blockProps","dropdownMenuProps","date","siteFormat","formats","inspectorControls","children","label","resetAll","undefined","hasValue","onDeselect","isShownByDefault","defaultFormat","onChange","nextFormat","__nextHasNoMarginBottom","checked","commentDate","Date","dateTime","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/comment-date/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport {\n\tdateI18n,\n\thumanTimeDiff,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalDateFormatPicker as DateFormatPicker,\n} from '@wordpress/block-editor';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n/**\n * Renders the `core/comment-date` block on the editor.\n *\n * @param {Object} props React props.\n * @param {Object} props.setAttributes Callback for updating block attributes.\n * @param {Object} props.attributes Block attributes.\n * @param {string} props.attributes.format Format of the date.\n * @param {string} props.attributes.isLink Whether the author name should be linked.\n * @param {Object} props.context Inherited context.\n * @param {string} props.context.commentId The comment ID.\n *\n * @return {JSX.Element} React element.\n */\nexport default function Edit( {\n\tattributes: { format, isLink },\n\tcontext: { commentId },\n\tsetAttributes,\n} ) {\n\tconst blockProps = useBlockProps();\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tlet [ date ] = useEntityProp( 'root', 'comment', 'date', commentId );\n\tconst [ siteFormat = getDateSettings().formats.date ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'date_format'\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tformat: undefined,\n\t\t\t\t\t\tisLink: true,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Date format' ) }\n\t\t\t\t\thasValue={ () => format !== undefined }\n\t\t\t\t\tonDeselect={ () => setAttributes( { format: undefined } ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<DateFormatPicker\n\t\t\t\t\t\tformat={ format }\n\t\t\t\t\t\tdefaultFormat={ siteFormat }\n\t\t\t\t\t\tonChange={ ( nextFormat ) =>\n\t\t\t\t\t\t\tsetAttributes( { format: nextFormat } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Link to comment' ) }\n\t\t\t\t\thasValue={ () => ! isLink }\n\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: true } ) }\n\t\t\t\t\tisShownByDefault\n\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={ __( 'Link to comment' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\tif ( ! commentId || ! date ) {\n\t\tdate = _x( 'Comment Date', 'block title' );\n\t}\n\n\tlet commentDate =\n\t\tdate instanceof Date ? (\n\t\t\t<time dateTime={ dateI18n( 'c', date ) }>\n\t\t\t\t{ format === 'human-diff'\n\t\t\t\t\t? humanTimeDiff( date )\n\t\t\t\t\t: dateI18n( format || siteFormat, date ) }\n\t\t\t</time>\n\t\t) : (\n\t\t\t<time>{ date }</time>\n\t\t);\n\n\tif ( isLink ) {\n\t\tcommentDate = (\n\t\t\t<a\n\t\t\t\thref=\"#comment-date-pseudo-link\"\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ commentDate }\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...blockProps }>{ commentDate }</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SACCC,QAAQ,EACRC,aAAa,EACbC,WAAW,IAAIC,eAAe,QACxB,iBAAiB;AACxB,SACCC,iBAAiB,EACjBC,aAAa,EACbC,8BAA8B,IAAIC,gBAAgB,QAC5C,yBAAyB;AAChC,SACCC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,aAAa,QACP,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;;AAExC;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAaA,eAAe,SAASC,IAAIA,CAAE;EAC7BC,UAAU,EAAE;IAAEC,MAAM;IAAEC;EAAO,CAAC;EAC9BC,OAAO,EAAE;IAAEC;EAAU,CAAC;EACtBC;AACD,CAAC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
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { AlignmentControl, BlockControls, InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
10
|
-
import {
|
|
10
|
+
import { ToggleControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
12
17
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
18
|
export default function Edit({
|
|
14
19
|
attributes: {
|
|
@@ -22,6 +27,7 @@ export default function Edit({
|
|
|
22
27
|
[`has-text-align-${textAlign}`]: textAlign
|
|
23
28
|
})
|
|
24
29
|
});
|
|
30
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
25
31
|
const blockControls = /*#__PURE__*/_jsx(BlockControls, {
|
|
26
32
|
group: "block",
|
|
27
33
|
children: /*#__PURE__*/_jsx(AlignmentControl, {
|
|
@@ -32,15 +38,29 @@ export default function Edit({
|
|
|
32
38
|
})
|
|
33
39
|
});
|
|
34
40
|
const inspectorControls = /*#__PURE__*/_jsx(InspectorControls, {
|
|
35
|
-
children: /*#__PURE__*/_jsx(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
children: /*#__PURE__*/_jsx(ToolsPanel, {
|
|
42
|
+
label: __('Settings'),
|
|
43
|
+
resetAll: () => {
|
|
44
|
+
setAttributes({
|
|
45
|
+
linkTarget: '_self'
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
49
|
+
children: /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
39
50
|
label: __('Open in new tab'),
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
isShownByDefault: true,
|
|
52
|
+
hasValue: () => linkTarget === '_blank',
|
|
53
|
+
onDeselect: () => setAttributes({
|
|
54
|
+
linkTarget: '_self'
|
|
42
55
|
}),
|
|
43
|
-
|
|
56
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
57
|
+
__nextHasNoMarginBottom: true,
|
|
58
|
+
label: __('Open in new tab'),
|
|
59
|
+
onChange: value => setAttributes({
|
|
60
|
+
linkTarget: value ? '_blank' : '_self'
|
|
61
|
+
}),
|
|
62
|
+
checked: linkTarget === '_blank'
|
|
63
|
+
})
|
|
44
64
|
})
|
|
45
65
|
})
|
|
46
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","AlignmentControl","BlockControls","InspectorControls","useBlockProps","
|
|
1
|
+
{"version":3,"names":["clsx","AlignmentControl","BlockControls","InspectorControls","useBlockProps","ToggleControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","linkTarget","textAlign","setAttributes","blockProps","className","dropdownMenuProps","blockControls","group","children","value","onChange","newAlign","inspectorControls","label","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","checked","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/comment-edit-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function Edit( {\n\tattributes: { linkTarget, textAlign },\n\tsetAttributes,\n} ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => linkTarget === '_blank' }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t}\n\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={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<a\n\t\t\t\t\thref=\"#edit-comment-pseudo-link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,EACjBC,aAAa,QACP,yBAAyB;AAChC,SACCC,aAAa,EACbC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,eAAe,SAASC,IAAIA,CAAE;EAC7BC,UAAU,EAAE;IAAEC,UAAU;IAAEC;EAAU,CAAC;EACrCC;AACD,CAAC,EAAG;EACH,MAAMC,UAAU,GAAGnB,aAAa,CAAE;IACjCoB,SAAS,EAAExB,IAAI,CAAE;MAChB,CAAE,kBAAmBqB,SAAS,EAAG,GAAIA;IACtC,CAAE;EACH,CAAE,CAAC;EAEH,MAAMI,iBAAiB,GAAGd,8BAA8B,CAAC,CAAC;EAE1D,MAAMe,aAAa,gBAClBb,IAAA,CAACX,aAAa;IAACyB,KAAK,EAAC,OAAO;IAAAC,QAAA,eAC3Bf,IAAA,CAACZ,gBAAgB;MAChB4B,KAAK,EAAGR,SAAW;MACnBS,QAAQ,EAAKC,QAAQ,IACpBT,aAAa,CAAE;QAAED,SAAS,EAAEU;MAAS,CAAE;IACvC,CACD;EAAC,CACY,CACf;EACD,MAAMC,iBAAiB,gBACtBnB,IAAA,CAACV,iBAAiB;IAAAyB,QAAA,eACjBf,IAAA,CAACN,UAAU;MACV0B,KAAK,EAAGvB,EAAE,CAAE,UAAW,CAAG;MAC1BwB,QAAQ,EAAGA,CAAA,KAAM;QAChBZ,aAAa,CAAE;UACdF,UAAU,EAAE;QACb,CAAE,CAAC;MACJ,CAAG;MACHK,iBAAiB,EAAGA,iBAAmB;MAAAG,QAAA,eAEvCf,IAAA,CAACJ,cAAc;QACdwB,KAAK,EAAGvB,EAAE,CAAE,iBAAkB,CAAG;QACjCyB,gBAAgB;QAChBC,QAAQ,EAAGA,CAAA,KAAMhB,UAAU,KAAK,QAAU;QAC1CiB,UAAU,EAAGA,CAAA,KACZf,aAAa,CAAE;UAAEF,UAAU,EAAE;QAAQ,CAAE,CACvC;QAAAQ,QAAA,eAEDf,IAAA,CAACR,aAAa;UACbiC,uBAAuB;UACvBL,KAAK,EAAGvB,EAAE,CAAE,iBAAkB,CAAG;UACjCoB,QAAQ,EAAKD,KAAK,IACjBP,aAAa,CAAE;YACdF,UAAU,EAAES,KAAK,GAAG,QAAQ,GAAG;UAChC,CAAE,CACF;UACDU,OAAO,EAAGnB,UAAU,KAAK;QAAU,CACnC;MAAC,CACa;IAAC,CACN;EAAC,CACK,CACnB;EAED,oBACCH,KAAA,CAAAF,SAAA;IAAAa,QAAA,GACGF,aAAa,EACbM,iBAAiB,eACnBnB,IAAA;MAAA,GAAUU,UAAU;MAAAK,QAAA,eACnBf,IAAA;QACC2B,IAAI,EAAC,2BAA2B;QAChCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAAf,QAAA,EAE7ClB,EAAE,CAAE,MAAO;MAAC,CACZ;IAAC,CACA,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
@@ -16,8 +16,7 @@ export default function CommentsInspectorControls({
|
|
|
16
16
|
attributes: {
|
|
17
17
|
tagName
|
|
18
18
|
},
|
|
19
|
-
setAttributes
|
|
20
|
-
clientId
|
|
19
|
+
setAttributes
|
|
21
20
|
}) {
|
|
22
21
|
return /*#__PURE__*/_jsx(InspectorControls, {
|
|
23
22
|
children: /*#__PURE__*/_jsx(InspectorControls, {
|
|
@@ -27,7 +26,6 @@ export default function CommentsInspectorControls({
|
|
|
27
26
|
onChange: value => setAttributes({
|
|
28
27
|
tagName: value
|
|
29
28
|
}),
|
|
30
|
-
clientId: clientId,
|
|
31
29
|
options: [{
|
|
32
30
|
label: __('Default (<div>)'),
|
|
33
31
|
value: 'div'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","InspectorControls","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","HTMLElementControl","CommentsInspectorControls","attributes","tagName","setAttributes","
|
|
1
|
+
{"version":3,"names":["__","InspectorControls","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","HTMLElementControl","CommentsInspectorControls","attributes","tagName","setAttributes","children","group","onChange","value","options","label"],"sources":["@wordpress/block-library/src/comments/edit/comments-inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nexport default function CommentsInspectorControls( {\n\tattributes: { tagName },\n\tsetAttributes,\n} ) {\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</InspectorControls>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;;AAEhC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAmB,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAE/D,eAAe,SAASK,yBAAyBA,CAAE;EAClDC,UAAU,EAAE;IAAEC;EAAQ,CAAC;EACvBC;AACD,CAAC,EAAG;EACH,oBACCL,IAAA,CAACL,iBAAiB;IAAAW,QAAA,eACjBN,IAAA,CAACL,iBAAiB;MAACY,KAAK,EAAC,UAAU;MAAAD,QAAA,eAClCN,IAAA,CAACC,kBAAkB;QAClBG,OAAO,EAAGA,OAAS;QACnBI,QAAQ,EAAKC,KAAK,IACjBJ,aAAa,CAAE;UAAED,OAAO,EAAEK;QAAM,CAAE,CAClC;QACDC,OAAO,EAAG,CACT;UAAEC,KAAK,EAAEjB,EAAE,CAAE,iBAAkB,CAAC;UAAEe,KAAK,EAAE;QAAM,CAAC,EAChD;UAAEE,KAAK,EAAE,WAAW;UAAEF,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEE,KAAK,EAAE,SAAS;UAAEF,KAAK,EAAE;QAAQ,CAAC;MAClC,CACH;IAAC,CACgB;EAAC,CACF,CAAC;AAEtB","ignoreList":[]}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { InspectorControls, useBlockProps, useInnerBlocksProps, store as blockEditorStore, Warning } from '@wordpress/block-editor';
|
|
6
6
|
import { useSelect } from '@wordpress/data';
|
|
7
|
-
import {
|
|
7
|
+
import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { CommentsPaginationArrowControls } from './comments-pagination-arrow-controls';
|
|
13
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
13
14
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
const TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
|
|
15
16
|
export default function QueryPaginationEdit({
|
|
@@ -34,6 +35,7 @@ export default function QueryPaginationEdit({
|
|
|
34
35
|
});
|
|
35
36
|
}, []);
|
|
36
37
|
const blockProps = useBlockProps();
|
|
38
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
37
39
|
const innerBlocksProps = useInnerBlocksProps(blockProps, {
|
|
38
40
|
template: TEMPLATE
|
|
39
41
|
});
|
|
@@ -59,15 +61,27 @@ export default function QueryPaginationEdit({
|
|
|
59
61
|
}
|
|
60
62
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
61
63
|
children: [hasNextPreviousBlocks && /*#__PURE__*/_jsx(InspectorControls, {
|
|
62
|
-
children: /*#__PURE__*/_jsx(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
children: /*#__PURE__*/_jsx(ToolsPanel, {
|
|
65
|
+
label: __('Settings'),
|
|
66
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
67
|
+
resetAll: () => setAttributes({
|
|
68
|
+
paginationArrow: 'none'
|
|
69
|
+
}),
|
|
70
|
+
children: /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
71
|
+
label: __('Arrow'),
|
|
72
|
+
hasValue: () => paginationArrow !== 'none',
|
|
73
|
+
onDeselect: () => setAttributes({
|
|
74
|
+
paginationArrow: 'none'
|
|
75
|
+
}),
|
|
76
|
+
isShownByDefault: true,
|
|
77
|
+
children: /*#__PURE__*/_jsx(CommentsPaginationArrowControls, {
|
|
78
|
+
value: paginationArrow,
|
|
79
|
+
onChange: value => {
|
|
80
|
+
setAttributes({
|
|
81
|
+
paginationArrow: value
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
})
|
|
71
85
|
})
|
|
72
86
|
})
|
|
73
87
|
}), /*#__PURE__*/_jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","InspectorControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","Warning","useSelect","
|
|
1
|
+
{"version":3,"names":["__","InspectorControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","Warning","useSelect","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","CommentsPaginationArrowControls","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TEMPLATE","QueryPaginationEdit","attributes","paginationArrow","setAttributes","clientId","hasNextPreviousBlocks","select","getBlocks","innerBlocks","find","innerBlock","includes","name","blockProps","dropdownMenuProps","innerBlocksProps","template","pageComments","getSettings","__experimentalDiscussionSettings","children","label","resetAll","hasValue","onDeselect","isShownByDefault","value","onChange"],"sources":["@wordpress/block-library/src/comments-pagination/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\tWarning,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { CommentsPaginationArrowControls } from './comments-pagination-arrow-controls';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst TEMPLATE = [\n\t[ 'core/comments-pagination-previous' ],\n\t[ 'core/comments-pagination-numbers' ],\n\t[ 'core/comments-pagination-next' ],\n];\n\nexport default function QueryPaginationEdit( {\n\tattributes: { paginationArrow },\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst hasNextPreviousBlocks = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst innerBlocks = getBlocks( clientId );\n\t\t/**\n\t\t * Show the `paginationArrow` control only if a\n\t\t * Comments Pagination Next or Comments Pagination Previous\n\t\t * block exists.\n\t\t */\n\t\treturn innerBlocks?.find( ( innerBlock ) => {\n\t\t\treturn [\n\t\t\t\t'core/comments-pagination-previous',\n\t\t\t\t'core/comments-pagination-next',\n\t\t\t].includes( innerBlock.name );\n\t\t} );\n\t}, [] );\n\n\tconst blockProps = useBlockProps();\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\t// Get the Discussion settings\n\tconst pageComments = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings?.pageComments;\n\t}, [] );\n\n\t// If paging comments is not enabled in the Discussion Settings then hide the pagination\n\t// controls. We don't want to remove them from the template so that when the user enables\n\t// paging comments, the controls will be visible.\n\tif ( ! pageComments ) {\n\t\treturn (\n\t\t\t<Warning>\n\t\t\t\t{ __(\n\t\t\t\t\t'Comments Pagination block: paging comments is disabled in the Discussion Settings'\n\t\t\t\t) }\n\t\t\t</Warning>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ hasNextPreviousBlocks && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t\tresetAll={ () =>\n\t\t\t\t\t\t\tsetAttributes( { paginationArrow: 'none' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\t\thasValue={ () => paginationArrow !== 'none' }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { paginationArrow: 'none' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CommentsPaginationArrowControls\n\t\t\t\t\t\t\t\tvalue={ paginationArrow }\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { paginationArrow: value } );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,aAAa,EACbC,mBAAmB,EACnBC,KAAK,IAAIC,gBAAgB,EACzBC,OAAO,QACD,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;;AAE9B;AACA;AACA;AACA,SAASC,+BAA+B,QAAQ,sCAAsC;AACtF,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,QAAQ,GAAG,CAChB,CAAE,mCAAmC,CAAE,EACvC,CAAE,kCAAkC,CAAE,EACtC,CAAE,+BAA+B,CAAE,CACnC;AAED,eAAe,SAASC,mBAAmBA,CAAE;EAC5CC,UAAU,EAAE;IAAEC;EAA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AAGA,iBAAmB;QACvCQ,QAAQ,EAAGA,CAAA,KACVnB,aAAa,CAAE;UAAED,eAAe,EAAE;QAAO,CAAE,CAC3C;QAAAkB,QAAA,eAED1B,IAAA,CAACJ,cAAc;UACd+B,KAAK,EAAG1C,EAAE,CAAE,OAAQ,CAAG;UACvB4C,QAAQ,EAAGA,CAAA,KAAMrB,eAAe,KAAK,MAAQ;UAC7CsB,UAAU,EAAGA,CAAA,KACZrB,aAAa,CAAE;YAAED,eAAe,EAAE;UAAO,CAAE,CAC3C;UACDuB,gBAAgB;UAAAL,QAAA,eAEhB1B,IAAA,CAACH,+BAA+B;YAC/BmC,KAAK,EAAGxB,eAAiB;YACzByB,QAAQ,EAAKD,KAAK,IAAM;cACvBvB,aAAa,CAAE;gBAAED,eAAe,EAAEwB;cAAM,CAAE,CAAC;YAC5C;UAAG,CACH;QAAC,CACa;MAAC,CACN;IAAC,CACK,CACnB,eACDhC,IAAA;MAAA,GAAUqB;IAAgB,CAAI,CAAC;EAAA,CAC9B,CAAC;AAEL","ignoreList":[]}
|
|
@@ -9,11 +9,16 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { AlignmentControl, BlockControls, useBlockProps, InspectorControls, store as blockEditorStore, HeadingLevelDropdown } from '@wordpress/block-editor';
|
|
10
10
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
11
11
|
import { useEntityProp } from '@wordpress/core-data';
|
|
12
|
-
import {
|
|
12
|
+
import { ToggleControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
|
|
13
13
|
import { useState, useEffect } from '@wordpress/element';
|
|
14
14
|
import { useSelect } from '@wordpress/data';
|
|
15
15
|
import apiFetch from '@wordpress/api-fetch';
|
|
16
16
|
import { addQueryArgs } from '@wordpress/url';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
17
22
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
23
|
export default function Edit({
|
|
19
24
|
attributes: {
|
|
@@ -49,6 +54,7 @@ export default function Edit({
|
|
|
49
54
|
} = select(blockEditorStore);
|
|
50
55
|
return getSettings().__experimentalDiscussionSettings;
|
|
51
56
|
});
|
|
57
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
52
58
|
useEffect(() => {
|
|
53
59
|
if (isSiteEditor) {
|
|
54
60
|
// Match the number of comments that will be shown in the comment-template/edit.js placeholder
|
|
@@ -92,21 +98,44 @@ export default function Edit({
|
|
|
92
98
|
})]
|
|
93
99
|
});
|
|
94
100
|
const inspectorControls = /*#__PURE__*/_jsx(InspectorControls, {
|
|
95
|
-
children: /*#__PURE__*/_jsxs(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
children: /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
102
|
+
label: __('Settings'),
|
|
103
|
+
resetAll: () => {
|
|
104
|
+
setAttributes({
|
|
105
|
+
showPostTitle: true,
|
|
106
|
+
showCommentsCount: true
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
110
|
+
children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
99
111
|
label: __('Show post title'),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
isShownByDefault: true,
|
|
113
|
+
hasValue: () => !showPostTitle,
|
|
114
|
+
onDeselect: () => setAttributes({
|
|
115
|
+
showPostTitle: true
|
|
116
|
+
}),
|
|
117
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
118
|
+
__nextHasNoMarginBottom: true,
|
|
119
|
+
label: __('Show post title'),
|
|
120
|
+
checked: showPostTitle,
|
|
121
|
+
onChange: value => setAttributes({
|
|
122
|
+
showPostTitle: value
|
|
123
|
+
})
|
|
103
124
|
})
|
|
104
|
-
}), /*#__PURE__*/_jsx(
|
|
105
|
-
__nextHasNoMarginBottom: true,
|
|
125
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
106
126
|
label: __('Show comments count'),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
127
|
+
isShownByDefault: true,
|
|
128
|
+
hasValue: () => !showCommentsCount,
|
|
129
|
+
onDeselect: () => setAttributes({
|
|
130
|
+
showCommentsCount: true
|
|
131
|
+
}),
|
|
132
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
133
|
+
__nextHasNoMarginBottom: true,
|
|
134
|
+
label: __('Show comments count'),
|
|
135
|
+
checked: showCommentsCount,
|
|
136
|
+
onChange: value => setAttributes({
|
|
137
|
+
showCommentsCount: value
|
|
138
|
+
})
|
|
110
139
|
})
|
|
111
140
|
})]
|
|
112
141
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","AlignmentControl","BlockControls","useBlockProps","InspectorControls","store","blockEditorStore","HeadingLevelDropdown","__","_n","sprintf","useEntityProp","PanelBody","ToggleControl","useState","useEffect","useSelect","apiFetch","addQueryArgs","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","textAlign","showPostTitle","showCommentsCount","level","levelOptions","setAttributes","context","postType","postId","TagName","commentsCount","setCommentsCount","rawTitle","isSiteEditor","blockProps","className","threadCommentsDepth","threadComments","commentsPerPage","pageComments","select","getSettings","__experimentalDiscussionSettings","nestedCommentsNumber","Math","min","topLevelCommentsNumber","commentsNumber","parseInt","currentPostId","path","post","_fields","method","parse","then","res","headers","get","catch","blockControls","group","children","value","onChange","newAlign","options","newLevel","inspectorControls","title","__nextHasNoMarginBottom","label","checked","postTitle","placeholder","undefined"],"sources":["@wordpress/block-library/src/comments-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\nexport default function Edit( {\n\tattributes: {\n\t\ttextAlign,\n\t\tshowPostTitle,\n\t\tshowCommentsCount,\n\t\tlevel,\n\t\tlevelOptions,\n\t},\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tconst TagName = 'h' + level;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst [ rawTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tconst isSiteEditor = typeof postId === 'undefined';\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst {\n\t\tthreadCommentsDepth,\n\t\tthreadComments,\n\t\tcommentsPerPage,\n\t\tpageComments,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalDiscussionSettings;\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( isSiteEditor ) {\n\t\t\t// Match the number of comments that will be shown in the comment-template/edit.js placeholder\n\n\t\t\tconst nestedCommentsNumber = threadComments\n\t\t\t\t? Math.min( threadCommentsDepth, 3 ) - 1\n\t\t\t\t: 0;\n\t\t\tconst topLevelCommentsNumber = pageComments ? commentsPerPage : 3;\n\n\t\t\tconst commentsNumber =\n\t\t\t\tparseInt( nestedCommentsNumber ) +\n\t\t\t\tparseInt( topLevelCommentsNumber );\n\n\t\t\tsetCommentsCount( Math.min( commentsNumber, 3 ) );\n\t\t\treturn;\n\t\t}\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t\t_fields: 'id',\n\t\t\t} ),\n\t\t\tmethod: 'HEAD',\n\t\t\tparse: false,\n\t\t} )\n\t\t\t.then( ( res ) => {\n\t\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\t\tif ( currentPostId === postId ) {\n\t\t\t\t\tsetCommentsCount(\n\t\t\t\t\t\tparseInt( res.headers.get( 'X-WP-Total' ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tsetCommentsCount( 0 );\n\t\t\t} );\n\t}, [ postId ] );\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<HeadingLevelDropdown\n\t\t\t\tvalue={ level }\n\t\t\t\toptions={ levelOptions }\n\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show post title' ) }\n\t\t\t\t\tchecked={ showPostTitle }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showPostTitle: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show comments count' ) }\n\t\t\t\t\tchecked={ showCommentsCount }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showCommentsCount: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tconst postTitle = isSiteEditor ? __( '“Post Title”' ) : `\"${ rawTitle }\"`;\n\n\tlet placeholder;\n\tif ( showCommentsCount && commentsCount !== undefined ) {\n\t\tif ( showPostTitle ) {\n\t\t\tif ( commentsCount === 1 ) {\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tplaceholder = sprintf( __( 'One response to %s' ), postTitle );\n\t\t\t} else {\n\t\t\t\tplaceholder = sprintf(\n\t\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%1$s response to %2$s',\n\t\t\t\t\t\t'%1$s responses to %2$s',\n\t\t\t\t\t\tcommentsCount\n\t\t\t\t\t),\n\t\t\t\t\tcommentsCount,\n\t\t\t\t\tpostTitle\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( commentsCount === 1 ) {\n\t\t\tplaceholder = __( 'One response' );\n\t\t} else {\n\t\t\tplaceholder = sprintf(\n\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t_n( '%s response', '%s responses', commentsCount ),\n\t\t\t\tcommentsCount\n\t\t\t);\n\t\t}\n\t} else if ( showPostTitle ) {\n\t\tif ( commentsCount === 1 ) {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Response to %s' ), postTitle );\n\t\t} else {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Responses to %s' ), postTitle );\n\t\t}\n\t} else if ( commentsCount === 1 ) {\n\t\tplaceholder = __( 'Response' );\n\t} else {\n\t\tplaceholder = __( 'Responses' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName { ...blockProps }>{ placeholder }</TagName>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM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EF,EAAE,CAAE,oBAAqB,CAAC,EAAEwE,SAAU,CAAC;MAC/D,CAAC,MAAM;QACNC,WAAW,GAAGvE,OAAO,CACpB;QACAD,EAAE,CACD,uBAAuB,EACvB,wBAAwB,EACxB4B,aACD,CAAC,EACDA,aAAa,EACb2C,SACD,CAAC;MACF;IACD,CAAC,MAAM,IAAK3C,aAAa,KAAK,CAAC,EAAG;MACjC4C,WAAW,GAAGzE,EAAE,CAAE,cAAe,CAAC;IACnC,CAAC,MAAM;MACNyE,WAAW,GAAGvE,OAAO,CACpB;MACAD,EAAE,CAAE,aAAa,EAAE,cAAc,EAAE4B,aAAc,CAAC,EAClDA,aACD,CAAC;IACF;EACD,CAAC,MAAM,IAAKT,aAAa,EAAG;IAC3B,IAAKS,aAAa,KAAK,CAAC,EAAG;MAC1B;MACA4C,WAAW,GAAGvE,OAAO,CAAEF,EAAE,CAAE,gBAAiB,CAAC,EAAEwE,SAAU,CAAC;IAC3D,CAAC,MAAM;MACN;MACAC,WAAW,GAAGvE,OAAO,CAAEF,EAAE,CAAE,iBAAkB,CAAC,EAAEwE,SAAU,CAAC;IAC5D;EACD,CAAC,MAAM,IAAK3C,aAAa,KAAK,CAAC,EAAG;IACjC4C,WAAW,GAAGzE,EAAE,CAAE,UAAW,CAAC;EAC/B,CAAC,MAAM;IACNyE,WAAW,GAAGzE,EAAE,CAAE,WAAY,CAAC;EAChC;EAEA,oBACCc,KAAA,CAAAE,SAAA;IAAA6C,QAAA,GACGF,aAAa,EACbQ,iBAAiB,eACnBvD,IAAA,CAACgB,OAAO;MAAA,GAAMK,UAAU;MAAA4B,QAAA,EAAKY;IAAW,CAAW,CAAC;EAAA,CACnD,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","AlignmentControl","BlockControls","useBlockProps","InspectorControls","store","blockEditorStore","HeadingLevelDropdown","__","_n","sprintf","useEntityProp","ToggleControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useState","useEffect","useSelect","apiFetch","addQueryArgs","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","textAlign","showPostTitle","showCommentsCount","level","levelOptions","setAttributes","context","postType","postId","TagName","commentsCount","setCommentsCount","rawTitle","isSiteEditor","blockProps","className","threadCommentsDepth","threadComments","commentsPerPage","pageComments","select","getSettings","__experimentalDiscussionSettings","dropdownMenuProps","nestedCommentsNumber","Math","min","topLevelCommentsNumber","commentsNumber","parseInt","currentPostId","path","post","_fields","method","parse","then","res","headers","get","catch","blockControls","group","children","value","onChange","newAlign","options","newLevel","inspectorControls","label","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","checked","postTitle","placeholder","undefined"],"sources":["@wordpress/block-library/src/comments-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEntityProp } from '@wordpress/core-data';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function Edit( {\n\tattributes: {\n\t\ttextAlign,\n\t\tshowPostTitle,\n\t\tshowCommentsCount,\n\t\tlevel,\n\t\tlevelOptions,\n\t},\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tconst TagName = 'h' + level;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst [ rawTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tconst isSiteEditor = typeof postId === 'undefined';\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst {\n\t\tthreadCommentsDepth,\n\t\tthreadComments,\n\t\tcommentsPerPage,\n\t\tpageComments,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalDiscussionSettings;\n\t} );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tuseEffect( () => {\n\t\tif ( isSiteEditor ) {\n\t\t\t// Match the number of comments that will be shown in the comment-template/edit.js placeholder\n\n\t\t\tconst nestedCommentsNumber = threadComments\n\t\t\t\t? Math.min( threadCommentsDepth, 3 ) - 1\n\t\t\t\t: 0;\n\t\t\tconst topLevelCommentsNumber = pageComments ? commentsPerPage : 3;\n\n\t\t\tconst commentsNumber =\n\t\t\t\tparseInt( nestedCommentsNumber ) +\n\t\t\t\tparseInt( topLevelCommentsNumber );\n\n\t\t\tsetCommentsCount( Math.min( commentsNumber, 3 ) );\n\t\t\treturn;\n\t\t}\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t\t_fields: 'id',\n\t\t\t} ),\n\t\t\tmethod: 'HEAD',\n\t\t\tparse: false,\n\t\t} )\n\t\t\t.then( ( res ) => {\n\t\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\t\tif ( currentPostId === postId ) {\n\t\t\t\t\tsetCommentsCount(\n\t\t\t\t\t\tparseInt( res.headers.get( 'X-WP-Total' ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tsetCommentsCount( 0 );\n\t\t\t} );\n\t}, [ postId ] );\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<HeadingLevelDropdown\n\t\t\t\tvalue={ level }\n\t\t\t\toptions={ levelOptions }\n\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tshowPostTitle: true,\n\t\t\t\t\t\tshowCommentsCount: true,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Show post title' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => ! showPostTitle }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { showPostTitle: true } )\n\t\t\t\t\t}\n\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={ __( 'Show post title' ) }\n\t\t\t\t\t\tchecked={ showPostTitle }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { showPostTitle: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Show comments count' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => ! showCommentsCount }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { showCommentsCount: true } )\n\t\t\t\t\t}\n\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={ __( 'Show comments count' ) }\n\t\t\t\t\t\tchecked={ showCommentsCount }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { showCommentsCount: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\tconst postTitle = isSiteEditor ? __( '“Post Title”' ) : `\"${ rawTitle }\"`;\n\n\tlet placeholder;\n\tif ( showCommentsCount && commentsCount !== undefined ) {\n\t\tif ( showPostTitle ) {\n\t\t\tif ( commentsCount === 1 ) {\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tplaceholder = sprintf( __( 'One response to %s' ), postTitle );\n\t\t\t} else {\n\t\t\t\tplaceholder = sprintf(\n\t\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%1$s response to %2$s',\n\t\t\t\t\t\t'%1$s responses to %2$s',\n\t\t\t\t\t\tcommentsCount\n\t\t\t\t\t),\n\t\t\t\t\tcommentsCount,\n\t\t\t\t\tpostTitle\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( commentsCount === 1 ) {\n\t\t\tplaceholder = __( 'One response' );\n\t\t} else {\n\t\t\tplaceholder = sprintf(\n\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t_n( '%s response', '%s responses', commentsCount ),\n\t\t\t\tcommentsCount\n\t\t\t);\n\t\t}\n\t} else if ( showPostTitle ) {\n\t\tif ( commentsCount === 1 ) {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Response to %s' ), postTitle );\n\t\t} else {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Responses to %s' ), postTitle );\n\t\t}\n\t} else if ( commentsCount === 1 ) {\n\t\tplaceholder = __( 'Response' );\n\t} else {\n\t\tplaceholder = __( 'Responses' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName { ...blockProps }>{ placeholder }</TagName>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,aAAa,EACbC,aAAa,EACbC,iBAAiB,EACjBC,KAAK,IAAIC,gBAAgB,EACzBC,oBAAoB,QACd,yBAAyB;AAChC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SACCC,aAAa,EACbC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEhE,eAAe,SAASC,IAAIA,CAAE;EAC7BC,UAAU,EAAE;IACXC,SAAS;IACTC,aAAa;IACbC,iBAAiB;IACjBC,KAAK;IACLC;EACD,CAAC;EACDC,aAAa;EACbC,OAAO,EAAE;IAAEC,QAAQ;IAAEC;EAAO;AAC7B,CAAC,EAAG;EACH,MAAMC,OAAO,GAAG,GAAG,GAAGN,KAAK;EAC3B,MAAM,CAAEO,aAAa,EAAEC,gBAAgB,CAAE,GAAGzB,QAAQ,CAAC,CAAC;EACtD,MAAM,CAAE0B,QAAQ,CAAE,G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