@wordpress/block-library 9.33.2-next.36001005c.0 → 9.33.3
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/build/accordion/block.json +1 -1
- package/build/accordion/edit.js +11 -9
- package/build/accordion/edit.js.map +2 -2
- package/build/accordion-heading/block.json +1 -1
- package/build/accordion-item/block.json +1 -1
- package/build/accordion-panel/block.json +1 -1
- package/build/buttons/transforms.js +1 -0
- package/build/buttons/transforms.js.map +2 -2
- package/build/code/transforms.js +2 -0
- package/build/code/transforms.js.map +2 -2
- package/build/freeform/block.json +5 -1
- package/build/home-link/block.json +2 -1
- package/build/image/view.js +4 -1
- package/build/image/view.js.map +2 -2
- package/build/math/deprecated.js +54 -0
- package/build/math/deprecated.js.map +7 -0
- package/build/math/edit.js +1 -0
- package/build/math/edit.js.map +2 -2
- package/build/math/index.js +3 -1
- package/build/math/index.js.map +3 -3
- package/build/math/save.js +2 -3
- package/build/math/save.js.map +2 -2
- package/build/missing/block.json +3 -0
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +2 -2
- package/build/navigation/menu-items-to-blocks.js +8 -3
- package/build/navigation/menu-items-to-blocks.js.map +2 -2
- package/build/navigation/view.js +2 -2
- package/build/navigation/view.js.map +2 -2
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +2 -2
- package/build/navigation-link/shared/controls.js +16 -36
- package/build/navigation-link/shared/controls.js.map +2 -2
- package/build/navigation-link/shared/use-entity-binding.js +1 -1
- package/build/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +2 -2
- package/build/post-date/block.json +1 -1
- package/build/post-date/edit.js +11 -5
- package/build/post-date/edit.js.map +3 -3
- package/build/post-date/variations.js +4 -7
- package/build/post-date/variations.js.map +2 -2
- package/build/post-template/edit.js +13 -1
- package/build/post-template/edit.js.map +2 -2
- package/build/query/index.js +11 -1
- package/build/query/index.js.map +2 -2
- package/build/query/variations.js +16 -11
- package/build/query/variations.js.map +2 -2
- package/build/search/view.js +4 -4
- package/build/search/view.js.map +2 -2
- package/build/terms-query/edit/inspector-controls/index.js +1 -1
- package/build/terms-query/edit/inspector-controls/index.js.map +2 -2
- package/build/terms-query/edit/inspector-controls/inherit-control.js +2 -4
- package/build/terms-query/edit/inspector-controls/inherit-control.js.map +2 -2
- package/build/utils/get-transformed-attributes.js +1 -13
- package/build/utils/get-transformed-attributes.js.map +2 -2
- package/build-module/accordion/block.json +1 -1
- package/build-module/accordion/edit.js +11 -9
- package/build-module/accordion/edit.js.map +2 -2
- package/build-module/accordion-heading/block.json +1 -1
- package/build-module/accordion-item/block.json +1 -1
- package/build-module/accordion-panel/block.json +1 -1
- package/build-module/buttons/transforms.js +1 -0
- package/build-module/buttons/transforms.js.map +2 -2
- package/build-module/code/transforms.js +2 -0
- package/build-module/code/transforms.js.map +2 -2
- package/build-module/freeform/block.json +5 -1
- package/build-module/home-link/block.json +2 -1
- package/build-module/image/view.js +4 -1
- package/build-module/image/view.js.map +2 -2
- package/build-module/math/deprecated.js +34 -0
- package/build-module/math/deprecated.js.map +7 -0
- package/build-module/math/edit.js +1 -0
- package/build-module/math/edit.js.map +2 -2
- package/build-module/math/index.js +3 -1
- package/build-module/math/index.js.map +2 -2
- package/build-module/math/save.js +2 -3
- package/build-module/math/save.js.map +2 -2
- package/build-module/missing/block.json +3 -0
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +2 -2
- package/build-module/navigation/menu-items-to-blocks.js +8 -3
- package/build-module/navigation/menu-items-to-blocks.js.map +2 -2
- package/build-module/navigation/view.js +2 -2
- package/build-module/navigation/view.js.map +2 -2
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +2 -2
- package/build-module/navigation-link/shared/controls.js +17 -37
- package/build-module/navigation-link/shared/controls.js.map +2 -2
- package/build-module/navigation-link/shared/use-entity-binding.js +1 -1
- package/build-module/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +2 -2
- package/build-module/post-date/block.json +1 -1
- package/build-module/post-date/edit.js +11 -5
- package/build-module/post-date/edit.js.map +2 -2
- package/build-module/post-date/variations.js +4 -7
- package/build-module/post-date/variations.js.map +2 -2
- package/build-module/post-template/edit.js +13 -1
- package/build-module/post-template/edit.js.map +2 -2
- package/build-module/query/index.js +11 -1
- package/build-module/query/index.js.map +2 -2
- package/build-module/query/variations.js +16 -11
- package/build-module/query/variations.js.map +2 -2
- package/build-module/search/view.js +4 -4
- package/build-module/search/view.js.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/index.js +1 -1
- package/build-module/terms-query/edit/inspector-controls/index.js.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/inherit-control.js +2 -4
- package/build-module/terms-query/edit/inspector-controls/inherit-control.js.map +2 -2
- package/build-module/utils/get-transformed-attributes.js +1 -13
- package/build-module/utils/get-transformed-attributes.js.map +2 -2
- package/build-style/editor-rtl.css +7 -2
- package/build-style/editor.css +8 -2
- package/build-style/math/editor-rtl.css +49 -0
- package/build-style/math/editor.css +50 -0
- package/build-style/math/style-rtl.css +4 -0
- package/build-style/math/style.css +4 -0
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/style-rtl.css +5 -0
- package/build-style/style.css +5 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- package/package.json +37 -37
- package/src/accordion/block.json +1 -1
- package/src/accordion/edit.js +16 -16
- package/src/accordion-heading/block.json +1 -1
- package/src/accordion-item/block.json +1 -1
- package/src/accordion-panel/block.json +1 -1
- package/src/archives/index.php +53 -1
- package/src/buttons/transforms.js +1 -0
- package/src/categories/index.php +25 -7
- package/src/code/transforms.js +2 -0
- package/src/editor.scss +1 -0
- package/src/freeform/block.json +5 -1
- package/src/home-link/block.json +2 -1
- package/src/image/index.php +9 -9
- package/src/image/view.js +11 -1
- package/src/math/deprecated.js +44 -0
- package/src/math/edit.js +1 -0
- package/src/math/editor.scss +7 -0
- package/src/math/index.js +2 -0
- package/src/math/save.js +6 -5
- package/src/math/style.scss +4 -0
- package/src/missing/block.json +3 -0
- package/src/navigation/edit/menu-inspector-controls.js +1 -1
- package/src/navigation/index.php +7 -7
- package/src/navigation/menu-items-to-blocks.js +12 -2
- package/src/navigation/test/menu-items-to-blocks.js +144 -0
- package/src/navigation/view.js +2 -2
- package/src/navigation-link/edit.js +1 -1
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/shared/controls.js +18 -58
- package/src/navigation-link/shared/test/controls.js +9 -14
- package/src/navigation-link/shared/use-entity-binding.js +1 -1
- package/src/navigation-submenu/edit.js +1 -1
- package/src/post-date/block.json +1 -1
- package/src/post-date/edit.js +15 -10
- package/src/post-date/variations.js +2 -5
- package/src/post-template/edit.js +13 -1
- package/src/query/index.js +10 -0
- package/src/query/variations.js +17 -11
- package/src/query-pagination-next/index.php +1 -1
- package/src/query-pagination-previous/index.php +1 -1
- package/src/search/index.php +2 -2
- package/src/search/view.js +4 -4
- package/src/style.scss +1 -0
- package/src/term-template/index.php +8 -2
- package/src/terms-query/edit/inspector-controls/index.js +2 -2
- package/src/terms-query/edit/inspector-controls/inherit-control.js +1 -3
- package/src/utils/get-transformed-attributes.js +5 -22
- package/src/video/editor.scss +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/post-template/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tBlockContextProvider,\n\t__experimentalUseBlockPreview as useBlockPreview,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Spinner, ToolbarGroup } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { list, grid } from '@wordpress/icons';\n\nconst TEMPLATE = [\n\t[ 'core/post-title' ],\n\t[ 'core/post-date' ],\n\t[ 'core/post-excerpt' ],\n];\n\nfunction PostTemplateInnerBlocks( { classList } ) {\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ className: clsx( 'wp-block-post', classList ) },\n\t\t{ template: TEMPLATE, __unstableDisableLayoutClassNames: true }\n\t);\n\treturn <li { ...innerBlocksProps } />;\n}\n\nfunction PostTemplateBlockPreview( {\n\tblocks,\n\tblockContextId,\n\tclassList,\n\tisHidden,\n\tsetActiveBlockContextId,\n} ) {\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t\tprops: {\n\t\t\tclassName: clsx( 'wp-block-post', classList ),\n\t\t},\n\t} );\n\n\tconst handleOnClick = () => {\n\t\tsetActiveBlockContextId( blockContextId );\n\t};\n\n\tconst style = {\n\t\tdisplay: isHidden ? 'none' : undefined,\n\t};\n\n\treturn (\n\t\t<li\n\t\t\t{ ...blockPreviewProps }\n\t\t\ttabIndex={ 0 }\n\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n\t\t\trole=\"button\"\n\t\t\tonClick={ handleOnClick }\n\t\t\tonKeyPress={ handleOnClick }\n\t\t\tstyle={ style }\n\t\t/>\n\t);\n}\n\nconst MemoizedPostTemplateBlockPreview = memo( PostTemplateBlockPreview );\n\nexport default function PostTemplateEdit( {\n\tsetAttributes,\n\tclientId,\n\tcontext: {\n\t\tquery: {\n\t\t\tperPage,\n\t\t\toffset = 0,\n\t\t\tpostType,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tpages,\n\t\t\tformat,\n\t\t\t// We gather extra query args to pass to the REST API call.\n\t\t\t// This way extenders of Query Loop can add their own query args,\n\t\t\t// and have accurate previews in the editor.\n\t\t\t// Noting though that these args should either be supported by the\n\t\t\t// REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`.\n\t\t\t...restQueryArgs\n\t\t} = {},\n\t\ttemplateSlug,\n\t\tpreviewPostType,\n\t},\n\tattributes: { layout },\n\t__unstableLayoutClassNames,\n} ) {\n\tconst { type: layoutType, columnCount = 3 } = layout || {};\n\tconst [ activeBlockContextId, setActiveBlockContextId ] = useState();\n\tconst { posts, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomies } = select( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\t\t\tconst templateCategory =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'category-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'category', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'category-', '' ),\n\t\t\t\t} );\n\t\t\tconst templateTag =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'tag-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'post_tag', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'tag-', '' ),\n\t\t\t\t} );\n\t\t\tconst query = {\n\t\t\t\toffset: offset || 0,\n\t\t\t\torder,\n\t\t\t\torderby: orderBy,\n\t\t\t};\n\t\t\t// There is no need to build the taxQuery if we inherit.\n\t\t\tif ( taxQuery && ! inherit ) {\n\t\t\t\tconst taxonomies = getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t} );\n\t\t\t\t// We have to build the tax query for the REST API and use as\n\t\t\t\t// keys the taxonomies `rest_base` with the `term ids` as values.\n\t\t\t\tconst builtTaxQuery = Object.entries( taxQuery ).reduce(\n\t\t\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\t\t\tconst taxonomy = taxonomies?.find(\n\t\t\t\t\t\t\t( { slug } ) => slug === taxonomySlug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( taxonomy?.rest_base ) {\n\t\t\t\t\t\t\taccumulator[ taxonomy?.rest_base ] = terms;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn accumulator;\n\t\t\t\t\t},\n\t\t\t\t\t{}\n\t\t\t\t);\n\t\t\t\tif ( !! Object.keys( builtTaxQuery ).length ) {\n\t\t\t\t\tObject.assign( query, builtTaxQuery );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( perPage ) {\n\t\t\t\tquery.per_page = perPage;\n\t\t\t}\n\t\t\tif ( author ) {\n\t\t\t\tquery.author = author;\n\t\t\t}\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t}\n\t\t\tif ( exclude?.length ) {\n\t\t\t\tquery.exclude = exclude;\n\t\t\t}\n\t\t\tif ( parents?.length ) {\n\t\t\t\tquery.parent = parents;\n\t\t\t}\n\t\t\tif ( format?.length ) {\n\t\t\t\tquery.format = format;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Handle cases where sticky is set to `exclude` or `only`.\n\t\t\t * Which works as a `post__in/post__not_in` query for sticky posts.\n\t\t\t */\n\t\t\tif ( [ 'exclude', 'only' ].includes( sticky ) ) {\n\t\t\t\tquery.sticky = sticky === 'only';\n\t\t\t}\n\n\t\t\t// Empty string represents the default behavior of including sticky posts.\n\t\t\tif ( [ '', 'ignore' ].includes( sticky ) ) {\n\t\t\t\t// Remove any leftover sticky query parameter.\n\t\t\t\tdelete query.sticky;\n\t\t\t\tquery.ignore_sticky = sticky === 'ignore';\n\t\t\t}\n\n\t\t\t// If `inherit` is truthy, adjust conditionally the query to create a better preview.\n\t\t\tlet currentPostType = postType;\n\t\t\tif ( inherit ) {\n\t\t\t\t// Change the post-type if needed.\n\t\t\t\tif ( templateSlug?.startsWith( 'archive-' ) ) {\n\t\t\t\t\tquery.postType = templateSlug.replace( 'archive-', '' );\n\t\t\t\t\tcurrentPostType = query.postType;\n\t\t\t\t} else if ( templateCategory ) {\n\t\t\t\t\tquery.categories = templateCategory[ 0 ]?.id;\n\t\t\t\t} else if ( templateTag ) {\n\t\t\t\t\tquery.tags = templateTag[ 0 ]?.id;\n\t\t\t\t} else if (\n\t\t\t\t\ttemplateSlug?.startsWith( 'taxonomy-post_format' )\n\t\t\t\t) {\n\t\t\t\t\t// Get the post format slug from the template slug by removing the prefix.\n\t\t\t\t\tquery.format = templateSlug.replace(\n\t\t\t\t\t\t'taxonomy-post_format-post-format-',\n\t\t\t\t\t\t''\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// When we preview Query Loop blocks we should prefer the current\n\t\t\t// block's postType, which is passed through block context.\n\t\t\tconst usedPostType = previewPostType || currentPostType;\n\t\t\treturn {\n\t\t\t\tposts: getEntityRecords( 'postType', usedPostType, {\n\t\t\t\t\t...query,\n\t\t\t\t\t...restQueryArgs,\n\t\t\t\t} ),\n\t\t\t\tblocks: getBlocks( clientId ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tperPage,\n\t\t\toffset,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tclientId,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\tpostType,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttemplateSlug,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tformat,\n\t\t\trestQueryArgs,\n\t\t\tpreviewPostType,\n\t\t]\n\t);\n\tconst blockContexts = useMemo(\n\t\t() =>\n\t\t\tposts?.map( ( post ) => ( {\n\t\t\t\tpostType: post.type,\n\t\t\t\tpostId: post.id,\n\t\t\t\tclassList: post.class_list ?? '',\n\t\t\t} ) ),\n\t\t[ posts ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( __unstableLayoutClassNames, {\n\t\t\t[ `columns-${ columnCount }` ]:\n\t\t\t\tlayoutType === 'grid' && columnCount, // Ensure column count is flagged via classname for backwards compatibility.\n\t\t} ),\n\t} );\n\n\tif ( ! posts ) {\n\t\treturn (\n\t\t\t<p { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</p>\n\t\t);\n\t}\n\n\tif ( ! posts.length ) {\n\t\treturn <p { ...blockProps }> { __( 'No results found.' ) }</p>;\n\t}\n\n\tconst setDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tlayout: { ...layout, ...newDisplayLayout },\n\t\t} );\n\n\tconst displayLayoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'Post template block display setting' ),\n\t\t\tonClick: () => setDisplayLayout( { type: 'default' } ),\n\t\t\tisActive: layoutType === 'default' || layoutType === 'constrained',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'Post template block display setting' ),\n\t\t\tonClick: () =>\n\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\ttype: 'grid',\n\t\t\t\t\tcolumnCount,\n\t\t\t\t} ),\n\t\t\tisActive: layoutType === 'grid',\n\t\t},\n\t];\n\n\t// To avoid flicker when switching active block contexts, a preview is rendered\n\t// for each block context, but the preview for the active block context is hidden.\n\t// This ensures that when it is displayed again, the cached rendering of the\n\t// block preview is used, instead of having to re-render the preview from scratch.\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ displayLayoutControls } />\n\t\t\t</BlockControls>\n\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ blockContexts &&\n\t\t\t\t\tblockContexts.map( ( blockContext ) => (\n\t\t\t\t\t\t<BlockContextProvider\n\t\t\t\t\t\t\tkey={ blockContext.postId }\n\t\t\t\t\t\t\tvalue={ blockContext }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ blockContext.postId ===\n\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId ) ? (\n\t\t\t\t\t\t\t\t<PostTemplateInnerBlocks\n\t\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null }\n\t\t\t\t\t\t\t<MemoizedPostTemplateBlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tblockContextId={ blockContext.postId }\n\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\tsetActiveBlockContextId={\n\t\t\t\t\t\t\t\t\tsetActiveBlockContextId\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisHidden={\n\t\t\t\t\t\t\t\t\tblockContext.postId ===\n\t\t\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tBlockContextProvider,\n\t__experimentalUseBlockPreview as useBlockPreview,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Spinner, ToolbarGroup } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { list, grid } from '@wordpress/icons';\n\nconst TEMPLATE = [\n\t[ 'core/post-title' ],\n\t[\n\t\t'core/post-date',\n\t\t{\n\t\t\tmetadata: {\n\t\t\t\tbindings: {\n\t\t\t\t\tdatetime: {\n\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\targs: { field: 'date' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\t[ 'core/post-excerpt' ],\n];\n\nfunction PostTemplateInnerBlocks( { classList } ) {\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ className: clsx( 'wp-block-post', classList ) },\n\t\t{ template: TEMPLATE, __unstableDisableLayoutClassNames: true }\n\t);\n\treturn <li { ...innerBlocksProps } />;\n}\n\nfunction PostTemplateBlockPreview( {\n\tblocks,\n\tblockContextId,\n\tclassList,\n\tisHidden,\n\tsetActiveBlockContextId,\n} ) {\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t\tprops: {\n\t\t\tclassName: clsx( 'wp-block-post', classList ),\n\t\t},\n\t} );\n\n\tconst handleOnClick = () => {\n\t\tsetActiveBlockContextId( blockContextId );\n\t};\n\n\tconst style = {\n\t\tdisplay: isHidden ? 'none' : undefined,\n\t};\n\n\treturn (\n\t\t<li\n\t\t\t{ ...blockPreviewProps }\n\t\t\ttabIndex={ 0 }\n\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n\t\t\trole=\"button\"\n\t\t\tonClick={ handleOnClick }\n\t\t\tonKeyPress={ handleOnClick }\n\t\t\tstyle={ style }\n\t\t/>\n\t);\n}\n\nconst MemoizedPostTemplateBlockPreview = memo( PostTemplateBlockPreview );\n\nexport default function PostTemplateEdit( {\n\tsetAttributes,\n\tclientId,\n\tcontext: {\n\t\tquery: {\n\t\t\tperPage,\n\t\t\toffset = 0,\n\t\t\tpostType,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tpages,\n\t\t\tformat,\n\t\t\t// We gather extra query args to pass to the REST API call.\n\t\t\t// This way extenders of Query Loop can add their own query args,\n\t\t\t// and have accurate previews in the editor.\n\t\t\t// Noting though that these args should either be supported by the\n\t\t\t// REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`.\n\t\t\t...restQueryArgs\n\t\t} = {},\n\t\ttemplateSlug,\n\t\tpreviewPostType,\n\t},\n\tattributes: { layout },\n\t__unstableLayoutClassNames,\n} ) {\n\tconst { type: layoutType, columnCount = 3 } = layout || {};\n\tconst [ activeBlockContextId, setActiveBlockContextId ] = useState();\n\tconst { posts, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomies } = select( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\t\t\tconst templateCategory =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'category-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'category', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'category-', '' ),\n\t\t\t\t} );\n\t\t\tconst templateTag =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'tag-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'post_tag', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'tag-', '' ),\n\t\t\t\t} );\n\t\t\tconst query = {\n\t\t\t\toffset: offset || 0,\n\t\t\t\torder,\n\t\t\t\torderby: orderBy,\n\t\t\t};\n\t\t\t// There is no need to build the taxQuery if we inherit.\n\t\t\tif ( taxQuery && ! inherit ) {\n\t\t\t\tconst taxonomies = getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t} );\n\t\t\t\t// We have to build the tax query for the REST API and use as\n\t\t\t\t// keys the taxonomies `rest_base` with the `term ids` as values.\n\t\t\t\tconst builtTaxQuery = Object.entries( taxQuery ).reduce(\n\t\t\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\t\t\tconst taxonomy = taxonomies?.find(\n\t\t\t\t\t\t\t( { slug } ) => slug === taxonomySlug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( taxonomy?.rest_base ) {\n\t\t\t\t\t\t\taccumulator[ taxonomy?.rest_base ] = terms;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn accumulator;\n\t\t\t\t\t},\n\t\t\t\t\t{}\n\t\t\t\t);\n\t\t\t\tif ( !! Object.keys( builtTaxQuery ).length ) {\n\t\t\t\t\tObject.assign( query, builtTaxQuery );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( perPage ) {\n\t\t\t\tquery.per_page = perPage;\n\t\t\t}\n\t\t\tif ( author ) {\n\t\t\t\tquery.author = author;\n\t\t\t}\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t}\n\t\t\tif ( exclude?.length ) {\n\t\t\t\tquery.exclude = exclude;\n\t\t\t}\n\t\t\tif ( parents?.length ) {\n\t\t\t\tquery.parent = parents;\n\t\t\t}\n\t\t\tif ( format?.length ) {\n\t\t\t\tquery.format = format;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Handle cases where sticky is set to `exclude` or `only`.\n\t\t\t * Which works as a `post__in/post__not_in` query for sticky posts.\n\t\t\t */\n\t\t\tif ( [ 'exclude', 'only' ].includes( sticky ) ) {\n\t\t\t\tquery.sticky = sticky === 'only';\n\t\t\t}\n\n\t\t\t// Empty string represents the default behavior of including sticky posts.\n\t\t\tif ( [ '', 'ignore' ].includes( sticky ) ) {\n\t\t\t\t// Remove any leftover sticky query parameter.\n\t\t\t\tdelete query.sticky;\n\t\t\t\tquery.ignore_sticky = sticky === 'ignore';\n\t\t\t}\n\n\t\t\t// If `inherit` is truthy, adjust conditionally the query to create a better preview.\n\t\t\tlet currentPostType = postType;\n\t\t\tif ( inherit ) {\n\t\t\t\t// Change the post-type if needed.\n\t\t\t\tif ( templateSlug?.startsWith( 'archive-' ) ) {\n\t\t\t\t\tquery.postType = templateSlug.replace( 'archive-', '' );\n\t\t\t\t\tcurrentPostType = query.postType;\n\t\t\t\t} else if ( templateCategory ) {\n\t\t\t\t\tquery.categories = templateCategory[ 0 ]?.id;\n\t\t\t\t} else if ( templateTag ) {\n\t\t\t\t\tquery.tags = templateTag[ 0 ]?.id;\n\t\t\t\t} else if (\n\t\t\t\t\ttemplateSlug?.startsWith( 'taxonomy-post_format' )\n\t\t\t\t) {\n\t\t\t\t\t// Get the post format slug from the template slug by removing the prefix.\n\t\t\t\t\tquery.format = templateSlug.replace(\n\t\t\t\t\t\t'taxonomy-post_format-post-format-',\n\t\t\t\t\t\t''\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// When we preview Query Loop blocks we should prefer the current\n\t\t\t// block's postType, which is passed through block context.\n\t\t\tconst usedPostType = previewPostType || currentPostType;\n\t\t\treturn {\n\t\t\t\tposts: getEntityRecords( 'postType', usedPostType, {\n\t\t\t\t\t...query,\n\t\t\t\t\t...restQueryArgs,\n\t\t\t\t} ),\n\t\t\t\tblocks: getBlocks( clientId ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tperPage,\n\t\t\toffset,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tclientId,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\tpostType,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttemplateSlug,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tformat,\n\t\t\trestQueryArgs,\n\t\t\tpreviewPostType,\n\t\t]\n\t);\n\tconst blockContexts = useMemo(\n\t\t() =>\n\t\t\tposts?.map( ( post ) => ( {\n\t\t\t\tpostType: post.type,\n\t\t\t\tpostId: post.id,\n\t\t\t\tclassList: post.class_list ?? '',\n\t\t\t} ) ),\n\t\t[ posts ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( __unstableLayoutClassNames, {\n\t\t\t[ `columns-${ columnCount }` ]:\n\t\t\t\tlayoutType === 'grid' && columnCount, // Ensure column count is flagged via classname for backwards compatibility.\n\t\t} ),\n\t} );\n\n\tif ( ! posts ) {\n\t\treturn (\n\t\t\t<p { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</p>\n\t\t);\n\t}\n\n\tif ( ! posts.length ) {\n\t\treturn <p { ...blockProps }> { __( 'No results found.' ) }</p>;\n\t}\n\n\tconst setDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tlayout: { ...layout, ...newDisplayLayout },\n\t\t} );\n\n\tconst displayLayoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'Post template block display setting' ),\n\t\t\tonClick: () => setDisplayLayout( { type: 'default' } ),\n\t\t\tisActive: layoutType === 'default' || layoutType === 'constrained',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'Post template block display setting' ),\n\t\t\tonClick: () =>\n\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\ttype: 'grid',\n\t\t\t\t\tcolumnCount,\n\t\t\t\t} ),\n\t\t\tisActive: layoutType === 'grid',\n\t\t},\n\t];\n\n\t// To avoid flicker when switching active block contexts, a preview is rendered\n\t// for each block context, but the preview for the active block context is hidden.\n\t// This ensures that when it is displayed again, the cached rendering of the\n\t// block preview is used, instead of having to re-render the preview from scratch.\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ displayLayoutControls } />\n\t\t\t</BlockControls>\n\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ blockContexts &&\n\t\t\t\t\tblockContexts.map( ( blockContext ) => (\n\t\t\t\t\t\t<BlockContextProvider\n\t\t\t\t\t\t\tkey={ blockContext.postId }\n\t\t\t\t\t\t\tvalue={ blockContext }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ blockContext.postId ===\n\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId ) ? (\n\t\t\t\t\t\t\t\t<PostTemplateInnerBlocks\n\t\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null }\n\t\t\t\t\t\t\t<MemoizedPostTemplateBlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tblockContextId={ blockContext.postId }\n\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\tsetActiveBlockContextId={\n\t\t\t\t\t\t\t\t\tsetActiveBlockContextId\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisHidden={\n\t\t\t\t\t\t\t\t\tblockContext.postId ===\n\t\t\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AA8CQ,SA8QN,UA9QM,KA8OC,YA9OD;AA3CR,OAAO,UAAU;AAKjB,SAAS,MAAM,SAAS,gBAAgB;AACxC,SAAS,iBAAiB;AAC1B,SAAS,IAAI,UAAU;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA,iCAAiC;AAAA,EACjC;AAAA,EACA;AAAA,EACA,SAAS;AAAA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AAO,GAAI,aAAa,qCAAsC;AAAA,MAC9D,SAAS,MACR,iBAAkB;AAAA,QACjB,MAAM;AAAA,QACN;AAAA,MACD,CAAE;AAAA,MACH,UAAU,eAAe;AAAA,IAC1B;AAAA,EACD;AAMA,SACC,iCACC;AAAA,wBAAC,iBACA,8BAAC,gBAAa,UAAW,uBAAwB,GAClD;AAAA,IAEA,oBAAC,QAAK,GAAG,YACN,2BACD,cAAc,IAAK,CAAE,iBACpB;AAAA,MAAC;AAAA;AAAA,QAEA,OAAQ;AAAA,QAEN;AAAA,uBAAa,YACb,wBACD,cAAe,CAAE,GAAG,UACpB;AAAA,YAAC;AAAA;AAAA,cACA,WAAY,aAAa;AAAA;AAAA,UAC1B,IACG;AAAA,UACJ;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA,gBAAiB,aAAa;AAAA,cAC9B,WAAY,aAAa;AAAA,cACzB;AAAA,cAGA,UACC,aAAa,YACX,wBACD,cAAe,CAAE,GAAG;AAAA;AAAA,UAEvB;AAAA;AAAA;AAAA,MAtBM,aAAa;AAAA,IAuBpB,CACC,GACJ;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -40,7 +40,17 @@ const settings = {
|
|
|
40
40
|
name: "core/post-title"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
name: "core/post-date"
|
|
43
|
+
name: "core/post-date",
|
|
44
|
+
attributes: {
|
|
45
|
+
metadata: {
|
|
46
|
+
bindings: {
|
|
47
|
+
datetime: {
|
|
48
|
+
source: "core/post-data",
|
|
49
|
+
args: { field: "date" }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
44
54
|
},
|
|
45
55
|
{
|
|
46
56
|
name: "core/post-excerpt"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\texample: {\n\t\tviewportWidth: 650,\n\t\tattributes: {\n\t\t\tnamespace: 'core/posts-list',\n\t\t\tquery: {\n\t\t\t\tperPage: 4,\n\t\t\t\tpages: 1,\n\t\t\t\toffset: 0,\n\t\t\t\tpostType: 'post',\n\t\t\t\torder: 'desc',\n\t\t\t\torderBy: 'date',\n\t\t\t\tauthor: '',\n\t\t\t\tsearch: '',\n\t\t\t\tsticky: 'exclude',\n\t\t\t\tinherit: false,\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/post-template',\n\t\t\t\tattributes: {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tinnerBlocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-title',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-date',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-excerpt',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,QAAQ,YAAY;AAK7B,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AAEvB,MAAM,EAAE,KAAK,IAAI;AAGV,MAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACR,eAAe;AAAA,IACf,YAAY;AAAA,MACX,WAAW;AAAA,MACX,OAAO;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,OAAO;AAAA,QACP,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,SAAS;AAAA,MACV;AAAA,IACD;AAAA,IACA,aAAa;AAAA,MACZ;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,QAAQ;AAAA,YACP,MAAM;AAAA,YACN,aAAa;AAAA,UACd;AAAA,QACD;AAAA,QACA,aAAa;AAAA,UACZ;AAAA,YACC,MAAM;AAAA,UACP;AAAA,UACA;AAAA,YACC,MAAM;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\texample: {\n\t\tviewportWidth: 650,\n\t\tattributes: {\n\t\t\tnamespace: 'core/posts-list',\n\t\t\tquery: {\n\t\t\t\tperPage: 4,\n\t\t\t\tpages: 1,\n\t\t\t\toffset: 0,\n\t\t\t\tpostType: 'post',\n\t\t\t\torder: 'desc',\n\t\t\t\torderBy: 'date',\n\t\t\t\tauthor: '',\n\t\t\t\tsearch: '',\n\t\t\t\tsticky: 'exclude',\n\t\t\t\tinherit: false,\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/post-template',\n\t\t\t\tattributes: {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tinnerBlocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-title',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-date',\n\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t\tbindings: {\n\t\t\t\t\t\t\t\t\tdatetime: {\n\t\t\t\t\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\t\t\t\t\targs: { field: 'date' },\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},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-excerpt',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,QAAQ,YAAY;AAK7B,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AAEvB,MAAM,EAAE,KAAK,IAAI;AAGV,MAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACR,eAAe;AAAA,IACf,YAAY;AAAA,MACX,WAAW;AAAA,MACX,OAAO;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,OAAO;AAAA,QACP,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,SAAS;AAAA,MACV;AAAA,IACD;AAAA,IACA,aAAa;AAAA,MACZ;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,QAAQ;AAAA,YACP,MAAM;AAAA,YACN,aAAa;AAAA,UACd;AAAA,QACD;AAAA,QACA,aAAa;AAAA,UACZ;AAAA,YACC,MAAM;AAAA,UACP;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,YAAY;AAAA,cACX,UAAU;AAAA,gBACT,UAAU;AAAA,kBACT,UAAU;AAAA,oBACT,QAAQ;AAAA,oBACR,MAAM,EAAE,OAAO,OAAO;AAAA,kBACvB;AAAA,gBACD;AAAA,cACD;AAAA,YACD;AAAA,UACD;AAAA,UACA;AAAA,YACC,MAAM;AAAA,UACP;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,MAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,6 +5,19 @@ import {
|
|
|
5
5
|
titleDateExcerpt,
|
|
6
6
|
imageDateTitle
|
|
7
7
|
} from "./icons";
|
|
8
|
+
const postDate = [
|
|
9
|
+
"core/post-date",
|
|
10
|
+
{
|
|
11
|
+
metadata: {
|
|
12
|
+
bindings: {
|
|
13
|
+
datetime: {
|
|
14
|
+
source: "core/post-data",
|
|
15
|
+
args: { field: "date" }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
];
|
|
8
21
|
const variations = [
|
|
9
22
|
{
|
|
10
23
|
name: "title-date",
|
|
@@ -12,11 +25,7 @@ const variations = [
|
|
|
12
25
|
icon: titleDate,
|
|
13
26
|
attributes: {},
|
|
14
27
|
innerBlocks: [
|
|
15
|
-
[
|
|
16
|
-
"core/post-template",
|
|
17
|
-
{},
|
|
18
|
-
[["core/post-title"], ["core/post-date"]]
|
|
19
|
-
],
|
|
28
|
+
["core/post-template", {}, [["core/post-title"], postDate]],
|
|
20
29
|
["core/query-pagination"],
|
|
21
30
|
["core/query-no-results"]
|
|
22
31
|
],
|
|
@@ -47,11 +56,7 @@ const variations = [
|
|
|
47
56
|
[
|
|
48
57
|
"core/post-template",
|
|
49
58
|
{},
|
|
50
|
-
[
|
|
51
|
-
["core/post-title"],
|
|
52
|
-
["core/post-date"],
|
|
53
|
-
["core/post-excerpt"]
|
|
54
|
-
]
|
|
59
|
+
[["core/post-title"], postDate, ["core/post-excerpt"]]
|
|
55
60
|
],
|
|
56
61
|
["core/query-pagination"],
|
|
57
62
|
["core/query-no-results"]
|
|
@@ -69,7 +74,7 @@ const variations = [
|
|
|
69
74
|
{},
|
|
70
75
|
[
|
|
71
76
|
["core/post-featured-image"],
|
|
72
|
-
|
|
77
|
+
postDate,
|
|
73
78
|
["core/post-title"]
|
|
74
79
|
]
|
|
75
80
|
],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query/variations.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\ttitleDate,\n\ttitleExcerpt,\n\ttitleDateExcerpt,\n\timageDateTitle,\n} from './icons';\n\nconst
|
|
5
|
-
"mappings": "AAGA,SAAS,UAAU;AAKnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,MAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,OAAO,GAAI,cAAe;AAAA,IAC1B,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,aAAa;AAAA,MACZ
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\ttitleDate,\n\ttitleExcerpt,\n\ttitleDateExcerpt,\n\timageDateTitle,\n} from './icons';\n\nconst postDate = [\n\t'core/post-date',\n\t{\n\t\tmetadata: {\n\t\t\tbindings: {\n\t\t\t\tdatetime: {\n\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\targs: { field: 'date' },\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n];\n\nconst variations = [\n\t{\n\t\tname: 'title-date',\n\t\ttitle: __( 'Title & Date' ),\n\t\ticon: titleDate,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[ 'core/post-template', {}, [ [ 'core/post-title' ], postDate ] ],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'title-excerpt',\n\t\ttitle: __( 'Title & Excerpt' ),\n\t\ticon: titleExcerpt,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[ [ 'core/post-title' ], [ 'core/post-excerpt' ] ],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'title-date-excerpt',\n\t\ttitle: __( 'Title, Date, & Excerpt' ),\n\t\ticon: titleDateExcerpt,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[ [ 'core/post-title' ], postDate, [ 'core/post-excerpt' ] ],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],\n\t\t\t[ 'core/query-no-results' ],\n\t\t],\n\t\tscope: [ 'block' ],\n\t},\n\t{\n\t\tname: 'image-date-title',\n\t\ttitle: __( 'Image, Date, & Title' ),\n\t\ticon: imageDateTitle,\n\t\tattributes: {},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/post-template',\n\t\t\t\t{},\n\t\t\t\t[\n\t\t\t\t\t[ 'core/post-featured-image' ],\n\t\t\t\t\tpostDate,\n\t\t\t\t\t[ 'core/post-title' ],\n\t\t\t\t],\n\t\t\t],\n\t\t\t[ 'core/query-pagination' ],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CAAE,mBAAoB,CAAE;AAAA,MAC5D;AAAA,MACA,CAAE,uBAAwB;AAAA,MAC1B,CAAE,uBAAwB;AAAA,IAC3B;AAAA,IACA,OAAO,CAAE,OAAQ;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,OAAO,GAAI,sBAAuB;AAAA,IAClC,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,aAAa;AAAA,MACZ;AAAA,QACC;AAAA,QACA,CAAC;AAAA,QACD;AAAA,UACC,CAAE,0BAA2B;AAAA,UAC7B;AAAA,UACA,CAAE,iBAAkB;AAAA,QACrB;AAAA,MACD;AAAA,MACA,CAAE,uBAAwB;AAAA,MAC1B,CAAE,uBAAwB;AAAA,IAC3B;AAAA,IACA,OAAO,CAAE,OAAQ;AAAA,EAClB;AACD;AAEA,IAAO,qBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -43,19 +43,19 @@ const { actions } = store(
|
|
|
43
43
|
const ctx = getContext();
|
|
44
44
|
ctx.isSearchInputVisible = false;
|
|
45
45
|
},
|
|
46
|
-
handleSearchKeydown(event) {
|
|
46
|
+
handleSearchKeydown: withSyncEvent((event) => {
|
|
47
47
|
const { ref } = getElement();
|
|
48
48
|
if (event?.key === "Escape") {
|
|
49
49
|
actions.closeSearchInput();
|
|
50
50
|
ref.querySelector("button").focus();
|
|
51
51
|
}
|
|
52
|
-
},
|
|
53
|
-
handleSearchFocusout(event) {
|
|
52
|
+
}),
|
|
53
|
+
handleSearchFocusout: withSyncEvent((event) => {
|
|
54
54
|
const { ref } = getElement();
|
|
55
55
|
if (!ref.contains(event.relatedTarget) && event.target !== window.document.activeElement) {
|
|
56
56
|
actions.closeSearchInput();
|
|
57
57
|
}
|
|
58
|
-
}
|
|
58
|
+
})
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
{ lock: true }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/search/view.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tstore,\n\tgetContext,\n\tgetElement,\n\twithSyncEvent,\n} from '@wordpress/interactivity';\n\nconst { actions } = store(\n\t'core/search',\n\t{\n\t\tstate: {\n\t\t\tget ariaLabel() {\n\t\t\t\tconst {\n\t\t\t\t\tisSearchInputVisible,\n\t\t\t\t\tariaLabelCollapsed,\n\t\t\t\t\tariaLabelExpanded,\n\t\t\t\t} = getContext();\n\t\t\t\treturn isSearchInputVisible\n\t\t\t\t\t? ariaLabelExpanded\n\t\t\t\t\t: ariaLabelCollapsed;\n\t\t\t},\n\t\t\tget ariaControls() {\n\t\t\t\tconst { isSearchInputVisible, inputId } = getContext();\n\t\t\t\treturn isSearchInputVisible ? null : inputId;\n\t\t\t},\n\t\t\tget type() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? 'submit' : 'button';\n\t\t\t},\n\t\t\tget tabindex() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? '0' : '-1';\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenSearchInput: withSyncEvent( ( event ) => {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( ! ctx.isSearchInputVisible ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tctx.isSearchInputVisible = true;\n\t\t\t\t\tref.parentElement.querySelector( 'input' ).focus();\n\t\t\t\t}\n\t\t\t} ),\n\t\t\tcloseSearchInput() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tctx.isSearchInputVisible = false;\n\t\t\t},\n\t\t\thandleSearchKeydown( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If Escape close the menu.\n\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleSearchFocusout( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If focus is outside search form, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\t\t\t\tif (\n\t\t\t\t\t! ref.contains( event.relatedTarget ) &&\n\t\t\t\t\tevent.target !== window.document.activeElement\n\t\t\t\t) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],
|
|
5
|
-
"mappings": "AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,MAAM,EAAE,QAAQ,IAAI;AAAA,EACnB;AAAA,EACA;AAAA,IACC,OAAO;AAAA,MACN,IAAI,YAAY;AACf,cAAM;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACD,IAAI,WAAW;AACf,eAAO,uBACJ,oBACA;AAAA,MACJ;AAAA,MACA,IAAI,eAAe;AAClB,cAAM,EAAE,sBAAsB,QAAQ,IAAI,WAAW;AACrD,eAAO,uBAAuB,OAAO;AAAA,MACtC;AAAA,MACA,IAAI,OAAO;AACV,cAAM,EAAE,qBAAqB,IAAI,WAAW;AAC5C,eAAO,uBAAuB,WAAW;AAAA,MAC1C;AAAA,MACA,IAAI,WAAW;AACd,cAAM,EAAE,qBAAqB,IAAI,WAAW;AAC5C,eAAO,uBAAuB,MAAM;AAAA,MACrC;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR,iBAAiB,cAAe,CAAE,UAAW;AAC5C,cAAM,MAAM,WAAW;AACvB,cAAM,EAAE,IAAI,IAAI,WAAW;AAC3B,YAAK,CAAE,IAAI,sBAAuB;AACjC,gBAAM,eAAe;AACrB,cAAI,uBAAuB;AAC3B,cAAI,cAAc,cAAe,OAAQ,EAAE,MAAM;AAAA,QAClD;AAAA,MACD,CAAE;AAAA,MACF,mBAAmB;AAClB,cAAM,MAAM,WAAW;AACvB,YAAI,uBAAuB;AAAA,MAC5B;AAAA,MACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tstore,\n\tgetContext,\n\tgetElement,\n\twithSyncEvent,\n} from '@wordpress/interactivity';\n\nconst { actions } = store(\n\t'core/search',\n\t{\n\t\tstate: {\n\t\t\tget ariaLabel() {\n\t\t\t\tconst {\n\t\t\t\t\tisSearchInputVisible,\n\t\t\t\t\tariaLabelCollapsed,\n\t\t\t\t\tariaLabelExpanded,\n\t\t\t\t} = getContext();\n\t\t\t\treturn isSearchInputVisible\n\t\t\t\t\t? ariaLabelExpanded\n\t\t\t\t\t: ariaLabelCollapsed;\n\t\t\t},\n\t\t\tget ariaControls() {\n\t\t\t\tconst { isSearchInputVisible, inputId } = getContext();\n\t\t\t\treturn isSearchInputVisible ? null : inputId;\n\t\t\t},\n\t\t\tget type() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? 'submit' : 'button';\n\t\t\t},\n\t\t\tget tabindex() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? '0' : '-1';\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenSearchInput: withSyncEvent( ( event ) => {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( ! ctx.isSearchInputVisible ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tctx.isSearchInputVisible = true;\n\t\t\t\t\tref.parentElement.querySelector( 'input' ).focus();\n\t\t\t\t}\n\t\t\t} ),\n\t\t\tcloseSearchInput() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tctx.isSearchInputVisible = false;\n\t\t\t},\n\t\t\thandleSearchKeydown: withSyncEvent( ( event ) => {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If Escape close the menu.\n\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t} ),\n\t\t\thandleSearchFocusout: withSyncEvent( ( event ) => {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If focus is outside search form, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\t\t\t\tif (\n\t\t\t\t\t! ref.contains( event.relatedTarget ) &&\n\t\t\t\t\tevent.target !== window.document.activeElement\n\t\t\t\t) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t}\n\t\t\t} ),\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],
|
|
5
|
+
"mappings": "AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,MAAM,EAAE,QAAQ,IAAI;AAAA,EACnB;AAAA,EACA;AAAA,IACC,OAAO;AAAA,MACN,IAAI,YAAY;AACf,cAAM;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACD,IAAI,WAAW;AACf,eAAO,uBACJ,oBACA;AAAA,MACJ;AAAA,MACA,IAAI,eAAe;AAClB,cAAM,EAAE,sBAAsB,QAAQ,IAAI,WAAW;AACrD,eAAO,uBAAuB,OAAO;AAAA,MACtC;AAAA,MACA,IAAI,OAAO;AACV,cAAM,EAAE,qBAAqB,IAAI,WAAW;AAC5C,eAAO,uBAAuB,WAAW;AAAA,MAC1C;AAAA,MACA,IAAI,WAAW;AACd,cAAM,EAAE,qBAAqB,IAAI,WAAW;AAC5C,eAAO,uBAAuB,MAAM;AAAA,MACrC;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR,iBAAiB,cAAe,CAAE,UAAW;AAC5C,cAAM,MAAM,WAAW;AACvB,cAAM,EAAE,IAAI,IAAI,WAAW;AAC3B,YAAK,CAAE,IAAI,sBAAuB;AACjC,gBAAM,eAAe;AACrB,cAAI,uBAAuB;AAC3B,cAAI,cAAc,cAAe,OAAQ,EAAE,MAAM;AAAA,QAClD;AAAA,MACD,CAAE;AAAA,MACF,mBAAmB;AAClB,cAAM,MAAM,WAAW;AACvB,YAAI,uBAAuB;AAAA,MAC5B;AAAA,MACA,qBAAqB,cAAe,CAAE,UAAW;AAChD,cAAM,EAAE,IAAI,IAAI,WAAW;AAE3B,YAAK,OAAO,QAAQ,UAAW;AAC9B,kBAAQ,iBAAiB;AACzB,cAAI,cAAe,QAAS,EAAE,MAAM;AAAA,QACrC;AAAA,MACD,CAAE;AAAA,MACF,sBAAsB,cAAe,CAAE,UAAW;AACjD,cAAM,EAAE,IAAI,IAAI,WAAW;AAM3B,YACC,CAAE,IAAI,SAAU,MAAM,aAAc,KACpC,MAAM,WAAW,OAAO,SAAS,eAChC;AACD,kBAAQ,iBAAiB;AAAA,QAC1B;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD;AAAA,EACA,EAAE,MAAM,KAAK;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -40,7 +40,7 @@ function TermsQueryInspectorControls({
|
|
|
40
40
|
)?.hierarchical;
|
|
41
41
|
const inheritQuery = !!inherit;
|
|
42
42
|
const displayInheritControl = ["taxonomy", "category", "tag", "archive"].includes(templateSlug) || templateSlug?.startsWith("taxonomy-") || templateSlug?.startsWith("category-") || templateSlug?.startsWith("tag-");
|
|
43
|
-
const displayShowNestedControl = isTaxonomyHierarchical
|
|
43
|
+
const displayShowNestedControl = isTaxonomyHierarchical;
|
|
44
44
|
const hasIncludeFilter = !!include?.length;
|
|
45
45
|
const queryTypeControlLabel = __("Query type");
|
|
46
46
|
const taxonomyControlLabel = __("Taxonomy");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/terms-query/edit/inspector-controls/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { InspectorControls } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';\nimport { usePublicTaxonomies } from '../../utils';\nimport TaxonomyControl from './taxonomy-control';\nimport OrderControl from './order-control';\nimport EmptyTermsControl from './empty-terms-control';\nimport NestedTermsControl from './nested-terms-control';\nimport InheritControl from './inherit-control';\nimport MaxTermsControl from './max-terms-control';\nimport AdvancedControls from './advanced-controls';\nimport IncludeControl from './include-control';\n\nexport default function TermsQueryInspectorControls( {\n\tattributes,\n\tsetQuery,\n\tsetAttributes,\n\tclientId,\n\ttemplateSlug,\n} ) {\n\tconst { termQuery, tagName: TagName } = attributes;\n\tconst {\n\t\ttaxonomy,\n\t\torderBy,\n\t\torder,\n\t\thideEmpty,\n\t\tinherit,\n\t\tshowNested,\n\t\tperPage,\n\t\tinclude,\n\t} = termQuery;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst taxonomies = usePublicTaxonomies();\n\n\tconst isTaxonomyHierarchical = taxonomies.find(\n\t\t( _taxonomy ) => _taxonomy.slug === taxonomy\n\t)?.hierarchical;\n\tconst inheritQuery = !! inherit;\n\t// Display the inherit control when we're in a taxonomy-related\n\t// template (category, tag, or custom taxonomy).\n\tconst displayInheritControl =\n\t\t[ 'taxonomy', 'category', 'tag', 'archive' ].includes( templateSlug ) ||\n\t\ttemplateSlug?.startsWith( 'taxonomy-' ) ||\n\t\ttemplateSlug?.startsWith( 'category-' ) ||\n\t\ttemplateSlug?.startsWith( 'tag-' );\n\t//
|
|
5
|
-
"mappings": "AAuEE,mBA2BK,KAzBH,YAFF;AApEF,SAAS,UAAU;AACnB;AAAA,EACC,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,OAC1B;AACP,SAAS,yBAAyB;AAKlC,SAAS,sCAAsC;AAC/C,SAAS,2BAA2B;AACpC,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AACzB,OAAO,uBAAuB;AAC9B,OAAO,wBAAwB;AAC/B,OAAO,oBAAoB;AAC3B,OAAO,qBAAqB;AAC5B,OAAO,sBAAsB;AAC7B,OAAO,oBAAoB;AAEZ,SAAR,4BAA8C;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,WAAW,SAAS,QAAQ,IAAI;AACxC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AACJ,QAAM,oBAAoB,+BAA+B;AAEzD,QAAM,aAAa,oBAAoB;AAEvC,QAAM,yBAAyB,WAAW;AAAA,IACzC,CAAE,cAAe,UAAU,SAAS;AAAA,EACrC,GAAG;AACH,QAAM,eAAe,CAAC,CAAE;AAGxB,QAAM,wBACL,CAAE,YAAY,YAAY,OAAO,SAAU,EAAE,SAAU,YAAa,KACpE,cAAc,WAAY,WAAY,KACtC,cAAc,WAAY,WAAY,KACtC,cAAc,WAAY,MAAO;AAElC,QAAM,2BAA2B
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { InspectorControls } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';\nimport { usePublicTaxonomies } from '../../utils';\nimport TaxonomyControl from './taxonomy-control';\nimport OrderControl from './order-control';\nimport EmptyTermsControl from './empty-terms-control';\nimport NestedTermsControl from './nested-terms-control';\nimport InheritControl from './inherit-control';\nimport MaxTermsControl from './max-terms-control';\nimport AdvancedControls from './advanced-controls';\nimport IncludeControl from './include-control';\n\nexport default function TermsQueryInspectorControls( {\n\tattributes,\n\tsetQuery,\n\tsetAttributes,\n\tclientId,\n\ttemplateSlug,\n} ) {\n\tconst { termQuery, tagName: TagName } = attributes;\n\tconst {\n\t\ttaxonomy,\n\t\torderBy,\n\t\torder,\n\t\thideEmpty,\n\t\tinherit,\n\t\tshowNested,\n\t\tperPage,\n\t\tinclude,\n\t} = termQuery;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst taxonomies = usePublicTaxonomies();\n\n\tconst isTaxonomyHierarchical = taxonomies.find(\n\t\t( _taxonomy ) => _taxonomy.slug === taxonomy\n\t)?.hierarchical;\n\tconst inheritQuery = !! inherit;\n\t// Display the inherit control when we're in a taxonomy-related\n\t// template (category, tag, or custom taxonomy).\n\tconst displayInheritControl =\n\t\t[ 'taxonomy', 'category', 'tag', 'archive' ].includes( templateSlug ) ||\n\t\ttemplateSlug?.startsWith( 'taxonomy-' ) ||\n\t\ttemplateSlug?.startsWith( 'category-' ) ||\n\t\ttemplateSlug?.startsWith( 'tag-' );\n\t// Display the showNested control if the taxonomy is hierarchical.\n\tconst displayShowNestedControl = isTaxonomyHierarchical;\n\tconst hasIncludeFilter = !! include?.length;\n\n\t// Labels shared between ToolsPanelItem and its child control.\n\tconst queryTypeControlLabel = __( 'Query type' );\n\tconst taxonomyControlLabel = __( 'Taxonomy' );\n\tconst orderByControlLabel = __( 'Order by' );\n\tconst emptyTermsControlLabel = __( 'Show empty terms' );\n\tconst nestedTermsControlLabel = __( 'Show nested terms' );\n\tconst maxTermsControlLabel = __( 'Max terms' );\n\tconst includeControlLabel = __( 'Selected terms' );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttermQuery: {\n\t\t\t\t\t\t\t\ttaxonomy: 'category',\n\t\t\t\t\t\t\t\torder: 'asc',\n\t\t\t\t\t\t\t\torderBy: 'name',\n\t\t\t\t\t\t\t\tinclude: [],\n\t\t\t\t\t\t\t\thideEmpty: true,\n\t\t\t\t\t\t\t\tshowNested: false,\n\t\t\t\t\t\t\t\tinherit: false,\n\t\t\t\t\t\t\t\tperPage: 10,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ displayInheritControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => inherit !== false }\n\t\t\t\t\t\t\tlabel={ queryTypeControlLabel }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { inherit: false } ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<InheritControl\n\t\t\t\t\t\t\t\tlabel={ queryTypeControlLabel }\n\t\t\t\t\t\t\t\tvalue={ inherit }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! inheritQuery && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => taxonomy !== 'category' }\n\t\t\t\t\t\t\tlabel={ taxonomyControlLabel }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetQuery( { taxonomy: 'category' } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TaxonomyControl\n\t\t\t\t\t\t\t\tlabel={ taxonomyControlLabel }\n\t\t\t\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t// We also need to reset the include filter when changing taxonomy.\n\t\t\t\t\t\t\t\t\tsetQuery( { taxonomy: value, include: [] } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => orderBy !== 'name' || order !== 'asc' }\n\t\t\t\t\t\tlabel={ orderByControlLabel }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetQuery( { orderBy: 'name', order: 'asc' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\tlabel={ orderByControlLabel }\n\t\t\t\t\t\t\t{ ...{ orderBy, order } }\n\t\t\t\t\t\t\tonChange={ ( newOrderBy, newOrder ) => {\n\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\torderBy: newOrderBy,\n\t\t\t\t\t\t\t\t\torder: newOrder,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisabled={ hasIncludeFilter }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\thasIncludeFilter\n\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t'When specific terms are selected, the order is based on their selection order.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ ! inheritQuery && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! include?.length }\n\t\t\t\t\t\t\tlabel={ includeControlLabel }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\tinclude: [],\n\t\t\t\t\t\t\t\t\torderBy: 'name',\n\t\t\t\t\t\t\t\t\torder: 'asc',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<IncludeControl\n\t\t\t\t\t\t\t\tlabel={ includeControlLabel }\n\t\t\t\t\t\t\t\ttaxonomy={ taxonomy }\n\t\t\t\t\t\t\t\tvalue={ include }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { include: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => hideEmpty !== true }\n\t\t\t\t\t\tlabel={ emptyTermsControlLabel }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { hideEmpty: true } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<EmptyTermsControl\n\t\t\t\t\t\t\tlabel={ emptyTermsControlLabel }\n\t\t\t\t\t\t\tvalue={ hideEmpty }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { hideEmpty: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ displayShowNestedControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => showNested !== false }\n\t\t\t\t\t\t\tlabel={ nestedTermsControlLabel }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetQuery( { showNested: false } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<NestedTermsControl\n\t\t\t\t\t\t\t\tlabel={ nestedTermsControlLabel }\n\t\t\t\t\t\t\t\tvalue={ showNested }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { showNested: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ hasIncludeFilter }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\thasIncludeFilter\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'When specific terms are selected, only those are displayed.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => perPage !== 10 }\n\t\t\t\t\t\tlabel={ maxTermsControlLabel }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { perPage: 10 } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<MaxTermsControl\n\t\t\t\t\t\t\tlabel={ maxTermsControlLabel }\n\t\t\t\t\t\t\tvalue={ perPage }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { perPage: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<AdvancedControls\n\t\t\t\tTagName={ TagName }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AAuEE,mBA2BK,KAzBH,YAFF;AApEF,SAAS,UAAU;AACnB;AAAA,EACC,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,OAC1B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A,UACD;AAAA,UAED;AAAA,YAAC;AAAA;AAAA,cACA,UAAW,MAAM,YAAY;AAAA,cAC7B,OAAQ;AAAA,cACR,YAAa,MAAM,SAAU,EAAE,SAAS,GAAG,CAAE;AAAA,cAC7C,kBAAgB;AAAA,cAEhB;AAAA,gBAAC;AAAA;AAAA,kBACA,OAAQ;AAAA,kBACR,OAAQ;AAAA,kBACR,UAAW,CAAE,UACZ,SAAU,EAAE,SAAS,MAAM,CAAE;AAAA;AAAA,cAE/B;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IACD,GACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,13 +14,11 @@ function InheritControl({ value, onChange, label }) {
|
|
|
14
14
|
isBlock: true,
|
|
15
15
|
onChange: (newValue) => {
|
|
16
16
|
onChange({
|
|
17
|
-
inherit: newValue === "default"
|
|
18
|
-
// When enabling inherit, hierarchical is not supported.
|
|
19
|
-
...newValue === "default" ? { showNested: false } : {}
|
|
17
|
+
inherit: newValue === "default"
|
|
20
18
|
});
|
|
21
19
|
},
|
|
22
20
|
help: value ? __(
|
|
23
|
-
"Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows
|
|
21
|
+
"Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows children of the current term. For non-hierarchical taxonomies, shows all terms."
|
|
24
22
|
) : __("Display terms based on specific criteria."),
|
|
25
23
|
value: value ? "default" : "custom",
|
|
26
24
|
children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/terms-query/edit/inspector-controls/inherit-control.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function InheritControl( { value, onChange, label } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ label }\n\t\t\tisBlock\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\tinherit: newValue === 'default',\n\t\t\t\t
|
|
5
|
-
"mappings": "AAWE,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function InheritControl( { value, onChange, label } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ label }\n\t\t\tisBlock\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\tinherit: newValue === 'default',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\thelp={\n\t\t\t\tvalue\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows children of the current term. For non-hierarchical taxonomies, shows all terms.'\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Display terms based on specific criteria.' )\n\t\t\t}\n\t\t\tvalue={ value ? 'default' : 'custom' }\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"default\"\n\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption value=\"custom\" label={ __( 'Custom' ) } />\n\t\t</ToggleGroupControl>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AAWE,SAmBC,KAnBD;AARF;AAAA,EACC,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,OACpC;AACP,SAAS,UAAU;AAEJ,SAAR,eAAiC,EAAE,OAAO,UAAU,MAAM,GAAI;AACpE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,yBAAuB;AAAA,MACvB;AAAA,MACA,SAAO;AAAA,MACP,UAAW,CAAE,aAAc;AAC1B,iBAAU;AAAA,UACT,SAAS,aAAa;AAAA,QACvB,CAAE;AAAA,MACH;AAAA,MACA,MACC,QACG;AAAA,QACA;AAAA,MACA,IACA,GAAI,2CAA4C;AAAA,MAEpD,OAAQ,QAAQ,YAAY;AAAA,MAE5B;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,OAAQ,GAAI,SAAU;AAAA;AAAA,QACvB;AAAA,QACA,oBAAC,4BAAyB,OAAM,UAAS,OAAQ,GAAI,QAAS,GAAI;AAAA;AAAA;AAAA,EACnE;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,29 +8,17 @@ function getTransformedAttributes(attributes, newBlockName, bindingsCallback = n
|
|
|
8
8
|
return void 0;
|
|
9
9
|
}
|
|
10
10
|
const transformedAttributes = {};
|
|
11
|
-
if (hasBlockSupport(newBlockType, "allowedBlocks") && attributes.allowedBlocks) {
|
|
12
|
-
transformedAttributes.allowedBlocks = attributes.allowedBlocks;
|
|
13
|
-
}
|
|
14
11
|
if (hasBlockSupport(newBlockType, "anchor") && attributes.anchor) {
|
|
15
12
|
transformedAttributes.anchor = attributes.anchor;
|
|
16
13
|
}
|
|
17
14
|
if (hasBlockSupport(newBlockType, "ariaLabel") && attributes.ariaLabel) {
|
|
18
15
|
transformedAttributes.ariaLabel = attributes.ariaLabel;
|
|
19
16
|
}
|
|
20
|
-
if (hasBlockSupport(newBlockType, "className") && attributes.className) {
|
|
21
|
-
transformedAttributes.className = attributes.className;
|
|
22
|
-
}
|
|
23
17
|
if (attributes.metadata) {
|
|
24
|
-
const transformedMetadata = [
|
|
18
|
+
const transformedMetadata = [];
|
|
25
19
|
if (bindingsCallback) {
|
|
26
20
|
transformedMetadata.push("id", "bindings");
|
|
27
21
|
}
|
|
28
|
-
if (hasBlockSupport(newBlockType, "renaming", true)) {
|
|
29
|
-
transformedMetadata.push("name");
|
|
30
|
-
}
|
|
31
|
-
if (hasBlockSupport(newBlockType, "blockVisibility", true)) {
|
|
32
|
-
transformedMetadata.push("blockVisibility");
|
|
33
|
-
}
|
|
34
22
|
if (transformedMetadata.length > 0) {
|
|
35
23
|
const newMetadata = Object.entries(attributes.metadata).reduce(
|
|
36
24
|
(obj, [prop, value]) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/get-transformed-attributes.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Transform block support attributes and metadata during block transforms.\n *\n * @param {Object} attributes Original attributes from the block being transformed.\n * @param {string} newBlockName Name of the target block after transformation.\n * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object.\n * @return {Object} New attributes object with preserved block support attributes and metadata.\n */\nexport function getTransformedAttributes(\n\tattributes,\n\tnewBlockName,\n\tbindingsCallback = null\n) {\n\tif ( ! attributes ) {\n\t\treturn undefined;\n\t}\n\n\tconst newBlockType = getBlockType( newBlockName );\n\tif ( ! newBlockType ) {\n\t\treturn undefined;\n\t}\n\n\tconst transformedAttributes = {};\n\n\t// Handle attributes derived from block support
|
|
5
|
-
"mappings": "AAGA,SAAS,cAAc,uBAAuB;AAUvC,SAAS,yBACf,YACA,cACA,mBAAmB,MAClB;AACD,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,QAAM,eAAe,aAAc,YAAa;AAChD,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,QAAM,wBAAwB,CAAC;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Transform block support attributes and metadata during block transforms.\n *\n * @param {Object} attributes Original attributes from the block being transformed.\n * @param {string} newBlockName Name of the target block after transformation.\n * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object.\n * @return {Object} New attributes object with preserved block support attributes and metadata.\n */\nexport function getTransformedAttributes(\n\tattributes,\n\tnewBlockName,\n\tbindingsCallback = null\n) {\n\tif ( ! attributes ) {\n\t\treturn undefined;\n\t}\n\n\tconst newBlockType = getBlockType( newBlockName );\n\tif ( ! newBlockType ) {\n\t\treturn undefined;\n\t}\n\n\tconst transformedAttributes = {};\n\n\t// Handle attributes derived from block support. The custom class name and\n\t// allowed blocks attribute is handled separately.\n\tif ( hasBlockSupport( newBlockType, 'anchor' ) && attributes.anchor ) {\n\t\ttransformedAttributes.anchor = attributes.anchor;\n\t}\n\tif (\n\t\thasBlockSupport( newBlockType, 'ariaLabel' ) &&\n\t\tattributes.ariaLabel\n\t) {\n\t\ttransformedAttributes.ariaLabel = attributes.ariaLabel;\n\t}\n\n\t// Handle metadata transformation.\n\tif ( attributes.metadata ) {\n\t\t// The metadata properties that should be preserved after the transform.\n\t\t// The noteId, name, and blockVisibility properties are separately handled\n\t\t// in the `core/metadata/addTransforms` hook.\n\t\tconst transformedMetadata = [];\n\n\t\t// If there is a transform bindings callback, add the `id` and `bindings` properties.\n\t\tif ( bindingsCallback ) {\n\t\t\ttransformedMetadata.push( 'id', 'bindings' );\n\t\t}\n\n\t\t// Only process metadata if there are supported properties.\n\t\tif ( transformedMetadata.length > 0 ) {\n\t\t\tconst newMetadata = Object.entries( attributes.metadata ).reduce(\n\t\t\t\t( obj, [ prop, value ] ) => {\n\t\t\t\t\t// If prop is not supported, don't add it to the new metadata object.\n\t\t\t\t\tif ( ! transformedMetadata.includes( prop ) ) {\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t}\n\t\t\t\t\tobj[ prop ] =\n\t\t\t\t\t\tprop === 'bindings' ? bindingsCallback( value ) : value;\n\t\t\t\t\treturn obj;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\t// Only add metadata if object is not empty.\n\t\t\tif ( Object.keys( newMetadata ).length > 0 ) {\n\t\t\t\ttransformedAttributes.metadata = newMetadata;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( Object.keys( transformedAttributes ).length === 0 ) {\n\t\treturn undefined;\n\t}\n\n\treturn transformedAttributes;\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,cAAc,uBAAuB;AAUvC,SAAS,yBACf,YACA,cACA,mBAAmB,MAClB;AACD,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,QAAM,eAAe,aAAc,YAAa;AAChD,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,QAAM,wBAAwB,CAAC;AAI/B,MAAK,gBAAiB,cAAc,QAAS,KAAK,WAAW,QAAS;AACrE,0BAAsB,SAAS,WAAW;AAAA,EAC3C;AACA,MACC,gBAAiB,cAAc,WAAY,KAC3C,WAAW,WACV;AACD,0BAAsB,YAAY,WAAW;AAAA,EAC9C;AAGA,MAAK,WAAW,UAAW;AAI1B,UAAM,sBAAsB,CAAC;AAG7B,QAAK,kBAAmB;AACvB,0BAAoB,KAAM,MAAM,UAAW;AAAA,IAC5C;AAGA,QAAK,oBAAoB,SAAS,GAAI;AACrC,YAAM,cAAc,OAAO,QAAS,WAAW,QAAS,EAAE;AAAA,QACzD,CAAE,KAAK,CAAE,MAAM,KAAM,MAAO;AAE3B,cAAK,CAAE,oBAAoB,SAAU,IAAK,GAAI;AAC7C,mBAAO;AAAA,UACR;AACA,cAAK,IAAK,IACT,SAAS,aAAa,iBAAkB,KAAM,IAAI;AACnD,iBAAO;AAAA,QACR;AAAA,QACA,CAAC;AAAA,MACF;AAGA,UAAK,OAAO,KAAM,WAAY,EAAE,SAAS,GAAI;AAC5C,8BAAsB,WAAW;AAAA,MAClC;AAAA,IACD;AAAA,EACD;AAEA,MAAK,OAAO,KAAM,qBAAsB,EAAE,WAAW,GAAI;AACxD,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1284,6 +1284,11 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1284
1284
|
padding-right: 0;
|
|
1285
1285
|
}
|
|
1286
1286
|
|
|
1287
|
+
.wp-block-math__textarea-control textarea {
|
|
1288
|
+
font-family: Menlo, Consolas, monaco, monospace;
|
|
1289
|
+
direction: ltr;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1287
1292
|
.wp-block-media-text__media {
|
|
1288
1293
|
position: relative;
|
|
1289
1294
|
}
|
|
@@ -1950,7 +1955,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
1950
1955
|
.link-control-transform__subheading {
|
|
1951
1956
|
font-size: 11px;
|
|
1952
1957
|
text-transform: uppercase;
|
|
1953
|
-
font-weight:
|
|
1958
|
+
font-weight: 500;
|
|
1954
1959
|
color: #1e1e1e;
|
|
1955
1960
|
margin-bottom: 1.5em;
|
|
1956
1961
|
}
|
|
@@ -2597,7 +2602,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2597
2602
|
color: #757575;
|
|
2598
2603
|
text-transform: uppercase;
|
|
2599
2604
|
font-size: 11px;
|
|
2600
|
-
font-weight:
|
|
2605
|
+
font-weight: 500;
|
|
2601
2606
|
display: block;
|
|
2602
2607
|
}
|
|
2603
2608
|
|
package/build-style/editor.css
CHANGED
|
@@ -1291,6 +1291,12 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1291
1291
|
padding-left: 0;
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
|
+
.wp-block-math__textarea-control textarea {
|
|
1295
|
+
font-family: Menlo, Consolas, monaco, monospace;
|
|
1296
|
+
/*rtl:ignore*/
|
|
1297
|
+
direction: ltr;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1294
1300
|
.wp-block-media-text__media {
|
|
1295
1301
|
position: relative;
|
|
1296
1302
|
}
|
|
@@ -1957,7 +1963,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
1957
1963
|
.link-control-transform__subheading {
|
|
1958
1964
|
font-size: 11px;
|
|
1959
1965
|
text-transform: uppercase;
|
|
1960
|
-
font-weight:
|
|
1966
|
+
font-weight: 500;
|
|
1961
1967
|
color: #1e1e1e;
|
|
1962
1968
|
margin-bottom: 1.5em;
|
|
1963
1969
|
}
|
|
@@ -2604,7 +2610,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2604
2610
|
color: #757575;
|
|
2605
2611
|
text-transform: uppercase;
|
|
2606
2612
|
font-size: 11px;
|
|
2607
|
-
font-weight:
|
|
2613
|
+
font-weight: 500;
|
|
2608
2614
|
display: block;
|
|
2609
2615
|
}
|
|
2610
2616
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SCSS Variables.
|
|
3
|
+
*
|
|
4
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
5
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
6
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Colors
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Fonts & basic variables.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Typography
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Grid System.
|
|
19
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Radius scale.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Elevation scale.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Dimensions.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Mobile specific styles
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Editor styles.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Block & Editor UI.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Block paddings.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* React Native specific.
|
|
44
|
+
* These variables do not appear to be used anywhere else.
|
|
45
|
+
*/
|
|
46
|
+
.wp-block-math__textarea-control textarea {
|
|
47
|
+
font-family: Menlo, Consolas, monaco, monospace;
|
|
48
|
+
direction: ltr;
|
|
49
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SCSS Variables.
|
|
3
|
+
*
|
|
4
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
5
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
6
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Colors
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Fonts & basic variables.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Typography
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Grid System.
|
|
19
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Radius scale.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Elevation scale.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Dimensions.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Mobile specific styles
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Editor styles.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Block & Editor UI.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Block paddings.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* React Native specific.
|
|
44
|
+
* These variables do not appear to be used anywhere else.
|
|
45
|
+
*/
|
|
46
|
+
.wp-block-math__textarea-control textarea {
|
|
47
|
+
font-family: Menlo, Consolas, monaco, monospace;
|
|
48
|
+
/*rtl:ignore*/
|
|
49
|
+
direction: ltr;
|
|
50
|
+
}
|