@wordpress/edit-post 7.34.0 → 8.0.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 +15 -2
- package/build/commands/use-commands.js +56 -0
- package/build/commands/use-commands.js.map +1 -0
- package/build/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build/components/back-button/index.js +57 -0
- package/build/components/back-button/index.js.map +1 -0
- package/build/components/header/header-toolbar/index.native.js +63 -62
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.native.js +2 -2
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +50 -43
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/layout/index.js +134 -156
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +28 -21
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/{visual-editor → layout}/use-padding-appender.js +6 -1
- package/build/components/layout/use-padding-appender.js.map +1 -0
- package/build/components/layout/use-should-iframe.js +46 -0
- package/build/components/layout/use-should-iframe.js.map +1 -0
- package/build/components/meta-boxes/index.js +10 -9
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +13 -13
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/more-menu/index.js +49 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
- package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/preferences-modal/enable-custom-fields.js +23 -18
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/index.js +4 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +13 -13
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/visual-editor/header.native.js +11 -10
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.native.js +3 -3
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +50 -33
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +13 -12
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +12 -8
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +9 -9
- package/build/deprecated.js.map +1 -1
- package/build/editor.js +16 -11
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +18 -12
- package/build/editor.native.js.map +1 -1
- package/build/index.js +12 -13
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -2
- package/build/index.native.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/commands/use-commands.js +49 -0
- package/build-module/commands/use-commands.js.map +1 -0
- package/build-module/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build-module/components/back-button/index.js +49 -0
- package/build-module/components/back-button/index.js.map +1 -0
- package/build-module/components/header/header-toolbar/index.native.js +64 -62
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.native.js +2 -2
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +52 -43
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +139 -159
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +30 -21
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/{visual-editor → layout}/use-padding-appender.js +6 -1
- package/build-module/components/layout/use-padding-appender.js.map +1 -0
- package/build-module/components/layout/use-should-iframe.js +39 -0
- package/build-module/components/layout/use-should-iframe.js.map +1 -0
- package/build-module/components/meta-boxes/index.js +12 -9
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +13 -11
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +43 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/preferences-modal/enable-custom-fields.js +25 -18
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +14 -13
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +11 -10
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js +3 -3
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +52 -33
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +14 -12
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +14 -8
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +9 -9
- package/build-module/deprecated.js.map +1 -1
- package/build-module/editor.js +17 -11
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +18 -12
- package/build-module/editor.native.js.map +1 -1
- package/build-module/index.js +10 -7
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -2
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +31 -392
- package/build-style/style.css +31 -392
- package/package.json +33 -33
- package/src/commands/use-commands.js +48 -0
- package/src/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +3 -3
- package/src/components/back-button/index.js +34 -0
- package/src/components/{header/fullscreen-mode-close → back-button}/style.scss +16 -2
- package/src/components/{header/fullscreen-mode-close/test/index.js → back-button/test/fullscreen-mode-close.js} +1 -1
- package/src/components/layout/index.js +151 -207
- package/src/components/layout/style.scss +9 -17
- package/src/components/{visual-editor → layout}/use-padding-appender.js +7 -1
- package/src/components/layout/use-should-iframe.js +40 -0
- package/src/components/meta-boxes/meta-boxes-area/index.js +4 -8
- package/src/components/{header/more-menu → more-menu}/index.js +2 -2
- package/src/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +1 -1
- package/src/index.js +11 -6
- package/src/store/selectors.js +8 -5
- package/src/style.scss +3 -10
- package/src/test/__snapshots__/editor.native.js.snap +72 -0
- package/src/test/editor.native.js +77 -0
- package/build/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build/components/header/index.js +0 -158
- package/build/components/header/index.js.map +0 -1
- package/build/components/header/main-dashboard-button/index.js +0 -33
- package/build/components/header/main-dashboard-button/index.js.map +0 -1
- package/build/components/header/more-menu/index.js +0 -43
- package/build/components/header/more-menu/index.js.map +0 -1
- package/build/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build/components/sidebar/post-format/index.js +0 -21
- package/build/components/sidebar/post-format/index.js.map +0 -1
- package/build/components/sidebar/post-pending-status/index.js +0 -26
- package/build/components/sidebar/post-pending-status/index.js.map +0 -1
- package/build/components/sidebar/post-slug/index.js +0 -21
- package/build/components/sidebar/post-slug/index.js.map +0 -1
- package/build/components/sidebar/post-status/index.js +0 -92
- package/build/components/sidebar/post-status/index.js.map +0 -1
- package/build/components/sidebar/post-sticky/index.js +0 -26
- package/build/components/sidebar/post-sticky/index.js.map +0 -1
- package/build/components/sidebar/post-trash/index.js +0 -16
- package/build/components/sidebar/post-trash/index.js.map +0 -1
- package/build/components/sidebar/post-visibility/index.js +0 -78
- package/build/components/sidebar/post-visibility/index.js.map +0 -1
- package/build/components/sidebar/settings-header/index.js +0 -53
- package/build/components/sidebar/settings-header/index.js.map +0 -1
- package/build/components/sidebar/settings-sidebar/index.js +0 -193
- package/build/components/sidebar/settings-sidebar/index.js.map +0 -1
- package/build/components/text-editor/index.js +0 -61
- package/build/components/text-editor/index.js.map +0 -1
- package/build/components/visual-editor/block-inspector-button.js +0 -55
- package/build/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build/components/visual-editor/index.js +0 -92
- package/build/components/visual-editor/index.js.map +0 -1
- package/build/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build/hooks/commands/use-common-commands.js +0 -119
- package/build/hooks/commands/use-common-commands.js.map +0 -1
- package/build/hooks/components/index.js +0 -11
- package/build/hooks/components/index.js.map +0 -1
- package/build/hooks/index.js +0 -5
- package/build/hooks/index.js.map +0 -1
- package/build/hooks/validate-multiple-use/index.js +0 -134
- package/build/hooks/validate-multiple-use/index.js.map +0 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build-module/components/header/index.js +0 -150
- package/build-module/components/header/index.js.map +0 -1
- package/build-module/components/header/main-dashboard-button/index.js +0 -26
- package/build-module/components/header/main-dashboard-button/index.js.map +0 -1
- package/build-module/components/header/more-menu/index.js +0 -35
- package/build-module/components/header/more-menu/index.js.map +0 -1
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build-module/components/sidebar/post-format/index.js +0 -13
- package/build-module/components/sidebar/post-format/index.js.map +0 -1
- package/build-module/components/sidebar/post-pending-status/index.js +0 -18
- package/build-module/components/sidebar/post-pending-status/index.js.map +0 -1
- package/build-module/components/sidebar/post-slug/index.js +0 -13
- package/build-module/components/sidebar/post-slug/index.js.map +0 -1
- package/build-module/components/sidebar/post-status/index.js +0 -84
- package/build-module/components/sidebar/post-status/index.js.map +0 -1
- package/build-module/components/sidebar/post-sticky/index.js +0 -18
- package/build-module/components/sidebar/post-sticky/index.js.map +0 -1
- package/build-module/components/sidebar/post-trash/index.js +0 -9
- package/build-module/components/sidebar/post-trash/index.js.map +0 -1
- package/build-module/components/sidebar/post-visibility/index.js +0 -70
- package/build-module/components/sidebar/post-visibility/index.js.map +0 -1
- package/build-module/components/sidebar/settings-header/index.js +0 -46
- package/build-module/components/sidebar/settings-header/index.js.map +0 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +0 -185
- package/build-module/components/sidebar/settings-sidebar/index.js.map +0 -1
- package/build-module/components/text-editor/index.js +0 -54
- package/build-module/components/text-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/block-inspector-button.js +0 -47
- package/build-module/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build-module/components/visual-editor/index.js +0 -84
- package/build-module/components/visual-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build-module/hooks/commands/use-common-commands.js +0 -112
- package/build-module/hooks/commands/use-common-commands.js.map +0 -1
- package/build-module/hooks/components/index.js +0 -8
- package/build-module/hooks/components/index.js.map +0 -1
- package/build-module/hooks/index.js +0 -6
- package/build-module/hooks/index.js.map +0 -1
- package/build-module/hooks/validate-multiple-use/index.js +0 -132
- package/build-module/hooks/validate-multiple-use/index.js.map +0 -1
- package/src/components/header/index.js +0 -156
- package/src/components/header/main-dashboard-button/index.js +0 -28
- package/src/components/header/style.scss +0 -251
- package/src/components/sidebar/post-format/index.js +0 -20
- package/src/components/sidebar/post-format/style.scss +0 -5
- package/src/components/sidebar/post-pending-status/index.js +0 -27
- package/src/components/sidebar/post-slug/index.js +0 -17
- package/src/components/sidebar/post-slug/style.scss +0 -5
- package/src/components/sidebar/post-status/index.js +0 -128
- package/src/components/sidebar/post-sticky/index.js +0 -27
- package/src/components/sidebar/post-trash/index.js +0 -12
- package/src/components/sidebar/post-visibility/index.js +0 -88
- package/src/components/sidebar/post-visibility/style.scss +0 -5
- package/src/components/sidebar/settings-header/index.js +0 -49
- package/src/components/sidebar/settings-sidebar/index.js +0 -247
- package/src/components/sidebar/style.scss +0 -18
- package/src/components/text-editor/index.js +0 -63
- package/src/components/text-editor/style.scss +0 -71
- package/src/components/visual-editor/block-inspector-button.js +0 -59
- package/src/components/visual-editor/index.js +0 -101
- package/src/components/visual-editor/style.scss +0 -53
- package/src/hooks/commands/use-common-commands.js +0 -126
- package/src/hooks/components/index.js +0 -13
- package/src/hooks/index.js +0 -5
- package/src/hooks/validate-multiple-use/index.js +0 -163
- /package/src/components/{header/fullscreen-mode-close/test/__snapshots__/index.js.snap → back-button/test/__snapshots__/fullscreen-mode-close.js.snap} +0 -0
- /package/src/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
|
@@ -1,92 +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 = PostStatus;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _editor = require("@wordpress/editor");
|
|
13
|
-
var _postTrash = _interopRequireDefault(require("../post-trash"));
|
|
14
|
-
var _postSticky = _interopRequireDefault(require("../post-sticky"));
|
|
15
|
-
var _postSlug = _interopRequireDefault(require("../post-slug"));
|
|
16
|
-
var _postFormat = _interopRequireDefault(require("../post-format"));
|
|
17
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
18
|
-
/**
|
|
19
|
-
* WordPress dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
PostStatus: PostStatusPanel,
|
|
28
|
-
PrivatePostExcerptPanel,
|
|
29
|
-
PostContentInformation,
|
|
30
|
-
PostLastEditedPanel
|
|
31
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Module Constants
|
|
35
|
-
*/
|
|
36
|
-
const PANEL_NAME = 'post-status';
|
|
37
|
-
function PostStatus() {
|
|
38
|
-
const {
|
|
39
|
-
isOpened,
|
|
40
|
-
isRemoved,
|
|
41
|
-
showPostContentPanels
|
|
42
|
-
} = (0, _data.useSelect)(select => {
|
|
43
|
-
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
|
|
44
|
-
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
|
|
45
|
-
const {
|
|
46
|
-
isEditorPanelRemoved,
|
|
47
|
-
isEditorPanelOpened,
|
|
48
|
-
getCurrentPostType
|
|
49
|
-
} = select(_editor.store);
|
|
50
|
-
const postType = getCurrentPostType();
|
|
51
|
-
return {
|
|
52
|
-
isRemoved: isEditorPanelRemoved(PANEL_NAME),
|
|
53
|
-
isOpened: isEditorPanelOpened(PANEL_NAME),
|
|
54
|
-
// Post excerpt panel is rendered in different place depending on the post type.
|
|
55
|
-
// So we cannot make this check inside the PostExcerpt component based on the current edited entity.
|
|
56
|
-
showPostContentPanels: !['wp_template', 'wp_template_part', 'wp_block'].includes(postType)
|
|
57
|
-
};
|
|
58
|
-
}, []);
|
|
59
|
-
const {
|
|
60
|
-
toggleEditorPanelOpened
|
|
61
|
-
} = (0, _data.useDispatch)(_editor.store);
|
|
62
|
-
if (isRemoved) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return (0, _react.createElement)(_components.PanelBody, {
|
|
66
|
-
className: "edit-post-post-status",
|
|
67
|
-
title: (0, _i18n.__)('Summary'),
|
|
68
|
-
opened: isOpened,
|
|
69
|
-
onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
|
|
70
|
-
}, (0, _react.createElement)(_editor.PluginPostStatusInfo.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, showPostContentPanels && (0, _react.createElement)(_components.__experimentalVStack, {
|
|
71
|
-
spacing: 3
|
|
72
|
-
// TODO: this needs to be consolidated with the panel in site editor, when we unify them.
|
|
73
|
-
,
|
|
74
|
-
style: {
|
|
75
|
-
marginBlockEnd: '24px'
|
|
76
|
-
}
|
|
77
|
-
}, (0, _react.createElement)(_editor.PostFeaturedImagePanel, {
|
|
78
|
-
withPanelBody: false
|
|
79
|
-
}), (0, _react.createElement)(PrivatePostExcerptPanel, null), (0, _react.createElement)(_components.__experimentalVStack, {
|
|
80
|
-
spacing: 1
|
|
81
|
-
}, (0, _react.createElement)(PostContentInformation, null), (0, _react.createElement)(PostLastEditedPanel, null))), (0, _react.createElement)(_components.__experimentalVStack, {
|
|
82
|
-
spacing: 1,
|
|
83
|
-
style: {
|
|
84
|
-
marginBlockEnd: '12px'
|
|
85
|
-
}
|
|
86
|
-
}, (0, _react.createElement)(PostStatusPanel, null), (0, _react.createElement)(_editor.PostSchedulePanel, null), (0, _react.createElement)(_editor.PostTemplatePanel, null), (0, _react.createElement)(_editor.PostURLPanel, null), (0, _react.createElement)(_editor.PostSyncStatus, null)), (0, _react.createElement)(_postSticky.default, null), (0, _react.createElement)(_postFormat.default, null), (0, _react.createElement)(_postSlug.default, null), (0, _react.createElement)(_editor.PostAuthorPanel, null), fills, (0, _react.createElement)(_components.__experimentalHStack, {
|
|
87
|
-
style: {
|
|
88
|
-
marginTop: '16px'
|
|
89
|
-
}
|
|
90
|
-
}, (0, _react.createElement)(_postTrash.default, null)))));
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_editor","_postTrash","_interopRequireDefault","_postSticky","_postSlug","_postFormat","_lockUnlock","PostStatus","PostStatusPanel","PrivatePostExcerptPanel","PostContentInformation","PostLastEditedPanel","unlock","editorPrivateApis","PANEL_NAME","isOpened","isRemoved","showPostContentPanels","useSelect","select","isEditorPanelRemoved","isEditorPanelOpened","getCurrentPostType","editorStore","postType","includes","toggleEditorPanelOpened","useDispatch","_react","createElement","PanelBody","className","title","__","opened","onToggle","PluginPostStatusInfo","Slot","fills","Fragment","__experimentalVStack","spacing","style","marginBlockEnd","PostFeaturedImagePanel","withPanelBody","PostSchedulePanel","PostTemplatePanel","PostURLPanel","PostSyncStatus","default","PostAuthorPanel","__experimentalHStack","marginTop"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPluginPostStatusInfo,\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSyncStatus,\n\tPostURLPanel,\n\tPostTemplatePanel,\n\tPostFeaturedImagePanel,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport { unlock } from '../../../lock-unlock';\n\nconst {\n\tPostStatus: PostStatusPanel,\n\tPrivatePostExcerptPanel,\n\tPostContentInformation,\n\tPostLastEditedPanel,\n} = unlock( editorPrivateApis );\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved, showPostContentPanels } = useSelect(\n\t\t( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tisEditorPanelOpened,\n\t\t\t\tgetCurrentPostType,\n\t\t\t} = select( editorStore );\n\t\t\tconst postType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\t\t// Post excerpt panel is rendered in different place depending on the post type.\n\t\t\t\t// So we cannot make this check inside the PostExcerpt component based on the current edited entity.\n\t\t\t\tshowPostContentPanels: ! [\n\t\t\t\t\t'wp_template',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t'wp_block',\n\t\t\t\t].includes( postType ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ showPostContentPanels && (\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\t\t\t\t// TODO: this needs to be consolidated with the panel in site editor, when we unify them.\n\t\t\t\t\t\t\t\tstyle={ { marginBlockEnd: '24px' } }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostFeaturedImagePanel\n\t\t\t\t\t\t\t\t\twithPanelBody={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PrivatePostExcerptPanel />\n\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\t\tstyle={ { marginBlockEnd: '12px' } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAeA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,WAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,SAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,WAAA,GAAAH,sBAAA,CAAAL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AAU,MAAE,CAAC,EACd,IAAAtB,MAAA,CAAAC,aAAA,EAACzB,SAAA,CAAA8C,OAAQ,MAAE,CAAC,EACZ,IAAAtB,MAAA,CAAAC,aAAA,EAAC7B,OAAA,CAAAmD,eAAe,MAAE,CAAC,EACjBb,KAAK,EACP,IAAAV,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAAsD,oBAAM;IACNV,KAAK,EAAG;MACPW,SAAS,EAAE;IACZ;EAAG,GAEH,IAAAzB,MAAA,CAAAC,aAAA,EAAC5B,UAAA,CAAAiD,OAAS,MAAE,CACL,CACP,CAEuB,CACjB,CAAC;AAEd","ignoreList":[]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PostSticky = PostSticky;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _editor = require("@wordpress/editor");
|
|
10
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
PostPanelRow
|
|
21
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
22
|
-
function PostSticky() {
|
|
23
|
-
return (0, _react.createElement)(_editor.PostStickyCheck, null, (0, _react.createElement)(PostPanelRow, null, (0, _react.createElement)(_editor.PostSticky, null)));
|
|
24
|
-
}
|
|
25
|
-
var _default = exports.default = PostSticky;
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostSticky","_react","createElement","PostStickyCheck","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-sticky/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostSticky as PostStickyForm,\n\tPostStickyCheck,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostSticky() {\n\treturn (\n\t\t<PostStickyCheck>\n\t\t\t<PostPanelRow>\n\t\t\t\t<PostStickyForm />\n\t\t\t</PostPanelRow>\n\t\t</PostStickyCheck>\n\t);\n}\n\nexport default PostSticky;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AASA,IAAAC,WAAA,GAAAD,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEE;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE7C,SAASC,UAAUA,CAAA,EAAG;EAC5B,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAS,eAAe,QACf,IAAAF,MAAA,CAAAC,aAAA,EAACL,YAAY,QACZ,IAAAI,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAM,UAAc,MAAE,CACJ,CACE,CAAC;AAEpB;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcN,UAAU","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = PostTrash;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _editor = require("@wordpress/editor");
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
function PostTrash() {
|
|
14
|
-
return (0, _react.createElement)(_editor.PostTrashCheck, null, (0, _react.createElement)(_editor.PostTrash, null));
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","PostTrash","_react","createElement","PostTrashCheck"],"sources":["@wordpress/edit-post/src/components/sidebar/post-trash/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';\n\nexport default function PostTrash() {\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<PostTrashLink />\n\t\t</PostTrashCheck>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,SAASA,CAAA,EAAG;EACnC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAK,cAAc,QACd,IAAAF,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAE,SAAa,MAAE,CACD,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PostVisibility = PostVisibility;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
var _editor = require("@wordpress/editor");
|
|
12
|
-
var _element = require("@wordpress/element");
|
|
13
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
PostPanelRow
|
|
24
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
25
|
-
function PostVisibility() {
|
|
26
|
-
// Use internal state instead of a ref to make sure that the component
|
|
27
|
-
// re-renders when the popover's anchor updates.
|
|
28
|
-
const [popoverAnchor, setPopoverAnchor] = (0, _element.useState)(null);
|
|
29
|
-
// Memoize popoverProps to avoid returning a new object every time.
|
|
30
|
-
const popoverProps = (0, _element.useMemo)(() => ({
|
|
31
|
-
// Anchor the popover to the middle of the entire row so that it doesn't
|
|
32
|
-
// move around when the label changes.
|
|
33
|
-
anchor: popoverAnchor,
|
|
34
|
-
placement: 'bottom-end'
|
|
35
|
-
}), [popoverAnchor]);
|
|
36
|
-
return (0, _react.createElement)(_editor.PostVisibilityCheck, {
|
|
37
|
-
render: ({
|
|
38
|
-
canEdit
|
|
39
|
-
}) => (0, _react.createElement)(PostPanelRow, {
|
|
40
|
-
label: (0, _i18n.__)('Visibility'),
|
|
41
|
-
ref: setPopoverAnchor
|
|
42
|
-
}, !canEdit && (0, _react.createElement)("span", null, (0, _react.createElement)(_editor.PostVisibilityLabel, null)), canEdit && (0, _react.createElement)(_components.Dropdown, {
|
|
43
|
-
contentClassName: "edit-post-post-visibility__dialog",
|
|
44
|
-
popoverProps: popoverProps,
|
|
45
|
-
focusOnMount: true,
|
|
46
|
-
renderToggle: ({
|
|
47
|
-
isOpen,
|
|
48
|
-
onToggle
|
|
49
|
-
}) => (0, _react.createElement)(PostVisibilityToggle, {
|
|
50
|
-
isOpen: isOpen,
|
|
51
|
-
onClick: onToggle
|
|
52
|
-
}),
|
|
53
|
-
renderContent: ({
|
|
54
|
-
onClose
|
|
55
|
-
}) => (0, _react.createElement)(_editor.PostVisibility, {
|
|
56
|
-
onClose: onClose
|
|
57
|
-
})
|
|
58
|
-
}))
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function PostVisibilityToggle({
|
|
62
|
-
isOpen,
|
|
63
|
-
onClick
|
|
64
|
-
}) {
|
|
65
|
-
const label = (0, _editor.usePostVisibilityLabel)();
|
|
66
|
-
return (0, _react.createElement)(_components.Button, {
|
|
67
|
-
__next40pxDefaultSize: true,
|
|
68
|
-
className: "edit-post-post-visibility__toggle",
|
|
69
|
-
variant: "tertiary",
|
|
70
|
-
"aria-expanded": isOpen
|
|
71
|
-
// translators: %s: Current post visibility.
|
|
72
|
-
,
|
|
73
|
-
"aria-label": (0, _i18n.sprintf)((0, _i18n.__)('Select visibility: %s'), label),
|
|
74
|
-
onClick: onClick
|
|
75
|
-
}, label);
|
|
76
|
-
}
|
|
77
|
-
var _default = exports.default = PostVisibility;
|
|
78
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_editor","_element","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostVisibility","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","_react","createElement","PostVisibilityCheck","render","canEdit","label","__","ref","PostVisibilityLabel","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostVisibilityToggle","onClick","renderContent","onClose","usePostVisibilityLabel","Button","__next40pxDefaultSize","className","variant","sprintf","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostVisibility() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostVisibilityCheck\n\t\t\trender={ ( { canEdit } ) => (\n\t\t\t\t<PostPanelRow\n\t\t\t\t\tlabel={ __( 'Visibility' ) }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t>\n\t\t\t\t\t{ ! canEdit && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canEdit && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"edit-post-post-visibility__dialog\"\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityToggle\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityForm onClose={ onClose } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PostPanelRow>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction PostVisibilityToggle( { isOpen, onClick } ) {\n\tconst label = usePostVisibilityLabel();\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"edit-post-post-visibility__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post visibility.\n\t\t\taria-label={ sprintf( __( 'Select visibility: %s' ), label ) }\n\t\t\tonClick={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,MAAA,CAAAC,aAAA,EAACc,oBAAoB;QACpBF,MAAM,EAAGA,MAAQ;QACjBG,OAAO,EAAGF;MAAU,CACpB,CACC;MACHG,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,KAC5B,IAAAlB,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAM,cAAkB;QAAC0B,OAAO,EAAGA;MAAS,CAAE;IACvC,CACH,CAEW;EACZ,CACH,CAAC;AAEJ;AAEA,SAASH,oBAAoBA,CAAE;EAAEF,MAAM;EAAEG;AAAQ,CAAC,EAAG;EACpD,MAAMX,KAAK,GAAG,IAAAc,8BAAsB,EAAC,CAAC;EACtC,OACC,IAAAnB,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAmC,MAAM;IACNC,qBAAqB;IACrBC,SAAS,EAAC,mCAAmC;IAC7CC,OAAO,EAAC,UAAU;IAClB,iBAAgBV;IAChB;IAAA;IACA,cAAa,IAAAW,aAAO,EAAE,IAAAlB,QAAE,EAAE,uBAAwB,CAAC,EAAED,KAAM,CAAG;IAC9DW,OAAO,EAAGA;EAAS,GAEjBX,KACK,CAAC;AAEX;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnC,cAAc","ignoreList":[]}
|
|
@@ -1,53 +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
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _element = require("@wordpress/element");
|
|
12
|
-
var _editor = require("@wordpress/editor");
|
|
13
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
14
|
-
var _settingsSidebar = require("../settings-sidebar");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
Tabs
|
|
25
|
-
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
26
|
-
const SettingsHeader = (_, ref) => {
|
|
27
|
-
const {
|
|
28
|
-
documentLabel
|
|
29
|
-
} = (0, _data.useSelect)(select => {
|
|
30
|
-
const {
|
|
31
|
-
getPostTypeLabel
|
|
32
|
-
} = select(_editor.store);
|
|
33
|
-
return {
|
|
34
|
-
// translators: Default label for the Document sidebar tab, not selected.
|
|
35
|
-
documentLabel: getPostTypeLabel() || (0, _i18n._x)('Document', 'noun')
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
return (0, _react.createElement)(Tabs.TabList, {
|
|
39
|
-
ref: ref
|
|
40
|
-
}, (0, _react.createElement)(Tabs.Tab, {
|
|
41
|
-
tabId: _settingsSidebar.sidebars.document
|
|
42
|
-
// Used for focus management in the SettingsSidebar component.
|
|
43
|
-
,
|
|
44
|
-
"data-tab-id": _settingsSidebar.sidebars.document
|
|
45
|
-
}, documentLabel), (0, _react.createElement)(Tabs.Tab, {
|
|
46
|
-
tabId: _settingsSidebar.sidebars.block
|
|
47
|
-
// Used for focus management in the SettingsSidebar component.
|
|
48
|
-
,
|
|
49
|
-
"data-tab-id": _settingsSidebar.sidebars.block
|
|
50
|
-
}, (0, _i18n.__)('Block')));
|
|
51
|
-
};
|
|
52
|
-
var _default = exports.default = (0, _element.forwardRef)(SettingsHeader);
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_element","_editor","_lockUnlock","_settingsSidebar","Tabs","unlock","componentsPrivateApis","SettingsHeader","_","ref","documentLabel","useSelect","select","getPostTypeLabel","editorStore","_x","_react","createElement","TabList","Tab","tabId","sidebars","document","block","__","_default","exports","default","forwardRef"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = ( _, ref ) => {\n\tconst { documentLabel } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList ref={ ref }>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.document }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.document }\n\t\t\t>\n\t\t\t\t{ documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.block }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.block }\n\t\t\t>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default forwardRef( SettingsHeader );\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,MAAM;EAAEO;AAAK,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AAEhD,MAAMC,cAAc,GAAGA,CAAEC,CAAC,EAAEC,GAAG,KAAM;EACpC,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAClD,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IAElD,OAAO;MACN;MACAJ,aAAa,EAAEG,gBAAgB,CAAC,CAAC,IAAI,IAAAE,QAAE,EAAE,UAAU,EAAE,MAAO;IAC7D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACb,IAAI,CAACc,OAAO;IAACT,GAAG,EAAGA;EAAK,GACxB,IAAAO,MAAA,CAAAC,aAAA,EAACb,IAAI,CAACe,GAAG;IACRC,KAAK,EAAGC,yBAAQ,CAACC;IACjB;IAAA;IACA,eAAcD,yBAAQ,CAACC;EAAU,GAE/BZ,aACO,CAAC,EACX,IAAAM,MAAA,CAAAC,aAAA,EAACb,IAAI,CAACe,GAAG;IACRC,KAAK,EAAGC,yBAAQ,CAACE;IACjB;IAAA;IACA,eAAcF,yBAAQ,CAACE;EAAO,GAG5B,IAAAC,QAAE,EAAE,OAAQ,CACL,CACG,CAAC;AAEjB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,mBAAU,EAAErB,cAAe,CAAC","ignoreList":[]}
|
|
@@ -1,193 +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.sidebars = exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _element = require("@wordpress/element");
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
var _icons = require("@wordpress/icons");
|
|
14
|
-
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
15
|
-
var _editor = require("@wordpress/editor");
|
|
16
|
-
var _url = require("@wordpress/url");
|
|
17
|
-
var _notices = require("@wordpress/notices");
|
|
18
|
-
var _settingsHeader = _interopRequireDefault(require("../settings-header"));
|
|
19
|
-
var _postStatus = _interopRequireDefault(require("../post-status"));
|
|
20
|
-
var _metaBoxes = _interopRequireDefault(require("../../meta-boxes"));
|
|
21
|
-
var _store = require("../../../store");
|
|
22
|
-
var _components = require("@wordpress/components");
|
|
23
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
24
|
-
/**
|
|
25
|
-
* WordPress dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Internal dependencies
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
const {
|
|
33
|
-
PostCardPanel,
|
|
34
|
-
PostActions,
|
|
35
|
-
interfaceStore
|
|
36
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
37
|
-
const {
|
|
38
|
-
Tabs
|
|
39
|
-
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
40
|
-
const {
|
|
41
|
-
PatternOverridesPanel,
|
|
42
|
-
useAutoSwitchEditorSidebars
|
|
43
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
44
|
-
const SIDEBAR_ACTIVE_BY_DEFAULT = _element.Platform.select({
|
|
45
|
-
web: true,
|
|
46
|
-
native: false
|
|
47
|
-
});
|
|
48
|
-
const sidebars = exports.sidebars = {
|
|
49
|
-
document: 'edit-post/document',
|
|
50
|
-
block: 'edit-post/block'
|
|
51
|
-
};
|
|
52
|
-
const SidebarContent = ({
|
|
53
|
-
tabName,
|
|
54
|
-
keyboardShortcut,
|
|
55
|
-
isEditingTemplate
|
|
56
|
-
}) => {
|
|
57
|
-
const tabListRef = (0, _element.useRef)(null);
|
|
58
|
-
// Because `PluginSidebar` renders a `ComplementaryArea`, we
|
|
59
|
-
// need to forward the `Tabs` context so it can be passed through the
|
|
60
|
-
// underlying slot/fill.
|
|
61
|
-
const tabsContextValue = (0, _element.useContext)(Tabs.Context);
|
|
62
|
-
|
|
63
|
-
// This effect addresses a race condition caused by tabbing from the last
|
|
64
|
-
// block in the editor into the settings sidebar. Without this effect, the
|
|
65
|
-
// selected tab and browser focus can become separated in an unexpected way
|
|
66
|
-
// (e.g the "block" tab is focused, but the "post" tab is selected).
|
|
67
|
-
(0, _element.useEffect)(() => {
|
|
68
|
-
const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []);
|
|
69
|
-
const selectedTabElement = tabsElements.find(
|
|
70
|
-
// We are purposefully using a custom `data-tab-id` attribute here
|
|
71
|
-
// because we don't want rely on any assumptions about `Tabs`
|
|
72
|
-
// component internals.
|
|
73
|
-
element => element.getAttribute('data-tab-id') === tabName);
|
|
74
|
-
const activeElement = selectedTabElement?.ownerDocument.activeElement;
|
|
75
|
-
const tabsHasFocus = tabsElements.some(element => {
|
|
76
|
-
return activeElement && activeElement.id === element.id;
|
|
77
|
-
});
|
|
78
|
-
if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
|
|
79
|
-
selectedTabElement?.focus();
|
|
80
|
-
}
|
|
81
|
-
}, [tabName]);
|
|
82
|
-
const {
|
|
83
|
-
createSuccessNotice
|
|
84
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
85
|
-
const onActionPerformed = (0, _element.useCallback)((actionId, items) => {
|
|
86
|
-
switch (actionId) {
|
|
87
|
-
case 'move-to-trash':
|
|
88
|
-
{
|
|
89
|
-
const postType = items[0].type;
|
|
90
|
-
document.location.href = (0, _url.addQueryArgs)('edit.php', {
|
|
91
|
-
post_type: postType
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
break;
|
|
95
|
-
case 'duplicate-post':
|
|
96
|
-
{
|
|
97
|
-
const newItem = items[0];
|
|
98
|
-
const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
|
|
99
|
-
createSuccessNotice((0, _i18n.sprintf)(
|
|
100
|
-
// translators: %s: Title of the created post e.g: "Post 1".
|
|
101
|
-
(0, _i18n.__)('"%s" successfully created.'), title), {
|
|
102
|
-
type: 'snackbar',
|
|
103
|
-
id: 'duplicate-post-action',
|
|
104
|
-
actions: [{
|
|
105
|
-
label: (0, _i18n.__)('Edit'),
|
|
106
|
-
onClick: () => {
|
|
107
|
-
const postId = newItem.id;
|
|
108
|
-
document.location.href = (0, _url.addQueryArgs)('post.php', {
|
|
109
|
-
post: postId,
|
|
110
|
-
action: 'edit'
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}]
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
}, [createSuccessNotice]);
|
|
119
|
-
return (0, _react.createElement)(_editor.PluginSidebar, {
|
|
120
|
-
identifier: tabName,
|
|
121
|
-
header: (0, _react.createElement)(Tabs.Context.Provider, {
|
|
122
|
-
value: tabsContextValue
|
|
123
|
-
}, (0, _react.createElement)(_settingsHeader.default, {
|
|
124
|
-
ref: tabListRef
|
|
125
|
-
})),
|
|
126
|
-
closeLabel: (0, _i18n.__)('Close Settings')
|
|
127
|
-
// This classname is added so we can apply a corrective negative
|
|
128
|
-
// margin to the panel.
|
|
129
|
-
// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
|
|
130
|
-
,
|
|
131
|
-
className: "edit-post-sidebar__panel",
|
|
132
|
-
headerClassName: "edit-post-sidebar__panel-tabs"
|
|
133
|
-
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
134
|
-
title: (0, _i18n.__)('Settings'),
|
|
135
|
-
toggleShortcut: keyboardShortcut,
|
|
136
|
-
icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
|
|
137
|
-
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
|
|
138
|
-
}, (0, _react.createElement)(Tabs.Context.Provider, {
|
|
139
|
-
value: tabsContextValue
|
|
140
|
-
}, (0, _react.createElement)(Tabs.TabPanel, {
|
|
141
|
-
tabId: sidebars.document,
|
|
142
|
-
focusable: false
|
|
143
|
-
}, (0, _react.createElement)(PostCardPanel, {
|
|
144
|
-
actions: (0, _react.createElement)(PostActions, {
|
|
145
|
-
onActionPerformed: onActionPerformed
|
|
146
|
-
})
|
|
147
|
-
}), !isEditingTemplate && (0, _react.createElement)(_postStatus.default, null), (0, _react.createElement)(_editor.PluginDocumentSettingPanel.Slot, null), (0, _react.createElement)(_editor.PostLastRevisionPanel, null), (0, _react.createElement)(_editor.PostTaxonomiesPanel, null), (0, _react.createElement)(_editor.PostDiscussionPanel, null), (0, _react.createElement)(_editor.PageAttributesPanel, null), (0, _react.createElement)(PatternOverridesPanel, null), !isEditingTemplate && (0, _react.createElement)(_metaBoxes.default, {
|
|
148
|
-
location: "side"
|
|
149
|
-
})), (0, _react.createElement)(Tabs.TabPanel, {
|
|
150
|
-
tabId: sidebars.block,
|
|
151
|
-
focusable: false
|
|
152
|
-
}, (0, _react.createElement)(_blockEditor.BlockInspector, null))));
|
|
153
|
-
};
|
|
154
|
-
const SettingsSidebar = () => {
|
|
155
|
-
useAutoSwitchEditorSidebars();
|
|
156
|
-
const {
|
|
157
|
-
tabName,
|
|
158
|
-
keyboardShortcut,
|
|
159
|
-
isEditingTemplate
|
|
160
|
-
} = (0, _data.useSelect)(select => {
|
|
161
|
-
const shortcut = select(_keyboardShortcuts.store).getShortcutRepresentation('core/editor/toggle-sidebar');
|
|
162
|
-
const sidebar = select(interfaceStore).getActiveComplementaryArea('core');
|
|
163
|
-
const _isEditorSidebarOpened = [sidebars.block, sidebars.document].includes(sidebar);
|
|
164
|
-
let _tabName = sidebar;
|
|
165
|
-
if (!_isEditorSidebarOpened) {
|
|
166
|
-
_tabName = !!select(_blockEditor.store).getBlockSelectionStart() ? sidebars.block : sidebars.document;
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
tabName: _tabName,
|
|
170
|
-
keyboardShortcut: shortcut,
|
|
171
|
-
isEditingTemplate: select(_editor.store).getCurrentPostType() === 'wp_template'
|
|
172
|
-
};
|
|
173
|
-
}, []);
|
|
174
|
-
const {
|
|
175
|
-
openGeneralSidebar
|
|
176
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
177
|
-
const onTabSelect = (0, _element.useCallback)(newSelectedTabId => {
|
|
178
|
-
if (!!newSelectedTabId) {
|
|
179
|
-
openGeneralSidebar(newSelectedTabId);
|
|
180
|
-
}
|
|
181
|
-
}, [openGeneralSidebar]);
|
|
182
|
-
return (0, _react.createElement)(Tabs, {
|
|
183
|
-
selectedTabId: tabName,
|
|
184
|
-
onSelect: onTabSelect,
|
|
185
|
-
selectOnMove: false
|
|
186
|
-
}, (0, _react.createElement)(SidebarContent, {
|
|
187
|
-
tabName: tabName,
|
|
188
|
-
keyboardShortcut: keyboardShortcut,
|
|
189
|
-
isEditingTemplate: isEditingTemplate
|
|
190
|
-
}));
|
|
191
|
-
};
|
|
192
|
-
var _default = exports.default = SettingsSidebar;
|
|
193
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_data","_element","_i18n","_icons","_keyboardShortcuts","_editor","_url","_notices","_settingsHeader","_interopRequireDefault","_postStatus","_metaBoxes","_store","_components","_lockUnlock","PostCardPanel","PostActions","interfaceStore","unlock","editorPrivateApis","Tabs","componentsPrivateApis","PatternOverridesPanel","useAutoSwitchEditorSidebars","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","sidebars","exports","document","block","SidebarContent","tabName","keyboardShortcut","isEditingTemplate","tabListRef","useRef","tabsContextValue","useContext","Context","useEffect","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","createSuccessNotice","useDispatch","noticesStore","onActionPerformed","useCallback","actionId","items","postType","type","location","href","addQueryArgs","post_type","newItem","title","rendered","sprintf","__","actions","label","onClick","postId","post","action","_react","createElement","PluginSidebar","identifier","header","Provider","value","default","ref","closeLabel","className","headerClassName","toggleShortcut","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","TabPanel","tabId","focusable","PluginDocumentSettingPanel","Slot","PostLastRevisionPanel","PostTaxonomiesPanel","PostDiscussionPanel","PageAttributesPanel","BlockInspector","SettingsSidebar","useSelect","shortcut","keyboardShortcutsStore","getShortcutRepresentation","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","blockEditorStore","getBlockSelectionStart","editorStore","getCurrentPostType","openGeneralSidebar","editPostStore","onTabSelect","newSelectedTabId","selectedTabId","onSelect","selectOnMove","_default"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPluginDocumentSettingPanel,\n\tPluginSidebar,\n\tPostDiscussionPanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostCardPanel, PostActions, interfaceStore } =\n\tunlock( editorPrivateApis );\nconst { Tabs } = unlock( componentsPrivateApis );\nconst { PatternOverridesPanel, useAutoSwitchEditorSidebars } =\n\tunlock( editorPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nconst SidebarContent = ( { tabName, keyboardShortcut, isEditingTemplate } ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst postType = items[ 0 ].type;\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\tpost_type: postType,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEditingTemplate && <PostStatus /> }\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t{ ! isEditingTemplate && <MetaBoxes location=\"side\" /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, isEditingTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisEditingTemplate={ isEditingTemplate }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAUA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,eAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,WAAA,GAAAD,sBAAA,CAAAV,OAAA;AACA,IAAAY,UAAA,GAAAF,sBAAA,CAAAV,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AAvCA;AACA;AACA;;AA6BA;AACA;AACA;;AAQA,MAAM;EAAEgB,aAAa;EAAEC,WAAW;EAAEC;AAAe,CAAC,GACnD,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAC5B,MAAM;EAAEC;AAAK,CAAC,GAAG,IAAAF,kBAAM,EAAEG,uBAAsB,CAAC;AAChD,MAAM;EAAEC,qBAAqB;EAAEC;AAA4B,CAAC,GAC3D,IAAAL,kBAAM,EAAEC,mBAAkB,CAAC;AAE5B,MAAMK,yBAAyB,GAAGC,iBAAQ,CAACC,MAAM,CAAE;EAClDC,GAAG,EAAE,IAAI;EACTC,MAAM,EAAE;AACT,CAAE,CAAC;AACI,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG;EACvBE,QAAQ,EAAE,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,EACD,CAAC;EAED,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAjE,iBAAW,EAAEkE,YAAc,CAAC;EAE3D,MAAMC,WAAW,GAAG,IAAAhE,oBAAW,EAC5BiE,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BH,kBAAkB,CAAEG,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD,CAAEH,kBAAkB,CACrB,CAAC;EAED,OACC,IAAA1C,MAAA,CAAAC,aAAA,EAAC/D,IAAI;IACJ4G,aAAa,EAAG9F,OAAS;IACzB+F,QAAQ,EAAGH,WAAa;IACxBI,YAAY,EAAG;EAAO,GAEtB,IAAAhD,MAAA,CAAAC,aAAA,EAAClD,cAAc;IACdC,OAAO,EAAGA,OAAS;IACnBC,gBAAgB,EAAGA,gBAAkB;IACrCC,iBAAiB,EAAGA;EAAmB,CACvC,CACI,CAAC;AAET,CAAC;AAAC,IAAA+F,QAAA,GAAArG,OAAA,CAAA2D,OAAA,GAEaqB,eAAe","ignoreList":[]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = TextEditor;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _editor = require("@wordpress/editor");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
|
-
var _store = require("../../store");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
function TextEditor() {
|
|
24
|
-
const isRichEditingEnabled = (0, _data.useSelect)(select => {
|
|
25
|
-
return select(_editor.store).getEditorSettings().richEditingEnabled;
|
|
26
|
-
}, []);
|
|
27
|
-
const {
|
|
28
|
-
switchEditorMode
|
|
29
|
-
} = (0, _data.useDispatch)(_editor.store);
|
|
30
|
-
const {
|
|
31
|
-
isWelcomeGuideVisible
|
|
32
|
-
} = (0, _data.useSelect)(select => {
|
|
33
|
-
const {
|
|
34
|
-
isFeatureActive
|
|
35
|
-
} = select(_store.store);
|
|
36
|
-
return {
|
|
37
|
-
isWelcomeGuideVisible: isFeatureActive('welcomeGuide')
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
const titleRef = (0, _element.useRef)();
|
|
41
|
-
(0, _element.useEffect)(() => {
|
|
42
|
-
if (isWelcomeGuideVisible) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
titleRef?.current?.focus();
|
|
46
|
-
}, [isWelcomeGuideVisible]);
|
|
47
|
-
return (0, _react.createElement)("div", {
|
|
48
|
-
className: "edit-post-text-editor"
|
|
49
|
-
}, isRichEditingEnabled && (0, _react.createElement)("div", {
|
|
50
|
-
className: "edit-post-text-editor__toolbar"
|
|
51
|
-
}, (0, _react.createElement)("h2", null, (0, _i18n.__)('Editing code')), (0, _react.createElement)(_components.Button, {
|
|
52
|
-
variant: "tertiary",
|
|
53
|
-
onClick: () => switchEditorMode('visual'),
|
|
54
|
-
shortcut: _keycodes.displayShortcut.secondary('m')
|
|
55
|
-
}, (0, _i18n.__)('Exit code editor'))), (0, _react.createElement)("div", {
|
|
56
|
-
className: "edit-post-text-editor__body"
|
|
57
|
-
}, (0, _react.createElement)(_editor.PostTitleRaw, {
|
|
58
|
-
ref: titleRef
|
|
59
|
-
}), (0, _react.createElement)(_editor.PostTextEditor, null)));
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_components","_data","_i18n","_keycodes","_element","_store","TextEditor","isRichEditingEnabled","useSelect","select","editorStore","getEditorSettings","richEditingEnabled","switchEditorMode","useDispatch","isWelcomeGuideVisible","isFeatureActive","editPostStore","titleRef","useRef","useEffect","current","focus","_react","createElement","className","__","Button","variant","onClick","shortcut","displayShortcut","secondary","PostTitleRaw","ref","PostTextEditor"],"sources":["@wordpress/edit-post/src/components/text-editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTextEditor,\n\tPostTitleRaw,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function TextEditor() {\n\tconst isRichEditingEnabled = useSelect( ( select ) => {\n\t\treturn select( editorStore ).getEditorSettings().richEditingEnabled;\n\t}, [] );\n\tconst { switchEditorMode } = useDispatch( editorStore );\n\n\tconst { isWelcomeGuideVisible } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\n\t}, [] );\n\n\tconst titleRef = useRef();\n\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible ] );\n\n\treturn (\n\t\t<div className=\"edit-post-text-editor\">\n\t\t\t{ isRichEditingEnabled && (\n\t\t\t\t<div className=\"edit-post-text-editor__toolbar\">\n\t\t\t\t\t<h2>{ __( 'Editing code' ) }</h2>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => switchEditorMode( 'visual' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'm' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Exit code editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"edit-post-text-editor__body\">\n\t\t\t\t<PostTitleRaw ref={ titleRef } />\n\t\t\t\t<PostTextEditor />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGe,SAASO,UAAUA,CAAA,EAAG;EACpC,MAAMC,oBAAoB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACrD,OAAOA,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC,kBAAkB;EACpE,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,aAAY,CAAC;EAEvD,MAAM;IAAEK;EAAsB,CAAC,GAAG,IAAAP,eAAS,EAAIC,MAAM,IAAM;IAC1D,MAAM;MAAEO;IAAgB,CAAC,GAAGP,MAAM,CAAEQ,YAAc,CAAC;IAEnD,OAAO;MACNF,qBAAqB,EAAEC,eAAe,CAAE,cAAe;IACxD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAME,QAAQ,GAAG,IAAAC,eAAM,EAAC,CAAC;EAEzB,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKL,qBAAqB,EAAG;MAC5B;IACD;IACAG,QAAQ,EAAEG,OAAO,EAAEC,KAAK,CAAC,CAAC;EAC3B,CAAC,EAAE,CAAEP,qBAAqB,CAAG,CAAC;EAE9B,OACC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