@wordpress/edit-post 7.32.0 → 7.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +17 -223
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +0 -1
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +1 -38
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +20 -51
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +1 -1
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +17 -42
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/more-menu/manage-patterns-menu-item.js +40 -0
- package/build/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +0 -123
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +28 -29
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +3 -32
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +35 -12
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +68 -41
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -1
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/visual-editor/use-padding-appender.js +62 -0
- package/build/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +132 -0
- package/build/deprecated.js.map +1 -0
- package/build/editor.js +2 -2
- package/build/editor.js.map +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +5 -22
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/components/index.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +19 -62
- package/build/index.js.map +1 -1
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +10 -8
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +34 -19
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -2
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +2 -38
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +22 -53
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/index.native.js +1 -1
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +17 -42
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js +33 -0
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build-module/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -124
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +28 -29
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -32
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +36 -14
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +71 -44
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/visual-editor/use-padding-appender.js +55 -0
- package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +116 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/editor.js +2 -2
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +7 -24
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/components/index.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +2 -15
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +8 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +33 -18
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/build-style/classic-rtl.css +2 -2
- package/build-style/classic.css +2 -2
- package/build-style/style-rtl.css +18 -589
- package/build-style/style.css +18 -589
- package/package.json +32 -34
- package/src/classic.scss +1 -1
- package/src/components/editor-initialization/index.js +1 -5
- package/src/components/editor-initialization/listener-hooks.js +1 -40
- package/src/components/editor-initialization/test/listener-hooks.js +1 -96
- package/src/components/header/index.js +25 -71
- package/src/components/header/index.native.js +1 -1
- package/src/components/header/more-menu/index.js +27 -43
- package/src/components/header/more-menu/manage-patterns-menu-item.js +33 -0
- package/src/components/header/style.scss +5 -82
- package/src/components/keyboard-shortcuts/index.js +2 -148
- package/src/components/layout/index.js +26 -47
- package/src/components/layout/style.scss +7 -80
- package/src/components/preferences-modal/index.js +3 -46
- package/src/components/sidebar/post-status/index.js +61 -24
- package/src/components/sidebar/settings-sidebar/index.js +113 -73
- package/src/components/visual-editor/block-inspector-button.js +1 -1
- package/src/components/visual-editor/index.js +4 -0
- package/src/components/visual-editor/use-padding-appender.js +66 -0
- package/src/deprecated.js +107 -0
- package/src/editor.js +2 -2
- package/src/hooks/commands/use-common-commands.js +11 -26
- package/src/index.js +3 -20
- package/src/store/actions.js +10 -12
- package/src/store/selectors.js +41 -33
- package/src/store/test/actions.js +11 -10
- package/src/style.scss +1 -19
- package/build/components/header/plugin-more-menu-item/index.js +0 -78
- package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/header/post-publish-button-or-toggle.js +0 -91
- package/build/components/header/post-publish-button-or-toggle.js.map +0 -1
- package/build/components/header/preferences-menu-item/index.js +0 -31
- package/build/components/header/preferences-menu-item/index.js.map +0 -1
- package/build/components/header/tools-more-menu-group/index.js +0 -26
- package/build/components/header/tools-more-menu-group/index.js.map +0 -1
- package/build/components/header/writing-menu/index.js +0 -71
- package/build/components/header/writing-menu/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -132
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/layout/actions-panel.js +0 -86
- package/build/components/layout/actions-panel.js.map +0 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +0 -38
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +0 -39
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
- package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +0 -43
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
- package/build/components/sidebar/plugin-sidebar/index.js +0 -104
- package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build/components/start-page-options/index.js +0 -107
- package/build/components/start-page-options/index.js.map +0 -1
- package/build/plugins/copy-content-menu-item/index.js +0 -39
- package/build/plugins/copy-content-menu-item/index.js.map +0 -1
- package/build/plugins/index.js +0 -69
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -41
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
- package/build/plugins/welcome-guide-menu-item/index.js.map +0 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +0 -83
- package/build-module/components/header/post-publish-button-or-toggle.js.map +0 -1
- package/build-module/components/header/preferences-menu-item/index.js +0 -24
- package/build-module/components/header/preferences-menu-item/index.js.map +0 -1
- package/build-module/components/header/tools-more-menu-group/index.js +0 -19
- package/build-module/components/header/tools-more-menu-group/index.js.map +0 -1
- package/build-module/components/header/writing-menu/index.js +0 -64
- package/build-module/components/header/writing-menu/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -122
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/layout/actions-panel.js +0 -78
- package/build-module/components/layout/actions-panel.js.map +0 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +0 -31
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +0 -32
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +0 -36
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/start-page-options/index.js +0 -100
- package/build-module/components/start-page-options/index.js.map +0 -1
- package/build-module/plugins/copy-content-menu-item/index.js +0 -32
- package/build-module/plugins/copy-content-menu-item/index.js.map +0 -1
- package/build-module/plugins/index.js +0 -65
- package/build-module/plugins/index.js.map +0 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -33
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +0 -1
- package/src/components/header/plugin-more-menu-item/index.js +0 -73
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/header/post-publish-button-or-toggle.js +0 -92
- package/src/components/header/preferences-menu-item/index.js +0 -25
- package/src/components/header/test/index.js +0 -51
- package/src/components/header/tools-more-menu-group/index.js +0 -20
- package/src/components/header/writing-menu/index.js +0 -73
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -163
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
- package/src/components/layout/actions-panel.js +0 -103
- package/src/components/preferences-modal/enable-publish-sidebar.js +0 -32
- package/src/components/preferences-modal/test/index.js +0 -28
- package/src/components/sidebar/plugin-post-publish-panel/index.js +0 -28
- package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
- package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
- package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +0 -32
- package/src/components/sidebar/plugin-sidebar/index.js +0 -94
- package/src/components/start-page-options/index.js +0 -108
- package/src/components/start-page-options/style.scss +0 -26
- package/src/plugins/copy-content-menu-item/index.js +0 -29
- package/src/plugins/index.js +0 -85
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -34
- /package/src/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +0 -0
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import Shortcut from './shortcut';
|
|
12
|
-
function DynamicShortcut({
|
|
13
|
-
name
|
|
14
|
-
}) {
|
|
15
|
-
const {
|
|
16
|
-
keyCombination,
|
|
17
|
-
description,
|
|
18
|
-
aliases
|
|
19
|
-
} = useSelect(select => {
|
|
20
|
-
const {
|
|
21
|
-
getShortcutKeyCombination,
|
|
22
|
-
getShortcutDescription,
|
|
23
|
-
getShortcutAliases
|
|
24
|
-
} = select(keyboardShortcutsStore);
|
|
25
|
-
return {
|
|
26
|
-
keyCombination: getShortcutKeyCombination(name),
|
|
27
|
-
aliases: getShortcutAliases(name),
|
|
28
|
-
description: getShortcutDescription(name)
|
|
29
|
-
};
|
|
30
|
-
}, [name]);
|
|
31
|
-
if (!keyCombination) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
return createElement(Shortcut, {
|
|
35
|
-
keyCombination: keyCombination,
|
|
36
|
-
description: description,
|
|
37
|
-
aliases: aliases
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
export default DynamicShortcut;
|
|
41
|
-
//# sourceMappingURL=dynamic-shortcut.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","keyboardShortcutsStore","Shortcut","DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","createElement"],"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":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;;AAE/E;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,YAAY;AAEjC,SAASC,eAAeA,CAAE;EAAEC;AAAK,CAAC,EAAG;EACpC,MAAM;IAAEC,cAAc;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAGR,SAAS,CACvDS,MAAM,IAAM;IACb,MAAM;MACLC,yBAAyB;MACzBC,sBAAsB;MACtBC;IACD,CAAC,GAAGH,MAAM,CAAEP,sBAAuB,CAAC;IAEpC,OAAO;MACNI,cAAc,EAAEI,yBAAyB,CAAEL,IAAK,CAAC;MACjDG,OAAO,EAAEI,kBAAkB,CAAEP,IAAK,CAAC;MACnCE,WAAW,EAAEI,sBAAsB,CAAEN,IAAK;IAC3C,CAAC;EACF,CAAC,EACD,CAAEA,IAAI,CACP,CAAC;EAED,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAO,IAAI;EACZ;EAEA,OACCO,aAAA,CAACV,QAAQ;IACRG,cAAc,EAAGA,cAAgB;IACjCC,WAAW,EAAGA,WAAa;IAC3BC,OAAO,EAAGA;EAAS,CACnB,CAAC;AAEJ;AAEA,eAAeJ,eAAe"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import classnames from 'classnames';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { Modal } from '@wordpress/components';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
12
|
-
import { useShortcut, store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
13
|
-
import { withSelect, withDispatch, useSelect } from '@wordpress/data';
|
|
14
|
-
import { compose } from '@wordpress/compose';
|
|
15
|
-
import { store as interfaceStore } from '@wordpress/interface';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
import { textFormattingShortcuts } from './config';
|
|
21
|
-
import Shortcut from './shortcut';
|
|
22
|
-
import DynamicShortcut from './dynamic-shortcut';
|
|
23
|
-
export const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'edit-post/keyboard-shortcut-help';
|
|
24
|
-
const ShortcutList = ({
|
|
25
|
-
shortcuts
|
|
26
|
-
}) =>
|
|
27
|
-
/*
|
|
28
|
-
* Disable reason: The `list` ARIA role is redundant but
|
|
29
|
-
* Safari+VoiceOver won't announce the list otherwise.
|
|
30
|
-
*/
|
|
31
|
-
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
32
|
-
createElement("ul", {
|
|
33
|
-
className: "edit-post-keyboard-shortcut-help-modal__shortcut-list",
|
|
34
|
-
role: "list"
|
|
35
|
-
}, shortcuts.map((shortcut, index) => createElement("li", {
|
|
36
|
-
className: "edit-post-keyboard-shortcut-help-modal__shortcut",
|
|
37
|
-
key: index
|
|
38
|
-
}, typeof shortcut === 'string' ? createElement(DynamicShortcut, {
|
|
39
|
-
name: shortcut
|
|
40
|
-
}) : createElement(Shortcut, {
|
|
41
|
-
...shortcut
|
|
42
|
-
}))))
|
|
43
|
-
/* eslint-enable jsx-a11y/no-redundant-roles */;
|
|
44
|
-
const ShortcutSection = ({
|
|
45
|
-
title,
|
|
46
|
-
shortcuts,
|
|
47
|
-
className
|
|
48
|
-
}) => createElement("section", {
|
|
49
|
-
className: classnames('edit-post-keyboard-shortcut-help-modal__section', className)
|
|
50
|
-
}, !!title && createElement("h2", {
|
|
51
|
-
className: "edit-post-keyboard-shortcut-help-modal__section-title"
|
|
52
|
-
}, title), createElement(ShortcutList, {
|
|
53
|
-
shortcuts: shortcuts
|
|
54
|
-
}));
|
|
55
|
-
const ShortcutCategorySection = ({
|
|
56
|
-
title,
|
|
57
|
-
categoryName,
|
|
58
|
-
additionalShortcuts = []
|
|
59
|
-
}) => {
|
|
60
|
-
const categoryShortcuts = useSelect(select => {
|
|
61
|
-
return select(keyboardShortcutsStore).getCategoryShortcuts(categoryName);
|
|
62
|
-
}, [categoryName]);
|
|
63
|
-
return createElement(ShortcutSection, {
|
|
64
|
-
title: title,
|
|
65
|
-
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
export function KeyboardShortcutHelpModal({
|
|
69
|
-
isModalActive,
|
|
70
|
-
toggleModal
|
|
71
|
-
}) {
|
|
72
|
-
useShortcut('core/edit-post/keyboard-shortcuts', toggleModal);
|
|
73
|
-
if (!isModalActive) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
return createElement(Modal, {
|
|
77
|
-
className: "edit-post-keyboard-shortcut-help-modal",
|
|
78
|
-
title: __('Keyboard shortcuts'),
|
|
79
|
-
closeButtonLabel: __('Close'),
|
|
80
|
-
onRequestClose: toggleModal
|
|
81
|
-
}, createElement(ShortcutSection, {
|
|
82
|
-
className: "edit-post-keyboard-shortcut-help-modal__main-shortcuts",
|
|
83
|
-
shortcuts: ['core/edit-post/keyboard-shortcuts']
|
|
84
|
-
}), createElement(ShortcutCategorySection, {
|
|
85
|
-
title: __('Global shortcuts'),
|
|
86
|
-
categoryName: "global"
|
|
87
|
-
}), createElement(ShortcutCategorySection, {
|
|
88
|
-
title: __('Selection shortcuts'),
|
|
89
|
-
categoryName: "selection"
|
|
90
|
-
}), createElement(ShortcutCategorySection, {
|
|
91
|
-
title: __('Block shortcuts'),
|
|
92
|
-
categoryName: "block",
|
|
93
|
-
additionalShortcuts: [{
|
|
94
|
-
keyCombination: {
|
|
95
|
-
character: '/'
|
|
96
|
-
},
|
|
97
|
-
description: __('Change the block type after adding a new paragraph.'),
|
|
98
|
-
/* translators: The forward-slash character. e.g. '/'. */
|
|
99
|
-
ariaLabel: __('Forward-slash')
|
|
100
|
-
}]
|
|
101
|
-
}), createElement(ShortcutSection, {
|
|
102
|
-
title: __('Text formatting'),
|
|
103
|
-
shortcuts: textFormattingShortcuts
|
|
104
|
-
}), createElement(ShortcutCategorySection, {
|
|
105
|
-
title: __('List View shortcuts'),
|
|
106
|
-
categoryName: "list-view"
|
|
107
|
-
}));
|
|
108
|
-
}
|
|
109
|
-
export default compose([withSelect(select => ({
|
|
110
|
-
isModalActive: select(interfaceStore).isModalActive(KEYBOARD_SHORTCUT_HELP_MODAL_NAME)
|
|
111
|
-
})), withDispatch((dispatch, {
|
|
112
|
-
isModalActive
|
|
113
|
-
}) => {
|
|
114
|
-
const {
|
|
115
|
-
openModal,
|
|
116
|
-
closeModal
|
|
117
|
-
} = dispatch(interfaceStore);
|
|
118
|
-
return {
|
|
119
|
-
toggleModal: () => isModalActive ? closeModal() : openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME)
|
|
120
|
-
};
|
|
121
|
-
})])(KeyboardShortcutHelpModal);
|
|
122
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","Modal","__","useShortcut","store","keyboardShortcutsStore","withSelect","withDispatch","useSelect","compose","interfaceStore","textFormattingShortcuts","Shortcut","DynamicShortcut","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","ShortcutList","shortcuts","createElement","className","role","map","shortcut","index","key","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","closeButtonLabel","onRequestClose","keyCombination","character","description","ariaLabel","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\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\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":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,UAAU,EAAEC,YAAY,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASL,KAAK,IAAIM,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,eAAe,MAAM,oBAAoB;AAEhD,OAAO,MAAMC,iCAAiC,GAC7C,kCAAkC;AAEnC,MAAMC,YAAY,GAAGA,CAAE;EAAEC;AAAU,CAAC;AACnC;AACD;AACA;AACA;AACC;AACAC,aAAA;EACCC,SAAS,EAAC,uDAAuD;EACjEC,IAAI,EAAC;AAAM,GAETH,SAAS,CAACI,GAAG,CAAE,CAAEC,QAAQ,EAAEC,KAAK,KACjCL,aAAA;EACCC,SAAS,EAAC,kDAAkD;EAC5DK,GAAG,EAAGD;AAAO,GAEX,OAAOD,QAAQ,KAAK,QAAQ,GAC7BJ,aAAA,CAACJ,eAAe;EAACW,IAAI,EAAGH;AAAU,CAAE,CAAC,GAErCJ,aAAA,CAACL,QAAQ;EAAA,GAAMS;AAAQ,CAAI,CAEzB,CACH,CACC;AACJ,+CACA;AAED,MAAMI,eAAe,GAAGA,CAAE;EAAEC,KAAK;EAAEV,SAAS;EAAEE;AAAU,CAAC,KACxDD,aAAA;EACCC,SAAS,EAAGlB,UAAU,CACrB,iDAAiD,EACjDkB,SACD;AAAG,GAED,CAAC,CAAEQ,KAAK,IACTT,aAAA;EAAIC,SAAS,EAAC;AAAuD,GAClEQ,KACC,CACJ,EACDT,aAAA,CAACF,YAAY;EAACC,SAAS,EAAGA;AAAW,CAAE,CAC/B,CACT;AAED,MAAMW,uBAAuB,GAAGA,CAAE;EACjCD,KAAK;EACLE,YAAY;EACZC,mBAAmB,GAAG;AACvB,CAAC,KAAM;EACN,MAAMC,iBAAiB,GAAGtB,SAAS,CAChCuB,MAAM,IAAM;IACb,OAAOA,MAAM,CAAE1B,sBAAuB,CAAC,CAAC2B,oBAAoB,CAC3DJ,YACD,CAAC;EACF,CAAC,EACD,CAAEA,YAAY,CACf,CAAC;EAED,OACCX,aAAA,CAACQ,eAAe;IACfC,KAAK,EAAGA,KAAO;IACfV,SAAS,EAAGc,iBAAiB,CAACG,MAAM,CAAEJ,mBAAoB;EAAG,CAC7D,CAAC;AAEJ,CAAC;AAED,OAAO,SAASK,yBAAyBA,CAAE;EAAEC,aAAa;EAAEC;AAAY,CAAC,EAAG;EAC3EjC,WAAW,CAAE,mCAAmC,EAAEiC,WAAY,CAAC;EAE/D,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACClB,aAAA,CAAChB,KAAK;IACLiB,SAAS,EAAC,wCAAwC;IAClDQ,KAAK,EAAGxB,EAAE,CAAE,oBAAqB,CAAG;IACpCmC,gBAAgB,EAAGnC,EAAE,CAAE,OAAQ,CAAG;IAClCoC,cAAc,EAAGF;EAAa,GAE9BnB,aAAA,CAACQ,eAAe;IACfP,SAAS,EAAC,wDAAwD;IAClEF,SAAS,EAAG,CAAE,mCAAmC;EAAI,CACrD,CAAC,EACFC,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGxB,EAAE,CAAE,kBAAmB,CAAG;IAClC0B,YAAY,EAAC;EAAQ,CACrB,CAAC,EAEFX,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGxB,EAAE,CAAE,qBAAsB,CAAG;IACrC0B,YAAY,EAAC;EAAW,CACxB,CAAC,EAEFX,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGxB,EAAE,CAAE,iBAAkB,CAAG;IACjC0B,YAAY,EAAC,OAAO;IACpBC,mBAAmB,EAAG,CACrB;MACCU,cAAc,EAAE;QAAEC,SAAS,EAAE;MAAI,CAAC;MAClCC,WAAW,EAAEvC,EAAE,CACd,qDACD,CAAC;MACD;MACAwC,SAAS,EAAExC,EAAE,CAAE,eAAgB;IAChC,CAAC;EACC,CACH,CAAC,EACFe,aAAA,CAACQ,eAAe;IACfC,KAAK,EAAGxB,EAAE,CAAE,iBAAkB,CAAG;IACjCc,SAAS,EAAGL;EAAyB,CACrC,CAAC,EACFM,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGxB,EAAE,CAAE,qBAAsB,CAAG;IACrC0B,YAAY,EAAC;EAAW,CACxB,CACK,CAAC;AAEV;AAEA,eAAenB,OAAO,CAAE,CACvBH,UAAU,CAAIyB,MAAM,KAAQ;EAC3BI,aAAa,EAAEJ,MAAM,CAAErB,cAAe,CAAC,CAACyB,aAAa,CACpDrB,iCACD;AACD,CAAC,CAAG,CAAC,EACLP,YAAY,CAAE,CAAEoC,QAAQ,EAAE;EAAER;AAAc,CAAC,KAAM;EAChD,MAAM;IAAES,SAAS;IAAEC;EAAW,CAAC,GAAGF,QAAQ,CAAEjC,cAAe,CAAC;EAE5D,OAAO;IACN0B,WAAW,EAAEA,CAAA,KACZD,aAAa,GACVU,UAAU,CAAC,CAAC,GACZD,SAAS,CAAE9B,iCAAkC;EAClD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEoB,yBAA0B,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { Fragment } from '@wordpress/element';
|
|
6
|
-
import { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';
|
|
7
|
-
function KeyCombination({
|
|
8
|
-
keyCombination,
|
|
9
|
-
forceAriaLabel
|
|
10
|
-
}) {
|
|
11
|
-
const shortcut = keyCombination.modifier ? displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
12
|
-
const ariaLabel = keyCombination.modifier ? shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
13
|
-
return createElement("kbd", {
|
|
14
|
-
className: "edit-post-keyboard-shortcut-help-modal__shortcut-key-combination",
|
|
15
|
-
"aria-label": forceAriaLabel || ariaLabel
|
|
16
|
-
}, (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => {
|
|
17
|
-
if (character === '+') {
|
|
18
|
-
return createElement(Fragment, {
|
|
19
|
-
key: index
|
|
20
|
-
}, character);
|
|
21
|
-
}
|
|
22
|
-
return createElement("kbd", {
|
|
23
|
-
key: index,
|
|
24
|
-
className: "edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
25
|
-
}, character);
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
function Shortcut({
|
|
29
|
-
description,
|
|
30
|
-
keyCombination,
|
|
31
|
-
aliases = [],
|
|
32
|
-
ariaLabel
|
|
33
|
-
}) {
|
|
34
|
-
return createElement(Fragment, null, createElement("div", {
|
|
35
|
-
className: "edit-post-keyboard-shortcut-help-modal__shortcut-description"
|
|
36
|
-
}, description), createElement("div", {
|
|
37
|
-
className: "edit-post-keyboard-shortcut-help-modal__shortcut-term"
|
|
38
|
-
}, createElement(KeyCombination, {
|
|
39
|
-
keyCombination: keyCombination,
|
|
40
|
-
forceAriaLabel: ariaLabel
|
|
41
|
-
}), aliases.map((alias, index) => createElement(KeyCombination, {
|
|
42
|
-
keyCombination: alias,
|
|
43
|
-
forceAriaLabel: ariaLabel,
|
|
44
|
-
key: index
|
|
45
|
-
}))));
|
|
46
|
-
}
|
|
47
|
-
export default Shortcut;
|
|
48
|
-
//# sourceMappingURL=shortcut.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","createElement","className","Array","isArray","map","index","key","Shortcut","description","aliases","alias"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-post-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-post-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,qBAAqB;AAE5E,SAASC,cAAcA,CAAE;EAAEC,cAAc;EAAEC;AAAe,CAAC,EAAG;EAC7D,MAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAQ,GACrCN,mBAAmB,CAAEG,cAAc,CAACG,QAAQ,CAAE,CAC9CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAC3B,MAAMC,SAAS,GAAGL,cAAc,CAACG,QAAQ,GACtCL,iBAAiB,CAAEE,cAAc,CAACG,QAAQ,CAAE,CAC5CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAE3B,OACCE,aAAA;IACCC,SAAS,EAAC,kEAAkE;IAC5E,cAAaN,cAAc,IAAII;EAAW,GAExC,CAAEG,KAAK,CAACC,OAAO,CAAEP,QAAS,CAAC,GAAGA,QAAQ,GAAG,CAAEA,QAAQ,CAAE,EAAGQ,GAAG,CAC5D,CAAEN,SAAS,EAAEO,KAAK,KAAM;IACvB,IAAKP,SAAS,KAAK,GAAG,EAAG;MACxB,OAAOE,aAAA,CAACV,QAAQ;QAACgB,GAAG,EAAGD;MAAO,GAAGP,SAAqB,CAAC;IACxD;IAEA,OACCE,aAAA;MACCM,GAAG,EAAGD,KAAO;MACbJ,SAAS,EAAC;IAAsD,GAE9DH,SACE,CAAC;EAER,CACD,CACI,CAAC;AAER;AAEA,SAASS,QAAQA,CAAE;EAAEC,WAAW;EAAEd,cAAc;EAAEe,OAAO,GAAG,EAAE;EAAEV;AAAU,CAAC,EAAG;EAC7E,OACCC,aAAA,CAAAV,QAAA,QACCU,aAAA;IAAKC,SAAS,EAAC;EAA8D,GAC1EO,WACE,CAAC,EACNR,aAAA;IAAKC,SAAS,EAAC;EAAuD,GACrED,aAAA,CAACP,cAAc;IACdC,cAAc,EAAGA,cAAgB;IACjCC,cAAc,EAAGI;EAAW,CAC5B,CAAC,EACAU,OAAO,CAACL,GAAG,CAAE,CAAEM,KAAK,EAAEL,KAAK,KAC5BL,aAAA,CAACP,cAAc;IACdC,cAAc,EAAGgB,KAAO;IACxBf,cAAc,EAAGI,SAAW;IAC5BO,GAAG,EAAGD;EAAO,CACb,CACA,CACE,CACJ,CAAC;AAEL;AAEA,eAAeE,QAAQ"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { EntitiesSavedStates, PostPublishPanel, PluginPrePublishPanel, PluginPostPublishPanel, store as editorStore } from '@wordpress/editor';
|
|
6
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
-
import { Button, createSlotFill } from '@wordpress/components';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { useCallback } from '@wordpress/element';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import { store as editPostStore } from '../../store';
|
|
15
|
-
const {
|
|
16
|
-
Fill,
|
|
17
|
-
Slot
|
|
18
|
-
} = createSlotFill('ActionsPanel');
|
|
19
|
-
export const ActionsPanelFill = Fill;
|
|
20
|
-
export default function ActionsPanel({
|
|
21
|
-
setEntitiesSavedStatesCallback,
|
|
22
|
-
closeEntitiesSavedStates,
|
|
23
|
-
isEntitiesSavedStatesOpen
|
|
24
|
-
}) {
|
|
25
|
-
const {
|
|
26
|
-
closePublishSidebar,
|
|
27
|
-
togglePublishSidebar
|
|
28
|
-
} = useDispatch(editorStore);
|
|
29
|
-
const {
|
|
30
|
-
publishSidebarOpened,
|
|
31
|
-
hasActiveMetaboxes,
|
|
32
|
-
hasNonPostEntityChanges
|
|
33
|
-
} = useSelect(select => ({
|
|
34
|
-
publishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
|
|
35
|
-
hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
|
|
36
|
-
hasNonPostEntityChanges: select(editorStore).hasNonPostEntityChanges()
|
|
37
|
-
}), []);
|
|
38
|
-
const openEntitiesSavedStates = useCallback(() => setEntitiesSavedStatesCallback(true), []);
|
|
39
|
-
|
|
40
|
-
// It is ok for these components to be unmounted when not in visual use.
|
|
41
|
-
// We don't want more than one present at a time, decide which to render.
|
|
42
|
-
let unmountableContent;
|
|
43
|
-
if (publishSidebarOpened) {
|
|
44
|
-
unmountableContent = createElement(PostPublishPanel, {
|
|
45
|
-
onClose: closePublishSidebar,
|
|
46
|
-
forceIsDirty: hasActiveMetaboxes,
|
|
47
|
-
PrePublishExtension: PluginPrePublishPanel.Slot,
|
|
48
|
-
PostPublishExtension: PluginPostPublishPanel.Slot
|
|
49
|
-
});
|
|
50
|
-
} else if (hasNonPostEntityChanges) {
|
|
51
|
-
unmountableContent = createElement("div", {
|
|
52
|
-
className: "edit-post-layout__toggle-entities-saved-states-panel"
|
|
53
|
-
}, createElement(Button, {
|
|
54
|
-
variant: "secondary",
|
|
55
|
-
className: "edit-post-layout__toggle-entities-saved-states-panel-button",
|
|
56
|
-
onClick: openEntitiesSavedStates,
|
|
57
|
-
"aria-expanded": false
|
|
58
|
-
}, __('Open save panel')));
|
|
59
|
-
} else {
|
|
60
|
-
unmountableContent = createElement("div", {
|
|
61
|
-
className: "edit-post-layout__toggle-publish-panel"
|
|
62
|
-
}, createElement(Button, {
|
|
63
|
-
variant: "secondary",
|
|
64
|
-
className: "edit-post-layout__toggle-publish-panel-button",
|
|
65
|
-
onClick: togglePublishSidebar,
|
|
66
|
-
"aria-expanded": false
|
|
67
|
-
}, __('Open publish panel')));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Since EntitiesSavedStates controls its own panel, we can keep it
|
|
71
|
-
// always mounted to retain its own component state (such as checkboxes).
|
|
72
|
-
return createElement(Fragment, null, isEntitiesSavedStatesOpen && createElement(EntitiesSavedStates, {
|
|
73
|
-
close: closeEntitiesSavedStates
|
|
74
|
-
}), createElement(Slot, {
|
|
75
|
-
bubblesVirtually: true
|
|
76
|
-
}), !isEntitiesSavedStatesOpen && unmountableContent);
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=actions-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["EntitiesSavedStates","PostPublishPanel","PluginPrePublishPanel","PluginPostPublishPanel","store","editorStore","useSelect","useDispatch","Button","createSlotFill","__","useCallback","editPostStore","Fill","Slot","ActionsPanelFill","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","publishSidebarOpened","hasActiveMetaboxes","hasNonPostEntityChanges","select","isPublishSidebarOpened","hasMetaBoxes","openEntitiesSavedStates","unmountableContent","createElement","onClose","forceIsDirty","PrePublishExtension","PostPublishExtension","className","variant","onClick","Fragment","close","bubblesVirtually"],"sources":["@wordpress/edit-post/src/components/layout/actions-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tEntitiesSavedStates,\n\tPostPublishPanel,\n\tPluginPrePublishPanel,\n\tPluginPostPublishPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function ActionsPanel( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\thasActiveMetaboxes,\n\t\thasNonPostEntityChanges,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tpublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( hasNonPostEntityChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,mBAAmB,EACnBC,gBAAgB,EAChBC,qBAAqB,EACrBC,sBAAsB,EACtBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,aAAa,QAAQ,aAAa;AAEpD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGL,cAAc,CAAE,cAAe,CAAC;AAEvD,OAAO,MAAMM,gBAAgB,GAAGF,IAAI;AAEpC,eAAe,SAASG,YAAYA,CAAE;EACrCC,8BAA8B;EAC9BC,wBAAwB;EACxBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,mBAAmB;IAAEC;EAAqB,CAAC,GAClDd,WAAW,CAAEF,WAAY,CAAC;EAC3B,MAAM;IACLiB,oBAAoB;IACpBC,kBAAkB;IAClBC;EACD,CAAC,GAAGlB,SAAS,CACVmB,MAAM,KAAQ;IACfH,oBAAoB,EACnBG,MAAM,CAAEpB,WAAY,CAAC,CAACqB,sBAAsB,CAAC,CAAC;IAC/CH,kBAAkB,EAAEE,MAAM,CAAEb,aAAc,CAAC,CAACe,YAAY,CAAC,CAAC;IAC1DH,uBAAuB,EACtBC,MAAM,CAAEpB,WAAY,CAAC,CAACmB,uBAAuB,CAAC;EAChD,CAAC,CAAE,EACH,EACD,CAAC;EAED,MAAMI,uBAAuB,GAAGjB,WAAW,CAC1C,MAAMM,8BAA8B,CAAE,IAAK,CAAC,EAC5C,EACD,CAAC;;EAED;EACA;EACA,IAAIY,kBAAkB;EACtB,IAAKP,oBAAoB,EAAG;IAC3BO,kBAAkB,GACjBC,aAAA,CAAC7B,gBAAgB;MAChB8B,OAAO,EAAGX,mBAAqB;MAC/BY,YAAY,EAAGT,kBAAoB;MACnCU,mBAAmB,EAAG/B,qBAAqB,CAACY,IAAM;MAClDoB,oBAAoB,EAAG/B,sBAAsB,CAACW;IAAM,CACpD,CACD;EACF,CAAC,MAAM,IAAKU,uBAAuB,EAAG;IACrCK,kBAAkB,GACjBC,aAAA;MAAKK,SAAS,EAAC;IAAsD,GACpEL,aAAA,CAACtB,MAAM;MACN4B,OAAO,EAAC,WAAW;MACnBD,SAAS,EAAC,6DAA6D;MACvEE,OAAO,EAAGT,uBAAyB;MACnC,iBAAgB;IAAO,GAErBlB,EAAE,CAAE,iBAAkB,CACjB,CACJ,CACL;EACF,CAAC,MAAM;IACNmB,kBAAkB,GACjBC,aAAA;MAAKK,SAAS,EAAC;IAAwC,GACtDL,aAAA,CAACtB,MAAM;MACN4B,OAAO,EAAC,WAAW;MACnBD,SAAS,EAAC,+CAA+C;MACzDE,OAAO,EAAGhB,oBAAsB;MAChC,iBAAgB;IAAO,GAErBX,EAAE,CAAE,oBAAqB,CACpB,CACJ,CACL;EACF;;EAEA;EACA;EACA,OACCoB,aAAA,CAAAQ,QAAA,QACGnB,yBAAyB,IAC1BW,aAAA,CAAC9B,mBAAmB;IAACuC,KAAK,EAAGrB;EAA0B,CAAE,CACzD,EACDY,aAAA,CAAChB,IAAI;IAAC0B,gBAAgB;EAAA,CAAE,CAAC,EACvB,CAAErB,yBAAyB,IAAIU,kBAChC,CAAC;AAEL"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { compose } from '@wordpress/compose';
|
|
5
|
-
import { withSelect, withDispatch } from '@wordpress/data';
|
|
6
|
-
import { ifViewportMatches } from '@wordpress/viewport';
|
|
7
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
-
import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { unlock } from '../../lock-unlock';
|
|
14
|
-
const {
|
|
15
|
-
PreferenceBaseOption
|
|
16
|
-
} = unlock(preferencesPrivateApis);
|
|
17
|
-
export default compose(withSelect(select => ({
|
|
18
|
-
isChecked: select(editorStore).isPublishSidebarEnabled()
|
|
19
|
-
})), withDispatch(dispatch => {
|
|
20
|
-
const {
|
|
21
|
-
enablePublishSidebar,
|
|
22
|
-
disablePublishSidebar
|
|
23
|
-
} = dispatch(editorStore);
|
|
24
|
-
return {
|
|
25
|
-
onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar()
|
|
26
|
-
};
|
|
27
|
-
}),
|
|
28
|
-
// In < medium viewports we override this option and always show the publish sidebar.
|
|
29
|
-
// See the edit-post's header component for the specific logic.
|
|
30
|
-
ifViewportMatches('medium'))(PreferenceBaseOption);
|
|
31
|
-
//# sourceMappingURL=enable-publish-sidebar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["compose","withSelect","withDispatch","ifViewportMatches","store","editorStore","privateApis","preferencesPrivateApis","unlock","PreferenceBaseOption","select","isChecked","isPublishSidebarEnabled","dispatch","enablePublishSidebar","disablePublishSidebar","onChange","isEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-publish-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ifViewportMatches } from '@wordpress/viewport';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\tisChecked: select( editorStore ).isPublishSidebarEnabled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { enablePublishSidebar, disablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonChange: ( isEnabled ) =>\n\t\t\t\tisEnabled ? enablePublishSidebar() : disablePublishSidebar(),\n\t\t};\n\t} ),\n\t// In < medium viewports we override this option and always show the publish sidebar.\n\t// See the edit-post's header component for the specific logic.\n\tifViewportMatches( 'medium' )\n)( PreferenceBaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAED,sBAAuB,CAAC;AAEjE,eAAeP,OAAO,CACrBC,UAAU,CAAIS,MAAM,KAAQ;EAC3BC,SAAS,EAAED,MAAM,CAAEL,WAAY,CAAC,CAACO,uBAAuB,CAAC;AAC1D,CAAC,CAAG,CAAC,EACLV,YAAY,CAAIW,QAAQ,IAAM;EAC7B,MAAM;IAAEC,oBAAoB;IAAEC;EAAsB,CAAC,GACpDF,QAAQ,CAAER,WAAY,CAAC;EACxB,OAAO;IACNW,QAAQ,EAAIC,SAAS,IACpBA,SAAS,GAAGH,oBAAoB,CAAC,CAAC,GAAGC,qBAAqB,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACAZ,iBAAiB,CAAE,QAAS,CAC7B,CAAC,CAAEM,oBAAqB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import deprecated from '@wordpress/deprecated';
|
|
6
|
-
import { PluginPostPublishPanel } from '@wordpress/editor';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Renders provided content to the post-publish panel in the publish flow
|
|
10
|
-
* (side panel that opens after a user publishes the post).
|
|
11
|
-
*
|
|
12
|
-
* @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.
|
|
13
|
-
*
|
|
14
|
-
* @param {Object} props Component properties.
|
|
15
|
-
* @param {string} [props.className] An optional class name added to the panel.
|
|
16
|
-
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
17
|
-
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
18
|
-
* @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 when the sidebar is pinned to toolbar.
|
|
19
|
-
* @param {Element} props.children Children to be rendered
|
|
20
|
-
* @return {Component} The component to be rendered.
|
|
21
|
-
*/
|
|
22
|
-
export default function EditPostPluginPostPublishPanel(props) {
|
|
23
|
-
deprecated('wp.editPost.PluginPostPublishPanel', {
|
|
24
|
-
since: '6.6',
|
|
25
|
-
version: '6.8',
|
|
26
|
-
alternative: 'wp.editor.PluginPostPublishPanel'
|
|
27
|
-
});
|
|
28
|
-
return createElement(PluginPostPublishPanel, {
|
|
29
|
-
...props
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["deprecated","PluginPostPublishPanel","EditPostPluginPostPublishPanel","props","since","version","alternative","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { PluginPostPublishPanel } from '@wordpress/editor';\n\n/**\n * Renders provided content to the post-publish panel in the publish flow\n * (side panel that opens after a user publishes the post).\n *\n * @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.\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 when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n * @return {Component} The component to be rendered.\n */\nexport default function EditPostPluginPostPublishPanel( props ) {\n\tdeprecated( 'wp.editPost.PluginPostPublishPanel', {\n\t\tsince: '6.6',\n\t\tversion: '6.8',\n\t\talternative: 'wp.editor.PluginPostPublishPanel',\n\t} );\n\treturn <PluginPostPublishPanel { ...props } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;AAC9C,SAASC,sBAAsB,QAAQ,mBAAmB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,8BAA8BA,CAAEC,KAAK,EAAG;EAC/DH,UAAU,CAAE,oCAAoC,EAAE;IACjDI,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAOC,aAAA,CAACN,sBAAsB;IAAA,GAAME;EAAK,CAAI,CAAC;AAC/C"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Defines as extensibility slot for the Summary panel.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { createSlotFill, PanelRow } from '@wordpress/components';
|
|
10
|
-
const {
|
|
11
|
-
Fill,
|
|
12
|
-
Slot
|
|
13
|
-
} = createSlotFill('PluginPostStatusInfo');
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Renders a row in the Summary panel of the Document sidebar.
|
|
17
|
-
* It should be noted that this is named and implemented around the function it serves
|
|
18
|
-
* and not its location, which may change in future iterations.
|
|
19
|
-
*
|
|
20
|
-
* @param {Object} props Component properties.
|
|
21
|
-
* @param {string} [props.className] An optional class name added to the row.
|
|
22
|
-
* @param {Element} props.children Children to be rendered.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```js
|
|
26
|
-
* // Using ES5 syntax
|
|
27
|
-
* var __ = wp.i18n.__;
|
|
28
|
-
* var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
|
|
29
|
-
*
|
|
30
|
-
* function MyPluginPostStatusInfo() {
|
|
31
|
-
* return React.createElement(
|
|
32
|
-
* PluginPostStatusInfo,
|
|
33
|
-
* {
|
|
34
|
-
* className: 'my-plugin-post-status-info',
|
|
35
|
-
* },
|
|
36
|
-
* __( 'My post status info' )
|
|
37
|
-
* )
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```jsx
|
|
43
|
-
* // Using ESNext syntax
|
|
44
|
-
* import { __ } from '@wordpress/i18n';
|
|
45
|
-
* import { PluginPostStatusInfo } from '@wordpress/edit-post';
|
|
46
|
-
*
|
|
47
|
-
* const MyPluginPostStatusInfo = () => (
|
|
48
|
-
* <PluginPostStatusInfo
|
|
49
|
-
* className="my-plugin-post-status-info"
|
|
50
|
-
* >
|
|
51
|
-
* { __( 'My post status info' ) }
|
|
52
|
-
* </PluginPostStatusInfo>
|
|
53
|
-
* );
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @return {Component} The component to be rendered.
|
|
57
|
-
*/
|
|
58
|
-
const PluginPostStatusInfo = ({
|
|
59
|
-
children,
|
|
60
|
-
className
|
|
61
|
-
}) => createElement(Fill, null, createElement(PanelRow, {
|
|
62
|
-
className: className
|
|
63
|
-
}, children));
|
|
64
|
-
PluginPostStatusInfo.Slot = Slot;
|
|
65
|
-
export default PluginPostStatusInfo;
|
|
66
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","PanelRow","Fill","Slot","PluginPostStatusInfo","children","className","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-status-info/index.js"],"sourcesContent":["/**\n * Defines as extensibility slot for the Summary panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { 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 {Element} 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 React.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 {Component} 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"],"mappings":";AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,QAAQ,QAAQ,uBAAuB;AAEhE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CAAE,sBAAuB,CAAC;;AAE/D;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,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KACrDC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,QAAQ;EAACK,SAAS,EAAGA;AAAW,GAAGD,QAAoB,CACnD,CACN;AAEDD,oBAAoB,CAACD,IAAI,GAAGA,IAAI;AAEhC,eAAeC,oBAAoB"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import deprecated from '@wordpress/deprecated';
|
|
6
|
-
import { PluginPrePublishPanel } from '@wordpress/editor';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Renders provided content to the pre-publish side panel in the publish flow
|
|
10
|
-
* (side panel that opens when a user first pushes "Publish" from the main editor).
|
|
11
|
-
*
|
|
12
|
-
* @deprecated since 6.6, use `wp.editor.PluginPrePublishPanel` instead.
|
|
13
|
-
*
|
|
14
|
-
* @param {Object} props Component props.
|
|
15
|
-
* @param {string} [props.className] An optional class name added to the panel.
|
|
16
|
-
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
17
|
-
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened.
|
|
18
|
-
* When no title is provided it is always opened.
|
|
19
|
-
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)
|
|
20
|
-
* icon slug string, or an SVG WP element, to be rendered when
|
|
21
|
-
* the sidebar is pinned to toolbar.
|
|
22
|
-
* @param {Element} props.children Children to be rendered
|
|
23
|
-
*
|
|
24
|
-
* @return {Component} The component to be rendered.
|
|
25
|
-
*/
|
|
26
|
-
export default function EditPostPluginPrePublishPanel(props) {
|
|
27
|
-
deprecated('wp.editPost.PluginPrePublishPanel', {
|
|
28
|
-
since: '6.6',
|
|
29
|
-
version: '6.8',
|
|
30
|
-
alternative: 'wp.editor.PluginPrePublishPanel'
|
|
31
|
-
});
|
|
32
|
-
return createElement(PluginPrePublishPanel, {
|
|
33
|
-
...props
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["deprecated","PluginPrePublishPanel","EditPostPluginPrePublishPanel","props","since","version","alternative","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-pre-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { PluginPrePublishPanel } from '@wordpress/editor';\n\n/**\n * Renders provided content to the pre-publish side panel in the publish flow\n * (side panel that opens when a user first pushes \"Publish\" from the main editor).\n *\n * @deprecated since 6.6, use `wp.editor.PluginPrePublishPanel` instead.\n *\n * @param {Object} props Component props.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened.\n * When no title is provided it is always opened.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)\n * icon slug string, or an SVG WP element, to be rendered when\n * the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @return {Component} The component to be rendered.\n */\nexport default function EditPostPluginPrePublishPanel( props ) {\n\tdeprecated( 'wp.editPost.PluginPrePublishPanel', {\n\t\tsince: '6.6',\n\t\tversion: '6.8',\n\t\talternative: 'wp.editor.PluginPrePublishPanel',\n\t} );\n\treturn <PluginPrePublishPanel { ...props } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;AAC9C,SAASC,qBAAqB,QAAQ,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,6BAA6BA,CAAEC,KAAK,EAAG;EAC9DH,UAAU,CAAE,mCAAmC,EAAE;IAChDI,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAOC,aAAA,CAACN,qBAAqB;IAAA,GAAME;EAAK,CAAI,CAAC;AAC9C"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { ComplementaryArea } from '@wordpress/interface';
|
|
6
|
-
import { useSelect } from '@wordpress/data';
|
|
7
|
-
import { __ } from '@wordpress/i18n';
|
|
8
|
-
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
9
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
|
|
13
|
-
* It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
|
|
14
|
-
* If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
|
|
15
|
-
*
|
|
16
|
-
* ```js
|
|
17
|
-
* wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @see PluginSidebarMoreMenuItem
|
|
21
|
-
*
|
|
22
|
-
* @param {Object} props Element props.
|
|
23
|
-
* @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
|
|
24
|
-
* @param {string} [props.className] An optional class name added to the sidebar body.
|
|
25
|
-
* @param {string} props.title Title displayed at the top of the sidebar.
|
|
26
|
-
* @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
|
|
27
|
-
* @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 when the sidebar is pinned to toolbar.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```js
|
|
31
|
-
* // Using ES5 syntax
|
|
32
|
-
* var __ = wp.i18n.__;
|
|
33
|
-
* var el = React.createElement;
|
|
34
|
-
* var PanelBody = wp.components.PanelBody;
|
|
35
|
-
* var PluginSidebar = wp.editPost.PluginSidebar;
|
|
36
|
-
* var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
37
|
-
*
|
|
38
|
-
* function MyPluginSidebar() {
|
|
39
|
-
* return el(
|
|
40
|
-
* PluginSidebar,
|
|
41
|
-
* {
|
|
42
|
-
* name: 'my-sidebar',
|
|
43
|
-
* title: 'My sidebar title',
|
|
44
|
-
* icon: moreIcon,
|
|
45
|
-
* },
|
|
46
|
-
* el(
|
|
47
|
-
* PanelBody,
|
|
48
|
-
* {},
|
|
49
|
-
* __( 'My sidebar content' )
|
|
50
|
-
* )
|
|
51
|
-
* );
|
|
52
|
-
* }
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```jsx
|
|
57
|
-
* // Using ESNext syntax
|
|
58
|
-
* import { __ } from '@wordpress/i18n';
|
|
59
|
-
* import { PanelBody } from '@wordpress/components';
|
|
60
|
-
* import { PluginSidebar } from '@wordpress/edit-post';
|
|
61
|
-
* import { more } from '@wordpress/icons';
|
|
62
|
-
*
|
|
63
|
-
* const MyPluginSidebar = () => (
|
|
64
|
-
* <PluginSidebar
|
|
65
|
-
* name="my-sidebar"
|
|
66
|
-
* title="My sidebar title"
|
|
67
|
-
* icon={ more }
|
|
68
|
-
* >
|
|
69
|
-
* <PanelBody>
|
|
70
|
-
* { __( 'My sidebar content' ) }
|
|
71
|
-
* </PanelBody>
|
|
72
|
-
* </PluginSidebar>
|
|
73
|
-
* );
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export default function PluginSidebarEditPost({
|
|
77
|
-
className,
|
|
78
|
-
...props
|
|
79
|
-
}) {
|
|
80
|
-
const {
|
|
81
|
-
postTitle,
|
|
82
|
-
shortcut
|
|
83
|
-
} = useSelect(select => {
|
|
84
|
-
return {
|
|
85
|
-
postTitle: select(editorStore).getEditedPostAttribute('title'),
|
|
86
|
-
shortcut: select(keyboardShortcutsStore).getShortcutRepresentation('core/edit-post/toggle-sidebar')
|
|
87
|
-
};
|
|
88
|
-
}, []);
|
|
89
|
-
return createElement(ComplementaryArea, {
|
|
90
|
-
panelClassName: className,
|
|
91
|
-
className: "edit-post-sidebar",
|
|
92
|
-
smallScreenTitle: postTitle || __('(no title)'),
|
|
93
|
-
scope: "core/edit-post",
|
|
94
|
-
toggleShortcut: shortcut,
|
|
95
|
-
...props
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=index.js.map
|