@wordpress/block-editor
Version:
8 lines (7 loc) • 1.87 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/components/block-switcher/preview-block-popover.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\n\nexport default function PreviewBlockPopover( { blocks } ) {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\n\tif ( isMobile ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__popover-preview-container\">\n\t\t\t<Popover\n\t\t\t\tclassName=\"block-editor-block-switcher__popover-preview\"\n\t\t\t\tplacement=\"right-start\"\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\toffset={ 16 }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-block-switcher__preview\">\n\t\t\t\t\t<div className=\"block-editor-block-switcher__preview-title\">\n\t\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ /* 600px is the value of $break-small in base-styles/_breakpoints.scss.\n\t\t\t\t\t\tWe set the viewport width to 601px to make sure that the media-text \n\t\t\t\t\t\tblock which uses this breakpoint has the correct padding. */ }\n\t\t\t\t\t<BlockPreview viewportWidth={ 601 } blocks={ blocks } />\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t</div>\n\t);\n}\n"],
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB,SAAS,wBAAwB;AAKjC,OAAO,kBAAkB;AAiBrB,SACC,KADD;AAfW,SAAR,oBAAsC,EAAE,OAAO,GAAI;AACzD,QAAM,WAAW,iBAAkB,UAAU,GAAI;AAEjD,MAAK,UAAW;AACf,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,SAAI,WAAU,0DACd;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,WAAU;AAAA,MACV,cAAe;AAAA,MACf,QAAS;AAAA,MAET,+BAAC,SAAI,WAAU,wCACd;AAAA,4BAAC,SAAI,WAAU,8CACZ,aAAI,SAAU,GACjB;AAAA,QAIA,oBAAC,gBAAa,eAAgB,KAAM,QAAkB;AAAA,SACvD;AAAA;AAAA,EACD,GACD;AAEF;",
"names": []
}