@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,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines as extensibility slot for the Summary panel.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* WordPress dependencies
|
|
7
|
-
*/
|
|
8
|
-
import { createSlotFill, PanelRow } from '@wordpress/components';
|
|
9
|
-
|
|
10
|
-
const { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Renders a row in the Summary panel of the Document sidebar.
|
|
14
|
-
* It should be noted that this is named and implemented around the function it serves
|
|
15
|
-
* and not its location, which may change in future iterations.
|
|
16
|
-
*
|
|
17
|
-
* @param {Object} props Component properties.
|
|
18
|
-
* @param {string} [props.className] An optional class name added to the row.
|
|
19
|
-
* @param {Element} props.children Children to be rendered.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```js
|
|
23
|
-
* // Using ES5 syntax
|
|
24
|
-
* var __ = wp.i18n.__;
|
|
25
|
-
* var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
|
|
26
|
-
*
|
|
27
|
-
* function MyPluginPostStatusInfo() {
|
|
28
|
-
* return React.createElement(
|
|
29
|
-
* PluginPostStatusInfo,
|
|
30
|
-
* {
|
|
31
|
-
* className: 'my-plugin-post-status-info',
|
|
32
|
-
* },
|
|
33
|
-
* __( 'My post status info' )
|
|
34
|
-
* )
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```jsx
|
|
40
|
-
* // Using ESNext syntax
|
|
41
|
-
* import { __ } from '@wordpress/i18n';
|
|
42
|
-
* import { PluginPostStatusInfo } from '@wordpress/edit-post';
|
|
43
|
-
*
|
|
44
|
-
* const MyPluginPostStatusInfo = () => (
|
|
45
|
-
* <PluginPostStatusInfo
|
|
46
|
-
* className="my-plugin-post-status-info"
|
|
47
|
-
* >
|
|
48
|
-
* { __( 'My post status info' ) }
|
|
49
|
-
* </PluginPostStatusInfo>
|
|
50
|
-
* );
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @return {Component} The component to be rendered.
|
|
54
|
-
*/
|
|
55
|
-
const PluginPostStatusInfo = ( { children, className } ) => (
|
|
56
|
-
<Fill>
|
|
57
|
-
<PanelRow className={ className }>{ children }</PanelRow>
|
|
58
|
-
</Fill>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
PluginPostStatusInfo.Slot = Slot;
|
|
62
|
-
|
|
63
|
-
export default PluginPostStatusInfo;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { render } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { SlotFillProvider } from '@wordpress/components';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import PluginPostStatusInfo from '../';
|
|
15
|
-
|
|
16
|
-
describe( 'PluginPostStatusInfo', () => {
|
|
17
|
-
test( 'renders fill properly', () => {
|
|
18
|
-
const { container } = render(
|
|
19
|
-
<SlotFillProvider>
|
|
20
|
-
<PluginPostStatusInfo className="my-plugin-post-status-info">
|
|
21
|
-
My plugin post status info
|
|
22
|
-
</PluginPostStatusInfo>
|
|
23
|
-
<PluginPostStatusInfo.Slot />
|
|
24
|
-
</SlotFillProvider>
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
expect( container ).toMatchSnapshot();
|
|
28
|
-
} );
|
|
29
|
-
} );
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import deprecated from '@wordpress/deprecated';
|
|
5
|
-
import { PluginPrePublishPanel } from '@wordpress/editor';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Renders provided content to the pre-publish side panel in the publish flow
|
|
9
|
-
* (side panel that opens when a user first pushes "Publish" from the main editor).
|
|
10
|
-
*
|
|
11
|
-
* @deprecated since 6.6, use `wp.editor.PluginPrePublishPanel` instead.
|
|
12
|
-
*
|
|
13
|
-
* @param {Object} props Component props.
|
|
14
|
-
* @param {string} [props.className] An optional class name added to the panel.
|
|
15
|
-
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
16
|
-
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened.
|
|
17
|
-
* 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/)
|
|
19
|
-
* icon slug string, or an SVG WP element, to be rendered when
|
|
20
|
-
* the sidebar is pinned to toolbar.
|
|
21
|
-
* @param {Element} props.children Children to be rendered
|
|
22
|
-
*
|
|
23
|
-
* @return {Component} The component to be rendered.
|
|
24
|
-
*/
|
|
25
|
-
export default function EditPostPluginPrePublishPanel( props ) {
|
|
26
|
-
deprecated( 'wp.editPost.PluginPrePublishPanel', {
|
|
27
|
-
since: '6.6',
|
|
28
|
-
version: '6.8',
|
|
29
|
-
alternative: 'wp.editor.PluginPrePublishPanel',
|
|
30
|
-
} );
|
|
31
|
-
return <PluginPrePublishPanel { ...props } />;
|
|
32
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { ComplementaryArea } from '@wordpress/interface';
|
|
5
|
-
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
8
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
|
|
12
|
-
* It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
|
|
13
|
-
* If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
|
|
14
|
-
*
|
|
15
|
-
* ```js
|
|
16
|
-
* wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @see PluginSidebarMoreMenuItem
|
|
20
|
-
*
|
|
21
|
-
* @param {Object} props Element props.
|
|
22
|
-
* @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
|
|
23
|
-
* @param {string} [props.className] An optional class name added to the sidebar body.
|
|
24
|
-
* @param {string} props.title Title displayed at the top of the sidebar.
|
|
25
|
-
* @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.
|
|
26
|
-
* @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.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```js
|
|
30
|
-
* // Using ES5 syntax
|
|
31
|
-
* var __ = wp.i18n.__;
|
|
32
|
-
* var el = React.createElement;
|
|
33
|
-
* var PanelBody = wp.components.PanelBody;
|
|
34
|
-
* var PluginSidebar = wp.editPost.PluginSidebar;
|
|
35
|
-
* var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
36
|
-
*
|
|
37
|
-
* function MyPluginSidebar() {
|
|
38
|
-
* return el(
|
|
39
|
-
* PluginSidebar,
|
|
40
|
-
* {
|
|
41
|
-
* name: 'my-sidebar',
|
|
42
|
-
* title: 'My sidebar title',
|
|
43
|
-
* icon: moreIcon,
|
|
44
|
-
* },
|
|
45
|
-
* el(
|
|
46
|
-
* PanelBody,
|
|
47
|
-
* {},
|
|
48
|
-
* __( 'My sidebar content' )
|
|
49
|
-
* )
|
|
50
|
-
* );
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```jsx
|
|
56
|
-
* // Using ESNext syntax
|
|
57
|
-
* import { __ } from '@wordpress/i18n';
|
|
58
|
-
* import { PanelBody } from '@wordpress/components';
|
|
59
|
-
* import { PluginSidebar } from '@wordpress/edit-post';
|
|
60
|
-
* import { more } from '@wordpress/icons';
|
|
61
|
-
*
|
|
62
|
-
* const MyPluginSidebar = () => (
|
|
63
|
-
* <PluginSidebar
|
|
64
|
-
* name="my-sidebar"
|
|
65
|
-
* title="My sidebar title"
|
|
66
|
-
* icon={ more }
|
|
67
|
-
* >
|
|
68
|
-
* <PanelBody>
|
|
69
|
-
* { __( 'My sidebar content' ) }
|
|
70
|
-
* </PanelBody>
|
|
71
|
-
* </PluginSidebar>
|
|
72
|
-
* );
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export default function PluginSidebarEditPost( { className, ...props } ) {
|
|
76
|
-
const { postTitle, shortcut } = useSelect( ( select ) => {
|
|
77
|
-
return {
|
|
78
|
-
postTitle: select( editorStore ).getEditedPostAttribute( 'title' ),
|
|
79
|
-
shortcut: select(
|
|
80
|
-
keyboardShortcutsStore
|
|
81
|
-
).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),
|
|
82
|
-
};
|
|
83
|
-
}, [] );
|
|
84
|
-
return (
|
|
85
|
-
<ComplementaryArea
|
|
86
|
-
panelClassName={ className }
|
|
87
|
-
className="edit-post-sidebar"
|
|
88
|
-
smallScreenTitle={ postTitle || __( '(no title)' ) }
|
|
89
|
-
scope="core/edit-post"
|
|
90
|
-
toggleShortcut={ shortcut }
|
|
91
|
-
{ ...props }
|
|
92
|
-
/>
|
|
93
|
-
);
|
|
94
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Modal } from '@wordpress/components';
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { useState, useMemo } from '@wordpress/element';
|
|
7
|
-
import {
|
|
8
|
-
store as blockEditorStore,
|
|
9
|
-
__experimentalBlockPatternsList as BlockPatternsList,
|
|
10
|
-
} from '@wordpress/block-editor';
|
|
11
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
|
-
import { useAsyncList } from '@wordpress/compose';
|
|
13
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
import { store as editPostStore } from '../../store';
|
|
19
|
-
|
|
20
|
-
function useStartPatterns() {
|
|
21
|
-
// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
|
|
22
|
-
// and it has no postTypes declared and the current post type is page or if
|
|
23
|
-
// the current post type is part of the postTypes declared.
|
|
24
|
-
const { blockPatternsWithPostContentBlockType, postType } = useSelect(
|
|
25
|
-
( select ) => {
|
|
26
|
-
const { getPatternsByBlockTypes } = select( blockEditorStore );
|
|
27
|
-
const { getCurrentPostType } = select( editorStore );
|
|
28
|
-
return {
|
|
29
|
-
blockPatternsWithPostContentBlockType:
|
|
30
|
-
getPatternsByBlockTypes( 'core/post-content' ),
|
|
31
|
-
postType: getCurrentPostType(),
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
[]
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
return useMemo( () => {
|
|
38
|
-
// filter patterns without postTypes declared if the current postType is page
|
|
39
|
-
// or patterns that declare the current postType in its post type array.
|
|
40
|
-
return blockPatternsWithPostContentBlockType.filter( ( pattern ) => {
|
|
41
|
-
return (
|
|
42
|
-
( postType === 'page' && ! pattern.postTypes ) ||
|
|
43
|
-
( Array.isArray( pattern.postTypes ) &&
|
|
44
|
-
pattern.postTypes.includes( postType ) )
|
|
45
|
-
);
|
|
46
|
-
} );
|
|
47
|
-
}, [ postType, blockPatternsWithPostContentBlockType ] );
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function PatternSelection( { blockPatterns, onChoosePattern } ) {
|
|
51
|
-
const shownBlockPatterns = useAsyncList( blockPatterns );
|
|
52
|
-
const { resetEditorBlocks } = useDispatch( editorStore );
|
|
53
|
-
return (
|
|
54
|
-
<BlockPatternsList
|
|
55
|
-
blockPatterns={ blockPatterns }
|
|
56
|
-
shownPatterns={ shownBlockPatterns }
|
|
57
|
-
onClickPattern={ ( _pattern, blocks ) => {
|
|
58
|
-
resetEditorBlocks( blocks );
|
|
59
|
-
onChoosePattern();
|
|
60
|
-
} }
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function StartPageOptionsModal( { onClose } ) {
|
|
66
|
-
const startPatterns = useStartPatterns();
|
|
67
|
-
const hasStartPattern = startPatterns.length > 0;
|
|
68
|
-
|
|
69
|
-
if ( ! hasStartPattern ) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<Modal
|
|
75
|
-
className="edit-post-start-page-options__modal"
|
|
76
|
-
title={ __( 'Choose a pattern' ) }
|
|
77
|
-
isFullScreen
|
|
78
|
-
onRequestClose={ onClose }
|
|
79
|
-
>
|
|
80
|
-
<div className="edit-post-start-page-options__modal-content">
|
|
81
|
-
<PatternSelection
|
|
82
|
-
blockPatterns={ startPatterns }
|
|
83
|
-
onChoosePattern={ onClose }
|
|
84
|
-
/>
|
|
85
|
-
</div>
|
|
86
|
-
</Modal>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export default function StartPageOptions() {
|
|
91
|
-
const [ isClosed, setIsClosed ] = useState( false );
|
|
92
|
-
const shouldEnableModal = useSelect( ( select ) => {
|
|
93
|
-
const { isCleanNewPost, getRenderingMode } = select( editorStore );
|
|
94
|
-
const { isFeatureActive } = select( editPostStore );
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
getRenderingMode() === 'post-only' &&
|
|
98
|
-
! isFeatureActive( 'welcomeGuide' ) &&
|
|
99
|
-
isCleanNewPost()
|
|
100
|
-
);
|
|
101
|
-
}, [] );
|
|
102
|
-
|
|
103
|
-
if ( ! shouldEnableModal || isClosed ) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return <StartPageOptionsModal onClose={ () => setIsClosed( true ) } />;
|
|
108
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// 2 column masonry layout.
|
|
2
|
-
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
3
|
-
column-count: 2;
|
|
4
|
-
column-gap: $grid-unit-30;
|
|
5
|
-
|
|
6
|
-
@include break-medium() {
|
|
7
|
-
column-count: 3;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@include break-wide() {
|
|
11
|
-
column-count: 4;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.block-editor-block-patterns-list__list-item {
|
|
15
|
-
break-inside: avoid-column;
|
|
16
|
-
margin-bottom: $grid-unit-30;
|
|
17
|
-
|
|
18
|
-
.block-editor-block-preview__container {
|
|
19
|
-
min-height: 100px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.block-editor-block-preview__content {
|
|
23
|
-
width: 100%;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { MenuItem } from '@wordpress/components';
|
|
5
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { useCopyToClipboard } from '@wordpress/compose';
|
|
8
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
9
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
10
|
-
|
|
11
|
-
export default function CopyContentMenuItem() {
|
|
12
|
-
const { createNotice } = useDispatch( noticesStore );
|
|
13
|
-
const { getEditedPostAttribute } = useSelect( editorStore );
|
|
14
|
-
|
|
15
|
-
function getText() {
|
|
16
|
-
return getEditedPostAttribute( 'content' );
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function onSuccess() {
|
|
20
|
-
createNotice( 'info', __( 'All content copied.' ), {
|
|
21
|
-
isDismissible: true,
|
|
22
|
-
type: 'snackbar',
|
|
23
|
-
} );
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const ref = useCopyToClipboard( getText, onSuccess );
|
|
27
|
-
|
|
28
|
-
return <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;
|
|
29
|
-
}
|
package/src/plugins/index.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { MenuItem, VisuallyHidden } from '@wordpress/components';
|
|
5
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
7
|
-
import { useSelect } from '@wordpress/data';
|
|
8
|
-
import { external } from '@wordpress/icons';
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { registerPlugin } from '@wordpress/plugins';
|
|
11
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import CopyContentMenuItem from './copy-content-menu-item';
|
|
17
|
-
import KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';
|
|
18
|
-
import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';
|
|
19
|
-
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
|
|
20
|
-
|
|
21
|
-
function ManagePatternsMenuItem() {
|
|
22
|
-
const url = useSelect( ( select ) => {
|
|
23
|
-
const { canUser } = select( coreStore );
|
|
24
|
-
const { getEditorSettings } = select( editorStore );
|
|
25
|
-
|
|
26
|
-
const isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;
|
|
27
|
-
const defaultUrl = addQueryArgs( 'edit.php', {
|
|
28
|
-
post_type: 'wp_block',
|
|
29
|
-
} );
|
|
30
|
-
const patternsUrl = addQueryArgs( 'site-editor.php', {
|
|
31
|
-
path: '/patterns',
|
|
32
|
-
} );
|
|
33
|
-
|
|
34
|
-
// The site editor and templates both check whether the user has
|
|
35
|
-
// edit_theme_options capabilities. We can leverage that here and not
|
|
36
|
-
// display the manage patterns link if the user can't access it.
|
|
37
|
-
return canUser( 'read', 'templates' ) && isBlockTheme
|
|
38
|
-
? patternsUrl
|
|
39
|
-
: defaultUrl;
|
|
40
|
-
}, [] );
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<MenuItem role="menuitem" href={ url }>
|
|
44
|
-
{ __( 'Manage patterns' ) }
|
|
45
|
-
</MenuItem>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
registerPlugin( 'edit-post', {
|
|
50
|
-
render() {
|
|
51
|
-
return (
|
|
52
|
-
<>
|
|
53
|
-
<ToolsMoreMenuGroup>
|
|
54
|
-
{ ( { onClose } ) => (
|
|
55
|
-
<>
|
|
56
|
-
<ManagePatternsMenuItem />
|
|
57
|
-
<KeyboardShortcutsHelpMenuItem
|
|
58
|
-
onSelect={ onClose }
|
|
59
|
-
/>
|
|
60
|
-
<WelcomeGuideMenuItem />
|
|
61
|
-
<CopyContentMenuItem />
|
|
62
|
-
<MenuItem
|
|
63
|
-
role="menuitem"
|
|
64
|
-
icon={ external }
|
|
65
|
-
href={ __(
|
|
66
|
-
'https://wordpress.org/documentation/article/wordpress-block-editor/'
|
|
67
|
-
) }
|
|
68
|
-
target="_blank"
|
|
69
|
-
rel="noopener noreferrer"
|
|
70
|
-
>
|
|
71
|
-
{ __( 'Help' ) }
|
|
72
|
-
<VisuallyHidden as="span">
|
|
73
|
-
{
|
|
74
|
-
/* translators: accessibility text */
|
|
75
|
-
__( '(opens in a new tab)' )
|
|
76
|
-
}
|
|
77
|
-
</VisuallyHidden>
|
|
78
|
-
</MenuItem>
|
|
79
|
-
</>
|
|
80
|
-
) }
|
|
81
|
-
</ToolsMoreMenuGroup>
|
|
82
|
-
</>
|
|
83
|
-
);
|
|
84
|
-
},
|
|
85
|
-
} );
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { MenuItem } from '@wordpress/components';
|
|
5
|
-
import { withDispatch } from '@wordpress/data';
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { displayShortcut } from '@wordpress/keycodes';
|
|
8
|
-
import { store as interfaceStore } from '@wordpress/interface';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';
|
|
14
|
-
|
|
15
|
-
export function KeyboardShortcutsHelpMenuItem( { openModal } ) {
|
|
16
|
-
return (
|
|
17
|
-
<MenuItem
|
|
18
|
-
onClick={ () => {
|
|
19
|
-
openModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );
|
|
20
|
-
} }
|
|
21
|
-
shortcut={ displayShortcut.access( 'h' ) }
|
|
22
|
-
>
|
|
23
|
-
{ __( 'Keyboard shortcuts' ) }
|
|
24
|
-
</MenuItem>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default withDispatch( ( dispatch ) => {
|
|
29
|
-
const { openModal } = dispatch( interfaceStore );
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
openModal,
|
|
33
|
-
};
|
|
34
|
-
} )( KeyboardShortcutsHelpMenuItem );
|
|
File without changes
|