@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,33 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { MenuItem } from '@wordpress/components';
6
+ import { store as coreStore } from '@wordpress/core-data';
7
+ import { useSelect } from '@wordpress/data';
8
+ import { __ } from '@wordpress/i18n';
9
+ import { addQueryArgs } from '@wordpress/url';
10
+ function ManagePatternsMenuItem() {
11
+ const url = useSelect(select => {
12
+ const {
13
+ canUser
14
+ } = select(coreStore);
15
+ const defaultUrl = addQueryArgs('edit.php', {
16
+ post_type: 'wp_block'
17
+ });
18
+ const patternsUrl = addQueryArgs('site-editor.php', {
19
+ path: '/patterns'
20
+ });
21
+
22
+ // The site editor and templates both check whether the user has
23
+ // edit_theme_options capabilities. We can leverage that here and not
24
+ // display the manage patterns link if the user can't access it.
25
+ return canUser('read', 'templates') ? patternsUrl : defaultUrl;
26
+ }, []);
27
+ return createElement(MenuItem, {
28
+ role: "menuitem",
29
+ href: url
30
+ }, __('Manage patterns'));
31
+ }
32
+ export default ManagePatternsMenuItem;
33
+ //# sourceMappingURL=manage-patterns-menu-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MenuItem","store","coreStore","useSelect","__","addQueryArgs","ManagePatternsMenuItem","url","select","canUser","defaultUrl","post_type","patternsUrl","path","createElement","role","href"],"sources":["@wordpress/edit-post/src/components/header/more-menu/manage-patterns-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) ? patternsUrl : defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,SAASC,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAGJ,SAAS,CAAIK,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEN,SAAU,CAAC;IACvC,MAAMQ,UAAU,GAAGL,YAAY,CAAE,UAAU,EAAE;MAC5CM,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAGP,YAAY,CAAE,iBAAiB,EAAE;MACpDQ,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAOJ,OAAO,CAAE,MAAM,EAAE,WAAY,CAAC,GAAGG,WAAW,GAAGF,UAAU;EACjE,CAAC,EAAE,EAAG,CAAC;EAEP,OACCI,aAAA,CAACd,QAAQ;IAACe,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGT;EAAK,GACnCH,EAAE,CAAE,iBAAkB,CACf,CAAC;AAEb;AAEA,eAAeE,sBAAsB","ignoreList":[]}
@@ -14,4 +14,4 @@ export default function WelcomeGuideMenuItem() {
14
14
  label: __('Welcome Guide')
15
15
  });
16
16
  }
17
- //# sourceMappingURL=index.js.map
17
+ //# sourceMappingURL=welcome-guide-menu-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","PreferenceToggleMenuItem","__","store","editorStore","WelcomeGuideMenuItem","isEditingTemplate","select","getCurrentPostType","createElement","scope","name","label"],"sources":["@wordpress/edit-post/src/components/header/more-menu/welcome-guide-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,eAAe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAGN,SAAS,CAChCO,MAAM,IACPA,MAAM,CAAEH,WAAY,CAAC,CAACI,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACCC,aAAA,CAACR,wBAAwB;IACxBS,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGL,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEM,KAAK,EAAGV,EAAE,CAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
@@ -2,11 +2,9 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useEffect } from '@wordpress/element';
5
- import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { useDispatch } from '@wordpress/data';
6
6
  import { useShortcut, store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
7
7
  import { __ } from '@wordpress/i18n';
8
- import { store as blockEditorStore } from '@wordpress/block-editor';
9
- import { createBlock } from '@wordpress/blocks';
10
8
 
11
9
  /**
12
10
  * Internal dependencies
@@ -19,36 +17,6 @@ function KeyboardShortcuts() {
19
17
  const {
20
18
  registerShortcut
21
19
  } = useDispatch(keyboardShortcutsStore);
22
- const {
23
- replaceBlocks
24
- } = useDispatch(blockEditorStore);
25
- const {
26
- getBlockName,
27
- getSelectedBlockClientId,
28
- getBlockAttributes
29
- } = useSelect(blockEditorStore);
30
- const handleTextLevelShortcut = (event, level) => {
31
- event.preventDefault();
32
- const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading';
33
- const currentClientId = getSelectedBlockClientId();
34
- if (currentClientId === null) {
35
- return;
36
- }
37
- const blockName = getBlockName(currentClientId);
38
- if (blockName !== 'core/paragraph' && blockName !== 'core/heading') {
39
- return;
40
- }
41
- const attributes = getBlockAttributes(currentClientId);
42
- const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign';
43
- const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
44
- replaceBlocks(currentClientId, createBlock(destinationBlockName, {
45
- level,
46
- content: attributes.content,
47
- ...{
48
- [destinationTextAlign]: attributes[textAlign]
49
- }
50
- }));
51
- };
52
20
  useEffect(() => {
53
21
  registerShortcut({
54
22
  name: 'core/edit-post/toggle-fullscreen',
@@ -59,66 +27,10 @@ function KeyboardShortcuts() {
59
27
  character: 'f'
60
28
  }
61
29
  });
62
- registerShortcut({
63
- name: 'core/edit-post/next-region',
64
- category: 'global',
65
- description: __('Navigate to the next part of the editor.'),
66
- keyCombination: {
67
- modifier: 'ctrl',
68
- character: '`'
69
- },
70
- aliases: [{
71
- modifier: 'access',
72
- character: 'n'
73
- }]
74
- });
75
- registerShortcut({
76
- name: 'core/edit-post/previous-region',
77
- category: 'global',
78
- description: __('Navigate to the previous part of the editor.'),
79
- keyCombination: {
80
- modifier: 'ctrlShift',
81
- character: '`'
82
- },
83
- aliases: [{
84
- modifier: 'access',
85
- character: 'p'
86
- }, {
87
- modifier: 'ctrlShift',
88
- character: '~'
89
- }]
90
- });
91
- registerShortcut({
92
- name: 'core/edit-post/transform-heading-to-paragraph',
93
- category: 'block-library',
94
- description: __('Transform heading to paragraph.'),
95
- keyCombination: {
96
- modifier: 'access',
97
- character: `0`
98
- }
99
- });
100
- [1, 2, 3, 4, 5, 6].forEach(level => {
101
- registerShortcut({
102
- name: `core/edit-post/transform-paragraph-to-heading-${level}`,
103
- category: 'block-library',
104
- description: __('Transform paragraph to heading.'),
105
- keyCombination: {
106
- modifier: 'access',
107
- character: `${level}`
108
- }
109
- });
110
- });
111
30
  }, []);
112
31
  useShortcut('core/edit-post/toggle-fullscreen', () => {
113
32
  toggleFeature('fullscreenMode');
114
33
  });
115
- useShortcut('core/edit-post/transform-heading-to-paragraph', event => handleTextLevelShortcut(event, 0));
116
- [1, 2, 3, 4, 5, 6].forEach(level => {
117
- //the loop is based off on a constant therefore
118
- //the hook will execute the same way every time
119
- //eslint-disable-next-line react-hooks/rules-of-hooks
120
- useShortcut(`core/edit-post/transform-paragraph-to-heading-${level}`, event => handleTextLevelShortcut(event, level));
121
- });
122
34
  return null;
123
35
  }
124
36
  export default KeyboardShortcuts;
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useSelect","useDispatch","useShortcut","store","keyboardShortcutsStore","__","blockEditorStore","createBlock","editPostStore","KeyboardShortcuts","toggleFeature","registerShortcut","replaceBlocks","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","name","category","description","keyCombination","modifier","character","aliases","forEach"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [] );\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFeature( 'fullscreenMode' );\n\t} );\n\n\tuseShortcut( 'core/edit-post/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":"AAAA;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W,EAAExB,EAAE,CAAE,iCAAkC,CAAC;MACpDyB,cAAc,EAAE;QACfC,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAG;MACb;IACD,CAAE,CAAC;IAEH,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACE,OAAO,CAAIhB,KAAK,IAAM;MAC1CP,gBAAgB,CAAE;QACjBgB,IAAI,EAAG,iDAAiDT,KAAO,EAAC;QAChEU,QAAQ,EAAE,eAAe;QACzBC,WAAW,EAAExB,EAAE,CAAE,iCAAkC,CAAC;QACpDyB,cAAc,EAAE;UACfC,QAAQ,EAAE,QAAQ;UAClBC,SAAS,EAAG,GAAGd,KAAO;QACvB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEPhB,WAAW,CAAE,kCAAkC,EAAE,MAAM;IACtDQ,aAAa,CAAE,gBAAiB,CAAC;EAClC,CAAE,CAAC;EAEHR,WAAW,CAAE,+CAA+C,EAAIe,KAAK,IACpED,uBAAuB,CAAEC,KAAK,EAAE,CAAE,CACnC,CAAC;EAED,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACiB,OAAO,CAAIhB,KAAK,IAAM;IAC1C;IACA;IACA;IACAhB,WAAW,CACT,iDAAiDgB,KAAO,EAAC,EACxDD,KAAK,IAAMD,uBAAuB,CAAEC,KAAK,EAAEC,KAAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAEA,eAAeT,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useDispatch","useShortcut","store","keyboardShortcutsStore","__","editPostStore","KeyboardShortcuts","toggleFeature","registerShortcut","name","category","description","keyCombination","modifier","character"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\t}, [] );\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFeature( 'fullscreenMode' );\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASF,KAAK,IAAIG,aAAa,QAAQ,aAAa;AAEpD,SAASC,iBAAiBA,CAAA,EAAG;EAC5B,MAAM;IAAEC;EAAc,CAAC,GAAGP,WAAW,CAAEK,aAAc,CAAC;EACtD,MAAM;IAAEG;EAAiB,CAAC,GAAGR,WAAW,CAAEG,sBAAuB,CAAC;EAElEJ,SAAS,CAAE,MAAM;IAChBS,gBAAgB,CAAE;MACjBC,IAAI,EAAE,kCAAkC;MACxCC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEP,EAAE,CAAE,yBAA0B,CAAC;MAC5CQ,cAAc,EAAE;QACfC,QAAQ,EAAE,WAAW;QACrBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEPb,WAAW,CAAE,kCAAkC,EAAE,MAAM;IACtDM,aAAa,CAAE,gBAAiB,CAAC;EAClC,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAEA,eAAeD,iBAAiB","ignoreList":[]}
@@ -20,6 +20,7 @@ import { store as noticesStore } from '@wordpress/notices';
20
20
  import { store as preferencesStore } from '@wordpress/preferences';
21
21
  import { privateApis as commandsPrivateApis } from '@wordpress/commands';
22
22
  import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';
23
+ import { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';
23
24
 
24
25
  /**
25
26
  * Internal dependencies
@@ -27,14 +28,12 @@ import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands
27
28
  import TextEditor from '../text-editor';
28
29
  import VisualEditor from '../visual-editor';
29
30
  import EditPostKeyboardShortcuts from '../keyboard-shortcuts';
30
- import EditPostPreferencesModal from '../preferences-modal';
31
31
  import InitPatternModal from '../init-pattern-modal';
32
32
  import BrowserURL from '../browser-url';
33
33
  import Header from '../header';
34
34
  import SettingsSidebar from '../sidebar/settings-sidebar';
35
35
  import MetaBoxes from '../meta-boxes';
36
36
  import WelcomeGuide from '../welcome-guide';
37
- import ActionsPanel from './actions-panel';
38
37
  import { store as editPostStore } from '../../store';
39
38
  import { unlock } from '../../lock-unlock';
40
39
  import useCommonCommands from '../../hooks/commands/use-common-commands';
@@ -52,9 +51,13 @@ const {
52
51
  ListViewSidebar,
53
52
  ComplementaryArea,
54
53
  FullscreenMode,
54
+ SavePublishPanels,
55
55
  InterfaceSkeleton,
56
56
  interfaceStore
57
57
  } = unlock(editorPrivateApis);
58
+ const {
59
+ BlockKeyboardShortcuts
60
+ } = unlock(blockLibraryPrivateApis);
58
61
  const interfaceLabels = {
59
62
  /* translators: accessibility text for the editor top bar landmark region. */
60
63
  header: __('Editor top bar'),
@@ -135,7 +138,8 @@ function Layout({
135
138
  showBlockBreadcrumbs,
136
139
  showMetaBoxes,
137
140
  documentLabel,
138
- hasHistory
141
+ hasHistory,
142
+ hasBlockBreadcrumbs
139
143
  } = useSelect(select => {
140
144
  const {
141
145
  get
@@ -155,15 +159,16 @@ function Layout({
155
159
  mode: select(editorStore).getEditorMode(),
156
160
  isRichEditingEnabled: editorSettings.richEditingEnabled,
157
161
  hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
158
- previousShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/edit-post/previous-region'),
159
- nextShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/edit-post/next-region'),
162
+ previousShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/editor/previous-region'),
163
+ nextShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/editor/next-region'),
160
164
  showIconLabels: get('core', 'showIconLabels'),
161
165
  isDistractionFree: get('core', 'distractionFree'),
162
166
  showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
163
167
  // translators: Default label for the Document in the Block Breadcrumb.
164
168
  documentLabel: postTypeLabel || _x('Document', 'noun'),
165
169
  hasBlockSelected: !!select(blockEditorStore).getBlockSelectionStart(),
166
- hasHistory: !!getEditorSettings().onNavigateToPreviousEntityRecord
170
+ hasHistory: !!getEditorSettings().onNavigateToPreviousEntityRecord,
171
+ hasBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs')
167
172
  };
168
173
  }, []);
169
174
 
@@ -204,7 +209,8 @@ function Layout({
204
209
  'is-sidebar-opened': sidebarIsOpened,
205
210
  'has-metaboxes': hasActiveMetaboxes,
206
211
  'is-distraction-free': isDistractionFree && isWideViewport,
207
- 'is-entity-save-view-open': !!entitiesSavedStatesCallback
212
+ 'is-entity-save-view-open': !!entitiesSavedStatesCallback,
213
+ 'has-block-breadcrumbs': hasBlockBreadcrumbs && !isDistractionFree && isWideViewport
208
214
  });
209
215
  const secondarySidebarLabel = isListViewOpened ? __('Document Overview') : __('Block Library');
210
216
  const secondarySidebar = () => {
@@ -227,7 +233,7 @@ function Layout({
227
233
  isActive: isFullscreenActive
228
234
  }), createElement(BrowserURL, {
229
235
  hasHistory: hasHistory
230
- }), createElement(UnsavedChangesWarning, null), createElement(AutosaveMonitor, null), createElement(LocalAutosaveMonitor, null), createElement(EditPostKeyboardShortcuts, null), createElement(EditorKeyboardShortcutsRegister, null), createElement(EditorKeyboardShortcuts, null), createElement(InterfaceSkeleton, {
236
+ }), createElement(UnsavedChangesWarning, null), createElement(AutosaveMonitor, null), createElement(LocalAutosaveMonitor, null), createElement(EditPostKeyboardShortcuts, null), createElement(EditorKeyboardShortcutsRegister, null), createElement(EditorKeyboardShortcuts, null), createElement(BlockKeyboardShortcuts, null), createElement(InterfaceSkeleton, {
231
237
  isDistractionFree: isDistractionFree && isWideViewport,
232
238
  className: className,
233
239
  labels: {
@@ -260,16 +266,17 @@ function Layout({
260
266
  }, createElement(BlockBreadcrumb, {
261
267
  rootLabelText: documentLabel
262
268
  })),
263
- actions: createElement(ActionsPanel, {
269
+ actions: createElement(SavePublishPanels, {
264
270
  closeEntitiesSavedStates: closeEntitiesSavedStates,
265
271
  isEntitiesSavedStatesOpen: entitiesSavedStatesCallback,
266
- setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
272
+ setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
273
+ forceIsDirtyPublishPanel: hasActiveMetaboxes
267
274
  }),
268
275
  shortcuts: {
269
276
  previous: previousShortcut,
270
277
  next: nextShortcut
271
278
  }
272
- }), createElement(EditPostPreferencesModal, null), createElement(WelcomeGuide, null), createElement(InitPatternModal, null), createElement(PluginArea, {
279
+ }), createElement(WelcomeGuide, null), createElement(InitPatternModal, null), createElement(PluginArea, {
273
280
  onError: onPluginAreaError
274
281
  }), !isDistractionFree && createElement(SettingsSidebar, null));
275
282
  }
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","BlockBreadcrumb","BlockToolbar","blockEditorPrivateApis","blockEditorStore","ScrollLock","useViewportMatch","PluginArea","__","_x","sprintf","useState","useEffect","useCallback","useMemo","keyboardShortcutsStore","noticesStore","preferencesStore","commandsPrivateApis","coreCommandsPrivateApis","TextEditor","VisualEditor","EditPostKeyboardShortcuts","EditPostPreferencesModal","InitPatternModal","BrowserURL","Header","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","editPostStore","unlock","useCommonCommands","getLayoutStyles","useCommands","useCommandContext","InserterSidebar","ListViewSidebar","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","interfaceLabels","header","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","select","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","initialPost","isMobileViewport","isHugeViewport","isWideViewport","isLargeViewport","closeGeneralSidebar","createErrorNotice","setIsInserterOpened","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","showMetaBoxes","documentLabel","hasHistory","get","getPostTypeLabel","postTypeLabel","getRenderingMode","getActiveComplementaryArea","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","document","classList","add","remove","className","secondarySidebarLabel","secondarySidebar","createElement","isRightSidebarOpen","onPluginAreaError","name","Fragment","isActive","labels","editorNotices","Slot","scope","notices","content","hideDragHandle","location","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ScrollLock } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useCommonCommands from '../../hooks/commands/use-common-commands';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst {\n\tInserterSidebar,\n\tListViewSidebar,\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tinterfaceStore,\n} = unlock( editorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseCommonCommands();\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst { closeGeneralSidebar } = useDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tshowMetaBoxes,\n\t\tdocumentLabel,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' ) ||\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'post-editor-edit';\n\tuseCommandContext( commandContext );\n\n\tconst styles = useEditorStyles();\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ isHugeViewport, setIsInserterOpened, sidebarIsOpened ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ closeGeneralSidebar, isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'is-distraction-free': isDistractionFree && isWideViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn (\n\t\t\t\t<InserterSidebar\n\t\t\t\t\tcloseGeneralSidebar={ closeGeneralSidebar }\n\t\t\t\t\tisRightSidebarOpen={ sidebarIsOpened }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<EditorKeyboardShortcuts />\n\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core\" />\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && <SettingsSidebar /> }\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";AAAA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A,CAAC5F,YAAY,MAAE,CAAC,EAChB4F,aAAA,CAACjG,gBAAgB,MAAE,CAAC,EACpBiG,aAAA,CAAClH,UAAU;IAACqI,OAAO,EAAGjB;EAAmB,CAAE,CAAC,EAC1C,CAAE/B,iBAAiB,IAAI6B,aAAA,CAAC9F,eAAe,MAAE,CAC1C,CAAC;AAEL;AAEA,eAAe6C,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","BlockBreadcrumb","BlockToolbar","blockEditorPrivateApis","blockEditorStore","ScrollLock","useViewportMatch","PluginArea","__","_x","sprintf","useState","useEffect","useCallback","useMemo","keyboardShortcutsStore","noticesStore","preferencesStore","commandsPrivateApis","coreCommandsPrivateApis","blockLibraryPrivateApis","TextEditor","VisualEditor","EditPostKeyboardShortcuts","InitPatternModal","BrowserURL","Header","SettingsSidebar","MetaBoxes","WelcomeGuide","editPostStore","unlock","useCommonCommands","getLayoutStyles","useCommands","useCommandContext","InserterSidebar","ListViewSidebar","ComplementaryArea","FullscreenMode","SavePublishPanels","InterfaceSkeleton","interfaceStore","BlockKeyboardShortcuts","interfaceLabels","header","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","select","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","initialPost","isMobileViewport","isHugeViewport","isWideViewport","isLargeViewport","closeGeneralSidebar","createErrorNotice","setIsInserterOpened","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","showMetaBoxes","documentLabel","hasHistory","hasBlockBreadcrumbs","get","getPostTypeLabel","postTypeLabel","getRenderingMode","getActiveComplementaryArea","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","document","classList","add","remove","className","secondarySidebarLabel","secondarySidebar","createElement","isRightSidebarOpen","onPluginAreaError","name","Fragment","isActive","labels","editorNotices","Slot","scope","notices","content","hideDragHandle","location","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","shortcuts","previous","next","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ScrollLock } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useCommonCommands from '../../hooks/commands/use-common-commands';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst {\n\tInserterSidebar,\n\tListViewSidebar,\n\tComplementaryArea,\n\tFullscreenMode,\n\tSavePublishPanels,\n\tInterfaceSkeleton,\n\tinterfaceStore,\n} = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseCommonCommands();\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst { closeGeneralSidebar } = useDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tshowMetaBoxes,\n\t\tdocumentLabel,\n\t\thasHistory,\n\t\thasBlockBreadcrumbs,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' ) ||\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\thasBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t};\n\t}, [] );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'post-editor-edit';\n\tuseCommandContext( commandContext );\n\n\tconst styles = useEditorStyles();\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ isHugeViewport, setIsInserterOpened, sidebarIsOpened ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ closeGeneralSidebar, isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'is-distraction-free': isDistractionFree && isWideViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t'has-block-breadcrumbs':\n\t\t\thasBlockBreadcrumbs && ! isDistractionFree && isWideViewport,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn (\n\t\t\t\t<InserterSidebar\n\t\t\t\t\tcloseGeneralSidebar={ closeGeneralSidebar }\n\t\t\t\t\tisRightSidebarOpen={ sidebarIsOpened }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<EditorKeyboardShortcuts />\n\t\t\t<BlockKeyboardShortcuts />\n\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core\" />\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforceIsDirtyPublishPanel={ hasActiveMetaboxes }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && <SettingsSidebar /> }\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,aAAa,EACbC,+BAA+B,EAC/BC,uBAAuB,EACvBC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,eAAe,EACfC,YAAY,EACZL,WAAW,IAAIM,sBAAsB,EACrCR,KAAK,IAAIS,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AAC9E,SAASnB,KAAK,IAA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AY;MAACqC,MAAM,EAAGA;IAAQ,CAAE,CACjC,EACC,CAAEkC,iBAAiB,IAAIE,aAAa,IACrC4B,aAAA;MAAKH,SAAS,EAAC;IAA6B,GAC3CG,aAAA,CAAC/F,SAAS;MAAC4G,QAAQ,EAAC;IAAQ,CAAE,CAAC,EAC/Bb,aAAA,CAAC/F,SAAS;MAAC4G,QAAQ,EAAC;IAAU,CAAE,CAC5B,CACL,EACC7D,gBAAgB,IAAIU,eAAe,IACpCsC,aAAA,CAACtH,UAAU,MAAE,CAEb,CACF;IACD4C,MAAM,EACL,CAAE4C,iBAAiB,IACnB,CAAElB,gBAAgB,IAClBmB,oBAAoB,IACpBV,oBAAoB,IACpBF,IAAI,KAAK,QAAQ,IAChByC,aAAA;MAAKH,SAAS,EAAC;IAA0B,GACxCG,aAAA,CAAC1H,eAAe;MAACwI,aAAa,EAAGzC;IAAe,CAAE,CAC9C,CAEN;IACDhD,OAAO,EACN2E,aAAA,CAACnF,iBAAiB;MACjB0E,wBAAwB,EAAGA,wBAA0B;MACrDwB,yBAAyB,EACxB1B,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACD0B,wBAAwB,EAAGrD;IAAoB,CAC/C,CACD;IACDsD,SAAS,EAAG;MACXC,QAAQ,EAAEtD,gBAAgB;MAC1BuD,IAAI,EAAEtD;IACP;EAAG,CACH,CAAC,EACFmC,aAAA,CAAC9F,YAAY,MAAE,CAAC,EAChB8F,aAAA,CAACnG,gBAAgB,MAAE,CAAC,EACpBmG,aAAA,CAACpH,UAAU;IAACwI,OAAO,EAAGlB;EAAmB,CAAE,CAAC,EAC1C,CAAEhC,iBAAiB,IAAI8B,aAAA,CAAChG,eAAe,MAAE,CAC1C,CAAC;AAEL;AAEA,eAAe8C,MAAM","ignoreList":[]}
@@ -1,10 +1,9 @@
1
- import { createElement, Fragment } from "react";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
5
 
6
6
  import { __ } from '@wordpress/i18n';
7
- import { useViewportMatch } from '@wordpress/compose';
8
7
  import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
9
8
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
10
9
 
@@ -13,25 +12,17 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
13
12
  */
14
13
  import { unlock } from '../../lock-unlock';
15
14
  import MetaBoxesSection from './meta-boxes-section';
16
- import EnablePublishSidebarOption from './enable-publish-sidebar';
17
15
  const {
18
- PreferencesModalSection,
19
16
  PreferenceToggleControl
20
17
  } = unlock(preferencesPrivateApis);
21
18
  const {
22
19
  PreferencesModal
23
20
  } = unlock(editorPrivateApis);
24
21
  export default function EditPostPreferencesModal() {
25
- const isLargeViewport = useViewportMatch('medium');
26
22
  const extraSections = {
27
- general: createElement(Fragment, null, isLargeViewport && createElement(PreferencesModalSection, {
28
- title: __('Publishing')
29
- }, createElement(EnablePublishSidebarOption, {
30
- help: __('Review settings, such as visibility and tags.'),
31
- label: __('Enable pre-publish checks')
32
- })), createElement(MetaBoxesSection, {
23
+ general: createElement(MetaBoxesSection, {
33
24
  title: __('Advanced')
34
- })),
25
+ }),
35
26
  appearance: createElement(PreferenceToggleControl, {
36
27
  scope: "core/edit-post",
37
28
  featureName: "themeStyles",
@@ -1 +1 @@
1
- {"version":3,"names":["__","useViewportMatch","privateApis","preferencesPrivateApis","editorPrivateApis","unlock","MetaBoxesSection","EnablePublishSidebarOption","PreferencesModalSection","PreferenceToggleControl","PreferencesModal","EditPostPreferencesModal","isLargeViewport","extraSections","general","createElement","Fragment","title","help","label","appearance","scope","featureName"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\n\nconst { PreferencesModalSection, PreferenceToggleControl } = unlock(\n\tpreferencesPrivateApis\n);\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst extraSections = {\n\t\tgeneral: (\n\t\t\t<>\n\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Publishing' ) }>\n\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Enable pre-publish checks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t) }\n\t\t\t\t<MetaBoxesSection title={ __( 'Advanced' ) } />\n\t\t\t</>\n\t\t),\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn <PreferencesModal extraSections={ extraSections } />;\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,OAAOC,0BAA0B,MAAM,0BAA0B;AAEjE,MAAM;EAAEC,uBAAuB;EAAEC;AAAwB,CAAC,GAAGJ,MAAM,CAClEF,sBACD,CAAC;AACD,MAAM;EAAEO;AAAiB,CAAC,GAAGL,MAAM,CAAED,iBAAkB,CAAC;AAExD,eAAe,SAASO,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,eAAe,GAAGX,gBAAgB,CAAE,QAAS,CAAC;EAEpD,MAAMY,aAAa,GAAG;IACrBC,OAAO,EACNC,aAAA,CAAAC,QAAA,QACGJ,eAAe,IAChBG,aAAA,CAACP,uBAAuB;MAACS,KAAK,EAAGjB,EAAE,CAAE,YAAa;IAAG,GACpDe,aAAA,CAACR,0BAA0B;MAC1BW,IAAI,EAAGlB,EAAE,CACR,+CACD,CAAG;MACHmB,KAAK,EAAGnB,EAAE,CAAE,2BAA4B;IAAG,CAC3C,CACuB,CACzB,EACDe,aAAA,CAACT,gBAAgB;MAACW,KAAK,EAAGjB,EAAE,CAAE,UAAW;IAAG,CAAE,CAC7C,CACF;IACDoB,UAAU,EACTL,aAAA,CAACN,uBAAuB;MACvBY,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBJ,IAAI,EAAGlB,EAAE,CAAE,uCAAwC,CAAG;MACtDmB,KAAK,EAAGnB,EAAE,CAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,OAAOe,aAAA,CAACL,gBAAgB;IAACG,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"names":["__","privateApis","preferencesPrivateApis","editorPrivateApis","unlock","MetaBoxesSection","PreferenceToggleControl","PreferencesModal","EditPostPreferencesModal","extraSections","general","createElement","title","appearance","scope","featureName","help","label"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\n\nconst { PreferenceToggleControl } = unlock( preferencesPrivateApis );\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function EditPostPreferencesModal() {\n\tconst extraSections = {\n\t\tgeneral: <MetaBoxesSection title={ __( 'Advanced' ) } />,\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn <PreferencesModal extraSections={ extraSections } />;\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,gBAAgB,MAAM,sBAAsB;AAEnD,MAAM;EAAEC;AAAwB,CAAC,GAAGF,MAAM,CAAEF,sBAAuB,CAAC;AACpE,MAAM;EAAEK;AAAiB,CAAC,GAAGH,MAAM,CAAED,iBAAkB,CAAC;AAExD,eAAe,SAASK,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAG;IACrBC,OAAO,EAAEC,aAAA,CAACN,gBAAgB;MAACO,KAAK,EAAGZ,EAAE,CAAE,UAAW;IAAG,CAAE,CAAC;IACxDa,UAAU,EACTF,aAAA,CAACL,uBAAuB;MACvBQ,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBC,IAAI,EAAGhB,EAAE,CAAE,uCAAwC,CAAG;MACtDiB,KAAK,EAAGjB,EAAE,CAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,OAAOW,aAAA,CAACJ,gBAAgB;IAACE,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
@@ -3,7 +3,7 @@ import { createElement, Fragment } from "react";
3
3
  * WordPress dependencies
4
4
  */
5
5
  import { __ } from '@wordpress/i18n';
6
- import { __experimentalHStack as HStack, PanelBody } from '@wordpress/components';
6
+ import { __experimentalHStack as HStack, __experimentalVStack as VStack, PanelBody } from '@wordpress/components';
7
7
  import { useDispatch, useSelect } from '@wordpress/data';
8
8
  import { PluginPostStatusInfo, PostAuthorPanel, PostSchedulePanel, PostSyncStatus, PostURLPanel, PostTemplatePanel, PostFeaturedImagePanel, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
9
9
 
@@ -16,7 +16,10 @@ import PostSlug from '../post-slug';
16
16
  import PostFormat from '../post-format';
17
17
  import { unlock } from '../../../lock-unlock';
18
18
  const {
19
- PostStatus: PostStatusPanel
19
+ PostStatus: PostStatusPanel,
20
+ PrivatePostExcerptPanel,
21
+ PostContentInformation,
22
+ PostLastEditedPanel
20
23
  } = unlock(editorPrivateApis);
21
24
 
22
25
  /**
@@ -26,17 +29,23 @@ const PANEL_NAME = 'post-status';
26
29
  export default function PostStatus() {
27
30
  const {
28
31
  isOpened,
29
- isRemoved
32
+ isRemoved,
33
+ showPostContentPanels
30
34
  } = useSelect(select => {
31
35
  // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
32
36
  // not use isEditorPanelEnabled since this panel should not be disabled through the UI.
33
37
  const {
34
38
  isEditorPanelRemoved,
35
- isEditorPanelOpened
39
+ isEditorPanelOpened,
40
+ getCurrentPostType
36
41
  } = select(editorStore);
42
+ const postType = getCurrentPostType();
37
43
  return {
38
44
  isRemoved: isEditorPanelRemoved(PANEL_NAME),
39
- isOpened: isEditorPanelOpened(PANEL_NAME)
45
+ isOpened: isEditorPanelOpened(PANEL_NAME),
46
+ // Post excerpt panel is rendered in different place depending on the post type.
47
+ // So we cannot make this check inside the PostExcerpt component based on the current edited entity.
48
+ showPostContentPanels: !['wp_template', 'wp_template_part', 'wp_block'].includes(postType)
40
49
  };
41
50
  }, []);
42
51
  const {
@@ -50,9 +59,23 @@ export default function PostStatus() {
50
59
  title: __('Summary'),
51
60
  opened: isOpened,
52
61
  onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
53
- }, createElement(PluginPostStatusInfo.Slot, null, fills => createElement(Fragment, null, createElement(PostStatusPanel, null), createElement(PostFeaturedImagePanel, {
62
+ }, createElement(PluginPostStatusInfo.Slot, null, fills => createElement(Fragment, null, showPostContentPanels && createElement(VStack, {
63
+ spacing: 3
64
+ // TODO: this needs to be consolidated with the panel in site editor, when we unify them.
65
+ ,
66
+ style: {
67
+ marginBlockEnd: '24px'
68
+ }
69
+ }, createElement(PostFeaturedImagePanel, {
54
70
  withPanelBody: false
55
- }), createElement(PostSchedulePanel, null), createElement(PostTemplatePanel, null), createElement(PostURLPanel, null), createElement(PostSyncStatus, null), createElement(PostSticky, null), createElement(PostFormat, null), createElement(PostSlug, null), createElement(PostAuthorPanel, null), fills, createElement(HStack, {
71
+ }), createElement(PrivatePostExcerptPanel, null), createElement(VStack, {
72
+ spacing: 1
73
+ }, createElement(PostContentInformation, null), createElement(PostLastEditedPanel, null))), createElement(VStack, {
74
+ spacing: 1,
75
+ style: {
76
+ marginBlockEnd: '12px'
77
+ }
78
+ }, createElement(PostStatusPanel, null), createElement(PostSchedulePanel, null), createElement(PostTemplatePanel, null), createElement(PostURLPanel, null), createElement(PostSyncStatus, null)), createElement(PostSticky, null), createElement(PostFormat, null), createElement(PostSlug, null), createElement(PostAuthorPanel, null), fills, createElement(HStack, {
56
79
  style: {
57
80
  marginTop: '16px'
58
81
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__","__experimentalHStack","HStack","PanelBody","useDispatch","useSelect","PluginPostStatusInfo","PostAuthorPanel","PostSchedulePanel","PostSyncStatus","PostURLPanel","PostTemplatePanel","PostFeaturedImagePanel","store","editorStore","privateApis","editorPrivateApis","PostTrash","PostSticky","PostSlug","PostFormat","unlock","PostStatus","PostStatusPanel","PANEL_NAME","isOpened","isRemoved","select","isEditorPanelRemoved","isEditorPanelOpened","toggleEditorPanelOpened","createElement","className","title","opened","onToggle","Slot","fills","Fragment","withPanelBody","style","marginTop"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPluginPostStatusInfo,\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSyncStatus,\n\tPostURLPanel,\n\tPostTemplatePanel,\n\tPostFeaturedImagePanel,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostStatus: PostStatusPanel } = unlock( editorPrivateApis );\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved } = useSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t<PostFeaturedImagePanel withPanelBody={ false } />\n\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,SAAS,QACH,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,oBAAoB,EACpBC,eAAe,EACfC,iBAAiB,EACjBC,cAAc,EACdC,YAAY,EACZC,iBAAiB,EACjBC,sBAAsB,EACtBC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,QAAQ,MAAM,cAAc;AACnC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC,UAAU,EAAEC;AAAgB,CAAC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eAAe,MAAE,CAAC,EACjB8B,KAAK,EACPN,aAAA,CAAC7B,MAAM;IACNsC,KAAK,EAAG;MACPC,SAAS,EAAE;IACZ;EAAG,GAEHV,aAAA,CAACd,SAAS,MAAE,CACL,CACP,CAEuB,CACjB,CAAC;AAEd","ignoreList":[]}
1
+ {"version":3,"names":["__","__experimentalHStack","HStack","__experimentalVStack","VStack","PanelBody","useDispatch","useSelect","PluginPostStatusInfo","PostAuthorPanel","PostSchedulePanel","PostSyncStatus","PostURLPanel","PostTemplatePanel","PostFeaturedImagePanel","store","editorStore","privateApis","editorPrivateApis","PostTrash","PostSticky","PostSlug","PostFormat","unlock","PostStatus","PostStatusPanel","PrivatePostExcerptPanel","PostContentInformation","PostLastEditedPanel","PANEL_NAME","isOpened","isRemoved","showPostContentPanels","select","isEditorPanelRemoved","isEditorPanelOpened","getCurrentPostType","postType","includes","toggleEditorPanelOpened","createElement","className","title","opened","onToggle","Slot","fills","Fragment","spacing","style","marginBlockEnd","withPanelBody","marginTop"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPluginPostStatusInfo,\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSyncStatus,\n\tPostURLPanel,\n\tPostTemplatePanel,\n\tPostFeaturedImagePanel,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport { unlock } from '../../../lock-unlock';\n\nconst {\n\tPostStatus: PostStatusPanel,\n\tPrivatePostExcerptPanel,\n\tPostContentInformation,\n\tPostLastEditedPanel,\n} = unlock( editorPrivateApis );\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved, showPostContentPanels } = useSelect(\n\t\t( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tisEditorPanelOpened,\n\t\t\t\tgetCurrentPostType,\n\t\t\t} = select( editorStore );\n\t\t\tconst postType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\t\t// Post excerpt panel is rendered in different place depending on the post type.\n\t\t\t\t// So we cannot make this check inside the PostExcerpt component based on the current edited entity.\n\t\t\t\tshowPostContentPanels: ! [\n\t\t\t\t\t'wp_template',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t'wp_block',\n\t\t\t\t].includes( postType ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ showPostContentPanels && (\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\t\t\t\t// TODO: this needs to be consolidated with the panel in site editor, when we unify them.\n\t\t\t\t\t\t\t\tstyle={ { marginBlockEnd: '24px' } }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostFeaturedImagePanel\n\t\t\t\t\t\t\t\t\twithPanelBody={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PrivatePostExcerptPanel />\n\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\t\tstyle={ { marginBlockEnd: '12px' } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,SAAS,QACH,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,oBAAoB,EACpBC,eAAe,EACfC,iBAAiB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