@wordpress/edit-post 7.19.3 → 7.20.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/README.md +22 -22
- package/build/components/block-manager/category.js +5 -4
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +5 -5
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +10 -9
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +5 -5
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/device-preview/index.js +5 -5
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/document-actions/index.js +9 -9
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +6 -6
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +9 -8
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +12 -11
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +14 -14
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +3 -2
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +2 -2
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +3 -3
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +6 -6
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/plugin-more-menu-item/index.js +3 -3
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +5 -5
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +2 -2
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +2 -2
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +3 -3
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +6 -6
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +15 -15
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +8 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/actions-panel.js +9 -8
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +22 -21
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +10 -9
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +5 -4
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +6 -5
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +27 -26
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +4 -4
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js +5 -4
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +2 -2
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +7 -6
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-outline.js +18 -18
- package/build/components/secondary-sidebar/list-view-outline.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +9 -8
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +6 -6
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +3 -3
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/last-revision/index.js +3 -3
- package/build/components/sidebar/last-revision/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +3 -3
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +6 -6
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +5 -5
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +7 -7
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +5 -5
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +4 -4
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-author/index.js +3 -3
- package/build/components/sidebar/post-author/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js +3 -3
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js +3 -3
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js +2 -2
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +7 -6
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js +3 -3
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +28 -30
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js +2 -2
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/index.js +3 -3
- package/build/components/sidebar/post-taxonomies/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +2 -2
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +9 -8
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/sidebar/post-template/form.js +7 -6
- package/build/components/sidebar/post-template/form.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +6 -5
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js +2 -2
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-url/index.js +6 -5
- package/build/components/sidebar/post-url/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +8 -7
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +4 -4
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +6 -5
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +5 -5
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/components/start-page-options/index.js +7 -6
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/text-editor/index.js +6 -6
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/view-link/index.js +2 -2
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +2 -2
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +4 -3
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +14 -13
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js +3 -2
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +17 -16
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -4
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +5 -5
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +5 -4
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +5 -4
- package/build/editor.native.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +11 -11
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -2
- package/build/index.native.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js +2 -2
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js +6 -6
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +2 -2
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js +2 -2
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -1
- package/build-module/components/block-manager/checklist.js +1 -1
- package/build-module/components/block-manager/index.js +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +3 -3
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/device-preview/index.js +1 -1
- package/build-module/components/header/document-actions/index.js +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +1 -1
- package/build-module/components/header/header-toolbar/index.js +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/header/index.native.js +1 -1
- package/build-module/components/header/main-dashboard-button/index.js +1 -1
- package/build-module/components/header/mode-switcher/index.js +1 -1
- package/build-module/components/header/more-menu/index.js +1 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +3 -3
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +4 -4
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +1 -1
- package/build-module/components/header/writing-menu/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -1
- package/build-module/components/layout/actions-panel.js +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/layout/index.native.js +1 -1
- package/build-module/components/meta-boxes/index.js +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +2 -2
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js +1 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -1
- package/build-module/components/secondary-sidebar/list-view-outline.js +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +1 -1
- package/build-module/components/sidebar/featured-image/index.js +1 -1
- package/build-module/components/sidebar/last-revision/index.js +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +4 -4
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +4 -4
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -6
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +4 -4
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +3 -3
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-author/index.js +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js +1 -1
- package/build-module/components/sidebar/post-format/index.js +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +1 -1
- package/build-module/components/sidebar/post-slug/index.js +1 -1
- package/build-module/components/sidebar/post-status/index.js +25 -26
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js +1 -1
- package/build-module/components/sidebar/post-taxonomies/index.js +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +1 -1
- package/build-module/components/sidebar/post-template/form.js +1 -1
- package/build-module/components/sidebar/post-template/index.js +1 -1
- package/build-module/components/sidebar/post-trash/index.js +1 -1
- package/build-module/components/sidebar/post-url/index.js +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +1 -1
- package/build-module/components/sidebar/settings-header/index.js +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +1 -1
- package/build-module/components/sidebar/template-summary/index.js +1 -1
- package/build-module/components/start-page-options/index.js +1 -1
- package/build-module/components/text-editor/index.js +1 -1
- package/build-module/components/view-link/index.js +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -1
- package/build-module/components/visual-editor/header.native.js +1 -1
- package/build-module/components/visual-editor/index.js +1 -1
- package/build-module/components/visual-editor/index.native.js +1 -1
- package/build-module/components/welcome-guide/default.js +1 -1
- package/build-module/components/welcome-guide/image.js +1 -1
- package/build-module/components/welcome-guide/index.js +1 -1
- package/build-module/components/welcome-guide/template.js +1 -1
- package/build-module/editor.js +1 -1
- package/build-module/editor.native.js +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +3 -3
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js +1 -1
- package/build-module/plugins/index.js +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +13 -17
- package/build-style/style.css +13 -17
- package/package.json +32 -32
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +2 -2
- package/src/components/header/plugin-more-menu-item/index.js +3 -3
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +3 -3
- package/src/components/meta-boxes/meta-boxes-area/index.js +1 -1
- package/src/components/sidebar/plugin-document-setting-panel/index.js +3 -3
- package/src/components/sidebar/plugin-post-publish-panel/index.js +3 -3
- package/src/components/sidebar/plugin-post-status-info/index.js +5 -5
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +3 -3
- package/src/components/sidebar/plugin-sidebar/index.js +2 -2
- package/src/components/sidebar/post-status/index.js +19 -25
- package/src/hooks/validate-multiple-use/index.js +2 -2
- package/src/style.scss +0 -1
- package/src/components/sidebar/post-status/style.scss +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_keyboardShortcuts","_editor","_store","MODES","value","label","__","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","useSelect","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","useDispatch","selectedMode","choices","map","choice","disabled","info","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_keyboardShortcuts","_editor","_store","MODES","value","label","__","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","useSelect","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","useDispatch","selectedMode","choices","map","choice","disabled","info","_react","createElement","MenuGroup","MenuItemsChoice","onSelect","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMM,KAAK,GAAG,CACb;EACCC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB;AAC5B,CAAC,EACD;EACCF,KAAK,EAAE,MAAM;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,aAAc;AAC1B,CAAC,CACD;AAED,SAASC,YAAYA,CAAA,EA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ACTC,QAAQ,EAAE,IAAI;QACdC,IAAI,EAAE,IAAAxB,QAAE,EACP,4DACD;MACD,CAAC;IACF;IACA,IAAKsB,MAAM,CAACxB,KAAK,KAAKqB,YAAY,IAAI,CAAEG,MAAM,CAACC,QAAQ,EAAG;MACzD,OAAO;QAAE,GAAGD,MAAM;QAAEpB;MAAS,CAAC;IAC/B;IACA,OAAOoB,MAAM;EACd,CAAE,CAAC;EAEH,OACC,IAAAG,MAAA,CAAAC,aAAA,EAAClC,WAAA,CAAAmC,SAAS;IAAC5B,KAAK,EAAG,IAAAC,QAAE,EAAE,QAAS;EAAG,GAClC,IAAAyB,MAAA,CAAAC,aAAA,EAAClC,WAAA,CAAAoC,eAAe;IACfR,OAAO,EAAGA,OAAS;IACnBtB,KAAK,EAAGqB,YAAc;IACtBU,QAAQ,EAAGZ;EAAkB,CAC7B,CACS,CAAC;AAEd;AAAC,IAAAa,QAAA,GAEc7B,YAAY;AAAA8B,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _interface = require("@wordpress/interface");
|
|
@@ -26,7 +26,7 @@ const MoreMenu = ({
|
|
|
26
26
|
showIconLabels
|
|
27
27
|
}) => {
|
|
28
28
|
const isLargeViewport = (0, _compose.useViewportMatch)('large');
|
|
29
|
-
return (0,
|
|
29
|
+
return (0, _react.createElement)(_interface.MoreMenuDropdown, {
|
|
30
30
|
toggleProps: {
|
|
31
31
|
showTooltip: !showIconLabels,
|
|
32
32
|
...(showIconLabels && {
|
|
@@ -35,21 +35,21 @@ const MoreMenu = ({
|
|
|
35
35
|
}
|
|
36
36
|
}, ({
|
|
37
37
|
onClose
|
|
38
|
-
}) => (0,
|
|
38
|
+
}) => (0, _react.createElement)(_react.Fragment, null, showIconLabels && !isLargeViewport && (0, _react.createElement)(_interface.PinnedItems.Slot, {
|
|
39
39
|
className: showIconLabels && 'show-icon-labels',
|
|
40
40
|
scope: "core/edit-post"
|
|
41
|
-
}), (0,
|
|
41
|
+
}), (0, _react.createElement)(_writingMenu.default, null), (0, _react.createElement)(_modeSwitcher.default, null), (0, _react.createElement)(_interface.ActionItem.Slot, {
|
|
42
42
|
name: "core/edit-post/plugin-more-menu",
|
|
43
43
|
label: (0, _i18n.__)('Plugins'),
|
|
44
44
|
as: _components.MenuGroup,
|
|
45
45
|
fillProps: {
|
|
46
46
|
onClick: onClose
|
|
47
47
|
}
|
|
48
|
-
}), (0,
|
|
48
|
+
}), (0, _react.createElement)(_toolsMoreMenuGroup.default.Slot, {
|
|
49
49
|
fillProps: {
|
|
50
50
|
onClose
|
|
51
51
|
}
|
|
52
|
-
}), (0,
|
|
52
|
+
}), (0, _react.createElement)(_components.MenuGroup, null, (0, _react.createElement)(_preferencesMenuItem.default, null))));
|
|
53
53
|
};
|
|
54
54
|
var _default = MoreMenu;
|
|
55
55
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_interface","_compose","_modeSwitcher","_interopRequireDefault","_preferencesMenuItem","_toolsMoreMenuGroup","_writingMenu","MoreMenu","showIconLabels","isLargeViewport","useViewportMatch","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_interface","_compose","_modeSwitcher","_interopRequireDefault","_preferencesMenuItem","_toolsMoreMenuGroup","_writingMenu","MoreMenu","showIconLabels","isLargeViewport","useViewportMatch","_react","createElement","MoreMenuDropdown","toggleProps","showTooltip","variant","onClose","Fragment","PinnedItems","Slot","className","scope","default","ActionItem","name","label","__","as","MenuGroup","fillProps","onClick","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup } from '@wordpress/components';\nimport {\n\tActionItem,\n\tMoreMenuDropdown,\n\tPinnedItems,\n} from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ModeSwitcher from '../mode-switcher';\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<MoreMenuDropdown\n\t\t\ttoggleProps={ {\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t} }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t\t<PinnedItems.Slot\n\t\t\t\t\t\t\tclassName={ showIconLabels && 'show-icon-labels' }\n\t\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<WritingMenu />\n\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/edit-post/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<PreferencesMenuItem />\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</MoreMenuDropdown>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,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;IAAQ;EAAG,CAClC,CAAC,EACF,IAAAN,MAAA,CAAAC,aAAA,EAACP,mBAAA,CAAAkB,OAAkB,CAACH,IAAI;IAACU,SAAS,EAAG;MAAEb;IAAQ;EAAG,CAAE,CAAC,EACrD,IAAAN,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAA8B,SAAS,QACT,IAAAlB,MAAA,CAAAC,aAAA,EAACR,oBAAA,CAAAmB,OAAmB,MAAE,CACZ,CACV,CAEc,CAAC;AAErB,CAAC;AAAC,IAAAS,QAAA,GAEazB,QAAQ;AAAA0B,OAAA,CAAAV,OAAA,GAAAS,QAAA"}
|
|
@@ -26,14 +26,14 @@ var _plugins = require("@wordpress/plugins");
|
|
|
26
26
|
* // Using ES5 syntax
|
|
27
27
|
* var __ = wp.i18n.__;
|
|
28
28
|
* var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;
|
|
29
|
-
* var moreIcon =
|
|
29
|
+
* var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
30
30
|
*
|
|
31
31
|
* function onButtonClick() {
|
|
32
32
|
* alert( 'Button clicked.' );
|
|
33
33
|
* }
|
|
34
34
|
*
|
|
35
35
|
* function MyButtonMoreMenuItem() {
|
|
36
|
-
* return
|
|
36
|
+
* return React.createElement(
|
|
37
37
|
* PluginMoreMenuItem,
|
|
38
38
|
* {
|
|
39
39
|
* icon: moreIcon,
|
|
@@ -65,7 +65,7 @@ var _plugins = require("@wordpress/plugins");
|
|
|
65
65
|
* );
|
|
66
66
|
* ```
|
|
67
67
|
*
|
|
68
|
-
* @return {
|
|
68
|
+
* @return {Component} The component to be rendered.
|
|
69
69
|
*/
|
|
70
70
|
var _default = (0, _compose.compose)((0, _plugins.withPluginContext)((context, ownProps) => {
|
|
71
71
|
var _ownProps$as;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_interface","require","_compose","_components","_plugins","_default","compose","withPluginContext","context","ownProps","_ownProps$as","as","MenuItem","icon","name","ActionItem","exports","default"],"sources":["@wordpress/edit-post/src/components/header/plugin-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ActionItem } from '@wordpress/interface';\nimport { compose } from '@wordpress/compose';\nimport { MenuItem } from '@wordpress/components';\nimport { withPluginContext } from '@wordpress/plugins';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.\n * @param {...*} [props.other] Any additional props are passed through to the underlying [MenuItem](https://github.com/WordPress/gutenberg/tree/HEAD/packages/components/src/menu-item/README.md) component.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;\n * var moreIcon =
|
|
1
|
+
{"version":3,"names":["_interface","require","_compose","_components","_plugins","_default","compose","withPluginContext","context","ownProps","_ownProps$as","as","MenuItem","icon","name","ActionItem","exports","default"],"sources":["@wordpress/edit-post/src/components/header/plugin-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ActionItem } from '@wordpress/interface';\nimport { compose } from '@wordpress/compose';\nimport { MenuItem } from '@wordpress/components';\nimport { withPluginContext } from '@wordpress/plugins';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.\n * @param {...*} [props.other] Any additional props are passed through to the underlying [MenuItem](https://github.com/WordPress/gutenberg/tree/HEAD/packages/components/src/menu-item/README.md) component.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * function MyButtonMoreMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginMoreMenuItem,\n * \t\t{\n * \t\t\ticon: moreIcon,\n * \t\t\tonClick: onButtonClick,\n * \t\t},\n * \t\t__( 'My button title' )\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginMoreMenuItem } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * const MyButtonMoreMenuItem = () => (\n * \t<PluginMoreMenuItem\n * \t\ticon={ more }\n * \t\tonClick={ onButtonClick }\n * \t>\n * \t\t{ __( 'My button title' ) }\n * \t</PluginMoreMenuItem>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nexport default compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\tas: ownProps.as ?? MenuItem,\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t\tname: 'core/edit-post/plugin-more-menu',\n\t\t};\n\t} )\n)( ActionItem );\n"],"mappings":";;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AANA;AACA;AACA;AAMA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvDA,IAAAI,QAAA,GAwDe,IAAAC,gBAAO,EACrB,IAAAC,0BAAiB,EAAE,CAAEC,OAAO,EAAEC,QAAQ,KAAM;EAAA,IAAAC,YAAA;EAC3C,OAAO;IACNC,EAAE,GAAAD,YAAA,GAAED,QAAQ,CAACE,EAAE,cAAAD,YAAA,cAAAA,YAAA,GAAIE,oBAAQ;IAC3BC,IAAI,EAAEJ,QAAQ,CAACI,IAAI,IAAIL,OAAO,CAACK,IAAI;IACnCC,IAAI,EAAE;EACP,CAAC;AACF,CAAE,CACH,CAAC,CAAEC,qBAAW,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAZ,QAAA"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PluginSidebarMoreMenuItem;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _interface = require("@wordpress/interface");
|
|
9
9
|
/**
|
|
10
10
|
* WordPress dependencies
|
|
@@ -24,10 +24,10 @@ var _interface = require("@wordpress/interface");
|
|
|
24
24
|
* // Using ES5 syntax
|
|
25
25
|
* var __ = wp.i18n.__;
|
|
26
26
|
* var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
|
|
27
|
-
* var moreIcon =
|
|
27
|
+
* var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
28
28
|
*
|
|
29
29
|
* function MySidebarMoreMenuItem() {
|
|
30
|
-
* return
|
|
30
|
+
* return React.createElement(
|
|
31
31
|
* PluginSidebarMoreMenuItem,
|
|
32
32
|
* {
|
|
33
33
|
* target: 'my-sidebar',
|
|
@@ -55,11 +55,11 @@ var _interface = require("@wordpress/interface");
|
|
|
55
55
|
* );
|
|
56
56
|
* ```
|
|
57
57
|
*
|
|
58
|
-
* @return {
|
|
58
|
+
* @return {Component} The component to be rendered.
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
61
|
function PluginSidebarMoreMenuItem(props) {
|
|
62
|
-
return (0,
|
|
62
|
+
return (0, _react.createElement)(_interface.ComplementaryAreaMoreMenuItem
|
|
63
63
|
// Menu item is marked with unstable prop for backward compatibility.
|
|
64
64
|
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
65
65
|
, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_interface","require","PluginSidebarMoreMenuItem","props","
|
|
1
|
+
{"version":3,"names":["_interface","require","PluginSidebarMoreMenuItem","props","_react","createElement","ComplementaryAreaMoreMenuItem","__unstableExplicitMenuItem","scope"],"sources":["@wordpress/edit-post/src/components/header/plugin-sidebar-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down,\n * and can be used to activate the corresponding `PluginSidebar` component.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component props.\n * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MySidebarMoreMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginSidebarMoreMenuItem,\n * \t\t{\n * \t\t\ttarget: 'my-sidebar',\n * \t\t\ticon: moreIcon,\n * \t\t},\n * \t\t__( 'My sidebar title' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MySidebarMoreMenuItem = () => (\n * \t<PluginSidebarMoreMenuItem\n * \t\ttarget=\"my-sidebar\"\n * \t\ticon={ more }\n * \t>\n * \t\t{ __( 'My sidebar title' ) }\n * \t</PluginSidebarMoreMenuItem>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\n\nexport default function PluginSidebarMoreMenuItem( props ) {\n\treturn (\n\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t// Menu item is marked with unstable prop for backward compatibility.\n\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t__unstableExplicitMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;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;AACA;AACA;AACA;;AAEe,SAASC,yBAAyBA,CAAEC,KAAK,EAAG;EAC1D,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACL,UAAA,CAAAM;EACA;EACA;EAAA;IACAC,0BAA0B;IAC1BC,KAAK,EAAC,gBAAgB;IAAA,GACjBL;EAAK,CACV,CAAC;AAEJ"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.PostPublishButtonOrToggle = PostPublishButtonOrToggle;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _compose = require("@wordpress/compose");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
@@ -66,7 +66,7 @@ function PostPublishButtonOrToggle({
|
|
|
66
66
|
} else {
|
|
67
67
|
component = IS_BUTTON;
|
|
68
68
|
}
|
|
69
|
-
return (0,
|
|
69
|
+
return (0, _react.createElement)(_editor.PostPublishButton, {
|
|
70
70
|
forceIsDirty: forceIsDirty,
|
|
71
71
|
isOpen: isPublishSidebarOpened,
|
|
72
72
|
isToggle: component === IS_TOGGLE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_editor","_store","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","useViewportMatch","component","
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_editor","_store","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","useViewportMatch","component","_react","createElement","PostPublishButton","isOpen","isToggle","onToggle","_default","compose","withSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","editPostStore","isCurrentPostScheduled","withDispatch","dispatch","exports","default"],"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else if ( isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened:\n\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editPostStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGO,SAASI,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,2BAA2B,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EACrE,IAAIC,SAAS;;EAEb;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CAAC,CAAC;IAChDC,sBAAsB,EACrBkB,MAAM,CAAEQ,YAAc,CAAC,CAAC1B,sBAAsB,CAAC,CAAC;IACjDC,WAAW,EAAEiB,MAAM,CAAEE,aAAY,CAAC,CAACO,sBAAsB,CAAC;EAC3D,CAAC;AAAA,CAAG,CAAC,EACL,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAE3B;EAAqB,CAAC,GAAG2B,QAAQ,CAAEH,YAAc,CAAC;EAC1D,OAAO;IACNxB;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC;AAAAqC,OAAA,CAAAC,OAAA,GAAAhB,QAAA"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PreferencesMenuItem;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
@@ -22,7 +22,7 @@ function PreferencesMenuItem() {
|
|
|
22
22
|
const {
|
|
23
23
|
openModal
|
|
24
24
|
} = (0, _data.useDispatch)(_interface.store);
|
|
25
|
-
return (0,
|
|
25
|
+
return (0, _react.createElement)(_components.MenuItem, {
|
|
26
26
|
onClick: () => {
|
|
27
27
|
openModal(_preferencesModal.PREFERENCES_MODAL_NAME);
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_components","_interface","_preferencesModal","PreferencesMenuItem","openModal","useDispatch","interfaceStore","
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_components","_interface","_preferencesModal","PreferencesMenuItem","openModal","useDispatch","interfaceStore","_react","createElement","MenuItem","onClick","PREFERENCES_MODAL_NAME","__"],"sources":["@wordpress/edit-post/src/components/header/preferences-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_MODAL_NAME } from '../../../components/preferences-modal';\n\nexport default function PreferencesMenuItem() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Preferences' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,iBAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGe,SAASK,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EACnD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACR,WAAA,CAAAS,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfN,SAAS,CAAEO,wCAAuB,CAAC;IACpC;EAAG,GAED,IAAAC,QAAE,EAAE,aAAc,CACX,CAAC;AAEb"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
/**
|
|
@@ -17,9 +17,9 @@ const {
|
|
|
17
17
|
} = (0, _components.createSlotFill)('ToolsMoreMenuGroup');
|
|
18
18
|
ToolsMoreMenuGroup.Slot = ({
|
|
19
19
|
fillProps
|
|
20
|
-
}) => (0,
|
|
20
|
+
}) => (0, _react.createElement)(Slot, {
|
|
21
21
|
fillProps: fillProps
|
|
22
|
-
}, fills => fills.length > 0 && (0,
|
|
22
|
+
}, fills => fills.length > 0 && (0, _react.createElement)(_components.MenuGroup, {
|
|
23
23
|
label: (0, _i18n.__)('Tools')
|
|
24
24
|
}, fills));
|
|
25
25
|
var _default = ToolsMoreMenuGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","Fill","ToolsMoreMenuGroup","Slot","createSlotFill","fillProps","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","Fill","ToolsMoreMenuGroup","Slot","createSlotFill","fillProps","_react","createElement","fills","length","MenuGroup","label","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\tfills.length > 0 && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAM;EAAEE,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvC,IAAAC,0BAAc,EAAE,oBAAqB,CAAC;AAEvCF,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEE;AAAU,CAAC,KACxC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,IAAI;EAACE,SAAS,EAAGA;AAAW,GACxBG,KAAK,IACRA,KAAK,CAACC,MAAM,GAAG,CAAC,IACf,IAAAH,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAY,SAAS;EAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,OAAQ;AAAG,GAAGJ,KAAkB,CAGpD,CACN;AAAC,IAAAK,QAAA,GAEaX,kBAAkB;AAAAY,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -44,9 +44,9 @@ function WritingMenu() {
|
|
|
44
44
|
if (!isLargeViewport) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
return (0,
|
|
47
|
+
return (0, _react.createElement)(_components.MenuGroup, {
|
|
48
48
|
label: (0, _i18n._x)('View', 'noun')
|
|
49
|
-
}, (0,
|
|
49
|
+
}, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
50
50
|
scope: "core/edit-post",
|
|
51
51
|
disabled: isDistractionFree,
|
|
52
52
|
name: "fixedToolbar",
|
|
@@ -54,14 +54,14 @@ function WritingMenu() {
|
|
|
54
54
|
info: (0, _i18n.__)('Access all block and document tools in a single place'),
|
|
55
55
|
messageActivated: (0, _i18n.__)('Top toolbar activated'),
|
|
56
56
|
messageDeactivated: (0, _i18n.__)('Top toolbar deactivated')
|
|
57
|
-
}), (0,
|
|
57
|
+
}), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
58
58
|
scope: "core/edit-post",
|
|
59
59
|
name: "focusMode",
|
|
60
60
|
label: (0, _i18n.__)('Spotlight mode'),
|
|
61
61
|
info: (0, _i18n.__)('Focus on one block at a time'),
|
|
62
62
|
messageActivated: (0, _i18n.__)('Spotlight mode activated'),
|
|
63
63
|
messageDeactivated: (0, _i18n.__)('Spotlight mode deactivated')
|
|
64
|
-
}), (0,
|
|
64
|
+
}), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
65
65
|
scope: "core/edit-post",
|
|
66
66
|
name: "fullscreenMode",
|
|
67
67
|
label: (0, _i18n.__)('Fullscreen mode'),
|
|
@@ -69,7 +69,7 @@ function WritingMenu() {
|
|
|
69
69
|
messageActivated: (0, _i18n.__)('Fullscreen mode activated'),
|
|
70
70
|
messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated'),
|
|
71
71
|
shortcut: _keycodes.displayShortcut.secondary('f')
|
|
72
|
-
}), (0,
|
|
72
|
+
}), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
73
73
|
scope: "core/edit-post",
|
|
74
74
|
name: "distractionFree",
|
|
75
75
|
onToggle: toggleDistractionFree,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_compose","_keycodes","_preferences","_blockEditor","_store","WritingMenu","registry","useRegistry","isDistractionFree","useSelect","select","blockEditorStore","getSettings","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","useDispatch","postEditorStore","set","setPreference","preferencesStore","toggleDistractionFree","batch","isLargeViewport","useViewportMatch","
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_compose","_keycodes","_preferences","_blockEditor","_store","WritingMenu","registry","useRegistry","isDistractionFree","useSelect","select","blockEditorStore","getSettings","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","useDispatch","postEditorStore","set","setPreference","preferencesStore","toggleDistractionFree","batch","isLargeViewport","useViewportMatch","_react","createElement","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","disabled","name","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","onToggle","primaryShift","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as postEditorStore } from '../../../store';\n\nfunction WritingMenu() {\n\tconst registry = useRegistry();\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree,\n\t\t[]\n\t);\n\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( postEditorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tdisabled={ isDistractionFree }\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide admin UI' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingMenu;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,SAASQ,WAAWA,CAAA,EAAG;EACtB,MAA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AC,IAAAC,QAAA,GAEctC,WAAW;AAAAuC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
11
11
|
var _shortcut = _interopRequireDefault(require("./shortcut"));
|
|
@@ -39,7 +39,7 @@ function DynamicShortcut({
|
|
|
39
39
|
if (!keyCombination) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
|
-
return (0,
|
|
42
|
+
return (0, _react.createElement)(_shortcut.default, {
|
|
43
43
|
keyCombination: keyCombination,
|
|
44
44
|
description: description,
|
|
45
45
|
aliases: aliases
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_keyboardShortcuts","_shortcut","_interopRequireDefault","DynamicShortcut","name","keyCombination","description","aliases","useSelect","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore","
|
|
1
|
+
{"version":3,"names":["_data","require","_keyboardShortcuts","_shortcut","_interopRequireDefault","DynamicShortcut","name","keyCombination","description","aliases","useSelect","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore","_react","createElement","default","_default","exports"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nfunction DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n\nexport default DynamicShortcut;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAKA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASI,eAAeA,CAAE;EAAEC;AAAK,CAAC,EAAG;EACpC,MAAM;IAAEC,cAAc;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAG,IAAAC,eAAS,EACvDC,MAAM,IAAM;IACb,MAAM;MACLC,yBAAyB;MACzBC,sBAAsB;MACtBC;IACD,CAAC,GAAGH,MAAM,CAAEI,wBAAuB,CAAC;IAEpC,OAAO;MACNR,cAAc,EAAEK,yBAAyB,CAAEN,IAAK,CAAC;MACjDG,OAAO,EAAEK,kBAAkB,CAAER,IAAK,CAAC;MACnCE,WAAW,EAAEK,sBAAsB,CAAEP,IAAK;IAC3C,CAAC;EACF,CAAC,EACD,CAAEA,IAAI,CACP,CAAC;EAED,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,SAAA,CAAAe,OAAQ;IACRX,cAAc,EAAGA,cAAgB;IACjCC,WAAW,EAAGA,WAAa;IAC3BC,OAAO,EAAGA;EAAS,CACnB,CAAC;AAEJ;AAAC,IAAAU,QAAA,GAEcd,eAAe;AAAAe,OAAA,CAAAF,OAAA,GAAAC,QAAA"}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.KEYBOARD_SHORTCUT_HELP_MODAL_NAME = void 0;
|
|
8
8
|
exports.KeyboardShortcutHelpModal = KeyboardShortcutHelpModal;
|
|
9
9
|
exports.default = void 0;
|
|
10
|
-
var
|
|
10
|
+
var _react = require("react");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _components = require("@wordpress/components");
|
|
13
13
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -40,15 +40,15 @@ const ShortcutList = ({
|
|
|
40
40
|
* Safari+VoiceOver won't announce the list otherwise.
|
|
41
41
|
*/
|
|
42
42
|
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
43
|
-
(0,
|
|
43
|
+
(0, _react.createElement)("ul", {
|
|
44
44
|
className: "edit-post-keyboard-shortcut-help-modal__shortcut-list",
|
|
45
45
|
role: "list"
|
|
46
|
-
}, shortcuts.map((shortcut, index) => (0,
|
|
46
|
+
}, shortcuts.map((shortcut, index) => (0, _react.createElement)("li", {
|
|
47
47
|
className: "edit-post-keyboard-shortcut-help-modal__shortcut",
|
|
48
48
|
key: index
|
|
49
|
-
}, typeof shortcut === 'string' ? (0,
|
|
49
|
+
}, typeof shortcut === 'string' ? (0, _react.createElement)(_dynamicShortcut.default, {
|
|
50
50
|
name: shortcut
|
|
51
|
-
}) : (0,
|
|
51
|
+
}) : (0, _react.createElement)(_shortcut.default, {
|
|
52
52
|
...shortcut
|
|
53
53
|
}))))
|
|
54
54
|
/* eslint-enable jsx-a11y/no-redundant-roles */;
|
|
@@ -57,11 +57,11 @@ const ShortcutSection = ({
|
|
|
57
57
|
title,
|
|
58
58
|
shortcuts,
|
|
59
59
|
className
|
|
60
|
-
}) => (0,
|
|
60
|
+
}) => (0, _react.createElement)("section", {
|
|
61
61
|
className: (0, _classnames.default)('edit-post-keyboard-shortcut-help-modal__section', className)
|
|
62
|
-
}, !!title && (0,
|
|
62
|
+
}, !!title && (0, _react.createElement)("h2", {
|
|
63
63
|
className: "edit-post-keyboard-shortcut-help-modal__section-title"
|
|
64
|
-
}, title), (0,
|
|
64
|
+
}, title), (0, _react.createElement)(ShortcutList, {
|
|
65
65
|
shortcuts: shortcuts
|
|
66
66
|
}));
|
|
67
67
|
const ShortcutCategorySection = ({
|
|
@@ -72,7 +72,7 @@ const ShortcutCategorySection = ({
|
|
|
72
72
|
const categoryShortcuts = (0, _data.useSelect)(select => {
|
|
73
73
|
return select(_keyboardShortcuts.store).getCategoryShortcuts(categoryName);
|
|
74
74
|
}, [categoryName]);
|
|
75
|
-
return (0,
|
|
75
|
+
return (0, _react.createElement)(ShortcutSection, {
|
|
76
76
|
title: title,
|
|
77
77
|
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
78
78
|
});
|
|
@@ -85,21 +85,21 @@ function KeyboardShortcutHelpModal({
|
|
|
85
85
|
if (!isModalActive) {
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
|
-
return (0,
|
|
88
|
+
return (0, _react.createElement)(_components.Modal, {
|
|
89
89
|
className: "edit-post-keyboard-shortcut-help-modal",
|
|
90
90
|
title: (0, _i18n.__)('Keyboard shortcuts'),
|
|
91
91
|
closeButtonLabel: (0, _i18n.__)('Close'),
|
|
92
92
|
onRequestClose: toggleModal
|
|
93
|
-
}, (0,
|
|
93
|
+
}, (0, _react.createElement)(ShortcutSection, {
|
|
94
94
|
className: "edit-post-keyboard-shortcut-help-modal__main-shortcuts",
|
|
95
95
|
shortcuts: ['core/edit-post/keyboard-shortcuts']
|
|
96
|
-
}), (0,
|
|
96
|
+
}), (0, _react.createElement)(ShortcutCategorySection, {
|
|
97
97
|
title: (0, _i18n.__)('Global shortcuts'),
|
|
98
98
|
categoryName: "global"
|
|
99
|
-
}), (0,
|
|
99
|
+
}), (0, _react.createElement)(ShortcutCategorySection, {
|
|
100
100
|
title: (0, _i18n.__)('Selection shortcuts'),
|
|
101
101
|
categoryName: "selection"
|
|
102
|
-
}), (0,
|
|
102
|
+
}), (0, _react.createElement)(ShortcutCategorySection, {
|
|
103
103
|
title: (0, _i18n.__)('Block shortcuts'),
|
|
104
104
|
categoryName: "block",
|
|
105
105
|
additionalShortcuts: [{
|
|
@@ -110,7 +110,7 @@ function KeyboardShortcutHelpModal({
|
|
|
110
110
|
/* translators: The forward-slash character. e.g. '/'. */
|
|
111
111
|
ariaLabel: (0, _i18n.__)('Forward-slash')
|
|
112
112
|
}]
|
|
113
|
-
}), (0,
|
|
113
|
+
}), (0, _react.createElement)(ShortcutSection, {
|
|
114
114
|
title: (0, _i18n.__)('Text formatting'),
|
|
115
115
|
shortcuts: _config.textFormattingShortcuts
|
|
116
116
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_keyboardShortcuts","_data","_compose","_interface","_config","_shortcut","_dynamicShortcut","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","exports","ShortcutList","shortcuts","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_keyboardShortcuts","_data","_compose","_interface","_config","_shortcut","_dynamicShortcut","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","exports","ShortcutList","shortcuts","_react","createElement","className","role","map","shortcut","index","key","default","name","ShortcutSection","title","classnames","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","useSelect","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","useShortcut","Modal","__","closeButtonLabel","onRequestClose","keyCombination","character","description","ariaLabel","textFormattingShortcuts","_default","compose","withSelect","interfaceStore","withDispatch","dispatch","openModal","closeModal"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/index.js"],"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';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nexport const KEYBOARD_SHORTCUT_HELP_MODAL_NAME =\n\t'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\tcloseButtonLabel={ __( '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( interfaceStore ).isModalActive(\n\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t),\n\t} ) ),\n\twithDispatch( ( dispatch, { isModalActive } ) => {\n\t\tconst { openModal, closeModal } = dispatch( interfaceStore );\n\n\t\treturn {\n\t\t\ttoggleModal: () =>\n\t\t\t\tisModalActive\n\t\t\t\t\t? closeModal()\n\t\t\t\t\t: openModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME ),\n\t\t};\n\t} ),\n] )( KeyboardShortcutHelpModal );\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,gBAAA,GAAAV,sBAAA,CAAAC,OAAA;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAKO,MAAMU,iCAAiC,GAC7C,kCAAkC;AAACC,OAAA,CAAAD,iCAAA,GAAAA,iCAAA;AAEpC,MAAME,YAAY,GAAGA,CAAE;EAAEC;AAAU,CAAC;AACnC;AACD;AACA;AACA;AACC;AACA,IAAAC,MAAA,CAAAC,aAAA;EACCC,SAAS,EAAC,uDAAuD;EACjEC,IAAI,EAAC;AAAM,G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