@wordpress/editor 14.0.1 → 14.1.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 (247) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +164 -20
  3. package/build/components/document-tools/index.js +12 -3
  4. package/build/components/document-tools/index.js.map +1 -1
  5. package/build/components/editor/index.js +18 -24
  6. package/build/components/editor/index.js.map +1 -1
  7. package/build/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  8. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  9. package/build/components/entities-saved-states/index.js +28 -0
  10. package/build/components/entities-saved-states/index.js.map +1 -1
  11. package/build/components/global-styles-provider/index.js +9 -2
  12. package/build/components/global-styles-provider/index.js.map +1 -1
  13. package/build/components/index.js +7 -0
  14. package/build/components/index.js.map +1 -1
  15. package/build/components/post-actions/actions.js +9 -4
  16. package/build/components/post-actions/actions.js.map +1 -1
  17. package/build/components/post-publish-button/index.js +4 -0
  18. package/build/components/post-publish-button/index.js.map +1 -1
  19. package/build/components/post-publish-button/label.js +5 -0
  20. package/build/components/post-publish-button/label.js.map +1 -1
  21. package/build/components/post-publish-panel/index.js +4 -0
  22. package/build/components/post-publish-panel/index.js.map +1 -1
  23. package/build/components/post-sticky/check.js +8 -0
  24. package/build/components/post-sticky/check.js.map +1 -1
  25. package/build/components/post-sticky/index.js +5 -1
  26. package/build/components/post-sticky/index.js.map +1 -1
  27. package/build/components/post-switch-to-draft-button/index.js +11 -2
  28. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  29. package/build/components/post-sync-status/index.js +5 -1
  30. package/build/components/post-sync-status/index.js.map +1 -1
  31. package/build/components/post-taxonomies/check.js +8 -0
  32. package/build/components/post-taxonomies/check.js.map +1 -1
  33. package/build/components/post-taxonomies/flat-term-selector.js +14 -2
  34. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  35. package/build/components/post-taxonomies/index.js +9 -0
  36. package/build/components/post-taxonomies/index.js.map +1 -1
  37. package/build/components/post-taxonomies/panel.js +10 -0
  38. package/build/components/post-taxonomies/panel.js.map +1 -1
  39. package/build/components/post-title/index.js +4 -8
  40. package/build/components/post-title/index.js.map +1 -1
  41. package/build/components/post-title/post-title-raw.js +3 -7
  42. package/build/components/post-title/post-title-raw.js.map +1 -1
  43. package/build/components/post-trash/check.js +8 -0
  44. package/build/components/post-trash/check.js.map +1 -1
  45. package/build/components/post-trash/index.js +6 -1
  46. package/build/components/post-trash/index.js.map +1 -1
  47. package/build/components/post-visibility/index.js +1 -0
  48. package/build/components/post-visibility/index.js.map +1 -1
  49. package/build/components/provider/index.js +18 -15
  50. package/build/components/provider/index.js.map +1 -1
  51. package/build/components/sidebar/post-summary.js +1 -1
  52. package/build/components/sidebar/post-summary.js.map +1 -1
  53. package/build/components/table-of-contents/index.js +11 -0
  54. package/build/components/table-of-contents/index.js.map +1 -1
  55. package/build/components/template-part-menu-items/convert-to-regular.js +38 -0
  56. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  57. package/build/components/template-part-menu-items/convert-to-template-part.js +77 -0
  58. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  59. package/build/components/template-part-menu-items/index.js +67 -0
  60. package/build/components/template-part-menu-items/index.js.map +1 -0
  61. package/build/components/template-part-menu-items/index.native.js +10 -0
  62. package/build/components/template-part-menu-items/index.native.js.map +1 -0
  63. package/build/components/template-validation-notice/index.js +1 -0
  64. package/build/components/template-validation-notice/index.js.map +1 -1
  65. package/build/components/theme-support-check/index.js +9 -0
  66. package/build/components/theme-support-check/index.js.map +1 -1
  67. package/build/components/time-to-read/index.js +6 -0
  68. package/build/components/time-to-read/index.js.map +1 -1
  69. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -0
  70. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  71. package/build/components/word-count/index.js +5 -1
  72. package/build/components/word-count/index.js.map +1 -1
  73. package/build/dataviews/api.js +61 -0
  74. package/build/dataviews/api.js.map +1 -0
  75. package/build/dataviews/store/private-actions.js +28 -0
  76. package/build/dataviews/store/private-actions.js.map +1 -0
  77. package/build/dataviews/store/private-selectors.js +20 -0
  78. package/build/dataviews/store/private-selectors.js.map +1 -0
  79. package/build/dataviews/store/reducer.js +36 -0
  80. package/build/dataviews/store/reducer.js.map +1 -0
  81. package/build/hooks/pattern-overrides.js +2 -1
  82. package/build/hooks/pattern-overrides.js.map +1 -1
  83. package/build/index.js +12 -0
  84. package/build/index.js.map +1 -1
  85. package/build/private-apis.js +0 -6
  86. package/build/private-apis.js.map +1 -1
  87. package/build/private-apis.native.js +0 -2
  88. package/build/private-apis.native.js.map +1 -1
  89. package/build/store/private-actions.js +21 -0
  90. package/build/store/private-actions.js.map +1 -1
  91. package/build/store/private-selectors.js +5 -0
  92. package/build/store/private-selectors.js.map +1 -1
  93. package/build/store/reducer.js +4 -1
  94. package/build/store/reducer.js.map +1 -1
  95. package/build-module/components/document-tools/index.js +12 -3
  96. package/build-module/components/document-tools/index.js.map +1 -1
  97. package/build-module/components/editor/index.js +19 -24
  98. package/build-module/components/editor/index.js.map +1 -1
  99. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -0
  100. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  101. package/build-module/components/entities-saved-states/index.js +28 -0
  102. package/build-module/components/entities-saved-states/index.js.map +1 -1
  103. package/build-module/components/global-styles-provider/index.js +9 -2
  104. package/build-module/components/global-styles-provider/index.js.map +1 -1
  105. package/build-module/components/index.js +7 -0
  106. package/build-module/components/index.js.map +1 -1
  107. package/build-module/components/post-actions/actions.js +9 -4
  108. package/build-module/components/post-actions/actions.js.map +1 -1
  109. package/build-module/components/post-publish-button/index.js +4 -0
  110. package/build-module/components/post-publish-button/index.js.map +1 -1
  111. package/build-module/components/post-publish-button/label.js +6 -0
  112. package/build-module/components/post-publish-button/label.js.map +1 -1
  113. package/build-module/components/post-publish-panel/index.js +4 -0
  114. package/build-module/components/post-publish-panel/index.js.map +1 -1
  115. package/build-module/components/post-sticky/check.js +9 -0
  116. package/build-module/components/post-sticky/check.js.map +1 -1
  117. package/build-module/components/post-sticky/index.js +6 -0
  118. package/build-module/components/post-sticky/index.js.map +1 -1
  119. package/build-module/components/post-switch-to-draft-button/index.js +10 -1
  120. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  121. package/build-module/components/post-sync-status/index.js +6 -0
  122. package/build-module/components/post-sync-status/index.js.map +1 -1
  123. package/build-module/components/post-taxonomies/check.js +9 -0
  124. package/build-module/components/post-taxonomies/check.js.map +1 -1
  125. package/build-module/components/post-taxonomies/flat-term-selector.js +14 -2
  126. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  127. package/build-module/components/post-taxonomies/index.js +9 -0
  128. package/build-module/components/post-taxonomies/index.js.map +1 -1
  129. package/build-module/components/post-taxonomies/panel.js +10 -0
  130. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  131. package/build-module/components/post-title/index.js +4 -8
  132. package/build-module/components/post-title/index.js.map +1 -1
  133. package/build-module/components/post-title/post-title-raw.js +3 -7
  134. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  135. package/build-module/components/post-trash/check.js +9 -0
  136. package/build-module/components/post-trash/check.js.map +1 -1
  137. package/build-module/components/post-trash/index.js +7 -0
  138. package/build-module/components/post-trash/index.js.map +1 -1
  139. package/build-module/components/post-visibility/index.js +1 -0
  140. package/build-module/components/post-visibility/index.js.map +1 -1
  141. package/build-module/components/provider/index.js +18 -15
  142. package/build-module/components/provider/index.js.map +1 -1
  143. package/build-module/components/sidebar/post-summary.js +1 -1
  144. package/build-module/components/sidebar/post-summary.js.map +1 -1
  145. package/build-module/components/table-of-contents/index.js +11 -0
  146. package/build-module/components/table-of-contents/index.js.map +1 -1
  147. package/build-module/components/template-part-menu-items/convert-to-regular.js +31 -0
  148. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  149. package/build-module/components/template-part-menu-items/convert-to-template-part.js +71 -0
  150. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  151. package/build-module/components/template-part-menu-items/index.js +59 -0
  152. package/build-module/components/template-part-menu-items/index.js.map +1 -0
  153. package/build-module/components/template-part-menu-items/index.native.js +4 -0
  154. package/build-module/components/template-part-menu-items/index.native.js.map +1 -0
  155. package/build-module/components/template-validation-notice/index.js +1 -0
  156. package/build-module/components/template-validation-notice/index.js.map +1 -1
  157. package/build-module/components/theme-support-check/index.js +10 -0
  158. package/build-module/components/theme-support-check/index.js.map +1 -1
  159. package/build-module/components/time-to-read/index.js +6 -0
  160. package/build-module/components/time-to-read/index.js.map +1 -1
  161. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -0
  162. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  163. package/build-module/components/word-count/index.js +6 -0
  164. package/build-module/components/word-count/index.js.map +1 -1
  165. package/build-module/dataviews/api.js +54 -0
  166. package/build-module/dataviews/api.js.map +1 -0
  167. package/build-module/dataviews/store/private-actions.js +21 -0
  168. package/build-module/dataviews/store/private-actions.js.map +1 -0
  169. package/build-module/dataviews/store/private-selectors.js +14 -0
  170. package/build-module/dataviews/store/private-selectors.js.map +1 -0
  171. package/build-module/dataviews/store/reducer.js +29 -0
  172. package/build-module/dataviews/store/reducer.js.map +1 -0
  173. package/build-module/hooks/pattern-overrides.js +2 -1
  174. package/build-module/hooks/pattern-overrides.js.map +1 -1
  175. package/build-module/index.js +1 -0
  176. package/build-module/index.js.map +1 -1
  177. package/build-module/private-apis.js +0 -6
  178. package/build-module/private-apis.js.map +1 -1
  179. package/build-module/private-apis.native.js +0 -2
  180. package/build-module/private-apis.native.js.map +1 -1
  181. package/build-module/store/private-actions.js +1 -0
  182. package/build-module/store/private-actions.js.map +1 -1
  183. package/build-module/store/private-selectors.js +4 -0
  184. package/build-module/store/private-selectors.js.map +1 -1
  185. package/build-module/store/reducer.js +3 -1
  186. package/build-module/store/reducer.js.map +1 -1
  187. package/build-style/style-rtl.css +7 -2
  188. package/build-style/style.css +7 -2
  189. package/build-types/dataviews/store/private-actions.d.ts +17 -0
  190. package/build-types/dataviews/store/private-actions.d.ts.map +1 -0
  191. package/build-types/dataviews/store/private-selectors.d.ts +10 -0
  192. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -0
  193. package/build-types/dataviews/store/reducer.d.ts +11 -0
  194. package/build-types/dataviews/store/reducer.d.ts.map +1 -0
  195. package/package.json +35 -35
  196. package/src/components/document-tools/index.js +13 -4
  197. package/src/components/editor/index.js +23 -28
  198. package/src/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  199. package/src/components/entities-saved-states/index.js +26 -0
  200. package/src/components/global-styles-provider/index.js +12 -2
  201. package/src/components/index.js +7 -0
  202. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
  203. package/src/components/post-actions/actions.js +6 -2
  204. package/src/components/post-card-panel/style.scss +4 -0
  205. package/src/components/post-panel-row/style.scss +1 -1
  206. package/src/components/post-publish-button/index.js +3 -0
  207. package/src/components/post-publish-button/label.js +5 -0
  208. package/src/components/post-publish-panel/index.js +3 -0
  209. package/src/components/post-status/style.scss +5 -0
  210. package/src/components/post-sticky/check.js +8 -0
  211. package/src/components/post-sticky/index.js +5 -0
  212. package/src/components/post-switch-to-draft-button/index.js +10 -1
  213. package/src/components/post-sync-status/index.js +5 -0
  214. package/src/components/post-taxonomies/check.js +8 -0
  215. package/src/components/post-taxonomies/flat-term-selector.js +13 -2
  216. package/src/components/post-taxonomies/index.js +8 -0
  217. package/src/components/post-taxonomies/panel.js +9 -0
  218. package/src/components/post-title/index.js +2 -5
  219. package/src/components/post-title/post-title-raw.js +2 -5
  220. package/src/components/post-trash/check.js +8 -0
  221. package/src/components/post-trash/index.js +6 -0
  222. package/src/components/post-visibility/index.js +1 -0
  223. package/src/components/provider/index.js +17 -17
  224. package/src/components/sidebar/post-summary.js +1 -1
  225. package/src/components/table-of-contents/index.js +10 -0
  226. package/src/components/template-part-menu-items/convert-to-regular.js +32 -0
  227. package/src/components/template-part-menu-items/convert-to-template-part.js +75 -0
  228. package/src/components/template-part-menu-items/index.js +59 -0
  229. package/src/components/template-part-menu-items/index.native.js +3 -0
  230. package/src/components/template-validation-notice/index.js +1 -0
  231. package/src/components/theme-support-check/index.js +9 -0
  232. package/src/components/time-to-read/index.js +5 -0
  233. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -0
  234. package/src/components/word-count/index.js +5 -0
  235. package/src/dataviews/api.js +55 -0
  236. package/src/dataviews/store/private-actions.ts +30 -0
  237. package/src/dataviews/store/private-selectors.ts +15 -0
  238. package/src/dataviews/store/reducer.ts +44 -0
  239. package/src/hooks/pattern-overrides.js +2 -0
  240. package/src/index.js +1 -0
  241. package/src/private-apis.js +0 -6
  242. package/src/private-apis.native.js +0 -2
  243. package/src/store/private-actions.js +1 -0
  244. package/src/store/private-selectors.js +5 -0
  245. package/src/store/reducer.js +2 -0
  246. package/tsconfig.json +36 -0
  247. package/tsconfig.tsbuildinfo +1 -0
@@ -35,19 +35,16 @@ var _jsxRuntime = require("react/jsx-runtime");
35
35
 
36
36
  function PostTitle(_, forwardedRef) {
37
37
  const {
38
- placeholder,
39
- hasFixedToolbar
38
+ placeholder
40
39
  } = (0, _data.useSelect)(select => {
41
40
  const {
42
41
  getSettings
43
42
  } = select(_blockEditor.store);
44
43
  const {
45
- titlePlaceholder,
46
- hasFixedToolbar: _hasFixedToolbar
44
+ titlePlaceholder
47
45
  } = getSettings();
48
46
  return {
49
- placeholder: titlePlaceholder,
50
- hasFixedToolbar: _hasFixedToolbar
47
+ placeholder: titlePlaceholder
51
48
  };
52
49
  }, []);
53
50
  const [isSelected, setIsSelected] = (0, _element.useState)(false);
@@ -186,8 +183,7 @@ function PostTitle(_, forwardedRef) {
186
183
  // The wp-block className is important for editor styles.
187
184
  // This same block is used in both the visual and the code editor.
188
185
  const className = (0, _clsx.default)(_constants.DEFAULT_CLASSNAMES, {
189
- 'is-selected': isSelected,
190
- 'has-fixed-toolbar': hasFixedToolbar
186
+ 'is-selected': isSelected
191
187
  });
192
188
  return (
193
189
  /*#__PURE__*/
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","_jsxRuntime","PostTitle","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAMA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,aAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,qBAAA,GAAAf,sBAAA,CAAAC,OAAA;AAA8D,IAAAe,WAAA,GAAAf,OAAA;AA7B9D;AACA;AACA;;AAEA;AACA;AACA;;AAiBA;AACA;AACA;;AAMA,SAASgB,SAASA,CAAEC,CAAC,EAAEC,YAAY,EAAG;EACrC,MAAM;IAAEC,WAAW;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjE,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAClD,MAAM;MAAEC,gBAAgB;MAAEL,eAAe,EAAEM;IAAiB,CAAC,GAC5DH,WAAW,CAAC,CAAC;IAEd,OAAO;MACNJ,WAAW,EAAEM,gBAAgB;MAC7BL,eAAe,EAAEM;IA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AE;EAC3B,CAAE,CAAC;;EAEH;EACA;EACA,MAAMC,SAAS,GAAG,IAAAC,aAAI,EAAEC,6BAAkB,EAAE;IAC3C,aAAa,EAAEvE,UAAU;IACzB,mBAAmB,EAAEP;EACtB,CAAE,CAAC;EAEH;IAAA;IACC;IACA,IAAAL,WAAA,CAAAoF,GAAA,EAACrF,qBAAA,CAAAsF,OAAoB;MAACC,WAAW,EAAC,OAAO;MAAAC,QAAA,eACxC,IAAAvF,WAAA,CAAAoF,GAAA;QACCrE,GAAG,EAAG,IAAAyE,qBAAY,EAAE,CAAEhB,WAAW,EAAExD,QAAQ,CAAG,CAAG;QACjDyE,eAAe;QACfR,SAAS,EAAGA,SAAW;QACvB,cAAaZ,kBAAoB;QACjCqB,IAAI,EAAC,SAAS;QACd,kBAAe,MAAM;QACrBC,OAAO,EAAGzD,QAAU;QACpB0D,MAAM,EAAGzD,UAAY;QACrBG,SAAS,EAAGA,SAAW;QACvBuD,UAAU,EAAG1D,UAAY;QACzBQ,OAAO,EAAGA;MAAS,CACnB;IAAC,CACmB;IACtB;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAmD,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAQe,IAAAW,mBAAU,EAAE/F,SAAU,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","_jsxRuntime","PostTitle","_","forwardedRef","placeholder","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAMA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA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A,CAAAV,OAAA,GAQe,IAAAW,mBAAU,EAAE7F,SAAU,CAAC","ignoreList":[]}
@@ -37,19 +37,16 @@ var _jsxRuntime = require("react/jsx-runtime");
37
37
  * @return {Component} The rendered component.
38
38
  */function PostTitleRaw(_, forwardedRef) {
39
39
  const {
40
- placeholder,
41
- hasFixedToolbar
40
+ placeholder
42
41
  } = (0, _data.useSelect)(select => {
43
42
  const {
44
43
  getSettings
45
44
  } = select(_blockEditor.store);
46
45
  const {
47
- titlePlaceholder,
48
- hasFixedToolbar: _hasFixedToolbar
46
+ titlePlaceholder
49
47
  } = getSettings();
50
48
  return {
51
- placeholder: titlePlaceholder,
52
- hasFixedToolbar: _hasFixedToolbar
49
+ placeholder: titlePlaceholder
53
50
  };
54
51
  }, []);
55
52
  const [isSelected, setIsSelected] = (0, _element.useState)(false);
@@ -74,7 +71,6 @@ var _jsxRuntime = require("react/jsx-runtime");
74
71
  // This same block is used in both the visual and the code editor.
75
72
  const className = (0, _clsx.default)(_constants.DEFAULT_CLASSNAMES, {
76
73
  'is-selected': isSelected,
77
- 'has-fixed-toolbar': hasFixedToolbar,
78
74
  'is-raw-text': true
79
75
  });
80
76
  const decodedPlaceholder = (0, _htmlEntities.decodeEntities)(placeholder) || (0, _i18n.__)('Add title');
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_htmlEntities","_data","_blockEditor","_element","_constants","_usePostTitleFocus","_usePostTitle","_jsxRuntime","PostTitleRaw","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","title","setTitle","onUpdate","usePostTitle","ref","focusRef","usePostTitleFocus","onChange","value","replace","REGEXP_NEWLINES","onSelect","onUnselect","className","clsx","DEFAULT_CLASSNAMES","decodedPlaceholder","decodeEntities","__","jsx","TextareaControl","onFocus","onBlur","label","hideLabelFromVision","autoComplete","dir","rows","__nextHasNoMarginBottom","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/post-title-raw.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\n\n/**\n * Renders a raw post title input field.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Reference to the component's DOM node.\n *\n * @return {Component} The rendered component.\n */\nfunction PostTitleRaw( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'is-raw-text': true,\n\t} );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\treturn (\n\t\t<TextareaControl\n\t\t\tref={ focusRef }\n\t\t\tvalue={ title }\n\t\t\tonChange={ onChange }\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tlabel={ placeholder }\n\t\t\tclassName={ className }\n\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\thideLabelFromVision\n\t\t\tautoComplete=\"off\"\n\t\t\tdir=\"auto\"\n\t\t\trows={ 1 }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PostTitleRaw );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAA4C,IAAAU,WAAA,GAAAV,OAAA;AApB5C;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASW,YAAYA,CAAEC,CAAC,EAAEC,YAAY,EAAG;EACxC,MAAM;IAAEC,WAAW;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjE,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAClD,MAAM;MAAEC,gBAAgB;MAAEL,eAAe,EAAEM;IAAiB,CAAC,GAC5DH,WAAW,CAAC,CAAC;IAEd,OAAO;MACNJ,WAAW,EAAEM,gBAAgB;MAC7BL,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BAAuB;EAAA,CACvB,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAE9C,YAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_htmlEntities","_data","_blockEditor","_element","_constants","_usePostTitleFocus","_usePostTitle","_jsxRuntime","PostTitleRaw","_","forwardedRef","placeholder","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","isSelected","setIsSelected","useState","title","setTitle","onUpdate","usePostTitle","ref","focusRef","usePostTitleFocus","onChange","value","replace","REGEXP_NEWLINES","onSelect","onUnselect","className","clsx","DEFAULT_CLASSNAMES","decodedPlaceholder","decodeEntities","__","jsx","TextareaControl","onFocus","onBlur","label","hideLabelFromVision","autoComplete","dir","rows","__nextHasNoMarginBottom","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/post-title-raw.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\n\n/**\n * Renders a raw post title input field.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Reference to the component's DOM node.\n *\n * @return {Component} The rendered component.\n */\nfunction PostTitleRaw( _, forwardedRef ) {\n\tconst { placeholder } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'is-raw-text': true,\n\t} );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\treturn (\n\t\t<TextareaControl\n\t\t\tref={ focusRef }\n\t\t\tvalue={ title }\n\t\t\tonChange={ onChange }\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tlabel={ placeholder }\n\t\t\tclassName={ className }\n\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\thideLabelFromVision\n\t\t\tautoComplete=\"off\"\n\t\t\tdir=\"auto\"\n\t\t\trows={ 1 }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PostTitleRaw );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAA4C,IAAAU,WAAA,GAAAV,OAAA;AApB5C;AAC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ACfhB,GAAG,EAAGC,QAAU;IAChBG,KAAK,EAAGR,KAAO;IACfO,QAAQ,EAAGA,QAAU;IACrBc,OAAO,EAAGV,QAAU;IACpBW,MAAM,EAAGV,UAAY;IACrBW,KAAK,EAAGhC,WAAa;IACrBsB,SAAS,EAAGA,SAAW;IACvBtB,WAAW,EAAGyB,kBAAoB;IAClCQ,mBAAmB;IACnBC,YAAY,EAAC,KAAK;IAClBC,GAAG,EAAC,MAAM;IACVC,IAAI,EAAG,CAAG;IACVC,uBAAuB;EAAA,CACvB,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAE5C,YAAa,CAAC","ignoreList":[]}
@@ -15,6 +15,14 @@ var _store = require("../../store");
15
15
  * Internal dependencies
16
16
  */
17
17
 
18
+ /**
19
+ * Wrapper component that renders its children only if the post can trashed.
20
+ *
21
+ * @param {Object} props - The component props.
22
+ * @param {Element} props.children - The child components to render.
23
+ *
24
+ * @return {Component|null} The rendered child components or null if the post can not trashed.
25
+ */
18
26
  function PostTrashCheck({
19
27
  children
20
28
  }) {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_coreData","_store","PostTrashCheck","children","canTrashPost","useSelect","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","editorStore","getPostType","canUser","coreStore","postType","postId","isNew","resource","rest_base","canUserDelete"],"sources":["@wordpress/editor/src/components/post-trash/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostTrashCheck( { children } ) {\n\tconst { canTrashPost } = useSelect( ( select ) => {\n\t\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { getPostType, canUser } = select( coreStore );\n\t\tconst postType = getPostType( getCurrentPostType() );\n\t\tconst postId = getCurrentPostId();\n\t\tconst isNew = isEditedPostNew();\n\t\tconst resource = postType?.rest_base || ''; // eslint-disable-line camelcase\n\t\tconst canUserDelete =\n\t\t\tpostId && resource ? canUser( 'delete', resource, postId ) : false;\n\n\t\treturn {\n\t\t\tcanTrashPost: ( ! isNew || postId ) && canUserDelete,\n\t\t};\n\t}, [] );\n\n\tif ( ! canTrashPost ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASG,cAAcA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjD,MAAM;MAAEC,eAAe;MAAEC,gBAAgB;MAAEC;IAAmB,CAAC,GAC9DH,MAAM,CAAEI,YAAY,CAAC;IACtB,MAAM;MAAEC,WAAW;MAAEC;IAAQ,CAAC,GAAGN,MAAM,CAAEO,eAAU,CAAC;IACpD,MAAMC,QAAQ,GAAGH,WAAW,CAAEF,kBAAkB,CAAC,CAAE,CAAC;IACpD,MAAMM,MAAM,GAAGP,gBAAgB,CAAC,CAAC;IACjC,MAAMQ,KAAK,GAAGT,eAAe,CAAC,CAAC;IAC/B,MAAMU,QAAQ,GAAGH,QAAQ,EAAEI,SAAS,IAAI,EAAE,CAAC,CAAC;IAC5C,MAAMC,aAAa,GAClBJ,MAAM,IAAIE,QAAQ,GAAGL,OAAO,CAAE,QAAQ,EAAEK,QAAQ,EAAEF,MAAO,CAAC,GAAG,KAAK;IAEnE,OAAO;MACNX,YAAY,EAAE,CAAE,CAAEY,KAAK,IAAID,MAAM,KAAMI;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEf,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_coreData","_store","PostTrashCheck","children","canTrashPost","useSelect","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","editorStore","getPostType","canUser","coreStore","postType","postId","isNew","resource","rest_base","canUserDelete"],"sources":["@wordpress/editor/src/components/post-trash/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if the post can trashed.\n *\n * @param {Object} props - The component props.\n * @param {Element} props.children - The child components to render.\n *\n * @return {Component|null} The rendered child components or null if the post can not trashed.\n */\nexport default function PostTrashCheck( { children } ) {\n\tconst { canTrashPost } = useSelect( ( select ) => {\n\t\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { getPostType, canUser } = select( coreStore );\n\t\tconst postType = getPostType( getCurrentPostType() );\n\t\tconst postId = getCurrentPostId();\n\t\tconst isNew = isEditedPostNew();\n\t\tconst resource = postType?.rest_base || ''; // eslint-disable-line camelcase\n\t\tconst canUserDelete =\n\t\t\tpostId && resource ? canUser( 'delete', resource, postId ) : false;\n\n\t\treturn {\n\t\t\tcanTrashPost: ( ! isNew || postId ) && canUserDelete,\n\t\t};\n\t}, [] );\n\n\tif ( ! canTrashPost ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,cAAcA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjD,MAAM;MAAEC,eAAe;MAAEC,gBAAgB;MAAEC;IAAmB,CAAC,GAC9DH,MAAM,CAAEI,YAAY,CAAC;IACtB,MAAM;MAAEC,WAAW;MAAEC;IAAQ,CAAC,GAAGN,MAAM,CAAEO,eAAU,CAAC;IACpD,MAAMC,QAAQ,GAAGH,WAAW,CAAEF,kBAAkB,CAAC,CAAE,CAAC;IACpD,MAAMM,MAAM,GAAGP,gBAAgB,CAAC,CAAC;IACjC,MAAMQ,KAAK,GAAGT,eAAe,CAAC,CAAC;IAC/B,MAAMU,QAAQ,GAAGH,QAAQ,EAAEI,SAAS,IAAI,EAAE,CAAC,CAAC;IAC5C,MAAMC,aAAa,GAClBJ,MAAM,IAAIE,QAAQ,GAAGL,OAAO,CAAE,QAAQ,EAAEK,QAAQ,EAAEF,MAAO,CAAC,GAAG,KAAK;IAEnE,OAAO;MACNX,YAAY,EAAE,CAAE,CAAEY,KAAK,IAAID,MAAM,KAAMI;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEf,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -18,7 +18,11 @@ var _jsxRuntime = require("react/jsx-runtime");
18
18
  * Internal dependencies
19
19
  */
20
20
 
21
- function PostTrash() {
21
+ /**
22
+ * Displays the Post Trash Button and Confirm Dialog in the Editor.
23
+ *
24
+ * @return {JSX.Element|null} The rendered PostTrash component.
25
+ */function PostTrash() {
22
26
  const {
23
27
  isNew,
24
28
  isDeleting,
@@ -57,6 +61,7 @@ function PostTrash() {
57
61
  onConfirm: handleConfirm,
58
62
  onCancel: () => setShowConfirmDialog(false),
59
63
  confirmButtonText: (0, _i18n.__)('Move to trash'),
64
+ size: "medium",
60
65
  children: (0, _i18n.__)('Are you sure you want to move this post to the trash?')
61
66
  })]
62
67
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_element","_store","_jsxRuntime","PostTrash","isNew","isDeleting","postId","useSelect","select","store","editorStore","isEditedPostNew","isDeletingPost","getCurrentPostId","trashPost","useDispatch","showConfirmDialog","setShowConfirmDialog","useState","handleConfirm","jsxs","Fragment","children","jsx","Button","__next40pxDefaultSize","className","isDestructive","variant","isBusy","onClick","undefined","__","__experimentalConfirmDialog","isOpen","onConfirm","onCancel","confirmButtonText"],"sources":["@wordpress/editor/src/components/post-trash/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostTrash() {\n\tconst { isNew, isDeleting, postId } = useSelect( ( select ) => {\n\t\tconst store = select( editorStore );\n\t\treturn {\n\t\t\tisNew: store.isEditedPostNew(),\n\t\t\tisDeleting: store.isDeletingPost(),\n\t\t\tpostId: store.getCurrentPostId(),\n\t\t};\n\t}, [] );\n\tconst { trashPost } = useDispatch( editorStore );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tif ( isNew || ! postId ) {\n\t\treturn null;\n\t}\n\n\tconst handleConfirm = () => {\n\t\tsetShowConfirmDialog( false );\n\t\ttrashPost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"editor-post-trash\"\n\t\t\t\tisDestructive\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isDeleting }\n\t\t\t\taria-disabled={ isDeleting }\n\t\t\t\tonClick={\n\t\t\t\t\tisDeleting ? undefined : () => setShowConfirmDialog( true )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ __( 'Move to trash' ) }\n\t\t\t</Button>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tonConfirm={ handleConfirm }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t\tconfirmButtonText={ __( 'Move to trash' ) }\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Are you sure you want to move this post to the trash?'\n\t\t\t\t) }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAAmD,IAAAK,WAAA,GAAAL,OAAA;AAdnD;AACA;AACA;;AASA;AACA;AACA;;AAGe,SAASM,SAASA,CAAA,EAAG;EACnC,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAO,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC9D,MAAMC,KAAK,GAAGD,MAAM,CAAEE,YAAY,CAAC;IACnC,OAAO;MACNN,KAAK,EAAEK,KAAK,CAACE,eAAe,CAAC,CAAC;MAC9BN,UAAU,EAAEI,KAAK,CAACG,cAAc,CAAC,CAAC;MAClCN,MAAM,EAAEG,KAAK,CAACI,gBAAgB,CAAC;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,iBAAW,EAAEL,YAAY,CAAC;EAChD,MAAM,CAAEM,iBAAiB,EAAEC,oBAAoB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAErE,IAAKd,KAAK,IAAI,CAAEE,MAAM,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,MAAMa,aAAa,GAAGA,CAAA,KAAM;IAC3BF,oBAAoB,CAAE,KAAM,CAAC;IAC7BH,SAAS,CAAC,CAAC;EACZ,CAAC;EAED,oBACC,IAAAZ,WAAA,CAAAkB,IAAA,EAAAlB,WAAA,CAAAmB,QAAA;IAAAC,QAAA,gBACC,IAAApB,WAAA,CAAAqB,GAAA,EAACzB,WAAA,CAAA0B,MAAM;MACNC,qBAAqB;MACrBC,SAAS,EAAC,mBAAmB;MAC7BC,aAAa;MACbC,OAAO,EAAC,WAAW;MACnBC,MAAM,EAAGxB,UAAY;MACrB,iBAAgBA,UAAY;MAC5ByB,OAAO,EACNzB,UAAU,GAAG0B,SAAS,GAAG,MAAMd,oBAAoB,CAAE,IAAK,CAC1D;MAAAK,QAAA,EAEC,IAAAU,QAAE,EAAE,eAAgB;IAAC,CAChB,CAAC,eACT,IAAA9B,WAAA,CAAAqB,GAAA,EAACzB,WAAA,CAAAmC,2BAAa;MACbC,MAAM,EAAGlB,iBAAmB;MAC5BmB,SAAS,EAAGhB,aAAe;MAC3BiB,QAAQ,EAAGA,CAAA,KAAMnB,oBAAoB,CAAE,KAAM,CAAG;MAChDoB,iBAAiB,EAAG,IAAAL,QAAE,EAAE,eAAgB,CAAG;MAAAV,QAAA,EAEzC,IAAAU,QAAE,EACH,uDACD;IAAC,CACa,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_element","_store","_jsxRuntime","PostTrash","isNew","isDeleting","postId","useSelect","select","store","editorStore","isEditedPostNew","isDeletingPost","getCurrentPostId","trashPost","useDispatch","showConfirmDialog","setShowConfirmDialog","useState","handleConfirm","jsxs","Fragment","children","jsx","Button","__next40pxDefaultSize","className","isDestructive","variant","isBusy","onClick","undefined","__","__experimentalConfirmDialog","isOpen","onConfirm","onCancel","confirmButtonText","size"],"sources":["@wordpress/editor/src/components/post-trash/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Displays the Post Trash Button and Confirm Dialog in the Editor.\n *\n * @return {JSX.Element|null} The rendered PostTrash component.\n */\nexport default function PostTrash() {\n\tconst { isNew, isDeleting, postId } = useSelect( ( select ) => {\n\t\tconst store = select( editorStore );\n\t\treturn {\n\t\t\tisNew: store.isEditedPostNew(),\n\t\t\tisDeleting: store.isDeletingPost(),\n\t\t\tpostId: store.getCurrentPostId(),\n\t\t};\n\t}, [] );\n\tconst { trashPost } = useDispatch( editorStore );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tif ( isNew || ! postId ) {\n\t\treturn null;\n\t}\n\n\tconst handleConfirm = () => {\n\t\tsetShowConfirmDialog( false );\n\t\ttrashPost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"editor-post-trash\"\n\t\t\t\tisDestructive\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isDeleting }\n\t\t\t\taria-disabled={ isDeleting }\n\t\t\t\tonClick={\n\t\t\t\t\tisDeleting ? undefined : () => setShowConfirmDialog( true )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ __( 'Move to trash' ) }\n\t\t\t</Button>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tonConfirm={ handleConfirm }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t\tconfirmButtonText={ __( 'Move to trash' ) }\n\t\t\t\tsize=\"medium\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Are you sure you want to move this post to the trash?'\n\t\t\t\t) }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OA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QAAE,EAAE,eAAgB;IAAC,CAChB,CAAC,eACT,IAAA9B,WAAA,CAAAqB,GAAA,EAACzB,WAAA,CAAAmC,2BAAa;MACbC,MAAM,EAAGlB,iBAAmB;MAC5BmB,SAAS,EAAGhB,aAAe;MAC3BiB,QAAQ,EAAGA,CAAA,KAAMnB,oBAAoB,CAAE,KAAM,CAAG;MAChDoB,iBAAiB,EAAG,IAAAL,QAAE,EAAE,eAAgB,CAAG;MAC3CM,IAAI,EAAC,QAAQ;MAAAhB,QAAA,EAEX,IAAAU,QAAE,EACH,uDACD;IAAC,CACa,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
@@ -132,6 +132,7 @@ var _jsxRuntime = require("react/jsx-runtime");
132
132
  onConfirm: confirmPrivate,
133
133
  onCancel: handleDialogCancel,
134
134
  confirmButtonText: (0, _i18n.__)('Publish'),
135
+ size: "medium",
135
136
  children: (0, _i18n.__)('Would you like to privately publish this post now?')
136
137
  })]
137
138
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_components","_compose","_data","_blockEditor","_utils","_store","_jsxRuntime","PostVisibility","onClose","instanceId","useInstanceId","status","visibility","password","useSelect","select","editorStore","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","useDispatch","hasPassword","setHasPassword","useState","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","jsxs","className","children","jsx","__experimentalInspectorPopoverHeader","title","__","help","VisuallyHidden","as","PostVisibilityChoice","label","visibilityOptions","public","info","checked","onChange","private","htmlFor","id","type","placeholder","__experimentalConfirmDialog","isOpen","onConfirm","onCancel","confirmButtonText","props","name"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Allows users to set the visibility of a post.\n *\n * @param {Object} props The component props.\n * @param {Function} props.onClose Function to call when the popover is closed.\n * @return {JSX.Element} The rendered component.\n */\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t\tconfirmButtonText={ __( 'Publish' ) }\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA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epB,KAAO,IAAI1B,UAAY,cAAe;MAC3D4B,SAAS,EAAC,8BAA8B;MAAAC,QAAA,EAEtCY;IAAI,CACJ,CAAC;EAAA,CACA,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_components","_compose","_data","_blockEditor","_utils","_store","_jsxRuntime","PostVisibility","onClose","instanceId","useInstanceId","status","visibility","password","useSelect","select","editorStore","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","useDispatch","hasPassword","setHasPassword","useState","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","jsxs","className","children","jsx","__experimentalInspectorPopoverHeader","title","__","help","VisuallyHidden","as","PostVisibilityChoice","label","visibilityOptions","public","info","checked","onChange","private","htmlFor","id","type","placeholder","__experimentalConfirmDialog","isOpen","onConfirm","onCancel","confirmButtonText","size","props","name"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Allows users to set the visibility of a post.\n *\n * @param {Object} props The component props.\n * @param {Function} props.onClose Function to call when the popover is closed.\n * @return {JSX.Element} The rendered component.\n */\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t\tconfirmButtonText={ __( 'Publish' ) }\n\t\t\t\tsize=\"medium\"\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAmD,IAAAQ,WAAA,GAAAR,OAAA;AAjBnD;AACA;AACA;;AAWA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,GACe,SAASS,cAAcA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACrD,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEH,cAAe,CAAC;EAElD,MAAM;IAAEI,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC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AAQ;MAAAzB,QAAA,EAEX,IAAAI,QAAE,EAAE,oDAAqD;IAAC,CAC9C,CAAC;EAAA,CACZ,CAAC;AAER;AAEA,SAASI,oBAAoBA,CAAE;EAAErC,UAAU;EAAE0B,KAAK;EAAEY,KAAK;EAAEG,IAAI;EAAE,GAAGc;AAAM,CAAC,EAAG;EAC7E,oBACC,IAAA1D,WAAA,CAAA8B,IAAA;IAAKC,SAAS,EAAC,gCAAgC;IAAAC,QAAA,gBAC9C,IAAAhC,WAAA,CAAAiC,GAAA;MACCiB,IAAI,EAAC,OAAO;MACZS,IAAI,EAAI,mCAAmCxD,UAAY,EAAG;MAC1D0B,KAAK,EAAGA,KAAO;MACfoB,EAAE,EAAI,eAAepB,KAAO,IAAI1B,UAAY,EAAG;MAC/C,oBAAoB,eAAe0B,KAAO,IAAI1B,UAAY,cAAe;MACzE4B,SAAS,EAAC,+BAA+B;MAAA,GACpC2B;IAAK,CACV,CAAC,eACF,IAAA1D,WAAA,CAAAiC,GAAA;MACCe,OAAO,EAAI,eAAenB,KAAO,IAAI1B,UAAY,EAAG;MACpD4B,SAAS,EAAC,+BAA+B;MAAAC,QAAA,EAEvCS;IAAK,CACD,CAAC,eACR,IAAAzC,WAAA,CAAAiC,GAAA;MACCgB,EAAE,EAAI,eAAepB,KAAO,IAAI1B,UAAY,cAAe;MAC3D4B,SAAS,EAAC,8BAA8B;MAAAC,QAAA,EAEtCY;IAAI,CACJ,CAAC;EAAA,CACA,CAAC;AAER","ignoreList":[]}
@@ -30,6 +30,7 @@ var _startTemplateOptions = _interopRequireDefault(require("../start-template-op
30
30
  var _globalKeyboardShortcuts = _interopRequireDefault(require("../global-keyboard-shortcuts"));
31
31
  var _patternRenameModal = _interopRequireDefault(require("../pattern-rename-modal"));
32
32
  var _patternDuplicateModal = _interopRequireDefault(require("../pattern-duplicate-modal"));
33
+ var _templatePartMenuItems = _interopRequireDefault(require("../template-part-menu-items"));
33
34
  var _jsxRuntime = require("react/jsx-runtime");
34
35
  /**
35
36
  * WordPress dependencies
@@ -147,35 +148,37 @@ const ExperimentalEditorProvider = exports.ExperimentalEditorProvider = (0, _wit
147
148
  BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
148
149
  __unstableTemplate: template
149
150
  }) => {
150
- const mode = (0, _data.useSelect)(select => select(_store.store).getRenderingMode(), []);
151
- const shouldRenderTemplate = !!template && mode !== 'post-only';
152
- const rootLevelPost = shouldRenderTemplate ? template : post;
153
- const defaultBlockContext = (0, _element.useMemo)(() => {
154
- const postContext = !NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate ? {
155
- postId: post.id,
156
- postType: post.type
157
- } : {};
158
- return {
159
- ...postContext,
160
- templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined
161
- };
162
- }, [shouldRenderTemplate, post.id, post.type, rootLevelPost.type, rootLevelPost.slug]);
163
151
  const {
164
152
  editorSettings,
165
153
  selection,
166
- isReady
154
+ isReady,
155
+ mode
167
156
  } = (0, _data.useSelect)(select => {
168
157
  const {
169
158
  getEditorSettings,
170
159
  getEditorSelection,
160
+ getRenderingMode,
171
161
  __unstableIsEditorReady
172
162
  } = select(_store.store);
173
163
  return {
174
164
  editorSettings: getEditorSettings(),
175
165
  isReady: __unstableIsEditorReady(),
166
+ mode: getRenderingMode(),
176
167
  selection: getEditorSelection()
177
168
  };
178
169
  }, []);
170
+ const shouldRenderTemplate = !!template && mode !== 'post-only';
171
+ const rootLevelPost = shouldRenderTemplate ? template : post;
172
+ const defaultBlockContext = (0, _element.useMemo)(() => {
173
+ const postContext = !NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate ? {
174
+ postId: post.id,
175
+ postType: post.type
176
+ } : {};
177
+ return {
178
+ ...postContext,
179
+ templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined
180
+ };
181
+ }, [shouldRenderTemplate, post.id, post.type, rootLevelPost.type, rootLevelPost.slug]);
179
182
  const {
180
183
  id,
181
184
  type
@@ -257,7 +260,7 @@ const ExperimentalEditorProvider = exports.ExperimentalEditorProvider = (0, _wit
257
260
  settings: blockEditorSettings,
258
261
  useSubRegistry: false,
259
262
  children: [children, !settings.__unstableIsPreviewMode && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
260
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_contentOnlySettingsMenu.default, {}), mode === 'template-locked' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_disableNonPageContentBlocks.default, {}), type === 'wp_navigation' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationBlockEditingMode.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_globalKeyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcutHelpModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockRemovalWarnings.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startPageOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startTemplateOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternRenameModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternDuplicateModal.default, {})]
263
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templatePartMenuItems.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_contentOnlySettingsMenu.default, {}), mode === 'template-locked' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_disableNonPageContentBlocks.default, {}), type === 'wp_navigation' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationBlockEditingMode.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_globalKeyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcutHelpModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockRemovalWarnings.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startPageOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_startTemplateOptions.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternRenameModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternDuplicateModal.default, {})]
261
264
  })]
262
265
  })
263
266
  })
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_i18n","_coreData","_blockEditor","_notices","_patterns","_blocks","_withRegistryProvider","_interopRequireDefault","_store","_useBlockEditorSettings","_lockUnlock","_disableNonPageContentBlocks","_navigationBlockEditingMode","_useHideBlocksFromInserter","_commands","_blockRemovalWarnings","_startPageOptions","_keyboardShortcutHelpModal","_contentOnlySettingsMenu","_startTemplateOptions","_globalKeyboardShortcuts","_patternRenameModal","_patternDuplicateModal","_jsxRuntime","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","useEntityBlockEditor","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","useMemo","createBlock","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","exports","withRegistryProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","useSelect","select","editorStore","getRenderingMode","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","editorSettings","selection","isReady","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blockEditorSettings","useBlockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","useDispatch","createWarningNotice","noticesStore","useLayoutEffect","postLock","autosave","__","actions","label","url","editLink","useEffect","_settings$defaultRend","defaultRenderingMode","useHideBlocksFromInserter","useCommands","jsx","EntityProvider","kind","BlockContextProvider","value","jsxs","useSubRegistry","__unstableIsPreviewMode","Fragment","default","EditorProvider","props","BlockEditorProvider","_default"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst mode = useSelect(\n\t\t\t( select ) => select( editorStore ).getRenderingMode(),\n\t\t\t[]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext =\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t\t\t? { postId: post.id, postType: post.type }\n\t\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {JSX.Element} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,qBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,uBAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,4BAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,IAAAc,2BAAA,GAAAL,sBAAA,CAAAT,OAAA;AACA,IAAAe,0BAAA,GAAAf,OAAA;AACA,IAAAgB,SAAA,GAAAP,sBAAA,CAAAT,OAAA;AACA,IAAAiB,qBAAA,GAAAR,sBAAA,CAAAT,OAAA;AACA,IAAAkB,iBAAA,GAAAT,sBAAA,CAAAT,OAAA;AACA,IAAAmB,0BAAA,GAAAV,sBAAA,CAAAT,OAA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,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACC,IAAA5F,WAAA,CAAAiF,GAAA,EAACpD,0BAA0B;IAAA,GACrB+D,KAAK;IACVxD,4BAA4B,EAAGyD,gCAAqB;IAAA1D,QAAA,EAElDyD,KAAK,CAACzD;EAAQ,CACW,CAAC;AAE/B;AAAC,IAAA2D,QAAA,GAAAhE,OAAA,CAAA4D,OAAA,GAEcC,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_i18n","_coreData","_blockEditor","_notices","_patterns","_blocks","_withRegistryProvider","_interopRequireDefault","_store","_useBlockEditorSettings","_lockUnlock","_disableNonPageContentBlocks","_navigationBlockEditingMode","_useHideBlocksFromInserter","_commands","_blockRemovalWarnings","_startPageOptions","_keyboardShortcutHelpModal","_contentOnlySettingsMenu","_startTemplateOptions","_globalKeyboardShortcuts","_patternRenameModal","_patternDuplicateModal","_templatePartMenuItems","_jsxRuntime","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","useEntityBlockEditor","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","useMemo","createBlock","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","exports","withRegistryProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","editorSettings","selection","isReady","useSelect","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","editorStore","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","blockEditorSettings","useBlockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","useDispatch","createWarningNotice","noticesStore","useLayoutEffect","postLock","autosave","__","actions","label","url","editLink","useEffect","_settings$defaultRend","defaultRenderingMode","useHideBlocksFromInserter","useCommands","jsx","EntityProvider","kind","BlockContextProvider","value","jsxs","useSubRegistry","__unstableIsPreviewMode","Fragment","default","EditorProvider","props","BlockEditorProvider","_default"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst { editorSettings, selection, isReady, mode } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext =\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t\t\t? { postId: post.id, postType: post.type }\n\t\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {JSX.Element} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,qBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,uBAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,4BAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,I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AAE,CAAC,eACxB,IAAA1F,WAAA,CAAAiF,GAAA,EAACzF,iBAAA,CAAAkG,OAAgB,IAAE,CAAC,eACpB,IAAA1F,WAAA,CAAAiF,GAAA,EAACtF,qBAAA,CAAA+F,OAAoB,IAAE,CAAC,eACxB,IAAA1F,WAAA,CAAAiF,GAAA,EAACpF,mBAAA,CAAA6F,OAAkB,IAAE,CAAC,eACtB,IAAA1F,WAAA,CAAAiF,GAAA,EAACnF,sBAAA,CAAA4F,OAAqB,IAAE,CAAC;UAAA,CACxB,CACF;QAAA,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACC,IAAA5F,WAAA,CAAAiF,GAAA,EAACpD,0BAA0B;IAAA,GACrB+D,KAAK;IACVxD,4BAA4B,EAAGyD,gCAAqB;IAAA1D,QAAA,EAElDyD,KAAK,CAACzD;EAAQ,CACW,CAAC;AAE/B;AAAC,IAAA2D,QAAA,GAAAhE,OAAA,CAAA4D,OAAA,GAEcC,cAAc","ignoreList":[]}
@@ -76,7 +76,7 @@ function PostSummary({
76
76
  spacing: 1,
77
77
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_postContentInformation.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postLastEditedPanel.default, {})]
78
78
  }), !isRemovedPostStatusPanel && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
79
- spacing: 2,
79
+ spacing: 4,
80
80
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
81
81
  spacing: 1,
82
82
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_postStatus.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel7.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel9.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel8.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel3.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postLastRevision.PrivatePostLastRevision, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel2.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postSyncStatus.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blogTitle.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postsPerPage.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_siteDiscussion.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel6.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postSticky.default, {})]
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_pluginPostStatusInfo","_interopRequireDefault","_postActions","_panel","_postCardPanel","_postContentInformation","_panel2","_panel3","_panel4","_panel5","_panel6","_postLastEditedPanel","_postPanelSection","_panel7","_postStatus","_postSticky","_postSyncStatus","_panel8","_panel9","_blogTitle","_postsPerPage","_siteDiscussion","_store","_templateAreas","_postLastRevision","_jsxRuntime","PANEL_NAME","PostSummary","onActionPerformed","isRemovedPostStatusPanel","useSelect","select","isEditorPanelRemoved","getCurrentPostType","editorStore","postType","jsx","default","className","children","Slot","fills","Fragment","jsxs","__experimentalVStack","spacing","actions","withPanelBody","PrivatePostExcerptPanel","PrivatePostLastRevision"],"sources":["@wordpress/editor/src/components/sidebar/post-summary.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostActions from '../post-actions';\nimport PostAuthorPanel from '../post-author/panel';\nimport PostCardPanel from '../post-card-panel';\nimport PostContentInformation from '../post-content-information';\nimport PageAttributesPanel from '../page-attributes/panel';\nimport PostDiscussionPanel from '../post-discussion/panel';\nimport { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';\nimport PostFeaturedImagePanel from '../post-featured-image/panel';\nimport PostFormatPanel from '../post-format/panel';\nimport PostLastEditedPanel from '../post-last-edited-panel';\nimport PostPanelSection from '../post-panel-section';\nimport PostSchedulePanel from '../post-schedule/panel';\nimport PostStatusPanel from '../post-status';\nimport PostStickyPanel from '../post-sticky';\nimport PostSyncStatus from '../post-sync-status';\nimport PostTemplatePanel from '../post-template/panel';\nimport PostURLPanel from '../post-url/panel';\nimport BlogTitle from '../blog-title';\nimport PostsPerPage from '../posts-per-page';\nimport SiteDiscussion from '../site-discussion';\nimport { store as editorStore } from '../../store';\nimport TemplateAreas from '../template-areas';\nimport { PrivatePostLastRevision } from '../post-last-revision';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel } = 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, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\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<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImagePanel withPanelBody={ false } />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t\t\t\t<PrivatePostLastRevision />\n\t\t\t\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t\t\t\t\t<BlogTitle />\n\t\t\t\t\t\t\t\t\t\t<PostsPerPage />\n\t\t\t\t\t\t\t\t\t\t<SiteDiscussion />\n\t\t\t\t\t\t\t\t\t\t<PostFormatPanel />\n\t\t\t\t\t\t\t\t\t\t<PostStickyPanel />\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<TemplateAreas />\n\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PostPanelSection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B,OAAY,IAAE,CAAC,eAChB,IAAAZ,WAAA,CAAAW,GAAA,EAACf,eAAA,CAAAgB,OAAc,IAAE,CAAC,eAClB,IAAAZ,WAAA,CAAAW,GAAA,EAAC1B,OAAA,CAAA2B,OAAe,IAAE,CAAC,eACnB,IAAAZ,WAAA,CAAAW,GAAA,EAACrB,WAAA,CAAAsB,OAAe,IAAE,CAAC;YAAA,CACZ,CAAC,eACT,IAAAZ,WAAA,CAAAW,GAAA,EAACb,cAAA,CAAAc,OAAa,IAAE,CAAC,EACfI,KAAK;UAAA,CACA,CACR;QAAA,CACM;MAAC,CACR;IACF,CACyB;EAAC,CACX,CAAC;AAErB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_data","_pluginPostStatusInfo","_interopRequireDefault","_postActions","_panel","_postCardPanel","_postContentInformation","_panel2","_panel3","_panel4","_panel5","_panel6","_postLastEditedPanel","_postPanelSection","_panel7","_postStatus","_postSticky","_postSyncStatus","_panel8","_panel9","_blogTitle","_postsPerPage","_siteDiscussion","_store","_templateAreas","_postLastRevision","_jsxRuntime","PANEL_NAME","PostSummary","onActionPerformed","isRemovedPostStatusPanel","useSelect","select","isEditorPanelRemoved","getCurrentPostType","editorStore","postType","jsx","default","className","children","Slot","fills","Fragment","jsxs","__experimentalVStack","spacing","actions","withPanelBody","PrivatePostExcerptPanel","PrivatePostLastRevision"],"sources":["@wordpress/editor/src/components/sidebar/post-summary.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostActions from '../post-actions';\nimport PostAuthorPanel from '../post-author/panel';\nimport PostCardPanel from '../post-card-panel';\nimport PostContentInformation from '../post-content-information';\nimport PageAttributesPanel from '../page-attributes/panel';\nimport PostDiscussionPanel from '../post-discussion/panel';\nimport { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';\nimport PostFeaturedImagePanel from '../post-featured-image/panel';\nimport PostFormatPanel from '../post-format/panel';\nimport PostLastEditedPanel from '../post-last-edited-panel';\nimport PostPanelSection from '../post-panel-section';\nimport PostSchedulePanel from '../post-schedule/panel';\nimport PostStatusPanel from '../post-status';\nimport PostStickyPanel from '../post-sticky';\nimport PostSyncStatus from '../post-sync-status';\nimport PostTemplatePanel from '../post-template/panel';\nimport PostURLPanel from '../post-url/panel';\nimport BlogTitle from '../blog-title';\nimport PostsPerPage from '../posts-per-page';\nimport SiteDiscussion from '../site-discussion';\nimport { store as editorStore } from '../../store';\nimport TemplateAreas from '../template-areas';\nimport { PrivatePostLastRevision } from '../post-last-revision';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel } = 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, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\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<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImagePanel withPanelBody={ false } />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t\t\t\t<PrivatePostLastRevision />\n\t\t\t\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t\t\t\t\t<BlogTitle />\n\t\t\t\t\t\t\t\t\t\t<PostsPerPage />\n\t\t\t\t\t\t\t\t\t\t<SiteDiscussion />\n\t\t\t\t\t\t\t\t\t\t<PostFormatPanel />\n\t\t\t\t\t\t\t\t\t\t<PostStickyPanel />\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<TemplateAreas />\n\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PostPanelSection>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,I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,GAAA,EAACrB,WAAA,CAAAsB,OAAe,IAAE,CAAC;YAAA,CACZ,CAAC,eACT,IAAAZ,WAAA,CAAAW,GAAA,EAACb,cAAA,CAAAc,OAAa,IAAE,CAAC,EACfI,KAAK;UAAA,CACA,CACR;QAAA,CACM;MAAC,CACR;IACF,CACyB;EAAC,CACX,CAAC;AAErB","ignoreList":[]}
@@ -56,5 +56,16 @@ function TableOfContents({
56
56
  })
57
57
  });
58
58
  }
59
+
60
+ /**
61
+ * Renders a table of contents component.
62
+ *
63
+ * @param {Object} props The component props.
64
+ * @param {boolean} props.hasOutlineItemsDisabled Whether outline items are disabled.
65
+ * @param {boolean} props.repositionDropdown Whether to reposition the dropdown.
66
+ * @param {Element.ref} ref The component's ref.
67
+ *
68
+ * @return {JSX.Element} The rendered table of contents component.
69
+ */
59
70
  var _default = exports.default = (0, _element.forwardRef)(TableOfContents);
60
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_icons","_element","_blockEditor","_panel","_interopRequireDefault","_jsxRuntime","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","useSelect","select","blockEditorStore","getBlockCount","jsx","Dropdown","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","Button","onClick","undefined","icon","info","label","__","tooltipPosition","renderContent","onClose","default","onRequestClose","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAC,sBAAA,CAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAb3C;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASS,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,oBACC,IAAAV,WAAA,CAAAW,GAAA,EAAClB,WAAA,CAAAmB,QAAQ;IACRC,YAAY,EAAG;MACdC,SAAS,EAAEX,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHY,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAnB,WAAA,CAAAW,GAAA,EAAClB,WAAA,CAAA2B,MAAM;MAAA,GACDhB,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXgB,OAAO,EAAGf,SAAS,GAAGa,QAAQ,GAAGG,SAAW;MAC5CC,IAAI,EAAGC,WAAM;MACb,iBAAgBN,MAAQ;MACxB,iBAAc;MACd;MACAO,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;MACzBC,eAAe,EAAC,QAAQ;MACxB,iBAAgB,CAAErB;IAAW,CAC7B,CACC;IACHsB,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,kBAC5B,IAAA7B,WAAA,CAAAW,GAAA,EAACb,MAAA,CAAAgC,OAAoB;MACpBC,cAAc,EAAGF,OAAS;MAC1B3B,uBAAuB,EAAGA;IAAyB,CACnD;EACC,CACH,CAAC;AAEJ;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEc,IAAAI,mBAAU,EAAEjC,eAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_icons","_element","_blockEditor","_panel","_interopRequireDefault","_jsxRuntime","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","useSelect","select","blockEditorStore","getBlockCount","jsx","Dropdown","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","Button","onClick","undefined","icon","info","label","__","tooltipPosition","renderContent","onClose","default","onRequestClose","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a table of contents component.\n *\n * @param {Object} props The component props.\n * @param {boolean} props.hasOutlineItemsDisabled Whether outline items are disabled.\n * @param {boolean} props.repositionDropdown Whether to reposition the dropdown.\n * @param {Element.ref} ref The component's ref.\n *\n * @return {JSX.Element} The rendered table of contents component.\n */\nexport default forwardRef( TableOfContents );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAC,sBAAA,CAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAb3C;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASS,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,oBACC,IAAAV,WAAA,CAAAW,GAAA,EAAClB,WAAA,CAAAmB,QAAQ;IACRC,YAAY,EAAG;MACdC,SAAS,EAAEX,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHY,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAnB,WAAA,CAAAW,GAAA,EAAClB,WAAA,CAAA2B,MAAM;MAAA,GACDhB,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXgB,OAAO,EAAGf,SAAS,GAAGa,QAAQ,GAAGG,SAAW;MAC5CC,IAAI,EAAGC,WAAM;MACb,iBAAgBN,MAAQ;MACxB,iBAAc;MACd;MAC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