@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,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ActionsPanelFill = void 0;
|
|
7
|
-
exports.default = ActionsPanel;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _editor = require("@wordpress/editor");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _components = require("@wordpress/components");
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
|
-
var _store = require("../../store");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
Fill,
|
|
25
|
-
Slot
|
|
26
|
-
} = (0, _components.createSlotFill)('ActionsPanel');
|
|
27
|
-
const ActionsPanelFill = exports.ActionsPanelFill = Fill;
|
|
28
|
-
function ActionsPanel({
|
|
29
|
-
setEntitiesSavedStatesCallback,
|
|
30
|
-
closeEntitiesSavedStates,
|
|
31
|
-
isEntitiesSavedStatesOpen
|
|
32
|
-
}) {
|
|
33
|
-
const {
|
|
34
|
-
closePublishSidebar,
|
|
35
|
-
togglePublishSidebar
|
|
36
|
-
} = (0, _data.useDispatch)(_editor.store);
|
|
37
|
-
const {
|
|
38
|
-
publishSidebarOpened,
|
|
39
|
-
hasActiveMetaboxes,
|
|
40
|
-
hasNonPostEntityChanges
|
|
41
|
-
} = (0, _data.useSelect)(select => ({
|
|
42
|
-
publishSidebarOpened: select(_editor.store).isPublishSidebarOpened(),
|
|
43
|
-
hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
|
|
44
|
-
hasNonPostEntityChanges: select(_editor.store).hasNonPostEntityChanges()
|
|
45
|
-
}), []);
|
|
46
|
-
const openEntitiesSavedStates = (0, _element.useCallback)(() => setEntitiesSavedStatesCallback(true), []);
|
|
47
|
-
|
|
48
|
-
// It is ok for these components to be unmounted when not in visual use.
|
|
49
|
-
// We don't want more than one present at a time, decide which to render.
|
|
50
|
-
let unmountableContent;
|
|
51
|
-
if (publishSidebarOpened) {
|
|
52
|
-
unmountableContent = (0, _react.createElement)(_editor.PostPublishPanel, {
|
|
53
|
-
onClose: closePublishSidebar,
|
|
54
|
-
forceIsDirty: hasActiveMetaboxes,
|
|
55
|
-
PrePublishExtension: _editor.PluginPrePublishPanel.Slot,
|
|
56
|
-
PostPublishExtension: _editor.PluginPostPublishPanel.Slot
|
|
57
|
-
});
|
|
58
|
-
} else if (hasNonPostEntityChanges) {
|
|
59
|
-
unmountableContent = (0, _react.createElement)("div", {
|
|
60
|
-
className: "edit-post-layout__toggle-entities-saved-states-panel"
|
|
61
|
-
}, (0, _react.createElement)(_components.Button, {
|
|
62
|
-
variant: "secondary",
|
|
63
|
-
className: "edit-post-layout__toggle-entities-saved-states-panel-button",
|
|
64
|
-
onClick: openEntitiesSavedStates,
|
|
65
|
-
"aria-expanded": false
|
|
66
|
-
}, (0, _i18n.__)('Open save panel')));
|
|
67
|
-
} else {
|
|
68
|
-
unmountableContent = (0, _react.createElement)("div", {
|
|
69
|
-
className: "edit-post-layout__toggle-publish-panel"
|
|
70
|
-
}, (0, _react.createElement)(_components.Button, {
|
|
71
|
-
variant: "secondary",
|
|
72
|
-
className: "edit-post-layout__toggle-publish-panel-button",
|
|
73
|
-
onClick: togglePublishSidebar,
|
|
74
|
-
"aria-expanded": false
|
|
75
|
-
}, (0, _i18n.__)('Open publish panel')));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Since EntitiesSavedStates controls its own panel, we can keep it
|
|
79
|
-
// always mounted to retain its own component state (such as checkboxes).
|
|
80
|
-
return (0, _react.createElement)(_react.Fragment, null, isEntitiesSavedStatesOpen && (0, _react.createElement)(_editor.EntitiesSavedStates, {
|
|
81
|
-
close: closeEntitiesSavedStates
|
|
82
|
-
}), (0, _react.createElement)(Slot, {
|
|
83
|
-
bubblesVirtually: true
|
|
84
|
-
}), !isEntitiesSavedStatesOpen && unmountableContent);
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=actions-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_data","_components","_i18n","_element","_store","Fill","Slot","createSlotFill","ActionsPanelFill","exports","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","useDispatch","editorStore","publishSidebarOpened","hasActiveMetaboxes","hasNonPostEntityChanges","useSelect","select","isPublishSidebarOpened","editPostStore","hasMetaBoxes","openEntitiesSavedStates","useCallback","unmountableContent","_react","createElement","PostPublishPanel","onClose","forceIsDirty","PrePublishExtension","PluginPrePublishPanel","PostPublishExtension","PluginPostPublishPanel","className","Button","variant","onClick","__","Fragment","EntitiesSavedStates","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":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAlBA;AACA;AACA;;AAaA;AACA;AACA;;AAGA,MAAM;EAAEM,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,cAAe,CAAC;AAEhD,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGH,IAAI;AAErB,SAASK,YAAYA,CAAE;EACrCC,8BAA8B;EAC9BC,wBAAwB;EACxBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,mBAAmB;IAAEC;EAAqB,CAAC,GAClD,IAAAC,iBAAW,EAAEC,aAAY,CAAC;EAC3B,MAAM;IACLC,oBAAoB;IACpBC,kBAAkB;IAClBC;EACD,CAAC,GAAG,IAAAC,eAAS,EACVC,MAAM,KAAQ;IACfJ,oBAAoB,EACnBI,MAAM,CAAEL,aAAY,CAAC,CAACM,sBAAsB,CAAC,CAAC;IAC/CJ,kBAAkB,EAAEG,MAAM,CAAEE,YAAc,CAAC,CAACC,YAAY,CAAC,CAAC;IAC1DL,uBAAuB,EACtBE,MAAM,CAAEL,aAAY,CAAC,CAACG,uBAAuB,CAAC;EAChD,CAAC,CAAE,EACH,EACD,CAAC;EAED,MAAMM,uBAAuB,GAAG,IAAAC,oBAAW,EAC1C,MAAMhB,8BAA8B,CAAE,IAAK,CAAC,EAC5C,EACD,CAAC;;EAED;EACA;EACA,IAAIiB,kBAAkB;EACtB,IAAKV,oBAAoB,EAAG;IAC3BU,kBAAkB,GACjB,IAAAC,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAAiC,gBAAgB;MAChBC,OAAO,EAAGlB,mBAAqB;MAC/BmB,YAAY,EAAGd,kBAAoB;MACnCe,mBAAmB,EAAGC,6BAAqB,CAAC7B,IAAM;MAClD8B,oBAAoB,EAAGC,8BAAsB,CAAC/B;IAAM,CACpD,CACD;EACF,CAAC,MAAM,IAAKc,uBAAuB,EAAG;IACrCQ,kBAAkB,GACjB,IAAAC,MAAA,CAAAC,aAAA;MAAKQ,SAAS,EAAC;IAAsD,GACpE,IAAAT,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAAsC,MAAM;MACNC,OAAO,EAAC,WAAW;MACnBF,SAAS,EAAC,6DAA6D;MACvEG,OAAO,EAAGf,uBAAyB;MACnC,iBAAgB;IAAO,GAErB,IAAAgB,QAAE,EAAE,iBAAkB,CACjB,CACJ,CACL;EACF,CAAC,MAAM;IACNd,kBAAkB,GACjB,IAAAC,MAAA,CAAAC,aAAA;MAAKQ,SAAS,EAAC;IAAwC,GACtD,IAAAT,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAAsC,MAAM;MACNC,OAAO,EAAC,WAAW;MACnBF,SAAS,EAAC,+CAA+C;MACzDG,OAAO,EAAG1B,oBAAsB;MAChC,iBAAgB;IAAO,GAErB,IAAA2B,QAAE,EAAE,oBAAqB,CACpB,CACJ,CACL;EACF;;EAEA;EACA;EACA,OACC,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACG9B,yBAAyB,IAC1B,IAAAgB,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAA8C,mBAAmB;IAACC,KAAK,EAAGjC;EAA0B,CAAE,CACzD,EACD,IAAAiB,MAAA,CAAAC,aAAA,EAACxB,IAAI;IAACwC,gBAAgB;EAAA,CAAE,CAAC,EACvB,CAAEjC,yBAAyB,IAAIe,kBAChC,CAAC;AAEL"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _compose = require("@wordpress/compose");
|
|
8
|
-
var _data = require("@wordpress/data");
|
|
9
|
-
var _viewport = require("@wordpress/viewport");
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
|
-
var _preferences = require("@wordpress/preferences");
|
|
12
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const {
|
|
22
|
-
PreferenceBaseOption
|
|
23
|
-
} = (0, _lockUnlock.unlock)(_preferences.privateApis);
|
|
24
|
-
var _default = exports.default = (0, _compose.compose)((0, _data.withSelect)(select => ({
|
|
25
|
-
isChecked: select(_editor.store).isPublishSidebarEnabled()
|
|
26
|
-
})), (0, _data.withDispatch)(dispatch => {
|
|
27
|
-
const {
|
|
28
|
-
enablePublishSidebar,
|
|
29
|
-
disablePublishSidebar
|
|
30
|
-
} = dispatch(_editor.store);
|
|
31
|
-
return {
|
|
32
|
-
onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar()
|
|
33
|
-
};
|
|
34
|
-
}),
|
|
35
|
-
// In < medium viewports we override this option and always show the publish sidebar.
|
|
36
|
-
// See the edit-post's header component for the specific logic.
|
|
37
|
-
(0, _viewport.ifViewportMatches)('medium'))(PreferenceBaseOption);
|
|
38
|
-
//# sourceMappingURL=enable-publish-sidebar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_viewport","_editor","_preferences","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","_default","exports","default","compose","withSelect","select","isChecked","editorStore","isPublishSidebarEnabled","withDispatch","dispatch","enablePublishSidebar","disablePublishSidebar","onChange","isEnabled","ifViewportMatches"],"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":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEM;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEnD,IAAAC,gBAAO,EACrB,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC3BC,SAAS,EAAED,MAAM,CAAEE,aAAY,CAAC,CAACC,uBAAuB,CAAC;AAC1D,CAAC,CAAG,CAAC,EACL,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,oBAAoB;IAAEC;EAAsB,CAAC,GACpDF,QAAQ,CAAEH,aAAY,CAAC;EACxB,OAAO;IACNM,QAAQ,EAAIC,SAAS,IACpBA,SAAS,GAAGH,oBAAoB,CAAC,CAAC,GAAGC,qBAAqB,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACA,IAAAG,2BAAiB,EAAE,QAAS,CAC7B,CAAC,CAAElB,oBAAqB,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = EditPostPluginPostPublishPanel;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Renders provided content to the post-publish panel in the publish flow
|
|
17
|
-
* (side panel that opens after a user publishes the post).
|
|
18
|
-
*
|
|
19
|
-
* @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.
|
|
20
|
-
*
|
|
21
|
-
* @param {Object} props Component properties.
|
|
22
|
-
* @param {string} [props.className] An optional class name added to the panel.
|
|
23
|
-
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
24
|
-
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
25
|
-
* @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.
|
|
26
|
-
* @param {Element} props.children Children to be rendered
|
|
27
|
-
* @return {Component} The component to be rendered.
|
|
28
|
-
*/
|
|
29
|
-
function EditPostPluginPostPublishPanel(props) {
|
|
30
|
-
(0, _deprecated.default)('wp.editPost.PluginPostPublishPanel', {
|
|
31
|
-
since: '6.6',
|
|
32
|
-
version: '6.8',
|
|
33
|
-
alternative: 'wp.editor.PluginPostPublishPanel'
|
|
34
|
-
});
|
|
35
|
-
return (0, _react.createElement)(_editor.PluginPostPublishPanel, {
|
|
36
|
-
...props
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_deprecated","_interopRequireDefault","require","_editor","EditPostPluginPostPublishPanel","props","deprecated","since","version","alternative","_react","createElement","PluginPostPublishPanel"],"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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,8BAA8BA,CAAEC,KAAK,EAAG;EAC/D,IAAAC,mBAAU,EAAE,oCAAoC,EAAE;IACjDC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAS,sBAAsB;IAAA,GAAMP;EAAK,CAAI,CAAC;AAC/C"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
/**
|
|
10
|
-
* Defines as extensibility slot for the Summary panel.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const {
|
|
18
|
-
Fill,
|
|
19
|
-
Slot
|
|
20
|
-
} = (0, _components.createSlotFill)('PluginPostStatusInfo');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Renders a row in the Summary panel of the Document sidebar.
|
|
24
|
-
* It should be noted that this is named and implemented around the function it serves
|
|
25
|
-
* and not its location, which may change in future iterations.
|
|
26
|
-
*
|
|
27
|
-
* @param {Object} props Component properties.
|
|
28
|
-
* @param {string} [props.className] An optional class name added to the row.
|
|
29
|
-
* @param {Element} props.children Children to be rendered.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```js
|
|
33
|
-
* // Using ES5 syntax
|
|
34
|
-
* var __ = wp.i18n.__;
|
|
35
|
-
* var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
|
|
36
|
-
*
|
|
37
|
-
* function MyPluginPostStatusInfo() {
|
|
38
|
-
* return React.createElement(
|
|
39
|
-
* PluginPostStatusInfo,
|
|
40
|
-
* {
|
|
41
|
-
* className: 'my-plugin-post-status-info',
|
|
42
|
-
* },
|
|
43
|
-
* __( 'My post status info' )
|
|
44
|
-
* )
|
|
45
|
-
* }
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```jsx
|
|
50
|
-
* // Using ESNext syntax
|
|
51
|
-
* import { __ } from '@wordpress/i18n';
|
|
52
|
-
* import { PluginPostStatusInfo } from '@wordpress/edit-post';
|
|
53
|
-
*
|
|
54
|
-
* const MyPluginPostStatusInfo = () => (
|
|
55
|
-
* <PluginPostStatusInfo
|
|
56
|
-
* className="my-plugin-post-status-info"
|
|
57
|
-
* >
|
|
58
|
-
* { __( 'My post status info' ) }
|
|
59
|
-
* </PluginPostStatusInfo>
|
|
60
|
-
* );
|
|
61
|
-
* ```
|
|
62
|
-
*
|
|
63
|
-
* @return {Component} The component to be rendered.
|
|
64
|
-
*/
|
|
65
|
-
const PluginPostStatusInfo = ({
|
|
66
|
-
children,
|
|
67
|
-
className
|
|
68
|
-
}) => (0, _react.createElement)(Fill, null, (0, _react.createElement)(_components.PanelRow, {
|
|
69
|
-
className: className
|
|
70
|
-
}, children));
|
|
71
|
-
PluginPostStatusInfo.Slot = Slot;
|
|
72
|
-
var _default = exports.default = PluginPostStatusInfo;
|
|
73
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","Fill","Slot","createSlotFill","PluginPostStatusInfo","children","className","_react","createElement","PanelRow","_default","exports","default"],"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":";;;;;;;AAOA,IAAAA,WAAA,GAAAC,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGA,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,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,MAAMC,oBAAoB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KACrD,IAAAC,MAAA,CAAAC,aAAA,EAACP,IAAI,QACJ,IAAAM,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,QAAQ;EAACH,SAAS,EAAGA;AAAW,GAAGD,QAAoB,CACnD,CACN;AAEDD,oBAAoB,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAElBR,oBAAoB"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = EditPostPluginPrePublishPanel;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Renders provided content to the pre-publish side panel in the publish flow
|
|
17
|
-
* (side panel that opens when a user first pushes "Publish" from the main editor).
|
|
18
|
-
*
|
|
19
|
-
* @deprecated since 6.6, use `wp.editor.PluginPrePublishPanel` instead.
|
|
20
|
-
*
|
|
21
|
-
* @param {Object} props Component props.
|
|
22
|
-
* @param {string} [props.className] An optional class name added to the panel.
|
|
23
|
-
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
24
|
-
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened.
|
|
25
|
-
* When no title is provided it is always opened.
|
|
26
|
-
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)
|
|
27
|
-
* icon slug string, or an SVG WP element, to be rendered when
|
|
28
|
-
* the sidebar is pinned to toolbar.
|
|
29
|
-
* @param {Element} props.children Children to be rendered
|
|
30
|
-
*
|
|
31
|
-
* @return {Component} The component to be rendered.
|
|
32
|
-
*/
|
|
33
|
-
function EditPostPluginPrePublishPanel(props) {
|
|
34
|
-
(0, _deprecated.default)('wp.editPost.PluginPrePublishPanel', {
|
|
35
|
-
since: '6.6',
|
|
36
|
-
version: '6.8',
|
|
37
|
-
alternative: 'wp.editor.PluginPrePublishPanel'
|
|
38
|
-
});
|
|
39
|
-
return (0, _react.createElement)(_editor.PluginPrePublishPanel, {
|
|
40
|
-
...props
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_deprecated","_interopRequireDefault","require","_editor","EditPostPluginPrePublishPanel","props","deprecated","since","version","alternative","_react","createElement","PluginPrePublishPanel"],"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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,6BAA6BA,CAAEC,KAAK,EAAG;EAC9D,IAAAC,mBAAU,EAAE,mCAAmC,EAAE;IAChDC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAS,qBAAqB;IAAA,GAAMP;EAAK,CAAI,CAAC;AAC9C"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = PluginSidebarEditPost;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _interface = require("@wordpress/interface");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
12
|
-
var _editor = require("@wordpress/editor");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
|
|
19
|
-
* It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
|
|
20
|
-
* If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
|
|
21
|
-
*
|
|
22
|
-
* ```js
|
|
23
|
-
* wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @see PluginSidebarMoreMenuItem
|
|
27
|
-
*
|
|
28
|
-
* @param {Object} props Element props.
|
|
29
|
-
* @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
|
|
30
|
-
* @param {string} [props.className] An optional class name added to the sidebar body.
|
|
31
|
-
* @param {string} props.title Title displayed at the top of the sidebar.
|
|
32
|
-
* @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.
|
|
33
|
-
* @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.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```js
|
|
37
|
-
* // Using ES5 syntax
|
|
38
|
-
* var __ = wp.i18n.__;
|
|
39
|
-
* var el = React.createElement;
|
|
40
|
-
* var PanelBody = wp.components.PanelBody;
|
|
41
|
-
* var PluginSidebar = wp.editPost.PluginSidebar;
|
|
42
|
-
* var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
43
|
-
*
|
|
44
|
-
* function MyPluginSidebar() {
|
|
45
|
-
* return el(
|
|
46
|
-
* PluginSidebar,
|
|
47
|
-
* {
|
|
48
|
-
* name: 'my-sidebar',
|
|
49
|
-
* title: 'My sidebar title',
|
|
50
|
-
* icon: moreIcon,
|
|
51
|
-
* },
|
|
52
|
-
* el(
|
|
53
|
-
* PanelBody,
|
|
54
|
-
* {},
|
|
55
|
-
* __( 'My sidebar content' )
|
|
56
|
-
* )
|
|
57
|
-
* );
|
|
58
|
-
* }
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```jsx
|
|
63
|
-
* // Using ESNext syntax
|
|
64
|
-
* import { __ } from '@wordpress/i18n';
|
|
65
|
-
* import { PanelBody } from '@wordpress/components';
|
|
66
|
-
* import { PluginSidebar } from '@wordpress/edit-post';
|
|
67
|
-
* import { more } from '@wordpress/icons';
|
|
68
|
-
*
|
|
69
|
-
* const MyPluginSidebar = () => (
|
|
70
|
-
* <PluginSidebar
|
|
71
|
-
* name="my-sidebar"
|
|
72
|
-
* title="My sidebar title"
|
|
73
|
-
* icon={ more }
|
|
74
|
-
* >
|
|
75
|
-
* <PanelBody>
|
|
76
|
-
* { __( 'My sidebar content' ) }
|
|
77
|
-
* </PanelBody>
|
|
78
|
-
* </PluginSidebar>
|
|
79
|
-
* );
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
function PluginSidebarEditPost({
|
|
83
|
-
className,
|
|
84
|
-
...props
|
|
85
|
-
}) {
|
|
86
|
-
const {
|
|
87
|
-
postTitle,
|
|
88
|
-
shortcut
|
|
89
|
-
} = (0, _data.useSelect)(select => {
|
|
90
|
-
return {
|
|
91
|
-
postTitle: select(_editor.store).getEditedPostAttribute('title'),
|
|
92
|
-
shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-post/toggle-sidebar')
|
|
93
|
-
};
|
|
94
|
-
}, []);
|
|
95
|
-
return (0, _react.createElement)(_interface.ComplementaryArea, {
|
|
96
|
-
panelClassName: className,
|
|
97
|
-
className: "edit-post-sidebar",
|
|
98
|
-
smallScreenTitle: postTitle || (0, _i18n.__)('(no title)'),
|
|
99
|
-
scope: "core/edit-post",
|
|
100
|
-
toggleShortcut: shortcut,
|
|
101
|
-
...props
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_interface","require","_data","_i18n","_keyboardShortcuts","_editor","PluginSidebarEditPost","className","props","postTitle","shortcut","useSelect","select","editorStore","getEditedPostAttribute","keyboardShortcutsStore","getShortcutRepresentation","_react","createElement","ComplementaryArea","panelClassName","smallScreenTitle","__","scope","toggleShortcut"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @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.\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 *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = React.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editPost.PluginSidebar;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditPost( { className, ...props } ) {\n\tconst { postTitle, shortcut } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostTitle: select( editorStore ).getEditedPostAttribute( 'title' ),\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-post-sidebar\"\n\t\t\tsmallScreenTitle={ postTitle || __( '(no title)' ) }\n\t\t\tscope=\"core/edit-post\"\n\t\t\ttoggleShortcut={ shortcut }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASK,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACxE,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,OAAO;MACNH,SAAS,EAAEG,MAAM,CAAEC,aAAY,CAAC,CAACC,sBAAsB,CAAE,OAAQ,CAAC;MAClEJ,QAAQ,EAAEE,MAAM,CACfG,wBACD,CAAC,CAACC,yBAAyB,CAAE,+BAAgC;IAC9D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAClB,UAAA,CAAAmB,iBAAiB;IACjBC,cAAc,EAAGb,SAAW;IAC5BA,SAAS,EAAC,mBAAmB;IAC7Bc,gBAAgB,EAAGZ,SAAS,IAAI,IAAAa,QAAE,EAAE,YAAa,CAAG;IACpDC,KAAK,EAAC,gBAAgB;IACtBC,cAAc,EAAGd,QAAU;IAAA,GACtBF;EAAK,CACV,CAAC;AAEJ"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = StartPageOptions;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
-
var _data = require("@wordpress/data");
|
|
13
|
-
var _compose = require("@wordpress/compose");
|
|
14
|
-
var _editor = require("@wordpress/editor");
|
|
15
|
-
var _store = require("../../store");
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
function useStartPatterns() {
|
|
25
|
-
// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
|
|
26
|
-
// and it has no postTypes declared and the current post type is page or if
|
|
27
|
-
// the current post type is part of the postTypes declared.
|
|
28
|
-
const {
|
|
29
|
-
blockPatternsWithPostContentBlockType,
|
|
30
|
-
postType
|
|
31
|
-
} = (0, _data.useSelect)(select => {
|
|
32
|
-
const {
|
|
33
|
-
getPatternsByBlockTypes
|
|
34
|
-
} = select(_blockEditor.store);
|
|
35
|
-
const {
|
|
36
|
-
getCurrentPostType
|
|
37
|
-
} = select(_editor.store);
|
|
38
|
-
return {
|
|
39
|
-
blockPatternsWithPostContentBlockType: getPatternsByBlockTypes('core/post-content'),
|
|
40
|
-
postType: getCurrentPostType()
|
|
41
|
-
};
|
|
42
|
-
}, []);
|
|
43
|
-
return (0, _element.useMemo)(() => {
|
|
44
|
-
// filter patterns without postTypes declared if the current postType is page
|
|
45
|
-
// or patterns that declare the current postType in its post type array.
|
|
46
|
-
return blockPatternsWithPostContentBlockType.filter(pattern => {
|
|
47
|
-
return postType === 'page' && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType);
|
|
48
|
-
});
|
|
49
|
-
}, [postType, blockPatternsWithPostContentBlockType]);
|
|
50
|
-
}
|
|
51
|
-
function PatternSelection({
|
|
52
|
-
blockPatterns,
|
|
53
|
-
onChoosePattern
|
|
54
|
-
}) {
|
|
55
|
-
const shownBlockPatterns = (0, _compose.useAsyncList)(blockPatterns);
|
|
56
|
-
const {
|
|
57
|
-
resetEditorBlocks
|
|
58
|
-
} = (0, _data.useDispatch)(_editor.store);
|
|
59
|
-
return (0, _react.createElement)(_blockEditor.__experimentalBlockPatternsList, {
|
|
60
|
-
blockPatterns: blockPatterns,
|
|
61
|
-
shownPatterns: shownBlockPatterns,
|
|
62
|
-
onClickPattern: (_pattern, blocks) => {
|
|
63
|
-
resetEditorBlocks(blocks);
|
|
64
|
-
onChoosePattern();
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function StartPageOptionsModal({
|
|
69
|
-
onClose
|
|
70
|
-
}) {
|
|
71
|
-
const startPatterns = useStartPatterns();
|
|
72
|
-
const hasStartPattern = startPatterns.length > 0;
|
|
73
|
-
if (!hasStartPattern) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
return (0, _react.createElement)(_components.Modal, {
|
|
77
|
-
className: "edit-post-start-page-options__modal",
|
|
78
|
-
title: (0, _i18n.__)('Choose a pattern'),
|
|
79
|
-
isFullScreen: true,
|
|
80
|
-
onRequestClose: onClose
|
|
81
|
-
}, (0, _react.createElement)("div", {
|
|
82
|
-
className: "edit-post-start-page-options__modal-content"
|
|
83
|
-
}, (0, _react.createElement)(PatternSelection, {
|
|
84
|
-
blockPatterns: startPatterns,
|
|
85
|
-
onChoosePattern: onClose
|
|
86
|
-
})));
|
|
87
|
-
}
|
|
88
|
-
function StartPageOptions() {
|
|
89
|
-
const [isClosed, setIsClosed] = (0, _element.useState)(false);
|
|
90
|
-
const shouldEnableModal = (0, _data.useSelect)(select => {
|
|
91
|
-
const {
|
|
92
|
-
isCleanNewPost,
|
|
93
|
-
getRenderingMode
|
|
94
|
-
} = select(_editor.store);
|
|
95
|
-
const {
|
|
96
|
-
isFeatureActive
|
|
97
|
-
} = select(_store.store);
|
|
98
|
-
return getRenderingMode() === 'post-only' && !isFeatureActive('welcomeGuide') && isCleanNewPost();
|
|
99
|
-
}, []);
|
|
100
|
-
if (!shouldEnableModal || isClosed) {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
return (0, _react.createElement)(StartPageOptionsModal, {
|
|
104
|
-
onClose: () => setIsClosed(true)
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_element","_blockEditor","_data","_compose","_editor","_store","useStartPatterns","blockPatternsWithPostContentBlockType","postType","useSelect","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","useMemo","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","useAsyncList","resetEditorBlocks","useDispatch","_react","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","onClose","startPatterns","hasStartPattern","length","Modal","className","title","__","isFullScreen","onRequestClose","StartPageOptions","isClosed","setIsClosed","useState","shouldEnableModal","isCleanNewPost","getRenderingMode","isFeatureActive","editPostStore"],"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ onClose }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ onClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst shouldEnableModal = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost, getRenderingMode } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn (\n\t\t\tgetRenderingMode() === 'post-only' &&\n\t\t\t! isFeatureActive( 'welcomeGuide' ) &&\n\t\t\tisCleanNewPost()\n\t\t);\n\t}, [] );\n\n\tif ( ! shouldEnableModal || isClosed ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsClosed( true ) } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,SAASQ,gBAAgBA,CAAA,EAAG;EAC3B;EACA;EACA;EACA,MAAM;IAAEC,qCAAqC;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAClEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAC9D,MAAM;MAAEC;IAAmB,CAAC,GAAGH,MAAM,CAAEI,aAAY,CAAC;IACpD,OAAO;MACNP,qCAAqC,EACpCI,uBAAuB,CAAE,mBAAoB,CAAC;MAC/CH,QAAQ,EAAEK,kBAAkB,CAAC;IAC9B,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,OAAO,IAAAE,gBAAO,EAAE,MAAM;IACrB;IACA;IACA,OAAOR,qCAAqC,CAACS,MAAM,CAAIC,OAAO,IAAM;MACnE,OACGT,QAAQ,KAAK,MAAM,IAAI,CAAES,OAAO,CAACC,SAAS,IAC1CC,KAAK,CAACC,OAAO,CAAEH,OAAO,CAACC,SAAU,CAAC,IACnCD,OAAO,CAACC,SAAS,CAACG,QAAQ,CAAEb,QAAS,CAAG;IAE3C,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEA,QAAQ,EAAED,qCAAqC,CAAG,CAAC;AACzD;AAEA,SAASe,gBAAgBA,CAAE;EAAEC,aAAa;EAAEC;AAAgB,CAAC,EAAG;EAC/D,MAAMC,kBAAkB,GAAG,IAAAC,qBAAY,EAAEH,aAAc,CAAC;EACxD,MAAM;IAAEI;EAAkB,CAAC,GAAG,IAAAC,iBAAW,EAAEd,aAAY,CAAC;EACxD,OACC,IAAAe,MAAA,CAAAC,aAAA,EAAC7B,YAAA,CAAA8B,+BAAiB;IACjBR,aAAa,EAAGA,aAAe;IAC/BS,aAAa,EAAGP,kBAAoB;IACpCQ,cAAc,EAAGA,CAAEC,QAAQ,EAAEC,MAAM,KAAM;MACxCR,iBAAiB,CAAEQ,MAAO,CAAC;MAC3BX,eAAe,CAAC,CAAC;IAClB;EAAG,CACH,CAAC;AAEJ;AAEA,SAASY,qBAAqBA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EAC7C,MAAMC,aAAa,GAAGhC,gBAAgB,CAAC,CAAC;EACxC,MAAMiC,eAAe,GAAGD,aAAa,CAACE,MAAM,GAAG,CAAC;EAEhD,IAAK,CAAED,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAV,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAA4C,KAAK;IACLC,SAAS,EAAC,qCAAqC;IAC/CC,KAAK,EAAG,IAAAC,QAAE,EAAE,kBAAmB,CAAG;IAClCC,YAAY;IACZC,cAAc,EAAGT;EAAS,GAE1B,IAAAR,MAAA,CAAAC,aAAA;IAAKY,SAAS,EAAC;EAA6C,GAC3D,IAAAb,MAAA,CAAAC,aAAA,EAACR,gBAAgB;IAChBC,aAAa,EAAGe,aAAe;IAC/Bd,eAAe,EAAGa;EAAS,CAC3B,CACG,CACC,CAAC;AAEV;AAEe,SAASU,gBAAgBA,CAAA,EAAG;EAC1C,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACnD,MAAMC,iBAAiB,GAAG,IAAA1C,eAAS,EAAIC,MAAM,IAAM;IAClD,MAAM;MAAE0C,cAAc;MAAEC;IAAiB,CAAC,GAAG3C,MAAM,CAAEI,aAAY,CAAC;IAClE,MAAM;MAAEwC;IAAgB,CAAC,GAAG5C,MAAM,CAAE6C,YAAc,CAAC;IAEnD,OACCF,gBAAgB,CAAC,CAAC,KAAK,WAAW,IAClC,CAAEC,eAAe,CAAE,cAAe,CAAC,IACnCF,cAAc,CAAC,CAAC;EAElB,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAED,iBAAiB,IAAIH,QAAQ,EAAG;IACtC,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAnB,MAAA,CAAAC,aAAA,EAACM,qBAAqB;IAACC,OAAO,EAAGA,CAAA,KAAMY,WAAW,CAAE,IAAK;EAAG,CAAE,CAAC;AACvE"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = CopyContentMenuItem;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _compose = require("@wordpress/compose");
|
|
12
|
-
var _notices = require("@wordpress/notices");
|
|
13
|
-
var _editor = require("@wordpress/editor");
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
function CopyContentMenuItem() {
|
|
19
|
-
const {
|
|
20
|
-
createNotice
|
|
21
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
22
|
-
const {
|
|
23
|
-
getEditedPostAttribute
|
|
24
|
-
} = (0, _data.useSelect)(_editor.store);
|
|
25
|
-
function getText() {
|
|
26
|
-
return getEditedPostAttribute('content');
|
|
27
|
-
}
|
|
28
|
-
function onSuccess() {
|
|
29
|
-
createNotice('info', (0, _i18n.__)('All content copied.'), {
|
|
30
|
-
isDismissible: true,
|
|
31
|
-
type: 'snackbar'
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const ref = (0, _compose.useCopyToClipboard)(getText, onSuccess);
|
|
35
|
-
return (0, _react.createElement)(_components.MenuItem, {
|
|
36
|
-
ref: ref
|
|
37
|
-
}, (0, _i18n.__)('Copy all blocks'));
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_i18n","_compose","_notices","_editor","CopyContentMenuItem","createNotice","useDispatch","noticesStore","getEditedPostAttribute","useSelect","editorStore","getText","onSuccess","__","isDismissible","type","ref","useCopyToClipboard","_react","createElement","MenuItem"],"sources":["@wordpress/edit-post/src/plugins/copy-content-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function CopyContentMenuItem() {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tfunction getText() {\n\t\treturn getEditedPostAttribute( 'content' );\n\t}\n\n\tfunction onSuccess() {\n\t\tcreateNotice( 'info', __( 'All content copied.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tconst ref = useCopyToClipboard( getText, onSuccess );\n\n\treturn <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQe,SAASM,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EACpD,MAAM;IAAEC;EAAuB,CAAC,GAAG,IAAAC,eAAS,EAAEC,aAAY,CAAC;EAE3D,SAASC,OAAOA,CAAA,EAAG;IAClB,OAAOH,sBAAsB,CAAE,SAAU,CAAC;EAC3C;EAEA,SAASI,SAASA,CAAA,EAAG;IACpBP,YAAY,CAAE,MAAM,EAAE,IAAAQ,QAAE,EAAE,qBAAsB,CAAC,EAAE;MAClDC,aAAa,EAAE,IAAI;MACnBC,IAAI,EAAE;IACP,CAAE,CAAC;EACJ;EAEA,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEN,OAAO,EAAEC,SAAU,CAAC;EAEpD,OAAO,IAAAM,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,QAAQ;IAACJ,GAAG,EAAGA;EAAK,GAAG,IAAAH,QAAE,EAAE,iBAAkB,CAAa,CAAC;AACpE"}
|