@wordpress/edit-post 7.26.1-next.79a6196f.0 → 7.27.1
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 +3 -1
- package/build/components/header/index.js +2 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/meta-boxes/index.js +3 -2
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +11 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +11 -2
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +31 -149
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +11 -5
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/editor.js +3 -26
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +4 -28
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +48 -8
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/index.native.js +1 -1
- package/build/index.native.js.map +1 -1
- package/build/store/actions.js +11 -10
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +24 -6
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/index.js +2 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +3 -2
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +10 -2
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +10 -2
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +31 -150
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +7 -2
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/editor.js +3 -26
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +5 -29
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +49 -9
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/actions.js +11 -10
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +24 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +16 -182
- package/build-style/style.css +16 -182
- package/package.json +32 -32
- package/src/components/header/index.js +2 -4
- package/src/components/header/style.scss +13 -4
- package/src/components/meta-boxes/index.js +4 -2
- package/src/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -3
- package/src/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +9 -2
- package/src/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +9 -2
- package/src/components/preferences-modal/index.js +44 -267
- package/src/components/preferences-modal/meta-boxes-section.js +6 -2
- package/src/components/preferences-modal/{options/test → test}/__snapshots__/enable-custom-fields.js.snap +4 -4
- package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +18 -18
- package/src/components/sidebar/plugin-document-setting-panel/index.js +6 -2
- package/src/editor.js +55 -85
- package/src/editor.native.js +4 -33
- package/src/hooks/commands/use-common-commands.js +77 -7
- package/src/index.js +2 -2
- package/src/index.native.js +1 -1
- package/src/store/actions.js +14 -33
- package/src/store/selectors.js +52 -26
- package/src/store/test/actions.js +9 -9
- package/src/style.scss +0 -1
- package/build/components/block-manager/category.js +0 -105
- package/build/components/block-manager/category.js.map +0 -1
- package/build/components/block-manager/checklist.js +0 -35
- package/build/components/block-manager/checklist.js.map +0 -1
- package/build/components/block-manager/index.js +0 -127
- package/build/components/block-manager/index.js.map +0 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build/components/preferences-modal/options/enable-feature.js +0 -36
- package/build/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -32
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build/components/preferences-modal/options/index.js +0 -42
- package/build/components/preferences-modal/options/index.js.map +0 -1
- package/build-module/components/block-manager/category.js +0 -96
- package/build-module/components/block-manager/category.js.map +0 -1
- package/build-module/components/block-manager/checklist.js +0 -27
- package/build-module/components/block-manager/checklist.js.map +0 -1
- package/build-module/components/block-manager/index.js +0 -118
- package/build-module/components/block-manager/index.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +0 -29
- package/build-module/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -24
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build-module/components/preferences-modal/options/index.js +0 -6
- package/build-module/components/preferences-modal/options/index.js.map +0 -1
- package/src/components/block-manager/category.js +0 -94
- package/src/components/block-manager/checklist.js +0 -30
- package/src/components/block-manager/index.js +0 -158
- package/src/components/block-manager/style.scss +0 -82
- package/src/components/preferences-modal/options/enable-feature.js +0 -31
- package/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -23
- package/src/components/preferences-modal/options/index.js +0 -5
- /package/src/components/preferences-modal/{options/test → test}/enable-custom-fields.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -131,14 +131,14 @@ function Header({
|
|
|
131
131
|
disableBlockTools: isTextEditor
|
|
132
132
|
}), hasFixedToolbar && isLargeViewport && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("div", {
|
|
133
133
|
className: (0, _classnames.default)('selected-block-tools-wrapper', {
|
|
134
|
-
'is-collapsed':
|
|
134
|
+
'is-collapsed': isBlockToolsCollapsed
|
|
135
135
|
})
|
|
136
136
|
}, (0, _react.createElement)(_blockEditor.BlockToolbar, {
|
|
137
137
|
hideDragHandle: true
|
|
138
138
|
})), (0, _react.createElement)(_components.Popover.Slot, {
|
|
139
139
|
ref: blockToolbarRef,
|
|
140
140
|
name: "block-toolbar"
|
|
141
|
-
}),
|
|
141
|
+
}), hasBlockSelection && (0, _react.createElement)(_components.Button, {
|
|
142
142
|
className: "edit-post-header__block-tools-toggle",
|
|
143
143
|
icon: isBlockToolsCollapsed ? _icons.next : _icons.previous,
|
|
144
144
|
onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_editor","_element","_data","_i18n","_icons","_interface","_compose","_components","_preferences","_fullscreenModeClose","_moreMenu","_postPublishButtonOrToggle","_mainDashboardButton","_store","_lockUnlock","DocumentTools","PostViewLink","PreviewDropdown","unlock","editorPrivateApis","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isWideViewport","useViewportMatch","isLargeViewport","blockToolbarRef","useRef","isTextEditor","hasBlockSelection","hasActiveMetaboxes","hasFixedToolbar","isEditingTemplate","isPublishSidebarOpened","showIconLabels","hasHistory","useSelect","select","get","getPreference","preferencesStore","getEditorMode","editPostStore","blockEditorStore","getBlockSelectionStart","hasMetaBoxes","editorStore","getEditorSettings","goBack","getRenderingMode","isBlockToolsCollapsed","setIsBlockToolsCollapsed","useState","useEffect","_react","createElement","className","default","Slot","__unstableMotion","div","variants","showTooltip","disableBlockTools","Fragment","classnames","BlockToolbar","hideDragHandle","Popover","ref","name","Button","icon","next","previous","onClick","collapsed","label","__","DocumentBar","PostSavedState","forceIsDirty","forceIsAutosaveable","PostPreviewButton","PinnedItems","scope","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tDocumentBar,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { DocumentTools, PostViewLink, PreviewDropdown } =\n\tunlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst {\n\t\tisTextEditor,\n\t\thasBlockSelection,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tisEditingTemplate,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory: !! select( editorStore ).getEditorSettings().goBack,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( hasBlockSelection ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ hasBlockSelection ] );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isEditingTemplate && hasBlockSelection && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-post-header__block-tools-toggle\"\n\t\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\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\tlabel={\n\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t}\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\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\thasBlockSelection &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasFixedToolbar &&\n\t\t\t\t\t\t\tisLargeViewport,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ( isEditingTemplate || hasHistory ) && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t) }\n\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAAAU,YAAA,GAAAV,OAAA;AAKA,IAAAW,oBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,0BAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,oBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAxCA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;;AAQA,MAAM;EAAEiB,aAAa;EAAEC,YAAY;EAAEC;AAAgB,CAAC,GACrD,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE5B,MAAMC,MAAM,GAAG;EACdC,MAAM,EAAE;I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":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_editor","_element","_data","_i18n","_icons","_interface","_compose","_components","_preferences","_fullscreenModeClose","_moreMenu","_postPublishButtonOrToggle","_mainDashboardButton","_store","_lockUnlock","DocumentTools","PostViewLink","PreviewDropdown","unlock","editorPrivateApis","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isWideViewport","useViewportMatch","isLargeViewport","blockToolbarRef","useRef","isTextEditor","hasBlockSelection","hasActiveMetaboxes","hasFixedToolbar","isEditingTemplate","isPublishSidebarOpened","showIconLabels","hasHistory","useSelect","select","get","getPreference","preferencesStore","getEditorMode","editPostStore","blockEditorStore","getBlockSelectionStart","hasMetaBoxes","editorStore","getEditorSettings","goBack","getRenderingMode","isBlockToolsCollapsed","setIsBlockToolsCollapsed","useState","useEffect","_react","createElement","className","default","Slot","__unstableMotion","div","variants","showTooltip","disableBlockTools","Fragment","classnames","BlockToolbar","hideDragHandle","Popover","ref","name","Button","icon","next","previous","onClick","collapsed","label","__","DocumentBar","PostSavedState","forceIsDirty","forceIsAutosaveable","PostPreviewButton","PinnedItems","scope","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tDocumentBar,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { DocumentTools, PostViewLink, PreviewDropdown } =\n\tunlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst {\n\t\tisTextEditor,\n\t\thasBlockSelection,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tisEditingTemplate,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory: !! select( editorStore ).getEditorSettings().goBack,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( hasBlockSelection ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ hasBlockSelection ] );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-collapsed': isBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ hasBlockSelection && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-post-header__block-tools-toggle\"\n\t\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\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\tlabel={\n\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t}\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\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\thasBlockSelection &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasFixedToolbar &&\n\t\t\t\t\t\t\tisLargeViewport,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ( isEditingTemplate || hasHistory ) && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t) }\n\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAAAU,YAAA,GAAAV,OAAA;AAKA,IAAAW,oBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,0BAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,oBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAxCA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;;AAQA,MAAM;EAAEiB,aAAa;EAAEC,YAAY;EAAE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cjE,MAAM;AAAAkE,OAAA,CAAA9B,OAAA,GAAA6B,QAAA"}
|
|
@@ -42,15 +42,16 @@ function MetaBoxes({
|
|
|
42
42
|
isEditorReady: __unstableIsEditorReady()
|
|
43
43
|
};
|
|
44
44
|
}, [location]);
|
|
45
|
+
const hasMetaBoxes = !!metaBoxes?.length;
|
|
45
46
|
|
|
46
47
|
// When editor is ready, initialize postboxes (wp core script) and metabox
|
|
47
48
|
// saving. This initializes all meta box locations, not just this specific
|
|
48
49
|
// one.
|
|
49
50
|
(0, _element.useEffect)(() => {
|
|
50
|
-
if (isEditorReady && !areMetaBoxesInitialized) {
|
|
51
|
+
if (isEditorReady && hasMetaBoxes && !areMetaBoxesInitialized) {
|
|
51
52
|
registry.dispatch(_store.store).initializeMetaBoxes();
|
|
52
53
|
}
|
|
53
|
-
}, [isEditorReady, areMetaBoxesInitialized]);
|
|
54
|
+
}, [isEditorReady, hasMetaBoxes, areMetaBoxesInitialized]);
|
|
54
55
|
if (!areMetaBoxesInitialized) {
|
|
55
56
|
return null;
|
|
56
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_editor","_metaBoxesArea","_interopRequireDefault","_metaBoxVisibility","_store","MetaBoxes","location","registry","useRegistry","metaBoxes","areMetaBoxesInitialized","isEditorReady","useSelect","select","__unstableIsEditorReady","editorStore","getMetaBoxesPerLocation","_areMetaBoxesInitialized","editPostStore","useEffect","dispatch","initializeMetaBoxes","_react","createElement","Fragment","map","id","default","key"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAKA;AACA;AACA;;AAKe,SAASO,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC,SAAS;IAAEC,uBAAuB;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EACpEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACzD,MAAM;MACLC,uBAAuB;MACvBN,uBAAuB,EAAEO;IAC1B,CAAC,GAAGJ,MAAM,CAAEK,YAAc,CAAC;IAC3B,OAAO;MACNT,SAAS,EAAEO,uBAAuB,CAAEV,QAAS,CAAC;MAC9CI,uBAAuB,EAAEO,wBAAwB,CAAC,CAAC;MACnDN,aAAa,EAAEG,uBAAuB,CAAC;IACxC,CAAC;EACF,CAAC,EACD,CAAER,QAAQ,CACX,CAAC;;
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_editor","_metaBoxesArea","_interopRequireDefault","_metaBoxVisibility","_store","MetaBoxes","location","registry","useRegistry","metaBoxes","areMetaBoxesInitialized","isEditorReady","useSelect","select","__unstableIsEditorReady","editorStore","getMetaBoxesPerLocation","_areMetaBoxesInitialized","editPostStore","hasMetaBoxes","length","useEffect","dispatch","initializeMetaBoxes","_react","createElement","Fragment","map","id","default","key"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\tconst hasMetaBoxes = !! metaBoxes?.length;\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && hasMetaBoxes && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, hasMetaBoxes, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAKA;AACA;AACA;;AAKe,SAASO,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC,SAAS;IAAEC,uBAAuB;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EACpEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACzD,MAAM;MACLC,uBAAuB;MACvBN,uBAAuB,EAAEO;IAC1B,CAAC,GAAGJ,MAAM,CAAEK,YAAc,CAAC;IAC3B,OAAO;MACNT,SAAS,EAAEO,uBAAuB,CAAEV,QAAS,CAAC;MAC9CI,uBAAuB,EAAEO,wBAAwB,CAAC,CAAC;MACnDN,aAAa,EAAEG,uBAAuB,CAAC;IACxC,CAAC;EACF,CAAC,EACD,CAAER,QAAQ,CACX,CAAC;EAED,MAAMa,YAAY,GAAG,CAAC,CAAEV,SAAS,EAAEW,MAAM;;EAEzC;EACA;EACA;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKV,aAAa,IAAIQ,YAAY,IAAI,CAAET,uBAAuB,EAAG;MACjEH,QAAQ,CAACe,QAAQ,CAAEJ,YAAc,CAAC,CAACK,mBAAmB,CAAC,CAAC;IACzD;EACD,CAAC,EAAE,CAAEZ,aAAa,EAAEQ,YAAY,EAAET,uBAAuB,CAAG,CAAC;EAE7D,IAAK,CAAEA,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAc,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACG,CAAEjB,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGkB,GAAG,CAAE,CAAE;IAAEC;EAAG,CAAC,KAClC,IAAAJ,MAAA,CAAAC,aAAA,EAACtB,kBAAA,CAAA0B,OAAiB;IAACC,GAAG,EAAGF,EAAI;IAACA,EAAE,EAAGA;EAAI,CAAE,CACxC,CAAC,EACH,IAAAJ,MAAA,CAAAC,aAAA,EAACxB,cAAA,CAAA4B,OAAa;IAACvB,QAAQ,EAAGA;EAAU,CAAE,CACrC,CAAC;AAEL"}
|
|
@@ -12,12 +12,20 @@ var _i18n = require("@wordpress/i18n");
|
|
|
12
12
|
var _components = require("@wordpress/components");
|
|
13
13
|
var _data = require("@wordpress/data");
|
|
14
14
|
var _editor = require("@wordpress/editor");
|
|
15
|
-
var
|
|
15
|
+
var _preferences = require("@wordpress/preferences");
|
|
16
16
|
var _url = require("@wordpress/url");
|
|
17
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
17
18
|
/**
|
|
18
19
|
* WordPress dependencies
|
|
19
20
|
*/
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const {
|
|
27
|
+
PreferenceBaseOption
|
|
28
|
+
} = (0, _lockUnlock.unlock)(_preferences.privateApis);
|
|
21
29
|
function submitCustomFieldsForm() {
|
|
22
30
|
const customFieldsForm = document.getElementById('toggle-custom-fields-form');
|
|
23
31
|
|
|
@@ -47,7 +55,7 @@ function EnableCustomFieldsOption({
|
|
|
47
55
|
areCustomFieldsEnabled
|
|
48
56
|
}) {
|
|
49
57
|
const [isChecked, setIsChecked] = (0, _element.useState)(areCustomFieldsEnabled);
|
|
50
|
-
return (0, _react.createElement)(
|
|
58
|
+
return (0, _react.createElement)(PreferenceBaseOption, {
|
|
51
59
|
label: label,
|
|
52
60
|
isChecked: isChecked,
|
|
53
61
|
onChange: setIsChecked
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","_react","createElement","Fragment","className","__","Button","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","_default","withSelect","select","editorStore","getEditorSettings","enableCustomFields","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAEQ;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,SAASC,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,cAAc,CAC/C,2BACD,CAAC;;EAED;EACAF,gBAAgB,CACdG,aAAa,CAAE,2BAA4B,CAAC,CAC5CC,YAAY,CAAE,OAAO,EAAE,IAAAC,0BAAqB,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAE,CAAC;EAExER,gBAAgB,CAACS,MAAM,CAAC,CAAC;AAC1B;AAEO,SAASC,wBAAwBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC1D,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA;IAAGE,SAAS,EAAC;EAAiE,GAC3E,IAAAC,QAAE,EACH,8FACD,CACE,CAAC,EACJ,IAAAJ,MAAA,CAAAC,aAAA,EAAC1B,WAAA,CAAA8B,MAAM;IACNF,SAAS,EAAC,gEAAgE;IAC1EG,OAAO,EAAC,WAAW;IACnBC,MAAM,EAAGV,WAAa;IACtBW,QAAQ,EAAGX,WAAa;IACxBY,OAAO,EAAGA,CAAA,KAAM;MACfX,cAAc,CAAE,IAAK,CAAC;MACtBd,sBAAsB,CAAC,CAAC;IACzB;EAAG,GAEDY,UAAU,GACT,IAAAQ,QAAE,EAAE,oBAAqB,CAAC,GAC1B,IAAAA,QAAE,EAAE,oBAAqB,CACrB,CACP,CAAC;AAEL;AAEO,SAASM,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAG,IAAAf,iBAAQ,EAAEa,sBAAuB,CAAC;EAEtE,OACC,IAAAZ,MAAA,CAAAC,aAAA,EAACpB,oBAAoB;IACpB8B,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD;EAAc,GAEvBD,SAAS,KAAKD,sBAAsB,IACrC,IAAAZ,MAAA,CAAAC,aAAA,EAACN,wBAAwB;IAACC,UAAU,EAAGiB;EAAW,CAAE,CAEhC,CAAC;AAEzB;AAAC,IAAAG,QAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC1CN,sBAAsB,EACrB,CAAC,CAAEM,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAEX,wBAAyB,CAAC;AAAAY,OAAA,CAAAC,OAAA,GAAAP,QAAA"}
|
|
@@ -6,11 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _compose = require("@wordpress/compose");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
|
-
var _interface = require("@wordpress/interface");
|
|
10
9
|
var _editor = require("@wordpress/editor");
|
|
10
|
+
var _preferences = require("@wordpress/preferences");
|
|
11
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
11
12
|
/**
|
|
12
13
|
* WordPress dependencies
|
|
13
14
|
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
PreferenceBaseOption
|
|
22
|
+
} = (0, _lockUnlock.unlock)(_preferences.privateApis);
|
|
14
23
|
var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
|
|
15
24
|
panelName
|
|
16
25
|
}) => {
|
|
@@ -28,6 +37,6 @@ var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
|
|
|
28
37
|
panelName
|
|
29
38
|
}) => ({
|
|
30
39
|
onChange: () => dispatch(_editor.store).toggleEditorPanelEnabled(panelName)
|
|
31
|
-
})))(
|
|
40
|
+
})))(PreferenceBaseOption);
|
|
32
41
|
exports.default = _default;
|
|
33
42
|
//# sourceMappingURL=enable-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_editor","_preferences","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","_default","compose","withSelect","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","editorStore","isRemoved","isChecked","ifCondition","withDispatch","dispatch","onChange","toggleEditorPanelEnabled","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( PreferenceBaseOption );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAAC,IAAAC,QAAA,GAEnD,IAAAC,gBAAO,EACrB,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAEI,aAAY,CAAC;EACtB,OAAO;IACNC,SAAS,EAAEF,oBAAoB,CAAEF,SAAU,CAAC;IAC5CK,SAAS,EAAEJ,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACH,IAAAM,oBAAW,EAAE,CAAE;EAAEF;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/C,IAAAG,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAER;AAAU,CAAC,MAAQ;EAC9CS,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEL,aAAY,CAAC,CAACO,wBAAwB,CAAEV,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEP,oBAAqB,CAAC;AAAAkB,OAAA,CAAAC,OAAA,GAAAhB,QAAA"}
|
|
@@ -8,10 +8,19 @@ var _compose = require("@wordpress/compose");
|
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _viewport = require("@wordpress/viewport");
|
|
10
10
|
var _editor = require("@wordpress/editor");
|
|
11
|
-
var
|
|
11
|
+
var _preferences = require("@wordpress/preferences");
|
|
12
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
12
13
|
/**
|
|
13
14
|
* WordPress dependencies
|
|
14
15
|
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
PreferenceBaseOption
|
|
23
|
+
} = (0, _lockUnlock.unlock)(_preferences.privateApis);
|
|
15
24
|
var _default = (0, _compose.compose)((0, _data.withSelect)(select => ({
|
|
16
25
|
isChecked: select(_editor.store).isPublishSidebarEnabled()
|
|
17
26
|
})), (0, _data.withDispatch)(dispatch => {
|
|
@@ -25,6 +34,6 @@ var _default = (0, _compose.compose)((0, _data.withSelect)(select => ({
|
|
|
25
34
|
}),
|
|
26
35
|
// In < medium viewports we override this option and always show the publish sidebar.
|
|
27
36
|
// See the edit-post's header component for the specific logic.
|
|
28
|
-
(0, _viewport.ifViewportMatches)('medium'))(
|
|
37
|
+
(0, _viewport.ifViewportMatches)('medium'))(PreferenceBaseOption);
|
|
29
38
|
exports.default = _default;
|
|
30
39
|
//# sourceMappingURL=enable-publish-sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_viewport","_editor","_preferences","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","_default","compose","withSelect","select","isChecked","editorStore","isPublishSidebarEnabled","withDispatch","dispatch","enablePublishSidebar","disablePublishSidebar","onChange","isEnabled","ifViewportMatches","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-publish-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ifViewportMatches } from '@wordpress/viewport';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\tisChecked: select( editorStore ).isPublishSidebarEnabled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { enablePublishSidebar, disablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonChange: ( isEnabled ) =>\n\t\t\t\tisEnabled ? enablePublishSidebar() : disablePublishSidebar(),\n\t\t};\n\t} ),\n\t// In < medium viewports we override this option and always show the publish sidebar.\n\t// See the edit-post's header component for the specific logic.\n\tifViewportMatches( 'medium' )\n)( PreferenceBaseOption );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEM;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAAC,IAAAC,QAAA,GAEnD,IAAAC,gBAAO,EACrB,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC3BC,SAAS,EAAED,MAAM,CAAEE,aAAY,CAAC,CAACC,uBAAuB,CAAC;AAC1D,CAAC,CAAG,CAAC,EACL,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,oBAAoB;IAAEC;EAAsB,CAAC,GACpDF,QAAQ,CAAEH,aAAY,CAAC;EACxB,OAAO;IACNM,QAAQ,EAAIC,SAAS,IACpBA,SAAS,GAAGH,oBAAoB,CAAC,CAAC,GAAGC,qBAAqB,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACA,IAAAG,2BAAiB,EAAE,QAAS,CAC7B,CAAC,CAAEhB,oBAAqB,CAAC;AAAAiB,OAAA,CAAAC,OAAA,GAAAf,QAAA"}
|
|
@@ -10,14 +10,12 @@ var _react = require("react");
|
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _compose = require("@wordpress/compose");
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
|
-
var _editor = require("@wordpress/editor");
|
|
15
13
|
var _interface = require("@wordpress/interface");
|
|
16
14
|
var _preferences = require("@wordpress/preferences");
|
|
17
|
-
var
|
|
15
|
+
var _editor = require("@wordpress/editor");
|
|
16
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
18
17
|
var _metaBoxesSection = _interopRequireDefault(require("./meta-boxes-section"));
|
|
19
|
-
var
|
|
20
|
-
var _blockManager = _interopRequireDefault(require("../block-manager"));
|
|
18
|
+
var _enablePublishSidebar = _interopRequireDefault(require("./enable-publish-sidebar"));
|
|
21
19
|
/**
|
|
22
20
|
* WordPress dependencies
|
|
23
21
|
*/
|
|
@@ -26,6 +24,13 @@ var _blockManager = _interopRequireDefault(require("../block-manager"));
|
|
|
26
24
|
* Internal dependencies
|
|
27
25
|
*/
|
|
28
26
|
|
|
27
|
+
const {
|
|
28
|
+
PreferencesModalSection,
|
|
29
|
+
PreferenceToggleControl
|
|
30
|
+
} = (0, _lockUnlock.unlock)(_preferences.privateApis);
|
|
31
|
+
const {
|
|
32
|
+
PreferencesModal
|
|
33
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
29
34
|
const PREFERENCES_MODAL_NAME = 'edit-post/preferences';
|
|
30
35
|
exports.PREFERENCES_MODAL_NAME = PREFERENCES_MODAL_NAME;
|
|
31
36
|
function EditPostPreferencesModal() {
|
|
@@ -33,160 +38,37 @@ function EditPostPreferencesModal() {
|
|
|
33
38
|
const {
|
|
34
39
|
closeModal
|
|
35
40
|
} = (0, _data.useDispatch)(_interface.store);
|
|
36
|
-
const [isModalActive, showBlockBreadcrumbsOption] = (0, _data.useSelect)(select => {
|
|
37
|
-
const {
|
|
38
|
-
getEditorSettings
|
|
39
|
-
} = select(_editor.store);
|
|
40
|
-
const {
|
|
41
|
-
getEditorMode
|
|
42
|
-
} = select(_store.store);
|
|
43
|
-
const {
|
|
44
|
-
get
|
|
45
|
-
} = select(_preferences.store);
|
|
46
|
-
const modalActive = select(_interface.store).isModalActive(PREFERENCES_MODAL_NAME);
|
|
47
|
-
const mode = getEditorMode();
|
|
48
|
-
const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
|
|
49
|
-
const isDistractionFreeEnabled = get('core', 'distractionFree');
|
|
50
|
-
return [modalActive, !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled && mode === 'visual', isDistractionFreeEnabled];
|
|
51
|
-
}, [isLargeViewport]);
|
|
52
|
-
const {
|
|
53
|
-
closeGeneralSidebar
|
|
54
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
55
|
-
const {
|
|
56
|
-
setIsListViewOpened,
|
|
57
|
-
setIsInserterOpened
|
|
58
|
-
} = (0, _data.useDispatch)(_editor.store);
|
|
59
41
|
const {
|
|
60
|
-
|
|
61
|
-
} = (0, _data.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
setPreference('core', 'distractionFree', false);
|
|
70
|
-
};
|
|
71
|
-
const sections = (0, _element.useMemo)(() => [{
|
|
72
|
-
name: 'general',
|
|
73
|
-
tabLabel: (0, _i18n.__)('General'),
|
|
74
|
-
content: (0, _react.createElement)(_react.Fragment, null, isLargeViewport && (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
42
|
+
isModalActive
|
|
43
|
+
} = (0, _data.useSelect)(select => {
|
|
44
|
+
const modalActive = select(_interface.store).isModalActive(PREFERENCES_MODAL_NAME);
|
|
45
|
+
return {
|
|
46
|
+
isModalActive: modalActive
|
|
47
|
+
};
|
|
48
|
+
}, []);
|
|
49
|
+
const extraSections = {
|
|
50
|
+
general: (0, _react.createElement)(_react.Fragment, null, isLargeViewport && (0, _react.createElement)(PreferencesModalSection, {
|
|
75
51
|
title: (0, _i18n.__)('Publishing')
|
|
76
|
-
}, (0, _react.createElement)(
|
|
52
|
+
}, (0, _react.createElement)(_enablePublishSidebar.default, {
|
|
77
53
|
help: (0, _i18n.__)('Review settings, such as visibility and tags.'),
|
|
78
54
|
label: (0, _i18n.__)('Enable pre-publish checks')
|
|
79
|
-
})), (0, _react.createElement)(
|
|
80
|
-
title: (0, _i18n.__)('Interface')
|
|
81
|
-
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
82
|
-
scope: "core",
|
|
83
|
-
featureName: "showListViewByDefault",
|
|
84
|
-
help: (0, _i18n.__)('Opens the block list view sidebar by default.'),
|
|
85
|
-
label: (0, _i18n.__)('Always open list view')
|
|
86
|
-
}), showBlockBreadcrumbsOption && (0, _react.createElement)(_options.EnableFeature, {
|
|
87
|
-
scope: "core",
|
|
88
|
-
featureName: "showBlockBreadcrumbs",
|
|
89
|
-
help: (0, _i18n.__)('Display the block hierarchy trail at the bottom of the editor.'),
|
|
90
|
-
label: (0, _i18n.__)('Show block breadcrumbs')
|
|
91
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
92
|
-
scope: "core",
|
|
93
|
-
featureName: "allowRightClickOverrides",
|
|
94
|
-
help: (0, _i18n.__)('Allows contextual list view menus via right-click, overriding browser defaults.'),
|
|
95
|
-
label: (0, _i18n.__)('Allow right-click contextual menus')
|
|
96
|
-
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
97
|
-
title: (0, _i18n.__)('Document settings'),
|
|
98
|
-
description: (0, _i18n.__)('Select what settings are shown in the document panel.')
|
|
99
|
-
}, (0, _react.createElement)(_options.EnablePluginDocumentSettingPanelOption.Slot, null), (0, _react.createElement)(_editor.PostTaxonomies, {
|
|
100
|
-
taxonomyWrapper: (content, taxonomy) => (0, _react.createElement)(_options.EnablePanelOption, {
|
|
101
|
-
label: taxonomy.labels.menu_name,
|
|
102
|
-
panelName: `taxonomy-panel-${taxonomy.slug}`
|
|
103
|
-
})
|
|
104
|
-
}), (0, _react.createElement)(_editor.PostFeaturedImageCheck, null, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
105
|
-
label: (0, _i18n.__)('Featured image'),
|
|
106
|
-
panelName: "featured-image"
|
|
107
|
-
})), (0, _react.createElement)(_editor.PostExcerptCheck, null, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
108
|
-
label: (0, _i18n.__)('Excerpt'),
|
|
109
|
-
panelName: "post-excerpt"
|
|
110
|
-
})), (0, _react.createElement)(_editor.PostTypeSupportCheck, {
|
|
111
|
-
supportKeys: ['comments', 'trackbacks']
|
|
112
|
-
}, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
113
|
-
label: (0, _i18n.__)('Discussion'),
|
|
114
|
-
panelName: "discussion-panel"
|
|
115
|
-
})), (0, _react.createElement)(_editor.PageAttributesCheck, null, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
116
|
-
label: (0, _i18n.__)('Page attributes'),
|
|
117
|
-
panelName: "page-attributes"
|
|
118
|
-
}))), (0, _react.createElement)(_metaBoxesSection.default, {
|
|
55
|
+
})), (0, _react.createElement)(_metaBoxesSection.default, {
|
|
119
56
|
title: (0, _i18n.__)('Advanced')
|
|
120
|
-
}))
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
tabLabel: (0, _i18n.__)('Appearance'),
|
|
124
|
-
content: (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
125
|
-
title: (0, _i18n.__)('Appearance'),
|
|
126
|
-
description: (0, _i18n.__)('Customize the editor interface to suit your needs.')
|
|
127
|
-
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
128
|
-
scope: "core",
|
|
129
|
-
featureName: "fixedToolbar",
|
|
130
|
-
onToggle: turnOffDistractionFree,
|
|
131
|
-
help: (0, _i18n.__)('Access all block and document tools in a single place.'),
|
|
132
|
-
label: (0, _i18n.__)('Top toolbar')
|
|
133
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
134
|
-
scope: "core",
|
|
135
|
-
featureName: "distractionFree",
|
|
136
|
-
onToggle: toggleDistractionFree,
|
|
137
|
-
help: (0, _i18n.__)('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
|
|
138
|
-
label: (0, _i18n.__)('Distraction free')
|
|
139
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
140
|
-
scope: "core",
|
|
141
|
-
featureName: "focusMode",
|
|
142
|
-
help: (0, _i18n.__)('Highlights the current block and fades other content.'),
|
|
143
|
-
label: (0, _i18n.__)('Spotlight mode')
|
|
144
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
57
|
+
})),
|
|
58
|
+
appearance: (0, _react.createElement)(PreferenceToggleControl, {
|
|
59
|
+
scope: "core/edit-post",
|
|
145
60
|
featureName: "themeStyles",
|
|
146
61
|
help: (0, _i18n.__)('Make the editor look like your theme.'),
|
|
147
62
|
label: (0, _i18n.__)('Use theme styles')
|
|
148
|
-
})
|
|
149
|
-
}
|
|
150
|
-
name: 'accessibility',
|
|
151
|
-
tabLabel: (0, _i18n.__)('Accessibility'),
|
|
152
|
-
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
153
|
-
title: (0, _i18n.__)('Navigation'),
|
|
154
|
-
description: (0, _i18n.__)('Optimize the editing experience for enhanced control.')
|
|
155
|
-
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
156
|
-
scope: "core",
|
|
157
|
-
featureName: "keepCaretInsideBlock",
|
|
158
|
-
help: (0, _i18n.__)('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'),
|
|
159
|
-
label: (0, _i18n.__)('Contain text cursor inside block')
|
|
160
|
-
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
161
|
-
title: (0, _i18n.__)('Interface')
|
|
162
|
-
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
163
|
-
scope: "core",
|
|
164
|
-
featureName: "showIconLabels",
|
|
165
|
-
label: (0, _i18n.__)('Show button text labels'),
|
|
166
|
-
help: (0, _i18n.__)('Show text instead of icons on buttons across the interface.')
|
|
167
|
-
})))
|
|
168
|
-
}, {
|
|
169
|
-
name: 'blocks',
|
|
170
|
-
tabLabel: (0, _i18n.__)('Blocks'),
|
|
171
|
-
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
172
|
-
title: (0, _i18n.__)('Inserter')
|
|
173
|
-
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
174
|
-
scope: "core",
|
|
175
|
-
featureName: "mostUsedBlocks",
|
|
176
|
-
help: (0, _i18n.__)('Adds a category with the most frequently used blocks in the inserter.'),
|
|
177
|
-
label: (0, _i18n.__)('Show most used blocks')
|
|
178
|
-
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
179
|
-
title: (0, _i18n.__)('Manage block visibility'),
|
|
180
|
-
description: (0, _i18n.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
|
|
181
|
-
}, (0, _react.createElement)(_blockManager.default, null)))
|
|
182
|
-
}], [isLargeViewport, showBlockBreadcrumbsOption]);
|
|
63
|
+
})
|
|
64
|
+
};
|
|
183
65
|
if (!isModalActive) {
|
|
184
66
|
return null;
|
|
185
67
|
}
|
|
186
|
-
return (0, _react.createElement)(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
})
|
|
68
|
+
return (0, _react.createElement)(PreferencesModal, {
|
|
69
|
+
extraSections: extraSections,
|
|
70
|
+
isActive: isModalActive,
|
|
71
|
+
onClose: closeModal
|
|
72
|
+
});
|
|
191
73
|
}
|
|
192
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_compose","_data","_element","_editor","_interface","_preferences","_options","_metaBoxesSection","_interopRequireDefault","_store","_blockManager","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","showBlockBreadcrumbsOption","useSelect","select","getEditorSettings","editorStore","getEditorMode","editPostStore","get","preferencesStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","turnOffDistractionFree","sections","useMemo","name","tabLabel","__","content","_react","createElement","Fragment","PreferencesModalSection","title","EnablePublishSidebarOption","help","label","EnableFeature","scope","featureName","description","EnablePluginDocumentSettingPanelOption","Slot","PostTaxonomies","taxonomyWrapper","taxonomy","EnablePanelOption","labels","menu_name","panelName","slug","PostFeaturedImageCheck","PostExcerptCheck","PostTypeSupportCheck","supportKeys","PageAttributesCheck","default","onToggle","PreferencesModal","PreferencesModalTabs"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"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\tstore as interfaceStore,\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\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode } = select( editPostStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', '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 } = useDispatch( editPostStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\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>\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={ __( 'Enable pre-publish checks' ) }\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\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\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{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tscope=\"core\"\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'Display the block hierarchy trail 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={ __( 'Show 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\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\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'Allow right-click contextual menus'\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={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document 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 title={ __( 'Advanced' ) } />\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\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={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\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\tscope=\"core\"\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'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\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 title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\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 across the interface.'\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 title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\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'Adds a category with the most frequently used blocks in the inserter.'\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</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\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],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Prefer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AAW;IAAG,GAClD,IAAAE,MAAA,CAAAC,aAAA,EAAC1C,QAAA,CAAAiD,aAAa;MACbC,KAAK,EAAC,MAAM;MACZC,WAAW,EAAC,gBAAgB;MAC5BJ,IAAI,EAAG,IAAAR,QAAE,EACR,uEACD,CAAG;MACHS,KAAK,EAAG,IAAAT,QAAE,EAAE,uBAAwB;IAAG,CACvC,CACuB,CAAC,EAC1B,IAAAE,MAAA,CAAAC,aAAA,EAAC5C,UAAA,CAAA8C,uBAAuB;MACvBC,KAAK,EAAG,IAAAN,QAAE,EAAE,yBAA0B,CAAG;MACzCa,WAAW,EAAG,IAAAb,QAAE,EACf,yGACD;IAAG,GAEH,IAAAE,MAAA,CAAAC,aAAA,EAACtC,aAAA,CAAAgE,OAAY,MAAE,CACS,CACxB;EAEJ,CAAC,CACD,EACD,CAAE5D,eAAe,EAAEM,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACC,IAAA4B,MAAA,CAAAC,aAAA,EAAC5C,UAAA,CAAAwE,gBAAgB;IAAC5D,UAAU,EAAGA;EAAY,GAC1C,IAAA+B,MAAA,CAAAC,aAAA,EAAC5C,UAAA,CAAAyE,oBAAoB;IAACpC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_data","_interface","_preferences","_editor","_lockUnlock","_metaBoxesSection","_interopRequireDefault","_enablePublishSidebar","PreferencesModalSection","PreferenceToggleControl","unlock","preferencesPrivateApis","PreferencesModal","editorPrivateApis","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","useSelect","select","modalActive","extraSections","general","_react","createElement","Fragment","title","__","default","help","label","appearance","scope","featureName","isActive","onClose"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\n\nconst { PreferencesModalSection, PreferenceToggleControl } = unlock(\n\tpreferencesPrivateApis\n);\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst { isModalActive } = useSelect( ( select ) => {\n\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\tPREFERENCES_MODAL_NAME\n\t\t);\n\t\treturn {\n\t\t\tisModalActive: modalActive,\n\t\t};\n\t}, [] );\n\n\tconst extraSections = {\n\t\tgeneral: (\n\t\t\t<>\n\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Publishing' ) }>\n\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Enable pre-publish checks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t) }\n\t\t\t\t<MetaBoxesSection title={ __( 'Advanced' ) } />\n\t\t\t</>\n\t\t),\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal\n\t\t\textraSections={ extraSections }\n\t\t\tisActive={ isModalActive }\n\t\t\tonClose={ closeModal }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAD,sBAAA,CAAAR,OAAA;AAhBA;AACA;AACA;;AASA;AACA;AACA;;AAKA,MAAM;EAAEU,uBAAuB;EAAEC;AAAwB,CAAC,GAAG,IAAAC,kBAAM,EAClEC,wBACD,CAAC;AACD,MAAM;EAAEC;AAAiB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAEjD,MAAMC,sBAAsB,GAAG,uBAAuB;AAACC,OAAA,CAAAD,sBAAA,GAAAA,sBAAA;AAE/C,SAASE,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;EACpD,MAAM;IAAEC;EAAW,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EACpD,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAClD,MAAMC,WAAW,GAAGD,MAAM,CAAEH,gBAAe,CAAC,CAACC,aAAa,CACzDR,sBACD,CAAC;IACD,OAAO;MACNQ,aAAa,EAAEG;IAChB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,aAAa,GAAG;IACrBC,OAAO,EACN,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACGb,eAAe,IAChB,IAAAW,MAAA,CAAAC,aAAA,EAACrB,uBAAuB;MAACuB,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa;IAAG,GACpD,IAAAJ,MAAA,CAAAC,aAAA,EAACtB,qBAAA,CAAA0B,OAA0B;MAC1BC,IAAI,EAAG,IAAAF,QAAE,EACR,+CACD,CAAG;MACHG,KAAK,EAAG,IAAAH,QAAE,EAAE,2BAA4B;IAAG,CAC3C,CACuB,CACzB,EACD,IAAAJ,MAAA,CAAAC,aAAA,EAACxB,iBAAA,CAAA4B,OAAgB;MAACF,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAAE,CAC7C,CACF;IACDI,UAAU,EACT,IAAAR,MAAA,CAAAC,aAAA,EAACpB,uBAAuB;MACvB4B,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBJ,IAAI,EAAG,IAAAF,QAAE,EAAE,uCAAwC,CAAG;MACtDG,KAAK,EAAG,IAAAH,QAAE,EAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,IAAK,CAAEV,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAM,MAAA,CAAAC,aAAA,EAACjB,gBAAgB;IAChBc,aAAa,EAAGA,aAAe;IAC/Ba,QAAQ,EAAGjB,aAAe;IAC1BkB,OAAO,EAAGrB;EAAY,CACtB,CAAC;AAEJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -9,9 +10,11 @@ var _react = require("react");
|
|
|
9
10
|
var _i18n = require("@wordpress/i18n");
|
|
10
11
|
var _data = require("@wordpress/data");
|
|
11
12
|
var _editor = require("@wordpress/editor");
|
|
12
|
-
var
|
|
13
|
-
var
|
|
13
|
+
var _preferences = require("@wordpress/preferences");
|
|
14
|
+
var _enableCustomFields = _interopRequireDefault(require("./enable-custom-fields"));
|
|
15
|
+
var _enablePanel = _interopRequireDefault(require("./enable-panel"));
|
|
14
16
|
var _store = require("../../store");
|
|
17
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
15
18
|
/**
|
|
16
19
|
* WordPress dependencies
|
|
17
20
|
*/
|
|
@@ -20,6 +23,9 @@ var _store = require("../../store");
|
|
|
20
23
|
* Internal dependencies
|
|
21
24
|
*/
|
|
22
25
|
|
|
26
|
+
const {
|
|
27
|
+
PreferencesModalSection
|
|
28
|
+
} = (0, _lockUnlock.unlock)(_preferences.privateApis);
|
|
23
29
|
function MetaBoxesSection({
|
|
24
30
|
areCustomFieldsRegistered,
|
|
25
31
|
metaBoxes,
|
|
@@ -32,14 +38,14 @@ function MetaBoxesSection({
|
|
|
32
38
|
if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
|
|
33
39
|
return null;
|
|
34
40
|
}
|
|
35
|
-
return (0, _react.createElement)(
|
|
41
|
+
return (0, _react.createElement)(PreferencesModalSection, {
|
|
36
42
|
...sectionProps
|
|
37
|
-
}, areCustomFieldsRegistered && (0, _react.createElement)(
|
|
43
|
+
}, areCustomFieldsRegistered && (0, _react.createElement)(_enableCustomFields.default, {
|
|
38
44
|
label: (0, _i18n.__)('Custom fields')
|
|
39
45
|
}), thirdPartyMetaBoxes.map(({
|
|
40
46
|
id,
|
|
41
47
|
title
|
|
42
|
-
}) => (0, _react.createElement)(
|
|
48
|
+
}) => (0, _react.createElement)(_enablePanel.default, {
|
|
43
49
|
key: id,
|
|
44
50
|
label: title,
|
|
45
51
|
panelName: `meta-box-${id}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_editor","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_editor","_preferences","_enableCustomFields","_interopRequireDefault","_enablePanel","_store","_lockUnlock","PreferencesModalSection","unlock","preferencesPrivateApis","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","_react","createElement","default","label","__","map","title","key","panelName","_default","withSelect","select","getEditorSettings","editorStore","getAllMetaBoxes","editPostStore","enableCustomFields","undefined","exports"],"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,YAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAdA;AACA;AACA;;AAMA;AACA;AACA;;AAMA,MAAM;EAAES;AAAwB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE7D,SAASC,gBAAgBA,CAAE;EACjCC,yBAAyB;EACzBC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAMC,mBAAmB,GAAGF,SAAS,CAACG,MAAM,CAC3C,CAAE;IAAEC;EAAG,CAAC,KAAMA,EAAE,KAAK,YACtB,CAAC;EAED,IAAK,CAAEL,yBAAyB,IAAIG,mBAAmB,CAACG,MAAM,KAAK,CAAC,EAAG;IACtE,OAAO,IAAI;EACZ;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACZ,uBAAuB;IAAA,GAAMM;EAAY,GACvCF,yBAAyB,IAC1B,IAAAO,MAAA,CAAAC,aAAA,EAACjB,mBAAA,CAAAkB,OAAwB;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAAE,CAC3D,EACCR,mBAAmB,CAACS,GAAG,CAAE,CAAE;IAAEP,EAAE;IAAEQ;EAAM,CAAC,KACzC,IAAAN,MAAA,CAAAC,aAAA,EAAC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