@wordpress/edit-post 7.4.0 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/device-preview/index.js +3 -7
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +3 -3
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +5 -0
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +13 -15
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +6 -8
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +1 -7
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +11 -11
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +13 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -7
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +3 -7
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +3 -7
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +6 -8
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +1 -1
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/visual-editor/index.js +29 -24
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/welcome-guide/default.js +1 -1
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/build-module/components/device-preview/index.js +3 -6
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +3 -2
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +6 -0
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +13 -14
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +6 -7
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +1 -6
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +11 -11
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +13 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -6
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js +3 -6
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +3 -6
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +6 -7
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build-module/components/visual-editor/index.js +28 -24
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +1 -1
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/index.js +4 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +10 -3
- package/build-style/style.css +10 -3
- package/package.json +30 -31
- package/src/components/device-preview/index.js +1 -6
- package/src/components/header/fullscreen-mode-close/index.js +1 -6
- package/src/components/header/header-toolbar/index.native.js +5 -0
- package/src/components/header/post-publish-button-or-toggle.js +4 -10
- package/src/components/header/template-title/edit-template-title.js +8 -12
- package/src/components/header/tools-more-menu-group/index.js +1 -6
- package/src/components/keyboard-shortcuts/index.js +13 -11
- package/src/components/layout/index.js +14 -14
- package/src/components/preferences-modal/index.js +1 -9
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +1 -1
- package/src/components/sidebar/featured-image/index.js +3 -10
- package/src/components/sidebar/page-attributes/index.js +3 -10
- package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +2 -7
- package/src/components/sidebar/post-template/create-modal.js +1 -1
- package/src/components/visual-editor/index.js +36 -22
- package/src/components/welcome-guide/default.js +1 -1
- package/src/index.js +5 -1
- package/src/test/editor.native.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["interfaceLabels","header","body","sidebar","actions","footer","Layout","styles","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","editPostStore","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFreeMode","showBlockBreadcrumbs","isTemplateMode","documentLabel","select","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","isEditingTemplate","isFeatureActive","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","isDistractionFree","className","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";;;;;;;;;AA6BA;;AA1BA;;AAKA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;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G;AACXM,MAAAA,QAAQ,EAAErC,gBADC;AAEXsC,MAAAA,IAAI,EAAErC;AAFK;AAhFb,IATD,EA8FC,4BAAC,yBAAD,OA9FD,EA+FC,4BAAC,kCAAD,OA/FD,EAgGC,4BAAC,qBAAD,OAhGD,EAiGC,4BAAC,yBAAD,OAjGD,EAkGC,4BAAC,mBAAD,CAAS,IAAT,OAlGD,EAmGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGmC;AAAtB,IAnGD,CADD;AAuGA;;eAEcrD,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction Layout( { styles } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFreeMode,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFreeMode:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst isDistractionFree = isDistractionFreeMode && isLargeViewport;\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree,\n\t} );\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["interfaceLabels","header","body","sidebar","actions","footer","Layout","styles","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","editPostStore","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","select","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","isEditingTemplate","isFeatureActive","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";;;;;;;;;AA6BA;;AA1BA;;AAKA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAlDA;AACA;AACA;;AAGA;AACA;AACA;;AA0BA;AACA;AACA;AAiBA,MAAMA,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,gBAAJ,CAJiB;;AAKvB;AACA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D,EAiGC,4BAAC,yBAAD,OAjGD,EAkGC,4BAAC,mBAAD,CAAS,IAAT,OAlGD,EAmGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGkC;AAAtB,IAnGD,CADD;AAuGA;;eAEcpD,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction Layout( { styles } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
|
|
@@ -9,8 +9,6 @@ exports.default = EditPostPreferencesModal;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _lodash = require("lodash");
|
|
13
|
-
|
|
14
12
|
var _i18n = require("@wordpress/i18n");
|
|
15
13
|
|
|
16
14
|
var _compose = require("@wordpress/compose");
|
|
@@ -31,10 +29,6 @@ var _store = require("../../store");
|
|
|
31
29
|
|
|
32
30
|
var _blockManager = _interopRequireDefault(require("../block-manager"));
|
|
33
31
|
|
|
34
|
-
/**
|
|
35
|
-
* External dependencies
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
32
|
/**
|
|
39
33
|
* WordPress dependencies
|
|
40
34
|
*/
|
|
@@ -143,7 +137,7 @@ function EditPostPreferencesModal() {
|
|
|
143
137
|
description: (0, _i18n.__)('Choose what displays in the panel.')
|
|
144
138
|
}, (0, _element.createElement)(_options.EnablePluginDocumentSettingPanelOption.Slot, null), (0, _element.createElement)(_editor.PostTaxonomies, {
|
|
145
139
|
taxonomyWrapper: (content, taxonomy) => (0, _element.createElement)(_options.EnablePanelOption, {
|
|
146
|
-
label:
|
|
140
|
+
label: taxonomy.labels.menu_name,
|
|
147
141
|
panelName: `taxonomy-panel-${taxonomy.slug}`
|
|
148
142
|
})
|
|
149
143
|
}), (0, _element.createElement)(_editor.PostFeaturedImageCheck, null, (0, _element.createElement)(_options.EnablePanelOption, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","editPostStore","isModalActive","showBlockBreadcrumbsOption","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","name","tabLabel","content","taxonomy","slug"],"mappings":";;;;;;;;;AAYA;;AATA;;AAMA;;AACA;;AACA;;AAEA;;AAQA;;AAKA;;AAMA;;AAMA;;AACA;;AACA;;AAxCA;AACA;AACA;;AAGA;AACA;AACA;;AAqBA;AACA;AACA;AAYA,MAAMA,UAAU,GAAG,uBAAnB;;AAEe,SAASC,wBAAT,GAAoC;AAClD,QAAMC,eAAe,GAAG,+BAAkB,QAAlB,CAAxB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAiB,uBAAaC,YAAb,CAAvB;AACA,QAAM,CAAEC,aAAF,EAAiBC,0BAAjB,IAAgD,qBACnDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAwBD,MAAM,CAAEE,aAAF,CAApC;AACA,UAAM;AAAEC,MAAAA,aAAF;AAAiBC,MAAAA;AAAjB,QAAqCJ,MAAM,CAAEH,YAAF,CAAjD;AACA,UAAMQ,WAAW,GAChBL,MAAM,CAAEH,YAAF,CAAN,CAAwBC,aAAxB,CAAuCL,UAAvC,CADD;AAEA,UAAMa,IAAI,GAAGH,aAAa,EAA1B;AACA,UAAMI,oBAAoB,GAAGN,iBAAiB,GAAGO,kBAAjD;AACA,UAAMC,wBAAwB,GAC7BL,eAAe,CAAE,iBAAF,CADhB;AAEA,WAAO,CACNC,WADM,EAEN,CAAEI,wBAAF,IACCd,eADD,IAECY,oBAFD,IAGCD,IAAI,KAAK,QALJ,EAMNG,wBANM,CAAP;AAQA,GAlBoD,EAmBrD,CAAEd,eAAF,CAnBqD,CAAtD;AAsBA,QAAM;AAAEe,IAAAA,mBAAF;AAAuBC,IAAAA,mBAAvB;AAA4CC,IAAAA;AAA5C,MACL,uBAAaf,YAAb,CADD;AAGA,QAAM;AAAEgB,IAAAA,GAAG,EAAEC;AAAP,MAAyB,uBAAaC,kBAAb,CAA/B;;AAEA,QAAMC,qBAAqB,GAAG,MAAM;AACnCF,IAA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\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nconst MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( editPostStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive =\n\t\t\t\tselect( editPostStore ).isModalActive( MODAL_NAME );\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ get( taxonomy, [\n\t\t\t\t\t\t\t\t\t\t\t'labels',\n\t\t\t\t\t\t\t\t\t\t\t'menu_name',\n\t\t\t\t\t\t\t\t\t\t] ) }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","editPostStore","isModalActive","showBlockBreadcrumbsOption","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","s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AAWC,QAAX,KACjB,4BAAC,0BAAD;AACC,QAAA,KAAK,EAAGA,QAAQ,CAACC,MAAT,CAAgBC,SADzB;AAEC,QAAA,SAAS,EAAI,kBAAkBF,QAAQ,CAACG,IAAM;AAF/C;AAFF,MAPD,EAeC,4BAAC,8BAAD,QACC,4BAAC,0BAAD;AACC,MAAA,KAAK,EAAG,cAAI,gBAAJ,CADT;AAEC,MAAA,SAAS,EAAC;AAFX,MADD,CAfD,EAqBC,4BAAC,wBAAD,QACC,4BAAC,0BAAD;AACC,MAAA,KAAK,EAAG,cAAI,SAAJ,CADT;AAEC,MAAA,SAAS,EAAC;AAFX,MADD,CArBD,EA2BC,4BAAC,4BAAD;AACC,MAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AADf,OAGC,4BAAC,0BAAD;AACC,MAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,MAAA,SAAS,EAAC;AAFX,MAHD,CA3BD,EAmCC,4BAAC,2BAAD,QACC,4BAAC,0BAAD;AACC,MAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,MAAA,SAAS,EAAC;AAFX,MADD,CAnCD,CADD,EA2CC,4BAAC,yBAAD;AACC,MAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,MAAA,WAAW,EAAG,cACb,gCADa;AAFf,MA3CD;AAJF,GAtHK,CADU,EAgLhB,CAAE7B,eAAF,EAAmBI,0BAAnB,CAhLgB,CAAjB;;AAmLA,MAAK,CAAED,aAAP,EAAuB;AACtB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,2BAAD;AAAkB,IAAA,UAAU,EAAGF;AAA/B,KACC,4BAAC,+BAAD;AAAsB,IAAA,QAAQ,EAAGqB;AAAjC,IADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nconst MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( editPostStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive =\n\t\t\t\tselect( editPostStore ).isModalActive( MODAL_NAME );\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"]}
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
|
|
10
|
-
var _lodash = require("lodash");
|
|
11
|
-
|
|
12
10
|
var _i18n = require("@wordpress/i18n");
|
|
13
11
|
|
|
14
12
|
var _components = require("@wordpress/components");
|
|
@@ -23,10 +21,6 @@ var _coreData = require("@wordpress/core-data");
|
|
|
23
21
|
|
|
24
22
|
var _store = require("../../../store");
|
|
25
23
|
|
|
26
|
-
/**
|
|
27
|
-
* External dependencies
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
24
|
/**
|
|
31
25
|
* WordPress dependencies
|
|
32
26
|
*/
|
|
@@ -41,6 +35,8 @@ var _store = require("../../../store");
|
|
|
41
35
|
const PANEL_NAME = 'featured-image';
|
|
42
36
|
|
|
43
37
|
function FeaturedImage(_ref) {
|
|
38
|
+
var _postType$labels$feat, _postType$labels;
|
|
39
|
+
|
|
44
40
|
let {
|
|
45
41
|
isEnabled,
|
|
46
42
|
isOpened,
|
|
@@ -53,7 +49,7 @@ function FeaturedImage(_ref) {
|
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
return (0, _element.createElement)(_editor.PostFeaturedImageCheck, null, (0, _element.createElement)(_components.PanelBody, {
|
|
56
|
-
title: (0
|
|
52
|
+
title: (_postType$labels$feat = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : (0, _i18n.__)('Featured image'),
|
|
57
53
|
opened: isOpened,
|
|
58
54
|
onToggle: onTogglePanel
|
|
59
55
|
}, (0, _element.createElement)(_editor.PostFeaturedImage, null)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"names":["PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","applyWithSelect","select","getEditedPostAttribute","editorStore","getPostType","coreStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"mappings":";;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"names":["PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","labels","featured_image","applyWithSelect","select","getEditedPostAttribute","editorStore","getPostType","coreStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,gBA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AAA;AADT,GAAP;AAIA,CAPyB,CAA1B;;eASe,sBAASZ,eAAT,EAA0BS,iBAA1B,EAA+ChB,aAA/C,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostFeaturedImage,\n\tPostFeaturedImageCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'featured-image';\n\nfunction FeaturedImage( { isEnabled, isOpened, postType, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\tselect( editPostStore );\n\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch ) => {\n\tconst { toggleEditorPanelOpened } = dispatch( editPostStore );\n\n\treturn {\n\t\tonTogglePanel: ( ...args ) =>\n\t\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args ),\n\t};\n} );\n\nexport default compose( applyWithSelect, applyWithDispatch )( FeaturedImage );\n"]}
|
|
@@ -8,8 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
|
|
9
9
|
var _element = require("@wordpress/element");
|
|
10
10
|
|
|
11
|
-
var _lodash = require("lodash");
|
|
12
|
-
|
|
13
11
|
var _i18n = require("@wordpress/i18n");
|
|
14
12
|
|
|
15
13
|
var _components = require("@wordpress/components");
|
|
@@ -22,10 +20,6 @@ var _coreData = require("@wordpress/core-data");
|
|
|
22
20
|
|
|
23
21
|
var _store = require("../../../store");
|
|
24
22
|
|
|
25
|
-
/**
|
|
26
|
-
* External dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
23
|
/**
|
|
30
24
|
* WordPress dependencies
|
|
31
25
|
*/
|
|
@@ -40,6 +34,8 @@ var _store = require("../../../store");
|
|
|
40
34
|
const PANEL_NAME = 'page-attributes';
|
|
41
35
|
|
|
42
36
|
function PageAttributes() {
|
|
37
|
+
var _postType$labels$attr, _postType$labels;
|
|
38
|
+
|
|
43
39
|
const {
|
|
44
40
|
isEnabled,
|
|
45
41
|
isOpened,
|
|
@@ -78,7 +74,7 @@ function PageAttributes() {
|
|
|
78
74
|
};
|
|
79
75
|
|
|
80
76
|
return (0, _element.createElement)(_editor.PageAttributesCheck, null, (0, _element.createElement)(_components.PanelBody, {
|
|
81
|
-
title: (0
|
|
77
|
+
title: (_postType$labels$attr = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : (0, _i18n.__)('Page attributes'),
|
|
82
78
|
opened: isOpened,
|
|
83
79
|
onToggle: onTogglePanel
|
|
84
80
|
}, (0, _element.createElement)(_editor.PageAttributesParent, null), (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PageAttributesOrder, null))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"names":["PANEL_NAME","PageAttributes","isEnabled","isOpened","postType","select","getEditedPostAttribute","editorStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","getPostType","coreStore","toggleEditorPanelOpened","onTogglePanel","args"],"mappings":";;;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"names":["PANEL_NAME","PageAttributes","isEnabled","isOpened","postType","select","getEditedPostAttribute","editorStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","getPostType","coreStore","toggleEditorPanelOpened","onTogglePanel","args","labels","attributes"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAMA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,iBAAnB;;AAEO,SAASC,cAAT,GAA0B;AAAA;;AAChC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAM;AAAEC,MAAAA;AAAF,QAA6BD,MAAM,CAAEE,aAAF,CAAzC;AACA,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLJ,MAAM,CAAEK,YAAF,CADP;AAEA,UAAM;AAAEC,MAAAA;AAAF,QAAkBN,MAAM,CAAEO,eAAF,CAA9B;AACA,WAAO;AACNV,MAAAA,SAAS,EAAEM,oBAAoB,CAAER,UAAF,CADzB;AAENG,MAAAA,QAAQ,EAAEM,mBAAmB,CAAET,UAAF,CAFvB;AAGNI,MAAAA,QAAQ,EAAEO,WAAW,CAAEL,sBAAsB,CAAE,MAAF,CAAxB;AAHf,KAAP;AAKA,GAVyC,EAUvC,EAVuC,CAA1C;AAYA,QAAM;AAAEO,IAAAA;AAAF,MAA8B,uBAAaH,YAAb,CAApC;;AAEA,MAAK,CAAER,SAAF,IAAe,CAAEE,QAAtB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,QAAMU,aAAa,GAAG;AAAA,sCAAKC,IAAL;AAAKA,MAAAA,IAAL;AAAA;;AAAA,WACrBF,uBAAuB,CAAEb,UAAF,EAAc,GAAGe,IAAjB,CADF;AAAA,GAAtB;;AAGA,SACC,4BAAC,2BAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,2BACJX,QADI,aACJA,QADI,2CACJA,QAAQ,CAAEY,MADN,qDACJ,iBAAkBC,UADd,yEAC4B,cAAI,iBAAJ,CAFlC;AAIC,IAAA,MAAM,EAAGd,QAJV;AAKC,IAAA,QAAQ,EAAGW;AALZ,KAOC,4BAAC,4BAAD,OAPD,EAQC,4BAAC,oBAAD,QACC,4BAAC,2BAAD,OADD,CARD,CADD,CADD;AAgBA;;eAEcb,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tstore as editorStore,\n\tPageAttributesCheck,\n\tPageAttributesOrder,\n\tPageAttributesParent,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'page-attributes';\n\nexport function PageAttributes() {\n\tconst { isEnabled, isOpened, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\tconst onTogglePanel = ( ...args ) =>\n\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args );\n\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.attributes ?? __( 'Page attributes' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PageAttributesParent />\n\t\t\t\t<PanelRow>\n\t\t\t\t\t<PageAttributesOrder />\n\t\t\t\t</PanelRow>\n\t\t\t</PanelBody>\n\t\t</PageAttributesCheck>\n\t);\n}\n\nexport default PageAttributes;\n"]}
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
|
|
10
|
-
var _lodash = require("lodash");
|
|
11
|
-
|
|
12
10
|
var _compose = require("@wordpress/compose");
|
|
13
11
|
|
|
14
12
|
var _components = require("@wordpress/components");
|
|
@@ -17,10 +15,6 @@ var _data = require("@wordpress/data");
|
|
|
17
15
|
|
|
18
16
|
var _store = require("../../../store");
|
|
19
17
|
|
|
20
|
-
/**
|
|
21
|
-
* External dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
18
|
/**
|
|
25
19
|
* WordPress dependencies
|
|
26
20
|
*/
|
|
@@ -29,6 +23,8 @@ var _store = require("../../../store");
|
|
|
29
23
|
* Internal dependencies
|
|
30
24
|
*/
|
|
31
25
|
function TaxonomyPanel(_ref) {
|
|
26
|
+
var _taxonomy$labels;
|
|
27
|
+
|
|
32
28
|
let {
|
|
33
29
|
isEnabled,
|
|
34
30
|
taxonomy,
|
|
@@ -41,7 +37,7 @@ function TaxonomyPanel(_ref) {
|
|
|
41
37
|
return null;
|
|
42
38
|
}
|
|
43
39
|
|
|
44
|
-
const taxonomyMenuName =
|
|
40
|
+
const taxonomyMenuName = taxonomy === null || taxonomy === void 0 ? void 0 : (_taxonomy$labels = taxonomy.labels) === null || _taxonomy$labels === void 0 ? void 0 : _taxonomy$labels.menu_name;
|
|
45
41
|
|
|
46
42
|
if (!taxonomyMenuName) {
|
|
47
43
|
return null;
|
|
@@ -55,7 +51,9 @@ function TaxonomyPanel(_ref) {
|
|
|
55
51
|
}
|
|
56
52
|
|
|
57
53
|
var _default = (0, _compose.compose)((0, _data.withSelect)((select, ownProps) => {
|
|
58
|
-
|
|
54
|
+
var _ownProps$taxonomy;
|
|
55
|
+
|
|
56
|
+
const slug = (_ownProps$taxonomy = ownProps.taxonomy) === null || _ownProps$taxonomy === void 0 ? void 0 : _ownProps$taxonomy.slug;
|
|
59
57
|
const panelName = slug ? `taxonomy-panel-${slug}` : '';
|
|
60
58
|
return {
|
|
61
59
|
panelName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"names":["TaxonomyPanel","isEnabled","taxonomy","isOpened","onTogglePanel","children","taxonomyMenuName","select","ownProps","slug","panelName","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"names":["TaxonomyPanel","isEnabled","taxonomy","isOpened","onTogglePanel","children","taxonomyMenuName","labels","menu_name","select","ownProps","slug","panelName","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,aAAT,OAMI;AAAA;;AAAA,MANoB;AACvBC,IAAAA,SADuB;AAEvBC,IAAAA,QAFuB;AAGvBC,IAAAA,QAHuB;AAIvBC,IAAAA,aAJuB;AAKvBC,IAAAA;AALuB,GAMpB;;AACH,MAAK,CAAEJ,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMK,gBAAgB,GAAGJ,QAAH,aAAGA,QAAH,2CAAGA,QAAQ,CAAEK,MAAb,qDAAG,iBAAkBC,SAA3C;;AACA,MAAK,CAAEF,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAGA,gBADT;AAEC,IAAA,MAAM,EAAGH,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGC,QALH,CADD;AASA;;eAEc,sBACd,sBAAY,CAAEI,MAAF,EAAUC,QAAV,KAAwB;AAAA;;AACnC,QAAMC,IAAI,yBAAGD,QAAQ,CAACR,QAAZ,uDAAG,mBAAmBS,IAAhC;AACA,QAAMC,SAAS,GAAGD,IAAI,GAAI,kBAAkBA,IAAM,EAA5B,GAAgC,EAAtD;AACA,SAAO;AACNC,IAAAA,SADM;AAENX,IAAAA,SAAS,EAAEU,IAAI,GACZF,MAAM,CAAEI,YAAF,CAAN,CAAwBC,oBAAxB,CAA8CF,SAA9C,CADY,GAEZ,KAJG;AAKNT,IAAAA,QAAQ,EAAEQ,IAAI,GACXF,MAAM,CAAEI,YAAF,CAAN,CAAwBE,mBAAxB,CAA6CH,SAA7C,CADW,GAEX;AAPG,GAAP;AASA,CAZD,CADc,EAcd,wBAAc,CAAEI,QAAF,EAAYN,QAAZ,MAA4B;AACzCN,EAAAA,aAAa,EAAE,MAAM;AACpBY,IAAAA,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACCP,QAAQ,CAACE,SADV;AAGA;AALwC,CAA5B,CAAd,CAdc,EAqBZZ,aArBY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { PanelBody } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TaxonomyPanel( {\n\tisEnabled,\n\ttaxonomy,\n\tisOpened,\n\tonTogglePanel,\n\tchildren,\n} ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, ownProps ) => {\n\t\tconst slug = ownProps.taxonomy?.slug;\n\t\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\t\treturn {\n\t\t\tpanelName,\n\t\t\tisEnabled: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelEnabled( panelName )\n\t\t\t\t: false,\n\t\t\tisOpened: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelOpened( panelName )\n\t\t\t\t: false,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tonTogglePanel: () => {\n\t\t\tdispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\townProps.panelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( TaxonomyPanel );\n"]}
|
|
@@ -98,7 +98,7 @@ function PostTemplateCreateModal(_ref) {
|
|
|
98
98
|
onChange: setTitle,
|
|
99
99
|
placeholder: DEFAULT_TITLE,
|
|
100
100
|
disabled: isBusy,
|
|
101
|
-
help: (0, _i18n.__)('Describe the template, e.g. "Post with sidebar".
|
|
101
|
+
help: (0, _i18n.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')
|
|
102
102
|
}), (0, _element.createElement)(_components.__experimentalHStack, {
|
|
103
103
|
justify: "right"
|
|
104
104
|
}, (0, _element.createElement)(_components.Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/create-modal.js"],"names":["DEFAULT_TITLE","PostTemplateCreateModal","onClose","defaultBlockTemplate","select","editorStore","getEditorSettings","__unstableCreateTemplate","__unstableSwitchToTemplateMode","editPostStore","title","setTitle","isBusy","setIsBusy","cancel","submit","event","preventDefault","newTemplateContent","tagName","layout","inherit","slug","content"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAOA;;AACA;;AAKA;;AApBA;AACA;AACA;;AAeA;AACA;AACA;AAGA,MAAMA,aAAa,GAAG,cAAI,iBAAJ,CAAtB;;AAEe,SAASC,uBAAT,OAAgD;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AAC9D,QAAMC,oBAAoB,GAAG,qBAC1BC,MAAF,IACCA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CH,oBAFf,EAG5B,EAH4B,CAA7B;AAMA,QAAM;AAAEI,IAAAA,wBAAF;AAA4BC,IAAAA;AAA5B,MACL,uBAAaC,YAAb,CADD;AAGA,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAU,EAAV,CAA5B;AAEA,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,KAAV,CAA9B;;AAEA,QAAMC,MAAM,GAAG,MAAM;AACpBH,IAAAA,QAAQ,CAAE,EAAF,CAAR;AACAT,IAAAA,OAAO;AACP,GAHD;;AAKA,QAAMa,MAAM,GAAG,MAAQC,KAAR,IAAmB;AACjCA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAKL,MAAL,EAAc;AACb;AACA;;AAEDC,IAAAA,SAAS,CAAE,IAAF,CAAT;AAEA,UAAMK,kBAAkB,GACvBf,oBADuB,aACvBA,oBADuB,cACvBA,oBADuB,GAEvB,uBAAW,CACV,yBACC,YADD,EAEC;AACCgB,MAAAA,OAAO,EAAE,QADV;AAECC,MAAAA,MAAM,EAAE;AAAEC,QAAAA,OAAO,EAAE;AAAX;AAFT,KAFD,EAMC,CACC,yBAAa,iBAAb,C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/src/components/sidebar/post-template/create-modal.js"],"names":["DEFAULT_TITLE","PostTemplateCreateModal","onClose","defaultBlockTemplate","select","editorStore","getEditorSettings","__unstableCreateTemplate","__unstableSwitchToTemplateMode","editPostStore","title","setTitle","isBusy","setIsBusy","cancel","submit","event","preventDefault","newTemplateContent","tagName","layout","inherit","slug","content"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAOA;;AACA;;AAKA;;AApBA;AACA;AACA;;AAeA;AACA;AACA;AAGA,MAAMA,aAAa,GAAG,cAAI,iBAAJ,CAAtB;;AAEe,SAASC,uBAAT,OAAgD;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AAC9D,QAAMC,oBAAoB,GAAG,qBAC1BC,MAAF,IACCA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CH,oBAFf,EAG5B,EAH4B,CAA7B;AAMA,QAAM;AAAEI,IAAAA,wBAAF;AAA4BC,IAAAA;AAA5B,MACL,uBAAaC,YAAb,CADD;AAGA,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAU,EAAV,CAA5B;AAEA,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,KAAV,CAA9B;;AAEA,QAAMC,MAAM,GAAG,MAAM;AACpBH,IAAAA,QAAQ,CAAE,EAAF,CAAR;AACAT,IAAAA,OAAO;AACP,GAHD;;AAKA,QAAMa,MAAM,GAAG,MAAQC,KAAR,IAAmB;AACjCA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAKL,MAAL,EAAc;AACb;AACA;;AAEDC,IAAAA,SAAS,CAAE,IAAF,CAAT;AAEA,UAAMK,kBAAkB,GACvBf,oBADuB,aACvBA,oBADuB,cACvBA,oBADuB,GAEvB,uBAAW,CACV,yBACC,YADD,EAEC;AACCgB,MAAAA,OAAO,EAAE,QADV;AAECC,MAAAA,MAAM,EAAE;AAAEC,QAAAA,OAAO,EAAE;AAAX;AAFT,KAFD,EAMC,CAC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C,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,UAAhB;AAA2B,IAAA,OAAO,EAAGE;AAArC,KACG,cAAI,QAAJ,CADH,CADD,EAKC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,MAAM,EAAGF,MAHV;AAIC,qBAAgBA;AAJjB,KAMG,cAAI,QAAJ,CANH,CALD,CAZD,CAJD,CALD,CADD;AAwCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useState } from '@wordpress/element';\nimport { serialize, createBlock } from '@wordpress/blocks';\nimport {\n\tModal,\n\tTextControl,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cleanForSlug } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst DEFAULT_TITLE = __( 'Custom Template' );\n\nexport default function PostTemplateCreateModal( { onClose } ) {\n\tconst defaultBlockTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().defaultBlockTemplate,\n\t\t[]\n\t);\n\n\tconst { __unstableCreateTemplate, __unstableSwitchToTemplateMode } =\n\t\tuseDispatch( editPostStore );\n\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst cancel = () => {\n\t\tsetTitle( '' );\n\t\tonClose();\n\t};\n\n\tconst submit = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst newTemplateContent =\n\t\t\tdefaultBlockTemplate ??\n\t\t\tserialize( [\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'header',\n\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/site-title' ),\n\t\t\t\t\t\tcreateBlock( 'core/site-tagline' ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\tcreateBlock( 'core/separator' ),\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'main',\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[ createBlock( 'core/post-title' ) ]\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcreateBlock( 'core/post-content', {\n\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t] );\n\n\t\tawait __unstableCreateTemplate( {\n\t\t\tslug: cleanForSlug( title || DEFAULT_TITLE ),\n\t\t\tcontent: newTemplateContent,\n\t\t\ttitle: title || DEFAULT_TITLE,\n\t\t} );\n\n\t\tsetIsBusy( false );\n\t\tcancel();\n\n\t\t__unstableSwitchToTemplateMode( true );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Create custom template' ) }\n\t\t\tonRequestClose={ cancel }\n\t\t\tclassName=\"edit-post-post-template__create-modal\"\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"edit-post-post-template__create-form\"\n\t\t\t\tonSubmit={ submit }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ DEFAULT_TITLE }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Describe the template, e.g. \"Post with sidebar\". A custom template can be manually applied to any post or page.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ cancel }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\t\taria-disabled={ isBusy }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -42,6 +42,8 @@ var _store = require("../../store");
|
|
|
42
42
|
/**
|
|
43
43
|
* Internal dependencies
|
|
44
44
|
*/
|
|
45
|
+
const isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;
|
|
46
|
+
|
|
45
47
|
function MaybeIframe(_ref) {
|
|
46
48
|
let {
|
|
47
49
|
children,
|
|
@@ -82,7 +84,8 @@ function MaybeIframe(_ref) {
|
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* Given an array of nested blocks, find the first Post Content
|
|
85
|
-
* block inside it, recursing through any nesting levels
|
|
87
|
+
* block inside it, recursing through any nesting levels,
|
|
88
|
+
* and return its attributes.
|
|
86
89
|
*
|
|
87
90
|
* @param {Array} blocks A list of blocks.
|
|
88
91
|
*
|
|
@@ -90,14 +93,14 @@ function MaybeIframe(_ref) {
|
|
|
90
93
|
*/
|
|
91
94
|
|
|
92
95
|
|
|
93
|
-
function
|
|
96
|
+
function getPostContentAttributes(blocks) {
|
|
94
97
|
for (let i = 0; i < blocks.length; i++) {
|
|
95
98
|
if (blocks[i].name === 'core/post-content') {
|
|
96
|
-
return blocks[i];
|
|
99
|
+
return blocks[i].attributes;
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
if (blocks[i].innerBlocks.length) {
|
|
100
|
-
const nestedPostContent =
|
|
103
|
+
const nestedPostContent = getPostContentAttributes(blocks[i].innerBlocks);
|
|
101
104
|
|
|
102
105
|
if (nestedPostContent) {
|
|
103
106
|
return nestedPostContent;
|
|
@@ -107,8 +110,6 @@ function findPostContent(blocks) {
|
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
function VisualEditor(_ref2) {
|
|
110
|
-
var _postContentBlock$att;
|
|
111
|
-
|
|
112
113
|
let {
|
|
113
114
|
styles
|
|
114
115
|
} = _ref2;
|
|
@@ -116,6 +117,7 @@ function VisualEditor(_ref2) {
|
|
|
116
117
|
deviceType,
|
|
117
118
|
isWelcomeGuideVisible,
|
|
118
119
|
isTemplateMode,
|
|
120
|
+
postContentAttributes,
|
|
119
121
|
editedPostTemplate = {},
|
|
120
122
|
wrapperBlockName,
|
|
121
123
|
wrapperUniqueId,
|
|
@@ -124,8 +126,8 @@ function VisualEditor(_ref2) {
|
|
|
124
126
|
const {
|
|
125
127
|
isFeatureActive,
|
|
126
128
|
isEditingTemplate,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
getEditedPostTemplate,
|
|
130
|
+
__experimentalGetPreviewDeviceType
|
|
129
131
|
} = select(_store.store);
|
|
130
132
|
const {
|
|
131
133
|
getCurrentPostId,
|
|
@@ -150,8 +152,9 @@ function VisualEditor(_ref2) {
|
|
|
150
152
|
deviceType: __experimentalGetPreviewDeviceType(),
|
|
151
153
|
isWelcomeGuideVisible: isFeatureActive('welcomeGuide'),
|
|
152
154
|
isTemplateMode: _isTemplateMode,
|
|
155
|
+
postContentAttributes: getEditorSettings().postContentAttributes,
|
|
153
156
|
// Post template fetch returns a 404 on classic themes, which
|
|
154
|
-
// messes with e2e tests, so
|
|
157
|
+
// messes with e2e tests, so check it's a block theme first.
|
|
155
158
|
editedPostTemplate: supportsTemplateMode && canEditTemplate ? getEditedPostTemplate() : undefined,
|
|
156
159
|
wrapperBlockName: _wrapperBlockName,
|
|
157
160
|
wrapperUniqueId: getCurrentPostId(),
|
|
@@ -237,23 +240,27 @@ function VisualEditor(_ref2) {
|
|
|
237
240
|
type: 'default'
|
|
238
241
|
};
|
|
239
242
|
}, [isTemplateMode, themeSupportsLayout, globalLayoutSettings]);
|
|
240
|
-
const
|
|
241
|
-
|
|
243
|
+
const newestPostContentAttributes = (0, _element.useMemo)(() => {
|
|
244
|
+
if (!(editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.content) && !(editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.blocks)) {
|
|
245
|
+
return postContentAttributes;
|
|
246
|
+
} // When in template editing mode, we can access the blocks directly.
|
|
247
|
+
|
|
248
|
+
|
|
242
249
|
if (editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.blocks) {
|
|
243
|
-
return
|
|
250
|
+
return getPostContentAttributes(editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks);
|
|
244
251
|
} // If there are no blocks, we have to parse the content string.
|
|
245
252
|
// Best double-check it's a string otherwise the parse function gets unhappy.
|
|
246
253
|
|
|
247
254
|
|
|
248
255
|
const parseableContent = typeof (editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content) === 'string' ? editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content : '';
|
|
249
|
-
return
|
|
250
|
-
}, [editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content, editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks]);
|
|
251
|
-
const
|
|
256
|
+
return getPostContentAttributes((0, _blocks.parse)(parseableContent)) || {};
|
|
257
|
+
}, [editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content, editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks, postContentAttributes]);
|
|
258
|
+
const layout = (newestPostContentAttributes === null || newestPostContentAttributes === void 0 ? void 0 : newestPostContentAttributes.layout) || {};
|
|
259
|
+
const postContentLayoutClasses = (0, _blockEditor.__experimentaluseLayoutClasses)(newestPostContentAttributes, 'core/post-content');
|
|
252
260
|
const blockListLayoutClass = (0, _classnames.default)({
|
|
253
261
|
'is-layout-flow': !themeSupportsLayout
|
|
254
262
|
}, themeSupportsLayout && postContentLayoutClasses);
|
|
255
|
-
const postContentLayoutStyles = (0, _blockEditor.__experimentaluseLayoutStyles)(
|
|
256
|
-
const layout = (postContentBlock === null || postContentBlock === void 0 ? void 0 : (_postContentBlock$att = postContentBlock.attributes) === null || _postContentBlock$att === void 0 ? void 0 : _postContentBlock$att.layout) || {}; // Update type for blocks using legacy layouts.
|
|
263
|
+
const postContentLayoutStyles = (0, _blockEditor.__experimentaluseLayoutStyles)(newestPostContentAttributes, 'core/post-content', '.block-editor-block-list__layout.is-root-container'); // Update type for blocks using legacy layouts.
|
|
257
264
|
|
|
258
265
|
const postContentLayout = (0, _element.useMemo)(() => {
|
|
259
266
|
return layout && ((layout === null || layout === void 0 ? void 0 : layout.type) === 'constrained' || layout !== null && layout !== void 0 && layout.inherit || layout !== null && layout !== void 0 && layout.contentSize || layout !== null && layout !== void 0 && layout.wideSize) ? { ...globalLayoutSettings,
|
|
@@ -266,7 +273,7 @@ function VisualEditor(_ref2) {
|
|
|
266
273
|
}, [layout === null || layout === void 0 ? void 0 : layout.type, layout === null || layout === void 0 ? void 0 : layout.inherit, layout === null || layout === void 0 ? void 0 : layout.contentSize, layout === null || layout === void 0 ? void 0 : layout.wideSize, globalLayoutSettings]); // If there is a Post Content block we use its layout for the block list;
|
|
267
274
|
// if not, this must be a classic theme, in which case we use the fallback layout.
|
|
268
275
|
|
|
269
|
-
const blockListLayout =
|
|
276
|
+
const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout;
|
|
270
277
|
const titleRef = (0, _element.useRef)();
|
|
271
278
|
(0, _element.useEffect)(() => {
|
|
272
279
|
var _titleRef$current;
|
|
@@ -289,7 +296,7 @@ function VisualEditor(_ref2) {
|
|
|
289
296
|
}, (0, _element.createElement)(_editor.VisualEditorGlobalKeyboardShortcuts, null), (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
290
297
|
className: "edit-post-visual-editor__content-area",
|
|
291
298
|
animate: {
|
|
292
|
-
padding: isTemplateMode ? '48px 48px 0' :
|
|
299
|
+
padding: isTemplateMode ? '48px 48px 0' : 0
|
|
293
300
|
},
|
|
294
301
|
ref: blockSelectionClearerRef
|
|
295
302
|
}, isTemplateMode && (0, _element.createElement)(_components.Button, {
|
|
@@ -304,7 +311,7 @@ function VisualEditor(_ref2) {
|
|
|
304
311
|
initial: desktopCanvasStyles,
|
|
305
312
|
className: previewMode
|
|
306
313
|
}, (0, _element.createElement)(MaybeIframe, {
|
|
307
|
-
shouldIframe: isBlockBasedTheme && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
|
|
314
|
+
shouldIframe: isGutenbergPlugin && isBlockBasedTheme && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
|
|
308
315
|
contentRef: contentRef,
|
|
309
316
|
styles: styles
|
|
310
317
|
}, themeSupportsLayout && !themeHasDisabledLayoutStyles && !isTemplateMode && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.__experimentalLayoutStyle, {
|
|
@@ -316,11 +323,9 @@ function VisualEditor(_ref2) {
|
|
|
316
323
|
css: postContentLayoutStyles,
|
|
317
324
|
layoutDefinitions: globalLayoutSettings === null || globalLayoutSettings === void 0 ? void 0 : globalLayoutSettings.definitions
|
|
318
325
|
})), !isTemplateMode && (0, _element.createElement)("div", {
|
|
319
|
-
className: (0, _classnames.default)(
|
|
320
|
-
// classes as the block list beneath.
|
|
321
|
-
'is-root-container', 'block-editor-block-list__layout', 'edit-post-visual-editor__post-title-wrapper', {
|
|
326
|
+
className: (0, _classnames.default)('edit-post-visual-editor__post-title-wrapper', {
|
|
322
327
|
'is-focus-mode': isFocusMode
|
|
323
|
-
},
|
|
328
|
+
}, 'is-layout-flow'),
|
|
324
329
|
contentEditable: false
|
|
325
330
|
}, (0, _element.createElement)(_editor.PostTitle, {
|
|
326
331
|
ref: titleRef
|