@wordpress/block-library 7.14.3 → 7.14.4
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/navigation/edit/index.js +12 -12
- package/build/navigation/edit/index.js.map +1 -1
- package/build/post-content/edit.js +6 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -1
- package/build/post-featured-image/overlay.js +2 -2
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +1 -1
- package/build/query/utils.js.map +1 -1
- package/build/quote/index.js +0 -1
- package/build/quote/index.js.map +1 -1
- package/build/template-part/index.js +2 -2
- package/build/template-part/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +12 -12
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/post-content/edit.js +6 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -1
- package/build-module/post-featured-image/overlay.js +2 -2
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +1 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/quote/index.js +0 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/template-part/index.js +2 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-style/code/style-rtl.css +3 -0
- package/build-style/code/style.css +3 -0
- package/build-style/editor-rtl.css +39 -29
- package/build-style/editor.css +39 -29
- package/build-style/post-featured-image/editor-rtl.css +39 -29
- package/build-style/post-featured-image/editor.css +39 -29
- package/build-style/style-rtl.css +3 -0
- package/build-style/style.css +3 -0
- package/package.json +12 -12
- package/src/code/style.scss +12 -7
- package/src/navigation/edit/index.js +12 -10
- package/src/post-content/edit.js +3 -1
- package/src/post-featured-image/block.json +1 -1
- package/src/post-featured-image/editor.scss +79 -72
- package/src/post-featured-image/index.php +18 -24
- package/src/post-featured-image/overlay.js +17 -14
- package/src/query/edit/inspector-controls/index.js +1 -4
- package/src/query/utils.js +1 -1
- package/src/quote/block.json +0 -1
- package/src/template-part/index.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"names":["debounce","PanelBody","TextControl","SelectControl","RangeControl","ToggleControl","Notice","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","InspectorControls","useEffect","useState","useCallback","OrderControl","AuthorControl","ParentControl","TaxonomyControls","useTaxonomiesInfo","StickyControl","usePostTypes","useIsPostTypeHierarchical","useAllowedControls","isControlAllowed","QueryInspectorControls","attributes","setQuery","setDisplayLayout","query","displayLayout","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","showSticky","setShowSticky","postTypesTaxonomiesMap","postTypesSelectOptions","taxonomiesInfo","isPostTypeHierarchical","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","cancel","showInheritControl","showPostTypeControl","showColumnsControl","type","showOrderControl","showStickyControl","showSettingsPanel","value","columns","Math","max","values","some"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,WAFD,EAGCC,aAHD,EAICC,YAJD,EAKCC,aALD,EAMCC,MAND,EAOCC,wBAAwB,IAAIC,UAP7B,EAQCC,4BAA4B,IAAIC,cARjC,QASO,uBATP;AAUA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AACA,SAASC,SAAT,EAAoBC,QAApB,EAA8BC,WAA9B,QAAiD,oBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAA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BAAsB,IACvB,CAAEtB,gBAAgB,CACjBgB,eADiB,EAEjB,SAFiB,CADjB,IAKA,cAAC,cAAD;AACC,IAAA,QAAQ,EAAG,MAAM,CAAC,EAAED,OAAF,aAAEA,OAAF,eAAEA,OAAO,CAAEqB,MAAX,CADnB;AAEC,IAAA,KAAK,EAAGlD,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,UAAU,EAAG,MACZiB,QAAQ,CAAE;AAAEY,MAAAA,OAAO,EAAE;AAAX,KAAF;AAJV,KAOC,cAAC,aAAD;AACC,IAAA,OAAO,EAAGA,OADX;AAEC,IAAA,QAAQ,EAAGJ,QAFZ;AAGC,IAAA,QAAQ,EAAGR;AAHZ,IAPD,CA9DH,CADD,CApEF,CADD;AAuJA","sourcesContent":["/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\tToggleControl,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { useEffect, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls, useTaxonomiesInfo } from './taxonomy-controls';\nimport StickyControl from './sticky-control';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n} from '../../utils';\n\nexport default function QueryInspectorControls( {\n\tattributes,\n\tsetQuery,\n\tsetDisplayLayout,\n} ) {\n\tconst { query, displayLayout } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpostType,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst [ showSticky, setShowSticky ] = useState( postType === 'post' );\n\tconst { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();\n\tconst taxonomiesInfo = useTaxonomiesInfo( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tuseEffect( () => {\n\t\tsetShowSticky( postType === 'post' );\n\t}, [ postType ] );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\tconst showInheritControl = isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst showColumnsControl = displayLayout?.type === 'flex';\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\treturn (\n\t\t<>\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { inherit: !! value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showPostTypeControl && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ __( 'Post type' ) }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'WordPress contains different types of content and they are divided into collections called \"Post types\". By default there are a few different ones such as blog posts and pages, but plugins could add more.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( { columns: value } )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showOrderControl && (\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ ! inherit && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\"\n\t\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ !! taxonomiesInfo?.length &&\n\t\t\t\t\t\t\tisControlAllowed( allowedControls, 'taxQuery' ) && (\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\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\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetQuery( { taxQuery: null } )\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\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isControlAllowed( allowedControls, 'author' ) && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isControlAllowed( allowedControls, 'search' ) && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isPostTypeHierarchical &&\n\t\t\t\t\t\t\t! isControlAllowed(\n\t\t\t\t\t\t\t\tallowedControls,\n\t\t\t\t\t\t\t\t'parents'\n\t\t\t\t\t\t\t) && (\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetQuery( { parents: [] } )\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\t\t<ParentControl\n\t\t\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"names":["debounce","PanelBody","TextControl","SelectControl","RangeControl","ToggleControl","Notice","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","InspectorControls","useEffect","useState","useCallback","OrderControl","AuthorControl","ParentControl","TaxonomyControls","useTaxonomiesInfo","StickyControl","usePostTypes","useIsPostTypeHierarchical","useAllowedControls","isControlAllowed","QueryInspectorControls","attributes","setQuery","setDisplayLayout","query","displayLayout","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","showSticky","setShowSticky","postTypesTaxonomiesMap","postTypesSelectOptions","taxonomiesInfo","isPostTypeHierarchical","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","cancel","showInheritControl","showPostTypeControl","showColumnsControl","type","showOrderControl","showStickyControl","showSettingsPanel","value","columns","Math","max","values","some"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,WAFD,EAGCC,aAHD,EAICC,YAJD,EAKCC,aALD,EAMCC,MAND,EAOCC,wBAAwB,IAAIC,UAP7B,EAQCC,4BAA4B,IAAIC,cARjC,QASO,uBATP;AAUA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AACA,SAASC,SAAT,EAAoBC,QAApB,EAA8BC,WAA9B,QAAiD,oBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,SAASC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IAAA,QAAQ,EAAG,MAAM,CAAC,EAAED,OAAF,aAAEA,OAAF,eAAEA,OAAO,CAAEqB,MAAX,CADnB;AAEC,IAAA,KAAK,EAAGlD,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,UAAU,EAAG,MACZiB,QAAQ,CAAE;AAAEY,MAAAA,OAAO,EAAE;AAAX,KAAF;AAJV,KAOC,cAAC,aAAD;AACC,IAAA,OAAO,EAAGA,OADX;AAEC,IAAA,QAAQ,EAAGJ,QAFZ;AAGC,IAAA,QAAQ,EAAGR;AAHZ,IAPD,CA3DH,CADD,CApEF,CADD;AAoJA","sourcesContent":["/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\tToggleControl,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { useEffect, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls, useTaxonomiesInfo } from './taxonomy-controls';\nimport StickyControl from './sticky-control';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n} from '../../utils';\n\nexport default function QueryInspectorControls( {\n\tattributes,\n\tsetQuery,\n\tsetDisplayLayout,\n} ) {\n\tconst { query, displayLayout } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpostType,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst [ showSticky, setShowSticky ] = useState( postType === 'post' );\n\tconst { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();\n\tconst taxonomiesInfo = useTaxonomiesInfo( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tuseEffect( () => {\n\t\tsetShowSticky( postType === 'post' );\n\t}, [ postType ] );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\tconst showInheritControl = isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst showColumnsControl = displayLayout?.type === 'flex';\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\treturn (\n\t\t<>\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { inherit: !! value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showPostTypeControl && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ __( 'Post type' ) }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'WordPress contains different types of content and they are divided into collections called \"Post types\". By default there are a few different ones such as blog posts and pages, but plugins could add more.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( { columns: value } )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showOrderControl && (\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ ! inherit && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\"\n\t\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ !! taxonomiesInfo?.length &&\n\t\t\t\t\t\t\tisControlAllowed( allowedControls, 'taxQuery' ) && (\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\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\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetQuery( { taxQuery: null } )\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\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isControlAllowed( allowedControls, 'author' ) && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isControlAllowed( allowedControls, 'search' ) && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isPostTypeHierarchical &&\n\t\t\t\t\t\t\tisControlAllowed( allowedControls, 'parents' ) && (\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetQuery( { parents: [] } )\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\t\t<ParentControl\n\t\t\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -239,7 +239,7 @@ export function useAllowedControls(attributes) {
|
|
|
239
239
|
return useSelect(select => {
|
|
240
240
|
var _select$getActiveBloc;
|
|
241
241
|
|
|
242
|
-
return (_select$getActiveBloc = select(blocksStore).getActiveBlockVariation(queryLoopName, attributes)) === null || _select$getActiveBloc === void 0 ? void 0 : _select$getActiveBloc.
|
|
242
|
+
return (_select$getActiveBloc = select(blocksStore).getActiveBlockVariation(queryLoopName, attributes)) === null || _select$getActiveBloc === void 0 ? void 0 : _select$getActiveBloc.allowedControls;
|
|
243
243
|
}, [attributes]);
|
|
244
244
|
}
|
|
245
245
|
export function isControlAllowed(allowedControls, key) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["get","useSelect","useMemo","store","coreStore","blockEditorStore","decodeEntities","cloneBlock","blocksStore","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","mapToIHasNameAndId","path","map","usePostTypes","postTypes","select","getPostTypes","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","value","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","getActiveBlockVariation","queryLoopName","allowControls","isControlAllowed","allowedControls","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","forEach","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","activeVariationPatterns","getBlockRootClientId","__experimentalGetPatternsByBlockTypes","rootClientId"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,y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;AAGA;;AACD,SAAO;AAAEC,IAAAA,SAAS,EAAET,YAAb;AAA2BE,IAAAA;AAA3B,GAAP;AACA,CAzBM;AA2BP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASQ,uBAAT,CAAkCL,QAAlC,EAA4CjB,UAA5C,EAAyD;AAC/D,QAAMuB,mBAAmB,GAAG3E,SAAS,CAClCyB,MAAF;AAAA;;AAAA,qCACCA,MAAM,CAAElB,WAAF,CAAN,CAAsB8C,uBAAtB,CACCC,aADD,EAECF,UAFD,CADD,2DACC,uBAGGlC,IAJJ;AAAA,GADoC,EAOpC,CAAEkC,UAAF,CAPoC,CAArC;AASA,QAAMwB,SAAS,GAAI,GAAGtB,aAAe,IAAIqB,mBAAqB,EAA9D;AACA,QAAME,uBAAuB,GAAG7E,SAAS,CACtCyB,MAAF,IAAc;AACb,QAAK,CAAEkD,mBAAP,EAA6B;AAC5B;AACA;;AACD,UAAM;AACLG,MAAAA,oBADK;AAELC,MAAAA;AAFK,QAGFtD,MAAM,CAAErB,gBAAF,CAHV;AAIA,UAAM4E,YAAY,GAAGF,oBAAoB,CAAET,QAAF,CAAzC;AACA,WAAOU,qCAAqC,CAC3CH,SAD2C,EAE3CI,YAF2C,CAA5C;AAIA,GAduC,EAexC,CAAEX,QAAF,EAAYM,mBAAZ,CAfwC,CAAzC;AAiBA,SAAOE,uBAAuB,SAAvB,IAAAA,uBAAuB,WAAvB,IAAAA,uBAAuB,CAAE1C,MAAzB,GAAkCyC,SAAlC,GAA8CtB,aAArD;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\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/**\n * Internal dependencies\n */\nimport { name as queryLoopName } from './block.json';\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 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( get( 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\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.allowControls,\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\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.name,\n\n\t\t[ attributes ]\n\t);\n\tconst blockName = `${ queryLoopName }/${ activeVariationName }`;\n\tconst activeVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\t__experimentalGetPatternsByBlockTypes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn __experimentalGetPatternsByBlockTypes(\n\t\t\t\tblockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t},\n\t\t[ clientId, activeVariationName ]\n\t);\n\treturn activeVariationPatterns?.length ? blockName : queryLoopName;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["get","useSelect","useMemo","store","coreStore","blockEditorStore","decodeEntities","cloneBlock","blocksStore","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","mapToIHasNameAndId","path","map","usePostTypes","postTypes","select","getPostTypes","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","value","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","getActiveBlockVariation","queryLoopName","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","forEach","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","activeVariationPatterns","getBlockRootClientId","__experimentalGetPatternsByBlockTypes","rootClientId"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,UAAT,EAAqBJ,KAAK,IAAIK,WAA9B,QAAiD,mBAAjD;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,eAAe,GAAKC,QAAF,IAAgB;AAC9C,QAAMC,OAAO,GAAGD,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAEE,MAAV,CACf,CAAEC,WAAF,EAAeC,MAAf,KAA2B;AAC1B,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,SAAX;AAAsBC,MAAAA;AAAtB,QAAgCJ,WAAtC;AACAE,IAAAA,OAAO,CAAED,MAAM,CAACI,EAAT,CAAP,GAAuBJ,MAAvB;AACAE,IAAAA,SAAS,CAAEF,MAAM,CAACK,IAAT,CAAT,GAA2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F,CAHV;AAIA,UAAM2E,YAAY,GAAGF,oBAAoB,CAAET,QAAF,CAAzC;AACA,WAAOU,qCAAqC,CAC3CH,SAD2C,EAE3CI,YAF2C,CAA5C;AAIA,GAduC,EAexC,CAAEX,QAAF,EAAYM,mBAAZ,CAfwC,CAAzC;AAiBA,SAAOE,uBAAuB,SAAvB,IAAAA,uBAAuB,WAAvB,IAAAA,uBAAuB,CAAEzC,MAAzB,GAAkCwC,SAAlC,GAA8CrB,aAArD;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\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/**\n * Internal dependencies\n */\nimport { name as queryLoopName } from './block.json';\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 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( get( 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\tqueryLoopName,\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\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.name,\n\n\t\t[ attributes ]\n\t);\n\tconst blockName = `${ queryLoopName }/${ activeVariationName }`;\n\tconst activeVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\t__experimentalGetPatternsByBlockTypes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn __experimentalGetPatternsByBlockTypes(\n\t\t\t\tblockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t},\n\t\t[ clientId, activeVariationName ]\n\t);\n\treturn activeVariationPatterns?.length ? blockName : queryLoopName;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["__","quote","icon","initBlock","deprecated","edit","save","transforms","name","metadata","settings","example","attributes","citation","innerBlocks","content","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,IAAlB,QAA8B,kBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["__","quote","icon","initBlock","deprecated","edit","save","transforms","name","metadata","settings","example","attributes","citation","innerBlocks","content","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,IAAlB,QAA8B,kBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBR,EAAAA,IADuB;AAEvBS,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,QAAQ,EAAE;AADC,KADJ;AAIRC,IAAAA,WAAW,EAAE,CACZ;AACCN,MAAAA,IAAI,EAAE,gBADP;AAECI,MAAAA,UAAU,EAAE;AACXG,QAAAA,OAAO,EAAEf,EAAE,CAAE,uCAAF;AADA;AAFb,KADY;AAJL,GAFc;AAevBO,EAAAA,UAfuB;AAgBvBF,EAAAA,IAhBuB;AAiBvBC,EAAAA,IAjBuB;AAkBvBF,EAAAA;AAlBuB,CAAjB;AAqBP,OAAO,MAAMY,IAAI,GAAG,MAAMb,SAAS,CAAE;AAAEK,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcitation: 'Julio Cortázar',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( 'In quoting others, we cite ourselves.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -81,14 +81,14 @@ export const init = () => {
|
|
|
81
81
|
addFilter('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
|
|
82
82
|
|
|
83
83
|
const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content'];
|
|
84
|
-
addFilter('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (
|
|
84
|
+
addFilter('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (canInsert, blockType, rootClientId, _ref2) => {
|
|
85
85
|
let {
|
|
86
86
|
getBlock,
|
|
87
87
|
getBlockParentsByBlockName
|
|
88
88
|
} = _ref2;
|
|
89
89
|
|
|
90
90
|
if (blockType.name !== 'core/template-part') {
|
|
91
|
-
return
|
|
91
|
+
return canInsert;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
for (const disallowedParentType of DISALLOWED_PARENTS) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/template-part/index.js"],"names":["capitalCase","store","coreDataStore","select","symbolFilled","addFilter","decodeEntities","initBlock","edit","enhanceTemplatePartVariations","name","metadata","settings","icon","__experimentalLabel","slug","theme","entity","getEntityRecord","title","rendered","init","DISALLOWED_PARENTS","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/template-part/index.js"],"names":["capitalCase","store","coreDataStore","select","symbolFilled","addFilter","decodeEntities","initBlock","edit","enhanceTemplatePartVariations","name","metadata","settings","icon","__experimentalLabel","slug","theme","entity","getEntityRecord","title","rendered","init","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,aAA5B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,MAAT,QAAuB,iBAAvB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,SA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BAAnC,IACAD,0BAA0B,CACzBF,YADyB,EAEzBG,oBAFyB,CAA1B,CAGEE,MALH;;AAMA,UAAKD,mBAAL,EAA2B;AAC1B,eAAO,KAAP;AACA;AACD;;AACD,WAAO,IAAP;AACA,GAzBO,CAAT;AA4BA,SAAOtB,SAAS,CAAE;AAAEG,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAF,CAAhB;AACA,CAtCM","sourcesContent":["/**\n * External dependencies\n */\nimport { capitalCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { symbolFilled } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport { enhanceTemplatePartVariations } from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: symbolFilled,\n\t__experimentalLabel: ( { slug, theme } ) => {\n\t\t// Attempt to find entity title if block is a template part.\n\t\t// Require slug to request, otherwise entity is uncreated and will throw 404.\n\t\tif ( ! slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttheme + '//' + slug\n\t\t);\n\t\tif ( ! entity ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tdecodeEntities( entity.title?.rendered ) ||\n\t\t\tcapitalCase( entity.slug )\n\t\t);\n\t},\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceTemplatePartVariations\n\t);\n\n\t// Prevent adding template parts inside post templates.\n\tconst DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromPostTemplates',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/template-part' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
|
|
@@ -2719,19 +2719,19 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2719
2719
|
-webkit-backdrop-filter: none;
|
|
2720
2720
|
backdrop-filter: none;
|
|
2721
2721
|
}
|
|
2722
|
-
.wp-block-post-featured-image
|
|
2723
|
-
.wp-block-post-featured-image
|
|
2722
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
|
|
2723
|
+
.wp-block-post-featured-image .components-placeholder {
|
|
2724
2724
|
justify-content: center;
|
|
2725
2725
|
align-items: center;
|
|
2726
2726
|
padding: 0;
|
|
2727
2727
|
min-height: 200px;
|
|
2728
2728
|
}
|
|
2729
|
-
.wp-block-post-featured-image
|
|
2730
|
-
.wp-block-post-featured-image
|
|
2729
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
|
|
2730
|
+
.wp-block-post-featured-image .components-placeholder .components-form-file-upload {
|
|
2731
2731
|
display: none;
|
|
2732
2732
|
}
|
|
2733
|
-
.wp-block-post-featured-image
|
|
2734
|
-
.wp-block-post-featured-image
|
|
2733
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button,
|
|
2734
|
+
.wp-block-post-featured-image .components-placeholder .components-button {
|
|
2735
2735
|
padding: 0;
|
|
2736
2736
|
display: flex;
|
|
2737
2737
|
justify-content: center;
|
|
@@ -2745,51 +2745,61 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2745
2745
|
border-style: solid;
|
|
2746
2746
|
color: #fff;
|
|
2747
2747
|
}
|
|
2748
|
-
.wp-block-post-featured-image
|
|
2749
|
-
.wp-block-post-featured-image
|
|
2748
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button > svg,
|
|
2749
|
+
.wp-block-post-featured-image .components-placeholder .components-button > svg {
|
|
2750
2750
|
color: inherit;
|
|
2751
2751
|
}
|
|
2752
|
-
.wp-block-post-featured-image
|
|
2753
|
-
.wp-block-post-featured-image
|
|
2752
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
|
|
2753
|
+
.wp-block-post-featured-image .components-placeholder:where(.has-border-color),
|
|
2754
|
+
.wp-block-post-featured-image img:where(.has-border-color) {
|
|
2754
2755
|
border-style: solid;
|
|
2755
2756
|
}
|
|
2756
|
-
.wp-block-post-featured-image
|
|
2757
|
-
.wp-block-post-featured-image
|
|
2757
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
|
|
2758
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]),
|
|
2759
|
+
.wp-block-post-featured-image img:where([style*="border-top-color"]) {
|
|
2758
2760
|
border-top-style: solid;
|
|
2759
2761
|
}
|
|
2760
|
-
.wp-block-post-featured-image
|
|
2761
|
-
.wp-block-post-featured-image
|
|
2762
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
|
|
2763
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]),
|
|
2764
|
+
.wp-block-post-featured-image img:where([style*="border-right-color"]) {
|
|
2762
2765
|
border-left-style: solid;
|
|
2763
2766
|
}
|
|
2764
|
-
.wp-block-post-featured-image
|
|
2765
|
-
.wp-block-post-featured-image
|
|
2767
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
|
|
2768
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]),
|
|
2769
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-color"]) {
|
|
2766
2770
|
border-bottom-style: solid;
|
|
2767
2771
|
}
|
|
2768
|
-
.wp-block-post-featured-image
|
|
2769
|
-
.wp-block-post-featured-image
|
|
2772
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
|
|
2773
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]),
|
|
2774
|
+
.wp-block-post-featured-image img:where([style*="border-left-color"]) {
|
|
2770
2775
|
border-right-style: solid;
|
|
2771
2776
|
}
|
|
2772
|
-
.wp-block-post-featured-image
|
|
2773
|
-
.wp-block-post-featured-image
|
|
2777
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
|
|
2778
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-width"]),
|
|
2779
|
+
.wp-block-post-featured-image img:where([style*="border-width"]) {
|
|
2774
2780
|
border-style: solid;
|
|
2775
2781
|
}
|
|
2776
|
-
.wp-block-post-featured-image
|
|
2777
|
-
.wp-block-post-featured-image
|
|
2782
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
|
|
2783
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]),
|
|
2784
|
+
.wp-block-post-featured-image img:where([style*="border-top-width"]) {
|
|
2778
2785
|
border-top-style: solid;
|
|
2779
2786
|
}
|
|
2780
|
-
.wp-block-post-featured-image
|
|
2781
|
-
.wp-block-post-featured-image
|
|
2787
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
|
|
2788
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]),
|
|
2789
|
+
.wp-block-post-featured-image img:where([style*="border-right-width"]) {
|
|
2782
2790
|
border-left-style: solid;
|
|
2783
2791
|
}
|
|
2784
|
-
.wp-block-post-featured-image
|
|
2785
|
-
.wp-block-post-featured-image
|
|
2792
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
|
|
2793
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]),
|
|
2794
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-width"]) {
|
|
2786
2795
|
border-bottom-style: solid;
|
|
2787
2796
|
}
|
|
2788
|
-
.wp-block-post-featured-image
|
|
2789
|
-
.wp-block-post-featured-image
|
|
2797
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
|
|
2798
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]),
|
|
2799
|
+
.wp-block-post-featured-image img:where([style*="border-left-width"]) {
|
|
2790
2800
|
border-right-style: solid;
|
|
2791
2801
|
}
|
|
2792
|
-
.wp-block-post-featured-image
|
|
2802
|
+
.wp-block-post-featured-image[style*=height] .components-placeholder {
|
|
2793
2803
|
min-height: 48px;
|
|
2794
2804
|
min-width: 48px;
|
|
2795
2805
|
height: 100%;
|
package/build-style/editor.css
CHANGED
|
@@ -2730,19 +2730,19 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2730
2730
|
-webkit-backdrop-filter: none;
|
|
2731
2731
|
backdrop-filter: none;
|
|
2732
2732
|
}
|
|
2733
|
-
.wp-block-post-featured-image
|
|
2734
|
-
.wp-block-post-featured-image
|
|
2733
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
|
|
2734
|
+
.wp-block-post-featured-image .components-placeholder {
|
|
2735
2735
|
justify-content: center;
|
|
2736
2736
|
align-items: center;
|
|
2737
2737
|
padding: 0;
|
|
2738
2738
|
min-height: 200px;
|
|
2739
2739
|
}
|
|
2740
|
-
.wp-block-post-featured-image
|
|
2741
|
-
.wp-block-post-featured-image
|
|
2740
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
|
|
2741
|
+
.wp-block-post-featured-image .components-placeholder .components-form-file-upload {
|
|
2742
2742
|
display: none;
|
|
2743
2743
|
}
|
|
2744
|
-
.wp-block-post-featured-image
|
|
2745
|
-
.wp-block-post-featured-image
|
|
2744
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button,
|
|
2745
|
+
.wp-block-post-featured-image .components-placeholder .components-button {
|
|
2746
2746
|
padding: 0;
|
|
2747
2747
|
display: flex;
|
|
2748
2748
|
justify-content: center;
|
|
@@ -2756,51 +2756,61 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2756
2756
|
border-style: solid;
|
|
2757
2757
|
color: #fff;
|
|
2758
2758
|
}
|
|
2759
|
-
.wp-block-post-featured-image
|
|
2760
|
-
.wp-block-post-featured-image
|
|
2759
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button > svg,
|
|
2760
|
+
.wp-block-post-featured-image .components-placeholder .components-button > svg {
|
|
2761
2761
|
color: inherit;
|
|
2762
2762
|
}
|
|
2763
|
-
.wp-block-post-featured-image
|
|
2764
|
-
.wp-block-post-featured-image
|
|
2763
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
|
|
2764
|
+
.wp-block-post-featured-image .components-placeholder:where(.has-border-color),
|
|
2765
|
+
.wp-block-post-featured-image img:where(.has-border-color) {
|
|
2765
2766
|
border-style: solid;
|
|
2766
2767
|
}
|
|
2767
|
-
.wp-block-post-featured-image
|
|
2768
|
-
.wp-block-post-featured-image
|
|
2768
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
|
|
2769
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]),
|
|
2770
|
+
.wp-block-post-featured-image img:where([style*="border-top-color"]) {
|
|
2769
2771
|
border-top-style: solid;
|
|
2770
2772
|
}
|
|
2771
|
-
.wp-block-post-featured-image
|
|
2772
|
-
.wp-block-post-featured-image
|
|
2773
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
|
|
2774
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]),
|
|
2775
|
+
.wp-block-post-featured-image img:where([style*="border-right-color"]) {
|
|
2773
2776
|
border-right-style: solid;
|
|
2774
2777
|
}
|
|
2775
|
-
.wp-block-post-featured-image
|
|
2776
|
-
.wp-block-post-featured-image
|
|
2778
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
|
|
2779
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]),
|
|
2780
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-color"]) {
|
|
2777
2781
|
border-bottom-style: solid;
|
|
2778
2782
|
}
|
|
2779
|
-
.wp-block-post-featured-image
|
|
2780
|
-
.wp-block-post-featured-image
|
|
2783
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
|
|
2784
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]),
|
|
2785
|
+
.wp-block-post-featured-image img:where([style*="border-left-color"]) {
|
|
2781
2786
|
border-left-style: solid;
|
|
2782
2787
|
}
|
|
2783
|
-
.wp-block-post-featured-image
|
|
2784
|
-
.wp-block-post-featured-image
|
|
2788
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
|
|
2789
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-width"]),
|
|
2790
|
+
.wp-block-post-featured-image img:where([style*="border-width"]) {
|
|
2785
2791
|
border-style: solid;
|
|
2786
2792
|
}
|
|
2787
|
-
.wp-block-post-featured-image
|
|
2788
|
-
.wp-block-post-featured-image
|
|
2793
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
|
|
2794
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]),
|
|
2795
|
+
.wp-block-post-featured-image img:where([style*="border-top-width"]) {
|
|
2789
2796
|
border-top-style: solid;
|
|
2790
2797
|
}
|
|
2791
|
-
.wp-block-post-featured-image
|
|
2792
|
-
.wp-block-post-featured-image
|
|
2798
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
|
|
2799
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]),
|
|
2800
|
+
.wp-block-post-featured-image img:where([style*="border-right-width"]) {
|
|
2793
2801
|
border-right-style: solid;
|
|
2794
2802
|
}
|
|
2795
|
-
.wp-block-post-featured-image
|
|
2796
|
-
.wp-block-post-featured-image
|
|
2803
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
|
|
2804
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]),
|
|
2805
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-width"]) {
|
|
2797
2806
|
border-bottom-style: solid;
|
|
2798
2807
|
}
|
|
2799
|
-
.wp-block-post-featured-image
|
|
2800
|
-
.wp-block-post-featured-image
|
|
2808
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
|
|
2809
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]),
|
|
2810
|
+
.wp-block-post-featured-image img:where([style*="border-left-width"]) {
|
|
2801
2811
|
border-left-style: solid;
|
|
2802
2812
|
}
|
|
2803
|
-
.wp-block-post-featured-image
|
|
2813
|
+
.wp-block-post-featured-image[style*=height] .components-placeholder {
|
|
2804
2814
|
min-height: 48px;
|
|
2805
2815
|
min-width: 48px;
|
|
2806
2816
|
height: 100%;
|
|
@@ -79,19 +79,19 @@
|
|
|
79
79
|
-webkit-backdrop-filter: none;
|
|
80
80
|
backdrop-filter: none;
|
|
81
81
|
}
|
|
82
|
-
.wp-block-post-featured-image
|
|
83
|
-
.wp-block-post-featured-image
|
|
82
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
|
|
83
|
+
.wp-block-post-featured-image .components-placeholder {
|
|
84
84
|
justify-content: center;
|
|
85
85
|
align-items: center;
|
|
86
86
|
padding: 0;
|
|
87
87
|
min-height: 200px;
|
|
88
88
|
}
|
|
89
|
-
.wp-block-post-featured-image
|
|
90
|
-
.wp-block-post-featured-image
|
|
89
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
|
|
90
|
+
.wp-block-post-featured-image .components-placeholder .components-form-file-upload {
|
|
91
91
|
display: none;
|
|
92
92
|
}
|
|
93
|
-
.wp-block-post-featured-image
|
|
94
|
-
.wp-block-post-featured-image
|
|
93
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button,
|
|
94
|
+
.wp-block-post-featured-image .components-placeholder .components-button {
|
|
95
95
|
padding: 0;
|
|
96
96
|
display: flex;
|
|
97
97
|
justify-content: center;
|
|
@@ -105,51 +105,61 @@
|
|
|
105
105
|
border-style: solid;
|
|
106
106
|
color: #fff;
|
|
107
107
|
}
|
|
108
|
-
.wp-block-post-featured-image
|
|
109
|
-
.wp-block-post-featured-image
|
|
108
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button > svg,
|
|
109
|
+
.wp-block-post-featured-image .components-placeholder .components-button > svg {
|
|
110
110
|
color: inherit;
|
|
111
111
|
}
|
|
112
|
-
.wp-block-post-featured-image
|
|
113
|
-
.wp-block-post-featured-image
|
|
112
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
|
|
113
|
+
.wp-block-post-featured-image .components-placeholder:where(.has-border-color),
|
|
114
|
+
.wp-block-post-featured-image img:where(.has-border-color) {
|
|
114
115
|
border-style: solid;
|
|
115
116
|
}
|
|
116
|
-
.wp-block-post-featured-image
|
|
117
|
-
.wp-block-post-featured-image
|
|
117
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
|
|
118
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]),
|
|
119
|
+
.wp-block-post-featured-image img:where([style*="border-top-color"]) {
|
|
118
120
|
border-top-style: solid;
|
|
119
121
|
}
|
|
120
|
-
.wp-block-post-featured-image
|
|
121
|
-
.wp-block-post-featured-image
|
|
122
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
|
|
123
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]),
|
|
124
|
+
.wp-block-post-featured-image img:where([style*="border-right-color"]) {
|
|
122
125
|
border-left-style: solid;
|
|
123
126
|
}
|
|
124
|
-
.wp-block-post-featured-image
|
|
125
|
-
.wp-block-post-featured-image
|
|
127
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
|
|
128
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]),
|
|
129
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-color"]) {
|
|
126
130
|
border-bottom-style: solid;
|
|
127
131
|
}
|
|
128
|
-
.wp-block-post-featured-image
|
|
129
|
-
.wp-block-post-featured-image
|
|
132
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
|
|
133
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]),
|
|
134
|
+
.wp-block-post-featured-image img:where([style*="border-left-color"]) {
|
|
130
135
|
border-right-style: solid;
|
|
131
136
|
}
|
|
132
|
-
.wp-block-post-featured-image
|
|
133
|
-
.wp-block-post-featured-image
|
|
137
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
|
|
138
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-width"]),
|
|
139
|
+
.wp-block-post-featured-image img:where([style*="border-width"]) {
|
|
134
140
|
border-style: solid;
|
|
135
141
|
}
|
|
136
|
-
.wp-block-post-featured-image
|
|
137
|
-
.wp-block-post-featured-image
|
|
142
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
|
|
143
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]),
|
|
144
|
+
.wp-block-post-featured-image img:where([style*="border-top-width"]) {
|
|
138
145
|
border-top-style: solid;
|
|
139
146
|
}
|
|
140
|
-
.wp-block-post-featured-image
|
|
141
|
-
.wp-block-post-featured-image
|
|
147
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
|
|
148
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]),
|
|
149
|
+
.wp-block-post-featured-image img:where([style*="border-right-width"]) {
|
|
142
150
|
border-left-style: solid;
|
|
143
151
|
}
|
|
144
|
-
.wp-block-post-featured-image
|
|
145
|
-
.wp-block-post-featured-image
|
|
152
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
|
|
153
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]),
|
|
154
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-width"]) {
|
|
146
155
|
border-bottom-style: solid;
|
|
147
156
|
}
|
|
148
|
-
.wp-block-post-featured-image
|
|
149
|
-
.wp-block-post-featured-image
|
|
157
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
|
|
158
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]),
|
|
159
|
+
.wp-block-post-featured-image img:where([style*="border-left-width"]) {
|
|
150
160
|
border-right-style: solid;
|
|
151
161
|
}
|
|
152
|
-
.wp-block-post-featured-image
|
|
162
|
+
.wp-block-post-featured-image[style*=height] .components-placeholder {
|
|
153
163
|
min-height: 48px;
|
|
154
164
|
min-width: 48px;
|
|
155
165
|
height: 100%;
|