UNPKG

@wordpress/block-library

Version:
8 lines (7 loc) 31.6 kB
{ "version": 3, "sources": ["../../src/site-logo/edit.js"], "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tcreateInterpolateElement,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tRangeControl,\n\tResizableBox,\n\tSpinner,\n\tToggleControl,\n\tToolbarButton,\n\tPlaceholder,\n\tButton,\n\tDropZone,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalImageEditor as ImageEditor,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { crop, upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { MIN_SIZE } from '../image/constants';\nimport { MediaControl, MediaControlPreview } from '../utils/media-control';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst SiteLogo = ( {\n\talt,\n\tattributes: { align, width, height, isLink, linkTarget, shouldSyncIcon },\n\tisSelected,\n\tsetAttributes,\n\tsetLogo,\n\tlogoUrl,\n\tsiteUrl,\n\tlogoId,\n\ticonId,\n\tsetIcon,\n\tcanUserEdit,\n} ) => {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst isResizable = ! isWideAligned && isLargeViewport;\n\tconst [ { naturalWidth, naturalHeight }, setNaturalSize ] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst { toggleSelection } = useDispatch( blockEditorStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Check if we're in contentOnly mode\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\n\tconst { imageEditing, maxWidth, title } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\tconst siteEntities = select( coreStore ).getEntityRecord(\n\t\t\t'root',\n\t\t\t'__unstableBase'\n\t\t);\n\t\treturn {\n\t\t\ttitle: siteEntities?.name,\n\t\t\timageEditing: settings.imageEditing,\n\t\t\tmaxWidth: settings.maxWidth,\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t// Turn the `Use as site icon` toggle off if it is on but the logo and icon have\n\t\t// fallen out of sync. This can happen if the toggle is saved in the `on` position,\n\t\t// but changes are later made to the site icon in the Customizer.\n\t\tif ( shouldSyncIcon && logoId !== iconId ) {\n\t\t\tsetAttributes( { shouldSyncIcon: false } );\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tconst img = (\n\t\t<>\n\t\t\t<img\n\t\t\t\tclassName=\"custom-logo\"\n\t\t\t\tsrc={ logoUrl }\n\t\t\t\talt={ alt }\n\t\t\t\tonLoad={ ( event ) => {\n\t\t\t\t\tsetNaturalSize( {\n\t\t\t\t\t\tnaturalWidth: event.target.naturalWidth,\n\t\t\t\t\t\tnaturalHeight: event.target.naturalHeight,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ isBlobURL( logoUrl ) && <Spinner /> }\n\t\t</>\n\t);\n\n\tlet imgWrapper = img;\n\tif ( isLink ) {\n\t\timgWrapper = (\n\t\t\t<a\n\t\t\t\thref={ siteUrl }\n\t\t\t\tclassName=\"custom-logo-link\"\n\t\t\t\trel=\"home\"\n\t\t\t\ttitle={ title }\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ img }\n\t\t\t</a>\n\t\t);\n\t}\n\n\tif ( ! isResizable || ! naturalWidth || ! naturalHeight ) {\n\t\treturn <div style={ { width, height } }>{ imgWrapper }</div>;\n\t}\n\n\t// Set the default width to a responsible size.\n\t// Note that this width is also set in the attached frontend CSS file.\n\tconst defaultWidth = 120;\n\n\tconst currentWidth = width || defaultWidth;\n\tconst ratio = naturalWidth / naturalHeight;\n\tconst currentHeight = currentWidth / ratio;\n\tconst minWidth =\n\t\tnaturalWidth < naturalHeight ? MIN_SIZE : Math.ceil( MIN_SIZE * ratio );\n\tconst minHeight =\n\t\tnaturalHeight < naturalWidth ? MIN_SIZE : Math.ceil( MIN_SIZE / ratio );\n\n\t// With the current implementation of ResizableBox, an image needs an\n\t// explicit pixel value for the max-width. In absence of being able to\n\t// set the content-width, this max-width is currently dictated by the\n\t// vanilla editor style. The following variable adds a buffer to this\n\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t// in most cases, allow you to scale the image beyond the width of the\n\t// main column, though not infinitely.\n\t// @todo It would be good to revisit this once a content-width variable\n\t// becomes available.\n\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\tlet showRightHandle = false;\n\tlet showLeftHandle = false;\n\n\t/* eslint-disable no-lonely-if */\n\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\tif ( align === 'center' ) {\n\t\t// When the image is centered, show both handles.\n\t\tshowRightHandle = true;\n\t\tshowLeftHandle = true;\n\t} else if ( isRTL() ) {\n\t\t// In RTL mode the image is on the right by default.\n\t\t// Show the right handle and hide the left handle only when it is\n\t\t// aligned left. Otherwise always show the left handle.\n\t\tif ( align === 'left' ) {\n\t\t\tshowRightHandle = true;\n\t\t} else {\n\t\t\tshowLeftHandle = true;\n\t\t}\n\t} else {\n\t\t// Show the left handle and hide the right handle only when the\n\t\t// image is aligned right. Otherwise always show the right handle.\n\t\tif ( align === 'right' ) {\n\t\t\tshowLeftHandle = true;\n\t\t} else {\n\t\t\tshowRightHandle = true;\n\t\t}\n\t}\n\t/* eslint-enable no-lonely-if */\n\n\tconst canEditImage =\n\t\tlogoId && naturalWidth && naturalHeight && imageEditing;\n\n\t// Hide crop and dimensions editing in write mode\n\tconst shouldShowCropAndDimensions = ! isContentOnlyMode;\n\n\tlet imgEdit;\n\tif ( canEditImage && isEditingImage ) {\n\t\timgEdit = (\n\t\t\t<ImageEditor\n\t\t\t\tid={ logoId }\n\t\t\t\turl={ logoUrl }\n\t\t\t\twidth={ currentWidth }\n\t\t\t\theight={ currentHeight }\n\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\tonSaveImage={ ( imageAttributes ) => {\n\t\t\t\t\tsetLogo( imageAttributes.id );\n\t\t\t\t} }\n\t\t\t\tonFinishEditing={ () => {\n\t\t\t\t\tsetIsEditingImage( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\t// Always render ResizableBox but disable resize functionality in contentOnly mode\n\t\timgEdit = (\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\theight: currentHeight,\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected && shouldShowCropAndDimensions }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ imgWrapper }\n\t\t\t</ResizableBox>\n\t\t);\n\t}\n\n\t// Support the previous location for the Site Icon settings. To be removed\n\t// when the required WP core version for Gutenberg is >= 6.5.0.\n\tconst shouldUseNewUrl = ! window?.__experimentalUseCustomizerSiteLogoUrl;\n\n\tconst siteIconSettingsUrl = shouldUseNewUrl\n\t\t? siteUrl + '/wp-admin/options-general.php'\n\t\t: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline';\n\n\tconst syncSiteIconHelpText = createInterpolateElement(\n\t\t__(\n\t\t\t'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'\n\t\t),\n\t\t{\n\t\t\ta: (\n\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t<a\n\t\t\t\t\thref={ siteIconSettingsUrl }\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t/>\n\t\t\t),\n\t\t}\n\t);\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\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! width }\n\t\t\t\t\t\tlabel={ __( 'Image width' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { width: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Image width' ) }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { width: newWidth } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ minWidth }\n\t\t\t\t\t\t\tmax={ maxWidthBuffer }\n\t\t\t\t\t\t\tinitialPosition={ Math.min(\n\t\t\t\t\t\t\t\tdefaultWidth,\n\t\t\t\t\t\t\t\tmaxWidthBuffer\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ width || '' }\n\t\t\t\t\t\t\tdisabled={ ! isResizable }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! isLink }\n\t\t\t\t\t\tlabel={ __( 'Link image to home' ) }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: true } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Link image to home' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => linkTarget === '_blank' }\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ canUserEdit && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! shouldSyncIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Use as Site Icon' ) }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { shouldSyncIcon: false } );\n\t\t\t\t\t\t\t\tsetIcon( undefined );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Use as Site Icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { shouldSyncIcon: value } );\n\t\t\t\t\t\t\t\t\tsetIcon( value ? logoId : undefined );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tchecked={ !! shouldSyncIcon }\n\t\t\t\t\t\t\t\thelp={ syncSiteIconHelpText }\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</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ canEditImage &&\n\t\t\t\t! isEditingImage &&\n\t\t\t\tshouldShowCropAndDimensions && (\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ () => setIsEditingImage( true ) }\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t{ imgEdit }\n\t\t</>\n\t);\n};\n\nexport default function LogoEdit( {\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tisSelected,\n} ) {\n\tconst { width, shouldSyncIcon } = attributes;\n\tconst {\n\t\tsiteLogoId,\n\t\tcanUserEdit,\n\t\turl,\n\t\tsiteIconId,\n\t\tmediaItemData,\n\t\tisRequestingMediaItem,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst _canUserEdit = canUser( 'update', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} );\n\t\tconst siteSettings = _canUserEdit\n\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase' );\n\t\tconst _siteLogoId = _canUserEdit\n\t\t\t? siteSettings?.site_logo\n\t\t\t: siteData?.site_logo;\n\t\tconst _siteIconId = siteSettings?.site_icon;\n\t\tconst mediaItem =\n\t\t\t_siteLogoId &&\n\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'attachment',\n\t\t\t\t_siteLogoId,\n\t\t\t\t{\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t}\n\t\t\t);\n\t\tconst _isRequestingMediaItem =\n\t\t\t!! _siteLogoId &&\n\t\t\t! select( coreStore ).hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\t'attachment',\n\t\t\t\t_siteLogoId,\n\t\t\t\t{ context: 'view' },\n\t\t\t] );\n\n\t\treturn {\n\t\t\tsiteLogoId: _siteLogoId,\n\t\t\tcanUserEdit: _canUserEdit,\n\t\t\turl: siteData?.home,\n\t\t\tmediaItemData: mediaItem,\n\t\t\tisRequestingMediaItem: _isRequestingMediaItem,\n\t\t\tsiteIconId: _siteIconId,\n\t\t};\n\t}, [] );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst [ temporaryURL, setTemporaryURL ] = useState();\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst setLogo = ( newValue, shouldForceSync = false ) => {\n\t\t// `shouldForceSync` is used to force syncing when the attribute\n\t\t// may not have updated yet.\n\t\tif ( shouldSyncIcon || shouldForceSync ) {\n\t\t\tsetIcon( newValue );\n\t\t}\n\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tsite_logo: newValue,\n\t\t} );\n\t};\n\n\tconst setIcon = ( newValue ) =>\n\t\t// The new value needs to be `null` to reset the Site Icon.\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tsite_icon: newValue ?? null,\n\t\t} );\n\n\tconst { alt_text: alt, source_url: logoUrl } = mediaItemData ?? {};\n\n\tconst onInitialSelectLogo = ( media ) => {\n\t\t// Initialize the syncSiteIcon toggle. If we currently have no Site logo and no\n\t\t// site icon, automatically sync the logo to the icon.\n\t\tif ( shouldSyncIcon === undefined ) {\n\t\t\tconst shouldForceSync = ! siteIconId;\n\t\t\tsetAttributes( { shouldSyncIcon: shouldForceSync } );\n\n\t\t\t// Because we cannot rely on the `shouldSyncIcon` attribute to have updated by\n\t\t\t// the time `setLogo` is called, pass an argument to force the syncing.\n\t\t\tonSelectLogo( media, shouldForceSync );\n\t\t\treturn;\n\t\t}\n\n\t\tonSelectLogo( media );\n\t};\n\n\tconst onSelectLogo = ( media, shouldForceSync = false ) => {\n\t\tif ( ! media ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! media.id && media.url ) {\n\t\t\t// This is a temporary blob image.\n\t\t\tsetTemporaryURL( media.url );\n\t\t\tsetLogo( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tsetLogo( media.id, shouldForceSync );\n\t};\n\n\tconst onRemoveLogo = () => {\n\t\tsetLogo( null );\n\t\tsetAttributes( { width: undefined } );\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetTemporaryURL();\n\t};\n\n\tconst onFilesDrop = ( filesList ) => {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetTemporaryURL( image.url );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonInitialSelectLogo( image );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t\tmultiple: false,\n\t\t} );\n\t};\n\n\tconst mediaReplaceFlowProps = {\n\t\tmediaURL: logoUrl,\n\t\tname: ! logoUrl ? __( 'Choose logo' ) : __( 'Replace' ),\n\t\tonSelect: onSelectLogo,\n\t\tonError: onUploadError,\n\t\tonReset: onRemoveLogo,\n\t};\n\tconst controls = canUserEdit && (\n\t\t<BlockControls group=\"other\">\n\t\t\t<MediaReplaceFlow\n\t\t\t\t{ ...mediaReplaceFlowProps }\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tvariant=\"toolbar\"\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\tlet logoImage;\n\tconst isLoading = siteLogoId === undefined || isRequestingMediaItem;\n\tif ( isLoading ) {\n\t\tlogoImage = <Spinner />;\n\t}\n\n\t// Reset temporary url when logoUrl is available.\n\tuseEffect( () => {\n\t\tif ( logoUrl && temporaryURL ) {\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}, [ logoUrl, temporaryURL ] );\n\n\tif ( !! logoUrl || !! temporaryURL ) {\n\t\tlogoImage = (\n\t\t\t<>\n\t\t\t\t<SiteLogo\n\t\t\t\t\talt={ alt }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tlogoUrl={ temporaryURL || logoUrl }\n\t\t\t\t\tsetLogo={ setLogo }\n\t\t\t\t\tlogoId={ mediaItemData?.id || siteLogoId }\n\t\t\t\t\tsiteUrl={ url }\n\t\t\t\t\tsetIcon={ setIcon }\n\t\t\t\t\ticonId={ siteIconId }\n\t\t\t\t\tcanUserEdit={ canUserEdit }\n\t\t\t\t/>\n\t\t\t\t{ canUserEdit && <DropZone onFilesDrop={ onFilesDrop } /> }\n\t\t\t</>\n\t\t);\n\t}\n\tconst placeholder = ( content ) => {\n\t\tconst placeholderClassName = clsx(\n\t\t\t'block-editor-media-placeholder',\n\t\t\tclassName\n\t\t);\n\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ placeholderClassName }\n\t\t\t\tpreview={ logoImage }\n\t\t\t\twithIllustration\n\t\t\t\tstyle={ {\n\t\t\t\t\twidth,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-default-size': ! width,\n\t\t'is-transient': temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( { className: classes } );\n\n\tconst mediaInspectorPanel = ( canUserEdit || logoUrl ) && (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t{ ! canUserEdit ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"block-library-site-logo__inspector-media-replace-container\"\n\t\t\t\t\t\tstyle={ { gridColumn: '1 / -1' } }\n\t\t\t\t\t>\n\t\t\t\t\t\t<MediaControlPreview\n\t\t\t\t\t\t\turl={ mediaItemData?.source_url }\n\t\t\t\t\t\t\talt={ mediaItemData?.alt_text }\n\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\tmediaItemData?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t?.file || mediaItemData?.slug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\titemGroupProps={ {\n\t\t\t\t\t\t\t\tisBordered: true,\n\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t'block-library-site-logo__inspector-readonly-logo-preview',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName=\"block-library-site-logo__inspector-media-replace-title\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! logoUrl }\n\t\t\t\t\t\tlabel={ __( 'Logo' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<MediaControl\n\t\t\t\t\t\t\tmediaId={ siteLogoId }\n\t\t\t\t\t\t\tmediaUrl={ logoUrl }\n\t\t\t\t\t\t\talt={ mediaItemData?.alt_text }\n\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\tmediaItemData?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t?.file || mediaItemData?.slug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\tonSelect={ onSelectLogo }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ onRemoveLogo }\n\t\t\t\t\t\t\tisUploading={ !! temporaryURL }\n\t\t\t\t\t\t\temptyLabel={ __( 'Choose logo' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\t\t\t{ mediaInspectorPanel }\n\t\t\t{ ( !! logoUrl || !! temporaryURL ) && logoImage }\n\t\t\t{ ( isLoading ||\n\t\t\t\t( ! temporaryURL && ! logoUrl && ! canUserEdit ) ) && (\n\t\t\t\t<Placeholder className=\"site-logo_placeholder\" withIllustration>\n\t\t\t\t\t{ isLoading && (\n\t\t\t\t\t\t<span className=\"components-placeholder__preview\">\n\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ ! isLoading && ! temporaryURL && ! logoUrl && canUserEdit && (\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\tonSelect={ onInitialSelectLogo }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Choose logo' ) }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topen();\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/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAA0B;AAC1B,qBAIO;AACP,kBAA0B;AAC1B,wBAWO;AACP,qBAAiC;AACjC,0BASO;AACP,kBAAuC;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