@wordpress/editor 14.0.0 → 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 (301) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +164 -20
  3. package/build/components/block-settings-menu/content-only-settings-menu.js +14 -5
  4. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  5. package/build/components/document-tools/index.js +12 -3
  6. package/build/components/document-tools/index.js.map +1 -1
  7. package/build/components/editor/index.js +77 -0
  8. package/build/components/editor/index.js.map +1 -0
  9. package/build/components/editor-interface/index.js +6 -8
  10. package/build/components/editor-interface/index.js.map +1 -1
  11. package/build/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  12. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  13. package/build/components/entities-saved-states/index.js +28 -0
  14. package/build/components/entities-saved-states/index.js.map +1 -1
  15. package/build/components/global-styles-provider/index.js +9 -2
  16. package/build/components/global-styles-provider/index.js.map +1 -1
  17. package/build/components/header/back-button.js +4 -1
  18. package/build/components/header/back-button.js.map +1 -1
  19. package/build/components/header/index.js +1 -5
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/index.js +7 -0
  22. package/build/components/index.js.map +1 -1
  23. package/build/components/media-categories/index.js +1 -1
  24. package/build/components/media-categories/index.js.map +1 -1
  25. package/build/components/post-actions/actions.js +10 -4
  26. package/build/components/post-actions/actions.js.map +1 -1
  27. package/build/components/post-last-revision/index.js +35 -9
  28. package/build/components/post-last-revision/index.js.map +1 -1
  29. package/build/components/post-preview-button/index.js +1 -0
  30. package/build/components/post-preview-button/index.js.map +1 -1
  31. package/build/components/post-publish-button/index.js +4 -0
  32. package/build/components/post-publish-button/index.js.map +1 -1
  33. package/build/components/post-publish-button/label.js +5 -0
  34. package/build/components/post-publish-button/label.js.map +1 -1
  35. package/build/components/post-publish-panel/index.js +5 -0
  36. package/build/components/post-publish-panel/index.js.map +1 -1
  37. package/build/components/post-sticky/check.js +8 -0
  38. package/build/components/post-sticky/check.js.map +1 -1
  39. package/build/components/post-sticky/index.js +5 -1
  40. package/build/components/post-sticky/index.js.map +1 -1
  41. package/build/components/post-switch-to-draft-button/index.js +11 -2
  42. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  43. package/build/components/post-sync-status/index.js +6 -2
  44. package/build/components/post-sync-status/index.js.map +1 -1
  45. package/build/components/post-taxonomies/check.js +8 -0
  46. package/build/components/post-taxonomies/check.js.map +1 -1
  47. package/build/components/post-taxonomies/flat-term-selector.js +14 -2
  48. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  49. package/build/components/post-taxonomies/index.js +9 -0
  50. package/build/components/post-taxonomies/index.js.map +1 -1
  51. package/build/components/post-taxonomies/panel.js +10 -0
  52. package/build/components/post-taxonomies/panel.js.map +1 -1
  53. package/build/components/post-title/index.js +4 -8
  54. package/build/components/post-title/index.js.map +1 -1
  55. package/build/components/post-title/post-title-raw.js +3 -7
  56. package/build/components/post-title/post-title-raw.js.map +1 -1
  57. package/build/components/post-trash/check.js +8 -0
  58. package/build/components/post-trash/check.js.map +1 -1
  59. package/build/components/post-trash/index.js +6 -1
  60. package/build/components/post-trash/index.js.map +1 -1
  61. package/build/components/post-url/panel.js +25 -3
  62. package/build/components/post-url/panel.js.map +1 -1
  63. package/build/components/post-visibility/index.js +1 -0
  64. package/build/components/post-visibility/index.js.map +1 -1
  65. package/build/components/provider/disable-non-page-content-blocks.js +5 -3
  66. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  67. package/build/components/provider/index.js +18 -15
  68. package/build/components/provider/index.js.map +1 -1
  69. package/build/components/sidebar/post-summary.js +3 -2
  70. package/build/components/sidebar/post-summary.js.map +1 -1
  71. package/build/components/table-of-contents/index.js +11 -0
  72. package/build/components/table-of-contents/index.js.map +1 -1
  73. package/build/components/template-part-menu-items/convert-to-regular.js +38 -0
  74. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  75. package/build/components/template-part-menu-items/convert-to-template-part.js +77 -0
  76. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  77. package/build/components/template-part-menu-items/index.js +67 -0
  78. package/build/components/template-part-menu-items/index.js.map +1 -0
  79. package/build/components/template-part-menu-items/index.native.js +10 -0
  80. package/build/components/template-part-menu-items/index.native.js.map +1 -0
  81. package/build/components/template-validation-notice/index.js +1 -0
  82. package/build/components/template-validation-notice/index.js.map +1 -1
  83. package/build/components/theme-support-check/index.js +9 -0
  84. package/build/components/theme-support-check/index.js.map +1 -1
  85. package/build/components/time-to-read/index.js +6 -0
  86. package/build/components/time-to-read/index.js.map +1 -1
  87. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -0
  88. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  89. package/build/components/word-count/index.js +5 -1
  90. package/build/components/word-count/index.js.map +1 -1
  91. package/build/dataviews/api.js +61 -0
  92. package/build/dataviews/api.js.map +1 -0
  93. package/build/dataviews/store/private-actions.js +28 -0
  94. package/build/dataviews/store/private-actions.js.map +1 -0
  95. package/build/dataviews/store/private-selectors.js +20 -0
  96. package/build/dataviews/store/private-selectors.js.map +1 -0
  97. package/build/dataviews/store/reducer.js +36 -0
  98. package/build/dataviews/store/reducer.js.map +1 -0
  99. package/build/hooks/pattern-overrides.js +2 -1
  100. package/build/hooks/pattern-overrides.js.map +1 -1
  101. package/build/index.js +12 -0
  102. package/build/index.js.map +1 -1
  103. package/build/private-apis.js +2 -6
  104. package/build/private-apis.js.map +1 -1
  105. package/build/private-apis.native.js +0 -2
  106. package/build/private-apis.native.js.map +1 -1
  107. package/build/store/private-actions.js +21 -0
  108. package/build/store/private-actions.js.map +1 -1
  109. package/build/store/private-selectors.js +5 -0
  110. package/build/store/private-selectors.js.map +1 -1
  111. package/build/store/reducer.js +4 -1
  112. package/build/store/reducer.js.map +1 -1
  113. package/build-module/components/block-settings-menu/content-only-settings-menu.js +14 -5
  114. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  115. package/build-module/components/document-tools/index.js +12 -3
  116. package/build-module/components/document-tools/index.js.map +1 -1
  117. package/build-module/components/editor/index.js +71 -0
  118. package/build-module/components/editor/index.js.map +1 -0
  119. package/build-module/components/editor-interface/index.js +6 -8
  120. package/build-module/components/editor-interface/index.js.map +1 -1
  121. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -0
  122. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  123. package/build-module/components/entities-saved-states/index.js +28 -0
  124. package/build-module/components/entities-saved-states/index.js.map +1 -1
  125. package/build-module/components/global-styles-provider/index.js +9 -2
  126. package/build-module/components/global-styles-provider/index.js.map +1 -1
  127. package/build-module/components/header/back-button.js +4 -1
  128. package/build-module/components/header/back-button.js.map +1 -1
  129. package/build-module/components/header/index.js +1 -5
  130. package/build-module/components/header/index.js.map +1 -1
  131. package/build-module/components/index.js +7 -0
  132. package/build-module/components/index.js.map +1 -1
  133. package/build-module/components/media-categories/index.js +1 -1
  134. package/build-module/components/media-categories/index.js.map +1 -1
  135. package/build-module/components/post-actions/actions.js +10 -4
  136. package/build-module/components/post-actions/actions.js.map +1 -1
  137. package/build-module/components/post-last-revision/index.js +34 -11
  138. package/build-module/components/post-last-revision/index.js.map +1 -1
  139. package/build-module/components/post-preview-button/index.js +1 -0
  140. package/build-module/components/post-preview-button/index.js.map +1 -1
  141. package/build-module/components/post-publish-button/index.js +4 -0
  142. package/build-module/components/post-publish-button/index.js.map +1 -1
  143. package/build-module/components/post-publish-button/label.js +6 -0
  144. package/build-module/components/post-publish-button/label.js.map +1 -1
  145. package/build-module/components/post-publish-panel/index.js +5 -0
  146. package/build-module/components/post-publish-panel/index.js.map +1 -1
  147. package/build-module/components/post-sticky/check.js +9 -0
  148. package/build-module/components/post-sticky/check.js.map +1 -1
  149. package/build-module/components/post-sticky/index.js +6 -0
  150. package/build-module/components/post-sticky/index.js.map +1 -1
  151. package/build-module/components/post-switch-to-draft-button/index.js +10 -1
  152. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build-module/components/post-sync-status/index.js +7 -1
  154. package/build-module/components/post-sync-status/index.js.map +1 -1
  155. package/build-module/components/post-taxonomies/check.js +9 -0
  156. package/build-module/components/post-taxonomies/check.js.map +1 -1
  157. package/build-module/components/post-taxonomies/flat-term-selector.js +14 -2
  158. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  159. package/build-module/components/post-taxonomies/index.js +9 -0
  160. package/build-module/components/post-taxonomies/index.js.map +1 -1
  161. package/build-module/components/post-taxonomies/panel.js +10 -0
  162. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  163. package/build-module/components/post-title/index.js +4 -8
  164. package/build-module/components/post-title/index.js.map +1 -1
  165. package/build-module/components/post-title/post-title-raw.js +3 -7
  166. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  167. package/build-module/components/post-trash/check.js +9 -0
  168. package/build-module/components/post-trash/check.js.map +1 -1
  169. package/build-module/components/post-trash/index.js +7 -0
  170. package/build-module/components/post-trash/index.js.map +1 -1
  171. package/build-module/components/post-url/panel.js +26 -3
  172. package/build-module/components/post-url/panel.js.map +1 -1
  173. package/build-module/components/post-visibility/index.js +1 -0
  174. package/build-module/components/post-visibility/index.js.map +1 -1
  175. package/build-module/components/provider/disable-non-page-content-blocks.js +5 -3
  176. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  177. package/build-module/components/provider/index.js +18 -15
  178. package/build-module/components/provider/index.js.map +1 -1
  179. package/build-module/components/sidebar/post-summary.js +3 -2
  180. package/build-module/components/sidebar/post-summary.js.map +1 -1
  181. package/build-module/components/table-of-contents/index.js +11 -0
  182. package/build-module/components/table-of-contents/index.js.map +1 -1
  183. package/build-module/components/template-part-menu-items/convert-to-regular.js +31 -0
  184. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  185. package/build-module/components/template-part-menu-items/convert-to-template-part.js +71 -0
  186. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  187. package/build-module/components/template-part-menu-items/index.js +59 -0
  188. package/build-module/components/template-part-menu-items/index.js.map +1 -0
  189. package/build-module/components/template-part-menu-items/index.native.js +4 -0
  190. package/build-module/components/template-part-menu-items/index.native.js.map +1 -0
  191. package/build-module/components/template-validation-notice/index.js +1 -0
  192. package/build-module/components/template-validation-notice/index.js.map +1 -1
  193. package/build-module/components/theme-support-check/index.js +10 -0
  194. package/build-module/components/theme-support-check/index.js.map +1 -1
  195. package/build-module/components/time-to-read/index.js +6 -0
  196. package/build-module/components/time-to-read/index.js.map +1 -1
  197. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -0
  198. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  199. package/build-module/components/word-count/index.js +6 -0
  200. package/build-module/components/word-count/index.js.map +1 -1
  201. package/build-module/dataviews/api.js +54 -0
  202. package/build-module/dataviews/api.js.map +1 -0
  203. package/build-module/dataviews/store/private-actions.js +21 -0
  204. package/build-module/dataviews/store/private-actions.js.map +1 -0
  205. package/build-module/dataviews/store/private-selectors.js +14 -0
  206. package/build-module/dataviews/store/private-selectors.js.map +1 -0
  207. package/build-module/dataviews/store/reducer.js +29 -0
  208. package/build-module/dataviews/store/reducer.js.map +1 -0
  209. package/build-module/hooks/pattern-overrides.js +2 -1
  210. package/build-module/hooks/pattern-overrides.js.map +1 -1
  211. package/build-module/index.js +1 -0
  212. package/build-module/index.js.map +1 -1
  213. package/build-module/private-apis.js +2 -6
  214. package/build-module/private-apis.js.map +1 -1
  215. package/build-module/private-apis.native.js +0 -2
  216. package/build-module/private-apis.native.js.map +1 -1
  217. package/build-module/store/private-actions.js +1 -0
  218. package/build-module/store/private-actions.js.map +1 -1
  219. package/build-module/store/private-selectors.js +4 -0
  220. package/build-module/store/private-selectors.js.map +1 -1
  221. package/build-module/store/reducer.js +3 -1
  222. package/build-module/store/reducer.js.map +1 -1
  223. package/build-style/style-rtl.css +35 -43
  224. package/build-style/style.css +35 -43
  225. package/build-types/dataviews/store/private-actions.d.ts +17 -0
  226. package/build-types/dataviews/store/private-actions.d.ts.map +1 -0
  227. package/build-types/dataviews/store/private-selectors.d.ts +10 -0
  228. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -0
  229. package/build-types/dataviews/store/reducer.d.ts +11 -0
  230. package/build-types/dataviews/store/reducer.d.ts.map +1 -0
  231. package/package.json +35 -35
  232. package/src/components/block-settings-menu/content-only-settings-menu.js +26 -12
  233. package/src/components/collapsible-block-toolbar/style.scss +3 -1
  234. package/src/components/document-tools/index.js +13 -4
  235. package/src/components/editor/index.js +88 -0
  236. package/src/components/editor-interface/index.js +5 -5
  237. package/src/components/editor-interface/style.scss +3 -0
  238. package/src/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  239. package/src/components/entities-saved-states/index.js +26 -0
  240. package/src/components/entities-saved-states/style.scss +0 -7
  241. package/src/components/global-styles-provider/index.js +12 -2
  242. package/src/components/header/back-button.js +6 -1
  243. package/src/components/header/index.js +1 -8
  244. package/src/components/header/style.scss +1 -1
  245. package/src/components/index.js +7 -0
  246. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
  247. package/src/components/media-categories/index.js +1 -3
  248. package/src/components/post-actions/actions.js +9 -3
  249. package/src/components/post-card-panel/style.scss +4 -0
  250. package/src/components/post-last-revision/index.js +30 -7
  251. package/src/components/post-last-revision/style.scss +4 -0
  252. package/src/components/post-panel-row/style.scss +2 -1
  253. package/src/components/post-preview-button/index.js +1 -0
  254. package/src/components/post-preview-button/test/index.js +10 -2
  255. package/src/components/post-publish-button/index.js +3 -0
  256. package/src/components/post-publish-button/label.js +5 -0
  257. package/src/components/post-publish-panel/index.js +4 -0
  258. package/src/components/post-publish-panel/style.scss +28 -36
  259. package/src/components/post-status/style.scss +5 -0
  260. package/src/components/post-sticky/check.js +8 -0
  261. package/src/components/post-sticky/index.js +5 -0
  262. package/src/components/post-switch-to-draft-button/index.js +10 -1
  263. package/src/components/post-sync-status/index.js +7 -8
  264. package/src/components/post-taxonomies/check.js +8 -0
  265. package/src/components/post-taxonomies/flat-term-selector.js +13 -2
  266. package/src/components/post-taxonomies/index.js +8 -0
  267. package/src/components/post-taxonomies/panel.js +9 -0
  268. package/src/components/post-title/index.js +2 -5
  269. package/src/components/post-title/post-title-raw.js +2 -5
  270. package/src/components/post-trash/check.js +8 -0
  271. package/src/components/post-trash/index.js +6 -0
  272. package/src/components/post-url/panel.js +13 -5
  273. package/src/components/post-visibility/index.js +1 -0
  274. package/src/components/provider/disable-non-page-content-blocks.js +9 -4
  275. package/src/components/provider/index.js +17 -17
  276. package/src/components/save-publish-panels/style.scss +0 -8
  277. package/src/components/sidebar/post-summary.js +3 -1
  278. package/src/components/table-of-contents/index.js +10 -0
  279. package/src/components/template-part-menu-items/convert-to-regular.js +32 -0
  280. package/src/components/template-part-menu-items/convert-to-template-part.js +75 -0
  281. package/src/components/template-part-menu-items/index.js +59 -0
  282. package/src/components/template-part-menu-items/index.native.js +3 -0
  283. package/src/components/template-validation-notice/index.js +1 -0
  284. package/src/components/theme-support-check/index.js +9 -0
  285. package/src/components/time-to-read/index.js +5 -0
  286. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -0
  287. package/src/components/word-count/index.js +5 -0
  288. package/src/dataviews/api.js +55 -0
  289. package/src/dataviews/store/private-actions.ts +30 -0
  290. package/src/dataviews/store/private-selectors.ts +15 -0
  291. package/src/dataviews/store/reducer.ts +44 -0
  292. package/src/hooks/pattern-overrides.js +2 -0
  293. package/src/index.js +1 -0
  294. package/src/private-apis.js +2 -6
  295. package/src/private-apis.native.js +0 -2
  296. package/src/store/private-actions.js +1 -0
  297. package/src/store/private-selectors.js +5 -0
  298. package/src/store/reducer.js +2 -0
  299. package/src/style.scss +1 -0
  300. package/tsconfig.json +36 -0
  301. package/tsconfig.tsbuildinfo +1 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_blockEditor","_element","_hooks","CONTENT_ONLY_BLOCKS","applyFilters","DisableNonPageContentBlocks","contentOnlyIds","useSelect","select","getBlocksByName","getBlockParents","getBlockName","blockEditorStore","filter","clientId","every","parentClientId","parentBlockName","includes","disabledIds","getBlockOrder","flatMap","registry","useRegistry","useEffect","setBlockEditingMode","unsetBlockEditingMode","dispatch","batch"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\nconst CONTENT_ONLY_BLOCKS = applyFilters( 'editor.postContentBlockTypes', [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n\t'core/template-part',\n] );\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\t// Note that there are two separate subscription because the result for each\n\t// returns a new array.\n\tconst contentOnlyIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\treturn getBlocksByName( CONTENT_ONLY_BLOCKS ).filter( ( clientId ) =>\n\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\treturn (\n\t\t\t\t\t// Ignore descendents of the query block.\n\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t// Enable only the top-most block.\n\t\t\t\t\t! CONTENT_ONLY_BLOCKS.includes( parentBlockName )\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}, [] );\n\tconst disabledIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockOrder } = select( blockEditorStore );\n\t\treturn getBlocksByName( [ 'core/template-part' ] ).flatMap(\n\t\t\t( clientId ) => getBlockOrder( clientId )\n\t\t);\n\t}, [] );\n\n\tconst registry = useRegistry();\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tsetBlockEditingMode( '', 'disabled' );\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t}\n\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'disabled' );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tunsetBlockEditingMode( '' );\n\t\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ contentOnlyIds, disabledIds, registry ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA,MAAMI,mBAAmB,GAAG,IAAAC,mBAAY,EAAE,8BAA8B,EAAE,CACzE,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,CACnB,CAAC;;AAEH;AACA;AACA;AACA;AACe,SAASC,2BAA2BA,CAAA,EAAG;EACrD;EACA;EACA,MAAMC,cAAc,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC/C,MAAM;MAAEC,eAAe;MAAEC,eAAe;MAAEC;IAAa,CAAC,GACvDH,MAAM,CAAEI,kBAAiB,CAAC;IAC3B,OAAOH,eAAe,CAAEN,mBAAoB,CAAC,CAACU,MAAM,CAAIC,QAAQ,IAC/DJ,eAAe,CAAEI,QAAS,CAAC,CAACC,KAAK,CAAIC,cAAc,IAAM;MACx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QAClC;MACD,CAAE,CAAC;IACJ,CAAC;EACF,CAAC,EAAE,CAAER,cAAc,EAAEa,WAAW,EAAEG,QAAQ,CAAG,CAAC;EAE9C,OAAO,IAAI;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_blockEditor","_element","_hooks","DEFAULT_CONTENT_ONLY_BLOCKS","DisableNonPageContentBlocks","contentOnlyBlocks","applyFilters","contentOnlyIds","useSelect","select","getBlocksByName","getBlockParents","getBlockName","blockEditorStore","filter","clientId","every","parentClientId","parentBlockName","includes","disabledIds","getBlockOrder","flatMap","registry","useRegistry","useEffect","setBlockEditingMode","unsetBlockEditingMode","dispatch","batch"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\nconst DEFAULT_CONTENT_ONLY_BLOCKS = [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n\t'core/template-part',\n];\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tconst contentOnlyBlocks = applyFilters(\n\t\t'editor.postContentBlockTypes',\n\t\tDEFAULT_CONTENT_ONLY_BLOCKS\n\t);\n\n\t// Note that there are two separate subscription because the result for each\n\t// returns a new array.\n\tconst contentOnlyIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\treturn getBlocksByName( contentOnlyBlocks ).filter( ( clientId ) =>\n\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\treturn (\n\t\t\t\t\t// Ignore descendents of the query block.\n\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t// Enable only the top-most block.\n\t\t\t\t\t! contentOnlyBlocks.includes( parentBlockName )\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}, [] );\n\tconst disabledIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockOrder } = select( blockEditorStore );\n\t\treturn getBlocksByName( [ 'core/template-part' ] ).flatMap(\n\t\t\t( clientId ) => getBlockOrder( clientId )\n\t\t);\n\t}, [] );\n\n\tconst registry = useRegistry();\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tsetBlockEditingMode( '', 'disabled' );\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t}\n\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'disabled' );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tunsetBlockEditingMode( '' );\n\t\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ contentOnlyIds, disabledIds, registry ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA,MAAMI,2BAA2B,GAAG,CACnC,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,CACpB;;AAED;AACA;AACA;AACA;AACe,SAASC,2BAA2BA,CAAA,EAAG;EACrD,MAAMC,iBAAiB,GAAG,IAAAC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W,EAAG;QACrCM,mBAAmB,CAAEX,QAAQ,EAAE,UAAW,CAAC;MAC5C;IACD,CAAE,CAAC;IAEH,OAAO,MAAM;MACZQ,QAAQ,CAACM,KAAK,CAAE,MAAM;QACrBF,qBAAqB,CAAE,EAAG,CAAC;QAC3B,KAAM,MAAMZ,QAAQ,IAAIR,cAAc,EAAG;UACxCoB,qBAAqB,CAAEZ,QAAS,CAAC;QAClC;QACA,KAAM,MAAMA,QAAQ,IAAIK,WAAW,EAAG;UACrCO,qBAAqB,CAAEZ,QAAS,CAAC;QAClC;MACD,CAAE,CAAC;IACJ,CAAC;EACF,CAAC,EAAE,CAAER,cAAc,EAAEa,WAAW,EAAEG,QAAQ,CAAG,CAAC;EAE9C,OAAO,IAAI;AACZ","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</ExperimentalE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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,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,OAAA;AACA,IAAAoB,wBAAA,GAAAX,sBAAA,CAAAT,OAAA;AACA,IAAAqB,qBAAA,GAAAZ,sBAAA,CAAAT,OAAA;AACA,IAAAsB,wBAAA,GAAAb,sBAAA,CAAAT,OAAA;AACA,IAAAuB,mBAAA,GAAAd,sBAAA,CA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A;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":[]}
@@ -30,6 +30,7 @@ var _postsPerPage = _interopRequireDefault(require("../posts-per-page"));
30
30
  var _siteDiscussion = _interopRequireDefault(require("../site-discussion"));
31
31
  var _store = require("../../store");
32
32
  var _templateAreas = _interopRequireDefault(require("../template-areas"));
33
+ var _postLastRevision = require("../post-last-revision");
33
34
  var _jsxRuntime = require("react/jsx-runtime");
34
35
  /**
35
36
  * WordPress dependencies
@@ -75,10 +76,10 @@ function PostSummary({
75
76
  spacing: 1,
76
77
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_postContentInformation.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postLastEditedPanel.default, {})]
77
78
  }), !isRemovedPostStatusPanel && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
78
- spacing: 2,
79
+ spacing: 4,
79
80
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
80
81
  spacing: 1,
81
- 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)(_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, {})]
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, {})]
82
83
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templateAreas.default, {}), fills]
83
84
  })]
84
85
  })
@@ -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","_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"],"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';\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<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,IAAAK,MAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,cAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,uBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,OAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,OAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,oBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,iBAAA,GAAAX,sBAAA,CAAAH,OAAA;AACA,IAAAe,OAAA,GAAAZ,sBAAA,CAAAH,OAAA;AACA,IAAAgB,WAAA,GAAAb,sBAAA,CAAAH,OAAA;AACA,IAAAiB,WAAA,GAAAd,sBAAA,CAAAH,OAAA;AACA,IAAAkB,eAAA,GAAAf,sBAAA,CAAAH,OAAA;AACA,IAAAmB,OAAA,GAAA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ACvB,IAAAZ,WAAA,CAAAW,GAAA,EAAC7B,OAAA,CAAA8B,OAAmB,IAAE,CAAC,eACvB,IAAAZ,WAAA,CAAAW,GAAA,EAACnB,eAAA,CAAAoB,OAAc,IAAE,CAAC,eAClB,IAAAZ,WAAA,CAAAW,GAAA,EAAChB,UAAA,CAAAiB,OAAS,IAAE,CAAC,eACb,IAAAZ,WAAA,CAAAW,GAAA,EAACf,aAAA,CAAAgB,OAAY,IAAE,CAAC,eAChB,IAAAZ,WAAA,CAAAW,GAAA,EAACd,eAAA,CAAAe,OAAc,IAAE,CAAC,eAClB,IAAAZ,WAAA,CAAAW,GAAA,EAACzB,OAAA,CAAA0B,OAAe,IAAE,CAAC,eACnB,IAAAZ,WAAA,CAAAW,GAAA,EAACpB,WAAA,CAAAqB,OAAe,IAAE,CAAC;YAAA,CACZ,CAAC,eACT,IAAAZ,WAAA,CAAAW,GAAA,EAACZ,cAAA,CAAAa,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>\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AAAkB,OAAS,IAAE,CAAC,eACb,IAAAZ,WAAA,CAAAW,GAAA,EAAChB,aAAA,CAAAiB,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":[]}
@@ -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,O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AAH,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;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,IAAA8B,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAUe,IAAAI,mBAAU,EAAEjC,eAAgB,CAAC","ignoreList":[]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = ConvertToRegularBlocks;
7
+ var _data = require("@wordpress/data");
8
+ var _blockEditor = require("@wordpress/block-editor");
9
+ var _components = require("@wordpress/components");
10
+ var _i18n = require("@wordpress/i18n");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * WordPress dependencies
14
+ */
15
+
16
+ function ConvertToRegularBlocks({
17
+ clientId,
18
+ onClose
19
+ }) {
20
+ const {
21
+ getBlocks
22
+ } = (0, _data.useSelect)(_blockEditor.store);
23
+ const {
24
+ replaceBlocks
25
+ } = (0, _data.useDispatch)(_blockEditor.store);
26
+ const canRemove = (0, _data.useSelect)(select => select(_blockEditor.store).canRemoveBlock(clientId), [clientId]);
27
+ if (!canRemove) {
28
+ return null;
29
+ }
30
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
31
+ onClick: () => {
32
+ replaceBlocks(clientId, getBlocks(clientId));
33
+ onClose();
34
+ },
35
+ children: (0, _i18n.__)('Detach')
36
+ });
37
+ }
38
+ //# sourceMappingURL=convert-to-regular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_blockEditor","_components","_i18n","_jsxRuntime","ConvertToRegularBlocks","clientId","onClose","getBlocks","useSelect","blockEditorStore","replaceBlocks","useDispatch","canRemove","select","canRemoveBlock","jsx","MenuItem","onClick","children","__"],"sources":["@wordpress/editor/src/components/template-part-menu-items/convert-to-regular.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function ConvertToRegularBlocks( { clientId, onClose } ) {\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\tconst canRemove = useSelect(\n\t\t( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tif ( ! canRemove ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\treplaceBlocks( clientId, getBlocks( clientId ) );\n\t\t\t\tonClose();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Detach' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,IAAAI,WAAA,GAAAJ,OAAA;AANrC;AACA;AACA;;AAMe,SAASK,sBAAsBA,CAAE;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EACvE,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,eAAS,EAAEC,kBAAiB,CAAC;EACnD,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEF,kBAAiB,CAAC;EAEzD,MAAMG,SAAS,GAAG,IAAAJ,eAAS,EACxBK,MAAM,IAAMA,MAAM,CAAEJ,kBAAiB,CAAC,CAACK,cAAc,CAAET,QAAS,CAAC,EACnE,CAAEA,QAAQ,CACX,CAAC;EAED,IAAK,CAAEO,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAT,WAAA,CAAAY,GAAA,EAACd,WAAA,CAAAe,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfP,aAAa,CAAEL,QAAQ,EAAEE,SAAS,CAAEF,QAAS,CAAE,CAAC;MAChDC,OAAO,CAAC,CAAC;IACV,CAAG;IAAAY,QAAA,EAED,IAAAC,QAAE,EAAE,QAAS;EAAC,CACP,CAAC;AAEb","ignoreList":[]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = ConvertToTemplatePart;
8
+ var _data = require("@wordpress/data");
9
+ var _blockEditor = require("@wordpress/block-editor");
10
+ var _components = require("@wordpress/components");
11
+ var _blocks = require("@wordpress/blocks");
12
+ var _i18n = require("@wordpress/i18n");
13
+ var _element = require("@wordpress/element");
14
+ var _notices = require("@wordpress/notices");
15
+ var _icons = require("@wordpress/icons");
16
+ var _createTemplatePartModal = _interopRequireDefault(require("../create-template-part-modal"));
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ /**
19
+ * WordPress dependencies
20
+ */
21
+
22
+ /**
23
+ * Internal dependencies
24
+ */
25
+
26
+ function ConvertToTemplatePart({
27
+ clientIds,
28
+ blocks
29
+ }) {
30
+ const [isModalOpen, setIsModalOpen] = (0, _element.useState)(false);
31
+ const {
32
+ replaceBlocks
33
+ } = (0, _data.useDispatch)(_blockEditor.store);
34
+ const {
35
+ createSuccessNotice
36
+ } = (0, _data.useDispatch)(_notices.store);
37
+ const {
38
+ canCreate
39
+ } = (0, _data.useSelect)(select => {
40
+ return {
41
+ canCreate: select(_blockEditor.store).canInsertBlockType('core/template-part')
42
+ };
43
+ }, []);
44
+ if (!canCreate) {
45
+ return null;
46
+ }
47
+ const onConvert = async templatePart => {
48
+ replaceBlocks(clientIds, (0, _blocks.createBlock)('core/template-part', {
49
+ slug: templatePart.slug,
50
+ theme: templatePart.theme
51
+ }));
52
+ createSuccessNotice((0, _i18n.__)('Template part created.'), {
53
+ type: 'snackbar'
54
+ });
55
+
56
+ // The modal and this component will be unmounted because of `replaceBlocks` above,
57
+ // so no need to call `closeModal` or `onClose`.
58
+ };
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
60
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
61
+ icon: _icons.symbolFilled,
62
+ onClick: () => {
63
+ setIsModalOpen(true);
64
+ },
65
+ "aria-expanded": isModalOpen,
66
+ "aria-haspopup": "dialog",
67
+ children: (0, _i18n.__)('Create template part')
68
+ }), isModalOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_createTemplatePartModal.default, {
69
+ closeModal: () => {
70
+ setIsModalOpen(false);
71
+ },
72
+ blocks: blocks,
73
+ onCreate: onConvert
74
+ })]
75
+ });
76
+ }
77
+ //# sourceMappingURL=convert-to-template-part.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_blockEditor","_components","_blocks","_i18n","_element","_notices","_icons","_createTemplatePartModal","_interopRequireDefault","_jsxRuntime","ConvertToTemplatePart","clientIds","blocks","isModalOpen","setIsModalOpen","useState","replaceBlocks","useDispatch","blockEditorStore","createSuccessNotice","noticesStore","canCreate","useSelect","select","canInsertBlockType","onConvert","templatePart","createBlock","slug","theme","__","type","jsxs","Fragment","children","jsx","MenuItem","icon","symbolFilled","onClick","default","closeModal","onCreate"],"sources":["@wordpress/editor/src/components/template-part-menu-items/convert-to-template-part.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { symbolFilled } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CreateTemplatePartModal from '../create-template-part-modal';\n\nexport default function ConvertToTemplatePart( { clientIds, blocks } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst { canCreate } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tcanCreate:\n\t\t\t\tselect( blockEditorStore ).canInsertBlockType(\n\t\t\t\t\t'core/template-part'\n\t\t\t\t),\n\t\t};\n\t}, [] );\n\n\tif ( ! canCreate ) {\n\t\treturn null;\n\t}\n\n\tconst onConvert = async ( templatePart ) => {\n\t\treplaceBlocks(\n\t\t\tclientIds,\n\t\t\tcreateBlock( 'core/template-part', {\n\t\t\t\tslug: templatePart.slug,\n\t\t\t\ttheme: templatePart.theme,\n\t\t\t} )\n\t\t);\n\t\tcreateSuccessNotice( __( 'Template part created.' ), {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\n\t\t// The modal and this component will be unmounted because of `replaceBlocks` above,\n\t\t// so no need to call `closeModal` or `onClose`.\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\ticon={ symbolFilled }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t} }\n\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ __( 'Create template part' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<CreateTemplatePartModal\n\t\t\t\t\tcloseModal={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tonCreate={ onConvert }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,wBAAA,GAAAC,sBAAA,CAAAT,OAAA;AAAoE,IAAAU,WAAA,GAAAV,OAAA;AAfpE;AACA;AACA;;AAUA;AACA;AACA;;AAGe,SAASW,qBAAqBA,CAAE;EAAEC,SAAS;EAAEC;AAAO,CAAC,EAAG;EACtE,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEC,kBAAiB,CAAC;EACzD,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAF,iBAAW,EAAEG,cAAa,CAAC;EAE3D,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC9C,OAAO;MACNF,SAAS,EACRE,MAAM,CAAEL,kBAAiB,CAAC,CAACM,kBAAkB,CAC5C,oBACD;IACF,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEH,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMI,SAAS,GAAG,MAAQC,YAAY,IAAM;IAC3CV,aAAa,CACZL,SAAS,EACT,IAAAgB,mBAAW,EAAE,oBAAoB,EAAE;MAClCC,IAAI,EAAEF,YAAY,CAACE,IAAI;MACvBC,KAAK,EAAEH,YAAY,CAACG;IACrB,CAAE,CACH,CAAC;IACDV,mBAAmB,CAAE,IAAAW,QAAE,EAAE,wBAAyB,CAAC,EAAE;MACpDC,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;EACD,CAAC;EAED,oBACC,IAAAtB,WAAA,CAAAuB,IAAA,EAAAvB,WAAA,CAAAwB,QAAA;IAAAC,QAAA,gBACC,IAAAzB,WAAA,CAAA0B,GAAA,EAAClC,WAAA,CAAAmC,QAAQ;MACRC,IAAI,EAAGC,mBAAc;MACrBC,OAAO,EAAGA,CAAA,KAAM;QACfzB,cAAc,CAAE,IAAK,CAAC;MACvB,CAAG;MACH,iBAAgBD,WAAa;MAC7B,iBAAc,QAAQ;MAAAqB,QAAA,EAEpB,IAAAJ,QAAE,EAAE,sBAAuB;IAAC,CACrB,CAAC,EACTjB,WAAW,iBACZ,IAAAJ,WAAA,CAAA0B,GAAA,EAAC5B,wBAAA,CAAAiC,OAAuB;MACvBC,UAAU,EAAGA,CAAA,KAAM;QAClB3B,cAAc,CAAE,KAAM,CAAC;MACxB,CAAG;MACHF,MAAM,EAAGA,MAAQ;MACjB8B,QAAQ,EAAGjB;IAAW,CACtB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = TemplatePartMenuItems;
8
+ var _data = require("@wordpress/data");
9
+ var _blockEditor = require("@wordpress/block-editor");
10
+ var _convertToRegular = _interopRequireDefault(require("./convert-to-regular"));
11
+ var _convertToTemplatePart = _interopRequireDefault(require("./convert-to-template-part"));
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ /**
14
+ * WordPress dependencies
15
+ */
16
+
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+
21
+ function TemplatePartMenuItems() {
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockSettingsMenuControls, {
23
+ children: ({
24
+ selectedClientIds,
25
+ onClose
26
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(TemplatePartConverterMenuItem, {
27
+ clientIds: selectedClientIds,
28
+ onClose: onClose
29
+ })
30
+ });
31
+ }
32
+ function TemplatePartConverterMenuItem({
33
+ clientIds,
34
+ onClose
35
+ }) {
36
+ const {
37
+ isContentOnly,
38
+ blocks
39
+ } = (0, _data.useSelect)(select => {
40
+ const {
41
+ getBlocksByClientId,
42
+ getBlockEditingMode
43
+ } = select(_blockEditor.store);
44
+ return {
45
+ blocks: getBlocksByClientId(clientIds),
46
+ isContentOnly: clientIds.length === 1 && getBlockEditingMode(clientIds[0]) === 'contentOnly'
47
+ };
48
+ }, [clientIds]);
49
+
50
+ // Do not show the convert button if the block is in content-only mode.
51
+ if (isContentOnly) {
52
+ return null;
53
+ }
54
+
55
+ // Allow converting a single template part to standard blocks.
56
+ if (blocks.length === 1 && blocks[0]?.name === 'core/template-part') {
57
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_convertToRegular.default, {
58
+ clientId: clientIds[0],
59
+ onClose: onClose
60
+ });
61
+ }
62
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_convertToTemplatePart.default, {
63
+ clientIds: clientIds,
64
+ blocks: blocks
65
+ });
66
+ }
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_blockEditor","_convertToRegular","_interopRequireDefault","_convertToTemplatePart","_jsxRuntime","TemplatePartMenuItems","jsx","BlockSettingsMenuControls","children","selectedClientIds","onClose","TemplatePartConverterMenuItem","clientIds","isContentOnly","blocks","useSelect","select","getBlocksByClientId","getBlockEditingMode","blockEditorStore","length","name","default","clientId"],"sources":["@wordpress/editor/src/components/template-part-menu-items/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ConvertToRegularBlocks from './convert-to-regular';\nimport ConvertToTemplatePart from './convert-to-template-part';\n\nexport default function TemplatePartMenuItems() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) => (\n\t\t\t\t<TemplatePartConverterMenuItem\n\t\t\t\t\tclientIds={ selectedClientIds }\n\t\t\t\t\tonClose={ onClose }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n\nfunction TemplatePartConverterMenuItem( { clientIds, onClose } ) {\n\tconst { isContentOnly, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocksByClientId, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tblocks: getBlocksByClientId( clientIds ),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tclientIds.length === 1 &&\n\t\t\t\t\tgetBlockEditingMode( clientIds[ 0 ] ) === 'contentOnly',\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\t// Do not show the convert button if the block is in content-only mode.\n\tif ( isContentOnly ) {\n\t\treturn null;\n\t}\n\n\t// Allow converting a single template part to standard blocks.\n\tif ( blocks.length === 1 && blocks[ 0 ]?.name === 'core/template-part' ) {\n\t\treturn (\n\t\t\t<ConvertToRegularBlocks\n\t\t\t\tclientId={ clientIds[ 0 ] }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\treturn <ConvertToTemplatePart clientIds={ clientIds } blocks={ blocks } />;\n}\n"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sB;MACtBC,QAAQ,EAAGX,SAAS,CAAE,CAAC,CAAI;MAC3BF,OAAO,EAAGA;IAAS,CACnB,CAAC;EAEJ;EACA,oBAAO,IAAAN,WAAA,CAAAE,GAAA,EAACH,sBAAA,CAAAmB,OAAqB;IAACV,SAAS,EAAGA,SAAW;IAACE,MAAM,EAAGA;EAAQ,CAAE,CAAC;AAC3E","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = TemplatePartMenuItems;
7
+ function TemplatePartMenuItems() {
8
+ return null;
9
+ }
10
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TemplatePartMenuItems"],"sources":["@wordpress/editor/src/components/template-part-menu-items/index.native.js"],"sourcesContent":["export default function TemplatePartMenuItems() {\n\treturn null;\n}\n"],"mappings":";;;;;;AAAe,SAASA,qBAAqBA,CAAA,EAAG;EAC/C,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -47,6 +47,7 @@ function TemplateValidationNotice() {
47
47
  synchronizeTemplate();
48
48
  },
49
49
  onCancel: () => setShowConfirmDialog(false),
50
+ size: "medium",
50
51
  children: (0, _i18n.__)('Resetting the template may result in loss of content, do you want to continue?')
51
52
  })]
52
53
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_data","_element","_blockEditor","_jsxRuntime","TemplateValidationNotice","showConfirmDialog","setShowConfirmDialog","useState","isValid","useSelect","select","blockEditorStore","isValidTemplate","setTemplateValidity","synchronizeTemplate","useDispatch","jsxs","Fragment","children","jsx","Notice","className","isDismissible","status","actions","label","__","onClick","__experimentalConfirmDialog","isOpen","confirmButtonText","onConfirm","onCancel"],"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tNotice,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function TemplateValidationNotice() {\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\tconst isValid = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).isValidTemplate();\n\t}, [] );\n\tconst { setTemplateValidity, synchronizeTemplate } =\n\t\tuseDispatch( blockEditorStore );\n\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Notice\n\t\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\t\tisDismissible={ false }\n\t\t\t\tstatus=\"warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\t\tonClick: () => setTemplateValidity( true ),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\t\tonClick: () => setShowConfirmDialog( true ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t\t) }\n\t\t\t</Notice>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tconfirmButtonText={ __( 'Reset' ) }\n\t\t\t\tonConfirm={ () => {\n\t\t\t\t\tsetShowConfirmDialog( false );\n\t\t\t\t\tsynchronizeTemplate();\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t) }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAA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,EAAE,OAAQ,CAAG;MACnCK,SAAS,EAAGA,CAAA,KAAM;QACjBzB,oBAAoB,CAAE,KAAM,CAAC;QAC7BQ,mBAAmB,CAAC,CAAC;MACtB,CAAG;MACHkB,QAAQ,EAAGA,CAAA,KAAM1B,oBAAoB,CAAE,KAAM,CAAG;MAAAY,QAAA,EAE9C,IAAAQ,QAAE,EACH,gFACD;IAAC,CACa,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_data","_element","_blockEditor","_jsxRuntime","TemplateValidationNotice","showConfirmDialog","setShowConfirmDialog","useState","isValid","useSelect","select","blockEditorStore","isValidTemplate","setTemplateValidity","synchronizeTemplate","useDispatch","jsxs","Fragment","children","jsx","Notice","className","isDismissible","status","actions","label","__","onClick","__experimentalConfirmDialog","isOpen","confirmButtonText","onConfirm","onCancel","size"],"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tNotice,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function TemplateValidationNotice() {\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\tconst isValid = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).isValidTemplate();\n\t}, [] );\n\tconst { setTemplateValidity, synchronizeTemplate } =\n\t\tuseDispatch( blockEditorStore );\n\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Notice\n\t\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\t\tisDismissible={ false }\n\t\t\t\tstatus=\"warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\t\tonClick: () => setTemplateValidity( true ),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\t\tonClick: () => setShowConfirmDialog( true ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t\t) }\n\t\t\t</Notice>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tconfirmButtonText={ __( 'Reset' ) }\n\t\t\t\tonConfirm={ () => {\n\t\t\t\t\tsetShowConfirmDialog( false );\n\t\t\t\t\tsynchronizeTemplate();\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t\tsize=\"medium\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t) }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAAoE,IAAAK,WAAA,GAAAL,OAAA;AAVpE;AACA;AACA;;AAUe,SAASM,wBAAwBA,CAAA,EAAG;EAClD,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACrE,MAAMC,OAAO,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxC,OAAOA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,eAAe,CAAC,CAAC;EACpD,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,GACjD,IAAAC,iBAAW,EAAEJ,kBAAiB,CAAC;EAEhC,IAAKH,OAAO,EAAG;IACd,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAL,WAAA,CAAAa,IAAA,EAAAb,WAAA,CAAAc,QAAA;IAAAC,QAAA,gBACC,IAAAf,WAAA,CAAAgB,GAAA,EAACtB,WAAA,CAAAuB,MAAM;MACNC,SAAS,EAAC,mCAAmC;MAC7CC,aAAa,EAAG,KAAO;MACvBC,MAAM,EAAC,SAAS;MAChBC,OAAO,EAAG,CACT;QACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;QAC5BC,OAAO,EAAEA,CAAA,KAAMd,mBAAmB,CAAE,IAAK;MAC1C,CAAC,EACD;QACCY,KAAK,EAAE,IAAAC,QAAE,EAAE,oBAAqB,CAAC;QACjCC,OAAO,EAAEA,CAAA,KAAMrB,oBAAoB,CAAE,IAAK;MAC3C,CAAC,CACC;MAAAY,QAAA,EAED,IAAAQ,QAAE,EACH,iFACD;IAAC,CACM,CAAC,eACT,IAAAvB,WAAA,CAAAgB,GAAA,EAACtB,WAAA,CAAA+B,2BAAa;MACbC,MAAM,EAAGxB,iBAAmB;MAC5ByB,iBAAiB,EAAG,IAAAJ,QAAE,EAAE,OAAQ,CAAG;MACnCK,SAAS,EAAGA,CAAA,KAAM;QACjBzB,oBAAoB,CAAE,KAAM,CAAC;QAC7BQ,mBAAmB,CAAC,CAAC;MACtB,CAAG;MACHkB,QAAQ,EAAGA,CAAA,KAAM1B,oBAAoB,CAAE,KAAM,CAAG;MAChD2B,IAAI,EAAC,QAAQ;MAAAf,QAAA,EAEX,IAAAQ,QAAE,EACH,gFACD;IAAC,CACa,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
@@ -15,6 +15,15 @@ var _store = require("../../store");
15
15
  * Internal dependencies
16
16
  */
17
17
 
18
+ /**
19
+ * Checks if the current theme supports specific features and renders the children if supported.
20
+ *
21
+ * @param {Object} props The component props.
22
+ * @param {Element} props.children The children to render if the theme supports the specified features.
23
+ * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
24
+ *
25
+ * @return {JSX.Element|null} The rendered children if the theme supports the specified features, otherwise null.
26
+ */
18
27
  function ThemeSupportCheck({
19
28
  children,
20
29
  supportKeys