@wordpress/edit-post 7.33.0 → 7.35.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 +10 -2
- package/README.md +22 -36
- package/build/components/header/fullscreen-mode-close/index.js +2 -2
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/index.js +7 -127
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +17 -43
- 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/keyboard-shortcuts/index.js +0 -88
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +72 -33
- package/build/components/layout/index.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +2 -2
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +2 -11
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/visual-editor/index.js +11 -5
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-padding-appender.js +6 -1
- package/build/components/visual-editor/use-padding-appender.js.map +1 -1
- package/build/deprecated.js +132 -0
- package/build/deprecated.js.map +1 -0
- package/build/index.js +19 -58
- package/build/index.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +2 -2
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/index.js +11 -131
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +17 -43
- 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/keyboard-shortcuts/index.js +1 -89
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +73 -34
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +2 -2
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +3 -12
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +11 -5
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-padding-appender.js +6 -1
- package/build-module/components/visual-editor/use-padding-appender.js.map +1 -1
- package/build-module/deprecated.js +116 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/index.js +2 -15
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +14 -409
- package/build-style/style.css +14 -409
- package/package.json +32 -32
- package/src/components/header/fullscreen-mode-close/index.js +2 -2
- package/src/components/header/index.js +11 -159
- package/src/components/header/more-menu/index.js +27 -42
- package/src/components/header/more-menu/manage-patterns-menu-item.js +33 -0
- package/src/components/header/style.scss +4 -320
- package/src/components/keyboard-shortcuts/index.js +1 -106
- package/src/components/layout/index.js +84 -25
- package/src/components/layout/style.scss +7 -80
- package/src/components/meta-boxes/meta-boxes-area/index.js +4 -8
- package/src/components/preferences-modal/index.js +2 -22
- package/src/components/visual-editor/index.js +11 -4
- package/src/components/visual-editor/use-padding-appender.js +7 -1
- package/src/deprecated.js +107 -0
- package/src/index.js +3 -24
- package/src/style.scss +1 -5
- package/build/components/header/post-publish-button-or-toggle.js +0 -94
- package/build/components/header/post-publish-button-or-toggle.js.map +0 -1
- package/build/components/header/preferences-menu-item/index.js +0 -39
- 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/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-pre-publish-panel/index.js +0 -43
- package/build/components/sidebar/plugin-pre-publish-panel/index.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 -69
- 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 -163
- package/build/components/sidebar/settings-sidebar/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 -44
- 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/post-publish-button-or-toggle.js +0 -86
- 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 -32
- 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/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-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/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 -61
- 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 -155
- package/build-module/components/sidebar/settings-sidebar/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 -36
- 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/post-publish-button-or-toggle.js +0 -97
- package/src/components/header/preferences-menu-item/index.js +0 -31
- package/src/components/header/test/index.js +0 -63
- 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/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-pre-publish-panel/index.js +0 -32
- 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 -88
- 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 -211
- package/src/components/sidebar/style.scss +0 -18
- 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 -36
- /package/src/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 7.35.0 (2024-05-16)
|
|
6
|
+
|
|
7
|
+
### Internal
|
|
8
|
+
|
|
9
|
+
- Replaced `classnames` package with the faster and smaller `clsx` package ([#61138](https://github.com/WordPress/gutenberg/pull/61138)).
|
|
10
|
+
|
|
11
|
+
## 7.34.0 (2024-05-02)
|
|
12
|
+
|
|
5
13
|
## 7.33.0 (2024-04-19)
|
|
6
14
|
|
|
7
15
|
## 7.32.0 (2024-04-03)
|
|
@@ -146,8 +154,8 @@
|
|
|
146
154
|
|
|
147
155
|
### Breaking Changes
|
|
148
156
|
|
|
149
|
-
- Drop support for Internet Explorer 11 ([#31110](https://github.com/WordPress/gutenberg/pull/31110)). Learn more at https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan
|
|
150
|
-
- Increase the minimum Node.js version to v12 matching Long Term Support releases ([#31270](https://github.com/WordPress/gutenberg/pull/31270)). Learn more at https://nodejs.org/en/about/releases
|
|
157
|
+
- Drop support for Internet Explorer 11 ([#31110](https://github.com/WordPress/gutenberg/pull/31110)). Learn more at <https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan/>.
|
|
158
|
+
- Increase the minimum Node.js version to v12 matching Long Term Support releases ([#31270](https://github.com/WordPress/gutenberg/pull/31270)). Learn more at <https://nodejs.org/en/about/releases/>.
|
|
151
159
|
|
|
152
160
|
## 3.27.0 (2021-03-17)
|
|
153
161
|
|
package/README.md
CHANGED
|
@@ -41,65 +41,51 @@ _Parameters_
|
|
|
41
41
|
|
|
42
42
|
### PluginBlockSettingsMenuItem
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### PluginDocumentSettingPanel
|
|
44
|
+
_Related_
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
- PluginBlockSettingsMenuItem in @wordpress/editor package.
|
|
49
47
|
|
|
50
|
-
###
|
|
48
|
+
### PluginDocumentSettingPanel
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
_Related_
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
- PluginDocumentSettingPanel in @wordpress/editor package.
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
### PluginMoreMenuItem
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
_Related_
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
- PluginMoreMenuItem in @wordpress/editor package.
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
- _props.className_ `[string]`: An optional class name added to the panel.
|
|
64
|
-
- _props.title_ `[string]`: Title displayed at the top of the panel.
|
|
65
|
-
- _props.initialOpen_ `[boolean]`: Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
66
|
-
- _props.icon_ `[WPBlockTypeIconRender]`: 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.
|
|
67
|
-
- _props.children_ `Element`: Children to be rendered
|
|
60
|
+
### PluginPostPublishPanel
|
|
68
61
|
|
|
69
|
-
|
|
62
|
+
_Related_
|
|
70
63
|
|
|
71
|
-
-
|
|
64
|
+
- PluginPostPublishPanel in @wordpress/editor package.
|
|
72
65
|
|
|
73
66
|
### PluginPostStatusInfo
|
|
74
67
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### PluginPrePublishPanel
|
|
78
|
-
|
|
79
|
-
> **Deprecated** since 6.6, use `wp.editor.PluginPrePublishPanel` instead.
|
|
80
|
-
|
|
81
|
-
Renders provided content to the pre-publish side panel in the publish flow (side panel that opens when a user first pushes "Publish" from the main editor).
|
|
68
|
+
_Related_
|
|
82
69
|
|
|
83
|
-
|
|
70
|
+
- PluginPostStatusInfo in @wordpress/editor package.
|
|
84
71
|
|
|
85
|
-
|
|
86
|
-
- _props.className_ `[string]`: An optional class name added to the panel.
|
|
87
|
-
- _props.title_ `[string]`: Title displayed at the top of the panel.
|
|
88
|
-
- _props.initialOpen_ `[boolean]`: Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
89
|
-
- _props.icon_ `[WPBlockTypeIconRender]`: 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.
|
|
90
|
-
- _props.children_ `Element`: Children to be rendered
|
|
72
|
+
### PluginPrePublishPanel
|
|
91
73
|
|
|
92
|
-
|
|
74
|
+
_Related_
|
|
93
75
|
|
|
94
|
-
-
|
|
76
|
+
- PluginPrePublishPanel in @wordpress/editor package.
|
|
95
77
|
|
|
96
78
|
### PluginSidebar
|
|
97
79
|
|
|
98
|
-
|
|
80
|
+
_Related_
|
|
81
|
+
|
|
82
|
+
- PluginSidebar in @wordpress/editor package.
|
|
99
83
|
|
|
100
84
|
### PluginSidebarMoreMenuItem
|
|
101
85
|
|
|
102
|
-
|
|
86
|
+
_Related_
|
|
87
|
+
|
|
88
|
+
- PluginSidebarMoreMenuItem in @wordpress/editor package.
|
|
103
89
|
|
|
104
90
|
### reinitializeEditor
|
|
105
91
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _components = require("@wordpress/components");
|
|
12
12
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -97,7 +97,7 @@ function FullscreenModeClose({
|
|
|
97
97
|
icon: icon
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
const classes = (0,
|
|
100
|
+
const classes = (0, _clsx.default)({
|
|
101
101
|
'edit-post-fullscreen-mode-close': true,
|
|
102
102
|
'has-icon': siteIconUrl
|
|
103
103
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_store","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isActive","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","_react","createElement","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAA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;EACrB,CAAE,CAAC;EAEJ,MAAMC,WAAW,IAAA9C,qBAAA,GAAGG,QAAQ,EAAE4C,MAAM,EAAEC,UAAU,cAAAhD,qBAAA,cAAAA,qBAAA,GAAI,IAAAqC,QAAE,EAAE,MAAO,CAAC;EAEhE,OACC,IAAAd,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAA8C,gBAAM,CAACgB,GAAG;IAACC,UAAU,EAAC;EAAQ,GAC9B,IAAA3B,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAAgE,MAAM;IACNb,SAAS,EAAGE,OAAS;IACrB1C,IAAI,EAAG4C,UAAY;IACnBU,KAAK,EAAGN,WAAa;IACrBlD,WAAW,EAAGA;EAAa,GAEzB0B,UACK,CACG,CAAC;AAEf;AAAC,IAAA+B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc5D,mBAAmB","ignoreList":[]}
|
|
@@ -6,26 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
11
9
|
var _editor = require("@wordpress/editor");
|
|
12
|
-
var _element = require("@wordpress/element");
|
|
13
10
|
var _data = require("@wordpress/data");
|
|
14
|
-
var _i18n = require("@wordpress/i18n");
|
|
15
|
-
var _icons = require("@wordpress/icons");
|
|
16
|
-
var _compose = require("@wordpress/compose");
|
|
17
11
|
var _components = require("@wordpress/components");
|
|
18
|
-
var _preferences = require("@wordpress/preferences");
|
|
19
12
|
var _fullscreenModeClose = _interopRequireDefault(require("./fullscreen-mode-close"));
|
|
20
13
|
var _moreMenu = _interopRequireDefault(require("./more-menu"));
|
|
21
|
-
var _postPublishButtonOrToggle = _interopRequireDefault(require("./post-publish-button-or-toggle"));
|
|
22
14
|
var _mainDashboardButton = _interopRequireDefault(require("./main-dashboard-button"));
|
|
23
15
|
var _store = require("../../store");
|
|
24
16
|
var _lockUnlock = require("../../lock-unlock");
|
|
25
|
-
/**
|
|
26
|
-
* External dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
17
|
/**
|
|
30
18
|
* WordPress dependencies
|
|
31
19
|
*/
|
|
@@ -35,29 +23,8 @@ var _lockUnlock = require("../../lock-unlock");
|
|
|
35
23
|
*/
|
|
36
24
|
|
|
37
25
|
const {
|
|
38
|
-
|
|
39
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
40
|
-
const {
|
|
41
|
-
DocumentTools,
|
|
42
|
-
PostViewLink,
|
|
43
|
-
PreviewDropdown,
|
|
44
|
-
PinnedItems
|
|
26
|
+
Header: EditorHeader
|
|
45
27
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
46
|
-
const slideY = {
|
|
47
|
-
hidden: {
|
|
48
|
-
y: '-50px'
|
|
49
|
-
},
|
|
50
|
-
distractionFreeInactive: {
|
|
51
|
-
y: 0
|
|
52
|
-
},
|
|
53
|
-
hover: {
|
|
54
|
-
y: 0,
|
|
55
|
-
transition: {
|
|
56
|
-
type: 'tween',
|
|
57
|
-
delay: 0.2
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
28
|
const slideX = {
|
|
62
29
|
hidden: {
|
|
63
30
|
x: '-100%'
|
|
@@ -77,46 +44,16 @@ function Header({
|
|
|
77
44
|
setEntitiesSavedStatesCallback,
|
|
78
45
|
initialPost
|
|
79
46
|
}) {
|
|
80
|
-
const isWideViewport = (0, _compose.useViewportMatch)('large');
|
|
81
|
-
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
82
|
-
const blockToolbarRef = (0, _element.useRef)();
|
|
83
47
|
const {
|
|
84
|
-
|
|
85
|
-
blockSelectionStart,
|
|
86
|
-
hasActiveMetaboxes,
|
|
87
|
-
isPublishSidebarOpened,
|
|
88
|
-
showIconLabels,
|
|
89
|
-
hasHistory
|
|
48
|
+
hasActiveMetaboxes
|
|
90
49
|
} = (0, _data.useSelect)(select => {
|
|
91
|
-
const {
|
|
92
|
-
get: getPreference
|
|
93
|
-
} = select(_preferences.store);
|
|
94
|
-
const {
|
|
95
|
-
getEditorMode
|
|
96
|
-
} = select(_editor.store);
|
|
97
50
|
return {
|
|
98
|
-
|
|
99
|
-
blockSelectionStart: select(_blockEditor.store).getBlockSelectionStart(),
|
|
100
|
-
hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
|
|
101
|
-
hasHistory: !!select(_editor.store).getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
102
|
-
isPublishSidebarOpened: select(_editor.store).isPublishSidebarOpened(),
|
|
103
|
-
showIconLabels: getPreference('core', 'showIconLabels')
|
|
51
|
+
hasActiveMetaboxes: select(_store.store).hasMetaBoxes()
|
|
104
52
|
};
|
|
105
53
|
}, []);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const showTopToolbar = isLargeViewport && showFixedToolbar;
|
|
110
|
-
const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0, _element.useState)(true);
|
|
111
|
-
const hasBlockSelection = !!blockSelectionStart;
|
|
112
|
-
(0, _element.useEffect)(() => {
|
|
113
|
-
// If we have a new block selection, show the block tools
|
|
114
|
-
if (blockSelectionStart) {
|
|
115
|
-
setIsBlockToolsCollapsed(false);
|
|
116
|
-
}
|
|
117
|
-
}, [blockSelectionStart]);
|
|
118
|
-
return (0, _react.createElement)("div", {
|
|
119
|
-
className: "edit-post-header"
|
|
54
|
+
return (0, _react.createElement)(EditorHeader, {
|
|
55
|
+
forceIsDirty: hasActiveMetaboxes,
|
|
56
|
+
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
|
|
120
57
|
}, (0, _react.createElement)(_mainDashboardButton.default.Slot, null, (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
121
58
|
variants: slideX,
|
|
122
59
|
transition: {
|
|
@@ -126,64 +63,7 @@ function Header({
|
|
|
126
63
|
}, (0, _react.createElement)(_fullscreenModeClose.default, {
|
|
127
64
|
showTooltip: true,
|
|
128
65
|
initialPost: initialPost
|
|
129
|
-
}))), (0, _react.createElement)(
|
|
130
|
-
variants: slideY,
|
|
131
|
-
transition: {
|
|
132
|
-
type: 'tween',
|
|
133
|
-
delay: 0.8
|
|
134
|
-
},
|
|
135
|
-
className: "edit-post-header__toolbar"
|
|
136
|
-
}, (0, _react.createElement)(DocumentTools, {
|
|
137
|
-
disableBlockTools: isTextEditor
|
|
138
|
-
}), showTopToolbar && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("div", {
|
|
139
|
-
className: (0, _classnames.default)('selected-block-tools-wrapper', {
|
|
140
|
-
'is-collapsed': isBlockToolsCollapsed || !hasBlockSelection
|
|
141
|
-
})
|
|
142
|
-
}, (0, _react.createElement)(_blockEditor.BlockToolbar, {
|
|
143
|
-
hideDragHandle: true
|
|
144
|
-
})), (0, _react.createElement)(_components.Popover.Slot, {
|
|
145
|
-
ref: blockToolbarRef,
|
|
146
|
-
name: "block-toolbar"
|
|
147
|
-
}), (0, _react.createElement)(_components.Button, {
|
|
148
|
-
className: "edit-post-header__block-tools-toggle",
|
|
149
|
-
icon: isBlockToolsCollapsed ? _icons.next : _icons.previous,
|
|
150
|
-
onClick: () => {
|
|
151
|
-
setIsBlockToolsCollapsed(collapsed => !collapsed);
|
|
152
|
-
},
|
|
153
|
-
label: isBlockToolsCollapsed ? (0, _i18n.__)('Show block tools') : (0, _i18n.__)('Hide block tools'),
|
|
154
|
-
size: "compact"
|
|
155
|
-
})), (0, _react.createElement)("div", {
|
|
156
|
-
className: (0, _classnames.default)('edit-post-header__center', {
|
|
157
|
-
'is-collapsed': hasHistory && !isBlockToolsCollapsed && showTopToolbar
|
|
158
|
-
})
|
|
159
|
-
}, hasHistory && (0, _react.createElement)(_editor.DocumentBar, null))), (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
160
|
-
variants: slideY,
|
|
161
|
-
transition: {
|
|
162
|
-
type: 'tween',
|
|
163
|
-
delay: 0.8
|
|
164
|
-
},
|
|
165
|
-
className: "edit-post-header__settings"
|
|
166
|
-
}, !isPublishSidebarOpened &&
|
|
167
|
-
// This button isn't completely hidden by the publish sidebar.
|
|
168
|
-
// We can't hide the whole toolbar when the publish sidebar is open because
|
|
169
|
-
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
|
|
170
|
-
// We track that DOM node to return focus to the PostPublishButtonOrToggle
|
|
171
|
-
// when the publish sidebar has been closed.
|
|
172
|
-
(0, _react.createElement)(_editor.PostSavedState, {
|
|
173
|
-
forceIsDirty: hasActiveMetaboxes
|
|
174
|
-
}), (0, _react.createElement)(PreviewDropdown, {
|
|
175
|
-
forceIsAutosaveable: hasActiveMetaboxes
|
|
176
|
-
}), (0, _react.createElement)(_editor.PostPreviewButton, {
|
|
177
|
-
className: "edit-post-header__post-preview-button",
|
|
178
|
-
forceIsAutosaveable: hasActiveMetaboxes
|
|
179
|
-
}), (0, _react.createElement)(PostViewLink, null), (0, _react.createElement)(_postPublishButtonOrToggle.default, {
|
|
180
|
-
forceIsDirty: hasActiveMetaboxes,
|
|
181
|
-
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
|
|
182
|
-
}), (isWideViewport || !showIconLabels) && (0, _react.createElement)(PinnedItems.Slot, {
|
|
183
|
-
scope: "core"
|
|
184
|
-
}), (0, _react.createElement)(_moreMenu.default, {
|
|
185
|
-
showIconLabels: showIconLabels
|
|
186
|
-
})));
|
|
66
|
+
}))), (0, _react.createElement)(_moreMenu.default, null));
|
|
187
67
|
}
|
|
188
68
|
var _default = exports.default = Header;
|
|
189
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_editor","_element","_data","_i18n","_icons","_compose","_components","_preferences","_fullscreenModeClose","_moreMenu","_postPublishButtonOrToggle","_mainDashboardButton","_store","_lockUnlock","useShowBlockTools","unlock","blockEditorPrivateApis","DocumentTools","PostViewLink","PreviewDropdown","PinnedItems","editorPrivateApis","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","initialPost","isWideViewport","useViewportMatch","isLargeViewport","blockToolbarRef","useRef","isTextEditor","blockSelectionStart","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","hasHistory","useSelect","select","get","getPreference","preferencesStore","getEditorMode","editorStore","blockEditorStore","getBlockSelectionStart","editPostStore","hasMetaBoxes","getEditorSettings","onNavigateToPreviousEntityRecord","showFixedToolbar","showTopToolbar","isBlockToolsCollapsed","setIsBlockToolsCollapsed","useState","hasBlockSelection","useEffect","_react","createElement","className","default","Slot","__unstableMotion","div","variants","showTooltip","disableBlockTools","Fragment","classnames","BlockToolbar","hideDragHandle","Popover","ref","name","Button","icon","next","previous","onClick","collapsed","label","__","size","DocumentBar","PostSavedState","forceIsDirty","forceIsAutosaveable","PostPreviewButton","scope","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tDocumentBar,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useShowBlockTools } = unlock( blockEditorPrivateApis );\nconst { DocumentTools, PostViewLink, PreviewDropdown, PinnedItems } =\n\tunlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback, initialPost } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst {\n\t\tisTextEditor,\n\t\tblockSelectionStart,\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\tblockSelectionStart:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory:\n\t\t\t\t!! select( editorStore ).getEditorSettings()\n\t\t\t\t\t.onNavigateToPreviousEntityRecord,\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst { showFixedToolbar } = useShowBlockTools();\n\tconst showTopToolbar = isLargeViewport && showFixedToolbar;\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\tconst hasBlockSelection = !! blockSelectionStart;\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( blockSelectionStart ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ blockSelectionStart ] );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t/>\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ showTopToolbar && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed ||\n\t\t\t\t\t\t\t\t\t\t! hasBlockSelection,\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\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-post-header__block-tools-toggle\"\n\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\thasHistory &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\tshowTopToolbar,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ hasHistory && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core\" />\n\t\t\t\t) }\n\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAKA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,oBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,SAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,0BAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,oBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AAxCA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;;AAQA,MAAM;EAAEgB;AAAkB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAC9D,MAAM;EAAEC,aAAa;EAAEC,YAAY;EAAEC,eAAe;EAAEC;AAAY,CAAC,GAClE,IAAA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|
1
|
+
{"version":3,"names":["_editor","require","_data","_components","_fullscreenModeClose","_interopRequireDefault","_moreMenu","_mainDashboardButton","_store","_lockUnlock","Header","EditorHeader","unlock","editorPrivateApis","slideX","hidden","x","distractionFreeInactive","hover","transition","type","delay","setEntitiesSavedStatesCallback","initialPost","hasActiveMetaboxes","useSelect","select","editPostStore","hasMetaBoxes","_react","createElement","forceIsDirty","default","Slot","__unstableMotion","div","variants","showTooltip","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport PostEditorMoreMenu from './more-menu';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Header: EditorHeader } = unlock( editorPrivateApis );\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback, initialPost } ) {\n\tconst { hasActiveMetaboxes } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<EditorHeader\n\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t>\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t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AAyB,OAAmB,CAACC,IAAI,QACxB,IAAAJ,MAAA,CAAAC,aAAA,EAAC3B,WAAA,CAAA+B,gBAAM,CAACC,GAAG;IACVC,QAAQ,EAAGtB,MAAQ;IACnBK,UAAU,EAAG;MAAEC,IAAI,EAAE,OAAO;MAAEC,KAAK,EAAE;IAAI;EAAG,GAE5C,IAAAQ,MAAA,CAAAC,aAAA,EAAC1B,oBAAA,CAAA4B,OAAmB;IACnBK,WAAW;IACXd,WAAW,EAAGA;EAAa,CAC3B,CACU,CACa,CAAC,EAC3B,IAAAM,MAAA,CAAAC,aAAA,EAACxB,SAAA,CAAA0B,OAAkB,MAAE,CACR,CAAC;AAEjB;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEctB,MAAM","ignoreList":[]}
|
|
@@ -7,14 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
10
|
var _compose = require("@wordpress/compose");
|
|
12
11
|
var _editor = require("@wordpress/editor");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var _toolsMoreMenuGroup = _interopRequireDefault(require("../tools-more-menu-group"));
|
|
16
|
-
var _writingMenu = _interopRequireDefault(require("../writing-menu"));
|
|
12
|
+
var _preferences = require("@wordpress/preferences");
|
|
13
|
+
var _keycodes = require("@wordpress/keycodes");
|
|
17
14
|
var _lockUnlock = require("../../../lock-unlock");
|
|
15
|
+
var _managePatternsMenuItem = _interopRequireDefault(require("./manage-patterns-menu-item"));
|
|
16
|
+
var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu-item"));
|
|
17
|
+
var _preferencesModal = _interopRequireDefault(require("../../preferences-modal"));
|
|
18
18
|
/**
|
|
19
19
|
* WordPress dependencies
|
|
20
20
|
*/
|
|
@@ -24,46 +24,20 @@ var _lockUnlock = require("../../../lock-unlock");
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
const {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
PinnedItems
|
|
27
|
+
ToolsMoreMenuGroup,
|
|
28
|
+
ViewMoreMenuGroup
|
|
30
29
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
31
|
-
const MoreMenu = ({
|
|
32
|
-
showIconLabels
|
|
33
|
-
}) => {
|
|
30
|
+
const MoreMenu = () => {
|
|
34
31
|
const isLargeViewport = (0, _compose.useViewportMatch)('large');
|
|
35
|
-
return (0, _react.createElement)(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
variant: 'tertiary'
|
|
45
|
-
}),
|
|
46
|
-
tooltipPosition: 'bottom',
|
|
47
|
-
showTooltip: !showIconLabels,
|
|
48
|
-
size: 'compact'
|
|
49
|
-
}
|
|
50
|
-
}, ({
|
|
51
|
-
onClose
|
|
52
|
-
}) => (0, _react.createElement)(_react.Fragment, null, showIconLabels && !isLargeViewport && (0, _react.createElement)(PinnedItems.Slot, {
|
|
53
|
-
className: showIconLabels && 'show-icon-labels',
|
|
54
|
-
scope: "core"
|
|
55
|
-
}), (0, _react.createElement)(_writingMenu.default, null), (0, _react.createElement)(ModeSwitcher, null), (0, _react.createElement)(ActionItem.Slot, {
|
|
56
|
-
name: "core/plugin-more-menu",
|
|
57
|
-
label: (0, _i18n.__)('Plugins'),
|
|
58
|
-
as: _components.MenuGroup,
|
|
59
|
-
fillProps: {
|
|
60
|
-
onClick: onClose
|
|
61
|
-
}
|
|
62
|
-
}), (0, _react.createElement)(_toolsMoreMenuGroup.default.Slot, {
|
|
63
|
-
fillProps: {
|
|
64
|
-
onClose
|
|
65
|
-
}
|
|
66
|
-
}), (0, _react.createElement)(_components.MenuGroup, null, (0, _react.createElement)(_preferencesMenuItem.default, null))));
|
|
32
|
+
return (0, _react.createElement)(_react.Fragment, null, isLargeViewport && (0, _react.createElement)(ViewMoreMenuGroup, null, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
33
|
+
scope: "core/edit-post",
|
|
34
|
+
name: "fullscreenMode",
|
|
35
|
+
label: (0, _i18n.__)('Fullscreen mode'),
|
|
36
|
+
info: (0, _i18n.__)('Show and hide the admin user interface'),
|
|
37
|
+
messageActivated: (0, _i18n.__)('Fullscreen mode activated'),
|
|
38
|
+
messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated'),
|
|
39
|
+
shortcut: _keycodes.displayShortcut.secondary('f')
|
|
40
|
+
})), (0, _react.createElement)(ToolsMoreMenuGroup, null, (0, _react.createElement)(_managePatternsMenuItem.default, null), (0, _react.createElement)(_welcomeGuideMenuItem.default, null)), (0, _react.createElement)(_preferencesModal.default, null));
|
|
67
41
|
};
|
|
68
42
|
var _default = exports.default = MoreMenu;
|
|
69
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_editor","_preferences","_keycodes","_lockUnlock","_managePatternsMenuItem","_interopRequireDefault","_welcomeGuideMenuItem","_preferencesModal","ToolsMoreMenuGroup","ViewMoreMenuGroup","unlock","editorPrivateApis","MoreMenu","isLargeViewport","useViewportMatch","_react","createElement","Fragment","PreferenceToggleMenuItem","scope","name","label","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","default","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport ManagePatternsMenuItem from './manage-patterns-menu-item';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport EditPostPreferencesModal from '../../preferences-modal';\n\nconst { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );\n\nconst MoreMenu = () => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<ViewMoreMenuGroup>\n\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Fullscreen mode deactivated'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ViewMoreMenuGroup>\n\t\t\t) }\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<EditPostPreferencesModal />\n\t\t</>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,uBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,iBAAA,GAAAF,sBAAA,CAAAP,OAAA;AAfA;AACA;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
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
9
|
+
var _coreData = require("@wordpress/core-data");
|
|
10
|
+
var _data = require("@wordpress/data");
|
|
11
|
+
var _i18n = require("@wordpress/i18n");
|
|
12
|
+
var _url = require("@wordpress/url");
|
|
13
|
+
/**
|
|
14
|
+
* WordPress dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function ManagePatternsMenuItem() {
|
|
18
|
+
const url = (0, _data.useSelect)(select => {
|
|
19
|
+
const {
|
|
20
|
+
canUser
|
|
21
|
+
} = select(_coreData.store);
|
|
22
|
+
const defaultUrl = (0, _url.addQueryArgs)('edit.php', {
|
|
23
|
+
post_type: 'wp_block'
|
|
24
|
+
});
|
|
25
|
+
const patternsUrl = (0, _url.addQueryArgs)('site-editor.php', {
|
|
26
|
+
path: '/patterns'
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// The site editor and templates both check whether the user has
|
|
30
|
+
// edit_theme_options capabilities. We can leverage that here and not
|
|
31
|
+
// display the manage patterns link if the user can't access it.
|
|
32
|
+
return canUser('create', 'templates') ? patternsUrl : defaultUrl;
|
|
33
|
+
}, []);
|
|
34
|
+
return (0, _react.createElement)(_components.MenuItem, {
|
|
35
|
+
role: "menuitem",
|
|
36
|
+
href: url
|
|
37
|
+
}, (0, _i18n.__)('Manage patterns'));
|
|
38
|
+
}
|
|
39
|
+
var _default = exports.default = ManagePatternsMenuItem;
|
|
40
|
+
//# sourceMappingURL=manage-patterns-menu-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_coreData","_data","_i18n","_url","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","defaultUrl","addQueryArgs","post_type","patternsUrl","path","_react","createElement","MenuItem","role","href","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/more-menu/manage-patterns-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'create', 'templates' ) ? patternsUrl : defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA,SAASK,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACvC,MAAMC,UAAU,GAAG,IAAAC,iBAAY,EAAE,UAAU,EAAE;MAC5CC,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAG,IAAAF,iBAAY,EAAE,iBAAiB,EAAE;MACpDG,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAON,OAAO,CAAE,QAAQ,EAAE,WAAY,CAAC,GAAGK,WAAW,GAAGH,UAAU;EACnE,CAAC,EAAE,EAAG,CAAC;EAEP,OACC,IAAAK,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAmB,QAAQ;IAACC,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGd;EAAK,GACnC,IAAAe,QAAE,EAAE,iBAAkB,CACf,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnB,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/components/header/more-menu/welcome-guide-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
|