How to use the @wordpress/block-editor.__experimentalUsePageTemplatePickerVisible function in @wordpress/block-editor

To help you get started, we’ve selected a few @wordpress/block-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / edit-post / src / components / header / header-toolbar / index.native.js View on Github external
function HeaderToolbar( {
	hasFixedToolbar,
	hasRedo,
	hasUndo,
	redo,
	undo,
	showInserter,
	showKeyboardHideButton,
	getStylesFromColorScheme,
	onHideKeyboard,
} ) {
	const scrollViewRef = useRef( null );
	const scrollToStart = () => {
		scrollViewRef.current.scrollTo( { x: 0 } );
	};
	const showPageTemplatePicker = __experimentalUsePageTemplatePickerVisible();

	return (
		<>
			{ showPageTemplatePicker && <__experimentalPageTemplatePicker /> }
github WordPress / gutenberg / packages / edit-post / src / components / layout / index.js View on Github external
nextShortcut,
	} = useSelect( ( select ) => {
		return ( {
			hasFixedToolbar: select( 'core/edit-post' ).isFeatureActive( 'fixedToolbar' ),
			editorSidebarOpened: select( 'core/edit-post' ).isEditorSidebarOpened(),
			pluginSidebarOpened: select( 'core/edit-post' ).isPluginSidebarOpened(),
			publishSidebarOpened: select( 'core/edit-post' ).isPublishSidebarOpened(),
			mode: select( 'core/edit-post' ).getEditorMode(),
			isRichEditingEnabled: select( 'core/editor' ).getEditorSettings().richEditingEnabled,
			hasActiveMetaboxes: select( 'core/edit-post' ).hasMetaBoxes(),
			isSaving: select( 'core/edit-post' ).isSavingMetaBoxes(),
			previousShortcut: select( 'core/keyboard-shortcuts' ).getAllShortcutRawKeyCombinations( 'core/edit-post/previous-region' ),
			nextShortcut: select( 'core/keyboard-shortcuts' ).getAllShortcutRawKeyCombinations( 'core/edit-post/next-region' ),
		} );
	}, [] );
	const showPageTemplatePicker = __experimentalUsePageTemplatePickerVisible();
	const sidebarIsOpened = editorSidebarOpened || pluginSidebarOpened || publishSidebarOpened;
	const className = classnames( 'edit-post-layout', 'is-mode-' + mode, {
		'is-sidebar-opened': sidebarIsOpened,
		'has-fixed-toolbar': hasFixedToolbar,
		'has-metaboxes': hasActiveMetaboxes,
	} );

	return (
		<>