@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":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","select","getRenderingMode","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","editorSettings","selection","isReady","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","kind","value","useSubRegistry","__unstableIsPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst mode = useSelect(\n\t\t\t( select ) => select( editorStore ).getRenderingMode(),\n\t\t\t[]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext =\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t\t\t? { postId: post.id, postType: post.type }\n\t\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {JSX.Element} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":"A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B,IAAE,CAAC,eACxBK,IAAA,CAACH,kBAAkB,IAAE,CAAC,eACtBG,IAAA,CAACF,qBAAqB,IAAE,CAAC;UAAA,CACxB,CACF;QAAA,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyE,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACCxE,IAAA,CAAC2B,0BAA0B;IAAA,GACrB6C,KAAK;IACVxC,4BAA4B,EAAGzD,mBAAqB;IAAAwD,QAAA,EAElDyC,KAAK,CAACzC;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAewC,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","editorSettings","selection","isReady","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","kind","value","useSubRegistry","__unstableIsPreviewMode","EditorProvider","props"],"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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC3E,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,WAAW,IAAII,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAClD,OAA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CACW,CAAC;AAE/B;AAEA,eAAewC,cAAc","ignoreList":[]}
@@ -30,6 +30,7 @@ import PostsPerPage from '../posts-per-page';
30
30
  import SiteDiscussion from '../site-discussion';
31
31
  import { store as editorStore } from '../../store';
32
32
  import TemplateAreas from '../template-areas';
33
+ import { PrivatePostLastRevision } from '../post-last-revision';
33
34
 
34
35
  /**
35
36
  * Module Constants
@@ -71,10 +72,10 @@ export default function PostSummary({
71
72
  spacing: 1,
72
73
  children: [/*#__PURE__*/_jsx(PostContentInformation, {}), /*#__PURE__*/_jsx(PostLastEditedPanel, {})]
73
74
  }), !isRemovedPostStatusPanel && /*#__PURE__*/_jsxs(VStack, {
74
- spacing: 2,
75
+ spacing: 4,
75
76
  children: [/*#__PURE__*/_jsxs(VStack, {
76
77
  spacing: 1,
77
- children: [/*#__PURE__*/_jsx(PostStatusPanel, {}), /*#__PURE__*/_jsx(PostSchedulePanel, {}), /*#__PURE__*/_jsx(PostURLPanel, {}), /*#__PURE__*/_jsx(PostAuthorPanel, {}), /*#__PURE__*/_jsx(PostTemplatePanel, {}), /*#__PURE__*/_jsx(PostDiscussionPanel, {}), /*#__PURE__*/_jsx(PageAttributesPanel, {}), /*#__PURE__*/_jsx(PostSyncStatus, {}), /*#__PURE__*/_jsx(BlogTitle, {}), /*#__PURE__*/_jsx(PostsPerPage, {}), /*#__PURE__*/_jsx(SiteDiscussion, {}), /*#__PURE__*/_jsx(PostFormatPanel, {}), /*#__PURE__*/_jsx(PostStickyPanel, {})]
78
+ children: [/*#__PURE__*/_jsx(PostStatusPanel, {}), /*#__PURE__*/_jsx(PostSchedulePanel, {}), /*#__PURE__*/_jsx(PostURLPanel, {}), /*#__PURE__*/_jsx(PostAuthorPanel, {}), /*#__PURE__*/_jsx(PostTemplatePanel, {}), /*#__PURE__*/_jsx(PostDiscussionPanel, {}), /*#__PURE__*/_jsx(PrivatePostLastRevision, {}), /*#__PURE__*/_jsx(PageAttributesPanel, {}), /*#__PURE__*/_jsx(PostSyncStatus, {}), /*#__PURE__*/_jsx(BlogTitle, {}), /*#__PURE__*/_jsx(PostsPerPage, {}), /*#__PURE__*/_jsx(SiteDiscussion, {}), /*#__PURE__*/_jsx(PostFormatPanel, {}), /*#__PURE__*/_jsx(PostStickyPanel, {})]
78
79
  }), /*#__PURE__*/_jsx(TemplateAreas, {}), fills]
79
80
  })]
80
81
  })
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalVStack","VStack","useSelect","PluginPostStatusInfo","PostActions","PostAuthorPanel","PostCardPanel","PostContentInformation","PageAttributesPanel","PostDiscussionPanel","PrivatePostExcerptPanel","PostExcerptPanel","PostFeaturedImagePanel","PostFormatPanel","PostLastEditedPanel","PostPanelSection","PostSchedulePanel","PostStatusPanel","PostStickyPanel","PostSyncStatus","PostTemplatePanel","PostURLPanel","BlogTitle","PostsPerPage","SiteDiscussion","store","editorStore","TemplateAreas","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PANEL_NAME","PostSummary","onActionPerformed","isRemovedPostStatusPanel","select","isEditorPanelRemoved","getCurrentPostType","postType","className","children","Slot","fills","spacing","actions","withPanelBody"],"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":"AAAA;AACA;AACA;AACA,SAASA,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,eAAe,MAAM,sBAAsB;AAClD,OAAOC,aAAa,MAAM,oBAAoB;AAC9C,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,uBAAuB,IAAIC,gBAAg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,CACM;MAAC,CACR;IACF,CACyB;EAAC,CACX,CAAC;AAErB","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalVStack","VStack","useSelect","PluginPostStatusInfo","PostActions","PostAuthorPanel","PostCardPanel","PostContentInformation","PageAttributesPanel","PostDiscussionPanel","PrivatePostExcerptPanel","PostExcerptPanel","PostFeaturedImagePanel","PostFormatPanel","PostLastEditedPanel","PostPanelSection","PostSchedulePanel","PostStatusPanel","PostStickyPanel","PostSyncStatus","PostTemplatePanel","PostURLPanel","BlogTitle","PostsPerPage","SiteDiscussion","store","editorStore","TemplateAreas","PrivatePostLastRevision","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PANEL_NAME","PostSummary","onActionPerformed","isRemovedPostStatusPanel","select","isEditorPanelRemoved","getCurrentPostType","postType","className","children","Slot","fills","spacing","actions","withPanelBody"],"sources":["@wordpress/editor/src/components/sidebar/post-summary.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostActions from '../post-actions';\nimport PostAuthorPanel from '../post-author/panel';\nimport PostCardPanel from '../post-card-panel';\nimport PostContentInformation from '../post-content-information';\nimport PageAttributesPanel from '../page-attributes/panel';\nimport PostDiscussionPanel from '../post-discussion/panel';\nimport { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';\nimport PostFeaturedImagePanel from '../post-featured-image/panel';\nimport PostFormatPanel from '../post-format/panel';\nimport PostLastEditedPanel from '../post-last-edited-panel';\nimport PostPanelSection from '../post-panel-section';\nimport PostSchedulePanel from '../post-schedule/panel';\nimport PostStatusPanel from '../post-status';\nimport PostStickyPanel from '../post-sticky';\nimport PostSyncStatus from '../post-sync-status';\nimport PostTemplatePanel from '../post-template/panel';\nimport PostURLPanel from '../post-url/panel';\nimport BlogTitle from '../blog-title';\nimport PostsPerPage from '../posts-per-page';\nimport SiteDiscussion from '../site-discussion';\nimport { store as editorStore } from '../../store';\nimport TemplateAreas from '../template-areas';\nimport { PrivatePostLastRevision } from '../post-last-revision';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel } = useSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImagePanel withPanelBody={ false } />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t\t\t\t<PrivatePostLastRevision />\n\t\t\t\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t\t\t\t\t<BlogTitle />\n\t\t\t\t\t\t\t\t\t\t<PostsPerPage />\n\t\t\t\t\t\t\t\t\t\t<SiteDiscussion />\n\t\t\t\t\t\t\t\t\t\t<PostFormatPanel />\n\t\t\t\t\t\t\t\t\t\t<PostStickyPanel />\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<TemplateAreas />\n\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PostPanelSection>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,eAAe,MAAM,sBAAsB;AAClD,OAAOC,aAAa,MAAM,oBAAoB;AAC9C,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,uBAAuB,IAAIC,gBAAgB,QAAQ,uBAAuB;AACnF,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,OAAOC,eAAe,MAAM,sBAAsB;AA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,CACR;IACF,CACyB;EAAC,CACX,CAAC;AAErB","ignoreList":[]}
@@ -48,5 +48,16 @@ function TableOfContents({
48
48
  })
49
49
  });
50
50
  }
51
+
52
+ /**
53
+ * Renders a table of contents component.
54
+ *
55
+ * @param {Object} props The component props.
56
+ * @param {boolean} props.hasOutlineItemsDisabled Whether outline items are disabled.
57
+ * @param {boolean} props.repositionDropdown Whether to reposition the dropdown.
58
+ * @param {Element.ref} ref The component's ref.
59
+ *
60
+ * @return {JSX.Element} The rendered table of contents component.
61
+ */
51
62
  export default forwardRef(TableOfContents);
52
63
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","jsx","_jsx","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","onClick","undefined","icon","label","tooltipPosition","renderContent","onClose","onRequestClose"],"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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,SAASC,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAGb,SAAS,CACxBc,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEV,gBAAiB,CAAC,CAACW,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,oBACCR,IAAA,CAACT,QAAQ;IACRkB,YAAY,EAAG;MACdC,SAAS,EAAEP,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHQ,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpCf,IAAA,CAACR,MAAM;MAAA,GACDY,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXW,OAAO,EAAGV,SAAS,GAAGS,QAAQ,GAAGE,SAAW;MAC5CC,IAAI,EAAGxB,IAAM;MACb,iBAAgBoB,MAAQ;MACxB,iBAAc;MACd;MACAK,KAAK,EAAG7B,EAAE,CAAE,SAAU,CAAG;MACzB8B,eAAe,EAAC,QAAQ;MACxB,iBAAgB,CAAEd;IAAW,CAC7B,CACC;IACHe,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,kBAC5BtB,IAAA,CAACF,oBAAoB;MACpByB,cAAc,EAAGD,OAAS;MAC1BpB,uBAAuB,EAAGA;IAAyB,CACnD;EACC,CACH,CAAC;AAEJ;AAEA,eAAeP,UAAU,CAAEM,eAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","jsx","_jsx","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","onClick","undefined","icon","label","tooltipPosition","renderContent","onClose","onRequestClose"],"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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,SAASC,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAGb,SAAS,CACxBc,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEV,gBAAiB,CAAC,CAACW,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,oBACCR,IAAA,CAACT,QAAQ;IACRkB,YAAY,EAAG;MACdC,SAAS,EAAEP,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHQ,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpCf,IAAA,CAACR,MAAM;MAAA,GACDY,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXW,OAAO,EAAGV,SAAS,GAAGS,QAAQ,GAAGE,SAAW;MAC5CC,IAAI,EAAGxB,IAAM;MACb,iBAAgBoB,MAAQ;MACxB,iBAAc;MACd;MACAK,KAAK,EAAG7B,EAAE,CAAE,SAAU,CAAG;MACzB8B,eAAe,EAAC,QAAQ;MACxB,iBAAgB,CAAEd;IAAW,CAC7B,CACC;IACHe,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,kBAC5BtB,IAAA,CAACF,oBAAoB;MACpByB,cAAc,EAAGD,OAAS;MAC1BpB,uBAAuB,EAAGA;IAAyB,CACnD;EACC,CACH,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeP,UAAU,CAAEM,eAAgB,CAAC","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { store as blockEditorStore } from '@wordpress/block-editor';
6
+ import { MenuItem } from '@wordpress/components';
7
+ import { __ } from '@wordpress/i18n';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ export default function ConvertToRegularBlocks({
10
+ clientId,
11
+ onClose
12
+ }) {
13
+ const {
14
+ getBlocks
15
+ } = useSelect(blockEditorStore);
16
+ const {
17
+ replaceBlocks
18
+ } = useDispatch(blockEditorStore);
19
+ const canRemove = useSelect(select => select(blockEditorStore).canRemoveBlock(clientId), [clientId]);
20
+ if (!canRemove) {
21
+ return null;
22
+ }
23
+ return /*#__PURE__*/_jsx(MenuItem, {
24
+ onClick: () => {
25
+ replaceBlocks(clientId, getBlocks(clientId));
26
+ onClose();
27
+ },
28
+ children: __('Detach')
29
+ });
30
+ }
31
+ //# sourceMappingURL=convert-to-regular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","useDispatch","store","blockEditorStore","MenuItem","__","jsx","_jsx","ConvertToRegularBlocks","clientId","onClose","getBlocks","replaceBlocks","canRemove","select","canRemoveBlock","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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,eAAe,SAASC,sBAAsBA,CAAE;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EACvE,MAAM;IAAEC;EAAU,CAAC,GAAGX,SAAS,CAAEG,gBAAiB,CAAC;EACnD,MAAM;IAAES;EAAc,CAAC,GAAGX,WAAW,CAAEE,gBAAiB,CAAC;EAEzD,MAAMU,SAAS,GAAGb,SAAS,CACxBc,MAAM,IAAMA,MAAM,CAAEX,gBAAiB,CAAC,CAACY,cAAc,CAAEN,QAAS,CAAC,EACnE,CAAEA,QAAQ,CACX,CAAC;EAED,IAAK,CAAEI,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,oBACCN,IAAA,CAACH,QAAQ;IACRY,OAAO,EAAGA,CAAA,KAAM;MACfJ,aAAa,CAAEH,QAAQ,EAAEE,SAAS,CAAEF,QAAS,CAAE,CAAC;MAChDC,OAAO,CAAC,CAAC;IACV,CAAG;IAAAO,QAAA,EAEDZ,EAAE,CAAE,QAAS;EAAC,CACP,CAAC;AAEb","ignoreList":[]}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useDispatch, useSelect } from '@wordpress/data';
5
+ import { store as blockEditorStore } from '@wordpress/block-editor';
6
+ import { MenuItem } from '@wordpress/components';
7
+ import { createBlock } from '@wordpress/blocks';
8
+ import { __ } from '@wordpress/i18n';
9
+ import { useState } from '@wordpress/element';
10
+ import { store as noticesStore } from '@wordpress/notices';
11
+ import { symbolFilled } from '@wordpress/icons';
12
+
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+ import CreateTemplatePartModal from '../create-template-part-modal';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { Fragment as _Fragment } from "react/jsx-runtime";
19
+ import { jsxs as _jsxs } from "react/jsx-runtime";
20
+ export default function ConvertToTemplatePart({
21
+ clientIds,
22
+ blocks
23
+ }) {
24
+ const [isModalOpen, setIsModalOpen] = useState(false);
25
+ const {
26
+ replaceBlocks
27
+ } = useDispatch(blockEditorStore);
28
+ const {
29
+ createSuccessNotice
30
+ } = useDispatch(noticesStore);
31
+ const {
32
+ canCreate
33
+ } = useSelect(select => {
34
+ return {
35
+ canCreate: select(blockEditorStore).canInsertBlockType('core/template-part')
36
+ };
37
+ }, []);
38
+ if (!canCreate) {
39
+ return null;
40
+ }
41
+ const onConvert = async templatePart => {
42
+ replaceBlocks(clientIds, createBlock('core/template-part', {
43
+ slug: templatePart.slug,
44
+ theme: templatePart.theme
45
+ }));
46
+ createSuccessNotice(__('Template part created.'), {
47
+ type: 'snackbar'
48
+ });
49
+
50
+ // The modal and this component will be unmounted because of `replaceBlocks` above,
51
+ // so no need to call `closeModal` or `onClose`.
52
+ };
53
+ return /*#__PURE__*/_jsxs(_Fragment, {
54
+ children: [/*#__PURE__*/_jsx(MenuItem, {
55
+ icon: symbolFilled,
56
+ onClick: () => {
57
+ setIsModalOpen(true);
58
+ },
59
+ "aria-expanded": isModalOpen,
60
+ "aria-haspopup": "dialog",
61
+ children: __('Create template part')
62
+ }), isModalOpen && /*#__PURE__*/_jsx(CreateTemplatePartModal, {
63
+ closeModal: () => {
64
+ setIsModalOpen(false);
65
+ },
66
+ blocks: blocks,
67
+ onCreate: onConvert
68
+ })]
69
+ });
70
+ }
71
+ //# sourceMappingURL=convert-to-template-part.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useDispatch","useSelect","store","blockEditorStore","MenuItem","createBlock","__","useState","noticesStore","symbolFilled","CreateTemplatePartModal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ConvertToTemplatePart","clientIds","blocks","isModalOpen","setIsModalOpen","replaceBlocks","createSuccessNotice","canCreate","select","canInsertBlockType","onConvert","templatePart","slug","theme","type","children","icon","onClick","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":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEpE,eAAe,SAASC,qBAAqBA,CAAE;EAAEC,SAAS;EAAEC;AAAO,CAAC,EAAG;EACtE,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAGd,QAAQ,CAAE,KAAM,CAAC;EACzD,MAAM;IAAEe;EAAc,CAAC,GAAGtB,WAAW,CAAEG,gBAAiB,CAAC;EACzD,MAAM;IAAEoB;EAAoB,CAAC,GAAGvB,WAAW,CAAEQ,YAAa,CAAC;EAE3D,MAAM;IAAEgB;EAAU,CAAC,GAAGvB,SAAS,CAAIwB,MAAM,IAAM;IAC9C,OAAO;MACND,SAAS,EACRC,MAAM,CAAEtB,gBAAiB,CAAC,CAACuB,kBAAkB,CAC5C,oBACD;IACF,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEF,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMG,SAAS,GAAG,MAAQC,YAAY,IAAM;IAC3CN,aAAa,CACZJ,SAAS,EACTb,WAAW,CAAE,oBAAoB,EAAE;MAClCwB,IAAI,EAAED,YAAY,CAACC,IAAI;MACvBC,KAAK,EAAEF,YAAY,CAACE;IACrB,CAAE,CACH,CAAC;IACDP,mBAAmB,CAAEjB,EAAE,CAAE,wBAAyB,CAAC,EAAE;MACpDyB,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;EACD,CAAC;EAED,oBACCf,KAAA,CAAAF,SAAA;IAAAkB,QAAA,gBACCpB,IAAA,CAACR,QAAQ;MACR6B,IAAI,EAAGxB,YAAc;MACrByB,OAAO,EAAGA,CAAA,KAAM;QACfb,cAAc,CAAE,IAAK,CAAC;MACvB,CAAG;MACH,iBAAgBD,WAAa;MAC7B,iBAAc,QAAQ;MAAAY,QAAA,EAEpB1B,EAAE,CAAE,sBAAuB;IAAC,CACrB,CAAC,EACTc,WAAW,iBACZR,IAAA,CAACF,uBAAuB;MACvByB,UAAU,EAAGA,CAAA,KAAM;QAClBd,cAAc,CAAE,KAAM,CAAC;MACxB,CAAG;MACHF,MAAM,EAAGA,MAAQ;MACjBiB,QAAQ,EAAGT;IAAW,CACtB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect } from '@wordpress/data';
5
+ import { BlockSettingsMenuControls, store as blockEditorStore } from '@wordpress/block-editor';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import ConvertToRegularBlocks from './convert-to-regular';
11
+ import ConvertToTemplatePart from './convert-to-template-part';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ export default function TemplatePartMenuItems() {
14
+ return /*#__PURE__*/_jsx(BlockSettingsMenuControls, {
15
+ children: ({
16
+ selectedClientIds,
17
+ onClose
18
+ }) => /*#__PURE__*/_jsx(TemplatePartConverterMenuItem, {
19
+ clientIds: selectedClientIds,
20
+ onClose: onClose
21
+ })
22
+ });
23
+ }
24
+ function TemplatePartConverterMenuItem({
25
+ clientIds,
26
+ onClose
27
+ }) {
28
+ const {
29
+ isContentOnly,
30
+ blocks
31
+ } = useSelect(select => {
32
+ const {
33
+ getBlocksByClientId,
34
+ getBlockEditingMode
35
+ } = select(blockEditorStore);
36
+ return {
37
+ blocks: getBlocksByClientId(clientIds),
38
+ isContentOnly: clientIds.length === 1 && getBlockEditingMode(clientIds[0]) === 'contentOnly'
39
+ };
40
+ }, [clientIds]);
41
+
42
+ // Do not show the convert button if the block is in content-only mode.
43
+ if (isContentOnly) {
44
+ return null;
45
+ }
46
+
47
+ // Allow converting a single template part to standard blocks.
48
+ if (blocks.length === 1 && blocks[0]?.name === 'core/template-part') {
49
+ return /*#__PURE__*/_jsx(ConvertToRegularBlocks, {
50
+ clientId: clientIds[0],
51
+ onClose: onClose
52
+ });
53
+ }
54
+ return /*#__PURE__*/_jsx(ConvertToTemplatePart, {
55
+ clientIds: clientIds,
56
+ blocks: blocks
57
+ });
58
+ }
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","BlockSettingsMenuControls","store","blockEditorStore","ConvertToRegularBlocks","ConvertToTemplatePart","jsx","_jsx","TemplatePartMenuItems","children","selectedClientIds","onClose","TemplatePartConverterMenuItem","clientIds","isContentOnly","blocks","select","getBlocksByClientId","getBlockEditingMode","length","name","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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,yBAAyB,EACzBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;;AAEhC;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,sBAAsB;AACzD,OAAOC,qBAAqB,MAAM,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/D,eAAe,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,oBACCD,IAAA,CAACN,yBAAyB;IAAAQ,QAAA,EACvBA,CAAE;MAAEC,iBAAiB;MAAEC;IAAQ,CAAC,kBACjCJ,IAAA,CAACK,6BAA6B;MAC7BC,SAAS,EAAGH,iBAAmB;MAC/BC,OAAO,EAAGA;IAAS,CACnB;EACD,CACyB,CAAC;AAE9B;AAEA,SAASC,6BAA6BA,CAAE;EAAEC,SAAS;EAAEF;AAAQ,CAAC,EAAG;EAChE,MAAM;IAAEG,aAAa;IAAEC;EAAO,CAAC,GAAGf,SAAS,CACxCgB,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAoB,CAAC,GACjDF,MAAM,CAAEb,gBAAiB,CAAC;IAC3B,OAAO;MACNY,MAAM,EAAEE,mBAAmB,CAAEJ,SAAU,CAAC;MACxCC,aAAa,EACZD,SAAS,CAACM,MAAM,KAAK,CAAC,IACtBD,mBAAmB,CAAEL,SAAS,CAAE,CAAC,CAAG,CAAC,KAAK;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;;EAED;EACA,IAAKC,aAAa,EAAG;IACpB,OAAO,IAAI;EACZ;;EAEA;EACA,IAAKC,MAAM,CAACI,MAAM,KAAK,CAAC,IAAIJ,MAAM,CAAE,CAAC,CAAE,EAAEK,IAAI,KAAK,oBAAoB,EAAG;IACxE,oBACCb,IAAA,CAACH,sBAAsB;MACtBiB,QAAQ,EAAGR,SAAS,CAAE,CAAC,CAAI;MAC3BF,OAAO,EAAGA;IAAS,CACnB,CAAC;EAEJ;EACA,oBAAOJ,IAAA,CAACF,qBAAqB;IAACQ,SAAS,EAAGA,SAAW;IAACE,MAAM,EAAGA;EAAQ,CAAE,CAAC;AAC3E","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export default function TemplatePartMenuItems() {
2
+ return null;
3
+ }
4
+ //# 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":"AAAA,eAAe,SAASA,qBAAqBA,CAAA,EAAG;EAC/C,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -42,6 +42,7 @@ export default function TemplateValidationNotice() {
42
42
  synchronizeTemplate();
43
43
  },
44
44
  onCancel: () => setShowConfirmDialog(false),
45
+ size: "medium",
45
46
  children: __('Resetting the template may result in loss of content, do you want to continue?')
46
47
  })]
47
48
  });
@@ -1 +1 @@
1
- {"version":3,"names":["Notice","__experimentalConfirmDialog","ConfirmDialog","__","useDispatch","useSelect","useState","store","blockEditorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TemplateValidationNotice","showConfirmDialog","setShowConfirmDialog","isValid","select","isValidTemplate","setTemplateValidity","synchronizeTemplate","children","className","isDismissible","status","actions","label","onClick","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":"AAAA;AACA;AACA;AACA,SACCA,MAAM,EACNC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEpE,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAGX,QAAQ,CAAE,KAAM,CAAC;EACrE,MAAMY,OAAO,GAAGb,SAAS,CAAIc,MAAM,IAAM;IACxC,OAAOA,MAAM,CAAEX,gBAAiB,CAAC,CAACY,eAAe,CAAC,CAAC;EACpD,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,GACjDlB,WAAW,CAAEI,gBAAiB,CAAC;EAEhC,IAAKU,OAAO,EAAG;IACd,OAAO,IAAI;EACZ;EAEA,oBACCJ,KAAA,CAAAF,SAAA;IAAAW,QAAA,gBACCb,IAAA,CAACV,MAAM;MACNwB,SAAS,EAAC,mCAAmC;MAC7CC,aAAa,EAAG,KAAO;MACvBC,MAAM,EAAC,SAAS;MAChBC,OAAO,EAAG,CACT;QACCC,KAAK,EAAEzB,EAAE,CAAE,eAAgB,CAAC;QAC5B0B,OAAO,EAAEA,CAAA,KAAMR,mBAAmB,CAAE,IAAK;MAC1C,CAAC,EACD;QACCO,KAAK,EAAEzB,EAAE,CAAE,oBAAqB,CAAC;QACjC0B,OAAO,EAAEA,CAAA,KAAMZ,oBAAoB,CAAE,IAAK;MAC3C,CAAC,CACC;MAAAM,QAAA,EAEDpB,EAAE,CACH,iFACD;IAAC,CACM,CAAC,eACTO,IAAA,CAACR,aAAa;MACb4B,MAAM,EAAGd,iBAAmB;MAC5Be,iBAAiB,EAAG5B,EAAE,CAAE,OAAQ,CAAG;MACnC6B,SAAS,EAAGA,CAAA,KAAM;QACjBf,oBAAoB,CAAE,KAAM,CAAC;QAC7BK,mBAAmB,CAAC,CAAC;MACtB,CAAG;MACHW,QAAQ,EAAGA,CAAA,KAAMhB,oBAAoB,CAAE,KAAM,CAAG;MAAAM,QAAA,EAE9CpB,EAAE,CACH,gFACD;IAAC,CACa,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["Notice","__experimentalConfirmDialog","ConfirmDialog","__","useDispatch","useSelect","useState","store","blockEditorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TemplateValidationNotice","showConfirmDialog","setShowConfirmDialog","isValid","select","isValidTemplate","setTemplateValidity","synchronizeTemplate","children","className","isDismissible","status","actions","label","onClick","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\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B,CAAE,IAAK;MAC3C,CAAC,CACC;MAAAM,QAAA,EAEDpB,EAAE,CACH,iFACD;IAAC,CACM,CAAC,eACTO,IAAA,CAACR,aAAa;MACb4B,MAAM,EAAGd,iBAAmB;MAC5Be,iBAAiB,EAAG5B,EAAE,CAAE,OAAQ,CAAG;MACnC6B,SAAS,EAAGA,CAAA,KAAM;QACjBf,oBAAoB,CAAE,KAAM,CAAC;QAC7BK,mBAAmB,CAAC,CAAC;MACtB,CAAG;MACHW,QAAQ,EAAGA,CAAA,KAAMhB,oBAAoB,CAAE,KAAM,CAAG;MAChDiB,IAAI,EAAC,QAAQ;MAAAX,QAAA,EAEXpB,EAAE,CACH,gFACD;IAAC,CACa,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
@@ -8,6 +8,16 @@ import { store as coreStore } from '@wordpress/core-data';
8
8
  * Internal dependencies
9
9
  */
10
10
  import { store as editorStore } from '../../store';
11
+
12
+ /**
13
+ * Checks if the current theme supports specific features and renders the children if supported.
14
+ *
15
+ * @param {Object} props The component props.
16
+ * @param {Element} props.children The children to render if the theme supports the specified features.
17
+ * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
18
+ *
19
+ * @return {JSX.Element|null} The rendered children if the theme supports the specified features, otherwise null.
20
+ */
11
21
  export default function ThemeSupportCheck({
12
22
  children,
13
23
  supportKeys
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","editorStore","ThemeSupportCheck","children","supportKeys","postType","themeSupports","select","getEditedPostAttribute","getThemeSupports","isSupported","Array","isArray","some","key","_themeSupports$key","supported","includes"],"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function ThemeSupportCheck( { children, supportKeys } ) {\n\tconst { postType, themeSupports } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t\t\tthemeSupports: select( coreStore ).getThemeSupports(),\n\t\t};\n\t}, [] );\n\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EACtE,MAAM;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC5D,OAAO;MACNF,QAAQ,EAAEE,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,MAAO,CAAC;MAChEF,aAAa,EAAEC,MAAM,CAAEP,SAAU,CAAC,CAACS,gBAAgB,CAAC;IACrD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAO,CAAER,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DS,IAAI,CAAIC,GAAG,IAAM;IAAA,IAAAC,kBAAA;IAClB,MAAMC,SAAS,IAAAD,kBAAA,GAAGT,aAAa,GAAIQ,GAAG,CAAE,cAAAC,kBAAA,cAAAA,kBAAA,GAAI,KAAK;IACjD;IACA;IACA;IACA;IACA,IAAK,iBAAiB,KAAKD,GAAG,IAAIH,KAAK,CAACC,OAAO,CAAEI,SAAU,CAAC,EAAG;MAC9D,OAAOA,SAAS,CAACC,QAAQ,CAAEZ,QAAS,CAAC;IACtC;IACA,OAAOW,SAAS;EACjB,CAAE,CAAC;EAEH,IAAK,CAAEN,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOP,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","coreStore","editorStore","ThemeSupportCheck","children","supportKeys","postType","themeSupports","select","getEditedPostAttribute","getThemeSupports","isSupported","Array","isArray","some","key","_themeSupports$key","supported","includes"],"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Checks if the current theme supports specific features and renders the children if supported.\n *\n * @param {Object} props The component props.\n * @param {Element} props.children The children to render if the theme supports the specified features.\n * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.\n *\n * @return {JSX.Element|null} The rendered children if the theme supports the specified features, otherwise null.\n */\nexport default function ThemeSupportCheck( { children, supportKeys } ) {\n\tconst { postType, themeSupports } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t\t\tthemeSupports: select( coreStore ).getThemeSupports(),\n\t\t};\n\t}, [] );\n\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EACtE,MAAM;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC5D,OAAO;MACNF,QAAQ,EAAEE,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,MAAO,CAAC;MAChEF,aAAa,EAAEC,MAAM,CAAEP,SAAU,CAAC,CAACS,gBAAgB,CAAC;IACrD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAO,CAAER,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DS,IAAI,CAAIC,GAAG,IAAM;IAAA,IAAAC,kBAAA;IAClB,MAAMC,SAAS,IAAAD,kBAAA,GAAGT,aAAa,GAAIQ,GAAG,CAAE,cAAAC,kBAAA,cAAAA,kBAAA,GAAI,KAAK;IACjD;IACA;IACA;IACA;IACA,IAAK,iBAAiB,KAAKD,GAAG,IAAIH,KAAK,CAACC,OAAO,CAAEI,SAAU,CAAC,EAAG;MAC9D,OAAOA,SAAS,CAACC,QAAQ,CAAEZ,QAAS,CAAC;IACtC;IACA,OAAOW,SAAS;EACjB,CAAE,CAAC;EAEH,IAAK,CAAEN,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOP,QAAQ;AAChB","ignoreList":[]}
@@ -20,6 +20,12 @@ import { store as editorStore } from '../../store';
20
20
  */
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const AVERAGE_READING_RATE = 189;
23
+
24
+ /**
25
+ * Component for showing Time To Read in Content.
26
+ *
27
+ * @return {JSX.Element} The rendered TimeToRead component.
28
+ */
23
29
  export default function TimeToRead() {
24
30
  const content = useSelect(select => select(editorStore).getEditedPostAttribute('content'), []);
25
31
 
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","jsx","_jsx","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","className","children"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s is the number of minutes the post will take to read. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%d</span> minute',\n\t\t\t\t\t\t\t'<span>%d</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,MAAMC,oBAAoB,GAAG,GAAG;AAEhC,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAGd,SAAS,CACtBe,MAAM,IAAMA,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGhB,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMiB,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/Bd,SAAS,CAAEQ,OAAO,EAAEG,aAAc,CAAC,GAAGL,oBACvC,CAAC;EACD,MAAMS,mBAAmB,GACxBH,aAAa,KAAK,CAAC,GAChBX,wBAAwB,CAAEJ,EAAE,CAAE,yBAA0B,CAAC,EAAE;IAC3DmB,IAAI,eAAEX,IAAA,WAAO;EACb,CAAE,CAAC,GACHJ,wBAAwB,CACxBH,OAAO,EACN;EACAF,EAAE,CACD,wBAAwB,EACxB,yBAAyB,EACzBgB,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCI,IAAI,eAAEX,IAAA,WAAO;EACd,CACA,CAAC;EAEL,oBAAOA,IAAA;IAAMY,SAAS,EAAC,cAAc;IAAAC,QAAA,EAAGH;EAAmB,CAAQ,CAAC;AACrE","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","jsx","_jsx","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","className","children"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\n/**\n * Component for showing Time To Read in Content.\n *\n * @return {JSX.Element} The rendered TimeToRead component.\n */\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s is the number of minutes the post will take to read. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%d</span> minute',\n\t\t\t\t\t\t\t'<span>%d</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,MAAMC,oBAAoB,GAAG,GAAG;;AAEhC;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAGd,SAAS,CACtBe,MAAM,IAAMA,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGhB,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMiB,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/Bd,SAAS,CAAEQ,OAAO,EAAEG,aAAc,CAAC,GAAGL,oBACvC,CAAC;EACD,MAAMS,mBAAmB,GACxBH,aAAa,KAAK,CAAC,GAChBX,wBAAwB,CAAEJ,EAAE,CAAE,yBAA0B,CAAC,EAAE;IAC3DmB,IAAI,eAAEX,IAAA,WAAO;EACb,CAAE,CAAC,GACHJ,wBAAwB,CACxBH,OAAO,EACN;EACAF,EAAE,CACD,wBAAwB,EACxB,yBAAyB,EACzBgB,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCI,IAAI,eAAEX,IAAA,WAAO;EACd,CACA,CAAC;EAEL,oBAAOA,IAAA;IAAMY,SAAS,EAAC,cAAc;IAAAC,QAAA,EAAGH;EAAmB,CAAQ,CAAC;AACrE","ignoreList":[]}
@@ -78,6 +78,7 @@ export default function EditTemplateBlocksNotification({
78
78
  });
79
79
  },
80
80
  onCancel: () => setIsDialogOpen(false),
81
+ size: "medium",
81
82
  children: __('You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?')
82
83
  });
83
84
  }
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","useEffect","useState","__","__experimentalConfirmDialog","ConfirmDialog","editorStore","jsx","_jsx","EditTemplateBlocksNotification","contentRef","onNavigateToEntityRecord","templateId","select","getEditorSettings","getCurrentTemplateId","canEditTemplate","_select$canUser","canUser","isDialogOpen","setIsDialogOpen","handleDblClick","event","target","classList","contains","canvas","current","addEventListener","removeEventListener","isOpen","confirmButtonText","onConfirm","postId","postType","onCancel","children"],"sources":["@wordpress/editor/src/components/visual-editor/edit-template-blocks-notification.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page conetnt and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst canEditTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false\n\t);\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! canEditTemplate ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsDialogOpen( true );\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ contentRef, canEditTemplate ] );\n\n\tif ( ! canEditTemplate ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?'\n\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;;AAEpF;AACA;AACA;AACA,SAASN,KAAK,IAAIO,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAbA,SAAAC,GAAA,IAAAC,IAAA;AAcA,eAAe,SAASC,8BAA8BA,CAAE;EAAEC;AAAW,CAAC,EAAG;EACxE,MAAM;IAAEC,wBAAwB;IAAEC;EAAW,CAAC,GAAGd,SAAS,CAAIe,MAAM,IAAM;IACzE,MAAM;MAAEC,iBAAiB;MAAEC;IAAqB,CAAC,GAChDF,MAAM,CAAEP,WAAY,CAAC;IAEtB,OAAO;MACNK,wBAAwB,EACvBG,iBAAiB,CAAC,CAAC,CAACH,wBAAwB;MAC7CC,UAAU,EAAEG,oBAAoB,CAAC;IAClC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,eAAe,GAAGlB,SAAS,CAC9Be,MAAM;IAAA,IAAAI,eAAA;IAAA,QAAAA,eAAA,GACPJ,MAAM,CAAEb,SAAU,CAAC,CAACkB,OAAO,CAAE,QAAQ,EAAE,WAAY,CAAC,cAAAD,eAAA,cAAAA,eAAA,GAAI,KAAK;EAAA,CAC/D,CAAC;EAED,MAAM,CAAEE,YAAY,EAAEC,eAAe,CAAE,GAAGlB,QAAQ,CAAE,KAAM,CAAC;EAE3DD,SAAS,CAAE,MAAM;IAChB,MAAMoB,cAAc,GAAKC,KAAK,IAAM;MACnC,IAAK,CAAEN,eAAe,EAAG;QACxB;MACD;MAEA,IAAK,CAAEM,KAAK,CAACC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAAE,mBAAoB,CAAC,EAAG;QAC/D;MACD;MACAL,eAAe,CAAE,IAAK,CAAC;IACxB,CAAC;IAED,MAAMM,MAAM,GAAGhB,UAAU,CAACiB,OAAO;IACjCD,MAAM,EAAEE,gBAAgB,CAAE,UAAU,EAAEP,cAAe,CAAC;IACtD,OAAO,MAAM;MACZK,MAAM,EAAEG,mBAAmB,CAAE,UAAU,EAAER,cAAe,CAAC;IAC1D,CAAC;EACF,CAAC,EAAE,CAAEX,UAAU,EAAEM,eAAe,CAAG,CAAC;EAEpC,IAAK,CAAEA,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACCR,IAAA,CAACH,aAAa;IACbyB,MAAM,EAAGX,YAAc;IACvBY,iBAAiB,EAAG5B,EAAE,CAAE,eAAgB,CAAG;IAC3C6B,SAAS,EAAGA,CAAA,KAAM;MACjBZ,eAAe,CAAE,KAAM,CAAC;MACxBT,wBAAwB,CAAE;QACzBsB,MAAM,EAAErB,UAAU;QAClBsB,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ,CAAG;IACHC,QAAQ,EAAGA,CAAA,KAAMf,eAAe,CAAE,KAAM,CAAG;IAAAgB,QAAA,EAEzCjC,EAAE,CACH,6IACD;EAAC,CACa,CAAC;AAElB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","coreStore","useEffect","useState","__","__experimentalConfirmDialog","ConfirmDialog","editorStore","jsx","_jsx","EditTemplateBlocksNotification","contentRef","onNavigateToEntityRecord","templateId","select","getEditorSettings","getCurrentTemplateId","canEditTemplate","_select$canUser","canUser","isDialogOpen","setIsDialogOpen","handleDblClick","event","target","classList","contains","canvas","current","addEventListener","removeEventListener","isOpen","confirmButtonText","onConfirm","postId","postType","onCancel","size","children"],"sources":["@wordpress/editor/src/components/visual-editor/edit-template-blocks-notification.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page conetnt and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst canEditTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false\n\t);\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! canEditTemplate ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsDialogOpen( true );\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ contentRef, canEditTemplate ] );\n\n\tif ( ! canEditTemplate ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?'\n\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;;AAEpF;AACA;AACA;AACA,SAASN,KAAK,IAAIO,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAbA,SAAAC,GAAA,IAAAC,IAAA;AAcA,eAAe,SAASC,8BAA8BA,CAAE;EAAEC;AAAW,CAAC,EAAG;EACxE,MAAM;IAAEC,wBAAwB;IAAEC;EAAW,CAAC,GAAGd,SAAS,CAAIe,MAAM,IAAM;IACzE,MAAM;MAAEC,iBAAiB;MAAEC;IAAqB,CAAC,GAChDF,MAAM,CAAEP,WAAY,CAAC;IAEtB,OAAO;MACNK,wBAAwB,EACv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C;IACJ,CAAG;IACHC,QAAQ,EAAGA,CAAA,KAAMf,eAAe,CAAE,KAAM,CAAG;IAC3CgB,IAAI,EAAC,QAAQ;IAAAC,QAAA,EAEXlC,EAAE,CACH,6IACD;EAAC,CACa,CAAC;AAElB","ignoreList":[]}
@@ -9,6 +9,12 @@ import { count as wordCount } from '@wordpress/wordcount';
9
9
  * Internal dependencies
10
10
  */
11
11
  import { store as editorStore } from '../../store';
12
+
13
+ /**
14
+ * Renders the word count of the post content.
15
+ *
16
+ * @return {JSX.Element|null} The rendered WordCount component.
17
+ */
12
18
  import { jsx as _jsx } from "react/jsx-runtime";
13
19
  export default function WordCount() {
14
20
  const content = useSelect(select => select(editorStore).getEditedPostAttribute('content'), []);
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","_x","count","wordCount","store","editorStore","jsx","_jsx","WordCount","content","select","getEditedPostAttribute","wordCountType","className","children"],"sources":["@wordpress/editor/src/components/word-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function WordCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,eAAe,SAASC,SAASA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGT,SAAS,CACtBU,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGX,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EAEzE,oBACCM,IAAA;IAAMM,SAAS,EAAC,YAAY;IAAAC,QAAA,EACzBX,SAAS,CAAEM,OAAO,EAAEG,aAAc;EAAC,CAChC,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","_x","count","wordCount","store","editorStore","jsx","_jsx","WordCount","content","select","getEditedPostAttribute","wordCountType","className","children"],"sources":["@wordpress/editor/src/components/word-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the word count of the post content.\n *\n * @return {JSX.Element|null} The rendered WordCount component.\n */\nexport default function WordCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,eAAe,SAASC,SAASA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGT,SAAS,CACtBU,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGX,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EAEzE,oBACCM,IAAA;IAAMM,SAAS,EAAC,YAAY;IAAAC,QAAA,EACzBX,SAAS,CAAEM,OAAO,EAAEG,aAAc;EAAC,CAChC,CAAC;AAET","ignoreList":[]}