@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
8 lines (7 loc) • 1.78 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/components/page-attributes/panel.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PageAttributesCheck from './check';\nimport { ParentRow } from './parent';\n\nconst PANEL_NAME = 'page-attributes';\n\nfunction AttributesPanel() {\n\tconst { isEnabled, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isEditorPanelEnabled } =\n\t\t\tselect( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\treturn <ParentRow />;\n}\n\n/**\n * Renders the Page Attributes Panel component.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PageAttributesPanel() {\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<AttributesPanel />\n\t\t</PageAttributesCheck>\n\t);\n}\n"],
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAInC,SAAS,SAAS,mBAAmB;AACrC,OAAO,yBAAyB;AAChC,SAAS,iBAAiB;AAmBlB;AAjBR,IAAM,aAAa;AAEnB,SAAS,kBAAkB;AAC1B,QAAM,EAAE,WAAW,SAAS,IAAI,UAAW,CAAE,WAAY;AACxD,UAAM,EAAE,wBAAwB,qBAAqB,IACpD,OAAQ,WAAY;AACrB,UAAM,EAAE,YAAY,IAAI,OAAQ,SAAU;AAC1C,WAAO;AAAA,MACN,WAAW,qBAAsB,UAAW;AAAA,MAC5C,UAAU,YAAa,uBAAwB,MAAO,CAAE;AAAA,IACzD;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,aAAa,CAAE,UAAW;AAChC,WAAO;AAAA,EACR;AAEA,SAAO,oBAAC,aAAU;AACnB;AAOe,SAAR,sBAAuC;AAC7C,SACC,oBAAC,uBACA,8BAAC,mBAAgB,GAClB;AAEF;",
"names": []
}