@wordpress/editor 14.15.1 → 14.17.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 (215) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +20 -20
  3. package/build/bindings/pattern-overrides.js +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/components/collab-sidebar/index.js +1 -4
  6. package/build/components/collab-sidebar/index.js.map +1 -1
  7. package/build/components/document-outline/check.js +3 -3
  8. package/build/components/document-outline/check.js.map +1 -1
  9. package/build/components/document-outline/index.js +2 -2
  10. package/build/components/document-outline/index.js.map +1 -1
  11. package/build/components/header/index.js +14 -8
  12. package/build/components/header/index.js.map +1 -1
  13. package/build/components/page-attributes/check.js +3 -3
  14. package/build/components/page-attributes/check.js.map +1 -1
  15. package/build/components/post-excerpt/index.js +1 -1
  16. package/build/components/post-excerpt/index.js.map +1 -1
  17. package/build/components/post-pending-status/check.js +3 -3
  18. package/build/components/post-pending-status/check.js.map +1 -1
  19. package/build/components/post-preview-button/index.js +7 -1
  20. package/build/components/post-preview-button/index.js.map +1 -1
  21. package/build/components/post-publish-button/index.js +2 -2
  22. package/build/components/post-publish-button/index.js.map +1 -1
  23. package/build/components/post-publish-button/post-publish-button-or-toggle.js +1 -1
  24. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  25. package/build/components/post-schedule/check.js +3 -3
  26. package/build/components/post-schedule/check.js.map +1 -1
  27. package/build/components/post-schedule/index.js +1 -1
  28. package/build/components/post-schedule/index.js.map +1 -1
  29. package/build/components/post-sticky/check.js +3 -3
  30. package/build/components/post-sticky/check.js.map +1 -1
  31. package/build/components/post-taxonomies/check.js +1 -1
  32. package/build/components/post-taxonomies/check.js.map +1 -1
  33. package/build/components/post-template/swap-template-button.js +1 -1
  34. package/build/components/post-template/swap-template-button.js.map +1 -1
  35. package/build/components/post-trash/check.js +3 -3
  36. package/build/components/post-trash/check.js.map +1 -1
  37. package/build/components/post-type-support-check/index.js +6 -6
  38. package/build/components/post-type-support-check/index.js.map +1 -1
  39. package/build/components/post-url/check.js +3 -3
  40. package/build/components/post-url/check.js.map +1 -1
  41. package/build/components/preferences-modal/index.js +1 -1
  42. package/build/components/preferences-modal/index.js.map +1 -1
  43. package/build/components/provider/index.js +25 -17
  44. package/build/components/provider/index.js.map +1 -1
  45. package/build/components/sidebar/post-summary.js +1 -1
  46. package/build/components/sidebar/post-summary.js.map +1 -1
  47. package/build/components/start-page-options/index.js +15 -6
  48. package/build/components/start-page-options/index.js.map +1 -1
  49. package/build/components/theme-support-check/index.js +4 -4
  50. package/build/components/theme-support-check/index.js.map +1 -1
  51. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
  52. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  53. package/build/components/visual-editor/index.js +2 -2
  54. package/build/components/visual-editor/index.js.map +1 -1
  55. package/build/dataviews/fields/content-preview/content-preview-view.js +101 -0
  56. package/build/dataviews/fields/content-preview/content-preview-view.js.map +1 -0
  57. package/build/dataviews/fields/content-preview/index.js +26 -0
  58. package/build/dataviews/fields/content-preview/index.js.map +1 -0
  59. package/build/dataviews/store/private-actions.js +3 -1
  60. package/build/dataviews/store/private-actions.js.map +1 -1
  61. package/build/store/private-actions.js +1 -1
  62. package/build/store/private-actions.js.map +1 -1
  63. package/build/store/private-selectors.js +7 -1
  64. package/build/store/private-selectors.js.map +1 -1
  65. package/build/store/selectors.js +4 -4
  66. package/build/store/selectors.js.map +1 -1
  67. package/build-module/bindings/pattern-overrides.js +1 -1
  68. package/build-module/bindings/pattern-overrides.js.map +1 -1
  69. package/build-module/components/collab-sidebar/index.js +1 -4
  70. package/build-module/components/collab-sidebar/index.js.map +1 -1
  71. package/build-module/components/document-outline/check.js +3 -3
  72. package/build-module/components/document-outline/check.js.map +1 -1
  73. package/build-module/components/document-outline/index.js +2 -2
  74. package/build-module/components/document-outline/index.js.map +1 -1
  75. package/build-module/components/header/index.js +14 -8
  76. package/build-module/components/header/index.js.map +1 -1
  77. package/build-module/components/page-attributes/check.js +3 -3
  78. package/build-module/components/page-attributes/check.js.map +1 -1
  79. package/build-module/components/post-excerpt/index.js +1 -1
  80. package/build-module/components/post-excerpt/index.js.map +1 -1
  81. package/build-module/components/post-pending-status/check.js +3 -3
  82. package/build-module/components/post-pending-status/check.js.map +1 -1
  83. package/build-module/components/post-preview-button/index.js +7 -1
  84. package/build-module/components/post-preview-button/index.js.map +1 -1
  85. package/build-module/components/post-publish-button/index.js +2 -2
  86. package/build-module/components/post-publish-button/index.js.map +1 -1
  87. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +1 -1
  88. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  89. package/build-module/components/post-schedule/check.js +3 -3
  90. package/build-module/components/post-schedule/check.js.map +1 -1
  91. package/build-module/components/post-schedule/index.js +1 -1
  92. package/build-module/components/post-schedule/index.js.map +1 -1
  93. package/build-module/components/post-sticky/check.js +3 -3
  94. package/build-module/components/post-sticky/check.js.map +1 -1
  95. package/build-module/components/post-taxonomies/check.js +1 -1
  96. package/build-module/components/post-taxonomies/check.js.map +1 -1
  97. package/build-module/components/post-template/swap-template-button.js +1 -1
  98. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  99. package/build-module/components/post-trash/check.js +3 -3
  100. package/build-module/components/post-trash/check.js.map +1 -1
  101. package/build-module/components/post-type-support-check/index.js +6 -6
  102. package/build-module/components/post-type-support-check/index.js.map +1 -1
  103. package/build-module/components/post-url/check.js +3 -3
  104. package/build-module/components/post-url/check.js.map +1 -1
  105. package/build-module/components/preferences-modal/index.js +1 -1
  106. package/build-module/components/preferences-modal/index.js.map +1 -1
  107. package/build-module/components/provider/index.js +25 -17
  108. package/build-module/components/provider/index.js.map +1 -1
  109. package/build-module/components/sidebar/post-summary.js +1 -1
  110. package/build-module/components/sidebar/post-summary.js.map +1 -1
  111. package/build-module/components/start-page-options/index.js +15 -6
  112. package/build-module/components/start-page-options/index.js.map +1 -1
  113. package/build-module/components/theme-support-check/index.js +4 -4
  114. package/build-module/components/theme-support-check/index.js.map +1 -1
  115. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
  116. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  117. package/build-module/components/visual-editor/index.js +2 -2
  118. package/build-module/components/visual-editor/index.js.map +1 -1
  119. package/build-module/dataviews/fields/content-preview/content-preview-view.js +95 -0
  120. package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +1 -0
  121. package/build-module/dataviews/fields/content-preview/index.js +19 -0
  122. package/build-module/dataviews/fields/content-preview/index.js.map +1 -0
  123. package/build-module/dataviews/store/private-actions.js +2 -1
  124. package/build-module/dataviews/store/private-actions.js.map +1 -1
  125. package/build-module/store/private-actions.js +1 -1
  126. package/build-module/store/private-actions.js.map +1 -1
  127. package/build-module/store/private-selectors.js +7 -1
  128. package/build-module/store/private-selectors.js.map +1 -1
  129. package/build-module/store/selectors.js +4 -4
  130. package/build-module/store/selectors.js.map +1 -1
  131. package/build-style/style-rtl.css +35 -31
  132. package/build-style/style.css +35 -31
  133. package/build-types/components/autocompleters/user.d.ts +5 -1
  134. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  135. package/build-types/components/document-outline/check.d.ts +5 -5
  136. package/build-types/components/document-outline/check.d.ts.map +1 -1
  137. package/build-types/components/header/index.d.ts.map +1 -1
  138. package/build-types/components/page-attributes/check.d.ts +5 -5
  139. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  140. package/build-types/components/post-author/hook.d.ts +1 -1
  141. package/build-types/components/post-pending-status/check.d.ts +5 -5
  142. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  143. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  144. package/build-types/components/post-schedule/check.d.ts +5 -5
  145. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  146. package/build-types/components/post-sticky/check.d.ts +5 -5
  147. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  148. package/build-types/components/post-taxonomies/check.d.ts +2 -2
  149. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  150. package/build-types/components/post-taxonomies/index.d.ts +1 -1
  151. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  152. package/build-types/components/post-template/hooks.d.ts +1 -1
  153. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  154. package/build-types/components/post-trash/check.d.ts +5 -5
  155. package/build-types/components/post-trash/check.d.ts.map +1 -1
  156. package/build-types/components/post-type-support-check/index.d.ts +8 -8
  157. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  158. package/build-types/components/post-url/check.d.ts +5 -5
  159. package/build-types/components/post-url/check.d.ts.map +1 -1
  160. package/build-types/components/provider/index.d.ts +9 -9
  161. package/build-types/components/provider/index.d.ts.map +1 -1
  162. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  163. package/build-types/components/theme-support-check/index.d.ts +6 -6
  164. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  165. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +1 -1
  166. package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts +5 -0
  167. package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -0
  168. package/build-types/dataviews/fields/content-preview/index.d.ts +8 -0
  169. package/build-types/dataviews/fields/content-preview/index.d.ts.map +1 -0
  170. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  171. package/build-types/store/private-selectors.d.ts.map +1 -1
  172. package/build-types/store/selectors.d.ts +5 -5
  173. package/build-types/store/selectors.d.ts.map +1 -1
  174. package/package.json +37 -37
  175. package/src/bindings/pattern-overrides.js +1 -1
  176. package/src/components/autocompleters/style.scss +1 -1
  177. package/src/components/collab-sidebar/index.js +1 -4
  178. package/src/components/document-bar/style.scss +4 -2
  179. package/src/components/document-outline/check.js +3 -3
  180. package/src/components/document-outline/index.js +2 -2
  181. package/src/components/document-tools/style.scss +3 -2
  182. package/src/components/header/index.js +26 -23
  183. package/src/components/page-attributes/check.js +3 -3
  184. package/src/components/post-excerpt/index.js +1 -1
  185. package/src/components/post-featured-image/style.scss +4 -2
  186. package/src/components/post-pending-status/check.js +3 -3
  187. package/src/components/post-preview-button/index.js +5 -1
  188. package/src/components/post-publish-button/index.js +2 -2
  189. package/src/components/post-publish-button/post-publish-button-or-toggle.js +1 -1
  190. package/src/components/post-publish-panel/style.scss +5 -3
  191. package/src/components/post-schedule/check.js +3 -3
  192. package/src/components/post-schedule/index.js +1 -1
  193. package/src/components/post-sticky/check.js +3 -3
  194. package/src/components/post-taxonomies/check.js +1 -1
  195. package/src/components/post-template/swap-template-button.js +1 -1
  196. package/src/components/post-text-editor/style.scss +4 -2
  197. package/src/components/post-trash/check.js +3 -3
  198. package/src/components/post-type-support-check/index.js +6 -6
  199. package/src/components/post-url/check.js +3 -3
  200. package/src/components/preferences-modal/index.js +1 -1
  201. package/src/components/provider/index.js +32 -20
  202. package/src/components/sidebar/post-summary.js +1 -1
  203. package/src/components/start-page-options/index.js +20 -12
  204. package/src/components/theme-support-check/index.js +4 -4
  205. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -1
  206. package/src/components/visual-editor/index.js +2 -2
  207. package/src/dataviews/fields/content-preview/content-preview-view.tsx +108 -0
  208. package/src/dataviews/fields/content-preview/index.tsx +21 -0
  209. package/src/dataviews/fields/content-preview/style.scss +21 -0
  210. package/src/dataviews/store/private-actions.ts +4 -0
  211. package/src/store/private-actions.js +1 -1
  212. package/src/store/private-selectors.js +15 -8
  213. package/src/store/selectors.js +4 -4
  214. package/src/style.scss +1 -0
  215. package/tsconfig.tsbuildinfo +1 -1
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -47,6 +48,11 @@ const noop = () => {};
47
48
  */
48
49
  const NON_CONTEXTUAL_POST_TYPES = ['wp_block', 'wp_navigation', 'wp_template_part'];
49
50
 
51
+ /**
52
+ * These are rendering modes that the editor supports.
53
+ */
54
+ const RENDERING_MODES = ['post-only', 'template-locked'];
55
+
50
56
  /**
51
57
  * Depending on the post, template and template mode,
52
58
  * returns the appropriate blocks and change handlers for the block editor provider.
@@ -146,8 +152,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
146
152
  isReady,
147
153
  mode,
148
154
  defaultMode,
149
- postTypeEntities,
150
- hasLoadedPostObject
155
+ postTypeEntities
151
156
  } = useSelect(select => {
152
157
  const {
153
158
  getEditorSettings,
@@ -156,16 +161,19 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
156
161
  __unstableIsEditorReady
157
162
  } = select(editorStore);
158
163
  const {
159
- getEntitiesConfig
164
+ getEntitiesConfig,
165
+ getPostType,
166
+ hasFinishedResolution
160
167
  } = select(coreStore);
161
- const postTypeObject = select(coreStore).getPostType(post.type);
162
- const _hasLoadedPostObject = select(coreStore).hasFinishedResolution('getPostType', [post.type]);
168
+ const postTypeSupports = getPostType(post.type)?.supports;
169
+ const hasLoadedPostObject = hasFinishedResolution('getPostType', [post.type]);
170
+ const _defaultMode = Array.isArray(postTypeSupports?.editor) ? postTypeSupports.editor.find(features => 'default-mode' in features)?.['default-mode'] : undefined;
171
+ const hasDefaultMode = RENDERING_MODES.includes(_defaultMode);
163
172
  return {
164
- hasLoadedPostObject: _hasLoadedPostObject,
165
173
  editorSettings: getEditorSettings(),
166
- isReady: __unstableIsEditorReady(),
174
+ isReady: __unstableIsEditorReady() && hasLoadedPostObject,
167
175
  mode: getRenderingMode(),
168
- defaultMode: hasTemplate && postTypeObject?.default_rendering_mode ? postTypeObject?.default_rendering_mode : 'post-only',
176
+ defaultMode: hasTemplate && hasDefaultMode ? _defaultMode : 'post-only',
169
177
  selection: getEditorSelection(),
170
178
  postTypeEntities: post.type === 'wp_template' ? getEntitiesConfig('postType') : null
171
179
  };
@@ -261,7 +269,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
261
269
 
262
270
  // Register the editor commands.
263
271
  useCommands();
264
- if (!isReady || !mode || !hasLoadedPostObject) {
272
+ if (!isReady || !mode) {
265
273
  return null;
266
274
  }
267
275
  return /*#__PURE__*/_jsx(EntityProvider, {
@@ -297,14 +305,14 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
297
305
  *
298
306
  * All modification and changes are performed to the `@wordpress/core-data` store.
299
307
  *
300
- * @param {Object} props The component props.
301
- * @param {Object} [props.post] The post object to edit. This is required.
302
- * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.
303
- * This is optional and can only be used when the post type supports templates (like posts and pages).
304
- * @param {Object} [props.settings] The settings object to use for the editor.
305
- * This is optional and can be used to override the default settings.
306
- * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.
307
- * This is optional.
308
+ * @param {Object} props The component props.
309
+ * @param {Object} [props.post] The post object to edit. This is required.
310
+ * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.
311
+ * This is optional and can only be used when the post type supports templates (like posts and pages).
312
+ * @param {Object} [props.settings] The settings object to use for the editor.
313
+ * This is optional and can be used to override the default settings.
314
+ * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply.
315
+ * This is optional.
308
316
  *
309
317
  * @example
310
318
  * ```jsx
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","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","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","hasLoadedPostObject","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","postTypeObject","getPostType","_hasLoadedPostObject","hasFinishedResolution","default_rendering_mode","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","includes","postId","templateSlug","undefined","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","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 {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} 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_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 = mode === 'template-locked' ? 'template' : 'post';\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 hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t\thasLoadedPostObject,\n\t\t} = 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\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst postTypeObject = select( coreStore ).getPostType(\n\t\t\t\t\tpost.type\n\t\t\t\t);\n\n\t\t\t\tconst _hasLoadedPostObject = select(\n\t\t\t\t\tcoreStore\n\t\t\t\t).hasFinishedResolution( 'getPostType', [ post.type ] );\n\n\t\t\t\treturn {\n\t\t\t\t\thasLoadedPostObject: _hasLoadedPostObject,\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\tdefaultMode:\n\t\t\t\t\t\thasTemplate && postTypeObject?.default_rendering_mode\n\t\t\t\t\t\t\t? postTypeObject?.default_rendering_mode\n\t\t\t\t\t\t\t: 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\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// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\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\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\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\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\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( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode || ! hasLoadedPostObject ) {\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.isPreviewMode && (\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 {React.ReactNode} 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,oBAAo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AoB,IAAE,CAAC,eACxBU,IAAA,CAACT,gBAAgB,IAAE,CAAC,eACpBS,IAAA,CAACN,oBAAoB,IAAE,CAAC,eACxBM,IAAA,CAACJ,kBAAkB,IAAE,CAAC,eACtBI,IAAA,CAACH,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,SAASyF,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACCvF,IAAA,CAAC2B,0BAA0B;IAAA,GACrB4D,KAAK;IACVvD,4BAA4B,EAAGzD,mBAAqB;IAAAwD,QAAA,EAElDwD,KAAK,CAACxD;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAeuD,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","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","RENDERING_MODES","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","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","getPostType","hasFinishedResolution","postTypeSupports","supports","hasLoadedPostObject","_defaultMode","Array","isArray","editor","find","features","undefined","hasDefaultMode","includes","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","postId","templateSlug","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","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 {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} 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_navigation',\n\t'wp_template_part',\n];\n\n/**\n * These are rendering modes that the editor supports.\n */\nconst RENDERING_MODES = [ 'post-only', 'template-locked' ];\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 = mode === 'template-locked' ? 'template' : 'post';\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 hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = 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\tconst {\n\t\t\t\t\tgetEntitiesConfig,\n\t\t\t\t\tgetPostType,\n\t\t\t\t\thasFinishedResolution,\n\t\t\t\t} = select( coreStore );\n\n\t\t\t\tconst postTypeSupports = getPostType( post.type )?.supports;\n\t\t\t\tconst hasLoadedPostObject = hasFinishedResolution(\n\t\t\t\t\t'getPostType',\n\t\t\t\t\t[ post.type ]\n\t\t\t\t);\n\n\t\t\t\tconst _defaultMode = Array.isArray( postTypeSupports?.editor )\n\t\t\t\t\t? postTypeSupports.editor.find(\n\t\t\t\t\t\t\t( features ) => 'default-mode' in features\n\t\t\t\t\t )?.[ 'default-mode' ]\n\t\t\t\t\t: undefined;\n\t\t\t\tconst hasDefaultMode = RENDERING_MODES.includes( _defaultMode );\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady() && hasLoadedPostObject,\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\thasTemplate && hasDefaultMode\n\t\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t\t: 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\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// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\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\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\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\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\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( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\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.isPreviewMode && (\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 {React.ReactNode} [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 {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorPro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A;YAAA8B,QAAA,gBACChC,IAAA,CAACM,iBAAiB,IAAE,CAAC,eACrBN,IAAA,CAACF,qBAAqB,IAAE,CAAC,eACzBE,IAAA,CAACP,uBAAuB,IAAE,CAAC,EACzBoB,IAAI,KAAK,iBAAiB,iBAC3Bb,IAAA,CAACd,2BAA2B,IAAE,CAC9B,EACCgC,IAAI,KAAK,eAAe,iBACzBlB,IAAA,CAACb,0BAA0B,IAAE,CAC7B,eACDa,IAAA,CAACL,uBAAuB,IAAE,CAAC,eAC3BK,IAAA,CAACR,yBAAyB,IAAE,CAAC,eAC7BQ,IAAA,CAACV,oBAAoB,IAAE,CAAC,eACxBU,IAAA,CAACT,gBAAgB,IAAE,CAAC,eACpBS,IAAA,CAACN,oBAAoB,IAAE,CAAC,eACxBM,IAAA,CAACJ,kBAAkB,IAAE,CAAC,eACtBI,IAAA,CAACH,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,SAASgG,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACC9F,IAAA,CAAC4B,0BAA0B;IAAA,GACrBkE,KAAK;IACV7D,4BAA4B,EAAG1D,mBAAqB;IAAAyD,QAAA,EAElD8D,KAAK,CAAC9D;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAe6D,cAAc","ignoreList":[]}
@@ -43,7 +43,7 @@ export default function PostSummary({
43
43
  postType,
44
44
  postId
45
45
  } = useSelect(select => {
46
- // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
46
+ // We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do
47
47
  // not use isEditorPanelEnabled since this panel should not be disabled through the UI.
48
48
  const {
49
49
  isEditorPanelRemoved,
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalVStack","VStack","useSelect","PluginPostStatusInfo","PostAuthorPanel","PostCardPanel","PostContentInformation","PageAttributesPanel","PostDiscussionPanel","PrivatePostExcerptPanel","PostExcerptPanel","PostFeaturedImagePanel","PostFormatPanel","PostLastEditedPanel","PostPanelSection","PostSchedulePanel","PostStatusPanel","PostSyncStatus","PostTemplatePanel","PostURLPanel","BlogTitle","PostsPerPage","SiteDiscussion","store","editorStore","PrivatePostLastRevision","PostTrash","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PANEL_NAME","PostSummary","onActionPerformed","isRemovedPostStatusPanel","postType","postId","select","isEditorPanelRemoved","getCurrentPostType","getCurrentPostId","className","children","Slot","fills","spacing","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 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 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 { PrivatePostLastRevision } from '../post-last-revision';\nimport PostTrash from '../post-trash';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel, postType, postId } = useSelect(\n\t\t( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t};\n\t\t},\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\tpostType={ postType }\n\t\t\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\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{ fills }\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<PostTrash\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</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,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;AAClD,OAAOC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;QAAA,CACM;MAAC,CACR;IACF,CACyB;EAAC,CACX,CAAC;AAErB","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalVStack","VStack","useSelect","PluginPostStatusInfo","PostAuthorPanel","PostCardPanel","PostContentInformation","PageAttributesPanel","PostDiscussionPanel","PrivatePostExcerptPanel","PostExcerptPanel","PostFeaturedImagePanel","PostFormatPanel","PostLastEditedPanel","PostPanelSection","PostSchedulePanel","PostStatusPanel","PostSyncStatus","PostTemplatePanel","PostURLPanel","BlogTitle","PostsPerPage","SiteDiscussion","store","editorStore","PrivatePostLastRevision","PostTrash","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PANEL_NAME","PostSummary","onActionPerformed","isRemovedPostStatusPanel","postType","postId","select","isEditorPanelRemoved","getCurrentPostType","getCurrentPostId","className","children","Slot","fills","spacing","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 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 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 { PrivatePostLastRevision } from '../post-last-revision';\nimport PostTrash from '../post-trash';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel, postType, postId } = useSelect(\n\t\t( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t};\n\t\t},\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\tpostType={ postType }\n\t\t\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\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{ fills }\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<PostTrash\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</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,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,OAA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A;YAAmB,CACvC,CAAC;UAAA,CACK,CACR;QAAA,CACM;MAAC,CACR;IACF,CACyB;EAAC,CACX,CAAC;AAErB","ignoreList":[]}
@@ -13,11 +13,9 @@ import { store as editorStore } from '../../store';
13
13
  export default function StartPageOptions() {
14
14
  const {
15
15
  postId,
16
- shouldEnable
16
+ enabled
17
17
  } = useSelect(select => {
18
18
  const {
19
- isEditedPostDirty,
20
- isEditedPostEmpty,
21
19
  getCurrentPostId,
22
20
  getCurrentPostType
23
21
  } = select(editorStore);
@@ -25,20 +23,31 @@ export default function StartPageOptions() {
25
23
  const choosePatternModalEnabled = select(preferencesStore).get('core', 'enableChoosePatternModal');
26
24
  return {
27
25
  postId: getCurrentPostId(),
28
- shouldEnable: choosePatternModalEnabled && !preferencesModalActive && !isEditedPostDirty() && isEditedPostEmpty() && 'page' === getCurrentPostType()
26
+ enabled: choosePatternModalEnabled && !preferencesModalActive && 'page' === getCurrentPostType()
29
27
  };
30
28
  }, []);
29
+ const {
30
+ isEditedPostDirty,
31
+ isEditedPostEmpty
32
+ } = useSelect(editorStore);
31
33
  const {
32
34
  setIsInserterOpened
33
35
  } = useDispatch(editorStore);
34
36
  useEffect(() => {
35
- if (shouldEnable) {
37
+ if (!enabled) {
38
+ return;
39
+ }
40
+ const isFreshPage = !isEditedPostDirty() && isEditedPostEmpty();
41
+ if (isFreshPage) {
36
42
  setIsInserterOpened({
37
43
  tab: 'patterns',
38
44
  category: 'core/starter-content'
39
45
  });
40
46
  }
41
- }, [postId, shouldEnable, setIsInserterOpened]);
47
+
48
+ // Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.
49
+ // Examples: changing pages in the List View, creating a new page via Command Palette.
50
+ }, [postId, enabled, setIsInserterOpened, isEditedPostDirty, isEditedPostEmpty]);
42
51
  return null;
43
52
  }
44
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useSelect","useDispatch","store","preferencesStore","interfaceStore","editorStore","StartPageOptions","postId","shouldEnable","select","isEditedPostDirty","isEditedPostEmpty","getCurrentPostId","getCurrentPostType","preferencesModalActive","isModalActive","choosePatternModalEnabled","get","setIsInserterOpened","tab","category"],"sources":["@wordpress/editor/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function StartPageOptions() {\n\tconst { postId, shouldEnable } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostEmpty,\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t} = select( editorStore );\n\t\tconst preferencesModalActive =\n\t\t\tselect( interfaceStore ).isModalActive( 'editor/preferences' );\n\t\tconst choosePatternModalEnabled = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'enableChoosePatternModal'\n\t\t);\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tshouldEnable:\n\t\t\t\tchoosePatternModalEnabled &&\n\t\t\t\t! preferencesModalActive &&\n\t\t\t\t! isEditedPostDirty() &&\n\t\t\t\tisEditedPostEmpty() &&\n\t\t\t\t'page' === getCurrentPostType(),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tif ( shouldEnable ) {\n\t\t\tsetIsInserterOpened( {\n\t\t\t\ttab: 'patterns',\n\t\t\t\tcategory: 'core/starter-content',\n\t\t\t} );\n\t\t}\n\t}, [ postId, shouldEnable, setIsInserterOpened ] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,MAAM;IAAEC;EAAa,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IACzD,MAAM;MACLC,iBAAiB;MACjBC,iBAAiB;MACjBC,gBAAgB;MAChBC;IACD,CAAC,GAAGJ,MAAM,CAAEJ,WAAY,CAAC;IACzB,MAAMS,sBAAsB,GAC3BL,MAAM,CAAEL,cAAe,CAAC,CAACW,aAAa,CAAE,oBAAqB,CAAC;IAC/D,MAAMC,yBAAyB,GAAGP,MAAM,CAAEN,gBAAiB,CAAC,CAACc,GAAG,CAC/D,MAAM,EACN,0BACD,CAAC;IACD,OAAO;MACNV,MAAM,EAAEK,gBAAgB,CAAC,CAAC;MAC1BJ,YAAY,EACXQ,yBAAyB,IACzB,CAAEF,sBAAsB,IACxB,CAAEJ,iBAAiB,CAAC,CAAC,IACrBC,iBAAiB,CAAC,CAAC,IACnB,MAAM,KAAKE,kBAAkB,CAAC;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEK;EAAoB,CAAC,GAAGjB,WAAW,CAAEI,WAAY,CAAC;EAE1DN,SAAS,CAAE,MAAM;IAChB,IAAKS,YAAY,EAAG;MACnBU,mBAAmB,CAAE;QACpBC,GAAG,EAAE,UAAU;QACfC,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ;EACD,CAAC,EAAE,CAAEb,MAAM,EAAEC,YAAY,EAAEU,mBAAmB,CAAG,CAAC;EAElD,OAAO,IAAI;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useSelect","useDispatch","store","preferencesStore","interfaceStore","editorStore","StartPageOptions","postId","enabled","select","getCurrentPostId","getCurrentPostType","preferencesModalActive","isModalActive","choosePatternModalEnabled","get","isEditedPostDirty","isEditedPostEmpty","setIsInserterOpened","isFreshPage","tab","category"],"sources":["@wordpress/editor/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function StartPageOptions() {\n\tconst { postId, enabled } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst preferencesModalActive =\n\t\t\tselect( interfaceStore ).isModalActive( 'editor/preferences' );\n\t\tconst choosePatternModalEnabled = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'enableChoosePatternModal'\n\t\t);\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tenabled:\n\t\t\t\tchoosePatternModalEnabled &&\n\t\t\t\t! preferencesModalActive &&\n\t\t\t\t'page' === getCurrentPostType(),\n\t\t};\n\t}, [] );\n\tconst { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();\n\t\tif ( isFreshPage ) {\n\t\t\tsetIsInserterOpened( {\n\t\t\t\ttab: 'patterns',\n\t\t\t\tcategory: 'core/starter-content',\n\t\t\t} );\n\t\t}\n\n\t\t// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.\n\t\t// Examples: changing pages in the List View, creating a new page via Command Palette.\n\t}, [\n\t\tpostId,\n\t\tenabled,\n\t\tsetIsInserterOpened,\n\t\tisEditedPostDirty,\n\t\tisEditedPostEmpty,\n\t] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,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AM,EACNC,OAAO,EACPU,mBAAmB,EACnBF,iBAAiB,EACjBC,iBAAiB,CAChB,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -13,11 +13,11 @@ import { store as editorStore } from '../../store';
13
13
  /**
14
14
  * Checks if the current theme supports specific features and renders the children if supported.
15
15
  *
16
- * @param {Object} props The component props.
17
- * @param {React.ReactElement} props.children The children to render if the theme supports the specified features.
18
- * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
16
+ * @param {Object} props The component props.
17
+ * @param {React.ReactNode} props.children The children to render if the theme supports the specified features.
18
+ * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
19
19
  *
20
- * @return {React.ReactElement} The rendered children if the theme supports the specified features, otherwise null.
20
+ * @return {React.ReactNode} The rendered children if the theme supports the specified features, otherwise null.
21
21
  */
22
22
  export default function ThemeSupportCheck({
23
23
  children,
@@ -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\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 {React.ReactElement} 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 {React.ReactElement} 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":[]}
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 {React.ReactNode} 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 {React.ReactNode} 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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import { store as editorStore } from '../../store';
19
19
  * user is focusing on editing page content and clicks on a disabled template
20
20
  * block.
21
21
  * - Displays a 'Edit your template to edit this block' dialog when the user
22
- * is focusing on editing page conetnt and double clicks on a disabled
22
+ * is focusing on editing page content and double clicks on a disabled
23
23
  * template block.
24
24
  *
25
25
  * @param {Object} props
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","useEffect","useState","__","__experimentalConfirmDialog","ConfirmDialog","editorStore","jsx","_jsx","EditTemplateBlocksNotification","contentRef","onNavigateToEntityRecord","templateId","select","getEditorSettings","getCurrentTemplateId","canEditTemplate","canUser","kind","name","isDialogOpen","setIsDialogOpen","handleDblClick","event","target","classList","contains","dataset","type","defaultPrevented","preventDefault","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\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t[]\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 (\n\t\t\t\t! event.target.classList.contains( 'is-root-container' ) ||\n\t\t\t\tevent.target.dataset?.type === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsDialogOpen( true );\n\t\t\t}\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,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AAO,EAAEC,IAAI,KAAK,oBAAoB,EAClD;QACD;MACD;MAEA,IAAK,CAAEL,KAAK,CAACM,gBAAgB,EAAG;QAC/BN,KAAK,CAACO,cAAc,CAAC,CAAC;QACtBT,eAAe,CAAE,IAAK,CAAC;MACxB;IACD,CAAC;IAED,MAAMU,MAAM,GAAGrB,UAAU,CAACsB,OAAO;IACjCD,MAAM,EAAEE,gBAAgB,CAAE,UAAU,EAAEX,cAAe,CAAC;IACtD,OAAO,MAAM;MACZS,MAAM,EAAEG,mBAAmB,CAAE,UAAU,EAAEZ,cAAe,CAAC;IAC1D,CAAC;EACF,CAAC,EAAE,CAAEZ,UAAU,EAAEM,eAAe,CAAG,CAAC;EAEpC,IAAK,CAAEA,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACCR,IAAA,CAACH,aAAa;IACb8B,MAAM,EAAGf,YAAc;IACvBgB,iBAAiB,EAAGjC,EAAE,CAAE,eAAgB,CAAG;IAC3CkC,SAAS,EAAGA,CAAA,KAAM;MACjBhB,eAAe,CAAE,KAAM,CAAC;MACxBV,wBAAwB,CAAE;QACzB2B,MAAM,EAAE1B,UAAU;QAClB2B,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ,CAAG;IACHC,QAAQ,EAAGA,CAAA,KAAMnB,eAAe,CAAE,KAAM,CAAG;IAC3CoB,IAAI,EAAC,QAAQ;IAAAC,QAAA,EAEXvC,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","canUser","kind","name","isDialogOpen","setIsDialogOpen","handleDblClick","event","target","classList","contains","dataset","type","defaultPrevented","preventDefault","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 content 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\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t[]\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 (\n\t\t\t\t! event.target.classList.contains( 'is-root-container' ) ||\n\t\t\t\tevent.target.dataset?.type === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsDialogOpen( true );\n\t\t\t}\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;MAAE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a;IACb8B,MAAM,EAAGf,YAAc;IACvBgB,iBAAiB,EAAGjC,EAAE,CAAE,eAAgB,CAAG;IAC3CkC,SAAS,EAAGA,CAAA,KAAM;MACjBhB,eAAe,CAAE,KAAM,CAAC;MACxBV,wBAAwB,CAAE;QACzB2B,MAAM,EAAE1B,UAAU;QAClB2B,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ,CAAG;IACHC,QAAQ,EAAGA,CAAA,KAAMnB,eAAe,CAAE,KAAM,CAAG;IAC3CoB,IAAI,EAAC,QAAQ;IAAAC,QAAA,EAEXvC,EAAE,CACH,6IACD;EAAC,CACa,CAAC;AAElB","ignoreList":[]}
@@ -253,7 +253,7 @@ function VisualEditor({
253
253
  !isPreview &&
254
254
  // Disable resizing in mobile viewport.
255
255
  !isMobileViewport &&
256
- // Dsiable resizing in zoomed-out mode.
256
+ // Disable resizing in zoomed-out mode.
257
257
  !isZoomedOut;
258
258
  const iframeStyles = useMemo(() => {
259
259
  return [...(styles !== null && styles !== void 0 ? styles : []), {
@@ -315,7 +315,7 @@ function VisualEditor({
315
315
  })]
316
316
  }), renderingMode === 'post-only' && !isDesignPostType && /*#__PURE__*/_jsx("div", {
317
317
  className: clsx('editor-visual-editor__post-title-wrapper',
318
- // The following class is only here for backward comapatibility
318
+ // The following class is only here for backward compatibility
319
319
  // some themes might be using it to style the post title.
320
320
  'edit-post-visual-editor__post-title-wrapper', {
321
321
  'has-global-padding': hasRootPaddingAwareAlignments
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","BlockList","store","blockEditorStore","__unstableUseTypewriter","useTypewriter","__unstableUseTypingObserver","useTypingObserver","useSettings","RecursionProvider","privateApis","blockEditorPrivateApis","__experimentalUseResizeCanvas","useResizeCanvas","useEffect","useRef","useMemo","useState","useSelect","parse","coreStore","useMergeRefs","useViewportMatch","useResizeObserver","PostTitle","editorStore","unlock","EditTemplateBlocksNotification","ResizableEditor","useSelectNearestEditableBlock","NAVIGATION_POST_TYPE","PATTERN_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","useZoomOutModeExit","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","DESIGN_POST_TYPES","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","VisualEditor","autoFocus","styles","disableIframe","iframeProps","contentRef","className","contentHeight","setContentHeight","effectContentHeight","entry","borderBoxSize","blockSize","isMobileViewport","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","isFocusedEntity","isDesignPostType","postType","isPreview","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","getPostType","getEditedEntityRecord","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postTypeObject","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","isPreviewMode","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","isZoomedOut","getSettings","isZoomOut","_isZoomOut","_settings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","globalLayoutSettings","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","titleRef","current","focus","alignCSS","forceFullHeight","enableResizing","iframeStyles","css","localRef","typewriterRef","isEnabled","children","height","shouldIframe","style","selector","contentEditable","ref","marginTop","blockName","uniqueId","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone"],"sources":["@wordpress/editor/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseMergeRefs,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst [ contentHeight, setContentHeight ] = useState( '' );\n\tconst effectContentHeight = useResizeObserver( ( [ entry ] ) => {\n\t\tsetContentHeight( entry.borderBoxSize[ 0 ].blockSize );\n\t} );\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable && supportsTemplateMode\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.isPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst forceFullHeight = postType === NAVIGATION_POST_TYPE;\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Dsiable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\t// Ensures margins of children are contained so that the body background paints behind them.\n\t\t\t\t// Otherwise, the background of html (when zoomed out) would show there and appear broken. It’s\n\t\t\t\t// important mostly for post-only views yet conceivably an issue in templated views too.\n\t\t\t\tcss: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}`,\n\t\t\t},\n\t\t];\n\t}, [ styles, enableResizing ] );\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseZoomOutModeExit(),\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width.\n\t\tenableResizing ? effectContentHeight : null,\n\t] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': ! disableIframe,\n\t\t\t\t\t'is-scrollable': disableIframe || deviceType !== 'Desktop',\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<ResizableEditor\n\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\theight={\n\t\t\t\t\tcontentHeight && ! forceFullHeight ? contentHeight : '100%'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ ! disableIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\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) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content`, // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t\t\t\t\t! isDesignPostType &&\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,SAAS,EACTC,KAAK,IAAIC,gBAAgB,EACzBC,uBAAuB,IAAIC,aAAa,EACxCC,2BAA2B,IAAIC,iBAAiB,EAChDC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,IAAIC,sBAAsB,EACrCC,6BAA6B,IAAIC,eAAe,QAC1C,yBAAyB;AAChC,SAASC,SAAS,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACzE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASjB,KAAK,IAAIkB,SAAS,QAAQ,sBAAsB;AACzD,SACCC,YAAY,EACZC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,SAAStB,KAAK,IAAIuB,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,8BAA8B,MAAM,qCAAqC;AAChF,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,6BAA6B,MAAM,qCAAqC;AAC/E,SACCC,oBAAoB,EACpBC,iBAAiB,EACjBC,uBAAuB,EACvBC,kBAAkB,QACZ,uBA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,wBAAyB;YAAE;YACtD;cACC,oBAAoB,EACnBxD,aAAa,KAAK,WAAW,IAC7B,CAAEO,gBAAgB,IAClB0B;YACF,CACD,CAAG;YACHoB,MAAM,EAAGS,eAAiB;YAC1ByB,eAAe;YACd;YACA;YACAlG,aAAa,GACVoF,QAAQ,CAACP,OAAO,GAChBO,QAAQ,CAACP,OAAO,EAAEsB,UACrB;YACDC,yBAAyB;YACxB;YACAzF,aAAa,KAAK,iBAAiB,GAChC,IAAI,GACJ;UACH,CACD,CAAC,EACAA,aAAa,KAAK,iBAAiB,iBACpCnC,IAAA,CAACT,8BAA8B;YAC9BmC,UAAU,EAAGkF;UAAU,CACvB,CACD;QAAA,CACiB,CAAC;MAAA,CACR;IAAC,CACE;EAAC,CACd,CAAC;AAER;AAEA,eAAevF,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["clsx","BlockList","store","blockEditorStore","__unstableUseTypewriter","useTypewriter","__unstableUseTypingObserver","useTypingObserver","useSettings","RecursionProvider","privateApis","blockEditorPrivateApis","__experimentalUseResizeCanvas","useResizeCanvas","useEffect","useRef","useMemo","useState","useSelect","parse","coreStore","useMergeRefs","useViewportMatch","useResizeObserver","PostTitle","editorStore","unlock","EditTemplateBlocksNotification","ResizableEditor","useSelectNearestEditableBlock","NAVIGATION_POST_TYPE","PATTERN_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","useZoomOutModeExit","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","DESIGN_POST_TYPES","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","VisualEditor","autoFocus","styles","disableIframe","iframeProps","contentRef","className","contentHeight","setContentHeight","effectContentHeight","entry","borderBoxSize","blockSize","isMobileViewport","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","isFocusedEntity","isDesignPostType","postType","isPreview","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","getPostType","getEditedEntityRecord","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postTypeObject","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","isPreviewMode","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","isZoomedOut","getSettings","isZoomOut","_isZoomOut","_settings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","globalLayoutSettings","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","titleRef","current","focus","alignCSS","forceFullHeight","enableResizing","iframeStyles","css","localRef","typewriterRef","isEnabled","children","height","shouldIframe","style","selector","contentEditable","ref","marginTop","blockName","uniqueId","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone"],"sources":["@wordpress/editor/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseMergeRefs,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst [ contentHeight, setContentHeight ] = useState( '' );\n\tconst effectContentHeight = useResizeObserver( ( [ entry ] ) => {\n\t\tsetContentHeight( entry.borderBoxSize[ 0 ].blockSize );\n\t} );\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable && supportsTemplateMode\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.isPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst forceFullHeight = postType === NAVIGATION_POST_TYPE;\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Disable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\t// Ensures margins of children are contained so that the body background paints behind them.\n\t\t\t\t// Otherwise, the background of html (when zoomed out) would show there and appear broken. It’s\n\t\t\t\t// important mostly for post-only views yet conceivably an issue in templated views too.\n\t\t\t\tcss: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}`,\n\t\t\t},\n\t\t];\n\t}, [ styles, enableResizing ] );\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseZoomOutModeExit(),\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width.\n\t\tenableResizing ? effectContentHeight : null,\n\t] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': ! disableIframe,\n\t\t\t\t\t'is-scrollable': disableIframe || deviceType !== 'Desktop',\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<ResizableEditor\n\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\theight={\n\t\t\t\t\tcontentHeight && ! forceFullHeight ? contentHeight : '100%'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ ! disableIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\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) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward compatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content`, // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t\t\t\t\t! isDesignPostType &&\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],"mappings":"AAAA;AACA;AACA;A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