@wordpress/block-library 8.29.0 → 8.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/audio/edit.js +7 -17
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js.map +1 -1
- package/build/avatar/edit.js.map +1 -1
- package/build/block/deprecated.js +71 -11
- package/build/block/deprecated.js.map +1 -1
- package/build/block/edit.js +49 -24
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +2 -2
- package/build/button/edit.js.map +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/buttons/transforms.js +16 -2
- package/build/buttons/transforms.js.map +1 -1
- package/build/code/transforms.js +17 -6
- package/build/code/transforms.js.map +1 -1
- package/build/columns/edit.js +3 -2
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -1
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/cover/edit/block-controls.js +14 -3
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/resizable-cover-popover.js +0 -6
- package/build/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +6 -13
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/save.js.map +1 -1
- package/build/form-input/edit.js +1 -1
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.native.js.map +1 -1
- package/build/heading/transforms.js +17 -4
- package/build/heading/transforms.js.map +1 -1
- package/build/image/edit.js +8 -4
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +22 -8
- package/build/image/image.js.map +1 -1
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/ordered-list-settings.js +1 -1
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list-item/edit.js +1 -3
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/index.js +0 -7
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +1 -0
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +16 -7
- package/build/list-item/hooks/use-space.js.map +1 -1
- package/build/list-item/index.js +4 -1
- package/build/list-item/index.js.map +1 -1
- package/build/media-text/media-container.native.js +1 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/pattern/edit.js +11 -0
- package/build/pattern/edit.js.map +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +8 -11
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-title/edit.js +2 -2
- package/build/post-title/edit.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/utils.js +7 -5
- package/build/query/utils.js.map +1 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/quote/deprecated.js +111 -12
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +5 -5
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +1 -1
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +2 -2
- package/build/quote/save.js.map +1 -1
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js.map +1 -1
- package/build/site-logo/edit.js +7 -2
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-title/{edit/index.js → edit.js} +1 -1
- package/build/site-title/edit.js.map +1 -0
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.native.js.map +1 -1
- package/build/spacer/edit.js.map +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/index.js +53 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +2 -8
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/map-template-part-to-block-pattern.js +30 -0
- package/build/template-part/edit/utils/map-template-part-to-block-pattern.js.map +1 -0
- package/build/utils/caption.js +15 -5
- package/build/utils/caption.js.map +1 -1
- package/build/utils/get-transformed-metadata.js +57 -0
- package/build/utils/get-transformed-metadata.js.map +1 -0
- package/build/utils/hooks.js +55 -4
- package/build/utils/hooks.js.map +1 -1
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +7 -16
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +2 -7
- package/build/video/edit.native.js.map +1 -1
- package/build-module/audio/edit.js +10 -20
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/block/deprecated.js +71 -11
- package/build-module/block/deprecated.js.map +1 -1
- package/build-module/block/edit.js +49 -24
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +3 -3
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/buttons/transforms.js +16 -2
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/code/transforms.js +17 -6
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/columns/edit.js +3 -2
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -1
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +15 -4
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/resizable-cover-popover.js +1 -7
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/edit.js +7 -14
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/save.js.map +1 -1
- package/build-module/form-input/edit.js +1 -1
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.native.js.map +1 -1
- package/build-module/heading/transforms.js +17 -4
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/edit.js +9 -5
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +23 -9
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +1 -1
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list-item/edit.js +2 -4
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/index.js +0 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +1 -0
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +17 -8
- package/build-module/list-item/hooks/use-space.js.map +1 -1
- package/build-module/list-item/index.js +4 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/pattern/edit.js +11 -0
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +9 -12
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-title/edit.js +2 -2
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/utils.js +7 -5
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +112 -13
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +5 -5
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +2 -2
- package/build-module/quote/save.js.map +1 -1
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +1 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/site-logo/edit.js +7 -2
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-title/{edit/index.js → edit.js} +1 -1
- package/build-module/site-title/edit.js.map +1 -0
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +57 -5
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +2 -8
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js +24 -0
- package/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js.map +1 -0
- package/build-module/utils/caption.js +13 -3
- package/build-module/utils/caption.js.map +1 -1
- package/build-module/utils/get-transformed-metadata.js +51 -0
- package/build-module/utils/get-transformed-metadata.js.map +1 -0
- package/build-module/utils/hooks.js +54 -3
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +10 -19
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +2 -7
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/common-rtl.css +1 -0
- package/build-style/common.css +1 -0
- package/build-style/cover/style-rtl.css +2 -1
- package/build-style/cover/style.css +2 -1
- package/build-style/editor-rtl.css +4 -1
- package/build-style/editor.css +4 -1
- package/build-style/group/editor-rtl.css +1 -1
- package/build-style/group/editor.css +1 -1
- package/build-style/image/editor-rtl.css +3 -0
- package/build-style/image/editor.css +3 -0
- package/build-style/search/style-rtl.css +2 -0
- package/build-style/search/style.css +2 -0
- package/build-style/style-rtl.css +4 -1
- package/build-style/style.css +4 -1
- package/package.json +34 -34
- package/src/audio/edit.js +9 -19
- package/src/audio/edit.native.js +3 -3
- package/src/avatar/edit.js +1 -1
- package/src/block/deprecated.js +76 -11
- package/src/block/edit.js +64 -19
- package/src/block/index.php +23 -12
- package/src/button/edit.js +4 -3
- package/src/buttons/edit.native.js +1 -1
- package/src/buttons/transforms.js +14 -4
- package/src/calendar/index.php +5 -0
- package/src/code/transforms.js +20 -5
- package/src/columns/edit.js +3 -2
- package/src/comment-author-avatar/edit.js +1 -1
- package/src/comments/index.php +2 -0
- package/src/cover/edit/block-controls.js +16 -2
- package/src/cover/edit/index.js +2 -2
- package/src/cover/edit/inspector-controls.js +1 -1
- package/src/cover/edit/resizable-cover-popover.js +1 -6
- package/src/cover/edit.native.js +1 -1
- package/src/cover/style.scss +3 -2
- package/src/file/deprecated.js +3 -3
- package/src/file/edit.js +8 -15
- package/src/file/edit.native.js +4 -4
- package/src/file/save.js +1 -1
- package/src/footnotes/index.php +1 -1
- package/src/form-input/edit.js +1 -1
- package/src/gallery/edit.js +3 -3
- package/src/gallery/gallery.native.js +1 -1
- package/src/gallery/test/index.native.js +1 -1
- package/src/gallery/v1/edit.js +2 -2
- package/src/gallery/v1/gallery.native.js +1 -1
- package/src/group/editor.scss +1 -1
- package/src/heading/transforms.js +27 -8
- package/src/image/edit.js +13 -5
- package/src/image/edit.native.js +1 -1
- package/src/image/editor.scss +6 -0
- package/src/image/image.js +34 -22
- package/src/latest-posts/edit.native.js +1 -1
- package/src/list/ordered-list-settings.js +1 -1
- package/src/list-item/edit.js +1 -2
- package/src/list-item/edit.native.js +1 -1
- package/src/list-item/hooks/index.js +0 -1
- package/src/list-item/hooks/use-indent-list-item.js +2 -0
- package/src/list-item/hooks/use-outdent-list-item.js +2 -0
- package/src/list-item/hooks/use-space.js +16 -9
- package/src/list-item/index.js +3 -0
- package/src/media-text/media-container.native.js +5 -3
- package/src/media-text/test/edit.native.js +58 -0
- package/src/missing/test/edit-integration.native.js +2 -1
- package/src/navigation/edit/index.js +1 -1
- package/src/navigation/edit/test/navigation-menu-selector.js +3 -3
- package/src/navigation/index.php +26 -17
- package/src/navigation-link/link-ui.js +2 -2
- package/src/paragraph/edit.native.js +1 -1
- package/src/paragraph/test/edit.native.js +36 -0
- package/src/pattern/edit.js +14 -0
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-featured-image/dimension-controls.js +4 -4
- package/src/post-featured-image/edit.js +10 -12
- package/src/post-navigation-link/edit.js +1 -1
- package/src/post-template/index.php +2 -0
- package/src/post-title/edit.js +49 -43
- package/src/query/edit/pattern-selection-modal.js +1 -1
- package/src/query/utils.js +6 -4
- package/src/query-pagination-next/edit.js +1 -1
- package/src/query-pagination-previous/edit.js +1 -1
- package/src/quote/block.json +1 -1
- package/src/quote/deprecated.js +110 -15
- package/src/quote/edit.js +5 -5
- package/src/quote/save.js +2 -2
- package/src/quote/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/read-more/edit.js +1 -1
- package/src/search/edit.js +1 -1
- package/src/search/edit.native.js +4 -4
- package/src/search/index.php +1 -1
- package/src/search/style.scss +2 -0
- package/src/site-logo/edit.js +11 -6
- package/src/social-link/edit.js +1 -1
- package/src/social-links/edit.native.js +1 -1
- package/src/spacer/edit.js +1 -1
- package/src/table-of-contents/edit.js +1 -1
- package/src/template-part/edit/index.js +91 -4
- package/src/template-part/edit/selection-modal.js +4 -8
- package/src/template-part/edit/utils/map-template-part-to-block-pattern.js +23 -0
- package/src/utils/caption.js +10 -1
- package/src/utils/get-transformed-metadata.js +65 -0
- package/src/utils/hooks.js +53 -3
- package/src/video/edit-common-settings.js +1 -1
- package/src/video/edit.js +10 -18
- package/src/video/edit.native.js +5 -8
- package/src/video/test/edit.native.js +0 -14
- package/build/list-item/hooks/use-copy.js +0 -39
- package/build/list-item/hooks/use-copy.js.map +0 -1
- package/build/site-title/edit/index.js.map +0 -1
- package/build-module/list-item/hooks/use-copy.js +0 -32
- package/build-module/list-item/hooks/use-copy.js.map +0 -1
- package/build-module/site-title/edit/index.js.map +0 -1
- package/src/list-item/hooks/use-copy.js +0 -38
- /package/src/site-title/{edit/index.js → edit.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_components","_i18n","_blocks","_coreData","_hooks","PostTitleEdit","attributes","level","textAlign","isLink","rel","linkTarget","setAttributes","context","postType","postId","queryId","insertBlocksAfter","TagName","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","useCanEditEntity","rawTitle","setTitle","fullTitle","useEntityProp","link","onSplitAtEnd","createBlock","getDefaultBlockName","blockProps","useBlockProps","className","classnames","blockEditingMode","useBlockEditingMode","titleElement","_react","createElement","__","PlainText","tagName","placeholder","value","onChange","__experimentalVersion","__unstableOnSplitAtEnd","dangerouslySetInnerHTML","__html","rendered","href","target","length","onClick","event","preventDefault","Fragment","BlockControls","group","HeadingLevelDropdown","newLevel","AlignmentControl","nextAlign","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","TextControl","newRel"],"sources":["@wordpress/block-library/src/post-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tPlainText,\n\tHeadingLevelDropdown,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { ToggleControl, TextControl, PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nexport default function PostTitleEdit( {\n\tattributes: { level, textAlign, isLink, rel, linkTarget },\n\tsetAttributes,\n\tcontext: { postType, postId, queryId },\n\tinsertBlocksAfter,\n} ) {\n\tconst TagName = 'h' + level;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\t/**\n\t * Hack: useCanEditEntity may trigger an OPTIONS request to the REST API via the canUser resolver.\n\t * However, when the Post Title is a descendant of a Query Loop block, the title cannot be edited.\n\t * In order to avoid these unnecessary requests, we call the hook without\n\t * the proper data, resulting in returning early without making them.\n\t */\n\tconst userCanEdit = useCanEditEntity(\n\t\t'postType',\n\t\t! isDescendentOfQueryLoop && postType,\n\t\tpostId\n\t);\n\tconst [ rawTitle = '', setTitle, fullTitle ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'title',\n\t\tpostId\n\t);\n\tconst [ link ] = useEntityProp( 'postType', postType, 'link', postId );\n\tconst onSplitAtEnd = () => {\n\t\tinsertBlocksAfter( createBlock( getDefaultBlockName() ) );\n\t};\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tlet titleElement = <TagName { ...blockProps }>{ __( 'Title' ) }</TagName>;\n\n\tif ( postType && postId ) {\n\t\ttitleElement = userCanEdit ? (\n\t\t\t<PlainText\n\t\t\t\ttagName={ TagName }\n\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\tvalue={ rawTitle }\n\t\t\t\tonChange={ setTitle }\n\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t__unstableOnSplitAtEnd={ onSplitAtEnd }\n\t\t\t\t{ ...blockProps }\n\t\t\t/>\n\t\t) : (\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tdangerouslySetInnerHTML={ { __html: fullTitle?.rendered } }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isLink && postType && postId ) {\n\t\ttitleElement = userCanEdit ? (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<PlainText\n\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\thref={ link }\n\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\trel={ rel }\n\t\t\t\t\tplaceholder={ ! rawTitle.length ? __( 'No Title' ) : null }\n\t\t\t\t\tvalue={ rawTitle }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\t__unstableOnSplitAtEnd={ onSplitAtEnd }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t) : (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<a\n\t\t\t\t\thref={ link }\n\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\trel={ rel }\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t__html: fullTitle?.rendered,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\t\tvalue={ level }\n\t\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Make title a link' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<>\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={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t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G,CACH,CACa,CACf,EACD,IAAAzB,MAAA,CAAAC,aAAA,EAACzC,YAAA,CAAAkE,iBAAiB,QACjB,IAAA1B,MAAA,CAAAC,aAAA,EAACxC,WAAA,CAAAkE,SAAS;IAACC,KAAK,EAAG,IAAA1B,QAAE,EAAE,UAAW;EAAG,GACpC,IAAAF,MAAA,CAAAC,aAAA,EAACxC,WAAA,CAAAoE,aAAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,IAAA7B,QAAE,EAAE,mBAAoB,CAAG;IACnCK,QAAQ,EAAGA,CAAA,KAAMlC,aAAa,CAAE;MAAEH,MAAM,EAAE,CAAEA;IAAO,CAAE,CAAG;IACxD8D,OAAO,EAAG9D;EAAQ,CAClB,CAAC,EACAA,MAAM,IACP,IAAA8B,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAmB,QAAA,QACC,IAAAnB,MAAA,CAAAC,aAAA,EAACxC,WAAA,CAAAoE,aAAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,IAAA7B,QAAE,EAAE,iBAAkB,CAAG;IACjCK,QAAQ,EAAKD,KAAK,IACjBjC,aAAa,CAAE;MACdD,UAAU,EAAEkC,KAAK,GAAG,QAAQ,GAAG;IAChC,CAAE,CACF;IACD0B,OAAO,EAAG5D,UAAU,KAAK;EAAU,CACnC,CAAC,EACF,IAAA4B,MAAA,CAAAC,aAAA,EAACxC,WAAA,CAAAwE,WAAW;IACXH,uBAAuB;IACvBC,KAAK,EAAG,IAAA7B,QAAE,EAAE,UAAW,CAAG;IAC1BI,KAAK,EAAGnC,GAAK;IACboC,QAAQ,EAAK2B,MAAM,IAClB7D,aAAa,CAAE;MAAEF,GAAG,EAAE+D;IAAO,CAAE;EAC/B,CACD,CACA,CAEO,CACO,CAAC,EAClBnC,YACD,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_components","_i18n","_blocks","_coreData","_hooks","PostTitleEdit","attributes","level","textAlign","isLink","rel","linkTarget","setAttributes","context","postType","postId","queryId","insertBlocksAfter","TagName","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","useCanEditEntity","rawTitle","setTitle","fullTitle","useEntityProp","link","onSplitAtEnd","createBlock","getDefaultBlockName","blockProps","useBlockProps","className","classnames","blockEditingMode","useBlockEditingMode","titleElement","_react","createElement","__","PlainText","tagName","placeholder","value","onChange","__experimentalVersion","__unstableOnSplitAtEnd","dangerouslySetInnerHTML","__html","rendered","href","target","length","onClick","event","preventDefault","Fragment","BlockControls","group","HeadingLevelDropdown","newLevel","AlignmentControl","nextAlign","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","TextControl","newRel"],"sources":["@wordpress/block-library/src/post-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tPlainText,\n\tHeadingLevelDropdown,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { ToggleControl, TextControl, PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nexport default function PostTitleEdit( {\n\tattributes: { level, textAlign, isLink, rel, linkTarget },\n\tsetAttributes,\n\tcontext: { postType, postId, queryId },\n\tinsertBlocksAfter,\n} ) {\n\tconst TagName = 'h' + level;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\t/**\n\t * Hack: useCanEditEntity may trigger an OPTIONS request to the REST API via the canUser resolver.\n\t * However, when the Post Title is a descendant of a Query Loop block, the title cannot be edited.\n\t * In order to avoid these unnecessary requests, we call the hook without\n\t * the proper data, resulting in returning early without making them.\n\t */\n\tconst userCanEdit = useCanEditEntity(\n\t\t'postType',\n\t\t! isDescendentOfQueryLoop && postType,\n\t\tpostId\n\t);\n\tconst [ rawTitle = '', setTitle, fullTitle ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'title',\n\t\tpostId\n\t);\n\tconst [ link ] = useEntityProp( 'postType', postType, 'link', postId );\n\tconst onSplitAtEnd = () => {\n\t\tinsertBlocksAfter( createBlock( getDefaultBlockName() ) );\n\t};\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tlet titleElement = <TagName { ...blockProps }>{ __( 'Title' ) }</TagName>;\n\n\tif ( postType && postId ) {\n\t\ttitleElement = userCanEdit ? (\n\t\t\t<PlainText\n\t\t\t\ttagName={ TagName }\n\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\tvalue={ rawTitle }\n\t\t\t\tonChange={ setTitle }\n\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t__unstableOnSplitAtEnd={ onSplitAtEnd }\n\t\t\t\t{ ...blockProps }\n\t\t\t/>\n\t\t) : (\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tdangerouslySetInnerHTML={ { __html: fullTitle?.rendered } }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isLink && postType && postId ) {\n\t\ttitleElement = userCanEdit ? (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<PlainText\n\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\thref={ link }\n\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\trel={ rel }\n\t\t\t\t\tplaceholder={ ! rawTitle.length ? __( 'No Title' ) : null }\n\t\t\t\t\tvalue={ rawTitle }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\t__unstableOnSplitAtEnd={ onSplitAtEnd }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t) : (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<a\n\t\t\t\t\thref={ link }\n\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\trel={ rel }\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t__html: fullTitle?.rendered,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\t\t\tvalue={ level }\n\t\t\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<InspectorControls>\n\t\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\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={ __( 'Make title a link' ) }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tlinkTarget: value\n\t\t\t\t\t\t\t\t\t\t\t\t\t? '_blank'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: '_self',\n\t\t\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\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</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t</InspectorControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ titleElement }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAGe,SAASO,aAAaA,CAAE;EACtCC,UAAU,EAAE;IAAEC,KAAK;IAAEC,SAAS;IAAEC,MAAM;IAAEC,GAAG;IAAEC;EA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AAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,IAAA7B,QAAE,EAAE,iBAAkB,CAAG;IACjCK,QAAQ,EAAKD,KAAK,IACjBjC,aAAa,CAAE;MACdD,UAAU,EAAEkC,KAAK,GACd,QAAQ,GACR;IACJ,CAAE,CACF;IACD0B,OAAO,EAAG5D,UAAU,KAAK;EAAU,CACnC,CAAC,EACF,IAAA4B,MAAA,CAAAC,aAAA,EAACxC,WAAA,CAAAwE,WAAW;IACXH,uBAAuB;IACvBC,KAAK,EAAG,IAAA7B,QAAE,EAAE,UAAW,CAAG;IAC1BI,KAAK,EAAGnC,GAAK;IACboC,QAAQ,EAAK2B,MAAM,IAClB7D,aAAa,CAAE;MAAEF,GAAG,EAAE+D;IAAO,CAAE;EAC/B,CACD,CACA,CAEO,CACO,CAClB,CACF,EACCnC,YACD,CAAC;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_components","_compose","_blockEditor","_i18n","_utils","_searchPatterns","PatternSelectionModal","clientId","attributes","setIsPatternSelectionModalOpen","searchValue","setSearchValue","useState","replaceBlock","selectBlock","useDispatch","blockEditorStore","onBlockPatternSelect","pattern","blocks","newBlocks","queryClientIds","getTransformedBlocksFromPattern","blockPreviewContext","useMemo","previewPostType","query","postType","blockNameForPatterns","useBlockNameForPatterns","blockPatterns","usePatterns","filteredBlockPatterns","searchPatterns","shownBlockPatterns","useAsyncList","_react","createElement","Modal","overlayClassName","title","__","onRequestClose","isFullScreen","className","SearchControl","__nextHasNoMarginBottom","onChange","value","label","placeholder","BlockContextProvider","__experimentalBlockPatternsList","shownPatterns","onClickPattern"],"sources":["@wordpress/block-library/src/query/edit/pattern-selection-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { Modal, SearchControl } from '@wordpress/components';\nimport { useAsyncList } from '@wordpress/compose';\nimport {\n\tBlockContextProvider,\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockNameForPatterns,\n\tgetTransformedBlocksFromPattern,\n\tusePatterns,\n} from '../utils';\nimport { searchPatterns } from '../../utils/search-patterns';\n\nexport default function PatternSelectionModal( {\n\tclientId,\n\tattributes,\n\tsetIsPatternSelectionModalOpen,\n} ) {\n\tconst [ searchValue, setSearchValue ] = useState( '' );\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst onBlockPatternSelect = ( pattern, blocks ) => {\n\t\tconst { newBlocks, queryClientIds } = getTransformedBlocksFromPattern(\n\t\t\tblocks,\n\t\t\tattributes\n\t\t);\n\t\treplaceBlock( clientId, newBlocks );\n\t\tif ( queryClientIds[ 0 ] ) {\n\t\t\tselectBlock( queryClientIds[ 0 ] );\n\t\t}\n\t};\n\t// When we preview Query Loop blocks we should prefer the current\n\t// block's postType, which is passed through block context.\n\tconst blockPreviewContext = useMemo(\n\t\t() => ( {\n\t\t\tpreviewPostType: attributes.query.postType,\n\t\t} ),\n\t\t[ attributes.query.postType ]\n\t);\n\tconst blockNameForPatterns = useBlockNameForPatterns(\n\t\tclientId,\n\t\tattributes\n\t);\n\tconst blockPatterns = usePatterns( clientId, blockNameForPatterns );\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\treturn searchPatterns( blockPatterns, searchValue );\n\t}, [ blockPatterns, searchValue ] );\n\tconst shownBlockPatterns = useAsyncList( filteredBlockPatterns );\n\n\treturn (\n\t\t<Modal\n\t\t\toverlayClassName=\"block-library-query-pattern__selection-modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tonRequestClose={ () => setIsPatternSelectionModalOpen( false ) }\n\t\t\tisFullScreen
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_components","_compose","_blockEditor","_i18n","_utils","_searchPatterns","PatternSelectionModal","clientId","attributes","setIsPatternSelectionModalOpen","searchValue","setSearchValue","useState","replaceBlock","selectBlock","useDispatch","blockEditorStore","onBlockPatternSelect","pattern","blocks","newBlocks","queryClientIds","getTransformedBlocksFromPattern","blockPreviewContext","useMemo","previewPostType","query","postType","blockNameForPatterns","useBlockNameForPatterns","blockPatterns","usePatterns","filteredBlockPatterns","searchPatterns","shownBlockPatterns","useAsyncList","_react","createElement","Modal","overlayClassName","title","__","onRequestClose","isFullScreen","className","SearchControl","__nextHasNoMarginBottom","onChange","value","label","placeholder","BlockContextProvider","__experimentalBlockPatternsList","shownPatterns","onClickPattern"],"sources":["@wordpress/block-library/src/query/edit/pattern-selection-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { Modal, SearchControl } from '@wordpress/components';\nimport { useAsyncList } from '@wordpress/compose';\nimport {\n\tBlockContextProvider,\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockNameForPatterns,\n\tgetTransformedBlocksFromPattern,\n\tusePatterns,\n} from '../utils';\nimport { searchPatterns } from '../../utils/search-patterns';\n\nexport default function PatternSelectionModal( {\n\tclientId,\n\tattributes,\n\tsetIsPatternSelectionModalOpen,\n} ) {\n\tconst [ searchValue, setSearchValue ] = useState( '' );\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst onBlockPatternSelect = ( pattern, blocks ) => {\n\t\tconst { newBlocks, queryClientIds } = getTransformedBlocksFromPattern(\n\t\t\tblocks,\n\t\t\tattributes\n\t\t);\n\t\treplaceBlock( clientId, newBlocks );\n\t\tif ( queryClientIds[ 0 ] ) {\n\t\t\tselectBlock( queryClientIds[ 0 ] );\n\t\t}\n\t};\n\t// When we preview Query Loop blocks we should prefer the current\n\t// block's postType, which is passed through block context.\n\tconst blockPreviewContext = useMemo(\n\t\t() => ( {\n\t\t\tpreviewPostType: attributes.query.postType,\n\t\t} ),\n\t\t[ attributes.query.postType ]\n\t);\n\tconst blockNameForPatterns = useBlockNameForPatterns(\n\t\tclientId,\n\t\tattributes\n\t);\n\tconst blockPatterns = usePatterns( clientId, blockNameForPatterns );\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\treturn searchPatterns( blockPatterns, searchValue );\n\t}, [ blockPatterns, searchValue ] );\n\tconst shownBlockPatterns = useAsyncList( filteredBlockPatterns );\n\n\treturn (\n\t\t<Modal\n\t\t\toverlayClassName=\"block-library-query-pattern__selection-modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tonRequestClose={ () => setIsPatternSelectionModalOpen( false ) }\n\t\t\tisFullScreen\n\t\t>\n\t\t\t<div className=\"block-library-query-pattern__selection-content\">\n\t\t\t\t<div className=\"block-library-query-pattern__selection-search\">\n\t\t\t\t\t<SearchControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tonChange={ setSearchValue }\n\t\t\t\t\t\tvalue={ searchValue }\n\t\t\t\t\t\tlabel={ __( 'Search for patterns' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<BlockContextProvider value={ blockPreviewContext }>\n\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\tblockPatterns={ filteredBlockPatterns }\n\t\t\t\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\t\t\t\tonClickPattern={ onBlockPatternSelect }\n\t\t\t\t\t/>\n\t\t\t\t</BlockContextProvider>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AA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G,IAAAC,qBAAY,EAAEH,qBAAsB,CAAC;EAEhE,OACC,IAAAI,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAAsC,KAAK;IACLC,gBAAgB,EAAC,8CAA8C;IAC/DC,KAAK,EAAG,IAAAC,QAAE,EAAE,kBAAmB,CAAG;IAClCC,cAAc,EAAGA,CAAA,KAAMjC,8BAA8B,CAAE,KAAM,CAAG;IAChEkC,YAAY;EAAA,GAEZ,IAAAP,MAAA,CAAAC,aAAA;IAAKO,SAAS,EAAC;EAAgD,GAC9D,IAAAR,MAAA,CAAAC,aAAA;IAAKO,SAAS,EAAC;EAA+C,GAC7D,IAAAR,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAA6C,aAAa;IACbC,uBAAuB;IACvBC,QAAQ,EAAGpC,cAAgB;IAC3BqC,KAAK,EAAGtC,WAAa;IACrBuC,KAAK,EAAG,IAAAR,QAAE,EAAE,qBAAsB,CAAG;IACrCS,WAAW,EAAG,IAAAT,QAAE,EAAE,QAAS;EAAG,CAC9B,CACG,CAAC,EACN,IAAAL,MAAA,CAAAC,aAAA,EAACnC,YAAA,CAAAiD,oBAAoB;IAACH,KAAK,EAAGzB;EAAqB,GAClD,IAAAa,MAAA,CAAAC,aAAA,EAACnC,YAAA,CAAAkD,+BAAiB;IACjBtB,aAAa,EAAGE,qBAAuB;IACvCqB,aAAa,EAAGnB,kBAAoB;IACpCoB,cAAc,EAAGrC;EAAsB,CACvC,CACoB,CAClB,CACC,CAAC;AAEV"}
|
package/build/query/utils.js
CHANGED
|
@@ -161,14 +161,16 @@ const useTaxonomies = postType => {
|
|
|
161
161
|
const {
|
|
162
162
|
getTaxonomies
|
|
163
163
|
} = select(_coreData.store);
|
|
164
|
-
|
|
164
|
+
return getTaxonomies({
|
|
165
165
|
type: postType,
|
|
166
|
-
per_page: -1
|
|
167
|
-
context: 'view'
|
|
166
|
+
per_page: -1
|
|
168
167
|
});
|
|
169
|
-
return filteredTaxonomies;
|
|
170
168
|
}, [postType]);
|
|
171
|
-
return
|
|
169
|
+
return (0, _element.useMemo)(() => {
|
|
170
|
+
return taxonomies?.filter(({
|
|
171
|
+
visibility
|
|
172
|
+
}) => !!visibility?.publicly_queryable);
|
|
173
|
+
}, [taxonomies]);
|
|
172
174
|
};
|
|
173
175
|
|
|
174
176
|
/**
|
package/build/query/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_coreData","_blockEditor","_htmlEntities","_blocks","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","exports","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","decodeEntities","usePostTypes","postTypes","useSelect","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","useMemo","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","blocksStore","getActiveBlockVariation","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","cloneBlock","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","hasActiveVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","namespace","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","startsWith","hasBlocksFromPlugins","hasPostContentBlock","hasUnsupportedBlocks"],"sources":["@wordpress/block-library/src/query/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { cloneBlock, store as blocksStore } from '@wordpress/blocks';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( getValueFromObjectPath( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) return;\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\treturn { postTypesTaxonomiesMap, postTypesSelectOptions };\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn taxonomies;\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\tconst activeVariationName = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `core/query/${ activeVariationName }`;\n\tconst hasActiveVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\tblockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t\treturn activePatterns.length > 0;\n\t\t},\n\t\t[ clientId, activeVariationName, blockName ]\n\t);\n\treturn hasActiveVariationPatterns ? blockName : 'core/query';\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\t'core/query',\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( 'core/query', 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n\n/**\n * Hook that returns the block patterns for a specific block type.\n *\n * @param {string} clientId The block's client ID.\n * @param {string} name The block type name.\n * @return {Object[]} An array of valid block patterns.\n */\nexport const usePatterns = ( clientId, name ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( name, rootClientId );\n\t\t},\n\t\t[ name, clientId ]\n\t);\n};\n\n/**\n * The object returned by useUnsupportedBlocks with info about the type of\n * unsupported blocks present inside the Query block.\n *\n * @typedef {Object} UnsupportedBlocksInfo\n * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present.\n * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present.\n * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks.\n */\n\n/**\n * Hook that returns an object with information about the unsupported blocks\n * present inside a Query Loop with the given `clientId`. The returned object\n * contains props that are true when a certain type of unsupported block is\n * present.\n *\n * @param {string} clientId The block's client ID.\n * @return {UnsupportedBlocksInfo} The object containing the information.\n */\nexport const useUnsupportedBlocks = ( clientId ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getClientIdsOfDescendants, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst blocks = {};\n\t\t\tgetClientIdsOfDescendants( clientId ).forEach(\n\t\t\t\t( descendantClientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( descendantClientId );\n\t\t\t\t\tif ( ! blockName.startsWith( 'core/' ) ) {\n\t\t\t\t\t\tblocks.hasBlocksFromPlugins = true;\n\t\t\t\t\t} else if ( blockName === 'core/post-content' ) {\n\t\t\t\t\t\tblocks.hasPostContentBlock = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\tblocks.hasUnsupportedBlocks =\n\t\t\t\tblocks.hasBlocksF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C3B,MAAMC,YAAY,GAAGH,oBAAoB,CAAER,QAAS,CAAC;IACrD,OAAOS,uBAAuB,CAAEvE,IAAI,EAAEyE,YAAa,CAAC;EACrD,CAAC,EACD,CAAEzE,IAAI,EAAE8D,QAAQ,CACjB,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA5D,OAAA,CAAAiF,WAAA,GAAAA,WAAA;AASO,MAAMC,oBAAoB,GAAKtB,QAAQ,IAAM;EACnD,OAAO,IAAA9C,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MAAEoE,yBAAyB;MAAEC;IAAa,CAAC,GAChDrE,MAAM,CAAEuD,kBAAiB,CAAC;IAC3B,MAAMpB,MAAM,GAAG,CAAC,CAAC;IACjBiC,yBAAyB,CAAEvB,QAAS,CAAC,CAACrD,OAAO,CAC1C8E,kBAAkB,IAAM;MACzB,MAAMnB,SAAS,GAAGkB,YAAY,CAAEC,kBAAmB,CAAC;MACpD,IAAK,CAAEnB,SAAS,CAACoB,UAAU,CAAE,OAAQ,CAAC,EAAG;QACxCpC,MAAM,CAACqC,oBAAoB,GAAG,IAAI;MACnC,CAAC,MAAM,IAAKrB,SAAS,KAAK,mBAAmB,EAAG;QAC/ChB,MAAM,CAACsC,mBAAmB,GAAG,IAAI;MAClC;IACD,CACD,CAAC;IACDtC,MAAM,CAACuC,oBAAoB,GAC1BvC,MAAM,CAACqC,oBAAoB,IAAIrC,MAAM,CAACsC,mBAAmB;IAC1D,OAAOtC,MAAM;EACd,CAAC,EACD,CAAEU,QAAQ,CACX,CAAC;AACF,CAAC;AAAC5D,OAAA,CAAAkF,oBAAA,GAAAA,oBAAA"}
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_coreData","_blockEditor","_htmlEntities","_blocks","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","exports","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","decodeEntities","usePostTypes","postTypes","useSelect","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","useMemo","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","visibility","publicly_queryable","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","blocksStore","getActiveBlockVariation","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","cloneBlock","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","hasActiveVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","activePatterns","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","namespace","connectedVariations","usePatterns","useUnsupportedBlocks","getClientIdsOfDescendants","getBlockName","descendantClientId","startsWith","hasBlocksFromPlugins","hasPostContentBlock","hasUnsupportedBlocks"],"sources":["@wordpress/block-library/src/query/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { cloneBlock, store as blocksStore } from '@wordpress/blocks';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( getValueFromObjectPath( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) return;\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\treturn { postTypesTaxonomiesMap, postTypesSelectOptions };\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\treturn getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn taxonomies?.filter(\n\t\t\t( { visibility } ) => !! visibility?.publicly_queryable\n\t\t);\n\t}, [ taxonomies ] );\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\tconst activeVariationName = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `core/query/${ activeVariationName }`;\n\tconst hasActiveVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\tblockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t\treturn activePatterns.length > 0;\n\t\t},\n\t\t[ clientId, activeVariationName, blockName ]\n\t);\n\treturn hasActiveVariationPatterns ? blockName : 'core/query';\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\t'core/query',\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( 'core/query', 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n\n/**\n * Hook that returns the block patterns for a specific block type.\n *\n * @param {string} clientId The block's client ID.\n * @param {string} name The block type name.\n * @return {Object[]} An array of valid block patterns.\n */\nexport const usePatterns = ( clientId, name ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( name, rootClientId );\n\t\t},\n\t\t[ name, clientId ]\n\t);\n};\n\n/**\n * The object returned by useUnsupportedBlocks with info about the type of\n * unsupported blocks present inside the Query block.\n *\n * @typedef {Object} UnsupportedBlocksInfo\n * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present.\n * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present.\n * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks.\n */\n\n/**\n * Hook that returns an object with information about the unsupported blocks\n * present inside a Query Loop with the given `clientId`. The returned object\n * contains props that are true when a certain type of unsupported block is\n * present.\n *\n * @param {string} clientId The block's client ID.\n * @return {UnsupportedBlocksInfo} The object containing the information.\n */\nexport const useUnsupportedBlocks = ( clientId ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getClientIdsOfDescendants, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst blocks = {};\n\t\t\tgetClientIdsOfDescendants( clientId ).forEach(\n\t\t\t\t( descendantClientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( descendantClientId );\n\t\t\t\t\tif ( ! blockName.startsWith( 'core/' ) ) {\n\t\t\t\t\t\tblocks.hasBlocksFromPlugins = true;\n\t\t\t\t\t} else if ( blockName === 'core/post-content' ) {\n\t\t\t\t\t\tblocks.hasPostContentBlock = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\tblocks.hasUnsupportedBlocks =\n\t\t\t\tblocks.hasBlocksFromPlugins || blocks.hasPostContentBlock;\n\t\t\treturn blocks;\n\t\t},\n\t\t[ clientId ]\n\t);\n};\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA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A;AACA;AACA;AACA;AACA;AARA5D,OAAA,CAAAiF,WAAA,GAAAA,WAAA;AASO,MAAMC,oBAAoB,GAAKtB,QAAQ,IAAM;EACnD,OAAO,IAAA9C,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MAAEoE,yBAAyB;MAAEC;IAAa,CAAC,GAChDrE,MAAM,CAAEuD,kBAAiB,CAAC;IAC3B,MAAMpB,MAAM,GAAG,CAAC,CAAC;IACjBiC,yBAAyB,CAAEvB,QAAS,CAAC,CAACrD,OAAO,CAC1C8E,kBAAkB,IAAM;MACzB,MAAMnB,SAAS,GAAGkB,YAAY,CAAEC,kBAAmB,CAAC;MACpD,IAAK,CAAEnB,SAAS,CAACoB,UAAU,CAAE,OAAQ,CAAC,EAAG;QACxCpC,MAAM,CAACqC,oBAAoB,GAAG,IAAI;MACnC,CAAC,MAAM,IAAKrB,SAAS,KAAK,mBAAmB,EAAG;QAC/ChB,MAAM,CAACsC,mBAAmB,GAAG,IAAI;MAClC;IACD,CACD,CAAC;IACDtC,MAAM,CAACuC,oBAAoB,GAC1BvC,MAAM,CAACqC,oBAAoB,IAAIrC,MAAM,CAACsC,mBAAmB;IAC1D,OAAOtC,MAAM;EACd,CAAC,EACD,CAAEU,QAAQ,CACX,CAAC;AACF,CAAC;AAAC5D,OAAA,CAAAkF,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","arrowMap","none","arrow","chevron","QueryPaginationNextEdit","attributes","label","setAttributes","context","paginationArrow","showLabel","displayArrow","_react","createElement","href","onClick","event","preventDefault","useBlockProps","PlainText","__experimentalVersion","tagName","__","placeholder","value","onChange","newLabel","className"],"sources":["@wordpress/block-library/src/query-pagination-next/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '→',\n\tchevron: '»',\n};\n\nexport default function QueryPaginationNextEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-next-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ showLabel && (\n\t\t\t\t<PlainText\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\taria-label={ __( 'Next page link' ) }\n\t\t\t\t\tplaceholder={ __( 'Next Page' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-next-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","arrowMap","none","arrow","chevron","QueryPaginationNextEdit","attributes","label","setAttributes","context","paginationArrow","showLabel","displayArrow","_react","createElement","href","onClick","event","preventDefault","useBlockProps","PlainText","__experimentalVersion","tagName","__","placeholder","value","onChange","newLabel","className"],"sources":["@wordpress/block-library/src/query-pagination-next/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '→',\n\tchevron: '»',\n};\n\nexport default function QueryPaginationNextEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-next-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ showLabel && (\n\t\t\t\t<PlainText\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\taria-label={ __( 'Next page link' ) }\n\t\t\t\t\tplaceholder={ __( 'Next Page' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-next-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,QAAQ,GAAG;EAChBC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,GAAG;EACVC,OAAO,EAAE;AACV,CAAC;AAEc,SAASC,uBAAuBA,CAAE;EAChDC,UAAU,EAAE;IAAEC;EAAM,CAAC;EACrBC,aAAa;EACbC,OAAO,EAAE;IAAEC,eAAe;IAAEC;EAAU;AACvC,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGX,QAAQ,CAAES,eAAe,CAAE;EAChD,OACC,IAAAG,MAAA,CAAAC,aAAA;IACCC,IAAI,EAAC,8BAA8B;IACnCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;IAAA,GAC1C,IAAAC,0BAAa,EAAC;EAAC,GAElBR,SAAS,IACV,IAAAE,MAAA,CAAAC,aAAA,EAACd,YAAA,CAAAoB,SAAS;IACTC,qBAAqB,EAAG,CAAG;IAC3BC,OAAO,EAAC,MAAM;IACd,cAAa,IAAAC,QAAE,EAAE,gBAAiB,CAAG;IACrCC,WAAW,EAAG,IAAAD,QAAE,EAAE,WAAY,CAAG;IACjCE,KAAK,EAAGlB,KAAO;IACfmB,QAAQ,EAAKC,QAAQ,IACpBnB,aAAa,CAAE;MAAED,KAAK,EAAEoB;IAAS,CAAE;EACnC,CACD,CACD,EACCf,YAAY,IACb,IAAAC,MAAA,CAAAC,aAAA;IACCc,SAAS,EAAI,iDAAiDlB,eAAiB,EAAG;IAClF;EAAW,GAETE,YACG,CAEL,CAAC;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","arrowMap","none","arrow","chevron","QueryPaginationPreviousEdit","attributes","label","setAttributes","context","paginationArrow","showLabel","displayArrow","_react","createElement","href","onClick","event","preventDefault","useBlockProps","className","PlainText","__experimentalVersion","tagName","__","placeholder","value","onChange","newLabel"],"sources":["@wordpress/block-library/src/query-pagination-previous/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '←',\n\tchevron: '«',\n};\n\nexport default function QueryPaginationPreviousEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-previous-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-previous-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","arrowMap","none","arrow","chevron","QueryPaginationPreviousEdit","attributes","label","setAttributes","context","paginationArrow","showLabel","displayArrow","_react","createElement","href","onClick","event","preventDefault","useBlockProps","className","PlainText","__experimentalVersion","tagName","__","placeholder","value","onChange","newLabel"],"sources":["@wordpress/block-library/src/query-pagination-previous/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '←',\n\tchevron: '«',\n};\n\nexport default function QueryPaginationPreviousEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-previous-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-previous-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t{ showLabel && (\n\t\t\t\t<PlainText\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\taria-label={ __( 'Previous page link' ) }\n\t\t\t\t\tplaceholder={ __( 'Previous Page' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,QAAQ,GAAG;EAChBC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,GAAG;EACVC,OAAO,EAAE;AACV,CAAC;AAEc,SAASC,2BAA2BA,CAAE;EACpDC,UAAU,EAAE;IAAEC;EAAM,CAAC;EACrBC,aAAa;EACbC,OAAO,EAAE;IAAEC,eAAe;IAAEC;EAAU;AACvC,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGX,QAAQ,CAAES,eAAe,CAAE;EAChD,OACC,IAAAG,MAAA,CAAAC,aAAA;IACCC,IAAI,EAAC,kCAAkC;IACvCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;IAAA,GAC1C,IAAAC,0BAAa,EAAC;EAAC,GAElBP,YAAY,IACb,IAAAC,MAAA,CAAAC,aAAA;IACCM,SAAS,EAAI,qDAAqDV,eAAiB,EAAG;IACtF;EAAW,GAETE,YACG,CACN,EACCD,SAAS,IACV,IAAAE,MAAA,CAAAC,aAAA,EAACd,YAAA,CAAAqB,SAAS;IACTC,qBAAqB,EAAG,CAAG;IAC3BC,OAAO,EAAC,MAAM;IACd,cAAa,IAAAC,QAAE,EAAE,oBAAqB,CAAG;IACzCC,WAAW,EAAG,IAAAD,QAAE,EAAE,eAAgB,CAAG;IACrCE,KAAK,EAAGnB,KAAO;IACfoB,QAAQ,EAAKC,QAAQ,IACpBpB,aAAa,CAAE;MAAED,KAAK,EAAEqB;IAAS,CAAE;EACnC,CACD,CAEA,CAAC;AAEN"}
|
|
@@ -41,6 +41,106 @@ const migrateToQuoteV2 = attributes => {
|
|
|
41
41
|
})) : (0, _blocks.createBlock)('core/paragraph')];
|
|
42
42
|
};
|
|
43
43
|
exports.migrateToQuoteV2 = migrateToQuoteV2;
|
|
44
|
+
const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center'];
|
|
45
|
+
|
|
46
|
+
// Migrate existing text alignment settings to the renamed attribute.
|
|
47
|
+
const migrateTextAlign = (attributes, innerBlocks) => {
|
|
48
|
+
const {
|
|
49
|
+
align,
|
|
50
|
+
...rest
|
|
51
|
+
} = attributes;
|
|
52
|
+
// Check if there are valid alignments stored in the old attribute
|
|
53
|
+
// and assign them to the new attribute name.
|
|
54
|
+
const migratedAttributes = TEXT_ALIGN_OPTIONS.includes(align) ? {
|
|
55
|
+
...rest,
|
|
56
|
+
textAlign: align
|
|
57
|
+
} : attributes;
|
|
58
|
+
return [migratedAttributes, innerBlocks];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Migrate the v2 blocks with style === `2`;
|
|
62
|
+
const migrateLargeStyle = (attributes, innerBlocks) => {
|
|
63
|
+
return [{
|
|
64
|
+
...attributes,
|
|
65
|
+
className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
|
|
66
|
+
}, innerBlocks];
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Version before the 'align' attribute was replaced with 'textAlign'.
|
|
70
|
+
const v4 = {
|
|
71
|
+
attributes: {
|
|
72
|
+
value: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
source: 'html',
|
|
75
|
+
selector: 'blockquote',
|
|
76
|
+
multiline: 'p',
|
|
77
|
+
default: '',
|
|
78
|
+
__experimentalRole: 'content'
|
|
79
|
+
},
|
|
80
|
+
citation: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
source: 'html',
|
|
83
|
+
selector: 'cite',
|
|
84
|
+
default: '',
|
|
85
|
+
__experimentalRole: 'content'
|
|
86
|
+
},
|
|
87
|
+
align: {
|
|
88
|
+
type: 'string'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
supports: {
|
|
92
|
+
anchor: true,
|
|
93
|
+
html: false,
|
|
94
|
+
__experimentalOnEnter: true,
|
|
95
|
+
__experimentalOnMerge: true,
|
|
96
|
+
typography: {
|
|
97
|
+
fontSize: true,
|
|
98
|
+
lineHeight: true,
|
|
99
|
+
__experimentalFontFamily: true,
|
|
100
|
+
__experimentalFontWeight: true,
|
|
101
|
+
__experimentalFontStyle: true,
|
|
102
|
+
__experimentalTextTransform: true,
|
|
103
|
+
__experimentalTextDecoration: true,
|
|
104
|
+
__experimentalLetterSpacing: true,
|
|
105
|
+
__experimentalDefaultControls: {
|
|
106
|
+
fontSize: true,
|
|
107
|
+
fontAppearance: true
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
color: {
|
|
111
|
+
gradients: true,
|
|
112
|
+
heading: true,
|
|
113
|
+
link: true,
|
|
114
|
+
__experimentalDefaultControls: {
|
|
115
|
+
background: true,
|
|
116
|
+
text: true
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
isEligible: ({
|
|
121
|
+
align
|
|
122
|
+
}) => TEXT_ALIGN_OPTIONS.includes(align),
|
|
123
|
+
save({
|
|
124
|
+
attributes
|
|
125
|
+
}) {
|
|
126
|
+
const {
|
|
127
|
+
align,
|
|
128
|
+
citation
|
|
129
|
+
} = attributes;
|
|
130
|
+
const className = (0, _classnames.default)({
|
|
131
|
+
[`has-text-align-${align}`]: align
|
|
132
|
+
});
|
|
133
|
+
return (0, _react.createElement)("blockquote", {
|
|
134
|
+
..._blockEditor.useBlockProps.save({
|
|
135
|
+
className
|
|
136
|
+
})
|
|
137
|
+
}, (0, _react.createElement)(_blockEditor.InnerBlocks.Content, null), !_blockEditor.RichText.isEmpty(citation) && (0, _react.createElement)(_blockEditor.RichText.Content, {
|
|
138
|
+
tagName: "cite",
|
|
139
|
+
value: citation
|
|
140
|
+
}));
|
|
141
|
+
},
|
|
142
|
+
migrate: migrateTextAlign
|
|
143
|
+
};
|
|
44
144
|
const v3 = {
|
|
45
145
|
attributes: {
|
|
46
146
|
value: {
|
|
@@ -101,7 +201,9 @@ const v3 = {
|
|
|
101
201
|
value: citation
|
|
102
202
|
}));
|
|
103
203
|
},
|
|
104
|
-
migrate
|
|
204
|
+
migrate(attributes) {
|
|
205
|
+
return migrateTextAlign(...migrateToQuoteV2(attributes));
|
|
206
|
+
}
|
|
105
207
|
};
|
|
106
208
|
const v2 = {
|
|
107
209
|
attributes: {
|
|
@@ -122,7 +224,9 @@ const v2 = {
|
|
|
122
224
|
type: 'string'
|
|
123
225
|
}
|
|
124
226
|
},
|
|
125
|
-
migrate
|
|
227
|
+
migrate(attributes) {
|
|
228
|
+
return migrateTextAlign(...migrateToQuoteV2(attributes));
|
|
229
|
+
},
|
|
126
230
|
save({
|
|
127
231
|
attributes
|
|
128
232
|
}) {
|
|
@@ -173,12 +277,9 @@ const v1 = {
|
|
|
173
277
|
style,
|
|
174
278
|
...restAttributes
|
|
175
279
|
} = attributes;
|
|
176
|
-
return migrateToQuoteV2(
|
|
177
|
-
...restAttributes,
|
|
178
|
-
className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
|
|
179
|
-
});
|
|
280
|
+
return migrateTextAlign(...migrateLargeStyle(...migrateToQuoteV2(restAttributes)));
|
|
180
281
|
}
|
|
181
|
-
return migrateToQuoteV2(attributes);
|
|
282
|
+
return migrateTextAlign(...migrateToQuoteV2(attributes));
|
|
182
283
|
},
|
|
183
284
|
save({
|
|
184
285
|
attributes
|
|
@@ -232,11 +333,9 @@ const v0 = {
|
|
|
232
333
|
style,
|
|
233
334
|
...restAttributes
|
|
234
335
|
} = attributes;
|
|
235
|
-
return migrateToQuoteV2(
|
|
236
|
-
...restAttributes
|
|
237
|
-
});
|
|
336
|
+
return migrateTextAlign(...migrateToQuoteV2(restAttributes));
|
|
238
337
|
}
|
|
239
|
-
return migrateToQuoteV2(attributes);
|
|
338
|
+
return migrateTextAlign(...migrateToQuoteV2(attributes));
|
|
240
339
|
},
|
|
241
340
|
save({
|
|
242
341
|
attributes
|
|
@@ -270,5 +369,5 @@ const v0 = {
|
|
|
270
369
|
*
|
|
271
370
|
* See block-deprecation.md
|
|
272
371
|
*/
|
|
273
|
-
var _default = exports.default = [v3, v2, v1, v0];
|
|
372
|
+
var _default = exports.default = [v4, v3, v2, v1, v0];
|
|
274
373
|
//# sourceMappingURL=deprecated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blocks","_blockEditor","migrateToQuoteV2","attributes","value","restAttributes","parseWithAttributeSchema","type","source","selector","query","content","map","createBlock","exports","v3","multiline","default","__experimentalRole","citation","align","supports","anchor","__experimentalSlashInserter","typography","fontSize","lineHeight","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalDefaultControls","fontAppearance","save","className","classnames","_react","createElement","useBlockProps","RichText","Content","isEmpty","tagName","migrate","v2","style","textAlign","v1","v0","isNaN","parseInt","_default"],"sources":["@wordpress/block-library/src/quote/deprecated.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock, parseWithAttributeSchema } from '@wordpress/blocks';\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\nexport const migrateToQuoteV2 = ( attributes ) => {\n\tconst { value, ...restAttributes } = attributes;\n\n\treturn [\n\t\t{\n\t\t\t...restAttributes,\n\t\t},\n\t\tvalue\n\t\t\t? parseWithAttributeSchema( value, {\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\tsource: 'query',\n\t\t\t\t\tselector: 'p',\n\t\t\t\t\tquery: {\n\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\tsource: 'html',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t } ).map( ( { content } ) =>\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content } )\n\t\t\t )\n\t\t\t: createBlock( 'core/paragraph' ),\n\t];\n};\n\nconst v3 = {\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\tdefault: '',\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\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\t__experimentalSlashInserter: true,\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t\tfontAppearance: true,\n\t\t\t},\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation } = attributes;\n\n\t\tconst className = classnames( {\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} );\n\n\t\treturn (\n\t\t\t<blockquote { ...useBlockProps.save( { className } ) }>\n\t\t\t\t<RichText.Content multiline value={ value } />\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: migrateToQuoteV2,\n};\n\nconst v2 = {\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\tdefault: '',\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},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tmigrate: migrateToQuoteV2,\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote style={ { textAlign: align ? align : null } }>\n\t\t\t\t<RichText.Content multiline value={ value } />\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};\n\nconst v1 = {\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\tdefault: '',\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},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tstyle: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 1,\n\t\t},\n\t},\n\n\tmigrate( attributes ) {\n\t\tif ( attributes.style === 2 ) {\n\t\t\tconst { style, ...restAttributes } = attributes;\n\t\t\treturn migrateToQuoteV2( {\n\t\t\t\t...restAttributes,\n\t\t\t\tclassName: attributes.className\n\t\t\t\t\t? attributes.className + ' is-style-large'\n\t\t\t\t\t: 'is-style-large',\n\t\t\t} );\n\t\t}\n\n\t\treturn migrateToQuoteV2( attributes );\n\t},\n\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation, style } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote\n\t\t\t\tclassName={ style === 2 ? 'is-large' : '' }\n\t\t\t\tstyle={ { textAlign: align ? align : null } }\n\t\t\t>\n\t\t\t\t<RichText.Content multiline value={ value } />\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};\n\nconst v0 = {\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\tdefault: '',\n\t\t},\n\t\tcitation: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'footer',\n\t\t\tdefault: '',\n\t\t},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tstyle: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 1,\n\t\t},\n\t},\n\n\tmigrate( attributes ) {\n\t\tif ( ! isNaN( parseInt( attributes.style ) ) ) {\n\t\t\tconst { style, ...restAttributes } = attributes;\n\t\t\treturn migrateToQuoteV2( {\n\t\t\t\t...restAttributes,\n\t\t\t} );\n\t\t}\n\n\t\treturn migrateToQuoteV2( attributes );\n\t},\n\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation, style } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote\n\t\t\t\tclassName={ `blocks-quote-style-${ style }` }\n\t\t\t\tstyle={ { textAlign: align ? align : null } }\n\t\t\t>\n\t\t\t\t<RichText.Content multiline value={ value } />\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};\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 [ v3, v2, v1, v0 ];\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,MAAMG,gBAAgB,GAAKC,UAAU,IAAM;EACjD,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAe,CAAC,GAAGF,UAAU;EAE/C,OAAO,CACN;IACC,GAAGE;EACJ,CAAC,EACDD,KAAK,GACF,IAAAE,gCAAwB,EAAEF,KAAK,EAAE;IACjCG,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,OAAO;IACfC,QAAQ,EAAE,GAAG;IACbC,KAAK,EAAE;MACNC,OAAO,EAAE;QACRJ,IAAI,EAAE,QAAQ;QACdC,MAAM,EAAE;MACT;IACD;EACA,CAAE,CAAC,CAACI,GAAG,CAAE,CAAE;IAAED;EAAQ,CAAC,KACtB,IAAAE,mBAAW,EAAE,gBAAgB,EAAE;IAAEF;E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CAAC,GAAG1C,UAAU;IAEpD,OACC,IAAAiC,MAAA,CAAAC,aAAA;MACCH,SAAS,EAAI,sBAAsBW,KAAO,EAAG;MAC7CA,KAAK,EAAG;QAAEC,SAAS,EAAE1B,KAAK,GAAGA,KAAK,GAAG;MAAK;IAAG,GAE7C,IAAAgB,MAAA,CAAAC,aAAA,EAACpC,YAAA,CAAAsC,QAAQ,CAACC,OAAO;MAACxB,SAAS;MAACZ,KAAK,EAAGA;IAAO,CAAE,CAAC,EAC5C,CAAEmC,qBAAQ,CAACE,OAAO,CAAEtB,QAAS,CAAC,IAC/B,IAAAiB,MAAA,CAAAC,aAAA,EAACpC,YAAA,CAAAsC,QAAQ,CAACC,OAAO;MAACE,OAAO,EAAC,QAAQ;MAACtC,KAAK,EAAGe;IAAU,CAAE,CAE7C,CAAC;EAEf;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAgC,QAAA,GAAArC,OAAA,CAAAG,OAAA,GAQe,CAAEF,EAAE,EAAE6B,EAAE,EAAEG,EAAE,EAAEC,EAAE,CAAE"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blocks","_blockEditor","migrateToQuoteV2","attributes","value","restAttributes","parseWithAttributeSchema","type","source","selector","query","content","map","createBlock","exports","TEXT_ALIGN_OPTIONS","migrateTextAlign","innerBlocks","align","rest","migratedAttributes","includes","textAlign","migrateLargeStyle","className","v4","multiline","default","__experimentalRole","citation","supports","anchor","html","__experimentalOnEnter","__experimentalOnMerge","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","fontAppearance","color","gradients","heading","link","background","text","isEligible","save","classnames","_react","createElement","useBlockProps","InnerBlocks","Content","RichText","isEmpty","tagName","migrate","v3","__experimentalSlashInserter","v2","style","v1","v0","isNaN","parseInt","_default"],"sources":["@wordpress/block-library/src/quote/deprecated.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock, parseWithAttributeSchema } from '@wordpress/blocks';\nimport { InnerBlocks, RichText, useBlockProps } from '@wordpress/block-editor';\n\nexport const migrateToQuoteV2 = ( attributes ) => {\n\tconst { value, ...restAttributes } = attributes;\n\n\treturn [\n\t\t{\n\t\t\t...restAttributes,\n\t\t},\n\t\tvalue\n\t\t\t? parseWithAttributeSchema( value, {\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\tsource: 'query',\n\t\t\t\t\tselector: 'p',\n\t\t\t\t\tquery: {\n\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\tsource: 'html',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t } ).map( ( { content } ) =>\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content } )\n\t\t\t )\n\t\t\t: createBlock( 'core/paragraph' ),\n\t];\n};\n\nconst TEXT_ALIGN_OPTIONS = [ 'left', 'right', 'center' ];\n\n// Migrate existing text alignment settings to the renamed attribute.\nconst migrateTextAlign = ( attributes, innerBlocks ) => {\n\tconst { align, ...rest } = attributes;\n\t// Check if there are valid alignments stored in the old attribute\n\t// and assign them to the new attribute name.\n\tconst migratedAttributes = TEXT_ALIGN_OPTIONS.includes( align )\n\t\t? { ...rest, textAlign: align }\n\t\t: attributes;\n\n\treturn [ migratedAttributes, innerBlocks ];\n};\n\n// Migrate the v2 blocks with style === `2`;\nconst migrateLargeStyle = ( attributes, innerBlocks ) => {\n\treturn [\n\t\t{\n\t\t\t...attributes,\n\t\t\tclassName: attributes.className\n\t\t\t\t? attributes.className + ' is-style-large'\n\t\t\t\t: 'is-style-large',\n\t\t},\n\t\tinnerBlocks,\n\t];\n};\n\n// Version before the 'align' attribute was replaced with 'textAlign'.\nconst v4 = {\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\tdefault: '',\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\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\thtml: false,\n\t\t__experimentalOnEnter: true,\n\t\t__experimentalOnMerge: true,\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t\tfontAppearance: true,\n\t\t\t},\n\t\t},\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\theading: true,\n\t\t\tlink: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tbackground: true,\n\t\t\t\ttext: true,\n\t\t\t},\n\t\t},\n\t},\n\tisEligible: ( { align } ) => TEXT_ALIGN_OPTIONS.includes( align ),\n\tsave( { attributes } ) {\n\t\tconst { align, citation } = attributes;\n\t\tconst className = classnames( {\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} );\n\t\treturn (\n\t\t\t<blockquote { ...useBlockProps.save( { className } ) }>\n\t\t\t\t<InnerBlocks.Content />\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: migrateTextAlign,\n};\n\nconst v3 = {\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\tdefault: '',\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\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\t__experimentalSlashInserter: true,\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t\tfontAppearance: true,\n\t\t\t},\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation } = attributes;\n\n\t\tconst className = classnames( {\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} );\n\n\t\treturn (\n\t\t\t<blockquote { ...useBlockProps.save( { className } ) }>\n\t\t\t\t<RichText.Content multiline value={ value } />\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( attributes ) {\n\t\treturn migrateTextAlign( ...migrateToQuoteV2( attributes ) );\n\t},\n};\n\nconst v2 = {\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\tdefault: '',\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},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tmigrate( attributes ) {\n\t\treturn migrateTextAlign( ...migrateToQuoteV2( attributes ) );\n\t},\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote style={ { textAlign: align ? align : null } }>\n\t\t\t\t<RichText.Content multiline value={ value } />\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};\n\nconst v1 = {\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\tdefault: '',\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},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tstyle: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 1,\n\t\t},\n\t},\n\n\tmigrate( attributes ) {\n\t\tif ( attributes.style === 2 ) {\n\t\t\tconst { style, ...restAttributes } = attributes;\n\t\t\treturn migrateTextAlign(\n\t\t\t\t...migrateLargeStyle( ...migrateToQuoteV2( restAttributes ) )\n\t\t\t);\n\t\t}\n\n\t\treturn migrateTextAlign( ...migrateToQuoteV2( attributes ) );\n\t},\n\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation, style } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote\n\t\t\t\tclassName={ style === 2 ? 'is-large' : '' }\n\t\t\t\tstyle={ { textAlign: align ? align : null } }\n\t\t\t>\n\t\t\t\t<RichText.Content multiline value={ value } />\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};\n\nconst v0 = {\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\tdefault: '',\n\t\t},\n\t\tcitation: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'footer',\n\t\t\tdefault: '',\n\t\t},\n\t\talign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tstyle: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 1,\n\t\t},\n\t},\n\n\tmigrate( attributes ) {\n\t\tif ( ! isNaN( parseInt( attributes.style ) ) ) {\n\t\t\tconst { style, ...restAttributes } = attributes;\n\t\t\treturn migrateTextAlign( ...migrateToQuoteV2( restAttributes ) );\n\t\t}\n\n\t\treturn migrateTextAlign( ...migrateToQuoteV2( attributes ) );\n\t},\n\n\tsave( { attributes } ) {\n\t\tconst { align, value, citation, style } = attributes;\n\n\t\treturn (\n\t\t\t<blockquote\n\t\t\t\tclassName={ `blocks-quote-style-${ style }` }\n\t\t\t\tstyle={ { textAlign: align ? align : null } }\n\t\t\t>\n\t\t\t\t<RichText.Content multiline value={ value } />\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};\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 [ v4, v3, v2, v1, v0 ];\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,MAAMG,gBAAgB,GAAKC,UAAU,IAAM;EACjD,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAe,CAAC,GAAGF,UAAU;EAE/C,OAAO,CACN;IACC,GAAGE;EACJ,CAAC,EACDD,K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GED
|
@@ -72,7 +72,7 @@ function QuoteEdit({
|
|
|
72
72
|
style
|
|
73
73
|
}) {
|
|
74
74
|
const {
|
|
75
|
-
|
|
75
|
+
textAlign,
|
|
76
76
|
citation
|
|
77
77
|
} = attributes;
|
|
78
78
|
useMigrateOnLoad(attributes, clientId);
|
|
@@ -85,7 +85,7 @@ function QuoteEdit({
|
|
|
85
85
|
}, []);
|
|
86
86
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
87
87
|
className: (0, _classnames.default)(className, {
|
|
88
|
-
[`has-text-align-${
|
|
88
|
+
[`has-text-align-${textAlign}`]: textAlign
|
|
89
89
|
}),
|
|
90
90
|
...(!isWebPlatform && {
|
|
91
91
|
style
|
|
@@ -99,10 +99,10 @@ function QuoteEdit({
|
|
|
99
99
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_blockEditor.BlockControls, {
|
|
100
100
|
group: "block"
|
|
101
101
|
}, (0, _react.createElement)(_blockEditor.AlignmentControl, {
|
|
102
|
-
value:
|
|
102
|
+
value: textAlign,
|
|
103
103
|
onChange: nextAlign => {
|
|
104
104
|
setAttributes({
|
|
105
|
-
|
|
105
|
+
textAlign: nextAlign
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
})), (0, _react.createElement)(_components.BlockQuotation, {
|
|
@@ -128,7 +128,7 @@ function QuoteEdit({
|
|
|
128
128
|
className: "wp-block-quote__citation",
|
|
129
129
|
__unstableOnSplitAtEnd: () => insertBlocksAfter((0, _blocks.createBlock)((0, _blocks.getDefaultBlockName)())),
|
|
130
130
|
...(!isWebPlatform ? {
|
|
131
|
-
textAlign
|
|
131
|
+
textAlign
|
|
132
132
|
} : {})
|
|
133
133
|
})));
|
|
134
134
|
}
|
package/build/quote/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_blockEditor","_components","_data","_blocks","_element","_deprecated","_deprecated2","isWebPlatform","Platform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","useRegistry","updateBlockAttributes","replaceInnerBlocks","useDispatch","blockEditorStore","useEffect","value","newAttributes","newInnerBlocks","migrateToQuoteV2","deprecated","since","version","alternative","batch","QuoteEdit","setAttributes","insertBlocksAfter","className","style","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_blockEditor","_components","_data","_blocks","_element","_deprecated","_deprecated2","isWebPlatform","Platform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","useRegistry","updateBlockAttributes","replaceInnerBlocks","useDispatch","blockEditorStore","useEffect","value","newAttributes","newInnerBlocks","migrateToQuoteV2","deprecated","since","version","alternative","batch","QuoteEdit","setAttributes","insertBlocksAfter","className","style","textAlign","citation","hasSelection","useSelect","select","isBlockSelected","hasSelectedInnerBlock","blockProps","useBlockProps","classNames","innerBlocksProps","useInnerBlocksProps","template","templateInsertUpdatesSelection","__experimentalCaptureToolbars","_react","createElement","Fragment","BlockControls","group","AlignmentControl","onChange","nextAlign","BlockQuotation","children","RichText","isEmpty","identifier","tagName","undefined","display","nextCitation","__unstableMobileNoFocusOnMount","__","placeholder","__unstableOnSplitAtEnd","createBlock","getDefaultBlockName"],"sources":["@wordpress/block-library/src/quote/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { Platform, useEffect } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { migrateToQuoteV2 } from './deprecated';\n\nconst isWebPlatform = Platform.OS === 'web';\n\nconst TEMPLATE = [ [ 'core/paragraph', {} ] ];\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old quote block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nconst useMigrateOnLoad = ( attributes, clientId ) => {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.value ) {\n\t\t\t// No need to migrate if it doesn't have the value attribute.\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] =\n\t\t\tmigrateToQuoteV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the quote block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.value ] );\n};\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tclientId,\n\tclassName,\n\tstyle,\n} ) {\n\tconst { textAlign, citation } = attributes;\n\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst hasSelection = useSelect( ( select ) => {\n\t\tconst { isBlockSelected, hasSelectedInnerBlock } =\n\t\t\tselect( blockEditorStore );\n\t\treturn hasSelectedInnerBlock( clientId ) || isBlockSelected( clientId );\n\t}, [] );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classNames( className, {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\t...( ! isWebPlatform && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t__experimentalCaptureToolbars: true,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t{ ( ! RichText.isEmpty( citation ) || hasSelection ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"citation\"\n\t\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : undefined }\n\t\t\t\t\t\tstyle={ { display: 'block' } }\n\t\t\t\t\t\tvalue={ citation }\n\t\t\t\t\t\tonChange={ ( nextCitation ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tcitation: nextCitation,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\t\taria-label={ __( 'Quote citation' ) }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t// translators: placeholder text used for the\n\t\t\t\t\t\t\t// citation\n\t\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...( ! isWebPlatform ? { textAlign } : {} ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,s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