@wordpress/block-editor
Version:
8 lines (7 loc) • 921 B
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/hooks/block-fields/use-inspector-popover-placement.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\n\nexport function useInspectorPopoverPlacement(\n\t{ isControl } = { isControl: false }\n) {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: isControl ? 35 : 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n}\n"],
"mappings": ";AAGA,SAAS,wBAAwB;AAE1B,SAAS,6BACf,EAAE,UAAU,IAAI,EAAE,WAAW,MAAM,GAClC;AACD,QAAM,WAAW,iBAAkB,UAAU,GAAI;AACjD,SAAO,CAAE,WACN;AAAA,IACA,cAAc;AAAA,MACb,WAAW;AAAA;AAAA,MAEX,QAAQ,YAAY,KAAK;AAAA,IAC1B;AAAA,EACA,IACA,CAAC;AACL;",
"names": []
}