@wordpress/edit-post 7.15.0 → 7.16.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 +2 -0
- package/build/components/header/{document-title → document-actions}/index.js +10 -11
- package/build/components/header/document-actions/index.js.map +1 -0
- package/build/components/header/header-toolbar/index.native.js +2 -1
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +3 -3
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +23 -4
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/layout/index.js +38 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +2 -2
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +20 -20
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/editor.js +2 -39
- package/build/editor.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +61 -4
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build-module/components/header/{document-title → document-actions}/index.js +10 -11
- package/build-module/components/header/document-actions/index.js.map +1 -0
- package/build-module/components/header/header-toolbar/index.native.js +2 -1
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +3 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +23 -4
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/layout/index.js +38 -6
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -3
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +21 -19
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/editor.js +2 -38
- package/build-module/editor.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +60 -5
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +21 -18
- package/build-style/style.css +21 -18
- package/package.json +32 -32
- package/src/components/header/{document-title → document-actions}/index.js +22 -23
- package/src/components/header/{document-title → document-actions}/style.scss +25 -22
- package/src/components/header/header-toolbar/index.native.js +1 -0
- package/src/components/header/header-toolbar/style.scss +4 -0
- package/src/components/header/index.js +3 -3
- package/src/components/header/mode-switcher/index.js +23 -4
- package/src/components/header/style.scss +1 -1
- package/src/components/layout/index.js +47 -2
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +5 -2
- package/src/components/preferences-modal/test/index.js +4 -4
- package/src/components/secondary-sidebar/list-view-sidebar.js +3 -3
- package/src/components/sidebar/discussion-panel/index.js +15 -20
- package/src/editor.js +2 -47
- package/src/hooks/commands/use-common-commands.js +81 -15
- package/src/index.js +5 -1
- package/src/style.scss +1 -1
- package/src/test/editor.native.js +4 -3
- package/build/components/header/document-title/index.js.map +0 -1
- package/build-module/components/header/document-title/index.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -30,7 +30,7 @@ var _store = require("../../../store");
|
|
|
30
30
|
/**
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
|
-
function
|
|
33
|
+
function DocumentActions() {
|
|
34
34
|
const {
|
|
35
35
|
template,
|
|
36
36
|
isEditing
|
|
@@ -70,19 +70,19 @@ function DocumentTitle() {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
return (0, _element.createElement)("div", {
|
|
73
|
-
className: "edit-post-document-
|
|
74
|
-
}, (0, _element.createElement)("span", {
|
|
75
|
-
className: "edit-post-document-title__left"
|
|
73
|
+
className: "edit-post-document-actions"
|
|
76
74
|
}, (0, _element.createElement)(_components.Button, {
|
|
75
|
+
className: "edit-post-document-actions__back",
|
|
77
76
|
onClick: () => {
|
|
78
77
|
clearSelectedBlock();
|
|
79
78
|
setIsEditingTemplate(false);
|
|
80
79
|
},
|
|
81
80
|
icon: (0, _i18n.isRTL)() ? _icons.chevronRightSmall : _icons.chevronLeftSmall
|
|
82
|
-
}, (0, _i18n.__)('Back'))
|
|
83
|
-
className: "edit-post-document-
|
|
81
|
+
}, (0, _i18n.__)('Back')), (0, _element.createElement)(_components.Button, {
|
|
82
|
+
className: "edit-post-document-actions__command",
|
|
84
83
|
onClick: () => openCommandCenter()
|
|
85
84
|
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
85
|
+
className: "edit-post-document-actions__title",
|
|
86
86
|
spacing: 1,
|
|
87
87
|
justify: "center"
|
|
88
88
|
}, (0, _element.createElement)(_blockEditor.BlockIcon, {
|
|
@@ -92,12 +92,11 @@ function DocumentTitle() {
|
|
|
92
92
|
as: "h1"
|
|
93
93
|
}, (0, _element.createElement)(_components.VisuallyHidden, {
|
|
94
94
|
as: "span"
|
|
95
|
-
}, (0, _i18n.__)('Editing template: ')), templateTitle))
|
|
96
|
-
className: "edit-post-document-
|
|
97
|
-
|
|
98
|
-
}, _keycodes.displayShortcut.primary('k')));
|
|
95
|
+
}, (0, _i18n.__)('Editing template: ')), templateTitle)), (0, _element.createElement)("span", {
|
|
96
|
+
className: "edit-post-document-actions__shortcut"
|
|
97
|
+
}, _keycodes.displayShortcut.primary('k'))));
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
var _default =
|
|
100
|
+
var _default = DocumentActions;
|
|
102
101
|
exports.default = _default;
|
|
103
102
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/document-actions/index.js"],"names":["DocumentActions","template","isEditing","select","isEditingTemplate","getEditedPostTemplate","editPostStore","_isEditing","clearSelectedBlock","blockEditorStore","setIsEditingTemplate","open","openCommandCenter","commandsStore","templateTitle","title","slug","chevronRightSmall","chevronLeftSmall","layout","displayShortcut","primary"],"mappings":";;;;;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ANtC,KAQG,cAAI,MAAJ,CARH,CADD,EAWC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,OAAO,EAAG,MAAMN,iBAAiB;AAFlC,KAIC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAG,CAFX;AAGC,IAAA,OAAO,EAAC;AAHT,KAKC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGO;AAAlB,IALD,EAMC,4BAAC,8BAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,EAAE,EAAC;AAArB,KACC,4BAAC,0BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KACG,cAAI,oBAAJ,CADH,CADD,EAIGL,aAJH,CAND,CAJD,EAiBC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGM,0BAAgBC,OAAhB,CAAyB,GAAzB,CADH,CAjBD,CAXD,CADD;AAmCA;;eAEcrB,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { BlockIcon, store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { layout, chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction DocumentActions() {\n\tconst { template, isEditing } = useSelect( ( select ) => {\n\t\tconst { isEditingTemplate, getEditedPostTemplate } =\n\t\t\tselect( editPostStore );\n\t\tconst _isEditing = isEditingTemplate();\n\n\t\treturn {\n\t\t\ttemplate: _isEditing ? getEditedPostTemplate() : null,\n\t\t\tisEditing: _isEditing,\n\t\t};\n\t}, [] );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { setIsEditingTemplate } = useDispatch( editPostStore );\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\tif ( ! isEditing || ! template ) {\n\t\treturn null;\n\t}\n\n\tlet templateTitle = __( 'Default' );\n\tif ( template?.title ) {\n\t\ttemplateTitle = template.title;\n\t} else if ( !! template ) {\n\t\ttemplateTitle = template.slug;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-post-document-actions\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-document-actions__back\"\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\tsetIsEditingTemplate( false );\n\t\t\t\t} }\n\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t>\n\t\t\t\t{ __( 'Back' ) }\n\t\t\t</Button>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-document-actions__command\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-post-document-actions__title\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t>\n\t\t\t\t\t<BlockIcon icon={ layout } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t{ __( 'Editing template: ' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t{ templateTitle }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t\t<span className=\"edit-post-document-actions__shortcut\">\n\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nexport default DocumentActions;\n"]}
|
|
@@ -101,7 +101,8 @@ function HeaderToolbar({
|
|
|
101
101
|
|
|
102
102
|
const onInsertBlock = (0, _element.useCallback)(blockType => () => {
|
|
103
103
|
insertBlock((0, _blocks.createBlock)(blockType), undefined, undefined, true, {
|
|
104
|
-
source: 'inserter_menu'
|
|
104
|
+
source: 'inserter_menu',
|
|
105
|
+
inserterMethod: 'quick-inserter'
|
|
105
106
|
});
|
|
106
107
|
}, [insertBlock]);
|
|
107
108
|
const renderMediaButtons = (0, _element.createElement)(_components.ToolbarGroup, null, (0, _element.createElement)(_components.ToolbarButton, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","containerStyle","styles","borderTopWidth","StyleSheet","hairlineWidth","onUndoSubscription","onRedoSubscription","remove","scrollViewRef","scrollToStart","Platform","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","blockType","undefined","source","renderMediaButtons","imageIcon","hint","videoIcon","galleryIcon","audioIcon","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","keyboardClose","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","blockEditorStore","getEditorSettings","editorStore","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAOA;;AACA;;AACA;;AAUA;;AACA;;AAvCA;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;AAIA,MAAMA,WAAW,GAAG;AACnBC,EAAAA,YAAY,EAAE;AAAEC,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,MAAM,EAAE;AAApB,GADK;AAEnBC,EAAAA,aAAa,EAAE,CAFI;AAGnBC,EAAAA,YAAY,EAA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ADT;AAEA,QAAM;AAAEa,IAAAA;AAAF,MAA+BF,QAAQ,CAAET,aAAF,CAA7C;AAEA,SAAO;AACN/C,IAAAA,IAAI,EAAEwD,QAAQ,CAAET,aAAF,CAAR,CAAwB/C,IADxB;AAENC,IAAAA,IAAI,EAAEuD,QAAQ,CAAET,aAAF,CAAR,CAAwB9C,IAFxB;;AAGNI,IAAAA,cAAc,GAAG;AAChBoD,MAAAA,kBAAkB;AAClBC,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA,KANK;;AAONtD,IAAAA;AAPM,GAAP;AASA,CAdD,CA1BuB,EAyCvB,iCAAmB;AAAEuD,EAAAA,eAAe,EAAE;AAAnB,CAAnB,CAzCuB,CAAT,EA0CV9D,aA1CU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal={ true }\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","containerStyle","styles","borderTopWidth","StyleSheet","hairlineWidth","onUndoSubscription","onRedoSubscription","remove","scrollViewRef","scrollToStart","Platform","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","blockType","undefined","source","inserterMethod","renderMediaButtons","imageIcon","hint","videoIcon","galleryIcon","audioIcon","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","keyboardClose","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","blockEditorStore","getEditorSettings","editorStore","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAOA;;AACA;;AACA;;AAUA;;AACA;;AAvCA;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;AAIA,MAAMA,WAAW,GAAG;AACnBC,EAAAA,YAAY,EAAE;AAAEC,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,MAAM,EAAE;AAApB,GADK;AAEnBC,EAAAA,aAAa,EAAE,CAFI;AAGnBC,EAAAA,YAAY,EAAE,CAHK;AAInBC,EAAAA,SAAS,EAAE;AAJQ,CAApB;;AAOA,SAASC,aAAT,CAAwB;AACvBC,EAAAA,OADuB;AAEvBC,EAAAA,OAFuB;AAGvBC,EAAAA,IAHuB;AAIvBC,EAAAA,IAJuB;AAKvBC,EAAAA,YALuB;AAMvBC,EAAAA,sBANuB;AAOvBC,EAAAA,WAPuB;AAQvBC,EAAAA,cARuB;AASvBC,EAAAA,KATuB;AAUvBC,EAAAA;AAVuB,CAAxB,EAWI;AACH,QAAMC,aAAa,GAAG,sBAAtB;AAEA,QAAMC,cAAc,GAAG,CACtB,2CACCC,eAAQ,2BAAR,CADD,EAECA,eAAQ,iCAAR,CAFD,CADsB,EAKtB;AAAEC,IAAAA,cAAc,EAAEC,wBAAWC;AAA7B,GALsB,CAAvB;AAQA,0BAAW,MAAM;AAChB,UAAMC,kBAAkB,GAAG,+CAAwBb,IAAxB,CAA3B;AACA,UAAMc,kBAAkB,GAAG,+CAAwBf,IAAxB,CAA3B;AAEA,WAAO,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BE,aAAtB,EADH;AAENnD,IAAAA,OAAO,EAAE0C,MAAM,CAAEO,aAAF,CAAN,CAAsBG,aAAtB,EAFH;AAGN;AACAjD,IAAAA,YAAY,EACXuC,MAAM,CAAEW,YAAF,CAAN,CAAwBC,aAAxB,OAA4C,QAA5C,IACAN,iBAAiB,GAAGO,kBADpB,IAEAV,gBAAgB,CACfF,oBAAoB,CAAEC,oBAAoB,EAAtB,CADL,CAPX;AAUNY,IAAAA,iBAAiB,EAChBd,MAAM,CAAEW,YAAF,CAAN,CAAwBC,aAAxB,OAA4C,MAXvC;AAYN/C,IAAAA,KAAK,EAAEmC,MAAM,CAAEK,kBAAF,CAAN,CAA2BU,WAA3B,GAAyClD,KAZ1C;AAaNC,IAAAA,iBAAiB,EAAE,CAAE0C;AAbf,GAAP;AAeA,CAxBD,CADuB,EA0BvB,wBAAgBQ,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,kBAAF;AAAsBtD,IAAAA;AAAtB,MACLqD,QAAQ,CAAEX,kBAAF,CADT;AAEA,QAAM;AAAEa,IAAAA;AAAF,MAA+BF,QAAQ,CAAET,aAAF,CAA7C;AAEA,SAAO;AACNhD,IAAAA,IAAI,EAAEyD,QAAQ,CAAET,aAAF,CAAR,CAAwBhD,IADxB;AAENC,IAAAA,IAAI,EAAEwD,QAAQ,CAAET,aAAF,CAAR,CAAwB/C,IAFxB;;AAGNI,IAAAA,cAAc,GAAG;AAChBqD,MAAAA,kBAAkB;AAClBC,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA,KANK;;AAONvD,IAAAA;AAPM,GAAP;AASA,CAdD,CA1BuB,EAyCvB,iCAAmB;AAAEwD,EAAAA,eAAe,EAAE;AAAnB,CAAnB,CAzCuB,CAAT,EA0CV/D,aA1CU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal={ true }\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"]}
|
|
@@ -35,7 +35,7 @@ var _mainDashboardButton = _interopRequireDefault(require("./main-dashboard-butt
|
|
|
35
35
|
|
|
36
36
|
var _store = require("../../store");
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _documentActions = _interopRequireDefault(require("./document-actions"));
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* WordPress dependencies
|
|
@@ -100,8 +100,8 @@ function Header({
|
|
|
100
100
|
},
|
|
101
101
|
className: "edit-post-header__toolbar"
|
|
102
102
|
}, (0, _element.createElement)(_headerToolbar.default, null), (0, _element.createElement)("div", {
|
|
103
|
-
className: "edit-post-
|
|
104
|
-
}, (0, _element.createElement)(
|
|
103
|
+
className: "edit-post-header__center"
|
|
104
|
+
}, (0, _element.createElement)(_documentActions.default, null))), (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
105
105
|
variants: slideY,
|
|
106
106
|
transition: {
|
|
107
107
|
type: 'tween',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["slideY","hidden","y","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isLargeViewport","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","select","editPostStore","hasMetaBoxes","isFeatureActive"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAOA;AACA;AACA;AAWA,MAAM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BAAC,4BAAD;AAAqB,IAAA,WAAW;AAAhC,IAJD,CADD,CADD,EASC,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,QAAQ,EAAGN,MADZ;AAEC,IAAA,UAAU,EAAG;AAAEK,MAAAA,IAAI,EAAE,OAAR;AAAiBC,MAAAA,KAAK,EAAE;AAAxB,KAFd;AAGC,IAAA,SAAS,EAAC;AAHX,KAKC,4BAAC,sBAAD,OALD,EAMC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["slideY","hidden","y","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isLargeViewport","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","select","editPostStore","hasMetaBoxes","isFeatureActive"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAOA;AACA;AACA;AAWA,MAAMA,MAAM,GAAG;AACdC,EAAAA,MAAM,EAAE;AAAEC,IAAAA,CAAC,EAAE;AAAL,GADM;AAEdC,EAAAA,KAAK,EAAE;AAAED,IAAAA,CAAC,EAAE,CAAL;AAAQE,IAAAA,UAAU,EAAE;AAAEC,MAAAA,IAAI,EAAE,OAAR;AAAiBC,MAAAA,KAAK,EAAE;AAAxB;AAApB;AAFO,CAAf;AAKA,MAAMC,MAAM,GAAG;AACdN,EAAAA,MAAM,EAAE;AAAEO,IAAAA,CAAC,EAAE;AAAL,GADM;AAEdL,EAAAA,KAAK,EAAE;AAAEK,IAAAA,CAAC,EAAE,CAAL;AAAQJ,IAAAA,UAAU,EAAE;AAAEC,MAAAA,IAAI,EAAE,OAAR;AAAiBC,MAAAA,KAAK,EAAE;AAAxB;AAApB;AAFO,CAAf;;AAKA,SAASG,MAAT,CAAiB;AAAEC,EAAAA;AAAF,CAAjB,EAAsD;AAC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AACA;AACA;AACA,8BAAC,sBAAD;AACC,IAAA,YAAY,EAAGD,kBADhB;AAEC,IAAA,cAAc,EAAGE;AAFlB,IAXF,EAgBC,4BAAC,sBAAD,OAhBD,EAiBC,4BAAC,yBAAD;AAAmB,IAAA,mBAAmB,EAAGF;AAAzC,IAjBD,EAkBC,4BAAC,iBAAD,OAlBD,EAmBC,4BAAC,kCAAD;AACC,IAAA,YAAY,EAAGA,kBADhB;AAEC,IAAA,8BAA8B,EAC7BF;AAHF,IAnBD,EAyBG,CAAEC,eAAe,IAAI,CAAEG,cAAvB,KACD,qDACC,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IADD,EAEC,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGA;AAA3B,IAFD,CA1BF,EA+BGA,cAAc,IAAI,CAAEH,eAApB,IACD,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGG;AAA3B,IAhCF,CAnBD,CADD;AAyDA;;eAEcL,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport ViewLink from '../view-link';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport DocumentActions from './document-actions';\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { hasActiveMetaboxes, isPublishSidebarOpened, showIconLabels } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\tisPublishSidebarOpened:\n\t\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\t\tshowIconLabels:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\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<HeaderToolbar />\n\t\t\t\t<div className=\"edit-post-header__center\">\n\t\t\t\t\t<DocumentActions />\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\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<ViewLink />\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{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"]}
|
|
@@ -62,12 +62,31 @@ function ModeSwitcher() {
|
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
let selectedMode = mode;
|
|
66
|
+
|
|
67
|
+
if (!isRichEditingEnabled && mode === 'visual') {
|
|
68
|
+
selectedMode = 'text';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!isCodeEditingEnabled && mode === 'text') {
|
|
72
|
+
selectedMode = 'visual';
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
const choices = MODES.map(choice => {
|
|
70
|
-
if (choice.value
|
|
76
|
+
if (!isCodeEditingEnabled && choice.value === 'text') {
|
|
77
|
+
choice = { ...choice,
|
|
78
|
+
disabled: true
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!isRichEditingEnabled && choice.value === 'visual') {
|
|
83
|
+
choice = { ...choice,
|
|
84
|
+
disabled: true,
|
|
85
|
+
info: (0, _i18n.__)('You can enable the visual editor in your profile settings.')
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (choice.value !== selectedMode && !choice.disabled) {
|
|
71
90
|
return { ...choice,
|
|
72
91
|
shortcut
|
|
73
92
|
};
|
|
@@ -79,7 +98,7 @@ function ModeSwitcher() {
|
|
|
79
98
|
label: (0, _i18n.__)('Editor')
|
|
80
99
|
}, (0, _element.createElement)(_components.MenuItemsChoice, {
|
|
81
100
|
choices: choices,
|
|
82
|
-
value:
|
|
101
|
+
value: selectedMode,
|
|
83
102
|
onSelect: switchEditorMode
|
|
84
103
|
}));
|
|
85
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"names":["MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","choices","map","choice"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAK,GAAG,CACb;AACCC,EAAAA,KAAK,EAAE,QADR;AAECC,EAAAA,KAAK,EAAE,cAAI,eAAJ;AAFR,CADa,EAKb;AACCD,EAAAA,KAAK,EAAE,MADR;AAECC,EAAAA,KAAK,EAAE,cAAI,aAAJ;AAFR,CALa,CAAd;;AAWA,SAASC,YAAT,GAAwB;AACvB,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,oBAHK;AAILC,IAAAA,iBAJK;AAKLC,IAAAA;AALK,MAMF,qBACDC,MAAF,KAAgB;AACfL,IAAAA,QAAQ,EAAEK,MAAM,CACfC,wBADe,CAAN,CAERC,yBAFQ,CAEmB,4BAFnB,CADK;AAIfN,IAAAA,oBAAoB,EACnBI,MAAM,CAAEG,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CC,kBAL5B;AAMfR,IAAAA,oBAAoB,EACnBG,MAAM,CAAEG,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CE,kBAP5B;AAQfR,IAAAA,iBAAiB,EAAEE,MAAM,CAAEO,YAAF,CAAN,CAAwBT,iBAAxB,EARJ;AASfC,IAAAA,IAAI,EAAEC,MAAM,CAAEO,YAAF,CAAN,CAAwBC,aAAxB;AATS,GAAhB,CADG,EAYH,EAZG,CANJ;AAoBA,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaF,YAAb,CAA7B;;AAEA,MAAKT,iBAAL,EAAyB;AACxB,WAAO,IAAP;AACA;;AAED,MAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"names":["MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","selectedMode","choices","map","choice","disabled","info"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAK,GAAG,CACb;AACCC,EAAAA,KAAK,EAAE,QADR;AAECC,EAAAA,KAAK,EAAE,cAAI,eAAJ;AAFR,CADa,EAKb;AACCD,EAAAA,KAAK,EAAE,MADR;AAECC,EAAAA,KAAK,EAAE,cAAI,aAAJ;AAFR,CALa,CAAd;;AAWA,SAASC,YAAT,GAAwB;AACvB,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,oBAHK;AAILC,IAAAA,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AAGRC,QAAAA,IAAI,EAAE,cACL,4DADK;AAHE,OAAT;AAOA;;AACD,QAAKF,MAAM,CAACrB,KAAP,KAAiBkB,YAAjB,IAAiC,CAAEG,MAAM,CAACC,QAA/C,EAA0D;AACzD,aAAO,EAAE,GAAGD,MAAL;AAAalB,QAAAA;AAAb,OAAP;AACA;;AACD,WAAOkB,MAAP;AACA,GApBe,CAAhB;AAsBA,SACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,QAAJ;AAAnB,KACC,4BAAC,2BAAD;AACC,IAAA,OAAO,EAAGF,OADX;AAEC,IAAA,KAAK,EAAGD,YAFT;AAGC,IAAA,QAAQ,EAAGD;AAHZ,IADD,CADD;AASA;;eAEcf,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst {\n\t\tshortcut,\n\t\tisRichEditingEnabled,\n\t\tisCodeEditingEnabled,\n\t\tisEditingTemplate,\n\t\tmode,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-mode' ),\n\t\t\tisRichEditingEnabled:\n\t\t\t\tselect( editorStore ).getEditorSettings().richEditingEnabled,\n\t\t\tisCodeEditingEnabled:\n\t\t\t\tselect( editorStore ).getEditorSettings().codeEditingEnabled,\n\t\t\tisEditingTemplate: select( editPostStore ).isEditingTemplate(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { switchEditorMode } = useDispatch( editPostStore );\n\n\tif ( isEditingTemplate ) {\n\t\treturn null;\n\t}\n\n\tlet selectedMode = mode;\n\tif ( ! isRichEditingEnabled && mode === 'visual' ) {\n\t\tselectedMode = 'text';\n\t}\n\tif ( ! isCodeEditingEnabled && mode === 'text' ) {\n\t\tselectedMode = 'visual';\n\t}\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( ! isCodeEditingEnabled && choice.value === 'text' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t}\n\t\tif ( ! isRichEditingEnabled && choice.value === 'visual' ) {\n\t\t\tchoice = {\n\t\t\t\t...choice,\n\t\t\t\tdisabled: true,\n\t\t\t\tinfo: __(\n\t\t\t\t\t'You can enable the visual editor in your profile settings.'\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\tif ( choice.value !== selectedMode && ! choice.disabled ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={ selectedMode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"]}
|
|
@@ -61,6 +61,8 @@ var _startPageOptions = _interopRequireDefault(require("../start-page-options"))
|
|
|
61
61
|
|
|
62
62
|
var _store = require("../../store");
|
|
63
63
|
|
|
64
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
65
|
+
|
|
64
66
|
/**
|
|
65
67
|
* External dependencies
|
|
66
68
|
*/
|
|
@@ -72,6 +74,9 @@ var _store = require("../../store");
|
|
|
72
74
|
/**
|
|
73
75
|
* Internal dependencies
|
|
74
76
|
*/
|
|
77
|
+
const {
|
|
78
|
+
getLayoutStyles
|
|
79
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
75
80
|
const interfaceLabels = {
|
|
76
81
|
/* translators: accessibility text for the editor top bar landmark region. */
|
|
77
82
|
header: (0, _i18n.__)('Editor top bar'),
|
|
@@ -89,9 +94,7 @@ const interfaceLabels = {
|
|
|
89
94
|
footer: (0, _i18n.__)('Editor footer')
|
|
90
95
|
};
|
|
91
96
|
|
|
92
|
-
function Layout({
|
|
93
|
-
styles
|
|
94
|
-
}) {
|
|
97
|
+
function Layout() {
|
|
95
98
|
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
96
99
|
const isHugeViewport = (0, _compose.useViewportMatch)('huge', '>=');
|
|
97
100
|
const isLargeViewport = (0, _compose.useViewportMatch)('large');
|
|
@@ -119,14 +122,43 @@ function Layout({
|
|
|
119
122
|
isDistractionFree,
|
|
120
123
|
showBlockBreadcrumbs,
|
|
121
124
|
isTemplateMode,
|
|
122
|
-
documentLabel
|
|
125
|
+
documentLabel,
|
|
126
|
+
styles
|
|
123
127
|
} = (0, _data.useSelect)(select => {
|
|
124
128
|
const {
|
|
125
129
|
getEditorSettings,
|
|
126
130
|
getPostTypeLabel
|
|
127
131
|
} = select(_editor.store);
|
|
132
|
+
const {
|
|
133
|
+
isFeatureActive
|
|
134
|
+
} = select(_store.store);
|
|
128
135
|
const editorSettings = getEditorSettings();
|
|
129
136
|
const postTypeLabel = getPostTypeLabel();
|
|
137
|
+
const hasThemeStyles = isFeatureActive('themeStyles');
|
|
138
|
+
const themeStyles = [];
|
|
139
|
+
const presetStyles = [];
|
|
140
|
+
editorSettings.styles?.forEach(style => {
|
|
141
|
+
if (!style.__unstableType || style.__unstableType === 'theme') {
|
|
142
|
+
themeStyles.push(style);
|
|
143
|
+
} else {
|
|
144
|
+
presetStyles.push(style);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const defaultEditorStyles = [...editorSettings.defaultEditorStyles, ...presetStyles]; // If theme styles are not present or displayed, ensure that
|
|
148
|
+
// base layout styles are still present in the editor.
|
|
149
|
+
|
|
150
|
+
if (!editorSettings.disableLayoutStyles && !(hasThemeStyles && themeStyles.length)) {
|
|
151
|
+
defaultEditorStyles.push({
|
|
152
|
+
css: getLayoutStyles({
|
|
153
|
+
style: {},
|
|
154
|
+
selector: 'body',
|
|
155
|
+
hasBlockGapSupport: false,
|
|
156
|
+
hasFallbackGapSupport: true,
|
|
157
|
+
fallbackGapValue: '0.5em'
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
130
162
|
return {
|
|
131
163
|
isTemplateMode: select(_store.store).isEditingTemplate(),
|
|
132
164
|
hasFixedToolbar: select(_store.store).isFeatureActive('fixedToolbar'),
|
|
@@ -143,7 +175,8 @@ function Layout({
|
|
|
143
175
|
isDistractionFree: select(_store.store).isFeatureActive('distractionFree'),
|
|
144
176
|
showBlockBreadcrumbs: select(_store.store).isFeatureActive('showBlockBreadcrumbs'),
|
|
145
177
|
// translators: Default label for the Document in the Block Breadcrumb.
|
|
146
|
-
documentLabel: postTypeLabel || (0, _i18n._x)('Document', 'noun')
|
|
178
|
+
documentLabel: postTypeLabel || (0, _i18n._x)('Document', 'noun'),
|
|
179
|
+
styles: hasThemeStyles && themeStyles.length ? editorSettings.styles : defaultEditorStyles
|
|
147
180
|
};
|
|
148
181
|
}, []);
|
|
149
182
|
|
|
@@ -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","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":";;;;;;;;;AA+BA;;AA5BA;;AAKA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApDA;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;AAiBA,MAAMA,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,gBAAJ,CAJiB;;AAKvB;AACAC,EAAAA,OAAO,EAAE,cAAI,iBAAJ,CANc;;AAOvB;AACAC,EAAAA,OAAO,EAAE,cAAI,gBAAJ,CARc;;AASvB;AACAC,EAAAA,MAAM,EAAE,cAAI,eAAJ;AAVe,CAAxB;;AAaA,SAASC,MAAT,CAAiB;AAAEC,EAAAA;AAAF,CAAjB,EAA8B;AAC7B,QAAMC,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AACA,QAAMC,cAAc,GAAG,+BAAkB,MAAlB,EAA0B,IAA1B,CAAvB;AACA,QAAMC,eAAe,GAAG,+BAAkB,OAAlB,CAAxB;AACA,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA,mBAAtB;AAA2CC,IAAAA;AAA3C,MACL,uBAAaC,YAAb,CADD;AAEA,QAAM;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S,EAAC;AAAf,OACC,4BAAC,kBAAD;AAAW,MAAA,QAAQ,EAAC;AAApB,MADD,EAEC,4BAAC,kBAAD;AAAW,MAAA,QAAQ,EAAC;AAApB,MAFD,CATF,EAcGvB,gBAAgB,IAAIY,eAApB,IACD,4BAAC,sBAAD,OAfF,CAvCF;AA0DC,IAAA,MAAM,EACL,CAAES,iBAAF,IACA,CAAErB,gBADF,IAEAsB,oBAFA,IAGAX,oBAHA,IAIAF,IAAI,KAAK,QAJT,IAKC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAGe;AAAjC,MADD,CAhEH;AAqEC,IAAA,OAAO,EACN,4BAAC,qBAAD;AACC,MAAA,wBAAwB,EAAGqB,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEpC,gBADC;AAEXqC,MAAAA,IAAI,EAAEpC;AAFK;AAhFb,IAVD,EA+FC,4BAAC,yBAAD,OA/FD,EAgGC,4BAAC,kCAAD,OAhGD,EAiGC,4BAAC,qBAAD,OAjGD,EAkGC,4BAAC,2BAAD,OAlGD,EAmGC,4BAAC,yBAAD,OAnGD,EAoGC,4BAAC,mBAAD,CAAS,IAAT,OApGD,EAqGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGkC;AAAtB,IArGD,CADD;AAyGA;;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\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\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<EditorKeyboardShortcuts />\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<PostSyncStatusModal />\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":["getLayoutStyles","blockEditorPrivateApis","interfaceLabels","header","body","sidebar","actions","footer","Layout","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","styles","select","getEditorSettings","getPostTypeLabel","editorStore","isFeatureActive","editorSettings","postTypeLabel","hasThemeStyles","themeStyles","presetStyles","forEach","style","__unstableType","push","defaultEditorStyles","disableLayoutStyles","length","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","isEditingTemplate","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";;;;;;;;;AAkCA;;AA/BA;;AAKA;;AAWA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAxDA;AACA;AACA;;AAGA;AACA;AACA;;AA+BA;AACA;AACA;AAkBA,MAAM;AAAEA,EAAAA;AAAF,IAAsB,wBAAQC,wBAAR,CAA5B;AAEA,MAAMC,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,gBAAJ,CAJiB;;AAKvB;AACAC,EAAAA,OAAO,EAAE,cAAI,iBAAJ,CANc;;AAOvB;AACAC,EAAAA,OAAO,EAAE,cAAI,gBAAJ,CARc;;AASvB;AACAC,EAAAA,MAAM,EAAE,cAAI,eAAJ;AAVe,CAAxB;;AAaA,SAASC,MAAT,GAAkB;AACjB,QAAMC,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AACA,QAAMC,cAAc,GAAG,+BAAkB,MAAlB,EAA0B,IAA1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CAAEE,cAAzB,IACD;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,kBAAD;AAAW,MAAA,QAAQ,EAAC;AAApB,MADD,EAEC,4BAAC,kBAAD;AAAW,MAAA,QAAQ,EAAC;AAApB,MAFD,CATF,EAcGvB,gBAAgB,IAAIY,eAApB,IACD,4BAAC,sBAAD,OAfF,CAvCF;AA0DC,IAAA,MAAM,EACL,CAAES,iBAAF,IACA,CAAErB,gBADF,IAEAsB,oBAFA,IAGAX,oBAHA,IAIAF,IAAI,KAAK,QAJT,IAKC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAGe;AAAjC,MADD,CAhEH;AAqEC,IAAA,OAAO,EACN,4BAAC,qBAAD;AACC,MAAA,wBAAwB,EAAGqC,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEpD,gBADC;AAEXqD,MAAAA,IAAI,EAAEpD;AAFK;AAhFb,IAVD,EA+FC,4BAAC,yBAAD,OA/FD,EAgGC,4BAAC,kCAAD,OAhGD,EAiGC,4BAAC,qBAAD,OAjGD,EAkGC,4BAAC,2BAAD,OAlGD,EAmGC,4BAAC,yBAAD,OAnGD,EAoGC,4BAAC,mBAAD,CAAS,IAAT,OApGD,EAqGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGkD;AAAtB,IArGD,CADD;AAyGA;;eAEcnE,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\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} 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';\nimport { unlock } from '../../lock-unlock';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\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() {\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\tstyles,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\t\tconst hasThemeStyles = isFeatureActive( 'themeStyles' );\n\n\t\tconst themeStyles = [];\n\t\tconst presetStyles = [];\n\t\teditorSettings.styles?.forEach( ( style ) => {\n\t\t\tif ( ! style.__unstableType || style.__unstableType === 'theme' ) {\n\t\t\t\tthemeStyles.push( style );\n\t\t\t} else {\n\t\t\t\tpresetStyles.push( style );\n\t\t\t}\n\t\t} );\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif (\n\t\t\t! editorSettings.disableLayoutStyles &&\n\t\t\t! ( hasThemeStyles && themeStyles.length )\n\t\t) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\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\tstyles:\n\t\t\t\thasThemeStyles && themeStyles.length\n\t\t\t\t\t? editorSettings.styles\n\t\t\t\t\t: defaultEditorStyles,\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<EditorKeyboardShortcuts />\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<PostSyncStatusModal />\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"]}
|
|
@@ -137,11 +137,11 @@ function ListViewSidebar() {
|
|
|
137
137
|
selectOnMove: false,
|
|
138
138
|
tabs: [{
|
|
139
139
|
name: 'list-view',
|
|
140
|
-
title: 'List View',
|
|
140
|
+
title: (0, _i18n._x)('List View', 'Post overview'),
|
|
141
141
|
className: 'edit-post-sidebar__panel-tab'
|
|
142
142
|
}, {
|
|
143
143
|
name: 'outline',
|
|
144
|
-
title: 'Outline',
|
|
144
|
+
title: (0, _i18n._x)('Outline', 'Post overview'),
|
|
145
145
|
className: 'edit-post-sidebar__panel-tab'
|
|
146
146
|
}]
|
|
147
147
|
}, currentTab => (0, _element.createElement)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["ListViewSidebar","setIsListViewOpened","editPostStore","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","focus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","ownerDocument","activeElement","renderTabContent","tabName","closeSmall","name","title","className"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAtBA;AACA;AACA;;AAgBA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC,CADyC,CAGzC;;AACA,QAAMC,eAAe,GAAG,8BAAiB,cAAjB,CAAxB,CAJyC,CAKzC;;AACA,QAAMC,oBAAoB,GAAG,8BAA7B;AACA,QAAMC,qBAAqB,GAAG,8BAA9B;;AAEA,WAASC,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBC,gBAAlB,IAA4B,CAAEF,KAAK,CAACG,gBAAzC,EAA4D;AAC3DH,MAAAA,KAAK,CAACI,cAAN;AACAV,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD,GAdwC,CAgBzC;AACA;;;AACA,QAAM,CAAEW,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,IAAV,CAAhD,CAlByC,CAmBzC;;AACA,QAAM,CAAEC,GAAF,EAAOC,MAAP,IAAkB,uBAAU,WAAV,CAAxB,CApByC,CAsBzC;;AACA,QAAMC,UAAU,GAAG,sBAAnB,CAvByC,CAwBzC;;AACA,QAAMC,WAAW,GAAG,sBAApB,CAzByC,CA0BzC;;AACA,QAAMC,WAAW,GAAG,sBAApB,CA3ByC,CA6BzC;;AACA,QAAMC,oBAAoB,GAAG,2BAAc,CAC1Cd,qBAD0C,EAE1CF,eAF0C,EAG1Ce,WAH0C,EA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AAG,EAAGU;AAHP,OAKC,4BAAC,kBAAD;AACC,MAAA,SAAS,EAAC,yDADX;AAEC,MAAA,GAAG,EAAGZ,oBAFP;AAGC,MAAA,IAAI,EAAG8B,iBAHR;AAIC,MAAA,KAAK,EAAG,cAAI,OAAJ,CAJT;AAKC,MAAA,OAAO,EAAG,MAAMjC,mBAAmB,CAAE,KAAF;AALpC,MALD,EAYC,4BAAC,oBAAD;AACC,MAAA,SAAS,EAAC,sDADX;AAEC,MAAA,GAAG,EAAGgB,WAFP;AAGC,MAAA,QAAQ,EAAKgB,OAAF,IAAelB,MAAM,CAAEkB,OAAF,CAHjC;AAIC,MAAA,YAAY,EAAG,KAJhB;AAKC,MAAA,IAAI,EAAG,CACN;AACCE,QAAAA,IAAI,EAAE,WADP;AAECC,QAAAA,KAAK,EAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["ListViewSidebar","setIsListViewOpened","editPostStore","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","focus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","ownerDocument","activeElement","renderTabContent","tabName","closeSmall","name","title","className"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAtBA;AACA;AACA;;AAgBA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC,CADyC,CAGzC;;AACA,QAAMC,eAAe,GAAG,8BAAiB,cAAjB,CAAxB,CAJyC,CAKzC;;AACA,QAAMC,oBAAoB,GAAG,8BAA7B;AACA,QAAMC,qBAAqB,GAAG,8BAA9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F,QAAAA,IAAI,EAAE,SADP;AAECC,QAAAA,KAAK,EAAE,cAAI,SAAJ,EAAe,eAAf,CAFR;AAGCC,QAAAA,SAAS,EAAE;AAHZ,OANM;AALR,OAkBKhB,UAAF,IACD;AACC,MAAA,SAAS,EAAC,uCADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIGa,gBAAgB,CAAEX,UAAU,CAACc,IAAb,CAJnB,CAnBF,CAZD;AAFD;AA2CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\t// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tcontentFocusReturnRef,\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__close-button\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: _x( 'List View', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: _x( 'Outline', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderTabContent( currentTab.name ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TabPanel>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -13,8 +13,6 @@ var _components = require("@wordpress/components");
|
|
|
13
13
|
|
|
14
14
|
var _editor = require("@wordpress/editor");
|
|
15
15
|
|
|
16
|
-
var _compose = require("@wordpress/compose");
|
|
17
|
-
|
|
18
16
|
var _data = require("@wordpress/data");
|
|
19
17
|
|
|
20
18
|
var _store = require("../../../store");
|
|
@@ -32,11 +30,24 @@ var _store = require("../../../store");
|
|
|
32
30
|
*/
|
|
33
31
|
const PANEL_NAME = 'discussion-panel';
|
|
34
32
|
|
|
35
|
-
function DiscussionPanel({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}) {
|
|
33
|
+
function DiscussionPanel() {
|
|
34
|
+
const {
|
|
35
|
+
isEnabled,
|
|
36
|
+
isOpened
|
|
37
|
+
} = (0, _data.useSelect)(select => {
|
|
38
|
+
const {
|
|
39
|
+
isEditorPanelEnabled,
|
|
40
|
+
isEditorPanelOpened
|
|
41
|
+
} = select(_store.store);
|
|
42
|
+
return {
|
|
43
|
+
isEnabled: isEditorPanelEnabled(PANEL_NAME),
|
|
44
|
+
isOpened: isEditorPanelOpened(PANEL_NAME)
|
|
45
|
+
};
|
|
46
|
+
}, []);
|
|
47
|
+
const {
|
|
48
|
+
toggleEditorPanelOpened
|
|
49
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
50
|
+
|
|
40
51
|
if (!isEnabled) {
|
|
41
52
|
return null;
|
|
42
53
|
}
|
|
@@ -46,7 +57,7 @@ function DiscussionPanel({
|
|
|
46
57
|
}, (0, _element.createElement)(_components.PanelBody, {
|
|
47
58
|
title: (0, _i18n.__)('Discussion'),
|
|
48
59
|
opened: isOpened,
|
|
49
|
-
onToggle:
|
|
60
|
+
onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
|
|
50
61
|
}, (0, _element.createElement)(_editor.PostTypeSupportCheck, {
|
|
51
62
|
supportKeys: "comments"
|
|
52
63
|
}, (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PostComments, null))), (0, _element.createElement)(_editor.PostTypeSupportCheck, {
|
|
@@ -54,17 +65,6 @@ function DiscussionPanel({
|
|
|
54
65
|
}, (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PostPingbacks, null)))));
|
|
55
66
|
}
|
|
56
67
|
|
|
57
|
-
var _default =
|
|
58
|
-
return {
|
|
59
|
-
isEnabled: select(_store.store).isEditorPanelEnabled(PANEL_NAME),
|
|
60
|
-
isOpened: select(_store.store).isEditorPanelOpened(PANEL_NAME)
|
|
61
|
-
};
|
|
62
|
-
}), (0, _data.withDispatch)(dispatch => ({
|
|
63
|
-
onTogglePanel() {
|
|
64
|
-
return dispatch(_store.store).toggleEditorPanelOpened(PANEL_NAME);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}))])(DiscussionPanel);
|
|
68
|
-
|
|
68
|
+
var _default = DiscussionPanel;
|
|
69
69
|
exports.default = _default;
|
|
70
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["PANEL_NAME","DiscussionPanel","isEnabled","isOpened","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["PANEL_NAME","DiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,kBAAnB;;AAEA,SAASC,eAAT,GAA2B;AAC1B,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0B,qBAAaC,MAAF,IAAc;AACxD,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLF,MAAM,CAAEG,YAAF,CADP;AAEA,WAAO;AACNL,MAAAA,SAAS,EAAEG,oBAAoB,CAAEL,UAAF,CADzB;AAENG,MAAAA,QAAQ,EAAEG,mBAAmB,CAAEN,UAAF;AAFvB,KAAP;AAIA,GAP+B,EAO7B,EAP6B,CAAhC;AASA,QAAM;AAAEQ,IAAAA;AAAF,MAA8B,uBAAaD,YAAb,CAApC;;AAEA,MAAK,CAAEL,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AAApC,KACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,MAAM,EAAGC,QAFV;AAGC,IAAA,QAAQ,EAAG,MAAMK,uBAAuB,CAAER,UAAF;AAHzC,KAKC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD,OADD,CADD,CALD,EAWC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,qBAAD,OADD,CADD,CAXD,CADD,CADD;AAqBA;;eAEcC,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel() {\n\tconst { isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default DiscussionPanel;\n"]}
|