@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
8 lines (7 loc) • 1.62 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/components/template-actions-panel/index.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { usePostTemplatePanelMode } from '../post-template/hooks';\nimport BlockThemeContent from './block-theme-content';\nimport ClassicThemeContent from './classic-theme-content';\n\nexport default function TemplateActionsPanel() {\n\tconst postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\tconst mode = usePostTemplatePanelMode();\n\t// This check is because the experiment is gated for these post\n\t// types for now. Later we should use `postType.viewable`.\n\tif ( ! [ 'page', 'post' ].includes( postType ) ) {\n\t\treturn null;\n\t}\n\tif ( mode === 'classic' ) {\n\t\treturn <ClassicThemeContent />;\n\t}\n\tif ( mode === 'block-theme' ) {\n\t\treturn <BlockThemeContent />;\n\t}\n\treturn null;\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAK1B,mBAAqC;AACrC,mBAAyC;AACzC,iCAA8B;AAC9B,mCAAgC;AAcvB;AAZM,SAAR,uBAAwC;AAC9C,QAAM,eAAW;AAAA,IAChB,CAAE,WAAY,OAAQ,aAAAA,KAAY,EAAE,mBAAmB;AAAA,IACvD,CAAC;AAAA,EACF;AACA,QAAM,WAAO,uCAAyB;AAGtC,MAAK,CAAE,CAAE,QAAQ,MAAO,EAAE,SAAU,QAAS,GAAI;AAChD,WAAO;AAAA,EACR;AACA,MAAK,SAAS,WAAY;AACzB,WAAO,4CAAC,6BAAAC,SAAA,EAAoB;AAAA,EAC7B;AACA,MAAK,SAAS,eAAgB;AAC7B,WAAO,4CAAC,2BAAAC,SAAA,EAAkB;AAAA,EAC3B;AACA,SAAO;AACR;",
"names": ["editorStore", "ClassicThemeContent", "BlockThemeContent"]
}