@wordpress/edit-post 7.33.0 → 7.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +22 -36
  3. package/build/components/header/index.js +17 -48
  4. package/build/components/header/index.js.map +1 -1
  5. package/build/components/header/more-menu/index.js +17 -43
  6. package/build/components/header/more-menu/index.js.map +1 -1
  7. package/build/components/header/more-menu/manage-patterns-menu-item.js +40 -0
  8. package/build/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
  9. package/build/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
  10. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  11. package/build/components/keyboard-shortcuts/index.js +0 -88
  12. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  13. package/build/components/layout/index.js +18 -11
  14. package/build/components/layout/index.js.map +1 -1
  15. package/build/components/preferences-modal/index.js +2 -11
  16. package/build/components/preferences-modal/index.js.map +1 -1
  17. package/build/components/sidebar/post-status/index.js +29 -6
  18. package/build/components/sidebar/post-status/index.js.map +1 -1
  19. package/build/components/sidebar/settings-sidebar/index.js +40 -10
  20. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  21. package/build/deprecated.js +132 -0
  22. package/build/deprecated.js.map +1 -0
  23. package/build/index.js +19 -58
  24. package/build/index.js.map +1 -1
  25. package/build-module/components/header/index.js +20 -51
  26. package/build-module/components/header/index.js.map +1 -1
  27. package/build-module/components/header/more-menu/index.js +17 -43
  28. package/build-module/components/header/more-menu/index.js.map +1 -1
  29. package/build-module/components/header/more-menu/manage-patterns-menu-item.js +33 -0
  30. package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
  31. package/build-module/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
  32. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  33. package/build-module/components/keyboard-shortcuts/index.js +1 -89
  34. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  35. package/build-module/components/layout/index.js +18 -11
  36. package/build-module/components/layout/index.js.map +1 -1
  37. package/build-module/components/preferences-modal/index.js +3 -12
  38. package/build-module/components/preferences-modal/index.js.map +1 -1
  39. package/build-module/components/sidebar/post-status/index.js +30 -7
  40. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  41. package/build-module/components/sidebar/settings-sidebar/index.js +43 -13
  42. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  43. package/build-module/deprecated.js +116 -0
  44. package/build-module/deprecated.js.map +1 -0
  45. package/build-module/index.js +2 -15
  46. package/build-module/index.js.map +1 -1
  47. package/build-style/style-rtl.css +6 -141
  48. package/build-style/style.css +6 -141
  49. package/package.json +31 -31
  50. package/src/components/header/index.js +24 -69
  51. package/src/components/header/more-menu/index.js +27 -42
  52. package/src/components/header/more-menu/manage-patterns-menu-item.js +33 -0
  53. package/src/components/header/style.scss +0 -79
  54. package/src/components/keyboard-shortcuts/index.js +1 -106
  55. package/src/components/layout/index.js +12 -6
  56. package/src/components/layout/style.scss +7 -80
  57. package/src/components/preferences-modal/index.js +2 -22
  58. package/src/components/sidebar/post-status/index.js +57 -17
  59. package/src/components/sidebar/settings-sidebar/index.js +60 -24
  60. package/src/deprecated.js +107 -0
  61. package/src/index.js +3 -24
  62. package/build/components/header/post-publish-button-or-toggle.js +0 -94
  63. package/build/components/header/post-publish-button-or-toggle.js.map +0 -1
  64. package/build/components/header/preferences-menu-item/index.js +0 -39
  65. package/build/components/header/preferences-menu-item/index.js.map +0 -1
  66. package/build/components/header/tools-more-menu-group/index.js +0 -26
  67. package/build/components/header/tools-more-menu-group/index.js.map +0 -1
  68. package/build/components/header/writing-menu/index.js +0 -71
  69. package/build/components/header/writing-menu/index.js.map +0 -1
  70. package/build/components/layout/actions-panel.js +0 -86
  71. package/build/components/layout/actions-panel.js.map +0 -1
  72. package/build/components/preferences-modal/enable-publish-sidebar.js +0 -38
  73. package/build/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
  74. package/build/components/sidebar/plugin-post-publish-panel/index.js +0 -39
  75. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
  76. package/build/components/sidebar/plugin-pre-publish-panel/index.js +0 -43
  77. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
  78. package/build/plugins/copy-content-menu-item/index.js +0 -39
  79. package/build/plugins/copy-content-menu-item/index.js.map +0 -1
  80. package/build/plugins/index.js +0 -69
  81. package/build/plugins/index.js.map +0 -1
  82. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -44
  83. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
  84. package/build/plugins/welcome-guide-menu-item/index.js.map +0 -1
  85. package/build-module/components/header/post-publish-button-or-toggle.js +0 -86
  86. package/build-module/components/header/post-publish-button-or-toggle.js.map +0 -1
  87. package/build-module/components/header/preferences-menu-item/index.js +0 -32
  88. package/build-module/components/header/preferences-menu-item/index.js.map +0 -1
  89. package/build-module/components/header/tools-more-menu-group/index.js +0 -19
  90. package/build-module/components/header/tools-more-menu-group/index.js.map +0 -1
  91. package/build-module/components/header/writing-menu/index.js +0 -64
  92. package/build-module/components/header/writing-menu/index.js.map +0 -1
  93. package/build-module/components/layout/actions-panel.js +0 -78
  94. package/build-module/components/layout/actions-panel.js.map +0 -1
  95. package/build-module/components/preferences-modal/enable-publish-sidebar.js +0 -31
  96. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
  97. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +0 -32
  98. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
  99. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +0 -36
  100. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
  101. package/build-module/plugins/copy-content-menu-item/index.js +0 -32
  102. package/build-module/plugins/copy-content-menu-item/index.js.map +0 -1
  103. package/build-module/plugins/index.js +0 -65
  104. package/build-module/plugins/index.js.map +0 -1
  105. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
  106. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
  107. package/build-module/plugins/welcome-guide-menu-item/index.js.map +0 -1
  108. package/src/components/header/post-publish-button-or-toggle.js +0 -97
  109. package/src/components/header/preferences-menu-item/index.js +0 -31
  110. package/src/components/header/test/index.js +0 -63
  111. package/src/components/header/tools-more-menu-group/index.js +0 -20
  112. package/src/components/header/writing-menu/index.js +0 -73
  113. package/src/components/layout/actions-panel.js +0 -103
  114. package/src/components/preferences-modal/enable-publish-sidebar.js +0 -32
  115. package/src/components/preferences-modal/test/index.js +0 -28
  116. package/src/components/sidebar/plugin-post-publish-panel/index.js +0 -28
  117. package/src/components/sidebar/plugin-pre-publish-panel/index.js +0 -32
  118. package/src/plugins/copy-content-menu-item/index.js +0 -29
  119. package/src/plugins/index.js +0 -85
  120. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
  121. /package/src/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +0 -0
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.PluginBlockSettingsMenuItem = PluginBlockSettingsMenuItem;
8
+ exports.PluginDocumentSettingPanel = PluginDocumentSettingPanel;
9
+ exports.PluginMoreMenuItem = PluginMoreMenuItem;
10
+ exports.PluginPostPublishPanel = PluginPostPublishPanel;
11
+ exports.PluginPostStatusInfo = PluginPostStatusInfo;
12
+ exports.PluginPrePublishPanel = PluginPrePublishPanel;
13
+ exports.PluginSidebar = PluginSidebar;
14
+ exports.PluginSidebarMoreMenuItem = PluginSidebarMoreMenuItem;
15
+ exports.__experimentalPluginPostExcerpt = __experimentalPluginPostExcerpt;
16
+ var _react = require("react");
17
+ var _editor = require("@wordpress/editor");
18
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
19
+ var _lockUnlock = require("./lock-unlock");
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+
28
+ const {
29
+ PluginPostExcerpt
30
+ } = (0, _lockUnlock.unlock)(_editor.privateApis);
31
+ const deprecateSlot = name => {
32
+ (0, _deprecated.default)(`wp.editPost.${name}`, {
33
+ since: '6.6',
34
+ alternative: `wp.editor.${name}`
35
+ });
36
+ };
37
+
38
+ /* eslint-disable jsdoc/require-param */
39
+ /**
40
+ * @see PluginBlockSettingsMenuItem in @wordpress/editor package.
41
+ */
42
+ function PluginBlockSettingsMenuItem(props) {
43
+ deprecateSlot('PluginBlockSettingsMenuItem');
44
+ return (0, _react.createElement)(_editor.PluginBlockSettingsMenuItem, {
45
+ ...props
46
+ });
47
+ }
48
+
49
+ /**
50
+ * @see PluginDocumentSettingPanel in @wordpress/editor package.
51
+ */
52
+ function PluginDocumentSettingPanel(props) {
53
+ deprecateSlot('PluginDocumentSettingPanel');
54
+ return (0, _react.createElement)(_editor.PluginDocumentSettingPanel, {
55
+ ...props
56
+ });
57
+ }
58
+
59
+ /**
60
+ * @see PluginMoreMenuItem in @wordpress/editor package.
61
+ */
62
+ function PluginMoreMenuItem(props) {
63
+ deprecateSlot('PluginMoreMenuItem');
64
+ return (0, _react.createElement)(_editor.PluginMoreMenuItem, {
65
+ ...props
66
+ });
67
+ }
68
+
69
+ /**
70
+ * @see PluginPrePublishPanel in @wordpress/editor package.
71
+ */
72
+ function PluginPrePublishPanel(props) {
73
+ deprecateSlot('PluginPrePublishPanel');
74
+ return (0, _react.createElement)(_editor.PluginPrePublishPanel, {
75
+ ...props
76
+ });
77
+ }
78
+
79
+ /**
80
+ * @see PluginPostPublishPanel in @wordpress/editor package.
81
+ */
82
+ function PluginPostPublishPanel(props) {
83
+ deprecateSlot('PluginPostPublishPanel');
84
+ return (0, _react.createElement)(_editor.PluginPostPublishPanel, {
85
+ ...props
86
+ });
87
+ }
88
+
89
+ /**
90
+ * @see PluginPostStatusInfo in @wordpress/editor package.
91
+ */
92
+ function PluginPostStatusInfo(props) {
93
+ deprecateSlot('PluginPostStatusInfo');
94
+ return (0, _react.createElement)(_editor.PluginPostStatusInfo, {
95
+ ...props
96
+ });
97
+ }
98
+
99
+ /**
100
+ * @see PluginSidebar in @wordpress/editor package.
101
+ */
102
+ function PluginSidebar(props) {
103
+ deprecateSlot('PluginSidebar');
104
+ return (0, _react.createElement)(_editor.PluginSidebar, {
105
+ ...props
106
+ });
107
+ }
108
+
109
+ /**
110
+ * @see PluginSidebarMoreMenuItem in @wordpress/editor package.
111
+ */
112
+ function PluginSidebarMoreMenuItem(props) {
113
+ deprecateSlot('PluginSidebarMoreMenuItem');
114
+ return (0, _react.createElement)(_editor.PluginSidebarMoreMenuItem, {
115
+ ...props
116
+ });
117
+ }
118
+
119
+ /**
120
+ * @see PluginPostExcerpt in @wordpress/editor package.
121
+ */
122
+ function __experimentalPluginPostExcerpt() {
123
+ (0, _deprecated.default)('wp.editPost.__experimentalPluginPostExcerpt', {
124
+ since: '6.6',
125
+ hint: 'Core and custom panels can be access programmatically using their panel name.',
126
+ link: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically'
127
+ });
128
+ return PluginPostExcerpt;
129
+ }
130
+
131
+ /* eslint-enable jsdoc/require-param */
132
+ //# sourceMappingURL=deprecated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_editor","require","_deprecated","_interopRequireDefault","_lockUnlock","PluginPostExcerpt","unlock","editorPrivateApis","deprecateSlot","name","deprecated","since","alternative","PluginBlockSettingsMenuItem","props","_react","createElement","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPrePublishPanel","PluginPostPublishPanel","PluginPostStatusInfo","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalPluginPostExcerpt","hint","link"],"sources":["@wordpress/edit-post/src/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as editorPrivateApis,\n\tPluginBlockSettingsMenuItem as EditorPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel as EditorPluginDocumentSettingPanel,\n\tPluginMoreMenuItem as EditorPluginMoreMenuItem,\n\tPluginPrePublishPanel as EditorPluginPrePublishPanel,\n\tPluginPostPublishPanel as EditorPluginPostPublishPanel,\n\tPluginPostStatusInfo as EditorPluginPostStatusInfo,\n\tPluginSidebar as EditorPluginSidebar,\n\tPluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nconst { PluginPostExcerpt } = unlock( editorPrivateApis );\n\nconst deprecateSlot = ( name ) => {\n\tdeprecated( `wp.editPost.${ name }`, {\n\t\tsince: '6.6',\n\t\talternative: `wp.editor.${ name }`,\n\t} );\n};\n\n/* eslint-disable jsdoc/require-param */\n/**\n * @see PluginBlockSettingsMenuItem in @wordpress/editor package.\n */\nexport function PluginBlockSettingsMenuItem( props ) {\n\tdeprecateSlot( 'PluginBlockSettingsMenuItem' );\n\treturn <EditorPluginBlockSettingsMenuItem { ...props } />;\n}\n\n/**\n * @see PluginDocumentSettingPanel in @wordpress/editor package.\n */\nexport function PluginDocumentSettingPanel( props ) {\n\tdeprecateSlot( 'PluginDocumentSettingPanel' );\n\treturn <EditorPluginDocumentSettingPanel { ...props } />;\n}\n\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPrePublishPanel in @wordpress/editor package.\n */\nexport function PluginPrePublishPanel( props ) {\n\tdeprecateSlot( 'PluginPrePublishPanel' );\n\treturn <EditorPluginPrePublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostPublishPanel in @wordpress/editor package.\n */\nexport function PluginPostPublishPanel( props ) {\n\tdeprecateSlot( 'PluginPostPublishPanel' );\n\treturn <EditorPluginPostPublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostStatusInfo in @wordpress/editor package.\n */\nexport function PluginPostStatusInfo( props ) {\n\tdeprecateSlot( 'PluginPostStatusInfo' );\n\treturn <EditorPluginPostStatusInfo { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPostExcerpt in @wordpress/editor package.\n */\nexport function __experimentalPluginPostExcerpt() {\n\tdeprecated( 'wp.editPost.__experimentalPluginPostExcerpt', {\n\t\tsince: '6.6',\n\t\thint: 'Core and custom panels can be access programmatically using their panel name.',\n\t\tlink: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically',\n\t} );\n\treturn PluginPostExcerpt;\n}\n\n/* eslint-enable jsdoc/require-param */\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAWA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAnBA;AACA;AACA;;AAcA;AACA;AACA;;AAEA,MAAM;EAAEI;AAAkB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEzD,MAAMC,aAAa,GAAKC,IAAI,IAAM;EACjC,IAAAC,mBAAU,EAAG,eAAeD,IAAM,EAAC,EAAE;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AA0B;IAAA,GAAMP;EAAK,CAAI,CAAC;AACnD;;AAEA;AACA;AACA;AACO,SAASQ,aAAaA,CAAER,KAAK,EAAG;EACtCN,aAAa,CAAE,eAAgB,CAAC;EAChC,OAAO,IAAAO,MAAA,CAAAC,aAAA,EAAChB,OAAA,CAAAsB,aAAmB;IAAA,GAAMR;EAAK,CAAI,CAAC;AAC5C;;AAEA;AACA;AACA;AACO,SAASS,yBAAyBA,CAAET,KAAK,EAAG;EAClDN,aAAa,CAAE,2BAA4B,CAAC;EAC5C,OAAO,IAAAO,MAAA,CAAAC,aAAA,EAAChB,OAAA,CAAAuB,yBAA+B;IAAA,GAAMT;EAAK,CAAI,CAAC;AACxD;;AAEA;AACA;AACA;AACO,SAASU,+BAA+BA,CAAA,EAAG;EACjD,IAAAd,mBAAU,EAAE,6CAA6C,EAAE;IAC1DC,KAAK,EAAE,KAAK;IACZc,IAAI,EAAE,+EAA+E;IACrFC,IAAI,EAAE;EACP,CAAE,CAAC;EACH,OAAOrB,iBAAiB;AACzB;;AAEA","ignoreList":[]}
package/build/index.js CHANGED
@@ -4,54 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- Object.defineProperty(exports, "PluginBlockSettingsMenuItem", {
8
- enumerable: true,
9
- get: function () {
10
- return _editor.PluginBlockSettingsMenuItem;
11
- }
12
- });
13
- Object.defineProperty(exports, "PluginDocumentSettingPanel", {
14
- enumerable: true,
15
- get: function () {
16
- return _editor.PluginDocumentSettingPanel;
17
- }
18
- });
19
- Object.defineProperty(exports, "PluginMoreMenuItem", {
20
- enumerable: true,
21
- get: function () {
22
- return _editor.PluginMoreMenuItem;
23
- }
24
- });
25
- Object.defineProperty(exports, "PluginPostPublishPanel", {
26
- enumerable: true,
27
- get: function () {
28
- return _pluginPostPublishPanel.default;
29
- }
30
- });
31
- Object.defineProperty(exports, "PluginPostStatusInfo", {
32
- enumerable: true,
33
- get: function () {
34
- return _editor.PluginPostStatusInfo;
35
- }
36
- });
37
- Object.defineProperty(exports, "PluginPrePublishPanel", {
38
- enumerable: true,
39
- get: function () {
40
- return _pluginPrePublishPanel.default;
41
- }
42
- });
43
- Object.defineProperty(exports, "PluginSidebar", {
44
- enumerable: true,
45
- get: function () {
46
- return _editor.PluginSidebar;
47
- }
48
- });
49
- Object.defineProperty(exports, "PluginSidebarMoreMenuItem", {
50
- enumerable: true,
51
- get: function () {
52
- return _editor.PluginSidebarMoreMenuItem;
53
- }
54
- });
7
+ var _exportNames = {
8
+ initializeEditor: true,
9
+ reinitializeEditor: true,
10
+ __experimentalFullscreenModeClose: true,
11
+ __experimentalMainDashboardButton: true,
12
+ store: true
13
+ };
55
14
  Object.defineProperty(exports, "__experimentalFullscreenModeClose", {
56
15
  enumerable: true,
57
16
  get: function () {
@@ -64,7 +23,6 @@ Object.defineProperty(exports, "__experimentalMainDashboardButton", {
64
23
  return _mainDashboardButton.default;
65
24
  }
66
25
  });
67
- exports.__experimentalPluginPostExcerpt = void 0;
68
26
  exports.initializeEditor = initializeEditor;
69
27
  exports.reinitializeEditor = reinitializeEditor;
70
28
  Object.defineProperty(exports, "store", {
@@ -83,14 +41,22 @@ var _preferences = require("@wordpress/preferences");
83
41
  var _widgets = require("@wordpress/widgets");
84
42
  var _editor = require("@wordpress/editor");
85
43
  require("./hooks");
86
- require("./plugins");
87
44
  var _editor2 = _interopRequireDefault(require("./editor"));
88
- var _lockUnlock = require("./lock-unlock");
89
- var _pluginPostPublishPanel = _interopRequireDefault(require("./components/sidebar/plugin-post-publish-panel"));
90
- var _pluginPrePublishPanel = _interopRequireDefault(require("./components/sidebar/plugin-pre-publish-panel"));
91
45
  var _fullscreenModeClose = _interopRequireDefault(require("./components/header/fullscreen-mode-close"));
92
46
  var _mainDashboardButton = _interopRequireDefault(require("./components/header/main-dashboard-button"));
93
47
  var _store = require("./store");
48
+ var _deprecated2 = require("./deprecated");
49
+ Object.keys(_deprecated2).forEach(function (key) {
50
+ if (key === "default" || key === "__esModule") return;
51
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
52
+ if (key in exports && exports[key] === _deprecated2[key]) return;
53
+ Object.defineProperty(exports, key, {
54
+ enumerable: true,
55
+ get: function () {
56
+ return _deprecated2[key];
57
+ }
58
+ });
59
+ });
94
60
  /**
95
61
  * WordPress dependencies
96
62
  */
@@ -99,10 +65,6 @@ var _store = require("./store");
99
65
  * Internal dependencies
100
66
  */
101
67
 
102
- const {
103
- PluginPostExcerpt: __experimentalPluginPostExcerpt
104
- } = (0, _lockUnlock.unlock)(_editor.privateApis);
105
-
106
68
  /**
107
69
  * Initializes and returns an instance of Editor.
108
70
  *
@@ -114,7 +76,6 @@ const {
114
76
  * considered as non-user-initiated (bypass for
115
77
  * unsaved changes prompt).
116
78
  */
117
- exports.__experimentalPluginPostExcerpt = __experimentalPluginPostExcerpt;
118
79
  function initializeEditor(id, postType, postId, settings, initialEdits) {
119
80
  const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches;
120
81
  const target = document.getElementById(id);
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_editor2","_lockUnlock","_pluginPostPublishPanel","_pluginPrePublishPanel","_fullscreenModeClose","_mainDashboardButton","_store","PluginPostExcerpt","__experimentalPluginPostExcerpt","unlock","editorPrivateApis","exports","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","blocksStore","reapplyBlockTypeFilters","select","get","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel,\n\tPluginMoreMenuItem,\n\tPluginPostStatusInfo,\n\tPluginSidebar,\n\tPluginSidebarMoreMenuItem,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { PluginBlockSettingsMenuItem };\nexport { PluginDocumentSettingPanel };\nexport { PluginMoreMenuItem };\nexport { PluginPostStatusInfo };\nexport { PluginSidebar };\nexport { PluginSidebarMoreMenuItem };\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAIA,IAAAQ,OAAA,GAAAR,OAAA;AAcAA,OAAA;AACAA,OAAA;AACA,IAAAS,QAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AA6IA,IAAAW,uBAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,sBAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,oBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,oBAAA,GAAAX,sBAAA,CAAAH,OAAA;AAEA,IAAAe,MAAA,GAAAf,OAAA;AAnLA;AACA;AACA;;AAyBA;AACA;AACA;;AAMA,MAAM;EAAEgB,iBAAiB,EAAEC;AAAgC,CAAC,GAC3D,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE5B;A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AE,CAAE,CAAC;QACxB;MACD;IACD,CAAE,CAAC;EACJ;;EAEA;EACAvD,MAAM,CAACiD,gBAAgB,CAAE,UAAU,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEzD,MAAM,CAACiD,gBAAgB,CAAE,MAAM,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEnD,IAAI,CAACoD,MAAM,CACV,IAAAC,MAAA,CAAAC,aAAA,EAAC/E,QAAA,CAAAgF,OAAM;IACNhE,QAAQ,EAAGA,QAAU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASwD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_editor2","_fullscreenModeClose","_mainDashboardButton","_store","_deprecated2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","blocksStore","reapplyBlockTypeFilters","select","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport Editor from './editor';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\n\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;A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AU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASuD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "react";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -7,33 +7,29 @@ import classnames from 'classnames';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import { BlockToolbar, privateApis as blockEditorPrivateApis, store as blockEditorStore } from '@wordpress/block-editor';
11
- import { PostSavedState, PostPreviewButton, store as editorStore, DocumentBar, privateApis as editorPrivateApis } from '@wordpress/editor';
12
- import { useEffect, useRef, useState } from '@wordpress/element';
10
+ import { DocumentBar, PostSavedState, PostPreviewButton, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
13
11
  import { useSelect } from '@wordpress/data';
14
- import { __ } from '@wordpress/i18n';
15
- import { next, previous } from '@wordpress/icons';
16
12
  import { useViewportMatch } from '@wordpress/compose';
17
- import { Button, __unstableMotion as motion, Popover } from '@wordpress/components';
13
+ import { __unstableMotion as motion } from '@wordpress/components';
18
14
  import { store as preferencesStore } from '@wordpress/preferences';
15
+ import { useState } from '@wordpress/element';
19
16
 
20
17
  /**
21
18
  * Internal dependencies
22
19
  */
23
20
  import FullscreenModeClose from './fullscreen-mode-close';
24
- import MoreMenu from './more-menu';
25
- import PostPublishButtonOrToggle from './post-publish-button-or-toggle';
21
+ import PostEditorMoreMenu from './more-menu';
26
22
  import MainDashboardButton from './main-dashboard-button';
27
23
  import { store as editPostStore } from '../../store';
28
24
  import { unlock } from '../../lock-unlock';
29
25
  const {
30
- useShowBlockTools
31
- } = unlock(blockEditorPrivateApis);
32
- const {
26
+ CollapsableBlockToolbar,
33
27
  DocumentTools,
34
28
  PostViewLink,
35
29
  PreviewDropdown,
36
- PinnedItems
30
+ PinnedItems,
31
+ MoreMenu,
32
+ PostPublishButtonOrToggle
37
33
  } = unlock(editorPrivateApis);
38
34
  const slideY = {
39
35
  hidden: {
@@ -71,14 +67,13 @@ function Header({
71
67
  }) {
72
68
  const isWideViewport = useViewportMatch('large');
73
69
  const isLargeViewport = useViewportMatch('medium');
74
- const blockToolbarRef = useRef();
75
70
  const {
76
71
  isTextEditor,
77
- blockSelectionStart,
78
72
  hasActiveMetaboxes,
79
73
  isPublishSidebarOpened,
80
74
  showIconLabels,
81
- hasHistory
75
+ hasHistory,
76
+ hasFixedToolbar
82
77
  } = useSelect(select => {
83
78
  const {
84
79
  get: getPreference
@@ -88,25 +83,15 @@ function Header({
88
83
  } = select(editorStore);
89
84
  return {
90
85
  isTextEditor: getEditorMode() === 'text',
91
- blockSelectionStart: select(blockEditorStore).getBlockSelectionStart(),
92
86
  hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
93
87
  hasHistory: !!select(editorStore).getEditorSettings().onNavigateToPreviousEntityRecord,
94
88
  isPublishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
95
- showIconLabels: getPreference('core', 'showIconLabels')
89
+ showIconLabels: getPreference('core', 'showIconLabels'),
90
+ hasFixedToolbar: getPreference('core', 'fixedToolbar')
96
91
  };
97
92
  }, []);
98
- const {
99
- showFixedToolbar
100
- } = useShowBlockTools();
101
- const showTopToolbar = isLargeViewport && showFixedToolbar;
93
+ const hasTopToolbar = isLargeViewport && hasFixedToolbar;
102
94
  const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = useState(true);
103
- const hasBlockSelection = !!blockSelectionStart;
104
- useEffect(() => {
105
- // If we have a new block selection, show the block tools
106
- if (blockSelectionStart) {
107
- setIsBlockToolsCollapsed(false);
108
- }
109
- }, [blockSelectionStart]);
110
95
  return createElement("div", {
111
96
  className: "edit-post-header"
112
97
  }, createElement(MainDashboardButton.Slot, null, createElement(motion.div, {
@@ -127,26 +112,12 @@ function Header({
127
112
  className: "edit-post-header__toolbar"
128
113
  }, createElement(DocumentTools, {
129
114
  disableBlockTools: isTextEditor
130
- }), showTopToolbar && createElement(Fragment, null, createElement("div", {
131
- className: classnames('selected-block-tools-wrapper', {
132
- 'is-collapsed': isBlockToolsCollapsed || !hasBlockSelection
133
- })
134
- }, createElement(BlockToolbar, {
135
- hideDragHandle: true
136
- })), createElement(Popover.Slot, {
137
- ref: blockToolbarRef,
138
- name: "block-toolbar"
139
- }), createElement(Button, {
140
- className: "edit-post-header__block-tools-toggle",
141
- icon: isBlockToolsCollapsed ? next : previous,
142
- onClick: () => {
143
- setIsBlockToolsCollapsed(collapsed => !collapsed);
144
- },
145
- label: isBlockToolsCollapsed ? __('Show block tools') : __('Hide block tools'),
146
- size: "compact"
147
- })), createElement("div", {
115
+ }), hasTopToolbar && createElement(CollapsableBlockToolbar, {
116
+ isCollapsed: isBlockToolsCollapsed,
117
+ onToggle: setIsBlockToolsCollapsed
118
+ }), createElement("div", {
148
119
  className: classnames('edit-post-header__center', {
149
- 'is-collapsed': hasHistory && !isBlockToolsCollapsed && showTopToolbar
120
+ 'is-collapsed': hasHistory && !isBlockToolsCollapsed && hasTopToolbar
150
121
  })
151
122
  }, hasHistory && createElement(DocumentBar, null))), createElement(motion.div, {
152
123
  variants: slideY,
@@ -173,9 +144,7 @@ function Header({
173
144
  setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
174
145
  }), (isWideViewport || !showIconLabels) && createElement(PinnedItems.Slot, {
175
146
  scope: "core"
176
- }), createElement(MoreMenu, {
177
- showIconLabels: showIconLabels
178
- })));
147
+ }), createElement(MoreMenu, null), createElement(PostEditorMoreMenu, null)));
179
148
  }
180
149
  export default Header;
181
150
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","BlockToolbar","privateApis","blockEditorPrivateApis","store","blockEditorStore","PostSavedState","PostPreviewButton","editorStore","DocumentBar","editorPrivateApis","useEffect","useRef","useState","useSelect","__","next","previous","useViewportMatch","Button","__unstableMotion","motion","Popover","preferencesStore","FullscreenModeClose","MoreMenu","PostPublishButtonOrToggle","MainDashboardButton","editPostStore","unlock","useShowBlockTools","DocumentTools","PostViewLink","PreviewDropdown","PinnedItems","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","initialPost","isWideViewport","isLargeViewport","blockToolbarRef","isTextEditor","blockSelectionStart","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","hasHistory","select","get","getPreference","getEditorMode","getBlockSelectionStart","hasMetaBoxes","getEditorSettings","onNavigateToPreviousEntityRecord","showFixedToolbar","showTopToolbar","isBlockToolsCollapsed","setIsBlockToolsCollapsed","hasBlockSelection","createElement","className","Slot","div","variants","showTooltip","disableBlockTools","Fragment","hideDragHandle","ref","name","icon","onClick","collapsed","label","size","forceIsDirty","forceIsAutosaveable","scope"],"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":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,YAAY,EACZC,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SACCC,cAAc,EACdC,iBAAiB,EACjBH,KAAK,IAAII,WAAW,EACpBC,WAAW,EACXP,WAAW,IAAIQ,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,QAAQ,QAAQ,kBAAkB;AACjD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,MAAM,EACNC,gBAAgB,IAAIC,MAAM,EAC1BC,OAAO,QACD,uBAAuB;AAC9B,SAASlB,KAAK,IAAImB,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD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UAAU,EAAG;MAAEC,IAAI,EAAE,OAAO;MAAEC,KAAK,EAAE;IAAI,CAAG;IAC5C6B,SAAS,EAAC;EAA4B,GAEpC,CAAEjB,sBAAsB;EACzB;EACA;EACA;EACA;EACA;EACAgB,aAAA,CAAChE,cAAc;IAACgF,YAAY,EAAGjC;EAAoB,CAAE,CACrD,EACDiB,aAAA,CAACrC,eAAe;IAACsD,mBAAmB,EAAGlC;EAAoB,CAAE,CAAC,EAC9DiB,aAAA,CAAC/D,iBAAiB;IACjBgE,SAAS,EAAC,uCAAuC;IACjDgB,mBAAmB,EAAGlC;EAAoB,CAC1C,CAAC,EACFiB,aAAA,CAACtC,YAAY,MAAE,CAAC,EAChBsC,aAAA,CAAC5C,yBAAyB;IACzB4D,YAAY,EAAGjC,kBAAoB;IACnCP,8BAA8B,EAC7BA;EACA,CACD,CAAC,EACA,CAAEE,cAAc,IAAI,CAAEO,cAAc,KACrCe,aAAA,CAACpC,WAAW,CAACsC,IAAI;IAACgB,KAAK,EAAC;EAAM,CAAE,CAChC,EACDlB,aAAA,CAAC7C,QAAQ;IAAC8B,cAAc,EAAGA;EAAgB,CAAE,CAClC,CACR,CAAC;AAER;AAEA,eAAeV,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["classnames","DocumentBar","PostSavedState","PostPreviewButton","store","editorStore","privateApis","editorPrivateApis","useSelect","useViewportMatch","__unstableMotion","motion","preferencesStore","useState","FullscreenModeClose","PostEditorMoreMenu","MainDashboardButton","editPostStore","unlock","CollapsableBlockToolbar","DocumentTools","PostViewLink","PreviewDropdown","PinnedItems","MoreMenu","PostPublishButtonOrToggle","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","initialPost","isWideViewport","isLargeViewport","isTextEditor","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","hasHistory","hasFixedToolbar","select","get","getPreference","getEditorMode","hasMetaBoxes","getEditorSettings","onNavigateToPreviousEntityRecord","hasTopToolbar","isBlockToolsCollapsed","setIsBlockToolsCollapsed","createElement","className","Slot","div","variants","showTooltip","disableBlockTools","isCollapsed","onToggle","forceIsDirty","forceIsAutosaveable","scope"],"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\tDocumentBar,\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useState } from '@wordpress/element';\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 {\n\tCollapsableBlockToolbar,\n\tDocumentTools,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPinnedItems,\n\tMoreMenu,\n\tPostPublishButtonOrToggle,\n} = unlock( 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 {\n\t\tisTextEditor,\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t\thasFixedToolbar,\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\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\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\n\tconst hasTopToolbar = isLargeViewport && hasFixedToolbar;\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\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{ hasTopToolbar && (\n\t\t\t\t\t<CollapsableBlockToolbar\n\t\t\t\t\t\tisCollapsed={ isBlockToolsCollapsed }\n\t\t\t\t\t\tonToggle={ setIsBlockToolsCollapsed }\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\thasTopToolbar,\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 />\n\t\t\t\t<PostEditorMoreMenu />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACC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AC7BA;EACA,CACD,CAAC,EACA,CAAEE,cAAc,IAAI,CAAEK,cAAc,KACrCa,aAAA,CAAClC,WAAW,CAACoC,IAAI;IAACS,KAAK,EAAC;EAAM,CAAE,CAChC,EACDX,aAAA,CAACjC,QAAQ,MAAE,CAAC,EACZiC,aAAA,CAAC1C,kBAAkB,MAAE,CACV,CACR,CAAC;AAER;AAEA,eAAeqB,MAAM","ignoreList":[]}
@@ -3,59 +3,33 @@ import { createElement, Fragment } from "react";
3
3
  * WordPress dependencies
4
4
  */
5
5
  import { __ } from '@wordpress/i18n';
6
- import { MenuGroup, DropdownMenu } from '@wordpress/components';
7
6
  import { useViewportMatch } from '@wordpress/compose';
8
7
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
9
- import { moreVertical } from '@wordpress/icons';
8
+ import { PreferenceToggleMenuItem } from '@wordpress/preferences';
9
+ import { displayShortcut } from '@wordpress/keycodes';
10
10
 
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import PreferencesMenuItem from '../preferences-menu-item';
15
- import ToolsMoreMenuGroup from '../tools-more-menu-group';
16
- import WritingMenu from '../writing-menu';
17
14
  import { unlock } from '../../../lock-unlock';
15
+ import ManagePatternsMenuItem from './manage-patterns-menu-item';
16
+ import WelcomeGuideMenuItem from './welcome-guide-menu-item';
17
+ import EditPostPreferencesModal from '../../preferences-modal';
18
18
  const {
19
- ModeSwitcher,
20
- ActionItem,
21
- PinnedItems
19
+ ToolsMoreMenuGroup,
20
+ ViewMoreMenuGroup
22
21
  } = unlock(editorPrivateApis);
23
- const MoreMenu = ({
24
- showIconLabels
25
- }) => {
22
+ const MoreMenu = () => {
26
23
  const isLargeViewport = useViewportMatch('large');
27
- return createElement(DropdownMenu, {
28
- icon: moreVertical,
29
- label: __('Options'),
30
- popoverProps: {
31
- placement: 'bottom-end',
32
- className: 'more-menu-dropdown__content'
33
- },
34
- toggleProps: {
35
- ...(showIconLabels && {
36
- variant: 'tertiary'
37
- }),
38
- tooltipPosition: 'bottom',
39
- showTooltip: !showIconLabels,
40
- size: 'compact'
41
- }
42
- }, ({
43
- onClose
44
- }) => createElement(Fragment, null, showIconLabels && !isLargeViewport && createElement(PinnedItems.Slot, {
45
- className: showIconLabels && 'show-icon-labels',
46
- scope: "core"
47
- }), createElement(WritingMenu, null), createElement(ModeSwitcher, null), createElement(ActionItem.Slot, {
48
- name: "core/plugin-more-menu",
49
- label: __('Plugins'),
50
- as: MenuGroup,
51
- fillProps: {
52
- onClick: onClose
53
- }
54
- }), createElement(ToolsMoreMenuGroup.Slot, {
55
- fillProps: {
56
- onClose
57
- }
58
- }), createElement(MenuGroup, null, createElement(PreferencesMenuItem, null))));
24
+ return createElement(Fragment, null, isLargeViewport && createElement(ViewMoreMenuGroup, null, createElement(PreferenceToggleMenuItem, {
25
+ scope: "core/edit-post",
26
+ name: "fullscreenMode",
27
+ label: __('Fullscreen mode'),
28
+ info: __('Show and hide the admin user interface'),
29
+ messageActivated: __('Fullscreen mode activated'),
30
+ messageDeactivated: __('Fullscreen mode deactivated'),
31
+ shortcut: displayShortcut.secondary('f')
32
+ })), createElement(ToolsMoreMenuGroup, null, createElement(ManagePatternsMenuItem, null), createElement(WelcomeGuideMenuItem, null)), createElement(EditPostPreferencesModal, null));
59
33
  };
60
34
  export default MoreMenu;
61
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","MenuGroup","DropdownMenu","useViewportMatch","privateApis","editorPrivateApis","moreVertical","PreferencesMenuItem","ToolsMoreMenuGroup","WritingMenu","unlock","ModeSwitcher","ActionItem","PinnedItems","MoreMenu","showIconLabels","isLargeViewport","createElement","icon","label","popoverProps","placement","className","toggleProps","variant","tooltipPosition","showTooltip","size","onClose","Fragment","Slot","scope","name","as","fillProps","onClick"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup, DropdownMenu } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { moreVertical } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\nimport { unlock } from '../../../lock-unlock';\n\nconst { ModeSwitcher, ActionItem, PinnedItems } = unlock( editorPrivateApis );\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: 'bottom-end',\n\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\tsize: 'compact',\n\t\t\t} }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t\t<PinnedItems.Slot\n\t\t\t\t\t\t\tclassName={ showIconLabels && 'show-icon-labels' }\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<WritingMenu />\n\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<PreferencesMenuItem />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,CACZ,CACD,EACDd,aAAA,CAACR,WAAW,MAAE,CAAC,EACfQ,aAAA,CAACN,YAAY,MAAE,CAAC,EAChBM,aAAA,CAACL,UAAU,CAACkB,IAAI;IACfE,IAAI,EAAC,uBAAuB;IAC5Bb,KAAK,EAAGnB,EAAE,CAAE,SAAU,CAAG;IACzBiC,EAAE,EAAGhC,SAAW;IAChBiC,SAAS,EAAG;MAAEC,OAAO,EAAEP;IAAQ;EAAG,CAClC,CAAC,EACFX,aAAA,CAACT,kBAAkB,CAACsB,IAAI;IAACI,SAAS,EAAG;MAAEN;IAAQ;EAAG,CAAE,CAAC,EACrDX,aAAA,CAAChB,SAAS,QACTgB,aAAA,CAACV,mBAAmB,MAAE,CACZ,CACV,CAEU,CAAC;AAEjB,CAAC;AAED,eAAeO,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["__","useViewportMatch","privateApis","editorPrivateApis","PreferenceToggleMenuItem","displayShortcut","unlock","ManagePatternsMenuItem","WelcomeGuideMenuItem","EditPostPreferencesModal","ToolsMoreMenuGroup","ViewMoreMenuGroup","MoreMenu","isLargeViewport","createElement","Fragment","scope","name","label","info","messageActivated","messageDeactivated","shortcut","secondary"],"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":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,eAAe,QAAQ,qBAAqB;;AAErD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,wBAAwB,MAAM,yBAAyB;AAE9D,MAAM;EAAEC,kBAAkB;EAAEC;AAAkB,CAAC,GAAGL,MAAM,CAAEH,iBAAkB,CAAC;AAE7E,MAAMS,QAAQ,GAAGA,CAAA,KAAM;EACtB,MAAMC,eAAe,GAAGZ,gBAAgB,CAAE,OAAQ,CAAC;EAEnD,OACCa,aA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