@wordpress/edit-post 8.32.0 → 8.32.1-next.ff1cebbba.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 (184) hide show
  1. package/build/commands/use-commands.js +54 -47
  2. package/build/commands/use-commands.js.map +7 -1
  3. package/build/components/back-button/fullscreen-mode-close.js +127 -118
  4. package/build/components/back-button/fullscreen-mode-close.js.map +7 -1
  5. package/build/components/back-button/index.js +56 -54
  6. package/build/components/back-button/index.js.map +7 -1
  7. package/build/components/browser-url/index.js +45 -44
  8. package/build/components/browser-url/index.js.map +7 -1
  9. package/build/components/editor-initialization/index.js +24 -18
  10. package/build/components/editor-initialization/index.js.map +7 -1
  11. package/build/components/editor-initialization/listener-hooks.js +42 -43
  12. package/build/components/editor-initialization/listener-hooks.js.map +7 -1
  13. package/build/components/init-pattern-modal/index.js +100 -79
  14. package/build/components/init-pattern-modal/index.js.map +7 -1
  15. package/build/components/keyboard-shortcuts/index.js +37 -33
  16. package/build/components/keyboard-shortcuts/index.js.map +7 -1
  17. package/build/components/layout/index.js +447 -467
  18. package/build/components/layout/index.js.map +7 -1
  19. package/build/components/layout/use-padding-appender.js +66 -59
  20. package/build/components/layout/use-padding-appender.js.map +7 -1
  21. package/build/components/layout/use-should-iframe.js +36 -30
  22. package/build/components/layout/use-should-iframe.js.map +7 -1
  23. package/build/components/meta-boxes/index.js +46 -33
  24. package/build/components/meta-boxes/index.js.map +7 -1
  25. package/build/components/meta-boxes/meta-box-visibility.js +37 -22
  26. package/build/components/meta-boxes/meta-box-visibility.js.map +7 -1
  27. package/build/components/meta-boxes/meta-boxes-area/index.js +62 -53
  28. package/build/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
  29. package/build/components/meta-boxes/use-meta-box-initialization.js +37 -32
  30. package/build/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
  31. package/build/components/more-menu/index.js +64 -44
  32. package/build/components/more-menu/index.js.map +7 -1
  33. package/build/components/more-menu/manage-patterns-menu-item.js +39 -37
  34. package/build/components/more-menu/manage-patterns-menu-item.js.map +7 -1
  35. package/build/components/more-menu/welcome-guide-menu-item.js +39 -21
  36. package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
  37. package/build/components/preferences-modal/enable-custom-fields.js +76 -66
  38. package/build/components/preferences-modal/enable-custom-fields.js.map +7 -1
  39. package/build/components/preferences-modal/enable-panel.js +47 -43
  40. package/build/components/preferences-modal/enable-panel.js.map +7 -1
  41. package/build/components/preferences-modal/index.js +51 -39
  42. package/build/components/preferences-modal/index.js.map +7 -1
  43. package/build/components/preferences-modal/meta-boxes-section.js +65 -52
  44. package/build/components/preferences-modal/meta-boxes-section.js.map +7 -1
  45. package/build/components/welcome-guide/default.js +134 -97
  46. package/build/components/welcome-guide/default.js.map +7 -1
  47. package/build/components/welcome-guide/image.js +34 -23
  48. package/build/components/welcome-guide/image.js.map +7 -1
  49. package/build/components/welcome-guide/index.js +51 -38
  50. package/build/components/welcome-guide/index.js.map +7 -1
  51. package/build/components/welcome-guide/template.js +65 -45
  52. package/build/components/welcome-guide/template.js.map +7 -1
  53. package/build/deprecated.js +84 -110
  54. package/build/deprecated.js.map +7 -1
  55. package/build/hooks/use-navigate-to-entity-record.js +60 -78
  56. package/build/hooks/use-navigate-to-entity-record.js.map +7 -1
  57. package/build/index.js +101 -136
  58. package/build/index.js.map +7 -1
  59. package/build/lock-unlock.js +31 -15
  60. package/build/lock-unlock.js.map +7 -1
  61. package/build/store/actions.js +239 -431
  62. package/build/store/actions.js.map +7 -1
  63. package/build/store/constants.js +33 -26
  64. package/build/store/constants.js.map +7 -1
  65. package/build/store/index.js +44 -32
  66. package/build/store/index.js.map +7 -1
  67. package/build/store/reducer.js +50 -57
  68. package/build/store/reducer.js.map +7 -1
  69. package/build/store/selectors.js +288 -459
  70. package/build/store/selectors.js.map +7 -1
  71. package/build/utils/meta-boxes.js +31 -19
  72. package/build/utils/meta-boxes.js.map +7 -1
  73. package/build-module/commands/use-commands.js +35 -40
  74. package/build-module/commands/use-commands.js.map +7 -1
  75. package/build-module/components/back-button/fullscreen-mode-close.js +102 -110
  76. package/build-module/components/back-button/fullscreen-mode-close.js.map +7 -1
  77. package/build-module/components/back-button/index.js +28 -47
  78. package/build-module/components/back-button/index.js.map +7 -1
  79. package/build-module/components/browser-url/index.js +23 -38
  80. package/build-module/components/browser-url/index.js.map +7 -1
  81. package/build-module/components/editor-initialization/index.js +6 -13
  82. package/build-module/components/editor-initialization/index.js.map +7 -1
  83. package/build-module/components/editor-initialization/listener-hooks.js +20 -34
  84. package/build-module/components/editor-initialization/listener-hooks.js.map +7 -1
  85. package/build-module/components/init-pattern-modal/index.js +90 -74
  86. package/build-module/components/init-pattern-modal/index.js.map +7 -1
  87. package/build-module/components/keyboard-shortcuts/index.js +21 -26
  88. package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
  89. package/build-module/components/layout/index.js +439 -448
  90. package/build-module/components/layout/index.js.map +7 -1
  91. package/build-module/components/layout/use-padding-appender.js +44 -54
  92. package/build-module/components/layout/use-padding-appender.js.map +7 -1
  93. package/build-module/components/layout/use-should-iframe.js +15 -25
  94. package/build-module/components/layout/use-should-iframe.js.map +7 -1
  95. package/build-module/components/meta-boxes/index.js +18 -26
  96. package/build-module/components/meta-boxes/index.js.map +7 -1
  97. package/build-module/components/meta-boxes/meta-box-visibility.js +18 -15
  98. package/build-module/components/meta-boxes/meta-box-visibility.js.map +7 -1
  99. package/build-module/components/meta-boxes/meta-boxes-area/index.js +30 -44
  100. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
  101. package/build-module/components/meta-boxes/use-meta-box-initialization.js +14 -25
  102. package/build-module/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
  103. package/build-module/components/more-menu/index.js +36 -37
  104. package/build-module/components/more-menu/index.js.map +7 -1
  105. package/build-module/components/more-menu/manage-patterns-menu-item.js +21 -31
  106. package/build-module/components/more-menu/manage-patterns-menu-item.js.map +7 -1
  107. package/build-module/components/more-menu/welcome-guide-menu-item.js +22 -16
  108. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
  109. package/build-module/components/preferences-modal/enable-custom-fields.js +51 -56
  110. package/build-module/components/preferences-modal/enable-custom-fields.js.map +7 -1
  111. package/build-module/components/preferences-modal/enable-panel.js +30 -38
  112. package/build-module/components/preferences-modal/enable-panel.js.map +7 -1
  113. package/build-module/components/preferences-modal/index.js +24 -34
  114. package/build-module/components/preferences-modal/index.js.map +7 -1
  115. package/build-module/components/preferences-modal/meta-boxes-section.js +34 -45
  116. package/build-module/components/preferences-modal/meta-boxes-section.js.map +7 -1
  117. package/build-module/components/welcome-guide/default.js +107 -91
  118. package/build-module/components/welcome-guide/default.js.map +7 -1
  119. package/build-module/components/welcome-guide/image.js +16 -18
  120. package/build-module/components/welcome-guide/image.js.map +7 -1
  121. package/build-module/components/welcome-guide/index.js +23 -31
  122. package/build-module/components/welcome-guide/index.js.map +7 -1
  123. package/build-module/components/welcome-guide/template.js +38 -39
  124. package/build-module/components/welcome-guide/template.js.map +7 -1
  125. package/build-module/deprecated.js +62 -103
  126. package/build-module/deprecated.js.map +7 -1
  127. package/build-module/hooks/use-navigate-to-entity-record.js +42 -73
  128. package/build-module/hooks/use-navigate-to-entity-record.js.map +7 -1
  129. package/build-module/index.js +70 -95
  130. package/build-module/index.js.map +7 -1
  131. package/build-module/lock-unlock.js +8 -7
  132. package/build-module/lock-unlock.js.map +7 -1
  133. package/build-module/store/actions.js +158 -368
  134. package/build-module/store/actions.js.map +7 -1
  135. package/build-module/store/constants.js +9 -21
  136. package/build-module/store/constants.js.map +7 -1
  137. package/build-module/store/index.js +10 -22
  138. package/build-module/store/index.js.map +7 -1
  139. package/build-module/store/reducer.js +28 -51
  140. package/build-module/store/reducer.js.map +7 -1
  141. package/build-module/store/selectors.js +232 -442
  142. package/build-module/store/selectors.js.map +7 -1
  143. package/build-module/utils/meta-boxes.js +9 -13
  144. package/build-module/utils/meta-boxes.js.map +7 -1
  145. package/build-style/classic-rtl.css +0 -154
  146. package/build-style/classic.css +0 -154
  147. package/build-style/style-rtl.css +135 -110
  148. package/build-style/style.css +135 -110
  149. package/package.json +39 -31
  150. package/src/classic.scss +3 -0
  151. package/src/components/back-button/style.scss +3 -0
  152. package/src/components/layout/index.js +3 -2
  153. package/src/components/layout/style.scss +4 -0
  154. package/src/components/meta-boxes/meta-boxes-area/style.scss +3 -0
  155. package/src/components/welcome-guide/style.scss +3 -0
  156. package/src/style.scss +8 -4
  157. package/build/components/header/header-toolbar/index.native.js +0 -204
  158. package/build/components/header/header-toolbar/index.native.js.map +0 -1
  159. package/build/components/header/index.native.js +0 -59
  160. package/build/components/header/index.native.js.map +0 -1
  161. package/build/components/layout/index.native.js +0 -166
  162. package/build/components/layout/index.native.js.map +0 -1
  163. package/build/components/visual-editor/header.native.js +0 -63
  164. package/build/components/visual-editor/header.native.js.map +0 -1
  165. package/build/components/visual-editor/index.native.js +0 -44
  166. package/build/components/visual-editor/index.native.js.map +0 -1
  167. package/build/editor.native.js +0 -157
  168. package/build/editor.native.js.map +0 -1
  169. package/build/index.native.js +0 -58
  170. package/build/index.native.js.map +0 -1
  171. package/build-module/components/header/header-toolbar/index.native.js +0 -196
  172. package/build-module/components/header/header-toolbar/index.native.js.map +0 -1
  173. package/build-module/components/header/index.native.js +0 -50
  174. package/build-module/components/header/index.native.js.map +0 -1
  175. package/build-module/components/layout/index.native.js +0 -158
  176. package/build-module/components/layout/index.native.js.map +0 -1
  177. package/build-module/components/visual-editor/header.native.js +0 -56
  178. package/build-module/components/visual-editor/header.native.js.map +0 -1
  179. package/build-module/components/visual-editor/index.native.js +0 -35
  180. package/build-module/components/visual-editor/index.native.js.map +0 -1
  181. package/build-module/editor.native.js +0 -149
  182. package/build-module/editor.native.js.map +0 -1
  183. package/build-module/index.native.js +0 -45
  184. package/build-module/index.native.js.map +0 -1
@@ -1 +1,7 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_image","_interopRequireDefault","_store","_jsxRuntime","WelcomeGuideTemplate","toggleFeature","useDispatch","editPostStore","jsx","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","default","nonAnimatedSrc","animatedSrc","content","jsxs","Fragment","children"],"sources":["@wordpress/edit-post/src/components/welcome-guide/template.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-template-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the template editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuideTemplate' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the template editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\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["../../../src/components/welcome-guide/template.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-template-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the template editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuideTemplate' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the template editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBM;AAtBN,kBAA4B;AAC5B,wBAAsB;AACtB,kBAAmB;AAKnB,mBAA8B;AAC9B,mBAAuC;AAExB,SAAR,uBAAwC;AAC9C,QAAM,EAAE,cAAc,QAAI,yBAAa,aAAAA,KAAc;AAErD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,kBAAe,gBAAI,gCAAiC;AAAA,MACpD,sBAAmB,gBAAI,aAAc;AAAA,MACrC,UAAW,MAAM,cAAe,sBAAuB;AAAA,MACvD,OAAQ;AAAA,QACP;AAAA,UACC,OACC;AAAA,YAAC,aAAAC;AAAA,YAAA;AAAA,cACA,gBAAe;AAAA,cACf,aAAY;AAAA;AAAA,UACb;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,8BAAI,gCAAiC,GACxC;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,cACD;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
6
+ "names": ["editPostStore", "WelcomeGuideImage"]
7
+ }
@@ -1,161 +1,135 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var deprecated_exports = {};
29
+ __export(deprecated_exports, {
30
+ PluginBlockSettingsMenuItem: () => PluginBlockSettingsMenuItem,
31
+ PluginDocumentSettingPanel: () => PluginDocumentSettingPanel,
32
+ PluginMoreMenuItem: () => PluginMoreMenuItem,
33
+ PluginPostPublishPanel: () => PluginPostPublishPanel,
34
+ PluginPostStatusInfo: () => PluginPostStatusInfo,
35
+ PluginPrePublishPanel: () => PluginPrePublishPanel,
36
+ PluginSidebar: () => PluginSidebar,
37
+ PluginSidebarMoreMenuItem: () => PluginSidebarMoreMenuItem,
38
+ __experimentalPluginPostExcerpt: () => __experimentalPluginPostExcerpt
6
39
  });
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 _editor = require("@wordpress/editor");
17
- var _url = require("@wordpress/url");
18
- var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
19
- var _lockUnlock = require("./lock-unlock");
20
- var _jsxRuntime = require("react/jsx-runtime");
21
- /**
22
- * WordPress dependencies
23
- */
24
-
25
- /**
26
- * Internal dependencies
27
- */
28
-
29
- const {
30
- PluginPostExcerpt
31
- } = (0, _lockUnlock.unlock)(_editor.privateApis);
32
- const isSiteEditor = (0, _url.getPath)(window.location.href)?.includes('site-editor.php');
33
- const deprecateSlot = name => {
34
- (0, _deprecated.default)(`wp.editPost.${name}`, {
35
- since: '6.6',
40
+ module.exports = __toCommonJS(deprecated_exports);
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ var import_editor = require("@wordpress/editor");
43
+ var import_url = require("@wordpress/url");
44
+ var import_deprecated = __toESM(require("@wordpress/deprecated"));
45
+ var import_lock_unlock = require("./lock-unlock");
46
+ const { PluginPostExcerpt } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
47
+ const isSiteEditor = (0, import_url.getPath)(window.location.href)?.includes(
48
+ "site-editor.php"
49
+ );
50
+ const deprecateSlot = (name) => {
51
+ (0, import_deprecated.default)(`wp.editPost.${name}`, {
52
+ since: "6.6",
36
53
  alternative: `wp.editor.${name}`
37
54
  });
38
55
  };
39
-
40
- /* eslint-disable jsdoc/require-param */
41
- /**
42
- * @see PluginBlockSettingsMenuItem in @wordpress/editor package.
43
- */
44
56
  function PluginBlockSettingsMenuItem(props) {
45
57
  if (isSiteEditor) {
46
58
  return null;
47
59
  }
48
- deprecateSlot('PluginBlockSettingsMenuItem');
49
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginBlockSettingsMenuItem, {
50
- ...props
51
- });
60
+ deprecateSlot("PluginBlockSettingsMenuItem");
61
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginBlockSettingsMenuItem, { ...props });
52
62
  }
53
-
54
- /**
55
- * @see PluginDocumentSettingPanel in @wordpress/editor package.
56
- */
57
63
  function PluginDocumentSettingPanel(props) {
58
64
  if (isSiteEditor) {
59
65
  return null;
60
66
  }
61
- deprecateSlot('PluginDocumentSettingPanel');
62
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginDocumentSettingPanel, {
63
- ...props
64
- });
67
+ deprecateSlot("PluginDocumentSettingPanel");
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginDocumentSettingPanel, { ...props });
65
69
  }
66
-
67
- /**
68
- * @see PluginMoreMenuItem in @wordpress/editor package.
69
- */
70
70
  function PluginMoreMenuItem(props) {
71
71
  if (isSiteEditor) {
72
72
  return null;
73
73
  }
74
- deprecateSlot('PluginMoreMenuItem');
75
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginMoreMenuItem, {
76
- ...props
77
- });
74
+ deprecateSlot("PluginMoreMenuItem");
75
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginMoreMenuItem, { ...props });
78
76
  }
79
-
80
- /**
81
- * @see PluginPrePublishPanel in @wordpress/editor package.
82
- */
83
77
  function PluginPrePublishPanel(props) {
84
78
  if (isSiteEditor) {
85
79
  return null;
86
80
  }
87
- deprecateSlot('PluginPrePublishPanel');
88
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginPrePublishPanel, {
89
- ...props
90
- });
81
+ deprecateSlot("PluginPrePublishPanel");
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginPrePublishPanel, { ...props });
91
83
  }
92
-
93
- /**
94
- * @see PluginPostPublishPanel in @wordpress/editor package.
95
- */
96
84
  function PluginPostPublishPanel(props) {
97
85
  if (isSiteEditor) {
98
86
  return null;
99
87
  }
100
- deprecateSlot('PluginPostPublishPanel');
101
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginPostPublishPanel, {
102
- ...props
103
- });
88
+ deprecateSlot("PluginPostPublishPanel");
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginPostPublishPanel, { ...props });
104
90
  }
105
-
106
- /**
107
- * @see PluginPostStatusInfo in @wordpress/editor package.
108
- */
109
91
  function PluginPostStatusInfo(props) {
110
92
  if (isSiteEditor) {
111
93
  return null;
112
94
  }
113
- deprecateSlot('PluginPostStatusInfo');
114
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginPostStatusInfo, {
115
- ...props
116
- });
95
+ deprecateSlot("PluginPostStatusInfo");
96
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginPostStatusInfo, { ...props });
117
97
  }
118
-
119
- /**
120
- * @see PluginSidebar in @wordpress/editor package.
121
- */
122
98
  function PluginSidebar(props) {
123
99
  if (isSiteEditor) {
124
100
  return null;
125
101
  }
126
- deprecateSlot('PluginSidebar');
127
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginSidebar, {
128
- ...props
129
- });
102
+ deprecateSlot("PluginSidebar");
103
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginSidebar, { ...props });
130
104
  }
131
-
132
- /**
133
- * @see PluginSidebarMoreMenuItem in @wordpress/editor package.
134
- */
135
105
  function PluginSidebarMoreMenuItem(props) {
136
106
  if (isSiteEditor) {
137
107
  return null;
138
108
  }
139
- deprecateSlot('PluginSidebarMoreMenuItem');
140
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginSidebarMoreMenuItem, {
141
- ...props
142
- });
109
+ deprecateSlot("PluginSidebarMoreMenuItem");
110
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.PluginSidebarMoreMenuItem, { ...props });
143
111
  }
144
-
145
- /**
146
- * @see PluginPostExcerpt in @wordpress/editor package.
147
- */
148
112
  function __experimentalPluginPostExcerpt() {
149
113
  if (isSiteEditor) {
150
114
  return null;
151
115
  }
152
- (0, _deprecated.default)('wp.editPost.__experimentalPluginPostExcerpt', {
153
- since: '6.6',
154
- hint: 'Core and custom panels can be access programmatically using their panel name.',
155
- link: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically'
116
+ (0, import_deprecated.default)("wp.editPost.__experimentalPluginPostExcerpt", {
117
+ since: "6.6",
118
+ hint: "Core and custom panels can be access programmatically using their panel name.",
119
+ link: "https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically"
156
120
  });
157
121
  return PluginPostExcerpt;
158
122
  }
159
-
160
- /* eslint-enable jsdoc/require-param */
161
- //# sourceMappingURL=deprecated.js.map
123
+ // Annotate the CommonJS export names for ESM import in node:
124
+ 0 && (module.exports = {
125
+ PluginBlockSettingsMenuItem,
126
+ PluginDocumentSettingPanel,
127
+ PluginMoreMenuItem,
128
+ PluginPostPublishPanel,
129
+ PluginPostStatusInfo,
130
+ PluginPrePublishPanel,
131
+ PluginSidebar,
132
+ PluginSidebarMoreMenuItem,
133
+ __experimentalPluginPostExcerpt
134
+ });
135
+ //# sourceMappingURL=deprecated.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_editor","require","_url","_deprecated","_interopRequireDefault","_lockUnlock","_jsxRuntime","PluginPostExcerpt","unlock","editorPrivateApis","isSiteEditor","getPath","window","location","href","includes","deprecateSlot","name","deprecated","since","alternative","PluginBlockSettingsMenuItem","props","jsx","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 { getPath } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nconst { PluginPostExcerpt } = unlock( editorPrivateApis );\n\nconst isSiteEditor = getPath( window.location.href )?.includes(\n\t'site-editor.php'\n);\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\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginBlockSettingsMenuItem' );\n\treturn <EditorPluginBlockSettingsMenuItem { ...props } />;\n}\n\n/**\n * @see PluginDocumentSettingPanel in @wordpress/editor package.\n */\nexport function PluginDocumentSettingPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginDocumentSettingPanel' );\n\treturn <EditorPluginDocumentSettingPanel { ...props } />;\n}\n\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPrePublishPanel in @wordpress/editor package.\n */\nexport function PluginPrePublishPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPrePublishPanel' );\n\treturn <EditorPluginPrePublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostPublishPanel in @wordpress/editor package.\n */\nexport function PluginPostPublishPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPostPublishPanel' );\n\treturn <EditorPluginPostPublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostStatusInfo in @wordpress/editor package.\n */\nexport function PluginPostStatusInfo( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPostStatusInfo' );\n\treturn <EditorPluginPostStatusInfo { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPostExcerpt in @wordpress/editor package.\n */\nexport function __experimentalPluginPostExcerpt() {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\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,IAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAAuC,IAAAK,WAAA,GAAAL,OAAA;AApBvC;AACA;AACA;;AAeA;AACA;AACA;;AAEA,MAAM;EAAEM;AAAkB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mB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AK;IACZa,IAAI,EAAE,+EAA+E;IACrFC,IAAI,EAAE;EACP,CAAE,CAAC;EACH,OAAO1B,iBAAiB;AACzB;;AAEA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/deprecated.js"],
4
+ "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 { getPath } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nconst { PluginPostExcerpt } = unlock( editorPrivateApis );\n\nconst isSiteEditor = getPath( window.location.href )?.includes(\n\t'site-editor.php'\n);\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\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginBlockSettingsMenuItem' );\n\treturn <EditorPluginBlockSettingsMenuItem { ...props } />;\n}\n\n/**\n * @see PluginDocumentSettingPanel in @wordpress/editor package.\n */\nexport function PluginDocumentSettingPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginDocumentSettingPanel' );\n\treturn <EditorPluginDocumentSettingPanel { ...props } />;\n}\n\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPrePublishPanel in @wordpress/editor package.\n */\nexport function PluginPrePublishPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPrePublishPanel' );\n\treturn <EditorPluginPrePublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostPublishPanel in @wordpress/editor package.\n */\nexport function PluginPostPublishPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPostPublishPanel' );\n\treturn <EditorPluginPostPublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostStatusInfo in @wordpress/editor package.\n */\nexport function PluginPostStatusInfo( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPostStatusInfo' );\n\treturn <EditorPluginPostStatusInfo { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPostExcerpt in @wordpress/editor package.\n */\nexport function __experimentalPluginPostExcerpt() {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2CQ;AAxCR,oBAUO;AACP,iBAAwB;AACxB,wBAAuB;AAKvB,yBAAuB;AACvB,MAAM,EAAE,kBAAkB,QAAI,2BAAQ,cAAAA,WAAkB;AAExD,MAAM,mBAAe,oBAAS,OAAO,SAAS,IAAK,GAAG;AAAA,EACrD;AACD;AAEA,MAAM,gBAAgB,CAAE,SAAU;AACjC,wBAAAC,SAAY,eAAgB,IAAK,IAAI;AAAA,IACpC,OAAO;AAAA,IACP,aAAa,aAAc,IAAK;AAAA,EACjC,CAAE;AACH;AAMO,SAAS,4BAA6B,OAAQ;AACpD,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,6BAA8B;AAC7C,SAAO,4CAAC,cAAAC,6BAAA,EAAoC,GAAG,OAAQ;AACxD;AAKO,SAAS,2BAA4B,OAAQ;AACnD,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,4BAA6B;AAC5C,SAAO,4CAAC,cAAAC,4BAAA,EAAmC,GAAG,OAAQ;AACvD;AAKO,SAAS,mBAAoB,OAAQ;AAC3C,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,oBAAqB;AACpC,SAAO,4CAAC,cAAAC,oBAAA,EAA2B,GAAG,OAAQ;AAC/C;AAKO,SAAS,sBAAuB,OAAQ;AAC9C,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,uBAAwB;AACvC,SAAO,4CAAC,cAAAC,uBAAA,EAA8B,GAAG,OAAQ;AAClD;AAKO,SAAS,uBAAwB,OAAQ;AAC/C,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,wBAAyB;AACxC,SAAO,4CAAC,cAAAC,wBAAA,EAA+B,GAAG,OAAQ;AACnD;AAKO,SAAS,qBAAsB,OAAQ;AAC7C,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,sBAAuB;AACtC,SAAO,4CAAC,cAAAC,sBAAA,EAA6B,GAAG,OAAQ;AACjD;AAKO,SAAS,cAAe,OAAQ;AACtC,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,eAAgB;AAC/B,SAAO,4CAAC,cAAAC,eAAA,EAAsB,GAAG,OAAQ;AAC1C;AAKO,SAAS,0BAA2B,OAAQ;AAClD,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,gBAAe,2BAA4B;AAC3C,SAAO,4CAAC,cAAAC,2BAAA,EAAkC,GAAG,OAAQ;AACtD;AAKO,SAAS,kCAAkC;AACjD,MAAK,cAAe;AACnB,WAAO;AAAA,EACR;AACA,wBAAAR,SAAY,+CAA+C;AAAA,IAC1D,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,EACP,CAAE;AACF,SAAO;AACR;",
6
+ "names": ["editorPrivateApis", "deprecated", "EditorPluginBlockSettingsMenuItem", "EditorPluginDocumentSettingPanel", "EditorPluginMoreMenuItem", "EditorPluginPrePublishPanel", "EditorPluginPostPublishPanel", "EditorPluginPostStatusInfo", "EditorPluginSidebar", "EditorPluginSidebarMoreMenuItem"]
7
+ }
@@ -1,82 +1,64 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var use_navigate_to_entity_record_exports = {};
19
+ __export(use_navigate_to_entity_record_exports, {
20
+ default: () => useNavigateToEntityRecord
5
21
  });
6
- exports.default = useNavigateToEntityRecord;
7
- var _element = require("@wordpress/element");
8
- var _data = require("@wordpress/data");
9
- var _editor = require("@wordpress/editor");
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- /**
15
- * A hook that records the 'entity' history in the post editor as a user
16
- * navigates between editing a post and editing the post template or patterns.
17
- *
18
- * Implemented as a stack, so a little similar to the browser history API.
19
- *
20
- * Used to control displaying UI elements like the back button.
21
- *
22
- * @param {number} initialPostId The post id of the post when the editor loaded.
23
- * @param {string} initialPostType The post type of the post when the editor loaded.
24
- * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.
25
- *
26
- * @return {Object} An object containing the `currentPost` variable and
27
- * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.
28
- */
22
+ module.exports = __toCommonJS(use_navigate_to_entity_record_exports);
23
+ var import_element = require("@wordpress/element");
24
+ var import_data = require("@wordpress/data");
25
+ var import_editor = require("@wordpress/editor");
29
26
  function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) {
30
- const [postHistory, dispatch] = (0, _element.useReducer)((historyState, {
31
- type,
32
- post,
33
- previousRenderingMode
34
- }) => {
35
- if (type === 'push') {
36
- return [...historyState, {
37
- post,
38
- previousRenderingMode
39
- }];
40
- }
41
- if (type === 'pop') {
42
- // Try to leave one item in the history.
43
- if (historyState.length > 1) {
44
- return historyState.slice(0, -1);
27
+ const [postHistory, dispatch] = (0, import_element.useReducer)(
28
+ (historyState, { type, post: post2, previousRenderingMode: previousRenderingMode2 }) => {
29
+ if (type === "push") {
30
+ return [...historyState, { post: post2, previousRenderingMode: previousRenderingMode2 }];
45
31
  }
46
- }
47
- return historyState;
48
- }, [{
49
- post: {
50
- postId: initialPostId,
51
- postType: initialPostType
52
- }
53
- }]);
54
- const {
55
- post,
56
- previousRenderingMode
57
- } = postHistory[postHistory.length - 1];
58
- const {
59
- getRenderingMode
60
- } = (0, _data.useSelect)(_editor.store);
61
- const {
62
- setRenderingMode
63
- } = (0, _data.useDispatch)(_editor.store);
64
- const onNavigateToEntityRecord = (0, _element.useCallback)(params => {
65
- dispatch({
66
- type: 'push',
67
- post: {
68
- postId: params.postId,
69
- postType: params.postType
70
- },
71
- // Save the current rendering mode so we can restore it when navigating back.
72
- previousRenderingMode: getRenderingMode()
73
- });
74
- setRenderingMode(defaultRenderingMode);
75
- }, [getRenderingMode, setRenderingMode, defaultRenderingMode]);
76
- const onNavigateToPreviousEntityRecord = (0, _element.useCallback)(() => {
77
- dispatch({
78
- type: 'pop'
79
- });
32
+ if (type === "pop") {
33
+ if (historyState.length > 1) {
34
+ return historyState.slice(0, -1);
35
+ }
36
+ }
37
+ return historyState;
38
+ },
39
+ [
40
+ {
41
+ post: { postId: initialPostId, postType: initialPostType }
42
+ }
43
+ ]
44
+ );
45
+ const { post, previousRenderingMode } = postHistory[postHistory.length - 1];
46
+ const { getRenderingMode } = (0, import_data.useSelect)(import_editor.store);
47
+ const { setRenderingMode } = (0, import_data.useDispatch)(import_editor.store);
48
+ const onNavigateToEntityRecord = (0, import_element.useCallback)(
49
+ (params) => {
50
+ dispatch({
51
+ type: "push",
52
+ post: { postId: params.postId, postType: params.postType },
53
+ // Save the current rendering mode so we can restore it when navigating back.
54
+ previousRenderingMode: getRenderingMode()
55
+ });
56
+ setRenderingMode(defaultRenderingMode);
57
+ },
58
+ [getRenderingMode, setRenderingMode, defaultRenderingMode]
59
+ );
60
+ const onNavigateToPreviousEntityRecord = (0, import_element.useCallback)(() => {
61
+ dispatch({ type: "pop" });
80
62
  if (previousRenderingMode) {
81
63
  setRenderingMode(previousRenderingMode);
82
64
  }
@@ -84,7 +66,7 @@ function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRender
84
66
  return {
85
67
  currentPost: post,
86
68
  onNavigateToEntityRecord,
87
- onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : undefined
69
+ onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : void 0
88
70
  };
89
71
  }
90
- //# sourceMappingURL=use-navigate-to-entity-record.js.map
72
+ //# sourceMappingURL=use-navigate-to-entity-record.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_element","require","_data","_editor","useNavigateToEntityRecord","initialPostId","initialPostType","defaultRenderingMode","postHistory","dispatch","useReducer","historyState","type","post","previousRenderingMode","length","slice","postId","postType","getRenderingMode","useSelect","editorStore","setRenderingMode","useDispatch","onNavigateToEntityRecord","useCallback","params","onNavigateToPreviousEntityRecord","currentPost","undefined"],"sources":["@wordpress/edit-post/src/hooks/use-navigate-to-entity-record.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId The post id of the post when the editor loaded.\n * @param {string} initialPostType The post type of the post when the editor loaded.\n * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.\n *\n * @return {Object} An object containing the `currentPost` variable and\n * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType,\n\tdefaultRenderingMode\n) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post, previousRenderingMode } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, { post, previousRenderingMode } ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Try to leave one item in the history.\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[\n\t\t\t{\n\t\t\t\tpost: { postId: initialPostId, postType: initialPostType },\n\t\t\t},\n\t\t]\n\t);\n\n\tconst { post, previousRenderingMode } =\n\t\tpostHistory[ postHistory.length - 1 ];\n\n\tconst { getRenderingMode } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'push',\n\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t// Save the current rendering mode so we can restore it when navigating back.\n\t\t\t\tpreviousRenderingMode: getRenderingMode(),\n\t\t\t} );\n\t\t\tsetRenderingMode( defaultRenderingMode );\n\t\t},\n\t\t[ getRenderingMode, setRenderingMode, defaultRenderingMode ]\n\t);\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t\tif ( previousRenderingMode ) {\n\t\t\tsetRenderingMode( previousRenderingMode );\n\t\t}\n\t}, [ setRenderingMode, previousRenderingMode ] );\n\n\treturn {\n\t\tcurrentPost: post,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,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,MAAM,CAACR;MAAS,CAAC;MAC1D;MACAJ,qBAAqB,EAAEK,gBAAgB,CAAC;IACzC,CAAE,CAAC;IACHG,gBAAgB,CAAEf,oBAAqB,CAAC;EACzC,CAAC,EACD,CAAEY,gBAAgB,EAAEG,gBAAgB,EAAEf,oBAAoB,CAC3D,CAAC;EAED,MAAMoB,gCAAgC,GAAG,IAAAF,oBAAW,EAAE,MAAM;IAC3DhB,QAAQ,CAAE;MAAEG,IAAI,EAAE;IAAM,CAAE,CAAC;IAC3B,IAAKE,qBAAqB,EAAG;MAC5BQ,gBAAgB,CAAER,qBAAsB,CAAC;IAC1C;EACD,CAAC,EAAE,CAAEQ,gBAAgB,EAAER,qBAAqB,CAAG,CAAC;EAEhD,OAAO;IACNc,WAAW,EAAEf,IAAI;IACjBW,wBAAwB;IACxBG,gCAAgC,EAC/BnB,WAAW,CAACO,MAAM,GAAG,CAAC,GACnBY,gCAAgC,GAChCE;EACL,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/hooks/use-navigate-to-entity-record.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId The post id of the post when the editor loaded.\n * @param {string} initialPostType The post type of the post when the editor loaded.\n * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.\n *\n * @return {Object} An object containing the `currentPost` variable and\n * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType,\n\tdefaultRenderingMode\n) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post, previousRenderingMode } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, { post, previousRenderingMode } ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Try to leave one item in the history.\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[\n\t\t\t{\n\t\t\t\tpost: { postId: initialPostId, postType: initialPostType },\n\t\t\t},\n\t\t]\n\t);\n\n\tconst { post, previousRenderingMode } =\n\t\tpostHistory[ postHistory.length - 1 ];\n\n\tconst { getRenderingMode } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'push',\n\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t// Save the current rendering mode so we can restore it when navigating back.\n\t\t\t\tpreviousRenderingMode: getRenderingMode(),\n\t\t\t} );\n\t\t\tsetRenderingMode( defaultRenderingMode );\n\t\t},\n\t\t[ getRenderingMode, setRenderingMode, defaultRenderingMode ]\n\t);\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t\tif ( previousRenderingMode ) {\n\t\t\tsetRenderingMode( previousRenderingMode );\n\t\t}\n\t}, [ setRenderingMode, previousRenderingMode ] );\n\n\treturn {\n\t\tcurrentPost: post,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAwC;AACxC,kBAAuC;AACvC,oBAAqC;AAiBtB,SAAR,0BACN,eACA,iBACA,sBACC;AACD,QAAM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