@wordpress/edit-post 6.8.0 → 6.11.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 +6 -0
- package/README.md +1 -1
- package/build/components/header/header-toolbar/index.js +7 -6
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +11 -2
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +1 -3
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +3 -26
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +2 -2
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js +3 -1
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +28 -12
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js +3 -1
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +6 -2
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +116 -0
- package/build/components/sidebar/post-template/create-modal.js.map +1 -0
- package/build/components/sidebar/post-template/form.js +123 -0
- package/build/components/sidebar/post-template/form.js.map +1 -0
- package/build/components/sidebar/post-template/index.js +128 -0
- package/build/components/sidebar/post-template/index.js.map +1 -0
- package/build/components/sidebar/post-url/index.js +68 -0
- package/build/components/sidebar/post-url/index.js.map +1 -0
- package/build/components/sidebar/post-visibility/index.js +21 -6
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +2 -6
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/start-page-options/index.js +31 -13
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -2
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/editor.js +8 -3
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/store/selectors.js +8 -8
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +8 -6
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +12 -2
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +3 -25
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +2 -2
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js +3 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +32 -13
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js +3 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +4 -2
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +104 -0
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -0
- package/build-module/components/sidebar/post-template/form.js +106 -0
- package/build-module/components/sidebar/post-template/form.js.map +1 -0
- package/build-module/components/sidebar/post-template/index.js +114 -0
- package/build-module/components/sidebar/post-template/index.js.map +1 -0
- package/build-module/components/sidebar/post-url/index.js +59 -0
- package/build-module/components/sidebar/post-url/index.js.map +1 -0
- package/build-module/components/sidebar/post-visibility/index.js +24 -8
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +2 -4
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +32 -14
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -2
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/editor.js +9 -4
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +2 -2
- package/build-module/editor.native.js.map +1 -1
- package/build-module/store/selectors.js +8 -7
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +82 -91
- package/build-style/style.css +81 -94
- package/package.json +27 -27
- package/src/components/header/header-toolbar/index.js +10 -10
- package/src/components/header/header-toolbar/style.scss +2 -5
- package/src/components/header/style.scss +0 -6
- package/src/components/header/template-title/edit-template-title.js +11 -1
- package/src/components/keyboard-shortcut-help-modal/config.js +8 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -5
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +14 -0
- package/src/components/preferences-modal/index.js +5 -23
- package/src/components/preferences-modal/test/index.js +3 -3
- package/src/components/sidebar/plugin-post-status-info/index.js +2 -2
- package/src/components/sidebar/post-author/style.scss +4 -10
- package/src/components/sidebar/post-format/index.js +1 -1
- package/src/components/sidebar/post-format/style.scss +5 -0
- package/src/components/sidebar/post-schedule/index.js +27 -16
- package/src/components/sidebar/post-schedule/style.scss +16 -3
- package/src/components/sidebar/post-slug/index.js +1 -1
- package/src/components/sidebar/post-slug/style.scss +4 -3
- package/src/components/sidebar/post-status/index.js +6 -2
- package/src/components/sidebar/post-template/create-modal.js +146 -0
- package/src/components/sidebar/post-template/form.js +143 -0
- package/src/components/sidebar/post-template/index.js +106 -0
- package/src/components/sidebar/post-template/style.scss +36 -0
- package/src/components/sidebar/post-url/index.js +51 -0
- package/src/components/sidebar/post-url/style.scss +23 -0
- package/src/components/sidebar/post-visibility/index.js +22 -8
- package/src/components/sidebar/post-visibility/style.scss +4 -4
- package/src/components/sidebar/settings-sidebar/index.js +1 -5
- package/src/components/sidebar/template/style.scss +0 -8
- package/src/components/start-page-options/index.js +46 -22
- package/src/components/start-page-options/style.scss +0 -9
- package/src/components/visual-editor/index.js +2 -1
- package/src/editor.js +8 -4
- package/src/editor.native.js +2 -2
- package/src/store/selectors.js +5 -8
- package/src/style.scss +3 -2
- package/src/test/editor.native.js +1 -3
- package/build/components/sidebar/post-link/index.js +0 -182
- package/build/components/sidebar/post-link/index.js.map +0 -1
- package/build/components/sidebar/template/actions.js +0 -172
- package/build/components/sidebar/template/actions.js.map +0 -1
- package/build/components/sidebar/template/index.js +0 -164
- package/build/components/sidebar/template/index.js.map +0 -1
- package/build-module/components/sidebar/post-link/index.js +0 -165
- package/build-module/components/sidebar/post-link/index.js.map +0 -1
- package/build-module/components/sidebar/template/actions.js +0 -158
- package/build-module/components/sidebar/template/actions.js.map +0 -1
- package/build-module/components/sidebar/template/index.js +0 -145
- package/build-module/components/sidebar/template/index.js.map +0 -1
- package/src/components/sidebar/post-link/index.js +0 -179
- package/src/components/sidebar/post-link/style.scss +0 -20
- package/src/components/sidebar/template/actions.js +0 -206
- package/src/components/sidebar/template/index.js +0 -160
|
@@ -96,6 +96,11 @@ function HeaderToolbar() {
|
|
|
96
96
|
setIsInserterOpened(true);
|
|
97
97
|
}
|
|
98
98
|
}, [isInserterOpened, setIsInserterOpened]);
|
|
99
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
100
|
+
|
|
101
|
+
const longLabel = _x('Toggle block inserter', 'Generic label for block inserter button');
|
|
102
|
+
|
|
103
|
+
const shortLabel = !isInserterOpened ? __('Add') : __('Close');
|
|
99
104
|
return createElement(NavigableToolbar, {
|
|
100
105
|
className: "edit-post-header-toolbar",
|
|
101
106
|
"aria-label": toolbarAriaLabel
|
|
@@ -110,13 +115,10 @@ function HeaderToolbar() {
|
|
|
110
115
|
onMouseDown: preventDefault,
|
|
111
116
|
onClick: openInserter,
|
|
112
117
|
disabled: !isInserterEnabled,
|
|
113
|
-
icon: plus
|
|
114
|
-
|
|
115
|
-
characters. */
|
|
116
|
-
,
|
|
117
|
-
label: _x('Toggle block inserter', 'Generic label for block inserter button'),
|
|
118
|
+
icon: plus,
|
|
119
|
+
label: showIconLabels ? shortLabel : longLabel,
|
|
118
120
|
showTooltip: !showIconLabels
|
|
119
|
-
}
|
|
121
|
+
}), (isWideViewport || !showIconLabels) && createElement(Fragment, null, isLargeViewport && createElement(ToolbarItem, {
|
|
120
122
|
as: ToolSelector,
|
|
121
123
|
showTooltip: !showIconLabels,
|
|
122
124
|
variant: showIconLabels ? 'tertiary' : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.js"],"names":["useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","TableOfContents","EditorHistoryRedo","EditorHistoryUndo","editorStore","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","editPostStore","preventDefault","event","HeaderToolbar","inserterButton","setIsInserterOpened","setIsListViewOpened","isInserterEnabled","isInserterOpened","isTextModeEnabled","showIconLabels","isListViewOpen","listViewShortcut","select","hasInserterItems","getBlockRootClientId","getBlockSelectionEnd","getEditorSettings","getEditorMode","isFeatureActive","isListViewOpened","getShortcutRepresentation","richEditingEnabled","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","overflowItems","undefined","openInserter","current","focus"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,gBAAT,QAAiC,oBAAjC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,EAAb,QAAuB,iBAAvB;AACA,SACCC,gBADD,EAECC,YAFD,EAGCC,KAAK,IAAIC,gBAHV,Q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AAE,EAAGlB,iBADN;AAEC,IAAA,WAAW,EAAG,CAAEmB,cAFjB;AAGC,IAAA,OAAO,EAAGA,cAAc,GAAG,UAAH,GAAgBkB;AAHzC,IAXD,EAgBC,cAAC,WAAD;AACC,IAAA,EAAE,EAAGtC,iBADN;AAEC,IAAA,WAAW,EAAG,CAAEoB,cAFjB;AAGC,IAAA,OAAO,EAAGA,cAAc,GAAG,UAAH,GAAgBkB;AAHzC,IAhBD,EAqBGD,aArBH,CAvBF,CAJD,CADD;AAuDA;;AAED,eAAexB,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tTableOfContents,\n\tEditorHistoryRedo,\n\tEditorHistoryUndo,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction HeaderToolbar() {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tisInserterEnabled,\n\t\tisInserterOpened,\n\t\tisTextModeEnabled,\n\t\tshowIconLabels,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { hasInserterItems, getBlockRootClientId, getBlockSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { getEditorMode, isFeatureActive, isListViewOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tisInserterEnabled:\n\t\t\t\tgetEditorMode() === '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\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisTextModeEnabled: getEditorMode() === 'text',\n\t\t\tshowIconLabels: isFeatureActive( 'showIconLabels' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-post/toggle-list-view'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\tconst overflowItems = (\n\t\t<>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ TableOfContents }\n\t\t\t\thasOutlineItemsDisabled={ isTextModeEnabled }\n\t\t\t\trepositionDropdown={ showIconLabels && ! isWideViewport }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t/>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-post-header-toolbar__list-view-toggle\"\n\t\t\t\ticon={ listView }\n\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\tonClick={ toggleListView }\n\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t/>\n\t\t</>\n\t);\n\tconst openInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button closes the inserter popover.\n\t\t\tinserterButton.current.focus();\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-post-header-toolbar\"\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t>\n\t\t\t<div className=\"edit-post-header-toolbar__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"edit-post-header-toolbar__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ openInserter }\n\t\t\t\t\tdisabled={ ! isInserterEnabled }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\tcharacters. */\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Toggle block inserter',\n\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t) }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t>\n\t\t\t\t\t{ showIconLabels &&\n\t\t\t\t\t\t( ! isInserterOpened ? __( 'Add' ) : __( 'Close' ) ) }\n\t\t\t\t</ToolbarItem>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ overflowItems }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default HeaderToolbar;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.js"],"names":["useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","TableOfContents","EditorHistoryRedo","EditorHistoryUndo","editorStore","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","editPostStore","preventDefault","event","HeaderToolbar","inserterButton","setIsInserterOpened","setIsListViewOpened","isInserterEnabled","isInserterOpened","isTextModeEnabled","showIconLabels","isListViewOpen","listViewShortcut","select","hasInserterItems","getBlockRootClientId","getBlockSelectionEnd","getEditorSettings","getEditorMode","isFeatureActive","isListViewOpened","getShortcutRepresentation","richEditingEnabled","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","overflowItems","undefined","openInserter","current","focus","longLabel","shortLabel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,gBAAT,QAAiC,oBAAjC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,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EwB,cAFjB;AAGC,IAAA,OAAO,EACNA,cAAc,GAAG,UAAH,GAAgBkB,SAJhC;AAMC,IAAA,QAAQ,EAAGnB;AANZ,IAFF,EAWC,cAAC,WAAD;AACC,IAAA,EAAE,EAAGlB,iBADN;AAEC,IAAA,WAAW,EAAG,CAAEmB,cAFjB;AAGC,IAAA,OAAO,EAAGA,cAAc,GAAG,UAAH,GAAgBkB;AAHzC,IAXD,EAgBC,cAAC,WAAD;AACC,IAAA,EAAE,EAAGtC,iBADN;AAEC,IAAA,WAAW,EAAG,CAAEoB,cAFjB;AAGC,IAAA,OAAO,EAAGA,cAAc,GAAG,UAAH,GAAgBkB;AAHzC,IAhBD,EAqBGD,aArBH,CAfF,CAJD,CADD;AA+CA;;AAED,eAAexB,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tTableOfContents,\n\tEditorHistoryRedo,\n\tEditorHistoryUndo,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction HeaderToolbar() {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tisInserterEnabled,\n\t\tisInserterOpened,\n\t\tisTextModeEnabled,\n\t\tshowIconLabels,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { hasInserterItems, getBlockRootClientId, getBlockSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { getEditorMode, isFeatureActive, isListViewOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tisInserterEnabled:\n\t\t\t\tgetEditorMode() === '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\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisTextModeEnabled: getEditorMode() === 'text',\n\t\t\tshowIconLabels: isFeatureActive( 'showIconLabels' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-post/toggle-list-view'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\tconst overflowItems = (\n\t\t<>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ TableOfContents }\n\t\t\t\thasOutlineItemsDisabled={ isTextModeEnabled }\n\t\t\t\trepositionDropdown={ showIconLabels && ! isWideViewport }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t/>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-post-header-toolbar__list-view-toggle\"\n\t\t\t\ticon={ listView }\n\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\tonClick={ toggleListView }\n\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t/>\n\t\t</>\n\t);\n\tconst openInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button closes the inserter popover.\n\t\t\tinserterButton.current.focus();\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-post-header-toolbar\"\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t>\n\t\t\t<div className=\"edit-post-header-toolbar__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"edit-post-header-toolbar__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ openInserter }\n\t\t\t\t\tdisabled={ ! isInserterEnabled }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ overflowItems }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default HeaderToolbar;\n"]}
|
|
@@ -11,6 +11,7 @@ import { mapValues } from 'lodash';
|
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { TextControl } from '@wordpress/components';
|
|
13
13
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
14
|
+
import { useState } from '@wordpress/element';
|
|
14
15
|
import { store as editorStore } from '@wordpress/editor';
|
|
15
16
|
import { store as coreStore } from '@wordpress/core-data';
|
|
16
17
|
/**
|
|
@@ -19,6 +20,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
19
20
|
|
|
20
21
|
import { store as editPostStore } from '../../../store';
|
|
21
22
|
export default function EditTemplateTitle() {
|
|
23
|
+
const [forceEmpty, setForceEmpty] = useState(false);
|
|
22
24
|
const {
|
|
23
25
|
template
|
|
24
26
|
} = useSelect(select => {
|
|
@@ -55,9 +57,16 @@ export default function EditTemplateTitle() {
|
|
|
55
57
|
className: "edit-site-template-details__group"
|
|
56
58
|
}, createElement(TextControl, {
|
|
57
59
|
label: __('Title'),
|
|
58
|
-
value: templateTitle,
|
|
60
|
+
value: forceEmpty ? '' : templateTitle,
|
|
59
61
|
help: __('Give the template a title that indicates its purpose, e.g. "Full Width".'),
|
|
60
62
|
onChange: newTitle => {
|
|
63
|
+
// Allow having the field temporarily empty while typing.
|
|
64
|
+
if (!newTitle && !forceEmpty) {
|
|
65
|
+
setForceEmpty(true);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
setForceEmpty(false);
|
|
61
70
|
const settings = getEditorSettings();
|
|
62
71
|
const newAvailableTemplates = mapValues(settings.availableTemplates, (existingTitle, id) => {
|
|
63
72
|
if (id !== template.slug) {
|
|
@@ -72,7 +81,8 @@ export default function EditTemplateTitle() {
|
|
|
72
81
|
editEntityRecord('postType', 'wp_template', template.id, {
|
|
73
82
|
title: newTitle
|
|
74
83
|
});
|
|
75
|
-
}
|
|
84
|
+
},
|
|
85
|
+
onBlur: () => setForceEmpty(false)
|
|
76
86
|
}));
|
|
77
87
|
}
|
|
78
88
|
//# sourceMappingURL=edit-template-title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/edit-template-title.js"],"names":["mapValues","__","TextControl","useDispatch","useSelect","store","editorStore","coreStore","editPostStore","EditTemplateTitle","template","select","getEditedPostTemplate","editEntityRecord","getEditorSettings","updateEditorSettings","is_custom","has_theme_file","templateTitle","title","slug","newTitle","settings","newAvailableTemplates","availableTemplates","existingTitle","id"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,uBAA5B;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,gBAAvC;AAEA,eAAe,SAASC,iBAAT,GAA6B;AAC3C,QAAM;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/edit-template-title.js"],"names":["mapValues","__","TextControl","useDispatch","useSelect","useState","store","editorStore","coreStore","editPostStore","EditTemplateTitle","forceEmpty","setForceEmpty","template","select","getEditedPostTemplate","editEntityRecord","getEditorSettings","updateEditorSettings","is_custom","has_theme_file","templateTitle","title","slug","newTitle","settings","newAvailableTemplates","availableTemplates","existingTitle","id"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,uBAA5B;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,gBAAvC;AAEA,eAAe,SAASC,iBAAT,GAA6B;AAC3C,QAAM,CAAEC,UAAF,EAAcC,aAAd,IAAgCP,QAAQ,CAAE,KAAF,CAA9C;AACA,QAAM;AAAEQ,IAAAA;AAAF,MAAeT,SAAS,CAAIU,MAAF,IAAc;AAC7C,UAAM;AAAEC,MAAAA;AAAF,QAA4BD,MAAM,CAAEL,aAAF,CAAxC;AACA,WAAO;AACNI,MAAAA,QAAQ,EAAEE,qBAAqB;AADzB,KAAP;AAGA,GAL6B,EAK3B,EAL2B,CAA9B;AAOA,QAAM;AAAEC,IAAAA;AAAF,MAAuBb,WAAW,CAAEK,SAAF,CAAxC;AACA,QAAM;AAAES,IAAAA;AAAF,MAAwBb,SAAS,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B;AAIAV,MAAAA,gBAAgB,CAAE,UAAF,EAAc,aAAd,EAA6BH,QAAQ,CAACgB,EAAtC,EAA0C;AACzDP,QAAAA,KAAK,EAAEE;AADkD,OAA1C,CAAhB;AAGA,KA/BF;AAgCC,IAAA,MAAM,EAAG,MAAMZ,aAAa,CAAE,KAAF;AAhC7B,IADD,CADD;AAsCA","sourcesContent":["/**\n * External dependencies\n */\nimport { mapValues } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { TextControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nexport default function EditTemplateTitle() {\n\tconst [ forceEmpty, setForceEmpty ] = useState( false );\n\tconst { template } = useSelect( ( select ) => {\n\t\tconst { getEditedPostTemplate } = select( editPostStore );\n\t\treturn {\n\t\t\ttemplate: getEditedPostTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { getEditorSettings } = useSelect( editorStore );\n\tconst { updateEditorSettings } = useDispatch( editorStore );\n\n\t// Only user-created and non-default templates can change the name.\n\tif ( ! template.is_custom || template.has_theme_file ) {\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-site-template-details__group\">\n\t\t\t<TextControl\n\t\t\t\tlabel={ __( 'Title' ) }\n\t\t\t\tvalue={ forceEmpty ? '' : templateTitle }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Give the template a title that indicates its purpose, e.g. \"Full Width\".'\n\t\t\t\t) }\n\t\t\t\tonChange={ ( newTitle ) => {\n\t\t\t\t\t// Allow having the field temporarily empty while typing.\n\t\t\t\t\tif ( ! newTitle && ! forceEmpty ) {\n\t\t\t\t\t\tsetForceEmpty( true );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetForceEmpty( false );\n\n\t\t\t\t\tconst settings = getEditorSettings();\n\t\t\t\t\tconst newAvailableTemplates = mapValues(\n\t\t\t\t\t\tsettings.availableTemplates,\n\t\t\t\t\t\t( existingTitle, id ) => {\n\t\t\t\t\t\t\tif ( id !== template.slug ) {\n\t\t\t\t\t\t\t\treturn existingTitle;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn newTitle;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tupdateEditorSettings( {\n\t\t\t\t\t\t...settings,\n\t\t\t\t\t\tavailableTemplates: newAvailableTemplates,\n\t\t\t\t\t} );\n\t\t\t\t\teditEntityRecord( 'postType', 'wp_template', template.id, {\n\t\t\t\t\t\ttitle: newTitle,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tonBlur={ () => setForceEmpty( false ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -37,5 +37,17 @@ export const textFormattingShortcuts = [{
|
|
|
37
37
|
character: 'u'
|
|
38
38
|
},
|
|
39
39
|
description: __('Underline the selected text.')
|
|
40
|
+
}, {
|
|
41
|
+
keyCombination: {
|
|
42
|
+
modifier: 'access',
|
|
43
|
+
character: 'd'
|
|
44
|
+
},
|
|
45
|
+
description: __('Strikethrough the selected text.')
|
|
46
|
+
}, {
|
|
47
|
+
keyCombination: {
|
|
48
|
+
modifier: 'access',
|
|
49
|
+
character: 'x'
|
|
50
|
+
},
|
|
51
|
+
description: __('Make the selected text inline code.')
|
|
40
52
|
}];
|
|
41
53
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/config.js"],"names":["__","textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA,OAAO,MAAMC,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,8BAAF;AAFhB,CADsC,EAKtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gCAAF;AAFhB,CALsC,EAStC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,wCAAF;AAFhB,CATsC,EAatC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gBAAF;AAFhB,CAbsC,EAiBtC;AACCE,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,iCAAF;AAFhB,CAjBsC,EAqBtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,8BAAF;AAFhB,CArBsC,CAAhC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n];\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/config.js"],"names":["__","textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA,OAAO,MAAMC,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,8BAAF;AAFhB,CADsC,EAKtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gCAAF;AAFhB,CALsC,EAStC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,wCAAF;AAFhB,CATsC,EAatC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,gBAAF;AAFhB,CAbsC,EAiBtC;AACCE,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,iCAAF;AAFhB,CAjBsC,EAqBtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,8BAAF;AAFhB,CArBsC,EAyBtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,kCAAF;AAFhB,CAzBsC,EA6BtC;AACCE,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAEL,EAAE,CAAE,qCAAF;AAFhB,CA7BsC,CAAhC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n];\n"]}
|
|
@@ -4,7 +4,6 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
6
6
|
import classnames from 'classnames';
|
|
7
|
-
import { isString } from 'lodash';
|
|
8
7
|
/**
|
|
9
8
|
* WordPress dependencies
|
|
10
9
|
*/
|
|
@@ -41,7 +40,7 @@ const ShortcutList = _ref => {
|
|
|
41
40
|
}, shortcuts.map((shortcut, index) => createElement("li", {
|
|
42
41
|
className: "edit-post-keyboard-shortcut-help-modal__shortcut",
|
|
43
42
|
key: index
|
|
44
|
-
},
|
|
43
|
+
}, typeof shortcut === 'string' ? createElement(DynamicShortcut, {
|
|
45
44
|
name: shortcut
|
|
46
45
|
}) : createElement(Shortcut, shortcut))))
|
|
47
46
|
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/index.js"],"names":["classnames","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/index.js"],"names":["classnames","Modal","__","useShortcut","store","keyboardShortcutsStore","withSelect","withDispatch","useSelect","compose","textFormattingShortcuts","Shortcut","DynamicShortcut","editPostStore","MODAL_NAME","ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","keyCombination","character","description","ariaLabel","dispatch","openModal","closeModal"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,uBAAtB;A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,cAAc,EAAE;AAAEC,QAAAA,SAAS,EAAE;AAAb,OADjB;AAECC,MAAAA,WAAW,EAAEjC,EAAE,CACd,qDADc,CAFhB;;AAKC;AACAkC,MAAAA,SAAS,EAAElC,EAAE,CAAE,eAAF;AANd,KADqB;AAHvB,IApBD,EAkCC,cAAC,eAAD;AACC,IAAA,KAAK,EAAGA,EAAE,CAAE,iBAAF,CADX;AAEC,IAAA,SAAS,EAAGQ;AAFb,IAlCD,CADD;AAyCA;AAED,eAAeD,OAAO,CAAE,CACvBH,UAAU,CAAIqB,MAAF,KAAgB;AAC3BI,EAAAA,aAAa,EAAEJ,MAAM,CAAEd,aAAF,CAAN,CAAwBkB,aAAxB,CAAuCjB,UAAvC;AADY,CAAhB,CAAF,CADa,EAIvBP,YAAY,CAAE,CAAE8B,QAAF,YAAmC;AAAA,MAAvB;AAAEN,IAAAA;AAAF,GAAuB;AAChD,QAAM;AAAEO,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA4BF,QAAQ,CAAExB,aAAF,CAA1C;AAEA,SAAO;AACNmB,IAAAA,WAAW,EAAE,MACZD,aAAa,GAAGQ,UAAU,EAAb,GAAkBD,SAAS,CAAExB,UAAF;AAFnC,GAAP;AAIA,CAPW,CAJW,CAAF,CAAP,CAYVgB,yBAZU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { withSelect, withDispatch, useSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\nimport { store as editPostStore } from '../../store';\n\nconst MODAL_NAME = 'edit-post/keyboard-shortcut-help';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-post-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-post-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) {\n\tuseShortcut( 'core/edit-post/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-post/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisModalActive: select( editPostStore ).isModalActive( MODAL_NAME ),\n\t} ) ),\n\twithDispatch( ( dispatch, { isModalActive } ) => {\n\t\tconst { openModal, closeModal } = dispatch( editPostStore );\n\n\t\treturn {\n\t\t\ttoggleModal: () =>\n\t\t\t\tisModalActive ? closeModal() : openModal( MODAL_NAME ),\n\t\t};\n\t} ),\n] )( KeyboardShortcutHelpModal );\n"]}
|
|
@@ -13,7 +13,6 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
13
13
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
14
14
|
import { useMemo } from '@wordpress/element';
|
|
15
15
|
import { PostTaxonomies, PostExcerptCheck, PageAttributesCheck, PostFeaturedImageCheck, PostTypeSupportCheck, store as editorStore } from '@wordpress/editor';
|
|
16
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
17
16
|
import { PreferencesModal, PreferencesModalTabs, PreferencesModalSection } from '@wordpress/interface';
|
|
18
17
|
/**
|
|
19
18
|
* Internal dependencies
|
|
@@ -29,22 +28,7 @@ export default function EditPostPreferencesModal() {
|
|
|
29
28
|
const {
|
|
30
29
|
closeModal
|
|
31
30
|
} = useDispatch(editPostStore);
|
|
32
|
-
const
|
|
33
|
-
isModalActive,
|
|
34
|
-
isViewable
|
|
35
|
-
} = useSelect(select => {
|
|
36
|
-
const {
|
|
37
|
-
getEditedPostAttribute
|
|
38
|
-
} = select(editorStore);
|
|
39
|
-
const {
|
|
40
|
-
getPostType
|
|
41
|
-
} = select(coreStore);
|
|
42
|
-
const postType = getPostType(getEditedPostAttribute('type'));
|
|
43
|
-
return {
|
|
44
|
-
isModalActive: select(editPostStore).isModalActive(MODAL_NAME),
|
|
45
|
-
isViewable: get(postType, ['viewable'], false)
|
|
46
|
-
};
|
|
47
|
-
}, []);
|
|
31
|
+
const isModalActive = useSelect(select => select(editPostStore).isModalActive(MODAL_NAME), []);
|
|
48
32
|
const showBlockBreadcrumbsOption = useSelect(select => {
|
|
49
33
|
const {
|
|
50
34
|
getEditorSettings
|
|
@@ -119,13 +103,7 @@ export default function EditPostPreferencesModal() {
|
|
|
119
103
|
content: createElement(Fragment, null, createElement(PreferencesModalSection, {
|
|
120
104
|
title: __('Document settings'),
|
|
121
105
|
description: __('Choose what displays in the panel.')
|
|
122
|
-
}, createElement(EnablePluginDocumentSettingPanelOption.Slot, null),
|
|
123
|
-
label: __('Permalink'),
|
|
124
|
-
panelName: "post-link"
|
|
125
|
-
}), isViewable && createElement(EnablePanelOption, {
|
|
126
|
-
label: __('Template'),
|
|
127
|
-
panelName: "template"
|
|
128
|
-
}), createElement(PostTaxonomies, {
|
|
106
|
+
}, createElement(EnablePluginDocumentSettingPanelOption.Slot, null), createElement(PostTaxonomies, {
|
|
129
107
|
taxonomyWrapper: (content, taxonomy) => createElement(EnablePanelOption, {
|
|
130
108
|
label: get(taxonomy, ['labels', 'menu_name']),
|
|
131
109
|
panelName: `taxonomy-panel-${taxonomy.slug}`
|
|
@@ -148,7 +126,7 @@ export default function EditPostPreferencesModal() {
|
|
|
148
126
|
title: __('Additional'),
|
|
149
127
|
description: __('Add extra areas to the editor.')
|
|
150
128
|
}))
|
|
151
|
-
}], [
|
|
129
|
+
}], [isLargeViewport, showBlockBreadcrumbsOption]);
|
|
152
130
|
|
|
153
131
|
if (!isModalActive) {
|
|
154
132
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["get","__","useViewportMatch","useSelect","useDispatch","useMemo","PostTaxonomies","PostExcerptCheck","PageAttributesCheck","PostFeaturedImageCheck","PostTypeSupportCheck","store","editorStore","coreStore","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","EnablePanelOption","EnableFeature","MetaBoxesSection","editPostStore","BlockManager","MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","isModalActive","isViewable","select","getEditedPostAttribute","getPostType","postType","showBlockBreadcrumbsOption","getEditorSettings","getEditorMode","isFeatureActive","mode","isRichEditingEnabled","richEditingEnabled","hasReducedUI","sections","name","tabLabel","content","taxonomy","slug"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AAEA,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EC,MAAA,SAAS,EAAC;AAFX,MADD,CApCD,EA0CC,cAAC,oBAAD;AACC,MAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AADf,OAGC,cAAC,iBAAD;AACC,MAAA,KAAK,EAAGA,EAAE,CAAE,YAAF,CADX;AAEC,MAAA,SAAS,EAAC;AAFX,MAHD,CA1CD,EAkDC,cAAC,mBAAD,QACC,cAAC,iBAAD;AACC,MAAA,KAAK,EAAGA,EAAE,CAAE,iBAAF,CADX;AAEC,MAAA,SAAS,EAAC;AAFX,MADD,CAlDD,CADD,EA0DC,cAAC,gBAAD;AACC,MAAA,KAAK,EAAGA,EAAE,CAAE,YAAF,CADX;AAEC,MAAA,WAAW,EAAGA,EAAE,CACf,gCADe;AAFjB,MA1DD;AAJF,GArHK,CADiB,EA8LvB,CAAE4B,UAAF,EAAcH,eAAd,EAA+BQ,0BAA/B,CA9LuB,CAAxB;;AAiMA,MAAK,CAAEN,aAAP,EAAuB;AACtB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,gBAAD;AAAkB,IAAA,UAAU,EAAGD;AAA/B,KACC,cAAC,oBAAD;AAAsB,IAAA,QAAQ,EAAGe;AAAjC,IADD,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\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 { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n} from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nconst MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( editPostStore );\n\tconst { isModalActive, isViewable } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tisModalActive: select( editPostStore ).isModalActive( MODAL_NAME ),\n\t\t\tisViewable: get( postType, [ 'viewable' ], false ),\n\t\t};\n\t}, [] );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst hasReducedUI = isFeatureActive( 'reducedUI' );\n\t\t\treturn (\n\t\t\t\t! hasReducedUI &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tmode === 'visual'\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"reducedUI\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Compacts options and outlines in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Reduce the interface' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Permalink' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-link\"\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{ isViewable && (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"template\"\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<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ get( taxonomy, [\n\t\t\t\t\t\t\t\t\t\t\t'labels',\n\t\t\t\t\t\t\t\t\t\t\t'menu_name',\n\t\t\t\t\t\t\t\t\t\t] ) }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isViewable, isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"names":["get","__","useViewportMatch","useSelect","useDispatch","useMemo","PostTaxonomies","PostExcerptCheck","PageAttributesCheck","PostFeaturedImageCheck","PostTypeSupportCheck","store","editorStore","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","EnablePanelOption","EnableFeature","MetaBoxesSection","editPostStore","BlockManager","MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","isModalActive","select","showBlockBreadcrumbsOption","getEditorSettings","getEditorMode","isFeatureActive","mode","isRichEditingEnabled","richEditingEnabled","hasReducedUI","sections","name","tabLabel","content","taxonomy","slug"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AAE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C,oBAAD;AAAsB,IAAA,QAAQ,EAAGW;AAAjC,IADD,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n} from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nconst MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( editPostStore );\n\tconst isModalActive = useSelect(\n\t\t( select ) => select( editPostStore ).isModalActive( MODAL_NAME ),\n\t\t[]\n\t);\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst hasReducedUI = isFeatureActive( 'reducedUI' );\n\t\t\treturn (\n\t\t\t\t! hasReducedUI &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tmode === 'visual'\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"reducedUI\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Compacts options and outlines in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Reduce the interface' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ get( taxonomy, [\n\t\t\t\t\t\t\t\t\t\t\t'labels',\n\t\t\t\t\t\t\t\t\t\t\t'menu_name',\n\t\t\t\t\t\t\t\t\t\t] ) }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Defines as extensibility slot for the
|
|
4
|
+
* Defines as extensibility slot for the Summary panel.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ export const {
|
|
|
13
13
|
Slot
|
|
14
14
|
} = createSlotFill('PluginPostStatusInfo');
|
|
15
15
|
/**
|
|
16
|
-
* Renders a row in the
|
|
16
|
+
* Renders a row in the Summary panel of the Document sidebar.
|
|
17
17
|
* It should be noted that this is named and implemented around the function it serves
|
|
18
18
|
* and not its location, which may change in future iterations.
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-status-info/index.js"],"names":["createSlotFill","PanelRow","Fill","Slot","PluginPostStatusInfo","children","className"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,QAAzB,QAAyC,uBAAzC;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiBH,cAAc,CAAE,sBAAF,CAArC;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMI,oBAAoB,GAAG;AAAA,MAAE;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAF;AAAA,SAC5B,cAAC,IAAD,QACC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAGA;AAAtB,KAAoCD,QAApC,CADD,CAD4B;AAAA,CAA7B;;AAMAD,oBAAoB,CAACD,IAArB,GAA4BA,IAA5B;AAEA,eAAeC,oBAAf","sourcesContent":["/**\n * Defines as extensibility slot for the
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-status-info/index.js"],"names":["createSlotFill","PanelRow","Fill","Slot","PluginPostStatusInfo","children","className"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,QAAzB,QAAyC,uBAAzC;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiBH,cAAc,CAAE,sBAAF,CAArC;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMI,oBAAoB,GAAG;AAAA,MAAE;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAF;AAAA,SAC5B,cAAC,IAAD,QACC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAGA;AAAtB,KAAoCD,QAApC,CADD,CAD4B;AAAA,CAA7B;;AAMAD,oBAAoB,CAACD,IAArB,GAA4BA,IAA5B;AAEA,eAAeC,oBAAf","sourcesContent":["/**\n * Defines as extensibility slot for the Summary panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nexport const { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );\n\n/**\n * Renders a row in the Summary panel of the Document sidebar.\n * It should be noted that this is named and implemented around the function it serves\n * and not its location, which may change in future iterations.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {WPElement} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;\n *\n * function MyPluginPostStatusInfo() {\n * \treturn wp.element.createElement(\n * \t\tPluginPostStatusInfo,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-status-info',\n * \t\t},\n * \t\t__( 'My post status info' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostStatusInfo } from '@wordpress/edit-post';\n *\n * const MyPluginPostStatusInfo = () => (\n * \t<PluginPostStatusInfo\n * \t\tclassName=\"my-plugin-post-status-info\"\n * \t>\n * \t\t{ __( 'My post status info' ) }\n * \t</PluginPostStatusInfo>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginPostStatusInfo = ( { children, className } ) => (\n\t<Fill>\n\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t</Fill>\n);\n\nPluginPostStatusInfo.Slot = Slot;\n\nexport default PluginPostStatusInfo;\n"]}
|
|
@@ -6,7 +6,9 @@ import { createElement } from "@wordpress/element";
|
|
|
6
6
|
import { PanelRow } from '@wordpress/components';
|
|
7
7
|
import { PostFormat as PostFormatForm, PostFormatCheck } from '@wordpress/editor';
|
|
8
8
|
export function PostFormat() {
|
|
9
|
-
return createElement(PostFormatCheck, null, createElement(PanelRow,
|
|
9
|
+
return createElement(PostFormatCheck, null, createElement(PanelRow, {
|
|
10
|
+
className: "edit-post-post-format"
|
|
11
|
+
}, createElement(PostFormatForm, null)));
|
|
10
12
|
}
|
|
11
13
|
export default PostFormat;
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-format/index.js"],"names":["PanelRow","PostFormat","PostFormatForm","PostFormatCheck"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SACCC,UAAU,IAAIC,cADf,EAECC,eAFD,QAGO,mBAHP;AAKA,OAAO,SAASF,UAAT,GAAsB;AAC5B,SACC,cAAC,eAAD,QACC,cAAC,QAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-format/index.js"],"names":["PanelRow","PostFormat","PostFormatForm","PostFormatCheck"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SACCC,UAAU,IAAIC,cADf,EAECC,eAFD,QAGO,mBAHP;AAKA,OAAO,SAASF,UAAT,GAAsB;AAC5B,SACC,cAAC,eAAD,QACC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,cAAC,cAAD,OADD,CADD,CADD;AAOA;AAED,eAAeA,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelRow } from '@wordpress/components';\nimport {\n\tPostFormat as PostFormatForm,\n\tPostFormatCheck,\n} from '@wordpress/editor';\n\nexport function PostFormat() {\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<PanelRow className=\"edit-post-post-format\">\n\t\t\t\t<PostFormatForm />\n\t\t\t</PanelRow>\n\t\t</PostFormatCheck>\n\t);\n}\n\nexport default PostFormat;\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createElement
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
7
7
|
import { PanelRow, Dropdown, Button } from '@wordpress/components';
|
|
8
8
|
import { useRef } from '@wordpress/element';
|
|
9
|
-
import { PostSchedule as PostScheduleForm,
|
|
10
|
-
export function PostSchedule() {
|
|
9
|
+
import { PostSchedule as PostScheduleForm, PostScheduleCheck, usePostScheduleLabel } from '@wordpress/editor';
|
|
10
|
+
export default function PostSchedule() {
|
|
11
11
|
const anchorRef = useRef();
|
|
12
12
|
return createElement(PostScheduleCheck, null, createElement(PanelRow, {
|
|
13
13
|
className: "edit-post-post-schedule",
|
|
@@ -18,17 +18,16 @@ export function PostSchedule() {
|
|
|
18
18
|
},
|
|
19
19
|
position: "bottom left",
|
|
20
20
|
contentClassName: "edit-post-post-schedule__dialog",
|
|
21
|
+
focusOnMount: true,
|
|
21
22
|
renderToggle: _ref => {
|
|
22
23
|
let {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
isOpen,
|
|
25
|
+
onToggle
|
|
25
26
|
} = _ref;
|
|
26
|
-
return createElement(
|
|
27
|
-
|
|
28
|
-
onClick: onToggle
|
|
29
|
-
|
|
30
|
-
variant: "tertiary"
|
|
31
|
-
}, createElement(PostScheduleLabel, null)));
|
|
27
|
+
return createElement(PostScheduleToggle, {
|
|
28
|
+
isOpen: isOpen,
|
|
29
|
+
onClick: onToggle
|
|
30
|
+
});
|
|
32
31
|
},
|
|
33
32
|
renderContent: _ref2 => {
|
|
34
33
|
let {
|
|
@@ -40,5 +39,25 @@ export function PostSchedule() {
|
|
|
40
39
|
}
|
|
41
40
|
})));
|
|
42
41
|
}
|
|
43
|
-
|
|
42
|
+
|
|
43
|
+
function PostScheduleToggle(_ref3) {
|
|
44
|
+
let {
|
|
45
|
+
isOpen,
|
|
46
|
+
onClick
|
|
47
|
+
} = _ref3;
|
|
48
|
+
const label = usePostScheduleLabel();
|
|
49
|
+
const fullLabel = usePostScheduleLabel({
|
|
50
|
+
full: true
|
|
51
|
+
});
|
|
52
|
+
return createElement(Button, {
|
|
53
|
+
className: "edit-post-post-schedule__toggle",
|
|
54
|
+
variant: "tertiary",
|
|
55
|
+
label: fullLabel,
|
|
56
|
+
showTooltip: true,
|
|
57
|
+
"aria-expanded": isOpen // translators: %s: Current post date.
|
|
58
|
+
,
|
|
59
|
+
"aria-label": sprintf(__('Change date: %s'), label),
|
|
60
|
+
onClick: onClick
|
|
61
|
+
}, label);
|
|
62
|
+
}
|
|
44
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-schedule/index.js"],"names":["__","PanelRow","Dropdown","Button","useRef","PostSchedule","PostScheduleForm","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-schedule/index.js"],"names":["__","sprintf","PanelRow","Dropdown","Button","useRef","PostSchedule","PostScheduleForm","PostScheduleCheck","usePostScheduleLabel","anchorRef","isOpen","onToggle","onClose","PostScheduleToggle","onClick","label","fullLabel","full"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,MAA7B,QAA2C,uBAA3C;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SACCC,YAAY,IAAIC,gBADjB,EAECC,iBAFD,EAGCC,oBAHD,QAIO,mBAJP;AAMA,eAAe,SAASH,YAAT,GAAwB;AACtC,QAAMI,SAAS,GAAGL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i18n';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { useRef } from '@wordpress/element';\nimport {\n\tPostSchedule as PostScheduleForm,\n\tPostScheduleCheck,\n\tusePostScheduleLabel,\n} from '@wordpress/editor';\n\nexport default function PostSchedule() {\n\tconst anchorRef = useRef();\n\treturn (\n\t\t<PostScheduleCheck>\n\t\t\t<PanelRow className=\"edit-post-post-schedule\" ref={ anchorRef }>\n\t\t\t\t<span>{ __( 'Publish' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ { anchorRef } }\n\t\t\t\t\tposition=\"bottom left\"\n\t\t\t\t\tcontentClassName=\"edit-post-post-schedule__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostScheduleToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostScheduleForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostScheduleCheck>\n\t);\n}\n\nfunction PostScheduleToggle( { isOpen, onClick } ) {\n\tconst label = usePostScheduleLabel();\n\tconst fullLabel = usePostScheduleLabel( { full: true } );\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-schedule__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\tlabel={ fullLabel }\n\t\t\tshowTooltip\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post date.\n\t\t\taria-label={ sprintf( __( 'Change date: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
|
|
@@ -6,7 +6,9 @@ import { createElement } from "@wordpress/element";
|
|
|
6
6
|
import { PanelRow } from '@wordpress/components';
|
|
7
7
|
import { PostSlug as PostSlugForm, PostSlugCheck } from '@wordpress/editor';
|
|
8
8
|
export function PostSlug() {
|
|
9
|
-
return createElement(PostSlugCheck, null, createElement(PanelRow,
|
|
9
|
+
return createElement(PostSlugCheck, null, createElement(PanelRow, {
|
|
10
|
+
className: "edit-post-post-slug"
|
|
11
|
+
}, createElement(PostSlugForm, null)));
|
|
10
12
|
}
|
|
11
13
|
export default PostSlug;
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-slug/index.js"],"names":["PanelRow","PostSlug","PostSlugForm","PostSlugCheck"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SAASC,QAAQ,IAAIC,YAArB,EAAmCC,aAAnC,QAAwD,mBAAxD;AAEA,OAAO,SAASF,QAAT,GAAoB;AAC1B,SACC,cAAC,aAAD,QACC,cAAC,QAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-slug/index.js"],"names":["PanelRow","PostSlug","PostSlugForm","PostSlugCheck"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SAASC,QAAQ,IAAIC,YAArB,EAAmCC,aAAnC,QAAwD,mBAAxD;AAEA,OAAO,SAASF,QAAT,GAAoB;AAC1B,SACC,cAAC,aAAD,QACC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,cAAC,YAAD,OADD,CADD,CADD;AAOA;AAED,eAAeA,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelRow } from '@wordpress/components';\nimport { PostSlug as PostSlugForm, PostSlugCheck } from '@wordpress/editor';\n\nexport function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PanelRow className=\"edit-post-post-slug\">\n\t\t\t\t<PostSlugForm />\n\t\t\t</PanelRow>\n\t\t</PostSlugCheck>\n\t);\n}\n\nexport default PostSlug;\n"]}
|
|
@@ -21,6 +21,8 @@ import PostFormat from '../post-format';
|
|
|
21
21
|
import PostPendingStatus from '../post-pending-status';
|
|
22
22
|
import PluginPostStatusInfo from '../plugin-post-status-info';
|
|
23
23
|
import { store as editPostStore } from '../../../store';
|
|
24
|
+
import PostTemplate from '../post-template';
|
|
25
|
+
import PostURL from '../post-url';
|
|
24
26
|
/**
|
|
25
27
|
* Module Constants
|
|
26
28
|
*/
|
|
@@ -34,10 +36,10 @@ function PostStatus(_ref) {
|
|
|
34
36
|
} = _ref;
|
|
35
37
|
return createElement(PanelBody, {
|
|
36
38
|
className: "edit-post-post-status",
|
|
37
|
-
title: __('
|
|
39
|
+
title: __('Summary'),
|
|
38
40
|
opened: isOpened,
|
|
39
41
|
onToggle: onTogglePanel
|
|
40
|
-
}, createElement(PluginPostStatusInfo.Slot, null, fills => createElement(Fragment, null, createElement(PostVisibility, null), createElement(PostSchedule, null), createElement(
|
|
42
|
+
}, createElement(PluginPostStatusInfo.Slot, null, fills => createElement(Fragment, null, createElement(PostVisibility, null), createElement(PostSchedule, null), createElement(PostURL, null), createElement(PostTemplate, null), createElement(PostSticky, null), createElement(PostPendingStatus, null), createElement(PostFormat, null), createElement(PostSlug, null), createElement(PostAuthor, null), fills, createElement(PostTrash, null))));
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
export default compose([withSelect(select => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"names":["__","PanelBody","withSelect","withDispatch","compose","ifCondition","PostVisibility","PostTrash","PostSchedule","PostSticky","PostAuthor","PostSlug","PostFormat","PostPendingStatus","PluginPostStatusInfo","store","editPostStore","PANEL_NAME","PostStatus","isOpened","onTogglePanel","fills","select","isEditorPanelRemoved","isEditorPanelOpened","isRemoved","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,EAAkBC,WAAlB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,oBAAP,MAAiC,4BAAjC;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG,aAAnB;;AAEA,SAASC,UAAT,OAAmD;AAAA,MAA9B;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAA8B;AAClD,SACC,cAAC,SAAD;AACC,IAAA,SAAS,EAAC,uBADX;AAEC,IAAA,KAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"names":["__","PanelBody","withSelect","withDispatch","compose","ifCondition","PostVisibility","PostTrash","PostSchedule","PostSticky","PostAuthor","PostSlug","PostFormat","PostPendingStatus","PluginPostStatusInfo","store","editPostStore","PostTemplate","PostURL","PANEL_NAME","PostStatus","isOpened","onTogglePanel","fills","select","isEditorPanelRemoved","isEditorPanelOpened","isRemoved","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,EAAkBC,WAAlB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2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CADzB;AAENE,IAAAA,QAAQ,EAAEK,mBAAmB,CAAEP,UAAF;AAFvB,GAAP;AAIA,CATS,CADa,EAWvBd,WAAW,CAAE;AAAA,MAAE;AAAEsB,IAAAA;AAAF,GAAF;AAAA,SAAqB,CAAEA,SAAvB;AAAA,CAAF,CAXY,EAYvBxB,YAAY,CAAIyB,QAAF,KAAkB;AAC/BN,EAAAA,aAAa,GAAG;AACf,WAAOM,QAAQ,CAAEZ,aAAF,CAAR,CAA0Ba,uBAA1B,CACNV,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAF,CAZW,CAAF,CAAP,CAmBVC,UAnBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSchedule from '../post-schedule';\nimport PostSticky from '../post-sticky';\nimport PostAuthor from '../post-author';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport { store as editPostStore } from '../../../store';\nimport PostTemplate from '../post-template';\nimport PostURL from '../post-url';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nfunction PostStatus( { isOpened, onTogglePanel } ) {\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t\t<PostURL />\n\t\t\t\t\t\t<PostTemplate />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthor />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonTogglePanel() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tPANEL_NAME\n\t\t\t);\n\t\t},\n\t} ) ),\n] )( PostStatus );\n"]}
|