@wordpress/block-library 8.18.1-next.5a1d1283.0 → 8.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/build/block/edit.js +53 -2
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +7 -4
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +11 -2
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +10 -4
- package/build/button/save.js.map +1 -1
- package/build/buttons/edit.js +12 -3
- package/build/buttons/edit.js.map +1 -1
- package/build/code/edit.js +8 -2
- package/build/code/edit.js.map +1 -1
- package/build/code/index.js +7 -1
- package/build/code/index.js.map +1 -1
- package/build/column/index.js +1 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/index.js +2 -0
- package/build/columns/index.js.map +1 -1
- package/build/file/edit.native.js +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/index.js +2 -1
- package/build/file/index.js.map +1 -1
- package/build/file/utils/index.js +1 -15
- package/build/file/utils/index.js.map +1 -1
- package/build/file/view.js +14 -1
- package/build/file/view.js.map +1 -1
- package/build/footnotes/edit.js +12 -2
- package/build/footnotes/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/group/edit.js +0 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +4 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/edit.js +0 -1
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +2 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +3 -6
- package/build/heading/transforms.js.map +1 -1
- package/build/image/deprecated.js +191 -7
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +27 -12
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +75 -40
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -4
- package/build/image/index.js.map +1 -1
- package/build/image/{view-interactivity.js → view.js} +1 -1
- package/build/image/view.js.map +1 -0
- package/build/list/deprecated.js +93 -1
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +10 -10
- package/build/list/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +10 -10
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list/save.js +4 -2
- package/build/list/save.js.map +1 -1
- package/build/list/utils.js +21 -2
- package/build/list/utils.js.map +1 -1
- package/build/navigation/constants.js +1 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/index.js +4 -2
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/view.js +168 -82
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +3 -9
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/transforms.js +24 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/page-list/edit.js +2 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +10 -2
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +5 -3
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-content/edit.js +8 -7
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-featured-image/overlay.js +2 -1
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/preformatted/edit.js +4 -1
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/index.js +1 -1
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/deprecated.js +6 -7
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +56 -0
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -0
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +42 -0
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
- package/build/query/edit/inspector-controls/index.js +8 -25
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-content.js +8 -2
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/utils.js +19 -0
- package/build/query/utils.js.map +1 -1
- package/build/query/view.js +4 -5
- package/build/query/view.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/search/view.js +81 -150
- package/build/search/view.js.map +1 -1
- package/build/social-link/edit.native.js +3 -1
- package/build/social-link/edit.native.js.map +1 -1
- package/build/table/edit.js +7 -7
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +2 -130
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/hooks.js +145 -0
- package/build/table-of-contents/hooks.js.map +1 -0
- package/build/table-of-contents/index.js +2 -1
- package/build/table-of-contents/index.js.map +1 -1
- package/build/verse/edit.js +4 -1
- package/build/verse/edit.js.map +1 -1
- package/build/verse/index.js +1 -1
- package/build/verse/index.js.map +1 -1
- package/build-module/block/edit.js +54 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +7 -4
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +11 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +10 -4
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/edit.js +12 -3
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/code/edit.js +8 -2
- package/build-module/code/edit.js.map +1 -1
- package/build-module/code/index.js +7 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/index.js +1 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/index.js +2 -0
- package/build-module/columns/index.js.map +1 -1
- package/build-module/file/edit.native.js +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/index.js +2 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/utils/index.js +0 -13
- package/build-module/file/utils/index.js.map +1 -1
- package/build-module/file/view.js +14 -2
- package/build-module/file/view.js.map +1 -1
- package/build-module/footnotes/edit.js +12 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/group/edit.js +0 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +4 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/edit.js +0 -1
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +2 -0
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +3 -6
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +191 -7
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +27 -12
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +77 -42
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -4
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/{view-interactivity.js → view.js} +1 -1
- package/build-module/image/view.js.map +1 -0
- package/build-module/list/deprecated.js +95 -3
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +10 -10
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +10 -10
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list/save.js +4 -2
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/utils.js +20 -2
- package/build-module/list/utils.js.map +1 -1
- package/build-module/navigation/constants.js +1 -1
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/index.js +4 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/view.js +168 -83
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +3 -9
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/transforms.js +24 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/page-list/edit.js +2 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +10 -2
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +5 -3
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-content/edit.js +8 -7
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +2 -1
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/preformatted/edit.js +4 -1
- package/build-module/preformatted/edit.js.map +1 -1
- package/build-module/preformatted/index.js +1 -1
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +6 -7
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +50 -0
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -0
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +35 -0
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
- package/build-module/query/edit/inspector-controls/index.js +9 -26
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +8 -2
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/utils.js +17 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/view.js +4 -5
- package/build-module/query/view.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/search/view.js +81 -151
- package/build-module/search/view.js.map +1 -1
- package/build-module/social-link/edit.native.js +3 -1
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/table/edit.js +7 -7
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +3 -131
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/hooks.js +137 -0
- package/build-module/table-of-contents/hooks.js.map +1 -0
- package/build-module/table-of-contents/index.js +2 -1
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/verse/edit.js +4 -1
- package/build-module/verse/edit.js.map +1 -1
- package/build-module/verse/index.js +1 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-style/cover/style-rtl.css +9 -0
- package/build-style/cover/style.css +9 -0
- package/build-style/editor-rtl.css +15 -9
- package/build-style/editor.css +15 -9
- package/build-style/file/style-rtl.css +5 -0
- package/build-style/file/style.css +5 -0
- package/build-style/heading/style-rtl.css +13 -0
- package/build-style/heading/style.css +13 -0
- package/build-style/navigation-link/editor-rtl.css +0 -9
- package/build-style/navigation-link/editor.css +0 -9
- package/build-style/paragraph/editor-rtl.css +5 -0
- package/build-style/paragraph/editor.css +5 -0
- package/build-style/paragraph/style-rtl.css +5 -0
- package/build-style/paragraph/style.css +5 -0
- package/build-style/post-navigation-link/style-rtl.css +3 -0
- package/build-style/post-navigation-link/style.css +3 -0
- package/build-style/query/editor-rtl.css +10 -0
- package/build-style/query/editor.css +10 -0
- package/build-style/query/style-rtl.css +1 -1
- package/build-style/query/style.css +1 -1
- package/build-style/reset-rtl.css +27 -27
- package/build-style/reset.css +27 -27
- package/build-style/style-rtl.css +35 -0
- package/build-style/style.css +35 -0
- package/package.json +32 -33
- package/src/audio/test/__snapshots__/edit.native.js.snap +78 -106
- package/src/avatar/index.php +2 -2
- package/src/block/edit.js +58 -2
- package/src/block/test/edit.native.js +2 -3
- package/src/button/block.json +11 -2
- package/src/button/edit.js +27 -11
- package/src/button/save.js +10 -4
- package/src/buttons/edit.js +13 -3
- package/src/buttons/test/edit.native.js +28 -24
- package/src/calendar/index.php +2 -2
- package/src/code/block.json +2 -1
- package/src/code/edit.js +13 -1
- package/src/code/index.js +5 -0
- package/src/column/block.json +1 -0
- package/src/columns/block.json +2 -0
- package/src/comment-template/index.php +1 -1
- package/src/comments-pagination-next/index.php +1 -1
- package/src/comments-pagination-previous/index.php +1 -1
- package/src/cover/style.scss +12 -1
- package/src/cover/test/edit.js +7 -7
- package/src/cover/test/edit.native.js +18 -27
- package/src/embed/test/index.native.js +30 -45
- package/src/file/block.json +2 -1
- package/src/file/edit.native.js +1 -1
- package/src/file/index.php +19 -21
- package/src/file/style.scss +6 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +162 -218
- package/src/file/utils/index.js +0 -15
- package/src/file/view.js +14 -5
- package/src/footnotes/edit.js +13 -1
- package/src/gallery/edit.js +1 -1
- package/src/gallery/index.php +1 -1
- package/src/group/block.json +4 -0
- package/src/group/edit.js +0 -1
- package/src/heading/block.json +2 -0
- package/src/heading/edit.js +0 -1
- package/src/heading/style.scss +4 -0
- package/src/heading/transforms.js +1 -6
- package/src/image/block.json +7 -4
- package/src/image/deprecated.js +210 -7
- package/src/image/edit.js +43 -29
- package/src/image/image.js +86 -43
- package/src/image/index.php +251 -28
- package/src/latest-posts/index.php +1 -1
- package/src/list/deprecated.js +84 -3
- package/src/list/edit.js +6 -3
- package/src/list/ordered-list-settings.js +20 -5
- package/src/list/save.js +10 -1
- package/src/list/test/edit.native.js +2 -4
- package/src/list/utils.js +22 -1
- package/src/navigation/block.json +4 -2
- package/src/navigation/constants.js +1 -0
- package/src/navigation/index.php +85 -123
- package/src/navigation/view.js +192 -96
- package/src/navigation-link/edit.js +21 -36
- package/src/navigation-link/editor.scss +0 -8
- package/src/navigation-link/transforms.js +22 -0
- package/src/page-list/edit.js +2 -1
- package/src/paragraph/editor.scss +5 -0
- package/src/paragraph/style.scss +5 -0
- package/src/pattern/index.php +2 -2
- package/src/post-comments-form/edit.js +10 -0
- package/src/post-comments-form/form.js +7 -1
- package/src/post-content/block.json +3 -0
- package/src/post-content/edit.js +14 -6
- package/src/post-excerpt/index.php +2 -2
- package/src/post-featured-image/index.php +2 -2
- package/src/post-featured-image/overlay.js +1 -0
- package/src/post-navigation-link/index.php +0 -5
- package/src/post-navigation-link/style.scss +4 -0
- package/src/post-template/index.php +1 -1
- package/src/post-terms/index.php +5 -2
- package/src/preformatted/edit.js +5 -0
- package/src/preformatted/index.js +1 -1
- package/src/pullquote/deprecated.js +8 -13
- package/src/query/edit/enhanced-pagination-modal.js +65 -0
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +49 -0
- package/src/query/edit/inspector-controls/index.js +9 -45
- package/src/query/edit/query-content.js +8 -0
- package/src/query/editor.scss +10 -0
- package/src/query/index.php +29 -16
- package/src/query/style.scss +2 -2
- package/src/query/utils.js +22 -0
- package/src/query/view.js +5 -5
- package/src/query-pagination-next/index.php +1 -1
- package/src/query-pagination-previous/index.php +1 -1
- package/src/reset.scss +1 -1
- package/src/search/block.json +1 -0
- package/src/search/index.php +45 -4
- package/src/search/test/__snapshots__/edit.native.js.snap +265 -363
- package/src/search/view.js +70 -169
- package/src/social-link/edit.native.js +1 -1
- package/src/social-link/editor.native.scss +4 -0
- package/src/table/edit.js +21 -19
- package/src/table-of-contents/block.json +2 -1
- package/src/table-of-contents/edit.js +5 -162
- package/src/table-of-contents/hooks.js +156 -0
- package/src/verse/edit.js +5 -0
- package/src/verse/index.js +1 -1
- package/src/verse/test/edit.native.js +2 -3
- package/build/file/view-interactivity.js +0 -22
- package/build/file/view-interactivity.js.map +0 -1
- package/build/image/view-interactivity.js.map +0 -1
- package/build/navigation/view-interactivity.js +0 -172
- package/build/navigation/view-interactivity.js.map +0 -1
- package/build/navigation/view-modal.js +0 -115
- package/build/navigation/view-modal.js.map +0 -1
- package/build-module/file/view-interactivity.js +0 -18
- package/build-module/file/view-interactivity.js.map +0 -1
- package/build-module/image/view-interactivity.js.map +0 -1
- package/build-module/navigation/view-interactivity.js +0 -169
- package/build-module/navigation/view-interactivity.js.map +0 -1
- package/build-module/navigation/view-modal.js +0 -112
- package/build-module/navigation/view-modal.js.map +0 -1
- package/src/file/view-interactivity.js +0 -18
- package/src/navigation/view-interactivity.js +0 -196
- package/src/navigation/view-modal.js +0 -127
- /package/src/image/{view-interactivity.js → view.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_data","_richText","_shared","blockAttributes","value","type","source","selector","multiline","citation","default","mainColor","customMainColor","textColor","customTextColor","parseBorderColor","styleString","matches","match","multilineToInline","toHTMLString","replace","create","html","multilineTag","RegExp","__UNSTABLE_LINE_SEPARATOR","v5","attributes","__experimentalRole","textAlign","save","shouldShowCitation","RichText","isEmpty","_element","createElement","useBlockProps","className","classnames","Content","tagName","migrate","v4","isSolidColorStyle","includes","SOLID_COLOR_CLASS","figureClasses","figureStyles","backgroundClass","getColorClassName","backgroundColor","undefined","borderColor","blockquoteTextColorClass","blockquoteClasses","blockquoteStyles","color","style","border","background","text","v3","figureStyle","attribute","v2","figureClass","_select$getSettings$c","colors","select","blockEditorStore","getSettings","colorObject","getColorObjectByAttributeValues","blockquoteStyle","v1","v0","align","_default","exports"],"sources":["@wordpress/block-library/src/pullquote/deprecated.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n\tRichText,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { select } from '@wordpress/data';\nimport {\n\tcreate,\n\treplace,\n\ttoHTMLString,\n\t__UNSTABLE_LINE_SEPARATOR,\n} from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { SOLID_COLOR_CLASS } from './shared';\n\nconst blockAttributes = {\n\tvalue: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'blockquote',\n\t\tmultiline: 'p',\n\t},\n\tcitation: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'cite',\n\t\tdefault: '',\n\t},\n\tmainColor: {\n\t\ttype: 'string',\n\t},\n\tcustomMainColor: {\n\t\ttype: 'string',\n\t},\n\ttextColor: {\n\t\ttype: 'string',\n\t},\n\tcustomTextColor: {\n\t\ttype: 'string',\n\t},\n};\n\nfunction parseBorderColor( styleString ) {\n\tif ( ! styleString ) {\n\t\treturn;\n\t}\n\tconst matches = styleString.match( /border-color:([^;]+)[;]?/ );\n\tif ( matches && matches[ 1 ] ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n\nfunction multilineToInline( value ) {\n\treturn toHTMLString( {\n\t\tvalue: replace(\n\t\t\tcreate( { html: value, multilineTag: 'p' } ),\n\t\t\tnew RegExp( __UNSTABLE_LINE_SEPARATOR, 'g' ),\n\t\t\t'\\n'\n\t\t),\n\t} );\n}\n\nconst v5 = {\n\tattributes: {\n\t\tvalue: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'blockquote',\n\t\t\tmultiline: 'p',\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\tcitation: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'cite',\n\t\t\tdefault: '',\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { textAlign, citation, value } = attributes;\n\t\tconst shouldShowCitation = ! RichText.isEmpty( citation );\n\n\t\treturn (\n\t\t\t<figure\n\t\t\t\t{ ...useBlockProps.save( {\n\t\t\t\t\tclassName: classnames( {\n\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t} ),\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<blockquote>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ shouldShowCitation && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( { value, ...attributes } ) {\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\n// TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example\n\nconst v4 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t},\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\tmainColor,\n\t\t\tcustomMainColor,\n\t\t\tcustomTextColor,\n\t\t\ttextColor,\n\t\t\tvalue,\n\t\t\tcitation,\n\t\t\tclassName,\n\t\t} = attributes;\n\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\n\t\tlet figureClasses, figureStyles;\n\n\t\t// Is solid color style\n\t\tif ( isSolidColorStyle ) {\n\t\t\tconst backgroundClass = getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tmainColor\n\t\t\t);\n\n\t\t\tfigureClasses = classnames( {\n\t\t\t\t'has-background': backgroundClass || customMainColor,\n\t\t\t\t[ backgroundClass ]: backgroundClass,\n\t\t\t} );\n\n\t\t\tfigureStyles = {\n\t\t\t\tbackgroundColor: backgroundClass ? undefined : customMainColor,\n\t\t\t};\n\t\t\t// Is normal style and a custom color is being used ( we can set a style directly with its value)\n\t\t} else if ( customMainColor ) {\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: customMainColor,\n\t\t\t};\n\t\t}\n\n\t\tconst blockquoteTextColorClass = getColorClassName(\n\t\t\t'color',\n\t\t\ttextColor\n\t\t);\n\t\tconst blockquoteClasses = classnames( {\n\t\t\t'has-text-color': textColor || customTextColor,\n\t\t\t[ blockquoteTextColorClass ]: blockquoteTextColorClass,\n\t\t} );\n\n\t\tconst blockquoteStyles = blockquoteTextColorClass\n\t\t\t? undefined\n\t\t\t: { color: customTextColor };\n\n\t\treturn (\n\t\t\t<figure\n\t\t\t\t{ ...useBlockProps.save( {\n\t\t\t\t\tclassName: figureClasses,\n\t\t\t\t\tstyle: figureStyles,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName={ blockquoteClasses }\n\t\t\t\t\tstyle={ blockquoteStyles }\n\t\t\t\t>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( {\n\t\tvalue,\n\t\tclassName,\n\t\tmainColor,\n\t\tcustomMainColor,\n\t\tcustomTextColor,\n\t\t...attributes\n\t} ) {\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\t\tlet style;\n\n\t\tif ( customMainColor ) {\n\t\t\tif ( ! isSolidColorStyle ) {\n\t\t\t\t// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tborder: {\n\t\t\t\t\t\tcolor: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tbackground: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.\n\t\tif ( customTextColor && style ) {\n\t\t\tstyle.color = {\n\t\t\t\t...style.color,\n\t\t\t\ttext: customTextColor,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\tclassName,\n\t\t\tbackgroundColor: isSolidColorStyle ? mainColor : undefined,\n\t\t\tborderColor: isSolidColorStyle ? undefined : mainColor,\n\t\t\ttextAlign: isSolidColorStyle ? 'left' : undefined,\n\t\t\tstyle,\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v3 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t\t// figureStyle is an attribute that never existed.\n\t\t// We are using it as a way to access the styles previously applied to the figure.\n\t\tfigureStyle: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'figure',\n\t\t\tattribute: 'style',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\tmainColor,\n\t\t\tcustomMainColor,\n\t\t\ttextColor,\n\t\t\tcustomTextColor,\n\t\t\tvalue,\n\t\t\tcitation,\n\t\t\tclassName,\n\t\t\tfigureStyle,\n\t\t} = attributes;\n\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\n\t\tlet figureClasses, figureStyles;\n\n\t\t// Is solid color style\n\t\tif ( isSolidColorStyle ) {\n\t\t\tconst backgroundClass = getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tmainColor\n\t\t\t);\n\n\t\t\tfigureClasses = classnames( {\n\t\t\t\t'has-background': backgroundClass || customMainColor,\n\t\t\t\t[ backgroundClass ]: backgroundClass,\n\t\t\t} );\n\n\t\t\tfigureStyles = {\n\t\t\t\tbackgroundColor: backgroundClass ? undefined : customMainColor,\n\t\t\t};\n\t\t\t// Is normal style and a custom color is being used ( we can set a style directly with its value)\n\t\t} else if ( customMainColor ) {\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: customMainColor,\n\t\t\t};\n\t\t\t// If normal style and a named color are being used, we need to retrieve the color value to set the style,\n\t\t\t// as there is no expectation that themes create classes that set border colors.\n\t\t} else if ( mainColor ) {\n\t\t\t// Previously here we queried the color settings to know the color value\n\t\t\t// of a named color. This made the save function impure and the block was refactored,\n\t\t\t// because meanwhile a change in the editor made it impossible to query color settings in the save function.\n\t\t\t// Here instead of querying the color settings to know the color value, we retrieve the value\n\t\t\t// directly from the style previously serialized.\n\t\t\tconst borderColor = parseBorderColor( figureStyle );\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor,\n\t\t\t};\n\t\t}\n\n\t\tconst blockquoteTextColorClass = getColorClassName(\n\t\t\t'color',\n\t\t\ttextColor\n\t\t);\n\t\tconst blockquoteClasses =\n\t\t\t( textColor || customTextColor ) &&\n\t\t\tclassnames( 'has-text-color', {\n\t\t\t\t[ blockquoteTextColorClass ]: blockquoteTextColorClass,\n\t\t\t} );\n\n\t\tconst blockquoteStyles = blockquoteTextColorClass\n\t\t\t? undefined\n\t\t\t: { color: customTextColor };\n\n\t\treturn (\n\t\t\t<figure className={ figureClasses } style={ figureStyles }>\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName={ blockquoteClasses }\n\t\t\t\t\tstyle={ blockquoteStyles }\n\t\t\t\t>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( {\n\t\tvalue,\n\t\tclassName,\n\t\tfigureStyle,\n\t\tmainColor,\n\t\tcustomMainColor,\n\t\tcustomTextColor,\n\t\t...attributes\n\t} ) {\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\t\tlet style;\n\n\t\tif ( customMainColor ) {\n\t\t\tif ( ! isSolidColorStyle ) {\n\t\t\t\t// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tborder: {\n\t\t\t\t\t\tcolor: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tbackground: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.\n\t\tif ( customTextColor && style ) {\n\t\t\tstyle.color = {\n\t\t\t\t...style.color,\n\t\t\t\ttext: customTextColor,\n\t\t\t};\n\t\t}\n\t\t// If is the default style, and a main color is set,\n\t\t// migrate the main color value into a custom border color.\n\t\t// The custom border color value is retrieved by parsing the figure styles.\n\t\tif ( ! isSolidColorStyle && mainColor && figureStyle ) {\n\t\t\tconst borderColor = parseBorderColor( figureStyle );\n\t\t\tif ( borderColor ) {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: multilineToInline( value ),\n\t\t\t\t\t...attributes,\n\t\t\t\t\tclassName,\n\t\t\t\t\t// Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style.\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tborder: {\n\t\t\t\t\t\t\tcolor: borderColor,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\tclassName,\n\t\t\tbackgroundColor: isSolidColorStyle ? mainColor : undefined,\n\t\t\tborderColor: isSolidColorStyle ? undefined : mainColor,\n\t\t\ttextAlign: isSolidColorStyle ? 'left' : undefined,\n\t\t\tstyle,\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v2 = {\n\tattributes: blockAttributes,\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\tmainColor,\n\t\t\tcustomMainColor,\n\t\t\ttextColor,\n\t\t\tcustomTextColor,\n\t\t\tvalue,\n\t\t\tcitation,\n\t\t\tclassName,\n\t\t} = attributes;\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\n\t\tlet figureClass, figureStyles;\n\t\t// Is solid color style\n\t\tif ( isSolidColorStyle ) {\n\t\t\tfigureClass = getColorClassName( 'background-color', mainColor );\n\t\t\tif ( ! figureClass ) {\n\t\t\t\tfigureStyles = {\n\t\t\t\t\tbackgroundColor: customMainColor,\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Is normal style and a custom color is being used ( we can set a style directly with its value)\n\t\t} else if ( customMainColor ) {\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: customMainColor,\n\t\t\t};\n\t\t\t// Is normal style and a named color is being used, we need to retrieve the color value to set the style,\n\t\t\t// as there is no expectation that themes create classes that set border colors.\n\t\t} else if ( mainColor ) {\n\t\t\tconst colors =\n\t\t\t\tselect( blockEditorStore ).getSettings().colors ?? [];\n\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\tcolors,\n\t\t\t\tmainColor\n\t\t\t);\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: colorObject.color,\n\t\t\t};\n\t\t}\n\n\t\tconst blockquoteTextColorClass = getColorClassName(\n\t\t\t'color',\n\t\t\ttextColor\n\t\t);\n\t\tconst blockquoteClasses =\n\t\t\ttextColor || customTextColor\n\t\t\t\t? classnames( 'has-text-color', {\n\t\t\t\t\t\t[ blockquoteTextColorClass ]: blockquoteTextColorClass,\n\t\t\t\t } )\n\t\t\t\t: undefined;\n\t\tconst blockquoteStyle = blockquoteTextColorClass\n\t\t\t? undefined\n\t\t\t: { color: customTextColor };\n\t\treturn (\n\t\t\t<figure className={ figureClass } style={ figureStyles }>\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName={ blockquoteClasses }\n\t\t\t\t\tstyle={ blockquoteStyle }\n\t\t\t\t>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( {\n\t\tvalue,\n\t\tclassName,\n\t\tmainColor,\n\t\tcustomMainColor,\n\t\tcustomTextColor,\n\t\t...attributes\n\t} ) {\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\t\tlet style = {};\n\n\t\tif ( customMainColor ) {\n\t\t\tif ( ! isSolidColorStyle ) {\n\t\t\t\t// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tborder: {\n\t\t\t\t\t\tcolor: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tbackground: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.\n\t\tif ( customTextColor && style ) {\n\t\t\tstyle.color = {\n\t\t\t\t...style.color,\n\t\t\t\ttext: customTextColor,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\tclassName,\n\t\t\tbackgroundColor: isSolidColorStyle ? mainColor : undefined,\n\t\t\tborderColor: isSolidColorStyle ? undefined : mainColor,\n\t\t\ttextAlign: isSolidColorStyle ? 'left' : undefined,\n\t\t\tstyle,\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v1 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t},\n\tsave( { attributes } ) {\n\t\tconst { value, citation } = attributes;\n\t\treturn (\n\t\t\t<blockquote>\n\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t) }\n\t\t\t</blockquote>\n\t\t);\n\t},\n\tmigrate( { value, ...attributes } ) {\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v0 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t\tcitation: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'footer',\n\t\t},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'none',\n\t\t},\n\t},\n\n\tsave( { attributes } ) {\n\t\tconst { value, citation, align } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote className={ `align${ align }` }>\n\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t<RichText.Content tagName=\"footer\" value={ citation } />\n\t\t\t\t) }\n\t\t\t</blockquote>\n\t\t);\n\t},\n\tmigrate( { value, ...attributes } ) {\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v5, v4, v3, v2, v1, v0 ];\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAUA,IAAAI,OAAA,GAAAJ,OAAA;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;;AAGA,MAAMK,eAAe,GAAG;EACvBC,KAAK,EAAE;IACNC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,MAAM;IACdC,QAAQ,EAAE,YAAY;IACtBC,SAAS,EAAE;EACZ,CAAC;EACDC,QAAQ,EAAE;IACTJ,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,MAAM;IACdC,QAAQ,EAAE,MAAM;IAChBG,OAAO,EAAE;EACV,CAAC;EACDC,SAAS,EAAE;IACVN,IAAI,EAAE;EACP,CAAC;EACDO,eAAe,EAAE;IAChBP,IAAI,EAAE;EACP,CAAC;EACDQ,SAAS,EAAE;IACVR,IAAI,EAAE;EACP,CAAC;EACDS,eAAe,EAAE;IAChBT,IAAI,EAAE;EACP;AACD,CAAC;AAED,SAASU,gBAAgBA,CAAEC,WAAW,EAAG;EACxC,IAAK,CAAEA,WAAW,EAAG;IACpB;EACD;EACA,MAAMC,OAAO,GAAGD,WAAW,CAACE,KAAK,CAAE,0BAA2B,CAAC;EAC/D,IAAKD,OAAO,IAAIA,OAAO,CAAE,CAAC,CAAE,EAAG;IAC9B,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD;AAEA,SAASE,iBAAiBA,CAAEf,KAAK,EAAG;EACnC,OAAO,IAAAgB,sBAAY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,QAAQuC,KAAO;IAAG,GAC1C,IAAA1C,QAAA,CAAAC,aAAA,EAACrC,YAAA,CAAAkC,QAAQ,CAACO,OAAO;MAACpC,KAAK,EAAGA,KAAO;MAACI,SAAS;IAAA,CAAE,CAAC,EAC5C,CAAEyB,qBAAQ,CAACC,OAAO,CAAEzB,QAAS,CAAC,IAC/B,IAAA0B,QAAA,CAAAC,aAAA,EAACrC,YAAA,CAAAkC,QAAQ,CAACO,OAAO;MAACC,OAAO,EAAC,QAAQ;MAACrC,KAAK,EAAGK;IAAU,CAAE,CAE7C,CAAC;EAEf,CAAC;EACDiC,OAAOA,CAAE;IAAEtC,KAAK;IAAE,GAAGwB;EAAW,CAAC,EAAG;IACnC,OAAO;MACNxB,KAAK,EAAEe,iBAAiB,CAAEf,KAAM,CAAC;MACjC,GAAGwB;IACJ,CAAC;EACF;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAkD,QAAA,GAQe,CAAEnD,EAAE,EAAEgB,EAAE,EAAEmB,EAAE,EAAEG,EAAE,EAAEU,EAAE,EAAEC,EAAE,CAAE;AAAAG,OAAA,CAAArE,OAAA,GAAAoE,QAAA"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_data","_shared","blockAttributes","value","type","source","selector","multiline","citation","default","mainColor","customMainColor","textColor","customTextColor","parseBorderColor","styleString","matches","match","multilineToInline","padded","values","split","shift","pop","join","v5","attributes","__experimentalRole","textAlign","save","shouldShowCitation","RichText","isEmpty","_element","createElement","useBlockProps","className","classnames","Content","tagName","migrate","v4","isSolidColorStyle","includes","SOLID_COLOR_CLASS","figureClasses","figureStyles","backgroundClass","getColorClassName","backgroundColor","undefined","borderColor","blockquoteTextColorClass","blockquoteClasses","blockquoteStyles","color","style","border","background","text","v3","figureStyle","attribute","v2","figureClass","_select$getSettings$c","colors","select","blockEditorStore","getSettings","colorObject","getColorObjectByAttributeValues","blockquoteStyle","v1","v0","align","_default","exports"],"sources":["@wordpress/block-library/src/pullquote/deprecated.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n\tRichText,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { select } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { SOLID_COLOR_CLASS } from './shared';\n\nconst blockAttributes = {\n\tvalue: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'blockquote',\n\t\tmultiline: 'p',\n\t},\n\tcitation: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'cite',\n\t\tdefault: '',\n\t},\n\tmainColor: {\n\t\ttype: 'string',\n\t},\n\tcustomMainColor: {\n\t\ttype: 'string',\n\t},\n\ttextColor: {\n\t\ttype: 'string',\n\t},\n\tcustomTextColor: {\n\t\ttype: 'string',\n\t},\n};\n\nfunction parseBorderColor( styleString ) {\n\tif ( ! styleString ) {\n\t\treturn;\n\t}\n\tconst matches = styleString.match( /border-color:([^;]+)[;]?/ );\n\tif ( matches && matches[ 1 ] ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n\nfunction multilineToInline( value ) {\n\tvalue = value || `<p></p>`;\n\tconst padded = `</p>${ value }<p>`;\n\tconst values = padded.split( `</p><p>` );\n\n\tvalues.shift();\n\tvalues.pop();\n\n\treturn values.join( '<br>' );\n}\n\nconst v5 = {\n\tattributes: {\n\t\tvalue: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'blockquote',\n\t\t\tmultiline: 'p',\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\tcitation: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'cite',\n\t\t\tdefault: '',\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { textAlign, citation, value } = attributes;\n\t\tconst shouldShowCitation = ! RichText.isEmpty( citation );\n\n\t\treturn (\n\t\t\t<figure\n\t\t\t\t{ ...useBlockProps.save( {\n\t\t\t\t\tclassName: classnames( {\n\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t} ),\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<blockquote>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ shouldShowCitation && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( { value, ...attributes } ) {\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\n// TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example\n\nconst v4 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t},\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\tmainColor,\n\t\t\tcustomMainColor,\n\t\t\tcustomTextColor,\n\t\t\ttextColor,\n\t\t\tvalue,\n\t\t\tcitation,\n\t\t\tclassName,\n\t\t} = attributes;\n\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\n\t\tlet figureClasses, figureStyles;\n\n\t\t// Is solid color style\n\t\tif ( isSolidColorStyle ) {\n\t\t\tconst backgroundClass = getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tmainColor\n\t\t\t);\n\n\t\t\tfigureClasses = classnames( {\n\t\t\t\t'has-background': backgroundClass || customMainColor,\n\t\t\t\t[ backgroundClass ]: backgroundClass,\n\t\t\t} );\n\n\t\t\tfigureStyles = {\n\t\t\t\tbackgroundColor: backgroundClass ? undefined : customMainColor,\n\t\t\t};\n\t\t\t// Is normal style and a custom color is being used ( we can set a style directly with its value)\n\t\t} else if ( customMainColor ) {\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: customMainColor,\n\t\t\t};\n\t\t}\n\n\t\tconst blockquoteTextColorClass = getColorClassName(\n\t\t\t'color',\n\t\t\ttextColor\n\t\t);\n\t\tconst blockquoteClasses = classnames( {\n\t\t\t'has-text-color': textColor || customTextColor,\n\t\t\t[ blockquoteTextColorClass ]: blockquoteTextColorClass,\n\t\t} );\n\n\t\tconst blockquoteStyles = blockquoteTextColorClass\n\t\t\t? undefined\n\t\t\t: { color: customTextColor };\n\n\t\treturn (\n\t\t\t<figure\n\t\t\t\t{ ...useBlockProps.save( {\n\t\t\t\t\tclassName: figureClasses,\n\t\t\t\t\tstyle: figureStyles,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName={ blockquoteClasses }\n\t\t\t\t\tstyle={ blockquoteStyles }\n\t\t\t\t>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( {\n\t\tvalue,\n\t\tclassName,\n\t\tmainColor,\n\t\tcustomMainColor,\n\t\tcustomTextColor,\n\t\t...attributes\n\t} ) {\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\t\tlet style;\n\n\t\tif ( customMainColor ) {\n\t\t\tif ( ! isSolidColorStyle ) {\n\t\t\t\t// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tborder: {\n\t\t\t\t\t\tcolor: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tbackground: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.\n\t\tif ( customTextColor && style ) {\n\t\t\tstyle.color = {\n\t\t\t\t...style.color,\n\t\t\t\ttext: customTextColor,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\tclassName,\n\t\t\tbackgroundColor: isSolidColorStyle ? mainColor : undefined,\n\t\t\tborderColor: isSolidColorStyle ? undefined : mainColor,\n\t\t\ttextAlign: isSolidColorStyle ? 'left' : undefined,\n\t\t\tstyle,\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v3 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t\t// figureStyle is an attribute that never existed.\n\t\t// We are using it as a way to access the styles previously applied to the figure.\n\t\tfigureStyle: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'figure',\n\t\t\tattribute: 'style',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\tmainColor,\n\t\t\tcustomMainColor,\n\t\t\ttextColor,\n\t\t\tcustomTextColor,\n\t\t\tvalue,\n\t\t\tcitation,\n\t\t\tclassName,\n\t\t\tfigureStyle,\n\t\t} = attributes;\n\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\n\t\tlet figureClasses, figureStyles;\n\n\t\t// Is solid color style\n\t\tif ( isSolidColorStyle ) {\n\t\t\tconst backgroundClass = getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tmainColor\n\t\t\t);\n\n\t\t\tfigureClasses = classnames( {\n\t\t\t\t'has-background': backgroundClass || customMainColor,\n\t\t\t\t[ backgroundClass ]: backgroundClass,\n\t\t\t} );\n\n\t\t\tfigureStyles = {\n\t\t\t\tbackgroundColor: backgroundClass ? undefined : customMainColor,\n\t\t\t};\n\t\t\t// Is normal style and a custom color is being used ( we can set a style directly with its value)\n\t\t} else if ( customMainColor ) {\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: customMainColor,\n\t\t\t};\n\t\t\t// If normal style and a named color are being used, we need to retrieve the color value to set the style,\n\t\t\t// as there is no expectation that themes create classes that set border colors.\n\t\t} else if ( mainColor ) {\n\t\t\t// Previously here we queried the color settings to know the color value\n\t\t\t// of a named color. This made the save function impure and the block was refactored,\n\t\t\t// because meanwhile a change in the editor made it impossible to query color settings in the save function.\n\t\t\t// Here instead of querying the color settings to know the color value, we retrieve the value\n\t\t\t// directly from the style previously serialized.\n\t\t\tconst borderColor = parseBorderColor( figureStyle );\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor,\n\t\t\t};\n\t\t}\n\n\t\tconst blockquoteTextColorClass = getColorClassName(\n\t\t\t'color',\n\t\t\ttextColor\n\t\t);\n\t\tconst blockquoteClasses =\n\t\t\t( textColor || customTextColor ) &&\n\t\t\tclassnames( 'has-text-color', {\n\t\t\t\t[ blockquoteTextColorClass ]: blockquoteTextColorClass,\n\t\t\t} );\n\n\t\tconst blockquoteStyles = blockquoteTextColorClass\n\t\t\t? undefined\n\t\t\t: { color: customTextColor };\n\n\t\treturn (\n\t\t\t<figure className={ figureClasses } style={ figureStyles }>\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName={ blockquoteClasses }\n\t\t\t\t\tstyle={ blockquoteStyles }\n\t\t\t\t>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( {\n\t\tvalue,\n\t\tclassName,\n\t\tfigureStyle,\n\t\tmainColor,\n\t\tcustomMainColor,\n\t\tcustomTextColor,\n\t\t...attributes\n\t} ) {\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\t\tlet style;\n\n\t\tif ( customMainColor ) {\n\t\t\tif ( ! isSolidColorStyle ) {\n\t\t\t\t// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tborder: {\n\t\t\t\t\t\tcolor: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tbackground: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.\n\t\tif ( customTextColor && style ) {\n\t\t\tstyle.color = {\n\t\t\t\t...style.color,\n\t\t\t\ttext: customTextColor,\n\t\t\t};\n\t\t}\n\t\t// If is the default style, and a main color is set,\n\t\t// migrate the main color value into a custom border color.\n\t\t// The custom border color value is retrieved by parsing the figure styles.\n\t\tif ( ! isSolidColorStyle && mainColor && figureStyle ) {\n\t\t\tconst borderColor = parseBorderColor( figureStyle );\n\t\t\tif ( borderColor ) {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: multilineToInline( value ),\n\t\t\t\t\t...attributes,\n\t\t\t\t\tclassName,\n\t\t\t\t\t// Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style.\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tborder: {\n\t\t\t\t\t\t\tcolor: borderColor,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\tclassName,\n\t\t\tbackgroundColor: isSolidColorStyle ? mainColor : undefined,\n\t\t\tborderColor: isSolidColorStyle ? undefined : mainColor,\n\t\t\ttextAlign: isSolidColorStyle ? 'left' : undefined,\n\t\t\tstyle,\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v2 = {\n\tattributes: blockAttributes,\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\tmainColor,\n\t\t\tcustomMainColor,\n\t\t\ttextColor,\n\t\t\tcustomTextColor,\n\t\t\tvalue,\n\t\t\tcitation,\n\t\t\tclassName,\n\t\t} = attributes;\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\n\t\tlet figureClass, figureStyles;\n\t\t// Is solid color style\n\t\tif ( isSolidColorStyle ) {\n\t\t\tfigureClass = getColorClassName( 'background-color', mainColor );\n\t\t\tif ( ! figureClass ) {\n\t\t\t\tfigureStyles = {\n\t\t\t\t\tbackgroundColor: customMainColor,\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Is normal style and a custom color is being used ( we can set a style directly with its value)\n\t\t} else if ( customMainColor ) {\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: customMainColor,\n\t\t\t};\n\t\t\t// Is normal style and a named color is being used, we need to retrieve the color value to set the style,\n\t\t\t// as there is no expectation that themes create classes that set border colors.\n\t\t} else if ( mainColor ) {\n\t\t\tconst colors =\n\t\t\t\tselect( blockEditorStore ).getSettings().colors ?? [];\n\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\tcolors,\n\t\t\t\tmainColor\n\t\t\t);\n\t\t\tfigureStyles = {\n\t\t\t\tborderColor: colorObject.color,\n\t\t\t};\n\t\t}\n\n\t\tconst blockquoteTextColorClass = getColorClassName(\n\t\t\t'color',\n\t\t\ttextColor\n\t\t);\n\t\tconst blockquoteClasses =\n\t\t\ttextColor || customTextColor\n\t\t\t\t? classnames( 'has-text-color', {\n\t\t\t\t\t\t[ blockquoteTextColorClass ]: blockquoteTextColorClass,\n\t\t\t\t } )\n\t\t\t\t: undefined;\n\t\tconst blockquoteStyle = blockquoteTextColorClass\n\t\t\t? undefined\n\t\t\t: { color: customTextColor };\n\t\treturn (\n\t\t\t<figure className={ figureClass } style={ figureStyles }>\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName={ blockquoteClasses }\n\t\t\t\t\tstyle={ blockquoteStyle }\n\t\t\t\t>\n\t\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t\t) }\n\t\t\t\t</blockquote>\n\t\t\t</figure>\n\t\t);\n\t},\n\tmigrate( {\n\t\tvalue,\n\t\tclassName,\n\t\tmainColor,\n\t\tcustomMainColor,\n\t\tcustomTextColor,\n\t\t...attributes\n\t} ) {\n\t\tconst isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );\n\t\tlet style = {};\n\n\t\tif ( customMainColor ) {\n\t\t\tif ( ! isSolidColorStyle ) {\n\t\t\t\t// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tborder: {\n\t\t\t\t\t\tcolor: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.\n\t\t\t\tstyle = {\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tbackground: customMainColor,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.\n\t\tif ( customTextColor && style ) {\n\t\t\tstyle.color = {\n\t\t\t\t...style.color,\n\t\t\t\ttext: customTextColor,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\tclassName,\n\t\t\tbackgroundColor: isSolidColorStyle ? mainColor : undefined,\n\t\t\tborderColor: isSolidColorStyle ? undefined : mainColor,\n\t\t\ttextAlign: isSolidColorStyle ? 'left' : undefined,\n\t\t\tstyle,\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v1 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t},\n\tsave( { attributes } ) {\n\t\tconst { value, citation } = attributes;\n\t\treturn (\n\t\t\t<blockquote>\n\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t) }\n\t\t\t</blockquote>\n\t\t);\n\t},\n\tmigrate( { value, ...attributes } ) {\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\nconst v0 = {\n\tattributes: {\n\t\t...blockAttributes,\n\t\tcitation: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'footer',\n\t\t},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'none',\n\t\t},\n\t},\n\n\tsave( { attributes } ) {\n\t\tconst { value, citation, align } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote className={ `align${ align }` }>\n\t\t\t\t<RichText.Content value={ value } multiline />\n\t\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t\t<RichText.Content tagName=\"footer\" value={ citation } />\n\t\t\t\t) }\n\t\t\t</blockquote>\n\t\t);\n\t},\n\tmigrate( { value, ...attributes } ) {\n\t\treturn {\n\t\t\tvalue: multilineToInline( value ),\n\t\t\t...attributes,\n\t\t};\n\t},\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v5, v4, v3, v2, v1, v0 ];\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMI,eAAe,GAAG;EACvBC,KAAK,EAAE;IACNC,IA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AiB,CAAEf,KAAM,CAAC;MACjC,GAAGuB;IACJ,CAAC;EACF;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAkD,QAAA,GAQe,CAAEnD,EAAE,EAAEgB,EAAE,EAAEmB,EAAE,EAAEG,EAAE,EAAEU,EAAE,EAAEC,EAAE,CAAE;AAAAG,OAAA,CAAApE,OAAA,GAAAmE,QAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = EnhancedPaginationModal;
|
|
7
|
+
var _element = require("@wordpress/element");
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
9
|
+
var _i18n = require("@wordpress/i18n");
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const disableEnhancedPaginationDescription = (0, _i18n.__)('Plugin blocks are not supported yet. For the enhanced pagination to work, remove the plugin block, then re-enable "Enhanced pagination" in the Query Block settings.');
|
|
20
|
+
const modalDescriptionId = 'wp-block-query-enhanced-pagination-modal__description';
|
|
21
|
+
function EnhancedPaginationModal({
|
|
22
|
+
clientId,
|
|
23
|
+
attributes: {
|
|
24
|
+
enhancedPagination
|
|
25
|
+
},
|
|
26
|
+
setAttributes
|
|
27
|
+
}) {
|
|
28
|
+
const [isOpen, setOpen] = (0, _element.useState)(false);
|
|
29
|
+
const containsThirdPartyBlocks = (0, _utils.useContainsThirdPartyBlocks)(clientId);
|
|
30
|
+
(0, _element.useEffect)(() => {
|
|
31
|
+
setOpen(containsThirdPartyBlocks && enhancedPagination);
|
|
32
|
+
}, [containsThirdPartyBlocks, enhancedPagination, setOpen]);
|
|
33
|
+
return isOpen && (0, _element.createElement)(_components.Modal, {
|
|
34
|
+
title: (0, _i18n.__)('Enhanced pagination will be disabled'),
|
|
35
|
+
className: "wp-block-query__enhanced-pagination-modal",
|
|
36
|
+
aria: {
|
|
37
|
+
describedby: modalDescriptionId
|
|
38
|
+
},
|
|
39
|
+
isDismissible: false,
|
|
40
|
+
shouldCloseOnEsc: false,
|
|
41
|
+
shouldCloseOnClickOutside: false
|
|
42
|
+
}, (0, _element.createElement)(_components.__experimentalVStack, {
|
|
43
|
+
alignment: "right",
|
|
44
|
+
spacing: 5
|
|
45
|
+
}, (0, _element.createElement)("span", {
|
|
46
|
+
id: modalDescriptionId
|
|
47
|
+
}, disableEnhancedPaginationDescription), (0, _element.createElement)(_components.Button, {
|
|
48
|
+
variant: "primary",
|
|
49
|
+
onClick: () => {
|
|
50
|
+
setAttributes({
|
|
51
|
+
enhancedPagination: false
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, (0, _i18n.__)('OK'))));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=enhanced-pagination-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_utils","disableEnhancedPaginationDescription","__","modalDescriptionId","EnhancedPaginationModal","clientId","attributes","enhancedPagination","setAttributes","isOpen","setOpen","useState","containsThirdPartyBlocks","useContainsThirdPartyBlocks","useEffect","createElement","Modal","title","className","aria","describedby","isDismissible","shouldCloseOnEsc","shouldCloseOnClickOutside","__experimentalVStack","alignment","spacing","id","Button","variant","onClick"],"sources":["@wordpress/block-library/src/query/edit/enhanced-pagination-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useContainsThirdPartyBlocks } from '../utils';\n\nconst disableEnhancedPaginationDescription = __(\n\t'Plugin blocks are not supported yet. For the enhanced pagination to work, remove the plugin block, then re-enable \"Enhanced pagination\" in the Query Block settings.'\n);\n\nconst modalDescriptionId =\n\t'wp-block-query-enhanced-pagination-modal__description';\n\nexport default function EnhancedPaginationModal( {\n\tclientId,\n\tattributes: { enhancedPagination },\n\tsetAttributes,\n} ) {\n\tconst [ isOpen, setOpen ] = useState( false );\n\n\tconst containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId );\n\n\tuseEffect( () => {\n\t\tsetOpen( containsThirdPartyBlocks && enhancedPagination );\n\t}, [ containsThirdPartyBlocks, enhancedPagination, setOpen ] );\n\n\treturn (\n\t\tisOpen && (\n\t\t\t<Modal\n\t\t\t\ttitle={ __( 'Enhanced pagination will be disabled' ) }\n\t\t\t\tclassName=\"wp-block-query__enhanced-pagination-modal\"\n\t\t\t\taria={ {\n\t\t\t\t\tdescribedby: modalDescriptionId,\n\t\t\t\t} }\n\t\t\t\tisDismissible={ false }\n\t\t\t\tshouldCloseOnEsc={ false }\n\t\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\t>\n\t\t\t\t<VStack alignment=\"right\" spacing={ 5 }>\n\t\t\t\t\t<span id={ modalDescriptionId }>\n\t\t\t\t\t\t{ disableEnhancedPaginationDescription }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( { enhancedPagination: false } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'OK' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</VStack>\n\t\t\t</Modal>\n\t\t)\n\t);\n}\n"],"mappings":";;;;;;AASA,IAAAA,QAAA,GAAAC,OAAA;AANA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AAMA,IAAAG,MAAA,GAAAH,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;A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AAEH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = EnhancedPaginationControl;
|
|
7
|
+
var _element = require("@wordpress/element");
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
9
|
+
var _i18n = require("@wordpress/i18n");
|
|
10
|
+
var _utils = require("../../utils");
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function EnhancedPaginationControl({
|
|
20
|
+
enhancedPagination,
|
|
21
|
+
setAttributes,
|
|
22
|
+
clientId
|
|
23
|
+
}) {
|
|
24
|
+
const enhancedPaginationNotice = (0, _i18n.__)("Enhanced pagination doesn't support plugin blocks yet. If you want to enable it, you have to remove all plugin blocks from the Query Loop.");
|
|
25
|
+
const containsThirdPartyBlocks = (0, _utils.useContainsThirdPartyBlocks)(clientId);
|
|
26
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToggleControl, {
|
|
27
|
+
label: (0, _i18n.__)('Enhanced pagination'),
|
|
28
|
+
help: (0, _i18n.__)('Browsing between pages won’t require a full page reload.'),
|
|
29
|
+
checked: !!enhancedPagination,
|
|
30
|
+
disabled: containsThirdPartyBlocks,
|
|
31
|
+
onChange: value => {
|
|
32
|
+
setAttributes({
|
|
33
|
+
enhancedPagination: !!value
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}), containsThirdPartyBlocks && (0, _element.createElement)(_components.Notice, {
|
|
37
|
+
status: "warning",
|
|
38
|
+
isDismissible: false,
|
|
39
|
+
className: "wp-block-query__enhanced-pagination-notice"
|
|
40
|
+
}, enhancedPaginationNotice));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=enhanced-pagination-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_utils","EnhancedPaginationControl","enhancedPagination","setAttributes","clientId","enhancedPaginationNotice","__","containsThirdPartyBlocks","useContainsThirdPartyBlocks","_element","createElement","Fragment","ToggleControl","label","help","checked","disabled","onChange","value","Notice","status","isDismissible","className"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToggleControl, Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useContainsThirdPartyBlocks } from '../../utils';\n\nexport default function EnhancedPaginationControl( {\n\tenhancedPagination,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst enhancedPaginationNotice = __(\n\t\t\"Enhanced pagination doesn't support plugin blocks yet. If you want to enable it, you have to remove all plugin blocks from the Query Loop.\"\n\t);\n\n\tconst containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId );\n\n\treturn (\n\t\t<>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Enhanced pagination' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Browsing between pages won’t require a full page reload.'\n\t\t\t\t) }\n\t\t\t\tchecked={ !! enhancedPagination }\n\t\t\t\tdisabled={ containsThirdPartyBlocks }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tenhancedPagination: !! value,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ containsThirdPartyBlocks && (\n\t\t\t\t<Notice\n\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\tclassName=\"wp-block-query__enhanced-pagination-notice\"\n\t\t\t\t>\n\t\t\t\t\t{ enhancedPaginationNotice }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASG,yBAAyBA,CAAE;EAClDC,kBAAkB;EAClBC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,MAAMC,wBAAwB,GAAG,IAAAC,QAAE,EAClC,4IACD,CAAC;EAED,MAAMC,wBAAwB,GAAG,IAAAC,kCAA2B,EAAEJ,QAAS,CAAC;EAExE,OACC,IAAAK,QAAA,CAAAC,aAAA,EAAAD,QAAA,CAAAE,QAAA,QACC,IAAAF,QAAA,CAAAC,aAAA,EAACb,WAAA,CAAAe,aAAa;IACbC,KAAK,EAAG,IAAAP,QAAE,EAAE,qBAAsB,CAAG;IACrCQ,IAAI,EAAG,IAAAR,QAAE,EACR,0DACD,CAAG;IACHS,OAAO,EAAG,CAAC,CAAEb,kBAAoB;IACjCc,QAAQ,EAAGT,wBAA0B;IACrCU,QAAQ,EAAKC,KAAK,IAAM;MACvBf,aAAa,CAAE;QACdD,kBAAkB,EAAE,CAAC,CAAEgB;MACxB,CAAE,CAAC;IACJ;EAAG,CACH,CAAC,EACAX,wBAAwB,IACzB,IAAAE,QAAA,CAAAC,aAAA,EAACb,WAAA,CAAAsB,MAAM;IACNC,MAAM,EAAC,SAAS;IAChBC,aAAa,EAAG,KAAO;IACvBC,SAAS,EAAC;EAA4C,GAEpDjB,wBACK,CAER,CAAC;AAEL"}
|
|
@@ -10,12 +10,12 @@ var _components = require("@wordpress/components");
|
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
12
|
var _compose = require("@wordpress/compose");
|
|
13
|
-
var _a11y = require("@wordpress/a11y");
|
|
14
13
|
var _orderControl = _interopRequireDefault(require("./order-control"));
|
|
15
14
|
var _authorControl = _interopRequireDefault(require("./author-control"));
|
|
16
15
|
var _parentControl = _interopRequireDefault(require("./parent-control"));
|
|
17
16
|
var _taxonomyControls = require("./taxonomy-controls");
|
|
18
17
|
var _stickyControl = _interopRequireDefault(require("./sticky-control"));
|
|
18
|
+
var _enhancedPaginationControl = _interopRequireDefault(require("./enhanced-pagination-control"));
|
|
19
19
|
var _createNewPostLink = _interopRequireDefault(require("./create-new-post-link"));
|
|
20
20
|
var _lockUnlock = require("../../../lock-unlock");
|
|
21
21
|
var _utils = require("../../utils");
|
|
@@ -35,7 +35,8 @@ function QueryInspectorControls(props) {
|
|
|
35
35
|
attributes,
|
|
36
36
|
setQuery,
|
|
37
37
|
setDisplayLayout,
|
|
38
|
-
setAttributes
|
|
38
|
+
setAttributes,
|
|
39
|
+
clientId
|
|
39
40
|
} = props;
|
|
40
41
|
const {
|
|
41
42
|
query,
|
|
@@ -106,14 +107,6 @@ function QueryInspectorControls(props) {
|
|
|
106
107
|
const showAuthorControl = (0, _utils.isControlAllowed)(allowedControls, 'author');
|
|
107
108
|
const showSearchControl = (0, _utils.isControlAllowed)(allowedControls, 'search');
|
|
108
109
|
const showParentControl = (0, _utils.isControlAllowed)(allowedControls, 'parents') && isPostTypeHierarchical;
|
|
109
|
-
const enhancedPaginationNotice = (0, _i18n.__)('Enhanced Pagination might cause interactive blocks within the Post Template to stop working. Disable it if you experience any issues.');
|
|
110
|
-
const isFirstRender = (0, _element.useRef)(true); // Don't speak on first render.
|
|
111
|
-
(0, _element.useEffect)(() => {
|
|
112
|
-
if (!isFirstRender.current && enhancedPagination) {
|
|
113
|
-
(0, _a11y.speak)(enhancedPaginationNotice);
|
|
114
|
-
}
|
|
115
|
-
isFirstRender.current = false;
|
|
116
|
-
}, [enhancedPagination, enhancedPaginationNotice]);
|
|
117
110
|
const showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl;
|
|
118
111
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(BlockInfo, null, (0, _element.createElement)(_createNewPostLink.default, {
|
|
119
112
|
...props
|
|
@@ -155,6 +148,10 @@ function QueryInspectorControls(props) {
|
|
|
155
148
|
onChange: value => setQuery({
|
|
156
149
|
sticky: value
|
|
157
150
|
})
|
|
151
|
+
}), (0, _element.createElement)(_enhancedPaginationControl.default, {
|
|
152
|
+
enhancedPagination: enhancedPagination,
|
|
153
|
+
setAttributes: setAttributes,
|
|
154
|
+
clientId: clientId
|
|
158
155
|
}))), !inherit && showFiltersPanel && (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.__experimentalToolsPanel, {
|
|
159
156
|
className: "block-library-query-toolspanel__filters",
|
|
160
157
|
label: (0, _i18n.__)('Filters'),
|
|
@@ -204,20 +201,6 @@ function QueryInspectorControls(props) {
|
|
|
204
201
|
parents: parents,
|
|
205
202
|
postType: postType,
|
|
206
203
|
onChange: setQuery
|
|
207
|
-
}))))
|
|
208
|
-
title: (0, _i18n.__)('User Experience'),
|
|
209
|
-
initialOpen: false
|
|
210
|
-
}, (0, _element.createElement)(_components.ToggleControl, {
|
|
211
|
-
label: (0, _i18n.__)('Enhanced pagination'),
|
|
212
|
-
help: (0, _i18n.__)("Don't refresh the page when paginating to another page."),
|
|
213
|
-
checked: !!enhancedPagination,
|
|
214
|
-
onChange: value => setAttributes({
|
|
215
|
-
enhancedPagination: !!value
|
|
216
|
-
})
|
|
217
|
-
}), enhancedPagination && (0, _element.createElement)("div", null, (0, _element.createElement)(_components.Notice, {
|
|
218
|
-
spokenMessage: null,
|
|
219
|
-
status: "warning",
|
|
220
|
-
isDismissible: false
|
|
221
|
-
}, enhancedPaginationNotice)))));
|
|
204
|
+
})))));
|
|
222
205
|
}
|
|
223
206
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_i18n","_blockEditor","_compose","_a11y","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_stickyControl","_createNewPostLink","_lockUnlock","_utils","BlockInfo","unlock","blockEditorPrivateApis","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","setAttributes","query","displayLayout","enhancedPagination","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","useAllowedControls","showSticky","setShowSticky","useState","postTypesTaxonomiesMap","postTypesSelectOptions","usePostTypes","taxonomies","useTaxonomies","isPostTypeHierarchical","useIsPostTypeHierarchical","useEffect","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","useCallback","debounce","cancel","showInheritControl","isControlAllowed","showPostTypeControl","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","enhancedPaginationNotice","__","isFirstRender","useRef","current","speak","showFiltersPanel","createElement","Fragment","default","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","help","checked","onChange","value","SelectControl","options","RangeControl","columns","min","max","Math","Notice","status","isDismissible","__experimentalToolsPanel","className","resetAll","__experimentalToolsPanelItem","hasValue","values","some","onDeselect","TaxonomyControls","TextControl","initialOpen","spokenMessage"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\tToggleControl,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls } from './taxonomy-controls';\nimport StickyControl from './sticky-control';\nimport CreateNewPostLink from './create-new-post-link';\nimport { unlock } from '../../../lock-unlock';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n} from '../../utils';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout, setAttributes } = props;\n\tconst { query, displayLayout, enhancedPagination } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpostType,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst [ showSticky, setShowSticky ] = useState( postType === 'post' );\n\tconst { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();\n\tconst taxonomies = useTaxonomies( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tuseEffect( () => {\n\t\tsetShowSticky( postType === 'post' );\n\t}, [ postType ] );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\tconst showInheritControl = isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst showColumnsControl = false;\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\tconst showTaxControl =\n\t\t!! taxonomies?.length &&\n\t\tisControlAllowed( allowedControls, 'taxQuery' );\n\tconst showAuthorControl = isControlAllowed( allowedControls, 'author' );\n\tconst showSearchControl = isControlAllowed( allowedControls, 'search' );\n\tconst showParentControl =\n\t\tisControlAllowed( allowedControls, 'parents' ) &&\n\t\tisPostTypeHierarchical;\n\n\tconst enhancedPaginationNotice = __(\n\t\t'Enhanced Pagination might cause interactive blocks within the Post Template to stop working. Disable it if you experience any issues.'\n\t);\n\n\tconst isFirstRender = useRef( true ); // Don't speak on first render.\n\tuseEffect( () => {\n\t\tif ( ! isFirstRender.current && enhancedPagination ) {\n\t\t\tspeak( enhancedPaginationNotice );\n\t\t}\n\t\tisFirstRender.current = false;\n\t}, [ enhancedPagination, enhancedPaginationNotice ] );\n\n\tconst showFiltersPanel =\n\t\tshowTaxControl ||\n\t\tshowAuthorControl ||\n\t\tshowSearchControl ||\n\t\tshowParentControl;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockInfo>\n\t\t\t\t<CreateNewPostLink { ...props } />\n\t\t\t</BlockInfo>\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { inherit: !! 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) }\n\t\t\t\t\t\t{ showPostTypeControl && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ __( 'Post type' ) }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.'\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\t{ showColumnsControl && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\t\tcolumns: value,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\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\t{ showOrderControl && (\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: 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) }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\"\n\t\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetQuery( { taxQuery: null } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'User Experience' ) }\n\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Enhanced pagination' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\"Don't refresh the page when paginating to another page.\"\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tchecked={ !! enhancedPagination }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tenhancedPagination: !! value,\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{ enhancedPagination && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\tspokenMessage={ null }\n\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ enhancedPaginationNotice }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAmBA,IAAAA,QAAA,GAAAC,OAAA;AAhBA,IAAAC,WAAA,GAAAD,OAAA;AAUA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,cAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,cAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,kBAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAhCA;AACA;AACA;;AAoBA;AACA;AACA;;AAgBA,MAAM;EAAEe;AAAU,CAAC,GAAG,IAAAC,kBAAM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BACK,CACJ,CAEI,CACO,CAClB,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_blockEditor","_compose","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_stickyControl","_enhancedPaginationControl","_createNewPostLink","_lockUnlock","_utils","BlockInfo","unlock","blockEditorPrivateApis","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","setAttributes","clientId","query","displayLayout","enhancedPagination","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","useAllowedControls","showSticky","setShowSticky","useState","postTypesTaxonomiesMap","postTypesSelectOptions","usePostTypes","taxonomies","useTaxonomies","isPostTypeHierarchical","useIsPostTypeHierarchical","useEffect","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","useCallback","debounce","cancel","showInheritControl","isControlAllowed","showPostTypeControl","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","showFiltersPanel","createElement","Fragment","default","InspectorControls","PanelBody","title","__","ToggleControl","__nextHasNoMarginBottom","label","help","checked","onChange","value","SelectControl","options","RangeControl","columns","min","max","Math","Notice","status","isDismissible","__experimentalToolsPanel","className","resetAll","__experimentalToolsPanelItem","hasValue","values","some","onDeselect","TaxonomyControls","TextControl"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\tToggleControl,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useEffect, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls } from './taxonomy-controls';\nimport StickyControl from './sticky-control';\nimport EnhancedPaginationControl from './enhanced-pagination-control';\nimport CreateNewPostLink from './create-new-post-link';\nimport { unlock } from '../../../lock-unlock';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n} from '../../utils';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout, setAttributes, clientId } =\n\t\tprops;\n\tconst { query, displayLayout, enhancedPagination } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpostType,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst [ showSticky, setShowSticky ] = useState( postType === 'post' );\n\tconst { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();\n\tconst taxonomies = useTaxonomies( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tuseEffect( () => {\n\t\tsetShowSticky( postType === 'post' );\n\t}, [ postType ] );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\tconst showInheritControl = isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst showColumnsControl = false;\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\tconst showTaxControl =\n\t\t!! taxonomies?.length &&\n\t\tisControlAllowed( allowedControls, 'taxQuery' );\n\tconst showAuthorControl = isControlAllowed( allowedControls, 'author' );\n\tconst showSearchControl = isControlAllowed( allowedControls, 'search' );\n\tconst showParentControl =\n\t\tisControlAllowed( allowedControls, 'parents' ) &&\n\t\tisPostTypeHierarchical;\n\n\tconst showFiltersPanel =\n\t\tshowTaxControl ||\n\t\tshowAuthorControl ||\n\t\tshowSearchControl ||\n\t\tshowParentControl;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockInfo>\n\t\t\t\t<CreateNewPostLink { ...props } />\n\t\t\t</BlockInfo>\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { inherit: !! 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) }\n\t\t\t\t\t\t{ showPostTypeControl && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ __( 'Post type' ) }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.'\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\t{ showColumnsControl && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\t\tcolumns: value,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\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\t{ showOrderControl && (\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: 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) }\n\t\t\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\t\t\tenhancedPagination={ enhancedPagination }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\"\n\t\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetQuery( { taxQuery: null } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAmBA,IAAAA,QAAA,GAAAC,OAAA;AAhBA,IAAAC,WAAA,GAAAD,OAAA;AAUA,IAAA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ACnF,WAAA,CAAA8G,4BAAc;IACdC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAE/C,WAAa;IACjC4B,KAAK,EAAG,IAAAH,QAAE,EAAE,SAAU,CAAG;IACzByB,UAAU,EAAGA,CAAA,KAAMjD,cAAc,CAAE,EAAG;EAAG,GAEzC,IAAAnE,QAAA,CAAAqF,aAAA,EAACnF,WAAA,CAAAoH,WAAW;IACXzB,uBAAuB;IACvBC,KAAK,EAAG,IAAAH,QAAE,EAAE,SAAU,CAAG;IACzBO,KAAK,EAAGhC,WAAa;IACrB+B,QAAQ,EAAG9B;EAAgB,CAC3B,CACc,CAChB,EACCgB,iBAAiB,IAClB,IAAAnF,QAAA,CAAAqF,aAAA,EAACnF,WAAA,CAAA8G,4BAAc;IACdC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAE5E,OAAO,EAAE2B,MAAQ;IACrC8B,KAAK,EAAG,IAAAH,QAAE,EAAE,SAAU,CAAG;IACzByB,UAAU,EAAGA,CAAA,KAAM9F,QAAQ,CAAE;MAAEe,OAAO,EAAE;IAAG,CAAE;EAAG,GAEhD,IAAArC,QAAA,CAAAqF,aAAA,EAAC5E,cAAA,CAAA8E,OAAa;IACblD,OAAO,EAAGA,OAAS;IACnBJ,QAAQ,EAAGA,QAAU;IACrBgE,QAAQ,EAAG3E;EAAU,CACrB,CACc,CAEN,CACM,CAEnB,CAAC;AAEL"}
|
|
@@ -14,6 +14,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
14
14
|
var _coreData = require("@wordpress/core-data");
|
|
15
15
|
var _queryToolbar = _interopRequireDefault(require("./query-toolbar"));
|
|
16
16
|
var _inspectorControls = _interopRequireDefault(require("./inspector-controls"));
|
|
17
|
+
var _enhancedPaginationModal = _interopRequireDefault(require("./enhanced-pagination-modal"));
|
|
17
18
|
/**
|
|
18
19
|
* WordPress dependencies
|
|
19
20
|
*/
|
|
@@ -113,11 +114,16 @@ function QueryContent({
|
|
|
113
114
|
section: (0, _i18n.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
|
|
114
115
|
aside: (0, _i18n.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.")
|
|
115
116
|
};
|
|
116
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(
|
|
117
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_enhancedPaginationModal.default, {
|
|
118
|
+
attributes: attributes,
|
|
119
|
+
setAttributes: setAttributes,
|
|
120
|
+
clientId: clientId
|
|
121
|
+
}), (0, _element.createElement)(_inspectorControls.default, {
|
|
117
122
|
attributes: attributes,
|
|
118
123
|
setQuery: updateQuery,
|
|
119
124
|
setDisplayLayout: updateDisplayLayout,
|
|
120
|
-
setAttributes: setAttributes
|
|
125
|
+
setAttributes: setAttributes,
|
|
126
|
+
clientId: clientId
|
|
121
127
|
}), (0, _element.createElement)(_blockEditor.BlockControls, null, (0, _element.createElement)(_queryToolbar.default, {
|
|
122
128
|
name: name,
|
|
123
129
|
clientId: clientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_compose","_blockEditor","_components","_i18n","_coreData","_queryToolbar","_interopRequireDefault","_inspectorControls","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","inherit","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","instanceId","useInstanceId","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","postsPerPage","useSelect","select","getSettings","getEntityRecord","canUser","coreStore","settingPerPage","posts_per_page","useEffect","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","__","section","aside","createElement","Fragment","default","setQuery","setDisplayLayout","BlockControls","InspectorControls","group","SelectControl","__nextHasNoMarginBottom","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport QueryToolbar from './query-toolbar';\nimport QueryInspectorControls from './inspector-controls';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getEntityRecord, canUser } = select( coreStore );\n\t\tconst settingPerPage = canUser( 'read', 'settings' )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\t\treturn {\n\t\t\tpostsPerPage: settingPerPage || DEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\t// When we inherit from global query always need to set the `perPage`\n\t\t// based on the reading settings.\n\t\tif ( inherit && query.perPage !== postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t} else if ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [ query.perPage, postsPerPage, inherit ] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [ queryId, instanceId ] );\n\tconst updateQuery = ( newQuery ) =>\n\t\tsetAttributes( { query: { ...query, ...newQuery } } );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\tconst htmlElementMessages = {\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\treturn (\n\t\t<>\n\t\t\t<QueryInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t/>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\topenPatternSelectionModal={ openPatternSelectionModal }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\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: '<main>', value: 'main' },\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\tvalue={ 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\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AAFA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAD,sBAAA,CAAAR,OAAA;AArBA;AACA;AACA;;AAeA;AACA;AACA;;AAIA,MAAMU,uBAAuB,GAAG,CAAC;AAEjC,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAoB,CAAE,CAAE;AAC9B,SAASC,YAAYA,CAAE;EACrCC,UAAU;EACVC,aAAa;EACbC,yBAAyB;E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,aAAa,EAAGA;EAAe,CAC/B,CAAC,EACF,IAAAf,QAAA,CAAA4D,aAAA,EAACxD,YAAA,CAAA6D,aAAa,QACb,IAAAjE,QAAA,CAAA4D,aAAA,EAACpD,aAAA,CAAAsD,OAAY;IACZ7C,IAAI,EAAGA,IAAM;IACbC,QAAQ,EAAGA,QAAU;IACrBJ,UAAU,EAAGA,UAAY;IACzBiD,QAAQ,EAAGb,WAAa;IACxBlC,yBAAyB,EAAGA;EAA2B,CACvD,CACa,CAAC,EAChB,IAAAhB,QAAA,CAAA4D,aAAA,EAACxD,YAAA,CAAA8D,iBAAiB;IAACC,KAAK,EAAC;EAAU,GAClC,IAAAnE,QAAA,CAAA4D,aAAA,EAACvD,WAAA,CAAA+D,aAAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,IAAAb,QAAE,EAAE,cAAe,CAAG;IAC9Bc,OAAO,EAAG,CACT;MAAED,KAAK,EAAE,IAAAb,QAAE,EAAE,iBAAkB,CAAC;MAAEe,KAAK,EAAE;IAAM,CAAC,EAChD;MAAEF,KAAK,EAAE,QAAQ;MAAEE,KAAK,EAAE;IAAO,CAAC,EAClC;MAAEF,KAAK,EAAE,WAAW;MAAEE,KAAK,EAAE;IAAU,CAAC,EACxC;MAAEF,KAAK,EAAE,SAAS;MAAEE,KAAK,EAAE;IAAQ,CAAC,CAClC;IACHA,KAAK,EAAGjD,OAAS;IACjBkD,QAAQ,EAAKD,KAAK,IACjBzD,aAAa,CAAE;MAAEO,OAAO,EAAEkD;IAAM,CAAE,CAClC;IACDE,IAAI,EAAGnB,mBAAmB,CAAEhC,OAAO;EAAI,CACvC,CACiB,CAAC,EACpB,IAAAvB,QAAA,CAAA4D,aAAA,EAACrC,OAAO;IAAA,GAAMS;EAAgB,CAAI,CACjC,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_compose","_blockEditor","_components","_i18n","_coreData","_queryToolbar","_interopRequireDefault","_inspectorControls","_enhancedPaginationModal","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","inherit","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","instanceId","useInstanceId","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","postsPerPage","useSelect","select","getSettings","getEntityRecord","canUser","coreStore","settingPerPage","posts_per_page","useEffect","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","__","section","aside","createElement","Fragment","default","setQuery","setDisplayLayout","BlockControls","InspectorControls","group","SelectControl","__nextHasNoMarginBottom","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport QueryToolbar from './query-toolbar';\nimport QueryInspectorControls from './inspector-controls';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getEntityRecord, canUser } = select( coreStore );\n\t\tconst settingPerPage = canUser( 'read', 'settings' )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\t\treturn {\n\t\t\tpostsPerPage: settingPerPage || DEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\t// When we inherit from global query always need to set the `perPage`\n\t\t// based on the reading settings.\n\t\tif ( inherit && query.perPage !== postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t} else if ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [ query.perPage, postsPerPage, inherit ] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [ queryId, instanceId ] );\n\tconst updateQuery = ( newQuery ) =>\n\t\tsetAttributes( { query: { ...query, ...newQuery } } );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\tconst htmlElementMessages = {\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<EnhancedPaginationModal\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<QueryInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\topenPatternSelectionModal={ openPatternSelectionModal }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\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: '<main>', value: 'main' },\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\tvalue={ 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\th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YAAA,CAAA+D,iBAAiB;IAACC,KAAK,EAAC;EAAU,GAClC,IAAApE,QAAA,CAAA6D,aAAA,EAACxD,WAAA,CAAAgE,aAAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,IAAAb,QAAE,EAAE,cAAe,CAAG;IAC9Bc,OAAO,EAAG,CACT;MAAED,KAAK,EAAE,IAAAb,QAAE,EAAE,iBAAkB,CAAC;MAAEe,KAAK,EAAE;IAAM,CAAC,EAChD;MAAEF,KAAK,EAAE,QAAQ;MAAEE,KAAK,EAAE;IAAO,CAAC,EAClC;MAAEF,KAAK,EAAE,WAAW;MAAEE,KAAK,EAAE;IAAU,CAAC,EACxC;MAAEF,KAAK,EAAE,SAAS;MAAEE,KAAK,EAAE;IAAQ,CAAC,CAClC;IACHA,KAAK,EAAGjD,OAAS;IACjBkD,QAAQ,EAAKD,KAAK,IACjBzD,aAAa,CAAE;MAAEO,OAAO,EAAEkD;IAAM,CAAE,CAClC;IACDE,IAAI,EAAGnB,mBAAmB,CAAEhC,OAAO;EAAI,CACvC,CACiB,CAAC,EACpB,IAAAxB,QAAA,CAAA6D,aAAA,EAACrC,OAAO;IAAA,GAAMS;EAAgB,CAAI,CACjC,CAAC;AAEL"}
|
package/build/query/utils.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.isControlAllowed = isControlAllowed;
|
|
|
8
8
|
exports.mapToIHasNameAndId = void 0;
|
|
9
9
|
exports.useAllowedControls = useAllowedControls;
|
|
10
10
|
exports.useBlockNameForPatterns = useBlockNameForPatterns;
|
|
11
|
+
exports.useContainsThirdPartyBlocks = void 0;
|
|
11
12
|
exports.useIsPostTypeHierarchical = useIsPostTypeHierarchical;
|
|
12
13
|
exports.usePostTypes = exports.usePatterns = void 0;
|
|
13
14
|
exports.useScopedBlockVariations = useScopedBlockVariations;
|
|
@@ -350,5 +351,23 @@ const usePatterns = (clientId, name) => {
|
|
|
350
351
|
return getPatternsByBlockTypes(name, rootClientId);
|
|
351
352
|
}, [name, clientId]);
|
|
352
353
|
};
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Hook that returns whether the Query Loop with the given `clientId` contains
|
|
357
|
+
* any third-party block.
|
|
358
|
+
*
|
|
359
|
+
* @param {string} clientId The block's client ID.
|
|
360
|
+
* @return {boolean} True if it contains third-party blocks.
|
|
361
|
+
*/
|
|
353
362
|
exports.usePatterns = usePatterns;
|
|
363
|
+
const useContainsThirdPartyBlocks = clientId => {
|
|
364
|
+
return (0, _data.useSelect)(select => {
|
|
365
|
+
const {
|
|
366
|
+
getClientIdsOfDescendants,
|
|
367
|
+
getBlockName
|
|
368
|
+
} = select(_blockEditor.store);
|
|
369
|
+
return getClientIdsOfDescendants(clientId).some(descendantClientId => !getBlockName(descendantClientId).startsWith('core/'));
|
|
370
|
+
}, [clientId]);
|
|
371
|
+
};
|
|
372
|
+
exports.useContainsThirdPartyBlocks = useContainsThirdPartyBlocks;
|
|
354
373
|
//# sourceMappingURL=utils.js.map
|