UNPKG

@wordpress/block-library

Version:
1 lines • 16.6 kB
{"version":3,"file":"edit.cjs","names":["useSelect","coreStore","useState","useToolsPanelDropdownMenuProps","useServerSideRender","useRef","useDisabled","useBlockProps","WCSpinner","__","InspectorControls","ToolsPanel","ToolsPanelItem","ToggleControl","TextControl","WCCheckboxControl","HtmlRenderer","sprintf"],"sources":["../../src/breadcrumbs/edit.jsx"],"sourcesContent":["import { __, sprintf } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\tTextControl,\n\tCheckboxControl as WCCheckboxControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tSpinner as WCSpinner,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useServerSideRender } from '@wordpress/server-side-render';\nimport { useDisabled } from '@wordpress/compose';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport HtmlRenderer from '../utils/html-renderer';\n\nconst separatorDefaultValue = '/';\n\nexport default function BreadcrumbEdit( {\n\tattributes,\n\tsetAttributes,\n\tname,\n\tcontext: { postId, postType, templateSlug },\n} ) {\n\tconst {\n\t\tseparator,\n\t\tshowHomeItem,\n\t\tshowCurrentItem,\n\t\tprefersTaxonomy,\n\t\tshowOnHomePage,\n\t} = attributes;\n\tconst {\n\t\tpost,\n\t\tisPostTypeHierarchical,\n\t\tpostTypeHasTaxonomies,\n\t\thasTermsAssigned,\n\t\tisLoading,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postType ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst _post = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst postTypeObject = select( coreStore ).getPostType( postType );\n\t\t\tconst _postTypeHasTaxonomies =\n\t\t\t\tpostTypeObject && postTypeObject.taxonomies.length;\n\t\t\tlet taxonomies;\n\t\t\tif ( _postTypeHasTaxonomies ) {\n\t\t\t\ttaxonomies = select( coreStore ).getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tpost: _post,\n\t\t\t\tisPostTypeHierarchical: postTypeObject?.hierarchical,\n\t\t\t\tpostTypeHasTaxonomies: _postTypeHasTaxonomies,\n\t\t\t\thasTermsAssigned:\n\t\t\t\t\t_post &&\n\t\t\t\t\t( taxonomies || [] )\n\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t( { visibility } ) => visibility?.publicly_queryable\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.some( ( taxonomy ) => {\n\t\t\t\t\t\t\treturn !! _post[ taxonomy.rest_base ]?.length;\n\t\t\t\t\t\t} ),\n\t\t\t\tisLoading:\n\t\t\t\t\t( postId && ! _post ) ||\n\t\t\t\t\t! postTypeObject ||\n\t\t\t\t\t( _postTypeHasTaxonomies && ! taxonomies ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\t/**\n\t * Counter used to cache-bust `useServerSideRender`.\n\t *\n\t * This is a catch-all signal to re-render the block when a post's title,\n\t * parent ID, or terms change.\n\t *\n\t * This is fundamentally imperfect, because there are other entities which\n\t * could change in the meantime (the titles of ancestor posts, or the\n\t * labels of taxonomy terms), hence the choice to re-render systematically\n\t * upon saving.\n\t */\n\tconst [ invalidationKey, setInvalidationKey ] = useState( 0 );\n\tuseEffect( () => {\n\t\tsetInvalidationKey( ( c ) => c + 1 );\n\t}, [ post ] );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst { content, status, error } = useServerSideRender( {\n\t\tattributes,\n\t\tskipBlockSupportAttributes: true,\n\t\tblock: name,\n\t\turlQueryArgs: { post_id: postId, invalidationKey },\n\t} );\n\tconst prevContentRef = useRef( '' );\n\tuseEffect( () => {\n\t\tif ( status === 'success' ) {\n\t\t\tprevContentRef.current = content;\n\t\t}\n\t}, [ content, status ] );\n\tconst [ showLoader, setShowLoader ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( status !== 'loading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst timeout = setTimeout( () => {\n\t\t\tsetShowLoader( true );\n\t\t}, 400 );\n\t\treturn () => {\n\t\t\tclearTimeout( timeout );\n\t\t\tsetShowLoader( false );\n\t\t};\n\t}, [ status ] );\n\tconst disabledRef = useDisabled();\n\tconst blockProps = useBlockProps( { ref: disabledRef } );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<WCSpinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Try to determine breadcrumb type for more accurate previews.\n\tlet _showTerms;\n\t// Some non-hierarchical post types (e.g., attachments) can have parents.\n\t// Use hierarchical breadcrumbs if a parent exists, otherwise use taxonomy breadcrumbs.\n\tif ( ! isPostTypeHierarchical && ! post?.parent ) {\n\t\t_showTerms = true;\n\t} else if ( ! postTypeHasTaxonomies ) {\n\t\t// Hierarchical post type without taxonomies can only use ancestors.\n\t\t_showTerms = false;\n\t} else {\n\t\t// For hierarchical post types with taxonomies, use the attribute.\n\t\t_showTerms = prefersTaxonomy;\n\t}\n\tlet placeholder = null;\n\t// This is fragile because this block is server side rendered and we'll have to\n\t// update the placeholder html if the server side rendering output changes.\n\tconst showPlaceholder =\n\t\t! postId ||\n\t\t! postType ||\n\t\t// When `templateSlug` is set only show placeholder if the post type is not.\n\t\t// This is needed because when we are showing the template in post editor we\n\t\t// want to show the real breadcrumbs if we have the post type.\n\t\t( templateSlug && ! postType ) ||\n\t\t( ! _showTerms && ! isPostTypeHierarchical ) ||\n\t\t( _showTerms && ! hasTermsAssigned );\n\tif ( showPlaceholder ) {\n\t\tconst placeholderItems = [];\n\t\tif ( showHomeItem ) {\n\t\t\tplaceholderItems.push( __( 'Home' ) );\n\t\t}\n\t\tif ( templateSlug && ! postId ) {\n\t\t\tplaceholderItems.push( __( 'Page' ) );\n\t\t} else if ( _showTerms ) {\n\t\t\tplaceholderItems.push( __( 'Category' ) );\n\t\t} else {\n\t\t\tplaceholderItems.push( __( 'Ancestor' ), __( 'Parent' ) );\n\t\t}\n\t\tplaceholder = (\n\t\t\t<nav\n\t\t\t\t{ ...blockProps }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--separator': `\"${ separator\n\t\t\t\t\t\t.replace( /\\\\/g, '\\\\\\\\' )\n\t\t\t\t\t\t.replace( /\"/g, '\\\\\"' ) }\"`,\n\t\t\t\t\t...blockProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ol>\n\t\t\t\t\t{ placeholderItems.map( ( text, index ) => (\n\t\t\t\t\t\t<li key={ index }>\n\t\t\t\t\t\t\t<a href={ `#breadcrumbs-pseudo-link-${ index }` }>\n\t\t\t\t\t\t\t\t{ text }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) ) }\n\t\t\t\t\t{ showCurrentItem && (\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span aria-current=\"page\">{ __( 'Current' ) }</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) }\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t);\n\t}\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\tseparator: separatorDefaultValue,\n\t\t\t\t\t\t\tshowHomeItem: true,\n\t\t\t\t\t\t\tshowCurrentItem: true,\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<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show home breadcrumb' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showHomeItem }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowHomeItem: true,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show home breadcrumb' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { showHomeItem: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showHomeItem }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show current breadcrumb' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showCurrentItem }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowCurrentItem: true,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show current breadcrumb' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { showCurrentItem: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showCurrentItem }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Separator' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => separator !== separatorDefaultValue }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tseparator: separatorDefaultValue,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tlabel={ __( 'Separator' ) }\n\t\t\t\t\t\t\tvalue={ separator }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { separator: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\t\t\tif ( ! separator ) {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tseparator: separatorDefaultValue,\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</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<WCCheckboxControl\n\t\t\t\t\tlabel={ __( 'Show on homepage' ) }\n\t\t\t\t\tchecked={ showOnHomePage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showOnHomePage: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'If this Breadcrumbs block appears in a template or template part that’s shown on the homepage, enable this option to display the breadcrumb trail. Otherwise, this setting has no effect.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<WCCheckboxControl\n\t\t\t\t\tlabel={ __( 'Prefer taxonomy terms' ) }\n\t\t\t\t\tchecked={ prefersTaxonomy }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { prefersTaxonomy: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'The exact type of breadcrumbs shown will vary automatically depending on the page in which this block is displayed. In the specific case of a hierarchical post type with taxonomies, the breadcrumbs can either reflect its post hierarchy (default) or the hierarchy of its assigned taxonomy terms.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ status === 'loading' &&\n\t\t\t\t! showPlaceholder &&\n\t\t\t\t( prevContentRef.current ? (\n\t\t\t\t\t<HtmlRenderer\n\t\t\t\t\t\twrapperProps={ {\n\t\t\t\t\t\t\t...blockProps,\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\t\t\topacity: showLoader ? 0.3 : 1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thtml={ prevContentRef.current }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t\t<WCSpinner />\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t{ status === 'error' && (\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: error message returned when rendering the block. */\n\t\t\t\t\t\t\t__( 'Error: %s' ),\n\t\t\t\t\t\t\terror\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ showPlaceholder && placeholder }\n\t\t\t{ ! showPlaceholder && status === 'success' && (\n\t\t\t\t<HtmlRenderer wrapperProps={ blockProps } html={ content } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,wBAAwB;AAE9B,SAAwB,eAAgB,EACvC,YACA,eACA,MACA,SAAS,EAAE,QAAQ,UAAU,kBAC1B;CACH,MAAM,EACL,WACA,cACA,iBACA,iBACA,mBACG;CACJ,MAAM,EACL,MACA,wBACA,uBACA,kBACA,eAAA,GACGA,gBAAAA,UAAAA,EACD,WAAY;EACb,IAAK,CAAE,UACN,OAAO,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